You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__HttpStatus__HpcCourse.0d...

3370 lines
1.5 MiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

!(function(){var Ys=Math.pow;var zl=(kn,dn,de)=>new Promise((pe,ut)=>{var $e=Pe=>{try{Se(de.next(Pe))}catch(Ne){ut(Ne)}},ct=Pe=>{try{Se(de.throw(Pe))}catch(Ne){ut(Ne)}},Se=Pe=>Pe.done?pe(Pe.value):Promise.resolve(Pe.value).then($e,ct);Se((de=de.apply(kn,dn)).next())});(self.webpackChunk=self.webpackChunk||[]).push([[4496],{40001:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return Ce}});var pe=de(60499),ut=de(59301),$e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},ct=$e,Se=de(7657),Pe=function(Fe,gt){return ut.createElement(Se.Z,(0,pe.Z)({},Fe,{ref:gt,icon:ct}))},Ne=ut.forwardRef(Pe),Ce=Ne},26227:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return Ce}});var pe=de(60499),ut=de(59301),$e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},ct=$e,Se=de(7657),Pe=function(Fe,gt){return ut.createElement(Se.Z,(0,pe.Z)({},Fe,{ref:gt,icon:ct}))},Ne=ut.forwardRef(Pe),Ce=Ne},84105:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return Ce}});var pe=de(60499),ut=de(59301),$e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},ct=$e,Se=de(7657),Pe=function(Fe,gt){return ut.createElement(Se.Z,(0,pe.Z)({},Fe,{ref:gt,icon:ct}))},Ne=ut.forwardRef(Pe),Ce=Ne},41464:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return Ce}});var pe=de(60499),ut=de(59301),$e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},ct=$e,Se=de(7657),Pe=function(Fe,gt){return ut.createElement(Se.Z,(0,pe.Z)({},Fe,{ref:gt,icon:ct}))},Ne=ut.forwardRef(Pe),Ce=Ne},18785:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return Ce}});var pe=de(60499),ut=de(59301),$e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},ct=$e,Se=de(7657),Pe=function(Fe,gt){return ut.createElement(Se.Z,(0,pe.Z)({},Fe,{ref:gt,icon:ct}))},Ne=ut.forwardRef(Pe),Ce=Ne},73331:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return Ce}});var pe=de(60499),ut=de(59301),$e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},ct=$e,Se=de(7657),Pe=function(Fe,gt){return ut.createElement(Se.Z,(0,pe.Z)({},Fe,{ref:gt,icon:ct}))},Ne=ut.forwardRef(Pe),Ce=Ne},15277:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return Ce}});var pe=de(60499),ut=de(59301),$e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},ct=$e,Se=de(7657),Pe=function(Fe,gt){return ut.createElement(Se.Z,(0,pe.Z)({},Fe,{ref:gt,icon:ct}))},Ne=ut.forwardRef(Pe),Ce=Ne},62772:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return Ce}});var pe=de(60499),ut=de(59301),$e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},ct=$e,Se=de(7657),Pe=function(Fe,gt){return ut.createElement(Se.Z,(0,pe.Z)({},Fe,{ref:gt,icon:ct}))},Ne=ut.forwardRef(Pe),Ce=Ne},61485:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return Ce}});var pe=de(60499),ut=de(59301),$e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"},ct=$e,Se=de(7657),Pe=function(Fe,gt){return ut.createElement(Se.Z,(0,pe.Z)({},Fe,{ref:gt,icon:ct}))},Ne=ut.forwardRef(Pe),Ce=Ne},47472:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return Ce}});var pe=de(60499),ut=de(59301),$e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},ct=$e,Se=de(7657),Pe=function(Fe,gt){return ut.createElement(Se.Z,(0,pe.Z)({},Fe,{ref:gt,icon:ct}))},Ne=ut.forwardRef(Pe),Ce=Ne},87395:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return Ce}});var pe=de(60499),ut=de(59301),$e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},ct=$e,Se=de(7657),Pe=function(Fe,gt){return ut.createElement(Se.Z,(0,pe.Z)({},Fe,{ref:gt,icon:ct}))},Ne=ut.forwardRef(Pe),Ce=Ne},42741:function(){"use strict"},27494:function(){"use strict"},14973:function(kn,dn){"use strict";dn.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},13547:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;(function(){if(typeof window.GGBApplet=="function"){console.warn("deployggb.js was loaded twice");return}var isRenderGGBElementEnabled=!1,scriptLoadStarted=!1,html5AppletsToProcess=null,ggbHTML5LoadedCodebaseIsWebSimple=!1,ggbHTML5LoadedCodebaseVersion=null,ggbHTML5LoadedScript=null,GGBApplet=function(){"use strict";for(var kn={},dn="5.0",de={},pe=null,ut=!1,$e=!1,ct=null,Se=!1,Pe=null,Ne=null,Ce=0;Ce<arguments.length;Ce++){var ke=arguments[Ce];if(ke!==null)switch(typeof ke){case"number":dn=ke.toFixed(1);break;case"string":ke.match(new RegExp("^[0-9]\\.[0-9]+$"))?dn=ke:ct=ke;break;case"object":typeof ke.is3D!="undefined"?pe=ke:de=ke;break;case"boolean":ut=ke,$e=!0;break}}pe===null&&(pe={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},de.material_id!==void 0&&!$e&&(ut=!0)),ct!==null&&de.id===void 0&&(de.id=ct);var Fe="",gt="",Oe=!1,je=null,kt=null,et=null,mt=!1,st=null,Rt=null,tn=null,nt=null,ht=null;de.height!==void 0&&(de.height=Math.round(de.height)),de.width!==void 0&&(de.width=Math.round(de.width));var Ve=function(Ge){return parseFloat(Ge)>4?parseFloat(Ge):5};kn.setHTML5Codebase=function(Ge,Ye){Ne=Ge,bt(Ge,Ye)},kn.setJavaCodebase=kn.setJavaCodebaseVersion=kn.isCompiledInstalled=kn.setPreCompiledScriptPath=kn.setPreCompiledResourcePath=function(){},kn.setHTML5CodebaseVersion=function(Ge,Ye){var It=parseFloat(Ge);if(It!==NaN&&It<5){console.log("The GeoGebra HTML5 codebase version "+It+" is deprecated. Using version latest instead.");return}Pe=Ge,xe(Ge,Ye)},kn.getHTML5CodebaseVersion=function(){return kt},kn.getParameters=function(){return de},kn.setFontsCSSURL=function(Ge){nt=Ge},kn.setGiacJSURL=function(Ge){},kn.setJNLPFile=function(Ge){Fe=Ge},kn.setJNLPBaseDir=function(Ge){},kn.inject=function(){function Ge(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var Ye="auto",It=de.id,Mn,jt=!1,bn=0;bn<arguments.length;bn++){var Vt=arguments[bn];typeof Vt=="string"?(Vt=Vt.toLowerCase(),Vt.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?Ye=Vt:It=arguments[bn]):typeof Vt=="boolean"?jt=Vt:Vt instanceof HTMLElement&&(Mn=Vt)}Zt();function Zt(){if(!Se){setTimeout(Zt,200);return}Ye=Wt(Ye);var zt=Mn||document.getElementById(It);if(!zt){console.log("possibly bug on ajax loading? ");return}if(kn.removeExistingApplet(zt,!1),de.width===void 0&&zt.clientWidth&&(de.width=zt.clientWidth),de.height===void 0&&zt.clientHeight&&(de.height=zt.clientHeight),!(de.width&&de.height)&&Ye==="html5"&&(delete de.width,delete de.height),je=Ye,Ye==="screenshot")qe(zt,de);else{var ve=!1;de.hasOwnProperty("playButton")&&de.playButton||de.hasOwnProperty("clickToLoad")&&de.clickToLoad?ve=!0:de.hasOwnProperty("playButtonAutoDecide")&&de.playButtonAutoDecide&&(ve=(!Ee()||Ge())&&Xe()),ve?(je="screenshot",cn(zt,de,jt,Ye)):At(zt,de,jt)}}};function Ee(){try{return window.self!==window.top}catch(Ge){return!0}}function Xe(){return de.hasOwnProperty("screenshotGenerator")&&de.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}kn.getViews=function(){return pe},kn.isJavaInstalled=function(){return!1};var at=function(Ge){var Ye=function(bn){var Vt=JSON.parse(bn),Zt=function(se){return se.type=="G"||se.type=="E"},zt=Vt.elements?Vt.elements.filter(Zt)[0]:Vt;if(!zt||!zt.url){It();return}de.fileName=zt.url,vt(zt.settings||{}),pe.is3D=!0;var ve="https://www.geogebra.org/images/";kn.setPreviewImage(st||zt.previewUrl,ve+"GeoGebra_loading.png",ve+"applet_play.png"),Ge()},It=function(){de.onError&&de.onError(),pn("Error: Fetching material (id "+de.material_id+") failed.",de)},Mn=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",jt="/materials/"+de.material_id+"?scope=basic";Ue("https://"+Mn+"/api/proxy.php?path="+encodeURIComponent(jt),Ye,It)};function vt(Ge){var Ye=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(It){Ge[It]=!!Ge[It]}),Ye.forEach(function(It){de[It]===void 0&&Ge[It]!==void 0&&(de[It]=Ge[It])}),de.showToolBarHelp===void 0&&(de.showToolBarHelp=de.showToolBar)}function Ue(Ge,Ye,It){var Mn=new XMLHttpRequest;Mn.open("GET",Ge),Mn.onload=function(){Ye(Mn.responseText)},Mn.onerror=It,Mn.send()}kn.isHTML5Installed=function(){return!0},kn.getLoadedAppletType=function(){return je},kn.setPreviewImage=function(Ge,Ye,It){st=Ge,Rt=Ye,tn=It},kn.removeExistingApplet=function(Ge,Ye){var It;typeof Ge=="string"&&(Ge=document.getElementById(Ge)),je=null;var Mn=null;for(It=0;It<Ge.childNodes.length;It++){var jt=Ge.childNodes[It],bn=jt.className;bn==="applet_screenshot"?Ye?(jt.style.display="block",je="screenshot"):jt.style.display="none":bn!=="applet_scaler prerender"&&(Ge.removeChild(jt),Mn=bn&&bn.indexOf("appletParameters")!=-1?jt.id:null,It--)}var Vt=de.id!==void 0?de.id:Mn,Zt=window[Vt];Zt&&typeof Zt.getBase64=="function"&&(Zt.remove(),window[Vt]=null)},kn.refreshHitPoints=function(){if(Ve(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var Ge=kn.getAppletObject();return Ge&&typeof Ge.recalculateEnvironments=="function"?(Ge.recalculateEnvironments(),!0):!1},kn.startAnimation=function(){var Ge=kn.getAppletObject();return Ge&&typeof Ge.startAnimation=="function"?(Ge.startAnimation(),!0):!1},kn.stopAnimation=function(){var Ge=kn.getAppletObject();return Ge&&typeof Ge.stopAnimation=="function"?(Ge.stopAnimation(),!0):!1},kn.getAppletObject=function(){var Ge=de.id!==void 0?de.id:"ggbApplet";return window[Ge]},kn.resize=function(){};var Ot=function(Ge,Ye,It){var Mn=document.createElement("param");Mn.setAttribute("name",Ye),Mn.setAttribute("value",It),Ge.appendChild(Mn)},rt=function(Ge){return Ge&&Ge!=="false"},At=function(Ge,Ye,It){Ve(kt)<=4.2&&(It=!0);var Mn=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==kt||ggbHTML5LoadedCodebaseIsWebSimple&&!mt)&&(Mn=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var jt=document.createElement("div");jt.classList.add("appletParameters","notranslate");var bn=Ye.width,Vt=Ye.height;if(Ye.disableAutoScale=Ye.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():Ye.disableAutoScale,Ye.width!==void 0)if(Ve(kt)<=4.4)rt(Ye.showToolBar)&&(Ye.height-=7),rt(Ye.showAlgebraInput)&&(Ye.height-=37),Ye.width<605&&rt(Ye.showToolBar)&&(Ye.width=605,bn=605);else{var Zt=100;(rt(Ye.showToolBar)||rt(Ye.showMenuBar))&&(Ye.hasOwnProperty("customToolBar")&&(Ye.customToolbar=Ye.customToolBar),Zt=rt(Ye.showMenuBar)?245:155),bn<Zt&&(Ye.width=Zt,bn=Zt)}jt.style.border="none",jt.style.display="inline-block";for(var zt in Ye)Ye.hasOwnProperty(zt)&&zt!=="appletOnLoad"&&jt.setAttribute("data-param-"+zt,Ye[zt]);nt&&jt.setAttribute("data-param-fontscssurl",nt),kn.resize=function(){GGBAppletUtils.responsiveResize(Ge,Ye)},window.addEventListener("resize",function(wn){kn.resize()});var ve=typeof Ye.appletOnLoad=="function"?Ye.appletOnLoad:function(){};if(!It&&Ye.width!==void 0){Ye.hasOwnProperty("showSplash")||jt.setAttribute("data-param-showSplash","false");var se=Ge.querySelector(".applet_scaler.prerender"),oe=se!==null;if(oe)var fe=se.querySelector(".ggb_preview");else{var fe=Xt(bn,Vt,Ye.borderColor,!1);se=document.createElement("div"),se.className="applet_scaler",se.style.position="relative",se.style.display="block",se.style.width=bn+"px",se.style.height=Vt+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(se,"66%"),Ve(kt)>=5?(Ye.appletOnLoad=function(wn){var mn=Ge.querySelector(".ggb_preview");mn&&mn.parentNode.removeChild(mn),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(se),window.GGBT_wsf_view&&$(window).trigger("resize"),ve(wn)},oe||se.appendChild(fe)):jt.appendChild(fe),se.appendChild(jt),oe||Ge.appendChild(se),setTimeout(function(){kn.resize()},1)}else{var ye=document.createElement("div");ye.className="applet_scaler",ye.style.position="relative",ye.style.display="block",ye.appendChild(jt),Ge.appendChild(ye),Ye.appletOnLoad=function(wn){kn.resize(),ve(wn)}}function ce(wn,mn){mn&&typeof mn.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(wn,mn.appletOnLoad):renderGGBElement(wn),pn("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",mn)}function Ke(wn,mn){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:wn,params:mn}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(En){ce(En.article,En.params)}),html5AppletsToProcess=null)},Ve(kt)<5&&(wn.className+=" geogebraweb")):ce(wn,mn)}if(Mn){scriptLoadStarted=!0;for(var Dt=0;Dt<jt.childNodes.length;Dt++){var ln=jt.childNodes[Dt].tagName;ln==="TABLE"&&(jt.removeChild(jt.childNodes[Dt]),Dt--)}if(ggbHTML5LoadedScript!==null){var Jt=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');Jt!=null&&Jt.parentNode.removeChild(Jt)}var en=document.createElement("script"),nn=function(){Ke(jt,Ye)};en.src=gt+et,ggbHTML5LoadedCodebaseIsWebSimple=mt,ggbHTML5LoadedCodebaseVersion=kt,ggbHTML5LoadedScript=en.src,pn("GeoGebra HTML5 codebase loaded: '"+gt+"'.",Ye),!Ne&&(!Pe||Pe=="5.0")?(mt?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),nn()):gt.requirejs?__webpack_require__.e(8366).then(function(){var wn=[__webpack_require__(18366)];nn.apply(null,wn)}.bind(this)).catch(__webpack_require__.oe):(en.onload=nn,Ge.appendChild(en))}else Ke(jt,Ye);Ye.height=Vt,Ye.width=bn},qe=function(Ge,Ye,It){var Mn=Xt(Ye.width,Ye.height,Ye.borderColor,It),jt=document.createElement("div");jt.style.position="relative",jt.style.display="block",jt.style.width=Ye.width+"px",jt.style.height=Ye.height+"px",jt.className="applet_screenshot applet_scaler"+(It?" applet_screenshot_play":""),jt.appendChild(Mn);var bn=GGBAppletUtils.getScale(Ye,Ge,It);It?(Ge.appendChild(Kt()),window.GGBT_wsf_view||(Ge.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(jt,"66%"),Ge.appendChild(jt),bn!==1&&!isNaN(bn)&&(GGBAppletUtils.scaleElement(jt,bn),jt.style.width=Ye.width+"px",jt.style.height=Ye.height+"px",jt.parentNode.style.width=Ye.width*bn+"px",jt.parentNode.style.height=Ye.height*bn+"px"),kn.resize=function(){Ht(Ge,Mn,jt,It)},window.addEventListener("resize",function(Vt){kn.resize()}),kn.resize()};function Ht(Ge,Ye,It,Mn){if(Ge.contains(Ye)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Ge.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(Ge)}var jt=GGBAppletUtils.getScale(de,Ge,Mn);It.parentNode!==null&&(!isNaN(jt)&&jt!==1?(GGBAppletUtils.scaleElement(It,jt),It.parentNode.style.width=de.width*jt+"px",It.parentNode.style.height=de.height*jt+"px"):(GGBAppletUtils.scaleElement(It,1),It.parentNode.style.width=de.width+"px",It.parentNode.style.height=de.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(Ge),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}kn.onExitFullscreen=function(Ge,Ye){Ye.appendChild(Ge)};var cn=function(Ge,Ye,It,Mn){qe(Ge,Ye,!0);for(var jt=function(){var Zt=[];for(Vt=0;Vt<Ge.childNodes.length;Vt++)Zt.push(Ge.childNodes[Vt]);if(window.GGBT_wsf_view){var zt=window.GGBT_wsf_view.renderFullScreen(Ge,Ye.id),ve=document.getElementById("fullscreencontainer"),se=jQuery(Ge).find(".fullscreencontent");se.length>0?(zt.remove(),se.attr("id","fullscreencontent").show(),jQuery(ve).append(se),window.dispatchEvent(new Event("resize"))):At(zt,Ye,!1),window.GGBT_wsf_view.launchFullScreen(ve)}else je=Mn,At(Ge,Ye,!1);if(!window.GGBT_wsf_view)for(Vt=0;Vt<Zt.length;Vt++)Ge.removeChild(Zt[Vt])},bn=Ge.getElementsByClassName("ggb_preview_play"),Vt=0;Vt<bn.length;Vt++)bn[Vt].addEventListener("click",jt,!1),bn[Vt].addEventListener("ontouchstart",jt,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(Ge),Xe()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},Kt=function(){var Ge=document.createElement("div");if(Ge.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var Ye='.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");}',It=document.createElement("style");It.styleSheet?It.styleSheet.cssText=Ye:It.appendChild(document.createTextNode(Ye)),document.getElementsByTagName("head")[0].appendChild(It)}return Ge},Xt=function(Ge,Ye,It,Mn){var jt=document.createElement("div");jt.className="ggb_preview",jt.style.position="absolute",jt.style.zIndex="90",jt.style.width=Ge-2+"px",jt.style.height=Ye-2+"px",jt.style.top="0px",jt.style.left="0px",jt.style.overflow="hidden",jt.style.backgroundColor="white";var bn="lightgrey";It!==void 0&&(It==="none"?bn="transparent":bn=It),jt.style.border="1px solid "+bn;var Vt=document.createElement("img");if(Vt.style.position="relative",Vt.style.zIndex="1000",Vt.style.top="-1px",Vt.style.left="-1px",st!==null&&Vt.setAttribute("src",st),Vt.style.opacity=.7,Rt!==null){var Zt,zt,ve;if(!Mn){Zt=document.createElement("img"),Zt.style.position="absolute",Zt.style.zIndex="1001",Zt.style.opacity=1,Vt.style.opacity=.3,zt=360,zt>Ge/4*3&&(zt=Ge/4*3),ve=zt/5.8,Zt.setAttribute("src",Rt),Zt.setAttribute("width",zt),Zt.setAttribute("height",ve);var se=(Ge-zt)/2,oe=(Ye-ve)/2;Zt.style.left=se+"px",Zt.style.top=oe+"px",jt.appendChild(Zt)}}return jt.appendChild(Vt),jt},Wt=function(Ge){return Ge=Ge.toLowerCase(),Ge==="html5"||Ge==="screenshot"?Ge:"html5"},ze=["web","webSimple","web3d","tablet","tablet3d","phone"],xe=function(Ge,Ye){if(kt=Ge,Ye){bt(kt,!0);return}var It=!ut;if(It){var Mn=Ve(kt);!isNaN(Mn)&&Mn<4.4&&(It=!1)}var jt,bn;window.location.protocol.substr(0,4)==="http"?jt=window.location.protocol:jt="http:";var Vt=kt.indexOf("//");Vt>0?bn=kt:Vt===0?bn=jt+kt:bn="https://www.geogebra.org/apps/5.2.814.0/";for(var Zt in ze)if(kt.slice(ze[Zt].length*-1)===ze[Zt]||kt.slice((ze[Zt].length+1)*-1)===ze[Zt]+"/"){bt(bn,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&It&&!pe.is3D&&!pe.AV&&!pe.SV&&!pe.CV&&!pe.EV2&&!pe.CP&&!pe.PC&&!pe.DA&&!pe.FI&&!pe.PV&&!rt(de.showToolBar)&&!rt(de.showMenuBar)&&!rt(de.showAlgebraInput)&&!rt(de.enableRightClick)&&(!de.appName||de.appName=="classic")?bn+="webSimple/":bn+="web3d/",bt(bn,!1)},bt=function(Ge,Ye){if(Ge.requirejs){gt=Ge;return}Ge.slice(-1)!=="/"&&(Ge+="/"),gt=Ge,Ye===null&&(Ye=Ge.indexOf("http")===-1),Oe=Ye,et="web.nocache.js",mt=!1;var It=gt.split("/");It.length>1&&(!Ye&&It[It.length-2]==="webSimple"?(et="webSimple.nocache.js",mt=!0):ze.indexOf(It[It.length-2])>=0&&(et=It[It.length-2]+".nocache.js")),It=Ge.split("/"),kt=It[It.length-3],kt.substr(0,4)==="test"?kt=kt.substr(4,1)+"."+kt.substr(5,1):(kt.substr(0,3)==="war"||kt.substr(0,4)==="beta")&&(kt="5.0");var Mn=parseFloat(kt);Mn!==NaN&&Mn<5&&Ge.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+Mn+" is deprecated. Using version latest instead."),xe("5.0",Ye))},pn=function(Ge,Ye){window.console&&window.console.log&&(!Ye||typeof Ye.showLogging=="undefined"||Ye.showLogging&&Ye.showLogging!=="false")&&console.log(Ge)};de.material_id!==void 0?at(Ut):Ut();function Ut(){var Ge=dn;Pe!==null?Ge=Pe:parseFloat(Ge)<5&&(Ge="5.0"),xe(Ge,!1),Ne!==null&&bt(Ne,Oe),Se=!0}return kn},GGBAppletUtils=function(){"use strict";function kn(){return window.GGBT_wsf_edit!==void 0}function dn(Se,Pe){Pe!=1?(Se.style.transformOrigin="0% 0% 0px",Se.style.webkitTransformOrigin="0% 0% 0px",Se.style.transform="scale("+Pe+","+Pe+")",Se.style.webkitTransform="scale("+Pe+","+Pe+")",Se.style.maxWidth="initial",Se.querySelector(".ggb_preview")!==null&&(Se.querySelector(".ggb_preview").style.maxWidth="initial"),Se.querySelectorAll(".ggb_preview img")[0]!==void 0&&(Se.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),Se.querySelectorAll(".ggb_preview img")[1]!==void 0&&(Se.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(Se.style.transform="none",Se.style.webkitTransform="none")}function de(Se,Pe,Ne,Ce,ke,Fe){var gt=null;if(Fe!=null&&Fe!="")for(var Oe=Se.parentNode;Oe!=null;)if((" "+Oe.className+" ").indexOf(" "+Fe+" ")>-1){gt=Oe;break}else Oe=Oe.parentNode;var je=0,kt=0,et=0,mt=0,st=0,Rt=0,tn=0;if(gt)je=gt.offsetWidth,kt=Math.max(Ce?gt.offsetWidth:0,gt.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(je=Math.min(window.innerWidth,document.documentElement.clientWidth),kt=Math.min(window.innerHeight,document.documentElement.clientHeight),et=je):(je=window.innerWidth,kt=window.innerHeight,et=window.innerWidth),Se){var nt=Se.getBoundingClientRect();nt.left>0&&nt.left<=je&&(ke===void 0||!ke)&&(document.dir==="rtl"?(st=je-nt.width-nt.left,Rt=et<=480?10:30):(Rt=nt.left,st=et<=480?10:30),mt=Rt+st)}if(Se&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var ht=Se.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(mt=40,tn=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(mt=0,tn=40)}}return Se&&((Ne===void 0||!Ne)&&Pe>0&&Pe+mt<je?je=Pe:je-=mt,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Ne===void 0||!Ne)&&(kt-=tn)),{width:je,height:kt}}function pe(Se,Pe,Ne,Ce,ke){if(Se.isScreenshoGenerator)return 1;var Fe=Ce!==void 0&&Ce,gt=Se.noScaleMargin!=null&&Se.noScaleMargin,Oe=function(ht){return ht&&ht!=="false"},je=Oe(Se.autoHeight),kt=de(Pe,Se.width,Ne,je,Fe&&window.GGBT_wsf_view||gt,ke),et=parseInt(kt.width),mt=Se.width,st=Se.height;if(mt===void 0){var Rt=Pe.querySelector(".appletParameters");Rt&&(mt=Rt.offsetWidth,st=Rt.offsetHeight)}var tn=et/mt,nt=Fe?1:kt.height/st;return Ne!==void 0&&!Ne&&(tn=Math.min(1,tn),nt=Math.min(1,nt)),Math.min(tn,nt)}function ut(Se,Pe,Ne){var Ce=1,ke,Fe=!1;if(Se.hasOwnProperty("allowUpscale")&&(Fe=Se.allowUpscale),Se.hasOwnProperty("scale")&&(Ce=parseFloat(Se.scale),(isNaN(Ce)||Ce===null||Ce===0)&&(Ce=1),Ce>1&&(Fe=!0)),Pe&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Fe=!0),!(Se.hasOwnProperty("disableAutoScale")&&Se.disableAutoScale))ke=pe(Se,Pe,Fe,Ne,Se.scaleContainerClass);else return Ce;return Fe&&(!Se.hasOwnProperty("scale")||Ce===1)?ke:Math.min(Ce,ke)}function $e(Se){var Pe=Math.min(window.innerWidth,document.documentElement.clientWidth),Ne=Math.min(window.innerHeight,document.documentElement.clientHeight),Ce=Se.getBoundingClientRect(),ke=(Pe-Ce.width)/2,Fe=(Ne-Ce.height)/2;Fe<0&&(Fe=0),Se.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(ke<40?Se.style.left="40px":Se.style.left=ke+"px",Se.style.top=Fe+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(Fe<40?Se.style.top="40px":Se.style.top=Fe+"px",Se.style.left=ke+"px")}function ct(Se,Pe){var Ne=Se.querySelector(".appletParameters");if(Ne){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Pe.id!==Ne.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(Se)}if(Ne.parentElement&&/fullscreen/.test(Ne.parentElement.className))return;var Ce=ut(Pe,Se);kn()&&Ne.setAttribute("data-param-scale",Ce);for(var ke=null,Fe=0;Fe<Se.childNodes.length;Fe++)if(Se.childNodes[Fe].className!==void 0&&Se.childNodes[Fe].className.match(/^applet_scaler/)){ke=Se.childNodes[Fe];break}if(ke!==null&&ke.querySelector(".noscale")!==null)return;var gt=Pe.id!==void 0?Pe.id:"ggbApplet",Oe=window[gt];(Oe==null||!Oe.recalculateEnvironments)&&ke!==null&&!ke.className.match(/fullscreen/)&&(ke.parentNode.style.transform="",!isNaN(Ce)&&Ce!==1?(ke.parentNode.style.width=Pe.width*Ce+"px",ke.parentNode.style.height=Pe.height*Ce+"px",dn(ke,Ce)):(dn(ke,1),ke.parentNode.style.width=Pe.width+"px",ke.parentNode.style.height=Pe.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&$e(Se),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(Ne).parents(".content-added-content"))}}return{responsiveResize:ct,isFlexibleWorksheetEditor:kn,positionCenter:$e,getScale:ut,scaleElement:dn}}();__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return GGBApplet}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),__WEBPACK_AMD_DEFINE_RESULT__!==void 0&&(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 kn=n.location.search;return kn.indexOf(J)!=-1||kn.indexOf(K)!=-1}function q(kn,dn){}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||{};s[L]={moduleName:L},webModule.__moduleStartupDone=function(kn){var dn=s[L].bindings;s[L].bindings=function(){for(var de=dn?dn():{},pe=kn[webModule.__softPermutationId],ut=O;ut<pe.length;ut++){var $e=pe[ut];de[$e[O]]=$e[P]}return de}};var t;function u(){return v(),t}function v(){if(!t){var kn=o.createElement(Q);if(kn.id=L,kn.style.cssText=R+S,kn.tabIndex=-1,o.body.appendChild(kn),t=kn.contentWindow.document,navigator.userAgent.indexOf(T)==-1){t.open();var dn=document.compatMode==U?V:W;t.write(dn+X),t.close()}}}function w(kn){function dn(pe){function ut(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var $e=ut();if($e){pe();return}function ct(){if(!$e){if(!ut())return;$e=!0,pe(),o.removeEventListener&&o.removeEventListener(Z,ct,!1),Se&&clearInterval(Se)}}o.addEventListener&&o.addEventListener(Z,ct,!1);var Se=setInterval(function(){ct()},$)}function de(pe){var ut=u(),$e=ut.body,ct=ut.createElement(_);ct.language=ab,ct.crossOrigin=W,ct.src=pe,webModule.__errFn&&(ct.onerror=function(){webModule.__errFn(L,new Error(bb+pe))}),$e.appendChild(ct)}dn(function(){de(kn)})}webModule.__startLoadingFragment=function(kn){return C(kn)},webModule.__installRunAsyncCode=function(kn){var dn=u(),de=dn.body,pe=dn.createElement(_);pe.language=ab,pe.text=kn,de.appendChild(pe),de.removeChild(pe)};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(kn){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(kn){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(kn){var dn=c[kn];return dn==null?null:dn},r=d,webModule.__errFn=e}function B(){function kn(Se){var Pe=Se.lastIndexOf(rb);Pe==-1&&(Pe=Se.length);var Ne=Se.indexOf(sb);Ne==-1&&(Ne=Se.length);var Ce=Se.lastIndexOf(tb,Math.min(Ne,Pe));return Ce>=O?Se.substring(O,Ce+P):W}function dn(Se){if(!Se.match(/^\w+:\/\//)){var Pe=o.createElement(ub);Pe.src=Se+vb,Se=kn(Pe.src)}return Se}function de(){var Se=__gwt_getMetaProperty(wb);return Se!=null?Se:W}function pe(){for(var Se=o.getElementsByTagName(_),Pe=O;Pe<Se.length;++Pe)if(Se[Pe].src.indexOf(xb)!=-1)return kn(Se[Pe].src);return W}function ut(){var Se=o.getElementsByTagName(yb);return Se.length>O?Se[Se.length-P].href:W}function $e(){var Se=o.location;return Se.href==Se.protocol+zb+Se.host+Se.pathname+Se.search+Se.hash}var ct=de();return ct==W&&(ct=pe()),ct==W&&(ct=ut()),ct==W&&$e()&&(ct=kn(o.location.href)),ct=dn(ct),ct}function C(kn){return kn.match(/^\//)||kn.match(/^[a-zA-Z]+:\/\//)?kn:webModule.__moduleBase+kn}function D(){var kn=[],dn=O,de=[],pe=[];function ut(Se){var Pe=pe[Se](),Ne=de[Se];if(Pe in Ne)return Pe;var Ce=[];for(var ke in Ne)Ce[Ne[ke]]=ke;throw r&&r(Se,Ce,Pe),null}if(__gwt_isKnownPropertyValue=function(Se,Pe){return Pe in de[Se]},webModule.__getPropMap=function(){var Se={};for(var Pe in de)de.hasOwnProperty(Pe)&&(Se[Pe]=ut(Pe));return Se},webModule.__computePropValue=ut,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var $e;try{$e=Cb;var ct=$e.indexOf(Db);ct!=-1&&(dn=parseInt($e.substring(ct+P),$),$e=$e.substring(O,ct))}catch(Se){}return webModule.__softPermutationId=dn,C($e+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}A(),webModule.__moduleBase=window.ENV==="build"?"/react/build/js/mathematicalGraphics/"+name+"/":"/js/mathematicalGraphics/"+name+"/",s[L].moduleBase=webModule.__moduleBase;var G=D();return F(),w(G),!0}return webModule},typeof window.web3d!="function"&&(window.web3d=GGBAppletUtils.makeModule("web3d","A18F540516513B1292CA7CEF2F6AFC7E")),typeof window.webSimple!="function"&&(window.webSimple=GGBAppletUtils.makeModule("webSimple","96B09BF1B436BF53F0DF54116700F16A")),window.GGBApplet=GGBApplet})()},5862:function(kn,dn,de){"use strict";de.d(dn,{Ax:function(){return ct},Ds:function(){return Se},KI:function(){return Ne},SI:function(){return $e},f1:function(){return ut}});var pe=de(41510);function ut(Ce){let ke=!0;if(Ce.length>0){for(let Fe=0;Fe<Ce.length;Fe++)if(Ce[Fe].compile_success==0||!Ce[Fe].compile_success){ke=!1;break}}else ke=!1;return ke}function $e(Ce,ke=""){let Fe=[];for(let gt=0;gt<Ce.length;gt++){let Oe=Ce[gt],je=ke?`${ke}/${Oe.name}`:`${Oe.name}`;Fe.push({title:Oe.name,type:Oe.type,isLeaf:Oe.type!=="tree",key:je})}return Fe}function ct(Ce,ke,Fe){for(let gt=0;gt<Ce.length;gt++){let Oe=Ce[gt];if(Oe.key===ke){Oe.children=Fe;break}Oe.children&&ct(Oe.children,ke,Fe)}return Ce}function Se(Ce,ke,Fe){let gt;return function(){let Oe=this,je=arguments,kt=function(){gt=null,Fe||Ce.apply(Oe,je)},et=Fe&&!gt;clearTimeout(gt),gt=setTimeout(kt,ke),et&&Ce.apply(Oe,je)}}const Pe=!0,Ne=pe.Z.API_SERVER},94094:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return gt}});var pe=de(59301),ut={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},$e=de(92310),ct=de.n($e),Se=de(71418),Pe=de(2859),Ne=de(23789),Ce=de(21331),ke=(Oe,je,kt)=>new Promise((et,mt)=>{var st=nt=>{try{tn(kt.next(nt))}catch(ht){mt(ht)}},Rt=nt=>{try{tn(kt.throw(nt))}catch(ht){mt(ht)}},tn=nt=>nt.done?et(nt.value):Promise.resolve(nt.value).then(st,Rt);tn((kt=kt.apply(Oe,je)).next())}),gt=({data:Oe,className:je,fullWidth:kt,style:et={},onClose:mt,onOk:st,showFullTools:Rt,noAssociationId:tn})=>{const nt=(0,pe.useRef)(null),ht=(0,pe.useRef)(null),Ve=(0,pe.useRef)(null),Ee=(0,pe.useRef)(null),[Xe,at]=(0,pe.useState)(!1),[vt,Ue]=(0,pe.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,pe.useEffect)(()=>{Ve.current||(Ve.current=document.createElement("style"),document.head.appendChild(Ve.current)),Oe!=null&&Oe.visible?(document.body.setAttribute("data-custom","y-hidden"),Ve.current.innerHTML=" html { overflow-y: hidden; }",Oe!=null&&Oe.src&&Ot()):(document.body.removeAttribute("data-custom"),Ve.current&&(document.head.removeChild(Ve.current),Ve.current=null))},[Oe==null?void 0:Oe.visible]);const Ot=()=>ke(void 0,null,function*(){at(!0),Ue("\u6B63\u5728\u52A0\u8F7D\u4E2D");const cn=yield(0,Ce.ZJ)(Oe==null?void 0:Oe.src);nt.current.src="",nt.current.src=cn,nt.current.onload=function(){Ht()},at(!1),Ue("")}),rt=()=>{document.body.removeAttribute("data-custom"),Ve.current.innerHTML=" ",mt()},At=cn=>ke(void 0,null,function*(){at(!0),Ue("\u6B63\u5728\u4FDD\u5B58\u4E2D");const Kt=yield(0,Ne.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Oe.title,file:cn.dataUrl}});Kt!=null&&Kt.id&&!tn?(yield(0,Ne.ZP)(`/api/attachments/${Oe.id}/add_subitem.json`,{method:"post",body:{subitem_id:Kt==null?void 0:Kt.id,settings:JSON.stringify(cn.state)}})).status===0&&st():Kt!=null&&Kt.id&&st(Kt),document.body.removeAttribute("data-custom"),Ve.current.innerHTML=" ",at(!1),Ue("")}),qe=()=>{const cn=document.querySelector('a[href="https://markerjs.com/"]');cn&&cn.parentNode&&(cn.parentNode.style.display="none"),[{name:'[data-action="select"]',title:"\u9009\u62E9"},{name:'[data-action="delete"]',title:"\u5220\u9664\u5143\u7D20"},{name:'[data-action="undo"]',title:"\u64A4\u9500"},{name:'[data-type-name="FrameMarker"]',title:"\u77E9\u5F62"},{name:'[data-type-name="FreehandMarker"]',title:"\u753B\u7EBF"},{name:'[data-type-name="ArrowMarker"]',title:"\u7BAD\u5934"},{name:'[data-type-name="TextMarker"]',title:"\u6587\u672C"},{name:'[data-type-name="EllipseMarker"]',title:"\u692D\u5706"},{name:'[data-type-name="HighlightMarker"]',title:"\u65B9\u5757"},{name:'[data-type-name="CalloutMarker"]',title:"\u6CE8\u91CA"},{name:'[data-action="render"]',title:"\u4FDD\u5B58"},{name:'[data-action="close"]',title:"\u9000\u51FA"}].forEach(Xt=>{const Wt=document.querySelector(Xt.name);Wt&&Wt.setAttribute("title",Xt.title)})},Ht=()=>{ht.current=new Pe.hP(nt.current),ht.current.targetRoot=Ee.current,ht.current.addEventListener("render",At),ht.current.addEventListener("beforeclose",rt),Rt&&(ht.current.availableMarkerTypes=ht.current.ALL_MARKER_TYPES,ht.current.uiStyleSettings.redoButtonVisible=!0,ht.current.uiStyleSettings.notesButtonVisible=!0,ht.current.uiStyleSettings.zoomButtonVisible=!0,ht.current.uiStyleSettings.zoomOutButtonVisible=!0,ht.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=ht.current.uiStyleSettings,ht.current.show(),Oe!=null&&Oe.snapshotData&&ht.current.restoreState(Oe.snapshotData),setTimeout(()=>{window.scrollTo(0,0),qe()},300)};return pe.createElement(pe.Fragment,null,(Oe==null?void 0:Oe.visible)&&pe.createElement(Se.Z,{spinning:Xe,tip:vt,style:{position:"absolute"}},pe.createElement("div",{ref:Ee,className:ct()(ut.imageDimensions,je,kt?ut.fullWidth:""),style:et},pe.createElement("img",{className:ut.img,ref:nt}))))}},29386:function(kn,dn,de){"use strict";var pe=de(59301),ut=de(95237),$e=de(43604),ct=de(99313),Se=de(3113),Pe=de(88622),Ne=de(14973),Ce=de(48136),ke=de(59301);const Fe=(0,pe.forwardRef)(({callback:gt,showSaveButton:Oe,value:je=""},kt)=>{const et=(0,pe.useRef)(),mt=[{name:"\u5206\u6570\u5F97\u5206",value:"\\frac{x}{y}",children:[{name:"\u5206\u6570 Fractions",data:[{value:"\\frac{a}{b}"},{value:"x\\tfrac{x}{a} "},{value:"\\mathrm{d}t"},{value:"\\partial t"},{value:"\\frac{\\partial y}{\\partial x}"},{value:"\\nabla\\psi"},{value:"\\frac{\\partial^2}{\\partial x_1\\partial x_2}y"},{value:"\\cfrac{1}{a + \\cfrac{7}{b + \\cfrac{2}{9}}} = c"}]},{name:"\u5BFC\u6570 Derivative",data:[{value:"\\dot{a} "},{value:"\\ddot{a}"},{value:"{f}^{\\prime}"},{value:"{f}^{\\prime\\prime}"},{value:"{f}^{(n)}"}]},{name:"\u6A21\u7B97\u672F Modular arithmetic",data:[{value:"a \\bmod b"},{value:"a \\equiv b \\pmod{m} "},{value:"\\gcd(m, n) "},{value:"\\operatorname{lcm}(m, n) "}]}]},{name:"\u6839\u5F0F\u89D2\u6807",value:"\\sqrt{x}",children:[{name:"\u6839\u5F0F Radicals",data:[{value:"\\sqrt{x}"},{value:"\\sqrt[y]{x}"}]},{name:"\u4E0A\u4E0B\u6807 Sub&Super",data:[{value:"x^{a}"},{value:"x_{a}"},{value:"x_{a}^{b} "},{value:"_{a}^{b} x"},{value:"x_{a}^{b} "}]},{name:"\u91CD\u97F3\u7B26\u53CA\u5176\u4ED6 Accents and Others",data:[{value:"\\hat{a} "},{value:"\\sqrt[y]{x}"},{value:"\\check{} "},{value:"\\grave{a} "},{value:"\\acute{a}"},{value:"\\tilde{a}"},{value:"\\breve{a}"},{value:"\\bar{a}"},{value:"\\vec{a}"},{value:"\\not{a}"},{value:"\\widetilde{abc}"},{value:"\\widehat{abc}"},{value:"\\overleftarrow{abc} "},{value:"\\overrightarrow{abc}"},{value:"\\overline{abc}"},{value:"\\underline{abc}"},{value:"\\overbrace{abc}"},{value:"\\underbrace{abc}"},{value:"\\overset{a}{abc}"},{value:"\\underset{a}{abc} \\stackrel\\frown{ab}"},{value:"\\overline{ab} "},{value:"\\overleftrightarrow{ab}"},{value:"\\overset{a}{\\leftarrow}"},{value:"\\overset{a}{\\rightarrow}"},{value:"\\xleftarrow[abc]{a}"},{value:"\\xrightarrow[abc]{a} "}]}]},{name:"\u6781\u9650\u5BF9\u6570",value:"\\lim_{x \\to 0}",children:[{name:"\u6781\u9650 Limits",data:[{value:"\\lim a"},{value:"\\lim_{x \\to 0}"},{value:"\\lim_{x \\to \\infty}"},{value:"\\max_b{a}"},{value:"\\min_a{b}"}]},{name:"\u5BF9\u6570\u6307\u6570 Logarithms and exponentials",data:[{value:"\\log_{a}{b}"},{value:"\\lg_{a}{b}"},{value:"\\ln_{a}{b}"},{value:"\\exp a"}]},{name:"\u754C\u9650 Bounds",data:[{value:"\\min x"},{value:"\\sup t"},{value:"\\inf s"},{value:"\\lim u"},{value:"\\limsup w"},{value:"\\dim p"},{value:"\\ker\\phi "}]}]},{name:"\u4E09\u89D2\u51FD\u6570",value:"\\sin a",children:[{name:"\u4E09\u89D2\u51FD\u6570 Trigonometric functions",data:[{value:"\\sin a"},{value:"\\cos a"},{value:"\\tan a"},{value:"\\cot a "},{value:"\\sec a "},{value:"\\csc a "}]},{name:"\u53CD\u4E09\u89D2\u51FD\u6570 Inverse trigonometric functions",data:[{value:"\\sin^{-1}"},{value:"\\cos^{-1}"},{value:"\\tan^{-1}"},{value:"\\cot^{-1}"},{value:"\\sec^{-1}"},{value:"\\csc^{-1}"},{value:"\\arcsin a"},{value:"\\arccos a"},{value:"\\arctan a"},{value:"\\operatorname{arccot} a"},{value:"\\operatorname{arcsec} a"},{value:"\\operatorname{arccsc} a"}]},{name:"\u53CC\u66F2\u51FD\u6570 Hyperblic functions",data:[{value:"\\sinh a"},{value:"\\cosh a"},{value:"\\tanh a"},{value:"\\coth a"},{value:"\\operatorname{sech} a"},{value:"\\operatorname{csch} a"}]},{name:"\u53CD\u53CC\u66F2\u51FD\u6570 Inverse hyperbolic functions",data:[{value:"\\sinh^{-1}"},{value:"a\\cosh^{-1} a"},{value:"\\tanh^{-1} a"},{value:"\\coth^{-1} a"},{value:"\\operatorname{sech}^{-1} a"},{value:"\\operatorname{csch}^{-1} a"}]}]},{name:"\u79EF\u5206\u8FD0\u7B97",value:"\\int_{a}^{b}",children:[{name:"\u79EF\u5206 Integral",data:[{value:"\\int"},{value:"\\int_{a}^{b}"},{value:"\\int\\limits_{a}^{b}"}]},{name:"\u53CC\u91CD\u79EF\u5206 Double integral",data:[{value:"\\iint"},{value:"\\iint_{a}^{b} "},{value:"\\iint\\limits_{a}^{b} "}]},{name:"\u4E09\u91CD\u79EF\u5206 Triple integral",data:[{value:"\\iiint"},{value:"\\iiint_{a}^{b}"},{value:"\\iiint\\limits_{a}^{b} "}]},{name:"\u66F2\u7EBF\u79EF\u5206 Closed line or path integral",data:[{value:"\\oint"},{value:"\\oint_{a}^{b} "}]}]},{name:"\u5927\u578B\u8FD0\u7B97",value:"\\sum_{a}^{b}",children:[{name:"\u6C42\u548C Summation",data:[{value:"\\sum"},{value:"\\sum_{a}^{b}"},{value:"{\\textstyle \\sum_{a}^{b}} "}]},{name:"\u4E58\u79EF\u4F59\u79EF Product and coproduct",data:[{value:"\\prod"},{value:"\\prod_{a}^{b}"},{value:"{\\textstyle \\prod_{a}^{b}}"},{value:"\\coprod"},{value:"\\coprod_{a}^{b}"},{value:"{\\textstyle \\coprod_{a}^{b}} "}]},{name:"\u5E76\u96C6\u4EA4\u96C6 Union and intersection",data:[{value:"\\bigcup"},{value:"\\bigcup_{a}^{b}"},{value:"{\\textstyle \\bigcup_{a}^{b}}"},{value:"\\bigcap"},{value:"\\bigcap_{a}^{b}"}]},{name:"\u6790\u53D6\u5408\u53D6 Disjunction and conjunction",data:[{value:"\\bigvee"},{value:"\\bigvee_{a}^{b}"},{value:"\\bigwedge"},{value:"\\bigwedge_{a}^{b}"}]}]},{name:"\u62EC\u53F7\u53D6\u6574",value:"\\left [ \\left ( \\right ) \\right ] ",children:[{name:"\u62EC\u53F7 Brackets",data:[{value:"\\left ( \\right )"},{value:"\\left [ \\right ]"},{value:"\\left \\langle \\right \\rangle "},{value:"\\left | \\right | "},{value:"\\left \\lfloor \\right \\rfloor "},{value:"\\left \\lceil \\right \\rceil "}]}]}],st=[{name:"\u4EE3\u6570",value:"\\sqrt{a^2+b^2}",children:[{data:[{value:"\\left(x-1\\right)\\left(x+3\\right) "},{value:"\\sqrt{a^2+b^2}"},{value:"\\left ( \\frac{a}{b}\\right )^{n}= \\frac{a^{n}}{b^{n}}"},{value:"\\frac{a}{b}\\pm \\frac{c}{d}= \\frac{ad \\pm bc}{bd} "},{value:"\\frac{x^{2}}{a^{2}}-\\frac{y^{2}}{b^{2}}=1 "},{value:"\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0 "},{value:"\\sqrt[n]{a^{n}}=\\left ( \\sqrt[n]{a}\\right )^{n} "},{value:"x ={-b \\pm \\sqrt{b^2-4ac}\\over 2a} "},{value:"y-y_{1}=k \\left( x-x_{1}\\right) "},{value:`\\left\\{\\begin{matrix} \r
x=a + r\\text{cos}\\theta \\ \r
y=b + r\\text{sin}\\theta \r
\\end{matrix}\\right. `},{value:`\\begin{array}{l} \r
\\text{\u5BF9\u4E8E\u65B9\u7A0B\u5F62\u5982\uFF1A}x^{3}-1=0 \\ \r
\\text{\u8BBE}\\text{:}\\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r
x_{1}=1,x_{2}= \\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r
x_{3}= \\omega ^{2}=\\frac{-1-\\sqrt{3}i}{2} \r
\\end{array} `},{value:`\\begin{array}{l} \r
a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r
\\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r
\\left\\{\\begin{matrix} \r
\\Delta \\gt 0\\text{\u65B9\u7A0B\u6709\u4E24\u4E2A\u4E0D\u76F8\u7B49\u7684\u5B9E\u6839} \\ \r
\\Delta = 0\\text{\u65B9\u7A0B\u6709\u4E24\u4E2A\u76F8\u7B49\u7684\u5B9E\u6839} \\ \r
\\Delta \\lt 0\\text{\u65B9\u7A0B\u65E0\u5B9E\u6839} \r
\\end{matrix}\\right. \r
\\end{array} `},{value:`\\begin{array}{l} \r
a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r
\\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r
\\mathop{{x}}\\nolimits_{{1,2}}=\\frac{{-b \\pm \r
\\sqrt{{\\mathop{{b}}\\nolimits^{{2}}-4ac}}}}{{2a}} \\ \r
\\mathop{{x}}\\nolimits_{{1}}+\\mathop{{x}}\\nolimits_{{2}}=-\\frac{{b}}{{a}} \\ \r
\\mathop{{x}}\\nolimits_{{1}}\\mathop{{x}}\\nolimits_{{2}}=\\frac{{c}}{{a}} \r
\\end{array} `}]}]},{name:"\u51E0\u4F55",value:"\\Delta A B C ",children:[{data:[{value:"\\Delta A B C "},{value:"a \\parallel c,b \\parallel c \\Rightarrow a \\parallel b "},{value:"l \\perp \\beta ,l \\subset \\alpha \\Rightarrow \\alpha \\perp \\beta"},{value:`\\left.\\begin{matrix} \r
a \\perp \\alpha \\ \r
b \\perp \\alpha \r
\\end{matrix}\\right\\}\\Rightarrow a \\parallel b`},{value:"P \\in \\alpha ,P \\in \\beta , \\alpha \\cap \\beta =l \\Rightarrow P \\in l "},{value:`\\alpha \\perp \\beta , \\alpha \\cap \\beta =l,a \\subset \\alpha ,a \\perp l \r
\\Rightarrow a \\perp \\beta `},{value:`\\left.\\begin{matrix} \r
a \\subset \\beta ,b \\subset \\beta ,a \\cap b=P \\ \r
a \\parallel \\partial ,b \\parallel \\partial \r
\\end{matrix}\\right\\}\\Rightarrow \\beta \\parallel \\alpha `},{value:"\\alpha \\parallel \\beta , \\gamma \\cap \\alpha =a, \\gamma \\cap \\beta =b \\Rightarrow a \\parallel b "},{value:"A \\in l,B \\in l,A \\in \\alpha ,B \\in \\alpha \\Rightarrow l \\subset \\alpha "},{value:`\\left.\\begin{matrix} \r
m \\subset \\alpha ,n \\subset \\alpha ,m \\cap n=P \\ \r
a \\perp m,a \\perp n \r
\\end{matrix}\\right\\}\\Rightarrow a \\perp \\alpha `},{value:`\\begin{array}{c} \r
\\text{\u76F4\u89D2\u4E09\u89D2\u5F62\u4E2D,\u76F4\u89D2\u8FB9\u957Fa,b,\u659C\u8FB9\u8FB9\u957Fc} \\ \r
a^{2}+b^{2}=c^{2} \r
\\end{array}`}]}]},{name:"\u4E0D\u7B49\u5F0F",value:"a > b",children:[{data:[{value:"a > b,b > c \\Rightarrow a > c "},{value:"a > b,c > d \\Rightarrow a+c > b+d "},{value:"a > b > 0,c > d > 0 \\Rightarrow ac bd "},{value:`\\begin{array}{c} \r
a \\gt b,c \\gt 0 \\Rightarrow ac \\gt bc \\ \r
a \\gt b,c \\lt 0 \\Rightarrow ac \\lt bc \r
\\end{array}`},{value:"\\left | a-b \\right | \\geqslant \\left | a \\right | -\\left | b \\right | "},{value:"-\\left | a \\right |\\leq a\\leqslant \\left | a \\right | "},{value:"\\left | a \\right |\\leqslant b \\Rightarrow -b \\leqslant a \\leqslant \\left | b \\right | "},{value:"\\left | a+b \\right | \\leqslant \\left | a \\right | + \\left | b \\right | "},{value:`\\begin{array}{c} \r
a \\gt b \\gt 0,n \\in N^{\\ast},n \\gt 1 \\ \r
\\Rightarrow a^{n}\\gt b^{n}, \\sqrt[n]{a}\\gt \\sqrt[n]{b} \r
\\end{array}`},{value:`\\left( \\sum_{k=1}^n a_k b_k \\right)^{\\!\\!2}\\leq \r
\\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right) `},{value:`\\begin{array}{c} \r
a,b \\in R^{+} \\ \r
\\Rightarrow \\frac{a+b}{{2}}\\ge \\sqrt{ab} \\ \r
\\left( \\text{\u5F53\u4E14\u4EC5\u5F53}a=b\\text{\u65F6\u53D6\u201C}=\\text{\u201D\u53F7}\\right) \r
\\end{array}`},{value:`\\begin{array}{c} \r
a,b \\in R \\ \r
\\Rightarrow a^{2}+b^{2}\\gt 2ab \\ \r
\\left( \\text{\u5F53\u4E14\u4EC5\u5F53}a=b\\text{\u65F6\u53D6\u201C}=\\text{\u201D\u53F7}\\right) \r
\\end{array}`},{value:`\\begin{array}{c} \r
H_{n}=\\frac{n}{\\sum \\limits_{i=1}^{n}\\frac{1}{x_{i}}}= \\frac{n}{\\frac{1}{x_{1}}+ \\frac{1}{x_{2}}+ \\cdots + \\frac{1}{x_{n}}} \\ G_{n}=\\sqrt[n]{\\prod \\limits_{i=1}^{n}x_{i}}= \\sqrt[n]{x_{1}x_{2}\\cdots x_{n}} \\ A_{n}=\\frac{1}{n}\\sum \\limits_{i=1}^{n}x_{i}=\\frac{x_{1}+ x_{2}+ \\cdots + x_{n}}{n} \\ Q_{n}=\\sqrt{\\sum \\limits_{i=1}^{n}x_{i}^{2}}= \\sqrt{\\frac{x_{1}^{2}+ x_{2}^{2}+ \\cdots + x_{n}^{2}}{n}} \\ H_{n}\\leq G_{n}\\leq A_{n}\\leq Q_{n} \r
\\end{array}`}]}]},{name:"\u79EF\u5206",value:"\\frac{\\mathrm{d}\\partial}{\\partial x}",children:[{data:[{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}x^n=nx^{n-1} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}e^{ax}=a\\,e^{ax} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\ln(x)=\\frac{1}{x} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\sin x=\\cos x "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cos x=-\\sin x "},{value:"\\int k\\mathrm{d}x = kx+C "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\tan x=\\sec^2 x "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cot x=-\\csc^2 x "},{value:"\\int \\frac{1}{x}\\mathrm{d}x= \\ln \\left| x \\right| +C "},{value:"\\int \\frac{1}{\\sqrt{1-x^{2}}}\\mathrm{d}x= \\arcsin x +C "},{value:"\\int \\frac{1}{1+x^{2}}\\mathrm{d}x= \\arctan x +C "},{value:"\\int u \\frac{\\mathrm{d}v}{\\mathrm{d}x}\\,\\mathrm{d}x=uv-\\int \\frac{\\mathrm{d}u}{\\mathrm{d}x}v\\,\\mathrm{d}x "},{value:"f(x) = \\int_{-\\infty}^\\infty \\hat f(x)\\xi\\,e^{2 \\pi i \\xi x} \\,\\mathrm{d}\\xi "},{value:"\\int x^{\\mu}\\mathrm{d}x=\\frac{x^{\\mu +1}}{\\mu +1}+C, \\left({\\mu \\neq -1}\\right) "}]}]},{name:"\u4E09\u89D2",value:"e^{i \\theta}",children:[{name:"\u6C42\u548C Summation",data:[{value:"e^{i \\theta} "},{value:"\\left(\\frac{\\pi}{2}-\\theta \\right ) "},{value:"\\text{sin}^{2}\\frac{\\alpha}{2}=\\frac{1- \\text{cos}\\alpha}{2} "},{value:"\\text{cos}^{2}\\frac{\\alpha}{2}=\\frac{1+ \\text{cos}\\alpha}{2} "},{value:"\\text{tan}\\frac{\\alpha}{2}=\\frac{\\text{sin}\\alpha}{1+ \\text{cos}\\alpha} "},{value:"\\sin \\alpha + \\sin \\beta =2 \\sin \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "},{value:"\\sin \\alpha - \\sin \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "},{value:"\\cos \\alpha + \\cos \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "},{value:"\\cos \\alpha - \\cos \\beta =-2\\sin \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "},{value:"a^{2}=b^{2}+c^{2}-2bc\\cos A "},{value:"\\frac{\\sin A}{a}=\\frac{\\sin B}{b}=\\frac{\\sin C}{c}=\\frac{1}{2R} "},{value:"\\sin \\left ( \\frac{\\pi}{2}-\\alpha \\right ) = \\cos \\alpha "},{value:"\\sin \\left ( \\frac{\\pi}{2}+\\alpha \\right ) = \\cos \\alpha "}]}]},{name:"\u7EDF\u8BA1",value:"C_{r}^{n}",children:[{data:[{value:"C_{r}^{n} "},{value:"\\frac{n!}{r!(n-r)!} "},{value:"\\sum_{i=1}^{n}{X_i} "},{value:"\\sum_{i=1}^{n}{X_i^2} "},{value:"X_1, \\cdots,X_n "},{value:"\\frac{x-\\mu}{\\sigma} "},{value:"\\sum_{i=1}^{n}{(X_i - \\overline{X})^2} "},{value:`\\begin{array}{c} \r
\\text{\u82E5}P \\left( AB \\right) =P \\left( A \\right) P \\left( B \\right) \\\\ \r
\\text{\u5219}P \\left( A \\left| B\\right. \\right) =P \\left({B}\\right) \r
\\end{array}`},{value:"P(E) ={n \\choose k}p^k (1-p)^{n-k} "},{value:"P \\left( A \\right) = \\lim \\limits_{n \\to \\infty}f_{n}\\left ( A \\right ) "},{value:"P \\left( \\bigcup \\limits_{i=1}^{+ \\infty}A_{i}\\right) = \\prod \\limits_{i=1}^{+ \\infty}P{\\left( A_{i}\\right)} "},{value:`\\begin{array}{c} \r
P \\left( \\emptyset \\right) =0 \\\\ \r
P \\left( S \\right) =1 \r
\\end{array}`},{value:`\\begin{array}{c} \r
\\forall A \\in S \\\\ \r
P \\left( A \\right) \\ge 0 \r
\\end{array}`},{value:"P \\left( \\bigcup \\limits_{i=1}^{n}A_{i}\\right) = \\prod \\limits_{i=1}^{n}P \\left( A_{i}\\right) "},{value:`\\begin{array}{c} \r
S= \\binom{N}{n},A_{k}=\\binom{M}{k}\\cdot \\binom{N-M}{n-k} \\\\ \r
P\\left ( A_{k}\\right ) = \\frac{\\binom{M}{k}\\cdot \\binom{N-M}{n-k}}{\\binom{N}{n}} \r
\\end{array}`},{value:`\\begin{array}{c} \r
P_{n}=n! \\\\ \r
A_{n}^{k}=\\frac{n!}{\\left( n-k \\left) !\\right. \\right.} \r
\\end{array}`}]}]}],Rt=ht=>{et.current.setValue(et.current.getValue()+" "+ht.value+" ")},tn=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:ke.createElement(ut.Z,{className:Ne.Z.lists,gutter:[10,10]},mt.map((ht,Ve)=>ke.createElement($e.Z,{flex:"110px",className:Ne.Z.item},ke.createElement("div",null,ke.createElement(Pe.Z,{value:`$$${ht.value}$$`}),ht.name),ke.createElement("div",{className:Ne.Z.children},ht.children.map((Ee,Xe)=>ke.createElement("div",{key:Xe},ke.createElement("h1",null,Ee.name),ke.createElement(ut.Z,{gutter:[10,10]},Ee.data.map((at,vt)=>ke.createElement($e.Z,{key:vt,onClick:()=>Rt(at),className:Ne.Z.diamond},ke.createElement(Pe.Z,{value:"`$$"+at.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:ke.createElement(ut.Z,{className:Ne.Z.lists,gutter:[10,10]},st.map((ht,Ve)=>ke.createElement($e.Z,{flex:"110px",className:Ne.Z.item},ke.createElement("div",null,ke.createElement(Pe.Z,{value:"`$$"+ht.value+"$$`"}),ht.name),ke.createElement("div",{className:Ne.Z.children},ht.children.map((Ee,Xe)=>ke.createElement("div",{key:Xe},Ee.name&&ke.createElement("h1",null,Ee.name),ke.createElement(ut.Z,{gutter:[10,10]},Ee.data.map((at,vt)=>ke.createElement($e.Z,{key:vt,onClick:()=>Rt(at),className:Ne.Z.diamond},ke.createElement(Pe.Z,{value:"`$$"+at.value+"$$`"}))))))))))}],nt=()=>{var ht=document.createElement("div");ht.innerHTML=et.current.getValue();var Ve=ht.innerText;return gt&&gt(Ve),Ve};return(0,pe.useImperativeHandle)(kt,()=>({getData:nt})),ke.createElement("div",{className:Ne.Z.mathWrap},ke.createElement(ct.default,{defaultActiveKey:"1",items:tn}),ke.createElement("math-field",{locale:"zh_cn",className:Ne.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:et,style:{width:800,marginTop:30,fontSize:18}},je||""),Oe&&ke.createElement("div",{className:Ne.Z.button},ke.createElement(Se.ZP,{size:"large",onClick:nt,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});dn.Z=Fe},8738:function(kn,dn,de){"use strict";de.d(dn,{h:function(){return ht}});var pe=de(59301),ut=de(57809),$e=de(78241),ct=de(3113),Se=de(89780),Pe=de.n(Se),Ne=de(42741),Ce=de(27494),ke=Object.defineProperty,Fe=Object.defineProperties,gt=Object.getOwnPropertyDescriptors,Oe=Object.getOwnPropertySymbols,je=Object.prototype.hasOwnProperty,kt=Object.prototype.propertyIsEnumerable,et=(Ve,Ee,Xe)=>Ee in Ve?ke(Ve,Ee,{enumerable:!0,configurable:!0,writable:!0,value:Xe}):Ve[Ee]=Xe,mt=(Ve,Ee)=>{for(var Xe in Ee||(Ee={}))je.call(Ee,Xe)&&et(Ve,Xe,Ee[Xe]);if(Oe)for(var Xe of Oe(Ee))kt.call(Ee,Xe)&&et(Ve,Xe,Ee[Xe]);return Ve},st=(Ve,Ee)=>Fe(Ve,gt(Ee));const Rt=ut.default.Option,tn={labelCol:{span:4},wrapperCol:{span:20}},nt={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"]};dn.Z=({callback:Ve,onCancel:Ee})=>{const[Xe,at]=(0,pe.useState)("python");function vt(Ot){at(nt[Ot][1])}function Ue(Ot){Ve(Ot)}return pe.createElement($e.default,st(mt({},tn),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:Ue,style:{width:500}}),pe.createElement($e.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},pe.createElement(ut.default,{getPopupContainer:Ot=>Ot.parentNode,onChange:vt},Object.keys(nt).map(Ot=>pe.createElement(Rt,{key:Ot,value:Ot},nt[Ot][0])))),pe.createElement($e.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},pe.createElement(ht,{mode:Xe})),pe.createElement("div",{className:"flex-container flex-end"},pe.createElement(ct.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),pe.createElement(ct.ZP,{type:"ghost",onClick:Ee},"\u53D6\u6D88")))};function ht({value:Ve,onChange:Ee,mode:Xe,options:at={}}){const vt=(0,pe.useRef)(),[Ue,Ot]=(0,pe.useState)();return(0,pe.useEffect)(()=>{if(Ue){let rt=function(At){const qe=At.getValue();Ee&&Ee(qe)};return Ue.on("change",rt),()=>{Ue.off("change",rt)}}},[Ue,Ee]),(0,pe.useEffect)(()=>{Ue&&Ue.setOption("mode",Xe)},[Ue,Xe]),(0,pe.useEffect)(()=>{Ue&&(Ve!==Ue.getValue()||Ve==="")&&setTimeout(()=>{Ue.setValue(Ve||"")},300)},[Ue,Ve]),(0,pe.useEffect)(()=>{if(vt.current&&!Ue){const rt=Pe().fromTextArea(vt.current,mt({mode:Xe,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},at));Ot(rt)}},[vt.current,Ue]),pe.createElement("div",{className:"my-codemirror-container"},pe.createElement("textarea",{ref:vt}))}},20387:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return zr}});var pe=de(59301),ut=de(89780),$e=de.n(ut),ct=de(76374),Se=de(42741),Pe=de(6313),Ne=de(25717),Ce=de(99498),ke=de(25419),Fe=de(67549),gt=de(88622),Oe=({value:ar="",className:or,showTextOnly:Bn,showLines:In,style:wr={}})=>{const Qe=(0,pe.useMemo)(()=>"",[ar]);return pe.createElement(pe.Fragment,null,pe.createElement("div",{dangerouslySetInnerHTML:{__html:Qe}}))},je=de(59301),kt=Object.defineProperty,et=Object.defineProperties,mt=Object.getOwnPropertyDescriptors,st=Object.getOwnPropertySymbols,Rt=Object.prototype.hasOwnProperty,tn=Object.prototype.propertyIsEnumerable,nt=(ar,or,Bn)=>or in ar?kt(ar,or,{enumerable:!0,configurable:!0,writable:!0,value:Bn}):ar[or]=Bn,ht=(ar,or)=>{for(var Bn in or||(or={}))Rt.call(or,Bn)&&nt(ar,Bn,or[Bn]);if(st)for(var Bn of st(or))tn.call(or,Bn)&&nt(ar,Bn,or[Bn]);return ar},Ve=(ar,or)=>et(ar,mt(or));let Ee=[{title:"\u7C97\u4F53",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"md-iconfont icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"\u6570\u5B66\u56FE\u50CF",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"iconfont icon-jisuan1",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"\u63D2\u5165\u753B\u56FE",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"\u63D2\u5165\u6D41\u7A0B\u56FE",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"\u8868\u683C",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function Xe({onActionCallback:ar,title:or,icon:Bn,actionName:In,className:wr="",children:Qe}){function Me(){ar(In)}return je.createElement("a",{title:or,className:wr,onClick:Me},je.createElement("i",{className:`${Bn}`}),Qe)}var at=({watch:ar,showNullButton:or,showNullProgramButton:Bn,onActionCallback:In,fullScreen:wr,insertTemp:Qe,hidetoolBar:Me,extraUse:Ae})=>{const Le=[...Ee,{title:`${ar?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${ar?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return je.createElement("ul",{className:"markdown-toolbar-container"},!Me&&Le.map((De,We)=>je.createElement("li",{key:We},De.actionName?je.createElement(Xe,Ve(ht({},De),{onActionCallback:In})):je.createElement("span",{className:"v-line"}))),or?je.createElement("li",null,je.createElement(Xe,{icon:"iconfont icon-tianjia5 insert-blank",className:"btn-null ml5",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:In},je.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u65B0\u589E\u586B\u7A7A\u9879"))):null,Bn?je.createElement(je.Fragment,null,je.createElement("li",null,je.createElement(Xe,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:In},je.createElement("span",{className:"fill-tip"},"+\u5355\u884C\u586B\u7A7A\u9879"))),je.createElement("li",null,je.createElement(Xe,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:In},je.createElement("span",{className:"fill-tip"},"+\u591A\u884C\u586B\u7A7A\u9879")))):null,Qe&&je.createElement("li",null,je.createElement(Xe,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${Qe}`,onActionCallback:In},je.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),Ae&&je.createElement("li",null,Ae),je.createElement("li",{className:"btn-full-screen"},je.createElement(Xe,{icon:`${wr?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:wr?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:In})))},vt=de(23252),Ue=de(78241),Ot=de(92832),rt=de(3113),At=Object.defineProperty,qe=Object.defineProperties,Ht=Object.getOwnPropertyDescriptors,cn=Object.getOwnPropertySymbols,Kt=Object.prototype.hasOwnProperty,Xt=Object.prototype.propertyIsEnumerable,Wt=(ar,or,Bn)=>or in ar?At(ar,or,{enumerable:!0,configurable:!0,writable:!0,value:Bn}):ar[or]=Bn,ze=(ar,or)=>{for(var Bn in or||(or={}))Kt.call(or,Bn)&&Wt(ar,Bn,or[Bn]);if(cn)for(var Bn of cn(or))Xt.call(or,Bn)&&Wt(ar,Bn,or[Bn]);return ar},xe=(ar,or)=>qe(ar,Ht(or));const bt={labelCol:{span:4},wrapperCol:{span:20}};var pn=({callback:ar,onCancel:or})=>{function Bn(In){ar(In)}return pe.createElement(Ue.default,xe(ze({},bt),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Bn,style:{width:500}}),pe.createElement(Ue.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},pe.createElement(Ot.default,null)),pe.createElement(Ue.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},pe.createElement(Ot.default,null)),pe.createElement("div",{className:"flex-container flex-end"},pe.createElement(rt.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),pe.createElement(rt.ZP,{type:"ghost",onClick:or},"\u53D6\u6D88")))},Ut=de(8738),Ge=de(30315),Ye=de(43418),It=de(95237),Mn=de(94094),jt=de(59301),bn=({callback:ar,onCancel:or})=>{const Bn=document.createElement("canvas"),In=Bn.getContext("2d");Bn.width=1e3,Bn.height=800,In.fillStyle="#ffffff",In.fillRect(0,0,Bn.width,Bn.height);const wr=Bn.toDataURL("image/png");return jt.createElement(Ye.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},jt.createElement(It.Z,{style:{height:"100vh"}},jt.createElement(Mn.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:wr,visible:!0,title:String(Date.now())},onOk:Qe=>{ar({src:Qe.url})},onClose:or})))},Vt=de(8591),Zt=de(43428),zt=de(43604),ve={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re"},se=de(59301),fe=(0,pe.forwardRef)(({onCancel:ar,editImgId:or,callback:Bn},In)=>{let wr=(0,pe.useRef)(),Qe=(0,pe.useRef)(),Me=(0,pe.useRef)(),Ae=(0,pe.useRef)(!1);const Le=(0,pe.useRef)(!1);console.log("ref:",In);const[De,We]=(0,pe.useState)(0),[it,Nt]=(0,pe.useState)("100vh");(0,pe.useEffect)(()=>{We(1);try{indexedDB.databases().then(sn=>{sn.forEach(hn=>indexedDB.deleteDatabase(hn.name))})}catch(sn){}},[]),(0,pe.useEffect)(()=>(window.addEventListener("message",$t),()=>{window.removeEventListener("message",$t)}),[]),(0,pe.useImperativeHandle)(In,()=>({setHeight:Nt}));const Lt=sn=>{window.saveDrawData(hn=>{if(hn===null&&!sn){Vt.ZP.warning({content:"\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u8BF7\u5148\u7ED8\u5236\u6D41\u7A0B\u56FE",key:"saveFlowChart"});return}Vt.ZP.success({content:"\u4FDD\u5B58\u6210\u529F",key:"saveFlowChart",style:{zIndex:999999999}}),Bn({src:`/api/attachments/${hn}`,id:hn,disabledClose:!0})})},$t=sn=>{var hn;((hn=sn==null?void 0:sn.data)==null?void 0:hn.type)==="closePop"&&Lt(!0)};return se.createElement("div",{ref:Le,className:"body-overflow-initial"},se.createElement(Zt.Z,{width:"100vw",height:it,footer:null,closable:!0,placement:"bottom",open:!!De,destroyOnClose:!0,maskClosable:!1,mask:!1,rootClassName:`zIndex-9999 ${ve.drawerWrap}`,onClose:()=>{window.saveDrawData(sn=>{Bn({src:`/api/attachments/${sn}`,id:sn})})},title:se.createElement(It.Z,{align:"middle"},se.createElement(zt.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),se.createElement(zt.Z,{onClick:()=>{Nt(it==="60px"?"100vh":"60px")}},se.createElement("span",{className:"current c-blue",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77")),se.createElement(zt.Z,{onClick:Lt},se.createElement(rt.ZP,{type:"primary",className:"ml20"},"\u4FDD\u5B58")))},se.createElement("iframe",{src:`${window.ENV==="build"?"/react/build":""}/drawio/src/main/webapp/?id=${or||""}&gapi=0&od=0&db=0&gh=0&gl=0&local=0`,width:"100%",height:"100%",frameBorder:"0",ref:Qe})))}),ye=de(41510),ce=de(5112),Ke=de(5871);const Dt=ce.ZP.Group,ln={margin:"0 8px"};var Jt=({callback:ar,onCancel:or})=>{function Bn(In){ar(In)}return pe.createElement(Ue.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Bn},pe.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},pe.createElement("span",{style:ln},"\u5355\u5143\u683C\u6570\uFF1A"),pe.createElement("span",{style:ln},"\u884C\u6570"),pe.createElement(Ue.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},pe.createElement(Ke.Z,null)),pe.createElement("span",{style:ln},"\u5217\u6570"),pe.createElement(Ue.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},pe.createElement(Ke.Z,null))),pe.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},pe.createElement("span",{style:ln},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),pe.createElement(Ue.default.Item,{name:"align"},pe.createElement(Dt,null,pe.createElement(ce.ZP,{value:"default"},pe.createElement("i",{className:"fa fa-align-justify"})),pe.createElement(ce.ZP,{value:"left"},pe.createElement("i",{className:"fa fa-align-left"})),pe.createElement(ce.ZP,{value:"center"},pe.createElement("i",{className:"fa fa-align-center"})),pe.createElement(ce.ZP,{value:"right"},pe.createElement("i",{className:"fa fa-align-right"}))))),pe.createElement("div",{className:"flex-container flex-end"},pe.createElement(rt.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),pe.createElement(rt.ZP,{type:"ghost",onClick:or},"\u53D6\u6D88")))},en=de(78673),nn=de(13547),wn=de.n(nn),En=(0,pe.forwardRef)(({use3d:ar,width:or,height:Bn,callback:In,showSaveButton:wr},Qe)=>{const Me=(0,pe.useRef)(),Ae=(0,pe.useRef)(),[Le,De]=(0,pe.useState)(!1),We=(0,pe.useRef)({id:Me,appName:"graphing",width:or||1e3,height:Bn||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,pe.useEffect)(()=>{Ae.current=new(wn())(We.current,!0),window.onload=function(){Ae.current.inject("applet_container")}},[]);const it=()=>{var Nt=window.ggbApplet.getPNGBase64(1,!0,72);return In&&In(Nt),Nt};return(0,pe.useEffect)(()=>{We.current.appName=Le?"3D":"graphing",Ae.current.inject("applet_container")},[Le]),(0,pe.useEffect)(()=>{De(ar)},[ar]),(0,pe.useImperativeHandle)(Qe,()=>({getImgData:it})),pe.createElement(pe.Fragment,null,pe.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:Me}),pe.createElement(It.Z,{align:"middle"},pe.createElement(zt.Z,{flex:1},pe.createElement(en.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:Le,onChange:Nt=>De(Nt)})),pe.createElement(zt.Z,null,pe.createElement(rt.ZP,{size:"large",onClick:it,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),yt=de(29386),gn=de(1012);const Jn="link",tt="upload-image",Re="add-flowchart",Ze="draw-image",Ft="add-flowchart",Qt="code-block",an="add-table",Pn="------------",On={default:Pn,left:`:${Pn}`,center:`:${Pn}:`,right:`${Pn}:`};var Nn=de(34500),Zn=(ar,or,Bn)=>new Promise((In,wr)=>{var Qe=Le=>{try{Ae(Bn.next(Le))}catch(De){wr(De)}},Me=Le=>{try{Ae(Bn.throw(Le))}catch(De){wr(De)}},Ae=Le=>Le.done?In(Le.value):Promise.resolve(Le.value).then(Qe,Me);Ae((Bn=Bn.apply(ar,or)).next())});function tr(){}let Tn=0;const gr=1e4,Pr="\u2581",Rr="@\u2581\u2581@",Zr="@\u2581@",vr=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`,Dr=["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 yr(ar){return/^\d+$/.test(ar)?`${ar}px`:ar}const Wr=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",Er={[Wr+"-B"]:"bold",[Wr+"-I"]:"italic"},qr={[Jn]:"\u6DFB\u52A0\u94FE\u63A5",[Qt]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[tt]:"\u6DFB\u52A0\u56FE\u7247",[Ze]:"\u6DFB\u52A0\u753B\u56FE",[Re]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[an]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var zr=({defaultValue:ar="",onChange:or,width:Bn="100%",height:In=400,miniToolbar:wr=!1,isFocus:Qe=!1,watch:Me,insertTemp:Ae,mode:Le="markdown",id:De="markdown-editor-id",showResizeBar:We=!1,noStorage:it=!1,showNullButton:Nt=!1,showNullProgramButton:Lt=!1,hidetoolBar:$t=!1,fullScreen:sn=!1,onBlur:hn,onCMBeforeChange:xn,onFullScreen:Mt,className:rn="",disablePaste:Je=!1,disabled:pt=!1,disabledFill:Ct=!1,placeholder:Et="",values:Yt="",extraUse:St,onAddBlank:Gt})=>{const[Te,dt]=(0,pe.useState)(null),[ft,Tt]=(0,pe.useState)(ar),[_t,Pt]=(0,pe.useState)(Me),[Bt,un]=(0,pe.useState)(sn),[yn,_n]=(0,pe.useState)(""),[$n,qn]=(0,pe.useState)(0),[sr,jn]=(0,pe.useState)(In),[Ln,ur]=(0,pe.useState)(!1),Qn=(0,pe.useRef)((0,gn.Z)()),mr=(0,pe.useRef)(!1),Vn=(0,pe.useRef)(),[Un,br]=(0,pe.useState)(0),[lr,Ir]=(0,pe.useState)(0),Ur=(0,pe.useRef)(),rr=(0,pe.useRef)(),Cn=(0,pe.useRef)(),Sn=(0,pe.useRef)(),fr=(0,pe.useRef)(),er=(0,pe.useRef)(),Mr=()=>Zn(void 0,null,function*(){var Gn;const Wn=yield Fetch("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Qn.current}});(Gn=Wn==null?void 0:Wn.attachments)!=null&&Gn.length&&(console.log("cm:",Te,Ur),Wn.attachments.map(Hn=>{Hn.content_type.indexOf("image")>-1?Te.replaceSelection(`![,](/api/attachments/${Hn.id}?type=${Hn.content_type})`):Hn.content_type.indexOf("video")>-1?Te.replaceSelection(`<video width="100%" controls src="${ye.Z.API_SERVER}/api/attachments/${data.id}"></video>`):Hn.content_type.indexOf("pdf")>-1?Te.replaceSelection(`<a href="${ye.Z.API_SERVER}/api/attachments/${Hn.id}?type=${Hn.content_type}&disposition=inline" target="_blank">${Hn.name}</a>`):Te.replaceSelection(`[${Hn.name}](${ye.Z.API_SERVER}/api/attachments/${Hn.id}?type=${Hn.content_type})`)}))});(0,pe.useEffect)(()=>{const Gn=window.scrollY||window.pageYOffset;Tt(Yt),Te==null||Te.setValue(Yt),window.scrollTo(0,Gn)},[Yt]),(0,pe.useEffect)(()=>{Mt==null||Mt(Bt)},[Bt]),(0,pe.useEffect)(()=>{if(Ur.current){let Gn=function(Hn,hr){var ni;if(Je){hr.preventDefault();return}const xi=hr.clipboardData;if(xi){const Mi=xi.types.toString(),gi=xi.items;if(Mi==="Files"||xi.types.indexOf("Files")>-1){if(hr.preventDefault(),Le=="stex")return;try{let ci=gi[1];((ni=gi[0])==null?void 0:ni.kind)==="file"&&(ci=gi[0]);const ki=ci.getAsFile(),Hi=ki.name.split(".").pop();(0,Ge.I)(ki,$i=>{var oa,Gr,ei;$i.id?((oa=ki==null?void 0:ki.type)==null?void 0:oa.indexOf("image"))>-1?Wn.replaceSelection(`<img width="100%" src="/api/attachments/${$i.id}?type=${$i.content_type})" alt="" />`):((Gr=ki==null?void 0:ki.type)==null?void 0:Gr.indexOf("video"))>-1?Wn.replaceSelection(`<video width="100%" controls src="/api/attachments/${$i.id}"></video>`):((ei=ki==null?void 0:ki.type)==null?void 0:ei.indexOf("pdf"))>-1?Wn.replaceSelection(`<a href="/api/attachments/${$i.id}?type=${ki.type}&disposition=inline" target="_blank">${ki.name}</a>`):Dr.includes(Hi)?Wn.replaceSelection(`<a href="/api/attachments/${$i.id}?type=office&disposition=inline" target="_blank">${ki.name}</a>`):Wn.replaceSelection(`[${ki.name}](/api/attachments/${$i.id}?type=${$i.content_type})`):($i==null?void 0:$i.status)===401&&(Vt.ZP.warning(($i==null?void 0:$i.message)||"\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C"),document.location.href="/user/login")})}catch(ci){Vt.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const Wn=$e().fromTextArea(Ur.current,{mode:Le,lineNumbers:!wr,lineWrapping:!0,value:ar,autoCloseTags:!Lt,autoCloseBrackets:!0});return Wn.on("keyup",function(Hn,hr){hr.keyCode===8&&(Hn.getValue()==""?Wn.setOption("placeholder",Et):Wn.setOption("placeholder",null))}),Wn.on("keydown",function(Hn,hr){if(hr.keyCode===8){var ni=Ar(Hn);ni&&hr.preventDefault()}}),Qe&&Wn.focus(),Wn.on("paste",Gn),Wn.on("dragleave",function(Hn,hr){rr.current.classList.remove("mouse-hover-md")}),pt&&Wn.on("beforeChange",function(Hn,hr){(hr.origin==="paste"||hr.origin==="+input")&&hr.cancel()}),dt(Wn),()=>{Wn.off("paste",Gn)}}},[]);const _r=(0,pe.useCallback)(()=>{if(rr.current)try{}catch(Gn){console.log(Gn,"---- to set md editor body height")}},[sr,rr,Bt]);(0,pe.useEffect)(()=>{function Gn(){let Wn=new ct.Z(Hn=>{for(let hr of Hn)(hr.target.offsetHeight>0||hr.target.offsetWidth>0)&&(_r(),Te.setSize("100%","100%"),Te.refresh())});return Wn.observe(Ur.current.parentElement),Wn}if(Te){const Wn=Gn();return()=>{var Hn,hr;(Hn=Ur.current)!=null&&Hn.parentElement&&Wn.unobserve((hr=Ur.current)==null?void 0:hr.parentElement)}}},[Te,_r]),(0,pe.useEffect)(()=>{if(Te){let Gn=[];for(const[Wn,Hn]of Object.entries(Er)){let hr={[Wn]:()=>{dr(Hn)}};Gn.push(hr),Te.addKeyMap(hr)}return Vn.current=setInterval(()=>{mr.current&&Mr()},4e3),()=>{clearInterval(Vn.current);for(let Wn of Gn)Te.removeKeyMap(Wn)}}},[Te]),(0,pe.useEffect)(()=>{sn!==Bt&&un(sn)},[sn]),(0,Nn.Z)(()=>{if(!it&&$n>0){let Gn=new Date().getTime(),Wn=window.sessionStorage.getItem(De);Gn>=$n+gr&&(!Wn||Wn!==ft)&&(window.sessionStorage.setItem(De,ft),ur(!0))}},gr),(0,pe.useEffect)(()=>{Pt(Me)},[Te,Me]),(0,pe.useEffect)(()=>{Te&&Qe&&Te.focus()},[Te,Qe]),(0,pe.useEffect)(()=>{if(_t&&Te){let Gn=function(Hn){let hr=Hn.target;if(Sn.current){let ni=hr.scrollTop/hr.scrollHeight;Sn.current.scrollTop=Sn.current.scrollHeight*ni}};const Wn=Te.getScrollerElement();return Wn.addEventListener("scroll",Gn),()=>{Wn.removeEventListener("scroll",Gn)}}},[Te,_t]),(0,pe.useEffect)(()=>{if(Te&&xn){let Gn=function(Wn,Hn){xn(Wn,Hn)};return Te.on("beforeChange",Gn),()=>{Te.off("beforeChange",Gn)}}},[Te,xn]),(0,pe.useEffect)(()=>{if(Te&&hn){let Gn=function(){hn(Te.getValue())};return Te.on("blur",Gn),()=>{Te.off("blur",Gn)}}},[Te,hn]);function Ar(Gn,Wn){var Hn=Gn.getDoc(),hr=Hn.getCursor(),ni=Hn.getLine(hr.line),xi=ni.charAt(hr.ch-1),Mi=ni.lastIndexOf("@\u2581@",hr.ch),gi=ni.lastIndexOf("@\u2581\u2581@",hr.ch),ci=Mi>gi?Mi:gi,ki=Mi>gi?3:4;if(Rr.indexOf(xi)===-1)return null;if(console.log("change1:",Wn,Gn,ni,hr,ci,Mi,gi,xi),ci>=0&&hr.ch-ci<5){var Hi=ci+ki;return Hn.replaceRange("",{line:hr.line,ch:ci},{line:hr.line,ch:Hi}),{line:hr.line,ch:Hi}}return null}(0,pe.useEffect)(()=>{if(Te){let Gn=function(Wn,Hn){const hr=Wn.getValue();Tt(hr),qn(new Date().getTime()),Wn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),or&&(Lt?or(hr,di(hr)):or(hr))};return Te.on("change",Gn),()=>{Te.off("change",Gn)}}},[Te,or]),(0,pe.useEffect)(()=>{if(Te)if(ar==null)Te.setValue(""),Tt("");else{const Gn=window.scrollY||window.pageYOffset;ar!==Te.getValue()&&(Te.setValue(ar),Tt(ar),Te.setCursor(pt?1:Te.lineCount(),0),window.scrollTo(0,Gn))}},[Te,ar]);const dr=(0,pe.useCallback)(Gn=>{const Wn=Te.getCursor(),Hn=Te.getSelection();let hr=Hn.split(`
`);switch(Gn){case"bold":return Te.replaceSelection("**"+Hn+"**"),Hn===""&&Te.setCursor(Wn.line,Wn.ch+2),Te.focus();case"italic":return Te.replaceSelection("*"+Hn+"*"),Hn===""&&Te.setCursor(Wn.line,Wn.ch+1),Te.focus();case"code":return Te.replaceSelection("`"+Hn+"`"),Hn===""&&Te.setCursor(Wn.line,Wn.ch+1),Te.focus();case"inline-latex":return _n("inline-latex"),Te.focus();case"latex":return Te.replaceSelection("```latex\n"+Hn+"\n```"),Te.setCursor(Wn.line+1,Hn.length+1),Te.focus();case"line-break":return Te.replaceSelection(`<br/>
`),Te.focus();case"list-ul":return Hn===""?Te.replaceSelection("- "+Hn):Te.replaceSelection(hr.map(ni=>ni===""?"":`- ${ni}`).join(`
`)),Te.focus();case"list-ol":return Hn===""?Te.replaceSelection("1. "+Hn):Te.replaceSelection(hr.map((ni,xi)=>ni===""?"":`${xi+1}. ${ni}`).join(`
`)),Te.focus();case"add-null-ch":Gt==null||Gt();return;case"add-signal":return Hn===""&&Te.setCursor(Wn.line,Wn.ch),Te.replaceSelection(Zr),Te.focus();case"add-multiple":return Hn===""&&Te.setCursor(Wn.line,Wn.ch),Te.replaceSelection(Rr),Te.focus();case"inster-template-1":return Hn===""&&Te.setCursor(Wn.line,Wn.ch),Te.replaceSelection(vr),Te.focus();case"eraser":return Te.setValue(""),Te.focus();case"trigger-watch":return Pt(!_t),Te.focus();case"trigger-full-screen":return un(!Bt),Te.focus();case Jn:_n(Jn);return;case Qt:_n(Qt);return;case tt:_n(tt);return;case Ze:_n(Ze);return;case"maths-latex":_n("maths-latex");return;case Re:fr.current="",sessionStorage.removeItem("file_id"),_n(Re);return;case an:_n(an);return;default:throw new Error}},[Te,_t,Bt]),Sr=(0,pe.useCallback)((Gn,Wn)=>{var Hn,hr,ni,xi,Mi,gi;_n("");const{src:ci,alt:ki,id:Hi}=Gn||{};switch(yn){case Jn:const{title:Ai,link:ai}=Gn;return Te.replaceSelection(`[${Ai}](${ai})`),Te.focus();case Qt:const{language:fi,content:_i}=Gn;return Te.replaceSelection(["```"+fi,_i,"```"].join(`
`)),Te.focus();case"maths-latex":for(var $i=atob(Gn),oa=new Uint8Array($i.length),Gr=0;Gr<$i.length;Gr++)oa[Gr]=$i.charCodeAt(Gr);var ei=new Blob([oa],{type:"image/png"});(0,Ge.I)(ei,oi=>{oi.id?Te.replaceSelection(`![,](/api/attachments/${oi.id}?type=${oi.content_type})`):(oi==null?void 0:oi.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":Te.replaceSelection("`$$"+Gn+"$$`");break;case Ft:if(!Hi)return;Te.focus(),Te.getValue().indexOf(ci)===-1?Te.replaceSelection(`<center><img id="${Hi}" width="80%" src="${ci}" class="draw-flowchart" alt="${ki||""}" /></center>`):document.getElementById(Hi).src=ye.Z.API_SERVER+ci+"?t="+Date.now();try{setTimeout(()=>{hn(Te.getValue())},100)}catch(oi){}break;case tt:case Ze:const pi=Wn,Tr=(ni=(hr=(Hn=pi==null?void 0:pi.name)==null?void 0:Hn.split("."))==null?void 0:hr.pop)==null?void 0:ni.call(hr);return((xi=pi==null?void 0:pi.type)==null?void 0:xi.indexOf("image"))>-1||!(pi!=null&&pi.type)?pi!=null&&pi.align||pi!=null&&pi.width?Te.replaceSelection(`<p style="text-align:${pi.align||"initial"}"><img width="${pi.width?pi.width+"%":"initial"}" src="${ci}" alt="${ki||""}" /></p>`):Te.replaceSelection(`<img width="100%" src="${ci}" alt="${ki||""}" />`):((Mi=pi==null?void 0:pi.type)==null?void 0:Mi.indexOf("video"))>-1?Te.replaceSelection(`<video width="100%" controls src="${ci}"></video>`):((gi=pi==null?void 0:pi.type)==null?void 0:gi.indexOf("pdf"))>-1?Te.replaceSelection(`<a href="${ci}?type=${pi.type}&disposition=inline" target="_blank">${pi.name}</a>`):Dr.includes(Tr)?Te.replaceSelection(`<a href="${ci}?type=office&disposition=inline" target="_blank">${pi.name}</a>`):Te.replaceSelection(`[${pi.name}](${ci})`),Te.focus();case an:const{row:Xr,col:Vr,align:$r}=Gn;let ui=`
`;for(let oi=0;oi<Xr;oi++){let zi=[],Wi=[];for(let Zi=0;Zi<Vr;Zi++)oi===1&&Wi.push(On[$r]),zi.push(" ");oi===1&&(ui+=`| ${Wi.join(" | ")} |
`),ui+=`| ${zi.join(Vr===1?"":" | ")} |
`}return Te.replaceSelection(ui+`
`),Te.focus();default:throw new Error}},[Te,yn]),ii=(0,pe.useMemo)(()=>{switch(yn){case Jn:return pe.createElement(pn,{callback:Sr,onCancel:zn});case Qt:return pe.createElement(Ut.Z,{callback:Sr,onCancel:zn});case tt:return pe.createElement(Ge.Z,{callback:Sr,onCancel:zn});case Re:return pe.createElement(fe,{editImgId:fr.current,callback:Sr,onCancel:zn});case an:return pe.createElement(Jt,{callback:Sr,onCancel:zn});case"maths-latex":return pe.createElement(En,{showSaveButton:!0,callback:Sr});case"inline-latex":return pe.createElement(yt.Z,{showSaveButton:!0,callback:Sr});default:return null}},[yn]);function zn(){_n("")}(0,pe.useEffect)(()=>{if(Cn.current){let Gn=function(Mi){ni=!0,xi=Mi.pageY},Wn=function(){ni=!1},Hn=function(Mi){if(ni){let gi=Mi.pageY-xi;gi<0&&(gi=0),gi>300&&(gi=300);let ci=In+gi+"px";jn(ci)}},hr=Cn.current,ni=!1,xi=0;return hr.addEventListener("mousedown",Gn),document.addEventListener("mousemove",Hn),document.addEventListener("mouseup",Wn),()=>{hr.removeEventListener("mousedown",Gn),document.removeEventListener("mousemove",Hn),document.removeEventListener("mouseup",Wn)}}},[Te,Cn]),(0,pe.useEffect)(()=>{jn(In)},[In]);const Xn=yr(Bn),kr=yr(sr),Br={width:Xn,height:kr},li=(0,pe.useMemo)(()=>{if($n){let Gn=new Date($n),Wn=Gn.getHours(),Hn=Gn.getMinutes(),hr=Gn.getSeconds();return Wn=Wn<10?"0"+Wn:Wn,Hn=Hn<10?"0"+Hn:Hn,hr=hr<10?"0"+hr:hr,`${Wn}:${Hn}:${hr}`}return 0},[$n]),di=Gn=>{const Wn=[];if(Lt){let Hn=-1;Gn=Gn.replace(/(@▁▁@|@▁@)/g,function(hr,ni,xi){Wn.push({multiLine:hr!==Zr})})}return Wn};function ri(){window.sessionStorage.removeItem(De),ur(!1),qn(0)}function Yr(){ur(!1),qn(0),Te.setValue(window.sessionStorage.getItem(De))}(0,pe.useEffect)(()=>{qr[yn]&&yn!==Ze&&yn!==Re&&setTimeout(()=>{const Gn=document.getElementsByClassName("markdown-popup-form")[0],Wn=window.innerWidth/2-Gn.offsetWidth/2,Hn=window.innerHeight/2-Gn.offsetHeight/2;br(Wn),Ir(Hn)},0)},[yn]);const yi=Gn=>{Gn.preventDefault();const Wn=Gn.clientX-Un,Hn=Gn.clientY-lr;document.body.onmousemove=hr=>{let ni=hr.clientX-Wn,xi=hr.clientY-Hn;const Mi=document.getElementsByClassName("markdown-popup-form")[0],gi=window.innerWidth-Mi.offsetWidth,ci=window.innerHeight-Mi.offsetHeight;ni=Math.max(0,Math.min(ni,gi)),xi=Math.max(0,Math.min(xi,ci)),bi(hr.clientX,hr.clientY,Wn,Hn)&&(br(ni),Ir(xi))},document.body.onmouseup=function(){document.body.onmousemove=null}},bi=(Gn,Wn,Hn,hr)=>{const ni=document.body.clientHeight,xi=document.body.clientWidth;return Gn<20&&Hn>Gn||Gn>xi-20&&Hn<Gn||Wn<20&&hr>Wn||Wn>ni-20&&hr<Wn?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};return pe.createElement(pe.Fragment,null,pe.createElement("div",{className:"markdown-editor-wrapper",ref:rr},pe.createElement("div",{className:`markdown-editor-container ${rn} ${_t?"on-preview":""} ${wr?"mini":""} ${Bt?"full-screen":""}`,style:Br},pe.createElement(at,{insertTemp:Ae,watch:_t,fullScreen:Bt,showNullButton:Nt,showNullProgramButton:Lt,onActionCallback:dr,hidetoolBar:$t,extraUse:St}),pe.createElement("div",{className:"markdown-editor-body"},pe.createElement("div",{className:"codemirror-container"},pe.createElement("textarea",{ref:Ur,placeholder:Et})),_t?pe.createElement("div",{ref:Sn,className:"preview-container"},Le==="stex"&&pe.createElement(Oe,{value:ft}),Le!=="stex"&&pe.createElement(gt.Z,{edit:!0,disabledFill:Ct,showProgramFill:Lt,value:ft,openEditor:Gn=>{var Wn;fr.current=Gn,(Wn=er.current)==null||Wn.setHeight("100vh"),setTimeout(()=>{_n("add-flowchart")},150)}})):null))),We?pe.createElement("a",{ref:Cn,className:"editor-resize"}):null,yn===Ze&&pe.createElement(bn,{callback:Sr,onCancel:zn}),yn===Re&&pe.createElement(fe,{ref:er,editImgId:fr.current,callback:Sr,onCancel:zn}),pe.createElement(vt.Z,null,qr[yn]&&yn!==Ze&&yn!==Re?pe.createElement(Ye.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:Un,top:lr},title:pe.createElement("div",{style:{cursor:"move"},onMouseDown:yi},qr[yn]),open:!0,onCancel:zn,footer:null,destroyOnClose:!0,width:yn===Re?"1200px":null,height:yn===Re?"80vh":null,className:"markdown-popup-form"},ii):null))}},30315:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return Xe},I:function(){return vt}});var pe=de(78241),ut=de(8591),$e=de(92832),ct=de(81327),Se=de(5871),Pe=de(5112),Ne=de(3113),Ce=de(5862),ke=de(59301),Fe=de(35219),gt=de(59301),Oe=Object.defineProperty,je=Object.defineProperties,kt=Object.getOwnPropertyDescriptors,et=Object.getOwnPropertySymbols,mt=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable,Rt=(Ue,Ot,rt)=>Ot in Ue?Oe(Ue,Ot,{enumerable:!0,configurable:!0,writable:!0,value:rt}):Ue[Ot]=rt,tn=(Ue,Ot)=>{for(var rt in Ot||(Ot={}))mt.call(Ot,rt)&&Rt(Ue,rt,Ot[rt]);if(et)for(var rt of et(Ot))st.call(Ot,rt)&&Rt(Ue,rt,Ot[rt]);return Ue},nt=(Ue,Ot)=>je(Ue,kt(Ot));const{useForm:ht}=pe.default,Ve={width:280,marginRight:10},Ee={labelCol:{span:5},wrapperCol:{span:19}};var Xe=({callback:Ue,onCancel:Ot})=>{const[rt]=ht();let At=(0,ke.useRef)();function qe(Kt){At.current.width=rt.getFieldValue("width"),At.current.align=rt.getFieldValue("align"),Ue(Kt,At.current)}function Ht(Kt,Xt){if(Kt.status===-1){ut.ZP.error(Kt.message);return}rt.setFieldsValue({src:`/api/attachments/${Kt.id}`,type:Xt.type})}function cn(Kt){let Xt=Kt.target.files[0];At.current=Xt,vt(Xt,Ht)}return gt.createElement(pe.default,nt(tn({form:rt},Ee),{className:"upload-image-panel",onFinish:qe,style:{width:470,overflow:"hidden"}}),gt.createElement(pe.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},gt.createElement("div",{className:"flex-container"},gt.createElement(pe.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},gt.createElement($e.default,{style:Ve})),gt.createElement(at,{onFileChange:cn}))),gt.createElement(pe.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},gt.createElement($e.default,{style:{width:264}})),gt.createElement(pe.default.Item,{label:"\u56FE\u7247\u5BBD\u5EA6",name:"width"},gt.createElement(ct.Z,null,gt.createElement(pe.default.Item,{name:"width",style:{margin:0}},gt.createElement(Se.Z,{style:{width:264}})),gt.createElement("span",{className:"ml8"},"%"))),gt.createElement(pe.default.Item,{label:"\u5BF9\u9F50\u65B9\u5F0F",name:"align"},gt.createElement(Pe.ZP.Group,{name:"align",defaultValue:1,options:[{value:"left",label:"\u5DE6\u5BF9\u9F50"},{value:"center",label:"\u5C45\u4E2D\u5BF9\u9F50"},{value:"right",label:"\u53F3\u5BF9\u9F50"}]})),gt.createElement("aside",null,gt.createElement(pe.default.Item,{style:{textAlign:"right",position:"relative",right:-98}},gt.createElement(Ne.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),gt.createElement(Ne.ZP,{type:"default",onClick:Ot},"\u53D6\u6D88"))))};function at({onFileChange:Ue}){return gt.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",gt.createElement("input",{type:"file",onChange:Ue}))}function vt(Ue,Ot){if(!Ue)throw new String("\u6CA1\u6709\u6587\u4EF6");if(!(0,Fe.bg)())throw ut.ZP.warning("\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C"),new String("\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C");let rt=new FormData;rt.append("editormd-image-file",Ue),rt.append("file_param_name","editormd-image-file"),rt.append("byxhr","true");var At=new window.XMLHttpRequest;At.withCredentials=!0,At.addEventListener("load",function(qe){Ot(JSON.parse(qe.target.responseText),Ue)},!1),At.addEventListener("error",function(qe){console.error(qe)},!1),At.open("POST",`${Ce.KI}/api/attachments.json`),At.send(rt)}},23252:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return $e}});var pe=de(59301),ut=de(4676);class $e extends pe.Component{constructor(Se){super(Se);const Pe=window.document;this.node=Pe.createElement("div"),Pe.body.appendChild(this.node)}render(){const{children:Se}=this.props;return(0,ut.createPortal)(Se,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},34500:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return ut}});var pe=de(59301);function ut($e,ct){const Se=(0,pe.useRef)();(0,pe.useEffect)(()=>{Se.current=$e}),(0,pe.useEffect)(()=>{function Pe(){Se.current()}if(ct!==null){let Ne=setInterval(Pe,ct);return()=>clearInterval(Ne)}},[ct])}},27768:function(kn,dn,de){"use strict";de.r(dn),de.d(dn,{default:function(){return at}});var pe=de(59301),ut=de(20387),$e=de(8591),ct=de(92832),Se=de(3113),Pe=de(23789),Ne=(vt,Ue,Ot)=>new Promise((rt,At)=>{var qe=Kt=>{try{cn(Ot.next(Kt))}catch(Xt){At(Xt)}},Ht=Kt=>{try{cn(Ot.throw(Kt))}catch(Xt){At(Xt)}},cn=Kt=>Kt.done?rt(Kt.value):Promise.resolve(Kt.value).then(qe,Ht);cn((Ot=Ot.apply(vt,Ue)).next())});function Ce({setIscreate:vt,init:Ue,UpdateItem:Ot}){const[rt,At]=(0,pe.useState)(""),[qe,Ht]=(0,pe.useState)("");(0,pe.useEffect)(()=>{Ot&&(At(Ot&&Ot.name),Ht(Ot&&Ot.description))},[Ot]);function cn(){return Ne(this,null,function*(){if(!rt){$e.ZP.info("\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A");return}if(!qe){$e.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A");return}if(Ot){Kt();return}(yield(0,Pe.ZP)("/api/hpc_courses.json",{method:"post",body:{name:rt,description:qe,container_type:window.location.pathname.split("/")[1]}}))&&($e.ZP.info("\u521B\u5EFA\u6210\u529F"),vt(!1),Ue("add"))})}function Kt(){return Ne(this,null,function*(){(yield(0,Pe.ZP)(`/api/hpc_courses/${Ot.id}.json`,{method:"put",body:{name:rt,description:qe,container_type:window.location.pathname.split("/")[1]}}))&&($e.ZP.info("\u7F16\u8F91\u6210\u529F"),vt(!1),Ue(""))})}return pe.createElement("div",null,pe.createElement(ct.default,{style:{marginBottom:"20px"},placeholder:"\u8BF7\u8F93\u5165\u6807\u9898",value:rt,maxLength:60,addonAfter:String(rt.length)+"/60",onChange:Xt=>At(Xt.target.value)}),pe.createElement(ut.Z,{id:"courseContentMD",defaultValue:qe,onChange:Xt=>Ht(Xt)}),pe.createElement("div",{className:"clearfix mt30 mb30"},pe.createElement(Se.ZP,{type:"primary",onClick:()=>cn(),className:"defalutSubmitbtn fl mr20"},"\u63D0\u4EA4"),pe.createElement("a",{className:"defalutCancelbtn fl",onClick:()=>vt(!1)},"\u53D6\u6D88")))}var ke=Ce,Fe=de(88622),gt=(vt,Ue,Ot)=>new Promise((rt,At)=>{var qe=Kt=>{try{cn(Ot.next(Kt))}catch(Xt){At(Xt)}},Ht=Kt=>{try{cn(Ot.throw(Kt))}catch(Xt){At(Xt)}},cn=Kt=>Kt.done?rt(Kt.value):Promise.resolve(Kt.value).then(qe,Ht);cn((Ot=Ot.apply(vt,Ue)).next())});function Oe({CourseItem:vt,userId:Ue,init:Ot,ItemUpdate:rt,setSee:At,UserInfo:qe}){function Ht(){return gt(this,null,function*(){(yield(0,Pe.ZP)(`/api/hpc_courses/${vt.id}.json`,{method:"delete"}))&&($e.ZP.info("\u5220\u9664\u6210\u529F"),Ot("delete"),At(!1))})}function cn(){rt(vt)}return pe.createElement("div",null,Ue===299635||Ue===301458||qe!=null&&qe.admin||qe!=null&&qe.business?pe.createElement("div",{style:{textAlign:"right"}},pe.createElement(Se.ZP,{onClick:()=>cn()},"\u7F16\u8F91"),pe.createElement(Se.ZP,{onClick:()=>Ht(),style:{marginLeft:"30px"}},"\u5220\u9664")):null,pe.createElement("h1",null,vt==null?void 0:vt.name),pe.createElement(Fe.Z,{value:vt==null?void 0:vt.description}))}var je=Oe,kt=de(54580),et=de(41510),mt=de(6075),st=Object.defineProperty,Rt=Object.getOwnPropertySymbols,tn=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable,ht=(vt,Ue,Ot)=>Ue in vt?st(vt,Ue,{enumerable:!0,configurable:!0,writable:!0,value:Ot}):vt[Ue]=Ot,Ve=(vt,Ue)=>{for(var Ot in Ue||(Ue={}))tn.call(Ue,Ot)&&ht(vt,Ot,Ue[Ot]);if(Rt)for(var Ot of Rt(Ue))nt.call(Ue,Ot)&&ht(vt,Ot,Ue[Ot]);return vt},Ee=(vt,Ue,Ot)=>new Promise((rt,At)=>{var qe=Kt=>{try{cn(Ot.next(Kt))}catch(Xt){At(Xt)}},Ht=Kt=>{try{cn(Ot.throw(Kt))}catch(Xt){At(Xt)}},cn=Kt=>Kt.done?rt(Kt.value):Promise.resolve(Kt.value).then(qe,Ht);cn((Ot=Ot.apply(vt,Ue)).next())});function Xe({user:vt,dispatch:Ue}){var Ot,rt,At,qe,Ht,cn,Kt,Xt,Wt;const[ze,xe]=(0,pe.useState)(1),[bt,pn]=(0,pe.useState)(100),[Ut,Ge]=(0,pe.useState)([]),[Ye,It]=(0,pe.useState)(!1),[Mn,jt]=(0,pe.useState)(!1),[bn,Vt]=(0,pe.useState)(""),[Zt,zt]=(0,pe.useState)(""),[ve,se]=(0,pe.useState)("");let{itemname:oe}=(0,mt.useParams)();const[fe,ye]=(0,pe.useState)("");(0,pe.useEffect)(()=>{Ue({type:"globalSetting/headerToggle",payload:!1}),ze&&ce("")},[ze]);function ce(en){return Ee(this,null,function*(){var nn,wn;const mn=yield(0,Pe.ZP)("/api/hpc_courses.json",{method:"get",params:{page:ze,per_page:bt,container_type:window.location.pathname.split("/")[1]}});if(mn){let En=mn.data.hpc_courses.length;if(Ge(mn.data.hpc_courses),se(mn.data.file_url),zt(""),!En)return;if(fe)if(en==="delete"){if(En===0){jt(!1);return}Vt(mn.data.hpc_courses[0]),jt(!0),ye(mn.data.hpc_courses[0].id)}else en==="add"?(Vt(mn.data.hpc_courses[En-1]),jt(!0),ye(mn.data.hpc_courses[En-1].id)):(Vt(mn.data.hpc_courses.filter(yt=>yt.id===fe)[0]),jt(!0),ye(fe));else if(oe){let yt=0;(wn=(nn=mn==null?void 0:mn.data)==null?void 0:nn.hpc_courses)==null||wn.map((gn,Jn)=>{var tt;(oe==null?void 0:oe.toLocaleLowerCase())===((tt=gn==null?void 0:gn.name)==null?void 0:tt.toLocaleLowerCase())&&(yt=Jn)}),Vt(mn.data.hpc_courses[yt]),jt(!0),ye(mn.data.hpc_courses[yt].id),(oe==null?void 0:oe.toLocaleLowerCase())==="resources"&&(Vt(mn.data.hpc_courses.filter(gn=>gn.id===15)[0]),jt(!0),ye(15))}else Vt(mn.data.hpc_courses[0]),jt(!0),ye(mn.data.hpc_courses[0].id)}})}function Ke(en){It(!1),jt(!0),Vt(en),ye(en.id)}function Dt(en){zt(en),It(!0),jt(!1)}function ln(){zt(""),It(!0),jt(!1)}const Jt={name:"file",multiple:!0,action:"https://www.educoder.net/api/hpc_courses/upload_file.json",data:{container_type:window.location.pathname.split("/")[1]},onChange(en){const{status:nn}=en.file;nn==="done"?($e.ZP.success(`${en.file.name} \u6587\u4EF6\u4E0A\u4F20\u6210\u529F`),ce("")):nn==="error"&&$e.ZP.error(`${en.file.name} \u6587\u4EF6\u4E0A\u4F20\u5931\u8D25`)},beforeUpload:en=>{const nn=en.size/1024/1024<150;return nn||$e.ZP.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E150MB"),nn}};return pe.createElement("div",{style:{marginBottom:"40px"}},pe.createElement("div",{className:"bannterdiv",style:{background:`url(${et.Z.IMG_SERVER+`/${ve}`})`}}),pe.createElement("img",{style:{width:"100%"},src:et.Z.IMG_SERVER+`/${ve}`}),pe.createElement("div",{className:"edu-container minH500",style:{display:"flex",width:"1200px"}},pe.createElement("div",{style:{flex:"1",marginTop:"17px"}},Ut&&Ut.map((en,nn)=>pe.createElement("p",{key:nn,onClick:()=>Ke(en),className:fe===en.id?"menuitemselect":"menuitem task-hide"},en.name)),((Ot=vt==null?void 0:vt.userInfo)==null?void 0:Ot.user_id)===299635||((rt=vt==null?void 0:vt.userInfo)==null?void 0:rt.user_id)===301458||(At=vt==null?void 0:vt.userInfo)!=null&&At.admin||(qe=vt==null?void 0:vt.userInfo)!=null&&qe.business?pe.createElement("p",{onClick:()=>ln(),className:"menuadd",style:{fontSize:"24px",paddingLeft:"10px"}},pe.createElement("span",{style:{fontSize:"16px",marginLeft:"5px"}},"Last updated")):null),pe.createElement("div",{className:"rightcount",style:{flex:"6",background:"#ffffff",padding:"20px",marginLeft:"30px",marginTop:"24px"}},Ye?pe.createElement(ke,{UpdateItem:Zt,setIscreate:It,init:ce}):null,Mn?pe.createElement(je,{UserInfo:vt==null?void 0:vt.userInfo,setSee:jt,userId:(Ht=vt==null?void 0:vt.userInfo)==null?void 0:Ht.user_id,ItemUpdate:Dt,CourseItem:bn,init:ce}):null)),((cn=vt==null?void 0:vt.userInfo)==null?void 0:cn.user_id)===299635||((Kt=vt==null?void 0:vt.userInfo)==null?void 0:Kt.user_id)===301458||(Xt=vt==null?void 0:vt.userInfo)!=null&&Xt.admin||(Wt=vt==null?void 0:vt.userInfo)!=null&&Wt.business?pe.createElement(kt.default,Ve({},Jt),pe.createElement(Se.ZP,{className:"menuadd",style:{paddingLeft:"10px",marginLeft:"20px"}},"\u4E0A\u4F20\u9996\u9875\u56FE\u7247")):null)}var at=(0,mt.connect)(({user:vt})=>({user:vt}))(Xe)},56762:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return ut}});var pe=de(59301);function ut(){const[,$e]=pe.useReducer(ct=>ct+1,0);return $e}},19080:function(kn,dn,de){"use strict";de.d(dn,{F:function(){return Se},Z:function(){return ct}});var pe=de(92310),ut=de.n(pe);const $e=null;function ct(Pe,Ne,Ce){return ut()({[`${Pe}-status-success`]:Ne==="success",[`${Pe}-status-warning`]:Ne==="warning",[`${Pe}-status-error`]:Ne==="error",[`${Pe}-status-validating`]:Ne==="validating",[`${Pe}-has-feedback`]:Ce})}const Se=(Pe,Ne)=>Ne||Pe},93891:function(kn,dn,de){"use strict";var pe=de(59301),ut=de(36355),$e=de(64165);const ct=Se=>{const{componentName:Pe}=Se,{getPrefixCls:Ne}=(0,pe.useContext)(ut.E_),Ce=Ne("empty");switch(Pe){case"Table":case"List":return pe.createElement($e.Z,{image:$e.Z.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return pe.createElement($e.Z,{image:$e.Z.PRESENTED_IMAGE_SIMPLE,className:`${Ce}-small`});default:return pe.createElement($e.Z,null)}};dn.Z=ct},43428:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return Vt}});var pe=de(92310),ut=de.n(pe),$e=de(85899),ct=de(72190),Se=de(43403),Pe=de(34280),Ne=de(59301),Ce=Ne.createContext(null),ke=Ne.createContext({}),Fe=Ce,gt=de(18642),Oe=de(60499),je=de(77900),kt=de(10228),et=de(26112),mt=de(70425),st=function(zt){var ve=zt.prefixCls,se=zt.className,oe=zt.style,fe=zt.children,ye=zt.containerRef,ce=zt.id,Ke=zt.onMouseEnter,Dt=zt.onMouseOver,ln=zt.onMouseLeave,Jt=zt.onClick,en=zt.onKeyDown,nn=zt.onKeyUp,wn={onMouseEnter:Ke,onMouseOver:Dt,onMouseLeave:ln,onClick:Jt,onKeyDown:en,onKeyUp:nn},mn=Ne.useContext(ke),En=mn.panel,yt=(0,mt.useComposeRef)(En,ye);return Ne.createElement(Ne.Fragment,null,Ne.createElement("div",(0,Oe.Z)({id:ce,className:ut()("".concat(ve,"-content"),se),style:(0,$e.Z)({},oe),"aria-modal":"true",role:"dialog",ref:yt},wn),fe))},Rt=st,tn=de(48736);function nt(Zt){return typeof Zt=="string"&&String(Number(Zt))===Zt?((0,tn.ZP)(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(Zt)):Zt}function ht(Zt){warning(!("wrapperClassName"in Zt),"'wrapperClassName' is removed. Please use 'rootClassName' instead."),warning(canUseDom()||!Zt.open,"Drawer with 'open' in SSR is not work since no place to createPortal. Please move to 'useEffect' instead.")}var Ve={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function Ee(Zt,zt){var ve,se,oe,fe,ye=Zt.prefixCls,ce=Zt.open,Ke=Zt.placement,Dt=Zt.inline,ln=Zt.push,Jt=Zt.forceRender,en=Zt.autoFocus,nn=Zt.keyboard,wn=Zt.rootClassName,mn=Zt.rootStyle,En=Zt.zIndex,yt=Zt.className,gn=Zt.id,Jn=Zt.style,tt=Zt.motion,Re=Zt.width,Ze=Zt.height,Ft=Zt.children,Qt=Zt.contentWrapperStyle,an=Zt.mask,Pn=Zt.maskClosable,On=Zt.maskMotion,Nn=Zt.maskClassName,Zn=Zt.maskStyle,tr=Zt.afterOpenChange,Tn=Zt.onClose,gr=Zt.onMouseEnter,Pr=Zt.onMouseOver,Rr=Zt.onMouseLeave,Zr=Zt.onClick,vr=Zt.onKeyDown,Dr=Zt.onKeyUp,yr=Ne.useRef(),Nr=Ne.useRef(),Wr=Ne.useRef();Ne.useImperativeHandle(zt,function(){return yr.current});var Er=function(Lt){var $t=Lt.keyCode,sn=Lt.shiftKey;switch($t){case kt.Z.TAB:{if($t===kt.Z.TAB){if(!sn&&document.activeElement===Wr.current){var hn;(hn=Nr.current)===null||hn===void 0||hn.focus({preventScroll:!0})}else if(sn&&document.activeElement===Nr.current){var xn;(xn=Wr.current)===null||xn===void 0||xn.focus({preventScroll:!0})}}break}case kt.Z.ESC:{Tn&&nn&&(Lt.stopPropagation(),Tn(Lt));break}}};Ne.useEffect(function(){if(ce&&en){var Nt;(Nt=yr.current)===null||Nt===void 0||Nt.focus({preventScroll:!0})}},[ce]);var qr=Ne.useState(!1),zr=(0,ct.Z)(qr,2),ar=zr[0],or=zr[1],Bn=Ne.useContext(Fe),In;ln===!1?In={distance:0}:ln===!0?In={}:In=ln||{};var wr=(ve=(se=(oe=In)===null||oe===void 0?void 0:oe.distance)!==null&&se!==void 0?se:Bn==null?void 0:Bn.pushDistance)!==null&&ve!==void 0?ve:180,Qe=Ne.useMemo(function(){return{pushDistance:wr,push:function(){or(!0)},pull:function(){or(!1)}}},[wr]);Ne.useEffect(function(){if(ce){var Nt;Bn==null||(Nt=Bn.push)===null||Nt===void 0||Nt.call(Bn)}else{var Lt;Bn==null||(Lt=Bn.pull)===null||Lt===void 0||Lt.call(Bn)}},[ce]),Ne.useEffect(function(){return function(){var Nt;Bn==null||(Nt=Bn.pull)===null||Nt===void 0||Nt.call(Bn)}},[]);var Me=an&&Ne.createElement(je.default,(0,Oe.Z)({key:"mask"},On,{visible:ce}),function(Nt,Lt){var $t=Nt.className,sn=Nt.style;return Ne.createElement("div",{className:ut()("".concat(ye,"-mask"),$t,Nn),style:(0,$e.Z)((0,$e.Z)({},sn),Zn),onClick:Pn&&ce?Tn:void 0,ref:Lt})}),Ae=typeof tt=="function"?tt(Ke):tt,Le={};if(ar&&wr)switch(Ke){case"top":Le.transform="translateY(".concat(wr,"px)");break;case"bottom":Le.transform="translateY(".concat(-wr,"px)");break;case"left":Le.transform="translateX(".concat(wr,"px)");break;default:Le.transform="translateX(".concat(-wr,"px)");break}Ke==="left"||Ke==="right"?Le.width=nt(Re):Le.height=nt(Ze);var De={onMouseEnter:gr,onMouseOver:Pr,onMouseLeave:Rr,onClick:Zr,onKeyDown:vr,onKeyUp:Dr},We=Ne.createElement(je.default,(0,Oe.Z)({key:"panel"},Ae,{visible:ce,forceRender:Jt,onVisibleChanged:function(Lt){tr==null||tr(Lt)},removeOnLeave:!1,leavedClassName:"".concat(ye,"-content-wrapper-hidden")}),function(Nt,Lt){var $t=Nt.className,sn=Nt.style;return Ne.createElement("div",(0,Oe.Z)({className:ut()("".concat(ye,"-content-wrapper"),$t),style:(0,$e.Z)((0,$e.Z)((0,$e.Z)({},Le),sn),Qt)},(0,et.Z)(Zt,{data:!0})),Ne.createElement(Rt,(0,Oe.Z)({id:gn,containerRef:Lt,prefixCls:ye,className:yt,style:Jn},De),Ft))}),it=(0,$e.Z)({},mn);return En&&(it.zIndex=En),Ne.createElement(Fe.Provider,{value:Qe},Ne.createElement("div",{className:ut()(ye,"".concat(ye,"-").concat(Ke),wn,(fe={},(0,gt.Z)(fe,"".concat(ye,"-open"),ce),(0,gt.Z)(fe,"".concat(ye,"-inline"),Dt),fe)),style:it,tabIndex:-1,ref:yr,onKeyDown:Er},Me,Ne.createElement("div",{tabIndex:0,ref:Nr,style:Ve,"aria-hidden":"true","data-sentinel":"start"}),We,Ne.createElement("div",{tabIndex:0,ref:Wr,style:Ve,"aria-hidden":"true","data-sentinel":"end"})))}var Xe=Ne.forwardRef(Ee),at=Xe,vt=function(zt){var ve=zt.open,se=ve===void 0?!1:ve,oe=zt.prefixCls,fe=oe===void 0?"rc-drawer":oe,ye=zt.placement,ce=ye===void 0?"right":ye,Ke=zt.autoFocus,Dt=Ke===void 0?!0:Ke,ln=zt.keyboard,Jt=ln===void 0?!0:ln,en=zt.width,nn=en===void 0?378:en,wn=zt.mask,mn=wn===void 0?!0:wn,En=zt.maskClosable,yt=En===void 0?!0:En,gn=zt.getContainer,Jn=zt.forceRender,tt=zt.afterOpenChange,Re=zt.destroyOnClose,Ze=zt.onMouseEnter,Ft=zt.onMouseOver,Qt=zt.onMouseLeave,an=zt.onClick,Pn=zt.onKeyDown,On=zt.onKeyUp,Nn=zt.panelRef,Zn=Ne.useState(!1),tr=(0,ct.Z)(Zn,2),Tn=tr[0],gr=tr[1],Pr=Ne.useState(!1),Rr=(0,ct.Z)(Pr,2),Zr=Rr[0],vr=Rr[1];(0,Pe.Z)(function(){vr(!0)},[]);var Dr=Zr?se:!1,yr=Ne.useRef(),Nr=Ne.useRef();(0,Pe.Z)(function(){Dr&&(Nr.current=document.activeElement)},[Dr]);var Wr=function(or){var Bn;if(gr(or),tt==null||tt(or),!or&&Nr.current&&!((Bn=yr.current)!==null&&Bn!==void 0&&Bn.contains(Nr.current))){var In;(In=Nr.current)===null||In===void 0||In.focus({preventScroll:!0})}},Er=Ne.useMemo(function(){return{panel:Nn}},[Nn]);if(!Jn&&!Tn&&!Dr&&Re)return null;var qr={onMouseEnter:Ze,onMouseOver:Ft,onMouseLeave:Qt,onClick:an,onKeyDown:Pn,onKeyUp:On},zr=(0,$e.Z)((0,$e.Z)({},zt),{},{open:Dr,prefixCls:fe,placement:ce,autoFocus:Dt,keyboard:Jt,width:nn,mask:mn,maskClosable:yt,inline:gn===!1,afterOpenChange:Wr,ref:yr},qr);return Ne.createElement(ke.Provider,{value:Er},Ne.createElement(Se.Z,{open:Dr||Jn||Tn,autoDestroy:!1,getContainer:gn,autoLock:mn&&(Dr||Tn)},Ne.createElement(at,zr)))},Ue=vt,Ot=Ue,rt=de(62892),At=de(36355),qe=de(32441),Ht=de(47729),Kt=Zt=>{const{prefixCls:zt,title:ve,footer:se,extra:oe,closeIcon:fe,closable:ye,onClose:ce,headerStyle:Ke,drawerStyle:Dt,bodyStyle:ln,footerStyle:Jt,children:en}=Zt,nn=Ne.useCallback(gn=>Ne.createElement("button",{type:"button",onClick:ce,"aria-label":"Close",className:`${zt}-close`},gn),[ce]),[wn,mn]=(0,Ht.Z)(ye,fe,nn,void 0,!0),En=Ne.useMemo(()=>!ve&&!wn?null:Ne.createElement("div",{style:Ke,className:ut()(`${zt}-header`,{[`${zt}-header-close-only`]:wn&&!ve&&!oe})},Ne.createElement("div",{className:`${zt}-header-title`},mn,ve&&Ne.createElement("div",{className:`${zt}-title`},ve)),oe&&Ne.createElement("div",{className:`${zt}-extra`},oe)),[wn,mn,oe,Ke,zt,ve]),yt=Ne.useMemo(()=>{if(!se)return null;const gn=`${zt}-footer`;return Ne.createElement("div",{className:gn,style:Jt},se)},[se,Jt,zt]);return Ne.createElement("div",{className:`${zt}-wrapper-body`,style:Dt},En,Ne.createElement("div",{className:`${zt}-body`,style:ln},en),yt)},Xt=de(33234),Wt=de(83116),ze=de(37613),bt=Zt=>{const{componentCls:zt,motionDurationSlow:ve}=Zt,se={"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${ve}`}}};return{[zt]:{[`${zt}-mask-motion`]:{"&-enter, &-appear, &-leave":{"&-active":{transition:`all ${ve}`}},"&-enter, &-appear":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}}},[`${zt}-panel-motion`]:{"&-left":[se,{"&-enter, &-appear":{"&-start":{transform:"translateX(-100%) !important"},"&-active":{transform:"translateX(0)"}},"&-leave":{transform:"translateX(0)","&-active":{transform:"translateX(-100%)"}}}],"&-right":[se,{"&-enter, &-appear":{"&-start":{transform:"translateX(100%) !important"},"&-active":{transform:"translateX(0)"}},"&-leave":{transform:"translateX(0)","&-active":{transform:"translateX(100%)"}}}],"&-top":[se,{"&-enter, &-appear":{"&-start":{transform:"translateY(-100%) !important"},"&-active":{transform:"translateY(0)"}},"&-leave":{transform:"translateY(0)","&-active":{transform:"translateY(-100%)"}}}],"&-bottom":[se,{"&-enter, &-appear":{"&-start":{transform:"translateY(100%) !important"},"&-active":{transform:"translateY(0)"}},"&-leave":{transform:"translateY(0)","&-active":{transform:"translateY(100%)"}}}]}}}};const pn=Zt=>{const{componentCls:zt,zIndexPopup:ve,colorBgMask:se,colorBgElevated:oe,motionDurationSlow:fe,motionDurationMid:ye,padding:ce,paddingLG:Ke,fontSizeLG:Dt,lineHeightLG:ln,lineWidth:Jt,lineType:en,colorSplit:nn,marginSM:wn,colorIcon:mn,colorIconHover:En,colorText:yt,fontWeightStrong:gn,footerPaddingBlock:Jn,footerPaddingInline:tt}=Zt,Re=`${zt}-content-wrapper`;return{[zt]:{position:"fixed",inset:0,zIndex:ve,pointerEvents:"none","&-pure":{position:"relative",background:oe,[`&${zt}-left`]:{boxShadow:Zt.boxShadowDrawerLeft},[`&${zt}-right`]:{boxShadow:Zt.boxShadowDrawerRight},[`&${zt}-top`]:{boxShadow:Zt.boxShadowDrawerUp},[`&${zt}-bottom`]:{boxShadow:Zt.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${zt}-mask`]:{position:"absolute",inset:0,zIndex:ve,background:se,pointerEvents:"auto"},[Re]:{position:"absolute",zIndex:ve,maxWidth:"100vw",transition:`all ${fe}`,"&-hidden":{display:"none"}},[`&-left > ${Re}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:Zt.boxShadowDrawerLeft},[`&-right > ${Re}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:Zt.boxShadowDrawerRight},[`&-top > ${Re}`]:{top:0,insetInline:0,boxShadow:Zt.boxShadowDrawerUp},[`&-bottom > ${Re}`]:{bottom:0,insetInline:0,boxShadow:Zt.boxShadowDrawerDown},[`${zt}-content`]:{width:"100%",height:"100%",overflow:"auto",background:oe,pointerEvents:"auto"},[`${zt}-wrapper-body`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%"},[`${zt}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${ce}px ${Ke}px`,fontSize:Dt,lineHeight:ln,borderBottom:`${Jt}px ${en} ${nn}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${zt}-extra`]:{flex:"none"},[`${zt}-close`]:{display:"inline-block",marginInlineEnd:wn,color:mn,fontWeight:gn,fontSize:Dt,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,outline:0,cursor:"pointer",transition:`color ${ye}`,textRendering:"auto","&:focus, &:hover":{color:En,textDecoration:"none"}},[`${zt}-title`]:{flex:1,margin:0,color:yt,fontWeight:Zt.fontWeightStrong,fontSize:Dt,lineHeight:ln},[`${zt}-body`]:{flex:1,minWidth:0,minHeight:0,padding:Ke,overflow:"auto"},[`${zt}-footer`]:{flexShrink:0,padding:`${Jn}px ${tt}px`,borderTop:`${Jt}px ${en} ${nn}`},"&-rtl":{direction:"rtl"}}}};var Ut=(0,Wt.Z)("Drawer",Zt=>{const zt=(0,ze.TS)(Zt,{});return[pn(zt),bt(zt)]},Zt=>({zIndexPopup:Zt.zIndexPopupBase,footerPaddingBlock:Zt.paddingXS,footerPaddingInline:Zt.padding})),Ge=de(11575),Ye=function(Zt,zt){var ve={};for(var se in Zt)Object.prototype.hasOwnProperty.call(Zt,se)&&zt.indexOf(se)<0&&(ve[se]=Zt[se]);if(Zt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var oe=0,se=Object.getOwnPropertySymbols(Zt);oe<se.length;oe++)zt.indexOf(se[oe])<0&&Object.prototype.propertyIsEnumerable.call(Zt,se[oe])&&(ve[se[oe]]=Zt[se[oe]]);return ve};const It=null,Mn={distance:180},jt=Zt=>{var zt;const{rootClassName:ve,width:se,height:oe,size:fe="default",mask:ye=!0,push:ce=Mn,open:Ke,afterOpenChange:Dt,onClose:ln,prefixCls:Jt,getContainer:en,style:nn,className:wn,visible:mn,afterVisibleChange:En}=Zt,yt=Ye(Zt,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","style","className","visible","afterVisibleChange"]),{getPopupContainer:gn,getPrefixCls:Jn,direction:tt,drawer:Re}=Ne.useContext(At.E_),Ze=Jn("drawer",Jt),[Ft,Qt]=Ut(Ze),an=en===void 0&&gn?()=>gn(document.body):en,Pn=ut()({"no-mask":!ye,[`${Ze}-rtl`]:tt==="rtl"},ve,Qt),On=Ne.useMemo(()=>se!=null?se:fe==="large"?736:378,[se,fe]),Nn=Ne.useMemo(()=>oe!=null?oe:fe==="large"?736:378,[oe,fe]),Zn={motionName:(0,rt.m)(Ze,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},tr=gr=>({motionName:(0,rt.m)(Ze,`panel-motion-${gr}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500}),Tn=(0,Ge.H)();return Ft(Ne.createElement(Xt.BR,null,Ne.createElement(qe.Ux,{status:!0,override:!0},Ne.createElement(Ot,Object.assign({prefixCls:Ze,onClose:ln,maskMotion:Zn,motion:tr},yt,{open:Ke!=null?Ke:mn,mask:ye,push:ce,width:On,height:Nn,style:Object.assign(Object.assign({},Re==null?void 0:Re.style),nn),className:ut()(Re==null?void 0:Re.className,wn),rootClassName:Pn,getContainer:an,afterOpenChange:Dt!=null?Dt:En,panelRef:Tn}),Ne.createElement(Kt,Object.assign({prefixCls:Ze},yt,{onClose:ln}))))))},bn=Zt=>{const{prefixCls:zt,style:ve,className:se,placement:oe="right"}=Zt,fe=Ye(Zt,["prefixCls","style","className","placement"]),{getPrefixCls:ye}=Ne.useContext(At.E_),ce=ye("drawer",zt),[Ke,Dt]=Ut(ce),ln=ut()(ce,`${ce}-pure`,`${ce}-${oe}`,Dt,se);return Ke(Ne.createElement("div",{className:ln,style:ve},Ne.createElement(Kt,Object.assign({prefixCls:ce},fe))))};jt._InternalPanelDoNotUseOrYouWillBeFired=bn;var Vt=jt},64165:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return nt}});var pe=de(92310),ut=de.n(pe),$e=de(59301),ct=de(36355),Se=de(9763),Pe=de(64993),Ne=de(88088),ke=()=>{const[,ht]=(0,Ne.Z)(),Ee=new Pe.C(ht.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return $e.createElement("svg",{style:Ee,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},$e.createElement("g",{fill:"none",fillRule:"evenodd"},$e.createElement("g",{transform:"translate(24 31.67)"},$e.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),$e.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),$e.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),$e.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),$e.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),$e.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),$e.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},$e.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),$e.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},gt=()=>{const[,ht]=(0,Ne.Z)(),{colorFill:Ve,colorFillTertiary:Ee,colorFillQuaternary:Xe,colorBgContainer:at}=ht,{borderColor:vt,shadowColor:Ue,contentColor:Ot}=(0,$e.useMemo)(()=>({borderColor:new Pe.C(Ve).onBackground(at).toHexShortString(),shadowColor:new Pe.C(Ee).onBackground(at).toHexShortString(),contentColor:new Pe.C(Xe).onBackground(at).toHexShortString()}),[Ve,Ee,Xe,at]);return $e.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},$e.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},$e.createElement("ellipse",{fill:Ue,cx:"32",cy:"33",rx:"32",ry:"7"}),$e.createElement("g",{fillRule:"nonzero",stroke:vt},$e.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),$e.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:Ot}))))},Oe=de(83116),je=de(37613);const kt=ht=>{const{componentCls:Ve,margin:Ee,marginXS:Xe,marginXL:at,fontSize:vt,lineHeight:Ue}=ht;return{[Ve]:{marginInline:Xe,fontSize:vt,lineHeight:Ue,textAlign:"center",[`${Ve}-image`]:{height:ht.emptyImgHeight,marginBottom:Xe,opacity:ht.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${Ve}-description`]:{color:ht.colorText},[`${Ve}-footer`]:{marginTop:Ee},"&-normal":{marginBlock:at,color:ht.colorTextDisabled,[`${Ve}-description`]:{color:ht.colorTextDisabled},[`${Ve}-image`]:{height:ht.emptyImgHeightMD}},"&-small":{marginBlock:Xe,color:ht.colorTextDisabled,[`${Ve}-image`]:{height:ht.emptyImgHeightSM}}}}};var et=(0,Oe.Z)("Empty",ht=>{const{componentCls:Ve,controlHeightLG:Ee}=ht,Xe=(0,je.TS)(ht,{emptyImgCls:`${Ve}-img`,emptyImgHeight:Ee*2.5,emptyImgHeightMD:Ee,emptyImgHeightSM:Ee*.875});return[kt(Xe)]}),mt=function(ht,Ve){var Ee={};for(var Xe in ht)Object.prototype.hasOwnProperty.call(ht,Xe)&&Ve.indexOf(Xe)<0&&(Ee[Xe]=ht[Xe]);if(ht!=null&&typeof Object.getOwnPropertySymbols=="function")for(var at=0,Xe=Object.getOwnPropertySymbols(ht);at<Xe.length;at++)Ve.indexOf(Xe[at])<0&&Object.prototype.propertyIsEnumerable.call(ht,Xe[at])&&(Ee[Xe[at]]=ht[Xe[at]]);return Ee};const st=$e.createElement(ke,null),Rt=$e.createElement(gt,null),tn=ht=>{var{className:Ve,rootClassName:Ee,prefixCls:Xe,image:at=st,description:vt,children:Ue,imageStyle:Ot,style:rt}=ht,At=mt(ht,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);const{getPrefixCls:qe,direction:Ht,empty:cn}=$e.useContext(ct.E_),Kt=qe("empty",Xe),[Xt,Wt]=et(Kt),[ze]=(0,Se.Z)("Empty"),xe=typeof vt!="undefined"?vt:ze==null?void 0:ze.description,bt=typeof xe=="string"?xe:"empty";let pn=null;return typeof at=="string"?pn=$e.createElement("img",{alt:bt,src:at}):pn=at,Xt($e.createElement("div",Object.assign({className:ut()(Wt,Kt,cn==null?void 0:cn.className,{[`${Kt}-normal`]:at===Rt,[`${Kt}-rtl`]:Ht==="rtl"},Ve,Ee),style:Object.assign(Object.assign({},cn==null?void 0:cn.style),rt)},At),$e.createElement("div",{className:`${Kt}-image`,style:Ot},pn),xe&&$e.createElement("div",{className:`${Kt}-description`},xe),Ue&&$e.createElement("div",{className:`${Kt}-footer`},Ue)))};tn.PRESENTED_IMAGE_DEFAULT=st,tn.PRESENTED_IMAGE_SIMPLE=Rt;var nt=tn},78241:function(kn,dn,de){"use strict";de.d(dn,{default:function(){return wr}});var pe=de(77654),ut=de(92310),$e=de.n(ut),ct=de(77900),Se=de(59301),Pe=de(62892),Ne=de(32441);function Ce(Qe){const[Me,Ae]=Se.useState(Qe);return Se.useEffect(()=>{const Le=setTimeout(()=>{Ae(Qe)},Qe.length?0:10);return()=>{clearTimeout(Le)}},[Qe]),Me}var ke=de(17313),Fe=de(29878),gt=de(8378),Oe=de(37613),je=de(83116),et=Qe=>{const{componentCls:Me}=Qe,Ae=`${Me}-show-help`,Le=`${Me}-show-help-item`;return{[Ae]:{transition:`opacity ${Qe.motionDurationSlow} ${Qe.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[Le]:{overflow:"hidden",transition:`height ${Qe.motionDurationSlow} ${Qe.motionEaseInOut},
opacity ${Qe.motionDurationSlow} ${Qe.motionEaseInOut},
transform ${Qe.motionDurationSlow} ${Qe.motionEaseInOut} !important`,[`&${Le}-appear, &${Le}-enter`]:{transform:"translateY(-5px)",opacity:0,"&-active":{transform:"translateY(0)",opacity:1}},[`&${Le}-leave-active`]:{transform:"translateY(-5px)"}}}}};const mt=Qe=>({legend:{display:"block",width:"100%",marginBottom:Qe.marginLG,padding:0,color:Qe.colorTextDescription,fontSize:Qe.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:`${Qe.lineWidth}px ${Qe.lineType} ${Qe.colorBorder}`},label:{fontSize:Qe.fontSize},'input[type="search"]':{boxSizing:"border-box"},'input[type="radio"], input[type="checkbox"]':{lineHeight:"normal"},'input[type="file"]':{display:"block"},'input[type="range"]':{display:"block",width:"100%"},"select[multiple], select[size]":{height:"auto"},"input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus":{outline:0,boxShadow:`0 0 0 ${Qe.controlOutlineWidth}px ${Qe.controlOutline}`},output:{display:"block",paddingTop:15,color:Qe.colorText,fontSize:Qe.fontSize,lineHeight:Qe.lineHeight}}),st=(Qe,Me)=>{const{formItemCls:Ae}=Qe;return{[Ae]:{[`${Ae}-label > label`]:{height:Me},[`${Ae}-control-input`]:{minHeight:Me}}}},Rt=Qe=>{const{componentCls:Me}=Qe;return{[Qe.componentCls]:Object.assign(Object.assign(Object.assign({},(0,ke.Wf)(Qe)),mt(Qe)),{[`${Me}-text`]:{display:"inline-block",paddingInlineEnd:Qe.paddingSM},"&-small":Object.assign({},st(Qe,Qe.controlHeightSM)),"&-large":Object.assign({},st(Qe,Qe.controlHeightLG))})}},tn=Qe=>{const{formItemCls:Me,iconCls:Ae,componentCls:Le,rootPrefixCls:De,labelRequiredMarkColor:We,labelColor:it,labelFontSize:Nt,labelHeight:Lt,labelColonMarginInlineStart:$t,labelColonMarginInlineEnd:sn,itemMarginBottom:hn}=Qe;return{[Me]:Object.assign(Object.assign({},(0,ke.Wf)(Qe)),{marginBottom:hn,verticalAlign:"top","&-with-help":{transition:"none"},[`&-hidden,
&-hidden.${De}-row`]:{display:"none"},"&-has-warning":{[`${Me}-split`]:{color:Qe.colorError}},"&-has-error":{[`${Me}-split`]:{color:Qe.colorWarning}},[`${Me}-label`]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:`${Qe.lineHeight} - 0.25em`,whiteSpace:"unset"},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:Lt,color:it,fontSize:Nt,[`> ${Ae}`]:{fontSize:Qe.fontSize,verticalAlign:"top"},[`&${Me}-required:not(${Me}-required-mark-optional)::before`]:{display:"inline-block",marginInlineEnd:Qe.marginXXS,color:We,fontSize:Qe.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"',[`${Le}-hide-required-mark &`]:{display:"none"}},[`${Me}-optional`]:{display:"inline-block",marginInlineStart:Qe.marginXXS,color:Qe.colorTextDescription,[`${Le}-hide-required-mark &`]:{display:"none"}},[`${Me}-tooltip`]:{color:Qe.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:Qe.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:$t,marginInlineEnd:sn},[`&${Me}-no-colon::after`]:{content:'"\\a0"'}}},[`${Me}-control`]:{"--ant-display":"flex",flexDirection:"column",flexGrow:1,[`&:first-child:not([class^="'${De}-col-'"]):not([class*="' ${De}-col-'"])`]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:Qe.controlHeight,"&-content":{flex:"auto",maxWidth:"100%"}}},[Me]:{"&-explain, &-extra":{clear:"both",color:Qe.colorTextDescription,fontSize:Qe.fontSize,lineHeight:Qe.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:Qe.controlHeightSM,transition:`color ${Qe.motionDurationMid} ${Qe.motionEaseOut}`},"&-explain":{"&-error":{color:Qe.colorError},"&-warning":{color:Qe.colorWarning}}},[`&-with-help ${Me}-explain`]:{height:"auto",opacity:1},[`${Me}-feedback-icon`]:{fontSize:Qe.fontSize,textAlign:"center",visibility:"visible",animationName:Fe.kr,animationDuration:Qe.motionDurationMid,animationTimingFunction:Qe.motionEaseOutBack,pointerEvents:"none","&-success":{color:Qe.colorSuccess},"&-error":{color:Qe.colorError},"&-warning":{color:Qe.colorWarning},"&-validating":{color:Qe.colorPrimary}}})}},nt=Qe=>{const{componentCls:Me,formItemCls:Ae}=Qe;return{[`${Me}-horizontal`]:{[`${Ae}-label`]:{flexGrow:0},[`${Ae}-control`]:{flex:"1 1 0",minWidth:0},[`${Ae}-label[class$='-24'], ${Ae}-label[class*='-24 ']`]:{[`& + ${Ae}-control`]:{minWidth:"unset"}}}}},ht=Qe=>{const{componentCls:Me,formItemCls:Ae}=Qe;return{[`${Me}-inline`]:{display:"flex",flexWrap:"wrap",[Ae]:{flex:"none",marginInlineEnd:Qe.margin,marginBottom:0,"&-row":{flexWrap:"nowrap"},[`> ${Ae}-label,
> ${Ae}-control`]:{display:"inline-block",verticalAlign:"top"},[`> ${Ae}-label`]:{flex:"none"},[`${Me}-text`]:{display:"inline-block"},[`${Ae}-has-feedback`]:{display:"inline-block"}}}}},Ve=Qe=>({padding:Qe.verticalLabelPadding,margin:Qe.verticalLabelMargin,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{visibility:"hidden"}}}),Ee=Qe=>{const{componentCls:Me,formItemCls:Ae,rootPrefixCls:Le}=Qe;return{[`${Ae} ${Ae}-label`]:Ve(Qe),[Me]:{[Ae]:{flexWrap:"wrap",[`${Ae}-label, ${Ae}-control`]:{[`&:not([class*=" ${Le}-col-xs"])`]:{flex:"0 0 100%",maxWidth:"100%"}}}}}},Xe=Qe=>{const{componentCls:Me,formItemCls:Ae,rootPrefixCls:Le}=Qe;return{[`${Me}-vertical`]:{[Ae]:{"&-row":{flexDirection:"column"},"&-label > label":{height:"auto"},[`${Me}-item-control`]:{width:"100%"}}},[`${Me}-vertical ${Ae}-label,
.${Le}-col-24${Ae}-label,
.${Le}-col-xl-24${Ae}-label`]:Ve(Qe),[`@media (max-width: ${Qe.screenXSMax}px)`]:[Ee(Qe),{[Me]:{[`.${Le}-col-xs-24${Ae}-label`]:Ve(Qe)}}],[`@media (max-width: ${Qe.screenSMMax}px)`]:{[Me]:{[`.${Le}-col-sm-24${Ae}-label`]:Ve(Qe)}},[`@media (max-width: ${Qe.screenMDMax}px)`]:{[Me]:{[`.${Le}-col-md-24${Ae}-label`]:Ve(Qe)}},[`@media (max-width: ${Qe.screenLGMax}px)`]:{[Me]:{[`.${Le}-col-lg-24${Ae}-label`]:Ve(Qe)}}}},at=(Qe,Me)=>(0,Oe.TS)(Qe,{formItemCls:`${Qe.componentCls}-item`,rootPrefixCls:Me});var vt=(0,je.Z)("Form",(Qe,Me)=>{let{rootPrefixCls:Ae}=Me;const Le=at(Qe,Ae);return[Rt(Le),tn(Le),et(Le),nt(Le),ht(Le),Xe(Le),(0,gt.Z)(Le),Fe.kr]},Qe=>({labelRequiredMarkColor:Qe.colorError,labelColor:Qe.colorTextHeading,labelFontSize:Qe.fontSize,labelHeight:Qe.controlHeight,labelColonMarginInlineStart:Qe.marginXXS/2,labelColonMarginInlineEnd:Qe.marginXS,itemMarginBottom:Qe.marginLG,verticalLabelPadding:`0 0 ${Qe.paddingXS}px`,verticalLabelMargin:0}),{order:-1e3});const Ue=[];function Ot(Qe,Me,Ae){let Le=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return{key:typeof Qe=="string"?Qe:`${Me}-${Le}`,error:Qe,errorStatus:Ae}}var At=Qe=>{let{help:Me,helpStatus:Ae,errors:Le=Ue,warnings:De=Ue,className:We,fieldId:it,onVisibleChanged:Nt}=Qe;const{prefixCls:Lt}=Se.useContext(Ne.Rk),$t=`${Lt}-item-explain`,[,sn]=vt(Lt),hn=(0,Se.useMemo)(()=>(0,Pe.Z)(Lt),[Lt]),xn=Ce(Le),Mt=Ce(De),rn=Se.useMemo(()=>Me!=null?[Ot(Me,"help",Ae)]:[].concat((0,pe.Z)(xn.map((pt,Ct)=>Ot(pt,"error","error",Ct))),(0,pe.Z)(Mt.map((pt,Ct)=>Ot(pt,"warning","warning",Ct)))),[Me,Ae,xn,Mt]),Je={};return it&&(Je.id=`${it}_help`),Se.createElement(ct.default,{motionDeadline:hn.motionDeadline,motionName:`${Lt}-show-help`,visible:!!rn.length,onVisibleChanged:Nt},pt=>{const{className:Ct,style:Et}=pt;return Se.createElement("div",Object.assign({},Je,{className:$e()($t,Ct,We,sn),style:Et,role:"alert"}),Se.createElement(ct.CSSMotionList,Object.assign({keys:rn},(0,Pe.Z)(Lt),{motionName:`${Lt}-show-help-item`,component:!1}),Yt=>{const{key:St,error:Gt,errorStatus:Te,className:dt,style:ft}=Yt;return Se.createElement("div",{key:St,className:$e()(dt,{[`${$t}-${Te}`]:Te}),style:ft},Gt)}))})},qe=de(95013),Ht=de(36355),cn=de(1684),Kt=de(52946),Xt=de(19716),Wt=de(16722);const ze=["parentNode"],xe="form_item";function bt(Qe){return Qe===void 0||Qe===!1?[]:Array.isArray(Qe)?Qe:[Qe]}function pn(Qe,Me){if(!Qe.length)return;const Ae=Qe.join("_");return Me?`${Me}_${Ae}`:ze.includes(Ae)?`${xe}_${Ae}`:Ae}function Ut(Qe,Me,Ae,Le,De,We){let it=Le;return We!==void 0?it=We:Ae.validating?it="validating":Qe.length?it="error":Me.length?it="warning":(Ae.touched||De&&Ae.validated)&&(it="success"),it}function Ge(Qe){return bt(Qe).join("_")}function Ye(Qe){const[Me]=(0,qe.useForm)(),Ae=Se.useRef({}),Le=Se.useMemo(()=>Qe!=null?Qe:Object.assign(Object.assign({},Me),{__INTERNAL__:{itemRef:De=>We=>{const it=Ge(De);We?Ae.current[it]=We:delete Ae.current[it]}},scrollToField:function(De){let We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const it=bt(De),Nt=pn(it,Le.__INTERNAL__.name),Lt=Nt?document.getElementById(Nt):null;Lt&&(0,Wt.Z)(Lt,Object.assign({scrollMode:"if-needed",block:"nearest"},We))},getFieldInstance:De=>{const We=Ge(De);return Ae.current[We]}}),[Qe,Me]);return[Le]}var It=de(28726),Mn=function(Qe,Me){var Ae={};for(var Le in Qe)Object.prototype.hasOwnProperty.call(Qe,Le)&&Me.indexOf(Le)<0&&(Ae[Le]=Qe[Le]);if(Qe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var De=0,Le=Object.getOwnPropertySymbols(Qe);De<Le.length;De++)Me.indexOf(Le[De])<0&&Object.prototype.propertyIsEnumerable.call(Qe,Le[De])&&(Ae[Le[De]]=Qe[Le[De]]);return Ae};const jt=(Qe,Me)=>{const Ae=Se.useContext(cn.Z),{getPrefixCls:Le,direction:De,form:We}=Se.useContext(Ht.E_),{prefixCls:it,className:Nt,rootClassName:Lt,size:$t,disabled:sn=Ae,form:hn,colon:xn,labelAlign:Mt,labelWrap:rn,labelCol:Je,wrapperCol:pt,hideRequiredMark:Ct,layout:Et="horizontal",scrollToFirstError:Yt,requiredMark:St,onFinishFailed:Gt,name:Te,style:dt,feedbackIcons:ft}=Qe,Tt=Mn(Qe,["prefixCls","className","rootClassName","size","disabled","form","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","style","feedbackIcons"]),_t=(0,Xt.Z)($t),Pt=Se.useContext(It.Z),Bt=(0,Se.useMemo)(()=>St!==void 0?St:We&&We.requiredMark!==void 0?We.requiredMark:!Ct,[Ct,St,We]),un=xn!=null?xn:We==null?void 0:We.colon,yn=Le("form",it),[_n,$n]=vt(yn),qn=$e()(yn,`${yn}-${Et}`,{[`${yn}-hide-required-mark`]:Bt===!1,[`${yn}-rtl`]:De==="rtl",[`${yn}-${_t}`]:_t},$n,We==null?void 0:We.className,Nt,Lt),[sr]=Ye(hn),{__INTERNAL__:jn}=sr;jn.name=Te;const Ln=(0,Se.useMemo)(()=>({name:Te,labelAlign:Mt,labelCol:Je,labelWrap:rn,wrapperCol:pt,vertical:Et==="vertical",colon:un,requiredMark:Bt,itemRef:jn.itemRef,form:sr,feedbackIcons:ft}),[Te,Mt,Je,pt,Et,un,Bt,sr,ft]);Se.useImperativeHandle(Me,()=>sr);const ur=(mr,Vn)=>{if(mr){let Un={block:"nearest"};typeof mr=="object"&&(Un=mr),sr.scrollToField(Vn,Un)}},Qn=mr=>{if(Gt==null||Gt(mr),mr.errorFields.length){const Vn=mr.errorFields[0].name;if(Yt!==void 0){ur(Yt,Vn);return}We&&We.scrollToFirstError!==void 0&&ur(We.scrollToFirstError,Vn)}};return _n(Se.createElement(cn.n,{disabled:sn},Se.createElement(Kt.q,{size:_t},Se.createElement(Ne.RV,Object.assign({},{validateMessages:Pt}),Se.createElement(Ne.q3.Provider,{value:Ln},Se.createElement(qe.default,Object.assign({id:Te},Tt,{name:Te,onFinishFailed:Qn,form:sr,style:Object.assign(Object.assign({},We==null?void 0:We.style),dt),className:qn})))))))};var Vt=Se.forwardRef(jt),Zt=de(41799),zt=de(8654),ve=de(92343),se=de(11592);function oe(Qe){if(typeof Qe=="function")return Qe;const Me=(0,se.Z)(Qe);return Me.length<=1?Me[0]:Me}const fe=()=>{const{status:Qe,errors:Me=[],warnings:Ae=[]}=(0,Se.useContext)(Ne.aM);return{status:Qe,errors:Me,warnings:Ae}};fe.Context=Ne.aM;var ye=fe,ce=de(16089);function Ke(Qe){const[Me,Ae]=Se.useState(Qe),Le=(0,Se.useRef)(null),De=(0,Se.useRef)([]),We=(0,Se.useRef)(!1);Se.useEffect(()=>(We.current=!1,()=>{We.current=!0,ce.Z.cancel(Le.current),Le.current=null}),[]);function it(Nt){We.current||(Le.current===null&&(De.current=[],Le.current=(0,ce.Z)(()=>{Le.current=null,Ae(Lt=>{let $t=Lt;return De.current.forEach(sn=>{$t=sn($t)}),$t})})),De.current.push(Nt))}return[Me,it]}function Dt(){const{itemRef:Qe}=Se.useContext(Ne.q3),Me=Se.useRef({});function Ae(Le,De){const We=De&&typeof De=="object"&&De.ref,it=Le.join("_");return(Me.current.name!==it||Me.current.originRef!==We)&&(Me.current.name=it,Me.current.originRef=We,Me.current.ref=(0,zt.sQ)(Qe(Le),We)),Me.current.ref}return Ae}var ln=de(29194),Jt=de(34280),en=de(2738),nn=de(27382),wn=de(37028);const mn=Qe=>{const{formItemCls:Me}=Qe;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${Me}-control`]:{display:"flex"}}}};var En=(0,je.b)(["Form","item-item"],(Qe,Me)=>{let{rootPrefixCls:Ae}=Me;const Le=at(Qe,Ae);return[mn(Le)]}),gn=Qe=>{const{prefixCls:Me,status:Ae,wrapperCol:Le,children:De,errors:We,warnings:it,_internalItemRender:Nt,extra:Lt,help:$t,fieldId:sn,marginBottom:hn,onErrorVisibleChanged:xn}=Qe,Mt=`${Me}-item`,rn=Se.useContext(Ne.q3),Je=Le||rn.wrapperCol||{},pt=$e()(`${Mt}-control`,Je.className),Ct=Se.useMemo(()=>Object.assign({},rn),[rn]);delete Ct.labelCol,delete Ct.wrapperCol;const Et=Se.createElement("div",{className:`${Mt}-control-input`},Se.createElement("div",{className:`${Mt}-control-input-content`},De)),Yt=Se.useMemo(()=>({prefixCls:Me,status:Ae}),[Me,Ae]),St=hn!==null||We.length||it.length?Se.createElement("div",{style:{display:"flex",flexWrap:"nowrap"}},Se.createElement(Ne.Rk.Provider,{value:Yt},Se.createElement(At,{fieldId:sn,errors:We,warnings:it,help:$t,helpStatus:Ae,className:`${Mt}-explain-connected`,onVisibleChanged:xn})),!!hn&&Se.createElement("div",{style:{width:0,height:hn}})):null,Gt={};sn&&(Gt.id=`${sn}_extra`);const Te=Lt?Se.createElement("div",Object.assign({},Gt,{className:`${Mt}-extra`}),Lt):null,dt=Nt&&Nt.mark==="pro_table_render"&&Nt.render?Nt.render(Qe,{input:Et,errorList:St,extra:Te}):Se.createElement(Se.Fragment,null,Et,St,Te);return Se.createElement(Ne.q3.Provider,{value:Ct},Se.createElement(wn.Z,Object.assign({},Je,{className:pt}),dt),Se.createElement(En,{prefixCls:Me}))},Jn=de(61485),tt=de(31724),Re=de(9763),Ze=de(6848),Ft=function(Qe,Me){var Ae={};for(var Le in Qe)Object.prototype.hasOwnProperty.call(Qe,Le)&&Me.indexOf(Le)<0&&(Ae[Le]=Qe[Le]);if(Qe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var De=0,Le=Object.getOwnPropertySymbols(Qe);De<Le.length;De++)Me.indexOf(Le[De])<0&&Object.prototype.propertyIsEnumerable.call(Qe,Le[De])&&(Ae[Le[De]]=Qe[Le[De]]);return Ae};function Qt(Qe){return Qe?typeof Qe=="object"&&!Se.isValidElement(Qe)?Qe:{title:Qe}:null}var Pn=Qe=>{let{prefixCls:Me,label:Ae,htmlFor:Le,labelCol:De,labelAlign:We,colon:it,required:Nt,requiredMark:Lt,tooltip:$t}=Qe;var sn;const[hn]=(0,Re.Z)("Form"),{vertical:xn,labelAlign:Mt,labelCol:rn,labelWrap:Je,colon:pt}=Se.useContext(Ne.q3);if(!Ae)return null;const Ct=De||rn||{},Et=We||Mt,Yt=`${Me}-item-label`,St=$e()(Yt,Et==="left"&&`${Yt}-left`,Ct.className,{[`${Yt}-wrap`]:!!Je});let Gt=Ae;const Te=it===!0||pt!==!1&&it!==!1;Te&&!xn&&typeof Ae=="string"&&Ae.trim()!==""&&(Gt=Ae.replace(/[:|]\s*$/,""));const ft=Qt($t);if(ft){const{icon:Bt=Se.createElement(Jn.Z,null)}=ft,un=Ft(ft,["icon"]),yn=Se.createElement(Ze.Z,Object.assign({},un),Se.cloneElement(Bt,{className:`${Me}-item-tooltip`,title:""}));Gt=Se.createElement(Se.Fragment,null,Gt,yn)}const Tt=Lt==="optional",_t=typeof Lt=="function";_t?Gt=Lt(Gt,{required:!!Nt}):Tt&&!Nt&&(Gt=Se.createElement(Se.Fragment,null,Gt,Se.createElement("span",{className:`${Me}-item-optional`,title:""},(hn==null?void 0:hn.optional)||((sn=tt.Z.Form)===null||sn===void 0?void 0:sn.optional))));const Pt=$e()({[`${Me}-item-required`]:Nt,[`${Me}-item-required-mark-optional`]:Tt||_t,[`${Me}-item-no-colon`]:!Te});return Se.createElement(wn.Z,Object.assign({},Ct,{className:St}),Se.createElement("label",{htmlFor:Le,className:Pt,title:typeof Ae=="string"?Ae:""},Gt))},On=de(29679),Nn=de(19248),Zn=de(96512),tr=de(58617);const Tn={success:On.Z,warning:Zn.Z,error:Nn.Z,validating:tr.Z};function gr(Qe){let{children:Me,errors:Ae,warnings:Le,hasFeedback:De,validateStatus:We,prefixCls:it,meta:Nt,noStyle:Lt}=Qe;const $t=`${it}-item`,{feedbackIcons:sn}=Se.useContext(Ne.q3),hn=Ut(Ae,Le,Nt,null,!!De,We),{isFormItemInput:xn,status:Mt}=Se.useContext(Ne.aM),rn=Se.useMemo(()=>{var Je;let pt;if(De){const Yt=De!==!0&&De.icons||sn,St=hn&&((Je=Yt==null?void 0:Yt({status:hn,errors:Ae,warnings:Le}))===null||Je===void 0?void 0:Je[hn]),Gt=hn&&Tn[hn];pt=St!==!1&&Gt?Se.createElement("span",{className:$e()(`${$t}-feedback-icon`,`${$t}-feedback-icon-${hn}`)},St||Se.createElement(Gt,null)):null}let Ct=!0,Et=hn||"";return Lt&&(Ct=xn,Et=(hn!=null?hn:Mt)||""),{status:Et,errors:Ae,warnings:Le,hasFeedback:!!De,feedbackIcon:pt,isFormItemInput:Ct}},[hn,De,Lt,xn,Mt]);return Se.createElement(Ne.aM.Provider,{value:rn},Me)}var Pr=function(Qe,Me){var Ae={};for(var Le in Qe)Object.prototype.hasOwnProperty.call(Qe,Le)&&Me.indexOf(Le)<0&&(Ae[Le]=Qe[Le]);if(Qe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var De=0,Le=Object.getOwnPropertySymbols(Qe);De<Le.length;De++)Me.indexOf(Le[De])<0&&Object.prototype.propertyIsEnumerable.call(Qe,Le[De])&&(Ae[Le[De]]=Qe[Le[De]]);return Ae};function Rr(Qe){const{prefixCls:Me,className:Ae,rootClassName:Le,style:De,help:We,errors:it,warnings:Nt,validateStatus:Lt,meta:$t,hasFeedback:sn,hidden:hn,children:xn,fieldId:Mt,required:rn,isRequired:Je,onSubItemMetaChange:pt}=Qe,Ct=Pr(Qe,["prefixCls","className","rootClassName","style","help","errors","warnings","validateStatus","meta","hasFeedback","hidden","children","fieldId","required","isRequired","onSubItemMetaChange"]),Et=`${Me}-item`,{requiredMark:Yt}=Se.useContext(Ne.q3),St=Se.useRef(null),Gt=Ce(it),Te=Ce(Nt),dt=We!=null,ft=!!(dt||it.length||Nt.length),Tt=!!St.current&&(0,ln.Z)(St.current),[_t,Pt]=Se.useState(null);(0,Jt.Z)(()=>{if(ft&&St.current){const $n=getComputedStyle(St.current);Pt(parseInt($n.marginBottom,10))}},[ft,Tt]);const Bt=$n=>{$n||Pt(null)},yn=function(){let $n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const qn=$n?Gt:$t.errors,sr=$n?Te:$t.warnings;return Ut(qn,sr,$t,"",!!sn,Lt)}(),_n=$e()(Et,Ae,Le,{[`${Et}-with-help`]:dt||Gt.length||Te.length,[`${Et}-has-feedback`]:yn&&sn,[`${Et}-has-success`]:yn==="success",[`${Et}-has-warning`]:yn==="warning",[`${Et}-has-error`]:yn==="error",[`${Et}-is-validating`]:yn==="validating",[`${Et}-hidden`]:hn});return Se.createElement("div",{className:_n,style:De,ref:St},Se.createElement(nn.Z,Object.assign({className:`${Et}-row`},(0,en.Z)(Ct,["_internalItemRender","colon","dependencies","extra","fieldKey","getValueFromEvent","getValueProps","htmlFor","id","initialValue","isListField","label","labelAlign","labelCol","labelWrap","messageVariables","name","normalize","noStyle","preserve","requiredMark","rules","shouldUpdate","trigger","tooltip","validateFirst","validateTrigger","valuePropName","wrapperCol","validateDebounce"])),Se.createElement(Pn,Object.assign({htmlFor:Mt},Qe,{requiredMark:Yt,required:rn!=null?rn:Je,prefixCls:Me})),Se.createElement(gn,Object.assign({},Qe,$t,{errors:Gt,warnings:Te,prefixCls:Me,status:yn,help:We,marginBottom:_t,onErrorVisibleChanged:Bt}),Se.createElement(Ne.qI.Provider,{value:pt},Se.createElement(gr,{prefixCls:Me,meta:$t,errors:$t.errors,warnings:$t.warnings,hasFeedback:sn,validateStatus:yn},xn)))),!!_t&&Se.createElement("div",{className:`${Et}-margin-offset`,style:{marginBottom:-_t}}))}const Zr="__SPLIT__",vr=null,Dr=Se.memo(Qe=>{let{children:Me}=Qe;return Me},(Qe,Me)=>Qe.value===Me.value&&Qe.update===Me.update&&Qe.childProps.length===Me.childProps.length&&Qe.childProps.every((Ae,Le)=>Ae===Me.childProps[Le]));function yr(Qe){return Qe!=null}function Nr(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}function Wr(Qe){const{name:Me,noStyle:Ae,className:Le,dependencies:De,prefixCls:We,shouldUpdate:it,rules:Nt,children:Lt,required:$t,label:sn,messageVariables:hn,trigger:xn="onChange",validateTrigger:Mt,hidden:rn,help:Je}=Qe,{getPrefixCls:pt}=Se.useContext(Ht.E_),{name:Ct}=Se.useContext(Ne.q3),Et=oe(Lt),Yt=typeof Et=="function",St=Se.useContext(Ne.qI),{validateTrigger:Gt}=Se.useContext(qe.FieldContext),Te=Mt!==void 0?Mt:Gt,dt=yr(Me),ft=pt("form",We),[Tt,_t]=vt(ft),Pt=Se.useContext(qe.ListContext),Bt=Se.useRef(),[un,yn]=Ke({}),[_n,$n]=(0,Zt.Z)(()=>Nr()),qn=Vn=>{const Un=Pt==null?void 0:Pt.getKey(Vn.name);if($n(Vn.destroy?Nr():Vn,!0),Ae&&Je!==!1&&St){let br=Vn.name;if(Vn.destroy)br=Bt.current||br;else if(Un!==void 0){const[lr,Ir]=Un;br=[lr].concat((0,pe.Z)(Ir)),Bt.current=br}St(Vn,br)}},sr=(Vn,Un)=>{yn(br=>{const lr=Object.assign({},br),Ur=[].concat((0,pe.Z)(Vn.name.slice(0,-1)),(0,pe.Z)(Un)).join(Zr);return Vn.destroy?delete lr[Ur]:lr[Ur]=Vn,lr})},[jn,Ln]=Se.useMemo(()=>{const Vn=(0,pe.Z)(_n.errors),Un=(0,pe.Z)(_n.warnings);return Object.values(un).forEach(br=>{Vn.push.apply(Vn,(0,pe.Z)(br.errors||[])),Un.push.apply(Un,(0,pe.Z)(br.warnings||[]))}),[Vn,Un]},[un,_n.errors,_n.warnings]),ur=Dt();function Qn(Vn,Un,br){return Ae&&!rn?Se.createElement(gr,{prefixCls:ft,hasFeedback:Qe.hasFeedback,validateStatus:Qe.validateStatus,meta:_n,errors:jn,warnings:Ln,noStyle:!0},Vn):Se.createElement(Rr,Object.assign({key:"row"},Qe,{className:$e()(Le,_t),prefixCls:ft,fieldId:Un,isRequired:br,errors:jn,warnings:Ln,meta:_n,onSubItemMetaChange:sr}),Vn)}if(!dt&&!Yt&&!De)return Tt(Qn(Et));let mr={};return typeof sn=="string"?mr.label=sn:Me&&(mr.label=String(Me)),hn&&(mr=Object.assign(Object.assign({},mr),hn)),Tt(Se.createElement(qe.Field,Object.assign({},Qe,{messageVariables:mr,trigger:xn,validateTrigger:Te,onMetaChange:qn}),(Vn,Un,br)=>{const lr=bt(Me).length&&Un?Un.name:[],Ir=pn(lr,Ct),Ur=$t!==void 0?$t:!!(Nt&&Nt.some(Sn=>{if(Sn&&typeof Sn=="object"&&Sn.required&&!Sn.warningOnly)return!0;if(typeof Sn=="function"){const fr=Sn(br);return fr&&fr.required&&!fr.warningOnly}return!1})),rr=Object.assign({},Vn);let Cn=null;if(Array.isArray(Et)&&dt)Cn=Et;else if(!(Yt&&(!(it||De)||dt))){if(!(De&&!Yt&&!dt))if((0,ve.l$)(Et)){const Sn=Object.assign(Object.assign({},Et.props),rr);if(Sn.id||(Sn.id=Ir),Je||jn.length>0||Ln.length>0||Qe.extra){const Mr=[];(Je||jn.length>0)&&Mr.push(`${Ir}_help`),Qe.extra&&Mr.push(`${Ir}_extra`),Sn["aria-describedby"]=Mr.join(" ")}jn.length>0&&(Sn["aria-invalid"]="true"),Ur&&(Sn["aria-required"]="true"),(0,zt.Yr)(Et)&&(Sn.ref=ur(lr,Et)),new Set([].concat((0,pe.Z)(bt(xn)),(0,pe.Z)(bt(Te)))).forEach(Mr=>{Sn[Mr]=function(){for(var _r,Ar,dr,Sr,ii,zn=arguments.length,Xn=new Array(zn),kr=0;kr<zn;kr++)Xn[kr]=arguments[kr];(dr=rr[Mr])===null||dr===void 0||(_r=dr).call.apply(_r,[rr].concat(Xn)),(ii=(Sr=Et.props)[Mr])===null||ii===void 0||(Ar=ii).call.apply(Ar,[Sr].concat(Xn))}});const er=[Sn["aria-required"],Sn["aria-invalid"],Sn["aria-describedby"]];Cn=Se.createElement(Dr,{value:rr[Qe.valuePropName||"value"],update:Et,childProps:er},(0,ve.Tm)(Et,Sn))}else Yt&&(it||De)&&!dt?Cn=Et(br):Cn=Et}return Qn(Cn,Ir,Ur)}))}const Er=Wr;Er.useStatus=ye;var qr=Er,zr=function(Qe,Me){var Ae={};for(var Le in Qe)Object.prototype.hasOwnProperty.call(Qe,Le)&&Me.indexOf(Le)<0&&(Ae[Le]=Qe[Le]);if(Qe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var De=0,Le=Object.getOwnPropertySymbols(Qe);De<Le.length;De++)Me.indexOf(Le[De])<0&&Object.prototype.propertyIsEnumerable.call(Qe,Le[De])&&(Ae[Le[De]]=Qe[Le[De]]);return Ae},or=Qe=>{var{prefixCls:Me,children:Ae}=Qe,Le=zr(Qe,["prefixCls","children"]);const{getPrefixCls:De}=Se.useContext(Ht.E_),We=De("form",Me),it=Se.useMemo(()=>({prefixCls:We,status:"error"}),[We]);return Se.createElement(qe.List,Object.assign({},Le),(Nt,Lt,$t)=>Se.createElement(Ne.Rk.Provider,{value:it},Ae(Nt.map(sn=>Object.assign(Object.assign({},sn),{fieldKey:sn.key})),Lt,{errors:$t.errors,warnings:$t.warnings})))};function Bn(){const{form:Qe}=(0,Se.useContext)(Ne.q3);return Qe}const In=Vt;In.Item=qr,In.List=or,In.ErrorList=At,In.useForm=Ye,In.useFormInstance=Bn,In.useWatch=qe.useWatch,In.Provider=Ne.RV,In.create=()=>{};var wr=In},5871:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return Jn}});var pe=de(84105),ut=de(87395),$e=de(92310),ct=de.n($e),Se=de(60499),Pe=de(18642),Ne=de(43749),Ce=de(72190),ke=de(42244),Fe=de(38705),gt=de(17212);function Oe(){return typeof BigInt=="function"}function je(tt){return!tt&&tt!==0&&!Number.isNaN(tt)||!String(tt).trim()}function kt(tt){var Re=tt.trim(),Ze=Re.startsWith("-");Ze&&(Re=Re.slice(1)),Re=Re.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),Re.startsWith(".")&&(Re="0".concat(Re));var Ft=Re||"0",Qt=Ft.split("."),an=Qt[0]||"0",Pn=Qt[1]||"0";an==="0"&&Pn==="0"&&(Ze=!1);var On=Ze?"-":"";return{negative:Ze,negativeStr:On,trimStr:Ft,integerStr:an,decimalStr:Pn,fullStr:"".concat(On).concat(Ft)}}function et(tt){var Re=String(tt);return!Number.isNaN(Number(Re))&&Re.includes("e")}function mt(tt){var Re=String(tt);if(et(tt)){var Ze=Number(Re.slice(Re.indexOf("e-")+2)),Ft=Re.match(/\.(\d+)/);return Ft!=null&&Ft[1]&&(Ze+=Ft[1].length),Ze}return Re.includes(".")&&Rt(Re)?Re.length-Re.indexOf(".")-1:0}function st(tt){var Re=String(tt);if(et(tt)){if(tt>Number.MAX_SAFE_INTEGER)return String(Oe()?BigInt(tt).toString():Number.MAX_SAFE_INTEGER);if(tt<Number.MIN_SAFE_INTEGER)return String(Oe()?BigInt(tt).toString():Number.MIN_SAFE_INTEGER);Re=tt.toFixed(mt(Re))}return kt(Re).fullStr}function Rt(tt){return typeof tt=="number"?!Number.isNaN(tt):tt?/^\s*-?\d+(\.\d+)?\s*$/.test(tt)||/^\s*-?\d+\.\s*$/.test(tt)||/^\s*-?\.\d+\s*$/.test(tt):!1}var tn=function(){function tt(Re){if((0,Fe.Z)(this,tt),(0,Pe.Z)(this,"origin",""),(0,Pe.Z)(this,"negative",void 0),(0,Pe.Z)(this,"integer",void 0),(0,Pe.Z)(this,"decimal",void 0),(0,Pe.Z)(this,"decimalLen",void 0),(0,Pe.Z)(this,"empty",void 0),(0,Pe.Z)(this,"nan",void 0),je(Re)){this.empty=!0;return}if(this.origin=String(Re),Re==="-"||Number.isNaN(Re)){this.nan=!0;return}var Ze=Re;if(et(Ze)&&(Ze=Number(Ze)),Ze=typeof Ze=="string"?Ze:st(Ze),Rt(Ze)){var Ft=kt(Ze);this.negative=Ft.negative;var Qt=Ft.trimStr.split(".");this.integer=BigInt(Qt[0]);var an=Qt[1]||"0";this.decimal=BigInt(an),this.decimalLen=an.length}else this.nan=!0}return(0,gt.Z)(tt,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(Ze){var Ft="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(Ze,"0"));return BigInt(Ft)}},{key:"negate",value:function(){var Ze=new tt(this.toString());return Ze.negative=!Ze.negative,Ze}},{key:"cal",value:function(Ze,Ft,Qt){var an=Math.max(this.getDecimalStr().length,Ze.getDecimalStr().length),Pn=this.alignDecimal(an),On=Ze.alignDecimal(an),Nn=Ft(Pn,On).toString(),Zn=Qt(an),tr=kt(Nn),Tn=tr.negativeStr,gr=tr.trimStr,Pr="".concat(Tn).concat(gr.padStart(Zn+1,"0"));return new tt("".concat(Pr.slice(0,-Zn),".").concat(Pr.slice(-Zn)))}},{key:"add",value:function(Ze){if(this.isInvalidate())return new tt(Ze);var Ft=new tt(Ze);return Ft.isInvalidate()?this:this.cal(Ft,function(Qt,an){return Qt+an},function(Qt){return Qt})}},{key:"multi",value:function(Ze){var Ft=new tt(Ze);return this.isInvalidate()||Ft.isInvalidate()?new tt(NaN):this.cal(Ft,function(Qt,an){return Qt*an},function(Qt){return Qt*2})}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(Ze){return this.toString()===(Ze==null?void 0:Ze.toString())}},{key:"lessEquals",value:function(Ze){return this.add(Ze.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var Ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return Ze?this.isInvalidate()?"":kt("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),tt}(),nt=function(){function tt(Re){if((0,Fe.Z)(this,tt),(0,Pe.Z)(this,"origin",""),(0,Pe.Z)(this,"number",void 0),(0,Pe.Z)(this,"empty",void 0),je(Re)){this.empty=!0;return}this.origin=String(Re),this.number=Number(Re)}return(0,gt.Z)(tt,[{key:"negate",value:function(){return new tt(-this.toNumber())}},{key:"add",value:function(Ze){if(this.isInvalidate())return new tt(Ze);var Ft=Number(Ze);if(Number.isNaN(Ft))return this;var Qt=this.number+Ft;if(Qt>Number.MAX_SAFE_INTEGER)return new tt(Number.MAX_SAFE_INTEGER);if(Qt<Number.MIN_SAFE_INTEGER)return new tt(Number.MIN_SAFE_INTEGER);var an=Math.max(mt(this.number),mt(Ft));return new tt(Qt.toFixed(an))}},{key:"multi",value:function(Ze){var Ft=Number(Ze);if(this.isInvalidate()||Number.isNaN(Ft))return new tt(NaN);var Qt=this.number*Ft;if(Qt>Number.MAX_SAFE_INTEGER)return new tt(Number.MAX_SAFE_INTEGER);if(Qt<Number.MIN_SAFE_INTEGER)return new tt(Number.MIN_SAFE_INTEGER);var an=Math.max(mt(this.number),mt(Ft));return new tt(Qt.toFixed(an))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return Number.isNaN(this.number)}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(Ze){return this.toNumber()===(Ze==null?void 0:Ze.toNumber())}},{key:"lessEquals",value:function(Ze){return this.add(Ze.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var Ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return Ze?this.isInvalidate()?"":st(this.number):this.origin}}]),tt}();function ht(tt){return Oe()?new tn(tt):new nt(tt)}function Ve(tt,Re,Ze){var Ft=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(tt==="")return"";var Qt=kt(tt),an=Qt.negativeStr,Pn=Qt.integerStr,On=Qt.decimalStr,Nn="".concat(Re).concat(On),Zn="".concat(an).concat(Pn);if(Ze>=0){var tr=Number(On[Ze]);if(tr>=5&&!Ft){var Tn=ht(tt).add("".concat(an,"0.").concat("0".repeat(Ze)).concat(10-tr));return Ve(Tn.toString(),Re,Ze,Ft)}return Ze===0?Zn:"".concat(Zn).concat(Re).concat(On.padEnd(Ze,"0").slice(0,Ze))}return Nn===".0"?Zn:"".concat(Zn).concat(Nn)}var Ee=ht,Xe=de(93681),at=de(34280),vt=de(8654),Ue=de(59301),Ot=de(48736);function rt(tt,Re){var Ze=(0,Ue.useRef)(null);function Ft(){try{var an=tt.selectionStart,Pn=tt.selectionEnd,On=tt.value,Nn=On.substring(0,an),Zn=On.substring(Pn);Ze.current={start:an,end:Pn,value:On,beforeTxt:Nn,afterTxt:Zn}}catch(tr){}}function Qt(){if(tt&&Ze.current&&Re)try{var an=tt.value,Pn=Ze.current,On=Pn.beforeTxt,Nn=Pn.afterTxt,Zn=Pn.start,tr=an.length;if(an.endsWith(Nn))tr=an.length-Ze.current.afterTxt.length;else if(an.startsWith(On))tr=On.length;else{var Tn=On[Zn-1],gr=an.indexOf(Tn,Zn-1);gr!==-1&&(tr=gr+1)}tt.setSelectionRange(tr,tr)}catch(Pr){(0,Ot.ZP)(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(Pr.message))}}return[Ft,Qt]}var At=de(49658),qe=function(){var Re=(0,Ue.useState)(!1),Ze=(0,Ce.Z)(Re,2),Ft=Ze[0],Qt=Ze[1];return(0,at.Z)(function(){Qt((0,At.Z)())},[]),Ft},Ht=qe,cn=de(16089),Kt=200,Xt=600;function Wt(tt){var Re=tt.prefixCls,Ze=tt.upNode,Ft=tt.downNode,Qt=tt.upDisabled,an=tt.downDisabled,Pn=tt.onStep,On=Ue.useRef(),Nn=Ue.useRef([]),Zn=Ue.useRef();Zn.current=Pn;var tr=function(){clearTimeout(On.current)},Tn=function(Nr,Wr){Nr.preventDefault(),tr(),Zn.current(Wr);function Er(){Zn.current(Wr),On.current=setTimeout(Er,Kt)}On.current=setTimeout(Er,Xt)};Ue.useEffect(function(){return function(){tr(),Nn.current.forEach(function(yr){return cn.Z.cancel(yr)})}},[]);var gr=Ht();if(gr)return null;var Pr="".concat(Re,"-handler"),Rr=ct()(Pr,"".concat(Pr,"-up"),(0,Pe.Z)({},"".concat(Pr,"-up-disabled"),Qt)),Zr=ct()(Pr,"".concat(Pr,"-down"),(0,Pe.Z)({},"".concat(Pr,"-down-disabled"),an)),vr=function(){return Nn.current.push((0,cn.Z)(tr))},Dr={unselectable:"on",role:"button",onMouseUp:vr,onMouseLeave:vr};return Ue.createElement("div",{className:"".concat(Pr,"-wrap")},Ue.createElement("span",(0,Se.Z)({},Dr,{onMouseDown:function(Nr){Tn(Nr,!0)},"aria-label":"Increase Value","aria-disabled":Qt,className:Rr}),Ze||Ue.createElement("span",{unselectable:"on",className:"".concat(Re,"-handler-up-inner")})),Ue.createElement("span",(0,Se.Z)({},Dr,{onMouseDown:function(Nr){Tn(Nr,!1)},"aria-label":"Decrease Value","aria-disabled":an,className:Zr}),Ft||Ue.createElement("span",{unselectable:"on",className:"".concat(Re,"-handler-down-inner")})))}function ze(tt){var Re=typeof tt=="number"?st(tt):kt(tt).fullStr,Ze=Re.includes(".");return Ze?kt(Re.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:tt+"0"}var xe=de(5643),bt=function(){var tt=(0,Ue.useRef)(0),Re=function(){cn.Z.cancel(tt.current)};return(0,Ue.useEffect)(function(){return Re},[]),function(Ze){Re(),tt.current=(0,cn.Z)(function(){Ze()})}},pn=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],Ut=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","classes","className","classNames"],Ge=function(Re,Ze){return Re||Ze.isEmpty()?Ze.toString():Ze.toNumber()},Ye=function(Re){var Ze=Ee(Re);return Ze.isInvalidate()?null:Ze},It=Ue.forwardRef(function(tt,Re){var Ze,Ft=tt.prefixCls,Qt=Ft===void 0?"rc-input-number":Ft,an=tt.className,Pn=tt.style,On=tt.min,Nn=tt.max,Zn=tt.step,tr=Zn===void 0?1:Zn,Tn=tt.defaultValue,gr=tt.value,Pr=tt.disabled,Rr=tt.readOnly,Zr=tt.upHandler,vr=tt.downHandler,Dr=tt.keyboard,yr=tt.controls,Nr=yr===void 0?!0:yr,Wr=tt.classNames,Er=tt.stringMode,qr=tt.parser,zr=tt.formatter,ar=tt.precision,or=tt.decimalSeparator,Bn=tt.onChange,In=tt.onInput,wr=tt.onPressEnter,Qe=tt.onStep,Me=(0,ke.Z)(tt,pn),Ae="".concat(Qt,"-input"),Le=Ue.useRef(null),De=Ue.useState(!1),We=(0,Ce.Z)(De,2),it=We[0],Nt=We[1],Lt=Ue.useRef(!1),$t=Ue.useRef(!1),sn=Ue.useRef(!1),hn=Ue.useState(function(){return Ee(gr!=null?gr:Tn)}),xn=(0,Ce.Z)(hn,2),Mt=xn[0],rn=xn[1];function Je(Cn){gr===void 0&&rn(Cn)}var pt=Ue.useCallback(function(Cn,Sn){if(!Sn)return ar>=0?ar:Math.max(mt(Cn),mt(tr))},[ar,tr]),Ct=Ue.useCallback(function(Cn){var Sn=String(Cn);if(qr)return qr(Sn);var fr=Sn;return or&&(fr=fr.replace(or,".")),fr.replace(/[^\w.-]+/g,"")},[qr,or]),Et=Ue.useRef(""),Yt=Ue.useCallback(function(Cn,Sn){if(zr)return zr(Cn,{userTyping:Sn,input:String(Et.current)});var fr=typeof Cn=="number"?st(Cn):Cn;if(!Sn){var er=pt(fr,Sn);if(Rt(fr)&&(or||er>=0)){var Mr=or||".";fr=Ve(fr,Mr,er)}}return fr},[zr,pt,or]),St=Ue.useState(function(){var Cn=Tn!=null?Tn:gr;return Mt.isInvalidate()&&["string","number"].includes((0,Ne.Z)(Cn))?Number.isNaN(Cn)?"":Cn:Yt(Mt.toString(),!1)}),Gt=(0,Ce.Z)(St,2),Te=Gt[0],dt=Gt[1];Et.current=Te;function ft(Cn,Sn){dt(Yt(Cn.isInvalidate()?Cn.toString(!1):Cn.toString(!Sn),Sn))}var Tt=Ue.useMemo(function(){return Ye(Nn)},[Nn,ar]),_t=Ue.useMemo(function(){return Ye(On)},[On,ar]),Pt=Ue.useMemo(function(){return!Tt||!Mt||Mt.isInvalidate()?!1:Tt.lessEquals(Mt)},[Tt,Mt]),Bt=Ue.useMemo(function(){return!_t||!Mt||Mt.isInvalidate()?!1:Mt.lessEquals(_t)},[_t,Mt]),un=rt(Le.current,it),yn=(0,Ce.Z)(un,2),_n=yn[0],$n=yn[1],qn=function(Sn){return Tt&&!Sn.lessEquals(Tt)?Tt:_t&&!_t.lessEquals(Sn)?_t:null},sr=function(Sn){return!qn(Sn)},jn=function(Sn,fr){var er=Sn,Mr=sr(er)||er.isEmpty();if(!er.isEmpty()&&!fr&&(er=qn(er)||er,Mr=!0),!Rr&&!Pr&&Mr){var _r=er.toString(),Ar=pt(_r,fr);return Ar>=0&&(er=Ee(Ve(_r,".",Ar)),sr(er)||(er=Ee(Ve(_r,".",Ar,!0)))),er.equals(Mt)||(Je(er),Bn==null||Bn(er.isEmpty()?null:Ge(Er,er)),gr===void 0&&ft(er,fr)),er}return Mt},Ln=bt(),ur=function Cn(Sn){if(_n(),Et.current=Sn,dt(Sn),!$t.current){var fr=Ct(Sn),er=Ee(fr);er.isNaN()||jn(er,!0)}In==null||In(Sn),Ln(function(){var Mr=Sn;qr||(Mr=Sn.replace(/。/g,".")),Mr!==Sn&&Cn(Mr)})},Qn=function(){$t.current=!0},mr=function(){$t.current=!1,ur(Le.current.value)},Vn=function(Sn){ur(Sn.target.value)},Un=function(Sn){var fr;if(!(Sn&&Pt||!Sn&&Bt)){Lt.current=!1;var er=Ee(sn.current?ze(tr):tr);Sn||(er=er.negate());var Mr=(Mt||Ee(0)).add(er.toString()),_r=jn(Mr,!1);Qe==null||Qe(Ge(Er,_r),{offset:sn.current?ze(tr):tr,type:Sn?"up":"down"}),(fr=Le.current)===null||fr===void 0||fr.focus()}},br=function(Sn){var fr=Ee(Ct(Te)),er=fr;fr.isNaN()?er=jn(Mt,Sn):er=jn(fr,Sn),gr!==void 0?ft(Mt,!1):er.isNaN()||ft(er,!1)},lr=function(){Lt.current=!0},Ir=function(Sn){var fr=Sn.key,er=Sn.shiftKey;Lt.current=!0,sn.current=er,fr==="Enter"&&($t.current||(Lt.current=!1),br(!1),wr==null||wr(Sn)),Dr!==!1&&!$t.current&&["Up","ArrowUp","Down","ArrowDown"].includes(fr)&&(Un(fr==="Up"||fr==="ArrowUp"),Sn.preventDefault())},Ur=function(){Lt.current=!1,sn.current=!1},rr=function(){br(!1),Nt(!1),Lt.current=!1};return(0,at.o)(function(){Mt.isInvalidate()||ft(Mt,!1)},[ar]),(0,at.o)(function(){var Cn=Ee(gr);rn(Cn);var Sn=Ee(Ct(Te));(!Cn.equals(Sn)||!Lt.current||zr)&&ft(Cn,Lt.current)},[gr]),(0,at.o)(function(){zr&&$n()},[Te]),Ue.createElement("div",{className:ct()(Qt,Wr==null?void 0:Wr.input,an,(Ze={},(0,Pe.Z)(Ze,"".concat(Qt,"-focused"),it),(0,Pe.Z)(Ze,"".concat(Qt,"-disabled"),Pr),(0,Pe.Z)(Ze,"".concat(Qt,"-readonly"),Rr),(0,Pe.Z)(Ze,"".concat(Qt,"-not-a-number"),Mt.isNaN()),(0,Pe.Z)(Ze,"".concat(Qt,"-out-of-range"),!Mt.isInvalidate()&&!sr(Mt)),Ze)),style:Pn,onFocus:function(){Nt(!0)},onBlur:rr,onKeyDown:Ir,onKeyUp:Ur,onCompositionStart:Qn,onCompositionEnd:mr,onBeforeInput:lr},Nr&&Ue.createElement(Wt,{prefixCls:Qt,upNode:Zr,downNode:vr,upDisabled:Pt,downDisabled:Bt,onStep:Un}),Ue.createElement("div",{className:"".concat(Ae,"-wrap")},Ue.createElement("input",(0,Se.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":On,"aria-valuemax":Nn,"aria-valuenow":Mt.isInvalidate()?null:Mt.toString(),step:tr},Me,{ref:(0,vt.sQ)(Le,Re),className:Ae,value:Te,onChange:Vn,disabled:Pr,readOnly:Rr}))))}),Mn=Ue.forwardRef(function(tt,Re){var Ze=tt.disabled,Ft=tt.style,Qt=tt.prefixCls,an=tt.value,Pn=tt.prefix,On=tt.suffix,Nn=tt.addonBefore,Zn=tt.addonAfter,tr=tt.classes,Tn=tt.className,gr=tt.classNames,Pr=(0,ke.Z)(tt,Ut),Rr=Ue.useRef(null),Zr=function(Dr){Rr.current&&(0,xe.nH)(Rr.current,Dr)};return Ue.createElement(Xe.BaseInput,{inputElement:Ue.createElement(It,(0,Se.Z)({prefixCls:Qt,disabled:Ze,classNames:gr,ref:(0,vt.sQ)(Rr,Re)},Pr)),className:Tn,triggerFocus:Zr,prefixCls:Qt,value:an,disabled:Ze,style:Ft,prefix:Pn,suffix:On,addonAfter:Zn,addonBefore:Nn,classes:tr,classNames:gr,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}})});Mn.displayName="InputNumber";var jt=Mn,bn=jt,Vt=de(19080),Zt=de(36355),zt=de(92736),ve=de(1684),se=de(19716),oe=de(32441),fe=de(33234),ye=de(9937),ce=de(17313),Ke=de(74207),Dt=de(83116),ln=de(37613);const Jt=(tt,Re)=>{let{componentCls:Ze,borderRadiusSM:Ft,borderRadiusLG:Qt}=tt;const an=Re==="lg"?Qt:Ft;return{[`&-${Re}`]:{[`${Ze}-handler-wrap`]:{borderStartEndRadius:an,borderEndEndRadius:an},[`${Ze}-handler-up`]:{borderStartEndRadius:an},[`${Ze}-handler-down`]:{borderEndEndRadius:an}}}},en=tt=>{const{componentCls:Re,lineWidth:Ze,lineType:Ft,colorBorder:Qt,borderRadius:an,fontSizeLG:Pn,controlHeightLG:On,controlHeightSM:Nn,colorError:Zn,paddingInlineSM:tr,colorTextDescription:Tn,motionDurationMid:gr,handleHoverColor:Pr,paddingInline:Rr,paddingBlock:Zr,handleBg:vr,handleActiveBg:Dr,colorTextDisabled:yr,borderRadiusSM:Nr,borderRadiusLG:Wr,controlWidth:Er,handleVisible:qr,handleBorderColor:zr}=tt;return[{[Re]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,ce.Wf)(tt)),(0,ye.ik)(tt)),(0,ye.bi)(tt,Re)),{display:"inline-block",width:Er,margin:0,padding:0,border:`${Ze}px ${Ft} ${Qt}`,borderRadius:an,"&-rtl":{direction:"rtl",[`${Re}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:Pn,borderRadius:Wr,[`input${Re}-input`]:{height:On-2*Ze}},"&-sm":{padding:0,borderRadius:Nr,[`input${Re}-input`]:{height:Nn-2*Ze,padding:`0 ${tr}px`}},"&:hover":Object.assign({},(0,ye.pU)(tt)),"&-focused":Object.assign({},(0,ye.M1)(tt)),"&-out-of-range":{[`${Re}-input-wrap`]:{input:{color:Zn}}},"&-group":Object.assign(Object.assign(Object.assign({},(0,ce.Wf)(tt)),(0,ye.s7)(tt)),{"&-wrapper":{display:"inline-block",textAlign:"start",verticalAlign:"top",[`${Re}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${Re}-group-addon`]:{borderRadius:Wr,fontSize:tt.fontSizeLG}},"&-sm":{[`${Re}-group-addon`]:{borderRadius:Nr}},[`${Re}-wrapper-disabled > ${Re}-group-addon`]:Object.assign({},(0,ye.Xy)(tt))}}),[`&-disabled ${Re}-input`]:{cursor:"not-allowed"},[Re]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},(0,ce.Wf)(tt)),{width:"100%",padding:`${Zr}px ${Rr}px`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:an,outline:0,transition:`all ${gr} linear`,appearance:"textfield",fontSize:"inherit"}),(0,ye.nz)(tt.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[Re]:Object.assign(Object.assign(Object.assign({[`&:hover ${Re}-handler-wrap, &-focused ${Re}-handler-wrap`]:{opacity:1},[`${Re}-handler-wrap`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:tt.handleWidth,height:"100%",background:vr,borderStartStartRadius:0,borderStartEndRadius:an,borderEndEndRadius:an,borderEndStartRadius:0,opacity:qr===!0?1:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`opacity ${gr} linear ${gr}`,[`${Re}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[`
${Re}-handler-up-inner,
${Re}-handler-down-inner
`]:{marginInlineEnd:0,fontSize:tt.handleFontSize}}},[`${Re}-handler`]:{height:"50%",overflow:"hidden",color:Tn,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:`${Ze}px ${Ft} ${zr}`,transition:`all ${gr} linear`,"&:active":{background:Dr},"&:hover":{height:"60%",[`
${Re}-handler-up-inner,
${Re}-handler-down-inner
`]:{color:Pr}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},(0,ce.Ro)()),{color:Tn,transition:`all ${gr} linear`,userSelect:"none"})},[`${Re}-handler-up`]:{borderStartEndRadius:an},[`${Re}-handler-down`]:{borderBlockStart:`${Ze}px ${Ft} ${zr}`,borderEndEndRadius:an}},Jt(tt,"lg")),Jt(tt,"sm")),{"&-disabled, &-readonly":{[`${Re}-handler-wrap`]:{display:"none"},[`${Re}-input`]:{color:"inherit"}},[`
${Re}-handler-up-disabled,
${Re}-handler-down-disabled
`]:{cursor:"not-allowed"},[`
${Re}-handler-up-disabled:hover &-handler-up-inner,
${Re}-handler-down-disabled:hover &-handler-down-inner
`]:{color:yr}})},{[`${Re}-borderless`]:{borderColor:"transparent",boxShadow:"none",[`${Re}-handler-down`]:{borderBlockStartWidth:0}}}]},nn=tt=>{const{componentCls:Re,paddingBlock:Ze,paddingInline:Ft,inputAffixPadding:Qt,controlWidth:an,borderRadiusLG:Pn,borderRadiusSM:On}=tt;return{[`${Re}-affix-wrapper`]:Object.assign(Object.assign(Object.assign({},(0,ye.ik)(tt)),(0,ye.bi)(tt,`${Re}-affix-wrapper`)),{position:"relative",display:"inline-flex",width:an,padding:0,paddingInlineStart:Ft,"&-lg":{borderRadius:Pn},"&-sm":{borderRadius:On},[`&:not(${Re}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},(0,ye.pU)(tt)),{zIndex:1}),"&-focused, &:focus":{zIndex:1},[`&-disabled > ${Re}-disabled`]:{background:"transparent"},[`> div${Re}`]:{width:"100%",border:"none",outline:"none",[`&${Re}-focused`]:{boxShadow:"none !important"}},[`input${Re}-input`]:{padding:`${Ze}px 0`},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${Re}-handler-wrap`]:{zIndex:2},[Re]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:Qt},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:Ft,marginInlineStart:Qt}}})}};var wn=(0,Dt.Z)("InputNumber",tt=>{const Re=(0,ln.TS)(tt,(0,ye.e5)(tt));return[en(Re),nn(Re),(0,Ke.c)(Re)]},tt=>Object.assign(Object.assign({},(0,ye.TM)(tt)),{controlWidth:90,handleWidth:tt.controlHeightSM-tt.lineWidth*2,handleFontSize:tt.fontSize/2,handleVisible:"auto",handleActiveBg:tt.colorFillAlter,handleBg:tt.colorBgContainer,handleHoverColor:tt.colorPrimary,handleBorderColor:tt.colorBorder})),mn=function(tt,Re){var Ze={};for(var Ft in tt)Object.prototype.hasOwnProperty.call(tt,Ft)&&Re.indexOf(Ft)<0&&(Ze[Ft]=tt[Ft]);if(tt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Qt=0,Ft=Object.getOwnPropertySymbols(tt);Qt<Ft.length;Qt++)Re.indexOf(Ft[Qt])<0&&Object.prototype.propertyIsEnumerable.call(tt,Ft[Qt])&&(Ze[Ft[Qt]]=tt[Ft[Qt]]);return Ze};const En=Ue.forwardRef((tt,Re)=>{const{getPrefixCls:Ze,direction:Ft}=Ue.useContext(Zt.E_),Qt=Ue.useRef(null);Ue.useImperativeHandle(Re,()=>Qt.current);const{className:an,rootClassName:Pn,size:On,disabled:Nn,prefixCls:Zn,addonBefore:tr,addonAfter:Tn,prefix:gr,bordered:Pr=!0,readOnly:Rr,status:Zr,controls:vr}=tt,Dr=mn(tt,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls"]),yr=Ze("input-number",Zn),[Nr,Wr]=wn(yr),{compactSize:Er,compactItemClassnames:qr}=(0,fe.ri)(yr,Ft);let zr=Ue.createElement(ut.Z,{className:`${yr}-handler-up-inner`}),ar=Ue.createElement(pe.Z,{className:`${yr}-handler-down-inner`});const or=typeof vr=="boolean"?vr:void 0;typeof vr=="object"&&(zr=typeof vr.upIcon=="undefined"?zr:Ue.createElement("span",{className:`${yr}-handler-up-inner`},vr.upIcon),ar=typeof vr.downIcon=="undefined"?ar:Ue.createElement("span",{className:`${yr}-handler-down-inner`},vr.downIcon));const{hasFeedback:Bn,status:In,isFormItemInput:wr,feedbackIcon:Qe}=Ue.useContext(oe.aM),Me=(0,Vt.F)(In,Zr),Ae=(0,se.Z)(Lt=>{var $t;return($t=On!=null?On:Er)!==null&&$t!==void 0?$t:Lt}),Le=Ue.useContext(ve.Z),De=Nn!=null?Nn:Le,We=ct()({[`${yr}-lg`]:Ae==="large",[`${yr}-sm`]:Ae==="small",[`${yr}-rtl`]:Ft==="rtl",[`${yr}-borderless`]:!Pr,[`${yr}-in-form-item`]:wr},(0,Vt.Z)(yr,Me),qr,Wr),it=`${yr}-group`,Nt=Ue.createElement(bn,Object.assign({ref:Qt,disabled:De,className:ct()(an,Pn),upHandler:zr,downHandler:ar,prefixCls:yr,readOnly:Rr,controls:or,prefix:gr,suffix:Bn&&Qe,addonAfter:Tn&&Ue.createElement(fe.BR,null,Ue.createElement(oe.Ux,{override:!0,status:!0},Tn)),addonBefore:tr&&Ue.createElement(fe.BR,null,Ue.createElement(oe.Ux,{override:!0,status:!0},tr)),classNames:{input:We},classes:{affixWrapper:ct()((0,Vt.Z)(`${yr}-affix-wrapper`,Me,Bn),{[`${yr}-affix-wrapper-sm`]:Ae==="small",[`${yr}-affix-wrapper-lg`]:Ae==="large",[`${yr}-affix-wrapper-rtl`]:Ft==="rtl",[`${yr}-affix-wrapper-borderless`]:!Pr},Wr),wrapper:ct()({[`${it}-rtl`]:Ft==="rtl",[`${yr}-wrapper-disabled`]:De},Wr),group:ct()({[`${yr}-group-wrapper-sm`]:Ae==="small",[`${yr}-group-wrapper-lg`]:Ae==="large",[`${yr}-group-wrapper-rtl`]:Ft==="rtl"},(0,Vt.Z)(`${yr}-group-wrapper`,Me,Bn),Wr)}},Dr));return Nr(Nt)}),yt=En,gn=tt=>Ue.createElement(zt.ZP,{theme:{components:{InputNumber:{handleVisible:!0}}}},Ue.createElement(En,Object.assign({},tt)));yt._InternalPanelDoNotUseOrYouWillBeFired=gn;var Jn=yt},9432:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return tn},n:function(){return st}});var pe=de(19248),ut=de(92310),$e=de.n(ut),ct=de(93681),Se=de(8654),Pe=de(59301),Ne=de(19080),Ce=de(36355),ke=de(1684),Fe=de(19716),gt=de(32441),Oe=de(33234),je=de(59412),kt=de(9937);function et(nt){return!!(nt.prefix||nt.suffix||nt.allowClear)}var mt=function(nt,ht){var Ve={};for(var Ee in nt)Object.prototype.hasOwnProperty.call(nt,Ee)&&ht.indexOf(Ee)<0&&(Ve[Ee]=nt[Ee]);if(nt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Xe=0,Ee=Object.getOwnPropertySymbols(nt);Xe<Ee.length;Xe++)ht.indexOf(Ee[Xe])<0&&Object.prototype.propertyIsEnumerable.call(nt,Ee[Xe])&&(Ve[Ee[Xe]]=nt[Ee[Xe]]);return Ve};function st(nt,ht){if(!nt)return;nt.focus(ht);const{cursor:Ve}=ht||{};if(Ve){const Ee=nt.value.length;switch(Ve){case"start":nt.setSelectionRange(0,0);break;case"end":nt.setSelectionRange(Ee,Ee);break;default:nt.setSelectionRange(0,Ee);break}}}var tn=(0,Pe.forwardRef)((nt,ht)=>{var Ve;const{prefixCls:Ee,bordered:Xe=!0,status:at,size:vt,disabled:Ue,onBlur:Ot,onFocus:rt,suffix:At,allowClear:qe,addonAfter:Ht,addonBefore:cn,className:Kt,style:Xt,styles:Wt,rootClassName:ze,onChange:xe,classNames:bt}=nt,pn=mt(nt,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames"]),{getPrefixCls:Ut,direction:Ge,input:Ye}=Pe.useContext(Ce.E_),It=Ut("input",Ee),Mn=(0,Pe.useRef)(null),[jt,bn]=(0,kt.ZP)(It),{compactSize:Vt,compactItemClassnames:Zt}=(0,Oe.ri)(It,Ge),zt=(0,Fe.Z)(En=>{var yt;return(yt=vt!=null?vt:Vt)!==null&&yt!==void 0?yt:En}),ve=Pe.useContext(ke.Z),se=Ue!=null?Ue:ve,{status:oe,hasFeedback:fe,feedbackIcon:ye}=(0,Pe.useContext)(gt.aM),ce=(0,Ne.F)(oe,at),Ke=et(nt)||!!fe,Dt=(0,Pe.useRef)(Ke);(0,Pe.useEffect)(()=>{var En;Ke&&Dt.current,Dt.current=Ke},[Ke]);const ln=(0,je.Z)(Mn,!0),Jt=En=>{ln(),Ot==null||Ot(En)},en=En=>{ln(),rt==null||rt(En)},nn=En=>{ln(),xe==null||xe(En)},wn=(fe||At)&&Pe.createElement(Pe.Fragment,null,At,fe&&ye);let mn;return typeof qe=="object"&&(qe!=null&&qe.clearIcon)?mn=qe:qe&&(mn={clearIcon:Pe.createElement(pe.Z,null)}),jt(Pe.createElement(ct.default,Object.assign({ref:(0,Se.sQ)(ht,Mn),prefixCls:It,autoComplete:Ye==null?void 0:Ye.autoComplete},pn,{disabled:se,onBlur:Jt,onFocus:en,style:Object.assign(Object.assign({},Ye==null?void 0:Ye.style),Xt),styles:Object.assign(Object.assign({},Ye==null?void 0:Ye.styles),Wt),suffix:wn,allowClear:mn,className:$e()(Kt,ze,Zt,Ye==null?void 0:Ye.className),onChange:nn,addonAfter:Ht&&Pe.createElement(Oe.BR,null,Pe.createElement(gt.Ux,{override:!0,status:!0},Ht)),addonBefore:cn&&Pe.createElement(Oe.BR,null,Pe.createElement(gt.Ux,{override:!0,status:!0},cn)),classNames:Object.assign(Object.assign(Object.assign({},bt),Ye==null?void 0:Ye.classNames),{input:$e()({[`${It}-sm`]:zt==="small",[`${It}-lg`]:zt==="large",[`${It}-rtl`]:Ge==="rtl",[`${It}-borderless`]:!Xe},!Ke&&(0,Ne.Z)(It,ce),bt==null?void 0:bt.input,(Ve=Ye==null?void 0:Ye.classNames)===null||Ve===void 0?void 0:Ve.input,bn)}),classes:{affixWrapper:$e()({[`${It}-affix-wrapper-sm`]:zt==="small",[`${It}-affix-wrapper-lg`]:zt==="large",[`${It}-affix-wrapper-rtl`]:Ge==="rtl",[`${It}-affix-wrapper-borderless`]:!Xe},(0,Ne.Z)(`${It}-affix-wrapper`,ce,fe),bn),wrapper:$e()({[`${It}-group-rtl`]:Ge==="rtl"},bn),group:$e()({[`${It}-group-wrapper-sm`]:zt==="small",[`${It}-group-wrapper-lg`]:zt==="large",[`${It}-group-wrapper-rtl`]:Ge==="rtl",[`${It}-group-wrapper-disabled`]:se},(0,Ne.Z)(`${It}-group-wrapper`,ce,fe),bn)}})))})},1643:function(kn,dn,de){"use strict";var pe=de(19248),ut=de(92310),$e=de.n(ut),ct=de(9296),Se=de(59301),Pe=de(19080),Ne=de(36355),Ce=de(1684),ke=de(19716),Fe=de(32441),gt=de(9432),Oe=de(9937),je=function(et,mt){var st={};for(var Rt in et)Object.prototype.hasOwnProperty.call(et,Rt)&&mt.indexOf(Rt)<0&&(st[Rt]=et[Rt]);if(et!=null&&typeof Object.getOwnPropertySymbols=="function")for(var tn=0,Rt=Object.getOwnPropertySymbols(et);tn<Rt.length;tn++)mt.indexOf(Rt[tn])<0&&Object.prototype.propertyIsEnumerable.call(et,Rt[tn])&&(st[Rt[tn]]=et[Rt[tn]]);return st};const kt=(0,Se.forwardRef)((et,mt)=>{const{prefixCls:st,bordered:Rt=!0,size:tn,disabled:nt,status:ht,allowClear:Ve,showCount:Ee,classNames:Xe,rootClassName:at,className:vt}=et,Ue=je(et,["prefixCls","bordered","size","disabled","status","allowClear","showCount","classNames","rootClassName","className"]),{getPrefixCls:Ot,direction:rt}=Se.useContext(Ne.E_),At=(0,ke.Z)(tn),qe=Se.useContext(Ce.Z),Ht=nt!=null?nt:qe,{status:cn,hasFeedback:Kt,feedbackIcon:Xt}=Se.useContext(Fe.aM),Wt=(0,Pe.F)(cn,ht),ze=Se.useRef(null);Se.useImperativeHandle(mt,()=>{var Ge;return{resizableTextArea:(Ge=ze.current)===null||Ge===void 0?void 0:Ge.resizableTextArea,focus:Ye=>{var It,Mn;(0,gt.n)((Mn=(It=ze.current)===null||It===void 0?void 0:It.resizableTextArea)===null||Mn===void 0?void 0:Mn.textArea,Ye)},blur:()=>{var Ye;return(Ye=ze.current)===null||Ye===void 0?void 0:Ye.blur()}}});const xe=Ot("input",st);let bt;typeof Ve=="object"&&(Ve!=null&&Ve.clearIcon)?bt=Ve:Ve&&(bt={clearIcon:Se.createElement(pe.Z,null)});const[pn,Ut]=(0,Oe.ZP)(xe);return pn(Se.createElement(ct.default,Object.assign({},Ue,{disabled:Ht,allowClear:bt,className:$e()(vt,at),classes:{affixWrapper:$e()(`${xe}-textarea-affix-wrapper`,{[`${xe}-affix-wrapper-rtl`]:rt==="rtl",[`${xe}-affix-wrapper-borderless`]:!Rt,[`${xe}-affix-wrapper-sm`]:At==="small",[`${xe}-affix-wrapper-lg`]:At==="large",[`${xe}-textarea-show-count`]:Ee},(0,Pe.Z)(`${xe}-affix-wrapper`,Wt),Ut)},classNames:Object.assign(Object.assign({},Xe),{textarea:$e()({[`${xe}-borderless`]:!Rt,[`${xe}-sm`]:At==="small",[`${xe}-lg`]:At==="large"},(0,Pe.Z)(xe,Wt),Ut,Xe==null?void 0:Xe.textarea)}),prefixCls:xe,suffix:Kt&&Se.createElement("span",{className:`${xe}-textarea-suffix`},Xt),showCount:Ee,ref:ze})))});dn.Z=kt},59412:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return ut}});var pe=de(59301);function ut($e,ct){const Se=(0,pe.useRef)([]),Pe=()=>{Se.current.push(setTimeout(()=>{var Ne,Ce,ke,Fe;!((Ne=$e.current)===null||Ne===void 0)&&Ne.input&&((Ce=$e.current)===null||Ce===void 0?void 0:Ce.input.getAttribute("type"))==="password"&&(!((ke=$e.current)===null||ke===void 0)&&ke.input.hasAttribute("value"))&&((Fe=$e.current)===null||Fe===void 0||Fe.input.removeAttribute("value"))}))};return(0,pe.useEffect)(()=>(ct&&Pe(),()=>Se.current.forEach(Ne=>{Ne&&clearTimeout(Ne)})),[]),Pe}},92832:function(kn,dn,de){"use strict";de.d(dn,{default:function(){return At}});var pe=de(92310),ut=de.n(pe),$e=de(59301),ct=de(36355),Se=de(32441),Pe=de(9937),Ce=qe=>{const{getPrefixCls:Ht,direction:cn}=(0,$e.useContext)(ct.E_),{prefixCls:Kt,className:Xt}=qe,Wt=Ht("input-group",Kt),ze=Ht("input"),[xe,bt]=(0,Pe.ZP)(ze),pn=ut()(Wt,{[`${Wt}-lg`]:qe.size==="large",[`${Wt}-sm`]:qe.size==="small",[`${Wt}-compact`]:qe.compact,[`${Wt}-rtl`]:cn==="rtl"},bt,Xt),Ut=(0,$e.useContext)(Se.aM),Ge=(0,$e.useMemo)(()=>Object.assign(Object.assign({},Ut),{isFormItemInput:!1}),[Ut]);return xe($e.createElement("span",{className:pn,style:qe.style,onMouseEnter:qe.onMouseEnter,onMouseLeave:qe.onMouseLeave,onFocus:qe.onFocus,onBlur:qe.onBlur},$e.createElement(Se.aM.Provider,{value:Ge},qe.children)))},ke=de(9432),Fe=de(73331),gt=de(15277),Oe=de(2738),je=de(8654),kt=de(59412),et=function(qe,Ht){var cn={};for(var Kt in qe)Object.prototype.hasOwnProperty.call(qe,Kt)&&Ht.indexOf(Kt)<0&&(cn[Kt]=qe[Kt]);if(qe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Xt=0,Kt=Object.getOwnPropertySymbols(qe);Xt<Kt.length;Xt++)Ht.indexOf(Kt[Xt])<0&&Object.prototype.propertyIsEnumerable.call(qe,Kt[Xt])&&(cn[Kt[Xt]]=qe[Kt[Xt]]);return cn};const mt=qe=>qe?$e.createElement(gt.Z,null):$e.createElement(Fe.Z,null),st={click:"onClick",hover:"onMouseOver"};var tn=$e.forwardRef((qe,Ht)=>{const{visibilityToggle:cn=!0}=qe,Kt=typeof cn=="object"&&cn.visible!==void 0,[Xt,Wt]=(0,$e.useState)(()=>Kt?cn.visible:!1),ze=(0,$e.useRef)(null);$e.useEffect(()=>{Kt&&Wt(cn.visible)},[Kt,cn]);const xe=(0,kt.Z)(ze),bt=()=>{const{disabled:se}=qe;se||(Xt&&xe(),Wt(oe=>{var fe;const ye=!oe;return typeof cn=="object"&&((fe=cn.onVisibleChange)===null||fe===void 0||fe.call(cn,ye)),ye}))},pn=se=>{const{action:oe="click",iconRender:fe=mt}=qe,ye=st[oe]||"",ce=fe(Xt),Ke={[ye]:bt,className:`${se}-icon`,key:"passwordIcon",onMouseDown:Dt=>{Dt.preventDefault()},onMouseUp:Dt=>{Dt.preventDefault()}};return $e.cloneElement($e.isValidElement(ce)?ce:$e.createElement("span",null,ce),Ke)},{className:Ut,prefixCls:Ge,inputPrefixCls:Ye,size:It}=qe,Mn=et(qe,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:jt}=$e.useContext(ct.E_),bn=jt("input",Ye),Vt=jt("input-password",Ge),Zt=cn&&pn(Vt),zt=ut()(Vt,Ut,{[`${Vt}-${It}`]:!!It}),ve=Object.assign(Object.assign({},(0,Oe.Z)(Mn,["suffix","iconRender","visibilityToggle"])),{type:Xt?"text":"password",className:zt,prefixCls:bn,suffix:Zt});return It&&(ve.size=It),$e.createElement(ke.Z,Object.assign({ref:(0,je.sQ)(Ht,ze)},ve))}),nt=de(47472),ht=de(92343),Ve=de(3113),Ee=de(19716),Xe=de(33234),at=function(qe,Ht){var cn={};for(var Kt in qe)Object.prototype.hasOwnProperty.call(qe,Kt)&&Ht.indexOf(Kt)<0&&(cn[Kt]=qe[Kt]);if(qe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Xt=0,Kt=Object.getOwnPropertySymbols(qe);Xt<Kt.length;Xt++)Ht.indexOf(Kt[Xt])<0&&Object.prototype.propertyIsEnumerable.call(qe,Kt[Xt])&&(cn[Kt[Xt]]=qe[Kt[Xt]]);return cn},Ue=$e.forwardRef((qe,Ht)=>{const{prefixCls:cn,inputPrefixCls:Kt,className:Xt,size:Wt,suffix:ze,enterButton:xe=!1,addonAfter:bt,loading:pn,disabled:Ut,onSearch:Ge,onChange:Ye,onCompositionStart:It,onCompositionEnd:Mn}=qe,jt=at(qe,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:bn,direction:Vt}=$e.useContext(ct.E_),Zt=$e.useRef(!1),zt=bn("input-search",cn),ve=bn("input",Kt),{compactSize:se}=(0,Xe.ri)(zt,Vt),oe=(0,Ee.Z)(gn=>{var Jn;return(Jn=Wt!=null?Wt:se)!==null&&Jn!==void 0?Jn:gn}),fe=$e.useRef(null),ye=gn=>{gn&&gn.target&&gn.type==="click"&&Ge&&Ge(gn.target.value,gn,{source:"clear"}),Ye&&Ye(gn)},ce=gn=>{var Jn;document.activeElement===((Jn=fe.current)===null||Jn===void 0?void 0:Jn.input)&&gn.preventDefault()},Ke=gn=>{var Jn,tt;Ge&&Ge((tt=(Jn=fe.current)===null||Jn===void 0?void 0:Jn.input)===null||tt===void 0?void 0:tt.value,gn,{source:"input"})},Dt=gn=>{Zt.current||pn||Ke(gn)},ln=typeof xe=="boolean"?$e.createElement(nt.Z,null):null,Jt=`${zt}-button`;let en;const nn=xe||{},wn=nn.type&&nn.type.__ANT_BUTTON===!0;wn||nn.type==="button"?en=(0,ht.Tm)(nn,Object.assign({onMouseDown:ce,onClick:gn=>{var Jn,tt;(tt=(Jn=nn==null?void 0:nn.props)===null||Jn===void 0?void 0:Jn.onClick)===null||tt===void 0||tt.call(Jn,gn),Ke(gn)},key:"enterButton"},wn?{className:Jt,size:oe}:{})):en=$e.createElement(Ve.ZP,{className:Jt,type:xe?"primary":void 0,size:oe,disabled:Ut,key:"enterButton",onMouseDown:ce,onClick:Ke,loading:pn,icon:ln},xe),bt&&(en=[en,(0,ht.Tm)(bt,{key:"addonAfter"})]);const mn=ut()(zt,{[`${zt}-rtl`]:Vt==="rtl",[`${zt}-${oe}`]:!!oe,[`${zt}-with-button`]:!!xe},Xt),En=gn=>{Zt.current=!0,It==null||It(gn)},yt=gn=>{Zt.current=!1,Mn==null||Mn(gn)};return $e.createElement(ke.Z,Object.assign({ref:(0,je.sQ)(fe,Ht),onPressEnter:Dt},jt,{size:oe,onCompositionStart:En,onCompositionEnd:yt,prefixCls:ve,addonAfter:en,suffix:ze,onChange:ye,className:mn,disabled:Ut}))}),Ot=de(1643);const rt=ke.Z;rt.Group=Ce,rt.Search=Ue,rt.TextArea=Ot.Z,rt.Password=tn;var At=rt},9937:function(kn,dn,de){"use strict";de.d(dn,{M1:function(){return Ne},TM:function(){return ht},Xy:function(){return Ce},bi:function(){return gt},e5:function(){return nt},ik:function(){return Oe},nz:function(){return Se},pU:function(){return Pe},s7:function(){return je},x0:function(){return Fe}});var pe=de(17313),ut=de(74207),$e=de(37613),ct=de(83116);const Se=Ve=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:Ve,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),Pe=Ve=>({borderColor:Ve.hoverBorderColor}),Ne=Ve=>({borderColor:Ve.activeBorderColor,boxShadow:Ve.activeShadow,outline:0}),Ce=Ve=>({color:Ve.colorTextDisabled,backgroundColor:Ve.colorBgContainerDisabled,borderColor:Ve.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},Pe((0,$e.TS)(Ve,{hoverBorderColor:Ve.colorBorder})))}),ke=Ve=>{const{paddingBlockLG:Ee,fontSizeLG:Xe,lineHeightLG:at,borderRadiusLG:vt,paddingInlineLG:Ue}=Ve;return{padding:`${Ee}px ${Ue}px`,fontSize:Xe,lineHeight:at,borderRadius:vt}},Fe=Ve=>({padding:`${Ve.paddingBlockSM}px ${Ve.paddingInlineSM}px`,borderRadius:Ve.borderRadiusSM}),gt=(Ve,Ee)=>{const{componentCls:Xe,colorError:at,colorWarning:vt,errorActiveShadow:Ue,warningActiveShadow:Ot,colorErrorBorderHover:rt,colorWarningBorderHover:At}=Ve;return{[`&-status-error:not(${Ee}-disabled):not(${Ee}-borderless)${Ee}`]:{borderColor:at,"&:hover":{borderColor:rt},"&:focus, &-focused":Object.assign({},Ne((0,$e.TS)(Ve,{activeBorderColor:at,activeShadow:Ue}))),[`${Xe}-prefix, ${Xe}-suffix`]:{color:at}},[`&-status-warning:not(${Ee}-disabled):not(${Ee}-borderless)${Ee}`]:{borderColor:vt,"&:hover":{borderColor:At},"&:focus, &-focused":Object.assign({},Ne((0,$e.TS)(Ve,{activeBorderColor:vt,activeShadow:Ot}))),[`${Xe}-prefix, ${Xe}-suffix`]:{color:vt}}}},Oe=Ve=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${Ve.paddingBlock}px ${Ve.paddingInline}px`,color:Ve.colorText,fontSize:Ve.fontSize,lineHeight:Ve.lineHeight,backgroundColor:Ve.colorBgContainer,backgroundImage:"none",borderWidth:Ve.lineWidth,borderStyle:Ve.lineType,borderColor:Ve.colorBorder,borderRadius:Ve.borderRadius,transition:`all ${Ve.motionDurationMid}`},Se(Ve.colorTextPlaceholder)),{"&:hover":Object.assign({},Pe(Ve)),"&:focus, &-focused":Object.assign({},Ne(Ve)),"&-disabled, &[disabled]":Object.assign({},Ce(Ve)),"&-borderless":{"&, &:hover, &:focus, &-focused, &-disabled, &[disabled]":{backgroundColor:"transparent",border:"none",boxShadow:"none"}},"textarea&":{maxWidth:"100%",height:"auto",minHeight:Ve.controlHeight,lineHeight:Ve.lineHeight,verticalAlign:"bottom",transition:`all ${Ve.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},ke(Ve)),"&-sm":Object.assign({},Fe(Ve)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),je=Ve=>{const{componentCls:Ee,antCls:Xe}=Ve;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:Ve.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${Ee}, &-lg > ${Ee}-group-addon`]:Object.assign({},ke(Ve)),[`&-sm ${Ee}, &-sm > ${Ee}-group-addon`]:Object.assign({},Fe(Ve)),[`&-lg ${Xe}-select-single ${Xe}-select-selector`]:{height:Ve.controlHeightLG},[`&-sm ${Xe}-select-single ${Xe}-select-selector`]:{height:Ve.controlHeightSM},[`> ${Ee}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${Ee}-group`]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${Ve.paddingInline}px`,color:Ve.colorText,fontWeight:"normal",fontSize:Ve.fontSize,textAlign:"center",backgroundColor:Ve.colorFillAlter,border:`${Ve.lineWidth}px ${Ve.lineType} ${Ve.colorBorder}`,borderRadius:Ve.borderRadius,transition:`all ${Ve.motionDurationSlow}`,lineHeight:1,[`${Xe}-select`]:{margin:`-${Ve.paddingBlock+1}px -${Ve.paddingInline}px`,[`&${Xe}-select-single:not(${Xe}-select-customize-input)`]:{[`${Xe}-select-selector`]:{backgroundColor:"inherit",border:`${Ve.lineWidth}px ${Ve.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${Xe}-select-selector`]:{color:Ve.colorPrimary}}},[`${Xe}-cascader-picker`]:{margin:`-9px -${Ve.paddingInline}px`,backgroundColor:"transparent",[`${Xe}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${Ee}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${Ee}-search-with-button &`]:{zIndex:0}}},[`> ${Ee}:first-child, ${Ee}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${Xe}-select ${Xe}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${Ee}-affix-wrapper`]:{[`&:not(:first-child) ${Ee}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${Ee}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${Ee}:last-child, ${Ee}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${Xe}-select ${Xe}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${Ee}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${Ee}-search &`]:{borderStartStartRadius:Ve.borderRadius,borderEndStartRadius:Ve.borderRadius}},[`&:not(:first-child), ${Ee}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${Ee}-group-compact`]:Object.assign(Object.assign({display:"block"},(0,pe.dF)()),{[`${Ee}-group-addon, ${Ee}-group-wrap, > ${Ee}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:Ve.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[`
& > ${Ee}-affix-wrapper,
& > ${Ee}-number-affix-wrapper,
& > ${Xe}-picker-range
`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-Ve.lineWidth,borderInlineEndWidth:Ve.lineWidth},[`${Ee}`]:{float:"none"},[`& > ${Xe}-select > ${Xe}-select-selector,
& > ${Xe}-select-auto-complete ${Ee},
& > ${Xe}-cascader-picker ${Ee},
& > ${Ee}-group-wrapper ${Ee}`]:{borderInlineEndWidth:Ve.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},[`& > ${Xe}-select-focused`]:{zIndex:1},[`& > ${Xe}-select > ${Xe}-select-arrow`]:{zIndex:1},[`& > *:first-child,
& > ${Xe}-select:first-child > ${Xe}-select-selector,
& > ${Xe}-select-auto-complete:first-child ${Ee},
& > ${Xe}-cascader-picker:first-child ${Ee}`]:{borderStartStartRadius:Ve.borderRadius,borderEndStartRadius:Ve.borderRadius},[`& > *:last-child,
& > ${Xe}-select:last-child > ${Xe}-select-selector,
& > ${Xe}-cascader-picker:last-child ${Ee},
& > ${Xe}-cascader-picker-focused:last-child ${Ee}`]:{borderInlineEndWidth:Ve.lineWidth,borderStartEndRadius:Ve.borderRadius,borderEndEndRadius:Ve.borderRadius},[`& > ${Xe}-select-auto-complete ${Ee}`]:{verticalAlign:"top"},[`${Ee}-group-wrapper + ${Ee}-group-wrapper`]:{marginInlineStart:-Ve.lineWidth,[`${Ee}-affix-wrapper`]:{borderRadius:0}},[`${Ee}-group-wrapper:not(:last-child)`]:{[`&${Ee}-search > ${Ee}-group`]:{[`& > ${Ee}-group-addon > ${Ee}-search-button`]:{borderRadius:0},[`& > ${Ee}`]:{borderStartStartRadius:Ve.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:Ve.borderRadius}}}})}},kt=Ve=>{const{componentCls:Ee,controlHeightSM:Xe,lineWidth:at}=Ve,Ue=(Xe-at*2-16)/2;return{[Ee]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,pe.Wf)(Ve)),Oe(Ve)),gt(Ve,Ee)),{'&[type="color"]':{height:Ve.controlHeight,[`&${Ee}-lg`]:{height:Ve.controlHeightLG},[`&${Ee}-sm`]:{height:Xe,paddingTop:Ue,paddingBottom:Ue}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},et=Ve=>{const{componentCls:Ee}=Ve;return{[`${Ee}-clear-icon`]:{margin:0,color:Ve.colorTextQuaternary,fontSize:Ve.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${Ve.motionDurationSlow}`,"&:hover":{color:Ve.colorTextTertiary},"&:active":{color:Ve.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${Ve.inputAffixPadding}px`}}}},mt=Ve=>{const{componentCls:Ee,inputAffixPadding:Xe,colorTextDescription:at,motionDurationSlow:vt,colorIcon:Ue,colorIconHover:Ot,iconCls:rt}=Ve;return{[`${Ee}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Oe(Ve)),{display:"inline-flex",[`&:not(${Ee}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},Pe(Ve)),{zIndex:1,[`${Ee}-search-with-button &`]:{zIndex:0}}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${Ee}[disabled]`]:{background:"transparent"}},[`> input${Ee}`]:{padding:0,fontSize:"inherit",border:"none",borderRadius:0,outline:"none","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${Ee}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:Ve.paddingXS}},"&-show-count-suffix":{color:at},"&-show-count-has-suffix":{marginInlineEnd:Ve.paddingXXS},"&-prefix":{marginInlineEnd:Xe},"&-suffix":{marginInlineStart:Xe}}}),et(Ve)),{[`${rt}${Ee}-password-icon`]:{color:Ue,cursor:"pointer",transition:`all ${vt}`,"&:hover":{color:Ot}}}),gt(Ve,`${Ee}-affix-wrapper`))}},st=Ve=>{const{componentCls:Ee,colorError:Xe,colorWarning:at,borderRadiusLG:vt,borderRadiusSM:Ue}=Ve;return{[`${Ee}-group`]:Object.assign(Object.assign(Object.assign({},(0,pe.Wf)(Ve)),je(Ve)),{"&-rtl":{direction:"rtl"},"&-wrapper":{display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${Ee}-group-addon`]:{borderRadius:vt,fontSize:Ve.fontSizeLG}},"&-sm":{[`${Ee}-group-addon`]:{borderRadius:Ue}},"&-status-error":{[`${Ee}-group-addon`]:{color:Xe,borderColor:Xe}},"&-status-warning":{[`${Ee}-group-addon`]:{color:at,borderColor:at}},"&-disabled":{[`${Ee}-group-addon`]:Object.assign({},Ce(Ve))},[`&:not(${Ee}-compact-first-item):not(${Ee}-compact-last-item)${Ee}-compact-item`]:{[`${Ee}, ${Ee}-group-addon`]:{borderRadius:0}},[`&:not(${Ee}-compact-last-item)${Ee}-compact-first-item`]:{[`${Ee}, ${Ee}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${Ee}-compact-first-item)${Ee}-compact-last-item`]:{[`${Ee}, ${Ee}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}})}},Rt=Ve=>{const{componentCls:Ee,antCls:Xe}=Ve,at=`${Ee}-search`;return{[at]:{[`${Ee}`]:{"&:hover, &:focus":{borderColor:Ve.colorPrimaryHover,[`+ ${Ee}-group-addon ${at}-button:not(${Xe}-btn-primary)`]:{borderInlineStartColor:Ve.colorPrimaryHover}}},[`${Ee}-affix-wrapper`]:{borderRadius:0},[`${Ee}-lg`]:{lineHeight:Ve.lineHeightLG-2e-4},[`> ${Ee}-group`]:{[`> ${Ee}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${at}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:Ve.borderRadius,borderEndEndRadius:Ve.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${at}-button:not(${Xe}-btn-primary)`]:{color:Ve.colorTextDescription,"&:hover":{color:Ve.colorPrimaryHover},"&:active":{color:Ve.colorPrimaryActive},[`&${Xe}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${at}-button`]:{height:Ve.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${at}-button`]:{height:Ve.controlHeightLG},[`&-small ${at}-button`]:{height:Ve.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${Ee}-compact-item`]:{[`&:not(${Ee}-compact-last-item)`]:{[`${Ee}-group-addon`]:{[`${Ee}-search-button`]:{marginInlineEnd:-Ve.lineWidth,borderRadius:0}}},[`&:not(${Ee}-compact-first-item)`]:{[`${Ee},${Ee}-affix-wrapper`]:{borderRadius:0}},[`> ${Ee}-group-addon ${Ee}-search-button,
> ${Ee},
${Ee}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${Ee}-affix-wrapper-focused`]:{zIndex:2}}}}},tn=Ve=>{const{componentCls:Ee,paddingLG:Xe}=Ve,at=`${Ee}-textarea`;return{[at]:{position:"relative","&-show-count":{[`> ${Ee}`]:{height:"100%"},[`${Ee}-data-count`]:{position:"absolute",bottom:-Ve.fontSize*Ve.lineHeight,insetInlineEnd:0,color:Ve.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${Ee}`]:{paddingInlineEnd:Xe}},[`&-affix-wrapper${at}-has-feedback`]:{[`${Ee}`]:{paddingInlineEnd:Xe}},[`&-affix-wrapper${Ee}-affix-wrapper`]:{padding:0,[`> textarea${Ee}`]:{fontSize:"inherit",border:"none",outline:"none","&:focus":{boxShadow:"none !important"}},[`${Ee}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${Ee}-clear-icon`]:{position:"absolute",insetInlineEnd:Ve.paddingXS,insetBlockStart:Ve.paddingXS},[`${at}-suffix`]:{position:"absolute",top:0,insetInlineEnd:Ve.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}};function nt(Ve){return(0,$e.TS)(Ve,{inputAffixPadding:Ve.paddingXXS})}const ht=Ve=>{const{controlHeight:Ee,fontSize:Xe,lineHeight:at,lineWidth:vt,controlHeightSM:Ue,controlHeightLG:Ot,fontSizeLG:rt,lineHeightLG:At,paddingSM:qe,controlPaddingHorizontalSM:Ht,controlPaddingHorizontal:cn,colorFillAlter:Kt,colorPrimaryHover:Xt,controlOutlineWidth:Wt,controlOutline:ze,colorErrorOutline:xe,colorWarningOutline:bt}=Ve;return{paddingBlock:Math.max(Math.round((Ee-Xe*at)/2*10)/10-vt,3),paddingBlockSM:Math.max(Math.round((Ue-Xe*at)/2*10)/10-vt,0),paddingBlockLG:Math.ceil((Ot-rt*At)/2*10)/10-vt,paddingInline:qe-vt,paddingInlineSM:Ht-vt,paddingInlineLG:cn-vt,addonBg:Kt,activeBorderColor:Xt,hoverBorderColor:Xt,activeShadow:`0 0 0 ${Wt}px ${ze}`,errorActiveShadow:`0 0 0 ${Wt}px ${xe}`,warningActiveShadow:`0 0 0 ${Wt}px ${bt}`}};dn.ZP=(0,ct.Z)("Input",Ve=>{const Ee=(0,$e.TS)(Ve,nt(Ve));return[kt(Ee),tn(Ee),mt(Ee),st(Ee),Rt(Ee),(0,ut.c)(Ee)]},ht)},93948:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return tt}});var pe=de(59301),ut=de(29679),$e=de(40001),ct=de(19248),Se=de(99267),Pe=de(92310),Ne=de.n(Pe),Ce=de(2738),ke=de(36355),Fe=de(60499),gt=de(85899),Oe=de(42244),je={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},kt=function(){var Ze=(0,pe.useRef)([]),Ft=(0,pe.useRef)(null);return(0,pe.useEffect)(function(){var Qt=Date.now(),an=!1;Ze.current.forEach(function(Pn){if(Pn){an=!0;var On=Pn.style;On.transitionDuration=".3s, .3s, .3s, .06s",Ft.current&&Qt-Ft.current<100&&(On.transitionDuration="0s, 0s")}}),an&&(Ft.current=Date.now())}),Ze.current},et=["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"],mt=function(Ze){var Ft=(0,gt.Z)((0,gt.Z)({},je),Ze),Qt=Ft.className,an=Ft.percent,Pn=Ft.prefixCls,On=Ft.strokeColor,Nn=Ft.strokeLinecap,Zn=Ft.strokeWidth,tr=Ft.style,Tn=Ft.trailColor,gr=Ft.trailWidth,Pr=Ft.transition,Rr=(0,Oe.Z)(Ft,et);delete Rr.gapPosition;var Zr=Array.isArray(an)?an:[an],vr=Array.isArray(On)?On:[On],Dr=kt(),yr=Zn/2,Nr=100-Zn/2,Wr="M ".concat(Nn==="round"?yr:0,",").concat(yr,`
L `).concat(Nn==="round"?Nr:100,",").concat(yr),Er="0 0 100 ".concat(Zn),qr=0;return pe.createElement("svg",(0,Fe.Z)({className:Ne()("".concat(Pn,"-line"),Qt),viewBox:Er,preserveAspectRatio:"none",style:tr},Rr),pe.createElement("path",{className:"".concat(Pn,"-line-trail"),d:Wr,strokeLinecap:Nn,stroke:Tn,strokeWidth:gr||Zn,fillOpacity:"0"}),Zr.map(function(zr,ar){var or=1;switch(Nn){case"round":or=1-Zn/100;break;case"square":or=1-Zn/2/100;break;default:or=1;break}var Bn={strokeDasharray:"".concat(zr*or,"px, 100px"),strokeDashoffset:"-".concat(qr,"px"),transition:Pr||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},In=vr[ar]||vr[vr.length-1];return qr+=zr,pe.createElement("path",{key:ar,className:"".concat(Pn,"-line-path"),d:Wr,strokeLinecap:Nn,stroke:In,strokeWidth:Zn,fillOpacity:"0",ref:function(Qe){Dr[ar]=Qe},style:Bn})}))},st=mt,Rt=de(43749),tn=de(72190),nt=de(47273),ht=0,Ve=(0,nt.Z)();function Ee(){var Re;return Ve?(Re=ht,ht+=1):Re="TEST_OR_SSR",Re}var Xe=function(Re){var Ze=pe.useState(),Ft=(0,tn.Z)(Ze,2),Qt=Ft[0],an=Ft[1];return pe.useEffect(function(){an("rc_progress_".concat(Ee()))},[]),Re||Qt},at=function(Ze){var Ft=Ze.bg,Qt=Ze.children;return pe.createElement("div",{style:{width:"100%",height:"100%",background:Ft}},Qt)};function vt(Re,Ze){return Object.keys(Re).map(function(Ft){var Qt=parseFloat(Ft),an="".concat(Math.floor(Qt*Ze),"%");return"".concat(Re[Ft]," ").concat(an)})}var Ue=pe.forwardRef(function(Re,Ze){var Ft=Re.prefixCls,Qt=Re.color,an=Re.gradientId,Pn=Re.radius,On=Re.style,Nn=Re.ptg,Zn=Re.strokeLinecap,tr=Re.strokeWidth,Tn=Re.size,gr=Re.gapDegree,Pr=Qt&&(0,Rt.Z)(Qt)==="object",Rr=Pr?"#FFF":void 0,Zr=Tn/2,vr=pe.createElement("circle",{className:"".concat(Ft,"-circle-path"),r:Pn,cx:Zr,cy:Zr,stroke:Rr,strokeLinecap:Zn,strokeWidth:tr,opacity:Nn===0?0:1,style:On,ref:Ze});if(!Pr)return vr;var Dr="".concat(an,"-conic"),yr=gr?"".concat(180+gr/2,"deg"):"0deg",Nr=vt(Qt,(360-gr)/360),Wr=vt(Qt,1),Er="conic-gradient(from ".concat(yr,", ").concat(Nr.join(", "),")"),qr="linear-gradient(to ".concat(gr?"bottom":"top",", ").concat(Wr.join(", "),")");return pe.createElement(pe.Fragment,null,pe.createElement("mask",{id:Dr},vr),pe.createElement("foreignObject",{x:0,y:0,width:Tn,height:Tn,mask:"url(#".concat(Dr,")")},pe.createElement(at,{bg:qr},pe.createElement(at,{bg:Er}))))}),Ot=Ue,rt=100,At=function(Ze,Ft,Qt,an,Pn,On,Nn,Zn,tr,Tn){var gr=arguments.length>10&&arguments[10]!==void 0?arguments[10]:0,Pr=Qt/100*360*((360-On)/360),Rr=On===0?0:{bottom:0,top:180,left:90,right:-90}[Nn],Zr=(100-an)/100*Ft;tr==="round"&&an!==100&&(Zr+=Tn/2,Zr>=Ft&&(Zr=Ft-.01));var vr=rt/2;return{stroke:typeof Zn=="string"?Zn:void 0,strokeDasharray:"".concat(Ft,"px ").concat(Ze),strokeDashoffset:Zr+gr,transform:"rotate(".concat(Pn+Pr+Rr,"deg)"),transformOrigin:"".concat(vr,"px ").concat(vr,"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}},qe=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function Ht(Re){var Ze=Re!=null?Re:[];return Array.isArray(Ze)?Ze:[Ze]}var cn=function(Ze){var Ft=(0,gt.Z)((0,gt.Z)({},je),Ze),Qt=Ft.id,an=Ft.prefixCls,Pn=Ft.steps,On=Ft.strokeWidth,Nn=Ft.trailWidth,Zn=Ft.gapDegree,tr=Zn===void 0?0:Zn,Tn=Ft.gapPosition,gr=Ft.trailColor,Pr=Ft.strokeLinecap,Rr=Ft.style,Zr=Ft.className,vr=Ft.strokeColor,Dr=Ft.percent,yr=(0,Oe.Z)(Ft,qe),Nr=rt/2,Wr=Xe(Qt),Er="".concat(Wr,"-gradient"),qr=Nr-On/2,zr=Math.PI*2*qr,ar=tr>0?90+tr/2:-90,or=zr*((360-tr)/360),Bn=(0,Rt.Z)(Pn)==="object"?Pn:{count:Pn,space:2},In=Bn.count,wr=Bn.space,Qe=Ht(Dr),Me=Ht(vr),Ae=Me.find(function($t){return $t&&(0,Rt.Z)($t)==="object"}),Le=Ae&&(0,Rt.Z)(Ae)==="object",De=Le?"butt":Pr,We=At(zr,or,0,100,ar,tr,Tn,gr,De,On),it=kt(),Nt=function(){var sn=0;return Qe.map(function(hn,xn){var Mt=Me[xn]||Me[Me.length-1],rn=At(zr,or,sn,hn,ar,tr,Tn,Mt,De,On);return sn+=hn,pe.createElement(Ot,{key:xn,color:Mt,ptg:hn,radius:qr,prefixCls:an,gradientId:Er,style:rn,strokeLinecap:De,strokeWidth:On,gapDegree:tr,ref:function(pt){it[xn]=pt},size:rt})}).reverse()},Lt=function(){var sn=Math.round(In*(Qe[0]/100)),hn=100/In,xn=0;return new Array(In).fill(null).map(function(Mt,rn){var Je=rn<=sn-1?Me[0]:gr,pt=Je&&(0,Rt.Z)(Je)==="object"?"url(#".concat(Er,")"):void 0,Ct=At(zr,or,xn,hn,ar,tr,Tn,Je,"butt",On,wr);return xn+=(or-Ct.strokeDashoffset+wr)*100/or,pe.createElement("circle",{key:rn,className:"".concat(an,"-circle-path"),r:qr,cx:Nr,cy:Nr,stroke:pt,strokeWidth:On,opacity:1,style:Ct,ref:function(Yt){it[rn]=Yt}})})};return pe.createElement("svg",(0,Fe.Z)({className:Ne()("".concat(an,"-circle"),Zr),viewBox:"0 0 ".concat(rt," ").concat(rt),style:Rr,id:Qt,role:"presentation"},yr),!In&&pe.createElement("circle",{className:"".concat(an,"-circle-trail"),r:qr,cx:Nr,cy:Nr,stroke:gr,strokeLinecap:De,strokeWidth:Nn||On,style:We}),In?Lt():Nt())},Kt=cn,Xt={Line:st,Circle:Kt},Wt=de(6848),ze=de(30071);function xe(Re){return!Re||Re<0?0:Re>100?100:Re}function bt(Re){let{success:Ze,successPercent:Ft}=Re,Qt=Ft;return Ze&&"progress"in Ze&&(Qt=Ze.progress),Ze&&"percent"in Ze&&(Qt=Ze.percent),Qt}const pn=Re=>{let{percent:Ze,success:Ft,successPercent:Qt}=Re;const an=xe(bt({success:Ft,successPercent:Qt}));return[an,xe(xe(Ze)-an)]},Ut=Re=>{let{success:Ze={},strokeColor:Ft}=Re;const{strokeColor:Qt}=Ze;return[Qt||ze.presetPrimaryColors.green,Ft||null]},Ge=(Re,Ze,Ft)=>{var Qt,an,Pn,On;let Nn=-1,Zn=-1;if(Ze==="step"){const tr=Ft.steps,Tn=Ft.strokeWidth;typeof Re=="string"||typeof Re=="undefined"?(Nn=Re==="small"?2:14,Zn=Tn!=null?Tn:8):typeof Re=="number"?[Nn,Zn]=[Re,Re]:[Nn=14,Zn=8]=Re,Nn*=tr}else if(Ze==="line"){const tr=Ft==null?void 0:Ft.strokeWidth;typeof Re=="string"||typeof Re=="undefined"?Zn=tr||(Re==="small"?6:8):typeof Re=="number"?[Nn,Zn]=[Re,Re]:[Nn=-1,Zn=8]=Re}else(Ze==="circle"||Ze==="dashboard")&&(typeof Re=="string"||typeof Re=="undefined"?[Nn,Zn]=Re==="small"?[60,60]:[120,120]:typeof Re=="number"?[Nn,Zn]=[Re,Re]:(Nn=(an=(Qt=Re[0])!==null&&Qt!==void 0?Qt:Re[1])!==null&&an!==void 0?an:120,Zn=(On=(Pn=Re[0])!==null&&Pn!==void 0?Pn:Re[1])!==null&&On!==void 0?On:120));return[Nn,Zn]},Ye=3,It=Re=>Ye/Re*100;var jt=Re=>{const{prefixCls:Ze,trailColor:Ft=null,strokeLinecap:Qt="round",gapPosition:an,gapDegree:Pn,width:On=120,type:Nn,children:Zn,success:tr,size:Tn=On}=Re,[gr,Pr]=Ge(Tn,"circle");let{strokeWidth:Rr}=Re;Rr===void 0&&(Rr=Math.max(It(gr),6));const Zr={width:gr,height:Pr,fontSize:gr*.15+6},vr=pe.useMemo(()=>{if(Pn||Pn===0)return Pn;if(Nn==="dashboard")return 75},[Pn,Nn]),Dr=an||Nn==="dashboard"&&"bottom"||void 0,yr=Object.prototype.toString.call(Re.strokeColor)==="[object Object]",Nr=Ut({success:tr,strokeColor:Re.strokeColor}),Wr=Ne()(`${Ze}-inner`,{[`${Ze}-circle-gradient`]:yr}),Er=pe.createElement(Kt,{percent:pn(Re),strokeWidth:Rr,trailWidth:Rr,strokeColor:Nr,strokeLinecap:Qt,trailColor:Ft,prefixCls:Ze,gapDegree:vr,gapPosition:Dr});return pe.createElement("div",{className:Wr,style:Zr},gr<=20?pe.createElement(Wt.Z,{title:Zn},pe.createElement("span",null,Er)):pe.createElement(pe.Fragment,null,Er,Zn))},bn=function(Re,Ze){var Ft={};for(var Qt in Re)Object.prototype.hasOwnProperty.call(Re,Qt)&&Ze.indexOf(Qt)<0&&(Ft[Qt]=Re[Qt]);if(Re!=null&&typeof Object.getOwnPropertySymbols=="function")for(var an=0,Qt=Object.getOwnPropertySymbols(Re);an<Qt.length;an++)Ze.indexOf(Qt[an])<0&&Object.prototype.propertyIsEnumerable.call(Re,Qt[an])&&(Ft[Qt[an]]=Re[Qt[an]]);return Ft};const Vt=Re=>{let Ze=[];return Object.keys(Re).forEach(Ft=>{const Qt=parseFloat(Ft.replace(/%/g,""));isNaN(Qt)||Ze.push({key:Qt,value:Re[Ft]})}),Ze=Ze.sort((Ft,Qt)=>Ft.key-Qt.key),Ze.map(Ft=>{let{key:Qt,value:an}=Ft;return`${an} ${Qt}%`}).join(", ")},Zt=(Re,Ze)=>{const{from:Ft=ze.presetPrimaryColors.blue,to:Qt=ze.presetPrimaryColors.blue,direction:an=Ze==="rtl"?"to left":"to right"}=Re,Pn=bn(Re,["from","to","direction"]);if(Object.keys(Pn).length!==0){const On=Vt(Pn);return{backgroundImage:`linear-gradient(${an}, ${On})`}}return{backgroundImage:`linear-gradient(${an}, ${Ft}, ${Qt})`}};var ve=Re=>{const{prefixCls:Ze,direction:Ft,percent:Qt,size:an,strokeWidth:Pn,strokeColor:On,strokeLinecap:Nn="round",children:Zn,trailColor:tr=null,success:Tn}=Re,gr=On&&typeof On!="string"?Zt(On,Ft):{backgroundColor:On},Pr=Nn==="square"||Nn==="butt"?0:void 0,Rr={backgroundColor:tr||void 0,borderRadius:Pr},Zr=an!=null?an:[-1,Pn||(an==="small"?6:8)],[vr,Dr]=Ge(Zr,"line",{strokeWidth:Pn}),yr=Object.assign({width:`${xe(Qt)}%`,height:Dr,borderRadius:Pr},gr),Nr=bt(Re),Wr={width:`${xe(Nr)}%`,height:Dr,borderRadius:Pr,backgroundColor:Tn==null?void 0:Tn.strokeColor},Er={width:vr<0?"100%":vr,height:Dr};return pe.createElement(pe.Fragment,null,pe.createElement("div",{className:`${Ze}-outer`,style:Er},pe.createElement("div",{className:`${Ze}-inner`,style:Rr},pe.createElement("div",{className:`${Ze}-bg`,style:yr}),Nr!==void 0?pe.createElement("div",{className:`${Ze}-success-bg`,style:Wr}):null)),Zn)},oe=Re=>{const{size:Ze,steps:Ft,percent:Qt=0,strokeWidth:an=8,strokeColor:Pn,trailColor:On=null,prefixCls:Nn,children:Zn}=Re,tr=Math.round(Ft*(Qt/100)),Tn=Ze==="small"?2:14,gr=Ze!=null?Ze:[Tn,an],[Pr,Rr]=Ge(gr,"step",{steps:Ft,strokeWidth:an}),Zr=Pr/Ft,vr=new Array(Ft);for(let Dr=0;Dr<Ft;Dr++){const yr=Array.isArray(Pn)?Pn[Dr]:Pn;vr[Dr]=pe.createElement("div",{key:Dr,className:Ne()(`${Nn}-steps-item`,{[`${Nn}-steps-item-active`]:Dr<=tr-1}),style:{backgroundColor:Dr<=tr-1?yr:On,width:Zr,height:Rr}})}return pe.createElement("div",{className:`${Nn}-steps-outer`},vr,Zn)},fe=de(36237),ye=de(17313),ce=de(83116),Ke=de(37613);const Dt=Re=>{const Ze=Re?"100%":"-100%";return new fe.Keyframes(`antProgress${Re?"RTL":"LTR"}Active`,{"0%":{transform:`translateX(${Ze}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${Ze}) scaleX(0)`,opacity:.5},to:{transform:"translateX(0) scaleX(1)",opacity:0}})},ln=Re=>{const{componentCls:Ze,iconCls:Ft}=Re;return{[Ze]:Object.assign(Object.assign({},(0,ye.Wf)(Re)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:Re.fontSize,marginInlineEnd:Re.marginXS,marginBottom:Re.marginXS},[`${Ze}-outer`]:{display:"inline-block",width:"100%"},[`&${Ze}-show-info`]:{[`${Ze}-outer`]:{marginInlineEnd:`calc(-2em - ${Re.marginXS}px)`,paddingInlineEnd:`calc(2em + ${Re.paddingXS}px)`}},[`${Ze}-inner`]:{position:"relative",display:"inline-block",width:"100%",overflow:"hidden",verticalAlign:"middle",backgroundColor:Re.remainingColor,borderRadius:Re.lineBorderRadius},[`${Ze}-inner:not(${Ze}-circle-gradient)`]:{[`${Ze}-circle-path`]:{stroke:Re.defaultColor}},[`${Ze}-success-bg, ${Ze}-bg`]:{position:"relative",backgroundColor:Re.defaultColor,borderRadius:Re.lineBorderRadius,transition:`all ${Re.motionDurationSlow} ${Re.motionEaseInOutCirc}`},[`${Ze}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:Re.colorSuccess},[`${Ze}-text`]:{display:"inline-block",width:"2em",marginInlineStart:Re.marginXS,color:Re.colorText,lineHeight:1,whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[Ft]:{fontSize:Re.fontSize}},[`&${Ze}-status-active`]:{[`${Ze}-bg::before`]:{position:"absolute",inset:0,backgroundColor:Re.colorBgContainer,borderRadius:Re.lineBorderRadius,opacity:0,animationName:Dt(),animationDuration:Re.progressActiveMotionDuration,animationTimingFunction:Re.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${Ze}-rtl${Ze}-status-active`]:{[`${Ze}-bg::before`]:{animationName:Dt(!0)}},[`&${Ze}-status-exception`]:{[`${Ze}-bg`]:{backgroundColor:Re.colorError},[`${Ze}-text`]:{color:Re.colorError}},[`&${Ze}-status-exception ${Ze}-inner:not(${Ze}-circle-gradient)`]:{[`${Ze}-circle-path`]:{stroke:Re.colorError}},[`&${Ze}-status-success`]:{[`${Ze}-bg`]:{backgroundColor:Re.colorSuccess},[`${Ze}-text`]:{color:Re.colorSuccess}},[`&${Ze}-status-success ${Ze}-inner:not(${Ze}-circle-gradient)`]:{[`${Ze}-circle-path`]:{stroke:Re.colorSuccess}}})}},Jt=Re=>{const{componentCls:Ze,iconCls:Ft}=Re;return{[Ze]:{[`${Ze}-circle-trail`]:{stroke:Re.remainingColor},[`&${Ze}-circle ${Ze}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${Ze}-circle ${Ze}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:Re.circleTextColor,fontSize:Re.circleTextFontSize,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[Ft]:{fontSize:`${Re.fontSize/Re.fontSizeSM}em`}},[`${Ze}-circle&-status-exception`]:{[`${Ze}-text`]:{color:Re.colorError}},[`${Ze}-circle&-status-success`]:{[`${Ze}-text`]:{color:Re.colorSuccess}}},[`${Ze}-inline-circle`]:{lineHeight:1,[`${Ze}-inner`]:{verticalAlign:"bottom"}}}},en=Re=>{const{componentCls:Ze}=Re;return{[Ze]:{[`${Ze}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:Re.progressStepMinWidth,marginInlineEnd:Re.progressStepMarginInlineEnd,backgroundColor:Re.remainingColor,transition:`all ${Re.motionDurationSlow}`,"&-active":{backgroundColor:Re.defaultColor}}}}}},nn=Re=>{const{componentCls:Ze,iconCls:Ft}=Re;return{[Ze]:{[`${Ze}-small&-line, ${Ze}-small&-line ${Ze}-text ${Ft}`]:{fontSize:Re.fontSizeSM}}}};var wn=(0,ce.Z)("Progress",Re=>{const Ze=Re.marginXXS/2,Ft=(0,Ke.TS)(Re,{progressStepMarginInlineEnd:Ze,progressStepMinWidth:Ze,progressActiveMotionDuration:"2.4s"});return[ln(Ft),Jt(Ft),en(Ft),nn(Ft)]},Re=>({circleTextColor:Re.colorText,defaultColor:Re.colorInfo,remainingColor:Re.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:"1em"})),mn=function(Re,Ze){var Ft={};for(var Qt in Re)Object.prototype.hasOwnProperty.call(Re,Qt)&&Ze.indexOf(Qt)<0&&(Ft[Qt]=Re[Qt]);if(Re!=null&&typeof Object.getOwnPropertySymbols=="function")for(var an=0,Qt=Object.getOwnPropertySymbols(Re);an<Qt.length;an++)Ze.indexOf(Qt[an])<0&&Object.prototype.propertyIsEnumerable.call(Re,Qt[an])&&(Ft[Qt[an]]=Re[Qt[an]]);return Ft};const En=null,yt=["normal","exception","active","success"];var Jn=pe.forwardRef((Re,Ze)=>{const{prefixCls:Ft,className:Qt,rootClassName:an,steps:Pn,strokeColor:On,percent:Nn=0,size:Zn="default",showInfo:tr=!0,type:Tn="line",status:gr,format:Pr,style:Rr}=Re,Zr=mn(Re,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format","style"]),vr=pe.useMemo(()=>{var Qe,Me;const Ae=bt(Re);return parseInt(Ae!==void 0?(Qe=Ae!=null?Ae:0)===null||Qe===void 0?void 0:Qe.toString():(Me=Nn!=null?Nn:0)===null||Me===void 0?void 0:Me.toString(),10)},[Nn,Re.success,Re.successPercent]),Dr=pe.useMemo(()=>!yt.includes(gr)&&vr>=100?"success":gr||"normal",[gr,vr]),{getPrefixCls:yr,direction:Nr,progress:Wr}=pe.useContext(ke.E_),Er=yr("progress",Ft),[qr,zr]=wn(Er),ar=pe.useMemo(()=>{if(!tr)return null;const Qe=bt(Re);let Me;const Ae=Pr||(De=>`${De}%`),Le=Tn==="line";return Pr||Dr!=="exception"&&Dr!=="success"?Me=Ae(xe(Nn),xe(Qe)):Dr==="exception"?Me=Le?pe.createElement(ct.Z,null):pe.createElement(Se.Z,null):Dr==="success"&&(Me=Le?pe.createElement(ut.Z,null):pe.createElement($e.Z,null)),pe.createElement("span",{className:`${Er}-text`,title:typeof Me=="string"?Me:void 0},Me)},[tr,Nn,vr,Dr,Tn,Er,Pr]),or=Array.isArray(On)?On[0]:On,Bn=typeof On=="string"||Array.isArray(On)?On:void 0;let In;Tn==="line"?In=Pn?pe.createElement(oe,Object.assign({},Re,{strokeColor:Bn,prefixCls:Er,steps:Pn}),ar):pe.createElement(ve,Object.assign({},Re,{strokeColor:or,prefixCls:Er,direction:Nr}),ar):(Tn==="circle"||Tn==="dashboard")&&(In=pe.createElement(jt,Object.assign({},Re,{strokeColor:or,prefixCls:Er,progressStatus:Dr}),ar));const wr=Ne()(Er,`${Er}-status-${Dr}`,`${Er}-${Tn==="dashboard"&&"circle"||Pn&&"steps"||Tn}`,{[`${Er}-inline-circle`]:Tn==="circle"&&Ge(Zn,"circle")[0]<=20,[`${Er}-show-info`]:tr,[`${Er}-${Zn}`]:typeof Zn=="string",[`${Er}-rtl`]:Nr==="rtl"},Wr==null?void 0:Wr.className,Qt,an,zr);return qr(pe.createElement("div",Object.assign({ref:Ze,style:Object.assign(Object.assign({},Wr==null?void 0:Wr.style),Rr),className:wr,role:"progressbar","aria-valuenow":vr},(0,Ce.Z)(Zr,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),In))}),tt=Jn},5112:function(kn,dn,de){"use strict";de.d(dn,{ZP:function(){return ze}});var pe=de(92310),ut=de.n(pe),$e=de(18929),ct=de(26112),Se=de(59301),Pe=de(36355),Ne=de(19716);const Ce=Se.createContext(null),ke=Ce.Provider;var Fe=Ce;const gt=Se.createContext(null),Oe=gt.Provider;var je=de(5630),kt=de(8654),et=de(1684),mt=de(32441),st=de(17313),Rt=de(83116),tn=de(37613);const nt=xe=>{const{componentCls:bt,antCls:pn}=xe,Ut=`${bt}-group`;return{[Ut]:Object.assign(Object.assign({},(0,st.Wf)(xe)),{display:"inline-block",fontSize:0,[`&${Ut}-rtl`]:{direction:"rtl"},[`${pn}-badge ${pn}-badge-count`]:{zIndex:1},[`> ${pn}-badge:not(:first-child) > ${pn}-button-wrapper`]:{borderInlineStart:"none"}})}},ht=xe=>{const{componentCls:bt,wrapperMarginInlineEnd:pn,colorPrimary:Ut,radioSize:Ge,motionDurationSlow:Ye,motionDurationMid:It,motionEaseInOutCirc:Mn,colorBgContainer:jt,colorBorder:bn,lineWidth:Vt,dotSize:Zt,colorBgContainerDisabled:zt,colorTextDisabled:ve,paddingXS:se,dotColorDisabled:oe,lineType:fe,radioDotDisabledSize:ye,wireframe:ce,colorWhite:Ke}=xe,Dt=`${bt}-inner`;return{[`${bt}-wrapper`]:Object.assign(Object.assign({},(0,st.Wf)(xe)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:pn,cursor:"pointer",[`&${bt}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:xe.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},[`${bt}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${Vt}px ${fe} ${Ut}`,borderRadius:"50%",visibility:"hidden",content:'""'},[bt]:Object.assign(Object.assign({},(0,st.Wf)(xe)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${bt}-wrapper:hover &,
&:hover ${Dt}`]:{borderColor:Ut},[`${bt}-input:focus-visible + ${Dt}`]:Object.assign({},(0,st.oN)(xe)),[`${bt}:hover::after, ${bt}-wrapper:hover &::after`]:{visibility:"visible"},[`${bt}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:Ge,height:Ge,marginBlockStart:Ge/-2,marginInlineStart:Ge/-2,backgroundColor:ce?Ut:Ke,borderBlockStart:0,borderInlineStart:0,borderRadius:Ge,transform:"scale(0)",opacity:0,transition:`all ${Ye} ${Mn}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:Ge,height:Ge,backgroundColor:jt,borderColor:bn,borderStyle:"solid",borderWidth:Vt,borderRadius:"50%",transition:`all ${It}`},[`${bt}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${bt}-checked`]:{[Dt]:{borderColor:Ut,backgroundColor:ce?jt:Ut,"&::after":{transform:`scale(${Zt/Ge})`,opacity:1,transition:`all ${Ye} ${Mn}`}}},[`${bt}-disabled`]:{cursor:"not-allowed",[Dt]:{backgroundColor:zt,borderColor:bn,cursor:"not-allowed","&::after":{backgroundColor:oe}},[`${bt}-input`]:{cursor:"not-allowed"},[`${bt}-disabled + span`]:{color:ve,cursor:"not-allowed"},[`&${bt}-checked`]:{[Dt]:{"&::after":{transform:`scale(${ye/Ge})`}}}},[`span${bt} + *`]:{paddingInlineStart:se,paddingInlineEnd:se}})}},Ve=xe=>{const{buttonColor:bt,controlHeight:pn,componentCls:Ut,lineWidth:Ge,lineType:Ye,colorBorder:It,motionDurationSlow:Mn,motionDurationMid:jt,buttonPaddingInline:bn,fontSize:Vt,buttonBg:Zt,fontSizeLG:zt,controlHeightLG:ve,controlHeightSM:se,paddingXS:oe,borderRadius:fe,borderRadiusSM:ye,borderRadiusLG:ce,buttonCheckedBg:Ke,buttonSolidCheckedColor:Dt,colorTextDisabled:ln,colorBgContainerDisabled:Jt,buttonCheckedBgDisabled:en,buttonCheckedColorDisabled:nn,colorPrimary:wn,colorPrimaryHover:mn,colorPrimaryActive:En,buttonSolidCheckedBg:yt,buttonSolidCheckedHoverBg:gn,buttonSolidCheckedActiveBg:Jn}=xe;return{[`${Ut}-button-wrapper`]:{position:"relative",display:"inline-block",height:pn,margin:0,paddingInline:bn,paddingBlock:0,color:bt,fontSize:Vt,lineHeight:`${pn-Ge*2}px`,background:Zt,border:`${Ge}px ${Ye} ${It}`,borderBlockStartWidth:Ge+.02,borderInlineStartWidth:0,borderInlineEndWidth:Ge,cursor:"pointer",transition:[`color ${jt}`,`background ${jt}`,`box-shadow ${jt}`].join(","),a:{color:bt},[`> ${Ut}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:-Ge,insetInlineStart:-Ge,display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:Ge,paddingInline:0,backgroundColor:It,transition:`background-color ${Mn}`,content:'""'}},"&:first-child":{borderInlineStart:`${Ge}px ${Ye} ${It}`,borderStartStartRadius:fe,borderEndStartRadius:fe},"&:last-child":{borderStartEndRadius:fe,borderEndEndRadius:fe},"&:first-child:last-child":{borderRadius:fe},[`${Ut}-group-large &`]:{height:ve,fontSize:zt,lineHeight:`${ve-Ge*2}px`,"&:first-child":{borderStartStartRadius:ce,borderEndStartRadius:ce},"&:last-child":{borderStartEndRadius:ce,borderEndEndRadius:ce}},[`${Ut}-group-small &`]:{height:se,paddingInline:oe-Ge,paddingBlock:0,lineHeight:`${se-Ge*2}px`,"&:first-child":{borderStartStartRadius:ye,borderEndStartRadius:ye},"&:last-child":{borderStartEndRadius:ye,borderEndEndRadius:ye}},"&:hover":{position:"relative",color:wn},"&:has(:focus-visible)":Object.assign({},(0,st.oN)(xe)),[`${Ut}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${Ut}-button-wrapper-disabled)`]:{zIndex:1,color:wn,background:Ke,borderColor:wn,"&::before":{backgroundColor:wn},"&:first-child":{borderColor:wn},"&:hover":{color:mn,borderColor:mn,"&::before":{backgroundColor:mn}},"&:active":{color:En,borderColor:En,"&::before":{backgroundColor:En}}},[`${Ut}-group-solid &-checked:not(${Ut}-button-wrapper-disabled)`]:{color:Dt,background:yt,borderColor:yt,"&:hover":{color:Dt,background:gn,borderColor:gn},"&:active":{color:Dt,background:Jn,borderColor:Jn}},"&-disabled":{color:ln,backgroundColor:Jt,borderColor:It,cursor:"not-allowed","&:first-child, &:hover":{color:ln,backgroundColor:Jt,borderColor:It}},[`&-disabled${Ut}-button-wrapper-checked`]:{color:nn,backgroundColor:en,borderColor:It,boxShadow:"none"}}}},Ee=xe=>xe-4*2;var Xe=(0,Rt.Z)("Radio",xe=>{const{controlOutline:bt,controlOutlineWidth:pn,radioSize:Ut}=xe,Ge=`0 0 0 ${pn}px ${bt}`,Ye=Ge,It=Ee(Ut),Mn=(0,tn.TS)(xe,{radioDotDisabledSize:It,radioFocusShadow:Ge,radioButtonFocusShadow:Ye});return[nt(Mn),ht(Mn),Ve(Mn)]},xe=>{const{wireframe:bt,padding:pn,marginXS:Ut,lineWidth:Ge,fontSizeLG:Ye,colorText:It,colorBgContainer:Mn,colorTextDisabled:jt,controlItemBgActiveDisabled:bn,colorTextLightSolid:Vt,colorPrimary:Zt,colorPrimaryHover:zt,colorPrimaryActive:ve}=xe,se=4,oe=Ye,fe=bt?Ee(oe):oe-(se+Ge)*2;return{radioSize:oe,dotSize:fe,dotColorDisabled:jt,buttonSolidCheckedColor:Vt,buttonSolidCheckedBg:Zt,buttonSolidCheckedHoverBg:zt,buttonSolidCheckedActiveBg:ve,buttonBg:Mn,buttonCheckedBg:Mn,buttonColor:It,buttonCheckedBgDisabled:bn,buttonCheckedColorDisabled:jt,buttonPaddingInline:pn-Ge,wrapperMarginInlineEnd:Ut}}),at=de(14088),vt=de(4572),Ue=function(xe,bt){var pn={};for(var Ut in xe)Object.prototype.hasOwnProperty.call(xe,Ut)&&bt.indexOf(Ut)<0&&(pn[Ut]=xe[Ut]);if(xe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ge=0,Ut=Object.getOwnPropertySymbols(xe);Ge<Ut.length;Ge++)bt.indexOf(Ut[Ge])<0&&Object.prototype.propertyIsEnumerable.call(xe,Ut[Ge])&&(pn[Ut[Ge]]=xe[Ut[Ge]]);return pn};const Ot=(xe,bt)=>{var pn,Ut;const Ge=Se.useContext(Fe),Ye=Se.useContext(gt),{getPrefixCls:It,direction:Mn,radio:jt}=Se.useContext(Pe.E_),bn=Se.useRef(null),Vt=(0,kt.sQ)(bt,bn),{isFormItemInput:Zt}=Se.useContext(mt.aM),zt=En=>{var yt,gn;(yt=xe.onChange)===null||yt===void 0||yt.call(xe,En),(gn=Ge==null?void 0:Ge.onChange)===null||gn===void 0||gn.call(Ge,En)},{prefixCls:ve,className:se,rootClassName:oe,children:fe,style:ye}=xe,ce=Ue(xe,["prefixCls","className","rootClassName","children","style"]),Ke=It("radio",ve),Dt=((Ge==null?void 0:Ge.optionType)||Ye)==="button",ln=Dt?`${Ke}-button`:Ke,[Jt,en]=Xe(Ke),nn=Object.assign({},ce),wn=Se.useContext(et.Z);Ge&&(nn.name=Ge.name,nn.onChange=zt,nn.checked=xe.value===Ge.value,nn.disabled=(pn=nn.disabled)!==null&&pn!==void 0?pn:Ge.disabled),nn.disabled=(Ut=nn.disabled)!==null&&Ut!==void 0?Ut:wn;const mn=ut()(`${ln}-wrapper`,{[`${ln}-wrapper-checked`]:nn.checked,[`${ln}-wrapper-disabled`]:nn.disabled,[`${ln}-wrapper-rtl`]:Mn==="rtl",[`${ln}-wrapper-in-form-item`]:Zt},jt==null?void 0:jt.className,se,oe,en);return Jt(Se.createElement(at.Z,{component:"Radio",disabled:nn.disabled},Se.createElement("label",{className:mn,style:Object.assign(Object.assign({},jt==null?void 0:jt.style),ye),onMouseEnter:xe.onMouseEnter,onMouseLeave:xe.onMouseLeave},Se.createElement(je.Z,Object.assign({},nn,{className:ut()(nn.className,!Dt&&vt.A),type:"radio",prefixCls:ln,ref:Vt})),fe!==void 0?Se.createElement("span",null,fe):null)))};var At=Se.forwardRef(Ot);const qe=Se.forwardRef((xe,bt)=>{const{getPrefixCls:pn,direction:Ut}=Se.useContext(Pe.E_),[Ge,Ye]=(0,$e.Z)(xe.defaultValue,{value:xe.value}),It=yt=>{const gn=Ge,Jn=yt.target.value;"value"in xe||Ye(Jn);const{onChange:tt}=xe;tt&&Jn!==gn&&tt(yt)},{prefixCls:Mn,className:jt,rootClassName:bn,options:Vt,buttonStyle:Zt="outline",disabled:zt,children:ve,size:se,style:oe,id:fe,onMouseEnter:ye,onMouseLeave:ce,onFocus:Ke,onBlur:Dt}=xe,ln=pn("radio",Mn),Jt=`${ln}-group`,[en,nn]=Xe(ln);let wn=ve;Vt&&Vt.length>0&&(wn=Vt.map(yt=>typeof yt=="string"||typeof yt=="number"?Se.createElement(At,{key:yt.toString(),prefixCls:ln,disabled:zt,value:yt,checked:Ge===yt},yt):Se.createElement(At,{key:`radio-group-value-options-${yt.value}`,prefixCls:ln,disabled:yt.disabled||zt,value:yt.value,checked:Ge===yt.value,title:yt.title,style:yt.style},yt.label)));const mn=(0,Ne.Z)(se),En=ut()(Jt,`${Jt}-${Zt}`,{[`${Jt}-${mn}`]:mn,[`${Jt}-rtl`]:Ut==="rtl"},jt,bn,nn);return en(Se.createElement("div",Object.assign({},(0,ct.Z)(xe,{aria:!0,data:!0}),{className:En,style:oe,onMouseEnter:ye,onMouseLeave:ce,onFocus:Ke,onBlur:Dt,id:fe,ref:bt}),Se.createElement(ke,{value:{onChange:It,value:Ge,disabled:xe.disabled,name:xe.name,optionType:xe.optionType}},wn)))});var Ht=Se.memo(qe),cn=function(xe,bt){var pn={};for(var Ut in xe)Object.prototype.hasOwnProperty.call(xe,Ut)&&bt.indexOf(Ut)<0&&(pn[Ut]=xe[Ut]);if(xe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ge=0,Ut=Object.getOwnPropertySymbols(xe);Ge<Ut.length;Ge++)bt.indexOf(Ut[Ge])<0&&Object.prototype.propertyIsEnumerable.call(xe,Ut[Ge])&&(pn[Ut[Ge]]=xe[Ut[Ge]]);return pn};const Kt=(xe,bt)=>{const{getPrefixCls:pn}=Se.useContext(Pe.E_),{prefixCls:Ut}=xe,Ge=cn(xe,["prefixCls"]),Ye=pn("radio",Ut);return Se.createElement(Oe,{value:"button"},Se.createElement(At,Object.assign({prefixCls:Ye},Ge,{type:"radio",ref:bt})))};var Xt=Se.forwardRef(Kt);const Wt=At;Wt.Button=Xt,Wt.Group=Ht,Wt.__ANT_RADIO=!0;var ze=Wt},57809:function(kn,dn,de){"use strict";var pe=de(92310),ut=de.n(pe),$e=de(77861),ct=de(2738),Se=de(59301),Pe=de(53487),Ne=de(62892),Ce=de(19080),ke=de(36355),Fe=de(1684),gt=de(93891),Oe=de(19716),je=de(32441),kt=de(33234),et=de(14154),mt=de(58582),st=de(84443),Rt=de(66339),tn=function(Xe,at){var vt={};for(var Ue in Xe)Object.prototype.hasOwnProperty.call(Xe,Ue)&&at.indexOf(Ue)<0&&(vt[Ue]=Xe[Ue]);if(Xe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ot=0,Ue=Object.getOwnPropertySymbols(Xe);Ot<Ue.length;Ot++)at.indexOf(Ue[Ot])<0&&Object.prototype.propertyIsEnumerable.call(Xe,Ue[Ot])&&(vt[Ue[Ot]]=Xe[Ue[Ot]]);return vt};const nt="SECRET_COMBOBOX_MODE_DO_NOT_USE",ht=(Xe,at)=>{var vt,{prefixCls:Ue,bordered:Ot=!0,className:rt,rootClassName:At,getPopupContainer:qe,popupClassName:Ht,dropdownClassName:cn,listHeight:Kt=256,placement:Xt,listItemHeight:Wt=24,size:ze,disabled:xe,notFoundContent:bt,status:pn,builtinPlacements:Ut,dropdownMatchSelectWidth:Ge,popupMatchSelectWidth:Ye,direction:It,style:Mn,allowClear:jt}=Xe,bn=tn(Xe,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:Vt,getPrefixCls:Zt,renderEmpty:zt,direction:ve,virtual:se,popupMatchSelectWidth:oe,popupOverflow:fe,select:ye}=Se.useContext(ke.E_),ce=Zt("select",Ue),Ke=Zt(),Dt=It!=null?It:ve,{compactSize:ln,compactItemClassnames:Jt}=(0,kt.ri)(ce,Dt),[en,nn]=(0,et.Z)(ce),wn=Se.useMemo(()=>{const{mode:Dr}=bn;if(Dr!=="combobox")return Dr===nt?"combobox":Dr},[bn.mode]),mn=wn==="multiple"||wn==="tags",En=(0,st.Z)(bn.suffixIcon,bn.showArrow),yt=(vt=Ye!=null?Ye:Ge)!==null&&vt!==void 0?vt:oe,{status:gn,hasFeedback:Jn,isFormItemInput:tt,feedbackIcon:Re}=Se.useContext(je.aM),Ze=(0,Ce.F)(gn,pn);let Ft;bt!==void 0?Ft=bt:wn==="combobox"?Ft=null:Ft=(zt==null?void 0:zt("Select"))||Se.createElement(gt.Z,{componentName:"Select"});const{suffixIcon:Qt,itemIcon:an,removeIcon:Pn,clearIcon:On}=(0,Rt.Z)(Object.assign(Object.assign({},bn),{multiple:mn,hasFeedback:Jn,feedbackIcon:Re,showSuffixIcon:En,prefixCls:ce,showArrow:bn.showArrow,componentName:"Select"})),Nn=jt===!0?{clearIcon:On}:jt,Zn=(0,ct.Z)(bn,["suffixIcon","itemIcon"]),tr=ut()(Ht||cn,{[`${ce}-dropdown-${Dt}`]:Dt==="rtl"},At,nn),Tn=(0,Oe.Z)(Dr=>{var yr;return(yr=ze!=null?ze:ln)!==null&&yr!==void 0?yr:Dr}),gr=Se.useContext(Fe.Z),Pr=xe!=null?xe:gr,Rr=ut()({[`${ce}-lg`]:Tn==="large",[`${ce}-sm`]:Tn==="small",[`${ce}-rtl`]:Dt==="rtl",[`${ce}-borderless`]:!Ot,[`${ce}-in-form-item`]:tt},(0,Ce.Z)(ce,Ze,Jn),Jt,ye==null?void 0:ye.className,rt,At,nn),Zr=Se.useMemo(()=>Xt!==void 0?Xt:Dt==="rtl"?"bottomRight":"bottomLeft",[Xt,Dt]),vr=(0,mt.Z)(Ut,fe);return en(Se.createElement($e.ZP,Object.assign({ref:at,virtual:se,showSearch:ye==null?void 0:ye.showSearch},Zn,{style:Object.assign(Object.assign({},ye==null?void 0:ye.style),Mn),dropdownMatchSelectWidth:yt,builtinPlacements:vr,transitionName:(0,Ne.m)(Ke,"slide-up",bn.transitionName),listHeight:Kt,listItemHeight:Wt,mode:wn,prefixCls:ce,placement:Zr,direction:Dt,suffixIcon:Qt,menuItemSelectedIcon:an,removeIcon:Pn,allowClear:Nn,notFoundContent:Ft,className:Rr,getPopupContainer:qe||Vt,dropdownClassName:tr,disabled:Pr})))},Ve=Se.forwardRef(ht),Ee=(0,Pe.Z)(Ve);Ve.SECRET_COMBOBOX_MODE_DO_NOT_USE=nt,Ve.Option=$e.Wx,Ve.OptGroup=$e.Xo,Ve._InternalPanelDoNotUseOrYouWillBeFired=Ee,dn.default=Ve},14154:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return Ve}});var pe=de(17313),ut=de(74207),$e=de(37613),ct=de(83116),Se=de(13826),Pe=de(92899);const Ne=Ee=>{const{optionHeight:Xe,optionFontSize:at,optionLineHeight:vt,optionPadding:Ue}=Ee;return{position:"relative",display:"block",minHeight:Xe,padding:Ue,color:Ee.colorText,fontWeight:"normal",fontSize:at,lineHeight:vt,boxSizing:"border-box"}};var ke=Ee=>{const{antCls:Xe,componentCls:at}=Ee,vt=`${at}-item`,Ue=`&${Xe}-slide-up-enter${Xe}-slide-up-enter-active`,Ot=`&${Xe}-slide-up-appear${Xe}-slide-up-appear-active`,rt=`&${Xe}-slide-up-leave${Xe}-slide-up-leave-active`,At=`${at}-dropdown-placement-`;return[{[`${at}-dropdown`]:Object.assign(Object.assign({},(0,pe.Wf)(Ee)),{position:"absolute",top:-9999,zIndex:Ee.zIndexPopup,boxSizing:"border-box",padding:Ee.paddingXXS,overflow:"hidden",fontSize:Ee.fontSize,fontVariant:"initial",backgroundColor:Ee.colorBgElevated,borderRadius:Ee.borderRadiusLG,outline:"none",boxShadow:Ee.boxShadowSecondary,[`
${Ue}${At}bottomLeft,
${Ot}${At}bottomLeft
`]:{animationName:Se.fJ},[`
${Ue}${At}topLeft,
${Ot}${At}topLeft,
${Ue}${At}topRight,
${Ot}${At}topRight
`]:{animationName:Se.Qt},[`${rt}${At}bottomLeft`]:{animationName:Se.Uw},[`
${rt}${At}topLeft,
${rt}${At}topRight
`]:{animationName:Se.ly},"&-hidden":{display:"none"},[`${vt}`]:Object.assign(Object.assign({},Ne(Ee)),{cursor:"pointer",transition:`background ${Ee.motionDurationSlow} ease`,borderRadius:Ee.borderRadiusSM,"&-group":{color:Ee.colorTextDescription,fontSize:Ee.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},pe.vS),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${vt}-option-disabled)`]:{backgroundColor:Ee.optionActiveBg},[`&-selected:not(${vt}-option-disabled)`]:{color:Ee.optionSelectedColor,fontWeight:Ee.optionSelectedFontWeight,backgroundColor:Ee.optionSelectedBg,[`${vt}-option-state`]:{color:Ee.colorPrimary}},"&-disabled":{[`&${vt}-option-selected`]:{backgroundColor:Ee.colorBgContainerDisabled},color:Ee.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:Ee.controlPaddingHorizontal*2}}}),"&-rtl":{direction:"rtl"}})},(0,Se.oN)(Ee,"slide-up"),(0,Se.oN)(Ee,"slide-down"),(0,Pe.Fm)(Ee,"move-up"),(0,Pe.Fm)(Ee,"move-down")]};const Fe=2,gt=Ee=>{let{controlHeightSM:Xe,controlHeight:at,lineWidth:vt}=Ee;const Ue=(at-Xe)/2-vt,Ot=Math.ceil(Ue/2);return[Ue,Ot]};function Oe(Ee,Xe){const{componentCls:at,iconCls:vt}=Ee,Ue=`${at}-selection-overflow`,Ot=Ee.multipleSelectItemHeight,[rt]=gt(Ee),At=Xe?`${at}-${Xe}`:"";return{[`${at}-multiple${At}`]:{fontSize:Ee.fontSize,[Ue]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},[`${at}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",padding:`${rt-Fe}px ${Fe*2}px`,borderRadius:Ee.borderRadius,[`${at}-show-search&`]:{cursor:"text"},[`${at}-disabled&`]:{background:Ee.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${Fe}px 0`,lineHeight:`${Ot}px`,visibility:"hidden",content:'"\\a0"'}},[`
&${at}-show-arrow ${at}-selector,
&${at}-allow-clear ${at}-selector
`]:{paddingInlineEnd:Ee.fontSizeIcon+Ee.controlPaddingHorizontal},[`${at}-selection-item`]:{position:"relative",display:"flex",flex:"none",boxSizing:"border-box",maxWidth:"100%",height:Ot,marginTop:Fe,marginBottom:Fe,lineHeight:`${Ot-Ee.lineWidth*2}px`,background:Ee.multipleItemBg,border:`${Ee.lineWidth}px ${Ee.lineType} ${Ee.multipleItemBorderColor}`,borderRadius:Ee.borderRadiusSM,cursor:"default",transition:`font-size ${Ee.motionDurationSlow}, line-height ${Ee.motionDurationSlow}, height ${Ee.motionDurationSlow}`,userSelect:"none",marginInlineEnd:Fe*2,paddingInlineStart:Ee.paddingXS,paddingInlineEnd:Ee.paddingXS/2,[`${at}-disabled&`]:{color:Ee.multipleItemColorDisabled,borderColor:Ee.multipleItemBorderColorDisabled,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:Ee.paddingXS/2,overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},(0,pe.Ro)()),{display:"inline-flex",alignItems:"center",color:Ee.colorIcon,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${vt}`]:{verticalAlign:"-0.2em"},"&:hover":{color:Ee.colorIconHover}})},[`${Ue}-item + ${Ue}-item`]:{[`${at}-selection-search`]:{marginInlineStart:0}},[`${at}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:Ee.inputPaddingHorizontalBase-rt,"\n &-input,\n &-mirror\n ":{height:Ot,fontFamily:Ee.fontFamily,lineHeight:`${Ot}px`,transition:`all ${Ee.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${at}-selection-placeholder `]:{position:"absolute",top:"50%",insetInlineStart:Ee.inputPaddingHorizontalBase,insetInlineEnd:Ee.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${Ee.motionDurationSlow}`}}}}var kt=Ee=>{const{componentCls:Xe}=Ee,at=(0,$e.TS)(Ee,{controlHeight:Ee.controlHeightSM,multipleSelectItemHeight:Ee.controlHeightXS,borderRadius:Ee.borderRadiusSM,borderRadiusSM:Ee.borderRadiusXS}),vt=(0,$e.TS)(Ee,{fontSize:Ee.fontSizeLG,controlHeight:Ee.controlHeightLG,multipleSelectItemHeight:Ee.multipleItemHeightLG,borderRadius:Ee.borderRadiusLG,borderRadiusSM:Ee.borderRadius}),[,Ue]=gt(Ee);return[Oe(Ee),Oe(at,"sm"),{[`${Xe}-multiple${Xe}-sm`]:{[`${Xe}-selection-placeholder`]:{insetInline:Ee.controlPaddingHorizontalSM-Ee.lineWidth},[`${Xe}-selection-search`]:{marginInlineStart:Ue}}},Oe(vt,"lg")]};function et(Ee,Xe){const{componentCls:at,inputPaddingHorizontalBase:vt,borderRadius:Ue}=Ee,Ot=Ee.controlHeight-Ee.lineWidth*2,rt=Math.ceil(Ee.fontSize*1.25),At=Xe?`${at}-${Xe}`:"";return{[`${at}-single${At}`]:{fontSize:Ee.fontSize,[`${at}-selector`]:Object.assign(Object.assign({},(0,pe.Wf)(Ee)),{display:"flex",borderRadius:Ue,[`${at}-selection-search`]:{position:"absolute",top:0,insetInlineStart:vt,insetInlineEnd:vt,bottom:0,"&-input":{width:"100%"}},[`
${at}-selection-item,
${at}-selection-placeholder
`]:{padding:0,lineHeight:`${Ot}px`,transition:`all ${Ee.motionDurationSlow}, visibility 0s`,"@supports (-moz-appearance: meterbar)":{lineHeight:`${Ot}px`}},[`${at}-selection-item`]:{position:"relative",userSelect:"none"},[`${at}-selection-placeholder`]:{transition:"none",pointerEvents:"none"},[["&:after",`${at}-selection-item:after`,`${at}-selection-placeholder:after`].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),[`
&${at}-show-arrow ${at}-selection-item,
&${at}-show-arrow ${at}-selection-placeholder
`]:{paddingInlineEnd:rt},[`&${at}-open ${at}-selection-item`]:{color:Ee.colorTextPlaceholder},[`&:not(${at}-customize-input)`]:{[`${at}-selector`]:{width:"100%",height:Ee.controlHeight,padding:`0 ${vt}px`,[`${at}-selection-search-input`]:{height:Ot},"&:after":{lineHeight:`${Ot}px`}}},[`&${at}-customize-input`]:{[`${at}-selector`]:{"&:after":{display:"none"},[`${at}-selection-search`]:{position:"static",width:"100%"},[`${at}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${vt}px`,"&:after":{display:"none"}}}}}}}function mt(Ee){const{componentCls:Xe}=Ee,at=Ee.controlPaddingHorizontalSM-Ee.lineWidth;return[et(Ee),et((0,$e.TS)(Ee,{controlHeight:Ee.controlHeightSM,borderRadius:Ee.borderRadiusSM}),"sm"),{[`${Xe}-single${Xe}-sm`]:{[`&:not(${Xe}-customize-input)`]:{[`${Xe}-selection-search`]:{insetInlineStart:at,insetInlineEnd:at},[`${Xe}-selector`]:{padding:`0 ${at}px`},[`&${Xe}-show-arrow ${Xe}-selection-search`]:{insetInlineEnd:at+Ee.fontSize*1.5},[`
&${Xe}-show-arrow ${Xe}-selection-item,
&${Xe}-show-arrow ${Xe}-selection-placeholder
`]:{paddingInlineEnd:Ee.fontSize*1.5}}}},et((0,$e.TS)(Ee,{controlHeight:Ee.singleItemHeightLG,fontSize:Ee.fontSizeLG,borderRadius:Ee.borderRadiusLG}),"lg")]}const st=Ee=>{const{componentCls:Xe,selectorBg:at}=Ee;return{position:"relative",backgroundColor:at,border:`${Ee.lineWidth}px ${Ee.lineType} ${Ee.colorBorder}`,transition:`all ${Ee.motionDurationMid} ${Ee.motionEaseInOut}`,input:{cursor:"pointer"},[`${Xe}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit"}},[`${Xe}-disabled&`]:{color:Ee.colorTextDisabled,background:Ee.colorBgContainerDisabled,cursor:"not-allowed",[`${Xe}-multiple&`]:{background:Ee.multipleSelectorBgDisabled},input:{cursor:"not-allowed"}}}},Rt=function(Ee,Xe){let at=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const{componentCls:vt,borderHoverColor:Ue,outlineColor:Ot,antCls:rt}=Xe,At=at?{[`${vt}-selector`]:{borderColor:Ue}}:{};return{[Ee]:{[`&:not(${vt}-disabled):not(${vt}-customize-input):not(${rt}-pagination-size-changer)`]:Object.assign(Object.assign({},At),{[`${vt}-focused& ${vt}-selector`]:{borderColor:Ue,boxShadow:`0 0 0 ${Xe.controlOutlineWidth}px ${Ot}`,outline:0},[`&:hover ${vt}-selector`]:{borderColor:Ue}})}}},tn=Ee=>{const{componentCls:Xe}=Ee;return{[`${Xe}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},nt=Ee=>{const{componentCls:Xe,inputPaddingHorizontalBase:at,iconCls:vt}=Ee;return{[Xe]:Object.assign(Object.assign({},(0,pe.Wf)(Ee)),{position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${Xe}-customize-input) ${Xe}-selector`]:Object.assign(Object.assign({},st(Ee)),tn(Ee)),[`${Xe}-selection-item`]:Object.assign({flex:1,fontWeight:"normal"},pe.vS),[`${Xe}-selection-placeholder`]:Object.assign(Object.assign({},pe.vS),{flex:1,color:Ee.colorTextPlaceholder,pointerEvents:"none"}),[`${Xe}-arrow`]:Object.assign(Object.assign({},(0,pe.Ro)()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:at,height:Ee.fontSizeIcon,marginTop:-Ee.fontSizeIcon/2,color:Ee.colorTextQuaternary,fontSize:Ee.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",[vt]:{verticalAlign:"top",transition:`transform ${Ee.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${Xe}-suffix)`]:{pointerEvents:"auto"}},[`${Xe}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${Xe}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:at,zIndex:1,display:"inline-block",width:Ee.fontSizeIcon,height:Ee.fontSizeIcon,marginTop:-Ee.fontSizeIcon/2,color:Ee.colorTextQuaternary,fontSize:Ee.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",background:Ee.clearBg,cursor:"pointer",opacity:0,transition:`color ${Ee.motionDurationMid} ease, opacity ${Ee.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:Ee.colorTextTertiary}},"&:hover":{[`${Xe}-clear`]:{opacity:1}}}),[`${Xe}-has-feedback`]:{[`${Xe}-clear`]:{insetInlineEnd:at+Ee.fontSize+Ee.paddingXS}}}},ht=Ee=>{const{componentCls:Xe}=Ee;return[{[Xe]:{[`&-borderless ${Xe}-selector`]:{backgroundColor:"transparent !important",borderColor:"transparent !important",boxShadow:"none !important"},[`&${Xe}-in-form-item`]:{width:"100%"}}},nt(Ee),mt(Ee),kt(Ee),ke(Ee),{[`${Xe}-rtl`]:{direction:"rtl"}},Rt(Xe,(0,$e.TS)(Ee,{borderHoverColor:Ee.colorPrimaryHover,outlineColor:Ee.controlOutline})),Rt(`${Xe}-status-error`,(0,$e.TS)(Ee,{borderHoverColor:Ee.colorErrorHover,outlineColor:Ee.colorErrorOutline}),!0),Rt(`${Xe}-status-warning`,(0,$e.TS)(Ee,{borderHoverColor:Ee.colorWarningHover,outlineColor:Ee.colorWarningOutline}),!0),(0,ut.c)(Ee,{borderElCls:`${Xe}-selector`,focusElCls:`${Xe}-focused`})]};var Ve=(0,ct.Z)("Select",(Ee,Xe)=>{let{rootPrefixCls:at}=Xe;const vt=(0,$e.TS)(Ee,{rootPrefixCls:at,inputPaddingHorizontalBase:Ee.paddingSM-1,multipleSelectItemHeight:Ee.multipleItemHeight});return[ht(vt)]},Ee=>{const{fontSize:Xe,lineHeight:at,controlHeight:vt,controlPaddingHorizontal:Ue,zIndexPopupBase:Ot,colorText:rt,fontWeightStrong:At,controlItemBgActive:qe,controlItemBgHover:Ht,colorBgContainer:cn,colorFillSecondary:Kt,controlHeightLG:Xt,controlHeightSM:Wt,colorBgContainerDisabled:ze,colorTextDisabled:xe}=Ee;return{zIndexPopup:Ot+50,optionSelectedColor:rt,optionSelectedFontWeight:At,optionSelectedBg:qe,optionActiveBg:Ht,optionPadding:`${(vt-Xe*at)/2}px ${Ue}px`,optionFontSize:Xe,optionLineHeight:at,optionHeight:vt,selectorBg:cn,clearBg:cn,singleItemHeightLG:Xt,multipleItemBg:Kt,multipleItemBorderColor:"transparent",multipleItemHeight:Wt,multipleItemHeightLG:vt,multipleSelectorBgDisabled:ze,multipleItemColorDisabled:xe,multipleItemBorderColorDisabled:"transparent"}})},58582:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return ut}});const pe=$e=>{const Se={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:$e==="scroll"?"scroll":"visible",_experimental:{dynamicInset:!0}};return{bottomLeft:Object.assign(Object.assign({},Se),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},Se),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},Se),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},Se),{points:["br","tr"],offset:[0,-4]})}};function ut($e,ct){return $e||pe(ct)}},84443:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return pe}});function pe(ut,$e){return $e!==void 0?$e:ut!==null}},66339:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return Ce}});var pe=de(40001),ut=de(19248),$e=de(99267),ct=de(84105),Se=de(58617),Pe=de(47472),Ne=de(59301);function Ce(ke){let{suffixIcon:Fe,clearIcon:gt,menuItemSelectedIcon:Oe,removeIcon:je,loading:kt,multiple:et,hasFeedback:mt,prefixCls:st,showSuffixIcon:Rt,feedbackIcon:tn,showArrow:nt,componentName:ht}=ke;const Ve=gt!=null?gt:Ne.createElement(ut.Z,null),Ee=Ue=>Fe===null&&!mt&&!nt?null:Ne.createElement(Ne.Fragment,null,Rt!==!1&&Ue,mt&&tn);let Xe=null;if(Fe!==void 0)Xe=Ee(Fe);else if(kt)Xe=Ee(Ne.createElement(Se.Z,{spin:!0}));else{const Ue=`${st}-suffix`;Xe=Ot=>{let{open:rt,showSearch:At}=Ot;return Ee(rt&&At?Ne.createElement(Pe.Z,{className:Ue}):Ne.createElement(ct.Z,{className:Ue}))}}let at=null;Oe!==void 0?at=Oe:et?at=Ne.createElement(pe.Z,null):at=null;let vt=null;return je!==void 0?vt=je:vt=Ne.createElement($e.Z,null),{clearIcon:Ve,suffixIcon:Xe,itemIcon:at,removeIcon:vt}}},8378:function(kn,dn){"use strict";const de=pe=>({[pe.componentCls]:{[`${pe.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${pe.motionDurationMid} ${pe.motionEaseInOut},
opacity ${pe.motionDurationMid} ${pe.motionEaseInOut} !important`}},[`${pe.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${pe.motionDurationMid} ${pe.motionEaseInOut},
opacity ${pe.motionDurationMid} ${pe.motionEaseInOut} !important`}}});dn.Z=de},92899:function(kn,dn,de){"use strict";de.d(dn,{Fm:function(){return Oe}});var pe=de(36237),ut=de(95406);const $e=new pe.Keyframes("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),ct=new pe.Keyframes("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),Se=new pe.Keyframes("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Pe=new pe.Keyframes("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),Ne=new pe.Keyframes("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Ce=new pe.Keyframes("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),ke=new pe.Keyframes("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Fe=new pe.Keyframes("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),gt={"move-up":{inKeyframes:ke,outKeyframes:Fe},"move-down":{inKeyframes:$e,outKeyframes:ct},"move-left":{inKeyframes:Se,outKeyframes:Pe},"move-right":{inKeyframes:Ne,outKeyframes:Ce}},Oe=(je,kt)=>{const{antCls:et}=je,mt=`${et}-${kt}`,{inKeyframes:st,outKeyframes:Rt}=gt[kt];return[(0,ut.R)(mt,st,Rt,je.motionDurationMid),{[`
${mt}-enter,
${mt}-appear
`]:{opacity:0,animationTimingFunction:je.motionEaseOutCirc},[`${mt}-leave`]:{animationTimingFunction:je.motionEaseInOutCirc}}]}},13826:function(kn,dn,de){"use strict";de.d(dn,{Qt:function(){return Se},Uw:function(){return ct},fJ:function(){return $e},ly:function(){return Pe},oN:function(){return Oe}});var pe=de(36237),ut=de(95406);const $e=new pe.Keyframes("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),ct=new pe.Keyframes("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),Se=new pe.Keyframes("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),Pe=new pe.Keyframes("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),Ne=new pe.Keyframes("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),Ce=new pe.Keyframes("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),ke=new pe.Keyframes("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),Fe=new pe.Keyframes("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),gt={"slide-up":{inKeyframes:$e,outKeyframes:ct},"slide-down":{inKeyframes:Se,outKeyframes:Pe},"slide-left":{inKeyframes:Ne,outKeyframes:Ce},"slide-right":{inKeyframes:ke,outKeyframes:Fe}},Oe=(je,kt)=>{const{antCls:et}=je,mt=`${et}-${kt}`,{inKeyframes:st,outKeyframes:Rt}=gt[kt];return[(0,ut.R)(mt,st,Rt,je.motionDurationMid),{[`
${mt}-enter,
${mt}-appear
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:je.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${mt}-leave`]:{animationTimingFunction:je.motionEaseInQuint}}]}},78673:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return At}});var pe=de(58617),ut=de(92310),$e=de.n(ut),ct=de(60499),Se=de(18642),Pe=de(72190),Ne=de(42244),Ce=de(59301),ke=de(18929),Fe=de(10228),gt=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],Oe=Ce.forwardRef(function(qe,Ht){var cn,Kt=qe.prefixCls,Xt=Kt===void 0?"rc-switch":Kt,Wt=qe.className,ze=qe.checked,xe=qe.defaultChecked,bt=qe.disabled,pn=qe.loadingIcon,Ut=qe.checkedChildren,Ge=qe.unCheckedChildren,Ye=qe.onClick,It=qe.onChange,Mn=qe.onKeyDown,jt=(0,Ne.Z)(qe,gt),bn=(0,ke.Z)(!1,{value:ze,defaultValue:xe}),Vt=(0,Pe.Z)(bn,2),Zt=Vt[0],zt=Vt[1];function ve(ye,ce){var Ke=Zt;return bt||(Ke=ye,zt(Ke),It==null||It(Ke,ce)),Ke}function se(ye){ye.which===Fe.Z.LEFT?ve(!1,ye):ye.which===Fe.Z.RIGHT&&ve(!0,ye),Mn==null||Mn(ye)}function oe(ye){var ce=ve(!Zt,ye);Ye==null||Ye(ce,ye)}var fe=$e()(Xt,Wt,(cn={},(0,Se.Z)(cn,"".concat(Xt,"-checked"),Zt),(0,Se.Z)(cn,"".concat(Xt,"-disabled"),bt),cn));return Ce.createElement("button",(0,ct.Z)({},jt,{type:"button",role:"switch","aria-checked":Zt,disabled:bt,className:fe,ref:Ht,onKeyDown:se,onClick:oe}),pn,Ce.createElement("span",{className:"".concat(Xt,"-inner")},Ce.createElement("span",{className:"".concat(Xt,"-inner-checked")},Ut),Ce.createElement("span",{className:"".concat(Xt,"-inner-unchecked")},Ge)))});Oe.displayName="Switch";var je=Oe,kt=de(14088),et=de(36355),mt=de(1684),st=de(19716),Rt=de(64993),tn=de(17313),nt=de(83116),ht=de(37613);const Ve=qe=>{const{componentCls:Ht,trackHeightSM:cn,trackPadding:Kt,trackMinWidthSM:Xt,innerMinMarginSM:Wt,innerMaxMarginSM:ze,handleSizeSM:xe}=qe,bt=`${Ht}-inner`;return{[Ht]:{[`&${Ht}-small`]:{minWidth:Xt,height:cn,lineHeight:`${cn}px`,[`${Ht}-inner`]:{paddingInlineStart:ze,paddingInlineEnd:Wt,[`${bt}-checked`]:{marginInlineStart:`calc(-100% + ${xe+Kt*2}px - ${ze*2}px)`,marginInlineEnd:`calc(100% - ${xe+Kt*2}px + ${ze*2}px)`},[`${bt}-unchecked`]:{marginTop:-cn,marginInlineStart:0,marginInlineEnd:0}},[`${Ht}-handle`]:{width:xe,height:xe},[`${Ht}-loading-icon`]:{top:(xe-qe.switchLoadingIconSize)/2,fontSize:qe.switchLoadingIconSize},[`&${Ht}-checked`]:{[`${Ht}-inner`]:{paddingInlineStart:Wt,paddingInlineEnd:ze,[`${bt}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${bt}-unchecked`]:{marginInlineStart:`calc(100% - ${xe+Kt*2}px + ${ze*2}px)`,marginInlineEnd:`calc(-100% + ${xe+Kt*2}px - ${ze*2}px)`}},[`${Ht}-handle`]:{insetInlineStart:`calc(100% - ${xe+Kt}px)`}},[`&:not(${Ht}-disabled):active`]:{[`&:not(${Ht}-checked) ${bt}`]:{[`${bt}-unchecked`]:{marginInlineStart:qe.marginXXS/2,marginInlineEnd:-qe.marginXXS/2}},[`&${Ht}-checked ${bt}`]:{[`${bt}-checked`]:{marginInlineStart:-qe.marginXXS/2,marginInlineEnd:qe.marginXXS/2}}}}}}},Ee=qe=>{const{componentCls:Ht,handleSize:cn}=qe;return{[Ht]:{[`${Ht}-loading-icon${qe.iconCls}`]:{position:"relative",top:(cn-qe.fontSize)/2,color:qe.switchLoadingIconColor,verticalAlign:"top"},[`&${Ht}-checked ${Ht}-loading-icon`]:{color:qe.switchColor}}}},Xe=qe=>{const{componentCls:Ht,motion:cn,trackPadding:Kt,handleBg:Xt,handleShadow:Wt,handleSize:ze}=qe,xe=`${Ht}-handle`;return{[Ht]:{[xe]:{position:"absolute",top:Kt,insetInlineStart:Kt,width:ze,height:ze,transition:`all ${qe.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:Xt,borderRadius:ze/2,boxShadow:Wt,transition:`all ${qe.switchDuration} ease-in-out`,content:'""'}},[`&${Ht}-checked ${xe}`]:{insetInlineStart:`calc(100% - ${ze+Kt}px)`},[`&:not(${Ht}-disabled):active`]:cn?{[`${xe}::before`]:{insetInlineEnd:qe.switchHandleActiveInset,insetInlineStart:0},[`&${Ht}-checked ${xe}::before`]:{insetInlineEnd:0,insetInlineStart:qe.switchHandleActiveInset}}:{}}}},at=qe=>{const{componentCls:Ht,trackHeight:cn,trackPadding:Kt,innerMinMargin:Xt,innerMaxMargin:Wt,handleSize:ze}=qe,xe=`${Ht}-inner`;return{[Ht]:{[xe]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:Wt,paddingInlineEnd:Xt,transition:`padding-inline-start ${qe.switchDuration} ease-in-out, padding-inline-end ${qe.switchDuration} ease-in-out`,[`${xe}-checked, ${xe}-unchecked`]:{display:"block",color:qe.colorTextLightSolid,fontSize:qe.fontSizeSM,transition:`margin-inline-start ${qe.switchDuration} ease-in-out, margin-inline-end ${qe.switchDuration} ease-in-out`,pointerEvents:"none"},[`${xe}-checked`]:{marginInlineStart:`calc(-100% + ${ze+Kt*2}px - ${Wt*2}px)`,marginInlineEnd:`calc(100% - ${ze+Kt*2}px + ${Wt*2}px)`},[`${xe}-unchecked`]:{marginTop:-cn,marginInlineStart:0,marginInlineEnd:0}},[`&${Ht}-checked ${xe}`]:{paddingInlineStart:Xt,paddingInlineEnd:Wt,[`${xe}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${xe}-unchecked`]:{marginInlineStart:`calc(100% - ${ze+Kt*2}px + ${Wt*2}px)`,marginInlineEnd:`calc(-100% + ${ze+Kt*2}px - ${Wt*2}px)`}},[`&:not(${Ht}-disabled):active`]:{[`&:not(${Ht}-checked) ${xe}`]:{[`${xe}-unchecked`]:{marginInlineStart:Kt*2,marginInlineEnd:-Kt*2}},[`&${Ht}-checked ${xe}`]:{[`${xe}-checked`]:{marginInlineStart:-Kt*2,marginInlineEnd:Kt*2}}}}}},vt=qe=>{const{componentCls:Ht,trackHeight:cn,trackMinWidth:Kt}=qe;return{[Ht]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,tn.Wf)(qe)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:Kt,height:cn,lineHeight:`${cn}px`,verticalAlign:"middle",background:qe.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${qe.motionDurationMid}`,userSelect:"none",[`&:hover:not(${Ht}-disabled)`]:{background:qe.colorTextTertiary}}),(0,tn.Qy)(qe)),{[`&${Ht}-checked`]:{background:qe.switchColor,[`&:hover:not(${Ht}-disabled)`]:{background:qe.colorPrimaryHover}},[`&${Ht}-loading, &${Ht}-disabled`]:{cursor:"not-allowed",opacity:qe.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${Ht}-rtl`]:{direction:"rtl"}})}};var Ue=(0,nt.Z)("Switch",qe=>{const Ht=(0,ht.TS)(qe,{switchDuration:qe.motionDurationMid,switchColor:qe.colorPrimary,switchDisabledOpacity:qe.opacityLoading,switchLoadingIconSize:qe.fontSizeIcon*.75,switchLoadingIconColor:`rgba(0, 0, 0, ${qe.opacityLoading})`,switchHandleActiveInset:"-30%"});return[vt(Ht),at(Ht),Xe(Ht),Ee(Ht),Ve(Ht)]},qe=>{const{fontSize:Ht,lineHeight:cn,controlHeight:Kt,colorWhite:Xt}=qe,Wt=Ht*cn,ze=Kt/2,xe=2,bt=Wt-xe*2,pn=ze-xe*2;return{trackHeight:Wt,trackHeightSM:ze,trackMinWidth:bt*2+xe*4,trackMinWidthSM:pn*2+xe*2,trackPadding:xe,handleBg:Xt,handleSize:bt,handleSizeSM:pn,handleShadow:`0 2px 4px 0 ${new Rt.C("#00230b").setAlpha(.2).toRgbString()}`,innerMinMargin:bt/2,innerMaxMargin:bt+xe+xe*2,innerMinMarginSM:pn/2,innerMaxMarginSM:pn+xe+xe*2}}),Ot=function(qe,Ht){var cn={};for(var Kt in qe)Object.prototype.hasOwnProperty.call(qe,Kt)&&Ht.indexOf(Kt)<0&&(cn[Kt]=qe[Kt]);if(qe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Xt=0,Kt=Object.getOwnPropertySymbols(qe);Xt<Kt.length;Xt++)Ht.indexOf(Kt[Xt])<0&&Object.prototype.propertyIsEnumerable.call(qe,Kt[Xt])&&(cn[Kt[Xt]]=qe[Kt[Xt]]);return cn};const rt=Ce.forwardRef((qe,Ht)=>{const{prefixCls:cn,size:Kt,disabled:Xt,loading:Wt,className:ze,rootClassName:xe,style:bt}=qe,pn=Ot(qe,["prefixCls","size","disabled","loading","className","rootClassName","style"]),{getPrefixCls:Ut,direction:Ge,switch:Ye}=Ce.useContext(et.E_),It=Ce.useContext(mt.Z),Mn=(Xt!=null?Xt:It)||Wt,jt=Ut("switch",cn),bn=Ce.createElement("div",{className:`${jt}-handle`},Wt&&Ce.createElement(pe.Z,{className:`${jt}-loading-icon`})),[Vt,Zt]=Ue(jt),zt=(0,st.Z)(Kt),ve=$e()(Ye==null?void 0:Ye.className,{[`${jt}-small`]:zt==="small",[`${jt}-loading`]:Wt,[`${jt}-rtl`]:Ge==="rtl"},ze,xe,Zt),se=Object.assign(Object.assign({},Ye==null?void 0:Ye.style),bt);return Vt(Ce.createElement(kt.Z,{component:"Switch"},Ce.createElement(je,Object.assign({},pn,{prefixCls:jt,className:ve,style:se,disabled:Mn,ref:Ht,loadingIcon:bn}))))});rt.__ANT_SWITCH=!0;var At=rt},99313:function(kn,dn,de){"use strict";de.d(dn,{default:function(){return Qe}});var pe=de(99267),ut=de(18785),$e=de(62772),ct=de(92310),Se=de.n(ct),Pe=de(60499),Ne=de(18642),Ce=de(85899),ke=de(72190),Fe=de(43749),gt=de(42244),Oe=de(59301),je=de(49658),kt=de(18929),et=de(77900),mt=(0,Oe.createContext)(null),st=Oe.forwardRef(function(Me,Ae){var Le=Me.prefixCls,De=Me.className,We=Me.style,it=Me.id,Nt=Me.active,Lt=Me.tabKey,$t=Me.children;return Oe.createElement("div",{id:it&&"".concat(it,"-panel-").concat(Lt),role:"tabpanel",tabIndex:Nt?0:-1,"aria-labelledby":it&&"".concat(it,"-tab-").concat(Lt),"aria-hidden":!Nt,style:We,className:Se()(Le,Nt&&"".concat(Le,"-active"),De),ref:Ae},$t)}),Rt=st,tn=["key","forceRender","style","className"];function nt(Me){var Ae=Me.id,Le=Me.activeKey,De=Me.animated,We=Me.tabPosition,it=Me.destroyInactiveTabPane,Nt=Oe.useContext(mt),Lt=Nt.prefixCls,$t=Nt.tabs,sn=De.tabPane,hn="".concat(Lt,"-tabpane");return Oe.createElement("div",{className:Se()("".concat(Lt,"-content-holder"))},Oe.createElement("div",{className:Se()("".concat(Lt,"-content"),"".concat(Lt,"-content-").concat(We),(0,Ne.Z)({},"".concat(Lt,"-content-animated"),sn))},$t.map(function(xn){var Mt=xn.key,rn=xn.forceRender,Je=xn.style,pt=xn.className,Ct=(0,gt.Z)(xn,tn),Et=Mt===Le;return Oe.createElement(et.default,(0,Pe.Z)({key:Mt,visible:Et,forceRender:rn,removeOnLeave:!!it,leavedClassName:"".concat(hn,"-hidden")},De.tabPaneMotion),function(Yt,St){var Gt=Yt.style,Te=Yt.className;return Oe.createElement(Rt,(0,Pe.Z)({},Ct,{prefixCls:hn,id:Ae,tabKey:Mt,animated:sn,active:Et,style:(0,Ce.Z)((0,Ce.Z)({},Je),Gt),className:Se()(pt,Te),ref:St}))})})))}var ht=de(77654),Ve=de(29301),Ee=de(6089),Xe=de(8654),at={width:0,height:0,left:0,top:0};function vt(Me,Ae,Le){return(0,Oe.useMemo)(function(){for(var De,We=new Map,it=Ae.get((De=Me[0])===null||De===void 0?void 0:De.key)||at,Nt=it.left+it.width,Lt=0;Lt<Me.length;Lt+=1){var $t=Me[Lt].key,sn=Ae.get($t);if(!sn){var hn;sn=Ae.get((hn=Me[Lt-1])===null||hn===void 0?void 0:hn.key)||at}var xn=We.get($t)||(0,Ce.Z)({},sn);xn.right=Nt-xn.left-xn.width,We.set($t,xn)}return We},[Me.map(function(De){return De.key}).join("_"),Ae,Le])}function Ue(Me,Ae){var Le=Oe.useRef(Me),De=Oe.useState({}),We=(0,ke.Z)(De,2),it=We[1];function Nt(Lt){var $t=typeof Lt=="function"?Lt(Le.current):Lt;$t!==Le.current&&Ae($t,Le.current),Le.current=$t,it({})}return[Le.current,Nt]}var Ot=.1,rt=.01,At=20,qe=Math.pow(.995,At);function Ht(Me,Ae){var Le=(0,Oe.useState)(),De=(0,ke.Z)(Le,2),We=De[0],it=De[1],Nt=(0,Oe.useState)(0),Lt=(0,ke.Z)(Nt,2),$t=Lt[0],sn=Lt[1],hn=(0,Oe.useState)(0),xn=(0,ke.Z)(hn,2),Mt=xn[0],rn=xn[1],Je=(0,Oe.useState)(),pt=(0,ke.Z)(Je,2),Ct=pt[0],Et=pt[1],Yt=(0,Oe.useRef)();function St(_t){var Pt=_t.touches[0],Bt=Pt.screenX,un=Pt.screenY;it({x:Bt,y:un}),window.clearInterval(Yt.current)}function Gt(_t){if(We){_t.preventDefault();var Pt=_t.touches[0],Bt=Pt.screenX,un=Pt.screenY;it({x:Bt,y:un});var yn=Bt-We.x,_n=un-We.y;Ae(yn,_n);var $n=Date.now();sn($n),rn($n-$t),Et({x:yn,y:_n})}}function Te(){if(We&&(it(null),Et(null),Ct)){var _t=Ct.x/Mt,Pt=Ct.y/Mt,Bt=Math.abs(_t),un=Math.abs(Pt);if(Math.max(Bt,un)<Ot)return;var yn=_t,_n=Pt;Yt.current=window.setInterval(function(){if(Math.abs(yn)<rt&&Math.abs(_n)<rt){window.clearInterval(Yt.current);return}yn*=qe,_n*=qe,Ae(yn*At,_n*At)},At)}}var dt=(0,Oe.useRef)();function ft(_t){var Pt=_t.deltaX,Bt=_t.deltaY,un=0,yn=Math.abs(Pt),_n=Math.abs(Bt);yn===_n?un=dt.current==="x"?Pt:Bt:yn>_n?(un=Pt,dt.current="x"):(un=Bt,dt.current="y"),Ae(-un,-un)&&_t.preventDefault()}var Tt=(0,Oe.useRef)(null);Tt.current={onTouchStart:St,onTouchMove:Gt,onTouchEnd:Te,onWheel:ft},Oe.useEffect(function(){function _t(yn){Tt.current.onTouchStart(yn)}function Pt(yn){Tt.current.onTouchMove(yn)}function Bt(yn){Tt.current.onTouchEnd(yn)}function un(yn){Tt.current.onWheel(yn)}return document.addEventListener("touchmove",Pt,{passive:!1}),document.addEventListener("touchend",Bt,{passive:!1}),Me.current.addEventListener("touchstart",_t,{passive:!1}),Me.current.addEventListener("wheel",un),function(){document.removeEventListener("touchmove",Pt),document.removeEventListener("touchend",Bt)}},[])}var cn=de(34280);function Kt(Me){var Ae=(0,Oe.useState)(0),Le=(0,ke.Z)(Ae,2),De=Le[0],We=Le[1],it=(0,Oe.useRef)(0),Nt=(0,Oe.useRef)();return Nt.current=Me,(0,cn.o)(function(){var Lt;(Lt=Nt.current)===null||Lt===void 0||Lt.call(Nt)},[De]),function(){it.current===De&&(it.current+=1,We(it.current))}}function Xt(Me){var Ae=(0,Oe.useRef)([]),Le=(0,Oe.useState)({}),De=(0,ke.Z)(Le,2),We=De[1],it=(0,Oe.useRef)(typeof Me=="function"?Me():Me),Nt=Kt(function(){var $t=it.current;Ae.current.forEach(function(sn){$t=sn($t)}),Ae.current=[],it.current=$t,We({})});function Lt($t){Ae.current.push($t),Nt()}return[it.current,Lt]}var Wt={width:0,height:0,left:0,top:0,right:0};function ze(Me,Ae,Le,De,We,it,Nt){var Lt=Nt.tabs,$t=Nt.tabPosition,sn=Nt.rtl,hn,xn,Mt;return["top","bottom"].includes($t)?(hn="width",xn=sn?"right":"left",Mt=Math.abs(Le)):(hn="height",xn="top",Mt=-Le),(0,Oe.useMemo)(function(){if(!Lt.length)return[0,0];for(var rn=Lt.length,Je=rn,pt=0;pt<rn;pt+=1){var Ct=Me.get(Lt[pt].key)||Wt;if(Ct[xn]+Ct[hn]>Mt+Ae){Je=pt-1;break}}for(var Et=0,Yt=rn-1;Yt>=0;Yt-=1){var St=Me.get(Lt[Yt].key)||Wt;if(St[xn]<Mt){Et=Yt+1;break}}return Et>=Je?[0,0]:[Et,Je]},[Me,Ae,De,We,it,Mt,$t,Lt.map(function(rn){return rn.key}).join("_"),sn])}function xe(Me){var Ae;return Me instanceof Map?(Ae={},Me.forEach(function(Le,De){Ae[De]=Le})):Ae=Me,JSON.stringify(Ae)}var bt="TABS_DQ";function pn(Me){return String(Me).replace(/"/g,bt)}function Ut(Me,Ae,Le,De){return!(!Le||De||Me===!1||Me===void 0&&(Ae===!1||Ae===null))}function Ge(Me,Ae){var Le=Me.prefixCls,De=Me.editable,We=Me.locale,it=Me.style;return!De||De.showAdd===!1?null:Oe.createElement("button",{ref:Ae,type:"button",className:"".concat(Le,"-nav-add"),style:it,"aria-label":(We==null?void 0:We.addAriaLabel)||"Add tab",onClick:function(Lt){De.onEdit("add",{event:Lt})}},De.addIcon||"+")}var Ye=Oe.forwardRef(Ge),It=Oe.forwardRef(function(Me,Ae){var Le=Me.position,De=Me.prefixCls,We=Me.extra;if(!We)return null;var it,Nt={};return(0,Fe.Z)(We)==="object"&&!Oe.isValidElement(We)?Nt=We:Nt.right=We,Le==="right"&&(it=Nt.right),Le==="left"&&(it=Nt.left),it?Oe.createElement("div",{className:"".concat(De,"-extra-content"),ref:Ae},it):null}),Mn=It,jt=de(31561),bn=de(15285),Vt=de(10228);function Zt(Me,Ae){var Le=Me.prefixCls,De=Me.id,We=Me.tabs,it=Me.locale,Nt=Me.mobile,Lt=Me.moreIcon,$t=Lt===void 0?"More":Lt,sn=Me.moreTransitionName,hn=Me.style,xn=Me.className,Mt=Me.editable,rn=Me.tabBarGutter,Je=Me.rtl,pt=Me.removeAriaLabel,Ct=Me.onTabClick,Et=Me.getPopupContainer,Yt=Me.popupClassName,St=(0,Oe.useState)(!1),Gt=(0,ke.Z)(St,2),Te=Gt[0],dt=Gt[1],ft=(0,Oe.useState)(null),Tt=(0,ke.Z)(ft,2),_t=Tt[0],Pt=Tt[1],Bt="".concat(De,"-more-popup"),un="".concat(Le,"-dropdown"),yn=_t!==null?"".concat(Bt,"-").concat(_t):null,_n=it==null?void 0:it.dropdownAriaLabel;function $n(mr,Vn){mr.preventDefault(),mr.stopPropagation(),Mt.onEdit("remove",{key:Vn,event:mr})}var qn=Oe.createElement(bn.ZP,{onClick:function(Vn){var Un=Vn.key,br=Vn.domEvent;Ct(Un,br),dt(!1)},prefixCls:"".concat(un,"-menu"),id:Bt,tabIndex:-1,role:"listbox","aria-activedescendant":yn,selectedKeys:[_t],"aria-label":_n!==void 0?_n:"expanded dropdown"},We.map(function(mr){var Vn=mr.closable,Un=mr.disabled,br=mr.closeIcon,lr=mr.key,Ir=mr.label,Ur=Ut(Vn,br,Mt,Un);return Oe.createElement(bn.sN,{key:lr,id:"".concat(Bt,"-").concat(lr),role:"option","aria-controls":De&&"".concat(De,"-panel-").concat(lr),disabled:Un},Oe.createElement("span",null,Ir),Ur&&Oe.createElement("button",{type:"button","aria-label":pt||"remove",tabIndex:0,className:"".concat(un,"-menu-item-remove"),onClick:function(Cn){Cn.stopPropagation(),$n(Cn,lr)}},br||Mt.removeIcon||"\xD7"))}));function sr(mr){for(var Vn=We.filter(function(Ur){return!Ur.disabled}),Un=Vn.findIndex(function(Ur){return Ur.key===_t})||0,br=Vn.length,lr=0;lr<br;lr+=1){Un=(Un+mr+br)%br;var Ir=Vn[Un];if(!Ir.disabled){Pt(Ir.key);return}}}function jn(mr){var Vn=mr.which;if(!Te){[Vt.Z.DOWN,Vt.Z.SPACE,Vt.Z.ENTER].includes(Vn)&&(dt(!0),mr.preventDefault());return}switch(Vn){case Vt.Z.UP:sr(-1),mr.preventDefault();break;case Vt.Z.DOWN:sr(1),mr.preventDefault();break;case Vt.Z.ESC:dt(!1);break;case Vt.Z.SPACE:case Vt.Z.ENTER:_t!==null&&Ct(_t,mr);break}}(0,Oe.useEffect)(function(){var mr=document.getElementById(yn);mr&&mr.scrollIntoView&&mr.scrollIntoView(!1)},[_t]),(0,Oe.useEffect)(function(){Te||Pt(null)},[Te]);var Ln=(0,Ne.Z)({},Je?"marginRight":"marginLeft",rn);We.length||(Ln.visibility="hidden",Ln.order=1);var ur=Se()((0,Ne.Z)({},"".concat(un,"-rtl"),Je)),Qn=Nt?null:Oe.createElement(jt.Z,{prefixCls:un,overlay:qn,trigger:["hover"],visible:We.length?Te:!1,transitionName:sn,onVisibleChange:dt,overlayClassName:Se()(ur,Yt),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:Et},Oe.createElement("button",{type:"button",className:"".concat(Le,"-nav-more"),style:Ln,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":Bt,id:"".concat(De,"-more"),"aria-expanded":Te,onKeyDown:jn},$t));return Oe.createElement("div",{className:Se()("".concat(Le,"-nav-operations"),xn),style:hn,ref:Ae},Qn,Oe.createElement(Ye,{prefixCls:Le,locale:it,editable:Mt}))}var zt=Oe.memo(Oe.forwardRef(Zt),function(Me,Ae){return Ae.tabMoving});function ve(Me){var Ae,Le=Me.prefixCls,De=Me.id,We=Me.active,it=Me.tab,Nt=it.key,Lt=it.label,$t=it.disabled,sn=it.closeIcon,hn=Me.closable,xn=Me.renderWrapper,Mt=Me.removeAriaLabel,rn=Me.editable,Je=Me.onClick,pt=Me.onFocus,Ct=Me.style,Et="".concat(Le,"-tab"),Yt=Ut(hn,sn,rn,$t);function St(dt){$t||Je(dt)}function Gt(dt){dt.preventDefault(),dt.stopPropagation(),rn.onEdit("remove",{key:Nt,event:dt})}var Te=Oe.createElement("div",{key:Nt,"data-node-key":pn(Nt),className:Se()(Et,(Ae={},(0,Ne.Z)(Ae,"".concat(Et,"-with-remove"),Yt),(0,Ne.Z)(Ae,"".concat(Et,"-active"),We),(0,Ne.Z)(Ae,"".concat(Et,"-disabled"),$t),Ae)),style:Ct,onClick:St},Oe.createElement("div",{role:"tab","aria-selected":We,id:De&&"".concat(De,"-tab-").concat(Nt),className:"".concat(Et,"-btn"),"aria-controls":De&&"".concat(De,"-panel-").concat(Nt),"aria-disabled":$t,tabIndex:$t?null:0,onClick:function(ft){ft.stopPropagation(),St(ft)},onKeyDown:function(ft){[Vt.Z.SPACE,Vt.Z.ENTER].includes(ft.which)&&(ft.preventDefault(),St(ft))},onFocus:pt},Lt),Yt&&Oe.createElement("button",{type:"button","aria-label":Mt||"remove",tabIndex:0,className:"".concat(Et,"-remove"),onClick:function(ft){ft.stopPropagation(),Gt(ft)}},sn||rn.removeIcon||"\xD7"));return xn?xn(Te):Te}var se=ve,oe=de(16089),fe=function(Ae){var Le=Ae.activeTabOffset,De=Ae.horizontal,We=Ae.rtl,it=Ae.indicatorSize,Nt=(0,Oe.useState)(),Lt=(0,ke.Z)(Nt,2),$t=Lt[0],sn=Lt[1],hn=(0,Oe.useRef)(),xn=function(Je){return typeof it=="function"?it(Je):typeof it=="number"?it:Je};function Mt(){oe.Z.cancel(hn.current)}return(0,Oe.useEffect)(function(){var rn={};return Le&&(De?(We?(rn.right=Le.right+Le.width/2,rn.transform="translateX(50%)"):(rn.left=Le.left+Le.width/2,rn.transform="translateX(-50%)"),rn.width=xn(Le.width)):(rn.top=Le.top+Le.height/2,rn.transform="translateY(-50%)",rn.height=xn(Le.height))),Mt(),hn.current=(0,oe.Z)(function(){sn(rn)}),Mt},[Le,De,We,it]),{style:$t}},ye=fe,ce=function(Ae){var Le=Ae.current||{},De=Le.offsetWidth,We=De===void 0?0:De,it=Le.offsetHeight,Nt=it===void 0?0:it;return[We,Nt]},Ke=function(Ae,Le){return Ae[Le?0:1]};function Dt(Me,Ae){var Le,De=Oe.useContext(mt),We=De.prefixCls,it=De.tabs,Nt=Me.className,Lt=Me.style,$t=Me.id,sn=Me.animated,hn=Me.activeKey,xn=Me.rtl,Mt=Me.extra,rn=Me.editable,Je=Me.locale,pt=Me.tabPosition,Ct=Me.tabBarGutter,Et=Me.children,Yt=Me.onTabClick,St=Me.onTabScroll,Gt=Me.indicatorSize,Te=(0,Oe.useRef)(),dt=(0,Oe.useRef)(),ft=(0,Oe.useRef)(),Tt=(0,Oe.useRef)(),_t=(0,Oe.useRef)(),Pt=(0,Oe.useRef)(),Bt=(0,Oe.useRef)(),un=pt==="top"||pt==="bottom",yn=Ue(0,function(wi,vi){un&&St&&St({direction:wi>vi?"left":"right"})}),_n=(0,ke.Z)(yn,2),$n=_n[0],qn=_n[1],sr=Ue(0,function(wi,vi){!un&&St&&St({direction:wi>vi?"top":"bottom"})}),jn=(0,ke.Z)(sr,2),Ln=jn[0],ur=jn[1],Qn=(0,Oe.useState)([0,0]),mr=(0,ke.Z)(Qn,2),Vn=mr[0],Un=mr[1],br=(0,Oe.useState)([0,0]),lr=(0,ke.Z)(br,2),Ir=lr[0],Ur=lr[1],rr=(0,Oe.useState)([0,0]),Cn=(0,ke.Z)(rr,2),Sn=Cn[0],fr=Cn[1],er=(0,Oe.useState)([0,0]),Mr=(0,ke.Z)(er,2),_r=Mr[0],Ar=Mr[1],dr=Xt(new Map),Sr=(0,ke.Z)(dr,2),ii=Sr[0],zn=Sr[1],Xn=vt(it,ii,Ir[0]),kr=Ke(Vn,un),Br=Ke(Ir,un),li=Ke(Sn,un),di=Ke(_r,un),ri=kr<Br+li,Yr=ri?kr-di:kr-li,yi="".concat(We,"-nav-operations-hidden"),bi=0,Gn=0;un&&xn?(bi=0,Gn=Math.max(0,Br-Yr)):(bi=Math.min(0,Yr-Br),Gn=0);function Wn(wi){return wi<bi?bi:wi>Gn?Gn:wi}var Hn=(0,Oe.useRef)(),hr=(0,Oe.useState)(),ni=(0,ke.Z)(hr,2),xi=ni[0],Mi=ni[1];function gi(){Mi(Date.now())}function ci(){window.clearTimeout(Hn.current)}Ht(Tt,function(wi,vi){function Gi(ca,sa){ca(function(ta){var ts=Wn(ta+sa);return ts})}return ri?(un?Gi(qn,wi):Gi(ur,vi),ci(),gi(),!0):!1}),(0,Oe.useEffect)(function(){return ci(),xi&&(Hn.current=window.setTimeout(function(){Mi(0)},100)),ci},[xi]);var ki=ze(Xn,Yr,un?$n:Ln,Br,li,di,(0,Ce.Z)((0,Ce.Z)({},Me),{},{tabs:it})),Hi=(0,ke.Z)(ki,2),$i=Hi[0],oa=Hi[1],Gr=(0,Ee.Z)(function(){var wi=arguments.length>0&&arguments[0]!==void 0?arguments[0]:hn,vi=Xn.get(wi)||{width:0,height:0,left:0,right:0,top:0};if(un){var Gi=$n;xn?vi.right<$n?Gi=vi.right:vi.right+vi.width>$n+Yr&&(Gi=vi.right+vi.width-Yr):vi.left<-$n?Gi=-vi.left:vi.left+vi.width>-$n+Yr&&(Gi=-(vi.left+vi.width-Yr)),ur(0),qn(Wn(Gi))}else{var ca=Ln;vi.top<-Ln?ca=-vi.top:vi.top+vi.height>-Ln+Yr&&(ca=-(vi.top+vi.height-Yr)),qn(0),ur(Wn(ca))}}),ei={};pt==="top"||pt==="bottom"?ei[xn?"marginRight":"marginLeft"]=Ct:ei.marginTop=Ct;var Ai=it.map(function(wi,vi){var Gi=wi.key;return Oe.createElement(se,{id:$t,prefixCls:We,key:Gi,tab:wi,style:vi===0?void 0:ei,closable:wi.closable,editable:rn,active:Gi===hn,renderWrapper:Et,removeAriaLabel:Je==null?void 0:Je.removeAriaLabel,onClick:function(sa){Yt(Gi,sa)},onFocus:function(){Gr(Gi),gi(),Tt.current&&(xn||(Tt.current.scrollLeft=0),Tt.current.scrollTop=0)}})}),ai=function(){return zn(function(){var vi=new Map;return it.forEach(function(Gi){var ca,sa=Gi.key,ta=(ca=_t.current)===null||ca===void 0?void 0:ca.querySelector('[data-node-key="'.concat(pn(sa),'"]'));ta&&vi.set(sa,{width:ta.offsetWidth,height:ta.offsetHeight,left:ta.offsetLeft,top:ta.offsetTop})}),vi})};(0,Oe.useEffect)(function(){ai()},[it.map(function(wi){return wi.key}).join("_")]);var fi=Kt(function(){var wi=ce(Te),vi=ce(dt),Gi=ce(ft);Un([wi[0]-vi[0]-Gi[0],wi[1]-vi[1]-Gi[1]]);var ca=ce(Bt);fr(ca);var sa=ce(Pt);Ar(sa);var ta=ce(_t);Ur([ta[0]-ca[0],ta[1]-ca[1]]),ai()}),_i=it.slice(0,$i),pi=it.slice(oa+1),Tr=[].concat((0,ht.Z)(_i),(0,ht.Z)(pi)),Xr=Xn.get(hn),Vr=ye({activeTabOffset:Xr,horizontal:un,rtl:xn,indicatorSize:Gt}),$r=Vr.style;(0,Oe.useEffect)(function(){Gr()},[hn,bi,Gn,xe(Xr),xe(Xn),un]),(0,Oe.useEffect)(function(){fi()},[xn]);var ui=!!Tr.length,oi="".concat(We,"-nav-wrap"),zi,Wi,Zi,na;return un?xn?(Wi=$n>0,zi=$n!==Gn):(zi=$n<0,Wi=$n!==bi):(Zi=Ln<0,na=Ln!==bi),Oe.createElement(Ve.Z,{onResize:fi},Oe.createElement("div",{ref:(0,Xe.x1)(Ae,Te),role:"tablist",className:Se()("".concat(We,"-nav"),Nt),style:Lt,onKeyDown:function(){gi()}},Oe.createElement(Mn,{ref:dt,position:"left",extra:Mt,prefixCls:We}),Oe.createElement(Ve.Z,{onResize:fi},Oe.createElement("div",{className:Se()(oi,(Le={},(0,Ne.Z)(Le,"".concat(oi,"-ping-left"),zi),(0,Ne.Z)(Le,"".concat(oi,"-ping-right"),Wi),(0,Ne.Z)(Le,"".concat(oi,"-ping-top"),Zi),(0,Ne.Z)(Le,"".concat(oi,"-ping-bottom"),na),Le)),ref:Tt},Oe.createElement(Ve.Z,{onResize:fi},Oe.createElement("div",{ref:_t,className:"".concat(We,"-nav-list"),style:{transform:"translate(".concat($n,"px, ").concat(Ln,"px)"),transition:xi?"none":void 0}},Ai,Oe.createElement(Ye,{ref:Bt,prefixCls:We,locale:Je,editable:rn,style:(0,Ce.Z)((0,Ce.Z)({},Ai.length===0?void 0:ei),{},{visibility:ui?"hidden":null})}),Oe.createElement("div",{className:Se()("".concat(We,"-ink-bar"),(0,Ne.Z)({},"".concat(We,"-ink-bar-animated"),sn.inkBar)),style:$r}))))),Oe.createElement(zt,(0,Pe.Z)({},Me,{removeAriaLabel:Je==null?void 0:Je.removeAriaLabel,ref:Pt,prefixCls:We,tabs:Tr,className:!ui&&yi,tabMoving:!!xi})),Oe.createElement(Mn,{ref:ft,position:"right",extra:Mt,prefixCls:We})))}var ln=Oe.forwardRef(Dt),Jt=["renderTabBar"],en=["label","key"];function nn(Me){var Ae=Me.renderTabBar,Le=(0,gt.Z)(Me,Jt),De=Oe.useContext(mt),We=De.tabs;if(Ae){var it=(0,Ce.Z)((0,Ce.Z)({},Le),{},{panes:We.map(function(Nt){var Lt=Nt.label,$t=Nt.key,sn=(0,gt.Z)(Nt,en);return Oe.createElement(Rt,(0,Pe.Z)({tab:Lt,key:$t,tabKey:$t},sn))})});return Ae(it,ln)}return Oe.createElement(ln,Le)}var wn=de(48736);function mn(){var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},Ae;return Me===!1?Ae={inkBar:!1,tabPane:!1}:Me===!0?Ae={inkBar:!0,tabPane:!1}:Ae=(0,Ce.Z)({inkBar:!0},(0,Fe.Z)(Me)==="object"?Me:{}),Ae.tabPaneMotion&&Ae.tabPane===void 0&&(Ae.tabPane=!0),!Ae.tabPaneMotion&&Ae.tabPane&&(Ae.tabPane=!1),Ae}var En=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicatorSize"],yt=0;function gn(Me,Ae){var Le,De=Me.id,We=Me.prefixCls,it=We===void 0?"rc-tabs":We,Nt=Me.className,Lt=Me.items,$t=Me.direction,sn=Me.activeKey,hn=Me.defaultActiveKey,xn=Me.editable,Mt=Me.animated,rn=Me.tabPosition,Je=rn===void 0?"top":rn,pt=Me.tabBarGutter,Ct=Me.tabBarStyle,Et=Me.tabBarExtraContent,Yt=Me.locale,St=Me.moreIcon,Gt=Me.moreTransitionName,Te=Me.destroyInactiveTabPane,dt=Me.renderTabBar,ft=Me.onChange,Tt=Me.onTabClick,_t=Me.onTabScroll,Pt=Me.getPopupContainer,Bt=Me.popupClassName,un=Me.indicatorSize,yn=(0,gt.Z)(Me,En),_n=Oe.useMemo(function(){return(Lt||[]).filter(function(Ar){return Ar&&(0,Fe.Z)(Ar)==="object"&&"key"in Ar})},[Lt]),$n=$t==="rtl",qn=mn(Mt),sr=(0,Oe.useState)(!1),jn=(0,ke.Z)(sr,2),Ln=jn[0],ur=jn[1];(0,Oe.useEffect)(function(){ur((0,je.Z)())},[]);var Qn=(0,kt.Z)(function(){var Ar;return(Ar=_n[0])===null||Ar===void 0?void 0:Ar.key},{value:sn,defaultValue:hn}),mr=(0,ke.Z)(Qn,2),Vn=mr[0],Un=mr[1],br=(0,Oe.useState)(function(){return _n.findIndex(function(Ar){return Ar.key===Vn})}),lr=(0,ke.Z)(br,2),Ir=lr[0],Ur=lr[1];(0,Oe.useEffect)(function(){var Ar=_n.findIndex(function(Sr){return Sr.key===Vn});if(Ar===-1){var dr;Ar=Math.max(0,Math.min(Ir,_n.length-1)),Un((dr=_n[Ar])===null||dr===void 0?void 0:dr.key)}Ur(Ar)},[_n.map(function(Ar){return Ar.key}).join("_"),Vn,Ir]);var rr=(0,kt.Z)(null,{value:De}),Cn=(0,ke.Z)(rr,2),Sn=Cn[0],fr=Cn[1];(0,Oe.useEffect)(function(){De||(fr("rc-tabs-".concat(yt)),yt+=1)},[]);function er(Ar,dr){Tt==null||Tt(Ar,dr);var Sr=Ar!==Vn;Un(Ar),Sr&&(ft==null||ft(Ar))}var Mr={id:Sn,activeKey:Vn,animated:qn,tabPosition:Je,rtl:$n,mobile:Ln},_r=(0,Ce.Z)((0,Ce.Z)({},Mr),{},{editable:xn,locale:Yt,moreIcon:St,moreTransitionName:Gt,tabBarGutter:pt,onTabClick:er,onTabScroll:_t,extra:Et,style:Ct,panes:null,getPopupContainer:Pt,popupClassName:Bt,indicatorSize:un});return Oe.createElement(mt.Provider,{value:{tabs:_n,prefixCls:it}},Oe.createElement("div",(0,Pe.Z)({ref:Ae,id:De,className:Se()(it,"".concat(it,"-").concat(Je),(Le={},(0,Ne.Z)(Le,"".concat(it,"-mobile"),Ln),(0,Ne.Z)(Le,"".concat(it,"-editable"),xn),(0,Ne.Z)(Le,"".concat(it,"-rtl"),$n),Le),Nt)},yn),Oe.createElement(nn,(0,Pe.Z)({},_r,{renderTabBar:dt})),Oe.createElement(nt,(0,Pe.Z)({destroyInactiveTabPane:Te},Mr,{animated:qn}))))}var Jn=Oe.forwardRef(gn),tt=Jn,Re=tt,Ze=de(36355),Ft=de(19716),an=()=>null,Pn=de(62892);const On={motionAppear:!1,motionEnter:!0,motionLeave:!0};function Nn(Me){let Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},Le;return Ae===!1?Le={inkBar:!1,tabPane:!1}:Ae===!0?Le={inkBar:!0,tabPane:!0}:Le=Object.assign({inkBar:!0},typeof Ae=="object"?Ae:{}),Le.tabPane&&(Le.tabPaneMotion=Object.assign(Object.assign({},On),{motionName:(0,Pn.m)(Me,"switch")})),Le}var Zn=de(11592),tr=function(Me,Ae){var Le={};for(var De in Me)Object.prototype.hasOwnProperty.call(Me,De)&&Ae.indexOf(De)<0&&(Le[De]=Me[De]);if(Me!=null&&typeof Object.getOwnPropertySymbols=="function")for(var We=0,De=Object.getOwnPropertySymbols(Me);We<De.length;We++)Ae.indexOf(De[We])<0&&Object.prototype.propertyIsEnumerable.call(Me,De[We])&&(Le[De[We]]=Me[De[We]]);return Le};function Tn(Me){return Me.filter(Ae=>Ae)}function gr(Me,Ae){if(Me)return Me;const Le=(0,Zn.Z)(Ae).map(De=>{if(Oe.isValidElement(De)){const{key:We,props:it}=De,Nt=it||{},{tab:Lt}=Nt,$t=tr(Nt,["tab"]);return Object.assign(Object.assign({key:String(We)},$t),{label:Lt})}return null});return Tn(Le)}var Pr=de(17313),Rr=de(83116),Zr=de(37613),vr=de(13826),yr=Me=>{const{componentCls:Ae,motionDurationSlow:Le}=Me;return[{[Ae]:{[`${Ae}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${Le}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${Le}`}}}}},[(0,vr.oN)(Me,"slide-up"),(0,vr.oN)(Me,"slide-down")]]};const Nr=Me=>{const{componentCls:Ae,tabsCardPadding:Le,cardBg:De,cardGutter:We,colorBorderSecondary:it,itemSelectedColor:Nt}=Me;return{[`${Ae}-card`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{[`${Ae}-tab`]:{margin:0,padding:Le,background:De,border:`${Me.lineWidth}px ${Me.lineType} ${it}`,transition:`all ${Me.motionDurationSlow} ${Me.motionEaseInOut}`},[`${Ae}-tab-active`]:{color:Nt,background:Me.colorBgContainer},[`${Ae}-ink-bar`]:{visibility:"hidden"}},[`&${Ae}-top, &${Ae}-bottom`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{[`${Ae}-tab + ${Ae}-tab`]:{marginLeft:{_skip_check_:!0,value:`${We}px`}}}},[`&${Ae}-top`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{[`${Ae}-tab`]:{borderRadius:`${Me.borderRadiusLG}px ${Me.borderRadiusLG}px 0 0`},[`${Ae}-tab-active`]:{borderBottomColor:Me.colorBgContainer}}},[`&${Ae}-bottom`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{[`${Ae}-tab`]:{borderRadius:`0 0 ${Me.borderRadiusLG}px ${Me.borderRadiusLG}px`},[`${Ae}-tab-active`]:{borderTopColor:Me.colorBgContainer}}},[`&${Ae}-left, &${Ae}-right`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{[`${Ae}-tab + ${Ae}-tab`]:{marginTop:`${We}px`}}},[`&${Ae}-left`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{[`${Ae}-tab`]:{borderRadius:{_skip_check_:!0,value:`${Me.borderRadiusLG}px 0 0 ${Me.borderRadiusLG}px`}},[`${Ae}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:Me.colorBgContainer}}}},[`&${Ae}-right`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{[`${Ae}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${Me.borderRadiusLG}px ${Me.borderRadiusLG}px 0`}},[`${Ae}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:Me.colorBgContainer}}}}}}},Wr=Me=>{const{componentCls:Ae,itemHoverColor:Le,dropdownEdgeChildVerticalPadding:De}=Me;return{[`${Ae}-dropdown`]:Object.assign(Object.assign({},(0,Pr.Wf)(Me)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:Me.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${Ae}-dropdown-menu`]:{maxHeight:Me.tabsDropdownHeight,margin:0,padding:`${De}px 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:Me.colorBgContainer,backgroundClip:"padding-box",borderRadius:Me.borderRadiusLG,outline:"none",boxShadow:Me.boxShadowSecondary,"&-item":Object.assign(Object.assign({},Pr.vS),{display:"flex",alignItems:"center",minWidth:Me.tabsDropdownWidth,margin:0,padding:`${Me.paddingXXS}px ${Me.paddingSM}px`,color:Me.colorText,fontWeight:"normal",fontSize:Me.fontSize,lineHeight:Me.lineHeight,cursor:"pointer",transition:`all ${Me.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:Me.marginSM},color:Me.colorTextDescription,fontSize:Me.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:Le}},"&:hover":{background:Me.controlItemBgHover},"&-disabled":{"&, &:hover":{color:Me.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},Er=Me=>{const{componentCls:Ae,margin:Le,colorBorderSecondary:De,horizontalMargin:We,verticalItemPadding:it,verticalItemMargin:Nt}=Me;return{[`${Ae}-top, ${Ae}-bottom`]:{flexDirection:"column",[`> ${Ae}-nav, > div > ${Ae}-nav`]:{margin:We,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${Me.lineWidth}px ${Me.lineType} ${De}`,content:"''"},[`${Ae}-ink-bar`]:{height:Me.lineWidthBold,"&-animated":{transition:`width ${Me.motionDurationSlow}, left ${Me.motionDurationSlow},
right ${Me.motionDurationSlow}`}},[`${Ae}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:Me.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:Me.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:Me.boxShadowTabsOverflowRight},[`&${Ae}-nav-wrap-ping-left::before`]:{opacity:1},[`&${Ae}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${Ae}-top`]:{[`> ${Ae}-nav,
> div > ${Ae}-nav`]:{"&::before":{bottom:0},[`${Ae}-ink-bar`]:{bottom:0}}},[`${Ae}-bottom`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{order:1,marginTop:`${Le}px`,marginBottom:0,"&::before":{top:0},[`${Ae}-ink-bar`]:{top:0}},[`> ${Ae}-content-holder, > div > ${Ae}-content-holder`]:{order:0}},[`${Ae}-left, ${Ae}-right`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{flexDirection:"column",minWidth:Me.controlHeight*1.25,[`${Ae}-tab`]:{padding:it,textAlign:"center"},[`${Ae}-tab + ${Ae}-tab`]:{margin:Nt},[`${Ae}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:Me.controlHeight},"&::before":{top:0,boxShadow:Me.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:Me.boxShadowTabsOverflowBottom},[`&${Ae}-nav-wrap-ping-top::before`]:{opacity:1},[`&${Ae}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${Ae}-ink-bar`]:{width:Me.lineWidthBold,"&-animated":{transition:`height ${Me.motionDurationSlow}, top ${Me.motionDurationSlow}`}},[`${Ae}-nav-list, ${Ae}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${Ae}-left`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{[`${Ae}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${Ae}-content-holder, > div > ${Ae}-content-holder`]:{marginLeft:{_skip_check_:!0,value:`-${Me.lineWidth}px`},borderLeft:{_skip_check_:!0,value:`${Me.lineWidth}px ${Me.lineType} ${Me.colorBorder}`},[`> ${Ae}-content > ${Ae}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:Me.paddingLG}}}},[`${Ae}-right`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{order:1,[`${Ae}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${Ae}-content-holder, > div > ${Ae}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:-Me.lineWidth},borderRight:{_skip_check_:!0,value:`${Me.lineWidth}px ${Me.lineType} ${Me.colorBorder}`},[`> ${Ae}-content > ${Ae}-tabpane`]:{paddingRight:{_skip_check_:!0,value:Me.paddingLG}}}}}},qr=Me=>{const{componentCls:Ae,cardPaddingSM:Le,cardPaddingLG:De,horizontalItemPaddingSM:We,horizontalItemPaddingLG:it}=Me;return{[Ae]:{"&-small":{[`> ${Ae}-nav`]:{[`${Ae}-tab`]:{padding:We,fontSize:Me.titleFontSizeSM}}},"&-large":{[`> ${Ae}-nav`]:{[`${Ae}-tab`]:{padding:it,fontSize:Me.titleFontSizeLG}}}},[`${Ae}-card`]:{[`&${Ae}-small`]:{[`> ${Ae}-nav`]:{[`${Ae}-tab`]:{padding:Le}},[`&${Ae}-bottom`]:{[`> ${Ae}-nav ${Ae}-tab`]:{borderRadius:`0 0 ${Me.borderRadius}px ${Me.borderRadius}px`}},[`&${Ae}-top`]:{[`> ${Ae}-nav ${Ae}-tab`]:{borderRadius:`${Me.borderRadius}px ${Me.borderRadius}px 0 0`}},[`&${Ae}-right`]:{[`> ${Ae}-nav ${Ae}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${Me.borderRadius}px ${Me.borderRadius}px 0`}}},[`&${Ae}-left`]:{[`> ${Ae}-nav ${Ae}-tab`]:{borderRadius:{_skip_check_:!0,value:`${Me.borderRadius}px 0 0 ${Me.borderRadius}px`}}}},[`&${Ae}-large`]:{[`> ${Ae}-nav`]:{[`${Ae}-tab`]:{padding:De}}}}}},zr=Me=>{const{componentCls:Ae,itemActiveColor:Le,itemHoverColor:De,iconCls:We,tabsHorizontalItemMargin:it,horizontalItemPadding:Nt,itemSelectedColor:Lt,itemColor:$t}=Me,sn=`${Ae}-tab`;return{[sn]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:Nt,fontSize:Me.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:$t,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:Le}},(0,Pr.Qy)(Me)),"&-btn":{outline:"none",transition:"all 0.3s"},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:-Me.marginXXS},marginLeft:{_skip_check_:!0,value:Me.marginXS},color:Me.colorTextDescription,fontSize:Me.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${Me.motionDurationSlow}`,"&:hover":{color:Me.colorTextHeading}},"&:hover":{color:De},[`&${sn}-active ${sn}-btn`]:{color:Lt,textShadow:Me.tabsActiveTextShadow},[`&${sn}-disabled`]:{color:Me.colorTextDisabled,cursor:"not-allowed"},[`&${sn}-disabled ${sn}-btn, &${sn}-disabled ${Ae}-remove`]:{"&:focus, &:active":{color:Me.colorTextDisabled}},[`& ${sn}-remove ${We}`]:{margin:0},[We]:{marginRight:{_skip_check_:!0,value:Me.marginSM}}},[`${sn} + ${sn}`]:{margin:{_skip_check_:!0,value:it}}}},ar=Me=>{const{componentCls:Ae,tabsHorizontalItemMarginRTL:Le,iconCls:De,cardGutter:We}=Me;return{[`${Ae}-rtl`]:{direction:"rtl",[`${Ae}-nav`]:{[`${Ae}-tab`]:{margin:{_skip_check_:!0,value:Le},[`${Ae}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[De]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:`${Me.marginSM}px`}},[`${Ae}-tab-remove`]:{marginRight:{_skip_check_:!0,value:`${Me.marginXS}px`},marginLeft:{_skip_check_:!0,value:`-${Me.marginXXS}px`},[De]:{margin:0}}}},[`&${Ae}-left`]:{[`> ${Ae}-nav`]:{order:1},[`> ${Ae}-content-holder`]:{order:0}},[`&${Ae}-right`]:{[`> ${Ae}-nav`]:{order:0},[`> ${Ae}-content-holder`]:{order:1}},[`&${Ae}-card${Ae}-top, &${Ae}-card${Ae}-bottom`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{[`${Ae}-tab + ${Ae}-tab`]:{marginRight:{_skip_check_:!0,value:We},marginLeft:{_skip_check_:!0,value:0}}}}},[`${Ae}-dropdown-rtl`]:{direction:"rtl"},[`${Ae}-menu-item`]:{[`${Ae}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},or=Me=>{const{componentCls:Ae,tabsCardPadding:Le,cardHeight:De,cardGutter:We,itemHoverColor:it,itemActiveColor:Nt,colorBorderSecondary:Lt}=Me;return{[Ae]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,Pr.Wf)(Me)),{display:"flex",[`> ${Ae}-nav, > div > ${Ae}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${Ae}-nav-wrap`]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:`opacity ${Me.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${Ae}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${Me.motionDurationSlow}`},[`${Ae}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${Ae}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${Ae}-nav-more`]:{position:"relative",padding:Le,background:"transparent",border:0,color:Me.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:Me.controlHeightLG/8,transform:"translateY(100%)",content:"''"}},[`${Ae}-nav-add`]:Object.assign({minWidth:De,marginLeft:{_skip_check_:!0,value:We},padding:`0 ${Me.paddingXS}px`,background:"transparent",border:`${Me.lineWidth}px ${Me.lineType} ${Lt}`,borderRadius:`${Me.borderRadiusLG}px ${Me.borderRadiusLG}px 0 0`,outline:"none",cursor:"pointer",color:Me.colorText,transition:`all ${Me.motionDurationSlow} ${Me.motionEaseInOut}`,"&:hover":{color:it},"&:active, &:focus:not(:focus-visible)":{color:Nt}},(0,Pr.Qy)(Me))},[`${Ae}-extra-content`]:{flex:"none"},[`${Ae}-ink-bar`]:{position:"absolute",background:Me.inkBarColor,pointerEvents:"none"}}),zr(Me)),{[`${Ae}-content`]:{position:"relative",width:"100%"},[`${Ae}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${Ae}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${Ae}-centered`]:{[`> ${Ae}-nav, > div > ${Ae}-nav`]:{[`${Ae}-nav-wrap`]:{[`&:not([class*='${Ae}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}};var Bn=(0,Rr.Z)("Tabs",Me=>{const Ae=(0,Zr.TS)(Me,{tabsCardPadding:Me.cardPadding||`${(Me.cardHeight-Math.round(Me.fontSize*Me.lineHeight))/2-Me.lineWidth}px ${Me.padding}px`,dropdownEdgeChildVerticalPadding:Me.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${Me.horizontalItemGutter}px`,tabsHorizontalItemMarginRTL:`0 0 0 ${Me.horizontalItemGutter}px`});return[qr(Ae),ar(Ae),Er(Ae),Wr(Ae),Nr(Ae),or(Ae),yr(Ae)]},Me=>{const Ae=Me.controlHeightLG;return{zIndexPopup:Me.zIndexPopupBase+50,cardBg:Me.colorFillAlter,cardHeight:Ae,cardPadding:"",cardPaddingSM:`${Me.paddingXXS*1.5}px ${Me.padding}px`,cardPaddingLG:`${Me.paddingXS}px ${Me.padding}px ${Me.paddingXXS*1.5}px`,titleFontSize:Me.fontSize,titleFontSizeLG:Me.fontSizeLG,titleFontSizeSM:Me.fontSize,inkBarColor:Me.colorPrimary,horizontalMargin:`0 0 ${Me.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${Me.paddingSM}px 0`,horizontalItemPaddingSM:`${Me.paddingXS}px 0`,horizontalItemPaddingLG:`${Me.padding}px 0`,verticalItemPadding:`${Me.paddingXS}px ${Me.paddingLG}px`,verticalItemMargin:`${Me.margin}px 0 0 0`,itemColor:Me.colorText,itemSelectedColor:Me.colorPrimary,itemHoverColor:Me.colorPrimaryHover,itemActiveColor:Me.colorPrimaryActive,cardGutter:Me.marginXXS/2}}),In=function(Me,Ae){var Le={};for(var De in Me)Object.prototype.hasOwnProperty.call(Me,De)&&Ae.indexOf(De)<0&&(Le[De]=Me[De]);if(Me!=null&&typeof Object.getOwnPropertySymbols=="function")for(var We=0,De=Object.getOwnPropertySymbols(Me);We<De.length;We++)Ae.indexOf(De[We])<0&&Object.prototype.propertyIsEnumerable.call(Me,De[We])&&(Le[De[We]]=Me[De[We]]);return Le};const wr=Me=>{const{type:Ae,className:Le,rootClassName:De,size:We,onEdit:it,hideAdd:Nt,centered:Lt,addIcon:$t,popupClassName:sn,children:hn,items:xn,animated:Mt,style:rn,indicatorSize:Je}=Me,pt=In(Me,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize"]),{prefixCls:Ct,moreIcon:Et=Oe.createElement(ut.Z,null)}=pt,{direction:Yt,tabs:St,getPrefixCls:Gt,getPopupContainer:Te}=Oe.useContext(Ze.E_),dt=Gt("tabs",Ct),[ft,Tt]=Bn(dt);let _t;Ae==="editable-card"&&(_t={onEdit:($n,qn)=>{let{key:sr,event:jn}=qn;it==null||it($n==="add"?jn:sr,$n)},removeIcon:Oe.createElement(pe.Z,null),addIcon:$t||Oe.createElement($e.Z,null),showAdd:Nt!==!0});const Pt=Gt(),Bt=gr(xn,hn),un=Nn(dt,Mt),yn=(0,Ft.Z)(We),_n=Object.assign(Object.assign({},St==null?void 0:St.style),rn);return ft(Oe.createElement(Re,Object.assign({direction:Yt,getPopupContainer:Te,moreTransitionName:`${Pt}-slide-up`},pt,{items:Bt,className:Se()({[`${dt}-${yn}`]:yn,[`${dt}-card`]:["card","editable-card"].includes(Ae),[`${dt}-editable-card`]:Ae==="editable-card",[`${dt}-centered`]:Lt},St==null?void 0:St.className,Le,De,Tt),popupClassName:Se()(sn,Tt),style:_n,editable:_t,moreIcon:Et,prefixCls:dt,animated:un,indicatorSize:Je!=null?Je:St==null?void 0:St.indicatorSize})))};wr.TabPane=an;var Qe=wr},54580:function(kn,dn,de){"use strict";de.d(dn,{default:function(){return rn}});var pe=de(59301),ut=de(77654),$e=de(92310),ct=de.n($e),Se=de(60499),Pe=de(38705),Ne=de(17212),Ce=de(39153),ke=de(55401),Fe=de(18642),gt=de(42244),Oe=de(73001),je=de(43749),kt=de(11576),et=de(26112);function mt(Je,pt){var Ct="cannot ".concat(Je.method," ").concat(Je.action," ").concat(pt.status,"'"),Et=new Error(Ct);return Et.status=pt.status,Et.method=Je.method,Et.url=Je.action,Et}function st(Je){var pt=Je.responseText||Je.response;if(!pt)return pt;try{return JSON.parse(pt)}catch(Ct){return pt}}function Rt(Je){var pt=new XMLHttpRequest;Je.onProgress&&pt.upload&&(pt.upload.onprogress=function(St){St.total>0&&(St.percent=St.loaded/St.total*100),Je.onProgress(St)});var Ct=new FormData;Je.data&&Object.keys(Je.data).forEach(function(Yt){var St=Je.data[Yt];if(Array.isArray(St)){St.forEach(function(Gt){Ct.append("".concat(Yt,"[]"),Gt)});return}Ct.append(Yt,St)}),Je.file instanceof Blob?Ct.append(Je.filename,Je.file,Je.file.name):Ct.append(Je.filename,Je.file),pt.onerror=function(St){Je.onError(St)},pt.onload=function(){return pt.status<200||pt.status>=300?Je.onError(mt(Je,pt),st(pt)):Je.onSuccess(st(pt),pt)},pt.open(Je.method,Je.action,!0),Je.withCredentials&&"withCredentials"in pt&&(pt.withCredentials=!0);var Et=Je.headers||{};return Et["X-Requested-With"]!==null&&pt.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(Et).forEach(function(Yt){Et[Yt]!==null&&pt.setRequestHeader(Yt,Et[Yt])}),pt.send(Ct),{abort:function(){pt.abort()}}}var tn=+new Date,nt=0;function ht(){return"rc-upload-".concat(tn,"-").concat(++nt)}var Ve=de(48736),Ee=function(Je,pt){if(Je&&pt){var Ct=Array.isArray(pt)?pt:pt.split(","),Et=Je.name||"",Yt=Je.type||"",St=Yt.replace(/\/.*$/,"");return Ct.some(function(Gt){var Te=Gt.trim();if(/^\*(\/\*)?$/.test(Gt))return!0;if(Te.charAt(0)==="."){var dt=Et.toLowerCase(),ft=Te.toLowerCase(),Tt=[ft];return(ft===".jpg"||ft===".jpeg")&&(Tt=[".jpg",".jpeg"]),Tt.some(function(_t){return dt.endsWith(_t)})}return/\/\*$/.test(Te)?St===Te.replace(/\/.*$/,""):Yt===Te?!0:/^\w+$/.test(Te)?((0,Ve.ZP)(!1,"Upload takes an invalidate 'accept' type '".concat(Te,"'.Skip for check.")),!0):!1})}return!0};function Xe(Je,pt){var Ct=Je.createReader(),Et=[];function Yt(){Ct.readEntries(function(St){var Gt=Array.prototype.slice.apply(St);Et=Et.concat(Gt);var Te=!Gt.length;Te?pt(Et):Yt()})}Yt()}var at=function(pt,Ct,Et){var Yt=function St(Gt,Te){Gt&&(Gt.path=Te||"",Gt.isFile?Gt.file(function(dt){Et(dt)&&(Gt.fullPath&&!dt.webkitRelativePath&&(Object.defineProperties(dt,{webkitRelativePath:{writable:!0}}),dt.webkitRelativePath=Gt.fullPath.replace(/^\//,""),Object.defineProperties(dt,{webkitRelativePath:{writable:!1}})),Ct([dt]))}):Gt.isDirectory&&Xe(Gt,function(dt){dt.forEach(function(ft){St(ft,"".concat(Te).concat(Gt.name,"/"))})}))};pt.forEach(function(St){Yt(St.webkitGetAsEntry())})},vt=at,Ue=["component","prefixCls","className","disabled","id","style","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"],Ot=function(Je){(0,Ce.Z)(Ct,Je);var pt=(0,ke.Z)(Ct);function Ct(){var Et;(0,Pe.Z)(this,Ct);for(var Yt=arguments.length,St=new Array(Yt),Gt=0;Gt<Yt;Gt++)St[Gt]=arguments[Gt];return Et=pt.call.apply(pt,[this].concat(St)),Et.state={uid:ht()},Et.reqs={},Et.fileInput=void 0,Et._isMounted=void 0,Et.onChange=function(Te){var dt=Et.props,ft=dt.accept,Tt=dt.directory,_t=Te.target.files,Pt=(0,ut.Z)(_t).filter(function(Bt){return!Tt||Ee(Bt,ft)});Et.uploadFiles(Pt),Et.reset()},Et.onClick=function(Te){var dt=Et.fileInput;if(dt){var ft=Te.target,Tt=Et.props.onClick;if(ft&&ft.tagName==="BUTTON"){var _t=dt.parentNode;_t.focus(),ft.blur()}dt.click(),Tt&&Tt(Te)}},Et.onKeyDown=function(Te){Te.key==="Enter"&&Et.onClick(Te)},Et.onFileDrop=function(Te){var dt=Et.props.multiple;if(Te.preventDefault(),Te.type!=="dragover")if(Et.props.directory)vt(Array.prototype.slice.call(Te.dataTransfer.items),Et.uploadFiles,function(Tt){return Ee(Tt,Et.props.accept)});else{var ft=(0,ut.Z)(Te.dataTransfer.files).filter(function(Tt){return Ee(Tt,Et.props.accept)});dt===!1&&(ft=ft.slice(0,1)),Et.uploadFiles(ft)}},Et.uploadFiles=function(Te){var dt=(0,ut.Z)(Te),ft=dt.map(function(Tt){return Tt.uid=ht(),Et.processFile(Tt,dt)});Promise.all(ft).then(function(Tt){var _t=Et.props.onBatchStart;_t==null||_t(Tt.map(function(Pt){var Bt=Pt.origin,un=Pt.parsedFile;return{file:Bt,parsedFile:un}})),Tt.filter(function(Pt){return Pt.parsedFile!==null}).forEach(function(Pt){Et.post(Pt)})})},Et.processFile=function(){var Te=(0,kt.Z)((0,Oe.Z)().mark(function dt(ft,Tt){var _t,Pt,Bt,un,yn,_n,$n,qn,sr;return(0,Oe.Z)().wrap(function(Ln){for(;;)switch(Ln.prev=Ln.next){case 0:if(_t=Et.props.beforeUpload,Pt=ft,!_t){Ln.next=14;break}return Ln.prev=3,Ln.next=6,_t(ft,Tt);case 6:Pt=Ln.sent,Ln.next=12;break;case 9:Ln.prev=9,Ln.t0=Ln.catch(3),Pt=!1;case 12:if(Pt!==!1){Ln.next=14;break}return Ln.abrupt("return",{origin:ft,parsedFile:null,action:null,data:null});case 14:if(Bt=Et.props.action,typeof Bt!="function"){Ln.next=21;break}return Ln.next=18,Bt(ft);case 18:un=Ln.sent,Ln.next=22;break;case 21:un=Bt;case 22:if(yn=Et.props.data,typeof yn!="function"){Ln.next=29;break}return Ln.next=26,yn(ft);case 26:_n=Ln.sent,Ln.next=30;break;case 29:_n=yn;case 30:return $n=((0,je.Z)(Pt)==="object"||typeof Pt=="string")&&Pt?Pt:ft,$n instanceof File?qn=$n:qn=new File([$n],ft.name,{type:ft.type}),sr=qn,sr.uid=ft.uid,Ln.abrupt("return",{origin:ft,data:_n,parsedFile:sr,action:un});case 35:case"end":return Ln.stop()}},dt,null,[[3,9]])}));return function(dt,ft){return Te.apply(this,arguments)}}(),Et.saveFileInput=function(Te){Et.fileInput=Te},Et}return(0,Ne.Z)(Ct,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"post",value:function(Yt){var St=this,Gt=Yt.data,Te=Yt.origin,dt=Yt.action,ft=Yt.parsedFile;if(this._isMounted){var Tt=this.props,_t=Tt.onStart,Pt=Tt.customRequest,Bt=Tt.name,un=Tt.headers,yn=Tt.withCredentials,_n=Tt.method,$n=Te.uid,qn=Pt||Rt,sr={action:dt,filename:Bt,data:Gt,file:ft,headers:un,withCredentials:yn,method:_n||"post",onProgress:function(Ln){var ur=St.props.onProgress;ur==null||ur(Ln,ft)},onSuccess:function(Ln,ur){var Qn=St.props.onSuccess;Qn==null||Qn(Ln,ft,ur),delete St.reqs[$n]},onError:function(Ln,ur){var Qn=St.props.onError;Qn==null||Qn(Ln,ur,ft),delete St.reqs[$n]}};_t(Te),this.reqs[$n]=qn(sr)}}},{key:"reset",value:function(){this.setState({uid:ht()})}},{key:"abort",value:function(Yt){var St=this.reqs;if(Yt){var Gt=Yt.uid?Yt.uid:Yt;St[Gt]&&St[Gt].abort&&St[Gt].abort(),delete St[Gt]}else Object.keys(St).forEach(function(Te){St[Te]&&St[Te].abort&&St[Te].abort(),delete St[Te]})}},{key:"render",value:function(){var Yt=this.props,St=Yt.component,Gt=Yt.prefixCls,Te=Yt.className,dt=Yt.disabled,ft=Yt.id,Tt=Yt.style,_t=Yt.multiple,Pt=Yt.accept,Bt=Yt.capture,un=Yt.children,yn=Yt.directory,_n=Yt.openFileDialogOnClick,$n=Yt.onMouseEnter,qn=Yt.onMouseLeave,sr=(0,gt.Z)(Yt,Ue),jn=ct()((0,Fe.Z)((0,Fe.Z)((0,Fe.Z)({},Gt,!0),"".concat(Gt,"-disabled"),dt),Te,Te)),Ln=yn?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},ur=dt?{}:{onClick:_n?this.onClick:function(){},onKeyDown:_n?this.onKeyDown:function(){},onMouseEnter:$n,onMouseLeave:qn,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return pe.createElement(St,(0,Se.Z)({},ur,{className:jn,role:"button",style:Tt}),pe.createElement("input",(0,Se.Z)({},(0,et.Z)(sr,{aria:!0,data:!0}),{id:ft,disabled:dt,type:"file",ref:this.saveFileInput,onClick:function(mr){return mr.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:Pt},Ln,{multiple:_t,onChange:this.onChange},Bt!=null?{capture:Bt}:{})),un)}}]),Ct}(pe.Component),rt=Ot;function At(){}var qe=function(Je){(0,Ce.Z)(Ct,Je);var pt=(0,ke.Z)(Ct);function Ct(){var Et;(0,Pe.Z)(this,Ct);for(var Yt=arguments.length,St=new Array(Yt),Gt=0;Gt<Yt;Gt++)St[Gt]=arguments[Gt];return Et=pt.call.apply(pt,[this].concat(St)),Et.uploader=void 0,Et.saveUploader=function(Te){Et.uploader=Te},Et}return(0,Ne.Z)(Ct,[{key:"abort",value:function(Yt){this.uploader.abort(Yt)}},{key:"render",value:function(){return pe.createElement(rt,(0,Se.Z)({},this.props,{ref:this.saveUploader}))}}]),Ct}(pe.Component);qe.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:At,onError:At,onSuccess:At,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var Ht=qe,cn=Ht,Kt=de(18929),Xt=de(4676),Wt=de(36355),ze=de(1684),xe=de(9763),bt=de(31724),pn={icon:function(pt,Ct){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:Ct}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:pt}}]}},name:"file",theme:"twotone"},Ut=pn,Ge=de(7657),Ye=function(pt,Ct){return pe.createElement(Ge.Z,(0,Se.Z)({},pt,{ref:Ct,icon:Ut}))},It=pe.forwardRef(Ye),Mn=It,jt=de(58617),bn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},Vt=bn,Zt=function(pt,Ct){return pe.createElement(Ge.Z,(0,Se.Z)({},pt,{ref:Ct,icon:Vt}))},zt=pe.forwardRef(Zt),ve=zt,se={icon:function(pt,Ct){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:pt}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:Ct}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:Ct}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:Ct}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:pt}}]}},name:"picture",theme:"twotone"},oe=se,fe=function(pt,Ct){return pe.createElement(Ge.Z,(0,Se.Z)({},pt,{ref:Ct,icon:oe}))},ye=pe.forwardRef(fe),ce=ye,Ke=de(77900),Dt=de(56762),ln=de(62892),Jt=de(92343),en=de(3113);function nn(Je){return Object.assign(Object.assign({},Je),{lastModified:Je.lastModified,lastModifiedDate:Je.lastModifiedDate,name:Je.name,size:Je.size,type:Je.type,uid:Je.uid,percent:0,originFileObj:Je})}function wn(Je,pt){const Ct=(0,ut.Z)(pt),Et=Ct.findIndex(Yt=>{let{uid:St}=Yt;return St===Je.uid});return Et===-1?Ct.push(Je):Ct[Et]=Je,Ct}function mn(Je,pt){const Ct=Je.uid!==void 0?"uid":"name";return pt.filter(Et=>Et[Ct]===Je[Ct])[0]}function En(Je,pt){const Ct=Je.uid!==void 0?"uid":"name",Et=pt.filter(Yt=>Yt[Ct]!==Je[Ct]);return Et.length===pt.length?null:Et}const yt=function(){const pt=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"").split("/"),Et=pt[pt.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(Et)||[""])[0]},gn=Je=>Je.indexOf("image/")===0,Jn=Je=>{if(Je.type&&!Je.thumbUrl)return gn(Je.type);const pt=Je.thumbUrl||Je.url||"",Ct=yt(pt);return/^data:image\//.test(pt)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(Ct)?!0:!(/^data:/.test(pt)||Ct)},tt=200;function Re(Je){return new Promise(pt=>{if(!Je.type||!gn(Je.type)){pt("");return}const Ct=document.createElement("canvas");Ct.width=tt,Ct.height=tt,Ct.style.cssText=`position: fixed; left: 0; top: 0; width: ${tt}px; height: ${tt}px; z-index: 9999; display: none;`,document.body.appendChild(Ct);const Et=Ct.getContext("2d"),Yt=new Image;if(Yt.onload=()=>{const{width:St,height:Gt}=Yt;let Te=tt,dt=tt,ft=0,Tt=0;St>Gt?(dt=Gt*(tt/St),Tt=-(dt-Te)/2):(Te=St*(tt/Gt),ft=-(Te-dt)/2),Et.drawImage(Yt,ft,Tt,Te,dt);const _t=Ct.toDataURL();document.body.removeChild(Ct),window.URL.revokeObjectURL(Yt.src),pt(_t)},Yt.crossOrigin="anonymous",Je.type.startsWith("image/svg+xml")){const St=new FileReader;St.onload=()=>{St.result&&(Yt.src=St.result)},St.readAsDataURL(Je)}else if(Je.type.startsWith("image/gif")){const St=new FileReader;St.onload=()=>{St.result&&pt(St.result)},St.readAsDataURL(Je)}else Yt.src=window.URL.createObjectURL(Je)})}var Ze=de(26227),Ft=de(41464),Qt=de(15277),an=de(93948),Pn=de(6848),Nn=pe.forwardRef((Je,pt)=>{let{prefixCls:Ct,className:Et,style:Yt,locale:St,listType:Gt,file:Te,items:dt,progress:ft,iconRender:Tt,actionIconRender:_t,itemRender:Pt,isImgUrl:Bt,showPreviewIcon:un,showRemoveIcon:yn,showDownloadIcon:_n,previewIcon:$n,removeIcon:qn,downloadIcon:sr,onPreview:jn,onDownload:Ln,onClose:ur}=Je;var Qn,mr;const{status:Vn}=Te,[Un,br]=pe.useState(Vn);pe.useEffect(()=>{Vn!=="removed"&&br(Vn)},[Vn]);const[lr,Ir]=pe.useState(!1);pe.useEffect(()=>{const di=setTimeout(()=>{Ir(!0)},300);return()=>{clearTimeout(di)}},[]);const Ur=Tt(Te);let rr=pe.createElement("div",{className:`${Ct}-icon`},Ur);if(Gt==="picture"||Gt==="picture-card"||Gt==="picture-circle")if(Un==="uploading"||!Te.thumbUrl&&!Te.url){const di=ct()(`${Ct}-list-item-thumbnail`,{[`${Ct}-list-item-file`]:Un!=="uploading"});rr=pe.createElement("div",{className:di},Ur)}else{const di=Bt!=null&&Bt(Te)?pe.createElement("img",{src:Te.thumbUrl||Te.url,alt:Te.name,className:`${Ct}-list-item-image`,crossOrigin:Te.crossOrigin}):Ur,ri=ct()(`${Ct}-list-item-thumbnail`,{[`${Ct}-list-item-file`]:Bt&&!Bt(Te)});rr=pe.createElement("a",{className:ri,onClick:Yr=>jn(Te,Yr),href:Te.url||Te.thumbUrl,target:"_blank",rel:"noopener noreferrer"},di)}const Cn=ct()(`${Ct}-list-item`,`${Ct}-list-item-${Un}`),Sn=typeof Te.linkProps=="string"?JSON.parse(Te.linkProps):Te.linkProps,fr=yn?_t((typeof qn=="function"?qn(Te):qn)||pe.createElement(Ze.Z,null),()=>ur(Te),Ct,St.removeFile):null,er=_n&&Un==="done"?_t((typeof sr=="function"?sr(Te):sr)||pe.createElement(Ft.Z,null),()=>Ln(Te),Ct,St.downloadFile):null,Mr=Gt!=="picture-card"&&Gt!=="picture-circle"&&pe.createElement("span",{key:"download-delete",className:ct()(`${Ct}-list-item-actions`,{picture:Gt==="picture"})},er,fr),_r=ct()(`${Ct}-list-item-name`),Ar=Te.url?[pe.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:_r,title:Te.name},Sn,{href:Te.url,onClick:di=>jn(Te,di)}),Te.name),Mr]:[pe.createElement("span",{key:"view",className:_r,onClick:di=>jn(Te,di),title:Te.name},Te.name),Mr],dr={pointerEvents:"none",opacity:.5},Sr=un?pe.createElement("a",{href:Te.url||Te.thumbUrl,target:"_blank",rel:"noopener noreferrer",style:Te.url||Te.thumbUrl?void 0:dr,onClick:di=>jn(Te,di),title:St.previewFile},typeof $n=="function"?$n(Te):$n||pe.createElement(Qt.Z,null)):null,ii=(Gt==="picture-card"||Gt==="picture-circle")&&Un!=="uploading"&&pe.createElement("span",{className:`${Ct}-list-item-actions`},Sr,Un==="done"&&er,fr),{getPrefixCls:zn}=pe.useContext(Wt.E_),Xn=zn(),kr=pe.createElement("div",{className:Cn},rr,Ar,ii,lr&&pe.createElement(Ke.default,{motionName:`${Xn}-fade`,visible:Un==="uploading",motionDeadline:2e3},di=>{let{className:ri}=di;const Yr="percent"in Te?pe.createElement(an.Z,Object.assign({},ft,{type:"line",percent:Te.percent,"aria-label":Te["aria-label"],"aria-labelledby":Te["aria-labelledby"]})):null;return pe.createElement("div",{className:ct()(`${Ct}-list-item-progress`,ri)},Yr)})),Br=Te.response&&typeof Te.response=="string"?Te.response:((Qn=Te.error)===null||Qn===void 0?void 0:Qn.statusText)||((mr=Te.error)===null||mr===void 0?void 0:mr.message)||St.uploadError,li=Un==="error"?pe.createElement(Pn.Z,{title:Br,getPopupContainer:di=>di.parentNode},kr):kr;return pe.createElement("div",{className:ct()(`${Ct}-list-item-container`,Et),style:Yt,ref:pt},Pt?Pt(li,Te,dt,{download:Ln.bind(null,Te),preview:jn.bind(null,Te),remove:ur.bind(null,Te)}):li)});const Zn=(Je,pt)=>{const{listType:Ct="text",previewFile:Et=Re,onPreview:Yt,onDownload:St,onRemove:Gt,locale:Te,iconRender:dt,isImageUrl:ft=Jn,prefixCls:Tt,items:_t=[],showPreviewIcon:Pt=!0,showRemoveIcon:Bt=!0,showDownloadIcon:un=!1,removeIcon:yn,previewIcon:_n,downloadIcon:$n,progress:qn={size:[-1,2],showInfo:!1},appendAction:sr,appendActionVisible:jn=!0,itemRender:Ln,disabled:ur}=Je,Qn=(0,Dt.Z)(),[mr,Vn]=pe.useState(!1);pe.useEffect(()=>{Ct!=="picture"&&Ct!=="picture-card"&&Ct!=="picture-circle"||(_t||[]).forEach(dr=>{typeof document=="undefined"||typeof window=="undefined"||!window.FileReader||!window.File||!(dr.originFileObj instanceof File||dr.originFileObj instanceof Blob)||dr.thumbUrl!==void 0||(dr.thumbUrl="",Et&&Et(dr.originFileObj).then(Sr=>{dr.thumbUrl=Sr||"",Qn()}))})},[Ct,_t,Et]),pe.useEffect(()=>{Vn(!0)},[]);const Un=(dr,Sr)=>{if(Yt)return Sr==null||Sr.preventDefault(),Yt(dr)},br=dr=>{typeof St=="function"?St(dr):dr.url&&window.open(dr.url)},lr=dr=>{Gt==null||Gt(dr)},Ir=dr=>{if(dt)return dt(dr,Ct);const Sr=dr.status==="uploading",ii=ft&&ft(dr)?pe.createElement(ce,null):pe.createElement(Mn,null);let zn=Sr?pe.createElement(jt.Z,null):pe.createElement(ve,null);return Ct==="picture"?zn=Sr?pe.createElement(jt.Z,null):ii:(Ct==="picture-card"||Ct==="picture-circle")&&(zn=Sr?Te.uploading:ii),zn},Ur=(dr,Sr,ii,zn)=>{const Xn={type:"text",size:"small",title:zn,onClick:kr=>{Sr(),(0,Jt.l$)(dr)&&dr.props.onClick&&dr.props.onClick(kr)},className:`${ii}-list-item-action`,disabled:ur};if((0,Jt.l$)(dr)){const kr=(0,Jt.Tm)(dr,Object.assign(Object.assign({},dr.props),{onClick:()=>{}}));return pe.createElement(en.ZP,Object.assign({},Xn,{icon:kr}))}return pe.createElement(en.ZP,Object.assign({},Xn),pe.createElement("span",null,dr))};pe.useImperativeHandle(pt,()=>({handlePreview:Un,handleDownload:br}));const{getPrefixCls:rr}=pe.useContext(Wt.E_),Cn=rr("upload",Tt),Sn=rr(),fr=ct()(`${Cn}-list`,`${Cn}-list-${Ct}`),er=(0,ut.Z)(_t.map(dr=>({key:dr.uid,file:dr})));let _r={motionDeadline:2e3,motionName:`${Cn}-${Ct==="picture-card"||Ct==="picture-circle"?"animate-inline":"animate"}`,keys:er,motionAppear:mr};const Ar=pe.useMemo(()=>{const dr=Object.assign({},(0,ln.Z)(Sn));return delete dr.onAppearEnd,delete dr.onEnterEnd,delete dr.onLeaveEnd,dr},[Sn]);return Ct!=="picture-card"&&Ct!=="picture-circle"&&(_r=Object.assign(Object.assign({},Ar),_r)),pe.createElement("div",{className:fr},pe.createElement(Ke.CSSMotionList,Object.assign({},_r,{component:!1}),dr=>{let{key:Sr,file:ii,className:zn,style:Xn}=dr;return pe.createElement(Nn,{key:Sr,locale:Te,prefixCls:Cn,className:zn,style:Xn,file:ii,items:_t,progress:qn,listType:Ct,isImgUrl:ft,showPreviewIcon:Pt,showRemoveIcon:Bt,showDownloadIcon:un,removeIcon:yn,previewIcon:_n,downloadIcon:$n,iconRender:Ir,actionIconRender:Ur,itemRender:Ln,onPreview:Un,onDownload:br,onClose:lr})}),sr&&pe.createElement(Ke.default,Object.assign({},_r,{visible:jn,forceRender:!0}),dr=>{let{className:Sr,style:ii}=dr;return(0,Jt.Tm)(sr,zn=>({className:ct()(zn.className,Sr),style:Object.assign(Object.assign(Object.assign({},ii),{pointerEvents:Sr?"none":void 0}),zn.style)}))}))};var Tn=pe.forwardRef(Zn),gr=de(17313),Pr=de(8378),Rr=de(83116),Zr=de(37613),Dr=Je=>{const{componentCls:pt,iconCls:Ct}=Je;return{[`${pt}-wrapper`]:{[`${pt}-drag`]:{position:"relative",width:"100%",height:"100%",textAlign:"center",background:Je.colorFillAlter,border:`${Je.lineWidth}px dashed ${Je.colorBorder}`,borderRadius:Je.borderRadiusLG,cursor:"pointer",transition:`border-color ${Je.motionDurationSlow}`,[pt]:{padding:`${Je.padding}px 0`},[`${pt}-btn`]:{display:"table",width:"100%",height:"100%",outline:"none"},[`${pt}-drag-container`]:{display:"table-cell",verticalAlign:"middle"},[`&:not(${pt}-disabled):hover`]:{borderColor:Je.colorPrimaryHover},[`p${pt}-drag-icon`]:{marginBottom:Je.margin,[Ct]:{color:Je.colorPrimary,fontSize:Je.uploadThumbnailSize}},[`p${pt}-text`]:{margin:`0 0 ${Je.marginXXS}px`,color:Je.colorTextHeading,fontSize:Je.fontSizeLG},[`p${pt}-hint`]:{color:Je.colorTextDescription,fontSize:Je.fontSize},[`&${pt}-disabled`]:{cursor:"not-allowed",[`p${pt}-drag-icon ${Ct},
p${pt}-text,
p${pt}-hint
`]:{color:Je.colorTextDisabled}}}}}},Nr=Je=>{const{componentCls:pt,antCls:Ct,iconCls:Et,fontSize:Yt,lineHeight:St}=Je,Gt=`${pt}-list-item`,Te=`${Gt}-actions`,dt=`${Gt}-action`,ft=Math.round(Yt*St);return{[`${pt}-wrapper`]:{[`${pt}-list`]:Object.assign(Object.assign({},(0,gr.dF)()),{lineHeight:Je.lineHeight,[Gt]:{position:"relative",height:Je.lineHeight*Yt,marginTop:Je.marginXS,fontSize:Yt,display:"flex",alignItems:"center",transition:`background-color ${Je.motionDurationSlow}`,"&:hover":{backgroundColor:Je.controlItemBgHover},[`${Gt}-name`]:Object.assign(Object.assign({},gr.vS),{padding:`0 ${Je.paddingXS}px`,lineHeight:St,flex:"auto",transition:`all ${Je.motionDurationSlow}`}),[Te]:{[dt]:{opacity:0},[`${dt}${Ct}-btn-sm`]:{height:ft,border:0,lineHeight:1,"> span":{transform:"scale(1)"}},[`
${dt}:focus-visible,
&.picture ${dt}
`]:{opacity:1},[Et]:{color:Je.actionsColor,transition:`all ${Je.motionDurationSlow}`},[`&:hover ${Et}`]:{color:Je.colorText}},[`${pt}-icon ${Et}`]:{color:Je.colorTextDescription,fontSize:Yt},[`${Gt}-progress`]:{position:"absolute",bottom:-Je.uploadProgressOffset,width:"100%",paddingInlineStart:Yt+Je.paddingXS,fontSize:Yt,lineHeight:0,pointerEvents:"none","> div":{margin:0}}},[`${Gt}:hover ${dt}`]:{opacity:1,color:Je.colorText},[`${Gt}-error`]:{color:Je.colorError,[`${Gt}-name, ${pt}-icon ${Et}`]:{color:Je.colorError},[Te]:{[`${Et}, ${Et}:hover`]:{color:Je.colorError},[dt]:{opacity:1}}},[`${pt}-list-item-container`]:{transition:`opacity ${Je.motionDurationSlow}, height ${Je.motionDurationSlow}`,"&::before":{display:"table",width:0,height:0,content:'""'}}})}}},Wr=de(36237),Er=de(1950);const qr=new Wr.Keyframes("uploadAnimateInlineIn",{from:{width:0,height:0,margin:0,padding:0,opacity:0}}),zr=new Wr.Keyframes("uploadAnimateInlineOut",{to:{width:0,height:0,margin:0,padding:0,opacity:0}});var or=Je=>{const{componentCls:pt}=Je,Ct=`${pt}-animate-inline`;return[{[`${pt}-wrapper`]:{[`${Ct}-appear, ${Ct}-enter, ${Ct}-leave`]:{animationDuration:Je.motionDurationSlow,animationTimingFunction:Je.motionEaseInOutCirc,animationFillMode:"forwards"},[`${Ct}-appear, ${Ct}-enter`]:{animationName:qr},[`${Ct}-leave`]:{animationName:zr}}},{[`${pt}-wrapper`]:(0,Er.J$)(Je)},qr,zr]},Bn=de(30071),In=de(64993);const wr=Je=>{const{componentCls:pt,iconCls:Ct,uploadThumbnailSize:Et,uploadProgressOffset:Yt}=Je,St=`${pt}-list`,Gt=`${St}-item`;return{[`${pt}-wrapper`]:{[`
${St}${St}-picture,
${St}${St}-picture-card,
${St}${St}-picture-circle
`]:{[Gt]:{position:"relative",height:Et+Je.lineWidth*2+Je.paddingXS*2,padding:Je.paddingXS,border:`${Je.lineWidth}px ${Je.lineType} ${Je.colorBorder}`,borderRadius:Je.borderRadiusLG,"&:hover":{background:"transparent"},[`${Gt}-thumbnail`]:Object.assign(Object.assign({},gr.vS),{width:Et,height:Et,lineHeight:`${Et+Je.paddingSM}px`,textAlign:"center",flex:"none",[Ct]:{fontSize:Je.fontSizeHeading2,color:Je.colorPrimary},img:{display:"block",width:"100%",height:"100%",overflow:"hidden"}}),[`${Gt}-progress`]:{bottom:Yt,width:`calc(100% - ${Je.paddingSM*2}px)`,marginTop:0,paddingInlineStart:Et+Je.paddingXS}},[`${Gt}-error`]:{borderColor:Je.colorError,[`${Gt}-thumbnail ${Ct}`]:{[`svg path[fill='${Bn.blue[0]}']`]:{fill:Je.colorErrorBg},[`svg path[fill='${Bn.blue.primary}']`]:{fill:Je.colorError}}},[`${Gt}-uploading`]:{borderStyle:"dashed",[`${Gt}-name`]:{marginBottom:Yt}}},[`${St}${St}-picture-circle ${Gt}`]:{[`&, &::before, ${Gt}-thumbnail`]:{borderRadius:"50%"}}}}},Qe=Je=>{const{componentCls:pt,iconCls:Ct,fontSizeLG:Et,colorTextLightSolid:Yt}=Je,St=`${pt}-list`,Gt=`${St}-item`,Te=Je.uploadPicCardSize;return{[`
${pt}-wrapper${pt}-picture-card-wrapper,
${pt}-wrapper${pt}-picture-circle-wrapper
`]:Object.assign(Object.assign({},(0,gr.dF)()),{display:"inline-block",width:"100%",[`${pt}${pt}-select`]:{width:Te,height:Te,marginInlineEnd:Je.marginXS,marginBottom:Je.marginXS,textAlign:"center",verticalAlign:"top",backgroundColor:Je.colorFillAlter,border:`${Je.lineWidth}px dashed ${Je.colorBorder}`,borderRadius:Je.borderRadiusLG,cursor:"pointer",transition:`border-color ${Je.motionDurationSlow}`,[`> ${pt}`]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",textAlign:"center"},[`&:not(${pt}-disabled):hover`]:{borderColor:Je.colorPrimary}},[`${St}${St}-picture-card, ${St}${St}-picture-circle`]:{[`${St}-item-container`]:{display:"inline-block",width:Te,height:Te,marginBlock:`0 ${Je.marginXS}px`,marginInline:`0 ${Je.marginXS}px`,verticalAlign:"top"},"&::after":{display:"none"},[Gt]:{height:"100%",margin:0,"&::before":{position:"absolute",zIndex:1,width:`calc(100% - ${Je.paddingXS*2}px)`,height:`calc(100% - ${Je.paddingXS*2}px)`,backgroundColor:Je.colorBgMask,opacity:0,transition:`all ${Je.motionDurationSlow}`,content:'" "'}},[`${Gt}:hover`]:{[`&::before, ${Gt}-actions`]:{opacity:1}},[`${Gt}-actions`]:{position:"absolute",insetInlineStart:0,zIndex:10,width:"100%",whiteSpace:"nowrap",textAlign:"center",opacity:0,transition:`all ${Je.motionDurationSlow}`,[`${Ct}-eye, ${Ct}-download, ${Ct}-delete`]:{zIndex:10,width:Et,margin:`0 ${Je.marginXXS}px`,fontSize:Et,cursor:"pointer",transition:`all ${Je.motionDurationSlow}`,svg:{verticalAlign:"baseline"}}},[`${Gt}-actions, ${Gt}-actions:hover`]:{[`${Ct}-eye, ${Ct}-download, ${Ct}-delete`]:{color:new In.C(Yt).setAlpha(.65).toRgbString(),"&:hover":{color:Yt}}},[`${Gt}-thumbnail, ${Gt}-thumbnail img`]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},[`${Gt}-name`]:{display:"none",textAlign:"center"},[`${Gt}-file + ${Gt}-name`]:{position:"absolute",bottom:Je.margin,display:"block",width:`calc(100% - ${Je.paddingXS*2}px)`},[`${Gt}-uploading`]:{[`&${Gt}`]:{backgroundColor:Je.colorFillAlter},[`&::before, ${Ct}-eye, ${Ct}-download, ${Ct}-delete`]:{display:"none"}},[`${Gt}-progress`]:{bottom:Je.marginXL,width:`calc(100% - ${Je.paddingXS*2}px)`,paddingInlineStart:0}}}),[`${pt}-wrapper${pt}-picture-circle-wrapper`]:{[`${pt}${pt}-select`]:{borderRadius:"50%"}}}};var Ae=Je=>{const{componentCls:pt}=Je;return{[`${pt}-rtl`]:{direction:"rtl"}}};const Le=Je=>{const{componentCls:pt,colorTextDisabled:Ct}=Je;return{[`${pt}-wrapper`]:Object.assign(Object.assign({},(0,gr.Wf)(Je)),{[pt]:{outline:0,"input[type='file']":{cursor:"pointer"}},[`${pt}-select`]:{display:"inline-block"},[`${pt}-disabled`]:{color:Ct,cursor:"not-allowed"}})}};var De=(0,Rr.Z)("Upload",Je=>{const{fontSizeHeading3:pt,fontSize:Ct,lineHeight:Et,lineWidth:Yt,controlHeightLG:St}=Je,Gt=Math.round(Ct*Et),Te=(0,Zr.TS)(Je,{uploadThumbnailSize:pt*2,uploadProgressOffset:Gt/2+Yt,uploadPicCardSize:St*2.55});return[Le(Te),Dr(Te),wr(Te),Qe(Te),Nr(Te),or(Te),Ae(Te),(0,Pr.Z)(Te)]},Je=>({actionsColor:Je.colorTextDescription})),We=function(Je,pt,Ct,Et){function Yt(St){return St instanceof Ct?St:new Ct(function(Gt){Gt(St)})}return new(Ct||(Ct=Promise))(function(St,Gt){function Te(Tt){try{ft(Et.next(Tt))}catch(_t){Gt(_t)}}function dt(Tt){try{ft(Et.throw(Tt))}catch(_t){Gt(_t)}}function ft(Tt){Tt.done?St(Tt.value):Yt(Tt.value).then(Te,dt)}ft((Et=Et.apply(Je,pt||[])).next())})};const it=`__LIST_IGNORE_${Date.now()}__`,Nt=(Je,pt)=>{const{fileList:Ct,defaultFileList:Et,onRemove:Yt,showUploadList:St=!0,listType:Gt="text",onPreview:Te,onDownload:dt,onChange:ft,onDrop:Tt,previewFile:_t,disabled:Pt,locale:Bt,iconRender:un,isImageUrl:yn,progress:_n,prefixCls:$n,className:qn,type:sr="select",children:jn,style:Ln,itemRender:ur,maxCount:Qn,data:mr={},multiple:Vn=!1,action:Un="",accept:br="",supportServerRender:lr=!0,rootClassName:Ir}=Je,Ur=pe.useContext(ze.Z),rr=Pt!=null?Pt:Ur,[Cn,Sn]=(0,Kt.Z)(Et||[],{value:Ct,postState:Gr=>Gr!=null?Gr:[]}),[fr,er]=pe.useState("drop"),Mr=pe.useRef(null);pe.useMemo(()=>{const Gr=Date.now();(Ct||[]).forEach((ei,Ai)=>{!ei.uid&&!Object.isFrozen(ei)&&(ei.uid=`__AUTO__${Gr}_${Ai}__`)})},[Ct]);const _r=(Gr,ei,Ai)=>{let ai=(0,ut.Z)(ei),fi=!1;Qn===1?ai=ai.slice(-1):Qn&&(fi=ai.length>Qn,ai=ai.slice(0,Qn)),(0,Xt.flushSync)(()=>{Sn(ai)});const _i={file:Gr,fileList:ai};Ai&&(_i.event=Ai),(!fi||ai.some(pi=>pi.uid===Gr.uid))&&(0,Xt.flushSync)(()=>{ft==null||ft(_i)})},Ar=(Gr,ei)=>We(void 0,void 0,void 0,function*(){const{beforeUpload:Ai,transformFile:ai}=Je;let fi=Gr;if(Ai){const _i=yield Ai(Gr,ei);if(_i===!1)return!1;if(delete Gr[it],_i===it)return Object.defineProperty(Gr,it,{value:!0,configurable:!0}),!1;typeof _i=="object"&&_i&&(fi=_i)}return ai&&(fi=yield ai(fi)),fi}),dr=Gr=>{const ei=Gr.filter(fi=>!fi.file[it]);if(!ei.length)return;const Ai=ei.map(fi=>nn(fi.file));let ai=(0,ut.Z)(Cn);Ai.forEach(fi=>{ai=wn(fi,ai)}),Ai.forEach((fi,_i)=>{let pi=fi;if(ei[_i].parsedFile)fi.status="uploading";else{const{originFileObj:Tr}=fi;let Xr;try{Xr=new File([Tr],Tr.name,{type:Tr.type})}catch(Vr){Xr=new Blob([Tr],{type:Tr.type}),Xr.name=Tr.name,Xr.lastModifiedDate=new Date,Xr.lastModified=new Date().getTime()}Xr.uid=fi.uid,pi=Xr}_r(pi,ai)})},Sr=(Gr,ei,Ai)=>{try{typeof Gr=="string"&&(Gr=JSON.parse(Gr))}catch(_i){}if(!mn(ei,Cn))return;const ai=nn(ei);ai.status="done",ai.percent=100,ai.response=Gr,ai.xhr=Ai;const fi=wn(ai,Cn);_r(ai,fi)},ii=(Gr,ei)=>{if(!mn(ei,Cn))return;const Ai=nn(ei);Ai.status="uploading",Ai.percent=Gr.percent;const ai=wn(Ai,Cn);_r(Ai,ai,Gr)},zn=(Gr,ei,Ai)=>{if(!mn(Ai,Cn))return;const ai=nn(Ai);ai.error=Gr,ai.response=ei,ai.status="error";const fi=wn(ai,Cn);_r(ai,fi)},Xn=Gr=>{let ei;Promise.resolve(typeof Yt=="function"?Yt(Gr):Yt).then(Ai=>{var ai;if(Ai===!1)return;const fi=En(Gr,Cn);fi&&(ei=Object.assign(Object.assign({},Gr),{status:"removed"}),Cn==null||Cn.forEach(_i=>{const pi=ei.uid!==void 0?"uid":"name";_i[pi]===ei[pi]&&!Object.isFrozen(_i)&&(_i.status="removed")}),(ai=Mr.current)===null||ai===void 0||ai.abort(ei),_r(ei,fi))})},kr=Gr=>{er(Gr.type),Gr.type==="drop"&&(Tt==null||Tt(Gr))};pe.useImperativeHandle(pt,()=>({onBatchStart:dr,onSuccess:Sr,onProgress:ii,onError:zn,fileList:Cn,upload:Mr.current}));const{getPrefixCls:Br,direction:li,upload:di}=pe.useContext(Wt.E_),ri=Br("upload",$n),Yr=Object.assign(Object.assign({onBatchStart:dr,onError:zn,onProgress:ii,onSuccess:Sr},Je),{data:mr,multiple:Vn,action:Un,accept:br,supportServerRender:lr,prefixCls:ri,disabled:rr,beforeUpload:Ar,onChange:void 0});delete Yr.className,delete Yr.style,(!jn||rr)&&delete Yr.id;const[yi,bi]=De(ri),[Gn]=(0,xe.Z)("Upload",bt.Z.Upload),{showRemoveIcon:Wn,showPreviewIcon:Hn,showDownloadIcon:hr,removeIcon:ni,previewIcon:xi,downloadIcon:Mi}=typeof St=="boolean"?{}:St,gi=(Gr,ei)=>St?pe.createElement(Tn,{prefixCls:ri,listType:Gt,items:Cn,previewFile:_t,onPreview:Te,onDownload:dt,onRemove:Xn,showRemoveIcon:!rr&&Wn,showPreviewIcon:Hn,showDownloadIcon:hr,removeIcon:ni,previewIcon:xi,downloadIcon:Mi,iconRender:un,locale:Object.assign(Object.assign({},Gn),Bt),isImageUrl:yn,progress:_n,appendAction:Gr,appendActionVisible:ei,itemRender:ur,disabled:rr}):Gr,ci=ct()(`${ri}-wrapper`,qn,Ir,bi,di==null?void 0:di.className,{[`${ri}-rtl`]:li==="rtl",[`${ri}-picture-card-wrapper`]:Gt==="picture-card",[`${ri}-picture-circle-wrapper`]:Gt==="picture-circle"}),ki=Object.assign(Object.assign({},di==null?void 0:di.style),Ln);if(sr==="drag"){const Gr=ct()(bi,ri,`${ri}-drag`,{[`${ri}-drag-uploading`]:Cn.some(ei=>ei.status==="uploading"),[`${ri}-drag-hover`]:fr==="dragover",[`${ri}-disabled`]:rr,[`${ri}-rtl`]:li==="rtl"});return yi(pe.createElement("span",{className:ci},pe.createElement("div",{className:Gr,style:ki,onDrop:kr,onDragOver:kr,onDragLeave:kr},pe.createElement(cn,Object.assign({},Yr,{ref:Mr,className:`${ri}-btn`}),pe.createElement("div",{className:`${ri}-drag-container`},jn))),gi()))}const Hi=ct()(ri,`${ri}-select`,{[`${ri}-disabled`]:rr}),oa=(Gr=>pe.createElement("div",{className:Hi,style:Gr},pe.createElement(cn,Object.assign({},Yr,{ref:Mr}))))(jn?void 0:{display:"none"});return yi(Gt==="picture-card"||Gt==="picture-circle"?pe.createElement("span",{className:ci},gi(oa,!!jn)):pe.createElement("span",{className:ci},oa,gi()))};var $t=pe.forwardRef(Nt),sn=function(Je,pt){var Ct={};for(var Et in Je)Object.prototype.hasOwnProperty.call(Je,Et)&&pt.indexOf(Et)<0&&(Ct[Et]=Je[Et]);if(Je!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Yt=0,Et=Object.getOwnPropertySymbols(Je);Yt<Et.length;Yt++)pt.indexOf(Et[Yt])<0&&Object.prototype.propertyIsEnumerable.call(Je,Et[Yt])&&(Ct[Et[Yt]]=Je[Et[Yt]]);return Ct},xn=pe.forwardRef((Je,pt)=>{var{style:Ct,height:Et}=Je,Yt=sn(Je,["style","height"]);return pe.createElement($t,Object.assign({ref:pt},Yt,{type:"drag",style:Object.assign(Object.assign({},Ct),{height:Et})}))});const Mt=$t;Mt.Dragger=xn,Mt.LIST_IGNORE=it;var rn=Mt},99498:function(kn,dn,de){(function(pe){pe(de(89780))})(function(pe){pe.defineOption("placeholder","",function(Ce,ke,Fe){var gt=Fe&&Fe!=pe.Init;if(ke&&!gt)Ce.on("blur",Se),Ce.on("change",Pe),Ce.on("swapDoc",Pe),pe.on(Ce.getInputField(),"compositionupdate",Ce.state.placeholderCompose=function(){ct(Ce)}),Pe(Ce);else if(!ke&&gt){Ce.off("blur",Se),Ce.off("change",Pe),Ce.off("swapDoc",Pe),pe.off(Ce.getInputField(),"compositionupdate",Ce.state.placeholderCompose),ut(Ce);var Oe=Ce.getWrapperElement();Oe.className=Oe.className.replace(" CodeMirror-empty","")}ke&&!Ce.hasFocus()&&Se(Ce)});function ut(Ce){Ce.state.placeholder&&(Ce.state.placeholder.parentNode.removeChild(Ce.state.placeholder),Ce.state.placeholder=null)}function $e(Ce){ut(Ce);var ke=Ce.state.placeholder=document.createElement("pre");ke.style.cssText="height: 0; overflow: visible",ke.style.direction=Ce.getOption("direction"),ke.className="CodeMirror-placeholder CodeMirror-line-like";var Fe=Ce.getOption("placeholder");typeof Fe=="string"&&(Fe=document.createTextNode(Fe)),ke.appendChild(Fe),Ce.display.lineSpace.insertBefore(ke,Ce.display.lineSpace.firstChild)}function ct(Ce){setTimeout(function(){var ke=!1,Fe=Ce.getInputField();Fe.nodeName=="TEXTAREA"?ke=!Fe.value:Ce.lineCount()==1&&(ke=!/[^\u200b]/.test(Fe.querySelector(".CodeMirror-line").textContent)),ke?$e(Ce):ut(Ce)},20)}function Se(Ce){Ne(Ce)&&$e(Ce)}function Pe(Ce){var ke=Ce.getWrapperElement(),Fe=Ne(Ce);ke.className=ke.className.replace(" CodeMirror-empty","")+(Fe?" CodeMirror-empty":""),Fe?$e(Ce):ut(Ce)}function Ne(Ce){return Ce.lineCount()===1&&Ce.getLine(0)===""}})},25717:function(kn,dn,de){(function(pe){pe(de(89780))})(function(pe){var ut={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},$e=pe.Pos;pe.defineOption("autoCloseBrackets",!1,function(et,mt,st){st&&st!=pe.Init&&(et.removeKeyMap(Se),et.state.closeBrackets=null),mt&&(Pe(ct(mt,"pairs")),et.state.closeBrackets=mt,et.addKeyMap(Se))});function ct(et,mt){return mt=="pairs"&&typeof et=="string"?et:typeof et=="object"&&et[mt]!=null?et[mt]:ut[mt]}var Se={Backspace:ke,Enter:Fe};function Pe(et){for(var mt=0;mt<et.length;mt++){var st=et.charAt(mt),Rt="'"+st+"'";Se[Rt]||(Se[Rt]=Ne(st))}}Pe(ut.pairs+"`");function Ne(et){return function(mt){return Oe(mt,et)}}function Ce(et){var mt=et.state.closeBrackets;if(!mt||mt.override)return mt;var st=et.getModeAt(et.getCursor());return st.closeBrackets||mt}function ke(et){var mt=Ce(et);if(!mt||et.getOption("disableInput"))return pe.Pass;for(var st=ct(mt,"pairs"),Rt=et.listSelections(),tn=0;tn<Rt.length;tn++){if(!Rt[tn].empty())return pe.Pass;var nt=je(et,Rt[tn].head);if(!nt||st.indexOf(nt)%2!=0)return pe.Pass}for(var tn=Rt.length-1;tn>=0;tn--){var ht=Rt[tn].head;et.replaceRange("",$e(ht.line,ht.ch-1),$e(ht.line,ht.ch+1),"+delete")}}function Fe(et){var mt=Ce(et),st=mt&&ct(mt,"explode");if(!st||et.getOption("disableInput"))return pe.Pass;for(var Rt=et.listSelections(),tn=0;tn<Rt.length;tn++){if(!Rt[tn].empty())return pe.Pass;var nt=je(et,Rt[tn].head);if(!nt||st.indexOf(nt)%2!=0)return pe.Pass}et.operation(function(){var ht=et.lineSeparator()||`
`;et.replaceSelection(ht+ht,null),et.execCommand("goCharLeft"),Rt=et.listSelections();for(var Ve=0;Ve<Rt.length;Ve++){var Ee=Rt[Ve].head.line;et.indentLine(Ee,null,!0),et.indentLine(Ee+1,null,!0)}})}function gt(et){var mt=pe.cmpPos(et.anchor,et.head)>0;return{anchor:new $e(et.anchor.line,et.anchor.ch+(mt?-1:1)),head:new $e(et.head.line,et.head.ch+(mt?1:-1))}}function Oe(et,mt){var st=Ce(et);if(!st||et.getOption("disableInput"))return pe.Pass;var Rt=ct(st,"pairs"),tn=Rt.indexOf(mt);if(tn==-1)return pe.Pass;for(var nt=ct(st,"closeBefore"),ht=ct(st,"triples"),Ve=Rt.charAt(tn+1)==mt,Ee=et.listSelections(),Xe=tn%2==0,at,vt=0;vt<Ee.length;vt++){var Ue=Ee[vt],Ot=Ue.head,rt,At=et.getRange(Ot,$e(Ot.line,Ot.ch+1));if(Xe&&!Ue.empty())rt="surround";else if((Ve||!Xe)&&At==mt)Ve&&kt(et,Ot)?rt="both":ht.indexOf(mt)>=0&&et.getRange(Ot,$e(Ot.line,Ot.ch+3))==mt+mt+mt?rt="skipThree":rt="skip";else if(Ve&&Ot.ch>1&&ht.indexOf(mt)>=0&&et.getRange($e(Ot.line,Ot.ch-2),Ot)==mt+mt){if(Ot.ch>2&&/\bstring/.test(et.getTokenTypeAt($e(Ot.line,Ot.ch-2))))return pe.Pass;rt="addFour"}else if(Ve){var qe=Ot.ch==0?" ":et.getRange($e(Ot.line,Ot.ch-1),Ot);if(!pe.isWordChar(At)&&qe!=mt&&!pe.isWordChar(qe))rt="both";else return pe.Pass}else if(Xe&&(At.length===0||/\s/.test(At)||nt.indexOf(At)>-1))rt="both";else return pe.Pass;if(!at)at=rt;else if(at!=rt)return pe.Pass}var Ht=tn%2?Rt.charAt(tn-1):mt,cn=tn%2?mt:Rt.charAt(tn+1);et.operation(function(){if(at=="skip")et.execCommand("goCharRight");else if(at=="skipThree")for(var Kt=0;Kt<3;Kt++)et.execCommand("goCharRight");else if(at=="surround"){for(var Xt=et.getSelections(),Kt=0;Kt<Xt.length;Kt++)Xt[Kt]=Ht+Xt[Kt]+cn;et.replaceSelections(Xt,"around"),Xt=et.listSelections().slice();for(var Kt=0;Kt<Xt.length;Kt++)Xt[Kt]=gt(Xt[Kt]);et.setSelections(Xt)}else at=="both"?(et.replaceSelection(Ht+cn,null),et.triggerElectric(Ht+cn),et.execCommand("goCharLeft")):at=="addFour"&&(et.replaceSelection(Ht+Ht+Ht+Ht,"before"),et.execCommand("goCharRight"))})}function je(et,mt){var st=et.getRange($e(mt.line,mt.ch-1),$e(mt.line,mt.ch+1));return st.length==2?st:null}function kt(et,mt){var st=et.getTokenAt($e(mt.line,mt.ch+1));return/\bstring/.test(st.type)&&st.start==mt.ch&&(mt.ch==0||!/\bstring/.test(et.getTokenTypeAt(mt)))}})},6313:function(kn,dn,de){(function(pe){pe(de(89780),de(32855))})(function(pe){pe.defineOption("autoCloseTags",!1,function(ke,Fe,gt){if(gt!=pe.Init&&gt&&ke.removeKeyMap("autoCloseTags"),!!Fe){var Oe={name:"autoCloseTags"};(typeof Fe!="object"||Fe.whenClosing!==!1)&&(Oe["'/'"]=function(je){return Pe(je)}),(typeof Fe!="object"||Fe.whenOpening!==!1)&&(Oe["'>'"]=function(je){return ct(je)}),ke.addKeyMap(Oe)}});var ut=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],$e=["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 ct(ke){if(ke.getOption("disableInput"))return pe.Pass;for(var Fe=ke.listSelections(),gt=[],Oe=ke.getOption("autoCloseTags"),je=0;je<Fe.length;je++){if(!Fe[je].empty())return pe.Pass;var kt=Fe[je].head,et=ke.getTokenAt(kt),mt=pe.innerMode(ke.getMode(),et.state),st=mt.state,Rt=mt.mode.xmlCurrentTag&&mt.mode.xmlCurrentTag(st),tn=Rt&&Rt.name;if(!tn)return pe.Pass;var nt=mt.mode.configuration=="html",ht=typeof Oe=="object"&&Oe.dontCloseTags||nt&&ut,Ve=typeof Oe=="object"&&Oe.indentTags||nt&&$e;et.end>kt.ch&&(tn=tn.slice(0,tn.length-et.end+kt.ch));var Ee=tn.toLowerCase();if(!tn||et.type=="string"&&(et.end!=kt.ch||!/[\"\']/.test(et.string.charAt(et.string.length-1))||et.string.length==1)||et.type=="tag"&&Rt.close||et.string.indexOf("/")==kt.ch-et.start-1||ht&&Ne(ht,Ee)>-1||Ce(ke,mt.mode.xmlCurrentContext&&mt.mode.xmlCurrentContext(st)||[],tn,kt,!0))return pe.Pass;var Xe=typeof Oe=="object"&&Oe.emptyTags;if(Xe&&Ne(Xe,tn)>-1){gt[je]={text:"/>",newPos:pe.Pos(kt.line,kt.ch+2)};continue}var at=Ve&&Ne(Ve,Ee)>-1;gt[je]={indent:at,text:">"+(at?`
`:"")+"</"+tn+">",newPos:at?pe.Pos(kt.line+1,0):pe.Pos(kt.line,kt.ch+1)}}for(var vt=typeof Oe=="object"&&Oe.dontIndentOnAutoClose,je=Fe.length-1;je>=0;je--){var Ue=gt[je];ke.replaceRange(Ue.text,Fe[je].head,Fe[je].anchor,"+insert");var Ot=ke.listSelections().slice(0);Ot[je]={head:Ue.newPos,anchor:Ue.newPos},ke.setSelections(Ot),!vt&&Ue.indent&&(ke.indentLine(Ue.newPos.line,null,!0),ke.indentLine(Ue.newPos.line+1,null,!0))}}function Se(ke,Fe){for(var gt=ke.listSelections(),Oe=[],je=Fe?"/":"</",kt=ke.getOption("autoCloseTags"),et=typeof kt=="object"&&kt.dontIndentOnSlash,mt=0;mt<gt.length;mt++){if(!gt[mt].empty())return pe.Pass;var st=gt[mt].head,Rt=ke.getTokenAt(st),tn=pe.innerMode(ke.getMode(),Rt.state),nt=tn.state;if(Fe&&(Rt.type=="string"||Rt.string.charAt(0)!="<"||Rt.start!=st.ch-1))return pe.Pass;var ht,Ve=tn.mode.name!="xml"&&ke.getMode().name=="htmlmixed";if(Ve&&tn.mode.name=="javascript")ht=je+"script";else if(Ve&&tn.mode.name=="css")ht=je+"style";else{var Ee=tn.mode.xmlCurrentContext&&tn.mode.xmlCurrentContext(nt);if(!Ee||Ee.length&&Ce(ke,Ee,Ee[Ee.length-1],st))return pe.Pass;ht=je+Ee[Ee.length-1]}ke.getLine(st.line).charAt(Rt.end)!=">"&&(ht+=">"),Oe[mt]=ht}if(ke.replaceSelections(Oe),gt=ke.listSelections(),!et)for(var mt=0;mt<gt.length;mt++)(mt==gt.length-1||gt[mt].head.line<gt[mt+1].head.line)&&ke.indentLine(gt[mt].head.line)}function Pe(ke){return ke.getOption("disableInput")?pe.Pass:Se(ke,!0)}pe.commands.closeTag=function(ke){return Se(ke)};function Ne(ke,Fe){if(ke.indexOf)return ke.indexOf(Fe);for(var gt=0,Oe=ke.length;gt<Oe;++gt)if(ke[gt]==Fe)return gt;return-1}function Ce(ke,Fe,gt,Oe,je){if(!pe.scanForClosingTag)return!1;var kt=Math.min(ke.lastLine()+1,Oe.line+500),et=pe.scanForClosingTag(ke,Oe,null,kt);if(!et||et.tag!=gt)return!1;for(var mt=je?1:0,st=Fe.length-1;st>=0&&Fe[st]==gt;st--)++mt;Oe=et.to;for(var st=1;st<mt;st++){var Rt=pe.scanForClosingTag(ke,Oe,null,kt);if(!Rt||Rt.tag!=gt)return!1;Oe=Rt.to}return!0}})},32855:function(kn,dn,de){(function(pe){pe(de(89780))})(function(pe){"use strict";var ut=pe.Pos;function $e(st,Rt){return st.line-Rt.line||st.ch-Rt.ch}var ct="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",Se=ct+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Pe=new RegExp("<(/?)(["+ct+"]["+Se+"]*)","g");function Ne(st,Rt,tn,nt){this.line=Rt,this.ch=tn,this.cm=st,this.text=st.getLine(Rt),this.min=nt?Math.max(nt.from,st.firstLine()):st.firstLine(),this.max=nt?Math.min(nt.to-1,st.lastLine()):st.lastLine()}function Ce(st,Rt){var tn=st.cm.getTokenTypeAt(ut(st.line,Rt));return tn&&/\btag\b/.test(tn)}function ke(st){if(!(st.line>=st.max))return st.ch=0,st.text=st.cm.getLine(++st.line),!0}function Fe(st){if(!(st.line<=st.min))return st.text=st.cm.getLine(--st.line),st.ch=st.text.length,!0}function gt(st){for(;;){var Rt=st.text.indexOf(">",st.ch);if(Rt==-1){if(ke(st))continue;return}if(!Ce(st,Rt+1)){st.ch=Rt+1;continue}var tn=st.text.lastIndexOf("/",Rt),nt=tn>-1&&!/\S/.test(st.text.slice(tn+1,Rt));return st.ch=Rt+1,nt?"selfClose":"regular"}}function Oe(st){for(;;){var Rt=st.ch?st.text.lastIndexOf("<",st.ch-1):-1;if(Rt==-1){if(Fe(st))continue;return}if(!Ce(st,Rt+1)){st.ch=Rt;continue}Pe.lastIndex=Rt,st.ch=Rt;var tn=Pe.exec(st.text);if(tn&&tn.index==Rt)return tn}}function je(st){for(;;){Pe.lastIndex=st.ch;var Rt=Pe.exec(st.text);if(!Rt){if(ke(st))continue;return}if(!Ce(st,Rt.index+1)){st.ch=Rt.index+1;continue}return st.ch=Rt.index+Rt[0].length,Rt}}function kt(st){for(;;){var Rt=st.ch?st.text.lastIndexOf(">",st.ch-1):-1;if(Rt==-1){if(Fe(st))continue;return}if(!Ce(st,Rt+1)){st.ch=Rt;continue}var tn=st.text.lastIndexOf("/",Rt),nt=tn>-1&&!/\S/.test(st.text.slice(tn+1,Rt));return st.ch=Rt+1,nt?"selfClose":"regular"}}function et(st,Rt){for(var tn=[];;){var nt=je(st),ht,Ve=st.line,Ee=st.ch-(nt?nt[0].length:0);if(!nt||!(ht=gt(st)))return;if(ht!="selfClose")if(nt[1]){for(var Xe=tn.length-1;Xe>=0;--Xe)if(tn[Xe]==nt[2]){tn.length=Xe;break}if(Xe<0&&(!Rt||Rt==nt[2]))return{tag:nt[2],from:ut(Ve,Ee),to:ut(st.line,st.ch)}}else tn.push(nt[2])}}function mt(st,Rt){for(var tn=[];;){var nt=kt(st);if(!nt)return;if(nt=="selfClose"){Oe(st);continue}var ht=st.line,Ve=st.ch,Ee=Oe(st);if(!Ee)return;if(Ee[1])tn.push(Ee[2]);else{for(var Xe=tn.length-1;Xe>=0;--Xe)if(tn[Xe]==Ee[2]){tn.length=Xe;break}if(Xe<0&&(!Rt||Rt==Ee[2]))return{tag:Ee[2],from:ut(st.line,st.ch),to:ut(ht,Ve)}}}}pe.registerHelper("fold","xml",function(st,Rt){for(var tn=new Ne(st,Rt.line,0);;){var nt=je(tn);if(!nt||tn.line!=Rt.line)return;var ht=gt(tn);if(!ht)return;if(!nt[1]&&ht!="selfClose"){var Ve=ut(tn.line,tn.ch),Ee=et(tn,nt[2]);return Ee&&$e(Ee.from,Ve)>0?{from:Ve,to:Ee.from}:null}}}),pe.findMatchingTag=function(st,Rt,tn){var nt=new Ne(st,Rt.line,Rt.ch,tn);if(!(nt.text.indexOf(">")==-1&&nt.text.indexOf("<")==-1)){var ht=gt(nt),Ve=ht&&ut(nt.line,nt.ch),Ee=ht&&Oe(nt);if(!(!ht||!Ee||$e(nt,Rt)>0)){var Xe={from:ut(nt.line,nt.ch),to:Ve,tag:Ee[2]};return ht=="selfClose"?{open:Xe,close:null,at:"open"}:Ee[1]?{open:mt(nt,Ee[2]),close:Xe,at:"close"}:(nt=new Ne(st,Ve.line,Ve.ch,tn),{open:Xe,close:et(nt,Ee[2]),at:"open"})}}},pe.findEnclosingTag=function(st,Rt,tn,nt){for(var ht=new Ne(st,Rt.line,Rt.ch,tn);;){var Ve=mt(ht,nt);if(!Ve)break;var Ee=new Ne(st,Rt.line,Rt.ch,tn),Xe=et(Ee,Ve.tag);if(Xe)return{open:Ve,close:Xe}}},pe.scanForClosingTag=function(st,Rt,tn,nt){var ht=new Ne(st,Rt.line,Rt.ch,nt?{from:0,to:nt}:null);return et(ht,tn)}})},89780:function(kn){(function(dn,de){kn.exports=de()})(this,function(){"use strict";var dn=navigator.userAgent,de=navigator.platform,pe=/gecko\/\d/i.test(dn),ut=/MSIE \d/.test(dn),$e=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(dn),ct=/Edge\/(\d+)/.exec(dn),Se=ut||$e||ct,Pe=Se&&(ut?document.documentMode||6:+(ct||$e)[1]),Ne=!ct&&/WebKit\//.test(dn),Ce=Ne&&/Qt\/\d+\.\d+/.test(dn),ke=!ct&&/Chrome\//.test(dn),Fe=/Opera\//.test(dn),gt=/Apple Computer/.test(navigator.vendor),Oe=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(dn),je=/PhantomJS/.test(dn),kt=!ct&&/AppleWebKit/.test(dn)&&/Mobile\/\w+/.test(dn),et=/Android/.test(dn),mt=kt||et||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(dn),st=kt||/Mac/.test(de),Rt=/\bCrOS\b/.test(dn),tn=/win/i.test(de),nt=Fe&&dn.match(/Version\/(\d*\.\d*)/);nt&&(nt=Number(nt[1])),nt&&nt>=15&&(Fe=!1,Ne=!0);var ht=st&&(Ce||Fe&&(nt==null||nt<12.11)),Ve=pe||Se&&Pe>=9;function Ee(x){return new RegExp("(^|\\s)"+x+"(?:$|\\s)\\s*")}var Xe=function(x,z){var ne=x.className,te=Ee(z).exec(ne);if(te){var ie=ne.slice(te.index+te[0].length);x.className=ne.slice(0,te.index)+(ie?te[1]+ie:"")}};function at(x){for(var z=x.childNodes.length;z>0;--z)x.removeChild(x.firstChild);return x}function vt(x,z){return at(x).appendChild(z)}function Ue(x,z,ne,te){var ie=document.createElement(x);if(ne&&(ie.className=ne),te&&(ie.style.cssText=te),typeof z=="string")ie.appendChild(document.createTextNode(z));else if(z)for(var le=0;le<z.length;++le)ie.appendChild(z[le]);return ie}function Ot(x,z,ne,te){var ie=Ue(x,z,ne,te);return ie.setAttribute("role","presentation"),ie}var rt;document.createRange?rt=function(x,z,ne,te){var ie=document.createRange();return ie.setEnd(te||x,ne),ie.setStart(x,z),ie}:rt=function(x,z,ne){var te=document.body.createTextRange();try{te.moveToElementText(x.parentNode)}catch(ie){return te}return te.collapse(!0),te.moveEnd("character",ne),te.moveStart("character",z),te};function At(x,z){if(z.nodeType==3&&(z=z.parentNode),x.contains)return x.contains(z);do if(z.nodeType==11&&(z=z.host),z==x)return!0;while(z=z.parentNode)}function qe(){var x;try{x=document.activeElement}catch(z){x=document.body||null}for(;x&&x.shadowRoot&&x.shadowRoot.activeElement;)x=x.shadowRoot.activeElement;return x}function Ht(x,z){var ne=x.className;Ee(z).test(ne)||(x.className+=(ne?" ":"")+z)}function cn(x,z){for(var ne=x.split(" "),te=0;te<ne.length;te++)ne[te]&&!Ee(ne[te]).test(z)&&(z+=" "+ne[te]);return z}var Kt=function(x){x.select()};kt?Kt=function(x){x.selectionStart=0,x.selectionEnd=x.value.length}:Se&&(Kt=function(x){try{x.select()}catch(z){}});function Xt(x){var z=Array.prototype.slice.call(arguments,1);return function(){return x.apply(null,z)}}function Wt(x,z,ne){z||(z={});for(var te in x)x.hasOwnProperty(te)&&(ne!==!1||!z.hasOwnProperty(te))&&(z[te]=x[te]);return z}function ze(x,z,ne,te,ie){z==null&&(z=x.search(/[^\s\u00a0]/),z==-1&&(z=x.length));for(var le=te||0,me=ie||0;;){var we=x.indexOf(" ",le);if(we<0||we>=z)return me+(z-le);me+=we-le,me+=ne-me%ne,le=we+1}}var xe=function(){this.id=null,this.f=null,this.time=0,this.handler=Xt(this.onTimeout,this)};xe.prototype.onTimeout=function(x){x.id=0,x.time<=+new Date?x.f():setTimeout(x.handler,x.time-+new Date)},xe.prototype.set=function(x,z){this.f=z;var ne=+new Date+x;(!this.id||ne<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,x),this.time=ne)};function bt(x,z){for(var ne=0;ne<x.length;++ne)if(x[ne]==z)return ne;return-1}var pn=50,Ut={toString:function(){return"CodeMirror.Pass"}},Ge={scroll:!1},Ye={origin:"*mouse"},It={origin:"+move"};function Mn(x,z,ne){for(var te=0,ie=0;;){var le=x.indexOf(" ",te);le==-1&&(le=x.length);var me=le-te;if(le==x.length||ie+me>=z)return te+Math.min(me,z-ie);if(ie+=le-te,ie+=ne-ie%ne,te=le+1,ie>=z)return te}}var jt=[""];function bn(x){for(;jt.length<=x;)jt.push(Vt(jt)+" ");return jt[x]}function Vt(x){return x[x.length-1]}function Zt(x,z){for(var ne=[],te=0;te<x.length;te++)ne[te]=z(x[te],te);return ne}function zt(x,z,ne){for(var te=0,ie=ne(z);te<x.length&&ne(x[te])<=ie;)te++;x.splice(te,0,z)}function ve(){}function se(x,z){var ne;return Object.create?ne=Object.create(x):(ve.prototype=x,ne=new ve),z&&Wt(z,ne),ne}var oe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function fe(x){return/\w/.test(x)||x>"\x80"&&(x.toUpperCase()!=x.toLowerCase()||oe.test(x))}function ye(x,z){return z?z.source.indexOf("\\w")>-1&&fe(x)?!0:z.test(x):fe(x)}function ce(x){for(var z in x)if(x.hasOwnProperty(z)&&x[z])return!1;return!0}var Ke=/[\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 Dt(x){return x.charCodeAt(0)>=768&&Ke.test(x)}function ln(x,z,ne){for(;(ne<0?z>0:z<x.length)&&Dt(x.charAt(z));)z+=ne;return z}function Jt(x,z,ne){for(var te=z>ne?-1:1;;){if(z==ne)return z;var ie=(z+ne)/2,le=te<0?Math.ceil(ie):Math.floor(ie);if(le==z)return x(le)?z:ne;x(le)?ne=le:z=le+te}}function en(x,z,ne,te){if(!x)return te(z,ne,"ltr",0);for(var ie=!1,le=0;le<x.length;++le){var me=x[le];(me.from<ne&&me.to>z||z==ne&&me.to==z)&&(te(Math.max(me.from,z),Math.min(me.to,ne),me.level==1?"rtl":"ltr",le),ie=!0)}ie||te(z,ne,"ltr")}var nn=null;function wn(x,z,ne){var te;nn=null;for(var ie=0;ie<x.length;++ie){var le=x[ie];if(le.from<z&&le.to>z)return ie;le.to==z&&(le.from!=le.to&&ne=="before"?te=ie:nn=ie),le.from==z&&(le.from!=le.to&&ne!="before"?te=ie:nn=ie)}return te!=null?te:nn}var mn=function(){var x="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",z="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function ne(Ie){return Ie<=247?x.charAt(Ie):1424<=Ie&&Ie<=1524?"R":1536<=Ie&&Ie<=1785?z.charAt(Ie-1536):1774<=Ie&&Ie<=2220?"r":8192<=Ie&&Ie<=8203?"w":Ie==8204?"b":"L"}var te=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,ie=/[stwN]/,le=/[LRr]/,me=/[Lb1n]/,we=/[1n]/;function _e(Ie,ot,wt){this.level=Ie,this.from=ot,this.to=wt}return function(Ie,ot){var wt=ot=="ltr"?"L":"R";if(Ie.length==0||ot=="ltr"&&!te.test(Ie))return!1;for(var on=Ie.length,qt=[],An=0;An<on;++An)qt.push(ne(Ie.charCodeAt(An)));for(var Kn=0,pr=wt;Kn<on;++Kn){var Lr=qt[Kn];Lr=="m"?qt[Kn]=pr:pr=Lr}for(var Or=0,Cr=wt;Or<on;++Or){var Fr=qt[Or];Fr=="1"&&Cr=="r"?qt[Or]="n":le.test(Fr)&&(Cr=Fr,Fr=="r"&&(qt[Or]="R"))}for(var Qr=1,ti=qt[0];Qr<on-1;++Qr){var Ci=qt[Qr];Ci=="+"&&ti=="1"&&qt[Qr+1]=="1"?qt[Qr]="1":Ci==","&&ti==qt[Qr+1]&&(ti=="1"||ti=="n")&&(qt[Qr]=ti),ti=Ci}for(var Ji=0;Ji<on;++Ji){var $a=qt[Ji];if($a==",")qt[Ji]="N";else if($a=="%"){var da=void 0;for(da=Ji+1;da<on&&qt[da]=="%";++da);for(var co=Ji&&qt[Ji-1]=="!"||da<on&&qt[da]=="1"?"1":"N",uo=Ji;uo<da;++uo)qt[uo]=co;Ji=da-1}}for(var _a=0,ho=wt;_a<on;++_a){var hi=qt[_a];ho=="L"&&hi=="1"?qt[_a]="L":le.test(hi)&&(ho=hi)}for(var ma=0;ma<on;++ma)if(ie.test(qt[ma])){var ha=void 0;for(ha=ma+1;ha<on&&ie.test(qt[ha]);++ha);for(var ga=(ma?qt[ma-1]:wt)=="L",ba=(ha<on?qt[ha]:wt)=="L",fl=ga==ba?ga?"L":"R":wt,vo=ma;vo<ha;++vo)qt[vo]=fl;ma=ha-1}for(var Za=[],Ri,Ia=0;Ia<on;)if(me.test(qt[Ia])){var au=Ia;for(++Ia;Ia<on&&me.test(qt[Ia]);++Ia);Za.push(new _e(0,au,Ia))}else{var bs=Ia,$s=Za.length,Yo=ot=="rtl"?1:0;for(++Ia;Ia<on&&qt[Ia]!="L";++Ia);for(var ka=bs;ka<Ia;)if(we.test(qt[ka])){bs<ka&&(Za.splice($s,0,new _e(1,bs,ka)),$s+=Yo);var pl=ka;for(++ka;ka<Ia&&we.test(qt[ka]);++ka);Za.splice($s,0,new _e(2,pl,ka)),$s+=Yo,bs=ka}else++ka;bs<Ia&&Za.splice($s,0,new _e(1,bs,Ia))}return ot=="ltr"&&(Za[0].level==1&&(Ri=Ie.match(/^\s+/))&&(Za[0].from=Ri[0].length,Za.unshift(new _e(0,0,Ri[0].length))),Vt(Za).level==1&&(Ri=Ie.match(/\s+$/))&&(Vt(Za).to-=Ri[0].length,Za.push(new _e(0,on-Ri[0].length,on)))),ot=="rtl"?Za.reverse():Za}}();function En(x,z){var ne=x.order;return ne==null&&(ne=x.order=mn(x.text,z)),ne}var yt=[],gn=function(x,z,ne){if(x.addEventListener)x.addEventListener(z,ne,!1);else if(x.attachEvent)x.attachEvent("on"+z,ne);else{var te=x._handlers||(x._handlers={});te[z]=(te[z]||yt).concat(ne)}};function Jn(x,z){return x._handlers&&x._handlers[z]||yt}function tt(x,z,ne){if(x.removeEventListener)x.removeEventListener(z,ne,!1);else if(x.detachEvent)x.detachEvent("on"+z,ne);else{var te=x._handlers,ie=te&&te[z];if(ie){var le=bt(ie,ne);le>-1&&(te[z]=ie.slice(0,le).concat(ie.slice(le+1)))}}}function Re(x,z){var ne=Jn(x,z);if(ne.length)for(var te=Array.prototype.slice.call(arguments,2),ie=0;ie<ne.length;++ie)ne[ie].apply(null,te)}function Ze(x,z,ne){return typeof z=="string"&&(z={type:z,preventDefault:function(){this.defaultPrevented=!0}}),Re(x,ne||z.type,x,z),Nn(z)||z.codemirrorIgnore}function Ft(x){var z=x._handlers&&x._handlers.cursorActivity;if(z)for(var ne=x.curOp.cursorActivityHandlers||(x.curOp.cursorActivityHandlers=[]),te=0;te<z.length;++te)bt(ne,z[te])==-1&&ne.push(z[te])}function Qt(x,z){return Jn(x,z).length>0}function an(x){x.prototype.on=function(z,ne){gn(this,z,ne)},x.prototype.off=function(z,ne){tt(this,z,ne)}}function Pn(x){x.preventDefault?x.preventDefault():x.returnValue=!1}function On(x){x.stopPropagation?x.stopPropagation():x.cancelBubble=!0}function Nn(x){return x.defaultPrevented!=null?x.defaultPrevented:x.returnValue==!1}function Zn(x){Pn(x),On(x)}function tr(x){return x.target||x.srcElement}function Tn(x){var z=x.which;return z==null&&(x.button&1?z=1:x.button&2?z=3:x.button&4&&(z=2)),st&&x.ctrlKey&&z==1&&(z=3),z}var gr=function(){if(Se&&Pe<9)return!1;var x=Ue("div");return"draggable"in x||"dragDrop"in x}(),Pr;function Rr(x){if(Pr==null){var z=Ue("span","\u200B");vt(x,Ue("span",[z,document.createTextNode("x")])),x.firstChild.offsetHeight!=0&&(Pr=z.offsetWidth<=1&&z.offsetHeight>2&&!(Se&&Pe<8))}var ne=Pr?Ue("span","\u200B"):Ue("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return ne.setAttribute("cm-text",""),ne}var Zr;function vr(x){if(Zr!=null)return Zr;var z=vt(x,document.createTextNode("A\u062EA")),ne=rt(z,0,1).getBoundingClientRect(),te=rt(z,1,2).getBoundingClientRect();return at(x),!ne||ne.left==ne.right?!1:Zr=te.right-ne.right<3}var Dr=`
b`.split(/\n/).length!=3?function(x){for(var z=0,ne=[],te=x.length;z<=te;){var ie=x.indexOf(`
`,z);ie==-1&&(ie=x.length);var le=x.slice(z,x.charAt(ie-1)=="\r"?ie-1:ie),me=le.indexOf("\r");me!=-1?(ne.push(le.slice(0,me)),z+=me+1):(ne.push(le),z=ie+1)}return ne}:function(x){return x.split(/\r\n?|\n/)},yr=window.getSelection?function(x){try{return x.selectionStart!=x.selectionEnd}catch(z){return!1}}:function(x){var z;try{z=x.ownerDocument.selection.createRange()}catch(ne){}return!z||z.parentElement()!=x?!1:z.compareEndPoints("StartToEnd",z)!=0},Nr=function(){var x=Ue("div");return"oncopy"in x?!0:(x.setAttribute("oncopy","return;"),typeof x.oncopy=="function")}(),Wr=null;function Er(x){if(Wr!=null)return Wr;var z=vt(x,Ue("span","x")),ne=z.getBoundingClientRect(),te=rt(z,0,1).getBoundingClientRect();return Wr=Math.abs(ne.left-te.left)>1}var qr={},zr={};function ar(x,z){arguments.length>2&&(z.dependencies=Array.prototype.slice.call(arguments,2)),qr[x]=z}function or(x,z){zr[x]=z}function Bn(x){if(typeof x=="string"&&zr.hasOwnProperty(x))x=zr[x];else if(x&&typeof x.name=="string"&&zr.hasOwnProperty(x.name)){var z=zr[x.name];typeof z=="string"&&(z={name:z}),x=se(z,x),x.name=z.name}else{if(typeof x=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(x))return Bn("application/xml");if(typeof x=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(x))return Bn("application/json")}return typeof x=="string"?{name:x}:x||{name:"null"}}function In(x,z){z=Bn(z);var ne=qr[z.name];if(!ne)return In(x,"text/plain");var te=ne(x,z);if(wr.hasOwnProperty(z.name)){var ie=wr[z.name];for(var le in ie)ie.hasOwnProperty(le)&&(te.hasOwnProperty(le)&&(te["_"+le]=te[le]),te[le]=ie[le])}if(te.name=z.name,z.helperType&&(te.helperType=z.helperType),z.modeProps)for(var me in z.modeProps)te[me]=z.modeProps[me];return te}var wr={};function Qe(x,z){var ne=wr.hasOwnProperty(x)?wr[x]:wr[x]={};Wt(z,ne)}function Me(x,z){if(z===!0)return z;if(x.copyState)return x.copyState(z);var ne={};for(var te in z){var ie=z[te];ie instanceof Array&&(ie=ie.concat([])),ne[te]=ie}return ne}function Ae(x,z){for(var ne;x.innerMode&&(ne=x.innerMode(z),!(!ne||ne.mode==x));)z=ne.state,x=ne.mode;return ne||{mode:x,state:z}}function Le(x,z,ne){return x.startState?x.startState(z,ne):!0}var De=function(x,z,ne){this.pos=this.start=0,this.string=x,this.tabSize=z||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=ne};De.prototype.eol=function(){return this.pos>=this.string.length},De.prototype.sol=function(){return this.pos==this.lineStart},De.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},De.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},De.prototype.eat=function(x){var z=this.string.charAt(this.pos),ne;if(typeof x=="string"?ne=z==x:ne=z&&(x.test?x.test(z):x(z)),ne)return++this.pos,z},De.prototype.eatWhile=function(x){for(var z=this.pos;this.eat(x););return this.pos>z},De.prototype.eatSpace=function(){for(var x=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>x},De.prototype.skipToEnd=function(){this.pos=this.string.length},De.prototype.skipTo=function(x){var z=this.string.indexOf(x,this.pos);if(z>-1)return this.pos=z,!0},De.prototype.backUp=function(x){this.pos-=x},De.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=ze(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?ze(this.string,this.lineStart,this.tabSize):0)},De.prototype.indentation=function(){return ze(this.string,null,this.tabSize)-(this.lineStart?ze(this.string,this.lineStart,this.tabSize):0)},De.prototype.match=function(x,z,ne){if(typeof x=="string"){var te=function(me){return ne?me.toLowerCase():me},ie=this.string.substr(this.pos,x.length);if(te(ie)==te(x))return z!==!1&&(this.pos+=x.length),!0}else{var le=this.string.slice(this.pos).match(x);return le&&le.index>0?null:(le&&z!==!1&&(this.pos+=le[0].length),le)}},De.prototype.current=function(){return this.string.slice(this.start,this.pos)},De.prototype.hideFirstChars=function(x,z){this.lineStart+=x;try{return z()}finally{this.lineStart-=x}},De.prototype.lookAhead=function(x){var z=this.lineOracle;return z&&z.lookAhead(x)},De.prototype.baseToken=function(){var x=this.lineOracle;return x&&x.baseToken(this.pos)};function We(x,z){if(z-=x.first,z<0||z>=x.size)throw new Error("There is no line "+(z+x.first)+" in the document.");for(var ne=x;!ne.lines;)for(var te=0;;++te){var ie=ne.children[te],le=ie.chunkSize();if(z<le){ne=ie;break}z-=le}return ne.lines[z]}function it(x,z,ne){var te=[],ie=z.line;return x.iter(z.line,ne.line+1,function(le){var me=le.text;ie==ne.line&&(me=me.slice(0,ne.ch)),ie==z.line&&(me=me.slice(z.ch)),te.push(me),++ie}),te}function Nt(x,z,ne){var te=[];return x.iter(z,ne,function(ie){te.push(ie.text)}),te}function Lt(x,z){var ne=z-x.height;if(ne)for(var te=x;te;te=te.parent)te.height+=ne}function $t(x){if(x.parent==null)return null;for(var z=x.parent,ne=bt(z.lines,x),te=z.parent;te;z=te,te=te.parent)for(var ie=0;te.children[ie]!=z;++ie)ne+=te.children[ie].chunkSize();return ne+z.first}function sn(x,z){var ne=x.first;e:do{for(var te=0;te<x.children.length;++te){var ie=x.children[te],le=ie.height;if(z<le){x=ie;continue e}z-=le,ne+=ie.chunkSize()}return ne}while(!x.lines);for(var me=0;me<x.lines.length;++me){var we=x.lines[me],_e=we.height;if(z<_e)break;z-=_e}return ne+me}function hn(x,z){return z>=x.first&&z<x.first+x.size}function xn(x,z){return String(x.lineNumberFormatter(z+x.firstLineNumber))}function Mt(x,z,ne){if(ne===void 0&&(ne=null),!(this instanceof Mt))return new Mt(x,z,ne);this.line=x,this.ch=z,this.sticky=ne}function rn(x,z){return x.line-z.line||x.ch-z.ch}function Je(x,z){return x.sticky==z.sticky&&rn(x,z)==0}function pt(x){return Mt(x.line,x.ch)}function Ct(x,z){return rn(x,z)<0?z:x}function Et(x,z){return rn(x,z)<0?x:z}function Yt(x,z){return Math.max(x.first,Math.min(z,x.first+x.size-1))}function St(x,z){if(z.line<x.first)return Mt(x.first,0);var ne=x.first+x.size-1;return z.line>ne?Mt(ne,We(x,ne).text.length):Gt(z,We(x,z.line).text.length)}function Gt(x,z){var ne=x.ch;return ne==null||ne>z?Mt(x.line,z):ne<0?Mt(x.line,0):x}function Te(x,z){for(var ne=[],te=0;te<z.length;te++)ne[te]=St(x,z[te]);return ne}var dt=function(x,z){this.state=x,this.lookAhead=z},ft=function(x,z,ne,te){this.state=z,this.doc=x,this.line=ne,this.maxLookAhead=te||0,this.baseTokens=null,this.baseTokenPos=1};ft.prototype.lookAhead=function(x){var z=this.doc.getLine(this.line+x);return z!=null&&x>this.maxLookAhead&&(this.maxLookAhead=x),z},ft.prototype.baseToken=function(x){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=x;)this.baseTokenPos+=2;var z=this.baseTokens[this.baseTokenPos+1];return{type:z&&z.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-x}},ft.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ft.fromSaved=function(x,z,ne){return z instanceof dt?new ft(x,Me(x.mode,z.state),ne,z.lookAhead):new ft(x,Me(x.mode,z),ne)},ft.prototype.save=function(x){var z=x!==!1?Me(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new dt(z,this.maxLookAhead):z};function Tt(x,z,ne,te){var ie=[x.state.modeGen],le={};sr(x,z.text,x.doc.mode,ne,function(Ie,ot){return ie.push(Ie,ot)},le,te);for(var me=ne.state,we=function(Ie){ne.baseTokens=ie;var ot=x.state.overlays[Ie],wt=1,on=0;ne.state=!0,sr(x,z.text,ot.mode,ne,function(qt,An){for(var Kn=wt;on<qt;){var pr=ie[wt];pr>qt&&ie.splice(wt,1,qt,ie[wt+1],pr),wt+=2,on=Math.min(qt,pr)}if(An)if(ot.opaque)ie.splice(Kn,wt-Kn,qt,"overlay "+An),wt=Kn+2;else for(;Kn<wt;Kn+=2){var Lr=ie[Kn+1];ie[Kn+1]=(Lr?Lr+" ":"")+"overlay "+An}},le),ne.state=me,ne.baseTokens=null,ne.baseTokenPos=1},_e=0;_e<x.state.overlays.length;++_e)we(_e);return{styles:ie,classes:le.bgClass||le.textClass?le:null}}function _t(x,z,ne){if(!z.styles||z.styles[0]!=x.state.modeGen){var te=Pt(x,$t(z)),ie=z.text.length>x.options.maxHighlightLength&&Me(x.doc.mode,te.state),le=Tt(x,z,te);ie&&(te.state=ie),z.stateAfter=te.save(!ie),z.styles=le.styles,le.classes?z.styleClasses=le.classes:z.styleClasses&&(z.styleClasses=null),ne===x.doc.highlightFrontier&&(x.doc.modeFrontier=Math.max(x.doc.modeFrontier,++x.doc.highlightFrontier))}return z.styles}function Pt(x,z,ne){var te=x.doc,ie=x.display;if(!te.mode.startState)return new ft(te,!0,z);var le=jn(x,z,ne),me=le>te.first&&We(te,le-1).stateAfter,we=me?ft.fromSaved(te,me,le):new ft(te,Le(te.mode),le);return te.iter(le,z,function(_e){Bt(x,_e.text,we);var Ie=we.line;_e.stateAfter=Ie==z-1||Ie%5==0||Ie>=ie.viewFrom&&Ie<ie.viewTo?we.save():null,we.nextLine()}),ne&&(te.modeFrontier=we.line),we}function Bt(x,z,ne,te){var ie=x.doc.mode,le=new De(z,x.options.tabSize,ne);for(le.start=le.pos=te||0,z==""&&un(ie,ne.state);!le.eol();)yn(ie,le,ne.state),le.start=le.pos}function un(x,z){if(x.blankLine)return x.blankLine(z);if(x.innerMode){var ne=Ae(x,z);if(ne.mode.blankLine)return ne.mode.blankLine(ne.state)}}function yn(x,z,ne,te){for(var ie=0;ie<10;ie++){te&&(te[0]=Ae(x,ne).mode);var le=x.token(z,ne);if(z.pos>z.start)return le}throw new Error("Mode "+x.name+" failed to advance stream.")}var _n=function(x,z,ne){this.start=x.start,this.end=x.pos,this.string=x.current(),this.type=z||null,this.state=ne};function $n(x,z,ne,te){var ie=x.doc,le=ie.mode,me;z=St(ie,z);var we=We(ie,z.line),_e=Pt(x,z.line,ne),Ie=new De(we.text,x.options.tabSize,_e),ot;for(te&&(ot=[]);(te||Ie.pos<z.ch)&&!Ie.eol();)Ie.start=Ie.pos,me=yn(le,Ie,_e.state),te&&ot.push(new _n(Ie,me,Me(ie.mode,_e.state)));return te?ot:new _n(Ie,me,_e.state)}function qn(x,z){if(x)for(;;){var ne=x.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!ne)break;x=x.slice(0,ne.index)+x.slice(ne.index+ne[0].length);var te=ne[1]?"bgClass":"textClass";z[te]==null?z[te]=ne[2]:new RegExp("(?:^|\\s)"+ne[2]+"(?:$|\\s)").test(z[te])||(z[te]+=" "+ne[2])}return x}function sr(x,z,ne,te,ie,le,me){var we=ne.flattenSpans;we==null&&(we=x.options.flattenSpans);var _e=0,Ie=null,ot=new De(z,x.options.tabSize,te),wt,on=x.options.addModeClass&&[null];for(z==""&&qn(un(ne,te.state),le);!ot.eol();){if(ot.pos>x.options.maxHighlightLength?(we=!1,me&&Bt(x,z,te,ot.pos),ot.pos=z.length,wt=null):wt=qn(yn(ne,ot,te.state,on),le),on){var qt=on[0].name;qt&&(wt="m-"+(wt?qt+" "+wt:qt))}if(!we||Ie!=wt){for(;_e<ot.start;)_e=Math.min(ot.start,_e+5e3),ie(_e,Ie);Ie=wt}ot.start=ot.pos}for(;_e<ot.pos;){var An=Math.min(ot.pos,_e+5e3);ie(An,Ie),_e=An}}function jn(x,z,ne){for(var te,ie,le=x.doc,me=ne?-1:z-(x.doc.mode.innerMode?1e3:100),we=z;we>me;--we){if(we<=le.first)return le.first;var _e=We(le,we-1),Ie=_e.stateAfter;if(Ie&&(!ne||we+(Ie instanceof dt?Ie.lookAhead:0)<=le.modeFrontier))return we;var ot=ze(_e.text,null,x.options.tabSize);(ie==null||te>ot)&&(ie=we-1,te=ot)}return ie}function Ln(x,z){if(x.modeFrontier=Math.min(x.modeFrontier,z),!(x.highlightFrontier<z-10)){for(var ne=x.first,te=z-1;te>ne;te--){var ie=We(x,te).stateAfter;if(ie&&(!(ie instanceof dt)||te+ie.lookAhead<z)){ne=te+1;break}}x.highlightFrontier=Math.min(x.highlightFrontier,ne)}}var ur=!1,Qn=!1;function mr(){ur=!0}function Vn(){Qn=!0}function Un(x,z,ne){this.marker=x,this.from=z,this.to=ne}function br(x,z){if(x)for(var ne=0;ne<x.length;++ne){var te=x[ne];if(te.marker==z)return te}}function lr(x,z){for(var ne,te=0;te<x.length;++te)x[te]!=z&&(ne||(ne=[])).push(x[te]);return ne}function Ir(x,z){x.markedSpans=x.markedSpans?x.markedSpans.concat([z]):[z],z.marker.attachLine(x)}function Ur(x,z,ne){var te;if(x)for(var ie=0;ie<x.length;++ie){var le=x[ie],me=le.marker,we=le.from==null||(me.inclusiveLeft?le.from<=z:le.from<z);if(we||le.from==z&&me.type=="bookmark"&&(!ne||!le.marker.insertLeft)){var _e=le.to==null||(me.inclusiveRight?le.to>=z:le.to>z);(te||(te=[])).push(new Un(me,le.from,_e?null:le.to))}}return te}function rr(x,z,ne){var te;if(x)for(var ie=0;ie<x.length;++ie){var le=x[ie],me=le.marker,we=le.to==null||(me.inclusiveRight?le.to>=z:le.to>z);if(we||le.from==z&&me.type=="bookmark"&&(!ne||le.marker.insertLeft)){var _e=le.from==null||(me.inclusiveLeft?le.from<=z:le.from<z);(te||(te=[])).push(new Un(me,_e?null:le.from-z,le.to==null?null:le.to-z))}}return te}function Cn(x,z){if(z.full)return null;var ne=hn(x,z.from.line)&&We(x,z.from.line).markedSpans,te=hn(x,z.to.line)&&We(x,z.to.line).markedSpans;if(!ne&&!te)return null;var ie=z.from.ch,le=z.to.ch,me=rn(z.from,z.to)==0,we=Ur(ne,ie,me),_e=rr(te,le,me),Ie=z.text.length==1,ot=Vt(z.text).length+(Ie?ie:0);if(we)for(var wt=0;wt<we.length;++wt){var on=we[wt];if(on.to==null){var qt=br(_e,on.marker);qt?Ie&&(on.to=qt.to==null?null:qt.to+ot):on.to=ie}}if(_e)for(var An=0;An<_e.length;++An){var Kn=_e[An];if(Kn.to!=null&&(Kn.to+=ot),Kn.from==null){var pr=br(we,Kn.marker);pr||(Kn.from=ot,Ie&&(we||(we=[])).push(Kn))}else Kn.from+=ot,Ie&&(we||(we=[])).push(Kn)}we&&(we=Sn(we)),_e&&_e!=we&&(_e=Sn(_e));var Lr=[we];if(!Ie){var Or=z.text.length-2,Cr;if(Or>0&&we)for(var Fr=0;Fr<we.length;++Fr)we[Fr].to==null&&(Cr||(Cr=[])).push(new Un(we[Fr].marker,null,null));for(var Qr=0;Qr<Or;++Qr)Lr.push(Cr);Lr.push(_e)}return Lr}function Sn(x){for(var z=0;z<x.length;++z){var ne=x[z];ne.from!=null&&ne.from==ne.to&&ne.marker.clearWhenEmpty!==!1&&x.splice(z--,1)}return x.length?x:null}function fr(x,z,ne){var te=null;if(x.iter(z.line,ne.line+1,function(qt){if(qt.markedSpans)for(var An=0;An<qt.markedSpans.length;++An){var Kn=qt.markedSpans[An].marker;Kn.readOnly&&(!te||bt(te,Kn)==-1)&&(te||(te=[])).push(Kn)}}),!te)return null;for(var ie=[{from:z,to:ne}],le=0;le<te.length;++le)for(var me=te[le],we=me.find(0),_e=0;_e<ie.length;++_e){var Ie=ie[_e];if(!(rn(Ie.to,we.from)<0||rn(Ie.from,we.to)>0)){var ot=[_e,1],wt=rn(Ie.from,we.from),on=rn(Ie.to,we.to);(wt<0||!me.inclusiveLeft&&!wt)&&ot.push({from:Ie.from,to:we.from}),(on>0||!me.inclusiveRight&&!on)&&ot.push({from:we.to,to:Ie.to}),ie.splice.apply(ie,ot),_e+=ot.length-3}}return ie}function er(x){var z=x.markedSpans;if(z){for(var ne=0;ne<z.length;++ne)z[ne].marker.detachLine(x);x.markedSpans=null}}function Mr(x,z){if(z){for(var ne=0;ne<z.length;++ne)z[ne].marker.attachLine(x);x.markedSpans=z}}function _r(x){return x.inclusiveLeft?-1:0}function Ar(x){return x.inclusiveRight?1:0}function dr(x,z){var ne=x.lines.length-z.lines.length;if(ne!=0)return ne;var te=x.find(),ie=z.find(),le=rn(te.from,ie.from)||_r(x)-_r(z);if(le)return-le;var me=rn(te.to,ie.to)||Ar(x)-Ar(z);return me||z.id-x.id}function Sr(x,z){var ne=Qn&&x.markedSpans,te;if(ne)for(var ie=void 0,le=0;le<ne.length;++le)ie=ne[le],ie.marker.collapsed&&(z?ie.from:ie.to)==null&&(!te||dr(te,ie.marker)<0)&&(te=ie.marker);return te}function ii(x){return Sr(x,!0)}function zn(x){return Sr(x,!1)}function Xn(x,z){var ne=Qn&&x.markedSpans,te;if(ne)for(var ie=0;ie<ne.length;++ie){var le=ne[ie];le.marker.collapsed&&(le.from==null||le.from<z)&&(le.to==null||le.to>z)&&(!te||dr(te,le.marker)<0)&&(te=le.marker)}return te}function kr(x,z,ne,te,ie){var le=We(x,z),me=Qn&&le.markedSpans;if(me)for(var we=0;we<me.length;++we){var _e=me[we];if(_e.marker.collapsed){var Ie=_e.marker.find(0),ot=rn(Ie.from,ne)||_r(_e.marker)-_r(ie),wt=rn(Ie.to,te)||Ar(_e.marker)-Ar(ie);if(!(ot>=0&&wt<=0||ot<=0&&wt>=0)&&(ot<=0&&(_e.marker.inclusiveRight&&ie.inclusiveLeft?rn(Ie.to,ne)>=0:rn(Ie.to,ne)>0)||ot>=0&&(_e.marker.inclusiveRight&&ie.inclusiveLeft?rn(Ie.from,te)<=0:rn(Ie.from,te)<0)))return!0}}}function Br(x){for(var z;z=ii(x);)x=z.find(-1,!0).line;return x}function li(x){for(var z;z=zn(x);)x=z.find(1,!0).line;return x}function di(x){for(var z,ne;z=zn(x);)x=z.find(1,!0).line,(ne||(ne=[])).push(x);return ne}function ri(x,z){var ne=We(x,z),te=Br(ne);return ne==te?z:$t(te)}function Yr(x,z){if(z>x.lastLine())return z;var ne=We(x,z),te;if(!yi(x,ne))return z;for(;te=zn(ne);)ne=te.find(1,!0).line;return $t(ne)+1}function yi(x,z){var ne=Qn&&z.markedSpans;if(ne){for(var te=void 0,ie=0;ie<ne.length;++ie)if(te=ne[ie],!!te.marker.collapsed){if(te.from==null)return!0;if(!te.marker.widgetNode&&te.from==0&&te.marker.inclusiveLeft&&bi(x,z,te))return!0}}}function bi(x,z,ne){if(ne.to==null){var te=ne.marker.find(1,!0);return bi(x,te.line,br(te.line.markedSpans,ne.marker))}if(ne.marker.inclusiveRight&&ne.to==z.text.length)return!0;for(var ie=void 0,le=0;le<z.markedSpans.length;++le)if(ie=z.markedSpans[le],ie.marker.collapsed&&!ie.marker.widgetNode&&ie.from==ne.to&&(ie.to==null||ie.to!=ne.from)&&(ie.marker.inclusiveLeft||ne.marker.inclusiveRight)&&bi(x,z,ie))return!0}function Gn(x){x=Br(x);for(var z=0,ne=x.parent,te=0;te<ne.lines.length;++te){var ie=ne.lines[te];if(ie==x)break;z+=ie.height}for(var le=ne.parent;le;ne=le,le=ne.parent)for(var me=0;me<le.children.length;++me){var we=le.children[me];if(we==ne)break;z+=we.height}return z}function Wn(x){if(x.height==0)return 0;for(var z=x.text.length,ne,te=x;ne=ii(te);){var ie=ne.find(0,!0);te=ie.from.line,z+=ie.from.ch-ie.to.ch}for(te=x;ne=zn(te);){var le=ne.find(0,!0);z-=te.text.length-le.from.ch,te=le.to.line,z+=te.text.length-le.to.ch}return z}function Hn(x){var z=x.display,ne=x.doc;z.maxLine=We(ne,ne.first),z.maxLineLength=Wn(z.maxLine),z.maxLineChanged=!0,ne.iter(function(te){var ie=Wn(te);ie>z.maxLineLength&&(z.maxLineLength=ie,z.maxLine=te)})}var hr=function(x,z,ne){this.text=x,Mr(this,z),this.height=ne?ne(this):1};hr.prototype.lineNo=function(){return $t(this)},an(hr);function ni(x,z,ne,te){x.text=z,x.stateAfter&&(x.stateAfter=null),x.styles&&(x.styles=null),x.order!=null&&(x.order=null),er(x),Mr(x,ne);var ie=te?te(x):1;ie!=x.height&&Lt(x,ie)}function xi(x){x.parent=null,er(x)}var Mi={},gi={};function ci(x,z){if(!x||/^\s*$/.test(x))return null;var ne=z.addModeClass?gi:Mi;return ne[x]||(ne[x]=x.replace(/\S+/g,"cm-$&"))}function ki(x,z){var ne=Ot("span",null,null,Ne?"padding-right: .1px":null),te={pre:Ot("pre",[ne],"CodeMirror-line"),content:ne,col:0,pos:0,cm:x,trailingSpace:!1,splitSpaces:x.getOption("lineWrapping")};z.measure={};for(var ie=0;ie<=(z.rest?z.rest.length:0);ie++){var le=ie?z.rest[ie-1]:z.line,me=void 0;te.pos=0,te.addToken=$i,vr(x.display.measure)&&(me=En(le,x.doc.direction))&&(te.addToken=Gr(te.addToken,me)),te.map=[];var we=z!=x.display.externalMeasured&&$t(le);Ai(le,te,_t(x,le,we)),le.styleClasses&&(le.styleClasses.bgClass&&(te.bgClass=cn(le.styleClasses.bgClass,te.bgClass||"")),le.styleClasses.textClass&&(te.textClass=cn(le.styleClasses.textClass,te.textClass||""))),te.map.length==0&&te.map.push(0,0,te.content.appendChild(Rr(x.display.measure))),ie==0?(z.measure.map=te.map,z.measure.cache={}):((z.measure.maps||(z.measure.maps=[])).push(te.map),(z.measure.caches||(z.measure.caches=[])).push({}))}if(Ne){var _e=te.content.lastChild;(/\bcm-tab\b/.test(_e.className)||_e.querySelector&&_e.querySelector(".cm-tab"))&&(te.content.className="cm-tab-wrap-hack")}return Re(x,"renderLine",x,z.line,te.pre),te.pre.className&&(te.textClass=cn(te.pre.className,te.textClass||"")),te}function Hi(x){var z=Ue("span","\u2022","cm-invalidchar");return z.title="\\u"+x.charCodeAt(0).toString(16),z.setAttribute("aria-label",z.title),z}function $i(x,z,ne,te,ie,le,me){if(z){var we=x.splitSpaces?oa(z,x.trailingSpace):z,_e=x.cm.state.specialChars,Ie=!1,ot;if(!_e.test(z))x.col+=z.length,ot=document.createTextNode(we),x.map.push(x.pos,x.pos+z.length,ot),Se&&Pe<9&&(Ie=!0),x.pos+=z.length;else{ot=document.createDocumentFragment();for(var wt=0;;){_e.lastIndex=wt;var on=_e.exec(z),qt=on?on.index-wt:z.length-wt;if(qt){var An=document.createTextNode(we.slice(wt,wt+qt));Se&&Pe<9?ot.appendChild(Ue("span",[An])):ot.appendChild(An),x.map.push(x.pos,x.pos+qt,An),x.col+=qt,x.pos+=qt}if(!on)break;wt+=qt+1;var Kn=void 0;if(on[0]==" "){var pr=x.cm.options.tabSize,Lr=pr-x.col%pr;Kn=ot.appendChild(Ue("span",bn(Lr),"cm-tab")),Kn.setAttribute("role","presentation"),Kn.setAttribute("cm-text"," "),x.col+=Lr}else on[0]=="\r"||on[0]==`
`?(Kn=ot.appendChild(Ue("span",on[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Kn.setAttribute("cm-text",on[0]),x.col+=1):(Kn=x.cm.options.specialCharPlaceholder(on[0]),Kn.setAttribute("cm-text",on[0]),Se&&Pe<9?ot.appendChild(Ue("span",[Kn])):ot.appendChild(Kn),x.col+=1);x.map.push(x.pos,x.pos+1,Kn),x.pos++}}if(x.trailingSpace=we.charCodeAt(z.length-1)==32,ne||te||ie||Ie||le||me){var Or=ne||"";te&&(Or+=te),ie&&(Or+=ie);var Cr=Ue("span",[ot],Or,le);if(me)for(var Fr in me)me.hasOwnProperty(Fr)&&Fr!="style"&&Fr!="class"&&Cr.setAttribute(Fr,me[Fr]);return x.content.appendChild(Cr)}x.content.appendChild(ot)}}function oa(x,z){if(x.length>1&&!/ /.test(x))return x;for(var ne=z,te="",ie=0;ie<x.length;ie++){var le=x.charAt(ie);le==" "&&ne&&(ie==x.length-1||x.charCodeAt(ie+1)==32)&&(le="\xA0"),te+=le,ne=le==" "}return te}function Gr(x,z){return function(ne,te,ie,le,me,we,_e){ie=ie?ie+" cm-force-border":"cm-force-border";for(var Ie=ne.pos,ot=Ie+te.length;;){for(var wt=void 0,on=0;on<z.length&&(wt=z[on],!(wt.to>Ie&&wt.from<=Ie));on++);if(wt.to>=ot)return x(ne,te,ie,le,me,we,_e);x(ne,te.slice(0,wt.to-Ie),ie,le,null,we,_e),le=null,te=te.slice(wt.to-Ie),Ie=wt.to}}}function ei(x,z,ne,te){var ie=!te&&ne.widgetNode;ie&&x.map.push(x.pos,x.pos+z,ie),!te&&x.cm.display.input.needsContentAttribute&&(ie||(ie=x.content.appendChild(document.createElement("span"))),ie.setAttribute("cm-marker",ne.id)),ie&&(x.cm.display.input.setUneditable(ie),x.content.appendChild(ie)),x.pos+=z,x.trailingSpace=!1}function Ai(x,z,ne){var te=x.markedSpans,ie=x.text,le=0;if(!te){for(var me=1;me<ne.length;me+=2)z.addToken(z,ie.slice(le,le=ne[me]),ci(ne[me+1],z.cm.options));return}for(var we=ie.length,_e=0,Ie=1,ot="",wt,on,qt=0,An,Kn,pr,Lr,Or;;){if(qt==_e){An=Kn=pr=on="",Or=null,Lr=null,qt=1/0;for(var Cr=[],Fr=void 0,Qr=0;Qr<te.length;++Qr){var ti=te[Qr],Ci=ti.marker;if(Ci.type=="bookmark"&&ti.from==_e&&Ci.widgetNode)Cr.push(Ci);else if(ti.from<=_e&&(ti.to==null||ti.to>_e||Ci.collapsed&&ti.to==_e&&ti.from==_e)){if(ti.to!=null&&ti.to!=_e&&qt>ti.to&&(qt=ti.to,Kn=""),Ci.className&&(An+=" "+Ci.className),Ci.css&&(on=(on?on+";":"")+Ci.css),Ci.startStyle&&ti.from==_e&&(pr+=" "+Ci.startStyle),Ci.endStyle&&ti.to==qt&&(Fr||(Fr=[])).push(Ci.endStyle,ti.to),Ci.title&&((Or||(Or={})).title=Ci.title),Ci.attributes)for(var Ji in Ci.attributes)(Or||(Or={}))[Ji]=Ci.attributes[Ji];Ci.collapsed&&(!Lr||dr(Lr.marker,Ci)<0)&&(Lr=ti)}else ti.from>_e&&qt>ti.from&&(qt=ti.from)}if(Fr)for(var $a=0;$a<Fr.length;$a+=2)Fr[$a+1]==qt&&(Kn+=" "+Fr[$a]);if(!Lr||Lr.from==_e)for(var da=0;da<Cr.length;++da)ei(z,0,Cr[da]);if(Lr&&(Lr.from||0)==_e){if(ei(z,(Lr.to==null?we+1:Lr.to)-_e,Lr.marker,Lr.from==null),Lr.to==null)return;Lr.to==_e&&(Lr=!1)}}if(_e>=we)break;for(var co=Math.min(we,qt);;){if(ot){var uo=_e+ot.length;if(!Lr){var _a=uo>co?ot.slice(0,co-_e):ot;z.addToken(z,_a,wt?wt+An:An,pr,_e+_a.length==qt?Kn:"",on,Or)}if(uo>=co){ot=ot.slice(co-_e),_e=co;break}_e=uo,pr=""}ot=ie.slice(le,le=ne[Ie++]),wt=ci(ne[Ie++],z.cm.options)}}}function ai(x,z,ne){this.line=z,this.rest=di(z),this.size=this.rest?$t(Vt(this.rest))-ne+1:1,this.node=this.text=null,this.hidden=yi(x,z)}function fi(x,z,ne){for(var te=[],ie,le=z;le<ne;le=ie){var me=new ai(x.doc,We(x.doc,le),le);ie=le+me.size,te.push(me)}return te}var _i=null;function pi(x){_i?_i.ops.push(x):x.ownsGroup=_i={ops:[x],delayedCallbacks:[]}}function Tr(x){var z=x.delayedCallbacks,ne=0;do{for(;ne<z.length;ne++)z[ne].call(null);for(var te=0;te<x.ops.length;te++){var ie=x.ops[te];if(ie.cursorActivityHandlers)for(;ie.cursorActivityCalled<ie.cursorActivityHandlers.length;)ie.cursorActivityHandlers[ie.cursorActivityCalled++].call(null,ie.cm)}}while(ne<z.length)}function Xr(x,z){var ne=x.ownsGroup;if(ne)try{Tr(ne)}finally{_i=null,z(ne)}}var Vr=null;function $r(x,z){var ne=Jn(x,z);if(ne.length){var te=Array.prototype.slice.call(arguments,2),ie;_i?ie=_i.delayedCallbacks:Vr?ie=Vr:(ie=Vr=[],setTimeout(ui,0));for(var le=function(we){ie.push(function(){return ne[we].apply(null,te)})},me=0;me<ne.length;++me)le(me)}}function ui(){var x=Vr;Vr=null;for(var z=0;z<x.length;++z)x[z]()}function oi(x,z,ne,te){for(var ie=0;ie<z.changes.length;ie++){var le=z.changes[ie];le=="text"?na(x,z):le=="gutter"?vi(x,z,ne,te):le=="class"?wi(x,z):le=="widget"&&Gi(x,z,te)}z.changes=null}function zi(x){return x.node==x.text&&(x.node=Ue("div",null,null,"position: relative"),x.text.parentNode&&x.text.parentNode.replaceChild(x.node,x.text),x.node.appendChild(x.text),Se&&Pe<8&&(x.node.style.zIndex=2)),x.node}function Wi(x,z){var ne=z.bgClass?z.bgClass+" "+(z.line.bgClass||""):z.line.bgClass;if(ne&&(ne+=" CodeMirror-linebackground"),z.background)ne?z.background.className=ne:(z.background.parentNode.removeChild(z.background),z.background=null);else if(ne){var te=zi(z);z.background=te.insertBefore(Ue("div",null,ne),te.firstChild),x.display.input.setUneditable(z.background)}}function Zi(x,z){var ne=x.display.externalMeasured;return ne&&ne.line==z.line?(x.display.externalMeasured=null,z.measure=ne.measure,ne.built):ki(x,z)}function na(x,z){var ne=z.text.className,te=Zi(x,z);z.text==z.node&&(z.node=te.pre),z.text.parentNode.replaceChild(te.pre,z.text),z.text=te.pre,te.bgClass!=z.bgClass||te.textClass!=z.textClass?(z.bgClass=te.bgClass,z.textClass=te.textClass,wi(x,z)):ne&&(z.text.className=ne)}function wi(x,z){Wi(x,z),z.line.wrapClass?zi(z).className=z.line.wrapClass:z.node!=z.text&&(z.node.className="");var ne=z.textClass?z.textClass+" "+(z.line.textClass||""):z.line.textClass;z.text.className=ne||""}function vi(x,z,ne,te){if(z.gutter&&(z.node.removeChild(z.gutter),z.gutter=null),z.gutterBackground&&(z.node.removeChild(z.gutterBackground),z.gutterBackground=null),z.line.gutterClass){var ie=zi(z);z.gutterBackground=Ue("div",null,"CodeMirror-gutter-background "+z.line.gutterClass,"left: "+(x.options.fixedGutter?te.fixedPos:-te.gutterTotalWidth)+"px; width: "+te.gutterTotalWidth+"px"),x.display.input.setUneditable(z.gutterBackground),ie.insertBefore(z.gutterBackground,z.text)}var le=z.line.gutterMarkers;if(x.options.lineNumbers||le){var me=zi(z),we=z.gutter=Ue("div",null,"CodeMirror-gutter-wrapper","left: "+(x.options.fixedGutter?te.fixedPos:-te.gutterTotalWidth)+"px");if(x.display.input.setUneditable(we),me.insertBefore(we,z.text),z.line.gutterClass&&(we.className+=" "+z.line.gutterClass),x.options.lineNumbers&&(!le||!le["CodeMirror-linenumbers"])&&(z.lineNumber=we.appendChild(Ue("div",xn(x.options,ne),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+te.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+x.display.lineNumInnerWidth+"px"))),le)for(var _e=0;_e<x.display.gutterSpecs.length;++_e){var Ie=x.display.gutterSpecs[_e].className,ot=le.hasOwnProperty(Ie)&&le[Ie];ot&&we.appendChild(Ue("div",[ot],"CodeMirror-gutter-elt","left: "+te.gutterLeft[Ie]+"px; width: "+te.gutterWidth[Ie]+"px"))}}}function Gi(x,z,ne){z.alignable&&(z.alignable=null);for(var te=Ee("CodeMirror-linewidget"),ie=z.node.firstChild,le=void 0;ie;ie=le)le=ie.nextSibling,te.test(ie.className)&&z.node.removeChild(ie);sa(x,z,ne)}function ca(x,z,ne,te){var ie=Zi(x,z);return z.text=z.node=ie.pre,ie.bgClass&&(z.bgClass=ie.bgClass),ie.textClass&&(z.textClass=ie.textClass),wi(x,z),vi(x,z,ne,te),sa(x,z,te),z.node}function sa(x,z,ne){if(ta(x,z.line,z,ne,!0),z.rest)for(var te=0;te<z.rest.length;te++)ta(x,z.rest[te],z,ne,!1)}function ta(x,z,ne,te,ie){if(z.widgets)for(var le=zi(ne),me=0,we=z.widgets;me<we.length;++me){var _e=we[me],Ie=Ue("div",[_e.node],"CodeMirror-linewidget"+(_e.className?" "+_e.className:""));_e.handleMouseEvents||Ie.setAttribute("cm-ignore-events","true"),ts(_e,Ie,ne,te),x.display.input.setUneditable(Ie),ie&&_e.above?le.insertBefore(Ie,ne.gutter||ne.text):le.appendChild(Ie),$r(_e,"redraw")}}function ts(x,z,ne,te){if(x.noHScroll){(ne.alignable||(ne.alignable=[])).push(z);var ie=te.wrapperWidth;z.style.left=te.fixedPos+"px",x.coverGutter||(ie-=te.gutterTotalWidth,z.style.paddingLeft=te.gutterTotalWidth+"px"),z.style.width=ie+"px"}x.coverGutter&&(z.style.zIndex=5,z.style.position="relative",x.noHScroll||(z.style.marginLeft=-te.gutterTotalWidth+"px"))}function ao(x){if(x.height!=null)return x.height;var z=x.doc.cm;if(!z)return 0;if(!At(document.body,x.node)){var ne="position: relative;";x.coverGutter&&(ne+="margin-left: -"+z.display.gutters.offsetWidth+"px;"),x.noHScroll&&(ne+="width: "+z.display.wrapper.clientWidth+"px;"),vt(z.display.measure,Ue("div",[x.node],null,ne))}return x.height=x.node.parentNode.offsetHeight}function oo(x,z){for(var ne=tr(z);ne!=x.wrapper;ne=ne.parentNode)if(!ne||ne.nodeType==1&&ne.getAttribute("cm-ignore-events")=="true"||ne.parentNode==x.sizer&&ne!=x.mover)return!0}function eo(x){return x.lineSpace.offsetTop}function Ss(x){return x.mover.offsetHeight-x.lineSpace.offsetHeight}function fo(x){if(x.cachedPaddingH)return x.cachedPaddingH;var z=vt(x.measure,Ue("pre","x","CodeMirror-line-like")),ne=window.getComputedStyle?window.getComputedStyle(z):z.currentStyle,te={left:parseInt(ne.paddingLeft),right:parseInt(ne.paddingRight)};return!isNaN(te.left)&&!isNaN(te.right)&&(x.cachedPaddingH=te),te}function Ea(x){return pn-x.display.nativeBarWidth}function fa(x){return x.display.scroller.clientWidth-Ea(x)-x.display.barWidth}function bo(x){return x.display.scroller.clientHeight-Ea(x)-x.display.barHeight}function ko(x,z,ne){var te=x.options.lineWrapping,ie=te&&fa(x);if(!z.measure.heights||te&&z.measure.width!=ie){var le=z.measure.heights=[];if(te){z.measure.width=ie;for(var me=z.text.firstChild.getClientRects(),we=0;we<me.length-1;we++){var _e=me[we],Ie=me[we+1];Math.abs(_e.bottom-Ie.bottom)>2&&le.push((_e.bottom+Ie.top)/2-ne.top)}}le.push(ne.bottom-ne.top)}}function Eo(x,z,ne){if(x.line==z)return{map:x.measure.map,cache:x.measure.cache};for(var te=0;te<x.rest.length;te++)if(x.rest[te]==z)return{map:x.measure.maps[te],cache:x.measure.caches[te]};for(var ie=0;ie<x.rest.length;ie++)if($t(x.rest[ie])>ne)return{map:x.measure.maps[ie],cache:x.measure.caches[ie],before:!0}}function ns(x,z){z=Br(z);var ne=$t(z),te=x.display.externalMeasured=new ai(x.doc,z,ne);te.lineN=ne;var ie=te.built=ki(x,te);return te.text=ie.pre,vt(x.display.lineMeasure,ie.pre),te}function Ro(x,z,ne,te){return Oi(x,Oa(x,z),ne,te)}function Xa(x,z){if(z>=x.display.viewFrom&&z<x.display.viewTo)return x.display.view[po(x,z)];var ne=x.display.externalMeasured;if(ne&&z>=ne.lineN&&z<ne.lineN+ne.size)return ne}function Oa(x,z){var ne=$t(z),te=Xa(x,ne);te&&!te.text?te=null:te&&te.changes&&(oi(x,te,ne,Bi(x)),x.curOp.forceUpdate=!0),te||(te=ns(x,z));var ie=Eo(te,z,ne);return{line:z,view:te,rect:null,map:ie.map,cache:ie.cache,before:ie.before,hasHeights:!1}}function Oi(x,z,ne,te,ie){z.before&&(ne=-1);var le=ne+(te||""),me;return z.cache.hasOwnProperty(le)?me=z.cache[le]:(z.rect||(z.rect=z.view.text.getBoundingClientRect()),z.hasHeights||(ko(x,z.view,z.rect),z.hasHeights=!0),me=Ei(x,z,ne,te),me.bogus||(z.cache[le]=me)),{left:me.left,right:me.right,top:ie?me.rtop:me.top,bottom:ie?me.rbottom:me.bottom}}var Lo={left:0,right:0,top:0,bottom:0};function rs(x,z,ne){for(var te,ie,le,me,we,_e,Ie=0;Ie<x.length;Ie+=3)if(we=x[Ie],_e=x[Ie+1],z<we?(ie=0,le=1,me="left"):z<_e?(ie=z-we,le=ie+1):(Ie==x.length-3||z==_e&&x[Ie+3]>z)&&(le=_e-we,ie=le-1,z>=_e&&(me="right")),ie!=null){if(te=x[Ie+2],we==_e&&ne==(te.insertLeft?"left":"right")&&(me=ne),ne=="left"&&ie==0)for(;Ie&&x[Ie-2]==x[Ie-3]&&x[Ie-1].insertLeft;)te=x[(Ie-=3)+2],me="left";if(ne=="right"&&ie==_e-we)for(;Ie<x.length-3&&x[Ie+3]==x[Ie+4]&&!x[Ie+5].insertLeft;)te=x[(Ie+=3)+2],me="right";break}return{node:te,start:ie,end:le,collapse:me,coverStart:we,coverEnd:_e}}function Do(x,z){var ne=Lo;if(z=="left")for(var te=0;te<x.length&&(ne=x[te]).left==ne.right;te++);else for(var ie=x.length-1;ie>=0&&(ne=x[ie]).left==ne.right;ie--);return ne}function Ei(x,z,ne,te){var ie=rs(z.map,ne,te),le=ie.node,me=ie.start,we=ie.end,_e=ie.collapse,Ie;if(le.nodeType==3){for(var ot=0;ot<4;ot++){for(;me&&Dt(z.line.text.charAt(ie.coverStart+me));)--me;for(;ie.coverStart+we<ie.coverEnd&&Dt(z.line.text.charAt(ie.coverStart+we));)++we;if(Se&&Pe<9&&me==0&&we==ie.coverEnd-ie.coverStart?Ie=le.parentNode.getBoundingClientRect():Ie=Do(rt(le,me,we).getClientRects(),te),Ie.left||Ie.right||me==0)break;we=me,me=me-1,_e="right"}Se&&Pe<11&&(Ie=mi(x.display.measure,Ie))}else{me>0&&(_e=te="right");var wt;x.options.lineWrapping&&(wt=le.getClientRects()).length>1?Ie=wt[te=="right"?wt.length-1:0]:Ie=le.getBoundingClientRect()}if(Se&&Pe<9&&!me&&(!Ie||!Ie.left&&!Ie.right)){var on=le.parentNode.getClientRects()[0];on?Ie={left:on.left,right:on.left+Pi(x.display),top:on.top,bottom:on.bottom}:Ie=Lo}for(var qt=Ie.top-z.rect.top,An=Ie.bottom-z.rect.top,Kn=(qt+An)/2,pr=z.view.measure.heights,Lr=0;Lr<pr.length-1&&!(Kn<pr[Lr]);Lr++);var Or=Lr?pr[Lr-1]:0,Cr=pr[Lr],Fr={left:(_e=="right"?Ie.right:Ie.left)-z.rect.left,right:(_e=="left"?Ie.left:Ie.right)-z.rect.left,top:Or,bottom:Cr};return!Ie.left&&!Ie.right&&(Fr.bogus=!0),x.options.singleCursorHeightPerLine||(Fr.rtop=qt,Fr.rbottom=An),Fr}function mi(x,z){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Er(x))return z;var ne=screen.logicalXDPI/screen.deviceXDPI,te=screen.logicalYDPI/screen.deviceYDPI;return{left:z.left*ne,right:z.right*ne,top:z.top*te,bottom:z.bottom*te}}function Ki(x){if(x.measure&&(x.measure.cache={},x.measure.heights=null,x.rest))for(var z=0;z<x.rest.length;z++)x.measure.caches[z]={}}function La(x){x.display.externalMeasure=null,at(x.display.lineMeasure);for(var z=0;z<x.display.view.length;z++)Ki(x.display.view[z])}function Xi(x){La(x),x.display.cachedCharWidth=x.display.cachedTextHeight=x.display.cachedPaddingH=null,x.options.lineWrapping||(x.display.maxLineChanged=!0),x.display.lineNumChars=null}function Ra(){return ke&&et?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Fa(){return ke&&et?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function to(x){var z=0;if(x.widgets)for(var ne=0;ne<x.widgets.length;++ne)x.widgets[ne].above&&(z+=ao(x.widgets[ne]));return z}function Na(x,z,ne,te,ie){if(!ie){var le=to(z);ne.top+=le,ne.bottom+=le}if(te=="line")return ne;te||(te="local");var me=Gn(z);if(te=="local"?me+=eo(x.display):me-=x.display.viewOffset,te=="page"||te=="window"){var we=x.display.lineSpace.getBoundingClientRect();me+=we.top+(te=="window"?0:Fa());var _e=we.left+(te=="window"?0:Ra());ne.left+=_e,ne.right+=_e}return ne.top+=me,ne.bottom+=me,ne}function so(x,z,ne){if(ne=="div")return z;var te=z.left,ie=z.top;if(ne=="page")te-=Ra(),ie-=Fa();else if(ne=="local"||!ne){var le=x.display.sizer.getBoundingClientRect();te+=le.left,ie+=le.top}var me=x.display.lineSpace.getBoundingClientRect();return{left:te-me.left,top:ie-me.top}}function lo(x,z,ne,te,ie){return te||(te=We(x.doc,z.line)),Na(x,te,Ro(x,te,z.ch,ie),ne)}function Da(x,z,ne,te,ie,le){te=te||We(x.doc,z.line),ie||(ie=Oa(x,te));function me(An,Kn){var pr=Oi(x,ie,An,Kn?"right":"left",le);return Kn?pr.left=pr.right:pr.right=pr.left,Na(x,te,pr,ne)}var we=En(te,x.doc.direction),_e=z.ch,Ie=z.sticky;if(_e>=te.text.length?(_e=te.text.length,Ie="before"):_e<=0&&(_e=0,Ie="after"),!we)return me(Ie=="before"?_e-1:_e,Ie=="before");function ot(An,Kn,pr){var Lr=we[Kn],Or=Lr.level==1;return me(pr?An-1:An,Or!=pr)}var wt=wn(we,_e,Ie),on=nn,qt=ot(_e,wt,Ie=="before");return on!=null&&(qt.other=ot(_e,on,Ie!="before")),qt}function bl(x,z){var ne=0;z=St(x.doc,z),x.options.lineWrapping||(ne=Pi(x.display)*z.ch);var te=We(x.doc,z.line),ie=Gn(te)+eo(x.display);return{left:ne,right:ne,top:ie,bottom:ie+te.height}}function jo(x,z,ne,te,ie){var le=Mt(x,z,ne);return le.xRel=ie,te&&(le.outside=te),le}function qs(x,z,ne){var te=x.doc;if(ne+=x.display.viewOffset,ne<0)return jo(te.first,0,null,-1,-1);var ie=sn(te,ne),le=te.first+te.size-1;if(ie>le)return jo(te.first+te.size-1,We(te,le).text.length,null,1,1);z<0&&(z=0);for(var me=We(te,ie);;){var we=_c(x,me,ie,z,ne),_e=Xn(me,we.ch+(we.xRel>0||we.outside>0?1:0));if(!_e)return we;var Ie=_e.find(1);if(Ie.line==ie)return Ie;me=We(te,ie=Ie.line)}}function Kl(x,z,ne,te){te-=to(z);var ie=z.text.length,le=Jt(function(me){return Oi(x,ne,me-1).bottom<=te},ie,0);return ie=Jt(function(me){return Oi(x,ne,me).top>te},le,ie),{begin:le,end:ie}}function Hl(x,z,ne,te){ne||(ne=Oa(x,z));var ie=Na(x,z,Oi(x,ne,te),"line").top;return Kl(x,z,ne,ie)}function Cs(x,z,ne,te){return x.bottom<=ne?!1:x.top>ne?!0:(te?x.left:x.right)>z}function _c(x,z,ne,te,ie){ie-=Gn(z);var le=Oa(x,z),me=to(z),we=0,_e=z.text.length,Ie=!0,ot=En(z,x.doc.direction);if(ot){var wt=(x.options.lineWrapping?xl:is)(x,z,ne,le,ot,te,ie);Ie=wt.level!=1,we=Ie?wt.from:wt.to-1,_e=Ie?wt.to:wt.from-1}var on=null,qt=null,An=Jt(function(Qr){var ti=Oi(x,le,Qr);return ti.top+=me,ti.bottom+=me,Cs(ti,te,ie,!1)?(ti.top<=ie&&ti.left<=te&&(on=Qr,qt=ti),!0):!1},we,_e),Kn,pr,Lr=!1;if(qt){var Or=te-qt.left<qt.right-te,Cr=Or==Ie;An=on+(Cr?0:1),pr=Cr?"after":"before",Kn=Or?qt.left:qt.right}else{!Ie&&(An==_e||An==we)&&An++,pr=An==0?"after":An==z.text.length?"before":Oi(x,le,An-(Ie?1:0)).bottom+me<=ie==Ie?"after":"before";var Fr=Da(x,Mt(ne,An,pr),"line",z,le);Kn=Fr.left,Lr=ie<Fr.top?-1:ie>=Fr.bottom?1:0}return An=ln(z.text,An,1),jo(ne,An,pr,Lr,te-Kn)}function is(x,z,ne,te,ie,le,me){var we=Jt(function(wt){var on=ie[wt],qt=on.level!=1;return Cs(Da(x,Mt(ne,qt?on.to:on.from,qt?"before":"after"),"line",z,te),le,me,!0)},0,ie.length-1),_e=ie[we];if(we>0){var Ie=_e.level!=1,ot=Da(x,Mt(ne,Ie?_e.from:_e.to,Ie?"after":"before"),"line",z,te);Cs(ot,le,me,!0)&&ot.top>me&&(_e=ie[we-1])}return _e}function xl(x,z,ne,te,ie,le,me){var we=Kl(x,z,te,me),_e=we.begin,Ie=we.end;/\s/.test(z.text.charAt(Ie-1))&&Ie--;for(var ot=null,wt=null,on=0;on<ie.length;on++){var qt=ie[on];if(!(qt.from>=Ie||qt.to<=_e)){var An=qt.level!=1,Kn=Oi(x,te,An?Math.min(Ie,qt.to)-1:Math.max(_e,qt.from)).right,pr=Kn<le?le-Kn+1e9:Kn-le;(!ot||wt>pr)&&(ot=qt,wt=pr)}}return ot||(ot=ie[ie.length-1]),ot.from<_e&&(ot={from:_e,to:ot.to,level:ot.level}),ot.to>Ie&&(ot={from:ot.from,to:Ie,level:ot.level}),ot}var Vo;function as(x){if(x.cachedTextHeight!=null)return x.cachedTextHeight;if(Vo==null){Vo=Ue("pre",null,"CodeMirror-line-like");for(var z=0;z<49;++z)Vo.appendChild(document.createTextNode("x")),Vo.appendChild(Ue("br"));Vo.appendChild(document.createTextNode("x"))}vt(x.measure,Vo);var ne=Vo.offsetHeight/50;return ne>3&&(x.cachedTextHeight=ne),at(x.measure),ne||1}function Pi(x){if(x.cachedCharWidth!=null)return x.cachedCharWidth;var z=Ue("span","xxxxxxxxxx"),ne=Ue("pre",[z],"CodeMirror-line-like");vt(x.measure,ne);var te=z.getBoundingClientRect(),ie=(te.right-te.left)/10;return ie>2&&(x.cachedCharWidth=ie),ie||10}function Bi(x){for(var z=x.display,ne={},te={},ie=z.gutters.clientLeft,le=z.gutters.firstChild,me=0;le;le=le.nextSibling,++me){var we=x.display.gutterSpecs[me].className;ne[we]=le.offsetLeft+le.clientLeft+ie,te[we]=le.clientWidth}return{fixedPos:ji(z),gutterTotalWidth:z.gutters.offsetWidth,gutterLeft:ne,gutterWidth:te,wrapperWidth:z.wrapper.clientWidth}}function ji(x){return x.scroller.getBoundingClientRect().left-x.sizer.getBoundingClientRect().left}function Ya(x){var z=as(x.display),ne=x.options.lineWrapping,te=ne&&Math.max(5,x.display.scroller.clientWidth/Pi(x.display)-3);return function(ie){if(yi(x.doc,ie))return 0;var le=0;if(ie.widgets)for(var me=0;me<ie.widgets.length;me++)ie.widgets[me].height&&(le+=ie.widgets[me].height);return ne?le+(Math.ceil(ie.text.length/te)||1)*z:le+z}}function Aa(x){var z=x.doc,ne=Ya(x);z.iter(function(te){var ie=ne(te);ie!=te.height&&Lt(te,ie)})}function xo(x,z,ne,te){var ie=x.display;if(!ne&&tr(z).getAttribute("cm-not-content")=="true")return null;var le,me,we=ie.lineSpace.getBoundingClientRect();try{le=z.clientX-we.left,me=z.clientY-we.top}catch(wt){return null}var _e=qs(x,le,me),Ie;if(te&&_e.xRel>0&&(Ie=We(x.doc,_e.line).text).length==_e.ch){var ot=ze(Ie,Ie.length,x.options.tabSize)-Ie.length;_e=Mt(_e.line,Math.max(0,Math.round((le-fo(x.display).left)/Pi(x.display))-ot))}return _e}function po(x,z){if(z>=x.display.viewTo||(z-=x.display.viewFrom,z<0))return null;for(var ne=x.display.view,te=0;te<ne.length;te++)if(z-=ne[te].size,z<0)return te}function za(x,z,ne,te){z==null&&(z=x.doc.first),ne==null&&(ne=x.doc.first+x.doc.size),te||(te=0);var ie=x.display;if(te&&ne<ie.viewTo&&(ie.updateLineNumbers==null||ie.updateLineNumbers>z)&&(ie.updateLineNumbers=z),x.curOp.viewChanged=!0,z>=ie.viewTo)Qn&&ri(x.doc,z)<ie.viewTo&&To(x);else if(ne<=ie.viewFrom)Qn&&Yr(x.doc,ne+te)>ie.viewFrom?To(x):(ie.viewFrom+=te,ie.viewTo+=te);else if(z<=ie.viewFrom&&ne>=ie.viewTo)To(x);else if(z<=ie.viewFrom){var le=wo(x,ne,ne+te,1);le?(ie.view=ie.view.slice(le.index),ie.viewFrom=le.lineN,ie.viewTo+=te):To(x)}else if(ne>=ie.viewTo){var me=wo(x,z,z,-1);me?(ie.view=ie.view.slice(0,me.index),ie.viewTo=me.lineN):To(x)}else{var we=wo(x,z,z,-1),_e=wo(x,ne,ne+te,1);we&&_e?(ie.view=ie.view.slice(0,we.index).concat(fi(x,we.lineN,_e.lineN)).concat(ie.view.slice(_e.index)),ie.viewTo+=te):To(x)}var Ie=ie.externalMeasured;Ie&&(ne<Ie.lineN?Ie.lineN+=te:z<Ie.lineN+Ie.size&&(ie.externalMeasured=null))}function Ao(x,z,ne){x.curOp.viewChanged=!0;var te=x.display,ie=x.display.externalMeasured;if(ie&&z>=ie.lineN&&z<ie.lineN+ie.size&&(te.externalMeasured=null),!(z<te.viewFrom||z>=te.viewTo)){var le=te.view[po(x,z)];if(le.node!=null){var me=le.changes||(le.changes=[]);bt(me,ne)==-1&&me.push(ne)}}}function To(x){x.display.viewFrom=x.display.viewTo=x.doc.first,x.display.view=[],x.display.viewOffset=0}function wo(x,z,ne,te){var ie=po(x,z),le,me=x.display.view;if(!Qn||ne==x.doc.first+x.doc.size)return{index:ie,lineN:ne};for(var we=x.display.viewFrom,_e=0;_e<ie;_e++)we+=me[_e].size;if(we!=z){if(te>0){if(ie==me.length-1)return null;le=we+me[ie].size-z,ie++}else le=we-z;z+=le,ne+=le}for(;ri(x.doc,ne)!=ne;){if(ie==(te<0?0:me.length-1))return null;ne+=te*me[ie-(te<0?1:0)].size,ie+=te}return{index:ie,lineN:ne}}function os(x,z,ne){var te=x.display,ie=te.view;ie.length==0||z>=te.viewTo||ne<=te.viewFrom?(te.view=fi(x,z,ne),te.viewFrom=z):(te.viewFrom>z?te.view=fi(x,z,te.viewFrom).concat(te.view):te.viewFrom<z&&(te.view=te.view.slice(po(x,z))),te.viewFrom=z,te.viewTo<ne?te.view=te.view.concat(fi(x,te.viewTo,ne)):te.viewTo>ne&&(te.view=te.view.slice(0,po(x,ne)))),te.viewTo=ne}function Wl(x){for(var z=x.display.view,ne=0,te=0;te<z.length;te++){var ie=z[te];!ie.hidden&&(!ie.node||ie.changes)&&++ne}return ne}function wl(x){x.display.input.showSelection(x.display.input.prepareSelection())}function _u(x,z){z===void 0&&(z=!0);for(var ne=x.doc,te={},ie=te.cursors=document.createDocumentFragment(),le=te.selection=document.createDocumentFragment(),me=0;me<ne.sel.ranges.length;me++)if(!(!z&&me==ne.sel.primIndex)){var we=ne.sel.ranges[me];if(!(we.from().line>=x.display.viewTo||we.to().line<x.display.viewFrom)){var _e=we.empty();(_e||x.options.showCursorWhenSelecting)&&ku(x,we.head,ie),_e||Od(x,we,le)}}return te}function ku(x,z,ne){var te=Da(x,z,"div",null,null,!x.options.singleCursorHeightPerLine),ie=ne.appendChild(Ue("div","\xA0","CodeMirror-cursor"));if(ie.style.left=te.left+"px",ie.style.top=te.top+"px",ie.style.height=Math.max(0,te.bottom-te.top)*x.options.cursorHeight+"px",te.other){var le=ne.appendChild(Ue("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));le.style.display="",le.style.left=te.other.left+"px",le.style.top=te.other.top+"px",le.style.height=(te.other.bottom-te.other.top)*.85+"px"}}function Zl(x,z){return x.top-z.top||x.left-z.left}function Od(x,z,ne){var te=x.display,ie=x.doc,le=document.createDocumentFragment(),me=fo(x.display),we=me.left,_e=Math.max(te.sizerWidth,fa(x)-te.sizer.offsetLeft)-me.right,Ie=ie.direction=="ltr";function ot(Cr,Fr,Qr,ti){Fr<0&&(Fr=0),Fr=Math.round(Fr),ti=Math.round(ti),le.appendChild(Ue("div",null,"CodeMirror-selected","position: absolute; left: "+Cr+`px;
top: `+Fr+"px; width: "+(Qr==null?_e-Cr:Qr)+`px;
height: `+(ti-Fr)+"px"))}function wt(Cr,Fr,Qr){var ti=We(ie,Cr),Ci=ti.text.length,Ji,$a;function da(_a,ho){return lo(x,Mt(Cr,_a),"div",ti,ho)}function co(_a,ho,hi){var ma=Hl(x,ti,null,_a),ha=ho=="ltr"==(hi=="after")?"left":"right",ga=hi=="after"?ma.begin:ma.end-(/\s/.test(ti.text.charAt(ma.end-1))?2:1);return da(ga,ha)[ha]}var uo=En(ti,ie.direction);return en(uo,Fr||0,Qr==null?Ci:Qr,function(_a,ho,hi,ma){var ha=hi=="ltr",ga=da(_a,ha?"left":"right"),ba=da(ho-1,ha?"right":"left"),fl=Fr==null&&_a==0,vo=Qr==null&&ho==Ci,Za=ma==0,Ri=!uo||ma==uo.length-1;if(ba.top-ga.top<=3){var Ia=(Ie?fl:vo)&&Za,au=(Ie?vo:fl)&&Ri,bs=Ia?we:(ha?ga:ba).left,$s=au?_e:(ha?ba:ga).right;ot(bs,ga.top,$s-bs,ga.bottom)}else{var Yo,ka,pl,ja;ha?(Yo=Ie&&fl&&Za?we:ga.left,ka=Ie?_e:co(_a,hi,"before"),pl=Ie?we:co(ho,hi,"after"),ja=Ie&&vo&&Ri?_e:ba.right):(Yo=Ie?co(_a,hi,"before"):we,ka=!Ie&&fl&&Za?_e:ga.right,pl=!Ie&&vo&&Ri?we:ba.left,ja=Ie?co(ho,hi,"after"):_e),ot(Yo,ga.top,ka-Yo,ga.bottom),ga.bottom<ba.top&&ot(we,ga.bottom,null,ba.top),ot(pl,ba.top,ja-pl,ba.bottom)}(!Ji||Zl(ga,Ji)<0)&&(Ji=ga),Zl(ba,Ji)<0&&(Ji=ba),(!$a||Zl(ga,$a)<0)&&($a=ga),Zl(ba,$a)<0&&($a=ba)}),{start:Ji,end:$a}}var on=z.from(),qt=z.to();if(on.line==qt.line)wt(on.line,on.ch,qt.ch);else{var An=We(ie,on.line),Kn=We(ie,qt.line),pr=Br(An)==Br(Kn),Lr=wt(on.line,on.ch,pr?An.text.length+1:null).end,Or=wt(qt.line,pr?0:null,qt.ch).start;pr&&(Lr.top<Or.top-2?(ot(Lr.right,Lr.top,null,Lr.bottom),ot(we,Or.top,Or.left,Or.bottom)):ot(Lr.right,Lr.top,Or.left-Lr.right,Lr.bottom)),Lr.bottom<Or.top&&ot(we,Lr.bottom,null,Or.top)}ne.appendChild(le)}function kc(x){if(x.state.focused){var z=x.display;clearInterval(z.blinker);var ne=!0;z.cursorDiv.style.visibility="",x.options.cursorBlinkRate>0?z.blinker=setInterval(function(){x.hasFocus()||Js(x),z.cursorDiv.style.visibility=(ne=!ne)?"":"hidden"},x.options.cursorBlinkRate):x.options.cursorBlinkRate<0&&(z.cursorDiv.style.visibility="hidden")}}function Sl(x){x.state.focused||(x.display.input.focus(),Ec(x))}function Eu(x){x.state.delayingBlurEvent=!0,setTimeout(function(){x.state.delayingBlurEvent&&(x.state.delayingBlurEvent=!1,Js(x))},100)}function Ec(x,z){x.state.delayingBlurEvent&&(x.state.delayingBlurEvent=!1),x.options.readOnly!="nocursor"&&(x.state.focused||(Re(x,"focus",x,z),x.state.focused=!0,Ht(x.display.wrapper,"CodeMirror-focused"),!x.curOp&&x.display.selForContextMenu!=x.doc.sel&&(x.display.input.reset(),Ne&&setTimeout(function(){return x.display.input.reset(!0)},20)),x.display.input.receivedFocus()),kc(x))}function Js(x,z){x.state.delayingBlurEvent||(x.state.focused&&(Re(x,"blur",x,z),x.state.focused=!1,Xe(x.display.wrapper,"CodeMirror-focused")),clearInterval(x.display.blinker),setTimeout(function(){x.state.focused||(x.display.shift=!1)},150))}function jl(x){for(var z=x.display,ne=z.lineDiv.offsetTop,te=0;te<z.view.length;te++){var ie=z.view[te],le=x.options.lineWrapping,me=void 0,we=0;if(!ie.hidden){if(Se&&Pe<8){var _e=ie.node.offsetTop+ie.node.offsetHeight;me=_e-ne,ne=_e}else{var Ie=ie.node.getBoundingClientRect();me=Ie.bottom-Ie.top,!le&&ie.text.firstChild&&(we=ie.text.firstChild.getBoundingClientRect().right-Ie.left-1)}var ot=ie.line.height-me;if((ot>.005||ot<-.005)&&(Lt(ie.line,me),Lu(ie.line),ie.rest))for(var wt=0;wt<ie.rest.length;wt++)Lu(ie.rest[wt]);if(we>x.display.sizerWidth){var on=Math.ceil(we/Pi(x.display));on>x.display.maxLineLength&&(x.display.maxLineLength=on,x.display.maxLine=ie.line,x.display.maxLineChanged=!0)}}}}function Lu(x){if(x.widgets)for(var z=0;z<x.widgets.length;++z){var ne=x.widgets[z],te=ne.node.parentNode;te&&(ne.height=te.offsetHeight)}}function Ta(x,z,ne){var te=ne&&ne.top!=null?Math.max(0,ne.top):x.scroller.scrollTop;te=Math.floor(te-eo(x));var ie=ne&&ne.bottom!=null?ne.bottom:te+x.wrapper.clientHeight,le=sn(z,te),me=sn(z,ie);if(ne&&ne.ensure){var we=ne.ensure.from.line,_e=ne.ensure.to.line;we<le?(le=we,me=sn(z,Gn(We(z,we))+x.wrapper.clientHeight)):Math.min(_e,z.lastLine())>=me&&(le=sn(z,Gn(We(z,_e))-x.wrapper.clientHeight),me=_e)}return{from:le,to:Math.max(me,le+1)}}function ss(x,z){if(!Ze(x,"scrollCursorIntoView")){var ne=x.display,te=ne.sizer.getBoundingClientRect(),ie=null;if(z.top+te.top<0?ie=!0:z.bottom+te.top>(window.innerHeight||document.documentElement.clientHeight)&&(ie=!1),ie!=null&&!je){var le=Ue("div","\u200B",null,`position: absolute;
top: `+(z.top-ne.viewOffset-eo(x.display))+`px;
height: `+(z.bottom-z.top+Ea(x)+ne.barHeight)+`px;
left: `+z.left+"px; width: "+Math.max(2,z.right-z.left)+"px;");x.display.lineSpace.appendChild(le),le.scrollIntoView(ie),x.display.lineSpace.removeChild(le)}}}function Ms(x,z,ne,te){te==null&&(te=0);var ie;!x.options.lineWrapping&&z==ne&&(z=z.ch?Mt(z.line,z.sticky=="before"?z.ch-1:z.ch,"after"):z,ne=z.sticky=="before"?Mt(z.line,z.ch+1,"before"):z);for(var le=0;le<5;le++){var me=!1,we=Da(x,z),_e=!ne||ne==z?we:Da(x,ne);ie={left:Math.min(we.left,_e.left),top:Math.min(we.top,_e.top)-te,right:Math.max(we.left,_e.left),bottom:Math.max(we.bottom,_e.bottom)+te};var Ie=Vl(x,ie),ot=x.doc.scrollTop,wt=x.doc.scrollLeft;if(Ie.scrollTop!=null&&(_s(x,Ie.scrollTop),Math.abs(x.doc.scrollTop-ot)>1&&(me=!0)),Ie.scrollLeft!=null&&(ks(x,Ie.scrollLeft),Math.abs(x.doc.scrollLeft-wt)>1&&(me=!0)),!me)break}return ie}function Rd(x,z){var ne=Vl(x,z);ne.scrollTop!=null&&_s(x,ne.scrollTop),ne.scrollLeft!=null&&ks(x,ne.scrollLeft)}function Vl(x,z){var ne=x.display,te=as(x.display);z.top<0&&(z.top=0);var ie=x.curOp&&x.curOp.scrollTop!=null?x.curOp.scrollTop:ne.scroller.scrollTop,le=bo(x),me={};z.bottom-z.top>le&&(z.bottom=z.top+le);var we=x.doc.height+Ss(ne),_e=z.top<te,Ie=z.bottom>we-te;if(z.top<ie)me.scrollTop=_e?0:z.top;else if(z.bottom>ie+le){var ot=Math.min(z.top,(Ie?we:z.bottom)-le);ot!=ie&&(me.scrollTop=ot)}var wt=x.options.fixedGutter?0:ne.gutters.offsetWidth,on=x.curOp&&x.curOp.scrollLeft!=null?x.curOp.scrollLeft:ne.scroller.scrollLeft-wt,qt=fa(x)-ne.gutters.offsetWidth,An=z.right-z.left>qt;return An&&(z.right=z.left+qt),z.left<10?me.scrollLeft=0:z.left<on?me.scrollLeft=Math.max(0,z.left+wt-(An?0:10)):z.right>qt+on-3&&(me.scrollLeft=z.right+(An?0:10)-qt),me}function Lc(x,z){z!=null&&(Ul(x),x.curOp.scrollTop=(x.curOp.scrollTop==null?x.doc.scrollTop:x.curOp.scrollTop)+z)}function Qs(x){Ul(x);var z=x.getCursor();x.curOp.scrollToPos={from:z,to:z,margin:x.options.cursorScrollMargin}}function el(x,z,ne){(z!=null||ne!=null)&&Ul(x),z!=null&&(x.curOp.scrollLeft=z),ne!=null&&(x.curOp.scrollTop=ne)}function Nd(x,z){Ul(x),x.curOp.scrollToPos=z}function Ul(x){var z=x.curOp.scrollToPos;if(z){x.curOp.scrollToPos=null;var ne=bl(x,z.from),te=bl(x,z.to);Du(x,ne,te,z.margin)}}function Du(x,z,ne,te){var ie=Vl(x,{left:Math.min(z.left,ne.left),top:Math.min(z.top,ne.top)-te,right:Math.max(z.right,ne.right),bottom:Math.max(z.bottom,ne.bottom)+te});el(x,ie.scrollLeft,ie.scrollTop)}function _s(x,z){Math.abs(x.doc.scrollTop-z)<2||(pe||Tc(x,{top:z}),Au(x,z,!0),pe&&Tc(x),nl(x,100))}function Au(x,z,ne){z=Math.max(0,Math.min(x.display.scroller.scrollHeight-x.display.scroller.clientHeight,z)),!(x.display.scroller.scrollTop==z&&!ne)&&(x.doc.scrollTop=z,x.display.scrollbars.setScrollTop(z),x.display.scroller.scrollTop!=z&&(x.display.scroller.scrollTop=z))}function ks(x,z,ne,te){z=Math.max(0,Math.min(z,x.display.scroller.scrollWidth-x.display.scroller.clientWidth)),!((ne?z==x.doc.scrollLeft:Math.abs(x.doc.scrollLeft-z)<2)&&!te)&&(x.doc.scrollLeft=z,Ru(x),x.display.scroller.scrollLeft!=z&&(x.display.scroller.scrollLeft=z),x.display.scrollbars.setScrollLeft(z))}function tl(x){var z=x.display,ne=z.gutters.offsetWidth,te=Math.round(x.doc.height+Ss(x.display));return{clientHeight:z.scroller.clientHeight,viewHeight:z.wrapper.clientHeight,scrollWidth:z.scroller.scrollWidth,clientWidth:z.scroller.clientWidth,viewWidth:z.wrapper.clientWidth,barLeft:x.options.fixedGutter?ne:0,docHeight:te,scrollHeight:te+Ea(x)+z.barHeight,nativeBarWidth:z.nativeBarWidth,gutterWidth:ne}}var ls=function(x,z,ne){this.cm=ne;var te=this.vert=Ue("div",[Ue("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),ie=this.horiz=Ue("div",[Ue("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");te.tabIndex=ie.tabIndex=-1,x(te),x(ie),gn(te,"scroll",function(){te.clientHeight&&z(te.scrollTop,"vertical")}),gn(ie,"scroll",function(){ie.clientWidth&&z(ie.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,Se&&Pe<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ls.prototype.update=function(x){var z=x.scrollWidth>x.clientWidth+1,ne=x.scrollHeight>x.clientHeight+1,te=x.nativeBarWidth;if(ne){this.vert.style.display="block",this.vert.style.bottom=z?te+"px":"0";var ie=x.viewHeight-(z?te:0);this.vert.firstChild.style.height=Math.max(0,x.scrollHeight-x.clientHeight+ie)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(z){this.horiz.style.display="block",this.horiz.style.right=ne?te+"px":"0",this.horiz.style.left=x.barLeft+"px";var le=x.viewWidth-x.barLeft-(ne?te:0);this.horiz.firstChild.style.width=Math.max(0,x.scrollWidth-x.clientWidth+le)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&x.clientHeight>0&&(te==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:ne?te:0,bottom:z?te:0}},ls.prototype.setScrollLeft=function(x){this.horiz.scrollLeft!=x&&(this.horiz.scrollLeft=x),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ls.prototype.setScrollTop=function(x){this.vert.scrollTop!=x&&(this.vert.scrollTop=x),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ls.prototype.zeroWidthHack=function(){var x=st&&!Oe?"12px":"18px";this.horiz.style.height=this.vert.style.width=x,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new xe,this.disableVert=new xe},ls.prototype.enableZeroWidthBar=function(x,z,ne){x.style.pointerEvents="auto";function te(){var ie=x.getBoundingClientRect(),le=ne=="vert"?document.elementFromPoint(ie.right-1,(ie.top+ie.bottom)/2):document.elementFromPoint((ie.right+ie.left)/2,ie.bottom-1);le!=x?x.style.pointerEvents="none":z.set(1e3,te)}z.set(1e3,te)},ls.prototype.clear=function(){var x=this.horiz.parentNode;x.removeChild(this.horiz),x.removeChild(this.vert)};var mo=function(){};mo.prototype.update=function(){return{bottom:0,right:0}},mo.prototype.setScrollLeft=function(){},mo.prototype.setScrollTop=function(){},mo.prototype.clear=function(){};function Es(x,z){z||(z=tl(x));var ne=x.display.barWidth,te=x.display.barHeight;Dc(x,z);for(var ie=0;ie<4&&ne!=x.display.barWidth||te!=x.display.barHeight;ie++)ne!=x.display.barWidth&&x.options.lineWrapping&&jl(x),Dc(x,tl(x)),ne=x.display.barWidth,te=x.display.barHeight}function Dc(x,z){var ne=x.display,te=ne.scrollbars.update(z);ne.sizer.style.paddingRight=(ne.barWidth=te.right)+"px",ne.sizer.style.paddingBottom=(ne.barHeight=te.bottom)+"px",ne.heightForcer.style.borderBottom=te.bottom+"px solid transparent",te.right&&te.bottom?(ne.scrollbarFiller.style.display="block",ne.scrollbarFiller.style.height=te.bottom+"px",ne.scrollbarFiller.style.width=te.right+"px"):ne.scrollbarFiller.style.display="",te.bottom&&x.options.coverGutterNextToScrollbar&&x.options.fixedGutter?(ne.gutterFiller.style.display="block",ne.gutterFiller.style.height=te.bottom+"px",ne.gutterFiller.style.width=z.gutterWidth+"px"):ne.gutterFiller.style.display=""}var Tu={native:ls,null:mo};function Pu(x){x.display.scrollbars&&(x.display.scrollbars.clear(),x.display.scrollbars.addClass&&Xe(x.display.wrapper,x.display.scrollbars.addClass)),x.display.scrollbars=new Tu[x.options.scrollbarStyle](function(z){x.display.wrapper.insertBefore(z,x.display.scrollbarFiller),gn(z,"mousedown",function(){x.state.focused&&setTimeout(function(){return x.display.input.focus()},0)}),z.setAttribute("cm-not-content","true")},function(z,ne){ne=="horizontal"?ks(x,z):_s(x,z)},x),x.display.scrollbars.addClass&&Ht(x.display.wrapper,x.display.scrollbars.addClass)}var $d=0;function Ls(x){x.curOp={cm:x,viewChanged:!1,startHeight:x.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:++$d},pi(x.curOp)}function cs(x){var z=x.curOp;z&&Xr(z,function(ne){for(var te=0;te<ne.ops.length;te++)ne.ops[te].cm.curOp=null;Fd(ne)})}function Fd(x){for(var z=x.ops,ne=0;ne<z.length;ne++)zd(z[ne]);for(var te=0;te<z.length;te++)Kd(z[te]);for(var ie=0;ie<z.length;ie++)Hd(z[ie]);for(var le=0;le<z.length;le++)Wd(z[le]);for(var me=0;me<z.length;me++)Zd(z[me])}function zd(x){var z=x.cm,ne=z.display;Bu(z),x.updateMaxLine&&Hn(z),x.mustUpdate=x.viewChanged||x.forceUpdate||x.scrollTop!=null||x.scrollToPos&&(x.scrollToPos.from.line<ne.viewFrom||x.scrollToPos.to.line>=ne.viewTo)||ne.maxLineChanged&&z.options.lineWrapping,x.update=x.mustUpdate&&new Gl(z,x.mustUpdate&&{top:x.scrollTop,ensure:x.scrollToPos},x.forceUpdate)}function Kd(x){x.updatedDisplay=x.mustUpdate&&Ac(x.cm,x.update)}function Hd(x){var z=x.cm,ne=z.display;x.updatedDisplay&&jl(z),x.barMeasure=tl(z),ne.maxLineChanged&&!z.options.lineWrapping&&(x.adjustWidthTo=Ro(z,ne.maxLine,ne.maxLine.text.length).left+3,z.display.sizerWidth=x.adjustWidthTo,x.barMeasure.scrollWidth=Math.max(ne.scroller.clientWidth,ne.sizer.offsetLeft+x.adjustWidthTo+Ea(z)+z.display.barWidth),x.maxScrollLeft=Math.max(0,ne.sizer.offsetLeft+x.adjustWidthTo-fa(z))),(x.updatedDisplay||x.selectionChanged)&&(x.preparedSelection=ne.input.prepareSelection())}function Wd(x){var z=x.cm;x.adjustWidthTo!=null&&(z.display.sizer.style.minWidth=x.adjustWidthTo+"px",x.maxScrollLeft<z.doc.scrollLeft&&ks(z,Math.min(z.display.scroller.scrollLeft,x.maxScrollLeft),!0),z.display.maxLineChanged=!1);var ne=x.focus&&x.focus==qe();x.preparedSelection&&z.display.input.showSelection(x.preparedSelection,ne),(x.updatedDisplay||x.startHeight!=z.doc.height)&&Es(z,x.barMeasure),x.updatedDisplay&&Ic(z,x.barMeasure),x.selectionChanged&&kc(z),z.state.focused&&x.updateInput&&z.display.input.reset(x.typing),ne&&Sl(x.cm)}function Zd(x){var z=x.cm,ne=z.display,te=z.doc;if(x.updatedDisplay&&Ou(z,x.update),ne.wheelStartX!=null&&(x.scrollTop!=null||x.scrollLeft!=null||x.scrollToPos)&&(ne.wheelStartX=ne.wheelStartY=null),x.scrollTop!=null&&Au(z,x.scrollTop,x.forceScroll),x.scrollLeft!=null&&ks(z,x.scrollLeft,!0,!0),x.scrollToPos){var ie=Ms(z,St(te,x.scrollToPos.from),St(te,x.scrollToPos.to),x.scrollToPos.margin);ss(z,ie)}var le=x.maybeHiddenMarkers,me=x.maybeUnhiddenMarkers;if(le)for(var we=0;we<le.length;++we)le[we].lines.length||Re(le[we],"hide");if(me)for(var _e=0;_e<me.length;++_e)me[_e].lines.length&&Re(me[_e],"unhide");ne.wrapper.offsetHeight&&(te.scrollTop=z.display.scroller.scrollTop),x.changeObjs&&Re(z,"changes",z,x.changeObjs),x.update&&x.update.finish()}function pa(x,z){if(x.curOp)return z();Ls(x);try{return z()}finally{cs(x)}}function Sa(x,z){return function(){if(x.curOp)return z.apply(x,arguments);Ls(x);try{return z.apply(x,arguments)}finally{cs(x)}}}function ua(x){return function(){if(this.curOp)return x.apply(this,arguments);Ls(this);try{return x.apply(this,arguments)}finally{cs(this)}}}function Pa(x){return function(){var z=this.cm;if(!z||z.curOp)return x.apply(this,arguments);Ls(z);try{return x.apply(this,arguments)}finally{cs(z)}}}function nl(x,z){x.doc.highlightFrontier<x.display.viewTo&&x.state.highlight.set(z,Xt(Iu,x))}function Iu(x){var z=x.doc;if(!(z.highlightFrontier>=x.display.viewTo)){var ne=+new Date+x.options.workTime,te=Pt(x,z.highlightFrontier),ie=[];z.iter(te.line,Math.min(z.first+z.size,x.display.viewTo+500),function(le){if(te.line>=x.display.viewFrom){var me=le.styles,we=le.text.length>x.options.maxHighlightLength?Me(z.mode,te.state):null,_e=Tt(x,le,te,!0);we&&(te.state=we),le.styles=_e.styles;var Ie=le.styleClasses,ot=_e.classes;ot?le.styleClasses=ot:Ie&&(le.styleClasses=null);for(var wt=!me||me.length!=le.styles.length||Ie!=ot&&(!Ie||!ot||Ie.bgClass!=ot.bgClass||Ie.textClass!=ot.textClass),on=0;!wt&&on<me.length;++on)wt=me[on]!=le.styles[on];wt&&ie.push(te.line),le.stateAfter=te.save(),te.nextLine()}else le.text.length<=x.options.maxHighlightLength&&Bt(x,le.text,te),le.stateAfter=te.line%5==0?te.save():null,te.nextLine();if(+new Date>ne)return nl(x,x.options.workDelay),!0}),z.highlightFrontier=te.line,z.modeFrontier=Math.max(z.modeFrontier,te.line),ie.length&&pa(x,function(){for(var le=0;le<ie.length;le++)Ao(x,ie[le],"text")})}}var Gl=function(x,z,ne){var te=x.display;this.viewport=z,this.visible=Ta(te,x.doc,z),this.editorIsHidden=!te.wrapper.offsetWidth,this.wrapperHeight=te.wrapper.clientHeight,this.wrapperWidth=te.wrapper.clientWidth,this.oldDisplayWidth=fa(x),this.force=ne,this.dims=Bi(x),this.events=[]};Gl.prototype.signal=function(x,z){Qt(x,z)&&this.events.push(arguments)},Gl.prototype.finish=function(){for(var x=0;x<this.events.length;x++)Re.apply(null,this.events[x])};function Bu(x){var z=x.display;!z.scrollbarsClipped&&z.scroller.offsetWidth&&(z.nativeBarWidth=z.scroller.offsetWidth-z.scroller.clientWidth,z.heightForcer.style.height=Ea(x)+"px",z.sizer.style.marginBottom=-z.nativeBarWidth+"px",z.sizer.style.borderRightWidth=Ea(x)+"px",z.scrollbarsClipped=!0)}function jd(x){if(x.hasFocus())return null;var z=qe();if(!z||!At(x.display.lineDiv,z))return null;var ne={activeElt:z};if(window.getSelection){var te=window.getSelection();te.anchorNode&&te.extend&&At(x.display.lineDiv,te.anchorNode)&&(ne.anchorNode=te.anchorNode,ne.anchorOffset=te.anchorOffset,ne.focusNode=te.focusNode,ne.focusOffset=te.focusOffset)}return ne}function Vd(x){if(!(!x||!x.activeElt||x.activeElt==qe())&&(x.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(x.activeElt.nodeName)&&x.anchorNode&&At(document.body,x.anchorNode)&&At(document.body,x.focusNode))){var z=window.getSelection(),ne=document.createRange();ne.setEnd(x.anchorNode,x.anchorOffset),ne.collapse(!1),z.removeAllRanges(),z.addRange(ne),z.extend(x.focusNode,x.focusOffset)}}function Ac(x,z){var ne=x.display,te=x.doc;if(z.editorIsHidden)return To(x),!1;if(!z.force&&z.visible.from>=ne.viewFrom&&z.visible.to<=ne.viewTo&&(ne.updateLineNumbers==null||ne.updateLineNumbers>=ne.viewTo)&&ne.renderedView==ne.view&&Wl(x)==0)return!1;Xl(x)&&(To(x),z.dims=Bi(x));var ie=te.first+te.size,le=Math.max(z.visible.from-x.options.viewportMargin,te.first),me=Math.min(ie,z.visible.to+x.options.viewportMargin);ne.viewFrom<le&&le-ne.viewFrom<20&&(le=Math.max(te.first,ne.viewFrom)),ne.viewTo>me&&ne.viewTo-me<20&&(me=Math.min(ie,ne.viewTo)),Qn&&(le=ri(x.doc,le),me=Yr(x.doc,me));var we=le!=ne.viewFrom||me!=ne.viewTo||ne.lastWrapHeight!=z.wrapperHeight||ne.lastWrapWidth!=z.wrapperWidth;os(x,le,me),ne.viewOffset=Gn(We(x.doc,ne.viewFrom)),x.display.mover.style.top=ne.viewOffset+"px";var _e=Wl(x);if(!we&&_e==0&&!z.force&&ne.renderedView==ne.view&&(ne.updateLineNumbers==null||ne.updateLineNumbers>=ne.viewTo))return!1;var Ie=jd(x);return _e>4&&(ne.lineDiv.style.display="none"),Ud(x,ne.updateLineNumbers,z.dims),_e>4&&(ne.lineDiv.style.display=""),ne.renderedView=ne.view,Vd(Ie),at(ne.cursorDiv),at(ne.selectionDiv),ne.gutters.style.height=ne.sizer.style.minHeight=0,we&&(ne.lastWrapHeight=z.wrapperHeight,ne.lastWrapWidth=z.wrapperWidth,nl(x,400)),ne.updateLineNumbers=null,!0}function Ou(x,z){for(var ne=z.viewport,te=!0;;te=!1){if(!te||!x.options.lineWrapping||z.oldDisplayWidth==fa(x)){if(ne&&ne.top!=null&&(ne={top:Math.min(x.doc.height+Ss(x.display)-bo(x),ne.top)}),z.visible=Ta(x.display,x.doc,ne),z.visible.from>=x.display.viewFrom&&z.visible.to<=x.display.viewTo)break}else te&&(z.visible=Ta(x.display,x.doc,ne));if(!Ac(x,z))break;jl(x);var ie=tl(x);wl(x),Es(x,ie),Ic(x,ie),z.force=!1}z.signal(x,"update",x),(x.display.viewFrom!=x.display.reportedViewFrom||x.display.viewTo!=x.display.reportedViewTo)&&(z.signal(x,"viewportChange",x,x.display.viewFrom,x.display.viewTo),x.display.reportedViewFrom=x.display.viewFrom,x.display.reportedViewTo=x.display.viewTo)}function Tc(x,z){var ne=new Gl(x,z);if(Ac(x,ne)){jl(x),Ou(x,ne);var te=tl(x);wl(x),Es(x,te),Ic(x,te),ne.finish()}}function Ud(x,z,ne){var te=x.display,ie=x.options.lineNumbers,le=te.lineDiv,me=le.firstChild;function we(An){var Kn=An.nextSibling;return Ne&&st&&x.display.currentWheelTarget==An?An.style.display="none":An.parentNode.removeChild(An),Kn}for(var _e=te.view,Ie=te.viewFrom,ot=0;ot<_e.length;ot++){var wt=_e[ot];if(!wt.hidden)if(!wt.node||wt.node.parentNode!=le){var on=ca(x,wt,Ie,ne);le.insertBefore(on,me)}else{for(;me!=wt.node;)me=we(me);var qt=ie&&z!=null&&z<=Ie&&wt.lineNumber;wt.changes&&(bt(wt.changes,"gutter")>-1&&(qt=!1),oi(x,wt,Ie,ne)),qt&&(at(wt.lineNumber),wt.lineNumber.appendChild(document.createTextNode(xn(x.options,Ie)))),me=wt.node.nextSibling}Ie+=wt.size}for(;me;)me=we(me)}function Pc(x){var z=x.gutters.offsetWidth;x.sizer.style.marginLeft=z+"px"}function Ic(x,z){x.display.sizer.style.minHeight=z.docHeight+"px",x.display.heightForcer.style.top=z.docHeight+"px",x.display.gutters.style.height=z.docHeight+x.display.barHeight+Ea(x)+"px"}function Ru(x){var z=x.display,ne=z.view;if(!(!z.alignWidgets&&(!z.gutters.firstChild||!x.options.fixedGutter))){for(var te=ji(z)-z.scroller.scrollLeft+x.doc.scrollLeft,ie=z.gutters.offsetWidth,le=te+"px",me=0;me<ne.length;me++)if(!ne[me].hidden){x.options.fixedGutter&&(ne[me].gutter&&(ne[me].gutter.style.left=le),ne[me].gutterBackground&&(ne[me].gutterBackground.style.left=le));var we=ne[me].alignable;if(we)for(var _e=0;_e<we.length;_e++)we[_e].style.left=le}x.options.fixedGutter&&(z.gutters.style.left=te+ie+"px")}}function Xl(x){if(!x.options.lineNumbers)return!1;var z=x.doc,ne=xn(x.options,z.first+z.size-1),te=x.display;if(ne.length!=te.lineNumChars){var ie=te.measure.appendChild(Ue("div",[Ue("div",ne)],"CodeMirror-linenumber CodeMirror-gutter-elt")),le=ie.firstChild.offsetWidth,me=ie.offsetWidth-le;return te.lineGutter.style.width="",te.lineNumInnerWidth=Math.max(le,te.lineGutter.offsetWidth-me)+1,te.lineNumWidth=te.lineNumInnerWidth+me,te.lineNumChars=te.lineNumInnerWidth?ne.length:-1,te.lineGutter.style.width=te.lineNumWidth+"px",Pc(x.display),!0}return!1}function Bc(x,z){for(var ne=[],te=!1,ie=0;ie<x.length;ie++){var le=x[ie],me=null;if(typeof le!="string"&&(me=le.style,le=le.className),le=="CodeMirror-linenumbers")if(z)te=!0;else continue;ne.push({className:le,style:me})}return z&&!te&&ne.push({className:"CodeMirror-linenumbers",style:null}),ne}function Nu(x){var z=x.gutters,ne=x.gutterSpecs;at(z),x.lineGutter=null;for(var te=0;te<ne.length;++te){var ie=ne[te],le=ie.className,me=ie.style,we=z.appendChild(Ue("div",null,"CodeMirror-gutter "+le));me&&(we.style.cssText=me),le=="CodeMirror-linenumbers"&&(x.lineGutter=we,we.style.width=(x.lineNumWidth||1)+"px")}z.style.display=ne.length?"":"none",Pc(x)}function Cl(x){Nu(x.display),za(x),Ru(x)}function Gd(x,z,ne,te){var ie=this;this.input=ne,ie.scrollbarFiller=Ue("div",null,"CodeMirror-scrollbar-filler"),ie.scrollbarFiller.setAttribute("cm-not-content","true"),ie.gutterFiller=Ue("div",null,"CodeMirror-gutter-filler"),ie.gutterFiller.setAttribute("cm-not-content","true"),ie.lineDiv=Ot("div",null,"CodeMirror-code"),ie.selectionDiv=Ue("div",null,null,"position: relative; z-index: 1"),ie.cursorDiv=Ue("div",null,"CodeMirror-cursors"),ie.measure=Ue("div",null,"CodeMirror-measure"),ie.lineMeasure=Ue("div",null,"CodeMirror-measure"),ie.lineSpace=Ot("div",[ie.measure,ie.lineMeasure,ie.selectionDiv,ie.cursorDiv,ie.lineDiv],null,"position: relative; outline: none");var le=Ot("div",[ie.lineSpace],"CodeMirror-lines");ie.mover=Ue("div",[le],null,"position: relative"),ie.sizer=Ue("div",[ie.mover],"CodeMirror-sizer"),ie.sizerWidth=null,ie.heightForcer=Ue("div",null,null,"position: absolute; height: "+pn+"px; width: 1px;"),ie.gutters=Ue("div",null,"CodeMirror-gutters"),ie.lineGutter=null,ie.scroller=Ue("div",[ie.sizer,ie.heightForcer,ie.gutters],"CodeMirror-scroll"),ie.scroller.setAttribute("tabIndex","-1"),ie.wrapper=Ue("div",[ie.scrollbarFiller,ie.gutterFiller,ie.scroller],"CodeMirror"),Se&&Pe<8&&(ie.gutters.style.zIndex=-1,ie.scroller.style.paddingRight=0),!Ne&&!(pe&&mt)&&(ie.scroller.draggable=!0),x&&(x.appendChild?x.appendChild(ie.wrapper):x(ie.wrapper)),ie.viewFrom=ie.viewTo=z.first,ie.reportedViewFrom=ie.reportedViewTo=z.first,ie.view=[],ie.renderedView=null,ie.externalMeasured=null,ie.viewOffset=0,ie.lastWrapHeight=ie.lastWrapWidth=0,ie.updateLineNumbers=null,ie.nativeBarWidth=ie.barHeight=ie.barWidth=0,ie.scrollbarsClipped=!1,ie.lineNumWidth=ie.lineNumInnerWidth=ie.lineNumChars=null,ie.alignWidgets=!1,ie.cachedCharWidth=ie.cachedTextHeight=ie.cachedPaddingH=null,ie.maxLine=null,ie.maxLineLength=0,ie.maxLineChanged=!1,ie.wheelDX=ie.wheelDY=ie.wheelStartX=ie.wheelStartY=null,ie.shift=!1,ie.selForContextMenu=null,ie.activeTouch=null,ie.gutterSpecs=Bc(te.gutters,te.lineNumbers),Nu(ie),ne.init(ie)}var Yl=0,Ka=null;Se?Ka=-.53:pe?Ka=15:ke?Ka=-.7:gt&&(Ka=-1/3);function rl(x){var z=x.wheelDeltaX,ne=x.wheelDeltaY;return z==null&&x.detail&&x.axis==x.HORIZONTAL_AXIS&&(z=x.detail),ne==null&&x.detail&&x.axis==x.VERTICAL_AXIS?ne=x.detail:ne==null&&(ne=x.wheelDelta),{x:z,y:ne}}function $u(x){var z=rl(x);return z.x*=Ka,z.y*=Ka,z}function Fu(x,z){var ne=rl(z),te=ne.x,ie=ne.y,le=x.display,me=le.scroller,we=me.scrollWidth>me.clientWidth,_e=me.scrollHeight>me.clientHeight;if(te&&we||ie&&_e){if(ie&&st&&Ne){e:for(var Ie=z.target,ot=le.view;Ie!=me;Ie=Ie.parentNode)for(var wt=0;wt<ot.length;wt++)if(ot[wt].node==Ie){x.display.currentWheelTarget=Ie;break e}}if(te&&!pe&&!Fe&&Ka!=null){ie&&_e&&_s(x,Math.max(0,me.scrollTop+ie*Ka)),ks(x,Math.max(0,me.scrollLeft+te*Ka)),(!ie||ie&&_e)&&Pn(z),le.wheelStartX=null;return}if(ie&&Ka!=null){var on=ie*Ka,qt=x.doc.scrollTop,An=qt+le.wrapper.clientHeight;on<0?qt=Math.max(0,qt+on-50):An=Math.min(x.doc.height,An+on+50),Tc(x,{top:qt,bottom:An})}Yl<20&&(le.wheelStartX==null?(le.wheelStartX=me.scrollLeft,le.wheelStartY=me.scrollTop,le.wheelDX=te,le.wheelDY=ie,setTimeout(function(){if(le.wheelStartX!=null){var Kn=me.scrollLeft-le.wheelStartX,pr=me.scrollTop-le.wheelStartY,Lr=pr&&le.wheelDY&&pr/le.wheelDY||Kn&&le.wheelDX&&Kn/le.wheelDX;le.wheelStartX=le.wheelStartY=null,Lr&&(Ka=(Ka*Yl+Lr)/(Yl+1),++Yl)}},200)):(le.wheelDX+=te,le.wheelDY+=ie))}}var go=function(x,z){this.ranges=x,this.primIndex=z};go.prototype.primary=function(){return this.ranges[this.primIndex]},go.prototype.equals=function(x){if(x==this)return!0;if(x.primIndex!=this.primIndex||x.ranges.length!=this.ranges.length)return!1;for(var z=0;z<this.ranges.length;z++){var ne=this.ranges[z],te=x.ranges[z];if(!Je(ne.anchor,te.anchor)||!Je(ne.head,te.head))return!1}return!0},go.prototype.deepCopy=function(){for(var x=[],z=0;z<this.ranges.length;z++)x[z]=new Fi(pt(this.ranges[z].anchor),pt(this.ranges[z].head));return new go(x,this.primIndex)},go.prototype.somethingSelected=function(){for(var x=0;x<this.ranges.length;x++)if(!this.ranges[x].empty())return!0;return!1},go.prototype.contains=function(x,z){z||(z=x);for(var ne=0;ne<this.ranges.length;ne++){var te=this.ranges[ne];if(rn(z,te.from())>=0&&rn(x,te.to())<=0)return ne}return-1};var Fi=function(x,z){this.anchor=x,this.head=z};Fi.prototype.from=function(){return Et(this.anchor,this.head)},Fi.prototype.to=function(){return Ct(this.anchor,this.head)},Fi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Po(x,z,ne){var te=x&&x.options.selectionsMayTouch,ie=z[ne];z.sort(function(on,qt){return rn(on.from(),qt.from())}),ne=bt(z,ie);for(var le=1;le<z.length;le++){var me=z[le],we=z[le-1],_e=rn(we.to(),me.from());if(te&&!me.empty()?_e>0:_e>=0){var Ie=Et(we.from(),me.from()),ot=Ct(we.to(),me.to()),wt=we.empty()?me.from()==me.head:we.from()==we.head;le<=ne&&--ne,z.splice(--le,2,new Fi(wt?ot:Ie,wt?Ie:ot))}}return new go(z,ne)}function No(x,z){return new go([new Fi(x,z||x)],0)}function us(x){return x.text?Mt(x.from.line+x.text.length-1,Vt(x.text).length+(x.text.length==1?x.from.ch:0)):x.to}function zu(x,z){if(rn(x,z.from)<0)return x;if(rn(x,z.to)<=0)return us(z);var ne=x.line+z.text.length-(z.to.line-z.from.line)-1,te=x.ch;return x.line==z.to.line&&(te+=us(z).ch-z.to.ch),Mt(ne,te)}function Oc(x,z){for(var ne=[],te=0;te<x.sel.ranges.length;te++){var ie=x.sel.ranges[te];ne.push(new Fi(zu(ie.anchor,z),zu(ie.head,z)))}return Po(x.cm,ne,x.sel.primIndex)}function il(x,z,ne){return x.line==z.line?Mt(ne.line,x.ch-z.ch+ne.ch):Mt(ne.line+(x.line-z.line),x.ch)}function Rc(x,z,ne){for(var te=[],ie=Mt(x.first,0),le=ie,me=0;me<z.length;me++){var we=z[me],_e=il(we.from,ie,le),Ie=il(us(we),ie,le);if(ie=we.to,le=Ie,ne=="around"){var ot=x.sel.ranges[me],wt=rn(ot.head,ot.anchor)<0;te[me]=new Fi(wt?Ie:_e,wt?_e:Ie)}else te[me]=new Fi(_e,_e)}return new go(te,x.sel.primIndex)}function Nc(x){x.doc.mode=In(x.options,x.doc.modeOption),al(x)}function al(x){x.doc.iter(function(z){z.stateAfter&&(z.stateAfter=null),z.styles&&(z.styles=null)}),x.doc.modeFrontier=x.doc.highlightFrontier=x.doc.first,nl(x,100),x.state.modeGen++,x.curOp&&za(x)}function Ku(x,z){return z.from.ch==0&&z.to.ch==0&&Vt(z.text)==""&&(!x.cm||x.cm.options.wholeLineUpdateBefore)}function $c(x,z,ne,te){function ie(Or){return ne?ne[Or]:null}function le(Or,Cr,Fr){ni(Or,Cr,Fr,te),$r(Or,"change",Or,z)}function me(Or,Cr){for(var Fr=[],Qr=Or;Qr<Cr;++Qr)Fr.push(new hr(Ie[Qr],ie(Qr),te));return Fr}var we=z.from,_e=z.to,Ie=z.text,ot=We(x,we.line),wt=We(x,_e.line),on=Vt(Ie),qt=ie(Ie.length-1),An=_e.line-we.line;if(z.full)x.insert(0,me(0,Ie.length)),x.remove(Ie.length,x.size-Ie.length);else if(Ku(x,z)){var Kn=me(0,Ie.length-1);le(wt,wt.text,qt),An&&x.remove(we.line,An),Kn.length&&x.insert(we.line,Kn)}else if(ot==wt)if(Ie.length==1)le(ot,ot.text.slice(0,we.ch)+on+ot.text.slice(_e.ch),qt);else{var pr=me(1,Ie.length-1);pr.push(new hr(on+ot.text.slice(_e.ch),qt,te)),le(ot,ot.text.slice(0,we.ch)+Ie[0],ie(0)),x.insert(we.line+1,pr)}else if(Ie.length==1)le(ot,ot.text.slice(0,we.ch)+Ie[0]+wt.text.slice(_e.ch),ie(0)),x.remove(we.line+1,An);else{le(ot,ot.text.slice(0,we.ch)+Ie[0],ie(0)),le(wt,on+wt.text.slice(_e.ch),qt);var Lr=me(1,Ie.length-1);An>1&&x.remove(we.line+1,An-1),x.insert(we.line+1,Lr)}$r(x,"change",x,z)}function ds(x,z,ne){function te(ie,le,me){if(ie.linked)for(var we=0;we<ie.linked.length;++we){var _e=ie.linked[we];if(_e.doc!=le){var Ie=me&&_e.sharedHist;ne&&!Ie||(z(_e.doc,Ie),te(_e.doc,ie,Ie))}}}te(x,null,!0)}function ql(x,z){if(z.cm)throw new Error("This document is already in use.");x.doc=z,z.cm=x,Aa(x),Nc(x),Jl(x),x.options.lineWrapping||Hn(x),x.options.mode=z.modeOption,za(x)}function Jl(x){(x.doc.direction=="rtl"?Ht:Xe)(x.display.lineDiv,"CodeMirror-rtl")}function Fc(x){pa(x,function(){Jl(x),za(x)})}function Ql(x){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=x||1}function zc(x,z){var ne={from:pt(z.from),to:us(z),text:it(x,z.from,z.to)};return Zc(x,ne,z.from.line,z.to.line+1),ds(x,function(te){return Zc(te,ne,z.from.line,z.to.line+1)},!0),ne}function Hu(x){for(;x.length;){var z=Vt(x);if(z.ranges)x.pop();else break}}function Kc(x,z){if(z)return Hu(x.done),Vt(x.done);if(x.done.length&&!Vt(x.done).ranges)return Vt(x.done);if(x.done.length>1&&!x.done[x.done.length-2].ranges)return x.done.pop(),Vt(x.done)}function ec(x,z,ne,te){var ie=x.history;ie.undone.length=0;var le=+new Date,me,we;if((ie.lastOp==te||ie.lastOrigin==z.origin&&z.origin&&(z.origin.charAt(0)=="+"&&ie.lastModTime>le-(x.cm?x.cm.options.historyEventDelay:500)||z.origin.charAt(0)=="*"))&&(me=Kc(ie,ie.lastOp==te)))we=Vt(me.changes),rn(z.from,z.to)==0&&rn(z.from,we.to)==0?we.to=us(z):me.changes.push(zc(x,z));else{var _e=Vt(ie.done);for((!_e||!_e.ranges)&&tc(x.sel,ie.done),me={changes:[zc(x,z)],generation:ie.generation},ie.done.push(me);ie.done.length>ie.undoDepth;)ie.done.shift(),ie.done[0].ranges||ie.done.shift()}ie.done.push(ne),ie.generation=++ie.maxGeneration,ie.lastModTime=ie.lastSelTime=le,ie.lastOp=ie.lastSelOp=te,ie.lastOrigin=ie.lastSelOrigin=z.origin,we||Re(x,"historyAdded")}function Hc(x,z,ne,te){var ie=z.charAt(0);return ie=="*"||ie=="+"&&ne.ranges.length==te.ranges.length&&ne.somethingSelected()==te.somethingSelected()&&new Date-x.history.lastSelTime<=(x.cm?x.cm.options.historyEventDelay:500)}function Wc(x,z,ne,te){var ie=x.history,le=te&&te.origin;ne==ie.lastSelOp||le&&ie.lastSelOrigin==le&&(ie.lastModTime==ie.lastSelTime&&ie.lastOrigin==le||Hc(x,le,Vt(ie.done),z))?ie.done[ie.done.length-1]=z:tc(z,ie.done),ie.lastSelTime=+new Date,ie.lastSelOrigin=le,ie.lastSelOp=ne,te&&te.clearRedo!==!1&&Hu(ie.undone)}function tc(x,z){var ne=Vt(z);ne&&ne.ranges&&ne.equals(x)||z.push(x)}function Zc(x,z,ne,te){var ie=z["spans_"+x.id],le=0;x.iter(Math.max(x.first,ne),Math.min(x.first+x.size,te),function(me){me.markedSpans&&((ie||(ie=z["spans_"+x.id]={}))[le]=me.markedSpans),++le})}function jc(x){if(!x)return null;for(var z,ne=0;ne<x.length;++ne)x[ne].marker.explicitlyCleared?z||(z=x.slice(0,ne)):z&&z.push(x[ne]);return z?z.length?z:null:x}function Xd(x,z){var ne=z["spans_"+x.id];if(!ne)return null;for(var te=[],ie=0;ie<z.text.length;++ie)te.push(jc(ne[ie]));return te}function Wu(x,z){var ne=Xd(x,z),te=Cn(x,z);if(!ne)return te;if(!te)return ne;for(var ie=0;ie<ne.length;++ie){var le=ne[ie],me=te[ie];if(le&&me)e:for(var we=0;we<me.length;++we){for(var _e=me[we],Ie=0;Ie<le.length;++Ie)if(le[Ie].marker==_e.marker)continue e;le.push(_e)}else me&&(ne[ie]=me)}return ne}function ol(x,z,ne){for(var te=[],ie=0;ie<x.length;++ie){var le=x[ie];if(le.ranges){te.push(ne?go.prototype.deepCopy.call(le):le);continue}var me=le.changes,we=[];te.push({changes:we});for(var _e=0;_e<me.length;++_e){var Ie=me[_e],ot=void 0;if(we.push({from:Ie.from,to:Ie.to,text:Ie.text}),z)for(var wt in Ie)(ot=wt.match(/^spans_(\d+)$/))&&bt(z,Number(ot[1]))>-1&&(Vt(we)[wt]=Ie[wt],delete Ie[wt])}}return te}function Vc(x,z,ne,te){if(te){var ie=x.anchor;if(ne){var le=rn(z,ie)<0;le!=rn(ne,ie)<0?(ie=z,z=ne):le!=rn(z,ne)<0&&(z=ne)}return new Fi(ie,z)}else return new Fi(ne||z,z)}function sl(x,z,ne,te,ie){ie==null&&(ie=x.cm&&(x.cm.display.shift||x.extend)),Ca(x,new go([Vc(x.sel.primary(),z,ne,ie)],0),te)}function Kr(x,z,ne){for(var te=[],ie=x.cm&&(x.cm.display.shift||x.extend),le=0;le<x.sel.ranges.length;le++)te[le]=Vc(x.sel.ranges[le],z[le],null,ie);var me=Po(x.cm,te,x.sel.primIndex);Ca(x,me,ne)}function So(x,z,ne,te){var ie=x.sel.ranges.slice(0);ie[z]=ne,Ca(x,Po(x.cm,ie,x.sel.primIndex),te)}function Zu(x,z,ne,te){Ca(x,No(z,ne),te)}function Yd(x,z,ne){var te={ranges:z.ranges,update:function(ie){this.ranges=[];for(var le=0;le<ie.length;le++)this.ranges[le]=new Fi(St(x,ie[le].anchor),St(x,ie[le].head))},origin:ne&&ne.origin};return Re(x,"beforeSelectionChange",x,te),x.cm&&Re(x.cm,"beforeSelectionChange",x.cm,te),te.ranges!=z.ranges?Po(x.cm,te.ranges,te.ranges.length-1):z}function no(x,z,ne){var te=x.history.done,ie=Vt(te);ie&&ie.ranges?(te[te.length-1]=z,nc(x,z,ne)):Ca(x,z,ne)}function Ca(x,z,ne){nc(x,z,ne),Wc(x,x.sel,x.cm?x.cm.curOp.id:NaN,ne)}function nc(x,z,ne){(Qt(x,"beforeSelectionChange")||x.cm&&Qt(x.cm,"beforeSelectionChange"))&&(z=Yd(x,z,ne));var te=ne&&ne.bias||(rn(z.primary().head,x.sel.primary().head)<0?-1:1);qd(x,ll(x,z,te,!0)),!(ne&&ne.scroll===!1)&&x.cm&&Qs(x.cm)}function qd(x,z){z.equals(x.sel)||(x.sel=z,x.cm&&(x.cm.curOp.updateInput=1,x.cm.curOp.selectionChanged=!0,Ft(x.cm)),$r(x,"cursorActivity",x))}function Jd(x){qd(x,ll(x,x.sel,null,!1))}function ll(x,z,ne,te){for(var ie,le=0;le<z.ranges.length;le++){var me=z.ranges[le],we=z.ranges.length==x.sel.ranges.length&&x.sel.ranges[le],_e=Uc(x,me.anchor,we&&we.anchor,ne,te),Ie=Uc(x,me.head,we&&we.head,ne,te);(ie||_e!=me.anchor||Ie!=me.head)&&(ie||(ie=z.ranges.slice(0,le)),ie[le]=new Fi(_e,Ie))}return ie?Po(x.cm,ie,z.primIndex):z}function ro(x,z,ne,te,ie){var le=We(x,z.line);if(le.markedSpans)for(var me=0;me<le.markedSpans.length;++me){var we=le.markedSpans[me],_e=we.marker,Ie="selectLeft"in _e?!_e.selectLeft:_e.inclusiveLeft,ot="selectRight"in _e?!_e.selectRight:_e.inclusiveRight;if((we.from==null||(Ie?we.from<=z.ch:we.from<z.ch))&&(we.to==null||(ot?we.to>=z.ch:we.to>z.ch))){if(ie&&(Re(_e,"beforeCursorEnter"),_e.explicitlyCleared))if(le.markedSpans){--me;continue}else break;if(!_e.atomic)continue;if(ne){var wt=_e.find(te<0?1:-1),on=void 0;if((te<0?ot:Ie)&&(wt=hs(x,wt,-te,wt&&wt.line==z.line?le:null)),wt&&wt.line==z.line&&(on=rn(wt,ne))&&(te<0?on<0:on>0))return ro(x,wt,z,te,ie)}var qt=_e.find(te<0?-1:1);return(te<0?Ie:ot)&&(qt=hs(x,qt,te,qt.line==z.line?le:null)),qt?ro(x,qt,z,te,ie):null}}return z}function Uc(x,z,ne,te,ie){var le=te||1,me=ro(x,z,ne,le,ie)||!ie&&ro(x,z,ne,le,!0)||ro(x,z,ne,-le,ie)||!ie&&ro(x,z,ne,-le,!0);return me||(x.cantEdit=!0,Mt(x.first,0))}function hs(x,z,ne,te){return ne<0&&z.ch==0?z.line>x.first?St(x,Mt(z.line-1)):null:ne>0&&z.ch==(te||We(x,z.line)).text.length?z.line<x.first+x.size-1?Mt(z.line+1,0):null:new Mt(z.line,z.ch+ne)}function ju(x){x.setSelection(Mt(x.firstLine(),0),Mt(x.lastLine()),Ge)}function Gc(x,z,ne){var te={canceled:!1,from:z.from,to:z.to,text:z.text,origin:z.origin,cancel:function(){return te.canceled=!0}};return ne&&(te.update=function(ie,le,me,we){ie&&(te.from=St(x,ie)),le&&(te.to=St(x,le)),me&&(te.text=me),we!==void 0&&(te.origin=we)}),Re(x,"beforeChange",x,te),x.cm&&Re(x.cm,"beforeChange",x.cm,te),te.canceled?(x.cm&&(x.cm.curOp.updateInput=2),null):{from:te.from,to:te.to,text:te.text,origin:te.origin}}function Ds(x,z,ne){if(x.cm){if(!x.cm.curOp)return Sa(x.cm,Ds)(x,z,ne);if(x.cm.state.suppressEdits)return}if(!((Qt(x,"beforeChange")||x.cm&&Qt(x.cm,"beforeChange"))&&(z=Gc(x,z,!0),!z))){var te=ur&&!ne&&fr(x,z.from,z.to);if(te)for(var ie=te.length-1;ie>=0;--ie)Vu(x,{from:te[ie].from,to:te[ie].to,text:ie?[""]:z.text,origin:z.origin});else Vu(x,z)}}function Vu(x,z){if(!(z.text.length==1&&z.text[0]==""&&rn(z.from,z.to)==0)){var ne=Oc(x,z);ec(x,z,ne,x.cm?x.cm.curOp.id:NaN),cl(x,z,ne,Cn(x,z));var te=[];ds(x,function(ie,le){!le&&bt(te,ie.history)==-1&&(rc(ie.history,z),te.push(ie.history)),cl(ie,z,null,Cn(ie,z))})}}function fs(x,z,ne){var te=x.cm&&x.cm.state.suppressEdits;if(!(te&&!ne)){for(var ie=x.history,le,me=x.sel,we=z=="undo"?ie.done:ie.undone,_e=z=="undo"?ie.undone:ie.done,Ie=0;Ie<we.length&&(le=we[Ie],!(ne?le.ranges&&!le.equals(x.sel):!le.ranges));Ie++);if(Ie!=we.length){for(ie.lastOrigin=ie.lastSelOrigin=null;;)if(le=we.pop(),le.ranges){if(tc(le,_e),ne&&!le.equals(x.sel)){Ca(x,le,{clearRedo:!1});return}me=le}else if(te){we.push(le);return}else break;var ot=[];tc(me,_e),_e.push({changes:ot,generation:ie.generation}),ie.generation=le.generation||++ie.maxGeneration;for(var wt=Qt(x,"beforeChange")||x.cm&&Qt(x.cm,"beforeChange"),on=function(Kn){var pr=le.changes[Kn];if(pr.origin=z,wt&&!Gc(x,pr,!1))return we.length=0,{};ot.push(zc(x,pr));var Lr=Kn?Oc(x,pr):Vt(we);cl(x,pr,Lr,Wu(x,pr)),!Kn&&x.cm&&x.cm.scrollIntoView({from:pr.from,to:us(pr)});var Or=[];ds(x,function(Cr,Fr){!Fr&&bt(Or,Cr.history)==-1&&(rc(Cr.history,pr),Or.push(Cr.history)),cl(Cr,pr,null,Wu(Cr,pr))})},qt=le.changes.length-1;qt>=0;--qt){var An=on(qt);if(An)return An.v}}}}function Xc(x,z){if(z!=0&&(x.first+=z,x.sel=new go(Zt(x.sel.ranges,function(ie){return new Fi(Mt(ie.anchor.line+z,ie.anchor.ch),Mt(ie.head.line+z,ie.head.ch))}),x.sel.primIndex),x.cm)){za(x.cm,x.first,x.first-z,z);for(var ne=x.cm.display,te=ne.viewFrom;te<ne.viewTo;te++)Ao(x.cm,te,"gutter")}}function cl(x,z,ne,te){if(x.cm&&!x.cm.curOp)return Sa(x.cm,cl)(x,z,ne,te);if(z.to.line<x.first){Xc(x,z.text.length-1-(z.to.line-z.from.line));return}if(!(z.from.line>x.lastLine())){if(z.from.line<x.first){var ie=z.text.length-1-(x.first-z.from.line);Xc(x,ie),z={from:Mt(x.first,0),to:Mt(z.to.line+ie,z.to.ch),text:[Vt(z.text)],origin:z.origin}}var le=x.lastLine();z.to.line>le&&(z={from:z.from,to:Mt(le,We(x,le).text.length),text:[z.text[0]],origin:z.origin}),z.removed=it(x,z.from,z.to),ne||(ne=Oc(x,z)),x.cm?Qd(x.cm,z,te):$c(x,z,te),nc(x,ne,Ge),x.cantEdit&&Uc(x,Mt(x.firstLine(),0))&&(x.cantEdit=!1)}}function Qd(x,z,ne){var te=x.doc,ie=x.display,le=z.from,me=z.to,we=!1,_e=le.line;x.options.lineWrapping||(_e=$t(Br(We(te,le.line))),te.iter(_e,me.line+1,function(qt){if(qt==ie.maxLine)return we=!0,!0})),te.sel.contains(z.from,z.to)>-1&&Ft(x),$c(te,z,ne,Ya(x)),x.options.lineWrapping||(te.iter(_e,le.line+z.text.length,function(qt){var An=Wn(qt);An>ie.maxLineLength&&(ie.maxLine=qt,ie.maxLineLength=An,ie.maxLineChanged=!0,we=!1)}),we&&(x.curOp.updateMaxLine=!0)),Ln(te,le.line),nl(x,400);var Ie=z.text.length-(me.line-le.line)-1;z.full?za(x):le.line==me.line&&z.text.length==1&&!Ku(x.doc,z)?Ao(x,le.line,"text"):za(x,le.line,me.line+1,Ie);var ot=Qt(x,"changes"),wt=Qt(x,"change");if(wt||ot){var on={from:le,to:me,text:z.text,removed:z.removed,origin:z.origin};wt&&$r(x,"change",x,on),ot&&(x.curOp.changeObjs||(x.curOp.changeObjs=[])).push(on)}x.display.selForContextMenu=null}function Ml(x,z,ne,te,ie){var le;te||(te=ne),rn(te,ne)<0&&(le=[te,ne],ne=le[0],te=le[1]),typeof z=="string"&&(z=x.splitLines(z)),Ds(x,{from:ne,to:te,text:z,origin:ie})}function eh(x,z,ne,te){ne<x.line?x.line+=te:z<x.line&&(x.line=z,x.ch=0)}function th(x,z,ne,te){for(var ie=0;ie<x.length;++ie){var le=x[ie],me=!0;if(le.ranges){le.copied||(le=x[ie]=le.deepCopy(),le.copied=!0);for(var we=0;we<le.ranges.length;we++)eh(le.ranges[we].anchor,z,ne,te),eh(le.ranges[we].head,z,ne,te);continue}for(var _e=0;_e<le.changes.length;++_e){var Ie=le.changes[_e];if(ne<Ie.from.line)Ie.from=Mt(Ie.from.line+te,Ie.from.ch),Ie.to=Mt(Ie.to.line+te,Ie.to.ch);else if(z<=Ie.to.line){me=!1;break}}me||(x.splice(0,ie+1),ie=0)}}function rc(x,z){var ne=z.from.line,te=z.to.line,ie=z.text.length-(te-ne)-1;th(x.done,ne,te,ie),th(x.undone,ne,te,ie)}function ic(x,z,ne,te){var ie=z,le=z;return typeof z=="number"?le=We(x,Yt(x,z)):ie=$t(z),ie==null?null:(te(le,ie)&&x.cm&&Ao(x.cm,ie,ne),le)}function As(x){this.lines=x,this.parent=null;for(var z=0,ne=0;ne<x.length;++ne)x[ne].parent=this,z+=x[ne].height;this.height=z}As.prototype={chunkSize:function(){return this.lines.length},removeInner:function(x,z){for(var ne=x,te=x+z;ne<te;++ne){var ie=this.lines[ne];this.height-=ie.height,xi(ie),$r(ie,"delete")}this.lines.splice(x,z)},collapse:function(x){x.push.apply(x,this.lines)},insertInner:function(x,z,ne){this.height+=ne,this.lines=this.lines.slice(0,x).concat(z).concat(this.lines.slice(x));for(var te=0;te<z.length;++te)z[te].parent=this},iterN:function(x,z,ne){for(var te=x+z;x<te;++x)if(ne(this.lines[x]))return!0}};function _l(x){this.children=x;for(var z=0,ne=0,te=0;te<x.length;++te){var ie=x[te];z+=ie.chunkSize(),ne+=ie.height,ie.parent=this}this.size=z,this.height=ne,this.parent=null}_l.prototype={chunkSize:function(){return this.size},removeInner:function(x,z){this.size-=z;for(var ne=0;ne<this.children.length;++ne){var te=this.children[ne],ie=te.chunkSize();if(x<ie){var le=Math.min(z,ie-x),me=te.height;if(te.removeInner(x,le),this.height-=me-te.height,ie==le&&(this.children.splice(ne--,1),te.parent=null),(z-=le)==0)break;x=0}else x-=ie}if(this.size-z<25&&(this.children.length>1||!(this.children[0]instanceof As))){var we=[];this.collapse(we),this.children=[new As(we)],this.children[0].parent=this}},collapse:function(x){for(var z=0;z<this.children.length;++z)this.children[z].collapse(x)},insertInner:function(x,z,ne){this.size+=z.length,this.height+=ne;for(var te=0;te<this.children.length;++te){var ie=this.children[te],le=ie.chunkSize();if(x<=le){if(ie.insertInner(x,z,ne),ie.lines&&ie.lines.length>50){for(var me=ie.lines.length%25+25,we=me;we<ie.lines.length;){var _e=new As(ie.lines.slice(we,we+=25));ie.height-=_e.height,this.children.splice(++te,0,_e),_e.parent=this}ie.lines=ie.lines.slice(0,me),this.maybeSpill()}break}x-=le}},maybeSpill:function(){if(!(this.children.length<=10)){var x=this;do{var z=x.children.splice(x.children.length-5,5),ne=new _l(z);if(x.parent){x.size-=ne.size,x.height-=ne.height;var ie=bt(x.parent.children,x);x.parent.children.splice(ie+1,0,ne)}else{var te=new _l(x.children);te.parent=x,x.children=[te,ne],x=te}ne.parent=x.parent}while(x.children.length>10);x.parent.maybeSpill()}},iterN:function(x,z,ne){for(var te=0;te<this.children.length;++te){var ie=this.children[te],le=ie.chunkSize();if(x<le){var me=Math.min(z,le-x);if(ie.iterN(x,me,ne))return!0;if((z-=me)==0)break;x=0}else x-=le}}};var kl=function(x,z,ne){if(ne)for(var te in ne)ne.hasOwnProperty(te)&&(this[te]=ne[te]);this.doc=x,this.node=z};kl.prototype.clear=function(){var x=this.doc.cm,z=this.line.widgets,ne=this.line,te=$t(ne);if(!(te==null||!z)){for(var ie=0;ie<z.length;++ie)z[ie]==this&&z.splice(ie--,1);z.length||(ne.widgets=null);var le=ao(this);Lt(ne,Math.max(0,ne.height-le)),x&&(pa(x,function(){nh(x,ne,-le),Ao(x,te,"widget")}),$r(x,"lineWidgetCleared",x,this,te))}},kl.prototype.changed=function(){var x=this,z=this.height,ne=this.doc.cm,te=this.line;this.height=null;var ie=ao(this)-z;ie&&(yi(this.doc,te)||Lt(te,te.height+ie),ne&&pa(ne,function(){ne.curOp.forceUpdate=!0,nh(ne,te,ie),$r(ne,"lineWidgetChanged",ne,x,$t(te))}))},an(kl);function nh(x,z,ne){Gn(z)<(x.curOp&&x.curOp.scrollTop||x.doc.scrollTop)&&Lc(x,ne)}function rh(x,z,ne,te){var ie=new kl(x,ne,te),le=x.cm;return le&&ie.noHScroll&&(le.display.alignWidgets=!0),ic(x,z,"widget",function(me){var we=me.widgets||(me.widgets=[]);if(ie.insertAt==null?we.push(ie):we.splice(Math.min(we.length-1,Math.max(0,ie.insertAt)),0,ie),ie.line=me,le&&!yi(x,me)){var _e=Gn(me)<x.scrollTop;Lt(me,me.height+ao(ie)),_e&&Lc(le,ie.height),le.curOp.forceUpdate=!0}return!0}),le&&$r(le,"lineWidgetAdded",le,ie,typeof z=="number"?z:$t(z)),ie}var ih=0,Ts=function(x,z){this.lines=[],this.type=z,this.doc=x,this.id=++ih};Ts.prototype.clear=function(){if(!this.explicitlyCleared){var x=this.doc.cm,z=x&&!x.curOp;if(z&&Ls(x),Qt(this,"clear")){var ne=this.find();ne&&$r(this,"clear",ne.from,ne.to)}for(var te=null,ie=null,le=0;le<this.lines.length;++le){var me=this.lines[le],we=br(me.markedSpans,this);x&&!this.collapsed?Ao(x,$t(me),"text"):x&&(we.to!=null&&(ie=$t(me)),we.from!=null&&(te=$t(me))),me.markedSpans=lr(me.markedSpans,we),we.from==null&&this.collapsed&&!yi(this.doc,me)&&x&&Lt(me,as(x.display))}if(x&&this.collapsed&&!x.options.lineWrapping)for(var _e=0;_e<this.lines.length;++_e){var Ie=Br(this.lines[_e]),ot=Wn(Ie);ot>x.display.maxLineLength&&(x.display.maxLine=Ie,x.display.maxLineLength=ot,x.display.maxLineChanged=!0)}te!=null&&x&&this.collapsed&&za(x,te,ie+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,x&&Jd(x.doc)),x&&$r(x,"markerCleared",x,this,te,ie),z&&cs(x),this.parent&&this.parent.clear()}},Ts.prototype.find=function(x,z){x==null&&this.type=="bookmark"&&(x=1);for(var ne,te,ie=0;ie<this.lines.length;++ie){var le=this.lines[ie],me=br(le.markedSpans,this);if(me.from!=null&&(ne=Mt(z?le:$t(le),me.from),x==-1))return ne;if(me.to!=null&&(te=Mt(z?le:$t(le),me.to),x==1))return te}return ne&&{from:ne,to:te}},Ts.prototype.changed=function(){var x=this,z=this.find(-1,!0),ne=this,te=this.doc.cm;!z||!te||pa(te,function(){var ie=z.line,le=$t(z.line),me=Xa(te,le);if(me&&(Ki(me),te.curOp.selectionChanged=te.curOp.forceUpdate=!0),te.curOp.updateMaxLine=!0,!yi(ne.doc,ie)&&ne.height!=null){var we=ne.height;ne.height=null;var _e=ao(ne)-we;_e&&Lt(ie,ie.height+_e)}$r(te,"markerChanged",te,x)})},Ts.prototype.attachLine=function(x){if(!this.lines.length&&this.doc.cm){var z=this.doc.cm.curOp;(!z.maybeHiddenMarkers||bt(z.maybeHiddenMarkers,this)==-1)&&(z.maybeUnhiddenMarkers||(z.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(x)},Ts.prototype.detachLine=function(x){if(this.lines.splice(bt(this.lines,x),1),!this.lines.length&&this.doc.cm){var z=this.doc.cm.curOp;(z.maybeHiddenMarkers||(z.maybeHiddenMarkers=[])).push(this)}},an(Ts);function ps(x,z,ne,te,ie){if(te&&te.shared)return ra(x,z,ne,te,ie);if(x.cm&&!x.cm.curOp)return Sa(x.cm,ps)(x,z,ne,te,ie);var le=new Ts(x,ie),me=rn(z,ne);if(te&&Wt(te,le,!1),me>0||me==0&&le.clearWhenEmpty!==!1)return le;if(le.replacedWith&&(le.collapsed=!0,le.widgetNode=Ot("span",[le.replacedWith],"CodeMirror-widget"),te.handleMouseEvents||le.widgetNode.setAttribute("cm-ignore-events","true"),te.insertLeft&&(le.widgetNode.insertLeft=!0)),le.collapsed){if(kr(x,z.line,z,ne,le)||z.line!=ne.line&&kr(x,ne.line,z,ne,le))throw new Error("Inserting collapsed marker partially overlapping an existing one");Vn()}le.addToHistory&&ec(x,{from:z,to:ne,origin:"markText"},x.sel,NaN);var we=z.line,_e=x.cm,Ie;if(x.iter(we,ne.line+1,function(wt){_e&&le.collapsed&&!_e.options.lineWrapping&&Br(wt)==_e.display.maxLine&&(Ie=!0),le.collapsed&&we!=z.line&&Lt(wt,0),Ir(wt,new Un(le,we==z.line?z.ch:null,we==ne.line?ne.ch:null)),++we}),le.collapsed&&x.iter(z.line,ne.line+1,function(wt){yi(x,wt)&&Lt(wt,0)}),le.clearOnEnter&&gn(le,"beforeCursorEnter",function(){return le.clear()}),le.readOnly&&(mr(),(x.history.done.length||x.history.undone.length)&&x.clearHistory()),le.collapsed&&(le.id=++ih,le.atomic=!0),_e){if(Ie&&(_e.curOp.updateMaxLine=!0),le.collapsed)za(_e,z.line,ne.line+1);else if(le.className||le.startStyle||le.endStyle||le.css||le.attributes||le.title)for(var ot=z.line;ot<=ne.line;ot++)Ao(_e,ot,"text");le.atomic&&Jd(_e.doc),$r(_e,"markerAdded",_e,le)}return le}var Si=function(x,z){this.markers=x,this.primary=z;for(var ne=0;ne<x.length;++ne)x[ne].parent=this};Si.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var x=0;x<this.markers.length;++x)this.markers[x].clear();$r(this,"clear")}},Si.prototype.find=function(x,z){return this.primary.find(x,z)},an(Si);function ra(x,z,ne,te,ie){te=Wt(te),te.shared=!1;var le=[ps(x,z,ne,te,ie)],me=le[0],we=te.widgetNode;return ds(x,function(_e){we&&(te.widgetNode=we.cloneNode(!0)),le.push(ps(_e,St(_e,z),St(_e,ne),te,ie));for(var Ie=0;Ie<_e.linked.length;++Ie)if(_e.linked[Ie].isParent)return;me=Vt(le)}),new Si(le,me)}function Ps(x){return x.findMarks(Mt(x.first,0),x.clipPos(Mt(x.lastLine())),function(z){return z.parent})}function ah(x,z){for(var ne=0;ne<z.length;ne++){var te=z[ne],ie=te.find(),le=x.clipPos(ie.from),me=x.clipPos(ie.to);if(rn(le,me)){var we=ps(x,le,me,te.primary,te.primary.type);te.markers.push(we),we.parent=te}}}function Co(x){for(var z=function(te){var ie=x[te],le=[ie.primary.doc];ds(ie.primary.doc,function(_e){return le.push(_e)});for(var me=0;me<ie.markers.length;me++){var we=ie.markers[me];bt(le,we.doc)==-1&&(we.parent=null,ie.markers.splice(me--,1))}},ne=0;ne<x.length;ne++)z(ne)}var oh=0,ya=function(x,z,ne,te,ie){if(!(this instanceof ya))return new ya(x,z,ne,te,ie);ne==null&&(ne=0),_l.call(this,[new As([new hr("",null)])]),this.first=ne,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=ne;var le=Mt(ne,0);this.sel=No(le),this.history=new Ql(null),this.id=++oh,this.modeOption=z,this.lineSep=te,this.direction=ie=="rtl"?"rtl":"ltr",this.extend=!1,typeof x=="string"&&(x=this.splitLines(x)),$c(this,{from:le,to:le,text:x}),Ca(this,No(le),Ge)};ya.prototype=se(_l.prototype,{constructor:ya,iter:function(x,z,ne){ne?this.iterN(x-this.first,z-x,ne):this.iterN(this.first,this.first+this.size,x)},insert:function(x,z){for(var ne=0,te=0;te<z.length;++te)ne+=z[te].height;this.insertInner(x-this.first,z,ne)},remove:function(x,z){this.removeInner(x-this.first,z)},getValue:function(x){var z=Nt(this,this.first,this.first+this.size);return x===!1?z:z.join(x||this.lineSeparator())},setValue:Pa(function(x){var z=Mt(this.first,0),ne=this.first+this.size-1;Ds(this,{from:z,to:Mt(ne,We(this,ne).text.length),text:this.splitLines(x),origin:"setValue",full:!0},!0),this.cm&&el(this.cm,0,0),Ca(this,No(z),Ge)}),replaceRange:function(x,z,ne,te){z=St(this,z),ne=ne?St(this,ne):z,Ml(this,x,z,ne,te)},getRange:function(x,z,ne){var te=it(this,St(this,x),St(this,z));return ne===!1?te:te.join(ne||this.lineSeparator())},getLine:function(x){var z=this.getLineHandle(x);return z&&z.text},getLineHandle:function(x){if(hn(this,x))return We(this,x)},getLineNumber:function(x){return $t(x)},getLineHandleVisualStart:function(x){return typeof x=="number"&&(x=We(this,x)),Br(x)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(x){return St(this,x)},getCursor:function(x){var z=this.sel.primary(),ne;return x==null||x=="head"?ne=z.head:x=="anchor"?ne=z.anchor:x=="end"||x=="to"||x===!1?ne=z.to():ne=z.from(),ne},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Pa(function(x,z,ne){Zu(this,St(this,typeof x=="number"?Mt(x,z||0):x),null,ne)}),setSelection:Pa(function(x,z,ne){Zu(this,St(this,x),St(this,z||x),ne)}),extendSelection:Pa(function(x,z,ne){sl(this,St(this,x),z&&St(this,z),ne)}),extendSelections:Pa(function(x,z){Kr(this,Te(this,x),z)}),extendSelectionsBy:Pa(function(x,z){var ne=Zt(this.sel.ranges,x);Kr(this,Te(this,ne),z)}),setSelections:Pa(function(x,z,ne){if(x.length){for(var te=[],ie=0;ie<x.length;ie++)te[ie]=new Fi(St(this,x[ie].anchor),St(this,x[ie].head));z==null&&(z=Math.min(x.length-1,this.sel.primIndex)),Ca(this,Po(this.cm,te,z),ne)}}),addSelection:Pa(function(x,z,ne){var te=this.sel.ranges.slice(0);te.push(new Fi(St(this,x),St(this,z||x))),Ca(this,Po(this.cm,te,te.length-1),ne)}),getSelection:function(x){for(var z=this.sel.ranges,ne,te=0;te<z.length;te++){var ie=it(this,z[te].from(),z[te].to());ne=ne?ne.concat(ie):ie}return x===!1?ne:ne.join(x||this.lineSeparator())},getSelections:function(x){for(var z=[],ne=this.sel.ranges,te=0;te<ne.length;te++){var ie=it(this,ne[te].from(),ne[te].to());x!==!1&&(ie=ie.join(x||this.lineSeparator())),z[te]=ie}return z},replaceSelection:function(x,z,ne){for(var te=[],ie=0;ie<this.sel.ranges.length;ie++)te[ie]=x;this.replaceSelections(te,z,ne||"+input")},replaceSelections:Pa(function(x,z,ne){for(var te=[],ie=this.sel,le=0;le<ie.ranges.length;le++){var me=ie.ranges[le];te[le]={from:me.from(),to:me.to(),text:this.splitLines(x[le]),origin:ne}}for(var we=z&&z!="end"&&Rc(this,te,z),_e=te.length-1;_e>=0;_e--)Ds(this,te[_e]);we?no(this,we):this.cm&&Qs(this.cm)}),undo:Pa(function(){fs(this,"undo")}),redo:Pa(function(){fs(this,"redo")}),undoSelection:Pa(function(){fs(this,"undo",!0)}),redoSelection:Pa(function(){fs(this,"redo",!0)}),setExtending:function(x){this.extend=x},getExtending:function(){return this.extend},historySize:function(){for(var x=this.history,z=0,ne=0,te=0;te<x.done.length;te++)x.done[te].ranges||++z;for(var ie=0;ie<x.undone.length;ie++)x.undone[ie].ranges||++ne;return{undo:z,redo:ne}},clearHistory:function(){var x=this;this.history=new Ql(this.history.maxGeneration),ds(this,function(z){return z.history=x.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(x){return x&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(x){return this.history.generation==(x||this.cleanGeneration)},getHistory:function(){return{done:ol(this.history.done),undone:ol(this.history.undone)}},setHistory:function(x){var z=this.history=new Ql(this.history.maxGeneration);z.done=ol(x.done.slice(0),null,!0),z.undone=ol(x.undone.slice(0),null,!0)},setGutterMarker:Pa(function(x,z,ne){return ic(this,x,"gutter",function(te){var ie=te.gutterMarkers||(te.gutterMarkers={});return ie[z]=ne,!ne&&ce(ie)&&(te.gutterMarkers=null),!0})}),clearGutter:Pa(function(x){var z=this;this.iter(function(ne){ne.gutterMarkers&&ne.gutterMarkers[x]&&ic(z,ne,"gutter",function(){return ne.gutterMarkers[x]=null,ce(ne.gutterMarkers)&&(ne.gutterMarkers=null),!0})})}),lineInfo:function(x){var z;if(typeof x=="number"){if(!hn(this,x)||(z=x,x=We(this,x),!x))return null}else if(z=$t(x),z==null)return null;return{line:z,handle:x,text:x.text,gutterMarkers:x.gutterMarkers,textClass:x.textClass,bgClass:x.bgClass,wrapClass:x.wrapClass,widgets:x.widgets}},addLineClass:Pa(function(x,z,ne){return ic(this,x,z=="gutter"?"gutter":"class",function(te){var ie=z=="text"?"textClass":z=="background"?"bgClass":z=="gutter"?"gutterClass":"wrapClass";if(!te[ie])te[ie]=ne;else{if(Ee(ne).test(te[ie]))return!1;te[ie]+=" "+ne}return!0})}),removeLineClass:Pa(function(x,z,ne){return ic(this,x,z=="gutter"?"gutter":"class",function(te){var ie=z=="text"?"textClass":z=="background"?"bgClass":z=="gutter"?"gutterClass":"wrapClass",le=te[ie];if(le)if(ne==null)te[ie]=null;else{var me=le.match(Ee(ne));if(!me)return!1;var we=me.index+me[0].length;te[ie]=le.slice(0,me.index)+(!me.index||we==le.length?"":" ")+le.slice(we)||null}else return!1;return!0})}),addLineWidget:Pa(function(x,z,ne){return rh(this,x,z,ne)}),removeLineWidget:function(x){x.clear()},markText:function(x,z,ne){return ps(this,St(this,x),St(this,z),ne,ne&&ne.type||"range")},setBookmark:function(x,z){var ne={replacedWith:z&&(z.nodeType==null?z.widget:z),insertLeft:z&&z.insertLeft,clearWhenEmpty:!1,shared:z&&z.shared,handleMouseEvents:z&&z.handleMouseEvents};return x=St(this,x),ps(this,x,x,ne,"bookmark")},findMarksAt:function(x){x=St(this,x);var z=[],ne=We(this,x.line).markedSpans;if(ne)for(var te=0;te<ne.length;++te){var ie=ne[te];(ie.from==null||ie.from<=x.ch)&&(ie.to==null||ie.to>=x.ch)&&z.push(ie.marker.parent||ie.marker)}return z},findMarks:function(x,z,ne){x=St(this,x),z=St(this,z);var te=[],ie=x.line;return this.iter(x.line,z.line+1,function(le){var me=le.markedSpans;if(me)for(var we=0;we<me.length;we++){var _e=me[we];!(_e.to!=null&&ie==x.line&&x.ch>=_e.to||_e.from==null&&ie!=x.line||_e.from!=null&&ie==z.line&&_e.from>=z.ch)&&(!ne||ne(_e.marker))&&te.push(_e.marker.parent||_e.marker)}++ie}),te},getAllMarks:function(){var x=[];return this.iter(function(z){var ne=z.markedSpans;if(ne)for(var te=0;te<ne.length;++te)ne[te].from!=null&&x.push(ne[te].marker)}),x},posFromIndex:function(x){var z,ne=this.first,te=this.lineSeparator().length;return this.iter(function(ie){var le=ie.text.length+te;if(le>x)return z=x,!0;x-=le,++ne}),St(this,Mt(ne,z))},indexFromPos:function(x){x=St(this,x);var z=x.ch;if(x.line<this.first||x.ch<0)return 0;var ne=this.lineSeparator().length;return this.iter(this.first,x.line,function(te){z+=te.text.length+ne}),z},copy:function(x){var z=new ya(Nt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return z.scrollTop=this.scrollTop,z.scrollLeft=this.scrollLeft,z.sel=this.sel,z.extend=!1,x&&(z.history.undoDepth=this.history.undoDepth,z.setHistory(this.getHistory())),z},linkedDoc:function(x){x||(x={});var z=this.first,ne=this.first+this.size;x.from!=null&&x.from>z&&(z=x.from),x.to!=null&&x.to<ne&&(ne=x.to);var te=new ya(Nt(this,z,ne),x.mode||this.modeOption,z,this.lineSep,this.direction);return x.sharedHist&&(te.history=this.history),(this.linked||(this.linked=[])).push({doc:te,sharedHist:x.sharedHist}),te.linked=[{doc:this,isParent:!0,sharedHist:x.sharedHist}],ah(te,Ps(this)),te},unlinkDoc:function(x){if(x instanceof si&&(x=x.doc),this.linked)for(var z=0;z<this.linked.length;++z){var ne=this.linked[z];if(ne.doc==x){this.linked.splice(z,1),x.unlinkDoc(this),Co(Ps(this));break}}if(x.history==this.history){var te=[x.id];ds(x,function(ie){return te.push(ie.id)},!0),x.history=new Ql(null),x.history.done=ol(this.history.done,te),x.history.undone=ol(this.history.undone,te)}},iterLinkedDocs:function(x){ds(this,x)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(x){return this.lineSep?x.split(this.lineSep):Dr(x)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Pa(function(x){x!="rtl"&&(x="ltr"),x!=this.direction&&(this.direction=x,this.iter(function(z){return z.order=null}),this.cm&&Fc(this.cm))})}),ya.prototype.eachLine=ya.prototype.iter;var Uu=0;function Qh(x){var z=this;if(El(z),!(Ze(z,x)||oo(z.display,x))){Pn(x),Se&&(Uu=+new Date);var ne=xo(z,x,!0),te=x.dataTransfer.files;if(!(!ne||z.isReadOnly()))if(te&&te.length&&window.FileReader&&window.File)for(var ie=te.length,le=Array(ie),me=0,we=function(){++me==ie&&Sa(z,function(){ne=St(z.doc,ne);var qt={from:ne,to:ne,text:z.doc.splitLines(le.filter(function(An){return An!=null}).join(z.doc.lineSeparator())),origin:"paste"};Ds(z.doc,qt),no(z.doc,No(St(z.doc,ne),St(z.doc,us(qt))))})()},_e=function(qt,An){if(z.options.allowDropFileTypes&&bt(z.options.allowDropFileTypes,qt.type)==-1){we();return}var Kn=new FileReader;Kn.onerror=function(){return we()},Kn.onload=function(){var pr=Kn.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(pr)){we();return}le[An]=pr,we()},Kn.readAsText(qt)},Ie=0;Ie<te.length;Ie++)_e(te[Ie],Ie);else{if(z.state.draggingText&&z.doc.sel.contains(ne)>-1){z.state.draggingText(x),setTimeout(function(){return z.display.input.focus()},20);return}try{var ot=x.dataTransfer.getData("Text");if(ot){var wt;if(z.state.draggingText&&!z.state.draggingText.copy&&(wt=z.listSelections()),nc(z.doc,No(ne,ne)),wt)for(var on=0;on<wt.length;++on)Ml(z.doc,"",wt[on].anchor,wt[on].head,"drag");z.replaceSelection(ot,"around","paste"),z.display.input.focus()}}catch(qt){}}}}function ef(x,z){if(Se&&(!x.state.draggingText||+new Date-Uu<100)){Zn(z);return}if(!(Ze(x,z)||oo(x.display,z))&&(z.dataTransfer.setData("Text",x.getSelection()),z.dataTransfer.effectAllowed="copyMove",z.dataTransfer.setDragImage&&!gt)){var ne=Ue("img",null,null,"position: fixed; left: 0; top: 0;");ne.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Fe&&(ne.width=ne.height=1,x.display.wrapper.appendChild(ne),ne._top=ne.offsetTop),z.dataTransfer.setDragImage(ne,0,0),Fe&&ne.parentNode.removeChild(ne)}}function Gu(x,z){var ne=xo(x,z);if(ne){var te=document.createDocumentFragment();ku(x,ne,te),x.display.dragCursor||(x.display.dragCursor=Ue("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),x.display.lineSpace.insertBefore(x.display.dragCursor,x.display.cursorDiv)),vt(x.display.dragCursor,te)}}function El(x){x.display.dragCursor&&(x.display.lineSpace.removeChild(x.display.dragCursor),x.display.dragCursor=null)}function Ll(x){if(document.getElementsByClassName){for(var z=document.getElementsByClassName("CodeMirror"),ne=[],te=0;te<z.length;te++){var ie=z[te].CodeMirror;ie&&ne.push(ie)}ne.length&&ne[0].operation(function(){for(var le=0;le<ne.length;le++)x(ne[le])})}}var ir=!1;function Xu(){ir||(Yc(),ir=!0)}function Yc(){var x;gn(window,"resize",function(){x==null&&(x=setTimeout(function(){x=null,Ll(qc)},100))}),gn(window,"blur",function(){return Ll(Js)})}function qc(x){var z=x.display;z.cachedCharWidth=z.cachedTextHeight=z.cachedPaddingH=null,z.scrollbarsClipped=!1,x.setSize()}for(var $o={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"},ac=0;ac<10;ac++)$o[ac+48]=$o[ac+96]=String(ac);for(var Jc=65;Jc<=90;Jc++)$o[Jc]=String.fromCharCode(Jc);for(var oc=1;oc<=12;oc++)$o[oc+111]=$o[oc+63235]="F"+oc;var Yi={};Yi.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"},Yi.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"},Yi.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"},Yi.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"]},Yi.default=st?Yi.macDefault:Yi.pcDefault;function tf(x){var z=x.split(/-(?!$)/);x=z[z.length-1];for(var ne,te,ie,le,me=0;me<z.length-1;me++){var we=z[me];if(/^(cmd|meta|m)$/i.test(we))le=!0;else if(/^a(lt)?$/i.test(we))ne=!0;else if(/^(c|ctrl|control)$/i.test(we))te=!0;else if(/^s(hift)?$/i.test(we))ie=!0;else throw new Error("Unrecognized modifier name: "+we)}return ne&&(x="Alt-"+x),te&&(x="Ctrl-"+x),le&&(x="Cmd-"+x),ie&&(x="Shift-"+x),x}function Yu(x){var z={};for(var ne in x)if(x.hasOwnProperty(ne)){var te=x[ne];if(/^(name|fallthrough|(de|at)tach)$/.test(ne))continue;if(te=="..."){delete x[ne];continue}for(var ie=Zt(ne.split(" "),tf),le=0;le<ie.length;le++){var me=void 0,we=void 0;le==ie.length-1?(we=ie.join(" "),me=te):(we=ie.slice(0,le+1).join(" "),me="...");var _e=z[we];if(!_e)z[we]=me;else if(_e!=me)throw new Error("Inconsistent bindings for "+we)}delete x[ne]}for(var Ie in z)x[Ie]=z[Ie];return x}function ms(x,z,ne,te){z=io(z);var ie=z.call?z.call(x,te):z[x];if(ie===!1)return"nothing";if(ie==="...")return"multi";if(ie!=null&&ne(ie))return"handled";if(z.fallthrough){if(Object.prototype.toString.call(z.fallthrough)!="[object Array]")return ms(x,z.fallthrough,ne,te);for(var le=0;le<z.fallthrough.length;le++){var me=ms(x,z.fallthrough[le],ne,te);if(me)return me}}}function sc(x){var z=typeof x=="string"?x:$o[x.keyCode];return z=="Ctrl"||z=="Alt"||z=="Shift"||z=="Mod"}function Is(x,z,ne){var te=x;return z.altKey&&te!="Alt"&&(x="Alt-"+x),(ht?z.metaKey:z.ctrlKey)&&te!="Ctrl"&&(x="Ctrl-"+x),(ht?z.ctrlKey:z.metaKey)&&te!="Mod"&&(x="Cmd-"+x),!ne&&z.shiftKey&&te!="Shift"&&(x="Shift-"+x),x}function ul(x,z){if(Fe&&x.keyCode==34&&x.char)return!1;var ne=$o[x.keyCode];return ne==null||x.altGraphKey?!1:(x.keyCode==3&&x.code&&(ne=x.code),Is(ne,x,z))}function io(x){return typeof x=="string"?Yi[x]:x}function Io(x,z){for(var ne=x.doc.sel.ranges,te=[],ie=0;ie<ne.length;ie++){for(var le=z(ne[ie]);te.length&&rn(le.from,Vt(te).to)<=0;){var me=te.pop();if(rn(me.from,le.from)<0){le.from=me.from;break}}te.push(le)}pa(x,function(){for(var we=te.length-1;we>=0;we--)Ml(x.doc,"",te[we].from,te[we].to,"+delete");Qs(x)})}function Ha(x,z,ne){var te=ln(x.text,z+ne,ne);return te<0||te>x.text.length?null:te}function Uo(x,z,ne){var te=Ha(x,z.ch,ne);return te==null?null:new Mt(z.line,te,ne<0?"after":"before")}function dl(x,z,ne,te,ie){if(x){z.doc.direction=="rtl"&&(ie=-ie);var le=En(ne,z.doc.direction);if(le){var me=ie<0?Vt(le):le[0],we=ie<0==(me.level==1),_e=we?"after":"before",Ie;if(me.level>0||z.doc.direction=="rtl"){var ot=Oa(z,ne);Ie=ie<0?ne.text.length-1:0;var wt=Oi(z,ot,Ie).top;Ie=Jt(function(on){return Oi(z,ot,on).top==wt},ie<0==(me.level==1)?me.from:me.to-1,Ie),_e=="before"&&(Ie=Ha(ne,Ie,1))}else Ie=ie<0?me.to:me.from;return new Mt(te,Ie,_e)}}return new Mt(te,ie<0?ne.text.length:0,ie<0?"before":"after")}function Go(x,z,ne,te){var ie=En(z,x.doc.direction);if(!ie)return Uo(z,ne,te);ne.ch>=z.text.length?(ne.ch=z.text.length,ne.sticky="before"):ne.ch<=0&&(ne.ch=0,ne.sticky="after");var le=wn(ie,ne.ch,ne.sticky),me=ie[le];if(x.doc.direction=="ltr"&&me.level%2==0&&(te>0?me.to>ne.ch:me.from<ne.ch))return Uo(z,ne,te);var we=function(Lr,Or){return Ha(z,Lr instanceof Mt?Lr.ch:Lr,Or)},_e,Ie=function(Lr){return x.options.lineWrapping?(_e=_e||Oa(x,z),Hl(x,z,_e,Lr)):{begin:0,end:z.text.length}},ot=Ie(ne.sticky=="before"?we(ne,-1):ne.ch);if(x.doc.direction=="rtl"||me.level==1){var wt=me.level==1==te<0,on=we(ne,wt?1:-1);if(on!=null&&(wt?on<=me.to&&on<=ot.end:on>=me.from&&on>=ot.begin)){var qt=wt?"before":"after";return new Mt(ne.line,on,qt)}}var An=function(Lr,Or,Cr){for(var Fr=function(Ji,$a){return $a?new Mt(ne.line,we(Ji,1),"before"):new Mt(ne.line,Ji,"after")};Lr>=0&&Lr<ie.length;Lr+=Or){var Qr=ie[Lr],ti=Or>0==(Qr.level!=1),Ci=ti?Cr.begin:we(Cr.end,-1);if(Qr.from<=Ci&&Ci<Qr.to||(Ci=ti?Qr.from:we(Qr.to,-1),Cr.begin<=Ci&&Ci<Cr.end))return Fr(Ci,ti)}},Kn=An(le+te,te,ot);if(Kn)return Kn;var pr=te>0?ot.end:we(ot.begin,-1);return pr!=null&&!(te>0&&pr==z.text.length)&&(Kn=An(te>0?0:ie.length-1,te,Ie(pr)),Kn)?Kn:null}var Dl={selectAll:ju,singleSelection:function(x){return x.setSelection(x.getCursor("anchor"),x.getCursor("head"),Ge)},killLine:function(x){return Io(x,function(z){if(z.empty()){var ne=We(x.doc,z.head.line).text.length;return z.head.ch==ne&&z.head.line<x.lastLine()?{from:z.head,to:Mt(z.head.line+1,0)}:{from:z.head,to:Mt(z.head.line,ne)}}else return{from:z.from(),to:z.to()}})},deleteLine:function(x){return Io(x,function(z){return{from:Mt(z.from().line,0),to:St(x.doc,Mt(z.to().line+1,0))}})},delLineLeft:function(x){return Io(x,function(z){return{from:Mt(z.from().line,0),to:z.from()}})},delWrappedLineLeft:function(x){return Io(x,function(z){var ne=x.charCoords(z.head,"div").top+5,te=x.coordsChar({left:0,top:ne},"div");return{from:te,to:z.from()}})},delWrappedLineRight:function(x){return Io(x,function(z){var ne=x.charCoords(z.head,"div").top+5,te=x.coordsChar({left:x.display.lineDiv.offsetWidth+100,top:ne},"div");return{from:z.from(),to:te}})},undo:function(x){return x.undo()},redo:function(x){return x.redo()},undoSelection:function(x){return x.undoSelection()},redoSelection:function(x){return x.redoSelection()},goDocStart:function(x){return x.extendSelection(Mt(x.firstLine(),0))},goDocEnd:function(x){return x.extendSelection(Mt(x.lastLine()))},goLineStart:function(x){return x.extendSelectionsBy(function(z){return qu(x,z.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(x){return x.extendSelectionsBy(function(z){return sh(x,z.head)},{origin:"+move",bias:1})},goLineEnd:function(x){return x.extendSelectionsBy(function(z){return Ju(x,z.head.line)},{origin:"+move",bias:-1})},goLineRight:function(x){return x.extendSelectionsBy(function(z){var ne=x.cursorCoords(z.head,"div").top+5;return x.coordsChar({left:x.display.lineDiv.offsetWidth+100,top:ne},"div")},It)},goLineLeft:function(x){return x.extendSelectionsBy(function(z){var ne=x.cursorCoords(z.head,"div").top+5;return x.coordsChar({left:0,top:ne},"div")},It)},goLineLeftSmart:function(x){return x.extendSelectionsBy(function(z){var ne=x.cursorCoords(z.head,"div").top+5,te=x.coordsChar({left:0,top:ne},"div");return te.ch<x.getLine(te.line).search(/\S/)?sh(x,z.head):te},It)},goLineUp:function(x){return x.moveV(-1,"line")},goLineDown:function(x){return x.moveV(1,"line")},goPageUp:function(x){return x.moveV(-1,"page")},goPageDown:function(x){return x.moveV(1,"page")},goCharLeft:function(x){return x.moveH(-1,"char")},goCharRight:function(x){return x.moveH(1,"char")},goColumnLeft:function(x){return x.moveH(-1,"column")},goColumnRight:function(x){return x.moveH(1,"column")},goWordLeft:function(x){return x.moveH(-1,"word")},goGroupRight:function(x){return x.moveH(1,"group")},goGroupLeft:function(x){return x.moveH(-1,"group")},goWordRight:function(x){return x.moveH(1,"word")},delCharBefore:function(x){return x.deleteH(-1,"codepoint")},delCharAfter:function(x){return x.deleteH(1,"char")},delWordBefore:function(x){return x.deleteH(-1,"word")},delWordAfter:function(x){return x.deleteH(1,"word")},delGroupBefore:function(x){return x.deleteH(-1,"group")},delGroupAfter:function(x){return x.deleteH(1,"group")},indentAuto:function(x){return x.indentSelection("smart")},indentMore:function(x){return x.indentSelection("add")},indentLess:function(x){return x.indentSelection("subtract")},insertTab:function(x){return x.replaceSelection(" ")},insertSoftTab:function(x){for(var z=[],ne=x.listSelections(),te=x.options.tabSize,ie=0;ie<ne.length;ie++){var le=ne[ie].from(),me=ze(x.getLine(le.line),le.ch,te);z.push(bn(te-me%te))}x.replaceSelections(z)},defaultTab:function(x){x.somethingSelected()?x.indentSelection("add"):x.execCommand("insertTab")},transposeChars:function(x){return pa(x,function(){for(var z=x.listSelections(),ne=[],te=0;te<z.length;te++)if(z[te].empty()){var ie=z[te].head,le=We(x.doc,ie.line).text;if(le){if(ie.ch==le.length&&(ie=new Mt(ie.line,ie.ch-1)),ie.ch>0)ie=new Mt(ie.line,ie.ch+1),x.replaceRange(le.charAt(ie.ch-1)+le.charAt(ie.ch-2),Mt(ie.line,ie.ch-2),ie,"+transpose");else if(ie.line>x.doc.first){var me=We(x.doc,ie.line-1).text;me&&(ie=new Mt(ie.line,1),x.replaceRange(le.charAt(0)+x.doc.lineSeparator()+me.charAt(me.length-1),Mt(ie.line-1,me.length-1),ie,"+transpose"))}}ne.push(new Fi(ie,ie))}x.setSelections(ne)})},newlineAndIndent:function(x){return pa(x,function(){for(var z=x.listSelections(),ne=z.length-1;ne>=0;ne--)x.replaceRange(x.doc.lineSeparator(),z[ne].anchor,z[ne].head,"+input");z=x.listSelections();for(var te=0;te<z.length;te++)x.indentLine(z[te].from().line,null,!0);Qs(x)})},openLine:function(x){return x.replaceSelection(`
`,"start")},toggleOverwrite:function(x){return x.toggleOverwrite()}};function qu(x,z){var ne=We(x.doc,z),te=Br(ne);return te!=ne&&(z=$t(te)),dl(!0,x,te,z,1)}function Ju(x,z){var ne=We(x.doc,z),te=li(ne);return te!=ne&&(z=$t(te)),dl(!0,x,ne,z,-1)}function sh(x,z){var ne=qu(x,z.line),te=We(x.doc,ne.line),ie=En(te,x.doc.direction);if(!ie||ie[0].level==0){var le=Math.max(ne.ch,te.text.search(/\S/)),me=z.line==ne.line&&z.ch<=le&&z.ch;return Mt(ne.line,me?0:le,ne.sticky)}return ne}function Ma(x,z,ne){if(typeof z=="string"&&(z=Dl[z],!z))return!1;x.display.input.ensurePolled();var te=x.display.shift,ie=!1;try{x.isReadOnly()&&(x.state.suppressEdits=!0),ne&&(x.display.shift=!1),ie=z(x)!=Ut}finally{x.display.shift=te,x.state.suppressEdits=!1}return ie}function Xo(x,z,ne){for(var te=0;te<x.state.keyMaps.length;te++){var ie=ms(z,x.state.keyMaps[te],ne,x);if(ie)return ie}return x.options.extraKeys&&ms(z,x.options.extraKeys,ne,x)||ms(z,x.options.keyMap,ne,x)}var nf=new xe;function Al(x,z,ne,te){var ie=x.state.keySeq;if(ie){if(sc(z))return"handled";if(/\'$/.test(z)?x.state.keySeq=null:nf.set(50,function(){x.state.keySeq==ie&&(x.state.keySeq=null,x.display.input.reset())}),Qc(x,ie+" "+z,ne,te))return!0}return Qc(x,z,ne,te)}function Qc(x,z,ne,te){var ie=Xo(x,z,te);return ie=="multi"&&(x.state.keySeq=z),ie=="handled"&&$r(x,"keyHandled",x,z,ne),(ie=="handled"||ie=="multi")&&(Pn(ne),kc(x)),!!ie}function Di(x,z){var ne=ul(z,!0);return ne?z.shiftKey&&!x.state.keySeq?Al(x,"Shift-"+ne,z,function(te){return Ma(x,te,!0)})||Al(x,ne,z,function(te){if(typeof te=="string"?/^go[A-Z]/.test(te):te.motion)return Ma(x,te)}):Al(x,ne,z,function(te){return Ma(x,te)}):!1}function Tl(x,z,ne){return Al(x,"'"+ne+"'",z,function(te){return Ma(x,te,!0)})}var gs=null;function lc(x){var z=this;if(!(x.target&&x.target!=z.display.input.getField())&&(z.curOp.focus=qe(),!Ze(z,x))){Se&&Pe<11&&x.keyCode==27&&(x.returnValue=!1);var ne=x.keyCode;z.display.shift=ne==16||x.shiftKey;var te=Di(z,x);Fe&&(gs=te?ne:null,!te&&ne==88&&!Nr&&(st?x.metaKey:x.ctrlKey)&&z.replaceSelection("",null,"cut")),pe&&!st&&!te&&ne==46&&x.shiftKey&&!x.ctrlKey&&document.execCommand&&document.execCommand("cut"),ne==18&&!/\bCodeMirror-crosshair\b/.test(z.display.lineDiv.className)&&Dn(z)}}function Dn(x){var z=x.display.lineDiv;Ht(z,"CodeMirror-crosshair");function ne(te){(te.keyCode==18||!te.altKey)&&(Xe(z,"CodeMirror-crosshair"),tt(document,"keyup",ne),tt(document,"mouseover",ne))}gn(document,"keyup",ne),gn(document,"mouseover",ne)}function lh(x){x.keyCode==16&&(this.doc.sel.shift=!1),Ze(this,x)}function ch(x){var z=this;if(!(x.target&&x.target!=z.display.input.getField())&&!(oo(z.display,x)||Ze(z,x)||x.ctrlKey&&!x.altKey||st&&x.metaKey)){var ne=x.keyCode,te=x.charCode;if(Fe&&ne==gs){gs=null,Pn(x);return}if(!(Fe&&(!x.which||x.which<10)&&Di(z,x))){var ie=String.fromCharCode(te==null?ne:te);ie!="\b"&&(Tl(z,x,ie)||z.display.input.onKeyPress(x))}}}var Qu=400,ed=function(x,z,ne){this.time=x,this.pos=z,this.button=ne};ed.prototype.compare=function(x,z,ne){return this.time+Qu>x&&rn(z,this.pos)==0&&ne==this.button};var vs,cc;function rf(x,z){var ne=+new Date;return cc&&cc.compare(ne,x,z)?(vs=cc=null,"triple"):vs&&vs.compare(ne,x,z)?(cc=new ed(ne,x,z),vs=null,"double"):(vs=new ed(ne,x,z),cc=null,"single")}function Wa(x){var z=this,ne=z.display;if(!(Ze(z,x)||ne.activeTouch&&ne.input.supportsTouch())){if(ne.input.ensurePolled(),ne.shift=x.shiftKey,oo(ne,x)){Ne||(ne.scroller.draggable=!1,setTimeout(function(){return ne.scroller.draggable=!0},100));return}if(!qa(z,x)){var te=xo(z,x),ie=Tn(x),le=te?rf(te,ie):"single";window.focus(),ie==1&&z.state.selectingText&&z.state.selectingText(x),!(te&&Bs(z,ie,te,le,x))&&(ie==1?te?tu(z,te,le,x):tr(x)==ne.scroller&&Pn(x):ie==2?(te&&sl(z.doc,te),setTimeout(function(){return ne.input.focus()},20)):ie==3&&(Ve?z.display.input.onContextMenu(x):Eu(z)))}}}function Bs(x,z,ne,te,ie){var le="Click";return te=="double"?le="Double"+le:te=="triple"&&(le="Triple"+le),le=(z==1?"Left":z==2?"Middle":"Right")+le,Al(x,Is(le,ie),ie,function(me){if(typeof me=="string"&&(me=Dl[me]),!me)return!1;var we=!1;try{x.isReadOnly()&&(x.state.suppressEdits=!0),we=me(x,ne)!=Ut}finally{x.state.suppressEdits=!1}return we})}function eu(x,z,ne){var te=x.getOption("configureMouse"),ie=te?te(x,z,ne):{};if(ie.unit==null){var le=Rt?ne.shiftKey&&ne.metaKey:ne.altKey;ie.unit=le?"rectangle":z=="single"?"char":z=="double"?"word":"line"}return(ie.extend==null||x.doc.extend)&&(ie.extend=x.doc.extend||ne.shiftKey),ie.addNew==null&&(ie.addNew=st?ne.metaKey:ne.ctrlKey),ie.moveOnDrag==null&&(ie.moveOnDrag=!(st?ne.altKey:ne.ctrlKey)),ie}function tu(x,z,ne,te){Se?setTimeout(Xt(Sl,x),0):x.curOp.focus=qe();var ie=eu(x,ne,te),le=x.doc.sel,me;x.options.dragDrop&&gr&&!x.isReadOnly()&&ne=="single"&&(me=le.contains(z))>-1&&(rn((me=le.ranges[me]).from(),z)<0||z.xRel>0)&&(rn(me.to(),z)>0||z.xRel<0)?af(x,te,z,ie):td(x,te,z,ie)}function af(x,z,ne,te){var ie=x.display,le=!1,me=Sa(x,function(Ie){Ne&&(ie.scroller.draggable=!1),x.state.draggingText=!1,tt(ie.wrapper.ownerDocument,"mouseup",me),tt(ie.wrapper.ownerDocument,"mousemove",we),tt(ie.scroller,"dragstart",_e),tt(ie.scroller,"drop",me),le||(Pn(Ie),te.addNew||sl(x.doc,ne,null,null,te.extend),Ne&&!gt||Se&&Pe==9?setTimeout(function(){ie.wrapper.ownerDocument.body.focus({preventScroll:!0}),ie.input.focus()},20):ie.input.focus())}),we=function(Ie){le=le||Math.abs(z.clientX-Ie.clientX)+Math.abs(z.clientY-Ie.clientY)>=10},_e=function(){return le=!0};Ne&&(ie.scroller.draggable=!0),x.state.draggingText=me,me.copy=!te.moveOnDrag,ie.scroller.dragDrop&&ie.scroller.dragDrop(),gn(ie.wrapper.ownerDocument,"mouseup",me),gn(ie.wrapper.ownerDocument,"mousemove",we),gn(ie.scroller,"dragstart",_e),gn(ie.scroller,"drop",me),Eu(x),setTimeout(function(){return ie.input.focus()},20)}function uh(x,z,ne){if(ne=="char")return new Fi(z,z);if(ne=="word")return x.findWordAt(z);if(ne=="line")return new Fi(Mt(z.line,0),St(x.doc,Mt(z.line+1,0)));var te=ne(x,z);return new Fi(te.from,te.to)}function td(x,z,ne,te){var ie=x.display,le=x.doc;Pn(z);var me,we,_e=le.sel,Ie=_e.ranges;if(te.addNew&&!te.extend?(we=le.sel.contains(ne),we>-1?me=Ie[we]:me=new Fi(ne,ne)):(me=le.sel.primary(),we=le.sel.primIndex),te.unit=="rectangle")te.addNew||(me=new Fi(ne,ne)),ne=xo(x,z,!0,!0),we=-1;else{var ot=uh(x,ne,te.unit);te.extend?me=Vc(me,ot.anchor,ot.head,te.extend):me=ot}te.addNew?we==-1?(we=Ie.length,Ca(le,Po(x,Ie.concat([me]),we),{scroll:!1,origin:"*mouse"})):Ie.length>1&&Ie[we].empty()&&te.unit=="char"&&!te.extend?(Ca(le,Po(x,Ie.slice(0,we).concat(Ie.slice(we+1)),0),{scroll:!1,origin:"*mouse"}),_e=le.sel):So(le,we,me,Ye):(we=0,Ca(le,new go([me],0),Ye),_e=le.sel);var wt=ne;function on(Cr){if(rn(wt,Cr)!=0)if(wt=Cr,te.unit=="rectangle"){for(var Fr=[],Qr=x.options.tabSize,ti=ze(We(le,ne.line).text,ne.ch,Qr),Ci=ze(We(le,Cr.line).text,Cr.ch,Qr),Ji=Math.min(ti,Ci),$a=Math.max(ti,Ci),da=Math.min(ne.line,Cr.line),co=Math.min(x.lastLine(),Math.max(ne.line,Cr.line));da<=co;da++){var uo=We(le,da).text,_a=Mn(uo,Ji,Qr);Ji==$a?Fr.push(new Fi(Mt(da,_a),Mt(da,_a))):uo.length>_a&&Fr.push(new Fi(Mt(da,_a),Mt(da,Mn(uo,$a,Qr))))}Fr.length||Fr.push(new Fi(ne,ne)),Ca(le,Po(x,_e.ranges.slice(0,we).concat(Fr),we),{origin:"*mouse",scroll:!1}),x.scrollIntoView(Cr)}else{var ho=me,hi=uh(x,Cr,te.unit),ma=ho.anchor,ha;rn(hi.anchor,ma)>0?(ha=hi.head,ma=Et(ho.from(),hi.anchor)):(ha=hi.anchor,ma=Ct(ho.to(),hi.head));var ga=_e.ranges.slice(0);ga[we]=dh(x,new Fi(St(le,ma),ha)),Ca(le,Po(x,ga,we),Ye)}}var qt=ie.wrapper.getBoundingClientRect(),An=0;function Kn(Cr){var Fr=++An,Qr=xo(x,Cr,!0,te.unit=="rectangle");if(Qr)if(rn(Qr,wt)!=0){x.curOp.focus=qe(),on(Qr);var ti=Ta(ie,le);(Qr.line>=ti.to||Qr.line<ti.from)&&setTimeout(Sa(x,function(){An==Fr&&Kn(Cr)}),150)}else{var Ci=Cr.clientY<qt.top?-20:Cr.clientY>qt.bottom?20:0;Ci&&setTimeout(Sa(x,function(){An==Fr&&(ie.scroller.scrollTop+=Ci,Kn(Cr))}),50)}}function pr(Cr){x.state.selectingText=!1,An=1/0,Cr&&(Pn(Cr),ie.input.focus()),tt(ie.wrapper.ownerDocument,"mousemove",Lr),tt(ie.wrapper.ownerDocument,"mouseup",Or),le.history.lastSelOrigin=null}var Lr=Sa(x,function(Cr){Cr.buttons===0||!Tn(Cr)?pr(Cr):Kn(Cr)}),Or=Sa(x,pr);x.state.selectingText=Or,gn(ie.wrapper.ownerDocument,"mousemove",Lr),gn(ie.wrapper.ownerDocument,"mouseup",Or)}function dh(x,z){var ne=z.anchor,te=z.head,ie=We(x.doc,ne.line);if(rn(ne,te)==0&&ne.sticky==te.sticky)return z;var le=En(ie);if(!le)return z;var me=wn(le,ne.ch,ne.sticky),we=le[me];if(we.from!=ne.ch&&we.to!=ne.ch)return z;var _e=me+(we.from==ne.ch==(we.level!=1)?0:1);if(_e==0||_e==le.length)return z;var Ie;if(te.line!=ne.line)Ie=(te.line-ne.line)*(x.doc.direction=="ltr"?1:-1)>0;else{var ot=wn(le,te.ch,te.sticky),wt=ot-me||(te.ch-ne.ch)*(we.level==1?-1:1);ot==_e-1||ot==_e?Ie=wt<0:Ie=wt>0}var on=le[_e+(Ie?-1:0)],qt=Ie==(on.level==1),An=qt?on.from:on.to,Kn=qt?"after":"before";return ne.ch==An&&ne.sticky==Kn?z:new Fi(new Mt(ne.line,An,Kn),te)}function uc(x,z,ne,te){var ie,le;if(z.touches)ie=z.touches[0].clientX,le=z.touches[0].clientY;else try{ie=z.clientX,le=z.clientY}catch(on){return!1}if(ie>=Math.floor(x.display.gutters.getBoundingClientRect().right))return!1;te&&Pn(z);var me=x.display,we=me.lineDiv.getBoundingClientRect();if(le>we.bottom||!Qt(x,ne))return Nn(z);le-=we.top-me.viewOffset;for(var _e=0;_e<x.display.gutterSpecs.length;++_e){var Ie=me.gutters.childNodes[_e];if(Ie&&Ie.getBoundingClientRect().right>=ie){var ot=sn(x.doc,le),wt=x.display.gutterSpecs[_e];return Re(x,ne,x,ot,wt.className,z),Nn(z)}}}function qa(x,z){return uc(x,z,"gutterClick",!0)}function Os(x,z){oo(x.display,z)||hh(x,z)||Ze(x,z,"contextmenu")||Ve||x.display.input.onContextMenu(z)}function hh(x,z){return Qt(x,"gutterContextMenu")?uc(x,z,"gutterContextMenu",!1):!1}function nd(x){x.display.wrapper.className=x.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+x.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Xi(x)}var Rs={toString:function(){return"CodeMirror.Init"}},fh={},nu={};function of(x){var z=x.optionHandlers;function ne(te,ie,le,me){x.defaults[te]=ie,le&&(z[te]=me?function(we,_e,Ie){Ie!=Rs&&le(we,_e,Ie)}:le)}x.defineOption=ne,x.Init=Rs,ne("value","",function(te,ie){return te.setValue(ie)},!0),ne("mode",null,function(te,ie){te.doc.modeOption=ie,Nc(te)},!0),ne("indentUnit",2,Nc,!0),ne("indentWithTabs",!1),ne("smartIndent",!0),ne("tabSize",4,function(te){al(te),Xi(te),za(te)},!0),ne("lineSeparator",null,function(te,ie){if(te.doc.lineSep=ie,!!ie){var le=[],me=te.doc.first;te.doc.iter(function(_e){for(var Ie=0;;){var ot=_e.text.indexOf(ie,Ie);if(ot==-1)break;Ie=ot+ie.length,le.push(Mt(me,ot))}me++});for(var we=le.length-1;we>=0;we--)Ml(te.doc,ie,le[we],Mt(le[we].line,le[we].ch+ie.length))}}),ne("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(te,ie,le){te.state.specialChars=new RegExp(ie.source+(ie.test(" ")?"":"| "),"g"),le!=Rs&&te.refresh()}),ne("specialCharPlaceholder",Hi,function(te){return te.refresh()},!0),ne("electricChars",!0),ne("inputStyle",mt?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),ne("spellcheck",!1,function(te,ie){return te.getInputField().spellcheck=ie},!0),ne("autocorrect",!1,function(te,ie){return te.getInputField().autocorrect=ie},!0),ne("autocapitalize",!1,function(te,ie){return te.getInputField().autocapitalize=ie},!0),ne("rtlMoveVisually",!tn),ne("wholeLineUpdateBefore",!0),ne("theme","default",function(te){nd(te),Cl(te)},!0),ne("keyMap","default",function(te,ie,le){var me=io(ie),we=le!=Rs&&io(le);we&&we.detach&&we.detach(te,me),me.attach&&me.attach(te,we||null)}),ne("extraKeys",null),ne("configureMouse",null),ne("lineWrapping",!1,ph,!0),ne("gutters",[],function(te,ie){te.display.gutterSpecs=Bc(ie,te.options.lineNumbers),Cl(te)},!0),ne("fixedGutter",!0,function(te,ie){te.display.gutters.style.left=ie?ji(te.display)+"px":"0",te.refresh()},!0),ne("coverGutterNextToScrollbar",!1,function(te){return Es(te)},!0),ne("scrollbarStyle","native",function(te){Pu(te),Es(te),te.display.scrollbars.setScrollTop(te.doc.scrollTop),te.display.scrollbars.setScrollLeft(te.doc.scrollLeft)},!0),ne("lineNumbers",!1,function(te,ie){te.display.gutterSpecs=Bc(te.options.gutters,ie),Cl(te)},!0),ne("firstLineNumber",1,Cl,!0),ne("lineNumberFormatter",function(te){return te},Cl,!0),ne("showCursorWhenSelecting",!1,wl,!0),ne("resetSelectionOnContextMenu",!0),ne("lineWiseCopyCut",!0),ne("pasteLinesPerSelection",!0),ne("selectionsMayTouch",!1),ne("readOnly",!1,function(te,ie){ie=="nocursor"&&(Js(te),te.display.input.blur()),te.display.input.readOnlyChanged(ie)}),ne("screenReaderLabel",null,function(te,ie){ie=ie===""?null:ie,te.display.input.screenReaderLabelChanged(ie)}),ne("disableInput",!1,function(te,ie){ie||te.display.input.reset()},!0),ne("dragDrop",!0,sf),ne("allowDropFileTypes",null),ne("cursorBlinkRate",530),ne("cursorScrollMargin",0),ne("cursorHeight",1,wl,!0),ne("singleCursorHeightPerLine",!0,wl,!0),ne("workTime",100),ne("workDelay",100),ne("flattenSpans",!0,al,!0),ne("addModeClass",!1,al,!0),ne("pollInterval",100),ne("undoDepth",200,function(te,ie){return te.doc.history.undoDepth=ie}),ne("historyEventDelay",1250),ne("viewportMargin",10,function(te){return te.refresh()},!0),ne("maxHighlightLength",1e4,al,!0),ne("moveInputWithCursor",!0,function(te,ie){ie||te.display.input.resetPosition()}),ne("tabindex",null,function(te,ie){return te.display.input.getField().tabIndex=ie||""}),ne("autofocus",null),ne("direction","ltr",function(te,ie){return te.doc.setDirection(ie)},!0),ne("phrases",null)}function sf(x,z,ne){var te=ne&&ne!=Rs;if(!z!=!te){var ie=x.display.dragFunctions,le=z?gn:tt;le(x.display.scroller,"dragstart",ie.start),le(x.display.scroller,"dragenter",ie.enter),le(x.display.scroller,"dragover",ie.over),le(x.display.scroller,"dragleave",ie.leave),le(x.display.scroller,"drop",ie.drop)}}function ph(x){x.options.lineWrapping?(Ht(x.display.wrapper,"CodeMirror-wrap"),x.display.sizer.style.minWidth="",x.display.sizerWidth=null):(Xe(x.display.wrapper,"CodeMirror-wrap"),Hn(x)),Aa(x),za(x),Xi(x),setTimeout(function(){return Es(x)},100)}function si(x,z){var ne=this;if(!(this instanceof si))return new si(x,z);this.options=z=z?Wt(z):{},Wt(fh,z,!1);var te=z.value;typeof te=="string"?te=new ya(te,z.mode,null,z.lineSeparator,z.direction):z.mode&&(te.modeOption=z.mode),this.doc=te;var ie=new si.inputStyles[z.inputStyle](this),le=this.display=new Gd(x,te,ie,z);le.wrapper.CodeMirror=this,nd(this),z.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Pu(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 xe,keySeq:null,specialChars:null},z.autofocus&&!mt&&le.input.focus(),Se&&Pe<11&&setTimeout(function(){return ne.display.input.reset(!0)},20),lf(this),Xu(),Ls(this),this.curOp.forceUpdate=!0,ql(this,te),z.autofocus&&!mt||this.hasFocus()?setTimeout(function(){ne.hasFocus()&&!ne.state.focused&&Ec(ne)},20):Js(this);for(var me in nu)nu.hasOwnProperty(me)&&nu[me](this,z[me],Rs);Xl(this),z.finishInit&&z.finishInit(this);for(var we=0;we<rd.length;++we)rd[we](this);cs(this),Ne&&z.lineWrapping&&getComputedStyle(le.lineDiv).textRendering=="optimizelegibility"&&(le.lineDiv.style.textRendering="auto")}si.defaults=fh,si.optionHandlers=nu;function lf(x){var z=x.display;gn(z.scroller,"mousedown",Sa(x,Wa)),Se&&Pe<11?gn(z.scroller,"dblclick",Sa(x,function(_e){if(!Ze(x,_e)){var Ie=xo(x,_e);if(!(!Ie||qa(x,_e)||oo(x.display,_e))){Pn(_e);var ot=x.findWordAt(Ie);sl(x.doc,ot.anchor,ot.head)}}})):gn(z.scroller,"dblclick",function(_e){return Ze(x,_e)||Pn(_e)}),gn(z.scroller,"contextmenu",function(_e){return Os(x,_e)}),gn(z.input.getField(),"contextmenu",function(_e){z.scroller.contains(_e.target)||Os(x,_e)});var ne,te={end:0};function ie(){z.activeTouch&&(ne=setTimeout(function(){return z.activeTouch=null},1e3),te=z.activeTouch,te.end=+new Date)}function le(_e){if(_e.touches.length!=1)return!1;var Ie=_e.touches[0];return Ie.radiusX<=1&&Ie.radiusY<=1}function me(_e,Ie){if(Ie.left==null)return!0;var ot=Ie.left-_e.left,wt=Ie.top-_e.top;return ot*ot+wt*wt>20*20}gn(z.scroller,"touchstart",function(_e){if(!Ze(x,_e)&&!le(_e)&&!qa(x,_e)){z.input.ensurePolled(),clearTimeout(ne);var Ie=+new Date;z.activeTouch={start:Ie,moved:!1,prev:Ie-te.end<=300?te:null},_e.touches.length==1&&(z.activeTouch.left=_e.touches[0].pageX,z.activeTouch.top=_e.touches[0].pageY)}}),gn(z.scroller,"touchmove",function(){z.activeTouch&&(z.activeTouch.moved=!0)}),gn(z.scroller,"touchend",function(_e){var Ie=z.activeTouch;if(Ie&&!oo(z,_e)&&Ie.left!=null&&!Ie.moved&&new Date-Ie.start<300){var ot=x.coordsChar(z.activeTouch,"page"),wt;!Ie.prev||me(Ie,Ie.prev)?wt=new Fi(ot,ot):!Ie.prev.prev||me(Ie,Ie.prev.prev)?wt=x.findWordAt(ot):wt=new Fi(Mt(ot.line,0),St(x.doc,Mt(ot.line+1,0))),x.setSelection(wt.anchor,wt.head),x.focus(),Pn(_e)}ie()}),gn(z.scroller,"touchcancel",ie),gn(z.scroller,"scroll",function(){z.scroller.clientHeight&&(_s(x,z.scroller.scrollTop),ks(x,z.scroller.scrollLeft,!0),Re(x,"scroll",x))}),gn(z.scroller,"mousewheel",function(_e){return Fu(x,_e)}),gn(z.scroller,"DOMMouseScroll",function(_e){return Fu(x,_e)}),gn(z.wrapper,"scroll",function(){return z.wrapper.scrollTop=z.wrapper.scrollLeft=0}),z.dragFunctions={enter:function(_e){Ze(x,_e)||Zn(_e)},over:function(_e){Ze(x,_e)||(Gu(x,_e),Zn(_e))},start:function(_e){return ef(x,_e)},drop:Sa(x,Qh),leave:function(_e){Ze(x,_e)||El(x)}};var we=z.input.getField();gn(we,"keyup",function(_e){return lh.call(x,_e)}),gn(we,"keydown",Sa(x,lc)),gn(we,"keypress",Sa(x,ch)),gn(we,"focus",function(_e){return Ec(x,_e)}),gn(we,"blur",function(_e){return Js(x,_e)})}var rd=[];si.defineInitHook=function(x){return rd.push(x)};function Fo(x,z,ne,te){var ie=x.doc,le;ne==null&&(ne="add"),ne=="smart"&&(ie.mode.indent?le=Pt(x,z).state:ne="prev");var me=x.options.tabSize,we=We(ie,z),_e=ze(we.text,null,me);we.stateAfter&&(we.stateAfter=null);var Ie=we.text.match(/^\s*/)[0],ot;if(!te&&!/\S/.test(we.text))ot=0,ne="not";else if(ne=="smart"&&(ot=ie.mode.indent(le,we.text.slice(Ie.length),we.text),ot==Ut||ot>150)){if(!te)return;ne="prev"}ne=="prev"?z>ie.first?ot=ze(We(ie,z-1).text,null,me):ot=0:ne=="add"?ot=_e+x.options.indentUnit:ne=="subtract"?ot=_e-x.options.indentUnit:typeof ne=="number"&&(ot=_e+ne),ot=Math.max(0,ot);var wt="",on=0;if(x.options.indentWithTabs)for(var qt=Math.floor(ot/me);qt;--qt)on+=me,wt+=" ";if(on<ot&&(wt+=bn(ot-on)),wt!=Ie)return Ml(ie,wt,Mt(z,0),Mt(z,Ie.length),"+input"),we.stateAfter=null,!0;for(var An=0;An<ie.sel.ranges.length;An++){var Kn=ie.sel.ranges[An];if(Kn.head.line==z&&Kn.head.ch<Ie.length){var pr=Mt(z,Ie.length);So(ie,An,new Fi(pr,pr));break}}}var zo=null;function Ns(x){zo=x}function id(x,z,ne,te,ie){var le=x.doc;x.display.shift=!1,te||(te=le.sel);var me=+new Date-200,we=ie=="paste"||x.state.pasteIncoming>me,_e=Dr(z),Ie=null;if(we&&te.ranges.length>1)if(zo&&zo.text.join(`
`)==z){if(te.ranges.length%zo.text.length==0){Ie=[];for(var ot=0;ot<zo.text.length;ot++)Ie.push(le.splitLines(zo.text[ot]))}}else _e.length==te.ranges.length&&x.options.pasteLinesPerSelection&&(Ie=Zt(_e,function(Lr){return[Lr]}));for(var wt=x.curOp.updateInput,on=te.ranges.length-1;on>=0;on--){var qt=te.ranges[on],An=qt.from(),Kn=qt.to();qt.empty()&&(ne&&ne>0?An=Mt(An.line,An.ch-ne):x.state.overwrite&&!we?Kn=Mt(Kn.line,Math.min(We(le,Kn.line).text.length,Kn.ch+Vt(_e).length)):we&&zo&&zo.lineWise&&zo.text.join(`
`)==_e.join(`
`)&&(An=Kn=Mt(An.line,0)));var pr={from:An,to:Kn,text:Ie?Ie[on%Ie.length]:_e,origin:ie||(we?"paste":x.state.cutIncoming>me?"cut":"+input")};Ds(x.doc,pr),$r(x,"inputRead",x,pr)}z&&!we&&od(x,z),Qs(x),x.curOp.updateInput<2&&(x.curOp.updateInput=wt),x.curOp.typing=!0,x.state.pasteIncoming=x.state.cutIncoming=-1}function ad(x,z){var ne=x.clipboardData&&x.clipboardData.getData("Text");if(ne)return x.preventDefault(),!z.isReadOnly()&&!z.options.disableInput&&pa(z,function(){return id(z,ne,0,null,"paste")}),!0}function od(x,z){if(!(!x.options.electricChars||!x.options.smartIndent))for(var ne=x.doc.sel,te=ne.ranges.length-1;te>=0;te--){var ie=ne.ranges[te];if(!(ie.head.ch>100||te&&ne.ranges[te-1].head.line==ie.head.line)){var le=x.getModeAt(ie.head),me=!1;if(le.electricChars){for(var we=0;we<le.electricChars.length;we++)if(z.indexOf(le.electricChars.charAt(we))>-1){me=Fo(x,ie.head.line,"smart");break}}else le.electricInput&&le.electricInput.test(We(x.doc,ie.head.line).text.slice(0,ie.head.ch))&&(me=Fo(x,ie.head.line,"smart"));me&&$r(x,"electricInput",x,ie.head.line)}}}function Pl(x){for(var z=[],ne=[],te=0;te<x.doc.sel.ranges.length;te++){var ie=x.doc.sel.ranges[te].head.line,le={anchor:Mt(ie,0),head:Mt(ie+1,0)};ne.push(le),z.push(x.getRange(le.anchor,le.head))}return{text:z,ranges:ne}}function mh(x,z,ne,te){x.setAttribute("autocorrect",ne?"":"off"),x.setAttribute("autocapitalize",te?"":"off"),x.setAttribute("spellcheck",!!z)}function sd(){var x=Ue("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),z=Ue("div",[x],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return Ne?x.style.width="1000px":x.setAttribute("wrap","off"),kt&&(x.style.border="1px solid black"),mh(x),z}function ld(x){var z=x.optionHandlers,ne=x.helpers={};x.prototype={constructor:x,focus:function(){window.focus(),this.display.input.focus()},setOption:function(te,ie){var le=this.options,me=le[te];le[te]==ie&&te!="mode"||(le[te]=ie,z.hasOwnProperty(te)&&Sa(this,z[te])(this,ie,me),Re(this,"optionChange",this,te))},getOption:function(te){return this.options[te]},getDoc:function(){return this.doc},addKeyMap:function(te,ie){this.state.keyMaps[ie?"push":"unshift"](io(te))},removeKeyMap:function(te){for(var ie=this.state.keyMaps,le=0;le<ie.length;++le)if(ie[le]==te||ie[le].name==te)return ie.splice(le,1),!0},addOverlay:ua(function(te,ie){var le=te.token?te:x.getMode(this.options,te);if(le.startState)throw new Error("Overlays may not be stateful.");zt(this.state.overlays,{mode:le,modeSpec:te,opaque:ie&&ie.opaque,priority:ie&&ie.priority||0},function(me){return me.priority}),this.state.modeGen++,za(this)}),removeOverlay:ua(function(te){for(var ie=this.state.overlays,le=0;le<ie.length;++le){var me=ie[le].modeSpec;if(me==te||typeof te=="string"&&me.name==te){ie.splice(le,1),this.state.modeGen++,za(this);return}}}),indentLine:ua(function(te,ie,le){typeof ie!="string"&&typeof ie!="number"&&(ie==null?ie=this.options.smartIndent?"smart":"prev":ie=ie?"add":"subtract"),hn(this.doc,te)&&Fo(this,te,ie,le)}),indentSelection:ua(function(te){for(var ie=this.doc.sel.ranges,le=-1,me=0;me<ie.length;me++){var we=ie[me];if(we.empty())we.head.line>le&&(Fo(this,we.head.line,te,!0),le=we.head.line,me==this.doc.sel.primIndex&&Qs(this));else{var _e=we.from(),Ie=we.to(),ot=Math.max(le,_e.line);le=Math.min(this.lastLine(),Ie.line-(Ie.ch?0:1))+1;for(var wt=ot;wt<le;++wt)Fo(this,wt,te);var on=this.doc.sel.ranges;_e.ch==0&&ie.length==on.length&&on[me].from().ch>0&&So(this.doc,me,new Fi(_e,on[me].to()),Ge)}}}),getTokenAt:function(te,ie){return $n(this,te,ie)},getLineTokens:function(te,ie){return $n(this,Mt(te),ie,!0)},getTokenTypeAt:function(te){te=St(this.doc,te);var ie=_t(this,We(this.doc,te.line)),le=0,me=(ie.length-1)/2,we=te.ch,_e;if(we==0)_e=ie[2];else for(;;){var Ie=le+me>>1;if((Ie?ie[Ie*2-1]:0)>=we)me=Ie;else if(ie[Ie*2+1]<we)le=Ie+1;else{_e=ie[Ie*2+2];break}}var ot=_e?_e.indexOf("overlay "):-1;return ot<0?_e:ot==0?null:_e.slice(0,ot-1)},getModeAt:function(te){var ie=this.doc.mode;return ie.innerMode?x.innerMode(ie,this.getTokenAt(te).state).mode:ie},getHelper:function(te,ie){return this.getHelpers(te,ie)[0]},getHelpers:function(te,ie){var le=[];if(!ne.hasOwnProperty(ie))return le;var me=ne[ie],we=this.getModeAt(te);if(typeof we[ie]=="string")me[we[ie]]&&le.push(me[we[ie]]);else if(we[ie])for(var _e=0;_e<we[ie].length;_e++){var Ie=me[we[ie][_e]];Ie&&le.push(Ie)}else we.helperType&&me[we.helperType]?le.push(me[we.helperType]):me[we.name]&&le.push(me[we.name]);for(var ot=0;ot<me._global.length;ot++){var wt=me._global[ot];wt.pred(we,this)&&bt(le,wt.val)==-1&&le.push(wt.val)}return le},getStateAfter:function(te,ie){var le=this.doc;return te=Yt(le,te==null?le.first+le.size-1:te),Pt(this,te+1,ie).state},cursorCoords:function(te,ie){var le,me=this.doc.sel.primary();return te==null?le=me.head:typeof te=="object"?le=St(this.doc,te):le=te?me.from():me.to(),Da(this,le,ie||"page")},charCoords:function(te,ie){return lo(this,St(this.doc,te),ie||"page")},coordsChar:function(te,ie){return te=so(this,te,ie||"page"),qs(this,te.left,te.top)},lineAtHeight:function(te,ie){return te=so(this,{top:te,left:0},ie||"page").top,sn(this.doc,te+this.display.viewOffset)},heightAtLine:function(te,ie,le){var me=!1,we;if(typeof te=="number"){var _e=this.doc.first+this.doc.size-1;te<this.doc.first?te=this.doc.first:te>_e&&(te=_e,me=!0),we=We(this.doc,te)}else we=te;return Na(this,we,{top:0,left:0},ie||"page",le||me).top+(me?this.doc.height-Gn(we):0)},defaultTextHeight:function(){return as(this.display)},defaultCharWidth:function(){return Pi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(te,ie,le,me,we){var _e=this.display;te=Da(this,St(this.doc,te));var Ie=te.bottom,ot=te.left;if(ie.style.position="absolute",ie.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(ie),_e.sizer.appendChild(ie),me=="over")Ie=te.top;else if(me=="above"||me=="near"){var wt=Math.max(_e.wrapper.clientHeight,this.doc.height),on=Math.max(_e.sizer.clientWidth,_e.lineSpace.clientWidth);(me=="above"||te.bottom+ie.offsetHeight>wt)&&te.top>ie.offsetHeight?Ie=te.top-ie.offsetHeight:te.bottom+ie.offsetHeight<=wt&&(Ie=te.bottom),ot+ie.offsetWidth>on&&(ot=on-ie.offsetWidth)}ie.style.top=Ie+"px",ie.style.left=ie.style.right="",we=="right"?(ot=_e.sizer.clientWidth-ie.offsetWidth,ie.style.right="0px"):(we=="left"?ot=0:we=="middle"&&(ot=(_e.sizer.clientWidth-ie.offsetWidth)/2),ie.style.left=ot+"px"),le&&Rd(this,{left:ot,top:Ie,right:ot+ie.offsetWidth,bottom:Ie+ie.offsetHeight})},triggerOnKeyDown:ua(lc),triggerOnKeyPress:ua(ch),triggerOnKeyUp:lh,triggerOnMouseDown:ua(Wa),execCommand:function(te){if(Dl.hasOwnProperty(te))return Dl[te].call(null,this)},triggerElectric:ua(function(te){od(this,te)}),findPosH:function(te,ie,le,me){var we=1;ie<0&&(we=-1,ie=-ie);for(var _e=St(this.doc,te),Ie=0;Ie<ie&&(_e=ru(this.doc,_e,we,le,me),!_e.hitSide);++Ie);return _e},moveH:ua(function(te,ie){var le=this;this.extendSelectionsBy(function(me){return le.display.shift||le.doc.extend||me.empty()?ru(le.doc,me.head,te,ie,le.options.rtlMoveVisually):te<0?me.from():me.to()},It)}),deleteH:ua(function(te,ie){var le=this.doc.sel,me=this.doc;le.somethingSelected()?me.replaceSelection("",null,"+delete"):Io(this,function(we){var _e=ru(me,we.head,te,ie,!1);return te<0?{from:_e,to:we.head}:{from:we.head,to:_e}})}),findPosV:function(te,ie,le,me){var we=1,_e=me;ie<0&&(we=-1,ie=-ie);for(var Ie=St(this.doc,te),ot=0;ot<ie;++ot){var wt=Da(this,Ie,"div");if(_e==null?_e=wt.left:wt.left=_e,Ie=gh(this,wt,we,le),Ie.hitSide)break}return Ie},moveV:ua(function(te,ie){var le=this,me=this.doc,we=[],_e=!this.display.shift&&!me.extend&&me.sel.somethingSelected();if(me.extendSelectionsBy(function(ot){if(_e)return te<0?ot.from():ot.to();var wt=Da(le,ot.head,"div");ot.goalColumn!=null&&(wt.left=ot.goalColumn),we.push(wt.left);var on=gh(le,wt,te,ie);return ie=="page"&&ot==me.sel.primary()&&Lc(le,lo(le,on,"div").top-wt.top),on},It),we.length)for(var Ie=0;Ie<me.sel.ranges.length;Ie++)me.sel.ranges[Ie].goalColumn=we[Ie]}),findWordAt:function(te){var ie=this.doc,le=We(ie,te.line).text,me=te.ch,we=te.ch;if(le){var _e=this.getHelper(te,"wordChars");(te.sticky=="before"||we==le.length)&&me?--me:++we;for(var Ie=le.charAt(me),ot=ye(Ie,_e)?function(wt){return ye(wt,_e)}:/\s/.test(Ie)?function(wt){return/\s/.test(wt)}:function(wt){return!/\s/.test(wt)&&!ye(wt)};me>0&&ot(le.charAt(me-1));)--me;for(;we<le.length&&ot(le.charAt(we));)++we}return new Fi(Mt(te.line,me),Mt(te.line,we))},toggleOverwrite:function(te){te!=null&&te==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Ht(this.display.cursorDiv,"CodeMirror-overwrite"):Xe(this.display.cursorDiv,"CodeMirror-overwrite"),Re(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==qe()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:ua(function(te,ie){el(this,te,ie)}),getScrollInfo:function(){var te=this.display.scroller;return{left:te.scrollLeft,top:te.scrollTop,height:te.scrollHeight-Ea(this)-this.display.barHeight,width:te.scrollWidth-Ea(this)-this.display.barWidth,clientHeight:bo(this),clientWidth:fa(this)}},scrollIntoView:ua(function(te,ie){te==null?(te={from:this.doc.sel.primary().head,to:null},ie==null&&(ie=this.options.cursorScrollMargin)):typeof te=="number"?te={from:Mt(te,0),to:null}:te.from==null&&(te={from:te,to:null}),te.to||(te.to=te.from),te.margin=ie||0,te.from.line!=null?Nd(this,te):Du(this,te.from,te.to,te.margin)}),setSize:ua(function(te,ie){var le=this,me=function(_e){return typeof _e=="number"||/^\d+$/.test(String(_e))?_e+"px":_e};te!=null&&(this.display.wrapper.style.width=me(te)),ie!=null&&(this.display.wrapper.style.height=me(ie)),this.options.lineWrapping&&La(this);var we=this.display.viewFrom;this.doc.iter(we,this.display.viewTo,function(_e){if(_e.widgets){for(var Ie=0;Ie<_e.widgets.length;Ie++)if(_e.widgets[Ie].noHScroll){Ao(le,we,"widget");break}}++we}),this.curOp.forceUpdate=!0,Re(this,"refresh",this)}),operation:function(te){return pa(this,te)},startOperation:function(){return Ls(this)},endOperation:function(){return cs(this)},refresh:ua(function(){var te=this.display.cachedTextHeight;za(this),this.curOp.forceUpdate=!0,Xi(this),el(this,this.doc.scrollLeft,this.doc.scrollTop),Pc(this.display),(te==null||Math.abs(te-as(this.display))>.5||this.options.lineWrapping)&&Aa(this),Re(this,"refresh",this)}),swapDoc:ua(function(te){var ie=this.doc;return ie.cm=null,this.state.selectingText&&this.state.selectingText(),ql(this,te),Xi(this),this.display.input.reset(),el(this,te.scrollLeft,te.scrollTop),this.curOp.forceScroll=!0,$r(this,"swapDoc",this,ie),ie}),phrase:function(te){var ie=this.options.phrases;return ie&&Object.prototype.hasOwnProperty.call(ie,te)?ie[te]:te},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}},an(x),x.registerHelper=function(te,ie,le){ne.hasOwnProperty(te)||(ne[te]=x[te]={_global:[]}),ne[te][ie]=le},x.registerGlobalHelper=function(te,ie,le,me){x.registerHelper(te,ie,me),ne[te]._global.push({pred:le,val:me})}}function ru(x,z,ne,te,ie){var le=z,me=ne,we=We(x,z.line),_e=ie&&x.direction=="rtl"?-ne:ne;function Ie(){var Or=z.line+_e;return Or<x.first||Or>=x.first+x.size?!1:(z=new Mt(Or,z.ch,z.sticky),we=We(x,Or))}function ot(Or){var Cr;if(te=="codepoint"){var Fr=we.text.charCodeAt(z.ch+(te>0?0:-1));isNaN(Fr)?Cr=null:Cr=new Mt(z.line,Math.max(0,Math.min(we.text.length,z.ch+ne*(Fr>=55296&&Fr<56320?2:1))),-ne)}else ie?Cr=Go(x.cm,we,z,ne):Cr=Uo(we,z,ne);if(Cr==null)if(!Or&&Ie())z=dl(ie,x.cm,we,z.line,_e);else return!1;else z=Cr;return!0}if(te=="char"||te=="codepoint")ot();else if(te=="column")ot(!0);else if(te=="word"||te=="group")for(var wt=null,on=te=="group",qt=x.cm&&x.cm.getHelper(z,"wordChars"),An=!0;!(ne<0&&!ot(!An));An=!1){var Kn=we.text.charAt(z.ch)||`
`,pr=ye(Kn,qt)?"w":on&&Kn==`
`?"n":!on||/\s/.test(Kn)?null:"p";if(on&&!An&&!pr&&(pr="s"),wt&&wt!=pr){ne<0&&(ne=1,ot(),z.sticky="after");break}if(pr&&(wt=pr),ne>0&&!ot(!An))break}var Lr=Uc(x,z,le,me,!0);return Je(le,Lr)&&(Lr.hitSide=!0),Lr}function gh(x,z,ne,te){var ie=x.doc,le=z.left,me;if(te=="page"){var we=Math.min(x.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),_e=Math.max(we-.5*as(x.display),3);me=(ne>0?z.bottom:z.top)+ne*_e}else te=="line"&&(me=ne>0?z.bottom+3:z.top-3);for(var Ie;Ie=qs(x,le,me),!!Ie.outside;){if(ne<0?me<=0:me>=ie.height){Ie.hitSide=!0;break}me+=ne*5}return Ie}var Vi=function(x){this.cm=x,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new xe,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Vi.prototype.init=function(x){var z=this,ne=this,te=ne.cm,ie=ne.div=x.lineDiv;mh(ie,te.options.spellcheck,te.options.autocorrect,te.options.autocapitalize);function le(we){for(var _e=we.target;_e;_e=_e.parentNode){if(_e==ie)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(_e.className))break}return!1}gn(ie,"paste",function(we){!le(we)||Ze(te,we)||ad(we,te)||Pe<=11&&setTimeout(Sa(te,function(){return z.updateFromDOM()}),20)}),gn(ie,"compositionstart",function(we){z.composing={data:we.data,done:!1}}),gn(ie,"compositionupdate",function(we){z.composing||(z.composing={data:we.data,done:!1})}),gn(ie,"compositionend",function(we){z.composing&&(we.data!=z.composing.data&&z.readFromDOMSoon(),z.composing.done=!0)}),gn(ie,"touchstart",function(){return ne.forceCompositionEnd()}),gn(ie,"input",function(){z.composing||z.readFromDOMSoon()});function me(we){if(!(!le(we)||Ze(te,we))){if(te.somethingSelected())Ns({lineWise:!1,text:te.getSelections()}),we.type=="cut"&&te.replaceSelection("",null,"cut");else if(te.options.lineWiseCopyCut){var _e=Pl(te);Ns({lineWise:!0,text:_e.text}),we.type=="cut"&&te.operation(function(){te.setSelections(_e.ranges,0,Ge),te.replaceSelection("",null,"cut")})}else return;if(we.clipboardData){we.clipboardData.clearData();var Ie=zo.text.join(`
`);if(we.clipboardData.setData("Text",Ie),we.clipboardData.getData("Text")==Ie){we.preventDefault();return}}var ot=sd(),wt=ot.firstChild;te.display.lineSpace.insertBefore(ot,te.display.lineSpace.firstChild),wt.value=zo.text.join(`
`);var on=document.activeElement;Kt(wt),setTimeout(function(){te.display.lineSpace.removeChild(ot),on.focus(),on==ie&&ne.showPrimarySelection()},50)}}gn(ie,"copy",me),gn(ie,"cut",me)},Vi.prototype.screenReaderLabelChanged=function(x){x?this.div.setAttribute("aria-label",x):this.div.removeAttribute("aria-label")},Vi.prototype.prepareSelection=function(){var x=_u(this.cm,!1);return x.focus=document.activeElement==this.div,x},Vi.prototype.showSelection=function(x,z){!x||!this.cm.display.view.length||((x.focus||z)&&this.showPrimarySelection(),this.showMultipleSelections(x))},Vi.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Vi.prototype.showPrimarySelection=function(){var x=this.getSelection(),z=this.cm,ne=z.doc.sel.primary(),te=ne.from(),ie=ne.to();if(z.display.viewTo==z.display.viewFrom||te.line>=z.display.viewTo||ie.line<z.display.viewFrom){x.removeAllRanges();return}var le=iu(z,x.anchorNode,x.anchorOffset),me=iu(z,x.focusNode,x.focusOffset);if(!(le&&!le.bad&&me&&!me.bad&&rn(Et(le,me),te)==0&&rn(Ct(le,me),ie)==0)){var we=z.display.view,_e=te.line>=z.display.viewFrom&&vh(z,te)||{node:we[0].measure.map[2],offset:0},Ie=ie.line<z.display.viewTo&&vh(z,ie);if(!Ie){var ot=we[we.length-1].measure,wt=ot.maps?ot.maps[ot.maps.length-1]:ot.map;Ie={node:wt[wt.length-1],offset:wt[wt.length-2]-wt[wt.length-3]}}if(!_e||!Ie){x.removeAllRanges();return}var on=x.rangeCount&&x.getRangeAt(0),qt;try{qt=rt(_e.node,_e.offset,Ie.offset,Ie.node)}catch(An){}qt&&(!pe&&z.state.focused?(x.collapse(_e.node,_e.offset),qt.collapsed||(x.removeAllRanges(),x.addRange(qt))):(x.removeAllRanges(),x.addRange(qt)),on&&x.anchorNode==null?x.addRange(on):pe&&this.startGracePeriod()),this.rememberSelection()}},Vi.prototype.startGracePeriod=function(){var x=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){x.gracePeriod=!1,x.selectionChanged()&&x.cm.operation(function(){return x.cm.curOp.selectionChanged=!0})},20)},Vi.prototype.showMultipleSelections=function(x){vt(this.cm.display.cursorDiv,x.cursors),vt(this.cm.display.selectionDiv,x.selection)},Vi.prototype.rememberSelection=function(){var x=this.getSelection();this.lastAnchorNode=x.anchorNode,this.lastAnchorOffset=x.anchorOffset,this.lastFocusNode=x.focusNode,this.lastFocusOffset=x.focusOffset},Vi.prototype.selectionInEditor=function(){var x=this.getSelection();if(!x.rangeCount)return!1;var z=x.getRangeAt(0).commonAncestorContainer;return At(this.div,z)},Vi.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Vi.prototype.blur=function(){this.div.blur()},Vi.prototype.getField=function(){return this.div},Vi.prototype.supportsTouch=function(){return!0},Vi.prototype.receivedFocus=function(){var x=this;this.selectionInEditor()?this.pollSelection():pa(this.cm,function(){return x.cm.curOp.selectionChanged=!0});function z(){x.cm.state.focused&&(x.pollSelection(),x.polling.set(x.cm.options.pollInterval,z))}this.polling.set(this.cm.options.pollInterval,z)},Vi.prototype.selectionChanged=function(){var x=this.getSelection();return x.anchorNode!=this.lastAnchorNode||x.anchorOffset!=this.lastAnchorOffset||x.focusNode!=this.lastFocusNode||x.focusOffset!=this.lastFocusOffset},Vi.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var x=this.getSelection(),z=this.cm;if(et&&ke&&this.cm.display.gutterSpecs.length&&cf(x.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var ne=iu(z,x.anchorNode,x.anchorOffset),te=iu(z,x.focusNode,x.focusOffset);ne&&te&&pa(z,function(){Ca(z.doc,No(ne,te),Ge),(ne.bad||te.bad)&&(z.curOp.selectionChanged=!0)})}}},Vi.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var x=this.cm,z=x.display,ne=x.doc.sel.primary(),te=ne.from(),ie=ne.to();if(te.ch==0&&te.line>x.firstLine()&&(te=Mt(te.line-1,We(x.doc,te.line-1).length)),ie.ch==We(x.doc,ie.line).text.length&&ie.line<x.lastLine()&&(ie=Mt(ie.line+1,0)),te.line<z.viewFrom||ie.line>z.viewTo-1)return!1;var le,me,we;te.line==z.viewFrom||(le=po(x,te.line))==0?(me=$t(z.view[0].line),we=z.view[0].node):(me=$t(z.view[le].line),we=z.view[le-1].node.nextSibling);var _e=po(x,ie.line),Ie,ot;if(_e==z.view.length-1?(Ie=z.viewTo-1,ot=z.lineDiv.lastChild):(Ie=$t(z.view[_e+1].line)-1,ot=z.view[_e+1].node.previousSibling),!we)return!1;for(var wt=x.doc.splitLines(uf(x,we,ot,me,Ie)),on=it(x.doc,Mt(me,0),Mt(Ie,We(x.doc,Ie).text.length));wt.length>1&&on.length>1;)if(Vt(wt)==Vt(on))wt.pop(),on.pop(),Ie--;else if(wt[0]==on[0])wt.shift(),on.shift(),me++;else break;for(var qt=0,An=0,Kn=wt[0],pr=on[0],Lr=Math.min(Kn.length,pr.length);qt<Lr&&Kn.charCodeAt(qt)==pr.charCodeAt(qt);)++qt;for(var Or=Vt(wt),Cr=Vt(on),Fr=Math.min(Or.length-(wt.length==1?qt:0),Cr.length-(on.length==1?qt:0));An<Fr&&Or.charCodeAt(Or.length-An-1)==Cr.charCodeAt(Cr.length-An-1);)++An;if(wt.length==1&&on.length==1&&me==te.line)for(;qt&&qt>te.ch&&Or.charCodeAt(Or.length-An-1)==Cr.charCodeAt(Cr.length-An-1);)qt--,An++;wt[wt.length-1]=Or.slice(0,Or.length-An).replace(/^\u200b+/,""),wt[0]=wt[0].slice(qt).replace(/\u200b+$/,"");var Qr=Mt(me,qt),ti=Mt(Ie,on.length?Vt(on).length-An:0);if(wt.length>1||wt[0]||rn(Qr,ti))return Ml(x.doc,wt,Qr,ti,"+input"),!0},Vi.prototype.ensurePolled=function(){this.forceCompositionEnd()},Vi.prototype.reset=function(){this.forceCompositionEnd()},Vi.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Vi.prototype.readFromDOMSoon=function(){var x=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(x.readDOMTimeout=null,x.composing)if(x.composing.done)x.composing=null;else return;x.updateFromDOM()},80))},Vi.prototype.updateFromDOM=function(){var x=this;(this.cm.isReadOnly()||!this.pollContent())&&pa(this.cm,function(){return za(x.cm)})},Vi.prototype.setUneditable=function(x){x.contentEditable="false"},Vi.prototype.onKeyPress=function(x){x.charCode==0||this.composing||(x.preventDefault(),this.cm.isReadOnly()||Sa(this.cm,id)(this.cm,String.fromCharCode(x.charCode==null?x.keyCode:x.charCode),0))},Vi.prototype.readOnlyChanged=function(x){this.div.contentEditable=String(x!="nocursor")},Vi.prototype.onContextMenu=function(){},Vi.prototype.resetPosition=function(){},Vi.prototype.needsContentAttribute=!0;function vh(x,z){var ne=Xa(x,z.line);if(!ne||ne.hidden)return null;var te=We(x.doc,z.line),ie=Eo(ne,te,z.line),le=En(te,x.doc.direction),me="left";if(le){var we=wn(le,z.ch);me=we%2?"right":"left"}var _e=rs(ie.map,z.ch,me);return _e.offset=_e.collapse=="right"?_e.end:_e.start,_e}function cf(x){for(var z=x;z;z=z.parentNode)if(/CodeMirror-gutter-wrapper/.test(z.className))return!0;return!1}function Il(x,z){return z&&(x.bad=!0),x}function uf(x,z,ne,te,ie){var le="",me=!1,we=x.doc.lineSeparator(),_e=!1;function Ie(qt){return function(An){return An.id==qt}}function ot(){me&&(le+=we,_e&&(le+=we),me=_e=!1)}function wt(qt){qt&&(ot(),le+=qt)}function on(qt){if(qt.nodeType==1){var An=qt.getAttribute("cm-text");if(An){wt(An);return}var Kn=qt.getAttribute("cm-marker"),pr;if(Kn){var Lr=x.findMarks(Mt(te,0),Mt(ie+1,0),Ie(+Kn));Lr.length&&(pr=Lr[0].find(0))&&wt(it(x.doc,pr.from,pr.to).join(we));return}if(qt.getAttribute("contenteditable")=="false")return;var Or=/^(pre|div|p|li|table|br)$/i.test(qt.nodeName);if(!/^br$/i.test(qt.nodeName)&&qt.textContent.length==0)return;Or&&ot();for(var Cr=0;Cr<qt.childNodes.length;Cr++)on(qt.childNodes[Cr]);/^(pre|p)$/i.test(qt.nodeName)&&(_e=!0),Or&&(me=!0)}else qt.nodeType==3&&wt(qt.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;on(z),z!=ne;)z=z.nextSibling,_e=!1;return le}function iu(x,z,ne){var te;if(z==x.display.lineDiv){if(te=x.display.lineDiv.childNodes[ne],!te)return Il(x.clipPos(Mt(x.display.viewTo-1)),!0);z=null,ne=0}else for(te=z;;te=te.parentNode){if(!te||te==x.display.lineDiv)return null;if(te.parentNode&&te.parentNode==x.display.lineDiv)break}for(var ie=0;ie<x.display.view.length;ie++){var le=x.display.view[ie];if(le.node==te)return df(le,z,ne)}}function df(x,z,ne){var te=x.text.firstChild,ie=!1;if(!z||!At(te,z))return Il(Mt($t(x.line),0),!0);if(z==te&&(ie=!0,z=te.childNodes[ne],ne=0,!z)){var le=x.rest?Vt(x.rest):x.line;return Il(Mt($t(le),le.text.length),ie)}var me=z.nodeType==3?z:null,we=z;for(!me&&z.childNodes.length==1&&z.firstChild.nodeType==3&&(me=z.firstChild,ne&&(ne=me.nodeValue.length));we.parentNode!=te;)we=we.parentNode;var _e=x.measure,Ie=_e.maps;function ot(pr,Lr,Or){for(var Cr=-1;Cr<(Ie?Ie.length:0);Cr++)for(var Fr=Cr<0?_e.map:Ie[Cr],Qr=0;Qr<Fr.length;Qr+=3){var ti=Fr[Qr+2];if(ti==pr||ti==Lr){var Ci=$t(Cr<0?x.line:x.rest[Cr]),Ji=Fr[Qr]+Or;return(Or<0||ti!=pr)&&(Ji=Fr[Qr+(Or?1:0)]),Mt(Ci,Ji)}}}var wt=ot(me,we,ne);if(wt)return Il(wt,ie);for(var on=we.nextSibling,qt=me?me.nodeValue.length-ne:0;on;on=on.nextSibling){if(wt=ot(on,on.firstChild,0),wt)return Il(Mt(wt.line,wt.ch-qt),ie);qt+=on.textContent.length}for(var An=we.previousSibling,Kn=ne;An;An=An.previousSibling){if(wt=ot(An,An.firstChild,-1),wt)return Il(Mt(wt.line,wt.ch+Kn),ie);Kn+=An.textContent.length}}var qi=function(x){this.cm=x,this.prevInput="",this.pollingFast=!1,this.polling=new xe,this.hasSelection=!1,this.composing=null};qi.prototype.init=function(x){var z=this,ne=this,te=this.cm;this.createField(x);var ie=this.textarea;x.wrapper.insertBefore(this.wrapper,x.wrapper.firstChild),kt&&(ie.style.width="0px"),gn(ie,"input",function(){Se&&Pe>=9&&z.hasSelection&&(z.hasSelection=null),ne.poll()}),gn(ie,"paste",function(me){Ze(te,me)||ad(me,te)||(te.state.pasteIncoming=+new Date,ne.fastPoll())});function le(me){if(!Ze(te,me)){if(te.somethingSelected())Ns({lineWise:!1,text:te.getSelections()});else if(te.options.lineWiseCopyCut){var we=Pl(te);Ns({lineWise:!0,text:we.text}),me.type=="cut"?te.setSelections(we.ranges,null,Ge):(ne.prevInput="",ie.value=we.text.join(`
`),Kt(ie))}else return;me.type=="cut"&&(te.state.cutIncoming=+new Date)}}gn(ie,"cut",le),gn(ie,"copy",le),gn(x.scroller,"paste",function(me){if(!(oo(x,me)||Ze(te,me))){if(!ie.dispatchEvent){te.state.pasteIncoming=+new Date,ne.focus();return}var we=new Event("paste");we.clipboardData=me.clipboardData,ie.dispatchEvent(we)}}),gn(x.lineSpace,"selectstart",function(me){oo(x,me)||Pn(me)}),gn(ie,"compositionstart",function(){var me=te.getCursor("from");ne.composing&&ne.composing.range.clear(),ne.composing={start:me,range:te.markText(me,te.getCursor("to"),{className:"CodeMirror-composing"})}}),gn(ie,"compositionend",function(){ne.composing&&(ne.poll(),ne.composing.range.clear(),ne.composing=null)})},qi.prototype.createField=function(x){this.wrapper=sd(),this.textarea=this.wrapper.firstChild},qi.prototype.screenReaderLabelChanged=function(x){x?this.textarea.setAttribute("aria-label",x):this.textarea.removeAttribute("aria-label")},qi.prototype.prepareSelection=function(){var x=this.cm,z=x.display,ne=x.doc,te=_u(x);if(x.options.moveInputWithCursor){var ie=Da(x,ne.sel.primary().head,"div"),le=z.wrapper.getBoundingClientRect(),me=z.lineDiv.getBoundingClientRect();te.teTop=Math.max(0,Math.min(z.wrapper.clientHeight-10,ie.top+me.top-le.top)),te.teLeft=Math.max(0,Math.min(z.wrapper.clientWidth-10,ie.left+me.left-le.left))}return te},qi.prototype.showSelection=function(x){var z=this.cm,ne=z.display;vt(ne.cursorDiv,x.cursors),vt(ne.selectionDiv,x.selection),x.teTop!=null&&(this.wrapper.style.top=x.teTop+"px",this.wrapper.style.left=x.teLeft+"px")},qi.prototype.reset=function(x){if(!(this.contextMenuPending||this.composing)){var z=this.cm;if(z.somethingSelected()){this.prevInput="";var ne=z.getSelection();this.textarea.value=ne,z.state.focused&&Kt(this.textarea),Se&&Pe>=9&&(this.hasSelection=ne)}else x||(this.prevInput=this.textarea.value="",Se&&Pe>=9&&(this.hasSelection=null))}},qi.prototype.getField=function(){return this.textarea},qi.prototype.supportsTouch=function(){return!1},qi.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!mt||qe()!=this.textarea))try{this.textarea.focus()}catch(x){}},qi.prototype.blur=function(){this.textarea.blur()},qi.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},qi.prototype.receivedFocus=function(){this.slowPoll()},qi.prototype.slowPoll=function(){var x=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){x.poll(),x.cm.state.focused&&x.slowPoll()})},qi.prototype.fastPoll=function(){var x=!1,z=this;z.pollingFast=!0;function ne(){var te=z.poll();!te&&!x?(x=!0,z.polling.set(60,ne)):(z.pollingFast=!1,z.slowPoll())}z.polling.set(20,ne)},qi.prototype.poll=function(){var x=this,z=this.cm,ne=this.textarea,te=this.prevInput;if(this.contextMenuPending||!z.state.focused||yr(ne)&&!te&&!this.composing||z.isReadOnly()||z.options.disableInput||z.state.keySeq)return!1;var ie=ne.value;if(ie==te&&!z.somethingSelected())return!1;if(Se&&Pe>=9&&this.hasSelection===ie||st&&/[\uf700-\uf7ff]/.test(ie))return z.display.input.reset(),!1;if(z.doc.sel==z.display.selForContextMenu){var le=ie.charCodeAt(0);if(le==8203&&!te&&(te="\u200B"),le==8666)return this.reset(),this.cm.execCommand("undo")}for(var me=0,we=Math.min(te.length,ie.length);me<we&&te.charCodeAt(me)==ie.charCodeAt(me);)++me;return pa(z,function(){id(z,ie.slice(me),te.length-me,null,x.composing?"*compose":null),ie.length>1e3||ie.indexOf(`
`)>-1?ne.value=x.prevInput="":x.prevInput=ie,x.composing&&(x.composing.range.clear(),x.composing.range=z.markText(x.composing.start,z.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},qi.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},qi.prototype.onKeyPress=function(){Se&&Pe>=9&&(this.hasSelection=null),this.fastPoll()},qi.prototype.onContextMenu=function(x){var z=this,ne=z.cm,te=ne.display,ie=z.textarea;z.contextMenuPending&&z.contextMenuPending();var le=xo(ne,x),me=te.scroller.scrollTop;if(!le||Fe)return;var we=ne.options.resetSelectionOnContextMenu;we&&ne.doc.sel.contains(le)==-1&&Sa(ne,Ca)(ne.doc,No(le),Ge);var _e=ie.style.cssText,Ie=z.wrapper.style.cssText,ot=z.wrapper.offsetParent.getBoundingClientRect();z.wrapper.style.cssText="position: static",ie.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(x.clientY-ot.top-5)+"px; left: "+(x.clientX-ot.left-5)+`px;
z-index: 1000; background: `+(Se?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var wt;Ne&&(wt=window.scrollY),te.input.focus(),Ne&&window.scrollTo(null,wt),te.input.reset(),ne.somethingSelected()||(ie.value=z.prevInput=" "),z.contextMenuPending=qt,te.selForContextMenu=ne.doc.sel,clearTimeout(te.detectingSelectAll);function on(){if(ie.selectionStart!=null){var Kn=ne.somethingSelected(),pr="\u200B"+(Kn?ie.value:"");ie.value="\u21DA",ie.value=pr,z.prevInput=Kn?"":"\u200B",ie.selectionStart=1,ie.selectionEnd=pr.length,te.selForContextMenu=ne.doc.sel}}function qt(){if(z.contextMenuPending==qt&&(z.contextMenuPending=!1,z.wrapper.style.cssText=Ie,ie.style.cssText=_e,Se&&Pe<9&&te.scrollbars.setScrollTop(te.scroller.scrollTop=me),ie.selectionStart!=null)){(!Se||Se&&Pe<9)&&on();var Kn=0,pr=function(){te.selForContextMenu==ne.doc.sel&&ie.selectionStart==0&&ie.selectionEnd>0&&z.prevInput=="\u200B"?Sa(ne,ju)(ne):Kn++<10?te.detectingSelectAll=setTimeout(pr,500):(te.selForContextMenu=null,te.input.reset())};te.detectingSelectAll=setTimeout(pr,200)}}if(Se&&Pe>=9&&on(),Ve){Zn(x);var An=function(){tt(window,"mouseup",An),setTimeout(qt,20)};gn(window,"mouseup",An)}else setTimeout(qt,50)},qi.prototype.readOnlyChanged=function(x){x||this.reset(),this.textarea.disabled=x=="nocursor",this.textarea.readOnly=!!x},qi.prototype.setUneditable=function(){},qi.prototype.needsContentAttribute=!1;function hl(x,z){if(z=z?Wt(z):{},z.value=x.value,!z.tabindex&&x.tabIndex&&(z.tabindex=x.tabIndex),!z.placeholder&&x.placeholder&&(z.placeholder=x.placeholder),z.autofocus==null){var ne=qe();z.autofocus=ne==x||x.getAttribute("autofocus")!=null&&ne==document.body}function te(){x.value=we.getValue()}var ie;if(x.form&&(gn(x.form,"submit",te),!z.leaveSubmitMethodAlone)){var le=x.form;ie=le.submit;try{var me=le.submit=function(){te(),le.submit=ie,le.submit(),le.submit=me}}catch(_e){}}z.finishInit=function(_e){_e.save=te,_e.getTextArea=function(){return x},_e.toTextArea=function(){_e.toTextArea=isNaN,te(),x.parentNode.removeChild(_e.getWrapperElement()),x.style.display="",x.form&&(tt(x.form,"submit",te),!z.leaveSubmitMethodAlone&&typeof x.form.submit=="function"&&(x.form.submit=ie))}},x.style.display="none";var we=si(function(_e){return x.parentNode.insertBefore(_e,x.nextSibling)},z);return we}function Bl(x){x.off=tt,x.on=gn,x.wheelEventPixels=$u,x.Doc=ya,x.splitLines=Dr,x.countColumn=ze,x.findColumn=Mn,x.isWordChar=fe,x.Pass=Ut,x.signal=Re,x.Line=hr,x.changeEnd=us,x.scrollbarModel=Tu,x.Pos=Mt,x.cmpPos=rn,x.modes=qr,x.mimeModes=zr,x.resolveMode=Bn,x.getMode=In,x.modeExtensions=wr,x.extendMode=Qe,x.copyState=Me,x.startState=Le,x.innerMode=Ae,x.commands=Dl,x.keyMap=Yi,x.keyName=ul,x.isModifierKey=sc,x.lookupKey=ms,x.normalizeKeyMap=Yu,x.StringStream=De,x.SharedTextMarker=Si,x.TextMarker=Ts,x.LineWidget=kl,x.e_preventDefault=Pn,x.e_stopPropagation=On,x.e_stop=Zn,x.addClass=Ht,x.contains=At,x.rmClass=Xe,x.keyNames=$o}of(si),ld(si);var ys="iter insert remove copy getEditor constructor".split(" ");for(var Bo in ya.prototype)ya.prototype.hasOwnProperty(Bo)&&bt(ys,Bo)<0&&(si.prototype[Bo]=function(x){return function(){return x.apply(this.doc,arguments)}}(ya.prototype[Bo]));return an(ya),si.inputStyles={textarea:qi,contenteditable:Vi},si.defineMode=function(x){!si.defaults.mode&&x!="null"&&(si.defaults.mode=x),ar.apply(this,arguments)},si.defineMIME=or,si.defineMode("null",function(){return{token:function(x){return x.skipToEnd()}}}),si.defineMIME("text/plain","null"),si.defineExtension=function(x,z){si.prototype[x]=z},si.defineDocExtension=function(x,z){ya.prototype[x]=z},si.fromTextArea=hl,Bl(si),si.version="5.58.2",si})},25419:function(kn,dn,de){(function(pe){pe(de(89780),de(15525),de(98101))})(function(pe){"use strict";pe.defineMode("markdown",function(ut,$e){var ct=pe.getMode(ut,"text/html"),Se=ct.name=="null";function Pe(ze){if(pe.findModeByName){var xe=pe.findModeByName(ze);xe&&(ze=xe.mime||xe.mimes[0])}var bt=pe.getMode(ut,ze);return bt.name=="null"?null:bt}$e.highlightFormatting===void 0&&($e.highlightFormatting=!1),$e.maxBlockquoteDepth===void 0&&($e.maxBlockquoteDepth=0),$e.taskLists===void 0&&($e.taskLists=!1),$e.strikethrough===void 0&&($e.strikethrough=!1),$e.emoji===void 0&&($e.emoji=!1),$e.fencedCodeBlockHighlighting===void 0&&($e.fencedCodeBlockHighlighting=!0),$e.fencedCodeBlockDefaultMode===void 0&&($e.fencedCodeBlockDefaultMode="text/plain"),$e.xml===void 0&&($e.xml=!0),$e.tokenTypeOverrides===void 0&&($e.tokenTypeOverrides={});var Ne={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 Ce in Ne)Ne.hasOwnProperty(Ce)&&$e.tokenTypeOverrides[Ce]&&(Ne[Ce]=$e.tokenTypeOverrides[Ce]);var ke=/^([*\-_])(?:\s*\1){2,}\s*$/,Fe=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,gt=/^\[(x| )\](?=\s)/i,Oe=$e.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,je=/^ {0,3}(?:\={1,}|-{2,})\s*$/,kt=/^[^#!\[\]*_\\<>` "'(~:]+/,et=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,mt=/^\s*\[[^\]]+?\]:.*$/,st=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,Rt=" ";function tn(ze,xe,bt){return xe.f=xe.inline=bt,bt(ze,xe)}function nt(ze,xe,bt){return xe.f=xe.block=bt,bt(ze,xe)}function ht(ze){return!ze||!/\S/.test(ze.string)}function Ve(ze){if(ze.linkTitle=!1,ze.linkHref=!1,ze.linkText=!1,ze.em=!1,ze.strong=!1,ze.strikethrough=!1,ze.quote=0,ze.indentedCode=!1,ze.f==Xe){var xe=Se;if(!xe){var bt=pe.innerMode(ct,ze.htmlState);xe=bt.mode.name=="xml"&&bt.state.tagStart===null&&!bt.state.context&&bt.state.tokenize.isInText}xe&&(ze.f=Ot,ze.block=Ee,ze.htmlState=null)}return ze.trailingSpace=0,ze.trailingSpaceNewLine=!1,ze.prevLine=ze.thisLine,ze.thisLine={stream:null},null}function Ee(ze,xe){var bt=ze.column()===xe.indentation,pn=ht(xe.prevLine.stream),Ut=xe.indentedCode,Ge=xe.prevLine.hr,Ye=xe.list!==!1,It=(xe.listStack[xe.listStack.length-1]||0)+3;xe.indentedCode=!1;var Mn=xe.indentation;if(xe.indentationDiff===null&&(xe.indentationDiff=xe.indentation,Ye)){for(xe.list=null;Mn<xe.listStack[xe.listStack.length-1];)xe.listStack.pop(),xe.listStack.length?xe.indentation=xe.listStack[xe.listStack.length-1]:xe.list=!1;xe.list!==!1&&(xe.indentationDiff=Mn-xe.listStack[xe.listStack.length-1])}var jt=!pn&&!Ge&&!xe.prevLine.header&&(!Ye||!Ut)&&!xe.prevLine.fencedCodeEnd,bn=(xe.list===!1||Ge||pn)&&xe.indentation<=It&&ze.match(ke),Vt=null;if(xe.indentationDiff>=4&&(Ut||xe.prevLine.fencedCodeEnd||xe.prevLine.header||pn))return ze.skipToEnd(),xe.indentedCode=!0,Ne.code;if(ze.eatSpace())return null;if(bt&&xe.indentation<=It&&(Vt=ze.match(Oe))&&Vt[1].length<=6)return xe.quote=0,xe.header=Vt[1].length,xe.thisLine.header=!0,$e.highlightFormatting&&(xe.formatting="header"),xe.f=xe.inline,vt(xe);if(xe.indentation<=It&&ze.eat(">"))return xe.quote=bt?1:xe.quote+1,$e.highlightFormatting&&(xe.formatting="quote"),ze.eatSpace(),vt(xe);if(!bn&&!xe.setext&&bt&&xe.indentation<=It&&(Vt=ze.match(Fe))){var Zt=Vt[1]?"ol":"ul";return xe.indentation=Mn+ze.current().length,xe.list=!0,xe.quote=0,xe.listStack.push(xe.indentation),xe.em=!1,xe.strong=!1,xe.code=!1,xe.strikethrough=!1,$e.taskLists&&ze.match(gt,!1)&&(xe.taskList=!0),xe.f=xe.inline,$e.highlightFormatting&&(xe.formatting=["list","list-"+Zt]),vt(xe)}else{if(bt&&xe.indentation<=It&&(Vt=ze.match(et,!0)))return xe.quote=0,xe.fencedEndRE=new RegExp(Vt[1]+"+ *$"),xe.localMode=$e.fencedCodeBlockHighlighting&&Pe(Vt[2]||$e.fencedCodeBlockDefaultMode),xe.localMode&&(xe.localState=pe.startState(xe.localMode)),xe.f=xe.block=at,$e.highlightFormatting&&(xe.formatting="code-block"),xe.code=-1,vt(xe);if(xe.setext||(!jt||!Ye)&&!xe.quote&&xe.list===!1&&!xe.code&&!bn&&!mt.test(ze.string)&&(Vt=ze.lookAhead(1))&&(Vt=Vt.match(je)))return xe.setext?(xe.header=xe.setext,xe.setext=0,ze.skipToEnd(),$e.highlightFormatting&&(xe.formatting="header")):(xe.header=Vt[0].charAt(0)=="="?1:2,xe.setext=xe.header),xe.thisLine.header=!0,xe.f=xe.inline,vt(xe);if(bn)return ze.skipToEnd(),xe.hr=!0,xe.thisLine.hr=!0,Ne.hr;if(ze.peek()==="[")return tn(ze,xe,cn)}return tn(ze,xe,xe.inline)}function Xe(ze,xe){var bt=ct.token(ze,xe.htmlState);if(!Se){var pn=pe.innerMode(ct,xe.htmlState);(pn.mode.name=="xml"&&pn.state.tagStart===null&&!pn.state.context&&pn.state.tokenize.isInText||xe.md_inside&&ze.current().indexOf(">")>-1)&&(xe.f=Ot,xe.block=Ee,xe.htmlState=null)}return bt}function at(ze,xe){var bt=xe.listStack[xe.listStack.length-1]||0,pn=xe.indentation<bt,Ut=bt+3;if(xe.fencedEndRE&&xe.indentation<=Ut&&(pn||ze.match(xe.fencedEndRE))){$e.highlightFormatting&&(xe.formatting="code-block");var Ge;return pn||(Ge=vt(xe)),xe.localMode=xe.localState=null,xe.block=Ee,xe.f=Ot,xe.fencedEndRE=null,xe.code=0,xe.thisLine.fencedCodeEnd=!0,pn?nt(ze,xe,xe.block):Ge}else return xe.localMode?xe.localMode.token(ze,xe.localState):(ze.skipToEnd(),Ne.code)}function vt(ze){var xe=[];if(ze.formatting){xe.push(Ne.formatting),typeof ze.formatting=="string"&&(ze.formatting=[ze.formatting]);for(var bt=0;bt<ze.formatting.length;bt++)xe.push(Ne.formatting+"-"+ze.formatting[bt]),ze.formatting[bt]==="header"&&xe.push(Ne.formatting+"-"+ze.formatting[bt]+"-"+ze.header),ze.formatting[bt]==="quote"&&(!$e.maxBlockquoteDepth||$e.maxBlockquoteDepth>=ze.quote?xe.push(Ne.formatting+"-"+ze.formatting[bt]+"-"+ze.quote):xe.push("error"))}if(ze.taskOpen)return xe.push("meta"),xe.length?xe.join(" "):null;if(ze.taskClosed)return xe.push("property"),xe.length?xe.join(" "):null;if(ze.linkHref?xe.push(Ne.linkHref,"url"):(ze.strong&&xe.push(Ne.strong),ze.em&&xe.push(Ne.em),ze.strikethrough&&xe.push(Ne.strikethrough),ze.emoji&&xe.push(Ne.emoji),ze.linkText&&xe.push(Ne.linkText),ze.code&&xe.push(Ne.code),ze.image&&xe.push(Ne.image),ze.imageAltText&&xe.push(Ne.imageAltText,"link"),ze.imageMarker&&xe.push(Ne.imageMarker)),ze.header&&xe.push(Ne.header,Ne.header+"-"+ze.header),ze.quote&&(xe.push(Ne.quote),!$e.maxBlockquoteDepth||$e.maxBlockquoteDepth>=ze.quote?xe.push(Ne.quote+"-"+ze.quote):xe.push(Ne.quote+"-"+$e.maxBlockquoteDepth)),ze.list!==!1){var pn=(ze.listStack.length-1)%3;pn?pn===1?xe.push(Ne.list2):xe.push(Ne.list3):xe.push(Ne.list1)}return ze.trailingSpaceNewLine?xe.push("trailing-space-new-line"):ze.trailingSpace&&xe.push("trailing-space-"+(ze.trailingSpace%2?"a":"b")),xe.length?xe.join(" "):null}function Ue(ze,xe){if(ze.match(kt,!0))return vt(xe)}function Ot(ze,xe){var bt=xe.text(ze,xe);if(typeof bt!="undefined")return bt;if(xe.list)return xe.list=null,vt(xe);if(xe.taskList){var pn=ze.match(gt,!0)[1]===" ";return pn?xe.taskOpen=!0:xe.taskClosed=!0,$e.highlightFormatting&&(xe.formatting="task"),xe.taskList=!1,vt(xe)}if(xe.taskOpen=!1,xe.taskClosed=!1,xe.header&&ze.match(/^#+$/,!0))return $e.highlightFormatting&&(xe.formatting="header"),vt(xe);var Ut=ze.next();if(xe.linkTitle){xe.linkTitle=!1;var Ge=Ut;Ut==="("&&(Ge=")"),Ge=(Ge+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ye="^\\s*(?:[^"+Ge+"\\\\]+|\\\\\\\\|\\\\.)"+Ge;if(ze.match(new RegExp(Ye),!0))return Ne.linkHref}if(Ut==="`"){var It=xe.formatting;$e.highlightFormatting&&(xe.formatting="code"),ze.eatWhile("`");var Mn=ze.current().length;if(xe.code==0&&(!xe.quote||Mn==1))return xe.code=Mn,vt(xe);if(Mn==xe.code){var jt=vt(xe);return xe.code=0,jt}else return xe.formatting=It,vt(xe)}else if(xe.code)return vt(xe);if(Ut==="\\"&&(ze.next(),$e.highlightFormatting)){var bn=vt(xe),Vt=Ne.formatting+"-escape";return bn?bn+" "+Vt:Vt}if(Ut==="!"&&ze.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return xe.imageMarker=!0,xe.image=!0,$e.highlightFormatting&&(xe.formatting="image"),vt(xe);if(Ut==="["&&xe.imageMarker&&ze.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return xe.imageMarker=!1,xe.imageAltText=!0,$e.highlightFormatting&&(xe.formatting="image"),vt(xe);if(Ut==="]"&&xe.imageAltText){$e.highlightFormatting&&(xe.formatting="image");var bn=vt(xe);return xe.imageAltText=!1,xe.image=!1,xe.inline=xe.f=At,bn}if(Ut==="["&&!xe.image)return xe.linkText&&ze.match(/^.*?\]/)||(xe.linkText=!0,$e.highlightFormatting&&(xe.formatting="link")),vt(xe);if(Ut==="]"&&xe.linkText){$e.highlightFormatting&&(xe.formatting="link");var bn=vt(xe);return xe.linkText=!1,xe.inline=xe.f=ze.match(/\(.*?\)| ?\[.*?\]/,!1)?At:Ot,bn}if(Ut==="<"&&ze.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){xe.f=xe.inline=rt,$e.highlightFormatting&&(xe.formatting="link");var bn=vt(xe);return bn?bn+=" ":bn="",bn+Ne.linkInline}if(Ut==="<"&&ze.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){xe.f=xe.inline=rt,$e.highlightFormatting&&(xe.formatting="link");var bn=vt(xe);return bn?bn+=" ":bn="",bn+Ne.linkEmail}if($e.xml&&Ut==="<"&&ze.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Zt=ze.string.indexOf(">",ze.pos);if(Zt!=-1){var zt=ze.string.substring(ze.start,Zt);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(zt)&&(xe.md_inside=!0)}return ze.backUp(1),xe.htmlState=pe.startState(ct),nt(ze,xe,Xe)}if($e.xml&&Ut==="<"&&ze.match(/^\/\w*?>/))return xe.md_inside=!1,"tag";if(Ut==="*"||Ut==="_"){for(var ve=1,se=ze.pos==1?" ":ze.string.charAt(ze.pos-2);ve<3&&ze.eat(Ut);)ve++;var oe=ze.peek()||" ",fe=!/\s/.test(oe)&&(!st.test(oe)||/\s/.test(se)||st.test(se)),ye=!/\s/.test(se)&&(!st.test(se)||/\s/.test(oe)||st.test(oe)),ce=null,Ke=null;if(ve%2&&(!xe.em&&fe&&(Ut==="*"||!ye||st.test(se))?ce=!0:xe.em==Ut&&ye&&(Ut==="*"||!fe||st.test(oe))&&(ce=!1)),ve>1&&(!xe.strong&&fe&&(Ut==="*"||!ye||st.test(se))?Ke=!0:xe.strong==Ut&&ye&&(Ut==="*"||!fe||st.test(oe))&&(Ke=!1)),Ke!=null||ce!=null){$e.highlightFormatting&&(xe.formatting=ce==null?"strong":Ke==null?"em":"strong em"),ce===!0&&(xe.em=Ut),Ke===!0&&(xe.strong=Ut);var jt=vt(xe);return ce===!1&&(xe.em=!1),Ke===!1&&(xe.strong=!1),jt}}else if(Ut===" "&&(ze.eat("*")||ze.eat("_"))){if(ze.peek()===" ")return vt(xe);ze.backUp(1)}if($e.strikethrough){if(Ut==="~"&&ze.eatWhile(Ut)){if(xe.strikethrough){$e.highlightFormatting&&(xe.formatting="strikethrough");var jt=vt(xe);return xe.strikethrough=!1,jt}else if(ze.match(/^[^\s]/,!1))return xe.strikethrough=!0,$e.highlightFormatting&&(xe.formatting="strikethrough"),vt(xe)}else if(Ut===" "&&ze.match(/^~~/,!0)){if(ze.peek()===" ")return vt(xe);ze.backUp(2)}}if($e.emoji&&Ut===":"&&ze.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){xe.emoji=!0,$e.highlightFormatting&&(xe.formatting="emoji");var Dt=vt(xe);return xe.emoji=!1,Dt}return Ut===" "&&(ze.match(/^ +$/,!1)?xe.trailingSpace++:xe.trailingSpace&&(xe.trailingSpaceNewLine=!0)),vt(xe)}function rt(ze,xe){var bt=ze.next();if(bt===">"){xe.f=xe.inline=Ot,$e.highlightFormatting&&(xe.formatting="link");var pn=vt(xe);return pn?pn+=" ":pn="",pn+Ne.linkInline}return ze.match(/^[^>]+/,!0),Ne.linkInline}function At(ze,xe){if(ze.eatSpace())return null;var bt=ze.next();return bt==="("||bt==="["?(xe.f=xe.inline=Ht(bt==="("?")":"]"),$e.highlightFormatting&&(xe.formatting="link-string"),xe.linkHref=!0,vt(xe)):"error"}var qe={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function Ht(ze){return function(xe,bt){var pn=xe.next();if(pn===ze){bt.f=bt.inline=Ot,$e.highlightFormatting&&(bt.formatting="link-string");var Ut=vt(bt);return bt.linkHref=!1,Ut}return xe.match(qe[ze]),bt.linkHref=!0,vt(bt)}}function cn(ze,xe){return ze.match(/^([^\]\\]|\\.)*\]:/,!1)?(xe.f=Kt,ze.next(),$e.highlightFormatting&&(xe.formatting="link"),xe.linkText=!0,vt(xe)):tn(ze,xe,Ot)}function Kt(ze,xe){if(ze.match(/^\]:/,!0)){xe.f=xe.inline=Xt,$e.highlightFormatting&&(xe.formatting="link");var bt=vt(xe);return xe.linkText=!1,bt}return ze.match(/^([^\]\\]|\\.)+/,!0),Ne.linkText}function Xt(ze,xe){return ze.eatSpace()?null:(ze.match(/^[^\s]+/,!0),ze.peek()===void 0?xe.linkTitle=!0:ze.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),xe.f=xe.inline=Ot,Ne.linkHref+" url")}var Wt={startState:function(){return{f:Ee,prevLine:{stream:null},thisLine:{stream:null},block:Ee,htmlState:null,indentation:0,inline:Ot,text:Ue,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(ze){return{f:ze.f,prevLine:ze.prevLine,thisLine:ze.thisLine,block:ze.block,htmlState:ze.htmlState&&pe.copyState(ct,ze.htmlState),indentation:ze.indentation,localMode:ze.localMode,localState:ze.localMode?pe.copyState(ze.localMode,ze.localState):null,inline:ze.inline,text:ze.text,formatting:!1,linkText:ze.linkText,linkTitle:ze.linkTitle,linkHref:ze.linkHref,code:ze.code,em:ze.em,strong:ze.strong,strikethrough:ze.strikethrough,emoji:ze.emoji,header:ze.header,setext:ze.setext,hr:ze.hr,taskList:ze.taskList,list:ze.list,listStack:ze.listStack.slice(0),quote:ze.quote,indentedCode:ze.indentedCode,trailingSpace:ze.trailingSpace,trailingSpaceNewLine:ze.trailingSpaceNewLine,md_inside:ze.md_inside,fencedEndRE:ze.fencedEndRE}},token:function(ze,xe){if(xe.formatting=!1,ze!=xe.thisLine.stream){if(xe.header=0,xe.hr=!1,ze.match(/^\s*$/,!0))return Ve(xe),null;if(xe.prevLine=xe.thisLine,xe.thisLine={stream:ze},xe.taskList=!1,xe.trailingSpace=0,xe.trailingSpaceNewLine=!1,!xe.localState&&(xe.f=xe.block,xe.f!=Xe)){var bt=ze.match(/^\s*/,!0)[0].replace(/\t/g,Rt).length;if(xe.indentation=bt,xe.indentationDiff=null,bt>0)return null}}return xe.f(ze,xe)},innerMode:function(ze){return ze.block==Xe?{state:ze.htmlState,mode:ct}:ze.localState?{state:ze.localState,mode:ze.localMode}:{state:ze,mode:Wt}},indent:function(ze,xe,bt){return ze.block==Xe&&ct.indent?ct.indent(ze.htmlState,xe,bt):ze.localState&&ze.localMode.indent?ze.localMode.indent(ze.localState,xe,bt):pe.Pass},blankLine:Ve,getType:vt,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Wt},"xml"),pe.defineMIME("text/markdown","markdown"),pe.defineMIME("text/x-markdown","markdown")})},98101:function(kn,dn,de){(function(pe){pe(de(89780))})(function(pe){"use strict";pe.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 ut=0;ut<pe.modeInfo.length;ut++){var $e=pe.modeInfo[ut];$e.mimes&&($e.mime=$e.mimes[0])}pe.findModeByMIME=function(ct){ct=ct.toLowerCase();for(var Se=0;Se<pe.modeInfo.length;Se++){var Pe=pe.modeInfo[Se];if(Pe.mime==ct)return Pe;if(Pe.mimes){for(var Ne=0;Ne<Pe.mimes.length;Ne++)if(Pe.mimes[Ne]==ct)return Pe}}if(/\+xml$/.test(ct))return pe.findModeByMIME("application/xml");if(/\+json$/.test(ct))return pe.findModeByMIME("application/json")},pe.findModeByExtension=function(ct){ct=ct.toLowerCase();for(var Se=0;Se<pe.modeInfo.length;Se++){var Pe=pe.modeInfo[Se];if(Pe.ext){for(var Ne=0;Ne<Pe.ext.length;Ne++)if(Pe.ext[Ne]==ct)return Pe}}},pe.findModeByFileName=function(ct){for(var Se=0;Se<pe.modeInfo.length;Se++){var Pe=pe.modeInfo[Se];if(Pe.file&&Pe.file.test(ct))return Pe}var Ne=ct.lastIndexOf("."),Ce=Ne>-1&&ct.substring(Ne+1,ct.length);if(Ce)return pe.findModeByExtension(Ce)},pe.findModeByName=function(ct){ct=ct.toLowerCase();for(var Se=0;Se<pe.modeInfo.length;Se++){var Pe=pe.modeInfo[Se];if(Pe.name.toLowerCase()==ct)return Pe;if(Pe.alias){for(var Ne=0;Ne<Pe.alias.length;Ne++)if(Pe.alias[Ne].toLowerCase()==ct)return Pe}}}})},67549:function(kn,dn,de){(function(pe){pe(de(89780))})(function(pe){"use strict";pe.defineMode("stex",function(ut,$e){"use strict";function ct(kt,et){kt.cmdState.push(et)}function Se(kt){return kt.cmdState.length>0?kt.cmdState[kt.cmdState.length-1]:null}function Pe(kt){var et=kt.cmdState.pop();et&&et.closeBracket()}function Ne(kt){for(var et=kt.cmdState,mt=et.length-1;mt>=0;mt--){var st=et[mt];if(st.name!="DEFAULT")return st}return{styleIdentifier:function(){return null}}}function Ce(kt,et,mt){return function(){this.name=kt,this.bracketNo=0,this.style=et,this.styles=mt,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var ke={};ke.importmodule=Ce("importmodule","tag",["string","builtin"]),ke.documentclass=Ce("documentclass","tag",["","atom"]),ke.usepackage=Ce("usepackage","tag",["atom"]),ke.begin=Ce("begin","tag",["atom"]),ke.end=Ce("end","tag",["atom"]),ke.label=Ce("label","tag",["atom"]),ke.ref=Ce("ref","tag",["atom"]),ke.eqref=Ce("eqref","tag",["atom"]),ke.cite=Ce("cite","tag",["atom"]),ke.bibitem=Ce("bibitem","tag",["atom"]),ke.Bibitem=Ce("Bibitem","tag",["atom"]),ke.RBibitem=Ce("RBibitem","tag",["atom"]),ke.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function Fe(kt,et){kt.f=et}function gt(kt,et){var mt;if(kt.match(/^\\[a-zA-Z@]+/)){var st=kt.current().slice(1);return mt=ke.hasOwnProperty(st)?ke[st]:ke.DEFAULT,mt=new mt,ct(et,mt),Fe(et,je),mt.style}if(kt.match(/^\\[$&%#{}_]/)||kt.match(/^\\[,;!\/\\]/))return"tag";if(kt.match("\\["))return Fe(et,function(tn,nt){return Oe(tn,nt,"\\]")}),"keyword";if(kt.match("\\("))return Fe(et,function(tn,nt){return Oe(tn,nt,"\\)")}),"keyword";if(kt.match("$$"))return Fe(et,function(tn,nt){return Oe(tn,nt,"$$")}),"keyword";if(kt.match("$"))return Fe(et,function(tn,nt){return Oe(tn,nt,"$")}),"keyword";var Rt=kt.next();if(Rt=="%")return kt.skipToEnd(),"comment";if(Rt=="}"||Rt=="]"){if(mt=Se(et),mt)mt.closeBracket(Rt),Fe(et,je);else return"error";return"bracket"}else return Rt=="{"||Rt=="["?(mt=ke.DEFAULT,mt=new mt,ct(et,mt),"bracket"):/\d/.test(Rt)?(kt.eatWhile(/[\w.%]/),"atom"):(kt.eatWhile(/[\w\-_]/),mt=Ne(et),mt.name=="begin"&&(mt.argument=kt.current()),mt.styleIdentifier())}function Oe(kt,et,mt){if(kt.eatSpace())return null;if(mt&&kt.match(mt))return Fe(et,gt),"keyword";if(kt.match(/^\\[a-zA-Z@]+/))return"tag";if(kt.match(/^[a-zA-Z]+/))return"variable-2";if(kt.match(/^\\[$&%#{}_]/)||kt.match(/^\\[,;!\/]/)||kt.match(/^[\^_&]/))return"tag";if(kt.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(kt.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var st=kt.next();return st=="{"||st=="}"||st=="["||st=="]"||st=="("||st==")"?"bracket":st=="%"?(kt.skipToEnd(),"comment"):"error"}function je(kt,et){var mt=kt.peek(),st;return mt=="{"||mt=="["?(st=Se(et),st.openBracket(mt),kt.eat(mt),Fe(et,gt),"bracket"):/[ \t\r]/.test(mt)?(kt.eat(mt),null):(Fe(et,gt),Pe(et),gt(kt,et))}return{startState:function(){var kt=$e.inMathMode?function(et,mt){return Oe(et,mt)}:gt;return{cmdState:[],f:kt}},copyState:function(kt){return{cmdState:kt.cmdState.slice(),f:kt.f}},token:function(kt,et){return et.f(kt,et)},blankLine:function(kt){kt.f=gt,kt.cmdState.length=0},lineComment:"%"}}),pe.defineMIME("text/x-stex","stex"),pe.defineMIME("text/x-latex","stex")})},15525:function(kn,dn,de){(function(pe){pe(de(89780))})(function(pe){"use strict";var ut={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},$e={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};pe.defineMode("xml",function(ct,Se){var Pe=ct.indentUnit,Ne={},Ce=Se.htmlMode?ut:$e;for(var ke in Ce)Ne[ke]=Ce[ke];for(var ke in Se)Ne[ke]=Se[ke];var Fe,gt;function Oe(rt,At){function qe(Kt){return At.tokenize=Kt,Kt(rt,At)}var Ht=rt.next();if(Ht=="<")return rt.eat("!")?rt.eat("[")?rt.match("CDATA[")?qe(et("atom","]]>")):null:rt.match("--")?qe(et("comment","-->")):rt.match("DOCTYPE",!0,!0)?(rt.eatWhile(/[\w\._\-]/),qe(mt(1))):null:rt.eat("?")?(rt.eatWhile(/[\w\._\-]/),At.tokenize=et("meta","?>"),"meta"):(Fe=rt.eat("/")?"closeTag":"openTag",At.tokenize=je,"tag bracket");if(Ht=="&"){var cn;return rt.eat("#")?rt.eat("x")?cn=rt.eatWhile(/[a-fA-F\d]/)&&rt.eat(";"):cn=rt.eatWhile(/[\d]/)&&rt.eat(";"):cn=rt.eatWhile(/[\w\.\-:]/)&&rt.eat(";"),cn?"atom":"error"}else return rt.eatWhile(/[^&<]/),null}Oe.isInText=!0;function je(rt,At){var qe=rt.next();if(qe==">"||qe=="/"&&rt.eat(">"))return At.tokenize=Oe,Fe=qe==">"?"endTag":"selfcloseTag","tag bracket";if(qe=="=")return Fe="equals",null;if(qe=="<"){At.tokenize=Oe,At.state=nt,At.tagName=At.tagStart=null;var Ht=At.tokenize(rt,At);return Ht?Ht+" tag error":"tag error"}else return/[\'\"]/.test(qe)?(At.tokenize=kt(qe),At.stringStartCol=rt.column(),At.tokenize(rt,At)):(rt.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function kt(rt){var At=function(qe,Ht){for(;!qe.eol();)if(qe.next()==rt){Ht.tokenize=je;break}return"string"};return At.isInAttribute=!0,At}function et(rt,At){return function(qe,Ht){for(;!qe.eol();){if(qe.match(At)){Ht.tokenize=Oe;break}qe.next()}return rt}}function mt(rt){return function(At,qe){for(var Ht;(Ht=At.next())!=null;){if(Ht=="<")return qe.tokenize=mt(rt+1),qe.tokenize(At,qe);if(Ht==">")if(rt==1){qe.tokenize=Oe;break}else return qe.tokenize=mt(rt-1),qe.tokenize(At,qe)}return"meta"}}function st(rt,At,qe){this.prev=rt.context,this.tagName=At,this.indent=rt.indented,this.startOfLine=qe,(Ne.doNotIndent.hasOwnProperty(At)||rt.context&&rt.context.noIndent)&&(this.noIndent=!0)}function Rt(rt){rt.context&&(rt.context=rt.context.prev)}function tn(rt,At){for(var qe;;){if(!rt.context||(qe=rt.context.tagName,!Ne.contextGrabbers.hasOwnProperty(qe)||!Ne.contextGrabbers[qe].hasOwnProperty(At)))return;Rt(rt)}}function nt(rt,At,qe){return rt=="openTag"?(qe.tagStart=At.column(),ht):rt=="closeTag"?Ve:nt}function ht(rt,At,qe){return rt=="word"?(qe.tagName=At.current(),gt="tag",at):Ne.allowMissingTagName&&rt=="endTag"?(gt="tag bracket",at(rt,At,qe)):(gt="error",ht)}function Ve(rt,At,qe){if(rt=="word"){var Ht=At.current();return qe.context&&qe.context.tagName!=Ht&&Ne.implicitlyClosed.hasOwnProperty(qe.context.tagName)&&Rt(qe),qe.context&&qe.context.tagName==Ht||Ne.matchClosing===!1?(gt="tag",Ee):(gt="tag error",Xe)}else return Ne.allowMissingTagName&&rt=="endTag"?(gt="tag bracket",Ee(rt,At,qe)):(gt="error",Xe)}function Ee(rt,At,qe){return rt!="endTag"?(gt="error",Ee):(Rt(qe),nt)}function Xe(rt,At,qe){return gt="error",Ee(rt,At,qe)}function at(rt,At,qe){if(rt=="word")return gt="attribute",vt;if(rt=="endTag"||rt=="selfcloseTag"){var Ht=qe.tagName,cn=qe.tagStart;return qe.tagName=qe.tagStart=null,rt=="selfcloseTag"||Ne.autoSelfClosers.hasOwnProperty(Ht)?tn(qe,Ht):(tn(qe,Ht),qe.context=new st(qe,Ht,cn==qe.indented)),nt}return gt="error",at}function vt(rt,At,qe){return rt=="equals"?Ue:(Ne.allowMissing||(gt="error"),at(rt,At,qe))}function Ue(rt,At,qe){return rt=="string"?Ot:rt=="word"&&Ne.allowUnquoted?(gt="string",at):(gt="error",at(rt,At,qe))}function Ot(rt,At,qe){return rt=="string"?Ot:at(rt,At,qe)}return{startState:function(rt){var At={tokenize:Oe,state:nt,indented:rt||0,tagName:null,tagStart:null,context:null};return rt!=null&&(At.baseIndent=rt),At},token:function(rt,At){if(!At.tagName&&rt.sol()&&(At.indented=rt.indentation()),rt.eatSpace())return null;Fe=null;var qe=At.tokenize(rt,At);return(qe||Fe)&&qe!="comment"&&(gt=null,At.state=At.state(Fe||qe,rt,At),gt&&(qe=gt=="error"?qe+" error":gt)),qe},indent:function(rt,At,qe){var Ht=rt.context;if(rt.tokenize.isInAttribute)return rt.tagStart==rt.indented?rt.stringStartCol+1:rt.indented+Pe;if(Ht&&Ht.noIndent)return pe.Pass;if(rt.tokenize!=je&&rt.tokenize!=Oe)return qe?qe.match(/^(\s*)/)[0].length:0;if(rt.tagName)return Ne.multilineTagIndentPastTag!==!1?rt.tagStart+rt.tagName.length+2:rt.tagStart+Pe*(Ne.multilineTagIndentFactor||1);if(Ne.alignCDATA&&/<!\[CDATA\[/.test(At))return 0;var cn=At&&/^<(\/)?([\w_:\.-]*)/.exec(At);if(cn&&cn[1])for(;Ht;)if(Ht.tagName==cn[2]){Ht=Ht.prev;break}else if(Ne.implicitlyClosed.hasOwnProperty(Ht.tagName))Ht=Ht.prev;else break;else if(cn)for(;Ht;){var Kt=Ne.contextGrabbers[Ht.tagName];if(Kt&&Kt.hasOwnProperty(cn[2]))Ht=Ht.prev;else break}for(;Ht&&Ht.prev&&!Ht.startOfLine;)Ht=Ht.prev;return Ht?Ht.indent+Pe:rt.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:Ne.htmlMode?"html":"xml",helperType:Ne.htmlMode?"html":"xml",skipAttribute:function(rt){rt.state==Ue&&(rt.state=at)},xmlCurrentTag:function(rt){return rt.tagName?{name:rt.tagName,close:rt.type=="closeTag"}:null},xmlCurrentContext:function(rt){for(var At=[],qe=rt.context;qe;qe=qe.prev)qe.tagName&&At.push(qe.tagName);return At.reverse()}}}),pe.defineMIME("text/xml","xml"),pe.defineMIME("application/xml","xml"),pe.mimeModes.hasOwnProperty("text/html")||pe.defineMIME("text/html",{name:"xml",htmlMode:!0})})},2859:function(kn,dn,de){"use strict";de.d(dn,{hP:function(){return zt}});var pe=function(ve,se){return(pe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(oe,fe){oe.__proto__=fe}||function(oe,fe){for(var ye in fe)Object.prototype.hasOwnProperty.call(fe,ye)&&(oe[ye]=fe[ye])})(ve,se)};function ut(ve,se){function oe(){this.constructor=ve}pe(ve,se),ve.prototype=se===null?Object.create(se):(oe.prototype=se.prototype,new oe)}function $e(ve,se,oe,fe){return new(oe||(oe=Promise))(function(ye,ce){function Ke(Jt){try{ln(fe.next(Jt))}catch(en){ce(en)}}function Dt(Jt){try{ln(fe.throw(Jt))}catch(en){ce(en)}}function ln(Jt){var en;Jt.done?ye(Jt.value):(en=Jt.value,en instanceof oe?en:new oe(function(nn){nn(en)})).then(Ke,Dt)}ln((fe=fe.apply(ve,se||[])).next())})}function ct(ve,se){var oe,fe,ye,ce,Ke={label:0,sent:function(){if(1&ye[0])throw ye[1];return ye[1]},trys:[],ops:[]};return ce={next:Dt(0),throw:Dt(1),return:Dt(2)},typeof Symbol=="function"&&(ce[Symbol.iterator]=function(){return this}),ce;function Dt(ln){return function(Jt){return function(en){if(oe)throw new TypeError("Generator is already executing.");for(;Ke;)try{if(oe=1,fe&&(ye=2&en[0]?fe.return:en[0]?fe.throw||((ye=fe.return)&&ye.call(fe),0):fe.next)&&!(ye=ye.call(fe,en[1])).done)return ye;switch(fe=0,ye&&(en=[2&en[0],ye.value]),en[0]){case 0:case 1:ye=en;break;case 4:return Ke.label++,{value:en[1],done:!1};case 5:Ke.label++,fe=en[1],en=[0];continue;case 7:en=Ke.ops.pop(),Ke.trys.pop();continue;default:if(ye=Ke.trys,!((ye=ye.length>0&&ye[ye.length-1])||en[0]!==6&&en[0]!==2)){Ke=0;continue}if(en[0]===3&&(!ye||en[1]>ye[0]&&en[1]<ye[3])){Ke.label=en[1];break}if(en[0]===6&&Ke.label<ye[1]){Ke.label=ye[1],ye=en;break}if(ye&&Ke.label<ye[2]){Ke.label=ye[2],Ke.ops.push(en);break}ye[2]&&Ke.ops.pop(),Ke.trys.pop();continue}en=se.call(ve,Ke)}catch(nn){en=[6,nn],fe=0}finally{oe=ye=0}if(5&en[0])throw en[1];return{value:en[0]?en[1]:void 0,done:!0}}([ln,Jt])}}}function Se(){for(var ve=0,se=0,oe=arguments.length;se<oe;se++)ve+=arguments[se].length;var fe=Array(ve),ye=0;for(se=0;se<oe;se++)for(var ce=arguments[se],Ke=0,Dt=ce.length;Ke<Dt;Ke++,ye++)fe[ye]=ce[Ke];return fe}var Pe=function(){function ve(){}return ve.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ve.setAttributes=function(se,oe){for(var fe=0,ye=oe;fe<ye.length;fe++){var ce=ye[fe],Ke=ce[0],Dt=ce[1];se.setAttribute(Ke,Dt)}},ve.createRect=function(se,oe,fe){var ye=document.createElementNS("http://www.w3.org/2000/svg","rect");return ye.setAttribute("width",se.toString()),ye.setAttribute("height",oe.toString()),fe&&ve.setAttributes(ye,fe),ye},ve.createLine=function(se,oe,fe,ye,ce){var Ke=document.createElementNS("http://www.w3.org/2000/svg","line");return Ke.setAttribute("x1",se.toString()),Ke.setAttribute("y1",oe.toString()),Ke.setAttribute("x2",fe.toString()),Ke.setAttribute("y2",ye.toString()),ce&&ve.setAttributes(Ke,ce),Ke},ve.createPolygon=function(se,oe){var fe=document.createElementNS("http://www.w3.org/2000/svg","polygon");return fe.setAttribute("points",se),oe&&ve.setAttributes(fe,oe),fe},ve.createCircle=function(se,oe){var fe=document.createElementNS("http://www.w3.org/2000/svg","circle");return fe.setAttribute("cx",(se/2).toString()),fe.setAttribute("cy",(se/2).toString()),fe.setAttribute("r",se.toString()),oe&&ve.setAttributes(fe,oe),fe},ve.createEllipse=function(se,oe,fe){var ye=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ye.setAttribute("cx",(se/2).toString()),ye.setAttribute("cy",(oe/2).toString()),ye.setAttribute("rx",(se/2).toString()),ye.setAttribute("ry",(oe/2).toString()),fe&&ve.setAttributes(ye,fe),ye},ve.createGroup=function(se){var oe=document.createElementNS("http://www.w3.org/2000/svg","g");return se&&ve.setAttributes(oe,se),oe},ve.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ve.createMarker=function(se,oe,fe,ye,ce,Ke,Dt){var ln=document.createElementNS("http://www.w3.org/2000/svg","marker");return ve.setAttributes(ln,[["id",se],["orient",oe],["markerWidth",fe.toString()],["markerHeight",ye.toString()],["refX",ce.toString()],["refY",Ke.toString()]]),ln.appendChild(Dt),ln},ve.createText=function(se){var oe=document.createElementNS("http://www.w3.org/2000/svg","text");return oe.setAttribute("x","0"),oe.setAttribute("y","0"),se&&ve.setAttributes(oe,se),oe},ve.createTSpan=function(se,oe){var fe=document.createElementNS("http://www.w3.org/2000/svg","tspan");return fe.textContent=se,oe&&ve.setAttributes(fe,oe),fe},ve.createImage=function(se){var oe=document.createElementNS("http://www.w3.org/2000/svg","image");return se&&ve.setAttributes(oe,se),oe},ve.createPoint=function(se,oe){var fe=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return fe.x=se,fe.y=oe,fe},ve.createPath=function(se,oe){var fe=document.createElementNS("http://www.w3.org/2000/svg","path");return fe.setAttribute("d",se),oe&&ve.setAttributes(fe,oe),fe},ve}(),Ne=function(){function ve(){}return ve.addKey=function(se){ve.key=se},Object.defineProperty(ve,"isLicensed",{get:function(){return!!ve.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ve.key)},enumerable:!1,configurable:!0}),ve}(),Ce=function(){function ve(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return ve.prototype.rasterize=function(se,oe,fe){var ye=this;return new Promise(function(ce){var Ke=fe!==void 0?fe:document.createElement("canvas");se===null&&(ye.markersOnly=!0,ye.naturalSize=!1);var Dt=document.createElementNS("http://www.w3.org/2000/svg","svg");Dt.setAttribute("xmlns","http://www.w3.org/2000/svg"),Dt.setAttribute("width",oe.width.baseVal.valueAsString),Dt.setAttribute("height",oe.height.baseVal.valueAsString),Dt.setAttribute("viewBox","0 0 "+oe.viewBox.baseVal.width.toString()+" "+oe.viewBox.baseVal.height.toString()),Dt.innerHTML=oe.innerHTML,ye.naturalSize===!0?(Dt.width.baseVal.value=se.naturalWidth,Dt.height.baseVal.value=se.naturalHeight):ye.width!==void 0&&ye.height!==void 0&&(Dt.width.baseVal.value=ye.width,Dt.height.baseVal.value=ye.height),Ke.width=Dt.width.baseVal.value,Ke.height=Dt.height.baseVal.value;var ln=Dt.outerHTML,Jt=Ke.getContext("2d");ye.markersOnly!==!0&&Jt.drawImage(se,0,0,Ke.width,Ke.height);var en=window.URL,nn=new Image(Ke.width,Ke.height);nn.setAttribute("crossOrigin","anonymous");var wn=new Blob([ln],{type:"image/svg+xml"}),mn=en.createObjectURL(wn);nn.onload=function(){Jt.drawImage(nn,0,0),en.revokeObjectURL(mn);var En=Ke.toDataURL(ye.imageType,ye.imageQuality);ce(En)},nn.src=mn})},ve}(),ke=function(){},Fe=function(){function ve(se){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+se+"_"}return Object.defineProperty(ve.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ve.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(ve.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),ve.prototype.addClass=function(se){return this.styleSheet===void 0&&this.addStyleSheet(),se.name=""+this.classNamePrefix+se.localName,this.classes.push(se),this.styleSheet.sheet.insertRule("."+se.name+" {"+se.style+"}",this.styleSheet.sheet.cssRules.length),se},ve.prototype.addRule=function(se){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(se),this.styleSheet.sheet.insertRule(se.selector+" {"+se.style+"}",this.styleSheet.sheet.cssRules.length)},ve.prototype.addStyleSheet=function(){var se;this.styleSheet=document.createElement("style"),((se=this.styleSheetRoot)!==null&&se!==void 0?se:document.head).appendChild(this.styleSheet),this.addRule(new gt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new gt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new gt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Oe("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Oe("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},ve.prototype.removeStyleSheet=function(){var se;this.styleSheet&&(((se=this.styleSheetRoot)!==null&&se!==void 0?se:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ve}(),gt=function(ve,se){this.selector=ve,this.style=se},Oe=function(ve,se){this.localName=ve,this.style=se},je=function(){function ve(se,oe,fe,ye,ce){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=se,this.displayMode=oe,this.markerItems=fe,this.uiStyleSettings=ye,this.styles=ce,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return ve.prototype.show=function(se){var oe=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=se,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var fe=document.createElement("div");fe.className=this.toolbarBlockStyleClass.name,fe.style.whiteSpace="nowrap",this.uiContainer.appendChild(fe),this.addActionButton(fe,'<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(fe,'<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(fe,'<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(fe,'<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(fe,'<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(fe,'<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(fe,'<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(fe,'<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(ce){var Ke=document.createElement("div");Ke.className=""+oe.toolbarButtonStyleClass.name,Ke.setAttribute("data-type-name",ce.typeName),Ke.innerHTML=ce.icon,Ke.addEventListener("click",function(){oe.markerToolbarButtonClicked(Ke,ce)}),oe.buttons.push(Ke),oe.markerButtons.push(Ke)}),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 ye=document.createElement("div");ye.className=this.toolbarBlockStyleClass.name,ye.style.whiteSpace="nowrap",ye.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ye),this.addActionButton(ye,'<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(ye,'<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()},ve.prototype.addButtonClickListener=function(se){this.buttonClickListeners.push(se)},ve.prototype.removeButtonClickListener=function(se){this.buttonClickListeners.indexOf(se)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(se),1)},ve.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},ve.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var se=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var oe=0;oe<this.markerButtons.length;oe++)oe<se||oe===se&&this.markerButtons.length-1===se?this.markerButtonBlock.appendChild(this.markerButtons[oe]):(oe===se&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[oe]))}},ve.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(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")},ve.prototype.resetButtonStyles=function(){var se=this;this.buttons.forEach(function(oe){oe.className=oe.className.replace(se.uiStyleSettings.toolbarButtonStyleColorsClassName?se.uiStyleSettings.toolbarButtonStyleColorsClassName:se.toolbarButtonStyleColorsClass.name,"").trim(),oe.className=oe.className.replace(se.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?se.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:se.toolbarActiveButtonStyleColorsClass.name,"").trim(),oe.className+=" "+(se.uiStyleSettings.toolbarButtonStyleColorsClassName?se.uiStyleSettings.toolbarButtonStyleColorsClassName:se.toolbarButtonStyleColorsClass.name)})},ve.prototype.addActionButton=function(se,oe,fe){var ye=this,ce=document.createElement("div");switch(ce.className=""+this.toolbarButtonStyleClass.name,ce.innerHTML=oe,ce.setAttribute("data-action",fe),ce.addEventListener("click",function(){ye.actionToolbarButtonClicked(ce,fe)}),fe){case"select":ce.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":ce.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":ce.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":ce.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":ce.style.fill=this.uiStyleSettings.closeButtonColor}se.appendChild(ce),this.buttons.push(ce)},ve.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Oe("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new Oe("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Oe("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Oe("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new Oe("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var se=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Oe("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*se)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*se)+`px;
padding: `+se+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Oe("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Oe("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new gt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new gt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},ve.prototype.markerToolbarButtonClicked=function(se,oe){this.setActiveButton(se),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(fe){return fe("marker",oe)}),this.markerButtonOverflowBlock.style.display="none"},ve.prototype.actionToolbarButtonClicked=function(se,oe){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(fe){return fe("action",oe)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},ve.prototype.setActiveButton=function(se){this.resetButtonStyles(),se.className=se.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),se.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},ve.prototype.setActiveMarkerButton=function(se){var oe=this.markerButtons.find(function(fe){return fe.getAttribute("data-type-name")===se});oe&&this.setActiveButton(oe)},ve.prototype.setCurrentMarker=function(se){var oe=this;this.currentMarker=se,this.buttons.filter(function(fe){return/delete|notes/.test(fe.getAttribute("data-action"))}).forEach(function(fe){oe.currentMarker===void 0?(fe.style.fillOpacity="0.4",fe.style.pointerEvents="none"):(fe.style.fillOpacity="1",fe.style.pointerEvents="all")})},ve}(),kt=function(){function ve(se,oe,fe,ye){this.panels=[],this.panelButtons=[],this.markerjsContainer=se,this.displayMode=oe,this.uiStyleSettings=fe,this.styles=ye,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return ve.prototype.addStyles=function(){var se;this.toolboxStyleClass=this.styles.addClass(new Oe("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new Oe("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var oe=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Oe("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Oe("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Oe("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new Oe("toolbox-panel-row_colors",`
background-color: `+((se=this.uiStyleSettings.toolboxBackgroundColor)!==null&&se!==void 0?se:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Oe("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*oe)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*oe)+`px;
padding: `+oe+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Oe("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Oe("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new gt("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new gt("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},ve.prototype.show=function(se){var oe;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=se,this.uiContainer.className=this.toolboxStyleClass.name+" "+((oe=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&oe!==void 0?oe:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},ve.prototype.setPanelButtons=function(se){var oe,fe,ye=this;this.panels=se,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((oe=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&oe!==void 0?oe:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((fe=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&fe!==void 0?fe:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(ce){var Ke;ce.uiStyleSettings=ye.uiStyleSettings;var Dt=document.createElement("div");Dt.className=ye.toolboxButtonStyleClass.name+" "+((Ke=ye.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ke!==void 0?Ke:ye.toolboxButtonStyleColorsClass.name),Dt.innerHTML=ce.icon,Dt.title=ce.title,Dt.addEventListener("click",function(){ye.panelButtonClick(ce)}),ye.panelButtons.push(Dt),ye.buttonRow.appendChild(Dt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},ve.prototype.panelButtonClick=function(se){var oe=this,fe=-1;if(se!==this.activePanel){fe=this.panels.indexOf(se),this.panelRow.innerHTML="";var ye=se.getUi();ye.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ye),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=se}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){oe.displayMode==="inline"?oe.panelRow.style.display="none":oe.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(ce,Ke){var Dt,ln;ce.className=oe.toolboxButtonStyleClass.name+" "+(Ke===fe?""+((Dt=oe.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Dt!==void 0?Dt:oe.toolboxActiveButtonStyleColorsClass.name):""+((ln=oe.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ln!==void 0?ln:oe.toolboxButtonStyleColorsClass.name))})},ve}(),et=function(ve,se){this.title=ve,this.icon=se},mt=function(ve){function se(oe,fe,ye,ce){var Ke=ve.call(this,oe,ce||'<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 Ke.colors=[],Ke.addTransparent=!1,Ke.colorBoxes=[],Ke.colors=fe,Ke.currentColor=ye,Ke.setCurrentColor=Ke.setCurrentColor.bind(Ke),Ke.getColorBox=Ke.getColorBox.bind(Ke),Ke}return ut(se,ve),se.prototype.getUi=function(){var oe=this,fe=document.createElement("div");return fe.style.overflow="hidden",fe.style.whiteSpace="nowrap",this.colors.forEach(function(ye){var ce=oe.getColorBox(ye);fe.appendChild(ce),oe.colorBoxes.push(ce)}),fe},se.prototype.getColorBox=function(oe){var fe=this,ye=this.uiStyleSettings.toolbarHeight/4,ce=this.uiStyleSettings.toolbarHeight-ye,Ke=document.createElement("div");Ke.style.display="inline-block",Ke.style.boxSizing="content-box",Ke.style.width=ce-2+"px",Ke.style.height=ce-2+"px",Ke.style.padding="1px",Ke.style.marginRight="2px",Ke.style.marginBottom="2px",Ke.style.borderWidth="2px",Ke.style.borderStyle="solid",Ke.style.borderRadius=(ce+2)/2+"px",Ke.style.borderColor=oe===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ke.addEventListener("click",function(){fe.setCurrentColor(oe,Ke)});var Dt=document.createElement("div");return Dt.style.display="inline-block",Dt.style.width=ce-2+"px",Dt.style.height=ce-2+"px",Dt.style.backgroundColor=oe,Dt.style.borderRadius=ce/2+"px",oe==="transparent"&&(Dt.style.fill=this.uiStyleSettings.toolboxAccentColor,Dt.innerHTML=`<svg viewBox="0 0 24 24">
<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" />
</svg>`),Ke.appendChild(Dt),Ke},se.prototype.setCurrentColor=function(oe,fe){var ye=this;this.currentColor=oe,this.colorBoxes.forEach(function(ce){ce.style.borderColor=ce===fe?ye.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(oe)},se}(et),st=function(){function ve(se,oe,fe){this._state="new",this._isSelected=!1,this._container=se,this._overlayContainer=oe,this.globalSettings=fe,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(ve.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),ve.prototype.ownsTarget=function(se){return!1},Object.defineProperty(ve.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),ve.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},ve.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},ve.prototype.pointerDown=function(se,oe){},ve.prototype.dblClick=function(se,oe){},ve.prototype.manipulate=function(se){},ve.prototype.pointerUp=function(se){this.stateChanged()},ve.prototype.dispose=function(){},ve.prototype.addMarkerVisualToContainer=function(se){this.container.childNodes.length>0?this.container.insertBefore(se,this.container.childNodes[0]):this.container.appendChild(se)},ve.prototype.getState=function(){return{typeName:ve.typeName,state:this.state,notes:this.notes}},ve.prototype.restoreState=function(se){this._state=se.state,this.notes=se.notes},ve.prototype.scale=function(se,oe){},ve.prototype.colorChanged=function(se){this.onColorChanged&&this.onColorChanged(se),this.stateChanged()},ve.prototype.fillColorChanged=function(se){this.onFillColorChanged&&this.onFillColorChanged(se),this.stateChanged()},ve.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var se=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),se.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(se)&&this.onStateChanged(this)}},ve.typeName="MarkerBase",ve}(),Rt=function(){function ve(){this.findGripByVisual=this.findGripByVisual.bind(this)}return ve.prototype.findGripByVisual=function(se){return this.topLeft.ownsTarget(se)?this.topLeft:this.topCenter.ownsTarget(se)?this.topCenter:this.topRight.ownsTarget(se)?this.topRight:this.centerLeft.ownsTarget(se)?this.centerLeft:this.centerRight.ownsTarget(se)?this.centerRight:this.bottomLeft.ownsTarget(se)?this.bottomLeft:this.bottomCenter.ownsTarget(se)?this.bottomCenter:this.bottomRight.ownsTarget(se)?this.bottomRight:void 0},ve}(),tn=function(){function ve(){this.GRIP_SIZE=10,this.visual=Pe.createGroup(),this.visual.appendChild(Pe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Pe.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ve.prototype.ownsTarget=function(se){return se===this.visual||se===this.visual.childNodes[0]||se===this.visual.childNodes[1]},ve}(),nt=function(){function ve(){}return ve.toITransformMatrix=function(se){return{a:se.a,b:se.b,c:se.c,d:se.d,e:se.e,f:se.f}},ve.toSVGMatrix=function(se,oe){return se.a=oe.a,se.b=oe.b,se.c=oe.c,se.d=oe.d,se.e=oe.e,se.f=oe.f,se},ve}(),ht=function(ve){function se(oe,fe,ye){var ce=ve.call(this,oe,fe,ye)||this;return ce.left=0,ce.top=0,ce.width=0,ce.height=0,ce.defaultSize={x:50,y:20},ce.offsetX=0,ce.offsetY=0,ce.rotationAngle=0,ce.CB_DISTANCE=10,ce._suppressMarkerCreateEvent=!1,ce.container.transform.baseVal.appendItem(Pe.createTransform()),ce.setupControlBox(),ce}return ut(se,ve),Object.defineProperty(se.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"visual",{get:function(){return this._visual},set:function(oe){this._visual=oe;var fe=Pe.createTransform();this._visual.transform.baseVal.appendItem(fe)},enumerable:!1,configurable:!0}),se.prototype.ownsTarget=function(oe){return!!ve.prototype.ownsTarget.call(this,oe)||!!(this.controlGrips.findGripByVisual(oe)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(oe))},se.prototype.pointerDown=function(oe,fe){ve.prototype.pointerDown.call(this,oe,fe),this.state==="new"&&(this.left=oe.x,this.top=oe.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ye=this.unrotatePoint(oe);if(this.manipulationStartX=ye.x,this.manipulationStartY=ye.y,this.offsetX=ye.x-this.left,this.offsetY=ye.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(fe),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(fe)){this.activeGrip=this.rotatorGrip;var ce=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=ce.x-this.width/2,this.top=ce.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Ke=this.container.transform.baseVal.getItem(0);Ke.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ke,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},se.prototype.pointerUp=function(oe){var fe=this.state;ve.prototype.pointerUp.call(this,oe),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(oe),this._state="select",fe==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},se.prototype.moveVisual=function(oe){this.visual.style.transform="translate("+oe.x+"px, "+oe.y+"px)"},se.prototype.manipulate=function(oe){var fe=this.unrotatePoint(oe);this.state==="creating"?this.resize(oe):this.state==="move"?(this.left=this.manipulationStartLeft+(fe.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(fe.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(fe):this.state==="rotate"&&this.rotate(oe)},se.prototype.resize=function(oe){var fe=this.manipulationStartLeft,ye=this.manipulationStartWidth,ce=this.manipulationStartTop,Ke=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:fe=this.manipulationStartLeft+oe.x-this.manipulationStartX,ye=this.manipulationStartWidth+this.manipulationStartLeft-fe;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ye=this.manipulationStartWidth+oe.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:ce=this.manipulationStartTop+oe.y-this.manipulationStartY,Ke=this.manipulationStartHeight+this.manipulationStartTop-ce;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ke=this.manipulationStartHeight+oe.y-this.manipulationStartY}ye>=0?(this.left=fe,this.width=ye):(this.left=fe+ye,this.width=-ye),Ke>=0?(this.top=ce,this.height=Ke):(this.top=ce+Ke,this.height=-Ke),this.setSize()},se.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},se.prototype.rotate=function(oe){if(Math.abs(oe.x-this.centerX)>.1){var fe=Math.sign(oe.x-this.centerX);this.rotationAngle=180*Math.atan((oe.y-this.centerY)/(oe.x-this.centerX))/Math.PI+90*fe,this.applyRotation()}},se.prototype.applyRotation=function(){var oe=this.container.transform.baseVal.getItem(0);oe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(oe,0)},se.prototype.rotatePoint=function(oe){if(this.rotationAngle===0)return oe;var fe=this.container.getCTM(),ye=Pe.createPoint(oe.x,oe.y);return{x:(ye=ye.matrixTransform(fe)).x,y:ye.y}},se.prototype.unrotatePoint=function(oe){if(this.rotationAngle===0)return oe;var fe=this.container.getCTM();fe=fe.inverse();var ye=Pe.createPoint(oe.x,oe.y);return{x:(ye=ye.matrixTransform(fe)).x,y:ye.y}},se.prototype.select=function(){ve.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},se.prototype.deselect=function(){ve.prototype.deselect.call(this),this.controlBox.style.display="none"},se.prototype.setupControlBox=function(){this.controlBox=Pe.createGroup();var oe=Pe.createTransform();oe.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(oe),this.container.appendChild(this.controlBox),this.controlRect=Pe.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=Pe.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 Rt,this.addControlGrips(),this.controlBox.style.display="none"},se.prototype.adjustControlBox=function(){var oe=this.controlBox.transform.baseVal.getItem(0);oe.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(oe,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},se.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},se.prototype.createGrip=function(){var oe=new tn;return oe.visual.transform.baseVal.appendItem(Pe.createTransform()),this.controlBox.appendChild(oe.visual),oe},se.prototype.positionGrips=function(){var oe=this.controlGrips.topLeft.GRIP_SIZE,fe=-oe/2,ye=fe,ce=(this.width+this.CB_DISTANCE)/2-oe/2,Ke=(this.height+this.CB_DISTANCE)/2-oe/2,Dt=this.height+this.CB_DISTANCE-oe/2,ln=this.width+this.CB_DISTANCE-oe/2;this.positionGrip(this.controlGrips.topLeft.visual,fe,ye),this.positionGrip(this.controlGrips.topCenter.visual,ce,ye),this.positionGrip(this.controlGrips.topRight.visual,ln,ye),this.positionGrip(this.controlGrips.centerLeft.visual,fe,Ke),this.positionGrip(this.controlGrips.centerRight.visual,ln,Ke),this.positionGrip(this.controlGrips.bottomLeft.visual,fe,Dt),this.positionGrip(this.controlGrips.bottomCenter.visual,ce,Dt),this.positionGrip(this.controlGrips.bottomRight.visual,ln,Dt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,ce,ye-3*this.CB_DISTANCE)},se.prototype.positionGrip=function(oe,fe,ye){var ce=oe.transform.baseVal.getItem(0);ce.setTranslate(fe,ye),oe.transform.baseVal.replaceItem(ce,0)},se.prototype.hideControlBox=function(){this.controlBox.style.display="none"},se.prototype.showControlBox=function(){this.controlBox.style.display=""},se.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:nt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:nt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},ve.prototype.getState.call(this))},se.prototype.restoreState=function(oe){ve.prototype.restoreState.call(this,oe);var fe=oe;this.left=fe.left,this.top=fe.top,this.width=fe.width,this.height=fe.height,this.rotationAngle=fe.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(nt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,fe.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(nt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,fe.containerTransformMatrix))},se.prototype.scale=function(oe,fe){ve.prototype.scale.call(this,oe,fe);var ye=this.rotatePoint({x:this.left,y:this.top}),ce=this.unrotatePoint({x:ye.x*oe,y:ye.y*fe});this.left=ce.x,this.top=ce.y,this.width=this.width*oe,this.height=this.height*fe,this.adjustControlBox()},se}(st),Ve=function(ve){function se(oe,fe,ye){var ce=ve.call(this,oe,fe,ye)||this;return ce.fillColor="transparent",ce.strokeColor="transparent",ce.strokeWidth=0,ce.strokeDasharray="",ce.opacity=1,ce.setStrokeColor=ce.setStrokeColor.bind(ce),ce.setFillColor=ce.setFillColor.bind(ce),ce.setStrokeWidth=ce.setStrokeWidth.bind(ce),ce.setStrokeDasharray=ce.setStrokeDasharray.bind(ce),ce.createVisual=ce.createVisual.bind(ce),ce}return ut(se,ve),se.prototype.ownsTarget=function(oe){return!(!ve.prototype.ownsTarget.call(this,oe)&&oe!==this.visual)},se.prototype.createVisual=function(){this.visual=Pe.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)},se.prototype.pointerDown=function(oe,fe){ve.prototype.pointerDown.call(this,oe,fe),this.state==="new"&&(this.createVisual(),this.moveVisual(oe),this._state="creating")},se.prototype.manipulate=function(oe){ve.prototype.manipulate.call(this,oe)},se.prototype.resize=function(oe){ve.prototype.resize.call(this,oe),this.setSize()},se.prototype.setSize=function(){ve.prototype.setSize.call(this),Pe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},se.prototype.pointerUp=function(oe){ve.prototype.pointerUp.call(this,oe),this.setSize()},se.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.visual&&Pe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(oe),this.stateChanged()},se.prototype.setFillColor=function(oe){this.fillColor=oe,this.visual&&Pe.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},se.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.visual&&Pe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},se.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.visual&&Pe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},se.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ve.prototype.getState.call(this))},se.prototype.restoreState=function(oe){var fe=oe;this.fillColor=fe.fillColor,this.strokeColor=fe.strokeColor,this.strokeWidth=fe.strokeWidth,this.strokeDasharray=fe.strokeDasharray,this.opacity=fe.opacity,this.createVisual(),ve.prototype.restoreState.call(this,oe),this.setSize()},se.prototype.scale=function(oe,fe){ve.prototype.scale.call(this,oe,fe),this.setSize()},se.title="Rectangle marker",se}(ht),Ee=function(ve){function se(oe,fe,ye,ce){var Ke=ve.call(this,oe,ce||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Ke.widths=[],Ke.widthBoxes=[],Ke.widths=fe,Ke.currentWidth=ye,Ke.setCurrentWidth=Ke.setCurrentWidth.bind(Ke),Ke}return ut(se,ve),se.prototype.getUi=function(){var oe=this,fe=document.createElement("div");return fe.style.display="flex",fe.style.overflow="hidden",fe.style.flexGrow="2",this.widths.forEach(function(ye){var ce=document.createElement("div");ce.style.display="flex",ce.style.flexGrow="2",ce.style.alignItems="center",ce.style.justifyContent="space-between",ce.style.padding="5px",ce.style.borderWidth="2px",ce.style.borderStyle="solid",ce.style.borderColor=ye===oe.currentWidth?oe.uiStyleSettings.toolboxAccentColor:"transparent",ce.addEventListener("click",function(){oe.setCurrentWidth(ye,ce)}),fe.appendChild(ce);var Ke=document.createElement("div");Ke.innerText=ye.toString(),Ke.style.marginRight="5px",ce.appendChild(Ke);var Dt=document.createElement("div");Dt.style.minHeight="20px",Dt.style.flexGrow="2",Dt.style.display="flex",Dt.style.alignItems="center";var ln=document.createElement("hr");ln.style.minWidth="20px",ln.style.border="0px",ln.style.borderTop=ye+"px solid "+oe.uiStyleSettings.toolboxColor,ln.style.flexGrow="2",Dt.appendChild(ln),ce.appendChild(Dt),oe.widthBoxes.push(ce)}),fe},se.prototype.setCurrentWidth=function(oe,fe){var ye=this;this.currentWidth=oe,this.widthBoxes.forEach(function(ce){ce.style.borderColor=ce===fe?ye.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},se}(et),Xe=function(ve){function se(oe,fe,ye,ce){var Ke=ve.call(this,oe,ce||'<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 Ke.styles=[],Ke.styleBoxes=[],Ke.styles=fe,Ke.currentStyle=ye,Ke.setCurrentStyle=Ke.setCurrentStyle.bind(Ke),Ke}return ut(se,ve),se.prototype.getUi=function(){var oe=this,fe=document.createElement("div");return fe.style.display="flex",fe.style.overflow="hidden",fe.style.flexGrow="2",this.styles.forEach(function(ye){var ce=document.createElement("div");ce.style.display="flex",ce.style.alignItems="center",ce.style.justifyContent="space-between",ce.style.padding="5px",ce.style.borderWidth="2px",ce.style.borderStyle="solid",ce.style.overflow="hidden",ce.style.maxWidth=100/oe.styles.length-5+"%",ce.style.borderColor=ye===oe.currentStyle?oe.uiStyleSettings.toolboxAccentColor:"transparent",ce.addEventListener("click",function(){oe.setCurrentStyle(ye,ce)}),fe.appendChild(ce);var Ke=document.createElement("div");Ke.style.minHeight="20px",Ke.style.flexGrow="2",Ke.style.overflow="hidden";var Dt=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+oe.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ye!==""?'stroke-dasharray="'+ye+'"':"")+` />
</svg>`;Ke.innerHTML=Dt,ce.appendChild(Ke),oe.styleBoxes.push(ce)}),fe},se.prototype.setCurrentStyle=function(oe,fe){var ye=this;this.currentStyle=oe,this.styleBoxes.forEach(function(ce){ce.style.borderColor=ce===fe?ye.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},se}(et),at=function(ve){function se(oe,fe,ye){var ce=ve.call(this,oe,fe,ye)||this;return ce.strokeColor=ye.defaultColor,ce.strokeWidth=ye.defaultStrokeWidth,ce.strokeDasharray=ye.defaultStrokeDasharray,ce.strokePanel=new mt("Line color",ye.defaultColorSet,ye.defaultColor),ce.strokePanel.onColorChanged=ce.setStrokeColor,ce.strokeWidthPanel=new Ee("Line width",ye.defaultStrokeWidths,ye.defaultStrokeWidth),ce.strokeWidthPanel.onWidthChanged=ce.setStrokeWidth,ce.strokeStylePanel=new Xe("Line style",ye.defaultStrokeDasharrays,ye.defaultStrokeDasharray),ce.strokeStylePanel.onStyleChanged=ce.setStrokeDasharray,ce}return ut(se,ve),Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=ve.prototype.getState.call(this);return oe.typeName=se.typeName,oe},se.typeName="FrameMarker",se.title="Frame marker",se.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',se}(Ve),vt=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"},Ue=function(ve){function se(oe,fe,ye){var ce=ve.call(this,oe,fe,ye)||this;return ce.x1=0,ce.y1=0,ce.x2=0,ce.y2=0,ce.defaultLength=50,ce.manipulationStartX=0,ce.manipulationStartY=0,ce.manipulationStartX1=0,ce.manipulationStartY1=0,ce.manipulationStartX2=0,ce.manipulationStartY2=0,ce.setupControlBox(),ce}return ut(se,ve),se.prototype.ownsTarget=function(oe){return!!ve.prototype.ownsTarget.call(this,oe)||!(!this.grip1.ownsTarget(oe)&&!this.grip2.ownsTarget(oe))},se.prototype.pointerDown=function(oe,fe){ve.prototype.pointerDown.call(this,oe,fe),this.manipulationStartX=oe.x,this.manipulationStartY=oe.y,this.state==="new"&&(this.x1=oe.x,this.y1=oe.y,this.x2=oe.x,this.y2=oe.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(fe)?this.activeGrip=this.grip1:this.grip2.ownsTarget(fe)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},se.prototype.pointerUp=function(oe){var fe=this.state;ve.prototype.pointerUp.call(this,oe),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(oe),this._state="select",fe==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},se.prototype.adjustVisual=function(){},se.prototype.manipulate=function(oe){this.state==="creating"?this.resize(oe):this.state==="move"?(this.x1=this.manipulationStartX1+oe.x-this.manipulationStartX,this.y1=this.manipulationStartY1+oe.y-this.manipulationStartY,this.x2=this.manipulationStartX2+oe.x-this.manipulationStartX,this.y2=this.manipulationStartY2+oe.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(oe)},se.prototype.resize=function(oe){switch(this.activeGrip){case this.grip1:this.x1=oe.x,this.y1=oe.y;break;case this.grip2:case void 0:this.x2=oe.x,this.y2=oe.y}this.adjustVisual(),this.adjustControlBox()},se.prototype.select=function(){ve.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},se.prototype.deselect=function(){ve.prototype.deselect.call(this),this.controlBox.style.display="none"},se.prototype.setupControlBox=function(){this.controlBox=Pe.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},se.prototype.adjustControlBox=function(){this.positionGrips()},se.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},se.prototype.createGrip=function(){var oe=new tn;return oe.visual.transform.baseVal.appendItem(Pe.createTransform()),this.controlBox.appendChild(oe.visual),oe},se.prototype.positionGrips=function(){var oe=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-oe/2,this.y1-oe/2),this.positionGrip(this.grip2.visual,this.x2-oe/2,this.y2-oe/2)},se.prototype.positionGrip=function(oe,fe,ye){var ce=oe.transform.baseVal.getItem(0);ce.setTranslate(fe,ye),oe.transform.baseVal.replaceItem(ce,0)},se.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},ve.prototype.getState.call(this))},se.prototype.restoreState=function(oe){ve.prototype.restoreState.call(this,oe);var fe=oe;this.x1=fe.x1,this.y1=fe.y1,this.x2=fe.x2,this.y2=fe.y2},se.prototype.scale=function(oe,fe){ve.prototype.scale.call(this,oe,fe),this.x1=this.x1*oe,this.y1=this.y1*fe,this.x2=this.x2*oe,this.y2=this.y2*fe,this.adjustVisual(),this.adjustControlBox()},se}(st),Ot=function(ve){function se(oe,fe,ye){var ce=ve.call(this,oe,fe,ye)||this;return ce.strokeColor="transparent",ce.strokeWidth=0,ce.strokeDasharray="",ce.setStrokeColor=ce.setStrokeColor.bind(ce),ce.setStrokeWidth=ce.setStrokeWidth.bind(ce),ce.setStrokeDasharray=ce.setStrokeDasharray.bind(ce),ce.strokeColor=ye.defaultColor,ce.strokeWidth=ye.defaultStrokeWidth,ce.strokeDasharray=ye.defaultStrokeDasharray,ce.strokePanel=new mt("Line color",ye.defaultColorSet,ye.defaultColor),ce.strokePanel.onColorChanged=ce.setStrokeColor,ce.strokeWidthPanel=new Ee("Line width",ye.defaultStrokeWidths,ye.defaultStrokeWidth),ce.strokeWidthPanel.onWidthChanged=ce.setStrokeWidth,ce.strokeStylePanel=new Xe("Line style",ye.defaultStrokeDasharrays,ye.defaultStrokeDasharray),ce.strokeStylePanel.onStyleChanged=ce.setStrokeDasharray,ce}return ut(se,ve),se.prototype.ownsTarget=function(oe){return!(!ve.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.selectorLine&&oe!==this.visibleLine)},se.prototype.createVisual=function(){this.visual=Pe.createGroup(),this.selectorLine=Pe.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=Pe.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)},se.prototype.pointerDown=function(oe,fe){ve.prototype.pointerDown.call(this,oe,fe),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},se.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()),Pe.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),Pe.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),Pe.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},se.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.adjustVisual(),this.colorChanged(oe)},se.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.adjustVisual()},se.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.adjustVisual(),this.stateChanged()},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},ve.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){ve.prototype.restoreState.call(this,oe);var fe=oe;this.strokeColor=fe.strokeColor,this.strokeWidth=fe.strokeWidth,this.strokeDasharray=fe.strokeDasharray,this.createVisual(),this.adjustVisual()},se.typeName="LineMarker",se.title="Line marker",se.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',se}(Ue),rt=function(ve){function se(oe,fe,ye,ce){var Ke=ve.call(this,oe,ce||'<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 Ke.fonts=[],Ke.fontBoxes=[],Ke.fonts=fe,Ke.currentFont=ye,Ke.setCurrentFont=Ke.setCurrentFont.bind(Ke),Ke}return ut(se,ve),se.prototype.getUi=function(){var oe=this,fe=document.createElement("div");return fe.style.overflow="hidden",fe.style.flexGrow="2",this.fonts.forEach(function(ye){var ce=document.createElement("div");ce.style.display="inline-block",ce.style.alignItems="center",ce.style.justifyContent="space-between",ce.style.padding="5px",ce.style.borderWidth="2px",ce.style.borderStyle="solid",ce.style.overflow="hidden",ce.style.maxWidth=100/oe.fonts.length-5+"%",ce.style.borderColor=ye===oe.currentFont?oe.uiStyleSettings.toolboxAccentColor:"transparent",ce.addEventListener("click",function(){oe.setCurrentFont(ye,ce)}),fe.appendChild(ce);var Ke=document.createElement("div");Ke.style.display="flex",Ke.style.minHeight="20px",Ke.style.flexGrow="2",Ke.style.fontFamily=ye,Ke.style.overflow="hidden";var Dt=document.createElement("div");Dt.style.whiteSpace="nowrap",Dt.style.overflow="hidden",Dt.style.textOverflow="ellipsis",Dt.innerHTML="The quick brown fox jumps over the lazy dog",Ke.appendChild(Dt),ce.appendChild(Ke),oe.fontBoxes.push(ce)}),fe},se.prototype.setCurrentFont=function(oe,fe){var ye=this;this.currentFont=oe,this.fontBoxes.forEach(function(ce){ce.style.borderColor=ce===fe?ye.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},se}(et),At=function(ve){function se(oe,fe,ye){var ce=ve.call(this,oe,fe,ye)||this;return ce.color="transparent",ce.padding=5,ce.DEFAULT_TEXT="\u8BF7\u8F93\u5165\u6587\u672C",ce.text=ce.DEFAULT_TEXT,ce.isMoved=!1,ce.color=ye.defaultColor,ce.fontFamily=ye.defaultFontFamily,ce.defaultSize={x:100,y:30},ce.setColor=ce.setColor.bind(ce),ce.setFont=ce.setFont.bind(ce),ce.renderText=ce.renderText.bind(ce),ce.sizeText=ce.sizeText.bind(ce),ce.textEditDivClicked=ce.textEditDivClicked.bind(ce),ce.showTextEditor=ce.showTextEditor.bind(ce),ce.setSize=ce.setSize.bind(ce),ce.positionTextEditor=ce.positionTextEditor.bind(ce),ce.colorPanel=new mt("Color",ye.defaultColorSet,ye.defaultColor),ce.colorPanel.onColorChanged=ce.setColor,ce.fontFamilyPanel=new rt("Font",ye.defaultFontFamilies,ye.defaultFontFamily),ce.fontFamilyPanel.onFontChanged=ce.setFont,ce}return ut(se,ve),se.prototype.ownsTarget=function(oe){if(ve.prototype.ownsTarget.call(this,oe)||oe===this.visual||oe===this.textElement||oe===this.bgRectangle)return!0;var fe=!1;return this.textElement.childNodes.forEach(function(ye){ye===oe&&(fe=!0)}),fe},se.prototype.createVisual=function(){this.visual=Pe.createGroup(),this.bgRectangle=Pe.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=Pe.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(Pe.createTransform()),this.textElement.transform.baseVal.appendItem(Pe.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},se.prototype.pointerDown=function(oe,fe){ve.prototype.pointerDown.call(this,oe,fe),this.isMoved=!1,this.pointerDownPoint=oe,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(oe),this._state="creating")},se.prototype.renderText=function(){var oe=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(fe){oe.textElement.appendChild(Pe.createTSpan(fe.trim()===""?" ":fe.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},se.prototype.getTextScale=function(){var oe=this.textElement.getBBox(),fe=1;if(oe.width>0&&oe.height>0){var ye=(1*this.width-this.width*this.padding*2/100)/oe.width,ce=(1*this.height-this.height*this.padding*2/100)/oe.height;fe=Math.min(ye,ce)}return fe},se.prototype.getTextPosition=function(oe){var fe=this.textElement.getBBox(),ye=0,ce=0;return fe.width>0&&fe.height>0&&(ye=(this.width-fe.width*oe)/2,ce=this.height/2-fe.height*oe/2),{x:ye,y:ce}},se.prototype.sizeText=function(){var oe=this.textElement.getBBox(),fe=this.getTextScale(),ye=this.getTextPosition(fe);ye.y-=oe.y*fe,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ye.x+"px, "+ye.y+"px) scale("+fe+", "+fe+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ye.x,ye.y),this.textElement.transform.baseVal.getItem(1).setScale(fe,fe))},se.prototype.manipulate=function(oe){ve.prototype.manipulate.call(this,oe),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(oe.x-this.pointerDownPoint.x)>5||Math.abs(oe.y-this.pointerDownPoint.y)>5)},se.prototype.resize=function(oe){ve.prototype.resize.call(this,oe),this.isMoved=!0,this.setSize(),this.sizeText()},se.prototype.setSize=function(){ve.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(Pe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Pe.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},se.prototype.pointerUp=function(oe){var fe=this.state;fe==="creating"&&(this._suppressMarkerCreateEvent=!0),ve.prototype.pointerUp.call(this,oe),this.setSize(),(fe==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},se.prototype.showTextEditor=function(){var oe=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(fe){fe.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var fe=Number.parseFloat(oe.textEditor.style.fontSize);oe.textEditor.clientWidth>=Number.parseInt(oe.textEditor.style.maxWidth)&&fe>.9;)fe-=.1,oe.textEditor.style.fontSize=Math.max(fe,.9)+"em"}),this.textEditor.addEventListener("keyup",function(fe){fe.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(fe){if(fe.clipboardData){var ye=fe.clipboardData.getData("text"),ce=window.getSelection();if(!ce.rangeCount)return!1;ce.deleteFromDocument(),ce.getRangeAt(0).insertNode(document.createTextNode(ye)),fe.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){oe.textEditDivClicked(oe.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},se.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var oe=this.getTextScale(),fe=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ye=this.textElement.getBBox(),ce={x:ye.width*oe,y:ye.height*oe};fe.x-=ce.x/2,fe.y-=ce.y/2,this.textEditor.style.top=fe.y+"px",this.textEditor.style.left=fe.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-fe.x+"px",this.textEditor.style.fontSize=Math.max(16*oe,12)+"px",this.textElement.style.display="none"}},se.prototype.textEditDivClicked=function(oe){this.text=oe.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},se.prototype.select=function(){ve.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},se.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),ve.prototype.deselect.call(this)},se.prototype.dblClick=function(oe,fe){ve.prototype.dblClick.call(this,oe,fe),this.showTextEditor()},se.prototype.setColor=function(oe){this.textElement&&Pe.setAttributes(this.textElement,[["fill",oe]]),this.color=oe,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(oe)},se.prototype.setFont=function(oe){this.textElement&&Pe.setAttributes(this.textElement,[["font-family",oe]]),this.fontFamily=oe,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},se.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},se.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},ve.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){var fe=oe;this.color=fe.color,this.fontFamily=fe.fontFamily,this.padding=fe.padding,this.text=fe.text,this.createVisual(),ve.prototype.restoreState.call(this,oe),this.setSize()},se.prototype.scale=function(oe,fe){ve.prototype.scale.call(this,oe,fe),this.setSize(),this.sizeText(),this.positionTextEditor()},se.typeName="TextMarker",se.title="Text marker",se.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>',se}(ht),qe=function(ve){function se(oe,fe,ye){var ce=ve.call(this,oe,fe,ye)||this;return ce.color="transparent",ce.lineWidth=3,ce.drawing=!1,ce.pixelRatio=1,ce.color=ye.defaultColor,ce.lineWidth=ye.defaultStrokeWidth,ce.pixelRatio=ye.freehandPixelRatio,ce.setColor=ce.setColor.bind(ce),ce.addCanvas=ce.addCanvas.bind(ce),ce.finishCreation=ce.finishCreation.bind(ce),ce.setLineWidth=ce.setLineWidth.bind(ce),ce.colorPanel=new mt("Color",ye.defaultColorSet,ye.defaultColor),ce.colorPanel.onColorChanged=ce.setColor,ce.lineWidthPanel=new Ee("Line width",ye.defaultStrokeWidths,ye.defaultStrokeWidth),ce.lineWidthPanel.onWidthChanged=ce.setLineWidth,ce}return ut(se,ve),se.prototype.ownsTarget=function(oe){return!(!ve.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.drawingImage)},se.prototype.createVisual=function(){this.visual=Pe.createGroup(),this.drawingImage=Pe.createImage(),this.visual.appendChild(this.drawingImage);var oe=Pe.createTransform();this.visual.transform.baseVal.appendItem(oe),this.addMarkerVisualToContainer(this.visual)},se.prototype.pointerDown=function(oe,fe){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(oe.x,oe.y),this.drawing=!0):ve.prototype.pointerDown.call(this,oe,fe)},se.prototype.manipulate=function(oe){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(oe.x,oe.y),this.canvasContext.stroke()):ve.prototype.manipulate.call(this,oe)},se.prototype.resize=function(oe){ve.prototype.resize.call(this,oe),Pe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Pe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},se.prototype.pointerUp=function(oe){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):ve.prototype.pointerUp.call(this,oe)},se.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)},se.prototype.select=function(){this.state==="creating"&&this.finishCreation(),ve.prototype.select.call(this)},se.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),ve.prototype.deselect.call(this)},se.prototype.finishCreation=function(){for(var oe=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),fe=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ye=fe[0],ce=fe[1],Ke=fe[2],Dt=fe[3],ln=!1,Jt=0;Jt<this.canvasElement.height;Jt++)for(var en=0;en<this.canvasElement.width;en++)oe.data[Jt*this.canvasElement.width*4+4*en+3]>0&&(ln=!0,Jt<ce&&(ce=Jt),en<ye&&(ye=en),Jt>Dt&&(Dt=Jt),en>Ke&&(Ke=en));if(ln){this.left=ye/this.pixelRatio,this.top=ce/this.pixelRatio,this.width=(Ke-ye)/this.pixelRatio,this.height=(Dt-ce)/this.pixelRatio;var nn=document.createElement("canvas");nn.width=Ke-ye,nn.height=Dt-ce,nn.getContext("2d").putImageData(this.canvasContext.getImageData(ye,ce,Ke-ye,Dt-ce),0,0),this.drawingImgUrl=nn.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},se.prototype.setDrawingImage=function(){Pe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),Pe.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},se.prototype.setColor=function(oe){this.color=oe,this.colorChanged(oe)},se.prototype.setLineWidth=function(oe){this.lineWidth=oe},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=Object.assign({drawingImgUrl:this.drawingImgUrl},ve.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){this.createVisual(),ve.prototype.restoreState.call(this,oe),this.drawingImgUrl=oe.drawingImgUrl,this.setDrawingImage()},se.prototype.scale=function(oe,fe){ve.prototype.scale.call(this,oe,fe),this.setDrawingImage()},se.typeName="FreehandMarker",se.title="Freehand marker",se.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>',se}(ht),Ht=function(ve){function se(oe,fe,ye){var ce=ve.call(this,oe,ye||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return ce.typeBoxes=[],ce.currentType=fe,ce.setCurrentType=ce.setCurrentType.bind(ce),ce}return ut(se,ve),se.prototype.getUi=function(){var oe=this,fe=document.createElement("div");fe.style.display="flex",fe.style.overflow="hidden",fe.style.flexGrow="2";for(var ye=function(Dt){var ln="both";switch(Dt){case 0:ln="both";break;case 1:ln="start";break;case 2:ln="end";break;case 3:ln="none"}var Jt=document.createElement("div");if(Jt.style.display="flex",Jt.style.flexGrow="2",Jt.style.alignItems="center",Jt.style.justifyContent="space-between",Jt.style.padding="5px",Jt.style.borderWidth="2px",Jt.style.borderStyle="solid",Jt.style.borderColor=ln===ce.currentType?ce.uiStyleSettings.toolboxAccentColor:"transparent",Jt.addEventListener("click",function(){oe.setCurrentType(ln,Jt)}),fe.appendChild(Jt),ln==="both"||ln==="start"){var en=document.createElement("div");en.style.display="flex",en.style.alignItems="center",en.style.minHeight="20px",en.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(ce.uiStyleSettings!==void 0?ce.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,en.style.marginLeft="5px",Jt.appendChild(en)}var nn=document.createElement("div");nn.style.display="flex",nn.style.alignItems="center",nn.style.minHeight="20px",nn.style.flexGrow="2";var wn=document.createElement("hr");if(wn.style.minWidth="20px",wn.style.border="0px",wn.style.borderTop="3px solid "+(ce.uiStyleSettings!==void 0?ce.uiStyleSettings.toolboxColor:"#eeeeee"),wn.style.flexGrow="2",nn.appendChild(wn),Jt.appendChild(nn),ln==="both"||ln==="end"){var mn=document.createElement("div");mn.style.display="flex",mn.style.alignItems="center",mn.style.minHeight="20px",mn.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(ce.uiStyleSettings!==void 0?ce.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,mn.style.marginRight="5px",Jt.appendChild(mn)}ce.typeBoxes.push(Jt)},ce=this,Ke=0;Ke<4;Ke++)ye(Ke);return fe},se.prototype.setCurrentType=function(oe,fe){var ye=this;this.currentType=oe,this.typeBoxes.forEach(function(ce){ce.style.borderColor=ce===fe?ye.uiStyleSettings!==void 0?ye.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},se}(et),cn=function(ve){function se(oe,fe,ye){var ce=ve.call(this,oe,fe,ye)||this;return ce.arrowType="end",ce.arrowBaseHeight=10,ce.arrowBaseWidth=10,ce.getArrowPoints=ce.getArrowPoints.bind(ce),ce.setArrowType=ce.setArrowType.bind(ce),ce.arrowTypePanel=new Ht("Arrow type","end"),ce.arrowTypePanel.onArrowTypeChanged=ce.setArrowType,ce}return ut(se,ve),se.prototype.ownsTarget=function(oe){return!(!ve.prototype.ownsTarget.call(this,oe)&&oe!==this.arrow1&&oe!==this.arrow2)},se.prototype.getArrowPoints=function(oe,fe){var ye=this.arrowBaseWidth+2*this.strokeWidth,ce=this.arrowBaseHeight+2*this.strokeWidth;return oe-ye/2+","+(fe+ce/2)+" "+oe+","+(fe-ce/2)+" "+(oe+ye/2)+","+(fe+ce/2)},se.prototype.createTips=function(){this.arrow1=Pe.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(Pe.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=Pe.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(Pe.createTransform()),this.visual.appendChild(this.arrow2)},se.prototype.pointerDown=function(oe,fe){ve.prototype.pointerDown.call(this,oe,fe),this.state==="creating"&&this.createTips()},se.prototype.adjustVisual=function(){if(ve.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2){this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",Pe.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),Pe.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]);var oe=0;Math.abs(this.x1-this.x2)>.1&&(oe=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var fe=this.arrow1.transform.baseVal.getItem(0);fe.setRotate(oe,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(fe,0);var ye=this.arrow2.transform.baseVal.getItem(0);ye.setRotate(oe+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ye,0)}},se.prototype.setArrowType=function(oe){this.arrowType=oe,this.adjustVisual(),this.stateChanged()},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=Object.assign({arrowType:this.arrowType},ve.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){ve.prototype.restoreState.call(this,oe);var fe=oe;this.arrowType=fe.arrowType,this.createTips(),this.adjustVisual()},se.typeName="ArrowMarker",se.title="Arrow marker",se.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',se}(Ot),Kt=function(ve){function se(oe,fe,ye){var ce=ve.call(this,oe,fe,ye)||this;return ce.fillColor=ye.defaultFillColor,ce.strokeWidth=0,ce.fillPanel=new mt("Color",ye.defaultColorSet,ye.defaultFillColor),ce.fillPanel.onColorChanged=ce.setFillColor,ce}return ut(se,ve),Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=ve.prototype.getState.call(this);return oe.typeName=se.typeName,oe},se.typeName="CoverMarker",se.title="Cover marker",se.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',se}(Ve),Xt=function(ve){function se(oe,fe,ye,ce){var Ke=ve.call(this,oe,ce||'<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 Ke.opacities=[],Ke.opacityBoxes=[],Ke.opacities=fe,Ke.currentOpacity=ye,Ke.setCurrentOpacity=Ke.setCurrentOpacity.bind(Ke),Ke}return ut(se,ve),se.prototype.getUi=function(){var oe=this,fe=document.createElement("div");return fe.style.display="flex",fe.style.overflow="hidden",fe.style.flexGrow="2",fe.style.justifyContent="space-between",this.opacities.forEach(function(ye){var ce=document.createElement("div");ce.style.display="flex",ce.style.alignItems="center",ce.style.justifyContent="center",ce.style.padding="5px",ce.style.borderWidth="2px",ce.style.borderStyle="solid",ce.style.borderColor=ye===oe.currentOpacity?oe.uiStyleSettings.toolboxAccentColor:"transparent",ce.addEventListener("click",function(){oe.setCurrentOpacity(ye,ce)}),fe.appendChild(ce);var Ke=document.createElement("div");Ke.innerText=100*ye+"%",ce.appendChild(Ke),oe.opacityBoxes.push(ce)}),fe},se.prototype.setCurrentOpacity=function(oe,fe){var ye=this;this.currentOpacity=oe,this.opacityBoxes.forEach(function(ce){ce.style.borderColor=ce===fe?ye.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},se}(et),Wt=function(ve){function se(oe,fe,ye){var ce=ve.call(this,oe,fe,ye)||this;return ce.setOpacity=ce.setOpacity.bind(ce),ce.fillColor=ye.defaultHighlightColor,ce.strokeWidth=0,ce.opacity=ye.defaultHighlightOpacity,ce.fillPanel=new mt("Color",ye.defaultColorSet,ce.fillColor),ce.fillPanel.onColorChanged=ce.setFillColor,ce.opacityPanel=new Xt("Opacity",ye.defaultOpacitySteps,ce.opacity),ce.opacityPanel.onOpacityChanged=ce.setOpacity,ce}return ut(se,ve),se.prototype.setOpacity=function(oe){this.opacity=oe,this.visual&&Pe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=ve.prototype.getState.call(this);return oe.typeName=se.typeName,oe},se.typeName="HighlightMarker",se.title="Highlight marker",se.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>',se}(Kt),ze='<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>',xe='<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>',bt=function(ve){function se(oe,fe,ye){var ce=ve.call(this,oe,fe,ye)||this;return ce.bgColor="transparent",ce.tipPosition={x:0,y:0},ce.tipBase1Position={x:0,y:0},ce.tipBase2Position={x:0,y:0},ce.tipMoving=!1,ce.color=ye.defaultStrokeColor,ce.bgColor=ye.defaultFillColor,ce.fontFamily=ye.defaultFontFamily,ce.defaultSize={x:100,y:30},ce.setBgColor=ce.setBgColor.bind(ce),ce.getTipPoints=ce.getTipPoints.bind(ce),ce.positionTip=ce.positionTip.bind(ce),ce.setTipPoints=ce.setTipPoints.bind(ce),ce.colorPanel=new mt("Text color",ye.defaultColorSet,ce.color,ze),ce.colorPanel.onColorChanged=ce.setColor,ce.bgColorPanel=new mt("Fill color",ye.defaultColorSet,ce.bgColor,xe),ce.bgColorPanel.onColorChanged=ce.setBgColor,ce.fontFamilyPanel=new rt("Font",ye.defaultFontFamilies,ye.defaultFontFamily),ce.fontFamilyPanel.onFontChanged=ce.setFont,ce.tipGrip=new tn,ce.tipGrip.visual.transform.baseVal.appendItem(Pe.createTransform()),ce.controlBox.appendChild(ce.tipGrip.visual),ce}return ut(se,ve),se.prototype.ownsTarget=function(oe){return ve.prototype.ownsTarget.call(this,oe)||this.tipGrip.ownsTarget(oe)||this.tip===oe},se.prototype.createTip=function(){Pe.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=Pe.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},se.prototype.pointerDown=function(oe,fe){this.state==="new"&&ve.prototype.pointerDown.call(this,oe,fe),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(fe)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):ve.prototype.pointerDown.call(this,oe,fe)},se.prototype.pointerUp=function(oe){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,ve.prototype.pointerUp.call(this,oe);else{var fe=this.state==="creating";ve.prototype.pointerUp.call(this,oe),this.setTipPoints(fe),this.positionTip()}},se.prototype.manipulate=function(oe){if(this.tipMoving){var fe=this.unrotatePoint(oe);this.tipPosition={x:fe.x-this.manipulationStartLeft,y:fe.y-this.manipulationStartTop},this.positionTip()}else ve.prototype.manipulate.call(this,oe)},se.prototype.setBgColor=function(oe){this.bgRectangle&&this.tip&&(Pe.setAttributes(this.bgRectangle,[["fill",oe]]),Pe.setAttributes(this.tip,[["fill",oe]])),this.bgColor=oe,this.fillColorChanged(oe)},se.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},se.prototype.setTipPoints=function(oe){oe===void 0&&(oe=!1);var fe=Math.min(this.height/2,15),ye=this.height/5;oe&&(this.tipPosition={x:fe+ye/2,y:this.height+20});var ce=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?ce<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ye=this.width/5,fe=Math.min(this.width/2,15),this.tipBase1Position={x:fe,y:0},this.tipBase2Position={x:fe+ye,y:0}):(this.tipBase1Position={x:0,y:fe},this.tipBase2Position={x:0,y:fe+ye}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?ce<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ye=this.width/5,fe=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-fe-ye,y:0},this.tipBase2Position={x:this.width-fe,y:0}):(this.tipBase1Position={x:this.width,y:fe},this.tipBase2Position={x:this.width,y:fe+ye}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?ce<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ye=this.width/5,fe=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-fe-ye,y:this.height},this.tipBase2Position={x:this.width-fe,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-fe-ye},this.tipBase2Position={x:this.width,y:this.height-fe}):ce<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ye=this.width/5,fe=Math.min(this.width/2,15),this.tipBase1Position={x:fe,y:this.height},this.tipBase2Position={x:fe+ye,y:this.height}):(this.tipBase1Position={x:0,y:this.height-fe},this.tipBase2Position={x:0,y:this.height-fe-ye})},se.prototype.resize=function(oe){ve.prototype.resize.call(this,oe),this.positionTip()},se.prototype.positionTip=function(){Pe.setAttributes(this.tip,[["points",this.getTipPoints()]]);var oe=this.tipGrip.visual.transform.baseVal.getItem(0);oe.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(oe,0)},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),se.prototype.select=function(){this.positionTip(),ve.prototype.select.call(this)},se.prototype.getState=function(){var oe=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},ve.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){var fe=oe;this.bgColor=fe.bgColor,this.tipPosition=fe.tipPosition,ve.prototype.restoreState.call(this,oe),this.createTip(),this.setTipPoints()},se.prototype.scale=function(oe,fe){ve.prototype.scale.call(this,oe,fe),this.tipPosition={x:this.tipPosition.x*oe,y:this.tipPosition.y*fe},this.positionTip()},se.typeName="CalloutMarker",se.title="Callout marker",se.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>',se}(At),pn=function(ve){function se(oe,fe,ye){var ce=ve.call(this,oe,fe,ye)||this;return ce.fillColor="transparent",ce.strokeColor="transparent",ce.strokeWidth=0,ce.strokeDasharray="",ce.opacity=1,ce.strokeColor=ye.defaultColor,ce.strokeWidth=ye.defaultStrokeWidth,ce.strokeDasharray=ye.defaultStrokeDasharray,ce.fillColor=ye.defaultFillColor,ce.setStrokeColor=ce.setStrokeColor.bind(ce),ce.setFillColor=ce.setFillColor.bind(ce),ce.setStrokeWidth=ce.setStrokeWidth.bind(ce),ce.setStrokeDasharray=ce.setStrokeDasharray.bind(ce),ce.setOpacity=ce.setOpacity.bind(ce),ce.createVisual=ce.createVisual.bind(ce),ce.strokePanel=new mt("Line color",Se(ye.defaultColorSet,["transparent"]),ye.defaultColor),ce.strokePanel.onColorChanged=ce.setStrokeColor,ce.fillPanel=new mt("Fill color",Se(ye.defaultColorSet,["transparent"]),ce.fillColor,xe),ce.fillPanel.onColorChanged=ce.setFillColor,ce.strokeWidthPanel=new Ee("Line width",ye.defaultStrokeWidths,ye.defaultStrokeWidth),ce.strokeWidthPanel.onWidthChanged=ce.setStrokeWidth,ce.strokeStylePanel=new Xe("Line style",ye.defaultStrokeDasharrays,ye.defaultStrokeDasharray),ce.strokeStylePanel.onStyleChanged=ce.setStrokeDasharray,ce.opacityPanel=new Xt("Opacity",ye.defaultOpacitySteps,ce.opacity),ce.opacityPanel.onOpacityChanged=ce.setOpacity,ce}return ut(se,ve),se.prototype.ownsTarget=function(oe){return!(!ve.prototype.ownsTarget.call(this,oe)&&oe!==this.visual)},se.prototype.createVisual=function(){this.visual=Pe.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)},se.prototype.pointerDown=function(oe,fe){ve.prototype.pointerDown.call(this,oe,fe),this.state==="new"&&(this.createVisual(),this.moveVisual(oe),this._state="creating")},se.prototype.manipulate=function(oe){ve.prototype.manipulate.call(this,oe)},se.prototype.resize=function(oe){ve.prototype.resize.call(this,oe),this.setSize()},se.prototype.setSize=function(){ve.prototype.setSize.call(this),Pe.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},se.prototype.pointerUp=function(oe){ve.prototype.pointerUp.call(this,oe),this.setSize()},se.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.visual&&Pe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(oe),this.stateChanged()},se.prototype.setFillColor=function(oe){this.fillColor=oe,this.visual&&Pe.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(oe),this.stateChanged()},se.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.visual&&Pe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},se.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.visual&&Pe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},se.prototype.setOpacity=function(oe){this.opacity=oe,this.visual&&Pe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ve.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){var fe=oe;this.fillColor=fe.fillColor,this.strokeColor=fe.strokeColor,this.strokeWidth=fe.strokeWidth,this.strokeDasharray=fe.strokeDasharray,this.opacity=fe.opacity,this.createVisual(),ve.prototype.restoreState.call(this,oe),this.setSize()},se.prototype.scale=function(oe,fe){ve.prototype.scale.call(this,oe,fe),this.setSize()},se.typeName="EllipseMarker",se.title="Ellipse marker",se.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>',se}(ht),Ut=function(ve){function se(oe,fe,ye){return ve.call(this,oe,fe,ye)||this}return ut(se,ve),Object.defineProperty(se.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),se.prototype.ownsTarget=function(oe){return!(!ve.prototype.ownsTarget.call(this,oe)&&oe!==this.tip1&&oe!==this.tip2)},se.prototype.createTips=function(){this.tip1=Pe.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(Pe.createTransform()),this.visual.appendChild(this.tip1),this.tip2=Pe.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(Pe.createTransform()),this.visual.appendChild(this.tip2)},se.prototype.pointerDown=function(oe,fe){ve.prototype.pointerDown.call(this,oe,fe),this.state==="creating"&&this.createTips()},se.prototype.adjustVisual=function(){if(ve.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(Pe.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()]]),Pe.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 oe=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),fe=this.tip1.transform.baseVal.getItem(0);fe.setRotate(oe,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(fe,0);var ye=this.tip2.transform.baseVal.getItem(0);ye.setRotate(oe+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ye,0)}},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=ve.prototype.getState.call(this);return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){ve.prototype.restoreState.call(this,oe),this.createTips(),this.adjustVisual()},se.typeName="MeasurementMarker",se.title="Measurement marker",se.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>',se}(Ot),Ge=function(ve){function se(oe,fe,ye){var ce=ve.call(this,oe,fe,ye)||this;return ce.strokePanel.colors=ye.defaultColorSet,ce.fillColor="transparent",ce}return ut(se,ve),Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=ve.prototype.getState.call(this);return oe.typeName=se.typeName,oe},se.typeName="EllipseFrameMarker",se.title="Ellipse frame marker",se.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>',se}(pn),Ye=function(){function ve(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(ve.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),ve.prototype.addUndoStep=function(se){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(se)||(this.undoStack.push(se),JSON.stringify(this.lastRedoStep)!==JSON.stringify(se)&&this.redoStack.splice(0,this.redoStack.length))},ve.prototype.replaceLastUndoStep=function(se){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=se)},ve.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},ve.prototype.undo=function(){if(this.undoStack.length>1){var se=this.undoStack.pop();return se!==void 0&&this.redoStack.push(se),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},ve.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},ve}(),It=function(ve){function se(oe,fe,ye){var ce=ve.call(this,oe,fe,ye)||this;return ce.strokeColor="transparent",ce.strokeWidth=0,ce.strokeDasharray="",ce.curveX=0,ce.curveY=0,ce.manipulationStartCurveX=0,ce.manipulationStartCurveY=0,ce.setStrokeColor=ce.setStrokeColor.bind(ce),ce.setStrokeWidth=ce.setStrokeWidth.bind(ce),ce.setStrokeDasharray=ce.setStrokeDasharray.bind(ce),ce.positionGrips=ce.positionGrips.bind(ce),ce.addControlGrips=ce.addControlGrips.bind(ce),ce.adjustVisual=ce.adjustVisual.bind(ce),ce.setupControlBox=ce.setupControlBox.bind(ce),ce.resize=ce.resize.bind(ce),ce.strokeColor=ye.defaultColor,ce.strokeWidth=ye.defaultStrokeWidth,ce.strokeDasharray=ye.defaultStrokeDasharray,ce.strokePanel=new mt("Line color",ye.defaultColorSet,ye.defaultColor),ce.strokePanel.onColorChanged=ce.setStrokeColor,ce.strokeWidthPanel=new Ee("Line width",ye.defaultStrokeWidths,ye.defaultStrokeWidth),ce.strokeWidthPanel.onWidthChanged=ce.setStrokeWidth,ce.strokeStylePanel=new Xe("Line style",ye.defaultStrokeDasharrays,ye.defaultStrokeDasharray),ce.strokeStylePanel.onStyleChanged=ce.setStrokeDasharray,ce}return ut(se,ve),se.prototype.ownsTarget=function(oe){return!(!ve.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.selectorCurve&&oe!==this.visibleCurve&&!this.curveGrip.ownsTarget(oe))},se.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},se.prototype.createVisual=function(){this.visual=Pe.createGroup(),this.selectorCurve=Pe.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=Pe.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)},se.prototype.pointerDown=function(oe,fe){ve.prototype.pointerDown.call(this,oe,fe),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=oe.x,this.curveY=oe.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(fe)&&(this.activeGrip=this.curveGrip,this._state="resize")},se.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),Pe.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),Pe.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),Pe.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},se.prototype.setupControlBox=function(){ve.prototype.setupControlBox.call(this),this.curveControlLine1=Pe.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=Pe.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)},se.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,ve.prototype.addControlGrips.call(this)},se.prototype.positionGrips=function(){ve.prototype.positionGrips.call(this);var oe=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-oe/2,this.curveY-oe/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()))},se.prototype.manipulate=function(oe){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+oe.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+oe.y-this.manipulationStartY),ve.prototype.manipulate.call(this,oe)},se.prototype.resize=function(oe){this.activeGrip===this.curveGrip&&(this.curveX=oe.x,this.curveY=oe.y),ve.prototype.resize.call(this,oe),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},se.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.adjustVisual(),this.colorChanged(oe)},se.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.adjustVisual()},se.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.adjustVisual()},se.prototype.scale=function(oe,fe){this.curveX=this.curveX*oe,this.curveY=this.curveY*fe,ve.prototype.scale.call(this,oe,fe)},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},ve.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){ve.prototype.restoreState.call(this,oe);var fe=oe;this.strokeColor=fe.strokeColor,this.strokeWidth=fe.strokeWidth,this.strokeDasharray=fe.strokeDasharray,this.curveX=fe.curveX,this.curveY=fe.curveY,this.createVisual(),this.adjustVisual()},se.typeName="CurveMarker",se.title="Curve marker",se.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>',se}(Ue),Mn=function(ve){function se(oe,fe,ye){var ce=ve.call(this,oe,fe,ye)||this;return ce.fillColor="transparent",ce.strokeColor="transparent",ce.strokeWidth=0,ce.strokeDasharray="",ce.textColor="transparent",ce.fontSize="1rem",ce.isMoved=!1,ce.captionText="Caption",ce.PADDING=5,ce.captionBoxWidth=0,ce.captionBoxHeight=0,ce.strokeColor=ye.defaultColor,ce.strokeWidth=ye.defaultStrokeWidth,ce.strokeDasharray=ye.defaultStrokeDasharray,ce.fillColor=ye.defaultFillColor,ce.textColor=ye.defaultStrokeColor,ce.fontFamily=ye.defaultFontFamily,ce.fontSize=ye.defaultCaptionFontSize,ce.captionText=ye.defaultCaptionText,ce.setStrokeColor=ce.setStrokeColor.bind(ce),ce.setFillColor=ce.setFillColor.bind(ce),ce.setStrokeWidth=ce.setStrokeWidth.bind(ce),ce.setStrokeDasharray=ce.setStrokeDasharray.bind(ce),ce.createVisual=ce.createVisual.bind(ce),ce.sizeCaption=ce.sizeCaption.bind(ce),ce.setCaptionText=ce.setCaptionText.bind(ce),ce.showTextEditor=ce.showTextEditor.bind(ce),ce.positionTextEditor=ce.positionTextEditor.bind(ce),ce.finishTextEditing=ce.finishTextEditing.bind(ce),ce.setFont=ce.setFont.bind(ce),ce.setTextColor=ce.setTextColor.bind(ce),ce.strokePanel=new mt("Line color",Se(ye.defaultColorSet,["transparent"]),ce.strokeColor),ce.strokePanel.onColorChanged=ce.setStrokeColor,ce.fillPanel=new mt("Fill color",Se(ye.defaultColorSet,["transparent"]),ce.fillColor,xe),ce.fillPanel.onColorChanged=ce.setFillColor,ce.strokeWidthPanel=new Ee("Line width",ye.defaultStrokeWidths,ye.defaultStrokeWidth),ce.strokeWidthPanel.onWidthChanged=ce.setStrokeWidth,ce.strokeStylePanel=new Xe("Line style",ye.defaultStrokeDasharrays,ye.defaultStrokeDasharray),ce.strokeStylePanel.onStyleChanged=ce.setStrokeDasharray,ce.fontFamilyPanel=new rt("Font",ye.defaultFontFamilies,ye.defaultFontFamily),ce.fontFamilyPanel.onFontChanged=ce.setFont,ce.textColorPanel=new mt("Text color",ye.defaultColorSet,ce.textColor,ze),ce.textColorPanel.onColorChanged=ce.setTextColor,ce}return ut(se,ve),se.prototype.ownsTarget=function(oe){return!(!ve.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.frame&&oe!==this.captionBg&&oe!==this.captionElement)},se.prototype.createVisual=function(){this.visual=Pe.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=Pe.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=Pe.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=Pe.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()},se.prototype.setCaptionText=function(oe){this.captionText=oe,this.captionElement.textContent=this.captionText,this.sizeCaption()},se.prototype.pointerDown=function(oe,fe){ve.prototype.pointerDown.call(this,oe,fe),this.isMoved=!1,this.pointerDownPoint=oe,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(oe),this._state="creating")},se.prototype.manipulate=function(oe){ve.prototype.manipulate.call(this,oe),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(oe.x-this.pointerDownPoint.x)>5||Math.abs(oe.y-this.pointerDownPoint.y)>5)},se.prototype.resize=function(oe){ve.prototype.resize.call(this,oe),this.setSize()},se.prototype.sizeCaption=function(){var oe=this.captionElement.getBBox();this.captionText.trim()!==""?(this.captionBoxWidth=oe.width+2*this.PADDING,this.captionBoxHeight=oe.height+2*this.PADDING):(this.captionBoxWidth=0,this.captionBoxHeight=0),Pe.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')"]]),Pe.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')"]])},se.prototype.showTextEditor=function(){var oe=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditBox=document.createElement("input"),this.textEditBox.style.position="absolute",this.textEditBox.style.width=this.width+"px",this.captionBoxHeight>0&&(this.textEditBox.style.height=this.captionBoxHeight+"px"),this.textEditBox.style.fontSize=this.fontSize,this.textEditBox.style.fontFamily=this.fontFamily,this.textEditBox.style.backgroundColor=this.fillColor,this.textEditBox.style.color=this.textColor,this.textEditBox.style.borderWidth="0",this.textEditBox.setAttribute("value",this.captionText),this.textEditBox.select(),this.textEditDiv.appendChild(this.textEditBox),this.overlayContainer.appendChild(this.textEditDiv),this.textEditBox.addEventListener("pointerup",function(fe){fe.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(fe){fe.key==="Enter"&&oe.finishTextEditing(oe.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(fe){fe.cancelBubble=!0}),this.textEditBox.addEventListener("blur",function(){oe.finishTextEditing(oe.textEditBox.value)}),this.textEditDiv.addEventListener("pointerup",function(){oe.finishTextEditing(oe.textEditBox.value)}),this.positionTextEditor(),this.textEditBox.focus()},se.prototype.positionTextEditor=function(){this.state==="edit"&&(this.textEditBox===void 0?this.showTextEditor():(this.textEditBox.style.left=this.left+"px",this.textEditBox.style.top=this.top+"px",this.textEditBox.style.transform="rotate("+this.rotationAngle+"deg)",this.textEditBox.style.transformOrigin=this.width/2+"px "+this.height/2+"px"))},se.prototype.finishTextEditing=function(oe){this.setCaptionText(oe.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},se.prototype.setFont=function(oe){this.captionElement&&Pe.setAttributes(this.captionElement,[["font-family",oe]]),this.fontFamily=oe,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},se.prototype.setTextColor=function(oe){this.captionElement&&Pe.setAttributes(this.captionElement,[["fill",oe]]),this.textColor=oe,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},se.prototype.setSize=function(){ve.prototype.setSize.call(this),Pe.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},se.prototype.pointerUp=function(oe){ve.prototype.pointerUp.call(this,oe),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},se.prototype.dblClick=function(oe,fe){ve.prototype.dblClick.call(this,oe,fe),this.showTextEditor()},se.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.frame&&Pe.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(oe),this.stateChanged()},se.prototype.setFillColor=function(oe){this.fillColor=oe,this.captionBg&&Pe.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(oe),this.stateChanged()},se.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.frame&&Pe.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},se.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.frame&&Pe.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=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},ve.prototype.getState.call(this));return oe.typeName=this.typeName,oe},se.prototype.restoreState=function(oe){var fe=oe;this.fillColor=fe.fillColor,this.strokeColor=fe.strokeColor,this.strokeWidth=fe.strokeWidth,this.strokeDasharray=fe.strokeDasharray,this.textColor=fe.textColor,this.fontFamily=fe.fontFamily,this.captionText=fe.captionText,this.fontSize=fe.fontSize,this.createVisual(),ve.prototype.restoreState.call(this,oe),this.setSize()},se.prototype.scale=function(oe,fe){ve.prototype.scale.call(this,oe,fe),this.setSize()},se.typeName="CaptionFrameMarker",se.title="Caption frame marker",se.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>',se}(ht),jt=function(){function ve(se,oe){oe===void 0&&(oe=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=se,this.cancelable=oe}return Object.defineProperty(ve.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),ve.prototype.preventDefault=function(){this._defaultPrevented=!0},ve}(),bn=function(ve){function se(oe,fe,ye){var ce=ve.call(this,oe,!1)||this;return ce.dataUrl=fe,ce.state=ye,ce}return ut(se,ve),se}(jt),Vt=function(ve){function se(oe,fe,ye){ye===void 0&&(ye=!1);var ce=ve.call(this,oe,ye)||this;return ce.marker=fe,ce}return ut(se,ve),se}(jt),Zt=function(){function ve(){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 ve.prototype.addEventListener=function(se,oe){this[se].push(oe)},ve.prototype.removeEventListener=function(se,oe){var fe=this[se].indexOf(oe);fe>-1&&this[se].splice(fe,1)},ve}(),zt=function(){function ve(se){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new vt,this._isOpen=!1,this.undoRedoManager=new Ye,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 Zt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=ve.instanceCounter++,this.styles=new Fe(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=se,this.targetRoot=document.body,this.width=se.clientWidth,this.height=se.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(ve.prototype,"ALL_MARKER_TYPES",{get:function(){return[at,qe,cn,At,Ge,pn,Wt,bt,Ut,Kt,Ot,It,Mn]},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[at,qe,cn,At,pn,Wt,bt]},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"BASIC_MARKER_TYPES",{get:function(){return[at,qe,cn,At,Wt]},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(se){var oe=this;this._availableMarkerTypes.splice(0),se.forEach(function(fe){if(typeof fe=="string"){var ye=oe.ALL_MARKER_TYPES.find(function(ce){return ce.typeName===fe});ye!==void 0&&oe._availableMarkerTypes.push(ye)}else oe._availableMarkerTypes.push(fe)})},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ve.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(se){this._zoomLevel=se,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(ve.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),ve.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Ne.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},ve.prototype.show=function(){var se=this;this.styles.styleSheetRoot===void 0&&ke.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ke.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(oe){return oe(new jt(se))})},ve.prototype.render=function(){return $e(this,void 0,void 0,function(){var se;return ct(this,function(oe){switch(oe.label){case 0:return this.setCurrentMarker(),(se=new Ce).naturalSize=this.renderAtNaturalSize,se.imageType=this.renderImageType,se.imageQuality=this.renderImageQuality,se.markersOnly=this.renderMarkersOnly,se.width=this.renderWidth,se.height=this.renderHeight,[4,se.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return oe.sent(),[4,se.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,oe.sent()]}})})},ve.prototype.close=function(se){var oe=this;if(se===void 0&&(se=!1),this.isOpen){var fe=!1;se||this.eventListeners.beforeclose.forEach(function(ye){var ce=new jt(oe,!0);ye(ce),ce.defaultPrevented&&(fe=!0)}),fe||(this.coverDiv&&this.closeUI(),this.targetObserver&&(this.targetObserver.unobserve(this.target),this.targetObserver.unobserve(this.editorCanvas)),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(ye){return ye(new jt(oe))}),this.detachEvents(),this._isOpen=!1)}},ve.prototype.addMarkersToToolbar=function(){for(var se,oe=[],fe=0;fe<arguments.length;fe++)oe[fe]=arguments[fe];(se=this._availableMarkerTypes).push.apply(se,oe)},ve.prototype.addRenderEventListener=function(se){this.addEventListener("render",function(oe){se(oe.dataUrl,oe.state)})},ve.prototype.removeRenderEventListener=function(se){},ve.prototype.addCloseEventListener=function(se){this.addEventListener("close",function(){se()})},ve.prototype.removeCloseEventListener=function(se){},ve.prototype.setupResizeObserver=function(){var se=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){se.resize(se.target.clientWidth,se.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return se.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},ve.prototype.onPopupTargetResize=function(){var se=1*this.target.clientWidth/this.target.clientHeight,oe=this.editorCanvas.clientWidth/se>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*se:this.editorCanvas.clientWidth,fe=oe<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/se;this.resize(oe,fe)},ve.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ve.prototype.resize=function(se,oe){this._isResizing=!0;var fe=se/this.imageWidth,ye=oe/this.imageHeight;this.imageWidth=Math.round(se),this.imageHeight=Math.round(oe),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",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(fe,ye),this._isResizing=!1},ve.prototype.scaleMarkers=function(se,oe){var fe,ye=this;this._currentMarker&&this._currentMarker instanceof At?this._currentMarker.scale(se,oe):(fe=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(ce){ce!==ye._currentMarker&&ce.scale(se,oe)}),fe!==void 0&&this.setCurrentMarker(fe)},ve.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"},ve.prototype.setTopLeft=function(){var se=this.editingTarget.getBoundingClientRect(),oe=this.editorCanvas.getBoundingClientRect();this.left=se.left-oe.left,this.top=se.top-oe.top},ve.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)},ve.prototype.addDefs=function(){for(var se,oe=[],fe=0;fe<arguments.length;fe++)oe[fe]=arguments[fe];this.defs=Pe.createDefs(),this.addDefsToImage(),(se=this.defs).append.apply(se,oe)},ve.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},ve.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)},ve.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},ve.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},ve.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)},ve.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},ve.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)},ve.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 se=document.createElement("a");se.href="https://markerjs.com/",se.target="_blank",se.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>',se.title="Powered by marker.js",se.style.display="grid",se.style.alignItems="center",se.style.justifyItems="center",se.style.padding="3px",se.style.width="20px",se.style.height="20px",this.logoUI.appendChild(se),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},ve.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},ve.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"},ve.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ve.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var se=this.settings.uiOffsetTop!==void 0?this.target.offsetTop+this.settings.uiOffsetTop:this.target.offsetTop>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=se+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new je(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.settings.uiOffsetTop===void 0&&this.target.offsetTop<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new kt(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},ve.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ve.prototype.removeMarker=function(se){this.markerImage.removeChild(se.container),this.markers.indexOf(se)>-1&&this.markers.splice(this.markers.indexOf(se),1),se.dispose()},ve.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},ve.prototype.toolbarButtonClicked=function(se,oe){if(se==="marker"&&oe!==void 0)this.createNewMarker(oe);else if(se==="action")switch(oe){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},ve.prototype.deleteSelectedMarker=function(){var se=this;if(this._currentMarker!==void 0){var oe=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ye){var ce=new Vt(se,se._currentMarker,!0);ye(ce),ce.defaultPrevented&&(oe=!0)}),!oe){var fe=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(ye){return ye(new Vt(se,fe))})}}},ve.prototype.clear=function(){var se=this,oe=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ke){var Dt=new Vt(se,void 0,!0);Ke(Dt),Dt.defaultPrevented&&(oe=!0)}),!oe)){this.setCurrentMarker();for(var fe=function(Ke){var Dt=ye.markers[Ke];ye.setCurrentMarker(ye.markers[Ke]),ye._currentMarker.dispose(),ye.markerImage.removeChild(ye._currentMarker.container),ye.markers.splice(ye.markers.indexOf(ye._currentMarker),1),ye.eventListeners.markerdelete.forEach(function(ln){return ln(new Vt(se,Dt))})},ye=this,ce=this.markers.length-1;ce>=0;ce--)fe(ce);this.addUndoStep()}},Object.defineProperty(ve.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),ve.prototype.showNotesEditor=function(){var se;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(se=this._currentMarker.notes)!==null&&se!==void 0?se:"",this.overlayContainer.appendChild(this.notesArea))},ve.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},ve.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},ve.prototype.addUndoStep=function(){var se=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var oe=this.getState(),fe=this.undoRedoManager.getLastUndoStep();if(!fe||fe.width===oe.width&&fe.height===oe.height){var ye=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(oe),ye<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(ce){return ce(new jt(se))})}else this.undoRedoManager.replaceLastUndoStep(oe),this.eventListeners.statechange.forEach(function(ce){return ce(new jt(se))})}},ve.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},ve.prototype.undoStep=function(){var se=this,oe=this.undoRedoManager.undo();oe!==void 0&&(this.restoreState(oe),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(fe){return fe(new jt(se))}))},ve.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},ve.prototype.redoStep=function(){var se=this,oe=this.undoRedoManager.redo();oe!==void 0&&(this.restoreState(oe),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(fe){return fe(new jt(se))}))},ve.prototype.stepZoom=function(){var se=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=se<this.zoomSteps.length-1?this.zoomSteps[se+1]:this.zoomSteps[0]},ve.prototype.panTo=function(se){this.contentDiv.scrollBy({left:this.prevPanPoint.x-se.x,top:this.prevPanPoint.y-se.y}),this.prevPanPoint=se},ve.prototype.startRenderAndClose=function(){return $e(this,void 0,void 0,function(){var se,oe,fe=this;return ct(this,function(ye){switch(ye.label){case 0:return[4,this.render()];case 1:return se=ye.sent(),oe=this.getState(),this.eventListeners.render.forEach(function(ce){return ce(new bn(fe,se,oe))}),this.close(!0),[2]}})})},ve.prototype.getState=function(se){se===!0&&this.setCurrentMarker();var oe={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(fe){return oe.markers.push(fe.getState())}),oe},ve.prototype.restoreState=function(se){var oe=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);se.markers.forEach(function(fe){var ye=oe._availableMarkerTypes.find(function(Ke){return Ke.typeName===fe.typeName});if(ye!==void 0){var ce=oe.addNewMarker(ye);ce.restoreState(fe),oe.markers.push(ce)}}),se.width&&se.height&&(se.width!==this.imageWidth||se.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/se.width,this.imageHeight/se.height),this.eventListeners.restorestate.forEach(function(fe){return fe(new jt(oe))})},ve.prototype.addNewMarker=function(se){var oe=Pe.createGroup();return this.markerImage.appendChild(oe),new se(oe,this.overlayContainer,this.settings)},ve.prototype.createNewMarker=function(se){var oe,fe=this;(oe=typeof se=="string"?this._availableMarkerTypes.find(function(ye){return ye.typeName===se}):se)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(oe),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(oe.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ye){return ye(new Vt(fe,fe._currentMarker))}))},ve.prototype.markerCreated=function(se){var oe=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(se),this.setCurrentMarker(se),se instanceof qe&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(qe):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(fe){return fe(new Vt(oe,oe._currentMarker))})},ve.prototype.colorChanged=function(se){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=se,this.settings.defaultStrokeColor=se)},ve.prototype.fillColorChanged=function(se){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=se)},ve.prototype.markerStateChanged=function(se){var oe=this;this.eventListeners.markerchange.forEach(function(fe){return fe(new Vt(oe,se))})},ve.prototype.setCurrentMarker=function(se){var oe=this;this._currentMarker!==se&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(fe){return fe(new Vt(oe,oe._currentMarker))})),this._currentMarker=se,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(fe){return fe(new Vt(oe,oe._currentMarker))}))},ve.prototype.onPointerDown=function(se){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||se.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var oe=this.markers.find(function(fe){return fe.ownsTarget(se.target)});oe!==void 0?(this.setCurrentMarker(oe),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(se.clientX,se.clientY),se.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:se.clientX,y:se.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(se.clientX,se.clientY))},ve.prototype.onDblClick=function(se){if(this._isFocused||this.focus(),this.mode==="select"){var oe=this.markers.find(function(fe){return fe.ownsTarget(se.target)});oe!==void 0&&oe!==this._currentMarker&&this.setCurrentMarker(oe),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(se.clientX,se.clientY),se.target):this.setCurrentMarker()}},ve.prototype.onPointerMove=function(se){this.touchPoints!==1&&se.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||se.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(se.clientX,se.clientY)):this.zoomLevel>1&&this.panTo({x:se.clientX,y:se.clientY}))},ve.prototype.onPointerUp=function(se){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(se.clientX,se.clientY)),this.isDragging=!1,this.addUndoStep()},ve.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},ve.prototype.onKeyUp=function(se){this._currentMarker===void 0||this.notesArea!==void 0||se.key!=="Delete"&&se.key!=="Backspace"||this.deleteSelectedMarker()},ve.prototype.clientToLocalCoordinates=function(se,oe){var fe=this.markerImage.getBoundingClientRect();return{x:(se-fe.left)/this.zoomLevel,y:(oe-fe.top)/this.zoomLevel}},ve.prototype.onWindowResize=function(){this.positionUI()},ve.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var se=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=se+"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()},ve.prototype.addLicenseKey=function(se){Ne.addKey(se)},ve.prototype.addEventListener=function(se,oe){this.eventListeners.addEventListener(se,oe)},ve.prototype.removeEventListener=function(se,oe){this.eventListeners.removeEventListener(se,oe)},ve.prototype.renderState=function(se){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(se),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(ve.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),ve.prototype.focus=function(){var se=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(oe){return oe(new jt(se))}))},ve.prototype.blur=function(){var se=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(oe){return oe(new jt(se))}))},ve.instanceCounter=0,ve}()},5630:function(kn,dn,de){"use strict";var pe=de(60499),ut=de(85899),$e=de(18642),ct=de(72190),Se=de(42244),Pe=de(92310),Ne=de.n(Pe),Ce=de(18929),ke=de(59301),Fe=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],gt=(0,ke.forwardRef)(function(Oe,je){var kt,et=Oe.prefixCls,mt=et===void 0?"rc-checkbox":et,st=Oe.className,Rt=Oe.style,tn=Oe.checked,nt=Oe.disabled,ht=Oe.defaultChecked,Ve=ht===void 0?!1:ht,Ee=Oe.type,Xe=Ee===void 0?"checkbox":Ee,at=Oe.title,vt=Oe.onChange,Ue=(0,Se.Z)(Oe,Fe),Ot=(0,ke.useRef)(null),rt=(0,Ce.Z)(Ve,{value:tn}),At=(0,ct.Z)(rt,2),qe=At[0],Ht=At[1];(0,ke.useImperativeHandle)(je,function(){return{focus:function(){var Wt;(Wt=Ot.current)===null||Wt===void 0||Wt.focus()},blur:function(){var Wt;(Wt=Ot.current)===null||Wt===void 0||Wt.blur()},input:Ot.current}});var cn=Ne()(mt,st,(kt={},(0,$e.Z)(kt,"".concat(mt,"-checked"),qe),(0,$e.Z)(kt,"".concat(mt,"-disabled"),nt),kt)),Kt=function(Wt){nt||("checked"in Oe||Ht(Wt.target.checked),vt==null||vt({target:(0,ut.Z)((0,ut.Z)({},Oe),{},{type:Xe,checked:Wt.target.checked}),stopPropagation:function(){Wt.stopPropagation()},preventDefault:function(){Wt.preventDefault()},nativeEvent:Wt.nativeEvent}))};return ke.createElement("span",{className:cn,title:at,style:Rt},ke.createElement("input",(0,pe.Z)({},Ue,{className:"".concat(mt,"-input"),ref:Ot,onChange:Kt,disabled:nt,checked:!!qe,type:Xe})),ke.createElement("span",{className:"".concat(mt,"-inner")}))});dn.Z=gt},31561:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return Xe}});var pe=de(60499),ut=de(18642),$e=de(72190),ct=de(42244),Se=de(35593),Pe=de(92310),Ne=de.n(Pe),Ce=de(8654),ke=de(59301),Fe=de(10228),gt=de(16089),Oe=Fe.Z.ESC,je=Fe.Z.TAB;function kt(at){var vt=at.visible,Ue=at.triggerRef,Ot=at.onVisibleChange,rt=at.autoFocus,At=at.overlayRef,qe=ke.useRef(!1),Ht=function(){if(vt){var Wt,ze;(Wt=Ue.current)===null||Wt===void 0||(ze=Wt.focus)===null||ze===void 0||ze.call(Wt),Ot==null||Ot(!1)}},cn=function(){var Wt;return(Wt=At.current)!==null&&Wt!==void 0&&Wt.focus?(At.current.focus(),qe.current=!0,!0):!1},Kt=function(Wt){switch(Wt.keyCode){case Oe:Ht();break;case je:{var ze=!1;qe.current||(ze=cn()),ze?Wt.preventDefault():Ht();break}}};ke.useEffect(function(){return vt?(window.addEventListener("keydown",Kt),rt&&(0,gt.Z)(cn,3),function(){window.removeEventListener("keydown",Kt),qe.current=!1}):function(){qe.current=!1}},[vt])}var et=(0,ke.forwardRef)(function(at,vt){var Ue=at.overlay,Ot=at.arrow,rt=at.prefixCls,At=(0,ke.useMemo)(function(){var Ht;return typeof Ue=="function"?Ht=Ue():Ht=Ue,Ht},[Ue]),qe=(0,Ce.sQ)(vt,At==null?void 0:At.ref);return ke.createElement(ke.Fragment,null,Ot&&ke.createElement("div",{className:"".concat(rt,"-arrow")}),ke.cloneElement(At,{ref:(0,Ce.Yr)(At)?qe:void 0}))}),mt=et,st={adjustX:1,adjustY:1},Rt=[0,0],tn={topLeft:{points:["bl","tl"],overflow:st,offset:[0,-4],targetOffset:Rt},top:{points:["bc","tc"],overflow:st,offset:[0,-4],targetOffset:Rt},topRight:{points:["br","tr"],overflow:st,offset:[0,-4],targetOffset:Rt},bottomLeft:{points:["tl","bl"],overflow:st,offset:[0,4],targetOffset:Rt},bottom:{points:["tc","bc"],overflow:st,offset:[0,4],targetOffset:Rt},bottomRight:{points:["tr","br"],overflow:st,offset:[0,4],targetOffset:Rt}},nt=tn,ht=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function Ve(at,vt){var Ue,Ot=at.arrow,rt=Ot===void 0?!1:Ot,At=at.prefixCls,qe=At===void 0?"rc-dropdown":At,Ht=at.transitionName,cn=at.animation,Kt=at.align,Xt=at.placement,Wt=Xt===void 0?"bottomLeft":Xt,ze=at.placements,xe=ze===void 0?nt:ze,bt=at.getPopupContainer,pn=at.showAction,Ut=at.hideAction,Ge=at.overlayClassName,Ye=at.overlayStyle,It=at.visible,Mn=at.trigger,jt=Mn===void 0?["hover"]:Mn,bn=at.autoFocus,Vt=at.overlay,Zt=at.children,zt=at.onVisibleChange,ve=(0,ct.Z)(at,ht),se=ke.useState(),oe=(0,$e.Z)(se,2),fe=oe[0],ye=oe[1],ce="visible"in at?It:fe,Ke=ke.useRef(null),Dt=ke.useRef(null),ln=ke.useRef(null);ke.useImperativeHandle(vt,function(){return Ke.current});var Jt=function(tt){ye(tt),zt==null||zt(tt)};kt({visible:ce,triggerRef:ln,onVisibleChange:Jt,autoFocus:bn,overlayRef:Dt});var en=function(tt){var Re=at.onOverlayClick;ye(!1),Re&&Re(tt)},nn=function(){return ke.createElement(mt,{ref:Dt,overlay:Vt,prefixCls:qe,arrow:rt})},wn=function(){return typeof Vt=="function"?nn:nn()},mn=function(){var tt=at.minOverlayWidthMatchTrigger,Re=at.alignPoint;return"minOverlayWidthMatchTrigger"in at?tt:!Re},En=function(){var tt=at.openClassName;return tt!==void 0?tt:"".concat(qe,"-open")},yt=ke.cloneElement(Zt,{className:Ne()((Ue=Zt.props)===null||Ue===void 0?void 0:Ue.className,ce&&En()),ref:(0,Ce.Yr)(Zt)?(0,Ce.sQ)(ln,Zt.ref):void 0}),gn=Ut;return!gn&&jt.indexOf("contextMenu")!==-1&&(gn=["click"]),ke.createElement(Se.Z,(0,pe.Z)({builtinPlacements:xe},ve,{prefixCls:qe,ref:Ke,popupClassName:Ne()(Ge,(0,ut.Z)({},"".concat(qe,"-show-arrow"),rt)),popupStyle:Ye,action:jt,showAction:pn,hideAction:gn,popupPlacement:Wt,popupAlign:Kt,popupTransitionName:Ht,popupAnimation:cn,popupVisible:ce,stretch:mn()?"minWidth":"",popup:wn(),onPopupVisibleChange:Jt,onPopupClick:en,getPopupContainer:bt}),yt)}var Ee=ke.forwardRef(Ve),Xe=Ee},93681:function(kn,dn,de){"use strict";de.r(dn),de.d(dn,{BaseInput:function(){return Fe},default:function(){return tn}});var pe=de(60499),ut=de(85899),$e=de(18642),ct=de(43749),Se=de(92310),Pe=de.n(Se),Ne=de(59301),Ce=de(5643),ke=function(ht){var Ve,Ee,Xe=ht.inputElement,at=ht.prefixCls,vt=ht.prefix,Ue=ht.suffix,Ot=ht.addonBefore,rt=ht.addonAfter,At=ht.className,qe=ht.style,Ht=ht.disabled,cn=ht.readOnly,Kt=ht.focused,Xt=ht.triggerFocus,Wt=ht.allowClear,ze=ht.value,xe=ht.handleReset,bt=ht.hidden,pn=ht.classes,Ut=ht.classNames,Ge=ht.dataAttrs,Ye=ht.styles,It=ht.components,Mn=(It==null?void 0:It.affixWrapper)||"span",jt=(It==null?void 0:It.groupWrapper)||"span",bn=(It==null?void 0:It.wrapper)||"span",Vt=(It==null?void 0:It.groupAddon)||"span",Zt=(0,Ne.useRef)(null),zt=function(nn){var wn;(wn=Zt.current)!==null&&wn!==void 0&&wn.contains(nn.target)&&(Xt==null||Xt())},ve=function(){var nn;if(!Wt)return null;var wn=!Ht&&!cn&&ze,mn="".concat(at,"-clear-icon"),En=(0,ct.Z)(Wt)==="object"&&Wt!==null&&Wt!==void 0&&Wt.clearIcon?Wt.clearIcon:"\u2716";return Ne.createElement("span",{onClick:xe,onMouseDown:function(gn){return gn.preventDefault()},className:Pe()(mn,(nn={},(0,$e.Z)(nn,"".concat(mn,"-hidden"),!wn),(0,$e.Z)(nn,"".concat(mn,"-has-suffix"),!!Ue),nn)),role:"button",tabIndex:-1},En)},se=(0,Ne.cloneElement)(Xe,{value:ze,hidden:bt,className:Pe()((Ve=Xe.props)===null||Ve===void 0?void 0:Ve.className,!(0,Ce.X3)(ht)&&!(0,Ce.He)(ht)&&At)||null,style:(0,ut.Z)((0,ut.Z)({},(Ee=Xe.props)===null||Ee===void 0?void 0:Ee.style),!(0,Ce.X3)(ht)&&!(0,Ce.He)(ht)?qe:{})});if((0,Ce.X3)(ht)){var oe,fe="".concat(at,"-affix-wrapper"),ye=Pe()(fe,(oe={},(0,$e.Z)(oe,"".concat(fe,"-disabled"),Ht),(0,$e.Z)(oe,"".concat(fe,"-focused"),Kt),(0,$e.Z)(oe,"".concat(fe,"-readonly"),cn),(0,$e.Z)(oe,"".concat(fe,"-input-with-clear-btn"),Ue&&Wt&&ze),oe),!(0,Ce.He)(ht)&&At,pn==null?void 0:pn.affixWrapper,Ut==null?void 0:Ut.affixWrapper),ce=(Ue||Wt)&&Ne.createElement("span",{className:Pe()("".concat(at,"-suffix"),Ut==null?void 0:Ut.suffix),style:Ye==null?void 0:Ye.suffix},ve(),Ue);se=Ne.createElement(Mn,(0,pe.Z)({className:ye,style:(0,ut.Z)((0,ut.Z)({},(0,Ce.He)(ht)?void 0:qe),Ye==null?void 0:Ye.affixWrapper),hidden:!(0,Ce.He)(ht)&&bt,onClick:zt},Ge==null?void 0:Ge.affixWrapper,{ref:Zt}),vt&&Ne.createElement("span",{className:Pe()("".concat(at,"-prefix"),Ut==null?void 0:Ut.prefix),style:Ye==null?void 0:Ye.prefix},vt),(0,Ne.cloneElement)(Xe,{value:ze,hidden:null}),ce)}if((0,Ce.He)(ht)){var Ke="".concat(at,"-group"),Dt="".concat(Ke,"-addon"),ln=Pe()("".concat(at,"-wrapper"),Ke,pn==null?void 0:pn.wrapper),Jt=Pe()("".concat(at,"-group-wrapper"),At,pn==null?void 0:pn.group);return Ne.createElement(jt,{className:Jt,style:qe,hidden:bt},Ne.createElement(bn,{className:ln},Ot&&Ne.createElement(Vt,{className:Dt},Ot),(0,Ne.cloneElement)(se,{hidden:null}),rt&&Ne.createElement(Vt,{className:Dt},rt)))}return se},Fe=ke,gt=de(77654),Oe=de(72190),je=de(42244),kt=de(18929),et=de(2738),mt=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","classes","classNames","styles"],st=(0,Ne.forwardRef)(function(nt,ht){var Ve=nt.autoComplete,Ee=nt.onChange,Xe=nt.onFocus,at=nt.onBlur,vt=nt.onPressEnter,Ue=nt.onKeyDown,Ot=nt.prefixCls,rt=Ot===void 0?"rc-input":Ot,At=nt.disabled,qe=nt.htmlSize,Ht=nt.className,cn=nt.maxLength,Kt=nt.suffix,Xt=nt.showCount,Wt=nt.type,ze=Wt===void 0?"text":Wt,xe=nt.classes,bt=nt.classNames,pn=nt.styles,Ut=(0,je.Z)(nt,mt),Ge=(0,kt.Z)(nt.defaultValue,{value:nt.value}),Ye=(0,Oe.Z)(Ge,2),It=Ye[0],Mn=Ye[1],jt=(0,Ne.useState)(!1),bn=(0,Oe.Z)(jt,2),Vt=bn[0],Zt=bn[1],zt=(0,Ne.useRef)(null),ve=function(Jt){zt.current&&(0,Ce.nH)(zt.current,Jt)};(0,Ne.useImperativeHandle)(ht,function(){return{focus:ve,blur:function(){var Jt;(Jt=zt.current)===null||Jt===void 0||Jt.blur()},setSelectionRange:function(Jt,en,nn){var wn;(wn=zt.current)===null||wn===void 0||wn.setSelectionRange(Jt,en,nn)},select:function(){var Jt;(Jt=zt.current)===null||Jt===void 0||Jt.select()},input:zt.current}}),(0,Ne.useEffect)(function(){Zt(function(ln){return ln&&At?!1:ln})},[At]);var se=function(Jt){nt.value===void 0&&Mn(Jt.target.value),zt.current&&(0,Ce.rJ)(zt.current,Jt,Ee)},oe=function(Jt){vt&&Jt.key==="Enter"&&vt(Jt),Ue==null||Ue(Jt)},fe=function(Jt){Zt(!0),Xe==null||Xe(Jt)},ye=function(Jt){Zt(!1),at==null||at(Jt)},ce=function(Jt){Mn(""),ve(),zt.current&&(0,Ce.rJ)(zt.current,Jt,Ee)},Ke=function(){var Jt=(0,et.Z)(nt,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","classes","htmlSize","styles","classNames"]);return Ne.createElement("input",(0,pe.Z)({autoComplete:Ve},Jt,{onChange:se,onFocus:fe,onBlur:ye,onKeyDown:oe,className:Pe()(rt,(0,$e.Z)({},"".concat(rt,"-disabled"),At),bt==null?void 0:bt.input),style:pn==null?void 0:pn.input,ref:zt,size:qe,type:ze}))},Dt=function(){var Jt=Number(cn)>0;if(Kt||Xt){var en=(0,Ce.D7)(It),nn=(0,gt.Z)(en).length,wn=(0,ct.Z)(Xt)==="object"?Xt.formatter({value:en,count:nn,maxLength:cn}):"".concat(nn).concat(Jt?" / ".concat(cn):"");return Ne.createElement(Ne.Fragment,null,!!Xt&&Ne.createElement("span",{className:Pe()("".concat(rt,"-show-count-suffix"),(0,$e.Z)({},"".concat(rt,"-show-count-has-suffix"),!!Kt),bt==null?void 0:bt.count),style:(0,ut.Z)({},pn==null?void 0:pn.count)},wn),Kt)}return null};return Ne.createElement(Fe,(0,pe.Z)({},Ut,{prefixCls:rt,className:Ht,inputElement:Ke(),handleReset:ce,value:(0,Ce.D7)(It),focused:Vt,triggerFocus:ve,suffix:Dt(),disabled:At,classes:xe,classNames:bt,styles:pn}))}),Rt=st,tn=Rt},5643:function(kn,dn,de){"use strict";de.d(dn,{D7:function(){return Se},He:function(){return pe},X3:function(){return ut},nH:function(){return ct},rJ:function(){return $e}});function pe(Pe){return!!(Pe.addonBefore||Pe.addonAfter)}function ut(Pe){return!!(Pe.prefix||Pe.suffix||Pe.allowClear)}function $e(Pe,Ne,Ce,ke){if(Ce){var Fe=Ne;if(Ne.type==="click"){var gt=Pe.cloneNode(!0);Fe=Object.create(Ne,{target:{value:gt},currentTarget:{value:gt}}),gt.value="",Ce(Fe);return}if(ke!==void 0){Fe=Object.create(Ne,{target:{value:Pe},currentTarget:{value:Pe}}),Pe.value=ke,Ce(Fe);return}Ce(Fe)}}function ct(Pe,Ne){if(Pe){Pe.focus(Ne);var Ce=Ne||{},ke=Ce.cursor;if(ke){var Fe=Pe.value.length;switch(ke){case"start":Pe.setSelectionRange(0,0);break;case"end":Pe.setSelectionRange(Fe,Fe);break;default:Pe.setSelectionRange(0,Fe)}}}}function Se(Pe){return typeof Pe=="undefined"||Pe===null?"":String(Pe)}},15285:function(kn,dn,de){"use strict";de.d(dn,{iz:function(){return xn},ck:function(){return Zr},BW:function(){return hn},sN:function(){return Zr},Wd:function(){return it},ZP:function(){return Gt},Xl:function(){return Ue}});var pe=de(60499),ut=de(18642),$e=de(85899),ct=de(77654),Se=de(72190),Pe=de(42244),Ne=de(92310),Ce=de.n(Ne),ke=de(83836),Fe=de(18929),gt=de(13697),Oe=de(48736),je=de(59301),kt=de(4676),et=je.createContext(null);function mt(Te,dt){return Te===void 0?null:"".concat(Te,"-").concat(dt)}function st(Te){var dt=je.useContext(et);return mt(dt,Te)}var Rt=de(80547),tn=["children","locked"],nt=je.createContext(null);function ht(Te,dt){var ft=(0,$e.Z)({},Te);return Object.keys(dt).forEach(function(Tt){var _t=dt[Tt];_t!==void 0&&(ft[Tt]=_t)}),ft}function Ve(Te){var dt=Te.children,ft=Te.locked,Tt=(0,Pe.Z)(Te,tn),_t=je.useContext(nt),Pt=(0,Rt.Z)(function(){return ht(_t,Tt)},[_t,Tt],function(Bt,un){return!ft&&(Bt[0]!==un[0]||!(0,gt.Z)(Bt[1],un[1],!0))});return je.createElement(nt.Provider,{value:Pt},dt)}var Ee=[],Xe=je.createContext(null);function at(){return je.useContext(Xe)}var vt=je.createContext(Ee);function Ue(Te){var dt=je.useContext(vt);return je.useMemo(function(){return Te!==void 0?[].concat((0,ct.Z)(dt),[Te]):dt},[dt,Te])}var Ot=je.createContext(null),rt=je.createContext({}),At=rt,qe=de(29194);function Ht(Te){var dt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,qe.Z)(Te)){var ft=Te.nodeName.toLowerCase(),Tt=["input","select","textarea","button"].includes(ft)||Te.isContentEditable||ft==="a"&&!!Te.getAttribute("href"),_t=Te.getAttribute("tabindex"),Pt=Number(_t),Bt=null;return _t&&!Number.isNaN(Pt)?Bt=Pt:Tt&&Bt===null&&(Bt=0),Tt&&Te.disabled&&(Bt=null),Bt!==null&&(Bt>=0||dt&&Bt<0)}return!1}function cn(Te){var dt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ft=(0,ct.Z)(Te.querySelectorAll("*")).filter(function(Tt){return Ht(Tt,dt)});return Ht(Te,dt)&&ft.unshift(Te),ft}var Kt=null;function Xt(){Kt=document.activeElement}function Wt(){Kt=null}function ze(){if(Kt)try{Kt.focus()}catch(Te){}}function xe(Te,dt){if(dt.keyCode===9){var ft=cn(Te),Tt=ft[dt.shiftKey?0:ft.length-1],_t=Tt===document.activeElement||Te===document.activeElement;if(_t){var Pt=ft[dt.shiftKey?ft.length-1:0];Pt.focus(),dt.preventDefault()}}}var bt=de(10228),pn=de(16089),Ut=bt.Z.LEFT,Ge=bt.Z.RIGHT,Ye=bt.Z.UP,It=bt.Z.DOWN,Mn=bt.Z.ENTER,jt=bt.Z.ESC,bn=bt.Z.HOME,Vt=bt.Z.END,Zt=[Ye,It,Ut,Ge];function zt(Te,dt,ft,Tt){var _t,Pt,Bt,un,yn="prev",_n="next",$n="children",qn="parent";if(Te==="inline"&&Tt===Mn)return{inlineTrigger:!0};var sr=(_t={},(0,ut.Z)(_t,Ye,yn),(0,ut.Z)(_t,It,_n),_t),jn=(Pt={},(0,ut.Z)(Pt,Ut,ft?_n:yn),(0,ut.Z)(Pt,Ge,ft?yn:_n),(0,ut.Z)(Pt,It,$n),(0,ut.Z)(Pt,Mn,$n),Pt),Ln=(Bt={},(0,ut.Z)(Bt,Ye,yn),(0,ut.Z)(Bt,It,_n),(0,ut.Z)(Bt,Mn,$n),(0,ut.Z)(Bt,jt,qn),(0,ut.Z)(Bt,Ut,ft?$n:qn),(0,ut.Z)(Bt,Ge,ft?qn:$n),Bt),ur={inline:sr,horizontal:jn,vertical:Ln,inlineSub:sr,horizontalSub:Ln,verticalSub:Ln},Qn=(un=ur["".concat(Te).concat(dt?"":"Sub")])===null||un===void 0?void 0:un[Tt];switch(Qn){case yn:return{offset:-1,sibling:!0};case _n:return{offset:1,sibling:!0};case qn:return{offset:-1,sibling:!1};case $n:return{offset:1,sibling:!1};default:return null}}function ve(Te){for(var dt=Te;dt;){if(dt.getAttribute("data-menu-list"))return dt;dt=dt.parentElement}return null}function se(Te,dt){for(var ft=Te||document.activeElement;ft;){if(dt.has(ft))return ft;ft=ft.parentElement}return null}function oe(Te,dt){var ft=cn(Te,!0);return ft.filter(function(Tt){return dt.has(Tt)})}function fe(Te,dt,ft){var Tt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!Te)return null;var _t=oe(Te,dt),Pt=_t.length,Bt=_t.findIndex(function(un){return ft===un});return Tt<0?Bt===-1?Bt=Pt-1:Bt-=1:Tt>0&&(Bt+=1),Bt=(Bt+Pt)%Pt,_t[Bt]}var ye=function(dt,ft){var Tt=new Set,_t=new Map,Pt=new Map;return dt.forEach(function(Bt){var un=document.querySelector("[data-menu-id='".concat(mt(ft,Bt),"']"));un&&(Tt.add(un),Pt.set(un,Bt),_t.set(Bt,un))}),{elements:Tt,key2element:_t,element2key:Pt}};function ce(Te,dt,ft,Tt,_t,Pt,Bt,un,yn,_n){var $n=je.useRef(),qn=je.useRef();qn.current=dt;var sr=function(){pn.Z.cancel($n.current)};return je.useEffect(function(){return function(){sr()}},[]),function(jn){var Ln=jn.which;if([].concat(Zt,[Mn,jt,bn,Vt]).includes(Ln)){var ur=Pt(),Qn=ye(ur,Tt),mr=Qn,Vn=mr.elements,Un=mr.key2element,br=mr.element2key,lr=Un.get(dt),Ir=se(lr,Vn),Ur=br.get(Ir),rr=zt(Te,Bt(Ur,!0).length===1,ft,Ln);if(!rr&&Ln!==bn&&Ln!==Vt)return;(Zt.includes(Ln)||[bn,Vt].includes(Ln))&&jn.preventDefault();var Cn=function(Sr){if(Sr){var ii=Sr,zn=Sr.querySelector("a");zn!=null&&zn.getAttribute("href")&&(ii=zn);var Xn=br.get(Sr);un(Xn),sr(),$n.current=(0,pn.Z)(function(){qn.current===Xn&&ii.focus()})}};if([bn,Vt].includes(Ln)||rr.sibling||!Ir){var Sn;!Ir||Te==="inline"?Sn=_t.current:Sn=ve(Ir);var fr,er=oe(Sn,Vn);Ln===bn?fr=er[0]:Ln===Vt?fr=er[er.length-1]:fr=fe(Sn,Vn,Ir,rr.offset),Cn(fr)}else if(rr.inlineTrigger)yn(Ur);else if(rr.offset>0)yn(Ur,!0),sr(),$n.current=(0,pn.Z)(function(){Qn=ye(ur,Tt);var dr=Ir.getAttribute("aria-controls"),Sr=document.getElementById(dr),ii=fe(Sr,Qn.elements);Cn(ii)},5);else if(rr.offset<0){var Mr=Bt(Ur,!0),_r=Mr[Mr.length-2],Ar=Un.get(_r);yn(_r,!1),Cn(Ar)}}_n==null||_n(jn)}}function Ke(Te){Promise.resolve().then(Te)}var Dt="__RC_UTIL_PATH_SPLIT__",ln=function(dt){return dt.join(Dt)},Jt=function(dt){return dt.split(Dt)},en="rc-menu-more";function nn(){var Te=je.useState({}),dt=(0,Se.Z)(Te,2),ft=dt[1],Tt=(0,je.useRef)(new Map),_t=(0,je.useRef)(new Map),Pt=je.useState([]),Bt=(0,Se.Z)(Pt,2),un=Bt[0],yn=Bt[1],_n=(0,je.useRef)(0),$n=(0,je.useRef)(!1),qn=function(){$n.current||ft({})},sr=(0,je.useCallback)(function(Un,br){var lr=ln(br);_t.current.set(lr,Un),Tt.current.set(Un,lr),_n.current+=1;var Ir=_n.current;Ke(function(){Ir===_n.current&&qn()})},[]),jn=(0,je.useCallback)(function(Un,br){var lr=ln(br);_t.current.delete(lr),Tt.current.delete(Un)},[]),Ln=(0,je.useCallback)(function(Un){yn(Un)},[]),ur=(0,je.useCallback)(function(Un,br){var lr=Tt.current.get(Un)||"",Ir=Jt(lr);return br&&un.includes(Ir[0])&&Ir.unshift(en),Ir},[un]),Qn=(0,je.useCallback)(function(Un,br){return Un.some(function(lr){var Ir=ur(lr,!0);return Ir.includes(br)})},[ur]),mr=function(){var br=(0,ct.Z)(Tt.current.keys());return un.length&&br.push(en),br},Vn=(0,je.useCallback)(function(Un){var br="".concat(Tt.current.get(Un)).concat(Dt),lr=new Set;return(0,ct.Z)(_t.current.keys()).forEach(function(Ir){Ir.startsWith(br)&&lr.add(_t.current.get(Ir))}),lr},[]);return je.useEffect(function(){return function(){$n.current=!0}},[]),{registerPath:sr,unregisterPath:jn,refreshOverflowKeys:Ln,isSubPathKey:Qn,getKeyPath:ur,getKeys:mr,getSubPathKeys:Vn}}function wn(Te){var dt=je.useRef(Te);dt.current=Te;var ft=je.useCallback(function(){for(var Tt,_t=arguments.length,Pt=new Array(_t),Bt=0;Bt<_t;Bt++)Pt[Bt]=arguments[Bt];return(Tt=dt.current)===null||Tt===void 0?void 0:Tt.call.apply(Tt,[dt].concat(Pt))},[]);return Te?ft:void 0}var mn=Math.random().toFixed(5).toString().slice(2),En=0;function yt(Te){var dt=(0,Fe.Z)(Te,{value:Te}),ft=(0,Se.Z)(dt,2),Tt=ft[0],_t=ft[1];return je.useEffect(function(){En+=1;var Pt="".concat(mn,"-").concat(En);_t("rc-menu-uuid-".concat(Pt))},[]),Tt}var gn=de(38705),Jn=de(17212),tt=de(39153),Re=de(55401),Ze=de(2738),Ft=de(8654);function Qt(Te,dt,ft,Tt){var _t=je.useContext(nt),Pt=_t.activeKey,Bt=_t.onActive,un=_t.onInactive,yn={active:Pt===Te};return dt||(yn.onMouseEnter=function(_n){ft==null||ft({key:Te,domEvent:_n}),Bt(Te)},yn.onMouseLeave=function(_n){Tt==null||Tt({key:Te,domEvent:_n}),un(Te)}),yn}function an(Te){var dt=je.useContext(nt),ft=dt.mode,Tt=dt.rtl,_t=dt.inlineIndent;if(ft!=="inline")return null;var Pt=Te;return Tt?{paddingRight:Pt*_t}:{paddingLeft:Pt*_t}}function Pn(Te){var dt=Te.icon,ft=Te.props,Tt=Te.children,_t;return dt===null||dt===!1?null:(typeof dt=="function"?_t=je.createElement(dt,(0,$e.Z)({},ft)):typeof dt!="boolean"&&(_t=dt),_t||Tt||null)}var On=["item"];function Nn(Te){var dt=Te.item,ft=(0,Pe.Z)(Te,On);return Object.defineProperty(ft,"item",{get:function(){return(0,Oe.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),dt}}),ft}var Zn=["title","attribute","elementRef"],tr=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],Tn=["active"],gr=function(Te){(0,tt.Z)(ft,Te);var dt=(0,Re.Z)(ft);function ft(){return(0,gn.Z)(this,ft),dt.apply(this,arguments)}return(0,Jn.Z)(ft,[{key:"render",value:function(){var _t=this.props,Pt=_t.title,Bt=_t.attribute,un=_t.elementRef,yn=(0,Pe.Z)(_t,Zn),_n=(0,Ze.Z)(yn,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,Oe.ZP)(!Bt,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),je.createElement(ke.Z.Item,(0,pe.Z)({},Bt,{title:typeof Pt=="string"?Pt:void 0},_n,{ref:un}))}}]),ft}(je.Component),Pr=je.forwardRef(function(Te,dt){var ft,Tt=Te.style,_t=Te.className,Pt=Te.eventKey,Bt=Te.warnKey,un=Te.disabled,yn=Te.itemIcon,_n=Te.children,$n=Te.role,qn=Te.onMouseEnter,sr=Te.onMouseLeave,jn=Te.onClick,Ln=Te.onKeyDown,ur=Te.onFocus,Qn=(0,Pe.Z)(Te,tr),mr=st(Pt),Vn=je.useContext(nt),Un=Vn.prefixCls,br=Vn.onItemClick,lr=Vn.disabled,Ir=Vn.overflowDisabled,Ur=Vn.itemIcon,rr=Vn.selectedKeys,Cn=Vn.onActive,Sn=je.useContext(At),fr=Sn._internalRenderMenuItem,er="".concat(Un,"-item"),Mr=je.useRef(),_r=je.useRef(),Ar=lr||un,dr=(0,Ft.x1)(dt,_r),Sr=Ue(Pt),ii=function(Hn){return{key:Pt,keyPath:(0,ct.Z)(Sr).reverse(),item:Mr.current,domEvent:Hn}},zn=yn||Ur,Xn=Qt(Pt,Ar,qn,sr),kr=Xn.active,Br=(0,Pe.Z)(Xn,Tn),li=rr.includes(Pt),di=an(Sr.length),ri=function(Hn){if(!Ar){var hr=ii(Hn);jn==null||jn(Nn(hr)),br(hr)}},Yr=function(Hn){if(Ln==null||Ln(Hn),Hn.which===bt.Z.ENTER){var hr=ii(Hn);jn==null||jn(Nn(hr)),br(hr)}},yi=function(Hn){Cn(Pt),ur==null||ur(Hn)},bi={};Te.role==="option"&&(bi["aria-selected"]=li);var Gn=je.createElement(gr,(0,pe.Z)({ref:Mr,elementRef:dr,role:$n===null?"none":$n||"menuitem",tabIndex:un?null:-1,"data-menu-id":Ir&&mr?null:mr},Qn,Br,bi,{component:"li","aria-disabled":un,style:(0,$e.Z)((0,$e.Z)({},di),Tt),className:Ce()(er,(ft={},(0,ut.Z)(ft,"".concat(er,"-active"),kr),(0,ut.Z)(ft,"".concat(er,"-selected"),li),(0,ut.Z)(ft,"".concat(er,"-disabled"),Ar),ft),_t),onClick:ri,onKeyDown:Yr,onFocus:yi}),_n,je.createElement(Pn,{props:(0,$e.Z)((0,$e.Z)({},Te),{},{isSelected:li}),icon:zn}));return fr&&(Gn=fr(Gn,Te,{selected:li})),Gn});function Rr(Te,dt){var ft=Te.eventKey,Tt=at(),_t=Ue(ft);return je.useEffect(function(){if(Tt)return Tt.registerPath(ft,_t),function(){Tt.unregisterPath(ft,_t)}},[_t]),Tt?null:je.createElement(Pr,(0,pe.Z)({},Te,{ref:dt}))}var Zr=je.forwardRef(Rr),vr=["className","children"],Dr=function(dt,ft){var Tt=dt.className,_t=dt.children,Pt=(0,Pe.Z)(dt,vr),Bt=je.useContext(nt),un=Bt.prefixCls,yn=Bt.mode,_n=Bt.rtl;return je.createElement("ul",(0,pe.Z)({className:Ce()(un,_n&&"".concat(un,"-rtl"),"".concat(un,"-sub"),"".concat(un,"-").concat(yn==="inline"?"inline":"vertical"),Tt),role:"menu"},Pt,{"data-menu-list":!0,ref:ft}),_t)},yr=je.forwardRef(Dr);yr.displayName="SubMenuList";var Nr=yr,Wr=de(11592);function Er(Te,dt){return(0,Wr.Z)(Te).map(function(ft,Tt){if(je.isValidElement(ft)){var _t,Pt,Bt=ft.key,un=(_t=(Pt=ft.props)===null||Pt===void 0?void 0:Pt.eventKey)!==null&&_t!==void 0?_t:Bt,yn=un==null;yn&&(un="tmp_key-".concat([].concat((0,ct.Z)(dt),[Tt]).join("-")));var _n={key:un,eventKey:un};return je.cloneElement(ft,_n)}return ft})}var qr=de(35593),zr={adjustX:1,adjustY:1},ar={topLeft:{points:["bl","tl"],overflow:zr},topRight:{points:["br","tr"],overflow:zr},bottomLeft:{points:["tl","bl"],overflow:zr},bottomRight:{points:["tr","br"],overflow:zr},leftTop:{points:["tr","tl"],overflow:zr},leftBottom:{points:["br","bl"],overflow:zr},rightTop:{points:["tl","tr"],overflow:zr},rightBottom:{points:["bl","br"],overflow:zr}},or={topLeft:{points:["bl","tl"],overflow:zr},topRight:{points:["br","tr"],overflow:zr},bottomLeft:{points:["tl","bl"],overflow:zr},bottomRight:{points:["tr","br"],overflow:zr},rightTop:{points:["tr","tl"],overflow:zr},rightBottom:{points:["br","bl"],overflow:zr},leftTop:{points:["tl","tr"],overflow:zr},leftBottom:{points:["bl","br"],overflow:zr}},Bn=null;function In(Te,dt,ft){if(dt)return dt;if(ft)return ft[Te]||ft.other}var wr={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function Qe(Te){var dt=Te.prefixCls,ft=Te.visible,Tt=Te.children,_t=Te.popup,Pt=Te.popupStyle,Bt=Te.popupClassName,un=Te.popupOffset,yn=Te.disabled,_n=Te.mode,$n=Te.onVisibleChange,qn=je.useContext(nt),sr=qn.getPopupContainer,jn=qn.rtl,Ln=qn.subMenuOpenDelay,ur=qn.subMenuCloseDelay,Qn=qn.builtinPlacements,mr=qn.triggerSubMenuAction,Vn=qn.forceSubMenuRender,Un=qn.rootClassName,br=qn.motion,lr=qn.defaultMotions,Ir=je.useState(!1),Ur=(0,Se.Z)(Ir,2),rr=Ur[0],Cn=Ur[1],Sn=jn?(0,$e.Z)((0,$e.Z)({},or),Qn):(0,$e.Z)((0,$e.Z)({},ar),Qn),fr=wr[_n],er=In(_n,br,lr),Mr=je.useRef(er);_n!=="inline"&&(Mr.current=er);var _r=(0,$e.Z)((0,$e.Z)({},Mr.current),{},{leavedClassName:"".concat(dt,"-hidden"),removeOnLeave:!1,motionAppear:!0}),Ar=je.useRef();return je.useEffect(function(){return Ar.current=(0,pn.Z)(function(){Cn(ft)}),function(){pn.Z.cancel(Ar.current)}},[ft]),je.createElement(qr.Z,{prefixCls:dt,popupClassName:Ce()("".concat(dt,"-popup"),(0,ut.Z)({},"".concat(dt,"-rtl"),jn),Bt,Un),stretch:_n==="horizontal"?"minWidth":null,getPopupContainer:sr,builtinPlacements:Sn,popupPlacement:fr,popupVisible:rr,popup:_t,popupStyle:Pt,popupAlign:un&&{offset:un},action:yn?[]:[mr],mouseEnterDelay:Ln,mouseLeaveDelay:ur,onPopupVisibleChange:$n,forceRender:Vn,popupMotion:_r,fresh:!0},Tt)}var Me=de(77900);function Ae(Te){var dt=Te.id,ft=Te.open,Tt=Te.keyPath,_t=Te.children,Pt="inline",Bt=je.useContext(nt),un=Bt.prefixCls,yn=Bt.forceSubMenuRender,_n=Bt.motion,$n=Bt.defaultMotions,qn=Bt.mode,sr=je.useRef(!1);sr.current=qn===Pt;var jn=je.useState(!sr.current),Ln=(0,Se.Z)(jn,2),ur=Ln[0],Qn=Ln[1],mr=sr.current?ft:!1;je.useEffect(function(){sr.current&&Qn(!1)},[qn]);var Vn=(0,$e.Z)({},In(Pt,_n,$n));Tt.length>1&&(Vn.motionAppear=!1);var Un=Vn.onVisibleChanged;return Vn.onVisibleChanged=function(br){return!sr.current&&!br&&Qn(!0),Un==null?void 0:Un(br)},ur?null:je.createElement(Ve,{mode:Pt,locked:!sr.current},je.createElement(Me.default,(0,pe.Z)({visible:mr},Vn,{forceRender:yn,removeOnLeave:!1,leavedClassName:"".concat(un,"-hidden")}),function(br){var lr=br.className,Ir=br.style;return je.createElement(Nr,{id:dt,className:lr,style:Ir},_t)}))}var Le=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],De=["active"],We=function(dt){var ft,Tt=dt.style,_t=dt.className,Pt=dt.title,Bt=dt.eventKey,un=dt.warnKey,yn=dt.disabled,_n=dt.internalPopupClose,$n=dt.children,qn=dt.itemIcon,sr=dt.expandIcon,jn=dt.popupClassName,Ln=dt.popupOffset,ur=dt.popupStyle,Qn=dt.onClick,mr=dt.onMouseEnter,Vn=dt.onMouseLeave,Un=dt.onTitleClick,br=dt.onTitleMouseEnter,lr=dt.onTitleMouseLeave,Ir=(0,Pe.Z)(dt,Le),Ur=st(Bt),rr=je.useContext(nt),Cn=rr.prefixCls,Sn=rr.mode,fr=rr.openKeys,er=rr.disabled,Mr=rr.overflowDisabled,_r=rr.activeKey,Ar=rr.selectedKeys,dr=rr.itemIcon,Sr=rr.expandIcon,ii=rr.onItemClick,zn=rr.onOpenChange,Xn=rr.onActive,kr=je.useContext(At),Br=kr._internalRenderSubMenuItem,li=je.useContext(Ot),di=li.isSubPathKey,ri=Ue(),Yr="".concat(Cn,"-submenu"),yi=er||yn,bi=je.useRef(),Gn=je.useRef(),Wn=qn!=null?qn:dr,Hn=sr!=null?sr:Sr,hr=fr.includes(Bt),ni=!Mr&&hr,xi=di(Ar,Bt),Mi=Qt(Bt,yi,br,lr),gi=Mi.active,ci=(0,Pe.Z)(Mi,De),ki=je.useState(!1),Hi=(0,Se.Z)(ki,2),$i=Hi[0],oa=Hi[1],Gr=function(Zi){yi||oa(Zi)},ei=function(Zi){Gr(!0),mr==null||mr({key:Bt,domEvent:Zi})},Ai=function(Zi){Gr(!1),Vn==null||Vn({key:Bt,domEvent:Zi})},ai=je.useMemo(function(){return gi||(Sn!=="inline"?$i||di([_r],Bt):!1)},[Sn,gi,_r,$i,Bt,di]),fi=an(ri.length),_i=function(Zi){yi||(Un==null||Un({key:Bt,domEvent:Zi}),Sn==="inline"&&zn(Bt,!hr))},pi=wn(function(Wi){Qn==null||Qn(Nn(Wi)),ii(Wi)}),Tr=function(Zi){Sn!=="inline"&&zn(Bt,Zi)},Xr=function(){Xn(Bt)},Vr=Ur&&"".concat(Ur,"-popup"),$r=je.createElement("div",(0,pe.Z)({role:"menuitem",style:fi,className:"".concat(Yr,"-title"),tabIndex:yi?null:-1,ref:bi,title:typeof Pt=="string"?Pt:null,"data-menu-id":Mr&&Ur?null:Ur,"aria-expanded":ni,"aria-haspopup":!0,"aria-controls":Vr,"aria-disabled":yi,onClick:_i,onFocus:Xr},ci),Pt,je.createElement(Pn,{icon:Sn!=="horizontal"?Hn:void 0,props:(0,$e.Z)((0,$e.Z)({},dt),{},{isOpen:ni,isSubMenu:!0})},je.createElement("i",{className:"".concat(Yr,"-arrow")}))),ui=je.useRef(Sn);if(Sn!=="inline"&&ri.length>1?ui.current="vertical":ui.current=Sn,!Mr){var oi=ui.current;$r=je.createElement(Qe,{mode:oi,prefixCls:Yr,visible:!_n&&ni&&Sn!=="inline",popupClassName:jn,popupOffset:Ln,popupStyle:ur,popup:je.createElement(Ve,{mode:oi==="horizontal"?"vertical":oi},je.createElement(Nr,{id:Vr,ref:Gn},$n)),disabled:yi,onVisibleChange:Tr},$r)}var zi=je.createElement(ke.Z.Item,(0,pe.Z)({role:"none"},Ir,{component:"li",style:Tt,className:Ce()(Yr,"".concat(Yr,"-").concat(Sn),_t,(ft={},(0,ut.Z)(ft,"".concat(Yr,"-open"),ni),(0,ut.Z)(ft,"".concat(Yr,"-active"),ai),(0,ut.Z)(ft,"".concat(Yr,"-selected"),xi),(0,ut.Z)(ft,"".concat(Yr,"-disabled"),yi),ft)),onMouseEnter:ei,onMouseLeave:Ai}),$r,!Mr&&je.createElement(Ae,{id:Vr,open:ni,keyPath:ri},$n));return Br&&(zi=Br(zi,dt,{selected:xi,active:ai,open:ni,disabled:yi})),je.createElement(Ve,{onItemClick:pi,mode:Sn==="horizontal"?"vertical":Sn,itemIcon:Wn,expandIcon:Hn},zi)};function it(Te){var dt=Te.eventKey,ft=Te.children,Tt=Ue(dt),_t=Er(ft,Tt),Pt=at();je.useEffect(function(){if(Pt)return Pt.registerPath(dt,Tt),function(){Pt.unregisterPath(dt,Tt)}},[Tt]);var Bt;return Pt?Bt=_t:Bt=je.createElement(We,Te,_t),je.createElement(vt.Provider,{value:Tt},Bt)}var Nt=de(43749),Lt=["className","title","eventKey","children"],$t=["children"],sn=function(dt){var ft=dt.className,Tt=dt.title,_t=dt.eventKey,Pt=dt.children,Bt=(0,Pe.Z)(dt,Lt),un=je.useContext(nt),yn=un.prefixCls,_n="".concat(yn,"-item-group");return je.createElement("li",(0,pe.Z)({role:"presentation"},Bt,{onClick:function(qn){return qn.stopPropagation()},className:Ce()(_n,ft)}),je.createElement("div",{role:"presentation",className:"".concat(_n,"-title"),title:typeof Tt=="string"?Tt:void 0},Tt),je.createElement("ul",{role:"group",className:"".concat(_n,"-list")},Pt))};function hn(Te){var dt=Te.children,ft=(0,Pe.Z)(Te,$t),Tt=Ue(ft.eventKey),_t=Er(dt,Tt),Pt=at();return Pt?_t:je.createElement(sn,(0,Ze.Z)(ft,["warnKey"]),_t)}function xn(Te){var dt=Te.className,ft=Te.style,Tt=je.useContext(nt),_t=Tt.prefixCls,Pt=at();return Pt?null:je.createElement("li",{role:"separator",className:Ce()("".concat(_t,"-item-divider"),dt),style:ft})}var Mt=["label","children","key","type"];function rn(Te){return(Te||[]).map(function(dt,ft){if(dt&&(0,Nt.Z)(dt)==="object"){var Tt=dt,_t=Tt.label,Pt=Tt.children,Bt=Tt.key,un=Tt.type,yn=(0,Pe.Z)(Tt,Mt),_n=Bt!=null?Bt:"tmp-".concat(ft);return Pt||un==="group"?un==="group"?je.createElement(hn,(0,pe.Z)({key:_n},yn,{title:_t}),rn(Pt)):je.createElement(it,(0,pe.Z)({key:_n},yn,{title:_t}),rn(Pt)):un==="divider"?je.createElement(xn,(0,pe.Z)({key:_n},yn)):je.createElement(Zr,(0,pe.Z)({key:_n},yn),_t)}return null}).filter(function(dt){return dt})}function Je(Te,dt,ft){var Tt=Te;return dt&&(Tt=rn(dt)),Er(Tt,ft)}var pt=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],Ct=[],Et=je.forwardRef(function(Te,dt){var ft,Tt,_t=Te,Pt=_t.prefixCls,Bt=Pt===void 0?"rc-menu":Pt,un=_t.rootClassName,yn=_t.style,_n=_t.className,$n=_t.tabIndex,qn=$n===void 0?0:$n,sr=_t.items,jn=_t.children,Ln=_t.direction,ur=_t.id,Qn=_t.mode,mr=Qn===void 0?"vertical":Qn,Vn=_t.inlineCollapsed,Un=_t.disabled,br=_t.disabledOverflow,lr=_t.subMenuOpenDelay,Ir=lr===void 0?.1:lr,Ur=_t.subMenuCloseDelay,rr=Ur===void 0?.1:Ur,Cn=_t.forceSubMenuRender,Sn=_t.defaultOpenKeys,fr=_t.openKeys,er=_t.activeKey,Mr=_t.defaultActiveFirst,_r=_t.selectable,Ar=_r===void 0?!0:_r,dr=_t.multiple,Sr=dr===void 0?!1:dr,ii=_t.defaultSelectedKeys,zn=_t.selectedKeys,Xn=_t.onSelect,kr=_t.onDeselect,Br=_t.inlineIndent,li=Br===void 0?24:Br,di=_t.motion,ri=_t.defaultMotions,Yr=_t.triggerSubMenuAction,yi=Yr===void 0?"hover":Yr,bi=_t.builtinPlacements,Gn=_t.itemIcon,Wn=_t.expandIcon,Hn=_t.overflowedIndicator,hr=Hn===void 0?"...":Hn,ni=_t.overflowedIndicatorPopupClassName,xi=_t.getPopupContainer,Mi=_t.onClick,gi=_t.onOpenChange,ci=_t.onKeyDown,ki=_t.openAnimation,Hi=_t.openTransitionName,$i=_t._internalRenderMenuItem,oa=_t._internalRenderSubMenuItem,Gr=(0,Pe.Z)(_t,pt),ei=je.useMemo(function(){return Je(jn,sr,Ct)},[jn,sr]),Ai=je.useState(!1),ai=(0,Se.Z)(Ai,2),fi=ai[0],_i=ai[1],pi=je.useRef(),Tr=yt(ur),Xr=Ln==="rtl",Vr=(0,Fe.Z)(Sn,{value:fr,postState:function(Bi){return Bi||Ct}}),$r=(0,Se.Z)(Vr,2),ui=$r[0],oi=$r[1],zi=function(Bi){var ji=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Ya(){oi(Bi),gi==null||gi(Bi)}ji?(0,kt.flushSync)(Ya):Ya()},Wi=je.useState(ui),Zi=(0,Se.Z)(Wi,2),na=Zi[0],wi=Zi[1],vi=je.useRef(!1),Gi=je.useMemo(function(){return(mr==="inline"||mr==="vertical")&&Vn?["vertical",Vn]:[mr,!1]},[mr,Vn]),ca=(0,Se.Z)(Gi,2),sa=ca[0],ta=ca[1],ts=sa==="inline",ao=je.useState(sa),oo=(0,Se.Z)(ao,2),eo=oo[0],Ss=oo[1],fo=je.useState(ta),Ea=(0,Se.Z)(fo,2),fa=Ea[0],bo=Ea[1];je.useEffect(function(){Ss(sa),bo(ta),vi.current&&(ts?oi(na):zi(Ct))},[sa,ta]);var ko=je.useState(0),Eo=(0,Se.Z)(ko,2),ns=Eo[0],Ro=Eo[1],Xa=ns>=ei.length-1||eo!=="horizontal"||br;je.useEffect(function(){ts&&wi(ui)},[ui]),je.useEffect(function(){return vi.current=!0,function(){vi.current=!1}},[]);var Oa=nn(),Oi=Oa.registerPath,Lo=Oa.unregisterPath,rs=Oa.refreshOverflowKeys,Do=Oa.isSubPathKey,Ei=Oa.getKeyPath,mi=Oa.getKeys,Ki=Oa.getSubPathKeys,La=je.useMemo(function(){return{registerPath:Oi,unregisterPath:Lo}},[Oi,Lo]),Xi=je.useMemo(function(){return{isSubPathKey:Do}},[Do]);je.useEffect(function(){rs(Xa?Ct:ei.slice(ns+1).map(function(Pi){return Pi.key}))},[ns,Xa]);var Ra=(0,Fe.Z)(er||Mr&&((ft=ei[0])===null||ft===void 0?void 0:ft.key),{value:er}),Fa=(0,Se.Z)(Ra,2),to=Fa[0],Na=Fa[1],so=wn(function(Pi){Na(Pi)}),lo=wn(function(){Na(void 0)});(0,je.useImperativeHandle)(dt,function(){return{list:pi.current,focus:function(Bi){var ji,Ya=mi(),Aa=ye(Ya,Tr),xo=Aa.elements,po=Aa.key2element,za=Aa.element2key,Ao=oe(pi.current,xo),To=to!=null?to:Ao[0]?za.get(Ao[0]):(ji=ei.find(function(Wl){return!Wl.props.disabled}))===null||ji===void 0?void 0:ji.key,wo=po.get(To);if(To&&wo){var os;wo==null||(os=wo.focus)===null||os===void 0||os.call(wo,Bi)}}}});var Da=(0,Fe.Z)(ii||[],{value:zn,postState:function(Bi){return Array.isArray(Bi)?Bi:Bi==null?Ct:[Bi]}}),bl=(0,Se.Z)(Da,2),jo=bl[0],qs=bl[1],Kl=function(Bi){if(Ar){var ji=Bi.key,Ya=jo.includes(ji),Aa;Sr?Ya?Aa=jo.filter(function(po){return po!==ji}):Aa=[].concat((0,ct.Z)(jo),[ji]):Aa=[ji],qs(Aa);var xo=(0,$e.Z)((0,$e.Z)({},Bi),{},{selectedKeys:Aa});Ya?kr==null||kr(xo):Xn==null||Xn(xo)}!Sr&&ui.length&&eo!=="inline"&&zi(Ct)},Hl=wn(function(Pi){Mi==null||Mi(Nn(Pi)),Kl(Pi)}),Cs=wn(function(Pi,Bi){var ji=ui.filter(function(Aa){return Aa!==Pi});if(Bi)ji.push(Pi);else if(eo!=="inline"){var Ya=Ki(Pi);ji=ji.filter(function(Aa){return!Ya.has(Aa)})}(0,gt.Z)(ui,ji,!0)||zi(ji,!0)}),_c=function(Bi,ji){var Ya=ji!=null?ji:!ui.includes(Bi);Cs(Bi,Ya)},is=ce(eo,to,Xr,Tr,pi,mi,Ei,Na,_c,ci);je.useEffect(function(){_i(!0)},[]);var xl=je.useMemo(function(){return{_internalRenderMenuItem:$i,_internalRenderSubMenuItem:oa}},[$i,oa]),Vo=eo!=="horizontal"||br?ei:ei.map(function(Pi,Bi){return je.createElement(Ve,{key:Pi.key,overflowDisabled:Bi>ns},Pi)}),as=je.createElement(ke.Z,(0,pe.Z)({id:ur,ref:pi,prefixCls:"".concat(Bt,"-overflow"),component:"ul",itemComponent:Zr,className:Ce()(Bt,"".concat(Bt,"-root"),"".concat(Bt,"-").concat(eo),_n,(Tt={},(0,ut.Z)(Tt,"".concat(Bt,"-inline-collapsed"),fa),(0,ut.Z)(Tt,"".concat(Bt,"-rtl"),Xr),Tt),un),dir:Ln,style:yn,role:"menu",tabIndex:qn,data:Vo,renderRawItem:function(Bi){return Bi},renderRawRest:function(Bi){var ji=Bi.length,Ya=ji?ei.slice(-ji):null;return je.createElement(it,{eventKey:en,title:hr,disabled:Xa,internalPopupClose:ji===0,popupClassName:ni},Ya)},maxCount:eo!=="horizontal"||br?ke.Z.INVALIDATE:ke.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Bi){Ro(Bi)},onKeyDown:is},Gr));return je.createElement(At.Provider,{value:xl},je.createElement(et.Provider,{value:Tr},je.createElement(Ve,{prefixCls:Bt,rootClassName:un,mode:eo,openKeys:ui,rtl:Xr,disabled:Un,motion:fi?di:null,defaultMotions:fi?ri:null,activeKey:to,onActive:so,onInactive:lo,selectedKeys:jo,inlineIndent:li,subMenuOpenDelay:Ir,subMenuCloseDelay:rr,forceSubMenuRender:Cn,builtinPlacements:bi,triggerSubMenuAction:yi,getPopupContainer:xi,itemIcon:Gn,expandIcon:Wn,onItemClick:Hl,onOpenChange:Cs},je.createElement(Ot.Provider,{value:Xi},as),je.createElement("div",{style:{display:"none"},"aria-hidden":!0},je.createElement(Xe.Provider,{value:La},ei)))))}),Yt=Et,St=Yt;St.Item=Zr,St.SubMenu=it,St.ItemGroup=hn,St.Divider=xn;var Gt=St},83836:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return Xt}});var pe=de(60499),ut=de(85899),$e=de(72190),ct=de(42244),Se=de(59301),Pe=de(92310),Ne=de.n(Pe),Ce=de(29301),ke=de(34280),Fe=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],gt=void 0;function Oe(Wt,ze){var xe=Wt.prefixCls,bt=Wt.invalidate,pn=Wt.item,Ut=Wt.renderItem,Ge=Wt.responsive,Ye=Wt.responsiveDisabled,It=Wt.registerSize,Mn=Wt.itemKey,jt=Wt.className,bn=Wt.style,Vt=Wt.children,Zt=Wt.display,zt=Wt.order,ve=Wt.component,se=ve===void 0?"div":ve,oe=(0,ct.Z)(Wt,Fe),fe=Ge&&!Zt;function ye(Jt){It(Mn,Jt)}Se.useEffect(function(){return function(){ye(null)}},[]);var ce=Ut&&pn!==gt?Ut(pn,{index:zt}):Vt,Ke;bt||(Ke={opacity:fe?0:1,height:fe?0:gt,overflowY:fe?"hidden":gt,order:Ge?zt:gt,pointerEvents:fe?"none":gt,position:fe?"absolute":gt});var Dt={};fe&&(Dt["aria-hidden"]=!0);var ln=Se.createElement(se,(0,pe.Z)({className:Ne()(!bt&&xe,jt),style:(0,ut.Z)((0,ut.Z)({},Ke),bn)},Dt,oe,{ref:ze}),ce);return Ge&&(ln=Se.createElement(Ce.Z,{onResize:function(en){var nn=en.offsetWidth;ye(nn)},disabled:Ye},ln)),ln}var je=Se.forwardRef(Oe);je.displayName="Item";var kt=je,et=de(6089),mt=de(4676),st=de(16089);function Rt(Wt){if(typeof MessageChannel=="undefined")(0,st.Z)(Wt);else{var ze=new MessageChannel;ze.port1.onmessage=function(){return Wt()},ze.port2.postMessage(void 0)}}function tn(){var Wt=Se.useRef(null),ze=function(bt){Wt.current||(Wt.current=[],Rt(function(){(0,mt.unstable_batchedUpdates)(function(){Wt.current.forEach(function(pn){pn()}),Wt.current=null})})),Wt.current.push(bt)};return ze}function nt(Wt,ze){var xe=Se.useState(ze),bt=(0,$e.Z)(xe,2),pn=bt[0],Ut=bt[1],Ge=(0,et.Z)(function(Ye){Wt(function(){Ut(Ye)})});return[pn,Ge]}var ht=Se.createContext(null),Ve=["component"],Ee=["className"],Xe=["className"],at=function(ze,xe){var bt=Se.useContext(ht);if(!bt){var pn=ze.component,Ut=pn===void 0?"div":pn,Ge=(0,ct.Z)(ze,Ve);return Se.createElement(Ut,(0,pe.Z)({},Ge,{ref:xe}))}var Ye=bt.className,It=(0,ct.Z)(bt,Ee),Mn=ze.className,jt=(0,ct.Z)(ze,Xe);return Se.createElement(ht.Provider,{value:null},Se.createElement(kt,(0,pe.Z)({ref:xe,className:Ne()(Ye,Mn)},It,jt)))},vt=Se.forwardRef(at);vt.displayName="RawItem";var Ue=vt,Ot=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","prefix","suffix","component","itemComponent","onVisibleChange"],rt="responsive",At="invalidate";function qe(Wt){return"+ ".concat(Wt.length," ...")}function Ht(Wt,ze){var xe=Wt.prefixCls,bt=xe===void 0?"rc-overflow":xe,pn=Wt.data,Ut=pn===void 0?[]:pn,Ge=Wt.renderItem,Ye=Wt.renderRawItem,It=Wt.itemKey,Mn=Wt.itemWidth,jt=Mn===void 0?10:Mn,bn=Wt.ssr,Vt=Wt.style,Zt=Wt.className,zt=Wt.maxCount,ve=Wt.renderRest,se=Wt.renderRawRest,oe=Wt.prefix,fe=Wt.suffix,ye=Wt.component,ce=ye===void 0?"div":ye,Ke=Wt.itemComponent,Dt=Wt.onVisibleChange,ln=(0,ct.Z)(Wt,Ot),Jt=bn==="full",en=tn(),nn=nt(en,null),wn=(0,$e.Z)(nn,2),mn=wn[0],En=wn[1],yt=mn||0,gn=nt(en,new Map),Jn=(0,$e.Z)(gn,2),tt=Jn[0],Re=Jn[1],Ze=nt(en,0),Ft=(0,$e.Z)(Ze,2),Qt=Ft[0],an=Ft[1],Pn=nt(en,0),On=(0,$e.Z)(Pn,2),Nn=On[0],Zn=On[1],tr=nt(en,0),Tn=(0,$e.Z)(tr,2),gr=Tn[0],Pr=Tn[1],Rr=nt(en,0),Zr=(0,$e.Z)(Rr,2),vr=Zr[0],Dr=Zr[1],yr=(0,Se.useState)(null),Nr=(0,$e.Z)(yr,2),Wr=Nr[0],Er=Nr[1],qr=(0,Se.useState)(null),zr=(0,$e.Z)(qr,2),ar=zr[0],or=zr[1],Bn=Se.useMemo(function(){return ar===null&&Jt?Number.MAX_SAFE_INTEGER:ar||0},[ar,mn]),In=(0,Se.useState)(!1),wr=(0,$e.Z)(In,2),Qe=wr[0],Me=wr[1],Ae="".concat(bt,"-item"),Le=Math.max(Qt,Nn),De=zt===rt,We=Ut.length&&De,it=zt===At,Nt=We||typeof zt=="number"&&Ut.length>zt,Lt=(0,Se.useMemo)(function(){var Pt=Ut;return We?mn===null&&Jt?Pt=Ut:Pt=Ut.slice(0,Math.min(Ut.length,yt/jt)):typeof zt=="number"&&(Pt=Ut.slice(0,zt)),Pt},[Ut,jt,mn,zt,We]),$t=(0,Se.useMemo)(function(){return We?Ut.slice(Bn+1):Ut.slice(Lt.length)},[Ut,Lt,We,Bn]),sn=(0,Se.useCallback)(function(Pt,Bt){var un;return typeof It=="function"?It(Pt):(un=It&&(Pt==null?void 0:Pt[It]))!==null&&un!==void 0?un:Bt},[It]),hn=(0,Se.useCallback)(Ge||function(Pt){return Pt},[Ge]);function xn(Pt,Bt,un){ar===Pt&&(Bt===void 0||Bt===Wr)||(or(Pt),un||(Me(Pt<Ut.length-1),Dt==null||Dt(Pt)),Bt!==void 0&&Er(Bt))}function Mt(Pt,Bt){En(Bt.clientWidth)}function rn(Pt,Bt){Re(function(un){var yn=new Map(un);return Bt===null?yn.delete(Pt):yn.set(Pt,Bt),yn})}function Je(Pt,Bt){Zn(Bt),an(Nn)}function pt(Pt,Bt){Pr(Bt)}function Ct(Pt,Bt){Dr(Bt)}function Et(Pt){return tt.get(sn(Lt[Pt],Pt))}(0,ke.Z)(function(){if(yt&&typeof Le=="number"&&Lt){var Pt=gr+vr,Bt=Lt.length,un=Bt-1;if(!Bt){xn(0,null);return}for(var yn=0;yn<Bt;yn+=1){var _n=Et(yn);if(Jt&&(_n=_n||0),_n===void 0){xn(yn-1,void 0,!0);break}if(Pt+=_n,un===0&&Pt<=yt||yn===un-1&&Pt+Et(un)<=yt){xn(un,null);break}else if(Pt+Le>yt){xn(yn-1,Pt-_n-vr+Nn);break}}fe&&Et(0)+vr>yt&&Er(null)}},[yt,tt,Nn,gr,vr,sn,Lt]);var Yt=Qe&&!!$t.length,St={};Wr!==null&&We&&(St={position:"absolute",left:Wr,top:0});var Gt={prefixCls:Ae,responsive:We,component:Ke,invalidate:it},Te=Ye?function(Pt,Bt){var un=sn(Pt,Bt);return Se.createElement(ht.Provider,{key:un,value:(0,ut.Z)((0,ut.Z)({},Gt),{},{order:Bt,item:Pt,itemKey:un,registerSize:rn,display:Bt<=Bn})},Ye(Pt,Bt))}:function(Pt,Bt){var un=sn(Pt,Bt);return Se.createElement(kt,(0,pe.Z)({},Gt,{order:Bt,key:un,item:Pt,renderItem:hn,itemKey:un,registerSize:rn,display:Bt<=Bn}))},dt={order:Yt?Bn:Number.MAX_SAFE_INTEGER,className:"".concat(Ae,"-rest"),registerSize:Je,display:Yt},ft=ve||qe,Tt=se?Se.createElement(ht.Provider,{value:(0,ut.Z)((0,ut.Z)({},Gt),dt)},se($t)):Se.createElement(kt,(0,pe.Z)({},Gt,dt),typeof ft=="function"?ft($t):ft),_t=Se.createElement(ce,(0,pe.Z)({className:Ne()(!it&&bt,Zt),style:Vt,ref:ze},ln),oe&&Se.createElement(kt,(0,pe.Z)({},Gt,{responsive:De,responsiveDisabled:!We,order:-1,className:"".concat(Ae,"-prefix"),registerSize:pt,display:!0}),oe),Lt.map(Te),Nt?Tt:null,fe&&Se.createElement(kt,(0,pe.Z)({},Gt,{responsive:De,responsiveDisabled:!We,order:Bn,className:"".concat(Ae,"-suffix"),registerSize:Ct,display:!0,style:St}),fe));return De?Se.createElement(Ce.Z,{onResize:Mt,disabled:!We},_t):_t}var cn=Se.forwardRef(Ht);cn.displayName="Overflow",cn.Item=Ue,cn.RESPONSIVE=rt,cn.INVALIDATE=At;var Kt=cn,Xt=Kt},17115:function(kn,dn,de){"use strict";de.d(dn,{ZP:function(){return Ne}});var pe=de(72190),ut=de(59301),$e=de(47273),ct=0,Se=(0,$e.Z)();function Pe(){var Ce;return Se?(Ce=ct,ct+=1):Ce="TEST_OR_SSR",Ce}function Ne(Ce){var ke=ut.useState(),Fe=(0,pe.Z)(ke,2),gt=Fe[0],Oe=Fe[1];return ut.useEffect(function(){Oe("rc_select_".concat(Pe()))},[]),Ce||gt}},77861:function(kn,dn,de){"use strict";de.d(dn,{Ac:function(){return mn},Xo:function(){return Nn},Wx:function(){return tr},ZP:function(){return Ae},lk:function(){return ht}});var pe=de(60499),ut=de(77654),$e=de(18642),ct=de(85899),Se=de(72190),Pe=de(42244),Ne=de(43749),Ce=de(18929),ke=de(48736),Fe=de(59301),gt=de(92310),Oe=de.n(gt),je=de(34280),kt=de(49658),et=de(10228),mt=de(8654),st=function(De){var We=De.className,it=De.customizeIcon,Nt=De.customizeIconProps,Lt=De.onMouseDown,$t=De.onClick,sn=De.children,hn;return typeof it=="function"?hn=it(Nt):hn=it,Fe.createElement("span",{className:We,onMouseDown:function(Mt){Mt.preventDefault(),Lt&&Lt(Mt)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:$t,"aria-hidden":!0},hn!==void 0?hn:Fe.createElement("span",{className:Oe()(We.split(/\s+/).map(function(xn){return"".concat(xn,"-icon")}))},sn))},Rt=st;function tn(Le,De,We,it,Nt){var Lt=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,$t=arguments.length>6?arguments[6]:void 0,sn=arguments.length>7?arguments[7]:void 0,hn=Fe.useMemo(function(){if((0,Ne.Z)(it)==="object")return it.clearIcon;if(Nt)return Nt},[it,Nt]),xn=Fe.useMemo(function(){return!!(!Lt&&it&&(We.length||$t)&&!(sn==="combobox"&&$t===""))},[it,Lt,We.length,$t,sn]);return{allowClear:xn,clearIcon:Fe.createElement(Rt,{className:"".concat(Le,"-clear"),onMouseDown:De,customizeIcon:hn},"\xD7")}}var nt=Fe.createContext(null);function ht(){return Fe.useContext(nt)}function Ve(){var Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,De=Fe.useState(!1),We=(0,Se.Z)(De,2),it=We[0],Nt=We[1],Lt=Fe.useRef(null),$t=function(){window.clearTimeout(Lt.current)};Fe.useEffect(function(){return $t},[]);var sn=function(xn,Mt){$t(),Lt.current=window.setTimeout(function(){Nt(xn),Mt&&Mt()},Le)};return[it,sn,$t]}function Ee(){var Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,De=Fe.useRef(null),We=Fe.useRef(null);Fe.useEffect(function(){return function(){window.clearTimeout(We.current)}},[]);function it(Nt){(Nt||De.current===null)&&(De.current=Nt),window.clearTimeout(We.current),We.current=window.setTimeout(function(){De.current=null},Le)}return[function(){return De.current},it]}function Xe(Le,De,We,it){var Nt=Fe.useRef(null);Nt.current={open:De,triggerOpen:We,customizedTrigger:it},Fe.useEffect(function(){function Lt($t){var sn;if(!((sn=Nt.current)!==null&&sn!==void 0&&sn.customizedTrigger)){var hn=$t.target;hn.shadowRoot&&$t.composed&&(hn=$t.composedPath()[0]||hn),Nt.current.open&&Le().filter(function(xn){return xn}).every(function(xn){return!xn.contains(hn)&&xn!==hn})&&Nt.current.triggerOpen(!1)}}return window.addEventListener("mousedown",Lt),function(){return window.removeEventListener("mousedown",Lt)}},[])}var at=de(26112),vt=de(83836),Ue=function(De,We){var it,Nt,Lt=De.prefixCls,$t=De.id,sn=De.inputElement,hn=De.disabled,xn=De.tabIndex,Mt=De.autoFocus,rn=De.autoComplete,Je=De.editable,pt=De.activeDescendantId,Ct=De.value,Et=De.maxLength,Yt=De.onKeyDown,St=De.onMouseDown,Gt=De.onChange,Te=De.onPaste,dt=De.onCompositionStart,ft=De.onCompositionEnd,Tt=De.open,_t=De.attrs,Pt=sn||Fe.createElement("input",null),Bt=Pt,un=Bt.ref,yn=Bt.props,_n=yn.onKeyDown,$n=yn.onChange,qn=yn.onMouseDown,sr=yn.onCompositionStart,jn=yn.onCompositionEnd,Ln=yn.style;return(0,ke.Kp)(!("maxLength"in Pt.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),Pt=Fe.cloneElement(Pt,(0,ct.Z)((0,ct.Z)((0,ct.Z)({type:"search"},yn),{},{id:$t,ref:(0,mt.sQ)(We,un),disabled:hn,tabIndex:xn,autoComplete:rn||"off",autoFocus:Mt,className:Oe()("".concat(Lt,"-selection-search-input"),(it=Pt)===null||it===void 0||(Nt=it.props)===null||Nt===void 0?void 0:Nt.className),role:"combobox","aria-label":"Search","aria-expanded":Tt||!1,"aria-haspopup":"listbox","aria-owns":"".concat($t,"_list"),"aria-autocomplete":"list","aria-controls":"".concat($t,"_list"),"aria-activedescendant":Tt?pt:void 0},_t),{},{value:Je?Ct:"",maxLength:Et,readOnly:!Je,unselectable:Je?null:"on",style:(0,ct.Z)((0,ct.Z)({},Ln),{},{opacity:Je?null:0}),onKeyDown:function(Qn){Yt(Qn),_n&&_n(Qn)},onMouseDown:function(Qn){St(Qn),qn&&qn(Qn)},onChange:function(Qn){Gt(Qn),$n&&$n(Qn)},onCompositionStart:function(Qn){dt(Qn),sr&&sr(Qn)},onCompositionEnd:function(Qn){ft(Qn),jn&&jn(Qn)},onPaste:Te})),Pt},Ot=Fe.forwardRef(Ue);Ot.displayName="Input";var rt=Ot;function At(Le){return Array.isArray(Le)?Le:Le!==void 0?[Le]:[]}var qe=typeof window!="undefined"&&window.document&&window.document.documentElement,Ht=qe;function cn(Le){return Le!=null}function Kt(Le){return!Le&&Le!==0}function Xt(Le){return["string","number"].includes((0,Ne.Z)(Le))}function Wt(Le){var De=void 0;return Le&&(Xt(Le.title)?De=Le.title.toString():Xt(Le.label)&&(De=Le.label.toString())),De}function ze(Le,De){Ht?Fe.useLayoutEffect(Le,De):Fe.useEffect(Le,De)}function xe(Le){var De;return(De=Le.key)!==null&&De!==void 0?De:Le.value}var bt=function(De){De.preventDefault(),De.stopPropagation()},pn=function(De){var We=De.id,it=De.prefixCls,Nt=De.values,Lt=De.open,$t=De.searchValue,sn=De.autoClearSearchValue,hn=De.inputRef,xn=De.placeholder,Mt=De.disabled,rn=De.mode,Je=De.showSearch,pt=De.autoFocus,Ct=De.autoComplete,Et=De.activeDescendantId,Yt=De.tabIndex,St=De.removeIcon,Gt=De.maxTagCount,Te=De.maxTagTextLength,dt=De.maxTagPlaceholder,ft=dt===void 0?function(_r){return"+ ".concat(_r.length," ...")}:dt,Tt=De.tagRender,_t=De.onToggleOpen,Pt=De.onRemove,Bt=De.onInputChange,un=De.onInputPaste,yn=De.onInputKeyDown,_n=De.onInputMouseDown,$n=De.onInputCompositionStart,qn=De.onInputCompositionEnd,sr=Fe.useRef(null),jn=(0,Fe.useState)(0),Ln=(0,Se.Z)(jn,2),ur=Ln[0],Qn=Ln[1],mr=(0,Fe.useState)(!1),Vn=(0,Se.Z)(mr,2),Un=Vn[0],br=Vn[1],lr="".concat(it,"-selection"),Ir=Lt||rn==="multiple"&&sn===!1||rn==="tags"?$t:"",Ur=rn==="tags"||rn==="multiple"&&sn===!1||Je&&(Lt||Un);ze(function(){Qn(sr.current.scrollWidth)},[Ir]);function rr(_r,Ar,dr,Sr,ii){return Fe.createElement("span",{className:Oe()("".concat(lr,"-item"),(0,$e.Z)({},"".concat(lr,"-item-disabled"),dr)),title:Wt(_r)},Fe.createElement("span",{className:"".concat(lr,"-item-content")},Ar),Sr&&Fe.createElement(Rt,{className:"".concat(lr,"-item-remove"),onMouseDown:bt,onClick:ii,customizeIcon:St},"\xD7"))}function Cn(_r,Ar,dr,Sr,ii){var zn=function(kr){bt(kr),_t(!Lt)};return Fe.createElement("span",{onMouseDown:zn},Tt({label:Ar,value:_r,disabled:dr,closable:Sr,onClose:ii}))}function Sn(_r){var Ar=_r.disabled,dr=_r.label,Sr=_r.value,ii=!Mt&&!Ar,zn=dr;if(typeof Te=="number"&&(typeof dr=="string"||typeof dr=="number")){var Xn=String(zn);Xn.length>Te&&(zn="".concat(Xn.slice(0,Te),"..."))}var kr=function(li){li&&li.stopPropagation(),Pt(_r)};return typeof Tt=="function"?Cn(Sr,zn,Ar,ii,kr):rr(_r,zn,Ar,ii,kr)}function fr(_r){var Ar=typeof ft=="function"?ft(_r):ft;return rr({title:Ar},Ar,!1)}var er=Fe.createElement("div",{className:"".concat(lr,"-search"),style:{width:ur},onFocus:function(){br(!0)},onBlur:function(){br(!1)}},Fe.createElement(rt,{ref:hn,open:Lt,prefixCls:it,id:We,inputElement:null,disabled:Mt,autoFocus:pt,autoComplete:Ct,editable:Ur,activeDescendantId:Et,value:Ir,onKeyDown:yn,onMouseDown:_n,onChange:Bt,onPaste:un,onCompositionStart:$n,onCompositionEnd:qn,tabIndex:Yt,attrs:(0,at.Z)(De,!0)}),Fe.createElement("span",{ref:sr,className:"".concat(lr,"-search-mirror"),"aria-hidden":!0},Ir,"\xA0")),Mr=Fe.createElement(vt.Z,{prefixCls:"".concat(lr,"-overflow"),data:Nt,renderItem:Sn,renderRest:fr,suffix:er,itemKey:xe,maxCount:Gt});return Fe.createElement(Fe.Fragment,null,Mr,!Nt.length&&!Ir&&Fe.createElement("span",{className:"".concat(lr,"-placeholder")},xn))},Ut=pn,Ge=function(De){var We=De.inputElement,it=De.prefixCls,Nt=De.id,Lt=De.inputRef,$t=De.disabled,sn=De.autoFocus,hn=De.autoComplete,xn=De.activeDescendantId,Mt=De.mode,rn=De.open,Je=De.values,pt=De.placeholder,Ct=De.tabIndex,Et=De.showSearch,Yt=De.searchValue,St=De.activeValue,Gt=De.maxLength,Te=De.onInputKeyDown,dt=De.onInputMouseDown,ft=De.onInputChange,Tt=De.onInputPaste,_t=De.onInputCompositionStart,Pt=De.onInputCompositionEnd,Bt=De.title,un=Fe.useState(!1),yn=(0,Se.Z)(un,2),_n=yn[0],$n=yn[1],qn=Mt==="combobox",sr=qn||Et,jn=Je[0],Ln=Yt||"";qn&&St&&!_n&&(Ln=St),Fe.useEffect(function(){qn&&$n(!1)},[qn,St]);var ur=Mt!=="combobox"&&!rn&&!Et?!1:!!Ln,Qn=Bt===void 0?Wt(jn):Bt,mr=function(){if(jn)return null;var Un=ur?{visibility:"hidden"}:void 0;return Fe.createElement("span",{className:"".concat(it,"-selection-placeholder"),style:Un},pt)};return Fe.createElement(Fe.Fragment,null,Fe.createElement("span",{className:"".concat(it,"-selection-search")},Fe.createElement(rt,{ref:Lt,prefixCls:it,id:Nt,open:rn,inputElement:We,disabled:$t,autoFocus:sn,autoComplete:hn,editable:sr,activeDescendantId:xn,value:Ln,onKeyDown:Te,onMouseDown:dt,onChange:function(Un){$n(!0),ft(Un)},onPaste:Tt,onCompositionStart:_t,onCompositionEnd:Pt,tabIndex:Ct,attrs:(0,at.Z)(De,!0),maxLength:qn?Gt:void 0})),!qn&&jn?Fe.createElement("span",{className:"".concat(it,"-selection-item"),title:Qn,style:ur?{visibility:"hidden"}:void 0},jn.label):null,mr())},Ye=Ge;function It(Le){return![et.Z.ESC,et.Z.SHIFT,et.Z.BACKSPACE,et.Z.TAB,et.Z.WIN_KEY,et.Z.ALT,et.Z.META,et.Z.WIN_KEY_RIGHT,et.Z.CTRL,et.Z.SEMICOLON,et.Z.EQUALS,et.Z.CAPS_LOCK,et.Z.CONTEXT_MENU,et.Z.F1,et.Z.F2,et.Z.F3,et.Z.F4,et.Z.F5,et.Z.F6,et.Z.F7,et.Z.F8,et.Z.F9,et.Z.F10,et.Z.F11,et.Z.F12].includes(Le)}var Mn=function(De,We){var it=(0,Fe.useRef)(null),Nt=(0,Fe.useRef)(!1),Lt=De.prefixCls,$t=De.open,sn=De.mode,hn=De.showSearch,xn=De.tokenWithEnter,Mt=De.autoClearSearchValue,rn=De.onSearch,Je=De.onSearchSubmit,pt=De.onToggleOpen,Ct=De.onInputKeyDown,Et=De.domRef;Fe.useImperativeHandle(We,function(){return{focus:function(){it.current.focus()},blur:function(){it.current.blur()}}});var Yt=Ee(0),St=(0,Se.Z)(Yt,2),Gt=St[0],Te=St[1],dt=function(Ln){var ur=Ln.which;(ur===et.Z.UP||ur===et.Z.DOWN)&&Ln.preventDefault(),Ct&&Ct(Ln),ur===et.Z.ENTER&&sn==="tags"&&!Nt.current&&!$t&&(Je==null||Je(Ln.target.value)),It(ur)&&pt(!0)},ft=function(){Te(!0)},Tt=(0,Fe.useRef)(null),_t=function(Ln){rn(Ln,!0,Nt.current)!==!1&&pt(!0)},Pt=function(){Nt.current=!0},Bt=function(Ln){Nt.current=!1,sn!=="combobox"&&_t(Ln.target.value)},un=function(Ln){var ur=Ln.target.value;if(xn&&Tt.current&&/[\r\n]/.test(Tt.current)){var Qn=Tt.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");ur=ur.replace(Qn,Tt.current)}Tt.current=null,_t(ur)},yn=function(Ln){var ur=Ln.clipboardData,Qn=ur.getData("text");Tt.current=Qn},_n=function(Ln){var ur=Ln.target;if(ur!==it.current){var Qn=document.body.style.msTouchAction!==void 0;Qn?setTimeout(function(){it.current.focus()}):it.current.focus()}},$n=function(Ln){var ur=Gt();Ln.target!==it.current&&!ur&&sn!=="combobox"&&Ln.preventDefault(),(sn!=="combobox"&&(!hn||!ur)||!$t)&&($t&&Mt!==!1&&rn("",!0,!1),pt())},qn={inputRef:it,onInputKeyDown:dt,onInputMouseDown:ft,onInputChange:un,onInputPaste:yn,onInputCompositionStart:Pt,onInputCompositionEnd:Bt},sr=sn==="multiple"||sn==="tags"?Fe.createElement(Ut,(0,pe.Z)({},De,qn)):Fe.createElement(Ye,(0,pe.Z)({},De,qn));return Fe.createElement("div",{ref:Et,className:"".concat(Lt,"-selector"),onClick:_n,onMouseDown:$n},sr)},jt=Fe.forwardRef(Mn);jt.displayName="Selector";var bn=jt,Vt=de(35593),Zt=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],zt=function(De){var We=De===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:We,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:We,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:We,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:We,adjustY:1},htmlRegion:"scroll"}}},ve=function(De,We){var it=De.prefixCls,Nt=De.disabled,Lt=De.visible,$t=De.children,sn=De.popupElement,hn=De.animation,xn=De.transitionName,Mt=De.dropdownStyle,rn=De.dropdownClassName,Je=De.direction,pt=Je===void 0?"ltr":Je,Ct=De.placement,Et=De.builtinPlacements,Yt=De.dropdownMatchSelectWidth,St=De.dropdownRender,Gt=De.dropdownAlign,Te=De.getPopupContainer,dt=De.empty,ft=De.getTriggerDOMNode,Tt=De.onPopupVisibleChange,_t=De.onPopupMouseEnter,Pt=(0,Pe.Z)(De,Zt),Bt="".concat(it,"-dropdown"),un=sn;St&&(un=St(sn));var yn=Fe.useMemo(function(){return Et||zt(Yt)},[Et,Yt]),_n=hn?"".concat(Bt,"-").concat(hn):xn,$n=typeof Yt=="number",qn=Fe.useMemo(function(){return $n?null:Yt===!1?"minWidth":"width"},[Yt,$n]),sr=Mt;$n&&(sr=(0,ct.Z)((0,ct.Z)({},sr),{},{width:Yt}));var jn=Fe.useRef(null);return Fe.useImperativeHandle(We,function(){return{getPopupElement:function(){return jn.current}}}),Fe.createElement(Vt.Z,(0,pe.Z)({},Pt,{showAction:Tt?["click"]:[],hideAction:Tt?["click"]:[],popupPlacement:Ct||(pt==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:yn,prefixCls:Bt,popupTransitionName:_n,popup:Fe.createElement("div",{ref:jn,onMouseEnter:_t},un),stretch:qn,popupAlign:Gt,popupVisible:Lt,getPopupContainer:Te,popupClassName:Oe()(rn,(0,$e.Z)({},"".concat(Bt,"-empty"),dt)),popupStyle:sr,getTriggerDOMNode:ft,onPopupVisibleChange:Tt}),$t)},se=Fe.forwardRef(ve);se.displayName="SelectTrigger";var oe=se,fe=de(48745);function ye(Le,De){var We=Le.key,it;return"value"in Le&&(it=Le.value),We!=null?We:it!==void 0?it:"rc-index-key-".concat(De)}function ce(Le,De){var We=Le||{},it=We.label,Nt=We.value,Lt=We.options,$t=We.groupLabel,sn=it||(De?"children":"label");return{label:sn,value:Nt||"value",options:Lt||"options",groupLabel:$t||sn}}function Ke(Le){var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},We=De.fieldNames,it=De.childrenAsData,Nt=[],Lt=ce(We,!1),$t=Lt.label,sn=Lt.value,hn=Lt.options,xn=Lt.groupLabel;function Mt(rn,Je){rn.forEach(function(pt){if(Je||!(hn in pt)){var Ct=pt[sn];Nt.push({key:ye(pt,Nt.length),groupOption:Je,data:pt,label:pt[$t],value:Ct})}else{var Et=pt[xn];Et===void 0&&it&&(Et=pt.label),Nt.push({key:ye(pt,Nt.length),group:!0,data:pt,label:Et}),Mt(pt[hn],!0)}})}return Mt(Le,!1),Nt}function Dt(Le){var De=(0,ct.Z)({},Le);return"props"in De||Object.defineProperty(De,"props",{get:function(){return(0,ke.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),De}}),De}function ln(Le,De){if(!De||!De.length)return null;var We=!1;function it(Lt,$t){var sn=(0,fe.Z)($t),hn=sn[0],xn=sn.slice(1);if(!hn)return[Lt];var Mt=Lt.split(hn);return We=We||Mt.length>1,Mt.reduce(function(rn,Je){return[].concat((0,ut.Z)(rn),(0,ut.Z)(it(Je,xn)))},[]).filter(function(rn){return rn})}var Nt=it(Le,De);return We?Nt:null}var Jt=["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","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],en=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function nn(Le){return Le==="tags"||Le==="multiple"}var wn=Fe.forwardRef(function(Le,De){var We,it,Nt=Le.id,Lt=Le.prefixCls,$t=Le.className,sn=Le.showSearch,hn=Le.tagRender,xn=Le.direction,Mt=Le.omitDomProps,rn=Le.displayValues,Je=Le.onDisplayValuesChange,pt=Le.emptyOptions,Ct=Le.notFoundContent,Et=Ct===void 0?"Not Found":Ct,Yt=Le.onClear,St=Le.mode,Gt=Le.disabled,Te=Le.loading,dt=Le.getInputElement,ft=Le.getRawInputElement,Tt=Le.open,_t=Le.defaultOpen,Pt=Le.onDropdownVisibleChange,Bt=Le.activeValue,un=Le.onActiveValueChange,yn=Le.activeDescendantId,_n=Le.searchValue,$n=Le.autoClearSearchValue,qn=Le.onSearch,sr=Le.onSearchSplit,jn=Le.tokenSeparators,Ln=Le.allowClear,ur=Le.suffixIcon,Qn=Le.clearIcon,mr=Le.OptionList,Vn=Le.animation,Un=Le.transitionName,br=Le.dropdownStyle,lr=Le.dropdownClassName,Ir=Le.dropdownMatchSelectWidth,Ur=Le.dropdownRender,rr=Le.dropdownAlign,Cn=Le.placement,Sn=Le.builtinPlacements,fr=Le.getPopupContainer,er=Le.showAction,Mr=er===void 0?[]:er,_r=Le.onFocus,Ar=Le.onBlur,dr=Le.onKeyUp,Sr=Le.onKeyDown,ii=Le.onMouseDown,zn=(0,Pe.Z)(Le,Jt),Xn=nn(St),kr=(sn!==void 0?sn:Xn)||St==="combobox",Br=(0,ct.Z)({},zn);en.forEach(function(Ei){delete Br[Ei]}),Mt==null||Mt.forEach(function(Ei){delete Br[Ei]});var li=Fe.useState(!1),di=(0,Se.Z)(li,2),ri=di[0],Yr=di[1];Fe.useEffect(function(){Yr((0,kt.Z)())},[]);var yi=Fe.useRef(null),bi=Fe.useRef(null),Gn=Fe.useRef(null),Wn=Fe.useRef(null),Hn=Fe.useRef(null),hr=Ve(),ni=(0,Se.Z)(hr,3),xi=ni[0],Mi=ni[1],gi=ni[2];Fe.useImperativeHandle(De,function(){var Ei,mi;return{focus:(Ei=Wn.current)===null||Ei===void 0?void 0:Ei.focus,blur:(mi=Wn.current)===null||mi===void 0?void 0:mi.blur,scrollTo:function(La){var Xi;return(Xi=Hn.current)===null||Xi===void 0?void 0:Xi.scrollTo(La)}}});var ci=Fe.useMemo(function(){var Ei;if(St!=="combobox")return _n;var mi=(Ei=rn[0])===null||Ei===void 0?void 0:Ei.value;return typeof mi=="string"||typeof mi=="number"?String(mi):""},[_n,St,rn]),ki=St==="combobox"&&typeof dt=="function"&&dt()||null,Hi=typeof ft=="function"&&ft(),$i=(0,mt.x1)(bi,Hi==null||(We=Hi.props)===null||We===void 0?void 0:We.ref),oa=Fe.useState(!1),Gr=(0,Se.Z)(oa,2),ei=Gr[0],Ai=Gr[1];(0,je.Z)(function(){Ai(!0)},[]);var ai=(0,Ce.Z)(!1,{defaultValue:_t,value:Tt}),fi=(0,Se.Z)(ai,2),_i=fi[0],pi=fi[1],Tr=ei?_i:!1,Xr=!Et&&pt;(Gt||Xr&&Tr&&St==="combobox")&&(Tr=!1);var Vr=Xr?!1:Tr,$r=Fe.useCallback(function(Ei){var mi=Ei!==void 0?Ei:!Tr;Gt||(pi(mi),Tr!==mi&&(Pt==null||Pt(mi)))},[Gt,Tr,pi,Pt]),ui=Fe.useMemo(function(){return(jn||[]).some(function(Ei){return[`
`,`\r
`].includes(Ei)})},[jn]),oi=function(mi,Ki,La){var Xi=!0,Ra=mi;un==null||un(null);var Fa=La?null:ln(mi,jn);return St!=="combobox"&&Fa&&(Ra="",sr==null||sr(Fa),$r(!1),Xi=!1),qn&&ci!==Ra&&qn(Ra,{source:Ki?"typing":"effect"}),Xi},zi=function(mi){!mi||!mi.trim()||qn(mi,{source:"submit"})};Fe.useEffect(function(){!Tr&&!Xn&&St!=="combobox"&&oi("",!1,!1)},[Tr]),Fe.useEffect(function(){_i&&Gt&&pi(!1),Gt&&Mi(!1)},[Gt]);var Wi=Ee(),Zi=(0,Se.Z)(Wi,2),na=Zi[0],wi=Zi[1],vi=function(mi){var Ki=na(),La=mi.which;if(La===et.Z.ENTER&&(St!=="combobox"&&mi.preventDefault(),Tr||$r(!0)),wi(!!ci),La===et.Z.BACKSPACE&&!Ki&&Xn&&!ci&&rn.length){for(var Xi=(0,ut.Z)(rn),Ra=null,Fa=Xi.length-1;Fa>=0;Fa-=1){var to=Xi[Fa];if(!to.disabled){Xi.splice(Fa,1),Ra=to;break}}Ra&&Je(Xi,{type:"remove",values:[Ra]})}for(var Na=arguments.length,so=new Array(Na>1?Na-1:0),lo=1;lo<Na;lo++)so[lo-1]=arguments[lo];if(Tr&&Hn.current){var Da;(Da=Hn.current).onKeyDown.apply(Da,[mi].concat(so))}Sr==null||Sr.apply(void 0,[mi].concat(so))},Gi=function(mi){for(var Ki=arguments.length,La=new Array(Ki>1?Ki-1:0),Xi=1;Xi<Ki;Xi++)La[Xi-1]=arguments[Xi];if(Tr&&Hn.current){var Ra;(Ra=Hn.current).onKeyUp.apply(Ra,[mi].concat(La))}dr==null||dr.apply(void 0,[mi].concat(La))},ca=function(mi){var Ki=rn.filter(function(La){return La!==mi});Je(Ki,{type:"remove",values:[mi]})},sa=Fe.useRef(!1),ta=function(){Mi(!0),Gt||(_r&&!sa.current&&_r.apply(void 0,arguments),Mr.includes("focus")&&$r(!0)),sa.current=!0},ts=function(){Mi(!1,function(){sa.current=!1,$r(!1)}),!Gt&&(ci&&(St==="tags"?qn(ci,{source:"submit"}):St==="multiple"&&qn("",{source:"blur"})),Ar&&Ar.apply(void 0,arguments))},ao=[];Fe.useEffect(function(){return function(){ao.forEach(function(Ei){return clearTimeout(Ei)}),ao.splice(0,ao.length)}},[]);var oo=function(mi){var Ki,La=mi.target,Xi=(Ki=Gn.current)===null||Ki===void 0?void 0:Ki.getPopupElement();if(Xi&&Xi.contains(La)){var Ra=setTimeout(function(){var so=ao.indexOf(Ra);if(so!==-1&&ao.splice(so,1),gi(),!ri&&!Xi.contains(document.activeElement)){var lo;(lo=Wn.current)===null||lo===void 0||lo.focus()}});ao.push(Ra)}for(var Fa=arguments.length,to=new Array(Fa>1?Fa-1:0),Na=1;Na<Fa;Na++)to[Na-1]=arguments[Na];ii==null||ii.apply(void 0,[mi].concat(to))},eo=Fe.useState({}),Ss=(0,Se.Z)(eo,2),fo=Ss[1];function Ea(){fo({})}var fa;Hi&&(fa=function(mi){$r(mi)}),Xe(function(){var Ei;return[yi.current,(Ei=Gn.current)===null||Ei===void 0?void 0:Ei.getPopupElement()]},Vr,$r,!!Hi);var bo=Fe.useMemo(function(){return(0,ct.Z)((0,ct.Z)({},Le),{},{notFoundContent:Et,open:Tr,triggerOpen:Vr,id:Nt,showSearch:kr,multiple:Xn,toggleOpen:$r})},[Le,Et,Vr,Tr,Nt,kr,Xn,$r]),ko=!!ur||Te,Eo;ko&&(Eo=Fe.createElement(Rt,{className:Oe()("".concat(Lt,"-arrow"),(0,$e.Z)({},"".concat(Lt,"-arrow-loading"),Te)),customizeIcon:ur,customizeIconProps:{loading:Te,searchValue:ci,open:Tr,focused:xi,showSearch:kr}}));var ns=function(){var mi;Yt==null||Yt(),(mi=Wn.current)===null||mi===void 0||mi.focus(),Je([],{type:"clear",values:rn}),oi("",!1,!1)},Ro=tn(Lt,ns,rn,Ln,Qn,Gt,ci,St),Xa=Ro.allowClear,Oa=Ro.clearIcon,Oi=Fe.createElement(mr,{ref:Hn}),Lo=Oe()(Lt,$t,(it={},(0,$e.Z)(it,"".concat(Lt,"-focused"),xi),(0,$e.Z)(it,"".concat(Lt,"-multiple"),Xn),(0,$e.Z)(it,"".concat(Lt,"-single"),!Xn),(0,$e.Z)(it,"".concat(Lt,"-allow-clear"),Ln),(0,$e.Z)(it,"".concat(Lt,"-show-arrow"),ko),(0,$e.Z)(it,"".concat(Lt,"-disabled"),Gt),(0,$e.Z)(it,"".concat(Lt,"-loading"),Te),(0,$e.Z)(it,"".concat(Lt,"-open"),Tr),(0,$e.Z)(it,"".concat(Lt,"-customize-input"),ki),(0,$e.Z)(it,"".concat(Lt,"-show-search"),kr),it)),rs=Fe.createElement(oe,{ref:Gn,disabled:Gt,prefixCls:Lt,visible:Vr,popupElement:Oi,animation:Vn,transitionName:Un,dropdownStyle:br,dropdownClassName:lr,direction:xn,dropdownMatchSelectWidth:Ir,dropdownRender:Ur,dropdownAlign:rr,placement:Cn,builtinPlacements:Sn,getPopupContainer:fr,empty:pt,getTriggerDOMNode:function(){return bi.current},onPopupVisibleChange:fa,onPopupMouseEnter:Ea},Hi?Fe.cloneElement(Hi,{ref:$i}):Fe.createElement(bn,(0,pe.Z)({},Le,{domRef:bi,prefixCls:Lt,inputElement:ki,ref:Wn,id:Nt,showSearch:kr,autoClearSearchValue:$n,mode:St,activeDescendantId:yn,tagRender:hn,values:rn,open:Tr,onToggleOpen:$r,activeValue:Bt,searchValue:ci,onSearch:oi,onSearchSubmit:zi,onRemove:ca,tokenWithEnter:ui}))),Do;return Hi?Do=rs:Do=Fe.createElement("div",(0,pe.Z)({className:Lo},Br,{ref:yi,onMouseDown:oo,onKeyDown:vi,onKeyUp:Gi,onFocus:ta,onBlur:ts}),xi&&!Tr&&Fe.createElement("span",{style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0},"aria-live":"polite"},"".concat(rn.map(function(Ei){var mi=Ei.label,Ki=Ei.value;return["number","string"].includes((0,Ne.Z)(mi))?mi:Ki}).join(", "))),rs,Eo,Xa&&Oa),Fe.createElement(nt.Provider,{value:bo},Do)}),mn=wn,En=function(Le,De){var We=Fe.useRef({values:new Map,options:new Map}),it=Fe.useMemo(function(){var Lt=We.current,$t=Lt.values,sn=Lt.options,hn=Le.map(function(rn){if(rn.label===void 0){var Je;return(0,ct.Z)((0,ct.Z)({},rn),{},{label:(Je=$t.get(rn.value))===null||Je===void 0?void 0:Je.label})}return rn}),xn=new Map,Mt=new Map;return hn.forEach(function(rn){xn.set(rn.value,rn),Mt.set(rn.value,De.get(rn.value)||sn.get(rn.value))}),We.current.values=xn,We.current.options=Mt,hn},[Le,De]),Nt=Fe.useCallback(function(Lt){return De.get(Lt)||We.current.options.get(Lt)},[De]);return[it,Nt]};function yt(Le,De){return At(Le).join("").toUpperCase().includes(De)}var gn=function(Le,De,We,it,Nt){return Fe.useMemo(function(){if(!We||it===!1)return Le;var Lt=De.options,$t=De.label,sn=De.value,hn=[],xn=typeof it=="function",Mt=We.toUpperCase(),rn=xn?it:function(pt,Ct){return Nt?yt(Ct[Nt],Mt):Ct[Lt]?yt(Ct[$t!=="children"?$t:"label"],Mt):yt(Ct[sn],Mt)},Je=xn?function(pt){return Dt(pt)}:function(pt){return pt};return Le.forEach(function(pt){if(pt[Lt]){var Ct=rn(We,Je(pt));if(Ct)hn.push(pt);else{var Et=pt[Lt].filter(function(Yt){return rn(We,Je(Yt))});Et.length&&hn.push((0,ct.Z)((0,ct.Z)({},pt),{},(0,$e.Z)({},Lt,Et)))}return}rn(We,Je(pt))&&hn.push(pt)}),hn},[Le,it,Nt,We,De])},Jn=de(17115),tt=de(11592),Re=["children","value"],Ze=["children"];function Ft(Le){var De=Le,We=De.key,it=De.props,Nt=it.children,Lt=it.value,$t=(0,Pe.Z)(it,Re);return(0,ct.Z)({key:We,value:Lt!==void 0?Lt:We,children:Nt},$t)}function Qt(Le){var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,tt.Z)(Le).map(function(We,it){if(!Fe.isValidElement(We)||!We.type)return null;var Nt=We,Lt=Nt.type.isSelectOptGroup,$t=Nt.key,sn=Nt.props,hn=sn.children,xn=(0,Pe.Z)(sn,Ze);return De||!Lt?Ft(We):(0,ct.Z)((0,ct.Z)({key:"__RC_SELECT_GRP__".concat($t===null?it:$t,"__"),label:$t},xn),{},{options:Qt(hn)})}).filter(function(We){return We})}function an(Le,De,We,it,Nt){return Fe.useMemo(function(){var Lt=Le,$t=!Le;$t&&(Lt=Qt(De));var sn=new Map,hn=new Map,xn=function(Je,pt,Ct){Ct&&typeof Ct=="string"&&Je.set(pt[Ct],pt)};function Mt(rn){for(var Je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,pt=0;pt<rn.length;pt+=1){var Ct=rn[pt];!Ct[We.options]||Je?(sn.set(Ct[We.value],Ct),xn(hn,Ct,We.label),xn(hn,Ct,it),xn(hn,Ct,Nt)):Mt(Ct[We.options],!0)}}return Mt(Lt),{options:Lt,valueOptions:sn,labelOptions:hn}},[Le,De,We,it,Nt])}function Pn(Le){var De=Fe.useRef();De.current=Le;var We=Fe.useCallback(function(){return De.current.apply(De,arguments)},[]);return We}var On=function(){return null};On.isSelectOptGroup=!0;var Nn=On,Zn=function(){return null};Zn.isSelectOption=!0;var tr=Zn,Tn=de(80547),gr=de(2738),Pr=de(48911),Rr=Fe.createContext(null),Zr=Rr;function vr(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var Dr=["disabled","title","children","style","className"];function yr(Le){return typeof Le=="string"||typeof Le=="number"}var Nr=function(De,We){var it=ht(),Nt=it.prefixCls,Lt=it.id,$t=it.open,sn=it.multiple,hn=it.mode,xn=it.searchValue,Mt=it.toggleOpen,rn=it.notFoundContent,Je=it.onPopupScroll,pt=Fe.useContext(Zr),Ct=pt.flattenOptions,Et=pt.onActiveValue,Yt=pt.defaultActiveFirstOption,St=pt.onSelect,Gt=pt.menuItemSelectedIcon,Te=pt.rawValues,dt=pt.fieldNames,ft=pt.virtual,Tt=pt.direction,_t=pt.listHeight,Pt=pt.listItemHeight,Bt="".concat(Nt,"-item"),un=(0,Tn.Z)(function(){return Ct},[$t,Ct],function(rr,Cn){return Cn[0]&&rr[1]!==Cn[1]}),yn=Fe.useRef(null),_n=function(Cn){Cn.preventDefault()},$n=function(Cn){yn.current&&yn.current.scrollTo(typeof Cn=="number"?{index:Cn}:Cn)},qn=function(Cn){for(var Sn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,fr=un.length,er=0;er<fr;er+=1){var Mr=(Cn+er*Sn+fr)%fr,_r=un[Mr],Ar=_r.group,dr=_r.data;if(!Ar&&!dr.disabled)return Mr}return-1},sr=Fe.useState(function(){return qn(0)}),jn=(0,Se.Z)(sr,2),Ln=jn[0],ur=jn[1],Qn=function(Cn){var Sn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;ur(Cn);var fr={source:Sn?"keyboard":"mouse"},er=un[Cn];if(!er){Et(null,-1,fr);return}Et(er.value,Cn,fr)};(0,Fe.useEffect)(function(){Qn(Yt!==!1?qn(0):-1)},[un.length,xn]);var mr=Fe.useCallback(function(rr){return Te.has(rr)&&hn!=="combobox"},[hn,(0,ut.Z)(Te).toString(),Te.size]);(0,Fe.useEffect)(function(){var rr=setTimeout(function(){if(!sn&&$t&&Te.size===1){var Sn=Array.from(Te)[0],fr=un.findIndex(function(er){var Mr=er.data;return Mr.value===Sn});fr!==-1&&(Qn(fr),$n(fr))}});if($t){var Cn;(Cn=yn.current)===null||Cn===void 0||Cn.scrollTo(void 0)}return function(){return clearTimeout(rr)}},[$t,xn,Ct.length]);var Vn=function(Cn){Cn!==void 0&&St(Cn,{selected:!Te.has(Cn)}),sn||Mt(!1)};if(Fe.useImperativeHandle(We,function(){return{onKeyDown:function(Cn){var Sn=Cn.which,fr=Cn.ctrlKey;switch(Sn){case et.Z.N:case et.Z.P:case et.Z.UP:case et.Z.DOWN:{var er=0;if(Sn===et.Z.UP?er=-1:Sn===et.Z.DOWN?er=1:vr()&&fr&&(Sn===et.Z.N?er=1:Sn===et.Z.P&&(er=-1)),er!==0){var Mr=qn(Ln+er,er);$n(Mr),Qn(Mr,!0)}break}case et.Z.ENTER:{var _r=un[Ln];_r&&!_r.data.disabled?Vn(_r.value):Vn(void 0),$t&&Cn.preventDefault();break}case et.Z.ESC:Mt(!1),$t&&Cn.stopPropagation()}},onKeyUp:function(){},scrollTo:function(Cn){$n(Cn)}}}),un.length===0)return Fe.createElement("div",{role:"listbox",id:"".concat(Lt,"_list"),className:"".concat(Bt,"-empty"),onMouseDown:_n},rn);var Un=Object.keys(dt).map(function(rr){return dt[rr]}),br=function(Cn){return Cn.label};function lr(rr,Cn){var Sn=rr.group;return{role:Sn?"presentation":"option",id:"".concat(Lt,"_list_").concat(Cn)}}var Ir=function(Cn){var Sn=un[Cn];if(!Sn)return null;var fr=Sn.data||{},er=fr.value,Mr=Sn.group,_r=(0,at.Z)(fr,!0),Ar=br(Sn);return Sn?Fe.createElement("div",(0,pe.Z)({"aria-label":typeof Ar=="string"&&!Mr?Ar:null},_r,{key:Cn},lr(Sn,Cn),{"aria-selected":mr(er)}),er):null},Ur={role:"listbox",id:"".concat(Lt,"_list")};return Fe.createElement(Fe.Fragment,null,ft&&Fe.createElement("div",(0,pe.Z)({},Ur,{style:{height:0,width:0,overflow:"hidden"}}),Ir(Ln-1),Ir(Ln),Ir(Ln+1)),Fe.createElement(Pr.Z,{itemKey:"key",ref:yn,data:un,height:_t,itemHeight:Pt,fullHeight:!1,onMouseDown:_n,onScroll:Je,virtual:ft,direction:Tt,innerProps:ft?null:Ur},function(rr,Cn){var Sn,fr=rr.group,er=rr.groupOption,Mr=rr.data,_r=rr.label,Ar=rr.value,dr=Mr.key;if(fr){var Sr,ii=(Sr=Mr.title)!==null&&Sr!==void 0?Sr:yr(_r)?_r.toString():void 0;return Fe.createElement("div",{className:Oe()(Bt,"".concat(Bt,"-group")),title:ii},_r!==void 0?_r:dr)}var zn=Mr.disabled,Xn=Mr.title,kr=Mr.children,Br=Mr.style,li=Mr.className,di=(0,Pe.Z)(Mr,Dr),ri=(0,gr.Z)(di,Un),Yr=mr(Ar),yi="".concat(Bt,"-option"),bi=Oe()(Bt,yi,li,(Sn={},(0,$e.Z)(Sn,"".concat(yi,"-grouped"),er),(0,$e.Z)(Sn,"".concat(yi,"-active"),Ln===Cn&&!zn),(0,$e.Z)(Sn,"".concat(yi,"-disabled"),zn),(0,$e.Z)(Sn,"".concat(yi,"-selected"),Yr),Sn)),Gn=br(rr),Wn=!Gt||typeof Gt=="function"||Yr,Hn=typeof Gn=="number"?Gn:Gn||Ar,hr=yr(Hn)?Hn.toString():void 0;return Xn!==void 0&&(hr=Xn),Fe.createElement("div",(0,pe.Z)({},(0,at.Z)(ri),ft?{}:lr(rr,Cn),{"aria-selected":Yr,className:bi,title:hr,onMouseMove:function(){Ln===Cn||zn||Qn(Cn)},onClick:function(){zn||Vn(Ar)},style:Br}),Fe.createElement("div",{className:"".concat(yi,"-content")},Hn),Fe.isValidElement(Gt)||Yr,Wn&&Fe.createElement(Rt,{className:"".concat(Bt,"-option-state"),customizeIcon:Gt,customizeIconProps:{isSelected:Yr}},Yr?"\u2713":null))}))},Wr=Fe.forwardRef(Nr);Wr.displayName="OptionList";var Er=Wr;function qr(Le){var De=Le.mode,We=Le.options,it=Le.children,Nt=Le.backfill,Lt=Le.allowClear,$t=Le.placeholder,sn=Le.getInputElement,hn=Le.showSearch,xn=Le.onSearch,Mt=Le.defaultOpen,rn=Le.autoFocus,Je=Le.labelInValue,pt=Le.value,Ct=Le.inputValue,Et=Le.optionLabelProp,Yt=isMultiple(De),St=hn!==void 0?hn:Yt||De==="combobox",Gt=We||convertChildrenToData(it);if(warning(De!=="tags"||Gt.every(function(Tt){return!Tt.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),De==="tags"||De==="combobox"){var Te=Gt.some(function(Tt){return Tt.options?Tt.options.some(function(_t){return typeof("value"in _t?_t.value:_t.key)=="number"}):typeof("value"in Tt?Tt.value:Tt.key)=="number"});warning(!Te,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(De!=="combobox"||!Et,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(De==="combobox"||!Nt,"`backfill` only works with `combobox` mode."),warning(De==="combobox"||!sn,"`getInputElement` only work with `combobox` mode."),noteOnce(De!=="combobox"||!sn||!Lt||!$t,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),xn&&!St&&De!=="combobox"&&De!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!Mt||rn,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),pt!=null){var dt=toArray(pt);warning(!Je||dt.every(function(Tt){return _typeof(Tt)==="object"&&("key"in Tt||"value"in Tt)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!Yt||Array.isArray(pt),"`value` should be array when `mode` is `multiple` or `tags`")}if(it){var ft=null;toNodeArray(it).some(function(Tt){if(!React.isValidElement(Tt)||!Tt.type)return!1;var _t=Tt,Pt=_t.type;if(Pt.isSelectOption)return!1;if(Pt.isSelectOptGroup){var Bt=toNodeArray(Tt.props.children).every(function(un){return!React.isValidElement(un)||!Tt.type||un.type.isSelectOption?!0:(ft=un.type,!1)});return!Bt}return ft=Pt,!0}),ft&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ft.displayName||ft.name||ft,"`.")),warning(Ct===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function zr(Le,De){if(Le){var We=function it(Nt){for(var Lt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,$t=0;$t<Nt.length;$t++){var sn=Nt[$t];if(sn[De==null?void 0:De.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!Lt&&Array.isArray(sn[De==null?void 0:De.options])&&it(sn[De==null?void 0:De.options],!0))break}};We(Le)}}var ar=null,or=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","value","defaultValue","labelInValue","onChange"],Bn=["inputValue"];function In(Le){return!Le||(0,Ne.Z)(Le)!=="object"}var wr=Fe.forwardRef(function(Le,De){var We=Le.id,it=Le.mode,Nt=Le.prefixCls,Lt=Nt===void 0?"rc-select":Nt,$t=Le.backfill,sn=Le.fieldNames,hn=Le.inputValue,xn=Le.searchValue,Mt=Le.onSearch,rn=Le.autoClearSearchValue,Je=rn===void 0?!0:rn,pt=Le.onSelect,Ct=Le.onDeselect,Et=Le.dropdownMatchSelectWidth,Yt=Et===void 0?!0:Et,St=Le.filterOption,Gt=Le.filterSort,Te=Le.optionFilterProp,dt=Le.optionLabelProp,ft=Le.options,Tt=Le.children,_t=Le.defaultActiveFirstOption,Pt=Le.menuItemSelectedIcon,Bt=Le.virtual,un=Le.direction,yn=Le.listHeight,_n=yn===void 0?200:yn,$n=Le.listItemHeight,qn=$n===void 0?20:$n,sr=Le.value,jn=Le.defaultValue,Ln=Le.labelInValue,ur=Le.onChange,Qn=(0,Pe.Z)(Le,or),mr=(0,Jn.ZP)(We),Vn=nn(it),Un=!!(!ft&&Tt),br=Fe.useMemo(function(){return St===void 0&&it==="combobox"?!1:St},[St,it]),lr=Fe.useMemo(function(){return ce(sn,Un)},[JSON.stringify(sn),Un]),Ir=(0,Ce.Z)("",{value:xn!==void 0?xn:hn,postState:function(Xr){return Xr||""}}),Ur=(0,Se.Z)(Ir,2),rr=Ur[0],Cn=Ur[1],Sn=an(ft,Tt,lr,Te,dt),fr=Sn.valueOptions,er=Sn.labelOptions,Mr=Sn.options,_r=Fe.useCallback(function(Tr){var Xr=At(Tr);return Xr.map(function(Vr){var $r,ui,oi,zi,Wi;if(In(Vr))$r=Vr;else{var Zi;oi=Vr.key,ui=Vr.label,$r=(Zi=Vr.value)!==null&&Zi!==void 0?Zi:oi}var na=fr.get($r);if(na){var wi;if(ui===void 0&&(ui=na==null?void 0:na[dt||lr.label]),oi===void 0&&(oi=(wi=na==null?void 0:na.key)!==null&&wi!==void 0?wi:$r),zi=na==null?void 0:na.disabled,Wi=na==null?void 0:na.title,0)var vi}return{label:ui,value:$r,key:oi,disabled:zi,title:Wi}})},[lr,dt,fr]),Ar=(0,Ce.Z)(jn,{value:sr}),dr=(0,Se.Z)(Ar,2),Sr=dr[0],ii=dr[1],zn=Fe.useMemo(function(){var Tr,Xr=_r(Sr);return it==="combobox"&&Kt((Tr=Xr[0])===null||Tr===void 0?void 0:Tr.value)?[]:Xr},[Sr,_r,it]),Xn=En(zn,fr),kr=(0,Se.Z)(Xn,2),Br=kr[0],li=kr[1],di=Fe.useMemo(function(){if(!it&&Br.length===1){var Tr=Br[0];if(Tr.value===null&&(Tr.label===null||Tr.label===void 0))return[]}return Br.map(function(Xr){var Vr;return(0,ct.Z)((0,ct.Z)({},Xr),{},{label:(Vr=Xr.label)!==null&&Vr!==void 0?Vr:Xr.value})})},[it,Br]),ri=Fe.useMemo(function(){return new Set(Br.map(function(Tr){return Tr.value}))},[Br]);Fe.useEffect(function(){if(it==="combobox"){var Tr,Xr=(Tr=Br[0])===null||Tr===void 0?void 0:Tr.value;Cn(cn(Xr)?String(Xr):"")}},[Br]);var Yr=Pn(function(Tr,Xr){var Vr,$r=Xr!=null?Xr:Tr;return Vr={},(0,$e.Z)(Vr,lr.value,Tr),(0,$e.Z)(Vr,lr.label,$r),Vr}),yi=Fe.useMemo(function(){if(it!=="tags")return Mr;var Tr=(0,ut.Z)(Mr),Xr=function($r){return fr.has($r)};return(0,ut.Z)(Br).sort(function(Vr,$r){return Vr.value<$r.value?-1:1}).forEach(function(Vr){var $r=Vr.value;Xr($r)||Tr.push(Yr($r,Vr.label))}),Tr},[Yr,Mr,fr,Br,it]),bi=gn(yi,lr,rr,br,Te),Gn=Fe.useMemo(function(){return it!=="tags"||!rr||bi.some(function(Tr){return Tr[Te||"value"]===rr})||bi.some(function(Tr){return Tr[lr.value]===rr})?bi:[Yr(rr)].concat((0,ut.Z)(bi))},[Yr,Te,it,bi,rr,lr]),Wn=Fe.useMemo(function(){return Gt?(0,ut.Z)(Gn).sort(function(Tr,Xr){return Gt(Tr,Xr)}):Gn},[Gn,Gt]),Hn=Fe.useMemo(function(){return Ke(Wn,{fieldNames:lr,childrenAsData:Un})},[Wn,lr,Un]),hr=function(Xr){var Vr=_r(Xr);if(ii(Vr),ur&&(Vr.length!==Br.length||Vr.some(function(oi,zi){var Wi;return((Wi=Br[zi])===null||Wi===void 0?void 0:Wi.value)!==(oi==null?void 0:oi.value)}))){var $r=Ln?Vr:Vr.map(function(oi){return oi.value}),ui=Vr.map(function(oi){return Dt(li(oi.value))});ur(Vn?$r:$r[0],Vn?ui:ui[0])}},ni=Fe.useState(null),xi=(0,Se.Z)(ni,2),Mi=xi[0],gi=xi[1],ci=Fe.useState(0),ki=(0,Se.Z)(ci,2),Hi=ki[0],$i=ki[1],oa=_t!==void 0?_t:it!=="combobox",Gr=Fe.useCallback(function(Tr,Xr){var Vr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},$r=Vr.source,ui=$r===void 0?"keyboard":$r;$i(Xr),$t&&it==="combobox"&&Tr!==null&&ui==="keyboard"&&gi(String(Tr))},[$t,it]),ei=function(Xr,Vr,$r){var ui=function(){var sa,ta=li(Xr);return[Ln?{label:ta==null?void 0:ta[lr.label],value:Xr,key:(sa=ta==null?void 0:ta.key)!==null&&sa!==void 0?sa:Xr}:Xr,Dt(ta)]};if(Vr&&pt){var oi=ui(),zi=(0,Se.Z)(oi,2),Wi=zi[0],Zi=zi[1];pt(Wi,Zi)}else if(!Vr&&Ct&&$r!=="clear"){var na=ui(),wi=(0,Se.Z)(na,2),vi=wi[0],Gi=wi[1];Ct(vi,Gi)}},Ai=Pn(function(Tr,Xr){var Vr,$r=Vn?Xr.selected:!0;$r?Vr=Vn?[].concat((0,ut.Z)(Br),[Tr]):[Tr]:Vr=Br.filter(function(ui){return ui.value!==Tr}),hr(Vr),ei(Tr,$r),it==="combobox"?gi(""):(!nn||Je)&&(Cn(""),gi(""))}),ai=function(Xr,Vr){hr(Xr);var $r=Vr.type,ui=Vr.values;($r==="remove"||$r==="clear")&&ui.forEach(function(oi){ei(oi.value,!1,$r)})},fi=function(Xr,Vr){if(Cn(Xr),gi(null),Vr.source==="submit"){var $r=(Xr||"").trim();if($r){var ui=Array.from(new Set([].concat((0,ut.Z)(ri),[$r])));hr(ui),ei($r,!0),Cn("")}return}Vr.source!=="blur"&&(it==="combobox"&&hr(Xr),Mt==null||Mt(Xr))},_i=function(Xr){var Vr=Xr;it!=="tags"&&(Vr=Xr.map(function(ui){var oi=er.get(ui);return oi==null?void 0:oi.value}).filter(function(ui){return ui!==void 0}));var $r=Array.from(new Set([].concat((0,ut.Z)(ri),(0,ut.Z)(Vr))));hr($r),$r.forEach(function(ui){ei(ui,!0)})},pi=Fe.useMemo(function(){var Tr=Bt!==!1&&Yt!==!1;return(0,ct.Z)((0,ct.Z)({},Sn),{},{flattenOptions:Hn,onActiveValue:Gr,defaultActiveFirstOption:oa,onSelect:Ai,menuItemSelectedIcon:Pt,rawValues:ri,fieldNames:lr,virtual:Tr,direction:un,listHeight:_n,listItemHeight:qn,childrenAsData:Un})},[Sn,Hn,Gr,oa,Ai,Pt,ri,lr,Bt,Yt,_n,qn,Un]);return Fe.createElement(Zr.Provider,{value:pi},Fe.createElement(mn,(0,pe.Z)({},Qn,{id:mr,prefixCls:Lt,ref:De,omitDomProps:Bn,mode:it,displayValues:di,onDisplayValuesChange:ai,direction:un,searchValue:rr,onSearch:fi,autoClearSearchValue:Je,onSearchSplit:_i,dropdownMatchSelectWidth:Yt,OptionList:Er,emptyOptions:!Hn.length,activeValue:Mi,activeDescendantId:"".concat(mr,"_list_").concat(Hi)})))}),Qe=wr;Qe.Option=tr,Qe.OptGroup=Nn;var Me=Qe,Ae=Me},9296:function(kn,dn,de){"use strict";de.r(dn),de.d(dn,{ResizableTextArea:function(){return Ot},default:function(){return Kt}});var pe=de(60499),ut=de(85899),$e=de(18642),ct=de(43749),Se=de(72190),Pe=de(42244),Ne=de(77654),Ce=de(92310),ke=de.n(Ce),Fe=de(93681),gt=de(5643),Oe=de(18929),je=de(59301),kt=de(29301),et=de(34280),mt=de(16089),st=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important;
pointer-events: none !important;
`,Rt=["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"],tn={},nt;function ht(Xt){var Wt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ze=Xt.getAttribute("id")||Xt.getAttribute("data-reactid")||Xt.getAttribute("name");if(Wt&&tn[ze])return tn[ze];var xe=window.getComputedStyle(Xt),bt=xe.getPropertyValue("box-sizing")||xe.getPropertyValue("-moz-box-sizing")||xe.getPropertyValue("-webkit-box-sizing"),pn=parseFloat(xe.getPropertyValue("padding-bottom"))+parseFloat(xe.getPropertyValue("padding-top")),Ut=parseFloat(xe.getPropertyValue("border-bottom-width"))+parseFloat(xe.getPropertyValue("border-top-width")),Ge=Rt.map(function(It){return"".concat(It,":").concat(xe.getPropertyValue(It))}).join(";"),Ye={sizingStyle:Ge,paddingSize:pn,borderSize:Ut,boxSizing:bt};return Wt&&ze&&(tn[ze]=Ye),Ye}function Ve(Xt){var Wt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ze=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,xe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;nt||(nt=document.createElement("textarea"),nt.setAttribute("tab-index","-1"),nt.setAttribute("aria-hidden","true"),document.body.appendChild(nt)),Xt.getAttribute("wrap")?nt.setAttribute("wrap",Xt.getAttribute("wrap")):nt.removeAttribute("wrap");var bt=ht(Xt,Wt),pn=bt.paddingSize,Ut=bt.borderSize,Ge=bt.boxSizing,Ye=bt.sizingStyle;nt.setAttribute("style","".concat(Ye,";").concat(st)),nt.value=Xt.value||Xt.placeholder||"";var It=void 0,Mn=void 0,jt,bn=nt.scrollHeight;if(Ge==="border-box"?bn+=Ut:Ge==="content-box"&&(bn-=pn),ze!==null||xe!==null){nt.value=" ";var Vt=nt.scrollHeight-pn;ze!==null&&(It=Vt*ze,Ge==="border-box"&&(It=It+pn+Ut),bn=Math.max(It,bn)),xe!==null&&(Mn=Vt*xe,Ge==="border-box"&&(Mn=Mn+pn+Ut),jt=bn>Mn?"":"hidden",bn=Math.min(Mn,bn))}var Zt={height:bn,overflowY:jt,resize:"none"};return It&&(Zt.minHeight=It),Mn&&(Zt.maxHeight=Mn),Zt}var Ee=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],Xe=0,at=1,vt=2,Ue=je.forwardRef(function(Xt,Wt){var ze=Xt,xe=ze.prefixCls,bt=ze.onPressEnter,pn=ze.defaultValue,Ut=ze.value,Ge=ze.autoSize,Ye=ze.onResize,It=ze.className,Mn=ze.style,jt=ze.disabled,bn=ze.onChange,Vt=ze.onInternalAutoSize,Zt=(0,Pe.Z)(ze,Ee),zt=(0,Oe.Z)(pn,{value:Ut,postState:function(Nn){return Nn!=null?Nn:""}}),ve=(0,Se.Z)(zt,2),se=ve[0],oe=ve[1],fe=function(Nn){oe(Nn.target.value),bn==null||bn(Nn)},ye=je.useRef();je.useImperativeHandle(Wt,function(){return{textArea:ye.current}});var ce=je.useMemo(function(){return Ge&&(0,ct.Z)(Ge)==="object"?[Ge.minRows,Ge.maxRows]:[]},[Ge]),Ke=(0,Se.Z)(ce,2),Dt=Ke[0],ln=Ke[1],Jt=!!Ge,en=function(){try{if(document.activeElement===ye.current){var Nn=ye.current,Zn=Nn.selectionStart,tr=Nn.selectionEnd,Tn=Nn.scrollTop;ye.current.setSelectionRange(Zn,tr),ye.current.scrollTop=Tn}}catch(gr){}},nn=je.useState(vt),wn=(0,Se.Z)(nn,2),mn=wn[0],En=wn[1],yt=je.useState(),gn=(0,Se.Z)(yt,2),Jn=gn[0],tt=gn[1],Re=function(){En(Xe)};(0,et.Z)(function(){Jt&&Re()},[Ut,Dt,ln,Jt]),(0,et.Z)(function(){if(mn===Xe)En(at);else if(mn===at){var On=Ve(ye.current,!1,Dt,ln);En(vt),tt(On)}else en()},[mn]);var Ze=je.useRef(),Ft=function(){mt.Z.cancel(Ze.current)},Qt=function(Nn){mn===vt&&(Ye==null||Ye(Nn),Ge&&(Ft(),Ze.current=(0,mt.Z)(function(){Re()})))};je.useEffect(function(){return Ft},[]);var an=Jt?Jn:null,Pn=(0,ut.Z)((0,ut.Z)({},Mn),an);return(mn===Xe||mn===at)&&(Pn.overflowY="hidden",Pn.overflowX="hidden"),je.createElement(kt.Z,{onResize:Qt,disabled:!(Ge||Ye)},je.createElement("textarea",(0,pe.Z)({},Zt,{ref:ye,style:Pn,className:ke()(xe,It,(0,$e.Z)({},"".concat(xe,"-disabled"),jt)),disabled:jt,value:se,onChange:fe})))}),Ot=Ue,rt=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","classes","showCount","className","style","disabled","hidden","classNames","styles","onResize"];function At(Xt,Wt){return(0,Ne.Z)(Xt||"").slice(0,Wt).join("")}function qe(Xt,Wt,ze,xe){var bt=ze;return Xt?bt=At(ze,xe):(0,Ne.Z)(Wt||"").length<ze.length&&(0,Ne.Z)(ze||"").length>xe&&(bt=Wt),bt}var Ht=je.forwardRef(function(Xt,Wt){var ze,xe=Xt.defaultValue,bt=Xt.value,pn=Xt.onFocus,Ut=Xt.onBlur,Ge=Xt.onChange,Ye=Xt.allowClear,It=Xt.maxLength,Mn=Xt.onCompositionStart,jt=Xt.onCompositionEnd,bn=Xt.suffix,Vt=Xt.prefixCls,Zt=Vt===void 0?"rc-textarea":Vt,zt=Xt.classes,ve=Xt.showCount,se=Xt.className,oe=Xt.style,fe=Xt.disabled,ye=Xt.hidden,ce=Xt.classNames,Ke=Xt.styles,Dt=Xt.onResize,ln=(0,Pe.Z)(Xt,rt),Jt=(0,Oe.Z)(xe,{value:bt,defaultValue:xe}),en=(0,Se.Z)(Jt,2),nn=en[0],wn=en[1],mn=(0,je.useRef)(null),En=je.useState(!1),yt=(0,Se.Z)(En,2),gn=yt[0],Jn=yt[1],tt=je.useState(!1),Re=(0,Se.Z)(tt,2),Ze=Re[0],Ft=Re[1],Qt=je.useRef(),an=je.useRef(0),Pn=je.useState(null),On=(0,Se.Z)(Pn,2),Nn=On[0],Zn=On[1],tr=function(){var In;(In=mn.current)===null||In===void 0||In.textArea.focus()};(0,je.useImperativeHandle)(Wt,function(){return{resizableTextArea:mn.current,focus:tr,blur:function(){var In;(In=mn.current)===null||In===void 0||In.textArea.blur()}}}),(0,je.useEffect)(function(){Jn(function(Bn){return!fe&&Bn})},[fe]);var Tn=Number(It)>0,gr=function(In){Ft(!0),Qt.current=nn,an.current=In.currentTarget.selectionStart,Mn==null||Mn(In)},Pr=function(In){Ft(!1);var wr=In.currentTarget.value;if(Tn){var Qe,Me=an.current>=It+1||an.current===((Qe=Qt.current)===null||Qe===void 0?void 0:Qe.length);wr=qe(Me,Qt.current,wr,It)}wr!==nn&&(wn(wr),(0,gt.rJ)(In.currentTarget,In,Ge,wr)),jt==null||jt(In)},Rr=function(In){var wr=In.target.value;if(!Ze&&Tn){var Qe=In.target.selectionStart>=It+1||In.target.selectionStart===wr.length||!In.target.selectionStart;wr=qe(Qe,nn,wr,It)}wn(wr),(0,gt.rJ)(In.currentTarget,In,Ge,wr)},Zr=function(In){var wr=ln.onPressEnter,Qe=ln.onKeyDown;In.key==="Enter"&&wr&&wr(In),Qe==null||Qe(In)},vr=function(In){Jn(!0),pn==null||pn(In)},Dr=function(In){Jn(!1),Ut==null||Ut(In)},yr=function(In){var wr;wn(""),tr(),(0,gt.rJ)((wr=mn.current)===null||wr===void 0?void 0:wr.textArea,In,Ge)},Nr=(0,gt.D7)(nn);!Ze&&Tn&&bt==null&&(Nr=At(Nr,It));var Wr=bn,Er;if(ve){var qr=(0,Ne.Z)(Nr).length;(0,ct.Z)(ve)==="object"?Er=ve.formatter({value:Nr,count:qr,maxLength:It}):Er="".concat(qr).concat(Tn?" / ".concat(It):""),Wr=je.createElement(je.Fragment,null,Wr,je.createElement("span",{className:ke()("".concat(Zt,"-data-count"),ce==null?void 0:ce.count),style:Ke==null?void 0:Ke.count},Er))}var zr=function(In){var wr;Dt==null||Dt(In),(wr=mn.current)!==null&&wr!==void 0&&wr.textArea.style.height&&Zn(!0)},ar=!ln.autoSize&&!ve&&!Ye,or=je.createElement(Fe.BaseInput,{value:Nr,allowClear:Ye,handleReset:yr,suffix:Wr,prefixCls:Zt,classes:{affixWrapper:ke()(zt==null?void 0:zt.affixWrapper,(ze={},(0,$e.Z)(ze,"".concat(Zt,"-show-count"),ve),(0,$e.Z)(ze,"".concat(Zt,"-textarea-allow-clear"),Ye),ze))},disabled:fe,focused:gn,className:se,style:(0,ut.Z)((0,ut.Z)({},oe),Nn&&!ar?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof Er=="string"?Er:void 0}},hidden:ye,inputElement:je.createElement(Ot,(0,pe.Z)({},ln,{onKeyDown:Zr,onChange:Rr,onFocus:vr,onBlur:Dr,onCompositionStart:gr,onCompositionEnd:Pr,className:ce==null?void 0:ce.textarea,style:(0,ut.Z)((0,ut.Z)({},Ke==null?void 0:Ke.textarea),{},{resize:oe==null?void 0:oe.resize}),disabled:fe,prefixCls:Zt,onResize:zr,ref:mn}))});return or}),cn=Ht,Kt=cn},48911:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return zt}});var pe=de(60499),ut=de(43749),$e=de(85899),ct=de(18642),Se=de(72190),Pe=de(42244),Ne=de(92310),Ce=de.n(Ne),ke=de(29301),Fe=de(70425),gt=de(34280),Oe=de(59301),je=de(4676),kt=Oe.forwardRef(function(ve,se){var oe=ve.height,fe=ve.offsetY,ye=ve.offsetX,ce=ve.children,Ke=ve.prefixCls,Dt=ve.onInnerResize,ln=ve.innerProps,Jt=ve.rtl,en=ve.extra,nn={},wn={display:"flex",flexDirection:"column"};return fe!==void 0&&(nn={height:oe,position:"relative",overflow:"hidden"},wn=(0,$e.Z)((0,$e.Z)({},wn),{},(0,ct.Z)((0,ct.Z)((0,ct.Z)((0,ct.Z)((0,ct.Z)({transform:"translateY(".concat(fe,"px)")},Jt?"marginRight":"marginLeft",-ye),"position","absolute"),"left",0),"right",0),"top",0))),Oe.createElement("div",{style:nn},Oe.createElement(ke.Z,{onResize:function(En){var yt=En.offsetHeight;yt&&Dt&&Dt()}},Oe.createElement("div",(0,pe.Z)({style:wn,className:Ce()((0,ct.Z)({},"".concat(Ke,"-holder-inner"),Ke)),ref:se},ln),ce,en)))});kt.displayName="Filler";var et=kt;function mt(ve){var se=ve.children,oe=ve.setRef,fe=Oe.useCallback(function(ye){oe(ye)},[]);return Oe.cloneElement(se,{ref:fe})}function st(ve,se,oe,fe,ye,ce,Ke,Dt){var ln=Dt.getKey;return ve.slice(se,oe+1).map(function(Jt,en){var nn=se+en,wn=Ke(Jt,nn,{style:{width:fe},offsetX:ye}),mn=ln(Jt);return Oe.createElement(mt,{key:mn,setRef:function(yt){return ce(Jt,yt)}},wn)})}function Rt(ve,se,oe,fe){var ye=oe-ve,ce=se-oe,Ke=Math.min(ye,ce)*2;if(fe<=Ke){var Dt=Math.floor(fe/2);return fe%2?oe+Dt+1:oe-Dt}return ye>ce?oe-(fe-ce):oe+(fe-ye)}function tn(ve,se,oe){var fe=ve.length,ye=se.length,ce,Ke;if(fe===0&&ye===0)return null;fe<ye?(ce=ve,Ke=se):(ce=se,Ke=ve);var Dt={__EMPTY_ITEM__:!0};function ln(En){return En!==void 0?oe(En):Dt}for(var Jt=null,en=Math.abs(fe-ye)!==1,nn=0;nn<Ke.length;nn+=1){var wn=ln(ce[nn]),mn=ln(Ke[nn]);if(wn!==mn){Jt=nn,en=en||wn!==ln(Ke[nn+1]);break}}return Jt===null?null:{index:Jt,multiple:en}}function nt(ve,se,oe){var fe=Oe.useState(ve),ye=(0,Se.Z)(fe,2),ce=ye[0],Ke=ye[1],Dt=Oe.useState(null),ln=(0,Se.Z)(Dt,2),Jt=ln[0],en=ln[1];return Oe.useEffect(function(){var nn=tn(ce||[],ve||[],se);(nn==null?void 0:nn.index)!==void 0&&(oe==null||oe(nn.index),en(ve[nn.index])),Ke(ve)},[ve]),[Jt]}var ht=de(16089),Ve=(typeof navigator=="undefined"?"undefined":(0,ut.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),Ee=Ve,Xe=function(ve,se,oe,fe){var ye=(0,Oe.useRef)(!1),ce=(0,Oe.useRef)(null);function Ke(){clearTimeout(ce.current),ye.current=!0,ce.current=setTimeout(function(){ye.current=!1},50)}var Dt=(0,Oe.useRef)({top:ve,bottom:se,left:oe,right:fe});return Dt.current.top=ve,Dt.current.bottom=se,Dt.current.left=oe,Dt.current.right=fe,function(ln,Jt){var en=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,nn=ln?Jt<0&&Dt.current.left||Jt>0&&Dt.current.right:Jt<0&&Dt.current.top||Jt>0&&Dt.current.bottom;return en&&nn?(clearTimeout(ce.current),ye.current=!1):(!nn||ye.current)&&Ke(),!ye.current&&nn}};function at(ve,se,oe,fe,ye,ce,Ke){var Dt=(0,Oe.useRef)(0),ln=(0,Oe.useRef)(null),Jt=(0,Oe.useRef)(null),en=(0,Oe.useRef)(!1),nn=Xe(se,oe,fe,ye);function wn(tt,Re){if(ht.Z.cancel(ln.current),!nn(!1,Re)){var Ze=tt;if(!Ze._virtualHandled)Ze._virtualHandled=!0;else return;Dt.current+=Re,Jt.current=Re,Ee||Ze.preventDefault(),ln.current=(0,ht.Z)(function(){var Ft=en.current?10:1;Ke(Dt.current*Ft,!1),Dt.current=0})}}function mn(tt,Re){Ke(Re,!0),Ee||tt.preventDefault()}var En=(0,Oe.useRef)(null),yt=(0,Oe.useRef)(null);function gn(tt){if(ve){ht.Z.cancel(yt.current),yt.current=(0,ht.Z)(function(){En.current=null},2);var Re=tt.deltaX,Ze=tt.deltaY,Ft=tt.shiftKey,Qt=Re,an=Ze;(En.current==="sx"||!En.current&&Ft&&Ze&&!Re)&&(Qt=Ze,an=0,En.current="sx");var Pn=Math.abs(Qt),On=Math.abs(an);En.current===null&&(En.current=ce&&Pn>On?"x":"y"),En.current==="y"?wn(tt,an):mn(tt,Qt)}}function Jn(tt){ve&&(en.current=tt.detail===Jt.current)}return[gn,Jn]}function vt(ve,se,oe,fe){var ye=Oe.useMemo(function(){return[new Map,[]]},[ve,oe.id,fe]),ce=(0,Se.Z)(ye,2),Ke=ce[0],Dt=ce[1],ln=function(en){var nn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:en,wn=Ke.get(en),mn=Ke.get(nn);if(wn===void 0||mn===void 0)for(var En=ve.length,yt=Dt.length;yt<En;yt+=1){var gn,Jn=ve[yt],tt=se(Jn);Ke.set(tt,yt);var Re=(gn=oe.get(tt))!==null&&gn!==void 0?gn:fe;if(Dt[yt]=(Dt[yt-1]||0)+Re,tt===en&&(wn=yt),tt===nn&&(mn=yt),wn!==void 0&&mn!==void 0)break}return{top:Dt[wn-1]||0,bottom:Dt[mn]}};return ln}var Ue=de(38705),Ot=de(17212),rt=function(){function ve(){(0,Ue.Z)(this,ve),(0,ct.Z)(this,"maps",void 0),(0,ct.Z)(this,"id",0),(0,ct.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,Ot.Z)(ve,[{key:"set",value:function(oe,fe){this.diffRecords.set(oe,this.maps[oe]),this.maps[oe]=fe,this.id+=1}},{key:"get",value:function(oe){return this.maps[oe]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),ve}(),At=rt;function qe(ve){var se=parseFloat(ve);return isNaN(se)?0:se}function Ht(ve,se,oe){var fe=Oe.useState(0),ye=(0,Se.Z)(fe,2),ce=ye[0],Ke=ye[1],Dt=(0,Oe.useRef)(new Map),ln=(0,Oe.useRef)(new At),Jt=(0,Oe.useRef)(0);function en(){Jt.current+=1}function nn(){var mn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;en();var En=function(){var Jn=!1;Dt.current.forEach(function(tt,Re){if(tt&&tt.offsetParent){var Ze=tt.offsetHeight,Ft=getComputedStyle(tt),Qt=Ft.marginTop,an=Ft.marginBottom,Pn=qe(Qt),On=qe(an),Nn=Ze+Pn+On;ln.current.get(Re)!==Nn&&(ln.current.set(Re,Nn),Jn=!0)}}),Jn&&Ke(function(tt){return tt+1})};if(mn)En();else{Jt.current+=1;var yt=Jt.current;Promise.resolve().then(function(){yt===Jt.current&&En()})}}function wn(mn,En){var yt=ve(mn),gn=Dt.current.get(yt);En?(Dt.current.set(yt,En),nn()):Dt.current.delete(yt),!gn!=!En&&(En?se==null||se(mn):oe==null||oe(mn))}return(0,Oe.useEffect)(function(){return en},[]),[wn,nn,ln.current,ce]}var cn=14/15;function Kt(ve,se,oe){var fe=(0,Oe.useRef)(!1),ye=(0,Oe.useRef)(0),ce=(0,Oe.useRef)(0),Ke=(0,Oe.useRef)(null),Dt=(0,Oe.useRef)(null),ln,Jt=function(mn){if(fe.current){var En=Math.ceil(mn.touches[0].pageX),yt=Math.ceil(mn.touches[0].pageY),gn=ye.current-En,Jn=ce.current-yt,tt=Math.abs(gn)>Math.abs(Jn);tt?ye.current=En:ce.current=yt;var Re=oe(tt,tt?gn:Jn,!1,mn);Re&&mn.preventDefault(),clearInterval(Dt.current),Re&&(Dt.current=setInterval(function(){tt?gn*=cn:Jn*=cn;var Ze=Math.floor(tt?gn:Jn);(!oe(tt,Ze,!0)||Math.abs(Ze)<=.1)&&clearInterval(Dt.current)},16))}},en=function(){fe.current=!1,ln()},nn=function(mn){ln(),mn.touches.length===1&&!fe.current&&(fe.current=!0,ye.current=Math.ceil(mn.touches[0].pageX),ce.current=Math.ceil(mn.touches[0].pageY),Ke.current=mn.target,Ke.current.addEventListener("touchmove",Jt,{passive:!1}),Ke.current.addEventListener("touchend",en,{passive:!0}))};ln=function(){Ke.current&&(Ke.current.removeEventListener("touchmove",Jt),Ke.current.removeEventListener("touchend",en))},(0,gt.Z)(function(){return ve&&se.current.addEventListener("touchstart",nn,{passive:!0}),function(){var wn;(wn=se.current)===null||wn===void 0||wn.removeEventListener("touchstart",nn),ln(),clearInterval(Dt.current)}},[ve])}function Xt(ve){return Math.floor(Math.pow(ve,.5))}function Wt(ve,se){var oe="touches"in ve?ve.touches[0]:ve;return oe[se?"pageX":"pageY"]-window[se?"scrollX":"scrollY"]}function ze(ve,se,oe){Oe.useEffect(function(){var fe=se.current;if(ve&&fe){var ye=!1,ce,Ke,Dt=function(){ht.Z.cancel(ce)},ln=function wn(){Dt(),ce=(0,ht.Z)(function(){oe(Ke),wn()})},Jt=function(){ye=!1,Dt()},en=function(mn){if(!(mn.target.draggable||mn.button!==0)){var En=mn;En._virtualHandled||(En._virtualHandled=!0,ye=!0)}},nn=function(mn){if(ye){var En=Wt(mn,!1),yt=fe.getBoundingClientRect(),gn=yt.top,Jn=yt.bottom;if(En<=gn){var tt=gn-En;Ke=-Xt(tt),ln()}else if(En>=Jn){var Re=En-Jn;Ke=Xt(Re),ln()}else Dt()}};return fe.addEventListener("mousedown",en),fe.ownerDocument.addEventListener("mouseup",Jt),fe.ownerDocument.addEventListener("mousemove",nn),fe.ownerDocument.addEventListener("dragend",Jt),function(){fe.removeEventListener("mousedown",en),fe.ownerDocument.removeEventListener("mouseup",Jt),fe.ownerDocument.removeEventListener("mousemove",nn),fe.ownerDocument.removeEventListener("dragend",Jt),Dt()}}},[ve])}var xe=10;function bt(ve,se,oe,fe,ye,ce,Ke,Dt){var ln=Oe.useRef(),Jt=Oe.useState(null),en=(0,Se.Z)(Jt,2),nn=en[0],wn=en[1];return(0,gt.Z)(function(){if(nn&&nn.times<xe){if(!ve.current){wn(function(Dr){return(0,$e.Z)({},Dr)});return}ce();var mn=nn.targetAlign,En=nn.originAlign,yt=nn.index,gn=nn.offset,Jn=ve.current.clientHeight,tt=!1,Re=mn,Ze=null;if(Jn){for(var Ft=mn||En,Qt=0,an=0,Pn=0,On=Math.min(se.length-1,yt),Nn=0;Nn<=On;Nn+=1){var Zn=ye(se[Nn]);an=Qt;var tr=oe.get(Zn);Pn=an+(tr===void 0?fe:tr),Qt=Pn}for(var Tn=Ft==="top"?gn:Jn-gn,gr=On;gr>=0;gr-=1){var Pr=ye(se[gr]),Rr=oe.get(Pr);if(Rr===void 0){tt=!0;break}if(Tn-=Rr,Tn<=0)break}switch(Ft){case"top":Ze=an-gn;break;case"bottom":Ze=Pn-Jn+gn;break;default:{var Zr=ve.current.scrollTop,vr=Zr+Jn;an<Zr?Re="top":Pn>vr&&(Re="bottom")}}Ze!==null&&Ke(Ze),Ze!==nn.lastTop&&(tt=!0)}tt&&wn((0,$e.Z)((0,$e.Z)({},nn),{},{times:nn.times+1,targetAlign:Re,lastTop:Ze}))}},[nn,ve.current]),function(mn){if(mn==null){Dt();return}if(ht.Z.cancel(ln.current),typeof mn=="number")Ke(mn);else if(mn&&(0,ut.Z)(mn)==="object"){var En,yt=mn.align;"index"in mn?En=mn.index:En=se.findIndex(function(tt){return ye(tt)===mn.key});var gn=mn.offset,Jn=gn===void 0?0:gn;wn({times:0,index:En,offset:Jn,originAlign:yt})}}}var pn=Oe.forwardRef(function(ve,se){var oe=ve.prefixCls,fe=ve.rtl,ye=ve.scrollOffset,ce=ve.scrollRange,Ke=ve.onStartMove,Dt=ve.onStopMove,ln=ve.onScroll,Jt=ve.horizontal,en=ve.spinSize,nn=ve.containerSize,wn=ve.style,mn=ve.thumbStyle,En=ve.showScrollBar,yt=Oe.useState(!1),gn=(0,Se.Z)(yt,2),Jn=gn[0],tt=gn[1],Re=Oe.useState(null),Ze=(0,Se.Z)(Re,2),Ft=Ze[0],Qt=Ze[1],an=Oe.useState(null),Pn=(0,Se.Z)(an,2),On=Pn[0],Nn=Pn[1],Zn=!fe,tr=Oe.useRef(),Tn=Oe.useRef(),gr=Oe.useState(En),Pr=(0,Se.Z)(gr,2),Rr=Pr[0],Zr=Pr[1],vr=Oe.useRef(),Dr=function(){En===!0||En===!1||(clearTimeout(vr.current),Zr(!0),vr.current=setTimeout(function(){Zr(!1)},3e3))},yr=ce-nn||0,Nr=nn-en||0,Wr=Oe.useMemo(function(){if(ye===0||yr===0)return 0;var Qe=ye/yr;return Qe*Nr},[ye,yr,Nr]),Er=function(Me){Me.stopPropagation(),Me.preventDefault()},qr=Oe.useRef({top:Wr,dragging:Jn,pageY:Ft,startTop:On});qr.current={top:Wr,dragging:Jn,pageY:Ft,startTop:On};var zr=function(Me){tt(!0),Qt(Wt(Me,Jt)),Nn(qr.current.top),Ke(),Me.stopPropagation(),Me.preventDefault()};Oe.useEffect(function(){var Qe=function(De){De.preventDefault()},Me=tr.current,Ae=Tn.current;return Me.addEventListener("touchstart",Qe,{passive:!1}),Ae.addEventListener("touchstart",zr,{passive:!1}),function(){Me.removeEventListener("touchstart",Qe),Ae.removeEventListener("touchstart",zr)}},[]);var ar=Oe.useRef();ar.current=yr;var or=Oe.useRef();or.current=Nr,Oe.useEffect(function(){if(Jn){var Qe,Me=function(De){var We=qr.current,it=We.dragging,Nt=We.pageY,Lt=We.startTop;ht.Z.cancel(Qe);var $t=tr.current.getBoundingClientRect(),sn=nn/(Jt?$t.width:$t.height);if(it){var hn=(Wt(De,Jt)-Nt)*sn,xn=Lt;!Zn&&Jt?xn-=hn:xn+=hn;var Mt=ar.current,rn=or.current,Je=rn?xn/rn:0,pt=Math.ceil(Je*Mt);pt=Math.max(pt,0),pt=Math.min(pt,Mt),Qe=(0,ht.Z)(function(){ln(pt,Jt)})}},Ae=function(){tt(!1),Dt()};return window.addEventListener("mousemove",Me,{passive:!0}),window.addEventListener("touchmove",Me,{passive:!0}),window.addEventListener("mouseup",Ae,{passive:!0}),window.addEventListener("touchend",Ae,{passive:!0}),function(){window.removeEventListener("mousemove",Me),window.removeEventListener("touchmove",Me),window.removeEventListener("mouseup",Ae),window.removeEventListener("touchend",Ae),ht.Z.cancel(Qe)}}},[Jn]),Oe.useEffect(function(){return Dr(),function(){clearTimeout(vr.current)}},[ye]),Oe.useImperativeHandle(se,function(){return{delayHidden:Dr}});var Bn="".concat(oe,"-scrollbar"),In={position:"absolute",visibility:Rr?null:"hidden"},wr={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return Jt?(Object.assign(In,{height:8,left:0,right:0,bottom:0}),Object.assign(wr,(0,ct.Z)({height:"100%",width:en},Zn?"left":"right",Wr))):(Object.assign(In,(0,ct.Z)({width:8,top:0,bottom:0},Zn?"right":"left",0)),Object.assign(wr,{width:"100%",height:en,top:Wr})),Oe.createElement("div",{ref:tr,className:Ce()(Bn,(0,ct.Z)((0,ct.Z)((0,ct.Z)({},"".concat(Bn,"-horizontal"),Jt),"".concat(Bn,"-vertical"),!Jt),"".concat(Bn,"-visible"),Rr)),style:(0,$e.Z)((0,$e.Z)({},In),wn),onMouseDown:Er,onMouseMove:Dr},Oe.createElement("div",{ref:Tn,className:Ce()("".concat(Bn,"-thumb"),(0,ct.Z)({},"".concat(Bn,"-thumb-moving"),Jn)),style:(0,$e.Z)((0,$e.Z)({},wr),mn),onMouseDown:zr}))}),Ut=pn,Ge=20;function Ye(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,oe=ve/se*ve;return isNaN(oe)&&(oe=0),oe=Math.max(oe,Ge),Math.floor(oe)}var It=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],Mn=[],jt={overflowY:"auto",overflowAnchor:"none"};function bn(ve,se){var oe=ve.prefixCls,fe=oe===void 0?"rc-virtual-list":oe,ye=ve.className,ce=ve.height,Ke=ve.itemHeight,Dt=ve.fullHeight,ln=Dt===void 0?!0:Dt,Jt=ve.style,en=ve.data,nn=ve.children,wn=ve.itemKey,mn=ve.virtual,En=ve.direction,yt=ve.scrollWidth,gn=ve.component,Jn=gn===void 0?"div":gn,tt=ve.onScroll,Re=ve.onVirtualScroll,Ze=ve.onVisibleChange,Ft=ve.innerProps,Qt=ve.extraRender,an=ve.styles,Pn=ve.showScrollBar,On=Pn===void 0?"optional":Pn,Nn=(0,Pe.Z)(ve,It),Zn=Oe.useCallback(function(zn){return typeof wn=="function"?wn(zn):zn==null?void 0:zn[wn]},[wn]),tr=Ht(Zn,null,null),Tn=(0,Se.Z)(tr,4),gr=Tn[0],Pr=Tn[1],Rr=Tn[2],Zr=Tn[3],vr=!!(mn!==!1&&ce&&Ke),Dr=Oe.useMemo(function(){return Object.values(Rr.maps).reduce(function(zn,Xn){return zn+Xn},0)},[Rr.id,Rr.maps]),yr=vr&&en&&(Math.max(Ke*en.length,Dr)>ce||!!yt),Nr=En==="rtl",Wr=Ce()(fe,(0,ct.Z)({},"".concat(fe,"-rtl"),Nr),ye),Er=en||Mn,qr=(0,Oe.useRef)(),zr=(0,Oe.useRef)(),ar=(0,Oe.useRef)(),or=(0,Oe.useState)(0),Bn=(0,Se.Z)(or,2),In=Bn[0],wr=Bn[1],Qe=(0,Oe.useState)(0),Me=(0,Se.Z)(Qe,2),Ae=Me[0],Le=Me[1],De=(0,Oe.useState)(!1),We=(0,Se.Z)(De,2),it=We[0],Nt=We[1],Lt=function(){Nt(!0)},$t=function(){Nt(!1)},sn={getKey:Zn};function hn(zn){wr(function(Xn){var kr;typeof zn=="function"?kr=zn(Xn):kr=zn;var Br=qn(kr);return qr.current.scrollTop=Br,Br})}var xn=(0,Oe.useRef)({start:0,end:Er.length}),Mt=(0,Oe.useRef)(),rn=nt(Er,Zn),Je=(0,Se.Z)(rn,1),pt=Je[0];Mt.current=pt;var Ct=Oe.useMemo(function(){if(!vr)return{scrollHeight:void 0,start:0,end:Er.length-1,offset:void 0};if(!yr){var zn;return{scrollHeight:((zn=zr.current)===null||zn===void 0?void 0:zn.offsetHeight)||0,start:0,end:Er.length-1,offset:void 0}}for(var Xn=0,kr,Br,li,di=Er.length,ri=0;ri<di;ri+=1){var Yr=Er[ri],yi=Zn(Yr),bi=Rr.get(yi),Gn=Xn+(bi===void 0?Ke:bi);Gn>=In&&kr===void 0&&(kr=ri,Br=Xn),Gn>In+ce&&li===void 0&&(li=ri),Xn=Gn}return kr===void 0&&(kr=0,Br=0,li=Math.ceil(ce/Ke)),li===void 0&&(li=Er.length-1),li=Math.min(li+1,Er.length-1),{scrollHeight:Xn,start:kr,end:li,offset:Br}},[yr,vr,In,Er,Zr,ce]),Et=Ct.scrollHeight,Yt=Ct.start,St=Ct.end,Gt=Ct.offset;xn.current.start=Yt,xn.current.end=St,Oe.useLayoutEffect(function(){var zn=Rr.getRecord();if(zn.size===1){var Xn=Array.from(zn.keys())[0],kr=zn.get(Xn),Br=Er[Yt];if(Br&&kr===void 0){var li=Zn(Br);if(li===Xn){var di=Rr.get(Xn),ri=di-Ke;hn(function(Yr){return Yr+ri})}}}Rr.resetRecord()},[Et]);var Te=Oe.useState({width:0,height:ce}),dt=(0,Se.Z)(Te,2),ft=dt[0],Tt=dt[1],_t=function(Xn){Tt({width:Xn.offsetWidth,height:Xn.offsetHeight})},Pt=(0,Oe.useRef)(),Bt=(0,Oe.useRef)(),un=Oe.useMemo(function(){return Ye(ft.width,yt)},[ft.width,yt]),yn=Oe.useMemo(function(){return Ye(ft.height,Et)},[ft.height,Et]),_n=Et-ce,$n=(0,Oe.useRef)(_n);$n.current=_n;function qn(zn){var Xn=zn;return Number.isNaN($n.current)||(Xn=Math.min(Xn,$n.current)),Xn=Math.max(Xn,0),Xn}var sr=In<=0,jn=In>=_n,Ln=Ae<=0,ur=Ae>=yt,Qn=Xe(sr,jn,Ln,ur),mr=function(){return{x:Nr?-Ae:Ae,y:In}},Vn=(0,Oe.useRef)(mr()),Un=(0,Fe.useEvent)(function(zn){if(Re){var Xn=(0,$e.Z)((0,$e.Z)({},mr()),zn);(Vn.current.x!==Xn.x||Vn.current.y!==Xn.y)&&(Re(Xn),Vn.current=Xn)}});function br(zn,Xn){var kr=zn;Xn?((0,je.flushSync)(function(){Le(kr)}),Un()):hn(kr)}function lr(zn){var Xn=zn.currentTarget.scrollTop;Xn!==In&&hn(Xn),tt==null||tt(zn),Un()}var Ir=function(Xn){var kr=Xn,Br=yt?yt-ft.width:0;return kr=Math.max(kr,0),kr=Math.min(kr,Br),kr},Ur=(0,Fe.useEvent)(function(zn,Xn){Xn?((0,je.flushSync)(function(){Le(function(kr){var Br=kr+(Nr?-zn:zn);return Ir(Br)})}),Un()):hn(function(kr){var Br=kr+zn;return Br})}),rr=at(vr,sr,jn,Ln,ur,!!yt,Ur),Cn=(0,Se.Z)(rr,2),Sn=Cn[0],fr=Cn[1];Kt(vr,qr,function(zn,Xn,kr,Br){var li=Br;return Qn(zn,Xn,kr)?!1:!li||!li._virtualHandled?(li&&(li._virtualHandled=!0),Sn({preventDefault:function(){},deltaX:zn?Xn:0,deltaY:zn?0:Xn}),!0):!1}),ze(yr,qr,function(zn){hn(function(Xn){return Xn+zn})}),(0,gt.Z)(function(){function zn(kr){var Br=sr&&kr.detail<0,li=jn&&kr.detail>0;vr&&!Br&&!li&&kr.preventDefault()}var Xn=qr.current;return Xn.addEventListener("wheel",Sn,{passive:!1}),Xn.addEventListener("DOMMouseScroll",fr,{passive:!0}),Xn.addEventListener("MozMousePixelScroll",zn,{passive:!1}),function(){Xn.removeEventListener("wheel",Sn),Xn.removeEventListener("DOMMouseScroll",fr),Xn.removeEventListener("MozMousePixelScroll",zn)}},[vr,sr,jn]),(0,gt.Z)(function(){if(yt){var zn=Ir(Ae);Le(zn),Un({x:zn})}},[ft.width,yt]);var er=function(){var Xn,kr;(Xn=Pt.current)===null||Xn===void 0||Xn.delayHidden(),(kr=Bt.current)===null||kr===void 0||kr.delayHidden()},Mr=bt(qr,Er,Rr,Ke,Zn,function(){return Pr(!0)},hn,er);Oe.useImperativeHandle(se,function(){return{nativeElement:ar.current,getScrollInfo:mr,scrollTo:function(Xn){function kr(Br){return Br&&(0,ut.Z)(Br)==="object"&&("left"in Br||"top"in Br)}kr(Xn)?(Xn.left!==void 0&&Le(Ir(Xn.left)),Mr(Xn.top)):Mr(Xn)}}}),(0,gt.Z)(function(){if(Ze){var zn=Er.slice(Yt,St+1);Ze(zn,Er)}},[Yt,St,Er]);var _r=vt(Er,Zn,Rr,Ke),Ar=Qt==null?void 0:Qt({start:Yt,end:St,virtual:yr,offsetX:Ae,offsetY:Gt,rtl:Nr,getSize:_r}),dr=st(Er,Yt,St,yt,Ae,gr,nn,sn),Sr=null;ce&&(Sr=(0,$e.Z)((0,ct.Z)({},ln?"height":"maxHeight",ce),jt),vr&&(Sr.overflowY="hidden",yt&&(Sr.overflowX="hidden"),it&&(Sr.pointerEvents="none")));var ii={};return Nr&&(ii.dir="rtl"),Oe.createElement("div",(0,pe.Z)({ref:ar,style:(0,$e.Z)((0,$e.Z)({},Jt),{},{position:"relative"}),className:Wr},ii,Nn),Oe.createElement(ke.Z,{onResize:_t},Oe.createElement(Jn,{className:"".concat(fe,"-holder"),style:Sr,ref:qr,onScroll:lr,onMouseEnter:er},Oe.createElement(et,{prefixCls:fe,height:Et,offsetX:Ae,offsetY:Gt,scrollWidth:yt,onInnerResize:Pr,ref:zr,innerProps:Ft,rtl:Nr,extra:Ar},dr))),yr&&Et>ce&&Oe.createElement(Ut,{ref:Pt,prefixCls:fe,scrollOffset:In,scrollRange:Et,rtl:Nr,onScroll:br,onStartMove:Lt,onStopMove:$t,spinSize:yn,containerSize:ft.height,style:an==null?void 0:an.verticalScrollBar,thumbStyle:an==null?void 0:an.verticalScrollBarThumb,showScrollBar:On}),yr&&yt>ft.width&&Oe.createElement(Ut,{ref:Bt,prefixCls:fe,scrollOffset:Ae,scrollRange:yt,rtl:Nr,onScroll:br,onStartMove:Lt,onStopMove:$t,spinSize:un,containerSize:ft.width,horizontal:!0,style:an==null?void 0:an.horizontalScrollBar,thumbStyle:an==null?void 0:an.horizontalScrollBarThumb,showScrollBar:On}))}var Vt=Oe.forwardRef(bn);Vt.displayName="List";var Zt=Vt,zt=Zt},48136:function(kn,dn,de){"use strict";var pe=Object.defineProperty,ut=Object.defineProperties,$e=Object.getOwnPropertyDescriptors,ct=Object.getOwnPropertySymbols,Se=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable,Ne=(a,y,b)=>y in a?pe(a,y,{enumerable:!0,configurable:!0,writable:!0,value:b}):a[y]=b,Ce=(a,y)=>{for(var b in y||(y={}))Se.call(y,b)&&Ne(a,b,y[b]);if(ct)for(var b of ct(y))Pe.call(y,b)&&Ne(a,b,y[b]);return a},ke=(a,y)=>ut(a,$e(y)),Fe=a=>typeof a=="symbol"?a:a+"",gt=(a,y)=>{var b={};for(var E in a)Se.call(a,E)&&y.indexOf(E)<0&&(b[E]=a[E]);if(a!=null&&ct)for(var E of ct(a))y.indexOf(E)<0&&Pe.call(a,E)&&(b[E]=a[E]);return b};function Oe(a){return Array.isArray(a)}var je={en:{"keyboard.tooltip.symbols":"\u7B26\u53F7","keyboard.tooltip.greek":"\u5E0C\u814A\u5B57\u6BCD","keyboard.tooltip.numeric":"\u6570\u5B57","keyboard.tooltip.alphabetic":"\u7F57\u9A6C\u5B57\u6BCD","tooltip.cut to clipboard":"\u526A\u5207\u5230\u526A\u8D34\u677F","tooltip.copy to clipboard":"\u590D\u5236\u5230\u526A\u8D34\u677F","tooltip.paste from clipboard":"\u7C98\u8D34","tooltip.redo":"\u91CD\u505A","tooltip.toggle virtual keyboard":"\u5207\u6362\u865A\u62DF\u952E\u76D8","tooltip.undo":"\u64A4\u6D88","menu.insert matrix":"\u63D2\u5165\u77E9\u9635","menu.borders":"\u77E9\u9635\u5206\u9694\u7B26","menu.array.add row above":"\u5728\u540E\u9762\u6DFB\u52A0\u884C","menu.array.add row below":"\u5728\u524D\u9762\u6DFB\u52A0\u884C","menu.array.add column after":"\u5728\u540E\u9762\u6DFB\u52A0\u5217r","menu.array.add column before":"\u5728\u524D\u9762\u6DFB\u52A0\u5217","menu.array.delete row":"\u5220\u9664\u884C","menu.array.delete rows":"\u5220\u9664\u9009\u5B9A\u884C","menu.array.delete column":"\u5220\u9664\u5217","menu.array.delete columns":"\u5220\u9664\u9009\u5B9A\u7684\u5217","menu.mode":"\u6A21\u5F0F","menu.mode-math":"\u6570\u5B66","menu.mode-text":"\u6587\u672C","menu.mode-latex":"LaTeX","tooltip.blackboard":"\u9ED1\u677F","tooltip.bold":"\u7C97\u4F53","tooltip.italic":"\u659C\u4F53","tooltip.fraktur":"Fraktur","tooltip.script":"\u811A\u672C","tooltip.caligraphic":"\u8349\u4E66","tooltip.typewriter":"\u6253\u5B57\u673A","tooltip.roman-upright":"\u7F57\u9A6C\u76F4\u7ACB","tooltip.row-by-col":"%@ \xD7 %@","menu.font-style":"\u5B57\u4F53\u6837\u5F0F","menu.accent":"\u91CD\u97F3","menu.decoration":"\u88C5\u9970","menu.color":"\u989C\u8272","menu.background-color":"\u80CC\u666F","menu.evaluate":"\u8BA1\u7B97","menu.simplify":"\u7B80\u5316","menu.solve":"\u6C42\u89E3","menu.solve-for":"\u6C42\u89E3 %@","menu.cut":"\u526A\u5207","menu.copy":"\u590D\u5236","menu.copy-as-latex":"\u590D\u5236\u4E3A LaTeX","menu.copy-as-ascii-math":"\u590D\u5236\u4E3A ASCII Math","menu.copy-as-mathml":"\u590D\u5236\u4E3A MathML","menu.paste":"\u7C98\u8D34","menu.select-all":"\u5168\u9009","color.red":"\u7EA2\u8272","color.orange":"\u6A59\u8272","color.yellow":"\u9EC4\u8272","color.lime":"\u7EFF\u9EC4\u8272","color.green":"\u7EFF\u8272","color.teal":"\u9752\u8272","color.cyan":"\u84DD\u7EFF\u8272","color.blue":"\u84DD\u8272","color.indigo":"\u975B\u84DD\u8272","color.purple":"\u7D2B\u8272","color.magenta":"\u6D0B\u7EA2\u8272","color.black":"\u9ED1\u8272","color.dark-grey":"\u6DF1\u7070\u8272","color.grey":"\u7070\u8272","color.light-grey":"\u6D45\u7070\u8272","color.white":"\u767D\u8272"}};function kt(){return"window"in globalThis&&"document"in globalThis}function et(){return"matchMedia"in window?window.matchMedia("(pointer: coarse)").matches:"ontouchstart"in window||navigator.maxTouchPoints>0}function mt(){return typeof navigator.vibrate=="function"}function st(){var a,y;if(!kt())return"other";const b=(y=(a=navigator.userAgentData)==null?void 0:a.platform)!=null?y:navigator.platform;return/^mac/i.test(b)?navigator.maxTouchPoints===5?"ios":"macos":/^win/i.test(b)?"windows":/android/i.test(navigator.userAgent)?"android":/iphone|ipod|ipad/i.test(navigator.userAgent)?"ios":/\bcros\b/i.test(navigator.userAgent)?"chromeos":"other"}function Rt(){if(!kt())return!0;if(/firefox/i.test(navigator.userAgent)){const a=navigator.userAgent.match(/firefox\/(\d+)/i);return a?parseInt(a[1])>=78:!1}if(/trident/i.test(navigator.userAgent))return!1;if(/edge/i.test(navigator.userAgent)){const a=navigator.userAgent.match(/edg\/(\d+)/i);return a?parseInt(a[1])>=79:!1}return!0}function tn(){return HTMLElement.prototype.hasOwnProperty("popover")}var nt={strings:je,_locale:"",_dirty:!1,_subscribers:[],_numberFormatter:void 0,get locale(){return nt._locale||(nt._locale=kt()?navigator.language.slice(0,5):"en-US"),nt._locale},set locale(a){nt._locale=a,nt._numberFormatter=void 0,nt.dirty=!0},get numberFormatter(){return nt._numberFormatter||(nt._numberFormatter=new Intl.NumberFormat(nt.locale)),nt._numberFormatter},merge(a,y){if(typeof a=="string"&&y)nt.strings[a]=Ce(Ce({},nt.strings[a]),y),nt.dirty=!0;else for(const b of Object.keys(a))nt.merge(b,a[b])},get dirty(){return nt._dirty},set dirty(a){nt._dirty||nt._dirty===a||(nt._dirty=!0,setTimeout(()=>{nt._dirty=!1,this._subscribers.forEach(y=>y==null?void 0:y())},0))},subscribe(a){return nt._subscribers.push(a),nt._subscribers.length-1},unsubscribe(a){a<0||a>=nt._subscribers.length||(nt._subscribers[a]=void 0)},update(a){let y=a.querySelectorAll("[data-l10n-tooltip]");for(const b of y){const E=b.getAttribute("data-l10n-tooltip");if(E){const ee=ht(E);ee&&b.setAttribute("data-tooltip",ee)}}y=a.querySelectorAll("[data-l10n-arial-label]");for(const b of y){const E=b.getAttribute("data-l10n-arial-label");if(E){const ee=ht(E);ee&&b.setAttribute("aria-label",ee)}}}};function ht(a,...y){if(a===void 0)return;let b="";const E=nt.locale;nt.strings[E]&&(b=nt.strings[E][a]);const ee=E.slice(0,2);if(!b&&nt.strings[ee]&&(b=nt.strings[ee][a]),b||(b=nt.strings.en[a]),!b)return;const re=/(%@|%([0-9]+)\$@)/g;let ae=re.exec(b),ue=0;for(;ae;){if(y[ue++]){const ge=ae[2]?parseInt(ae[2],10)-1:ue-1;let be=y[ge];typeof be=="number"&&(be=nt.numberFormatter.format(be)),b=b.replace(ae[1],be)}ae=re.exec(b)}return b=b.replace(/%%/g,"%"),b}var Ve={m0:"#3F3D99",m1:"#993D71",m2:"#998B3D",m3:"#3D9956",m4:"#3D5A99",m5:"#993D90",m6:"#996D3D",m7:"#43993D",m8:"#3D7999",m9:"#843D99"},Ee={blue:"#0072BD",orange:"#D95319",yellow:"#EDB120",purple:"#7E2F8E",green:"#77AC30",cyan:"#4DBEEE",red:"#A2142F"},Xe={red:"#fbbbb6",orange:"#ffe0c2",yellow:"#fff1c2",lime:"#d0e8b9",green:"#bceac4",teal:"#b9f1f1",cyan:"#b8e5c9",blue:"#b6d9fb",indigo:"#d1c2f0",purple:"#e3baf8",magenta:"#f9c8e0",black:"#353535","dark-grey":"#8C8C8C",grey:"#D0D0D0","light-grey":"#F0F0F0",white:"#ffffff"},at={red:"#d7170b",orange:"#fe8a2b",yellow:"#ffc02b",lime:"#63b215",green:"#21ba3a",teal:"#17cfcf",cyan:"#13a7ec",blue:"#0d80f2",indigo:"#63c",purple:"#a219e6",magenta:"#eb4799",black:"#000","dark-grey":"#666",grey:"#A6A6A6","light-grey":"#d4d5d2",white:"#ffffff"},vt={Red:"red",Orange:"orange",Yellow:"yellow",LimeGreen:"lime",Green:"green",TealBlue:"teal",Blue:"blue",Violet:"indigo",Purple:"purple",Magenta:"magenta",Black:"black",Gray:"grey",White:"white"},Ue={Apricot:"#FBB982",Aquamarine:"#00B5BE",Bittersweet:"#C04F17",Black:"#221E1F",Blue:"#2D2F92",BlueGreen:"#00B3B8",BlueViolet:"#473992",BrickRed:"#B6321C",Brown:"#792500",BurntOrange:"#F7921D",CadetBlue:"#74729A",CarnationPink:"#F282B4",Cerulean:"#00A2E3",CornflowerBlue:"#41B0E4",Cyan:"#00AEEF",Dandelion:"#FDBC42",DarkOrchid:"#A4538A",Emerald:"#00A99D",ForestGreen:"#009B55",Fuchsia:"#8C368C",Goldenrod:"#FFDF42",Gray:"#949698",Green:"#00A64F",GreenYellow:"#DFE674",JungleGreen:"#00A99A",Lavender:"#F49EC4",Limegreen:"#8DC73E",Magenta:"#EC008C",Mahogany:"#A9341F",Maroon:"#AF3235",Melon:"#F89E7B",MidnightBlue:"#006795",Mulberry:"#A93C93",NavyBlue:"#006EB8",OliveGreen:"#3C8031",Orange:"#F58137",OrangeRed:"#ED135A",Orchid:"#AF72B0",Peach:"#F7965A",Periwinkle:"#7977B8",PineGreen:"#008B72",Plum:"#92268F",ProcessBlue:"#00B0F0",Purple:"#99479B",RawSienna:"#974006",Red:"#ED1B23",RedOrange:"#F26035",RedViolet:"#A1246B",Rhodamine:"#EF559F",RoyalBlue:"#0071BC",RoyalPurple:"#613F99",RubineRed:"#ED017D",Salmon:"#F69289",SeaGreen:"#3FBC9D",Sepia:"#671800",SkyBlue:"#46C5DD",SpringGreen:"#C6DC67",Tan:"#DA9D76",TealBlue:"#00AEB3",Thistle:"#D883B7",Turquoise:"#00B4CE",Violet:"#58429B",VioletRed:"#EF58A0",White:"#FFFFFF",WildStrawberry:"#EE2967",Yellow:"#FFF200",YellowGreen:"#98CC70",YellowOrange:"#FAA21A"};function Ot(a){var y,b,E,ee,re,ae;const ue=a.split("!");let he,ge,be,Be=255,He=255,lt=255,xt=-1;const vn=ue.length>0&&ue[0].startsWith("-");vn&&(ue[0]=ue[0].slice(1));for(let nr=0;nr<ue.length;nr++){he=Be,ge=He,be=lt;const fn=(y=ue[nr].trim().match(/^([A-Za-z\d-]+)/))==null?void 0:y[1],Rn=fn==null?void 0:fn.toLowerCase(),cr=fn&&(ae=(re=(ee=(E=(b=at[Rn])!=null?b:at[vt[fn]])!=null?E:Ee[fn])!=null?ee:Ue[fn])!=null?re:Ve[fn])!=null?ae:ue[nr].trim();let Fn=cr.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if(Fn!=null&&Fn[1]&&Fn[2]&&Fn[3])Be=Math.max(0,Math.min(255,Number.parseInt(Fn[1],16))),He=Math.max(0,Math.min(255,Number.parseInt(Fn[2],16))),lt=Math.max(0,Math.min(255,Number.parseInt(Fn[3],16)));else if(Fn=cr.match(/^#([\da-f]{3})$/i),Fn!=null&&Fn[1]){const Hr=Number.parseInt(Fn[1][0],16),Jr=Number.parseInt(Fn[1][1],16),jr=Number.parseInt(Fn[1][2],16);Be=Math.max(0,Math.min(255,Hr*16+Hr)),He=Math.max(0,Math.min(255,Jr*16+Jr)),lt=Math.max(0,Math.min(255,jr*16+jr))}else if(Fn=cr.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i),Fn!=null&&Fn[1]&&Fn[2]&&Fn[3])Be=Math.max(0,Math.min(255,Number.parseInt(Fn[1]))),He=Math.max(0,Math.min(255,Number.parseInt(Fn[2]))),lt=Math.max(0,Math.min(255,Number.parseInt(Fn[3])));else return;xt>=0&&(Be=(1-xt)*Be+xt*he,He=(1-xt)*He+xt*ge,lt=(1-xt)*lt+xt*be,xt=-1),nr+1<ue.length&&(xt=Math.max(0,Math.min(100,Number.parseInt(ue[++nr])))/100)}return xt>=0&&(Be=xt*Be+(1-xt)*he,He=xt*He+(1-xt)*ge,lt=xt*lt+(1-xt)*be),vn&&(Be=255-Be,He=255-He,lt=255-lt),"#"+("00"+Math.round(Be).toString(16)).slice(-2)+("00"+Math.round(He).toString(16)).slice(-2)+("00"+Math.round(lt).toString(16)).slice(-2)}function rt(a){var y,b;return a=a.trim(),(b=(y=Xe[a.toLowerCase()])!=null?y:Xe[vt[a]])!=null?b:Ot(a)}function At(a){if(!a||a[0]!=="#")return;a=a.slice(1);let y;return a.length<=4?(y={r:parseInt(a[0]+a[0],16),g:parseInt(a[1]+a[1],16),b:parseInt(a[2]+a[2],16)},a.length===4&&(y.a=parseInt(a[3]+a[3],16)/255)):(y={r:parseInt(a[0]+a[1],16),g:parseInt(a[2]+a[3],16),b:parseInt(a[4]+a[5],16)},a.length===8&&(y.a=parseInt(a[6]+a[7],16)/255)),y&&y.a===void 0&&(y.a=1),y}function qe(a,y,b){return b<0&&(b+=6),b>=6&&(b-=6),b<1?(y-a)*b+a:b<3?y:b<4?(y-a)*(4-b)+a:a}function Ht(a){let[y,b,E]=[a.h,a.s,a.l];y=(y+360)%360/60,E=Math.max(0,Math.min(E,1)),b=Math.max(0,Math.min(b,1));const ee=E<=.5?E*(b+1):E+b-E*b,re=E*2-ee;return{r:Math.round(255*qe(re,ee,y+2)),g:Math.round(255*qe(re,ee,y)),b:Math.round(255*qe(re,ee,y-2))}}function cn(a){return a<0?0:a>255?255:Math.round(a)}function Kt(a){const{r:y,g:b,b:E}=a;let ee=((1<<24)+(cn(y)<<16)+(cn(b)<<8)+cn(E)).toString(16).slice(1);return ee[0]===ee[1]&&ee[2]===ee[3]&&ee[4]===ee[5]&&ee[6]===ee[7]&&(ee=ee[0]+ee[2]+ee[4]),"#"+ee}function Xt(a){let{r:y,g:b,b:E}=a;y=y/255,b=b/255,E=E/255;const ee=Math.min(y,b,E),re=Math.max(y,b,E),ae=re-ee;let ue,he;re===ee?ue=0:y===re?ue=(b-E)/ae:b===re?ue=2+(E-y)/ae:E===re&&(ue=4+(y-b)/ae),ue=Math.min(ue*60,360),ue<0&&(ue+=360);const ge=(ee+re)/2;return re===ee?he=0:ge<=.5?he=ae/(re+ee):he=ae/(2-re-ee),{h:ue,s:he,l:ge}}function Wt(a){let y=At(a);if(!y)return a;let{h:b,s:E,l:ee}=Xt(y);return E+=.1,ee-=.1,Kt(Ht({h:b,s:E,l:ee}))}var ze={60:"\\lt",62:"\\gt",111:"o",38:"\\&",123:"\\lbrace",125:"\\rbrace",91:"\\lbrack",93:"\\rbrack",58:"\\colon",160:"~",172:"\\neg",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8224:"\\dagger",8225:"\\ddagger",8230:"\\ldots",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",39:"\\prime",8592:"\\gets",8594:"\\to",9651:"\\triangle",9661:"\\triangledown",8715:"\\owns",8727:"\\ast",8739:"\\vert",8741:"\\Vert",8743:"\\land",8744:"\\lor",8901:"\\cdot",8904:"\\bowtie",8800:"\\ne",8804:"\\le",8805:"\\ge",8869:"\\bot",10231:"\\biconditional",10232:"\\impliedby",10233:"\\implies",10234:"\\iff",8450:"\\mathbb{C}",8469:"\\mathbb{N}",8473:"\\mathbb{P}",8474:"\\mathbb{Q}",8477:"\\mathbb{R}",8484:"\\mathbb{Z}",8461:"\\mathbb{H}",8476:"\\Re",8465:"\\Im",42:"\\ast",11036:"\\square",9633:"\\square",8720:"\\coprod",8716:"\\not\\ni",9671:"\\diamond",8846:"\\uplus",8851:"\\sqcap",8852:"\\sqcup",8768:"\\wr",8750:"\\oint",8226:"\\textbullet",8722:"-",978:"\\Upsilon"},xe={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},bt=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"main",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function pn(a,y,b){if(!/[A-Za-z\d]/.test(a)||(b==="up"&&(b=void 0),!y&&!b))return a;const E=a.codePointAt(0);if(E===void 0)return a;for(const ee of bt)if((!y||ee.variant===y)&&(!b||ee.style===b)&&E>=ee.offset&&E<ee.offset+ee.len){const re=ee.start+E-ee.offset;return String.fromCodePoint(xe[re]||re)}return a}function Ut(a){var y;if((a<119808||a>120831)&&(a<8448||a>8527))return{char:String.fromCodePoint(a)};for(const b in xe)if(xe[b]===a){a=(y=b.codePointAt(0))!=null?y:0;break}for(const b of bt)if(a>=b.start&&a<b.start+b.len)return{char:String.fromCodePoint(a-b.start+b.offset),variant:b.variant,style:b.style};return{char:String.fromCodePoint(a)}}function Ge(a){var y;let b="";for(const E of a){if("{}<>[]$&#^_%:'\u02DC".includes(E)){b+=E;continue}const ee=(y=E.codePointAt(0))!=null?y:0;let re=ze[ee];if(re)re.startsWith("\\")?b+=re+" ":b+=re;else{const{char:ae,variant:ue,style:he}=Ut(ee);switch(re=ae,ue){case"double-struck":re=`\\mathbb{${re}}`;break;case"fraktur":re=`\\mathfrak{${re}}`;break;case"script":re=`\\mathscr{${re}}`;break;case"sans-serif":re=`\\mathsf{${re}}`;break;case"monospace":re=`\\mathtt{${re}}`;break;case"calligraphic":re=`\\mathcal{${re}}`;break}switch(he){case"bold":re=`\\mathbf{${re}}`;break;case"italic":re=`\\mathit{${re}}`;break;case"bolditalic":re=`\\mathbfit{${re}}`;break}b+=re}}return b}function Ye(a){return a?Array.isArray(a)?a:typeof a=="object"&&"group"in a?a.group:[]:[]}var It={},Mn=Ce({},ze),jt={},bn={},Vt={darr:"\\downarrow",dArr:"\\Downarrow",Darr:"\\Downarrow",lang:"\\langle",rang:"\\rangle",uarr:"\\uparrow",uArr:"\\Uparrow",Uarr:"\\Uparrow",N:"\\mathbb{N}",R:"\\mathbb{R}",Z:"\\mathbb{Z}",alef:"\\aleph",alefsym:"\\aleph",Alpha:"\\mathrm{A}",Beta:"\\mathrm{B}",bull:"\\bullet",Chi:"\\mathrm{X}",clubs:"\\clubsuit",cnums:"\\mathbb{C}",Complex:"\\mathbb{C}",Dagger:"\\ddagger",diamonds:"\\diamondsuit",empty:"\\emptyset",Epsilon:"\\mathrm{E}",Eta:"\\mathrm{H}",exist:"\\exists",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",Harr:"\\Leftrightarrow",hearts:"\\heartsuit",image:"\\Im",infin:"\\infty",Iota:"\\mathrm{I}",isin:"\\in",Kappa:"\\mathrm{K}",larr:"\\leftarrow",lArr:"\\Leftarrow",Larr:"\\Leftarrow",lrarr:"\\leftrightarrow",lrArr:"\\Leftrightarrow",Lrarr:"\\Leftrightarrow",Mu:"\\mathrm{M}",natnums:"\\mathbb{N}",Nu:"\\mathrm{N}",Omicron:"\\mathrm{O}",plusmn:"\\pm",rarr:"\\rightarrow",rArr:"\\Rightarrow",Rarr:"\\Rightarrow",real:"\\Re",reals:"\\mathbb{R}",Reals:"\\mathbb{R}",Rho:"\\mathrm{P}",sdot:"\\cdot",sect:"\\S",spades:"\\spadesuit",sub:"\\subset",sube:"\\subseteq",supe:"\\supseteq",Tau:"\\mathrm{T}",thetasym:"\\vartheta",weierp:"\\wp",Zeta:"\\mathrm{Z}"},Zt={varGamma:"\\mathit{\\Gamma}",varDelta:"\\mathit{\\Delta}",varTheta:"\\mathit{\\Theta}",varLambda:"\\mathit{\\Lambda}",varXi:"\\mathit{\\Xi}",varPi:"\\mathit{\\Pi}",varSigma:"\\mathit{\\Sigma}",varUpsilon:"\\mathit{\\Upsilon}",varPhi:"\\mathit{\\Phi}",varPsi:"\\mathit{\\Psi}",varOmega:"\\mathit{\\Omega}",pmod:{def:"\\quad(\\operatorname{mod}\\ #1)",args:1,expand:!1,captureSelection:!1},mod:{def:"\\quad\\operatorname{mod}\\,\\,#1",args:1,expand:!1},bmod:{def:"\\;\\mathbin{\\operatorname{mod }}",expand:!1}},zt={bra:{def:"\\mathinner{\\langle{#1}|}",args:1,captureSelection:!1},ket:{def:"\\mathinner{|{#1}\\rangle}",args:1,captureSelection:!1},braket:{def:"\\mathinner{\\langle{#1}\\rangle}",args:1,captureSelection:!1},set:{def:"\\mathinner{\\lbrace #1 \\rbrace}",args:1,captureSelection:!1},Bra:{def:"\\left\\langle #1\\right|",args:1,captureSelection:!1},Ket:{def:"\\left|#1\\right\\rangle",args:1,captureSelection:!1},Braket:{def:"\\left\\langle{#1}\\right\\rangle",args:1,captureSelection:!1},Set:{def:"\\left\\lbrace #1 \\right\\rbrace",args:1,captureSelection:!1}},ve={iff:{primitive:!0,captureSelection:!0,def:"\\;\u27FA\\;"},nicefrac:"^{#1}\\!\\!/\\!_{#2}",phase:{def:"\\enclose{phasorangle}{#1}",args:1,captureSelection:!1},rd:"\\mathrm{d}",rD:"\\mathrm{D}",doubleStruckCapitalN:"\\mathbb{N}",doubleStruckCapitalR:"\\mathbb{R}",doubleStruckCapitalQ:"\\mathbb{Q}",doubleStruckCapitalZ:"\\mathbb{Z}",doubleStruckCapitalP:"\\mathbb{P}",scriptCapitalE:"\\mathscr{E}",scriptCapitalH:"\\mathscr{H}",scriptCapitalL:"\\mathscr{L}",gothicCapitalC:"\\mathfrak{C}",gothicCapitalH:"\\mathfrak{H}",gothicCapitalI:"\\mathfrak{I}",gothicCapitalR:"\\mathfrak{R}",imaginaryI:"\\mathrm{i}",imaginaryJ:"\\mathrm{j}",exponentialE:"\\mathrm{e}",differentialD:"\\mathrm{d}",capitalDifferentialD:"\\mathrm{D}",mathstrut:{def:"\\vphantom{(}",primitive:!0},angl:"\\enclose{actuarial}{#1}",angln:"\\enclose{actuarial}{n}",anglr:"\\enclose{actuarial}{r}",anglk:"\\enclose{actuarial}{k}",mathtools:{primitive:!0,package:{ordinarycolon:":",vcentcolon:"\\mathrel{\\mathop\\ordinarycolon}",dblcolon:'{\\mathop{\\char"2237}}',coloneqq:'{\\mathop{\\char"2254}}',Coloneqq:'{\\mathop{\\char"2237\\char"3D}}',coloneq:'{\\mathop{\\char"3A\\char"2212}}',Coloneq:'{\\mathop{\\char"2237\\char"2212}}',eqqcolon:'{\\mathop{\\char"2255}}',Eqqcolon:'{\\mathop{\\char"3D\\char"2237}}',eqcolon:'{\\mathop{\\char"2239}}',Eqcolon:'{\\mathop{\\char"2212\\char"2237}}',colonapprox:'{\\mathop{\\char"003A\\char"2248}}',Colonapprox:'{\\mathop{\\char"2237\\char"2248}}',colonsim:'{\\mathop{\\char"3A\\char"223C}}',Colonsim:'{\\mathop{\\char"2237\\char"223C}}',colondash:"\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}",Colondash:"\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}",dashcolon:"\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Dashcolon:"\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}"}},ratio:"\\vcentcolon",coloncolon:"\\dblcolon",colonequals:"\\coloneq",coloncolonequals:"\\Coloneq",equalscolon:"\\eqcolon",equalscoloncolon:"\\Eqcolon",colonminus:"\\colondash",coloncolonminus:"\\Colondash",minuscolon:"\\dashcolon",minuscoloncolon:"\\Dashcolon",coloncolonapprox:"\\Colonapprox",coloncolonsim:"\\Colonsim",simcolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Simcolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",simcoloncolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",approxcolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Approxcolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",approxcoloncolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",notni:"\\mathrel{\\char`\u220C}",limsup:"\\operatorname*{lim\\,sup}",liminf:"\\operatorname*{lim\\,inf}",injlim:"\\operatorname*{inj\\,lim}",projlim:"\\operatorname*{proj\\,lim}",varlimsup:"\\operatorname*{\\overline{lim}}",varliminf:"\\operatorname*{\\underline{lim}}",varinjlim:"\\operatorname*{\\underrightarrow{lim}}",varprojlim:"\\operatorname*{\\underleftarrow{lim}}",argmin:"\\operatorname*{arg\\,min}",argmax:"\\operatorname*{arg\\,max}",plim:"\\mathop{\\operatorname{plim}}\\limits",tripledash:{def:"\\vphantom{-}\\raise{4mu}{\\mkern1.5mu\\rule{2mu}{1.5mu}\\mkern{2.25mu}\\rule{2mu}{1.5mu}\\mkern{2.25mu}\\rule{2mu}{1.5mu}\\mkern{2mu}}",expand:!0},"braket.sty":{package:zt},"amsmath.sty":{package:Zt,primitive:!0},"texvc.sty":{package:Vt,primitive:!1}},se={" ":32,"\\!":33,"\\#":35,"\\$":36,"\\%":37,"\\&":38,"-":45,"\\textunderscore":95,"\\euro":8364,"\\maltese":10016,"\\{":123,"\\}":125,"\\textbraceleft":123,"\\textbraceright":125,"\\lbrace":123,"\\rbrace":125,"\\lbrack":91,"\\rbrack":93,"\\nobreakspace":160,"\\ldots":8230,"\\textellipsis":8230,"\\backslash":92,"`":8216,"'":8217,"``":8220,"''":8221,"\\degree":176,"\\textasciicircum":94,"\\textasciitilde":126,"\\textasteriskcentered":42,"\\textbackslash":92,"\\textbullet":8226,"\\textdollar":36,"\\textsterling":163,"\\textdagger":8224,"\\textdaggerdbl":8225,"\u2013":8211,"\u2014":8212,"\u2018":8216,"\u2019":8217,"\u201C":8220,"\u201D":8221,'"':8221,"\\ss":223,"\\ae":230,"\\oe":339,"\\AE":198,"\\OE":338,"\\O":216,"\\i":305,"\\j":567,"\\aa":229,"\\AA":197},oe=/[\w!@*()-=+{}\[\]\\';:?/.,~<>`|$%#&^" ]/,fe,ye;Rt()?(fe=new RegExp("\\p{Letter}","u"),ye=new RegExp("[0-9\\p{Letter}]","u")):(fe=/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/,ye=/[\da-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/);function ce(a,y,b="mord",E){y!==void 0&&(It[a]={definitionType:"symbol",type:b,variant:E,codepoint:y},Mn[y]||(Mn[y]=a))}function Ke(a,y,b){if(typeof a=="string"){for(let E=0;E<a.length;E++){const ee=a.charAt(E);ce(ee,ee.codePointAt(0))}return}for(const[E,ee,re,ae]of a)ce(E,ee,re!=null?re:y,ae!=null?ae:b)}function Dt(a,y){for(let b=a;b<=y;b++)ce(String.fromCodePoint(b),b)}function ln(a){var y;return(y=bn[a])!=null?y:null}function Jt(a,y){var b,E;if(y.length===0||y==="\\"||!y.startsWith("\\"))return[];const ee=[];for(const ae in jt)ae.startsWith(y)&&!jt[ae].infix&&ee.push({match:ae,frequency:(b=jt[ae].frequency)!=null?b:0});for(const ae in It)ae.startsWith(y)&&ee.push({match:ae,frequency:(E=It[ae].frequency)!=null?E:0});const re=y.substring(1);for(const ae of Object.keys(a.options.macros))ae.startsWith(re)&&ee.push({match:"\\"+ae,frequency:0});return ee.sort((ae,ue)=>{var he,ge;return ae.frequency===ue.frequency?ae.match.length===ue.match.length?ae.match<ue.match?-1:1:ae.match.length-ue.match.length:((he=ue.frequency)!=null?he:0)-((ge=ae.frequency)!=null?ge:0)}),ee.map(ae=>ae.match)}function en(a){let y="auto";const b=a.match(/:([^=]+)/);return b&&(y=b[1].trim()),y}function nn(a){if(!a)return[];const y=[];let b=a.split("]");if(b[0].startsWith("[")){y.push({isOptional:!0,type:en(b[0].slice(1))});for(let E=1;E<=b.length;E++)y.push(...nn(b[E]))}else if(b=a.split("}"),b[0].startsWith("{")){y.push({isOptional:!1,type:en(b[0].slice(1))});for(let E=1;E<=b.length;E++)y.push(...nn(b[E]))}return y}function wn(a){if(!a)return"";let y="",b=!0;for(const E of a)typeof E.value=="string"?y+=E.value:b=!1;return b?y:""}function mn(a,y){typeof a=="string"&&(a=[a]);const b={tabular:!1,params:[],createAtom:y};for(const E of a)bn[E]=b}function En(a,y,b){typeof a=="string"&&(a=[a]);const ee={tabular:!0,params:nn(y),createAtom:b};for(const re of a)bn[re]=ee}function yt(a,y,b){var E,ee;b||(b={});const re={definitionType:"function",params:nn(y),ifMode:b.ifMode,isFunction:(E=b.isFunction)!=null?E:!1,applyMode:b.applyMode,infix:(ee=b.infix)!=null?ee:!1,parse:b.parse,createAtom:b.createAtom,applyStyle:b.applyStyle,serialize:b.serialize,render:b.render};if(typeof a=="string")jt["\\"+a]=re;else for(const ae of a)jt["\\"+ae]=re}var gn;function Jn(a){return gn||(gn=Re(ve)),a?Re(Ce(Ce({},gn),a)):gn}function tt(a,y){var b,E,ee,re;if(typeof a=="string"){let ae=0;const ue=a;return/(^|[^\\])#1/.test(ue)&&(ae=1),/(^|[^\\])#2/.test(ue)&&(ae=2),/(^|[^\\])#3/.test(ue)&&(ae=3),/(^|[^\\])#4/.test(ue)&&(ae=4),/(^|[^\\])#5/.test(ue)&&(ae=5),/(^|[^\\])#6/.test(ue)&&(ae=6),/(^|[^\\])#7/.test(ue)&&(ae=7),/(^|[^\\])#8/.test(ue)&&(ae=8),/(^|[^\\])#9/.test(ue)&&(ae=9),{expand:(b=y==null?void 0:y.expand)!=null?b:!0,captureSelection:(E=y==null?void 0:y.captureSelection)!=null?E:!0,args:ae,def:ue}}return Ce({expand:(ee=y==null?void 0:y.expand)!=null?ee:!0,captureSelection:(re=y==null?void 0:y.captureSelection)!=null?re:!0,args:0},a)}function Re(a){if(!a)return{};const y={};for(const b of Object.keys(a)){const E=a[b];if(E==null)delete y[b];else if(typeof E=="object"&&"package"in E)for(const ee of Object.keys(E.package))y[ee]=tt(E.package[ee],{expand:!E.primitive,captureSelection:E.captureSelection});else y[b]=tt(E)}return y}function Ze(a,y="math"){if(!a||a.length===0)return null;let b=null;if(a.startsWith("\\")){if(b=jt[a],b)return!b.ifMode||b.ifMode===y?b:null;y==="math"?b=It[a]:se[a]&&(b={definitionType:"symbol",type:"mord",codepoint:se[a]})}else if(y==="math"){if(b=It[a],!b&&a.length===1){const E=Qt("math",a.codePointAt(0));return E.startsWith("\\")?ke(Ce({},Ze(E,"math")),{command:E}):null}}else se[a]?b={definitionType:"symbol",type:"mord",codepoint:se[a]}:y==="text"&&(b={definitionType:"symbol",type:"mord",codepoint:a.codePointAt(0)});return b!=null?b:null}function Ft(a,y){if(!a.startsWith("\\"))return null;const b=a.slice(1);return y[b]}function Qt(a,y){if(y===void 0)return"";if(a==="math"&&Mn[y])return Mn[y];if(a==="text"){const b=Object.keys(se).find(E=>se[E]===y);return b||String.fromCodePoint(y)}return String.fromCodePoint(y)}var an=[0,.68889,0,0,.72222],Pn=[0,.68889,0,0,.66667],On=[0,.68889,0,0,.77778],Nn=[0,.68889,0,0,.61111],Zn=[.16667,.68889,0,0,.77778],tr=[0,.68889,0,0,.55556],Tn=[0,0,0,0,.25],gr=[0,.825,0,0,2.33334],Pr=[0,.9,0,0,2.33334],Rr=[0,.68889,0,0,.54028],Zr=[-.03598,.46402,0,0,.5],vr=[-.13313,.36687,0,0,1],Dr=[.01354,.52239,0,0,1],yr=[.01354,.52239,0,0,1.11111],Nr=[0,.54986,0,0,1],Wr=[0,.69224,0,0,.5],Er=[0,.43056,0,0,1],qr=[.08198,.58198,0,0,.77778],zr=[.19444,.69224,0,0,.41667],ar=[.1808,.675,0,0,1],or=[.19444,.69224,0,0,.83334],Bn=[.13667,.63667,0,0,1],In=[-.064,.437,0,0,1.334],wr=[.08167,.58167,0,0,.77778],Qe=[0,.69224,0,0,.72222],Me=[0,.69224,0,0,.66667],Ae=[-.13313,.36687,0,0,.77778],Le=[.06062,.54986,0,0,.77778],De=[0,.69224,0,0,.77778],We=[.25583,.75583,0,0,.77778],it=[.25142,.75726,0,0,.77778],Nt=[.20576,.70576,0,0,.77778],Lt=[.30274,.79383,0,0,.77778],$t=[.22958,.72958,0,0,.77778],sn=[.1808,.675,0,0,.77778],hn=[.13667,.63667,0,0,.77778],xn=[.13597,.63597,0,0,.77778],Mt=[.03517,.54986,0,0,.77778],rn=[0,.675,0,0,.77778],Je=[.19444,.69224,0,0,.61111],pt=[0,.54986,0,0,.76042],Ct=[0,.54986,0,0,.66667],Et=[.0391,.5391,0,0,.77778],Yt=[.03517,.54986,0,0,1.33334],St=[.38569,.88569,0,0,.77778],Gt=[.23222,.74111,0,0,.77778],Te=[.19444,.69224,0,0,.77778],dt=[0,.37788,0,0,.5],ft=[0,.54986,0,0,.72222],Tt=[0,.69224,0,0,.83334],_t=[.11111,.69224,0,0,.66667],Pt=[.26167,.75726,0,0,.77778],Bt=[.48256,.98256,0,0,.77778],un=[.28481,.79383,0,0,.77778],yn=[.08167,.58167,0,0,.22222],_n=[.08167,.58167,0,0,.38889],$n=[0,.43056,.04028,0,.66667],qn=[.41951,.91951,0,0,.77778],sr=[.24982,.74947,0,0,.38865],jn=[.08319,.58283,0,0,.75623],Ln=[0,.10803,0,0,.27764],ur=[0,.47534,0,0,.50181],Qn=[.18906,.47534,0,0,.50181],mr=[0,.69141,0,0,.50181],Vn=[.24982,.74947,0,0,.27764],Un=[0,.69141,0,0,.21471],br=[.25,.75,0,0,.44722],lr=[0,.64444,0,0,.575],Ir=[.08556,.58556,0,0,.89444],Ur=[0,.69444,0,0,.89444],rr=[0,.68611,0,0,.9],Cn=[0,.68611,0,0,.86944],Sn=[.25,.75,0,0,.575],fr=[.25,.75,0,0,.31944],er=[0,.69444,0,0,.63889],Mr=[0,.69444,0,0,.31944],_r=[0,.44444,0,0,.63889],Ar=[0,.44444,0,0,.51111],dr=[0,.69444,0,0,.575],Sr=[.13333,.63333,0,0,.89444],ii=[0,.44444,0,0,.31944],zn=[0,.69444,0,0,.86944],Xn=[0,.68611,0,0,.69166],kr=[0,.68611,0,0,.83055],Br=[0,.68611,0,0,.89444],li=[0,.69444,0,0,.60278],di=[.19444,.69444,0,0,.51111],ri=[0,.69444,0,0,.83055],Yr=[-.10889,.39111,0,0,1.14999],yi=[.19444,.69444,0,0,.575],bi=[.19444,.69444,0,0,1.14999],Gn=[.19444,.69444,0,0,.70277],Wn=[.05556,.75,0,0,.575],Hn=[0,.68611,0,0,.95833],hr=[.08556,.58556,0,0,.76666],ni=[-.02639,.47361,0,0,.575],xi=[0,.44444,0,0,.89444],Mi=[0,.55556,0,0,.76666],gi=[-.10889,.39111,0,0,.89444],ci=[.00222,.50222,0,0,.89444],ki=[.19667,.69667,0,0,.89444],Hi=[.08556,.58556,0,0,1.14999],$i=[0,.69444,0,0,.70277],oa=[-.02778,.47222,0,0,.575],Gr=[.25,.75,0,0,.51111],ei=[-.13889,.36111,0,0,1.14999],Ai=[.19444,.69444,0,0,1.02222],ai=[.12963,.69444,0,0,.89444],fi=[.19444,.69444,0,0,.44722],_i=[0,.64444,.13167,0,.59111],pi=[.19444,.64444,.13167,0,.59111],Tr=[0,.68611,.17208,0,.8961],Xr=[.19444,.44444,.105,0,.53222],Vr=[0,.44444,.085,0,.82666],$r=[0,.69444,.06709,0,.59111],ui=[0,.69444,.12945,0,.35555],oi=[0,.69444,0,0,.94888],zi=[0,.69444,.11472,0,.59111],Wi=[0,.68611,.10778,0,.88555],Zi=[0,.69444,.07939,0,.62055],na=[0,.69444,.12417,0,.30667],wi=[0,.64444,.13556,0,.51111],vi=[.19444,.64444,.13556,0,.51111],Gi=[0,.68333,.16389,0,.74333],ca=[.19444,.43056,.08847,0,.46],sa=[0,.43056,.07514,0,.71555],ta=[0,.69444,.06646,0,.51111],ts=[0,.69444,0,0,.83129],ao=[0,.69444,.1225,0,.51111],oo=[0,.68333,.09403,0,.76666],eo=[0,.68333,.11111,0,.76666],Ss=[0,.69444,.06961,0,.51444],fo=[0,.69444,0,0,.27778],Ea=[.25,.75,0,0,.38889],fa=[0,.64444,0,0,.5],bo=[0,.69444,0,0,.77778],ko=[0,.68333,0,0,.75],Eo=[0,.68333,0,0,.77778],ns=[0,.68333,0,0,.68056],Ro=[0,.68333,0,0,.72222],Xa=[.25,.75,0,0,.5],Oa=[.25,.75,0,0,.27778],Oi=[0,.69444,0,0,.5],Lo=[0,.69444,0,0,.55556],rs=[0,.43056,0,0,.44445],Do=[0,.43056,0,0,.5],Ei=[.19444,.43056,0,0,.55556],mi=[0,.43056,0,0,.55556],Ki=[.08333,.58333,0,0,.77778],La=[0,.43056,0,0,.27778],Xi=[0,.66786,0,0,.27778],Ra=[0,.69444,0,0,.75],Fa=[0,.66786,0,0,.5],to=[0,.68333,0,0,.625],Na=[.19444,.69444,0,0,.44445],so=[0,.69444,0,0,.72222],lo=[.19444,.69444,0,0,.5],Da=[.19444,.69444,0,0,1],bl=[.011,.511,0,0,1.126],jo=[.19444,.69444,0,0,.61111],qs=[.05556,.75,0,0,.5],Kl=[0,.68333,0,0,.83334],Hl=[.0391,.5391,0,0,.66667],Cs=[-.05555,.44445,0,0,.5],_c=[0,.43056,0,0,.77778],is=[0,.55556,0,0,.66667],xl=[-.03625,.46375,0,0,.77778],Vo=[-.01688,.48312,0,0,.77778],as=[.0391,.5391,0,0,1],Pi=[0,.69444,0,0,.61111],Bi=[-.03472,.46528,0,0,.5],ji=[.25,.75,0,0,.44445],Ya=[-.14236,.35764,0,0,1],Aa=[.244,.744,0,0,.412],xo=[.19444,.69444,0,0,.88889],po=[.12963,.69444,0,0,.77778],za=[.19444,.69444,0,0,.38889],Ao=[.011,.511,0,0,1.638],To=[.19444,.69444,0,0,0],wo=[0,.44444,0,0,.575],os=[.19444,.44444,0,0,.575],Wl=[0,.68611,0,0,.75555],wl=[0,.69444,0,0,.66759],_u=[0,.68611,0,0,.80555],ku=[0,.68611,.08229,0,.98229],Zl=[0,.68611,0,0,.76666],Od=[0,.44444,0,0,.58472],kc=[.19444,.44444,0,0,.6118],Sl=[.19444,.43056,0,0,.5],Eu=[0,.68333,.02778,.08334,.76278],Ec=[0,.68333,.08125,.05556,.83125],Js=[0,.43056,0,.05556,.48472],jl=[.19444,.43056,0,.08334,.51702],Lu=[.25,.75,0,0,.42778],Ta=[0,.69444,0,0,.55],ss=[0,.69444,0,0,.73334],Ms=[0,.69444,0,0,.79445],Rd=[0,.69444,0,0,.51945],Vl=[0,.69444,0,0,.70278],Lc=[0,.69444,0,0,.76389],Qs=[.25,.75,0,0,.34306],el=[0,.69444,0,0,.56111],Nd=[0,.69444,0,0,.25556],Ul=[.19444,.45833,0,0,.56111],Du=[0,.45833,0,0,.56111],_s=[0,.69444,0,0,.30556],Au=[0,.69444,0,0,.58056],ks=[0,.69444,0,0,.67223],tl=[0,.69444,0,0,.85556],ls=[0,.69444,0,0,.55834],mo=[0,.65556,.11156,0,.5],Es=[0,.69444,.08094,0,.70834],Dc=[.17014,0,0,0,.44445],Tu=[0,.69444,.0799,0,.5],Pu=[0,.69444,0,0,.73752],$d=[0,.69444,.09205,0,.5],Ls=[0,.69444,.09031,0,.77778],cs=[0,.69444,.07816,0,.27778],Fd=[0,.69444,.00316,0,.5],zd=[.19444,.69444,0,0,.83334],Kd=[.05556,.75,0,0,.83334],Hd=[0,.75,0,0,.5],Wd=[.125,.08333,0,0,.27778],Zd=[0,.08333,0,0,.27778],pa=[0,.65556,0,0,.5],Sa=[0,.69444,0,0,.47222],ua=[0,.69444,0,0,.66667],Pa=[0,.69444,0,0,.59722],nl=[0,.69444,0,0,.54167],Iu=[0,.69444,0,0,.70834],Gl=[.25,.75,0,0,.28889],Bu=[0,.69444,0,0,.51667],jd=[0,.44444,0,0,.44445],Vd=[.19444,.44444,0,0,.51667],Ac=[0,.44444,0,0,.38333],Ou=[0,.44444,0,0,.51667],Tc=[0,.69444,0,0,.83334],Ud=[.35001,.85,0,0,.45834],Pc=[.35001,.85,0,0,.57778],Ic=[.35001,.85,0,0,.41667],Ru=[.35001,.85,0,0,.58334],Xl=[0,.72222,0,0,.55556],Bc=[1e-5,.6,0,0,.66667],Nu=[1e-5,.6,0,0,.77778],Cl=[.25001,.75,0,0,.94445],Gd=[.306,.805,.19445,0,.47222],Yl=[.30612,.805,.19445,0,.47222],Ka=[.25001,.75,0,0,.83334],rl=[.35001,.85,0,0,.47222],$u=[.25001,.75,0,0,1.11111],Fu=[.65002,1.15,0,0,.59722],go=[.65002,1.15,0,0,.81111],Fi=[.65002,1.15,0,0,.47222],Po=[.65002,1.15,0,0,.66667],No=[0,.75,0,0,1],us=[.55001,1.05,0,0,1.27778],zu=[.862,1.36,.44445,0,.55556],Oc=[.86225,1.36,.44445,0,.55556],il=[.55001,1.05,0,0,1.11111],Rc=[.65002,1.15,0,0,.52778],Nc=[.65002,1.15,0,0,.61111],al=[.55001,1.05,0,0,1.51112],Ku=[.95003,1.45,0,0,.73611],$c=[.95003,1.45,0,0,1.04445],ds=[.95003,1.45,0,0,.52778],ql=[.95003,1.45,0,0,.75],Jl=[0,.75,0,0,1.44445],Fc=[.95003,1.45,0,0,.58334],Ql=[1.25003,1.75,0,0,.79167],zc=[1.25003,1.75,0,0,1.27778],Hu=[1.25003,1.75,0,0,.58334],Kc=[1.25003,1.75,0,0,.80556],ec=[0,.825,0,0,1.8889],Hc=[1.25003,1.75,0,0,.63889],Wc=[.64502,1.155,0,0,.875],tc=[1e-5,.6,0,0,.875],Zc=[-99e-5,.601,0,0,.66667],jc=[.64502,1.155,0,0,.66667],Xd=[1e-5,.9,0,0,.88889],Wu=[.65002,1.15,0,0,.88889],ol=[.90001,0,0,0,.88889],Vc=[-.00499,.605,0,0,1.05556],sl=[0,.12,0,0,.45],Kr=[0,.61111,0,0,.525],So=[.08333,.69444,0,0,.525],Zu=[-.08056,.53055,0,0,.525],Yd=[-.05556,.55556,0,0,.525],no=[0,.43056,0,0,.525],Ca=[.22222,.43056,0,0,.525],nc=[0,0,0,0,.525],qd={"AMS-Regular":{32:Tn,65:an,66:Pn,67:an,68:an,69:Pn,70:Nn,71:On,72:On,73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:On,76:Pn,77:[0,.68889,0,0,.94445],78:an,79:Zn,80:Nn,81:Zn,82:an,83:tr,84:Pn,85:an,86:an,87:[0,.68889,0,0,1],88:an,89:an,90:Pn,107:tr,160:Tn,165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:tr,295:Rr,710:gr,732:Pr,770:gr,771:Pr,989:wr,1008:$n,8245:[0,.54986,0,0,.275],8463:Rr,8487:an,8498:tr,8502:Pn,8503:[0,.68889,0,0,.44445],8504:Pn,8513:[0,.68889,0,0,.63889],8592:Zr,8594:Zr,8602:vr,8603:vr,8606:Dr,8608:Dr,8610:yr,8611:yr,8619:Nr,8620:Nr,8621:[-.13313,.37788,0,0,1.38889],8622:vr,8624:Wr,8625:Wr,8630:Er,8631:Er,8634:qr,8635:qr,8638:zr,8639:zr,8642:zr,8643:zr,8644:ar,8646:ar,8647:ar,8648:or,8649:ar,8650:or,8651:Dr,8652:Dr,8653:vr,8654:vr,8655:vr,8666:Bn,8667:Bn,8669:[-.13313,.37788,0,0,1],8672:In,8674:In,8705:[0,.825,0,0,.5],8708:tr,8709:wr,8717:[0,.43056,0,0,.42917],8722:Zr,8724:[.08198,.69224,0,0,.77778],8726:wr,8733:De,8736:Qe,8737:Qe,8738:[.03517,.52239,0,0,.72222],8739:yn,8740:[.25142,.74111,0,0,.27778],8741:_n,8742:[.25142,.74111,0,0,.5],8756:Me,8757:Me,8764:Ae,8765:[-.13313,.37788,0,0,.77778],8769:Ae,8770:xl,8774:Lt,8776:Vo,8778:wr,8782:Le,8783:Le,8785:qr,8786:qr,8787:qr,8790:De,8791:$t,8796:[.08198,.91667,0,0,.77778],8806:We,8807:We,8808:it,8809:it,8812:[.25583,.75583,0,0,.5],8814:Nt,8815:Nt,8816:Lt,8817:Lt,8818:$t,8819:$t,8822:sn,8823:sn,8828:hn,8829:hn,8830:$t,8831:$t,8832:Nt,8833:Nt,8840:Lt,8841:Lt,8842:xn,8843:xn,8847:Mt,8848:Mt,8858:qr,8859:qr,8861:qr,8862:rn,8863:rn,8864:rn,8865:rn,8872:[0,.69224,0,0,.61111],8873:Qe,8874:[0,.69224,0,0,.88889],8876:Nn,8877:Nn,8878:an,8879:an,8882:Mt,8883:Mt,8884:hn,8885:hn,8888:[0,.54986,0,0,1.11111],8890:Ei,8891:Je,8892:Je,8901:[0,.54986,0,0,.27778],8903:wr,8905:wr,8906:wr,8907:De,8908:De,8909:[-.03598,.46402,0,0,.77778],8910:pt,8911:pt,8912:Mt,8913:Mt,8914:Ct,8915:Ct,8916:Me,8918:Et,8919:Et,8920:Yt,8921:Yt,8922:St,8923:St,8926:hn,8927:hn,8928:Lt,8929:Lt,8934:Gt,8935:Gt,8936:Gt,8937:Gt,8938:Nt,8939:Nt,8940:Lt,8941:Lt,8994:Te,8995:Te,9416:[.15559,.69224,0,0,.90222],9484:Wr,9488:Wr,9492:dt,9496:dt,9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:rn,9633:rn,9650:ft,9651:ft,9654:Mt,9660:ft,9661:ft,9664:Mt,9674:_t,9733:[.19444,.69224,0,0,.94445],10003:Tt,10016:Tt,10731:_t,10846:[.19444,.75583,0,0,.61111],10877:hn,10878:hn,10885:We,10886:We,10887:xn,10888:xn,10889:Pt,10890:Pt,10891:Bt,10892:Bt,10901:hn,10902:hn,10933:it,10934:it,10935:Pt,10936:Pt,10937:Pt,10938:Pt,10949:We,10950:We,10955:un,10956:un,57350:yn,57351:_n,57352:wr,57353:$n,57356:it,57357:it,57358:qn,57359:Lt,57360:Lt,57361:qn,57366:it,57367:it,57368:it,57369:it,57370:xn,57371:xn},"Caligraphic-Regular":{32:Tn,65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:Tn},"Fraktur-Regular":{32:Tn,33:[0,.69141,0,0,.29574],34:Un,38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:sr,41:sr,42:[0,.62119,0,0,.27764],43:jn,44:Ln,45:jn,46:Ln,47:[.24982,.74947,0,0,.50181],48:ur,49:ur,50:ur,51:Qn,52:Qn,53:Qn,54:mr,55:Qn,56:mr,57:Qn,58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:Vn,93:Vn,94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:Tn,8216:Un,8217:Un,58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:Tn,33:[0,.69444,0,0,.35],34:li,35:[.19444,.69444,0,0,.95833],36:Wn,37:[.05556,.75,0,0,.95833],38:Ur,39:Mr,40:br,41:br,42:[0,.75,0,0,.575],43:Sr,44:[.19444,.15556,0,0,.31944],45:Ac,46:[0,.15556,0,0,.31944],47:Sn,48:lr,49:lr,50:lr,51:lr,52:lr,53:lr,54:lr,55:lr,56:lr,57:lr,58:ii,59:[.19444,.44444,0,0,.31944],60:Ir,61:gi,62:Ir,63:[0,.69444,0,0,.54305],64:Ur,65:Cn,66:[0,.68611,0,0,.81805],67:kr,68:[0,.68611,0,0,.88194],69:Wl,70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:rr,73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:Xn,77:[0,.68611,0,0,1.09166],78:rr,79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:Cn,89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:fr,92:Sn,93:fr,94:dr,95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:er,99:Ar,100:er,101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:er,105:Mr,106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:Mr,109:[0,.44444,0,0,.95833],110:_r,111:wo,112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:_r,118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:Ar,123:Sn,124:fr,125:Sn,126:[.35,.34444,0,0,.575],160:Tn,163:[0,.69444,0,0,.86853],168:dr,172:[0,.44444,0,0,.76666],176:zn,177:Sr,184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:Sr,216:[.04861,.73472,0,0,.89444],223:Pa,230:[0,.44444,0,0,.83055],247:Sr,248:[.09722,.54167,0,0,.575],305:ii,338:[0,.68611,0,0,1.16944],339:xi,567:[.19444,.44444,0,0,.35139],710:dr,711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:dr,715:dr,728:dr,729:Mr,730:zn,732:dr,733:dr,915:Xn,916:Hn,920:Br,923:_u,926:Zl,928:rr,931:kr,933:Br,934:kr,936:Br,937:kr,8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:Mr,8217:Mr,8220:li,8221:li,8224:di,8225:di,8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:wl,8465:ri,8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:ri,8501:$i,8592:Yr,8593:yi,8594:Yr,8595:yi,8596:Yr,8597:Sn,8598:bi,8599:bi,8600:bi,8601:bi,8636:Yr,8637:Yr,8640:Yr,8641:Yr,8656:Yr,8657:Gn,8658:Yr,8659:Gn,8660:Yr,8661:[.25,.75,0,0,.70277],8704:er,8706:[0,.69444,.06389,0,.62847],8707:er,8709:Wn,8711:Hn,8712:hr,8715:hr,8722:Sr,8723:Sr,8725:Sn,8726:Sn,8727:oa,8728:ni,8729:ni,8730:[.18,.82,0,0,.95833],8733:xi,8734:[0,.44444,0,0,1.14999],8736:Qe,8739:fr,8741:Sn,8743:Mi,8744:Mi,8745:Mi,8746:Mi,8747:[.19444,.69444,.12778,0,.56875],8764:gi,8768:[.19444,.69444,0,0,.31944],8771:ci,8776:[.02444,.52444,0,0,.89444],8781:ci,8801:ci,8804:ki,8805:ki,8810:Hi,8811:Hi,8826:Ir,8827:Ir,8834:Ir,8835:Ir,8838:ki,8839:ki,8846:Mi,8849:ki,8850:ki,8851:Mi,8852:Mi,8853:Sr,8854:Sr,8855:Sr,8856:Sr,8857:Sr,8866:$i,8867:$i,8868:Ur,8869:Ur,8900:ni,8901:[-.02639,.47361,0,0,.31944],8902:oa,8968:Gr,8969:Gr,8970:Gr,8971:Gr,8994:ei,8995:ei,9651:Ai,9657:oa,9661:Ai,9667:oa,9711:bi,9824:ai,9825:ai,9826:ai,9827:ai,9837:[0,.75,0,0,.44722],9838:fi,9839:fi,10216:br,10217:br,10815:rr,10927:ki,10928:ki,57376:To},"Main-BoldItalic":{32:Tn,33:[0,.69444,.11417,0,.38611],34:Zi,35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:ui,40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:_i,49:_i,50:_i,51:_i,52:pi,53:_i,54:_i,55:pi,56:_i,57:_i,58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:zi,64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:Tr,73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:Tr,79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:$r,95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:Xr,104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:Xr,114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:Tn,168:[0,.69444,.11473,0,.59111],176:oi,184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:Vr,248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:Vr,567:[.19444,.44444,.04611,0,.385],710:$r,711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:ui,730:oi,732:zi,733:zi,915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:Tr,931:[0,.68611,.11431,0,.82666],933:Wi,934:[0,.68611,.05632,0,.82666],936:Wi,937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:ui,8217:ui,8220:[0,.69444,.16772,0,.62055],8221:Zi},"Main-Italic":{32:Tn,33:na,34:Ss,35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:na,40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:wi,49:wi,50:wi,51:wi,52:vi,53:wi,54:wi,55:vi,56:wi,57:wi,58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:ao,64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:Gi,73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:Gi,79:oo,80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:Gi,86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:ta,95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:ca,104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:ca,114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:Tn,168:[0,.66786,.10474,0,.51111],176:ts,184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:sa,248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:sa,710:ta,711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:ts,732:[0,.66786,.11585,0,.51111],733:ao,915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:oo,923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:Gi,931:[0,.68333,.12028,0,.71555],933:eo,934:[0,.68333,.05986,0,.71555],936:eo,937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:na,8217:na,8220:[0,.69444,.1685,0,.51444],8221:Ss,8463:Rr},"Main-Regular":{32:Tn,33:fo,34:Oi,35:zd,36:qs,37:Kd,38:bo,39:fo,40:Ea,41:Ea,42:Hd,43:Ki,44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:Xa,48:fa,49:fa,50:fa,51:fa,52:fa,53:fa,54:fa,55:fa,56:fa,57:fa,58:La,59:[.19444,.43056,0,0,.27778],60:Et,61:Ae,62:Et,63:Sa,64:bo,65:ko,66:[0,.68333,0,0,.70834],67:Ro,68:[0,.68333,0,0,.76389],69:ns,70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:ko,73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:Eo,76:to,77:[0,.68333,0,0,.91667],78:ko,79:Eo,80:ns,81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:Ro,85:ko,86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:ko,89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:Oa,92:Xa,93:Oa,94:Oi,95:[.31,.12056,.02778,0,.5],97:Do,98:Lo,99:rs,100:Lo,101:rs,102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:Lo,105:Xi,106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:fo,109:[0,.43056,0,0,.83334],110:mi,111:Do,112:Ei,113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:mi,118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:rs,123:Xa,124:Oa,125:Xa,126:[.35,.31786,0,0,.5],160:Tn,163:[0,.69444,0,0,.76909],167:Na,168:Fa,172:[0,.43056,0,0,.66667],176:Ra,177:Ki,182:jo,184:Dc,198:[0,.68333,0,0,.90278],215:Ki,216:[.04861,.73194,0,0,.77778],223:Oi,230:[0,.43056,0,0,.72222],247:Ki,248:[.09722,.52778,0,0,.5],305:La,338:[0,.68333,0,0,1.01389],339:_c,567:[.19444,.43056,0,0,.30556],710:Oi,711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:Oi,715:Oi,728:Oi,729:Xi,730:Ra,732:Fa,733:Oi,915:to,916:Kl,920:Eo,923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:ko,931:Ro,933:Eo,934:Ro,936:Eo,937:Ro,8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:fo,8217:fo,8220:Oi,8221:Oi,8224:Na,8225:Na,8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:Rr,8465:so,8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:so,8501:Pi,8592:vr,8593:lo,8594:vr,8595:lo,8596:vr,8597:Xa,8598:Da,8599:Da,8600:Da,8601:Da,8614:[.011,.511,0,0,1],8617:bl,8618:bl,8636:vr,8637:vr,8640:vr,8641:vr,8652:[.011,.671,0,0,1],8656:vr,8657:jo,8658:vr,8659:jo,8660:vr,8661:[.25,.75,0,0,.61111],8704:Lo,8706:[0,.69444,.05556,.08334,.5309],8707:Lo,8709:qs,8711:Kl,8712:Hl,8715:Hl,8722:Ki,8723:Ki,8725:Xa,8726:Xa,8727:Bi,8728:Cs,8729:Cs,8730:[.2,.8,0,0,.83334],8733:_c,8734:Er,8736:Qe,8739:Oa,8741:Xa,8743:is,8744:is,8745:is,8746:is,8747:[.19444,.69444,.11111,0,.41667],8764:Ae,8768:[.19444,.69444,0,0,.27778],8771:xl,8773:[-.022,.589,0,0,1],8776:Vo,8781:xl,8784:[-.133,.67,0,0,.778],8801:xl,8804:xn,8805:xn,8810:as,8811:as,8826:Et,8827:Et,8834:Et,8835:Et,8838:xn,8839:xn,8846:is,8849:xn,8850:xn,8851:is,8852:is,8853:Ki,8854:Ki,8855:Ki,8856:Ki,8857:Ki,8866:Pi,8867:Pi,8868:bo,8869:bo,8872:[.249,.75,0,0,.867],8900:Cs,8901:[-.05555,.44445,0,0,.27778],8902:Bi,8904:[.005,.505,0,0,.9],8942:[.03,.9,0,0,.278],8943:[-.19,.31,0,0,1.172],8945:[-.1,.82,0,0,1.282],8968:ji,8969:ji,8970:ji,8971:ji,8994:Ya,8995:Ya,9136:Aa,9137:Aa,9651:xo,9657:Bi,9661:xo,9667:Bi,9711:Da,9824:po,9825:po,9826:po,9827:po,9837:[0,.75,0,0,.38889],9838:za,9839:za,10216:Ea,10217:Ea,10222:Aa,10223:Aa,10229:[.011,.511,0,0,1.609],10230:Ao,10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:Ao,10815:ko,10927:xn,10928:xn,57376:To},"Math-BoldItalic":{32:Tn,48:wo,49:wo,50:wo,51:os,52:os,53:os,54:lr,55:os,56:lr,57:os,65:Cn,66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:ku,73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:Wl,77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:wl,105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:Od,112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:Tn,915:[0,.68611,.15972,0,.65694],916:Hn,920:[0,.68611,.03194,0,.86722],923:_u,926:[0,.68611,.07458,0,.84125],928:ku,931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:Zl,936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:Od,960:[0,.44444,.03704,0,.68241],961:kc,962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:kc,1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:Tn,48:Do,49:Do,50:Do,51:Sl,52:Sl,53:Sl,54:fa,55:Sl,56:fa,57:Sl,65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:Ec,73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:Eu,80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:Js,112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:Tn,915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:Eu,923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:Ec,931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:Js,960:[0,.43056,.03588,0,.57003],961:jl,962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:jl,1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:Tn,33:[0,.69444,0,0,.36667],34:ls,35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:_s,40:Lu,41:Lu,42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:Ta,49:Ta,50:Ta,51:Ta,52:Ta,53:Ta,54:Ta,55:Ta,56:Ta,57:Ta,58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:Rd,64:ss,65:ss,66:ss,67:Vl,68:Ms,69:[0,.69444,0,0,.64167],70:Pi,71:ss,72:Ms,73:[0,.69444,0,0,.33056],74:Rd,75:Lc,76:Au,77:[0,.69444,0,0,.97778],78:Ms,79:Ms,80:Vl,81:[.10556,.69444,0,0,.79445],82:Vl,83:Pi,84:ss,85:Lc,86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:ss,89:[0,.69444,.0275,0,.73334],90:ks,91:Qs,93:Qs,94:Ta,95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:el,99:[0,.45833,0,0,.48889],100:el,101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:el,105:Nd,106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:Nd,109:[0,.45833,0,0,.86667],110:Du,111:[0,.45833,0,0,.55],112:Ul,113:Ul,114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:Du,118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:Tn,168:Ta,176:ss,180:Ta,184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:Ta,711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:Ta,729:_s,730:ss,732:Ta,733:Ta,915:Au,916:[0,.69444,0,0,.91667],920:tl,923:ks,926:ss,928:Ms,931:Ms,933:tl,934:Ms,936:tl,937:Ms,8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:_s,8217:_s,8220:ls,8221:ls},"SansSerif-Italic":{32:Tn,33:[0,.69444,.05733,0,.31945],34:Fd,35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:cs,40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:Wd,45:[0,.44444,.01946,0,.33333],46:Zd,47:[.25,.75,.13164,0,.5],48:mo,49:mo,50:mo,51:mo,52:mo,53:mo,54:mo,55:mo,56:mo,57:mo,58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:ua,66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:Es,73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:nl,77:[0,.69444,.08094,0,.875],78:Es,79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:Tu,95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:Tn,168:[0,.67937,.06385,0,.5],176:Pu,184:Dc,305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:Tu,711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:$d,715:Oi,728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:Pu,732:[0,.67659,.08826,0,.5],733:$d,915:[0,.69444,.13372,0,.54167],916:Tc,920:[0,.69444,.07555,0,.77778],923:Pi,926:[0,.69444,.12816,0,.66667],928:Es,931:[0,.69444,.11983,0,.72222],933:Ls,934:[0,.69444,.04603,0,.72222],936:Ls,937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:cs,8217:cs,8220:[0,.69444,.14205,0,.5],8221:Fd},"SansSerif-Regular":{32:Tn,33:[0,.69444,0,0,.31945],34:Oi,35:zd,36:qs,37:Kd,38:[0,.69444,0,0,.75834],39:fo,40:Ea,41:Ea,42:Hd,43:Ki,44:Wd,45:[0,.44444,0,0,.33333],46:Zd,47:Xa,48:pa,49:pa,50:pa,51:pa,52:pa,53:pa,54:pa,55:pa,56:pa,57:pa,58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:Sa,64:ua,65:ua,66:ua,67:er,68:[0,.69444,0,0,.72223],69:Pa,70:[0,.69444,0,0,.56945],71:ua,72:Iu,73:fo,74:Sa,75:[0,.69444,0,0,.69445],76:nl,77:[0,.69444,0,0,.875],78:Iu,79:[0,.69444,0,0,.73611],80:er,81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:Lo,84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:ua,89:[0,.69444,.025,0,.66667],90:Pi,91:Gl,93:Gl,94:Oi,95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:Bu,99:jd,100:Bu,101:jd,102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:Bu,105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:Ou,111:[0,.44444,0,0,.5],112:Vd,113:Vd,114:[0,.44444,.01389,0,.34167],115:Ac,116:[0,.57143,0,0,.36111],117:Ou,118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:Tn,168:[0,.67937,0,0,.5],176:ua,184:Dc,305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:Oi,711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:Oi,715:Oi,728:Oi,729:[0,.67937,0,0,.27778],730:ua,732:[0,.67659,0,0,.5],733:Oi,915:nl,916:Tc,920:bo,923:Pi,926:ua,928:Iu,931:so,933:bo,934:so,936:bo,937:so,8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:fo,8217:fo,8220:Oi,8221:Oi},"Script-Regular":{32:Tn,65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:Tn},"Size1-Regular":{32:Tn,40:Ud,41:Ud,47:Pc,91:Ic,92:Pc,93:Ic,123:Ru,125:Ru,160:Tn,710:Xl,732:Xl,770:Xl,771:Xl,8214:[-99e-5,.601,0,0,.77778],8593:Bc,8595:Bc,8657:Nu,8659:Nu,8719:Cl,8720:Cl,8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:Yl,8748:Gd,8749:Gd,8750:Yl,8896:Ka,8897:Ka,8898:Ka,8899:Ka,8968:rl,8969:rl,8970:rl,8971:rl,9168:Zc,10216:rl,10217:rl,10752:$u,10753:$u,10754:$u,10756:Ka,10758:Ka},"Size2-Regular":{32:Tn,40:Fu,41:Fu,47:go,91:Fi,92:go,93:Fi,123:Po,125:Po,160:Tn,710:No,732:No,770:No,771:No,8719:us,8720:us,8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:Oc,8748:zu,8749:zu,8750:Oc,8896:il,8897:il,8898:il,8899:il,8968:Rc,8969:Rc,8970:Rc,8971:Rc,10216:Nc,10217:Nc,10752:al,10753:al,10754:al,10756:il,10758:il},"Size3-Regular":{32:Tn,40:Ku,41:Ku,47:$c,91:ds,92:$c,93:ds,123:ql,125:ql,160:Tn,710:Jl,732:Jl,770:Jl,771:Jl,8730:[.95003,1.45,0,0,1],8968:Fc,8969:Fc,8970:Fc,8971:Fc,10216:ql,10217:ql},"Size4-Regular":{32:Tn,40:Ql,41:Ql,47:zc,91:Hu,92:zc,93:Hu,123:Kc,125:Kc,160:Tn,710:ec,732:ec,770:ec,771:ec,8730:[1.25003,1.75,0,0,1],8968:Hc,8969:Hc,8970:Hc,8971:Hc,9115:Wc,9116:tc,9117:Wc,9118:Wc,9119:tc,9120:Wc,9121:jc,9122:Zc,9123:jc,9124:jc,9125:Zc,9126:jc,9127:Xd,9128:Wu,9129:ol,9130:[0,.3,0,0,.88889],9131:Xd,9132:Wu,9133:ol,9143:[.88502,.915,0,0,1.05556],10216:Kc,10217:Kc,57344:Vc,57345:Vc,57680:sl,57681:sl,57682:sl,57683:sl},"Typewriter-Regular":{32:nc,33:Kr,34:Kr,35:Kr,36:So,37:So,38:Kr,39:Kr,40:So,41:So,42:[0,.52083,0,0,.525],43:Zu,44:[.13889,.125,0,0,.525],45:Zu,46:[0,.125,0,0,.525],47:So,48:Kr,49:Kr,50:Kr,51:Kr,52:Kr,53:Kr,54:Kr,55:Kr,56:Kr,57:Kr,58:no,59:[.13889,.43056,0,0,.525],60:Yd,61:[-.19549,.41562,0,0,.525],62:Yd,63:Kr,64:Kr,65:Kr,66:Kr,67:Kr,68:Kr,69:Kr,70:Kr,71:Kr,72:Kr,73:Kr,74:Kr,75:Kr,76:Kr,77:Kr,78:Kr,79:Kr,80:Kr,81:[.13889,.61111,0,0,.525],82:Kr,83:Kr,84:Kr,85:Kr,86:Kr,87:Kr,88:Kr,89:Kr,90:Kr,91:So,92:So,93:So,94:Kr,95:[.09514,0,0,0,.525],96:Kr,97:no,98:Kr,99:no,100:Kr,101:no,102:Kr,103:Ca,104:Kr,105:Kr,106:[.22222,.61111,0,0,.525],107:Kr,108:Kr,109:no,110:no,111:no,112:Ca,113:Ca,114:no,115:no,116:[0,.55358,0,0,.525],117:no,118:no,119:no,120:no,121:Ca,122:no,123:So,124:So,125:So,126:Kr,127:Kr,160:nc,176:Kr,184:[.19445,0,0,0,.525],305:no,567:Ca,711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:Kr,715:Kr,728:Kr,730:Kr,770:Kr,771:Kr,776:Kr,915:Kr,916:Kr,920:Kr,923:Kr,926:Kr,928:Kr,931:Kr,933:Kr,934:Kr,936:Kr,937:Kr,8216:Kr,8217:Kr,8242:Kr,9251:[.11111,.21944,0,0,.525]}},Jd=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,ll=10,ro=.25,Uc=1.2,hs=.431,ju={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[hs,hs,hs],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.5,.732,.925],num2:[.394,.384,.5],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[ro,ro,ro],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04]},Gc=[0,.5,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Ds=5,Vu={"\xA0":" ","\u200B":" ",\u00C5:"A",\u00C7:"C",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00E7:"c",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};function fs(a,y){a===void 0&&(a=77);const b=qd[y][a];if(b)return{defaultMetrics:!1,depth:b[0],height:b[1],italic:b[2],skew:b[3],width:b[4]};if(a===11034)return{defaultMetrics:!0,depth:.2,height:.8,italic:0,skew:0,width:.8};const E=String.fromCodePoint(a);if(E in Vu)a=Vu[E].codePointAt(0);else if(Jd.test(E))return a=77,{defaultMetrics:!0,depth:.2,height:.9,italic:0,skew:0,width:1};return{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0,width:.8}}var Xc={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],longrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],longleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],longleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],longrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],longleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xleftrightarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],longleftrightarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xRightleftharpoons:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],longRightleftharpoons:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xLeftrightharpoons:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716],longLeftrightharpoons:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},cl={widehat1:[1062,239,.24],widehat2:[2364,300,.3],widehat3:[2364,360,.36],widehat4:[2364,420,.42],widecheck1:[1062,239,.24],widecheck2:[2364,300,.3],widecheck3:[2364,360,.36],widecheck4:[2364,420,.42],widetilde1:[600,260,.26],widetilde2:[1033,286,.286],widetilde3:[2339,306,.306],widetilde4:[2340,312,.34],overarc:[1061,159,.3],underarc:[1061,159,.3]},Qd={doubleleftarrow:`M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,overarc:"M529 0c179 0 524 115 524 115 5 1 9 5 9 10 0 1-1 2-1 3l-4 22c-1 5-5 9-11 9h-2s-338-93-512-92c-174 0-513 92-513 92h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13 0 0 342-115 520-115z",underarc:`m 529 160
c -179 0 -524 -115 -524 -115
c -5 -1 -9 -5 -9 -10
c 0 -1 1 -2 1 -3
l 4 -22
c 1 -5 5 -9 11 -9
h 2
s 338 93 512 92
c 174 0 513 -92 513 -92
h 2
c 5 0 9 4 11 9
l 5 22
c 1 6 -2 12 -8 13
c 0 0 -342 115 -520 115
z
`,leftgroup:`M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
435 0h399565z`,leftgroupunder:`M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,widetilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,widetilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,widetilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
-338 0-409-156.573-744-156.573z`,widetilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`};function Ml(a){if(cl[a]){const[ge,be,Be]=cl[a],He=`<span class="stretchy" style="height:${Be}em"><svg width="100%" height="${Be}em" viewBox="0 0 ${ge} ${be}" preserveAspectRatio="none" ><path fill="currentcolor" d="${Qd[a]}"></path></svg></span>`;return`<span style="display:inline-block;height:${Math.floor(100*Be/2)/100}em;min-width:0">${He}</span>`}const[y,b,E,ee]=Xc[a];let re,ae;const ue=E/1e3;y.length===3?(re=["slice-1-of-3","slice-2-of-3","slice-3-of-3"],ae=["xMinYMin","xMidYMin","xMaxYMin"]):y.length===2?(re=["slice-1-of-2","slice-2-of-2"],ae=["xMinYMin","xMaxYMin"]):(re=["slice-1-of-1"],ae=[ee]);const he=y.map((ge,be)=>`<span class="${re[be]}" style=height:${ue}em><svg width=400em height=${ue}em viewBox="0 0 400000 ${E}" preserveAspectRatio="${ae[be]} slice"><path fill="currentcolor" d="${Qd[ge]}"></path></svg></span>`).join("");return`<span style="display:inline-block;height:${ue}em;min-width:${b}em;">${he}</span>`}function eh(a){return Xc[a]?Xc[a][2]/1e3:cl[a][2]}function th(a){const y=[];for(let b=0;b<a.length;b++){let E=a.charCodeAt(b);if(E===13&&a.charCodeAt(b+1)===10&&(E=10,b++),(E===13||E===12)&&(E=10),E===0&&(E=65533),E>=55296&&E<=56319){const ee=a.charCodeAt(b+1);if(ee>=56320&&ee<=57343){const re=E-55296,ae=ee-56320;E=Ys(2,16)+re*Ys(2,10)+ae,b++}}y.push(E)}return y}var rc=8205,ic=[[rc,1],[65038,2],[127995,5],[129456,4],[917536,96]],As,_l=[127462,127487];function kl(a){var y;if(As===void 0){As={};for(const b of ic)for(let E=b[0];E<=b[0]+b[1]-1;E++)As[E]=!0}return(y=As[a])!=null?y:!1}function nh(a){return a>=_l[0]&&a<=_l[1]}function rh(a){if(/^[\u0020-\u00FF]*$/.test(a))return a;const y=[],b=th(a);let E=0;for(;E<b.length;){const ee=b[E++],re=b[E];if(re===rc){const ae=E-1;for(E+=2;b[E]===rc;)E+=2;y.push(String.fromCodePoint(...b.slice(ae,E-ae+1)))}else if(kl(re)){const ae=E-1;for(;kl(b[E]);)E+=b[E]===rc?2:1;y.push(String.fromCodePoint(...b.slice(ae,2*E-ae-1)))}else nh(ee)?(E+=1,y.push(String.fromCodePoint(...b.slice(E-2,2)))):y.push(String.fromCodePoint(ee))}return y}var ih=class{constructor(a){this.obeyspaces=!1,this.pos=0,this.s=rh(a)}end(){return this.pos>=this.s.length}get(){return this.pos<this.s.length?this.s[this.pos++]:""}peek(){return this.s[this.pos]}match(a){const y=typeof this.s=="string"?a.exec(this.s.slice(this.pos)):a.exec(this.s.slice(this.pos).join(""));return y!=null&&y[0]?(this.pos+=y[0].length,y[0]):""}next(){if(this.end())return null;if(!this.obeyspaces&&this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]+/)||this.obeyspaces&&this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]/))return"<space>";const a=this.get();if(a==="\\"){if(!this.end()){let y=this.match(/^[a-zA-Z\*]+/);return y?this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]*/):y=this.get(),"\\"+y}}else{if(a==="{")return"<{>";if(a==="}")return"<}>";if(a==="^"){if(this.peek()==="^"){this.get();const y=this.match(/^(\^(\^(\^(\^[\da-f])?[\da-f])?[\da-f])?[\da-f])?[\da-f]{2}/);if(y)return String.fromCodePoint(Number.parseInt(y.slice(y.lastIndexOf("^")+1),16))}return a}else if(a==="#"){if(!this.end()){let y=!1;if(/[\d?@]/.test(this.peek())&&(y=!0,this.pos+1<this.s.length)){const b=this.s[this.pos+1];y=/[^\dA-Za-z]/.test(b)}return y?"#"+this.get():"#"}}else if(a==="$")return this.peek()==="$"?(this.get(),"<$$>"):"<$>"}return a}};function Ts(a,y){var b,E,ee,re;const ae=[];let ue=a.next();if(ue&&ue!=="\\relax"){if(ue==="\\noexpand")ue=a.next(),ue&&ae.push(ue);else if(ue==="\\obeyspaces")a.obeyspaces=!0;else if(ue==="\\bgroup")ae.push("<{>");else if(ue==="\\egroup")ae.push("<}>");else if(ue==="\\string"){if(ue=a.next(),ue)if(ue.startsWith("\\"))for(const he of ue)ae.push(he==="\\"?"\\backslash":he);else ue==="<{>"?ae.push("\\{"):ue==="<space>"?ae.push("~"):ue==="<}>"&&ae.push("\\}")}else if(ue==="\\csname"){for(;a.peek()==="<space>";)a.next();let he="",ge=!1,be=[];do{if(be.length===0)if(/^#[\d?@]$/.test(a.peek())){const Be=a.get().slice(1);be=ps((E=(b=y==null?void 0:y(Be))!=null?b:y==null?void 0:y("?"))!=null?E:"\\placeholder{}",y),ue=be[0]}else ue=a.next(),be=ue?[ue]:[];ge=be.length===0,!ge&&ue==="\\endcsname"&&(ge=!0,be.shift()),ge||(ge=ue==="<$>"||ue==="<$$>"||ue==="<{>"||ue==="<}>"||typeof ue=="string"&&ue.length>1&&ue.startsWith("\\")),ge||(he+=be.shift())}while(!ge);he&&ae.push("\\"+he),ae.push(...be)}else if(ue!=="\\endcsname")if(ue.length>1&&ue.startsWith("#")){const he=ue.slice(1);ae.push(...ps((re=(ee=y==null?void 0:y(he))!=null?ee:y==null?void 0:y("?"))!=null?re:"\\placeholder{}",y))}else ae.push(ue)}return ae}function ps(a,y=null){const b=[];let E="";for(const ae of a.toString().split(/\r?\n/)){E&&b.push(E),E=" ";const ue=ae.match(/((?:\\%)|[^%])*/);ue!==null&&b.push(ue[0])}const ee=new ih(Ge(b.join(""))),re=[];do re.push(...Ts(ee,y));while(!ee.end());return re}function Si(a){let y="";const b=[];for(const E of a)E&&(y&&/^[a-zA-Z\*]/.test(E)&&b.push(y),b.push(E),/^\\[a-zA-Z]+\*?[\"\'][^\ ]+$/.test(E)&&b.push(" "),y=/\\[a-zA-Z]+\*?$/.test(E)?" ":"");return b.join("")}function ra(a,...y){return console.assert(a.startsWith("\\")),y.length===0?a:Si([a,...y.map(b=>`{${b}}`)])}function Ps(a){return Si(a.map(y=>{var b;return(b={"<space>":" ","<$$>":"$$","<$>":"$","<{>":"{","<}>":"}"}[y])!=null?b:y}))}var ah=class Bd{constructor(y){Bd._registry[y]=this}static createAtom(y,b,E){return Bd._registry[y].createAtom(b,Ze(b,y),E)}static serialize(y,b){var E;if(!y||y.length===0)return"";if((E=b.skipStyles)!=null&&E){const ee=[];for(const re of oh(y)){const ae=Bd._registry[re[0].mode];ee.push(...ae.serialize(re,b))}return Si(ee)}return Si(ef(y,b))}static getFont(y,b,E){return Bd._registry[y].getFont(b,E)}};ah._registry={};var Co=ah;function oh(a){const y=[];let b=[],E="NONE";for(const ee of a)ee.type!=="first"&&(ee.mode!==E?(b.length>0&&y.push(b),b=[ee],E=ee.mode):b.push(ee));return b.length>0&&y.push(b),y}function ya(a,y){const b=[];let E=[],ee;for(const re of a)if(re.type!=="first"&&re.style){let ae;y==="variant"?(ae=re.style.variant,re.style.variantStyle&&re.style.variantStyle!=="up"&&(ae+="-"+re.style.variantStyle)):ae=re.style[y],ae===ee?E.push(re):(E.length>0&&b.push(E),E=[re],ee=ae)}return E.length>0&&b.push(E),b}function Uu(a,y){var b;const{parent:E}=a[0],ee=E==null?void 0:E.computedStyle.color,re=[];for(const ae of oh(a)){const ue=y.defaultMode;for(const he of ya(ae,"color")){const ge=he[0].computedStyle,be=Co._registry[he[0].mode].serialize(he,ke(Ce({},y),{defaultMode:ue==="text"?"text":"math"}));!y.skipStyles&&ge.color&&ge.color!=="none"&&(!E||ee!==ge.color)?re.push(ra("\\textcolor",(b=ge.verbatimColor)!=null?b:ge.color,Si(be))):re.push(Si(be))}}return re}function Qh(a,y){const{parent:b}=a[0],E=b==null?void 0:b.computedStyle.backgroundColor;return ya(a,"backgroundColor").map(ee=>{var re;if(ee.length>0||ee[0].type!=="box"){const ae=ee[0].computedStyle;if(ae.backgroundColor&&ae.backgroundColor!=="none"&&(!b||E!==ae.backgroundColor))return ra("\\colorbox",(re=ae.verbatimBackgroundColor)!=null?re:ae.backgroundColor,Si(Uu(ee,ke(Ce({},y),{defaultMode:"text"}))))}return Si(Uu(ee,y))})}function ef(a,y){if(a.length===0)return[];const{parent:b}=a[0],E=b==null?void 0:b.computedStyle.fontSize,ee=[];for(const re of ya(a,"fontSize")){const ae=re[0].computedStyle.fontSize,ue=Qh(re,y);ue&&(ae&&ae!=="auto"&&(!b||E!==ae)?ee.push(["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][ae],...ue):ee.push(...ue))}return ee}function Gu(a){return a?{mord:"ord",mbin:"bin",mop:"op",mrel:"rel",mopen:"open",mclose:"close",mpunct:"punct",minner:"inner",spacing:"ignore",latex:"latex",composition:"inner",error:"inner",placeholder:"ord",supsub:"ignore"}[a]:void 0}function El(a){if(a.length===0)return"ord";const y=Gu(a[0].type),b=Gu(a[a.length-1].type);return y&&y===b?y:"ord"}function Ll(a,y){if(typeof a=="string")return a;if(typeof a=="number"){console.assert(Number.isFinite(a));const b=Math.ceil(100*a)/100;return b===0?"0":b.toString()+(y!=null?y:"")}return""}var ir=class Mp{constructor(y,b){var E,ee,re,ae,ue;if(typeof y=="number"?this.value=String.fromCodePoint(y):typeof y=="string"?this.value=y:Oe(y)?this.children=y.filter(ge=>ge!==null):y&&y instanceof Mp&&(this.children=[y]),this.children)for(const ge of this.children)ge.parent=this;this.type=(E=b==null?void 0:b.type)!=null?E:"ignore",this.isSelected=(b==null?void 0:b.isSelected)===!0,b!=null&&b.caret&&(this.caret=b.caret),this.classes=(ee=b==null?void 0:b.classes)!=null?ee:"",this.isTight=(re=b==null?void 0:b.isTight)!=null?re:!1,b!=null&&b.attributes&&(this.attributes=b.attributes);let he=b==null?void 0:b.fontFamily;b!=null&&b.style&&this.value&&(he=(ue=Co.getFont((ae=b.mode)!=null?ae:"math",this,ke(Ce({variant:"normal"},b.style),{letterShapeStyle:b.letterShapeStyle})))!=null?ue:void 0),he||(he="Main-Regular"),this._height=0,this._depth=0,this._width=0,this.hasExplicitWidth=!1,this.skew=0,this.italic=0,this.maxFontSize=0,this.scale=1,(b==null?void 0:b.maxFontSize)!==void 0&&(this.maxFontSize=b.maxFontSize),ac(this,he)}set atomID(y){y===void 0||y.length===0||(this.id=y)}selected(y){if(this.isSelected!==y&&(this.isSelected=y,this.children))for(const b of this.children)b.selected(y)}setStyle(y,b,E){if(b===void 0)return;const ee=Ll(b,E);ee.length>0&&(this.cssProperties||(this.cssProperties={}),this.cssProperties[y]=ee)}setTop(y){Number.isFinite(y)&&Math.abs(y)>.01&&(this.cssProperties||(this.cssProperties={}),this.cssProperties.top=Ll(y,"em"),this.height-=y,this.depth+=y)}get left(){var y;return(y=this.cssProperties)!=null&&y["margin-left"]?Number.parseFloat(this.cssProperties["margin-left"]):0}set left(y){Number.isFinite(y)&&(y===0?this.cssProperties&&delete this.cssProperties["margin-left"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-left"]=Ll(y,"em")))}set right(y){Number.isFinite(y)&&(y===0?this.cssProperties&&delete this.cssProperties["margin-right"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-right"]=Ll(y,"em")))}set bottom(y){Number.isFinite(y)&&(y===0?this.cssProperties&&delete this.cssProperties["margin-bottom"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-bottom"]=Ll(y,"em")))}get width(){return this._width*this.scale}set width(y){this._width=y,this.hasExplicitWidth=!0}set softWidth(y){}get height(){return this._height*this.scale}set height(y){this._height=y}get depth(){return this._depth*this.scale}set depth(y){this._depth=y}wrap(y){const b=y.parent;if(!b)return this;y.isPhantom&&this.setStyle("opacity",0);const E=y.color;E&&E!==b.color&&this.setStyle("color",E);let ee=y.backgroundColor;this.isSelected&&(ee=Wt(ee)),ee&&ee!==b.backgroundColor&&(this.setStyle("background-color",ee),this.setStyle("display","inline-block"));const re=y.scalingFactor;return this.scale=re,this.skew*=re,this.italic*=re,this}toMarkup(){var y,b,E,ee;let re=(y=this.value)!=null?y:"";if(this.children)for(const lt of this.children)re+=lt.toMarkup();let ae="";if(this.svgBody)ae=Ml(this.svgBody);else if(this.svgOverlay){ae='<span style="',ae+="display: inline-block;",ae+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`,ae+=`vertical-align:${Math.floor(100*this.depth)/100}em;`,ae+='">',ae+=re,ae+="</span>",ae+='<svg style="position:absolute;overflow:visible;',ae+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`;const lt=(b=this.cssProperties)==null?void 0:b.padding;lt?(ae+=`top:${lt};`,ae+=`left:${lt};`,ae+=`width:calc(100% - 2 * ${lt} );`):ae+="top:0;left:0;width:100%;",ae+="z-index:2;",ae+='"',this.svgStyle&&(ae+=this.svgStyle),ae+=` viewBox="0 0 ${Math.floor(100*this.width)/100} ${Math.floor(100*(this.height+this.depth))/100}"`,ae+=`>${this.svgOverlay}</svg>`}let ue="";const he=this.classes.split(" ");he.push((E={latex:"ML__raw-latex",placeholder:"ML__placeholder",error:"ML__error"}[this.type])!=null?E:""),this.caret==="latex"&&he.push("ML__latex-caret"),this.isSelected&&he.push("ML__selected");const ge=he.length===1?he[0]:he.filter((lt,xt,vn)=>lt.length>0&&vn.indexOf(lt)===xt).join(" ");if(ge.length>0&&(ue+=` class="${ge}"`),this.id&&(ue+=` data-atom-id=${this.id}`),this.cssId&&(ue+=` id="${this.cssId.replace(/ /g,"-")}" `),this.attributes&&(ue+=" "+Object.keys(this.attributes).map(lt=>`${lt}="${this.attributes[lt]}"`).join(" ")),this.htmlData){const lt=this.htmlData.split(",");for(const xt of lt){const vn=xt.match(/([^=]+)=(.+$)/);if(vn){const nr=vn[1].trim().replace(/ /g,"-");nr&&(ue+=` data-${nr}="${vn[2]}" `)}else{const nr=xt.trim().replace(/ /g,"-");nr&&(ue+=` data-${nr} `)}}}const be=(ee=this.cssProperties)!=null?ee:{};this.hasExplicitWidth&&be.width===void 0&&(be.width=`${Math.ceil(this._width*100)/100}em`);const Be=Object.keys(be).map(lt=>`${lt}:${be[lt]}`);if(this.scale!==void 0&&this.scale!==1&&(re.length>0||ae.length>0)&&Be.push(`font-size: ${Math.ceil(this.scale*1e4)/100}%`),this.htmlStyle){const lt=this.htmlStyle.split(";");let xt="";for(const vn of lt){const nr=vn.match(/([^=]+):(.+$)/);if(nr){const fn=nr[1].trim().replace(/ /g,"-");fn&&(xt+=`${fn}:${nr[2]};`)}}xt&&(ue+=` style="${xt}"`)}Be.length>0&&(ue+=` style="${Be.join(";")}"`);let He="";return ue.length>0||ae.length>0?He=`<span${ue}>${re}${ae}</span>`:He=re,this.caret==="text"?He+='<span class="ML__text-caret"></span>':this.caret==="math"&&(He+='<span class="ML__caret"></span>'),He}tryCoalesceWith(y){if(this.svgBody||!this.value||y.svgBody||!y.value)return!1;const b=this.children&&this.children.length>0,E=y.children&&y.children.length>0;if(b||E)return!1;if(y.cssProperties||this.cssProperties){for(const he of["border","border-left","border-right","border-right-width","left","margin","margin-left","margin-right","padding","position","width"])if(y.cssProperties&&he in y.cssProperties||this.cssProperties&&he in this.cssProperties)return!1}const ee=this.cssProperties?Object.keys(this.cssProperties).length:0,re=y.cssProperties?Object.keys(y.cssProperties).length:0;if(ee!==re)return!1;if(ee>0){for(const he of Object.keys(this.cssProperties))if(this.cssProperties[he]!==y.cssProperties[he])return!1}const ae=this.classes.trim().replace(/\s+/g," ").split(" "),ue=y.classes.trim().replace(/\s+/g," ").split(" ");if(ae.length!==ue.length)return!1;ae.sort(),ue.sort();for(const[he,ge]of ae.entries())if(ge==="vertical-separator"||ge!==ue[he])return!1;return this.value+=y.value,this.height=Math.max(this.height,y.height),this.depth=Math.max(this.depth,y.depth),this._width=this._width+y._width,this.maxFontSize=Math.max(this.maxFontSize,y.maxFontSize),this.italic=y.italic,!0}};function Xu(a){if(!a||a.length===0)return[];a[0].children=Xu(a[0].children);const y=[a[0]];for(let b=1;b<a.length;b++)y[y.length-1].tryCoalesceWith(a[b])||(a[b].children=Xu(a[b].children),y.push(a[b]));return y}function Yc(a){return a.children&&(a.children=Xu(a.children)),a}function qc(a,y){if(!a)return new ir(null,y);const b=new ir(null,{classes:"ML__strut",type:"ignore"});b.setStyle("height",Math.max(0,a.height),"em");const E=[b];if(a.depth!==0){const ee=new ir(null,{classes:"ML__strut--bottom",type:"ignore"});ee.setStyle("height",a.height+a.depth,"em"),ee.setStyle("vertical-align",-a.depth,"em"),E.push(ee)}return E.push(a),new ir(E,ke(Ce({},y),{type:"lift"}))}function $o(a){const y=eh(a)/2,b=new ir(null,{maxFontSize:0});return b.height=y+.166,b.depth=y-.166,b.svgBody=a,b}function ac(a,y){var b;if(a.type==="latex"){a.height=.9,a.depth=.2,a._width=1;return}if(a.value){a.height=-1/0,a.depth=-1/0,a._width=0,a.skew=-1/0,a.italic=-1/0;for(let E=0;E<a.value.length;E++){const ee=fs(a.value.codePointAt(E),y);a.height=Math.max(a.height,ee.height),a.depth=Math.max(a.depth,ee.depth),a._width+=ee.width,a.skew=ee.skew,a.italic=ee.italic}return}if(a.children&&a.children.length>0){let E=-1/0,ee=-1/0,re=0;for(const ae of a.children)ae.height>E&&(E=ae.height),ae.depth>ee&&(ee=ae.depth),re=Math.max(re,(b=ae.maxFontSize)!=null?b:0);a.height=E,a.depth=ee,a._width=a.children.reduce((ae,ue)=>ae+ue.width,0),a.maxFontSize=re}}function Jc(a){if("individualShift"in a){const y=a.individualShift;let b=y[0];const E=[b],ee=-b.shift-b.box.depth;let re=ee;for(let ae=1;ae<y.length;ae++){const ue=y[ae],he=-ue.shift-re-ue.box.depth,ge=he-(b.box.height+b.box.depth);re=re+he,E.push(ge),E.push(ue),b=ue}return[E,ee]}if("top"in a){let y=a.top;for(const b of a.children)y-=typeof b=="number"?b:b.box.height+b.box.depth;return[a.children,y]}else{if("bottom"in a)return[a.children,-a.bottom];if("firstBaseline"in a){const y=a.firstBaseline[0];if(typeof y=="number")throw new Error("First child must be an element.");return[a.firstBaseline,-y.box.depth]}else if("shift"in a){const y=a.children[0];if(typeof y=="number")throw new Error("First child must be an element.");return[a.children,-y.box.depth-a.shift]}}return[null,0]}function oc(a){var y;const[b,E]=Jc(a);if(!b)return[[],0,0];const ee=new ir(null,{classes:"pstrut"});let re=0;for(const xt of b)if(typeof xt!="number"){const vn=xt.box;re=Math.max(re,vn.maxFontSize,vn.height)}re+=2,ee.height=re,ee.setStyle("height",re,"em");const ae=[];let ue=E,he=E,ge=E,be=0;for(const xt of b){if(typeof xt=="number")ge+=xt;else{const vn=xt.box,nr=(y=xt.classes)!=null?y:[],fn=new ir([ee,vn],{classes:nr.join(" "),style:xt.style});vn.setStyle("height",vn.height+vn.depth,"em"),vn.setStyle("display","inline-block"),fn.setStyle("top",-re-ge-vn.depth,"em"),xt.marginLeft&&fn.setStyle("margin-left",xt.marginLeft,"em"),xt.marginRight&&fn.setStyle("margin-right",xt.marginRight,"em"),ae.push(fn),ge+=vn.height+vn.depth,be=Math.max(be,fn.width)}ue=Math.min(ue,ge),he=Math.max(he,ge)}ae.forEach(xt=>{xt.softWidth=be});const Be=new ir(ae,{classes:"vlist"});if(Be.softWidth=be,Be.height=he,Be.setStyle("height",he,"em"),ue>=0)return[[new ir(Be,{classes:"vlist-r"})],he,-ue];const He=new ir(new ir(null),{classes:"vlist"});He.height=-ue,He.setStyle("height",-ue,"em");const lt=new ir(8203,{classes:"vlist-s",maxFontSize:0});return lt.softWidth=0,lt.height=0,lt.depth=0,[[new ir([Be,lt],{classes:"vlist-r"}),new ir(He,{classes:"vlist-r"})],he,-ue]}var Yi=class extends ir{constructor(a,y){var b;const[E,ee,re]=oc(a);super(E.length===1?E[0]:E,{type:y==null?void 0:y.type,classes:((b=y==null?void 0:y.classes)!=null?b:"")+" vlist-t"+(E.length===2?" vlist-t2":"")}),this.height=ee,this.depth=re,this.softWidth=E.reduce((ae,ue)=>Math.max(ae,ue.width),0)}};function tf(a,y){var b,E,ee,re,ae;const ue=a.metrics,he=new ir(y.base),ge=(b=y.baseShift)!=null?b:0,be=(E=y.slant)!=null?E:0;let Be=0,He=0;y.above&&(Be=(ee=y.aboveShift)!=null?ee:Math.max(ue.bigOpSpacing1,ue.bigOpSpacing3-y.above.depth)),y.below&&(He=(re=y.belowShift)!=null?re:Math.max(ue.bigOpSpacing2,ue.bigOpSpacing4-y.below.height));let lt=null;if(y.below&&y.above){const xt=ue.bigOpSpacing5+y.below.height+y.below.depth+He+he.depth+ge;lt=new Yi({bottom:xt,children:[ue.bigOpSpacing5,{box:y.below,marginLeft:-be,classes:["ML__center"]},He,{box:he,classes:["ML__center"]},Be,{box:y.above,marginLeft:be,classes:["ML__center"]},ue.bigOpSpacing5]}).wrap(a)}else if(y.below&&!y.above)lt=new Yi({top:he.height-ge,children:[ue.bigOpSpacing5,{box:y.below,marginLeft:-be,classes:["ML__center"]},He,{box:he,classes:["ML__center"]}]}).wrap(a);else if(!y.below&&y.above){const xt=he.depth+ge;lt=new Yi({bottom:xt,children:[{box:he,classes:["ML__center"]},Be,{box:y.above,marginLeft:be,classes:["ML__center"]},ue.bigOpSpacing5]}).wrap(a)}else{const xt=he.depth+ge;lt=new Yi({bottom:xt,children:[{box:he},ue.bigOpSpacing5]}).wrap(a)}return new ir(lt,{type:(ae=y.type)!=null?ae:"op"})}var Yu=7,ms=6,sc=5,Is=4,ul=3,io=2,Io=1,Ha=0,Uo=class{constructor(a,y,b){this.id=a,this.sizeDelta=y,this.cramped=b;const E={"-4":2,"-3":1,0:0}[y];this.metrics=Object.keys(ju).reduce((ee,re)=>ke(Ce({},ee),{[re]:ju[re][E]}),{})}getFontSize(a){return Math.max(1,a+this.sizeDelta)}get sup(){return Go[[Ha,Io,Ha,Io,io,ul,io,ul][this.id]]}get sub(){return Go[[Ha,Ha,Ha,Ha,io,io,io,io][this.id]]}get fracNum(){return Go[[Ha,Io,Ha,Io,io,ul,Is,sc][this.id]]}get fracDen(){return Go[[Ha,Ha,Ha,Ha,io,io,Is,Is][this.id]]}get cramp(){return Go[[Ha,Ha,io,io,Is,Is,ms,ms][this.id]]}get isTight(){return this.sizeDelta<0}},dl={7:new Uo(Yu,0,!1),6:new Uo(ms,0,!0),5:new Uo(sc,0,!1),4:new Uo(Is,0,!0),3:new Uo(ul,-3,!1),2:new Uo(io,-3,!0),1:new Uo(Io,-4,!1),0:new Uo(Ha,-4,!0)},Go=ke(Ce({},dl),{displaystyle:dl[Yu],textstyle:dl[sc],scriptstyle:dl[ul],scriptscriptstyle:dl[Io]});function Dl(a,y){var b;if(!a)return 0;const E={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:3/4,em:ll,bp:803/800,dd:1238/1157,pc:12,in:72.27,mu:10/18}[(b=a.unit)!=null?b:"pt"];if(Number.isFinite(y)){const ee=Ys(10,y);return Math.round(a.dimension/ll*E*ee)/ee}return a.dimension*E}function qu(a,y){if(a===null)return 0;const b=Dl(a)/ll;if(Number.isFinite(y)){const E=Ys(10,y);return Math.round(b*E)/E}return b}function Ju(a){var y;return`${a.dimension}${(y=a.unit)!=null?y:"pt"}`}function sh(a){let y=Ju(a.glue);return a.grow&&a.grow.dimension!==0&&(y+=` plus ${Ju(a.grow)}`),a.shrink&&a.shrink.dimension!==0&&(y+=` minus ${Ju(a.shrink)}`),y}function Ma(a){var y,b;if(a==null)return null;let E="";if("dimension"in a&&(E=`${a.dimension}${(y=a.unit)!=null?y:"pt"}`),"glue"in a&&(E=sh(a)),"number"in a)if(!("base"in a)||a.base==="decimal")E=Number(a.number).toString();else if(a.base==="alpha")E=`\`${String.fromCodePoint(a.number)}`;else{const ee=Math.round(a.number)>>>0;a.base==="hexadecimal"?(E=Number(ee).toString(16).toUpperCase(),ee<=255?E=E.padStart(2,"0"):ee<=65535?E=E.padStart(4,"0"):ee<=16777215?E=E.padStart(6,"0"):E=E.padStart(8,"0"),E=`"${E}`):a.base==="octal"&&(E=Number(ee).toString(8),ee<=63?E=E.padStart(2,"0"):ee<=30583?E=E.padStart(4,"0"):E=E.padStart(8,"0"),E=`'${E}`)}return"register"in a&&("factor"in a&&(a.factor===-1?E="-":a.factor!==1&&(E=Number(a.factor).toString())),"global"in a&&a.global&&(E+="\\global"),E+=`\\${a.register}`),"string"in a&&(E=a.string),(b=a.relax)!=null&&b&&(E+="\\relax"),E}function Xo(a,y){return a==null?null:"number"in a?ke(Ce({},a),{number:a.number*y}):"register"in a?"factor"in a&&a.factor?ke(Ce({},a),{factor:a.factor*y}):ke(Ce({},a),{factor:y}):"dimension"in a?ke(Ce({},a),{dimension:a.dimension*y}):"glue"in a?a.shrink&&a.grow?{glue:Xo(a.glue,y),shrink:Xo(a.shrink,y),grow:Xo(a.grow,y)}:a.shrink?{glue:Xo(a.glue,y),shrink:Xo(a.shrink,y)}:a.grow?{glue:Xo(a.glue,y),grow:Xo(a.grow,y)}:{glue:Xo(a.glue,y)}:null}var nf={"p@":{dimension:1},"z@":{dimension:0},maxdimen:{dimension:16383.99999},hfuzz:{dimension:.1},vfuzz:{dimension:.1},overfullrule:{dimension:5},hsize:{dimension:6.5,unit:"in"},vsize:{dimension:8.9,unit:"in"},parindent:{dimension:20},maxdepth:{dimension:4},splitmaxdepth:{register:"maxdimen"},boxmaxdepth:{register:"maxdimen"},delimitershortfall:{dimension:5},nulldelimiterspace:{dimension:1.2,unit:"pt"},scriptspace:{dimension:.5},topskip:{dimension:10},splittopskip:{dimension:10},normalbaselineskip:{dimension:12},normallineskip:{dimension:1},normallineskiplimit:{dimension:0},jot:{dimension:3},doublerulesep:{dimension:2},arrayrulewidth:{dimension:.4},arraycolsep:{dimension:5},fboxsep:{dimension:3},fboxrule:{dimension:.4},"z@skip":{glue:{dimension:0},shrink:{dimension:0},grow:{dimension:0}},hideskip:{glue:{dimension:-1e3},grow:{dimension:1,unit:"fill"}},"@flushglue":{glue:{dimension:0},grow:{dimension:1,unit:"fill"}},parskip:{glue:{dimension:0},grow:{dimension:1}},abovedisplayskip:{glue:{dimension:12},grow:{dimension:3},shrink:{dimension:9}},abovedisplayshortskip:{glue:{dimension:0},grow:{dimension:3}},belowdisplayskip:{glue:{dimension:12},grow:{dimension:3},shrink:{dimension:9}},belowdisplayshortskip:{glue:{dimension:7},grow:{dimension:3},shrink:{dimension:4}},parfillskip:{glue:{dimension:0},grow:{dimension:1,unit:"fil"}},thinmuskip:{glue:{dimension:3,unit:"mu"}},medmuskip:{glue:{dimension:4,unit:"mu"},grow:{dimension:2,unit:"mu"},shrink:{dimension:4,unit:"mu"}},thickmuskip:{glue:{dimension:5,unit:"mu"},grow:{dimension:5,unit:"mu"}},smallskipamount:{glue:{dimension:3},grow:{dimension:1},shrink:{dimension:1}},medskipamount:{glue:{dimension:6},grow:{dimension:2},shrink:{dimension:3}},bigskipamount:{glue:{dimension:12},grow:{dimension:2},shrink:{dimension:4}},pretolerance:100,tolerance:200,hbadness:1e3,vbadness:1e3,linepenalty:10,hyphenpenalty:50,exhyphenpenalty:50,binoppenalty:700,relpenalty:500,clubpenalty:150,widowpenalty:150,displaywidowpenalty:50,brokenpenalty:100,predisplaypenalty:1e4,doublehyphendemerits:1e4,finalhyphendemerits:5e3,adjdemerits:1e4,tracinglostchars:1,uchyph:1,delimiterfactor:901,defaulthyphenchar:"\\-",defaultskewchar:-1,newlinechar:-1,showboxbreadth:5,showboxdepth:3,errorcontextlines:5,interdisplaylinepenalty:100,interfootnotelinepenalty:100,baselineSkip:1.2,arraystretch:1,month:new Date().getMonth()+1,day:new Date().getDate(),year:new Date().getFullYear()};function Al(){return Ce({},nf)}function Qc(){return{registers:Al(),smartFence:!1,renderPlaceholder:void 0,placeholderSymbol:"\u25A2",letterShapeStyle:nt.locale.startsWith("fr")?"french":"tex",minFontScale:0,colorMap:Ot,backgroundColorMap:rt,getMacro:a=>Ft(a,Jn())}}var Di=class _p{constructor(y,b){var E,ee,re,ae,ue,he,ge,be,Be,He,lt,xt,vn,nr,fn;let Rn;y!=null&&y.parent?(this.parent=y.parent,Rn=y.parent,this.registers={}):(Rn=Ce(Ce({},Qc()),(E=y==null?void 0:y.from)!=null?E:{}),this.registers=Rn.registers),Rn.atomIdsSettings&&(this.atomIdsSettings=Ce({},Rn.atomIdsSettings)),this.renderPlaceholder=Rn.renderPlaceholder,this.isPhantom=(ae=(re=y==null?void 0:y.isPhantom)!=null?re:(ee=this.parent)==null?void 0:ee.isPhantom)!=null?ae:!1,this.letterShapeStyle=Rn.letterShapeStyle,this.minFontScale=Rn.minFontScale,b!=null&&b.color&&b.color!=="none"?this.color=b.color:this.color=(he=(ue=this.parent)==null?void 0:ue.color)!=null?he:"",b!=null&&b.backgroundColor&&b.backgroundColor!=="none"?this.backgroundColor=b.backgroundColor:this.backgroundColor=(be=(ge=this.parent)==null?void 0:ge.backgroundColor)!=null?be:"",b!=null&&b.fontSize&&b.fontSize!=="auto"&&b.fontSize!==((Be=this.parent)==null?void 0:Be.size)?this.size=b.fontSize:this.size=(lt=(He=this.parent)==null?void 0:He.size)!=null?lt:Ds;let cr=(vn=(xt=this.parent)==null?void 0:xt.mathstyle)!=null?vn:Go.displaystyle;if(typeof(y==null?void 0:y.mathstyle)=="string"){if(Rn instanceof _p)switch(y.mathstyle){case"cramp":cr=cr.cramp;break;case"superscript":cr=cr.sup;break;case"subscript":cr=cr.sub;break;case"numerator":cr=cr.fracNum;break;case"denominator":cr=cr.fracDen;break}switch(y.mathstyle){case"textstyle":cr=Go.textstyle;break;case"displaystyle":cr=Go.displaystyle;break;case"scriptstyle":cr=Go.scriptstyle;break;case"scriptscriptstyle":cr=Go.scriptscriptstyle;break;case"":case"auto":break}}this.mathstyle=cr,this.smartFence=Rn.smartFence,this.placeholderSymbol=Rn.placeholderSymbol,this.colorMap=(nr=Rn.colorMap)!=null?nr:Fn=>Fn,this.backgroundColorMap=(fn=Rn.backgroundColorMap)!=null?fn:Fn=>Fn,this.getMacro=Rn.getMacro,console.assert(this.parent!==void 0||this.registers!==void 0)}makeID(){if(!this.atomIdsSettings)return;if(this.atomIdsSettings.overrideID)return this.atomIdsSettings.overrideID;if(typeof this.atomIdsSettings.seed!="number")return`${Date.now().toString(36).slice(-2)}${Math.floor(Math.random()*1e5).toString(36)}`;const y=this.atomIdsSettings.seed.toString(36);return this.atomIdsSettings.seed+=1,y}scale(y){return y*this.effectiveFontSize}get scalingFactor(){return this.parent?this.effectiveFontSize/this.parent.effectiveFontSize:1}get isDisplayStyle(){return this.mathstyle.id===Yu||this.mathstyle.id===ms}get isCramped(){return this.mathstyle.cramped}get isTight(){return this.mathstyle.isTight}get metrics(){return this.mathstyle.metrics}get effectiveFontSize(){return Math.max(Gc[Math.max(1,this.size+this.mathstyle.sizeDelta)],this.minFontScale)}getRegister(y){var b;if((b=this.registers)!=null&&b[y])return this.registers[y];if(this.parent)return this.parent.getRegister(y)}getRegisterAsNumber(y){const b=this.getRegister(y);if(typeof b=="number")return b;if(typeof b=="string")return Number(b)}getRegisterAsGlue(y){var b;if((b=this.registers)!=null&&b[y]){const E=this.registers[y];return typeof E=="object"&&"glue"in E?E:typeof E=="object"&&"dimension"in E?{glue:{dimension:E.dimension}}:typeof E=="number"?{glue:{dimension:E}}:void 0}if(this.parent)return this.parent.getRegisterAsGlue(y)}getRegisterAsEm(y,b){return qu(this.getRegisterAsDimension(y),b)}getRegisterAsDimension(y){var b;if((b=this.registers)!=null&&b[y]){const E=this.registers[y];return typeof E=="object"&&"glue"in E?E.glue:typeof E=="object"&&"dimension"in E?E:typeof E=="number"?{dimension:E}:void 0}if(this.parent)return this.parent.getRegisterAsDimension(y)}setRegister(y,b){if(b===void 0){delete this.registers[y];return}this.registers[y]=b}evaluate(y){if(!y||!("register"in y))return y;let b=this;if("global"in y&&y.global)for(;b.parent;)b=b.parent;let E=1;"factor"in y&&y.factor!==1&&y.factor!==void 0&&(E=y.factor);const ee=b.getRegister(y.register);if(ee===void 0)return;if(typeof ee=="string")return{string:Number(ee).toString()+ee};if(typeof ee=="number")return{number:E*ee};const re=b.evaluate(ee);if(re!==void 0)return"string"in re?{string:Number(ee).toString()+re.string}:"number"in re?{number:E*re.number}:"dimension"in re?ke(Ce({},re),{dimension:E*re.dimension}):"glue"in re?ke(Ce({},re),{glue:ke(Ce({},re.glue),{dimension:E*re.glue.dimension}),shrink:re.shrink?ke(Ce({},re.shrink),{dimension:E*re.shrink.dimension}):void 0,grow:re.grow?ke(Ce({},re.grow),{dimension:E*re.grow.dimension}):void 0}):y}toDimension(y){const b=this.evaluate(y);return b===void 0?null:"dimension"in b?b:"glue"in b?b.glue:"number"in b?{dimension:b.number}:null}toEm(y,b){if(y===null)return 0;const E=this.toDimension(y);return E===null?0:Dl(E,b)/ll}toNumber(y){if(y===null)return null;const b=this.evaluate(y);return b===void 0?null:"number"in b?b.number:"dimension"in b?b.dimension:"glue"in b?b.glue.dimension:"string"in b?Number(b.string):null}toColor(y){var b,E;if(y===null)return null;const ee=this.evaluate(y);return ee===void 0?null:"string"in ee?(E=(b=this.colorMap)==null?void 0:b.call(this,ee.string))!=null?E:ee.string:null}toBackgroundColor(y){var b,E;if(y===null)return null;const ee=this.evaluate(y);return ee===void 0?null:"string"in ee?(E=(b=this.backgroundColorMap)==null?void 0:b.call(this,ee.string))!=null?E:ee.string:null}},Tl=["body","above","below","superscript","subscript"];function gs(a){return typeof a=="string"&&Tl.includes(a)}function lc(a){return a!==void 0&&Array.isArray(a)&&a.length===2}var Dn=class vl{constructor(y){var b,E,ee,re,ae,ue;this.type=y.type,typeof y.value=="string"&&(this.value=y.value),this.command=(E=(b=y.command)!=null?b:this.value)!=null?E:"",this.mode=(ee=y.mode)!=null?ee:"math",y.isFunction&&(this.isFunction=!0),y.limits&&(this.subsupPlacement=y.limits),this.style=Ce({},y.style),this.displayContainsHighlight=(re=y.displayContainsHighlight)!=null?re:!1,this.captureSelection=(ae=y.captureSelection)!=null?ae:!1,this.skipBoundary=(ue=y.skipBoundary)!=null?ue:!1,y.verbatimLatex!==void 0&&y.verbatimLatex!==null&&(this.verbatimLatex=y.verbatimLatex),y.args&&(this.args=y.args),y.body&&(this.body=y.body),this._changeCounter=0}static createBox(y,b,E){var ee;if(!b)return null;const re=lh(b),ae=[];for(const he of re){const ge=he[0].style,be=ch(y,he,{style:{color:ge.color,backgroundColor:ge.backgroundColor,fontSize:ge.fontSize}});be&&ae.push(be)}if(ae.length===0)return null;const ue=((ee=E==null?void 0:E.classes)!=null?ee:"").trim();return ae.length===1&&!ue&&!(E!=null&&E.type)?ae[0].wrap(y):new ir(ae,{classes:ue,type:E==null?void 0:E.type}).wrap(y)}static serialize(y,b){return Co.serialize(y,b)}static commonAncestor(y,b){if(y===b||y.parent===b.parent)return y.parent;const E=new WeakSet;let{parent:ee}=y;for(;ee;)E.add(ee),ee=ee.parent;for(ee=b.parent;ee;){if(E.has(ee))return ee;ee=ee.parent}console.assert(!!ee)}static fromJson(y){return typeof y=="string"?new vl({type:"mord",value:y,mode:"math"}):new vl(y)}get latexMode(){return this.mode==="math"?"math":"text"}toJson(){const y={};if(this.type&&(y.type=this.type),this.mode!=="math"&&(y.mode=this.mode),this.command&&this.command!==this.value&&(y.command=this.command),this.value!==void 0&&(y.value=this.value),this.style&&Object.keys(this.style).length>0&&(y.style=Ce({},this.style)),this.verbatimLatex!==void 0&&(y.verbatimLatex=this.verbatimLatex),this.subsupPlacement&&(y.subsupPlacement=this.subsupPlacement),this.explicitSubsupPlacement&&(y.explicitSubsupPlacement=!0),this.isFunction&&(y.isFunction=!0),this.displayContainsHighlight&&(y.displayContainsHighlight=!0),this.isExtensibleSymbol&&(y.isExtensibleSymbol=!0),this.skipBoundary&&(y.skipBoundary=!0),this.captureSelection&&(y.captureSelection=!0),this.args&&(y.args=ed(this.args)),this._branches)for(const b of Object.keys(this._branches))this._branches[b]&&(y[b]=this._branches[b].filter(E=>E.type!=="first").map(E=>E.toJson()));return y.type==="mord"&&Object.keys(y).length===2&&"value"in y?y.value:y}get changeCounter(){return this.parent?this.parent.changeCounter:this._changeCounter}set isDirty(y){if(y){this.parent||this._changeCounter++,"verbatimLatex"in this&&(this.verbatimLatex=void 0),this._children=void 0;let{parent:b}=this;for(;b;)b.parent||b._changeCounter++,"verbatimLatex"in b&&(b.verbatimLatex=void 0),b._children=void 0,b=b.parent}}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Ze(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):this.body&&this.command?Si([ra(this.command,this.bodyToLatex(y)),this.supsubToLatex(y)]):this.body?Si([this.bodyToLatex(y),this.supsubToLatex(y)]):!this.value||this.value==="\u200B"?"":this.command}bodyToLatex(y){var b;return Co.serialize(this.body,ke(Ce({},y),{defaultMode:(b=y.defaultMode)!=null?b:this.latexMode}))}aboveToLatex(y){return Co.serialize(this.above,y)}belowToLatex(y){return Co.serialize(this.below,y)}supsubToLatex(y){let b="";if(y=ke(Ce({},y),{defaultMode:"math"}),this.branch("subscript")!==void 0){const E=Co.serialize(this.subscript,y);E.length===0?b+="_{}":E.length===1?/^[0-9]$/.test(E)?b+=`_${E}`:b+=`_{${E}}`:b+=`_{${E}}`}if(this.branch("superscript")!==void 0){const E=Co.serialize(this.superscript,y);E.length===0?b+="^{}":E.length===1?E==="\u2032"?b+="^\\prime ":E==="\u2033"?b+="^\\doubleprime ":/^[0-9]$/.test(E)?b+=`^${E}`:b+=`^{${E}}`:b+=`^{${E}}`}return b}get treeDepth(){let y=1,b=this.parent;for(;b;)b=b.parent,y+=1;return y}get inCaptureSelection(){let y=this;for(;y;){if(y.captureSelection)return!0;y=y.parent}return!1}get parentPrompt(){let y=this.parent;for(;y;){if(y.type==="prompt"&&!y.captureSelection)return y;y=y.parent}return null}branch(y){if(gs(y)&&this._branches)return this._branches[y]}get branches(){if(!this._branches)return[];const y=[];for(const b of Tl)this._branches[b]&&y.push(b);return y}createBranch(y){return console.assert(gs(y)),gs(y)?(this._branches?this._branches[y]||(this._branches[y]=[this.makeFirstAtom(y)]):this._branches={[y]:[this.makeFirstAtom(y)]},this.isDirty=!0,this._branches[y]):[]}get row(){return lc(this.parentBranch)?this.parentBranch[0]:-1}get col(){return lc(this.parentBranch)?this.parentBranch[1]:-1}get body(){var y;return(y=this._branches)==null?void 0:y.body}set body(y){this.setChildren(y,"body")}get superscript(){var y;return(y=this._branches)==null?void 0:y.superscript}set superscript(y){this.setChildren(y,"superscript")}get subscript(){var y;return(y=this._branches)==null?void 0:y.subscript}set subscript(y){this.setChildren(y,"subscript")}get above(){var y;return(y=this._branches)==null?void 0:y.above}set above(y){this.setChildren(y,"above")}get below(){var y;return(y=this._branches)==null?void 0:y.below}set below(y){this.setChildren(y,"below")}get computedStyle(){var y,b;const E=typeof this.style.verbatimColor=="string",ee=typeof this.style.verbatimBackgroundColor=="string",re=Ce(Ce({},(b=(y=this.parent)==null?void 0:y.computedStyle)!=null?b:{}),this.style);return delete re.variant,delete re.variantStyle,ee||delete re.verbatimBackgroundColor,E||delete re.verbatimColor,re}applyStyle(y){this.isDirty=!0,this.style=Ce(Ce({},this.style),y),this.style.fontFamily==="none"&&delete this.style.fontFamily,this.style.fontShape==="auto"&&delete this.style.fontShape,this.style.fontSeries==="auto"&&delete this.style.fontSeries,this.style.color==="none"&&(delete this.style.color,delete this.style.verbatimColor),this.style.backgroundColor==="none"&&(delete this.style.backgroundColor,delete this.style.verbatimBackgroundColor),this.style.fontSize==="auto"&&delete this.style.fontSize;for(const b of this.children)b.applyStyle(y)}getInitialBaseElement(){var y,b,E;return this.hasEmptyBranch("body")?this:(console.assert(((y=this.body)==null?void 0:y[0].type)==="first"),(E=(b=this.body[1])==null?void 0:b.getInitialBaseElement())!=null?E:this)}getFinalBaseElement(){return this.hasEmptyBranch("body")?this:this.body[this.body.length-1].getFinalBaseElement()}isCharacterBox(){return this.type==="leftright"||this.type==="genfrac"||this.type==="subsup"||this.type==="delim"||this.type==="array"||this.type==="surd"?!1:this.getFinalBaseElement().type==="mord"}hasEmptyBranch(y){const b=this.branch(y);return b?(console.assert(b.length>0),console.assert(b[0].type==="first"),b.length===1):!0}setChildren(y,b){var E;if(!y||(console.assert(gs(b)),!gs(b)))return;console.assert(((E=y[0])==null?void 0:E.type)!=="first");const ee=[this.makeFirstAtom(b),...y];this._branches?this._branches[b]=ee:this._branches={[b]:ee};for(const re of y)re.parent=this,re.parentBranch=b;this.isDirty=!0}makeFirstAtom(y){const b=new vl({type:"first",mode:this.mode});return b.parent=this,b.parentBranch=y,b}addChild(y,b){console.assert(y.type!=="first"),this.createBranch(b).push(y),this.isDirty=!0,y.parent=this,y.parentBranch=b}addChildBefore(y,b){console.assert(b.parentBranch!==void 0);const E=this.createBranch(b.parentBranch);E.splice(E.indexOf(b),0,y),this.isDirty=!0,y.parent=this,y.parentBranch=b.parentBranch}addChildAfter(y,b){console.assert(b.parentBranch!==void 0);const E=this.createBranch(b.parentBranch);E.splice(E.indexOf(b)+1,0,y),this.isDirty=!0,y.parent=this,y.parentBranch=b.parentBranch}addChildren(y,b){const E=this.createBranch(b);for(const ee of y)ee.parent=this,ee.parentBranch=b,E.push(ee);this.isDirty=!0}addChildrenAfter(y,b){console.assert(y.length===0||y[0].type!=="first"),console.assert(b.parentBranch!==void 0);const E=this.createBranch(b.parentBranch);E.splice(E.indexOf(b)+1,0,...y),this.isDirty=!0;for(const ee of y)ee.parent=this,ee.parentBranch=b.parentBranch;return y[y.length-1]}removeBranch(y){const b=this.branch(y);if(gs(y)&&(this._branches[y]=void 0),!b)return[];for(const E of b)E.parent=void 0,E.parentBranch=void 0;return console.assert(b[0].type==="first"),b.shift(),this.isDirty=!0,b}removeChild(y){if(console.assert(y.parent===this),y.type==="first")return;const b=this.branch(y.parentBranch),E=b.indexOf(y);console.assert(E>=0),b.splice(E,1),this.isDirty=!0,y.parent=void 0,y.parentBranch=void 0}get siblings(){return this.parent?this.parent.branch(this.parentBranch):[]}get firstSibling(){return this.siblings[0]}get lastSibling(){const{siblings:y}=this;return y[y.length-1]}get isFirstSibling(){return this===this.firstSibling}get isLastSibling(){return this===this.lastSibling}get hasNoSiblings(){return this.siblings.length===1}get leftSibling(){console.assert(this.parent!==void 0);const y=this.parent.branch(this.parentBranch);return y[y.indexOf(this)-1]}get rightSibling(){console.assert(this.parent!==void 0);const y=this.parent.branch(this.parentBranch);return y[y.indexOf(this)+1]}get hasChildren(){return!!(this._branches&&this.children.length>0)}get firstChild(){return console.assert(this.hasChildren),this.children[0]}get lastChild(){console.assert(this.hasChildren);const{children:y}=this;return y[y.length-1]}get children(){if(this._children)return this._children;if(!this._branches)return[];const y=[];for(const b of Tl)if(this._branches[b])for(const E of this._branches[b])y.push(...E.children),y.push(E);return this._children=y,y}render(y){if(this.type==="first"&&!y.atomIdsSettings)return null;const b=Ze(this.command,this.mode);if(b!=null&&b.render)return b.render(this,y);const E=new Di({parent:y},this.style);let ee=this.createBox(E,{classes:this.parent?"":"ML__base"});return ee?(!this.subsupPlacement&&(this.superscript||this.subscript)&&(ee=this.attachSupsub(E,{base:ee})),ee.wrap(E)):null}attachSupsub(y,b){var E;const ee=b.base,re=this.superscript,ae=this.subscript;if(!re&&!ae)return ee;let ue=null,he=null;const ge=(E=b.isCharacterBox)!=null?E:this.isCharacterBox();let be=0;if(re){const vn=new Di({parent:y,mathstyle:"superscript"});ue=vl.createBox(vn,re),ge||(be=ee.height-y.metrics.supDrop*vn.scalingFactor)}let Be=0;if(ae){const vn=new Di({parent:y,mathstyle:"subscript"});he=vl.createBox(vn,ae),ge||(Be=ee.depth+y.metrics.subDrop*vn.scalingFactor)}let He;y.isDisplayStyle?He=y.metrics.sup1:y.isCramped?He=y.metrics.sup3:He=y.metrics.sup2;const lt=.5/ll/y.scalingFactor;let xt=null;if(he&&ue){be=Math.max(be,He,ue.depth+.25*y.metrics.xHeight),Be=Math.max(Be,y.metrics.sub2);const vn=y.metrics.defaultRuleThickness;if(be-ue.depth-(he.height-Be)<4*vn){Be=4*vn-(be-ue.depth)+he.height;const fn=.8*y.metrics.xHeight-(be-ue.depth);fn>0&&(be+=fn,Be-=fn)}const nr=this.isExtensibleSymbol&&ee.italic?-ee.italic:0;xt=new Yi({individualShift:[{box:he,shift:Be,marginLeft:nr},{box:ue,shift:-be}]}).wrap(y)}else he&&!ue?(Be=Math.max(Be,y.metrics.sub1,he.height-.8*hs),xt=new Yi({shift:Be,children:[{box:he,marginRight:lt,marginLeft:this.isCharacterBox()?-ee.italic:0}]})):!he&&ue&&(be=Math.max(be,He,ue.depth+.25*hs),xt=new Yi({shift:-be,children:[{box:ue,marginRight:lt}]}));return new ir([ee,new ir(xt,{caret:this.caret,isSelected:this.isSelected,classes:"msubsup"})],{type:b.type})}attachLimits(y,b){const E=this.superscript?vl.createBox(new Di({parent:y,mathstyle:"superscript"},this.style),this.superscript):null,ee=this.subscript?vl.createBox(new Di({parent:y,mathstyle:"subscript"},this.style),this.subscript):null;return!E&&!ee?b.base.wrap(y):tf(y,ke(Ce({},b),{above:E,below:ee}))}bind(y,b){if(!b||y.isPhantom||this.value==="\u200B")return b;let E=this.parent;for(;E&&!E.captureSelection;)E=E.parent;return E!=null&&E.captureSelection||(this.id||(this.id=y.makeID()),b.atomID=this.id),b}createBox(y,b){var E,ee,re,ae;const ue=(E=this.value)!=null?E:this.body,he=(ee=b==null?void 0:b.boxType)!=null?ee:Gu(this.type);let ge=(re=b==null?void 0:b.classes)!=null?re:"";this.mode==="text"&&(ge+=" ML__text");const be=typeof ue=="string"||ue===void 0?new ir(ue!=null?ue:null,{type:he,isSelected:this.isSelected,mode:this.mode,maxFontSize:y.scalingFactor,style:ke(Ce({variant:"normal"},this.style),{fontSize:Math.max(1,y.size+y.mathstyle.sizeDelta)}),letterShapeStyle:y.letterShapeStyle,classes:ge}):(ae=vl.createBox(y,ue,{type:he,classes:ge}))!=null?ae:new ir(null);return y.isTight&&(be.isTight=!0),(this.mode!=="math"||this.style.variant==="main")&&(be.italic=0),be.right=be.italic,this.bind(y,be),this.caret&&!this.superscript&&!this.subscript&&(be.caret=this.caret),be}isDigit(){var y;return this.type==="mord"&&this.value?/^[\d,\.]$/.test(this.value):this.type==="group"&&((y=this.body)==null?void 0:y.length)===2?this.body[0].type==="first"&&this.body[1].value===",":!1}asDigit(){var y;return this.type==="mord"&&this.value&&/^[\d,\.]$/.test(this.value)?this.value:this.type==="group"&&((y=this.body)==null?void 0:y.length)===2&&this.body[0].type==="first"&&this.body[1].value===","?".":""}};function lh(a){let y;const b=[];let E=[];for(const ee of a)if(!y&&!ee.style)E.push(ee);else{const re=ee.computedStyle;y&&re.color===y.color&&re.backgroundColor===y.backgroundColor&&re.fontSize===y.fontSize?E.push(ee):(E.length>0&&b.push(E),E=[ee],y=re)}return E.length>0&&b.push(E),b}function ch(a,y,b){var E,ee,re,ae,ue;if(!y||y.length===0)return null;const he=new Di({parent:a},b.style),ge=!((E=he.atomIdsSettings)!=null&&E.groupNumbers);let be=[];if(y.length===1){const He=y[0],lt=He.render(he);lt&&(ge&&He.isSelected&&lt.selected(!0),be=[lt])}else{let He="",lt=!0;for(const xt of y){(ee=he.atomIdsSettings)!=null&&ee.groupNumbers&&He&&(lt&&xt.isDigit()||!lt&&Qu(xt))&&(he.atomIdsSettings.overrideID=He);const vn=xt.render(he);he.atomIdsSettings&&(he.atomIdsSettings.overrideID=void 0),vn&&((re=he.atomIdsSettings)!=null&&re.groupNumbers&&((xt.isDigit()||Qu(xt))&&(!He||lt!==xt.isDigit())&&(lt=xt.isDigit(),He=(ae=xt.id)!=null?ae:""),He&&(!(xt.isDigit()||Qu(xt))||!xt.hasEmptyBranch("superscript")||!xt.hasEmptyBranch("subscript"))&&(He="")),ge&&xt.isSelected&&vn.selected(!0),be.push(vn))}}if(be.length===0)return null;const Be=new ir(be,ke(Ce({isTight:he.isTight},b),{type:(ue=b.type)!=null?ue:"lift"}));return Be.isSelected=be.every(He=>He.isSelected),Be.wrap(he)}function Qu(a){return a.mode==="text"}function ed(a){return a.map(y=>y===null?"<null>":Array.isArray(y)&&y[0]instanceof Dn?{atoms:y.map(b=>b.toJson())}:typeof y=="object"&&"group"in y?{group:y.group.map(b=>b.toJson())}:y)}var vs=class kp extends Dn{constructor(y,b,E){super({type:"text",command:y,mode:"text",displayContainsHighlight:!0}),this.value=b,this.verbatimLatex=b,this.applyStyle(E)}static fromJson(y){return new kp(y.command,y.value,y.style)}render(y){const b=this.createBox(y);return this.caret&&(b.caret=this.caret),b}_serialize(y){var b;return(b=this.verbatimLatex)!=null?b:Qt("text",this.value.codePointAt(0))}};function cc(a,y){if(a.direction===y.direction){const b=a.ranges.length;if(y.ranges.length===b){let E=0;for(;E<b&&rf(a.ranges[E],y.ranges[E])==="equal";)E++;return E===b?"equal":"different"}}return"different"}function rf(a,y){return a[0]===y[0]&&a[1]===y[1]?"equal":"different"}function Wa(a){let y=1/0,b=-1/0;for(const E of a.ranges)y=Math.min(y,E[0],E[1]),b=Math.max(b,E[0],E[1]);return[y,b]}function Bs(a){return typeof a=="number"&&!Number.isNaN(a)}function eu(a){return Array.isArray(a)&&a.length===2}function tu(a){return a!=null&&typeof a=="object"&&"ranges"in a&&Array.isArray(a.ranges)}function af(a,y){const b=a.at(y);let E;if(b){E=b.mode;let ee=b.parent;for(;!E&&ee;)ee&&(E=ee.mode),ee=ee.parent}return E}function uh(a,y){if(!y)return"";if(typeof y=="string")return y;if(!a||y.after===void 0)return y.value;let b=!1,E=!1,ee=!1,re=!1,ae=!1,ue=!1,he=!1,ge=!1,be=!1,Be=!1,He=!1,lt=!1,xt=!1,vn=!1,nr=!1,fn=a[0],Rn=0;for(;fn!=null&&fn.type&&/^(subsup|placeholder)$/.test(fn.type);)Rn+=1,fn=a[Rn];return b=!fn||fn.type==="first",fn&&(vn=fn.mode==="text",E=!vn&&fn.type==="mord"&&fe.test(fn.value),ee=!vn&&fn.type==="mord"&&/\d+$/.test(fn.value),re=!vn&&fn.isFunction,ae=fn.type==="genfrac",ue=fn.type==="surd",he=fn.type==="mbin",ge=fn.type==="mrel",be=fn.type==="mop"||fn.type==="operator"||fn.type==="extensible-symbol",Be=fn.type==="mpunct"||fn.type==="minner",He=fn.type==="array",lt=fn.type==="mopen",xt=fn.type==="mclose"||fn.type==="leftright",nr=fn.type==="space"),y.after.includes("nothing")&&b||y.after.includes("letter")&&E||y.after.includes("digit")&&ee||y.after.includes("function")&&re||y.after.includes("frac")&&ae||y.after.includes("surd")&&ue||y.after.includes("binop")&&he||y.after.includes("relop")&&ge||y.after.includes("operator")&&be||y.after.includes("punct")&&Be||y.after.includes("array")&&He||y.after.includes("openfence")&&lt||y.after.includes("closefence")&&xt||y.after.includes("text")&&vn||y.after.includes("space")&&nr?y.value:""}function td(a,y,b){return b?uh(a,b[y]):""}var dh={"&":"\\&","%":"\\%",$:"\\$","''":"^{\\doubleprime}","'''":"^{\\prime\\prime\\prime}","''''":"^{\\prime\\prime\\prime\\prime}",alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:"\\pi",Pi:"\\Pi",theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:"\\nabla",grad:"\\nabla",del:"\\partial",deg:{after:"digit+space",value:"\\degree"},infty:"\\infty","\u221E":"\\infty",oo:{after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"\u2211":"\\sum",sum:"\\sum_{#?}^{#?}",int:"\\int_{#?}^{#?}",prod:"\\prod_{#?}^{#?}",sqrt:"\\sqrt{#?}","\u2206":"\\differentialD","\u2202":"\\differentialD",arcsin:"\\arcsin",arccos:"\\arccos",arctan:"\\arctan",arcsec:"\\arcsec",arccsc:"\\arccsc",arsinh:"\\arsinh",arcosh:"\\arcosh",artanh:"\\artanh",arcsech:"\\arcsech",arccsch:"\\arccsch",arg:"\\arg",ch:"\\ch",cosec:"\\cosec",cosh:"\\cosh",cot:"\\cot",cotg:"\\cotg",coth:"\\coth",csc:"\\csc",ctg:"\\ctg",cth:"\\cth",sec:"\\sec",sinh:"\\sinh",sh:"\\sh",tanh:"\\tanh",tg:"\\tg",th:"\\th",sin:"\\sin",cos:"\\cos",tan:"\\tan",lg:"\\lg",lb:"\\lb",log:"\\log",ln:"\\ln",exp:"\\exp",lim:"\\lim_{#?}",dx:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD x"},dy:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD y"},dt:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD t"},AA:"\\forall",EE:"\\exists","!EE":"\\nexists","&&":"\\land",xin:{after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},sint:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\sin t"},in:{after:"nothing+letter+closefence",value:"\\in"},"!in":"\\notin",NN:"\\mathbb{N}",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",xx:"\\times","+-":"\\pm","\u2260":"\\ne","!=":"\\ne","\u2265":"\\ge",">=":"\\ge","\u2264":"\\le","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","\u2248":"\\approx","?=":"\\questeq","\xF7":"\\div","\xAC":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},nu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},\u00B5:"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega",\u03A9:"\\omega",forall:"\\forall",exists:"\\exists","!exists":"\\nexists",":.":"\\therefore",liminf:"\\liminf_{#?}",limsup:"\\limsup_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:"\\bmod{#?}","(mod":"\\pmod{#?}",max:"\\max",min:"\\min",erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:"\\operatorname{bessel}",mean:"\\operatorname{mean}",median:"\\operatorname{median}",fft:"\\operatorname{fft}",lcm:"\\operatorname{lcm}",gcd:"\\operatorname{gcd}",randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:"\\operatorname{Re}",Im:"\\operatorname{Im}",mm:{after:"nothing+digit+operator",value:"\\operatorname{mm}"},cm:{after:"nothing+digit+operator",value:"\\operatorname{cm}"},km:{after:"nothing+digit+operator",value:"\\operatorname{km}"},kg:{after:"nothing+digit+operator",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","-->...":"\\longrightarrow\\cdots","->":"\\to","|->":"\\mapsto","-->":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","*":"\\cdot","**":"\\star","***":"\\ast","//":"\\slash","\\\\":"\\backslash",setminus:"\\backslash","|><":"\\ltimes","><|":"\\rtimes","|><|":"\\bowtie","-:":"\\div",divide:"\\div","@":"\\circ","^^":"\\wedge","^^^":"\\bigwedge",vv:"\\vee",vvv:"\\bigvee",nn:"\\cap",nnn:"\\bigcap",uu:"\\cup",uuu:"\\bigcup","-=":"\\equiv","~=":"\\cong",lt:"<","lt=":"\\leq",gt:">","gt=":"\\geq","-<":"\\prec","-lt":"\\prec","-<=":"\\preceq",">-=":"\\succeq",prop:"\\propto",diamond:"\\diamond",square:"\\square",iff:"\\iff",sub:"\\subset",sup:"\\supset",sube:"\\subseteq",supe:"\\supseteq",uarr:"\\uparrow",darr:"\\downarrow",rarr:"\\rightarrow",rArr:"\\Rightarrow",larr:"\\leftarrow",lArr:"\\Leftarrow",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",aleph:"\\aleph",and:"\\land",or:"\\lor",not:"\\neg","_|_":"\\bot",TT:"\\top","|--":"\\vdash","|==":"\\models","|__":"\\lfloor","__|":"\\rfloor","|~":"\\lceil","~|":"\\rceil",">->":"\\rightarrowtail","->>":"\\twoheadrightarrow",">->>":"\\twoheadrightarrowtail",frac:"\\frac{#?}{#?}",cbrt:"\\sqrt[3]{#?}",nthroot:"\\sqrt[#?]{#?}"};function uc(a,y){var b;let E=(b=y==null?void 0:y.format)!=null?b:"auto";return E==="auto"&&([E,a]=fh(a)),E==="ascii-math"?(a=a.replace(/\u2061/gu,""),a=a.replace(/\u3016/gu,"{"),a=a.replace(/\u3017/gu,"}"),a=a.replace(/([^\\])sinx/g,"$1\\sin x"),a=a.replace(/([^\\])cosx/g,"$1\\cos x "),a=a.replace(/\u2013/g,"-"),["ascii-math",qa(a,{inlineShortcuts:y==null?void 0:y.inlineShortcuts})]):["latex",a]}function qa(a,y){var b,E,ee;if(!a)return"";let re=!1,ae;const ue=(b=y.inlineShortcuts)!=null?b:dh;if(!re&&(a.startsWith("^")||a.startsWith("_"))&&(ae=Os(a.slice(1),{inlineShortcuts:ue,noWrap:!0}),a=a[0]+"{"+ae.match+"}",a+=qa(ae.rest,y),re=!0),re||(ae=a.match(/^(sqrt|\u221A)(.*)/),ae&&(ae=Os(ae[2],{inlineShortcuts:ue,noWrap:!0}),a="\\sqrt{"+((E=ae.match)!=null?E:"\\placeholder{}")+"}",a+=qa(ae.rest,y),re=!0)),re||(ae=a.match(/^(\\cbrt|\u221B)(.*)/),ae&&(ae=Os(ae[2],{inlineShortcuts:ue,noWrap:!0}),a="\\sqrt[3]{"+((ee=ae.match)!=null?ee:"\\placeholder{}")+"}",a+=qa(ae.rest,y),re=!0)),re||(ae=a.match(/^abs(.*)/),ae&&(ae=Os(ae[1],{inlineShortcuts:ue,noWrap:!0}),a="\\left|"+ae.match+"\\right|",a+=qa(ae.rest,y),re=!0)),re||(ae=a.match(/^["”“](.*?)["”“](.*)/),ae&&(a="\\text{"+ae[1]+"}",a+=qa(ae[2],y),re=!0)),re||(ae=a.match(/^([^a-zA-Z\(\{\[\_\^\\\s"]+)(.*)/),ae&&(a=hh(ae[1],ue),a+=qa(ae[2],y),re=!0)),!re&&/^([fgh])[^a-zA-Z]/.test(a)&&(ae=Os(a.slice(1),{inlineShortcuts:ue,noWrap:!0}),a=a[1]==="("?a[0]+"\\left("+ae.match+"\\right)":a[0]+ae.match,a+=qa(ae.rest,y),re=!0),re||(ae=a.match(/^([a-zA-Z]+)(.*)/),ae&&(a=hh(ae[1],ue),a+=qa(ae[2],y),re=!0)),!re)if(ae=Os(a,{inlineShortcuts:ue,noWrap:!0}),ae.match&&ae.rest[0]==="/"){const he=Os(ae.rest.slice(1),{inlineShortcuts:ue,noWrap:!0});he.match&&(a="\\frac{"+ae.match+"}{"+he.match+"}"+qa(he.rest,y)),re=!0}else ae.match&&(a=a.startsWith("(")?"\\left("+ae.match+"\\right)"+qa(ae.rest,y):ae.match+qa(ae.rest,y),re=!0);return re||(ae=a.match(/^(\s+)(.*)$/),ae&&(a=" "+qa(ae[2],y),re=!0)),a}function Os(a,y){let b="";a=a.trim();let E=a,ee=a.charAt(0),re={"(":")","{":"}","[":"]"}[ee];if(re){let ae=1,ue=1;for(;ue<a.length&&ae>0;)a[ue]===ee&&ae++,a[ue]===re&&ae--,ue++;ae===0?(y.noWrap&&ee==="("?b=qa(a.substring(1,ue-1),y):(ee==="{"&&re==="}"&&(ee="\\{",re="\\}"),b="\\left"+ee+qa(a.substring(1,ue-1),y)+"\\right"+re),E=a.slice(Math.max(0,ue))):(b=a.substring(1,ue),E="")}else{let ae=a.match(/^([a-zA-Z]+)/);if(ae){let ue=td(null,a,y.inlineShortcuts);if(ue)return ue=ue.replace("_{#?}",""),ue=ue.replace("^{#?}",""),{match:ue,rest:a.slice(ue.length)}}if(ae=a.match(/^([a-zA-Z])/),ae)return{match:ae[1],rest:a.slice(1)};if(ae=a.match(/^(-)?\d+(\.\d*)?/),ae)return{match:ae[0],rest:a.slice(ae[0].length)};/^\\(left|right)/.test(a)||(ae=a.match(/^(\\[a-zA-Z]+)/),ae&&(E=a.slice(ae[1].length),b=ae[1]))}return{match:b,rest:E}}function hh(a,y){let b=td(null,a,y);return b?(b=b.replace("_{#?}",""),b=b.replace("^{#?}",""),b+=" "):b=a,b}var nd=[["\\[","\\]"],["\\(","\\)"],["$$","$$"],["$","$"],["\\begin{math}","\\end{math}"],["\\begin{displaymath}","\\end{displaymath}"],["\\begin{equation}","\\end{equation}"],["\\begin{equation*}","\\end{equation*}"]];function Rs(a){const y=a.trim();for(const b of nd)if(y.startsWith(b[0])&&y.endsWith(b[1]))return[!0,y.substring(b[0].length,y.length-b[1].length)];return[!1,a]}function fh(a){if(a=a.trim(),a.length<=1)return["latex",a];let y;return[y,a]=Rs(a),y?["latex",a]:a.startsWith("`")&&a.endsWith("`")?(a=a.substring(1,a.length-1),["ascii-math",a]):a.includes("\\")?["latex",a]:/\$.+\$/.test(a)?["latex",`\\text{${a}}`]:[void 0,a]}var nu="$$",of="$$",sf=(a,y,b)=>(nd.some(E=>y.startsWith(E[0])&&y.endsWith(E[1]))||(y=`${nu} ${y} ${of}`),y),ph=class Jh{constructor(y){Jh._modes[y]=this}static onPaste(y,b,E){var ee;if(!b.contentEditable&&b.userSelect==="none")return b.model.announce("plonk"),!1;if(typeof E=="string"){const ae=new DataTransfer;ae.setData("text/plain",E),E=ae}const re=new ClipboardEvent("paste",{clipboardData:E,cancelable:!0});return(ee=b.host)!=null&&ee.dispatchEvent(re)?Jh._modes[y].onPaste(b,E):!1}static copyToClipboard(y,b){if(!y.contentEditable&&y.userSelect==="none"){y.model.announce("plonk");return}const E=y.model,ee=E.selectionIsCollapsed?[0,E.lastOffset]:Wa(E.selection),re=E.getValue(ee,b);navigator.clipboard.writeText(re).then(()=>{},()=>y.model.announce("plonk"))}static onCopy(y,b){var E;if(!b.clipboardData)return;if(!y.contentEditable&&y.userSelect==="none"){y.model.announce("plonk");return}const ee=y.model,re=ee.selectionIsCollapsed?[0,ee.lastOffset]:Wa(ee.selection);let ae=ee.getAtoms(re);if(ae.every(ue=>ue.mode==="text"||!ue.mode))b.clipboardData.setData("text/plain",ae.filter(ue=>ue instanceof vs).map(ue=>ue.value).join(""));else if(ae.every(ue=>ue.mode==="latex"))b.clipboardData.setData("text/plain",ee.getAtoms(re,{includeChildren:!0}).map(ue=>{var he;return(he=ue.value)!=null?he:""}).join(""));else{let ue;ae.length===1&&ae[0].verbatimLatex!==void 0?ue=ae[0].verbatimLatex:ue=ee.getValue(re,"latex-expanded"),b.clipboardData.setData("application/x-latex",ue);try{b.clipboardData.setData("text/plain",y.options.onExport(y,ue,re))}catch(he){}if(ae.length===1){const he=ae[0];(he.type==="root"||he.type==="group")&&(ae=he.body.filter(ge=>ge.type!=="first"))}try{b.clipboardData.setData("application/json+mathlive",JSON.stringify(ae.map(he=>he.toJson())))}catch(he){}if((E=window[Symbol.for("io.cortexjs.compute-engine")])!=null&&E.ComputeEngine){const he=window.MathfieldElement.computeEngine;if(he)try{const ge=he.jsonSerializationOptions;he.jsonSerializationOptions={metadata:["latex"]};const be=he.parse(ee.getValue(re,"latex-unstyled"));he.jsonSerializationOptions=ge;const Be=JSON.stringify(be.json);Be&&b.clipboardData.setData("application/json",Be)}catch(ge){}}}b.preventDefault()}static insert(y,b,E={}){var ee;const re=E.mode==="auto"?y.mode:(ee=E.mode)!=null?ee:y.mode;return Jh._modes[re].insert(y,b,E)}onPaste(y,b){return!1}insert(y,b,E){return!1}};ph._modes={};var si=ph,lf=[{key:"left",command:"moveToPreviousChar"},{key:"right",command:"moveToNextChar"},{key:"up",command:"moveUp"},{key:"down",command:"moveDown"},{key:"shift+[ArrowLeft]",command:"extendSelectionBackward"},{key:"shift+[ArrowRight]",command:"extendSelectionForward"},{key:"shift+[ArrowUp]",command:"extendSelectionUpward"},{key:"shift+[ArrowDown]",command:"extendSelectionDownward"},{key:"[Backspace]",command:"deleteBackward"},{key:"alt+[Delete]",command:"deleteBackward"},{key:"[Delete]",command:"deleteForward"},{key:"alt+[Backspace]",command:"deleteForward"},{key:"alt+[ArrowLeft]",command:"moveToPreviousWord"},{key:"alt+[ArrowRight]",command:"moveToNextWord"},{key:"shift+alt+[ArrowLeft]",command:"extendToPreviousWord"},{key:"shift+alt+[ArrowRight]",command:"extendToNextWord"},{key:"ctrl+[ArrowLeft]",command:"moveToGroupStart"},{key:"ctrl+[ArrowRight]",command:"moveToGroupEnd"},{key:"shift+ctrl+[ArrowLeft]",command:"extendToGroupStart"},{key:"shift+ctrl+[ArrowRight]",command:"extendToGroupEnd"},{key:"[Home]",command:"moveToMathfieldStart"},{key:"cmd+[ArrowLeft]",command:"moveToMathfieldStart"},{key:"shift+[Home]",command:"extendToMathFieldStart"},{key:"shift+cmd+[ArrowLeft]",command:"extendToMathFieldStart"},{key:"[End]",command:"moveToMathfieldEnd"},{key:"cmd+[ArrowRight]",command:"moveToMathfieldEnd"},{key:"shift+[End]",command:"extendToMathFieldEnd"},{key:"shift+cmd+[ArrowRight]",command:"extendToMathFieldEnd"},{key:"[Pageup]",command:"moveToGroupStart"},{key:"[Pagedown]",command:"moveToGroupEnd"},{key:"[Tab]",command:"moveToNextGroup"},{key:"shift+[Tab]",command:"moveToPreviousGroup"},{key:"[Escape]",ifMode:"math",command:["switchMode","latex"]},{key:"[Escape]",ifMode:"text",command:["switchMode","latex"]},{key:"[Escape]",ifMode:"latex",command:["complete","complete",{selectItem:"true"}]},{key:"\\",ifMode:"math",command:["switchMode","latex","\\"]},{key:"[IntlBackslash]",ifMode:"math",command:["switchMode","latex","\\"]},{key:"[Tab]",ifMode:"latex",command:["complete","accept-suggestion"]},{key:"[Return]",ifMode:"latex",command:"complete"},{key:"[Enter]",ifMode:"latex",command:"complete"},{key:"shift+[Escape]",ifMode:"latex",command:["complete","reject"]},{key:"[ArrowDown]",ifMode:"latex",command:"nextSuggestion"},{key:"[ArrowUp]",ifMode:"latex",command:"previousSuggestion"},{key:"ctrl+a",ifPlatform:"!macos",command:"selectAll"},{key:"cmd+a",command:"selectAll"},{key:"[Cut]",command:"cutToClipboard"},{key:"[Copy]",command:"copyToClipboard"},{key:"[Paste]",command:"pasteFromClipboard"},{key:"[Clear]",command:"deleteBackward"},{key:"[Undo]",command:"undo"},{key:"[Redo]",command:"redo"},{key:"[EraseEof]",command:"deleteToGroupEnd"},{key:"ctrl+x",ifPlatform:"ios",command:"cutToClipboard"},{key:"cmd+x",ifPlatform:"ios",command:"cutToClipboard"},{key:"ctrl+c",ifPlatform:"ios",command:"copyToClipboard"},{key:"cmd+c",ifPlatform:"ios",command:"copyToClipboard"},{key:"ctrl+v",ifPlatform:"ios",command:"pasteFromClipboard"},{key:"cmd+v",ifPlatform:"ios",command:"pasteFromClipboard"},{key:"ctrl+z",ifPlatform:"!macos",command:"undo"},{key:"cmd+z",command:"undo"},{key:"ctrl+y",ifPlatform:"!macos",command:"redo"},{key:"shift+cmd+y",command:"redo"},{key:"shift+ctrl+z",ifPlatform:"!macos",command:"redo"},{key:"shift+cmd+z",command:"redo"},{key:"ctrl+b",ifPlatform:"macos",command:"moveToPreviousChar"},{key:"ctrl+f",ifPlatform:"macos",command:"moveToNextChar"},{key:"ctrl+p",ifPlatform:"macos",command:"moveUp"},{key:"ctrl+n",ifPlatform:"macos",command:"moveDown"},{key:"ctrl+a",ifPlatform:"macos",command:"moveToMathfieldStart"},{key:"ctrl+e",ifPlatform:"macos",command:"moveToMathfieldEnd"},{key:"shift+ctrl+b",ifPlatform:"macos",command:"extendSelectionBackward"},{key:"shift+ctrl+f",ifPlatform:"macos",command:"extendSelectionForward"},{key:"shift+ctrl+p",ifPlatform:"macos",command:"extendSelectionUpward"},{key:"shift+ctrl+n",ifPlatform:"macos",command:"extendSelectionDownward"},{key:"shift+ctrl+a",ifPlatform:"macos",command:"extendToMathFieldStart"},{key:"shift+ctrl+e",ifPlatform:"macos",command:"extendToMathFieldEnd"},{key:"alt+ctrl+b",ifPlatform:"macos",command:"moveToPreviousWord"},{key:"alt+ctrl+f",ifPlatform:"macos",command:"moveToNextWord"},{key:"shift+alt+ctrl+b",ifPlatform:"macos",command:"extendToPreviousWord"},{key:"shift+alt+ctrl+f",ifPlatform:"macos",command:"extendToNextWord"},{key:"ctrl+h",ifPlatform:"macos",command:"deleteBackward"},{key:"ctrl+d",ifPlatform:"macos",command:"deleteForward"},{key:"ctrl+l",ifPlatform:"macos",command:"scrollIntoView"},{key:"ctrl+[Digit2]",ifMode:"math",command:["insert","\\sqrt{#0}"]},{key:"ctrl+[Digit5]",ifMode:"math",command:"moveToOpposite"},{key:"ctrl+[Digit6]",ifMode:"math",command:"moveToSuperscript"},{key:"ctrl+[Return]",ifMode:"math",command:"addRowAfter"},{key:"ctrl+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Return]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"alt+p",ifMode:"math",command:["insert","\\pi"]},{key:"alt+v",ifMode:"math",command:["insert","\\sqrt{#0}"]},{key:"alt+o",ifMode:"math",command:["insert","\\emptyset"]},{key:"alt+d",ifMode:"math",command:["insert","\\differentialD"]},{key:"shift+alt+o",ifMode:"math",command:["insert","\\varnothing"]},{key:"shift+alt+d",ifMode:"math",command:["insert","\\partial"]},{key:"alt+[Backslash]",ifMode:"math",command:["insert","\\backslash"]},{key:"[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#@}{#?}"]},{key:"alt+[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#?}{#@}"]},{key:"shift+alt+k",command:"toggleKeystrokeCaption"},{key:"alt+[Space]",command:"toggleContextMenu"},{key:"alt+shift+[Space]",command:"toggleVirtualKeyboard"},{key:"alt+ctrl+[ArrowUp]",command:["speak","all",{withHighlighting:!1}]},{key:"alt+ctrl+[ArrowDown]",command:["speak","selection",{withHighlighting:!1}]},{key:"shift+[Quote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["switchMode","text","",""]},{key:"shift+alt+[KeyT]",ifMode:"math",command:["switchMode","text","",""]},{key:"shift+[Quote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"text",command:["switchMode","math","",""]},{key:"shift+alt+[KeyT]",ifMode:"text",command:["switchMode","math","",""]},{key:"/",ifMode:"math",command:["insert","\\frac{#@}{#?}"]},{key:"alt+/",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","/"]},{key:"alt+shift+/",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","/"]},{key:"alt+[BracketLeft]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\left\\lbrack #0 \\right\\rbrack"]},{key:"ctrl+[Minus]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"moveToSubscript"},{key:"shift+alt+[BracketLeft]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\left\\lbrace #0 \\right\\rbrace"]},{key:"ctrl+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowAfter"},{key:"cmd+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowAfter"},{key:"shift+ctrl+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowBefore"},{key:"shift+cmd+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowBefore"},{key:"ctrl+[Backspace]",ifMode:"math",command:"removeRow"},{key:"cmd+[Backspace]",ifMode:"math",command:"removeRow"},{key:"alt+[Tab]",ifMode:"math",command:"addColumnAfter"},{key:"shift+alt+[Tab]",ifMode:"math",command:"addColumnBefore"},{key:"alt+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"shift+alt+[Enter]",ifMode:"math",command:"addRowBefore"},{key:"alt+[Return]",ifMode:"math",command:"addRowAfter"},{key:"shift+alt+[Return]",ifMode:"math",command:"addRowBefore"},{key:"shift+[Backspace]",ifMode:"math",command:"removeColumn"},{key:"alt+[Digit5]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","$\\infty"]},{key:"alt+[Digit9]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","("]},{key:"alt+[Digit0]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert",")"]},{key:"alt+|",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","|"]},{key:"shift+[Backquote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\~"]},{key:"[Backquote]",ifLayout:["windows.french","linux.french"],ifMode:"math",command:["insert","^2"]},{key:"[Backquote]",ifLayout:["windows.german","linux.german"],ifMode:"math",command:["insert","^"]},{key:"[IntlBackslash]",ifLayout:["apple.german"],ifMode:"math",command:["insert","^"]}],rd={"\\sqrt":["alt+v","ctrl+[Digit2]"],"\\pi":"alt+p","\\infty":"alt+[Digit5]","\\differentialD":"alt+d","\\partial":"shift+alt+d","\\frac":"Slash","\\emptyset":"alt+o","\\varnothing":"shift+alt+o","\\~":"~"};function Fo(a){var y;return((y=a.element)==null?void 0:y.mathfield)===a}function zo(a){var y,b;return(b=(y=a.querySelector(".ML__caret"))!=null?y:a.querySelector(".ML__text-caret"))!=null?b:a.querySelector(".ML__latex-caret")}function Ns(a){const y=zo(a);if(!y)return null;const b=y.getBoundingClientRect();return{x:b.right,y:b.bottom,height:b.height}}function id(a){var y;if(!a.parent)return"root";let b=(y=a.parent.id)!=null?y:"";return b+=typeof a.parentBranch=="string"?"-"+a.parentBranch:`-${a.parentBranch[0]}/${a.parentBranch[0]}`,b}function ad(a,y,b){if(!y)return null;const E=a.field.getBoundingClientRect(),ee=y.right-y.left,re=y.bottom-y.top,ae=Math.ceil(y.left-E.left+a.field.scrollLeft*b),ue=Math.ceil(y.top-E.top);return{left:ae,right:ae+ee,top:ue,bottom:ue+re}}function od(a){const y=a.getBoundingClientRect(),b=parseInt(getComputedStyle(a).marginRight),E={top:y.top-1,bottom:y.bottom,left:y.left,right:y.right-1+b};if(a.children.length===0||a.tagName.toUpperCase()==="SVG")return E;for(const ee of a.children)if(ee.nodeType===1&&"atomId"in ee.dataset&&!ee.classList.contains("pstrut")){const re=od(ee);E.left=Math.min(E.left,re.left),E.right=Math.max(E.right,re.right),E.top=Math.min(E.top,re.top),E.bottom=Math.max(E.bottom,re.bottom)}return E}function Pl(a,y){var b,E;if(!y.id)return null;let ee=(E=(b=a.atomBoundsCache)==null?void 0:b.get(y.id))!=null?E:null;if(ee!==null)return ee;const re=a.field.querySelector(`[data-atom-id="${y.id}"]`);return ee=re?od(re):null,a.atomBoundsCache&&(ee?a.atomBoundsCache.set(y.id,ee):a.atomBoundsCache.delete(y.id)),ee!=null?ee:null}function mh(a,y,b){const E=new Map;for(const ee of a.model.getAtoms(y,{includeChildren:!0})){if(b!=null&&b.excludeAtomsWithBackground&&ee.style.backgroundColor)continue;const re=a.field,ae=re.offsetWidth;let he=Math.floor(re.getBoundingClientRect().width)/ae;he=isNaN(he)?1:he;const ge=ad(a,Pl(a,ee),he);if(ge){const be=id(ee);if(E.has(be)){const Be=E.get(be);E.set(be,{left:Math.min(Be.left,ge.left),right:Math.max(Be.right,ge.right),top:Math.min(Be.top,ge.top),bottom:Math.max(Be.bottom,ge.bottom)})}else E.set(be,ge)}}return[...E.values()]}function sd(a,y){return a.model.selection.ranges.reduce((b,E)=>b.concat(...mh(a,E,y)),[])}function ld(a,y){return a==="*"||y==="none"?!0:y==="same-origin"?!window.origin||a===window.origin:typeof y=="function"?y(a):!1}function ru(a){let y=0,b=0;const E=a.offsetWidth,ee=a.offsetHeight;for(;a instanceof HTMLElement;)y+=a.offsetTop,b+=a.offsetLeft,a=a.offsetParent;return new DOMRect(b,y,E,ee)}var gh=`@keyframes ML__caret-blink {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0;
}
}
.ML__container {
display: inline-flex;
flex-flow: row;
justify-content: space-between;
align-items: flex-end;
min-height: 39px;
/* Need some room for the virtual keyboard toggle */
width: 100%;
/* Encourage browsers to consider allocating a hardware accelerated
layer for this element. */
isolation: isolate;
/* Prevent the browser from trying to interpret touch gestures in the field */
/* "Disabling double-tap to zoom removes the need for browsers to
delay the generation of click events when the user taps the screen." */
touch-action: none;
--_caret-color: var(--caret-color, hsl(var(--_hue), 40%, 49%));
--_selection-color: var(--selection-color, #000);
--_selection-background-color: var(--selection-background-color, hsl(var(--_hue), 70%, 85%));
--_text-highlight-background-color: var(--highlight-text, hsla(var(--_hue), 40%, 50%, 0.1));
--_contains-highlight-background-color: var(--contains-highlight-background-color, hsl(var(--_hue), 40%, 95%));
--_smart-fence-color: var(--smart-fence-color, currentColor);
--_smart-fence-opacity: var(--smart-fence-opacity, 0.5);
--_latex-color: var(--latex-color, hsl(var(--_hue), 80%, 40%));
--_correct-color: var(--correct-color, #10a000);
--_incorrect-color: var(--incorrect-color, #a01b00);
--_composition-background-color: var(--composition-background-color, #fff1c2);
--_composition-text-color: var(--composition-text-color, black);
--_composition-underline-color: var(--composition-underline-color, transparent);
}
/* This is the actual field content (formula) */
.ML__content {
display: flex;
align-items: center;
align-self: center;
position: relative;
overflow: hidden;
padding: 2px 3px 2px 1px;
width: 100%;
}
.ML__virtual-keyboard-toggle,
.ML__menu-toggle {
box-sizing: border-box;
display: flex;
align-self: center;
align-items: center;
flex-shrink: 0;
flex-direction: column;
justify-content: center;
width: 34px;
height: 34px;
padding: 0;
margin-right: 4px;
cursor: pointer;
/* Avoid some weird blinking with :hover */
border-radius: 8px;
border: 1px solid transparent;
transition: background 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
color: hsl(var(--_hue), 40%, 50%);
fill: currentColor;
background: transparent;
}
.ML__virtual-keyboard-toggle:hover,
.ML__menu-toggle:hover {
background: hsla(0, 0%, 70%, 0.3);
color: #333;
fill: currentColor;
}
.ML__virtual-keyboard-toggle > span,
.ML__menu-toggle > span {
display: flex;
align-self: center;
align-items: center;
}
/* The invisible element used to capture keyboard events. We're just trying
really hard to make sure it doesn't show. */
.ML__keyboard-sink {
display: inline-block;
resize: none;
outline: none;
border: none;
/* Need these for Microsoft Edge */
position: fixed;
clip: rect(0 0 0 0);
/* Need this to prevent iOS Safari from auto-zooming */
font-size: 1em;
font-family: KaTeX_Main;
line-height: 0.5;
/* On Chromium, if this is 0, no keyboard events are received */
}
[part="placeholder"] {
color: var(--neutral-400);
}
.ML__composition {
background: var(--_composition-background-color);
color: var(--_composition-text-color);
text-decoration: underline var(--_composition-underline-color);
}
.ML__caret::after {
content: '';
visibility: hidden;
width: 0;
display: inline-block;
height: 0.76em;
--_caret-width: clamp(2px, 0.08em, 10px);
border: none;
border-radius: calc(var(--_caret-width) / 2);
border-right: var(--_caret-width) solid var(--_caret-color);
margin-right: calc(-1 * var(--_caret-width));
position: relative;
left: -0.045em;
bottom: -0.05em;
animation: ML__caret-blink 1.05s step-end forwards infinite;
}
.ML__text-caret::after {
content: '';
visibility: hidden;
width: 0;
display: inline-block;
height: 0.76em;
--_caret-width: clamp(2px, 0.08em, 10px);
border: none;
border-radius: calc(var(--_caret-width) / 2);
border-right: var(--_caret-width) solid var(--_caret-color);
margin-right: calc(-1 * var(--_caret-width));
position: relative;
left: -0.045em;
bottom: -0.05em;
animation: ML__caret-blink 1.05s step-end forwards infinite;
}
.ML__latex-caret::after {
content: '';
visibility: hidden;
--_caret-width: clamp(2px, 0.08em, 10px);
border: none;
border-radius: calc(var(--_caret-width) / 2);
border-right: var(--_caret-width) solid var(--_latex-color);
margin-right: calc(-1 * var(--_caret-width));
position: relative;
left: -0.019em;
animation: ML__caret-blink 1.05s step-end forwards infinite;
}
.ML__focused .ML__latex-caret::after,
.ML__focused .ML__text-caret::after,
.ML__focused .ML__caret::after {
visibility: visible;
}
.ML__focused .ML__text {
background: var(--_text-highlight-background-color);
}
/* When using smartFence, the anticipated closing fence is displayed
with this style */
.ML__smart-fence__close {
opacity: var(--_smart-fence-opacity);
color: var(--_smart-fence-color);
}
.ML__selected,
.ML__focused .ML__selected .ML__contains-caret,
.ML__focused .ML__selected .ML__smart-fence__close,
.ML__focused .ML__selected .ML__placeholder {
color: var(--_selection-color);
opacity: 1;
}
.ML__selection {
box-sizing: border-box;
background: var(--_selection-background-color) !important;
}
.ML__contains-caret.ML__close,
.ML__contains-caret.ML__open,
.ML__contains-caret > .ML__close,
.ML__contains-caret > .ML__open,
.ML__contains-caret .ML__sqrt-sign,
.ML__contains-caret .ML__sqrt-line {
color: var(--_caret-color);
}
.ML__contains-highlight {
box-sizing: border-box;
background: transparent;
}
.ML__focused .ML__contains-highlight {
background: var(--_contains-highlight-background-color);
}
.ML__raw-latex {
font-family: 'Berkeley Mono', 'IBM Plex Mono', 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;
font-weight: 400;
font-size: 0.8em;
letter-spacing: -0.05em;
color: var(--_latex-color);
}
.ML__suggestion {
color: var(--neutral-500);
}
.ML__virtual-keyboard-toggle.is-visible.is-pressed:hover {
background: hsl(var(--_hue), 25%, 35%);
color: #fafafa;
fill: currentColor;
}
.ML__virtual-keyboard-toggle:focus {
outline: none;
border-radius: 8px;
border: 2px solid hsl(var(--_hue), 40%, 50%);
}
.ML__virtual-keyboard-toggle.is-pressed,
.ML__virtual-keyboard-toggle.is-active:hover,
.ML__virtual-keyboard-toggle.is-active {
background: hsl(var(--_hue), 25%, 35%);
color: #fafafa;
fill: currentColor;
}
/* Add an attribute 'data-tooltip' to automatically show a
tooltip over a element on hover.
*/
[data-tooltip] {
position: relative;
}
[data-tooltip]::after {
content: attr(data-tooltip);
position: absolute;
display: block;
z-index: 2;
pointer-events: none;
right: auto;
top: calc(-100% - 4px);
width: max-content;
max-width: 200px;
padding: 8px 8px;
border-radius: 4px;
background: #616161;
color: #fff;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
text-align: center;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-style: normal;
font-weight: 400;
font-size: 13px;
/* Phone */
opacity: 0;
transform: scale(0.5);
}
@media only screen and (max-width: 767px) {
[data-tooltip]::after {
padding: 8px 16px;
font-size: 16px;
}
}
menu [data-tooltip]::after {
left: 100%;
top: 0%;
}
menu .ML__base {
cursor: default;
}
/** Don't display if we're tracking, i.e. have the pointer down */
.tracking [data-tooltip]:hover::after {
/* Use visibility, not display. Display will remove the after from the DOM, and the override below will not work */
visibility: hidden;
}
/** But do display if tracking and inside a menu */
.tracking menu li[data-tooltip]:hover::after,
[data-tooltip]:hover::after {
visibility: visible;
opacity: 1;
transform: scale(1);
transition-property: opacity, scale;
transition-duration: 0.15s;
transition-delay: 1s;
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}
.ML__prompt {
border-radius: 2px;
}
.ML__editablePromptBox {
outline: 1px solid #acacac;
border-radius: 2px;
z-index: -1;
}
.ML__focusedPromptBox {
outline: highlight auto 1px;
}
.ML__lockedPromptBox {
background-color: rgba(142, 142, 141, 0.4);
z-index: -1;
}
.ML__correctPromptBox {
outline: 1px solid var(--_correct-color);
box-shadow: 0 0 5px var(--_correct-color);
}
.ML__incorrectPromptBox {
outline: 1px solid var(--_incorrect-color);
box-shadow: 0 0 5px var(--_incorrect-color);
}
.variant-submenu {
display: flex;
flex-direction: column;
padding: 8px;
}
.variant-submenu [part=menu-item] {
font-size: 2rem;
text-align: center;
margin: 0;
}
.insert-matrix-submenu {
display: grid;
padding: 8px;
align-content: center;
justify-content: center;
grid-template-columns: repeat(5, minmax(0, 1fr));
}
.insert-matrix-submenu [part=menu-item] {
font-size: 21px;
border: none;
border-radius: 0;
line-height: 21px;
text-align: center;
padding: 0;
margin: 0;
}
.border-submenu [part=menu-item] {
font-size: 2rem;
line-height: 1.2;
text-align: center;
}
.swatches-submenu {
--_swatch-size: 2rem;
--_columns: 4;
display: flex;
flex-flow: wrap;
padding: 8px;
max-width: calc(var(--_columns) * (var(--_swatch-size) + 18px) + 16px);
box-sizing: border-box;
}
.menu-swatch {
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: fit-content;
height: fit-content;
margin: 2px;
padding: 0;
background: var(--neutral-200);
}
.menu-swatch > .label {
padding: 0;
margin: 0;
line-height: 0;
}
.menu-swatch > .label > span {
display: inline-block;
margin: 6px;
min-width: var(--_swatch-size);
min-height: var(--_swatch-size);
border-radius: 50%;
}
.menu-swatch.active {
background: var(--neutral-100);
scale: 1.4;
}
.menu-swatch.active > .label > span {
border-radius: 2px;
}
.menu-swatch .ui-checkmark,
.menu-swatch .ui-mixedmark {
position: absolute;
margin: 0;
padding: 0;
color: white;
}
.menu-swatch.dark-contrast .ui-checkmark,
.menu-swatch.dark-contrast .ui-mixedmark {
color: #000;
}
`,Vi=`.ML__container {
min-height: auto !important;
--_hue: var(--hue, 212);
--_placeholder-color: var(--placeholder-color, hsl(var(--_hue), 40%, 49%));
--_placeholder-opacity: var(--placeholder-opacity, 0.4);
--_text-font-family: var(--text-font-family, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif);
}
.ML__sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
clip-path: inset(50%);
white-space: nowrap;
border: 0;
}
.ML__is-inline {
display: inline-block;
}
.ML__base {
visibility: inherit;
display: inline-block;
position: relative;
cursor: text;
padding: 0;
margin: 0;
box-sizing: content-box;
border: 0;
outline: 0;
vertical-align: baseline;
font-weight: inherit;
font-family: inherit;
font-style: inherit;
text-decoration: none;
width: min-content;
}
.ML__strut,
.ML__strut--bottom {
display: inline-block;
min-height: 0.5em;
}
.ML__small-delim {
font-family: KaTeX_Main;
}
/* Text mode */
.ML__text {
font-family: var(--_text-font-family);
white-space: pre;
}
/* Use cmr for 'math upright' */
.ML__cmr {
font-family: KaTeX_Main;
font-style: normal;
}
.ML__mathit {
font-family: KaTeX_Math;
/* The KaTeX_Math font is italic by default, so the font-style below is only
useful when a fallback font is used
*/
font-style: italic;
}
.ML__mathbf {
font-family: KaTeX_Main;
font-weight: bold;
}
/* Lowercase greek symbols should stick to math font when \\mathbf is applied
to match TeX idiosyncratic behavior */
.lcGreek.ML__mathbf {
font-family: KaTeX_Math;
font-weight: normal;
}
.ML__mathbfit {
font-family: KaTeX_Math;
font-weight: bold;
font-style: italic;
}
.ML__ams {
font-family: KaTeX_AMS;
}
/* Blackboard */
.ML__bb {
font-family: KaTeX_AMS;
}
.ML__cal {
font-family: KaTeX_Caligraphic;
}
.ML__frak {
font-family: KaTeX_Fraktur;
}
.ML__tt {
font-family: KaTeX_Typewriter;
}
.ML__script {
font-family: KaTeX_Script;
}
.ML__sans {
font-family: KaTeX_SansSerif;
}
.ML__series_ul {
font-weight: 100;
}
.ML__series_el {
font-weight: 100;
}
.ML__series_l {
font-weight: 200;
}
.ML__series_sl {
font-weight: 300;
}
.ML__series_sb {
font-weight: 500;
}
.ML__bold,
.ML__boldsymbol {
font-weight: 700;
}
.ML__series_eb {
font-weight: 800;
}
.ML__series_ub {
font-weight: 900;
}
.ML__series_uc {
font-stretch: ultra-condensed;
}
.ML__series_ec {
font-stretch: extra-condensed;
}
.ML__series_c {
font-stretch: condensed;
}
.ML__series_sc {
font-stretch: semi-condensed;
}
.ML__series_sx {
font-stretch: semi-expanded;
}
.ML__series_x {
font-stretch: expanded;
}
.ML__series_ex {
font-stretch: extra-expanded;
}
.ML__series_ux {
font-stretch: ultra-expanded;
}
.ML__it {
font-style: italic;
}
.ML__shape_ol {
-webkit-text-stroke: 1px black;
text-stroke: 1px black;
color: transparent;
}
.ML__shape_sc {
font-variant: small-caps;
}
.ML__shape_sl {
font-style: oblique;
}
/* First level emphasis */
.ML__emph {
color: #bc2612;
}
/* Second level emphasis */
.ML__emph .ML__emph {
color: #0c7f99;
}
.ML__highlight {
color: #007cb2;
background: #edd1b0;
}
.ML__center {
text-align: center;
}
.ML__label_padding {
padding: 0 0.5em;
}
.ML__frac-line {
width: 100%;
min-height: 1px;
}
.ML__frac-line:after {
content: '';
display: block;
margin-top: max(-1px, -0.04em);
min-height: max(1px, 0.04em);
/* Ensure the line is visible when printing even if "turn off background images" is on*/
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
/* There's a bug since Chrome 62 where
sub-pixel border lines don't draw at some zoom
levels (110%, 90%).
Setting the min-height used to work around it, but that workaround
broke in Chrome 84 or so.
Setting the background (and the min-height) seems to work for now.
*/
background: currentColor;
box-sizing: content-box;
/* Vuetify sets the box-sizing to inherit
causes the fraction line to not draw at all sizes (see #26) */
/* On some versions of Firefox on Windows, the line fails to
draw at some zoom levels, but setting the transform triggers
the hardware accelerated path, which works */
transform: translate(0, 0);
}
.ML__sqrt {
display: inline-block;
}
.ML__sqrt-sign {
display: inline-block;
position: relative;
}
.ML__sqrt-line {
display: inline-block;
height: max(1px, 0.04em);
width: 100%;
}
.ML__sqrt-line:before {
content: '';
display: block;
margin-top: min(-1px, -0.04em);
min-height: max(1px, 0.04em);
/* Ensure the line is visible when printing even if "turn off background images" is on*/
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
background: currentColor;
/* On some versions of Firefox on Windows, the line fails to
draw at some zoom levels, but setting the transform triggers
the hardware accelerated path, which works */
transform: translate(0, 0);
}
.ML__sqrt-line:after {
border-bottom-width: 1px;
content: ' ';
display: block;
margin-top: -0.1em;
}
.ML__sqrt-index {
margin-left: 0.27777778em;
margin-right: -0.55555556em;
}
.ML__delim-size1 {
font-family: KaTeX_Size1;
}
.ML__delim-size2 {
font-family: KaTeX_Size2;
}
.ML__delim-size3 {
font-family: KaTeX_Size3;
}
.ML__delim-size4 {
font-family: KaTeX_Size4;
}
.ML__delim-mult .delim-size1 > span {
font-family: KaTeX_Size1;
}
.ML__delim-mult .delim-size4 > span {
font-family: KaTeX_Size4;
}
.ML__accent-body > span {
font-family: KaTeX_Main;
width: 0;
}
.ML__accent-vec {
position: relative;
left: 0.24em;
}
/** The markup for a LaTeX formula, either in an editable mathfield or
in a static display.
*/
.ML__latex {
display: inline-block;
direction: ltr;
text-align: left;
text-indent: 0;
text-rendering: auto;
font-family: KaTeX_Main, 'Times New Roman', serif;
font-style: normal;
font-size-adjust: none;
font-stretch: normal;
font-variant-caps: normal;
letter-spacing: normal;
line-height: 1.2;
word-wrap: normal;
word-spacing: normal;
white-space: nowrap;
text-shadow: none;
-webkit-user-select: none;
user-select: none;
width: min-content;
}
.ML__latex .style-wrap {
position: relative;
}
.ML__latex .mfrac {
display: inline-block;
}
.ML__latex .left-right {
display: inline-block;
}
.ML__latex .vlist-t {
display: inline-table;
table-layout: fixed;
border-collapse: collapse;
}
.ML__latex .vlist-r {
display: table-row;
}
.ML__latex .vlist {
display: table-cell;
vertical-align: bottom;
position: relative;
}
.ML__latex .vlist > span {
display: block;
height: 0;
position: relative;
}
.ML__latex .vlist > span > span {
display: inline-block;
}
.ML__latex .vlist > span > .pstrut {
overflow: hidden;
width: 0;
}
.ML__latex .vlist-t2 {
margin-right: -2px;
}
.ML__latex .vlist-s {
display: table-cell;
vertical-align: bottom;
font-size: 1px;
width: 2px;
min-width: 2px;
}
.ML__latex .msubsup {
text-align: left;
}
.ML__latex .negativethinspace {
display: inline-block;
margin-left: -0.16667em;
height: 0.71em;
}
.ML__latex .thinspace {
display: inline-block;
width: 0.16667em;
height: 0.71em;
}
.ML__latex .mediumspace {
display: inline-block;
width: 0.22222em;
height: 0.71em;
}
.ML__latex .thickspace {
display: inline-block;
width: 0.27778em;
height: 0.71em;
}
.ML__latex .enspace {
display: inline-block;
width: 0.5em;
height: 0.71em;
}
.ML__latex .quad {
display: inline-block;
width: 1em;
height: 0.71em;
}
.ML__latex .qquad {
display: inline-block;
width: 2em;
height: 0.71em;
}
.ML__latex .llap,
.ML__latex .rlap {
width: 0;
position: relative;
display: inline-block;
}
.ML__latex .llap > .inner,
.ML__latex .rlap > .inner {
position: absolute;
}
.ML__latex .llap > .fix,
.ML__latex .rlap > .fix {
display: inline-block;
}
.ML__latex .llap > .inner {
right: 0;
}
.ML__latex .rlap > .inner {
left: 0;
}
.ML__latex .rule {
display: inline-block;
border: solid 0;
position: relative;
box-sizing: border-box;
}
.ML__latex .overline .overline-line,
.ML__latex .underline .underline-line {
width: 100%;
}
.ML__latex .overline .overline-line:before,
.ML__latex .underline .underline-line:before {
content: '';
border-bottom-style: solid;
border-bottom-width: max(1px, 0.04em);
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
display: block;
}
.ML__latex .overline .overline-line:after,
.ML__latex .underline .underline-line:after {
border-bottom-style: solid;
border-bottom-width: max(1px, 0.04em);
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
content: '';
display: block;
margin-top: -1px;
}
.ML__latex .stretchy {
display: block;
position: absolute;
width: 100%;
left: 0;
overflow: hidden;
}
.ML__latex .stretchy:before,
.ML__latex .stretchy:after {
content: '';
}
.ML__latex .stretchy svg {
display: block;
position: absolute;
width: 100%;
height: inherit;
fill: currentColor;
stroke: currentColor;
fill-rule: nonzero;
fill-opacity: 1;
stroke-width: 1;
stroke-linecap: butt;
stroke-linejoin: miter;
stroke-miterlimit: 4;
stroke-dasharray: none;
stroke-dashoffset: 0;
stroke-opacity: 1;
}
.ML__latex .slice-1-of-2 {
display: inline-flex;
position: absolute;
left: 0;
width: 50.2%;
overflow: hidden;
}
.ML__latex .slice-2-of-2 {
display: inline-flex;
position: absolute;
right: 0;
width: 50.2%;
overflow: hidden;
}
.ML__latex .slice-1-of-3 {
display: inline-flex;
position: absolute;
left: 0;
width: 25.1%;
overflow: hidden;
}
.ML__latex .slice-2-of-3 {
display: inline-flex;
position: absolute;
left: 25%;
width: 50%;
overflow: hidden;
}
.ML__latex .slice-3-of-3 {
display: inline-flex;
position: absolute;
right: 0;
width: 25.1%;
overflow: hidden;
}
.ML__latex .slice-1-of-1 {
display: inline-flex;
position: absolute;
width: 100%;
left: 0;
overflow: hidden;
}
.ML__latex .nulldelimiter {
display: inline-block;
}
.ML__latex .op-group {
display: inline-block;
}
.ML__latex .op-symbol {
position: relative;
}
.ML__latex .op-symbol.small-op {
font-family: KaTeX_Size1;
}
.ML__latex .op-symbol.large-op {
font-family: KaTeX_Size2;
}
.ML__latex .mtable .vertical-separator {
display: inline-block;
min-width: 1px;
box-sizing: border-box;
}
.ML__latex .mtable .arraycolsep {
display: inline-block;
}
.ML__latex .mtable .col-align-m > .vlist-t {
text-align: center;
}
.ML__latex .mtable .col-align-c > .vlist-t {
text-align: center;
}
.ML__latex .mtable .col-align-l > .vlist-t {
text-align: left;
}
.ML__latex .mtable .col-align-r > .vlist-t {
text-align: right;
}
.ML__error {
display: inline-block;
background-image: radial-gradient(ellipse at center, hsl(341, 100%, 40%), rgba(0, 0, 0, 0) 70%);
background-color: hsla(341, 100%, 40%, 0.1);
background-repeat: repeat-x;
background-size: 3px 3px;
padding-bottom: 3px;
background-position: 0 100%;
}
.ML__error > .ML__error {
background: transparent;
padding: 0;
}
.ML__placeholder {
color: var(--_placeholder-color);
opacity: var(--_placeholder-opacity);
padding-left: 0.4ex;
padding-right: 0.4ex;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}
.ML__notation {
position: absolute;
box-sizing: border-box;
line-height: 0;
}
/* This class is used to implement the \`\\mathtip\` and \`\\texttip\` commands
For UI elements, see \`[data-ML__tooltip]\`
*/
.ML__tooltip-container {
position: relative;
transform: scale(0);
}
.ML__tooltip-container .ML__tooltip-content {
position: fixed;
display: inline-table;
visibility: hidden;
z-index: 2;
width: max-content;
max-width: 400px;
padding: 12px 12px;
border-radius: 8px;
background: #616161;
--_selection-color: #fff;
color: #fff;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
opacity: 0;
transition: opacity 0.15s cubic-bezier(0.4, 0, 1, 1);
}
.ML__tooltip-container .ML__tooltip-content .ML__text {
white-space: normal;
}
.ML__tooltip-container .ML__tooltip-content .ML__base {
display: contents;
}
.ML__tooltip-container:hover .ML__tooltip-content {
visibility: visible;
opacity: 1;
font-size: 0.75em;
transform: scale(1) translate(0, 3em);
}
`,vh=`#mathlive-environment-popover.is-visible {
visibility: visible;
}
#mathlive-environment-popover {
--_environment-panel-height: var(--environment-panel-height, 70px);
--_accent-color: var(--accent-color, #aaa);
--_background: var(--environment-panel-background, #fff);
--_button-background: var(--environment-panel-button-background, white);
--_button-background-hover: var(--environment-panel-button-background-hover, #f5f5f7);
--_button-background-active: var(--environment-panel-button-background-active, #f5f5f7);
--_button-text: var(--environment-panel-button-text, #e3e4e8);
position: absolute;
width: calc(var(--_environment-panel-height) * 2);
height: var(--_environment-panel-height);
border-radius: 4px;
border: 1.5px solid var(--_accent-color);
background-color: var(--_background);
box-shadow: 0 0 30px 0 var(--environment-shadow, rgba(0, 0, 0, 0.4));
pointer-events: all;
visibility: hidden;
}
#mathlive-environment-popover .MLEP__array-buttons {
height: calc(var(--_environment-panel-height) * 5/4);
width: calc(var(--_environment-panel-height) * 5/4);
margin-left: calc(0px - var(--_environment-panel-height) * 0.16);
margin-top: calc(0px - var(--_environment-panel-height) * 0.19);
}
#mathlive-environment-popover .MLEP__array-buttons .font {
fill: white;
}
#mathlive-environment-popover .MLEP__array-buttons circle {
fill: #7f7f7f;
transition: fill 300ms;
}
#mathlive-environment-popover .MLEP__array-buttons .MLEP__array-insert-background {
fill-opacity: 1;
fill: var(--_background);
stroke: var(--_accent-color);
stroke-width: 3px;
}
#mathlive-environment-popover .MLEP__array-buttons line {
stroke: var(--_accent-color);
stroke-opacity: 0;
stroke-width: 40;
pointer-events: none;
transition: stroke-opacity 300ms;
stroke-linecap: round;
}
#mathlive-environment-popover .MLEP__array-buttons g[data-command]:hover circle {
fill: var(--_accent-color);
}
#mathlive-environment-popover .MLEP__array-buttons g[data-command]:hover line {
stroke-opacity: 1;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls {
height: 100%;
width: 50%;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options {
width: var(--_environment-panel-height);
height: var(--_environment-panel-height);
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: space-around;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg {
pointer-events: all;
margin-top: 2px;
width: calc(var(--_environment-panel-height) / 3 * 28 / 24);
height: calc(var(--_environment-panel-height) / 3 - 2px);
border-radius: calc(var(--_environment-panel-height) / 25);
background-color: var(--_button-background);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg:hover {
background-color: var(--_button-background-hover);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg path,
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg line {
stroke: var(--_button-text);
stroke-width: 2;
stroke-linecap: round;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg rect,
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg path {
fill-opacity: 0;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active {
pointer-events: none;
background-color: var(--_button-background-active);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active path,
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active line {
stroke: var(--_accent-color);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active circle {
fill: var(--_accent-color);
}
`,cf=`/* The element that display info while in latex mode */
#mathlive-suggestion-popover {
background-color: rgba(97, 97, 97);
color: #fff;
text-align: center;
border-radius: 8px;
position: fixed;
z-index: 1;
display: none;
flex-direction: column;
justify-content: center;
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
}
#mathlive-suggestion-popover.top-tip::after {
content: '';
position: absolute;
top: -15px;
left: calc(50% - 15px);
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-bottom: 15px solid rgba(97, 97, 97);
font-size: 1rem;
}
#mathlive-suggestion-popover.bottom-tip::after {
content: '';
position: absolute;
bottom: -15px;
left: calc(50% - 15px);
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-top: 15px solid rgba(97, 97, 97);
font-size: 1rem;
}
#mathlive-suggestion-popover.is-animated {
transition: all 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
animation: ML__fade-in cubic-bezier(0, 0, 0.2, 1) 0.15s;
}
#mathlive-suggestion-popover.is-visible {
display: flex;
}
@keyframes ML__fade-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* The wrapper class for the entire content of the popover panel */
#mathlive-suggestion-popover ul {
display: flex;
flex-flow: column;
list-style: none;
margin: 0;
padding: 0;
align-items: flex-start;
max-height: 400px;
overflow-y: auto;
}
#mathlive-suggestion-popover li {
display: flex;
flex-direction: row;
justify-content: space-between;
margin: 8px;
padding: 8px;
width: calc(100% - 16px - 16px);
column-gap: 1em;
border-radius: 8px;
cursor: pointer;
/* Since the content can be clicked on, provide feedback on hover */
}
#mathlive-suggestion-popover li a {
color: #5ea6fd;
padding-top: 0.3em;
margin-top: 0.4em;
display: block;
}
#mathlive-suggestion-popover li a:hover {
color: #5ea6fd;
text-decoration: underline;
}
#mathlive-suggestion-popover li:hover,
#mathlive-suggestion-popover li.is-pressed,
#mathlive-suggestion-popover li.is-active {
background: rgba(255, 255, 255, 0.1);
}
/* The command inside a popover (inside a #mathlive-suggestion-popover) */
.ML__popover__command {
font-size: 1.6rem;
font-family: KaTeX_Main;
}
.ML__popover__current {
background: #5ea6fd;
color: #fff;
}
.ML__popover__latex {
font-family: 'IBM Plex Mono', 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;
align-self: center;
}
/* The keyboard shortcuts for a symbol as displayed in the popover */
.ML__popover__keybinding {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 0.8em;
opacity: 0.7;
}
/* Style for the character that joins the modifiers of a keyboard shortcut
(usually a "+" sign)*/
.ML__shortcut-join {
opacity: 0.5;
}
`,Il=`/* The element that displays the keys as the user type them */
#mathlive-keystroke-caption-panel {
visibility: hidden;
/*min-width: 160px;*/
/*background-color: rgba(97, 97, 200, .95);*/
background: var(--secondary, hsl(var(--_hue), 19%, 26%));
border-color: var(--secondary-border, hsl(0, 0%, 91%));
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
text-align: center;
border-radius: 6px;
padding: 16px;
position: absolute;
z-index: 1;
display: flex;
flex-direction: row-reverse;
justify-content: center;
--keystroke: white;
--on-keystroke: #555;
--keystroke-border: #f7f7f7;
}
@media (prefers-color-scheme: dark) {
body:not([theme='light']) #mathlive-keystroke-caption-panel {
--keystroke: hsl(var(--_hue), 50%, 30%);
--on-keystroke: hsl(0, 0%, 98%);
--keystroke-border: hsl(var(--_hue), 50%, 25%);
}
}
body[theme='dark'] #mathlive-keystroke-caption-panel {
--keystroke: hsl(var(--_hue), 50%, 30%);
--on-keystroke: hsl(0, 0%, 98%);
--keystroke-border: hsl(var(--_hue), 50%, 25%);
}
#mathlive-keystroke-caption-panel > span {
min-width: 14px;
/*height: 8px;*/
margin: 0 8px 0 0;
padding: 4px;
background-color: var(--keystroke);
color: var(--on-keystroke);
fill: currentColor;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 1em;
border-radius: 6px;
border: 2px solid var(--keystroke-border);
/*box-shadow: 0 7px 14px rgba(0,0,0,0.25), 0 5px 5px rgba(0,0,0,0.22);*/
}
`,uf=`.ML__keyboard {
--_keyboard-height: 0;
--_keyboard-zindex: var(--keyboard-zindex, 105);
--_accent-color: var(--keyboard-accent-color, #0c75d8);
--_background: var(--keyboard-background, #cacfd7);
--_border: var(--keyboard-border, #ddd);
--_padding-horizontal: var(--keyboard-padding-horizontal, 0px);
--_padding-top: var(--keyboard-padding-top, 5px);
--_padding-bottom: var(--keyboard-padding-bottom, 0px);
--_row-padding-left: var(--keyboard-row-padding-left, 0px);
--_row-padding-right: var(--keyboard-row-padding-right, 0px);
--_toolbar-text: var(--keyboard-toolbar-text, #2c2e2f);
--_toolbar-text-active: var(--keyboard-toolbar-text-active, var(--_accent-color));
--_toolbar-background: var(--keyboard-toolbar-background, transparent);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #eee);
--_toolbar-background-selected: var(--keyboard-toolbar-background-selected, transparent);
--_toolbar-font-size: var(--keyboard-toolbar-font-size, '135%');
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #fff);
--_keycap-background: var(--keycap-background, white);
--_keycap-background-hover: var(--keycap-background-hover, #f5f5f7);
--_keycap-background-active: var(--keycap-background-active, var(--_accent-color));
--_keycap-background-pressed: var(--keycap-background-pressed, var(--_accent-color));
--_keycap-border: var(--keycap-border, #e5e6e9);
--_keycap-border-bottom: var(--keycap-border-bottom, #8d8f92);
--_keycap-text: var(--keycap-text, #000);
--_keycap-text-active: var(--keycap-text-active, #fff);
--_keycap-text-hover: var(--keycap-text-hover, var(--_keycap-text));
--_keycap-text-pressed: var(--keycap-text-pressed, #fff);
--_keycap-shift-text: var(--keycap-shift-text, var(--_accent-color));
--_keycap-primary-background: var(--keycap-primary-background, var(--_accent-color));
--_keycap-primary-text: var(--keycap-primary-text, #ddd);
--_keycap-primary-background-hover: var(--keycap-primary-background-hover, #0d80f2);
--_keycap-secondary-background: var(--keycap-secondary-background, #a0a9b8);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #7d8795);
--_keycap-secondary-text: var(--keycap-secondary-text, #060707);
--_keycap-secondary-border: var(--keycap-secondary-border, #c5c9d0);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, #989da6);
--_keycap-height: var(--keycap-height, 60px);
/* Keycap width (incl. margin) */
--_keycap-max-width: var(--keycap-max-width, 100px);
--_keycap-gap: var(--keycap-gap, 8px);
--_keycap-font-size: var(--keycap-font-size, clamp(16px, 4cqw, 24px));
--_keycap-small-font-size: var(--keycap-small-font-size, calc(var(--keycap-font-size) * 0.8));
--_keycap-extra-small-font-size: var(--keycap-extra-small-font-size, calc(var(--keycap-font-size) / 1.42));
--_variant-panel-background: var(--variant-panel-background, #fff);
--_variant-keycap-text: var(--variant-keycap-text, var(--_keycap-text));
--_variant-keycap-text-active: var(--variant-keycap-text-active, var(--_keycap-text-active));
--_variant-keycap-background-active: var(--variant-keycap-background-active, var(--_accent-color));
--_variant-keycap-length: var(--variant-keycap-length, 70px);
--_variant-keycap-font-size: var(--variant-keycap-font-size, 30px);
--_variant-keycap-aside-font-size: var(--variant-keycap-aside-font-size, 12px);
--_keycap-shift-font-size: var(--keycap-shift-font-size, 16px);
--_keycap-shift-color: var(--keycap-shift-color, var(--_accent-color));
--_box-placeholder-color: var(--box-placeholder-color, var(--_accent-color));
--_box-placeholder-pressed-color: var(--box-placeholder-pressed-color, var(--keycap-text-pressed));
}
.is-math-mode .MLK__rows .if-text-mode,
.is-text-mode .MLK__rows .if-math-mode {
display: none;
}
.if-can-undo,
.if-can-redo,
.if-can-copy,
.if-can-cut,
.if-can-paste {
opacity: 0.4;
pointer-events: none;
}
.can-undo .if-can-undo,
.can-redo .if-can-redo,
.can-copy .if-can-copy,
.can-cut .if-can-cut,
.can-paste .if-can-paste {
opacity: 1;
pointer-events: all;
}
body > .ML__keyboard {
position: fixed;
--_padding-bottom: calc(var(--keyboard-padding-bottom, 0px) + env(safe-area-inset-bottom, 0));
}
body > .ML__keyboard.is-visible > .MLK__backdrop {
box-shadow: 0 -5px 6px rgba(0, 0, 0, 0.08);
border-top: 1px solid var(--_border);
}
body > .ML__keyboard.backdrop-is-transparent.is-visible > .MLK__backdrop {
box-shadow: none;
border: none;
}
body > .ML__keyboard.is-visible.animate > .MLK__backdrop {
transition: 0.28s cubic-bezier(0, 0, 0.2, 1);
transition-property: transform, opacity;
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}
.ML__keyboard {
position: relative;
overflow: hidden;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: var(--_keyboard-zindex);
box-sizing: border-box;
outline: none;
border: none;
margin: 0;
padding: 0;
line-height: 1;
overflow-wrap: unset;
text-align: left;
vertical-align: baseline;
cursor: auto;
white-space: pre;
box-shadow: none;
opacity: 1;
transform: none;
pointer-events: none;
}
.ML__keyboard :where(div) {
box-sizing: border-box;
outline: none;
border: none;
margin: 0;
padding: 0;
line-height: 1;
overflow-wrap: unset;
text-align: left;
vertical-align: baseline;
cursor: auto;
white-space: pre;
box-shadow: none;
transform: none;
}
.MLK__backdrop {
position: absolute;
bottom: calc(-1 * var(--_keyboard-height));
width: 100%;
height: var(--_keyboard-height);
box-sizing: border-box;
padding-top: var(--_padding-top);
padding-bottom: var(--_padding-bottom);
padding-left: var(--_padding-horizontal);
padding-right: var(--_padding-horizontal);
opacity: 0;
visibility: hidden;
transform: translate(0, 0);
background: var(--_background);
}
.backdrop-is-transparent .MLK__backdrop {
background: transparent;
}
/* If a custom layout has a custom container/backdrop
(backdrop-is-transparent), make sure to let pointer event go through. */
.backdrop-is-transparent .MLK__plate {
background: transparent;
pointer-events: none;
}
/* If a custom layout has a custom container/backdrop, make sure to
allow pointer events on it. */
.backdrop-is-transparent .MLK__layer > div > div {
pointer-events: all;
}
.ML__keyboard.is-visible > .MLK__backdrop {
transform: translate(0, calc(-1 * var(--_keyboard-height)));
opacity: 1;
visibility: visible;
}
.caps-lock-indicator {
display: none;
width: 8px;
height: 8px;
background: #0cbc0c;
box-shadow: inset 0 0 4px 0 #13ca13, 0 0 4px 0 #a9ef48;
border-radius: 8px;
right: 8px;
top: 8px;
position: absolute;
}
.ML__keyboard.is-caps-lock .caps-lock-indicator {
display: block;
}
.ML__keyboard.is-caps-lock .shift {
background: var(--_keycap-background-active);
color: var(--_keycap-text-active);
}
.MLK__plate {
position: absolute;
top: var(--_padding-top);
left: var(--_padding-horizontal);
width: calc(100% - 2 * var(--_padding-horizontal));
margin: 0;
padding: 0;
box-sizing: border-box;
container-type: inline-size;
touch-action: none;
-webkit-user-select: none;
user-select: none;
pointer-events: all;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 16px;
/* Size of toolbar labels */
font-weight: 400;
text-shadow: none;
}
.ML__box-placeholder {
color: var(--_box-placeholder-color);
}
.MLK__tex {
font-family: KaTeX_Main, KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
}
.MLK__tex-math {
font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
font-style: italic;
}
.MLK__layer {
display: none;
outline: none;
}
.MLK__layer.is-visible {
display: flex;
flex-flow: column;
}
/* Keyboard layouts are made or rows of keys... */
.MLK__rows {
--_keycap-width: min(var(--_keycap-max-width), 10cqw);
display: flex;
flex-flow: column;
align-items: center;
border-collapse: separate;
clear: both;
border: 0;
margin: 0;
margin-bottom: var(--_keycap-gap);
gap: var(--_keycap-gap);
/* If the styling include, e.g., some shadows, they will be
cut off by the overflow. In that case, set the padding to
compensate. */
padding-left: var(--_row-padding-left);
padding-right: var(--_row-padding-right);
overflow: visible;
touch-action: none;
}
.MLK__rows > .MLK__row {
display: flex;
flex-flow: row;
justify-content: center;
width: 100%;
gap: var(--_keycap-gap);
margin: 0;
padding: 0;
/* For the alignment of the text on some modifiers (e.g. shift) */
/* Extra spacing between two adjacent keys */
}
.MLK__rows > .MLK__row .tex {
font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
}
.MLK__rows > .MLK__row .tex-math {
font-family: KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
}
.MLK__rows > .MLK__row .big-op {
font-size: calc(1.25 * var(--_keycap-font-size));
}
.MLK__rows > .MLK__row .small {
font-size: var(--_keycap-small-font-size);
}
.MLK__rows > .MLK__row .bottom {
justify-content: flex-end;
}
.MLK__rows > .MLK__row .left {
align-items: flex-start;
padding-left: 12px;
}
.MLK__rows > .MLK__row .right {
align-items: flex-end;
padding-right: 12px;
}
.MLK__rows > .MLK__row .w0 {
width: 0;
}
.MLK__rows > .MLK__row .w5 {
width: calc(0.5 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w15 {
width: calc(1.5 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w20 {
width: calc(2 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w40 {
width: calc(4 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w50 {
width: calc(5 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .MLK__keycap.w50 {
font-size: 80%;
padding-top: 10px;
font-weight: 100;
}
.MLK__rows > .MLK__row .separator {
background: transparent;
border: none;
pointer-events: none;
}
.MLK__rows > .MLK__row .horizontal-rule {
height: 6px;
margin-top: 3px;
margin-bottom: 0;
width: 100%;
border-radius: 0;
border-top: var(--_horizontal-rule);
}
.MLK__rows > .MLK__row .ghost {
background: var(--_toolbar-background);
border: none;
color: var(--_toolbar-text);
}
.MLK__rows > .MLK__row .ghost:hover {
background: var(--_toolbar-background-hover);
}
.MLK__rows > .MLK__row .bigfnbutton {
font-size: var(--_keycap-extra-small-font-size);
}
.MLK__rows > .MLK__row .shift,
.MLK__rows > .MLK__row .action {
color: var(--_keycap-secondary-text);
background: var(--_keycap-secondary-background);
border-color: var(--_keycap-secondary-border);
border-bottom-color: var(--_keycap-secondary-border-bottom);
line-height: 0.8;
font-size: min(1rem, var(--_keycap-small-font-size));
font-weight: 600;
padding: 8px 12px 8px 12px;
}
.MLK__rows > .MLK__row .shift:hover,
.MLK__rows > .MLK__row .action:hover {
background: var(--_keycap-secondary-background-hover);
}
.MLK__rows > .MLK__row .action.primary {
background: var(--_keycap-primary-background);
color: var(--_keycap-primary-text);
}
.MLK__rows > .MLK__row .action.primary:hover {
background: var(--_keycap-primary-background-hover);
color: var(--_keycap-primary-text);
}
.MLK__rows > .MLK__row .shift.selected,
.MLK__rows > .MLK__row .action.selected {
color: var(--_toolbar-text-active);
}
.MLK__rows > .MLK__row .shift.selected.is-pressed,
.MLK__rows > .MLK__row .action.selected.is-pressed,
.MLK__rows > .MLK__row .shift.selected.is-active,
.MLK__rows > .MLK__row .action.selected.is-active {
color: white;
}
.MLK__rows > .MLK__row .warning {
background: #cd0030;
color: white;
}
.MLK__rows > .MLK__row .warning svg.svg-glyph {
width: 24px;
height: 24px;
min-height: 24px;
}
/** A regular keycap
* Use the :where() pseudo-class to give it a very low specifity,
* so that it can be overriden by custom style.
*/
:where(.MLK__rows > .MLK__row div) {
display: flex;
flex-flow: column;
align-items: center;
justify-content: space-evenly;
width: calc(var(--_keycap-width) - var(--_keycap-gap));
height: var(--_keycap-height);
box-sizing: border-box;
padding: 0;
vertical-align: top;
text-align: center;
float: left;
color: var(--_keycap-text);
fill: currentColor;
font-size: var(--_keycap-font-size);
background: var(--_keycap-background);
border: 1px solid var(--_keycap-border);
border-bottom-color: var(--_keycap-border-bottom);
border-radius: 6px;
cursor: pointer;
touch-action: none;
/* Keys with a variants panel */
position: relative;
overflow: hidden;
-webkit-user-select: none;
user-select: none;
-webkit-tap-highlight-color: transparent;
}
:where(.MLK__rows > .MLK__row div):hover {
overflow: visible;
background: var(--_keycap-background-hover);
}
:where(.MLK__rows > .MLK__row div) .ML__latex {
pointer-events: none;
touch-action: none;
}
:where(.MLK__rows > .MLK__row div) svg.svg-glyph {
margin: 8px 0;
width: 20px;
height: 20px;
min-height: 20px;
}
:where(.MLK__rows > .MLK__row div) svg.svg-glyph-lg {
margin: 8px 0;
width: 24px;
height: 24px;
min-height: 24px;
}
:where(.MLK__rows > .MLK__row div).MLK__tex-math {
font-size: 25px;
}
:where(.MLK__rows > .MLK__row div).is-pressed {
background: var(--_keycap-background-pressed);
color: var(--_keycap-text-pressed);
--_box-placeholder-color: var(--_box-placeholder-pressed-color);
}
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active,
:where(.MLK__rows > .MLK__row div).action.is-active,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed,
:where(.MLK__rows > .MLK__row div).action.is-pressed {
z-index: calc(var(--_keyboard-zindex) - 5);
}
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active aside,
:where(.MLK__rows > .MLK__row div).action.is-active aside,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed aside,
:where(.MLK__rows > .MLK__row div).action.is-pressed aside {
display: none;
}
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active .MLK__shift,
:where(.MLK__rows > .MLK__row div).action.is-active .MLK__shift,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed .MLK__shift,
:where(.MLK__rows > .MLK__row div).action.is-pressed .MLK__shift {
display: none;
}
:where(.MLK__rows > .MLK__row div).shift.is-pressed,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed,
:where(.MLK__rows > .MLK__row div).action.is-pressed {
background: var(--_keycap-background-pressed);
color: var(--_keycap-text-pressed);
}
:where(.MLK__rows > .MLK__row div).shift.is-active,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active,
:where(.MLK__rows > .MLK__row div).action.is-active {
background: var(--_keycap-background-active);
color: var(--_keycap-text-active);
--_box-placeholder-color: var(--_box-placeholder-pressed-color);
}
:where(.MLK__rows > .MLK__row div) small {
color: var(--_keycap-secondary-text);
}
:where(.MLK__rows > .MLK__row div) aside {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 10px;
line-height: 10px;
color: var(--_keycap-secondary-text);
}
/* Add an attribute 'data-tooltip' to display a tooltip on hover.
Note there are a different set of tooltip rules for the keyboard toggle
(it's in a different CSS tree) */
.ML__keyboard [data-tooltip] {
position: relative;
}
.ML__keyboard [data-tooltip]::after {
position: absolute;
display: inline-table;
content: attr(data-tooltip);
top: inherit;
bottom: 100%;
width: max-content;
max-width: 200px;
padding: 8px 8px;
background: #616161;
color: #fff;
text-align: center;
z-index: 2;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
border-radius: 2px;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-weight: 400;
font-size: 12px;
transition: all 0.15s cubic-bezier(0.4, 0, 1, 1) 1s;
opacity: 0;
transform: scale(0.5);
}
.ML__keyboard [data-tooltip]:hover {
position: relative;
}
.ML__keyboard [data-tooltip]:hover::after {
opacity: 1;
transform: scale(1);
}
.MLK__toolbar {
align-self: center;
display: flex;
flex-flow: row;
justify-content: space-between;
width: 100%;
max-width: 996px;
min-height: 32px;
/* Icons for undo/redo, etc. */
}
.MLK__toolbar svg {
height: 20px;
width: 20px;
}
.MLK__toolbar > .left {
position: relative;
display: flex;
justify-content: flex-start;
flex-flow: row;
}
.MLK__toolbar > .right {
display: flex;
justify-content: flex-end;
flex-flow: row;
}
.MLK__toolbar > div > div {
/* "button" in the toolbar */
display: flex;
align-items: center;
justify-content: center;
color: var(--_toolbar-text);
fill: currentColor;
background: var(--_toolbar-background);
font-size: var(--_toolbar-font-size);
padding: 4px 15px;
cursor: pointer;
width: max-content;
min-width: 42px;
min-height: 34px;
border: none;
padding-left: 10px;
padding-right: 10px;
padding-bottom: 8px;
padding-top: 8px;
margin-top: 0;
margin-bottom: 4px;
margin-left: 4px;
margin-right: 4px;
border-radius: 8px;
box-shadow: none;
border-bottom: 2px solid transparent;
}
.MLK__toolbar > div > div:not(.disabled):not(.selected):hover {
background: var(--_toolbar-background-hover);
}
.MLK__toolbar > div > div.disabled svg,
.MLK__toolbar > div > div.disabled:hover svg,
.MLK__toolbar > div > div.disabled.is-pressed svg {
color: var(--_toolbar-text);
opacity: 0.2;
}
.MLK__toolbar > div > div:hover,
.MLK__toolbar > div > div:active,
.MLK__toolbar > div > div.is-pressed,
.MLK__toolbar > div > div.is-active {
color: var(--_toolbar-text-active);
}
.MLK__toolbar > div > div.selected {
color: var(--_toolbar-text-active);
background: var(--_toolbar-background-selected);
border-radius: 0;
border-bottom-color: var(--_toolbar-text-active);
padding-bottom: 4px;
margin-bottom: 8px;
}
/* This is the element that displays variants on press+hold */
.MLK__variant-panel {
visibility: hidden;
position: fixed;
display: flex;
flex-flow: row wrap-reverse;
justify-content: center;
align-content: center;
margin: 0;
padding: 0;
bottom: auto;
top: 0;
box-sizing: content-box;
transform: none;
z-index: calc(var(--_keyboard-zindex) + 1);
touch-action: none;
max-width: 350px;
background: var(--_variant-panel-background);
text-align: center;
border-radius: 6px;
padding: 6px;
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
transition: none;
}
.MLK__variant-panel.is-visible {
visibility: visible;
}
.MLK__variant-panel.compact {
--_variant-keycap-length: var(--variant-keycap-length, 50px);
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
--_variant-keycap-aside-font-size: var(--variant-keycap-aside-font-size, 10px);
}
.MLK__variant-panel .item {
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
font-size: var(--_variant-keycap-font-size);
height: var(--_variant-keycap-length);
width: var(--_variant-keycap-length);
margin: 0;
box-sizing: border-box;
border-radius: 5px;
border: 1px solid transparent;
background: transparent;
pointer-events: all;
cursor: pointer;
color: var(--_variant-keycap-text);
fill: currentColor;
}
@media (max-height: 412px) {
.MLK__variant-panel .item {
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
--_variant-keycap-length: var(--variant-keycap-length, 50px);
}
}
.MLK__variant-panel .item .ML__latex {
pointer-events: none;
}
.MLK__variant-panel .item.is-active {
background: var(--_variant-keycap-background-active);
color: var(--_variant-keycap-text-active);
}
.MLK__variant-panel .item.is-pressed {
background: var(--_variant-keycap-background-pressed);
color: var(--_variant-keycap-text-pressed);
}
.MLK__variant-panel .item.small {
font-size: var(--_keycap-small-font-size);
}
.MLK__variant-panel .item.swatch-button {
box-sizing: border-box;
background: #fbfbfb;
}
.MLK__variant-panel .item.swatch-button > span {
display: inline-block;
margin: 6px;
width: calc(100% - 12px);
height: calc(100% - 12px);
border-radius: 50%;
}
.MLK__variant-panel .item.swatch-button:hover {
background: #f0f0f0;
}
.MLK__variant-panel .item.swatch-button:hover > span {
border-radius: 2px;
}
.MLK__variant-panel .item.box > div,
.MLK__variant-panel .item.box > span {
border: 1px dashed rgba(0, 0, 0, 0.24);
}
.MLK__variant-panel .item .warning {
min-height: 60px;
min-width: 60px;
background: #cd0030;
color: white;
padding: 5px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 5px;
}
.MLK__variant-panel .item .warning.is-pressed,
.MLK__variant-panel .item .warning.is-active {
background: red;
}
.MLK__variant-panel .item .warning svg.svg-glyph {
width: 50px;
height: 50px;
}
.MLK__variant-panel .item aside {
font-size: var(--_variant-keycap-aside-font-size);
line-height: 12px;
opacity: 0.78;
padding-top: 2px;
}
.MLK__keycap {
position: relative;
}
.MLK__shift {
display: block;
position: absolute;
right: 4px;
top: 4px;
font-size: var(--_keycap-shift-font-size);
color: var(--_keycap-shift-color);
}
.hide-shift .MLK__shift {
display: none;
}
@media (max-width: 414px) {
.MLK__variant-panel {
max-width: 350px;
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
--_variant-keycap-length: var(--variant-keycap-length, 50px);
}
}
/* @xs breakpoint: iPhone 5 */
@container (max-width: 414px) {
.MLK__rows {
--_keycap-gap: max(var(--_keycap-gap, 2px), 2px);
--_keycap-height: max(var(--_keycap-height), 42px);
--_keycap-width: min(min(var(--_keycap-max-width), 10cqw), 62px);
}
.MLK__toolbar > div > div {
font-size: 100%;
margin-left: 2px;
margin-right: 2px;
}
.MLK__rows .shift,
.MLK__rows .action {
font-size: 65%;
}
.MLK__rows .warning svg.svg-glyph {
width: 14px;
height: 14px;
min-height: 14px;
}
}
@container (max-width: 744px) {
.MLK__rows {
--_keycap-gap: max(var(--keycap-gap, 2px), 2px);
--_keycap-height: max(var(--keycap-height, 52px), 52px);
--_keycap-width: min(min(var(--_keycap-max-width), 10cqw), 62px);
}
.MLK__toolbar > div > div {
padding-left: 0;
padding-right: 0;
}
.MLK__tooltip::after {
padding: 8px 16px;
font-size: 16px;
}
.MLK__rows > .MLK__row > div.fnbutton {
font-size: 16px;
}
.MLK__rows > .MLK__row > div.bigfnbutton {
font-size: calc(var(--_keycap-extra-small-font-size) / 1.55);
}
.MLK__rows > .MLK__row > div.small {
font-size: 13px;
}
.MLK__rows > .MLK__row > div > aside {
display: none;
}
.MLK__shift {
display: none;
}
}
/* Medium breakpoint: larger phones */
@container (max-width: 768px) {
.MLK__rows {
--_keycap-height: max(var(--keycap-height, 42px), 42px);
}
.MLK__rows > .MLK__row > div > small {
font-size: 14px;
}
}
@media (max-height: 768px) {
.MLK__rows {
--_keycap-height: max(var(--keycap-height, 42px), 42px);
}
.MLK__rows > .MLK__row > div > small {
font-size: 14px;
}
}
@container (max-width: 1444px) {
.MLK__rows .if-wide {
display: none;
}
}
@media (prefers-color-scheme: dark) {
.ML__keyboard {
--_accent-color: var(--keyboard-accent-color, #0b5c9c);
--_background: var(--keyboard-background, #151515);
--_border: var(--keyboard-border, transparent);
--_toolbar-text: var(--keyboard-toolbar-text, #e3e4e8);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #303030);
--keyboard-toolbar-background-hover: #303030;
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #303030);
--_keycap-background: var(--keycap-background, #1f2022);
--_keycap-background-hover: var(--keycap-background-hover, #2f3032);
--_keycap-border: var(--_keycap-border, transparent);
--_keycap-border-bottom: var(--_keycap-border-bottom, transparent);
--_keycap-text: var(--keycap-text, #e3e4e8);
--_keycap-secondary-background: var(--keycap-secondary-background, #3d4144);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #4d5154);
--_keycap-secondary-text: var(--keycap-secondary-text, #e7ebee);
--keycap-secondary-border: transparent;
--keycap-secondary-border-bottom: transparent;
--_keycap-secondary-border: var(--keycap-secondary-border, transparent);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, transparent);
--_variant-panel-background: var(--variant-panel-background, #303030);
--_variant-keycap-text-active: var(--variant-keycap-text-active, #fff);
}
}
/* Same as the media query, but with a class */
[theme='dark'] .ML__keyboard {
--_accent-color: var(--keyboard-accent-color, #0b5c9c);
--_background: var(--keyboard-background, #151515);
--_border: var(--keyboard-border, transparent);
--_toolbar-text: var(--keyboard-toolbar-text, #e3e4e8);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #303030);
--keyboard-toolbar-background-hover: #303030;
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #303030);
--_keycap-background: var(--keycap-background, #1f2022);
--_keycap-background-hover: var(--keycap-background-hover, #2f3032);
--_keycap-border: var(--_keycap-border, transparent);
--_keycap-border-bottom: var(--_keycap-border-bottom, transparent);
--_keycap-text: var(--keycap-text, #e3e4e8);
--_keycap-secondary-background: var(--keycap-secondary-background, #3d4144);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #4d5154);
--_keycap-secondary-text: var(--keycap-secondary-text, #e7ebee);
--keycap-secondary-border: transparent;
--keycap-secondary-border-bottom: transparent;
--_keycap-secondary-border: var(--keycap-secondary-border, transparent);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, transparent);
--_variant-panel-background: var(--variant-panel-background, #303030);
--_variant-keycap-text-active: var(--variant-keycap-text-active, #fff);
}
[theme='light'] .ML__keyboard {
--_accent-color: var(--keyboard-accent-color, #0c75d8);
--_background: var(--keyboard-background, #cacfd7);
--_border: var(--keyboard-border, #ddd);
--_toolbar-text: var(--keyboard-toolbar-text, #2c2e2f);
--_toolbar-background: var(--keyboard-toolbar-background, transparent);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #eee);
--_toolbar-background-selected: var(--keyboard-toolbar-background-selected, transparent);
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #fff);
--_keycap-background: var(--keycap-background, white);
--_keycap-background-hover: var(--keycap-background-hover, #f5f5f7);
--_keycap-background-active: var(--keycap-background-active, var(--_accent-color));
--_keycap-background-pressed: var(--keycap-background-pressed, var(--_accent-color));
--_keycap-border: var(--_keycap-border, #e5e6e9);
--_keycap-border-bottom: var(--_keycap-border-bottom, #8d8f92);
--_keycap-text: var(--keycap-text, #000);
--_keycap-text-active: var(--keycap-text-active, #fff);
--_keycap-text-hover: var(--keycap-text-hover, var(--_keycap-text));
--_keycap-text-pressed: var(--keycap-text-pressed, #fff);
--_keycap-shift-text: var(--keycap-shift-text, var(--_accent-color));
--_keycap-secondary-background: var(--keycap-secondary-background, #a0a9b8);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #7d8795);
--_keycap-secondary-text: var(--keycap-secondary-text, #060707);
--_keycap-secondary-border: var(--keycap-secondary-border, #c5c9d0);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, #989da6);
--_variant-panel-background: var(--variant-panel-background, #fff);
--_variant-keycap-text: var(--variant-keycap-textvar, var(--_keycap-text));
--_variant-keycap-text-active: var(--variant-keycap-text-active, var(--_keycap-text-active));
--_variant-keycap-background-active: var(--variant-keycap-background-active, var(--_accent-color));
}
`,iu=`:host {
--primary-color: #5898ff;
--primary-color-dimmed: #c0c0f0;
--primary-color-dark: var(--blue-500);
--primary-color-light: var(--blue-100);
--primary-color-reverse: #ffffff;
--secondary-color: #ff8a65;
--secondary-color-dimmed: #f0d5c5;
--secondary-color-dark: var(--orange-500);
--secondary-color-light: var(--orange-100);
--secondary-color-reverse: #ffffff;
--link-color: #5898ff;
--link-color-dimmed: #c5c5c5;
--link-color-dark: #121212;
--link-color-light: #e2e2e2;
--link-color-reverse: #ffffff;
--semantic-blue: var(--blue-700);
--semantic-red: var(--red-400);
--semantic-orange: var(--orange-400);
--semantic-green: var(--green-700);
--neutral-100: #f5f5f5;
--neutral-200: #eeeeee;
--neutral-300: #e0e0e0;
--neutral-400: #bdbdbd;
--neutral-500: #9e9e9e;
--neutral-600: #757575;
--neutral-700: #616161;
--neutral-800: #424242;
--neutral-900: #212121;
--red-25: #fff8f7;
--red-50: #fff1ef;
--red-100: #ffeae6;
--red-200: #ffcac1;
--red-300: #ffa495;
--red-400: #ff7865;
--red-500: #f21c0d;
--red-600: #e50018;
--red-700: #d30024;
--red-800: #bd002c;
--red-900: #a1002f;
--orange-25: #fffbf8;
--orange-50: #fff7f1;
--orange-100: #fff3ea;
--orange-200: #ffe1c9;
--orange-300: #ffcca2;
--orange-400: #ffb677;
--orange-500: #fe9310;
--orange-600: #f58700;
--orange-700: #ea7c00;
--orange-800: #dc6d00;
--orange-900: #ca5b00;
--brown-25: #fff8ef;
--brown-50: #fff1df;
--brown-100: #ffe9ce;
--brown-200: #ebcca6;
--brown-300: #cdaf8a;
--brown-400: #af936f;
--brown-500: #856a47;
--brown-600: #7f5e34;
--brown-700: #78511f;
--brown-800: #6e4200;
--brown-900: #593200;
--yellow-25: #fffdf9;
--yellow-50: #fffcf2;
--yellow-100: #fffaec;
--yellow-200: #fff2ce;
--yellow-300: #ffe8ab;
--yellow-400: #ffdf85;
--yellow-500: #ffcf33;
--yellow-600: #f1c000;
--yellow-700: #dfb200;
--yellow-800: #c9a000;
--yellow-900: #ad8a00;
--lime-25: #f4ffee;
--lime-50: #e9ffdd;
--lime-100: #ddffca;
--lime-200: #a8fb6f;
--lime-300: #94e659;
--lime-400: #80d142;
--lime-500: #63b215;
--lime-600: #45a000;
--lime-700: #268e00;
--lime-800: #007417;
--lime-900: #005321;
--green-25: #f5fff5;
--green-50: #ebffea;
--green-100: #e0ffdf;
--green-200: #a7ffa7;
--green-300: #5afa65;
--green-400: #45e953;
--green-500: #17cf36;
--green-600: #00b944;
--green-700: #00a34a;
--green-800: #008749;
--green-900: #00653e;
--teal-25: #f3ffff;
--teal-50: #e6fffe;
--teal-100: #d9fffe;
--teal-200: #8dfffe;
--teal-300: #57f4f4;
--teal-400: #43e5e5;
--teal-500: #17cfcf;
--teal-600: #00c2c0;
--teal-700: #00b5b1;
--teal-800: #00a49e;
--teal-900: #009087;
--cyan-25: #f7fcff;
--cyan-50: #eff8ff;
--cyan-100: #e7f5ff;
--cyan-200: #c2e6ff;
--cyan-300: #95d5ff;
--cyan-400: #61c4ff;
--cyan-500: #13a7ec;
--cyan-600: #069eda;
--cyan-700: #0095c9;
--cyan-800: #0088b2;
--cyan-900: #0a7897;
--blue-25: #f7faff;
--blue-50: #eef5ff;
--blue-100: #e5f1ff;
--blue-200: #bfdbff;
--blue-300: #92c2ff;
--blue-400: #63a8ff;
--blue-500: #0d80f2;
--blue-600: #0077db;
--blue-700: #006dc4;
--blue-800: #0060a7;
--blue-900: #005086;
--indigo-25: #f8f7ff;
--indigo-50: #f1efff;
--indigo-100: #eae7ff;
--indigo-200: #ccc3ff;
--indigo-300: #ac99ff;
--indigo-400: #916aff;
--indigo-500: #63c;
--indigo-600: #5a21b2;
--indigo-700: #4e0b99;
--indigo-800: #3b0071;
--indigo-900: #220040;
--purple-25: #fbf7ff;
--purple-50: #f8f0ff;
--purple-100: #f4e8ff;
--purple-200: #e4c4ff;
--purple-300: #d49aff;
--purple-400: #c36aff;
--purple-500: #a219e6;
--purple-600: #9000c4;
--purple-700: #7c009f;
--purple-800: #600073;
--purple-900: #3d0043;
--magenta-25: #fff8fb;
--magenta-50: #fff2f6;
--magenta-100: #ffebf2;
--magenta-200: #ffcddf;
--magenta-300: #ffa8cb;
--magenta-400: #ff7fb7;
--magenta-500: #eb4799;
--magenta-600: #da3689;
--magenta-700: #c82179;
--magenta-800: #b00065;
--magenta-900: #8a004c;
}
@media (prefers-color-scheme: dark) {
:host {
--semantic-blue: var(--blue-700);
--semantic-red: var(--red-400);
--semantic-orange: var(--orange-400);
--semantic-green: var(--green-700);
--semantic-bg-blue: var(--blue-25);
--semantic-bg-red: var(--red-25);
--semantic-bg-orange: var(--orange-25);
--semantic-bg-green: var(--green-25);
--neutral-100: #121212;
--neutral-200: #424242;
--neutral-300: #616161;
--neutral-400: #757575;
--neutral-500: #9e9e9e;
--neutral-600: #bdbdbd;
--neutral-700: #e0e0e0;
--neutral-800: #eeeeee;
--neutral-900: #f5f5f5;
}
}
:host([theme='dark']) {
--semantic-blue: var(--blue-700);
--semantic-red: var(--red-400);
--semantic-orange: var(--orange-400);
--semantic-green: var(--green-700);
--semantic-bg-blue: var(--blue-25);
--semantic-bg-red: var(--red-25);
--semantic-bg-orange: var(--orange-25);
--semantic-bg-green: var(--green-25);
--neutral-100: #121212;
--neutral-200: #424242;
--neutral-300: #616161;
--neutral-400: #757575;
--neutral-500: #9e9e9e;
--neutral-600: #bdbdbd;
--neutral-700: #e0e0e0;
--neutral-800: #eeeeee;
--neutral-900: #f5f5f5;
}
/* @media (prefers-color-scheme: dark) {
:host {
--label-color: #fff;
--active-label-color: #000;
--menu-bg: #525252;
--active-bg: #5898ff;
--active-bg-dimmed: #5c5c5c;
}
} */
:host {
--ui-font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont,
'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji',
'Segoe UI Emoji', 'Segoe UI Symbol';
--ui-font-size: 14px;
--ui-line-height: 1.5;
--ui-letter-spacing: 0.007em;
--mono-font-family: 'Berkeley Mono', 'JetBrains Mono', 'IBM Plex Mono',
'Source Code Pro', Menlo, Monaco, 'Courier New', monospace;
--ui-layer-1: var(--neutral-100);
--ui-layer-2: var(--neutral-200);
--ui-layer-3: var(--neutral-300);
--ui-layer-4: var(--neutral-400);
--ui-layer-5: var(--neutral-500);
--ui-layer-6: var(--neutral-600);
--ui-border-color: var(--primary-color);
--ui-border-radius: 4px;
--ui-text: var(--neutral-900);
--ui-text-secondary: var(--neutral-700);
--ui-text-placeholder: var(--neutral-500);
--ui-text-muted: var(--neutral-300);
/** A field is a UI element in which a user can type data, for
* example an input or textarea element.
*/
--ui-field-bg: var(--neutral-100);
--ui-field-bg-hover: var(--neutral-100);
--ui-field-bg-disabled: var(--neutral-300);
--ui-field-bg-invalid: var(--red-100);
--ui-field-bg-focus: var(--neutral-100);
--ui-field-border: 0.5px solid var(--border-color);
--ui-field-border-hover: 0.5px solid var(--border-color);
--ui-field-border-disabled: 0.5px solid var(--border-color);
--ui-field-border-invalid: 0.5px solid var(--border-color);
--ui-field-border-focus: 0.5px solid var(--border-color);
--ui-menu-bg: var(--neutral-100);
--ui-menu-text: var(--neutral-900);
--ui-menu-bg-hover: var(--neutral-200);
--ui-menu-text-hover: var(--neutral-900);
/** The \`active\` state is used for the state of menu items
* when they are selected.
*/
--ui-menu-bg-active: var(--primary-color);
--ui-menu-text-active: var(--primary-color-reverse);
/** The \`active-muted\` set is used for the state of
* submenus when they are open.
*/
--ui-menu-bg-active-muted: var(--neutral-300);
--ui-menu-text-active-muted: var(--neutral-900);
/* --ui-menu-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.302),
0 2px 6px 2px rgba(60, 64, 67, 0.149); */
--ui-menu-shadow: 0 0 2px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 0, 0, 0.2);
--ui-menu-divider: 0.5px solid #c7c7c7;
/* var(--neutral-300); */
--ui-menu-z-index: 10000;
--page-bg: var(--neutral-100);
--content-bg: var(--neutral-200);
}
@media (prefers-color-scheme: dark) {
:host {
--ui-menu-bg: var(--neutral-200);
}
}
:host([theme='dark']) {
--ui-menu-bg: var(--neutral-200);
}
/* PingFang SC is a macOS font. Microsoft Yahei is a Windows font.
Noto is a Linux/Android font.
*/
:lang(zh-cn),
:lang(zh-sg),
:lang(zh-my),
:lang(zh) {
--ui-font-family: -apple-system, system-ui, 'PingFang SC', 'Hiragino Sans GB',
'Noto Sans CJK SC', 'Noto Sans SC', 'Noto Sans', 'Microsoft Yahei UI',
'Microsoft YaHei New', 'Microsoft Yahei', '\u5FAE\u8F6F\u96C5\u9ED1', SimSun, '\u5B8B\u4F53',
STXihei, '\u534E\u6587\u7EC6\u9ED1', sans-serif;
}
:lang(zh-tw),
:lang(zh-hk),
:lang(zh-mo) {
--ui-font-family: -apple-system, system-ui, 'Noto Sans',
'Microsoft JhengHei UI', 'Microsoft JhengHei', '\u5FAE\u8EDF\u6B63\u9ED1\u9AD4', '\u65B0\u7D30\u660E\u9AD4',
'PMingLiU', '\u7D30\u660E\u9AD4', 'MingLiU', sans-serif;
}
:lang(ja),
:lang(ja-jp),
:lang(ja-jp-mac) {
--ui-font-family: -apple-system, system-ui, 'Hiragino Sans',
'Hiragino Kaku Gothic ProN', 'Noto Sans CJK JP', 'Noto Sans JP', 'Noto Sans',
'\u6E38\u30B4\u30B7\u30C3\u30AF', '\u6E38\u30B4\u30B7\u30C3\u30AF\u4F53', YuGothic, 'Yu Gothic', '\u30E1\u30A4\u30EA\u30AA', Meiryo,
'\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF', 'MS PGothic', sans-serif;
}
:lang(ko),
:lang(ko-kr),
:lang(ko-kr-std) {
--ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',
'Noto Sans', 'Malgun Gothic', '\uB9D1\uC740 \uACE0\uB515', 'Apple SD Gothic Neo',
'\uC560\uD50C SD \uC0B0\uB3CC\uACE0\uB515 Neo', 'Apple SD \uC0B0\uB3CC\uACE0\uB515 Neo', '\uB3CB\uC6C0', Dotum, sans-serif;
}
:lang(ko-kr-apple) {
--ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',
'Noto Sans', 'Apple SD Gothic Neo', '\uC560\uD50C SD \uC0B0\uB3CC\uACE0\uB515 Neo',
'Apple SD \uC0B0\uB3CC\uACE0\uB515 Neo', '\uB3CB\uC6C0', Dotum, sans-serif;
}
:lang(zh-cn),
:lang(zh-sg),
:lang(zh-my),
:lang(zh),
:lang(zh-tw),
:lang(zh-hk),
:lang(zh-mo),
:lang(ja),
:lang(ja-jp),
:lang(ja-jp-mac),
:lang(ko),
:lang(ko-kr),
:lang(ko-kr-std),
:lang(ko-kr-apple) {
--ui-font-size: 1rem;
--ui-line-height: 1.7;
--ui-letter-spacing: 0;
}
:dir(rtl) {
--ui-line-height: auto;
--ui-letter-spacing: 0;
}
`,df=`.ui-menu *,
.ui-menu ::before,
.ui-menu ::after {
box-sizing: border-box;
}
.ui-menu {
display: none;
color-scheme: light dark;
-webkit-user-select: none;
/* Important: Safari iOS doesn't respect user-select */
user-select: none;
cursor: default;
-webkit-touch-callout: none;
-webkit-tap-highlight-color: rgba(0 0 0 0);
--active-label-color: #fff;
/* ui-menu-text-active */
--label-color: #121212;
/* ui-menu-text */
--menu-bg: #e2e2e2;
/* ui-menu-background */
--active-bg: #5898ff;
/* ui-menu-background-active */
--active-bg-dimmed: #c5c5c5;
/* ui-menu-background-active-muted */
}
/** Use the :where pseudo selector to make the specificity of the
* selector 0, so that it can be overridden by the user.
*/
:where(.ui-menu-container) {
position: absolute;
overflow: visible;
width: auto;
height: auto;
z-index: 10000;
border-radius: 8px;
background: var(--ui-menu-bg);
box-shadow: var(--ui-menu-shadow);
list-style: none;
padding: 6px 0 6px 0;
margin: 0;
user-select: none;
cursor: default;
color: var(--ui-menu-text);
font-weight: normal;
font-style: normal;
text-shadow: none;
text-transform: none;
letter-spacing: 0;
outline: none;
opacity: 1;
/* The [popover] elements have a 1px solid black border. Ugh. */
border: none;
width: fit-content;
height: fit-content;
}
:where(.ui-menu-container > li) {
display: flex;
flex-flow: row;
align-items: center;
padding: 1px 7px 1px 7px;
margin-top: 0;
margin-left: 6px;
margin-right: 6px;
border-radius: 4px;
white-space: nowrap;
position: relative;
outline: none;
fill: currentColor;
user-select: none;
cursor: default;
text-align: left;
color: inherit;
font-family: var(--ui-font-family);
font-size: var(--ui-font-size);
line-height: var(--ui-line-height);
letter-spacing: var(--ui-letter-spacing);
}
:where(.ui-menu-container > li > .label) {
appearance: none;
background: none;
outline: none;
width: 100%;
margin: 0;
padding: 1px 2px 1px 1px;
overflow: visible;
border: 1px solid transparent;
white-space: nowrap;
text-align: start;
}
:where(.ui-menu-container > li:has(.heading)) {
margin-top: 0.5em;
}
:where(.ui-menu-container > li > .label.heading) {
font-weight: bold;
opacity: 0.4;
}
:where(.ui-menu-container > li.indent > .label) {
margin-inline-start: 12px;
}
:where(.ui-menu-container > li > .label.indent) {
margin-inline-start: 12px;
}
:where(.ui-menu-container > li[role='divider']) {
border-bottom: 1px solid var(--ui-menu-divider);
border-radius: 0;
padding: 0;
margin-left: 15px;
margin-right: 15px;
padding-top: 5px;
margin-bottom: 5px;
width: calc(100% - 30px);
/** 100% - (margin-left + margin-right) */
}
:where(.ui-menu-container > li[aria-disabled='true']) {
opacity: 0.5;
}
:where(.ui-menu-container > li.active) {
background: var(--ui-menu-bg-active);
background: -apple-system-control-accent;
color: var(--ui-menu-text-active);
}
:where(.ui-menu-container > li.active.is-submenu-open) {
background: var(--ui-menu-bg-active-muted);
color: inherit;
}
:where(.ui-menu-container > li[aria-haspopup='true'] > .label) {
padding-inline-end: 0;
}
:where(.ui-menu-container > li[aria-haspopup='true'].active::after) {
color: var(--ui-menu-text-active);
}
/** Keyboard shortcut */
:where(.ui-menu-container > li > kbd) {
font-family: var(--ui-font-family);
margin-inline-start: 12px;
opacity: 0.4;
}
:where(.ui-menu-container > li.active > kbd) {
opacity: 0.85;
}
.ui-trailing-chevron {
display: flex;
margin-inline-start: 24px;
width: 10px;
height: 10px;
margin-bottom: 4px;
}
.ui-trailing-chevron:dir(rtl) {
transform: scaleX(-1);
}
.ui-checkmark {
display: flex;
margin-inline-end: -11px;
margin-inline-start: -4px;
margin-top: 2px;
width: 16px;
height: 16px;
}
.ui-mixedmark {
display: flex;
margin-inline-end: -11px;
margin-inline-start: -4px;
margin-top: 2px;
width: 16px;
height: 16px;
}
`,qi;function hl(a){let y="";switch(a){case"mathfield-element":y=`
:host { display: inline-block; background-color: field; color: fieldtext; border-width: 1px; border-style: solid; border-color: #acacac; border-radius: 2px; padding:4px;}
:host([hidden]) { display: none; }
:host([disabled]), :host([disabled]:focus), :host([disabled]:focus-within) { outline: none; opacity: .5; }
:host(:focus), :host(:focus-within) {
outline: Highlight auto 1px; /* For Firefox */
outline: -webkit-focus-ring-color auto 1px;
}
:host([readonly]:focus), :host([readonly]:focus-within),
:host([read-only]:focus), :host([read-only]:focus-within) {
outline: none;
}
@media (hover: none) and (pointer: coarse) {
:host(:not(:focus)) :first-child { pointer-events: none !important; }
}`;break;case"core":y=Vi;break;case"mathfield":y=gh;break;case"environment-popover":y=vh;break;case"suggestion-popover":y=cf;break;case"keystroke-caption":y=Il;break;case"virtual-keyboard":y=uf;break;case"ui":y=iu;break;case"menu":y=df;break;default:debugger}return y}function Bl(a){return qi||(qi={}),qi[a]||(qi[a]=new CSSStyleSheet,qi[a].replaceSync(hl(a))),qi[a]}var ys;function Bo(a){var y;if(!("adoptedStyleSheets"in document)){if(window.document.getElementById(`mathlive-style-${a}`))return;const b=window.document.createElement("style");b.id=`mathlive-style-${a}`,b.append(window.document.createTextNode(hl(a))),window.document.head.appendChild(b);return}if(ys||(ys={}),((y=ys[a])!=null?y:0)!==0)ys[a]+=1;else{const b=Bl(a);document.adoptedStyleSheets=[...document.adoptedStyleSheets,b],ys[a]=1}}function x(a){if("adoptedStyleSheets"in document&&ys!=null&&ys[a]&&(ys[a]-=1,ys[a]<=0)){const y=qi[a];document.adoptedStyleSheets=document.adoptedStyleSheets.filter(b=>b!==y)}}var z=class Ep extends Dn{constructor(y){var b;super(ke(Ce({},y),{type:"accent",body:(b=y.body)!=null?b:void 0})),y.accentChar?this.accent=y.accentChar:this.svgAccent=y==null?void 0:y.svgAccent,this.skipBoundary=!0,this.captureSelection=!0}static fromJson(y){return new Ep(y)}toJson(){return ke(Ce({},super.toJson()),{accentChar:this.accent,svgAccent:this.svgAccent})}render(y){var b;const E=new Di({parent:y,mathstyle:"cramp"},this.style),ee=(b=Dn.createBox(E,this.body))!=null?b:new ir("\u25A2",{style:this.style});let re=0;!this.hasEmptyBranch("body")&&this.body.length===2&&this.body[1].isCharacterBox()&&(re=ee.skew);let ae=Math.min(ee.height,hs),ue;if(this.svgAccent)ue=$o(this.svgAccent),ae=E.metrics.bigOpSpacing1-ae;else if(this.accent){const ge=new ir(this.accent,{fontFamily:"Main-Regular"});ge.italic=0;const be=this.accent===8407?" ML__accent-vec":"";ue=new ir(new ir(ge),{classes:"ML__accent-body"+be})}ue=new Yi({shift:0,children:[{box:new ir(ee)},-ae,{box:ue,marginLeft:ee.left+2*re,classes:["ML__center"]}]});const he=new ir(ue,{type:"lift"});return this.caret&&(he.caret=this.caret),this.bind(E,he.wrap(E)),this.attachSupsub(E,{base:he})}},ne={"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\lparen":"\\rparen","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},te=Object.fromEntries(Object.entries(ne).map(([a,y])=>[y,a]));function ie(a){var y;return(y={"[":91,"]":93,"(":40,")":41,"\\mid":8739,"|":8739,"\u2223":8739,"\u2225":8741,"\\|":8739,"\\{":123,"\\}":125,"\\lbrace":123,"\\rbrace":125,"\\lparen":40,"\\rparen":41,"\\lbrack":91,"\\rbrack":93,"\\vert":8739,"\\lvert":8739,"\\mvert":8739,"\\rvert":8739,"\\Vert":8741,"\\lVert":8741,"\\mVert":8741,"\\rVert":8741,"\\parallel":8741,"\\shortparallel":8741,"\\langle":10216,"\\rangle":10217,"\\lfloor":8970,"\\rfloor":8971,"\\lceil":8968,"\\rceil":8969,"\\ulcorner":9484,"\\urcorner":9488,"\\llcorner":9492,"\\lrcorner":9496,"\\lgroup":10222,"\\rgroup":10223,"\\lmoustache":9136,"\\rmoustache":9137,"\\surd":8730}[a])!=null?y:a.codePointAt(0)}function le(a,y,b,E){var ee;const ae=new ir(ie(a),{fontFamily:"Main-Regular",isSelected:E.isSelected,classes:"ML__small-delim "+((ee=E.classes)!=null?ee:"")}).wrap(y);return b&&ae.setTop((1-y.scalingFactor)*ro),ae}function me(a,y,b,E,ee){var re,ae;const ue=new Di({parent:E,mathstyle:"textstyle"},ee==null?void 0:ee.style),he=new ir(ie(a),{fontFamily:`Size${y}-Regular`,isSelected:ee.isSelected,classes:((re=ee.classes)!=null?re:"")+` ML__delim-size${y}`,type:(ae=ee.type)!=null?ae:"ignore"}).wrap(ue);return b&&he.setTop((1-ue.scalingFactor)*ro),he}function we(a,y,b,E,ee){var re;let ae,ue,he,ge;ae=he=ge=ie(a),ue=null;let be="Size1-Regular";a==="\\vert"||a==="\\lvert"||a==="\\rvert"||a==="\\mvert"||a==="\\mid"?he=ae=ge=8739:a==="\\Vert"||a==="\\lVert"||a==="\\rVert"||a==="\\mVert"||a==="\\|"?he=ae=ge=8741:a==="\\uparrow"?he=ge=9168:a==="\\Uparrow"?he=ge=8214:a==="\\downarrow"?ae=he=9168:a==="\\Downarrow"?ae=he=8214:a==="\\updownarrow"?(ae=8593,he=9168,ge=8595):a==="\\Updownarrow"?(ae=8657,he=8214,ge=8659):a==="["||a==="\\lbrack"?(ae=9121,he=9122,ge=9123,be="Size4-Regular"):a==="]"||a==="\\rbrack"?(ae=9124,he=9125,ge=9126,be="Size4-Regular"):a==="\\lfloor"||a==="\u230A"?(he=ae=9122,ge=9123,be="Size4-Regular"):a==="\\lceil"||a==="\u2308"?(ae=9121,he=ge=9122,be="Size4-Regular"):a==="\\rfloor"||a==="\u230B"?(he=ae=9125,ge=9126,be="Size4-Regular"):a==="\\rceil"||a==="\u2309"?(ae=9124,he=ge=9125,be="Size4-Regular"):a==="("||a==="\\lparen"?(ae=9115,he=9116,ge=9117,be="Size4-Regular"):a===")"||a==="\\rparen"?(ae=9118,he=9119,ge=9120,be="Size4-Regular"):a==="\\{"||a==="\\lbrace"?(ae=9127,ue=9128,ge=9129,he=9130,be="Size4-Regular"):a==="\\}"||a==="\\rbrace"?(ae=9131,ue=9132,ge=9133,he=9130,be="Size4-Regular"):a==="\\lgroup"||a==="\u27EE"?(ae=9127,ge=9129,he=9130,be="Size4-Regular"):a==="\\rgroup"||a==="\u27EF"?(ae=9131,ge=9133,he=9130,be="Size4-Regular"):a==="\\lmoustache"||a==="\u23B0"?(ae=9127,ge=9133,he=9130,be="Size4-Regular"):a==="\\rmoustache"||a==="\u23B1"?(ae=9131,ge=9129,he=9130,be="Size4-Regular"):a==="\\surd"?(ae=57345,ge=9143,he=57344,be="Size4-Regular"):a==="\\ulcorner"?(ae=9484,he=ge=32):a==="\\urcorner"?(ae=9488,he=ge=32):a==="\\llcorner"?(ge=9492,he=ae=32):a==="\\lrcorner"&&(ae=9496,he=ae=32);const Be=fs(ae,be),He=Be.height+Be.depth,lt=fs(he,be),xt=lt.height+lt.depth,vn=fs(ge,be),nr=vn.height+vn.depth;let fn=0,Rn=1;if(ue!==null){const Ua=fs(ue,be);fn=Ua.height+Ua.depth,Rn=2}const cr=He+nr+fn,Fn=Math.max(0,Math.ceil((y-cr)/(Rn*xt))),Hr=cr+Fn*Rn*xt;let Jr=ro;b&&(Jr=Jr*E.scalingFactor);const jr=Hr/2-Jr,Ti=.008,Ui=[];Ui.push({box:new ir(ge,{fontFamily:be})}),Ui.push(-Ti);const xr=new ir(he,{fontFamily:be});if(ue===null)for(let Ua=0;Ua<Fn;Ua++)Ui.push({box:xr});else{for(let Ua=0;Ua<Fn;Ua++)Ui.push({box:xr});Ui.push(-Ti),Ui.push({box:new ir(ue,{fontFamily:be})}),Ui.push(-Ti);for(let Ua=0;Ua<Fn;Ua++)Ui.push({box:xr})}Ui.push(-Ti),Ui.push({box:new ir(ae,{fontFamily:be})});let Wo="";be==="Size1-Regular"?Wo=" delim-size1":be==="Size4-Regular"&&(Wo=" delim-size4");const js=new Yi({bottom:jr,children:Ui},{classes:Wo});return new ir(js,ke(Ce({},ee!=null?ee:{}),{classes:((re=ee==null?void 0:ee.classes)!=null?re:"")+" ML__delim-mult"}))}var _e=new Set(["(",")","\\lparen","\\rparen","[","]","\\lbrack","\\rbrack","\\{","\\}","\\lbrace","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd","\u230A","\u230B","\u2308","\u2309"]),Ie=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache","\u27EE","\u27EF","\u23B0","\u23B1"]),ot=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),wt=[0,1.2,1.8,2.4,3];function on(a,y,b,E){return a===void 0||a==="."?Fr(b,E.classes):(a==="<"||a==="\\lt"||a==="\u27E8"?a="\\langle":(a===">"||a==="\\gt"||a==="\u27E9")&&(a="\\rangle"),_e.has(a)||ot.has(a)?me(a,y,!1,b,E):Ie.has(a)?we(a,wt[y],!1,b,E):(console.assert(!1,"Unknown delimiter '"+a+"'"),null))}var qt=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],An=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"stack"}],Kn=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function pr(a){return a.type==="small"?"Main-Regular":a.type==="large"?"Size"+a.size+"-Regular":(console.assert(a.type==="stack"),"Size4-Regular")}function Lr(a,y,b,E){const ee={"-4":0,"-3":1,0:2}[E.mathstyle.sizeDelta];for(let re=ee;re<b.length&&b[re].type!=="stack";re++){const ae=fs(a,pr(b[re]));if(ae.defaultMetrics)return{type:"small",mathstyle:"scriptstyle"};let ue=ae.height+ae.depth;if(b[re].type==="small"&&(b[re].mathstyle==="scriptscriptstyle"?ue*=Math.max(Gc[Math.max(1,E.size-2)],E.minFontScale):b[re].mathstyle==="scriptstyle"&&(ue*=Math.max(Gc[Math.max(1,E.size-1)],E.minFontScale))),ue>y)return b[re]}return b[b.length-1]}function Or(a,y,b,E,ee,re){if(!y||y.length===0||y===".")return Fr(ee);y==="<"||y==="\\lt"?y="\\langle":(y===">"||y==="\\gt")&&(y="\\rangle");let ae;ot.has(y)?ae=qt:_e.has(y)?ae=Kn:ae=An;const ue=Lr(ie(y),b,ae,ee),he=new Di({parent:ee,mathstyle:ue.mathstyle},re==null?void 0:re.style);return ue.type==="small"?le(y,he,E,ke(Ce({},re),{type:a})):ue.type==="large"?me(y,ue.size,E,he,ke(Ce({},re),{type:a})):(console.assert(ue.type==="stack"),we(y,b,E,he,ke(Ce({},re),{type:a})))}function Cr(a,y,b,E,ee,re){if(y===".")return Fr(ee,re==null?void 0:re.classes);const ae=ro*ee.scalingFactor,ue=901,he=5/ll,ge=Math.max(b-ae,E+ae),be=Math.max(ge/500*ue,2*ge-he);return Or(a,y,be,!0,ee,re)}function Fr(a,y){const b=new ir(null,{classes:" nulldelimiter "+(y!=null?y:""),type:"ignore"});return b.width=a.getRegisterAsEm("nulldelimiterspace"),b.wrap(new Di({parent:a,mathstyle:"textstyle"}))}var Qr=class Lp extends Dn{constructor(y){var b;super({type:"placeholder",command:"\\placeholder",mode:(b=y==null?void 0:y.mode)!=null?b:"math",style:y==null?void 0:y.style}),this.captureSelection=!0}static fromJson(y){return new Lp(y)}toJson(){return super.toJson()}render(y){let b;return this.value=y.placeholderSymbol,typeof y.renderPlaceholder=="function"?b=y.renderPlaceholder(y):b=this.createBox(y),this.caret&&(b.classes+=" ML__placeholder-selected"),b}_serialize(y){return y.skipPlaceholders?"":"\\placeholder{}"}},ti=["matrix","matrix*","pmatrix","pmatrix*","bmatrix","bmatrix*","Bmatrix","Bmatrix*","vmatrix","vmatrix*","Vmatrix","Vmatrix*"],Ci=["cases","dcases","rcases"],Ji=["align","align*","aligned","gather","gathered","split"],$a=["array","subequations","eqnarray"];function da(a){return $a.concat(Ji).concat(Ci).concat(ti).includes(a)}function co(a){return ti.includes(a)}function uo(a){return Ci.includes(a)}function _a(a){return Ji.includes(a)}function ho(a,y,b){let E=0;for(const ge of b)"align"in ge&&(E+=1);let ee=0;const re=[];for(const ge of y){let be=0;for(ee=Math.max(ee,Math.min(ge.length,E));be<ge.length;){const Be=[],He=Math.min(ge.length,be+E);for(;be<He;){const lt=ge[be];lt.length===0?Be.push([new Dn({type:"first",mode:a.mode})]):lt[0].type!=="first"?Be.push([new Dn({type:"first",mode:a.mode}),...lt]):(console.assert(!lt.slice(1).some(xt=>xt.type==="first")),Be.push(lt)),be+=1}re.push(Be)}}re.length>0&&re[re.length-1].length===1&&re[re.length-1][0].length===1&&re[re.length-1][0][0].type==="first"&&re.pop();const ae=[];for(const ge of re){if(ge.length!==ee)for(let be=ge.length;be<ee;be++)ge.push([new Dn({type:"first",mode:a.mode}),new Qr]);ae.push(ge)}let ue=0,he=0;for(const ge of ae){he=0;for(const be of ge){for(const Be of be)Be.parent=a,Be.parentBranch=[ue,he];he+=1}ue+=1}return a.isDirty=!0,ae}var hi=class Dp extends Dn{constructor(y,b,E,ee={}){var re;super({type:"array"}),this.environmentName=y,this.rowGaps=E,ee.mathstyleName&&(this.mathstyleName=ee.mathstyleName),ee.columns&&(ee.columns.length===0?this.colFormat=[{align:"l"}]:this.colFormat=ee.columns),this.colFormat||(this.colFormat=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]),this.array=ho(this,b,this.colFormat),ee.leftDelim&&(this.leftDelim=ee.leftDelim),ee.rightDelim&&(this.rightDelim=ee.rightDelim),ee.arraycolsep!==void 0&&(this.arraycolsep=ee.arraycolsep),this.colSeparationType=ee.colSeparationType,ee.arraystretch!==void 0&&(this.arraystretch=ee.arraystretch),this.minColumns=(re=ee.minColumns)!=null?re:1}static fromJson(y){return new Dp(y.environmentName,y.array,y.rowGaps,y)}toJson(){const y=ke(Ce({},super.toJson()),{environmentName:this.environmentName,array:this.array.map(b=>b.map(E=>E.map(ee=>ee.toJson()))),rowGaps:this.rowGaps,columns:this.colFormat,colSeparationType:this.colSeparationType});return this.arraystretch!==void 0&&(y.arraystretch=this.arraystretch),this.arraycolsep!==void 0&&(y.arraycolsep=this.arraycolsep),this.leftDelim&&(y.leftDelim=this.leftDelim),this.rightDelim&&(y.rightDelim=this.rightDelim),y}branch(y){var b;if(lc(y))return(b=this.array[y[0]][y[1]])!=null?b:void 0}createBranch(y){var b;return lc(y)?(this.isDirty=!0,(b=this.branch(y))!=null?b:[]):[]}get rowCount(){return this.array.length}get colCount(){return this.array[0].length}get maxColumns(){return this.colFormat.filter(y=>!!y.align).length}removeBranch(y){if(gs(y))return super.removeBranch(y);const b=this.branch(y);return this.array[y[0]][y[1]]=void 0,b.forEach(E=>{E.parent=void 0,E.parentBranch=void 0}),console.assert(b[0].type==="first"),b.shift(),this.isDirty=!0,b}get hasChildren(){return this.children.length>0}get children(){const y=[];for(const b of this.array)for(const E of b)if(E)for(const ee of E)y.push(...ee.children),y.push(ee);return[...y,...super.children]}render(y){var b,E,ee,re,ae,ue;const he=new Di({parent:y,mathstyle:this.mathstyleName},this.style),ge=he.getRegisterAsEm("arrayrulewidth"),be=he.getRegisterAsEm("arraycolsep"),Be=he.getRegisterAsEm("doublerulesep"),He=(E=(b=this.arraystretch)!=null?b:he.getRegisterAsNumber("arraystretch"))!=null?E:1;let lt=typeof this.arraycolsep=="number"?this.arraycolsep:be;this.colSeparationType==="small"&&(lt=.2778*(new Di({parent:y,mathstyle:"scriptstyle"}).scalingFactor/y.scalingFactor));const xt=He*Uc,vn=.7*xt,nr=.3*xt;let fn=0;const Rn=[];let cr=0;const Fn=this.array.length;for(let ea=0;ea<Fn;++ea){const wa=this.array[ea];cr=Math.max(cr,wa.length);const Ga=new Di({parent:he,mathstyle:this.mathstyleName},this.style);let Vs=vn/Ga.scalingFactor,Us=nr/Ga.scalingFactor;const Gs={cells:[],height:0,depth:0,pos:0};for(const ws of wa){const e0=(ee=Dn.createBox(Ga,ws,{type:"ignore"}))!=null?ee:new ir(null,{type:"ignore"});Us=Math.max(Us,e0.depth),Vs=Math.max(Vs,e0.height),Gs.cells.push(e0)}let Xs=(re=qu(this.rowGaps[ea]))!=null?re:0;Xs>0&&(Xs+=nr,Us=Math.max(Us,Xs),Xs=0),ea<Fn-1&&!co(this.environmentName)&&this.environmentName!=="cases"&&this.environmentName!=="array"&&(Us+=he.getRegisterAsEm("jot")),Gs.height=Vs,Gs.depth=Us,fn+=Vs,Gs.pos=fn,fn+=Us+Xs,Rn.push(Gs)}const Hr=fn/2+ro,Jr=[];for(let ea=0;ea<cr;ea++){const wa=[];for(const Ga of Rn){const Vs=Ga.cells[ea];Vs.depth=Ga.depth,Vs.height=Ga.height,wa.push({box:Vs,shift:Ga.pos-Hr})}wa.length>0&&Jr.push(new Yi({individualShift:wa}))}const jr=[];let Ti=!1,Ui=!1,xr=0,Wo=!this.leftDelim;const{colFormat:js}=this;for(const ea of js){if("align"in ea&&xr>=Jr.length)break;if("align"in ea)Ti?jr.push(ha(2*lt)):(Ui||Wo)&&jr.push(ha(lt)),jr.push(new ir(Jr[xr],{classes:"col-align-"+ea.align})),xr++,Ti=!0,Ui=!1,Wo=!1;else if("gap"in ea){if(typeof ea.gap=="number")jr.push(ha(ea.gap));else{const wa=ga(y,Rn,Hr,ea.gap);wa&&jr.push(wa)}Ti=!1,Ui=!1,Wo=!1}else if("separator"in ea){const wa=new ir(null,{classes:"vertical-separator"});wa.height=fn,wa.setStyle("height",fn,"em"),wa.setStyle("border-right",`${ge}em ${ea.separator} currentColor`),wa.setStyle("vertical-align",-(fn-Hr),"em");let Ga=0;Ui?Ga=Be-ge:Ti&&(Ga=lt-ge),wa.left=Ga,jr.push(wa),Ti=!1,Ui=!0,Wo=!1}}Ti&&!this.rightDelim&&jr.push(ha(lt));const Qo=new ir(jr,{classes:"mtable"});if((!this.leftDelim||this.leftDelim===".")&&(!this.rightDelim||this.rightDelim==="."))return this.caret&&(Qo.caret=this.caret),this.bind(y,Qo);const Ua=Qo.height,Zo=Qo.depth,_o=this.bind(y,new ir([this.bind(y,Cr("open",(ae=this.leftDelim)!=null?ae:".",Ua,Zo,he,{isSelected:this.isSelected})),Qo,this.bind(y,Cr("close",(ue=this.rightDelim)!=null?ue:".",Ua,Zo,he,{isSelected:this.isSelected}))],{type:"ord"}));return _o?(_o.setStyle("display","inline-block"),this.caret&&(_o.caret=this.caret),this.bind(y,this.attachSupsub(y,{base:_o}))):null}_serialize(y){var b;const E=[];if(this.environmentName==="lines"?E.push("{\\displaylines"):E.push(`\\begin{${this.environmentName}}`),this.environmentName==="array"){if(E.push("{"),this.colFormat!==void 0)for(const ee of this.colFormat)"align"in ee&&typeof ee.align=="string"?E.push(ee.align):"separator"in ee&&ee.separator==="solid"?E.push("|"):"separator"in ee&&ee.separator==="dashed"&&E.push(":");E.push("}")}for(let ee=0;ee<this.array.length;ee++){for(let re=0;re<this.array[ee].length;re++)re>0&&E.push(" & "),E.push(Dn.serialize(this.array[ee][re],y));if(ee<this.array.length-1){const re=this.rowGaps[ee];re!=null&&re.dimension?E.push(`\\\\[${re.dimension} ${(b=re.unit)!=null?b:"pt"}] `):E.push("\\\\ ")}}return this.environmentName==="lines"?E.push("}"):E.push(`\\end{${this.environmentName}}`),Si(E)}getCell(y,b){return this.array[y][b]}setCell(y,b,E){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.array[y][b]!==void 0);for(const re of this.array[y][b])re.parent=void 0,re.parentBranch=void 0;let ee=E;(E.length===0||E[0].type!=="first")&&(ee=[new Dn({type:"first",mode:this.mode}),...E]),this.array[y][b]=ee;for(const re of ee)re.parent=this,re.parentBranch=[y,b];this.isDirty=!0}addRowBefore(y){console.assert(this.type==="array"&&Array.isArray(this.array));const b=[];for(let E=0;E<this.colCount;E++)b.push(ma(this));this.array.splice(y,0,b);for(let E=y;E<this.rowCount;E++)for(let ee=0;ee<this.colCount;ee++){const re=this.array[E][ee];if(re)for(const ae of re)ae.parentBranch=[E,ee]}this.isDirty=!0}addRowAfter(y){console.assert(this.type==="array"&&Array.isArray(this.array));const b=[];for(let E=0;E<this.colCount;E++)b.push(ma(this));this.array.splice(y+1,0,b);for(let E=y+1;E<this.rowCount;E++)for(let ee=0;ee<this.colCount;ee++){const re=this.array[E][ee];if(re)for(const ae of re)ae.parentBranch=[E,ee]}this.isDirty=!0}removeRow(y){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.rowCount>y);const b=this.array.splice(y,1);for(const E of b)for(const ee of E)if(ee)for(const re of ee)re.parent=void 0,re.parentBranch=void 0;for(let E=y;E<this.rowCount;E++)for(let ee=0;ee<this.colCount;ee++){const re=this.array[E][ee];if(re)for(const ae of re)ae.parentBranch=[E,ee]}this.isDirty=!0}addColumnBefore(y){console.assert(this.type==="array"&&Array.isArray(this.array));for(const b of this.array)b.splice(y,0,ma(this));for(let b=0;b<this.rowCount;b++)for(let E=y;E<this.colCount;E++){const ee=this.array[b][E];if(ee)for(const re of ee)re.parentBranch=[b,E]}this.isDirty=!0}addColumnAfter(y){console.assert(this.type==="array"&&Array.isArray(this.array));for(const b of this.array)b.splice(y+1,0,ma(this));for(let b=0;b<this.rowCount;b++)for(let E=y+1;E<this.colCount;E++){const ee=this.array[b][E];if(ee)for(const re of ee)re.parentBranch=[b,E]}this.isDirty=!0}addColumn(){this.addColumnAfter(this.colCount-1)}removeColumn(y){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.colCount>y);for(const b of this.array){const E=b.splice(y,1);for(const ee of E)if(ee)for(const re of ee)re.parent=void 0,re.parentBranch=void 0}for(let b=0;b<this.rowCount;b++)for(let E=y;E<this.colCount;E++){const ee=this.array[b][E];if(ee)for(const re of ee)re.parentBranch=[b,E]}this.isDirty=!0}get cells(){const y=[];for(const b of this.array)for(const E of b)E&&y.push(E.filter(ee=>ee.type!=="first"));return y}};function ma(a){const y=new Dn({type:"first",mode:a.mode});y.parent=a;const b=new Qr;return b.parent=a,[y,b]}function ha(a){const y=new ir(null,{classes:"arraycolsep"});return y.width=a,y}function ga(a,y,b,E){if(!E)return null;const ee=[];for(const re of y){const ae=Dn.createBox(a,E,{type:"ignore"});ae&&(ae.depth=re.depth,ae.height=re.height,ee.push({box:ae,shift:re.pos-b}))}return new Yi({individualShift:ee}).wrap(a)}var ba=class Ap extends Dn{constructor(y){super({mode:y.mode,command:y.command,style:y.style,body:y.body,type:"box"}),this.framecolor=y.framecolor,this.backgroundcolor=y.backgroundcolor,this.padding=y.padding,this.offset=y.offset,this.border=y.border}static fromJson(y){return new Ap(y)}toJson(){return ke(Ce({},super.toJson()),{framecolor:this.framecolor,backgroundcolor:this.backgroundcolor,padding:this.padding,offset:this.offset,border:this.border})}render(y){var b,E,ee,re;const ae=Dn.createBox(y,this.body,{type:"lift"});if(!ae)return null;const ue=y.toEm((b=this.offset)!=null?b:{dimension:0});ae.depth+=ue,ae.setStyle("display","inline-block"),ae.setStyle("position","relative"),ae.setStyle("height",Math.floor(100*ae.height+ae.depth)/100,"em"),ae.setStyle("vertical-align",-Math.floor(100*ae.height)/100,"em");const he=new Di({parent:y},this.style),ge=he.toEm((E=this.padding)!=null?E:{register:"fboxsep"}),be=new ir(null,{classes:"ML__box"});be.height=ae.height+ge,be.depth=ae.depth+ge,be.setStyle("box-sizing","border-box"),be.setStyle("position","absolute"),be.setStyle("top",-ge+.3,"em"),be.setStyle("left",0),be.setStyle("height",be.height+be.depth,"em"),be.setStyle("width","100%"),this.backgroundcolor&&be.setStyle("background-color",(ee=he.toColor(this.backgroundcolor))!=null?ee:"transparent"),this.framecolor&&be.setStyle("border",`${he.getRegisterAsEm("fboxrule",2)}em solid ${(re=he.toColor(this.framecolor))!=null?re:"black"}`),this.border&&be.setStyle("border",this.border);const Be=new ir([be,ae],{type:"lift"});return Be.setStyle("display","inline-block"),Be.setStyle("position","relative"),Be.setStyle("line-height",0),Be.height=ae.height+ge+(ue>0?ue:0),Be.depth=ae.depth+ge+(ue<0?-ue:0),Be.setStyle("padding-left",ge,"em"),Be.setStyle("padding-right",ge,"em"),Be.setStyle("height",Math.floor(100*(ae.height+ae.depth+2*ge+Math.abs(ue)))/100,"em"),Be.setStyle("margin-top",-ge,"em"),Be.setStyle("top",Math.floor(100*(ae.depth-ae.height+2*ge-ue))/100,"em"),Be.setStyle("vertical-align",Math.floor(100*(ae.depth+2*ge))/100,"em"),this.caret&&(Be.caret=this.caret),this.attachSupsub(y,{base:Be})}_serialize(y){return y.skipStyles?Si([this.bodyToLatex(y),this.supsubToLatex(y)]):super._serialize(y)}},fl=class Tp extends Dn{constructor(y,b){var E;super({type:"composition",mode:(E=b==null?void 0:b.mode)!=null?E:"math",value:y})}static fromJson(y){return new Tp(y.value,y)}toJson(){return super.toJson()}get computedStyle(){return{}}render(y){const b=new ir(this.value,{classes:"ML__composition",type:"composition"});return this.bind(y,b),this.caret&&(b.caret=this.caret),b}_serialize(y){return""}},vo=class Pp extends Dn{constructor(y){super({type:"error",value:y,command:y,mode:"math"}),this.verbatimLatex=y}static fromJson(y){return new Pp(y.command)}toJson(){return super.toJson()}render(y){const b=this.createBox(y,{classes:"ML__error"});return this.caret&&(b.caret=this.caret),b}},Za=class Ip extends Dn{constructor(y,b,E){super({type:"group",mode:b,style:E}),this.body=y,this.boxType=y.length>1?"ord":"ignore",this.skipBoundary=!0,this.displayContainsHighlight=!1,y&&y.length===1&&y[0].command===","&&(this.captureSelection=!0)}static fromJson(y){return new Ip(y.body,y.mode,y.style)}render(y){const b=Dn.createBox(y,this.body,{type:this.boxType});return b?(this.caret&&(b.caret=this.caret),this.bind(y,b)):null}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Ze(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):`{${this.bodyToLatex(y)}}`}},Ri=class Bp extends Dn{constructor(y,b,E){super({type:"leftright",style:E.style,displayContainsHighlight:!0}),this.variant=y,this.body=b,this.leftDelim=E.leftDelim,this.rightDelim=E.rightDelim}static fromJson(y){var b;return new Bp((b=y.variant)!=null?b:"",y.body,y)}toJson(){const y=super.toJson();return this.variant&&(y.variant=this.variant),this.leftDelim&&(y.leftDelim=this.leftDelim),this.rightDelim&&(y.rightDelim=this.rightDelim),y}_serialize(y){var b,E;const ee=this.matchingRightDelim();return this.variant==="left...right"?Si(["\\left",(b=this.leftDelim)!=null?b:".",this.bodyToLatex(y),"\\right",ee]):this.variant==="mleft...mright"?Si(["\\mleft",(E=this.leftDelim)!=null?E:".",this.bodyToLatex(y),"\\mright",ee]):Si([!this.leftDelim||this.leftDelim==="."?"":this.leftDelim,this.bodyToLatex(y),ee])}matchingRightDelim(){var y,b;if(this.rightDelim&&this.rightDelim!=="?")return this.rightDelim;const E=(y=this.leftDelim)!=null?y:".";return(b=ne[E])!=null?b:E}render(y){var b,E;const ee=new Di({parent:y},this.style);console.assert(this.body!==void 0);const re=new Di({parent:y,mathstyle:"textstyle"},this.style),ae=(b=Dn.createBox(ee,this.body,{type:"inner"}))!=null?b:new ir(null,{type:"inner"}),ue=ae.height/re.scalingFactor,he=ae.depth/re.scalingFactor,ge=[];if(this.leftDelim&&ge.push(this.bind(re,Cr("open",this.leftDelim,ue,he,re,{isSelected:this.isSelected,classes:"ML__open"+(this.containsCaret?" ML__contains-caret":""),mode:this.mode,style:this.style}))),ae&&(Ia(ae.children,this,ee,ue,he),ge.push(ae)),this.rightDelim){let lt=this.containsCaret?" ML__contains-caret":"",xt=this.rightDelim;xt==="?"&&(ee.smartFence?(xt=this.matchingRightDelim(),lt+=" ML__smart-fence__close"):xt="."),ge.push(this.bind(re,Cr("close",xt,ue,he,re,{isSelected:this.isSelected,classes:lt+" ML__close",mode:this.mode,style:this.style})))}let be=this.variant==="mleft...mright";const Be=this.leftSibling;Be&&(!be&&Be.isFunction&&(be=!0),!be&&Be.type==="subsup"&&((E=Be.leftSibling)!=null&&E.isFunction)&&(be=!0));const He=new ir(ge,{type:be?"close":"inner",classes:"left-right"});return He.setStyle("margin-top",`${-ae.depth}em`),He.setStyle("height",`${ae.height+ae.depth}em`),this.caret&&(He.caret=this.caret),this.bind(ee,He.wrap(ee))}};function Ia(a,y,b,E,ee){if(a)for(let re=0;re<a.length;re++){const ae=a[re];ae.type==="middle"?(a[re]=y.bind(b,Cr("inner",ae.value,E,ee,b,{isSelected:y.isSelected})),a[re].caret=ae.caret,a[re].isSelected=ae.isSelected,a[re].cssId=ae.cssId,a[re].htmlData=ae.htmlData,a[re].htmlStyle=ae.htmlStyle,a[re].attributes=ae.attributes,a[re].cssProperties=ae.cssProperties):ae.children&&Ia(ae.children,y,b,E,ee)}}var au=class Op extends Dn{constructor(y,b){var E;super({type:"macro",command:y,style:b.style}),this.body=b.body,b.captureSelection===void 0?b.args?this.captureSelection=!1:this.captureSelection=!0:this.captureSelection=b.captureSelection,this.macroArgs=b.args,this.expand=(E=b.expand)!=null?E:!1}static fromJson(y){return new Op(y.command,y)}toJson(){const y=super.toJson();return this.expand&&(y.expand=!0),this.captureSelection!==void 0&&(y.captureSelection=this.captureSelection),this.macroArgs&&(y.args=this.macroArgs),y}_serialize(y){var b;return y.expandMacro&&this.expand?this.bodyToLatex(y):this.command+((b=this.macroArgs)!=null?b:"")}render(y){const b=Dn.createBox(y,this.body);return b?(this.caret&&(b.caret=this.caret),this.bind(y,b)):null}},bs=class Rp extends Dn{constructor(){super({type:"macro-argument"})}static fromJson(y){return new Rp}toJson(){return super.toJson()}_serialize(y){return""}render(y){return null}},$s=class Np extends Dn{constructor(y,b,E=!1,ee,re){var ae;super({type:"prompt",mode:(ae=re==null?void 0:re.mode)!=null?ae:"math",style:re==null?void 0:re.style,command:"\\placeholder"}),this.body=ee,this.correctness=b,this.placeholderId=y,this.locked=E,this.captureSelection=this.locked}static fromJson(y){return new Np(y.placeholderId,y.correctness,y.locked,y.body,y)}toJson(){const y=super.toJson();return this.placeholderId&&(y.placeholderId=this.placeholderId),this.body||delete y.body,this.body&&(y.body=this.body.filter(b=>b.type!=="first").map(b=>b.toJson())),this.correctness&&(y.correctness=this.correctness),y.locked=this.locked,y}render(y){const b=new Di({parent:y}),E=b.getRegisterAsEm("fboxsep"),ee=E,re=E,ae=Dn.createBox(y,this.body);if(!ae)return null;ae.height||(ae.height=b.metrics.xHeight),ae.setStyle("vertical-align",-ae.height,"em"),this.correctness==="correct"?ae.setStyle("color","var(--correct-color, var(--ML__correct-color))"):this.correctness==="incorrect"&&ae.setStyle("color","var(--incorrect-color, var(--ML__incorrect-color))");const ue=new ir(ae,{type:"ord"});ue.setStyle("display","inline-block"),ue.setStyle("height",ae.height+ae.depth,"em"),ue.setStyle("vertical-align",-re,"em");let he="ML__prompt ";this.locked?he+=" ML__lockedPromptBox ":he+=" ML__editablePromptBox ",this.correctness==="correct"?he+=" ML__correctPromptBox ":this.correctness==="incorrect"&&(he+=" ML__incorrectPromptBox "),this.containsCaret&&(he+=" ML__focusedPromptBox ");const ge=new ir(null,{classes:he,attributes:{part:"prompt"}});ge.height=ue.height+re,ge.depth=ue.depth+re,ge.width=ue.width+2*ee,ge.setStyle("box-sizing","border-box"),ge.setStyle("position","absolute"),ge.setStyle("height",ue.height+ue.depth+2*re,"em"),ee===0&&ge.setStyle("width","100%"),ee!==0&&(ge.setStyle("width",`calc(100% + ${2*ee}em)`),ge.setStyle("top",E,"em"),ge.setStyle("left",-ee,"em")),(!this.body||this.body.length===1)&&(ge.width=3*ee,ge.setStyle("width",`calc(100% + ${3*ee}em)`),ge.setStyle("left",-1.5*ee,"em"));let be="";this.correctness==="incorrect"&&(be+='<line x1="3%" y1="97%" x2="97%" y2="3%" stroke-width="0.5" stroke="var(--incorrect-color, var(--ML__incorrect-color))" stroke-linecap="round" />'),be&&(ge.svgOverlay=be);const Be=new ir([ge,ue],{classes:"ML__prompt-atom"});return Be.setStyle("position","relative"),Be.setStyle("display","inline-block"),Be.setStyle("line-height",0),Be.height=ue.height+re+.2,Be.depth=ue.depth+re,Be.left=ee,Be.right=ee,Be.setStyle("height",ue.height+re,"em"),Be.setStyle("top",ue.depth-ue.height,"em"),Be.setStyle("vertical-align",ue.depth+re,"em"),Be.setStyle("margin-left",.5,"em"),Be.setStyle("margin-right",.5,"em"),this.caret&&(Be.caret=this.caret),this.bind(b,this.attachSupsub(y,{base:Be}))}_serialize(y){var b;const E=(b=this.bodyToLatex(y))!=null?b:"";if(y.skipPlaceholders)return E;let ee="\\placeholder";return this.placeholderId&&(ee+=`[${this.placeholderId}]`),this.correctness==="correct"?ee+="[correct]":this.correctness==="incorrect"&&(ee+="[incorrect]"),this.locked&&(ee+="[locked]"),ra(ee,E)}},Yo=class $p extends Dn{constructor(y){super({type:"subsup",style:y==null?void 0:y.style}),this.subsupPlacement="auto"}static fromJson(y){const b=new $p(y);for(const E of Tl)y[E]&&b.setChildren(y[E],E);return b}render(y){var b;const E=new Di({parent:y,isPhantom:!0}),ee=this.leftSibling,re=(b=ee.render(E))!=null?b:new ir(null),ae=new ir(null);return ae.height=re.height,ae.depth=re.depth,this.attachSupsub(y,{base:ae,isCharacterBox:ee.isCharacterBox(),type:"ignore"})}_serialize(y){return this.supsubToLatex(y)}};function ka(a){return a?!/^(<$$>|<$>|<space>|<{>|<}>|#[0-9\?]|\\.+)$/.test(a):!1}var pl=class{constructor(a,y,b){this.errors=[],this.index=0,this.endCount=0;var E,ee,re,ae;b!=null||(b={}),this.tokens=a,this.context=y instanceof Di&&!(b!=null&&b.parseMode)&&!b.mathstyle?y:new Di({from:y,mathstyle:b.mathstyle},b.style),this.args=(E=b.args)!=null?E:void 0,this.smartFence=this.context.smartFence,this.parsingContext={parent:void 0,mathlist:[],style:(ee=b.style)!=null?ee:{},parseMode:(re=b.parseMode)!=null?re:"math",mathstyle:(ae=b.mathstyle)!=null?ae:"displaystyle",tabular:!1}}beginContext(a){var y,b,E;const ee=this.parsingContext,re={parent:ee,mathlist:[],style:Ce({},ee.style),parseMode:(y=a==null?void 0:a.mode)!=null?y:ee.parseMode,mathstyle:(b=a==null?void 0:a.mathstyle)!=null?b:ee.mathstyle,tabular:(E=a==null?void 0:a.tabular)!=null?E:!1};this.parsingContext=re}endContext(){this.parsingContext=this.parsingContext.parent}onError(a){this.errors.push(Ce({before:Ps(this.tokens.slice(this.index,this.index+10)),after:Ps(this.tokens.slice(Math.max(0,this.index-10),this.index))},a))}get mathlist(){return this.parsingContext.mathlist}set mathlist(a){this.parsingContext.mathlist=a}get parseMode(){return this.parsingContext.parseMode}set parseMode(a){this.parsingContext.parseMode=a}get tabularMode(){return this.parsingContext.tabular}get style(){let a=this.parsingContext;for(;a;){if(a.style)return Ce({},a.style);a=a.parent}return{}}set style(a){this.parsingContext.style=a}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}next(){this.index+=1}get(){return this.endCount=0,this.index<this.tokens.length?this.tokens[this.index++]:""}peek(){return this.tokens[this.index]}match(a){return this.tokens[this.index]===a?(this.index++,!0):!1}lastSubsupAtom(){let a;return this.mathlist.length>0&&(a=this.mathlist[this.mathlist.length-1],a.type==="subsup"||a.subsupPlacement!==void 0)||(a=new Yo({style:this.style}),this.mathlist.push(a)),a}hasPattern(a){return a.test(this.tokens[this.index])}hasInfixCommand(){var a;const{index:y}=this;if(y<this.tokens.length&&this.tokens[y].startsWith("\\")){const b=Ze(this.tokens[y],this.parseMode);return!b||b.definitionType==="symbol"||b.ifMode&&!b.ifMode.includes(this.parseMode)?!1:(a=b.infix)!=null?a:!1}return!1}matchColumnSeparator(){return!this.tabularMode||this.peek()!=="&"?!1:(this.index++,!0)}matchRowSeparator(){if(!this.tabularMode)return!1;const a=this.peek();return a!=="\\\\"&&a!=="\\cr"&&a!=="\\tabularnewline"?!1:(this.index++,!0)}placeholder(){var a;const y=(a=this.args)==null?void 0:a.call(this,"?");return y?ja(y,{parseMode:this.parseMode,mathstyle:"textstyle"}):[new Qr({mode:this.parseMode,style:this.style})]}skipWhitespace(){for(;this.match("<space>"););}skipUntilToken(a){let y=this.tokens[this.index];for(;y&&y!==a;)y=this.tokens[++this.index];y===a&&this.index++}skipFiller(){for(;this.match("\\relax")||this.match("<space>"););}matchKeyword(a){const y=this.index;let b=this.end(),E="";for(;!b;){const re=this.get();ka(re)?(E+=re,b=this.end()||E.length>=a.length):b=!0}const ee=a.toUpperCase()===E.toUpperCase();return ee||(this.index=y),ee}scanString(){let a="";for(;!this.end();){const y=this.peek();if(y==="]")return a;if(y==="<space>")a+=" ";else if(y.startsWith("\\"))this.onError({code:"unexpected-command-in-string"}),a+=y.substring(1);else if(ka(y))a+=y;else return a;this.next()}return a}scanBalancedString(){let a="",y=this.end(),b=1;for(;!y;){const E=this.get();E==="<space>"?a+=" ":E==="<{>"?(a+="{",b+=1):E==="<}>"?(b-=1,b>0?a+="}":this.index-=1):E==="<$>"?a+="$":E==="<$$>"?a+="$$":a+=E,y=b===0||this.end()}return a}scanLiteralGroup(){var a;if(!this.match("<{>"))return"";let y="",b=1;for(;b>0&&!this.end();){const E=this.get();E==="<}>"?(b-=1,b>0&&(y+="}")):E==="<{>"?(b+=1,y+="{"):(/\\[a-zA-Z]+$/.test(y)&&/^[a-zA-Z]/.test(E)&&(y+=" "),y+=(a={"<space>":" ","<$$>":"$$","<$>":"$"}[E])!=null?a:E)}return y}scanNumber(a=!0){var y,b;let E=!1,ee=this.peek();for(;ee==="<space>"||ee==="+"||ee==="-";)this.get(),ee==="-"&&(E=!E),ee=this.peek();a=!!a;let re=10,ae=/\d/;if(this.match("'"))re=8,ae=/[0-7]/,a=!0;else if(this.match('"'))re=16,ae=/[\dA-F]/,a=!0;else if(this.match("x"))re=16,ae=/[\dA-Fa-f]/,a=!0;else if(this.match("`"))return ee=this.get(),ee?ee.length===2&&ee.startsWith("\\")?{number:(E?-1:1)*((y=ee.codePointAt(1))!=null?y:0),base:"alpha"}:{number:(E?-1:1)*((b=ee.codePointAt(0))!=null?b:0),base:"alpha"}:null;let ue="";for(;this.hasPattern(ae);)ue+=this.get();if(!a&&(this.match(".")||this.match(",")))for(ue+=".";this.hasPattern(ae);)ue+=this.get();const he=a?Number.parseInt(ue,re):Number.parseFloat(ue);return Number.isNaN(he)?null:{number:E?-he:he,base:re===16?"hexadecimal":re===8?"octal":"decimal"}}scanRegister(){var a;const y=this.index,b=this.scanNumber(!1);if(this.skipWhitespace(),this.match("\\relax"))return b;let E=!1;if(b===null)for(;;){const re=this.peek();if(re==="-")E=!E;else if(re!=="+")break;this.next(),this.skipWhitespace()}if(this.match("\\global")){this.skipWhitespace();const re=this.get();return re.startsWith("\\")?b?{register:re,global:!0,factor:(E?-1:1)*b.number}:E?{register:re,global:!0,factor:-1}:{register:re,global:!0}:(this.index=y,null)}let ee=this.get();return ee!=null&&ee.startsWith("\\")?(ee=ee.substring(1),this.context.registers[ee]?!E||b!==null?{register:ee,factor:(E?-1:1)*((a=b==null?void 0:b.number)!=null?a:1)}:{register:ee}:(this.index=y,null)):(this.index=y,null)}scanValue(){const a=this.scanRegister();if(a)return a;const y=this.index,b=this.scanGlueOrDimen();if(b&&("unit"in b||"glue"in b&&"unit"in b.glue))return b;this.index=y;const E=this.scanNumber();if(E)return E;if(this.end()||!ka(this.peek()))return null;const ee=this.scanString();return ee.length>0?{string:ee}:null}scanDimen(){const a=this.scanNumber(!1);if(a===null)return null;const y=a.number;this.skipWhitespace(),this.matchKeyword("true"),this.skipWhitespace();let b;return this.matchKeyword("pt")?b="pt":this.matchKeyword("mm")?b="mm":this.matchKeyword("cm")?b="cm":this.matchKeyword("ex")?b="ex":this.matchKeyword("px")?b="px":this.matchKeyword("em")?b="em":this.matchKeyword("bp")?b="bp":this.matchKeyword("dd")?b="dd":this.matchKeyword("pc")?b="pc":this.matchKeyword("in")?b="in":this.matchKeyword("mu")&&(b="mu"),b?{dimension:y,unit:b}:{dimension:y}}scanGlueOrDimen(){const a=this.scanDimen();if(a===null)return null;if(this.skipWhitespace(),this.match("\\relax"))return a;const y={glue:a};if(this.matchKeyword("plus")){const b=this.scanDimen();if(b)y.grow=b;else return y}if(this.skipWhitespace(),this.match("\\relax"))return y;if(this.skipWhitespace(),this.matchKeyword("minus")){const b=this.scanDimen();if(b)y.shrink=b;else return y}return!y.grow&&!y.shrink?a:y}scanColspec(){this.skipWhitespace();const a=[];for(;!this.end()&&!(this.peek()==="<}>"||this.peek()==="]");){const y=this.get();y==="c"||y==="r"||y==="l"?a.push({align:y}):y==="|"?a.push({separator:"solid"}):y===":"?a.push({separator:"dashed"}):y==="@"&&(this.match("<{>")&&(this.beginContext({mode:"math"}),a.push({gap:this.scan(b=>b==="<}>")}),this.endContext()),this.match("<}>")||this.onError({code:"unbalanced-braces"}))}return a}scanModeSet(){let a;if(this.match("\\(")&&(a="textstyle"),!a&&this.match("\\[")&&(a="displaystyle"),!a)return null;this.beginContext({mode:"math",mathstyle:a});const y=this.scan(b=>b===(a==="displaystyle"?"\\]":"\\)"));return this.match(a==="displaystyle"?"\\]":"\\)")||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),y}scanModeShift(){let a="";if(this.match("<$>")&&(a="<$>"),!a&&this.match("<$$>")&&(a="<$$>"),!a)return null;this.beginContext({mode:"math",mathstyle:"textstyle"});const y=this.scan(b=>b===a);return this.match(a)||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),y}scanEnvironment(){if(!this.match("\\begin"))return null;const a=this.scanArgument("string");if(!a)return null;const y=ln(a);if(!y)return this.onError({code:"unknown-environment",arg:a}),null;const b=[];if(y.params)for(const ue of y.params)if(ue.isOptional)b.push(this.scanOptionalArgument(ue.type));else{const he=this.scanArgument(ue.type);he||this.onError({code:"missing-argument",arg:a}),b.push(he)}this.beginContext({tabular:y.tabular});const E=[],ee=[];let re=[],ae=!1;do if(this.end()&&(this.onError({code:"unbalanced-environment",arg:a}),ae=!0),!ae&&this.match("\\end")&&(this.scanArgument("string")!==a&&this.onError({code:"unbalanced-environment",arg:a}),ae=!0),!ae)if(this.matchColumnSeparator())re.push(this.mathlist),this.mathlist=[];else if(this.matchRowSeparator()){re.push(this.mathlist),this.mathlist=[];let ue=null;this.skipWhitespace(),this.match("[")&&(ue=this.scanDimen(),this.skipWhitespace(),this.match("]")),ee.push(ue!=null?ue:{dimension:0}),E.push(re),re=[]}else this.mathlist.push(...this.scan(ue=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline"].includes(ue)));while(!ae);return re.push(this.mathlist),re.length>0&&E.push(re),this.endContext(),y.createAtom(a,E,ee,b)}scanExpression(){const a=this.mathlist;if(this.mathlist=[],this.parseExpression()){const y=this.mathlist;return this.mathlist=a,y}return this.mathlist=a,null}scan(a){this.beginContext(),a||(a=ae=>ae==="<}>");let y="",b=null,E=[],ee=null;for(;!this.end()&&!a(this.peek());)this.hasInfixCommand()&&!y?(y=this.get(),b=Ze(y,"math"),b&&(E=this.scanArguments(b)[1]),ee=this.mathlist,this.mathlist=[]):this.parseExpression();let re;return y?(console.assert(!!b),E.unshift(this.mathlist),ee&&E.unshift(ee),re=[b.createAtom({command:y,args:E,style:this.style,mode:this.parseMode})]):re=this.mathlist,this.endContext(),re}scanGroup(){const a=this.index;if(!this.match("<{>"))return null;const y=this.scan(E=>E==="<}>");this.match("<}>")||this.onError({code:"unbalanced-braces"});const b=new Za(y,this.parseMode,this.style);return b.verbatimLatex=Ps(this.tokens.slice(a,this.index)),b}scanSmartFence(){if(this.skipWhitespace(),!this.match("("))return null;this.beginContext();let a=1;for(;!this.end()&&a!==0;)this.match("(")&&(a+=1),this.match(")")&&(a-=1),a!==0&&this.parseExpression();const y=new Ri("",this.mathlist,{leftDelim:"(",rightDelim:a===0?")":"?"});return this.endContext(),y}scanDelim(){this.skipWhitespace();const a=this.peek();if(!a)return this.onError({code:"unexpected-end-of-string"}),null;if(!ka(a)&&!a.startsWith("\\"))return null;this.next();const y=Ze(a,"math");return y?y.definitionType==="function"&&y.ifMode&&!y.ifMode.includes(this.parseMode)?(this.onError({code:"unexpected-delimiter",arg:a}),null):y.definitionType==="symbol"&&(y.type==="mopen"||y.type==="mclose")||/^(\.|\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(a)?a:(this.onError({code:"unexpected-delimiter",arg:a}),null):(this.onError({code:"unknown-command",arg:a}),null)}scanLeftRight(){var a;if(this.match("\\right"))return this.onError({code:"unbalanced-braces"}),new vo("\\right");if(this.match("\\mright"))return this.onError({code:"unbalanced-braces"}),new vo("\\mright");let y="\\right";if(!this.match("\\left")){if(!this.match("\\mleft"))return null;y="\\mright"}const b=this.scanDelim();if(!b)return this.onError({code:"unexpected-delimiter"}),new vo(y==="\\right"?"\\left":"\\mleft");for(this.beginContext();!this.end()&&!this.match(y);)this.parseExpression();const E=this.mathlist;this.endContext();const ee=(a=this.scanDelim())!=null?a:".";return new Ri(y==="\\right"?"left...right":"mleft...mright",E,{leftDelim:b,rightDelim:ee,style:this.style})}parseSupSub(){if(this.parseMode!=="math")return!1;let a=this.peek();if(a!=="^"&&a!=="_"&&a!=="'")return!1;const y=this.lastSubsupAtom();for(;a==="^"||a==="_"||a==="'";)this.match("'")?this.match("'")?y.addChild(new Dn({type:"mord",command:"\\doubleprime",mode:"math",value:"\u2032\u2032"}),"superscript"):y.addChild(new Dn({type:"mord",command:"\\prime",mode:"math",value:"\u2032"}),"superscript"):(this.match("^")||this.match("_"))&&y.addChildren(Ye(this.scanArgument("expression")),a==="_"?"subscript":"superscript"),a=this.peek();return!0}parseLimits(){if(this.parseMode!=="math")return!1;const a=this.match("\\limits"),y=!a&&this.match("\\nolimits"),b=!y&&!a&&this.match("\\displaylimits");if(!a&&!y&&!b)return!1;const E=this.mathlist.length>0?this.mathlist[this.mathlist.length-1]:null;return E===null?!1:(E.explicitSubsupPlacement=!0,a&&(E.subsupPlacement="over-under"),y&&(E.subsupPlacement="adjacent"),b&&(E.subsupPlacement="auto"),!0)}scanArguments(a){if(!(a!=null&&a.params))return[void 0,[]];let y;const b=[];let E=a.infix?2:0;for(;E<a.params.length;){const ee=a.params[E];ee.type==="rest"?b.push(this.scan(re=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline","\\right"].includes(re))):ee.isOptional?b.push(this.scanOptionalArgument(ee.type)):ee.type.endsWith("*")?y=ee.type.slice(0,-1):b.push(this.scanArgument(ee.type)),E+=1}return[y,b]}scanSymbolOrLiteral(){const a=this.peek();if(!a)return null;this.next();let y;if(ka(a)){const b=Co.createAtom(this.parseMode,a,Ce({},this.style));return b?[b]:null}if(y=this.scanMacro(a),y)return[y];if(a.startsWith("\\")){const b=Ze(a,this.parseMode);if(!b)return this.onError({code:"unknown-command",arg:a}),[new vo(a)];if(b.definitionType==="symbol"){const E=Ce({},this.style);b.variant&&(E.variant=b.variant),y=new Dn({type:b.type,command:a,style:E,value:String.fromCodePoint(b.codepoint),mode:this.parseMode,verbatimLatex:a})}else{if(b.applyMode||b.applyStyle||b.infix)return this.onError({code:"invalid-command",arg:a}),[new vo(a)];b.createAtom&&(y=b.createAtom({command:a,args:[],style:this.style,mode:this.parseMode}))}}return y?[y]:null}scanArgument(a){var y;this.skipFiller();const b=this.parseMode;if(a==="auto"&&(a=b),!this.match("<{>")){if(a==="string")return this.scanString();if(a==="value")return this.scanValue();if(a==="delim")return(y=this.scanDelim())!=null?y:".";if(a==="expression")return this.scanExpression();if(a==="math"){a!==b&&this.beginContext({mode:"math"});const ee=this.scanSymbolOrLiteral();return a!==b&&this.endContext(),ee}if(a==="text"){a!==b&&this.beginContext({mode:"text"});const ee=this.scanSymbolOrLiteral();return a!==b&&this.endContext(),ee}return a==="balanced-string"||console.assert(!1),null}if(a==="text"){this.beginContext({mode:"text"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const ee=this.mathlist;return this.endContext(),{group:ee}}if(a==="math"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const ee=this.mathlist;return this.endContext(),{group:ee}}let E=null;if(a==="expression"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const ee=this.mathlist;return this.endContext(),{group:ee}}return a==="string"?E=this.scanString():a==="balanced-string"?E=this.scanBalancedString():a==="colspec"?E=this.scanColspec():a==="value"&&(E=this.scanValue()),this.skipUntilToken("<}>"),E}scanOptionalArgument(a){if(a=a==="auto"?this.parseMode:a,this.skipFiller(),!this.match("["))return null;let y=null;for(;!this.end()&&!this.match("]");)if(a==="string")y=this.scanString();else if(a==="value")y=this.scanValue();else if(a==="colspec")y=this.scanColspec();else if(a==="bbox"){const b={},E=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const ee of E){const re=ee.match(/^\s*([\d.]+)\s*([a-z]{2})/);if(re)b.padding={dimension:parseInt(re[1]),unit:re[2]};else{const ae=ee.match(/^\s*border\s*:\s*(.*)/);ae?b.border=ae[1]:b.backgroundcolor={string:ee}}}y=b}else a==="math"&&(this.beginContext({mode:"math"}),y=this.mathlist.concat(this.scan(b=>b==="]")),this.endContext());return y}scanSymbolOrCommand(a){var y,b,E;if(a==="\\placeholder"){const ue=this.scanOptionalArgument("string"),he=this.scanOptionalArgument("math"),ge=Dn.serialize(he,{defaultMode:"math"});let be=[],Be;!Be&&ge==="correct"?Be="correct":!Be&&ge==="incorrect"?Be="incorrect":ge!==""&&(be=he);const He=this.scanOptionalArgument("string")==="locked",lt=this.scanArgument("auto");let xt;return lt&&Array.isArray(lt)&&lt.length>0?xt=lt:lt&&typeof lt=="object"&&"group"in lt?xt=lt.group:xt=be,ue?[new $s(ue,Be,He,xt!=null?xt:be,{mode:this.parseMode,style:this.style})]:[new Qr({mode:this.parseMode,style:this.style})]}if(a==="\\renewcommand"||a==="\\newcommand"||a==="\\providecommand"||a==="\\def"){const ue=this.index,he=this.scanLiteralGroup()||this.next();if(!he)return null;if(this.context.registers[he.substring(1)]){const ge=this.scanArgument("string");ge!==null&&(this.context.registers[he.substring(1)]=ge);const be=Si([a,Ps(this.tokens.slice(ue,this.index))]);return[new Dn({type:"text",value:"",verbatimLatex:be})]}}let ee=this.scanMacro(a);if(ee)return[ee];const re=Ze(a,this.parseMode);if(!re)return this.parseMode==="text"?(/[a-zA-Z]/.test((y=this.peek())!=null?y:"")&&(a+=" "),[...a].map(ue=>new Dn({type:"text",value:ue,mode:"text",style:this.style}))):(this.onError({code:"unknown-command",arg:a}),[new vo(a)]);const ae=this.index;if(re.definitionType==="symbol"){const ue=Ce({},this.style);re.variant&&(ue.variant=re.variant),ee=new Dn({type:re.type,command:a,style:ue,value:String.fromCodePoint(re.codepoint),mode:this.parseMode})}else{if(re.ifMode&&!re.ifMode.includes(this.parseMode))return[];const ue=this.parseMode;re.applyMode&&(this.parseMode=re.applyMode);let he,ge=[];if(re.parse?ge=re.parse(this):[he,ge]=this.scanArguments(re),this.parseMode=ue,re.applyMode&&!re.applyStyle&&!re.createAtom)return Ye(ge[0]);if(re.infix)return this.onError({code:"too-many-infix-commands",arg:a}),null;if(typeof re.createAtom=="function")ee=re.createAtom({command:a,args:ge,style:this.style,mode:this.parseMode}),he&&(ee.body=Ye(this.scanArgument(he)));else if(typeof re.applyStyle=="function"){const be=Ce(Ce({},this.style),re.applyStyle(a,ge,this.context)),Be=this.parseMode;if(re.applyMode&&(this.parseMode=re.applyMode),he){const He=this.style;this.style=be;const lt=this.scanArgument(he);return this.style=He,this.parseMode=Be,Ye(lt)}this.style=be}else ee=new Dn({type:"mord",command:(b=re.command)!=null?b:a,style:Ce({},this.style),value:a,mode:(E=re.applyMode)!=null?E:this.parseMode})}if(!ee)return null;if(ee instanceof Dn&&ee.verbatimLatex===void 0&&!/^\\(llap|rlap|class|cssId|htmlData)$/.test(a)){const ue=Si([a,Ps(this.tokens.slice(ae,this.index))]);ue&&(ee.verbatimLatex=ue)}if(ee.verbatimLatex===null&&(ee.verbatimLatex=void 0),ee.isFunction&&this.smartFence){const ue=this.scanSmartFence();if(ue)return[ee,ue]}return[ee]}scanSymbolCommandOrLiteral(){const a=this.get();if(!a)return null;if(ka(a)){const y=Co.createAtom(this.parseMode,a,Ce({},this.style));if(!y)return null;if(y.isFunction&&this.smartFence){const b=this.scanSmartFence();if(b)return[y,b]}return[y]}return a.startsWith("\\")?this.scanSymbolOrCommand(a):a==="<space>"?this.parseMode==="text"?[new vs(" "," ",this.style)]:null:(a==="<}>"?this.onError({latex:"",code:"unbalanced-braces"}):this.onError({latex:"",code:"unexpected-token",arg:a}),null)}scanMacro(a){var y;const b=this.context.getMacro(a);if(!b)return null;const E=this.index,ee=b.args,re={"?":(y=this.args)==null?void 0:y.call(this,"?")};for(let ae=1;ae<=ee;ae++){let ue=this.scanLiteralGroup();if(!ue){const he=this.index;this.scanExpression(),ue=Ps(this.tokens.slice(he,this.index))}re[ae]=ue}return new au(a,{expand:b.expand,captureSelection:b.captureSelection,args:E===this.index?null:Ps(this.tokens.slice(E,this.index)),style:this.parsingContext.style,body:ja(b.def,{context:this.context,parseMode:this.parseMode,args:ae=>re[ae],mathstyle:this.parsingContext.mathstyle,style:this.parsingContext.style})})}parseExpression(){var a,y,b,E;let ee=(E=(b=(y=(a=this.scanEnvironment())!=null?a:this.scanModeShift())!=null?y:this.scanModeSet())!=null?b:this.scanGroup())!=null?E:this.scanLeftRight();if(ee===null){if(this.parseSupSub()||this.parseLimits())return!0;ee=this.scanSymbolCommandOrLiteral()}return ee?(Array.isArray(ee)?this.mathlist.push(...ee):this.mathlist.push(ee),!0):!1}};function ja(a,y){var b,E,ee,re;const ae=(b=y==null?void 0:y.args)!=null?b:void 0,ue=new pl(ps(a,ae),y==null?void 0:y.context,{args:ae,mathstyle:(E=y==null?void 0:y.mathstyle)!=null?E:"displaystyle",parseMode:(ee=y==null?void 0:y.parseMode)!=null?ee:"math",style:(re=y==null?void 0:y.style)!=null?re:{}}),he=[];for(;!ue.end();)he.push(...ue.scan(()=>!1));return he}function t0(a,y){var b;const E=new pl(ps(a,null),y==null?void 0:y.context,{mathstyle:"displaystyle",parseMode:(b=y==null?void 0:y.parseMode)!=null?b:"math"});for(;!E.end();)E.scan();return E.errors}var n0=class Fp extends Dn{constructor(y,b){super({type:"chem"},{command:y,mode:"math"});const E=la.go(Yn.go(b,y==="\\pu"?"pu":"ce"),!1);this.body=ja(E),this._verbatimLatex=y+"{"+b+"}",this.arg=b,this.captureSelection=!0}static fromJson(y){return new Fp(y.command,y.arg)}set verbatimLatex(y){}get verbatimLatex(){return this._verbatimLatex}toJson(){return ke(Ce({},super.toJson()),{arg:this.arg})}render(y){const b=Dn.createBox(y,this.body,{type:"inner"});return this.caret&&(b.caret=this.caret),this.bind(y,b)}_serialize(y){return console.assert(this.verbatimLatex!==void 0),this.verbatimLatex}};yt(["ce","pu"],"{chemformula:balanced-string}",{createAtom:a=>{var y;return new n0(a.command,(y=a.args[0])!=null?y:"")}});var Yn={go:function(a,y){if(!a)return[];y===void 0&&(y="ce");var b="0",E={};E.parenthesisLevel=0,a=a.replace(/\n/g," "),a=a.replace(/[\u2212\u2013\u2014\u2010]/g,"-"),a=a.replace(/[\u2026]/g,"...");for(var ee,re=10,ae=[];;){ee!==a?(re=10,ee=a):re--;var ue=Yn.stateMachines[y],he=ue.transitions[b]||ue.transitions["*"];e:for(var ge=0;ge<he.length;ge++){var be=Yn.patterns.match_(he[ge].pattern,a);if(be){for(var Be=he[ge].task,He=0;He<Be.action_.length;He++){var lt;if(ue.actions[Be.action_[He].type_])lt=ue.actions[Be.action_[He].type_](E,be.match_,Be.action_[He].option);else if(Yn.actions[Be.action_[He].type_])lt=Yn.actions[Be.action_[He].type_](E,be.match_,Be.action_[He].option);else throw["MhchemBugA","mhchem bug A. Please report. ("+Be.action_[He].type_+")"];Yn.concatArray(ae,lt)}if(b=Be.nextState||b,a.length>0){if(Be.revisit||(a=be.remainder),!Be.toContinue)break e}else return ae}}if(re<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(a,y){if(y)if(Object.prototype.toString.call(y)==="[object Array]")for(var b=0;b<y.length;b++)a.push(y[b]);else a.push(y)},patterns:{patterns:{empty:/^$/,else:/^./,else2:/^./,space:/^\s/,"space A":/^\s(?=[A-Z\\$])/,space$:/^\s$/,"a-z":/^[a-z]/,x:/^x/,x$:/^x$/,i$:/^i$/,letters:/^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,"\\greek":/^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,"one lowercase latin letter $":/^(?:([a-z])(?:$|[^a-zA-Z]))$/,"$one lowercase latin letter$ $":/^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,"one lowercase greek letter $":/^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,digits:/^[0-9]+/,"-9.,9":/^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,"-9.,9 no missing 0":/^[+\-]?[0-9]+(?:[.,][0-9]+)?/,"(-)(9.,9)(e)(99)":function(a){var y=a.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))?(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))\))?(?:(?:([eE])|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);return y&&y[0]?{match_:y.slice(1),remainder:a.substr(y[0].length)}:null},"(-)(9)^(-9)":function(a){var y=a.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);return y&&y[0]?{match_:y.slice(1),remainder:a.substr(y[0].length)}:null},"state of aggregation $":function(a){var y=Yn.patterns.findObserveGroups(a,"",/^\([a-z]{1,3}(?=[\),])/,")","");if(y&&y.remainder.match(/^($|[\s,;\)\]\}])/))return y;var b=a.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);return b?{match_:b[0],remainder:a.substr(b[0].length)}:null},"_{(state of aggregation)}$":/^_\{(\([a-z]{1,3}\))\}/,"{[(":/^(?:\\\{|\[|\()/,")]}":/^(?:\)|\]|\\\})/,", ":/^[,;]\s*/,",":/^[,;]/,".":/^[.]/,". ":/^([.\u22C5\u00B7\u2022])\s*/,"...":/^\.\.\.(?=$|[^.])/,"* ":/^([*])\s*/,"^{(...)}":function(a){return Yn.patterns.findObserveGroups(a,"^{","","","}")},"^($...$)":function(a){return Yn.patterns.findObserveGroups(a,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(a){return Yn.patterns.findObserveGroups(a,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(a){return Yn.patterns.findObserveGroups(a,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(a){return Yn.patterns.findObserveGroups(a,"_{","","","}")},"_($...$)":function(a){return Yn.patterns.findObserveGroups(a,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(a){return Yn.patterns.findObserveGroups(a,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(a){return Yn.patterns.findObserveGroups(a,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(a){return Yn.patterns.findObserveGroups(a,"","{","}","")},"{(...)}":function(a){return Yn.patterns.findObserveGroups(a,"{","","","}")},"$...$":function(a){return Yn.patterns.findObserveGroups(a,"","$","$","")},"${(...)}$":function(a){return Yn.patterns.findObserveGroups(a,"${","","","}$")},"$(...)$":function(a){return Yn.patterns.findObserveGroups(a,"$","","","$")},"=<>":/^[=<>]/,"#":/^[#\u2261]/,"+":/^\+/,"-$":/^-(?=[\s_},;\]/]|$|\([a-z]+\))/,"-9":/^-(?=[0-9])/,"- orbital overlap":/^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,"-":/^-/,"pm-operator":/^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,operator:/^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,arrowUpDown:/^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,"\\bond{(...)}":function(a){return Yn.patterns.findObserveGroups(a,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(a){return Yn.patterns.findObserveGroups(a,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(a){return Yn.patterns.findObserveGroups(a,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(a){return Yn.patterns.findObserveGroups(a,"",/^\\[a-zA-Z]+\{/,"}","")},"\\ca":/^\\ca(?:\s+|(?![a-zA-Z]))/,"\\x":/^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,orbital:/^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,others:/^[\/~|]/,"\\frac{(...)}":function(a){return Yn.patterns.findObserveGroups(a,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(a){return Yn.patterns.findObserveGroups(a,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(a){return Yn.patterns.findObserveGroups(a,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(a){return Yn.patterns.findObserveGroups(a,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(a){return Yn.patterns.findObserveGroups(a,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(a){return Yn.patterns.findObserveGroups(a,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(a){return Yn.patterns.findObserveGroups(a,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(a){return Yn.patterns.findObserveGroups(a,"\\ce{","","","}")},oxidation$:/^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"d-oxidation$":/^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"roman numeral":/^[IVX]+/,"1/2$":/^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,amount:function(a){var y;if(y=a.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/),y)return{match_:y[0],remainder:a.substr(y[0].length)};var b=Yn.patterns.findObserveGroups(a,"","$","$","");return b&&(y=b.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/),y)?{match_:y[0],remainder:a.substr(y[0].length)}:null},amount2:function(a){return this.amount(a)},"(KV letters),":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,formula$:function(a){if(a.match(/^\([a-z]+\)$/))return null;var y=a.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return y?{match_:y[0],remainder:a.substr(y[0].length)}:null},uprightEntities:/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*[*.]\s*/},findObserveGroups:function(a,y,b,E,ee,re,ae,ue,he,ge){var be=function(fn,Rn){if(typeof Rn=="string")return fn.indexOf(Rn)!==0?null:Rn;var cr=fn.match(Rn);return cr?cr[0]:null},Be=function(fn,Rn,cr){for(var Fn=0;Rn<fn.length;){var Hr=fn.charAt(Rn),Jr=be(fn.substr(Rn),cr);if(Jr!==null&&Fn===0)return{endMatchBegin:Rn,endMatchEnd:Rn+Jr.length};if(Hr==="{")Fn++;else if(Hr==="}"){if(Fn===0)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];Fn--}Rn++}return Fn>0,null},He=be(a,y);if(He===null||(a=a.substr(He.length),He=be(a,b),He===null))return null;var lt=Be(a,He.length,E||ee);if(lt===null)return null;var xt=a.substring(0,E?lt.endMatchEnd:lt.endMatchBegin);if(re||ae){var vn=this.findObserveGroups(a.substr(lt.endMatchEnd),re,ae,ue,he);if(vn===null)return null;var nr=[xt,vn.match_];return{match_:ge?nr.join(""):nr,remainder:vn.remainder}}else return{match_:xt,remainder:a.substr(lt.endMatchEnd)}},match_:function(a,y){var b=Yn.patterns.patterns[a];if(b===void 0)throw["MhchemBugP","mhchem bug P. Please report. ("+a+")"];if(typeof b=="function")return Yn.patterns.patterns[a](y);var E=y.match(b);if(E){var ee;return E[2]?ee=[E[1],E[2]]:E[1]?ee=E[1]:ee=E[0],{match_:ee,remainder:y.substr(E[0].length)}}return null}},actions:{"a=":function(a,y){a.a=(a.a||"")+y},"b=":function(a,y){a.b=(a.b||"")+y},"p=":function(a,y){a.p=(a.p||"")+y},"o=":function(a,y){a.o=(a.o||"")+y},"q=":function(a,y){a.q=(a.q||"")+y},"d=":function(a,y){a.d=(a.d||"")+y},"rm=":function(a,y){a.rm=(a.rm||"")+y},"text=":function(a,y){a.text_=(a.text_||"")+y},insert:function(a,y,b){return{type_:b}},"insert+p1":function(a,y,b){return{type_:b,p1:y}},"insert+p1+p2":function(a,y,b){return{type_:b,p1:y[0],p2:y[1]}},copy:function(a,y){return y},rm:function(a,y){return{type_:"rm",p1:y||""}},text:function(a,y){return Yn.go(y,"text")},"{text}":function(a,y){var b=["{"];return Yn.concatArray(b,Yn.go(y,"text")),b.push("}"),b},"tex-math":function(a,y){return Yn.go(y,"tex-math")},"tex-math tight":function(a,y){return Yn.go(y,"tex-math tight")},bond:function(a,y,b){return{type_:"bond",kind_:b||y}},"color0-output":function(a,y){return{type_:"color0",color:y[0]}},ce:function(a,y){return Yn.go(y)},"1/2":function(a,y){var b=[];y.match(/^[+\-]/)&&(b.push(y.substr(0,1)),y=y.substr(1));var E=y.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);return E[1]=E[1].replace(/\$/g,""),b.push({type_:"frac",p1:E[1],p2:E[2]}),E[3]&&(E[3]=E[3].replace(/\$/g,""),b.push({type_:"tex-math",p1:E[3]})),b},"9,9":function(a,y){return Yn.go(y,"9,9")}},createTransitions:function(a){var y,b,E,ee,re={};for(y in a)for(b in a[y])for(E=b.split("|"),a[y][b].stateArray=E,ee=0;ee<E.length;ee++)re[E[ee]]=[];for(y in a)for(b in a[y])for(E=a[y][b].stateArray||[],ee=0;ee<E.length;ee++){var ae=a[y][b];if(ae.action_){ae.action_=[].concat(ae.action_);for(var ue=0;ue<ae.action_.length;ue++)typeof ae.action_[ue]=="string"&&(ae.action_[ue]={type_:ae.action_[ue]})}else ae.action_=[];for(var he=y.split("|"),ge=0;ge<he.length;ge++)if(E[ee]==="*")for(var be in re)re[be].push({pattern:he[ge],task:ae});else re[E[ee]].push({pattern:he[ge],task:ae})}return re},stateMachines:{}};Yn.stateMachines={ce:{transitions:Yn.createTransitions({empty:{"*":{action_:"output"}},else:{"0|1|2":{action_:"beginsWithBond=false",revisit:!0,toContinue:!0}},oxidation$:{0:{action_:"oxidation-output"}},CMT:{r:{action_:"rdt=",nextState:"rt"},rd:{action_:"rqt=",nextState:"rdt"}},arrowUpDown:{"0|1|2|as":{action_:["sb=false","output","operator"],nextState:"1"}},uprightEntities:{"0|1|2":{action_:["o=","output"],nextState:"1"}},orbital:{"0|1|2|3":{action_:"o=",nextState:"o"}},"->":{"0|1|2|3":{action_:"r=",nextState:"r"},"a|as":{action_:["output","r="],nextState:"r"},"*":{action_:["output","r="],nextState:"r"}},"+":{o:{action_:"d= kv",nextState:"d"},"d|D":{action_:"d=",nextState:"d"},q:{action_:"d=",nextState:"qd"},"qd|qD":{action_:"d=",nextState:"qd"},dq:{action_:["output","d="],nextState:"d"},3:{action_:["sb=false","output","operator"],nextState:"0"}},amount:{"0|2":{action_:"a=",nextState:"a"}},"pm-operator":{"0|1|2|a|as":{action_:["sb=false","output",{type_:"operator",option:"\\pm"}],nextState:"0"}},operator:{"0|1|2|a|as":{action_:["sb=false","output","operator"],nextState:"0"}},"-$":{"o|q":{action_:["charge or bond","output"],nextState:"qd"},d:{action_:"d=",nextState:"d"},D:{action_:["output",{type_:"bond",option:"-"}],nextState:"3"},q:{action_:"d=",nextState:"qd"},qd:{action_:"d=",nextState:"qd"},"qD|dq":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},"-9":{"3|o":{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"3"}},"- orbital overlap":{o:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},d:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"}},"-":{"0|1|2":{action_:[{type_:"output",option:1},"beginsWithBond=true",{type_:"bond",option:"-"}],nextState:"3"},3:{action_:{type_:"bond",option:"-"}},a:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},as:{action_:[{type_:"output",option:2},{type_:"bond",option:"-"}],nextState:"3"},b:{action_:"b="},o:{action_:{type_:"- after o/d",option:!1},nextState:"2"},q:{action_:{type_:"- after o/d",option:!1},nextState:"2"},"d|qd|dq":{action_:{type_:"- after o/d",option:!0},nextState:"2"},"D|qD|p":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},amount2:{"1|3":{action_:"a=",nextState:"a"}},letters:{"0|1|2|3|a|as|b|p|bp|o":{action_:"o=",nextState:"o"},"q|dq":{action_:["output","o="],nextState:"o"},"d|D|qd|qD":{action_:"o after d",nextState:"o"}},digits:{o:{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},q:{action_:["output","o="],nextState:"o"},a:{action_:"o=",nextState:"o"}},"space A":{"b|p|bp":{}},space:{a:{nextState:"as"},0:{action_:"sb=false"},"1|2":{action_:"sb=true"},"r|rt|rd|rdt|rdq":{action_:"output",nextState:"0"},"*":{action_:["output","sb=true"],nextState:"1"}},"1st-level escape":{"1|2":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}]},"*":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}],nextState:"0"}},"[(...)]":{"r|rt":{action_:"rd=",nextState:"rd"},"rd|rdt":{action_:"rq=",nextState:"rdq"}},"...":{"o|d|D|dq|qd|qD":{action_:["output",{type_:"bond",option:"..."}],nextState:"3"},"*":{action_:[{type_:"output",option:1},{type_:"insert",option:"ellipsis"}],nextState:"1"}},". |* ":{"*":{action_:["output",{type_:"insert",option:"addition compound"}],nextState:"1"}},"state of aggregation $":{"*":{action_:["output","state of aggregation"],nextState:"1"}},"{[(":{"a|as|o":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"0|1|2|3":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"*":{action_:["output","o=","output","parenthesisLevel++"],nextState:"2"}},")]}":{"0|1|2|3|b|p|bp|o":{action_:["o=","parenthesisLevel--"],nextState:"o"},"a|as|d|D|q|qd|qD|dq":{action_:["output","o=","parenthesisLevel--"],nextState:"o"}},", ":{"*":{action_:["output","comma"],nextState:"0"}},"^_":{"*":{}},"^{(...)}|^($...$)":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"D"},q:{action_:"d=",nextState:"qD"},"d|D|qd|qD|dq":{action_:["output","d="],nextState:"D"}},"^a|^\\x{}{}|^\\x{}|^\\x|'":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"d"},q:{action_:"d=",nextState:"qd"},"d|qd|D|qD":{action_:"d="},dq:{action_:["output","d="],nextState:"d"}},"_{(state of aggregation)}$":{"d|D|q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x":{"0|1|2|as":{action_:"p=",nextState:"p"},b:{action_:"p=",nextState:"bp"},"3|o":{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},"q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"=<>":{"0|1|2|3|a|as|o|q|d|D|qd|qD|dq":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"#":{"0|1|2|3|a|as|o":{action_:[{type_:"output",option:2},{type_:"bond",option:"#"}],nextState:"3"}},"{}":{"*":{action_:{type_:"output",option:1},nextState:"1"}},"{...}":{"0|1|2|3|a|as|b|p|bp":{action_:"o=",nextState:"o"},"o|d|D|q|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"$...$":{a:{action_:"a="},"0|1|2|3|as|b|p|bp|o":{action_:"o=",nextState:"o"},"as|o":{action_:"o="},"q|d|D|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"\\bond{(...)}":{"*":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"\\frac{(...)}":{"*":{action_:[{type_:"output",option:1},"frac-output"],nextState:"3"}},"\\overset{(...)}":{"*":{action_:[{type_:"output",option:2},"overset-output"],nextState:"3"}},"\\underset{(...)}":{"*":{action_:[{type_:"output",option:2},"underset-output"],nextState:"3"}},"\\underbrace{(...)}":{"*":{action_:[{type_:"output",option:2},"underbrace-output"],nextState:"3"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:[{type_:"output",option:2},"color-output"],nextState:"3"}},"\\color{(...)}0":{"*":{action_:[{type_:"output",option:2},"color0-output"]}},"\\ce{(...)}":{"*":{action_:[{type_:"output",option:2},"ce"],nextState:"3"}},"\\,":{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"1"}},"\\x{}{}|\\x{}|\\x":{"0|1|2|3|a|as|b|p|bp|o|c0":{action_:["o=","output"],nextState:"3"},"*":{action_:["output","o=","output"],nextState:"3"}},others:{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"3"}},else2:{a:{action_:"a to o",nextState:"o",revisit:!0},as:{action_:["output","sb=true"],nextState:"1",revisit:!0},"r|rt|rd|rdt|rdq":{action_:["output"],nextState:"0",revisit:!0},"*":{action_:["output","copy"],nextState:"3"}}}),actions:{"o after d":function(a,y){var b;if((a.d||"").match(/^[0-9]+$/)){var E=a.d;a.d=void 0,b=this.output(a),a.b=E}else b=this.output(a);return Yn.actions["o="](a,y),b},"d= kv":function(a,y){a.d=y,a.dType="kv"},"charge or bond":function(a,y){if(a.beginsWithBond){var b=[];return Yn.concatArray(b,this.output(a)),Yn.concatArray(b,Yn.actions.bond(a,y,"-")),b}else a.d=y},"- after o/d":function(a,y,b){var E=Yn.patterns.match_("orbital",a.o||""),ee=Yn.patterns.match_("one lowercase greek letter $",a.o||""),re=Yn.patterns.match_("one lowercase latin letter $",a.o||""),ae=Yn.patterns.match_("$one lowercase latin letter$ $",a.o||""),ue=y==="-"&&(E&&E.remainder===""||ee||re||ae);ue&&!a.a&&!a.b&&!a.p&&!a.d&&!a.q&&!E&&re&&(a.o="$"+a.o+"$");var he=[];return ue?(Yn.concatArray(he,this.output(a)),he.push({type_:"hyphen"})):(E=Yn.patterns.match_("digits",a.d||""),b&&E&&E.remainder===""?(Yn.concatArray(he,Yn.actions["d="](a,y)),Yn.concatArray(he,this.output(a))):(Yn.concatArray(he,this.output(a)),Yn.concatArray(he,Yn.actions.bond(a,y,"-")))),he},"a to o":function(a){a.o=a.a,a.a=void 0},"sb=true":function(a){a.sb=!0},"sb=false":function(a){a.sb=!1},"beginsWithBond=true":function(a){a.beginsWithBond=!0},"beginsWithBond=false":function(a){a.beginsWithBond=!1},"parenthesisLevel++":function(a){a.parenthesisLevel++},"parenthesisLevel--":function(a){a.parenthesisLevel--},"state of aggregation":function(a,y){return{type_:"state of aggregation",p1:Yn.go(y,"o")}},comma:function(a,y){var b=y.replace(/\s*$/,""),E=b!==y;return E&&a.parenthesisLevel===0?{type_:"comma enumeration L",p1:b}:{type_:"comma enumeration M",p1:b}},output:function(a,y,b){var E;if(!a.r)E=[],!a.a&&!a.b&&!a.p&&!a.o&&!a.q&&!a.d&&!b||(a.sb&&E.push({type_:"entitySkip"}),!a.o&&!a.q&&!a.d&&!a.b&&!a.p&&b!==2?(a.o=a.a,a.a=void 0):!a.o&&!a.q&&!a.d&&(a.b||a.p)?(a.o=a.a,a.d=a.b,a.q=a.p,a.a=a.b=a.p=void 0):a.o&&a.dType==="kv"&&Yn.patterns.match_("d-oxidation$",a.d||"")?a.dType="oxidation":a.o&&a.dType==="kv"&&!a.q&&(a.dType=void 0),E.push({type_:"chemfive",a:Yn.go(a.a,"a"),b:Yn.go(a.b,"bd"),p:Yn.go(a.p,"pq"),o:Yn.go(a.o,"o"),q:Yn.go(a.q,"pq"),d:Yn.go(a.d,a.dType==="oxidation"?"oxidation":"bd"),dType:a.dType}));else{var ee;a.rdt==="M"?ee=Yn.go(a.rd,"tex-math"):a.rdt==="T"?ee=[{type_:"text",p1:a.rd||""}]:ee=Yn.go(a.rd);var re;a.rqt==="M"?re=Yn.go(a.rq,"tex-math"):a.rqt==="T"?re=[{type_:"text",p1:a.rq||""}]:re=Yn.go(a.rq),E={type_:"arrow",r:a.r,rd:ee,rq:re}}for(var ae in a)ae!=="parenthesisLevel"&&ae!=="beginsWithBond"&&delete a[ae];return E},"oxidation-output":function(a,y){var b=["{"];return Yn.concatArray(b,Yn.go(y,"oxidation")),b.push("}"),b},"frac-output":function(a,y){return{type_:"frac-ce",p1:Yn.go(y[0]),p2:Yn.go(y[1])}},"overset-output":function(a,y){return{type_:"overset",p1:Yn.go(y[0]),p2:Yn.go(y[1])}},"underset-output":function(a,y){return{type_:"underset",p1:Yn.go(y[0]),p2:Yn.go(y[1])}},"underbrace-output":function(a,y){return{type_:"underbrace",p1:Yn.go(y[0]),p2:Yn.go(y[1])}},"color-output":function(a,y){return{type_:"color",color1:y[0],color2:Yn.go(y[1])}},"r=":function(a,y){a.r=y},"rdt=":function(a,y){a.rdt=y},"rd=":function(a,y){a.rd=y},"rqt=":function(a,y){a.rqt=y},"rq=":function(a,y){a.rq=y},operator:function(a,y,b){return{type_:"operator",kind_:b||y}}}},a:{transitions:Yn.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},"$(...)$":{"*":{action_:"tex-math tight",nextState:"1"}},",":{"*":{action_:{type_:"insert",option:"commaDecimal"}}},else2:{"*":{action_:"copy"}}}),actions:{}},o:{transitions:Yn.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},letters:{"*":{action_:"rm"}},"\\ca":{"*":{action_:{type_:"insert",option:"circa"}}},"\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"{text}"}},else2:{"*":{action_:"copy"}}}),actions:{}},text:{transitions:Yn.createTransitions({empty:{"*":{action_:"output"}},"{...}":{"*":{action_:"text="}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"\\greek":{"*":{action_:["output","rm"]}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:["output","copy"]}},else:{"*":{action_:"text="}}}),actions:{output:function(a){if(a.text_){var y={type_:"text",p1:a.text_};for(var b in a)delete a[b];return y}}}},pq:{transitions:Yn.createTransitions({empty:{"*":{}},"state of aggregation $":{"*":{action_:"state of aggregation"}},i$:{0:{nextState:"!f",revisit:!0}},"(KV letters),":{0:{action_:"rm",nextState:"0"}},formula$:{0:{nextState:"f",revisit:!0}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"!f",revisit:!0}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"a-z":{f:{action_:"tex-math"}},letters:{"*":{action_:"rm"}},"-9.,9":{"*":{action_:"9,9"}},",":{"*":{action_:{type_:"insert+p1",option:"comma enumeration S"}}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"state of aggregation":function(a,y){return{type_:"state of aggregation subscript",p1:Yn.go(y,"o")}},"color-output":function(a,y){return{type_:"color",color1:y[0],color2:Yn.go(y[1],"pq")}}}},bd:{transitions:Yn.createTransitions({empty:{"*":{}},x$:{0:{nextState:"!f",revisit:!0}},formula$:{0:{nextState:"f",revisit:!0}},else:{0:{nextState:"!f",revisit:!0}},"-9.,9 no missing 0":{"*":{action_:"9,9"}},".":{"*":{action_:{type_:"insert",option:"electron dot"}}},"a-z":{f:{action_:"tex-math"}},x:{"*":{action_:{type_:"insert",option:"KV x"}}},letters:{"*":{action_:"rm"}},"'":{"*":{action_:{type_:"insert",option:"prime"}}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"color-output":function(a,y){return{type_:"color",color1:y[0],color2:Yn.go(y[1],"bd")}}}},oxidation:{transitions:Yn.createTransitions({empty:{"*":{}},"roman numeral":{"*":{action_:"roman-numeral"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},else:{"*":{action_:"copy"}}}),actions:{"roman-numeral":function(a,y){return{type_:"roman numeral",p1:y||""}}}},"tex-math":{transitions:Yn.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},else:{"*":{action_:"o="}}}),actions:{output:function(a){if(a.o){var y={type_:"tex-math",p1:a.o};for(var b in a)delete a[b];return y}}}},"tex-math tight":{transitions:Yn.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},"-|+":{"*":{action_:"tight operator"}},else:{"*":{action_:"o="}}}),actions:{"tight operator":function(a,y){a.o=(a.o||"")+"{"+y+"}"},output:function(a){if(a.o){var y={type_:"tex-math",p1:a.o};for(var b in a)delete a[b];return y}}}},"9,9":{transitions:Yn.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:Yn.createTransitions({empty:{"*":{action_:"output"}},space$:{"*":{action_:["output","space"]}},"{[(|)]}":{"0|a":{action_:"copy"}},"(-)(9)^(-9)":{0:{action_:"number^",nextState:"a"}},"(-)(9.,9)(e)(99)":{0:{action_:"enumber",nextState:"a"}},space:{"0|a":{}},"pm-operator":{"0|a":{action_:{type_:"operator",option:"\\pm"},nextState:"0"}},operator:{"0|a":{action_:"copy",nextState:"0"}},"//":{d:{action_:"o=",nextState:"/"}},"/":{d:{action_:"o=",nextState:"/"}},"{...}|else":{"0|d":{action_:"d=",nextState:"d"},a:{action_:["space","d="],nextState:"d"},"/|q":{action_:"q=",nextState:"q"}}}),actions:{enumber:function(a,y){var b=[];return y[0]==="+-"||y[0]==="+/-"?b.push("\\pm "):y[0]&&b.push(y[0]),y[1]&&(Yn.concatArray(b,Yn.go(y[1],"pu-9,9")),y[2]&&(y[2].match(/[,.]/)?Yn.concatArray(b,Yn.go(y[2],"pu-9,9")):b.push(y[2])),(y[3]||y[4])&&(y[3]==="e"||y[4]==="*"?b.push({type_:"cdot"}):b.push({type_:"times"}))),y[5]&&b.push("10^{"+y[5]+"}"),b},"number^":function(a,y){var b=[];return y[0]==="+-"||y[0]==="+/-"?b.push("\\pm "):y[0]&&b.push(y[0]),Yn.concatArray(b,Yn.go(y[1],"pu-9,9")),b.push("^{"+y[2]+"}"),b},operator:function(a,y,b){return{type_:"operator",kind_:b||y}},space:function(){return{type_:"pu-space-1"}},output:function(a){var y,b=Yn.patterns.match_("{(...)}",a.d||"");b&&b.remainder===""&&(a.d=b.match_);var E=Yn.patterns.match_("{(...)}",a.q||"");if(E&&E.remainder===""&&(a.q=E.match_),a.d&&(a.d=a.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),a.d=a.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),a.q){a.q=a.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),a.q=a.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F");var ee={d:Yn.go(a.d,"pu"),q:Yn.go(a.q,"pu")};a.o==="//"?y={type_:"pu-frac",p1:ee.d,p2:ee.q}:(y=ee.d,ee.d.length>1||ee.q.length>1?y.push({type_:" / "}):y.push({type_:"/"}),Yn.concatArray(y,ee.q))}else y=Yn.go(a.d,"pu-2");for(var re in a)delete a[re];return y}}},"pu-2":{transitions:Yn.createTransitions({empty:{"*":{action_:"output"}},"*":{"*":{action_:["output","cdot"],nextState:"0"}},"\\x":{"*":{action_:"rm="}},space:{"*":{action_:["output","space"],nextState:"0"}},"^{(...)}|^(-1)":{1:{action_:"^(-1)"}},"-9.,9":{0:{action_:"rm=",nextState:"0"},1:{action_:"^(-1)",nextState:"0"}},"{...}|else":{"*":{action_:"rm=",nextState:"1"}}}),actions:{cdot:function(){return{type_:"tight cdot"}},"^(-1)":function(a,y){a.rm+="^{"+y+"}"},space:function(){return{type_:"pu-space-2"}},output:function(a){var y=[];if(a.rm){var b=Yn.patterns.match_("{(...)}",a.rm||"");b&&b.remainder===""?y=Yn.go(b.match_,"pu"):y={type_:"rm",p1:a.rm}}for(var E in a)delete a[E];return y}}},"pu-9,9":{transitions:Yn.createTransitions({empty:{0:{action_:"output-0"},o:{action_:"output-o"}},",":{0:{action_:["output-0","comma"],nextState:"o"}},".":{0:{action_:["output-0","copy"],nextState:"o"}},else:{"*":{action_:"text="}}}),actions:{comma:function(){return{type_:"commaDecimal"}},"output-0":function(a){var y=[];if(a.text_=a.text_||"",a.text_.length>4){var b=a.text_.length%3;b===0&&(b=3);for(var E=a.text_.length-3;E>0;E-=3)y.push(a.text_.substr(E,3)),y.push({type_:"1000 separator"});y.push(a.text_.substr(0,b)),y.reverse()}else y.push(a.text_);for(var ee in a)delete a[ee];return y},"output-o":function(a){var y=[];if(a.text_=a.text_||"",a.text_.length>4){for(var b=a.text_.length-3,E=0;E<b;E+=3)y.push(a.text_.substr(E,3)),y.push({type_:"1000 separator"});y.push(a.text_.substr(E))}else y.push(a.text_);for(var ee in a)delete a[ee];return y}}}};var la={go:function(a,y){if(!a)return"";for(var b="",E=!1,ee=0;ee<a.length;ee++){var re=a[ee];typeof re=="string"?b+=re:(b+=la._go2(re),re.type_==="1st-level escape"&&(E=!0))}return!y&&!E&&b&&(b="{"+b+"}"),b},_goInner:function(a){return a&&la.go(a,!0)},_go2:function(a){var y;switch(a.type_){case"chemfive":y="";var b={a:la._goInner(a.a),b:la._goInner(a.b),p:la._goInner(a.p),o:la._goInner(a.o),q:la._goInner(a.q),d:la._goInner(a.d)};b.a&&(b.a.match(/^[+\-]/)&&(b.a="{"+b.a+"}"),y+=b.a+"\\,"),(b.b||b.p)&&(y+="{\\vphantom{X}}",y+="^{\\hphantom{"+(b.b||"")+"}}_{\\hphantom{"+(b.p||"")+"}}",y+="{\\vphantom{X}}",y+="^{\\smash[t]{\\vphantom{2}}\\llap{"+(b.b||"")+"}}",y+="_{\\vphantom{2}\\llap{\\smash[t]{"+(b.p||"")+"}}}"),b.o&&(b.o.match(/^[+\-]/)&&(b.o="{"+b.o+"}"),y+=b.o),a.dType==="kv"?((b.d||b.q)&&(y+="{\\vphantom{X}}"),b.d&&(y+="^{"+b.d+"}"),b.q&&(y+="_{\\smash[t]{"+b.q+"}}")):a.dType==="oxidation"?(b.d&&(y+="{\\vphantom{X}}",y+="^{"+b.d+"}"),b.q&&(y+="{\\vphantom{X}}",y+="_{\\smash[t]{"+b.q+"}}")):(b.q&&(y+="{\\vphantom{X}}",y+="_{\\smash[t]{"+b.q+"}}"),b.d&&(y+="{\\vphantom{X}}",y+="^{"+b.d+"}"));break;case"rm":y="\\mathrm{"+a.p1+"}";break;case"text":a.p1.match(/[\^_]/)?(a.p1=a.p1.replace(" ","~").replace("-","\\text{-}"),y="\\mathrm{"+a.p1+"}"):y="\\text{"+a.p1+"}";break;case"roman numeral":y="\\mathrm{"+a.p1+"}";break;case"state of aggregation":y="\\mskip2mu "+la._goInner(a.p1);break;case"state of aggregation subscript":y="\\mskip1mu "+la._goInner(a.p1);break;case"bond":if(y=la._getBond(a.kind_),!y)throw["MhchemErrorBond","mhchem Error. Unknown bond type ("+a.kind_+")"];break;case"frac":var E="\\frac{"+a.p1+"}{"+a.p2+"}";y="\\mathchoice{\\textstyle"+E+"}{"+E+"}{"+E+"}{"+E+"}";break;case"pu-frac":var ee="\\frac{"+la._goInner(a.p1)+"}{"+la._goInner(a.p2)+"}";y="\\mathchoice{\\textstyle"+ee+"}{"+ee+"}{"+ee+"}{"+ee+"}";break;case"tex-math":y=a.p1+" ";break;case"frac-ce":y="\\frac{"+la._goInner(a.p1)+"}{"+la._goInner(a.p2)+"}";break;case"overset":y="\\overset{"+la._goInner(a.p1)+"}{"+la._goInner(a.p2)+"}";break;case"underset":y="\\underset{"+la._goInner(a.p1)+"}{"+la._goInner(a.p2)+"}";break;case"underbrace":y="\\underbrace{"+la._goInner(a.p1)+"}_{"+la._goInner(a.p2)+"}";break;case"color":y="{\\color{"+a.color1+"}{"+la._goInner(a.color2)+"}}";break;case"color0":y="\\color{"+a.color+"}";break;case"arrow":var re={rd:la._goInner(a.rd),rq:la._goInner(a.rq)},ae=la._getArrow(a.r);re.rd||re.rq?a.r==="<=>"||a.r==="<=>>"||a.r==="<<=>"||a.r==="<-->"?(ae="\\long"+ae,re.rd&&(ae="\\overset{"+re.rd+"}{"+ae+"}"),re.rq&&(a.r==="<-->"?ae="\\underset{\\lower2mu{"+re.rq+"}}{"+ae+"}":ae="\\underset{\\lower6mu{"+re.rq+"}}{"+ae+"}"),ae=" {}\\mathrel{"+ae+"}{} "):(re.rq&&(ae+="[{"+re.rq+"}]"),ae+="{"+re.rd+"}",ae=" {}\\mathrel{\\x"+ae+"}{} "):ae=" {}\\mathrel{\\long"+ae+"}{} ",y=ae;break;case"operator":y=la._getOperator(a.kind_);break;case"1st-level escape":y=a.p1+" ";break;case"space":y=" ";break;case"entitySkip":y="~";break;case"pu-space-1":y="~";break;case"pu-space-2":y="\\mkern3mu ";break;case"1000 separator":y="\\mkern2mu ";break;case"commaDecimal":y="{,}";break;case"comma enumeration L":y="{"+a.p1+"}\\mkern6mu ";break;case"comma enumeration M":y="{"+a.p1+"}\\mkern3mu ";break;case"comma enumeration S":y="{"+a.p1+"}\\mkern1mu ";break;case"hyphen":y="\\text{-}";break;case"addition compound":y="\\,{\\cdot}\\,";break;case"electron dot":y="\\mkern1mu \\bullet\\mkern1mu ";break;case"KV x":y="{\\times}";break;case"prime":y="\\prime ";break;case"cdot":y="\\cdot ";break;case"tight cdot":y="\\mkern1mu{\\cdot}\\mkern1mu ";break;case"times":y="\\times ";break;case"circa":y="{\\sim}";break;case"^":y="uparrow";break;case"v":y="downarrow";break;case"ellipsis":y="\\ldots ";break;case"/":y="/";break;case" / ":y="\\,/\\,";break;default:throw["MhchemBugT","mhchem bug T. Please report."]}return y},_getArrow:function(a){switch(a){case"->":return"rightarrow";case"\u2192":return"rightarrow";case"\u27F6":return"rightarrow";case"<-":return"leftarrow";case"<->":return"leftrightarrow";case"<-->":return"leftrightarrows";case"<=>":return"rightleftharpoons";case"\u21CC":return"rightleftharpoons";case"<=>>":return"Rightleftharpoons";case"<<=>":return"Leftrightharpoons";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getBond:function(a){switch(a){case"-":return"{-}";case"1":return"{-}";case"=":return"{=}";case"2":return"{=}";case"#":return"{\\equiv}";case"3":return"{\\equiv}";case"~":return"{\\tripledash}";case"~-":return"{\\rlap{\\lower.1em{-}}\\raise.1em{\\tripledash}}";case"~=":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";case"~--":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";case"-~-":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{-}}\\tripledash}";case"...":return"{{\\cdot}{\\cdot}{\\cdot}}";case"....":return"{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";case"->":return"{\\rightarrow}";case"<-":return"{\\leftarrow}";case"<":return"{<}";case">":return"{>}";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getOperator:function(a){switch(a){case"+":return" {}+{} ";case"-":return" {}-{} ";case"=":return" {}={} ";case"<":return" {}<{} ";case">":return" {}>{} ";case"<<":return" {}\\ll{} ";case">>":return" {}\\gg{} ";case"\\pm":return" {}\\pm{} ";case"\\approx":return" {}\\approx{} ";case"$\\approx$":return" {}\\approx{} ";case"v":return" \\downarrow{} ";case"(v)":return" \\downarrow{} ";case"^":return" \\uparrow{} ";case"(^)":return" \\uparrow{} ";default:throw["MhchemBugT","mhchem bug T. Please report."]}}};function _1(a){}function k1(a){}var r0=class zp extends Dn{constructor(y){super(ke(Ce({},y),{type:"delim"})),this.value=y.delim,this.size=y.size}static fromJson(y){return new zp(y)}toJson(){return ke(Ce({},super.toJson()),{delim:this.value,size:this.size})}render(y){return new ir(this.value,{type:"middle"})}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Ze(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):ra(this.command,this.value)}},i0=class Kp extends Dn{constructor(y){super(ke(Ce({},y),{type:"sizeddelim",value:y.delim})),this.delimType=y.delimType,this.size=y.size}static fromJson(y){return new Kp(y)}toJson(){return ke(Ce({},super.toJson()),{delim:this.value,size:this.size,delimType:this.delimType})}render(y){let b=on(this.value,this.size,y,{classes:{open:"mopen",close:"mclose"}[this.delimType],type:this.delimType,isSelected:this.isSelected});return b?(b=this.bind(y,b),this.caret&&(b.caret=this.caret),b):null}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Ze(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):ra(this.command,this.value)}},cd=class Hp extends Dn{constructor(y,b,E,ee){var re,ae;super({type:"enclose",command:y,style:ee.style}),this.body=b,this.backgroundcolor=ee.backgroundcolor,E.updiagonalarrow&&(E.updiagonalstrike=!1),E.box&&(E.left=!1,E.right=!1,E.bottom=!1,E.top=!1),this.notation=E,this.shadow=(re=ee.shadow)!=null?re:"none",this.strokeWidth=(ae=ee.strokeWidth)!=null?ae:"0.06em",this.strokeWidth||(this.strokeWidth="0.06em"),this.strokeStyle=ee.strokeStyle,this.svgStrokeStyle=ee.svgStrokeStyle,this.strokeColor=ee.strokeColor,this.borderStyle=ee.borderStyle,this.padding=ee.padding,this.captureSelection=!1}static fromJson(y){return new Hp(y.command,y.body,y.notation,y)}toJson(){return ke(Ce({},super.toJson()),{notation:this.notation,shadow:this.shadow,strokeWidth:this.strokeWidth,strokeStyle:this.strokeStyle,svgStrokeStyle:this.svgStrokeStyle,strokeColor:this.strokeColor,borderStyle:this.borderStyle,padding:this.padding})}_serialize(y){var b;if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const E=Ze(this.command,this.mode);if(E!=null&&E.serialize)return E.serialize(this,y);let ee=(b=this.command)!=null?b:"";if(this.command==="\\enclose"){ee+="{"+Object.keys(this.notation).join(" ")+"}";let re="",ae="";this.backgroundcolor&&this.backgroundcolor!=="transparent"&&(re+=ae+'mathbackground="'+this.backgroundcolor+'"',ae=","),this.shadow&&this.shadow!=="auto"&&(re+=ae+'shadow="'+this.shadow+'"',ae=","),this.strokeWidth||this.strokeStyle!=="solid"?(re+=ae+this.borderStyle,ae=","):this.strokeColor&&this.strokeColor!=="currentColor"&&(re+=ae+'mathcolor="'+this.strokeColor+'"',ae=","),re&&(ee+=`[${re}]`)}return ra(ee,this.bodyToLatex(y))}render(y){const b=new Di({parent:y},this.style),E=Dn.createBox(b,this.body);if(!E)return null;const ee=im(this.borderStyle),re=b.toEm(!this.padding||this.padding==="auto"?{register:"fboxsep"}:{string:this.padding});E.setStyle("position","relative"),E.setStyle("display","inline-block"),E.setStyle("top",re,"em"),E.setStyle("height",E.height+E.depth,"em"),E.setStyle("width",E.width,"em");const ae=new ir(null,{classes:"ML__notation"});let ue=E.height+E.depth+2*re;const he=E.width+2*re;let ge="";if(this.notation.horizontalstrike&&(ge+=this.line(3,50,97,50)),this.notation.verticalstrike&&(ge+=this.line(50,3,50,97)),this.notation.updiagonalstrike&&(ge+=this.line(3,97,97,3)),this.notation.downdiagonalstrike&&(ge+=this.line(3,3,97,97)),this.notation.updiagonalarrow){ge+=this.line(re.toString(),(re+E.depth+E.height).toString(),(re+E.width).toString(),re.toString());const xt=.03*Math.sqrt(he*he+ue*ue)*1,vn=E.width*xt,nr=(E.depth+E.height)*xt,fn=re+E.width;let Rn=re;Rn+nr-.4*vn<0&&(Rn=.4*vn-nr),ge+='<polygon points="',ge+=`${fn},${Rn} ${fn-vn-.4*nr},${Rn+nr-.4*vn} `,ge+=`${fn-.7*vn},${Rn+.7*nr} ${fn-vn+.4*nr},${Rn+nr+.4*vn} `,ge+=`${fn},${Rn}`,ge+=`" stroke='none' fill="${this.strokeColor}"`,ge+="/>"}let be=0;if(this.notation.phasorangle){const He=a0(b),lt=(E.height+E.depth+2*He+re).toString(),xt=(E.height+E.depth)/2;ge+=this.line(re.toString(),lt,(re+xt+E.width).toString(),lt),ge+=this.line(re.toString(),lt,(re+xt).toString(),(re-He).toString()),ue+=He,be=xt,E.left+=ue/2-re}if(this.notation.longdiv){const He=a0(b);ue+=He,ge+=this.line(re.toString(),re.toString(),(re+E.width).toString(),re.toString());const lt=.3;be=lt+He,E.left+=lt+He,E.setTop(re+He),ge+='<path d="',ge+=`M ${re} ${re} a${lt} ${(E.depth+E.height+2*He)/2}, 0, 1, 1, 0 ${E.depth+E.height+2*He} "`,ge+=` stroke-width="${am(b)}" stroke="${this.strokeColor}" fill="none"`,ge+="/>"}if(ae.width=E.width+2*re+be,ae.height=E.height+re,ae.depth=E.depth+re,ae.setStyle("box-sizing","border-box"),ae.setStyle("left",`calc(-${ee} / 2 )`),ae.setStyle("height",`${Math.floor(100*ue)/100}em`),ae.setStyle("top",`calc(${ee} / 2 )`),this.backgroundcolor&&ae.setStyle("background-color",this.backgroundcolor),this.notation.box&&ae.setStyle("border","1px solid red"),this.notation.actuarial&&(ae.setStyle("border-top",this.borderStyle),ae.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(ae.setStyle("border-bottom",this.borderStyle),ae.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(ae.setStyle("border-radius","8px"),ae.setStyle("border",this.borderStyle)),this.notation.circle&&(ae.setStyle("border-radius","50%"),ae.setStyle("border",this.borderStyle)),this.notation.top&&ae.setStyle("border-top",this.borderStyle),this.notation.left&&ae.setStyle("border-left",this.borderStyle),this.notation.right&&ae.setStyle("border-right",this.borderStyle),this.notation.bottom&&ae.setStyle("border-bottom",this.borderStyle),ge){let He="";this.shadow==="auto"&&(He+="filter: drop-shadow(0 0 .5px rgba(255, 255, 255, .7)) drop-shadow(1px 1px 2px #333)"),this.shadow!=="none"&&(He+=`filter: drop-shadow(${this.shadow})`),He+=` stroke-width="${this.strokeWidth}" stroke="${this.strokeColor}"`,He+=' stroke-linecap="round"',this.svgStrokeStyle&&(He+=` stroke-dasharray="${this.svgStrokeStyle}"`),ae.svgStyle=He,ae.svgOverlay=ge}const Be=new ir([ae,E]);return Be.setStyle("position","relative"),Be.setStyle("vertical-align",re,"em"),Be.setStyle("height",`${Math.floor(100*(E.height+E.depth+2*re))/100}em`),Be.setStyle("display","inline-block"),Be.height=ae.height,Be.depth=ae.depth,Be.width=ae.width-2*re,Be.left=re,Be.right=re,this.caret&&(Be.caret=this.caret),Be.wrap(b)}line(y,b,E,ee){return`<line x1="${yh(y)}" y1="${yh(b)}" x2="${yh(E)}" y2="${yh(ee)}" vector-effect="non-scaling-stroke"></line>`}};function yh(a){return typeof a=="number"?`${Math.floor(100*a)/100}%`:a}function im(a){if(!a)return"1px";const y=a.match(/([0-9][a-zA-Z\%]+)/);return y===null?"1px":y[1]}function am(a){return(Math.floor(100*a.metrics.sqrtRuleThickness/a.scalingFactor)/100/10).toString()+"em"}function a0(a){const y=a.isDisplayStyle?hs:a.metrics.defaultRuleThickness;return a.metrics.defaultRuleThickness+a.scalingFactor*y/4}var ou=class Wp extends Dn{constructor(y,b,E){var ee,re;super(ke(Ce({},E),{type:"genfrac",displayContainsHighlight:!0})),this.above=y,this.below=b,this.hasBarLine=(ee=E==null?void 0:E.hasBarLine)!=null?ee:!0,this.continuousFraction=(re=E==null?void 0:E.continuousFraction)!=null?re:!1,this.numerPrefix=E==null?void 0:E.numerPrefix,this.denomPrefix=E==null?void 0:E.denomPrefix,this.mathstyleName=E==null?void 0:E.mathstyleName,this.leftDelim=E==null?void 0:E.leftDelim,this.rightDelim=E==null?void 0:E.rightDelim,this.fractionNavigationOrder=E==null?void 0:E.fractionNavigationOrder}static fromJson(y){return new Wp(y.above,y.below,y)}toJson(){const y={};return this.continuousFraction&&(y.continuousFraction=!0),this.numerPrefix&&(y.numerPrefix=this.numerPrefix),this.denomPrefix&&(y.denomPrefix=this.denomPrefix),this.leftDelim&&(y.leftDelim=this.leftDelim),this.rightDelim&&(y.rightDelim=this.rightDelim),this.hasBarLine||(y.hasBarLine=!1),this.mathstyleName&&(y.mathstyleName=this.mathstyleName),this.fractionNavigationOrder&&(y.fractionNavigationOrder=this.fractionNavigationOrder),Ce(Ce({},super.toJson()),y)}get children(){if(this._children)return this._children;const y=[];if(this.fractionNavigationOrder==="denominator-numerator"){for(const b of this.below)y.push(...b.children),y.push(b);for(const b of this.above)y.push(...b.children),y.push(b)}else{for(const b of this.above)y.push(...b.children),y.push(b);for(const b of this.below)y.push(...b.children),y.push(b)}return this._children=y,y}render(y){var b,E;const ee=new Di({parent:y,mathstyle:this.mathstyleName},this.style),re=ee.metrics,ae=new Di({parent:ee,mathstyle:this.continuousFraction?"":"numerator"},this.style),ue=this.numerPrefix?new ir([new ir(this.numerPrefix),Dn.createBox(ae,this.above)],{isTight:ae.isTight,type:"ignore"}):(b=Dn.createBox(ae,this.above,{type:"ignore"}))!=null?b:new ir(null,{type:"ignore"}),he=new Di({parent:ee,mathstyle:this.continuousFraction?"":"denominator"},this.style),ge=this.denomPrefix?new ir([new ir(this.denomPrefix),Dn.createBox(he,this.below,{type:"ignore"})]):(E=Dn.createBox(he,this.below,{type:"ignore"}))!=null?E:new ir(null,{type:"ignore"}),be=this.hasBarLine?re.defaultRuleThickness:0;let Be,He=0,lt;ee.isDisplayStyle?(Be=ae.metrics.num1,He=be>0?3*be:7*be,lt=he.metrics.denom1):(be>0?(Be=ae.metrics.num2,He=be):(Be=ae.metrics.num3,He=3*re.defaultRuleThickness),lt=he.metrics.denom2);const xt=[];this.isSelected&&xt.push("ML__selected");const vn=ue.depth,nr=ge.height;let fn;if(be<=0){const jr=Be-vn-(nr-lt);jr<He&&(Be+=(He-jr)/2,lt+=(He-jr)/2),fn=new Yi({individualShift:[{box:ue,shift:-Be,classes:[...xt,"ML__center"]},{box:ge,shift:lt,classes:[...xt,"ML__center"]}]}).wrap(ee)}else{const jr=new ir(null,{classes:"ML__frac-line",mode:this.mode,style:this.style});jr.softWidth=Math.max(ue.width,ge.width),jr.height=be/2,jr.depth=be/2;const Ti=ro+be/2;Be<He+vn+Ti&&(Be=He+vn+Ti);const Ui=ro-be/2;lt<He+nr-Ui&&(lt=He+nr-Ui),fn=new Yi({individualShift:[{box:ge,shift:lt,classes:[...xt,"ML__center"]},{box:jr,shift:-Ui,classes:xt},{box:ue,shift:-Be,classes:[...xt,"ML__center"]}]}).wrap(ee)}const Rn=ee.isDisplayStyle?re.delim1:re.delim2,cr=this.leftDelim?this.bind(y,Or("open",this.leftDelim,Rn,!0,y,{style:this.style,mode:this.mode,isSelected:this.isSelected})):Fr(ee,"open");let Fn=null;this.continuousFraction?Fn=new ir(null,{type:"close"}):this.rightDelim?Fn=this.bind(y,Or("close",this.rightDelim,Rn,!0,y,{style:this.style,mode:this.mode,isSelected:this.isSelected})):Fn=Fr(ee,"close");const Hr=new ir([cr,fn,Fn],{isTight:ee.isTight,type:"inner",classes:"mfrac"}),Jr=this.bind(y,Hr);return this.caret&&(Jr.caret=this.caret),this.attachSupsub(y,{base:Jr})}},Ja=class Zp extends Dn{constructor(y,b){var E;super({type:"latex",value:y,mode:"latex"}),this.isSuggestion=(E=b==null?void 0:b.isSuggestion)!=null?E:!1,this.isError=!1}static fromJson(y){const b=new Zp(y.value);return y.isSuggestion&&(b.isSuggestion=!0),y.isError&&(b.isError=!0),b}toJson(){const y={};return this.isSuggestion&&(y.isSuggestion=!0),this.isError&&(y.isError=!0),Ce({type:"latex",value:this.value},y)}get computedStyle(){return{}}render(y){const b=new ir(this.value,{classes:this.isSuggestion?"ML__suggestion":this.isError?"ML__error":"",type:"latex",maxFontSize:1});return b?(this.caret&&(b.caret=this.caret),this.bind(y,b)):null}},ud=class jp extends Dn{constructor(y){super({type:"latexgroup",mode:"latex"}),this.body=[...y].map(b=>new Ja(b)),this.skipBoundary=!1}static fromJson(y){return new jp("")}toJson(){return super.toJson()}render(y){const b=Dn.createBox(y,this.body);return b?(this.caret&&(b.caret=this.caret),this.bind(y,b)):null}_serialize(y){var b,E;return(E=(b=this.body)==null?void 0:b.map(ee=>ee.value).join(""))!=null?E:""}},hf=class Vp extends Dn{constructor(y,b){super(ke(Ce({},b),{type:"extensible-symbol",isFunction:b==null?void 0:b.isFunction})),this.value=y,this.variant=b==null?void 0:b.variant,this.subsupPlacement=b==null?void 0:b.limits}static fromJson(y){return new Vp(y.symbol,y)}toJson(){const y=super.toJson();return this.variant&&(y.variant=this.variant),this.subsupPlacement&&(y.limits=this.subsupPlacement),this.isExtensibleSymbol&&(y.isExtensibleSymbol=!0),this.value&&(y.symbol=this.value),y}render(y){var b;const E=y.isDisplayStyle&&this.value!=="\\smallint",ee=new ir(this.value,{fontFamily:E?"Size2-Regular":"Size1-Regular",classes:"op-symbol "+(E?"large-op":"small-op"),type:"op",maxFontSize:y.scalingFactor,isSelected:this.isSelected});if(!ee)return null;ee.right=ee.italic;const re=(ee.height-ee.depth)/2-ro*y.scalingFactor,ae=ee.italic;ee.setTop(re);let ue=ee;if(this.superscript||this.subscript){const he=(b=this.subsupPlacement)!=null?b:"auto";ue=he==="over-under"||he==="auto"&&y.isDisplayStyle?this.attachLimits(y,{base:ee,baseShift:re,slant:ae}):this.attachSupsub(y,{base:ee})}return new ir(this.bind(y,ue),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(y)}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Ze(this.command,this.mode);if(b!=null&&b.serialize)return b.serialize(this,y);const E=[];return E.push(this.command),this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&E.push("\\limits"),this.subsupPlacement==="adjacent"&&E.push("\\nolimits"),this.subsupPlacement==="auto"&&E.push("\\displaylimits")),E.push(this.supsubToLatex(y)),Si(E)}},dc=class Up extends Dn{constructor(y){const b=y.body;super(ke(Ce({},y),{type:"overlap",body:typeof b=="string"?[new Dn({value:b})]:b,style:y==null?void 0:y.style})),this.skipBoundary=!0,this.align=y==null?void 0:y.align,this.boxType=y==null?void 0:y.boxType}static fromJson(y){return new Up(y)}toJson(){const y={};return this.align&&(y.align=this.align),this.boxType&&(y.boxType=this.boxType),Ce(Ce({},super.toJson()),y)}render(y){const b=Dn.createBox(y,this.body,{classes:"inner"});return b?(this.caret&&(b.caret=this.caret),this.bind(y,new ir([b,new ir(null,{classes:"fix"})],{classes:this.align==="right"?"rlap":"llap",type:this.boxType}))):null}},qo=class Gp extends Dn{constructor(y){var b,E,ee,re;super({type:"overunder",command:y.command,style:y.style,mode:y.mode,body:y.body,skipBoundary:(b=y.skipBoundary)!=null?b:!0}),this.subsupPlacement=y.supsubPlacement,this.svgAbove=y.svgAbove,this.svgBelow=y.svgBelow,this.svgBody=y.svgBody,this.above=y.above,this.below=y.below,this.boxType=(E=y.boxType)!=null?E:"ord",this.paddedBody=(ee=y.paddedBody)!=null?ee:!1,this.paddedLabels=(re=y.paddedLabels)!=null?re:!1}static fromJson(y){return new Gp(y)}toJson(){const y=super.toJson();return this.skipBoundary||(y.skipBoundary=!1),this.subsupPlacement&&(y.subsupPlacement=this.subsupPlacement),this.svgAbove&&(y.svgAbove=this.svgAbove),this.svgBelow&&(y.svgBelow=this.svgBelow),this.svgBody&&(y.svgBody=this.svgBody),this.boxType!=="ord"&&(y.boxType=this.boxType),this.paddedBody&&(y.paddedBody=!0),this.paddedLabels&&(y.paddedLabels=!0),y}render(y){let b=this.svgBody?$o(this.svgBody):Dn.createBox(y,this.body,{type:"ignore"});const E=new Di({parent:y,mathstyle:"scriptstyle"},this.style);let ee=null;this.svgAbove?ee=$o(this.svgAbove):this.above&&(ee=Dn.createBox(E,this.above,{type:"ignore"}));let re=null;this.svgBelow?re=$o(this.svgBelow):this.below&&(re=Dn.createBox(E,this.below,{type:"ignore"})),this.paddedBody&&(b=new ir([Fr(y,"open"),b,Fr(y,"close")],{type:"ignore"}));let ae=om(y,{base:b,above:ee,below:re,type:this.boxType==="bin"||this.boxType==="rel"?this.boxType:"ord",paddedAboveBelow:this.paddedLabels});return ae?(this.subsupPlacement==="over-under"?ae=this.attachLimits(y,{base:ae,type:ae.type}):ae=this.attachSupsub(y,{base:ae}),this.caret&&(ae.caret=this.caret),this.bind(y,ae)):null}};function om(a,y){if(!y.base)return null;if(!y.above&&!y.below){const ue=new ir(y.base,{type:y.type});return ue.setStyle("position","relative"),ue}let b=0;y.above&&(b=a.metrics.bigOpSpacing5);let E=null;const ee=y.base,re=0,ae=["ML__center"];if(y.paddedAboveBelow&&ae.push("ML__label_padding"),y.below&&y.above){const ue=a.metrics.bigOpSpacing5+y.below.height+y.below.depth+ee.depth+re;E=new Yi({bottom:ue,children:[a.metrics.bigOpSpacing5,{box:y.below,classes:ae},{box:ee,classes:["ML__center"]},b,{box:y.above,classes:ae},a.metrics.bigOpSpacing5]})}else y.below?E=new Yi({top:ee.height-re,children:[a.metrics.bigOpSpacing5,{box:y.below,classes:ae},{box:ee,classes:["ML__center"]}]}):y.above&&(E=new Yi({bottom:ee.depth+re,children:[{box:ee,classes:["ML__center"]},b,{box:y.above,classes:ae},a.metrics.bigOpSpacing5]}));return new ir(E,{type:y.type})}var dd=class Xp extends Dn{constructor(y){var b,E,ee,re;super(ke(Ce({},y),{type:"phantom"})),this.captureSelection=!0,this.isInvisible=(b=y.isInvisible)!=null?b:!1,this.smashDepth=(E=y.smashDepth)!=null?E:!1,this.smashHeight=(ee=y.smashHeight)!=null?ee:!1,this.smashWidth=(re=y.smashWidth)!=null?re:!1}static fromJson(y){return new Xp(y)}toJson(){const y={};return this.isInvisible&&(y.isInvisible=!0),this.smashDepth&&(y.smashDepth=!0),this.smashHeight&&(y.smashHeight=!0),this.smashWidth&&(y.smashWidth=!0),Ce(Ce({},super.toJson()),y)}render(y){const b=new Di({parent:y,isPhantom:!0});if(!this.smashDepth&&!this.smashHeight&&!this.smashWidth)return console.assert(this.isInvisible),Dn.createBox(b,this.body,{classes:"inner"});const E=Dn.createBox(this.isInvisible?b:y,this.body);if(!E)return null;if(this.smashWidth){const ee=new ir(null,{classes:"fix"});return new ir([E,ee],{classes:"rlap"}).wrap(y)}if(!this.smashHeight&&!this.smashDepth)return E;if(this.smashHeight&&(E.height=0),this.smashDepth&&(E.depth=0),E.children)for(const ee of E.children)this.smashHeight&&(ee.height=0),this.smashDepth&&(ee.depth=0);return new Yi({firstBaseline:[{box:E}]},{type:E.type}).wrap(y)}},hd=class Yp extends Dn{constructor(y){var b;super(Ce({type:"spacing"},y)),this.width=y==null?void 0:y.width,this._braced=(b=y==null?void 0:y.braced)!=null?b:!1}static fromJson(y){return new Yp(y)}toJson(){const y=super.toJson();return this.width!==void 0&&(y.width=this.width),this._braced&&(y.braced=!0),y}render(y){var b;if(this.command==="space")return new ir(this.mode==="math"?null:" ");let E;if(this.width!==void 0)E=new ir(null,{classes:"mspace"}),E.left=y.toEm(this.width);else{const ee=(b={"\\qquad":"qquad","\\quad":"quad","\\enspace":"enspace","\\;":"thickspace","\\:":"mediumspace","\\>":"mediumspace","\\,":"thinspace","\\!":"negativethinspace"}[this.command])!=null?b:"mediumspace";E=new ir(null,{classes:ee})}return E=this.bind(y,E),this.caret&&(E.caret=this.caret),E}_serialize(y){var b;if(!y.expandMacro&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const E=Ze(this.command,this.mode);if(E!=null&&E.serialize)return E.serialize(this,y);const ee=(b=this.command)!=null?b:"";return this.width===void 0?ee:this._braced&&!("register"in this.width)?`${ee}{${Ma(this.width)}}`:`${ee}${Ma(this.width)}`}},o0=class qp extends Dn{constructor(y){var b;super(ke(Ce({},y),{type:"surd",mode:(b=y.mode)!=null?b:"math",style:y.style,displayContainsHighlight:!0,body:y.body})),this.above=y.index}static fromJson(y){return new qp(ke(Ce({},y),{index:y.above}))}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Ze(this.command,this.mode);if(b!=null&&b.serialize)return b.serialize(this,y);const E=this.command,ee=this.bodyToLatex(y);return this.above&&!this.hasEmptyBranch("above")?ra(`${E}[${this.aboveToLatex(y)}]`,ee):/^[0-9]$/.test(ee)?`${E}${ee}`:ra(E,ee)}get children(){if(this._children)return this._children;const y=[];if(this.above)for(const b of this.above)y.push(...b.children),y.push(b);if(this.body)for(const b of this.body)y.push(...b.children),y.push(b);return this._children=y,y}render(y){var b;const E=new Di({parent:y,mathstyle:"cramp"},this.style),ee=(b=Dn.createBox(E,this.body,{type:"inner"}))!=null?b:new ir(null),re=E.scalingFactor,ae=E.metrics.defaultRuleThickness/re,ue=y.isDisplayStyle?hs:ae,he=new ir(null,{classes:"ML__sqrt-line",style:this.style});he.height=ae,he.softWidth=ee.width;let ge=re*(ae+ue/4);const Be=Math.max(re*2*ue,ee.height+ee.depth)+ge+ae,He=new Di({parent:y},this.style),lt=this.bind(He,new ir(Or("inner","\\surd",Be,!1,He,{isSelected:this.isSelected}),{isSelected:this.isSelected,classes:"ML__sqrt-sign",style:this.style}));if(!lt)return null;const xt=lt.height+lt.depth-ae;xt>ee.height+ee.depth+ge&&(ge=(ge+xt-(ee.height+ee.depth))/2),lt.setTop(lt.height-ee.height-ge);const vn=this.bind(y,new Yi({firstBaseline:[{box:new ir(ee)},ge-2*ae,{box:he},ae]})),nr=Dn.createBox(new Di({parent:y,mathstyle:"scriptscriptstyle"}),this.above,{type:"ignore"});if(!nr){const cr=new ir([lt,vn],{classes:this.containsCaret?"ML__contains-caret":"",type:"inner"});return cr.setStyle("display","inline-block"),cr.setStyle("height",cr.height+cr.depth,"em"),this.caret&&(cr.caret=this.caret),this.bind(y,cr)}const fn=new Yi({shift:-.6*(Math.max(lt.height,vn.height)-Math.max(lt.depth,vn.depth)),children:[{box:nr}]}),Rn=new ir([new ir(fn,{classes:"ML__sqrt-index",type:"ignore"}),lt,vn],{type:"inner",classes:this.containsCaret?"ML__contains-caret":""});return Rn.height=lt.height,Rn.depth=lt.depth,this.caret&&(Rn.caret=this.caret),this.bind(y,Rn)}},sm=class extends ir{constructor(a){super(null,{type:"skip"}),this._width=a}toMarkup(){return`<span style="display:inline-block;width:${Math.ceil(this.width*100)/100}em"></span>`}};function bh(a,y){if(!a.parent)return;const b=a.parent.children,E=b.indexOf(a);let ee=E-1;for(;ee>=0&&b[ee].type==="ignore";)ee-=1;if(ee<0&&a.parent.parent&&a.parent.type==="lift"){bh(a.parent,y);return}E>0&&b[E-1].type==="skip"?b[E-1].width+=y:b.splice(E,0,new sm(y))}var lm={ord:{op:3,bin:4,rel:5,inner:3},op:{ord:3,op:3,rel:5,inner:3},bin:{ord:4,op:4,open:4,inner:4},rel:{ord:5,op:5,open:5,inner:5},close:{op:3,bin:4,rel:5,inner:3},punct:{ord:3,op:3,rel:3,open:3,punct:3,inner:3},inner:{ord:3,op:3,bin:4,rel:5,open:3,punct:3,inner:3}},cm={ord:{op:3},op:{ord:3,op:3},close:{op:3},inner:{op:3}};function um(a){pd(a,(y,b)=>{b.type==="bin"&&(!y||/^(middle|bin|op|rel|open|punct)$/.test(y.type))&&(b.type="ord"),(y==null?void 0:y.type)==="bin"&&/^(rel|close|punct)$/.test(b.type)&&(y.type="ord"),b.type!=="ignore"&&(y=b)})}function fd(a,y){if(!a.children)return a;const b=a.children;um(b);const E=y.getRegisterAsEm("thinmuskip"),ee=y.getRegisterAsEm("medmuskip"),re=y.getRegisterAsEm("thickmuskip");return pd(b,(ae,ue)=>{var he,ge,be;if(!ae)return;const Be=ae.type,He=ue.isTight?(he=cm[Be])!=null?he:null:(ge=lm[Be])!=null?ge:null,lt=(be=He==null?void 0:He[ue.type])!=null?be:null;lt===3&&bh(ue,E),lt===4&&bh(ue,ee),lt===5&&bh(ue,re)}),a}function pd(a,y,b=void 0){if(!a)return b;a=[...a];for(const E of a)E.type==="lift"?b=pd(E.children,y,b):E.type==="ignore"?pd(E.children,y):(y(b,E),pd(E.children,y),b=E);return b}var ff=class Jp extends Dn{constructor(y){super({type:"tooltip",command:y.command,mode:y.mode,style:y.style,body:y.body,displayContainsHighlight:!0}),this.tooltip=new Dn({type:"root",mode:y.content,body:y.tooltip,style:{}}),this.skipBoundary=!0,this.captureSelection=!1}static fromJson(y){return new Jp(ke(Ce({},y),{tooltip:Ol(y.tooltip)}))}toJson(){var y;const b=(y=this.tooltip.body)==null?void 0:y.filter(E=>E.type!=="first").map(E=>E.toJson());return ke(Ce({},super.toJson()),{tooltip:b})}render(y){const b=Dn.createBox(new Di,this.body);if(!b)return null;const E=new Di({parent:y,mathstyle:"displaystyle"},{fontSize:Ds}),ee=Yc(fd(new ir(this.tooltip.render(E),{classes:"ML__tooltip-content"}),E)),re=new ir([ee,b],{classes:"ML__tooltip-container"});return this.caret&&(re.caret=this.caret),this.bind(y,re)}},hc=class Qp extends Dn{constructor(y,b){super(ke(Ce({},b),{type:"operator",isFunction:b==null?void 0:b.isFunction})),this.value=y,this.variant=b==null?void 0:b.variant,this.variantStyle=b==null?void 0:b.variantStyle,this.subsupPlacement=b==null?void 0:b.limits}static fromJson(y){return new Qp(y.symbol,y)}toJson(){const y=super.toJson();return this.variant&&(y.variant=this.variant),this.variantStyle&&(y.variantStyle=this.variantStyle),this.subsupPlacement&&(y.limits=this.subsupPlacement),this.value&&(y.symbol=this.value),y}render(y){var b;const E=new ir(this.value,{type:"op",mode:"math",maxFontSize:y.scalingFactor,style:{variant:this.variant,variantStyle:this.variantStyle},isSelected:this.isSelected,letterShapeStyle:y.letterShapeStyle});let ee=E;if(this.superscript||this.subscript){const re=(b=this.subsupPlacement)!=null?b:"auto";ee=re==="over-under"||re==="auto"&&y.isDisplayStyle?this.attachLimits(y,{base:E}):this.attachSupsub(y,{base:E})}return new ir(this.bind(y,ee),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(y)}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Ze(this.command,this.mode);if(b!=null&&b.serialize)return b.serialize(this,y);const E=[this.command];return this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&E.push("\\limits"),this.subsupPlacement==="adjacent"&&E.push("\\nolimits"),this.subsupPlacement==="auto"&&E.push("\\displaylimits")),E.push(this.supsubToLatex(y)),Si(E)}};function Ol(a){if(Oe(a))return a.map(E=>Ol(E));if(typeof a=="string")return Dn.fromJson(a);a=Ce({},a);for(const E of Tl)a[E]&&(a[E]=Ol(a[E]));a.args&&(a.args=dm(a.args)),a.array&&(a.array=Ol(a.array));const y=a.type;let b;y==="accent"&&(b=z.fromJson(a)),y==="array"&&(b=hi.fromJson(a)),y==="box"&&(b=ba.fromJson(a)),y==="chem"&&(b=n0.fromJson(a)),y==="composition"&&(b=fl.fromJson(a)),y==="delim"&&(b=r0.fromJson(a)),y==="enclose"&&(b=cd.fromJson(a)),y==="error"&&(b=vo.fromJson(a)),y==="extensible-symbol"&&(b=hf.fromJson(a)),y==="genfrac"&&(b=ou.fromJson(a)),y==="group"&&(b=Za.fromJson(a)),y==="latex"&&(b=Ja.fromJson(a)),y==="latexgroup"&&(b=ud.fromJson(a)),y==="leftright"&&(b=Ri.fromJson(a)),y==="macro"&&(b=au.fromJson(a)),y==="macro-argument"&&(b=bs.fromJson(a)),y==="operator"&&(b=hc.fromJson(a)),y==="overlap"&&(b=dc.fromJson(a)),y==="overunder"&&(b=qo.fromJson(a)),y==="placeholder"&&(b=Qr.fromJson(a)),y==="prompt"&&(b=$s.fromJson(a)),y==="phantom"&&(b=dd.fromJson(a)),y==="sizeddelim"&&(b=i0.fromJson(a)),y==="spacing"&&(b=hd.fromJson(a)),y==="subsup"&&(b=Yo.fromJson(a)),y==="surd"&&(b=o0.fromJson(a)),y==="text"&&(b=vs.fromJson(a)),y==="tooltip"&&(b=ff.fromJson(a)),b||(console.assert(!y||["first","mbin","mrel","mclose","minner","mop","mopen","mord","mpunct","root","space"].includes(y),`MathLive 0.98.5: an unexpected atom type "${y}" was encountered. Add new atom constructors to \`fromJson()\` in "atom.ts"`),b=Dn.fromJson(a));for(const E of Tl)a[E]&&b.setChildren(a[E],E);return a.verbatimLatex!==void 0&&(b.verbatimLatex=a.verbatimLatex),a.subsupPlacement&&(b.subsupPlacement=a.subsupPlacement),a.explicitSubsupPlacement&&(b.explicitSubsupPlacement=!0),a.isFunction&&(b.isFunction=!0),a.isExtensibleSymbol&&(b.isExtensibleSymbol=!0),a.skipBoundary&&(b.skipBoundary=!0),a.captureSelection&&(b.captureSelection=!0),b}function dm(a){if(a&&Array.isArray(a))return a.map(y=>y==="<null>"?null:typeof y=="object"&&"group"in y?{group:y.group.map(b=>Ol(b))}:typeof y=="object"&&"atoms"in y?y.atoms.map(b=>Ol(b)):y)}var s0={main:["Main-Regular","ML__cmr"],"main-italic":["Main-Italic","ML__cmr ML__it"],"main-bold":["Main-Bold","ML__cmr ML__bold"],"main-bolditalic":["Main-BoldItalic","ML__cmr ML__bold ML__it"],normal:["Main-Regular","ML__cmr"],"normal-bold":["Main-Bold","ML__mathbf"],"normal-italic":["Math-Italic","ML__mathit"],"normal-bolditalic":["Math-BoldItalic","ML__mathbfit"],ams:["AMS-Regular","ML__ams"],"ams-bold":["AMS-Regular","ML__ams"],"ams-italic":["AMS-Regular","ML__ams"],"ams-bolditalic":["AMS-Regular","ML__ams"],"sans-serif":["SansSerif-Regular","ML__sans"],"sans-serif-bold":["SansSerif-Regular","ML__sans ML__bold"],"sans-serif-italic":["SansSerif-Regular","ML__sans"],"sans-serif-bolditalic":["SansSerif-Regular","ML__sans"],calligraphic:["Caligraphic-Regular","ML__cal"],"calligraphic-bold":["Caligraphic-Regular","ML__cal ML__bold"],"calligraphic-italic":["Caligraphic-Regular","ML__cal ML__it"],"calligraphic-bolditalic":["Caligraphic-Regular","ML__cal ML__bold ML__it"],script:["Script-Regular","ML__script"],"script-bold":["Script-Regular","ML__script ML__bold"],"script-italic":["Script-Regular","ML__script ML__it"],"script-bolditalic":["Script-Regular","ML__script ML__bold ML__it"],fraktur:["Fraktur-Regular","ML__frak"],"fraktur-bold":["Fraktur-Regular","ML__frak"],"fraktur-italic":["Fraktur-Regular","ML__frak"],"fraktur-bolditalic":["Fraktur-Regular","ML__frak"],monospace:["Typewriter-Regular","ML__tt"],"monospace-bold":["Typewriter-Regular","ML__tt ML__bold"],"monospace-italic":["Typewriter-Regular","ML__tt ML__it"],"monospace-bolditalic":["Typewriter-Regular","ML__tt ML__bold ML__it"],"double-struck":["AMS-Regular","ML__bb"],"double-struck-bold":["AMS-Regular","ML__bb"],"double-struck-italic":["AMS-Regular","ML__bb"],"double-struck-bolditalic":["AMS-Regular","ML__bb"]},pf={"double-struck":/^[A-Z ]$/,script:/^[A-Z ]$/,calligraphic:/^[\dA-Z ]$/,fraktur:/^[\dA-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^]$/,monospace:/^[\dA-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A8\u03A9]$/,"sans-serif":/^[\dA-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A8\u03A9]$/},l0=/^[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5]$/,hm=/^[\u0393|\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A6\u03A8\u03A9]$/,fm=[/^[a-z]$/,/^[A-Z]$/,l0,hm],pm={iso:["it","it","it","it"],tex:["it","it","it","up"],french:["it","up","up","up"],upright:["up","up","up","up"]},mm=class extends Co{constructor(){super("math")}createAtom(a,y,b){var E,ee,re,ae;if(y===null)return new Dn({type:"mord",mode:"math",command:a,value:a,style:b});const ue=window.MathfieldElement.isFunction((E=y.command)!=null?E:a);if(y.definitionType==="symbol"){const ge=new Dn({type:(ee=y.type)!=null?ee:"mord",mode:"math",command:(re=y.command)!=null?re:a,value:String.fromCodePoint(y.codepoint),style:b});return ue&&(ge.isFunction=!0),a.startsWith("\\")&&(ge.verbatimLatex=a),ge}const he=new Dn({type:"mord",mode:"math",command:(ae=y.command)!=null?ae:a,value:a,style:b});return ue&&(he.isFunction=!0),a.startsWith("\\")&&(he.verbatimLatex=a),he}serialize(a,y){const b=gm(a,ke(Ce({},y),{defaultMode:"math"}));return b.length===0||y.defaultMode!=="text"?b:["$ ",...b," $"]}getFont(a,y){console.assert(y.variant!==void 0);let{variant:b}=y,{variantStyle:E}=y;b==="normal"&&!E&&/[\u00A3\u0131\u0237]/.test(a.value)&&(b="main",E="italic"),b==="normal"&&!E&&a.value.length===1&&fm.forEach((ue,he)=>{var ge;ue.test(a.value)&&pm[(ge=y.letterShapeStyle)!=null?ge:"tex"][he]==="it"&&(E="italic")}),E==="up"&&(E=void 0);const ee=E?b+"-"+E:b;console.assert(s0[ee]!==void 0);const[re,ae]=s0[ee];return pf[b]&&!pf[b].test(a.value)?(a.value=pn(a.value,b,E),null):(l0.test(a.value)&&(a.classes+=" lcGreek"),ae&&(a.classes+=" "+ae),re)}};function gm(a,y){const{parent:b}=a[0],E=c0(b);return ya(a,"variant").map(ee=>{const re=c0(ee[0]);let ae="";re&&re!==E&&(ae={calligraphic:"\\mathcal",fraktur:"\\mathfrak","double-struck":"\\mathbb",script:"\\mathscr",monospace:"\\mathtt","sans-serif":"\\mathsf",normal:"\\mathrm","normal-italic":"\\mathnormal","normal-bold":"\\mathbf","normal-bolditalic":"\\mathbfit",ams:"","ams-italic":"\\mathit","ams-bold":"\\mathbf","ams-bolditalic":"\\mathbfit",main:"","main-italic":"\\mathit","main-bold":"\\mathbf","main-bolditalic":"\\mathbfit"}[re],console.assert(ae!==void 0));const ue=Si(ee.map(he=>he._serialize(y)));return ae?ra(ae,ue):ue})}function c0(a){if(!a)return"";const{style:y}=a;if(y.variant===void 0)return"";let b=y.variant;return!["calligraphic","fraktur","double-struck","script","monospace","sans-serif"].includes(y.variant)&&y.variantStyle&&y.variantStyle!=="up"&&(b+="-"+y.variantStyle),b}new mm;function vm(a,y){return a.map(b=>b._serialize(y))}function ym(a,y){return ya(a,"fontShape").map(b=>{const E=vm(b,y),{fontShape:ee}=b[0].style;let re="";return ee==="it"&&(re="\\textit"),ee==="sl"&&(re="\\textsl"),ee==="sc"&&(re="\\textsc"),ee==="n"&&(re="\\textup"),!re&&ee?`{${ra("\\fontshape",ee)}${Si(E)}}`:re?ra(re,Si(E)):Si(E)})}function bm(a,y){return ya(a,"fontSeries").map(b=>{const E=ym(b,y),{fontSeries:ee}=b[0].style;let re="";return ee==="b"&&(re="\\textbf"),ee==="l"&&(re="\\textlf"),ee==="m"&&(re="\\textmd"),ee&&!re?`{${ra("\\fontseries",ee)}${Si(E)}}`:re?ra(re,Si(E)):Si(E)})}function xm(a,y){return ya(a,"fontSize").map(b=>{var E,ee;const re=bm(b,y),ae=(ee=["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][(E=b[0].style.fontSize)!=null?E:""])!=null?ee:"";return ae?`${ae} ${Si(re)}`:Si(re)})}function wm(a,y,b){return ya(a,"fontFamily").map(E=>{var ee,re;const ae=xm(E,y),ue=(re={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[(ee=E[0].style.fontFamily)!=null?ee:""])!=null?re:"";return ue?`\\${ue}{${Si(ae)}}`:E[0].style.fontFamily?`{\\fontfamily{${E[0].style.fontFamily}} ${Si(ae)}}`:b?`\\text{${Si(ae)}}`:Si(ae)})}var u0={roman:"","sans-serif":"ML__sans",monospace:"ML__tt"},Sm=class extends Co{constructor(){super("text")}createAtom(a,y,b){return y&&y.definitionType==="symbol"?new vs(a,String.fromCodePoint(y.codepoint),b!=null?b:{}):null}serialize(a,y){return wm(a,ke(Ce({},y),{defaultMode:"text"}),y.defaultMode!=="text")}getFont(a,y){var b,E,ee,re,ae;const{fontFamily:ue}=y;if(u0[ue]?a.classes+=" "+u0[ue]:ue&&a.setStyle("font-family",ue),y.fontShape&&(a.classes+=" ",a.classes+=(b={it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[y.fontShape])!=null?b:""),y.fontSeries){const he=y.fontSeries.match(/(.?[lbm])?(.?[cx])?/);he&&(a.classes+=" ",a.classes+=(ee={ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[(E=he[1])!=null?E:""])!=null?ee:"",a.classes+=" ",a.classes+=(ae={uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[(re=he[2])!=null?re:""])!=null?ae:"")}return"Main-Regular"}};new Sm;var Cm=class extends Co{constructor(){super("latex")}createAtom(a){return new Ja(a)}serialize(a,y){return a.filter(b=>b instanceof Ja&&!b.isSuggestion).map(b=>b.value)}getFont(){return null}};new Cm;var Mm={id:"dvorak",locale:"en",displayName:"Dvorak",virtualLayout:"dvorak",platform:"",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["x","X","\u2248","\u02DB"],KeyC:["j","J","\u2206","\xD4"],KeyD:["e","E","\xB4","\xB4"],KeyE:[".",">","\u2265","\u02D8"],KeyF:["u","U","\xA8","\xA8"],KeyG:["i","I","\u02C6","\u02C6"],KeyH:["d","D","\u2202","\xCE"],KeyI:["c","C","\xE7","\xC7"],KeyJ:["h","H","\u02D9","\xD3"],KeyK:["t","T","\u2020","\u02C7"],KeyL:["n","N","\u02DC","\u02DC"],KeyM:["m","M","\xB5","\xC2"],KeyN:["b","B","\u222B","\u0131"],KeyO:["r","R","\xAE","\u2030"],KeyP:["l","L","\xAC","\xD2"],KeyQ:["'",'"',"\xE6","\xC6"],KeyR:["p","P","\u03C0","\u220F"],KeyS:["o","O","\xF8","\xD8"],KeyT:["y","Y","\xA5","\xC1"],KeyU:["g","G","\xA9","\u02DD"],KeyV:["k","K","\u02DA","\uF8FF"],KeyW:[",","<","\u2264","\xAF"],KeyX:["q","Q","\u0153","\u0152"],KeyY:["f","F","\u0192","\xCF"],KeyZ:[";",":","\u2026","\xDA"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["[","{","\u201C","\u201D"],Equal:["]","}","\u2018","\u2019"],BracketLeft:["/","?","\xF7","\xBF"],BracketRight:["=","+","\u2260","\xB1"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:["s","S","\xDF","\xCD"],Quote:["-","_","\u2013","\u2014"],Backquote:["`","~","`","`"],Comma:["w","W","\u2211","\u201E"],Period:["v","V","\u221A","\u25CA"],Slash:["z","Z","\u03A9","\xB8"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},mf={id:"apple.en-intl",displayName:"English (international)",virtualLayout:"qwerty",platform:"apple",locale:"en",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\u222B","\u0131"],KeyC:["c","C","\xE7","\xC7"],KeyD:["d","D","\u2202","\xCE"],KeyE:["e","E","\xB4","\xB4"],KeyF:["f","F","\u0192","\xCF"],KeyG:["g","G","\xA9","\u02DD"],KeyH:["h","H","\u02D9","\xD3"],KeyI:["i","I","\u02C6","\u02C6"],KeyJ:["j","J","\u2206","\xD4"],KeyK:["k","K","\u02DA","\uF8FF"],KeyL:["l","L","\xAC","\xD2"],KeyM:["m","M","\xB5","\xC2"],KeyN:["n","N","\u02DC","\u02DC"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\u0153","\u0152"],KeyR:["r","R","\xAE","\u2030"],KeyS:["s","S","\xDF","\xCD"],KeyT:["t","T","\u2020","\u02C7"],KeyU:["u","U","\xA8","\xA8"],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\u2211","\u201E"],KeyX:["x","X","\u2248","\u02DB"],KeyY:["y","Y","\xA5","\xC1"],KeyZ:["z","Z","\u03A9","\xB8"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["-","_","\u2013","\u2014"],Equal:["=","+","\u2260","\xB1"],BracketLeft:["[","{","\u201C","\u201D"],BracketRight:["]","}","\u2018","\u2019"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:[";",":","\u2026","\xDA"],Quote:["'",'"',"\xE6","\xC6"],Backquote:["`","\u02DC","`","`"],Comma:[",","<","\u2264","\xAF"],Period:[".",">","\u2265","\u02D8"],Slash:["/","?","\xF7","\xBF"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},d0={id:"windows.en-intl",displayName:"English (international)",platform:"windows",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","\xE1","\xC1"],KeyB:["b","B","",""],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\xE9","\xC9"],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","\xED","\xCD"],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","\xF8","\xD8"],KeyM:["m","M","\xB5",""],KeyN:["n","N","\xF1","\xD1"],KeyO:["o","O","\xF3","\xD3"],KeyP:["p","P","\xF6","\xD6"],KeyQ:["q","Q","\xE4","\xC4"],KeyR:["r","R","\xAE",""],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\xFE","\xDE"],KeyU:["u","U","\xFA","\xDA"],KeyV:["v","V","",""],KeyW:["w","W","\xE5","\xC5"],KeyX:["x","X","",""],KeyY:["y","Y","\xFC","\xDC"],KeyZ:["z","Z","\xE6","\xC6"],Digit1:["1","!","\xA1","\xB9"],Digit2:["2","@","\xB2",""],Digit3:["3","#","\xB3",""],Digit4:["4","$","\xA4","\xA3"],Digit5:["5","%","\u20AC",""],Digit6:["6","^","\xBC",""],Digit7:["7","&","\xBD",""],Digit8:["8","*","\xBE",""],Digit9:["9","(","\u2018",""],Digit0:["0",")","\u2019",""],Space:[" "," ","",""],Minus:["-","_","\xA5",""],Equal:["=","+","\xD7","\xF7"],BracketLeft:["[","{","\xAB",""],BracketRight:["]","}","\xBB",""],Backslash:["\\","|","\xAC","\xA6"],Semicolon:[";",":","\xB6","\xB0"],Quote:["'",'"',"\xB4","\xA8"],Backquote:["`","~","",""],Comma:[",","<","\xE7","\xC7"],Period:[".",">","",""],Slash:["/","?","\xBF",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["\\","|","",""]}},h0={id:"linux.en",displayName:"English",platform:"linux",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","a","A"],KeyB:["b","B","b","B"],KeyC:["c","C","c","C"],KeyD:["d","D","d","D"],KeyE:["e","E","e","E"],KeyF:["f","F","f","F"],KeyG:["g","G","g","G"],KeyH:["h","H","h","H"],KeyI:["i","I","i","I"],KeyJ:["j","J","j","J"],KeyK:["k","K","k","K"],KeyL:["l","L","l","L"],KeyM:["m","M","m","M"],KeyN:["n","N","n","N"],KeyO:["o","O","o","O"],KeyP:["p","P","p","P"],KeyQ:["q","Q","q","Q"],KeyR:["r","R","r","R"],KeyS:["s","S","s","S"],KeyT:["t","T","t","T"],KeyU:["u","U","u","U"],KeyV:["v","V","v","V"],KeyW:["w","W","w","W"],KeyX:["x","X","x","X"],KeyY:["y","Y","y","Y"],KeyZ:["z","Z","z","Z"],Digit1:["1","!","1","!"],Digit2:["2","@","2","@"],Digit3:["3","#","3","#"],Digit4:["4","$","4","$"],Digit5:["5","%","5","%"],Digit6:["6","^","6","^"],Digit7:["7","&","7","&"],Digit8:["8","*","8","*"],Digit9:["9","(","9","("],Digit0:["0",")","0",")"],Space:[" "," "," "," "],Minus:["-","_","-","_"],Equal:["=","+","=","+"],BracketLeft:["[","{","[","{"],BracketRight:["]","}","]","}"],Backslash:["\\","|","\\","|"],Semicolon:[";",":",";",":"],Quote:["'",'"',"'",'"'],Backquote:["`","~","`","~"],Comma:[",","<",",","<"],Period:[".",">",".",">"],Slash:["/","?","/","?"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}},_m={id:"apple.french",locale:"fr",displayName:"French",platform:"apple",virtualLayout:"azerty",score:0,mapping:{KeyA:["q","Q","\u2021","\u03A9"],KeyB:["b","B","\xDF","\u222B"],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\xEA","\xCA"],KeyF:["f","F","\u0192","\xB7"],KeyG:["g","G","\uFB01","\uFB02"],KeyH:["h","H","\xCC","\xCE"],KeyI:["i","I","\xEE","\xEF"],KeyJ:["j","J","\xCF","\xCD"],KeyK:["k","K","\xC8","\xCB"],KeyL:["l","L","\xAC","|"],KeyM:[",","?","\u221E","\xBF"],KeyN:["n","N","~","\u0131"],KeyO:["o","O","\u0153","\u0152"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xAE","\u201A"],KeyS:["s","S","\xD2","\u2211"],KeyT:["t","T","\u2020","\u2122"],KeyU:["u","U","\xBA","\xAA"],KeyV:["v","V","\u25CA","\u221A"],KeyW:["z","Z","\xC2","\xC5"],KeyX:["x","X","\u2248","\u2044"],KeyY:["y","Y","\xDA","\u0178"],KeyZ:["w","W","\u2039","\u203A"],Digit1:["&","1","\uF8FF","\xB4"],Digit2:["\xE9","2","\xEB","\u201E"],Digit3:['"',"3","\u201C","\u201D"],Digit4:["'","4","\u2018","\u2019"],Digit5:["(","5","{","["],Digit6:["\xA7","6","\xB6","\xE5"],Digit7:["\xE8","7","\xAB","\xBB"],Digit8:["!","8","\xA1","\xDB"],Digit9:["\xE7","9","\xC7","\xC1"],Digit0:["\xE0","0","\xF8","\xD8"],Space:[" "," "," "," "],Minus:[")","\xB0","}","]"],Equal:["-","_","\u2014","\u2013"],BracketLeft:["^","\xA8","\xF4","\xD4"],BracketRight:["$","*","\u20AC","\xA5"],Backslash:["`","\xA3","@","#"],Semicolon:["m","M","\xB5","\xD3"],Quote:["\xF9","%","\xD9","\u2030"],Backquote:["<",">","\u2264","\u2265"],Comma:[";",".","\u2026","\u2022"],Period:[":","/","\xF7","\\"],Slash:["=","+","\u2260","\xB1"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",".",",","."],IntlBackslash:["@","#","\u2022","\u0178"],NumpadEqual:["=","=","=","="]}},km={id:"windows.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"windows",score:0,mapping:{KeyA:["q","Q","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:[",","?","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["a","A","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["z","Z","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["w","W","",""],Digit1:["&","1","",""],Digit2:["\xE9","2","~",""],Digit3:['"',"3","#",""],Digit4:["'","4","{",""],Digit5:["(","5","[",""],Digit6:["-","6","|",""],Digit7:["\xE8","7","`",""],Digit8:["_","8","\\",""],Digit9:["\xE7","9","^",""],Digit0:["\xE0","0","@",""],Space:[" "," ","",""],Minus:[")","\xB0","]",""],Equal:["=","+","}",""],BracketLeft:["^","\xA8","",""],BracketRight:["$","\xA3","\xA4",""],Backslash:["*","\xB5","",""],Semicolon:["m","M","",""],Quote:["\xF9","%","",""],Backquote:["\xB2","","",""],Comma:[";",".","",""],Period:[":","/","",""],Slash:["!","\xA7","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},Em={id:"linux.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"linux",score:0,mapping:{KeyA:["q","Q","@","\u03A9"],KeyB:["b","B","\u201D","\u2019"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\xA2"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0309","\u031B"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:[",","?","\u0301","\u030B"],KeyN:["n","N","n","N"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201C","\u2018"],KeyW:["z","Z","\xAB","<"],KeyX:["x","X","\xBB",">"],KeyY:["y","Y","\u2190","\xA5"],KeyZ:["w","W","\u0142","\u0141"],Digit1:["&","1","\xB9","\xA1"],Digit2:["\xE9","2","~","\u215B"],Digit3:['"',"3","#","\xA3"],Digit4:["'","4","{","$"],Digit5:["(","5","[","\u215C"],Digit6:["-","6","|","\u215D"],Digit7:["\xE8","7","`","\u215E"],Digit8:["_","8","\\","\u2122"],Digit9:["\xE7","9","^","\xB1"],Digit0:["\xE0","0","@","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:[")","\xB0","]","\xBF"],Equal:["=","+","}","\u0328"],BracketLeft:["\u0302","\u0308","\u0308","\u030A"],BracketRight:["$","\xA3","\xA4","\u0304"],Backslash:["*","\xB5","\u0300","\u0306"],Semicolon:["m","M","\xB5","\xBA"],Quote:["\xF9","%","\u0302","\u030C"],Backquote:["\xB2","~","\xAC","\xAC"],Comma:[";",".","\u2500","\xD7"],Period:[":","/","\xB7","\xF7"],Slash:["!","\xA7","\u0323","\u0307"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"]}},Lm={id:"apple.german",locale:"de",displayName:"German",virtualLayout:"qwertz",platform:"apple",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\u222B","\u2039"],KeyC:["c","C","\xE7","\xC7"],KeyD:["d","D","\u2202","\u2122"],KeyE:["e","E","\u20AC","\u2030"],KeyF:["f","F","\u0192","\xCF"],KeyG:["g","G","\xA9","\xCC"],KeyH:["h","H","\xAA","\xD3"],KeyI:["i","I","\u2044","\xDB"],KeyJ:["j","J","\xBA","\u0131"],KeyK:["k","K","\u2206","\u02C6"],KeyL:["l","L","@","\uFB02"],KeyM:["m","M","\xB5","\u02D8"],KeyN:["n","N","~","\u203A"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\xAB","\xBB"],KeyR:["r","R","\xAE","\xB8"],KeyS:["s","S","\u201A","\xCD"],KeyT:["t","T","\u2020","\u02DD"],KeyU:["u","U","\xA8","\xC1"],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\u2211","\u201E"],KeyX:["x","X","\u2248","\xD9"],KeyY:["z","Z","\u03A9","\u02C7"],KeyZ:["y","Y","\xA5","\u2021"],Digit1:["1","!","\xA1","\xAC"],Digit2:["2",'"',"\u201C","\u201D"],Digit3:["3","\xA7","\xB6","#"],Digit4:["4","$","\xA2","\xA3"],Digit5:["5","%","[","\uFB01"],Digit6:["6","&","]","^"],Digit7:["7","/","|","\\"],Digit8:["8","(","{","\u02DC"],Digit9:["9",")","}","\xB7"],Digit0:["0","=","\u2260","\xAF"],Space:[" "," "," "," "],Minus:["\xDF","?","\xBF","\u02D9"],Equal:["\xB4","`","'","\u02DA"],BracketLeft:["\xFC","\xDC","\u2022","\xB0"],BracketRight:["+","*","\xB1","\uF8FF"],Backslash:["#","'","\u2018","\u2019"],Semicolon:["\xF6","\xD6","\u0153","\u0152"],Quote:["\xE4","\xC4","\xE6","\xC6"],Backquote:["<",">","\u2264","\u2265"],Comma:[",",";","\u221E","\u02DB"],Period:[".",":","\u2026","\xF7"],Slash:["-","_","\u2013","\u2014"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",",",".","."],IntlBackslash:["^","\xB0","\u201E","\u201C"],NumpadEqual:["=","=","=","="]}},Dm={id:"windows.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","\xB5",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","@",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["z","Z","",""],KeyZ:["y","Y","",""],Digit1:["1","!","",""],Digit2:["2",'"',"\xB2",""],Digit3:["3","\xA7","\xB3",""],Digit4:["4","$","",""],Digit5:["5","%","",""],Digit6:["6","&","",""],Digit7:["7","/","{",""],Digit8:["8","(","[",""],Digit9:["9",")","]",""],Digit0:["0","=","}",""],Space:[" "," ","",""],Minus:["\xDF","?","\\","\u1E9E"],Equal:["\xB4","`","",""],BracketLeft:["\xFC","\xDC","",""],BracketRight:["+","*","~",""],Backslash:["#","'","",""],Semicolon:["\xF6","\xD6","",""],Quote:["\xE4","\xC4","",""],Backquote:["^","\xB0","",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","|",""]}},Am={id:"linux.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","\xE6","\xC6"],KeyB:["b","B","\u201C","\u2018"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\u20AC"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0323","\u0307"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:["m","M","\xB5","\xBA"],KeyN:["n","N","\u201D","\u2019"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["q","Q","@","\u03A9"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\u017F","\u1E9E"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201E","\u201A"],KeyW:["w","W","\u0142","\u0141"],KeyX:["x","X","\xAB","\u2039"],KeyY:["z","Z","\u2190","\xA5"],KeyZ:["y","Y","\xBB","\u203A"],Digit1:["1","!","\xB9","\xA1"],Digit2:["2",'"',"\xB2","\u215B"],Digit3:["3","\xA7","\xB3","\xA3"],Digit4:["4","$","\xBC","\xA4"],Digit5:["5","%","\xBD","\u215C"],Digit6:["6","&","\xAC","\u215D"],Digit7:["7","/","{","\u215E"],Digit8:["8","(","[","\u2122"],Digit9:["9",")","]","\xB1"],Digit0:["0","=","}","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:["\xDF","?","\\","\xBF"],Equal:["\u0301","\u0300","\u0327","\u0328"],BracketLeft:["\xFC","\xDC","\u0308","\u030A"],BracketRight:["+","*","~","\xAF"],Backslash:["#","'","\u2019","\u0306"],Semicolon:["\xF6","\xD6","\u030B","\u0323"],Quote:["\xE4","\xC4","\u0302","\u030C"],Backquote:["\u0302","\xB0","\u2032","\u2033"],Comma:[",",";","\xB7","\xD7"],Period:[".",":","\u2026","\xF7"],Slash:["-","_","\u2013","\u2014"],PrintScreen:["","","",""],PageUp:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",",","",","],IntlBackslash:["<",">","|","\u0331"],AltRight:["\r","\r","\r","\r"],MetaRight:[".",".",".","."]}},Tm={id:"apple.spanish",locale:"es",displayName:"Spanish ISO",platform:"apple",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\xDF",""],KeyC:["c","C","\xA9"," "],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\u20AC","\u20AC"],KeyF:["f","F","\u0192","\uFB01"],KeyG:["g","G","\uF8FF","\uFB02"],KeyH:["h","H","\u2122"," "],KeyI:["i","I"," "," "],KeyJ:["j","J","\xB6","\xAF"],KeyK:["k","K","\xA7","\u02C7"],KeyL:["l","L"," ","\u02D8"],KeyM:["m","M","\xB5","\u02DA"],KeyN:["n","N"," ","\u02D9"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\u0153","\u0152"],KeyR:["r","R","\xAE"," "],KeyS:["s","S","\u222B"," "],KeyT:["t","T","\u2020","\u2021"],KeyU:["u","U"," "," "],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\xE6","\xC6"],KeyX:["x","X","\u2211","\u203A"],KeyY:["y","Y","\xA5"," "],KeyZ:["z","Z","\u03A9","\u2039"],Digit1:["1","!","|","\u0131"],Digit2:["2",'"',"@","\u02DD"],Digit3:["3","\xB7","#","\u2022"],Digit4:["4","$","\xA2","\xA3"],Digit5:["5","%","\u221E","\u2030"],Digit6:["6","&","\xAC"," "],Digit7:["7","/","\xF7","\u2044"],Digit8:["8","(","\u201C","\u2018"],Digit9:["9",")","\u201D","\u2019"],Digit0:["0","=","\u2260","\u2248"],Space:[" "," "," "," "],Minus:["'","?","\xB4","\xB8"],Equal:["\xA1","\xBF","\u201A","\u02DB"],BracketLeft:["`","^","[","\u02C6"],BracketRight:["+","*","]","\xB1"],Backslash:["\xE7","\xC7","}","\xBB"],Semicolon:["\xF1","\xD1","~","\u02DC"],Quote:["\xB4","\xA8","{","\xAB"],Backquote:["<",">","\u2264","\u2265"],Comma:[",",";","\u201E",""],Period:[".",":","\u2026","\u2026"],Slash:["-","_","\u2013","\u2014"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[",",",",",",","],IntlBackslash:["\xBA","\xAA","\\","\xB0"]}},Pm={id:"windows.spanish",locale:"es",displayName:"Spanish",platform:"windows",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["z","Z","",""],Digit1:["1","!","|",""],Digit2:["2",'"',"@",""],Digit3:["3","\xB7","#",""],Digit4:["4","$","~",""],Digit5:["5","%","\u20AC",""],Digit6:["6","&","\xAC",""],Digit7:["7","/","",""],Digit8:["8","(","",""],Digit9:["9",")","",""],Digit0:["0","=","",""],Space:[" "," ","",""],Minus:["'","?","",""],Equal:["\xA1","\xBF","",""],BracketLeft:["`","^","[",""],BracketRight:["+","*","]",""],Backslash:["\xE7","\xC7","}",""],Semicolon:["\xF1","\xD1","",""],Quote:["\xB4","\xA8","{",""],Backquote:["\xBA","\xAA","\\",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},Im={id:"linux.spanish",locale:"es",displayName:"Spanish",platform:"linux",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","\xE6","\xC6"],KeyB:["b","B","\u201D","\u2019"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\xA2"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0309","\u031B"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:["m","M","\xB5","\xBA"],KeyN:["n","N","n","N"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["q","Q","@","\u03A9"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201C","\u2018"],KeyW:["w","W","\u0142","\u0141"],KeyX:["x","X","\xBB",">"],KeyY:["y","Y","\u2190","\xA5"],KeyZ:["z","Z","\xAB","<"],Digit1:["1","!","|","\xA1"],Digit2:["2",'"',"@","\u215B"],Digit3:["3","\xB7","#","\xA3"],Digit4:["4","$","~","$"],Digit5:["5","%","\xBD","\u215C"],Digit6:["6","&","\xAC","\u215D"],Digit7:["7","/","{","\u215E"],Digit8:["8","(","[","\u2122"],Digit9:["9",")","]","\xB1"],Digit0:["0","=","}","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:["'","?","\\","\xBF"],Equal:["\xA1","\xBF","\u0303","~"],BracketLeft:["\u0300","\u0302","[","\u030A"],BracketRight:["+","*","]","\u0304"],Backslash:["\xE7","\xC7","}","\u0306"],Semicolon:["\xF1","\xD1","~","\u030B"],Quote:["\u0301","\u0308","{","{"],Backquote:["\xBA","\xAA","\\","\\"],Comma:[",",";","\u2500","\xD7"],Period:[".",":","\xB7","\xF7"],Slash:["-","_","\u0323","\u0307"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadEnter:["\r","\r","\r","\r"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}};function f0(a){const y=a.split("+"),b={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:y.pop()};return y.includes("shift")&&(b.shift=!0),y.includes("alt")&&(b.alt=!0),y.includes("ctrl")&&(b.ctrl=!0),y.includes("cmd")&&(b.cmd=!0),y.includes("win")&&(b.win=!0),y.includes("meta")&&(b.meta=!0),b}function su(a){let y="";return a.shift&&(y+="shift+"),a.alt&&(y+="alt+"),a.ctrl&&(y+="ctrl+"),a.cmd&&(y+="cmd+"),a.win&&(y+="win+"),a.meta&&(y+="meta+"),y+a.key}var Bm={enter:"[Enter]",escape:"[Escape]",backspace:"[Backspace]",tab:"[Tab]",space:"[Space]",pausebreak:"[Pause]",insert:"[Insert]",home:"[Home]",pageup:"[PageUp]",delete:"[Delete]",end:"[End]",pagedown:"[PageDown]",right:"[ArrowRight]",left:"[ArrowLeft]",down:"[ArrowDown]",up:"[ArrowUp]",numpad0:"[Numpad0]",numpad1:"[Numpad1]",numpad2:"[Numpad2]",numpad3:"[Numpad3]",numpad4:"[Numpad4]",numpad5:"[Numpad5]",numpad6:"[Numpad6]",numpad7:"[Numpad7]",numpad8:"[Numpad8]",numpad9:"[Numpad9]",numpad_divide:"[NumpadDivide]",numpad_multiply:"[NumpadMultiply]",numpad_subtract:"[NumpadSubtract]",numpad_add:"[NumpadAdd]",numpad_decimal:"[NumpadDecimal]",numpad_separator:"[NumpadComma]",capslock:"[Capslock]",f1:"[F1]",f2:"[F2]",f3:"[F3]",f4:"[F4]",f5:"[F5]",f6:"[F6]",f7:"[F7]",f8:"[F8]",f9:"[F9]",f10:"[F10]",f11:"[F11]",f12:"[F12]",f13:"[F13]",f14:"[F14]",f15:"[F15]",f16:"[F16]",f17:"[F17]",f18:"[F18]",f19:"[F19]"},md=[],gd;function gf(){switch(st()){case"macos":case"ios":return"apple";case"windows":return"windows"}return"linux"}function Ko(a){(!a.platform||a.platform===gf())&&md.push(a)}function Om(a,y){var b;const E={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:""};if(!a)return E;for(const[ee,re]of Object.entries(y.mapping)){if(re[0]===a)return E.key=`[${ee}]`,E;if(re[1]===a)return E.shift=!0,E.key=`[${ee}]`,E;if(re[2]===a)return E.alt=!0,E.key=`[${ee}]`,E;if(re[3]===a)return E.shift=!0,E.alt=!0,E.key=`[${ee}]`,E}return E.key=(b=Bm[a])!=null?b:"",E}function Rm(a){if(a.code)return a;const y=Object.entries(vd().mapping);let b=!1,E=!1,ee="";for(let re=0;re<4;re++){for(const[ae,ue]of y)if(ue[re]===a.key){ee=ae,re===3?(b=!0,E=!0):re===2?b=!0:re===1&&(E=!0);break}if(ee)break}return new KeyboardEvent(a.type,ke(Ce({},a),{altKey:b,shiftKey:E,code:ee}))}function Nm(a){var y,b;if(!a||a.key==="Unidentified"||a.key==="Dead")return;const E=a.shiftKey&&a.altKey?3:a.altKey?2:a.shiftKey?1:0;for(const ee of md)((y=ee.mapping[a.code])==null?void 0:y[E])===a.key?ee.score+=1:(b=ee.mapping[a.code])!=null&&b[E]&&(ee.score=0);md.sort((ee,re)=>re.score-ee.score)}function $m(a){gd=md.find(y=>a.startsWith(y.locale))}function vd(){return gd!=null?gd:md[0]}function Fm(){switch(gf()){case"apple":return mf;case"windows":return d0;case"linux":return h0}return mf}switch(gf()){case"apple":Ko(mf),Ko(_m),Ko(Tm),Ko(Lm);break;case"windows":Ko(d0),Ko(km),Ko(Pm),Ko(Dm);break;case"linux":Ko(h0),Ko(Em),Ko(Im),Ko(Am);break}Ko(Mm);function vf(a){var y;const b=/macos|ios/.test(st()),E=a.split("+");let ee="";for(const re of E)ee&&(ee+=b?"\u2009":'<span class="ML__shortcut-join">+</span>'),re.startsWith("[Key")?ee+=re.slice(4,5):re.startsWith("Key")?ee+=re.slice(3,4):re.startsWith("[Digit")?ee+=re.slice(6,7):re.startsWith("Digit")?ee+=re.slice(5,6):ee+=(y={cmd:"\u2318",meta:b?"\u2318":"Ctrl",shift:b?"\u21E7":"Shift",alt:b?"\u2325":"Alt",ctrl:b?"\u2303":"Ctrl","\n":b?"\u23CE":"Return","[return]":b?"\u23CE":"Return","[enter]":b?"\u2324":"Enter","[tab]":b?"\u21E5":"Tab","[escape]":"Esc","[backspace]":b?"\u232B":"Backspace","[delete]":b?"\u2326":"Del","[pageup]":b?"\u21DE":"Page Up","[pagedown]":b?"\u21DF":"Page Down","[home]":b?"\u2912":"Home","[end]":b?"\u2913":"End","[space]":"Space","[equal]":"=","[minus]":"-","[comma]":",","[slash]":"/","[backslash]":"\\","[bracketleft]":"[","[bracketright]":"]",semicolon:";",period:".",comma:",",minus:"-",equal:"=",quote:"'",backslash:"\\",intlbackslash:"\\",backquote:"`",slash:"/",numpadmultiply:"* &#128290;",numpaddivide:"/ &#128290;",numpadsubtract:"- &#128290;",numpadadd:"+ &#128290;",numpaddecimal:". &#128290;",numpadcomma:", &#128290;",help:"help",left:"\u21E0",up:"\u21E1",right:"\u21E2",down:"\u21E3","[arrowleft]":"\u21E0","[arrowup]":"\u21E1","[arrowright]":"\u21E2","[arrowdown]":"\u21E3"}[re.toLowerCase()])!=null?y:re.toUpperCase();return ee}function xh(a){if(a instanceof MouseEvent||a instanceof PointerEvent)return{x:a.clientX,y:a.clientY};if(a instanceof TouchEvent){const y=[...a.touches].reduce((E,ee)=>({x:E.x+ee.clientX,y:E.y+ee.clientY}),{x:0,y:0}),b=a.touches.length;return{x:y.x/b,y:y.y/b}}}function fc(a){const y={alt:!1,control:!1,shift:!1,meta:!1};return(a instanceof MouseEvent||a instanceof PointerEvent||a instanceof TouchEvent||a instanceof KeyboardEvent)&&(a.altKey&&(y.alt=!0),a.ctrlKey&&(y.control=!0),a.metaKey&&(y.meta=!0),a.shiftKey&&(y.shift=!0)),y}function zm(a,y){return!a&&y||a&&!y?!1:!a||!y?!0:a.alt===y.alt&&a.control===y.control&&a.shift===y.shift&&a.meta===y.meta}var Km=new Set(["Backquote","Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","Minus","Equal","IntlYen","KeyQ","KeyW","KeyE","KeyR","KeyT","KeyY","KeyU","KeyI","KeyO","KeyP","BracketLeft","BracketRight","Backslash","KeyA","KeyS","KeyD","KeyF","KeyG","KeyH","KeyJ","KeyK","KeyL","Semicolon","Quote","IntlBackslash","KeyZ","KeyX","KeyC","KeyV","KeyB","KeyN","KeyM","Comma","Period","Slash","IntlRo","Space","Numpad0","Numpad1","Numpad2","Numpad3","Numpad4","Numpad5","Numpad6","Numpad7","Numpad8","Numpad9","NumpadAdd","NumpadComma","NumpadDecimal","NumpadDivide","NumpadEqual","NumpadHash","NumpadMultiply","NumpadParenLeft","NumpadParenRight","NumpadStar","NumpadSubstract"]);function wh(a){return a.ctrlKey||a.metaKey||["Dead","Process"].includes(a.key)?!1:a.code===""?!0:Km.has(a.code)}function Sh(){var a;let y=document.activeElement;for(;(a=y==null?void 0:y.shadowRoot)!=null&&a.activeElement;)y=y.shadowRoot.activeElement;return y}var Fs=class yl{static get scrim(){return yl._scrim||(yl._scrim=new yl),yl._scrim}static open(y){yl.scrim.open(y)}static close(){yl.scrim.close()}static get state(){return yl.scrim.state}static get element(){return yl.scrim.element}constructor(y){var b,E;this.lightDismiss=(b=y==null?void 0:y.lightDismiss)!=null?b:!0,this.translucent=(E=y==null?void 0:y.translucent)!=null?E:!1,this.state="closed"}get element(){if(this._element)return this._element;const y=document.createElement("div");return y.setAttribute("role","presentation"),y.style.position="fixed",y.style.contain="content",y.style.top="0",y.style.left="0",y.style.right="0",y.style.bottom="0",y.style.zIndex="var(--scrim-zindex, 10099)",y.style.outline="none",this.translucent?(y.style.background="rgba(255, 255, 255, .2)",y.style.backdropFilter="contrast(40%)"):y.style.background="transparent",this._element=y,y}open(y){var b;if(this.state!=="closed")return;this.state="opening",this.onDismiss=y==null?void 0:y.onDismiss,this.savedActiveElement=Sh();const{element:E}=this;((b=y==null?void 0:y.root)!=null?b:document.body).appendChild(E),E.addEventListener("click",this),document.addEventListener("touchmove",this,!1),document.addEventListener("scroll",this,!1);const ee=window.innerWidth-document.documentElement.clientWidth;this.savedMarginRight=document.body.style.marginRight,this.savedOverflow=document.body.style.overflow,document.body.style.overflow="hidden";const re=Number.parseFloat(getComputedStyle(document.body).marginRight);document.body.style.marginRight=`${re+ee}px`,y!=null&&y.child&&E.append(y.child),this.state="open"}close(){var y,b,E,ee;if(this.state!=="open"){console.assert(this.element.parentElement!==null);return}this.state="closing",typeof this.onDismiss=="function"&&this.onDismiss(),this.onDismiss=void 0;const{element:re}=this;re.removeEventListener("click",this),document.removeEventListener("touchmove",this,!1),document.removeEventListener("scroll",this,!1),re.remove(),document.body.style.overflow=(y=this.savedOverflow)!=null?y:"",document.body.style.marginRight=(b=this.savedMarginRight)!=null?b:"",Sh()!==this.savedActiveElement&&((ee=(E=this.savedActiveElement)==null?void 0:E.focus)==null||ee.call(E)),re.innerHTML="",this.state="closed"}handleEvent(y){this.lightDismiss&&(y.target===this._element&&y.type==="click"?(this.close(),y.preventDefault(),y.stopPropagation()):y.target===document&&(y.type==="touchmove"||y.type==="scroll")&&(this.close(),y.preventDefault(),y.stopPropagation()))}};function Hm(a,y,b){let E=null,ee=null,re=!1,ae=!1,ue=!1;const he=new AbortController,ge=he.signal;return a.addEventListener("keydown",be=>{if(re||be.key==="Process"||be.code==="CapsLock"||/(Control|Meta|Alt|Shift)(Left|Right)/.test(be.code)){E=null;return}E=be,ee=null,b.onKeystroke(be)?a.textContent="":E=null},{capture:!0,signal:ge}),a.addEventListener("keypress",be=>{re||(E&&ee&&b.onKeystroke(E),ee=be)},{capture:!0,signal:ge}),a.addEventListener("compositionstart",be=>{a.textContent="",re=!0,b.onCompositionStart(be.data)},{capture:!0,signal:ge}),a.addEventListener("compositionupdate",be=>{re&&b.onCompositionUpdate(be.data)},{capture:!0,signal:ge}),a.addEventListener("compositionend",be=>{a.textContent="",re&&(re=!1,b.onCompositionEnd(be.data))},{capture:!0,signal:ge}),a.addEventListener("beforeinput",be=>be.stopImmediatePropagation(),{signal:ge}),a.addEventListener("input",be=>{var Be;if(!re&&(a.textContent="",be.inputType!=="insertCompositionText")){if(be.inputType==="insertFromPaste"){be.preventDefault(),be.stopPropagation();return}b.onInput((Be=be.data)!=null?Be:""),be.preventDefault(),be.stopPropagation()}},{signal:ge}),a.addEventListener("paste",be=>{a.focus({preventScroll:!0}),a.textContent="",b.onPaste(be)||be.preventDefault(),be.stopImmediatePropagation()},{signal:ge}),a.addEventListener("cut",be=>b.onCut(be),{capture:!0,signal:ge}),a.addEventListener("copy",be=>b.onCopy(be),{capture:!0,signal:ge}),a.addEventListener("blur",be=>{var Be,He;if(((He=(Be=be.relatedTarget)==null?void 0:Be._mathfield)==null?void 0:He.element)===y){a.focus({preventScroll:!0}),be.preventDefault(),be.stopPropagation();return}const lt=Fs.state;if(lt==="open"||lt==="opening"){be.preventDefault(),be.stopPropagation();return}if(be.relatedTarget===be.target.getRootNode().host){be.preventDefault(),be.stopPropagation();return}ue||ae||(ue=!0,E=null,ee=null,b.onBlur(),ue=!1)},{capture:!0,signal:ge}),a.addEventListener("focus",be=>{ue||ae||(ae=!0,b.onFocus(),ae=!1)},{capture:!0,signal:ge}),{dispose:()=>he.abort(),cancelComposition:()=>{re&&(a.blur(),requestAnimationFrame(()=>a.focus({preventScroll:!0})))},blur:()=>{typeof a.blur=="function"&&a.blur()},focus:()=>{!ae&&typeof a.focus=="function"&&a.focus({preventScroll:!0})},hasFocus:()=>Sh()===a,setAriaLabel:be=>a.setAttribute("aria-label",be),setValue:be=>{var Be;a.textContent=be,a.style.left="-1000px",(Be=window.getSelection())==null||Be.selectAllChildren(a)},moveTo:(be,Be)=>{a.style.top=`${Be}px`,a.style.left=`${be}px`}}}function lu(a){var y;if(!a||!wh(a))return"";let b;return a.key==="Unidentified"&&a.target&&(b=a.target.value),b=(y=b!=null?b:a.key)!=null?y:a.code,/^(Dead|Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(b)&&(b=""),b}function p0(a){a=Rm(a);const y=[];return a.ctrlKey&&y.push("ctrl"),a.metaKey&&y.push("meta"),a.altKey&&y.push("alt"),a.shiftKey&&y.push("shift"),y.length===0?`[${a.code}]`:(y.push(`[${a.code}]`),y.join("+"))}function Wm(a){if(kt()){const y=st(),b=a.startsWith("!"),E=a.endsWith(y);if(b&&!E||!b&&E)return!0}return a==="!other"?!1:a==="other"}function Zm(a,y,b){if(a.length===0)return"";const E=su(f0(p0(b))),ee=su({key:b.key,shift:b.shiftKey,alt:b.altKey,ctrl:b.ctrlKey,meta:b.metaKey||b.ctrlKey&&/macos|ios/.test(st()),cmd:!1,win:!1});for(let re=a.length-1;re>=0;re--)if((a[re].key===E||a[re].key===ee)&&(!a[re].ifMode||a[re].ifMode===y))return a[re].command;return""}function m0(a){let y=a;return Oe(y)&&(y=y.length>0?y[0]+"("+y.slice(1).join("")+")":""),y}function jm(a,y){let b=[];if(typeof y=="string"){const re=rd[y];Oe(re)?b=re.slice():re&&b.push(re)}const E=m0(y),ee=new RegExp("^"+E.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");for(const re of a)ee.test(m0(re.command))&&b.push(re.key);return b.map(vf)}function Vm(a,y){if(a.ifPlatform&&!/^!?(macos|windows|android|ios|chromeos|other)$/.test(a.ifPlatform))throw new Error(`Unexpected platform "${a.ifPlatform}" for keybinding ${a.key}`);if(a.ifLayout!==void 0&&(y.score===0||!a.ifLayout.includes(y.id)))return;const b=f0(a.key);let E=a.ifPlatform;if(b.cmd){if(E&&E!=="macos"&&E!=="ios")throw new Error('Unexpected "cmd" modifier with platform "'+E+`"
"cmd" modifier can only be used with macOS or iOS platform.`);E||(E=st()==="ios"?"ios":"macos"),b.win=!1,b.cmd=!1,b.meta=!0}if(b.win){if(E&&E!=="windows")throw new Error('Unexpected "win" modifier with platform "'+E+`"
"win" modifier can only be used with Windows platform.`);E="windows",b.win=!1,b.cmd=!1,b.meta=!0}if(E&&!Wm(E))return;if(/^\[.+\]$/.test(b.key))return ke(Ce({},a),{key:su(b)});const ee=Om(b.key,y);if(!ee)return ke(Ce({},a),{key:su(b)});if(ee.shift&&b.shift||ee.alt&&b.alt)throw new Error(`The keybinding ${a.key} (${yf(a.command)}) is conflicting with the key combination ${su(ee)} using the ${y.displayName} keyboard layout`);return ee.shift=ee.shift||b.shift,ee.alt=ee.alt||b.alt,ee.meta=b.meta,ee.ctrl=b.ctrl,ke(Ce({},a),{key:su(ee)})}function yf(a){if(Array.isArray(a)){const y=[...a];return y.shift()+"("+y.map(b=>typeof b=="string"?`"${b}"`:b.toString()).join(", ")+")"}return a}function Um(a,y){const b=[],E=[];for(const ee of a)try{const re=Vm(ee,y);if(!re)continue;const ae=E.find(ue=>ue.key===re.key&&ue.ifMode===re.ifMode);if(ae)throw new Error(`Ambiguous key binding ${ee.key} (${yf(ee.command)}) matches ${ae.key} (${yf(ae.command)}) with the ${y.displayName} keyboard layout`);E.push(re)}catch(re){re instanceof Error&&b.push(re.message)}return[E,b]}var Gm=class extends si{constructor(){super("latex")}createAtom(a){return new Ja(a)}onPaste(a,y){if(!y)return!1;const b=typeof y=="string"?y:y.getData("application/x-latex")||y.getData("text/plain");return b&&a.model.contentWillChange({inputType:"insertFromPaste",data:b})?(a.stopCoalescingUndo(),a.stopRecording(),this.insert(a.model,b)&&(a.startRecording(),a.snapshot("paste"),a.model.contentDidChange({inputType:"insertFromPaste"}),va(a)),a.startRecording(),!0):!1}insert(a,y,b){if(!a.contentWillChange({data:y,inputType:"insertText"}))return!1;b||(b={}),b.insertionMode||(b.insertionMode="replaceSelection"),b.selectionMode||(b.selectionMode="placeholder");const{silenceNotifications:E}=a;b.silenceNotifications&&(a.silenceNotifications=!0);const ee=a.silenceNotifications;a.silenceNotifications=!0,b.insertionMode==="replaceSelection"&&!a.selectionIsCollapsed?a.deleteAtoms(Wa(a.selection)):b.insertionMode==="replaceAll"?(a.root.setChildren([],"body"),a.position=0):b.insertionMode==="insertBefore"?a.collapseSelection("backward"):b.insertionMode==="insertAfter"&&a.collapseSelection("forward");const re=[];for(const he of y)oe.test(he)&&re.push(new Ja(he));let ae=a.at(a.position);if(ae instanceof ud&&(ae=ae.lastChild),!(ae.parent instanceof ud)){const he=new ud("");ae.parent.addChildAfter(he,ae),ae=he.firstChild}const ue=ae.parent.addChildrenAfter(re,ae);return a.silenceNotifications=ee,b.selectionMode==="before"||(b.selectionMode==="item"?a.setSelection(a.anchor,a.offsetOf(ue)):ue&&(a.position=a.offsetOf(ue))),a.contentDidChange({data:y,inputType:"insertText"}),a.silenceNotifications=E,!0}};function Xm(a){return a.atoms.find(y=>y.type==="latexgroup")}function yd(a){var y,b;const E=a.atoms.find(ee=>ee.type==="latexgroup");return E?(b=(y=E.body)==null?void 0:y.filter(ee=>ee.type==="latex"))!=null?b:[]:[]}function g0(a,y){var b;let E=0,ee=!1;const re=Number.isFinite(y==null?void 0:y.before)?(b=y==null?void 0:y.before)!=null?b:0:a.lastOffset;for(;E<=re&&!ee;){const he=a.at(E);ee=he instanceof Ja&&he.isSuggestion,ee||E++}if(!ee)return[void 0,void 0];let ae=E,ue=!1;for(;ae<=re&&!ue;){const he=a.at(ae);ue=!(he instanceof Ja&&he.isSuggestion),ue||ae++}return[E-1,ae-1]}new Gm;function Ch(a){const y=yd(a.model).filter(b=>b.isSuggestion);if(y.length!==0){a.model.position=a.model.offsetOf(y[0].leftSibling);for(const b of y)b.parent.removeChild(b)}}function bd(a,y){var b;const{model:E}=a;Ch(a);for(const be of yd(E))be.isError=!1;if(!E.selectionIsCollapsed||a.options.popoverPolicy==="off"){uu(a);return}const ee=[];let re=E.at(E.position);for(;re&&re instanceof Ja&&/^[a-zA-Z\*]$/.test(re.value);)re=re.leftSibling;if(re&&re instanceof Ja&&re.value==="\\")for(ee.push(re),re=re.rightSibling;re&&re instanceof Ja&&/^[a-zA-Z\*]$/.test(re.value);)ee.push(re),re=re.rightSibling;const ae=ee.map(be=>be.value).join(""),ue=Jt(a,ae);if(ue.length===0){if(/^\\[a-zA-Z\*]+$/.test(ae))for(const be of ee)be.isError=!0;uu(a);return}const he=(b=y==null?void 0:y.atIndex)!=null?b:0;a.suggestionIndex=he<0?ue.length-1:he%ue.length;const ge=ue[a.suggestionIndex];if(ge!==ae){const be=ee[ee.length-1];be.parent.addChildrenAfter([...ge.slice(ae.length-ge.length)].map(Be=>new Ja(Be,{isSuggestion:!0})),be),pc(a,{interactive:!0})}qm(a,ue)}function v0(a){const[y,b]=g0(a,{before:a.position});if(y===void 0||b===void 0)return!1;let E=!1;return a.getAtoms([y,b]).forEach(ee=>{ee.isSuggestion&&(ee.isSuggestion=!1,E=!0)}),E}function cu(a,y="accept",b){var E,ee;uu(a);const re=Xm(a.model);if(!re)return!1;if(y==="accept-suggestion"||y==="accept-all"){const ge=yd(a.model).filter(be=>be.isSuggestion);if(ge.length!==0){for(const be of ge)be.isSuggestion=!1;a.model.position=a.model.offsetOf(ge[ge.length-1])}if(y==="accept-suggestion")return ge.length!==0}const ue=yd(a.model).filter(ge=>!ge.isSuggestion).map(ge=>ge.value).join(""),he=re.leftSibling;return re.parent.removeChild(re),a.model.position=a.model.offsetOf(he),a.switchMode((E=b==null?void 0:b.mode)!=null?E:"math"),y==="reject"||(si.insert(a.model,ue,{selectionMode:(ee=b==null?void 0:b.selectItem)!=null&&ee?"item":"placeholder",format:"latex",mode:"math"}),a.snapshot(),a.model.announce("replacement"),a.switchMode("math")),!0}function Mh(a){var y;let b=document.getElementById(a);return b?b.dataset.refcount=Number(Number.parseInt((y=b.dataset.refcount)!=null?y:"0")+1).toString():(b=document.createElement("div"),b.setAttribute("aria-hidden","true"),b.dataset.refcount="1",b.id=a,document.body.append(b)),b}function bf(a){var y;const b=document.getElementById(a);if(!b)return;const E=Number.parseInt((y=b.getAttribute("data-refcount"))!=null?y:"0");E<=1?b.remove():b.dataset.refcount=Number(E-1).toString()}function Ym(a,y){const b=new Di({from:a.context}),E=new Dn({mode:"math",type:"root",body:ja(y,{context:b})}),ee=Yc(fd(new ir(E.render(b),{classes:"ML__base"}),b));return qc(ee,{classes:"ML__latex"}).toMarkup()}function qm(a,y){var b;if(y.length===0){uu(a);return}let E="";for(const[re,ae]of y.entries()){const ue=ae,he=Ym(a,ae),ge=jm(a.keybindings,ue).join("<br>");E+=`<li role="button" data-command="${ue}" ${re===a.suggestionIndex?"class=ML__popover__current":""}><span class="ML__popover__latex">${ue}</span><span class="ML__popover__command">${he}</span>`,ge&&(E+=`<span class="ML__popover__keybinding">${ge}</span>`),E+="</li>"}const ee=Jm(a,`<ul>${E}</ul>`);xf()&&((b=ee.querySelector(".ML__popover__current"))==null||b.scrollIntoView({block:"nearest",inline:"nearest"})),setTimeout(()=>{var re;ee&&!xf()&&(ee.classList.add("is-visible"),_h(a),(re=ee.querySelector(".ML__popover__current"))==null||re.scrollIntoView({block:"nearest",inline:"nearest"}))},32)}function xf(){const a=document.getElementById("mathlive-suggestion-popover");return a?a.classList.contains("is-visible"):!1}function _h(a,y){var b;if(!a.element||a.element.mathfield!==a||!xf())return;if(((b=a.model.at(a.model.position))==null?void 0:b.type)!=="latex"){uu(a);return}if(y!=null&&y.deferred){setTimeout(()=>_h(a),32);return}const E=Ns(a.field);if(!E)return;const ee=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,re=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,ae=window.innerWidth-document.documentElement.clientWidth,ue=window.innerHeight-document.documentElement.clientHeight,he=window.mathVirtualKeyboard.boundingRect.height,ge=document.getElementById("mathlive-suggestion-popover");E.x+ge.offsetWidth/2>re-ae?ge.style.left=`${re-ge.offsetWidth-ae}px`:E.x-ge.offsetWidth/2<0?ge.style.left="0":ge.style.left=`${E.x-ge.offsetWidth/2}px`;const be=E.y-E.height;ee-ue-he-E.y<be?(ge.classList.add("ML__popover--reverse-direction"),ge.classList.remove("top-tip"),ge.classList.add("bottom-tip"),ge.style.top=`${E.y-E.height-ge.offsetHeight-15}px`):(ge.classList.remove("ML__popover--reverse-direction"),ge.classList.add("top-tip"),ge.classList.remove("bottom-tip"),ge.style.top=`${E.y+15}px`)}function uu(a){a.suggestionIndex=0;const y=document.getElementById("mathlive-suggestion-popover");y&&(y.classList.remove("is-visible"),y.innerHTML="")}function Jm(a,y){let b=document.getElementById("mathlive-suggestion-popover");return b||(b=Mh("mathlive-suggestion-popover"),Bo("suggestion-popover"),Bo("core"),b.addEventListener("pointerdown",E=>E.preventDefault()),b.addEventListener("click",E=>{let ee=E.target;for(;ee&&!ee.dataset.command;)ee=ee.parentElement;ee&&(cu(a,"reject"),si.insert(a.model,ee.dataset.command,{selectionMode:"placeholder",format:"latex",mode:"math"}),a.dirty=!0,a.focus())})),b.innerHTML=window.MathfieldElement.createHTML(y),b}function Qm(){document.getElementById("mathlive-suggestion-popover")&&(bf("mathlive-suggestion-popover"),x("suggestion-popover"),x("core"))}function eg(){const a=String(new Error().stack).replace(/^Error.*\n/,"").split(`
`);if(a.length===0)return console.error(`Can't use relative paths to specify assets location because the sourcefile location could not be determined (unexpected stack trace format "${new Error().stack}").`),"";let y=a[1],b=y.match(/http.*\.ts[\?:]/);return b&&(y=a[2]),b=y.match(/(https?:.*):[0-9]+:[0-9]+/),b||(b=y.match(/at (.*(\.ts))[\?:]/),b||(b=y.match(/at (.*(\.mjs|\.js))[\?:]/))),b?b[1]:(console.error(a),console.error(`Can't use relative paths to specify assets location because the source file location could not be determined (unexpected location "${y}").`),"")}var kh=null,y0,b0,wf=((b0=(y0=globalThis==null?void 0:globalThis.document)==null?void 0:y0.currentScript)==null?void 0:b0.src)||eg();function x0(a){return zl(this,null,function*(){if(/^(?:[a-z+]+:)?\/\//i.test(a))return new URL(a).href;if(kh===null)try{const y=yield fetch(wf,{method:"HEAD"});y.status===200&&(kh=y.url)}catch(y){console.error(`Invalid URL "${a}" (relative to "${wf}")`)}return new URL(a,kh!=null?kh:wf).href})}function tg(a,y,b={}){return new FontFace(a,`url(${y}.woff2) format('woff2')`,b)}var Ho="not-loaded";function ng(){return zl(this,null,function*(){return Ho="not-loaded",Eh()})}function Eh(){return zl(this,null,function*(){var a;if(Ho!=="not-loaded")return;if(Ho="loading",(a=getComputedStyle(document.documentElement).getPropertyValue("--ML__static-fonts"))!=null?a:!1){Ho="ready";return}if(document.body.classList.remove("ML__fonts-did-not-load"),"fonts"in document){const b=["KaTeX_Main","KaTeX_Math","KaTeX_AMS","KaTeX_Caligraphic","KaTeX_Fraktur","KaTeX_SansSerif","KaTeX_Script","KaTeX_Typewriter","KaTeX_Size1","KaTeX_Size2","KaTeX_Size3","KaTeX_Size4"],E=Array.from(document.fonts).map(ae=>ae.family);if(b.every(ae=>E.includes(ae))){Ho="ready";return}if(!window.MathfieldElement.fontsDirectory){Ho="not-loaded";return}const ee=yield x0(window.MathfieldElement.fontsDirectory);if(!ee){document.body.classList.add("ML__fonts-did-not-load"),Ho="error";return}const re=[["KaTeX_Main-Regular"],["KaTeX_Main-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_Main-Bold",{weight:"bold"}],["KaTeX_Main-Italic",{style:"italic"}],["KaTeX_Math-Italic",{style:"italic"}],["KaTeX_Math-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_AMS-Regular"],["KaTeX_Caligraphic-Regular"],["KaTeX_Caligraphic-Bold",{weight:"bold"}],["KaTeX_Fraktur-Regular"],["KaTeX_Fraktur-Bold",{weight:"bold"}],["KaTeX_SansSerif-Regular"],["KaTeX_SansSerif-Bold",{weight:"bold"}],["KaTeX_SansSerif-Italic",{style:"italic"}],["KaTeX_Script-Regular"],["KaTeX_Typewriter-Regular"],["KaTeX_Size1-Regular"],["KaTeX_Size2-Regular"],["KaTeX_Size3-Regular"],["KaTeX_Size4-Regular"]].map(ae=>tg(ae[0].replace(/-[a-zA-Z]+$/,""),`${ee}/${ae[0]}`,ae[1]));try{(yield Promise.all(re.map(ue=>{try{return ue.load()}catch(he){}}))).forEach(ue=>document.fonts.add(ue)),Ho="ready";return}catch(ae){console.error(`MathLive 0.98.5: The math fonts could not be loaded from "${ee}"`,{cause:ae}),document.body.classList.add("ML__fonts-did-not-load")}Ho="error"}})}function rg(a){let y=0;for(let b=0;b<a.length;b++)y=y*31+a.charCodeAt(b),y=y|0;return Math.abs(y)}function va(a,y){a&&(a.dirty||(a.dirty=!0,requestAnimationFrame(()=>{Fo(a)&&a.dirty&&(a.atomBoundsCache=new Map,pc(a,y),a.atomBoundsCache=void 0)})))}function ig(a,y){var b;y=y!=null?y:{};const E=new Di({from:ke(Ce({},a.context),{atomIdsSettings:{seed:y.forHighlighting?rg(Dn.serialize([a.model.root],{expandMacro:!1,defaultMode:a.options.defaultMode})):"random",groupNumbers:(b=y.forHighlighting)!=null?b:!1},letterShapeStyle:a.options.letterShapeStyle}),mathstyle:a.options.defaultMode==="inline-math"?"textstyle":"displaystyle"}),ee=a.model.root.render(E);return qc(fd(ee,E),{classes:a.hasEditablePrompts?"ML__latex ML__prompting":"ML__latex",attributes:{translate:"no","aria-hidden":"true"}})}function w0(a,y){const{model:b}=a;b.root.caret=void 0,b.root.isSelected=!1,b.root.containsCaret=!0;for(const ee of b.atoms)ee.caret=void 0,ee.isSelected=!1,ee.containsCaret=!1;if(b.selectionIsCollapsed){const ee=b.at(b.position);ee.caret=a.model.mode;let re=ee.parent;for(;re;)re.containsCaret=!0,re=re.parent}else{const ee=b.getAtoms(b.selection,{includeChildren:!0});for(const re of ee)re.isSelected=!0}return ig(a,y).toMarkup()}function pc(a,y){if(!Fo(a))return;y!=null||(y={});const b=a.element.querySelector("[part=virtual-keyboard-toggle]");b&&(b.style.display=a.hasEditableContent?"":"none");const E=a.field;if(!E)return;const ee=a.isSelectionEditable&&a.hasFocus(),re=E.classList.contains("ML__focused");re&&!ee?E.classList.remove("ML__focused"):!re&&ee&&E.classList.add("ML__focused");let ae=w0(a,y);const ue=a.element.querySelector("[part=menu-toggle]");if(ue&&(a.model.atoms.length<=1||a.disabled||a.readOnly&&!a.hasEditableContent||a.userSelect==="none"?ue.style.display="none":ue.style.display=""),a.model.atoms.length<=1){const he=a.options.contentPlaceholder;he&&(ae+=`<span part=placeholder class="ML__content-placeholder">${Va(he)}</span>`)}E.innerHTML=window.MathfieldElement.createHTML(ae),Lh(a,y.interactive),a.dirty=!1}function Lh(a,y){const b=a.field;if(!b)return;for(const ue of b.querySelectorAll(".ML__selection, .ML__contains-highlight"))ue.remove();!(y!=null&&y)&&Ho!=="error"&&Ho!=="ready"&&setTimeout(()=>{Ho==="ready"?Lh(a):setTimeout(()=>Lh(a),128)},32);const E=a.model,ee=b.offsetWidth,re=b.getBoundingClientRect().width;let ae=Math.floor(re)/ee;if(ae=isNaN(ae)?1:ae,E.selectionIsCollapsed){_h(a,{deferred:!0});let ue=E.at(E.position);for(;ue&&ue.type!=="prompt"&&!(ue.containsCaret&&ue.displayContainsHighlight);)ue=ue.parent;if(ue!=null&&ue.containsCaret&&ue.displayContainsHighlight){const he=ad(a,Pl(a,ue),ae);if(he){he.left/=ae,he.right/=ae,he.top/=ae,he.bottom/=ae;const ge=document.createElement("div");ge.classList.add("ML__contains-highlight"),ge.style.position="absolute",ge.style.left=`${he.left+1}px`,ge.style.top=`${Math.ceil(he.top)}px`,ge.style.width=`${Math.ceil(he.right-he.left)}px`,ge.style.height=`${Math.ceil(he.bottom-he.top)}px`,b.insertBefore(ge,b.childNodes[0])}}return}for(const ue of ag(sd(a,{excludeAtomsWithBackground:!0}))){ue.left/=ae,ue.right/=ae,ue.top/=ae,ue.bottom/=ae;const he=document.createElement("div");he.classList.add("ML__selection"),he.style.position="absolute",he.style.left=`${ue.left}px`,he.style.top=`${ue.top}px`,he.style.width=`${Math.ceil(ue.right-ue.left)}px`,he.style.height=`${Math.ceil(ue.bottom-ue.top-1)}px`,b.insertBefore(he,b.childNodes[0])}}function ag(a){let y=[];for(const b of a){let E=!1;for(const ee of y)if(b.left===ee.left&&b.right===ee.right&&b.top===ee.top&&b.bottom===ee.bottom){E=!0;break}E||y.push(b)}a=y,y=[];for(const b of a){let E=0;for(const ee of a)if(b.left>=ee.left&&b.right<=ee.right&&b.top>=ee.top&&b.bottom<=ee.bottom&&(E+=1,E>1))break;E===1&&y.push(b)}return y}var S0=3,zs;function Oo(a,y){y=Ce({target:"mathfield",canUndo:!1,audioFeedback:void 0,changeContent:!1,changeSelection:!1},y!=null?y:{}),zs||(zs={});for(const b of Object.keys(a))console.assert(!zs[b],"Selector already defined: ",b),zs[b]=ke(Ce({},y),{fn:a[b]})}function Sf(a){let y;if(Array.isArray(a)){if(a[0]==="performWithFeedback")return Sf(a[1]);y=a[0]}else y=a;return y=y.replace(/-\w/g,b=>b[1].toUpperCase()),zs[y]}function du(a){var y;return(y=Sf(a))==null?void 0:y.target}function og(a,y){var b;if(!y)return!1;let E,ee=[],re=!1,ae=!1;Oe(y)?(E=y[0],ee=y.slice(1)):E=y,E=E.replace(/-\w/g,ge=>ge[1].toUpperCase());const ue=zs[E],he=ue==null?void 0:ue.target;if(he==="model"){if(!a.isSelectionEditable&&(ue!=null&&ue.changeContent))return a.model.announce("plonk"),!1;/^(delete|add)/.test(E)&&(E!=="deleteBackward"&&a.flushInlineShortcutBuffer(),a.snapshot(E)),/^complete/.test(E)||Ch(a),zs[E].fn(a.model,...ee),bd(a),ae=!0,re=!0}else if(he==="virtual-keyboard")ae=(b=window.mathVirtualKeyboard.executeCommand(y))!=null?b:!1,re=!0;else if(zs[E]){if(!a.isSelectionEditable&&(ue!=null&&ue.changeContent))return a.model.announce("plonk"),!1;/^(undo|redo)/.test(E)&&a.flushInlineShortcutBuffer(),ae=zs[E].fn(a,...ee),re=!0}else throw new Error(`Unknown command "${E}"`);return he!=="virtual-keyboard"&&(!a.model.selectionIsCollapsed||ue!=null&&ue.changeSelection&&y!=="deleteBackward")&&(a.flushInlineShortcutBuffer(),ue!=null&&ue.changeContent||a.stopCoalescingUndo(),a.defaultStyle={}),ae&&va(a),re}function sg(a,y){var b;if(!a)return!1;a.focus(),vp.keypressVibration&&mt()&&navigator.vibrate(S0);const E=Sf(y);window.MathfieldElement.playSound((b=E==null?void 0:E.audioFeedback)!=null?b:"keypress");const ee=a.executeCommand(y);return a.scrollIntoView(),ee}Oo({performWithFeedback:(a,y)=>sg(a,y)});function lg(a){return bd(a,{atIndex:a.suggestionIndex+1}),!1}function cg(a){return bd(a,{atIndex:a.suggestionIndex-1}),!1}Oo({complete:cu},{target:"mathfield",audioFeedback:"return",canUndo:!0,changeContent:!0,changeSelection:!0}),Oo({nextSuggestion:lg,previousSuggestion:cg},{target:"mathfield",audioFeedback:"keypress",changeSelection:!0});var Dh="mathlive#virtual-keyboard-message";function Cf(a){var y;return a.type!=="message"?!1:((y=a.data)==null?void 0:y.type)===Dh}var ug=class em{constructor(){this.targetOrigin=window.origin,this.originValidator="none",this._boundingRect=new DOMRect(0,0,0,0),this._isShifted=!1,window.addEventListener("message",this),this.sendMessage("proxy-created"),this.listeners={}}static get singleton(){return this._singleton||(this._singleton=new em),this._singleton}set alphabeticLayout(y){this.sendMessage("update-setting",{alphabeticLayout:y})}set layouts(y){this.sendMessage("update-setting",{layouts:y})}get normalizedLayouts(){return[]}set editToolbar(y){this.sendMessage("update-setting",{editToolbar:y})}set actionKeycap(y){this.sendMessage("update-setting",{actionKeycap:y})}set shiftKeycap(y){this.sendMessage("update-setting",{shiftKeycap:y})}set backspaceKeycap(y){this.sendMessage("update-setting",{backspaceKeycap:y})}set tabKeycap(y){this.sendMessage("update-setting",{tabKeycap:y})}set container(y){throw new Error("Container inside an iframe cannot be changed")}show(y){this.sendMessage("show",y)}hide(y){this.sendMessage("hide",y)}get isShifted(){return this._isShifted}get visible(){return this._boundingRect.height>0}set visible(y){y?this.show():this.hide()}get boundingRect(){return this._boundingRect}executeCommand(y){return this.sendMessage("execute-command",{command:y}),!0}updateToolbar(y){this.sendMessage("update-toolbar",y)}update(y){this.sendMessage("update-setting",y)}connect(){this.sendMessage("connect")}disconnect(){this.sendMessage("disconnect")}addEventListener(y,b,E){this.listeners[y]||(this.listeners[y]=new Set),this.listeners[y].has(b)||this.listeners[y].add(b)}dispatchEvent(y){return!this.listeners[y.type]||this.listeners[y.type].size===0?!0:(this.listeners[y.type].forEach(b=>{typeof b=="function"?b(y):b==null||b.handleEvent(y)}),!y.defaultPrevented)}removeEventListener(y,b,E){this.listeners[y]&&this.listeners[y].delete(b)}handleEvent(y){if(Cf(y)){if(!ld(y.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${y.origin}) cannot be handled`,"SecurityError");this.handleMessage(y.data)}}handleMessage(y){const{action:b}=y;if(b==="execute-command"){const{command:E}=y;du(E)==="virtual-keyboard"&&this.executeCommand(E);return}if(b==="synchronize-proxy"){this._boundingRect=y.boundingRect,this._isShifted=y.isShifted;return}if(b==="geometry-changed"){this._boundingRect=y.boundingRect,this.dispatchEvent(new Event("geometrychange"));return}}sendMessage(y,b={}){if(!window.top)throw new DOMException("A frame does not have access to the top window and can\u2018t communicate with the keyboard. Review virtualKeyboardTargetOrigin and originValidator on mathfields embedded in an iframe","SecurityError");window.top.postMessage(Ce({type:Dh,action:y},b),this.targetOrigin)}},C0={numeric:{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",rows:[[{latex:"x",shift:"y",variants:["y","z","t","r","x^2","x^n","x^{#?}","x_n","x_i","x_{#?}",{latex:"f(#?)",class:"small"},{latex:"g(#?)",class:"small"}]},{latex:"n",shift:"a",variants:["i","j","p","k","a","u"]},"[separator-5]","[7]","[8]","[9]","[/]","[separator-5]",{latex:"\\exponentialE",shift:"\\ln",variants:["\\exp","\\times 10^{#?}","\\ln","\\log_{10}","\\log"]},{latex:"\\imaginaryI",variants:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"]},{latex:"\\pi",shift:"\\sin",variants:["\\prod",{latex:"\\theta",aside:"theta"},{latex:"\\rho",aside:"rho"},{latex:"\\tau",aside:"tau"},"\\sin","\\cos","\\tan"]}],[{label:"<",latex:"<",class:"hide-shift",shift:{latex:"\\le",label:"\u2264"}},{label:">",latex:">",class:"hide-shift",shift:{latex:"\\ge",label:"\u2265"}},"[separator-5]","[4]","[5]","[6]","[*]","[separator-5]",{class:"hide-shift",latex:"#@^2}",shift:"#@^{\\prime}}"},{latex:"#@^{#0}}",class:"hide-shift",shift:"#@_{#?}"},{class:"hide-shift",latex:"\\sqrt{#0}",shift:{latex:"\\sqrt[#0]{#?}}"}}],["[(]","[)]","[separator-5]","[1]","[2]","[3]","[-]","[separator-5]",{latex:"\\int^{\\infty}_{0}\\!#?\\,\\mathrm{d}x",class:"small hide-shift",shift:"\\int",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{class:"hide-shift",latex:"\\forall",shift:"\\exists"},{label:"[backspace]",width:1}],[{label:"[shift]",width:2},"[separator-5]","[0]","[.]","[=]","[+]","[separator-5]","[left]","[right]",{label:"[action]",width:1}]]},greek:{label:"&alpha;&beta;&gamma;",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.greek",rows:[[{label:"<i>&#x03c6;</i>",class:"MLK__tex hide-shift",insert:"\\varphi",aside:"phi var.",shift:"\\Phi"},{label:"<i>&#x03c2;</i>",class:"MLK__tex hide-shift",insert:"\\varsigma",aside:"sigma var.",shift:"\\Sigma"},{label:"<i>&#x03f5;</i>",class:"MLK__tex hide-shift",insert:"\\epsilon",aside:"espilon",shift:'\\char"0190'},{label:"<i>&rho;</i>",class:"MLK__tex hide-shift",insert:"\\rho",aside:"rho",shift:'\\char"3A1'},{label:"<i>&tau;</i>",class:"MLK__tex hide-shift",insert:"\\tau",aside:"tau",shift:'\\char"3A4'},{label:"<i>&upsilon;</i>",class:"MLK__tex hide-shift",insert:"\\upsilon",aside:"upsilon",shift:"\\Upsilon"},{label:"<i>&theta;</i>",class:"MLK__tex hide-shift",insert:"\\theta",aside:"theta",shift:"\\Theta"},{label:"<i>&iota;</i>",class:"MLK__tex hide-shift",insert:"\\iota",aside:"iota",shift:'\\char"399'},{label:"<i>&omicron;</i>",class:"MLK__tex hide-shift",insert:"\\omicron",aside:"omicron",shift:'\\char"39F'},{label:"<i>&pi;</i>",class:"MLK__tex hide-shift",insert:"\\pi",aside:"pi",shift:"\\Pi"}],["[separator-5]",{label:"<i>&alpha;</i>",class:"MLK__tex hide-shift",insert:"\\alpha",aside:"alpha",shift:'\\char"391'},{label:"<i>&sigma;</i>",class:"MLK__tex hide-shift",insert:"\\sigma",aside:"sigma",shift:"\\Sigma"},{label:"<i>&delta;</i>",class:"MLK__tex hide-shift",insert:"\\delta",aside:"delta",shift:"\\Delta"},{latex:"\\phi",class:"MLK__tex hide-shift",insert:"\\phi",aside:"phi",shift:"\\Phi"},{label:"<i>&gamma;</i>",class:"MLK__tex hide-shift",insert:"\\gamma",aside:"gamma",shift:"\\Gamma"},{label:"<i>&eta;</i>",class:"MLK__tex hide-shift",insert:"\\eta",aside:"eta",shift:'\\char"397'},{label:"<i>&xi;</i>",class:"MLK__tex hide-shift",insert:"\\xi",aside:"xi",shift:"\\Xi"},{label:"<i>&kappa;</i>",class:"MLK__tex hide-shift",insert:"\\kappa",aside:"kappa",shift:"\\Kappa"},{label:"<i>&lambda;</i>",class:"MLK__tex hide-shift",insert:"\\lambda",aside:"lambda",shift:"\\Lambda"},"[separator-5]"],["[shift]",{label:"<i>&zeta;</i>",class:"MLK__tex hide-shift",insert:"\\zeta",aside:"zeta",shift:'\\char"396'},{label:"<i>&chi;</i>",class:"MLK__tex hide-shift",insert:"\\chi",aside:"chi",shift:'\\char"3A7'},{label:"<i>&psi;</i>",class:"MLK__tex hide-shift",insert:"\\psi",aside:"zeta",shift:"\\Psi"},{label:"<i>&omega;</i>",class:"MLK__tex hide-shift",insert:"\\omega",aside:"omega",shift:"\\Omega"},{label:"<i>&beta;</i>",class:"MLK__tex hide-shift",insert:"\\beta",aside:"beta",shift:'\\char"392'},{label:"<i>&nu;</i>",class:"MLK__tex hide-shift",insert:"\\nu",aside:"nu",shift:'\\char"39D'},{label:"<i>&mu;</i>",class:"MLK__tex hide-shift",insert:"\\mu",aside:"mu",shift:'\\char"39C'},"[backspace]"],["[separator]",{label:"<i>&#x03b5;</i>",class:"MLK__tex",insert:"\\varepsilon",aside:"espilon var."},{label:"<i>&#x03d1;</i>",class:"MLK__tex",insert:"\\vartheta",aside:"theta var."},{label:"<i>&#x3f0;</i>",class:"MLK__tex",insert:"\\varkappa",aside:"kappa var."},{label:"<i>&#x03d6;</i>",class:"MLK__tex",insert:"\\varpi",aside:"pi var."},{label:"<i>&#x03f1;</i>",class:"MLK__tex",insert:"\\varrho",aside:"rho var."},"[left]","[right]","[action]"]]},symbols:{label:"&infin;\u2260\u2208",labelClass:"MLK__tex",tooltip:"keyboard.tooltip.symbols",rows:[[{latex:"\\sin",shift:"\\sin^{-1}",variants:[{class:"small",latex:"\\sinh"},{class:"small",latex:"\\sin^{-1}"},{class:"small",latex:"\\arsinh"}]},"\\ln",{latex:"\\mathrm{abs}",insert:"\\mathrm{abs}\\left(#0\\right)"},{latex:"\\rarr",shift:"\\rArr",variants:[{latex:"\\implies",aside:"implies"},{latex:"\\to",aside:"to"},"\\dashv",{latex:"\\roundimplies",aside:"round implies"}]},{latex:"\\exists",variants:["\\nexists"],shift:"\\nexists"},{latex:"\\in",shift:"\\notin",variants:["\\notin","\\owns"]},"\\cup",{latex:"\\overrightarrow{#@}",shift:"\\overleftarrow{#@}",variants:["\\overleftarrow{#@}","\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"]},{class:"small",latex:"\\lim_{#?}",shift:"\\lim_{x\\to\\infty}",variants:[{class:"small",latex:"\\liminf_{#?}"},{class:"small",latex:"\\limsup_{#?}"}]},"\\exponentialE"],[{latex:"\\cos",shift:"\\cos^{-1}",variants:[{class:"small",latex:"\\cosh"},{class:"small",latex:"\\cos^{-1}"},{class:"small",latex:"\\arcosh"}]},{latex:"\\log",shift:"\\log_{10}",variants:["\\log_{#0}","\\log_{10}"]},"\\left\\vert#0\\right\\vert",{latex:"\\larr",shift:"\\lArr",variants:[{latex:"\\impliedby",aside:"implied by"},{latex:"\\gets",aside:"gets"},"\\lArr","\\vdash",{latex:"\\models",aside:"models"}]},{latex:"\\forall",shift:"\\lnot",variants:[{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"}]},{latex:"\\ni",shift:"\\not\\owns"},"\\cap",{latex:"\\overline{#@}",shift:"\\underline{#@}",variants:["\\overbrace{#@}","\\overlinesegment{#@}","\\overleftrightarrow{#@}","\\overrightarrow{#@}","\\overleftarrow{#@}","\\overgroup{#@}","\\underbrace{#@}","\\underlinesegment{#@}","\\underleftrightarrow{#@}","\\underrightarrow{#@}","\\underleftarrow{#@}","\\undergroup{#@}"]},{class:"hide-shift",latex:"\\int",shift:"\\iint",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\smallint",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\intop","\\iiint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"]},{latex:"\\pi",shift:"\\tau",variants:["\\tau"]}],[{latex:"\\tan",shift:"\\tan^{-1}",variants:[{class:"small",latex:"\\tanh"},{class:"small",latex:"\\tan^{-1}"},{class:"small",latex:"\\artanh"},{class:"small",latex:"\\arctan"},{class:"small",latex:"\\arctg"},{class:"small",latex:"\\tg"}]},{latex:"\\exp",insert:"\\exp\\left(#0\\right)",variants:["\\exponentialE^{#0}"]},"\\left\\Vert#0\\right\\Vert",{latex:"\\lrArr",shift:"\\leftrightarrow",variants:[{latex:"\\iff",aside:"if and only if"},"\\leftrightarrow","\\leftrightarrows","\\Leftrightarrow",{latex:"^\\biconditional",aside:"biconditional"}]},{latex:"\\vert",shift:"!"},{latex:"#@^{\\complement}",aside:"complement",variants:[{latex:"\\setminus",aside:"set minus"},{latex:"\\smallsetminus",aside:"small set minus"}]},{latex:"\\subset",shift:"\\subseteq",variants:["\\subset","\\subseteq","\\subsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsubseteq","\\supset","\\supseteq","\\supsetneq","\\supsetneqq","\\nsupset","\\nsupseteq"]},{latex:"#@^{\\prime}",shift:"#@^{\\doubleprime}",variants:["#@^{\\doubleprime}","#@\\degree"]},{latex:"\\mathrm{d}",shift:"\\partial",variants:["\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{latex:"\\infty",variants:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"]}],[{label:"[shift]",width:2},{class:"box",latex:",",shift:";",variants:[";","?"]},{class:"box",latex:"\\colon",shift:"\\Colon",variants:[{latex:"\\Colon",aside:"such that",class:"box"},{latex:":",aside:"ratio",class:"box"},{latex:"\\vdots",aside:"",class:"box"},{latex:"\\ddots",aside:"",class:"box"},{latex:"\\ldotp",aside:"low dot",class:"box"},{latex:"\\cdotp",aside:"center dot",class:"box"},{latex:"\\ldots",aside:"low ellipsis",class:"box"},{latex:"\\cdots",aside:"center ellipsis",class:"box"},{latex:"\\therefore",aside:"therefore",class:"box"},{latex:"\\because",aside:"because",class:"box"}]},{class:"box",latex:"\\cdot",aside:"centered dot",shift:"\\ast",variants:["\\circ","\\bigcirc","\\bullet","\\odot","\\oslash","\\circledcirc","\\ast","\\star","\\times","\\doteq","\\doteqdot"]},"[separator]","[left]","[right]",{label:"[backspace]",width:1,class:"action hide-shift"},{label:"[action]",width:1}]]},compact:{label:"compact",rows:[["[+]","[-]","[*]","[/]","[=]","[.]","[(]","[)]","\\sqrt{#0}","#@^{#?}"],["[1]","[2]","[3]","[4]","[5]","[6]","[7]","[8]","[9]","[0]"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]},minimalist:{label:"minimalist",layers:[{style:`
.minimalist-backdrop {
display: flex;
justify-content: center;
}
.minimalist-container {
--keycap-height: 40px;
--keycap-max-width: 53px;
--keycap-small-font-size: 12px;
background: var(--keyboard-background);
padding: 20px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
border: 1px solid var(--keyboard-border);
box-shadow: 0 0 32px rgb(0 0 0 / 30%);
}
`,backdrop:"minimalist-backdrop",container:"minimalist-container",rows:[["+","-","\\times",{latex:"\\frac{#@}{#0}",class:"small"},"=","[.]","(",")",{latex:"\\sqrt{#0}",class:"small"},{latex:"#@^{#?}",class:"small"}],["1","2","3","4","5","6","7","8","9","0"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]}]},"numeric-only":{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",id:"numeric-only",rows:[["7","8","9","[separator]",{label:"[backspace]",width:2}],["4","5","6","[separator]","[separator]","[separator]"],["1","2","3","[separator]","[separator]","[separator]"],["0",{label:"[.]",variants:[]},"-","[separator]","[left]","[right]"]]}},Ah={0:["\\varnothing","\\infty"],1:["\\frac{1}{#@}","#@^{-1}","\\times 10^{#?}","\\phi","\\imaginaryI"],2:["\\frac{1}{2}","#@^2","\\sqrt2","\\exponentialE"],3:["\\frac{1}{3}","#@^3","\\sqrt3","\\pi"],4:["\\frac{1}{4}","#@^4"],5:["\\frac{1}{5}","#@^5","\\sqrt5"],6:["\\frac{1}{6}","#@^6"],7:["\\frac{1}{7}","#@^7"],8:["\\frac{1}{8}","#@^8"],9:["\\frac{1}{9}","#@^9"],".":[".",",",";","\\colon"],",":["{,}",".",";","\\colon"],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"},"\xE0","\xE1","\xE2","\xE4","\xE6"],b:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"},"\xE7"],d:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn\u2019t"},"\xE8","\xE9","\xEA","\xEB"],g:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"},"\xEC","\xED","\xEE","\xEF"],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\mathbb{N}",aside:"set of natural numbers"},"\xF1"],o:["\xF8","\u0153","\xF2","\xF3","\xF4","\xF6","\u0153"],p:[{latex:"\\mathbb{P}",aside:"set of primes"}],q:[{latex:"\\mathbb{Q}",aside:"set of rational numbers"}],r:[{latex:"\\mathbb{R}",aside:"set of real numbers"}],u:["\xF9","\xFA","\xFB","\xFC"],z:[{latex:"\\mathbb{Z}",aside:"set of integers"}],y:["\xFD","\xFF"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space<br>\u207B\xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\,\\char"2039',insert:"\\,",aside:"thin space<br>\xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\:\\char"2039',insert:"\\:",aside:"medium space<br>\u2074\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\;\\char"2039',insert:"\\;",aside:"thick space<br>\u2075\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\ \\char"2039',insert:"\\ ",aside:"\u2153 em"},{latex:'\\char"203A\\enspace\\char"2039',insert:"\\enspace",aside:"\xBD em"},{latex:'\\char"203A\\quad\\char"2039',insert:"\\quad",aside:"1 em"},{latex:'\\char"203A\\qquad\\char"2039',insert:"\\qquad",aside:"2 em"}]},xd;function M0(a,y){var b,E,ee;const re=Rl.singleton;if(!re)return;const ae=hu(a),ue=(E=(b=re.getKeycap(ae==null?void 0:ae.id))==null?void 0:b.variants)!=null?E:"";if(typeof ue=="string"&&!_0(ue)||Array.isArray(ue)&&ue.length===0){y==null||y();return}const he={};let ge="";for(const vn of hg(ue)){const nr=E0(vn),fn=Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);he[fn]=nr;const[Rn,cr]=Th(nr);ge+=`<div id=${fn} class="item ${cr}">${Rn}</div>`}const be=document.createElement("div");be.setAttribute("aria-hidden","true"),be.className="MLK__variant-panel",be.style.height="auto";const Be=Object.keys(he).length;let He=5;Be===1?He=1:Be===2||Be===4?He=2:Be===3||Be===5||Be===6?He=3:Be>=7&&Be<14&&(He=4),be.style.width=`calc(var(--variant-keycap-length) * ${He} + 12px)`,be.innerHTML=vp.createHTML(ge),Fs.open({root:(ee=re==null?void 0:re.container)==null?void 0:ee.querySelector(".ML__keyboard"),child:be}),xd=new AbortController;const{signal:lt}=xd,xt=a==null?void 0:a.getBoundingClientRect();if(xt){xt.top-be.clientHeight<0&&(be.style.width="auto",Be<=6?be.style.height="56px":Be<=12?be.style.height="108px":Be<=18?be.style.height="205px":be.classList.add("compact"));const vn=Math.max(0,Math.min(window.innerWidth-be.offsetWidth,(xt.left+xt.right-be.offsetWidth)/2)),nr=xt.top-be.clientHeight+5;be.style.transform=`translate(${vn}px, ${nr}px)`,be.classList.add("is-visible"),requestAnimationFrame(()=>{be.addEventListener("pointerup",fn=>{const Rn=hu(fn.target);!(Rn!=null&&Rn.id)||!he[Rn.id]||(Mf(he[Rn.id]),wd(),y==null||y(),fn.preventDefault())},{capture:!0,passive:!1,signal:lt}),be.addEventListener("pointerenter",fn=>{const Rn=hu(fn.target);!(Rn!=null&&Rn.id)||!he[Rn.id]||Rn.classList.add("is-active")},{capture:!0,signal:lt}),be.addEventListener("pointerleave",fn=>{const Rn=hu(fn.target);!(Rn!=null&&Rn.id)||!he[Rn.id]||Rn.classList.remove("is-active")},{capture:!0,signal:lt}),window.addEventListener("pointercancel",()=>{wd(),y==null||y()},{signal:lt}),window.addEventListener("pointerup",()=>{wd(),y==null||y()},{signal:lt})})}}function wd(){xd==null||xd.abort(),xd=null,Fs.state==="open"&&Fs.close()}function dg(a){if(a==="foreground-color"){const y=[];for(const b of Object.keys(at))y.push({class:"swatch-button",label:'<span style="border: 3px solid '+at[b]+'"></span>',command:["applyStyle",{color:b}]});return y}if(a==="background-color"){const y=[];for(const b of Object.keys(Xe))y.push({class:"swatch-button",label:'<span style="background:'+Xe[b]+'"></span>',command:["applyStyle",{backgroundColor:b}]});return y}}function _0(a){return Ah[a]!==void 0}function hg(a){var y;return typeof a!="string"?a:(Ah[a]||(Ah[a]=(y=dg(a))!=null?y:[]),Ah[a])}function fg(a){return typeof a=="string"?a:Object.entries(a).map(([y,b])=>`${y}:${b} !important`).join(";")}function pg(a){return Object.keys(a).map(y=>`${y} {${fg(a[y])}}`).join("")}function Sd(a){if(!a)return"";const y=new Di,b=new Dn({mode:"math",type:"root",body:ja(a,{context:y,args:ee=>ee==="@"?"{\\class{ML__box-placeholder}{\\blacksquare}}":"\\placeholder{}"})}),E=Yc(fd(new ir(b.render(y),{classes:"ML__base"}),y));return qc(E,{classes:"ML__latex"}).toMarkup()}function Cd(a){var y;if(Array.isArray(a))return a.map(E=>Cd(E)).flat();const b=typeof a=="string"?{markup:a}:a;return"rows"in b&&Array.isArray(b.rows)&&(b.rows=b.rows.map(E=>E.map(ee=>E0(ee)))),(y=b.id)!=null||(b.id="ML__layer_"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36)),[b]}function mg(){var a,y;let E=window.mathVirtualKeyboard.alphabeticLayout;if(E==="auto"){const ue=vd();ue&&(E=ue.virtualLayout),(!E||E==="auto")&&(E=(a={fr:"azerty",be:"azerty",al:"qwertz",ba:"qwertz",cz:"qwertz",de:"qwertz",hu:"qwertz",sk:"qwertz",ch:"qwertz"}[nt.locale.slice(0,2)])!=null?a:"qwerty")}const ee={qwerty:["qwertyuiop"," asdfghjkl ","^zxcvbnm~"],azerty:["azertyuiop","qsdfghjklm","^ wxcvbn ~"],qwertz:["qwertzuiop"," asdfghjkl ","^yxcvbnm~"],dvorak:["^ pyfgcrl ","aoeuidhtns","qjkxbmwvz~"],colemak:[" qwfpgjluy ","arstdhneio","^zxcvbkm~"]},re=(y=ee[E])!=null?y:ee.qwerty,ae=E==="azerty"?[[{label:"1",variants:"1"},{label:"2",shift:{latex:"\xE9"},variants:"2"},{label:"3",shift:{latex:"\xF9"},variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{label:"(",latex:"("},variants:"5"},{label:"6",shift:{label:")",latex:")"},variants:"6"},{label:"7",shift:{latex:"\xE8"},variants:"7"},{label:"8",shift:{latex:"\xEA"},variants:"8"},{label:"9",shift:{latex:"\xE7"},variants:"9"},{label:"0",shift:{latex:"\xE0"},variants:"0"}]]:[[{label:"1",variants:"1"},{label:"2",variants:"2"},{label:"3",variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{latex:"\\frac{#@}{#?}"},variants:"5"},{label:"6",shift:{latex:"#@^#?"},variants:"6"},{label:"7",variants:"7"},{label:"8",shift:{latex:"\\times"},variants:"8"},{label:"9",shift:{label:"(",latex:"("},variants:"9"},{label:"0",shift:{label:")",latex:")"},variants:"0"}]];for(const ue of re){const he=[];for(const ge of ue)/[a-z]/.test(ge)?he.push({label:ge,class:"hide-shift",shift:{label:ge.toUpperCase()},variants:_0(ge)?ge:void 0}):ge==="~"?E!=="dvorak"?he.push("[backspace]"):he.push({label:"[backspace]",width:1}):ge==="^"?he.push("[shift]"):ge===" "&&he.push("[separator-5]");ae.push(he)}return ae.push(["[-]","[+]","[=]",{label:" ",width:1.5},{label:",",shift:";",variants:".",class:"hide-shift"},"[.]","[left]","[right]",{label:"[action]",width:1.5}]),{label:"abc",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.alphabetic",layers:Cd({rows:ae})}}function k0(a){if(a==="alphabetic")return mg();if(typeof a=="string")return console.assert(C0[a]!==void 0,`MathLive 0.98.5: unknown keyboard layout "${a}"`),k0(C0[a]);let y;if("rows"in a&&Array.isArray(a.rows)){console.assert(!("layers"in a||"markup"in a),'MathLive 0.98.5: when providing a "rows" property, "layers" and "markup" are ignored');const ee=a,{rows:re}=ee,ae=gt(ee,["rows"]);y=ke(Ce({},ae),{layers:Cd({rows:a.rows})})}else if("markup"in a&&typeof a.markup=="string"){const ee=a,{markup:re}=ee,ae=gt(ee,["markup"]);y=ke(Ce({},ae),{layers:Cd(a.markup)})}else y=Ce({},a),"layers"in a?y.layers=Cd(a.layers):console.error('MathLive 0.98.5: provide either a "rows", "markup" or "layers" property');let b=!1,E=!1;for(const ee of y.layers)if(ee.rows)for(const re of ee.rows.flat()){fu(re)&&(b=!0);const ae=re.command;typeof ae=="string"&&["undo","redo","cut","copy","paste"].includes(ae)&&(E=!0)}return(!("displayShiftedKeycaps"in a)||a.displayShiftedKeycaps===void 0)&&(y.displayShiftedKeycaps=b),(!("displayEditToolbar"in a)||a.displayEditToolbar===void 0)&&(y.displayEditToolbar=!E),y}function gg(a,y){var b,E;let ee='<div class="left">';if(a.normalizedLayouts.length>1)for(const[re,ae]of a.normalizedLayouts.entries()){const ue=ae,he=[re===y?"selected":"layer-switch"];ue.tooltip&&he.push("MLK__tooltip"),ue.labelClass&&he.push(...ue.labelClass.split(" ")),ee+=`<div class="${he.join(" ")}"`,ue.tooltip&&(ee+=" data-tooltip='"+((b=ht(ue.tooltip))!=null?b:ue.tooltip)+"' "),re!==y&&(ee+=`data-layer="${ue.layers[0].id}"`),ee+=`>${(E=ue.label)!=null?E:"untitled"}</div>`}return ee+="</div>",ee}function vg(a,y){let b="";if(a.editToolbar==="none")return"";const ee=[];y.selectionIsCollapsed?ee.push("undo","redo","pasteFromClipboard"):ee.push("cutToClipboard","copyToClipboard","pasteFromClipboard");const re={undo:`<div class='action ${y.canUndo===!1?"disabled":""}'
data-command='"undo"'
data-tooltip='${ht("tooltip.undo")}'>
<svg><use xlink:href='#svg-undo' /></svg>
</div>`,redo:`<div class='action ${y.canRedo===!1?"disabled":""}'
data-command='"redo"'
data-tooltip='${ht("tooltip.redo")}'>
<svg><use xlink:href='#svg-redo' /></svg>
</div>`,cutToClipboard:`
<div class='action'
data-command='"cutToClipboard"'
data-tooltip='${ht("tooltip.cut to clipboard")}'>
<svg><use xlink:href='#svg-cut' /></svg>
</div>
`,copyToClipboard:`
<div class='action'
data-command='"copyToClipboard"'
data-tooltip='${ht("tooltip.copy to clipboard")}'>
<svg><use xlink:href='#svg-copy' /></svg>
</div>
`,pasteFromClipboard:`
<div class='action'
data-command='"pasteFromClipboard"'
data-tooltip='${ht("tooltip.paste from clipboard")}'>
<svg><use xlink:href='#svg-paste' /></svg>
</div>
`};return b+=ee.map(ae=>re[ae]).join(""),b}function yg(a){for(const y of a)bg(y)}function bg(a){const y=Rl.singleton;if(!y)return;const b={};if(!a.id){if(a.hasAttribute("data-label")&&(b.label=a.dataset.label),a.hasAttribute("data-latex")&&(b.latex=a.dataset.latex),a.hasAttribute("data-key")&&(b.key=a.dataset.key),a.hasAttribute("data-insert")&&(b.insert=a.dataset.insert),a.hasAttribute("data-variants")&&(b.variants=a.dataset.variants),a.hasAttribute("data-aside")&&(b.aside=a.dataset.aside),a.className&&(b.class=a.className),!b.label&&!b.latex&&!b.key&&!b.insert&&(b.latex=a.innerText,b.label=a.innerHTML),a.hasAttribute("data-command"))try{b.command=JSON.parse(a.dataset.command)}catch(E){}a.id=y.registerKeycap(b)}if(!a.innerHTML){const[E,ee]=Th(b);a.innerHTML=window.MathfieldElement.createHTML(E)}}function xg(){Bo("virtual-keyboard"),Bo("core"),Eh()}function wg(){x("core"),x("virtual-keyboard")}var Sg=`<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="svg-delete-backward" viewBox="0 0 576 512">
<path d="M432.1 208.1L385.9 256L432.1 303C442.3 312.4 442.3 327.6 432.1 336.1C423.6 346.3 408.4 346.3 399 336.1L352 289.9L304.1 336.1C295.6 346.3 280.4 346.3 271 336.1C261.7 327.6 261.7 312.4 271 303L318.1 256L271 208.1C261.7 199.6 261.7 184.4 271 175C280.4 165.7 295.6 165.7 304.1 175L352 222.1L399 175C408.4 165.7 423.6 165.7 432.1 175C442.3 184.4 442.3 199.6 432.1 208.1V208.1zM512 64C547.3 64 576 92.65 576 128V384C576 419.3 547.3 448 512 448H205.3C188.3 448 172 441.3 160 429.3L9.372 278.6C3.371 272.6 0 264.5 0 256C0 247.5 3.372 239.4 9.372 233.4L160 82.75C172 70.74 188.3 64 205.3 64L512 64zM528 128C528 119.2 520.8 112 512 112H205.3C201 112 196.9 113.7 193.9 116.7L54.63 256L193.9 395.3C196.9 398.3 201 400 205.3 400H512C520.8 400 528 392.8 528 384V128z"/>
</symbol>
<symbol id="svg-shift" viewBox="0 0 384 512">
<path d="M2.438 252.3C7.391 264.2 19.06 272 32 272h80v160c0 26.51 21.49 48 48 48h64C250.5 480 272 458.5 272 432v-160H352c12.94 0 24.61-7.797 29.56-19.75c4.953-11.97 2.219-25.72-6.938-34.88l-160-176C208.4 35.13 200.2 32 192 32S175.6 35.13 169.4 41.38l-160 176C.2188 226.5-2.516 240.3 2.438 252.3zM192 86.63L313.4 224H224v208H160V224H70.63L192 86.63z"/>
</symbol>
<symbol id="svg-commit" viewBox="0 0 512 512">
<path d="M135 432.1l-128-128C2.344 300.3 0 294.2 0 288s2.344-12.28 7.031-16.97l128-128c9.375-9.375 24.56-9.375 33.94 0s9.375 24.56 0 33.94L81.94 264H464v-208C464 42.75 474.8 32 488 32S512 42.75 512 56V288c0 13.25-10.75 24-24 24H81.94l87.03 87.03c9.375 9.375 9.375 24.56 0 33.94S144.4 442.3 135 432.1z"/>
</symbol>
<symbol id="circle-plus" viewBox="0 0 512 512"><path d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344c0 13.3 10.7 24 24 24s24-10.7 24-24V280h64c13.3 0 24-10.7 24-24s-10.7-24-24-24H280V168c0-13.3-10.7-24-24-24s-24 10.7-24 24v64H168c-13.3 0-24 10.7-24 24s10.7 24 24 24h64v64z"/></symbol>
<symbol id="svg-command" viewBox="0 0 640 512">
<path d="M34.495 36.465l211.051 211.05c4.686 4.686 4.686 12.284 0 16.971L34.495 475.535c-4.686 4.686-12.284 4.686-16.97 0l-7.071-7.07c-4.686-4.686-4.686-12.284 0-16.971L205.947 256 10.454 60.506c-4.686-4.686-4.686-12.284 0-16.971l7.071-7.07c4.686-4.687 12.284-4.687 16.97 0zM640 468v-10c0-6.627-5.373-12-12-12H300c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h328c6.627 0 12-5.373 12-12z"/>
</symbol>
<symbol id="svg-undo" viewBox="0 0 512 512">
<path d="M20 8h10c6.627 0 12 5.373 12 12v110.625C85.196 57.047 165.239 7.715 256.793 8.001 393.18 8.428 504.213 120.009 504 256.396 503.786 393.181 392.834 504 256 504c-63.926 0-122.202-24.187-166.178-63.908-5.113-4.618-5.354-12.561-.482-17.433l7.069-7.069c4.503-4.503 11.749-4.714 16.482-.454C150.782 449.238 200.935 470 256 470c117.744 0 214-95.331 214-214 0-117.744-95.331-214-214-214-82.862 0-154.737 47.077-190.289 116H180c6.627 0 12 5.373 12 12v10c0 6.627-5.373 12-12 12H20c-6.627 0-12-5.373-12-12V20c0-6.627 5.373-12 12-12z"/>
</symbol>
<symbol id="svg-redo" viewBox="0 0 512 512">
<path d="M492 8h-10c-6.627 0-12 5.373-12 12v110.625C426.804 57.047 346.761 7.715 255.207 8.001 118.82 8.428 7.787 120.009 8 256.396 8.214 393.181 119.166 504 256 504c63.926 0 122.202-24.187 166.178-63.908 5.113-4.618 5.354-12.561.482-17.433l-7.069-7.069c-4.503-4.503-11.749-4.714-16.482-.454C361.218 449.238 311.065 470 256 470c-117.744 0-214-95.331-214-214 0-117.744 95.331-214 214-214 82.862 0 154.737 47.077 190.289 116H332c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h160c6.627 0 12-5.373 12-12V20c0-6.627-5.373-12-12-12z"/>
</symbol>
<symbol id="svg-arrow-left" viewBox="0 0 320 512">
<path d="M206.7 464.6l-183.1-191.1C18.22 267.1 16 261.1 16 256s2.219-11.97 6.688-16.59l183.1-191.1c9.152-9.594 24.34-9.906 33.9-.7187c9.625 9.125 9.938 24.37 .7187 33.91L73.24 256l168 175.4c9.219 9.5 8.906 24.78-.7187 33.91C231 474.5 215.8 474.2 206.7 464.6z"/>
</symbol>
<symbol id="svg-arrow-right" viewBox="0 0 320 512">
<path d="M113.3 47.41l183.1 191.1c4.469 4.625 6.688 10.62 6.688 16.59s-2.219 11.97-6.688 16.59l-183.1 191.1c-9.152 9.594-24.34 9.906-33.9 .7187c-9.625-9.125-9.938-24.38-.7187-33.91l168-175.4L78.71 80.6c-9.219-9.5-8.906-24.78 .7187-33.91C88.99 37.5 104.2 37.82 113.3 47.41z"/>
</symbol>
<symbol id="svg-tab" viewBox="0 0 448 512">
<path d="M32 217.1c0-8.8 7.2-16 16-16h144v-93.9c0-7.1 8.6-10.7 13.6-5.7l143.5 143.1c6.3 6.3 6.3 16.4 0 22.7L205.6 410.4c-5 5-13.6 1.5-13.6-5.7v-93.9H48c-8.8 0-16-7.2-16-16v-77.7m-32 0v77.7c0 26.5 21.5 48 48 48h112v61.9c0 35.5 43 53.5 68.2 28.3l143.6-143c18.8-18.8 18.8-49.2 0-68L228.2 78.9c-25.1-25.1-68.2-7.3-68.2 28.3v61.9H48c-26.5 0-48 21.6-48 48zM436 64h-8c-6.6 0-12 5.4-12 12v360c0 6.6 5.4 12 12 12h8c6.6 0 12-5.4 12-12V76c0-6.6-5.4-12-12-12z"/>
</symbol>
<symbol id="svg-paste" viewBox="0 0 512 512"><path d="M160 32c11.6 0 21.3 8.2 23.5 19.2C185 58.6 191.6 64 199.2 64H208c8.8 0 16 7.2 16 16V96H96V80c0-8.8 7.2-16 16-16h8.8c7.6 0 14.2-5.4 15.7-12.8C138.7 40.2 148.4 32 160 32zM64 64h2.7C65 69 64 74.4 64 80V96c0 17.7 14.3 32 32 32H224c17.7 0 32-14.3 32-32V80c0-5.6-1-11-2.7-16H256c17.7 0 32 14.3 32 32h32c0-35.3-28.7-64-64-64H210.6c-9-18.9-28.3-32-50.6-32s-41.6 13.1-50.6 32H64C28.7 32 0 60.7 0 96V384c0 35.3 28.7 64 64 64H192V416H64c-17.7 0-32-14.3-32-32V96c0-17.7 14.3-32 32-32zM288 480c-17.7 0-32-14.3-32-32V192c0-17.7 14.3-32 32-32h96v56c0 22.1 17.9 40 40 40h56V448c0 17.7-14.3 32-32 32H288zM416 165.3L474.7 224H424c-4.4 0-8-3.6-8-8V165.3zM448 512c35.3 0 64-28.7 64-64V235.9c0-12.7-5.1-24.9-14.1-33.9l-59.9-59.9c-9-9-21.2-14.1-33.9-14.1H288c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H448z"/></symbol>
<symbol id="svg-cut" viewBox="0 0 512 512"><path d="M485.6 444.2L333.6 314.9C326.9 309.2 326.1 299.1 331.8 292.4C337.5 285.6 347.6 284.8 354.4 290.5L506.4 419.8C513.1 425.5 513.9 435.6 508.2 442.4C502.5 449.1 492.4 449.9 485.6 444.2zM485.7 67.76C492.5 62.07 502.5 62.94 508.2 69.69C513.9 76.45 513.1 86.55 506.3 92.24L208.5 343.1C218.3 359.7 224 379.2 224 400C224 461.9 173.9 512 112 512C50.14 512 0 461.9 0 400C0 338.1 50.14 288 112 288C141.5 288 168.4 299.4 188.4 318.1L262.2 256L188.4 193.9C168.4 212.6 141.5 224 112 224C50.14 224 0 173.9 0 112C0 50.14 50.14 0 112 0C173.9 0 224 50.14 224 112C224 132.8 218.3 152.3 208.5 168.9L287 235.1L485.7 67.76zM32 112C32 156.2 67.82 192 112 192C156.2 192 192 156.2 192 112C192 67.82 156.2 32 112 32C67.82 32 32 67.82 32 112zM112 480C156.2 480 192 444.2 192 400C192 355.8 156.2 320 112 320C67.82 320 32 355.8 32 400C32 444.2 67.82 480 112 480z"/></symbol>
<symbol id="svg-copy" viewBox="0 0 512 512"><path d="M272 416C263.2 416 256 423.2 256 432V448c0 17.67-14.33 32-32 32H64c-17.67 0-32-14.33-32-32V192c0-17.67 14.33-32 32-32h112C184.8 160 192 152.8 192 144C192 135.2 184.8 128 176 128H63.99c-35.35 0-64 28.65-64 64l.0098 256C0 483.3 28.65 512 64 512h160c35.35 0 64-28.65 64-64v-16C288 423.2 280.8 416 272 416zM502.6 86.63l-77.25-77.25C419.4 3.371 411.2 0 402.7 0H288C252.7 0 224 28.65 224 64v256c0 35.35 28.65 64 64 64h160c35.35 0 64-28.65 64-64V109.3C512 100.8 508.6 92.63 502.6 86.63zM416 45.25L466.7 96H416V45.25zM480 320c0 17.67-14.33 32-32 32h-160c-17.67 0-32-14.33-32-32V64c0-17.67 14.33-32 32-32h96l.0026 64c0 17.67 14.33 32 32 32H480V320z"/>
</symbol>
<symbol id="svg-angle-double-right" viewBox="0 0 512 512"><path d="M470.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256 265.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L210.7 256 73.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"/>
</symbol>
<symbol id="svg-angle-double-left" viewBox="0 0 512 512"><path d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160zm352-160l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L301.3 256 438.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0z"/>
</symbol>
<symbol id="svg-trash" viewBox="0 0 448 512">
<path d="M336 64l-33.6-44.8C293.3 7.1 279.1 0 264 0h-80c-15.1 0-29.3 7.1-38.4 19.2L112 64H24C10.7 64 0 74.7 0 88v2c0 3.3 2.7 6 6 6h26v368c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V96h26c3.3 0 6-2.7 6-6v-2c0-13.3-10.7-24-24-24h-88zM184 32h80c5 0 9.8 2.4 12.8 6.4L296 64H152l19.2-25.6c3-4 7.8-6.4 12.8-6.4zm200 432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V96h320v368zm-176-44V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zm-80 0V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zm160 0V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12z"/>
</symbol>
<symbol id="svg-keyboard-down" viewBox="0 0 576 512"><path d="M64 48c-8.8 0-16 7.2-16 16V240c0 8.8 7.2 16 16 16H512c8.8 0 16-7.2 16-16V64c0-8.8-7.2-16-16-16H64zM0 64C0 28.7 28.7 0 64 0H512c35.3 0 64 28.7 64 64V240c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64zM159 359c9.4-9.4 24.6-9.4 33.9 0l95 95 95-95c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L305 505c-4.5 4.5-10.6 7-17 7s-12.5-2.5-17-7L159 393c-9.4-9.4-9.4-24.6 0-33.9zm1-167c0-8.8 7.2-16 16-16H400c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V192zM120 88h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H120c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16zm64 16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H200c-8.8 0-16-7.2-16-16V104zm96-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H280c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16zm64 16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H360c-8.8 0-16-7.2-16-16V104zm96-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H440c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16z"/></symbol>
</svg>`;function Cg(a){a.resetKeycapRegistry(),xg();const y=document.createElement("div");y.className="ML__keyboard";const b=document.createElement("div");b.className="MLK__plate",b.innerHTML=window.MathfieldElement.createHTML(Sg+a.normalizedLayouts.map((ae,ue)=>Mg(a,ae,ue)).join(""));const E=document.createElement("div");E.className="MLK__backdrop",E.appendChild(b),y.appendChild(E),y.addEventListener("pointerdown",kg,{passive:!1});const ee=y.querySelectorAll(".ML__edit-toolbar");if(ee)for(const ae of ee)ae.addEventListener("click",ue=>{var he,ge;let be=ue.target,Be="";for(;be&&!Be;)Be=(he=be==null?void 0:be.getAttribute("data-command"))!=null?he:"",be=(ge=be==null?void 0:be.parentElement)!=null?ge:null;Be&&a.executeCommand(JSON.parse(Be))});yg(y.querySelectorAll(".MLK__keycap, .action, .fnbutton, .bigfnbutton"));const re=y.querySelectorAll(".MLK__layer");console.assert(re.length>0,"No virtual keyboards available");for(const ae of re)ae.addEventListener("pointerdown",ue=>ue.preventDefault());return a.currentLayer=a.latentLayer,y}function Mg(a,y,b){const E=[];if(!("layers"in y))return"";for(const ee of y.layers)E.push(`<div tabindex="-1" class="MLK__layer" id="${ee.id}">`),(a.normalizedLayouts.length>1||y.displayEditToolbar)&&(E.push("<div class='MLK__toolbar' role='toolbar'>"),E.push(gg(a,b)),y.displayEditToolbar&&E.push('<div class="ML__edit-toolbar right"></div>'),E.push("</div>")),E.push(_g(a,ee)),E.push("</div>");return E.join("")}function _g(a,y){if(typeof y=="string")return y;let b="";if(typeof y.style=="string"?b+=`<style>${y.style}</style>`:typeof y.style=="object"&&(b+=`<style>${pg(y.style)}</style>`),y.backdrop&&(b+=`<div class='${y.backdrop}'>`),y.container&&(b+=`<div class='${y.container}'>`),y.rows){b+="<div class=MLK__rows>";for(const E of y.rows){b+="<div dir='ltr' class=MLK__row>";for(const ee of E)if(ee){const re=a.registerKeycap(ee),[ae,ue]=Th(ee);/(^|\s)separator/.test(ue)?b+=`<div class="${ue}"`:b+=`<div tabindex="-1" id="${re}" class="${ue}"`,ee.tooltip&&(b+=` data-tooltip="${ee.tooltip}"`),b+=`>${ae}</div>`}b+="</div>"}b+="</div>"}else y.markup&&(b+=y.markup);return y.container&&(b+="</div>"),y.backdrop&&(b+="</div>"),b}function Th(a,y={shifted:!1}){var b,E,ee,re,ae,ue,he;let ge="",be=(b=a.class)!=null?b:"";if(y.shifted&&fu(a)&&(be+=" is-active"),y.shifted&&"shift"in a)typeof a.shift=="string"?ge=Sd(a.shift):typeof a.shift=="object"&&(ge=a.shift.label?a.shift.label:(E=Sd(a.shift.latex||a.shift.insert||"")||a.shift.key)!=null?E:""),typeof a.shift=="object"&&(be=(re=(ee=a.shift.class)!=null?ee:a.class)!=null?re:"");else{if(ge=a.label?a.label:(ae=Sd(a.latex||a.insert||"")||a.key)!=null?ae:"",a.shift){let Be;typeof a.shift=="string"?Be=Sd(a.shift):a.shift.label?Be=a.shift.label:Be=(ue=Sd(a.shift.latex||a.shift.insert||"")||a.shift.key)!=null?ue:"",ge+=`<span class="MLK__shift">${Be}</span>`}a.aside&&(ge+=`<aside>${a.aside}</aside>`)}return a.layer&&!/layer-switch/.test(be)&&(be+=" layer-switch"),/(^|\s)(separator|action|shift|fnbutton|bigfnbutton)($|\s)/.test(be)||(be+=" MLK__keycap"),!/\bw[0-9]+\b/.test(be)&&a.width&&(be+=(he={0:" w0",.5:" w5",1.5:" w15",2:" w20",5:" w50"}[a.width])!=null?he:""),[ge,be||"MLK__keycap"]}var mc={"[left]":{class:"action hide-shift",label:"<svg class=svg-glyph><use xlink:href=#svg-arrow-left /></svg>",command:["performWithFeedback","moveToPreviousChar"],shift:{label:"<svg class=svg-glyph><use xlink:href=#svg-angle-double-left /></svg>",command:["performWithFeedback","extendSelectionBackward"]}},"[right]":{class:"action hide-shift",label:"<svg class=svg-glyph><use xlink:href=#svg-arrow-right /></svg>",command:["performWithFeedback","moveToNextChar"],shift:{label:"<svg class=svg-glyph><use xlink:href=#svg-angle-double-right /></svg>",command:["performWithFeedback","extendSelectionForward"]}},"[up]":{class:"action hide-shift",label:"\u2191",command:["performWithFeedback","moveUp"],shift:{label:"\u219F",command:["performWithFeedback","extendSelectionUpward"]}},"[down]":{class:"action hide-shift",label:"\u2193",command:["performWithFeedback","moveDown"],shift:{label:"\u21A1",command:["performWithFeedback","extendSelectionDownward"]}},"[return]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>"},"[action]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{label:"<svg class=svg-glyph><use xlink:href=#circle-plus /></svg>",command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>"},"[hr]":{class:"separator horizontal-rule"},"[hide-keyboard]":{class:"action",command:["hideVirtualKeyboard"],width:1.5,label:"<svg class=svg-glyph-lg><use xlink:href=#svg-keyboard-down /></svg>"},"[.]":{variants:".",command:["performWithFeedback","insertDecimalSeparator"],shift:",",class:"big-op hide-shift",label:"."},"[,]":{variants:",",command:["performWithFeedback","insertDecimalSeparator"],shift:".",class:"big-op hide-shift",label:","},"[+]":{variants:[{latex:"\\sum_{#0}^{#0}",class:"small"},"\\oplus"],latex:"+",label:"+",class:"big-op hide-shift",shift:{latex:"\\sum",insert:"\\sum",class:"small"}},"[-]":{variants:["\\pm","\\ominus"],latex:"-",label:"&#x2212;",shift:"\\pm",class:"big-op hide-shift"},"[/]":{class:"big-op hide-shift",shift:{class:"",latex:"\\frac{1}{#@}"},variants:["/","\\div","\\%","\\oslash"],latex:"\\frac{#@}{#?}",label:"&divide;"},"[*]":{variants:[{latex:"\\prod_{#0}^{#0}",class:"small"},"\\otimes","\\cdot"],latex:"\\cdot",label:"&times;",shift:{latex:"\\times"},class:"big-op hide-shift"},"[=]":{variants:["\\neq","\\equiv","\\varpropto","\\thickapprox","\\lt","\\gt","\\le","\\ge"],latex:"=",label:"=",shift:{label:"\u2260",latex:"\\ne"},class:"big-op hide-shift"},"[backspace]":{class:"action bottom right hide-shift",width:1.5,command:["performWithFeedback","deleteBackward"],label:"<svg class=svg-glyph><use xlink:href=#svg-delete-backward /></svg>",shift:{class:"action warning",label:"<svg class=svg-glyph><use xlink:href=#svg-trash /></svg>",command:"deleteAll"}},"[undo]":{class:"ghost if-can-undo",command:"undo",label:"<svg class=svg-glyph><use xlink:href=#svg-undo /></svg>",tooltip:"tooltip.undo"},"[redo]":{class:"ghost if-can-redo",command:"redo",label:"<svg class=svg-glyph><use xlink:href=#svg-redo /></svg>",tooltip:"tooltip.redo"},"[(]":{variants:[{latex:"\\lbrack",key:"["},"\\langle","\\lfloor","\\lceil",{latex:"\\lbrace",key:"{"}],key:"(",label:"(",shift:{label:"[",key:"["},class:"hide-shift"},"[)]":{variants:[{latex:"\\rbrack",key:"]"},"\\rangle","\\rfloor","\\rceil",{latex:"\\rbrace",key:"]"}],key:")",label:")",shift:{label:"]",latex:"\\rbrack"},class:"hide-shift"},"[0]":{variants:"0",latex:"0",label:"0",shift:"\\infty",class:"hide-shift"},"[1]":{variants:"1",latex:"1",label:"1",shift:"#@^{-1}",class:"hide-shift"},"[2]":{variants:"2",latex:"2",label:"2",shift:"#@^2",class:"hide-shift"},"[3]":{variants:"3",latex:"3",label:"3",shift:"#@^3",class:"hide-shift"},"[4]":{variants:"4",latex:"4",label:"4",shift:"#@^4",class:"hide-shift"},"[5]":{variants:"5",latex:"5",label:"5",shift:"#@^5",class:"hide-shift"},"[6]":{variants:"6",latex:"6",label:"6",shift:"#@^6",class:"hide-shift"},"[7]":{variants:"7",latex:"7",label:"7",shift:"#@^7",class:"hide-shift"},"[8]":{variants:"8",latex:"8",label:"8",shift:"#@^8",class:"hide-shift"},"[9]":{variants:"9",latex:"9",label:"9",shift:"#@^9",class:"hide-shift"},"[separator-5]":{class:"separator",width:.5},"[separator]":{class:"separator"},"[separator-10]":{class:"separator"},"[separator-15]":{class:"separator",width:1.5},"[separator-20]":{class:"separator",width:2},"[separator-50]":{class:"separator",width:5},"[shift]":{class:"shift bottom left",width:1.5,label:"<span class=caps-lock-indicator></span><svg class=svg-glyph><use xlink:href=#svg-shift /></svg>"},"[foreground-color]":{variants:"foreground-color",command:["applyStyle",{color:"red"}],label:"<span style='border-radius: 50%;width:22px;height:22px; border: 3px solid #cc2428; box-sizing: border-box'>"},"[background-color]":{variants:"background-color",command:["applyStyle",{backgroundColor:"yellow"}],label:"<span style='border-radius: 50%;width:22px;height:22px; background:#fff590; box-sizing: border-box'></span>"}};function E0(a){var y;if(typeof a=="string"){if(a==="[.]"&&window.MathfieldElement.decimalSeparator===","&&(a="[,]"),!mc[a])return{latex:a};a={label:a}}let b;return"label"in a&&a.label&&mc[a.label]&&(b=ke(Ce(Ce({},mc[a.label]),a),{label:mc[a.label].label})),"key"in a&&a.key&&mc[a.key]&&(b=ke(Ce(Ce({},mc[a.key]),a),{key:mc[a.key].key})),b?(b.command==="insertDecimalSeparator"&&(b.label=(y=window.MathfieldElement.decimalSeparator)!=null?y:"."),a.label==="[action]"&&(b=Ce(Ce({},b),window.mathVirtualKeyboard.actionKeycap)),a.label==="[shift]"&&(b=Ce(Ce({},b),window.mathVirtualKeyboard.shiftKeycap)),a.label==="[backspace]"&&(b=Ce(Ce({},b),window.mathVirtualKeyboard.backspaceKeycap)),a.label==="[tab]"&&(b=Ce(Ce({},b),window.mathVirtualKeyboard.tabKeycap)),b):a}var Md;function kg(a){var y;if(a.button!==0)return;const b=Rl.singleton;if(!b)return;let E=a.target;for(;E&&!E.getAttribute("data-layer");)E=E.parentElement;if(E){b.currentLayer=(y=E.getAttribute("data-layer"))!=null?y:"",a.preventDefault();return}const ee=hu(a.target);if(!(ee!=null&&ee.id))return;const re=b.getKeycap(ee.id);if(!re)return;console.assert(a.type==="pointerdown");const ae=new AbortController,ue=ae.signal;ee.classList.add("is-pressed"),ee.addEventListener("pointerenter",Ph(ae),{capture:!0,signal:ue}),ee.addEventListener("pointerleave",Ph(ae),{capture:!0,signal:ue}),ee.addEventListener("pointercancel",Ph(ae),{signal:ue}),ee.addEventListener("pointerup",Ph(ae),{signal:ue}),fu(re)&&(ee.classList.add("is-active"),b.shiftPressCount++),re.variants&&(Md&&clearTimeout(Md),Md=setTimeout(()=>{ee.classList.contains("is-pressed")&&(ee.classList.remove("is-pressed"),ee.classList.add("is-active"),a.target&&"releasePointerCapture"in a.target&&a.target.releasePointerCapture(a.pointerId),M0(ee,()=>{ae.abort(),ee==null||ee.classList.remove("is-active")}))},300)),a.preventDefault()}function Ph(a){return y=>{const b=hu(y.target);if(!(b!=null&&b.id))return;const E=Rl.singleton;if(!E)return;const ee=E.getKeycap(b.id);if(ee){if(y.type==="pointerenter"&&y.target===b&&y.isPrimary&&b.classList.add("is-pressed"),y.type==="pointercancel"){b.classList.remove("is-pressed"),fu(ee)&&(E.shiftPressCount--,b.classList.toggle("is-active",E.isShifted)),a.abort();return}if(y.type==="pointerleave"&&y.target===b){b.classList.remove("is-pressed"),fu(ee)&&(E.shiftPressCount--,b.classList.toggle("is-active",E.isShifted));return}if(y.type==="pointerup"){Md&&clearTimeout(Md),fu(ee)?b.classList.toggle("is-active",E.isShifted):b.classList.contains("is-pressed")&&(b.classList.remove("is-pressed"),E.isShifted&&ee.shift?typeof ee.shift=="string"?E.executeCommand(["insert",ee.shift,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]):Mf(ee.shift):Mf(ee),E.shiftPressCount===1&&!y.shiftKey&&(E.shiftPressCount=0)),a.abort(),y.preventDefault();return}}}}function Mf(a){var y;let b=a.command;!b&&a.insert&&(b=["insert",a.insert,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),!b&&a.key&&(b=["typedText",a.key,{focus:!0,feedback:!0,simulateKeystroke:!0}]),!b&&a.latex&&(b=["insert",a.latex,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),b||(b=["typedText",a.label,{focus:!0,feedback:!0,simulateKeystroke:!0}]),(y=Rl.singleton)==null||y.executeCommand(b)}function Eg(a){if(a.nodeType!==1)return!1;const y=a.classList;return y.contains("MLK__keycap")||y.contains("shift")||y.contains("action")||y.contains("fnbutton")||y.contains("bigfnbutton")}function hu(a){if(!a)return;let y=a;for(;y&&!Eg(y);)y=y.parentElement;return y!=null?y:void 0}function fu(a){return!!a.class&&/(^|\s)shift($|\s)/.test(a.class)}var Rl=class tm{constructor(){this.originalContainerBottomPadding=null,this.keycapRegistry={},this._shiftPressCount=0;var y,b,E;this.targetOrigin=window.origin,this.originValidator="none",this._alphabeticLayout="auto",this._layouts=Object.freeze(["default"]),this._editToolbar="default",this._container=(b=(y=window.document)==null?void 0:y.body)!=null?b:null,this._visible=!1,this._rebuilding=!1,this.observer=new ResizeObserver(ee=>{this.adjustBoundingRect(),this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect})}),this.listeners={};try{(E=window.top)==null||E.addEventListener("message",this)}catch(ee){window.addEventListener("message",this)}document.body.addEventListener("focusin",ee=>{const re=ee.target;re!=null&&re.isConnected&&setTimeout(()=>{const ae=L0();ae&&!ae.readOnly&&ae.mathVirtualKeyboardPolicy==="auto"&&et()&&this.show({animate:!0})},300)}),document.addEventListener("focusout",ee=>{ee.target.mathVirtualKeyboardPolicy!=="manual"&&setTimeout(()=>{L0()||this.hide()},300)})}get currentLayer(){var y,b,E;return(E=(b=(y=this._element)==null?void 0:y.querySelector(".MLK__layer.is-visible"))==null?void 0:b.id)!=null?E:""}set currentLayer(y){var b;if(!this._element){this.latentLayer=y;return}let E=y?this._element.querySelector(`#${y}.MLK__layer`):null;E||(E=this._element.querySelector(".MLK__layer")),E&&((b=this._element.querySelector(".MLK__layer.is-visible"))==null||b.classList.remove("is-visible"),E.classList.add("is-visible")),this.render()}get shiftPressCount(){return this._shiftPressCount}set shiftPressCount(y){var b;this._shiftPressCount=y>2||y<0?0:y,(b=this._element)==null||b.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.render()}get isShifted(){return this._shiftPressCount>0}resetKeycapRegistry(){this.keycapRegistry={}}registerKeycap(y){const b="ML__k"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);return this.keycapRegistry[b]=y,b}getKeycap(y){return y?this.keycapRegistry[y]:void 0}getLayer(y){const b=this.normalizedLayouts;for(const E of b)for(const ee of E.layers)if(ee.id===y)return ee}get alphabeticLayout(){return this._alphabeticLayout}set alphabeticLayout(y){this._alphabeticLayout=y,this.rebuild()}get actionKeycap(){return this._actionKeycap}set actionKeycap(y){this._actionKeycap=typeof y=="string"?{label:y}:y}get shiftKeycap(){return this._shiftKeycap}set shiftKeycap(y){this._shiftKeycap=typeof y=="string"?{label:y}:y}get backspaceKeycap(){return this._backspaceKeycap}set backspaceKeycap(y){this._backspaceKeycap=typeof y=="string"?{label:y}:y}get tabKeycap(){return this._tabKeycap}set tabKeycap(y){this._tabKeycap=typeof y=="string"?{label:y}:y}get layouts(){return this._layouts}set layouts(y){this.updateNormalizedLayouts(y),this.rebuild()}updateNormalizedLayouts(y){const b=Array.isArray(y)?[...y]:[y],E=b.findIndex(ee=>ee==="default");E>=0&&b.splice(E,1,"numeric","symbols","alphabetic","greek"),this._layouts=Object.freeze(b),this._normalizedLayouts=b.map(ee=>k0(ee))}get normalizedLayouts(){return this._normalizedLayouts||this.updateNormalizedLayouts(this._layouts),this._normalizedLayouts}get editToolbar(){return this._editToolbar}set editToolbar(y){this._editToolbar=y,this.rebuild()}get container(){return this._container}set container(y){this._container=y,this.rebuild()}static get singleton(){if(this._singleton===void 0)try{this._singleton=new tm}catch(y){this._singleton=null}return this._singleton}get style(){return this._style}addEventListener(y,b,E){this.listeners[y]||(this.listeners[y]=new Set),this.listeners[y].has(b)||this.listeners[y].add(b)}dispatchEvent(y){return!this.listeners[y.type]||this.listeners[y.type].size===0?!0:(this.listeners[y.type].forEach(b=>{typeof b=="function"?b(y):b==null||b.handleEvent(y)}),!y.defaultPrevented)}removeEventListener(y,b,E){this.listeners[y]&&this.listeners[y].delete(b)}get element(){return this._element}set element(y){var b;this._element!==y&&((b=this._element)==null||b.remove(),this._element=y)}get visible(){return this._visible}set visible(y){y?this.show():this.hide()}get boundingRect(){var y;if(!this._visible)return new DOMRect;const b=(y=this._element)==null?void 0:y.getElementsByClassName("MLK__plate")[0];return b?b.getBoundingClientRect():new DOMRect}adjustBoundingRect(){var y,b;const E=this.boundingRect.height;if(this.container===document.body){(y=this._element)==null||y.style.setProperty("--_keyboard-height",`calc(${E}px + var(--_padding-top) + var(--_padding-bottom) + env(safe-area-inset-bottom, 0))`);const ee=E-1;this.container.style.paddingBottom=this.originalContainerBottomPadding?`calc(${this.originalContainerBottomPadding} + ${ee}px)`:`${ee}px`}else(b=this._element)==null||b.style.setProperty("--_keyboard-height",`${E}px`)}rebuild(){if(this._rebuilding||!this._element)return;this._rebuilding=!0;const y=this.currentLayer;requestAnimationFrame(()=>{this._rebuilding=!1,this._element&&(this._element.remove(),this._element=void 0),this.visible&&(this.buildAndAttachElement(),this.currentLayer=y,this.render(),this.adjustBoundingRect(),this._element.classList.add("is-visible"))})}render(){if(!this._element)return;const y=this.getLayer(this.currentLayer);this._element.classList.toggle("backdrop-is-transparent",!!(y&&(y.backdrop||y.container)));const b=this._element.querySelectorAll(".MLK__layer.is-visible .MLK__keycap, .MLK__layer.is-visible .action, .fnbutton, .MLK__layer.is-visible .bigfnbutton, .MLK__layer.is-visible .shift");if(b)for(const E of b){const ee=this.getKeycap(E.id);if(ee){const[re,ae]=Th(ee,{shifted:this.isShifted});E.innerHTML=window.MathfieldElement.createHTML(re),E.className=ae}}}show(y){var b;if(this._visible)return;const E=this.container;if(E&&window.mathVirtualKeyboard&&this.stateWillChange(!0)){if(this._element||(this.buildAndAttachElement(),this.adjustBoundingRect()),!this._visible){const ee=this._element.getElementsByClassName("MLK__plate")[0];if(ee&&this.observer.observe(ee),E===window.document.body){const re=E.style.paddingBottom;this.originalContainerBottomPadding=re;const ae=ee.offsetHeight-1;E.style.paddingBottom=re?`calc(${re} + ${ae}px)`:`${ae}px`}window.addEventListener("mouseup",this),window.addEventListener("blur",this),window.addEventListener("keydown",this,{capture:!0}),window.addEventListener("keyup",this,{capture:!0}),(b=this._element)==null||b.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.currentLayer=this.latentLayer}this._visible=!0,y!=null&&y.animate?requestAnimationFrame(()=>{this._element&&(this._element.classList.add("animate"),this._element.addEventListener("transitionend",()=>{var ee;return(ee=this._element)==null?void 0:ee.classList.remove("animate")},{once:!0}),this._element.classList.add("is-visible"),this.stateChanged())}):(this._element.classList.add("is-visible"),this.stateChanged())}}hide(y){var b;const E=this.container;if(E&&this._visible&&this.stateWillChange(!1)){if(this._visible=!1,this._element){this.latentLayer=this.currentLayer;const ee=this._element.getElementsByClassName("MLK__plate")[0];ee&&this.observer.unobserve(ee),window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("keydown",this,{capture:!0}),window.removeEventListener("keyup",this,{capture:!0}),window.removeEventListener("contextmenu",this,{capture:!0}),wd(),wg(),(b=this._element)==null||b.remove(),this._element=void 0,this.originalContainerBottomPadding!==null&&(E.style.paddingBottom=this.originalContainerBottomPadding)}this.stateChanged()}}get height(){var y,b;return(b=(y=this.element)==null?void 0:y.offsetHeight)!=null?b:0}buildAndAttachElement(){var y;console.assert(!this.element),this.element=Cg(this),window.addEventListener("contextmenu",this,{capture:!0}),this.element.addEventListener("contextmenu",b=>{b.shiftKey||((b.ctrlKey||b.button===2)&&M0(b.target),b.preventDefault(),b.stopPropagation())},{capture:!0}),(y=this.container)==null||y.appendChild(this.element)}handleEvent(y){if(Cf(y)){if(!ld(y.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${y.origin}) cannot be handled`,"SecurityError");y.data.action==="disconnect"?this.connectedMathfieldWindow=void 0:y.data.action!=="update-setting"&&y.data.action!=="proxy-created"&&y.data.action!=="execute-command"&&(console.assert(y.source!==void 0),this.connectedMathfieldWindow=y.source),this.handleMessage(y.data,y.source)}if(this._element)switch(y.type){case"mouseup":case"blur":document.body.style.userSelect="",this.shiftPressCount=0;break;case"contextmenu":y.button!==2&&y.preventDefault();break;case"keydown":{y.key==="Shift"&&!y.repeat&&(this.shiftPressCount=1);break}case"keyup":{(y.key==="Shift"||!y.getModifierState("Shift")&&this.shiftPressCount!==2)&&(this.shiftPressCount=0);break}}}handleMessage(y,b){const{action:E}=y;if(E==="execute-command"){const{command:ee}=y,re=du(ee);if(window.top!==void 0&&re!=="virtual-keyboard")return;this.executeCommand(ee);return}if((E==="connect"||E==="show")&&this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},b),E!=="disconnect"&&window===window.top){if(E==="show"){typeof y.animate!="undefined"?this.show({animate:y.animate}):this.show();return}if(E==="hide"){typeof y.animate!="undefined"?this.hide({animate:y.animate}):this.hide();return}if(E==="update-setting"){y.alphabeticLayout&&(this.alphabeticLayout=y.alphabeticLayout),y.layouts&&(this.layouts=y.layouts),y.editToolbar&&(this.editToolbar=y.editToolbar);return}if(E==="proxy-created"){this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},b);return}}}sendMessage(y,b,E){if(E||(E=this.connectedMathfieldWindow),this.targetOrigin===null||this.targetOrigin==="null"||E===window){window.dispatchEvent(new MessageEvent("message",{source:window,data:Ce({type:Dh,action:y},b)}));return}if(E)E.postMessage(Ce({type:Dh,action:y},b),{targetOrigin:this.targetOrigin});else if(b.command&&this.dispatchEvent(new CustomEvent("math-virtual-keyboard-command",{detail:b.command})),y==="execute-command"&&Array.isArray(b.command)&&b.command[0]==="insert"){const ee=b.command[1].split("");for(const re of ee)this.dispatchEvent(new KeyboardEvent("keydown",{key:re,bubbles:!0})),this.dispatchEvent(new KeyboardEvent("keyup",{key:re,bubbles:!0}))}}stateWillChange(y){return this.dispatchEvent(new CustomEvent("before-virtual-keyboard-toggle",{detail:{visible:y},bubbles:!0,cancelable:!0,composed:!0}))}stateChanged(){this.dispatchEvent(new Event("virtual-keyboard-toggle")),this._visible||(this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect}))}focus(){this.sendMessage("focus",{})}blur(){this.sendMessage("blur",{})}updateToolbar(y){const b=this._element;if(!b)return;b.classList.toggle("is-math-mode",y.mode==="math"),b.classList.toggle("is-text-mode",y.mode==="text"),b.classList.toggle("can-undo",y.canUndo),b.classList.toggle("can-redo",y.canRedo),b.classList.toggle("can-copy",!y.selectionIsCollapsed),b.classList.toggle("can-copy",!y.selectionIsCollapsed),b.classList.toggle("can-paste",!0);const E=b.querySelectorAll(".ML__edit-toolbar");if(E)for(const ee of E)ee.innerHTML=vg(this,y)}update(y){this._style=y.style,this.updateToolbar(y)}connect(){this.connectedMathfieldWindow=window}disconnect(){this.connectedMathfieldWindow=void 0}executeCommand(y){let b,E=[],ee=du(y);return Oe(y)?(b=y[0],b==="performWithFeedback"&&(y=y.slice(1),ee=du(y)),E=y.slice(1)):b=y,b=b.replace(/-\w/g,re=>re[1].toUpperCase()),ee==="virtual-keyboard"?zs[b].fn(void 0,...E):(this.sendMessage("execute-command",{command:y}),!1)}dispose(){window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("message",this)}};function L0(){var a,y;let b=Sh(),E=null;for(;b;){if("host"in b&&((y=(a=b.host)==null?void 0:a.tagName)==null?void 0:y.toLowerCase())==="math-field"){E=b.host;break}b=b.parentNode}return E}if(kt()&&!("mathVirtualKeyboard"in window))if(window===window.top){const a=Rl.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>a})}else Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>ug.singleton,configurable:!0});function Ih(a){const y={};for(const b of Object.keys(a))switch(b){case"scriptDepth":const E=a.scriptDepth;if(Oe(E))y.scriptDepth=[E[0],E[1]];else if(typeof E=="number")y.scriptDepth=[E,E];else if(typeof E=="string"){const[re,ae]=E.split(",").map(ue=>parseInt(ue.trim()));y.scriptDepth=[re,ae]}else throw new TypeError("Unexpected value for scriptDepth");break;case"mathVirtualKeyboardPolicy":let ee=a.mathVirtualKeyboardPolicy.toLowerCase();if(ee==="sandboxed"){if(window!==window.top){const re=Rl.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>re})}ee="manual"}y.mathVirtualKeyboardPolicy=ee;break;case"letterShapeStyle":a.letterShapeStyle==="auto"?nt.locale.startsWith("fr")?y.letterShapeStyle="french":y.letterShapeStyle="tex":y.letterShapeStyle=a.letterShapeStyle;break;case"defaultMode":["text","math","inline-math"].includes(a.defaultMode)?y.defaultMode=a.defaultMode:(console.error('MathLive 0.98.5: valid values for defaultMode are "text", "math" or "inline-math"'),y.defaultMode="math");break;case"macros":y.macros=Re(a.macros);break;default:Oe(a[b])?y[b]=[...a[b]]:typeof a[b]=="object"&&!(a[b]instanceof Element)&&b!=="computeEngine"?y[b]=Ce({},a[b]):y[b]=a[b]}return y}function gc(a,y){let b;typeof y=="string"?b=[y]:y===void 0?b=Object.keys(a):b=y;const E={};for(const ee of b)a[ee]===null?E[ee]=null:Oe(a[ee])?E[ee]=[...a[ee]]:typeof a[ee]=="object"&&!(a[ee]instanceof Element)&&ee!=="computeEngine"?E[ee]=Ce({},a[ee]):E[ee]=a[ee];return typeof y=="string"?E[y]:E}function Bh(){return{readOnly:!1,defaultMode:"math",macros:{},registers:{},colorMap:Ot,backgroundColorMap:rt,letterShapeStyle:nt.locale.startsWith("fr")?"french":"tex",minFontScale:0,smartMode:!1,smartFence:!0,smartSuperscript:!0,scriptDepth:[1/0,1/0],removeExtraneousParentheses:!0,isImplicitFunction:a=>["\\sin","\\cos","\\tan","\\arcsin","\\arccos","\\arctan","\\arcsec","\\arccsc","\\arsinh","\\arcosh","\\artanh","\\arcsech","\\arccsch","\\arg","\\ch","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\sec","\\sinh","\\sh","\\tanh","\\tg","\\th","\\lg","\\lb","\\log","\\ln"].includes(a),mathModeSpace:"",placeholderSymbol:"\u25A2",contentPlaceholder:"",popoverPolicy:"auto",environmentPopoverPolicy:"off",keybindings:lf,inlineShortcuts:dh,inlineShortcutTimeout:0,mathVirtualKeyboardPolicy:"auto",virtualKeyboardTargetOrigin:window==null?void 0:window.origin,originValidator:"none",onInlineShortcut:()=>"",onScrollIntoView:null,onExport:sf,value:""}}function D0(a){return a.defaultMode==="inline-math"?"math":a.defaultMode}function Nl(a,y){!a||!y||(Oe(a)?a.forEach(b=>Nl(b,y)):typeof a=="object"&&!a.style.color&&!a.style.backgroundColor&&!a.style.fontFamily&&!a.style.fontShape&&!a.style.fontSeries&&!a.style.fontSize&&!a.style.variant&&!a.style.variantStyle&&(a.applyStyle(y),Nl(a.body,y),Nl(a.above,y),Nl(a.below,y),Nl(a.subscript,y),Nl(a.superscript,y)))}function _f(a,y,b,E){function ee(ae,ue){for(const he of re)if(he.style[ae]!==ue)return!1;return!0}if(y=a.normalizeRange(y),y[0]===y[1])return!1;const re=a.getAtoms(y,{includeChildren:!0});E.operation==="toggle"&&(b.color&&ee("color",b.color)&&(b.color="none",delete b.verbatimColor),b.backgroundColor&&ee("backgroundColor",b.backgroundColor)&&(b.backgroundColor="none",delete b.verbatimBackgroundColor),b.fontFamily&&ee("fontFamily",b.fontFamily)&&(b.fontFamily="none"),b.fontSeries&&ee("fontSeries",b.fontSeries)&&(b.fontSeries="auto"),b.fontShape&&ee("fontShape",b.fontShape)&&(b.fontShape="auto"),b.fontSize&&ee("fontSize",b.fontSize)&&(b.fontSize=Ds),b.variant&&ee("variant",b.variant)&&(b.variant="normal"),b.variantStyle&&ee("variantStyle",b.variantStyle)&&(b.variantStyle=""));for(const ae of re)ae.applyStyle(b);return!0}function Lg(a,y){const b=a.at(a.position);if(b.type==="composition")b.value=y;else{const{caret:E}=b;b.caret=void 0;const ee=new fl(y,{mode:b.mode});ee.caret=E,b.parent.addChildAfter(ee,b),a.position+=1}}function Dg(a){const y=a.at(a.position);y.type==="composition"&&(y.parent.removeChild(y),a.position-=1)}mn(["math","displaymath"],Jo),mn("center",Jo),yt("displaylines","",{parse:a=>{const y=[];let b=[];a.beginContext({tabular:!0});do{if(a.end()||a.match("<}>"))break;a.matchColumnSeparator()||a.matchRowSeparator()?(y.push([b]),b=[]):b.push(...a.scan(E=>["<}>","&","\\cr","\\\\","\\tabularnewline"].includes(E)))}while(!0);return a.endContext(),y.push([b]),y},createAtom:a=>new hi("lines",a.args,[],{leftDelim:".",rightDelim:".",columns:[{align:"l"}]})}),En("array","{columns:colspec}",(a,y,b,E)=>new hi(a,kf(y),b,{columns:E[0],mathstyleName:"textstyle"})),En(["equation","equation*","subequations"],"",(a,y,b)=>new hi(a,kf(y),b,{columns:[{align:"c"}]})),En(["multline","multline*"],"",Jo),En(["align","align*","aligned","eqnarray"],"",Jo),En("split","",Jo),En(["gather","gathered"],"",Jo),En(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],"[columns:colspec]",Jo),En(["smallmatrix","smallmatrix*"],"[columns:colspec]",Jo),En(["cases","dcases","rcases"],"",Jo);function Ag(a){for(const y of a)for(const b of y)if(b.length>0)return!1;return!0}function kf(a,y=1){return Ag(a)?Array(y).fill([[new Dn({type:"first"}),new Qr]]):a.map(b=>b.length===0?[[new Dn({type:"first"})]]:b.map(E=>E.length===0?[new Dn({type:"first"})]:(E[0].type!=="first"&&E.unshift(new Dn({type:"first"})),E)))}function Jo(a,y=[[[]]],b=[],E=[]){switch(y=kf(y,["split","align","align*","aligned","eqnarray"].includes(a)?2:1),a){case"math":return new hi(a,y,b,{mathstyleName:"textstyle"});case"displaymath":return new hi(a,y,b,{mathstyleName:"textstyle"});case"center":return new hi(a,y,b,{columns:[{align:"c"}]});case"multline":case"multline*":return new hi(a,y,b,{columns:[{align:"m"}],leftDelim:".",rightDelim:"."});case"split":return new hi(a,y,b,{columns:[{align:"r"},{align:"l"}],minColumns:2});case"gather":case"gathered":return new hi(a,y,b,{columns:[{gap:.25},{align:"c"},{gap:0}]});case"pmatrix":case"pmatrix*":return new hi(a,y,b,{mathstyleName:"textstyle",leftDelim:"(",rightDelim:")",columns:vc(E[0])});case"bmatrix":case"bmatrix*":return new hi(a,y,b,{mathstyleName:"textstyle",leftDelim:"[",rightDelim:"]",columns:vc(E[0])});case"Bmatrix":case"Bmatrix*":return new hi(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\lbrace",rightDelim:"\\rbrace",columns:vc(E[0])});case"vmatrix":case"vmatrix*":return new hi(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\vert",rightDelim:"\\vert",columns:vc(E[0])});case"Vmatrix":case"Vmatrix*":return new hi(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\Vert",rightDelim:"\\Vert",columns:vc(E[0])});case"matrix":case"matrix*":return new hi(a,y,b,{mathstyleName:"textstyle",leftDelim:".",rightDelim:".",columns:vc(E==null?void 0:E[0])});case"smallmatrix":case"smallmatrix*":return new hi(a,y,b,{mathstyleName:"scriptstyle",columns:vc(E==null?void 0:E[0]),colSeparationType:"small",arraystretch:.5});case"cases":case"dcases":return new hi(a,y,b,{mathstyleName:a==="dcases"?"displaystyle":"textstyle",arraystretch:1.2,leftDelim:"\\lbrace",rightDelim:".",columns:[{align:"l"},{gap:1},{align:"l"}]});case"rcases":return new hi(a,y,b,{arraystretch:1.2,leftDelim:".",rightDelim:"\\rbrace",columns:[{align:"l"},{gap:1},{align:"l"}]});case"lines":return new hi(a,y,b,{leftDelim:".",rightDelim:".",columns:[{align:"l"}]});case"align":case"align*":case"aligned":case"eqnarray":{let ee=0;for(const ue of y)ee=Math.max(ee,ue.length);const re=[{gap:0},{align:"r"},{gap:.25},{align:"l"}];let ae=2;for(;ae<ee;)re.push({gap:1},{align:"r"},{gap:.25},{align:"l"}),ae+=2;return re.push({gap:0}),new hi(a,y,b,{arraycolsep:0,columns:re,minColumns:2})}}return new hi(a,y,b,{mathstyleName:"textstyle"})}function vc(a){return a!=null?a:[{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"}]}function Tg(a,y){let b=a.at(a.position);for(;b&&!(b.parent instanceof hi);)b=b.parent;if(b&&b.type==="array"&&b.environmentName,!b||!(b.parent instanceof hi)){const E=a.at(a.position);if(b=E,!b.parent.parent){let ee=a.extractAtoms([a.position,a.lastOffset]),re=a.extractAtoms([0,a.position]);re.length===0&&(re=Nh()),ee.length===0&&(ee=Nh());let ae;return y.endsWith("column")?(ae=Jo("split",[[re,ee]]),a.root=ae,yc(ae,0,0)?bc(a,ae,0,0):yc(ae,0,1)?bc(a,ae,0,1):a.position=a.offsetOf(E)):(ae=Jo("lines",[[re],[ee]]),a.root=ae,yc(ae,0,0)?bc(a,ae,0,0):yc(ae,1,0)?bc(a,ae,1,0):a.position=a.offsetOf(E)),[void 0,[0,0]]}if(b.parent instanceof Ri){const ee=b.parent;let re=a.extractAtoms([a.position,a.offsetOf(ee.lastChild)]),ae=a.extractAtoms([a.offsetOf(ee.firstChild),a.position]);ae.length===0&&(ae=Nh()),re.length===0&&(re=Nh());let ue="pmatrix";const he=ee.leftDelim,ge=ee.rightDelim;he==="("&&(ge===")"||ge==="?")?ue="pmatrix":(he==="["||he==="\\lbrack")&&(ge==="]"||ge==="\\rbrack"||ge==="?")?ue="bmatrix":he==="\\vert"&&ge==="\\vert"?ue="vmatrix":he==="\\Vert"&&ge==="\\Vert"?ue="Vmatrix":(he==="{"||he==="\\lbrace")&&(ge==="."||ge==="?")&&(ue="cases");const be=Jo(ue,y.endsWith("column")?[[ae,re]]:[[ae],[re]]);return ee.parent.addChildBefore(be,ee),ee.parent.removeChild(ee),yc(be,0,0)?bc(a,be,0,0):y.endsWith("column")?yc(be,0,1)?bc(a,be,0,1):a.position=a.offsetOf(b):yc(be,1,0)?bc(a,be,1,0):a.position=a.offsetOf(b),[void 0,[0,0]]}}return b&&b.parent instanceof hi?[b.parent,b.parentBranch]:[void 0,[0,0]]}function yc(a,y,b){const E=a.getCell(y,b);return!E||E.length!==2?!1:E[1].type==="placeholder"}function Pg(a,y,b,E){const ee=y.getCell(b,E);return ee?[a.offsetOf(ee[0]),a.offsetOf(ee[ee.length-1])]:-1}function bc(a,y,b,E){const ee=Pg(a,y,b,E);typeof ee!="number"&&a.setSelection(ee)}function Oh(a,y,b,E,ee){const re=y.getCell(b,E);re&&a.setPositionHandlingPlaceholder(a.offsetOf(re[ee==="start"?0:re.length-1]))}function Rh(a,y){const[b,[E,ee]]=Tg(a,y);if(b)switch(y){case"after row":b.addRowAfter(E),Oh(a,b,E+1,0,"end");break;case"after column":if(b.maxColumns<=b.colCount){a.announce("plonk");return}b.addColumnAfter(ee),Oh(a,b,E,ee+1,"end");break;case"before row":b.addRowBefore(E),Oh(a,b,E,0,"start");break;case"before column":if(b.maxColumns<=b.colCount){a.announce("plonk");return}b.addColumnBefore(ee),Oh(a,b,E,ee,"start");break}}function A0(a){return a.contentWillChange({inputType:"insertText"})?(Rh(a,"after row"),a.contentDidChange({inputType:"insertText"}),!0):!1}function Ig(a){return a.contentWillChange({inputType:"insertText"})?(Rh(a,"before row"),a.contentDidChange({inputType:"insertText"}),!0):!1}function T0(a){return a.contentWillChange({inputType:"insertText"})?(Rh(a,"after column"),a.contentDidChange({inputType:"insertText"}),!0):!1}function Bg(a){return a.contentWillChange({inputType:"insertText"})?(Rh(a,"before column"),a.contentDidChange({inputType:"insertText"}),!0):!1}function P0(a,y){if(!a.contentWillChange({}))return!1;a.mathfield.snapshot();let b=".",E=".";switch(y){case"pmatrix":case"pmatrix*":b="(",E=")";break;case"bmatrix":case"bmatrix*":b="[",E="]";break;case"Bmatrix":case"Bmatrix*":b="\\lbrace",E="\\rbrace";break;case"vmatrix":case"vmatrix*":b="\\vert",E="\\vert";break;case"Vmatrix":case"Vmatrix*":b="\\Vert",E="\\Vert";break;case"matrix":case"matrix*":b=".",E=".";break;case"cases":case"dcases":b="\\lbrace";break;case"rcases":E="\\rbrace";break}const ee=a.at(a.position),re=ee.type==="array"?ee:a.parentEnvironment;return re.environmentName=y,re.leftDelim=b,re.rightDelim=E,a.contentDidChange({}),!0}function I0(a,y){let b=a.at(a.position);for(;b&&!(Array.isArray(b.parentBranch)&&b.parent instanceof hi);)b=b.parent;if(Array.isArray(b==null?void 0:b.parentBranch)&&(b==null?void 0:b.parent)instanceof hi){const E=b.parent,ee=b.parentBranch;let re;switch(y){case"row":if(E.rowCount>1){E.removeRow(ee[0]);const ae=E.getCell(Math.max(0,ee[0]-1),ee[1]);re=a.offsetOf(ae[ae.length-1])}break;case"column":if(E.colCount>E.minColumns){E.removeColumn(ee[1]);const ae=E.getCell(ee[0],Math.max(0,ee[1]-1));re=a.offsetOf(ae[ae.length-1])}break}re&&a.setPositionHandlingPlaceholder(re)}}function Og(a){return a.contentWillChange({inputType:"deleteContent"})?(I0(a,"row"),a.contentDidChange({inputType:"deleteContent"}),!0):!1}function Rg(a){return a.contentWillChange({inputType:"deleteContent"})?(I0(a,"column"),a.contentDidChange({inputType:"deleteContent"}),!0):!1}Oo({addRowAfter:A0,addColumnAfter:T0,addRowBefore:Ig,addColumnBefore:Bg,removeRow:Og,removeColumn:Rg,setEnvironment:P0},{target:"model",canUndo:!0,changeContent:!0,changeSelection:!0});function Nh(){return[new Qr]}var B0=class nm{constructor(y){this.recording=!1,this.model=y,this.reset()}reset(){this.stack=[],this.index=-1,this.lastOp=""}startRecording(){this.recording=!0}stopRecording(){this.recording=!1}canUndo(){return this.index-1>=0}canRedo(){return this.stack.length-1>this.index}stopCoalescing(y){y&&this.index>=0&&(this.stack[this.index].selection=y),this.lastOp=""}undo(){return this.canUndo()?(this.model.setState(this.stack[this.index-1],{silenceNotifications:!1,type:"undo"}),this.index-=1,this.lastOp="",!0):!1}redo(){return this.canRedo()?(this.index+=1,this.model.setState(this.stack[this.index],{silenceNotifications:!1,type:"redo"}),this.lastOp="",!0):!1}pop(){this.canUndo()&&(this.stack.splice(this.index,this.stack.length-this.index),this.index-=1)}snapshot(y){return this.recording?(y&&y===this.lastOp&&this.pop(),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push(this.model.getState()),this.index+=1,this.stack.length>nm.maximumDepth&&(this.stack.shift(),this.index-=1),this.lastOp=y!=null?y:"",!0):!1}};B0.maximumDepth=1e3;var Ng=B0;function Ef(a,y,b){if(a.at(y).mode!=="text")return y;const E=b==="backward"?-1:1;let ee;if(ye.test(a.at(y).value)){let re=y,ae;do ae=a.at(re).mode==="text"&&ye.test(a.at(re).value),re+=E;while(a.at(re)&&ae);ee=a.at(re)?re-2*E:re-E}else if(/\s/.test(a.at(y).value)){let re=y;for(;a.at(re)&&a.at(re).mode==="text"&&/\s/.test(a.at(re).value);)re+=E;if(!a.at(re))ee=re-E;else{let ae=!0;do ae=a.at(re).mode==="text"&&!/\s/.test(a.at(re).value),re+=E;while(a.at(re)&&ae);ee=a.at(re)?re-2*E:re-E}}else{let re=y;for(;a.at(re)&&a.at(re).mode==="text"&&!/\s/.test(a.at(re).value);)re+=E;ee=a.at(re)?re:re-E;let ae=!0;for(;a.at(re)&&ae;)ae=a.at(re).mode==="text"&&/\s/.test(a.at(re).value),ae&&(ee=re),re+=E;ee=a.at(re)?re-2*E:re-E}return ee-(E>0?0:1)}function pu(a,y,b){var E,ee,re,ae,ue,he,ge;const be=a.position;(E=b==null?void 0:b.extend)!=null&&E||a.collapseSelection(y);let Be=a.at(a.position);if(y==="forward"&&(Be.type==="subsup"?(Be=Be.rightSibling,Be||(Be=a.at(a.position+1))):Be=a.at(a.position+1)),!Be)return a.announce("plonk"),!1;let He=a.offsetOf(Be);if(Be instanceof vs)He=Ef(a,He,y);else if(Be instanceof Ja)if(Be.isSuggestion)for(console.assert(y==="forward");Be&&Be instanceof Ja;)Be.isSuggestion=!1,He=a.offsetOf(Be),Be=Be.rightSibling;else if(y==="forward"){if(Be=Be.rightSibling,!Be||!(Be instanceof Ja))return a.announce("plonk"),!1;for(;Be&&Be instanceof Ja&&/[a-zA-Z\*]/.test(Be.value);)He=a.offsetOf(Be),Be=Be.rightSibling}else{if(Be=Be.leftSibling,!Be||!(Be instanceof Ja))return a.announce("plonk"),!1;for(;Be&&Be instanceof Ja&&/[a-zA-Z\*]/.test(Be.value);)He=a.offsetOf(Be),Be=Be.leftSibling}else if(y==="forward"&&Be.type==="mopen"){let lt=0;do Be.type==="mopen"?lt+=1:Be.type==="mclose"&&(lt-=1),Be=Be.rightSibling;while(!Be.isLastSibling&&lt!==0);He=a.offsetOf(Be.leftSibling)}else if(y==="backward"&&Be.type==="mclose"){let lt=0;do Be.type==="mopen"?lt+=1:Be.type==="mclose"&&(lt-=1),Be=Be.leftSibling;while(!Be.isFirstSibling&&lt!==0);He=a.offsetOf(Be)}else if(y==="backward")if(Be.type==="first")for(;He>0&&Be.type==="first";)He-=1,Be=a.at(He);else{const lt=Be.type;Be.type==="subsup"&&(He=a.offsetOf(a.at(He).leftSibling)),He-=1;let xt=(ee=a.at(He))==null?void 0:ee.type;for(;He>=0&&xt===lt;)((re=a.at(He))==null?void 0:re.type)==="subsup"?He=a.offsetOf(a.at(He).leftSibling):He-=1,xt=a.at(He).type}else{const{type:lt}=Be;let xt=(ae=a.at(He))==null?void 0:ae.type;const{lastOffset:vn}=a;for(;He<=vn&&(xt===lt||xt==="subsup");){for(;((ue=a.at(He).rightSibling)==null?void 0:ue.type)==="subsup";)He=a.offsetOf(a.at(He).rightSibling);He+=1,xt=(he=a.at(He))==null?void 0:he.type}He-=1}if((ge=b==null?void 0:b.extend)!=null&&ge){if(!a.setSelection(a.anchor,He))return a.announce("plonk"),!1}else{if(He===a.position)return a.announce("plonk"),!1;a.position=He}return a.announce("move",be),a.mathfield.stopCoalescingUndo(),!0}function Ks(a,y,b){var E,ee;if(b=b!=null?b:{extend:!1},a.mathfield.adoptStyle=y==="backward"?"right":"left",y!=="forward"){const[ue,he]=g0(a);ue!==void 0&&he!==void 0&&a.deleteAtoms([ue,he])}if(y==="upward")return Fg(a,b);if(y==="downward")return zg(a,b);if(b.extend){let ue=$h(a,a.position,y);ue<0&&(ue=0),ue>a.lastOffset&&(ue=a.lastOffset);const he=a.setSelection(a.anchor,ue);return a.mathfield.stopCoalescingUndo(),he}if(a.selectionIsPlaceholder){a.collapseSelection(y);const ue=Ks(a,y);return a.mathfield.stopCoalescingUndo(),ue}let re=a.position;const ae=re;if(a.collapseSelection(y)?(re=a.position,O0(a,re)||(re=$h(a,re,y))):re=$h(a,re,y),re<0||re>a.lastOffset){let ue=!0;return a.silenceNotifications||(ue=(ee=(E=a.mathfield.host)==null?void 0:E.dispatchEvent(new CustomEvent("move-out",{detail:{direction:y},cancelable:!0,bubbles:!0,composed:!0})))!=null?ee:!0),ue&&a.announce("plonk"),ue}return a.setPositionHandlingPlaceholder(re),a.mathfield.stopCoalescingUndo(),a.announce("move",ae),!0}function $h(a,y,b){return y=y+(b==="forward"?1:-1),y<0||y>a.lastOffset||O0(a,y)?y:$h(a,y,b)}function O0(a,y){var b;const E=a.at(y);let ee=E.parent;for(;ee&&!ee.inCaptureSelection;)ee=ee.parent;return!(ee!=null&&ee.inCaptureSelection||(b=E.parent)!=null&&b.skipBoundary&&(!E.isFirstSibling&&E.isLastSibling||E.type==="first")||a.mathfield.hasEditablePrompts&&!E.parentPrompt)}function $g(a,y,b){let E=1/0,ee=0;for(;ee<y.length;ee++){const re=ru(a.getHTMLElement(y[ee])).right,ae=Math.abs(b-re);if(ae<=E)E=ae;else break}return y[ee-1]}function Fh(a,y,b,E,ee){const re=a.mathfield.hasEditablePrompts,ae=re?b.filter(ge=>ge.type==="prompt"&&!ge.captureSelection):b,ue=ru(a.mathfield.getHTMLElement(y)).right,he=a.offsetOf($g(a.mathfield,ae,ue))-(re?1:0);if(E){const[ge,be]=a.selection.ranges[0];let Be;he<(ee==="up"?ge:be)?Be={ranges:[[he,be]],direction:"backward"}:Be={ranges:[[ge,he]],direction:"forward"},a.setSelection(Be)}else a.setPositionHandlingPlaceholder(he);a.announce(`move ${ee}`)}function Fg(a,y){var b,E;const ee=(b=y==null?void 0:y.extend)!=null?b:!1;ee||a.collapseSelection("backward");const re=()=>{var he,ge;let be=!0;return a.silenceNotifications||(be=(ge=(he=a.mathfield.host)==null?void 0:he.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"upward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?ge:!0),a.announce(be?"plonk":"line"),be},ae=a.at(a.position);let ue=ae;for(;ue&&ue.parentBranch!=="below"&&!(Array.isArray(ue.parentBranch)&&ue.parent instanceof hi);)ue=ue.parent;if(Array.isArray(ue==null?void 0:ue.parentBranch)&&ue.parent instanceof hi){const he=ue.parent;if(ue.parentBranch[0]<1)return re();const ge=ue.parentBranch[0]-1,be=he.array[ge][ue.parentBranch[1]];if(!be.some(He=>He.type==="prompt"&&!He.captureSelection)&&a.mathfield.hasEditablePrompts)return re();Fh(a,ae,be,ee,"up")}else if(ue){const he=(E=ue.parent.branch("above"))!=null?E:ue.parent.createBranch("above");if(!he.some(be=>be.type==="prompt"&&be.placeholderId)&&a.mathfield.hasEditablePrompts)return re();Fh(a,ae,he,ee,"up")}else return re();return a.mathfield.stopCoalescingUndo(),!0}function zg(a,y){var b,E;const ee=(b=y==null?void 0:y.extend)!=null?b:!1;ee||a.collapseSelection("forward");const re=()=>{var he,ge;let be=!0;return a.silenceNotifications||(be=(ge=(he=a.mathfield.host)==null?void 0:he.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"downward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?ge:!0),a.announce(be?"plonk":"line"),be},ae=a.at(a.position);let ue=ae;for(;ue&&ue.parentBranch!=="above"&&!(Array.isArray(ue.parentBranch)&&ue.parent instanceof hi);)ue=ue.parent;if(Array.isArray(ue==null?void 0:ue.parentBranch)&&ue.parent instanceof hi){const he=ue.parent;if(ue.parentBranch[0]+1>he.array.length-1)return re();const ge=ue.parentBranch[0]+1,be=he.array[ge][ue.parentBranch[1]];if(!be.some(He=>He.type==="prompt"&&!He.captureSelection)&&a.mathfield.hasEditablePrompts)return re();Fh(a,ae,be,ee,"down")}else if(ue){const he=(E=ue.parent.branch("below"))!=null?E:ue.parent.createBranch("below");if(!he.some(be=>be.type==="prompt")&&a.mathfield.hasEditablePrompts)return re();Fh(a,ae,he,ee,"down")}else return re();return!0}function R0(a){const y=a.position,b=a.at(y).parent;return b!=null&&b.parent?(a.position=a.offsetOf(b),a.mathfield.stopCoalescingUndo(),a.announce("move",y),!0):(a.announce("plonk"),!1)}function Kg(a){let y=0,b=a.at(a.position),E=!1;for(;b;)(!b.hasEmptyBranch("superscript")||!b.hasEmptyBranch("subscript"))&&(y+=1),b.hasEmptyBranch("superscript")?b.hasEmptyBranch("subscript")||(E=!1):E=!0,b=b.parent;return E?y:0}function Hg(a){let y=0,b=a.at(a.position),E=!1;for(;b;)(!b.hasEmptyBranch("superscript")||!b.hasEmptyBranch("subscript"))&&(y+=1),b.hasEmptyBranch("superscript")?b.hasEmptyBranch("subscript")||(E=!0):E=!1,b=b.parent;return E?y:0}function N0(a){var y;if(a.collapseSelection(),Kg(a)>=a.mathfield.options.scriptDepth[1])return a.announce("plonk"),!1;let b=a.at(a.position);return b.subsupPlacement===void 0&&(((y=b.rightSibling)==null?void 0:y.type)!=="subsup"&&b.parent.addChildAfter(new Yo({style:b.computedStyle}),b),b=b.rightSibling),b.createBranch("superscript"),a.setSelection(a.getSiblingsRange(a.offsetOf(b.superscript[0]))),!0}function $0(a){var y;if(a.collapseSelection(),Hg(a)>=a.mathfield.options.scriptDepth[0])return a.announce("plonk"),!1;let b=a.at(a.position);return b.subsupPlacement===void 0&&(((y=a.at(a.position+1))==null?void 0:y.type)!=="subsup"&&b.parent.addChildAfter(new Yo({style:a.at(a.position).computedStyle}),b),b=a.at(a.position+1)),b.createBranch("subscript"),a.setSelection(a.getSiblingsRange(a.offsetOf(b.subscript[0]))),!0}function Wg(){function a(he){const ge=[],be=[];return[...he.querySelectorAll(`input, select, textarea, a[href], button,
[tabindex], audio[controls], video[controls],
[contenteditable]:not([contenteditable="false"]), details>summary`)].filter(y).forEach((He,lt)=>{const xt=E(He);xt===0?ge.push(He):be.push({documentOrder:lt,tabIndex:xt,node:He})}),be.sort((He,lt)=>He.tabIndex===lt.tabIndex?He.documentOrder-lt.documentOrder:He.tabIndex-lt.tabIndex).map(He=>He.node).concat(ge)}function y(he){return!(!b(he)||ee(he)||E(he)<0)}function b(he){return!(he.disabled||he.type==="hidden"&&he.tagName.toUpperCase()==="INPUT"||ue(he))}function E(he){var ge;const be=Number.parseInt((ge=he.getAttribute("tabindex"))!=null?ge:"NaN",10);return Number.isNaN(be)?he.contentEditable==="true"||(he.nodeName==="AUDIO"||he.nodeName==="VIDEO")&&he.getAttribute("tabindex")===null?0:he.tabIndex:be}function ee(he){return he.tagName.toUpperCase()==="INPUT"&&he.type==="radio"&&!ae(he)}function re(he,ge){for(const be of he)if(be.checked&&be.form===ge)return be;return null}function ae(he){var ge;if(!he.name)return!0;const Be=((ge=he.form)!=null?ge:he.ownerDocument).querySelectorAll('input[type="radio"][name="'+he.name+'"]'),He=re(Be,he.form);return!He||He===he}function ue(he){if(!kt()||he===document.activeElement||he.contains(document.activeElement))return!1;if(getComputedStyle(he).visibility==="hidden")return!0;const ge=he.getBoundingClientRect();if(ge.width===0||ge.height===0)return!0;for(;he;){if(getComputedStyle(he).display==="none")return!0;he=he.parentElement}return!1}return kt()?a(document.body):[]}function yo(a,y,b="forward"){const E=a.position;if(Array.isArray(y)){const ee=a.offsetOf(y[0]),re=a.offsetOf(y[y.length-1]);return b==="forward"?a.setSelection(ee,re):a.setSelection(re,ee),a.announce("move",E),a.mathfield.stopCoalescingUndo(),!0}return b==="forward"?yo(a,[y.leftSibling,y]):yo(a,[y,y.leftSibling])}function xs(a,y){const b=a.position;if(typeof y=="number"&&(y=a.at(y)),y.type==="prompt")a.setSelection(a.offsetOf(y.firstChild),a.offsetOf(y.lastChild));else{const E=a.offsetOf(y);y.type==="placeholder"?a.setSelection(E-1,E):a.position=E}return a.announce("move",b),a.mathfield.stopCoalescingUndo(),!0}function zh(a,y,b=!0){var E,ee;const re=y==="forward"?1:-1;a.at(a.anchor).type==="placeholder"&&Ks(a,y);let ae;const ue=a.at(a.anchor).parentPrompt;ue?y==="forward"?ae=a.offsetOf(ue)+1:ae=a.offsetOf(ue.leftSibling):ae=Math.max(a.position+re,0);const he=Lf(a,ae,y);if(!he||y==="forward"&&a.offsetOf(he)<ae||y==="backward"&&a.offsetOf(he)>ae){if(!b||!((ee=(E=a.mathfield.host)==null?void 0:E.dispatchEvent(new CustomEvent("move-out",{detail:{direction:y},cancelable:!0,bubbles:!0,composed:!0})))==null||ee))return a.announce("plonk"),!1;const be=Wg();if(!document.activeElement||be.length<=1)return a.announce("plonk"),!1;let Be=be.indexOf(document.activeElement)+re;return Be<0&&(Be=be.length-1),Be>=be.length&&(Be=0),be[Be].focus(),a.mathfield.stopCoalescingUndo(),!0}return xs(a,he),!0}function Lf(a,y=0,b="forward"){return a.findAtom(E=>E.type==="placeholder"||E.type==="prompt"||!a.mathfield.readOnly&&E.treeDepth>2&&E.isFirstSibling&&E.isLastSibling,y,b)}Oo({moveToOpposite:a=>{const y={superscript:"subscript",subscript:"superscript",above:"below",below:"above"},b=a.at(a.position),{parent:E}=b;if(!E)return a.announce("plonk"),!1;const ee=b.parentBranch;let re;if(typeof ee=="string"&&(re=y[ee]),!re){const ue=b.subsupPlacement?$0(a):N0(a);return a.mathfield.stopCoalescingUndo(),ue}E.branch(re)||E.createBranch(re);const ae=a.setSelection(a.getBranchRange(a.offsetOf(E),re));return a.mathfield.stopCoalescingUndo(),ae},moveBeforeParent:a=>{const{parent:y}=a.at(a.position);return y?(a.position=a.offsetOf(y),a.mathfield.stopCoalescingUndo(),!0):(a.announce("plonk"),!1)},moveAfterParent:a=>R0(a),moveToNextChar:a=>Ks(a,"forward"),moveToPreviousChar:a=>Ks(a,"backward"),moveUp:a=>Ks(a,"upward"),moveDown:a=>Ks(a,"downward"),moveToNextWord:a=>pu(a,"forward"),moveToPreviousWord:a=>pu(a,"backward"),moveToGroupStart:a=>{const y=a.offsetOf(a.at(a.position).firstSibling);return y===a.position?(a.announce("plonk"),!1):(a.position=y,a.mathfield.stopCoalescingUndo(),!0)},moveToGroupEnd:a=>{const y=a.offsetOf(a.at(a.position).lastSibling);return y===a.position?(a.announce("plonk"),!1):(a.position=y,a.mathfield.stopCoalescingUndo(),!0)},moveToNextGroup:a=>{var y,b,E,ee;if(a.position===a.lastOffset&&a.anchor===a.lastOffset)return zh(a,"forward");const re=a.at(a.position);if(re.mode==="text"){if(a.selectionIsCollapsed){let He=re;for(;He&&He.mode==="text";)He=He.leftSibling;let lt=re;for(;((y=lt.rightSibling)==null?void 0:y.mode)==="text";)lt=lt.rightSibling;if(He&&lt)return yo(a,[He,lt])}if(re.rightSibling.mode==="text"){let He=re;for(;He&&He.mode==="text";)He=He.rightSibling;return He?(xs(a,(b=He.leftSibling)!=null?b:He),a.mathfield.switchMode("math"),!0):xs(a,a.lastOffset)}}const ue=a.at(a.anchor).parentPrompt,he=ue?a.offsetOf(ue)+1:Math.max(a.position+1,0),ge=Lf(a,he,"forward");if(ge)return xs(a,ge);const be=F0(a,re,He=>He.type==="leftright"||He.type==="text","forward");if(be){if(be.mode==="text"){let He=be;for(;He&&He.mode==="text";)He=He.rightSibling;return yo(a,[(E=be.leftSibling)!=null?E:be,(ee=He.leftSibling)!=null?ee:He])}return yo(a,be)}const Be=re.parent;if(Be){if(Be.type==="leftright"||Be.type==="surd")return yo(a,Be);if(re.parentBranch==="superscript"&&Be.subscript)return yo(a,Be.subscript);if(re.parentBranch==="above"&&Be.below)return yo(a,Be.below);if(re.parentBranch==="superscript"||re.parentBranch==="subscript")return xs(a,Be);if(re.parentBranch==="above"||re.parentBranch==="below")return yo(a,Be)}return xs(a,a.lastOffset)},moveToPreviousGroup:a=>{var y;if(a.position===0&&a.anchor===0)return zh(a,"backward");let b=a.at(a.position);const E=b.mode;if(E==="text"){if(a.selectionIsCollapsed){let ue=b;for(;ue&&ue.mode==="text";)ue=ue.leftSibling;let he=b;for(;((y=he.rightSibling)==null?void 0:y.mode)==="text";)he=he.rightSibling;if(ue&&he)return yo(a,[ue,he])}for(;b&&b.mode==="text";)b=b.leftSibling;return b?xs(a,b):xs(a,0)}const ee=a.at(a.anchor).parentPrompt,re=ee?a.offsetOf(ee.leftSibling):Math.max(a.position-1,0),ae=Lf(a,re,"backward");if(ae)return xs(a,ae);if(E==="math"){const ue=F0(a,b,ge=>ge.type==="leftright"||ge.type==="text","backward");if(ue){if(ue.mode==="text"){let ge=ue;for(;ge&&ge.mode==="text";)ge=ge.leftSibling;return yo(a,[ue,ge])}return yo(a,ue)}const he=b.parent;if(he){if(he.type==="leftright"||he.type==="surd")return yo(a,he);if(b.parentBranch==="subscript"&&he.superscript)return yo(a,he.superscript);if(b.parentBranch==="below"&&he.above)return yo(a,he.above);if(b.parentBranch==="superscript"||b.parentBranch==="subscript")return xs(a,he);if(b.parentBranch==="above"||b.parentBranch==="below")return yo(a,he)}return xs(a,0)}return!1},moveToMathfieldStart:a=>a.selectionIsCollapsed&&a.position===0?(a.announce("plonk"),!1):(a.position=0,a.mathfield.stopCoalescingUndo(),!0),moveToMathfieldEnd:a=>a.selectionIsCollapsed&&a.position===a.lastOffset?(a.announce("plonk"),!1):(a.position=a.lastOffset,a.mathfield.stopCoalescingUndo(),!0),moveToSuperscript:N0,moveToSubscript:$0},{target:"model",changeSelection:!0}),Oo({moveToNextPlaceholder:a=>zh(a,"forward"),moveToPreviousPlaceholder:a=>zh(a,"backward")},{target:"model",changeSelection:!0,audioFeedback:"return"});function F0(a,y,b,E){if(E==="forward"){let re=y.rightSibling;for(;re&&!b(re);)re=re.rightSibling;return re}let ee=y.leftSibling;for(;ee&&!b(ee);)ee=ee.leftSibling;return ee}function Kh(a,y,b){typeof y=="function"&&(b=y,y=1/0),y===void 0&&(y=1/0);let E=a.position,ee=!1,re="";for(;!ee;){const ae=a.at(E);ee=y===0||ae===void 0||ae.type==="first"||ae.mode!=="math"||!(ae.type&&/mord|mpunct|operator/.test(ae.type)||ae.type==="mop"&&/[a-zA-Z ]+/.test(ae.value))||!ae.hasEmptyBranch("superscript")||!ae.hasEmptyBranch("subscript")||typeof b=="function"&&!b(ae),ee||(ae.mode="text",ae.command=ae.value,ae.verbatimLatex=void 0,re+=ae.value),E-=1,y-=1}a.contentDidChange({data:re,inputType:"insertText"})}function xc(a,y,b){typeof y=="function"&&(b=y,y=1/0),y===void 0&&(y=1/0);let E=a.position,ee=!1;const re=[];for(;!ee;){const ae=a.at(E);ee=y===0||!ae||ae.type==="first"||ae.isFirstSibling||ae.mode!=="text"||ae.value===" "||typeof b=="function"&&!b(ae),ee||(re.push(Dn.serialize([ae],{defaultMode:"math"})),ae.mode="math"),E-=1,y-=1}Df(a),a.contentDidChange({data:Si(re),inputType:"insertText"})}function Df(a){var y;let b=a.position-1;for(;b>=0&&((y=a.at(b))==null?void 0:y.mode)==="math";)b-=1;if(!(b<0)&&a.at(b).mode==="text"&&a.at(b).value===" "&&a.at(b-1).mode==="math"){a.at(b-1).parent.removeChild(a.at(b-1));const E=a.silenceNotifications;a.silenceNotifications=!0,a.position-=1,a.silenceNotifications=E,a.contentDidChange({inputType:"deleteContent"})}}function Zg(a){let y="",b=a.position,E=!1;for(;!E;){const ee=a.at(b);E=!(ee&&(ee.mode==="text"||ee.mode==="math"&&ee.type&&/mord|mpunct/.test(ee.type))),E||(y=ee.value+y),b-=1}return y}function jg(a,y,b){const{model:E}=a;if(E.mode==="latex"||!E.at(E.position).isLastSibling||!b||!wh(b))return!1;const ee=lu(b);if(!E.selectionIsCollapsed)return!!(a.model.mode==="text"&&/[/_^]/.test(ee));const re=Zg(E)+ee;if(a.model.mode==="text"){if(y==="Esc"||/[/\\]/.test(ee))return!0;if(/[\^_]/.test(ee))return/(^|\s)[a-zA-Z][^_]$/.test(re)&&xc(E,1),!0;const ae={")":"(","}":"{","]":"["}[ee],{parent:ue}=E.at(E.position);if(ae&&ue instanceof Ri&&ue.leftDelim===ae)return!0;if(/(^|[^a-zA-Z])(a|I) $/.test(re))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(ee))return!0;if(/(^|[^a-zA-Z'])[a-zA-Z] $/.test(re))return xc(E,1),!1;if(/\D\.[^\d\s]$/.test(re)){xc(E,1);const he=E.at(E.position);return he.value="\u22C5",he.style.variant="normal",he.command="\\cdot",he.verbatimLatex=void 0,E.contentDidChange({data:"\\cdot",inputType:"insertText"}),!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(re)||/\.\d$/.test(re)||/\([\d+\-.]$/.test(re))return xc(E,1),!0;if(/\([a-z][,;]$/.test(re))return xc(E,2),!0;if(/[\d+\-=><*|]$/.test(ee))return Df(E),!0}else{if(y==="[Space]")return Kh(E,void 0,ae=>/[a-z][:,;.]$/.test(ae.value)),!0;if(/[a-zA-Z]{3,}$/.test(re)&&!/(dxd|abc|xyz|uvw)$/.test(re))return Kh(E,void 0,ae=>/[a-zA-Z]/.test(ae.value)),!0;if(/(^|\W)(if)$/i.test(re))return Kh(E,1),!0;if(/(\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5){3,}$/u.test(re)&&!/(αβγ)$/.test(re))return Kh(E,void 0,ae=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5)/u.test(ae.value)),!0;if(ee==="?"||ee==="."&&!/[\d-+]\.$/.test(re))return!0}return!1}function Vg(a,y){if(!a.isSelectionEditable||!a.keystrokeCaptionVisible)return;const b=z0(),E=a.element.getBoundingClientRect();b.style.left=`${E.left}px`,b.style.top=`${E.top-64}px`,b.innerHTML=window.MathfieldElement.createHTML("<span>"+(vf(y)||y)+"</span>"+b.innerHTML),b.style.visibility="visible",setTimeout(()=>{b.childNodes.length>0&&b.childNodes[b.childNodes.length-1].remove(),b.childNodes.length===0&&(b.style.visibility="hidden")},3e3)}function Ug(a){if(a.keystrokeCaptionVisible=!a.keystrokeCaptionVisible,a.keystrokeCaptionVisible){const y=z0();y.innerHTML=""}else{const y=Mh("mathlive-keystroke-caption-panel");y.style.visibility="hidden"}return!1}function z0(){const a=document.getElementById("mathlive-keystroke-caption-panel");return a||(Bo("keystroke-caption"),Bo("core"),Mh("mathlive-keystroke-caption-panel"))}function Gg(){document.getElementById("mathlive-keystroke-caption-panel")&&(bf("mathlive-keystroke-caption-panel"),x("core"),x("keystroke-caption"))}function K0(a,y){var b,E,ee;const{model:re}=a,ae=p0(y);if(y.isTrusted){Nm(y);const lt=vd();a.keyboardLayout!==lt.id&&(a.keyboardLayout=lt.id,a._keybindings=void 0)}if(clearTimeout(a.inlineShortcutBufferFlushTimer),a.inlineShortcutBufferFlushTimer=0,Vg(a,ae),y.isTrusted&&y.defaultPrevented)return a.flushInlineShortcutBuffer(),!1;let ue,he="",ge;const be=a.inlineShortcutBuffer;if(a.isSelectionEditable){if(re.mode==="math")if(ae==="[Backspace]")be.pop();else if(!wh(y))a.flushInlineShortcutBuffer();else{const lt=lu(y),xt=[...(E=(b=be[be.length-1])==null?void 0:b.keystrokes)!=null?E:[],lt];be.push({state:re.getState(),keystrokes:xt,leftSiblings:Xg(a)});let vn=0,nr="";for(;!ue&&vn<xt.length;)ge=be.length-(xt.length-vn),nr=xt.slice(vn).join(""),ue=td(be[ge].leftSiblings,nr,a.options.inlineShortcuts),!ue&&/^[a-zA-Z][a-zA-Z0-9]+?([_\^][a-zA-Z0-9\*\+\-]+?)?$/.test(nr)&&(ue=a.options.onInlineShortcut(a,nr)),vn+=1;a.flushInlineShortcutBuffer({defer:!0})}a.options.smartMode&&(ue?a.switchMode("math"):jg(a,ae,y)&&(a.switchMode({math:"text",text:"math"}[re.mode]),he=""))}if(!ue){if(he||(he=Zm(a.keybindings,re.mode,y)),!he&&(ae==="[Enter]"||ae==="[Return]")){let lt=!1;return re.contentWillChange({inputType:"insertLineBreak"})&&(a.host&&(lt=!a.host.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),lt||y.preventDefault&&(y.preventDefault(),y.stopPropagation()),re.contentDidChange({inputType:"insertLineBreak"})),lt}if((!he||ae==="[Space]")&&re.mode==="math"){if(ae==="[Space]"){if(a.adoptStyle="none",a.flushInlineShortcutBuffer(),a.options.mathModeSpace)return si.insert(re,a.options.mathModeSpace,{format:"latex",mode:"math"}),a.snapshot("insert-space"),he="",a.dirty=!0,a.scrollIntoView(),y.preventDefault&&(y.preventDefault(),y.stopPropagation()),!1;const lt=re.at(re.position+1),xt=re.at(re.position-1);if((lt==null?void 0:lt.mode)==="text"||(xt==null?void 0:xt.mode)==="text")return si.insert(re," ",{mode:"text"}),a.snapshot("insert-space"),a.dirty=!0,a.scrollIntoView(),!1}(ee=re.at(re.position))!=null&&ee.isDigit()&&window.MathfieldElement.decimalSeparator===","&&lu(y)===","&&(he="insertDecimalSeparator")}}if(!ue&&!he){if(re.mathfield.smartFence){if(Tf(re,lu(y),a.effectiveStyle))return a.dirty=!0,a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1}else{const{parent:lt}=re.at(re.position);if(lt instanceof Ri&&lt.rightDelim==="?"&&re.at(re.position).isLastSibling&&/^[)}\]|]$/.test(ae))return a.snapshot(),lt.isDirty=!0,lt.rightDelim=ae,re.position+=1,re.selectionDidChange(),re.contentDidChange({data:lu(y),inputType:"insertText"}),a.snapshot("insert-fence"),a.dirty=!0,a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1;if(!re.selectionIsCollapsed){const xt=lu(y);if(xt==="("||xt==="{"||xt==="["){const vn={"(":"(","{":"\\lbrace","[":"\\lbrack"}[xt],nr={"(":")","{":"\\rbrace","[":"\\rbrack"}[xt],[fn,Rn]=Wa(re.selection);return a.snapshot(),re.position=Rn,si.insert(re,nr,{format:"latex"}),re.position=fn,si.insert(re,vn,{format:"latex"}),re.setSelection(fn+1,Rn+1),re.contentDidChange({data:xt,inputType:"insertText"}),a.snapshot("insert-fence"),a.dirty=!0,a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1}}}return!0}const Be=re.at(Math.max(re.position,re.anchor)),{parent:He}=Be;if(he==="moveAfterParent"&&(He==null?void 0:He.type)==="leftright"&&Be.isLastSibling&&a.options.smartFence&&Tf(re,".",a.defaultStyle)&&(he="",va(a)),a.keyboardDelegate.cancelComposition(),he)a.executeCommand(he);else if(ue){const lt=a.effectiveStyle;re.setState(be[ge].state);const xt=be[be.length-1].keystrokes;for(const vn of xt)si.insert(re,vn,{silenceNotifications:!0,style:lt});a.snapshot("insert-shortcut"),re.setState(be[ge].state),re.deferNotifications({content:!0,selection:!0,data:ue,type:"insertText"},()=>(si.insert(re,ue,{format:"latex",style:lt}),Df(a.model),ue.endsWith(" ")&&(a.switchMode("text"),si.insert(re," ",{style:lt,mode:"text"})),a.snapshot(),re.selectionIsCollapsed||a.flushInlineShortcutBuffer(),!0)),a.dirty=!0,re.announce("replacement")}return a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1}function Af(a,y,b){const{model:E}=a;if(!a.isSelectionEditable){E.announce("plonk");return}b!=null||(b={}),b.focus&&a.focus(),b.feedback&&window.MathfieldElement.playSound("keypress"),typeof b.mode=="string"&&(a.switchMode(b.mode),a.snapshot());let ee=rh(y);const re=window.mathVirtualKeyboard;if(re!=null&&re.isShifted&&(ee=typeof ee=="string"?ee.toUpperCase():ee.map(he=>he.toUpperCase())),b.simulateKeystroke){let he=!0;for(const ge of ee)K0(a,new KeyboardEvent("keypress",{key:ge}))&&(he=!1);if(he)return}const ae=E.at(E.position),ue=Ce(Ce({},ae.computedStyle),a.defaultStyle);if(E.selectionIsCollapsed||(E.deleteAtoms(Wa(E.selection)),a.snapshot("delete")),E.mode==="latex")E.deferNotifications({content:!0,selection:!0,data:y,type:"insertText"},()=>{Ch(a);for(const he of ee)si.insert(E,he);a.snapshot("insert-latex"),bd(a)});else if(E.mode==="text"){for(const he of ee)si.insert(E,he,{style:ue});a.snapshot("insert-text")}else if(E.mode==="math")for(const he of ee)Yg(a,he,ue,ae);a.dirty=!0,a.scrollIntoView()}function Xg(a){const y=a.model,b=[];let E=y.at(Math.min(y.position,y.anchor));for(;E.type!=="first";)b.push(E),E=E.leftSibling;return b}function Yg(a,y,b,E){const ee=a.model;let re={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[y];if(y===" "&&a.options.mathModeSpace&&(re=["insert",a.options.mathModeSpace]),re){a.executeCommand(re);return}if(/\d/.test(y)&&a.options.smartSuperscript&&E.parentBranch==="superscript"&&E.parent.type!=="mop"&&E.parent.type!=="operator"&&E.parent.type!=="extensible-symbol"&&E.hasNoSiblings){qg(ee),si.insert(ee,y,{style:b}),a.snapshot(),R0(ee),a.snapshot();return}if(/[a-zA-Z0-9]/.test(y)&&a.adoptStyle!=="none"){const ae=a.adoptStyle==="left"?E:E.parent?E.rightSibling:null;(ae==null?void 0:ae.type)==="mord"&&/[a-zA-Z0-9]/.test(ae.value)&&(b=Ce({},b),ae.style.variant&&(b.variant=ae.style.variant),ae.style.variantStyle&&(b.variantStyle=ae.style.variantStyle))}si.insert(ee,y,{style:b}),a.snapshot(`insert-${ee.at(ee.position).type}`)}function qg(a){a.selectionIsCollapsed||(a.deleteAtoms(Wa(a.selection)),a.mathfield.snapshot("delete"))}function Tf(a,y,b){if(!y||a.mode!=="math")return!1;const E=a.at(a.position),{parent:ee}=E,re={"(":"(",")":")","{":"\\lbrace","}":"\\rbrace","[":"\\lbrack","]":"\\rbrack","|":"|"}[y];if(!re)return!1;const ae=te[re],ue=ne[re];if(!a.selectionIsCollapsed){a.mathfield.snapshot();const[he,ge]=Wa(a.selection),be=a.extractAtoms([he,ge]),Be=ee.addChildrenAfter([new Ri("left...right",be,{leftDelim:re,rightDelim:ue})],a.at(he));return a.setSelection(a.offsetOf(Be.firstChild),a.offsetOf(Be.lastChild)),a.mathfield.snapshot("insert-fence"),a.contentDidChange({data:re,inputType:"insertText"}),!0}if(re==="|"){const he=ee instanceof Ri?ee.leftDelim+ee.rightDelim:"";if(he==="\\lbrace\\rbrace"||he==="\\{\\}"||he==="\\lbrace?")return a.mathfield.snapshot(),si.insert(a,"\\,\\middle\\vert\\,",{format:"latex",style:b}),a.mathfield.snapshot("insert-fence"),a.contentDidChange({data:re,inputType:"insertText"}),!0}if(ue){if(ee instanceof Ri&&ee.firstChild===E&&(ee.leftDelim==="?"||ee.leftDelim==="."))return ee.leftDelim=re,ee.isDirty=!0,a.mathfield.snapshot(),a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0;if(!(ee instanceof Ri)){let Be=E;for(;Be&&!(Be.type==="mclose"&&Be.value===ue);)Be=Be.rightSibling;if(Be){a.mathfield.snapshot();const He=a.extractAtoms([a.offsetOf(E),a.offsetOf(Be)]);return He.pop(),ee.addChildrenAfter([new Ri("left...right",He,{leftDelim:re,rightDelim:ue})],E),a.position=a.offsetOf(ee.firstChild)+1,a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}}const he=a.offsetOf(E.lastSibling);let ge;for(ge=a.position;ge<=he;ge++){const Be=a.at(ge);if(Be instanceof Ri&&(Be.leftDelim==="?"||Be.leftDelim===".")&&H0(re,Be.rightDelim))break}const be=a.at(ge);if(ge<=he&&be instanceof Ri){be.leftDelim=re,a.mathfield.snapshot();let Be=a.extractAtoms([a.position,ge-1]);return Be=Be.filter(He=>He.type!=="first"),be.addChildren(Be,be.parentBranch),a.position+=1,a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}if(ee instanceof Ri&&(ee.leftDelim==="?"||ee.leftDelim===".")&&H0(re,ee.rightDelim)){ee.isDirty=!0,ee.leftDelim=re,a.mathfield.snapshot();const Be=a.extractAtoms([a.offsetOf(E.firstSibling),a.position]);for(const He of Be)ee.parent.addChildBefore(He,ee);return a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}if(!(ee instanceof Ri&&ee.leftDelim==="|")){if(a.mathfield.snapshot(),si.insert(a,`\\left${re}\\right?`,{format:"latex",style:b}),E.lastSibling.type!=="first"){const Be=a.offsetOf(E.lastSibling),He=a.extractAtoms([a.position,Be]);a.at(a.position).body=He,a.position-=1}return a.mathfield.snapshot("insert-fence"),!0}}if(ae){let he=E;for(;he;){if(he.type==="mopen"&&he.value===ae){a.mathfield.snapshot();const lt=he.leftSibling,xt=a.extractAtoms([a.offsetOf(he.leftSibling),a.offsetOf(E)]);xt.shift();const vn=new Ri("left...right",xt,{leftDelim:ae,rightDelim:re});return ee.addChildrenAfter([vn],lt),a.position=a.offsetOf(vn),a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}he=he.leftSibling}if(ee instanceof Ri&&E.isLastSibling&&Pf(ee.leftDelim,re))return a.mathfield.snapshot(),ee.isDirty=!0,ee.rightDelim=re,a.position+=1,a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0;const ge=a.offsetOf(E.firstSibling);let be;for(be=a.position;be>=ge;be--){const lt=a.at(be);if(lt instanceof Ri&&(lt.rightDelim==="?"||lt.rightDelim===".")&&Pf(lt.leftDelim,re))break}const Be=a.at(be);if(be>=ge&&Be instanceof Ri)return a.mathfield.snapshot(),Be.rightDelim=re,Be.addChildren(a.extractAtoms([be,a.position]),Be.parentBranch),a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0;if(ee instanceof Ri&&(ee.rightDelim==="?"||ee.rightDelim===".")&&Pf(ee.leftDelim,re))return a.mathfield.snapshot(),ee.isDirty=!0,ee.rightDelim=re,ee.parent.addChildren(a.extractAtoms([a.position,a.offsetOf(E.lastSibling)]),ee.parentBranch),a.position=a.offsetOf(ee),a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0;const He=ee.parent;return He instanceof Ri&&(He.rightDelim==="?"||He.rightDelim===".")&&a.at(a.position).isLastSibling?(a.position=a.offsetOf(He),Tf(a,re,b)):!1}return!1}function Pf(a,y){return a?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(a)?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(y):ne[a]===y:!0}function H0(a,y){return y?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(y)?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(a):te[y]===a:!0}Oo({undo:a=>(a.undo(),!0),redo:a=>(a.redo(),!0),scrollIntoView:a=>(a.scrollIntoView(),!0),scrollToStart:a=>(a.field.scroll(0,0),!0),scrollToEnd:a=>{const y=a.field.getBoundingClientRect();return a.field.scroll(y.left-window.scrollX,0),!0},toggleKeystrokeCaption:Ug,toggleContextMenu:a=>{const y=a.toggleContextMenu();return y||a.model.announce("plonk"),y},plonk:a=>(a.model.announce("plonk"),!0),switchMode:(a,y,b,E)=>(a.switchMode(y,b,E),!0),insert:(a,y,b)=>a.insert(y,b),typedText:(a,y,b)=>(Af(a,y,b),!0),insertDecimalSeparator:a=>{const y=a.model;return y.mode==="math"&&window.MathfieldElement.decimalSeparator===","&&y.at(Math.max(y.position,y.anchor)).isDigit()?(a.insert("{,}",{format:"latex"}),a.snapshot("insert-mord"),!0):(a.insert("."),!0)},commit:a=>{var y;return a.model.contentWillChange({inputType:"insertLineBreak"})&&((y=a.host)==null||y.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),a.model.contentDidChange({inputType:"insertLineBreak"})),!0},insertPrompt:(a,y,b)=>{const E=a.getPrompts();let ee="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),re=0;for(;E.includes(ee)&&re<100;){if(re===99)return console.error("could not find a unique ID after 100 tries"),!1;ee="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),re++}return a.insert(`\\placeholder[${y!=null?y:ee}]{}`,b),!0}}),Oo({copyToClipboard:a=>(a.focus(),a.model.selectionIsCollapsed&&a.select(),"queryCommandSupported"in document&&document.queryCommandSupported("copy")?document.execCommand("copy"):a.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("copy",{bubbles:!0,composed:!0})),!1)},{target:"mathfield"}),Oo({cutToClipboard:a=>(a.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("cut")?document.execCommand("cut"):a.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("cut",{bubbles:!0,composed:!0})),!0),pasteFromClipboard:a=>(a.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("paste")?(document.execCommand("paste"),!0):(navigator.clipboard.readText().then(y=>{y&&a.model.contentWillChange({inputType:"insertFromPaste",data:y})?(a.stopCoalescingUndo(),a.stopRecording(),a.insert(y,{mode:a.model.mode})&&(bd(a),a.startRecording(),a.snapshot("paste"),a.model.contentDidChange({inputType:"insertFromPaste"}),va(a))):a.model.announce("plonk"),a.startRecording()}),!0))},{target:"mathfield",canUndo:!0,changeContent:!0,changeSelection:!0});function Jg(a,y){a.flushInlineShortcutBuffer(),a.stopCoalescingUndo();const b=If(a,y),{model:E}=a;return E.selectionIsCollapsed?(a.defaultStyle.fontSeries&&b.fontSeries===a.defaultStyle.fontSeries&&(b.fontSeries="auto"),b.fontShape&&b.fontShape===a.defaultStyle.fontShape&&(b.fontShape="auto"),b.color&&b.color===a.defaultStyle.color&&(b.color="none"),b.backgroundColor&&b.backgroundColor===a.defaultStyle.backgroundColor&&(b.backgroundColor="none"),b.fontSize&&b.fontSize===a.defaultStyle.fontSize&&(b.fontSize="auto"),a.defaultStyle=Ce(Ce({},a.defaultStyle),b)):a.model.deferNotifications({content:!0,type:"insertText"},()=>{E.selection.ranges.forEach(ee=>_f(E,ee,b,{operation:"toggle"})),a.snapshot("style-change")}),!0}Oo({applyStyle:Jg},{target:"mathfield",canUndo:!0,changeContent:!0});function If(a,y){var b,E,ee,re,ae,ue,he,ge,be,Be;const He={};if(typeof y.color=="string"){const xt=(E=a.colorMap((b=y.color)!=null?b:y.verbatimColor))!=null?E:"none";xt!==y.color&&(He.verbatimColor=(ee=y.verbatimColor)!=null?ee:y.color),He.color=xt}if(typeof y.backgroundColor=="string"){const xt=(ae=a.backgroundColorMap((re=y.backgroundColor)!=null?re:y.verbatimBackgroundColor))!=null?ae:"none";xt!==y.backgroundColor&&(He.verbatimBackgroundColor=(ue=y.verbatimBackgroundColor)!=null?ue:y.backgroundColor),He.backgroundColor=xt}typeof y.fontFamily=="string"&&(He.fontFamily=y.fontFamily),typeof y.series=="string"&&(He.fontSeries=y.series),typeof y.fontSeries=="string"&&(He.fontSeries=y.fontSeries.toLowerCase()),He.fontSeries&&(He.fontSeries=(he={bold:"b",medium:"m",normal:"m"}[He.fontSeries])!=null?he:He.fontSeries),typeof y.shape=="string"&&(He.fontShape=y.shape),typeof y.fontShape=="string"&&(He.fontShape=y.fontShape.toLowerCase()),He.fontShape&&(He.fontShape=(ge={italic:"it",up:"n",upright:"n",normal:"n"}[He.fontShape])!=null?ge:He.fontShape),y.variant&&(He.variant=y.variant.toLowerCase()),y.variantStyle&&(He.variantStyle=y.variantStyle.toLowerCase());const lt=(be=y.size)!=null?be:y.fontSize;return typeof lt=="number"?He.fontSize=Math.max(1,Math.min(10,lt)):typeof lt=="string"&&(He.fontSize=(Be={size1:1,size2:2,size3:3,size4:4,size5:5,size6:6,size7:7,size8:8,size9:9,size10:10}[lt.toLowerCase()])!=null?Be:{tiny:1,scriptsize:2,footnotesize:3,small:4,normal:5,normalsize:5,large:6,Large:7,LARGE:8,huge:9,Huge:10}[lt]),He}function Bf(a){let[y,b]=Wa(a.selection);if(y=W0(a,y,"backward"),b=W0(a,b,"forward"),y===b){const E=a.at(y);if(E.type==="leftright")return a.setSelection(a.offsetOf(E.firstChild)-1,b);if(E.type==="first"&&(E.parent.type==="leftright"||E.parent.type==="surd"))return a.setSelection(y-1,a.offsetOf(E.parent.lastChild)+1);a.setSelection(y-1,b)}else a.setSelection(y,b);return!0}function W0(a,y,b){var E,ee,re;let ae=a.at(y);if(!ae)return y;const ue=b==="forward"?1:-1;if(ae.mode==="text"){for(;ae&&!(ae.mode!=="text"||!ye.test(ae.value));)y+=ue,ae=a.at(y);return b==="backward"?y-1:y}if(ae.mode==="latex"){if(/[a-zA-Z\*]/.test(ae.value))if(b==="backward")for(;ae&&ae.mode==="latex"&&ae.value!=="\\"&&/[a-zA-Z]/.test(ae.value);)y+=ue,ae=a.at(y);else for(;ae&&ae.mode==="latex"&&/[a-zA-Z\*]/.test(ae.value);)y+=ue,ae=a.at(y);else if(ae.value==="{"){if(b==="forward"){for(;ae&&ae.mode==="latex"&&ae.value!=="}";)y+=ue,ae=a.at(y);return y}return y-1}else if(ae.value==="}"){if(b==="backward"){for(;ae&&ae.mode==="latex"&&ae.value!=="{";)y+=ue,ae=a.at(y);return y-1}return y}return y-1}if(ae.mode==="math"){if(ae.isDigit()){for(;(E=a.at(y+ue))!=null&&E.isDigit();)y+=ue;return b==="backward"?y-1:y}if(ae.style.variant||ae.style.variantStyle){let he=(ee=a.at(y))==null?void 0:ee.style;for(;he&&he.variant===ae.style.variant&&he.variantStyle===ae.style.variantStyle;)he=(re=a.at(y+ue))==null?void 0:re.style,y+=ue;return b==="backward"?y-1:y}return y}return y}Oo({selectGroup:a=>{const y=Bf(a);return y||a.announce("plonk"),y},selectAll:a=>a.setSelection(0,a.lastOffset),extendSelectionForward:a=>Ks(a,"forward",{extend:!0}),extendSelectionBackward:a=>Ks(a,"backward",{extend:!0}),extendToNextWord:a=>pu(a,"forward",{extend:!0}),extendToPreviousWord:a=>pu(a,"backward",{extend:!0}),extendSelectionUpward:a=>Ks(a,"upward",{extend:!0}),extendSelectionDownward:a=>Ks(a,"downward",{extend:!0}),extendToNextBoundary:a=>pu(a,"forward",{extend:!0}),extendToPreviousBoundary:a=>pu(a,"backward",{extend:!0}),extendToGroupStart:a=>{const y=a.setSelection(a.anchor,a.offsetOf(a.at(a.position).firstSibling));return y||a.announce("plonk"),y},extendToGroupEnd:a=>{const y=a.setSelection(a.anchor,a.offsetOf(a.at(a.position).lastSibling));return y||a.announce("plonk"),y},extendToMathFieldStart:a=>{const y=a.setSelection(a.anchor,0);return y||a.announce("plonk"),y},extendToMathFieldEnd:a=>{const y=a.setSelection(a.anchor,a.lastOffset);return y||a.announce("plonk"),y}},{target:"model",changeSelection:!0});var wc=null,_d=0,Hh=class es{static start(y,b,E,ee){var re;es.element=y,(re=es.controller)==null||re.abort(),es.controller=new AbortController;const ae={signal:es.controller.signal};"PointerEvent"in window?(y.addEventListener("pointermove",E,ae),y.addEventListener("pointerup",ee,ae),y.addEventListener("pointercancel",ee,ae),Of(b)&&(es.pointerId=b.pointerId,y.setPointerCapture(b.pointerId))):(window.addEventListener("mousemove",E,ae),window.addEventListener("blur",ee,ae),window.addEventListener("mouseup",ee,ae))}static stop(){var y;(y=es.controller)==null||y.abort(),es.controller=void 0,typeof es.pointerId=="number"&&(es.element.releasePointerCapture(es.pointerId),es.pointerId=void 0)}};function Of(a){return a!==null&&globalThis.PointerEvent!==void 0&&a instanceof PointerEvent}function Z0(a,y){var b;if(y.buttons>1)return;a.atomBoundsCache=new Map;const E=a;let ee,re=!1,ae=!1,ue="none",he=!1,ge=!1;const be=y.clientX,Be=y.clientY,He=Date.now(),lt=E.field,xt=setInterval(()=>{he?lt.scroll({top:0,left:lt.scrollLeft-16}):ge&&lt.scroll({top:0,left:lt.scrollLeft+16})},32);function vn(){Hh.stop(),re=!1,clearInterval(xt),a.element.classList.remove("tracking"),y&&y.preventDefault()}function nr(Rn){if(!E.hasFocus()){vn();return}const cr=Rn.clientX,Fn=Rn.clientY,Hr=Of(Rn)&&Rn.pointerType==="touch"?20:5;if(Date.now()<He+500&&Math.abs(be-cr)<Hr&&Math.abs(Be-Fn)<Hr){Rn.preventDefault(),Rn.stopPropagation();return}const Jr=lt.getBoundingClientRect();ge=cr>Jr.right,he=cr<Jr.left;let jr=ee;Of(Rn)&&(Rn.isPrimary||(jr=kd(E,Rn.clientX,Rn.clientY,{bias:0})));const Ti=kd(E,cr,Fn,{bias:cr<=be?cr===be?0:-1:1});jr>=0&&Ti>=0&&(E.model.extendSelectionTo(jr,Ti),va(a)),ae&&Bf(E.model)}wc&&Math.abs(wc.x-be)<5&&Math.abs(wc.y-Be)<5&&Date.now()<wc.time+500?(_d+=1,wc.time=He):(wc={x:be,y:Be,time:He},_d=1);const fn=lt.getBoundingClientRect();if(be>=fn.left&&be<=fn.right&&Be>=fn.top&&Be<=fn.bottom){if(a.flushInlineShortcutBuffer(),a.adoptStyle="left",ee=kd(a,be,Be,{bias:0}),ee>=0){if(a.element.classList.add("tracking"),y.shiftKey){const Rn=a.model.selectionIsCollapsed;a.model.extendSelectionTo(a.model.anchor,ee),v0(a.model)||Rn?ue="all":ue="selection"}else a.model.at(ee).type==="placeholder"?(a.model.setSelection(ee-1,ee),ue="selection"):((b=a.model.at(ee).rightSibling)==null?void 0:b.type)==="placeholder"?(a.model.setSelection(ee,ee+1),ue="selection"):(a.model.position=ee,v0(a.model)?ue="all":ue="selection");a.defaultStyle={},y.detail===3||_d>2?(vn(),(y.detail===3||_d===3)&&(a.model.selection={ranges:[[0,a.model.lastOffset]]},ue="all")):re||(re=!0,Hh.start(lt,y,nr,vn),(y.detail===2||_d===2)&&(ae=!0,Bf(a.model),ue="all"))}a.hasFocus()||(ue="none",a.focus({preventScroll:!0}))}else wc=null;a.stopCoalescingUndo(),ue!=="none"&&(a.model.selectionIsCollapsed&&(ue="all"),va(a)),y.preventDefault()}function Qg(a,y,b){if(a>=b.left&&a<=b.right&&y>=b.top&&y<=b.bottom)return 0;const E=a-(b.left+b.right)/2,ee=y-(b.top+b.bottom)/2;return E*E+ee*ee}function j0(a,y,b,E,ee){if(!b.id)return[1/0,null];if(y.has(b.id))return y.get(b.id);const re=Pl(a,b);if(!re)return[1/0,null];let ae=[1/0,null];if(b.hasChildren&&!b.captureSelection&&E>=re.left&&E<=re.right)for(const ue of b.children){const he=j0(a,y,ue,E,ee);he[0]<=ae[0]&&(ae=he)}return ae[1]||(ae=[Qg(E,ee,re),b]),y.set(b.id,ae),ae}function ev(a,y,b){const[,E]=j0(a,new Map,a.model.root,y,b);return E}function kd(a,y,b,E){var ee;const re=a.field.querySelector(".ML__latex").getBoundingClientRect();if(!re)return 0;if(y>re.right||b>re.bottom+8)return a.model.lastOffset;if(y<re.left||b<re.top-8)return 0;E=E!=null?E:{},E.bias=(ee=E.bias)!=null?ee:0;let ae=ev(a,y,b);const ue=[];let he=ae;for(;he;)ue.unshift(he),he=he.parent;for(const be of ue)if(be.captureSelection){ae=be;break}let ge=a.model.offsetOf(ae);if(ge<0)return-1;if(ae.leftSibling)if(E.bias===0&&ae.type!=="placeholder"){const be=Pl(a,ae);be&&y<(be.left+be.right)/2&&(ge=a.model.offsetOf(ae.leftSibling))}else E.bias<0&&(ge=a.model.offsetOf(ae.leftSibling));return ge}var tv=class extends si{constructor(){super("math")}onPaste(a,y){if(!y||!a.model.contentWillChange({data:typeof y=="string"?y:null,dataTransfer:typeof y=="string"?null:y,inputType:"insertFromPaste"}))return!1;let b="",E="auto",ee=typeof y!="string"?y.getData("application/json+mathlive"):"";if(ee)try{const re=JSON.parse(ee);if(re&&Array.isArray(re)){a.snapshot();const ae=Ol(re),{model:ue}=a;ue.selectionIsCollapsed||ue.deleteAtoms(Wa(ue.selection));const he=ue.at(ue.position);if(he.parent instanceof hi){console.assert(he.parentBranch!==void 0);const ge=[];let be=[];ae[0].type==="first"&&ae.shift(),ae[ae.length-1].type==="first"&&ae.pop();for(const xt of ae)xt.type==="first"&&be.length>0?(ge.push(be),be=[xt]):be.push(xt);be.length>0&&ge.push(be);let Be=Number(he.parentBranch[0]),He=Number(he.parentBranch[1]);const lt=he.parent.maxColumns;for(;he.parent.colCount-He<ge.length&&he.parent.colCount<lt;)he.parent.addColumn();he.parent.addChildrenAfter(ge[0],he);for(let xt=1;xt<ge.length;xt++)He++,He>=lt&&(He=0,he.parent.addRowAfter(Be),Be++),he.parent.setCell(Be,He,ge[xt])}else he.parent.addChildrenAfter(ae.filter(ge=>ge.type!=="first"),he);return ue.position=ue.offsetOf(ae[ae.length-1]),ue.contentDidChange({inputType:"insertFromPaste"}),va(a),!0}}catch(re){}if(ee=typeof y!="string"?y.getData("application/json"):"",ee&&window.MathfieldElement.computeEngine)try{const re=JSON.parse(ee);if(typeof re=="object"&&"latex"in re&&re.latex&&(b=re.latex),!b){const ae=window.MathfieldElement.computeEngine.box(re);ae&&!ae.has("Error")&&(b=ae.latex)}b||(E="latex")}catch(re){}if(!b&&typeof y!="string"&&(b=y.getData("application/x-latex"),b&&(E="latex")),b||(b=typeof y=="string"?y:y.getData("text/plain")),b){let re;return[re,b]=Rs(b),E==="auto"&&re&&(E="latex"),a.stopCoalescingUndo(),a.stopRecording(),this.insert(a.model,b,{format:E})&&(a.startRecording(),a.snapshot("paste"),va(a)),a.startRecording(),!0}return!1}insert(a,y,b){var E,ee;const re=typeof y=="string"?y:(ee=(E=window.MathfieldElement.computeEngine)==null?void 0:E.box(y).latex)!=null?ee:"";if(!b.silenceNotifications&&!a.contentWillChange({data:re,inputType:"insertText"}))return!1;b.insertionMode||(b.insertionMode="replaceSelection"),b.selectionMode||(b.selectionMode="placeholder"),b.format||(b.format="auto");const{silenceNotifications:ae}=a;b.silenceNotifications&&(a.silenceNotifications=!0);const ue=a.silenceNotifications;a.silenceNotifications=!0;const he={"?":"\\placeholder{}","@":"\\placeholder{}"};he[0]=b.insertionMode==="replaceAll"?"":a.getValue(a.selection,"latex-unstyled"),b.insertionMode==="replaceSelection"&&!a.selectionIsCollapsed?a.deleteAtoms(Wa(a.selection)):b.insertionMode==="replaceAll"?(a.root.setChildren([],"body"),a.position=0):b.insertionMode==="insertBefore"?a.collapseSelection("backward"):b.insertionMode==="insertAfter"&&a.collapseSelection("forward"),!a.at(a.position).isLastSibling&&a.at(a.position+1).type==="placeholder"?a.deleteAtoms([a.position,a.position+1]):a.at(a.position).type==="placeholder"&&a.deleteAtoms([a.position-1,a.position]);let ge=-1;he[0]?he["@"]=he[0]:typeof y=="string"&&/(^|[^\\])#@/.test(y)&&(ge=rv(a),ge>=0&&(he["@"]=a.getValue(ge,a.position,"latex"))),he[0]||(he[0]=he["?"]);let be=!1;const Be=cr=>(be=!0,he[cr]);let[He,lt]=V0(a,y,Be,b);if(!lt)return!1;const xt=lt.length===1&&lt[0].type==="genfrac";xt&&ge>=0&&typeof a.mathfield.options.isImplicitFunction=="function"&&a.mathfield.options.isImplicitFunction(a.at(a.position).command)?(he["@"]=he["?"],be=!1,[He,lt]=V0(a,y,Be,b)):ge>=0&&a.deleteAtoms([ge,a.position]);const{parent:vn}=a.at(a.position),nr=vn.hasEmptyBranch("body");if(xt&&He!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&vn instanceof Ri&&vn.leftDelim==="("&&nr){const cr=vn.parent,Fn=vn.parentBranch;cr.removeChild(vn),cr.setChildren(lt,Fn)}const fn=a.at(a.position);fn.parent.addChildrenAfter(lt,fn),He==="latex"&&typeof y=="string"&&(vn==null?void 0:vn.type)==="root"&&nr&&!be&&(vn.verbatimLatex=y),a.silenceNotifications=ue;const Rn=lt[lt.length-1];if(b.selectionMode==="placeholder"){const cr=lt.flatMap(Fn=>[Fn,...Fn.children]).find(Fn=>Fn.type==="placeholder");if(cr){const Fn=a.offsetOf(cr);a.setSelection(Fn-1,Fn),a.announce("move")}else Rn&&(a.position=a.offsetOf(Rn))}else b.selectionMode==="before"||(b.selectionMode==="after"?Rn&&(a.position=a.offsetOf(Rn)):b.selectionMode==="item"&&a.setSelection(a.anchor,a.offsetOf(Rn)));return a.contentDidChange({data:re,inputType:"insertText"}),a.silenceNotifications=ae,!0}};function V0(a,y,b,E){var ee;let re,ae=[];if(typeof y!="string"||E.format==="math-json"){const ue=window.MathfieldElement.computeEngine;if(!ue)return["math-json",[]];[re,y]=["latex",ue.box(y).latex],ae=ja(y,{context:a.mathfield.context})}else typeof y=="string"&&E.format==="ascii-math"?([re,y]=uc(y,{format:"ascii-math",inlineShortcuts:a.mathfield.options.inlineShortcuts}),ae=ja(y,{context:a.mathfield.context}),re!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&Wh(ae)):(E.format==="auto"||(ee=E.format)!=null&&ee.startsWith("latex"))&&(E.format==="auto"&&([re,y]=uc(y,{format:"auto",inlineShortcuts:a.mathfield.options.inlineShortcuts})),E.format==="latex"&&([,y]=Rs(y)),ae=ja(y,{context:a.mathfield.context,args:b}),E.format!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&Wh(ae));return Nl(ae,E.style),[re!=null?re:"latex",ae]}function nv(a){if(!a||(console.assert(a[0].type==="first"),a.length>1))return null;const y=a[0];return y instanceof Ri&&y.leftDelim==="("&&y.rightDelim===")"?y.removeBranch("body"):null}function Wh(a){if(a){for(let y=0;a[y];y++){const b=a[y];if(b instanceof Ri&&b.leftDelim==="("){let E=0,ee=0,re=0;for(let ae=0;b.body[ae];ae++)b.body[ae].type==="genfrac"&&(E++,ee=ae),re++;re===0&&E===1&&(a[y]=b.body[ee])}}for(const y of a){for(const b of y.branches)if(!y.hasEmptyBranch(b)){Wh(y.branch(b));const E=nv(y.branch(b));E&&y.setChildren(E,b)}if(y instanceof hi)for(const b of y.cells)Wh(b)}}}function rv(a){let y=a.at(a.position);if(y.mode==="text"){for(;!y.isFirstSibling&&y.mode==="text";)y=y.leftSibling;return a.offsetOf(y)}const b=y;let E=!1;if(y.type==="mclose"){const ee=te[y.value];for(;!y.isFirstSibling&&!(y.type==="mopen"&&y.value===ee);)y=y.leftSibling;y.isFirstSibling||(y=y.leftSibling),E=!0}else y.type==="leftright"&&(y=y.leftSibling,E=!0);if(E)for(;!y.isFirstSibling&&(y.isFunction||U0(y));)y=y.leftSibling;else{const ee=[];for(;!y.isFirstSibling&&(U0(y)||ee.length>0);)y.type==="mclose"&&ee.unshift(y.value),y.type==="mopen"&&ee.length>0&&y.value===te[ee[0]]&&ee.shift(),y=y.leftSibling}return b===y?-1:a.offsetOf(y)}function U0(a){return a.isDigit()?!0:a.type&&/^(mord|surd|subsup|leftright|mop|mclose)$/.test(a.type)?!a.isExtensibleSymbol:!1}new tv;var iv=class extends si{constructor(){super("text")}onPaste(a,y){if(!y)return!1;const b=typeof y=="string"?y:y.getData("text/plain");return b&&a.model.contentWillChange({inputType:"insertFromPaste",data:b})?(a.stopCoalescingUndo(),a.stopRecording(),this.insert(a.model,b)&&(a.model.contentDidChange({inputType:"insertFromPaste"}),a.startRecording(),a.snapshot("paste"),va(a)),a.startRecording(),!0):!1}insert(a,y,b={}){if(!a.contentWillChange({data:y,inputType:"insertText"}))return!1;b.insertionMode||(b.insertionMode="replaceSelection"),b.selectionMode||(b.selectionMode="placeholder"),b.format||(b.format="auto");const{silenceNotifications:E}=a;b.silenceNotifications&&(a.silenceNotifications=!0);const ee=a.silenceNotifications;a.silenceNotifications=!0,b.insertionMode==="replaceSelection"&&!a.selectionIsCollapsed?a.deleteAtoms(Wa(a.selection)):b.insertionMode==="replaceAll"?(a.root.setChildren([],"body"),a.position=0):b.insertionMode==="insertBefore"?a.collapseSelection("backward"):b.insertionMode==="insertAfter"&&a.collapseSelection("forward");const re=av(y,a.mathfield.context);if(Nl(re,b.style),!re)return!1;const ae=a.at(a.position),ue=ae.parent.addChildrenAfter(re,ae);return a.silenceNotifications=ee,b.selectionMode==="before"||(b.selectionMode==="item"?a.setSelection(a.anchor,a.offsetOf(ue)):ue&&(a.position=a.offsetOf(ue))),a.contentDidChange({data:y,inputType:"insertText"}),a.silenceNotifications=E,!0}};function av(a,y){return a=a.replace(/\\/g,"\\textbackslash "),a=a.replace(/#/g,"\\#"),a=a.replace(/\$/g,"\\$"),a=a.replace(/%/g,"\\%"),a=a.replace(/&/g,"\\&"),a=a.replace(/_/g,"\\_"),a=a.replace(/{/g,"\\textbraceleft "),a=a.replace(/}/g,"\\textbraceright "),a=a.replace(/lbrace/g,"\\textbraceleft "),a=a.replace(/rbrace/g,"\\textbraceright "),a=a.replace(/\^/g,"\\textasciicircum "),a=a.replace(/~/g,"\\textasciitilde "),a=a.replace(/£/g,"\\textsterling "),ja(a,{context:y,parseMode:"text"})}new iv;function Hs(a){return{value:a.model.getValue(),selectionIsCollapsed:a.model.selectionIsCollapsed,canUndo:a.canUndo(),canRedo:a.canRedo(),style:a.selectionStyle,mode:a.model.mode}}var ia=4,Mo=20,Ba=2*(Mo+ia),Zh=(a,y)=>`
<line x1="${a+Mo}" y1="${y+Mo}"
x2="${a>y?a+Mo:7*Mo+10*ia}"
y2="${a<y?y+Mo:7*Mo+10*ia}"/>
<svg id="plus" viewBox="0 0 40 40" x="${a}" y="${y}" width="40" height="40">
<circle class="cls-2" cx="20" cy="20" r="20"/>
<path class="font" d="m33.33,20c0,1.84-1.49,3.34-3.33,3.34h-6.67v6.66c0,1.84-1.49,3.34-3.33,3.34s-3.34-1.5-3.34-3.34v-6.66h-6.66c-1.84,0-3.34-1.5-3.34-3.34s1.5-3.33,3.34-3.33h6.66v-6.67c0-1.84,1.5-3.33,3.34-3.33s3.33,1.49,3.33,3.33v6.67h6.67c1.84,0,3.33,1.49,3.33,3.33Z"/>
</svg>`,G0=(a,y)=>`
<line x1="${a+Mo}" y1="${y+Mo}"
x2="${a>y?a+Mo:7*Mo+10*ia}"
y2="${a<y?y+Mo:7*Mo+10*ia}"/>
<svg id="minus" viewBox="0 0 40 40" x="${a}" y="${y}" width="40" height="40">
<circle class="cls-2" cx="20" cy="20" r="20"/>
<path class="font" d="m33.33,20c0,1.84-1.49,3.33-3.33,3.33H10c-1.84,0-3.34-1.49-3.34-3.33s1.5-3.34,3.34-3.34h20c1.84,0,3.33,1.5,3.33,3.34Z"/>
</svg>`,jh=(a,y,b)=>`
<svg id="arrow" viewBox="0 0 40 40" x="${a}" y="${y}" width="40" height="40">
<circle class="cls-2" cx="20" cy="20" r="20"/>
<g transform="rotate(${b})" transform-origin="20 20">
<path class="font" d="m17.7,7.23h4.6c.52,0,.94.42.94.94v13.82c0,.52.42.94.94.94h3.39c.83,0,1.25,1.01.66,1.6l-7.56,7.56c-.37.37-.96.37-1.32,0l-7.56-7.56c-.59-.59-.17-1.6.66-1.6h3.39c.52,0,.94-.42.94-.94v-13.82c0-.52.42-.94.94-.94Z"/>
</g>
</svg>`,ov=`
<svg class="MLEP__array-buttons" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox=
"-2 -2 ${8*Mo+10*ia+5} ${8*Mo+10*ia+5}">
<rect
class="MLEP__array-insert-background rows"
x="0"
y="${Ba+ia}"
height="${3*Ba}"
width="${Ba}"
rx="${Ba/2}"/>
<rect
class="MLEP__array-insert-background columns"
x="${Ba+ia}"
y="0"
height="${Ba}"
width="${3*Ba}"
rx="${Ba/2}"/>
<g data-command='"moveDown"'>
${jh(2*(ia+Ba),2*ia+3*Ba,0)}
</g>
<g data-command='"moveUp"'>
${jh(2*(ia+Ba),2*ia+Ba,180)}
</g>
<g data-command='"moveToNextWord"'>
${jh(2*ia+3*Ba,2*(ia+Ba),-90)}
</g>
<g data-command='"moveToPreviousWord"'>
${jh(2*ia+Ba,2*(ia+Ba),90)}
</g>
<g>
<g data-command='"addColumnBefore"'>
${Zh(2*ia+Ba,ia)}
</g>
<g data-command='"removeColumn"'>
${G0(2*ia+2*Ba,ia)}
</g>
<g data-command='"addColumnAfter"'>
${Zh(2*ia+3*Ba,ia)}
</g>
<g data-command='"addRowBefore"'>
${Zh(ia,2*ia+Ba)}
</g>
<g data-command='"removeRow"'>
${G0(ia,2*ia+2*Ba)}
</g>
<g data-command='"addRowAfter"'>
${Zh(ia,2*ia+3*Ba)}
</g>
</svg>`,sv=a=>`
<svg id="matrix" class="${a}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","matrix"]'>
<rect class="cls-1" width="28" height="24"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/></svg>`,lv=a=>`
<svg id="pmatrix" class="${a}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","pmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m6,4c-3.96,4.6-3.96,11.4,0,16"/>
<path class="cls-2" d="m22,4c3.96,4.6,3.96,11.4,0,16"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/></svg>`,X0=a=>`
<svg id="Bmatrix" class="${a}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","Bmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m6,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>
<path class="cls-2" d="m22,4c1.1,0,2,.9,2,2v3c0,1.66.9,3,2,3-1.1,0-2,1.34-2,3v3c0,1.1-.9,2-2,2"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
</svg>`,cv=a=>`
<svg id="bmatrix" class="${a}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","bmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m6,4h-3v16h3"/>
<path class="cls-2" d="m22,4h3v16h-3"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
</svg>`,uv=a=>`
<svg id="vmatrix" class="${a}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","vmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
<line class="cls-2" x1="4" y1="4" x2="4" y2="20"/>
<line class="cls-2" x1="24" y1="4" x2="24" y2="20"/>
</svg>`,dv=a=>`
<svg id="Vmatrix" class="${a}" xmlns="http://www.w3.org/2000/svg" viewBox="-3.5 -3 35 30"
data-command='["setEnvironment","Vmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
<line class="cls-2" x1="6" y1="4" x2="6" y2="20"/>
<line class="cls-2" x1="22" y1="4" x2="22" y2="20"/>
<line class="cls-2" x1="2" y1="4" x2="2" y2="20"/>
<line class="cls-2" x1="26" y1="4" x2="26" y2="20"/>
</svg>`,hv=a=>`
<svg id="cases" class="${a}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","cases"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m10,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>
<circle cx="13" cy="8" r="1"/>
<circle cx="13" cy="16" r="1"/>
<circle cx="21" cy="8" r="1"/>
<circle cx="21" cy="16" r="1"/>
</svg>`,fv=a=>`
<svg id="rcases" class="${a}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","rcases"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m18,20c1.1,0,2-.9,2-2v-3c0-1.66.9-3,2-3-1.1,0-2-1.34-2-3v-3c0-1.1-.9-2-2-2"/>
<circle cx="15" cy="8" r="1"/>
<circle cx="15" cy="16" r="1"/>
<circle cx="7" cy="8" r="1"/>
<circle cx="7" cy="16" r="1"/>
</svg>`,Rf={matrix:sv,pmatrix:lv,bmatrix:cv,Bmatrix:X0,vmatrix:uv,Vmatrix:dv},Nf={cases:hv,rcases:fv,Bmatrix:X0};function pv(a){var y,b;const E=(y=a.model.parentEnvironment)==null?void 0:y.array;if(!E)return;let ee=0;E.forEach(xt=>{(!ee||xt.length>ee)&&(ee=xt.length)});let re=document.getElementById("mathlive-environment-popover");re||(re=Mh("mathlive-environment-popover"),Bo("environment-popover"),Bo("core"),re.setAttribute("aria-hidden","true"));let ae;const ue=re.querySelector(".MLEP__environment-controls");ue?ae=ue:(ae=document.createElement("div"),re.innerHTML="",re.appendChild(ae)),ae.className="MLEP__environment-controls",ae.style.display="flex",ae.style.width="100%",ae.style.height="100%",ae.style.boxSizing="border-box",ae.innerHTML=ov;let he=[],ge="";const be=a.model.parentEnvironment.environmentName;if(co(be)){const xt=gv(be);ge=Rf[xt]("active");const vn=Rf,{[xt]:nr}=vn,fn=gt(vn,[Fe(xt)]);he=Object.values(fn).map(Rn=>Rn("inactive"))}else if(uo(be)){const xt=vv(be);ge=Nf[xt]("active");const vn=Nf,{[xt]:nr}=vn,fn=gt(vn,[Fe(xt)]);he=Object.values(fn).map(Rn=>Rn("inactive"))}else _a(be)&&(ge=Rf.matrix("active"),he=Object.values(Nf).map(xt=>xt("inactive")));const Be=document.createElement("div");Be.className="MLEP__environment-delimiter-controls",Be.style.display="flex",Be.style.flexDirection="column",Be.innerHTML=`
<div class='MLEP__array-delimiter-options'>
${ge}
${he.join("")}
</div>`,ge&&ae.appendChild(Be),ae.querySelectorAll("[data-command]").forEach(xt=>{const vn=xt.dataset.command;let nr=vn;try{nr=JSON.parse(vn)}catch(fn){}xt.addEventListener("mousedown",fn=>fn.preventDefault()),nr&&xt.addEventListener("click",()=>a.executeCommand(nr))});const lt=(b=a.field)==null?void 0:b.getBoundingClientRect();lt&&(re.style.top=`${window.scrollY+(lt.top-re.clientHeight-15)}px`,re.style.left=`${lt.left+20}px`,re.classList.add("is-visible"))}function $f(){const a=document.getElementById("mathlive-environment-popover");a==null||a.classList.remove("is-visible")}function mv(){document.getElementById("mathlive-environment-popover")&&(bf("mathlive-environment-popover"),x("environment-popover"),x("core"))}function Vh(a){if(!a.hasFocus())return;let y=!1;if(a.model.mode==="math"){const b=a.model.parentEnvironment;if(b!=null&&b.array&&da(b.environmentName)){const E=a.options.environmentPopoverPolicy;y=E==="auto"||E==="on"}}y?pv(a):$f()}function gv(a){return a.replace("*","")}function vv(a){return a==="dcases"?"cases":a}function Y0(a){const y=getComputedStyle(a).direction;return y==="ltr"||y==="rtl"?y:"ltr"}function q0(a,y,b){return y==="left"||y==="leading"&&b==="ltr"||y==="trailing"&&b==="rtl"?a.left:a.right}function Ff(a,y,b,E){return b==="middle"?a-y/2:b==="start"&&E==="rtl"||b==="end"&&E==="ltr"||b==="top"||b==="right"?Math.max(0,a-y):a}function yv(a,y,b,E){return b==="middle"?a-y/2:b==="start"&&E==="ltr"||b==="end"&&E==="rtl"||b==="top"||b==="right"?a:a-y}function bv(a,y){var b,E,ee;const re=(b=Y0(a))!=null?b:"ltr";a.style.position="fixed",a.style.left="",a.style.top="",a.style.right="",a.style.bottom="",a.style.height="",a.style.width="";const ae=a.getBoundingClientRect(),ue=Number.isFinite(y.maxHeight)?Math.min(y.maxHeight,window.innerHeight):window.innerHeight;let he=Math.min(ue,(E=y.height)!=null?E:ae.height),ge=Ff(y.location.y,he,y.verticalPos,re);ge+he>window.innerHeight-8&&(y.alternateLocation?(ge=Ff(y.alternateLocation.y,he,y.verticalPos,re),ge+he>window.innerHeight-8&&(ge=void 0)):ge=void 0),Number.isFinite(ge)||(ge=Math.max(8,window.innerHeight-8-he),8+he>window.innerHeight-8&&(a.style.bottom="8px")),he=Math.min(ge+he,window.innerHeight-8)-ge;const be=Number.isFinite(y.maxWidth)?Math.min(y.maxWidth,window.innerWidth):window.innerWidth;let Be=Math.min(be,(ee=y.width)!=null?ee:ae.width),He=Ff(y.location.x,Be,y.horizontalPos,re);He+Be>window.innerWidth-8&&(y.alternateLocation?(He=yv(y.alternateLocation.x,Be,y.verticalPos,re),He+Be>window.innerWidth-8&&(He=void 0)):He=void 0),Number.isFinite(He)||(He=Math.max(8,window.innerWidth-8-Be),8+Be>window.innerWidth-8&&(a.style.right="8px")),Be=Math.min(He+Be,window.innerWidth-8)-He,re==="rtl"?a.style.right=`${Math.ceil(window.innerWidth-He-Be).toString()}px`:a.style.left=`${Math.ceil(He).toString()}px`,a.style.top=`${Math.ceil(ge).toString()}px`,he!==ae.height&&(a.style.height=`${Math.ceil(he).toString()}px`),Be!==ae.width&&(a.style.width=`${Math.ceil(Be).toString()}px`)}function xv(a,y){return Math.hypot(y.x-a.x,y.y-a.y)}function mu(a){return"submenu"in a}function Ws(a){return"type"in a&&a.type==="command"||"onMenuSelect"in a||"id"in a}function zf(a){return"type"in a&&a.type==="divider"}function Kf(a){return"type"in a&&a.type==="heading"}var J0={};function Hf(a){let y=J0[a];if(!y){let b;switch(a){case"checkmark":b=`<span aria-hidden="true" class="ui-checkmark"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z"></path></svg>
</span>`;break;case"trailing-chevron":b='<span aria-hidden="true" class="ui-trailing-chevron"><svg focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"></path></svg></span>';break;case"mixedmark":b='<span aria-hidden="true" class="ui-mixedmark"><svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 512 512"><path fill="currentColor" d="M0 256c0-13.3 10.7-24 24-24H488c13.3 0 24 10.7 24 24s-10.7 24-24 24H24c-13.3 0-24-10.7-24-24z"/></svg></span>'}if(b){const E=document.createElement("template");E.innerHTML=b,J0[a]=E,y=E}}if(y){if("content"in y)return y.content.cloneNode(!0);const b=document.createElement("svg");return b.innerHTML=y.innerHTML,b}}var Q0=80,ep=class{constructor(a,y){this._element=null;var b;this.parentMenu=y,this._declaration=a,mu(a)?(this.type="submenu",this.submenu=new tp(a.submenu,{parentMenu:y,submenuClass:a.submenuClass,columnCount:a.columnCount})):this.type=(b=a.type)!=null?b:"command",this.hasCheck=Ws(a)&&a.checked!==void 0}get rootMenu(){return this.parentMenu.rootMenu}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}dispose(){var a,y;(a=this._abortController)==null||a.abort(),this._abortController=void 0,(y=this._element)==null||y.remove(),this._element=null,this.submenu&&this.submenu.dispose(),this.submenu=void 0}get menuItem(){return this._declaration}get label(){var a;return(a=this._label)!=null?a:""}set label(a){a===void 0&&(a=""),a!==this._label&&(this._label=a,this.dirty=!0)}get visible(){return this._visible}set visible(a){a!==this._visible&&(this._visible=a,this.dirty=!0)}get enabled(){return this._enabled}set enabled(a){this._enabled=a,this.element&&(a?this.element.removeAttribute("aria-disabled"):this.element.setAttribute("aria-disabled","true")),this.dirty=!0}get checked(){return this._checked}set checked(a){this._checked=a,this.dirty=!0}get tooltip(){return this._tooltip}set tooltip(a){a!==this._tooltip&&(this._tooltip=a,this.dirty=!0)}get ariaLabel(){return this._ariaLabel}set ariaLabel(a){a!==this._ariaLabel&&(this._ariaLabel=a,this.dirty=!0)}get active(){var a,y;return(y=(a=this.element)==null?void 0:a.classList.contains("active"))!=null?y:!1}set active(a){this.element&&this.element.classList.toggle("active",a)}updateState(a){var y,b,E;const ee=this._declaration;if(zf(ee)){this.enabled=!1,this.checked=!1;return}Kf(ee)&&(this.enabled=!1,this.checked=!1,this.visible=!0),Ws(ee)&&(this.checked=Ws(ee)&&((y=gu(ee.checked,a))!=null?y:!1)),(Ws(ee)||mu(ee))&&(this.enabled=(b=gu(ee.enabled,a))!=null?b:!0,this.visible=(E=gu(ee.visible,a))!=null?E:!0,this.visible&&this.enabled&&this.submenu&&(this.submenu.updateState(a),this.submenu.visible||(this.visible=!1))),(Ws(ee)||Kf(ee)||mu(ee))&&(this.label=gu(ee.label,a),this.tooltip=gu(ee.tooltip,a),this.ariaLabel=gu(ee.ariaLabel,a)),this._element&&this.updateElement()}set dirty(a){console.assert(a===!0),a&&this.parentMenu&&(this.parentMenu.dirty=!0)}updateElement(){if(!this.visible||!this.element)return;const a=this.element;a.textContent="",this.enabled?a.removeAttribute("aria-disabled"):a.setAttribute("aria-disabled","true"),this.checked===!0?(a.setAttribute("aria-checked","true"),a.append(Hf("checkmark"))):this.checked==="mixed"?(a.setAttribute("aria-checked","mixed"),a.append(Hf("mixedmark"))):a.removeAttribute("aria-checked"),this.ariaLabel&&a.setAttribute("aria-label",this.ariaLabel);const y=document.createElement("span");if(y.className=this.parentMenu.hasCheck?"label indent":"label",this.type==="heading"&&y.classList.add("heading"),y.innerHTML=this.label,a.append(y),this._tooltip&&a.setAttribute("data-tooltip",this._tooltip),Ws(this._declaration)&&this._declaration.keyboardShortcut){const b=document.createElement("kbd");b.innerHTML=vf(this._declaration.keyboardShortcut),a.append(b)}this.type==="submenu"&&a.append(Hf("trailing-chevron"))}get element(){if(this._element)return this._element;if(zf(this._declaration)){const b=document.createElement("li");return b.setAttribute("part","menu-divider"),b.setAttribute("role","divider"),this._element=b,b}const a=document.createElement("li");this._element=a,(Ws(this._declaration)||Kf(this._declaration)||mu(this._declaration))&&this._declaration.class&&(a.className=this._declaration.class),a.setAttribute("part","menu-item"),a.setAttribute("tabindex","-1"),this.hasCheck?a.setAttribute("role","menuitemcheckbox"):a.setAttribute("role","menuitem"),this.type==="submenu"&&(a.setAttribute("aria-haspopup","true"),a.setAttribute("aria-expanded","false"));const y=this.abortController.signal;return a.addEventListener("pointerenter",this,{signal:y}),a.addEventListener("pointerleave",this,{signal:y}),a.addEventListener("pointerup",this,{signal:y}),a.addEventListener("click",this,{signal:y}),this._element}dispatchSelect(){if(!Ws(this._declaration))return;const a=new CustomEvent("menu-select",{cancelable:!0,bubbles:!0,detail:{modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data}});this.parentMenu.dispatchEvent(a)&&typeof this._declaration.onMenuSelect=="function"&&this._declaration.onMenuSelect({modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data})}handleEvent(a){var y;if(!(!this.visible||!this.enabled)){if(a.type==="click"){this.rootMenu.state==="modal"&&this.select(),a.stopPropagation(),a.preventDefault();return}if(a.type==="pointerenter"){const b=a;this.rootMenu.cancelDelayedOperation(),this.parentMenu.isSubmenuOpen&&((y=this.parentMenu.activeMenuItem)!=null&&y.movingTowardSubmenu(b))?this.rootMenu.scheduleOperation(()=>{this.parentMenu.activeMenuItem=this,this.openSubmenu()}):(this.parentMenu.activeMenuItem=this,this.openSubmenu({withDelay:!0}));return}if(a.type==="pointerleave"){this.rootMenu.activeSubmenu===this.parentMenu&&(this.parentMenu.activeMenuItem=null);return}if(a.type==="pointerup"){this.rootMenu.state!=="modal"&&this.select(),a.stopPropagation(),a.preventDefault();return}}}select(){if(this.rootMenu.cancelDelayedOperation(),this.type==="submenu"){this.openSubmenu();return}this.active=!1,setTimeout(()=>{this.active=!0,setTimeout(()=>{this.rootMenu.hide(),this.dispatchSelect()},Q0)},Q0)}openSubmenu(a){var y;if(this.type!=="submenu"||!this.element)return;if((y=a==null?void 0:a.withDelay)!=null&&y){this.rootMenu.scheduleOperation(()=>this.openSubmenu());return}const b=this.element.getBoundingClientRect(),E=Y0(this.element);this.submenu.show({container:this.rootMenu.element.parentNode,location:{x:q0(b,"trailing",E),y:b.top-4},alternateLocation:{x:q0(b,"leading",E),y:b.top-4}})}movingTowardSubmenu(a){if(!this.element||this.type!=="submenu")return!1;const y=this.rootMenu.lastMoveEvent;if(!y)return!1;const b=a.timeStamp-y.timeStamp;if(b>500)return!1;const E=a.clientX-y.clientX;if(wv(E,y.clientY-a.clientY,b)<=.2)return!1;let re="right";if(this.submenu.element){const ae=this.submenu.element.getBoundingClientRect(),ue=this.element.getBoundingClientRect();ae.left<ue.left+ue.width/2&&(re="left")}return re==="right"?E>0:E<0}};function wv(a,y,b){return Math.hypot(a,y)/b}function gu(a,y){return a===void 0||typeof a!="function"?a:(y!=null||(y={alt:!1,control:!1,shift:!1,meta:!1}),a(y))}var tp=class Mu{constructor(y,b){this._element=null,this._activeMenuItem=null,this._dirty=!0;var E,ee;this.parentMenu=(E=b==null?void 0:b.parentMenu)!=null?E:null,this._submenuClass=b==null?void 0:b.submenuClass,this.columnCount=(ee=b==null?void 0:b.columnCount)!=null?ee:1,this.isSubmenuOpen=!1,this.menuItems=y}get children(){return this._menuItems}set menuItems(y){const b=this.parentMenu;this.dispose(),this.parentMenu=b,y=[...y],this._menuItems=y.map(E=>E.onCreate?E.onCreate(E,this):new ep(E,this)),this.hasCheck=void 0,this.dirty=!0}dispose(){var y;this.hide(),this._element&&this._element.remove(),this._abortController&&this._abortController.abort(),(y=this._menuItems)==null||y.forEach(b=>b.dispose()),this._menuItems=[],this._activeMenuItem=null,this.parentMenu=null}handleEvent(y){if(y.type==="wheel"&&this._element){const b=y;this._element.scrollBy(0,b.deltaY),y.stopPropagation()}}dispatchEvent(y){return this.rootMenu.dispatchEvent(y)}get rootMenu(){return this.parentMenu.rootMenu}updateState(y){var b,E,ee;this._menuItems.forEach(ge=>ge.updateState(y));const re=this.hasCheck;this.hasCheck=this._menuItems.some(ge=>ge.visible&&ge.hasCheck),this.hasCheck!==re&&this._menuItems.forEach(ge=>ge.updateState(y));let ae,ue=0;for(const ge of this._menuItems)ge.type==="heading"?(ae&&ue===0&&(ae.visible=!1),ae=ge,ue=0):ge.type==="divider"&&ae?(ae.visible=ue>0,ae=void 0,ue=0):ae&&ge.visible&&(ue+=1);ae&&(ae.visible=ue>0);let he=!0;for(const ge of this._menuItems)ge.type==="divider"?(ge.visible=!he,he=!0):ge.visible&&(he=!1);(b=this.activeMenuItem)!=null&&b.visible||(this.activeMenuItem=null),!((E=this.activeMenuItem)!=null&&E.enabled)&&((ee=this.activeMenuItem)==null?void 0:ee.type)==="submenu"&&this._activeMenuItem.submenu.hide(),this._dirty=!1}get enabled(){return this.updateIfDirty(),this._menuItems.some(y=>y.type!=="divider"&&y.visible&&y.enabled)}get visible(){return this.updateIfDirty(),this._menuItems.some(y=>y.type!=="divider"&&y.visible)}set dirty(y){console.assert(y===!0),this._dirty!==y&&y&&this.parentMenu&&(this._dirty=!0,this.parentMenu.dirty=!0)}updateIfDirty(){this._dirty&&this.updateState(this.rootMenu.modifiers)}updateElement(){var y;if(this._element){this._element.textContent="";for(const{element:b,visible:E}of this._menuItems)b&&E&&this._element.append(b);(y=this._element.querySelector("li:first-of-type"))==null||y.setAttribute("tabindex","0")}}get element(){if(this._element)return this._element;const y=document.createElement("menu");y.setAttribute("role","menu"),y.setAttribute("tabindex","-1"),y.setAttribute("aria-orientation","vertical"),y.setAttribute("part","ui-menu-container"),this._submenuClass&&y.classList.add(this._submenuClass),y.classList.add("ui-menu-container"),this._abortController||(this._abortController=new AbortController);const b=this._abortController.signal;return y.addEventListener("focus",this,{signal:b}),y.addEventListener("wheel",this,{passive:!0,signal:b}),this._element=y,this.updateElement(),y}get activeMenuItem(){return this._activeMenuItem}set activeMenuItem(y){var b,E,ee,re;if(this.rootMenu.cancelDelayedOperation(),y!==this._activeMenuItem){if(this.activeMenuItem){const ae=this.activeMenuItem;ae.active=!1,(b=ae.submenu)==null||b.hide()}if(!((E=y==null?void 0:y.visible)==null||E)){this._activeMenuItem=null;return}this._activeMenuItem=y,y&&(y.active=!0)}y?(ee=y.element)==null||ee.focus({preventScroll:!0}):(re=this._element)==null||re.focus({preventScroll:!0})}get firstMenuItem(){this.updateIfDirty();let y=0,b=!1;const E=this._menuItems;for(;!b&&y<=E.length-1;){const ee=E[y];b=ee.type!=="divider"&&ee.visible&&ee.enabled,y+=1}return b?E[y-1]:null}get lastMenuItem(){this.updateIfDirty();const y=this._menuItems;let b=y.length-1,E=!1;for(;!E&&b>=0;){const ee=y[b];E=ee.type!=="divider"&&ee.visible&&ee.enabled,b-=1}return E?y[b+1]:null}nextMenuItem(y){if(y===0)return this._activeMenuItem;if(!this._activeMenuItem)return y>0?this.firstMenuItem:this.lastMenuItem;if(!this.firstMenuItem||!this.lastMenuItem||!this._activeMenuItem)return null;this.updateIfDirty();const b=this._menuItems.indexOf(this.firstMenuItem),E=this._menuItems.indexOf(this.lastMenuItem);let ee=this._menuItems.indexOf(this._activeMenuItem),re=1;for(;ee>=b&&ee<=E;){ee+=y>0?1:-1;const ae=this._menuItems[ee];if(!ae)break;if(ae.visible&&ae.enabled){if(re===Math.abs(y))return this._menuItems[ee];re+=1}}return y>0?this.lastMenuItem:this.firstMenuItem}getMenuItemColumn(y){this.updateIfDirty();const E=this._menuItems.filter(ee=>ee.visible&&ee.enabled).indexOf(y);return E<0?-1:E%this.columnCount}static get collator(){return Mu._collator||(Mu._collator=new Intl.Collator(void 0,{usage:"search",sensitivity:"base"})),Mu._collator}findMenuItem(y){var b;this.updateIfDirty();const E=this._menuItems.filter(ue=>ue.type!=="divider"&&ue.visible&&ue.enabled);if(E.length===0)return null;const ee=Math.max(...E.map(ue=>ue.label.length))-y.length;if(ee<0)return null;let re=null,ae=0;for(;ae<ee&&!re;)re=(b=E.find(ue=>Mu.collator.compare(y,ue.label.substring(ae,y.length))===0))!=null?b:null,ae++;return re}show(y){return!this.visible||!y.container?!1:(this.updateElement(),y.container.appendChild(this.element),tn()&&(this.element.popover="manual",this.element.showPopover()),y.location&&bv(this.element,{location:y.location,alternateLocation:y.alternateLocation,verticalPos:"bottom",horizontalPos:"start"}),this.element.focus({preventScroll:!0}),this.parentMenu&&(this.parentMenu.openSubmenu=this),!0)}hide(){var y,b,E,ee,re;this.openSubmenu=null,this.activeMenuItem=null,this.parentMenu&&(this.parentMenu.openSubmenu=null),tn()&&((y=this._element)!=null&&y.popover)&&this.element.hidePopover(),(E=(b=this.parentMenu)==null?void 0:b.element)==null||E.focus(),(re=(ee=this._element)==null?void 0:ee.parentNode)==null||re.removeChild(this._element)}set openSubmenu(y){var b,E,ee,re;const ae=y!==null;((b=this.activeMenuItem)==null?void 0:b.type)==="submenu"&&((E=this.activeMenuItem.element)==null||E.setAttribute("aria-expanded",ae.toString())),(re=(ee=this.activeMenuItem)==null?void 0:ee.element)==null||re.classList.toggle("is-submenu-open",ae),this.isSubmenuOpen=ae}},np=class rm extends tp{constructor(y,b){var E;super(y),this.state="closed",this.typingBufferResetTimer=0,this.hysteresisTimer=0,this._updating=!1,this._host=(E=b==null?void 0:b.host)!=null?E:null,this.isDynamic=y.some(rp),this._modifiers={shift:!1,control:!1,alt:!1,meta:!1},this.typingBuffer="",this.state="closed"}get modifiers(){return this._modifiers}set modifiers(y){zm(this._modifiers,y)||(this._modifiers=y,this.dirty=!0)}get activeSubmenu(){let y=this;for(;y.isSubmenuOpen;)y=y.activeMenuItem.submenu;return y}set dirty(y){this._updating||(console.assert(y===!0),this._dirty!==y&&(this._dirty=!0,y&&setTimeout(()=>{this.updateState(this.modifiers),this.updateElement()})))}updateState(y){this._updating=!0,this.modifiers=y!=null?y:this.modifiers,super.updateState(this.modifiers),this._updating=!1}handleKeyupEvent(y){this.isDynamic&&(this.modifiers=fc(y)),y.stopImmediatePropagation()}handleKeydownEvent(y){var b,E,ee;if(y.key==="Tab"||y.key==="Escape"){this.hide();return}this.isDynamic&&(this.modifiers=fc(y));let re=!0;const ae=this.activeSubmenu,ue=ae.activeMenuItem;switch(y.key){case" ":case"Space":case"Return":case"Enter":ue==null||ue.select(fc(y));break;case"ArrowRight":if((ue==null?void 0:ue.type)==="submenu")ue.select(fc(y)),this.activeSubmenu.activeMenuItem=this.activeSubmenu.firstMenuItem;else if(!ue)ae.activeMenuItem=ae.firstMenuItem;else{const he=(b=ae.getMenuItemColumn(ue))!=null?b:-1;if(he>=0&&he<((E=ae.columnCount)!=null?E:1)-1){const ge=ae.nextMenuItem(1);ge&&(ae.activeMenuItem=ge)}}break;case"ArrowLeft":if(ae===this.rootMenu)ue||(ae.activeMenuItem=ae.firstMenuItem);else if((ue&&(ee=ae.getMenuItemColumn(ue))!=null?ee:-1)<=0||!ue){ae.hide();const ge=ae.parentMenu.activeMenuItem;if(ge){const{element:be}=ge;be==null||be.focus(),be==null||be.classList.remove("is-submenu-open")}}else{const ge=ae.nextMenuItem(-1);ge&&(ae.activeMenuItem=ge)}break;case"ArrowDown":ae.activeMenuItem=ae.nextMenuItem(ae.columnCount);break;case"ArrowUp":ae.activeMenuItem=ae.nextMenuItem(-ae.columnCount);break;case"Home":case"PageUp":ae.activeMenuItem=ae.firstMenuItem;break;case"End":case"PageDown":ae.activeMenuItem=ae.lastMenuItem;break;case"Backspace":if(this.typingBuffer&&(this.typingBuffer=this.typingBuffer.slice(0,-1),this.typingBuffer)){clearTimeout(this.typingBufferResetTimer);const he=ae.findMenuItem(this.typingBuffer);he&&(ae.activeMenuItem=he),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}break;default:if(wh(y)){isFinite(this.typingBufferResetTimer)&&clearTimeout(this.typingBufferResetTimer),this.typingBuffer+=y.key;const he=ae.findMenuItem(this.typingBuffer);he&&(ae.activeMenuItem=he),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}else re=!1}re&&(y.preventDefault(),y.stopPropagation())}handleEvent(y){if(y.type==="keydown")this.handleKeydownEvent(y);else if(y.type==="keyup")this.handleKeyupEvent(y);else if(y.type==="pointermove")this.lastMoveEvent=y;else if(y.type==="pointerup"&&y.target===this.scrim)Number.isFinite(this.rootMenu._openTimestamp)&&Date.now()-this.rootMenu._openTimestamp<120?this.state="modal":this.state==="modal"&&this.hide();else if(y.type==="contextmenu"){y.preventDefault(),y.stopPropagation();return}super.handleEvent(y)}dispatchEvent(y){return this._host?this._host.dispatchEvent(y):!0}get scrim(){return Fs.element}connectScrim(y){const b=this.scrim;b.addEventListener("pointerup",this),b.addEventListener("contextmenu",this),b.addEventListener("keydown",this),b.addEventListener("keyup",this),b.addEventListener("pointermove",this),Fs.open({root:y,onDismiss:()=>this.hide()})}disconnectScrim(){const y=this.scrim;y.removeEventListener("pointerup",this),y.removeEventListener("contextmenu",this),y.removeEventListener("keydown",this),y.removeEventListener("keyup",this),y.removeEventListener("pointermove",this),Fs.state==="open"&&Fs.scrim.close()}get rootMenu(){return this}show(y){return this._onDismiss=y==null?void 0:y.onDismiss,y!=null&&y.modifiers&&(this.modifiers=y.modifiers),this.updateState(),this.connectScrim(y==null?void 0:y.target),super.show(ke(Ce({},y),{container:this.scrim}))?(this._openTimestamp=Date.now(),this.state="open",!0):(this.disconnectScrim(),!1)}hide(){this.cancelDelayedOperation(),this.state!==void 0&&(this.state!=="closed"&&(this.activeMenuItem=null,Fs.element.parentElement.focus(),super.hide(),this.state="closed",this.disconnectScrim()),this._onDismiss&&(this._onDismiss(),this._onDismiss=void 0))}scheduleOperation(y){this.cancelDelayedOperation();const b=rm.SUBMENU_DELAY;if(b<=0){y();return}this.hysteresisTimer=setTimeout(()=>{this.hysteresisTimer=0,y()},b)}cancelDelayedOperation(){this.hysteresisTimer&&(clearTimeout(this.hysteresisTimer),this.hysteresisTimer=0)}};np.SUBMENU_DELAY=120;var Sv=np;function rp(a){return zf(a)?!1:typeof a.label=="function"||typeof a.ariaLabel=="function"||typeof a.tooltip=="function"||(Ws(a)||mu(a))&&(typeof a.enabled=="function"||typeof a.visible=="function")||Ws(a)&&typeof a.checked=="function"?!0:mu(a)?a.submenu.some(rp):!1}var Uh=class{};Uh.DELAY=300,Uh.MAX_DISTANCE=10;function Cv(a){return new Promise((y,b)=>{const E=xh(a);E||y(!1);let ee=E;const re=setTimeout(()=>{ae.abort(),y(xv(ee,E)<Uh.MAX_DISTANCE)},Uh.DELAY),ae=new AbortController,ue=ae.signal;for(const he of["pointermove","pointerup","pointercancel"])window.addEventListener(he,ge=>{if(ge.type==="pointerup"||ge.type==="pointercancel")clearTimeout(re),ae.abort(),y(!1);else if(ge.type==="pointermove"){const be=xh(ge);be&&(ee=be)}},{passive:!0,signal:ue})})}function ip(a,y,b){return zl(this,null,function*(){if(a.type==="contextmenu"){const E=a;if(b.show({target:y,location:xh(E),modifiers:fc(E)}))return a.preventDefault(),a.stopPropagation(),!0}if(a.type==="keydown"){const E=a;if(E.code==="ContextMenu"||E.code==="F10"&&E.shiftKey){const ee=y==null?void 0:y.getBoundingClientRect();if(ee&&b.show({target:y,location:{x:Math.ceil(ee.left+ee.width/2),y:Math.ceil(ee.top+ee.height/2)},modifiers:fc(E)}))return a.preventDefault(),a.stopPropagation(),!0}}if(a.type==="pointerdown"&&a.pointerType!=="mouse"&&a.button===0){let E=a.target;for(;E&&y!==E;)E=E.parentNode;if(!E||!b.visible)return!1;const ee=xh(a);if(yield Cv(a))return b.state!=="closed"?!1:(b.show({target:y,location:ee}),!0)}return!1})}var ap={acute:714,grave:715,dot:729,ddot:168,mathring:730,tilde:126,bar:713,breve:728,check:711,hat:94,vec:8407};yt(Object.keys(ap),"{body:auto}",{createAtom:a=>new z(ke(Ce({},a),{body:Ye(a.args[0]),accentChar:ap[a.command.slice(1)]}))}),yt(["widehat","widecheck","widetilde"],"{body:auto}",{createAtom:a=>{const y=wn(Ye(a.args[0]));return new z(ke(Ce({},a),{body:Ye(a.args[0]),svgAccent:a.command.slice(1)+(y.length>5?"4":["1","1","2","2","3","3"][y.length])}))}}),yt(["overarc","overparen","wideparen"],"{body:auto}",{createAtom:a=>new z(ke(Ce({},a),{body:Ye(a.args[0]),svgAccent:"overarc"}))}),yt(["underarc","underparen"],"{body:auto}",{createAtom:a=>new qo(ke(Ce({},a),{body:Ye(a.args[0]),svgBelow:"underarc"}))}),yt("utilde","{body:auto}",{createAtom:a=>{const y=Ye(a.args[0]),b=wn(y),E="widetilde"+(b.length>5?"4":["1","1","2","2","3","3"][b.length]);return new qo(ke(Ce({},a),{body:y,svgBelow:E,boxType:El(y)}))}}),yt("^","{:string}",{createAtom:a=>{var y;return new Dn(ke(Ce({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={a:"\xE2",e:"\xEA",i:"\xEE",o:"\xF4",u:"\xFB",A:"\xC2",E:"\xCA",I:"\xCE",O:"\xD4",U:"\xDB"}[a.args[0]])!=null?y:"^"}))}}),yt("`","{:string}",{createAtom:a=>{var y;return new Dn(ke(Ce({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={a:"\xE0",e:"\xE8",i:"\xEC",o:"\xF2",u:"\xF9",A:"\xC0",E:"\xC8",I:"\xCC",O:"\xD2",U:"\xD9"}[a.args[0]])!=null?y:"`"}))}}),yt("'","{:string}",{createAtom:a=>{var y;return new Dn(ke(Ce({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={a:"\xE1",e:"\xE9",i:"\xED",o:"\xF3",u:"\xFA",A:"\xC1",E:"\xC9",I:"\xCD",O:"\xD3",U:"\xDA"}[a.args[0]])!=null?y:"'"}))}}),yt('"',"{:string}",{createAtom:a=>{var y,b;return new Dn(ke(Ce({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:(y=a.args)!=null&&y[0]?(b={a:"\xE4",e:"\xEB",i:"\xEF",o:"\xF6",u:"\xFC",A:"\xC4",E:"\xCB",I:"\xCB",O:"\xD6",U:"\xDC"}[a.args[0]])!=null?b:'"'+a.args[0]:'"'}))}}),yt(".","{:string}",{createAtom:a=>{var y,b;return new Dn(ke(Ce({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:(y=a.args)!=null&&y[0]?(b={a:"\u0227",e:"\u0117",i:"\u0307i",o:"\u022F",u:"\u0307u",A:"\u0226",E:"\u0116",I:"\u0130",O:"\u022E",U:"\u0307U"}[a.args[0]])!=null?b:"."+a.args[0]:"."}))}}),yt("=","{:string}",{createAtom:a=>{var y,b;return new Dn(ke(Ce({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:(y=a.args)!=null&&y[0]?(b={a:"\u0101",e:"\u0113",i:"\u012B",o:"\u014D",u:"\u016B",A:"\u0100",E:"\u0112",I:"\u012A",O:"\u014C",U:"\u016A"}[a.args[0]])!=null?b:"="+a.args[0]:"="}))}}),yt("~","{:string}",{createAtom:a=>{var y;return new Dn(ke(Ce({type:"mord"},a),{isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={n:"\xF1",N:"\xD1",a:"\xE3",o:"\xF5",A:"\xC3",O:"\xD5"}[a.args[0]])!=null?y:"\xB4"}))}}),yt("c","{:string}",{createAtom:a=>{var y;return new Dn(ke(Ce({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={c:"\xE7",C:"\xC7"}[a.args[0]])!=null?y:""}))}}),yt("enclose","{notation:string}[style:string]{body:auto}",{createAtom:a=>{var y,b;const E=a.args,ee={strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"none",svgStrokeStyle:void 0,borderStyle:void 0,style:(y=a.style)!=null?y:{}};if(E[1]){const ae=E[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const ue of ae){const he=ue.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(he)ee.strokeWidth=he[1],ee.strokeStyle=he[2],ee.strokeColor=he[3];else{const ge=ue.match(/\s*([a-z]*)\s*=\s*"(.*)"/);ge&&(ge[1]==="mathbackground"?ee.backgroundcolor=ge[2]:ge[1]==="mathcolor"?ee.strokeColor=ge[2]:ge[1]==="padding"?ee.padding=ge[2]:ge[1]==="shadow"&&(ee.shadow=ge[2]))}}ee.strokeStyle==="dashed"?ee.svgStrokeStyle="5,5":ee.strokeStyle==="dotted"&&(ee.svgStrokeStyle="1,5")}ee.borderStyle=`${ee.strokeWidth} ${ee.strokeStyle} ${ee.strokeColor}`;const re={};return((b=E[0])!=null?b:"").split(/[, ]/).filter(ae=>ae.length>0).forEach(ae=>{re[ae.toLowerCase()]=!0}),new cd(a.command,Ye(E[2]),re,ee)}}),yt("cancel","{body:auto}",{createAtom:a=>{var y;return new cd(a.command,Ye(a.args[0]),{updiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(y=a.style)!=null?y:{}})}}),yt("bcancel","{body:auto}",{createAtom:a=>{var y;return new cd(a.command,Ye(a.args[0]),{downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(y=a.style)!=null?y:{}})}}),yt("xcancel","{body:auto}",{createAtom:a=>{var y;return new cd(a.command,Ye(a.args[0]),{updiagonalstrike:!0,downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(y=a.style)!=null?y:{}})}}),yt(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overlinesegment","overgroup"],"{:auto}",{createAtom:a=>{var y;return new qo(ke(Ce({},a),{body:Ye((y=a.args)==null?void 0:y[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgAbove:a.command.slice(1)}))}}),yt("overbrace","{:auto}",{createAtom:a=>new qo(ke(Ce({},a),{body:Ye(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgAbove:a.command.slice(1)}))}),yt(["underrightarrow","underleftarrow","underleftrightarrow","underlinesegment","undergroup"],"{:auto}",{createAtom:a=>new qo(ke(Ce({},a),{body:Ye(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgBelow:a.command.slice(1)}))}),yt(["underbrace"],"{:auto}",{createAtom:a=>new qo(ke(Ce({},a),{body:Ye(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgBelow:a.command.slice(1)}))}),yt(["xrightarrow","longrightarrow","xleftarrow","longleftarrow","xRightarrow","xLeftarrow","xleftharpoonup","xleftharpoondown","xrightharpoonup","xrightharpoondown","xlongequal","xtwoheadleftarrow","xtwoheadrightarrow","xleftrightarrow","longleftrightarrow","xLeftrightarrow","xrightleftharpoons","longrightleftharpoons","xleftrightharpoons","xhookleftarrow","xhookrightarrow","xmapsto","xtofrom","xleftrightarrows","longleftrightarrows","xRightleftharpoons","longRightleftharpoons","xLeftrightharpoons","longLeftrightharpoons"],"[:auto]{:auto}",{createAtom:a=>{var y,b,E,ee,re;return new qo(ke(Ce({},a),{svgBody:a.command.slice(1),above:((b=Ye((y=a.args)==null?void 0:y[1]))==null?void 0:b.length)===0?void 0:Ye((E=a.args)==null?void 0:E[1]),below:(re=Ye((ee=a.args)==null?void 0:ee[0]))!=null?re:null,skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,paddedLabels:!0,boxType:"rel"}))},serialize:(a,y)=>a.command+(a.hasEmptyBranch("below")?"":`[${a.belowToLatex(y)}]`)+`{${a.aboveToLatex(y)}}${a.supsubToLatex(y)}`}),yt(["arccos","arcsin","arctan","arctg","arcctg","arg","ch","cos","cosh","cot","cotg","coth","ctg","cth","csc","cosec","deg","dim","exp","gcd","hom","inf","ker","lb","lg","ln","log","Pr","sec","sh","sin","sinh","sup","tan","tanh","tg","th","arcsec","arccsc","arsinh","arcosh","artanh","arcsech","arccsch"],"",{isFunction:!0,ifMode:"math",createAtom:a=>new hc(a.command.slice(1),ke(Ce({},a),{limits:"adjacent",isFunction:!0,variant:"main",variantStyle:"up"}))}),yt(["liminf","limsup"],"",{ifMode:"math",createAtom:a=>new hc({"\\liminf":"lim inf","\\limsup":"lim sup"}[a.command],ke(Ce({},a),{limits:"over-under",variant:"main"}))}),yt(["lim","mod"],"",{ifMode:"math",createAtom:a=>new hc(a.command.slice(1),ke(Ce({},a),{limits:"over-under",variant:"main"}))}),yt(["det","max","min"],"",{ifMode:"math",isFunction:!0,createAtom:a=>new hc(a.command.slice(1),ke(Ce({},a),{limits:"over-under",isFunction:!0,variant:"main"}))}),yt(["ang"],"{:math}",{ifMode:"math",createAtom:a=>new Dn(ke(Ce({},a),{body:Ye(a.args[0])})),serialize:(a,y)=>`\\ang{${a.bodyToLatex(y)}}`,render:(a,y)=>{const b=a.createBox(y),E=b.caret;b.caret=void 0;const ee=new ir("\xB0",{style:ke(Ce({},a.style),{variant:"normal",variantStyle:"up"})});return new ir([b,ee],{type:"inner",isSelected:a.isSelected,caret:E})}}),yt("sqrt","[index:auto]{radicand:expression}",{ifMode:"math",createAtom:a=>new o0(ke(Ce({},a),{body:Ye(a.args[1]),index:a.args[0]?Ye(a.args[0]):void 0}))}),yt(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{:expression}{:expression}",{ifMode:"math",createAtom:a=>{const y=Ce({},a),b=a.command,E=a.args;switch(b){case"\\dfrac":case"\\frac":case"\\tfrac":y.hasBarLine=!0;break;case"\\atopfrac":y.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":y.hasBarLine=!1,y.leftDelim="(",y.rightDelim=")";break;case"\\cfrac":y.hasBarLine=!0,y.continuousFraction=!0;break;default:}switch(b){case"\\dfrac":case"\\dbinom":y.mathstyleName="displaystyle";break;case"\\tfrac":case"\\tbinom":y.mathstyleName="textstyle";break;default:}return new ou(E[0]?Ye(E[0]):[new Qr],E[1]?Ye(E[1]):[new Qr],y)},serialize:(a,y)=>{const b=a.aboveToLatex(y),E=a.belowToLatex(y);return/^[0-9]$/.test(b)&&/^[0-9]$/.test(E)?`${a.command}${b}${E}`:ra(a.command,b,E)}}),yt(["brace","brack"],"",{infix:!0,createAtom:a=>new ou(Ye(a.args[0]),Ye(a.args[1]),ke(Ce({},a),{hasBarLine:!1,leftDelim:a.command==="\\brace"?"\\lbrace":"\\lbrack",rightDelim:a.command==="\\brace"?"\\rbrace":"\\rbrack"})),serialize:(a,y)=>Si([a.aboveToLatex(y),a.command,a.belowToLatex(y)])}),yt(["over","atop","choose"],"",{infix:!0,createAtom:a=>{let y,b;const E=a.args;return a.command==="\\choose"&&(y="(",b=")"),new ou(Ye(E[0]),Ye(E[1]),ke(Ce({},a),{hasBarLine:a.command==="\\over",leftDelim:y,rightDelim:b}))},serialize:(a,y)=>Si([a.aboveToLatex(y),a.command,a.belowToLatex(y)])}),yt(["overwithdelims","atopwithdelims"],"{numer:auto}{denom:auto}{left-delim:delim}{right-delim:delim}",{infix:!0,createAtom:a=>{var y,b;const E=a.args;return new ou(Ye(E[0]),Ye(E[1]),ke(Ce({},a),{leftDelim:(y=E[2])!=null?y:".",rightDelim:(b=E[3])!=null?b:".",hasBarLine:!1}))},serialize:(a,y)=>`${a.aboveToLatex(y)} ${a.command}${a.leftDelim}${a.rightDelim}${a.belowToLatex(y)}`}),yt("pdiff","{numerator}{denominator}",{ifMode:"math",createAtom:a=>new ou(Ye(a.args[0]),Ye(a.args[1]),ke(Ce({},a),{hasBarLine:!0,numerPrefix:"\u2202",denomPrefix:"\u2202"}))}),yt(["sum","prod","bigcup","bigcap","coprod","bigvee","bigwedge","biguplus","bigotimes","bigoplus","bigodot","bigsqcup","intop"],"",{ifMode:"math",createAtom:a=>new hf({coprod:"\u2210",bigvee:"\u22C1",bigwedge:"\u22C0",biguplus:"\u2A04",bigcap:"\u22C2",bigcup:"\u22C3",intop:"\u222B",prod:"\u220F",sum:"\u2211",bigotimes:"\u2A02",bigoplus:"\u2A01",bigodot:"\u2A00",bigsqcup:"\u2A06",smallint:"\u222B"}[a.command.slice(1)],ke(Ce({},a),{limits:"auto",variant:"main"}))}),yt("smallint","",{ifMode:"math",createAtom:a=>new hc("\u222B",ke(Ce({},a),{limits:"adjacent",variant:"main"}))});var op={int:"\u222B",iint:"\u222C",iiint:"\u222D",oint:"\u222E",oiint:"\u222F",oiiint:"\u2230",intclockwise:"\u2231",varointclockwise:"\u2232",ointctrclockwise:"\u2233",intctrclockwise:"\u2A11",sqcup:"\u2294",sqcap:"\u2293",uplus:"\u228E",wr:"\u2240",amalg:"\u2A3F",Cap:"\u22D2",Cup:"\u22D3",doublecap:"\u22D2",doublecup:"\u22D3"};yt(Object.keys(op),"",{ifMode:"math",createAtom:a=>{const y=a.command,b=op[y.slice(1)];return new hf(b,ke(Ce({},a),{limits:"adjacent",variant:{"\u22D2":"ams","\u22D3":"ams"}[b]}))}}),yt(["Re","Im"],"",{ifMode:"math",createAtom:a=>new hc({"\\Re":"\u211C","\\Im":"\u2111"}[a.command],ke(Ce({},a),{limits:"adjacent",isFunction:!0,variant:"fraktur"}))}),yt("middle","{:delim}",{ifMode:"math",createAtom:a=>{var y;return new r0(ke(Ce({},a),{delim:(y=a.args[0])!=null?y:"|",size:1}))}}),yt("the","{:value}",{createAtom:a=>new Dn(ke(Ce({},a),{captureSelection:!0,verbatimLatex:null})),render:(a,y)=>{var b;const E=new Di({parent:y},a.style);let ee="";a.isSelected&&(ee+=" ML__selected");const re=E.evaluate(a.args[0]);return new ir(((b=Ma(re))!=null?b:"").split("").map(ae=>new ir(ae,{type:"ord",classes:ee,mode:a.mode,isSelected:a.isSelected,style:Ce({variant:"main"},a.style)})),{type:"lift",style:a.style,caret:a.caret,isSelected:a.isSelected,classes:ee}).wrap(E)},serialize:a=>{var y;return`\\the${(y=Ma(a.args[0]))!=null?y:"\\relax"}`}}),yt("mathtip","{:auto}{:math}",{createAtom:a=>new ff(ke(Ce({},a),{body:Ye(a.args[0]),tooltip:Ye(a.args[1]),content:"math"})),serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`\\texttip{${a.bodyToLatex(y)}}{${Dn.serialize([a.tooltip],ke(Ce({},y),{defaultMode:"math"}))}}`}),yt("texttip","{:auto}{:text}",{createAtom:a=>new ff(ke(Ce({},a),{body:Ye(a.args[0]),tooltip:Ye(a.args[1]),content:"text"})),serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`\\texttip{${a.bodyToLatex(y)}}{${Dn.serialize([a.tooltip],ke(Ce({},y),{defaultMode:"text"}))}}`}),yt("error","{:math}",{createAtom:a=>new Dn(ke(Ce({},a),{body:Ye(a.args[0])})),serialize:(a,y)=>`\\error{${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__error"})}),yt("ensuremath","{:math}",{createAtom:a=>new Dn(ke(Ce({},a),{body:Ye(a.args[0])})),serialize:(a,y)=>`${a.command}{${a.bodyToLatex(ke(Ce({},y),{defaultMode:"math"}))}}`}),yt("color","{:value}",{applyStyle:(a,y,b)=>{var E,ee;return{verbatimColor:(E=Ma(y[0]))!=null?E:void 0,color:b.toColor((ee=y[0])!=null?ee:{string:"red"})}}}),yt("textcolor","{:value}{content:auto*}",{applyStyle:(a,y,b)=>{var E,ee;return{verbatimColor:(E=Ma(y[0]))!=null?E:void 0,color:b.toColor((ee=y[0])!=null?ee:{string:"red"})}}}),yt("boxed","{content:math}",{createAtom:a=>new ba(ke(Ce({},a),{body:Ye(a.args[0]),framecolor:{string:"black"}}))}),yt("colorbox","{:value}{:text*}",{applyStyle:(a,y,b)=>{var E,ee;return{verbatimBackgroundColor:(E=Ma(y[0]))!=null?E:void 0,backgroundColor:b.toBackgroundColor((ee=y[0])!=null?ee:{string:"yellow"})}}}),yt("fcolorbox","{frame-color:value}{background-color:value}{content:text}",{applyMode:"text",createAtom:a=>{var y,b;return new ba(ke(Ce({},a),{body:Ye(a.args[2]),framecolor:(y=a.args[0])!=null?y:{string:"blue"},backgroundcolor:(b=a.args[1])!=null?b:{string:"yellow"}}))},serialize:(a,y)=>{var b,E;return y.skipStyles?a.bodyToLatex(ke(Ce({},y),{defaultMode:"text"})):ra(a.command,(b=Ma(a.framecolor))!=null?b:"",(E=Ma(a.backgroundcolor))!=null?E:"",a.bodyToLatex(ke(Ce({},y),{defaultMode:"text"})))}}),yt("bbox","[:bbox]{body:auto}",{createAtom:a=>{var y;const b=a.args[0],E=Ye(a.args[1]);return b?new ba(ke(Ce({},a),{body:E,padding:b.padding,border:b.border,backgroundcolor:(y=b.backgroundcolor)!=null?y:void 0})):new ba(ke(Ce({},a),{body:E}))},serialize:(a,y)=>{var b,E;if(y.skipStyles)return a.bodyToLatex(y);let ee=a.command;if(Number.isFinite(a.padding)||a.border!==void 0||a.backgroundcolor!==void 0){const re=[];a.padding&&re.push((b=Ma(a.padding))!=null?b:""),a.border&&re.push(`border: ${a.border}`),a.backgroundcolor&&re.push((E=Ma(a.backgroundcolor))!=null?E:""),ee+=`[${re.join(",")}]`}return ra(ee,a.bodyToLatex(y))}}),yt(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"],"{:rest}",{createAtom:a=>new Dn(ke(Ce({},a),{body:Ye(a.args[0])})),render:(a,y)=>{const b=new Di({parent:y,mathstyle:a.command.slice(1)},a.style),E=Dn.createBox(b,a.body,{type:"lift"});return a.caret&&(E.caret=a.caret),a.bind(y,E)},serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`{${Si([a.command,a.bodyToLatex(y)])}}`}),yt(["tiny","scriptsize","footnotesize","small","normalsize","large","Large","LARGE","huge","Huge"],"",{applyStyle:a=>({fontSize:{"\\tiny":1,"\\scriptsize":2,"\\footnotesize":3,"\\small":4,"\\normalsize":5,"\\large":6,"\\Large":7,"\\LARGE":8,"\\huge":9,"\\Huge":10}[a]})}),yt("fontseries","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontSeries:(b=y[0])!=null?b:"auto"}}}),yt("fontshape","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontShape:(b=y[0])!=null?b:"auto"}}}),yt("fontfamily","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontFamily:(b=y[0])!=null?b:"roman"}}}),yt("selectfont","",{ifMode:"text",applyStyle:()=>({})}),yt("bf","{:rest}",{applyStyle:()=>({fontSeries:"b",fontShape:"n",fontFamily:"roman"})}),yt(["boldsymbol","bm"],"{:math}",{applyMode:"math",createAtom:a=>new Dn(ke(Ce({},a),{body:Ye(a.args[0])})),serialize:(a,y)=>`${a.command}{${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__boldsymbol"})}),yt("bold","{:math*}",{applyMode:"math",applyStyle:()=>({variantStyle:"bold"})}),yt("bfseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),yt("mdseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),yt("upshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),yt("slshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),yt("scshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),yt("textbf","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),yt("textmd","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),yt("textup","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),yt("textnormal","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n",fontSeries:"m"})}),yt("textsl","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),yt("textit","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"it"})}),yt("textsc","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),yt("textrm","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"roman"})}),yt("textsf","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"sans-serif"})}),yt("texttt","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"monospace"})}),yt("mathbf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"bold"})}),yt("mathit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"italic"})}),yt("mathnormal","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"italic"})}),yt("mathbfit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"bolditalic"})}),yt("mathrm","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"up"})}),yt("mathsf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"sans-serif",variantStyle:"up"})}),yt("mathtt","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"monospace",variantStyle:"up"})}),yt("it","{:rest}",{applyStyle:()=>({fontSeries:"m",fontShape:"it",fontFamily:"roman",variantStyle:"italic"})}),yt("rmfamily","",{applyStyle:()=>({fontFamily:"roman"})}),yt("sffamily","",{applyStyle:()=>({fontFamily:"sans-serif"})}),yt("ttfamily","",{applyStyle:()=>({fontFamily:"monospace"})}),yt(["Bbb","mathbb"],"{:math*}",{applyStyle:()=>({variant:"double-struck",variantStyle:"up"})}),yt(["frak","mathfrak"],"{:math*}",{applyStyle:()=>({variant:"fraktur",variantStyle:"up"})}),yt("mathcal","{:math*}",{applyStyle:()=>({variant:"calligraphic",variantStyle:"up"})}),yt("mathscr","{:math*}",{applyStyle:()=>({variant:"script",variantStyle:"up"})}),yt("mbox","{:text}",{ifMode:"math",createAtom:a=>new Dn(ke(Ce({},a),{type:"mord",body:Ye(a.args[0]),mode:"math"})),serialize:(a,y)=>ra("\\mbox",a.bodyToLatex(ke(Ce({},y),{defaultMode:"text"})))}),yt("text","{:text}",{ifMode:"math",applyMode:"text"}),yt(["class","htmlClass"],"{name:string}{content:auto}",{createAtom:a=>new Dn(ke(Ce({},a),{body:Ye(a.args[1])})),serialize:(a,y)=>!a.args[0]||y.skipStyles?a.bodyToLatex(y):`${a.command}{${a.args[0]}}{${a.bodyToLatex(y)}}`,render:(a,y)=>{var b;return a.createBox(y,{classes:(b=a.args[0])!=null?b:""})}}),yt(["cssId","htmlId"],"{id:string}{content:auto}",{createAtom:a=>new Dn(ke(Ce({},a),{body:Ye(a.args[1])})),serialize:(a,y)=>{var b;return!((b=a.args)!=null&&b[0])||y.skipStyles?a.bodyToLatex(y):`${a.command}{${a.args[0]}}{${a.bodyToLatex(y)}}`},render:(a,y)=>{var b;const E=a.createBox(y);return E.cssId=(b=a.args[0])!=null?b:"",E}}),yt("htmlData","{data:string}{content:auto}",{createAtom:a=>new Dn(ke(Ce({},a),{body:Ye(a.args[1])})),serialize:(a,y)=>{var b;return!((b=a.args)!=null&&b[0])||y.skipStyles?a.bodyToLatex(y):`\\htmlData{${a.args[0]}}{${a.bodyToLatex(y)}}`},render:(a,y)=>{var b;const E=a.createBox(y);return E.htmlData=(b=a.args[0])!=null?b:"",E}}),yt(["style","htmlStyle"],"{data:string}{content:auto}",{createAtom:a=>new Dn(ke(Ce({},a),{body:Ye(a.args[1])})),serialize:(a,y)=>{var b;return!((b=a.args)!=null&&b[0])||y.skipStyles?a.bodyToLatex(y):`${a.command}{${a.args[0]}}{${a.bodyToLatex(y)}}`},render:(a,y)=>{var b;const E=a.createBox(y);return E.htmlStyle=(b=a.args[0])!=null?b:"",E}}),yt("em","{:rest}",{createAtom:a=>new Dn(ke(Ce({},a),{body:Ye(a.args[0])})),serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`{\\em ${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__emph",boxType:"lift"})}),yt("emph","{:auto}",{createAtom:a=>new Dn(ke(Ce({},a),{body:Ye(a.args[1])})),serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`\\emph{${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__emph",boxType:"lift"})});var sp={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};yt(["bigl","Bigl","biggl","Biggl","bigr","Bigr","biggr","Biggr","bigm","Bigm","biggm","Biggm","big","Big","bigg","Bigg"],"{:delim}",{createAtom:a=>{var y;return new i0(ke(Ce({},a),{delim:(y=a.args[0])!=null?y:".",size:sp[a.command].size,delimType:sp[a.command].mclass}))}}),yt(["hspace","hspace*"],"{width:value}",{createAtom:a=>{var y;return new hd(ke(Ce({},a),{width:(y=a.args[0])!=null?y:{dimension:0}}))}}),yt(["mkern","kern","mskip","hskip","mspace"],"{width:value}",{createAtom:a=>{var y;return new hd(ke(Ce({},a),{width:(y=a.args[0])!=null?y:{dimension:0}}))}}),yt("mathchoice","{:math}{:math}{:math}{:math}",{createAtom:a=>new Dn(a),render:(a,y)=>{let b=0;const E=y.mathstyle.id;(E===sc||E===Is)&&(b=1),(E===ul||E===io)&&(b=2),(E===Io||E===Ha)&&(b=3);const ee=Ye(a.args[b]);return Dn.createBox(y,ee)},serialize:(a,y)=>`\\mathchoice{${Dn.serialize(a.args[0],y)}}{${Dn.serialize(a.args[1],y)}}{${Dn.serialize(a.args[2],y)}}{${Dn.serialize(a.args[3],y)}}`}),yt("mathop","{:auto}",{createAtom:a=>new Dn(ke(Ce({},a),{type:"mop",body:Ye(a.args[0]),limits:"over-under",isFunction:!0,captureSelection:!0})),render:(a,y)=>{var b;let E=Dn.createBox(y,a.body);if(a.superscript||a.subscript){const ee=(b=a.subsupPlacement)!=null?b:"auto";E=ee==="over-under"||ee==="auto"&&y.isDisplayStyle?a.attachLimits(y,{base:E}):a.attachSupsub(y,{base:E})}return new ir(a.bind(y,E),{type:"op",isSelected:a.isSelected,classes:"op-group"})},serialize:(a,y)=>{const b=[ra(a.command,a.bodyToLatex(y))];return a.explicitSubsupPlacement&&(a.subsupPlacement==="over-under"&&b.push("\\limits"),a.subsupPlacement==="adjacent"&&b.push("\\nolimits"),a.subsupPlacement==="auto"&&b.push("\\displaylimits")),b.push(a.supsubToLatex(y)),Si(b)}}),yt(["mathbin","mathrel","mathopen","mathclose","mathpunct","mathord","mathinner"],"{:auto}",{createAtom:a=>new Dn(ke(Ce({},a),{type:{"\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[a.command],body:Ye(a.args[0])}))}),yt(["operatorname","operatorname*"],"{operator:math}",{createAtom:a=>{const y=Ye(a.args[0]).map(b=>{var E;return b.type!=="first"&&(b.type="mord",b.value=(E={"\u2217":"*","\u2212":"-"}[b.value])!=null?E:b.value,b.isFunction=!1,!b.style.variant&&!b.style.variantStyle&&(b.style.variant="main",b.style.variantStyle="up")),b});return new Dn(ke(Ce({},a),{type:"mop",body:y,isFunction:!0,limits:a.command==="\\operatorname"?"adjacent":"over-under"}))},render:(a,y)=>{var b;let E=Dn.createBox(y,a.body);if(a.superscript||a.subscript){const ee=(b=a.subsupPlacement)!=null?b:"auto";E=ee==="over-under"||ee==="auto"&&y.isDisplayStyle?a.attachLimits(y,{base:E}):a.attachSupsub(y,{base:E})}return a.caret&&(E.caret=a.caret),new ir(a.bind(y,E),{type:"op",isSelected:a.isSelected,classes:"op-group"})},serialize:(a,y)=>{const b=[ra(a.command,a.bodyToLatex(y))];return a.explicitSubsupPlacement&&(a.subsupPlacement==="over-under"&&b.push("\\limits"),a.subsupPlacement==="adjacent"&&b.push("\\nolimits"),a.subsupPlacement==="auto"&&b.push("\\displaylimits")),b.push(a.supsubToLatex(y)),Si(b)}}),yt(["char","unicode"],"{charcode:value}",{createAtom:a=>new Dn(ke(Ce({},a),{type:a.mode==="text"?"text":"mord"})),serialize:a=>{var y;return`${a.command}${Ma((y=a.args[0])!=null?y:{number:10067,base:"hexadecimal"})}`},render:(a,y)=>{let b=y.evaluate(a.args[0]);return(!b||!("number"in b))&&(b={number:10067,base:"hexadecimal"}),a.value=String.fromCodePoint(b.number),a.createBox(y)}}),yt("rule","[raise:value]{width:value}{thickness:value}",{createAtom:a=>new Dn(a),render:(a,y)=>{var b,E,ee;const re=new Di({parent:y,mathstyle:"textstyle"},a.style),ae=re.toEm((b=a.args[0])!=null?b:{dimension:0}),ue=re.toEm((E=a.args[1])!=null?E:{dimension:10}),he=re.toEm((ee=a.args[2])!=null?ee:{dimension:10}),ge=new ir(null,{classes:"rule",type:"ord"});return ge.width=ue,ge.height=he+ae,ge.depth=-ae,ge.setStyle("border-right-width",ue,"em"),ge.setStyle("border-top-width",he,"em"),ge.setStyle("border-color",a.style.color),ge.setStyle("vertical-align",ae,"em"),a.isSelected&&ge.setStyle("opacity","50%"),a.bind(re,ge),a.caret&&(ge.caret=a.caret),ge.wrap(y)},serialize:a=>`\\rule${a.args[0]?`[${Ma(a.args[0])}]`:""}{${Ma(a.args[1])}}{${Ma(a.args[2])}}`}),yt(["overline","underline"],"{:auto}",{createAtom:a=>new Dn(ke(Ce({},a),{body:Ye(a.args[0])})),render:(a,y)=>{const b=a.command.substring(1),E=new Di({parent:y,mathstyle:"cramp"},a.style),ee=Dn.createBox(E,a.body);if(!ee)return null;const re=E.metrics.defaultRuleThickness/E.scalingFactor,ae=new ir(null,{classes:b+"-line"});ae.height=re,ae.maxFontSize=re*1.125*E.scalingFactor;let ue;return b==="overline"?ue=new Yi({shift:0,children:[{box:ee},3*re,{box:ae},re]}):ue=new Yi({top:ee.height,children:[re,{box:ae},3*re,{box:ee}]}),a.caret&&(ue.caret=a.caret),new ir(ue,{classes:b,type:"ignore"})}}),yt("overset","{:auto}{base:auto}",{createAtom:a=>{const y=Ye(a.args[1]);return new qo(ke(Ce({},a),{above:Ye(a.args[0]),body:y,skipBoundary:!1,boxType:El(y)}))},serialize:(a,y)=>ra(a.command,a.aboveToLatex(y),a.bodyToLatex(y))}),yt("underset","{:auto}{base:auto}",{createAtom:a=>{const y=Ye(a.args[1]);return new qo(ke(Ce({},a),{below:Ye(a.args[0]),body:y,skipBoundary:!1,boxType:El(y)}))},serialize:(a,y)=>ra(a.command,a.belowToLatex(y),a.bodyToLatex(y))}),yt("overunderset","{above:auto}{below:auto}{base:auto}",{createAtom:a=>{const y=Ye(a.args[2]);return new qo(ke(Ce({},a),{above:Ye(a.args[0]),below:Ye(a.args[1]),body:y,skipBoundary:!1,boxType:El(y)}))},serialize:(a,y)=>ra(a.command,a.belowToLatex(y),a.bodyToLatex(y))}),yt(["stackrel","stackbin"],"[below:auto]{above:auto}{base:auto}",{createAtom:a=>new qo(ke(Ce({},a),{body:Ye(a.args[2]),above:Ye(a.args[1]),below:Ye(a.args[0]),skipBoundary:!1,boxType:a.command==="\\stackrel"?"rel":"bin"})),serialize:(a,y)=>ra(a.command,a.aboveToLatex(y),a.bodyToLatex(y))}),yt("smash","[:string]{:auto}",{createAtom:a=>{var y,b,E,ee;return new dd(ke(Ce({},a),{body:Ye(a.args[1]),smashHeight:(b=(y=a.args[0])==null?void 0:y.includes("t"))!=null?b:!0,smashDepth:(ee=(E=a.args[0])==null?void 0:E.includes("b"))!=null?ee:!0}))}}),yt(["vphantom"],"{:auto}",{createAtom:a=>new dd(ke(Ce({},a),{body:Ye(a.args[0]),isInvisible:!0,smashWidth:!0}))}),yt(["hphantom"],"{:auto}",{createAtom:a=>new dd(ke(Ce({},a),{body:Ye(a.args[0]),isInvisible:!0,smashHeight:!0,smashDepth:!0}))}),yt(["phantom"],"{:auto}",{createAtom:a=>new dd(ke(Ce({},a),{body:Ye(a.args[0]),isInvisible:!0}))}),yt("not","{:math}",{createAtom:a=>{const y=Ye(a.args[0]);return y.length===0?new Dn(ke(Ce({},a),{type:"mrel",value:"\uE020"})):new Dn(ke(Ce({},a),{body:[new dc(ke(Ce({},a),{body:"\uE020",align:"right"})),...y],captureSelection:!0}))},serialize:(a,y)=>{const b=a.args[0],E=b&&typeof b=="object"&&"group"in b;return a.value!=="\uE020"?E?`\\not{${Dn.serialize(b.group,y)}}`:`\\not${Dn.serialize(b,y)}`:E?"\\not{}":"\\not"},render:(a,y)=>{if(a.value)return a.createBox(y);const E=a.args[0]&&typeof a.args[0]=="object"&&"group"in a.args[0]?"ord":El(Ye(a.args[0])),ee=Dn.createBox(y,a.body,{type:E});return a.caret&&(ee.caret=a.caret),a.bind(y,ee)}}),yt(["ne","neq"],"",{createAtom:a=>new Dn(ke(Ce({},a),{type:"mrel",body:[new dc(ke(Ce({},a),{body:"\uE020",align:"right",boxType:"rel"})),new Dn(ke(Ce({},a),{value:"="}))],captureSelection:!0})),serialize:a=>a.command}),yt("rlap","{:auto}",{createAtom:a=>new dc(ke(Ce({},a),{body:Ye(a.args[0]),align:"right"}))}),yt("llap","{:auto}",{createAtom:a=>new dc(ke(Ce({},a),{body:Ye(a.args[0]),align:"left"}))}),yt("mathrlap","{:math}",{createAtom:a=>new dc(ke(Ce({},a),{body:Ye(a.args[0]),align:"left"}))}),yt("mathllap","{:math}",{createAtom:a=>new dc(ke(Ce({},a),{body:Ye(a.args[0]),align:"left"}))}),yt("raisebox","{:value}{:text}",{createAtom:a=>{var y;return new ba(ke(Ce({},a),{body:Ye(a.args[1]),padding:{dimension:0},offset:(y=a.args[0])!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b;return ra("\\raisebox",(b=Ma(a.offset))!=null?b:"0pt",a.bodyToLatex(y))}}),yt("raise","{:value}{:auto}",{createAtom:a=>{var y;return new ba(ke(Ce({},a),{body:Ye(a.args[1]),padding:{dimension:0},offset:(y=a.args[0])!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b;return ra("\\raise",(b=Ma(a.offset))!=null?b:"0pt",a.bodyToLatex(y))}}),yt("lower","{:value}{:auto}",{createAtom:a=>{var y;return new ba(ke(Ce({},a),{body:Ye(a.args[1]),padding:{dimension:0},offset:(y=Xo(a.args[0],-1))!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b,E;return ra("\\lower",(E=Ma(Xo((b=a.offset)!=null?b:{dimension:0},-1)))!=null?E:"0pt",a.bodyToLatex(y))}}),Ke("0123456789/@.?!"),Dt(65,90),Dt(97,122),Ke([["\\forall",8704],["\\exists",8707],["\\nexists",8708,"mord","ams"],["\\mid",8739,"mrel"],["\\top",8868],["\\bot",8869]]),Ke([["\\#",35],["\\&",38],["\\parallelogram",9649],["\\spadesuit",9824],["\\heartsuit",9825],["\\diamondsuit",9826],["\\clubsuit",9827],["\\flat",9837],["\\natural",9838],["\\sharp",9839]]),Ke([["\\backslash",92],["\\nabla",8711],["\\partial",8706],["\\ell",8467],["\\hbar",8463],["\\Q",81,"mord","double-struck"],["\\C",67,"mord","double-struck"],["\\P",80,"mord","double-struck"],["\\pounds",163],["\\euro",8364]]),Ke([["\\rightarrow",8594],["\\to",8594],["\\leftarrow",8592],["\\gets",8592],["\\Rightarrow",8658],["\\Leftarrow",8656],["\\longrightarrow",10230],["\\longleftarrow",10229],["\\Longrightarrow",10233],["\\implies",10233],["\\Longleftarrow",10232],["\\impliedby",10232],["\\longleftrightarrow",10231],["\\biconditional",10231],["\\Longleftrightarrow",10234],["\\mapsto",8614],["\\longmapsto",10236],["\\uparrow",8593],["\\downarrow",8595],["\\Uparrow",8657],["\\Downarrow",8659],["\\updownarrow",8597],["\\Updownarrow",8661],["\\hookrightarrow",8618],["\\hookleftarrow",8617],["\\rightharpoonup",8640],["\\leftharpoonup",8636],["\\rightharpoondown",8641],["\\leftharpoondown",8637],["\\searrow",8600],["\\nearrow",8599],["\\swarrow",8601],["\\nwarrow",8598],["\\originalof",8886],["\\laplace",8886],["\\imageof",8887],["\\Laplace",8887]],"mrel"),Ke([["\\mapsfrom",8612,"mrel"],["\\Mapsfrom",10502,"mrel"],["\\MapsTo",10503,"mrel"],["\\Yup",8516,"mord"],["\\lightning",8623,"mrel"],["\\leftarrowtriangle",8701,"mrel"],["\\rightarrowtriangle",8702,"mrel"],["\\leftrightarrowtriangle",8703,"mrel"],["\\boxdot",8865,"mbin"],["\\bigtriangleup",9651,"mbin"],["\\bigtriangledown",9661,"mbin"],["\\boxbar",9707,"mbin"],["\\Lbag",10181,"mopen"],["\\Rbag",10182,"mclose"],["\\llbracket",10214,"mopen"],["\\rrbracket",10215,"mclose"],["\\longmapsfrom",10235,"mrel"],["\\Longmapsfrom",10237,"mrel"],["\\Longmapsto",10238,"mrel"],["\\boxslash",10692,"mbin"],["\\boxbslash",10693,"mbin"],["\\boxast",10694,"mbin"],["\\boxcircle",10695,"mbin"],["\\boxbox",10696,"mbin"],["\\fatsemi",10783,"mop"],["\\leftslice",10918,"mrel"],["\\rightslice",10919,"mrel"],["\\interleave",10996,"mbin"],["\\biginterleave",11004,"mop"],["\\sslash",11005,"mbin"],["\\talloblong",11006,"mbin"]]),Ke([["\\lbrace",123,"mopen"],["\\rbrace",125,"mclose"],["\\lparen",40,"mopen"],["\\rparen",41,"mclose"],["\\langle",10216,"mopen"],["\\rangle",10217,"mclose"],["\\lfloor",8970,"mopen"],["\\rfloor",8971,"mclose"],["\\lceil",8968,"mopen"],["\\rceil",8969,"mclose"],["\\vert",8739],["\\lvert",8739,"mopen"],["\\rvert",8739,"mclose"],["\\|",8741],["\\Vert",8741],["\\mVert",8741],["\\lVert",8741,"mopen"],["\\rVert",8741,"mclose"],["\\lbrack",91,"mopen"],["\\rbrack",93,"mclose"],["\\{",123,"mopen"],["\\}",125,"mclose"],["(",40,"mopen"],[")",41,"mclose"],["[",91,"mopen"],["]",93,"mclose"],["\\ulcorner",9484,"mopen","ams"],["\\urcorner",9488,"mclose","ams"],["\\llcorner",9492,"mopen","ams"],["\\lrcorner",9496,"mclose","ams"],["\\lgroup",10222,"mopen"],["\\rgroup",10223,"mclose"],["\\lmoustache",9136,"mopen"],["\\rmoustache",9137,"mclose"]]),Ke([["\\dashrightarrow",8674],["\\dashleftarrow",8672],["\\Rrightarrow",8667],["\\Lleftarrow",8666],["\\leftrightarrows",8646],["\\rightleftarrows",8644],["\\curvearrowright",8631],["\\curvearrowleft",8630],["\\rightrightarrows",8649],["\\leftleftarrows",8647],["\\upuparrows",8648],["\\downdownarrows",8650],["\\vartriangle",9651],["\\triangleq",8796],["\\vartriangleleft",8882],["\\trianglelefteq",8884],["\\ntriangleleft",8938],["\\ntrianglelefteq",8940],["\\vartriangleright",8883],["\\trianglerighteq",8885],["\\ntriangleright",8939],["\\ntrianglerighteq",8941],["\\blacktriangleleft",9664],["\\blacktriangleright",9654],["\\leftarrowtail",8610],["\\rightarrowtail",8611],["\\looparrowright",8620],["\\looparrowleft",8619],["\\twoheadleftarrow",8606],["\\twoheadrightarrow",8608],["\\twoheadrightarrowtail",10518],["\\rightleftharpoons",8652],["\\leftrightharpoons",8651],["\\Rsh",8625],["\\Lsh",8624],["\\circlearrowright",8635],["\\circlearrowleft",8634],["\\restriction",8638],["\\upharpoonright",8638],["\\upharpoonleft",8639],["\\downharpoonright",8642],["\\downharpoonleft",8643],["\\rightsquigarrow",8669],["\\leadsto",8669],["\\leftrightsquigarrow",8621],["\\multimap",8888],["\\nleftarrow",8602],["\\nrightarrow",8603],["\\nRightarrow",8655],["\\nLeftarrow",8653],["\\nleftrightarrow",8622],["\\nLeftrightarrow",8654],["\\nvrightarrow",8696],["\\nvtwoheadrightarrow",10496],["\\nvrightarrowtail",10516],["\\nvtwoheadrightarrowtail",10519],["\\shortparallel",8741],["\\nless",8814],["\\nleqslant",57360],["\\lneq",10887],["\\lneqq",8808],["\\nleqq",57361],["\\lvertneqq",57356],["\\lnsim",8934],["\\lnapprox",10889],["\\nprec",8832],["\\npreceq",8928],["\\precnsim",8936],["\\precnapprox",10937],["\\nsim",8769],["\\nshortmid",57350],["\\nmid",8740],["\\nvdash",8876],["\\nvDash",8877],["\\ngtr",8815],["\\ngeqslant",57359],["\\ngeqq",57358],["\\gneq",10888],["\\gneqq",8809],["\\gvertneqq",57357],["\\gnsim",8935],["\\gnapprox",10890],["\\nsucc",8833],["\\nsucceq",8929],["\\succnsim",8937],["\\succnapprox",10938],["\\ncong",8774],["\\nshortparallel",57351],["\\nparallel",8742],["\\nVDash",8879],["\\nsupseteqq",57368],["\\supsetneq",8843],["\\varsupsetneq",57371],["\\supsetneqq",10956],["\\varsupsetneqq",57369],["\\nVdash",8878],["\\precneqq",10933],["\\succneqq",10934],["\\nsubseteqq",57366],["\\leqslant",10877],["\\geqslant",10878],["\\gtrsim",8819],["\\approxeq",8778],["\\thickapprox",8776],["\\lessapprox",10885],["\\gtrapprox",10886],["\\precapprox",10935],["\\succapprox",10936],["\\thicksim",8764],["\\succsim",8831],["\\precsim",8830],["\\backsim",8765],["\\eqsim",8770],["\\backsimeq",8909],["\\lesssim",8818],["\\nleq",8816],["\\ngeq",8817],["\\smallsmile",8995],["\\smallfrown",8994],["\\leqq",8806],["\\eqslantless",10901],["\\lll",8920],["\\lessgtr",8822],["\\lesseqgtr",8922],["\\lesseqqgtr",10891],["\\risingdotseq",8787],["\\fallingdotseq",8786],["\\subseteqq",10949],["\\Subset",8912],["\\sqsubset",8847],["\\preccurlyeq",8828],["\\curlyeqprec",8926],["\\vDash",8872],["\\Vvdash",8874],["\\bumpeq",8783],["\\Bumpeq",8782],["\\geqq",8807],["\\eqslantgtr",10902],["\\ggg",8921],["\\gtrless",8823],["\\gtreqless",8923],["\\gtreqqless",10892],["\\supseteqq",10950],["\\Supset",8913],["\\sqsupset",8848],["\\succcurlyeq",8829],["\\curlyeqsucc",8927],["\\Vdash",8873],["\\shortmid",8739],["\\between",8812],["\\pitchfork",8916],["\\varpropto",8733],["\\backepsilon",8717],["\\llless",8920],["\\gggtr",8921],["\\doteqdot",8785],["\\Doteq",8785],["\\eqcirc",8790],["\\circeq",8791],["\\therefore",8756],["\\because",8757]],"mrel","ams"),Ke([["+",43],["-",8722],["\u2212",8722],["\\pm",177],["\\mp",8723],["*",8727],["\\times",215],["\\div",247],["\\divides",8739],["\\cdot",8901],["\\cap",8745],["\\cup",8746],["\\setminus",8726],["\\land",8743],["\\wedge",8743],["\\lor",8744],["\\vee",8744],["\\circ",8728],["\\bigcirc",9711],["\\bullet",8729],["\\oplus",8853],["\\ominus",8854],["\\otimes",8855],["\\odot",8857],["\\oslash",8856],["\\bigtriangleup",9651],["\\bigtriangledown",9661],["\\triangleleft",9667],["\\triangleright",9657],["\\And",38],["\\dagger",8224],["\\dag",8224],["\\ddag",8225],["\\ddagger",8225],["\\ast",8727],["\\star",8902],["\\bigstar",9733],["\\diamond",8900]],"mbin"),Ke([["\\lhd",8882],["\\rhd",8883],["\\lessdot",8918],["\\gtrdot",8919],["\\ltimes",8905],["\\rtimes",8906],["\\leftthreetimes",8907],["\\rightthreetimes",8908],["\\intercal",8890],["\\dotplus",8724],["\\doublebarwedge",10846],["\\divideontimes",8903],["\\centerdot",8901],["\\smallsetminus",8726],["\\barwedge",8892],["\\veebar",8891],["\\nor",8891],["\\curlywedge",8911],["\\curlyvee",8910],["\\boxminus",8863],["\\boxplus",8862],["\\boxtimes",8864],["\\boxdot",8865],["\\circleddash",8861],["\\circledast",8859],["\\circledcirc",8858],["\\unlhd",8884],["\\unrhd",8885]],"mbin","ams"),Ke([["\\surd",8730],["\\infty",8734],["\\prime",8242],["\\doubleprime",8243],["\\angle",8736],["`",8216],["\\$",36],["\\%",37],["\\_",95],["\\alpha",945],["\\beta",946],["\\gamma",947],["\\delta",948],["\\epsilon",1013],["\\varepsilon",949],["\\zeta",950],["\\eta",951],["\\theta",952],["\\vartheta",977],["\\iota",953],["\\kappa",954],["\\varkappa",1008,"mord","ams"],["\\lambda",955],["\\mu",956],["\\nu",957],["\\xi",958],["\\omicron",111],["\\pi",960],["\\varpi",982],["\\rho",961],["\\varrho",1009],["\\sigma",963],["\\varsigma",962],["\\tau",964],["\\phi",981],["\\varphi",966],["\\upsilon",965],["\\chi",967],["\\psi",968],["\\omega",969],["\\Gamma",915],["\\Delta",916],["\\Theta",920],["\\Lambda",923],["\\Xi",926],["\\Pi",928],["\\Sigma",931],["\\Upsilon",933],["\\Phi",934],["\\Psi",936],["\\Omega",937],["\\digamma",989,"mord","ams"],["\\emptyset",8709]]),Ke([["=",61],["<",60],["\\lt",60],[">",62],["\\gt",62],["\\le",8804],["\\leq",8804],["\\ge",8805],["\\geq",8805],["\\ll",8810],["\\gg",8811],["\\coloneq",8788],["\\coloneqq",8788],["\\colonequals",8788],["\\measeq",8797],["\\eqdef",8798],["\\questeq",8799],[":",58],["\\cong",8773],["\\equiv",8801],["\\prec",8826],["\\preceq",10927],["\\succ",8827],["\\succeq",10928],["\\perp",8869],["\\propto",8733],["\\Colon",8759],["\\smile",8995],["\\frown",8994],["\\sim",8764],["\\doteq",8784],["\\bowtie",8904],["\\Join",8904],["\\asymp",8781],["\\sqsubseteq",8849],["\\sqsupseteq",8850],["\\approx",8776],["\\~",126],["\\leftrightarrow",8596],["\\Leftrightarrow",8660],["\\models",8872],["\\vdash",8866],["\\dashv",8867],["\\roundimplies",10608],["\\in",8712],["\\notin",8713],["\\ni",8715],["\\owns",8715],["\\subset",8834],["\\supset",8835],["\\subseteq",8838],["\\supseteq",8839],["\\differencedelta",8710],["\\mvert",8739],["\\parallel",8741],["\\simeq",8771]],"mrel"),Ke([["\\lnot",172],["\\neg",172],["\\triangle",9651],["\\subsetneq",8842],["\\varsubsetneq",57370],["\\subsetneqq",10955],["\\varsubsetneqq",57367],["\\nsubset",8836],["\\nsupset",8837],["\\nsubseteq",8840],["\\nsupseteq",8841]],"mrel","ams"),Ke([["\\wp",8472],["\\aleph",8501]]),Ke([["\\blacktriangle",9650],["\\hslash",8463],["\\Finv",8498],["\\Game",8513],["\\eth",240],["\\mho",8487],["\\Bbbk",107],["\\yen",165],["\\square",9633],["\\Box",9633],["\\blacksquare",9632],["\\circledS",9416],["\\circledR",174],["\\triangledown",9661],["\\blacktriangledown",9660],["\\checkmark",10003],["\\diagup",9585],["\\measuredangle",8737],["\\sphericalangle",8738],["\\backprime",8245],["\\backdoubleprime",8246],["\\Diamond",9674],["\\lozenge",9674],["\\blacklozenge",10731],["\\varnothing",8709],["\\complement",8705],["\\maltese",10016],["\\beth",8502],["\\daleth",8504],["\\gimel",8503]],"mord","ams"),Ke([["\\ ",160],["~",160]],"space"),yt(["!",",",":",";",">","enskip","enspace","quad","qquad"],"",{createAtom:a=>new hd(a)}),yt("space","",{createAtom:a=>new hd(a)}),Ke([["\\colon",58],["\\cdotp",8901],["\\vdots",8942,"mord"],["\\ldotp",46],[",",44],[";",59]],"mpunct"),Ke([["\\cdots",8943],["\\ddots",8945],["\\ldots",8230],["\\mathellipsis",8230]],"minner"),Ke([["\\/",47],["|",8739,"mord"],["\\imath",305],["\\jmath",567],["\\degree",176],["'",8242],['"',8221]]);var lp="<mo>&#x2061;</mo>",Gh="<mo>&#8290;</mo>";function Xh(a){return a.replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Qi(a,y){return!a||!y.generateID?"":` extid="${a}"`}function Mv(a,y,b){var E,ee,re,ae,ue,he,ge,be,Be,He,lt;let xt=!1;y=y!=null?y:a.atoms.length;let vn="",nr="",fn=a.atoms[a.index];const Rn=(ee=(E=fn.style)==null?void 0:E.variant)!=null?ee:"",cr=(ae=(re=fn.style)==null?void 0:re.variantStyle)!=null?ae:"";let Fn="";if(Rn||cr){const Jr=pn(fn.value,(ue=fn.style)==null?void 0:ue.variant,(he=fn.style)==null?void 0:he.variantStyle);if(Jr!==fn.value)return a.index+=1,vn=`<mi${Qi(fn.id,b)}>${Jr}</mi>`,ml(vn,a,b)||(a.mathML+=vn,a.lastType="mi"),!0;Fn=(ge={upnormal:"normal",boldnormal:"bold",italicmain:"italic",bolditalicmain:"bold-italic","updouble-struck":"double-struck","double-struck":"double-struck",boldfraktur:"bold-fraktur",calligraphic:"script",upcalligraphic:"script",script:"script",boldscript:"bold-script",boldcalligraphic:"bold-script",fraktur:"fraktur","upsans-serif":"sans-serif","boldsans-serif":"bold-sans-serif","italicsans-serif":"sans-serif-italic","bolditalicsans-serif":"sans-serif-bold-italic",monospace:"monospace"}[cr+Rn])!=null?ge:"",Fn=` mathvariant="${Fn}"`}const Hr={"\\exponentialE":"&#x02147;","\\imaginaryI":"&#x2148;","\\differentialD":"&#x2146;","\\capitalDifferentialD":"&#x2145;","\\alpha":"&#x03b1;","\\pi":"&#x03c0;","\\infty":"&#x221e;","\\forall":"&#x2200;","\\nexists":"&#x2204;","\\exists":"&#x2203;","\\hbar":"\u210F","\\cdotp":"\u22C5","\\ldots":"\u2026","\\cdots":"\u22EF","\\ddots":"\u22F1","\\vdots":"\u22EE","\\ldotp":"."};if(fn.command==="!")return a.index+=1,vn="<mo>!</mo>",ml(vn,a,b)||(a.mathML+=vn,a.lastType="mo"),!0;if(Hr[fn.command]){a.index+=1;let Jr=`<mi${Qi(fn.id,b)}${Fn}>${Hr[fn.command]}</mi>`;return(a.lastType==="mi"||a.lastType==="mn"||a.lastType==="mtext"||a.lastType==="fence")&&(Jr=Gh+Jr),ml(Jr,a,b)||(a.mathML+=Jr,a.lastType="mi"),!0}if(fn.command==="\\operatorname")nr=vu(fn.body),a.index+=1;else if(Rn||cr)for(;a.index<y&&(fn.type==="mord"||fn.type==="macro")&&!fn.isDigit()&&Rn===((Be=(be=fn.style)==null?void 0:be.variant)!=null?Be:"")&&cr===((lt=(He=fn.style)==null?void 0:He.variantStyle)!=null?lt:"");)nr+=vu([fn]),a.index+=1,fn=a.atoms[a.index];else(fn.type==="mord"||fn.type==="macro")&&!fn.isDigit()&&(nr+=vu([fn]),a.index+=1);if(nr.length>0){xt=!0,vn=`<mi${Fn}>${nr}</mi>`;const Jr=a.lastType;vn.endsWith(">f</mi>")||vn.endsWith(">g</mi>")?(vn+=lp,a.lastType="applyfunction"):a.lastType=/^<mo>(.*)<\/mo>$/.test(vn)?"mo":"mi",ml(vn,a,b)||((Jr==="mi"||Jr==="mn"||Jr==="mtext"||Jr==="fence")&&(vn=Gh+vn),a.mathML+=vn)}return xt}function _v(a){return a.index<a.atoms.length&&a.atoms[a.index].superscript&&a.atoms[a.index].type==="subsup"}function kv(a){let y=-1,b=a.index,E=!1,ee=!1;for(;b<a.atoms.length&&!E&&!ee;){const re=a.atoms[b];E=!re.isDigit(),ee=!E&&re.superscript!==void 0,b++}return ee&&(y=b-1),y}function ml(a,y,b){var E;let ee=y.atoms[y.index-1];if(!ee)return!1;if(!ee.superscript&&!ee.subscript)if(((E=y.atoms[y.index])==null?void 0:E.type)==="subsup")ee=y.atoms[y.index],y.index+=1;else return!1;const re=y.lastType;y.lastType="";const ae=Ni(ee.superscript,b);y.lastType="";const ue=Ni(ee.subscript,b);if(y.lastType=re,!ae&&!ue)return!1;let he="";return ae&&ue?he=`<msubsup>${a}${ue}${ae}</msubsup>`:ae?he=`<msup>${a}${ae}</msup>`:ue&&(he=`<msub>${a}${ue}</msub>`),y.mathML+=he,y.lastType="",!0}function Ev(a,y,b){y=y!=null?y:a.atoms.length;const E=a.index;let ee="";for(;a.index<y&&a.atoms[a.index].mode==="text";)ee+=a.atoms[a.index].value?a.atoms[a.index].value:" ",a.index+=1;return ee.length>0?(a.mathML+=`<mtext ${Qi(a.atoms[E].id,b)}>${ee}</mtext>`,a.lastType="mtext",!0):!1}function Lv(a,y,b){y=y!=null?y:a.atoms.length;const E=a.index;let ee="",re=kv(a);for(re>=0&&re<y&&(y=re);a.index<y&&a.atoms[a.index].isDigit();)ee+=a.atoms[a.index].asDigit(),a.index+=1;return ee.length<=0?!1:(ee="<mn"+Qi(a.atoms[E].id,b)+">"+ee+"</mn>",re<0&&_v(a)&&(re=a.index,a.index+=1),ml(ee,a,b)||(a.mathML+=ee,a.lastType="mn"),!0)}function Dv(a,y,b){let E=!1;y=y!=null?y:a.atoms.length;let ee="",re="";if(a.index<y&&a.atoms[a.index].type==="mopen"){let ae=!1,ue=0;const he=a.index;let ge=-1,be=he+1;for(;be<y&&!ae;)a.atoms[be].type==="mopen"?ue+=1:a.atoms[be].type==="mclose"&&(ue-=1),ue===-1&&(ae=!0,ge=be),be+=1;ae&&(ee="<mrow>",ee+=Sc(a.atoms[he],b),ee+=Ni(a.atoms,b,he+1,ge),ee+=Sc(a.atoms[ge],b),ee+="</mrow>",a.index=ge+1,(a.lastType==="mi"||a.lastType==="mn"||a.lastType==="mfrac"||a.lastType==="fence")&&(a.mathML+=Gh),ml(ee,a,b)&&(E=!0,a.lastType="",ee=""),re="fence")}return ee.length>0&&(E=!0,a.mathML+=ee,a.lastType=re),E}function Av(a,y,b){let E=!1;y=y!=null?y:a.atoms.length;let ee="",re="";const ae=a.atoms[a.index];if(!ae)return!1;const ue={"\\ne":"&ne;","\\neq":"&neq;","\\pm":"&#177;","\\times":"&#215;","\\colon":":","\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lbrack":"[","\\rbrack":"]","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"};if(ue[ae.command]){a.index+=1;const he=`<mo${Qi(ae.id,b)}>${ue[ae.command]}</mo>`;return ml(he,a,b)||(a.mathML+=he,a.lastType="mo"),!0}if(a.index<y&&(ae.type==="mbin"||ae.type==="mrel"))ee+=Wf(a.atoms[a.index],b),a.index+=1,re="mo";else if(a.index<y&&(ae.type==="mop"||ae.type==="operator"||ae.type==="extensible-symbol")){if(ae.subsupPlacement==="over-under"&&(ae.superscript||ae.subscript)){const he=Sc(ae,b);return ae.superscript&&ae.subscript?(ee+="<munderover>"+he,ee+=Ni(ae.subscript,b),ee+=Ni(ae.superscript,b),ee+="</munderover>"):ae.superscript?(ee+="<mover>"+he,ee+=Ni(ae.superscript,b),ee+="</mover>"):ae.subscript&&(ee+="<munder>"+he,ee+=Ni(ae.subscript,b),ee+="</munder>"),a.mathML+=ee,a.lastType="mo",a.index+=1,!0}{const he=a.atoms[a.index],ge=he.value==="\\operatorname",be=ge?'<mi class="MathML-Unit"'+Qi(he.id,b)+">"+vu(he.value)+"</mi>":Sc(he,b);ee+=be,!ge&&!/^<mo>(.*)<\/mo>$/.test(be)?(ee+=lp,re="applyfunction"):re=ge?"mi":"mo"}(a.lastType==="mi"||a.lastType==="mn")&&!/^<mo>(.*)<\/mo>$/.test(ee)&&(ee=Gh+ee),a.index+=1}return ee.length>0&&(E=!0,ml(ee,a,b)||(a.mathML+=ee,a.lastType=re)),E}function Ni(a,y,b,E){y!=null||(y={});const ee={atoms:[],index:b!=null?b:0,mathML:"",lastType:""};if(typeof a=="number"||typeof a=="boolean")ee.mathML=a.toString();else if(typeof a=="string")ee.mathML=a;else if(a instanceof Dn)ee.mathML=Wf(a,y);else if(Array.isArray(a)){ee.atoms=a;let re=0;for(E=E||(a?a.length:0);ee.index<E;)if(Ev(ee,E,y)||Lv(ee,E,y)||Mv(ee,E,y)||Av(ee,E,y)||Dv(ee,E,y))re+=1;else if(ee.index<E){let ae=Wf(ee.atoms[ee.index],y);ee.lastType==="mn"&&ae.length>0&&ee.atoms[ee.index].type==="genfrac"&&(ae="<mo>&#x2064;</mo>"+ae),ee.atoms[ee.index].type==="genfrac"?ee.lastType="mfrac":ee.lastType="",ee.index+=1,ml(ae,ee,y)?re+=1:ae.length>0&&(ee.mathML+=ae,re+=1)}re>1&&(ee.mathML="<mrow>"+ee.mathML+"</mrow>")}return ee.mathML}function Sc(a,y){let b="";const E=vu(a.value);return E&&(b="<mo"+Qi(a.id,y)+">"+E+"</mo>"),b}function vu(a){if(!a)return"";if(typeof a=="string")return Xh(a);if(!Array.isArray(a)&&typeof a.body=="string")return Xh(a.body);let y="";for(const b of a)typeof b.value=="string"&&(y+=b.value);return Xh(y)}function Wf(a,y){var b,E,ee,re,ae,ue,he,ge,be,Be,He,lt,xt,vn,nr,fn,Rn,cr,Fn,Hr,Jr,jr;if(a.mode==="text")return`<mi${Qi(a.id,y)}>${a.value}</mi>`;const Ti={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",longleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",longrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",longrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xleftrightarrows:"\u21C4",xRightleftharpoons:"\u21CC",longRightleftharpoons:"\u21CC",xLeftrightharpoons:"\u21CB",longLeftrightharpoons:"\u21CB"},Ui={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\>":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let xr="",Wo="",js,Qo,Ua,Zo,_o,ea;const{command:wa}=a;if(a.command==="\\error")return`<merror${Qi(a.id,y)}>${Ni(a.body,y)}</merror>`;const Ga={"\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\lbrack":"[","\\rbrack":"]","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"},Vs={"\\vec":"&#x20d7;","\\acute":"&#x00b4;","\\grave":"&#x0060;","\\dot":"&#x02d9;","\\ddot":"&#x00a8;","\\tilde":"&#x007e;","\\bar":"&#x00af;","\\breve":"&#x02d8;","\\check":"&#x02c7;","\\hat":"&#x005e;"};switch(a.type){case"first":break;case"group":case"root":xr=Ni(a.body,y);break;case"array":if((a.leftDelim&&a.leftDelim!=="."||a.rightDelim&&a.rightDelim!==".")&&(xr+="<mrow>",a.leftDelim&&a.leftDelim!=="."&&(xr+="<mo>"+(Ga[a.leftDelim]||a.leftDelim)+"</mo>")),xr+="<mtable",a.colFormat){for(xr+=' columnalign="',Ua=0;Ua<a.colFormat.length;Ua++)a.colFormat[Ua].align&&(xr+={l:"left",c:"center",r:"right"}[a.colFormat[Ua].align]+" ");xr+='"'}for(xr+=">",Qo=0;Qo<a.array.length;Qo++){for(xr+="<mtr>",js=0;js<a.array[Qo].length;js++)xr+="<mtd>"+Ni(a.array[Qo][js],y)+"</mtd>";xr+="</mtr>"}xr+="</mtable>",(a.leftDelim&&a.leftDelim!=="."||a.rightDelim&&a.rightDelim!==".")&&(a.rightDelim&&a.rightDelim!=="."&&(xr+="<mo>"+(Ga[a.leftDelim]||a.rightDelim)+"</mo>"),xr+="</mrow>");break;case"genfrac":(a.leftDelim||a.rightDelim)&&(xr+="<mrow>"),a.leftDelim&&a.leftDelim!=="."&&(xr+="<mo"+Qi(a.id,y)+">"+(Ga[a.leftDelim]||a.leftDelim)+"</mo>"),a.hasBarLine?(xr+="<mfrac>",xr+=Ni(a.above,y)||"<mi>&nbsp;</mi>",xr+=Ni(a.below,y)||"<mi>&nbsp;</mi>",xr+="</mfrac>"):(xr+="<mtable"+Qi(a.id,y)+">",xr+="<mtr>"+Ni(a.above,y)+"</mtr>",xr+="<mtr>"+Ni(a.below,y)+"</mtr>",xr+="</mtable>"),a.rightDelim&&a.rightDelim!=="."&&(xr+="<mo"+Qi(a.id,y)+">"+(Ga[a.rightDelim]||a.rightDelim)+"</mo>"),(a.leftDelim||a.rightDelim)&&(xr+="</mrow>");break;case"surd":a.hasEmptyBranch("above")?(xr+="<msqrt"+Qi(a.id,y)+">",xr+=Ni(a.body,y),xr+="</msqrt>"):(xr+="<mroot"+Qi(a.id,y)+">",xr+=Ni(a.body,y),xr+=Ni(a.above,y),xr+="</mroot>");break;case"leftright":const Us=a,Gs=Us.leftDelim;xr="<mrow>",Gs&&Gs!=="."&&(xr+=`<mo${Qi(a.id,y)}>${(b=Ga[Gs])!=null?b:Gs}</mo>`),a.body&&(xr+=Ni(a.body,y));const Xs=Us.matchingRightDelim();Xs&&Xs!=="."&&(xr+=`<mo${Qi(a.id,y)}>${(E=Ga[Xs])!=null?E:Xs}</mo>`),xr+="</mrow>";break;case"sizeddelim":case"delim":xr+=`<mo${Qi(a.id,y)}>${Ga[a.value]||a.value}</mo>`;break;case"accent":xr+='<mover accent="true"'+Qi(a.id,y)+">",xr+=Ni(a.body,y),xr+="<mo>"+(Vs[wa]||a.accent)+"</mo>",xr+="</mover>";break;case"line":case"overlap":break;case"overunder":_o=a.above,Zo=a.below,(a.svgAbove||_o)&&(a.svgBelow||Zo)?ea=a.body:_o&&_o.length>0?(ea=a.body,(re=(ee=a.body)==null?void 0:ee[0])!=null&&re.below?(Zo=a.body[0].below,ea=a.body[0].body):((ue=(ae=a.body)==null?void 0:ae[0])==null?void 0:ue.type)==="first"&&((ge=(he=a.body)==null?void 0:he[1])!=null&&ge.below)&&(Zo=a.body[1].below,ea=a.body[1].body)):Zo&&Zo.length>0&&(ea=a.body,(Be=(be=a.body)==null?void 0:be[0])!=null&&Be.above?(_o=a.body[0].above,ea=a.body[0].body):((lt=(He=a.body)==null?void 0:He[0])==null?void 0:lt.type)==="first"&&((vn=(xt=a.body)==null?void 0:xt[1])!=null&&vn.above)&&(_o=a.body[1].overscript,ea=a.body[1].body)),(a.svgAbove||_o)&&(a.svgBelow||Zo)?(xr+=`<munderover ${Qi(a.id,y)}>`,xr+=(nr=Ti[a.svgBody])!=null?nr:Ni(ea,y),xr+=(fn=Ti[a.svgBelow])!=null?fn:Ni(Zo,y),xr+=(Rn=Ti[a.svgAbove])!=null?Rn:Ni(_o,y),xr+="</munderover>"):a.svgAbove||_o?(xr+=`<mover ${Qi(a.id,y)}>`+((cr=Ti[a.svgBody])!=null?cr:Ni(ea,y)),xr+=(Fn=Ti[a.svgAbove])!=null?Fn:Ni(_o,y),xr+="</mover>"):(a.svgBelow||Zo)&&(xr+=`<munder ${Qi(a.id,y)}>`+((Hr=Ti[a.svgBody])!=null?Hr:Ni(ea,y)),xr+=(Jr=Ti[a.svgBelow])!=null?Jr:Ni(Zo,y),xr+="</munder>");break;case"placeholder":xr+="?";break;case"mord":{xr=typeof a.value=="string"?a.value:wa,wa==="\\char"?xr="&#x"+("000000"+a.args[0].number.toString(16)).slice(-4)+";":xr.length>0&&xr.startsWith("\\")&&(typeof a.value=="string"&&a.value.charCodeAt(0)>255?xr="&#x"+("000000"+a.value.charCodeAt(0).toString(16)).slice(-4)+";":typeof a.value=="string"?xr=a.value.charAt(0):(console.error("Did not expect this"),xr=""));const ws=/\d/.test(xr)?"mn":"mi";xr=`<${ws}${Qi(a.id,y)}>${Xh(xr)}</${ws}>`;break}case"mbin":case"mrel":case"minner":xr=Sc(a,y);break;case"mpunct":xr='<mo separator="true"'+Qi(a.id,y)+">"+wa+"</mo>";break;case"mop":case"operator":case"extensible-symbol":a.body!=="\u200B"&&(xr="<mo"+Qi(a.id,y)+">",xr+=wa==="\\operatorname"?a.body:wa||a.body,xr+="</mo>");break;case"box":xr='<menclose notation="box"',a.backgroundcolor&&(xr+=' mathbackground="'+a.backgroundcolor+'"'),xr+=Qi(a.id,y)+">"+Ni(a.body,y)+"</menclose>";break;case"spacing":xr+='<mspace width="'+((jr=Ui[wa])!=null?jr:0)+'em"/>';break;case"enclose":xr='<menclose notation="';for(const ws in a.notation)Object.prototype.hasOwnProperty.call(a.notation,ws)&&a.notation[ws]&&(xr+=Wo+ws,Wo=" ");xr+=Qi(a.id,y)+'">'+Ni(a.body,y)+"</menclose>";break;case"prompt":xr='<menclose notation="roundexbox""">'+Ni(a.body,y)+"</menclose>";break;case"space":xr+="&nbsp;";break;case"subsup":break;case"phantom":break;case"composition":break;case"rule":break;case"chem":break;case"mopen":xr+=Sc(a,y);break;case"mclose":xr+=Sc(a,y);break;case"macro":{const ws=a.command+vu(a.macroArgs);ws&&(xr+=`<mo ${Qi(a.id,y)}>${ws}</mo>`)}break;case"latexgroup":xr+=Ni(a.body,y);break;case"latex":xr+="<mtext"+Qi(a.id,y)+">"+a.value+"</mtext>";break;case"tooltip":xr+=Ni(a.body,y);break;case"text":xr+=`<mtext ${Qi(a.id,y)}x>${a.value}</mtext>`;break;default:if(a.command==="\\displaystyle")return`<mrow ${Qi(a.id,y)} displaystyle="true">${Ni(a.body,y)}</mrow>`;if(a.command==="\\textstyle")return`<mrow ${Qi(a.id,y)} displaystyle="false">${Ni(a.body,y)}</mrow>`;console.info("Unexpected element in conversion to MathML:",a)}return xr}var yu={"\\alpha":"alpha ","\\mu":"mew ","\\sigma":"sigma ","\\pi":"pie ","\\imaginaryI":"imaginary eye ","\\imaginaryJ":"imaginary jay ","\\sum":"Summation ","\\prod":"Product ","+":"plus ","-":"minus ",";":'<break time="150ms"/> semi-colon <break time="150ms"/>',",":'<break time="150ms"/> comma <break time="150ms"/>',"|":'<break time="150ms"/>Vertical bar<break time="150ms"/>',"(":'<break time="150ms"/>Open paren. <break time="150ms"/>',")":'<break time="150ms"/> Close paren. <break time="150ms"/>',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\pm":"plus or minus","\\mp":"minus or plus","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","\\ne":"is not equal to ","\\neq":"is not equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","\u200B":"","\u2212":"minus ",":":'<break time="150ms"/> such that <break time="200ms"/> ',"\\colon":'<break time="150ms"/> such that <break time="200ms"/> ',"\\hbar":"etch bar ","\\iff":'<break time="200ms"/>if, and only if, <break time="200ms"/>',"\\Longleftrightarrow":'<break time="200ms"/>if, and only if, <break time="200ms"/>',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set <break time="150ms"/><say-as interpret-as="character">n</say-as>',"\\C":'the set <break time="150ms"/><say-as interpret-as="character">c</say-as>',"\\Z":'the set <break time="150ms"/><say-as interpret-as="character">z</say-as>',"\\Q":'the set <break time="150ms"/><say-as interpret-as="character">q</say-as>',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdot":"times ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lparen":'<break time="150ms"/>open paren<break time="150ms"/>',"\\rparen":'<break time="150ms"/>close paren<break time="150ms"/>',"\\lbrace":'<break time="150ms"/>open brace<break time="150ms"/>',"\\{":'<break time="150ms"/>open brace<break time="150ms"/>',"\\rbrace":'<break time="150ms"/>close brace<break time="150ms"/>',"\\}":'<break time="150ms"/>close brace<break time="150ms"/>',"\\langle":'<break time="150ms"/>left angle bracket<break time="150ms"/>',"\\rangle":'<break time="150ms"/>right angle bracket<break time="150ms"/>',"\\lfloor":'<break time="150ms"/>open floor<break time="150ms"/>',"\\rfloor":'<break time="150ms"/>close floor<break time="150ms"/>',"\\lceil":'<break time="150ms"/>open ceiling<break time="150ms"/>',"\\rceil":'<break time="150ms"/>close ceiling<break time="150ms"/>',"\\vert":'<break time="150ms"/>vertical bar<break time="150ms"/>',"\\mvert":'<break time="150ms"/>divides<break time="150ms"/>',"\\lvert":'<break time="150ms"/>left vertical bar<break time="150ms"/>',"\\rvert":'<break time="150ms"/>right vertical bar<break time="150ms"/>',"\\lbrack":'<break time="150ms"/> open square bracket <break time="150ms"/>',"\\rbrack":'<break time="150ms"/> close square bracket <break time="150ms"/>',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"},Zf={array:"array",matrix:"matrix",pmatrix:"parenthesis matrix",bmatrix:"square brackets matrix",Bmatrix:"braces matrix",vmatrix:"bars matrix",Vmatrix:"double bars matrix","matrix*":"matrix",smallmatrix:"small matrix"};function Tv(a){let y="";return a.startsWith("\\")&&(y=" "+a.replace("\\","")+" "),y}function Ed(a){let y=0;if(Oe(a))for(const b of a)b.type!=="first"&&(y+=1);return y===1}function Pv(a){if(Oe(a)){for(const y of a)if(y.type!=="first"&&y.id)return y.id.toString()}return""}function cp(a){let y="";if(Oe(a))for(const b of a)b.type!=="first"&&typeof b.value=="string"&&(y+=b.value);return y}function Iv(a){return a?a.map(y=>y.value).join(""):""}function Li(a,y){var b,E,ee,re,ae;function ue(be){return window.MathfieldElement.textToSpeechMarkup?/[a-z]/.test(be)?` <say-as interpret-as="character">${be}</say-as>`:/[A-Z]/.test(be)?`capital <say-as interpret-as="character">${be.toLowerCase()}</say-as>`:be:/[a-z]/.test(be)?" '"+be.toUpperCase()+"'":/[A-Z]/.test(be)?" 'capital "+be.toUpperCase()+"'":be}function he(be){return"<emphasis>"+be+"</emphasis>"}if(!y)return"";let ge="";if(Oe(y)){let be=!1,Be=!1;for(let He=0;He<y.length;He++)y[He].type!=="first"&&(y[He].mode!=="text"&&(Be=!1),He<y.length-2&&y[He].type==="mopen"&&y[He+2].type==="mclose"&&y[He+1].type==="mord"?(ge+=" of ",ge+=he(Li(a,y[He+1])),He+=2):y[He].mode==="text"?Be?ge+=(b=y[He].value)!=null?b:" ":(Be=!0,ge+=Li("text",y[He])):y[He].isDigit()?be?ge+=y[He].asDigit():(be=!0,ge+=Li(a,y[He])):(be=!1,ge+=Li(a,y[He])))}else if(y.mode==="text")y.id&&a==="math"&&(ge+='<mark name="'+y.id.toString()+'"/>'),ge+=y.value;else{y.id&&a==="math"&&(ge+='<mark name="'+y.id.toString()+'"/>');let be="",Be="",He="",lt=!1;const{command:xt}=y;switch(xt){case"\\vec":return"vector "+Li(a,y.body);case"\\acute":return Li(a,y.body)+" acute";case"\\grave":return Li(a,y.body)+" grave";case"\\dot":return"dot over"+Li(a,y.body);case"\\ddot":return"double dot over"+Li(a,y.body);case"\\mathring":return"ring over"+Li(a,y.body);case"\\tilde":case"\\widetilde":return"tilde over"+Li(a,y.body);case"\\bar":return Li(a,y.body)+" bar";case"\\breve":return Li(a,y.body)+" breve";case"\\check":case"\\widecheck":return"check over "+Li(a,y.body);case"\\hat":case"\\widehat":return"hat over"+Li(a,y.body);case"\\overarc":case"\\overparen":case"\\wideparen":return"arc over "+Li(a,y.body);case"\\underarc":case"\\underparen":return"arc under "+Li(a,y.body)}switch(y.type){case"prompt":const vn=y.body.length>1?'start input . <break time="500ms"/> '+Li(a,y.body)+'. <break time="500ms"/> end input':"blank";ge+=' <break time="300ms"/> '+vn+'. <break time="700ms"/>'+((E=y.correctness)!=null?E:"")+' . <break time="700ms"/> ';break;case"array":const nr=y.array,fn=y.environmentName;if(Object.keys(Zf).includes(fn)){ge+=` begin ${Zf[fn]} `;for(let Fn=0;Fn<nr.length;Fn++){Fn>0&&(ge+=","),ge+=` row ${Fn+1} `;for(let Hr=0;Hr<nr[Fn].length;Hr++)Hr>0&&(ge+=","),ge+=` column ${Hr+1}: `,ge+=Li("math",nr[Fn][Hr])}ge+=` end ${Zf[fn]} `}break;case"group":xt==="\\ne"?ge+=" not equal ":(xt==="\\not"&&(ge+=" not "),ge+=Li("math",y.body));break;case"root":ge+=Li("math",y.body);break;case"genfrac":if(be=Li("math",y.above),Be=Li("math",y.below),Ed(y.above)&&Ed(y.below)){const Hr={"1/2":" half ","1/3":" one third ","2/3":" two third","1/4":" one quarter ","3/4":" three quarter ","1/5":" one fifth ","2/5":" two fifths ","3/5":" three fifths ","4/5":" four fifths ","1/6":" one sixth ","5/6":" five sixths ","1/8":" one eight ","3/8":" three eights ","5/8":" five eights ","7/8":" seven eights ","1/9":" one ninth ","2/9":" two ninths ","4/9":" four ninths ","5/9":" five ninths ","7/9":" seven ninths ","8/9":" eight ninths "}[cp(y.above)+"/"+cp(y.below)];Hr?ge=Hr:ge+=be+" over "+Be}else ge+=' the fraction <break time="150ms"/>'+be+' over <break time="150ms"/>'+Be+'.<break time="150ms"/> End fraction.<break time="150ms"/>';break;case"surd":if(He=Li("math",y.body),y.hasEmptyBranch("above"))ge+=Ed(y.body)?" the square root of "+He+" , ":' the square root of <break time="200ms"/>'+He+'. <break time="200ms"/> End square root';else{let Fn=Li("math",y.above);Fn=Fn.trim();const Hr=Fn.replace(/<mark([^/]*)\/>/g,"");Hr==="3"?ge+=' the cube root of <break time="200ms"/>'+He+'. <break time="200ms"/> End cube root':Hr==="n"?ge+=' the nth root of <break time="200ms"/>'+He+'. <break time="200ms"/> End root':ge+=' the root with index: <break time="200ms"/>'+Fn+', of <break time="200ms"/>'+He+'. <break time="200ms"/> End root'}break;case"leftright":{const Fn=y;ge+=(ee=Fn.leftDelim?yu[Fn.leftDelim]:void 0)!=null?ee:Fn.leftDelim,ge+=Li("math",y.body),ge+=(re=Fn.rightDelim?yu[Fn.rightDelim]:void 0)!=null?re:Fn.rightDelim}break;case"rule":break;case"overunder":break;case"overlap":break;case"macro":const Rn=xt.replace(/^\\/g,""),cr=Jn()[Rn];cr&&(cr!=null&&cr.expand?ge+=Li("math",y.body):ge+=`${Rn} `);break;case"placeholder":ge+="placeholder ";break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":{if(xt==="\\mathbin"||xt==="\\mathrel"||xt==="\\mathopen"||xt==="\\mathclose"||xt==="\\mathpunct"||xt==="\\mathord"||xt==="\\mathinner"){ge=Li(a,y.body);break}let Fn=y.isDigit()?y.asDigit():y.value,Hr=y.command;if((y.type==="delim"||y.type==="sizeddelim")&&(Hr=y.value,Fn=Hr),a==="text")ge+=Fn;else{if(y.type==="mbin"&&(ge+='<break time="150ms"/>'),Fn){const Jr=yu[Fn]||(Hr?yu[Hr.trim()]:"");if(Jr)ge+=" "+Jr;else{const jr=Hr?Tv(Hr.trim()):"";ge+=jr||ue(Fn)}}else ge+=Li("math",y.body);y.type==="mbin"&&(ge+='<break time="150ms"/>')}break}case"mop":case"operator":case"extensible-symbol":if(y.value!=="\u200B"){const Fn=y.command;if(Fn==="\\sum")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let Hr=Li("math",y.superscript);Hr=Hr.trim();let Jr=Li("math",y.subscript);Jr=Jr.trim(),ge+=' the summation from <break time="200ms"/>'+Jr+'<break time="200ms"/> to <break time="200ms"/>'+Hr+'<break time="200ms"/> of <break time="150ms"/>',lt=!0}else if(y.hasEmptyBranch("subscript"))ge+=" the summation of";else{let Hr=Li("math",y.subscript);Hr=Hr.trim(),ge+=' the summation from <break time="200ms"/>'+Hr+'<break time="200ms"/> of <break time="150ms"/>',lt=!0}else if(Fn==="\\prod")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let Hr=Li("math",y.superscript);Hr=Hr.trim();let Jr=Li("math",y.subscript);Jr=Jr.trim(),ge+=' the product from <break time="200ms"/>'+Jr+'<break time="200ms"/> to <break time="200ms"/>'+Hr+'<break time="200ms"/> of <break time="150ms"/>',lt=!0}else if(y.hasEmptyBranch("subscript"))ge+=" the product of ";else{let Hr=Li("math",y.subscript);Hr=Hr.trim(),ge+=' the product from <break time="200ms"/>'+Hr+'<break time="200ms"/> of <break time="150ms"/>',lt=!0}else if(Fn==="\\int")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let Hr=Li("math",y.superscript);Hr=Hr.trim();let Jr=Li("math",y.subscript);Jr=Jr.trim(),ge+=' the integral from <break time="200ms"/>'+he(Jr)+'<break time="200ms"/> to <break time="200ms"/>'+he(Hr)+' <break time="200ms"/> of ',lt=!0}else ge+=' the integral of <break time="200ms"/> ';else if(typeof y.value=="string"){const Hr=(ae=yu[y.value])!=null?ae:y.command?yu[y.command]:void 0;ge+=Hr||" "+y.value}else y.command&&(y.command==="\\mathop"?ge+=Li("math",y.body):y.command==="\\operatorname"?ge+=Iv(y.body):ge+=y.command.startsWith("\\")?" "+y.command.slice(1):" "+y.command)}break;case"enclose":He=Li("math",y.body),ge+=" crossed out "+He+". End crossed out.";break;case"space":case"spacing":break}if(!lt&&!y.hasEmptyBranch("superscript")){let vn=Li(a,y.superscript);vn=vn.trim();const nr=vn.replace(/<[^>]*>/g,"");if(Ed(y.superscript)){if(a==="math"){const fn=Pv(y.superscript);fn&&(ge+='<mark name="'+fn+'"/>')}nr==="\u2032"?ge+=" prime ":nr==="2"?ge+=" squared ":nr==="3"?ge+=" cubed ":Number.isNaN(Number.parseInt(nr))?ge+=" to the "+vn+"; ":ge+=' to the <say-as interpret-as="ordinal">'+nr+"</say-as> power; "}else Number.isNaN(Number.parseInt(nr))?ge+=" raised to the "+vn+"; ":ge+=' raised to the <say-as interpret-as="ordinal">'+nr+"</say-as> power; "}if(!lt&&!y.hasEmptyBranch("subscript")){let vn=Li("math",y.subscript);vn=vn.trim(),ge+=Ed(y.subscript)?" sub "+vn:" subscript "+vn+". End subscript. "}}return ge}function bu(a){var y,b;if(window.MathfieldElement.textToSpeechRules==="sre"&&("sre"in window||"SRE"in window)){const ee=Ni(a);if(ee){window.MathfieldElement.textToSpeechMarkup&&(window.MathfieldElement.textToSpeechRulesOptions=(y=window.MathfieldElement.textToSpeechRulesOptions)!=null?y:{},window.MathfieldElement.textToSpeechRulesOptions=ke(Ce({},window.MathfieldElement.textToSpeechRulesOptions),{markup:window.MathfieldElement.textToSpeechMarkup}),window.MathfieldElement.textToSpeechRulesOptions.markup==="ssml"&&(window.MathfieldElement.textToSpeechRulesOptions=ke(Ce({},window.MathfieldElement.textToSpeechRulesOptions),{markup:"ssml_step"})),window.MathfieldElement.textToSpeechRulesOptions=ke(Ce({},window.MathfieldElement.textToSpeechRulesOptions),{rate:window.MathfieldElement.speechEngineRate}));const re=(b=window.SRE)!=null?b:window.sre.System.getInstance();window.MathfieldElement.textToSpeechRulesOptions&&re.setupEngine(window.MathfieldElement.textToSpeechRulesOptions);let ae="";try{ae=re.toSpeech(ee)}catch(ue){console.error("MathLive 0.98.5: `SRE.toSpeech()` runtime error",ue)}return ae}return""}let E=Li("math",a);if(window.MathfieldElement.textToSpeechMarkup==="ssml"){let ee="";window.MathfieldElement.speechEngineRate&&(ee='<prosody rate="'+window.MathfieldElement.speechEngineRate+'">'),E='<?xml version="1.0"?><speak version="1.1" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US"><amazon:auto-breaths>'+ee+"<p><s>"+E+"</s></p>"+(ee?"</prosody>":"")+"</amazon:auto-breaths></speak>"}else window.MathfieldElement.textToSpeechMarkup==="mac"&&st()==="macos"?E=E.replace(/<mark([^/]*)\/>/g,"").replace(/<emphasis>/g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(/<break time="(\d*)ms"\/>/g,"[[slc $1]]").replace(/<say-as[^>]*>/g,"").replace(/<\/say-as>/g,""):E=E.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return E}var Ld={"\\ne":"\u2260","\\neq":"\u2260","\u2212":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega","\\exponentialE":"e","\\imaginaryI":"i","\\imaginaryJ":"j","\\!":" ","\\,":" ","\\:":" ","\\>":" ","\\;":" ","\\enskip":" ","\\enspace":" ","\\qquad":" ","\\quad":" ","\\infty":"oo"},Dd={"\\pm":"+-","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrack":"[","\\rbrack":"]","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"(:","\\rangle":":)","\\sum":" sum ","\\prod":" prod ","\\bigcap":" nnn ","\\bigcup":" uuu ","\\int":" int ","\\oint":" oint ","\\ge":">=","\\le":"<=","\\ne":"!=","\\neq":"!=","\\lt":"<","\\gt":">","\\gets":"<-","\\to":"->","\\land":" and ","\\lor":" or ","\\lnot":" not ","\\forall":" AA ","\\exists":" EE ","\\in":" in ","\\notin":" !in ","\\mapsto":"|->","\\implies":"=>","\\iff":"<=>","\\cdot":"*","\\ast":"**","\\star":"***","\\times":"xx","\\div":"-:","\\ltimes":"|><","\\rtimes":"><|","\\bowtie":"|><|","\\circ":"@"};function Bv(a){let y="";for(const b of a){const E=y[y.length-1];E!==void 0&&/\d/.test(E)&&/^\d/.test(b)&&(y+=" "),y+=b}return y}function xa(a){var y,b,E,ee,re,ae,ue,he,ge,be,Be,He,lt;if(!a)return"";if(Oe(a)){if(a.length===0)return"";if(a[0].mode==="latex")return a.map(xa).join("");if(a[0].mode==="text"){let cr=0,Fn="";for(;((y=a[cr])==null?void 0:y.mode)==="text";)Fn+=a[cr].body?xa(a[cr].body):a[cr].value,cr++;return`"${Fn}" ${xa(a.slice(cr))}`}let fn=0;const Rn=[];for(;a[fn]&&a[fn].mode==="math";){let cr="";for(;a[fn]&&a[fn].type==="mord"&&/\d/.test(a[fn].value);)cr+=a[fn++].value;cr?Rn.push(cr):Rn.push(xa(a[fn++]))}return Rn.push(xa(a.slice(fn))),Bv(Rn)}if(a.mode==="text")return`"${a.value}"`;let xt="";const{command:vn}=a;let nr;if(vn==="\\placeholder")return`(${xa(a.body)})`;switch(a.type){case"accent":const fn={"\\vec":"vec","\\dot":"dot","\\ddot":"ddot","\\bar":"bar","\\hat":"hat","\\acute":"acute;","\\grave":"grave","\\tilde":"tilde","\\breve":"breave","\\check":"check"}[vn];xt=`${fn!=null?fn:""} ${xa(a.body)} `;break;case"first":return"";case"latexgroup":return a.body.map(jr=>jr.value).join("");case"group":case"root":xt=(b=Ld[vn])!=null?b:xa(a.body);break;case"genfrac":{const jr=a;(jr.leftDelim||jr.rightDelim)&&(xt=jr.leftDelim==="."||!jr.leftDelim?"{:":jr.leftDelim),jr.hasBarLine?(xt+="(",xt+=xa(jr.above),xt+=")/(",xt+=xa(jr.below),xt+=")"):(xt+="("+xa(jr.above)+"),",xt+="("+xa(jr.below)+")"),(jr.leftDelim||jr.rightDelim)&&(xt+=jr.rightDelim==="."||!jr.rightDelim?"{:":jr.rightDelim)}break;case"surd":xt+=a.hasEmptyBranch("above")?"sqrt("+xa(a.body)+")":"root("+xa(a.above)+")("+xa(a.body)+")";break;case"latex":xt=a.value;break;case"leftright":{const jr=a,Ti=jr.leftDelim;xt+=Ti==="."||!Ti?"{:":Ti,xt+=xa(jr.body);const Ui=jr.matchingRightDelim();xt+=Ui==="."||!Ui?":}":Ui}break;case"sizeddelim":case"delim":xt=a.value;break;case"overlap":break;case"overunder":break;case"mord":xt=(ee=(E=Ld[vn])!=null?E:vn)!=null?ee:typeof a.value=="string"?a.value:"",xt.startsWith("\\")&&(xt+=" "),nr=vn?vn.match(/{?\\char"([\dabcdefABCDEF]+)}?/):null,nr?xt=String.fromCodePoint(Number.parseInt("0x"+nr[1])):xt.length>0&&xt.startsWith("\\")&&(xt=typeof a.value=="string"?a.value.charAt(0):a.command),xt=Ov(xt,a.style);break;case"mbin":case"mrel":case"minner":xt=(ae=(re=Ld[vn])!=null?re:Dd[vn])!=null?ae:a.value;break;case"mopen":case"mclose":xt=a.value;break;case"mpunct":xt=(ue=Dd[vn])!=null?ue:vn;break;case"mop":case"operator":case"extensible-symbol":a.value!=="\u200B"&&(Dd[vn]?xt=Dd[vn]:xt=vn==="\\operatorname"?xa(a.body):(he=a.value)!=null?he:vn,xt+=" ");break;case"array":const Rn=a.array,cr=a.environmentName,Fn=(ge={bmatrix:["[","]"],"bmatrix*":["[","]"]}[cr])!=null?ge:["(",")"],Hr=[];for(const jr of Rn){const Ti=[];for(const Ui of jr)Ti.push(Fn[0]+xa(Ui)+Fn[1]);Hr.push(Ti.join(","))}const Jr=(be={bmatrix:["[","]"],"bmatrix*":["[","]"],cases:["{",":}"]}[cr])!=null?be:["(",")"];xt=Jr[0]+Hr.join(",")+Jr[1];break;case"box":break;case"spacing":xt=(Be=Ld[vn])!=null?Be:" ";break;case"enclose":xt="("+xa(a.body)+")";break;case"space":xt=" ";break;case"subsup":xt="";break;case"macro":xt=(lt=(He=Ld[vn])!=null?He:Dd[vn])!=null?lt:xa(a.body);break}if(!a.hasEmptyBranch("subscript")){xt+="_";const fn=xa(a.subscript);xt+=fn.length!==1?`(${fn})`:fn}if(!a.hasEmptyBranch("superscript")){xt+="^";const fn=xa(a.superscript);xt+=fn.length!==1?`(${fn})`:fn}return xt}function Ov(a,y){if(!y)return a;let b=a;return y.variant==="double-struck"&&(b=`bbb "${b}"`),y.variant==="script"&&(b=`cc "${b}"`),y.variant==="fraktur"&&(b=`fr "${b}"`),y.variant==="sans-serif"&&(b=`sf "${b}"`),y.variant==="monospace"&&(b=`tt "${b}"`),y.variantStyle==="bold"&&(b=`bb "${b}"`),y.color?`color({${y.color}})(${b})`:b}function Va(a,y){var b,E;y!=null||(y={}),y.mathstyle=(b=y.mathstyle)!=null?b:"displaystyle";const ee=new Di({from:ke(Ce({},Qc()),{renderPlaceholder:()=>new ir(160,{maxFontSize:1}),letterShapeStyle:(E=y==null?void 0:y.letterShapeStyle)!=null?E:"tex"}),mathstyle:y.mathstyle}),ae=new Dn({mode:"math",type:"root",body:ja(a,{context:ee,parseMode:"math",mathstyle:y.mathstyle})}).render(ee);return ae?(Yc(fd(ae,ee)),qc(ae,{classes:"ML__latex"}).toMarkup()):""}function E1(a){return t0(a,{context:Qc()})}function Rv(a,y={}){return Ni(ja(a,{parseMode:"math",args:()=>"",mathstyle:"displaystyle"}),y)}function Nv(a){const y=ja(a,{parseMode:"math",mathstyle:"displaystyle"});return bu(y)}var Yh;function $v(a){var y,b;if(!Yh){const E=(y=globalThis[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:y.ComputeEngine;E?Yh=new E:console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`)}return(b=Yh==null?void 0:Yh.box(a).latex)!=null?b:""}function L1(a,y="math"){return xa(new Dn({type:"root",body:ja(a,{parseMode:y})}))}function D1(a){return uc(a,{format:"ascii-math"})[1]}function jf(a){if(typeof a=="string"){const y=Fv(a);if(!y)throw new Error(`Invalid color: ${a}`);return y}return"C"in a?Kv(a):"a"in a?up(a):a}function xu(a){return a<0?0:a>255?255:Math.round(a)}function Fv(a){if(!a||a[0]!=="#")return;a=a.slice(1);let y;return a.length<=4?(y={r:parseInt(a[0]+a[0],16),g:parseInt(a[1]+a[1],16),b:parseInt(a[2]+a[2],16)},a.length===4&&(y.a=parseInt(a[3]+a[3],16)/255)):(y={r:parseInt(a[0]+a[1],16),g:parseInt(a[2]+a[3],16),b:parseInt(a[4]+a[5],16)},a.length===8&&(y.a=parseInt(a[6]+a[7],16)/255)),y&&typeof y.a=="undefined"&&(y.a=1),y}function Vf(a){const[y,b,E]=[a.L,a.C,a.H],ee=E*Math.PI/180,re={L:y,a:b*Math.cos(ee),b:b*Math.sin(ee)};return a.alpha!==void 0&&(re.alpha=a.alpha),re}function zv(a){const[y,b,E]=[a.L,a.a,a.b],ee=Math.sqrt(b*b+E*E),ae=Math.atan2(E,b)*180/Math.PI,ue={L:y,C:ee,H:ae};return a.alpha!==void 0&&(ue.alpha=a.alpha),ue}function Uf(a){const[y,b,E]=[a.L,a.a,a.b],ee=Math.pow(.9999999984505198*y+.39633779217376786*b+.2158037580607588*E,3),re=Math.pow(1.00000000888176*y-.10556134232365635*b-.0638541747717059*E,3),ae=Math.pow(y*1.000000054672411-.0894841820949657*b-1.2914855378640917*E,3),ue=4.076741661347994*ee-3.307711590408193*re+.230969928729428*ae,he=-1.2684380040921763*ee+2.6097574006633715*re-.3413193963102197*ae,ge=-.004196086541837188*ee-.7034186144594493*re+1.7076147009309444*ae,be=Be=>{const He=Math.abs(Be);return He<=.0031308?Be*12.92:(Math.sign(Be)||1)*(1.055*Math.pow(He,1/2.4)-.055)};return[be(ue),be(he),be(ge)]}function Gf(a){const[y,b,E]=a;return y>=0&&y<=1&&b>=0&&b<=1&&E>=0&&E<=1}function Xf(a,y){let[b,E,ee]=a;return b=xu(b*255),E=xu(E*255),ee=xu(ee*255),y!==void 0?{r:b,g:E,b:ee,alpha:y}:{r:b,g:E,b:ee}}function up(a){let[y,b,E]=Uf(a);if(Gf([y,b,E]))return Xf([y,b,E],a.alpha);const ee=zv(a);if(ee.C=0,[y,b,E]=Uf(Vf(ee)),!Gf([y,b,E]))return Xf([y,b,E],a.alpha);let re=0,ae=a.L,ue=(re+ae)/2;ee.C=ue;const he=.36/Math.pow(2,12);for(;ae-re>he;)ue=(re+ae)/2,ee.C=ue,[y,b,E]=Uf(Vf(ee)),Gf([y,b,E])?re=ue:ae=ue;return Xf([y,b,E],a.alpha)}function Kv(a){return up(Vf(a))}function dp(a,y){const b=jf(a),E=jf(y),ee=.56,re=.57,ae=.62,ue=.65,he=.022,ge=1.414,be=.1,Be=5e-4,He=1.14,lt=.027,xt=1.14,vn=.027;function nr(jr){return jr>=he?jr:jr+Ys(he-jr,ge)}function fn(jr){return(jr<0?-1:1)*Math.pow(Math.abs(jr),2.4)}const Rn=nr(fn(E.r/255)*.2126729+fn(E.g/255)*.7151522+fn(E.b/255)*.072175),cr=nr(fn(b.r/255)*.2126729+fn(b.g/255)*.7151522+fn(b.b/255)*.072175);let Fn,Hr,Jr;return Math.abs(cr-Rn)<Be?Hr=0:cr>Rn?(Fn=Ys(cr,ee)-Ys(Rn,re),Hr=Fn*He):(Fn=Ys(cr,ue)-Ys(Rn,ae),Hr=Fn*xt),Math.abs(Hr)<be?Jr=0:Hr>0?Jr=Hr-vn:Jr=Hr+lt,Jr*100}function hp(a,y,b){b!=null||(b="#fff"),y!=null||(y="#000");const E=dp(a,b),ee=dp(a,y);return Math.abs(E)>Math.abs(ee)?b:y}function Hv(a){const y=jf(a);let b=((1<<24)+(xu(y.r)<<16)+(xu(y.g)<<8)+xu(y.b)).toString(16).slice(1);return y.alpha!==void 0&&y.alpha<1&&(b+=("00"+Math.round(y.alpha*255).toString(16)).slice(-2)),b[0]===b[1]&&b[2]===b[3]&&b[4]===b[5]&&b[6]===b[7]&&(b=b[0]+b[2]+b[4]+(y.alpha!==void 0&&y.alpha<1?b[6]:"")),"#"+b}function aa(a){const y=fp(a);let b="";for(const E of y){if(typeof E.value!="string")return"";b+=E.value}return b}function fp(a){const b=a.model.selection.ranges;return b.length!==1?[]:a.model.getAtoms(b[0])}function Wv(a,y){const b=fp(a);if(b.length!==1)return!1;const E=pf[y];return E?!!E.test(b[0].value):!1}function Zv(a,y){return aa(a).length>0}function jv(a){return[Yf(a,"double-struck","mathbb","tooltip.blackboard"),Yf(a,"fraktur","mathfrak","tooltip.fraktur"),Yf(a,"calligraphic","mathcal","tooltip.caligraphic"),qf(a,"up","mathrm","tooltip.roman-upright"),qf(a,"bold","mathbf","tooltip.bold"),qf(a,"italic","mathit","tooltip.italic")]}function Vv(a){return[{label:()=>Va(`\\vec{${aa(a)}}`),visible:()=>aa(a).length===1,onMenuSelect:()=>a.insert("\\vec{#@}",{selectionMode:"item"})},{label:()=>Va(`\\overrightarrow{${aa(a)}}`),visible:()=>aa(a).length>0,onMenuSelect:()=>a.insert("\\overrightarrow{#@}",{selectionMode:"item"})},{label:()=>Va(`\\overleftarrow{${aa(a)}}`),visible:()=>aa(a).length>0,onMenuSelect:()=>a.insert("\\overleftarrow{#@}",{selectionMode:"item"})},{label:()=>Va(`\\dot{${aa(a)}}`),visible:()=>aa(a).length===1,onMenuSelect:()=>a.insert("\\dot{#@}",{selectionMode:"item"})},{label:()=>Va(`\\ddot{${aa(a)}}`),visible:()=>aa(a).length===1,onMenuSelect:()=>a.insert("\\ddot{#@}",{selectionMode:"item"})},{label:()=>Va(`\\bar{${aa(a)}}`),visible:()=>aa(a).length===1,onMenuSelect:()=>a.insert("\\bar{#@}",{selectionMode:"item"})},{label:()=>Va(`\\overline{${aa(a)}}`),visible:()=>aa(a).length>0,onMenuSelect:()=>a.insert("\\overline{#@}",{selectionMode:"item"})},{label:()=>Va(`\\overgroup{${aa(a)}}`),visible:()=>aa(a).length>0,onMenuSelect:()=>a.insert("\\overgroup{#@}",{selectionMode:"item"})},{label:()=>Va(`\\overbrace{${aa(a)}}`),visible:()=>aa(a).length>0,onMenuSelect:()=>a.insert("\\overbrace{#@}",{selectionMode:"item"})},{label:()=>Va(`\\underline{${aa(a)}}`),visible:()=>aa(a).length>0,onMenuSelect:()=>a.insert("\\underline{#@}",{selectionMode:"item"})},{label:()=>Va(`\\undergroup{${aa(a)}}`),visible:()=>aa(a).length>0,onMenuSelect:()=>a.insert("\\undergroup{#@}",{selectionMode:"item"})},{label:()=>Va(`\\underbrace{${aa(a)}}`),visible:()=>aa(a).length>0,onMenuSelect:()=>a.insert("\\underbrace{#@}",{selectionMode:"item"})}]}function Uv(a){return[{label:()=>Va(`\\boxed{${a.getValue(a.model.selection)}}}`),onMenuSelect:()=>a.insert("\\boxed{#@}",{selectionMode:"item"})},{label:()=>Va(`\\bbox[5px, border: 2px solid red]{${a.getValue(a.model.selection)}}`),onMenuSelect:()=>a.insert("\\bbox[5px, border: 2px solid red]{#@}",{selectionMode:"item"})},{label:()=>Va(`\\bbox[5px, border: 2px dashed black]{${a.getValue(a.model.selection)}}`),onMenuSelect:()=>a.insert("\\bbox[5px, border: 2px dashed black]{#@}",{selectionMode:"item"})}]}function Gv(a){const y=[];for(const b of Object.keys(Xe))y.push({class:(Hv(hp(Xe[b]))==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${Xe[b]} "></span>`,ariaLabel:()=>{var E;return(E=ht(b))!=null?E:b},checked:()=>{var E;return{some:"mixed",all:!0}[(E=a.queryStyle({backgroundColor:b}))!=null?E:!1]},onMenuSelect:()=>{a.applyStyle({backgroundColor:b},{operation:"toggle"}),a.adoptStyle="none"}});return y}function Xv(a){const y=[];for(const b of Object.keys(at))y.push({class:(hp(at[b])==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${at[b]} "></span>`,ariaLabel:()=>{var E;return(E=ht(b))!=null?E:b},checked:()=>{var E;return{some:"mixed",all:!0}[(E=a.queryStyle({color:b}))!=null?E:!1]},onMenuSelect:()=>{a.applyStyle({color:b},{operation:"toggle"}),a.adoptStyle="none"}});return y}var Yv=class extends ep{constructor(a,y,b,E){super(a,y),this.row=b,this.col=E}set active(a){const y=this.parentMenu.children;if(a)for(const b of y)b.element.classList.toggle("active",b.row<=this.row&&b.col<=this.col);else for(const b of y)b.element.classList.remove("active")}};function qv(a){const y=[];for(let b=1;b<=5;b++)for(let E=1;E<=5;E++)y.push({onCreate:(ee,re)=>new Yv(ee,re,b,E),label:"\u2610",tooltip:()=>ht("tooltip.row-by-col",b,E),data:{row:b,col:E},onMenuSelect:()=>{a.insert(`\\begin{pmatrix}${Array(b).fill(Array(E).fill("#?").join(" & ")).join("\\\\")}\\end{pmatrix}`,{selectionMode:"item"})}});return y}function Jv(a){return[{label:()=>ht("menu.array.add row above"),id:"add-row-above",onMenuSelect:()=>a.executeCommand("addRowBefore"),visible:()=>Cc(a)},{label:()=>ht("menu.array.add row below"),id:"add-row-below",onMenuSelect:()=>a.executeCommand("addRowAfter"),visible:()=>Cc(a)},{label:()=>ht("menu.array.add column before"),id:"add-column-before",onMenuSelect:()=>a.executeCommand("addColumnBefore"),visible:()=>Cc(a),enabled:()=>{const y=a.model.parentEnvironment;if(!y)return!1;const[b,E]=e1(a);return b<y.maxColumns}},{label:()=>ht("menu.array.add column after"),id:"add-column-after",onMenuSelect:()=>a.executeCommand("addColumnAfter"),visible:()=>Cc(a)},{type:"divider"},{label:()=>ht("menu.array.delete row"),id:"delete-row",onMenuSelect:()=>a.executeCommand("removeRow"),visible:()=>Cc(a)},{label:()=>ht("menu.array.delete column"),id:"delete-column",onMenuSelect:()=>a.executeCommand("removeColumn"),visible:()=>Cc(a)},{type:"divider"},{label:()=>ht("menu.borders"),visible:()=>(Qv(a)||Cc(a))&&a.isSelectionEditable,submenu:[{label:" \u22F1 ",id:"environment-no-border",onMenuSelect:()=>Ad(a,"matrix")},{label:"(\u22F1)",id:"environment-parentheses",onMenuSelect:()=>Ad(a,"pmatrix")},{label:"[\u22F1]",id:"environment-brackets",onMenuSelect:()=>Ad(a,"bmatrix")},{label:"|\u22F1|",id:"environment-bar",onMenuSelect:()=>Ad(a,"vmatrix")},{label:"{\u22F1}",id:"environment-braces",onMenuSelect:()=>Ad(a,"Bmatrix")}],submenuClass:"border-submenu"},{type:"divider"},{label:()=>ht("menu.insert matrix"),id:"insert-matrix",visible:()=>a.isSelectionEditable,submenu:qv(a),submenuClass:"insert-matrix-submenu",columnCount:5},{label:()=>ht("menu.mode"),id:"mode",visible:()=>a.isSelectionEditable&&a.model.selectionIsCollapsed,submenu:[{label:()=>ht("menu.mode-math"),id:"mode-math",onMenuSelect:()=>{cu(a,"accept-all"),a.executeCommand(["switchMode","math"])},checked:()=>a.model.mode==="math"},{label:()=>ht("menu.mode-text"),id:"mode-text",onMenuSelect:()=>{cu(a,"accept-all"),a.executeCommand(["switchMode","text"])},checked:()=>a.model.mode==="text"},{label:()=>ht("menu.mode-latex"),id:"mode-latex",onMenuSelect:()=>a.executeCommand(["switchMode","latex"]),checked:()=>a.model.mode==="latex"}]},{type:"divider"},{label:()=>ht("menu.font-style"),id:"variant",visible:()=>a.isSelectionEditable,submenu:jv(a),submenuClass:"variant-submenu"},{label:()=>ht("menu.color"),id:"color",visible:()=>a.isSelectionEditable,submenu:Xv(a),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>ht("menu.background-color"),id:"background-color",visible:()=>a.isSelectionEditable,submenu:Gv(a),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>ht("menu.accent"),id:"accent",visible:()=>a.isSelectionEditable,submenu:Vv(a),submenuClass:"variant-submenu"},{label:()=>ht("menu.decoration"),id:"decoration",visible:()=>a.isSelectionEditable&&aa(a).length>0,submenu:Uv(a),submenuClass:"variant-submenu"},{type:"divider"},{label:()=>ht("menu.evaluate"),id:"ce-evaluate",visible:()=>a.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{const y=t1(a);if(!y){a.model.announce("plonk");return}a.model.selectionIsCollapsed?(a.model.position=a.model.lastOffset,a.insert(`=${y}`,{insertionMode:"insertAfter",selectionMode:"item"})):a.insert(y,{insertionMode:"replaceSelection",selectionMode:"item"})}},{label:()=>ht("menu.simplify"),id:"ce-simplify",visible:()=>a.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{var y,b;if(a.model.selectionIsCollapsed){const E=(y=a.expression)==null?void 0:y.simplify();if(a.model.position=a.model.lastOffset,!E){a.model.announce("plonk");return}a.insert(`=${E.latex}`,{insertionMode:"insertAfter",selectionMode:"item"})}else{const E=(b=window.MathfieldElement.computeEngine)==null?void 0:b.parse(a.getValue(a.model.selection)).simplify();if(!E){a.model.announce("plonk");return}a.insert(E.latex,{insertionMode:"replaceSelection",selectionMode:"item"})}}},{label:()=>{var y;if(window.MathfieldElement.computeEngine===null)return"";const b=(y=a.expression)==null?void 0:y.unknowns[0];return b?ht("menu.solve-for",Va(b)):ht("menu.solve")},id:"ce-solve",visible:()=>{var y;return a.isSelectionEditable&&window.MathfieldElement.computeEngine!==null&&((y=a.expression)==null?void 0:y.unknowns.length)===1&&a.expression.unknowns[0]!=="Nothing"},onMenuSelect:()=>{var y;const b=a.expression,E=b==null?void 0:b.unknowns[0],ee=(y=b.solve(E))==null?void 0:y.map(re=>{var ae;return(ae=re.simplify().latex)!=null?ae:""});if(!ee){a.model.announce("plonk");return}a.insert(`${E}=${ee.length===1?ee[0]:"\\left\\lbrace"+(ee==null?void 0:ee.join(", "))+"\\right\\rbrace"}`,{insertionMode:"replaceAll",selectionMode:"item"})}},{type:"divider"},{label:()=>ht("menu.cut"),onMenuSelect:()=>a.executeCommand("cutToClipboard"),visible:()=>!a.options.readOnly&&a.isSelectionEditable,keyboardShortcut:"meta+X"},{label:()=>ht("menu.copy"),id:"copy",submenu:[{label:()=>ht("menu.copy-as-latex"),id:"copy-latex",onMenuSelect:()=>si.copyToClipboard(a,"latex"),keyboardShortcut:"meta+C"},{label:()=>ht("menu.copy-as-ascii-math"),id:"copy-ascii-math",onMenuSelect:()=>si.copyToClipboard(a,"ascii-math")},{label:()=>ht("menu.copy-as-mathml"),id:"copy-math-ml",onMenuSelect:()=>si.copyToClipboard(a,"math-ml")}]},{label:()=>ht("menu.paste"),id:"paste",onMenuSelect:()=>a.executeCommand("pasteFromClipboard"),visible:()=>a.hasEditableContent,keyboardShortcut:"meta+V"},{label:()=>ht("menu.select-all"),id:"select-all",keyboardShortcut:"meta+A",onMenuSelect:()=>a.executeCommand("selectAll")}]}function Cc(a){var y;return!!((y=a.model.parentEnvironment)!=null&&y.array)}function Qv(a){return a.model.at(a.model.position).type==="array"}function e1(a){var y;const b=(y=a.model.parentEnvironment)==null?void 0:y.array;return b?[b.length,b.reduce((E,ee)=>Math.max(E,ee.length),0)]:[0,0]}function Ad(a,y){Ch(a),a.flushInlineShortcutBuffer(),P0(a.model,y),va(a)}function t1(a){var y,b;let E;if(a.model.selectionIsCollapsed?E=(y=window.MathfieldElement.computeEngine)==null?void 0:y.parse(a.getValue(),{canonical:!1}):E=(b=window.MathfieldElement.computeEngine)==null?void 0:b.parse(a.getValue(a.model.selection),{canonical:!1}),!E)return"";let ee=E.evaluate();return ee.isSame(E)&&(ee=E.N()),ee.latex}function Yf(a,y,b,E){return{label:()=>Va(`\\${b}{${aa(a)}}`),tooltip:()=>{var ee;return(ee=ht(E))!=null?ee:E},visible:()=>Wv(a,y),checked:()=>{var ee;return{some:"mixed",all:!0}[(ee=a.queryStyle({variant:y}))!=null?ee:!1]},onMenuSelect:()=>{a.applyStyle({variant:y},{operation:"toggle"}),a.adoptStyle="none"}}}function qf(a,y,b,E){return{label:()=>Va(`\\${b}{${aa(a)}}`),tooltip:()=>{var ee;return(ee=ht(E))!=null?ee:E},visible:()=>Zv(a,y),checked:()=>{var ee;return{some:"mixed",all:!0}[(ee=a.queryStyle({variantStyle:y}))!=null?ee:!1]},onMenuSelect:()=>{a.applyStyle({variantStyle:y},{operation:"toggle"}),a.adoptStyle="none"}}}function wu(a,y){return a+bu(y)}Oo({speak:(a,y,b)=>n1(a,y,b)},{target:"mathfield"});function n1(a,y,b){var E,ee;b=b!=null?b:{withHighlighting:!1};const{model:re}=a;function ae(be){let Be=null;switch(be){case"all":Be=re.root;break;case"selection":Be=re.getAtoms(re.selection);break;case"left":{Be=re.getAtoms(re.offsetOf(re.at(re.position).leftSibling),re.position);break}case"right":{Be=re.getAtoms(re.position,re.offsetOf(re.at(re.position).rightSibling));break}case"group":Be=re.getAtoms(re.getSiblingsRange(re.position));break;case"parent":{const{parent:He}=re.at(re.position);He!=null&&He.parent?Be=He:Be=re.root;break}default:Be=re.root}return Be}function ue(be){let Be="";switch(be){case"all":console.log("Internal failure: speak all failed");break;case"selection":Be="no selection";break;case"left":Be="at start";break;case"right":Be="at end";break;case"group":console.log("Internal failure: speak group failed");break;case"parent":Be="no parent";break;default:console.log('unknown speak_ param value: "'+be+'"');break}return Be}const he=ae(y);if(he===null)return(ee=(E=window.MathfieldElement).speakHook)==null||ee.call(E,ue(y)),!1;(b.withHighlighting||window.MathfieldElement.speechEngine==="amazon")&&(window.MathfieldElement.textToSpeechMarkup=window.sre&&window.MathfieldElement.textToSpeechRules==="sre"?"ssml_step":"ssml");const ge=bu(he);return kt()&&b.withHighlighting?(Fl().readAloudMathfield=a,pc(a,{forHighlighting:!0}),window.MathfieldElement.readAloudHook&&window.MathfieldElement.readAloudHook(a.field,ge)):window.MathfieldElement.speakHook&&window.MathfieldElement.speakHook(ge),!1}function r1(a){var y,b;if(!kt()){console.log("Speak:",a);return}if(!window.MathfieldElement.speechEngine||window.MathfieldElement.speechEngine==="local"){const E=new SpeechSynthesisUtterance(a);window.speechSynthesis.speak(E)}else if(window.MathfieldElement.speechEngine==="amazon")if(!("AWS"in window))console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");else{const E=new window.AWS.Polly({apiVersion:"2016-06-10"}),ee={OutputFormat:"mp3",VoiceId:(y=window.MathfieldElement.speechEngineVoice)!=null?y:"Joanna",Engine:["Amy","Emma","Brian","Ivy","Joanna","Kendra","Kimberly","Salli","Joey","Justin","Matthew"].includes((b=window.MathfieldElement.speechEngineVoice)!=null?b:"Joanna")?"neural":"standard",Text:a,TextType:"ssml"};E.synthesizeSpeech(ee,(re,ae)=>{if(re)console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${re}`);else if(ae!=null&&ae.AudioStream){const ue=new Uint8Array(ae.AudioStream),he=new Blob([ue.buffer],{type:"audio/mpeg"}),ge=URL.createObjectURL(he);new Audio(ge).play().catch(Be=>console.log(Be))}else console.log("polly.synthesizeSpeech():",ae)})}else window.MathfieldElement.speechEngine==="google"&&console.error("MathLive 0.98.5: The Google speech engine is not supported yet. Please come again.")}function pp(a){var y;let b;if(a.parent.type==="prompt")a.parentBranch==="body"&&(b="prompt");else if(a.parentBranch==="body")b=a.type&&(y={enclose:"cross out",leftright:"delimiter",surd:"square root",root:"math field",mop:"operator",first:"first"}[a.type])!=null?y:"parent";else if(a.parent.type==="genfrac"){if(a.parentBranch==="above")return"numerator";if(a.parentBranch==="below")return"denominator"}else a.parent.type==="surd"?a.parentBranch==="above"&&(b="index"):a.parentBranch==="superscript"?b="superscript":a.parentBranch==="subscript"&&(b="subscript");return b||console.log("unknown relationship"),b!=null?b:"parent"}function i1(a,y,b,E){let ee="";if(y==="plonk")window.MathfieldElement.playSound("plonk"),a.flushInlineShortcutBuffer();else if(y==="delete")ee=wu("deleted: ",E);else if(y==="focus"||y.includes("move"))ee=a1(a.model,b)+(a.model.selectionIsCollapsed?"":"selected: ")+o1(a.model);else if(y==="replacement")ee=wu("",a.model.at(a.model.position));else if(y==="line"){const re=wu("",a.model.root);a.keyboardDelegate.setAriaLabel(re)}else ee=E?wu(y+" ",E):y;if(ee){const re=a.ariaLiveText.textContent.includes("\xA0")?" \u202F ":" \xA0 ";a.ariaLiveText.textContent=ee+re}}function a1(a,y){if(Number.isNaN(y))return"";const b=a.at(y);if(!b||b.treeDepth<=a.at(a.position).treeDepth)return"";let E="",ee=b.parent;const re=a.at(a.position).parent;for(;ee!==a.root&&ee!==re;)E+=`out of ${pp(ee)};`,ee=ee.parent;return E}function o1(a){if(!a.selectionIsCollapsed)return wu("",a.getAtoms(a.selection));let y="";const b=a.at(a.position),E=pp(b);return b.isFirstSibling&&(y=(E?"start of "+E:"unknown")+": "),b.isLastSibling?b.isFirstSibling||(y+=E?"end of "+E:"unknown"):y+=wu("",b),y}var s1=class{constructor(a,y,b){this.mathfield=a,this.mode=y,this.silenceNotifications=!1,this._selection={ranges:[[0,0]],direction:"none"},this._anchor=0,this._position=0,this.root=b}dispose(){this.mathfield=void 0}getState(){const a={ranges:[...this._selection.ranges]};return this.selection.direction&&this.selection.direction!=="none"&&(a.direction=this.selection.direction),{content:this.root.toJson(),selection:a,mode:this.mode}}setState(a,y){var b;const E=this.silenceNotifications;this.silenceNotifications=(b=y==null?void 0:y.silenceNotifications)!=null?b:!0;let ee={};if((y==null?void 0:y.type)==="undo"&&(ee={inputType:"historyUndo"}),(y==null?void 0:y.type)==="redo"&&(ee={inputType:"historyRedo"}),this.contentWillChange(ee)){const re=this.silenceNotifications;this.silenceNotifications=!0,this.mode=a.mode,this.root=Ol(a.content),this.selection=a.selection,this.silenceNotifications=re,this.contentDidChange(ee)}this.silenceNotifications=E}get atoms(){return this.root.children}get selection(){return this._selection}set selection(a){this.setSelection(a)}setSelection(a,y){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{var b,E,ee;const re=this.normalizeSelection(a,y);if(re===void 0)throw new TypeError("Invalid selection");if(re.ranges.length===1&&re.ranges[0][0]===re.ranges[0][1]){const be=re.ranges[0][0];if(!this.mathfield.dirty&&!((b=this.at(be))!=null&&b.parentPrompt)&&this.mathfield.hasEditablePrompts){if((E=this.at(be-1))!=null&&E.parentPrompt){this._anchor=this.normalizeOffset(be-1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}if((ee=this.at(be+1))!=null&&ee.parentPrompt){this._anchor=this.normalizeOffset(be+1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}this._anchor=0,this._position=0,this._selection={ranges:[[0,0]]};return}this._anchor=be,this._position=be,this._selection=re;return}const ae=Wa(re);re.direction==="backward"?[this._position,this._anchor]=ae:[this._anchor,this._position]=ae;const ue=this.at(ae[0]+1),he=this.at(ae[1]),ge=Dn.commonAncestor(ue,he);(ge==null?void 0:ge.type)==="array"&&ue.parent===ge&&he.parent===ge?this._selection={ranges:[ae],direction:re.direction}:this._selection={ranges:[ae],direction:re.direction},console.assert(this._position>=0&&this._position<=this.lastOffset)})}setPositionHandlingPlaceholder(a){var y;const b=this.at(a);(b==null?void 0:b.type)==="placeholder"?this.setSelection(a-1,a):((y=b==null?void 0:b.rightSibling)==null?void 0:y.type)==="placeholder"?this.setSelection(a,a+1):this.position=a,b instanceof Ja&&b.isSuggestion&&(b.isSuggestion=!1),this.mathfield.stopCoalescingUndo()}get position(){return this._position}set position(a){this.setSelection(a,a)}get anchor(){return this._anchor}get selectionIsCollapsed(){return this._anchor===this._position}get selectionIsPlaceholder(){return Math.abs(this._anchor-this._position)===1?this.at(Math.max(this._anchor,this._position)).type==="placeholder":!1}collapseSelection(a="forward"){return this._anchor===this._position?!1:(a==="backward"?this.position=Math.min(this._anchor,this._position):this.position=Math.max(this._anchor,this._position),!0)}get lastOffset(){return this.atoms.length-1}at(a){return this.atoms[a]}offsetOf(a){return this.atoms.indexOf(a)}getSiblingsRange(a){const y=this.at(a),{parent:b}=y;if(!b)return[0,this.lastOffset];const E=y.parent.branch(y.parentBranch);return[this.offsetOf(E[0]),this.offsetOf(E[E.length-1])]}getBranchRange(a,y){const b=this.at(a).branch(y);return[this.offsetOf(b[0]),this.offsetOf(b[b.length-1])]}getAtoms(a,y,b){let E=b!=null?b:{};if(tu(a)){if(E=y!=null?y:{},a.ranges.length>1)return a.ranges.reduce((ge,be)=>[...ge,...this.getAtoms(be,E)],[]);a=a.ranges[0]}let ee,re;if(Bs(a)){if(ee=a,!Bs(y))return[];re=y}else[ee,re]=a,E=y!=null?y:{};if(!Number.isFinite(ee))return[];E.includeChildren===void 0&&(E.includeChildren=!1),ee<0&&(ee=this.lastOffset-ee+1),re<0&&(re=this.lastOffset-re+1);const ae=Math.min(ee,re)+1,ue=Math.max(ee,re);if(!E.includeChildren&&ae===1&&ue===this.lastOffset)return[this.root];let he=[];for(let ge=ae;ge<=ue;ge++){const be=this.atoms[ge];mp(this,be,ae,ue)&&he.push(be)}return E.includeChildren||(he=he.filter(ge=>{let be=!1,{parent:Be}=ge;for(;Be&&!be;)be=mp(this,Be,ae,ue),Be=Be.parent;return!be})),he}getAllAtoms(a=0){const y=[],b=this.lastOffset;for(let E=a;E<=b;E++)y.push(this.atoms[E]);for(let E=0;E<a;E++)y.push(this.atoms[E]);return y}findAtom(a,y=0,b="forward"){let E;const ee=this.lastOffset;if(b==="forward"){for(let re=y;re<=ee;re++)if(E=this.atoms[re],a(E))return E;for(let re=0;re<y;re++)if(E=this.atoms[re],a(E))return E;return}for(let re=y;re>=0;re--)if(E=this.atoms[re],a(E))return E;for(let re=ee;re>y;re--)if(E=this.atoms[re],a(E))return E}extractAtoms(a){let y=this.getAtoms(a);if(y.length===1&&!y[0].parent)if(y[0].type==="root")y=[...y[0].body],y.shift();else return y=this.root.cells.flat(),this.root=new Dn({type:"root",body:[]}),y;for(const b of y)b.parent.removeChild(b);return y}deleteAtoms(a){this.extractAtoms(a),this.position=a[0]}atomToString(a,y){const b=y!=null?y:"latex";if(b.startsWith("latex"))return Dn.serialize([a],{expandMacro:b==="latex-expanded",skipStyles:b==="latex-unstyled",skipPlaceholders:b==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode});if(b==="math-ml")return Ni(a);if(b==="spoken")return bu(a);if(b==="spoken-text"){const E=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="";const ee=bu(a);return window.MathfieldElement.textToSpeechMarkup=E,ee}if(b==="spoken-ssml"||b==="spoken-ssml-with-highlighting"){const E=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="ssml";const ee=bu(a);return window.MathfieldElement.textToSpeechMarkup=E,ee}return b==="ascii-math"?xa(a):(console.error(`MathLive 0.98.5: Unexpected format "${b}`),"")}getValue(a,y,b){if(a===void 0)return this.atomToString(this.root,"latex");if(typeof a=="string"&&a!=="math-json")return this.atomToString(this.root,a);let E,ee;if(Bs(a)&&Bs(y)?(E=[this.normalizeRange([a,y])],ee=b):eu(a)?(E=[this.normalizeRange(a)],ee=y):tu(a)?(E=a.ranges,ee=y):(E=[this.normalizeRange([0,-1])],ee=a),ee!=null||(ee="latex"),ee==="math-json"){if(!window.MathfieldElement.computeEngine)return window[Symbol.for("io.cortexjs.compute-engine")]||console.error(`The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`),'["Error", "compute-engine-not-available"]';const re=this.getValue({ranges:E},"latex-unstyled");try{const ae=window.MathfieldElement.computeEngine.parse(re);return JSON.stringify(ae.json)}catch(ae){return JSON.stringify(["Error",`'${ae.toString()}'`])}}if(ee.startsWith("latex")){const re={expandMacro:ee==="latex-expanded",skipStyles:ee==="latex-unstyled",skipPlaceholders:ee==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode};return Si(E.map(ae=>Dn.serialize(this.getAtoms(ae),re)))}return E.map(re=>this.getAtoms(re).map(ae=>this.atomToString(ae,ee)).join("")).join("")}extendSelectionTo(a,y){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{const b=this.normalizeRange([a,y]);let[E,ee]=b,{parent:re}=this.at(ee);if(re&&(re.type==="genfrac"||re.type==="subsup"))for(;re!==this.root&&Jf(this,re,[E,ee]);)ee=this.offsetOf(re),re=re.parent;for(re=this.at(E).parent;re!==this.root&&Jf(this,re,[E,ee]);)E=this.offsetOf(re.leftSibling),re=re.parent;if(re=this.at(ee).parent,(re==null?void 0:re.type)==="genfrac")for(;re!==this.root&&Jf(this,re,[E,ee]);)ee=this.offsetOf(re),console.assert(ee>=0),re=re.parent;this._position=this.normalizeOffset(y),this._selection={ranges:[[E,ee]],direction:"none"}})}announce(a,y,b=[]){var E,ee;((ee=(E=this.mathfield.host)==null?void 0:E.dispatchEvent(new CustomEvent("announce",{detail:{command:a,previousPosition:y,atoms:b},cancelable:!0,bubbles:!0,composed:!0})))!=null?ee:!0)&&i1(this.mathfield,a,y,b)}deferNotifications(a,y){const b=this._selection,E=this._anchor,ee=this._position,re=this.silenceNotifications;this.silenceNotifications=!0;const ae=this.root.changeCounter;y();const ue=this.root.changeCounter!==ae,he=E!==this._anchor||ee!==this._position||cc(this._selection,b)==="different";return this.silenceNotifications=re,a.content&&ue&&this.contentDidChange({inputType:a.type}),a.selection&&he&&this.selectionDidChange(),ue||he}normalizeOffset(a){return a>0?a=Math.min(a,this.lastOffset):a<0&&(a=this.lastOffset+a+1),a}normalizeRange(a){let[y,b]=a;return y=this.normalizeOffset(y),b=this.normalizeOffset(b),y<b?[y,b]:[b,y]}normalizeSelection(a,y){var b;let E;if(Bs(a)){const ee=this.normalizeOffset(a);if(Bs(y)){const re=this.normalizeOffset(y);E=ee<=re?{ranges:[[ee,re]],direction:"none"}:{ranges:[[re,ee]],direction:"backward"}}else E={ranges:[[ee,ee]],direction:"none"}}else if(eu(a)){const ee=this.normalizeOffset(a[0]),re=this.normalizeOffset(a[1]);E=ee<=re?{ranges:[[ee,re]],direction:"none"}:{ranges:[[re,ee]],direction:"backward"}}else tu(a)&&(E={ranges:a.ranges.map(ee=>this.normalizeRange(ee)),direction:(b=a.direction)!=null?b:"none"});return console.assert(E!==void 0),E}get parentEnvironment(){let a=this.at(this.position).parent;if(a){for(;a.parent&&a.type!=="array";)a=a.parent;if(a.type==="array")return a}}get cell(){var a;let y=this.at(this.position);if(y){for(;y&&((a=y.parent)==null?void 0:a.type)!=="array";)y=y.parent;if(!(!(y!=null&&y.parent)||y.parent.type!=="array"))return y.parentBranch}}contentWillChange(a={}){if(this.silenceNotifications||!this.mathfield)return!0;const y=this.silenceNotifications;this.silenceNotifications=!0;const b=this.mathfield.onContentWillChange(a);return this.silenceNotifications=y,b}contentDidChange(a){var y;if(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Hs(this.mathfield)),this.silenceNotifications||!this.mathfield.host||!this.mathfield)return;const b=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.host.dispatchEvent(new InputEvent("input",ke(Ce({},a),{data:a.data?a.data:(y=a.inputType)!=null?y:"",bubbles:!0,composed:!0}))),this.silenceNotifications=b}selectionDidChange(){if(!this.mathfield||(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Hs(this.mathfield)),this.silenceNotifications))return;const a=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.onSelectionDidChange(),this.silenceNotifications=a}};function mp(a,y,b,E){const ee=a.offsetOf(y);if(ee<b||ee>E)return!1;if(!y.hasChildren)return!0;const re=a.offsetOf(y.firstChild);if(re>=b&&re<=E){const ae=a.offsetOf(y.lastChild);if(ae>=b&&ae<=E)return!0}return!1}function Jf(a,y,b){if(!(y!=null&&y.hasChildren))return!1;const[E,ee]=b,re=a.offsetOf(y.firstChild),ae=a.offsetOf(y.lastChild);return re>=E&&re<=ee&&ae>=re&&ae<=ee}function Td(a,y,b,E){var ee,re,ae,ue,he,ge;const be=b.parent;if(be&&b instanceof Ri){const Be=!E&&y==="forward"||E==="body"&&y==="backward";let He=Be?a.offsetOf(b.firstChild):a.offsetOf(b.lastChild);return Be?b.rightDelim!=="?"&&b.rightDelim!=="."?(b.leftDelim=".",b.isDirty=!0):(be.addChildrenAfter(b.removeBranch("body"),b),be.removeChild(b),He--):b.leftDelim!=="?"&&b.leftDelim!=="."?(b.rightDelim=".",b.isDirty=!0):(be.addChildrenAfter(b.removeBranch("body"),b),be.removeChild(b),He--),a.position=He,!0}if(be&&b.type==="surd"){if(y==="forward"&&!E||y==="backward"&&E==="body"){const Be=b.leftSibling;b.hasChildren&&be.addChildrenAfter(b.removeBranch("body"),b),be.removeChild(b),a.position=a.offsetOf(Be)}else y==="forward"&&E==="body"?a.position=a.offsetOf(b):!E&&y==="backward"?b.hasChildren?a.position=a.offsetOf(b.lastChild):(a.position=Math.max(0,a.offsetOf(b)-1),be.removeChild(b)):E==="above"&&(b.hasEmptyBranch("above")&&b.removeBranch("above"),y==="backward"?a.position=a.offsetOf(b.leftSibling):a.position=a.offsetOf(b.body[0]));return!0}if(be&&(b.type==="box"||b.type==="enclose")){const Be=E&&y==="backward"||!E&&y==="forward"?b.leftSibling:b.lastChild;return be.addChildrenAfter(b.removeBranch("body"),b),be.removeChild(b),a.position=a.offsetOf(Be),!0}if(b.type==="genfrac"||b.type==="overunder"){if(!E)return b.type==="overunder"&&b.hasEmptyBranch("body")||b.type==="genfrac"&&b.hasEmptyBranch("below")&&b.hasEmptyBranch("above")?!1:(a.position=a.offsetOf(y==="forward"?b.firstChild:b.lastChild),!0);const Be=Pd.fractionNavigationOrder==="numerator-denominator"?"above":"below",He=Be==="above"?"below":"above";if(be&&(y==="forward"&&E===Be||y==="backward"&&E===He)){const lt=b.removeBranch(Be),xt=b.removeBranch(He);return be.addChildrenAfter([...lt,...xt],b),be.removeChild(b),a.position=a.offsetOf(lt.length>0?lt[lt.length-1]:xt[0]),!0}return y==="backward"?a.position=a.offsetOf(b.leftSibling):a.position=a.offsetOf(b),!0}if(b.isExtensibleSymbol||b.type==="subsup"){if(!E&&y==="forward")return!1;if(!E){if(b.subscript||b.superscript){const Be=y==="forward"?(ae=(ee=b.superscript)==null?void 0:ee[0])!=null?ae:(re=b.subscript)==null?void 0:re[0]:(ge=(ue=b.subscript)==null?void 0:ue[0].lastSibling)!=null?ge:(he=b.superscript)==null?void 0:he[0].lastSibling;return Be&&(a.position=a.offsetOf(Be)),!0}return!1}if(!b.hasChildren&&b.type==="subsup"){const Be=y==="forward"?a.offsetOf(b):Math.max(0,a.offsetOf(b)-1);return b.parent.removeChild(b),a.position=Be,!0}if(E==="superscript")if(y==="backward"){const Be=a.offsetOf(b.firstChild)-1;console.assert(Be>=0),a.position=Be}else b.subscript?a.position=a.offsetOf(b.subscript[0]):a.position=a.offsetOf(b);else E==="subscript"&&(y==="backward"&&b.superscript?a.position=a.offsetOf(b.superscript[0].lastSibling):y==="backward"?a.position=a.offsetOf(b.firstChild)-1:a.position=a.offsetOf(b));if(E&&b.hasEmptyBranch(E)&&(b.removeBranch(E),b.type==="subsup"&&!b.subscript&&!b.superscript)){const Be=y==="forward"?a.offsetOf(b):Math.max(0,a.offsetOf(b)-1);b.parent.removeChild(b),a.position=Be}return!0}if((be==null?void 0:be.type)==="genfrac"&&!E&&b.type!=="first"){let Be=a.offsetOf(b.leftSibling);return be.removeChild(b),be.hasEmptyBranch("above")&&be.hasEmptyBranch("below")?(Be=a.offsetOf(be.leftSibling),be.parent.removeChild(be),a.announce("delete",void 0,[be]),a.position=Be,!0):(a.announce("delete",void 0,[b]),a.position=Be,!0)}if(y==="backward"&&((be==null?void 0:be.command)==="\\ln"||(be==null?void 0:be.command)==="\\log")&&b.parentBranch!=="body"){const Be=a.offsetOf(be.leftSibling);return be.parent.removeChild(be),a.announce("delete",void 0,[be]),a.position=Be,!0}return!1}function l1(a){return!a.mathfield.isSelectionEditable||!a.contentWillChange({inputType:"deleteContentBackward"})?!1:a.selectionIsCollapsed?a.deferNotifications({content:!0,selection:!0,type:"deleteContentBackward"},()=>{let y=a.at(a.position);if(!(y&&Td(a,"backward",y))){if(y!=null&&y.isFirstSibling){if(Td(a,"backward",y.parent,y.parentBranch))return;y=null}if(!y){a.announce("plonk");return}a.position=a.offsetOf(y.leftSibling),y.parent.removeChild(y),a.announce("delete",void 0,[y])}}):Zs(a,Wa(a.selection),"deleteContentBackward")}function c1(a){return!a.mathfield.isSelectionEditable||!a.contentWillChange({inputType:"deleteContentForward"})?!1:a.selectionIsCollapsed?a.deferNotifications({content:!0,selection:!0,type:"deleteContentForward"},()=>{var y,b;let E=a.at(a.position).rightSibling;if(E&&Td(a,"forward",E))return;if(E){if(a.at(a.position).isLastSibling&&Td(a,"forward",E.parent,E.parentBranch))return}else{if(E=a.at(a.position),E.isLastSibling&&Td(a,"forward",E.parent,E.parentBranch))return;E=void 0}if(a.position===a.lastOffset||!E){a.announce("plonk");return}E.parent.removeChild(E);let ee=(y=a.at(a.position))==null?void 0:y.rightSibling;for(;(ee==null?void 0:ee.type)==="subsup";)ee.parent.removeChild(ee),ee=(b=a.at(a.position))==null?void 0:b.rightSibling;a.announce("delete",void 0,[E])}):Zs(a,Wa(a.selection),"deleteContentForward")}function Zs(a,y,b){const E=a.getAtoms(y);if(E.length>0&&E[0].parent){let ee=E[0].parent.firstChild;ee.type==="first"&&(ee=ee.rightSibling);const re=E[E.length-1].parent.lastChild;let ae=E[0];ae.type==="first"&&(ae=ae.rightSibling);const ue=E[E.length-1];if(ae===ee&&ue===re){const he=E[0].parent;he.parent&&he.type!=="prompt"&&(y=[a.offsetOf(he.leftSibling),a.offsetOf(he)])}if(E.length===1&&E[0].type==="placeholder"&&E[0].parent.type==="genfrac"){const he=E[0].parent,ge=E[0].parentBranch==="below"?"above":"below",be=a.offsetOf(he.leftSibling);return a.deferNotifications({content:!0,selection:!0,type:b},()=>{var Be,He;const lt=he.removeBranch(ge);if(lt.length===1&&lt[0].type==="placeholder")(He=he.parent)==null||He.removeChild(he),a.position=Math.max(0,be);else{const xt=he.parent.addChildrenAfter(lt,he);(Be=he.parent)==null||Be.removeChild(he),a.position=a.offsetOf(xt)}})}}return a.deferNotifications({content:!0,selection:!0,type:b},()=>a.deleteAtoms(y))}Oo({deleteAll:a=>a.contentWillChange({inputType:"deleteContent"})&&Zs(a,[0,-1],"deleteContent"),deleteForward:a=>c1(a),deleteBackward:a=>l1(a),deleteNextWord:a=>a.contentWillChange({inputType:"deleteWordForward"})&&Zs(a,[a.anchor,Ef(a,a.position,"forward")],"deleteWordForward"),deletePreviousWord:a=>a.contentWillChange({inputType:"deleteWordBackward"})&&Zs(a,[a.anchor,Ef(a,a.position,"backward")],"deleteWordBackward"),deleteToGroupStart:a=>a.contentWillChange({inputType:"deleteSoftLineBackward"})&&Zs(a,[a.anchor,a.offsetOf(a.at(a.position).firstSibling)],"deleteSoftLineBackward"),deleteToGroupEnd:a=>a.contentWillChange({inputType:"deleteSoftLineForward"})&&Zs(a,[a.anchor,a.offsetOf(a.at(a.position).lastSibling)],"deleteSoftLineForward"),deleteToMathFieldStart:a=>a.contentWillChange({inputType:"deleteHardLineBackward"})&&Zs(a,[a.anchor,0],"deleteHardLineBackward"),deleteToMathFieldEnd:a=>a.contentWillChange({inputType:"deleteHardLineForward"})&&Zs(a,[a.anchor,-1],"deleteHardLineForward")},{target:"model",audioFeedback:"delete",canUndo:!0,changeContent:!0,changeSelection:!0});var u1=`<svg xmlns="http://www.w3.org/2000/svg" style="width: 21px;" viewBox="0 0 576 512" role="img" aria-label="${ht("tooltip.toggle virtual keyboard")}"><path d="M528 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h480c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm16 336c0 8.823-7.177 16-16 16H48c-8.823 0-16-7.177-16-16V112c0-8.823 7.177-16 16-16h480c8.823 0 16 7.177 16 16v288zM168 268v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-336 80v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm384 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zM120 188v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-96 152v-8c0-6.627-5.373-12-12-12H180c-6.627 0-12 5.373-12 12v8c0 6.627 5.373 12 12 12h216c6.627 0 12-5.373 12-12z"/></svg>`,d1=`<svg xmlns="http://www.w3.org/2000/svg" style="height: 18px;" viewBox="0 0 448 512" role="img" aria-label="${ht("tooltip.menu")}"><path d="M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"/></svg>`,h1=class{constructor(a,y){this.focusBlurInProgress=!1;var b,E,ee;this.options=Ce(ke(Ce({},Bh()),{macros:Jn(),registers:Al()}),Ih(y)),this.eventController=new AbortController;const re=this.eventController.signal;y.eventSink&&(this.host=y.eventSink),this.element=a,a.mathfield=this,this.blurred=!0,this.keystrokeCaptionVisible=!1,this.suggestionIndex=0,this.inlineShortcutBuffer=[],this.inlineShortcutBufferFlushTimer=0,this.defaultStyle={},this.adoptStyle="left",this.options.defaultMode==="inline-math"?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline"),this.dirty=!1;let ae=(E=(b=y.value)!=null?b:this.element.textContent)!=null?E:"";ae=ae.trim();const ue=D0(this.options),he=new Dn({type:"root",mode:ue,body:ja(ae,{context:this.context})});this.model=new s1(this,ue,he),this.undoManager=new Ng(this.model);const ge=[];if(ge.push("<span contenteditable=true aria-multiline=false part=keyboard-sink class=ML__keyboard-sink autocapitalize=off autocomplete=off autocorrect=off spellcheck=false inputmode=none tabindex=0></span>"),ge.push('<span part=container class=ML__container aria-hidden=true style="visibility:hidden">'),ge.push("<span part=content class=ML__content>"),ge.push(w0(this)),ge.push("</span>"),window.mathVirtualKeyboard&&(ge.push(`<div part=virtual-keyboard-toggle class=ML__virtual-keyboard-toggle role=button ${this.hasEditableContent?"":'style="display:none;"'} data-l10n-tooltip="tooltip.toggle virtual keyboard">`),ge.push(u1),ge.push("</div>")),ge.push('<div part=menu-toggle class=ML__menu-toggle role=button data-l10n-tooltip="tooltip.menu">'),ge.push(d1),ge.push("</div>"),ge.push("</span>"),ge.push("<span class=ML__sr-only>"),ge.push("<span role=status aria-live=assertive aria-atomic=true></span>"),ge.push("</span>"),this.element.innerHTML=window.MathfieldElement.createHTML(ge.join("")),!this.element.children){console.error("%cMathLive 0.98.5: Something went wrong and the mathfield could not be created.%c\nIf you are using Vue, this may be because you are using the runtime-only build of Vue. Make sure to include `runtimeCompiler: true` in your Vue configuration. There may a warning from Vue in the log above.","color:red;font-family:system-ui;font-size:1.2rem;font-weight:bold","color:inherit;font-family:system-ui;font-size:inherit;font-weight:inherit");return}this._l10Subscription=nt.subscribe(()=>nt.update(this.element)),nt.update(this.element),this.field=this.element.querySelector("[part=content]"),this.field.addEventListener("click",Be=>Be.stopImmediatePropagation(),{capture:!1,signal:re}),this.field.addEventListener("wheel",this,{passive:!1,signal:re}),"PointerEvent"in window?this.field.addEventListener("pointerdown",this,{signal:re}):this.field.addEventListener("mousedown",this,{signal:re}),(ee=this.element.querySelector("[part=virtual-keyboard-toggle]"))==null||ee.addEventListener("click",()=>{window.mathVirtualKeyboard.visible?window.mathVirtualKeyboard.hide():(window.mathVirtualKeyboard.show({animate:!0}),window.mathVirtualKeyboard.update(Hs(this)))},{signal:re}),this._menu=new Sv(Jv(this),{host:this.host}),this.field.addEventListener("contextmenu",this,{signal:re});const be=this.element.querySelector("[part=menu-toggle]");be==null||be.addEventListener("pointerdown",Be=>{if(Be.currentTarget!==be||this._menu.state!=="closed")return;this.element.classList.add("tracking");const He=be.getBoundingClientRect();this._menu.modifiers=fc(Be),this._menu.show({target:be,location:{x:He.left,y:He.bottom},onDismiss:()=>this.element.classList.remove("tracking")}),Be.preventDefault(),Be.stopPropagation()},{signal:re}),(this.model.atoms.length<=1||this.disabled||this.readOnly&&!this.hasEditableContent||this.userSelect==="none")&&(be.style.display="none"),this.ariaLiveText=this.element.querySelector("[role=status]"),this.keyboardDelegate=Hm(this.element.querySelector(".ML__keyboard-sink"),this.element,this),window.addEventListener("resize",this,{signal:re}),document.addEventListener("scroll",this,{signal:re}),this.resizeObserver=new ResizeObserver(()=>va(this)),this.resizeObserver.observe(this.field),window.mathVirtualKeyboard.addEventListener("virtual-keyboard-toggle",this,{signal:re}),gd&&!nt.locale.startsWith(gd.locale)&&$m(nt.locale),Ho!=="ready"&&document.fonts.ready.then(()=>Lh(this)),a.querySelector("[part=container]").style.removeProperty("visibility"),this.undoManager.startRecording(),this.undoManager.snapshot("set-value")}get defaultStyle(){return this._defaultStyle}set defaultStyle(a){this._defaultStyle=a}get effectiveStyle(){if(this.adoptStyle==="none")return this.defaultStyle;const a=this.model.at(this.model.position),y=this.adoptStyle==="right"?a.rightSibling:a;if(!y)return this.defaultStyle;if(y.type==="group"){const b=y.branch("body");return!b||b.length<2?{}:this.adoptStyle==="right"?b[1].computedStyle:b[b.length-1].computedStyle}return y.computedStyle}connectToVirtualKeyboard(){this.connectedToVirtualKeyboard||(this.connectedToVirtualKeyboard=!0,window.addEventListener("message",this,{signal:this.eventController.signal}),window.mathVirtualKeyboard.connect(),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Hs(this)),Vh(this))}disconnectFromVirtualKeyboard(){this.connectedToVirtualKeyboard&&(window.removeEventListener("message",this),window.mathVirtualKeyboard.disconnect(),this.connectedToVirtualKeyboard=!1,$f())}showMenu(a){var y,b;const E=(b=(y=a==null?void 0:a.location)!=null?y:Ns(this.field))!=null?b:void 0,ee=a==null?void 0:a.modifiers,re=this.element.querySelector("[part=container]");return this._menu.show({target:re,location:E,modifiers:ee})}get colorMap(){return a=>{var y,b,E;return(E=(b=(y=this.options).colorMap)==null?void 0:b.call(y,a))!=null?E:Ot(a)}}get backgroundColorMap(){return a=>{var y,b,E,ee,re,ae;return(ae=(re=(b=(y=this.options).backgroundColorMap)==null?void 0:b.call(y,a))!=null?re:(ee=(E=this.options).colorMap)==null?void 0:ee.call(E,a))!=null?ae:rt(a)}}get smartFence(){var a;return(a=this.options.smartFence)!=null?a:!1}get readOnly(){var a;return(a=this.options.readOnly)!=null?a:!1}get disabled(){var a,y;return(y=(a=this.host)==null?void 0:a.disabled)!=null?y:!1}get contentEditable(){return this.host?this.host.getAttribute("contenteditable")!=="false":!1}get userSelect(){if(!this.host)return"";const a=getComputedStyle(this.host);return a.getPropertyValue("user-select")||a.getPropertyValue("-webkit-user-select")}get hasEditableContent(){return this.disabled||!this.contentEditable?!1:!this.readOnly||this.hasEditablePrompts}get hasEditablePrompts(){return this.readOnly&&!this.disabled&&this.contentEditable&&this.model.findAtom(a=>a.type==="prompt"&&!a.locked)!==void 0}get isSelectionEditable(){if(this.disabled||!this.contentEditable)return!1;if(!this.readOnly)return!0;const a=this.model.at(this.model.anchor),y=this.model.at(this.model.position),b=Dn.commonAncestor(a,y);return!!((b==null?void 0:b.type)==="prompt"||b!=null&&b.parentPrompt)}get letterShapeStyle(){var a;return(a=this.options.letterShapeStyle)!=null?a:"tex"}get minFontScale(){return this.options.minFontScale}get selectionStyle(){if(this.model.selectionIsCollapsed)return this.effectiveStyle;const a=this.model.getAtoms(this.model.selection);if(a.length===0)return{};const y=Ce({},a[0].style);for(const b of a)for(const[E,ee]of Object.entries(b.style))y[E]!==ee&&delete y[E];return y}queryStyle(a){const y=If(this,a);"verbatimColor"in y&&delete y.verbatimColor,"verbatimBackgroundColor"in y&&delete y.verbatimBackgroundColor;const b=Object.keys(y).length;if(b===0)return"all";if(b>1){for(const he of Object.keys(y)){const ge=this.queryStyle({[he]:y[he]});if(ge==="none")return"none";if(ge==="some")return"some"}return"all"}const E=Object.keys(y)[0],ee=y[E];if(this.model.selectionIsCollapsed)return this.effectiveStyle[E]===ee?"all":"none";const re=this.model.getAtoms(this.model.selection,{includeChildren:!0});let ae=re.length;if(ae===0)return"none";let ue=0;for(const he of re){if(he.type==="first"){ae-=1;continue}he.style[E]===ee&&(ue+=1)}return ue===0?"none":ue===ae?"all":"some"}get keybindings(){var a,y;if(this._keybindings)return this._keybindings;const[b,E]=Um(this.options.keybindings,(a=vd())!=null?a:Fm());return((y=vd())==null?void 0:y.score)>0&&(this._keybindings=b,E.length>0&&console.error("MathLive 0.98.5: Invalid keybindings for current keyboard layout",E)),b}get menu(){return this._menu}setOptions(a){var y;this.options=Ce(Ce({},this.options),Ih(a)),this._keybindings=void 0,this.options.defaultMode==="inline-math"?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline");let b=this.options.defaultMode;b==="inline-math"&&(b="math"),((y=this.model.root.firstChild)==null?void 0:y.mode)!==b&&(this.model.root.firstChild.mode=b),this.options.readOnly&&this.hasFocus()&&window.mathVirtualKeyboard.visible&&this.executeCommand("hideVirtualKeyboard");const E=Dn.serialize([this.model.root],{expandMacro:!1,defaultMode:this.options.defaultMode});("macros"in a||this.model.getValue()!==E)&&si.insert(this.model,E,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",silenceNotifications:!0,mode:"math"}),("value"in a||"macros"in a||"registers"in a||"colorMap"in a||"backgroundColorMap"in a||"letterShapeStyle"in a||"minFontScale"in a||"readOnly"in a||"placeholderSymbol"in a)&&va(this)}getOptions(a){return gc(this.options,a)}getOption(a){return gc(this.options,a)}handleEvent(a){return zl(this,null,function*(){var y;if(Fo(this)){if(Cf(a)){if(!ld(a.origin,(y=this.options.originValidator)!=null?y:"none"))throw new DOMException(`Message from unknown origin (${a.origin}) cannot be handled`,"SecurityError");const{action:b}=a.data;if(b==="execute-command"){const E=a.data.command;if(du(E)==="virtual-keyboard")return;this.executeCommand(E)}else b==="update-state"||(b==="focus"?this.focus({preventScroll:!0}):b==="blur"&&this.blur());return}switch(a.type){case"focus":this.onFocus();break;case"blur":this.onBlur();break;case"mousedown":this.userSelect!=="none"&&Z0(this,a);break;case"pointerdown":this.userSelect!=="none"&&(Z0(this,a),a.shiftKey===!1&&(yield ip(a,this.element.querySelector("[part=container]"),this._menu))&&Hh.stop());break;case"contextmenu":this.userSelect!=="none"&&a.shiftKey===!1&&(yield ip(a,this.element.querySelector("[part=container]"),this._menu))&&Hh.stop();break;case"virtual-keyboard-toggle":this.hasFocus()&&Vh(this);break;case"resize":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>Fo(this)&&this.onGeometryChange());break;case"scroll":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>Fo(this)&&this.onGeometryChange());break;case"wheel":this.onWheel(a);break;default:console.warn("Unexpected event type",a.type)}}})}dispose(){if(!Fo(this))return;nt.unsubscribe(this._l10Subscription),this.keyboardDelegate.dispose(),this.keyboardDelegate=void 0,this.eventController.abort(),this.eventController=void 0,this.resizeObserver.disconnect(),window.mathVirtualKeyboard.removeEventListener("virtual-keyboard-toggle",this),this.disconnectFromVirtualKeyboard(),this.model.dispose();const a=this.element;delete a.mathfield,this.element=void 0,this.host=void 0,this.field=void 0,this.ariaLiveText=void 0,Gg(),Qm(),mv()}flushInlineShortcutBuffer(a){if(a!=null||(a={defer:!1}),!a.defer){this.inlineShortcutBuffer=[],clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=0;return}this.options.inlineShortcutTimeout>0&&(clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=setTimeout(()=>this.flushInlineShortcutBuffer(),this.options.inlineShortcutTimeout))}executeCommand(a){return du(a)==="virtual-keyboard"?(this.focus({preventScroll:!0}),window.mathVirtualKeyboard.executeCommand(a),requestAnimationFrame(()=>window.mathVirtualKeyboard.update(Hs(this))),!1):og(this,a)}get errors(){return t0(this.model.getValue(),{context:this.context})}getValue(a,y,b){return this.model.getValue(a,y,b)}setValue(a,y){var b;y=y!=null?y:{mode:"math"},y.insertionMode===void 0&&(y.insertionMode="replaceAll"),(y.format===void 0||y.format==="auto")&&(y.format="latex"),(y.mode===void 0||y.mode==="auto")&&(y.mode=(b=af(this.model,this.model.position))!=null?b:"math");const E=this.undoManager.canUndo();si.insert(this.model,a,y)&&(va(this),E||this.undoManager.reset(),this.undoManager.snapshot("set-value"))}get expression(){const a=window.MathfieldElement.computeEngine;return a?a.box(a.parse(this.model.getValue("latex-unstyled"))):(console.error("MathLive 0.98.5: no compute engine available. Make sure the Compute Engine library is loaded."),null)}scrollIntoView(){var a;if(!this.element)return;if(this.host){if(this.options.onScrollIntoView)this.options.onScrollIntoView(this);else if(this.host.scrollIntoView({block:"nearest",inline:"nearest"}),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.container===window.document.body){const E=window.mathVirtualKeyboard.boundingRect,ee=this.host.getBoundingClientRect();ee.bottom>E.top&&((a=window.document.scrollingElement)==null||a.scrollBy(0,ee.bottom-E.top+8))}}this.dirty&&pc(this,{interactive:!0});const y=this.field.getBoundingClientRect();let b=null;if(this.model.selectionIsCollapsed)b=Ns(this.field);else{const E=sd(this);if(E.length>0){let ee=-1/0,re=-1/0;for(const ae of E)ae.right>ee&&(ee=ae.right),ae.top<re&&(re=ae.top);b={x:ee+y.left-this.field.scrollLeft,y:re+y.top-this.field.scrollTop,height:0}}}if(this.host&&b){const E=this.host.getBoundingClientRect(),ee=b.y;let re=this.host.scrollTop;ee<E.top?re=ee-E.top+this.host.scrollTop:ee>E.bottom&&(re=ee-E.bottom+this.host.scrollTop+b.height),this.host.scroll({top:re,left:0})}if(b){const E=b.x-window.scrollX;let ee=this.field.scrollLeft;E<y.left?ee=E-y.left+this.field.scrollLeft-20:E>y.right&&(ee=E-y.right+this.field.scrollLeft+20),this.field.scroll({top:this.field.scrollTop,left:ee})}}insert(a,y){return typeof a!="string"||a.length===0&&((y==null?void 0:y.insertionMode)==="insertBefore"||(y==null?void 0:y.insertionMode)==="insertAfter")||a.length===0&&this.model.selectionIsCollapsed?!1:(this.flushInlineShortcutBuffer(),y=y!=null?y:{mode:"math"},y.focus&&this.focus(),y.feedback&&(window.MathfieldElement.keypressVibration&&mt()&&navigator.vibrate(S0),window.MathfieldElement.playSound("keypress")),a==="\\\\"?A0(this.model):a==="&"?T0(this.model):this.model.selectionIsCollapsed?si.insert(this.model,a,Ce({style:this.model.at(this.model.position).computedStyle},y)):si.insert(this.model,a,y),this.snapshot(`insert-${this.model.at(this.model.position).type}`),va(this),y.scrollIntoView&&this.scrollIntoView(),!0)}switchMode(a,y="",b=""){var E;if(this.model.mode===a||!this.hasEditableContent||!this.contentEditable||this.disabled)return;const ee=this.model.mode;if(this.model.mode=a,!((E=this.host)!=null&&E.dispatchEvent(new Event("mode-change",{bubbles:!0,composed:!0,cancelable:!0})))){this.model.mode=ee;return}const re=this.model.mode,{model:ae}=this;ae.deferNotifications({content:!!b||!!y,selection:!0,type:"insertText"},()=>{let ue=!1;if(this.flushInlineShortcutBuffer(),this.stopCoalescingUndo(),y&&a!=="latex"){const he=ja(y,{context:this.context,parseMode:a});ae.collapseSelection("forward");const ge=ae.at(ae.position);ae.position=ae.offsetOf(ge.parent.addChildrenAfter(he,ge)),ue=!0}if(this.model.mode=a,a==="latex"){let he=ae.selectionIsCollapsed;cu(this,"accept");let ge,be=ae.at(ae.position);if(he)ge="\\";else{const He=Wa(ae.selection);ge=this.model.getValue(He,"latex");const lt=this.model.extractAtoms(He);lt.length===1&&lt[0].type==="placeholder"&&(ge=y,he=!0),be=ae.at(He[0])}const Be=new ud(ge);be.parent.addChildAfter(Be,be),he?ae.position=ae.offsetOf(Be.lastChild):ae.setSelection(ae.offsetOf(Be.firstChild),ae.offsetOf(Be.lastChild))}else yd(ae).forEach(he=>{he.isError=!1});if(b){const he=ja(b,{context:this.context,parseMode:re});ae.collapseSelection("forward");const ge=ae.at(ae.position);ae.position=ae.offsetOf(ge.parent.addChildrenAfter(he,ge)),ue=!0}return va(this),this.undoManager.snapshot(a==="latex"?"insert-latex":"insert"),ue}),this.model.mode=a,window.mathVirtualKeyboard.update(Hs(this))}hasFocus(){return!this.blurred}focus(a){var y;this.hasFocus()||(this.keyboardDelegate.focus(),this.connectToVirtualKeyboard(),this.onFocus(),this.model.announce("line")),(y=a==null?void 0:a.preventScroll)!=null&&y||this.scrollIntoView()}blur(){this.disconnectFromVirtualKeyboard(),this.hasFocus()&&this.keyboardDelegate.blur()}select(){this.model.selection={ranges:[[0,this.model.lastOffset]]},this.focus()}applyStyle(a,y={}){var b,E;const ee={operation:"set",silenceNotifications:!1};eu(y)?ee.range=y:(y.operation==="toggle"&&(ee.operation="toggle"),ee.range=y.range,ee.silenceNotifications=(b=y.silenceNotifications)!=null?b:!1);const re=If(this,a),ae=(E=ee.operation)!=null?E:"set";if(ee.range===void 0&&this.model.selectionIsCollapsed){if(ae==="set"){this.defaultStyle=Ce(Ce({},this.defaultStyle),re);return}const ue=Ce({},this.defaultStyle);for(const he of Object.keys(re))ue[he]===re[he]?(he==="color"&&delete ue.verbatimColor,he==="backgroundColor"&&delete ue.verbatimBackgroundColor,delete ue[he]):ue[he]=re[he];this.defaultStyle=ue;return}this.model.deferNotifications({content:!ee.silenceNotifications,type:"insertText"},()=>{if(ee.range===void 0)for(const ue of this.model.selection.ranges)_f(this.model,ue,re,{operation:ae});else _f(this.model,ee.range,re,{operation:ae})}),va(this)}toggleContextMenu(){var a;return this._menu.visible?this._menu.state==="open"?(this._menu.hide(),!0):(this._menu.show({target:this.element.querySelector("[part=container]"),location:(a=this.getCaretPoint())!=null?a:void 0,onDismiss:()=>{var y;return(y=this.element)==null?void 0:y.focus()}}),!0):!1}getCaretPoint(){const a=Ns(this.field);return a?{x:a.x,y:a.y}:null}setCaretPoint(a,y){const b=kd(this,a,y,{bias:0});if(b<0)return!1;const E=this.model.position;return this.model.position=b,this.model.announce("move",E),va(this),!0}getPrompt(a){const y=this.model.findAtom(b=>b.type==="prompt"&&b.placeholderId===a);return console.assert(y!==void 0,"MathLive 0.98.5: no prompts with matching ID found"),y}getPromptValue(a,y){const b=this.getPrompt(a);if(!b)return"";const E=this.model.offsetOf(b.firstChild),ee=this.model.offsetOf(b.lastChild);return this.model.getValue(E,ee,y)}getPrompts(a){return this.model.getAllAtoms().filter(y=>y.type!=="prompt"?!1:a?!(a.id&&y.placeholderId!==a.id||a.locked&&y.locked!==a.locked||a.correctness==="undefined"&&y.correctness||a.correctness&&y.correctness!==a.correctness):!0).map(y=>y.placeholderId)}setPromptValue(a,y,b){if(y!==void 0){const E=this.getPrompt(a);if(!E){console.error(`MathLive 0.98.5: unknown prompt ${a}`);return}const ee=this.model.getBranchRange(this.model.offsetOf(E),"body");this.model.setSelection(ee),this.insert(y,ke(Ce({},b),{insertionMode:"replaceSelection"}))}b!=null&&b.silenceNotifications&&(this.valueOnFocus=this.getValue()),va(this)}setPromptState(a,y,b){const E=this.getPrompt(a);if(!E){console.error(`MathLive 0.98.5: unknown prompt ${a}`);return}y==="undefined"?E.correctness=void 0:typeof y=="string"&&(E.correctness=y),typeof b=="boolean"&&(E.locked=b,E.captureSelection=b),va(this)}getPromptState(a){const y=this.getPrompt(a);return y?[y.correctness,y.locked]:(console.error(`MathLive 0.98.5: unknown prompt ${a}`),[void 0,!0])}getPromptRange(a){const y=this.getPrompt(a);return y?this.model.getBranchRange(this.model.offsetOf(y),"body"):(console.error(`MathLive 0.98.5: unknown prompt ${a}`),[0,0])}canUndo(){return this.undoManager.canUndo()}canRedo(){return this.undoManager.canRedo()}popUndoStack(){this.undoManager.pop()}snapshot(a){var y;this.undoManager.snapshot(a)&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Hs(this)),(y=this.host)==null||y.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"snapshot"}})))}stopCoalescingUndo(){this.undoManager.stopCoalescing(this.model.selection)}stopRecording(){this.undoManager.stopRecording()}startRecording(){this.undoManager.startRecording()}undo(){var a;this.undoManager.undo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Hs(this)),(a=this.host)==null||a.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}redo(){var a;this.undoManager.redo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Hs(this)),(a=this.host)==null||a.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}resetUndo(){var a;(a=this.undoManager)==null||a.reset()}onSelectionDidChange(){var a,y;const b=this.model;this.keyboardDelegate.setValue(b.getValue(this.model.selection,"latex-expanded"));{const E=b.at(b.position),ee=(a=E.mode)!=null?a:D0(this.options);this.model.mode!==ee&&(this.model.mode==="latex"?(cu(this,"accept",{mode:ee}),b.position=b.offsetOf(E)):this.switchMode(ee))}(y=this.host)==null||y.dispatchEvent(new Event("selection-change",{bubbles:!0,composed:!0})),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Hs(this)),Vh(this)}onContentWillChange(a){var y,b,E;return(E=(b=this.host)==null?void 0:b.dispatchEvent(new InputEvent("beforeinput",ke(Ce({},a),{data:a.data?a.data:(y=a.inputType)!=null?y:"",cancelable:!0,bubbles:!0,composed:!0}))))!=null?E:!0}onFocus(){this.focusBlurInProgress||!this.blurred||(this.focusBlurInProgress=!0,this.blurred=!1,this.keyboardDelegate.focus(),this.stopCoalescingUndo(),pc(this,{interactive:!0}),this.valueOnFocus=this.model.getValue(),this.hasEditablePrompts&&!this.model.at(this.model.anchor).parentPrompt&&this.executeCommand("moveToNextPlaceholder"),this.focusBlurInProgress=!1)}onBlur(){var a,y,b;if(this.focusBlurInProgress||this.blurred)return;this.focusBlurInProgress=!0,this.stopCoalescingUndo(),this.blurred=!0,this.ariaLiveText.textContent="",uu(this),this.model.getValue()!==this.valueOnFocus&&((a=this.host)==null||a.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),this.disconnectFromVirtualKeyboard(),(y=this.host)==null||y.dispatchEvent(new Event("blur",{bubbles:!1,composed:!0})),(b=this.host)==null||b.dispatchEvent(new UIEvent("focusout",{bubbles:!0,composed:!0})),va(this),this.focusBlurInProgress=!1,$f();const E=new AbortController,ee=E.signal;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&document.addEventListener("visibilitychange",()=>{Fo(this)&&document.visibilityState==="visible"&&this.focus({preventScroll:!0})},{once:!0,signal:ee})},{once:!0,signal:ee}),setTimeout(()=>E.abort(),100)}onInput(a){Af(this,a)}onKeystroke(a){return K0(this,a)}onCompositionStart(a){this.model.deleteAtoms(Wa(this.model.selection));const y=Ns(this.field);y&&requestAnimationFrame(()=>{pc(this),this.keyboardDelegate.moveTo(y.x,y.y-y.height)})}onCompositionUpdate(a){Lg(this.model,a),va(this)}onCompositionEnd(a){Dg(this.model),Af(this,a,{simulateKeystroke:!0})}onCut(a){if(!this.isSelectionEditable){this.model.announce("plonk");return}this.model.contentWillChange({inputType:"deleteByCut"})&&(this.stopCoalescingUndo(),si.onCopy(this,a),Zs(this.model,Wa(this.model.selection),"deleteByCut"),this.snapshot("cut"),va(this))}onCopy(a){si.onCopy(this,a)}onPaste(a){let y=this.isSelectionEditable;return y&&(y=si.onPaste(this.model.at(this.model.position).mode,this,a.clipboardData)),y||this.model.announce("plonk"),a.preventDefault(),a.stopPropagation(),y}onGeometryChange(){this._menu.hide(),_h(this),Vh(this)}onWheel(a){const y=5*a.deltaX;if(!Number.isFinite(y)||y===0)return;const b=this.field;y<0&&b.scrollLeft===0||y>0&&b.offsetWidth+b.scrollLeft>=b.scrollWidth||(b.scrollBy({top:0,left:y}),a.preventDefault(),a.stopPropagation())}getHTMLElement(a){let y=a;for(;!y.id&&y.hasChildren;)y=a.children[0];return this.field.querySelector(`[data-atom-id="${y.id}"]`)}get context(){var a,y;return{registers:(a=this.options.registers)!=null?a:{},smartFence:this.smartFence,letterShapeStyle:this.letterShapeStyle,minFontScale:this.minFontScale,placeholderSymbol:(y=this.options.placeholderSymbol)!=null?y:"\u25A2",colorMap:b=>this.colorMap(b),backgroundColorMap:b=>this.backgroundColorMap(b),getMacro:b=>Ft(b,this.options.macros),atomIdsSettings:{seed:"random",groupNumbers:!1}}}};function gp(a){if(a&&(a.classList.remove("ML__highlight"),a.children))for(const y of a.children)gp(y)}function Qf(a,y){var b;a&&(!y||((b=a.dataset)==null?void 0:b.atomId)===y?(a.classList.add("ML__highlight"),a.children&&a.children.length>0&&[...a.children].forEach(E=>{E instanceof HTMLElement&&Qf(E)})):(a.classList.remove("ML__highlight"),a.children&&a.children.length>0&&[...a.children].forEach(E=>{E instanceof HTMLElement&&Qf(E,y)})))}function f1(a,y){var b;if(!kt())return;if(window.MathfieldElement.speechEngine!=="amazon"){console.error("MathLive 0.98.5: Use Amazon TTS Engine for synchronized highlighting"),typeof window.MathfieldElement.speakHook=="function"&&window.MathfieldElement.speakHook(y);return}if(!window.AWS){console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");return}const E=new window.AWS.Polly({apiVersion:"2016-06-10"}),ee={OutputFormat:"json",VoiceId:(b=window.MathfieldElement.speechEngineVoice)!=null?b:"Joanna",Engine:"standard",Text:y,TextType:"ssml",SpeechMarkTypes:["ssml"]};Fl().readAloudElement=a,E.synthesizeSpeech(ee,(re,ae)=>{if(re){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${re}`);return}if(!(ae!=null&&ae.AudioStream)){console.log("polly.synthesizeSpeech():",ae);return}const ue=new TextDecoder("utf-8").decode(new Uint8Array(ae.AudioStream));Fl().readAloudMarks=ue.split(`
`).map(he=>he?JSON.parse(he):{}),Fl().readAloudTokens=[];for(const he of Fl().readAloudMarks)he.value&&Fl().readAloudTokens.push(he.value);Fl().readAloudCurrentMark="",ee.OutputFormat="mp3",ee.SpeechMarkTypes=[],E.synthesizeSpeech(ee,(he,ge)=>{if(he){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech("${y}") error:${he}`);return}if(!(ge!=null&&ge.AudioStream))return;const be=new Uint8Array(ge.AudioStream),Be=new Blob([be.buffer],{type:"audio/mpeg"}),He=URL.createObjectURL(Be),lt=Fl();lt.readAloudAudio?lt.readAloudAudio.pause():(lt.readAloudAudio=new Audio,lt.readAloudAudio.addEventListener("ended",()=>{const xt=lt.readAloudMathfield;lt.readAloudStatus="ended",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),xt?(pc(xt),lt.readAloudElement=null,lt.readAloudMathfield=null,lt.readAloudTokens=[],lt.readAloudMarks=[],lt.readAloudCurrentMark=""):gp(lt.readAloudElement)}),lt.readAloudAudio.addEventListener("timeupdate",()=>{let xt="";const vn=lt.readAloudAudio.currentTime*1e3+100;for(const nr of lt.readAloudMarks)nr.time<vn&&(xt=nr.value);lt.readAloudCurrentMark!==xt&&(lt.readAloudCurrentToken=xt,xt&&xt===lt.readAloudFinalToken?lt.readAloudAudio.pause():(lt.readAloudCurrentMark=xt,Qf(lt.readAloudElement,lt.readAloudCurrentMark)))})),lt.readAloudAudio.src=He,lt.readAloudStatus="playing",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),lt.readAloudAudio.play()})})}kt()||console.error('MathLive 0.98.5: this version of the MathLive library is for use in the browser. A subset of the API is available on the server side in the "mathlive-ssr" library. If using server side rendering (with React for example) you may want to do a dynamic import of the MathLive library inside a `useEffect()` call.');var Ii=new WeakMap,p1=.5,$l={letterShapeStyle:"mf.letterShapeStyle = ...",horizontalSpacingScale:'Removed. Use `"thinmuskip"`, `"medmuskip"`, and `"thickmuskip"` registers ',macros:"mf.macros = ...",registers:"mf.registers = ...",backgroundColorMap:"mf.backgroundColorMap = ...",colorMap:"mf.colorMap = ...",enablePopover:"mf.popoverPolicy = ...",mathModeSpace:"mf.mathModeSpace = ...",placeholderSymbol:"mf.placeholderSymbol = ...",readOnly:"mf.readOnly = ...",removeExtraneousParentheses:"mf.removeExtraneousParentheses = ...",scriptDepth:"mf.scriptDepth = ...",smartFence:"mf.smartFence = ...",smartMode:"mf.smartMode = ...",smartSuperscript:"mf.smartSuperscript = ...",inlineShortcutTimeout:"mf.inlineShortcutTimeout = ...",inlineShortcuts:"mf.inlineShortcuts = ...",keybindings:"mf.keybindings = ...",virtualKeyboardMode:"mf.mathVirtualKeyboardPolicy = ...",customVirtualKeyboardLayers:"mathVirtualKeyboard.layers = ...",customVirtualKeyboards:"mathVirtualKeyboard.layouts = ...",keypressSound:"mathVirtualKeyboard.keypressSound = ...",keypressVibration:"mathVirtualKeyboard.keypressVibration = ...",plonkSound:"mathVirtualKeyboard.plonkSound = ...",virtualKeyboardContainer:"mathVirtualKeyboard.container = ...",virtualKeyboardLayout:"mathVirtualKeyboard.alphabeticLayout = ...",virtualKeyboardTheme:"No longer supported",virtualKeyboardToggleGlyph:"No longer supported",virtualKeyboardToolbar:"mathVirtualKeyboard.editToolbar = ...",virtualKeyboards:"Use `mathVirtualKeyboard.layouts`",speechEngine:"`MathfieldElement.speechEngine`",speechEngineRate:"`MathfieldElement.speechEngineRate`",speechEngineVoice:"`MathfieldElement.speechEngineVoice`",textToSpeechMarkup:"`MathfieldElement.textToSpeechMarkup`",textToSpeechRules:"`MathfieldElement.textToSpeechRules`",textToSpeechRulesOptions:"`MathfieldElement.textToSpeechRulesOptions`",readAloudHook:"`MathfieldElement.readAloudHook`",speakHook:"`MathfieldElement.speakHook`",computeEngine:"`MathfieldElement.computeEngine`",fontsDirectory:"`MathfieldElement.fontsDirectory`",soundsDirectory:"`MathfieldElement.soundsDirectory`",createHTML:"`MathfieldElement.createHTML`",onExport:"`MathfieldElement.onExport`",onInlineShortcut:"`MathfieldElement.onInlineShortcut`",onScrollIntoView:"`MathfieldElement.onScrollIntoView`",locale:"MathfieldElement.locale = ...",strings:"MathfieldElement.strings = ...",decimalSeparator:"MathfieldElement.decimalSeparator = ...",fractionNavigationOrder:"MathfieldElement.fractionNavigationOrder = ..."},Qa=class Mc extends HTMLElement{static get formAssociated(){return Su()}static get optionsAttributes(){return{"default-mode":"string","letter-shape-style":"string","min-font-scale":"number","popover-policy":"string","math-mode-space":"string","read-only":"boolean","remove-extraneous-parentheses":"on/off","smart-fence":"on/off","smart-mode":"on/off","smart-superscript":"on/off","inline-shortcut-timeout":"string","script-depth":"string",placeholder:"string","virtual-keyboard-target-origin":"string","math-virtual-keyboard-policy":"string"}}static get observedAttributes(){return[...Object.keys(this.optionsAttributes),"contenteditable","disabled","readonly","read-only"]}static get fontsDirectory(){return this._fontsDirectory}static set fontsDirectory(y){y!==this._fontsDirectory&&(this._fontsDirectory=y,ng())}get fontsDirectory(){throw new Error("Use MathfieldElement.fontsDirectory instead")}set fontsDirectory(y){throw new Error("Use MathfieldElement.fontsDirectory instead")}static get soundsDirectory(){return this._soundsDirectory}static set soundsDirectory(y){this._soundsDirectory=y,this.audioBuffers={}}get soundsDirectory(){throw new Error("Use MathfieldElement.soundsDirectory instead")}set soundsDirectory(y){throw new Error("Use MathfieldElement.soundsDirectory instead")}static get keypressSound(){return this._keypressSound}static set keypressSound(y){var b,E,ee;this.audioBuffers={},y===null?this._keypressSound={spacebar:null,return:null,delete:null,default:null}:typeof y=="string"?this._keypressSound={spacebar:y,return:y,delete:y,default:y}:typeof y=="object"&&"default"in y&&(this._keypressSound={spacebar:(b=y.spacebar)!=null?b:y.default,return:(E=y.return)!=null?E:y.default,delete:(ee=y.delete)!=null?ee:y.default,default:y.default})}static get plonkSound(){return this._plonkSound}static set plonkSound(y){this.audioBuffers={},this._plonkSound=y}static get audioContext(){return this._audioContext||(this._audioContext=new AudioContext),this._audioContext}static get speechEngine(){return this._speechEngine}static set speechEngine(y){this._speechEngine=y}static get speechEngineRate(){return this._speechEngineRate}static set speechEngineRate(y){this._speechEngineRate=y}static get speechEngineVoice(){return this._speechEngineVoice}static set speechEngineVoice(y){this._speechEngineVoice=y}static get textToSpeechMarkup(){return this._textToSpeechMarkup}static set textToSpeechMarkup(y){this._textToSpeechMarkup=y}static get textToSpeechRules(){return this._textToSpeechRules}static set textToSpeechRules(y){this._textToSpeechRules=y}static get textToSpeechRulesOptions(){return this._textToSpeechRulesOptions}static set textToSpeechRulesOptions(y){this._textToSpeechRulesOptions=y}static get locale(){return nt.locale}static set locale(y){y==="auto"&&(y=navigator.language.slice(0,5)),nt.locale=y}get locale(){throw new Error("Use MathfieldElement.locale instead")}set locale(y){throw new Error("Use MathfieldElement.locale instead")}static get strings(){return nt.strings}static set strings(y){nt.merge(y)}get strings(){throw new Error("Use MathfieldElement.strings instead")}set strings(y){throw new Error("Use MathfieldElement.strings instead")}static get decimalSeparator(){return this._decimalSeparator}static set decimalSeparator(y){this._decimalSeparator=y,this._computeEngine&&(this._computeEngine.latexOptions.decimalMarker=this.decimalSeparator===","?"{,}":".")}get decimalSeparator(){throw new Error("Use MathfieldElement.decimalSeparator instead")}set decimalSeparator(y){throw new Error("Use MathfieldElement.decimalSeparator instead")}static get computeEngine(){var y,b;if(this._computeEngine===void 0){const E=(y=window[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:y.ComputeEngine;if(!E)return null;this._computeEngine=new E,this._computeEngine&&this.decimalSeparator===","&&(this._computeEngine.latexOptions.decimalMarker="{,}")}return(b=this._computeEngine)!=null?b:null}static set computeEngine(y){this._computeEngine=y}get computeEngine(){throw new Error("Use MathfieldElement.computeEngine instead")}set computeEngine(y){throw new Error("Use MathfieldElement.computeEngine instead")}static get isFunction(){return typeof this._isFunction!="function"?()=>!1:this._isFunction}static set isFunction(y){this._isFunction=y}static loadSound(y){return zl(this,null,function*(){delete this.audioBuffers[y];let b="";switch(y){case"keypress":b=this._keypressSound.default;break;case"return":b=this._keypressSound.return;break;case"spacebar":b=this._keypressSound.spacebar;break;case"delete":b=this._keypressSound.delete;break;case"plonk":b=this.plonkSound;break}if(typeof b!="string")return;b=b.trim();const E=this.soundsDirectory;if(!(E==null||E==="null"||b==="none"||b==="null"))try{const re=yield(yield fetch(yield x0(`${E}/${b}`))).arrayBuffer(),ae=yield this.audioContext.decodeAudioData(re);this.audioBuffers[y]=ae}catch(ee){}})}static playSound(y){return zl(this,null,function*(){if((this.audioContext.state==="suspended"||this.audioContext.state==="interrupted")&&(yield this.audioContext.resume()),this.audioBuffers[y]||(yield this.loadSound(y)),!this.audioBuffers[y])return;const b=this.audioContext.createBufferSource();b.buffer=this.audioBuffers[y];const E=this.audioContext.createGain();E.gain.value=p1,b.connect(E).connect(this.audioContext.destination),b.start()})}constructor(y){if(super(),y){const b=[];for(const E of Object.keys(y))if($l[E])if($l[E].startsWith("mf."))if($l[E].startsWith(`mf.${E}`))b.push(`Option \`${E}\` cannot be used as a constructor option. Use ${$l[E]}`);else{const ee=$l[E].match(/([a-zA-Z]+) =/);b.push(`Option \`${E}\` has been renamed \`${ee[1]}\``)}else b.push(`Option \`${E}\` cannot be used as a constructor option. Use ${$l[E]}`);if(b.length>0){console.group("%cMathLive 0.98.5: %cInvalid Options","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),console.warn("Some of the options passed to `new MathfieldElement(...)` are invalid. \n See https://cortexjs.io/mathlive/changelog/ for details.");for(const E of b)console.warn(E);console.groupEnd()}}if(Su()&&(this._internals=this.attachInternals(),this._internals.role="math",this._internals.ariaLabel="math input field",this._internals.ariaMultiLine="false"),this.attachShadow({mode:"open",delegatesFocus:!0}),this.shadowRoot&&"adoptedStyleSheets"in this.shadowRoot){this.shadowRoot.adoptedStyleSheets=[Bl("core"),Bl("mathfield"),Bl("mathfield-element"),Bl("ui"),Bl("menu")],this.shadowRoot.appendChild(document.createElement("span"));const b=document.createElement("slot");b.style.display="none",this.shadowRoot.appendChild(b)}else this.shadowRoot.innerHTML="<style>"+hl("core")+hl("mathfield")+hl("mathfield-element")+hl("ui")+hl("menu")+'</style><span></span><slot style="display:none"></slot>';y&&this._setOptions(y),this.shadowRoot.addEventListener("slotchange",()=>{var b;const E=this.shadowRoot.querySelector("slot:not([name])");this.value=(b=E==null?void 0:E.assignedNodes().map(ee=>ee.nodeType===3?ee.textContent:"").join("").trim())!=null?b:""})}showMenu(y){var b,E;return(E=(b=this._mathfield)==null?void 0:b.showMenu(y))!=null?E:!1}get mathVirtualKeyboard(){throw new Error("The `mathVirtualKeyboard` property is not available on the MathfieldElement. Use `window.mathVirtualKeyboard` instead.")}onPointerDown(){window.addEventListener("pointerup",y=>{var b;y.target===this&&!((b=this._mathfield)!=null&&b.disabled)&&this.dispatchEvent(new MouseEvent("click",{altKey:y.altKey,button:y.button,buttons:y.buttons,clientX:y.clientX,clientY:y.clientY,ctrlKey:y.ctrlKey,metaKey:y.metaKey,movementX:y.movementX,movementY:y.movementY,relatedTarget:y.relatedTarget,screenX:y.screenX,screenY:y.screenY,shiftKey:y.shiftKey}))},{once:!0})}getPromptValue(y,b){var E,ee;return(ee=(E=this._mathfield)==null?void 0:E.getPromptValue(y,b))!=null?ee:""}setPromptValue(y,b,E){var ee;(ee=this._mathfield)==null||ee.setPromptValue(y,b,E)}getPromptRange(y){var b,E;return(E=(b=this._mathfield)==null?void 0:b.getPromptRange(y))!=null?E:null}getPrompts(y){var b,E;return(E=(b=this._mathfield)==null?void 0:b.getPrompts(y))!=null?E:[]}get form(){var y;return(y=this._internals)==null?void 0:y.form}get name(){var y;return(y=this.getAttribute("name"))!=null?y:""}get type(){return this.localName}get mode(){var y,b;return(b=(y=this._mathfield)==null?void 0:y.model.mode)!=null?b:this.defaultMode==="text"?"text":"math"}set mode(y){var b;(b=this._mathfield)==null||b.switchMode(y)}get expression(){if(this._mathfield)return window[Symbol.for("io.cortexjs.compute-engine")]?this._mathfield.expression:(console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`),null)}set expression(y){var b,E;if(!this._mathfield)return;const ee=(E=(b=Mc.computeEngine)==null?void 0:b.box(y).latex)!=null?E:null;ee!==null&&this._mathfield.setValue(ee),window[Symbol.for("io.cortexjs.compute-engine")]||console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`)}get errors(){var y,b;return(b=(y=this._mathfield)==null?void 0:y.errors)!=null?b:[]}_getOptions(y){return this._mathfield?gc(this._mathfield.options,y):Ii.has(this)?Ce({},gc(Ce(Ce({},Bh()),Ih(Ii.get(this).options)),y)):null}getOptions(y){return console.warn("%cMathLive 0.98.5: %cDeprecated Usage%c\n `mf.getOptions()` is deprecated. Read the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem","color: inherit, font-size: 1rem"),this._mathfield?gc(this._mathfield.options,y):Ii.has(this)?gc(Ce(Ce({},Bh()),Ih(Ii.get(this).options)),y):null}reflectAttributes(){const y=Bh(),b=this._getOptions();Object.keys(Mc.optionsAttributes).forEach(E=>{const ee=gl(E);Mc.optionsAttributes[E]==="on/off"?y[ee]!==b[ee]?this.setAttribute(E,b[ee]?"on":"off"):this.removeAttribute(E):y[ee]!==b[ee]&&(Mc.optionsAttributes[E]==="boolean"?b[ee]?this.setAttribute(E,""):this.removeAttribute(E):(typeof b[ee]=="string"||typeof b[ee]=="number")&&this.setAttribute(E,b[ee].toString()))})}getOption(y){return console.warn("%cMathLive 0.98.5: %cDeprecated Usage%c\n `mf.getOption()` is deprecated. Read the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem","color: inherit, font-size: 1rem"),this._getOptions([y])[y]}_getOption(y){return this._getOptions([y])[y]}_setOptions(y){if(this._mathfield)this._mathfield.setOptions(y);else if(Ii.has(this)){const b=Ce(Ce({},Ii.get(this).options),y);Ii.set(this,ke(Ce({},Ii.get(this)),{selection:{ranges:b.readOnly?[[0,0]]:[[0,-1]]},options:b}))}else Ii.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:y,menuItems:void 0});this.reflectAttributes()}setOptions(y){console.group("%cMathLive 0.98.5: %cDeprecated Usage","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),console.warn(" `mf.setOptions()` is deprecated. Set the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.");for(const b of Object.keys(y))$l[b]&&console.warn(`\`mf.setOptions({${b}:...})\` -> ${$l[b]}`);console.groupEnd(),this._setOptions(y)}executeCommand(y){var b,E;return(E=(b=this._mathfield)==null?void 0:b.executeCommand(y))!=null?E:!1}getValue(y,b,E){var ee,re;if(this._mathfield)return this._mathfield.model.getValue(y,b,E);if(Ii.has(this)){let ae,ue,he;if(tu(y)?([ae,ue]=y.ranges[0],he=b):eu(y)?([ae,ue]=y,he=b):Bs(y)&&Bs(b)?(ae=y,ue=b,he=E):(ae=0,ue=-1,he=y),(he===void 0||he==="latex")&&ae===0&&ue===-1)return(re=(ee=Ii.get(this).value)!=null?ee:this.textContent)!=null?re:""}return""}setValue(y,b){if(this._mathfield&&y!==void 0){b!=null||(b={silenceNotifications:!0,mode:"math"}),this._mathfield.setValue(y,b);return}if(Ii.has(this)){const ee=Ii.get(this).options;Ii.set(this,{value:y,selection:{ranges:[[-1,-1]],direction:"forward"},options:ee,menuItems:void 0});return}const E=Id(this);Ii.set(this,{value:y,selection:{ranges:[[-1,-1]],direction:"forward"},options:E,menuItems:void 0})}hasFocus(){var y,b;return(b=(y=this._mathfield)==null?void 0:y.hasFocus())!=null?b:!1}focus(){var y;(y=this._mathfield)==null||y.focus()}blur(){var y;(y=this._mathfield)==null||y.blur()}select(){var y;(y=this._mathfield)==null||y.select()}insert(y,b){var E,ee;return(ee=(E=this._mathfield)==null?void 0:E.insert(y,b))!=null?ee:!1}applyStyle(y,b){var E;return(E=this._mathfield)==null?void 0:E.applyStyle(y,b)}queryStyle(y){var b,E;return(E=(b=this._mathfield)==null?void 0:b.queryStyle(y))!=null?E:"none"}get caretPoint(){var y,b;return(b=(y=this._mathfield)==null?void 0:y.getCaretPoint())!=null?b:null}set caretPoint(y){var b;y&&((b=this._mathfield)==null||b.setCaretPoint(y.x,y.y))}setCaretPoint(y,b){var E,ee;return(ee=(E=this._mathfield)==null?void 0:E.setCaretPoint(y,b))!=null?ee:!1}offsetFromPoint(y,b,E){return this._mathfield?kd(this._mathfield,y,b,E):-1}hitboxFromOffset(y){if(!this._mathfield)return null;const b=this._mathfield.model.at(y);if(!b)return null;const E=Pl(this._mathfield,b);return E?new DOMRect(E.left,E.top,E.right-E.left,E.bottom-E.top):null}resetUndo(){var y;(y=this._mathfield)==null||y.resetUndo()}canUndo(){return this._mathfield?this._mathfield.canUndo():!1}canRedo(){return this._mathfield?this._mathfield.canRedo():!1}handleEvent(y){var b,E,ee,re;Fs.state==="closed"&&((E=(b=this._mathfield)==null?void 0:b.menu)==null?void 0:E.state)==="closed"&&(y.type==="pointerdown"&&this.onPointerDown(),y.type==="focus"&&((ee=this._mathfield)==null||ee.focus()),y.type==="blur"&&((re=this._mathfield)==null||re.blur()))}connectedCallback(){var y,b,E,ee;const re=window.getComputedStyle(this),ae=this.shadowRoot,ue=re.userSelect!=="none";if(ue)ae.host.addEventListener("pointerdown",this,!0);else{const be=ae.querySelector("span");be.style.pointerEvents="none"}ae.host.addEventListener("focus",this,!0),ae.host.addEventListener("blur",this,!0),Su()||(this.hasAttribute("role")||this.setAttribute("role","math"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","math input field"),this.setAttribute("aria-multiline","false")),ue&&!this.hasAttribute("contenteditable")&&this.setAttribute("contenteditable","true"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");const he=ae.querySelector("slot:not([name])");if(he)try{this._style=he.assignedElements().filter(be=>be.tagName.toLowerCase()==="style").map(be=>be.textContent).join("")}catch(be){console.error(be)}if(this._style){const be=document.createElement("style");be.textContent=this._style,ae.appendChild(be)}let ge="";if(this.hasAttribute("value")?ge=this.getAttribute("value"):ge=(y=he==null?void 0:he.assignedNodes().map(be=>be.nodeType===3?be.textContent:"").join("").trim())!=null?y:"",this._mathfield=new h1(ae.querySelector(":host > span"),ke(Ce({},(E=(b=Ii.get(this))==null?void 0:b.options)!=null?E:Id(this)),{eventSink:this,value:ge})),!Ii.has(this)){this.upgradeProperty("disabled"),this.upgradeProperty("readonly");for(const be of Object.keys(Mc.optionsAttributes))this.upgradeProperty(gl(be))}if(!((ee=this._mathfield)!=null&&ee.model)){this._mathfield=null;return}if(Ii.has(this)){const be=this._mathfield,Be=Ii.get(this),He=Be.menuItems;be.model.deferNotifications({content:!1,selection:!1},()=>{const lt=Be.value;lt!==void 0&&be.setValue(lt),be.model.selection=Be.selection,Ii.delete(this)}),He&&(this.menuItems=He)}window.queueMicrotask(()=>{this.isConnected&&this.dispatchEvent(new Event("mount",{cancelable:!1,bubbles:!0,composed:!0}))}),Eh()}disconnectedCallback(){var y,b;if(this.shadowRoot.host.removeEventListener("pointerdown",this,!0),!this._mathfield)return;window.queueMicrotask(()=>this.dispatchEvent(new Event("unmount",{cancelable:!1,bubbles:!0,composed:!0})));const E=gc(this._mathfield.options,Object.keys(Mc.optionsAttributes).map(ee=>gl(ee)));Ii.set(this,{value:this._mathfield.getValue(),selection:this._mathfield.model.selection,menuItems:(b=(y=this._mathfield.menu)==null?void 0:y.menuItems)!=null?b:void 0,options:E}),this._mathfield.dispose(),this._mathfield=null}upgradeProperty(y){if(this.hasOwnProperty(y)){const b=this[y];delete this[y],(y==="readonly"||y==="read-only")&&(y="readOnly"),this[y]=b}}attributeChangedCallback(y,b,E){if(b===E)return;const ee=E!==null;switch(y){case"contenteditable":va(this._mathfield);break;case"disabled":this.disabled=ee;break;case"read-only":case"readonly":this.readOnly=ee;break;default:}}get readonly(){return this.hasAttribute("readonly")||this.hasAttribute("read-only")}set readonly(y){const b=!!y;b?(this.setAttribute("readonly",""),Su()?this._internals.ariaReadOnly="true":this.setAttribute("aria-readonly","true"),this.setAttribute("aria-readonly","true")):(Su()?this._internals.ariaReadOnly="false":this.removeAttribute("aria-readonly"),this.removeAttribute("readonly"),this.removeAttribute("read-only")),this._setOptions({readOnly:b})}get disabled(){return this.hasAttribute("disabled")}set disabled(y){var b;const E=!!y;E?this.setAttribute("disabled",""):this.removeAttribute("disabled"),Su()?this._internals.ariaDisabled=E?"true":"false":this.setAttribute("aria-disabled",E?"true":"false"),E&&((b=this._mathfield)!=null&&b.hasFocus)&&window.mathVirtualKeyboard.visible&&this._mathfield.executeCommand("hideVirtualKeyboard")}get value(){return this.getValue()}set value(y){this.setValue(y)}get defaultMode(){return this._getOption("defaultMode")}set defaultMode(y){this._setOptions({defaultMode:y})}get macros(){return this._getOption("macros")}set macros(y){this._setOptions({macros:y})}get registers(){const y=this;return new Proxy({},{get:(b,E)=>{if(typeof E=="string")return y._getOption("registers")[E]},set(b,E,ee){return typeof E!="string"?!1:(y._setOptions({registers:ke(Ce({},y._getOption("registers")),{[E]:ee})}),!0)}})}set registers(y){this._setOptions({registers:y})}get colorMap(){return this._getOption("colorMap")}set colorMap(y){this._setOptions({colorMap:y})}get backgroundColorMap(){return this._getOption("backgroundColorMap")}set backgroundColorMap(y){this._setOptions({backgroundColorMap:y})}get letterShapeStyle(){return this._getOption("letterShapeStyle")}set letterShapeStyle(y){this._setOptions({letterShapeStyle:y})}get minFontScale(){return this._getOption("minFontScale")}set minFontScale(y){this._setOptions({minFontScale:y})}get smartMode(){return this._getOption("smartMode")}set smartMode(y){this._setOptions({smartMode:y})}get smartFence(){return this._getOption("smartFence")}set smartFence(y){this._setOptions({smartFence:y})}get smartSuperscript(){return this._getOption("smartSuperscript")}set smartSuperscript(y){this._setOptions({smartSuperscript:y})}get scriptDepth(){return this._getOption("scriptDepth")}set scriptDepth(y){this._setOptions({scriptDepth:y})}get removeExtraneousParentheses(){return this._getOption("removeExtraneousParentheses")}set removeExtraneousParentheses(y){this._setOptions({removeExtraneousParentheses:y})}get mathModeSpace(){return this._getOption("mathModeSpace")}set mathModeSpace(y){this._setOptions({mathModeSpace:y})}get placeholderSymbol(){return this._getOption("placeholderSymbol")}set placeholderSymbol(y){this._setOptions({placeholderSymbol:y})}get popoverPolicy(){return this._getOption("popoverPolicy")}set popoverPolicy(y){this._setOptions({popoverPolicy:y})}get environmentPopoverPolicy(){return this._getOption("environmentPopoverPolicy")}set environmentPopoverPolicy(y){this._setOptions({environmentPopoverPolicy:y})}get menuItems(){var y,b,E;return this._mathfield?(y=this._mathfield.menu._menuItems.map(ee=>ee.menuItem))!=null?y:[]:(E=(b=Ii.get(this))==null?void 0:b.menuItems)!=null?E:[]}set menuItems(y){var b;if(this._mathfield){const E=(b=this._mathfield.element)==null?void 0:b.querySelector("[part=menu-toggle]");E&&(E.style.display=y.length===0?"none":""),this._mathfield.menu.menuItems=y}Ii.has(this)?Ii.set(this,ke(Ce({},Ii.get(this)),{menuItems:y})):Ii.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:Id(this),menuItems:y})}get mathVirtualKeyboardPolicy(){return this._getOption("mathVirtualKeyboardPolicy")}set mathVirtualKeyboardPolicy(y){this._setOptions({mathVirtualKeyboardPolicy:y})}get inlineShortcuts(){return this._getOption("inlineShortcuts")}set inlineShortcuts(y){this._setOptions({inlineShortcuts:y})}get inlineShortcutTimeout(){return this._getOption("inlineShortcutTimeout")}set inlineShortcutTimeout(y){this._setOptions({inlineShortcutTimeout:y})}get keybindings(){return this._getOption("keybindings")}set keybindings(y){this._setOptions({keybindings:y})}get onInlineShortcut(){return this._getOption("onInlineShortcut")}set onInlineShortcut(y){this._setOptions({onInlineShortcut:y})}get onScrollIntoView(){return this._getOption("onScrollIntoView")}set onScrollIntoView(y){this._setOptions({onScrollIntoView:y})}get onExport(){return this._getOption("onExport")}set onExport(y){this._setOptions({onExport:y})}get readOnly(){return this._getOption("readOnly")}set readOnly(y){this._setOptions({readOnly:y})}get isSelectionEditable(){var y,b;return(b=(y=this._mathfield)==null?void 0:y.isSelectionEditable)!=null?b:!1}setPromptState(y,b,E){var ee;(ee=this._mathfield)==null||ee.setPromptState(y,b,E)}getPromptState(y){var b,E;return(E=(b=this._mathfield)==null?void 0:b.getPromptState(y))!=null?E:[void 0,!0]}get virtualKeyboardTargetOrigin(){return this._getOption("virtualKeyboardTargetOrigin")}set virtualKeyboardTargetOrigin(y){this._setOptions({virtualKeyboardTargetOrigin:y})}get selection(){return this._mathfield?this._mathfield.model.selection:Ii.has(this)?Ii.get(this).selection:{ranges:[[0,0]],direction:"forward"}}set selection(y){if(typeof y=="number"&&(y={ranges:[[y,y]]}),this._mathfield){this._mathfield.model.selection=y,va(this._mathfield);return}if(Ii.has(this)){Ii.set(this,ke(Ce({},Ii.get(this)),{selection:y}));return}Ii.set(this,{value:void 0,selection:y,options:Id(this),menuItems:void 0})}get selectionIsCollapsed(){const y=this.selection;return y.ranges.length===1&&y.ranges[0][0]===y.ranges[0][1]}get position(){return this._mathfield?this._mathfield.model.position:Ii.has(this)?Ii.get(this).selection.ranges[0][0]:0}set position(y){if(this._mathfield&&(this._mathfield.model.position=y,va(this._mathfield)),Ii.has(this)){Ii.set(this,ke(Ce({},Ii.get(this)),{selection:{ranges:[[y,y]]}}));return}Ii.set(this,{value:void 0,selection:{ranges:[[y,y]]},options:Id(this),menuItems:void 0})}getOffsetDepth(y){var b,E;return this._mathfield?((E=(b=this._mathfield.model.at(y))==null?void 0:b.treeDepth)!=null?E:2)-2:0}get lastOffset(){var y,b;return(b=(y=this._mathfield)==null?void 0:y.model.lastOffset)!=null?b:-1}};Qa.version="0.98.5",Qa._fontsDirectory="./fonts",Qa._soundsDirectory="./sounds",Qa.keypressVibration=!0,Qa._keypressSound={spacebar:"keypress-spacebar.wav",return:"keypress-return.wav",delete:"keypress-delete.wav",default:"keypress-standard.wav"},Qa._plonkSound="plonk.wav",Qa.audioBuffers={},Qa.createHTML=a=>a,Qa._speechEngineRate="100%",Qa._speechEngineVoice="Joanna",Qa._textToSpeechMarkup="",Qa._textToSpeechRules="mathlive",Qa._textToSpeechRulesOptions={},Qa.speakHook=r1,Qa.readAloudHook=f1,Qa._decimalSeparator=".",Qa.fractionNavigationOrder="numerator-denominator",Qa._isFunction=a=>{var y,b;const E=window.MathfieldElement.computeEngine;return(b=(y=E==null?void 0:E.parse(a).domain)==null?void 0:y.isFunction)!=null?b:!1};var Pd=Qa;function gl(a){return a.replace(/[^a-zA-Z\d]+(.)/g,(y,b)=>b.toUpperCase())}function Id(a){const y={readOnly:!1},b=Pd.optionsAttributes;return Object.keys(b).forEach(E=>{if(a.hasAttribute(E)){const ee=a.getAttribute(E);E==="placeholder"?y.contentPlaceholder=ee!=null?ee:"":b[E]==="boolean"?y[gl(E)]=!0:b[E]==="on/off"?ee==="on"?y[gl(E)]=!0:ee==="off"?y[gl(E)]=!1:y[gl(E)]=void 0:b[E]==="number"?y[gl(E)]=Number.parseFloat(ee!=null?ee:"0"):y[gl(E)]=ee}}),y}function Su(){return!(!("ElementInternals"in window)||!HTMLElement.prototype.attachInternals||!("role"in window.ElementInternals.prototype))}var vp=Pd,yp,bp,xp,wp;if(kt()&&!((yp=window.customElements)!=null&&yp.get("math-field"))){(xp=window[bp=Symbol.for("io.cortexjs.mathlive")])!=null||(window[bp]={});const a=window[Symbol.for("io.cortexjs.mathlive")];a.version="0.98.5",window.MathfieldElement=Pd,(wp=window.customElements)==null||wp.define("math-field",Pd)}function m1(a,y,b){let E=b,ee=0;const re=a.length;for(;E<y.length;){const ae=y[E];if(ee<=0&&y.slice(E,E+re)===a)return E;ae==="\\"?E++:ae==="{"?ee++:ae==="}"&&ee--,E++}return-1}function qh(a,y,b,E,ee="latex"){const re=[];for(const ae of a)if(ae.type==="text"){const ue=ae.data;let he=!0,ge=0,be;be=ue.indexOf(y),be!==-1&&(ge=be,ge>0&&re.push({type:"text",data:ue.slice(0,ge)}),he=!1);let Be=!1;for(;!Be;){if(he){if(be=ue.indexOf(y,ge),be===-1){Be=!0;break}ge!==be&&re.push({type:"text",data:ue.slice(ge,be)}),ge=be}else{if(be=m1(b,ue,ge+y.length),be===-1){Be=!0;break}let He=ue.slice(ge+y.length,be);ee==="ascii-math"&&([,He]=uc(He,{format:"ascii-math"})),re.push({type:"math",data:He,rawData:ue.slice(ge,be+b.length),mathstyle:E}),ge=be+b.length}he=!he}ge<ue.length&&re.push({type:"text",data:ue.slice(ge)})}else re.push(ae);return re}function Sp(a,y,b){let E=[{type:"text",data:a}];return y!=null&&y.inline&&y.inline.forEach(([ee,re])=>{E=qh(E,ee,re,"textstyle")}),y!=null&&y.display&&y.display.forEach(([ee,re])=>{E=qh(E,ee,re,"displaystyle")}),b!=null&&b.inline&&b.inline.forEach(([ee,re])=>{E=qh(E,ee,re,"textstyle","ascii-math")}),b!=null&&b.display&&b.display.forEach(([ee,re])=>{E=qh(E,ee,re,"displaystyle","ascii-math")}),E}function g1(a,y){const b=document.createElement("span");b.setAttribute("translate","no");try{const E="<math xmlns='http://www.w3.org/1998/Math/MathML'>"+y.renderToMathML(a)+"</math>";b.innerHTML=window.MathfieldElement.createHTML(E)}catch(E){console.error(`MathLive 0.98.5: Could not convert "${a}"' to MathML with ${E}`),b.textContent=a}return b.className="ML__sr-only",b}function v1(a,y,b,E){try{const ee=y.renderToMarkup(a,{mathstyle:b,format:"html"}),re=document.createElement("span");return re.dataset.latex=a,re.style.display=b==="displaystyle"?"flex":"inline-flex",re.setAttribute("aria-hidden","true"),re.setAttribute("translate","no"),re.innerHTML=window.MathfieldElement.createHTML(ee),re}catch(ee){if(console.error("Could not parse'"+a+"' with ",ee),E)return document.createTextNode(a)}return null}function Cu(a,y,b,E){var ee;const re=v1(a,b,y||"textstyle",E),ae=(ee=b.renderAccessibleContent)!=null?ee:"";if(re&&/\b(mathml|speakable-text)\b/i.test(ae)){const ue=document.createElement("span");if(/\bmathml\b/i.test(ae)&&b.renderToMathML&&ue.append(g1(a,b)),/\bspeakable-text\b/i.test(ae)&&b.renderToSpeakableText){const he=document.createElement("span");he.setAttribute("translate","no");const ge=b.renderToSpeakableText(a);he.innerHTML=window.MathfieldElement.createHTML(ge),he.className="ML__sr-only",ue.append(he)}return ue.append(re),ue}return re}function y1(a,y){var b,E,ee;let re=null;if((b=y.TeX)!=null&&b.processEnvironments&&/^\s*\\begin/.test(a)){re=document.createDocumentFragment();const ae=Cu(a,"",y,!0);ae&&re.appendChild(ae)}else{if(!a.trim())return null;const ae=Sp(a,(E=y.TeX)==null?void 0:E.delimiters,(ee=y.asciiMath)==null?void 0:ee.delimiters);if(ae.length===1&&ae[0].type==="text")return null;re=document.createDocumentFragment();for(const ue of ae)if(ue.type==="text")re.appendChild(document.createTextNode(ue.data));else{const he=Cu(ue.data,ue.mathstyle==="textstyle"?"textstyle":"displaystyle",y,!0);he&&re.appendChild(he)}}return re}function Cp(a,y){var b,E,ee,re,ae,ue,he,ge,be,Be,He,lt,xt,vn,nr,fn;if(a.childNodes.length===1&&a.childNodes[0].nodeType===3){const Rn=(b=a.childNodes[0].textContent)!=null?b:"";if((E=y.TeX)!=null&&E.processEnvironments&&/^\s*\\begin/.test(Rn)){a.textContent="";const Fn=Cu(Rn,"",y,!0);Fn&&a.append(Fn);return}const cr=Sp(Rn,(ee=y.TeX)==null?void 0:ee.delimiters,(re=y.asciiMath)==null?void 0:re.delimiters);if(cr.length===1&&cr[0].type==="math"){a.textContent="";const Fn=Cu(cr[0].data,cr[0].mathstyle==="textstyle"?"textstyle":"displaystyle",y,!0);Fn&&a.append(Fn);return}if(cr.length===1&&cr[0].type==="text")return}for(let Rn=a.childNodes.length-1;Rn>=0;Rn--){const cr=a.childNodes[Rn];if(cr.nodeType===3){const Fn=y1((ae=cr.textContent)!=null?ae:"",y);Fn&&(Rn+=Fn.childNodes.length-1,cr.replaceWith(Fn))}else if(cr.nodeType===1){const Fn=cr,Hr=cr.nodeName.toLowerCase();if(Hr==="script"){const Jr=cr;let jr;if((ue=y.processScriptTypePattern)!=null&&ue.test(Jr.type))jr=(he=Jr.textContent)!=null?he:"";else if((ge=y.processMathJSONScriptTypePattern)!=null&&ge.test(Jr.type))try{jr=(Be=y.serializeToLatex)==null?void 0:Be.call(y,JSON.parse((be=Jr.textContent)!=null?be:""))}catch(Ti){console.error(Ti)}if(jr){let Ti="textstyle";for(const xr of Jr.type.split(";")){const[Wo,js]=xr.toLowerCase().split("=");Wo.trim()==="mode"&&(Ti=js.trim()==="display"?"displaystyle":"textstyle")}const Ui=Cu(jr,Ti,y,!0);Ui&&Jr.parentNode.replaceChild(Ui,Jr)}}else if(((lt=(He=y.processClassPattern)==null?void 0:He.test(Fn.className))!=null?lt:!1)||!((vn=(xt=y.skipTags)==null?void 0:xt.includes(Hr))!=null&&vn||(fn=(nr=y.ignoreClassPattern)==null?void 0:nr.test(Fn.className))!=null&&fn))if(a.childNodes.length===1&&a.childNodes[0].nodeType===3){const jr=a.textContent;a.textContent="";const Ti=Cu(jr!=null?jr:"","displaystyle",y,!0);Ti&&a.append(Ti)}else Cp(Fn,y)}}}var b1={skipTags:["math-field","noscript","style","textarea","pre","code","annotation","annotation-xml"],processScriptType:"math/tex",processMathJSONScriptType:"math/json",ignoreClass:"tex2jax_ignore",processClass:"tex2jax_process",renderAccessibleContent:"mathml",asciiMath:{delimiters:{inline:[["`","`"]]}},TeX:{processEnvironments:!0,delimiters:{inline:[["\\(","\\)"]],display:[["$$","$$"],["\\[","\\]"]]}}};function x1(a,y){var b,E,ee,re;try{const ae=Ce(Ce({},b1),y);ae.ignoreClassPattern=new RegExp((b=ae.ignoreClass)!=null?b:""),ae.processClassPattern=new RegExp((E=ae.processClass)!=null?E:""),ae.processScriptTypePattern=new RegExp((ee=ae.processScriptType)!=null?ee:""),ae.processMathJSONScriptTypePattern=new RegExp((re=ae.processMathJSONScriptType)!=null?re:""),Eh(),Bo("core"),Cp(a,ae)}catch(ae){ae instanceof Error?console.error("renderMathInElement(): "+ae.message):console.error("renderMathInElement(): Could not render math for element",a)}}function w1(a,y){const b=Rl.singleton;return b?(b.show(),wd(),b.currentLayer=y,b.render(),b.focus(),!0):!1}function S1(){const a=window.mathVirtualKeyboard;return a.visible?a.hide({animate:!0}):a.show({animate:!0}),!1}Oo({switchKeyboardLayer:w1,toggleVirtualKeyboard:S1,hideVirtualKeyboard:()=>(window.mathVirtualKeyboard.hide({animate:!0}),!1),showVirtualKeyboard:()=>(window.mathVirtualKeyboard.show({animate:!0}),!1)},{target:"virtual-keyboard"});function Fl(){var a,y;return(y=globalThis[a=Symbol.for("io.cortexjs.mathlive")])!=null||(globalThis[a]={}),globalThis[Symbol.for("io.cortexjs.mathlive")]}function A1(){return console.warn("%cMathLive 0.98.5: %cmakeSharedVirtualKeyboard() is deprecated. \n Use `window.mathVirtualKeyboard` to access the virtual keyboard instance.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),window.mathVirtualKeyboard}function T1(a){M1(document.body,a)}function C1(a){if(typeof a=="string"){const y=document.getElementById(a);if(y===null)throw new Error(`The element with ID "${a}" could not be found.`);return y}return typeof a=="string"?null:a}function M1(a,y){var b,E,ee,re;const ae=C1(a);if(!ae)return;const ue=y!=null?y:{};(b=ue.renderToMarkup)!=null||(ue.renderToMarkup=Va),(E=ue.renderToMathML)!=null||(ue.renderToMathML=Rv),(ee=ue.renderToSpeakableText)!=null||(ue.renderToSpeakableText=Nv),(re=ue.serializeToLatex)!=null||(ue.serializeToLatex=$v),x1(ae,ue)}var P1={mathlive:"0.98.5"}},16722:function(kn,dn,de){"use strict";de.d(dn,{Z:function(){return Ce}});const pe=ke=>typeof ke=="object"&&ke!=null&&ke.nodeType===1,ut=(ke,Fe)=>(!Fe||ke!=="hidden")&&ke!=="visible"&&ke!=="clip",$e=(ke,Fe)=>{if(ke.clientHeight<ke.scrollHeight||ke.clientWidth<ke.scrollWidth){const gt=getComputedStyle(ke,null);return ut(gt.overflowY,Fe)||ut(gt.overflowX,Fe)||(Oe=>{const je=(kt=>{if(!kt.ownerDocument||!kt.ownerDocument.defaultView)return null;try{return kt.ownerDocument.defaultView.frameElement}catch(et){return null}})(Oe);return!!je&&(je.clientHeight<Oe.scrollHeight||je.clientWidth<Oe.scrollWidth)})(ke)}return!1},ct=(ke,Fe,gt,Oe,je,kt,et,mt)=>kt<ke&&et>Fe||kt>ke&&et<Fe?0:kt<=ke&&mt<=gt||et>=Fe&&mt>=gt?kt-ke-Oe:et>Fe&&mt<gt||kt<ke&&mt>gt?et-Fe+je:0,Se=ke=>{const Fe=ke.parentElement;return Fe==null?ke.getRootNode().host||null:Fe},Pe=(ke,Fe)=>{var gt,Oe,je,kt;if(typeof document=="undefined")return[];const{scrollMode:et,block:mt,inline:st,boundary:Rt,skipOverflowHiddenElements:tn}=Fe,nt=typeof Rt=="function"?Rt:Ut=>Ut!==Rt;if(!pe(ke))throw new TypeError("Invalid target");const ht=document.scrollingElement||document.documentElement,Ve=[];let Ee=ke;for(;pe(Ee)&&nt(Ee);){if(Ee=Se(Ee),Ee===ht){Ve.push(Ee);break}Ee!=null&&Ee===document.body&&$e(Ee)&&!$e(document.documentElement)||Ee!=null&&$e(Ee,tn)&&Ve.push(Ee)}const Xe=(Oe=(gt=window.visualViewport)==null?void 0:gt.width)!=null?Oe:innerWidth,at=(kt=(je=window.visualViewport)==null?void 0:je.height)!=null?kt:innerHeight,{scrollX:vt,scrollY:Ue}=window,{height:Ot,width:rt,top:At,right:qe,bottom:Ht,left:cn}=ke.getBoundingClientRect(),{top:Kt,right:Xt,bottom:Wt,left:ze}=(Ut=>{const Ge=window.getComputedStyle(Ut);return{top:parseFloat(Ge.scrollMarginTop)||0,right:parseFloat(Ge.scrollMarginRight)||0,bottom:parseFloat(Ge.scrollMarginBottom)||0,left:parseFloat(Ge.scrollMarginLeft)||0}})(ke);let xe=mt==="start"||mt==="nearest"?At-Kt:mt==="end"?Ht+Wt:At+Ot/2-Kt+Wt,bt=st==="center"?cn+rt/2-ze+Xt:st==="end"?qe+Xt:cn-ze;const pn=[];for(let Ut=0;Ut<Ve.length;Ut++){const Ge=Ve[Ut],{height:Ye,width:It,top:Mn,right:jt,bottom:bn,left:Vt}=Ge.getBoundingClientRect();if(et==="if-needed"&&At>=0&&cn>=0&&Ht<=at&&qe<=Xe&&(Ge===ht&&!$e(Ge)||At>=Mn&&Ht<=bn&&cn>=Vt&&qe<=jt))return pn;const Zt=getComputedStyle(Ge),zt=parseInt(Zt.borderLeftWidth,10),ve=parseInt(Zt.borderTopWidth,10),se=parseInt(Zt.borderRightWidth,10),oe=parseInt(Zt.borderBottomWidth,10);let fe=0,ye=0;const ce="offsetWidth"in Ge?Ge.offsetWidth-Ge.clientWidth-zt-se:0,Ke="offsetHeight"in Ge?Ge.offsetHeight-Ge.clientHeight-ve-oe:0,Dt="offsetWidth"in Ge?Ge.offsetWidth===0?0:It/Ge.offsetWidth:0,ln="offsetHeight"in Ge?Ge.offsetHeight===0?0:Ye/Ge.offsetHeight:0;if(ht===Ge)fe=mt==="start"?xe:mt==="end"?xe-at:mt==="nearest"?ct(Ue,Ue+at,at,ve,oe,Ue+xe,Ue+xe+Ot,Ot):xe-at/2,ye=st==="start"?bt:st==="center"?bt-Xe/2:st==="end"?bt-Xe:ct(vt,vt+Xe,Xe,zt,se,vt+bt,vt+bt+rt,rt),fe=Math.max(0,fe+Ue),ye=Math.max(0,ye+vt);else{fe=mt==="start"?xe-Mn-ve:mt==="end"?xe-bn+oe+Ke:mt==="nearest"?ct(Mn,bn,Ye,ve,oe+Ke,xe,xe+Ot,Ot):xe-(Mn+Ye/2)+Ke/2,ye=st==="start"?bt-Vt-zt:st==="center"?bt-(Vt+It/2)+ce/2:st==="end"?bt-jt+se+ce:ct(Vt,jt,It,zt,se+ce,bt,bt+rt,rt);const{scrollLeft:Jt,scrollTop:en}=Ge;fe=ln===0?0:Math.max(0,Math.min(en+fe/ln,Ge.scrollHeight-Ye/ln+Ke)),ye=Dt===0?0:Math.max(0,Math.min(Jt+ye/Dt,Ge.scrollWidth-It/Dt+ce)),xe+=en-fe,bt+=Jt-ye}pn.push({el:Ge,top:fe,left:ye})}return pn},Ne=ke=>ke===!1?{block:"end",inline:"nearest"}:(Fe=>Fe===Object(Fe)&&Object.keys(Fe).length!==0)(ke)?ke:{block:"start",inline:"nearest"};function Ce(ke,Fe){if(!ke.isConnected||!(je=>{let kt=je;for(;kt&&kt.parentNode;){if(kt.parentNode===document)return!0;kt=kt.parentNode instanceof ShadowRoot?kt.parentNode.host:kt.parentNode}return!1})(ke))return;const gt=(je=>{const kt=window.getComputedStyle(je);return{top:parseFloat(kt.scrollMarginTop)||0,right:parseFloat(kt.scrollMarginRight)||0,bottom:parseFloat(kt.scrollMarginBottom)||0,left:parseFloat(kt.scrollMarginLeft)||0}})(ke);if((je=>typeof je=="object"&&typeof je.behavior=="function")(Fe))return Fe.behavior(Pe(ke,Fe));const Oe=typeof Fe=="boolean"||Fe==null?void 0:Fe.behavior;for(const{el:je,top:kt,left:et}of Pe(ke,Ne(Fe))){const mt=kt-gt.top+gt.bottom,st=et-gt.left+gt.right;je.scroll({top:mt,left:st,behavior:Oe})}}}}]);
}());