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__User__Detail__Topics__Ex...

3406 lines
1.6 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 qs=Math.pow;var zl=(bn,tn,ue)=>new Promise((se,Te)=>{var ze=Me=>{try{xe(ue.next(Me))}catch(De){Te(De)}},ut=Me=>{try{xe(ue.throw(Me))}catch(De){Te(De)}},xe=Me=>Me.done?se(Me.value):Promise.resolve(Me.value).then(ze,ut);xe((ue=ue.apply(bn,tn)).next())});(self.webpackChunk=self.webpackChunk||[]).push([[7043],{40001:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return we}});var se=ue(60499),Te=ue(59301),ze={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"},ut=ze,xe=ue(7657),Me=function(Re,dt){return Te.createElement(xe.Z,(0,se.Z)({},Re,{ref:dt,icon:ut}))},De=Te.forwardRef(Me),we=De},49198:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return we}});var se=ue(60499),Te=ue(59301),ze={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"},ut=ze,xe=ue(7657),Me=function(Re,dt){return Te.createElement(xe.Z,(0,se.Z)({},Re,{ref:dt,icon:ut}))},De=Te.forwardRef(Me),we=De},84105:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return we}});var se=ue(60499),Te=ue(59301),ze={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"},ut=ze,xe=ue(7657),Me=function(Re,dt){return Te.createElement(xe.Z,(0,se.Z)({},Re,{ref:dt,icon:ut}))},De=Te.forwardRef(Me),we=De},18785:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return we}});var se=ue(60499),Te=ue(59301),ze={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"},ut=ze,xe=ue(7657),Me=function(Re,dt){return Te.createElement(xe.Z,(0,se.Z)({},Re,{ref:dt,icon:ut}))},De=Te.forwardRef(Me),we=De},73331:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return we}});var se=ue(60499),Te=ue(59301),ze={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"},ut=ze,xe=ue(7657),Me=function(Re,dt){return Te.createElement(xe.Z,(0,se.Z)({},Re,{ref:dt,icon:ut}))},De=Te.forwardRef(Me),we=De},15277:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return we}});var se=ue(60499),Te=ue(59301),ze={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"},ut=ze,xe=ue(7657),Me=function(Re,dt){return Te.createElement(xe.Z,(0,se.Z)({},Re,{ref:dt,icon:ut}))},De=Te.forwardRef(Me),we=De},33853:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return we}});var se=ue(60499),Te=ue(59301),ze={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},ut=ze,xe=ue(7657),Me=function(Re,dt){return Te.createElement(xe.Z,(0,se.Z)({},Re,{ref:dt,icon:ut}))},De=Te.forwardRef(Me),we=De},32134:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return we}});var se=ue(60499),Te=ue(59301),ze={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{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"}}]},name:"plus-circle",theme:"outlined"},ut=ze,xe=ue(7657),Me=function(Re,dt){return Te.createElement(xe.Z,(0,se.Z)({},Re,{ref:dt,icon:ut}))},De=Te.forwardRef(Me),we=De},62772:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return we}});var se=ue(60499),Te=ue(59301),ze={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"},ut=ze,xe=ue(7657),Me=function(Re,dt){return Te.createElement(xe.Z,(0,se.Z)({},Re,{ref:dt,icon:ut}))},De=Te.forwardRef(Me),we=De},61485:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return we}});var se=ue(60499),Te=ue(59301),ze={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"},ut=ze,xe=ue(7657),Me=function(Re,dt){return Te.createElement(xe.Z,(0,se.Z)({},Re,{ref:dt,icon:ut}))},De=Te.forwardRef(Me),we=De},38819:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return we}});var se=ue(60499),Te=ue(59301),ze={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},ut=ze,xe=ue(7657),Me=function(Re,dt){return Te.createElement(xe.Z,(0,se.Z)({},Re,{ref:dt,icon:ut}))},De=Te.forwardRef(Me),we=De},47472:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return we}});var se=ue(60499),Te=ue(59301),ze={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"},ut=ze,xe=ue(7657),Me=function(Re,dt){return Te.createElement(xe.Z,(0,se.Z)({},Re,{ref:dt,icon:ut}))},De=Te.forwardRef(Me),we=De},87395:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return we}});var se=ue(60499),Te=ue(59301),ze={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"},ut=ze,xe=ue(7657),Me=function(Re,dt){return Te.createElement(xe.Z,(0,se.Z)({},Re,{ref:dt,icon:ut}))},De=Te.forwardRef(Me),we=De},14618:function(){"use strict"},66552:function(){"use strict"},18760:function(bn,tn){"use strict";tn.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},3352: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 bn={},tn="5.0",ue={},se=null,Te=!1,ze=!1,ut=null,xe=!1,Me=null,De=null,we=0;we<arguments.length;we++){var _e=arguments[we];if(_e!==null)switch(typeof _e){case"number":tn=_e.toFixed(1);break;case"string":_e.match(new RegExp("^[0-9]\\.[0-9]+$"))?tn=_e:ut=_e;break;case"object":typeof _e.is3D!="undefined"?se=_e:ue=_e;break;case"boolean":Te=_e,ze=!0;break}}se===null&&(se={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},ue.material_id!==void 0&&!ze&&(Te=!0)),ut!==null&&ue.id===void 0&&(ue.id=ut);var Re="",dt="",Ae=!1,Fe=null,ft=null,Ye=null,ot=!1,at=null,Ct=null,jt=null,it=null,vt=null;ue.height!==void 0&&(ue.height=Math.round(ue.height)),ue.width!==void 0&&(ue.width=Math.round(ue.width));var $e=function(qe){return parseFloat(qe)>4?parseFloat(qe):5};bn.setHTML5Codebase=function(qe,nt){De=qe,xt(qe,nt)},bn.setJavaCodebase=bn.setJavaCodebaseVersion=bn.isCompiledInstalled=bn.setPreCompiledScriptPath=bn.setPreCompiledResourcePath=function(){},bn.setHTML5CodebaseVersion=function(qe,nt){var Ot=parseFloat(qe);if(Ot!==NaN&&Ot<5){console.log("The GeoGebra HTML5 codebase version "+Ot+" is deprecated. Using version latest instead.");return}Me=qe,be(qe,nt)},bn.getHTML5CodebaseVersion=function(){return ft},bn.getParameters=function(){return ue},bn.setFontsCSSURL=function(qe){it=qe},bn.setGiacJSURL=function(qe){},bn.setJNLPFile=function(qe){Re=qe},bn.setJNLPBaseDir=function(qe){},bn.inject=function(){function qe(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var nt="auto",Ot=ue.id,dn,en=!1,on=0;on<arguments.length;on++){var Xt=arguments[on];typeof Xt=="string"?(Xt=Xt.toLowerCase(),Xt.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?nt=Xt:Ot=arguments[on]):typeof Xt=="boolean"?en=Xt:Xt instanceof HTMLElement&&(dn=Xt)}Ut();function Ut(){if(!xe){setTimeout(Ut,200);return}nt=wt(nt);var Zt=dn||document.getElementById(Ot);if(!Zt){console.log("possibly bug on ajax loading? ");return}if(bn.removeExistingApplet(Zt,!1),ue.width===void 0&&Zt.clientWidth&&(ue.width=Zt.clientWidth),ue.height===void 0&&Zt.clientHeight&&(ue.height=Zt.clientHeight),!(ue.width&&ue.height)&&nt==="html5"&&(delete ue.width,delete ue.height),Fe=nt,nt==="screenshot")tt(Zt,ue);else{var ye=!1;ue.hasOwnProperty("playButton")&&ue.playButton||ue.hasOwnProperty("clickToLoad")&&ue.clickToLoad?ye=!0:ue.hasOwnProperty("playButtonAutoDecide")&&ue.playButtonAutoDecide&&(ye=(!Ee()||qe())&&Ve()),ye?(Fe="screenshot",pt(Zt,ue,en,nt)):kt(Zt,ue,en)}}};function Ee(){try{return window.self!==window.top}catch(qe){return!0}}function Ve(){return ue.hasOwnProperty("screenshotGenerator")&&ue.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}bn.getViews=function(){return se},bn.isJavaInstalled=function(){return!1};var Je=function(qe){var nt=function(on){var Xt=JSON.parse(on),Ut=function(le){return le.type=="G"||le.type=="E"},Zt=Xt.elements?Xt.elements.filter(Ut)[0]:Xt;if(!Zt||!Zt.url){Ot();return}ue.fileName=Zt.url,Lt(Zt.settings||{}),se.is3D=!0;var ye="https://www.geogebra.org/images/";bn.setPreviewImage(at||Zt.previewUrl,ye+"GeoGebra_loading.png",ye+"applet_play.png"),qe()},Ot=function(){ue.onError&&ue.onError(),Qt("Error: Fetching material (id "+ue.material_id+") failed.",ue)},dn=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",en="/materials/"+ue.material_id+"?scope=basic";et("https://"+dn+"/api/proxy.php?path="+encodeURIComponent(en),nt,Ot)};function Lt(qe){var nt=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(Ot){qe[Ot]=!!qe[Ot]}),nt.forEach(function(Ot){ue[Ot]===void 0&&qe[Ot]!==void 0&&(ue[Ot]=qe[Ot])}),ue.showToolBarHelp===void 0&&(ue.showToolBarHelp=ue.showToolBar)}function et(qe,nt,Ot){var dn=new XMLHttpRequest;dn.open("GET",qe),dn.onload=function(){nt(dn.responseText)},dn.onerror=Ot,dn.send()}bn.isHTML5Installed=function(){return!0},bn.getLoadedAppletType=function(){return Fe},bn.setPreviewImage=function(qe,nt,Ot){at=qe,Ct=nt,jt=Ot},bn.removeExistingApplet=function(qe,nt){var Ot;typeof qe=="string"&&(qe=document.getElementById(qe)),Fe=null;var dn=null;for(Ot=0;Ot<qe.childNodes.length;Ot++){var en=qe.childNodes[Ot],on=en.className;on==="applet_screenshot"?nt?(en.style.display="block",Fe="screenshot"):en.style.display="none":on!=="applet_scaler prerender"&&(qe.removeChild(en),dn=on&&on.indexOf("appletParameters")!=-1?en.id:null,Ot--)}var Xt=ue.id!==void 0?ue.id:dn,Ut=window[Xt];Ut&&typeof Ut.getBase64=="function"&&(Ut.remove(),window[Xt]=null)},bn.refreshHitPoints=function(){if($e(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var qe=bn.getAppletObject();return qe&&typeof qe.recalculateEnvironments=="function"?(qe.recalculateEnvironments(),!0):!1},bn.startAnimation=function(){var qe=bn.getAppletObject();return qe&&typeof qe.startAnimation=="function"?(qe.startAnimation(),!0):!1},bn.stopAnimation=function(){var qe=bn.getAppletObject();return qe&&typeof qe.stopAnimation=="function"?(qe.stopAnimation(),!0):!1},bn.getAppletObject=function(){var qe=ue.id!==void 0?ue.id:"ggbApplet";return window[qe]},bn.resize=function(){};var Dt=function(qe,nt,Ot){var dn=document.createElement("param");dn.setAttribute("name",nt),dn.setAttribute("value",Ot),qe.appendChild(dn)},Ge=function(qe){return qe&&qe!=="false"},kt=function(qe,nt,Ot){$e(ft)<=4.2&&(Ot=!0);var dn=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==ft||ggbHTML5LoadedCodebaseIsWebSimple&&!ot)&&(dn=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var en=document.createElement("div");en.classList.add("appletParameters","notranslate");var on=nt.width,Xt=nt.height;if(nt.disableAutoScale=nt.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():nt.disableAutoScale,nt.width!==void 0)if($e(ft)<=4.4)Ge(nt.showToolBar)&&(nt.height-=7),Ge(nt.showAlgebraInput)&&(nt.height-=37),nt.width<605&&Ge(nt.showToolBar)&&(nt.width=605,on=605);else{var Ut=100;(Ge(nt.showToolBar)||Ge(nt.showMenuBar))&&(nt.hasOwnProperty("customToolBar")&&(nt.customToolbar=nt.customToolBar),Ut=Ge(nt.showMenuBar)?245:155),on<Ut&&(nt.width=Ut,on=Ut)}en.style.border="none",en.style.display="inline-block";for(var Zt in nt)nt.hasOwnProperty(Zt)&&Zt!=="appletOnLoad"&&en.setAttribute("data-param-"+Zt,nt[Zt]);it&&en.setAttribute("data-param-fontscssurl",it),bn.resize=function(){GGBAppletUtils.responsiveResize(qe,nt)},window.addEventListener("resize",function(rt){bn.resize()});var ye=typeof nt.appletOnLoad=="function"?nt.appletOnLoad:function(){};if(!Ot&&nt.width!==void 0){nt.hasOwnProperty("showSplash")||en.setAttribute("data-param-showSplash","false");var le=qe.querySelector(".applet_scaler.prerender"),oe=le!==null;if(oe)var he=le.querySelector(".ggb_preview");else{var he=Tt(on,Xt,nt.borderColor,!1);le=document.createElement("div"),le.className="applet_scaler",le.style.position="relative",le.style.display="block",le.style.width=on+"px",le.style.height=Xt+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(le,"66%"),$e(ft)>=5?(nt.appletOnLoad=function(rt){var Ft=qe.querySelector(".ggb_preview");Ft&&Ft.parentNode.removeChild(Ft),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(le),window.GGBT_wsf_view&&$(window).trigger("resize"),ye(rt)},oe||le.appendChild(he)):en.appendChild(he),le.appendChild(en),oe||qe.appendChild(le),setTimeout(function(){bn.resize()},1)}else{var pe=document.createElement("div");pe.className="applet_scaler",pe.style.position="relative",pe.style.display="block",pe.appendChild(en),qe.appendChild(pe),nt.appletOnLoad=function(rt){bn.resize(),ye(rt)}}function ce(rt,Ft){Ft&&typeof Ft.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(rt,Ft.appletOnLoad):renderGGBElement(rt),Qt("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",Ft)}function Ie(rt,Ft){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:rt,params:Ft}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(sn){ce(sn.article,sn.params)}),html5AppletsToProcess=null)},$e(ft)<5&&(rt.className+=" geogebraweb")):ce(rt,Ft)}if(dn){scriptLoadStarted=!0;for(var yt=0;yt<en.childNodes.length;yt++){var Pe=en.childNodes[yt].tagName;Pe==="TABLE"&&(en.removeChild(en.childNodes[yt]),yt--)}if(ggbHTML5LoadedScript!==null){var je=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');je!=null&&je.parentNode.removeChild(je)}var Rt=document.createElement("script"),At=function(){Ie(en,nt)};Rt.src=dt+Ye,ggbHTML5LoadedCodebaseIsWebSimple=ot,ggbHTML5LoadedCodebaseVersion=ft,ggbHTML5LoadedScript=Rt.src,Qt("GeoGebra HTML5 codebase loaded: '"+dt+"'.",nt),!De&&(!Me||Me=="5.0")?(ot?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),At()):dt.requirejs?__webpack_require__.e(7206).then(function(){var rt=[__webpack_require__(97206)];At.apply(null,rt)}.bind(this)).catch(__webpack_require__.oe):(Rt.onload=At,qe.appendChild(Rt))}else Ie(en,nt);nt.height=Xt,nt.width=on},tt=function(qe,nt,Ot){var dn=Tt(nt.width,nt.height,nt.borderColor,Ot),en=document.createElement("div");en.style.position="relative",en.style.display="block",en.style.width=nt.width+"px",en.style.height=nt.height+"px",en.className="applet_screenshot applet_scaler"+(Ot?" applet_screenshot_play":""),en.appendChild(dn);var on=GGBAppletUtils.getScale(nt,qe,Ot);Ot?(qe.appendChild(Bt()),window.GGBT_wsf_view||(qe.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(en,"66%"),qe.appendChild(en),on!==1&&!isNaN(on)&&(GGBAppletUtils.scaleElement(en,on),en.style.width=nt.width+"px",en.style.height=nt.height+"px",en.parentNode.style.width=nt.width*on+"px",en.parentNode.style.height=nt.height*on+"px"),bn.resize=function(){$t(qe,dn,en,Ot)},window.addEventListener("resize",function(Xt){bn.resize()}),bn.resize()};function $t(qe,nt,Ot,dn){if(qe.contains(nt)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(qe.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(qe)}var en=GGBAppletUtils.getScale(ue,qe,dn);Ot.parentNode!==null&&(!isNaN(en)&&en!==1?(GGBAppletUtils.scaleElement(Ot,en),Ot.parentNode.style.width=ue.width*en+"px",Ot.parentNode.style.height=ue.height*en+"px"):(GGBAppletUtils.scaleElement(Ot,1),Ot.parentNode.style.width=ue.width+"px",Ot.parentNode.style.height=ue.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(qe),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}bn.onExitFullscreen=function(qe,nt){nt.appendChild(qe)};var pt=function(qe,nt,Ot,dn){tt(qe,nt,!0);for(var en=function(){var Ut=[];for(Xt=0;Xt<qe.childNodes.length;Xt++)Ut.push(qe.childNodes[Xt]);if(window.GGBT_wsf_view){var Zt=window.GGBT_wsf_view.renderFullScreen(qe,nt.id),ye=document.getElementById("fullscreencontainer"),le=jQuery(qe).find(".fullscreencontent");le.length>0?(Zt.remove(),le.attr("id","fullscreencontent").show(),jQuery(ye).append(le),window.dispatchEvent(new Event("resize"))):kt(Zt,nt,!1),window.GGBT_wsf_view.launchFullScreen(ye)}else Fe=dn,kt(qe,nt,!1);if(!window.GGBT_wsf_view)for(Xt=0;Xt<Ut.length;Xt++)qe.removeChild(Ut[Xt])},on=qe.getElementsByClassName("ggb_preview_play"),Xt=0;Xt<on.length;Xt++)on[Xt].addEventListener("click",en,!1),on[Xt].addEventListener("ontouchstart",en,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(qe),Ve()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},Bt=function(){var qe=document.createElement("div");if(qe.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var nt='.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");}',Ot=document.createElement("style");Ot.styleSheet?Ot.styleSheet.cssText=nt:Ot.appendChild(document.createTextNode(nt)),document.getElementsByTagName("head")[0].appendChild(Ot)}return qe},Tt=function(qe,nt,Ot,dn){var en=document.createElement("div");en.className="ggb_preview",en.style.position="absolute",en.style.zIndex="90",en.style.width=qe-2+"px",en.style.height=nt-2+"px",en.style.top="0px",en.style.left="0px",en.style.overflow="hidden",en.style.backgroundColor="white";var on="lightgrey";Ot!==void 0&&(Ot==="none"?on="transparent":on=Ot),en.style.border="1px solid "+on;var Xt=document.createElement("img");if(Xt.style.position="relative",Xt.style.zIndex="1000",Xt.style.top="-1px",Xt.style.left="-1px",at!==null&&Xt.setAttribute("src",at),Xt.style.opacity=.7,Ct!==null){var Ut,Zt,ye;if(!dn){Ut=document.createElement("img"),Ut.style.position="absolute",Ut.style.zIndex="1001",Ut.style.opacity=1,Xt.style.opacity=.3,Zt=360,Zt>qe/4*3&&(Zt=qe/4*3),ye=Zt/5.8,Ut.setAttribute("src",Ct),Ut.setAttribute("width",Zt),Ut.setAttribute("height",ye);var le=(qe-Zt)/2,oe=(nt-ye)/2;Ut.style.left=le+"px",Ut.style.top=oe+"px",en.appendChild(Ut)}}return en.appendChild(Xt),en},wt=function(qe){return qe=qe.toLowerCase(),qe==="html5"||qe==="screenshot"?qe:"html5"},Ne=["web","webSimple","web3d","tablet","tablet3d","phone"],be=function(qe,nt){if(ft=qe,nt){xt(ft,!0);return}var Ot=!Te;if(Ot){var dn=$e(ft);!isNaN(dn)&&dn<4.4&&(Ot=!1)}var en,on;window.location.protocol.substr(0,4)==="http"?en=window.location.protocol:en="http:";var Xt=ft.indexOf("//");Xt>0?on=ft:Xt===0?on=en+ft:on="https://www.geogebra.org/apps/5.2.814.0/";for(var Ut in Ne)if(ft.slice(Ne[Ut].length*-1)===Ne[Ut]||ft.slice((Ne[Ut].length+1)*-1)===Ne[Ut]+"/"){xt(on,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&Ot&&!se.is3D&&!se.AV&&!se.SV&&!se.CV&&!se.EV2&&!se.CP&&!se.PC&&!se.DA&&!se.FI&&!se.PV&&!Ge(ue.showToolBar)&&!Ge(ue.showMenuBar)&&!Ge(ue.showAlgebraInput)&&!Ge(ue.enableRightClick)&&(!ue.appName||ue.appName=="classic")?on+="webSimple/":on+="web3d/",xt(on,!1)},xt=function(qe,nt){if(qe.requirejs){dt=qe;return}qe.slice(-1)!=="/"&&(qe+="/"),dt=qe,nt===null&&(nt=qe.indexOf("http")===-1),Ae=nt,Ye="web.nocache.js",ot=!1;var Ot=dt.split("/");Ot.length>1&&(!nt&&Ot[Ot.length-2]==="webSimple"?(Ye="webSimple.nocache.js",ot=!0):Ne.indexOf(Ot[Ot.length-2])>=0&&(Ye=Ot[Ot.length-2]+".nocache.js")),Ot=qe.split("/"),ft=Ot[Ot.length-3],ft.substr(0,4)==="test"?ft=ft.substr(4,1)+"."+ft.substr(5,1):(ft.substr(0,3)==="war"||ft.substr(0,4)==="beta")&&(ft="5.0");var dn=parseFloat(ft);dn!==NaN&&dn<5&&qe.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+dn+" is deprecated. Using version latest instead."),be("5.0",nt))},Qt=function(qe,nt){window.console&&window.console.log&&(!nt||typeof nt.showLogging=="undefined"||nt.showLogging&&nt.showLogging!=="false")&&console.log(qe)};ue.material_id!==void 0?Je(Vt):Vt();function Vt(){var qe=tn;Me!==null?qe=Me:parseFloat(qe)<5&&(qe="5.0"),be(qe,!1),De!==null&&xt(De,Ae),xe=!0}return bn},GGBAppletUtils=function(){"use strict";function bn(){return window.GGBT_wsf_edit!==void 0}function tn(xe,Me){Me!=1?(xe.style.transformOrigin="0% 0% 0px",xe.style.webkitTransformOrigin="0% 0% 0px",xe.style.transform="scale("+Me+","+Me+")",xe.style.webkitTransform="scale("+Me+","+Me+")",xe.style.maxWidth="initial",xe.querySelector(".ggb_preview")!==null&&(xe.querySelector(".ggb_preview").style.maxWidth="initial"),xe.querySelectorAll(".ggb_preview img")[0]!==void 0&&(xe.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),xe.querySelectorAll(".ggb_preview img")[1]!==void 0&&(xe.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(xe.style.transform="none",xe.style.webkitTransform="none")}function ue(xe,Me,De,we,_e,Re){var dt=null;if(Re!=null&&Re!="")for(var Ae=xe.parentNode;Ae!=null;)if((" "+Ae.className+" ").indexOf(" "+Re+" ")>-1){dt=Ae;break}else Ae=Ae.parentNode;var Fe=0,ft=0,Ye=0,ot=0,at=0,Ct=0,jt=0;if(dt)Fe=dt.offsetWidth,ft=Math.max(we?dt.offsetWidth:0,dt.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(Fe=Math.min(window.innerWidth,document.documentElement.clientWidth),ft=Math.min(window.innerHeight,document.documentElement.clientHeight),Ye=Fe):(Fe=window.innerWidth,ft=window.innerHeight,Ye=window.innerWidth),xe){var it=xe.getBoundingClientRect();it.left>0&&it.left<=Fe&&(_e===void 0||!_e)&&(document.dir==="rtl"?(at=Fe-it.width-it.left,Ct=Ye<=480?10:30):(Ct=it.left,at=Ye<=480?10:30),ot=Ct+at)}if(xe&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var vt=xe.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(ot=40,jt=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(ot=0,jt=40)}}return xe&&((De===void 0||!De)&&Me>0&&Me+ot<Fe?Fe=Me:Fe-=ot,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(De===void 0||!De)&&(ft-=jt)),{width:Fe,height:ft}}function se(xe,Me,De,we,_e){if(xe.isScreenshoGenerator)return 1;var Re=we!==void 0&&we,dt=xe.noScaleMargin!=null&&xe.noScaleMargin,Ae=function(vt){return vt&&vt!=="false"},Fe=Ae(xe.autoHeight),ft=ue(Me,xe.width,De,Fe,Re&&window.GGBT_wsf_view||dt,_e),Ye=parseInt(ft.width),ot=xe.width,at=xe.height;if(ot===void 0){var Ct=Me.querySelector(".appletParameters");Ct&&(ot=Ct.offsetWidth,at=Ct.offsetHeight)}var jt=Ye/ot,it=Re?1:ft.height/at;return De!==void 0&&!De&&(jt=Math.min(1,jt),it=Math.min(1,it)),Math.min(jt,it)}function Te(xe,Me,De){var we=1,_e,Re=!1;if(xe.hasOwnProperty("allowUpscale")&&(Re=xe.allowUpscale),xe.hasOwnProperty("scale")&&(we=parseFloat(xe.scale),(isNaN(we)||we===null||we===0)&&(we=1),we>1&&(Re=!0)),Me&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Re=!0),!(xe.hasOwnProperty("disableAutoScale")&&xe.disableAutoScale))_e=se(xe,Me,Re,De,xe.scaleContainerClass);else return we;return Re&&(!xe.hasOwnProperty("scale")||we===1)?_e:Math.min(we,_e)}function ze(xe){var Me=Math.min(window.innerWidth,document.documentElement.clientWidth),De=Math.min(window.innerHeight,document.documentElement.clientHeight),we=xe.getBoundingClientRect(),_e=(Me-we.width)/2,Re=(De-we.height)/2;Re<0&&(Re=0),xe.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(_e<40?xe.style.left="40px":xe.style.left=_e+"px",xe.style.top=Re+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(Re<40?xe.style.top="40px":xe.style.top=Re+"px",xe.style.left=_e+"px")}function ut(xe,Me){var De=xe.querySelector(".appletParameters");if(De){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Me.id!==De.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(xe)}if(De.parentElement&&/fullscreen/.test(De.parentElement.className))return;var we=Te(Me,xe);bn()&&De.setAttribute("data-param-scale",we);for(var _e=null,Re=0;Re<xe.childNodes.length;Re++)if(xe.childNodes[Re].className!==void 0&&xe.childNodes[Re].className.match(/^applet_scaler/)){_e=xe.childNodes[Re];break}if(_e!==null&&_e.querySelector(".noscale")!==null)return;var dt=Me.id!==void 0?Me.id:"ggbApplet",Ae=window[dt];(Ae==null||!Ae.recalculateEnvironments)&&_e!==null&&!_e.className.match(/fullscreen/)&&(_e.parentNode.style.transform="",!isNaN(we)&&we!==1?(_e.parentNode.style.width=Me.width*we+"px",_e.parentNode.style.height=Me.height*we+"px",tn(_e,we)):(tn(_e,1),_e.parentNode.style.width=Me.width+"px",_e.parentNode.style.height=Me.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&ze(xe),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(De).parents(".content-added-content"))}}return{responsiveResize:ut,isFlexibleWorksheetEditor:bn,positionCenter:ze,getScale:Te,scaleElement:tn}}();__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 bn=n.location.search;return bn.indexOf(J)!=-1||bn.indexOf(K)!=-1}function q(bn,tn){}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(bn){var tn=s[L].bindings;s[L].bindings=function(){for(var ue=tn?tn():{},se=bn[webModule.__softPermutationId],Te=O;Te<se.length;Te++){var ze=se[Te];ue[ze[O]]=ze[P]}return ue}};var t;function u(){return v(),t}function v(){if(!t){var bn=o.createElement(Q);if(bn.id=L,bn.style.cssText=R+S,bn.tabIndex=-1,o.body.appendChild(bn),t=bn.contentWindow.document,navigator.userAgent.indexOf(T)==-1){t.open();var tn=document.compatMode==U?V:W;t.write(tn+X),t.close()}}}function w(bn){function tn(se){function Te(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var ze=Te();if(ze){se();return}function ut(){if(!ze){if(!Te())return;ze=!0,se(),o.removeEventListener&&o.removeEventListener(Z,ut,!1),xe&&clearInterval(xe)}}o.addEventListener&&o.addEventListener(Z,ut,!1);var xe=setInterval(function(){ut()},$)}function ue(se){var Te=u(),ze=Te.body,ut=Te.createElement(_);ut.language=ab,ut.crossOrigin=W,ut.src=se,webModule.__errFn&&(ut.onerror=function(){webModule.__errFn(L,new Error(bb+se))}),ze.appendChild(ut)}tn(function(){ue(bn)})}webModule.__startLoadingFragment=function(bn){return C(bn)},webModule.__installRunAsyncCode=function(bn){var tn=u(),ue=tn.body,se=tn.createElement(_);se.language=ab,se.text=bn,ue.appendChild(se),ue.removeChild(se)};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(bn){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(bn){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(bn){var tn=c[bn];return tn==null?null:tn},r=d,webModule.__errFn=e}function B(){function bn(xe){var Me=xe.lastIndexOf(rb);Me==-1&&(Me=xe.length);var De=xe.indexOf(sb);De==-1&&(De=xe.length);var we=xe.lastIndexOf(tb,Math.min(De,Me));return we>=O?xe.substring(O,we+P):W}function tn(xe){if(!xe.match(/^\w+:\/\//)){var Me=o.createElement(ub);Me.src=xe+vb,xe=bn(Me.src)}return xe}function ue(){var xe=__gwt_getMetaProperty(wb);return xe!=null?xe:W}function se(){for(var xe=o.getElementsByTagName(_),Me=O;Me<xe.length;++Me)if(xe[Me].src.indexOf(xb)!=-1)return bn(xe[Me].src);return W}function Te(){var xe=o.getElementsByTagName(yb);return xe.length>O?xe[xe.length-P].href:W}function ze(){var xe=o.location;return xe.href==xe.protocol+zb+xe.host+xe.pathname+xe.search+xe.hash}var ut=ue();return ut==W&&(ut=se()),ut==W&&(ut=Te()),ut==W&&ze()&&(ut=bn(o.location.href)),ut=tn(ut),ut}function C(bn){return bn.match(/^\//)||bn.match(/^[a-zA-Z]+:\/\//)?bn:webModule.__moduleBase+bn}function D(){var bn=[],tn=O,ue=[],se=[];function Te(xe){var Me=se[xe](),De=ue[xe];if(Me in De)return Me;var we=[];for(var _e in De)we[De[_e]]=_e;throw r&&r(xe,we,Me),null}if(__gwt_isKnownPropertyValue=function(xe,Me){return Me in ue[xe]},webModule.__getPropMap=function(){var xe={};for(var Me in ue)ue.hasOwnProperty(Me)&&(xe[Me]=Te(Me));return xe},webModule.__computePropValue=Te,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var ze;try{ze=Cb;var ut=ze.indexOf(Db);ut!=-1&&(tn=parseInt(ze.substring(ut+P),$),ze=ze.substring(O,ut))}catch(xe){}return webModule.__softPermutationId=tn,C(ze+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})()},79090:function(bn,tn,ue){"use strict";ue.d(tn,{Ax:function(){return ut},Ds:function(){return xe},KI:function(){return De},SI:function(){return ze},f1:function(){return Te}});var se=ue(6521);function Te(we){let _e=!0;if(we.length>0){for(let Re=0;Re<we.length;Re++)if(we[Re].compile_success==0||!we[Re].compile_success){_e=!1;break}}else _e=!1;return _e}function ze(we,_e=""){let Re=[];for(let dt=0;dt<we.length;dt++){let Ae=we[dt],Fe=_e?`${_e}/${Ae.name}`:`${Ae.name}`;Re.push({title:Ae.name,type:Ae.type,isLeaf:Ae.type!=="tree",key:Fe})}return Re}function ut(we,_e,Re){for(let dt=0;dt<we.length;dt++){let Ae=we[dt];if(Ae.key===_e){Ae.children=Re;break}Ae.children&&ut(Ae.children,_e,Re)}return we}function xe(we,_e,Re){let dt;return function(){let Ae=this,Fe=arguments,ft=function(){dt=null,Re||we.apply(Ae,Fe)},Ye=Re&&!dt;clearTimeout(dt),dt=setTimeout(ft,_e),Ye&&we.apply(Ae,Fe)}}const Me=!0,De=se.Z.API_SERVER},61746:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return _e}});var se=ue(59301),Te=ue(92832),ze=ue(12563),ut=ue(8591),xe={flex:"flex___eLcnP",flex1:"flex1___yUTT7",color666:"color666___TiUhG",error:"error___gTTtv",deleteIcon:"deleteIcon___mnZW1",addIcon:"addIcon___JC5NS"},Me=ue(62772);const{TextArea:De}=Te.default;class we extends se.Component{constructor(dt){super(dt),this.state={inputVisible:!1,EditInputIndex:-1}}render(){let{index:dt,onAnswerChange:Ae,addChildAnswer:Fe,exerciseIsPublish:ft,answers:Ye,activeOptionErrorIndex:ot,flex:at="0 0 1000px"}=this.props;console.log("----",Ye);let{inputVisible:Ct,EditInputIndex:jt}=this.state;return se.createElement("div",{className:xe.flex},se.createElement("div",{className:`${xe.color666} mb5 mt6`,style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",dt+1,"):"),se.createElement("div",{style:{border:"1px solid #f6f6f6",flex:1,padding:10}},Ye==null?void 0:Ye.map((it,vt)=>se.createElement(se.Fragment,null,jt!==vt?(it==null?void 0:it.length)>0?se.createElement(ze.Z,{className:"edit-tag",key:it,closable:!(dt===0&&vt===0),onClose:$e=>{$e.preventDefault(),(Ye==null?void 0:Ye.length)===1&&vt===0?this.props.deleteChildAnswermain(dt,vt):this.props.deleteChildAnswer(dt,vt)}},se.createElement("span",{onDoubleClick:$e=>{this.setState({EditInputIndex:vt}),$e.preventDefault()}},it)):se.createElement(Te.default,{defaultValue:it,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:$e=>{if($e.target.value.replaceAll(" ","").length<=0){ut.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");return}Ae(dt,vt,$e.target.value),this.setState({EditInputIndex:-1,inputVisible:!1})}}):se.createElement(Te.default,{defaultValue:it,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:$e=>{if($e.target.value.replaceAll(" ","").length<=0){ut.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");return}Ae(dt,vt,$e.target.value),this.setState({EditInputIndex:-1,inputVisible:!1})}}))),!Ct&&se.createElement(ze.Z,{className:"site-tag-plus",onClick:()=>{Fe(dt),this.setState({inputVisible:!0})}},se.createElement(Me.Z,null)," \u65B0\u589E\u7B54\u6848")))}}var _e=we},12132:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return ft}});var se=ue(59301),Te=ue(40973),ze=Object.defineProperty,ut=Object.defineProperties,xe=Object.getOwnPropertyDescriptors,Me=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,we=Object.prototype.propertyIsEnumerable,_e=(Ye,ot,at)=>ot in Ye?ze(Ye,ot,{enumerable:!0,configurable:!0,writable:!0,value:at}):Ye[ot]=at,Re=(Ye,ot)=>{for(var at in ot||(ot={}))De.call(ot,at)&&_e(Ye,at,ot[at]);if(Me)for(var at of Me(ot))we.call(ot,at)&&_e(Ye,at,ot[at]);return Ye},dt=(Ye,ot)=>ut(Ye,xe(ot)),Ae=(Ye,ot,at)=>_e(Ye,typeof ot!="symbol"?ot+"":ot,at);const Fe="\u2581";class ft extends se.Component{constructor(){super(...arguments),Ae(this,"getChCountBeforeCursor",(ot,at)=>{const Ct=at.line;let jt=0;for(let vt=0;vt<Ct;vt++)jt+=ot.getLine(vt).split(Fe).length-1;const it=ot.getLine(Ct).substring(0,at.ch);return jt+=it.split(Fe).length-1,jt}),Ae(this,"onCMBeforeChange",(ot,at)=>{const Ct=ot.getRange(at.from,at.to);let jt=0;if(at.text.forEach(it=>{jt+=it.split(Fe).length-1}),Ct&&Ct.indexOf(Fe)!=-1){const it=Ct.split(Fe).length-1,vt=this.getChCountBeforeCursor(ot,at.from);console.log(`\u5220\u9664${it}\u4E2A\uFF0C \u4E4B\u524D\u6709${vt}\u4E2A\uFF0C\u65B0\u589E${jt}\u4E2A`),this.props.deleteEmptyDisabled?at.cancel():this.props.onPlaceholderChange&&this.props.onPlaceholderChange(vt,it,jt)}else if(jt){const it=this.getChCountBeforeCursor(ot,at.from);console.log(`\u65B0\u589E${jt}\u4E2A\uFF0C\u4E4B\u524D\u6709${it}\u4E2A`),this.props.onPlaceholderChange&&this.props.onPlaceholderChange(it,0,jt)}})}render(){return se.createElement(Te.Z,dt(Re({},this.props),{onCMBeforeChange:this.onCMBeforeChange}))}}},15868:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return dt}});var se=ue(59301),Te={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},ze=ue(92310),ut=ue.n(ze),xe=ue(71418),Me=ue(2859),De=ue(79769),we=ue(25544),_e=(Ae,Fe,ft)=>new Promise((Ye,ot)=>{var at=it=>{try{jt(ft.next(it))}catch(vt){ot(vt)}},Ct=it=>{try{jt(ft.throw(it))}catch(vt){ot(vt)}},jt=it=>it.done?Ye(it.value):Promise.resolve(it.value).then(at,Ct);jt((ft=ft.apply(Ae,Fe)).next())}),dt=({data:Ae,className:Fe,fullWidth:ft,style:Ye={},onClose:ot,onOk:at,showFullTools:Ct,noAssociationId:jt})=>{const it=(0,se.useRef)(null),vt=(0,se.useRef)(null),$e=(0,se.useRef)(null),Ee=(0,se.useRef)(null),[Ve,Je]=(0,se.useState)(!1),[Lt,et]=(0,se.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,se.useEffect)(()=>{$e.current||($e.current=document.createElement("style"),document.head.appendChild($e.current)),Ae!=null&&Ae.visible?(document.body.setAttribute("data-custom","y-hidden"),$e.current.innerHTML=" html { overflow-y: hidden; }",Ae!=null&&Ae.src&&Dt()):(document.body.removeAttribute("data-custom"),$e.current&&(document.head.removeChild($e.current),$e.current=null))},[Ae==null?void 0:Ae.visible]);const Dt=()=>_e(void 0,null,function*(){Je(!0),et("\u6B63\u5728\u52A0\u8F7D\u4E2D");const pt=yield(0,we.ZJ)(Ae==null?void 0:Ae.src);it.current.src="",it.current.src=pt,it.current.onload=function(){$t()},Je(!1),et("")}),Ge=()=>{document.body.removeAttribute("data-custom"),$e.current.innerHTML=" ",ot()},kt=pt=>_e(void 0,null,function*(){Je(!0),et("\u6B63\u5728\u4FDD\u5B58\u4E2D");const Bt=yield(0,De.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Ae.title,file:pt.dataUrl}});Bt!=null&&Bt.id&&!jt?(yield(0,De.ZP)(`/api/attachments/${Ae.id}/add_subitem.json`,{method:"post",body:{subitem_id:Bt==null?void 0:Bt.id,settings:JSON.stringify(pt.state)}})).status===0&&at():Bt!=null&&Bt.id&&at(Bt),document.body.removeAttribute("data-custom"),$e.current.innerHTML=" ",Je(!1),et("")}),tt=()=>{const pt=document.querySelector('a[href="https://markerjs.com/"]');pt&&pt.parentNode&&(pt.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(Tt=>{const wt=document.querySelector(Tt.name);wt&&wt.setAttribute("title",Tt.title)})},$t=()=>{vt.current=new Me.hP(it.current),vt.current.targetRoot=Ee.current,vt.current.addEventListener("render",kt),vt.current.addEventListener("beforeclose",Ge),Ct&&(vt.current.availableMarkerTypes=vt.current.ALL_MARKER_TYPES,vt.current.uiStyleSettings.redoButtonVisible=!0,vt.current.uiStyleSettings.notesButtonVisible=!0,vt.current.uiStyleSettings.zoomButtonVisible=!0,vt.current.uiStyleSettings.zoomOutButtonVisible=!0,vt.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=vt.current.uiStyleSettings,vt.current.show(),Ae!=null&&Ae.snapshotData&&vt.current.restoreState(Ae.snapshotData),setTimeout(()=>{window.scrollTo(0,0),tt()},300)};return se.createElement(se.Fragment,null,(Ae==null?void 0:Ae.visible)&&se.createElement(xe.Z,{spinning:Ve,tip:Lt,style:{position:"absolute"}},se.createElement("div",{ref:Ee,className:ut()(Te.imageDimensions,Fe,ft?Te.fullWidth:""),style:Ye},se.createElement("img",{className:Te.img,ref:it}))))}},3315:function(bn,tn,ue){"use strict";var se=ue(59301),Te=ue(95237),ze=ue(43604),ut=ue(99313),xe=ue(3113),Me=ue(39655),De=ue(18760),we=ue(48136),_e=ue(59301);const Re=(0,se.forwardRef)(({callback:dt,showSaveButton:Ae,value:Fe=""},ft)=>{const Ye=(0,se.useRef)(),ot=[{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 "}]}]}],at=[{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}`}]}]}],Ct=vt=>{Ye.current.setValue(Ye.current.getValue()+" "+vt.value+" ")},jt=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:_e.createElement(Te.Z,{className:De.Z.lists,gutter:[10,10]},ot.map((vt,$e)=>_e.createElement(ze.Z,{flex:"110px",className:De.Z.item},_e.createElement("div",null,_e.createElement(Me.Z,{value:`$$${vt.value}$$`}),vt.name),_e.createElement("div",{className:De.Z.children},vt.children.map((Ee,Ve)=>_e.createElement("div",{key:Ve},_e.createElement("h1",null,Ee.name),_e.createElement(Te.Z,{gutter:[10,10]},Ee.data.map((Je,Lt)=>_e.createElement(ze.Z,{key:Lt,onClick:()=>Ct(Je),className:De.Z.diamond},_e.createElement(Me.Z,{value:"`$$"+Je.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:_e.createElement(Te.Z,{className:De.Z.lists,gutter:[10,10]},at.map((vt,$e)=>_e.createElement(ze.Z,{flex:"110px",className:De.Z.item},_e.createElement("div",null,_e.createElement(Me.Z,{value:"`$$"+vt.value+"$$`"}),vt.name),_e.createElement("div",{className:De.Z.children},vt.children.map((Ee,Ve)=>_e.createElement("div",{key:Ve},Ee.name&&_e.createElement("h1",null,Ee.name),_e.createElement(Te.Z,{gutter:[10,10]},Ee.data.map((Je,Lt)=>_e.createElement(ze.Z,{key:Lt,onClick:()=>Ct(Je),className:De.Z.diamond},_e.createElement(Me.Z,{value:"`$$"+Je.value+"$$`"}))))))))))}],it=()=>{var vt=document.createElement("div");vt.innerHTML=Ye.current.getValue();var $e=vt.innerText;return dt&&dt($e),$e};return(0,se.useImperativeHandle)(ft,()=>({getData:it})),_e.createElement("div",{className:De.Z.mathWrap},_e.createElement(ut.default,{defaultActiveKey:"1",items:jt}),_e.createElement("math-field",{locale:"zh_cn",className:De.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:Ye,style:{width:800,marginTop:30,fontSize:18}},Fe||""),Ae&&_e.createElement("div",{className:De.Z.button},_e.createElement(xe.ZP,{size:"large",onClick:it,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});tn.Z=Re},67831:function(bn,tn,ue){"use strict";ue.d(tn,{h:function(){return vt}});var se=ue(59301),Te=ue(57809),ze=ue(78241),ut=ue(3113),xe=ue(89780),Me=ue.n(xe),De=ue(14618),we=ue(66552),_e=Object.defineProperty,Re=Object.defineProperties,dt=Object.getOwnPropertyDescriptors,Ae=Object.getOwnPropertySymbols,Fe=Object.prototype.hasOwnProperty,ft=Object.prototype.propertyIsEnumerable,Ye=($e,Ee,Ve)=>Ee in $e?_e($e,Ee,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):$e[Ee]=Ve,ot=($e,Ee)=>{for(var Ve in Ee||(Ee={}))Fe.call(Ee,Ve)&&Ye($e,Ve,Ee[Ve]);if(Ae)for(var Ve of Ae(Ee))ft.call(Ee,Ve)&&Ye($e,Ve,Ee[Ve]);return $e},at=($e,Ee)=>Re($e,dt(Ee));const Ct=Te.default.Option,jt={labelCol:{span:4},wrapperCol:{span:20}},it={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"]};tn.Z=({callback:$e,onCancel:Ee})=>{const[Ve,Je]=(0,se.useState)("python");function Lt(Dt){Je(it[Dt][1])}function et(Dt){$e(Dt)}return se.createElement(ze.default,at(ot({},jt),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:et,style:{width:500}}),se.createElement(ze.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},se.createElement(Te.default,{getPopupContainer:Dt=>Dt.parentNode,onChange:Lt},Object.keys(it).map(Dt=>se.createElement(Ct,{key:Dt,value:Dt},it[Dt][0])))),se.createElement(ze.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},se.createElement(vt,{mode:Ve})),se.createElement("div",{className:"flex-container flex-end"},se.createElement(ut.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),se.createElement(ut.ZP,{type:"ghost",onClick:Ee},"\u53D6\u6D88")))};function vt({value:$e,onChange:Ee,mode:Ve,options:Je={}}){const Lt=(0,se.useRef)(),[et,Dt]=(0,se.useState)();return(0,se.useEffect)(()=>{if(et){let Ge=function(kt){const tt=kt.getValue();Ee&&Ee(tt)};return et.on("change",Ge),()=>{et.off("change",Ge)}}},[et,Ee]),(0,se.useEffect)(()=>{et&&et.setOption("mode",Ve)},[et,Ve]),(0,se.useEffect)(()=>{et&&($e!==et.getValue()||$e==="")&&setTimeout(()=>{et.setValue($e||"")},300)},[et,$e]),(0,se.useEffect)(()=>{if(Lt.current&&!et){const Ge=Me().fromTextArea(Lt.current,ot({mode:Ve,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Je));Dt(Ge)}},[Lt.current,et]),se.createElement("div",{className:"my-codemirror-container"},se.createElement("textarea",{ref:Lt}))}},40973:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return Zr}});var se=ue(59301),Te=ue(89780),ze=ue.n(Te),ut=ue(76374),xe=ue(14618),Me=ue(6313),De=ue(25717),we=ue(99498),_e=ue(25419),Re=ue(67549),dt=ue(39655),Ae=({value:dr="",className:_r,showTextOnly:Ln,showLines:Wn,style:Er={}})=>{const St=(0,se.useMemo)(()=>"",[dr]);return se.createElement(se.Fragment,null,se.createElement("div",{dangerouslySetInnerHTML:{__html:St}}))},Fe=ue(59301),ft=Object.defineProperty,Ye=Object.defineProperties,ot=Object.getOwnPropertyDescriptors,at=Object.getOwnPropertySymbols,Ct=Object.prototype.hasOwnProperty,jt=Object.prototype.propertyIsEnumerable,it=(dr,_r,Ln)=>_r in dr?ft(dr,_r,{enumerable:!0,configurable:!0,writable:!0,value:Ln}):dr[_r]=Ln,vt=(dr,_r)=>{for(var Ln in _r||(_r={}))Ct.call(_r,Ln)&&it(dr,Ln,_r[Ln]);if(at)for(var Ln of at(_r))jt.call(_r,Ln)&&it(dr,Ln,_r[Ln]);return dr},$e=(dr,_r)=>Ye(dr,ot(_r));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 Ve({onActionCallback:dr,title:_r,icon:Ln,actionName:Wn,className:Er="",children:St}){function Le(){dr(Wn)}return Fe.createElement("a",{title:_r,className:Er,onClick:Le},Fe.createElement("i",{className:`${Ln}`}),St)}var Je=({watch:dr,showNullButton:_r,showNullProgramButton:Ln,onActionCallback:Wn,fullScreen:Er,insertTemp:St,hidetoolBar:Le,extraUse:We})=>{const Be=[...Ee,{title:`${dr?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${dr?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return Fe.createElement("ul",{className:"markdown-toolbar-container"},!Le&&Be.map((Oe,lt)=>Fe.createElement("li",{key:lt},Oe.actionName?Fe.createElement(Ve,$e(vt({},Oe),{onActionCallback:Wn})):Fe.createElement("span",{className:"v-line"}))),_r?Fe.createElement("li",null,Fe.createElement(Ve,{icon:"iconfont icon-tianjia5 insert-blank",className:"btn-null ml5",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Wn},Fe.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u65B0\u589E\u586B\u7A7A\u9879"))):null,Ln?Fe.createElement(Fe.Fragment,null,Fe.createElement("li",null,Fe.createElement(Ve,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:Wn},Fe.createElement("span",{className:"fill-tip"},"+\u5355\u884C\u586B\u7A7A\u9879"))),Fe.createElement("li",null,Fe.createElement(Ve,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:Wn},Fe.createElement("span",{className:"fill-tip"},"+\u591A\u884C\u586B\u7A7A\u9879")))):null,St&&Fe.createElement("li",null,Fe.createElement(Ve,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${St}`,onActionCallback:Wn},Fe.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),We&&Fe.createElement("li",null,We),Fe.createElement("li",{className:"btn-full-screen"},Fe.createElement(Ve,{icon:`${Er?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:Er?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Wn})))},Lt=ue(53531),et=ue(78241),Dt=ue(92832),Ge=ue(3113),kt=Object.defineProperty,tt=Object.defineProperties,$t=Object.getOwnPropertyDescriptors,pt=Object.getOwnPropertySymbols,Bt=Object.prototype.hasOwnProperty,Tt=Object.prototype.propertyIsEnumerable,wt=(dr,_r,Ln)=>_r in dr?kt(dr,_r,{enumerable:!0,configurable:!0,writable:!0,value:Ln}):dr[_r]=Ln,Ne=(dr,_r)=>{for(var Ln in _r||(_r={}))Bt.call(_r,Ln)&&wt(dr,Ln,_r[Ln]);if(pt)for(var Ln of pt(_r))Tt.call(_r,Ln)&&wt(dr,Ln,_r[Ln]);return dr},be=(dr,_r)=>tt(dr,$t(_r));const xt={labelCol:{span:4},wrapperCol:{span:20}};var Qt=({callback:dr,onCancel:_r})=>{function Ln(Wn){dr(Wn)}return se.createElement(et.default,be(Ne({},xt),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Ln,style:{width:500}}),se.createElement(et.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},se.createElement(Dt.default,null)),se.createElement(et.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},se.createElement(Dt.default,null)),se.createElement("div",{className:"flex-container flex-end"},se.createElement(Ge.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),se.createElement(Ge.ZP,{type:"ghost",onClick:_r},"\u53D6\u6D88")))},Vt=ue(67831),qe=ue(58448),nt=ue(43418),Ot=ue(95237),dn=ue(15868),en=ue(59301),on=({callback:dr,onCancel:_r})=>{const Ln=document.createElement("canvas"),Wn=Ln.getContext("2d");Ln.width=1e3,Ln.height=800,Wn.fillStyle="#ffffff",Wn.fillRect(0,0,Ln.width,Ln.height);const Er=Ln.toDataURL("image/png");return en.createElement(nt.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},en.createElement(Ot.Z,{style:{height:"100vh"}},en.createElement(dn.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:Er,visible:!0,title:String(Date.now())},onOk:St=>{dr({src:St.url})},onClose:_r})))},Xt=ue(8591),Ut=ue(43428),Zt=ue(43604),ye={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re"},le=ue(59301),he=(0,se.forwardRef)(({onCancel:dr,editImgId:_r,callback:Ln},Wn)=>{let Er=(0,se.useRef)(),St=(0,se.useRef)(),Le=(0,se.useRef)(),We=(0,se.useRef)(!1);const Be=(0,se.useRef)(!1);console.log("ref:",Wn);const[Oe,lt]=(0,se.useState)(0),[_t,Yt]=(0,se.useState)("100vh");(0,se.useEffect)(()=>{lt(1);try{indexedDB.databases().then(un=>{un.forEach(fn=>indexedDB.deleteDatabase(fn.name))})}catch(un){}},[]),(0,se.useEffect)(()=>(window.addEventListener("message",Jt),()=>{window.removeEventListener("message",Jt)}),[]),(0,se.useImperativeHandle)(Wn,()=>({setHeight:Yt}));const Kt=un=>{window.saveDrawData(fn=>{if(fn===null&&!un){Xt.ZP.warning({content:"\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u8BF7\u5148\u7ED8\u5236\u6D41\u7A0B\u56FE",key:"saveFlowChart"});return}Xt.ZP.success({content:"\u4FDD\u5B58\u6210\u529F",key:"saveFlowChart",style:{zIndex:999999999}}),Ln({src:`/api/attachments/${fn}`,id:fn,disabledClose:!0})})},Jt=un=>{var fn;((fn=un==null?void 0:un.data)==null?void 0:fn.type)==="closePop"&&Kt(!0)};return le.createElement("div",{ref:Be,className:"body-overflow-initial"},le.createElement(Ut.Z,{width:"100vw",height:_t,footer:null,closable:!0,placement:"bottom",open:!!Oe,destroyOnClose:!0,maskClosable:!1,mask:!1,rootClassName:`zIndex-9999 ${ye.drawerWrap}`,onClose:()=>{window.saveDrawData(un=>{Ln({src:`/api/attachments/${un}`,id:un})})},title:le.createElement(Ot.Z,{align:"middle"},le.createElement(Zt.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),le.createElement(Zt.Z,{onClick:()=>{Yt(_t==="60px"?"100vh":"60px")}},le.createElement("span",{className:"current c-blue",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77")),le.createElement(Zt.Z,{onClick:Kt},le.createElement(Ge.ZP,{type:"primary",className:"ml20"},"\u4FDD\u5B58")))},le.createElement("iframe",{src:`${window.ENV==="build"?"/react/build":""}/drawio/src/main/webapp/?id=${_r||""}&gapi=0&od=0&db=0&gh=0&gl=0&local=0`,width:"100%",height:"100%",frameBorder:"0",ref:St})))}),pe=ue(6521),ce=ue(5112),Ie=ue(5871);const yt=ce.ZP.Group,Pe={margin:"0 8px"};var je=({callback:dr,onCancel:_r})=>{function Ln(Wn){dr(Wn)}return se.createElement(et.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Ln},se.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},se.createElement("span",{style:Pe},"\u5355\u5143\u683C\u6570\uFF1A"),se.createElement("span",{style:Pe},"\u884C\u6570"),se.createElement(et.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},se.createElement(Ie.Z,null)),se.createElement("span",{style:Pe},"\u5217\u6570"),se.createElement(et.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},se.createElement(Ie.Z,null))),se.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},se.createElement("span",{style:Pe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),se.createElement(et.default.Item,{name:"align"},se.createElement(yt,null,se.createElement(ce.ZP,{value:"default"},se.createElement("i",{className:"fa fa-align-justify"})),se.createElement(ce.ZP,{value:"left"},se.createElement("i",{className:"fa fa-align-left"})),se.createElement(ce.ZP,{value:"center"},se.createElement("i",{className:"fa fa-align-center"})),se.createElement(ce.ZP,{value:"right"},se.createElement("i",{className:"fa fa-align-right"}))))),se.createElement("div",{className:"flex-container flex-end"},se.createElement(Ge.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),se.createElement(Ge.ZP,{type:"ghost",onClick:_r},"\u53D6\u6D88")))},Rt=ue(78673),At=ue(3352),rt=ue.n(At),sn=(0,se.forwardRef)(({use3d:dr,width:_r,height:Ln,callback:Wn,showSaveButton:Er},St)=>{const Le=(0,se.useRef)(),We=(0,se.useRef)(),[Be,Oe]=(0,se.useState)(!1),lt=(0,se.useRef)({id:Le,appName:"graphing",width:_r||1e3,height:Ln||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,se.useEffect)(()=>{We.current=new(rt())(lt.current,!0),window.onload=function(){We.current.inject("applet_container")}},[]);const _t=()=>{var Yt=window.ggbApplet.getPNGBase64(1,!0,72);return Wn&&Wn(Yt),Yt};return(0,se.useEffect)(()=>{lt.current.appName=Be?"3D":"graphing",We.current.inject("applet_container")},[Be]),(0,se.useEffect)(()=>{Oe(dr)},[dr]),(0,se.useImperativeHandle)(St,()=>({getImgData:_t})),se.createElement(se.Fragment,null,se.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:Le}),se.createElement(Ot.Z,{align:"middle"},se.createElement(Zt.Z,{flex:1},se.createElement(Rt.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:Be,onChange:Yt=>Oe(Yt)})),se.createElement(Zt.Z,null,se.createElement(Ge.ZP,{size:"large",onClick:_t,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),ct=ue(3315),qt=ue(1012);const an="link",Qe="upload-image",mt="add-flowchart",Nt="draw-image",vn="add-flowchart",mn="code-block",wn="add-table",Tn="------------",Zn={default:Tn,left:`:${Tn}`,center:`:${Tn}:`,right:`${Tn}:`};var Hn=ue(57649),wr=(dr,_r,Ln)=>new Promise((Wn,Er)=>{var St=Be=>{try{We(Ln.next(Be))}catch(Oe){Er(Oe)}},Le=Be=>{try{We(Ln.throw(Be))}catch(Oe){Er(Oe)}},We=Be=>Be.done?Wn(Be.value):Promise.resolve(Be.value).then(St,Le);We((Ln=Ln.apply(dr,_r)).next())});function Cr(){}let Yn=0;const Nr=1e4,Kr="\u2581",Or="@\u2581\u2581@",Ar="@\u2581@",kr=`
**\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`,Gr=["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 ar(dr){return/^\d+$/.test(dr)?`${dr}px`:dr}const Ur=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",Vr={[Ur+"-B"]:"bold",[Ur+"-I"]:"italic"},Yr={[an]:"\u6DFB\u52A0\u94FE\u63A5",[mn]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[Qe]:"\u6DFB\u52A0\u56FE\u7247",[Nt]:"\u6DFB\u52A0\u753B\u56FE",[mt]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[wn]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var Zr=({defaultValue:dr="",onChange:_r,width:Ln="100%",height:Wn=400,miniToolbar:Er=!1,isFocus:St=!1,watch:Le,insertTemp:We,mode:Be="markdown",id:Oe="markdown-editor-id",showResizeBar:lt=!1,noStorage:_t=!1,showNullButton:Yt=!1,showNullProgramButton:Kt=!1,hidetoolBar:Jt=!1,fullScreen:un=!1,onBlur:fn,onCMBeforeChange:xn,onFullScreen:zt,className:ln="",disablePaste:jn=!1,disabled:Dn=!1,disabledFill:Vn=!1,placeholder:Pn="",values:yr="",extraUse:Sn,onAddBlank:pr})=>{const[ht,Ue]=(0,se.useState)(null),[Xe,Ze]=(0,se.useState)(dr),[gt,Wt]=(0,se.useState)(Le),[Gt,nn]=(0,se.useState)(un),[Ht,bt]=(0,se.useState)(""),[Cn,kn]=(0,se.useState)(0),[Jn,Fn]=(0,se.useState)(Wn),[Nn,_n]=(0,se.useState)(!1),tr=(0,se.useRef)((0,qt.Z)()),Xn=(0,se.useRef)(!1),In=(0,se.useRef)(),[zn,cr]=(0,se.useState)(0),[qn,br]=(0,se.useState)(0),Br=(0,se.useRef)(),rr=(0,se.useRef)(),yn=(0,se.useRef)(),hn=(0,se.useRef)(),En=(0,se.useRef)(),Qn=(0,se.useRef)(),Rn=()=>wr(void 0,null,function*(){var lr;const or=yield Fetch("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:tr.current}});(lr=or==null?void 0:or.attachments)!=null&&lr.length&&(console.log("cm:",ht,Br),or.attachments.map(ir=>{ir.content_type.indexOf("image")>-1?ht.replaceSelection(`![,](/api/attachments/${ir.id}?type=${ir.content_type})`):ir.content_type.indexOf("video")>-1?ht.replaceSelection(`<video width="100%" controls src="${pe.Z.API_SERVER}/api/attachments/${data.id}"></video>`):ir.content_type.indexOf("pdf")>-1?ht.replaceSelection(`<a href="${pe.Z.API_SERVER}/api/attachments/${ir.id}?type=${ir.content_type}&disposition=inline" target="_blank">${ir.name}</a>`):ht.replaceSelection(`[${ir.name}](${pe.Z.API_SERVER}/api/attachments/${ir.id}?type=${ir.content_type})`)}))});(0,se.useEffect)(()=>{const lr=window.scrollY||window.pageYOffset;Ze(yr),ht==null||ht.setValue(yr),window.scrollTo(0,lr)},[yr]),(0,se.useEffect)(()=>{zt==null||zt(Gt)},[Gt]),(0,se.useEffect)(()=>{if(Br.current){let lr=function(ir,mr){var ri;if(jn){mr.preventDefault();return}const pi=mr.clipboardData;if(pi){const yi=pi.types.toString(),gi=pi.items;if(yi==="Files"||pi.types.indexOf("Files")>-1){if(mr.preventDefault(),Be=="stex")return;try{let si=gi[1];((ri=gi[0])==null?void 0:ri.kind)==="file"&&(si=gi[0]);const wi=si.getAsFile(),Hi=wi.name.split(".").pop();(0,qe.I)(wi,Di=>{var aa,Ui,Pi;Di.id?((aa=wi==null?void 0:wi.type)==null?void 0:aa.indexOf("image"))>-1?or.replaceSelection(`<img width="100%" src="/api/attachments/${Di.id}?type=${Di.content_type})" alt="" />`):((Ui=wi==null?void 0:wi.type)==null?void 0:Ui.indexOf("video"))>-1?or.replaceSelection(`<video width="100%" controls src="/api/attachments/${Di.id}"></video>`):((Pi=wi==null?void 0:wi.type)==null?void 0:Pi.indexOf("pdf"))>-1?or.replaceSelection(`<a href="/api/attachments/${Di.id}?type=${wi.type}&disposition=inline" target="_blank">${wi.name}</a>`):Gr.includes(Hi)?or.replaceSelection(`<a href="/api/attachments/${Di.id}?type=office&disposition=inline" target="_blank">${wi.name}</a>`):or.replaceSelection(`[${wi.name}](/api/attachments/${Di.id}?type=${Di.content_type})`):(Di==null?void 0:Di.status)===401&&(Xt.ZP.warning((Di==null?void 0:Di.message)||"\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C"),document.location.href="/user/login")})}catch(si){Xt.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const or=ze().fromTextArea(Br.current,{mode:Be,lineNumbers:!Er,lineWrapping:!0,value:dr,autoCloseTags:!Kt,autoCloseBrackets:!0});return or.on("keyup",function(ir,mr){mr.keyCode===8&&(ir.getValue()==""?or.setOption("placeholder",Pn):or.setOption("placeholder",null))}),or.on("keydown",function(ir,mr){if(mr.keyCode===8){var ri=er(ir);ri&&mr.preventDefault()}}),St&&or.focus(),or.on("paste",lr),or.on("dragleave",function(ir,mr){rr.current.classList.remove("mouse-hover-md")}),Dn&&or.on("beforeChange",function(ir,mr){(mr.origin==="paste"||mr.origin==="+input")&&mr.cancel()}),Ue(or),()=>{or.off("paste",lr)}}},[]);const Mn=(0,se.useCallback)(()=>{if(rr.current)try{}catch(lr){console.log(lr,"---- to set md editor body height")}},[Jn,rr,Gt]);(0,se.useEffect)(()=>{function lr(){let or=new ut.Z(ir=>{for(let mr of ir)(mr.target.offsetHeight>0||mr.target.offsetWidth>0)&&(Mn(),ht.setSize("100%","100%"),ht.refresh())});return or.observe(Br.current.parentElement),or}if(ht){const or=lr();return()=>{var ir,mr;(ir=Br.current)!=null&&ir.parentElement&&or.unobserve((mr=Br.current)==null?void 0:mr.parentElement)}}},[ht,Mn]),(0,se.useEffect)(()=>{if(ht){let lr=[];for(const[or,ir]of Object.entries(Vr)){let mr={[or]:()=>{vr(ir)}};lr.push(mr),ht.addKeyMap(mr)}return In.current=setInterval(()=>{Xn.current&&Rn()},4e3),()=>{clearInterval(In.current);for(let or of lr)ht.removeKeyMap(or)}}},[ht]),(0,se.useEffect)(()=>{un!==Gt&&nn(un)},[un]),(0,Hn.Z)(()=>{if(!_t&&Cn>0){let lr=new Date().getTime(),or=window.sessionStorage.getItem(Oe);lr>=Cn+Nr&&(!or||or!==Xe)&&(window.sessionStorage.setItem(Oe,Xe),_n(!0))}},Nr),(0,se.useEffect)(()=>{Wt(Le)},[ht,Le]),(0,se.useEffect)(()=>{ht&&St&&ht.focus()},[ht,St]),(0,se.useEffect)(()=>{if(gt&&ht){let lr=function(ir){let mr=ir.target;if(hn.current){let ri=mr.scrollTop/mr.scrollHeight;hn.current.scrollTop=hn.current.scrollHeight*ri}};const or=ht.getScrollerElement();return or.addEventListener("scroll",lr),()=>{or.removeEventListener("scroll",lr)}}},[ht,gt]),(0,se.useEffect)(()=>{if(ht&&xn){let lr=function(or,ir){xn(or,ir)};return ht.on("beforeChange",lr),()=>{ht.off("beforeChange",lr)}}},[ht,xn]),(0,se.useEffect)(()=>{if(ht&&fn){let lr=function(){fn(ht.getValue())};return ht.on("blur",lr),()=>{ht.off("blur",lr)}}},[ht,fn]);function er(lr,or){var ir=lr.getDoc(),mr=ir.getCursor(),ri=ir.getLine(mr.line),pi=ri.charAt(mr.ch-1),yi=ri.lastIndexOf("@\u2581@",mr.ch),gi=ri.lastIndexOf("@\u2581\u2581@",mr.ch),si=yi>gi?yi:gi,wi=yi>gi?3:4;if(Or.indexOf(pi)===-1)return null;if(console.log("change1:",or,lr,ri,mr,si,yi,gi,pi),si>=0&&mr.ch-si<5){var Hi=si+wi;return ir.replaceRange("",{line:mr.line,ch:si},{line:mr.line,ch:Hi}),{line:mr.line,ch:Hi}}return null}(0,se.useEffect)(()=>{if(ht){let lr=function(or,ir){const mr=or.getValue();Ze(mr),kn(new Date().getTime()),or.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),_r&&(Kt?_r(mr,vi(mr)):_r(mr))};return ht.on("change",lr),()=>{ht.off("change",lr)}}},[ht,_r]),(0,se.useEffect)(()=>{if(ht)if(dr==null)ht.setValue(""),Ze("");else{const lr=window.scrollY||window.pageYOffset;dr!==ht.getValue()&&(ht.setValue(dr),Ze(dr),ht.setCursor(Dn?1:ht.lineCount(),0),window.scrollTo(0,lr))}},[ht,dr]);const vr=(0,se.useCallback)(lr=>{const or=ht.getCursor(),ir=ht.getSelection();let mr=ir.split(`
`);switch(lr){case"bold":return ht.replaceSelection("**"+ir+"**"),ir===""&&ht.setCursor(or.line,or.ch+2),ht.focus();case"italic":return ht.replaceSelection("*"+ir+"*"),ir===""&&ht.setCursor(or.line,or.ch+1),ht.focus();case"code":return ht.replaceSelection("`"+ir+"`"),ir===""&&ht.setCursor(or.line,or.ch+1),ht.focus();case"inline-latex":return bt("inline-latex"),ht.focus();case"latex":return ht.replaceSelection("```latex\n"+ir+"\n```"),ht.setCursor(or.line+1,ir.length+1),ht.focus();case"line-break":return ht.replaceSelection(`<br/>
`),ht.focus();case"list-ul":return ir===""?ht.replaceSelection("- "+ir):ht.replaceSelection(mr.map(ri=>ri===""?"":`- ${ri}`).join(`
`)),ht.focus();case"list-ol":return ir===""?ht.replaceSelection("1. "+ir):ht.replaceSelection(mr.map((ri,pi)=>ri===""?"":`${pi+1}. ${ri}`).join(`
`)),ht.focus();case"add-null-ch":pr==null||pr();return;case"add-signal":return ir===""&&ht.setCursor(or.line,or.ch),ht.replaceSelection(Ar),ht.focus();case"add-multiple":return ir===""&&ht.setCursor(or.line,or.ch),ht.replaceSelection(Or),ht.focus();case"inster-template-1":return ir===""&&ht.setCursor(or.line,or.ch),ht.replaceSelection(kr),ht.focus();case"eraser":return ht.setValue(""),ht.focus();case"trigger-watch":return Wt(!gt),ht.focus();case"trigger-full-screen":return nn(!Gt),ht.focus();case an:bt(an);return;case mn:bt(mn);return;case Qe:bt(Qe);return;case Nt:bt(Nt);return;case"maths-latex":bt("maths-latex");return;case mt:En.current="",sessionStorage.removeItem("file_id"),bt(mt);return;case wn:bt(wn);return;default:throw new Error}},[ht,gt,Gt]),Dr=(0,se.useCallback)((lr,or)=>{var ir,mr,ri,pi,yi,gi;bt("");const{src:si,alt:wi,id:Hi}=lr||{};switch(Ht){case an:const{title:Pa,link:da}=lr;return ht.replaceSelection(`[${Pa}](${da})`),ht.focus();case mn:const{language:oa,content:Xi}=lr;return ht.replaceSelection(["```"+oa,Xi,"```"].join(`
`)),ht.focus();case"maths-latex":for(var Di=atob(lr),aa=new Uint8Array(Di.length),Ui=0;Ui<Di.length;Ui++)aa[Ui]=Di.charCodeAt(Ui);var Pi=new Blob([aa],{type:"image/png"});(0,qe.I)(Pi,ii=>{ii.id?ht.replaceSelection(`![,](/api/attachments/${ii.id}?type=${ii.content_type})`):(ii==null?void 0:ii.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":ht.replaceSelection("`$$"+lr+"$$`");break;case vn:if(!Hi)return;ht.focus(),ht.getValue().indexOf(si)===-1?ht.replaceSelection(`<center><img id="${Hi}" width="80%" src="${si}" class="draw-flowchart" alt="${wi||""}" /></center>`):document.getElementById(Hi).src=pe.Z.API_SERVER+si+"?t="+Date.now();try{setTimeout(()=>{fn(ht.getValue())},100)}catch(ii){}break;case Qe:case Nt:const Si=or,Tr=(ri=(mr=(ir=Si==null?void 0:Si.name)==null?void 0:ir.split("."))==null?void 0:mr.pop)==null?void 0:ri.call(mr);return((pi=Si==null?void 0:Si.type)==null?void 0:pi.indexOf("image"))>-1||!(Si!=null&&Si.type)?Si!=null&&Si.align||Si!=null&&Si.width?ht.replaceSelection(`<p style="text-align:${Si.align||"initial"}"><img width="${Si.width?Si.width+"%":"initial"}" src="${si}" alt="${wi||""}" /></p>`):ht.replaceSelection(`<img width="100%" src="${si}" alt="${wi||""}" />`):((yi=Si==null?void 0:Si.type)==null?void 0:yi.indexOf("video"))>-1?ht.replaceSelection(`<video width="100%" controls src="${si}"></video>`):((gi=Si==null?void 0:Si.type)==null?void 0:gi.indexOf("pdf"))>-1?ht.replaceSelection(`<a href="${si}?type=${Si.type}&disposition=inline" target="_blank">${Si.name}</a>`):Gr.includes(Tr)?ht.replaceSelection(`<a href="${si}?type=office&disposition=inline" target="_blank">${Si.name}</a>`):ht.replaceSelection(`[${Si.name}](${si})`),ht.focus();case wn:const{row:ti,col:Hr,align:Ir}=lr;let ni=`
`;for(let ii=0;ii<ti;ii++){let Bi=[],Oi=[];for(let Fi=0;Fi<Hr;Fi++)ii===1&&Oi.push(Zn[Ir]),Bi.push(" ");ii===1&&(ni+=`| ${Oi.join(" | ")} |
`),ni+=`| ${Bi.join(Hr===1?"":" | ")} |
`}return ht.replaceSelection(ni+`
`),ht.focus();default:throw new Error}},[ht,Ht]),ei=(0,se.useMemo)(()=>{switch(Ht){case an:return se.createElement(Qt,{callback:Dr,onCancel:$n});case mn:return se.createElement(Vt.Z,{callback:Dr,onCancel:$n});case Qe:return se.createElement(qe.Z,{callback:Dr,onCancel:$n});case mt:return se.createElement(he,{editImgId:En.current,callback:Dr,onCancel:$n});case wn:return se.createElement(je,{callback:Dr,onCancel:$n});case"maths-latex":return se.createElement(sn,{showSaveButton:!0,callback:Dr});case"inline-latex":return se.createElement(ct.Z,{showSaveButton:!0,callback:Dr});default:return null}},[Ht]);function $n(){bt("")}(0,se.useEffect)(()=>{if(yn.current){let lr=function(yi){ri=!0,pi=yi.pageY},or=function(){ri=!1},ir=function(yi){if(ri){let gi=yi.pageY-pi;gi<0&&(gi=0),gi>300&&(gi=300);let si=Wn+gi+"px";Fn(si)}},mr=yn.current,ri=!1,pi=0;return mr.addEventListener("mousedown",lr),document.addEventListener("mousemove",ir),document.addEventListener("mouseup",or),()=>{mr.removeEventListener("mousedown",lr),document.removeEventListener("mousemove",ir),document.removeEventListener("mouseup",or)}}},[ht,yn]),(0,se.useEffect)(()=>{Fn(Wn)},[Wn]);const Kn=ar(Ln),Gn=ar(Jn),sr={width:Kn,height:Gn},Wr=(0,se.useMemo)(()=>{if(Cn){let lr=new Date(Cn),or=lr.getHours(),ir=lr.getMinutes(),mr=lr.getSeconds();return or=or<10?"0"+or:or,ir=ir<10?"0"+ir:ir,mr=mr<10?"0"+mr:mr,`${or}:${ir}:${mr}`}return 0},[Cn]),vi=lr=>{const or=[];if(Kt){let ir=-1;lr=lr.replace(/(@▁▁@|@▁@)/g,function(mr,ri,pi){or.push({multiLine:mr!==Ar})})}return or};function ci(){window.sessionStorage.removeItem(Oe),_n(!1),kn(0)}function qr(){_n(!1),kn(0),ht.setValue(window.sessionStorage.getItem(Oe))}(0,se.useEffect)(()=>{Yr[Ht]&&Ht!==Nt&&Ht!==mt&&setTimeout(()=>{const lr=document.getElementsByClassName("markdown-popup-form")[0],or=window.innerWidth/2-lr.offsetWidth/2,ir=window.innerHeight/2-lr.offsetHeight/2;cr(or),br(ir)},0)},[Ht]);const fi=lr=>{lr.preventDefault();const or=lr.clientX-zn,ir=lr.clientY-qn;document.body.onmousemove=mr=>{let ri=mr.clientX-or,pi=mr.clientY-ir;const yi=document.getElementsByClassName("markdown-popup-form")[0],gi=window.innerWidth-yi.offsetWidth,si=window.innerHeight-yi.offsetHeight;ri=Math.max(0,Math.min(ri,gi)),pi=Math.max(0,Math.min(pi,si)),mi(mr.clientX,mr.clientY,or,ir)&&(cr(ri),br(pi))},document.body.onmouseup=function(){document.body.onmousemove=null}},mi=(lr,or,ir,mr)=>{const ri=document.body.clientHeight,pi=document.body.clientWidth;return lr<20&&ir>lr||lr>pi-20&&ir<lr||or<20&&mr>or||or>ri-20&&mr<or?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};return se.createElement(se.Fragment,null,se.createElement("div",{className:"markdown-editor-wrapper",ref:rr},se.createElement("div",{className:`markdown-editor-container ${ln} ${gt?"on-preview":""} ${Er?"mini":""} ${Gt?"full-screen":""}`,style:sr},se.createElement(Je,{insertTemp:We,watch:gt,fullScreen:Gt,showNullButton:Yt,showNullProgramButton:Kt,onActionCallback:vr,hidetoolBar:Jt,extraUse:Sn}),se.createElement("div",{className:"markdown-editor-body"},se.createElement("div",{className:"codemirror-container"},se.createElement("textarea",{ref:Br,placeholder:Pn})),gt?se.createElement("div",{ref:hn,className:"preview-container"},Be==="stex"&&se.createElement(Ae,{value:Xe}),Be!=="stex"&&se.createElement(dt.Z,{edit:!0,disabledFill:Vn,showProgramFill:Kt,value:Xe,openEditor:lr=>{var or;En.current=lr,(or=Qn.current)==null||or.setHeight("100vh"),setTimeout(()=>{bt("add-flowchart")},150)}})):null))),lt?se.createElement("a",{ref:yn,className:"editor-resize"}):null,Ht===Nt&&se.createElement(on,{callback:Dr,onCancel:$n}),Ht===mt&&se.createElement(he,{ref:Qn,editImgId:En.current,callback:Dr,onCancel:$n}),se.createElement(Lt.Z,null,Yr[Ht]&&Ht!==Nt&&Ht!==mt?se.createElement(nt.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:zn,top:qn},title:se.createElement("div",{style:{cursor:"move"},onMouseDown:fi},Yr[Ht]),open:!0,onCancel:$n,footer:null,destroyOnClose:!0,width:Ht===mt?"1200px":null,height:Ht===mt?"80vh":null,className:"markdown-popup-form"},ei):null))}},58448:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return Ve},I:function(){return Lt}});var se=ue(78241),Te=ue(8591),ze=ue(92832),ut=ue(81327),xe=ue(5871),Me=ue(5112),De=ue(3113),we=ue(79090),_e=ue(59301),Re=ue(7544),dt=ue(59301),Ae=Object.defineProperty,Fe=Object.defineProperties,ft=Object.getOwnPropertyDescriptors,Ye=Object.getOwnPropertySymbols,ot=Object.prototype.hasOwnProperty,at=Object.prototype.propertyIsEnumerable,Ct=(et,Dt,Ge)=>Dt in et?Ae(et,Dt,{enumerable:!0,configurable:!0,writable:!0,value:Ge}):et[Dt]=Ge,jt=(et,Dt)=>{for(var Ge in Dt||(Dt={}))ot.call(Dt,Ge)&&Ct(et,Ge,Dt[Ge]);if(Ye)for(var Ge of Ye(Dt))at.call(Dt,Ge)&&Ct(et,Ge,Dt[Ge]);return et},it=(et,Dt)=>Fe(et,ft(Dt));const{useForm:vt}=se.default,$e={width:280,marginRight:10},Ee={labelCol:{span:5},wrapperCol:{span:19}};var Ve=({callback:et,onCancel:Dt})=>{const[Ge]=vt();let kt=(0,_e.useRef)();function tt(Bt){kt.current.width=Ge.getFieldValue("width"),kt.current.align=Ge.getFieldValue("align"),et(Bt,kt.current)}function $t(Bt,Tt){if(Bt.status===-1){Te.ZP.error(Bt.message);return}Ge.setFieldsValue({src:`/api/attachments/${Bt.id}`,type:Tt.type})}function pt(Bt){let Tt=Bt.target.files[0];kt.current=Tt,Lt(Tt,$t)}return dt.createElement(se.default,it(jt({form:Ge},Ee),{className:"upload-image-panel",onFinish:tt,style:{width:470,overflow:"hidden"}}),dt.createElement(se.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},dt.createElement("div",{className:"flex-container"},dt.createElement(se.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},dt.createElement(ze.default,{style:$e})),dt.createElement(Je,{onFileChange:pt}))),dt.createElement(se.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},dt.createElement(ze.default,{style:{width:264}})),dt.createElement(se.default.Item,{label:"\u56FE\u7247\u5BBD\u5EA6",name:"width"},dt.createElement(ut.Z,null,dt.createElement(se.default.Item,{name:"width",style:{margin:0}},dt.createElement(xe.Z,{style:{width:264}})),dt.createElement("span",{className:"ml8"},"%"))),dt.createElement(se.default.Item,{label:"\u5BF9\u9F50\u65B9\u5F0F",name:"align"},dt.createElement(Me.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"}]})),dt.createElement("aside",null,dt.createElement(se.default.Item,{style:{textAlign:"right",position:"relative",right:-98}},dt.createElement(De.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),dt.createElement(De.ZP,{type:"default",onClick:Dt},"\u53D6\u6D88"))))};function Je({onFileChange:et}){return dt.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",dt.createElement("input",{type:"file",onChange:et}))}function Lt(et,Dt){if(!et)throw new String("\u6CA1\u6709\u6587\u4EF6");if(!(0,Re.bg)())throw Te.ZP.warning("\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C"),new String("\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C");let Ge=new FormData;Ge.append("editormd-image-file",et),Ge.append("file_param_name","editormd-image-file"),Ge.append("byxhr","true");var kt=new window.XMLHttpRequest;kt.withCredentials=!0,kt.addEventListener("load",function(tt){Dt(JSON.parse(tt.target.responseText),et)},!1),kt.addEventListener("error",function(tt){console.error(tt)},!1),kt.open("POST",`${we.KI}/api/attachments.json`),kt.send(Ge)}},53531:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return ze}});var se=ue(59301),Te=ue(4676);class ze extends se.Component{constructor(xe){super(xe);const Me=window.document;this.node=Me.createElement("div"),Me.body.appendChild(this.node)}render(){const{children:xe}=this.props;return(0,Te.createPortal)(xe,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},57649:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return Te}});var se=ue(59301);function Te(ze,ut){const xe=(0,se.useRef)();(0,se.useEffect)(()=>{xe.current=ze}),(0,se.useEffect)(()=>{function Me(){xe.current()}if(ut!==null){let De=setInterval(Me,ut);return()=>clearInterval(De)}},[ut])}},21769:function(bn,tn,ue){"use strict";ue.r(tn),ue.d(tn,{default:function(){return ht}});var se=ue(59301),Te=ue(91482),ze=ue(20834),ut=ue(44e3),xe=ue(78241),Me=ue(8591),De=ue(28103),we=ue(66104),_e=ue(95237),Re=ue(43604),dt=ue(6848),Ae=ue(92832),Fe=ue(3113),ft=ue(32134),Ye=ue(63344),ot=ue(43418),at=ue(24905),Ct=ue(5871),jt=ue(31591),it=ue(40973),vt=ue(39655),$e={flex_box_center:"flex_box_center___T9vjl",flex_space_between:"flex_space_between___zZP1J",flex_box_vertical_center:"flex_box_vertical_center___vbIhw",flex_box_center_end:"flex_box_center_end___SjRau",flex_box_column:"flex_box_column___Ic_zi",wrap:"wrap___GtXAk",modal:"modal___mDuC3",titleWrap:"titleWrap___EzCZh",required:"required___KgfdI",title:"title___TMgfc",colorGray:"colorGray___xNVTs",choiceWrap:"choiceWrap___Rv9ug",answer:"answer___hVpls",activeAnswer:"activeAnswer___oJoq9",deleteIcon:"deleteIcon___bkn4b",addIcon:"addIcon___S2pDY",editorWrap:"editorWrap___BOx_r",htmlWrap:"htmlWrap___ERVlQ",radio:"radio___lrt5b",color333:"color333___pz3OT",color999:"color999___jtQ7e",questionType:"questionType___qUnUb",questionChoices:"questionChoices___n36qp"},Ee=Object.defineProperty,Ve=Object.getOwnPropertySymbols,Je=Object.prototype.hasOwnProperty,Lt=Object.prototype.propertyIsEnumerable,et=(Ue,Xe,Ze)=>Xe in Ue?Ee(Ue,Xe,{enumerable:!0,configurable:!0,writable:!0,value:Ze}):Ue[Xe]=Ze,Dt=(Ue,Xe)=>{for(var Ze in Xe||(Xe={}))Je.call(Xe,Ze)&&et(Ue,Ze,Xe[Ze]);if(Ve)for(var Ze of Ve(Xe))Lt.call(Xe,Ze)&&et(Ue,Ze,Xe[Ze]);return Ue},Ge=(Ue,Xe)=>{var Ze={};for(var gt in Ue)Je.call(Ue,gt)&&Xe.indexOf(gt)<0&&(Ze[gt]=Ue[gt]);if(Ue!=null&&Ve)for(var gt of Ve(Ue))Xe.indexOf(gt)<0&&Lt.call(Ue,gt)&&(Ze[gt]=Ue[gt]);return Ze},kt=(Ue,Xe,Ze)=>new Promise((gt,Wt)=>{var Gt=bt=>{try{Ht(Ze.next(bt))}catch(Cn){Wt(Cn)}},nn=bt=>{try{Ht(Ze.throw(bt))}catch(Cn){Wt(Cn)}},Ht=bt=>bt.done?gt(bt.value):Promise.resolve(bt.value).then(Gt,nn);Ht((Ze=Ze.apply(Ue,Xe)).next())});const tt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],$t=(Ue,Xe)=>{var Ze=Ue,{problemset:gt,globalSetting:Wt,loading:Gt,dispatch:nn,onRef:Ht=()=>{},editData:bt}=Ze,Cn=Ge(Ze,["problemset","globalSetting","loading","dispatch","onRef","editData"]);const[kn,Jn]=(0,se.useState)([]),[Fn,Nn]=(0,se.useState)(),[_n,tr]=(0,se.useState)([]),[Xn,In]=(0,se.useState)(""),[zn,cr]=(0,se.useState)(5),[qn,br]=(0,se.useState)(!1),Br=(0,Te.useParams)();(0,se.useEffect)(()=>{Jn(["","","",""])},[]),(0,se.useEffect)(()=>{if(!(bt!=null&&bt.question_choices)){br(!0);return}In(bt==null?void 0:bt.question_title),cr(parseInt(bt==null?void 0:bt.question_score)),Jn(bt==null?void 0:bt.question_choices.map(Mn=>Mn.choice_text));const Rn=[];bt==null||bt.standard_answer.map((Mn,er)=>{Rn.push(Mn-1)}),tr(Rn)},[bt]),(0,se.useImperativeHandle)(Xe,()=>({onSave:rr,isEdit:qn}));const rr=()=>kt(void 0,null,function*(){if(!Xn)return Me.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),!1;const Rn=kn.findIndex(vr=>!vr);if(Rn>-1)return Me.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${tt[Rn]} \u9009\u9879\u7684\u5185\u5BB9`),!1;if(!_n.length)return Me.ZP.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),!1;if(_n.length<1)return Me.ZP.info("\u8BF7\u9009\u62E9\u7B54\u6848"),!1;const Mn=kn.map((vr,Dr)=>({choice_text:vr,is_answer:_n.includes(Dr)?Dr+1:0}));let er;bt.question_id?er=yield nn({type:"exercise/editExerciseQuestion",payload:{id:bt.question_id,question_title:Xn,question_type:1,question_score:"5.0",question_choices:Mn.map(vr=>vr.choice_text),standard_answers:Mn.filter(vr=>vr.is_answer).map(vr=>vr.is_answer)}}):er=yield nn({type:"exercise/addExerciseQuestion",payload:{categoryId:Br.categoryId,question_title:Xn,question_type:1,question_score:"5.0",question_choices:Mn.map(vr=>vr.choice_text),standard_answers:Mn.filter(vr=>vr.is_answer).map(vr=>vr.is_answer)}}),er.status===0&&(Me.ZP.success("\u4FDD\u5B58\u6210\u529F"),br(!1),nn({type:"exercise/editExercise",payload:Dt({},Br)}))}),yn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],hn=Rn=>kt(void 0,null,function*(){switch(Rn.id){case"del":let Mn;ot.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return kt(this,null,function*(){yield(0,jt.Fl)({id:bt.question_id}),nn({type:"exercise/editExercise",payload:Dt({},Br)})})}});break;case"up":case"down":yield nn({type:"exercise/exeriseMoveUpDown",payload:{id:bt.question_id,opr:Rn.id}}),nn({type:"exercise/editExercise",payload:Dt({},Br)});break;case"edit":br(!0);break}}),En=()=>{var Rn;return se.createElement("aside",null,se.createElement("div",{className:$e.questionType},se.createElement("div",null,se.createElement("span",{className:"font16 c-blue"},bt.key,"\u3001\u591A\u9009\u9898"),"\uFF08",bt.question_score,"\u5206\uFF09"),!bt.hideAction&&yn.map(function(Mn,er){return Mn.id==="up"&&bt.key===1||Mn.id==="down"&&bt.key===bt.len?null:se.createElement(dt.Z,{key:er,placement:"bottom",title:Mn.name},se.createElement("span",{onClick:()=>hn(Mn),className:Mn.icon}))})),se.createElement("div",{className:"mt5"},se.createElement(vt.Z,{value:bt.question_title})),se.createElement("div",{className:$e.questionChoices},(Rn=bt==null?void 0:bt.question_choices)==null?void 0:Rn.map(function(Mn,er){return se.createElement(_e.Z,null,se.createElement(Re.Z,null,se.createElement(at.default,{key:er,checked:bt.standard_answer.includes(er+1),disabled:!0},tt[er],".")),se.createElement(Re.Z,{flex:"1"},se.createElement("span",{className:"c-black font14"},se.createElement(vt.Z,{value:Mn.choice_text}))))})))},Qn=()=>se.createElement("aside",null,se.createElement("div",{className:$e.questionType},se.createElement("div",null,se.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),se.createElement("p",{className:$e.titleWrap},se.createElement("span",{className:$e.required},"*"),se.createElement("span",{className:$e.title},"\u9898\u5E72\uFF1A")),se.createElement(it.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Xn,onChange:Rn=>In(Rn)}),kn.map((Rn,Mn)=>se.createElement("div",{className:$e.choiceWrap,key:Mn},se.createElement(dt.Z,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},se.createElement("div",{className:`${$e.answer} ${_n.includes(Mn)?$e.activeAnswer:""}`,onClick:()=>{_n.includes(Mn)?tr(_n.filter(er=>er!==Mn)):tr([..._n,Mn])}},tt[Mn])),se.createElement("div",{className:$e.editorWrap},Fn===Mn?se.createElement(it.Z,{id:`single-question-option-${Mn}`,watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Rn,onChange:er=>{kn[Mn]=er,Jn(kn)}}):se.createElement("div",{className:$e.htmlWrap,onClick:()=>Nn(Mn)},se.createElement(vt.Z,{value:Rn}))),Mn>1&&se.createElement(dt.Z,{title:"\u5220\u9664"},se.createElement("i",{className:`${$e.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>Jn(kn.filter((er,vr)=>vr!==Mn))})),Mn<7&&Mn===kn.length-1&&se.createElement(dt.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},se.createElement("i",{className:`${$e.addIcon} iconfont icon-roundaddfill ml6`,onClick:()=>Jn([...kn,""])})))),se.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),se.createElement("p",{className:""},"\u5206\u503C\uFF1A",se.createElement(Ct.Z,{value:zn,max:1e4,min:-1,onChange:Rn=>{cr(Rn)}})," \u5206"),se.createElement("aside",{className:"tr"},bt.question_id&&se.createElement(Fe.ZP,{type:"default",onClick:()=>br(!1)},"\u53D6\u6D88"),se.createElement(Fe.ZP,{className:"ml20",type:"primary",onClick:()=>rr()},"\u4FDD\u5B58")));return se.createElement("section",{className:$e.wrap},!qn&&En(),qn&&Qn())};var pt=(0,Te.connect)(({problemset:Ue,loading:Xe,globalSetting:Ze})=>({problemset:Ue,globalSetting:Ze,loading:Xe.effects}),null,null,{forwardRef:!0})((0,se.forwardRef)($t)),Bt=ue(5112),Tt=Object.defineProperty,wt=Object.getOwnPropertySymbols,Ne=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable,xt=(Ue,Xe,Ze)=>Xe in Ue?Tt(Ue,Xe,{enumerable:!0,configurable:!0,writable:!0,value:Ze}):Ue[Xe]=Ze,Qt=(Ue,Xe)=>{for(var Ze in Xe||(Xe={}))Ne.call(Xe,Ze)&&xt(Ue,Ze,Xe[Ze]);if(wt)for(var Ze of wt(Xe))be.call(Xe,Ze)&&xt(Ue,Ze,Xe[Ze]);return Ue},Vt=(Ue,Xe)=>{var Ze={};for(var gt in Ue)Ne.call(Ue,gt)&&Xe.indexOf(gt)<0&&(Ze[gt]=Ue[gt]);if(Ue!=null&&wt)for(var gt of wt(Ue))Xe.indexOf(gt)<0&&be.call(Ue,gt)&&(Ze[gt]=Ue[gt]);return Ze},qe=(Ue,Xe,Ze)=>new Promise((gt,Wt)=>{var Gt=bt=>{try{Ht(Ze.next(bt))}catch(Cn){Wt(Cn)}},nn=bt=>{try{Ht(Ze.throw(bt))}catch(Cn){Wt(Cn)}},Ht=bt=>bt.done?gt(bt.value):Promise.resolve(bt.value).then(Gt,nn);Ht((Ze=Ze.apply(Ue,Xe)).next())});const nt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Ot=(Ue,Xe)=>{var Ze=Ue,{problemset:gt,globalSetting:Wt,loading:Gt,dispatch:nn,onRef:Ht=()=>{},editData:bt}=Ze,Cn=Vt(Ze,["problemset","globalSetting","loading","dispatch","onRef","editData"]);const[kn,Jn]=(0,se.useState)([]),[Fn,Nn]=(0,se.useState)(),[_n,tr]=(0,se.useState)([]),[Xn,In]=(0,se.useState)(""),[zn,cr]=(0,se.useState)(0),[qn,br]=(0,se.useState)(!1),Br=(0,Te.useParams)();(0,se.useEffect)(()=>{Jn(["","","",""])},[]),(0,se.useEffect)(()=>{if(!(bt!=null&&bt.question_choices)){br(!0);return}In(bt==null?void 0:bt.question_title),cr(parseInt(bt==null?void 0:bt.question_score)),Jn(bt==null?void 0:bt.question_choices.map(Mn=>Mn.choice_text));const Rn=[];bt==null||bt.standard_answer.map((Mn,er)=>{Rn.push(Mn-1)}),tr(Rn)},[bt]),(0,se.useImperativeHandle)(Xe,()=>({onSave:rr,isEdit:qn}));const rr=()=>qe(void 0,null,function*(){if(!Xn)return Me.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),!1;const Rn=kn.findIndex(vr=>!vr);if(Rn>-1)return Me.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${nt[Rn]} \u9009\u9879\u7684\u5185\u5BB9`),!1;if(!_n.length)return Me.ZP.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),!1;if(_n.length<1)return Me.ZP.info("\u8BF7\u9009\u62E9\u7B54\u6848"),!1;const Mn=kn.map((vr,Dr)=>({choice_text:vr,is_answer:_n.includes(Dr)?Dr+1:0}));let er;bt.question_id?er=yield(0,Ye.Kc)({id:bt.question_id,question_title:Xn,question_type:1,question_score:zn,question_choices:Mn.map(vr=>vr.choice_text),standard_answers:Mn.filter(vr=>vr.is_answer).map(vr=>vr.is_answer)}):er=yield(0,Ye.iV)({exercise_bank_id:Br.topicId,question_title:Xn,question_type:1,question_score:"5.0",question_choices:Mn.map(vr=>vr.choice_text),standard_answers:Mn.filter(vr=>vr.is_answer).map(vr=>vr.is_answer)}),er.status===0&&(Me.ZP.success("\u4FDD\u5B58\u6210\u529F"),br(!1)),yield nn({type:"polls/getExerciseBanks",payload:Qt({},Br)})}),yn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],hn=Rn=>qe(void 0,null,function*(){switch(Rn.id){case"del":let Mn;ot.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return qe(this,null,function*(){yield(0,Ye.x$)({pollsId:bt.question_id}),nn({type:"polls/getExerciseBanks",payload:Qt({},Br)})})}});break;case"up":case"down":yield(0,Ye.W)({exerciseId:bt==null?void 0:bt.question_id,opr:Rn.id}),nn({type:"polls/getExerciseBanks",payload:Qt({},Br)});break;case"edit":br(!0);break}}),En=()=>{var Rn;return se.createElement("aside",null,se.createElement("div",{className:$e.questionType},se.createElement("div",null,se.createElement("span",{className:"font16 c-blue"},bt.key,"\u3001\u5355\u9009\u9898"),"\uFF08",bt.question_score,"\u5206\uFF09"),!bt.hideAction&&yn.map(function(Mn,er){return Mn.id==="up"&&bt.key===1||Mn.id==="down"&&bt.key===bt.len?null:se.createElement(dt.Z,{key:er,placement:"bottom",title:Mn.name},se.createElement("span",{onClick:()=>hn(Mn),className:Mn.icon}))})),se.createElement("div",{className:"mt5"},se.createElement(vt.Z,{value:bt.question_title})),se.createElement("div",{className:$e.questionChoices},(Rn=bt==null?void 0:bt.question_choices)==null?void 0:Rn.map(function(Mn,er){return se.createElement(_e.Z,null,se.createElement(Re.Z,null,se.createElement(Bt.ZP,{key:er,checked:bt.standard_answer.includes(er+1),disabled:!0},nt[er],".")),se.createElement(Re.Z,{flex:"1"},se.createElement("span",{className:"c-black font14"},se.createElement(vt.Z,{value:Mn.choice_text}))))})))},Qn=()=>se.createElement("aside",null,se.createElement("div",{className:$e.questionType},se.createElement("div",null,se.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),se.createElement("p",{className:$e.titleWrap},se.createElement("span",{className:$e.required},"*"),se.createElement("span",{className:$e.title},"\u9898\u5E72\uFF1A")),se.createElement(it.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Xn,onChange:Rn=>In(Rn)}),kn.map((Rn,Mn)=>se.createElement("div",{className:$e.choiceWrap,key:Mn},se.createElement(dt.Z,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},se.createElement("div",{className:`${$e.answer} ${_n.includes(Mn)?$e.activeAnswer:""}`,onClick:()=>{_n.includes(Mn)?tr(_n.filter(er=>er!==Mn)):tr([..._n,Mn])}},nt[Mn])),se.createElement("div",{className:$e.editorWrap},Fn===Mn?se.createElement(it.Z,{id:`single-question-option-${Mn}`,watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Rn,onChange:er=>{kn[Mn]=er,Jn(kn)}}):se.createElement("div",{className:$e.htmlWrap,onClick:()=>Nn(Mn)},se.createElement(vt.Z,{value:Rn}))),Mn>1&&se.createElement(dt.Z,{title:"\u5220\u9664"},se.createElement("i",{className:`${$e.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>Jn(kn.filter((er,vr)=>vr!==Mn))})),Mn<7&&Mn===kn.length-1&&se.createElement(dt.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},se.createElement("i",{className:`${$e.addIcon} iconfont icon-roundaddfill ml6`,onClick:()=>Jn([...kn,""])})))),se.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),se.createElement("p",{className:""},"\u5206\u503C\uFF1A",se.createElement(Ct.Z,{value:zn,max:1e4,min:-1,onChange:Rn=>{cr(Rn)}})," \u5206"),se.createElement("aside",{className:"tr"},bt.question_id&&se.createElement(Fe.ZP,{type:"default",onClick:()=>br(!1)},"\u53D6\u6D88"),se.createElement(Fe.ZP,{className:"ml20",type:"primary",onClick:()=>rr()},"\u4FDD\u5B58")));return se.createElement("section",{className:$e.wrap},!qn&&En(),qn&&Qn())};var dn=(0,Te.connect)(({problemset:Ue,loading:Xe,globalSetting:Ze})=>({problemset:Ue,globalSetting:Ze,loading:Xe.effects}),null,null,{forwardRef:!0})((0,se.forwardRef)(Ot)),en=Object.defineProperty,on=Object.getOwnPropertySymbols,Xt=Object.prototype.hasOwnProperty,Ut=Object.prototype.propertyIsEnumerable,Zt=(Ue,Xe,Ze)=>Xe in Ue?en(Ue,Xe,{enumerable:!0,configurable:!0,writable:!0,value:Ze}):Ue[Xe]=Ze,ye=(Ue,Xe)=>{for(var Ze in Xe||(Xe={}))Xt.call(Xe,Ze)&&Zt(Ue,Ze,Xe[Ze]);if(on)for(var Ze of on(Xe))Ut.call(Xe,Ze)&&Zt(Ue,Ze,Xe[Ze]);return Ue},le=(Ue,Xe)=>{var Ze={};for(var gt in Ue)Xt.call(Ue,gt)&&Xe.indexOf(gt)<0&&(Ze[gt]=Ue[gt]);if(Ue!=null&&on)for(var gt of on(Ue))Xe.indexOf(gt)<0&&Ut.call(Ue,gt)&&(Ze[gt]=Ue[gt]);return Ze},oe=(Ue,Xe,Ze)=>new Promise((gt,Wt)=>{var Gt=bt=>{try{Ht(Ze.next(bt))}catch(Cn){Wt(Cn)}},nn=bt=>{try{Ht(Ze.throw(bt))}catch(Cn){Wt(Cn)}},Ht=bt=>bt.done?gt(bt.value):Promise.resolve(bt.value).then(Gt,nn);Ht((Ze=Ze.apply(Ue,Xe)).next())});const he=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],pe=(Ue,Xe)=>{var Ze=Ue,{problemset:gt,globalSetting:Wt,loading:Gt,dispatch:nn,onRef:Ht=()=>{},editData:bt}=Ze,Cn=le(Ze,["problemset","globalSetting","loading","dispatch","onRef","editData"]);const[kn,Jn]=(0,se.useState)(),[Fn,Nn]=(0,se.useState)(""),[_n,tr]=(0,se.useState)(!1),[Xn,In]=(0,se.useState)(5),zn=(0,Te.useParams)();(0,se.useEffect)(()=>{if(!(bt!=null&&bt.question_choices)){tr(!0);return}Nn(bt==null?void 0:bt.question_title),In(bt==null?void 0:bt.question_score),Jn(bt.standard_answer[0]+"")},[bt]),(0,se.useImperativeHandle)(Xe,()=>({onSave:cr,isEdit:_n}));const cr=()=>oe(void 0,null,function*(){if(!Fn)return Me.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(!kn)return Me.ZP.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),!1;const yn=[{choice_text:"\u6B63\u786E",is_answer:kn==="1"?1:0},{choice_text:"\u9519\u8BEF",is_answer:kn==="2"?2:0}];let hn;return bt.question_id?hn=yield(0,Ye.Kc)({id:bt.question_id,question_title:Fn,question_type:2,question_score:Xn,question_choices:yn.map(En=>En.choice_text),standard_answers:yn.filter(En=>En.is_answer).map(En=>En.is_answer)}):hn=yield(0,Ye.iV)({exercise_bank_id:zn.topicId,question_title:Fn,question_type:2,question_score:Xn,question_choices:yn.map(En=>En.choice_text),standard_answers:yn.filter(En=>En.is_answer).map(En=>En.is_answer)}),hn.status===0&&(Me.ZP.success("\u4FDD\u5B58\u6210\u529F"),tr(!1)),nn({type:"polls/getExerciseBanks",payload:ye({},zn)}),{name:Fn,choices:yn}}),qn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],br=yn=>oe(void 0,null,function*(){switch(yn.id){case"del":let hn;ot.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return oe(this,null,function*(){yield(0,Ye.x$)({pollsId:bt.question_id}),nn({type:"polls/getExerciseBanks",payload:ye({},zn)})})}});break;case"up":case"down":yield(0,Ye.W)({exerciseId:bt==null?void 0:bt.question_id,opr:yn.id}),nn({type:"polls/getExerciseBanks",payload:ye({},zn)});break;case"edit":tr(!0);break}}),Br=()=>{var yn;return se.createElement("aside",null,se.createElement("div",{className:$e.questionType},se.createElement("div",null,se.createElement("span",{className:"font16 c-blue"},bt.key,"\u3001\u5224\u65AD\u9898"),"\uFF08",bt.question_score,"\u5206\uFF09"),!bt.hideAction&&qn.map(function(hn,En){return hn.id==="up"&&bt.key===1||hn.id==="down"&&bt.key===bt.len?null:se.createElement(dt.Z,{key:En,placement:"bottom",title:hn.name},se.createElement("span",{onClick:()=>br(hn),className:hn.icon}))})),se.createElement("div",{className:"mt5"},bt.question_title),se.createElement("div",{className:$e.questionChoices},(yn=bt==null?void 0:bt.question_choices)==null?void 0:yn.map(function(hn,En){return se.createElement(Bt.ZP,{key:En,checked:bt.standard_answer.includes(En+1),disabled:!0},he[En],". ",se.createElement("span",{className:"c-black font14"},hn.choice_text))})))},rr=()=>se.createElement("aside",null,se.createElement("div",null,se.createElement("span",{className:"font16 c-blue"},"\u5224\u65AD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09"),se.createElement("p",{className:$e.titleWrap},se.createElement("span",{className:$e.required},"*"),se.createElement("span",{className:$e.title},"\u9898\u5E72\uFF1A")),se.createElement(it.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Fn,onChange:yn=>Nn(yn)}),se.createElement("p",{className:$e.titleWrap},se.createElement("span",{className:$e.required},"*"),se.createElement("span",{className:$e.title},"\u7B54\u6848\u9009\u9879\uFF1A",se.createElement("span",{className:$e.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),se.createElement(Bt.ZP.Group,{buttonStyle:"solid",value:kn,onChange:yn=>Jn(yn.target.value)},se.createElement(Bt.ZP.Button,{value:"1",className:`${$e.radio} mr40`},"\u6B63\u786E"),se.createElement(Bt.ZP.Button,{value:"2",className:$e.radio},"\u9519\u8BEF")),se.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\uFF0C\u53EF\u4EE5\u76F4\u63A5\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848"),se.createElement("p",{className:""},"\u5206\u503C\uFF1A",se.createElement(Ct.Z,{value:Xn,max:1e4,min:-1,onChange:yn=>{In(yn)}})," \u5206"),se.createElement("aside",{className:"tr"},bt.question_id&&se.createElement(Fe.ZP,{type:"default",onClick:()=>tr(!1)},"\u53D6\u6D88"),se.createElement(Fe.ZP,{className:"ml20",type:"primary",onClick:()=>cr()},"\u4FDD\u5B58")));return se.createElement("section",{className:$e.wrap},!_n&&Br(),_n&&rr())};var ce=(0,Te.connect)(({problemset:Ue,loading:Xe,globalSetting:Ze})=>({problemset:Ue,globalSetting:Ze,loading:Xe.effects}),null,null,{forwardRef:!0})((0,se.forwardRef)(pe)),Ie=ue(12132),yt=ue(61746),Pe=ue(25544),je=Object.defineProperty,Rt=Object.getOwnPropertySymbols,At=Object.prototype.hasOwnProperty,rt=Object.prototype.propertyIsEnumerable,Ft=(Ue,Xe,Ze)=>Xe in Ue?je(Ue,Xe,{enumerable:!0,configurable:!0,writable:!0,value:Ze}):Ue[Xe]=Ze,sn=(Ue,Xe)=>{for(var Ze in Xe||(Xe={}))At.call(Xe,Ze)&&Ft(Ue,Ze,Xe[Ze]);if(Rt)for(var Ze of Rt(Xe))rt.call(Xe,Ze)&&Ft(Ue,Ze,Xe[Ze]);return Ue},ct=(Ue,Xe)=>{var Ze={};for(var gt in Ue)At.call(Ue,gt)&&Xe.indexOf(gt)<0&&(Ze[gt]=Ue[gt]);if(Ue!=null&&Rt)for(var gt of Rt(Ue))Xe.indexOf(gt)<0&&rt.call(Ue,gt)&&(Ze[gt]=Ue[gt]);return Ze},qt=(Ue,Xe,Ze)=>new Promise((gt,Wt)=>{var Gt=bt=>{try{Ht(Ze.next(bt))}catch(Cn){Wt(Cn)}},nn=bt=>{try{Ht(Ze.throw(bt))}catch(Cn){Wt(Cn)}},Ht=bt=>bt.done?gt(bt.value):Promise.resolve(bt.value).then(Gt,nn);Ht((Ze=Ze.apply(Ue,Xe)).next())});const an=null,Qe=(Ue,Xe)=>{var Ze=Ue,{problemset:gt,globalSetting:Wt,loading:Gt,dispatch:nn,editData:Ht}=Ze,bt=ct(Ze,["problemset","globalSetting","loading","dispatch","editData"]);const[Cn,kn]=(0,se.useState)(""),[Jn,Fn]=(0,se.useState)(""),[Nn,_n]=(0,se.useState)([]),[tr,Xn]=(0,se.useState)(""),[In,zn]=(0,se.useState)(),[cr,qn]=(0,se.useState)(!1),[br,Br]=(0,se.useState)(5),[rr,yn]=(0,se.useState)(!1),hn=(0,Te.useParams)();(0,se.useEffect)(()=>{if(!(Ht!=null&&Ht.question_title)){yn(!0);return}kn(Ht==null?void 0:Ht.question_title),zn(Ht==null?void 0:Ht.is_ordered),Br(Ht==null?void 0:Ht.question_score);const Gn=Ht==null?void 0:Ht.standard_answer.map(sr=>sr.answer_text);_n(Gn)},[gt.editData]),(0,se.useEffect)(()=>{qn(!1)},[rr]),(0,se.useImperativeHandle)(Xe,()=>({onSave:En,isEdit:rr}));const En=()=>qt(void 0,null,function*(){let Gn=[],sr=!1;if(Nn.forEach((vi,ci)=>{Gn.push({choice_id:ci+1,answer_text:[]}),vi.forEach((qr,fi)=>{Gn[ci].answer_text.push(qr),(!qr||!(0,Pe.eR)(qr,1e4))&&(Xn(`${ci}-${fi}`),Me.ZP.info(qr?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),sr=!0)})}),sr)return!1;let Wr;return Ht.question_id?Wr=yield(0,Ye.Kc)({id:Ht.question_id,question_title:Cn,question_type:3,question_score:br,is_ordered:In,standard_answers:Gn}):Wr=yield(0,Ye.iV)({exercise_bank_id:hn.topicId,question_title:Cn,question_type:3,question_score:br,is_ordered:In,standard_answers:Gn}),Wr.status===0&&(Me.ZP.success("\u4FDD\u5B58\u6210\u529F"),yn(!1)),nn({type:"polls/getExerciseBanks",payload:sn({},hn)}),{name:Cn,analysis:Jn,standard_answers:Gn,is_ordered:In}}),Qn=(Gn,sr,Wr)=>{const vi=Nn.slice();if(sr&&vi.splice(Gn,sr),Wr&&cr)for(let ci=0;ci<Wr;ci++)vi.splice(Gn+ci,0,[""]);qn(!0),_n(vi)},Rn=(Gn,sr,Wr)=>{Xn("");let vi=Nn.slice();vi[Gn][sr]=Wr,_n(vi)},Mn=Gn=>{let sr=Nn.slice();sr[Gn]=[...sr[Gn],""],_n(sr)},er=(Gn,sr)=>{let Wr=Nn.slice();if(!Wr[Gn][sr]){Wr[Gn]=Wr[Gn].filter((vi,ci)=>ci!==sr),_n(Wr);return}ot.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:$e.modal,onOk:()=>{Wr[Gn]=Wr[Gn].filter((vi,ci)=>ci!==sr),_n(Wr)}})},vr=Gn=>{ot.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:$e.modal,onOk:()=>{let sr=Nn.slice();sr=Nn.filter((Wr,vi)=>Gn!==vi),_n(sr)}})},Dr=()=>se.createElement("aside",null,se.createElement("div",{className:$e.questionType},se.createElement("div",null,se.createElement("span",{className:"font16 c-blue"},"\u586B\u7A7A\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848 \uFF1B\u652F\u6301\u6700\u591A5\u4E2A\u7A7A\uFF0C\u6BCF\u7A7A\u5F97\u5206\u6309\u7167\u672C\u9898\u7684\u603B\u5206\u5E73\u5747\u8BA1\u7B97\uFF09")),se.createElement("div",null,se.createElement(Ie.Z,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:Cn,onChange:Gn=>kn(Gn),showNullButton:!0,onPlaceholderChange:Qn})),se.createElement("div",{className:"mt20"},Nn.map((Gn,sr)=>se.createElement(yt.Z,{key:sr,answers:Gn,index:sr,is_md:!0,activeOptionErrorIndex:tr,onAnswerChange:Rn,addChildAnswer:Mn,deleteChildAnswer:er,deleteChildAnswermain:vr}))),se.createElement("div",{className:"mt20"},Nn.length>1&&se.createElement("span",null,se.createElement(at.default,{checked:In,onChange:Gn=>zn(Gn.target.checked),className:`${$e.color333} font14`},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),se.createElement("span",{className:`${$e.color999} font12`},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),se.createElement("p",{className:""},"\u5206\u503C\uFF1A",se.createElement(Ct.Z,{value:br,max:1e4,min:-1,onChange:Gn=>{Br(Gn)}})," \u5206"),se.createElement("aside",{className:"tr"},Ht.question_id&&se.createElement(Fe.ZP,{type:"default",onClick:()=>yn(!1)},"\u53D6\u6D88"),se.createElement(Fe.ZP,{className:"ml20",type:"primary",onClick:()=>En()},"\u4FDD\u5B58"))),ei=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],$n=Gn=>qt(void 0,null,function*(){switch(Gn.id){case"del":let sr;ot.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return qt(this,null,function*(){yield(0,Ye.x$)({pollsId:Ht.question_id}),nn({type:"polls/getExerciseBanks",payload:sn({},hn)})})}});break;case"up":case"down":yield(0,Ye.W)({exerciseId:Ht==null?void 0:Ht.question_id,opr:Gn.id}),nn({type:"polls/getExerciseBanks",payload:sn({},hn)});break;case"edit":yn(!0);break}}),Kn=()=>{var Gn;return se.createElement("aside",null,se.createElement("div",{className:$e.questionType},se.createElement("div",null,se.createElement("span",{className:"font16 c-blue"},Ht.key,"\u3001\u586B\u7A7A\u9898"),"\uFF08",Ht.question_score,"\u5206\uFF09"),!Ht.hideAction&&ei.map(function(sr,Wr){return sr.id==="up"&&Ht.key===1||sr.id==="down"&&Ht.key===Ht.len?null:se.createElement(dt.Z,{key:Wr,placement:"bottom",title:sr.name},se.createElement("span",{onClick:()=>$n(sr),className:sr.icon}))})),se.createElement("div",{className:"mt5"},Ht.question_title),se.createElement("div",{className:$e.questionChoices},(Gn=Ht==null?void 0:Ht.standard_answer)==null?void 0:Gn.map(function(sr,Wr){return se.createElement(_e.Z,null,se.createElement(Re.Z,null,"\u7B54\u6848\uFF08\u586B\u7A7A",sr.choice_id,"\uFF09\uFF1A"),se.createElement(Re.Z,{flex:"1"},se.createElement(Ae.default,{key:Wr,checked:Ht.standard_answer.includes(Wr),disabled:!0,value:sr.answer_text})))})))};return se.createElement("section",{className:$e.wrap},!rr&&Kn(),rr&&Dr())};var mt=(0,Te.connect)(({problemset:Ue,loading:Xe,globalSetting:Ze})=>({problemset:Ue,globalSetting:Ze,loading:Xe.effects}),null,null,{forwardRef:!0})((0,se.forwardRef)(Qe)),Nt=Object.defineProperty,vn=Object.getOwnPropertySymbols,mn=Object.prototype.hasOwnProperty,wn=Object.prototype.propertyIsEnumerable,Tn=(Ue,Xe,Ze)=>Xe in Ue?Nt(Ue,Xe,{enumerable:!0,configurable:!0,writable:!0,value:Ze}):Ue[Xe]=Ze,Zn=(Ue,Xe)=>{for(var Ze in Xe||(Xe={}))mn.call(Xe,Ze)&&Tn(Ue,Ze,Xe[Ze]);if(vn)for(var Ze of vn(Xe))wn.call(Xe,Ze)&&Tn(Ue,Ze,Xe[Ze]);return Ue},Hn=(Ue,Xe)=>{var Ze={};for(var gt in Ue)mn.call(Ue,gt)&&Xe.indexOf(gt)<0&&(Ze[gt]=Ue[gt]);if(Ue!=null&&vn)for(var gt of vn(Ue))Xe.indexOf(gt)<0&&wn.call(Ue,gt)&&(Ze[gt]=Ue[gt]);return Ze},wr=(Ue,Xe,Ze)=>new Promise((gt,Wt)=>{var Gt=bt=>{try{Ht(Ze.next(bt))}catch(Cn){Wt(Cn)}},nn=bt=>{try{Ht(Ze.throw(bt))}catch(Cn){Wt(Cn)}},Ht=bt=>bt.done?gt(bt.value):Promise.resolve(bt.value).then(Gt,nn);Ht((Ze=Ze.apply(Ue,Xe)).next())});const Cr=null,Yn=(Ue,Xe)=>{var Ze=Ue,{problemset:gt,globalSetting:Wt,loading:Gt,dispatch:nn,onRef:Ht=()=>{},editData:bt}=Ze,Cn=Hn(Ze,["problemset","globalSetting","loading","dispatch","onRef","editData"]);const[kn,Jn]=(0,se.useState)(""),[Fn,Nn]=(0,se.useState)(""),[_n,tr]=(0,se.useState)(""),[Xn,In]=(0,se.useState)(5),[zn,cr]=(0,se.useState)(!1),qn=(0,Te.useParams)();(0,se.useEffect)(()=>{var En;if(!(bt!=null&&bt.question_title)){cr(!0);return}Jn(bt==null?void 0:bt.question_title),tr((En=bt==null?void 0:bt.standard_answer)==null?void 0:En[0]),In(bt==null?void 0:bt.question_score)},[gt.editData]),(0,se.useImperativeHandle)(Xe,()=>({onSave:br,isEdit:zn}));const br=()=>wr(void 0,null,function*(){if(!kn)return Me.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;let En;return bt.question_id?En=yield(0,Ye.Kc)({id:bt.question_id,question_title:kn,question_type:4,question_score:Xn,standard_answers:[_n]}):En=yield(0,Ye.iV)({exercise_bank_id:qn.topicId,question_title:kn,question_type:4,question_score:Xn,standard_answers:[_n]}),En.status===0&&(Me.ZP.success("\u4FDD\u5B58\u6210\u529F"),cr(!1),nn({type:"polls/getExerciseBanks",payload:Zn({},qn)})),{name:kn,answer_texts:[_n],analysis:Fn}}),Br=()=>se.createElement("aside",null,se.createElement("div",{className:$e.questionType},se.createElement("div",null,se.createElement("span",{className:"font16 c-blue"},"\u7B80\u7B54\u9898"),"\uFF08\u4E3B\u89C2\u9898\uFF0C\u672A\u4F5C\u7B54\u7684\u60C5\u51B5\u4E0B\u81EA\u52A8\u8BC4\u4E3A\u96F6\u5206\uFF09")),se.createElement(it.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:kn,onChange:En=>Jn(En)}),se.createElement("p",{className:$e.titleWrap},se.createElement("span",{className:$e.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),se.createElement(it.Z,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:_n,onChange:En=>tr(En)}),se.createElement("p",{className:""},"\u5206\u503C\uFF1A",se.createElement(Ct.Z,{value:Xn,max:1e4,min:-1,onChange:En=>{In(En)}})," \u5206"),se.createElement("aside",{className:"tr"},bt.question_id&&se.createElement(Fe.ZP,{type:"default",onClick:()=>cr(!1)},"\u53D6\u6D88"),se.createElement(Fe.ZP,{className:"ml20",type:"primary",onClick:()=>br()},"\u4FDD\u5B58"))),rr=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],yn=En=>wr(void 0,null,function*(){switch(En.id){case"del":let Qn;ot.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return wr(this,null,function*(){yield(0,Ye.x$)({pollsId:bt.question_id}),nn({type:"polls/getExerciseBanks",payload:Zn({},qn)})})}});break;case"up":case"down":yield(0,Ye.W)({exerciseId:bt==null?void 0:bt.question_id,opr:En.id}),nn({type:"polls/getExerciseBanks",payload:Zn({},qn)});break;case"edit":cr(!0);break}}),hn=()=>se.createElement("aside",null,se.createElement("div",{className:$e.questionType},se.createElement("div",null,se.createElement("span",{className:"font16 c-blue"},bt.key,"\u3001\u7B80\u7B54\u9898"),"\uFF08",bt.question_score,"\u5206\uFF09"),!bt.hideAction&&rr.map(function(En,Qn){return En.id==="up"&&bt.key===1||En.id==="down"&&bt.key===bt.len?null:se.createElement(dt.Z,{key:Qn,placement:"bottom",title:En.name},se.createElement("span",{onClick:()=>yn(En),className:En.icon}))})),se.createElement("div",{className:"mt5"},bt.question_title),se.createElement("div",{className:$e.questionChoices},se.createElement("p",null,se.createElement("strong",null,"\u53C2\u8003\u7B54\u6848\uFF1A")),se.createElement(vt.Z,{value:_n})));return se.createElement("section",{className:$e.wrap},!zn&&hn(),zn&&Br())};var Nr=(0,Te.connect)(({problemset:Ue,loading:Xe,globalSetting:Ze})=>({problemset:Ue,globalSetting:Ze,loading:Xe.effects}),null,null,{forwardRef:!0})((0,se.forwardRef)(Yn)),Kr=Object.defineProperty,Or=Object.getOwnPropertySymbols,Ar=Object.prototype.hasOwnProperty,kr=Object.prototype.propertyIsEnumerable,Gr=(Ue,Xe,Ze)=>Xe in Ue?Kr(Ue,Xe,{enumerable:!0,configurable:!0,writable:!0,value:Ze}):Ue[Xe]=Ze,ar=(Ue,Xe)=>{for(var Ze in Xe||(Xe={}))Ar.call(Xe,Ze)&&Gr(Ue,Ze,Xe[Ze]);if(Or)for(var Ze of Or(Xe))kr.call(Xe,Ze)&&Gr(Ue,Ze,Xe[Ze]);return Ue},$r=(Ue,Xe)=>{var Ze={};for(var gt in Ue)Ar.call(Ue,gt)&&Xe.indexOf(gt)<0&&(Ze[gt]=Ue[gt]);if(Ue!=null&&Or)for(var gt of Or(Ue))Xe.indexOf(gt)<0&&kr.call(Ue,gt)&&(Ze[gt]=Ue[gt]);return Ze},Ur=(Ue,Xe,Ze)=>new Promise((gt,Wt)=>{var Gt=bt=>{try{Ht(Ze.next(bt))}catch(Cn){Wt(Cn)}},nn=bt=>{try{Ht(Ze.throw(bt))}catch(Cn){Wt(Cn)}},Ht=bt=>bt.done?gt(bt.value):Promise.resolve(bt.value).then(Gt,nn);Ht((Ze=Ze.apply(Ue,Xe)).next())});const Vr=null,Yr=(Ue,Xe)=>{var Ze=Ue,{problemset:gt,globalSetting:Wt,loading:Gt,dispatch:nn,editData:Ht}=Ze,bt=$r(Ze,["problemset","globalSetting","loading","dispatch","editData"]);const[Cn,kn]=(0,se.useState)(""),[Jn,Fn]=(0,se.useState)(""),[Nn,_n]=(0,se.useState)(""),[tr,Xn]=(0,se.useState)([]),[In,zn]=(0,se.useState)(""),[cr,qn]=(0,se.useState)(),[br,Br]=(0,se.useState)(!1),[rr,yn]=(0,se.useState)([]),[hn,En]=(0,se.useState)(!1),Qn=(0,Te.useParams)();(0,se.useEffect)(()=>{var ei;Ht.edit&&En(!0),kn(Ht.shixun_name),Fn(Ht.question_title);const $n=[];(ei=Ht.shixun)==null||ei.map(Kn=>{$n.push(Kn.challenge_score)}),yn($n)},[Ht]),(0,se.useEffect)(()=>{Br(!1)},[hn]),(0,se.useImperativeHandle)(Xe,()=>({onSave:Rn,isEdit:hn}));const Rn=()=>Ur(void 0,null,function*(){let ei=[];if(!1)return!1;let Kn;return Ht.question_id?Kn=yield(0,Ye.Kc)({id:Ht.question_id,question_title:Jn,shixun_name:Cn,shixun_id:Ht.shixun_id,question_type:5,question_scores:rr}):Kn=yield(0,Ye.iV)({exercise_bank_id:Qn.topicId,question_title:Jn,shixun_name:Cn,shixun_id:Ht.shixun_id,question_type:5,question_scores:rr}),Kn.status===0&&(Me.ZP.success("\u4FDD\u5B58\u6210\u529F"),En(!1)),yield nn({type:"polls/getExerciseBanks",payload:ar({},Qn)}),{name:Jn,analysis:Nn,standard_answers:ei,is_ordered:cr}}),Mn=()=>{var ei;return se.createElement("aside",null,se.createElement("div",{className:$e.questionType},se.createElement("div",null,se.createElement("span",{className:"font16 c-blue"},"\u5B9E\u8BAD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF09")),se.createElement("div",{className:"mt10"},se.createElement(Ae.default,{defaultValue:Cn,onChange:$n=>{kn($n.target.value)}})),se.createElement("div",{className:"mt10"},se.createElement(it.Z,{id:"single-question-option-0",height:155,placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8BAD\u9898\u5B8C\u6210\u8981\u6C42",defaultValue:Jn,onChange:$n=>{Fn($n)}})),se.createElement("div",{className:"mt20"},(ei=Ht.shixun)==null?void 0:ei.map(($n,Kn)=>se.createElement(_e.Z,{gutter:[20,20]},se.createElement(Re.Z,{flex:"1"},Kn+1,".",$n.challenge_name),se.createElement(Re.Z,null,se.createElement(Ct.Z,{defaultValue:rr[Kn],onChange:Gn=>{rr[Kn]=Gn,yn(rr),console.log("srore:L",rr[Kn])}}))))),se.createElement("div",{className:"mt20"},tr.length>1&&se.createElement("span",null,se.createElement(at.default,{checked:cr,onChange:$n=>qn($n.target.checked),className:`${$e.color333} font14`},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),se.createElement("span",{className:`${$e.color999} font12`},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),se.createElement("aside",{className:"tr"},!(Ht!=null&&Ht.edit)&&se.createElement(Fe.ZP,{type:"default",onClick:()=>En(!1)},"\u53D6\u6D88"),se.createElement(Fe.ZP,{className:"ml20",type:"primary",onClick:()=>Rn()},"\u4FDD\u5B58")))},er=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],vr=ei=>Ur(void 0,null,function*(){switch(ei.id){case"del":let $n;ot.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return Ur(this,null,function*(){yield(0,Ye.x$)({pollsId:Ht.question_id}),nn({type:"polls/getExerciseBanks",payload:ar({},Qn)})})}});break;case"up":case"down":yield(0,Ye.W)({exerciseId:Ht==null?void 0:Ht.question_id,opr:ei.id}),nn({type:"polls/getExerciseBanks",payload:ar({},Qn)});break;case"edit":En(!0);break}}),Dr=()=>{var ei;return se.createElement("aside",null,se.createElement("div",{className:$e.questionType},se.createElement("div",null,se.createElement("span",{className:"font16 c-blue"},Ht.key,"\u3001\u5B9E\u8BAD\u9898"),"\uFF08",Ht.question_score,"\u5206\uFF09"),se.createElement("div",{className:"tr"},se.createElement(Te.Link,{target:"_blank",to:`/shixuns/${Ht.shixun_identifier}/challenges`},"\u5B9E\u8BAD\u8BE6\u60C5"),!Ht.hideAction&&er.map(function($n,Kn){return $n.id==="up"&&Ht.key===1||$n.id==="down"&&Ht.key===Ht.len?null:se.createElement(dt.Z,{key:Kn,placement:"bottom",title:$n.name},se.createElement("span",{onClick:()=>vr($n),className:$n.icon}))}))),se.createElement("div",{className:"font16"},Ht.shixun_name),se.createElement("div",{className:"mt30"}),(ei=Ht.shixun)==null?void 0:ei.map(function($n,Kn){return se.createElement("div",{key:Kn},"\u7B2C",Kn+1,"\u5173 ",se.createElement("span",{className:"ml10"},$n.challenge_name)," ",se.createElement("span",{className:"ml10"},$n.challenge_score))}))};return se.createElement("section",{className:$e.wrap},!hn&&Dr(),hn&&Mn())};var Zr=(0,Te.connect)(({problemset:Ue,loading:Xe,globalSetting:Ze})=>({problemset:Ue,globalSetting:Ze,loading:Xe.effects}),null,null,{forwardRef:!0})((0,se.forwardRef)(Yr)),dr=ue(43428),_r=ue(58421),Ln={flex_box_center:"flex_box_center___hUmFx",flex_space_between:"flex_space_between___ZQWRF",flex_box_vertical_center:"flex_box_vertical_center___NvFWH",flex_box_center_end:"flex_box_center_end___VzfH9",flex_box_column:"flex_box_column___jzLHY",wrp:"wrp___tA5YW",drawer:"drawer___aMsAr",menu:"menu___EdF6h",actived:"actived___rUgO6",actived2:"actived2___ENpPA",listItem:"listItem___Ixzli",info:"info___KHkuz",title:"title___pDJPn",titleLeft:"titleLeft___UBBKz",titleRight:"titleRight___WrCz9",search:"search___AEwRm",description:"description___CYPQc",menuCourse:"menuCourse___gwZ0E"},Wn=Object.defineProperty,Er=Object.getOwnPropertySymbols,St=Object.prototype.hasOwnProperty,Le=Object.prototype.propertyIsEnumerable,We=(Ue,Xe,Ze)=>Xe in Ue?Wn(Ue,Xe,{enumerable:!0,configurable:!0,writable:!0,value:Ze}):Ue[Xe]=Ze,Be=(Ue,Xe)=>{for(var Ze in Xe||(Xe={}))St.call(Xe,Ze)&&We(Ue,Ze,Xe[Ze]);if(Er)for(var Ze of Er(Xe))Le.call(Xe,Ze)&&We(Ue,Ze,Xe[Ze]);return Ue},Oe=(Ue,Xe,Ze)=>new Promise((gt,Wt)=>{var Gt=bt=>{try{Ht(Ze.next(bt))}catch(Cn){Wt(Cn)}},nn=bt=>{try{Ht(Ze.throw(bt))}catch(Cn){Wt(Cn)}},Ht=bt=>bt.done?gt(bt.value):Promise.resolve(bt.value).then(Gt,nn);Ht((Ze=Ze.apply(Ue,Xe)).next())});const{Search:lt}=Ae.default,_t=[{id:"type",name:"\u7B5B\u9009",children:[{name:"\u5168\u90E8\u5B9E\u8BAD",id:"all",type:"type"},{name:"\u6211\u7684\u5B9E\u8BAD",id:"mine",type:"type"}]},{id:"diff",name:"\u96BE\u5EA6",children:[{name:"\u5168\u90E8",id:"",type:"diff"},{name:"\u521D\u7EA7",id:1,type:"diff"},{name:"\u4E2D\u7EA7",id:2,type:"diff"},{name:"\u4E2D\u9AD8\u7EA7",id:3,type:"diff"},{name:"\u9AD8\u7EA7",id:4,type:"diff"}]}],Yt=({classroomList:Ue,loading:Xe,dispatch:Ze,callback:gt})=>{var Wt;const Gt=(0,Te.useParams)(),nn=(0,Te.useLocation)(),{actionTabs:Ht}=Ue,[bt]=xe.default.useForm(),{shixunLists:Cn}=Ue,[kn,Jn]=(0,se.useState)([]),[Fn,Nn]=(0,se.useState)({page:1,type:"all",diff:"",status:"published",order:"desc",limit:20,sort:"publish_time",no_jupyter:1});return(0,se.useEffect)(()=>{Ze({type:"classroomList/getShixunLists",payload:Be({},Fn)})},[Gt.categoryId]),(0,se.useEffect)(()=>{Jn([])},[Ue.actionTabs.key]),Ue.actionTabs.key!=="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?null:se.createElement(dr.Z,{title:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",placement:"bottom",height:"100%",closable:!1,open:Ue.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",key:"bottom",rootClassName:Ln.drawer,footer:se.createElement("div",{className:"tc"},se.createElement(Fe.ZP,{size:"middle",onClick:()=>{Ze({type:"classroomList/setActionTabs",payload:{key:""}})},style:{marginRight:8}},"\u53D6\u6D88"),se.createElement(Fe.ZP,{size:"middle",onClick:()=>Oe(void 0,null,function*(){var _n;kn.length>1?Me.ZP.error("\u53EA\u80FD\u9009\u62E9\u4E00\u4E2A\u5B9E\u8DF5\u9879\u76EE"):kn.length===0?Me.ZP.error("\u8BF7\u9009\u62E9\u5B9E\u8DF5\u9879\u76EE"):(gt&&gt((_n=Cn==null?void 0:Cn.shixun_list)==null?void 0:_n.filter(tr=>tr.id===kn[0])[0]),Ze({type:"classroomList/setActionTabs",payload:{key:""}}))}),type:"primary"},"\u786E\u5B9A"))},se.createElement("section",{className:"tc"},se.createElement(lt,{placeholder:"\u5B9E\u8BAD\u4FE1\u606F/\u9662\u6821\u540D\u79F0/\u521B\u5EFA\u8005",enterButton:"\u641C\u7D22",size:"middle",className:Ln.search,onSearch:_n=>{Fn.keyword=_n,Ze({type:"classroomList/getShixunLists",payload:Be({},Fn)})}})),se.createElement("section",{className:"edu-container"},_t.map(function(_n,tr){var Xn;return se.createElement("ul",{className:Ln.menu,key:tr},se.createElement("li",null,_n.name),(Xn=_n==null?void 0:_n.children)==null?void 0:Xn.map(function(In,zn){return se.createElement("li",{key:zn,className:Fn[_n.id]==In.id?Ln.actived:"",onClick:()=>{Fn[_n.id]=In.id,Nn(Be({},Fn)),Ze({type:"classroomList/getShixunLists",payload:Be({},Fn)})}},se.createElement("strong",null,In.name))}))}),(Wt=Cn==null?void 0:Cn.shixun_list)==null?void 0:Wt.map(function(_n,tr){return se.createElement("div",{className:Ln.listItem,key:tr},se.createElement(at.default,{checked:kn.includes(_n.id),value:_n.id,onChange:Xn=>{let In=kn.indexOf(_n.id);kn.indexOf(_n.id)>-1?Jn(kn.filter(zn=>zn!==_n.id)):Jn(kn.concat(_n.id))}}),se.createElement("div",{className:Ln.info},se.createElement("div",{className:Ln.title},se.createElement("div",{className:Ln.titleLeft},se.createElement("strong",{className:"font16",dangerouslySetInnerHTML:{__html:_n.title}}))),se.createElement("div",{className:"flex-wrp mt10 font14 c-light-black"},se.createElement("span",{className:Ln.description,dangerouslySetInnerHTML:{__html:_n.description}})),se.createElement("div",{className:" mt15"},_n.challenge_names.map(function(Xn,In){return se.createElement("span",{key:In,className:"mr30"},"\u7B2C",In+1,"\u5173 ",Xn," ")})),se.createElement(De.Z,{dashed:!0}),se.createElement("div",{className:"c-light-black mt20"},se.createElement("span",null,_n.author_name),se.createElement("span",{className:"ml15 mr15"},"|"),se.createElement("span",null,_n.author_school_name),se.createElement("span",{className:"ml15 mr15"},"|"),se.createElement("span",null,"\u96BE\u5EA6\u7CFB\u6570:",_n.level),se.createElement("span",{className:"ml15 mr15"},"|"),se.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570:"),se.createElement("span",null,_n.study_count))))}),se.createElement("p",null)),se.createElement("div",{className:"tc"},se.createElement(_r.Z,{defaultCurrent:1,hideOnSinglePage:!0,defaultPageSize:20,showQuickJumper:!0,total:Cn==null?void 0:Cn.shixuns_count,onChange:_n=>{Fn.page=_n,Jn([]),Ze({type:"classroomList/getShixunLists",payload:Be({},Fn)})}})))};var Kt=(0,Te.connect)(({classroomList:Ue,loading:Xe})=>({classroomList:Ue,loading:Xe}))(Yt),Jt={flex_box_center:"flex_box_center___SQWFF",flex_space_between:"flex_space_between___CnFKV",flex_box_vertical_center:"flex_box_vertical_center___pIPP9",flex_box_center_end:"flex_box_center_end___wiYA8",flex_box_column:"flex_box_column___elCPc",bg:"bg___EaPuT",containerTitle:"containerTitle___ixpkx",containerDesc:"containerDesc___r2R0u",listItem:"listItem___jvD98",info:"info___dCwGz",title:"title___UW6TT",titleLeft:"titleLeft___MquHc",titleRight:"titleRight___aWhE3",acitons:"acitons___yle7y"},un=Object.defineProperty,fn=Object.getOwnPropertySymbols,xn=Object.prototype.hasOwnProperty,zt=Object.prototype.propertyIsEnumerable,ln=(Ue,Xe,Ze)=>Xe in Ue?un(Ue,Xe,{enumerable:!0,configurable:!0,writable:!0,value:Ze}):Ue[Xe]=Ze,jn=(Ue,Xe)=>{for(var Ze in Xe||(Xe={}))xn.call(Xe,Ze)&&ln(Ue,Ze,Xe[Ze]);if(fn)for(var Ze of fn(Xe))zt.call(Xe,Ze)&&ln(Ue,Ze,Xe[Ze]);return Ue},Dn=(Ue,Xe)=>{var Ze={};for(var gt in Ue)xn.call(Ue,gt)&&Xe.indexOf(gt)<0&&(Ze[gt]=Ue[gt]);if(Ue!=null&&fn)for(var gt of fn(Ue))Xe.indexOf(gt)<0&&zt.call(Ue,gt)&&(Ze[gt]=Ue[gt]);return Ze},Vn=(Ue,Xe,Ze)=>new Promise((gt,Wt)=>{var Gt=bt=>{try{Ht(Ze.next(bt))}catch(Cn){Wt(Cn)}},nn=bt=>{try{Ht(Ze.throw(bt))}catch(Cn){Wt(Cn)}},Ht=bt=>bt.done?gt(bt.value):Promise.resolve(bt.value).then(Gt,nn);Ht((Ze=Ze.apply(Ue,Xe)).next())});const{SubMenu:Pn}=ze.default,{Content:yr,Sider:Sn}=ut.default,pr=Ue=>{var Xe=Ue,{polls:Ze,globalSetting:gt,loading:Wt,user:Gt,dispatch:nn}=Xe,Ht=Dn(Xe,["polls","globalSetting","loading","user","dispatch"]),bt,Cn,kn,Jn,Fn,Nn,_n,tr,Xn,In,zn,cr,qn,br,Br,rr,yn,hn,En,Qn,Rn,Mn,er,vr,Dr,ei,$n,Kn,Gn,sr,Wr,vi,ci,qr,fi,mi,lr,or,ir,mr,ri,pi,yi,gi,si,wi,Hi,Di,aa,Ui,Pi,Pa,da,oa,Xi,Si;const Tr=(0,Te.useParams)(),ti=(0,Te.useLocation)(),{userInfo:Hr}=Gt,[Ir]=xe.default.useForm(),[ni,ii]=(0,se.useState)([]),[Bi,Oi]=(0,se.useState)(!1),Fi=[{name:"\u9009\u62E9\u9898",id:0},{name:"\u5224\u65AD\u9898",id:2},{name:"\u586B\u7A7A\u9898",id:3},{name:"\u7B80\u7B54\u9898",id:4},{name:"\u5B9E\u8BAD\u9898",id:5}],zi=(0,se.useRef)();(0,se.useEffect)(()=>{var ai,Mi,Ti,Mo,Fa,za;(ai=Ze.exerciseBanks)!=null&&ai.exercise_questions&&(ii([...(Mi=Ze.exerciseBanks)==null?void 0:Mi.exercise_questions]),Ir.setFieldsValue({exercise_name:(Mo=(Ti=Ze.exerciseBanks)==null?void 0:Ti.exercise)==null?void 0:Mo.exercise_name,exercise_description:(za=(Fa=Ze.exerciseBanks)==null?void 0:Fa.exercise)==null?void 0:za.exercise_description}))},[Ze.exerciseBanks]),(0,se.useEffect)(()=>{nn({type:"polls/getExerciseBanks",payload:jn({},Tr)})},[Tr.categoryId]);const hi=()=>Vn(void 0,null,function*(){var ai,Mi;yield Ir.validateFields();const Ti=Ir.getFieldValue();Ti.is_md=!0,Ti.topicId=(Mi=(ai=Ze.exerciseBanks)==null?void 0:ai.exercise)==null?void 0:Mi.id,Oi(!1),yield(0,Ye.hO)(jn({},Ti)),nn({type:"polls/getExerciseBanks",payload:jn({},Tr)})}),ui=ai=>Vn(void 0,null,function*(){const Mi=yield zi==null?void 0:zi.current;if(Mi!=null&&Mi.isEdit){Me.ZP.error("\u4E0D\u80FD\u540C\u65F6\u7F16\u8F91\u4E24\u9898");return}ai===5?nn({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}}):ii([...ni,{question_type:ai}])}),Zi=function(){return ni==null?void 0:ni.map(function(ai,Mi){if(ai.key=Mi+1,ai.len=ni.length,ai.question_type===0)return se.createElement("aside",null,se.createElement(dn,{ref:zi,editData:ai}),se.createElement(De.Z,null));if(ai.question_type===1)return se.createElement("aside",null,se.createElement(pt,{ref:zi,editData:ai}),se.createElement(De.Z,null));if(ai.question_type===2)return se.createElement("aside",null,se.createElement(ce,{ref:zi,editData:ai}),se.createElement(De.Z,null));if(ai.question_type===3)return se.createElement("aside",null,se.createElement(mt,{editData:ai}),se.createElement(De.Z,null));if(ai.question_type===4)return se.createElement("aside",null,se.createElement(Nr,{editData:ai}),se.createElement(De.Z,null));if(ai.question_type===5)return se.createElement("aside",null,se.createElement(Zr,{editData:ai}),se.createElement(De.Z,null))})};return se.createElement("section",{className:"edu-container"},se.createElement("section",{className:"animated fadeIn"},se.createElement("aside",{className:"mt10"},Hr&&se.createElement(we.Z,{separator:">"},se.createElement(we.Z.Item,null,se.createElement(Te.Link,{to:`/users/${Hr.login}/topics/personal`},"\u6211\u7684\u9898\u5E93")),se.createElement(we.Z.Item,null,se.createElement(Te.Link,{to:`/users/${Hr==null?void 0:Hr.login}/topics/${Tr.topicId}/${Tr.topictype}/exercise/detail`},"\u8BE6\u60C5")),se.createElement(we.Z.Item,null,"\u7F16\u8F91"))),se.createElement("aside",{className:[Jt.title,"mt20"].join(" ")},se.createElement(_e.Z,{style:{width:"100%"},align:"middle"},se.createElement(Re.Z,{flex:"1"},se.createElement("strong",{className:"font20 ml5"},"\u7F16\u8F91\u8BD5\u5377"),se.createElement(Pe.VV,{status:[(Cn=(bt=Ze.exerciseBanks)==null?void 0:bt.exercise)!=null&&Cn.is_public?"\u516C\u5F00":"\u79C1\u6709"]})),se.createElement(Re.Z,null,se.createElement(Te.Link,{className:"font16 c-light-black",to:`/users/${Hr.login}/topics/personal`},"\u8FD4\u56DE"))))),se.createElement("section",{className:[Jt.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},!Bi&&se.createElement("aside",null,se.createElement("div",{className:Jt.containerDesc},se.createElement("div",null,(Jn=(kn=Ze.exerciseBanks)==null?void 0:kn.exercise)==null?void 0:Jn.exercise_name),se.createElement("div",null,se.createElement(dt.Z,{title:"\u7F16\u8F91"},se.createElement("span",{onClick:()=>Oi(!0),className:"iconfont c-green ml30 icon-bianjishijuan3x"})))),se.createElement("div",{className:"c-light-black"},(Nn=(Fn=Ze.exerciseBanks)==null?void 0:Fn.exercise)==null?void 0:Nn.exercise_description)),Bi&&se.createElement(xe.default,{layout:"vertical",form:Ir},se.createElement(xe.default.Item,{name:"exercise_name",label:"\u8BD5\u5377\u6807\u9898\uFF1A",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BD5\u5377\u6807\u9898"}]},se.createElement(Ae.default,{maxLength:60,placeholder:"\u8BD5\u5377\u6807\u9898\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"})),se.createElement(xe.default.Item,{label:"\u8BD5\u5377\u987B\u77E5\uFF1A",name:"exercise_description"},se.createElement(Ae.default.TextArea,{rows:6,placeholder:"\u8BF7\u5728\u6B64\u8F93\u5165\u672C\u6B21\u8BD5\u5377\u7B54\u9898\u7684\u76F8\u5173\u8BF4\u660E\uFF0C\u6700\u5927\u9650\u5236100\u4E2A\u5B57\u7B26"})),se.createElement(xe.default.Item,{className:"tr"},se.createElement(Fe.ZP,{type:"primary",onClick:()=>{hi()}},"\u4FDD\u5B58")))),se.createElement("p",{className:"mt10",style:{display:"flex"}},se.createElement("span",{className:"fl",style:{flex:"1"}},!!((tr=(_n=Ze.exerciseBanks)==null?void 0:_n.exercise_types)!=null&&tr.q_singles)&&se.createElement("span",{className:"ml20"},"\u5355\u9009\u9898",(In=(Xn=Ze.exerciseBanks)==null?void 0:Xn.exercise_types)==null?void 0:In.q_singles,"\u9898\uFF0C\u5171",(cr=(zn=Ze.exerciseBanks)==null?void 0:zn.exercise_types)==null?void 0:cr.q_singles_scores,"\u5206"),!!((br=(qn=Ze.exerciseBanks)==null?void 0:qn.exercise_types)!=null&&br.q_doubles)&&se.createElement("span",{className:"ml20"},"\u591A\u9009\u9898",(rr=(Br=Ze.exerciseBanks)==null?void 0:Br.exercise_types)==null?void 0:rr.q_doubles,"\u9898\uFF0C\u5171",(hn=(yn=Ze.exerciseBanks)==null?void 0:yn.exercise_types)==null?void 0:hn.q_doubles_scores,"\u5206"),!!((Qn=(En=Ze.exerciseBanks)==null?void 0:En.exercise_types)!=null&&Qn.q_judges)&&se.createElement("span",{className:"ml20"},"\u5224\u65AD\u9898",(Mn=(Rn=Ze.exerciseBanks)==null?void 0:Rn.exercise_types)==null?void 0:Mn.q_judges,"\u9898\uFF0C\u5171",(vr=(er=Ze.exerciseBanks)==null?void 0:er.exercise_types)==null?void 0:vr.q_judges_scores,"\u5206"),!!((ei=(Dr=Ze.exerciseBanks)==null?void 0:Dr.exercise_types)!=null&&ei.q_nulls)&&se.createElement("span",{className:"ml20"},"\u586B\u7A7A\u9898",(Kn=($n=Ze.exerciseBanks)==null?void 0:$n.exercise_types)==null?void 0:Kn.q_nulls,"\u9898\uFF0C\u5171",(sr=(Gn=Ze.exerciseBanks)==null?void 0:Gn.exercise_types)==null?void 0:sr.q_nulls_scores,"\u5206"),!!((vi=(Wr=Ze.exerciseBanks)==null?void 0:Wr.exercise_types)!=null&&vi.q_mains)&&se.createElement("span",{className:"ml20"},"\u7B80\u7B54\u9898",(qr=(ci=Ze.exerciseBanks)==null?void 0:ci.exercise_types)==null?void 0:qr.q_mains,"\u9898\uFF0C\u5171",(mi=(fi=Ze.exerciseBanks)==null?void 0:fi.exercise_types)==null?void 0:mi.q_mains_scores,"\u5206"),!!((or=(lr=Ze.exerciseBanks)==null?void 0:lr.exercise_types)!=null&&or.q_shixuns)&&se.createElement("span",{className:"ml20"},"\u5B9E\u8BAD\u9898",(mr=(ir=Ze.exerciseBanks)==null?void 0:ir.exercise_types)==null?void 0:mr.q_shixuns,"\u9898\uFF0C\u5171",(pi=(ri=Ze.exerciseBanks)==null?void 0:ri.exercise_types)==null?void 0:pi.q_shixuns_scores,"\u5206"),!!((gi=(yi=Ze.exerciseBanks)==null?void 0:yi.exercise_types)!=null&&gi.q_pros)&&se.createElement("span",{className:"ml20"},"\u7F16\u7A0B\u9898",(wi=(si=Ze.exerciseBanks)==null?void 0:si.exercise_types)==null?void 0:wi.q_pros,"\u9898\uFF0C\u5171",(Di=(Hi=Ze.exerciseBanks)==null?void 0:Hi.exercise_types)==null?void 0:Di.q_pros_scores,"\u5206")),se.createElement("span",{className:"fr"},!!((Ui=(aa=Ze.exerciseBanks)==null?void 0:aa.exercise_types)!=null&&Ui.q_counts)&&se.createElement("span",null,"\u5408\u8BA1 ",se.createElement("span",{className:"color-blue"},(Pa=(Pi=Ze.exerciseBanks)==null?void 0:Pi.exercise_types)==null?void 0:Pa.q_counts)," \u9898\uFF0C \u5171 ",se.createElement("span",{className:`${((oa=(da=Ze.exerciseBanks)==null?void 0:da.exercise_types)==null?void 0:oa.q_scores)>100?"color-red font-bd":"color-orange"}`},(Si=(Xi=Ze.exerciseBanks)==null?void 0:Xi.exercise_types)==null?void 0:Si.q_scores)," \u5206"))),ni!=""&&se.createElement("section",{className:[Jt.bg,"pt30","pl20","pr20","pb20","mt20"].join(" ")},Zi()),se.createElement("section",{style:{display:"flex"},className:[Jt.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},se.createElement("div",{style:{flex:"1"}},Fi.map(function(ai,Mi){return se.createElement(Fe.ZP,{className:"mr20",type:"primary",onClick:()=>ui(ai.id)},se.createElement(ft.Z,{className:"mr5"}),ai.name)}))),se.createElement(Kt,{callback:ai=>{ni.push({shixun:ai.challenge_names.map(Mi=>({challenge_name:Mi,challenge_score:5})),shixun_name:ai.title,shixun_id:ai.id,question_type:5,edit:!0}),ii([...ni])}}))};var ht=(0,Te.connect)(({polls:Ue,loading:Xe,user:Ze,globalSetting:gt})=>({polls:Ue,globalSetting:gt,user:Ze,loading:Xe.effects}))(pr)},56762:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return Te}});var se=ue(59301);function Te(){const[,ze]=se.useReducer(ut=>ut+1,0);return ze}},19080:function(bn,tn,ue){"use strict";ue.d(tn,{F:function(){return xe},Z:function(){return ut}});var se=ue(92310),Te=ue.n(se);const ze=null;function ut(Me,De,we){return Te()({[`${Me}-status-success`]:De==="success",[`${Me}-status-warning`]:De==="warning",[`${Me}-status-error`]:De==="error",[`${Me}-status-validating`]:De==="validating",[`${Me}-has-feedback`]:we})}const xe=(Me,De)=>De||Me},66104:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return $t}});var se=ue(92310),Te=ue.n(se),ze=ue(11592),ut=ue(26112),xe=ue(59301),Me=ue(92343),De=ue(36355),we=ue(84105),_e=ue(91857);const Re=pt=>{let{children:Bt}=pt;const{getPrefixCls:Tt}=xe.useContext(De.E_),wt=Tt("breadcrumb");return xe.createElement("li",{className:`${wt}-separator`,"aria-hidden":"true"},Bt===""?Bt:Bt||"/")};Re.__ANT_BREADCRUMB_SEPARATOR=!0;var dt=Re,Ae=function(pt,Bt){var Tt={};for(var wt in pt)Object.prototype.hasOwnProperty.call(pt,wt)&&Bt.indexOf(wt)<0&&(Tt[wt]=pt[wt]);if(pt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ne=0,wt=Object.getOwnPropertySymbols(pt);Ne<wt.length;Ne++)Bt.indexOf(wt[Ne])<0&&Object.prototype.propertyIsEnumerable.call(pt,wt[Ne])&&(Tt[wt[Ne]]=pt[wt[Ne]]);return Tt};function Fe(pt,Bt){if(pt.title===void 0||pt.title===null)return null;const Tt=Object.keys(Bt).join("|");return typeof pt.title=="object"?pt.title:String(pt.title).replace(new RegExp(`:(${Tt})`,"g"),(wt,Ne)=>Bt[Ne]||wt)}function ft(pt,Bt,Tt,wt){if(Tt==null)return null;const{className:Ne,onClick:be}=Bt,xt=Ae(Bt,["className","onClick"]),Qt=Object.assign(Object.assign({},(0,ut.Z)(xt,{data:!0,aria:!0})),{onClick:be});return wt!==void 0?xe.createElement("a",Object.assign({},Qt,{className:Te()(`${pt}-link`,Ne),href:wt}),Tt):xe.createElement("span",Object.assign({},Qt,{className:Te()(`${pt}-link`,Ne)}),Tt)}function Ye(pt,Bt){return(wt,Ne,be,xt,Qt)=>{if(Bt)return Bt(wt,Ne,be,xt);const Vt=Fe(wt,Ne);return ft(pt,wt,Vt,Qt)}}var ot=function(pt,Bt){var Tt={};for(var wt in pt)Object.prototype.hasOwnProperty.call(pt,wt)&&Bt.indexOf(wt)<0&&(Tt[wt]=pt[wt]);if(pt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ne=0,wt=Object.getOwnPropertySymbols(pt);Ne<wt.length;Ne++)Bt.indexOf(wt[Ne])<0&&Object.prototype.propertyIsEnumerable.call(pt,wt[Ne])&&(Tt[wt[Ne]]=pt[wt[Ne]]);return Tt};const at=pt=>{const{prefixCls:Bt,separator:Tt="/",children:wt,menu:Ne,overlay:be,dropdownProps:xt,href:Qt}=pt,qe=(nt=>{if(Ne||be){const Ot=Object.assign({},xt);if(Ne){const dn=Ne||{},{items:en}=dn,on=ot(dn,["items"]);Ot.menu=Object.assign(Object.assign({},on),{items:en==null?void 0:en.map((Xt,Ut)=>{var{key:Zt,title:ye,label:le,path:oe}=Xt,he=ot(Xt,["key","title","label","path"]);let pe=le!=null?le:ye;return oe&&(pe=xe.createElement("a",{href:`${Qt}${oe}`},pe)),Object.assign(Object.assign({},he),{key:Zt!=null?Zt:Ut,label:pe})})})}else be&&(Ot.overlay=be);return xe.createElement(_e.Z,Object.assign({placement:"bottom"},Ot),xe.createElement("span",{className:`${Bt}-overlay-link`},nt,xe.createElement(we.Z,null)))}return nt})(wt);return qe!=null?xe.createElement(xe.Fragment,null,xe.createElement("li",null,qe),Tt&&xe.createElement(dt,null,Tt)):null},Ct=pt=>{const{prefixCls:Bt,children:Tt,href:wt}=pt,Ne=ot(pt,["prefixCls","children","href"]),{getPrefixCls:be}=xe.useContext(De.E_),xt=be("breadcrumb",Bt);return xe.createElement(at,Object.assign({},Ne,{prefixCls:xt}),ft(xt,Ne,Tt,wt))};Ct.__ANT_BREADCRUMB_ITEM=!0;var jt=Ct,it=ue(17313),vt=ue(83116),$e=ue(37613);const Ee=pt=>{const{componentCls:Bt,iconCls:Tt}=pt;return{[Bt]:Object.assign(Object.assign({},(0,it.Wf)(pt)),{color:pt.itemColor,fontSize:pt.fontSize,[Tt]:{fontSize:pt.iconFontSize},ol:{display:"flex",flexWrap:"wrap",margin:0,padding:0,listStyle:"none"},a:Object.assign({color:pt.linkColor,transition:`color ${pt.motionDurationMid}`,padding:`0 ${pt.paddingXXS}px`,borderRadius:pt.borderRadiusSM,height:pt.lineHeight*pt.fontSize,display:"inline-block",marginInline:-pt.marginXXS,"&:hover":{color:pt.linkHoverColor,backgroundColor:pt.colorBgTextHover}},(0,it.Qy)(pt)),"li:last-child":{color:pt.lastItemColor},[`${Bt}-separator`]:{marginInline:pt.separatorMargin,color:pt.separatorColor},[`${Bt}-link`]:{[`
> ${Tt} + span,
> ${Tt} + a
`]:{marginInlineStart:pt.marginXXS}},[`${Bt}-overlay-link`]:{borderRadius:pt.borderRadiusSM,height:pt.lineHeight*pt.fontSize,display:"inline-block",padding:`0 ${pt.paddingXXS}px`,marginInline:-pt.marginXXS,[`> ${Tt}`]:{marginInlineStart:pt.marginXXS,fontSize:pt.fontSizeIcon},"&:hover":{color:pt.linkHoverColor,backgroundColor:pt.colorBgTextHover,a:{color:pt.linkHoverColor}},a:{"&:hover":{backgroundColor:"transparent"}}},[`&${pt.componentCls}-rtl`]:{direction:"rtl"}})}};var Ve=(0,vt.Z)("Breadcrumb",pt=>{const Bt=(0,$e.TS)(pt,{});return[Ee(Bt)]},pt=>({itemColor:pt.colorTextDescription,lastItemColor:pt.colorText,iconFontSize:pt.fontSize,linkColor:pt.colorTextDescription,linkHoverColor:pt.colorText,separatorColor:pt.colorTextDescription,separatorMargin:pt.marginXS})),Je=function(pt,Bt){var Tt={};for(var wt in pt)Object.prototype.hasOwnProperty.call(pt,wt)&&Bt.indexOf(wt)<0&&(Tt[wt]=pt[wt]);if(pt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ne=0,wt=Object.getOwnPropertySymbols(pt);Ne<wt.length;Ne++)Bt.indexOf(wt[Ne])<0&&Object.prototype.propertyIsEnumerable.call(pt,wt[Ne])&&(Tt[wt[Ne]]=pt[wt[Ne]]);return Tt};function Lt(pt){const{breadcrumbName:Bt,children:Tt}=pt,wt=Je(pt,["breadcrumbName","children"]),Ne=Object.assign({title:Bt},wt);return Tt&&(Ne.menu={items:Tt.map(be=>{var{breadcrumbName:xt}=be,Qt=Je(be,["breadcrumbName"]);return Object.assign(Object.assign({},Qt),{title:xt})})}),Ne}function et(pt,Bt){return(0,xe.useMemo)(()=>pt||(Bt?Bt.map(Lt):null),[pt,Bt])}var Dt=function(pt,Bt){var Tt={};for(var wt in pt)Object.prototype.hasOwnProperty.call(pt,wt)&&Bt.indexOf(wt)<0&&(Tt[wt]=pt[wt]);if(pt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ne=0,wt=Object.getOwnPropertySymbols(pt);Ne<wt.length;Ne++)Bt.indexOf(wt[Ne])<0&&Object.prototype.propertyIsEnumerable.call(pt,wt[Ne])&&(Tt[wt[Ne]]=pt[wt[Ne]]);return Tt};const Ge=(pt,Bt)=>{if(Bt===void 0)return Bt;let Tt=(Bt||"").replace(/^\//,"");return Object.keys(pt).forEach(wt=>{Tt=Tt.replace(`:${wt}`,pt[wt])}),Tt},kt=pt=>{const{prefixCls:Bt,separator:Tt="/",style:wt,className:Ne,rootClassName:be,routes:xt,items:Qt,children:Vt,itemRender:qe,params:nt={}}=pt,Ot=Dt(pt,["prefixCls","separator","style","className","rootClassName","routes","items","children","itemRender","params"]),{getPrefixCls:dn,direction:en,breadcrumb:on}=xe.useContext(De.E_);let Xt;const Ut=dn("breadcrumb",Bt),[Zt,ye]=Ve(Ut),le=et(Qt,xt),oe=Ye(Ut,qe);if(le&&le.length>0){const ce=[],Ie=Qt||xt;Xt=le.map((yt,Pe)=>{const{path:je,key:Rt,type:At,menu:rt,overlay:Ft,onClick:sn,className:ct,separator:qt,dropdownProps:an}=yt,Qe=Ge(nt,je);Qe!==void 0&&ce.push(Qe);const mt=Rt!=null?Rt:Pe;if(At==="separator")return xe.createElement(dt,{key:mt},qt);const Nt={},vn=Pe===le.length-1;rt?Nt.menu=rt:Ft&&(Nt.overlay=Ft);let{href:mn}=yt;return ce.length&&Qe!==void 0&&(mn=`#/${ce.join("/")}`),xe.createElement(at,Object.assign({key:mt},Nt,(0,ut.Z)(yt,{data:!0,aria:!0}),{className:ct,dropdownProps:an,href:mn,separator:vn?"":Tt,onClick:sn,prefixCls:Ut}),oe(yt,nt,Ie,ce,mn))})}else if(Vt){const ce=(0,ze.Z)(Vt).length;Xt=(0,ze.Z)(Vt).map((Ie,yt)=>{if(!Ie)return Ie;const Pe=yt===ce-1;return(0,Me.Tm)(Ie,{separator:Pe?"":Tt,key:yt})})}const he=Te()(Ut,on==null?void 0:on.className,{[`${Ut}-rtl`]:en==="rtl"},Ne,be,ye),pe=Object.assign(Object.assign({},on==null?void 0:on.style),wt);return Zt(xe.createElement("nav",Object.assign({className:he,style:pe},Ot),xe.createElement("ol",null,Xt)))};kt.Item=jt,kt.Separator=dt;var tt=kt,$t=tt},24905:function(bn,tn,ue){"use strict";ue.d(tn,{default:function(){return Ve}});var se=ue(92310),Te=ue.n(se),ze=ue(5630),ut=ue(59301),xe=ue(36355),Me=ue(1684),De=ue(32441),_e=ut.createContext(null),Re=ue(98447),dt=ue(14088),Ae=ue(4572),Fe=function(Je,Lt){var et={};for(var Dt in Je)Object.prototype.hasOwnProperty.call(Je,Dt)&&Lt.indexOf(Dt)<0&&(et[Dt]=Je[Dt]);if(Je!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ge=0,Dt=Object.getOwnPropertySymbols(Je);Ge<Dt.length;Ge++)Lt.indexOf(Dt[Ge])<0&&Object.prototype.propertyIsEnumerable.call(Je,Dt[Ge])&&(et[Dt[Ge]]=Je[Dt[Ge]]);return et};const ft=(Je,Lt)=>{var et;const{prefixCls:Dt,className:Ge,rootClassName:kt,children:tt,indeterminate:$t=!1,style:pt,onMouseEnter:Bt,onMouseLeave:Tt,skipGroup:wt=!1,disabled:Ne}=Je,be=Fe(Je,["prefixCls","className","rootClassName","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]),{getPrefixCls:xt,direction:Qt,checkbox:Vt}=ut.useContext(xe.E_),qe=ut.useContext(_e),{isFormItemInput:nt}=ut.useContext(De.aM),Ot=ut.useContext(Me.Z),dn=(et=(qe==null?void 0:qe.disabled)||Ne)!==null&&et!==void 0?et:Ot,en=ut.useRef(be.value);ut.useEffect(()=>{qe==null||qe.registerValue(be.value)},[]),ut.useEffect(()=>{if(!wt)return be.value!==en.current&&(qe==null||qe.cancelValue(en.current),qe==null||qe.registerValue(be.value),en.current=be.value),()=>qe==null?void 0:qe.cancelValue(be.value)},[be.value]);const on=xt("checkbox",Dt),[Xt,Ut]=(0,Re.ZP)(on),Zt=Object.assign({},be);qe&&!wt&&(Zt.onChange=function(){be.onChange&&be.onChange.apply(be,arguments),qe.toggleOption&&qe.toggleOption({label:tt,value:be.value})},Zt.name=qe.name,Zt.checked=qe.value.includes(be.value));const ye=Te()(`${on}-wrapper`,{[`${on}-rtl`]:Qt==="rtl",[`${on}-wrapper-checked`]:Zt.checked,[`${on}-wrapper-disabled`]:dn,[`${on}-wrapper-in-form-item`]:nt},Vt==null?void 0:Vt.className,Ge,kt,Ut),le=Te()({[`${on}-indeterminate`]:$t},Ae.A,Ut),oe=$t?"mixed":void 0;return Xt(ut.createElement(dt.Z,{component:"Checkbox",disabled:dn},ut.createElement("label",{className:ye,style:Object.assign(Object.assign({},Vt==null?void 0:Vt.style),pt),onMouseEnter:Bt,onMouseLeave:Tt},ut.createElement(ze.Z,Object.assign({"aria-checked":oe},Zt,{prefixCls:on,className:le,disabled:dn,ref:Lt})),tt!==void 0&&ut.createElement("span",null,tt))))};var ot=ut.forwardRef(ft),at=ue(77654),Ct=ue(2738),jt=function(Je,Lt){var et={};for(var Dt in Je)Object.prototype.hasOwnProperty.call(Je,Dt)&&Lt.indexOf(Dt)<0&&(et[Dt]=Je[Dt]);if(Je!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ge=0,Dt=Object.getOwnPropertySymbols(Je);Ge<Dt.length;Ge++)Lt.indexOf(Dt[Ge])<0&&Object.prototype.propertyIsEnumerable.call(Je,Dt[Ge])&&(et[Dt[Ge]]=Je[Dt[Ge]]);return et};const it=(Je,Lt)=>{const{defaultValue:et,children:Dt,options:Ge=[],prefixCls:kt,className:tt,rootClassName:$t,style:pt,onChange:Bt}=Je,Tt=jt(Je,["defaultValue","children","options","prefixCls","className","rootClassName","style","onChange"]),{getPrefixCls:wt,direction:Ne}=ut.useContext(xe.E_),[be,xt]=ut.useState(Tt.value||et||[]),[Qt,Vt]=ut.useState([]);ut.useEffect(()=>{"value"in Tt&&xt(Tt.value||[])},[Tt.value]);const qe=ut.useMemo(()=>Ge.map(he=>typeof he=="string"||typeof he=="number"?{label:he,value:he}:he),[Ge]),nt=he=>{Vt(pe=>pe.filter(ce=>ce!==he))},Ot=he=>{Vt(pe=>[].concat((0,at.Z)(pe),[he]))},dn=he=>{const pe=be.indexOf(he.value),ce=(0,at.Z)(be);pe===-1?ce.push(he.value):ce.splice(pe,1),"value"in Tt||xt(ce),Bt==null||Bt(ce.filter(Ie=>Qt.includes(Ie)).sort((Ie,yt)=>{const Pe=qe.findIndex(Rt=>Rt.value===Ie),je=qe.findIndex(Rt=>Rt.value===yt);return Pe-je}))},en=wt("checkbox",kt),on=`${en}-group`,[Xt,Ut]=(0,Re.ZP)(en),Zt=(0,Ct.Z)(Tt,["value","disabled"]),ye=Ge.length?qe.map(he=>ut.createElement(ot,{prefixCls:en,key:he.value.toString(),disabled:"disabled"in he?he.disabled:Tt.disabled,value:he.value,checked:be.includes(he.value),onChange:he.onChange,className:`${on}-item`,style:he.style,title:he.title},he.label)):Dt,le={toggleOption:dn,value:be,disabled:Tt.disabled,name:Tt.name,registerValue:Ot,cancelValue:nt},oe=Te()(on,{[`${on}-rtl`]:Ne==="rtl"},tt,$t,Ut);return Xt(ut.createElement("div",Object.assign({className:oe,style:pt},Zt,{ref:Lt}),ut.createElement(_e.Provider,{value:le},ye)))},vt=ut.forwardRef(it);var $e=ut.memo(vt);const Ee=ot;Ee.Group=$e,Ee.__ANT_CHECKBOX=!0;var Ve=Ee},98447:function(bn,tn,ue){"use strict";ue.d(tn,{C2:function(){return xe}});var se=ue(17313),Te=ue(37613),ze=ue(83116);const ut=Me=>{const{checkboxCls:De}=Me,we=`${De}-wrapper`;return[{[`${De}-group`]:Object.assign(Object.assign({},(0,se.Wf)(Me)),{display:"inline-flex",flexWrap:"wrap",columnGap:Me.marginXS,[`> ${Me.antCls}-row`]:{flex:1}}),[we]:Object.assign(Object.assign({},(0,se.Wf)(Me)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${we}`]:{marginInlineStart:0},[`&${we}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[De]:Object.assign(Object.assign({},(0,se.Wf)(Me)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:Me.borderRadiusSM,alignSelf:"center",[`${De}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${De}-inner`]:Object.assign({},(0,se.oN)(Me))},[`${De}-inner`]:{boxSizing:"border-box",position:"relative",top:0,insetInlineStart:0,display:"block",width:Me.checkboxSize,height:Me.checkboxSize,direction:"ltr",backgroundColor:Me.colorBgContainer,border:`${Me.lineWidth}px ${Me.lineType} ${Me.colorBorder}`,borderRadius:Me.borderRadiusSM,borderCollapse:"separate",transition:`all ${Me.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"21.5%",display:"table",width:Me.checkboxSize/14*5,height:Me.checkboxSize/14*8,border:`${Me.lineWidthBold}px solid ${Me.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${Me.motionDurationFast} ${Me.motionEaseInBack}, opacity ${Me.motionDurationFast}`}},"& + span":{paddingInlineStart:Me.paddingXS,paddingInlineEnd:Me.paddingXS}})},{[`
${we}:not(${we}-disabled),
${De}:not(${De}-disabled)
`]:{[`&:hover ${De}-inner`]:{borderColor:Me.colorPrimary}},[`${we}:not(${we}-disabled)`]:{[`&:hover ${De}-checked:not(${De}-disabled) ${De}-inner`]:{backgroundColor:Me.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${De}-checked:not(${De}-disabled):after`]:{borderColor:Me.colorPrimaryHover}}},{[`${De}-checked`]:{[`${De}-inner`]:{backgroundColor:Me.colorPrimary,borderColor:Me.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${Me.motionDurationMid} ${Me.motionEaseOutBack} ${Me.motionDurationFast}`}}},[`
${we}-checked:not(${we}-disabled),
${De}-checked:not(${De}-disabled)
`]:{[`&:hover ${De}-inner`]:{backgroundColor:Me.colorPrimaryHover,borderColor:"transparent"}}},{[De]:{"&-indeterminate":{[`${De}-inner`]:{backgroundColor:Me.colorBgContainer,borderColor:Me.colorBorder,"&:after":{top:"50%",insetInlineStart:"50%",width:Me.fontSizeLG/2,height:Me.fontSizeLG/2,backgroundColor:Me.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}}}}},{[`${we}-disabled`]:{cursor:"not-allowed"},[`${De}-disabled`]:{[`&, ${De}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${De}-inner`]:{background:Me.colorBgContainerDisabled,borderColor:Me.colorBorder,"&:after":{borderColor:Me.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:Me.colorTextDisabled},[`&${De}-indeterminate ${De}-inner::after`]:{background:Me.colorTextDisabled}}}]};function xe(Me,De){const we=(0,Te.TS)(De,{checkboxCls:`.${Me}`,checkboxSize:De.controlInteractiveSize});return[ut(we)]}tn.ZP=(0,ze.Z)("Checkbox",(Me,De)=>{let{prefixCls:we}=De;return[xe(we,Me)]})},93891:function(bn,tn,ue){"use strict";var se=ue(59301),Te=ue(36355),ze=ue(64165);const ut=xe=>{const{componentName:Me}=xe,{getPrefixCls:De}=(0,se.useContext)(Te.E_),we=De("empty");switch(Me){case"Table":case"List":return se.createElement(ze.Z,{image:ze.Z.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return se.createElement(ze.Z,{image:ze.Z.PRESENTED_IMAGE_SIMPLE,className:`${we}-small`});default:return se.createElement(ze.Z,null)}};tn.Z=ut},28103:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return Ae}});var se=ue(92310),Te=ue.n(se),ze=ue(59301),ut=ue(36355),xe=ue(17313),Me=ue(83116),De=ue(37613);const we=Fe=>{const{componentCls:ft,sizePaddingEdgeHorizontal:Ye,colorSplit:ot,lineWidth:at,textPaddingInline:Ct,orientationMargin:jt,verticalMarginInline:it}=Fe;return{[ft]:Object.assign(Object.assign({},(0,xe.Wf)(Fe)),{borderBlockStart:`${at}px solid ${ot}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:it,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${at}px solid ${ot}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${Fe.dividerHorizontalGutterMargin}px 0`},[`&-horizontal${ft}-with-text`]:{display:"flex",alignItems:"center",margin:`${Fe.dividerHorizontalWithTextGutterMargin}px 0`,color:Fe.colorTextHeading,fontWeight:500,fontSize:Fe.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${ot}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${at}px solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${ft}-with-text-left`]:{"&::before":{width:`${jt*100}%`},"&::after":{width:`${100-jt*100}%`}},[`&-horizontal${ft}-with-text-right`]:{"&::before":{width:`${100-jt*100}%`},"&::after":{width:`${jt*100}%`}},[`${ft}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:Ct},"&-dashed":{background:"none",borderColor:ot,borderStyle:"dashed",borderWidth:`${at}px 0 0`},[`&-horizontal${ft}-with-text${ft}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${ft}-dashed`]:{borderInlineStartWidth:at,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${ft}-with-text`]:{color:Fe.colorText,fontWeight:"normal",fontSize:Fe.fontSize},[`&-horizontal${ft}-with-text-left${ft}-no-default-orientation-margin-left`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${ft}-inner-text`]:{paddingInlineStart:Ye}},[`&-horizontal${ft}-with-text-right${ft}-no-default-orientation-margin-right`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${ft}-inner-text`]:{paddingInlineEnd:Ye}}})}};var _e=(0,Me.Z)("Divider",Fe=>{const ft=(0,De.TS)(Fe,{dividerHorizontalWithTextGutterMargin:Fe.margin,dividerHorizontalGutterMargin:Fe.marginLG,sizePaddingEdgeHorizontal:0});return[we(ft)]},Fe=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:Fe.marginXS})),Re=function(Fe,ft){var Ye={};for(var ot in Fe)Object.prototype.hasOwnProperty.call(Fe,ot)&&ft.indexOf(ot)<0&&(Ye[ot]=Fe[ot]);if(Fe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var at=0,ot=Object.getOwnPropertySymbols(Fe);at<ot.length;at++)ft.indexOf(ot[at])<0&&Object.prototype.propertyIsEnumerable.call(Fe,ot[at])&&(Ye[ot[at]]=Fe[ot[at]]);return Ye},Ae=Fe=>{const{getPrefixCls:ft,direction:Ye,divider:ot}=ze.useContext(ut.E_),{prefixCls:at,type:Ct="horizontal",orientation:jt="center",orientationMargin:it,className:vt,rootClassName:$e,children:Ee,dashed:Ve,plain:Je,style:Lt}=Fe,et=Re(Fe,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),Dt=ft("divider",at),[Ge,kt]=_e(Dt),tt=jt.length>0?`-${jt}`:jt,$t=!!Ee,pt=jt==="left"&&it!=null,Bt=jt==="right"&&it!=null,Tt=Te()(Dt,ot==null?void 0:ot.className,kt,`${Dt}-${Ct}`,{[`${Dt}-with-text`]:$t,[`${Dt}-with-text${tt}`]:$t,[`${Dt}-dashed`]:!!Ve,[`${Dt}-plain`]:!!Je,[`${Dt}-rtl`]:Ye==="rtl",[`${Dt}-no-default-orientation-margin-left`]:pt,[`${Dt}-no-default-orientation-margin-right`]:Bt},vt,$e),wt=ze.useMemo(()=>typeof it=="number"?it:/^\d+$/.test(it)?Number(it):it,[it]),Ne=Object.assign(Object.assign({},pt&&{marginLeft:wt}),Bt&&{marginRight:wt});return Ge(ze.createElement("div",Object.assign({className:Tt,style:Object.assign(Object.assign({},ot==null?void 0:ot.style),Lt)},et,{role:"separator"}),Ee&&Ct!=="vertical"&&ze.createElement("span",{className:`${Dt}-inner-text`,style:Ne},Ee)))}},43428:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return Xt}});var se=ue(92310),Te=ue.n(se),ze=ue(85899),ut=ue(72190),xe=ue(43403),Me=ue(34280),De=ue(59301),we=De.createContext(null),_e=De.createContext({}),Re=we,dt=ue(18642),Ae=ue(60499),Fe=ue(77900),ft=ue(10228),Ye=ue(26112),ot=ue(70425),at=function(Zt){var ye=Zt.prefixCls,le=Zt.className,oe=Zt.style,he=Zt.children,pe=Zt.containerRef,ce=Zt.id,Ie=Zt.onMouseEnter,yt=Zt.onMouseOver,Pe=Zt.onMouseLeave,je=Zt.onClick,Rt=Zt.onKeyDown,At=Zt.onKeyUp,rt={onMouseEnter:Ie,onMouseOver:yt,onMouseLeave:Pe,onClick:je,onKeyDown:Rt,onKeyUp:At},Ft=De.useContext(_e),sn=Ft.panel,ct=(0,ot.useComposeRef)(sn,pe);return De.createElement(De.Fragment,null,De.createElement("div",(0,Ae.Z)({id:ce,className:Te()("".concat(ye,"-content"),le),style:(0,ze.Z)({},oe),"aria-modal":"true",role:"dialog",ref:ct},rt),he))},Ct=at,jt=ue(48736);function it(Ut){return typeof Ut=="string"&&String(Number(Ut))===Ut?((0,jt.ZP)(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(Ut)):Ut}function vt(Ut){warning(!("wrapperClassName"in Ut),"'wrapperClassName' is removed. Please use 'rootClassName' instead."),warning(canUseDom()||!Ut.open,"Drawer with 'open' in SSR is not work since no place to createPortal. Please move to 'useEffect' instead.")}var $e={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function Ee(Ut,Zt){var ye,le,oe,he,pe=Ut.prefixCls,ce=Ut.open,Ie=Ut.placement,yt=Ut.inline,Pe=Ut.push,je=Ut.forceRender,Rt=Ut.autoFocus,At=Ut.keyboard,rt=Ut.rootClassName,Ft=Ut.rootStyle,sn=Ut.zIndex,ct=Ut.className,qt=Ut.id,an=Ut.style,Qe=Ut.motion,mt=Ut.width,Nt=Ut.height,vn=Ut.children,mn=Ut.contentWrapperStyle,wn=Ut.mask,Tn=Ut.maskClosable,Zn=Ut.maskMotion,Hn=Ut.maskClassName,wr=Ut.maskStyle,Cr=Ut.afterOpenChange,Yn=Ut.onClose,Nr=Ut.onMouseEnter,Kr=Ut.onMouseOver,Or=Ut.onMouseLeave,Ar=Ut.onClick,kr=Ut.onKeyDown,Gr=Ut.onKeyUp,ar=De.useRef(),$r=De.useRef(),Ur=De.useRef();De.useImperativeHandle(Zt,function(){return ar.current});var Vr=function(Kt){var Jt=Kt.keyCode,un=Kt.shiftKey;switch(Jt){case ft.Z.TAB:{if(Jt===ft.Z.TAB){if(!un&&document.activeElement===Ur.current){var fn;(fn=$r.current)===null||fn===void 0||fn.focus({preventScroll:!0})}else if(un&&document.activeElement===$r.current){var xn;(xn=Ur.current)===null||xn===void 0||xn.focus({preventScroll:!0})}}break}case ft.Z.ESC:{Yn&&At&&(Kt.stopPropagation(),Yn(Kt));break}}};De.useEffect(function(){if(ce&&Rt){var Yt;(Yt=ar.current)===null||Yt===void 0||Yt.focus({preventScroll:!0})}},[ce]);var Yr=De.useState(!1),Zr=(0,ut.Z)(Yr,2),dr=Zr[0],_r=Zr[1],Ln=De.useContext(Re),Wn;Pe===!1?Wn={distance:0}:Pe===!0?Wn={}:Wn=Pe||{};var Er=(ye=(le=(oe=Wn)===null||oe===void 0?void 0:oe.distance)!==null&&le!==void 0?le:Ln==null?void 0:Ln.pushDistance)!==null&&ye!==void 0?ye:180,St=De.useMemo(function(){return{pushDistance:Er,push:function(){_r(!0)},pull:function(){_r(!1)}}},[Er]);De.useEffect(function(){if(ce){var Yt;Ln==null||(Yt=Ln.push)===null||Yt===void 0||Yt.call(Ln)}else{var Kt;Ln==null||(Kt=Ln.pull)===null||Kt===void 0||Kt.call(Ln)}},[ce]),De.useEffect(function(){return function(){var Yt;Ln==null||(Yt=Ln.pull)===null||Yt===void 0||Yt.call(Ln)}},[]);var Le=wn&&De.createElement(Fe.default,(0,Ae.Z)({key:"mask"},Zn,{visible:ce}),function(Yt,Kt){var Jt=Yt.className,un=Yt.style;return De.createElement("div",{className:Te()("".concat(pe,"-mask"),Jt,Hn),style:(0,ze.Z)((0,ze.Z)({},un),wr),onClick:Tn&&ce?Yn:void 0,ref:Kt})}),We=typeof Qe=="function"?Qe(Ie):Qe,Be={};if(dr&&Er)switch(Ie){case"top":Be.transform="translateY(".concat(Er,"px)");break;case"bottom":Be.transform="translateY(".concat(-Er,"px)");break;case"left":Be.transform="translateX(".concat(Er,"px)");break;default:Be.transform="translateX(".concat(-Er,"px)");break}Ie==="left"||Ie==="right"?Be.width=it(mt):Be.height=it(Nt);var Oe={onMouseEnter:Nr,onMouseOver:Kr,onMouseLeave:Or,onClick:Ar,onKeyDown:kr,onKeyUp:Gr},lt=De.createElement(Fe.default,(0,Ae.Z)({key:"panel"},We,{visible:ce,forceRender:je,onVisibleChanged:function(Kt){Cr==null||Cr(Kt)},removeOnLeave:!1,leavedClassName:"".concat(pe,"-content-wrapper-hidden")}),function(Yt,Kt){var Jt=Yt.className,un=Yt.style;return De.createElement("div",(0,Ae.Z)({className:Te()("".concat(pe,"-content-wrapper"),Jt),style:(0,ze.Z)((0,ze.Z)((0,ze.Z)({},Be),un),mn)},(0,Ye.Z)(Ut,{data:!0})),De.createElement(Ct,(0,Ae.Z)({id:qt,containerRef:Kt,prefixCls:pe,className:ct,style:an},Oe),vn))}),_t=(0,ze.Z)({},Ft);return sn&&(_t.zIndex=sn),De.createElement(Re.Provider,{value:St},De.createElement("div",{className:Te()(pe,"".concat(pe,"-").concat(Ie),rt,(he={},(0,dt.Z)(he,"".concat(pe,"-open"),ce),(0,dt.Z)(he,"".concat(pe,"-inline"),yt),he)),style:_t,tabIndex:-1,ref:ar,onKeyDown:Vr},Le,De.createElement("div",{tabIndex:0,ref:$r,style:$e,"aria-hidden":"true","data-sentinel":"start"}),lt,De.createElement("div",{tabIndex:0,ref:Ur,style:$e,"aria-hidden":"true","data-sentinel":"end"})))}var Ve=De.forwardRef(Ee),Je=Ve,Lt=function(Zt){var ye=Zt.open,le=ye===void 0?!1:ye,oe=Zt.prefixCls,he=oe===void 0?"rc-drawer":oe,pe=Zt.placement,ce=pe===void 0?"right":pe,Ie=Zt.autoFocus,yt=Ie===void 0?!0:Ie,Pe=Zt.keyboard,je=Pe===void 0?!0:Pe,Rt=Zt.width,At=Rt===void 0?378:Rt,rt=Zt.mask,Ft=rt===void 0?!0:rt,sn=Zt.maskClosable,ct=sn===void 0?!0:sn,qt=Zt.getContainer,an=Zt.forceRender,Qe=Zt.afterOpenChange,mt=Zt.destroyOnClose,Nt=Zt.onMouseEnter,vn=Zt.onMouseOver,mn=Zt.onMouseLeave,wn=Zt.onClick,Tn=Zt.onKeyDown,Zn=Zt.onKeyUp,Hn=Zt.panelRef,wr=De.useState(!1),Cr=(0,ut.Z)(wr,2),Yn=Cr[0],Nr=Cr[1],Kr=De.useState(!1),Or=(0,ut.Z)(Kr,2),Ar=Or[0],kr=Or[1];(0,Me.Z)(function(){kr(!0)},[]);var Gr=Ar?le:!1,ar=De.useRef(),$r=De.useRef();(0,Me.Z)(function(){Gr&&($r.current=document.activeElement)},[Gr]);var Ur=function(_r){var Ln;if(Nr(_r),Qe==null||Qe(_r),!_r&&$r.current&&!((Ln=ar.current)!==null&&Ln!==void 0&&Ln.contains($r.current))){var Wn;(Wn=$r.current)===null||Wn===void 0||Wn.focus({preventScroll:!0})}},Vr=De.useMemo(function(){return{panel:Hn}},[Hn]);if(!an&&!Yn&&!Gr&&mt)return null;var Yr={onMouseEnter:Nt,onMouseOver:vn,onMouseLeave:mn,onClick:wn,onKeyDown:Tn,onKeyUp:Zn},Zr=(0,ze.Z)((0,ze.Z)({},Zt),{},{open:Gr,prefixCls:he,placement:ce,autoFocus:yt,keyboard:je,width:At,mask:Ft,maskClosable:ct,inline:qt===!1,afterOpenChange:Ur,ref:ar},Yr);return De.createElement(_e.Provider,{value:Vr},De.createElement(xe.Z,{open:Gr||an||Yn,autoDestroy:!1,getContainer:qt,autoLock:Ft&&(Gr||Yn)},De.createElement(Je,Zr)))},et=Lt,Dt=et,Ge=ue(62892),kt=ue(36355),tt=ue(32441),$t=ue(47729),Bt=Ut=>{const{prefixCls:Zt,title:ye,footer:le,extra:oe,closeIcon:he,closable:pe,onClose:ce,headerStyle:Ie,drawerStyle:yt,bodyStyle:Pe,footerStyle:je,children:Rt}=Ut,At=De.useCallback(qt=>De.createElement("button",{type:"button",onClick:ce,"aria-label":"Close",className:`${Zt}-close`},qt),[ce]),[rt,Ft]=(0,$t.Z)(pe,he,At,void 0,!0),sn=De.useMemo(()=>!ye&&!rt?null:De.createElement("div",{style:Ie,className:Te()(`${Zt}-header`,{[`${Zt}-header-close-only`]:rt&&!ye&&!oe})},De.createElement("div",{className:`${Zt}-header-title`},Ft,ye&&De.createElement("div",{className:`${Zt}-title`},ye)),oe&&De.createElement("div",{className:`${Zt}-extra`},oe)),[rt,Ft,oe,Ie,Zt,ye]),ct=De.useMemo(()=>{if(!le)return null;const qt=`${Zt}-footer`;return De.createElement("div",{className:qt,style:je},le)},[le,je,Zt]);return De.createElement("div",{className:`${Zt}-wrapper-body`,style:yt},sn,De.createElement("div",{className:`${Zt}-body`,style:Pe},Rt),ct)},Tt=ue(33234),wt=ue(83116),Ne=ue(37613),xt=Ut=>{const{componentCls:Zt,motionDurationSlow:ye}=Ut,le={"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${ye}`}}};return{[Zt]:{[`${Zt}-mask-motion`]:{"&-enter, &-appear, &-leave":{"&-active":{transition:`all ${ye}`}},"&-enter, &-appear":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}}},[`${Zt}-panel-motion`]:{"&-left":[le,{"&-enter, &-appear":{"&-start":{transform:"translateX(-100%) !important"},"&-active":{transform:"translateX(0)"}},"&-leave":{transform:"translateX(0)","&-active":{transform:"translateX(-100%)"}}}],"&-right":[le,{"&-enter, &-appear":{"&-start":{transform:"translateX(100%) !important"},"&-active":{transform:"translateX(0)"}},"&-leave":{transform:"translateX(0)","&-active":{transform:"translateX(100%)"}}}],"&-top":[le,{"&-enter, &-appear":{"&-start":{transform:"translateY(-100%) !important"},"&-active":{transform:"translateY(0)"}},"&-leave":{transform:"translateY(0)","&-active":{transform:"translateY(-100%)"}}}],"&-bottom":[le,{"&-enter, &-appear":{"&-start":{transform:"translateY(100%) !important"},"&-active":{transform:"translateY(0)"}},"&-leave":{transform:"translateY(0)","&-active":{transform:"translateY(100%)"}}}]}}}};const Qt=Ut=>{const{componentCls:Zt,zIndexPopup:ye,colorBgMask:le,colorBgElevated:oe,motionDurationSlow:he,motionDurationMid:pe,padding:ce,paddingLG:Ie,fontSizeLG:yt,lineHeightLG:Pe,lineWidth:je,lineType:Rt,colorSplit:At,marginSM:rt,colorIcon:Ft,colorIconHover:sn,colorText:ct,fontWeightStrong:qt,footerPaddingBlock:an,footerPaddingInline:Qe}=Ut,mt=`${Zt}-content-wrapper`;return{[Zt]:{position:"fixed",inset:0,zIndex:ye,pointerEvents:"none","&-pure":{position:"relative",background:oe,[`&${Zt}-left`]:{boxShadow:Ut.boxShadowDrawerLeft},[`&${Zt}-right`]:{boxShadow:Ut.boxShadowDrawerRight},[`&${Zt}-top`]:{boxShadow:Ut.boxShadowDrawerUp},[`&${Zt}-bottom`]:{boxShadow:Ut.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${Zt}-mask`]:{position:"absolute",inset:0,zIndex:ye,background:le,pointerEvents:"auto"},[mt]:{position:"absolute",zIndex:ye,maxWidth:"100vw",transition:`all ${he}`,"&-hidden":{display:"none"}},[`&-left > ${mt}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:Ut.boxShadowDrawerLeft},[`&-right > ${mt}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:Ut.boxShadowDrawerRight},[`&-top > ${mt}`]:{top:0,insetInline:0,boxShadow:Ut.boxShadowDrawerUp},[`&-bottom > ${mt}`]:{bottom:0,insetInline:0,boxShadow:Ut.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 ${Ie}px`,fontSize:yt,lineHeight:Pe,borderBottom:`${je}px ${Rt} ${At}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${Zt}-extra`]:{flex:"none"},[`${Zt}-close`]:{display:"inline-block",marginInlineEnd:rt,color:Ft,fontWeight:qt,fontSize:yt,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,outline:0,cursor:"pointer",transition:`color ${pe}`,textRendering:"auto","&:focus, &:hover":{color:sn,textDecoration:"none"}},[`${Zt}-title`]:{flex:1,margin:0,color:ct,fontWeight:Ut.fontWeightStrong,fontSize:yt,lineHeight:Pe},[`${Zt}-body`]:{flex:1,minWidth:0,minHeight:0,padding:Ie,overflow:"auto"},[`${Zt}-footer`]:{flexShrink:0,padding:`${an}px ${Qe}px`,borderTop:`${je}px ${Rt} ${At}`},"&-rtl":{direction:"rtl"}}}};var Vt=(0,wt.Z)("Drawer",Ut=>{const Zt=(0,Ne.TS)(Ut,{});return[Qt(Zt),xt(Zt)]},Ut=>({zIndexPopup:Ut.zIndexPopupBase,footerPaddingBlock:Ut.paddingXS,footerPaddingInline:Ut.padding})),qe=ue(11575),nt=function(Ut,Zt){var ye={};for(var le in Ut)Object.prototype.hasOwnProperty.call(Ut,le)&&Zt.indexOf(le)<0&&(ye[le]=Ut[le]);if(Ut!=null&&typeof Object.getOwnPropertySymbols=="function")for(var oe=0,le=Object.getOwnPropertySymbols(Ut);oe<le.length;oe++)Zt.indexOf(le[oe])<0&&Object.prototype.propertyIsEnumerable.call(Ut,le[oe])&&(ye[le[oe]]=Ut[le[oe]]);return ye};const Ot=null,dn={distance:180},en=Ut=>{var Zt;const{rootClassName:ye,width:le,height:oe,size:he="default",mask:pe=!0,push:ce=dn,open:Ie,afterOpenChange:yt,onClose:Pe,prefixCls:je,getContainer:Rt,style:At,className:rt,visible:Ft,afterVisibleChange:sn}=Ut,ct=nt(Ut,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","style","className","visible","afterVisibleChange"]),{getPopupContainer:qt,getPrefixCls:an,direction:Qe,drawer:mt}=De.useContext(kt.E_),Nt=an("drawer",je),[vn,mn]=Vt(Nt),wn=Rt===void 0&&qt?()=>qt(document.body):Rt,Tn=Te()({"no-mask":!pe,[`${Nt}-rtl`]:Qe==="rtl"},ye,mn),Zn=De.useMemo(()=>le!=null?le:he==="large"?736:378,[le,he]),Hn=De.useMemo(()=>oe!=null?oe:he==="large"?736:378,[oe,he]),wr={motionName:(0,Ge.m)(Nt,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},Cr=Nr=>({motionName:(0,Ge.m)(Nt,`panel-motion-${Nr}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500}),Yn=(0,qe.H)();return vn(De.createElement(Tt.BR,null,De.createElement(tt.Ux,{status:!0,override:!0},De.createElement(Dt,Object.assign({prefixCls:Nt,onClose:Pe,maskMotion:wr,motion:Cr},ct,{open:Ie!=null?Ie:Ft,mask:pe,push:ce,width:Zn,height:Hn,style:Object.assign(Object.assign({},mt==null?void 0:mt.style),At),className:Te()(mt==null?void 0:mt.className,rt),rootClassName:Tn,getContainer:wn,afterOpenChange:yt!=null?yt:sn,panelRef:Yn}),De.createElement(Bt,Object.assign({prefixCls:Nt},ct,{onClose:Pe}))))))},on=Ut=>{const{prefixCls:Zt,style:ye,className:le,placement:oe="right"}=Ut,he=nt(Ut,["prefixCls","style","className","placement"]),{getPrefixCls:pe}=De.useContext(kt.E_),ce=pe("drawer",Zt),[Ie,yt]=Vt(ce),Pe=Te()(ce,`${ce}-pure`,`${ce}-${oe}`,yt,le);return Ie(De.createElement("div",{className:Pe,style:ye},De.createElement(Bt,Object.assign({prefixCls:ce},he))))};en._InternalPanelDoNotUseOrYouWillBeFired=on;var Xt=en},91857:function(bn,tn,ue){"use strict";var se=ue(59301),Te=ue(38819),ze=ue(92310),ut=ue.n(ze),xe=ue(31561),Me=ue(70425),De=ue(18929),we=ue(2738),_e=ue(79676),Re=ue(53487),dt=ue(92343),Ae=ue(36355),Fe=ue(20834),ft=ue(40875),Ye=ue(88088),ot=ue(47211);const at=null,Ct=$e=>{const{menu:Ee,arrow:Ve,prefixCls:Je,children:Lt,trigger:et,disabled:Dt,dropdownRender:Ge,getPopupContainer:kt,overlayClassName:tt,rootClassName:$t,open:pt,onOpenChange:Bt,visible:Tt,onVisibleChange:wt,mouseEnterDelay:Ne=.15,mouseLeaveDelay:be=.1,autoAdjustOverflow:xt=!0,placement:Qt="",overlay:Vt,transitionName:qe}=$e,{getPopupContainer:nt,getPrefixCls:Ot,direction:dn}=se.useContext(Ae.E_),en=se.useMemo(()=>{const rt=Ot();return qe!==void 0?qe:Qt.includes("top")?`${rt}-slide-down`:`${rt}-slide-up`},[Ot,Qt,qe]),on=se.useMemo(()=>Qt?Qt.includes("Center")?Qt.slice(0,Qt.indexOf("Center")):Qt:dn==="rtl"?"bottomRight":"bottomLeft",[Qt,dn]),Xt=Ot("dropdown",Je),[Ut,Zt]=(0,ot.Z)(Xt),[,ye]=(0,Ye.Z)(),le=se.Children.only(Lt),oe=(0,dt.Tm)(le,{className:ut()(`${Xt}-trigger`,{[`${Xt}-rtl`]:dn==="rtl"},le.props.className),disabled:Dt}),he=Dt?[]:et;let pe;he&&he.includes("contextMenu")&&(pe=!0);const[ce,Ie]=(0,De.Z)(!1,{value:pt!=null?pt:Tt}),yt=(0,Me.useEvent)(rt=>{Bt==null||Bt(rt),wt==null||wt(rt),Ie(rt)}),Pe=ut()(tt,$t,Zt,{[`${Xt}-rtl`]:dn==="rtl"}),je=(0,_e.Z)({arrowPointAtCenter:typeof Ve=="object"&&Ve.pointAtCenter,autoAdjustOverflow:xt,offset:ye.marginXXS,arrowWidth:Ve?ye.sizePopupArrow:0,borderRadius:ye.borderRadius}),Rt=se.useCallback(()=>{Ie(!1)},[]),At=()=>{let rt;return Ee!=null&&Ee.items?rt=se.createElement(Fe.default,Object.assign({},Ee)):typeof Vt=="function"?rt=Vt():rt=Vt,Ge&&(rt=Ge(rt)),rt=se.Children.only(typeof rt=="string"?se.createElement("span",null,rt):rt),se.createElement(ft.J,{prefixCls:`${Xt}-menu`,expandIcon:se.createElement("span",{className:`${Xt}-menu-submenu-arrow`},se.createElement(Te.Z,{className:`${Xt}-menu-submenu-arrow-icon`})),mode:"vertical",selectable:!1,onClick:Rt,validator:Ft=>{let{mode:sn}=Ft}},rt)};return Ut(se.createElement(xe.Z,Object.assign({alignPoint:pe},(0,we.Z)($e,["rootClassName"]),{mouseEnterDelay:Ne,mouseLeaveDelay:be,visible:ce,builtinPlacements:je,arrow:!!Ve,overlayClassName:Pe,prefixCls:Xt,getPopupContainer:kt||nt,transitionName:en,trigger:he,overlay:At,placement:on,onVisibleChange:yt}),oe))};function jt($e){return Object.assign(Object.assign({},$e),{align:{overflow:{adjustX:!1,adjustY:!1}}})}const it=(0,Re.Z)(Ct,"dropdown",$e=>$e,jt),vt=$e=>se.createElement(it,Object.assign({},$e),se.createElement("span",null));Ct._InternalPanelDoNotUseOrYouWillBeFired=vt,tn.Z=Ct},47211:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return dt}});var se=ue(17313),Te=ue(13826),ze=ue(92899),ut=ue(29878),xe=ue(19447),Me=ue(83116),De=ue(37613),_e=Ae=>{const{componentCls:Fe,menuCls:ft,colorError:Ye,colorTextLightSolid:ot}=Ae,at=`${ft}-item`;return{[`${Fe}, ${Fe}-menu-submenu`]:{[`${ft} ${at}`]:{[`&${at}-danger:not(${at}-disabled)`]:{color:Ye,"&:hover":{color:ot,backgroundColor:Ye}}}}}};const Re=Ae=>{const{componentCls:Fe,menuCls:ft,zIndexPopup:Ye,dropdownArrowDistance:ot,sizePopupArrow:at,antCls:Ct,iconCls:jt,motionDurationMid:it,dropdownPaddingVertical:vt,fontSize:$e,dropdownEdgeChildPadding:Ee,colorTextDisabled:Ve,fontSizeIcon:Je,controlPaddingHorizontal:Lt,colorBgElevated:et}=Ae;return[{[Fe]:Object.assign(Object.assign({},(0,se.Wf)(Ae)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:Ye,display:"block","&::before":{position:"absolute",insetBlock:-ot+at/2,zIndex:-9999,opacity:1e-4,content:'""'},[`&-trigger${Ct}-btn`]:{[`& > ${jt}-down, & > ${Ct}-btn-icon > ${jt}-down`]:{fontSize:Je}},[`${Fe}-wrap`]:{position:"relative",[`${Ct}-btn > ${jt}-down`]:{fontSize:Je},[`${jt}-down::before`]:{transition:`transform ${it}`}},[`${Fe}-wrap-open`]:{[`${jt}-down::before`]:{transform:"rotate(180deg)"}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:"none"},[`&${Ct}-slide-down-enter${Ct}-slide-down-enter-active${Fe}-placement-bottomLeft,
&${Ct}-slide-down-appear${Ct}-slide-down-appear-active${Fe}-placement-bottomLeft,
&${Ct}-slide-down-enter${Ct}-slide-down-enter-active${Fe}-placement-bottom,
&${Ct}-slide-down-appear${Ct}-slide-down-appear-active${Fe}-placement-bottom,
&${Ct}-slide-down-enter${Ct}-slide-down-enter-active${Fe}-placement-bottomRight,
&${Ct}-slide-down-appear${Ct}-slide-down-appear-active${Fe}-placement-bottomRight`]:{animationName:Te.fJ},[`&${Ct}-slide-up-enter${Ct}-slide-up-enter-active${Fe}-placement-topLeft,
&${Ct}-slide-up-appear${Ct}-slide-up-appear-active${Fe}-placement-topLeft,
&${Ct}-slide-up-enter${Ct}-slide-up-enter-active${Fe}-placement-top,
&${Ct}-slide-up-appear${Ct}-slide-up-appear-active${Fe}-placement-top,
&${Ct}-slide-up-enter${Ct}-slide-up-enter-active${Fe}-placement-topRight,
&${Ct}-slide-up-appear${Ct}-slide-up-appear-active${Fe}-placement-topRight`]:{animationName:Te.Qt},[`&${Ct}-slide-down-leave${Ct}-slide-down-leave-active${Fe}-placement-bottomLeft,
&${Ct}-slide-down-leave${Ct}-slide-down-leave-active${Fe}-placement-bottom,
&${Ct}-slide-down-leave${Ct}-slide-down-leave-active${Fe}-placement-bottomRight`]:{animationName:Te.Uw},[`&${Ct}-slide-up-leave${Ct}-slide-up-leave-active${Fe}-placement-topLeft,
&${Ct}-slide-up-leave${Ct}-slide-up-leave-active${Fe}-placement-top,
&${Ct}-slide-up-leave${Ct}-slide-up-leave-active${Fe}-placement-topRight`]:{animationName:Te.ly}})},(0,xe.ZP)(Ae,{colorBg:et,limitVerticalRadius:!0,arrowPlacement:{top:!0,bottom:!0}}),{[`${Fe} ${ft}`]:{position:"relative",margin:0},[`${ft}-submenu-popup`]:{position:"absolute",zIndex:Ye,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},[`${Fe}, ${Fe}-menu-submenu`]:{[ft]:Object.assign(Object.assign({padding:Ee,listStyleType:"none",backgroundColor:et,backgroundClip:"padding-box",borderRadius:Ae.borderRadiusLG,outline:"none",boxShadow:Ae.boxShadowSecondary},(0,se.Qy)(Ae)),{[`${ft}-item-group-title`]:{padding:`${vt}px ${Lt}px`,color:Ae.colorTextDescription,transition:`all ${it}`},[`${ft}-item`]:{position:"relative",display:"flex",alignItems:"center"},[`${ft}-item-icon`]:{minWidth:$e,marginInlineEnd:Ae.marginXS,fontSize:Ae.fontSizeSM},[`${ft}-title-content`]:{flex:"auto","> a":{color:"inherit",transition:`all ${it}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}}},[`${ft}-item, ${ft}-submenu-title`]:Object.assign(Object.assign({clear:"both",margin:0,padding:`${vt}px ${Lt}px`,color:Ae.colorText,fontWeight:"normal",fontSize:$e,lineHeight:Ae.lineHeight,cursor:"pointer",transition:`all ${it}`,borderRadius:Ae.borderRadiusSM,"&:hover, &-active":{backgroundColor:Ae.controlItemBgHover}},(0,se.Qy)(Ae)),{"&-selected":{color:Ae.colorPrimary,backgroundColor:Ae.controlItemBgActive,"&:hover, &-active":{backgroundColor:Ae.controlItemBgActiveHover}},"&-disabled":{color:Ve,cursor:"not-allowed","&:hover":{color:Ve,backgroundColor:et,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${Ae.marginXXS}px 0`,overflow:"hidden",lineHeight:0,backgroundColor:Ae.colorSplit},[`${Fe}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:Ae.paddingXS,[`${Fe}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:Ae.colorTextDescription,fontSize:Je,fontStyle:"normal"}}}),[`${ft}-item-group-list`]:{margin:`0 ${Ae.marginXS}px`,padding:0,listStyle:"none"},[`${ft}-submenu-title`]:{paddingInlineEnd:Lt+Ae.fontSizeSM},[`${ft}-submenu-vertical`]:{position:"relative"},[`${ft}-submenu${ft}-submenu-disabled ${Fe}-menu-submenu-title`]:{[`&, ${Fe}-menu-submenu-arrow-icon`]:{color:Ve,backgroundColor:et,cursor:"not-allowed"}},[`${ft}-submenu-selected ${Fe}-menu-submenu-title`]:{color:Ae.colorPrimary}})}},[(0,Te.oN)(Ae,"slide-up"),(0,Te.oN)(Ae,"slide-down"),(0,ze.Fm)(Ae,"move-up"),(0,ze.Fm)(Ae,"move-down"),(0,ut._y)(Ae,"zoom-big")]]};var dt=(0,Me.Z)("Dropdown",(Ae,Fe)=>{let{rootPrefixCls:ft}=Fe;const{marginXXS:Ye,sizePopupArrow:ot,controlHeight:at,fontSize:Ct,lineHeight:jt,paddingXXS:it,componentCls:vt,borderRadiusLG:$e}=Ae,Ee=(at-Ct*jt)/2,{dropdownArrowOffset:Ve}=(0,xe.fS)({contentRadius:$e}),Je=(0,De.TS)(Ae,{menuCls:`${vt}-menu`,rootPrefixCls:ft,dropdownArrowDistance:ot/2+Ye,dropdownArrowOffset:Ve,dropdownPaddingVertical:Ee,dropdownEdgeChildPadding:it});return[Re(Je),_e(Je)]},Ae=>({zIndexPopup:Ae.zIndexPopupBase+50}))},64165:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return it}});var se=ue(92310),Te=ue.n(se),ze=ue(59301),ut=ue(36355),xe=ue(9763),Me=ue(64993),De=ue(88088),_e=()=>{const[,vt]=(0,De.Z)(),Ee=new Me.C(vt.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return ze.createElement("svg",{style:Ee,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},ze.createElement("g",{fill:"none",fillRule:"evenodd"},ze.createElement("g",{transform:"translate(24 31.67)"},ze.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),ze.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"}),ze.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)"}),ze.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"}),ze.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"})),ze.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"}),ze.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},ze.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),ze.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},dt=()=>{const[,vt]=(0,De.Z)(),{colorFill:$e,colorFillTertiary:Ee,colorFillQuaternary:Ve,colorBgContainer:Je}=vt,{borderColor:Lt,shadowColor:et,contentColor:Dt}=(0,ze.useMemo)(()=>({borderColor:new Me.C($e).onBackground(Je).toHexShortString(),shadowColor:new Me.C(Ee).onBackground(Je).toHexShortString(),contentColor:new Me.C(Ve).onBackground(Je).toHexShortString()}),[$e,Ee,Ve,Je]);return ze.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},ze.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},ze.createElement("ellipse",{fill:et,cx:"32",cy:"33",rx:"32",ry:"7"}),ze.createElement("g",{fillRule:"nonzero",stroke:Lt},ze.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"}),ze.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:Dt}))))},Ae=ue(83116),Fe=ue(37613);const ft=vt=>{const{componentCls:$e,margin:Ee,marginXS:Ve,marginXL:Je,fontSize:Lt,lineHeight:et}=vt;return{[$e]:{marginInline:Ve,fontSize:Lt,lineHeight:et,textAlign:"center",[`${$e}-image`]:{height:vt.emptyImgHeight,marginBottom:Ve,opacity:vt.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${$e}-description`]:{color:vt.colorText},[`${$e}-footer`]:{marginTop:Ee},"&-normal":{marginBlock:Je,color:vt.colorTextDisabled,[`${$e}-description`]:{color:vt.colorTextDisabled},[`${$e}-image`]:{height:vt.emptyImgHeightMD}},"&-small":{marginBlock:Ve,color:vt.colorTextDisabled,[`${$e}-image`]:{height:vt.emptyImgHeightSM}}}}};var Ye=(0,Ae.Z)("Empty",vt=>{const{componentCls:$e,controlHeightLG:Ee}=vt,Ve=(0,Fe.TS)(vt,{emptyImgCls:`${$e}-img`,emptyImgHeight:Ee*2.5,emptyImgHeightMD:Ee,emptyImgHeightSM:Ee*.875});return[ft(Ve)]}),ot=function(vt,$e){var Ee={};for(var Ve in vt)Object.prototype.hasOwnProperty.call(vt,Ve)&&$e.indexOf(Ve)<0&&(Ee[Ve]=vt[Ve]);if(vt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Je=0,Ve=Object.getOwnPropertySymbols(vt);Je<Ve.length;Je++)$e.indexOf(Ve[Je])<0&&Object.prototype.propertyIsEnumerable.call(vt,Ve[Je])&&(Ee[Ve[Je]]=vt[Ve[Je]]);return Ee};const at=ze.createElement(_e,null),Ct=ze.createElement(dt,null),jt=vt=>{var{className:$e,rootClassName:Ee,prefixCls:Ve,image:Je=at,description:Lt,children:et,imageStyle:Dt,style:Ge}=vt,kt=ot(vt,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);const{getPrefixCls:tt,direction:$t,empty:pt}=ze.useContext(ut.E_),Bt=tt("empty",Ve),[Tt,wt]=Ye(Bt),[Ne]=(0,xe.Z)("Empty"),be=typeof Lt!="undefined"?Lt:Ne==null?void 0:Ne.description,xt=typeof be=="string"?be:"empty";let Qt=null;return typeof Je=="string"?Qt=ze.createElement("img",{alt:xt,src:Je}):Qt=Je,Tt(ze.createElement("div",Object.assign({className:Te()(wt,Bt,pt==null?void 0:pt.className,{[`${Bt}-normal`]:Je===Ct,[`${Bt}-rtl`]:$t==="rtl"},$e,Ee),style:Object.assign(Object.assign({},pt==null?void 0:pt.style),Ge)},kt),ze.createElement("div",{className:`${Bt}-image`,style:Dt},Qt),be&&ze.createElement("div",{className:`${Bt}-description`},be),et&&ze.createElement("div",{className:`${Bt}-footer`},et)))};jt.PRESENTED_IMAGE_DEFAULT=at,jt.PRESENTED_IMAGE_SIMPLE=Ct;var it=jt},78241:function(bn,tn,ue){"use strict";ue.d(tn,{default:function(){return Er}});var se=ue(77654),Te=ue(92310),ze=ue.n(Te),ut=ue(77900),xe=ue(59301),Me=ue(62892),De=ue(32441);function we(St){const[Le,We]=xe.useState(St);return xe.useEffect(()=>{const Be=setTimeout(()=>{We(St)},St.length?0:10);return()=>{clearTimeout(Be)}},[St]),Le}var _e=ue(17313),Re=ue(29878),dt=ue(8378),Ae=ue(37613),Fe=ue(83116),Ye=St=>{const{componentCls:Le}=St,We=`${Le}-show-help`,Be=`${Le}-show-help-item`;return{[We]:{transition:`opacity ${St.motionDurationSlow} ${St.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[Be]:{overflow:"hidden",transition:`height ${St.motionDurationSlow} ${St.motionEaseInOut},
opacity ${St.motionDurationSlow} ${St.motionEaseInOut},
transform ${St.motionDurationSlow} ${St.motionEaseInOut} !important`,[`&${Be}-appear, &${Be}-enter`]:{transform:"translateY(-5px)",opacity:0,"&-active":{transform:"translateY(0)",opacity:1}},[`&${Be}-leave-active`]:{transform:"translateY(-5px)"}}}}};const ot=St=>({legend:{display:"block",width:"100%",marginBottom:St.marginLG,padding:0,color:St.colorTextDescription,fontSize:St.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:`${St.lineWidth}px ${St.lineType} ${St.colorBorder}`},label:{fontSize:St.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 ${St.controlOutlineWidth}px ${St.controlOutline}`},output:{display:"block",paddingTop:15,color:St.colorText,fontSize:St.fontSize,lineHeight:St.lineHeight}}),at=(St,Le)=>{const{formItemCls:We}=St;return{[We]:{[`${We}-label > label`]:{height:Le},[`${We}-control-input`]:{minHeight:Le}}}},Ct=St=>{const{componentCls:Le}=St;return{[St.componentCls]:Object.assign(Object.assign(Object.assign({},(0,_e.Wf)(St)),ot(St)),{[`${Le}-text`]:{display:"inline-block",paddingInlineEnd:St.paddingSM},"&-small":Object.assign({},at(St,St.controlHeightSM)),"&-large":Object.assign({},at(St,St.controlHeightLG))})}},jt=St=>{const{formItemCls:Le,iconCls:We,componentCls:Be,rootPrefixCls:Oe,labelRequiredMarkColor:lt,labelColor:_t,labelFontSize:Yt,labelHeight:Kt,labelColonMarginInlineStart:Jt,labelColonMarginInlineEnd:un,itemMarginBottom:fn}=St;return{[Le]:Object.assign(Object.assign({},(0,_e.Wf)(St)),{marginBottom:fn,verticalAlign:"top","&-with-help":{transition:"none"},[`&-hidden,
&-hidden.${Oe}-row`]:{display:"none"},"&-has-warning":{[`${Le}-split`]:{color:St.colorError}},"&-has-error":{[`${Le}-split`]:{color:St.colorWarning}},[`${Le}-label`]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:`${St.lineHeight} - 0.25em`,whiteSpace:"unset"},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:Kt,color:_t,fontSize:Yt,[`> ${We}`]:{fontSize:St.fontSize,verticalAlign:"top"},[`&${Le}-required:not(${Le}-required-mark-optional)::before`]:{display:"inline-block",marginInlineEnd:St.marginXXS,color:lt,fontSize:St.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"',[`${Be}-hide-required-mark &`]:{display:"none"}},[`${Le}-optional`]:{display:"inline-block",marginInlineStart:St.marginXXS,color:St.colorTextDescription,[`${Be}-hide-required-mark &`]:{display:"none"}},[`${Le}-tooltip`]:{color:St.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:St.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:Jt,marginInlineEnd:un},[`&${Le}-no-colon::after`]:{content:'"\\a0"'}}},[`${Le}-control`]:{"--ant-display":"flex",flexDirection:"column",flexGrow:1,[`&:first-child:not([class^="'${Oe}-col-'"]):not([class*="' ${Oe}-col-'"])`]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:St.controlHeight,"&-content":{flex:"auto",maxWidth:"100%"}}},[Le]:{"&-explain, &-extra":{clear:"both",color:St.colorTextDescription,fontSize:St.fontSize,lineHeight:St.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:St.controlHeightSM,transition:`color ${St.motionDurationMid} ${St.motionEaseOut}`},"&-explain":{"&-error":{color:St.colorError},"&-warning":{color:St.colorWarning}}},[`&-with-help ${Le}-explain`]:{height:"auto",opacity:1},[`${Le}-feedback-icon`]:{fontSize:St.fontSize,textAlign:"center",visibility:"visible",animationName:Re.kr,animationDuration:St.motionDurationMid,animationTimingFunction:St.motionEaseOutBack,pointerEvents:"none","&-success":{color:St.colorSuccess},"&-error":{color:St.colorError},"&-warning":{color:St.colorWarning},"&-validating":{color:St.colorPrimary}}})}},it=St=>{const{componentCls:Le,formItemCls:We}=St;return{[`${Le}-horizontal`]:{[`${We}-label`]:{flexGrow:0},[`${We}-control`]:{flex:"1 1 0",minWidth:0},[`${We}-label[class$='-24'], ${We}-label[class*='-24 ']`]:{[`& + ${We}-control`]:{minWidth:"unset"}}}}},vt=St=>{const{componentCls:Le,formItemCls:We}=St;return{[`${Le}-inline`]:{display:"flex",flexWrap:"wrap",[We]:{flex:"none",marginInlineEnd:St.margin,marginBottom:0,"&-row":{flexWrap:"nowrap"},[`> ${We}-label,
> ${We}-control`]:{display:"inline-block",verticalAlign:"top"},[`> ${We}-label`]:{flex:"none"},[`${Le}-text`]:{display:"inline-block"},[`${We}-has-feedback`]:{display:"inline-block"}}}}},$e=St=>({padding:St.verticalLabelPadding,margin:St.verticalLabelMargin,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{visibility:"hidden"}}}),Ee=St=>{const{componentCls:Le,formItemCls:We,rootPrefixCls:Be}=St;return{[`${We} ${We}-label`]:$e(St),[Le]:{[We]:{flexWrap:"wrap",[`${We}-label, ${We}-control`]:{[`&:not([class*=" ${Be}-col-xs"])`]:{flex:"0 0 100%",maxWidth:"100%"}}}}}},Ve=St=>{const{componentCls:Le,formItemCls:We,rootPrefixCls:Be}=St;return{[`${Le}-vertical`]:{[We]:{"&-row":{flexDirection:"column"},"&-label > label":{height:"auto"},[`${Le}-item-control`]:{width:"100%"}}},[`${Le}-vertical ${We}-label,
.${Be}-col-24${We}-label,
.${Be}-col-xl-24${We}-label`]:$e(St),[`@media (max-width: ${St.screenXSMax}px)`]:[Ee(St),{[Le]:{[`.${Be}-col-xs-24${We}-label`]:$e(St)}}],[`@media (max-width: ${St.screenSMMax}px)`]:{[Le]:{[`.${Be}-col-sm-24${We}-label`]:$e(St)}},[`@media (max-width: ${St.screenMDMax}px)`]:{[Le]:{[`.${Be}-col-md-24${We}-label`]:$e(St)}},[`@media (max-width: ${St.screenLGMax}px)`]:{[Le]:{[`.${Be}-col-lg-24${We}-label`]:$e(St)}}}},Je=(St,Le)=>(0,Ae.TS)(St,{formItemCls:`${St.componentCls}-item`,rootPrefixCls:Le});var Lt=(0,Fe.Z)("Form",(St,Le)=>{let{rootPrefixCls:We}=Le;const Be=Je(St,We);return[Ct(Be),jt(Be),Ye(Be),it(Be),vt(Be),Ve(Be),(0,dt.Z)(Be),Re.kr]},St=>({labelRequiredMarkColor:St.colorError,labelColor:St.colorTextHeading,labelFontSize:St.fontSize,labelHeight:St.controlHeight,labelColonMarginInlineStart:St.marginXXS/2,labelColonMarginInlineEnd:St.marginXS,itemMarginBottom:St.marginLG,verticalLabelPadding:`0 0 ${St.paddingXS}px`,verticalLabelMargin:0}),{order:-1e3});const et=[];function Dt(St,Le,We){let Be=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return{key:typeof St=="string"?St:`${Le}-${Be}`,error:St,errorStatus:We}}var kt=St=>{let{help:Le,helpStatus:We,errors:Be=et,warnings:Oe=et,className:lt,fieldId:_t,onVisibleChanged:Yt}=St;const{prefixCls:Kt}=xe.useContext(De.Rk),Jt=`${Kt}-item-explain`,[,un]=Lt(Kt),fn=(0,xe.useMemo)(()=>(0,Me.Z)(Kt),[Kt]),xn=we(Be),zt=we(Oe),ln=xe.useMemo(()=>Le!=null?[Dt(Le,"help",We)]:[].concat((0,se.Z)(xn.map((Dn,Vn)=>Dt(Dn,"error","error",Vn))),(0,se.Z)(zt.map((Dn,Vn)=>Dt(Dn,"warning","warning",Vn)))),[Le,We,xn,zt]),jn={};return _t&&(jn.id=`${_t}_help`),xe.createElement(ut.default,{motionDeadline:fn.motionDeadline,motionName:`${Kt}-show-help`,visible:!!ln.length,onVisibleChanged:Yt},Dn=>{const{className:Vn,style:Pn}=Dn;return xe.createElement("div",Object.assign({},jn,{className:ze()(Jt,Vn,lt,un),style:Pn,role:"alert"}),xe.createElement(ut.CSSMotionList,Object.assign({keys:ln},(0,Me.Z)(Kt),{motionName:`${Kt}-show-help-item`,component:!1}),yr=>{const{key:Sn,error:pr,errorStatus:ht,className:Ue,style:Xe}=yr;return xe.createElement("div",{key:Sn,className:ze()(Ue,{[`${Jt}-${ht}`]:ht}),style:Xe},pr)}))})},tt=ue(95013),$t=ue(36355),pt=ue(1684),Bt=ue(52946),Tt=ue(19716),wt=ue(16722);const Ne=["parentNode"],be="form_item";function xt(St){return St===void 0||St===!1?[]:Array.isArray(St)?St:[St]}function Qt(St,Le){if(!St.length)return;const We=St.join("_");return Le?`${Le}_${We}`:Ne.includes(We)?`${be}_${We}`:We}function Vt(St,Le,We,Be,Oe,lt){let _t=Be;return lt!==void 0?_t=lt:We.validating?_t="validating":St.length?_t="error":Le.length?_t="warning":(We.touched||Oe&&We.validated)&&(_t="success"),_t}function qe(St){return xt(St).join("_")}function nt(St){const[Le]=(0,tt.useForm)(),We=xe.useRef({}),Be=xe.useMemo(()=>St!=null?St:Object.assign(Object.assign({},Le),{__INTERNAL__:{itemRef:Oe=>lt=>{const _t=qe(Oe);lt?We.current[_t]=lt:delete We.current[_t]}},scrollToField:function(Oe){let lt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const _t=xt(Oe),Yt=Qt(_t,Be.__INTERNAL__.name),Kt=Yt?document.getElementById(Yt):null;Kt&&(0,wt.Z)(Kt,Object.assign({scrollMode:"if-needed",block:"nearest"},lt))},getFieldInstance:Oe=>{const lt=qe(Oe);return We.current[lt]}}),[St,Le]);return[Be]}var Ot=ue(28726),dn=function(St,Le){var We={};for(var Be in St)Object.prototype.hasOwnProperty.call(St,Be)&&Le.indexOf(Be)<0&&(We[Be]=St[Be]);if(St!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Oe=0,Be=Object.getOwnPropertySymbols(St);Oe<Be.length;Oe++)Le.indexOf(Be[Oe])<0&&Object.prototype.propertyIsEnumerable.call(St,Be[Oe])&&(We[Be[Oe]]=St[Be[Oe]]);return We};const en=(St,Le)=>{const We=xe.useContext(pt.Z),{getPrefixCls:Be,direction:Oe,form:lt}=xe.useContext($t.E_),{prefixCls:_t,className:Yt,rootClassName:Kt,size:Jt,disabled:un=We,form:fn,colon:xn,labelAlign:zt,labelWrap:ln,labelCol:jn,wrapperCol:Dn,hideRequiredMark:Vn,layout:Pn="horizontal",scrollToFirstError:yr,requiredMark:Sn,onFinishFailed:pr,name:ht,style:Ue,feedbackIcons:Xe}=St,Ze=dn(St,["prefixCls","className","rootClassName","size","disabled","form","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","style","feedbackIcons"]),gt=(0,Tt.Z)(Jt),Wt=xe.useContext(Ot.Z),Gt=(0,xe.useMemo)(()=>Sn!==void 0?Sn:lt&&lt.requiredMark!==void 0?lt.requiredMark:!Vn,[Vn,Sn,lt]),nn=xn!=null?xn:lt==null?void 0:lt.colon,Ht=Be("form",_t),[bt,Cn]=Lt(Ht),kn=ze()(Ht,`${Ht}-${Pn}`,{[`${Ht}-hide-required-mark`]:Gt===!1,[`${Ht}-rtl`]:Oe==="rtl",[`${Ht}-${gt}`]:gt},Cn,lt==null?void 0:lt.className,Yt,Kt),[Jn]=nt(fn),{__INTERNAL__:Fn}=Jn;Fn.name=ht;const Nn=(0,xe.useMemo)(()=>({name:ht,labelAlign:zt,labelCol:jn,labelWrap:ln,wrapperCol:Dn,vertical:Pn==="vertical",colon:nn,requiredMark:Gt,itemRef:Fn.itemRef,form:Jn,feedbackIcons:Xe}),[ht,zt,jn,Dn,Pn,nn,Gt,Jn,Xe]);xe.useImperativeHandle(Le,()=>Jn);const _n=(Xn,In)=>{if(Xn){let zn={block:"nearest"};typeof Xn=="object"&&(zn=Xn),Jn.scrollToField(In,zn)}},tr=Xn=>{if(pr==null||pr(Xn),Xn.errorFields.length){const In=Xn.errorFields[0].name;if(yr!==void 0){_n(yr,In);return}lt&&lt.scrollToFirstError!==void 0&&_n(lt.scrollToFirstError,In)}};return bt(xe.createElement(pt.n,{disabled:un},xe.createElement(Bt.q,{size:gt},xe.createElement(De.RV,Object.assign({},{validateMessages:Wt}),xe.createElement(De.q3.Provider,{value:Nn},xe.createElement(tt.default,Object.assign({id:ht},Ze,{name:ht,onFinishFailed:tr,form:Jn,style:Object.assign(Object.assign({},lt==null?void 0:lt.style),Ue),className:kn})))))))};var Xt=xe.forwardRef(en),Ut=ue(41799),Zt=ue(8654),ye=ue(92343),le=ue(11592);function oe(St){if(typeof St=="function")return St;const Le=(0,le.Z)(St);return Le.length<=1?Le[0]:Le}const he=()=>{const{status:St,errors:Le=[],warnings:We=[]}=(0,xe.useContext)(De.aM);return{status:St,errors:Le,warnings:We}};he.Context=De.aM;var pe=he,ce=ue(16089);function Ie(St){const[Le,We]=xe.useState(St),Be=(0,xe.useRef)(null),Oe=(0,xe.useRef)([]),lt=(0,xe.useRef)(!1);xe.useEffect(()=>(lt.current=!1,()=>{lt.current=!0,ce.Z.cancel(Be.current),Be.current=null}),[]);function _t(Yt){lt.current||(Be.current===null&&(Oe.current=[],Be.current=(0,ce.Z)(()=>{Be.current=null,We(Kt=>{let Jt=Kt;return Oe.current.forEach(un=>{Jt=un(Jt)}),Jt})})),Oe.current.push(Yt))}return[Le,_t]}function yt(){const{itemRef:St}=xe.useContext(De.q3),Le=xe.useRef({});function We(Be,Oe){const lt=Oe&&typeof Oe=="object"&&Oe.ref,_t=Be.join("_");return(Le.current.name!==_t||Le.current.originRef!==lt)&&(Le.current.name=_t,Le.current.originRef=lt,Le.current.ref=(0,Zt.sQ)(St(Be),lt)),Le.current.ref}return We}var Pe=ue(29194),je=ue(34280),Rt=ue(2738),At=ue(27382),rt=ue(37028);const Ft=St=>{const{formItemCls:Le}=St;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${Le}-control`]:{display:"flex"}}}};var sn=(0,Fe.b)(["Form","item-item"],(St,Le)=>{let{rootPrefixCls:We}=Le;const Be=Je(St,We);return[Ft(Be)]}),qt=St=>{const{prefixCls:Le,status:We,wrapperCol:Be,children:Oe,errors:lt,warnings:_t,_internalItemRender:Yt,extra:Kt,help:Jt,fieldId:un,marginBottom:fn,onErrorVisibleChanged:xn}=St,zt=`${Le}-item`,ln=xe.useContext(De.q3),jn=Be||ln.wrapperCol||{},Dn=ze()(`${zt}-control`,jn.className),Vn=xe.useMemo(()=>Object.assign({},ln),[ln]);delete Vn.labelCol,delete Vn.wrapperCol;const Pn=xe.createElement("div",{className:`${zt}-control-input`},xe.createElement("div",{className:`${zt}-control-input-content`},Oe)),yr=xe.useMemo(()=>({prefixCls:Le,status:We}),[Le,We]),Sn=fn!==null||lt.length||_t.length?xe.createElement("div",{style:{display:"flex",flexWrap:"nowrap"}},xe.createElement(De.Rk.Provider,{value:yr},xe.createElement(kt,{fieldId:un,errors:lt,warnings:_t,help:Jt,helpStatus:We,className:`${zt}-explain-connected`,onVisibleChanged:xn})),!!fn&&xe.createElement("div",{style:{width:0,height:fn}})):null,pr={};un&&(pr.id=`${un}_extra`);const ht=Kt?xe.createElement("div",Object.assign({},pr,{className:`${zt}-extra`}),Kt):null,Ue=Yt&&Yt.mark==="pro_table_render"&&Yt.render?Yt.render(St,{input:Pn,errorList:Sn,extra:ht}):xe.createElement(xe.Fragment,null,Pn,Sn,ht);return xe.createElement(De.q3.Provider,{value:Vn},xe.createElement(rt.Z,Object.assign({},jn,{className:Dn}),Ue),xe.createElement(sn,{prefixCls:Le}))},an=ue(61485),Qe=ue(31724),mt=ue(9763),Nt=ue(6848),vn=function(St,Le){var We={};for(var Be in St)Object.prototype.hasOwnProperty.call(St,Be)&&Le.indexOf(Be)<0&&(We[Be]=St[Be]);if(St!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Oe=0,Be=Object.getOwnPropertySymbols(St);Oe<Be.length;Oe++)Le.indexOf(Be[Oe])<0&&Object.prototype.propertyIsEnumerable.call(St,Be[Oe])&&(We[Be[Oe]]=St[Be[Oe]]);return We};function mn(St){return St?typeof St=="object"&&!xe.isValidElement(St)?St:{title:St}:null}var Tn=St=>{let{prefixCls:Le,label:We,htmlFor:Be,labelCol:Oe,labelAlign:lt,colon:_t,required:Yt,requiredMark:Kt,tooltip:Jt}=St;var un;const[fn]=(0,mt.Z)("Form"),{vertical:xn,labelAlign:zt,labelCol:ln,labelWrap:jn,colon:Dn}=xe.useContext(De.q3);if(!We)return null;const Vn=Oe||ln||{},Pn=lt||zt,yr=`${Le}-item-label`,Sn=ze()(yr,Pn==="left"&&`${yr}-left`,Vn.className,{[`${yr}-wrap`]:!!jn});let pr=We;const ht=_t===!0||Dn!==!1&&_t!==!1;ht&&!xn&&typeof We=="string"&&We.trim()!==""&&(pr=We.replace(/[:|]\s*$/,""));const Xe=mn(Jt);if(Xe){const{icon:Gt=xe.createElement(an.Z,null)}=Xe,nn=vn(Xe,["icon"]),Ht=xe.createElement(Nt.Z,Object.assign({},nn),xe.cloneElement(Gt,{className:`${Le}-item-tooltip`,title:""}));pr=xe.createElement(xe.Fragment,null,pr,Ht)}const Ze=Kt==="optional",gt=typeof Kt=="function";gt?pr=Kt(pr,{required:!!Yt}):Ze&&!Yt&&(pr=xe.createElement(xe.Fragment,null,pr,xe.createElement("span",{className:`${Le}-item-optional`,title:""},(fn==null?void 0:fn.optional)||((un=Qe.Z.Form)===null||un===void 0?void 0:un.optional))));const Wt=ze()({[`${Le}-item-required`]:Yt,[`${Le}-item-required-mark-optional`]:Ze||gt,[`${Le}-item-no-colon`]:!ht});return xe.createElement(rt.Z,Object.assign({},Vn,{className:Sn}),xe.createElement("label",{htmlFor:Be,className:Wt,title:typeof We=="string"?We:""},pr))},Zn=ue(29679),Hn=ue(19248),wr=ue(96512),Cr=ue(58617);const Yn={success:Zn.Z,warning:wr.Z,error:Hn.Z,validating:Cr.Z};function Nr(St){let{children:Le,errors:We,warnings:Be,hasFeedback:Oe,validateStatus:lt,prefixCls:_t,meta:Yt,noStyle:Kt}=St;const Jt=`${_t}-item`,{feedbackIcons:un}=xe.useContext(De.q3),fn=Vt(We,Be,Yt,null,!!Oe,lt),{isFormItemInput:xn,status:zt}=xe.useContext(De.aM),ln=xe.useMemo(()=>{var jn;let Dn;if(Oe){const yr=Oe!==!0&&Oe.icons||un,Sn=fn&&((jn=yr==null?void 0:yr({status:fn,errors:We,warnings:Be}))===null||jn===void 0?void 0:jn[fn]),pr=fn&&Yn[fn];Dn=Sn!==!1&&pr?xe.createElement("span",{className:ze()(`${Jt}-feedback-icon`,`${Jt}-feedback-icon-${fn}`)},Sn||xe.createElement(pr,null)):null}let Vn=!0,Pn=fn||"";return Kt&&(Vn=xn,Pn=(fn!=null?fn:zt)||""),{status:Pn,errors:We,warnings:Be,hasFeedback:!!Oe,feedbackIcon:Dn,isFormItemInput:Vn}},[fn,Oe,Kt,xn,zt]);return xe.createElement(De.aM.Provider,{value:ln},Le)}var Kr=function(St,Le){var We={};for(var Be in St)Object.prototype.hasOwnProperty.call(St,Be)&&Le.indexOf(Be)<0&&(We[Be]=St[Be]);if(St!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Oe=0,Be=Object.getOwnPropertySymbols(St);Oe<Be.length;Oe++)Le.indexOf(Be[Oe])<0&&Object.prototype.propertyIsEnumerable.call(St,Be[Oe])&&(We[Be[Oe]]=St[Be[Oe]]);return We};function Or(St){const{prefixCls:Le,className:We,rootClassName:Be,style:Oe,help:lt,errors:_t,warnings:Yt,validateStatus:Kt,meta:Jt,hasFeedback:un,hidden:fn,children:xn,fieldId:zt,required:ln,isRequired:jn,onSubItemMetaChange:Dn}=St,Vn=Kr(St,["prefixCls","className","rootClassName","style","help","errors","warnings","validateStatus","meta","hasFeedback","hidden","children","fieldId","required","isRequired","onSubItemMetaChange"]),Pn=`${Le}-item`,{requiredMark:yr}=xe.useContext(De.q3),Sn=xe.useRef(null),pr=we(_t),ht=we(Yt),Ue=lt!=null,Xe=!!(Ue||_t.length||Yt.length),Ze=!!Sn.current&&(0,Pe.Z)(Sn.current),[gt,Wt]=xe.useState(null);(0,je.Z)(()=>{if(Xe&&Sn.current){const Cn=getComputedStyle(Sn.current);Wt(parseInt(Cn.marginBottom,10))}},[Xe,Ze]);const Gt=Cn=>{Cn||Wt(null)},Ht=function(){let Cn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const kn=Cn?pr:Jt.errors,Jn=Cn?ht:Jt.warnings;return Vt(kn,Jn,Jt,"",!!un,Kt)}(),bt=ze()(Pn,We,Be,{[`${Pn}-with-help`]:Ue||pr.length||ht.length,[`${Pn}-has-feedback`]:Ht&&un,[`${Pn}-has-success`]:Ht==="success",[`${Pn}-has-warning`]:Ht==="warning",[`${Pn}-has-error`]:Ht==="error",[`${Pn}-is-validating`]:Ht==="validating",[`${Pn}-hidden`]:fn});return xe.createElement("div",{className:bt,style:Oe,ref:Sn},xe.createElement(At.Z,Object.assign({className:`${Pn}-row`},(0,Rt.Z)(Vn,["_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"])),xe.createElement(Tn,Object.assign({htmlFor:zt},St,{requiredMark:yr,required:ln!=null?ln:jn,prefixCls:Le})),xe.createElement(qt,Object.assign({},St,Jt,{errors:pr,warnings:ht,prefixCls:Le,status:Ht,help:lt,marginBottom:gt,onErrorVisibleChanged:Gt}),xe.createElement(De.qI.Provider,{value:Dn},xe.createElement(Nr,{prefixCls:Le,meta:Jt,errors:Jt.errors,warnings:Jt.warnings,hasFeedback:un,validateStatus:Ht},xn)))),!!gt&&xe.createElement("div",{className:`${Pn}-margin-offset`,style:{marginBottom:-gt}}))}const Ar="__SPLIT__",kr=null,Gr=xe.memo(St=>{let{children:Le}=St;return Le},(St,Le)=>St.value===Le.value&&St.update===Le.update&&St.childProps.length===Le.childProps.length&&St.childProps.every((We,Be)=>We===Le.childProps[Be]));function ar(St){return St!=null}function $r(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}function Ur(St){const{name:Le,noStyle:We,className:Be,dependencies:Oe,prefixCls:lt,shouldUpdate:_t,rules:Yt,children:Kt,required:Jt,label:un,messageVariables:fn,trigger:xn="onChange",validateTrigger:zt,hidden:ln,help:jn}=St,{getPrefixCls:Dn}=xe.useContext($t.E_),{name:Vn}=xe.useContext(De.q3),Pn=oe(Kt),yr=typeof Pn=="function",Sn=xe.useContext(De.qI),{validateTrigger:pr}=xe.useContext(tt.FieldContext),ht=zt!==void 0?zt:pr,Ue=ar(Le),Xe=Dn("form",lt),[Ze,gt]=Lt(Xe),Wt=xe.useContext(tt.ListContext),Gt=xe.useRef(),[nn,Ht]=Ie({}),[bt,Cn]=(0,Ut.Z)(()=>$r()),kn=In=>{const zn=Wt==null?void 0:Wt.getKey(In.name);if(Cn(In.destroy?$r():In,!0),We&&jn!==!1&&Sn){let cr=In.name;if(In.destroy)cr=Gt.current||cr;else if(zn!==void 0){const[qn,br]=zn;cr=[qn].concat((0,se.Z)(br)),Gt.current=cr}Sn(In,cr)}},Jn=(In,zn)=>{Ht(cr=>{const qn=Object.assign({},cr),Br=[].concat((0,se.Z)(In.name.slice(0,-1)),(0,se.Z)(zn)).join(Ar);return In.destroy?delete qn[Br]:qn[Br]=In,qn})},[Fn,Nn]=xe.useMemo(()=>{const In=(0,se.Z)(bt.errors),zn=(0,se.Z)(bt.warnings);return Object.values(nn).forEach(cr=>{In.push.apply(In,(0,se.Z)(cr.errors||[])),zn.push.apply(zn,(0,se.Z)(cr.warnings||[]))}),[In,zn]},[nn,bt.errors,bt.warnings]),_n=yt();function tr(In,zn,cr){return We&&!ln?xe.createElement(Nr,{prefixCls:Xe,hasFeedback:St.hasFeedback,validateStatus:St.validateStatus,meta:bt,errors:Fn,warnings:Nn,noStyle:!0},In):xe.createElement(Or,Object.assign({key:"row"},St,{className:ze()(Be,gt),prefixCls:Xe,fieldId:zn,isRequired:cr,errors:Fn,warnings:Nn,meta:bt,onSubItemMetaChange:Jn}),In)}if(!Ue&&!yr&&!Oe)return Ze(tr(Pn));let Xn={};return typeof un=="string"?Xn.label=un:Le&&(Xn.label=String(Le)),fn&&(Xn=Object.assign(Object.assign({},Xn),fn)),Ze(xe.createElement(tt.Field,Object.assign({},St,{messageVariables:Xn,trigger:xn,validateTrigger:ht,onMetaChange:kn}),(In,zn,cr)=>{const qn=xt(Le).length&&zn?zn.name:[],br=Qt(qn,Vn),Br=Jt!==void 0?Jt:!!(Yt&&Yt.some(hn=>{if(hn&&typeof hn=="object"&&hn.required&&!hn.warningOnly)return!0;if(typeof hn=="function"){const En=hn(cr);return En&&En.required&&!En.warningOnly}return!1})),rr=Object.assign({},In);let yn=null;if(Array.isArray(Pn)&&Ue)yn=Pn;else if(!(yr&&(!(_t||Oe)||Ue))){if(!(Oe&&!yr&&!Ue))if((0,ye.l$)(Pn)){const hn=Object.assign(Object.assign({},Pn.props),rr);if(hn.id||(hn.id=br),jn||Fn.length>0||Nn.length>0||St.extra){const Rn=[];(jn||Fn.length>0)&&Rn.push(`${br}_help`),St.extra&&Rn.push(`${br}_extra`),hn["aria-describedby"]=Rn.join(" ")}Fn.length>0&&(hn["aria-invalid"]="true"),Br&&(hn["aria-required"]="true"),(0,Zt.Yr)(Pn)&&(hn.ref=_n(qn,Pn)),new Set([].concat((0,se.Z)(xt(xn)),(0,se.Z)(xt(ht)))).forEach(Rn=>{hn[Rn]=function(){for(var Mn,er,vr,Dr,ei,$n=arguments.length,Kn=new Array($n),Gn=0;Gn<$n;Gn++)Kn[Gn]=arguments[Gn];(vr=rr[Rn])===null||vr===void 0||(Mn=vr).call.apply(Mn,[rr].concat(Kn)),(ei=(Dr=Pn.props)[Rn])===null||ei===void 0||(er=ei).call.apply(er,[Dr].concat(Kn))}});const Qn=[hn["aria-required"],hn["aria-invalid"],hn["aria-describedby"]];yn=xe.createElement(Gr,{value:rr[St.valuePropName||"value"],update:Pn,childProps:Qn},(0,ye.Tm)(Pn,hn))}else yr&&(_t||Oe)&&!Ue?yn=Pn(cr):yn=Pn}return tr(yn,br,Br)}))}const Vr=Ur;Vr.useStatus=pe;var Yr=Vr,Zr=function(St,Le){var We={};for(var Be in St)Object.prototype.hasOwnProperty.call(St,Be)&&Le.indexOf(Be)<0&&(We[Be]=St[Be]);if(St!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Oe=0,Be=Object.getOwnPropertySymbols(St);Oe<Be.length;Oe++)Le.indexOf(Be[Oe])<0&&Object.prototype.propertyIsEnumerable.call(St,Be[Oe])&&(We[Be[Oe]]=St[Be[Oe]]);return We},_r=St=>{var{prefixCls:Le,children:We}=St,Be=Zr(St,["prefixCls","children"]);const{getPrefixCls:Oe}=xe.useContext($t.E_),lt=Oe("form",Le),_t=xe.useMemo(()=>({prefixCls:lt,status:"error"}),[lt]);return xe.createElement(tt.List,Object.assign({},Be),(Yt,Kt,Jt)=>xe.createElement(De.Rk.Provider,{value:_t},We(Yt.map(un=>Object.assign(Object.assign({},un),{fieldKey:un.key})),Kt,{errors:Jt.errors,warnings:Jt.warnings})))};function Ln(){const{form:St}=(0,xe.useContext)(De.q3);return St}const Wn=Xt;Wn.Item=Yr,Wn.List=_r,Wn.ErrorList=kt,Wn.useForm=nt,Wn.useFormInstance=Ln,Wn.useWatch=tt.useWatch,Wn.Provider=De.RV,Wn.create=()=>{};var Er=Wn},8628:function(bn,tn,ue){"use strict";var se=ue(59301),Te=ue(34280),ze=ue(56762),ut=ue(69507);function xe(){let Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const De=(0,se.useRef)({}),we=(0,ze.Z)(),_e=(0,ut.ZP)();return(0,Te.Z)(()=>{const Re=_e.subscribe(dt=>{De.current=dt,Me&&we()});return()=>_e.unsubscribe(Re)},[]),De.current}tn.Z=xe},5871:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return an}});var se=ue(84105),Te=ue(87395),ze=ue(92310),ut=ue.n(ze),xe=ue(60499),Me=ue(18642),De=ue(43749),we=ue(72190),_e=ue(42244),Re=ue(38705),dt=ue(17212);function Ae(){return typeof BigInt=="function"}function Fe(Qe){return!Qe&&Qe!==0&&!Number.isNaN(Qe)||!String(Qe).trim()}function ft(Qe){var mt=Qe.trim(),Nt=mt.startsWith("-");Nt&&(mt=mt.slice(1)),mt=mt.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),mt.startsWith(".")&&(mt="0".concat(mt));var vn=mt||"0",mn=vn.split("."),wn=mn[0]||"0",Tn=mn[1]||"0";wn==="0"&&Tn==="0"&&(Nt=!1);var Zn=Nt?"-":"";return{negative:Nt,negativeStr:Zn,trimStr:vn,integerStr:wn,decimalStr:Tn,fullStr:"".concat(Zn).concat(vn)}}function Ye(Qe){var mt=String(Qe);return!Number.isNaN(Number(mt))&&mt.includes("e")}function ot(Qe){var mt=String(Qe);if(Ye(Qe)){var Nt=Number(mt.slice(mt.indexOf("e-")+2)),vn=mt.match(/\.(\d+)/);return vn!=null&&vn[1]&&(Nt+=vn[1].length),Nt}return mt.includes(".")&&Ct(mt)?mt.length-mt.indexOf(".")-1:0}function at(Qe){var mt=String(Qe);if(Ye(Qe)){if(Qe>Number.MAX_SAFE_INTEGER)return String(Ae()?BigInt(Qe).toString():Number.MAX_SAFE_INTEGER);if(Qe<Number.MIN_SAFE_INTEGER)return String(Ae()?BigInt(Qe).toString():Number.MIN_SAFE_INTEGER);mt=Qe.toFixed(ot(mt))}return ft(mt).fullStr}function Ct(Qe){return typeof Qe=="number"?!Number.isNaN(Qe):Qe?/^\s*-?\d+(\.\d+)?\s*$/.test(Qe)||/^\s*-?\d+\.\s*$/.test(Qe)||/^\s*-?\.\d+\s*$/.test(Qe):!1}var jt=function(){function Qe(mt){if((0,Re.Z)(this,Qe),(0,Me.Z)(this,"origin",""),(0,Me.Z)(this,"negative",void 0),(0,Me.Z)(this,"integer",void 0),(0,Me.Z)(this,"decimal",void 0),(0,Me.Z)(this,"decimalLen",void 0),(0,Me.Z)(this,"empty",void 0),(0,Me.Z)(this,"nan",void 0),Fe(mt)){this.empty=!0;return}if(this.origin=String(mt),mt==="-"||Number.isNaN(mt)){this.nan=!0;return}var Nt=mt;if(Ye(Nt)&&(Nt=Number(Nt)),Nt=typeof Nt=="string"?Nt:at(Nt),Ct(Nt)){var vn=ft(Nt);this.negative=vn.negative;var mn=vn.trimStr.split(".");this.integer=BigInt(mn[0]);var wn=mn[1]||"0";this.decimal=BigInt(wn),this.decimalLen=wn.length}else this.nan=!0}return(0,dt.Z)(Qe,[{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(Nt){var vn="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(Nt,"0"));return BigInt(vn)}},{key:"negate",value:function(){var Nt=new Qe(this.toString());return Nt.negative=!Nt.negative,Nt}},{key:"cal",value:function(Nt,vn,mn){var wn=Math.max(this.getDecimalStr().length,Nt.getDecimalStr().length),Tn=this.alignDecimal(wn),Zn=Nt.alignDecimal(wn),Hn=vn(Tn,Zn).toString(),wr=mn(wn),Cr=ft(Hn),Yn=Cr.negativeStr,Nr=Cr.trimStr,Kr="".concat(Yn).concat(Nr.padStart(wr+1,"0"));return new Qe("".concat(Kr.slice(0,-wr),".").concat(Kr.slice(-wr)))}},{key:"add",value:function(Nt){if(this.isInvalidate())return new Qe(Nt);var vn=new Qe(Nt);return vn.isInvalidate()?this:this.cal(vn,function(mn,wn){return mn+wn},function(mn){return mn})}},{key:"multi",value:function(Nt){var vn=new Qe(Nt);return this.isInvalidate()||vn.isInvalidate()?new Qe(NaN):this.cal(vn,function(mn,wn){return mn*wn},function(mn){return mn*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(Nt){return this.toString()===(Nt==null?void 0:Nt.toString())}},{key:"lessEquals",value:function(Nt){return this.add(Nt.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var Nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return Nt?this.isInvalidate()?"":ft("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),Qe}(),it=function(){function Qe(mt){if((0,Re.Z)(this,Qe),(0,Me.Z)(this,"origin",""),(0,Me.Z)(this,"number",void 0),(0,Me.Z)(this,"empty",void 0),Fe(mt)){this.empty=!0;return}this.origin=String(mt),this.number=Number(mt)}return(0,dt.Z)(Qe,[{key:"negate",value:function(){return new Qe(-this.toNumber())}},{key:"add",value:function(Nt){if(this.isInvalidate())return new Qe(Nt);var vn=Number(Nt);if(Number.isNaN(vn))return this;var mn=this.number+vn;if(mn>Number.MAX_SAFE_INTEGER)return new Qe(Number.MAX_SAFE_INTEGER);if(mn<Number.MIN_SAFE_INTEGER)return new Qe(Number.MIN_SAFE_INTEGER);var wn=Math.max(ot(this.number),ot(vn));return new Qe(mn.toFixed(wn))}},{key:"multi",value:function(Nt){var vn=Number(Nt);if(this.isInvalidate()||Number.isNaN(vn))return new Qe(NaN);var mn=this.number*vn;if(mn>Number.MAX_SAFE_INTEGER)return new Qe(Number.MAX_SAFE_INTEGER);if(mn<Number.MIN_SAFE_INTEGER)return new Qe(Number.MIN_SAFE_INTEGER);var wn=Math.max(ot(this.number),ot(vn));return new Qe(mn.toFixed(wn))}},{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(Nt){return this.toNumber()===(Nt==null?void 0:Nt.toNumber())}},{key:"lessEquals",value:function(Nt){return this.add(Nt.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var Nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return Nt?this.isInvalidate()?"":at(this.number):this.origin}}]),Qe}();function vt(Qe){return Ae()?new jt(Qe):new it(Qe)}function $e(Qe,mt,Nt){var vn=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(Qe==="")return"";var mn=ft(Qe),wn=mn.negativeStr,Tn=mn.integerStr,Zn=mn.decimalStr,Hn="".concat(mt).concat(Zn),wr="".concat(wn).concat(Tn);if(Nt>=0){var Cr=Number(Zn[Nt]);if(Cr>=5&&!vn){var Yn=vt(Qe).add("".concat(wn,"0.").concat("0".repeat(Nt)).concat(10-Cr));return $e(Yn.toString(),mt,Nt,vn)}return Nt===0?wr:"".concat(wr).concat(mt).concat(Zn.padEnd(Nt,"0").slice(0,Nt))}return Hn===".0"?wr:"".concat(wr).concat(Hn)}var Ee=vt,Ve=ue(93681),Je=ue(34280),Lt=ue(8654),et=ue(59301),Dt=ue(48736);function Ge(Qe,mt){var Nt=(0,et.useRef)(null);function vn(){try{var wn=Qe.selectionStart,Tn=Qe.selectionEnd,Zn=Qe.value,Hn=Zn.substring(0,wn),wr=Zn.substring(Tn);Nt.current={start:wn,end:Tn,value:Zn,beforeTxt:Hn,afterTxt:wr}}catch(Cr){}}function mn(){if(Qe&&Nt.current&&mt)try{var wn=Qe.value,Tn=Nt.current,Zn=Tn.beforeTxt,Hn=Tn.afterTxt,wr=Tn.start,Cr=wn.length;if(wn.endsWith(Hn))Cr=wn.length-Nt.current.afterTxt.length;else if(wn.startsWith(Zn))Cr=Zn.length;else{var Yn=Zn[wr-1],Nr=wn.indexOf(Yn,wr-1);Nr!==-1&&(Cr=Nr+1)}Qe.setSelectionRange(Cr,Cr)}catch(Kr){(0,Dt.ZP)(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(Kr.message))}}return[vn,mn]}var kt=ue(49658),tt=function(){var mt=(0,et.useState)(!1),Nt=(0,we.Z)(mt,2),vn=Nt[0],mn=Nt[1];return(0,Je.Z)(function(){mn((0,kt.Z)())},[]),vn},$t=tt,pt=ue(16089),Bt=200,Tt=600;function wt(Qe){var mt=Qe.prefixCls,Nt=Qe.upNode,vn=Qe.downNode,mn=Qe.upDisabled,wn=Qe.downDisabled,Tn=Qe.onStep,Zn=et.useRef(),Hn=et.useRef([]),wr=et.useRef();wr.current=Tn;var Cr=function(){clearTimeout(Zn.current)},Yn=function($r,Ur){$r.preventDefault(),Cr(),wr.current(Ur);function Vr(){wr.current(Ur),Zn.current=setTimeout(Vr,Bt)}Zn.current=setTimeout(Vr,Tt)};et.useEffect(function(){return function(){Cr(),Hn.current.forEach(function(ar){return pt.Z.cancel(ar)})}},[]);var Nr=$t();if(Nr)return null;var Kr="".concat(mt,"-handler"),Or=ut()(Kr,"".concat(Kr,"-up"),(0,Me.Z)({},"".concat(Kr,"-up-disabled"),mn)),Ar=ut()(Kr,"".concat(Kr,"-down"),(0,Me.Z)({},"".concat(Kr,"-down-disabled"),wn)),kr=function(){return Hn.current.push((0,pt.Z)(Cr))},Gr={unselectable:"on",role:"button",onMouseUp:kr,onMouseLeave:kr};return et.createElement("div",{className:"".concat(Kr,"-wrap")},et.createElement("span",(0,xe.Z)({},Gr,{onMouseDown:function($r){Yn($r,!0)},"aria-label":"Increase Value","aria-disabled":mn,className:Or}),Nt||et.createElement("span",{unselectable:"on",className:"".concat(mt,"-handler-up-inner")})),et.createElement("span",(0,xe.Z)({},Gr,{onMouseDown:function($r){Yn($r,!1)},"aria-label":"Decrease Value","aria-disabled":wn,className:Ar}),vn||et.createElement("span",{unselectable:"on",className:"".concat(mt,"-handler-down-inner")})))}function Ne(Qe){var mt=typeof Qe=="number"?at(Qe):ft(Qe).fullStr,Nt=mt.includes(".");return Nt?ft(mt.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:Qe+"0"}var be=ue(5643),xt=function(){var Qe=(0,et.useRef)(0),mt=function(){pt.Z.cancel(Qe.current)};return(0,et.useEffect)(function(){return mt},[]),function(Nt){mt(),Qe.current=(0,pt.Z)(function(){Nt()})}},Qt=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],Vt=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","classes","className","classNames"],qe=function(mt,Nt){return mt||Nt.isEmpty()?Nt.toString():Nt.toNumber()},nt=function(mt){var Nt=Ee(mt);return Nt.isInvalidate()?null:Nt},Ot=et.forwardRef(function(Qe,mt){var Nt,vn=Qe.prefixCls,mn=vn===void 0?"rc-input-number":vn,wn=Qe.className,Tn=Qe.style,Zn=Qe.min,Hn=Qe.max,wr=Qe.step,Cr=wr===void 0?1:wr,Yn=Qe.defaultValue,Nr=Qe.value,Kr=Qe.disabled,Or=Qe.readOnly,Ar=Qe.upHandler,kr=Qe.downHandler,Gr=Qe.keyboard,ar=Qe.controls,$r=ar===void 0?!0:ar,Ur=Qe.classNames,Vr=Qe.stringMode,Yr=Qe.parser,Zr=Qe.formatter,dr=Qe.precision,_r=Qe.decimalSeparator,Ln=Qe.onChange,Wn=Qe.onInput,Er=Qe.onPressEnter,St=Qe.onStep,Le=(0,_e.Z)(Qe,Qt),We="".concat(mn,"-input"),Be=et.useRef(null),Oe=et.useState(!1),lt=(0,we.Z)(Oe,2),_t=lt[0],Yt=lt[1],Kt=et.useRef(!1),Jt=et.useRef(!1),un=et.useRef(!1),fn=et.useState(function(){return Ee(Nr!=null?Nr:Yn)}),xn=(0,we.Z)(fn,2),zt=xn[0],ln=xn[1];function jn(yn){Nr===void 0&&ln(yn)}var Dn=et.useCallback(function(yn,hn){if(!hn)return dr>=0?dr:Math.max(ot(yn),ot(Cr))},[dr,Cr]),Vn=et.useCallback(function(yn){var hn=String(yn);if(Yr)return Yr(hn);var En=hn;return _r&&(En=En.replace(_r,".")),En.replace(/[^\w.-]+/g,"")},[Yr,_r]),Pn=et.useRef(""),yr=et.useCallback(function(yn,hn){if(Zr)return Zr(yn,{userTyping:hn,input:String(Pn.current)});var En=typeof yn=="number"?at(yn):yn;if(!hn){var Qn=Dn(En,hn);if(Ct(En)&&(_r||Qn>=0)){var Rn=_r||".";En=$e(En,Rn,Qn)}}return En},[Zr,Dn,_r]),Sn=et.useState(function(){var yn=Yn!=null?Yn:Nr;return zt.isInvalidate()&&["string","number"].includes((0,De.Z)(yn))?Number.isNaN(yn)?"":yn:yr(zt.toString(),!1)}),pr=(0,we.Z)(Sn,2),ht=pr[0],Ue=pr[1];Pn.current=ht;function Xe(yn,hn){Ue(yr(yn.isInvalidate()?yn.toString(!1):yn.toString(!hn),hn))}var Ze=et.useMemo(function(){return nt(Hn)},[Hn,dr]),gt=et.useMemo(function(){return nt(Zn)},[Zn,dr]),Wt=et.useMemo(function(){return!Ze||!zt||zt.isInvalidate()?!1:Ze.lessEquals(zt)},[Ze,zt]),Gt=et.useMemo(function(){return!gt||!zt||zt.isInvalidate()?!1:zt.lessEquals(gt)},[gt,zt]),nn=Ge(Be.current,_t),Ht=(0,we.Z)(nn,2),bt=Ht[0],Cn=Ht[1],kn=function(hn){return Ze&&!hn.lessEquals(Ze)?Ze:gt&&!gt.lessEquals(hn)?gt:null},Jn=function(hn){return!kn(hn)},Fn=function(hn,En){var Qn=hn,Rn=Jn(Qn)||Qn.isEmpty();if(!Qn.isEmpty()&&!En&&(Qn=kn(Qn)||Qn,Rn=!0),!Or&&!Kr&&Rn){var Mn=Qn.toString(),er=Dn(Mn,En);return er>=0&&(Qn=Ee($e(Mn,".",er)),Jn(Qn)||(Qn=Ee($e(Mn,".",er,!0)))),Qn.equals(zt)||(jn(Qn),Ln==null||Ln(Qn.isEmpty()?null:qe(Vr,Qn)),Nr===void 0&&Xe(Qn,En)),Qn}return zt},Nn=xt(),_n=function yn(hn){if(bt(),Pn.current=hn,Ue(hn),!Jt.current){var En=Vn(hn),Qn=Ee(En);Qn.isNaN()||Fn(Qn,!0)}Wn==null||Wn(hn),Nn(function(){var Rn=hn;Yr||(Rn=hn.replace(/。/g,".")),Rn!==hn&&yn(Rn)})},tr=function(){Jt.current=!0},Xn=function(){Jt.current=!1,_n(Be.current.value)},In=function(hn){_n(hn.target.value)},zn=function(hn){var En;if(!(hn&&Wt||!hn&&Gt)){Kt.current=!1;var Qn=Ee(un.current?Ne(Cr):Cr);hn||(Qn=Qn.negate());var Rn=(zt||Ee(0)).add(Qn.toString()),Mn=Fn(Rn,!1);St==null||St(qe(Vr,Mn),{offset:un.current?Ne(Cr):Cr,type:hn?"up":"down"}),(En=Be.current)===null||En===void 0||En.focus()}},cr=function(hn){var En=Ee(Vn(ht)),Qn=En;En.isNaN()?Qn=Fn(zt,hn):Qn=Fn(En,hn),Nr!==void 0?Xe(zt,!1):Qn.isNaN()||Xe(Qn,!1)},qn=function(){Kt.current=!0},br=function(hn){var En=hn.key,Qn=hn.shiftKey;Kt.current=!0,un.current=Qn,En==="Enter"&&(Jt.current||(Kt.current=!1),cr(!1),Er==null||Er(hn)),Gr!==!1&&!Jt.current&&["Up","ArrowUp","Down","ArrowDown"].includes(En)&&(zn(En==="Up"||En==="ArrowUp"),hn.preventDefault())},Br=function(){Kt.current=!1,un.current=!1},rr=function(){cr(!1),Yt(!1),Kt.current=!1};return(0,Je.o)(function(){zt.isInvalidate()||Xe(zt,!1)},[dr]),(0,Je.o)(function(){var yn=Ee(Nr);ln(yn);var hn=Ee(Vn(ht));(!yn.equals(hn)||!Kt.current||Zr)&&Xe(yn,Kt.current)},[Nr]),(0,Je.o)(function(){Zr&&Cn()},[ht]),et.createElement("div",{className:ut()(mn,Ur==null?void 0:Ur.input,wn,(Nt={},(0,Me.Z)(Nt,"".concat(mn,"-focused"),_t),(0,Me.Z)(Nt,"".concat(mn,"-disabled"),Kr),(0,Me.Z)(Nt,"".concat(mn,"-readonly"),Or),(0,Me.Z)(Nt,"".concat(mn,"-not-a-number"),zt.isNaN()),(0,Me.Z)(Nt,"".concat(mn,"-out-of-range"),!zt.isInvalidate()&&!Jn(zt)),Nt)),style:Tn,onFocus:function(){Yt(!0)},onBlur:rr,onKeyDown:br,onKeyUp:Br,onCompositionStart:tr,onCompositionEnd:Xn,onBeforeInput:qn},$r&&et.createElement(wt,{prefixCls:mn,upNode:Ar,downNode:kr,upDisabled:Wt,downDisabled:Gt,onStep:zn}),et.createElement("div",{className:"".concat(We,"-wrap")},et.createElement("input",(0,xe.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":Zn,"aria-valuemax":Hn,"aria-valuenow":zt.isInvalidate()?null:zt.toString(),step:Cr},Le,{ref:(0,Lt.sQ)(Be,mt),className:We,value:ht,onChange:In,disabled:Kr,readOnly:Or}))))}),dn=et.forwardRef(function(Qe,mt){var Nt=Qe.disabled,vn=Qe.style,mn=Qe.prefixCls,wn=Qe.value,Tn=Qe.prefix,Zn=Qe.suffix,Hn=Qe.addonBefore,wr=Qe.addonAfter,Cr=Qe.classes,Yn=Qe.className,Nr=Qe.classNames,Kr=(0,_e.Z)(Qe,Vt),Or=et.useRef(null),Ar=function(Gr){Or.current&&(0,be.nH)(Or.current,Gr)};return et.createElement(Ve.BaseInput,{inputElement:et.createElement(Ot,(0,xe.Z)({prefixCls:mn,disabled:Nt,classNames:Nr,ref:(0,Lt.sQ)(Or,mt)},Kr)),className:Yn,triggerFocus:Ar,prefixCls:mn,value:wn,disabled:Nt,style:vn,prefix:Tn,suffix:Zn,addonAfter:wr,addonBefore:Hn,classes:Cr,classNames:Nr,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}})});dn.displayName="InputNumber";var en=dn,on=en,Xt=ue(19080),Ut=ue(36355),Zt=ue(92736),ye=ue(1684),le=ue(19716),oe=ue(32441),he=ue(33234),pe=ue(9937),ce=ue(17313),Ie=ue(74207),yt=ue(83116),Pe=ue(37613);const je=(Qe,mt)=>{let{componentCls:Nt,borderRadiusSM:vn,borderRadiusLG:mn}=Qe;const wn=mt==="lg"?mn:vn;return{[`&-${mt}`]:{[`${Nt}-handler-wrap`]:{borderStartEndRadius:wn,borderEndEndRadius:wn},[`${Nt}-handler-up`]:{borderStartEndRadius:wn},[`${Nt}-handler-down`]:{borderEndEndRadius:wn}}}},Rt=Qe=>{const{componentCls:mt,lineWidth:Nt,lineType:vn,colorBorder:mn,borderRadius:wn,fontSizeLG:Tn,controlHeightLG:Zn,controlHeightSM:Hn,colorError:wr,paddingInlineSM:Cr,colorTextDescription:Yn,motionDurationMid:Nr,handleHoverColor:Kr,paddingInline:Or,paddingBlock:Ar,handleBg:kr,handleActiveBg:Gr,colorTextDisabled:ar,borderRadiusSM:$r,borderRadiusLG:Ur,controlWidth:Vr,handleVisible:Yr,handleBorderColor:Zr}=Qe;return[{[mt]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,ce.Wf)(Qe)),(0,pe.ik)(Qe)),(0,pe.bi)(Qe,mt)),{display:"inline-block",width:Vr,margin:0,padding:0,border:`${Nt}px ${vn} ${mn}`,borderRadius:wn,"&-rtl":{direction:"rtl",[`${mt}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:Tn,borderRadius:Ur,[`input${mt}-input`]:{height:Zn-2*Nt}},"&-sm":{padding:0,borderRadius:$r,[`input${mt}-input`]:{height:Hn-2*Nt,padding:`0 ${Cr}px`}},"&:hover":Object.assign({},(0,pe.pU)(Qe)),"&-focused":Object.assign({},(0,pe.M1)(Qe)),"&-out-of-range":{[`${mt}-input-wrap`]:{input:{color:wr}}},"&-group":Object.assign(Object.assign(Object.assign({},(0,ce.Wf)(Qe)),(0,pe.s7)(Qe)),{"&-wrapper":{display:"inline-block",textAlign:"start",verticalAlign:"top",[`${mt}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${mt}-group-addon`]:{borderRadius:Ur,fontSize:Qe.fontSizeLG}},"&-sm":{[`${mt}-group-addon`]:{borderRadius:$r}},[`${mt}-wrapper-disabled > ${mt}-group-addon`]:Object.assign({},(0,pe.Xy)(Qe))}}),[`&-disabled ${mt}-input`]:{cursor:"not-allowed"},[mt]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},(0,ce.Wf)(Qe)),{width:"100%",padding:`${Ar}px ${Or}px`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:wn,outline:0,transition:`all ${Nr} linear`,appearance:"textfield",fontSize:"inherit"}),(0,pe.nz)(Qe.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[mt]:Object.assign(Object.assign(Object.assign({[`&:hover ${mt}-handler-wrap, &-focused ${mt}-handler-wrap`]:{opacity:1},[`${mt}-handler-wrap`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:Qe.handleWidth,height:"100%",background:kr,borderStartStartRadius:0,borderStartEndRadius:wn,borderEndEndRadius:wn,borderEndStartRadius:0,opacity:Yr===!0?1:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`opacity ${Nr} linear ${Nr}`,[`${mt}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[`
${mt}-handler-up-inner,
${mt}-handler-down-inner
`]:{marginInlineEnd:0,fontSize:Qe.handleFontSize}}},[`${mt}-handler`]:{height:"50%",overflow:"hidden",color:Yn,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:`${Nt}px ${vn} ${Zr}`,transition:`all ${Nr} linear`,"&:active":{background:Gr},"&:hover":{height:"60%",[`
${mt}-handler-up-inner,
${mt}-handler-down-inner
`]:{color:Kr}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},(0,ce.Ro)()),{color:Yn,transition:`all ${Nr} linear`,userSelect:"none"})},[`${mt}-handler-up`]:{borderStartEndRadius:wn},[`${mt}-handler-down`]:{borderBlockStart:`${Nt}px ${vn} ${Zr}`,borderEndEndRadius:wn}},je(Qe,"lg")),je(Qe,"sm")),{"&-disabled, &-readonly":{[`${mt}-handler-wrap`]:{display:"none"},[`${mt}-input`]:{color:"inherit"}},[`
${mt}-handler-up-disabled,
${mt}-handler-down-disabled
`]:{cursor:"not-allowed"},[`
${mt}-handler-up-disabled:hover &-handler-up-inner,
${mt}-handler-down-disabled:hover &-handler-down-inner
`]:{color:ar}})},{[`${mt}-borderless`]:{borderColor:"transparent",boxShadow:"none",[`${mt}-handler-down`]:{borderBlockStartWidth:0}}}]},At=Qe=>{const{componentCls:mt,paddingBlock:Nt,paddingInline:vn,inputAffixPadding:mn,controlWidth:wn,borderRadiusLG:Tn,borderRadiusSM:Zn}=Qe;return{[`${mt}-affix-wrapper`]:Object.assign(Object.assign(Object.assign({},(0,pe.ik)(Qe)),(0,pe.bi)(Qe,`${mt}-affix-wrapper`)),{position:"relative",display:"inline-flex",width:wn,padding:0,paddingInlineStart:vn,"&-lg":{borderRadius:Tn},"&-sm":{borderRadius:Zn},[`&:not(${mt}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},(0,pe.pU)(Qe)),{zIndex:1}),"&-focused, &:focus":{zIndex:1},[`&-disabled > ${mt}-disabled`]:{background:"transparent"},[`> div${mt}`]:{width:"100%",border:"none",outline:"none",[`&${mt}-focused`]:{boxShadow:"none !important"}},[`input${mt}-input`]:{padding:`${Nt}px 0`},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${mt}-handler-wrap`]:{zIndex:2},[mt]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:mn},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:vn,marginInlineStart:mn}}})}};var rt=(0,yt.Z)("InputNumber",Qe=>{const mt=(0,Pe.TS)(Qe,(0,pe.e5)(Qe));return[Rt(mt),At(mt),(0,Ie.c)(mt)]},Qe=>Object.assign(Object.assign({},(0,pe.TM)(Qe)),{controlWidth:90,handleWidth:Qe.controlHeightSM-Qe.lineWidth*2,handleFontSize:Qe.fontSize/2,handleVisible:"auto",handleActiveBg:Qe.colorFillAlter,handleBg:Qe.colorBgContainer,handleHoverColor:Qe.colorPrimary,handleBorderColor:Qe.colorBorder})),Ft=function(Qe,mt){var Nt={};for(var vn in Qe)Object.prototype.hasOwnProperty.call(Qe,vn)&&mt.indexOf(vn)<0&&(Nt[vn]=Qe[vn]);if(Qe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var mn=0,vn=Object.getOwnPropertySymbols(Qe);mn<vn.length;mn++)mt.indexOf(vn[mn])<0&&Object.prototype.propertyIsEnumerable.call(Qe,vn[mn])&&(Nt[vn[mn]]=Qe[vn[mn]]);return Nt};const sn=et.forwardRef((Qe,mt)=>{const{getPrefixCls:Nt,direction:vn}=et.useContext(Ut.E_),mn=et.useRef(null);et.useImperativeHandle(mt,()=>mn.current);const{className:wn,rootClassName:Tn,size:Zn,disabled:Hn,prefixCls:wr,addonBefore:Cr,addonAfter:Yn,prefix:Nr,bordered:Kr=!0,readOnly:Or,status:Ar,controls:kr}=Qe,Gr=Ft(Qe,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls"]),ar=Nt("input-number",wr),[$r,Ur]=rt(ar),{compactSize:Vr,compactItemClassnames:Yr}=(0,he.ri)(ar,vn);let Zr=et.createElement(Te.Z,{className:`${ar}-handler-up-inner`}),dr=et.createElement(se.Z,{className:`${ar}-handler-down-inner`});const _r=typeof kr=="boolean"?kr:void 0;typeof kr=="object"&&(Zr=typeof kr.upIcon=="undefined"?Zr:et.createElement("span",{className:`${ar}-handler-up-inner`},kr.upIcon),dr=typeof kr.downIcon=="undefined"?dr:et.createElement("span",{className:`${ar}-handler-down-inner`},kr.downIcon));const{hasFeedback:Ln,status:Wn,isFormItemInput:Er,feedbackIcon:St}=et.useContext(oe.aM),Le=(0,Xt.F)(Wn,Ar),We=(0,le.Z)(Kt=>{var Jt;return(Jt=Zn!=null?Zn:Vr)!==null&&Jt!==void 0?Jt:Kt}),Be=et.useContext(ye.Z),Oe=Hn!=null?Hn:Be,lt=ut()({[`${ar}-lg`]:We==="large",[`${ar}-sm`]:We==="small",[`${ar}-rtl`]:vn==="rtl",[`${ar}-borderless`]:!Kr,[`${ar}-in-form-item`]:Er},(0,Xt.Z)(ar,Le),Yr,Ur),_t=`${ar}-group`,Yt=et.createElement(on,Object.assign({ref:mn,disabled:Oe,className:ut()(wn,Tn),upHandler:Zr,downHandler:dr,prefixCls:ar,readOnly:Or,controls:_r,prefix:Nr,suffix:Ln&&St,addonAfter:Yn&&et.createElement(he.BR,null,et.createElement(oe.Ux,{override:!0,status:!0},Yn)),addonBefore:Cr&&et.createElement(he.BR,null,et.createElement(oe.Ux,{override:!0,status:!0},Cr)),classNames:{input:lt},classes:{affixWrapper:ut()((0,Xt.Z)(`${ar}-affix-wrapper`,Le,Ln),{[`${ar}-affix-wrapper-sm`]:We==="small",[`${ar}-affix-wrapper-lg`]:We==="large",[`${ar}-affix-wrapper-rtl`]:vn==="rtl",[`${ar}-affix-wrapper-borderless`]:!Kr},Ur),wrapper:ut()({[`${_t}-rtl`]:vn==="rtl",[`${ar}-wrapper-disabled`]:Oe},Ur),group:ut()({[`${ar}-group-wrapper-sm`]:We==="small",[`${ar}-group-wrapper-lg`]:We==="large",[`${ar}-group-wrapper-rtl`]:vn==="rtl"},(0,Xt.Z)(`${ar}-group-wrapper`,Le,Ln),Ur)}},Gr));return $r(Yt)}),ct=sn,qt=Qe=>et.createElement(Zt.ZP,{theme:{components:{InputNumber:{handleVisible:!0}}}},et.createElement(sn,Object.assign({},Qe)));ct._InternalPanelDoNotUseOrYouWillBeFired=qt;var an=ct},9432:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return jt},n:function(){return at}});var se=ue(19248),Te=ue(92310),ze=ue.n(Te),ut=ue(93681),xe=ue(8654),Me=ue(59301),De=ue(19080),we=ue(36355),_e=ue(1684),Re=ue(19716),dt=ue(32441),Ae=ue(33234),Fe=ue(59412),ft=ue(9937);function Ye(it){return!!(it.prefix||it.suffix||it.allowClear)}var ot=function(it,vt){var $e={};for(var Ee in it)Object.prototype.hasOwnProperty.call(it,Ee)&&vt.indexOf(Ee)<0&&($e[Ee]=it[Ee]);if(it!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ve=0,Ee=Object.getOwnPropertySymbols(it);Ve<Ee.length;Ve++)vt.indexOf(Ee[Ve])<0&&Object.prototype.propertyIsEnumerable.call(it,Ee[Ve])&&($e[Ee[Ve]]=it[Ee[Ve]]);return $e};function at(it,vt){if(!it)return;it.focus(vt);const{cursor:$e}=vt||{};if($e){const Ee=it.value.length;switch($e){case"start":it.setSelectionRange(0,0);break;case"end":it.setSelectionRange(Ee,Ee);break;default:it.setSelectionRange(0,Ee);break}}}var jt=(0,Me.forwardRef)((it,vt)=>{var $e;const{prefixCls:Ee,bordered:Ve=!0,status:Je,size:Lt,disabled:et,onBlur:Dt,onFocus:Ge,suffix:kt,allowClear:tt,addonAfter:$t,addonBefore:pt,className:Bt,style:Tt,styles:wt,rootClassName:Ne,onChange:be,classNames:xt}=it,Qt=ot(it,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames"]),{getPrefixCls:Vt,direction:qe,input:nt}=Me.useContext(we.E_),Ot=Vt("input",Ee),dn=(0,Me.useRef)(null),[en,on]=(0,ft.ZP)(Ot),{compactSize:Xt,compactItemClassnames:Ut}=(0,Ae.ri)(Ot,qe),Zt=(0,Re.Z)(sn=>{var ct;return(ct=Lt!=null?Lt:Xt)!==null&&ct!==void 0?ct:sn}),ye=Me.useContext(_e.Z),le=et!=null?et:ye,{status:oe,hasFeedback:he,feedbackIcon:pe}=(0,Me.useContext)(dt.aM),ce=(0,De.F)(oe,Je),Ie=Ye(it)||!!he,yt=(0,Me.useRef)(Ie);(0,Me.useEffect)(()=>{var sn;Ie&&yt.current,yt.current=Ie},[Ie]);const Pe=(0,Fe.Z)(dn,!0),je=sn=>{Pe(),Dt==null||Dt(sn)},Rt=sn=>{Pe(),Ge==null||Ge(sn)},At=sn=>{Pe(),be==null||be(sn)},rt=(he||kt)&&Me.createElement(Me.Fragment,null,kt,he&&pe);let Ft;return typeof tt=="object"&&(tt!=null&&tt.clearIcon)?Ft=tt:tt&&(Ft={clearIcon:Me.createElement(se.Z,null)}),en(Me.createElement(ut.default,Object.assign({ref:(0,xe.sQ)(vt,dn),prefixCls:Ot,autoComplete:nt==null?void 0:nt.autoComplete},Qt,{disabled:le,onBlur:je,onFocus:Rt,style:Object.assign(Object.assign({},nt==null?void 0:nt.style),Tt),styles:Object.assign(Object.assign({},nt==null?void 0:nt.styles),wt),suffix:rt,allowClear:Ft,className:ze()(Bt,Ne,Ut,nt==null?void 0:nt.className),onChange:At,addonAfter:$t&&Me.createElement(Ae.BR,null,Me.createElement(dt.Ux,{override:!0,status:!0},$t)),addonBefore:pt&&Me.createElement(Ae.BR,null,Me.createElement(dt.Ux,{override:!0,status:!0},pt)),classNames:Object.assign(Object.assign(Object.assign({},xt),nt==null?void 0:nt.classNames),{input:ze()({[`${Ot}-sm`]:Zt==="small",[`${Ot}-lg`]:Zt==="large",[`${Ot}-rtl`]:qe==="rtl",[`${Ot}-borderless`]:!Ve},!Ie&&(0,De.Z)(Ot,ce),xt==null?void 0:xt.input,($e=nt==null?void 0:nt.classNames)===null||$e===void 0?void 0:$e.input,on)}),classes:{affixWrapper:ze()({[`${Ot}-affix-wrapper-sm`]:Zt==="small",[`${Ot}-affix-wrapper-lg`]:Zt==="large",[`${Ot}-affix-wrapper-rtl`]:qe==="rtl",[`${Ot}-affix-wrapper-borderless`]:!Ve},(0,De.Z)(`${Ot}-affix-wrapper`,ce,he),on),wrapper:ze()({[`${Ot}-group-rtl`]:qe==="rtl"},on),group:ze()({[`${Ot}-group-wrapper-sm`]:Zt==="small",[`${Ot}-group-wrapper-lg`]:Zt==="large",[`${Ot}-group-wrapper-rtl`]:qe==="rtl",[`${Ot}-group-wrapper-disabled`]:le},(0,De.Z)(`${Ot}-group-wrapper`,ce,he),on)}})))})},1643:function(bn,tn,ue){"use strict";var se=ue(19248),Te=ue(92310),ze=ue.n(Te),ut=ue(9296),xe=ue(59301),Me=ue(19080),De=ue(36355),we=ue(1684),_e=ue(19716),Re=ue(32441),dt=ue(9432),Ae=ue(9937),Fe=function(Ye,ot){var at={};for(var Ct in Ye)Object.prototype.hasOwnProperty.call(Ye,Ct)&&ot.indexOf(Ct)<0&&(at[Ct]=Ye[Ct]);if(Ye!=null&&typeof Object.getOwnPropertySymbols=="function")for(var jt=0,Ct=Object.getOwnPropertySymbols(Ye);jt<Ct.length;jt++)ot.indexOf(Ct[jt])<0&&Object.prototype.propertyIsEnumerable.call(Ye,Ct[jt])&&(at[Ct[jt]]=Ye[Ct[jt]]);return at};const ft=(0,xe.forwardRef)((Ye,ot)=>{const{prefixCls:at,bordered:Ct=!0,size:jt,disabled:it,status:vt,allowClear:$e,showCount:Ee,classNames:Ve,rootClassName:Je,className:Lt}=Ye,et=Fe(Ye,["prefixCls","bordered","size","disabled","status","allowClear","showCount","classNames","rootClassName","className"]),{getPrefixCls:Dt,direction:Ge}=xe.useContext(De.E_),kt=(0,_e.Z)(jt),tt=xe.useContext(we.Z),$t=it!=null?it:tt,{status:pt,hasFeedback:Bt,feedbackIcon:Tt}=xe.useContext(Re.aM),wt=(0,Me.F)(pt,vt),Ne=xe.useRef(null);xe.useImperativeHandle(ot,()=>{var qe;return{resizableTextArea:(qe=Ne.current)===null||qe===void 0?void 0:qe.resizableTextArea,focus:nt=>{var Ot,dn;(0,dt.n)((dn=(Ot=Ne.current)===null||Ot===void 0?void 0:Ot.resizableTextArea)===null||dn===void 0?void 0:dn.textArea,nt)},blur:()=>{var nt;return(nt=Ne.current)===null||nt===void 0?void 0:nt.blur()}}});const be=Dt("input",at);let xt;typeof $e=="object"&&($e!=null&&$e.clearIcon)?xt=$e:$e&&(xt={clearIcon:xe.createElement(se.Z,null)});const[Qt,Vt]=(0,Ae.ZP)(be);return Qt(xe.createElement(ut.default,Object.assign({},et,{disabled:$t,allowClear:xt,className:ze()(Lt,Je),classes:{affixWrapper:ze()(`${be}-textarea-affix-wrapper`,{[`${be}-affix-wrapper-rtl`]:Ge==="rtl",[`${be}-affix-wrapper-borderless`]:!Ct,[`${be}-affix-wrapper-sm`]:kt==="small",[`${be}-affix-wrapper-lg`]:kt==="large",[`${be}-textarea-show-count`]:Ee},(0,Me.Z)(`${be}-affix-wrapper`,wt),Vt)},classNames:Object.assign(Object.assign({},Ve),{textarea:ze()({[`${be}-borderless`]:!Ct,[`${be}-sm`]:kt==="small",[`${be}-lg`]:kt==="large"},(0,Me.Z)(be,wt),Vt,Ve==null?void 0:Ve.textarea)}),prefixCls:be,suffix:Bt&&xe.createElement("span",{className:`${be}-textarea-suffix`},Tt),showCount:Ee,ref:Ne})))});tn.Z=ft},59412:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return Te}});var se=ue(59301);function Te(ze,ut){const xe=(0,se.useRef)([]),Me=()=>{xe.current.push(setTimeout(()=>{var De,we,_e,Re;!((De=ze.current)===null||De===void 0)&&De.input&&((we=ze.current)===null||we===void 0?void 0:we.input.getAttribute("type"))==="password"&&(!((_e=ze.current)===null||_e===void 0)&&_e.input.hasAttribute("value"))&&((Re=ze.current)===null||Re===void 0||Re.input.removeAttribute("value"))}))};return(0,se.useEffect)(()=>(ut&&Me(),()=>xe.current.forEach(De=>{De&&clearTimeout(De)})),[]),Me}},92832:function(bn,tn,ue){"use strict";ue.d(tn,{default:function(){return kt}});var se=ue(92310),Te=ue.n(se),ze=ue(59301),ut=ue(36355),xe=ue(32441),Me=ue(9937),we=tt=>{const{getPrefixCls:$t,direction:pt}=(0,ze.useContext)(ut.E_),{prefixCls:Bt,className:Tt}=tt,wt=$t("input-group",Bt),Ne=$t("input"),[be,xt]=(0,Me.ZP)(Ne),Qt=Te()(wt,{[`${wt}-lg`]:tt.size==="large",[`${wt}-sm`]:tt.size==="small",[`${wt}-compact`]:tt.compact,[`${wt}-rtl`]:pt==="rtl"},xt,Tt),Vt=(0,ze.useContext)(xe.aM),qe=(0,ze.useMemo)(()=>Object.assign(Object.assign({},Vt),{isFormItemInput:!1}),[Vt]);return be(ze.createElement("span",{className:Qt,style:tt.style,onMouseEnter:tt.onMouseEnter,onMouseLeave:tt.onMouseLeave,onFocus:tt.onFocus,onBlur:tt.onBlur},ze.createElement(xe.aM.Provider,{value:qe},tt.children)))},_e=ue(9432),Re=ue(73331),dt=ue(15277),Ae=ue(2738),Fe=ue(8654),ft=ue(59412),Ye=function(tt,$t){var pt={};for(var Bt in tt)Object.prototype.hasOwnProperty.call(tt,Bt)&&$t.indexOf(Bt)<0&&(pt[Bt]=tt[Bt]);if(tt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Tt=0,Bt=Object.getOwnPropertySymbols(tt);Tt<Bt.length;Tt++)$t.indexOf(Bt[Tt])<0&&Object.prototype.propertyIsEnumerable.call(tt,Bt[Tt])&&(pt[Bt[Tt]]=tt[Bt[Tt]]);return pt};const ot=tt=>tt?ze.createElement(dt.Z,null):ze.createElement(Re.Z,null),at={click:"onClick",hover:"onMouseOver"};var jt=ze.forwardRef((tt,$t)=>{const{visibilityToggle:pt=!0}=tt,Bt=typeof pt=="object"&&pt.visible!==void 0,[Tt,wt]=(0,ze.useState)(()=>Bt?pt.visible:!1),Ne=(0,ze.useRef)(null);ze.useEffect(()=>{Bt&&wt(pt.visible)},[Bt,pt]);const be=(0,ft.Z)(Ne),xt=()=>{const{disabled:le}=tt;le||(Tt&&be(),wt(oe=>{var he;const pe=!oe;return typeof pt=="object"&&((he=pt.onVisibleChange)===null||he===void 0||he.call(pt,pe)),pe}))},Qt=le=>{const{action:oe="click",iconRender:he=ot}=tt,pe=at[oe]||"",ce=he(Tt),Ie={[pe]:xt,className:`${le}-icon`,key:"passwordIcon",onMouseDown:yt=>{yt.preventDefault()},onMouseUp:yt=>{yt.preventDefault()}};return ze.cloneElement(ze.isValidElement(ce)?ce:ze.createElement("span",null,ce),Ie)},{className:Vt,prefixCls:qe,inputPrefixCls:nt,size:Ot}=tt,dn=Ye(tt,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:en}=ze.useContext(ut.E_),on=en("input",nt),Xt=en("input-password",qe),Ut=pt&&Qt(Xt),Zt=Te()(Xt,Vt,{[`${Xt}-${Ot}`]:!!Ot}),ye=Object.assign(Object.assign({},(0,Ae.Z)(dn,["suffix","iconRender","visibilityToggle"])),{type:Tt?"text":"password",className:Zt,prefixCls:on,suffix:Ut});return Ot&&(ye.size=Ot),ze.createElement(_e.Z,Object.assign({ref:(0,Fe.sQ)($t,Ne)},ye))}),it=ue(47472),vt=ue(92343),$e=ue(3113),Ee=ue(19716),Ve=ue(33234),Je=function(tt,$t){var pt={};for(var Bt in tt)Object.prototype.hasOwnProperty.call(tt,Bt)&&$t.indexOf(Bt)<0&&(pt[Bt]=tt[Bt]);if(tt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Tt=0,Bt=Object.getOwnPropertySymbols(tt);Tt<Bt.length;Tt++)$t.indexOf(Bt[Tt])<0&&Object.prototype.propertyIsEnumerable.call(tt,Bt[Tt])&&(pt[Bt[Tt]]=tt[Bt[Tt]]);return pt},et=ze.forwardRef((tt,$t)=>{const{prefixCls:pt,inputPrefixCls:Bt,className:Tt,size:wt,suffix:Ne,enterButton:be=!1,addonAfter:xt,loading:Qt,disabled:Vt,onSearch:qe,onChange:nt,onCompositionStart:Ot,onCompositionEnd:dn}=tt,en=Je(tt,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:on,direction:Xt}=ze.useContext(ut.E_),Ut=ze.useRef(!1),Zt=on("input-search",pt),ye=on("input",Bt),{compactSize:le}=(0,Ve.ri)(Zt,Xt),oe=(0,Ee.Z)(qt=>{var an;return(an=wt!=null?wt:le)!==null&&an!==void 0?an:qt}),he=ze.useRef(null),pe=qt=>{qt&&qt.target&&qt.type==="click"&&qe&&qe(qt.target.value,qt,{source:"clear"}),nt&&nt(qt)},ce=qt=>{var an;document.activeElement===((an=he.current)===null||an===void 0?void 0:an.input)&&qt.preventDefault()},Ie=qt=>{var an,Qe;qe&&qe((Qe=(an=he.current)===null||an===void 0?void 0:an.input)===null||Qe===void 0?void 0:Qe.value,qt,{source:"input"})},yt=qt=>{Ut.current||Qt||Ie(qt)},Pe=typeof be=="boolean"?ze.createElement(it.Z,null):null,je=`${Zt}-button`;let Rt;const At=be||{},rt=At.type&&At.type.__ANT_BUTTON===!0;rt||At.type==="button"?Rt=(0,vt.Tm)(At,Object.assign({onMouseDown:ce,onClick:qt=>{var an,Qe;(Qe=(an=At==null?void 0:At.props)===null||an===void 0?void 0:an.onClick)===null||Qe===void 0||Qe.call(an,qt),Ie(qt)},key:"enterButton"},rt?{className:je,size:oe}:{})):Rt=ze.createElement($e.ZP,{className:je,type:be?"primary":void 0,size:oe,disabled:Vt,key:"enterButton",onMouseDown:ce,onClick:Ie,loading:Qt,icon:Pe},be),xt&&(Rt=[Rt,(0,vt.Tm)(xt,{key:"addonAfter"})]);const Ft=Te()(Zt,{[`${Zt}-rtl`]:Xt==="rtl",[`${Zt}-${oe}`]:!!oe,[`${Zt}-with-button`]:!!be},Tt),sn=qt=>{Ut.current=!0,Ot==null||Ot(qt)},ct=qt=>{Ut.current=!1,dn==null||dn(qt)};return ze.createElement(_e.Z,Object.assign({ref:(0,Fe.sQ)(he,$t),onPressEnter:yt},en,{size:oe,onCompositionStart:sn,onCompositionEnd:ct,prefixCls:ye,addonAfter:Rt,suffix:Ne,onChange:pe,className:Ft,disabled:Vt}))}),Dt=ue(1643);const Ge=_e.Z;Ge.Group=we,Ge.Search=et,Ge.TextArea=Dt.Z,Ge.Password=jt;var kt=Ge},9937:function(bn,tn,ue){"use strict";ue.d(tn,{M1:function(){return De},TM:function(){return vt},Xy:function(){return we},bi:function(){return dt},e5:function(){return it},ik:function(){return Ae},nz:function(){return xe},pU:function(){return Me},s7:function(){return Fe},x0:function(){return Re}});var se=ue(17313),Te=ue(74207),ze=ue(37613),ut=ue(83116);const xe=$e=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:$e,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),Me=$e=>({borderColor:$e.hoverBorderColor}),De=$e=>({borderColor:$e.activeBorderColor,boxShadow:$e.activeShadow,outline:0}),we=$e=>({color:$e.colorTextDisabled,backgroundColor:$e.colorBgContainerDisabled,borderColor:$e.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},Me((0,ze.TS)($e,{hoverBorderColor:$e.colorBorder})))}),_e=$e=>{const{paddingBlockLG:Ee,fontSizeLG:Ve,lineHeightLG:Je,borderRadiusLG:Lt,paddingInlineLG:et}=$e;return{padding:`${Ee}px ${et}px`,fontSize:Ve,lineHeight:Je,borderRadius:Lt}},Re=$e=>({padding:`${$e.paddingBlockSM}px ${$e.paddingInlineSM}px`,borderRadius:$e.borderRadiusSM}),dt=($e,Ee)=>{const{componentCls:Ve,colorError:Je,colorWarning:Lt,errorActiveShadow:et,warningActiveShadow:Dt,colorErrorBorderHover:Ge,colorWarningBorderHover:kt}=$e;return{[`&-status-error:not(${Ee}-disabled):not(${Ee}-borderless)${Ee}`]:{borderColor:Je,"&:hover":{borderColor:Ge},"&:focus, &-focused":Object.assign({},De((0,ze.TS)($e,{activeBorderColor:Je,activeShadow:et}))),[`${Ve}-prefix, ${Ve}-suffix`]:{color:Je}},[`&-status-warning:not(${Ee}-disabled):not(${Ee}-borderless)${Ee}`]:{borderColor:Lt,"&:hover":{borderColor:kt},"&:focus, &-focused":Object.assign({},De((0,ze.TS)($e,{activeBorderColor:Lt,activeShadow:Dt}))),[`${Ve}-prefix, ${Ve}-suffix`]:{color:Lt}}}},Ae=$e=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${$e.paddingBlock}px ${$e.paddingInline}px`,color:$e.colorText,fontSize:$e.fontSize,lineHeight:$e.lineHeight,backgroundColor:$e.colorBgContainer,backgroundImage:"none",borderWidth:$e.lineWidth,borderStyle:$e.lineType,borderColor:$e.colorBorder,borderRadius:$e.borderRadius,transition:`all ${$e.motionDurationMid}`},xe($e.colorTextPlaceholder)),{"&:hover":Object.assign({},Me($e)),"&:focus, &-focused":Object.assign({},De($e)),"&-disabled, &[disabled]":Object.assign({},we($e)),"&-borderless":{"&, &:hover, &:focus, &-focused, &-disabled, &[disabled]":{backgroundColor:"transparent",border:"none",boxShadow:"none"}},"textarea&":{maxWidth:"100%",height:"auto",minHeight:$e.controlHeight,lineHeight:$e.lineHeight,verticalAlign:"bottom",transition:`all ${$e.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},_e($e)),"&-sm":Object.assign({},Re($e)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),Fe=$e=>{const{componentCls:Ee,antCls:Ve}=$e;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:$e.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${Ee}, &-lg > ${Ee}-group-addon`]:Object.assign({},_e($e)),[`&-sm ${Ee}, &-sm > ${Ee}-group-addon`]:Object.assign({},Re($e)),[`&-lg ${Ve}-select-single ${Ve}-select-selector`]:{height:$e.controlHeightLG},[`&-sm ${Ve}-select-single ${Ve}-select-selector`]:{height:$e.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 ${$e.paddingInline}px`,color:$e.colorText,fontWeight:"normal",fontSize:$e.fontSize,textAlign:"center",backgroundColor:$e.colorFillAlter,border:`${$e.lineWidth}px ${$e.lineType} ${$e.colorBorder}`,borderRadius:$e.borderRadius,transition:`all ${$e.motionDurationSlow}`,lineHeight:1,[`${Ve}-select`]:{margin:`-${$e.paddingBlock+1}px -${$e.paddingInline}px`,[`&${Ve}-select-single:not(${Ve}-select-customize-input)`]:{[`${Ve}-select-selector`]:{backgroundColor:"inherit",border:`${$e.lineWidth}px ${$e.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${Ve}-select-selector`]:{color:$e.colorPrimary}}},[`${Ve}-cascader-picker`]:{margin:`-9px -${$e.paddingInline}px`,backgroundColor:"transparent",[`${Ve}-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,[`${Ve}-select ${Ve}-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,[`${Ve}-select ${Ve}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${Ee}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${Ee}-search &`]:{borderStartStartRadius:$e.borderRadius,borderEndStartRadius:$e.borderRadius}},[`&:not(:first-child), ${Ee}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${Ee}-group-compact`]:Object.assign(Object.assign({display:"block"},(0,se.dF)()),{[`${Ee}-group-addon, ${Ee}-group-wrap, > ${Ee}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:$e.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[`
& > ${Ee}-affix-wrapper,
& > ${Ee}-number-affix-wrapper,
& > ${Ve}-picker-range
`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-$e.lineWidth,borderInlineEndWidth:$e.lineWidth},[`${Ee}`]:{float:"none"},[`& > ${Ve}-select > ${Ve}-select-selector,
& > ${Ve}-select-auto-complete ${Ee},
& > ${Ve}-cascader-picker ${Ee},
& > ${Ee}-group-wrapper ${Ee}`]:{borderInlineEndWidth:$e.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},[`& > ${Ve}-select-focused`]:{zIndex:1},[`& > ${Ve}-select > ${Ve}-select-arrow`]:{zIndex:1},[`& > *:first-child,
& > ${Ve}-select:first-child > ${Ve}-select-selector,
& > ${Ve}-select-auto-complete:first-child ${Ee},
& > ${Ve}-cascader-picker:first-child ${Ee}`]:{borderStartStartRadius:$e.borderRadius,borderEndStartRadius:$e.borderRadius},[`& > *:last-child,
& > ${Ve}-select:last-child > ${Ve}-select-selector,
& > ${Ve}-cascader-picker:last-child ${Ee},
& > ${Ve}-cascader-picker-focused:last-child ${Ee}`]:{borderInlineEndWidth:$e.lineWidth,borderStartEndRadius:$e.borderRadius,borderEndEndRadius:$e.borderRadius},[`& > ${Ve}-select-auto-complete ${Ee}`]:{verticalAlign:"top"},[`${Ee}-group-wrapper + ${Ee}-group-wrapper`]:{marginInlineStart:-$e.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:$e.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:$e.borderRadius}}}})}},ft=$e=>{const{componentCls:Ee,controlHeightSM:Ve,lineWidth:Je}=$e,et=(Ve-Je*2-16)/2;return{[Ee]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,se.Wf)($e)),Ae($e)),dt($e,Ee)),{'&[type="color"]':{height:$e.controlHeight,[`&${Ee}-lg`]:{height:$e.controlHeightLG},[`&${Ee}-sm`]:{height:Ve,paddingTop:et,paddingBottom:et}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},Ye=$e=>{const{componentCls:Ee}=$e;return{[`${Ee}-clear-icon`]:{margin:0,color:$e.colorTextQuaternary,fontSize:$e.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${$e.motionDurationSlow}`,"&:hover":{color:$e.colorTextTertiary},"&:active":{color:$e.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${$e.inputAffixPadding}px`}}}},ot=$e=>{const{componentCls:Ee,inputAffixPadding:Ve,colorTextDescription:Je,motionDurationSlow:Lt,colorIcon:et,colorIconHover:Dt,iconCls:Ge}=$e;return{[`${Ee}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Ae($e)),{display:"inline-flex",[`&:not(${Ee}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},Me($e)),{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:$e.paddingXS}},"&-show-count-suffix":{color:Je},"&-show-count-has-suffix":{marginInlineEnd:$e.paddingXXS},"&-prefix":{marginInlineEnd:Ve},"&-suffix":{marginInlineStart:Ve}}}),Ye($e)),{[`${Ge}${Ee}-password-icon`]:{color:et,cursor:"pointer",transition:`all ${Lt}`,"&:hover":{color:Dt}}}),dt($e,`${Ee}-affix-wrapper`))}},at=$e=>{const{componentCls:Ee,colorError:Ve,colorWarning:Je,borderRadiusLG:Lt,borderRadiusSM:et}=$e;return{[`${Ee}-group`]:Object.assign(Object.assign(Object.assign({},(0,se.Wf)($e)),Fe($e)),{"&-rtl":{direction:"rtl"},"&-wrapper":{display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${Ee}-group-addon`]:{borderRadius:Lt,fontSize:$e.fontSizeLG}},"&-sm":{[`${Ee}-group-addon`]:{borderRadius:et}},"&-status-error":{[`${Ee}-group-addon`]:{color:Ve,borderColor:Ve}},"&-status-warning":{[`${Ee}-group-addon`]:{color:Je,borderColor:Je}},"&-disabled":{[`${Ee}-group-addon`]:Object.assign({},we($e))},[`&: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}}}})}},Ct=$e=>{const{componentCls:Ee,antCls:Ve}=$e,Je=`${Ee}-search`;return{[Je]:{[`${Ee}`]:{"&:hover, &:focus":{borderColor:$e.colorPrimaryHover,[`+ ${Ee}-group-addon ${Je}-button:not(${Ve}-btn-primary)`]:{borderInlineStartColor:$e.colorPrimaryHover}}},[`${Ee}-affix-wrapper`]:{borderRadius:0},[`${Ee}-lg`]:{lineHeight:$e.lineHeightLG-2e-4},[`> ${Ee}-group`]:{[`> ${Ee}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${Je}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:$e.borderRadius,borderEndEndRadius:$e.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${Je}-button:not(${Ve}-btn-primary)`]:{color:$e.colorTextDescription,"&:hover":{color:$e.colorPrimaryHover},"&:active":{color:$e.colorPrimaryActive},[`&${Ve}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${Je}-button`]:{height:$e.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${Je}-button`]:{height:$e.controlHeightLG},[`&-small ${Je}-button`]:{height:$e.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${Ee}-compact-item`]:{[`&:not(${Ee}-compact-last-item)`]:{[`${Ee}-group-addon`]:{[`${Ee}-search-button`]:{marginInlineEnd:-$e.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}}}}},jt=$e=>{const{componentCls:Ee,paddingLG:Ve}=$e,Je=`${Ee}-textarea`;return{[Je]:{position:"relative","&-show-count":{[`> ${Ee}`]:{height:"100%"},[`${Ee}-data-count`]:{position:"absolute",bottom:-$e.fontSize*$e.lineHeight,insetInlineEnd:0,color:$e.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${Ee}`]:{paddingInlineEnd:Ve}},[`&-affix-wrapper${Je}-has-feedback`]:{[`${Ee}`]:{paddingInlineEnd:Ve}},[`&-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:$e.paddingXS,insetBlockStart:$e.paddingXS},[`${Je}-suffix`]:{position:"absolute",top:0,insetInlineEnd:$e.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}};function it($e){return(0,ze.TS)($e,{inputAffixPadding:$e.paddingXXS})}const vt=$e=>{const{controlHeight:Ee,fontSize:Ve,lineHeight:Je,lineWidth:Lt,controlHeightSM:et,controlHeightLG:Dt,fontSizeLG:Ge,lineHeightLG:kt,paddingSM:tt,controlPaddingHorizontalSM:$t,controlPaddingHorizontal:pt,colorFillAlter:Bt,colorPrimaryHover:Tt,controlOutlineWidth:wt,controlOutline:Ne,colorErrorOutline:be,colorWarningOutline:xt}=$e;return{paddingBlock:Math.max(Math.round((Ee-Ve*Je)/2*10)/10-Lt,3),paddingBlockSM:Math.max(Math.round((et-Ve*Je)/2*10)/10-Lt,0),paddingBlockLG:Math.ceil((Dt-Ge*kt)/2*10)/10-Lt,paddingInline:tt-Lt,paddingInlineSM:$t-Lt,paddingInlineLG:pt-Lt,addonBg:Bt,activeBorderColor:Tt,hoverBorderColor:Tt,activeShadow:`0 0 0 ${wt}px ${Ne}`,errorActiveShadow:`0 0 0 ${wt}px ${be}`,warningActiveShadow:`0 0 0 ${wt}px ${xt}`}};tn.ZP=(0,ut.Z)("Input",$e=>{const Ee=(0,ze.TS)($e,it($e));return[ft(Ee),jt(Ee),ot(Ee),at(Ee),Ct(Ee),(0,Te.c)(Ee)]},vt)},45818:function(bn,tn,ue){"use strict";ue.d(tn,{D:function(){return it},Z:function(){return Ee}});var se=ue(60499),Te=ue(59301),ze={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"},ut=ze,xe=ue(7657),Me=function(Je,Lt){return Te.createElement(xe.Z,(0,se.Z)({},Je,{ref:Lt,icon:ut}))},De=Te.forwardRef(Me),we=De,_e=ue(33853),Re=ue(38819),dt=ue(92310),Ae=ue.n(dt),Fe=ue(2738),Ye=Ve=>!isNaN(parseFloat(Ve))&&isFinite(Ve),ot=ue(36355),at=ue(84966),Ct=function(Ve,Je){var Lt={};for(var et in Ve)Object.prototype.hasOwnProperty.call(Ve,et)&&Je.indexOf(et)<0&&(Lt[et]=Ve[et]);if(Ve!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Dt=0,et=Object.getOwnPropertySymbols(Ve);Dt<et.length;Dt++)Je.indexOf(et[Dt])<0&&Object.prototype.propertyIsEnumerable.call(Ve,et[Dt])&&(Lt[et[Dt]]=Ve[et[Dt]]);return Lt};const jt={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px"},it=Te.createContext({}),vt=(()=>{let Ve=0;return function(){let Je=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return Ve+=1,`${Je}${Ve}`}})();var Ee=Te.forwardRef((Ve,Je)=>{const{prefixCls:Lt,className:et,trigger:Dt,children:Ge,defaultCollapsed:kt=!1,theme:tt="dark",style:$t={},collapsible:pt=!1,reverseArrow:Bt=!1,width:Tt=200,collapsedWidth:wt=80,zeroWidthTriggerStyle:Ne,breakpoint:be,onCollapse:xt,onBreakpoint:Qt}=Ve,Vt=Ct(Ve,["prefixCls","className","trigger","children","defaultCollapsed","theme","style","collapsible","reverseArrow","width","collapsedWidth","zeroWidthTriggerStyle","breakpoint","onCollapse","onBreakpoint"]),{siderHook:qe}=(0,Te.useContext)(at.Gs),[nt,Ot]=(0,Te.useState)("collapsed"in Ve?Ve.collapsed:kt),[dn,en]=(0,Te.useState)(!1);(0,Te.useEffect)(()=>{"collapsed"in Ve&&Ot(Ve.collapsed)},[Ve.collapsed]);const on=(oe,he)=>{"collapsed"in Ve||Ot(oe),xt==null||xt(oe,he)},Xt=(0,Te.useRef)();Xt.current=oe=>{en(oe.matches),Qt==null||Qt(oe.matches),nt!==oe.matches&&on(oe.matches,"responsive")},(0,Te.useEffect)(()=>{function oe(pe){return Xt.current(pe)}let he;if(typeof window!="undefined"){const{matchMedia:pe}=window;if(pe&&be&&be in jt){he=pe(`(max-width: ${jt[be]})`);try{he.addEventListener("change",oe)}catch(ce){he.addListener(oe)}oe(he)}}return()=>{try{he==null||he.removeEventListener("change",oe)}catch(pe){he==null||he.removeListener(oe)}}},[be]),(0,Te.useEffect)(()=>{const oe=vt("ant-sider-");return qe.addSider(oe),()=>qe.removeSider(oe)},[]);const Ut=()=>{on(!nt,"clickTrigger")},{getPrefixCls:Zt}=(0,Te.useContext)(ot.E_),ye=()=>{const oe=Zt("layout-sider",Lt),he=(0,Fe.Z)(Vt,["collapsed"]),pe=nt?wt:Tt,ce=Ye(pe)?`${pe}px`:String(pe),Ie=parseFloat(String(wt||0))===0?Te.createElement("span",{onClick:Ut,className:Ae()(`${oe}-zero-width-trigger`,`${oe}-zero-width-trigger-${Bt?"right":"left"}`),style:Ne},Dt||Te.createElement(we,null)):null,je={expanded:Bt?Te.createElement(Re.Z,null):Te.createElement(_e.Z,null),collapsed:Bt?Te.createElement(_e.Z,null):Te.createElement(Re.Z,null)}[nt?"collapsed":"expanded"],Rt=Dt!==null?Ie||Te.createElement("div",{className:`${oe}-trigger`,onClick:Ut,style:{width:ce}},Dt||je):null,At=Object.assign(Object.assign({},$t),{flex:`0 0 ${ce}`,maxWidth:ce,minWidth:ce,width:ce}),rt=Ae()(oe,`${oe}-${tt}`,{[`${oe}-collapsed`]:!!nt,[`${oe}-has-trigger`]:pt&&Dt!==null&&!Ie,[`${oe}-below`]:!!dn,[`${oe}-zero-width`]:parseFloat(ce)===0},et);return Te.createElement("aside",Object.assign({className:rt},he,{style:At,ref:Je}),Te.createElement("div",{className:`${oe}-children`},Ge),pt||dn&&Ie?Rt:null)},le=Te.useMemo(()=>({siderCollapsed:nt}),[nt]);return Te.createElement(it.Provider,{value:le},ye())})},44e3:function(bn,tn,ue){"use strict";var se=ue(84966),Te=ue(45818);const ze=se.ZP;ze.Header=se.h4,ze.Footer=se.$_,ze.Content=se.VY,ze.Sider=Te.Z,tn.default=ze},84966:function(bn,tn,ue){"use strict";ue.d(tn,{VY:function(){return it},$_:function(){return jt},h4:function(){return Ct},Gs:function(){return Fe},ZP:function(){return vt}});var se=ue(77654),Te=ue(92310),ze=ue.n(Te),ut=ue(2738),xe=ue(59301),Me=ue(36355),De=ue(83116),_e=$e=>{const{componentCls:Ee,bodyBg:Ve,lightSiderBg:Je,lightTriggerBg:Lt,lightTriggerColor:et}=$e;return{[`${Ee}-sider-light`]:{background:Je,[`${Ee}-sider-trigger`]:{color:et,background:Lt},[`${Ee}-sider-zero-width-trigger`]:{color:et,background:Lt,border:`1px solid ${Ve}`,borderInlineStart:0}}}};const Re=$e=>{const{antCls:Ee,componentCls:Ve,colorText:Je,triggerColor:Lt,footerBg:et,triggerBg:Dt,headerHeight:Ge,headerPadding:kt,headerColor:tt,footerPadding:$t,triggerHeight:pt,zeroTriggerHeight:Bt,zeroTriggerWidth:Tt,motionDurationMid:wt,motionDurationSlow:Ne,fontSize:be,borderRadius:xt,bodyBg:Qt,headerBg:Vt,siderBg:qe}=$e;return{[Ve]:Object.assign(Object.assign({display:"flex",flex:"auto",flexDirection:"column",minHeight:0,background:Qt,"&, *":{boxSizing:"border-box"},[`&${Ve}-has-sider`]:{flexDirection:"row",[`> ${Ve}, > ${Ve}-content`]:{width:0}},[`${Ve}-header, &${Ve}-footer`]:{flex:"0 0 auto"},[`${Ve}-sider`]:{position:"relative",minWidth:0,background:qe,transition:`all ${wt}, background 0s`,"&-children":{height:"100%",marginTop:-.1,paddingTop:.1,[`${Ee}-menu${Ee}-menu-inline-collapsed`]:{width:"auto"}},"&-has-trigger":{paddingBottom:pt},"&-right":{order:1},"&-trigger":{position:"fixed",bottom:0,zIndex:1,height:pt,color:Lt,lineHeight:`${pt}px`,textAlign:"center",background:Dt,cursor:"pointer",transition:`all ${wt}`},"&-zero-width":{"> *":{overflow:"hidden"},"&-trigger":{position:"absolute",top:Ge,insetInlineEnd:-Tt,zIndex:1,width:Tt,height:Bt,color:Lt,fontSize:$e.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:qe,borderStartStartRadius:0,borderStartEndRadius:xt,borderEndEndRadius:xt,borderEndStartRadius:0,cursor:"pointer",transition:`background ${Ne} ease`,"&::after":{position:"absolute",inset:0,background:"transparent",transition:`all ${Ne}`,content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:-Tt,borderStartStartRadius:xt,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:xt}}}}},_e($e)),{"&-rtl":{direction:"rtl"}}),[`${Ve}-header`]:{height:Ge,padding:kt,color:tt,lineHeight:`${Ge}px`,background:Vt,[`${Ee}-menu`]:{lineHeight:"inherit"}},[`${Ve}-footer`]:{padding:$t,color:Je,fontSize:be,background:et},[`${Ve}-content`]:{flex:"auto",minHeight:0}}};var dt=(0,De.Z)("Layout",$e=>[Re($e)],$e=>{const{colorBgLayout:Ee,controlHeight:Ve,controlHeightLG:Je,colorText:Lt,controlHeightSM:et,marginXXS:Dt,colorTextLightSolid:Ge,colorBgContainer:kt}=$e,tt=Je*1.25;return{colorBgHeader:"#001529",colorBgBody:Ee,colorBgTrigger:"#002140",bodyBg:Ee,headerBg:"#001529",headerHeight:Ve*2,headerPadding:`0 ${tt}px`,headerColor:Lt,footerPadding:`${et}px ${tt}px`,footerBg:Ee,siderBg:"#001529",triggerHeight:Je+Dt*2,triggerBg:"#002140",triggerColor:Ge,zeroTriggerWidth:Je,zeroTriggerHeight:Je,lightSiderBg:kt,lightTriggerBg:kt,lightTriggerColor:Lt}},{deprecatedTokens:[["colorBgBody","bodyBg"],["colorBgHeader","headerBg"],["colorBgTrigger","triggerBg"]]}),Ae=function($e,Ee){var Ve={};for(var Je in $e)Object.prototype.hasOwnProperty.call($e,Je)&&Ee.indexOf(Je)<0&&(Ve[Je]=$e[Je]);if($e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Lt=0,Je=Object.getOwnPropertySymbols($e);Lt<Je.length;Lt++)Ee.indexOf(Je[Lt])<0&&Object.prototype.propertyIsEnumerable.call($e,Je[Lt])&&(Ve[Je[Lt]]=$e[Je[Lt]]);return Ve};const Fe=xe.createContext({siderHook:{addSider:()=>null,removeSider:()=>null}});function ft($e){let{suffixCls:Ee,tagName:Ve,displayName:Je}=$e;return Lt=>xe.forwardRef((Dt,Ge)=>xe.createElement(Lt,Object.assign({ref:Ge,suffixCls:Ee,tagName:Ve},Dt)))}const Ye=xe.forwardRef(($e,Ee)=>{const{prefixCls:Ve,suffixCls:Je,className:Lt,tagName:et}=$e,Dt=Ae($e,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:Ge}=xe.useContext(Me.E_),kt=Ge("layout",Ve),[tt,$t]=dt(kt),pt=Je?`${kt}-${Je}`:kt;return tt(xe.createElement(et,Object.assign({className:ze()(Ve||pt,Lt,$t),ref:Ee},Dt)))}),ot=xe.forwardRef(($e,Ee)=>{const{direction:Ve}=xe.useContext(Me.E_),[Je,Lt]=xe.useState([]),{prefixCls:et,className:Dt,rootClassName:Ge,children:kt,hasSider:tt,tagName:$t,style:pt}=$e,Bt=Ae($e,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),Tt=(0,ut.Z)(Bt,["suffixCls"]),{getPrefixCls:wt,layout:Ne}=xe.useContext(Me.E_),be=wt("layout",et),[xt,Qt]=dt(be),Vt=ze()(be,{[`${be}-has-sider`]:typeof tt=="boolean"?tt:Je.length>0,[`${be}-rtl`]:Ve==="rtl"},Ne==null?void 0:Ne.className,Dt,Ge,Qt),qe=xe.useMemo(()=>({siderHook:{addSider:nt=>{Lt(Ot=>[].concat((0,se.Z)(Ot),[nt]))},removeSider:nt=>{Lt(Ot=>Ot.filter(dn=>dn!==nt))}}}),[]);return xt(xe.createElement(Fe.Provider,{value:qe},xe.createElement($t,Object.assign({ref:Ee,className:Vt,style:Object.assign(Object.assign({},Ne==null?void 0:Ne.style),pt)},Tt),kt)))}),at=ft({tagName:"div",displayName:"Layout"})(ot),Ct=ft({suffixCls:"header",tagName:"header",displayName:"Header"})(Ye),jt=ft({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(Ye),it=ft({suffixCls:"content",tagName:"main",displayName:"Content"})(Ye);var vt=at},40875:function(bn,tn,ue){"use strict";ue.d(tn,{J:function(){return Me}});var se=ue(59301),Te=ue(33234),ze=ue(70425),ut=function(De,we){var _e={};for(var Re in De)Object.prototype.hasOwnProperty.call(De,Re)&&we.indexOf(Re)<0&&(_e[Re]=De[Re]);if(De!=null&&typeof Object.getOwnPropertySymbols=="function")for(var dt=0,Re=Object.getOwnPropertySymbols(De);dt<Re.length;dt++)we.indexOf(Re[dt])<0&&Object.prototype.propertyIsEnumerable.call(De,Re[dt])&&(_e[Re[dt]]=De[Re[dt]]);return _e};const xe=se.createContext(null),Me=se.forwardRef((De,we)=>{const{children:_e}=De,Re=ut(De,["children"]),dt=se.useContext(xe),Ae=se.useMemo(()=>Object.assign(Object.assign({},dt),Re),[dt,Re.prefixCls,Re.mode,Re.selectable]);return se.createElement(xe.Provider,{value:Ae},se.createElement(Te.BR,null,(0,ze.supportNodeRef)(_e)?se.cloneElement(_e,{ref:we}):_e))});tn.Z=xe},20834:function(bn,tn,ue){"use strict";ue.d(tn,{default:function(){return le}});var se=ue(15285),Te=ue(59301),ze=ue(45818),ut=ue(92310),xe=ue.n(ut),Me=ue(36355),De=function(oe,he){var pe={};for(var ce in oe)Object.prototype.hasOwnProperty.call(oe,ce)&&he.indexOf(ce)<0&&(pe[ce]=oe[ce]);if(oe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ie=0,ce=Object.getOwnPropertySymbols(oe);Ie<ce.length;Ie++)he.indexOf(ce[Ie])<0&&Object.prototype.propertyIsEnumerable.call(oe,ce[Ie])&&(pe[ce[Ie]]=oe[ce[Ie]]);return pe},_e=oe=>{const{prefixCls:he,className:pe,dashed:ce}=oe,Ie=De(oe,["prefixCls","className","dashed"]),{getPrefixCls:yt}=Te.useContext(Me.E_),Pe=yt("menu",he),je=xe()({[`${Pe}-item-divider-dashed`]:!!ce},pe);return Te.createElement(se.iz,Object.assign({className:je},Ie))},Re=ue(11592),dt=ue(2738),Ae=ue(6848),Fe=ue(92343),Ye=(0,Te.createContext)({prefixCls:"",firstLevel:!0,inlineCollapsed:!1}),at=oe=>{var he;const{className:pe,children:ce,icon:Ie,title:yt,danger:Pe}=oe,{prefixCls:je,firstLevel:Rt,direction:At,disableMenuItemTitleTooltip:rt,inlineCollapsed:Ft}=Te.useContext(Ye),sn=Nt=>{const vn=Te.createElement("span",{className:`${je}-title-content`},ce);return(!Ie||(0,Fe.l$)(ce)&&ce.type==="span")&&ce&&Nt&&Rt&&typeof ce=="string"?Te.createElement("div",{className:`${je}-inline-collapsed-noicon`},ce.charAt(0)):vn},{siderCollapsed:ct}=Te.useContext(ze.D);let qt=yt;typeof yt=="undefined"?qt=Rt?ce:"":yt===!1&&(qt="");const an={title:qt};!ct&&!Ft&&(an.title=null,an.open=!1);const Qe=(0,Re.Z)(ce).length;let mt=Te.createElement(se.ck,Object.assign({},(0,dt.Z)(oe,["title","icon","danger"]),{className:xe()({[`${je}-item-danger`]:Pe,[`${je}-item-only-child`]:(Ie?Qe+1:Qe)===1},pe),title:typeof yt=="string"?yt:void 0}),(0,Fe.Tm)(Ie,{className:xe()((0,Fe.l$)(Ie)?(he=Ie.props)===null||he===void 0?void 0:he.className:"",`${je}-item-icon`)}),sn(Ft));return rt||(mt=Te.createElement(Ae.Z,Object.assign({},an,{placement:At==="rtl"?"left":"right",overlayClassName:`${je}-inline-collapsed-tooltip`}),mt)),mt},jt=oe=>{var he;const{popupClassName:pe,icon:ce,title:Ie,theme:yt}=oe,Pe=Te.useContext(Ye),{prefixCls:je,inlineCollapsed:Rt,theme:At}=Pe,rt=(0,se.Xl)();let Ft;if(!ce)Ft=Rt&&!rt.length&&Ie&&typeof Ie=="string"?Te.createElement("div",{className:`${je}-inline-collapsed-noicon`},Ie.charAt(0)):Te.createElement("span",{className:`${je}-title-content`},Ie);else{const ct=(0,Fe.l$)(Ie)&&Ie.type==="span";Ft=Te.createElement(Te.Fragment,null,(0,Fe.Tm)(ce,{className:xe()((0,Fe.l$)(ce)?(he=ce.props)===null||he===void 0?void 0:he.className:"",`${je}-item-icon`)}),ct?Ie:Te.createElement("span",{className:`${je}-title-content`},Ie))}const sn=Te.useMemo(()=>Object.assign(Object.assign({},Pe),{firstLevel:!1}),[Pe]);return Te.createElement(Ye.Provider,{value:sn},Te.createElement(se.Wd,Object.assign({},(0,dt.Z)(oe,["icon"]),{title:Ft,popupClassName:xe()(je,pe,`${je}-${yt||At}`)})))},it=ue(18785),vt=ue(70425),$e=ue(62892),Ee=ue(40875),Ve=function(oe,he){var pe={};for(var ce in oe)Object.prototype.hasOwnProperty.call(oe,ce)&&he.indexOf(ce)<0&&(pe[ce]=oe[ce]);if(oe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ie=0,ce=Object.getOwnPropertySymbols(oe);Ie<ce.length;Ie++)he.indexOf(ce[Ie])<0&&Object.prototype.propertyIsEnumerable.call(oe,ce[Ie])&&(pe[ce[Ie]]=oe[ce[Ie]]);return pe};function Je(oe){return(oe||[]).map((he,pe)=>{if(he&&typeof he=="object"){const ce=he,{label:Ie,children:yt,key:Pe,type:je}=ce,Rt=Ve(ce,["label","children","key","type"]),At=Pe!=null?Pe:`tmp-${pe}`;return yt||je==="group"?je==="group"?Te.createElement(se.BW,Object.assign({key:At},Rt,{title:Ie}),Je(yt)):Te.createElement(jt,Object.assign({key:At},Rt,{title:Ie}),Je(yt)):je==="divider"?Te.createElement(_e,Object.assign({key:At},Rt)):Te.createElement(at,Object.assign({key:At},Rt),Ie)}return null}).filter(he=>he)}function Lt(oe){return Te.useMemo(()=>oe&&Je(oe),[oe])}var et=ue(64993),Dt=ue(17313),Ge=ue(8378),kt=ue(13826),tt=ue(29878),$t=ue(83116),pt=ue(37613),Tt=oe=>{const{componentCls:he,motionDurationSlow:pe,horizontalLineHeight:ce,colorSplit:Ie,lineWidth:yt,lineType:Pe,itemPaddingInline:je}=oe;return{[`${he}-horizontal`]:{lineHeight:ce,border:0,borderBottom:`${yt}px ${Pe} ${Ie}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${he}-item, ${he}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:je},[`> ${he}-item:hover,
> ${he}-item-active,
> ${he}-submenu ${he}-submenu-title:hover`]:{backgroundColor:"transparent"},[`${he}-item, ${he}-submenu-title`]:{transition:[`border-color ${pe}`,`background ${pe}`].join(",")},[`${he}-submenu-arrow`]:{display:"none"}}}},Ne=oe=>{let{componentCls:he,menuArrowOffset:pe}=oe;return{[`${he}-rtl`]:{direction:"rtl"},[`${he}-submenu-rtl`]:{transformOrigin:"100% 0"},[`${he}-rtl${he}-vertical,
${he}-submenu-rtl ${he}-vertical`]:{[`${he}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(-${pe})`},"&::after":{transform:`rotate(45deg) translateY(${pe})`}}}}};const be=oe=>Object.assign({},(0,Dt.oN)(oe));var Qt=(oe,he)=>{const{componentCls:pe,itemColor:ce,itemSelectedColor:Ie,groupTitleColor:yt,itemBg:Pe,subMenuItemBg:je,itemSelectedBg:Rt,activeBarHeight:At,activeBarWidth:rt,activeBarBorderWidth:Ft,motionDurationSlow:sn,motionEaseInOut:ct,motionEaseOut:qt,itemPaddingInline:an,motionDurationMid:Qe,itemHoverColor:mt,lineType:Nt,colorSplit:vn,itemDisabledColor:mn,dangerItemColor:wn,dangerItemHoverColor:Tn,dangerItemSelectedColor:Zn,dangerItemActiveBg:Hn,dangerItemSelectedBg:wr,itemHoverBg:Cr,itemActiveBg:Yn,menuSubMenuBg:Nr,horizontalItemSelectedColor:Kr,horizontalItemSelectedBg:Or,horizontalItemBorderRadius:Ar,horizontalItemHoverBg:kr,popupBg:Gr}=oe;return{[`${pe}-${he}, ${pe}-${he} > ${pe}`]:{color:ce,background:Pe,[`&${pe}-root:focus-visible`]:Object.assign({},be(oe)),[`${pe}-item-group-title`]:{color:yt},[`${pe}-submenu-selected`]:{[`> ${pe}-submenu-title`]:{color:Ie}},[`${pe}-item-disabled, ${pe}-submenu-disabled`]:{color:`${mn} !important`},[`${pe}-item:not(${pe}-item-selected):not(${pe}-submenu-selected)`]:{[`&:hover, > ${pe}-submenu-title:hover`]:{color:mt}},[`&:not(${pe}-horizontal)`]:{[`${pe}-item:not(${pe}-item-selected)`]:{"&:hover":{backgroundColor:Cr},"&:active":{backgroundColor:Yn}},[`${pe}-submenu-title`]:{"&:hover":{backgroundColor:Cr},"&:active":{backgroundColor:Yn}}},[`${pe}-item-danger`]:{color:wn,[`&${pe}-item:hover`]:{[`&:not(${pe}-item-selected):not(${pe}-submenu-selected)`]:{color:Tn}},[`&${pe}-item:active`]:{background:Hn}},[`${pe}-item a`]:{"&, &:hover":{color:"inherit"}},[`${pe}-item-selected`]:{color:Ie,[`&${pe}-item-danger`]:{color:Zn},"a, a:hover":{color:"inherit"}},[`& ${pe}-item-selected`]:{backgroundColor:Rt,[`&${pe}-item-danger`]:{backgroundColor:wr}},[`${pe}-item, ${pe}-submenu-title`]:{[`&:not(${pe}-item-disabled):focus-visible`]:Object.assign({},be(oe))},[`&${pe}-submenu > ${pe}`]:{backgroundColor:Nr},[`&${pe}-popup > ${pe}`]:{backgroundColor:Gr},[`&${pe}-horizontal`]:Object.assign(Object.assign({},he==="dark"?{borderBottom:0}:{}),{[`> ${pe}-item, > ${pe}-submenu`]:{top:Ft,marginTop:-Ft,marginBottom:0,borderRadius:Ar,"&::after":{position:"absolute",insetInline:an,bottom:0,borderBottom:`${At}px solid transparent`,transition:`border-color ${sn} ${ct}`,content:'""'},"&:hover, &-active, &-open":{background:kr,"&::after":{borderBottomWidth:At,borderBottomColor:Kr}},"&-selected":{color:Kr,backgroundColor:Or,"&:hover":{backgroundColor:Or},"&::after":{borderBottomWidth:At,borderBottomColor:Kr}}}}),[`&${pe}-root`]:{[`&${pe}-inline, &${pe}-vertical`]:{borderInlineEnd:`${Ft}px ${Nt} ${vn}`}},[`&${pe}-inline`]:{[`${pe}-sub${pe}-inline`]:{background:je},[`${pe}-item, ${pe}-submenu-title`]:Ft&&rt?{width:`calc(100% + ${Ft}px)`}:{},[`${pe}-item`]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${rt}px solid ${Ie}`,transform:"scaleY(0.0001)",opacity:0,transition:[`transform ${Qe} ${qt}`,`opacity ${Qe} ${qt}`].join(","),content:'""'},[`&${pe}-item-danger`]:{"&::after":{borderInlineEndColor:Zn}}},[`${pe}-selected, ${pe}-item-selected`]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:[`transform ${Qe} ${ct}`,`opacity ${Qe} ${ct}`].join(",")}}}}}};const Vt=oe=>{const{componentCls:he,itemHeight:pe,itemMarginInline:ce,padding:Ie,menuArrowSize:yt,marginXS:Pe,itemMarginBlock:je}=oe,Rt=Ie+yt+Pe;return{[`${he}-item`]:{position:"relative",overflow:"hidden"},[`${he}-item, ${he}-submenu-title`]:{height:pe,lineHeight:`${pe}px`,paddingInline:Ie,overflow:"hidden",textOverflow:"ellipsis",marginInline:ce,marginBlock:je,width:`calc(100% - ${ce*2}px)`},[`> ${he}-item,
> ${he}-submenu > ${he}-submenu-title`]:{height:pe,lineHeight:`${pe}px`},[`${he}-item-group-list ${he}-submenu-title,
${he}-submenu-title`]:{paddingInlineEnd:Rt}}};var nt=oe=>{const{componentCls:he,iconCls:pe,itemHeight:ce,colorTextLightSolid:Ie,dropdownWidth:yt,controlHeightLG:Pe,motionDurationMid:je,motionEaseOut:Rt,paddingXL:At,itemMarginInline:rt,fontSizeLG:Ft,motionDurationSlow:sn,paddingXS:ct,boxShadowSecondary:qt,collapsedWidth:an,collapsedIconSize:Qe}=oe,mt={height:ce,lineHeight:`${ce}px`,listStylePosition:"inside",listStyleType:"disc"};return[{[he]:{"&-inline, &-vertical":Object.assign({[`&${he}-root`]:{boxShadow:"none"}},Vt(oe))},[`${he}-submenu-popup`]:{[`${he}-vertical`]:Object.assign(Object.assign({},Vt(oe)),{boxShadow:qt})}},{[`${he}-submenu-popup ${he}-vertical${he}-sub`]:{minWidth:yt,maxHeight:`calc(100vh - ${Pe*2.5}px)`,padding:"0",overflow:"hidden",borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:"hidden",overflowY:"auto"}}},{[`${he}-inline`]:{width:"100%",[`&${he}-root`]:{[`${he}-item, ${he}-submenu-title`]:{display:"flex",alignItems:"center",transition:[`border-color ${sn}`,`background ${sn}`,`padding ${je} ${Rt}`].join(","),[`> ${he}-title-content`]:{flex:"auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},"> *":{flex:"none"}}},[`${he}-sub${he}-inline`]:{padding:0,border:0,borderRadius:0,boxShadow:"none",[`& > ${he}-submenu > ${he}-submenu-title`]:mt,[`& ${he}-item-group-title`]:{paddingInlineStart:At}},[`${he}-item`]:mt}},{[`${he}-inline-collapsed`]:{width:an,[`&${he}-root`]:{[`${he}-item, ${he}-submenu ${he}-submenu-title`]:{[`> ${he}-inline-collapsed-noicon`]:{fontSize:Ft,textAlign:"center"}}},[`> ${he}-item,
> ${he}-item-group > ${he}-item-group-list > ${he}-item,
> ${he}-item-group > ${he}-item-group-list > ${he}-submenu > ${he}-submenu-title,
> ${he}-submenu > ${he}-submenu-title`]:{insetInlineStart:0,paddingInline:`calc(50% - ${Ft/2}px - ${rt}px)`,textOverflow:"clip",[`
${he}-submenu-arrow,
${he}-submenu-expand-icon
`]:{opacity:0},[`${he}-item-icon, ${pe}`]:{margin:0,fontSize:Qe,lineHeight:`${ce}px`,"+ span":{display:"inline-block",opacity:0}}},[`${he}-item-icon, ${pe}`]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",[`${he}-item-icon, ${pe}`]:{display:"none"},"a, a:hover":{color:Ie}},[`${he}-item-group-title`]:Object.assign(Object.assign({},Dt.vS),{paddingInline:ct})}}]};const Ot=oe=>{const{componentCls:he,motionDurationSlow:pe,motionDurationMid:ce,motionEaseInOut:Ie,motionEaseOut:yt,iconCls:Pe,iconSize:je,iconMarginInlineEnd:Rt}=oe;return{[`${he}-item, ${he}-submenu-title`]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:[`border-color ${pe}`,`background ${pe}`,`padding ${pe} ${Ie}`].join(","),[`${he}-item-icon, ${Pe}`]:{minWidth:je,fontSize:je,transition:[`font-size ${ce} ${yt}`,`margin ${pe} ${Ie}`,`color ${pe}`].join(","),"+ span":{marginInlineStart:Rt,opacity:1,transition:[`opacity ${pe} ${Ie}`,`margin ${pe}`,`color ${pe}`].join(",")}},[`${he}-item-icon`]:Object.assign({},(0,Dt.Ro)()),[`&${he}-item-only-child`]:{[`> ${Pe}, > ${he}-item-icon`]:{marginInlineEnd:0}}},[`${he}-item-disabled, ${he}-submenu-disabled`]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important"},[`> ${he}-submenu-title`]:{color:"inherit !important",cursor:"not-allowed"}}}},dn=oe=>{const{componentCls:he,motionDurationSlow:pe,motionEaseInOut:ce,borderRadius:Ie,menuArrowSize:yt,menuArrowOffset:Pe}=oe;return{[`${he}-submenu`]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:oe.margin,width:yt,color:"currentcolor",transform:"translateY(-50%)",transition:`transform ${pe} ${ce}, opacity ${pe}`},"&-arrow":{"&::before, &::after":{position:"absolute",width:yt*.6,height:yt*.15,backgroundColor:"currentcolor",borderRadius:Ie,transition:[`background ${pe} ${ce}`,`transform ${pe} ${ce}`,`top ${pe} ${ce}`,`color ${pe} ${ce}`].join(","),content:'""'},"&::before":{transform:`rotate(45deg) translateY(-${Pe})`},"&::after":{transform:`rotate(-45deg) translateY(${Pe})`}}}}},en=oe=>{const{antCls:he,componentCls:pe,fontSize:ce,motionDurationSlow:Ie,motionDurationMid:yt,motionEaseInOut:Pe,paddingXS:je,padding:Rt,colorSplit:At,lineWidth:rt,zIndexPopup:Ft,borderRadiusLG:sn,subMenuItemBorderRadius:ct,menuArrowSize:qt,menuArrowOffset:an,lineType:Qe,menuPanelMaskInset:mt,groupTitleLineHeight:Nt,groupTitleFontSize:vn}=oe;return[{"":{[`${pe}`]:Object.assign(Object.assign({},(0,Dt.dF)()),{"&-hidden":{display:"none"}})},[`${pe}-submenu-hidden`]:{display:"none"}},{[pe]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,Dt.Wf)(oe)),(0,Dt.dF)()),{marginBottom:0,paddingInlineStart:0,fontSize:ce,lineHeight:0,listStyle:"none",outline:"none",transition:`width ${Ie} cubic-bezier(0.2, 0, 0, 1) 0s`,"ul, ol":{margin:0,padding:0,listStyle:"none"},"&-overflow":{display:"flex",[`${pe}-item`]:{flex:"none"}},[`${pe}-item, ${pe}-submenu, ${pe}-submenu-title`]:{borderRadius:oe.itemBorderRadius},[`${pe}-item-group-title`]:{padding:`${je}px ${Rt}px`,fontSize:vn,lineHeight:Nt,transition:`all ${Ie}`},[`&-horizontal ${pe}-submenu`]:{transition:[`border-color ${Ie} ${Pe}`,`background ${Ie} ${Pe}`].join(",")},[`${pe}-submenu, ${pe}-submenu-inline`]:{transition:[`border-color ${Ie} ${Pe}`,`background ${Ie} ${Pe}`,`padding ${yt} ${Pe}`].join(",")},[`${pe}-submenu ${pe}-sub`]:{cursor:"initial",transition:[`background ${Ie} ${Pe}`,`padding ${Ie} ${Pe}`].join(",")},[`${pe}-title-content`]:{transition:`color ${Ie}`},[`${pe}-item a`]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},[`${pe}-item-divider`]:{overflow:"hidden",lineHeight:0,borderColor:At,borderStyle:Qe,borderWidth:0,borderTopWidth:rt,marginBlock:rt,padding:0,"&-dashed":{borderStyle:"dashed"}}}),Ot(oe)),{[`${pe}-item-group`]:{[`${pe}-item-group-list`]:{margin:0,padding:0,[`${pe}-item, ${pe}-submenu-title`]:{paddingInline:`${ce*2}px ${Rt}px`}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:Ft,borderRadius:sn,boxShadow:"none",transformOrigin:"0 0",[`&${pe}-submenu`]:{background:"transparent"},"&::before":{position:"absolute",inset:`${mt}px 0 0`,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'}},"&-placement-rightTop::before":{top:0,insetInlineStart:mt},"\n &-placement-leftTop,\n &-placement-bottomRight,\n ":{transformOrigin:"100% 0"},"\n &-placement-leftBottom,\n &-placement-topRight,\n ":{transformOrigin:"100% 100%"},"\n &-placement-rightBottom,\n &-placement-topLeft,\n ":{transformOrigin:"0 100%"},"\n &-placement-bottomLeft,\n &-placement-rightTop,\n ":{transformOrigin:"0 0"},"\n &-placement-leftTop,\n &-placement-leftBottom\n ":{paddingInlineEnd:oe.paddingXS},"\n &-placement-rightTop,\n &-placement-rightBottom\n ":{paddingInlineStart:oe.paddingXS},"\n &-placement-topRight,\n &-placement-topLeft\n ":{paddingBottom:oe.paddingXS},"\n &-placement-bottomRight,\n &-placement-bottomLeft\n ":{paddingTop:oe.paddingXS},[`> ${pe}`]:Object.assign(Object.assign(Object.assign({borderRadius:sn},Ot(oe)),dn(oe)),{[`${pe}-item, ${pe}-submenu > ${pe}-submenu-title`]:{borderRadius:ct},[`${pe}-submenu-title::after`]:{transition:`transform ${Ie} ${Pe}`}})}}),dn(oe)),{[`&-inline-collapsed ${pe}-submenu-arrow,
&-inline ${pe}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${an})`},"&::after":{transform:`rotate(45deg) translateX(-${an})`}},[`${pe}-submenu-open${pe}-submenu-inline > ${pe}-submenu-title > ${pe}-submenu-arrow`]:{transform:`translateY(-${qt*.2}px)`,"&::after":{transform:`rotate(-45deg) translateX(-${an})`},"&::before":{transform:`rotate(45deg) translateX(${an})`}}})},{[`${he}-layout-header`]:{[pe]:{lineHeight:"inherit"}}}]};var on=(oe,he)=>(0,$t.Z)("Menu",ce=>{if(he===!1)return[];const{colorBgElevated:Ie,colorPrimary:yt,colorTextLightSolid:Pe,controlHeightLG:je,fontSize:Rt,darkItemColor:At,darkDangerItemColor:rt,darkItemBg:Ft,darkSubMenuItemBg:sn,darkItemSelectedColor:ct,darkItemSelectedBg:qt,darkDangerItemSelectedBg:an,darkItemHoverBg:Qe,darkGroupTitleColor:mt,darkItemHoverColor:Nt,darkItemDisabledColor:vn,darkDangerItemHoverColor:mn,darkDangerItemSelectedColor:wn,darkDangerItemActiveBg:Tn}=ce,Zn=Rt/7*5,Hn=(0,pt.TS)(ce,{menuArrowSize:Zn,menuHorizontalHeight:je*1.15,menuArrowOffset:`${Zn*.25}px`,menuPanelMaskInset:-7,menuSubMenuBg:Ie}),wr=(0,pt.TS)(Hn,{itemColor:At,itemHoverColor:Nt,groupTitleColor:mt,itemSelectedColor:ct,itemBg:Ft,popupBg:Ft,subMenuItemBg:sn,itemActiveBg:"transparent",itemSelectedBg:qt,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:Qe,itemDisabledColor:vn,dangerItemColor:rt,dangerItemHoverColor:mn,dangerItemSelectedColor:wn,dangerItemActiveBg:Tn,dangerItemSelectedBg:an,menuSubMenuBg:sn,horizontalItemSelectedColor:Pe,horizontalItemSelectedBg:yt});return[en(Hn),Tt(Hn),nt(Hn),Qt(Hn,"light"),Qt(wr,"dark"),Ne(Hn),(0,Ge.Z)(Hn),(0,kt.oN)(Hn,"slide-up"),(0,kt.oN)(Hn,"slide-down"),(0,tt._y)(Hn,"zoom-big")]},ce=>{const{colorPrimary:Ie,colorError:yt,colorTextDisabled:Pe,colorErrorBg:je,colorText:Rt,colorTextDescription:At,colorBgContainer:rt,colorFillAlter:Ft,colorFillContent:sn,lineWidth:ct,lineWidthBold:qt,controlItemBgActive:an,colorBgTextHover:Qe,controlHeightLG:mt,lineHeight:Nt,colorBgElevated:vn,marginXXS:mn,padding:wn,fontSize:Tn,controlHeightSM:Zn,fontSizeLG:Hn,colorTextLightSolid:wr,colorErrorHover:Cr}=ce,Yn=new et.C(wr).setAlpha(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:ce.zIndexPopupBase+50,radiusItem:ce.borderRadiusLG,itemBorderRadius:ce.borderRadiusLG,radiusSubMenuItem:ce.borderRadiusSM,subMenuItemBorderRadius:ce.borderRadiusSM,colorItemText:Rt,itemColor:Rt,colorItemTextHover:Rt,itemHoverColor:Rt,colorItemTextHoverHorizontal:Ie,horizontalItemHoverColor:Ie,colorGroupTitle:At,groupTitleColor:At,colorItemTextSelected:Ie,itemSelectedColor:Ie,colorItemTextSelectedHorizontal:Ie,horizontalItemSelectedColor:Ie,colorItemBg:rt,itemBg:rt,colorItemBgHover:Qe,itemHoverBg:Qe,colorItemBgActive:sn,itemActiveBg:an,colorSubItemBg:Ft,subMenuItemBg:Ft,colorItemBgSelected:an,itemSelectedBg:an,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:0,colorActiveBarHeight:qt,activeBarHeight:qt,colorActiveBarBorderSize:ct,activeBarBorderWidth:ct,colorItemTextDisabled:Pe,itemDisabledColor:Pe,colorDangerItemText:yt,dangerItemColor:yt,colorDangerItemTextHover:yt,dangerItemHoverColor:yt,colorDangerItemTextSelected:yt,dangerItemSelectedColor:yt,colorDangerItemBgActive:je,dangerItemActiveBg:je,colorDangerItemBgSelected:je,dangerItemSelectedBg:je,itemMarginInline:ce.marginXXS,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:mt,groupTitleLineHeight:Nt,collapsedWidth:mt*2,popupBg:vn,itemMarginBlock:mn,itemPaddingInline:wn,horizontalLineHeight:`${mt*1.15}px`,iconSize:Tn,iconMarginInlineEnd:Zn-Tn,collapsedIconSize:Hn,groupTitleFontSize:Tn,darkItemDisabledColor:new et.C(wr).setAlpha(.25).toRgbString(),darkItemColor:Yn,darkDangerItemColor:yt,darkItemBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:wr,darkItemSelectedBg:Ie,darkDangerItemSelectedBg:yt,darkItemHoverBg:"transparent",darkGroupTitleColor:Yn,darkItemHoverColor:wr,darkDangerItemHoverColor:Cr,darkDangerItemSelectedColor:wr,darkDangerItemActiveBg:yt}},{deprecatedTokens:[["colorGroupTitle","groupTitleColor"],["radiusItem","itemBorderRadius"],["radiusSubMenuItem","subMenuItemBorderRadius"],["colorItemText","itemColor"],["colorItemTextHover","itemHoverColor"],["colorItemTextHoverHorizontal","horizontalItemHoverColor"],["colorItemTextSelected","itemSelectedColor"],["colorItemTextSelectedHorizontal","horizontalItemSelectedColor"],["colorItemTextDisabled","itemDisabledColor"],["colorDangerItemText","dangerItemColor"],["colorDangerItemTextHover","dangerItemHoverColor"],["colorDangerItemTextSelected","dangerItemSelectedColor"],["colorDangerItemBgActive","dangerItemActiveBg"],["colorDangerItemBgSelected","dangerItemSelectedBg"],["colorItemBg","itemBg"],["colorItemBgHover","itemHoverBg"],["colorSubItemBg","subMenuItemBg"],["colorItemBgActive","itemActiveBg"],["colorItemBgSelectedHorizontal","horizontalItemSelectedBg"],["colorActiveBarWidth","activeBarWidth"],["colorActiveBarHeight","activeBarHeight"],["colorActiveBarBorderSize","activeBarBorderWidth"],["colorItemBgSelected","itemSelectedBg"]]})(oe),Xt=function(oe,he){var pe={};for(var ce in oe)Object.prototype.hasOwnProperty.call(oe,ce)&&he.indexOf(ce)<0&&(pe[ce]=oe[ce]);if(oe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ie=0,ce=Object.getOwnPropertySymbols(oe);Ie<ce.length;Ie++)he.indexOf(ce[Ie])<0&&Object.prototype.propertyIsEnumerable.call(oe,ce[Ie])&&(pe[ce[Ie]]=oe[ce[Ie]]);return pe},Zt=(0,Te.forwardRef)((oe,he)=>{var pe,ce;const Ie=Te.useContext(Ee.Z),yt=Ie||{},{getPrefixCls:Pe,getPopupContainer:je,direction:Rt,menu:At}=Te.useContext(Me.E_),rt=Pe(),{prefixCls:Ft,className:sn,style:ct,theme:qt="light",expandIcon:an,_internalDisableMenuItemTitleTooltip:Qe,inlineCollapsed:mt,siderCollapsed:Nt,items:vn,children:mn,rootClassName:wn,mode:Tn,selectable:Zn,onClick:Hn,overflowedIndicatorPopupClassName:wr}=oe,Cr=Xt(oe,["prefixCls","className","style","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","items","children","rootClassName","mode","selectable","onClick","overflowedIndicatorPopupClassName"]),Yn=(0,dt.Z)(Cr,["collapsedWidth"]),Nr=Lt(vn)||mn;(pe=yt.validator)===null||pe===void 0||pe.call(yt,{mode:Tn});const Kr=(0,vt.useEvent)(function(){var dr;Hn==null||Hn.apply(void 0,arguments),(dr=yt.onClick)===null||dr===void 0||dr.call(yt)}),Or=yt.mode||Tn,Ar=Zn!=null?Zn:yt.selectable,kr=Te.useMemo(()=>Nt!==void 0?Nt:mt,[mt,Nt]),Gr={horizontal:{motionName:`${rt}-slide-up`},inline:(0,$e.Z)(rt),other:{motionName:`${rt}-zoom-big`}},ar=Pe("menu",Ft||yt.prefixCls),[$r,Ur]=on(ar,!Ie),Vr=xe()(`${ar}-${qt}`,At==null?void 0:At.className,sn);let Yr;if(typeof an=="function")Yr=an;else if(an===null||an===!1)Yr=null;else if(yt.expandIcon===null||yt.expandIcon===!1)Yr=null;else{const dr=an!=null?an:yt.expandIcon;Yr=(0,Fe.Tm)(dr,{className:xe()(`${ar}-submenu-expand-icon`,(0,Fe.l$)(dr)?(ce=dr.props)===null||ce===void 0?void 0:ce.className:"")})}const Zr=Te.useMemo(()=>({prefixCls:ar,inlineCollapsed:kr||!1,direction:Rt,firstLevel:!0,theme:qt,mode:Or,disableMenuItemTitleTooltip:Qe}),[ar,kr,Rt,Qe,qt]);return $r(Te.createElement(Ee.Z.Provider,{value:null},Te.createElement(Ye.Provider,{value:Zr},Te.createElement(se.ZP,Object.assign({getPopupContainer:je,overflowedIndicator:Te.createElement(it.Z,null),overflowedIndicatorPopupClassName:xe()(ar,`${ar}-${qt}`,wr),mode:Or,selectable:Ar,onClick:Kr},Yn,{inlineCollapsed:kr,style:Object.assign(Object.assign({},At==null?void 0:At.style),ct),className:Vr,prefixCls:ar,direction:Rt,defaultMotions:Gr,expandIcon:Yr,ref:he,rootClassName:xe()(wn,Ur)}),Nr))))});const ye=(0,Te.forwardRef)((oe,he)=>{const pe=(0,Te.useRef)(null),ce=Te.useContext(ze.D);return(0,Te.useImperativeHandle)(he,()=>({menu:pe.current,focus:Ie=>{var yt;(yt=pe.current)===null||yt===void 0||yt.focus(Ie)}})),Te.createElement(Zt,Object.assign({ref:pe},oe,ce))});ye.Item=at,ye.SubMenu=jt,ye.Divider=_e,ye.ItemGroup=se.BW;var le=ye},58421:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return yt}});var se=ue(60499),Te=ue(59301),ze={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"},ut=ze,xe=ue(7657),Me=function(je,Rt){return Te.createElement(xe.Z,(0,se.Z)({},je,{ref:Rt,icon:ut}))},De=Te.forwardRef(Me),we=De,_e=ue(49198),Re=ue(33853),dt=ue(38819),Ae=ue(92310),Fe=ue.n(Ae),ft=ue(18642),Ye=ue(85899),ot=ue(38705),at=ue(17212),Ct=ue(39153),jt=ue(55401),it=ue(26112),vt={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},$e=vt,Ee=ue(91735),Ve=function(Pe){(0,Ct.Z)(Rt,Pe);var je=(0,jt.Z)(Rt);function Rt(){var At;(0,ot.Z)(this,Rt);for(var rt=arguments.length,Ft=new Array(rt),sn=0;sn<rt;sn++)Ft[sn]=arguments[sn];return At=je.call.apply(je,[this].concat(Ft)),At.state={goInputText:""},At.getValidValue=function(){var ct=At.state.goInputText;return!ct||Number.isNaN(ct)?void 0:Number(ct)},At.buildOptionText=function(ct){return"".concat(ct," ").concat(At.props.locale.items_per_page)},At.changeSize=function(ct){At.props.changeSize(Number(ct))},At.handleChange=function(ct){At.setState({goInputText:ct.target.value})},At.handleBlur=function(ct){var qt=At.props,an=qt.goButton,Qe=qt.quickGo,mt=qt.rootPrefixCls,Nt=At.state.goInputText;an||Nt===""||(At.setState({goInputText:""}),!(ct.relatedTarget&&(ct.relatedTarget.className.indexOf("".concat(mt,"-item-link"))>=0||ct.relatedTarget.className.indexOf("".concat(mt,"-item"))>=0))&&Qe(At.getValidValue()))},At.go=function(ct){var qt=At.state.goInputText;qt!==""&&(ct.keyCode===$e.ENTER||ct.type==="click")&&(At.setState({goInputText:""}),At.props.quickGo(At.getValidValue()))},At}return(0,at.Z)(Rt,[{key:"getPageSizeOptions",value:function(){var rt=this.props,Ft=rt.pageSize,sn=rt.pageSizeOptions;return sn.some(function(ct){return ct.toString()===Ft.toString()})?sn:sn.concat([Ft.toString()]).sort(function(ct,qt){var an=Number.isNaN(Number(ct))?0:Number(ct),Qe=Number.isNaN(Number(qt))?0:Number(qt);return an-Qe})}},{key:"render",value:function(){var rt=this,Ft=this.props,sn=Ft.pageSize,ct=Ft.locale,qt=Ft.rootPrefixCls,an=Ft.changeSize,Qe=Ft.quickGo,mt=Ft.goButton,Nt=Ft.selectComponentClass,vn=Ft.buildOptionText,mn=Ft.selectPrefixCls,wn=Ft.disabled,Tn=this.state.goInputText,Zn="".concat(qt,"-options"),Hn=Nt,wr=null,Cr=null,Yn=null;if(!an&&!Qe)return null;var Nr=this.getPageSizeOptions();if(an&&Hn){var Kr=Nr.map(function(Or,Ar){return Te.createElement(Hn.Option,{key:Ar,value:Or.toString()},(vn||rt.buildOptionText)(Or))});wr=Te.createElement(Hn,{disabled:wn,prefixCls:mn,showSearch:!1,className:"".concat(Zn,"-size-changer"),optionLabelProp:"children",popupMatchSelectWidth:!1,value:(sn||Nr[0]).toString(),onChange:this.changeSize,getPopupContainer:function(Ar){return Ar.parentNode},"aria-label":ct.page_size,defaultOpen:!1},Kr)}return Qe&&(mt&&(Yn=typeof mt=="boolean"?Te.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:wn,className:"".concat(Zn,"-quick-jumper-button")},ct.jump_to_confirm):Te.createElement("span",{onClick:this.go,onKeyUp:this.go},mt)),Cr=Te.createElement("div",{className:"".concat(Zn,"-quick-jumper")},ct.jump_to,Te.createElement("input",{disabled:wn,type:"text",value:Tn,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur,"aria-label":ct.page}),ct.page,Yn)),Te.createElement("li",{className:"".concat(Zn)},wr,Cr)}}]),Rt}(Te.Component);Ve.defaultProps={pageSizeOptions:["10","20","50","100"]};var Je=Ve,Lt=function(je){var Rt,At=je.rootPrefixCls,rt=je.page,Ft=je.active,sn=je.className,ct=je.showTitle,qt=je.onClick,an=je.onKeyPress,Qe=je.itemRender,mt="".concat(At,"-item"),Nt=Fe()(mt,"".concat(mt,"-").concat(rt),(Rt={},(0,ft.Z)(Rt,"".concat(mt,"-active"),Ft),(0,ft.Z)(Rt,"".concat(mt,"-disabled"),!rt),(0,ft.Z)(Rt,je.className,sn),Rt)),vn=function(){qt(rt)},mn=function(Zn){an(Zn,qt,rt)},wn=Qe(rt,"page",Te.createElement("a",{rel:"nofollow"},rt));return wn?Te.createElement("li",{title:ct?rt.toString():null,className:Nt,onClick:vn,onKeyPress:mn,tabIndex:0},wn):null},et=Lt;function Dt(){}function Ge(Pe){var je=Number(Pe);return typeof je=="number"&&!Number.isNaN(je)&&isFinite(je)&&Math.floor(je)===je}var kt=function(je,Rt,At){return At};function tt(Pe,je,Rt){var At=typeof Pe=="undefined"?je.pageSize:Pe;return Math.floor((Rt.total-1)/At)+1}var $t=function(Pe){(0,Ct.Z)(Rt,Pe);var je=(0,jt.Z)(Rt);function Rt(At){var rt;(0,ot.Z)(this,Rt),rt=je.call(this,At),rt.paginationNode=Te.createRef(),rt.getJumpPrevPage=function(){return Math.max(1,rt.state.current-(rt.props.showLessItems?3:5))},rt.getJumpNextPage=function(){return Math.min(tt(void 0,rt.state,rt.props),rt.state.current+(rt.props.showLessItems?3:5))},rt.getItemIcon=function(an,Qe){var mt=rt.props.prefixCls,Nt=an||Te.createElement("button",{type:"button","aria-label":Qe,className:"".concat(mt,"-item-link")});return typeof an=="function"&&(Nt=Te.createElement(an,(0,Ye.Z)({},rt.props))),Nt},rt.isValid=function(an){var Qe=rt.props.total;return Ge(an)&&an!==rt.state.current&&Ge(Qe)&&Qe>0},rt.shouldDisplayQuickJumper=function(){var an=rt.props,Qe=an.showQuickJumper,mt=an.total,Nt=rt.state.pageSize;return mt<=Nt?!1:Qe},rt.handleKeyDown=function(an){(an.keyCode===$e.ARROW_UP||an.keyCode===$e.ARROW_DOWN)&&an.preventDefault()},rt.handleKeyUp=function(an){var Qe=rt.getValidValue(an),mt=rt.state.currentInputValue;Qe!==mt&&rt.setState({currentInputValue:Qe}),an.keyCode===$e.ENTER?rt.handleChange(Qe):an.keyCode===$e.ARROW_UP?rt.handleChange(Qe-1):an.keyCode===$e.ARROW_DOWN&&rt.handleChange(Qe+1)},rt.handleBlur=function(an){var Qe=rt.getValidValue(an);rt.handleChange(Qe)},rt.changePageSize=function(an){var Qe=rt.state.current,mt=tt(an,rt.state,rt.props);Qe=Qe>mt?mt:Qe,mt===0&&(Qe=rt.state.current),typeof an=="number"&&("pageSize"in rt.props||rt.setState({pageSize:an}),"current"in rt.props||rt.setState({current:Qe,currentInputValue:Qe})),rt.props.onShowSizeChange(Qe,an),"onChange"in rt.props&&rt.props.onChange&&rt.props.onChange(Qe,an)},rt.handleChange=function(an){var Qe=rt.props,mt=Qe.disabled,Nt=Qe.onChange,vn=rt.state,mn=vn.pageSize,wn=vn.current,Tn=vn.currentInputValue;if(rt.isValid(an)&&!mt){var Zn=tt(void 0,rt.state,rt.props),Hn=an;return an>Zn?Hn=Zn:an<1&&(Hn=1),"current"in rt.props||rt.setState({current:Hn}),Hn!==Tn&&rt.setState({currentInputValue:Hn}),Nt(Hn,mn),Hn}return wn},rt.prev=function(){rt.hasPrev()&&rt.handleChange(rt.state.current-1)},rt.next=function(){rt.hasNext()&&rt.handleChange(rt.state.current+1)},rt.jumpPrev=function(){rt.handleChange(rt.getJumpPrevPage())},rt.jumpNext=function(){rt.handleChange(rt.getJumpNextPage())},rt.hasPrev=function(){return rt.state.current>1},rt.hasNext=function(){return rt.state.current<tt(void 0,rt.state,rt.props)},rt.runIfEnter=function(an,Qe){if(an.key==="Enter"||an.charCode===13){for(var mt=arguments.length,Nt=new Array(mt>2?mt-2:0),vn=2;vn<mt;vn++)Nt[vn-2]=arguments[vn];Qe.apply(void 0,Nt)}},rt.runIfEnterPrev=function(an){rt.runIfEnter(an,rt.prev)},rt.runIfEnterNext=function(an){rt.runIfEnter(an,rt.next)},rt.runIfEnterJumpPrev=function(an){rt.runIfEnter(an,rt.jumpPrev)},rt.runIfEnterJumpNext=function(an){rt.runIfEnter(an,rt.jumpNext)},rt.handleGoTO=function(an){(an.keyCode===$e.ENTER||an.type==="click")&&rt.handleChange(rt.state.currentInputValue)},rt.renderPrev=function(an){var Qe=rt.props,mt=Qe.prevIcon,Nt=Qe.itemRender,vn=Nt(an,"prev",rt.getItemIcon(mt,"prev page")),mn=!rt.hasPrev();return(0,Te.isValidElement)(vn)?(0,Te.cloneElement)(vn,{disabled:mn}):vn},rt.renderNext=function(an){var Qe=rt.props,mt=Qe.nextIcon,Nt=Qe.itemRender,vn=Nt(an,"next",rt.getItemIcon(mt,"next page")),mn=!rt.hasNext();return(0,Te.isValidElement)(vn)?(0,Te.cloneElement)(vn,{disabled:mn}):vn};var Ft=At.onChange!==Dt,sn="current"in At;sn&&!Ft&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var ct=At.defaultCurrent;"current"in At&&(ct=At.current);var qt=At.defaultPageSize;return"pageSize"in At&&(qt=At.pageSize),ct=Math.min(ct,tt(qt,void 0,At)),rt.state={current:ct,currentInputValue:ct,pageSize:qt},rt}return(0,at.Z)(Rt,[{key:"componentDidUpdate",value:function(rt,Ft){var sn=this.props.prefixCls;if(Ft.current!==this.state.current&&this.paginationNode.current){var ct=this.paginationNode.current.querySelector(".".concat(sn,"-item-").concat(Ft.current));if(ct&&document.activeElement===ct){var qt;ct==null||(qt=ct.blur)===null||qt===void 0||qt.call(ct)}}}},{key:"getValidValue",value:function(rt){var Ft=rt.target.value,sn=tt(void 0,this.state,this.props),ct=this.state.currentInputValue,qt;return Ft===""?qt=Ft:Number.isNaN(Number(Ft))?qt=ct:Ft>=sn?qt=sn:qt=Number(Ft),qt}},{key:"getShowSizeChanger",value:function(){var rt=this.props,Ft=rt.showSizeChanger,sn=rt.total,ct=rt.totalBoundaryShowSizeChanger;return typeof Ft!="undefined"?Ft:sn>ct}},{key:"render",value:function(){var rt=this.props,Ft=rt.prefixCls,sn=rt.className,ct=rt.style,qt=rt.disabled,an=rt.hideOnSinglePage,Qe=rt.total,mt=rt.locale,Nt=rt.showQuickJumper,vn=rt.showLessItems,mn=rt.showTitle,wn=rt.showTotal,Tn=rt.simple,Zn=rt.itemRender,Hn=rt.showPrevNextJumpers,wr=rt.jumpPrevIcon,Cr=rt.jumpNextIcon,Yn=rt.selectComponentClass,Nr=rt.selectPrefixCls,Kr=rt.pageSizeOptions,Or=this.state,Ar=Or.current,kr=Or.pageSize,Gr=Or.currentInputValue;if(an===!0&&Qe<=kr)return null;var ar=tt(void 0,this.state,this.props),$r=[],Ur=null,Vr=null,Yr=null,Zr=null,dr=null,_r=Nt&&Nt.goButton,Ln=vn?1:2,Wn=Ar-1>0?Ar-1:0,Er=Ar+1<ar?Ar+1:ar,St=(0,it.Z)(this.props,{aria:!0,data:!0}),Le=wn&&Te.createElement("li",{className:"".concat(Ft,"-total-text")},wn(Qe,[Qe===0?0:(Ar-1)*kr+1,Ar*kr>Qe?Qe:Ar*kr]));if(Tn){_r&&(typeof _r=="boolean"?dr=Te.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},mt.jump_to_confirm):dr=Te.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},_r),dr=Te.createElement("li",{title:mn?"".concat(mt.jump_to).concat(Ar,"/").concat(ar):null,className:"".concat(Ft,"-simple-pager")},dr));var We=this.renderPrev(Wn);return Te.createElement("ul",(0,se.Z)({className:Fe()(Ft,"".concat(Ft,"-simple"),(0,ft.Z)({},"".concat(Ft,"-disabled"),qt),sn),style:ct,ref:this.paginationNode},St),Le,We?Te.createElement("li",{title:mn?mt.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:Fe()("".concat(Ft,"-prev"),(0,ft.Z)({},"".concat(Ft,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},We):null,Te.createElement("li",{title:mn?"".concat(Ar,"/").concat(ar):null,className:"".concat(Ft,"-simple-pager")},Te.createElement("input",{type:"text",value:Gr,disabled:qt,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,onBlur:this.handleBlur,size:3}),Te.createElement("span",{className:"".concat(Ft,"-slash")},"/"),ar),Te.createElement("li",{title:mn?mt.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:Fe()("".concat(Ft,"-next"),(0,ft.Z)({},"".concat(Ft,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Er)),dr)}if(ar<=3+Ln*2){var Be={locale:mt,rootPrefixCls:Ft,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:mn,itemRender:Zn};ar||$r.push(Te.createElement(et,(0,se.Z)({},Be,{key:"noPager",page:1,className:"".concat(Ft,"-item-disabled")})));for(var Oe=1;Oe<=ar;Oe+=1){var lt=Ar===Oe;$r.push(Te.createElement(et,(0,se.Z)({},Be,{key:Oe,page:Oe,active:lt})))}}else{var _t=vn?mt.prev_3:mt.prev_5,Yt=vn?mt.next_3:mt.next_5,Kt=Zn(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(wr,"prev page")),Jt=Zn(this.getJumpNextPage(),"jump-next",this.getItemIcon(Cr,"next page"));Hn&&(Ur=Kt?Te.createElement("li",{title:mn?_t:null,key:"prev",onClick:this.jumpPrev,tabIndex:0,onKeyPress:this.runIfEnterJumpPrev,className:Fe()("".concat(Ft,"-jump-prev"),(0,ft.Z)({},"".concat(Ft,"-jump-prev-custom-icon"),!!wr))},Kt):null,Vr=Jt?Te.createElement("li",{title:mn?Yt:null,key:"next",tabIndex:0,onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:Fe()("".concat(Ft,"-jump-next"),(0,ft.Z)({},"".concat(Ft,"-jump-next-custom-icon"),!!Cr))},Jt):null),Zr=Te.createElement(et,{locale:mt,last:!0,rootPrefixCls:Ft,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ar,page:ar,active:!1,showTitle:mn,itemRender:Zn}),Yr=Te.createElement(et,{locale:mt,rootPrefixCls:Ft,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:mn,itemRender:Zn});var un=Math.max(1,Ar-Ln),fn=Math.min(Ar+Ln,ar);Ar-1<=Ln&&(fn=1+Ln*2),ar-Ar<=Ln&&(un=ar-Ln*2);for(var xn=un;xn<=fn;xn+=1){var zt=Ar===xn;$r.push(Te.createElement(et,{locale:mt,rootPrefixCls:Ft,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:xn,page:xn,active:zt,showTitle:mn,itemRender:Zn}))}Ar-1>=Ln*2&&Ar!==3&&($r[0]=(0,Te.cloneElement)($r[0],{className:"".concat(Ft,"-item-after-jump-prev")}),$r.unshift(Ur)),ar-Ar>=Ln*2&&Ar!==ar-2&&($r[$r.length-1]=(0,Te.cloneElement)($r[$r.length-1],{className:"".concat(Ft,"-item-before-jump-next")}),$r.push(Vr)),un!==1&&$r.unshift(Yr),fn!==ar&&$r.push(Zr)}var ln=!this.hasPrev()||!ar,jn=!this.hasNext()||!ar,Dn=this.renderPrev(Wn),Vn=this.renderNext(Er);return Te.createElement("ul",(0,se.Z)({className:Fe()(Ft,sn,(0,ft.Z)({},"".concat(Ft,"-disabled"),qt)),style:ct,ref:this.paginationNode},St),Le,Dn?Te.createElement("li",{title:mn?mt.prev_page:null,onClick:this.prev,tabIndex:ln?null:0,onKeyPress:this.runIfEnterPrev,className:Fe()("".concat(Ft,"-prev"),(0,ft.Z)({},"".concat(Ft,"-disabled"),ln)),"aria-disabled":ln},Dn):null,$r,Vn?Te.createElement("li",{title:mn?mt.next_page:null,onClick:this.next,tabIndex:jn?null:0,onKeyPress:this.runIfEnterNext,className:Fe()("".concat(Ft,"-next"),(0,ft.Z)({},"".concat(Ft,"-disabled"),jn)),"aria-disabled":jn},Vn):null,Te.createElement(Je,{disabled:qt,locale:mt,rootPrefixCls:Ft,selectComponentClass:Yn,selectPrefixCls:Nr,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Ar,pageSize:kr,pageSizeOptions:Kr,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:_r}))}}],[{key:"getDerivedStateFromProps",value:function(rt,Ft){var sn={};if("current"in rt&&(sn.current=rt.current,rt.current!==Ft.current&&(sn.currentInputValue=sn.current)),"pageSize"in rt&&rt.pageSize!==Ft.pageSize){var ct=Ft.current,qt=tt(rt.pageSize,Ft,rt);ct=ct>qt?qt:ct,"current"in rt||(sn.current=ct,sn.currentInputValue=ct),sn.pageSize=rt.pageSize}return sn}}]),Rt}(Te.Component);$t.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:Dt,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:Dt,locale:Ee.Z,style:{},itemRender:kt,totalBoundaryShowSizeChanger:50};var pt=$t,Bt=ue(22075),Tt=ue(36355),wt=ue(19716),Ne=ue(8628),be=ue(9763),xt=ue(57809);const Qt=Pe=>Te.createElement(xt.default,Object.assign({},Pe,{showSearch:!0,size:"small"})),Vt=Pe=>Te.createElement(xt.default,Object.assign({},Pe,{showSearch:!0,size:"middle"}));Qt.Option=xt.default.Option,Vt.Option=xt.default.Option;var qe=ue(9937),nt=ue(17313),Ot=ue(83116),dn=ue(37613);const en=Pe=>{const{componentCls:je}=Pe;return{[`${je}-disabled`]:{"&, &:hover":{cursor:"not-allowed",[`${je}-item-link`]:{color:Pe.colorTextDisabled,cursor:"not-allowed"}},"&:focus-visible":{cursor:"not-allowed",[`${je}-item-link`]:{color:Pe.colorTextDisabled,cursor:"not-allowed"}}},[`&${je}-disabled`]:{cursor:"not-allowed",[`${je}-item`]:{cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},a:{color:Pe.colorTextDisabled,backgroundColor:"transparent",border:"none",cursor:"not-allowed"},"&-active":{borderColor:Pe.colorBorder,backgroundColor:Pe.itemActiveBgDisabled,"&:hover, &:active":{backgroundColor:Pe.itemActiveBgDisabled},a:{color:Pe.itemActiveColorDisabled}}},[`${je}-item-link`]:{color:Pe.colorTextDisabled,cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},[`${je}-simple&`]:{backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"}}},[`${je}-simple-pager`]:{color:Pe.colorTextDisabled},[`${je}-jump-prev, ${je}-jump-next`]:{[`${je}-item-link-icon`]:{opacity:0},[`${je}-item-ellipsis`]:{opacity:1}}},[`&${je}-simple`]:{[`${je}-prev, ${je}-next`]:{[`&${je}-disabled ${je}-item-link`]:{"&:hover, &:active":{backgroundColor:"transparent"}}}}}},on=Pe=>{const{componentCls:je}=Pe;return{[`&${je}-mini ${je}-total-text, &${je}-mini ${je}-simple-pager`]:{height:Pe.itemSizeSM,lineHeight:`${Pe.itemSizeSM}px`},[`&${je}-mini ${je}-item`]:{minWidth:Pe.itemSizeSM,height:Pe.itemSizeSM,margin:0,lineHeight:`${Pe.itemSizeSM-2}px`},[`&${je}-mini:not(${je}-disabled) ${je}-item:not(${je}-item-active)`]:{backgroundColor:"transparent",borderColor:"transparent","&:hover":{backgroundColor:Pe.colorBgTextHover},"&:active":{backgroundColor:Pe.colorBgTextActive}},[`&${je}-mini ${je}-prev, &${je}-mini ${je}-next`]:{minWidth:Pe.itemSizeSM,height:Pe.itemSizeSM,margin:0,lineHeight:`${Pe.itemSizeSM}px`},[`&${je}-mini:not(${je}-disabled)`]:{[`${je}-prev, ${je}-next`]:{[`&:hover ${je}-item-link`]:{backgroundColor:Pe.colorBgTextHover},[`&:active ${je}-item-link`]:{backgroundColor:Pe.colorBgTextActive},[`&${je}-disabled:hover ${je}-item-link`]:{backgroundColor:"transparent"}}},[`
&${je}-mini ${je}-prev ${je}-item-link,
&${je}-mini ${je}-next ${je}-item-link
`]:{backgroundColor:"transparent",borderColor:"transparent","&::after":{height:Pe.itemSizeSM,lineHeight:`${Pe.itemSizeSM}px`}},[`&${je}-mini ${je}-jump-prev, &${je}-mini ${je}-jump-next`]:{height:Pe.itemSizeSM,marginInlineEnd:0,lineHeight:`${Pe.itemSizeSM}px`},[`&${je}-mini ${je}-options`]:{marginInlineStart:Pe.paginationMiniOptionsMarginInlineStart,"&-size-changer":{top:Pe.miniOptionsSizeChangerTop},"&-quick-jumper":{height:Pe.itemSizeSM,lineHeight:`${Pe.itemSizeSM}px`,input:Object.assign(Object.assign({},(0,qe.x0)(Pe)),{width:Pe.paginationMiniQuickJumperInputWidth,height:Pe.controlHeightSM})}}}},Xt=Pe=>{const{componentCls:je}=Pe;return{[`
&${je}-simple ${je}-prev,
&${je}-simple ${je}-next
`]:{height:Pe.itemSizeSM,lineHeight:`${Pe.itemSizeSM}px`,verticalAlign:"top",[`${je}-item-link`]:{height:Pe.itemSizeSM,backgroundColor:"transparent",border:0,"&:hover":{backgroundColor:Pe.colorBgTextHover},"&:active":{backgroundColor:Pe.colorBgTextActive},"&::after":{height:Pe.itemSizeSM,lineHeight:`${Pe.itemSizeSM}px`}}},[`&${je}-simple ${je}-simple-pager`]:{display:"inline-block",height:Pe.itemSizeSM,marginInlineEnd:Pe.marginXS,input:{boxSizing:"border-box",height:"100%",marginInlineEnd:Pe.marginXS,padding:`0 ${Pe.paginationItemPaddingInline}px`,textAlign:"center",backgroundColor:Pe.itemInputBg,border:`${Pe.lineWidth}px ${Pe.lineType} ${Pe.colorBorder}`,borderRadius:Pe.borderRadius,outline:"none",transition:`border-color ${Pe.motionDurationMid}`,color:"inherit","&:hover":{borderColor:Pe.colorPrimary},"&:focus":{borderColor:Pe.colorPrimaryHover,boxShadow:`${Pe.inputOutlineOffset}px 0 ${Pe.controlOutlineWidth}px ${Pe.controlOutline}`},"&[disabled]":{color:Pe.colorTextDisabled,backgroundColor:Pe.colorBgContainerDisabled,borderColor:Pe.colorBorder,cursor:"not-allowed"}}}}},Ut=Pe=>{const{componentCls:je}=Pe;return{[`${je}-jump-prev, ${je}-jump-next`]:{outline:0,[`${je}-item-container`]:{position:"relative",[`${je}-item-link-icon`]:{color:Pe.colorPrimary,fontSize:Pe.fontSizeSM,opacity:0,transition:`all ${Pe.motionDurationMid}`,"&-svg":{top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,margin:"auto"}},[`${je}-item-ellipsis`]:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,display:"block",margin:"auto",color:Pe.colorTextDisabled,fontFamily:"Arial, Helvetica, sans-serif",letterSpacing:Pe.paginationEllipsisLetterSpacing,textAlign:"center",textIndent:Pe.paginationEllipsisTextIndent,opacity:1,transition:`all ${Pe.motionDurationMid}`}},"&:hover":{[`${je}-item-link-icon`]:{opacity:1},[`${je}-item-ellipsis`]:{opacity:0}}},[`
${je}-prev,
${je}-jump-prev,
${je}-jump-next
`]:{marginInlineEnd:Pe.marginXS},[`
${je}-prev,
${je}-next,
${je}-jump-prev,
${je}-jump-next
`]:{display:"inline-block",minWidth:Pe.itemSize,height:Pe.itemSize,color:Pe.colorText,fontFamily:Pe.fontFamily,lineHeight:`${Pe.itemSize}px`,textAlign:"center",verticalAlign:"middle",listStyle:"none",borderRadius:Pe.borderRadius,cursor:"pointer",transition:`all ${Pe.motionDurationMid}`},[`${je}-prev, ${je}-next`]:{fontFamily:"Arial, Helvetica, sans-serif",outline:0,button:{color:Pe.colorText,cursor:"pointer",userSelect:"none"},[`${je}-item-link`]:{display:"block",width:"100%",height:"100%",padding:0,fontSize:Pe.fontSizeSM,textAlign:"center",backgroundColor:"transparent",border:`${Pe.lineWidth}px ${Pe.lineType} transparent`,borderRadius:Pe.borderRadius,outline:"none",transition:`all ${Pe.motionDurationMid}`},[`&:hover ${je}-item-link`]:{backgroundColor:Pe.colorBgTextHover},[`&:active ${je}-item-link`]:{backgroundColor:Pe.colorBgTextActive},[`&${je}-disabled:hover`]:{[`${je}-item-link`]:{backgroundColor:"transparent"}}},[`${je}-slash`]:{marginInlineEnd:Pe.paginationSlashMarginInlineEnd,marginInlineStart:Pe.paginationSlashMarginInlineStart},[`${je}-options`]:{display:"inline-block",marginInlineStart:Pe.margin,verticalAlign:"middle","&-size-changer.-select":{display:"inline-block",width:"auto"},"&-quick-jumper":{display:"inline-block",height:Pe.controlHeight,marginInlineStart:Pe.marginXS,lineHeight:`${Pe.controlHeight}px`,verticalAlign:"top",input:Object.assign(Object.assign({},(0,qe.ik)(Pe)),{width:Pe.controlHeightLG*1.25,height:Pe.controlHeight,boxSizing:"border-box",margin:0,marginInlineStart:Pe.marginXS,marginInlineEnd:Pe.marginXS})}}}},Zt=Pe=>{const{componentCls:je}=Pe;return{[`${je}-item`]:{display:"inline-block",minWidth:Pe.itemSize,height:Pe.itemSize,marginInlineEnd:Pe.marginXS,fontFamily:Pe.fontFamily,lineHeight:`${Pe.itemSize-2}px`,textAlign:"center",verticalAlign:"middle",listStyle:"none",backgroundColor:"transparent",border:`${Pe.lineWidth}px ${Pe.lineType} transparent`,borderRadius:Pe.borderRadius,outline:0,cursor:"pointer",userSelect:"none",a:{display:"block",padding:`0 ${Pe.paginationItemPaddingInline}px`,color:Pe.colorText,"&:hover":{textDecoration:"none"}},[`&:not(${je}-item-active)`]:{"&:hover":{transition:`all ${Pe.motionDurationMid}`,backgroundColor:Pe.colorBgTextHover},"&:active":{backgroundColor:Pe.colorBgTextActive}},"&-active":{fontWeight:Pe.fontWeightStrong,backgroundColor:Pe.itemActiveBg,borderColor:Pe.colorPrimary,a:{color:Pe.colorPrimary},"&:hover":{borderColor:Pe.colorPrimaryHover},"&:hover a":{color:Pe.colorPrimaryHover}}}}},ye=Pe=>{const{componentCls:je}=Pe;return{[je]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,nt.Wf)(Pe)),{"ul, ol":{margin:0,padding:0,listStyle:"none"},"&::after":{display:"block",clear:"both",height:0,overflow:"hidden",visibility:"hidden",content:'""'},[`${je}-total-text`]:{display:"inline-block",height:Pe.itemSize,marginInlineEnd:Pe.marginXS,lineHeight:`${Pe.itemSize-2}px`,verticalAlign:"middle"}}),Zt(Pe)),Ut(Pe)),Xt(Pe)),on(Pe)),en(Pe)),{[`@media only screen and (max-width: ${Pe.screenLG}px)`]:{[`${je}-item`]:{"&-after-jump-prev, &-before-jump-next":{display:"none"}}},[`@media only screen and (max-width: ${Pe.screenSM}px)`]:{[`${je}-options`]:{display:"none"}}}),[`&${Pe.componentCls}-rtl`]:{direction:"rtl"}}},le=Pe=>{const{componentCls:je}=Pe;return{[`${je}${je}-disabled:not(${je}-mini)`]:{"&, &:hover":{[`${je}-item-link`]:{borderColor:Pe.colorBorder}},"&:focus-visible":{[`${je}-item-link`]:{borderColor:Pe.colorBorder}},[`${je}-item, ${je}-item-link`]:{backgroundColor:Pe.colorBgContainerDisabled,borderColor:Pe.colorBorder,[`&:hover:not(${je}-item-active)`]:{backgroundColor:Pe.colorBgContainerDisabled,borderColor:Pe.colorBorder,a:{color:Pe.colorTextDisabled}},[`&${je}-item-active`]:{backgroundColor:Pe.itemActiveBgDisabled}},[`${je}-prev, ${je}-next`]:{"&:hover button":{backgroundColor:Pe.colorBgContainerDisabled,borderColor:Pe.colorBorder,color:Pe.colorTextDisabled},[`${je}-item-link`]:{backgroundColor:Pe.colorBgContainerDisabled,borderColor:Pe.colorBorder}}},[`${je}:not(${je}-mini)`]:{[`${je}-prev, ${je}-next`]:{"&:hover button":{borderColor:Pe.colorPrimaryHover,backgroundColor:Pe.itemBg},[`${je}-item-link`]:{backgroundColor:Pe.itemLinkBg,borderColor:Pe.colorBorder},[`&:hover ${je}-item-link`]:{borderColor:Pe.colorPrimary,backgroundColor:Pe.itemBg,color:Pe.colorPrimary},[`&${je}-disabled`]:{[`${je}-item-link`]:{borderColor:Pe.colorBorder,color:Pe.colorTextDisabled}}},[`${je}-item`]:{backgroundColor:Pe.itemBg,border:`${Pe.lineWidth}px ${Pe.lineType} ${Pe.colorBorder}`,[`&:hover:not(${je}-item-active)`]:{borderColor:Pe.colorPrimary,backgroundColor:Pe.itemBg,a:{color:Pe.colorPrimary}},"&-active":{borderColor:Pe.colorPrimary}}}}},oe=Pe=>{const{componentCls:je}=Pe;return{[`${je}:not(${je}-disabled)`]:{[`${je}-item`]:Object.assign({},(0,nt.Qy)(Pe)),[`${je}-jump-prev, ${je}-jump-next`]:{"&:focus-visible":Object.assign({[`${je}-item-link-icon`]:{opacity:1},[`${je}-item-ellipsis`]:{opacity:0}},(0,nt.oN)(Pe))},[`${je}-prev, ${je}-next`]:{[`&:focus-visible ${je}-item-link`]:Object.assign({},(0,nt.oN)(Pe))}}}};var he=(0,Ot.Z)("Pagination",Pe=>{const je=(0,dn.TS)(Pe,{inputOutlineOffset:0,paginationMiniOptionsMarginInlineStart:Pe.marginXXS/2,paginationMiniQuickJumperInputWidth:Pe.controlHeightLG*1.1,paginationItemPaddingInline:Pe.marginXXS*1.5,paginationEllipsisLetterSpacing:Pe.marginXXS/2,paginationSlashMarginInlineStart:Pe.marginXXS,paginationSlashMarginInlineEnd:Pe.marginSM,paginationEllipsisTextIndent:"0.13em"},(0,qe.e5)(Pe),(0,qe.TM)(Pe));return[ye(je),oe(je),Pe.wireframe&&le(je)]},Pe=>({itemBg:Pe.colorBgContainer,itemSize:Pe.controlHeight,itemSizeSM:Pe.controlHeightSM,itemActiveBg:Pe.colorBgContainer,itemLinkBg:Pe.colorBgContainer,itemActiveColorDisabled:Pe.colorTextDisabled,itemActiveBgDisabled:Pe.controlItemBgActiveDisabled,itemInputBg:Pe.colorBgContainer,miniOptionsSizeChangerTop:0})),pe=function(Pe,je){var Rt={};for(var At in Pe)Object.prototype.hasOwnProperty.call(Pe,At)&&je.indexOf(At)<0&&(Rt[At]=Pe[At]);if(Pe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var rt=0,At=Object.getOwnPropertySymbols(Pe);rt<At.length;rt++)je.indexOf(At[rt])<0&&Object.prototype.propertyIsEnumerable.call(Pe,At[rt])&&(Rt[At[rt]]=Pe[At[rt]]);return Rt},Ie=Pe=>{const{prefixCls:je,selectPrefixCls:Rt,className:At,rootClassName:rt,style:Ft,size:sn,locale:ct,selectComponentClass:qt,responsive:an,showSizeChanger:Qe}=Pe,mt=pe(Pe,["prefixCls","selectPrefixCls","className","rootClassName","style","size","locale","selectComponentClass","responsive","showSizeChanger"]),{xs:Nt}=(0,Ne.Z)(an),{getPrefixCls:vn,direction:mn,pagination:wn={}}=Te.useContext(Tt.E_),Tn=vn("pagination",je),[Zn,Hn]=he(Tn),wr=Qe!=null?Qe:wn.showSizeChanger,Cr=Te.useMemo(()=>{const ar=Te.createElement("span",{className:`${Tn}-item-ellipsis`},"\u2022\u2022\u2022"),$r=Te.createElement("button",{className:`${Tn}-item-link`,type:"button",tabIndex:-1},mn==="rtl"?Te.createElement(dt.Z,null):Te.createElement(Re.Z,null)),Ur=Te.createElement("button",{className:`${Tn}-item-link`,type:"button",tabIndex:-1},mn==="rtl"?Te.createElement(Re.Z,null):Te.createElement(dt.Z,null)),Vr=Te.createElement("a",{className:`${Tn}-item-link`},Te.createElement("div",{className:`${Tn}-item-container`},mn==="rtl"?Te.createElement(_e.Z,{className:`${Tn}-item-link-icon`}):Te.createElement(we,{className:`${Tn}-item-link-icon`}),ar)),Yr=Te.createElement("a",{className:`${Tn}-item-link`},Te.createElement("div",{className:`${Tn}-item-container`},mn==="rtl"?Te.createElement(we,{className:`${Tn}-item-link-icon`}):Te.createElement(_e.Z,{className:`${Tn}-item-link-icon`}),ar));return{prevIcon:$r,nextIcon:Ur,jumpPrevIcon:Vr,jumpNextIcon:Yr}},[mn,Tn]),[Yn]=(0,be.Z)("Pagination",Bt.Z),Nr=Object.assign(Object.assign({},Yn),ct),Kr=(0,wt.Z)(sn),Or=Kr==="small"||!!(Nt&&!Kr&&an),Ar=vn("select",Rt),kr=Fe()({[`${Tn}-mini`]:Or,[`${Tn}-rtl`]:mn==="rtl"},wn==null?void 0:wn.className,At,rt,Hn),Gr=Object.assign(Object.assign({},wn==null?void 0:wn.style),Ft);return Zn(Te.createElement(pt,Object.assign({},Cr,mt,{style:Gr,prefixCls:Tn,selectPrefixCls:Ar,className:kr,selectComponentClass:qt||(Or?Qt:Vt),locale:Nr,showSizeChanger:wr})))},yt=Ie},5112:function(bn,tn,ue){"use strict";ue.d(tn,{ZP:function(){return Ne}});var se=ue(92310),Te=ue.n(se),ze=ue(18929),ut=ue(26112),xe=ue(59301),Me=ue(36355),De=ue(19716);const we=xe.createContext(null),_e=we.Provider;var Re=we;const dt=xe.createContext(null),Ae=dt.Provider;var Fe=ue(5630),ft=ue(8654),Ye=ue(1684),ot=ue(32441),at=ue(17313),Ct=ue(83116),jt=ue(37613);const it=be=>{const{componentCls:xt,antCls:Qt}=be,Vt=`${xt}-group`;return{[Vt]:Object.assign(Object.assign({},(0,at.Wf)(be)),{display:"inline-block",fontSize:0,[`&${Vt}-rtl`]:{direction:"rtl"},[`${Qt}-badge ${Qt}-badge-count`]:{zIndex:1},[`> ${Qt}-badge:not(:first-child) > ${Qt}-button-wrapper`]:{borderInlineStart:"none"}})}},vt=be=>{const{componentCls:xt,wrapperMarginInlineEnd:Qt,colorPrimary:Vt,radioSize:qe,motionDurationSlow:nt,motionDurationMid:Ot,motionEaseInOutCirc:dn,colorBgContainer:en,colorBorder:on,lineWidth:Xt,dotSize:Ut,colorBgContainerDisabled:Zt,colorTextDisabled:ye,paddingXS:le,dotColorDisabled:oe,lineType:he,radioDotDisabledSize:pe,wireframe:ce,colorWhite:Ie}=be,yt=`${xt}-inner`;return{[`${xt}-wrapper`]:Object.assign(Object.assign({},(0,at.Wf)(be)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:Qt,cursor:"pointer",[`&${xt}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:be.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},[`${xt}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${Xt}px ${he} ${Vt}`,borderRadius:"50%",visibility:"hidden",content:'""'},[xt]:Object.assign(Object.assign({},(0,at.Wf)(be)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${xt}-wrapper:hover &,
&:hover ${yt}`]:{borderColor:Vt},[`${xt}-input:focus-visible + ${yt}`]:Object.assign({},(0,at.oN)(be)),[`${xt}:hover::after, ${xt}-wrapper:hover &::after`]:{visibility:"visible"},[`${xt}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:qe,height:qe,marginBlockStart:qe/-2,marginInlineStart:qe/-2,backgroundColor:ce?Vt:Ie,borderBlockStart:0,borderInlineStart:0,borderRadius:qe,transform:"scale(0)",opacity:0,transition:`all ${nt} ${dn}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:qe,height:qe,backgroundColor:en,borderColor:on,borderStyle:"solid",borderWidth:Xt,borderRadius:"50%",transition:`all ${Ot}`},[`${xt}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${xt}-checked`]:{[yt]:{borderColor:Vt,backgroundColor:ce?en:Vt,"&::after":{transform:`scale(${Ut/qe})`,opacity:1,transition:`all ${nt} ${dn}`}}},[`${xt}-disabled`]:{cursor:"not-allowed",[yt]:{backgroundColor:Zt,borderColor:on,cursor:"not-allowed","&::after":{backgroundColor:oe}},[`${xt}-input`]:{cursor:"not-allowed"},[`${xt}-disabled + span`]:{color:ye,cursor:"not-allowed"},[`&${xt}-checked`]:{[yt]:{"&::after":{transform:`scale(${pe/qe})`}}}},[`span${xt} + *`]:{paddingInlineStart:le,paddingInlineEnd:le}})}},$e=be=>{const{buttonColor:xt,controlHeight:Qt,componentCls:Vt,lineWidth:qe,lineType:nt,colorBorder:Ot,motionDurationSlow:dn,motionDurationMid:en,buttonPaddingInline:on,fontSize:Xt,buttonBg:Ut,fontSizeLG:Zt,controlHeightLG:ye,controlHeightSM:le,paddingXS:oe,borderRadius:he,borderRadiusSM:pe,borderRadiusLG:ce,buttonCheckedBg:Ie,buttonSolidCheckedColor:yt,colorTextDisabled:Pe,colorBgContainerDisabled:je,buttonCheckedBgDisabled:Rt,buttonCheckedColorDisabled:At,colorPrimary:rt,colorPrimaryHover:Ft,colorPrimaryActive:sn,buttonSolidCheckedBg:ct,buttonSolidCheckedHoverBg:qt,buttonSolidCheckedActiveBg:an}=be;return{[`${Vt}-button-wrapper`]:{position:"relative",display:"inline-block",height:Qt,margin:0,paddingInline:on,paddingBlock:0,color:xt,fontSize:Xt,lineHeight:`${Qt-qe*2}px`,background:Ut,border:`${qe}px ${nt} ${Ot}`,borderBlockStartWidth:qe+.02,borderInlineStartWidth:0,borderInlineEndWidth:qe,cursor:"pointer",transition:[`color ${en}`,`background ${en}`,`box-shadow ${en}`].join(","),a:{color:xt},[`> ${Vt}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:-qe,insetInlineStart:-qe,display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:qe,paddingInline:0,backgroundColor:Ot,transition:`background-color ${dn}`,content:'""'}},"&:first-child":{borderInlineStart:`${qe}px ${nt} ${Ot}`,borderStartStartRadius:he,borderEndStartRadius:he},"&:last-child":{borderStartEndRadius:he,borderEndEndRadius:he},"&:first-child:last-child":{borderRadius:he},[`${Vt}-group-large &`]:{height:ye,fontSize:Zt,lineHeight:`${ye-qe*2}px`,"&:first-child":{borderStartStartRadius:ce,borderEndStartRadius:ce},"&:last-child":{borderStartEndRadius:ce,borderEndEndRadius:ce}},[`${Vt}-group-small &`]:{height:le,paddingInline:oe-qe,paddingBlock:0,lineHeight:`${le-qe*2}px`,"&:first-child":{borderStartStartRadius:pe,borderEndStartRadius:pe},"&:last-child":{borderStartEndRadius:pe,borderEndEndRadius:pe}},"&:hover":{position:"relative",color:rt},"&:has(:focus-visible)":Object.assign({},(0,at.oN)(be)),[`${Vt}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${Vt}-button-wrapper-disabled)`]:{zIndex:1,color:rt,background:Ie,borderColor:rt,"&::before":{backgroundColor:rt},"&:first-child":{borderColor:rt},"&:hover":{color:Ft,borderColor:Ft,"&::before":{backgroundColor:Ft}},"&:active":{color:sn,borderColor:sn,"&::before":{backgroundColor:sn}}},[`${Vt}-group-solid &-checked:not(${Vt}-button-wrapper-disabled)`]:{color:yt,background:ct,borderColor:ct,"&:hover":{color:yt,background:qt,borderColor:qt},"&:active":{color:yt,background:an,borderColor:an}},"&-disabled":{color:Pe,backgroundColor:je,borderColor:Ot,cursor:"not-allowed","&:first-child, &:hover":{color:Pe,backgroundColor:je,borderColor:Ot}},[`&-disabled${Vt}-button-wrapper-checked`]:{color:At,backgroundColor:Rt,borderColor:Ot,boxShadow:"none"}}}},Ee=be=>be-4*2;var Ve=(0,Ct.Z)("Radio",be=>{const{controlOutline:xt,controlOutlineWidth:Qt,radioSize:Vt}=be,qe=`0 0 0 ${Qt}px ${xt}`,nt=qe,Ot=Ee(Vt),dn=(0,jt.TS)(be,{radioDotDisabledSize:Ot,radioFocusShadow:qe,radioButtonFocusShadow:nt});return[it(dn),vt(dn),$e(dn)]},be=>{const{wireframe:xt,padding:Qt,marginXS:Vt,lineWidth:qe,fontSizeLG:nt,colorText:Ot,colorBgContainer:dn,colorTextDisabled:en,controlItemBgActiveDisabled:on,colorTextLightSolid:Xt,colorPrimary:Ut,colorPrimaryHover:Zt,colorPrimaryActive:ye}=be,le=4,oe=nt,he=xt?Ee(oe):oe-(le+qe)*2;return{radioSize:oe,dotSize:he,dotColorDisabled:en,buttonSolidCheckedColor:Xt,buttonSolidCheckedBg:Ut,buttonSolidCheckedHoverBg:Zt,buttonSolidCheckedActiveBg:ye,buttonBg:dn,buttonCheckedBg:dn,buttonColor:Ot,buttonCheckedBgDisabled:on,buttonCheckedColorDisabled:en,buttonPaddingInline:Qt-qe,wrapperMarginInlineEnd:Vt}}),Je=ue(14088),Lt=ue(4572),et=function(be,xt){var Qt={};for(var Vt in be)Object.prototype.hasOwnProperty.call(be,Vt)&&xt.indexOf(Vt)<0&&(Qt[Vt]=be[Vt]);if(be!=null&&typeof Object.getOwnPropertySymbols=="function")for(var qe=0,Vt=Object.getOwnPropertySymbols(be);qe<Vt.length;qe++)xt.indexOf(Vt[qe])<0&&Object.prototype.propertyIsEnumerable.call(be,Vt[qe])&&(Qt[Vt[qe]]=be[Vt[qe]]);return Qt};const Dt=(be,xt)=>{var Qt,Vt;const qe=xe.useContext(Re),nt=xe.useContext(dt),{getPrefixCls:Ot,direction:dn,radio:en}=xe.useContext(Me.E_),on=xe.useRef(null),Xt=(0,ft.sQ)(xt,on),{isFormItemInput:Ut}=xe.useContext(ot.aM),Zt=sn=>{var ct,qt;(ct=be.onChange)===null||ct===void 0||ct.call(be,sn),(qt=qe==null?void 0:qe.onChange)===null||qt===void 0||qt.call(qe,sn)},{prefixCls:ye,className:le,rootClassName:oe,children:he,style:pe}=be,ce=et(be,["prefixCls","className","rootClassName","children","style"]),Ie=Ot("radio",ye),yt=((qe==null?void 0:qe.optionType)||nt)==="button",Pe=yt?`${Ie}-button`:Ie,[je,Rt]=Ve(Ie),At=Object.assign({},ce),rt=xe.useContext(Ye.Z);qe&&(At.name=qe.name,At.onChange=Zt,At.checked=be.value===qe.value,At.disabled=(Qt=At.disabled)!==null&&Qt!==void 0?Qt:qe.disabled),At.disabled=(Vt=At.disabled)!==null&&Vt!==void 0?Vt:rt;const Ft=Te()(`${Pe}-wrapper`,{[`${Pe}-wrapper-checked`]:At.checked,[`${Pe}-wrapper-disabled`]:At.disabled,[`${Pe}-wrapper-rtl`]:dn==="rtl",[`${Pe}-wrapper-in-form-item`]:Ut},en==null?void 0:en.className,le,oe,Rt);return je(xe.createElement(Je.Z,{component:"Radio",disabled:At.disabled},xe.createElement("label",{className:Ft,style:Object.assign(Object.assign({},en==null?void 0:en.style),pe),onMouseEnter:be.onMouseEnter,onMouseLeave:be.onMouseLeave},xe.createElement(Fe.Z,Object.assign({},At,{className:Te()(At.className,!yt&&Lt.A),type:"radio",prefixCls:Pe,ref:Xt})),he!==void 0?xe.createElement("span",null,he):null)))};var kt=xe.forwardRef(Dt);const tt=xe.forwardRef((be,xt)=>{const{getPrefixCls:Qt,direction:Vt}=xe.useContext(Me.E_),[qe,nt]=(0,ze.Z)(be.defaultValue,{value:be.value}),Ot=ct=>{const qt=qe,an=ct.target.value;"value"in be||nt(an);const{onChange:Qe}=be;Qe&&an!==qt&&Qe(ct)},{prefixCls:dn,className:en,rootClassName:on,options:Xt,buttonStyle:Ut="outline",disabled:Zt,children:ye,size:le,style:oe,id:he,onMouseEnter:pe,onMouseLeave:ce,onFocus:Ie,onBlur:yt}=be,Pe=Qt("radio",dn),je=`${Pe}-group`,[Rt,At]=Ve(Pe);let rt=ye;Xt&&Xt.length>0&&(rt=Xt.map(ct=>typeof ct=="string"||typeof ct=="number"?xe.createElement(kt,{key:ct.toString(),prefixCls:Pe,disabled:Zt,value:ct,checked:qe===ct},ct):xe.createElement(kt,{key:`radio-group-value-options-${ct.value}`,prefixCls:Pe,disabled:ct.disabled||Zt,value:ct.value,checked:qe===ct.value,title:ct.title,style:ct.style},ct.label)));const Ft=(0,De.Z)(le),sn=Te()(je,`${je}-${Ut}`,{[`${je}-${Ft}`]:Ft,[`${je}-rtl`]:Vt==="rtl"},en,on,At);return Rt(xe.createElement("div",Object.assign({},(0,ut.Z)(be,{aria:!0,data:!0}),{className:sn,style:oe,onMouseEnter:pe,onMouseLeave:ce,onFocus:Ie,onBlur:yt,id:he,ref:xt}),xe.createElement(_e,{value:{onChange:Ot,value:qe,disabled:be.disabled,name:be.name,optionType:be.optionType}},rt)))});var $t=xe.memo(tt),pt=function(be,xt){var Qt={};for(var Vt in be)Object.prototype.hasOwnProperty.call(be,Vt)&&xt.indexOf(Vt)<0&&(Qt[Vt]=be[Vt]);if(be!=null&&typeof Object.getOwnPropertySymbols=="function")for(var qe=0,Vt=Object.getOwnPropertySymbols(be);qe<Vt.length;qe++)xt.indexOf(Vt[qe])<0&&Object.prototype.propertyIsEnumerable.call(be,Vt[qe])&&(Qt[Vt[qe]]=be[Vt[qe]]);return Qt};const Bt=(be,xt)=>{const{getPrefixCls:Qt}=xe.useContext(Me.E_),{prefixCls:Vt}=be,qe=pt(be,["prefixCls"]),nt=Qt("radio",Vt);return xe.createElement(Ae,{value:"button"},xe.createElement(kt,Object.assign({prefixCls:nt},qe,{type:"radio",ref:xt})))};var Tt=xe.forwardRef(Bt);const wt=kt;wt.Button=Tt,wt.Group=$t,wt.__ANT_RADIO=!0;var Ne=wt},57809:function(bn,tn,ue){"use strict";var se=ue(92310),Te=ue.n(se),ze=ue(77861),ut=ue(2738),xe=ue(59301),Me=ue(53487),De=ue(62892),we=ue(19080),_e=ue(36355),Re=ue(1684),dt=ue(93891),Ae=ue(19716),Fe=ue(32441),ft=ue(33234),Ye=ue(14154),ot=ue(58582),at=ue(84443),Ct=ue(66339),jt=function(Ve,Je){var Lt={};for(var et in Ve)Object.prototype.hasOwnProperty.call(Ve,et)&&Je.indexOf(et)<0&&(Lt[et]=Ve[et]);if(Ve!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Dt=0,et=Object.getOwnPropertySymbols(Ve);Dt<et.length;Dt++)Je.indexOf(et[Dt])<0&&Object.prototype.propertyIsEnumerable.call(Ve,et[Dt])&&(Lt[et[Dt]]=Ve[et[Dt]]);return Lt};const it="SECRET_COMBOBOX_MODE_DO_NOT_USE",vt=(Ve,Je)=>{var Lt,{prefixCls:et,bordered:Dt=!0,className:Ge,rootClassName:kt,getPopupContainer:tt,popupClassName:$t,dropdownClassName:pt,listHeight:Bt=256,placement:Tt,listItemHeight:wt=24,size:Ne,disabled:be,notFoundContent:xt,status:Qt,builtinPlacements:Vt,dropdownMatchSelectWidth:qe,popupMatchSelectWidth:nt,direction:Ot,style:dn,allowClear:en}=Ve,on=jt(Ve,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:Xt,getPrefixCls:Ut,renderEmpty:Zt,direction:ye,virtual:le,popupMatchSelectWidth:oe,popupOverflow:he,select:pe}=xe.useContext(_e.E_),ce=Ut("select",et),Ie=Ut(),yt=Ot!=null?Ot:ye,{compactSize:Pe,compactItemClassnames:je}=(0,ft.ri)(ce,yt),[Rt,At]=(0,Ye.Z)(ce),rt=xe.useMemo(()=>{const{mode:Gr}=on;if(Gr!=="combobox")return Gr===it?"combobox":Gr},[on.mode]),Ft=rt==="multiple"||rt==="tags",sn=(0,at.Z)(on.suffixIcon,on.showArrow),ct=(Lt=nt!=null?nt:qe)!==null&&Lt!==void 0?Lt:oe,{status:qt,hasFeedback:an,isFormItemInput:Qe,feedbackIcon:mt}=xe.useContext(Fe.aM),Nt=(0,we.F)(qt,Qt);let vn;xt!==void 0?vn=xt:rt==="combobox"?vn=null:vn=(Zt==null?void 0:Zt("Select"))||xe.createElement(dt.Z,{componentName:"Select"});const{suffixIcon:mn,itemIcon:wn,removeIcon:Tn,clearIcon:Zn}=(0,Ct.Z)(Object.assign(Object.assign({},on),{multiple:Ft,hasFeedback:an,feedbackIcon:mt,showSuffixIcon:sn,prefixCls:ce,showArrow:on.showArrow,componentName:"Select"})),Hn=en===!0?{clearIcon:Zn}:en,wr=(0,ut.Z)(on,["suffixIcon","itemIcon"]),Cr=Te()($t||pt,{[`${ce}-dropdown-${yt}`]:yt==="rtl"},kt,At),Yn=(0,Ae.Z)(Gr=>{var ar;return(ar=Ne!=null?Ne:Pe)!==null&&ar!==void 0?ar:Gr}),Nr=xe.useContext(Re.Z),Kr=be!=null?be:Nr,Or=Te()({[`${ce}-lg`]:Yn==="large",[`${ce}-sm`]:Yn==="small",[`${ce}-rtl`]:yt==="rtl",[`${ce}-borderless`]:!Dt,[`${ce}-in-form-item`]:Qe},(0,we.Z)(ce,Nt,an),je,pe==null?void 0:pe.className,Ge,kt,At),Ar=xe.useMemo(()=>Tt!==void 0?Tt:yt==="rtl"?"bottomRight":"bottomLeft",[Tt,yt]),kr=(0,ot.Z)(Vt,he);return Rt(xe.createElement(ze.ZP,Object.assign({ref:Je,virtual:le,showSearch:pe==null?void 0:pe.showSearch},wr,{style:Object.assign(Object.assign({},pe==null?void 0:pe.style),dn),dropdownMatchSelectWidth:ct,builtinPlacements:kr,transitionName:(0,De.m)(Ie,"slide-up",on.transitionName),listHeight:Bt,listItemHeight:wt,mode:rt,prefixCls:ce,placement:Ar,direction:yt,suffixIcon:mn,menuItemSelectedIcon:wn,removeIcon:Tn,allowClear:Hn,notFoundContent:vn,className:Or,getPopupContainer:tt||Xt,dropdownClassName:Cr,disabled:Kr})))},$e=xe.forwardRef(vt),Ee=(0,Me.Z)($e);$e.SECRET_COMBOBOX_MODE_DO_NOT_USE=it,$e.Option=ze.Wx,$e.OptGroup=ze.Xo,$e._InternalPanelDoNotUseOrYouWillBeFired=Ee,tn.default=$e},14154:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return $e}});var se=ue(17313),Te=ue(74207),ze=ue(37613),ut=ue(83116),xe=ue(13826),Me=ue(92899);const De=Ee=>{const{optionHeight:Ve,optionFontSize:Je,optionLineHeight:Lt,optionPadding:et}=Ee;return{position:"relative",display:"block",minHeight:Ve,padding:et,color:Ee.colorText,fontWeight:"normal",fontSize:Je,lineHeight:Lt,boxSizing:"border-box"}};var _e=Ee=>{const{antCls:Ve,componentCls:Je}=Ee,Lt=`${Je}-item`,et=`&${Ve}-slide-up-enter${Ve}-slide-up-enter-active`,Dt=`&${Ve}-slide-up-appear${Ve}-slide-up-appear-active`,Ge=`&${Ve}-slide-up-leave${Ve}-slide-up-leave-active`,kt=`${Je}-dropdown-placement-`;return[{[`${Je}-dropdown`]:Object.assign(Object.assign({},(0,se.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,[`
${et}${kt}bottomLeft,
${Dt}${kt}bottomLeft
`]:{animationName:xe.fJ},[`
${et}${kt}topLeft,
${Dt}${kt}topLeft,
${et}${kt}topRight,
${Dt}${kt}topRight
`]:{animationName:xe.Qt},[`${Ge}${kt}bottomLeft`]:{animationName:xe.Uw},[`
${Ge}${kt}topLeft,
${Ge}${kt}topRight
`]:{animationName:xe.ly},"&-hidden":{display:"none"},[`${Lt}`]:Object.assign(Object.assign({},De(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"},se.vS),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${Lt}-option-disabled)`]:{backgroundColor:Ee.optionActiveBg},[`&-selected:not(${Lt}-option-disabled)`]:{color:Ee.optionSelectedColor,fontWeight:Ee.optionSelectedFontWeight,backgroundColor:Ee.optionSelectedBg,[`${Lt}-option-state`]:{color:Ee.colorPrimary}},"&-disabled":{[`&${Lt}-option-selected`]:{backgroundColor:Ee.colorBgContainerDisabled},color:Ee.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:Ee.controlPaddingHorizontal*2}}}),"&-rtl":{direction:"rtl"}})},(0,xe.oN)(Ee,"slide-up"),(0,xe.oN)(Ee,"slide-down"),(0,Me.Fm)(Ee,"move-up"),(0,Me.Fm)(Ee,"move-down")]};const Re=2,dt=Ee=>{let{controlHeightSM:Ve,controlHeight:Je,lineWidth:Lt}=Ee;const et=(Je-Ve)/2-Lt,Dt=Math.ceil(et/2);return[et,Dt]};function Ae(Ee,Ve){const{componentCls:Je,iconCls:Lt}=Ee,et=`${Je}-selection-overflow`,Dt=Ee.multipleSelectItemHeight,[Ge]=dt(Ee),kt=Ve?`${Je}-${Ve}`:"";return{[`${Je}-multiple${kt}`]:{fontSize:Ee.fontSize,[et]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},[`${Je}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",padding:`${Ge-Re}px ${Re*2}px`,borderRadius:Ee.borderRadius,[`${Je}-show-search&`]:{cursor:"text"},[`${Je}-disabled&`]:{background:Ee.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${Re}px 0`,lineHeight:`${Dt}px`,visibility:"hidden",content:'"\\a0"'}},[`
&${Je}-show-arrow ${Je}-selector,
&${Je}-allow-clear ${Je}-selector
`]:{paddingInlineEnd:Ee.fontSizeIcon+Ee.controlPaddingHorizontal},[`${Je}-selection-item`]:{position:"relative",display:"flex",flex:"none",boxSizing:"border-box",maxWidth:"100%",height:Dt,marginTop:Re,marginBottom:Re,lineHeight:`${Dt-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:Re*2,paddingInlineStart:Ee.paddingXS,paddingInlineEnd:Ee.paddingXS/2,[`${Je}-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,se.Ro)()),{display:"inline-flex",alignItems:"center",color:Ee.colorIcon,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${Lt}`]:{verticalAlign:"-0.2em"},"&:hover":{color:Ee.colorIconHover}})},[`${et}-item + ${et}-item`]:{[`${Je}-selection-search`]:{marginInlineStart:0}},[`${Je}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:Ee.inputPaddingHorizontalBase-Ge,"\n &-input,\n &-mirror\n ":{height:Dt,fontFamily:Ee.fontFamily,lineHeight:`${Dt}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"}},[`${Je}-selection-placeholder `]:{position:"absolute",top:"50%",insetInlineStart:Ee.inputPaddingHorizontalBase,insetInlineEnd:Ee.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${Ee.motionDurationSlow}`}}}}var ft=Ee=>{const{componentCls:Ve}=Ee,Je=(0,ze.TS)(Ee,{controlHeight:Ee.controlHeightSM,multipleSelectItemHeight:Ee.controlHeightXS,borderRadius:Ee.borderRadiusSM,borderRadiusSM:Ee.borderRadiusXS}),Lt=(0,ze.TS)(Ee,{fontSize:Ee.fontSizeLG,controlHeight:Ee.controlHeightLG,multipleSelectItemHeight:Ee.multipleItemHeightLG,borderRadius:Ee.borderRadiusLG,borderRadiusSM:Ee.borderRadius}),[,et]=dt(Ee);return[Ae(Ee),Ae(Je,"sm"),{[`${Ve}-multiple${Ve}-sm`]:{[`${Ve}-selection-placeholder`]:{insetInline:Ee.controlPaddingHorizontalSM-Ee.lineWidth},[`${Ve}-selection-search`]:{marginInlineStart:et}}},Ae(Lt,"lg")]};function Ye(Ee,Ve){const{componentCls:Je,inputPaddingHorizontalBase:Lt,borderRadius:et}=Ee,Dt=Ee.controlHeight-Ee.lineWidth*2,Ge=Math.ceil(Ee.fontSize*1.25),kt=Ve?`${Je}-${Ve}`:"";return{[`${Je}-single${kt}`]:{fontSize:Ee.fontSize,[`${Je}-selector`]:Object.assign(Object.assign({},(0,se.Wf)(Ee)),{display:"flex",borderRadius:et,[`${Je}-selection-search`]:{position:"absolute",top:0,insetInlineStart:Lt,insetInlineEnd:Lt,bottom:0,"&-input":{width:"100%"}},[`
${Je}-selection-item,
${Je}-selection-placeholder
`]:{padding:0,lineHeight:`${Dt}px`,transition:`all ${Ee.motionDurationSlow}, visibility 0s`,"@supports (-moz-appearance: meterbar)":{lineHeight:`${Dt}px`}},[`${Je}-selection-item`]:{position:"relative",userSelect:"none"},[`${Je}-selection-placeholder`]:{transition:"none",pointerEvents:"none"},[["&:after",`${Je}-selection-item:after`,`${Je}-selection-placeholder:after`].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),[`
&${Je}-show-arrow ${Je}-selection-item,
&${Je}-show-arrow ${Je}-selection-placeholder
`]:{paddingInlineEnd:Ge},[`&${Je}-open ${Je}-selection-item`]:{color:Ee.colorTextPlaceholder},[`&:not(${Je}-customize-input)`]:{[`${Je}-selector`]:{width:"100%",height:Ee.controlHeight,padding:`0 ${Lt}px`,[`${Je}-selection-search-input`]:{height:Dt},"&:after":{lineHeight:`${Dt}px`}}},[`&${Je}-customize-input`]:{[`${Je}-selector`]:{"&:after":{display:"none"},[`${Je}-selection-search`]:{position:"static",width:"100%"},[`${Je}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${Lt}px`,"&:after":{display:"none"}}}}}}}function ot(Ee){const{componentCls:Ve}=Ee,Je=Ee.controlPaddingHorizontalSM-Ee.lineWidth;return[Ye(Ee),Ye((0,ze.TS)(Ee,{controlHeight:Ee.controlHeightSM,borderRadius:Ee.borderRadiusSM}),"sm"),{[`${Ve}-single${Ve}-sm`]:{[`&:not(${Ve}-customize-input)`]:{[`${Ve}-selection-search`]:{insetInlineStart:Je,insetInlineEnd:Je},[`${Ve}-selector`]:{padding:`0 ${Je}px`},[`&${Ve}-show-arrow ${Ve}-selection-search`]:{insetInlineEnd:Je+Ee.fontSize*1.5},[`
&${Ve}-show-arrow ${Ve}-selection-item,
&${Ve}-show-arrow ${Ve}-selection-placeholder
`]:{paddingInlineEnd:Ee.fontSize*1.5}}}},Ye((0,ze.TS)(Ee,{controlHeight:Ee.singleItemHeightLG,fontSize:Ee.fontSizeLG,borderRadius:Ee.borderRadiusLG}),"lg")]}const at=Ee=>{const{componentCls:Ve,selectorBg:Je}=Ee;return{position:"relative",backgroundColor:Je,border:`${Ee.lineWidth}px ${Ee.lineType} ${Ee.colorBorder}`,transition:`all ${Ee.motionDurationMid} ${Ee.motionEaseInOut}`,input:{cursor:"pointer"},[`${Ve}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit"}},[`${Ve}-disabled&`]:{color:Ee.colorTextDisabled,background:Ee.colorBgContainerDisabled,cursor:"not-allowed",[`${Ve}-multiple&`]:{background:Ee.multipleSelectorBgDisabled},input:{cursor:"not-allowed"}}}},Ct=function(Ee,Ve){let Je=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const{componentCls:Lt,borderHoverColor:et,outlineColor:Dt,antCls:Ge}=Ve,kt=Je?{[`${Lt}-selector`]:{borderColor:et}}:{};return{[Ee]:{[`&:not(${Lt}-disabled):not(${Lt}-customize-input):not(${Ge}-pagination-size-changer)`]:Object.assign(Object.assign({},kt),{[`${Lt}-focused& ${Lt}-selector`]:{borderColor:et,boxShadow:`0 0 0 ${Ve.controlOutlineWidth}px ${Dt}`,outline:0},[`&:hover ${Lt}-selector`]:{borderColor:et}})}}},jt=Ee=>{const{componentCls:Ve}=Ee;return{[`${Ve}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},it=Ee=>{const{componentCls:Ve,inputPaddingHorizontalBase:Je,iconCls:Lt}=Ee;return{[Ve]:Object.assign(Object.assign({},(0,se.Wf)(Ee)),{position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${Ve}-customize-input) ${Ve}-selector`]:Object.assign(Object.assign({},at(Ee)),jt(Ee)),[`${Ve}-selection-item`]:Object.assign({flex:1,fontWeight:"normal"},se.vS),[`${Ve}-selection-placeholder`]:Object.assign(Object.assign({},se.vS),{flex:1,color:Ee.colorTextPlaceholder,pointerEvents:"none"}),[`${Ve}-arrow`]:Object.assign(Object.assign({},(0,se.Ro)()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:Je,height:Ee.fontSizeIcon,marginTop:-Ee.fontSizeIcon/2,color:Ee.colorTextQuaternary,fontSize:Ee.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",[Lt]:{verticalAlign:"top",transition:`transform ${Ee.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${Ve}-suffix)`]:{pointerEvents:"auto"}},[`${Ve}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${Ve}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:Je,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":{[`${Ve}-clear`]:{opacity:1}}}),[`${Ve}-has-feedback`]:{[`${Ve}-clear`]:{insetInlineEnd:Je+Ee.fontSize+Ee.paddingXS}}}},vt=Ee=>{const{componentCls:Ve}=Ee;return[{[Ve]:{[`&-borderless ${Ve}-selector`]:{backgroundColor:"transparent !important",borderColor:"transparent !important",boxShadow:"none !important"},[`&${Ve}-in-form-item`]:{width:"100%"}}},it(Ee),ot(Ee),ft(Ee),_e(Ee),{[`${Ve}-rtl`]:{direction:"rtl"}},Ct(Ve,(0,ze.TS)(Ee,{borderHoverColor:Ee.colorPrimaryHover,outlineColor:Ee.controlOutline})),Ct(`${Ve}-status-error`,(0,ze.TS)(Ee,{borderHoverColor:Ee.colorErrorHover,outlineColor:Ee.colorErrorOutline}),!0),Ct(`${Ve}-status-warning`,(0,ze.TS)(Ee,{borderHoverColor:Ee.colorWarningHover,outlineColor:Ee.colorWarningOutline}),!0),(0,Te.c)(Ee,{borderElCls:`${Ve}-selector`,focusElCls:`${Ve}-focused`})]};var $e=(0,ut.Z)("Select",(Ee,Ve)=>{let{rootPrefixCls:Je}=Ve;const Lt=(0,ze.TS)(Ee,{rootPrefixCls:Je,inputPaddingHorizontalBase:Ee.paddingSM-1,multipleSelectItemHeight:Ee.multipleItemHeight});return[vt(Lt)]},Ee=>{const{fontSize:Ve,lineHeight:Je,controlHeight:Lt,controlPaddingHorizontal:et,zIndexPopupBase:Dt,colorText:Ge,fontWeightStrong:kt,controlItemBgActive:tt,controlItemBgHover:$t,colorBgContainer:pt,colorFillSecondary:Bt,controlHeightLG:Tt,controlHeightSM:wt,colorBgContainerDisabled:Ne,colorTextDisabled:be}=Ee;return{zIndexPopup:Dt+50,optionSelectedColor:Ge,optionSelectedFontWeight:kt,optionSelectedBg:tt,optionActiveBg:$t,optionPadding:`${(Lt-Ve*Je)/2}px ${et}px`,optionFontSize:Ve,optionLineHeight:Je,optionHeight:Lt,selectorBg:pt,clearBg:pt,singleItemHeightLG:Tt,multipleItemBg:Bt,multipleItemBorderColor:"transparent",multipleItemHeight:wt,multipleItemHeightLG:Lt,multipleSelectorBgDisabled:Ne,multipleItemColorDisabled:be,multipleItemBorderColorDisabled:"transparent"}})},58582:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return Te}});const se=ze=>{const xe={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:ze==="scroll"?"scroll":"visible",_experimental:{dynamicInset:!0}};return{bottomLeft:Object.assign(Object.assign({},xe),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},xe),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},xe),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},xe),{points:["br","tr"],offset:[0,-4]})}};function Te(ze,ut){return ze||se(ut)}},84443:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return se}});function se(Te,ze){return ze!==void 0?ze:Te!==null}},66339:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return we}});var se=ue(40001),Te=ue(19248),ze=ue(99267),ut=ue(84105),xe=ue(58617),Me=ue(47472),De=ue(59301);function we(_e){let{suffixIcon:Re,clearIcon:dt,menuItemSelectedIcon:Ae,removeIcon:Fe,loading:ft,multiple:Ye,hasFeedback:ot,prefixCls:at,showSuffixIcon:Ct,feedbackIcon:jt,showArrow:it,componentName:vt}=_e;const $e=dt!=null?dt:De.createElement(Te.Z,null),Ee=et=>Re===null&&!ot&&!it?null:De.createElement(De.Fragment,null,Ct!==!1&&et,ot&&jt);let Ve=null;if(Re!==void 0)Ve=Ee(Re);else if(ft)Ve=Ee(De.createElement(xe.Z,{spin:!0}));else{const et=`${at}-suffix`;Ve=Dt=>{let{open:Ge,showSearch:kt}=Dt;return Ee(Ge&&kt?De.createElement(Me.Z,{className:et}):De.createElement(ut.Z,{className:et}))}}let Je=null;Ae!==void 0?Je=Ae:Ye?Je=De.createElement(se.Z,null):Je=null;let Lt=null;return Fe!==void 0?Lt=Fe:Lt=De.createElement(ze.Z,null),{clearIcon:$e,suffixIcon:Ve,itemIcon:Je,removeIcon:Lt}}},8378:function(bn,tn){"use strict";const ue=se=>({[se.componentCls]:{[`${se.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${se.motionDurationMid} ${se.motionEaseInOut},
opacity ${se.motionDurationMid} ${se.motionEaseInOut} !important`}},[`${se.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${se.motionDurationMid} ${se.motionEaseInOut},
opacity ${se.motionDurationMid} ${se.motionEaseInOut} !important`}}});tn.Z=ue},92899:function(bn,tn,ue){"use strict";ue.d(tn,{Fm:function(){return Ae}});var se=ue(36237),Te=ue(95406);const ze=new se.Keyframes("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),ut=new se.Keyframes("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),xe=new se.Keyframes("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Me=new se.Keyframes("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),De=new se.Keyframes("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),we=new se.Keyframes("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),_e=new se.Keyframes("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Re=new se.Keyframes("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),dt={"move-up":{inKeyframes:_e,outKeyframes:Re},"move-down":{inKeyframes:ze,outKeyframes:ut},"move-left":{inKeyframes:xe,outKeyframes:Me},"move-right":{inKeyframes:De,outKeyframes:we}},Ae=(Fe,ft)=>{const{antCls:Ye}=Fe,ot=`${Ye}-${ft}`,{inKeyframes:at,outKeyframes:Ct}=dt[ft];return[(0,Te.R)(ot,at,Ct,Fe.motionDurationMid),{[`
${ot}-enter,
${ot}-appear
`]:{opacity:0,animationTimingFunction:Fe.motionEaseOutCirc},[`${ot}-leave`]:{animationTimingFunction:Fe.motionEaseInOutCirc}}]}},13826:function(bn,tn,ue){"use strict";ue.d(tn,{Qt:function(){return xe},Uw:function(){return ut},fJ:function(){return ze},ly:function(){return Me},oN:function(){return Ae}});var se=ue(36237),Te=ue(95406);const ze=new se.Keyframes("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),ut=new se.Keyframes("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),xe=new se.Keyframes("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),Me=new se.Keyframes("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),De=new se.Keyframes("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),we=new se.Keyframes("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),_e=new se.Keyframes("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),Re=new se.Keyframes("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),dt={"slide-up":{inKeyframes:ze,outKeyframes:ut},"slide-down":{inKeyframes:xe,outKeyframes:Me},"slide-left":{inKeyframes:De,outKeyframes:we},"slide-right":{inKeyframes:_e,outKeyframes:Re}},Ae=(Fe,ft)=>{const{antCls:Ye}=Fe,ot=`${Ye}-${ft}`,{inKeyframes:at,outKeyframes:Ct}=dt[ft];return[(0,Te.R)(ot,at,Ct,Fe.motionDurationMid),{[`
${ot}-enter,
${ot}-appear
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:Fe.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${ot}-leave`]:{animationTimingFunction:Fe.motionEaseInQuint}}]}},78673:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return kt}});var se=ue(58617),Te=ue(92310),ze=ue.n(Te),ut=ue(60499),xe=ue(18642),Me=ue(72190),De=ue(42244),we=ue(59301),_e=ue(18929),Re=ue(10228),dt=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],Ae=we.forwardRef(function(tt,$t){var pt,Bt=tt.prefixCls,Tt=Bt===void 0?"rc-switch":Bt,wt=tt.className,Ne=tt.checked,be=tt.defaultChecked,xt=tt.disabled,Qt=tt.loadingIcon,Vt=tt.checkedChildren,qe=tt.unCheckedChildren,nt=tt.onClick,Ot=tt.onChange,dn=tt.onKeyDown,en=(0,De.Z)(tt,dt),on=(0,_e.Z)(!1,{value:Ne,defaultValue:be}),Xt=(0,Me.Z)(on,2),Ut=Xt[0],Zt=Xt[1];function ye(pe,ce){var Ie=Ut;return xt||(Ie=pe,Zt(Ie),Ot==null||Ot(Ie,ce)),Ie}function le(pe){pe.which===Re.Z.LEFT?ye(!1,pe):pe.which===Re.Z.RIGHT&&ye(!0,pe),dn==null||dn(pe)}function oe(pe){var ce=ye(!Ut,pe);nt==null||nt(ce,pe)}var he=ze()(Tt,wt,(pt={},(0,xe.Z)(pt,"".concat(Tt,"-checked"),Ut),(0,xe.Z)(pt,"".concat(Tt,"-disabled"),xt),pt));return we.createElement("button",(0,ut.Z)({},en,{type:"button",role:"switch","aria-checked":Ut,disabled:xt,className:he,ref:$t,onKeyDown:le,onClick:oe}),Qt,we.createElement("span",{className:"".concat(Tt,"-inner")},we.createElement("span",{className:"".concat(Tt,"-inner-checked")},Vt),we.createElement("span",{className:"".concat(Tt,"-inner-unchecked")},qe)))});Ae.displayName="Switch";var Fe=Ae,ft=ue(14088),Ye=ue(36355),ot=ue(1684),at=ue(19716),Ct=ue(64993),jt=ue(17313),it=ue(83116),vt=ue(37613);const $e=tt=>{const{componentCls:$t,trackHeightSM:pt,trackPadding:Bt,trackMinWidthSM:Tt,innerMinMarginSM:wt,innerMaxMarginSM:Ne,handleSizeSM:be}=tt,xt=`${$t}-inner`;return{[$t]:{[`&${$t}-small`]:{minWidth:Tt,height:pt,lineHeight:`${pt}px`,[`${$t}-inner`]:{paddingInlineStart:Ne,paddingInlineEnd:wt,[`${xt}-checked`]:{marginInlineStart:`calc(-100% + ${be+Bt*2}px - ${Ne*2}px)`,marginInlineEnd:`calc(100% - ${be+Bt*2}px + ${Ne*2}px)`},[`${xt}-unchecked`]:{marginTop:-pt,marginInlineStart:0,marginInlineEnd:0}},[`${$t}-handle`]:{width:be,height:be},[`${$t}-loading-icon`]:{top:(be-tt.switchLoadingIconSize)/2,fontSize:tt.switchLoadingIconSize},[`&${$t}-checked`]:{[`${$t}-inner`]:{paddingInlineStart:wt,paddingInlineEnd:Ne,[`${xt}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${xt}-unchecked`]:{marginInlineStart:`calc(100% - ${be+Bt*2}px + ${Ne*2}px)`,marginInlineEnd:`calc(-100% + ${be+Bt*2}px - ${Ne*2}px)`}},[`${$t}-handle`]:{insetInlineStart:`calc(100% - ${be+Bt}px)`}},[`&:not(${$t}-disabled):active`]:{[`&:not(${$t}-checked) ${xt}`]:{[`${xt}-unchecked`]:{marginInlineStart:tt.marginXXS/2,marginInlineEnd:-tt.marginXXS/2}},[`&${$t}-checked ${xt}`]:{[`${xt}-checked`]:{marginInlineStart:-tt.marginXXS/2,marginInlineEnd:tt.marginXXS/2}}}}}}},Ee=tt=>{const{componentCls:$t,handleSize:pt}=tt;return{[$t]:{[`${$t}-loading-icon${tt.iconCls}`]:{position:"relative",top:(pt-tt.fontSize)/2,color:tt.switchLoadingIconColor,verticalAlign:"top"},[`&${$t}-checked ${$t}-loading-icon`]:{color:tt.switchColor}}}},Ve=tt=>{const{componentCls:$t,motion:pt,trackPadding:Bt,handleBg:Tt,handleShadow:wt,handleSize:Ne}=tt,be=`${$t}-handle`;return{[$t]:{[be]:{position:"absolute",top:Bt,insetInlineStart:Bt,width:Ne,height:Ne,transition:`all ${tt.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:Tt,borderRadius:Ne/2,boxShadow:wt,transition:`all ${tt.switchDuration} ease-in-out`,content:'""'}},[`&${$t}-checked ${be}`]:{insetInlineStart:`calc(100% - ${Ne+Bt}px)`},[`&:not(${$t}-disabled):active`]:pt?{[`${be}::before`]:{insetInlineEnd:tt.switchHandleActiveInset,insetInlineStart:0},[`&${$t}-checked ${be}::before`]:{insetInlineEnd:0,insetInlineStart:tt.switchHandleActiveInset}}:{}}}},Je=tt=>{const{componentCls:$t,trackHeight:pt,trackPadding:Bt,innerMinMargin:Tt,innerMaxMargin:wt,handleSize:Ne}=tt,be=`${$t}-inner`;return{[$t]:{[be]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:wt,paddingInlineEnd:Tt,transition:`padding-inline-start ${tt.switchDuration} ease-in-out, padding-inline-end ${tt.switchDuration} ease-in-out`,[`${be}-checked, ${be}-unchecked`]:{display:"block",color:tt.colorTextLightSolid,fontSize:tt.fontSizeSM,transition:`margin-inline-start ${tt.switchDuration} ease-in-out, margin-inline-end ${tt.switchDuration} ease-in-out`,pointerEvents:"none"},[`${be}-checked`]:{marginInlineStart:`calc(-100% + ${Ne+Bt*2}px - ${wt*2}px)`,marginInlineEnd:`calc(100% - ${Ne+Bt*2}px + ${wt*2}px)`},[`${be}-unchecked`]:{marginTop:-pt,marginInlineStart:0,marginInlineEnd:0}},[`&${$t}-checked ${be}`]:{paddingInlineStart:Tt,paddingInlineEnd:wt,[`${be}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${be}-unchecked`]:{marginInlineStart:`calc(100% - ${Ne+Bt*2}px + ${wt*2}px)`,marginInlineEnd:`calc(-100% + ${Ne+Bt*2}px - ${wt*2}px)`}},[`&:not(${$t}-disabled):active`]:{[`&:not(${$t}-checked) ${be}`]:{[`${be}-unchecked`]:{marginInlineStart:Bt*2,marginInlineEnd:-Bt*2}},[`&${$t}-checked ${be}`]:{[`${be}-checked`]:{marginInlineStart:-Bt*2,marginInlineEnd:Bt*2}}}}}},Lt=tt=>{const{componentCls:$t,trackHeight:pt,trackMinWidth:Bt}=tt;return{[$t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,jt.Wf)(tt)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:Bt,height:pt,lineHeight:`${pt}px`,verticalAlign:"middle",background:tt.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${tt.motionDurationMid}`,userSelect:"none",[`&:hover:not(${$t}-disabled)`]:{background:tt.colorTextTertiary}}),(0,jt.Qy)(tt)),{[`&${$t}-checked`]:{background:tt.switchColor,[`&:hover:not(${$t}-disabled)`]:{background:tt.colorPrimaryHover}},[`&${$t}-loading, &${$t}-disabled`]:{cursor:"not-allowed",opacity:tt.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${$t}-rtl`]:{direction:"rtl"}})}};var et=(0,it.Z)("Switch",tt=>{const $t=(0,vt.TS)(tt,{switchDuration:tt.motionDurationMid,switchColor:tt.colorPrimary,switchDisabledOpacity:tt.opacityLoading,switchLoadingIconSize:tt.fontSizeIcon*.75,switchLoadingIconColor:`rgba(0, 0, 0, ${tt.opacityLoading})`,switchHandleActiveInset:"-30%"});return[Lt($t),Je($t),Ve($t),Ee($t),$e($t)]},tt=>{const{fontSize:$t,lineHeight:pt,controlHeight:Bt,colorWhite:Tt}=tt,wt=$t*pt,Ne=Bt/2,be=2,xt=wt-be*2,Qt=Ne-be*2;return{trackHeight:wt,trackHeightSM:Ne,trackMinWidth:xt*2+be*4,trackMinWidthSM:Qt*2+be*2,trackPadding:be,handleBg:Tt,handleSize:xt,handleSizeSM:Qt,handleShadow:`0 2px 4px 0 ${new Ct.C("#00230b").setAlpha(.2).toRgbString()}`,innerMinMargin:xt/2,innerMaxMargin:xt+be+be*2,innerMinMarginSM:Qt/2,innerMaxMarginSM:Qt+be+be*2}}),Dt=function(tt,$t){var pt={};for(var Bt in tt)Object.prototype.hasOwnProperty.call(tt,Bt)&&$t.indexOf(Bt)<0&&(pt[Bt]=tt[Bt]);if(tt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Tt=0,Bt=Object.getOwnPropertySymbols(tt);Tt<Bt.length;Tt++)$t.indexOf(Bt[Tt])<0&&Object.prototype.propertyIsEnumerable.call(tt,Bt[Tt])&&(pt[Bt[Tt]]=tt[Bt[Tt]]);return pt};const Ge=we.forwardRef((tt,$t)=>{const{prefixCls:pt,size:Bt,disabled:Tt,loading:wt,className:Ne,rootClassName:be,style:xt}=tt,Qt=Dt(tt,["prefixCls","size","disabled","loading","className","rootClassName","style"]),{getPrefixCls:Vt,direction:qe,switch:nt}=we.useContext(Ye.E_),Ot=we.useContext(ot.Z),dn=(Tt!=null?Tt:Ot)||wt,en=Vt("switch",pt),on=we.createElement("div",{className:`${en}-handle`},wt&&we.createElement(se.Z,{className:`${en}-loading-icon`})),[Xt,Ut]=et(en),Zt=(0,at.Z)(Bt),ye=ze()(nt==null?void 0:nt.className,{[`${en}-small`]:Zt==="small",[`${en}-loading`]:wt,[`${en}-rtl`]:qe==="rtl"},Ne,be,Ut),le=Object.assign(Object.assign({},nt==null?void 0:nt.style),xt);return Xt(we.createElement(ft.Z,{component:"Switch"},we.createElement(Fe,Object.assign({},Qt,{prefixCls:en,className:ye,style:le,disabled:dn,ref:$t,loadingIcon:on}))))});Ge.__ANT_SWITCH=!0;var kt=Ge},99313:function(bn,tn,ue){"use strict";ue.d(tn,{default:function(){return St}});var se=ue(99267),Te=ue(18785),ze=ue(62772),ut=ue(92310),xe=ue.n(ut),Me=ue(60499),De=ue(18642),we=ue(85899),_e=ue(72190),Re=ue(43749),dt=ue(42244),Ae=ue(59301),Fe=ue(49658),ft=ue(18929),Ye=ue(77900),ot=(0,Ae.createContext)(null),at=Ae.forwardRef(function(Le,We){var Be=Le.prefixCls,Oe=Le.className,lt=Le.style,_t=Le.id,Yt=Le.active,Kt=Le.tabKey,Jt=Le.children;return Ae.createElement("div",{id:_t&&"".concat(_t,"-panel-").concat(Kt),role:"tabpanel",tabIndex:Yt?0:-1,"aria-labelledby":_t&&"".concat(_t,"-tab-").concat(Kt),"aria-hidden":!Yt,style:lt,className:xe()(Be,Yt&&"".concat(Be,"-active"),Oe),ref:We},Jt)}),Ct=at,jt=["key","forceRender","style","className"];function it(Le){var We=Le.id,Be=Le.activeKey,Oe=Le.animated,lt=Le.tabPosition,_t=Le.destroyInactiveTabPane,Yt=Ae.useContext(ot),Kt=Yt.prefixCls,Jt=Yt.tabs,un=Oe.tabPane,fn="".concat(Kt,"-tabpane");return Ae.createElement("div",{className:xe()("".concat(Kt,"-content-holder"))},Ae.createElement("div",{className:xe()("".concat(Kt,"-content"),"".concat(Kt,"-content-").concat(lt),(0,De.Z)({},"".concat(Kt,"-content-animated"),un))},Jt.map(function(xn){var zt=xn.key,ln=xn.forceRender,jn=xn.style,Dn=xn.className,Vn=(0,dt.Z)(xn,jt),Pn=zt===Be;return Ae.createElement(Ye.default,(0,Me.Z)({key:zt,visible:Pn,forceRender:ln,removeOnLeave:!!_t,leavedClassName:"".concat(fn,"-hidden")},Oe.tabPaneMotion),function(yr,Sn){var pr=yr.style,ht=yr.className;return Ae.createElement(Ct,(0,Me.Z)({},Vn,{prefixCls:fn,id:We,tabKey:zt,animated:un,active:Pn,style:(0,we.Z)((0,we.Z)({},jn),pr),className:xe()(Dn,ht),ref:Sn}))})})))}var vt=ue(77654),$e=ue(29301),Ee=ue(6089),Ve=ue(8654),Je={width:0,height:0,left:0,top:0};function Lt(Le,We,Be){return(0,Ae.useMemo)(function(){for(var Oe,lt=new Map,_t=We.get((Oe=Le[0])===null||Oe===void 0?void 0:Oe.key)||Je,Yt=_t.left+_t.width,Kt=0;Kt<Le.length;Kt+=1){var Jt=Le[Kt].key,un=We.get(Jt);if(!un){var fn;un=We.get((fn=Le[Kt-1])===null||fn===void 0?void 0:fn.key)||Je}var xn=lt.get(Jt)||(0,we.Z)({},un);xn.right=Yt-xn.left-xn.width,lt.set(Jt,xn)}return lt},[Le.map(function(Oe){return Oe.key}).join("_"),We,Be])}function et(Le,We){var Be=Ae.useRef(Le),Oe=Ae.useState({}),lt=(0,_e.Z)(Oe,2),_t=lt[1];function Yt(Kt){var Jt=typeof Kt=="function"?Kt(Be.current):Kt;Jt!==Be.current&&We(Jt,Be.current),Be.current=Jt,_t({})}return[Be.current,Yt]}var Dt=.1,Ge=.01,kt=20,tt=Math.pow(.995,kt);function $t(Le,We){var Be=(0,Ae.useState)(),Oe=(0,_e.Z)(Be,2),lt=Oe[0],_t=Oe[1],Yt=(0,Ae.useState)(0),Kt=(0,_e.Z)(Yt,2),Jt=Kt[0],un=Kt[1],fn=(0,Ae.useState)(0),xn=(0,_e.Z)(fn,2),zt=xn[0],ln=xn[1],jn=(0,Ae.useState)(),Dn=(0,_e.Z)(jn,2),Vn=Dn[0],Pn=Dn[1],yr=(0,Ae.useRef)();function Sn(gt){var Wt=gt.touches[0],Gt=Wt.screenX,nn=Wt.screenY;_t({x:Gt,y:nn}),window.clearInterval(yr.current)}function pr(gt){if(lt){gt.preventDefault();var Wt=gt.touches[0],Gt=Wt.screenX,nn=Wt.screenY;_t({x:Gt,y:nn});var Ht=Gt-lt.x,bt=nn-lt.y;We(Ht,bt);var Cn=Date.now();un(Cn),ln(Cn-Jt),Pn({x:Ht,y:bt})}}function ht(){if(lt&&(_t(null),Pn(null),Vn)){var gt=Vn.x/zt,Wt=Vn.y/zt,Gt=Math.abs(gt),nn=Math.abs(Wt);if(Math.max(Gt,nn)<Dt)return;var Ht=gt,bt=Wt;yr.current=window.setInterval(function(){if(Math.abs(Ht)<Ge&&Math.abs(bt)<Ge){window.clearInterval(yr.current);return}Ht*=tt,bt*=tt,We(Ht*kt,bt*kt)},kt)}}var Ue=(0,Ae.useRef)();function Xe(gt){var Wt=gt.deltaX,Gt=gt.deltaY,nn=0,Ht=Math.abs(Wt),bt=Math.abs(Gt);Ht===bt?nn=Ue.current==="x"?Wt:Gt:Ht>bt?(nn=Wt,Ue.current="x"):(nn=Gt,Ue.current="y"),We(-nn,-nn)&&gt.preventDefault()}var Ze=(0,Ae.useRef)(null);Ze.current={onTouchStart:Sn,onTouchMove:pr,onTouchEnd:ht,onWheel:Xe},Ae.useEffect(function(){function gt(Ht){Ze.current.onTouchStart(Ht)}function Wt(Ht){Ze.current.onTouchMove(Ht)}function Gt(Ht){Ze.current.onTouchEnd(Ht)}function nn(Ht){Ze.current.onWheel(Ht)}return document.addEventListener("touchmove",Wt,{passive:!1}),document.addEventListener("touchend",Gt,{passive:!1}),Le.current.addEventListener("touchstart",gt,{passive:!1}),Le.current.addEventListener("wheel",nn),function(){document.removeEventListener("touchmove",Wt),document.removeEventListener("touchend",Gt)}},[])}var pt=ue(34280);function Bt(Le){var We=(0,Ae.useState)(0),Be=(0,_e.Z)(We,2),Oe=Be[0],lt=Be[1],_t=(0,Ae.useRef)(0),Yt=(0,Ae.useRef)();return Yt.current=Le,(0,pt.o)(function(){var Kt;(Kt=Yt.current)===null||Kt===void 0||Kt.call(Yt)},[Oe]),function(){_t.current===Oe&&(_t.current+=1,lt(_t.current))}}function Tt(Le){var We=(0,Ae.useRef)([]),Be=(0,Ae.useState)({}),Oe=(0,_e.Z)(Be,2),lt=Oe[1],_t=(0,Ae.useRef)(typeof Le=="function"?Le():Le),Yt=Bt(function(){var Jt=_t.current;We.current.forEach(function(un){Jt=un(Jt)}),We.current=[],_t.current=Jt,lt({})});function Kt(Jt){We.current.push(Jt),Yt()}return[_t.current,Kt]}var wt={width:0,height:0,left:0,top:0,right:0};function Ne(Le,We,Be,Oe,lt,_t,Yt){var Kt=Yt.tabs,Jt=Yt.tabPosition,un=Yt.rtl,fn,xn,zt;return["top","bottom"].includes(Jt)?(fn="width",xn=un?"right":"left",zt=Math.abs(Be)):(fn="height",xn="top",zt=-Be),(0,Ae.useMemo)(function(){if(!Kt.length)return[0,0];for(var ln=Kt.length,jn=ln,Dn=0;Dn<ln;Dn+=1){var Vn=Le.get(Kt[Dn].key)||wt;if(Vn[xn]+Vn[fn]>zt+We){jn=Dn-1;break}}for(var Pn=0,yr=ln-1;yr>=0;yr-=1){var Sn=Le.get(Kt[yr].key)||wt;if(Sn[xn]<zt){Pn=yr+1;break}}return Pn>=jn?[0,0]:[Pn,jn]},[Le,We,Oe,lt,_t,zt,Jt,Kt.map(function(ln){return ln.key}).join("_"),un])}function be(Le){var We;return Le instanceof Map?(We={},Le.forEach(function(Be,Oe){We[Oe]=Be})):We=Le,JSON.stringify(We)}var xt="TABS_DQ";function Qt(Le){return String(Le).replace(/"/g,xt)}function Vt(Le,We,Be,Oe){return!(!Be||Oe||Le===!1||Le===void 0&&(We===!1||We===null))}function qe(Le,We){var Be=Le.prefixCls,Oe=Le.editable,lt=Le.locale,_t=Le.style;return!Oe||Oe.showAdd===!1?null:Ae.createElement("button",{ref:We,type:"button",className:"".concat(Be,"-nav-add"),style:_t,"aria-label":(lt==null?void 0:lt.addAriaLabel)||"Add tab",onClick:function(Kt){Oe.onEdit("add",{event:Kt})}},Oe.addIcon||"+")}var nt=Ae.forwardRef(qe),Ot=Ae.forwardRef(function(Le,We){var Be=Le.position,Oe=Le.prefixCls,lt=Le.extra;if(!lt)return null;var _t,Yt={};return(0,Re.Z)(lt)==="object"&&!Ae.isValidElement(lt)?Yt=lt:Yt.right=lt,Be==="right"&&(_t=Yt.right),Be==="left"&&(_t=Yt.left),_t?Ae.createElement("div",{className:"".concat(Oe,"-extra-content"),ref:We},_t):null}),dn=Ot,en=ue(31561),on=ue(15285),Xt=ue(10228);function Ut(Le,We){var Be=Le.prefixCls,Oe=Le.id,lt=Le.tabs,_t=Le.locale,Yt=Le.mobile,Kt=Le.moreIcon,Jt=Kt===void 0?"More":Kt,un=Le.moreTransitionName,fn=Le.style,xn=Le.className,zt=Le.editable,ln=Le.tabBarGutter,jn=Le.rtl,Dn=Le.removeAriaLabel,Vn=Le.onTabClick,Pn=Le.getPopupContainer,yr=Le.popupClassName,Sn=(0,Ae.useState)(!1),pr=(0,_e.Z)(Sn,2),ht=pr[0],Ue=pr[1],Xe=(0,Ae.useState)(null),Ze=(0,_e.Z)(Xe,2),gt=Ze[0],Wt=Ze[1],Gt="".concat(Oe,"-more-popup"),nn="".concat(Be,"-dropdown"),Ht=gt!==null?"".concat(Gt,"-").concat(gt):null,bt=_t==null?void 0:_t.dropdownAriaLabel;function Cn(Xn,In){Xn.preventDefault(),Xn.stopPropagation(),zt.onEdit("remove",{key:In,event:Xn})}var kn=Ae.createElement(on.ZP,{onClick:function(In){var zn=In.key,cr=In.domEvent;Vn(zn,cr),Ue(!1)},prefixCls:"".concat(nn,"-menu"),id:Gt,tabIndex:-1,role:"listbox","aria-activedescendant":Ht,selectedKeys:[gt],"aria-label":bt!==void 0?bt:"expanded dropdown"},lt.map(function(Xn){var In=Xn.closable,zn=Xn.disabled,cr=Xn.closeIcon,qn=Xn.key,br=Xn.label,Br=Vt(In,cr,zt,zn);return Ae.createElement(on.sN,{key:qn,id:"".concat(Gt,"-").concat(qn),role:"option","aria-controls":Oe&&"".concat(Oe,"-panel-").concat(qn),disabled:zn},Ae.createElement("span",null,br),Br&&Ae.createElement("button",{type:"button","aria-label":Dn||"remove",tabIndex:0,className:"".concat(nn,"-menu-item-remove"),onClick:function(yn){yn.stopPropagation(),Cn(yn,qn)}},cr||zt.removeIcon||"\xD7"))}));function Jn(Xn){for(var In=lt.filter(function(Br){return!Br.disabled}),zn=In.findIndex(function(Br){return Br.key===gt})||0,cr=In.length,qn=0;qn<cr;qn+=1){zn=(zn+Xn+cr)%cr;var br=In[zn];if(!br.disabled){Wt(br.key);return}}}function Fn(Xn){var In=Xn.which;if(!ht){[Xt.Z.DOWN,Xt.Z.SPACE,Xt.Z.ENTER].includes(In)&&(Ue(!0),Xn.preventDefault());return}switch(In){case Xt.Z.UP:Jn(-1),Xn.preventDefault();break;case Xt.Z.DOWN:Jn(1),Xn.preventDefault();break;case Xt.Z.ESC:Ue(!1);break;case Xt.Z.SPACE:case Xt.Z.ENTER:gt!==null&&Vn(gt,Xn);break}}(0,Ae.useEffect)(function(){var Xn=document.getElementById(Ht);Xn&&Xn.scrollIntoView&&Xn.scrollIntoView(!1)},[gt]),(0,Ae.useEffect)(function(){ht||Wt(null)},[ht]);var Nn=(0,De.Z)({},jn?"marginRight":"marginLeft",ln);lt.length||(Nn.visibility="hidden",Nn.order=1);var _n=xe()((0,De.Z)({},"".concat(nn,"-rtl"),jn)),tr=Yt?null:Ae.createElement(en.Z,{prefixCls:nn,overlay:kn,trigger:["hover"],visible:lt.length?ht:!1,transitionName:un,onVisibleChange:Ue,overlayClassName:xe()(_n,yr),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:Pn},Ae.createElement("button",{type:"button",className:"".concat(Be,"-nav-more"),style:Nn,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":Gt,id:"".concat(Oe,"-more"),"aria-expanded":ht,onKeyDown:Fn},Jt));return Ae.createElement("div",{className:xe()("".concat(Be,"-nav-operations"),xn),style:fn,ref:We},tr,Ae.createElement(nt,{prefixCls:Be,locale:_t,editable:zt}))}var Zt=Ae.memo(Ae.forwardRef(Ut),function(Le,We){return We.tabMoving});function ye(Le){var We,Be=Le.prefixCls,Oe=Le.id,lt=Le.active,_t=Le.tab,Yt=_t.key,Kt=_t.label,Jt=_t.disabled,un=_t.closeIcon,fn=Le.closable,xn=Le.renderWrapper,zt=Le.removeAriaLabel,ln=Le.editable,jn=Le.onClick,Dn=Le.onFocus,Vn=Le.style,Pn="".concat(Be,"-tab"),yr=Vt(fn,un,ln,Jt);function Sn(Ue){Jt||jn(Ue)}function pr(Ue){Ue.preventDefault(),Ue.stopPropagation(),ln.onEdit("remove",{key:Yt,event:Ue})}var ht=Ae.createElement("div",{key:Yt,"data-node-key":Qt(Yt),className:xe()(Pn,(We={},(0,De.Z)(We,"".concat(Pn,"-with-remove"),yr),(0,De.Z)(We,"".concat(Pn,"-active"),lt),(0,De.Z)(We,"".concat(Pn,"-disabled"),Jt),We)),style:Vn,onClick:Sn},Ae.createElement("div",{role:"tab","aria-selected":lt,id:Oe&&"".concat(Oe,"-tab-").concat(Yt),className:"".concat(Pn,"-btn"),"aria-controls":Oe&&"".concat(Oe,"-panel-").concat(Yt),"aria-disabled":Jt,tabIndex:Jt?null:0,onClick:function(Xe){Xe.stopPropagation(),Sn(Xe)},onKeyDown:function(Xe){[Xt.Z.SPACE,Xt.Z.ENTER].includes(Xe.which)&&(Xe.preventDefault(),Sn(Xe))},onFocus:Dn},Kt),yr&&Ae.createElement("button",{type:"button","aria-label":zt||"remove",tabIndex:0,className:"".concat(Pn,"-remove"),onClick:function(Xe){Xe.stopPropagation(),pr(Xe)}},un||ln.removeIcon||"\xD7"));return xn?xn(ht):ht}var le=ye,oe=ue(16089),he=function(We){var Be=We.activeTabOffset,Oe=We.horizontal,lt=We.rtl,_t=We.indicatorSize,Yt=(0,Ae.useState)(),Kt=(0,_e.Z)(Yt,2),Jt=Kt[0],un=Kt[1],fn=(0,Ae.useRef)(),xn=function(jn){return typeof _t=="function"?_t(jn):typeof _t=="number"?_t:jn};function zt(){oe.Z.cancel(fn.current)}return(0,Ae.useEffect)(function(){var ln={};return Be&&(Oe?(lt?(ln.right=Be.right+Be.width/2,ln.transform="translateX(50%)"):(ln.left=Be.left+Be.width/2,ln.transform="translateX(-50%)"),ln.width=xn(Be.width)):(ln.top=Be.top+Be.height/2,ln.transform="translateY(-50%)",ln.height=xn(Be.height))),zt(),fn.current=(0,oe.Z)(function(){un(ln)}),zt},[Be,Oe,lt,_t]),{style:Jt}},pe=he,ce=function(We){var Be=We.current||{},Oe=Be.offsetWidth,lt=Oe===void 0?0:Oe,_t=Be.offsetHeight,Yt=_t===void 0?0:_t;return[lt,Yt]},Ie=function(We,Be){return We[Be?0:1]};function yt(Le,We){var Be,Oe=Ae.useContext(ot),lt=Oe.prefixCls,_t=Oe.tabs,Yt=Le.className,Kt=Le.style,Jt=Le.id,un=Le.animated,fn=Le.activeKey,xn=Le.rtl,zt=Le.extra,ln=Le.editable,jn=Le.locale,Dn=Le.tabPosition,Vn=Le.tabBarGutter,Pn=Le.children,yr=Le.onTabClick,Sn=Le.onTabScroll,pr=Le.indicatorSize,ht=(0,Ae.useRef)(),Ue=(0,Ae.useRef)(),Xe=(0,Ae.useRef)(),Ze=(0,Ae.useRef)(),gt=(0,Ae.useRef)(),Wt=(0,Ae.useRef)(),Gt=(0,Ae.useRef)(),nn=Dn==="top"||Dn==="bottom",Ht=et(0,function(hi,ui){nn&&Sn&&Sn({direction:hi>ui?"left":"right"})}),bt=(0,_e.Z)(Ht,2),Cn=bt[0],kn=bt[1],Jn=et(0,function(hi,ui){!nn&&Sn&&Sn({direction:hi>ui?"top":"bottom"})}),Fn=(0,_e.Z)(Jn,2),Nn=Fn[0],_n=Fn[1],tr=(0,Ae.useState)([0,0]),Xn=(0,_e.Z)(tr,2),In=Xn[0],zn=Xn[1],cr=(0,Ae.useState)([0,0]),qn=(0,_e.Z)(cr,2),br=qn[0],Br=qn[1],rr=(0,Ae.useState)([0,0]),yn=(0,_e.Z)(rr,2),hn=yn[0],En=yn[1],Qn=(0,Ae.useState)([0,0]),Rn=(0,_e.Z)(Qn,2),Mn=Rn[0],er=Rn[1],vr=Tt(new Map),Dr=(0,_e.Z)(vr,2),ei=Dr[0],$n=Dr[1],Kn=Lt(_t,ei,br[0]),Gn=Ie(In,nn),sr=Ie(br,nn),Wr=Ie(hn,nn),vi=Ie(Mn,nn),ci=Gn<sr+Wr,qr=ci?Gn-vi:Gn-Wr,fi="".concat(lt,"-nav-operations-hidden"),mi=0,lr=0;nn&&xn?(mi=0,lr=Math.max(0,sr-qr)):(mi=Math.min(0,qr-sr),lr=0);function or(hi){return hi<mi?mi:hi>lr?lr:hi}var ir=(0,Ae.useRef)(),mr=(0,Ae.useState)(),ri=(0,_e.Z)(mr,2),pi=ri[0],yi=ri[1];function gi(){yi(Date.now())}function si(){window.clearTimeout(ir.current)}$t(Ze,function(hi,ui){function Zi(ai,Mi){ai(function(Ti){var Mo=or(Ti+Mi);return Mo})}return ci?(nn?Zi(kn,hi):Zi(_n,ui),si(),gi(),!0):!1}),(0,Ae.useEffect)(function(){return si(),pi&&(ir.current=window.setTimeout(function(){yi(0)},100)),si},[pi]);var wi=Ne(Kn,qr,nn?Cn:Nn,sr,Wr,vi,(0,we.Z)((0,we.Z)({},Le),{},{tabs:_t})),Hi=(0,_e.Z)(wi,2),Di=Hi[0],aa=Hi[1],Ui=(0,Ee.Z)(function(){var hi=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fn,ui=Kn.get(hi)||{width:0,height:0,left:0,right:0,top:0};if(nn){var Zi=Cn;xn?ui.right<Cn?Zi=ui.right:ui.right+ui.width>Cn+qr&&(Zi=ui.right+ui.width-qr):ui.left<-Cn?Zi=-ui.left:ui.left+ui.width>-Cn+qr&&(Zi=-(ui.left+ui.width-qr)),_n(0),kn(or(Zi))}else{var ai=Nn;ui.top<-Nn?ai=-ui.top:ui.top+ui.height>-Nn+qr&&(ai=-(ui.top+ui.height-qr)),kn(0),_n(or(ai))}}),Pi={};Dn==="top"||Dn==="bottom"?Pi[xn?"marginRight":"marginLeft"]=Vn:Pi.marginTop=Vn;var Pa=_t.map(function(hi,ui){var Zi=hi.key;return Ae.createElement(le,{id:Jt,prefixCls:lt,key:Zi,tab:hi,style:ui===0?void 0:Pi,closable:hi.closable,editable:ln,active:Zi===fn,renderWrapper:Pn,removeAriaLabel:jn==null?void 0:jn.removeAriaLabel,onClick:function(Mi){yr(Zi,Mi)},onFocus:function(){Ui(Zi),gi(),Ze.current&&(xn||(Ze.current.scrollLeft=0),Ze.current.scrollTop=0)}})}),da=function(){return $n(function(){var ui=new Map;return _t.forEach(function(Zi){var ai,Mi=Zi.key,Ti=(ai=gt.current)===null||ai===void 0?void 0:ai.querySelector('[data-node-key="'.concat(Qt(Mi),'"]'));Ti&&ui.set(Mi,{width:Ti.offsetWidth,height:Ti.offsetHeight,left:Ti.offsetLeft,top:Ti.offsetTop})}),ui})};(0,Ae.useEffect)(function(){da()},[_t.map(function(hi){return hi.key}).join("_")]);var oa=Bt(function(){var hi=ce(ht),ui=ce(Ue),Zi=ce(Xe);zn([hi[0]-ui[0]-Zi[0],hi[1]-ui[1]-Zi[1]]);var ai=ce(Gt);En(ai);var Mi=ce(Wt);er(Mi);var Ti=ce(gt);Br([Ti[0]-ai[0],Ti[1]-ai[1]]),da()}),Xi=_t.slice(0,Di),Si=_t.slice(aa+1),Tr=[].concat((0,vt.Z)(Xi),(0,vt.Z)(Si)),ti=Kn.get(fn),Hr=pe({activeTabOffset:ti,horizontal:nn,rtl:xn,indicatorSize:pr}),Ir=Hr.style;(0,Ae.useEffect)(function(){Ui()},[fn,mi,lr,be(ti),be(Kn),nn]),(0,Ae.useEffect)(function(){oa()},[xn]);var ni=!!Tr.length,ii="".concat(lt,"-nav-wrap"),Bi,Oi,Fi,zi;return nn?xn?(Oi=Cn>0,Bi=Cn!==lr):(Bi=Cn<0,Oi=Cn!==mi):(Fi=Nn<0,zi=Nn!==mi),Ae.createElement($e.Z,{onResize:oa},Ae.createElement("div",{ref:(0,Ve.x1)(We,ht),role:"tablist",className:xe()("".concat(lt,"-nav"),Yt),style:Kt,onKeyDown:function(){gi()}},Ae.createElement(dn,{ref:Ue,position:"left",extra:zt,prefixCls:lt}),Ae.createElement($e.Z,{onResize:oa},Ae.createElement("div",{className:xe()(ii,(Be={},(0,De.Z)(Be,"".concat(ii,"-ping-left"),Bi),(0,De.Z)(Be,"".concat(ii,"-ping-right"),Oi),(0,De.Z)(Be,"".concat(ii,"-ping-top"),Fi),(0,De.Z)(Be,"".concat(ii,"-ping-bottom"),zi),Be)),ref:Ze},Ae.createElement($e.Z,{onResize:oa},Ae.createElement("div",{ref:gt,className:"".concat(lt,"-nav-list"),style:{transform:"translate(".concat(Cn,"px, ").concat(Nn,"px)"),transition:pi?"none":void 0}},Pa,Ae.createElement(nt,{ref:Gt,prefixCls:lt,locale:jn,editable:ln,style:(0,we.Z)((0,we.Z)({},Pa.length===0?void 0:Pi),{},{visibility:ni?"hidden":null})}),Ae.createElement("div",{className:xe()("".concat(lt,"-ink-bar"),(0,De.Z)({},"".concat(lt,"-ink-bar-animated"),un.inkBar)),style:Ir}))))),Ae.createElement(Zt,(0,Me.Z)({},Le,{removeAriaLabel:jn==null?void 0:jn.removeAriaLabel,ref:Wt,prefixCls:lt,tabs:Tr,className:!ni&&fi,tabMoving:!!pi})),Ae.createElement(dn,{ref:Xe,position:"right",extra:zt,prefixCls:lt})))}var Pe=Ae.forwardRef(yt),je=["renderTabBar"],Rt=["label","key"];function At(Le){var We=Le.renderTabBar,Be=(0,dt.Z)(Le,je),Oe=Ae.useContext(ot),lt=Oe.tabs;if(We){var _t=(0,we.Z)((0,we.Z)({},Be),{},{panes:lt.map(function(Yt){var Kt=Yt.label,Jt=Yt.key,un=(0,dt.Z)(Yt,Rt);return Ae.createElement(Ct,(0,Me.Z)({tab:Kt,key:Jt,tabKey:Jt},un))})});return We(_t,Pe)}return Ae.createElement(Pe,Be)}var rt=ue(48736);function Ft(){var Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},We;return Le===!1?We={inkBar:!1,tabPane:!1}:Le===!0?We={inkBar:!0,tabPane:!1}:We=(0,we.Z)({inkBar:!0},(0,Re.Z)(Le)==="object"?Le:{}),We.tabPaneMotion&&We.tabPane===void 0&&(We.tabPane=!0),!We.tabPaneMotion&&We.tabPane&&(We.tabPane=!1),We}var sn=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicatorSize"],ct=0;function qt(Le,We){var Be,Oe=Le.id,lt=Le.prefixCls,_t=lt===void 0?"rc-tabs":lt,Yt=Le.className,Kt=Le.items,Jt=Le.direction,un=Le.activeKey,fn=Le.defaultActiveKey,xn=Le.editable,zt=Le.animated,ln=Le.tabPosition,jn=ln===void 0?"top":ln,Dn=Le.tabBarGutter,Vn=Le.tabBarStyle,Pn=Le.tabBarExtraContent,yr=Le.locale,Sn=Le.moreIcon,pr=Le.moreTransitionName,ht=Le.destroyInactiveTabPane,Ue=Le.renderTabBar,Xe=Le.onChange,Ze=Le.onTabClick,gt=Le.onTabScroll,Wt=Le.getPopupContainer,Gt=Le.popupClassName,nn=Le.indicatorSize,Ht=(0,dt.Z)(Le,sn),bt=Ae.useMemo(function(){return(Kt||[]).filter(function(er){return er&&(0,Re.Z)(er)==="object"&&"key"in er})},[Kt]),Cn=Jt==="rtl",kn=Ft(zt),Jn=(0,Ae.useState)(!1),Fn=(0,_e.Z)(Jn,2),Nn=Fn[0],_n=Fn[1];(0,Ae.useEffect)(function(){_n((0,Fe.Z)())},[]);var tr=(0,ft.Z)(function(){var er;return(er=bt[0])===null||er===void 0?void 0:er.key},{value:un,defaultValue:fn}),Xn=(0,_e.Z)(tr,2),In=Xn[0],zn=Xn[1],cr=(0,Ae.useState)(function(){return bt.findIndex(function(er){return er.key===In})}),qn=(0,_e.Z)(cr,2),br=qn[0],Br=qn[1];(0,Ae.useEffect)(function(){var er=bt.findIndex(function(Dr){return Dr.key===In});if(er===-1){var vr;er=Math.max(0,Math.min(br,bt.length-1)),zn((vr=bt[er])===null||vr===void 0?void 0:vr.key)}Br(er)},[bt.map(function(er){return er.key}).join("_"),In,br]);var rr=(0,ft.Z)(null,{value:Oe}),yn=(0,_e.Z)(rr,2),hn=yn[0],En=yn[1];(0,Ae.useEffect)(function(){Oe||(En("rc-tabs-".concat(ct)),ct+=1)},[]);function Qn(er,vr){Ze==null||Ze(er,vr);var Dr=er!==In;zn(er),Dr&&(Xe==null||Xe(er))}var Rn={id:hn,activeKey:In,animated:kn,tabPosition:jn,rtl:Cn,mobile:Nn},Mn=(0,we.Z)((0,we.Z)({},Rn),{},{editable:xn,locale:yr,moreIcon:Sn,moreTransitionName:pr,tabBarGutter:Dn,onTabClick:Qn,onTabScroll:gt,extra:Pn,style:Vn,panes:null,getPopupContainer:Wt,popupClassName:Gt,indicatorSize:nn});return Ae.createElement(ot.Provider,{value:{tabs:bt,prefixCls:_t}},Ae.createElement("div",(0,Me.Z)({ref:We,id:Oe,className:xe()(_t,"".concat(_t,"-").concat(jn),(Be={},(0,De.Z)(Be,"".concat(_t,"-mobile"),Nn),(0,De.Z)(Be,"".concat(_t,"-editable"),xn),(0,De.Z)(Be,"".concat(_t,"-rtl"),Cn),Be),Yt)},Ht),Ae.createElement(At,(0,Me.Z)({},Mn,{renderTabBar:Ue})),Ae.createElement(it,(0,Me.Z)({destroyInactiveTabPane:ht},Rn,{animated:kn}))))}var an=Ae.forwardRef(qt),Qe=an,mt=Qe,Nt=ue(36355),vn=ue(19716),wn=()=>null,Tn=ue(62892);const Zn={motionAppear:!1,motionEnter:!0,motionLeave:!0};function Hn(Le){let We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},Be;return We===!1?Be={inkBar:!1,tabPane:!1}:We===!0?Be={inkBar:!0,tabPane:!0}:Be=Object.assign({inkBar:!0},typeof We=="object"?We:{}),Be.tabPane&&(Be.tabPaneMotion=Object.assign(Object.assign({},Zn),{motionName:(0,Tn.m)(Le,"switch")})),Be}var wr=ue(11592),Cr=function(Le,We){var Be={};for(var Oe in Le)Object.prototype.hasOwnProperty.call(Le,Oe)&&We.indexOf(Oe)<0&&(Be[Oe]=Le[Oe]);if(Le!=null&&typeof Object.getOwnPropertySymbols=="function")for(var lt=0,Oe=Object.getOwnPropertySymbols(Le);lt<Oe.length;lt++)We.indexOf(Oe[lt])<0&&Object.prototype.propertyIsEnumerable.call(Le,Oe[lt])&&(Be[Oe[lt]]=Le[Oe[lt]]);return Be};function Yn(Le){return Le.filter(We=>We)}function Nr(Le,We){if(Le)return Le;const Be=(0,wr.Z)(We).map(Oe=>{if(Ae.isValidElement(Oe)){const{key:lt,props:_t}=Oe,Yt=_t||{},{tab:Kt}=Yt,Jt=Cr(Yt,["tab"]);return Object.assign(Object.assign({key:String(lt)},Jt),{label:Kt})}return null});return Yn(Be)}var Kr=ue(17313),Or=ue(83116),Ar=ue(37613),kr=ue(13826),ar=Le=>{const{componentCls:We,motionDurationSlow:Be}=Le;return[{[We]:{[`${We}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${Be}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${Be}`}}}}},[(0,kr.oN)(Le,"slide-up"),(0,kr.oN)(Le,"slide-down")]]};const $r=Le=>{const{componentCls:We,tabsCardPadding:Be,cardBg:Oe,cardGutter:lt,colorBorderSecondary:_t,itemSelectedColor:Yt}=Le;return{[`${We}-card`]:{[`> ${We}-nav, > div > ${We}-nav`]:{[`${We}-tab`]:{margin:0,padding:Be,background:Oe,border:`${Le.lineWidth}px ${Le.lineType} ${_t}`,transition:`all ${Le.motionDurationSlow} ${Le.motionEaseInOut}`},[`${We}-tab-active`]:{color:Yt,background:Le.colorBgContainer},[`${We}-ink-bar`]:{visibility:"hidden"}},[`&${We}-top, &${We}-bottom`]:{[`> ${We}-nav, > div > ${We}-nav`]:{[`${We}-tab + ${We}-tab`]:{marginLeft:{_skip_check_:!0,value:`${lt}px`}}}},[`&${We}-top`]:{[`> ${We}-nav, > div > ${We}-nav`]:{[`${We}-tab`]:{borderRadius:`${Le.borderRadiusLG}px ${Le.borderRadiusLG}px 0 0`},[`${We}-tab-active`]:{borderBottomColor:Le.colorBgContainer}}},[`&${We}-bottom`]:{[`> ${We}-nav, > div > ${We}-nav`]:{[`${We}-tab`]:{borderRadius:`0 0 ${Le.borderRadiusLG}px ${Le.borderRadiusLG}px`},[`${We}-tab-active`]:{borderTopColor:Le.colorBgContainer}}},[`&${We}-left, &${We}-right`]:{[`> ${We}-nav, > div > ${We}-nav`]:{[`${We}-tab + ${We}-tab`]:{marginTop:`${lt}px`}}},[`&${We}-left`]:{[`> ${We}-nav, > div > ${We}-nav`]:{[`${We}-tab`]:{borderRadius:{_skip_check_:!0,value:`${Le.borderRadiusLG}px 0 0 ${Le.borderRadiusLG}px`}},[`${We}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:Le.colorBgContainer}}}},[`&${We}-right`]:{[`> ${We}-nav, > div > ${We}-nav`]:{[`${We}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${Le.borderRadiusLG}px ${Le.borderRadiusLG}px 0`}},[`${We}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:Le.colorBgContainer}}}}}}},Ur=Le=>{const{componentCls:We,itemHoverColor:Be,dropdownEdgeChildVerticalPadding:Oe}=Le;return{[`${We}-dropdown`]:Object.assign(Object.assign({},(0,Kr.Wf)(Le)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:Le.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${We}-dropdown-menu`]:{maxHeight:Le.tabsDropdownHeight,margin:0,padding:`${Oe}px 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:Le.colorBgContainer,backgroundClip:"padding-box",borderRadius:Le.borderRadiusLG,outline:"none",boxShadow:Le.boxShadowSecondary,"&-item":Object.assign(Object.assign({},Kr.vS),{display:"flex",alignItems:"center",minWidth:Le.tabsDropdownWidth,margin:0,padding:`${Le.paddingXXS}px ${Le.paddingSM}px`,color:Le.colorText,fontWeight:"normal",fontSize:Le.fontSize,lineHeight:Le.lineHeight,cursor:"pointer",transition:`all ${Le.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:Le.marginSM},color:Le.colorTextDescription,fontSize:Le.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:Be}},"&:hover":{background:Le.controlItemBgHover},"&-disabled":{"&, &:hover":{color:Le.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},Vr=Le=>{const{componentCls:We,margin:Be,colorBorderSecondary:Oe,horizontalMargin:lt,verticalItemPadding:_t,verticalItemMargin:Yt}=Le;return{[`${We}-top, ${We}-bottom`]:{flexDirection:"column",[`> ${We}-nav, > div > ${We}-nav`]:{margin:lt,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${Le.lineWidth}px ${Le.lineType} ${Oe}`,content:"''"},[`${We}-ink-bar`]:{height:Le.lineWidthBold,"&-animated":{transition:`width ${Le.motionDurationSlow}, left ${Le.motionDurationSlow},
right ${Le.motionDurationSlow}`}},[`${We}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:Le.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:Le.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:Le.boxShadowTabsOverflowRight},[`&${We}-nav-wrap-ping-left::before`]:{opacity:1},[`&${We}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${We}-top`]:{[`> ${We}-nav,
> div > ${We}-nav`]:{"&::before":{bottom:0},[`${We}-ink-bar`]:{bottom:0}}},[`${We}-bottom`]:{[`> ${We}-nav, > div > ${We}-nav`]:{order:1,marginTop:`${Be}px`,marginBottom:0,"&::before":{top:0},[`${We}-ink-bar`]:{top:0}},[`> ${We}-content-holder, > div > ${We}-content-holder`]:{order:0}},[`${We}-left, ${We}-right`]:{[`> ${We}-nav, > div > ${We}-nav`]:{flexDirection:"column",minWidth:Le.controlHeight*1.25,[`${We}-tab`]:{padding:_t,textAlign:"center"},[`${We}-tab + ${We}-tab`]:{margin:Yt},[`${We}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:Le.controlHeight},"&::before":{top:0,boxShadow:Le.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:Le.boxShadowTabsOverflowBottom},[`&${We}-nav-wrap-ping-top::before`]:{opacity:1},[`&${We}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${We}-ink-bar`]:{width:Le.lineWidthBold,"&-animated":{transition:`height ${Le.motionDurationSlow}, top ${Le.motionDurationSlow}`}},[`${We}-nav-list, ${We}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${We}-left`]:{[`> ${We}-nav, > div > ${We}-nav`]:{[`${We}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${We}-content-holder, > div > ${We}-content-holder`]:{marginLeft:{_skip_check_:!0,value:`-${Le.lineWidth}px`},borderLeft:{_skip_check_:!0,value:`${Le.lineWidth}px ${Le.lineType} ${Le.colorBorder}`},[`> ${We}-content > ${We}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:Le.paddingLG}}}},[`${We}-right`]:{[`> ${We}-nav, > div > ${We}-nav`]:{order:1,[`${We}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${We}-content-holder, > div > ${We}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:-Le.lineWidth},borderRight:{_skip_check_:!0,value:`${Le.lineWidth}px ${Le.lineType} ${Le.colorBorder}`},[`> ${We}-content > ${We}-tabpane`]:{paddingRight:{_skip_check_:!0,value:Le.paddingLG}}}}}},Yr=Le=>{const{componentCls:We,cardPaddingSM:Be,cardPaddingLG:Oe,horizontalItemPaddingSM:lt,horizontalItemPaddingLG:_t}=Le;return{[We]:{"&-small":{[`> ${We}-nav`]:{[`${We}-tab`]:{padding:lt,fontSize:Le.titleFontSizeSM}}},"&-large":{[`> ${We}-nav`]:{[`${We}-tab`]:{padding:_t,fontSize:Le.titleFontSizeLG}}}},[`${We}-card`]:{[`&${We}-small`]:{[`> ${We}-nav`]:{[`${We}-tab`]:{padding:Be}},[`&${We}-bottom`]:{[`> ${We}-nav ${We}-tab`]:{borderRadius:`0 0 ${Le.borderRadius}px ${Le.borderRadius}px`}},[`&${We}-top`]:{[`> ${We}-nav ${We}-tab`]:{borderRadius:`${Le.borderRadius}px ${Le.borderRadius}px 0 0`}},[`&${We}-right`]:{[`> ${We}-nav ${We}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${Le.borderRadius}px ${Le.borderRadius}px 0`}}},[`&${We}-left`]:{[`> ${We}-nav ${We}-tab`]:{borderRadius:{_skip_check_:!0,value:`${Le.borderRadius}px 0 0 ${Le.borderRadius}px`}}}},[`&${We}-large`]:{[`> ${We}-nav`]:{[`${We}-tab`]:{padding:Oe}}}}}},Zr=Le=>{const{componentCls:We,itemActiveColor:Be,itemHoverColor:Oe,iconCls:lt,tabsHorizontalItemMargin:_t,horizontalItemPadding:Yt,itemSelectedColor:Kt,itemColor:Jt}=Le,un=`${We}-tab`;return{[un]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:Yt,fontSize:Le.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:Jt,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:Be}},(0,Kr.Qy)(Le)),"&-btn":{outline:"none",transition:"all 0.3s"},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:-Le.marginXXS},marginLeft:{_skip_check_:!0,value:Le.marginXS},color:Le.colorTextDescription,fontSize:Le.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${Le.motionDurationSlow}`,"&:hover":{color:Le.colorTextHeading}},"&:hover":{color:Oe},[`&${un}-active ${un}-btn`]:{color:Kt,textShadow:Le.tabsActiveTextShadow},[`&${un}-disabled`]:{color:Le.colorTextDisabled,cursor:"not-allowed"},[`&${un}-disabled ${un}-btn, &${un}-disabled ${We}-remove`]:{"&:focus, &:active":{color:Le.colorTextDisabled}},[`& ${un}-remove ${lt}`]:{margin:0},[lt]:{marginRight:{_skip_check_:!0,value:Le.marginSM}}},[`${un} + ${un}`]:{margin:{_skip_check_:!0,value:_t}}}},dr=Le=>{const{componentCls:We,tabsHorizontalItemMarginRTL:Be,iconCls:Oe,cardGutter:lt}=Le;return{[`${We}-rtl`]:{direction:"rtl",[`${We}-nav`]:{[`${We}-tab`]:{margin:{_skip_check_:!0,value:Be},[`${We}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[Oe]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:`${Le.marginSM}px`}},[`${We}-tab-remove`]:{marginRight:{_skip_check_:!0,value:`${Le.marginXS}px`},marginLeft:{_skip_check_:!0,value:`-${Le.marginXXS}px`},[Oe]:{margin:0}}}},[`&${We}-left`]:{[`> ${We}-nav`]:{order:1},[`> ${We}-content-holder`]:{order:0}},[`&${We}-right`]:{[`> ${We}-nav`]:{order:0},[`> ${We}-content-holder`]:{order:1}},[`&${We}-card${We}-top, &${We}-card${We}-bottom`]:{[`> ${We}-nav, > div > ${We}-nav`]:{[`${We}-tab + ${We}-tab`]:{marginRight:{_skip_check_:!0,value:lt},marginLeft:{_skip_check_:!0,value:0}}}}},[`${We}-dropdown-rtl`]:{direction:"rtl"},[`${We}-menu-item`]:{[`${We}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},_r=Le=>{const{componentCls:We,tabsCardPadding:Be,cardHeight:Oe,cardGutter:lt,itemHoverColor:_t,itemActiveColor:Yt,colorBorderSecondary:Kt}=Le;return{[We]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,Kr.Wf)(Le)),{display:"flex",[`> ${We}-nav, > div > ${We}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${We}-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 ${Le.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${We}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${Le.motionDurationSlow}`},[`${We}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${We}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${We}-nav-more`]:{position:"relative",padding:Be,background:"transparent",border:0,color:Le.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:Le.controlHeightLG/8,transform:"translateY(100%)",content:"''"}},[`${We}-nav-add`]:Object.assign({minWidth:Oe,marginLeft:{_skip_check_:!0,value:lt},padding:`0 ${Le.paddingXS}px`,background:"transparent",border:`${Le.lineWidth}px ${Le.lineType} ${Kt}`,borderRadius:`${Le.borderRadiusLG}px ${Le.borderRadiusLG}px 0 0`,outline:"none",cursor:"pointer",color:Le.colorText,transition:`all ${Le.motionDurationSlow} ${Le.motionEaseInOut}`,"&:hover":{color:_t},"&:active, &:focus:not(:focus-visible)":{color:Yt}},(0,Kr.Qy)(Le))},[`${We}-extra-content`]:{flex:"none"},[`${We}-ink-bar`]:{position:"absolute",background:Le.inkBarColor,pointerEvents:"none"}}),Zr(Le)),{[`${We}-content`]:{position:"relative",width:"100%"},[`${We}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${We}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${We}-centered`]:{[`> ${We}-nav, > div > ${We}-nav`]:{[`${We}-nav-wrap`]:{[`&:not([class*='${We}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}};var Ln=(0,Or.Z)("Tabs",Le=>{const We=(0,Ar.TS)(Le,{tabsCardPadding:Le.cardPadding||`${(Le.cardHeight-Math.round(Le.fontSize*Le.lineHeight))/2-Le.lineWidth}px ${Le.padding}px`,dropdownEdgeChildVerticalPadding:Le.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${Le.horizontalItemGutter}px`,tabsHorizontalItemMarginRTL:`0 0 0 ${Le.horizontalItemGutter}px`});return[Yr(We),dr(We),Vr(We),Ur(We),$r(We),_r(We),ar(We)]},Le=>{const We=Le.controlHeightLG;return{zIndexPopup:Le.zIndexPopupBase+50,cardBg:Le.colorFillAlter,cardHeight:We,cardPadding:"",cardPaddingSM:`${Le.paddingXXS*1.5}px ${Le.padding}px`,cardPaddingLG:`${Le.paddingXS}px ${Le.padding}px ${Le.paddingXXS*1.5}px`,titleFontSize:Le.fontSize,titleFontSizeLG:Le.fontSizeLG,titleFontSizeSM:Le.fontSize,inkBarColor:Le.colorPrimary,horizontalMargin:`0 0 ${Le.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${Le.paddingSM}px 0`,horizontalItemPaddingSM:`${Le.paddingXS}px 0`,horizontalItemPaddingLG:`${Le.padding}px 0`,verticalItemPadding:`${Le.paddingXS}px ${Le.paddingLG}px`,verticalItemMargin:`${Le.margin}px 0 0 0`,itemColor:Le.colorText,itemSelectedColor:Le.colorPrimary,itemHoverColor:Le.colorPrimaryHover,itemActiveColor:Le.colorPrimaryActive,cardGutter:Le.marginXXS/2}}),Wn=function(Le,We){var Be={};for(var Oe in Le)Object.prototype.hasOwnProperty.call(Le,Oe)&&We.indexOf(Oe)<0&&(Be[Oe]=Le[Oe]);if(Le!=null&&typeof Object.getOwnPropertySymbols=="function")for(var lt=0,Oe=Object.getOwnPropertySymbols(Le);lt<Oe.length;lt++)We.indexOf(Oe[lt])<0&&Object.prototype.propertyIsEnumerable.call(Le,Oe[lt])&&(Be[Oe[lt]]=Le[Oe[lt]]);return Be};const Er=Le=>{const{type:We,className:Be,rootClassName:Oe,size:lt,onEdit:_t,hideAdd:Yt,centered:Kt,addIcon:Jt,popupClassName:un,children:fn,items:xn,animated:zt,style:ln,indicatorSize:jn}=Le,Dn=Wn(Le,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize"]),{prefixCls:Vn,moreIcon:Pn=Ae.createElement(Te.Z,null)}=Dn,{direction:yr,tabs:Sn,getPrefixCls:pr,getPopupContainer:ht}=Ae.useContext(Nt.E_),Ue=pr("tabs",Vn),[Xe,Ze]=Ln(Ue);let gt;We==="editable-card"&&(gt={onEdit:(Cn,kn)=>{let{key:Jn,event:Fn}=kn;_t==null||_t(Cn==="add"?Fn:Jn,Cn)},removeIcon:Ae.createElement(se.Z,null),addIcon:Jt||Ae.createElement(ze.Z,null),showAdd:Yt!==!0});const Wt=pr(),Gt=Nr(xn,fn),nn=Hn(Ue,zt),Ht=(0,vn.Z)(lt),bt=Object.assign(Object.assign({},Sn==null?void 0:Sn.style),ln);return Xe(Ae.createElement(mt,Object.assign({direction:yr,getPopupContainer:ht,moreTransitionName:`${Wt}-slide-up`},Dn,{items:Gt,className:xe()({[`${Ue}-${Ht}`]:Ht,[`${Ue}-card`]:["card","editable-card"].includes(We),[`${Ue}-editable-card`]:We==="editable-card",[`${Ue}-centered`]:Kt},Sn==null?void 0:Sn.className,Be,Oe,Ze),popupClassName:xe()(un,Ze),style:bt,editable:gt,moreIcon:Pn,prefixCls:Ue,animated:nn,indicatorSize:jn!=null?jn:Sn==null?void 0:Sn.indicatorSize})))};Er.TabPane=wn;var St=Er},12563:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return Dt}});var se=ue(59301),Te=ue(99267),ze=ue(92310),ut=ue.n(ze),xe=ue(36785),Me=ue(47729),De=ue(14088),we=ue(36355),_e=ue(17313),Re=ue(37613),dt=ue(83116);const Ae=Ge=>{const{paddingXXS:kt,lineWidth:tt,tagPaddingHorizontal:$t,componentCls:pt}=Ge,Bt=$t-tt,Tt=kt-tt;return{[pt]:Object.assign(Object.assign({},(0,_e.Wf)(Ge)),{display:"inline-block",height:"auto",marginInlineEnd:Ge.marginXS,paddingInline:Bt,fontSize:Ge.tagFontSize,lineHeight:Ge.tagLineHeight,whiteSpace:"nowrap",background:Ge.defaultBg,border:`${Ge.lineWidth}px ${Ge.lineType} ${Ge.colorBorder}`,borderRadius:Ge.borderRadiusSM,opacity:1,transition:`all ${Ge.motionDurationMid}`,textAlign:"start",position:"relative",[`&${pt}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:Ge.defaultColor},[`${pt}-close-icon`]:{marginInlineStart:Tt,color:Ge.colorTextDescription,fontSize:Ge.tagIconSize,cursor:"pointer",transition:`all ${Ge.motionDurationMid}`,"&:hover":{color:Ge.colorTextHeading}},[`&${pt}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${Ge.iconCls}-close, ${Ge.iconCls}-close:hover`]:{color:Ge.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${pt}-checkable-checked):hover`]:{color:Ge.colorPrimary,backgroundColor:Ge.colorFillSecondary},"&:active, &-checked":{color:Ge.colorTextLightSolid},"&-checked":{backgroundColor:Ge.colorPrimary,"&:hover":{backgroundColor:Ge.colorPrimaryHover}},"&:active":{backgroundColor:Ge.colorPrimaryActive}},"&-hidden":{display:"none"},[`> ${Ge.iconCls} + span, > span + ${Ge.iconCls}`]:{marginInlineStart:Bt}}),[`${pt}-borderless`]:{borderColor:"transparent",background:Ge.tagBorderlessBg}}},Fe=Ge=>{const{lineWidth:kt,fontSizeIcon:tt}=Ge,$t=Ge.fontSizeSM,pt=`${Ge.lineHeightSM*$t}px`;return(0,Re.TS)(Ge,{tagFontSize:$t,tagLineHeight:pt,tagIconSize:tt-2*kt,tagPaddingHorizontal:8,tagBorderlessBg:Ge.colorFillTertiary})},ft=Ge=>({defaultBg:Ge.colorFillQuaternary,defaultColor:Ge.colorText});var Ye=(0,dt.Z)("Tag",Ge=>{const kt=Fe(Ge);return Ae(kt)},ft),ot=function(Ge,kt){var tt={};for(var $t in Ge)Object.prototype.hasOwnProperty.call(Ge,$t)&&kt.indexOf($t)<0&&(tt[$t]=Ge[$t]);if(Ge!=null&&typeof Object.getOwnPropertySymbols=="function")for(var pt=0,$t=Object.getOwnPropertySymbols(Ge);pt<$t.length;pt++)kt.indexOf($t[pt])<0&&Object.prototype.propertyIsEnumerable.call(Ge,$t[pt])&&(tt[$t[pt]]=Ge[$t[pt]]);return tt},Ct=Ge=>{const{prefixCls:kt,style:tt,className:$t,checked:pt,onChange:Bt,onClick:Tt}=Ge,wt=ot(Ge,["prefixCls","style","className","checked","onChange","onClick"]),{getPrefixCls:Ne,tag:be}=se.useContext(we.E_),xt=Ot=>{Bt==null||Bt(!pt),Tt==null||Tt(Ot)},Qt=Ne("tag",kt),[Vt,qe]=Ye(Qt),nt=ut()(Qt,`${Qt}-checkable`,{[`${Qt}-checkable-checked`]:pt},be==null?void 0:be.className,$t,qe);return Vt(se.createElement("span",Object.assign({},wt,{style:Object.assign(Object.assign({},tt),be==null?void 0:be.style),className:nt,onClick:xt})))},jt=ue(45157);const it=Ge=>(0,jt.Z)(Ge,(kt,tt)=>{let{textColor:$t,lightBorderColor:pt,lightColor:Bt,darkColor:Tt}=tt;return{[`${Ge.componentCls}-${kt}`]:{color:$t,background:Bt,borderColor:pt,"&-inverse":{color:Ge.colorTextLightSolid,background:Tt,borderColor:Tt},[`&${Ge.componentCls}-borderless`]:{borderColor:"transparent"}}}});var vt=(0,dt.b)(["Tag","preset"],Ge=>{const kt=Fe(Ge);return it(kt)},ft);function $e(Ge){return typeof Ge!="string"?Ge:Ge.charAt(0).toUpperCase()+Ge.slice(1)}const Ee=(Ge,kt,tt)=>{const $t=$e(tt);return{[`${Ge.componentCls}-${kt}`]:{color:Ge[`color${tt}`],background:Ge[`color${$t}Bg`],borderColor:Ge[`color${$t}Border`],[`&${Ge.componentCls}-borderless`]:{borderColor:"transparent"}}}};var Ve=(0,dt.b)(["Tag","status"],Ge=>{const kt=Fe(Ge);return[Ee(kt,"success","Success"),Ee(kt,"processing","Info"),Ee(kt,"error","Error"),Ee(kt,"warning","Warning")]},ft),Je=function(Ge,kt){var tt={};for(var $t in Ge)Object.prototype.hasOwnProperty.call(Ge,$t)&&kt.indexOf($t)<0&&(tt[$t]=Ge[$t]);if(Ge!=null&&typeof Object.getOwnPropertySymbols=="function")for(var pt=0,$t=Object.getOwnPropertySymbols(Ge);pt<$t.length;pt++)kt.indexOf($t[pt])<0&&Object.prototype.propertyIsEnumerable.call(Ge,$t[pt])&&(tt[$t[pt]]=Ge[$t[pt]]);return tt};const Lt=(Ge,kt)=>{const{prefixCls:tt,className:$t,rootClassName:pt,style:Bt,children:Tt,icon:wt,color:Ne,onClose:be,closeIcon:xt,closable:Qt,bordered:Vt=!0}=Ge,qe=Je(Ge,["prefixCls","className","rootClassName","style","children","icon","color","onClose","closeIcon","closable","bordered"]),{getPrefixCls:nt,direction:Ot,tag:dn}=se.useContext(we.E_),[en,on]=se.useState(!0);se.useEffect(()=>{"visible"in qe&&on(qe.visible)},[qe.visible]);const Xt=(0,xe.o2)(Ne),Ut=(0,xe.yT)(Ne),Zt=Xt||Ut,ye=Object.assign(Object.assign({backgroundColor:Ne&&!Zt?Ne:void 0},dn==null?void 0:dn.style),Bt),le=nt("tag",tt),[oe,he]=Ye(le),pe=ut()(le,dn==null?void 0:dn.className,{[`${le}-${Ne}`]:Zt,[`${le}-has-color`]:Ne&&!Zt,[`${le}-hidden`]:!en,[`${le}-rtl`]:Ot==="rtl",[`${le}-borderless`]:!Vt},$t,pt,he),ce=At=>{At.stopPropagation(),be==null||be(At),!At.defaultPrevented&&on(!1)},[,Ie]=(0,Me.Z)(Qt,xt,At=>At===null?se.createElement(Te.Z,{className:`${le}-close-icon`,onClick:ce}):se.createElement("span",{className:`${le}-close-icon`,onClick:ce},At),null,!1),yt=typeof qe.onClick=="function"||Tt&&Tt.type==="a",Pe=wt||null,je=Pe?se.createElement(se.Fragment,null,Pe,Tt&&se.createElement("span",null,Tt)):Tt,Rt=se.createElement("span",Object.assign({},qe,{ref:kt,className:pe,style:ye}),je,Ie,Xt&&se.createElement(vt,{key:"preset",prefixCls:le}),Ut&&se.createElement(Ve,{key:"status",prefixCls:le}));return oe(yt?se.createElement(De.Z,{component:"Tag"},Rt):Rt)},et=se.forwardRef(Lt);et.CheckableTag=Ct;var Dt=et},99498:function(bn,tn,ue){(function(se){se(ue(89780))})(function(se){se.defineOption("placeholder","",function(we,_e,Re){var dt=Re&&Re!=se.Init;if(_e&&!dt)we.on("blur",xe),we.on("change",Me),we.on("swapDoc",Me),se.on(we.getInputField(),"compositionupdate",we.state.placeholderCompose=function(){ut(we)}),Me(we);else if(!_e&&dt){we.off("blur",xe),we.off("change",Me),we.off("swapDoc",Me),se.off(we.getInputField(),"compositionupdate",we.state.placeholderCompose),Te(we);var Ae=we.getWrapperElement();Ae.className=Ae.className.replace(" CodeMirror-empty","")}_e&&!we.hasFocus()&&xe(we)});function Te(we){we.state.placeholder&&(we.state.placeholder.parentNode.removeChild(we.state.placeholder),we.state.placeholder=null)}function ze(we){Te(we);var _e=we.state.placeholder=document.createElement("pre");_e.style.cssText="height: 0; overflow: visible",_e.style.direction=we.getOption("direction"),_e.className="CodeMirror-placeholder CodeMirror-line-like";var Re=we.getOption("placeholder");typeof Re=="string"&&(Re=document.createTextNode(Re)),_e.appendChild(Re),we.display.lineSpace.insertBefore(_e,we.display.lineSpace.firstChild)}function ut(we){setTimeout(function(){var _e=!1,Re=we.getInputField();Re.nodeName=="TEXTAREA"?_e=!Re.value:we.lineCount()==1&&(_e=!/[^\u200b]/.test(Re.querySelector(".CodeMirror-line").textContent)),_e?ze(we):Te(we)},20)}function xe(we){De(we)&&ze(we)}function Me(we){var _e=we.getWrapperElement(),Re=De(we);_e.className=_e.className.replace(" CodeMirror-empty","")+(Re?" CodeMirror-empty":""),Re?ze(we):Te(we)}function De(we){return we.lineCount()===1&&we.getLine(0)===""}})},25717:function(bn,tn,ue){(function(se){se(ue(89780))})(function(se){var Te={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},ze=se.Pos;se.defineOption("autoCloseBrackets",!1,function(Ye,ot,at){at&&at!=se.Init&&(Ye.removeKeyMap(xe),Ye.state.closeBrackets=null),ot&&(Me(ut(ot,"pairs")),Ye.state.closeBrackets=ot,Ye.addKeyMap(xe))});function ut(Ye,ot){return ot=="pairs"&&typeof Ye=="string"?Ye:typeof Ye=="object"&&Ye[ot]!=null?Ye[ot]:Te[ot]}var xe={Backspace:_e,Enter:Re};function Me(Ye){for(var ot=0;ot<Ye.length;ot++){var at=Ye.charAt(ot),Ct="'"+at+"'";xe[Ct]||(xe[Ct]=De(at))}}Me(Te.pairs+"`");function De(Ye){return function(ot){return Ae(ot,Ye)}}function we(Ye){var ot=Ye.state.closeBrackets;if(!ot||ot.override)return ot;var at=Ye.getModeAt(Ye.getCursor());return at.closeBrackets||ot}function _e(Ye){var ot=we(Ye);if(!ot||Ye.getOption("disableInput"))return se.Pass;for(var at=ut(ot,"pairs"),Ct=Ye.listSelections(),jt=0;jt<Ct.length;jt++){if(!Ct[jt].empty())return se.Pass;var it=Fe(Ye,Ct[jt].head);if(!it||at.indexOf(it)%2!=0)return se.Pass}for(var jt=Ct.length-1;jt>=0;jt--){var vt=Ct[jt].head;Ye.replaceRange("",ze(vt.line,vt.ch-1),ze(vt.line,vt.ch+1),"+delete")}}function Re(Ye){var ot=we(Ye),at=ot&&ut(ot,"explode");if(!at||Ye.getOption("disableInput"))return se.Pass;for(var Ct=Ye.listSelections(),jt=0;jt<Ct.length;jt++){if(!Ct[jt].empty())return se.Pass;var it=Fe(Ye,Ct[jt].head);if(!it||at.indexOf(it)%2!=0)return se.Pass}Ye.operation(function(){var vt=Ye.lineSeparator()||`
`;Ye.replaceSelection(vt+vt,null),Ye.execCommand("goCharLeft"),Ct=Ye.listSelections();for(var $e=0;$e<Ct.length;$e++){var Ee=Ct[$e].head.line;Ye.indentLine(Ee,null,!0),Ye.indentLine(Ee+1,null,!0)}})}function dt(Ye){var ot=se.cmpPos(Ye.anchor,Ye.head)>0;return{anchor:new ze(Ye.anchor.line,Ye.anchor.ch+(ot?-1:1)),head:new ze(Ye.head.line,Ye.head.ch+(ot?1:-1))}}function Ae(Ye,ot){var at=we(Ye);if(!at||Ye.getOption("disableInput"))return se.Pass;var Ct=ut(at,"pairs"),jt=Ct.indexOf(ot);if(jt==-1)return se.Pass;for(var it=ut(at,"closeBefore"),vt=ut(at,"triples"),$e=Ct.charAt(jt+1)==ot,Ee=Ye.listSelections(),Ve=jt%2==0,Je,Lt=0;Lt<Ee.length;Lt++){var et=Ee[Lt],Dt=et.head,Ge,kt=Ye.getRange(Dt,ze(Dt.line,Dt.ch+1));if(Ve&&!et.empty())Ge="surround";else if(($e||!Ve)&&kt==ot)$e&&ft(Ye,Dt)?Ge="both":vt.indexOf(ot)>=0&&Ye.getRange(Dt,ze(Dt.line,Dt.ch+3))==ot+ot+ot?Ge="skipThree":Ge="skip";else if($e&&Dt.ch>1&&vt.indexOf(ot)>=0&&Ye.getRange(ze(Dt.line,Dt.ch-2),Dt)==ot+ot){if(Dt.ch>2&&/\bstring/.test(Ye.getTokenTypeAt(ze(Dt.line,Dt.ch-2))))return se.Pass;Ge="addFour"}else if($e){var tt=Dt.ch==0?" ":Ye.getRange(ze(Dt.line,Dt.ch-1),Dt);if(!se.isWordChar(kt)&&tt!=ot&&!se.isWordChar(tt))Ge="both";else return se.Pass}else if(Ve&&(kt.length===0||/\s/.test(kt)||it.indexOf(kt)>-1))Ge="both";else return se.Pass;if(!Je)Je=Ge;else if(Je!=Ge)return se.Pass}var $t=jt%2?Ct.charAt(jt-1):ot,pt=jt%2?ot:Ct.charAt(jt+1);Ye.operation(function(){if(Je=="skip")Ye.execCommand("goCharRight");else if(Je=="skipThree")for(var Bt=0;Bt<3;Bt++)Ye.execCommand("goCharRight");else if(Je=="surround"){for(var Tt=Ye.getSelections(),Bt=0;Bt<Tt.length;Bt++)Tt[Bt]=$t+Tt[Bt]+pt;Ye.replaceSelections(Tt,"around"),Tt=Ye.listSelections().slice();for(var Bt=0;Bt<Tt.length;Bt++)Tt[Bt]=dt(Tt[Bt]);Ye.setSelections(Tt)}else Je=="both"?(Ye.replaceSelection($t+pt,null),Ye.triggerElectric($t+pt),Ye.execCommand("goCharLeft")):Je=="addFour"&&(Ye.replaceSelection($t+$t+$t+$t,"before"),Ye.execCommand("goCharRight"))})}function Fe(Ye,ot){var at=Ye.getRange(ze(ot.line,ot.ch-1),ze(ot.line,ot.ch+1));return at.length==2?at:null}function ft(Ye,ot){var at=Ye.getTokenAt(ze(ot.line,ot.ch+1));return/\bstring/.test(at.type)&&at.start==ot.ch&&(ot.ch==0||!/\bstring/.test(Ye.getTokenTypeAt(ot)))}})},6313:function(bn,tn,ue){(function(se){se(ue(89780),ue(32855))})(function(se){se.defineOption("autoCloseTags",!1,function(_e,Re,dt){if(dt!=se.Init&&dt&&_e.removeKeyMap("autoCloseTags"),!!Re){var Ae={name:"autoCloseTags"};(typeof Re!="object"||Re.whenClosing!==!1)&&(Ae["'/'"]=function(Fe){return Me(Fe)}),(typeof Re!="object"||Re.whenOpening!==!1)&&(Ae["'>'"]=function(Fe){return ut(Fe)}),_e.addKeyMap(Ae)}});var Te=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],ze=["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 ut(_e){if(_e.getOption("disableInput"))return se.Pass;for(var Re=_e.listSelections(),dt=[],Ae=_e.getOption("autoCloseTags"),Fe=0;Fe<Re.length;Fe++){if(!Re[Fe].empty())return se.Pass;var ft=Re[Fe].head,Ye=_e.getTokenAt(ft),ot=se.innerMode(_e.getMode(),Ye.state),at=ot.state,Ct=ot.mode.xmlCurrentTag&&ot.mode.xmlCurrentTag(at),jt=Ct&&Ct.name;if(!jt)return se.Pass;var it=ot.mode.configuration=="html",vt=typeof Ae=="object"&&Ae.dontCloseTags||it&&Te,$e=typeof Ae=="object"&&Ae.indentTags||it&&ze;Ye.end>ft.ch&&(jt=jt.slice(0,jt.length-Ye.end+ft.ch));var Ee=jt.toLowerCase();if(!jt||Ye.type=="string"&&(Ye.end!=ft.ch||!/[\"\']/.test(Ye.string.charAt(Ye.string.length-1))||Ye.string.length==1)||Ye.type=="tag"&&Ct.close||Ye.string.indexOf("/")==ft.ch-Ye.start-1||vt&&De(vt,Ee)>-1||we(_e,ot.mode.xmlCurrentContext&&ot.mode.xmlCurrentContext(at)||[],jt,ft,!0))return se.Pass;var Ve=typeof Ae=="object"&&Ae.emptyTags;if(Ve&&De(Ve,jt)>-1){dt[Fe]={text:"/>",newPos:se.Pos(ft.line,ft.ch+2)};continue}var Je=$e&&De($e,Ee)>-1;dt[Fe]={indent:Je,text:">"+(Je?`
`:"")+"</"+jt+">",newPos:Je?se.Pos(ft.line+1,0):se.Pos(ft.line,ft.ch+1)}}for(var Lt=typeof Ae=="object"&&Ae.dontIndentOnAutoClose,Fe=Re.length-1;Fe>=0;Fe--){var et=dt[Fe];_e.replaceRange(et.text,Re[Fe].head,Re[Fe].anchor,"+insert");var Dt=_e.listSelections().slice(0);Dt[Fe]={head:et.newPos,anchor:et.newPos},_e.setSelections(Dt),!Lt&&et.indent&&(_e.indentLine(et.newPos.line,null,!0),_e.indentLine(et.newPos.line+1,null,!0))}}function xe(_e,Re){for(var dt=_e.listSelections(),Ae=[],Fe=Re?"/":"</",ft=_e.getOption("autoCloseTags"),Ye=typeof ft=="object"&&ft.dontIndentOnSlash,ot=0;ot<dt.length;ot++){if(!dt[ot].empty())return se.Pass;var at=dt[ot].head,Ct=_e.getTokenAt(at),jt=se.innerMode(_e.getMode(),Ct.state),it=jt.state;if(Re&&(Ct.type=="string"||Ct.string.charAt(0)!="<"||Ct.start!=at.ch-1))return se.Pass;var vt,$e=jt.mode.name!="xml"&&_e.getMode().name=="htmlmixed";if($e&&jt.mode.name=="javascript")vt=Fe+"script";else if($e&&jt.mode.name=="css")vt=Fe+"style";else{var Ee=jt.mode.xmlCurrentContext&&jt.mode.xmlCurrentContext(it);if(!Ee||Ee.length&&we(_e,Ee,Ee[Ee.length-1],at))return se.Pass;vt=Fe+Ee[Ee.length-1]}_e.getLine(at.line).charAt(Ct.end)!=">"&&(vt+=">"),Ae[ot]=vt}if(_e.replaceSelections(Ae),dt=_e.listSelections(),!Ye)for(var ot=0;ot<dt.length;ot++)(ot==dt.length-1||dt[ot].head.line<dt[ot+1].head.line)&&_e.indentLine(dt[ot].head.line)}function Me(_e){return _e.getOption("disableInput")?se.Pass:xe(_e,!0)}se.commands.closeTag=function(_e){return xe(_e)};function De(_e,Re){if(_e.indexOf)return _e.indexOf(Re);for(var dt=0,Ae=_e.length;dt<Ae;++dt)if(_e[dt]==Re)return dt;return-1}function we(_e,Re,dt,Ae,Fe){if(!se.scanForClosingTag)return!1;var ft=Math.min(_e.lastLine()+1,Ae.line+500),Ye=se.scanForClosingTag(_e,Ae,null,ft);if(!Ye||Ye.tag!=dt)return!1;for(var ot=Fe?1:0,at=Re.length-1;at>=0&&Re[at]==dt;at--)++ot;Ae=Ye.to;for(var at=1;at<ot;at++){var Ct=se.scanForClosingTag(_e,Ae,null,ft);if(!Ct||Ct.tag!=dt)return!1;Ae=Ct.to}return!0}})},32855:function(bn,tn,ue){(function(se){se(ue(89780))})(function(se){"use strict";var Te=se.Pos;function ze(at,Ct){return at.line-Ct.line||at.ch-Ct.ch}var ut="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",xe=ut+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Me=new RegExp("<(/?)(["+ut+"]["+xe+"]*)","g");function De(at,Ct,jt,it){this.line=Ct,this.ch=jt,this.cm=at,this.text=at.getLine(Ct),this.min=it?Math.max(it.from,at.firstLine()):at.firstLine(),this.max=it?Math.min(it.to-1,at.lastLine()):at.lastLine()}function we(at,Ct){var jt=at.cm.getTokenTypeAt(Te(at.line,Ct));return jt&&/\btag\b/.test(jt)}function _e(at){if(!(at.line>=at.max))return at.ch=0,at.text=at.cm.getLine(++at.line),!0}function Re(at){if(!(at.line<=at.min))return at.text=at.cm.getLine(--at.line),at.ch=at.text.length,!0}function dt(at){for(;;){var Ct=at.text.indexOf(">",at.ch);if(Ct==-1){if(_e(at))continue;return}if(!we(at,Ct+1)){at.ch=Ct+1;continue}var jt=at.text.lastIndexOf("/",Ct),it=jt>-1&&!/\S/.test(at.text.slice(jt+1,Ct));return at.ch=Ct+1,it?"selfClose":"regular"}}function Ae(at){for(;;){var Ct=at.ch?at.text.lastIndexOf("<",at.ch-1):-1;if(Ct==-1){if(Re(at))continue;return}if(!we(at,Ct+1)){at.ch=Ct;continue}Me.lastIndex=Ct,at.ch=Ct;var jt=Me.exec(at.text);if(jt&&jt.index==Ct)return jt}}function Fe(at){for(;;){Me.lastIndex=at.ch;var Ct=Me.exec(at.text);if(!Ct){if(_e(at))continue;return}if(!we(at,Ct.index+1)){at.ch=Ct.index+1;continue}return at.ch=Ct.index+Ct[0].length,Ct}}function ft(at){for(;;){var Ct=at.ch?at.text.lastIndexOf(">",at.ch-1):-1;if(Ct==-1){if(Re(at))continue;return}if(!we(at,Ct+1)){at.ch=Ct;continue}var jt=at.text.lastIndexOf("/",Ct),it=jt>-1&&!/\S/.test(at.text.slice(jt+1,Ct));return at.ch=Ct+1,it?"selfClose":"regular"}}function Ye(at,Ct){for(var jt=[];;){var it=Fe(at),vt,$e=at.line,Ee=at.ch-(it?it[0].length:0);if(!it||!(vt=dt(at)))return;if(vt!="selfClose")if(it[1]){for(var Ve=jt.length-1;Ve>=0;--Ve)if(jt[Ve]==it[2]){jt.length=Ve;break}if(Ve<0&&(!Ct||Ct==it[2]))return{tag:it[2],from:Te($e,Ee),to:Te(at.line,at.ch)}}else jt.push(it[2])}}function ot(at,Ct){for(var jt=[];;){var it=ft(at);if(!it)return;if(it=="selfClose"){Ae(at);continue}var vt=at.line,$e=at.ch,Ee=Ae(at);if(!Ee)return;if(Ee[1])jt.push(Ee[2]);else{for(var Ve=jt.length-1;Ve>=0;--Ve)if(jt[Ve]==Ee[2]){jt.length=Ve;break}if(Ve<0&&(!Ct||Ct==Ee[2]))return{tag:Ee[2],from:Te(at.line,at.ch),to:Te(vt,$e)}}}}se.registerHelper("fold","xml",function(at,Ct){for(var jt=new De(at,Ct.line,0);;){var it=Fe(jt);if(!it||jt.line!=Ct.line)return;var vt=dt(jt);if(!vt)return;if(!it[1]&&vt!="selfClose"){var $e=Te(jt.line,jt.ch),Ee=Ye(jt,it[2]);return Ee&&ze(Ee.from,$e)>0?{from:$e,to:Ee.from}:null}}}),se.findMatchingTag=function(at,Ct,jt){var it=new De(at,Ct.line,Ct.ch,jt);if(!(it.text.indexOf(">")==-1&&it.text.indexOf("<")==-1)){var vt=dt(it),$e=vt&&Te(it.line,it.ch),Ee=vt&&Ae(it);if(!(!vt||!Ee||ze(it,Ct)>0)){var Ve={from:Te(it.line,it.ch),to:$e,tag:Ee[2]};return vt=="selfClose"?{open:Ve,close:null,at:"open"}:Ee[1]?{open:ot(it,Ee[2]),close:Ve,at:"close"}:(it=new De(at,$e.line,$e.ch,jt),{open:Ve,close:Ye(it,Ee[2]),at:"open"})}}},se.findEnclosingTag=function(at,Ct,jt,it){for(var vt=new De(at,Ct.line,Ct.ch,jt);;){var $e=ot(vt,it);if(!$e)break;var Ee=new De(at,Ct.line,Ct.ch,jt),Ve=Ye(Ee,$e.tag);if(Ve)return{open:$e,close:Ve}}},se.scanForClosingTag=function(at,Ct,jt,it){var vt=new De(at,Ct.line,Ct.ch,it?{from:0,to:it}:null);return Ye(vt,jt)}})},89780:function(bn){(function(tn,ue){bn.exports=ue()})(this,function(){"use strict";var tn=navigator.userAgent,ue=navigator.platform,se=/gecko\/\d/i.test(tn),Te=/MSIE \d/.test(tn),ze=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(tn),ut=/Edge\/(\d+)/.exec(tn),xe=Te||ze||ut,Me=xe&&(Te?document.documentMode||6:+(ut||ze)[1]),De=!ut&&/WebKit\//.test(tn),we=De&&/Qt\/\d+\.\d+/.test(tn),_e=!ut&&/Chrome\//.test(tn),Re=/Opera\//.test(tn),dt=/Apple Computer/.test(navigator.vendor),Ae=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(tn),Fe=/PhantomJS/.test(tn),ft=!ut&&/AppleWebKit/.test(tn)&&/Mobile\/\w+/.test(tn),Ye=/Android/.test(tn),ot=ft||Ye||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(tn),at=ft||/Mac/.test(ue),Ct=/\bCrOS\b/.test(tn),jt=/win/i.test(ue),it=Re&&tn.match(/Version\/(\d*\.\d*)/);it&&(it=Number(it[1])),it&&it>=15&&(Re=!1,De=!0);var vt=at&&(we||Re&&(it==null||it<12.11)),$e=se||xe&&Me>=9;function Ee(x){return new RegExp("(^|\\s)"+x+"(?:$|\\s)\\s*")}var Ve=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 Je(x){for(var z=x.childNodes.length;z>0;--z)x.removeChild(x.firstChild);return x}function Lt(x,z){return Je(x).appendChild(z)}function et(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 de=0;de<z.length;++de)ie.appendChild(z[de]);return ie}function Dt(x,z,ne,te){var ie=et(x,z,ne,te);return ie.setAttribute("role","presentation"),ie}var Ge;document.createRange?Ge=function(x,z,ne,te){var ie=document.createRange();return ie.setEnd(te||x,ne),ie.setStart(x,z),ie}:Ge=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 kt(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 tt(){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 $t(x,z){var ne=x.className;Ee(z).test(ne)||(x.className+=(ne?" ":"")+z)}function pt(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 Bt=function(x){x.select()};ft?Bt=function(x){x.selectionStart=0,x.selectionEnd=x.value.length}:xe&&(Bt=function(x){try{x.select()}catch(z){}});function Tt(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 Ne(x,z,ne,te,ie){z==null&&(z=x.search(/[^\s\u00a0]/),z==-1&&(z=x.length));for(var de=te||0,ge=ie||0;;){var Ce=x.indexOf(" ",de);if(Ce<0||Ce>=z)return ge+(z-de);ge+=Ce-de,ge+=ne-ge%ne,de=Ce+1}}var be=function(){this.id=null,this.f=null,this.time=0,this.handler=Tt(this.onTimeout,this)};be.prototype.onTimeout=function(x){x.id=0,x.time<=+new Date?x.f():setTimeout(x.handler,x.time-+new Date)},be.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 xt(x,z){for(var ne=0;ne<x.length;++ne)if(x[ne]==z)return ne;return-1}var Qt=50,Vt={toString:function(){return"CodeMirror.Pass"}},qe={scroll:!1},nt={origin:"*mouse"},Ot={origin:"+move"};function dn(x,z,ne){for(var te=0,ie=0;;){var de=x.indexOf(" ",te);de==-1&&(de=x.length);var ge=de-te;if(de==x.length||ie+ge>=z)return te+Math.min(ge,z-ie);if(ie+=de-te,ie+=ne-ie%ne,te=de+1,ie>=z)return te}}var en=[""];function on(x){for(;en.length<=x;)en.push(Xt(en)+" ");return en[x]}function Xt(x){return x[x.length-1]}function Ut(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 ye(){}function le(x,z){var ne;return Object.create?ne=Object.create(x):(ye.prototype=x,ne=new ye),z&&wt(z,ne),ne}var oe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function he(x){return/\w/.test(x)||x>"\x80"&&(x.toUpperCase()!=x.toLowerCase()||oe.test(x))}function pe(x,z){return z?z.source.indexOf("\\w")>-1&&he(x)?!0:z.test(x):he(x)}function ce(x){for(var z in x)if(x.hasOwnProperty(z)&&x[z])return!1;return!0}var Ie=/[\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 yt(x){return x.charCodeAt(0)>=768&&Ie.test(x)}function Pe(x,z,ne){for(;(ne<0?z>0:z<x.length)&&yt(x.charAt(z));)z+=ne;return z}function je(x,z,ne){for(var te=z>ne?-1:1;;){if(z==ne)return z;var ie=(z+ne)/2,de=te<0?Math.ceil(ie):Math.floor(ie);if(de==z)return x(de)?z:ne;x(de)?ne=de:z=de+te}}function Rt(x,z,ne,te){if(!x)return te(z,ne,"ltr",0);for(var ie=!1,de=0;de<x.length;++de){var ge=x[de];(ge.from<ne&&ge.to>z||z==ne&&ge.to==z)&&(te(Math.max(ge.from,z),Math.min(ge.to,ne),ge.level==1?"rtl":"ltr",de),ie=!0)}ie||te(z,ne,"ltr")}var At=null;function rt(x,z,ne){var te;At=null;for(var ie=0;ie<x.length;++ie){var de=x[ie];if(de.from<z&&de.to>z)return ie;de.to==z&&(de.from!=de.to&&ne=="before"?te=ie:At=ie),de.from==z&&(de.from!=de.to&&ne!="before"?te=ie:At=ie)}return te!=null?te:At}var Ft=function(){var x="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",z="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function ne(Ke){return Ke<=247?x.charAt(Ke):1424<=Ke&&Ke<=1524?"R":1536<=Ke&&Ke<=1785?z.charAt(Ke-1536):1774<=Ke&&Ke<=2220?"r":8192<=Ke&&Ke<=8203?"w":Ke==8204?"b":"L"}var te=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,ie=/[stwN]/,de=/[LRr]/,ge=/[Lb1n]/,Ce=/[1n]/;function ke(Ke,Et,Pt){this.level=Ke,this.from=Et,this.to=Pt}return function(Ke,Et){var Pt=Et=="ltr"?"L":"R";if(Ke.length==0||Et=="ltr"&&!te.test(Ke))return!1;for(var cn=Ke.length,rn=[],Bn=0;Bn<cn;++Bn)rn.push(ne(Ke.charCodeAt(Bn)));for(var nr=0,xr=Pt;nr<cn;++nr){var Lr=rn[nr];Lr=="m"?rn[nr]=xr:xr=Lr}for(var Pr=0,Mr=Pt;Pr<cn;++Pr){var Rr=rn[Pr];Rr=="1"&&Mr=="r"?rn[Pr]="n":de.test(Rr)&&(Mr=Rr,Rr=="r"&&(rn[Pr]="R"))}for(var Jr=1,Qr=rn[0];Jr<cn-1;++Jr){var xi=rn[Jr];xi=="+"&&Qr=="1"&&rn[Jr+1]=="1"?rn[Jr]="1":xi==","&&Qr==rn[Jr+1]&&(Qr=="1"||Qr=="n")&&(rn[Jr]=Qr),Qr=xi}for(var Qi=0;Qi<cn;++Qi){var Ra=rn[Qi];if(Ra==",")rn[Qi]="N";else if(Ra=="%"){var ca=void 0;for(ca=Qi+1;ca<cn&&rn[ca]=="%";++ca);for(var co=Qi&&rn[Qi-1]=="!"||ca<cn&&rn[ca]=="1"?"1":"N",uo=Qi;uo<ca;++uo)rn[uo]=co;Qi=ca-1}}for(var _a=0,ho=Pt;_a<cn;++_a){var li=rn[_a];ho=="L"&&li=="1"?rn[_a]="L":de.test(li)&&(ho=li)}for(var pa=0;pa<cn;++pa)if(ie.test(rn[pa])){var ua=void 0;for(ua=pa+1;ua<cn&&ie.test(rn[ua]);++ua);for(var ma=(pa?rn[pa-1]:Pt)=="L",ya=(ua<cn?rn[ua]:Pt)=="L",fl=ma==ya?ma?"L":"R":Pt,vo=pa;vo<ua;++vo)rn[vo]=fl;pa=ua-1}for(var Va=[],Ni,Ta=0;Ta<cn;)if(ge.test(rn[Ta])){var au=Ta;for(++Ta;Ta<cn&&ge.test(rn[Ta]);++Ta);Va.push(new ke(0,au,Ta))}else{var bs=Ta,Rs=Va.length,Yo=Et=="rtl"?1:0;for(++Ta;Ta<cn&&rn[Ta]!="L";++Ta);for(var Ea=bs;Ea<Ta;)if(Ce.test(rn[Ea])){bs<Ea&&(Va.splice(Rs,0,new ke(1,bs,Ea)),Rs+=Yo);var pl=Ea;for(++Ea;Ea<Ta&&Ce.test(rn[Ea]);++Ea);Va.splice(Rs,0,new ke(2,pl,Ea)),Rs+=Yo,bs=Ea}else++Ea;bs<Ta&&Va.splice(Rs,0,new ke(1,bs,Ta))}return Et=="ltr"&&(Va[0].level==1&&(Ni=Ke.match(/^\s+/))&&(Va[0].from=Ni[0].length,Va.unshift(new ke(0,0,Ni[0].length))),Xt(Va).level==1&&(Ni=Ke.match(/\s+$/))&&(Xt(Va).to-=Ni[0].length,Va.push(new ke(0,cn-Ni[0].length,cn)))),Et=="rtl"?Va.reverse():Va}}();function sn(x,z){var ne=x.order;return ne==null&&(ne=x.order=Ft(x.text,z)),ne}var ct=[],qt=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]||ct).concat(ne)}};function an(x,z){return x._handlers&&x._handlers[z]||ct}function Qe(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 de=xt(ie,ne);de>-1&&(te[z]=ie.slice(0,de).concat(ie.slice(de+1)))}}}function mt(x,z){var ne=an(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 Nt(x,z,ne){return typeof z=="string"&&(z={type:z,preventDefault:function(){this.defaultPrevented=!0}}),mt(x,ne||z.type,x,z),Hn(z)||z.codemirrorIgnore}function vn(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)xt(ne,z[te])==-1&&ne.push(z[te])}function mn(x,z){return an(x,z).length>0}function wn(x){x.prototype.on=function(z,ne){qt(this,z,ne)},x.prototype.off=function(z,ne){Qe(this,z,ne)}}function Tn(x){x.preventDefault?x.preventDefault():x.returnValue=!1}function Zn(x){x.stopPropagation?x.stopPropagation():x.cancelBubble=!0}function Hn(x){return x.defaultPrevented!=null?x.defaultPrevented:x.returnValue==!1}function wr(x){Tn(x),Zn(x)}function Cr(x){return x.target||x.srcElement}function Yn(x){var z=x.which;return z==null&&(x.button&1?z=1:x.button&2?z=3:x.button&4&&(z=2)),at&&x.ctrlKey&&z==1&&(z=3),z}var Nr=function(){if(xe&&Me<9)return!1;var x=et("div");return"draggable"in x||"dragDrop"in x}(),Kr;function Or(x){if(Kr==null){var z=et("span","\u200B");Lt(x,et("span",[z,document.createTextNode("x")])),x.firstChild.offsetHeight!=0&&(Kr=z.offsetWidth<=1&&z.offsetHeight>2&&!(xe&&Me<8))}var ne=Kr?et("span","\u200B"):et("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return ne.setAttribute("cm-text",""),ne}var Ar;function kr(x){if(Ar!=null)return Ar;var z=Lt(x,document.createTextNode("A\u062EA")),ne=Ge(z,0,1).getBoundingClientRect(),te=Ge(z,1,2).getBoundingClientRect();return Je(x),!ne||ne.left==ne.right?!1:Ar=te.right-ne.right<3}var Gr=`
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 de=x.slice(z,x.charAt(ie-1)=="\r"?ie-1:ie),ge=de.indexOf("\r");ge!=-1?(ne.push(de.slice(0,ge)),z+=ge+1):(ne.push(de),z=ie+1)}return ne}:function(x){return x.split(/\r\n?|\n/)},ar=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},$r=function(){var x=et("div");return"oncopy"in x?!0:(x.setAttribute("oncopy","return;"),typeof x.oncopy=="function")}(),Ur=null;function Vr(x){if(Ur!=null)return Ur;var z=Lt(x,et("span","x")),ne=z.getBoundingClientRect(),te=Ge(z,0,1).getBoundingClientRect();return Ur=Math.abs(ne.left-te.left)>1}var Yr={},Zr={};function dr(x,z){arguments.length>2&&(z.dependencies=Array.prototype.slice.call(arguments,2)),Yr[x]=z}function _r(x,z){Zr[x]=z}function Ln(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=le(z,x),x.name=z.name}else{if(typeof x=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(x))return Ln("application/xml");if(typeof x=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(x))return Ln("application/json")}return typeof x=="string"?{name:x}:x||{name:"null"}}function Wn(x,z){z=Ln(z);var ne=Yr[z.name];if(!ne)return Wn(x,"text/plain");var te=ne(x,z);if(Er.hasOwnProperty(z.name)){var ie=Er[z.name];for(var de in ie)ie.hasOwnProperty(de)&&(te.hasOwnProperty(de)&&(te["_"+de]=te[de]),te[de]=ie[de])}if(te.name=z.name,z.helperType&&(te.helperType=z.helperType),z.modeProps)for(var ge in z.modeProps)te[ge]=z.modeProps[ge];return te}var Er={};function St(x,z){var ne=Er.hasOwnProperty(x)?Er[x]:Er[x]={};wt(z,ne)}function Le(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 We(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 Be(x,z,ne){return x.startState?x.startState(z,ne):!0}var Oe=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};Oe.prototype.eol=function(){return this.pos>=this.string.length},Oe.prototype.sol=function(){return this.pos==this.lineStart},Oe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Oe.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Oe.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},Oe.prototype.eatWhile=function(x){for(var z=this.pos;this.eat(x););return this.pos>z},Oe.prototype.eatSpace=function(){for(var x=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>x},Oe.prototype.skipToEnd=function(){this.pos=this.string.length},Oe.prototype.skipTo=function(x){var z=this.string.indexOf(x,this.pos);if(z>-1)return this.pos=z,!0},Oe.prototype.backUp=function(x){this.pos-=x},Oe.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Ne(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Ne(this.string,this.lineStart,this.tabSize):0)},Oe.prototype.indentation=function(){return Ne(this.string,null,this.tabSize)-(this.lineStart?Ne(this.string,this.lineStart,this.tabSize):0)},Oe.prototype.match=function(x,z,ne){if(typeof x=="string"){var te=function(ge){return ne?ge.toLowerCase():ge},ie=this.string.substr(this.pos,x.length);if(te(ie)==te(x))return z!==!1&&(this.pos+=x.length),!0}else{var de=this.string.slice(this.pos).match(x);return de&&de.index>0?null:(de&&z!==!1&&(this.pos+=de[0].length),de)}},Oe.prototype.current=function(){return this.string.slice(this.start,this.pos)},Oe.prototype.hideFirstChars=function(x,z){this.lineStart+=x;try{return z()}finally{this.lineStart-=x}},Oe.prototype.lookAhead=function(x){var z=this.lineOracle;return z&&z.lookAhead(x)},Oe.prototype.baseToken=function(){var x=this.lineOracle;return x&&x.baseToken(this.pos)};function lt(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],de=ie.chunkSize();if(z<de){ne=ie;break}z-=de}return ne.lines[z]}function _t(x,z,ne){var te=[],ie=z.line;return x.iter(z.line,ne.line+1,function(de){var ge=de.text;ie==ne.line&&(ge=ge.slice(0,ne.ch)),ie==z.line&&(ge=ge.slice(z.ch)),te.push(ge),++ie}),te}function Yt(x,z,ne){var te=[];return x.iter(z,ne,function(ie){te.push(ie.text)}),te}function Kt(x,z){var ne=z-x.height;if(ne)for(var te=x;te;te=te.parent)te.height+=ne}function Jt(x){if(x.parent==null)return null;for(var z=x.parent,ne=xt(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 un(x,z){var ne=x.first;e:do{for(var te=0;te<x.children.length;++te){var ie=x.children[te],de=ie.height;if(z<de){x=ie;continue e}z-=de,ne+=ie.chunkSize()}return ne}while(!x.lines);for(var ge=0;ge<x.lines.length;++ge){var Ce=x.lines[ge],ke=Ce.height;if(z<ke)break;z-=ke}return ne+ge}function fn(x,z){return z>=x.first&&z<x.first+x.size}function xn(x,z){return String(x.lineNumberFormatter(z+x.firstLineNumber))}function zt(x,z,ne){if(ne===void 0&&(ne=null),!(this instanceof zt))return new zt(x,z,ne);this.line=x,this.ch=z,this.sticky=ne}function ln(x,z){return x.line-z.line||x.ch-z.ch}function jn(x,z){return x.sticky==z.sticky&&ln(x,z)==0}function Dn(x){return zt(x.line,x.ch)}function Vn(x,z){return ln(x,z)<0?z:x}function Pn(x,z){return ln(x,z)<0?x:z}function yr(x,z){return Math.max(x.first,Math.min(z,x.first+x.size-1))}function Sn(x,z){if(z.line<x.first)return zt(x.first,0);var ne=x.first+x.size-1;return z.line>ne?zt(ne,lt(x,ne).text.length):pr(z,lt(x,z.line).text.length)}function pr(x,z){var ne=x.ch;return ne==null||ne>z?zt(x.line,z):ne<0?zt(x.line,0):x}function ht(x,z){for(var ne=[],te=0;te<z.length;te++)ne[te]=Sn(x,z[te]);return ne}var Ue=function(x,z){this.state=x,this.lookAhead=z},Xe=function(x,z,ne,te){this.state=z,this.doc=x,this.line=ne,this.maxLookAhead=te||0,this.baseTokens=null,this.baseTokenPos=1};Xe.prototype.lookAhead=function(x){var z=this.doc.getLine(this.line+x);return z!=null&&x>this.maxLookAhead&&(this.maxLookAhead=x),z},Xe.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}},Xe.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Xe.fromSaved=function(x,z,ne){return z instanceof Ue?new Xe(x,Le(x.mode,z.state),ne,z.lookAhead):new Xe(x,Le(x.mode,z),ne)},Xe.prototype.save=function(x){var z=x!==!1?Le(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Ue(z,this.maxLookAhead):z};function Ze(x,z,ne,te){var ie=[x.state.modeGen],de={};Jn(x,z.text,x.doc.mode,ne,function(Ke,Et){return ie.push(Ke,Et)},de,te);for(var ge=ne.state,Ce=function(Ke){ne.baseTokens=ie;var Et=x.state.overlays[Ke],Pt=1,cn=0;ne.state=!0,Jn(x,z.text,Et.mode,ne,function(rn,Bn){for(var nr=Pt;cn<rn;){var xr=ie[Pt];xr>rn&&ie.splice(Pt,1,rn,ie[Pt+1],xr),Pt+=2,cn=Math.min(rn,xr)}if(Bn)if(Et.opaque)ie.splice(nr,Pt-nr,rn,"overlay "+Bn),Pt=nr+2;else for(;nr<Pt;nr+=2){var Lr=ie[nr+1];ie[nr+1]=(Lr?Lr+" ":"")+"overlay "+Bn}},de),ne.state=ge,ne.baseTokens=null,ne.baseTokenPos=1},ke=0;ke<x.state.overlays.length;++ke)Ce(ke);return{styles:ie,classes:de.bgClass||de.textClass?de:null}}function gt(x,z,ne){if(!z.styles||z.styles[0]!=x.state.modeGen){var te=Wt(x,Jt(z)),ie=z.text.length>x.options.maxHighlightLength&&Le(x.doc.mode,te.state),de=Ze(x,z,te);ie&&(te.state=ie),z.stateAfter=te.save(!ie),z.styles=de.styles,de.classes?z.styleClasses=de.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 Wt(x,z,ne){var te=x.doc,ie=x.display;if(!te.mode.startState)return new Xe(te,!0,z);var de=Fn(x,z,ne),ge=de>te.first&&lt(te,de-1).stateAfter,Ce=ge?Xe.fromSaved(te,ge,de):new Xe(te,Be(te.mode),de);return te.iter(de,z,function(ke){Gt(x,ke.text,Ce);var Ke=Ce.line;ke.stateAfter=Ke==z-1||Ke%5==0||Ke>=ie.viewFrom&&Ke<ie.viewTo?Ce.save():null,Ce.nextLine()}),ne&&(te.modeFrontier=Ce.line),Ce}function Gt(x,z,ne,te){var ie=x.doc.mode,de=new Oe(z,x.options.tabSize,ne);for(de.start=de.pos=te||0,z==""&&nn(ie,ne.state);!de.eol();)Ht(ie,de,ne.state),de.start=de.pos}function nn(x,z){if(x.blankLine)return x.blankLine(z);if(x.innerMode){var ne=We(x,z);if(ne.mode.blankLine)return ne.mode.blankLine(ne.state)}}function Ht(x,z,ne,te){for(var ie=0;ie<10;ie++){te&&(te[0]=We(x,ne).mode);var de=x.token(z,ne);if(z.pos>z.start)return de}throw new Error("Mode "+x.name+" failed to advance stream.")}var bt=function(x,z,ne){this.start=x.start,this.end=x.pos,this.string=x.current(),this.type=z||null,this.state=ne};function Cn(x,z,ne,te){var ie=x.doc,de=ie.mode,ge;z=Sn(ie,z);var Ce=lt(ie,z.line),ke=Wt(x,z.line,ne),Ke=new Oe(Ce.text,x.options.tabSize,ke),Et;for(te&&(Et=[]);(te||Ke.pos<z.ch)&&!Ke.eol();)Ke.start=Ke.pos,ge=Ht(de,Ke,ke.state),te&&Et.push(new bt(Ke,ge,Le(ie.mode,ke.state)));return te?Et:new bt(Ke,ge,ke.state)}function kn(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 Jn(x,z,ne,te,ie,de,ge){var Ce=ne.flattenSpans;Ce==null&&(Ce=x.options.flattenSpans);var ke=0,Ke=null,Et=new Oe(z,x.options.tabSize,te),Pt,cn=x.options.addModeClass&&[null];for(z==""&&kn(nn(ne,te.state),de);!Et.eol();){if(Et.pos>x.options.maxHighlightLength?(Ce=!1,ge&&Gt(x,z,te,Et.pos),Et.pos=z.length,Pt=null):Pt=kn(Ht(ne,Et,te.state,cn),de),cn){var rn=cn[0].name;rn&&(Pt="m-"+(Pt?rn+" "+Pt:rn))}if(!Ce||Ke!=Pt){for(;ke<Et.start;)ke=Math.min(Et.start,ke+5e3),ie(ke,Ke);Ke=Pt}Et.start=Et.pos}for(;ke<Et.pos;){var Bn=Math.min(Et.pos,ke+5e3);ie(Bn,Ke),ke=Bn}}function Fn(x,z,ne){for(var te,ie,de=x.doc,ge=ne?-1:z-(x.doc.mode.innerMode?1e3:100),Ce=z;Ce>ge;--Ce){if(Ce<=de.first)return de.first;var ke=lt(de,Ce-1),Ke=ke.stateAfter;if(Ke&&(!ne||Ce+(Ke instanceof Ue?Ke.lookAhead:0)<=de.modeFrontier))return Ce;var Et=Ne(ke.text,null,x.options.tabSize);(ie==null||te>Et)&&(ie=Ce-1,te=Et)}return ie}function Nn(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=lt(x,te).stateAfter;if(ie&&(!(ie instanceof Ue)||te+ie.lookAhead<z)){ne=te+1;break}}x.highlightFrontier=Math.min(x.highlightFrontier,ne)}}var _n=!1,tr=!1;function Xn(){_n=!0}function In(){tr=!0}function zn(x,z,ne){this.marker=x,this.from=z,this.to=ne}function cr(x,z){if(x)for(var ne=0;ne<x.length;++ne){var te=x[ne];if(te.marker==z)return te}}function qn(x,z){for(var ne,te=0;te<x.length;++te)x[te]!=z&&(ne||(ne=[])).push(x[te]);return ne}function br(x,z){x.markedSpans=x.markedSpans?x.markedSpans.concat([z]):[z],z.marker.attachLine(x)}function Br(x,z,ne){var te;if(x)for(var ie=0;ie<x.length;++ie){var de=x[ie],ge=de.marker,Ce=de.from==null||(ge.inclusiveLeft?de.from<=z:de.from<z);if(Ce||de.from==z&&ge.type=="bookmark"&&(!ne||!de.marker.insertLeft)){var ke=de.to==null||(ge.inclusiveRight?de.to>=z:de.to>z);(te||(te=[])).push(new zn(ge,de.from,ke?null:de.to))}}return te}function rr(x,z,ne){var te;if(x)for(var ie=0;ie<x.length;++ie){var de=x[ie],ge=de.marker,Ce=de.to==null||(ge.inclusiveRight?de.to>=z:de.to>z);if(Ce||de.from==z&&ge.type=="bookmark"&&(!ne||de.marker.insertLeft)){var ke=de.from==null||(ge.inclusiveLeft?de.from<=z:de.from<z);(te||(te=[])).push(new zn(ge,ke?null:de.from-z,de.to==null?null:de.to-z))}}return te}function yn(x,z){if(z.full)return null;var ne=fn(x,z.from.line)&&lt(x,z.from.line).markedSpans,te=fn(x,z.to.line)&&lt(x,z.to.line).markedSpans;if(!ne&&!te)return null;var ie=z.from.ch,de=z.to.ch,ge=ln(z.from,z.to)==0,Ce=Br(ne,ie,ge),ke=rr(te,de,ge),Ke=z.text.length==1,Et=Xt(z.text).length+(Ke?ie:0);if(Ce)for(var Pt=0;Pt<Ce.length;++Pt){var cn=Ce[Pt];if(cn.to==null){var rn=cr(ke,cn.marker);rn?Ke&&(cn.to=rn.to==null?null:rn.to+Et):cn.to=ie}}if(ke)for(var Bn=0;Bn<ke.length;++Bn){var nr=ke[Bn];if(nr.to!=null&&(nr.to+=Et),nr.from==null){var xr=cr(Ce,nr.marker);xr||(nr.from=Et,Ke&&(Ce||(Ce=[])).push(nr))}else nr.from+=Et,Ke&&(Ce||(Ce=[])).push(nr)}Ce&&(Ce=hn(Ce)),ke&&ke!=Ce&&(ke=hn(ke));var Lr=[Ce];if(!Ke){var Pr=z.text.length-2,Mr;if(Pr>0&&Ce)for(var Rr=0;Rr<Ce.length;++Rr)Ce[Rr].to==null&&(Mr||(Mr=[])).push(new zn(Ce[Rr].marker,null,null));for(var Jr=0;Jr<Pr;++Jr)Lr.push(Mr);Lr.push(ke)}return Lr}function hn(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 En(x,z,ne){var te=null;if(x.iter(z.line,ne.line+1,function(rn){if(rn.markedSpans)for(var Bn=0;Bn<rn.markedSpans.length;++Bn){var nr=rn.markedSpans[Bn].marker;nr.readOnly&&(!te||xt(te,nr)==-1)&&(te||(te=[])).push(nr)}}),!te)return null;for(var ie=[{from:z,to:ne}],de=0;de<te.length;++de)for(var ge=te[de],Ce=ge.find(0),ke=0;ke<ie.length;++ke){var Ke=ie[ke];if(!(ln(Ke.to,Ce.from)<0||ln(Ke.from,Ce.to)>0)){var Et=[ke,1],Pt=ln(Ke.from,Ce.from),cn=ln(Ke.to,Ce.to);(Pt<0||!ge.inclusiveLeft&&!Pt)&&Et.push({from:Ke.from,to:Ce.from}),(cn>0||!ge.inclusiveRight&&!cn)&&Et.push({from:Ce.to,to:Ke.to}),ie.splice.apply(ie,Et),ke+=Et.length-3}}return ie}function Qn(x){var z=x.markedSpans;if(z){for(var ne=0;ne<z.length;++ne)z[ne].marker.detachLine(x);x.markedSpans=null}}function Rn(x,z){if(z){for(var ne=0;ne<z.length;++ne)z[ne].marker.attachLine(x);x.markedSpans=z}}function Mn(x){return x.inclusiveLeft?-1:0}function er(x){return x.inclusiveRight?1:0}function vr(x,z){var ne=x.lines.length-z.lines.length;if(ne!=0)return ne;var te=x.find(),ie=z.find(),de=ln(te.from,ie.from)||Mn(x)-Mn(z);if(de)return-de;var ge=ln(te.to,ie.to)||er(x)-er(z);return ge||z.id-x.id}function Dr(x,z){var ne=tr&&x.markedSpans,te;if(ne)for(var ie=void 0,de=0;de<ne.length;++de)ie=ne[de],ie.marker.collapsed&&(z?ie.from:ie.to)==null&&(!te||vr(te,ie.marker)<0)&&(te=ie.marker);return te}function ei(x){return Dr(x,!0)}function $n(x){return Dr(x,!1)}function Kn(x,z){var ne=tr&&x.markedSpans,te;if(ne)for(var ie=0;ie<ne.length;++ie){var de=ne[ie];de.marker.collapsed&&(de.from==null||de.from<z)&&(de.to==null||de.to>z)&&(!te||vr(te,de.marker)<0)&&(te=de.marker)}return te}function Gn(x,z,ne,te,ie){var de=lt(x,z),ge=tr&&de.markedSpans;if(ge)for(var Ce=0;Ce<ge.length;++Ce){var ke=ge[Ce];if(ke.marker.collapsed){var Ke=ke.marker.find(0),Et=ln(Ke.from,ne)||Mn(ke.marker)-Mn(ie),Pt=ln(Ke.to,te)||er(ke.marker)-er(ie);if(!(Et>=0&&Pt<=0||Et<=0&&Pt>=0)&&(Et<=0&&(ke.marker.inclusiveRight&&ie.inclusiveLeft?ln(Ke.to,ne)>=0:ln(Ke.to,ne)>0)||Et>=0&&(ke.marker.inclusiveRight&&ie.inclusiveLeft?ln(Ke.from,te)<=0:ln(Ke.from,te)<0)))return!0}}}function sr(x){for(var z;z=ei(x);)x=z.find(-1,!0).line;return x}function Wr(x){for(var z;z=$n(x);)x=z.find(1,!0).line;return x}function vi(x){for(var z,ne;z=$n(x);)x=z.find(1,!0).line,(ne||(ne=[])).push(x);return ne}function ci(x,z){var ne=lt(x,z),te=sr(ne);return ne==te?z:Jt(te)}function qr(x,z){if(z>x.lastLine())return z;var ne=lt(x,z),te;if(!fi(x,ne))return z;for(;te=$n(ne);)ne=te.find(1,!0).line;return Jt(ne)+1}function fi(x,z){var ne=tr&&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&&mi(x,z,te))return!0}}}function mi(x,z,ne){if(ne.to==null){var te=ne.marker.find(1,!0);return mi(x,te.line,cr(te.line.markedSpans,ne.marker))}if(ne.marker.inclusiveRight&&ne.to==z.text.length)return!0;for(var ie=void 0,de=0;de<z.markedSpans.length;++de)if(ie=z.markedSpans[de],ie.marker.collapsed&&!ie.marker.widgetNode&&ie.from==ne.to&&(ie.to==null||ie.to!=ne.from)&&(ie.marker.inclusiveLeft||ne.marker.inclusiveRight)&&mi(x,z,ie))return!0}function lr(x){x=sr(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 de=ne.parent;de;ne=de,de=ne.parent)for(var ge=0;ge<de.children.length;++ge){var Ce=de.children[ge];if(Ce==ne)break;z+=Ce.height}return z}function or(x){if(x.height==0)return 0;for(var z=x.text.length,ne,te=x;ne=ei(te);){var ie=ne.find(0,!0);te=ie.from.line,z+=ie.from.ch-ie.to.ch}for(te=x;ne=$n(te);){var de=ne.find(0,!0);z-=te.text.length-de.from.ch,te=de.to.line,z+=te.text.length-de.to.ch}return z}function ir(x){var z=x.display,ne=x.doc;z.maxLine=lt(ne,ne.first),z.maxLineLength=or(z.maxLine),z.maxLineChanged=!0,ne.iter(function(te){var ie=or(te);ie>z.maxLineLength&&(z.maxLineLength=ie,z.maxLine=te)})}var mr=function(x,z,ne){this.text=x,Rn(this,z),this.height=ne?ne(this):1};mr.prototype.lineNo=function(){return Jt(this)},wn(mr);function ri(x,z,ne,te){x.text=z,x.stateAfter&&(x.stateAfter=null),x.styles&&(x.styles=null),x.order!=null&&(x.order=null),Qn(x),Rn(x,ne);var ie=te?te(x):1;ie!=x.height&&Kt(x,ie)}function pi(x){x.parent=null,Qn(x)}var yi={},gi={};function si(x,z){if(!x||/^\s*$/.test(x))return null;var ne=z.addModeClass?gi:yi;return ne[x]||(ne[x]=x.replace(/\S+/g,"cm-$&"))}function wi(x,z){var ne=Dt("span",null,null,De?"padding-right: .1px":null),te={pre:Dt("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 de=ie?z.rest[ie-1]:z.line,ge=void 0;te.pos=0,te.addToken=Di,kr(x.display.measure)&&(ge=sn(de,x.doc.direction))&&(te.addToken=Ui(te.addToken,ge)),te.map=[];var Ce=z!=x.display.externalMeasured&&Jt(de);Pa(de,te,gt(x,de,Ce)),de.styleClasses&&(de.styleClasses.bgClass&&(te.bgClass=pt(de.styleClasses.bgClass,te.bgClass||"")),de.styleClasses.textClass&&(te.textClass=pt(de.styleClasses.textClass,te.textClass||""))),te.map.length==0&&te.map.push(0,0,te.content.appendChild(Or(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(De){var ke=te.content.lastChild;(/\bcm-tab\b/.test(ke.className)||ke.querySelector&&ke.querySelector(".cm-tab"))&&(te.content.className="cm-tab-wrap-hack")}return mt(x,"renderLine",x,z.line,te.pre),te.pre.className&&(te.textClass=pt(te.pre.className,te.textClass||"")),te}function Hi(x){var z=et("span","\u2022","cm-invalidchar");return z.title="\\u"+x.charCodeAt(0).toString(16),z.setAttribute("aria-label",z.title),z}function Di(x,z,ne,te,ie,de,ge){if(z){var Ce=x.splitSpaces?aa(z,x.trailingSpace):z,ke=x.cm.state.specialChars,Ke=!1,Et;if(!ke.test(z))x.col+=z.length,Et=document.createTextNode(Ce),x.map.push(x.pos,x.pos+z.length,Et),xe&&Me<9&&(Ke=!0),x.pos+=z.length;else{Et=document.createDocumentFragment();for(var Pt=0;;){ke.lastIndex=Pt;var cn=ke.exec(z),rn=cn?cn.index-Pt:z.length-Pt;if(rn){var Bn=document.createTextNode(Ce.slice(Pt,Pt+rn));xe&&Me<9?Et.appendChild(et("span",[Bn])):Et.appendChild(Bn),x.map.push(x.pos,x.pos+rn,Bn),x.col+=rn,x.pos+=rn}if(!cn)break;Pt+=rn+1;var nr=void 0;if(cn[0]==" "){var xr=x.cm.options.tabSize,Lr=xr-x.col%xr;nr=Et.appendChild(et("span",on(Lr),"cm-tab")),nr.setAttribute("role","presentation"),nr.setAttribute("cm-text"," "),x.col+=Lr}else cn[0]=="\r"||cn[0]==`
`?(nr=Et.appendChild(et("span",cn[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),nr.setAttribute("cm-text",cn[0]),x.col+=1):(nr=x.cm.options.specialCharPlaceholder(cn[0]),nr.setAttribute("cm-text",cn[0]),xe&&Me<9?Et.appendChild(et("span",[nr])):Et.appendChild(nr),x.col+=1);x.map.push(x.pos,x.pos+1,nr),x.pos++}}if(x.trailingSpace=Ce.charCodeAt(z.length-1)==32,ne||te||ie||Ke||de||ge){var Pr=ne||"";te&&(Pr+=te),ie&&(Pr+=ie);var Mr=et("span",[Et],Pr,de);if(ge)for(var Rr in ge)ge.hasOwnProperty(Rr)&&Rr!="style"&&Rr!="class"&&Mr.setAttribute(Rr,ge[Rr]);return x.content.appendChild(Mr)}x.content.appendChild(Et)}}function aa(x,z){if(x.length>1&&!/ /.test(x))return x;for(var ne=z,te="",ie=0;ie<x.length;ie++){var de=x.charAt(ie);de==" "&&ne&&(ie==x.length-1||x.charCodeAt(ie+1)==32)&&(de="\xA0"),te+=de,ne=de==" "}return te}function Ui(x,z){return function(ne,te,ie,de,ge,Ce,ke){ie=ie?ie+" cm-force-border":"cm-force-border";for(var Ke=ne.pos,Et=Ke+te.length;;){for(var Pt=void 0,cn=0;cn<z.length&&(Pt=z[cn],!(Pt.to>Ke&&Pt.from<=Ke));cn++);if(Pt.to>=Et)return x(ne,te,ie,de,ge,Ce,ke);x(ne,te.slice(0,Pt.to-Ke),ie,de,null,Ce,ke),de=null,te=te.slice(Pt.to-Ke),Ke=Pt.to}}}function Pi(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 Pa(x,z,ne){var te=x.markedSpans,ie=x.text,de=0;if(!te){for(var ge=1;ge<ne.length;ge+=2)z.addToken(z,ie.slice(de,de=ne[ge]),si(ne[ge+1],z.cm.options));return}for(var Ce=ie.length,ke=0,Ke=1,Et="",Pt,cn,rn=0,Bn,nr,xr,Lr,Pr;;){if(rn==ke){Bn=nr=xr=cn="",Pr=null,Lr=null,rn=1/0;for(var Mr=[],Rr=void 0,Jr=0;Jr<te.length;++Jr){var Qr=te[Jr],xi=Qr.marker;if(xi.type=="bookmark"&&Qr.from==ke&&xi.widgetNode)Mr.push(xi);else if(Qr.from<=ke&&(Qr.to==null||Qr.to>ke||xi.collapsed&&Qr.to==ke&&Qr.from==ke)){if(Qr.to!=null&&Qr.to!=ke&&rn>Qr.to&&(rn=Qr.to,nr=""),xi.className&&(Bn+=" "+xi.className),xi.css&&(cn=(cn?cn+";":"")+xi.css),xi.startStyle&&Qr.from==ke&&(xr+=" "+xi.startStyle),xi.endStyle&&Qr.to==rn&&(Rr||(Rr=[])).push(xi.endStyle,Qr.to),xi.title&&((Pr||(Pr={})).title=xi.title),xi.attributes)for(var Qi in xi.attributes)(Pr||(Pr={}))[Qi]=xi.attributes[Qi];xi.collapsed&&(!Lr||vr(Lr.marker,xi)<0)&&(Lr=Qr)}else Qr.from>ke&&rn>Qr.from&&(rn=Qr.from)}if(Rr)for(var Ra=0;Ra<Rr.length;Ra+=2)Rr[Ra+1]==rn&&(nr+=" "+Rr[Ra]);if(!Lr||Lr.from==ke)for(var ca=0;ca<Mr.length;++ca)Pi(z,0,Mr[ca]);if(Lr&&(Lr.from||0)==ke){if(Pi(z,(Lr.to==null?Ce+1:Lr.to)-ke,Lr.marker,Lr.from==null),Lr.to==null)return;Lr.to==ke&&(Lr=!1)}}if(ke>=Ce)break;for(var co=Math.min(Ce,rn);;){if(Et){var uo=ke+Et.length;if(!Lr){var _a=uo>co?Et.slice(0,co-ke):Et;z.addToken(z,_a,Pt?Pt+Bn:Bn,xr,ke+_a.length==rn?nr:"",cn,Pr)}if(uo>=co){Et=Et.slice(co-ke),ke=co;break}ke=uo,xr=""}Et=ie.slice(de,de=ne[Ke++]),Pt=si(ne[Ke++],z.cm.options)}}}function da(x,z,ne){this.line=z,this.rest=vi(z),this.size=this.rest?Jt(Xt(this.rest))-ne+1:1,this.node=this.text=null,this.hidden=fi(x,z)}function oa(x,z,ne){for(var te=[],ie,de=z;de<ne;de=ie){var ge=new da(x.doc,lt(x.doc,de),de);ie=de+ge.size,te.push(ge)}return te}var Xi=null;function Si(x){Xi?Xi.ops.push(x):x.ownsGroup=Xi={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 ti(x,z){var ne=x.ownsGroup;if(ne)try{Tr(ne)}finally{Xi=null,z(ne)}}var Hr=null;function Ir(x,z){var ne=an(x,z);if(ne.length){var te=Array.prototype.slice.call(arguments,2),ie;Xi?ie=Xi.delayedCallbacks:Hr?ie=Hr:(ie=Hr=[],setTimeout(ni,0));for(var de=function(Ce){ie.push(function(){return ne[Ce].apply(null,te)})},ge=0;ge<ne.length;++ge)de(ge)}}function ni(){var x=Hr;Hr=null;for(var z=0;z<x.length;++z)x[z]()}function ii(x,z,ne,te){for(var ie=0;ie<z.changes.length;ie++){var de=z.changes[ie];de=="text"?zi(x,z):de=="gutter"?ui(x,z,ne,te):de=="class"?hi(x,z):de=="widget"&&Zi(x,z,te)}z.changes=null}function Bi(x){return x.node==x.text&&(x.node=et("div",null,null,"position: relative"),x.text.parentNode&&x.text.parentNode.replaceChild(x.node,x.text),x.node.appendChild(x.text),xe&&Me<8&&(x.node.style.zIndex=2)),x.node}function Oi(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=Bi(z);z.background=te.insertBefore(et("div",null,ne),te.firstChild),x.display.input.setUneditable(z.background)}}function Fi(x,z){var ne=x.display.externalMeasured;return ne&&ne.line==z.line?(x.display.externalMeasured=null,z.measure=ne.measure,ne.built):wi(x,z)}function zi(x,z){var ne=z.text.className,te=Fi(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,hi(x,z)):ne&&(z.text.className=ne)}function hi(x,z){Oi(x,z),z.line.wrapClass?Bi(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 ui(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=Bi(z);z.gutterBackground=et("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 de=z.line.gutterMarkers;if(x.options.lineNumbers||de){var ge=Bi(z),Ce=z.gutter=et("div",null,"CodeMirror-gutter-wrapper","left: "+(x.options.fixedGutter?te.fixedPos:-te.gutterTotalWidth)+"px");if(x.display.input.setUneditable(Ce),ge.insertBefore(Ce,z.text),z.line.gutterClass&&(Ce.className+=" "+z.line.gutterClass),x.options.lineNumbers&&(!de||!de["CodeMirror-linenumbers"])&&(z.lineNumber=Ce.appendChild(et("div",xn(x.options,ne),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+te.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+x.display.lineNumInnerWidth+"px"))),de)for(var ke=0;ke<x.display.gutterSpecs.length;++ke){var Ke=x.display.gutterSpecs[ke].className,Et=de.hasOwnProperty(Ke)&&de[Ke];Et&&Ce.appendChild(et("div",[Et],"CodeMirror-gutter-elt","left: "+te.gutterLeft[Ke]+"px; width: "+te.gutterWidth[Ke]+"px"))}}}function Zi(x,z,ne){z.alignable&&(z.alignable=null);for(var te=Ee("CodeMirror-linewidget"),ie=z.node.firstChild,de=void 0;ie;ie=de)de=ie.nextSibling,te.test(ie.className)&&z.node.removeChild(ie);Mi(x,z,ne)}function ai(x,z,ne,te){var ie=Fi(x,z);return z.text=z.node=ie.pre,ie.bgClass&&(z.bgClass=ie.bgClass),ie.textClass&&(z.textClass=ie.textClass),hi(x,z),ui(x,z,ne,te),Mi(x,z,te),z.node}function Mi(x,z,ne){if(Ti(x,z.line,z,ne,!0),z.rest)for(var te=0;te<z.rest.length;te++)Ti(x,z.rest[te],z,ne,!1)}function Ti(x,z,ne,te,ie){if(z.widgets)for(var de=Bi(ne),ge=0,Ce=z.widgets;ge<Ce.length;++ge){var ke=Ce[ge],Ke=et("div",[ke.node],"CodeMirror-linewidget"+(ke.className?" "+ke.className:""));ke.handleMouseEvents||Ke.setAttribute("cm-ignore-events","true"),Mo(ke,Ke,ne,te),x.display.input.setUneditable(Ke),ie&&ke.above?de.insertBefore(Ke,ne.gutter||ne.text):de.appendChild(Ke),Ir(ke,"redraw")}}function Mo(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 Fa(x){if(x.height!=null)return x.height;var z=x.doc.cm;if(!z)return 0;if(!kt(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;"),Lt(z.display.measure,et("div",[x.node],null,ne))}return x.height=x.node.parentNode.offsetHeight}function za(x,z){for(var ne=Cr(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 no(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=Lt(x.measure,et("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 Ma(x){return Qt-x.display.nativeBarWidth}function ha(x){return x.display.scroller.clientWidth-Ma(x)-x.display.barWidth}function bo(x){return x.display.scroller.clientHeight-Ma(x)-x.display.barHeight}function ko(x,z,ne){var te=x.options.lineWrapping,ie=te&&ha(x);if(!z.measure.heights||te&&z.measure.width!=ie){var de=z.measure.heights=[];if(te){z.measure.width=ie;for(var ge=z.text.firstChild.getClientRects(),Ce=0;Ce<ge.length-1;Ce++){var ke=ge[Ce],Ke=ge[Ce+1];Math.abs(ke.bottom-Ke.bottom)>2&&de.push((ke.bottom+Ke.top)/2-ne.top)}}de.push(ne.bottom-ne.top)}}function Lo(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(Jt(x.rest[ie])>ne)return{map:x.measure.maps[ie],cache:x.measure.caches[ie],before:!0}}function ns(x,z){z=sr(z);var ne=Jt(z),te=x.display.externalMeasured=new da(x.doc,z,ne);te.lineN=ne;var ie=te.built=wi(x,te);return te.text=ie.pre,Lt(x.display.lineMeasure,ie.pre),te}function No(x,z,ne,te){return $i(x,Oa(x,z),ne,te)}function Ya(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=Jt(z),te=Ya(x,ne);te&&!te.text?te=null:te&&te.changes&&(ii(x,te,ne,Ii(x)),x.curOp.forceUpdate=!0),te||(te=ns(x,z));var ie=Lo(te,z,ne);return{line:z,view:te,rect:null,map:ie.map,cache:ie.cache,before:ie.before,hasHeights:!1}}function $i(x,z,ne,te,ie){z.before&&(ne=-1);var de=ne+(te||""),ge;return z.cache.hasOwnProperty(de)?ge=z.cache[de]:(z.rect||(z.rect=z.view.text.getBoundingClientRect()),z.hasHeights||(ko(x,z.view,z.rect),z.hasHeights=!0),ge=Ci(x,z,ne,te),ge.bogus||(z.cache[de]=ge)),{left:ge.left,right:ge.right,top:ie?ge.rtop:ge.top,bottom:ie?ge.rbottom:ge.bottom}}var Ao={left:0,right:0,top:0,bottom:0};function rs(x,z,ne){for(var te,ie,de,ge,Ce,ke,Ke=0;Ke<x.length;Ke+=3)if(Ce=x[Ke],ke=x[Ke+1],z<Ce?(ie=0,de=1,ge="left"):z<ke?(ie=z-Ce,de=ie+1):(Ke==x.length-3||z==ke&&x[Ke+3]>z)&&(de=ke-Ce,ie=de-1,z>=ke&&(ge="right")),ie!=null){if(te=x[Ke+2],Ce==ke&&ne==(te.insertLeft?"left":"right")&&(ge=ne),ne=="left"&&ie==0)for(;Ke&&x[Ke-2]==x[Ke-3]&&x[Ke-1].insertLeft;)te=x[(Ke-=3)+2],ge="left";if(ne=="right"&&ie==ke-Ce)for(;Ke<x.length-3&&x[Ke+3]==x[Ke+4]&&!x[Ke+5].insertLeft;)te=x[(Ke+=3)+2],ge="right";break}return{node:te,start:ie,end:de,collapse:ge,coverStart:Ce,coverEnd:ke}}function Do(x,z){var ne=Ao;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 Ci(x,z,ne,te){var ie=rs(z.map,ne,te),de=ie.node,ge=ie.start,Ce=ie.end,ke=ie.collapse,Ke;if(de.nodeType==3){for(var Et=0;Et<4;Et++){for(;ge&&yt(z.line.text.charAt(ie.coverStart+ge));)--ge;for(;ie.coverStart+Ce<ie.coverEnd&&yt(z.line.text.charAt(ie.coverStart+Ce));)++Ce;if(xe&&Me<9&&ge==0&&Ce==ie.coverEnd-ie.coverStart?Ke=de.parentNode.getBoundingClientRect():Ke=Do(Ge(de,ge,Ce).getClientRects(),te),Ke.left||Ke.right||ge==0)break;Ce=ge,ge=ge-1,ke="right"}xe&&Me<11&&(Ke=di(x.display.measure,Ke))}else{ge>0&&(ke=te="right");var Pt;x.options.lineWrapping&&(Pt=de.getClientRects()).length>1?Ke=Pt[te=="right"?Pt.length-1:0]:Ke=de.getBoundingClientRect()}if(xe&&Me<9&&!ge&&(!Ke||!Ke.left&&!Ke.right)){var cn=de.parentNode.getClientRects()[0];cn?Ke={left:cn.left,right:cn.left+Li(x.display),top:cn.top,bottom:cn.bottom}:Ke=Ao}for(var rn=Ke.top-z.rect.top,Bn=Ke.bottom-z.rect.top,nr=(rn+Bn)/2,xr=z.view.measure.heights,Lr=0;Lr<xr.length-1&&!(nr<xr[Lr]);Lr++);var Pr=Lr?xr[Lr-1]:0,Mr=xr[Lr],Rr={left:(ke=="right"?Ke.right:Ke.left)-z.rect.left,right:(ke=="left"?Ke.left:Ke.right)-z.rect.left,top:Pr,bottom:Mr};return!Ke.left&&!Ke.right&&(Rr.bogus=!0),x.options.singleCursorHeightPerLine||(Rr.rtop=rn,Rr.rbottom=Bn),Rr}function di(x,z){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Vr(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 Wi(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 ka(x){x.display.externalMeasure=null,Je(x.display.lineMeasure);for(var z=0;z<x.display.view.length;z++)Wi(x.display.view[z])}function qi(x){ka(x),x.display.cachedCharWidth=x.display.cachedTextHeight=x.display.cachedPaddingH=null,x.options.lineWrapping||(x.display.maxLineChanged=!0),x.display.lineNumChars=null}function $a(){return _e&&Ye?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Ka(){return _e&&Ye?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function ro(x){var z=0;if(x.widgets)for(var ne=0;ne<x.widgets.length;++ne)x.widgets[ne].above&&(z+=Fa(x.widgets[ne]));return z}function Na(x,z,ne,te,ie){if(!ie){var de=ro(z);ne.top+=de,ne.bottom+=de}if(te=="line")return ne;te||(te="local");var ge=lr(z);if(te=="local"?ge+=no(x.display):ge-=x.display.viewOffset,te=="page"||te=="window"){var Ce=x.display.lineSpace.getBoundingClientRect();ge+=Ce.top+(te=="window"?0:Ka());var ke=Ce.left+(te=="window"?0:$a());ne.left+=ke,ne.right+=ke}return ne.top+=ge,ne.bottom+=ge,ne}function so(x,z,ne){if(ne=="div")return z;var te=z.left,ie=z.top;if(ne=="page")te-=$a(),ie-=Ka();else if(ne=="local"||!ne){var de=x.display.sizer.getBoundingClientRect();te+=de.left,ie+=de.top}var ge=x.display.lineSpace.getBoundingClientRect();return{left:te-ge.left,top:ie-ge.top}}function lo(x,z,ne,te,ie){return te||(te=lt(x.doc,z.line)),Na(x,te,No(x,te,z.ch,ie),ne)}function La(x,z,ne,te,ie,de){te=te||lt(x.doc,z.line),ie||(ie=Oa(x,te));function ge(Bn,nr){var xr=$i(x,ie,Bn,nr?"right":"left",de);return nr?xr.left=xr.right:xr.right=xr.left,Na(x,te,xr,ne)}var Ce=sn(te,x.doc.direction),ke=z.ch,Ke=z.sticky;if(ke>=te.text.length?(ke=te.text.length,Ke="before"):ke<=0&&(ke=0,Ke="after"),!Ce)return ge(Ke=="before"?ke-1:ke,Ke=="before");function Et(Bn,nr,xr){var Lr=Ce[nr],Pr=Lr.level==1;return ge(xr?Bn-1:Bn,Pr!=xr)}var Pt=rt(Ce,ke,Ke),cn=At,rn=Et(ke,Pt,Ke=="before");return cn!=null&&(rn.other=Et(ke,cn,Ke!="before")),rn}function bl(x,z){var ne=0;z=Sn(x.doc,z),x.options.lineWrapping||(ne=Li(x.display)*z.ch);var te=lt(x.doc,z.line),ie=lr(te)+no(x.display);return{left:ne,right:ne,top:ie,bottom:ie+te.height}}function Vo(x,z,ne,te,ie){var de=zt(x,z,ne);return de.xRel=ie,te&&(de.outside=te),de}function Ys(x,z,ne){var te=x.doc;if(ne+=x.display.viewOffset,ne<0)return Vo(te.first,0,null,-1,-1);var ie=un(te,ne),de=te.first+te.size-1;if(ie>de)return Vo(te.first+te.size-1,lt(te,de).text.length,null,1,1);z<0&&(z=0);for(var ge=lt(te,ie);;){var Ce=Ec(x,ge,ie,z,ne),ke=Kn(ge,Ce.ch+(Ce.xRel>0||Ce.outside>0?1:0));if(!ke)return Ce;var Ke=ke.find(1);if(Ke.line==ie)return Ke;ge=lt(te,ie=Ke.line)}}function Kl(x,z,ne,te){te-=ro(z);var ie=z.text.length,de=je(function(ge){return $i(x,ne,ge-1).bottom<=te},ie,0);return ie=je(function(ge){return $i(x,ne,ge).top>te},de,ie),{begin:de,end:ie}}function Hl(x,z,ne,te){ne||(ne=Oa(x,z));var ie=Na(x,z,$i(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 Ec(x,z,ne,te,ie){ie-=lr(z);var de=Oa(x,z),ge=ro(z),Ce=0,ke=z.text.length,Ke=!0,Et=sn(z,x.doc.direction);if(Et){var Pt=(x.options.lineWrapping?xl:is)(x,z,ne,de,Et,te,ie);Ke=Pt.level!=1,Ce=Ke?Pt.from:Pt.to-1,ke=Ke?Pt.to:Pt.from-1}var cn=null,rn=null,Bn=je(function(Jr){var Qr=$i(x,de,Jr);return Qr.top+=ge,Qr.bottom+=ge,Cs(Qr,te,ie,!1)?(Qr.top<=ie&&Qr.left<=te&&(cn=Jr,rn=Qr),!0):!1},Ce,ke),nr,xr,Lr=!1;if(rn){var Pr=te-rn.left<rn.right-te,Mr=Pr==Ke;Bn=cn+(Mr?0:1),xr=Mr?"after":"before",nr=Pr?rn.left:rn.right}else{!Ke&&(Bn==ke||Bn==Ce)&&Bn++,xr=Bn==0?"after":Bn==z.text.length?"before":$i(x,de,Bn-(Ke?1:0)).bottom+ge<=ie==Ke?"after":"before";var Rr=La(x,zt(ne,Bn,xr),"line",z,de);nr=Rr.left,Lr=ie<Rr.top?-1:ie>=Rr.bottom?1:0}return Bn=Pe(z.text,Bn,1),Vo(ne,Bn,xr,Lr,te-nr)}function is(x,z,ne,te,ie,de,ge){var Ce=je(function(Pt){var cn=ie[Pt],rn=cn.level!=1;return Cs(La(x,zt(ne,rn?cn.to:cn.from,rn?"before":"after"),"line",z,te),de,ge,!0)},0,ie.length-1),ke=ie[Ce];if(Ce>0){var Ke=ke.level!=1,Et=La(x,zt(ne,Ke?ke.from:ke.to,Ke?"after":"before"),"line",z,te);Cs(Et,de,ge,!0)&&Et.top>ge&&(ke=ie[Ce-1])}return ke}function xl(x,z,ne,te,ie,de,ge){var Ce=Kl(x,z,te,ge),ke=Ce.begin,Ke=Ce.end;/\s/.test(z.text.charAt(Ke-1))&&Ke--;for(var Et=null,Pt=null,cn=0;cn<ie.length;cn++){var rn=ie[cn];if(!(rn.from>=Ke||rn.to<=ke)){var Bn=rn.level!=1,nr=$i(x,te,Bn?Math.min(Ke,rn.to)-1:Math.max(ke,rn.from)).right,xr=nr<de?de-nr+1e9:nr-de;(!Et||Pt>xr)&&(Et=rn,Pt=xr)}}return Et||(Et=ie[ie.length-1]),Et.from<ke&&(Et={from:ke,to:Et.to,level:Et.level}),Et.to>Ke&&(Et={from:Et.from,to:Ke,level:Et.level}),Et}var Go;function as(x){if(x.cachedTextHeight!=null)return x.cachedTextHeight;if(Go==null){Go=et("pre",null,"CodeMirror-line-like");for(var z=0;z<49;++z)Go.appendChild(document.createTextNode("x")),Go.appendChild(et("br"));Go.appendChild(document.createTextNode("x"))}Lt(x.measure,Go);var ne=Go.offsetHeight/50;return ne>3&&(x.cachedTextHeight=ne),Je(x.measure),ne||1}function Li(x){if(x.cachedCharWidth!=null)return x.cachedCharWidth;var z=et("span","xxxxxxxxxx"),ne=et("pre",[z],"CodeMirror-line-like");Lt(x.measure,ne);var te=z.getBoundingClientRect(),ie=(te.right-te.left)/10;return ie>2&&(x.cachedCharWidth=ie),ie||10}function Ii(x){for(var z=x.display,ne={},te={},ie=z.gutters.clientLeft,de=z.gutters.firstChild,ge=0;de;de=de.nextSibling,++ge){var Ce=x.display.gutterSpecs[ge].className;ne[Ce]=de.offsetLeft+de.clientLeft+ie,te[Ce]=de.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 Ja(x){var z=as(x.display),ne=x.options.lineWrapping,te=ne&&Math.max(5,x.display.scroller.clientWidth/Li(x.display)-3);return function(ie){if(fi(x.doc,ie))return 0;var de=0;if(ie.widgets)for(var ge=0;ge<ie.widgets.length;ge++)ie.widgets[ge].height&&(de+=ie.widgets[ge].height);return ne?de+(Math.ceil(ie.text.length/te)||1)*z:de+z}}function Aa(x){var z=x.doc,ne=Ja(x);z.iter(function(te){var ie=ne(te);ie!=te.height&&Kt(te,ie)})}function xo(x,z,ne,te){var ie=x.display;if(!ne&&Cr(z).getAttribute("cm-not-content")=="true")return null;var de,ge,Ce=ie.lineSpace.getBoundingClientRect();try{de=z.clientX-Ce.left,ge=z.clientY-Ce.top}catch(Pt){return null}var ke=Ys(x,de,ge),Ke;if(te&&ke.xRel>0&&(Ke=lt(x.doc,ke.line).text).length==ke.ch){var Et=Ne(Ke,Ke.length,x.options.tabSize)-Ke.length;ke=zt(ke.line,Math.max(0,Math.round((de-fo(x.display).left)/Li(x.display))-Et))}return ke}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 Ha(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)tr&&ci(x.doc,z)<ie.viewTo&&To(x);else if(ne<=ie.viewFrom)tr&&qr(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 de=wo(x,ne,ne+te,1);de?(ie.view=ie.view.slice(de.index),ie.viewFrom=de.lineN,ie.viewTo+=te):To(x)}else if(ne>=ie.viewTo){var ge=wo(x,z,z,-1);ge?(ie.view=ie.view.slice(0,ge.index),ie.viewTo=ge.lineN):To(x)}else{var Ce=wo(x,z,z,-1),ke=wo(x,ne,ne+te,1);Ce&&ke?(ie.view=ie.view.slice(0,Ce.index).concat(oa(x,Ce.lineN,ke.lineN)).concat(ie.view.slice(ke.index)),ie.viewTo+=te):To(x)}var Ke=ie.externalMeasured;Ke&&(ne<Ke.lineN?Ke.lineN+=te:z<Ke.lineN+Ke.size&&(ie.externalMeasured=null))}function Bo(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 de=te.view[po(x,z)];if(de.node!=null){var ge=de.changes||(de.changes=[]);xt(ge,ne)==-1&&ge.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),de,ge=x.display.view;if(!tr||ne==x.doc.first+x.doc.size)return{index:ie,lineN:ne};for(var Ce=x.display.viewFrom,ke=0;ke<ie;ke++)Ce+=ge[ke].size;if(Ce!=z){if(te>0){if(ie==ge.length-1)return null;de=Ce+ge[ie].size-z,ie++}else de=Ce-z;z+=de,ne+=de}for(;ci(x.doc,ne)!=ne;){if(ie==(te<0?0:ge.length-1))return null;ne+=te*ge[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=oa(x,z,ne),te.viewFrom=z):(te.viewFrom>z?te.view=oa(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(oa(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 Eu(x,z){z===void 0&&(z=!0);for(var ne=x.doc,te={},ie=te.cursors=document.createDocumentFragment(),de=te.selection=document.createDocumentFragment(),ge=0;ge<ne.sel.ranges.length;ge++)if(!(!z&&ge==ne.sel.primIndex)){var Ce=ne.sel.ranges[ge];if(!(Ce.from().line>=x.display.viewTo||Ce.to().line<x.display.viewFrom)){var ke=Ce.empty();(ke||x.options.showCursorWhenSelecting)&&Mu(x,Ce.head,ie),ke||Od(x,Ce,de)}}return te}function Mu(x,z,ne){var te=La(x,z,"div",null,null,!x.options.singleCursorHeightPerLine),ie=ne.appendChild(et("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 de=ne.appendChild(et("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));de.style.display="",de.style.left=te.other.left+"px",de.style.top=te.other.top+"px",de.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,de=document.createDocumentFragment(),ge=fo(x.display),Ce=ge.left,ke=Math.max(te.sizerWidth,ha(x)-te.sizer.offsetLeft)-ge.right,Ke=ie.direction=="ltr";function Et(Mr,Rr,Jr,Qr){Rr<0&&(Rr=0),Rr=Math.round(Rr),Qr=Math.round(Qr),de.appendChild(et("div",null,"CodeMirror-selected","position: absolute; left: "+Mr+`px;
top: `+Rr+"px; width: "+(Jr==null?ke-Mr:Jr)+`px;
height: `+(Qr-Rr)+"px"))}function Pt(Mr,Rr,Jr){var Qr=lt(ie,Mr),xi=Qr.text.length,Qi,Ra;function ca(_a,ho){return lo(x,zt(Mr,_a),"div",Qr,ho)}function co(_a,ho,li){var pa=Hl(x,Qr,null,_a),ua=ho=="ltr"==(li=="after")?"left":"right",ma=li=="after"?pa.begin:pa.end-(/\s/.test(Qr.text.charAt(pa.end-1))?2:1);return ca(ma,ua)[ua]}var uo=sn(Qr,ie.direction);return Rt(uo,Rr||0,Jr==null?xi:Jr,function(_a,ho,li,pa){var ua=li=="ltr",ma=ca(_a,ua?"left":"right"),ya=ca(ho-1,ua?"right":"left"),fl=Rr==null&&_a==0,vo=Jr==null&&ho==xi,Va=pa==0,Ni=!uo||pa==uo.length-1;if(ya.top-ma.top<=3){var Ta=(Ke?fl:vo)&&Va,au=(Ke?vo:fl)&&Ni,bs=Ta?Ce:(ua?ma:ya).left,Rs=au?ke:(ua?ya:ma).right;Et(bs,ma.top,Rs-bs,ma.bottom)}else{var Yo,Ea,pl,Ga;ua?(Yo=Ke&&fl&&Va?Ce:ma.left,Ea=Ke?ke:co(_a,li,"before"),pl=Ke?Ce:co(ho,li,"after"),Ga=Ke&&vo&&Ni?ke:ya.right):(Yo=Ke?co(_a,li,"before"):Ce,Ea=!Ke&&fl&&Va?ke:ma.right,pl=!Ke&&vo&&Ni?Ce:ya.left,Ga=Ke?co(ho,li,"after"):ke),Et(Yo,ma.top,Ea-Yo,ma.bottom),ma.bottom<ya.top&&Et(Ce,ma.bottom,null,ya.top),Et(pl,ya.top,Ga-pl,ya.bottom)}(!Qi||Zl(ma,Qi)<0)&&(Qi=ma),Zl(ya,Qi)<0&&(Qi=ya),(!Ra||Zl(ma,Ra)<0)&&(Ra=ma),Zl(ya,Ra)<0&&(Ra=ya)}),{start:Qi,end:Ra}}var cn=z.from(),rn=z.to();if(cn.line==rn.line)Pt(cn.line,cn.ch,rn.ch);else{var Bn=lt(ie,cn.line),nr=lt(ie,rn.line),xr=sr(Bn)==sr(nr),Lr=Pt(cn.line,cn.ch,xr?Bn.text.length+1:null).end,Pr=Pt(rn.line,xr?0:null,rn.ch).start;xr&&(Lr.top<Pr.top-2?(Et(Lr.right,Lr.top,null,Lr.bottom),Et(Ce,Pr.top,Pr.left,Pr.bottom)):Et(Lr.right,Lr.top,Pr.left-Lr.right,Lr.bottom)),Lr.bottom<Pr.top&&Et(Ce,Lr.bottom,null,Pr.top)}ne.appendChild(de)}function Mc(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(),kc(x))}function ku(x){x.state.delayingBlurEvent=!0,setTimeout(function(){x.state.delayingBlurEvent&&(x.state.delayingBlurEvent=!1,Js(x))},100)}function kc(x,z){x.state.delayingBlurEvent&&(x.state.delayingBlurEvent=!1),x.options.readOnly!="nocursor"&&(x.state.focused||(mt(x,"focus",x,z),x.state.focused=!0,$t(x.display.wrapper,"CodeMirror-focused"),!x.curOp&&x.display.selForContextMenu!=x.doc.sel&&(x.display.input.reset(),De&&setTimeout(function(){return x.display.input.reset(!0)},20)),x.display.input.receivedFocus()),Mc(x))}function Js(x,z){x.state.delayingBlurEvent||(x.state.focused&&(mt(x,"blur",x,z),x.state.focused=!1,Ve(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],de=x.options.lineWrapping,ge=void 0,Ce=0;if(!ie.hidden){if(xe&&Me<8){var ke=ie.node.offsetTop+ie.node.offsetHeight;ge=ke-ne,ne=ke}else{var Ke=ie.node.getBoundingClientRect();ge=Ke.bottom-Ke.top,!de&&ie.text.firstChild&&(Ce=ie.text.firstChild.getBoundingClientRect().right-Ke.left-1)}var Et=ie.line.height-ge;if((Et>.005||Et<-.005)&&(Kt(ie.line,ge),Lu(ie.line),ie.rest))for(var Pt=0;Pt<ie.rest.length;Pt++)Lu(ie.rest[Pt]);if(Ce>x.display.sizerWidth){var cn=Math.ceil(Ce/Li(x.display));cn>x.display.maxLineLength&&(x.display.maxLineLength=cn,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 Da(x,z,ne){var te=ne&&ne.top!=null?Math.max(0,ne.top):x.scroller.scrollTop;te=Math.floor(te-no(x));var ie=ne&&ne.bottom!=null?ne.bottom:te+x.wrapper.clientHeight,de=un(z,te),ge=un(z,ie);if(ne&&ne.ensure){var Ce=ne.ensure.from.line,ke=ne.ensure.to.line;Ce<de?(de=Ce,ge=un(z,lr(lt(z,Ce))+x.wrapper.clientHeight)):Math.min(ke,z.lastLine())>=ge&&(de=un(z,lr(lt(z,ke))-x.wrapper.clientHeight),ge=ke)}return{from:de,to:Math.max(ge,de+1)}}function ss(x,z){if(!Nt(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&&!Fe){var de=et("div","\u200B",null,`position: absolute;
top: `+(z.top-ne.viewOffset-no(x.display))+`px;
height: `+(z.bottom-z.top+Ma(x)+ne.barHeight)+`px;
left: `+z.left+"px; width: "+Math.max(2,z.right-z.left)+"px;");x.display.lineSpace.appendChild(de),de.scrollIntoView(ie),x.display.lineSpace.removeChild(de)}}}function _s(x,z,ne,te){te==null&&(te=0);var ie;!x.options.lineWrapping&&z==ne&&(z=z.ch?zt(z.line,z.sticky=="before"?z.ch-1:z.ch,"after"):z,ne=z.sticky=="before"?zt(z.line,z.ch+1,"before"):z);for(var de=0;de<5;de++){var ge=!1,Ce=La(x,z),ke=!ne||ne==z?Ce:La(x,ne);ie={left:Math.min(Ce.left,ke.left),top:Math.min(Ce.top,ke.top)-te,right:Math.max(Ce.left,ke.left),bottom:Math.max(Ce.bottom,ke.bottom)+te};var Ke=Vl(x,ie),Et=x.doc.scrollTop,Pt=x.doc.scrollLeft;if(Ke.scrollTop!=null&&(Es(x,Ke.scrollTop),Math.abs(x.doc.scrollTop-Et)>1&&(ge=!0)),Ke.scrollLeft!=null&&(Ms(x,Ke.scrollLeft),Math.abs(x.doc.scrollLeft-Pt)>1&&(ge=!0)),!ge)break}return ie}function $d(x,z){var ne=Vl(x,z);ne.scrollTop!=null&&Es(x,ne.scrollTop),ne.scrollLeft!=null&&Ms(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,de=bo(x),ge={};z.bottom-z.top>de&&(z.bottom=z.top+de);var Ce=x.doc.height+Ss(ne),ke=z.top<te,Ke=z.bottom>Ce-te;if(z.top<ie)ge.scrollTop=ke?0:z.top;else if(z.bottom>ie+de){var Et=Math.min(z.top,(Ke?Ce:z.bottom)-de);Et!=ie&&(ge.scrollTop=Et)}var Pt=x.options.fixedGutter?0:ne.gutters.offsetWidth,cn=x.curOp&&x.curOp.scrollLeft!=null?x.curOp.scrollLeft:ne.scroller.scrollLeft-Pt,rn=ha(x)-ne.gutters.offsetWidth,Bn=z.right-z.left>rn;return Bn&&(z.right=z.left+rn),z.left<10?ge.scrollLeft=0:z.left<cn?ge.scrollLeft=Math.max(0,z.left+Pt-(Bn?0:10)):z.right>rn+cn-3&&(ge.scrollLeft=z.right+(Bn?0:10)-rn),ge}function Lc(x,z){z!=null&&(Gl(x),x.curOp.scrollTop=(x.curOp.scrollTop==null?x.doc.scrollTop:x.curOp.scrollTop)+z)}function Qs(x){Gl(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)&&Gl(x),z!=null&&(x.curOp.scrollLeft=z),ne!=null&&(x.curOp.scrollTop=ne)}function Nd(x,z){Gl(x),x.curOp.scrollToPos=z}function Gl(x){var z=x.curOp.scrollToPos;if(z){x.curOp.scrollToPos=null;var ne=bl(x,z.from),te=bl(x,z.to);Au(x,ne,te,z.margin)}}function Au(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 Es(x,z){Math.abs(x.doc.scrollTop-z)<2||(se||Bc(x,{top:z}),Du(x,z,!0),se&&Bc(x),nl(x,100))}function Du(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 Ms(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,$u(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+Ma(x)+z.barHeight,nativeBarWidth:z.nativeBarWidth,gutterWidth:ne}}var ls=function(x,z,ne){this.cm=ne;var te=this.vert=et("div",[et("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),ie=this.horiz=et("div",[et("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");te.tabIndex=ie.tabIndex=-1,x(te),x(ie),qt(te,"scroll",function(){te.clientHeight&&z(te.scrollTop,"vertical")}),qt(ie,"scroll",function(){ie.clientWidth&&z(ie.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,xe&&Me<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 de=x.viewWidth-x.barLeft-(ne?te:0);this.horiz.firstChild.style.width=Math.max(0,x.scrollWidth-x.clientWidth+de)+"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=at&&!Ae?"12px":"18px";this.horiz.style.height=this.vert.style.width=x,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new be,this.disableVert=new be},ls.prototype.enableZeroWidthBar=function(x,z,ne){x.style.pointerEvents="auto";function te(){var ie=x.getBoundingClientRect(),de=ne=="vert"?document.elementFromPoint(ie.right-1,(ie.top+ie.bottom)/2):document.elementFromPoint((ie.right+ie.left)/2,ie.bottom-1);de!=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 ks(x,z){z||(z=tl(x));var ne=x.display.barWidth,te=x.display.barHeight;Ac(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),Ac(x,tl(x)),ne=x.display.barWidth,te=x.display.barHeight}function Ac(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 Bu={native:ls,null:mo};function Tu(x){x.display.scrollbars&&(x.display.scrollbars.clear(),x.display.scrollbars.addClass&&Ve(x.display.wrapper,x.display.scrollbars.addClass)),x.display.scrollbars=new Bu[x.options.scrollbarStyle](function(z){x.display.wrapper.insertBefore(z,x.display.scrollbarFiller),qt(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"?Ms(x,z):Es(x,z)},x),x.display.scrollbars.addClass&&$t(x.display.wrapper,x.display.scrollbars.addClass)}var Rd=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:++Rd},Si(x.curOp)}function cs(x){var z=x.curOp;z&&ti(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 de=0;de<z.length;de++)Wd(z[de]);for(var ge=0;ge<z.length;ge++)Zd(z[ge])}function zd(x){var z=x.cm,ne=z.display;Pu(z),x.updateMaxLine&&ir(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 Ul(z,x.mustUpdate&&{top:x.scrollTop,ensure:x.scrollToPos},x.forceUpdate)}function Kd(x){x.updatedDisplay=x.mustUpdate&&Dc(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=No(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+Ma(z)+z.display.barWidth),x.maxScrollLeft=Math.max(0,ne.sizer.offsetLeft+x.adjustWidthTo-ha(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&&Ms(z,Math.min(z.display.scroller.scrollLeft,x.maxScrollLeft),!0),z.display.maxLineChanged=!1);var ne=x.focus&&x.focus==tt();x.preparedSelection&&z.display.input.showSelection(x.preparedSelection,ne),(x.updatedDisplay||x.startHeight!=z.doc.height)&&ks(z,x.barMeasure),x.updatedDisplay&&Ic(z,x.barMeasure),x.selectionChanged&&Mc(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&&Du(z,x.scrollTop,x.forceScroll),x.scrollLeft!=null&&Ms(z,x.scrollLeft,!0,!0),x.scrollToPos){var ie=_s(z,Sn(te,x.scrollToPos.from),Sn(te,x.scrollToPos.to),x.scrollToPos.margin);ss(z,ie)}var de=x.maybeHiddenMarkers,ge=x.maybeUnhiddenMarkers;if(de)for(var Ce=0;Ce<de.length;++Ce)de[Ce].lines.length||mt(de[Ce],"hide");if(ge)for(var ke=0;ke<ge.length;++ke)ge[ke].lines.length&&mt(ge[ke],"unhide");ne.wrapper.offsetHeight&&(te.scrollTop=z.display.scroller.scrollTop),x.changeObjs&&mt(z,"changes",z,x.changeObjs),x.update&&x.update.finish()}function fa(x,z){if(x.curOp)return z();Ls(x);try{return z()}finally{cs(x)}}function wa(x,z){return function(){if(x.curOp)return z.apply(x,arguments);Ls(x);try{return z.apply(x,arguments)}finally{cs(x)}}}function la(x){return function(){if(this.curOp)return x.apply(this,arguments);Ls(this);try{return x.apply(this,arguments)}finally{cs(this)}}}function Ba(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,Tt(Iu,x))}function Iu(x){var z=x.doc;if(!(z.highlightFrontier>=x.display.viewTo)){var ne=+new Date+x.options.workTime,te=Wt(x,z.highlightFrontier),ie=[];z.iter(te.line,Math.min(z.first+z.size,x.display.viewTo+500),function(de){if(te.line>=x.display.viewFrom){var ge=de.styles,Ce=de.text.length>x.options.maxHighlightLength?Le(z.mode,te.state):null,ke=Ze(x,de,te,!0);Ce&&(te.state=Ce),de.styles=ke.styles;var Ke=de.styleClasses,Et=ke.classes;Et?de.styleClasses=Et:Ke&&(de.styleClasses=null);for(var Pt=!ge||ge.length!=de.styles.length||Ke!=Et&&(!Ke||!Et||Ke.bgClass!=Et.bgClass||Ke.textClass!=Et.textClass),cn=0;!Pt&&cn<ge.length;++cn)Pt=ge[cn]!=de.styles[cn];Pt&&ie.push(te.line),de.stateAfter=te.save(),te.nextLine()}else de.text.length<=x.options.maxHighlightLength&&Gt(x,de.text,te),de.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&&fa(x,function(){for(var de=0;de<ie.length;de++)Bo(x,ie[de],"text")})}}var Ul=function(x,z,ne){var te=x.display;this.viewport=z,this.visible=Da(te,x.doc,z),this.editorIsHidden=!te.wrapper.offsetWidth,this.wrapperHeight=te.wrapper.clientHeight,this.wrapperWidth=te.wrapper.clientWidth,this.oldDisplayWidth=ha(x),this.force=ne,this.dims=Ii(x),this.events=[]};Ul.prototype.signal=function(x,z){mn(x,z)&&this.events.push(arguments)},Ul.prototype.finish=function(){for(var x=0;x<this.events.length;x++)mt.apply(null,this.events[x])};function Pu(x){var z=x.display;!z.scrollbarsClipped&&z.scroller.offsetWidth&&(z.nativeBarWidth=z.scroller.offsetWidth-z.scroller.clientWidth,z.heightForcer.style.height=Ma(x)+"px",z.sizer.style.marginBottom=-z.nativeBarWidth+"px",z.sizer.style.borderRightWidth=Ma(x)+"px",z.scrollbarsClipped=!0)}function jd(x){if(x.hasFocus())return null;var z=tt();if(!z||!kt(x.display.lineDiv,z))return null;var ne={activeElt:z};if(window.getSelection){var te=window.getSelection();te.anchorNode&&te.extend&&kt(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==tt())&&(x.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(x.activeElt.nodeName)&&x.anchorNode&&kt(document.body,x.anchorNode)&&kt(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 Dc(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=Ii(x));var ie=te.first+te.size,de=Math.max(z.visible.from-x.options.viewportMargin,te.first),ge=Math.min(ie,z.visible.to+x.options.viewportMargin);ne.viewFrom<de&&de-ne.viewFrom<20&&(de=Math.max(te.first,ne.viewFrom)),ne.viewTo>ge&&ne.viewTo-ge<20&&(ge=Math.min(ie,ne.viewTo)),tr&&(de=ci(x.doc,de),ge=qr(x.doc,ge));var Ce=de!=ne.viewFrom||ge!=ne.viewTo||ne.lastWrapHeight!=z.wrapperHeight||ne.lastWrapWidth!=z.wrapperWidth;os(x,de,ge),ne.viewOffset=lr(lt(x.doc,ne.viewFrom)),x.display.mover.style.top=ne.viewOffset+"px";var ke=Wl(x);if(!Ce&&ke==0&&!z.force&&ne.renderedView==ne.view&&(ne.updateLineNumbers==null||ne.updateLineNumbers>=ne.viewTo))return!1;var Ke=jd(x);return ke>4&&(ne.lineDiv.style.display="none"),Gd(x,ne.updateLineNumbers,z.dims),ke>4&&(ne.lineDiv.style.display=""),ne.renderedView=ne.view,Vd(Ke),Je(ne.cursorDiv),Je(ne.selectionDiv),ne.gutters.style.height=ne.sizer.style.minHeight=0,Ce&&(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==ha(x)){if(ne&&ne.top!=null&&(ne={top:Math.min(x.doc.height+Ss(x.display)-bo(x),ne.top)}),z.visible=Da(x.display,x.doc,ne),z.visible.from>=x.display.viewFrom&&z.visible.to<=x.display.viewTo)break}else te&&(z.visible=Da(x.display,x.doc,ne));if(!Dc(x,z))break;jl(x);var ie=tl(x);wl(x),ks(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 Bc(x,z){var ne=new Ul(x,z);if(Dc(x,ne)){jl(x),Ou(x,ne);var te=tl(x);wl(x),ks(x,te),Ic(x,te),ne.finish()}}function Gd(x,z,ne){var te=x.display,ie=x.options.lineNumbers,de=te.lineDiv,ge=de.firstChild;function Ce(Bn){var nr=Bn.nextSibling;return De&&at&&x.display.currentWheelTarget==Bn?Bn.style.display="none":Bn.parentNode.removeChild(Bn),nr}for(var ke=te.view,Ke=te.viewFrom,Et=0;Et<ke.length;Et++){var Pt=ke[Et];if(!Pt.hidden)if(!Pt.node||Pt.node.parentNode!=de){var cn=ai(x,Pt,Ke,ne);de.insertBefore(cn,ge)}else{for(;ge!=Pt.node;)ge=Ce(ge);var rn=ie&&z!=null&&z<=Ke&&Pt.lineNumber;Pt.changes&&(xt(Pt.changes,"gutter")>-1&&(rn=!1),ii(x,Pt,Ke,ne)),rn&&(Je(Pt.lineNumber),Pt.lineNumber.appendChild(document.createTextNode(xn(x.options,Ke)))),ge=Pt.node.nextSibling}Ke+=Pt.size}for(;ge;)ge=Ce(ge)}function Tc(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+Ma(x)+"px"}function $u(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,de=te+"px",ge=0;ge<ne.length;ge++)if(!ne[ge].hidden){x.options.fixedGutter&&(ne[ge].gutter&&(ne[ge].gutter.style.left=de),ne[ge].gutterBackground&&(ne[ge].gutterBackground.style.left=de));var Ce=ne[ge].alignable;if(Ce)for(var ke=0;ke<Ce.length;ke++)Ce[ke].style.left=de}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(et("div",[et("div",ne)],"CodeMirror-linenumber CodeMirror-gutter-elt")),de=ie.firstChild.offsetWidth,ge=ie.offsetWidth-de;return te.lineGutter.style.width="",te.lineNumInnerWidth=Math.max(de,te.lineGutter.offsetWidth-ge)+1,te.lineNumWidth=te.lineNumInnerWidth+ge,te.lineNumChars=te.lineNumInnerWidth?ne.length:-1,te.lineGutter.style.width=te.lineNumWidth+"px",Tc(x.display),!0}return!1}function Pc(x,z){for(var ne=[],te=!1,ie=0;ie<x.length;ie++){var de=x[ie],ge=null;if(typeof de!="string"&&(ge=de.style,de=de.className),de=="CodeMirror-linenumbers")if(z)te=!0;else continue;ne.push({className:de,style:ge})}return z&&!te&&ne.push({className:"CodeMirror-linenumbers",style:null}),ne}function Nu(x){var z=x.gutters,ne=x.gutterSpecs;Je(z),x.lineGutter=null;for(var te=0;te<ne.length;++te){var ie=ne[te],de=ie.className,ge=ie.style,Ce=z.appendChild(et("div",null,"CodeMirror-gutter "+de));ge&&(Ce.style.cssText=ge),de=="CodeMirror-linenumbers"&&(x.lineGutter=Ce,Ce.style.width=(x.lineNumWidth||1)+"px")}z.style.display=ne.length?"":"none",Tc(x)}function Cl(x){Nu(x.display),Ha(x),$u(x)}function Ud(x,z,ne,te){var ie=this;this.input=ne,ie.scrollbarFiller=et("div",null,"CodeMirror-scrollbar-filler"),ie.scrollbarFiller.setAttribute("cm-not-content","true"),ie.gutterFiller=et("div",null,"CodeMirror-gutter-filler"),ie.gutterFiller.setAttribute("cm-not-content","true"),ie.lineDiv=Dt("div",null,"CodeMirror-code"),ie.selectionDiv=et("div",null,null,"position: relative; z-index: 1"),ie.cursorDiv=et("div",null,"CodeMirror-cursors"),ie.measure=et("div",null,"CodeMirror-measure"),ie.lineMeasure=et("div",null,"CodeMirror-measure"),ie.lineSpace=Dt("div",[ie.measure,ie.lineMeasure,ie.selectionDiv,ie.cursorDiv,ie.lineDiv],null,"position: relative; outline: none");var de=Dt("div",[ie.lineSpace],"CodeMirror-lines");ie.mover=et("div",[de],null,"position: relative"),ie.sizer=et("div",[ie.mover],"CodeMirror-sizer"),ie.sizerWidth=null,ie.heightForcer=et("div",null,null,"position: absolute; height: "+Qt+"px; width: 1px;"),ie.gutters=et("div",null,"CodeMirror-gutters"),ie.lineGutter=null,ie.scroller=et("div",[ie.sizer,ie.heightForcer,ie.gutters],"CodeMirror-scroll"),ie.scroller.setAttribute("tabIndex","-1"),ie.wrapper=et("div",[ie.scrollbarFiller,ie.gutterFiller,ie.scroller],"CodeMirror"),xe&&Me<8&&(ie.gutters.style.zIndex=-1,ie.scroller.style.paddingRight=0),!De&&!(se&&ot)&&(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=Pc(te.gutters,te.lineNumbers),Nu(ie),ne.init(ie)}var ql=0,Wa=null;xe?Wa=-.53:se?Wa=15:_e?Wa=-.7:dt&&(Wa=-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 Ru(x){var z=rl(x);return z.x*=Wa,z.y*=Wa,z}function Fu(x,z){var ne=rl(z),te=ne.x,ie=ne.y,de=x.display,ge=de.scroller,Ce=ge.scrollWidth>ge.clientWidth,ke=ge.scrollHeight>ge.clientHeight;if(te&&Ce||ie&&ke){if(ie&&at&&De){e:for(var Ke=z.target,Et=de.view;Ke!=ge;Ke=Ke.parentNode)for(var Pt=0;Pt<Et.length;Pt++)if(Et[Pt].node==Ke){x.display.currentWheelTarget=Ke;break e}}if(te&&!se&&!Re&&Wa!=null){ie&&ke&&Es(x,Math.max(0,ge.scrollTop+ie*Wa)),Ms(x,Math.max(0,ge.scrollLeft+te*Wa)),(!ie||ie&&ke)&&Tn(z),de.wheelStartX=null;return}if(ie&&Wa!=null){var cn=ie*Wa,rn=x.doc.scrollTop,Bn=rn+de.wrapper.clientHeight;cn<0?rn=Math.max(0,rn+cn-50):Bn=Math.min(x.doc.height,Bn+cn+50),Bc(x,{top:rn,bottom:Bn})}ql<20&&(de.wheelStartX==null?(de.wheelStartX=ge.scrollLeft,de.wheelStartY=ge.scrollTop,de.wheelDX=te,de.wheelDY=ie,setTimeout(function(){if(de.wheelStartX!=null){var nr=ge.scrollLeft-de.wheelStartX,xr=ge.scrollTop-de.wheelStartY,Lr=xr&&de.wheelDY&&xr/de.wheelDY||nr&&de.wheelDX&&nr/de.wheelDX;de.wheelStartX=de.wheelStartY=null,Lr&&(Wa=(Wa*ql+Lr)/(ql+1),++ql)}},200)):(de.wheelDX+=te,de.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(!jn(ne.anchor,te.anchor)||!jn(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 Ki(Dn(this.ranges[z].anchor),Dn(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(ln(z,te.from())>=0&&ln(x,te.to())<=0)return ne}return-1};var Ki=function(x,z){this.anchor=x,this.head=z};Ki.prototype.from=function(){return Pn(this.anchor,this.head)},Ki.prototype.to=function(){return Vn(this.anchor,this.head)},Ki.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Io(x,z,ne){var te=x&&x.options.selectionsMayTouch,ie=z[ne];z.sort(function(cn,rn){return ln(cn.from(),rn.from())}),ne=xt(z,ie);for(var de=1;de<z.length;de++){var ge=z[de],Ce=z[de-1],ke=ln(Ce.to(),ge.from());if(te&&!ge.empty()?ke>0:ke>=0){var Ke=Pn(Ce.from(),ge.from()),Et=Vn(Ce.to(),ge.to()),Pt=Ce.empty()?ge.from()==ge.head:Ce.from()==Ce.head;de<=ne&&--ne,z.splice(--de,2,new Ki(Pt?Et:Ke,Pt?Ke:Et))}}return new go(z,ne)}function Ro(x,z){return new go([new Ki(x,z||x)],0)}function us(x){return x.text?zt(x.from.line+x.text.length-1,Xt(x.text).length+(x.text.length==1?x.from.ch:0)):x.to}function zu(x,z){if(ln(x,z.from)<0)return x;if(ln(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),zt(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 Ki(zu(ie.anchor,z),zu(ie.head,z)))}return Io(x.cm,ne,x.sel.primIndex)}function il(x,z,ne){return x.line==z.line?zt(ne.line,x.ch-z.ch+ne.ch):zt(ne.line+(x.line-z.line),x.ch)}function $c(x,z,ne){for(var te=[],ie=zt(x.first,0),de=ie,ge=0;ge<z.length;ge++){var Ce=z[ge],ke=il(Ce.from,ie,de),Ke=il(us(Ce),ie,de);if(ie=Ce.to,de=Ke,ne=="around"){var Et=x.sel.ranges[ge],Pt=ln(Et.head,Et.anchor)<0;te[ge]=new Ki(Pt?Ke:ke,Pt?ke:Ke)}else te[ge]=new Ki(ke,ke)}return new go(te,x.sel.primIndex)}function Nc(x){x.doc.mode=Wn(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&&Ha(x)}function Ku(x,z){return z.from.ch==0&&z.to.ch==0&&Xt(z.text)==""&&(!x.cm||x.cm.options.wholeLineUpdateBefore)}function Rc(x,z,ne,te){function ie(Pr){return ne?ne[Pr]:null}function de(Pr,Mr,Rr){ri(Pr,Mr,Rr,te),Ir(Pr,"change",Pr,z)}function ge(Pr,Mr){for(var Rr=[],Jr=Pr;Jr<Mr;++Jr)Rr.push(new mr(Ke[Jr],ie(Jr),te));return Rr}var Ce=z.from,ke=z.to,Ke=z.text,Et=lt(x,Ce.line),Pt=lt(x,ke.line),cn=Xt(Ke),rn=ie(Ke.length-1),Bn=ke.line-Ce.line;if(z.full)x.insert(0,ge(0,Ke.length)),x.remove(Ke.length,x.size-Ke.length);else if(Ku(x,z)){var nr=ge(0,Ke.length-1);de(Pt,Pt.text,rn),Bn&&x.remove(Ce.line,Bn),nr.length&&x.insert(Ce.line,nr)}else if(Et==Pt)if(Ke.length==1)de(Et,Et.text.slice(0,Ce.ch)+cn+Et.text.slice(ke.ch),rn);else{var xr=ge(1,Ke.length-1);xr.push(new mr(cn+Et.text.slice(ke.ch),rn,te)),de(Et,Et.text.slice(0,Ce.ch)+Ke[0],ie(0)),x.insert(Ce.line+1,xr)}else if(Ke.length==1)de(Et,Et.text.slice(0,Ce.ch)+Ke[0]+Pt.text.slice(ke.ch),ie(0)),x.remove(Ce.line+1,Bn);else{de(Et,Et.text.slice(0,Ce.ch)+Ke[0],ie(0)),de(Pt,cn+Pt.text.slice(ke.ch),rn);var Lr=ge(1,Ke.length-1);Bn>1&&x.remove(Ce.line+1,Bn-1),x.insert(Ce.line+1,Lr)}Ir(x,"change",x,z)}function ds(x,z,ne){function te(ie,de,ge){if(ie.linked)for(var Ce=0;Ce<ie.linked.length;++Ce){var ke=ie.linked[Ce];if(ke.doc!=de){var Ke=ge&&ke.sharedHist;ne&&!Ke||(z(ke.doc,Ke),te(ke.doc,ie,Ke))}}}te(x,null,!0)}function Yl(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||ir(x),x.options.mode=z.modeOption,Ha(x)}function Jl(x){(x.doc.direction=="rtl"?$t:Ve)(x.display.lineDiv,"CodeMirror-rtl")}function Fc(x){fa(x,function(){Jl(x),Ha(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:Dn(z.from),to:us(z),text:_t(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=Xt(x);if(z.ranges)x.pop();else break}}function Kc(x,z){if(z)return Hu(x.done),Xt(x.done);if(x.done.length&&!Xt(x.done).ranges)return Xt(x.done);if(x.done.length>1&&!x.done[x.done.length-2].ranges)return x.done.pop(),Xt(x.done)}function ec(x,z,ne,te){var ie=x.history;ie.undone.length=0;var de=+new Date,ge,Ce;if((ie.lastOp==te||ie.lastOrigin==z.origin&&z.origin&&(z.origin.charAt(0)=="+"&&ie.lastModTime>de-(x.cm?x.cm.options.historyEventDelay:500)||z.origin.charAt(0)=="*"))&&(ge=Kc(ie,ie.lastOp==te)))Ce=Xt(ge.changes),ln(z.from,z.to)==0&&ln(z.from,Ce.to)==0?Ce.to=us(z):ge.changes.push(zc(x,z));else{var ke=Xt(ie.done);for((!ke||!ke.ranges)&&tc(x.sel,ie.done),ge={changes:[zc(x,z)],generation:ie.generation},ie.done.push(ge);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=de,ie.lastOp=ie.lastSelOp=te,ie.lastOrigin=ie.lastSelOrigin=z.origin,Ce||mt(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,de=te&&te.origin;ne==ie.lastSelOp||de&&ie.lastSelOrigin==de&&(ie.lastModTime==ie.lastSelTime&&ie.lastOrigin==de||Hc(x,de,Xt(ie.done),z))?ie.done[ie.done.length-1]=z:tc(z,ie.done),ie.lastSelTime=+new Date,ie.lastSelOrigin=de,ie.lastSelOp=ne,te&&te.clearRedo!==!1&&Hu(ie.undone)}function tc(x,z){var ne=Xt(z);ne&&ne.ranges&&ne.equals(x)||z.push(x)}function Zc(x,z,ne,te){var ie=z["spans_"+x.id],de=0;x.iter(Math.max(x.first,ne),Math.min(x.first+x.size,te),function(ge){ge.markedSpans&&((ie||(ie=z["spans_"+x.id]={}))[de]=ge.markedSpans),++de})}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=yn(x,z);if(!ne)return te;if(!te)return ne;for(var ie=0;ie<ne.length;++ie){var de=ne[ie],ge=te[ie];if(de&&ge)e:for(var Ce=0;Ce<ge.length;++Ce){for(var ke=ge[Ce],Ke=0;Ke<de.length;++Ke)if(de[Ke].marker==ke.marker)continue e;de.push(ke)}else ge&&(ne[ie]=ge)}return ne}function ol(x,z,ne){for(var te=[],ie=0;ie<x.length;++ie){var de=x[ie];if(de.ranges){te.push(ne?go.prototype.deepCopy.call(de):de);continue}var ge=de.changes,Ce=[];te.push({changes:Ce});for(var ke=0;ke<ge.length;++ke){var Ke=ge[ke],Et=void 0;if(Ce.push({from:Ke.from,to:Ke.to,text:Ke.text}),z)for(var Pt in Ke)(Et=Pt.match(/^spans_(\d+)$/))&&xt(z,Number(Et[1]))>-1&&(Xt(Ce)[Pt]=Ke[Pt],delete Ke[Pt])}}return te}function Vc(x,z,ne,te){if(te){var ie=x.anchor;if(ne){var de=ln(z,ie)<0;de!=ln(ne,ie)<0?(ie=z,z=ne):de!=ln(z,ne)<0&&(z=ne)}return new Ki(ie,z)}else return new Ki(ne||z,z)}function sl(x,z,ne,te,ie){ie==null&&(ie=x.cm&&(x.cm.display.shift||x.extend)),Sa(x,new go([Vc(x.sel.primary(),z,ne,ie)],0),te)}function Fr(x,z,ne){for(var te=[],ie=x.cm&&(x.cm.display.shift||x.extend),de=0;de<x.sel.ranges.length;de++)te[de]=Vc(x.sel.ranges[de],z[de],null,ie);var ge=Io(x.cm,te,x.sel.primIndex);Sa(x,ge,ne)}function So(x,z,ne,te){var ie=x.sel.ranges.slice(0);ie[z]=ne,Sa(x,Io(x.cm,ie,x.sel.primIndex),te)}function Zu(x,z,ne,te){Sa(x,Ro(z,ne),te)}function qd(x,z,ne){var te={ranges:z.ranges,update:function(ie){this.ranges=[];for(var de=0;de<ie.length;de++)this.ranges[de]=new Ki(Sn(x,ie[de].anchor),Sn(x,ie[de].head))},origin:ne&&ne.origin};return mt(x,"beforeSelectionChange",x,te),x.cm&&mt(x.cm,"beforeSelectionChange",x.cm,te),te.ranges!=z.ranges?Io(x.cm,te.ranges,te.ranges.length-1):z}function io(x,z,ne){var te=x.history.done,ie=Xt(te);ie&&ie.ranges?(te[te.length-1]=z,nc(x,z,ne)):Sa(x,z,ne)}function Sa(x,z,ne){nc(x,z,ne),Wc(x,x.sel,x.cm?x.cm.curOp.id:NaN,ne)}function nc(x,z,ne){(mn(x,"beforeSelectionChange")||x.cm&&mn(x.cm,"beforeSelectionChange"))&&(z=qd(x,z,ne));var te=ne&&ne.bias||(ln(z.primary().head,x.sel.primary().head)<0?-1:1);Yd(x,ll(x,z,te,!0)),!(ne&&ne.scroll===!1)&&x.cm&&Qs(x.cm)}function Yd(x,z){z.equals(x.sel)||(x.sel=z,x.cm&&(x.cm.curOp.updateInput=1,x.cm.curOp.selectionChanged=!0,vn(x.cm)),Ir(x,"cursorActivity",x))}function Jd(x){Yd(x,ll(x,x.sel,null,!1))}function ll(x,z,ne,te){for(var ie,de=0;de<z.ranges.length;de++){var ge=z.ranges[de],Ce=z.ranges.length==x.sel.ranges.length&&x.sel.ranges[de],ke=Gc(x,ge.anchor,Ce&&Ce.anchor,ne,te),Ke=Gc(x,ge.head,Ce&&Ce.head,ne,te);(ie||ke!=ge.anchor||Ke!=ge.head)&&(ie||(ie=z.ranges.slice(0,de)),ie[de]=new Ki(ke,Ke))}return ie?Io(x.cm,ie,z.primIndex):z}function ao(x,z,ne,te,ie){var de=lt(x,z.line);if(de.markedSpans)for(var ge=0;ge<de.markedSpans.length;++ge){var Ce=de.markedSpans[ge],ke=Ce.marker,Ke="selectLeft"in ke?!ke.selectLeft:ke.inclusiveLeft,Et="selectRight"in ke?!ke.selectRight:ke.inclusiveRight;if((Ce.from==null||(Ke?Ce.from<=z.ch:Ce.from<z.ch))&&(Ce.to==null||(Et?Ce.to>=z.ch:Ce.to>z.ch))){if(ie&&(mt(ke,"beforeCursorEnter"),ke.explicitlyCleared))if(de.markedSpans){--ge;continue}else break;if(!ke.atomic)continue;if(ne){var Pt=ke.find(te<0?1:-1),cn=void 0;if((te<0?Et:Ke)&&(Pt=hs(x,Pt,-te,Pt&&Pt.line==z.line?de:null)),Pt&&Pt.line==z.line&&(cn=ln(Pt,ne))&&(te<0?cn<0:cn>0))return ao(x,Pt,z,te,ie)}var rn=ke.find(te<0?-1:1);return(te<0?Ke:Et)&&(rn=hs(x,rn,te,rn.line==z.line?de:null)),rn?ao(x,rn,z,te,ie):null}}return z}function Gc(x,z,ne,te,ie){var de=te||1,ge=ao(x,z,ne,de,ie)||!ie&&ao(x,z,ne,de,!0)||ao(x,z,ne,-de,ie)||!ie&&ao(x,z,ne,-de,!0);return ge||(x.cantEdit=!0,zt(x.first,0))}function hs(x,z,ne,te){return ne<0&&z.ch==0?z.line>x.first?Sn(x,zt(z.line-1)):null:ne>0&&z.ch==(te||lt(x,z.line)).text.length?z.line<x.first+x.size-1?zt(z.line+1,0):null:new zt(z.line,z.ch+ne)}function ju(x){x.setSelection(zt(x.firstLine(),0),zt(x.lastLine()),qe)}function Uc(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,de,ge,Ce){ie&&(te.from=Sn(x,ie)),de&&(te.to=Sn(x,de)),ge&&(te.text=ge),Ce!==void 0&&(te.origin=Ce)}),mt(x,"beforeChange",x,te),x.cm&&mt(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 As(x,z,ne){if(x.cm){if(!x.cm.curOp)return wa(x.cm,As)(x,z,ne);if(x.cm.state.suppressEdits)return}if(!((mn(x,"beforeChange")||x.cm&&mn(x.cm,"beforeChange"))&&(z=Uc(x,z,!0),!z))){var te=_n&&!ne&&En(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]==""&&ln(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,yn(x,z));var te=[];ds(x,function(ie,de){!de&&xt(te,ie.history)==-1&&(rc(ie.history,z),te.push(ie.history)),cl(ie,z,null,yn(ie,z))})}}function fs(x,z,ne){var te=x.cm&&x.cm.state.suppressEdits;if(!(te&&!ne)){for(var ie=x.history,de,ge=x.sel,Ce=z=="undo"?ie.done:ie.undone,ke=z=="undo"?ie.undone:ie.done,Ke=0;Ke<Ce.length&&(de=Ce[Ke],!(ne?de.ranges&&!de.equals(x.sel):!de.ranges));Ke++);if(Ke!=Ce.length){for(ie.lastOrigin=ie.lastSelOrigin=null;;)if(de=Ce.pop(),de.ranges){if(tc(de,ke),ne&&!de.equals(x.sel)){Sa(x,de,{clearRedo:!1});return}ge=de}else if(te){Ce.push(de);return}else break;var Et=[];tc(ge,ke),ke.push({changes:Et,generation:ie.generation}),ie.generation=de.generation||++ie.maxGeneration;for(var Pt=mn(x,"beforeChange")||x.cm&&mn(x.cm,"beforeChange"),cn=function(nr){var xr=de.changes[nr];if(xr.origin=z,Pt&&!Uc(x,xr,!1))return Ce.length=0,{};Et.push(zc(x,xr));var Lr=nr?Oc(x,xr):Xt(Ce);cl(x,xr,Lr,Wu(x,xr)),!nr&&x.cm&&x.cm.scrollIntoView({from:xr.from,to:us(xr)});var Pr=[];ds(x,function(Mr,Rr){!Rr&&xt(Pr,Mr.history)==-1&&(rc(Mr.history,xr),Pr.push(Mr.history)),cl(Mr,xr,null,Wu(Mr,xr))})},rn=de.changes.length-1;rn>=0;--rn){var Bn=cn(rn);if(Bn)return Bn.v}}}}function Xc(x,z){if(z!=0&&(x.first+=z,x.sel=new go(Ut(x.sel.ranges,function(ie){return new Ki(zt(ie.anchor.line+z,ie.anchor.ch),zt(ie.head.line+z,ie.head.ch))}),x.sel.primIndex),x.cm)){Ha(x.cm,x.first,x.first-z,z);for(var ne=x.cm.display,te=ne.viewFrom;te<ne.viewTo;te++)Bo(x.cm,te,"gutter")}}function cl(x,z,ne,te){if(x.cm&&!x.cm.curOp)return wa(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:zt(x.first,0),to:zt(z.to.line+ie,z.to.ch),text:[Xt(z.text)],origin:z.origin}}var de=x.lastLine();z.to.line>de&&(z={from:z.from,to:zt(de,lt(x,de).text.length),text:[z.text[0]],origin:z.origin}),z.removed=_t(x,z.from,z.to),ne||(ne=Oc(x,z)),x.cm?Qd(x.cm,z,te):Rc(x,z,te),nc(x,ne,qe),x.cantEdit&&Gc(x,zt(x.firstLine(),0))&&(x.cantEdit=!1)}}function Qd(x,z,ne){var te=x.doc,ie=x.display,de=z.from,ge=z.to,Ce=!1,ke=de.line;x.options.lineWrapping||(ke=Jt(sr(lt(te,de.line))),te.iter(ke,ge.line+1,function(rn){if(rn==ie.maxLine)return Ce=!0,!0})),te.sel.contains(z.from,z.to)>-1&&vn(x),Rc(te,z,ne,Ja(x)),x.options.lineWrapping||(te.iter(ke,de.line+z.text.length,function(rn){var Bn=or(rn);Bn>ie.maxLineLength&&(ie.maxLine=rn,ie.maxLineLength=Bn,ie.maxLineChanged=!0,Ce=!1)}),Ce&&(x.curOp.updateMaxLine=!0)),Nn(te,de.line),nl(x,400);var Ke=z.text.length-(ge.line-de.line)-1;z.full?Ha(x):de.line==ge.line&&z.text.length==1&&!Ku(x.doc,z)?Bo(x,de.line,"text"):Ha(x,de.line,ge.line+1,Ke);var Et=mn(x,"changes"),Pt=mn(x,"change");if(Pt||Et){var cn={from:de,to:ge,text:z.text,removed:z.removed,origin:z.origin};Pt&&Ir(x,"change",x,cn),Et&&(x.curOp.changeObjs||(x.curOp.changeObjs=[])).push(cn)}x.display.selForContextMenu=null}function _l(x,z,ne,te,ie){var de;te||(te=ne),ln(te,ne)<0&&(de=[te,ne],ne=de[0],te=de[1]),typeof z=="string"&&(z=x.splitLines(z)),As(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 de=x[ie],ge=!0;if(de.ranges){de.copied||(de=x[ie]=de.deepCopy(),de.copied=!0);for(var Ce=0;Ce<de.ranges.length;Ce++)eh(de.ranges[Ce].anchor,z,ne,te),eh(de.ranges[Ce].head,z,ne,te);continue}for(var ke=0;ke<de.changes.length;++ke){var Ke=de.changes[ke];if(ne<Ke.from.line)Ke.from=zt(Ke.from.line+te,Ke.from.ch),Ke.to=zt(Ke.to.line+te,Ke.to.ch);else if(z<=Ke.to.line){ge=!1;break}}ge||(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,de=z;return typeof z=="number"?de=lt(x,yr(x,z)):ie=Jt(z),ie==null?null:(te(de,ie)&&x.cm&&Bo(x.cm,ie,ne),de)}function Ds(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}Ds.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,pi(ie),Ir(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 El(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}El.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 de=Math.min(z,ie-x),ge=te.height;if(te.removeInner(x,de),this.height-=ge-te.height,ie==de&&(this.children.splice(ne--,1),te.parent=null),(z-=de)==0)break;x=0}else x-=ie}if(this.size-z<25&&(this.children.length>1||!(this.children[0]instanceof Ds))){var Ce=[];this.collapse(Ce),this.children=[new Ds(Ce)],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],de=ie.chunkSize();if(x<=de){if(ie.insertInner(x,z,ne),ie.lines&&ie.lines.length>50){for(var ge=ie.lines.length%25+25,Ce=ge;Ce<ie.lines.length;){var ke=new Ds(ie.lines.slice(Ce,Ce+=25));ie.height-=ke.height,this.children.splice(++te,0,ke),ke.parent=this}ie.lines=ie.lines.slice(0,ge),this.maybeSpill()}break}x-=de}},maybeSpill:function(){if(!(this.children.length<=10)){var x=this;do{var z=x.children.splice(x.children.length-5,5),ne=new El(z);if(x.parent){x.size-=ne.size,x.height-=ne.height;var ie=xt(x.parent.children,x);x.parent.children.splice(ie+1,0,ne)}else{var te=new El(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],de=ie.chunkSize();if(x<de){var ge=Math.min(z,de-x);if(ie.iterN(x,ge,ne))return!0;if((z-=ge)==0)break;x=0}else x-=de}}};var Ml=function(x,z,ne){if(ne)for(var te in ne)ne.hasOwnProperty(te)&&(this[te]=ne[te]);this.doc=x,this.node=z};Ml.prototype.clear=function(){var x=this.doc.cm,z=this.line.widgets,ne=this.line,te=Jt(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 de=Fa(this);Kt(ne,Math.max(0,ne.height-de)),x&&(fa(x,function(){nh(x,ne,-de),Bo(x,te,"widget")}),Ir(x,"lineWidgetCleared",x,this,te))}},Ml.prototype.changed=function(){var x=this,z=this.height,ne=this.doc.cm,te=this.line;this.height=null;var ie=Fa(this)-z;ie&&(fi(this.doc,te)||Kt(te,te.height+ie),ne&&fa(ne,function(){ne.curOp.forceUpdate=!0,nh(ne,te,ie),Ir(ne,"lineWidgetChanged",ne,x,Jt(te))}))},wn(Ml);function nh(x,z,ne){lr(z)<(x.curOp&&x.curOp.scrollTop||x.doc.scrollTop)&&Lc(x,ne)}function rh(x,z,ne,te){var ie=new Ml(x,ne,te),de=x.cm;return de&&ie.noHScroll&&(de.display.alignWidgets=!0),ic(x,z,"widget",function(ge){var Ce=ge.widgets||(ge.widgets=[]);if(ie.insertAt==null?Ce.push(ie):Ce.splice(Math.min(Ce.length-1,Math.max(0,ie.insertAt)),0,ie),ie.line=ge,de&&!fi(x,ge)){var ke=lr(ge)<x.scrollTop;Kt(ge,ge.height+Fa(ie)),ke&&Lc(de,ie.height),de.curOp.forceUpdate=!0}return!0}),de&&Ir(de,"lineWidgetAdded",de,ie,typeof z=="number"?z:Jt(z)),ie}var ih=0,Bs=function(x,z){this.lines=[],this.type=z,this.doc=x,this.id=++ih};Bs.prototype.clear=function(){if(!this.explicitlyCleared){var x=this.doc.cm,z=x&&!x.curOp;if(z&&Ls(x),mn(this,"clear")){var ne=this.find();ne&&Ir(this,"clear",ne.from,ne.to)}for(var te=null,ie=null,de=0;de<this.lines.length;++de){var ge=this.lines[de],Ce=cr(ge.markedSpans,this);x&&!this.collapsed?Bo(x,Jt(ge),"text"):x&&(Ce.to!=null&&(ie=Jt(ge)),Ce.from!=null&&(te=Jt(ge))),ge.markedSpans=qn(ge.markedSpans,Ce),Ce.from==null&&this.collapsed&&!fi(this.doc,ge)&&x&&Kt(ge,as(x.display))}if(x&&this.collapsed&&!x.options.lineWrapping)for(var ke=0;ke<this.lines.length;++ke){var Ke=sr(this.lines[ke]),Et=or(Ke);Et>x.display.maxLineLength&&(x.display.maxLine=Ke,x.display.maxLineLength=Et,x.display.maxLineChanged=!0)}te!=null&&x&&this.collapsed&&Ha(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&&Ir(x,"markerCleared",x,this,te,ie),z&&cs(x),this.parent&&this.parent.clear()}},Bs.prototype.find=function(x,z){x==null&&this.type=="bookmark"&&(x=1);for(var ne,te,ie=0;ie<this.lines.length;++ie){var de=this.lines[ie],ge=cr(de.markedSpans,this);if(ge.from!=null&&(ne=zt(z?de:Jt(de),ge.from),x==-1))return ne;if(ge.to!=null&&(te=zt(z?de:Jt(de),ge.to),x==1))return te}return ne&&{from:ne,to:te}},Bs.prototype.changed=function(){var x=this,z=this.find(-1,!0),ne=this,te=this.doc.cm;!z||!te||fa(te,function(){var ie=z.line,de=Jt(z.line),ge=Ya(te,de);if(ge&&(Wi(ge),te.curOp.selectionChanged=te.curOp.forceUpdate=!0),te.curOp.updateMaxLine=!0,!fi(ne.doc,ie)&&ne.height!=null){var Ce=ne.height;ne.height=null;var ke=Fa(ne)-Ce;ke&&Kt(ie,ie.height+ke)}Ir(te,"markerChanged",te,x)})},Bs.prototype.attachLine=function(x){if(!this.lines.length&&this.doc.cm){var z=this.doc.cm.curOp;(!z.maybeHiddenMarkers||xt(z.maybeHiddenMarkers,this)==-1)&&(z.maybeUnhiddenMarkers||(z.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(x)},Bs.prototype.detachLine=function(x){if(this.lines.splice(xt(this.lines,x),1),!this.lines.length&&this.doc.cm){var z=this.doc.cm.curOp;(z.maybeHiddenMarkers||(z.maybeHiddenMarkers=[])).push(this)}},wn(Bs);function ps(x,z,ne,te,ie){if(te&&te.shared)return na(x,z,ne,te,ie);if(x.cm&&!x.cm.curOp)return wa(x.cm,ps)(x,z,ne,te,ie);var de=new Bs(x,ie),ge=ln(z,ne);if(te&&wt(te,de,!1),ge>0||ge==0&&de.clearWhenEmpty!==!1)return de;if(de.replacedWith&&(de.collapsed=!0,de.widgetNode=Dt("span",[de.replacedWith],"CodeMirror-widget"),te.handleMouseEvents||de.widgetNode.setAttribute("cm-ignore-events","true"),te.insertLeft&&(de.widgetNode.insertLeft=!0)),de.collapsed){if(Gn(x,z.line,z,ne,de)||z.line!=ne.line&&Gn(x,ne.line,z,ne,de))throw new Error("Inserting collapsed marker partially overlapping an existing one");In()}de.addToHistory&&ec(x,{from:z,to:ne,origin:"markText"},x.sel,NaN);var Ce=z.line,ke=x.cm,Ke;if(x.iter(Ce,ne.line+1,function(Pt){ke&&de.collapsed&&!ke.options.lineWrapping&&sr(Pt)==ke.display.maxLine&&(Ke=!0),de.collapsed&&Ce!=z.line&&Kt(Pt,0),br(Pt,new zn(de,Ce==z.line?z.ch:null,Ce==ne.line?ne.ch:null)),++Ce}),de.collapsed&&x.iter(z.line,ne.line+1,function(Pt){fi(x,Pt)&&Kt(Pt,0)}),de.clearOnEnter&&qt(de,"beforeCursorEnter",function(){return de.clear()}),de.readOnly&&(Xn(),(x.history.done.length||x.history.undone.length)&&x.clearHistory()),de.collapsed&&(de.id=++ih,de.atomic=!0),ke){if(Ke&&(ke.curOp.updateMaxLine=!0),de.collapsed)Ha(ke,z.line,ne.line+1);else if(de.className||de.startStyle||de.endStyle||de.css||de.attributes||de.title)for(var Et=z.line;Et<=ne.line;Et++)Bo(ke,Et,"text");de.atomic&&Jd(ke.doc),Ir(ke,"markerAdded",ke,de)}return de}var bi=function(x,z){this.markers=x,this.primary=z;for(var ne=0;ne<x.length;++ne)x[ne].parent=this};bi.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var x=0;x<this.markers.length;++x)this.markers[x].clear();Ir(this,"clear")}},bi.prototype.find=function(x,z){return this.primary.find(x,z)},wn(bi);function na(x,z,ne,te,ie){te=wt(te),te.shared=!1;var de=[ps(x,z,ne,te,ie)],ge=de[0],Ce=te.widgetNode;return ds(x,function(ke){Ce&&(te.widgetNode=Ce.cloneNode(!0)),de.push(ps(ke,Sn(ke,z),Sn(ke,ne),te,ie));for(var Ke=0;Ke<ke.linked.length;++Ke)if(ke.linked[Ke].isParent)return;ge=Xt(de)}),new bi(de,ge)}function Ts(x){return x.findMarks(zt(x.first,0),x.clipPos(zt(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(),de=x.clipPos(ie.from),ge=x.clipPos(ie.to);if(ln(de,ge)){var Ce=ps(x,de,ge,te.primary,te.primary.type);te.markers.push(Ce),Ce.parent=te}}}function Co(x){for(var z=function(te){var ie=x[te],de=[ie.primary.doc];ds(ie.primary.doc,function(ke){return de.push(ke)});for(var ge=0;ge<ie.markers.length;ge++){var Ce=ie.markers[ge];xt(de,Ce.doc)==-1&&(Ce.parent=null,ie.markers.splice(ge--,1))}},ne=0;ne<x.length;ne++)z(ne)}var oh=0,va=function(x,z,ne,te,ie){if(!(this instanceof va))return new va(x,z,ne,te,ie);ne==null&&(ne=0),El.call(this,[new Ds([new mr("",null)])]),this.first=ne,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=ne;var de=zt(ne,0);this.sel=Ro(de),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)),Rc(this,{from:de,to:de,text:x}),Sa(this,Ro(de),qe)};va.prototype=le(El.prototype,{constructor:va,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=Yt(this,this.first,this.first+this.size);return x===!1?z:z.join(x||this.lineSeparator())},setValue:Ba(function(x){var z=zt(this.first,0),ne=this.first+this.size-1;As(this,{from:z,to:zt(ne,lt(this,ne).text.length),text:this.splitLines(x),origin:"setValue",full:!0},!0),this.cm&&el(this.cm,0,0),Sa(this,Ro(z),qe)}),replaceRange:function(x,z,ne,te){z=Sn(this,z),ne=ne?Sn(this,ne):z,_l(this,x,z,ne,te)},getRange:function(x,z,ne){var te=_t(this,Sn(this,x),Sn(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(fn(this,x))return lt(this,x)},getLineNumber:function(x){return Jt(x)},getLineHandleVisualStart:function(x){return typeof x=="number"&&(x=lt(this,x)),sr(x)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(x){return Sn(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:Ba(function(x,z,ne){Zu(this,Sn(this,typeof x=="number"?zt(x,z||0):x),null,ne)}),setSelection:Ba(function(x,z,ne){Zu(this,Sn(this,x),Sn(this,z||x),ne)}),extendSelection:Ba(function(x,z,ne){sl(this,Sn(this,x),z&&Sn(this,z),ne)}),extendSelections:Ba(function(x,z){Fr(this,ht(this,x),z)}),extendSelectionsBy:Ba(function(x,z){var ne=Ut(this.sel.ranges,x);Fr(this,ht(this,ne),z)}),setSelections:Ba(function(x,z,ne){if(x.length){for(var te=[],ie=0;ie<x.length;ie++)te[ie]=new Ki(Sn(this,x[ie].anchor),Sn(this,x[ie].head));z==null&&(z=Math.min(x.length-1,this.sel.primIndex)),Sa(this,Io(this.cm,te,z),ne)}}),addSelection:Ba(function(x,z,ne){var te=this.sel.ranges.slice(0);te.push(new Ki(Sn(this,x),Sn(this,z||x))),Sa(this,Io(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=_t(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=_t(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:Ba(function(x,z,ne){for(var te=[],ie=this.sel,de=0;de<ie.ranges.length;de++){var ge=ie.ranges[de];te[de]={from:ge.from(),to:ge.to(),text:this.splitLines(x[de]),origin:ne}}for(var Ce=z&&z!="end"&&$c(this,te,z),ke=te.length-1;ke>=0;ke--)As(this,te[ke]);Ce?io(this,Ce):this.cm&&Qs(this.cm)}),undo:Ba(function(){fs(this,"undo")}),redo:Ba(function(){fs(this,"redo")}),undoSelection:Ba(function(){fs(this,"undo",!0)}),redoSelection:Ba(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:Ba(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:Ba(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(!fn(this,x)||(z=x,x=lt(this,x),!x))return null}else if(z=Jt(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:Ba(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:Ba(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",de=te[ie];if(de)if(ne==null)te[ie]=null;else{var ge=de.match(Ee(ne));if(!ge)return!1;var Ce=ge.index+ge[0].length;te[ie]=de.slice(0,ge.index)+(!ge.index||Ce==de.length?"":" ")+de.slice(Ce)||null}else return!1;return!0})}),addLineWidget:Ba(function(x,z,ne){return rh(this,x,z,ne)}),removeLineWidget:function(x){x.clear()},markText:function(x,z,ne){return ps(this,Sn(this,x),Sn(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=Sn(this,x),ps(this,x,x,ne,"bookmark")},findMarksAt:function(x){x=Sn(this,x);var z=[],ne=lt(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=Sn(this,x),z=Sn(this,z);var te=[],ie=x.line;return this.iter(x.line,z.line+1,function(de){var ge=de.markedSpans;if(ge)for(var Ce=0;Ce<ge.length;Ce++){var ke=ge[Ce];!(ke.to!=null&&ie==x.line&&x.ch>=ke.to||ke.from==null&&ie!=x.line||ke.from!=null&&ie==z.line&&ke.from>=z.ch)&&(!ne||ne(ke.marker))&&te.push(ke.marker.parent||ke.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 de=ie.text.length+te;if(de>x)return z=x,!0;x-=de,++ne}),Sn(this,zt(ne,z))},indexFromPos:function(x){x=Sn(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 va(Yt(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 va(Yt(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,Ts(this)),te},unlinkDoc:function(x){if(x instanceof oi&&(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(Ts(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):Gr(x)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Ba(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))})}),va.prototype.eachLine=va.prototype.iter;var Gu=0;function Qh(x){var z=this;if(kl(z),!(Nt(z,x)||za(z.display,x))){Tn(x),xe&&(Gu=+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,de=Array(ie),ge=0,Ce=function(){++ge==ie&&wa(z,function(){ne=Sn(z.doc,ne);var rn={from:ne,to:ne,text:z.doc.splitLines(de.filter(function(Bn){return Bn!=null}).join(z.doc.lineSeparator())),origin:"paste"};As(z.doc,rn),io(z.doc,Ro(Sn(z.doc,ne),Sn(z.doc,us(rn))))})()},ke=function(rn,Bn){if(z.options.allowDropFileTypes&&xt(z.options.allowDropFileTypes,rn.type)==-1){Ce();return}var nr=new FileReader;nr.onerror=function(){return Ce()},nr.onload=function(){var xr=nr.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(xr)){Ce();return}de[Bn]=xr,Ce()},nr.readAsText(rn)},Ke=0;Ke<te.length;Ke++)ke(te[Ke],Ke);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 Et=x.dataTransfer.getData("Text");if(Et){var Pt;if(z.state.draggingText&&!z.state.draggingText.copy&&(Pt=z.listSelections()),nc(z.doc,Ro(ne,ne)),Pt)for(var cn=0;cn<Pt.length;++cn)_l(z.doc,"",Pt[cn].anchor,Pt[cn].head,"drag");z.replaceSelection(Et,"around","paste"),z.display.input.focus()}}catch(rn){}}}}function ef(x,z){if(xe&&(!x.state.draggingText||+new Date-Gu<100)){wr(z);return}if(!(Nt(x,z)||za(x.display,z))&&(z.dataTransfer.setData("Text",x.getSelection()),z.dataTransfer.effectAllowed="copyMove",z.dataTransfer.setDragImage&&!dt)){var ne=et("img",null,null,"position: fixed; left: 0; top: 0;");ne.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Re&&(ne.width=ne.height=1,x.display.wrapper.appendChild(ne),ne._top=ne.offsetTop),z.dataTransfer.setDragImage(ne,0,0),Re&&ne.parentNode.removeChild(ne)}}function Uu(x,z){var ne=xo(x,z);if(ne){var te=document.createDocumentFragment();Mu(x,ne,te),x.display.dragCursor||(x.display.dragCursor=et("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),x.display.lineSpace.insertBefore(x.display.dragCursor,x.display.cursorDiv)),Lt(x.display.dragCursor,te)}}function kl(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 de=0;de<ne.length;de++)x(ne[de])})}}var fr=!1;function Xu(){fr||(qc(),fr=!0)}function qc(){var x;qt(window,"resize",function(){x==null&&(x=setTimeout(function(){x=null,Ll(Yc)},100))}),qt(window,"blur",function(){return Ll(Js)})}function Yc(x){var z=x.display;z.cachedCharWidth=z.cachedTextHeight=z.cachedPaddingH=null,z.scrollbarsClipped=!1,x.setSize()}for(var Fo={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++)Fo[ac+48]=Fo[ac+96]=String(ac);for(var Jc=65;Jc<=90;Jc++)Fo[Jc]=String.fromCharCode(Jc);for(var oc=1;oc<=12;oc++)Fo[oc+111]=Fo[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=at?Yi.macDefault:Yi.pcDefault;function tf(x){var z=x.split(/-(?!$)/);x=z[z.length-1];for(var ne,te,ie,de,ge=0;ge<z.length-1;ge++){var Ce=z[ge];if(/^(cmd|meta|m)$/i.test(Ce))de=!0;else if(/^a(lt)?$/i.test(Ce))ne=!0;else if(/^(c|ctrl|control)$/i.test(Ce))te=!0;else if(/^s(hift)?$/i.test(Ce))ie=!0;else throw new Error("Unrecognized modifier name: "+Ce)}return ne&&(x="Alt-"+x),te&&(x="Ctrl-"+x),de&&(x="Cmd-"+x),ie&&(x="Shift-"+x),x}function qu(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=Ut(ne.split(" "),tf),de=0;de<ie.length;de++){var ge=void 0,Ce=void 0;de==ie.length-1?(Ce=ie.join(" "),ge=te):(Ce=ie.slice(0,de+1).join(" "),ge="...");var ke=z[Ce];if(!ke)z[Ce]=ge;else if(ke!=ge)throw new Error("Inconsistent bindings for "+Ce)}delete x[ne]}for(var Ke in z)x[Ke]=z[Ke];return x}function ms(x,z,ne,te){z=oo(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 de=0;de<z.fallthrough.length;de++){var ge=ms(x,z.fallthrough[de],ne,te);if(ge)return ge}}}function sc(x){var z=typeof x=="string"?x:Fo[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),(vt?z.metaKey:z.ctrlKey)&&te!="Ctrl"&&(x="Ctrl-"+x),(vt?z.ctrlKey:z.metaKey)&&te!="Mod"&&(x="Cmd-"+x),!ne&&z.shiftKey&&te!="Shift"&&(x="Shift-"+x),x}function ul(x,z){if(Re&&x.keyCode==34&&x.char)return!1;var ne=Fo[x.keyCode];return ne==null||x.altGraphKey?!1:(x.keyCode==3&&x.code&&(ne=x.code),Is(ne,x,z))}function oo(x){return typeof x=="string"?Yi[x]:x}function Po(x,z){for(var ne=x.doc.sel.ranges,te=[],ie=0;ie<ne.length;ie++){for(var de=z(ne[ie]);te.length&&ln(de.from,Xt(te).to)<=0;){var ge=te.pop();if(ln(ge.from,de.from)<0){de.from=ge.from;break}}te.push(de)}fa(x,function(){for(var Ce=te.length-1;Ce>=0;Ce--)_l(x.doc,"",te[Ce].from,te[Ce].to,"+delete");Qs(x)})}function Za(x,z,ne){var te=Pe(x.text,z+ne,ne);return te<0||te>x.text.length?null:te}function Uo(x,z,ne){var te=Za(x,z.ch,ne);return te==null?null:new zt(z.line,te,ne<0?"after":"before")}function dl(x,z,ne,te,ie){if(x){z.doc.direction=="rtl"&&(ie=-ie);var de=sn(ne,z.doc.direction);if(de){var ge=ie<0?Xt(de):de[0],Ce=ie<0==(ge.level==1),ke=Ce?"after":"before",Ke;if(ge.level>0||z.doc.direction=="rtl"){var Et=Oa(z,ne);Ke=ie<0?ne.text.length-1:0;var Pt=$i(z,Et,Ke).top;Ke=je(function(cn){return $i(z,Et,cn).top==Pt},ie<0==(ge.level==1)?ge.from:ge.to-1,Ke),ke=="before"&&(Ke=Za(ne,Ke,1))}else Ke=ie<0?ge.to:ge.from;return new zt(te,Ke,ke)}}return new zt(te,ie<0?ne.text.length:0,ie<0?"before":"after")}function Xo(x,z,ne,te){var ie=sn(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 de=rt(ie,ne.ch,ne.sticky),ge=ie[de];if(x.doc.direction=="ltr"&&ge.level%2==0&&(te>0?ge.to>ne.ch:ge.from<ne.ch))return Uo(z,ne,te);var Ce=function(Lr,Pr){return Za(z,Lr instanceof zt?Lr.ch:Lr,Pr)},ke,Ke=function(Lr){return x.options.lineWrapping?(ke=ke||Oa(x,z),Hl(x,z,ke,Lr)):{begin:0,end:z.text.length}},Et=Ke(ne.sticky=="before"?Ce(ne,-1):ne.ch);if(x.doc.direction=="rtl"||ge.level==1){var Pt=ge.level==1==te<0,cn=Ce(ne,Pt?1:-1);if(cn!=null&&(Pt?cn<=ge.to&&cn<=Et.end:cn>=ge.from&&cn>=Et.begin)){var rn=Pt?"before":"after";return new zt(ne.line,cn,rn)}}var Bn=function(Lr,Pr,Mr){for(var Rr=function(Qi,Ra){return Ra?new zt(ne.line,Ce(Qi,1),"before"):new zt(ne.line,Qi,"after")};Lr>=0&&Lr<ie.length;Lr+=Pr){var Jr=ie[Lr],Qr=Pr>0==(Jr.level!=1),xi=Qr?Mr.begin:Ce(Mr.end,-1);if(Jr.from<=xi&&xi<Jr.to||(xi=Qr?Jr.from:Ce(Jr.to,-1),Mr.begin<=xi&&xi<Mr.end))return Rr(xi,Qr)}},nr=Bn(de+te,te,Et);if(nr)return nr;var xr=te>0?Et.end:Ce(Et.begin,-1);return xr!=null&&!(te>0&&xr==z.text.length)&&(nr=Bn(te>0?0:ie.length-1,te,Ke(xr)),nr)?nr:null}var Al={selectAll:ju,singleSelection:function(x){return x.setSelection(x.getCursor("anchor"),x.getCursor("head"),qe)},killLine:function(x){return Po(x,function(z){if(z.empty()){var ne=lt(x.doc,z.head.line).text.length;return z.head.ch==ne&&z.head.line<x.lastLine()?{from:z.head,to:zt(z.head.line+1,0)}:{from:z.head,to:zt(z.head.line,ne)}}else return{from:z.from(),to:z.to()}})},deleteLine:function(x){return Po(x,function(z){return{from:zt(z.from().line,0),to:Sn(x.doc,zt(z.to().line+1,0))}})},delLineLeft:function(x){return Po(x,function(z){return{from:zt(z.from().line,0),to:z.from()}})},delWrappedLineLeft:function(x){return Po(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 Po(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(zt(x.firstLine(),0))},goDocEnd:function(x){return x.extendSelection(zt(x.lastLine()))},goLineStart:function(x){return x.extendSelectionsBy(function(z){return Yu(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")},Ot)},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")},Ot)},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},Ot)},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 de=ne[ie].from(),ge=Ne(x.getLine(de.line),de.ch,te);z.push(on(te-ge%te))}x.replaceSelections(z)},defaultTab:function(x){x.somethingSelected()?x.indentSelection("add"):x.execCommand("insertTab")},transposeChars:function(x){return fa(x,function(){for(var z=x.listSelections(),ne=[],te=0;te<z.length;te++)if(z[te].empty()){var ie=z[te].head,de=lt(x.doc,ie.line).text;if(de){if(ie.ch==de.length&&(ie=new zt(ie.line,ie.ch-1)),ie.ch>0)ie=new zt(ie.line,ie.ch+1),x.replaceRange(de.charAt(ie.ch-1)+de.charAt(ie.ch-2),zt(ie.line,ie.ch-2),ie,"+transpose");else if(ie.line>x.doc.first){var ge=lt(x.doc,ie.line-1).text;ge&&(ie=new zt(ie.line,1),x.replaceRange(de.charAt(0)+x.doc.lineSeparator()+ge.charAt(ge.length-1),zt(ie.line-1,ge.length-1),ie,"+transpose"))}}ne.push(new Ki(ie,ie))}x.setSelections(ne)})},newlineAndIndent:function(x){return fa(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 Yu(x,z){var ne=lt(x.doc,z),te=sr(ne);return te!=ne&&(z=Jt(te)),dl(!0,x,te,z,1)}function Ju(x,z){var ne=lt(x.doc,z),te=Wr(ne);return te!=ne&&(z=Jt(te)),dl(!0,x,ne,z,-1)}function sh(x,z){var ne=Yu(x,z.line),te=lt(x.doc,ne.line),ie=sn(te,x.doc.direction);if(!ie||ie[0].level==0){var de=Math.max(ne.ch,te.text.search(/\S/)),ge=z.line==ne.line&&z.ch<=de&&z.ch;return zt(ne.line,ge?0:de,ne.sticky)}return ne}function Ca(x,z,ne){if(typeof z=="string"&&(z=Al[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)!=Vt}finally{x.display.shift=te,x.state.suppressEdits=!1}return ie}function qo(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 be;function Dl(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=qo(x,z,te);return ie=="multi"&&(x.state.keySeq=z),ie=="handled"&&Ir(x,"keyHandled",x,z,ne),(ie=="handled"||ie=="multi")&&(Tn(ne),Mc(x)),!!ie}function Ei(x,z){var ne=ul(z,!0);return ne?z.shiftKey&&!x.state.keySeq?Dl(x,"Shift-"+ne,z,function(te){return Ca(x,te,!0)})||Dl(x,ne,z,function(te){if(typeof te=="string"?/^go[A-Z]/.test(te):te.motion)return Ca(x,te)}):Dl(x,ne,z,function(te){return Ca(x,te)}):!1}function Bl(x,z,ne){return Dl(x,"'"+ne+"'",z,function(te){return Ca(x,te,!0)})}var gs=null;function lc(x){var z=this;if(!(x.target&&x.target!=z.display.input.getField())&&(z.curOp.focus=tt(),!Nt(z,x))){xe&&Me<11&&x.keyCode==27&&(x.returnValue=!1);var ne=x.keyCode;z.display.shift=ne==16||x.shiftKey;var te=Ei(z,x);Re&&(gs=te?ne:null,!te&&ne==88&&!$r&&(at?x.metaKey:x.ctrlKey)&&z.replaceSelection("",null,"cut")),se&&!at&&!te&&ne==46&&x.shiftKey&&!x.ctrlKey&&document.execCommand&&document.execCommand("cut"),ne==18&&!/\bCodeMirror-crosshair\b/.test(z.display.lineDiv.className)&&An(z)}}function An(x){var z=x.display.lineDiv;$t(z,"CodeMirror-crosshair");function ne(te){(te.keyCode==18||!te.altKey)&&(Ve(z,"CodeMirror-crosshair"),Qe(document,"keyup",ne),Qe(document,"mouseover",ne))}qt(document,"keyup",ne),qt(document,"mouseover",ne)}function lh(x){x.keyCode==16&&(this.doc.sel.shift=!1),Nt(this,x)}function ch(x){var z=this;if(!(x.target&&x.target!=z.display.input.getField())&&!(za(z.display,x)||Nt(z,x)||x.ctrlKey&&!x.altKey||at&&x.metaKey)){var ne=x.keyCode,te=x.charCode;if(Re&&ne==gs){gs=null,Tn(x);return}if(!(Re&&(!x.which||x.which<10)&&Ei(z,x))){var ie=String.fromCharCode(te==null?ne:te);ie!="\b"&&(Bl(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&&ln(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 ja(x){var z=this,ne=z.display;if(!(Nt(z,x)||ne.activeTouch&&ne.input.supportsTouch())){if(ne.input.ensurePolled(),ne.shift=x.shiftKey,za(ne,x)){De||(ne.scroller.draggable=!1,setTimeout(function(){return ne.scroller.draggable=!0},100));return}if(!Qa(z,x)){var te=xo(z,x),ie=Yn(x),de=te?rf(te,ie):"single";window.focus(),ie==1&&z.state.selectingText&&z.state.selectingText(x),!(te&&Ps(z,ie,te,de,x))&&(ie==1?te?tu(z,te,de,x):Cr(x)==ne.scroller&&Tn(x):ie==2?(te&&sl(z.doc,te),setTimeout(function(){return ne.input.focus()},20)):ie==3&&($e?z.display.input.onContextMenu(x):ku(z)))}}}function Ps(x,z,ne,te,ie){var de="Click";return te=="double"?de="Double"+de:te=="triple"&&(de="Triple"+de),de=(z==1?"Left":z==2?"Middle":"Right")+de,Dl(x,Is(de,ie),ie,function(ge){if(typeof ge=="string"&&(ge=Al[ge]),!ge)return!1;var Ce=!1;try{x.isReadOnly()&&(x.state.suppressEdits=!0),Ce=ge(x,ne)!=Vt}finally{x.state.suppressEdits=!1}return Ce})}function eu(x,z,ne){var te=x.getOption("configureMouse"),ie=te?te(x,z,ne):{};if(ie.unit==null){var de=Ct?ne.shiftKey&&ne.metaKey:ne.altKey;ie.unit=de?"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=at?ne.metaKey:ne.ctrlKey),ie.moveOnDrag==null&&(ie.moveOnDrag=!(at?ne.altKey:ne.ctrlKey)),ie}function tu(x,z,ne,te){xe?setTimeout(Tt(Sl,x),0):x.curOp.focus=tt();var ie=eu(x,ne,te),de=x.doc.sel,ge;x.options.dragDrop&&Nr&&!x.isReadOnly()&&ne=="single"&&(ge=de.contains(z))>-1&&(ln((ge=de.ranges[ge]).from(),z)<0||z.xRel>0)&&(ln(ge.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,de=!1,ge=wa(x,function(Ke){De&&(ie.scroller.draggable=!1),x.state.draggingText=!1,Qe(ie.wrapper.ownerDocument,"mouseup",ge),Qe(ie.wrapper.ownerDocument,"mousemove",Ce),Qe(ie.scroller,"dragstart",ke),Qe(ie.scroller,"drop",ge),de||(Tn(Ke),te.addNew||sl(x.doc,ne,null,null,te.extend),De&&!dt||xe&&Me==9?setTimeout(function(){ie.wrapper.ownerDocument.body.focus({preventScroll:!0}),ie.input.focus()},20):ie.input.focus())}),Ce=function(Ke){de=de||Math.abs(z.clientX-Ke.clientX)+Math.abs(z.clientY-Ke.clientY)>=10},ke=function(){return de=!0};De&&(ie.scroller.draggable=!0),x.state.draggingText=ge,ge.copy=!te.moveOnDrag,ie.scroller.dragDrop&&ie.scroller.dragDrop(),qt(ie.wrapper.ownerDocument,"mouseup",ge),qt(ie.wrapper.ownerDocument,"mousemove",Ce),qt(ie.scroller,"dragstart",ke),qt(ie.scroller,"drop",ge),ku(x),setTimeout(function(){return ie.input.focus()},20)}function uh(x,z,ne){if(ne=="char")return new Ki(z,z);if(ne=="word")return x.findWordAt(z);if(ne=="line")return new Ki(zt(z.line,0),Sn(x.doc,zt(z.line+1,0)));var te=ne(x,z);return new Ki(te.from,te.to)}function td(x,z,ne,te){var ie=x.display,de=x.doc;Tn(z);var ge,Ce,ke=de.sel,Ke=ke.ranges;if(te.addNew&&!te.extend?(Ce=de.sel.contains(ne),Ce>-1?ge=Ke[Ce]:ge=new Ki(ne,ne)):(ge=de.sel.primary(),Ce=de.sel.primIndex),te.unit=="rectangle")te.addNew||(ge=new Ki(ne,ne)),ne=xo(x,z,!0,!0),Ce=-1;else{var Et=uh(x,ne,te.unit);te.extend?ge=Vc(ge,Et.anchor,Et.head,te.extend):ge=Et}te.addNew?Ce==-1?(Ce=Ke.length,Sa(de,Io(x,Ke.concat([ge]),Ce),{scroll:!1,origin:"*mouse"})):Ke.length>1&&Ke[Ce].empty()&&te.unit=="char"&&!te.extend?(Sa(de,Io(x,Ke.slice(0,Ce).concat(Ke.slice(Ce+1)),0),{scroll:!1,origin:"*mouse"}),ke=de.sel):So(de,Ce,ge,nt):(Ce=0,Sa(de,new go([ge],0),nt),ke=de.sel);var Pt=ne;function cn(Mr){if(ln(Pt,Mr)!=0)if(Pt=Mr,te.unit=="rectangle"){for(var Rr=[],Jr=x.options.tabSize,Qr=Ne(lt(de,ne.line).text,ne.ch,Jr),xi=Ne(lt(de,Mr.line).text,Mr.ch,Jr),Qi=Math.min(Qr,xi),Ra=Math.max(Qr,xi),ca=Math.min(ne.line,Mr.line),co=Math.min(x.lastLine(),Math.max(ne.line,Mr.line));ca<=co;ca++){var uo=lt(de,ca).text,_a=dn(uo,Qi,Jr);Qi==Ra?Rr.push(new Ki(zt(ca,_a),zt(ca,_a))):uo.length>_a&&Rr.push(new Ki(zt(ca,_a),zt(ca,dn(uo,Ra,Jr))))}Rr.length||Rr.push(new Ki(ne,ne)),Sa(de,Io(x,ke.ranges.slice(0,Ce).concat(Rr),Ce),{origin:"*mouse",scroll:!1}),x.scrollIntoView(Mr)}else{var ho=ge,li=uh(x,Mr,te.unit),pa=ho.anchor,ua;ln(li.anchor,pa)>0?(ua=li.head,pa=Pn(ho.from(),li.anchor)):(ua=li.anchor,pa=Vn(ho.to(),li.head));var ma=ke.ranges.slice(0);ma[Ce]=dh(x,new Ki(Sn(de,pa),ua)),Sa(de,Io(x,ma,Ce),nt)}}var rn=ie.wrapper.getBoundingClientRect(),Bn=0;function nr(Mr){var Rr=++Bn,Jr=xo(x,Mr,!0,te.unit=="rectangle");if(Jr)if(ln(Jr,Pt)!=0){x.curOp.focus=tt(),cn(Jr);var Qr=Da(ie,de);(Jr.line>=Qr.to||Jr.line<Qr.from)&&setTimeout(wa(x,function(){Bn==Rr&&nr(Mr)}),150)}else{var xi=Mr.clientY<rn.top?-20:Mr.clientY>rn.bottom?20:0;xi&&setTimeout(wa(x,function(){Bn==Rr&&(ie.scroller.scrollTop+=xi,nr(Mr))}),50)}}function xr(Mr){x.state.selectingText=!1,Bn=1/0,Mr&&(Tn(Mr),ie.input.focus()),Qe(ie.wrapper.ownerDocument,"mousemove",Lr),Qe(ie.wrapper.ownerDocument,"mouseup",Pr),de.history.lastSelOrigin=null}var Lr=wa(x,function(Mr){Mr.buttons===0||!Yn(Mr)?xr(Mr):nr(Mr)}),Pr=wa(x,xr);x.state.selectingText=Pr,qt(ie.wrapper.ownerDocument,"mousemove",Lr),qt(ie.wrapper.ownerDocument,"mouseup",Pr)}function dh(x,z){var ne=z.anchor,te=z.head,ie=lt(x.doc,ne.line);if(ln(ne,te)==0&&ne.sticky==te.sticky)return z;var de=sn(ie);if(!de)return z;var ge=rt(de,ne.ch,ne.sticky),Ce=de[ge];if(Ce.from!=ne.ch&&Ce.to!=ne.ch)return z;var ke=ge+(Ce.from==ne.ch==(Ce.level!=1)?0:1);if(ke==0||ke==de.length)return z;var Ke;if(te.line!=ne.line)Ke=(te.line-ne.line)*(x.doc.direction=="ltr"?1:-1)>0;else{var Et=rt(de,te.ch,te.sticky),Pt=Et-ge||(te.ch-ne.ch)*(Ce.level==1?-1:1);Et==ke-1||Et==ke?Ke=Pt<0:Ke=Pt>0}var cn=de[ke+(Ke?-1:0)],rn=Ke==(cn.level==1),Bn=rn?cn.from:cn.to,nr=rn?"after":"before";return ne.ch==Bn&&ne.sticky==nr?z:new Ki(new zt(ne.line,Bn,nr),te)}function uc(x,z,ne,te){var ie,de;if(z.touches)ie=z.touches[0].clientX,de=z.touches[0].clientY;else try{ie=z.clientX,de=z.clientY}catch(cn){return!1}if(ie>=Math.floor(x.display.gutters.getBoundingClientRect().right))return!1;te&&Tn(z);var ge=x.display,Ce=ge.lineDiv.getBoundingClientRect();if(de>Ce.bottom||!mn(x,ne))return Hn(z);de-=Ce.top-ge.viewOffset;for(var ke=0;ke<x.display.gutterSpecs.length;++ke){var Ke=ge.gutters.childNodes[ke];if(Ke&&Ke.getBoundingClientRect().right>=ie){var Et=un(x.doc,de),Pt=x.display.gutterSpecs[ke];return mt(x,ne,x,Et,Pt.className,z),Hn(z)}}}function Qa(x,z){return uc(x,z,"gutterClick",!0)}function Os(x,z){za(x.display,z)||hh(x,z)||Nt(x,z,"contextmenu")||$e||x.display.input.onContextMenu(z)}function hh(x,z){return mn(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-"),qi(x)}var $s={toString:function(){return"CodeMirror.Init"}},fh={},nu={};function of(x){var z=x.optionHandlers;function ne(te,ie,de,ge){x.defaults[te]=ie,de&&(z[te]=ge?function(Ce,ke,Ke){Ke!=$s&&de(Ce,ke,Ke)}:de)}x.defineOption=ne,x.Init=$s,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),qi(te),Ha(te)},!0),ne("lineSeparator",null,function(te,ie){if(te.doc.lineSep=ie,!!ie){var de=[],ge=te.doc.first;te.doc.iter(function(ke){for(var Ke=0;;){var Et=ke.text.indexOf(ie,Ke);if(Et==-1)break;Ke=Et+ie.length,de.push(zt(ge,Et))}ge++});for(var Ce=de.length-1;Ce>=0;Ce--)_l(te.doc,ie,de[Ce],zt(de[Ce].line,de[Ce].ch+ie.length))}}),ne("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(te,ie,de){te.state.specialChars=new RegExp(ie.source+(ie.test(" ")?"":"| "),"g"),de!=$s&&te.refresh()}),ne("specialCharPlaceholder",Hi,function(te){return te.refresh()},!0),ne("electricChars",!0),ne("inputStyle",ot?"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",!jt),ne("wholeLineUpdateBefore",!0),ne("theme","default",function(te){nd(te),Cl(te)},!0),ne("keyMap","default",function(te,ie,de){var ge=oo(ie),Ce=de!=$s&&oo(de);Ce&&Ce.detach&&Ce.detach(te,ge),ge.attach&&ge.attach(te,Ce||null)}),ne("extraKeys",null),ne("configureMouse",null),ne("lineWrapping",!1,ph,!0),ne("gutters",[],function(te,ie){te.display.gutterSpecs=Pc(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 ks(te)},!0),ne("scrollbarStyle","native",function(te){Tu(te),ks(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=Pc(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!=$s;if(!z!=!te){var ie=x.display.dragFunctions,de=z?qt:Qe;de(x.display.scroller,"dragstart",ie.start),de(x.display.scroller,"dragenter",ie.enter),de(x.display.scroller,"dragover",ie.over),de(x.display.scroller,"dragleave",ie.leave),de(x.display.scroller,"drop",ie.drop)}}function ph(x){x.options.lineWrapping?($t(x.display.wrapper,"CodeMirror-wrap"),x.display.sizer.style.minWidth="",x.display.sizerWidth=null):(Ve(x.display.wrapper,"CodeMirror-wrap"),ir(x)),Aa(x),Ha(x),qi(x),setTimeout(function(){return ks(x)},100)}function oi(x,z){var ne=this;if(!(this instanceof oi))return new oi(x,z);this.options=z=z?wt(z):{},wt(fh,z,!1);var te=z.value;typeof te=="string"?te=new va(te,z.mode,null,z.lineSeparator,z.direction):z.mode&&(te.modeOption=z.mode),this.doc=te;var ie=new oi.inputStyles[z.inputStyle](this),de=this.display=new Ud(x,te,ie,z);de.wrapper.CodeMirror=this,nd(this),z.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Tu(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 be,keySeq:null,specialChars:null},z.autofocus&&!ot&&de.input.focus(),xe&&Me<11&&setTimeout(function(){return ne.display.input.reset(!0)},20),lf(this),Xu(),Ls(this),this.curOp.forceUpdate=!0,Yl(this,te),z.autofocus&&!ot||this.hasFocus()?setTimeout(function(){ne.hasFocus()&&!ne.state.focused&&kc(ne)},20):Js(this);for(var ge in nu)nu.hasOwnProperty(ge)&&nu[ge](this,z[ge],$s);Xl(this),z.finishInit&&z.finishInit(this);for(var Ce=0;Ce<rd.length;++Ce)rd[Ce](this);cs(this),De&&z.lineWrapping&&getComputedStyle(de.lineDiv).textRendering=="optimizelegibility"&&(de.lineDiv.style.textRendering="auto")}oi.defaults=fh,oi.optionHandlers=nu;function lf(x){var z=x.display;qt(z.scroller,"mousedown",wa(x,ja)),xe&&Me<11?qt(z.scroller,"dblclick",wa(x,function(ke){if(!Nt(x,ke)){var Ke=xo(x,ke);if(!(!Ke||Qa(x,ke)||za(x.display,ke))){Tn(ke);var Et=x.findWordAt(Ke);sl(x.doc,Et.anchor,Et.head)}}})):qt(z.scroller,"dblclick",function(ke){return Nt(x,ke)||Tn(ke)}),qt(z.scroller,"contextmenu",function(ke){return Os(x,ke)}),qt(z.input.getField(),"contextmenu",function(ke){z.scroller.contains(ke.target)||Os(x,ke)});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 de(ke){if(ke.touches.length!=1)return!1;var Ke=ke.touches[0];return Ke.radiusX<=1&&Ke.radiusY<=1}function ge(ke,Ke){if(Ke.left==null)return!0;var Et=Ke.left-ke.left,Pt=Ke.top-ke.top;return Et*Et+Pt*Pt>20*20}qt(z.scroller,"touchstart",function(ke){if(!Nt(x,ke)&&!de(ke)&&!Qa(x,ke)){z.input.ensurePolled(),clearTimeout(ne);var Ke=+new Date;z.activeTouch={start:Ke,moved:!1,prev:Ke-te.end<=300?te:null},ke.touches.length==1&&(z.activeTouch.left=ke.touches[0].pageX,z.activeTouch.top=ke.touches[0].pageY)}}),qt(z.scroller,"touchmove",function(){z.activeTouch&&(z.activeTouch.moved=!0)}),qt(z.scroller,"touchend",function(ke){var Ke=z.activeTouch;if(Ke&&!za(z,ke)&&Ke.left!=null&&!Ke.moved&&new Date-Ke.start<300){var Et=x.coordsChar(z.activeTouch,"page"),Pt;!Ke.prev||ge(Ke,Ke.prev)?Pt=new Ki(Et,Et):!Ke.prev.prev||ge(Ke,Ke.prev.prev)?Pt=x.findWordAt(Et):Pt=new Ki(zt(Et.line,0),Sn(x.doc,zt(Et.line+1,0))),x.setSelection(Pt.anchor,Pt.head),x.focus(),Tn(ke)}ie()}),qt(z.scroller,"touchcancel",ie),qt(z.scroller,"scroll",function(){z.scroller.clientHeight&&(Es(x,z.scroller.scrollTop),Ms(x,z.scroller.scrollLeft,!0),mt(x,"scroll",x))}),qt(z.scroller,"mousewheel",function(ke){return Fu(x,ke)}),qt(z.scroller,"DOMMouseScroll",function(ke){return Fu(x,ke)}),qt(z.wrapper,"scroll",function(){return z.wrapper.scrollTop=z.wrapper.scrollLeft=0}),z.dragFunctions={enter:function(ke){Nt(x,ke)||wr(ke)},over:function(ke){Nt(x,ke)||(Uu(x,ke),wr(ke))},start:function(ke){return ef(x,ke)},drop:wa(x,Qh),leave:function(ke){Nt(x,ke)||kl(x)}};var Ce=z.input.getField();qt(Ce,"keyup",function(ke){return lh.call(x,ke)}),qt(Ce,"keydown",wa(x,lc)),qt(Ce,"keypress",wa(x,ch)),qt(Ce,"focus",function(ke){return kc(x,ke)}),qt(Ce,"blur",function(ke){return Js(x,ke)})}var rd=[];oi.defineInitHook=function(x){return rd.push(x)};function zo(x,z,ne,te){var ie=x.doc,de;ne==null&&(ne="add"),ne=="smart"&&(ie.mode.indent?de=Wt(x,z).state:ne="prev");var ge=x.options.tabSize,Ce=lt(ie,z),ke=Ne(Ce.text,null,ge);Ce.stateAfter&&(Ce.stateAfter=null);var Ke=Ce.text.match(/^\s*/)[0],Et;if(!te&&!/\S/.test(Ce.text))Et=0,ne="not";else if(ne=="smart"&&(Et=ie.mode.indent(de,Ce.text.slice(Ke.length),Ce.text),Et==Vt||Et>150)){if(!te)return;ne="prev"}ne=="prev"?z>ie.first?Et=Ne(lt(ie,z-1).text,null,ge):Et=0:ne=="add"?Et=ke+x.options.indentUnit:ne=="subtract"?Et=ke-x.options.indentUnit:typeof ne=="number"&&(Et=ke+ne),Et=Math.max(0,Et);var Pt="",cn=0;if(x.options.indentWithTabs)for(var rn=Math.floor(Et/ge);rn;--rn)cn+=ge,Pt+=" ";if(cn<Et&&(Pt+=on(Et-cn)),Pt!=Ke)return _l(ie,Pt,zt(z,0),zt(z,Ke.length),"+input"),Ce.stateAfter=null,!0;for(var Bn=0;Bn<ie.sel.ranges.length;Bn++){var nr=ie.sel.ranges[Bn];if(nr.head.line==z&&nr.head.ch<Ke.length){var xr=zt(z,Ke.length);So(ie,Bn,new Ki(xr,xr));break}}}var Ko=null;function Ns(x){Ko=x}function id(x,z,ne,te,ie){var de=x.doc;x.display.shift=!1,te||(te=de.sel);var ge=+new Date-200,Ce=ie=="paste"||x.state.pasteIncoming>ge,ke=Gr(z),Ke=null;if(Ce&&te.ranges.length>1)if(Ko&&Ko.text.join(`
`)==z){if(te.ranges.length%Ko.text.length==0){Ke=[];for(var Et=0;Et<Ko.text.length;Et++)Ke.push(de.splitLines(Ko.text[Et]))}}else ke.length==te.ranges.length&&x.options.pasteLinesPerSelection&&(Ke=Ut(ke,function(Lr){return[Lr]}));for(var Pt=x.curOp.updateInput,cn=te.ranges.length-1;cn>=0;cn--){var rn=te.ranges[cn],Bn=rn.from(),nr=rn.to();rn.empty()&&(ne&&ne>0?Bn=zt(Bn.line,Bn.ch-ne):x.state.overwrite&&!Ce?nr=zt(nr.line,Math.min(lt(de,nr.line).text.length,nr.ch+Xt(ke).length)):Ce&&Ko&&Ko.lineWise&&Ko.text.join(`
`)==ke.join(`
`)&&(Bn=nr=zt(Bn.line,0)));var xr={from:Bn,to:nr,text:Ke?Ke[cn%Ke.length]:ke,origin:ie||(Ce?"paste":x.state.cutIncoming>ge?"cut":"+input")};As(x.doc,xr),Ir(x,"inputRead",x,xr)}z&&!Ce&&od(x,z),Qs(x),x.curOp.updateInput<2&&(x.curOp.updateInput=Pt),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&&fa(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 de=x.getModeAt(ie.head),ge=!1;if(de.electricChars){for(var Ce=0;Ce<de.electricChars.length;Ce++)if(z.indexOf(de.electricChars.charAt(Ce))>-1){ge=zo(x,ie.head.line,"smart");break}}else de.electricInput&&de.electricInput.test(lt(x.doc,ie.head.line).text.slice(0,ie.head.ch))&&(ge=zo(x,ie.head.line,"smart"));ge&&Ir(x,"electricInput",x,ie.head.line)}}}function Tl(x){for(var z=[],ne=[],te=0;te<x.doc.sel.ranges.length;te++){var ie=x.doc.sel.ranges[te].head.line,de={anchor:zt(ie,0),head:zt(ie+1,0)};ne.push(de),z.push(x.getRange(de.anchor,de.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=et("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),z=et("div",[x],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return De?x.style.width="1000px":x.setAttribute("wrap","off"),ft&&(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 de=this.options,ge=de[te];de[te]==ie&&te!="mode"||(de[te]=ie,z.hasOwnProperty(te)&&wa(this,z[te])(this,ie,ge),mt(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"](oo(te))},removeKeyMap:function(te){for(var ie=this.state.keyMaps,de=0;de<ie.length;++de)if(ie[de]==te||ie[de].name==te)return ie.splice(de,1),!0},addOverlay:la(function(te,ie){var de=te.token?te:x.getMode(this.options,te);if(de.startState)throw new Error("Overlays may not be stateful.");Zt(this.state.overlays,{mode:de,modeSpec:te,opaque:ie&&ie.opaque,priority:ie&&ie.priority||0},function(ge){return ge.priority}),this.state.modeGen++,Ha(this)}),removeOverlay:la(function(te){for(var ie=this.state.overlays,de=0;de<ie.length;++de){var ge=ie[de].modeSpec;if(ge==te||typeof te=="string"&&ge.name==te){ie.splice(de,1),this.state.modeGen++,Ha(this);return}}}),indentLine:la(function(te,ie,de){typeof ie!="string"&&typeof ie!="number"&&(ie==null?ie=this.options.smartIndent?"smart":"prev":ie=ie?"add":"subtract"),fn(this.doc,te)&&zo(this,te,ie,de)}),indentSelection:la(function(te){for(var ie=this.doc.sel.ranges,de=-1,ge=0;ge<ie.length;ge++){var Ce=ie[ge];if(Ce.empty())Ce.head.line>de&&(zo(this,Ce.head.line,te,!0),de=Ce.head.line,ge==this.doc.sel.primIndex&&Qs(this));else{var ke=Ce.from(),Ke=Ce.to(),Et=Math.max(de,ke.line);de=Math.min(this.lastLine(),Ke.line-(Ke.ch?0:1))+1;for(var Pt=Et;Pt<de;++Pt)zo(this,Pt,te);var cn=this.doc.sel.ranges;ke.ch==0&&ie.length==cn.length&&cn[ge].from().ch>0&&So(this.doc,ge,new Ki(ke,cn[ge].to()),qe)}}}),getTokenAt:function(te,ie){return Cn(this,te,ie)},getLineTokens:function(te,ie){return Cn(this,zt(te),ie,!0)},getTokenTypeAt:function(te){te=Sn(this.doc,te);var ie=gt(this,lt(this.doc,te.line)),de=0,ge=(ie.length-1)/2,Ce=te.ch,ke;if(Ce==0)ke=ie[2];else for(;;){var Ke=de+ge>>1;if((Ke?ie[Ke*2-1]:0)>=Ce)ge=Ke;else if(ie[Ke*2+1]<Ce)de=Ke+1;else{ke=ie[Ke*2+2];break}}var Et=ke?ke.indexOf("overlay "):-1;return Et<0?ke:Et==0?null:ke.slice(0,Et-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 de=[];if(!ne.hasOwnProperty(ie))return de;var ge=ne[ie],Ce=this.getModeAt(te);if(typeof Ce[ie]=="string")ge[Ce[ie]]&&de.push(ge[Ce[ie]]);else if(Ce[ie])for(var ke=0;ke<Ce[ie].length;ke++){var Ke=ge[Ce[ie][ke]];Ke&&de.push(Ke)}else Ce.helperType&&ge[Ce.helperType]?de.push(ge[Ce.helperType]):ge[Ce.name]&&de.push(ge[Ce.name]);for(var Et=0;Et<ge._global.length;Et++){var Pt=ge._global[Et];Pt.pred(Ce,this)&&xt(de,Pt.val)==-1&&de.push(Pt.val)}return de},getStateAfter:function(te,ie){var de=this.doc;return te=yr(de,te==null?de.first+de.size-1:te),Wt(this,te+1,ie).state},cursorCoords:function(te,ie){var de,ge=this.doc.sel.primary();return te==null?de=ge.head:typeof te=="object"?de=Sn(this.doc,te):de=te?ge.from():ge.to(),La(this,de,ie||"page")},charCoords:function(te,ie){return lo(this,Sn(this.doc,te),ie||"page")},coordsChar:function(te,ie){return te=so(this,te,ie||"page"),Ys(this,te.left,te.top)},lineAtHeight:function(te,ie){return te=so(this,{top:te,left:0},ie||"page").top,un(this.doc,te+this.display.viewOffset)},heightAtLine:function(te,ie,de){var ge=!1,Ce;if(typeof te=="number"){var ke=this.doc.first+this.doc.size-1;te<this.doc.first?te=this.doc.first:te>ke&&(te=ke,ge=!0),Ce=lt(this.doc,te)}else Ce=te;return Na(this,Ce,{top:0,left:0},ie||"page",de||ge).top+(ge?this.doc.height-lr(Ce):0)},defaultTextHeight:function(){return as(this.display)},defaultCharWidth:function(){return Li(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(te,ie,de,ge,Ce){var ke=this.display;te=La(this,Sn(this.doc,te));var Ke=te.bottom,Et=te.left;if(ie.style.position="absolute",ie.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(ie),ke.sizer.appendChild(ie),ge=="over")Ke=te.top;else if(ge=="above"||ge=="near"){var Pt=Math.max(ke.wrapper.clientHeight,this.doc.height),cn=Math.max(ke.sizer.clientWidth,ke.lineSpace.clientWidth);(ge=="above"||te.bottom+ie.offsetHeight>Pt)&&te.top>ie.offsetHeight?Ke=te.top-ie.offsetHeight:te.bottom+ie.offsetHeight<=Pt&&(Ke=te.bottom),Et+ie.offsetWidth>cn&&(Et=cn-ie.offsetWidth)}ie.style.top=Ke+"px",ie.style.left=ie.style.right="",Ce=="right"?(Et=ke.sizer.clientWidth-ie.offsetWidth,ie.style.right="0px"):(Ce=="left"?Et=0:Ce=="middle"&&(Et=(ke.sizer.clientWidth-ie.offsetWidth)/2),ie.style.left=Et+"px"),de&&$d(this,{left:Et,top:Ke,right:Et+ie.offsetWidth,bottom:Ke+ie.offsetHeight})},triggerOnKeyDown:la(lc),triggerOnKeyPress:la(ch),triggerOnKeyUp:lh,triggerOnMouseDown:la(ja),execCommand:function(te){if(Al.hasOwnProperty(te))return Al[te].call(null,this)},triggerElectric:la(function(te){od(this,te)}),findPosH:function(te,ie,de,ge){var Ce=1;ie<0&&(Ce=-1,ie=-ie);for(var ke=Sn(this.doc,te),Ke=0;Ke<ie&&(ke=ru(this.doc,ke,Ce,de,ge),!ke.hitSide);++Ke);return ke},moveH:la(function(te,ie){var de=this;this.extendSelectionsBy(function(ge){return de.display.shift||de.doc.extend||ge.empty()?ru(de.doc,ge.head,te,ie,de.options.rtlMoveVisually):te<0?ge.from():ge.to()},Ot)}),deleteH:la(function(te,ie){var de=this.doc.sel,ge=this.doc;de.somethingSelected()?ge.replaceSelection("",null,"+delete"):Po(this,function(Ce){var ke=ru(ge,Ce.head,te,ie,!1);return te<0?{from:ke,to:Ce.head}:{from:Ce.head,to:ke}})}),findPosV:function(te,ie,de,ge){var Ce=1,ke=ge;ie<0&&(Ce=-1,ie=-ie);for(var Ke=Sn(this.doc,te),Et=0;Et<ie;++Et){var Pt=La(this,Ke,"div");if(ke==null?ke=Pt.left:Pt.left=ke,Ke=gh(this,Pt,Ce,de),Ke.hitSide)break}return Ke},moveV:la(function(te,ie){var de=this,ge=this.doc,Ce=[],ke=!this.display.shift&&!ge.extend&&ge.sel.somethingSelected();if(ge.extendSelectionsBy(function(Et){if(ke)return te<0?Et.from():Et.to();var Pt=La(de,Et.head,"div");Et.goalColumn!=null&&(Pt.left=Et.goalColumn),Ce.push(Pt.left);var cn=gh(de,Pt,te,ie);return ie=="page"&&Et==ge.sel.primary()&&Lc(de,lo(de,cn,"div").top-Pt.top),cn},Ot),Ce.length)for(var Ke=0;Ke<ge.sel.ranges.length;Ke++)ge.sel.ranges[Ke].goalColumn=Ce[Ke]}),findWordAt:function(te){var ie=this.doc,de=lt(ie,te.line).text,ge=te.ch,Ce=te.ch;if(de){var ke=this.getHelper(te,"wordChars");(te.sticky=="before"||Ce==de.length)&&ge?--ge:++Ce;for(var Ke=de.charAt(ge),Et=pe(Ke,ke)?function(Pt){return pe(Pt,ke)}:/\s/.test(Ke)?function(Pt){return/\s/.test(Pt)}:function(Pt){return!/\s/.test(Pt)&&!pe(Pt)};ge>0&&Et(de.charAt(ge-1));)--ge;for(;Ce<de.length&&Et(de.charAt(Ce));)++Ce}return new Ki(zt(te.line,ge),zt(te.line,Ce))},toggleOverwrite:function(te){te!=null&&te==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?$t(this.display.cursorDiv,"CodeMirror-overwrite"):Ve(this.display.cursorDiv,"CodeMirror-overwrite"),mt(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==tt()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:la(function(te,ie){el(this,te,ie)}),getScrollInfo:function(){var te=this.display.scroller;return{left:te.scrollLeft,top:te.scrollTop,height:te.scrollHeight-Ma(this)-this.display.barHeight,width:te.scrollWidth-Ma(this)-this.display.barWidth,clientHeight:bo(this),clientWidth:ha(this)}},scrollIntoView:la(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:zt(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):Au(this,te.from,te.to,te.margin)}),setSize:la(function(te,ie){var de=this,ge=function(ke){return typeof ke=="number"||/^\d+$/.test(String(ke))?ke+"px":ke};te!=null&&(this.display.wrapper.style.width=ge(te)),ie!=null&&(this.display.wrapper.style.height=ge(ie)),this.options.lineWrapping&&ka(this);var Ce=this.display.viewFrom;this.doc.iter(Ce,this.display.viewTo,function(ke){if(ke.widgets){for(var Ke=0;Ke<ke.widgets.length;Ke++)if(ke.widgets[Ke].noHScroll){Bo(de,Ce,"widget");break}}++Ce}),this.curOp.forceUpdate=!0,mt(this,"refresh",this)}),operation:function(te){return fa(this,te)},startOperation:function(){return Ls(this)},endOperation:function(){return cs(this)},refresh:la(function(){var te=this.display.cachedTextHeight;Ha(this),this.curOp.forceUpdate=!0,qi(this),el(this,this.doc.scrollLeft,this.doc.scrollTop),Tc(this.display),(te==null||Math.abs(te-as(this.display))>.5||this.options.lineWrapping)&&Aa(this),mt(this,"refresh",this)}),swapDoc:la(function(te){var ie=this.doc;return ie.cm=null,this.state.selectingText&&this.state.selectingText(),Yl(this,te),qi(this),this.display.input.reset(),el(this,te.scrollLeft,te.scrollTop),this.curOp.forceScroll=!0,Ir(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}},wn(x),x.registerHelper=function(te,ie,de){ne.hasOwnProperty(te)||(ne[te]=x[te]={_global:[]}),ne[te][ie]=de},x.registerGlobalHelper=function(te,ie,de,ge){x.registerHelper(te,ie,ge),ne[te]._global.push({pred:de,val:ge})}}function ru(x,z,ne,te,ie){var de=z,ge=ne,Ce=lt(x,z.line),ke=ie&&x.direction=="rtl"?-ne:ne;function Ke(){var Pr=z.line+ke;return Pr<x.first||Pr>=x.first+x.size?!1:(z=new zt(Pr,z.ch,z.sticky),Ce=lt(x,Pr))}function Et(Pr){var Mr;if(te=="codepoint"){var Rr=Ce.text.charCodeAt(z.ch+(te>0?0:-1));isNaN(Rr)?Mr=null:Mr=new zt(z.line,Math.max(0,Math.min(Ce.text.length,z.ch+ne*(Rr>=55296&&Rr<56320?2:1))),-ne)}else ie?Mr=Xo(x.cm,Ce,z,ne):Mr=Uo(Ce,z,ne);if(Mr==null)if(!Pr&&Ke())z=dl(ie,x.cm,Ce,z.line,ke);else return!1;else z=Mr;return!0}if(te=="char"||te=="codepoint")Et();else if(te=="column")Et(!0);else if(te=="word"||te=="group")for(var Pt=null,cn=te=="group",rn=x.cm&&x.cm.getHelper(z,"wordChars"),Bn=!0;!(ne<0&&!Et(!Bn));Bn=!1){var nr=Ce.text.charAt(z.ch)||`
`,xr=pe(nr,rn)?"w":cn&&nr==`
`?"n":!cn||/\s/.test(nr)?null:"p";if(cn&&!Bn&&!xr&&(xr="s"),Pt&&Pt!=xr){ne<0&&(ne=1,Et(),z.sticky="after");break}if(xr&&(Pt=xr),ne>0&&!Et(!Bn))break}var Lr=Gc(x,z,de,ge,!0);return jn(de,Lr)&&(Lr.hitSide=!0),Lr}function gh(x,z,ne,te){var ie=x.doc,de=z.left,ge;if(te=="page"){var Ce=Math.min(x.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ke=Math.max(Ce-.5*as(x.display),3);ge=(ne>0?z.bottom:z.top)+ne*ke}else te=="line"&&(ge=ne>0?z.bottom+3:z.top-3);for(var Ke;Ke=Ys(x,de,ge),!!Ke.outside;){if(ne<0?ge<=0:ge>=ie.height){Ke.hitSide=!0;break}ge+=ne*5}return Ke}var Vi=function(x){this.cm=x,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new be,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 de(Ce){for(var ke=Ce.target;ke;ke=ke.parentNode){if(ke==ie)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ke.className))break}return!1}qt(ie,"paste",function(Ce){!de(Ce)||Nt(te,Ce)||ad(Ce,te)||Me<=11&&setTimeout(wa(te,function(){return z.updateFromDOM()}),20)}),qt(ie,"compositionstart",function(Ce){z.composing={data:Ce.data,done:!1}}),qt(ie,"compositionupdate",function(Ce){z.composing||(z.composing={data:Ce.data,done:!1})}),qt(ie,"compositionend",function(Ce){z.composing&&(Ce.data!=z.composing.data&&z.readFromDOMSoon(),z.composing.done=!0)}),qt(ie,"touchstart",function(){return ne.forceCompositionEnd()}),qt(ie,"input",function(){z.composing||z.readFromDOMSoon()});function ge(Ce){if(!(!de(Ce)||Nt(te,Ce))){if(te.somethingSelected())Ns({lineWise:!1,text:te.getSelections()}),Ce.type=="cut"&&te.replaceSelection("",null,"cut");else if(te.options.lineWiseCopyCut){var ke=Tl(te);Ns({lineWise:!0,text:ke.text}),Ce.type=="cut"&&te.operation(function(){te.setSelections(ke.ranges,0,qe),te.replaceSelection("",null,"cut")})}else return;if(Ce.clipboardData){Ce.clipboardData.clearData();var Ke=Ko.text.join(`
`);if(Ce.clipboardData.setData("Text",Ke),Ce.clipboardData.getData("Text")==Ke){Ce.preventDefault();return}}var Et=sd(),Pt=Et.firstChild;te.display.lineSpace.insertBefore(Et,te.display.lineSpace.firstChild),Pt.value=Ko.text.join(`
`);var cn=document.activeElement;Bt(Pt),setTimeout(function(){te.display.lineSpace.removeChild(Et),cn.focus(),cn==ie&&ne.showPrimarySelection()},50)}}qt(ie,"copy",ge),qt(ie,"cut",ge)},Vi.prototype.screenReaderLabelChanged=function(x){x?this.div.setAttribute("aria-label",x):this.div.removeAttribute("aria-label")},Vi.prototype.prepareSelection=function(){var x=Eu(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 de=iu(z,x.anchorNode,x.anchorOffset),ge=iu(z,x.focusNode,x.focusOffset);if(!(de&&!de.bad&&ge&&!ge.bad&&ln(Pn(de,ge),te)==0&&ln(Vn(de,ge),ie)==0)){var Ce=z.display.view,ke=te.line>=z.display.viewFrom&&vh(z,te)||{node:Ce[0].measure.map[2],offset:0},Ke=ie.line<z.display.viewTo&&vh(z,ie);if(!Ke){var Et=Ce[Ce.length-1].measure,Pt=Et.maps?Et.maps[Et.maps.length-1]:Et.map;Ke={node:Pt[Pt.length-1],offset:Pt[Pt.length-2]-Pt[Pt.length-3]}}if(!ke||!Ke){x.removeAllRanges();return}var cn=x.rangeCount&&x.getRangeAt(0),rn;try{rn=Ge(ke.node,ke.offset,Ke.offset,Ke.node)}catch(Bn){}rn&&(!se&&z.state.focused?(x.collapse(ke.node,ke.offset),rn.collapsed||(x.removeAllRanges(),x.addRange(rn))):(x.removeAllRanges(),x.addRange(rn)),cn&&x.anchorNode==null?x.addRange(cn):se&&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){Lt(this.cm.display.cursorDiv,x.cursors),Lt(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 kt(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():fa(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(Ye&&_e&&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&&fa(z,function(){Sa(z.doc,Ro(ne,te),qe),(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=zt(te.line-1,lt(x.doc,te.line-1).length)),ie.ch==lt(x.doc,ie.line).text.length&&ie.line<x.lastLine()&&(ie=zt(ie.line+1,0)),te.line<z.viewFrom||ie.line>z.viewTo-1)return!1;var de,ge,Ce;te.line==z.viewFrom||(de=po(x,te.line))==0?(ge=Jt(z.view[0].line),Ce=z.view[0].node):(ge=Jt(z.view[de].line),Ce=z.view[de-1].node.nextSibling);var ke=po(x,ie.line),Ke,Et;if(ke==z.view.length-1?(Ke=z.viewTo-1,Et=z.lineDiv.lastChild):(Ke=Jt(z.view[ke+1].line)-1,Et=z.view[ke+1].node.previousSibling),!Ce)return!1;for(var Pt=x.doc.splitLines(uf(x,Ce,Et,ge,Ke)),cn=_t(x.doc,zt(ge,0),zt(Ke,lt(x.doc,Ke).text.length));Pt.length>1&&cn.length>1;)if(Xt(Pt)==Xt(cn))Pt.pop(),cn.pop(),Ke--;else if(Pt[0]==cn[0])Pt.shift(),cn.shift(),ge++;else break;for(var rn=0,Bn=0,nr=Pt[0],xr=cn[0],Lr=Math.min(nr.length,xr.length);rn<Lr&&nr.charCodeAt(rn)==xr.charCodeAt(rn);)++rn;for(var Pr=Xt(Pt),Mr=Xt(cn),Rr=Math.min(Pr.length-(Pt.length==1?rn:0),Mr.length-(cn.length==1?rn:0));Bn<Rr&&Pr.charCodeAt(Pr.length-Bn-1)==Mr.charCodeAt(Mr.length-Bn-1);)++Bn;if(Pt.length==1&&cn.length==1&&ge==te.line)for(;rn&&rn>te.ch&&Pr.charCodeAt(Pr.length-Bn-1)==Mr.charCodeAt(Mr.length-Bn-1);)rn--,Bn++;Pt[Pt.length-1]=Pr.slice(0,Pr.length-Bn).replace(/^\u200b+/,""),Pt[0]=Pt[0].slice(rn).replace(/\u200b+$/,"");var Jr=zt(ge,rn),Qr=zt(Ke,cn.length?Xt(cn).length-Bn:0);if(Pt.length>1||Pt[0]||ln(Jr,Qr))return _l(x.doc,Pt,Jr,Qr,"+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())&&fa(this.cm,function(){return Ha(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()||wa(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=Ya(x,z.line);if(!ne||ne.hidden)return null;var te=lt(x.doc,z.line),ie=Lo(ne,te,z.line),de=sn(te,x.doc.direction),ge="left";if(de){var Ce=rt(de,z.ch);ge=Ce%2?"right":"left"}var ke=rs(ie.map,z.ch,ge);return ke.offset=ke.collapse=="right"?ke.end:ke.start,ke}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 de="",ge=!1,Ce=x.doc.lineSeparator(),ke=!1;function Ke(rn){return function(Bn){return Bn.id==rn}}function Et(){ge&&(de+=Ce,ke&&(de+=Ce),ge=ke=!1)}function Pt(rn){rn&&(Et(),de+=rn)}function cn(rn){if(rn.nodeType==1){var Bn=rn.getAttribute("cm-text");if(Bn){Pt(Bn);return}var nr=rn.getAttribute("cm-marker"),xr;if(nr){var Lr=x.findMarks(zt(te,0),zt(ie+1,0),Ke(+nr));Lr.length&&(xr=Lr[0].find(0))&&Pt(_t(x.doc,xr.from,xr.to).join(Ce));return}if(rn.getAttribute("contenteditable")=="false")return;var Pr=/^(pre|div|p|li|table|br)$/i.test(rn.nodeName);if(!/^br$/i.test(rn.nodeName)&&rn.textContent.length==0)return;Pr&&Et();for(var Mr=0;Mr<rn.childNodes.length;Mr++)cn(rn.childNodes[Mr]);/^(pre|p)$/i.test(rn.nodeName)&&(ke=!0),Pr&&(ge=!0)}else rn.nodeType==3&&Pt(rn.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;cn(z),z!=ne;)z=z.nextSibling,ke=!1;return de}function iu(x,z,ne){var te;if(z==x.display.lineDiv){if(te=x.display.lineDiv.childNodes[ne],!te)return Il(x.clipPos(zt(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 de=x.display.view[ie];if(de.node==te)return df(de,z,ne)}}function df(x,z,ne){var te=x.text.firstChild,ie=!1;if(!z||!kt(te,z))return Il(zt(Jt(x.line),0),!0);if(z==te&&(ie=!0,z=te.childNodes[ne],ne=0,!z)){var de=x.rest?Xt(x.rest):x.line;return Il(zt(Jt(de),de.text.length),ie)}var ge=z.nodeType==3?z:null,Ce=z;for(!ge&&z.childNodes.length==1&&z.firstChild.nodeType==3&&(ge=z.firstChild,ne&&(ne=ge.nodeValue.length));Ce.parentNode!=te;)Ce=Ce.parentNode;var ke=x.measure,Ke=ke.maps;function Et(xr,Lr,Pr){for(var Mr=-1;Mr<(Ke?Ke.length:0);Mr++)for(var Rr=Mr<0?ke.map:Ke[Mr],Jr=0;Jr<Rr.length;Jr+=3){var Qr=Rr[Jr+2];if(Qr==xr||Qr==Lr){var xi=Jt(Mr<0?x.line:x.rest[Mr]),Qi=Rr[Jr]+Pr;return(Pr<0||Qr!=xr)&&(Qi=Rr[Jr+(Pr?1:0)]),zt(xi,Qi)}}}var Pt=Et(ge,Ce,ne);if(Pt)return Il(Pt,ie);for(var cn=Ce.nextSibling,rn=ge?ge.nodeValue.length-ne:0;cn;cn=cn.nextSibling){if(Pt=Et(cn,cn.firstChild,0),Pt)return Il(zt(Pt.line,Pt.ch-rn),ie);rn+=cn.textContent.length}for(var Bn=Ce.previousSibling,nr=ne;Bn;Bn=Bn.previousSibling){if(Pt=Et(Bn,Bn.firstChild,-1),Pt)return Il(zt(Pt.line,Pt.ch+nr),ie);nr+=Bn.textContent.length}}var Ji=function(x){this.cm=x,this.prevInput="",this.pollingFast=!1,this.polling=new be,this.hasSelection=!1,this.composing=null};Ji.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),ft&&(ie.style.width="0px"),qt(ie,"input",function(){xe&&Me>=9&&z.hasSelection&&(z.hasSelection=null),ne.poll()}),qt(ie,"paste",function(ge){Nt(te,ge)||ad(ge,te)||(te.state.pasteIncoming=+new Date,ne.fastPoll())});function de(ge){if(!Nt(te,ge)){if(te.somethingSelected())Ns({lineWise:!1,text:te.getSelections()});else if(te.options.lineWiseCopyCut){var Ce=Tl(te);Ns({lineWise:!0,text:Ce.text}),ge.type=="cut"?te.setSelections(Ce.ranges,null,qe):(ne.prevInput="",ie.value=Ce.text.join(`
`),Bt(ie))}else return;ge.type=="cut"&&(te.state.cutIncoming=+new Date)}}qt(ie,"cut",de),qt(ie,"copy",de),qt(x.scroller,"paste",function(ge){if(!(za(x,ge)||Nt(te,ge))){if(!ie.dispatchEvent){te.state.pasteIncoming=+new Date,ne.focus();return}var Ce=new Event("paste");Ce.clipboardData=ge.clipboardData,ie.dispatchEvent(Ce)}}),qt(x.lineSpace,"selectstart",function(ge){za(x,ge)||Tn(ge)}),qt(ie,"compositionstart",function(){var ge=te.getCursor("from");ne.composing&&ne.composing.range.clear(),ne.composing={start:ge,range:te.markText(ge,te.getCursor("to"),{className:"CodeMirror-composing"})}}),qt(ie,"compositionend",function(){ne.composing&&(ne.poll(),ne.composing.range.clear(),ne.composing=null)})},Ji.prototype.createField=function(x){this.wrapper=sd(),this.textarea=this.wrapper.firstChild},Ji.prototype.screenReaderLabelChanged=function(x){x?this.textarea.setAttribute("aria-label",x):this.textarea.removeAttribute("aria-label")},Ji.prototype.prepareSelection=function(){var x=this.cm,z=x.display,ne=x.doc,te=Eu(x);if(x.options.moveInputWithCursor){var ie=La(x,ne.sel.primary().head,"div"),de=z.wrapper.getBoundingClientRect(),ge=z.lineDiv.getBoundingClientRect();te.teTop=Math.max(0,Math.min(z.wrapper.clientHeight-10,ie.top+ge.top-de.top)),te.teLeft=Math.max(0,Math.min(z.wrapper.clientWidth-10,ie.left+ge.left-de.left))}return te},Ji.prototype.showSelection=function(x){var z=this.cm,ne=z.display;Lt(ne.cursorDiv,x.cursors),Lt(ne.selectionDiv,x.selection),x.teTop!=null&&(this.wrapper.style.top=x.teTop+"px",this.wrapper.style.left=x.teLeft+"px")},Ji.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&&Bt(this.textarea),xe&&Me>=9&&(this.hasSelection=ne)}else x||(this.prevInput=this.textarea.value="",xe&&Me>=9&&(this.hasSelection=null))}},Ji.prototype.getField=function(){return this.textarea},Ji.prototype.supportsTouch=function(){return!1},Ji.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!ot||tt()!=this.textarea))try{this.textarea.focus()}catch(x){}},Ji.prototype.blur=function(){this.textarea.blur()},Ji.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ji.prototype.receivedFocus=function(){this.slowPoll()},Ji.prototype.slowPoll=function(){var x=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){x.poll(),x.cm.state.focused&&x.slowPoll()})},Ji.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)},Ji.prototype.poll=function(){var x=this,z=this.cm,ne=this.textarea,te=this.prevInput;if(this.contextMenuPending||!z.state.focused||ar(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(xe&&Me>=9&&this.hasSelection===ie||at&&/[\uf700-\uf7ff]/.test(ie))return z.display.input.reset(),!1;if(z.doc.sel==z.display.selForContextMenu){var de=ie.charCodeAt(0);if(de==8203&&!te&&(te="\u200B"),de==8666)return this.reset(),this.cm.execCommand("undo")}for(var ge=0,Ce=Math.min(te.length,ie.length);ge<Ce&&te.charCodeAt(ge)==ie.charCodeAt(ge);)++ge;return fa(z,function(){id(z,ie.slice(ge),te.length-ge,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},Ji.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ji.prototype.onKeyPress=function(){xe&&Me>=9&&(this.hasSelection=null),this.fastPoll()},Ji.prototype.onContextMenu=function(x){var z=this,ne=z.cm,te=ne.display,ie=z.textarea;z.contextMenuPending&&z.contextMenuPending();var de=xo(ne,x),ge=te.scroller.scrollTop;if(!de||Re)return;var Ce=ne.options.resetSelectionOnContextMenu;Ce&&ne.doc.sel.contains(de)==-1&&wa(ne,Sa)(ne.doc,Ro(de),qe);var ke=ie.style.cssText,Ke=z.wrapper.style.cssText,Et=z.wrapper.offsetParent.getBoundingClientRect();z.wrapper.style.cssText="position: static",ie.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(x.clientY-Et.top-5)+"px; left: "+(x.clientX-Et.left-5)+`px;
z-index: 1000; background: `+(xe?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Pt;De&&(Pt=window.scrollY),te.input.focus(),De&&window.scrollTo(null,Pt),te.input.reset(),ne.somethingSelected()||(ie.value=z.prevInput=" "),z.contextMenuPending=rn,te.selForContextMenu=ne.doc.sel,clearTimeout(te.detectingSelectAll);function cn(){if(ie.selectionStart!=null){var nr=ne.somethingSelected(),xr="\u200B"+(nr?ie.value:"");ie.value="\u21DA",ie.value=xr,z.prevInput=nr?"":"\u200B",ie.selectionStart=1,ie.selectionEnd=xr.length,te.selForContextMenu=ne.doc.sel}}function rn(){if(z.contextMenuPending==rn&&(z.contextMenuPending=!1,z.wrapper.style.cssText=Ke,ie.style.cssText=ke,xe&&Me<9&&te.scrollbars.setScrollTop(te.scroller.scrollTop=ge),ie.selectionStart!=null)){(!xe||xe&&Me<9)&&cn();var nr=0,xr=function(){te.selForContextMenu==ne.doc.sel&&ie.selectionStart==0&&ie.selectionEnd>0&&z.prevInput=="\u200B"?wa(ne,ju)(ne):nr++<10?te.detectingSelectAll=setTimeout(xr,500):(te.selForContextMenu=null,te.input.reset())};te.detectingSelectAll=setTimeout(xr,200)}}if(xe&&Me>=9&&cn(),$e){wr(x);var Bn=function(){Qe(window,"mouseup",Bn),setTimeout(rn,20)};qt(window,"mouseup",Bn)}else setTimeout(rn,50)},Ji.prototype.readOnlyChanged=function(x){x||this.reset(),this.textarea.disabled=x=="nocursor",this.textarea.readOnly=!!x},Ji.prototype.setUneditable=function(){},Ji.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=tt();z.autofocus=ne==x||x.getAttribute("autofocus")!=null&&ne==document.body}function te(){x.value=Ce.getValue()}var ie;if(x.form&&(qt(x.form,"submit",te),!z.leaveSubmitMethodAlone)){var de=x.form;ie=de.submit;try{var ge=de.submit=function(){te(),de.submit=ie,de.submit(),de.submit=ge}}catch(ke){}}z.finishInit=function(ke){ke.save=te,ke.getTextArea=function(){return x},ke.toTextArea=function(){ke.toTextArea=isNaN,te(),x.parentNode.removeChild(ke.getWrapperElement()),x.style.display="",x.form&&(Qe(x.form,"submit",te),!z.leaveSubmitMethodAlone&&typeof x.form.submit=="function"&&(x.form.submit=ie))}},x.style.display="none";var Ce=oi(function(ke){return x.parentNode.insertBefore(ke,x.nextSibling)},z);return Ce}function Pl(x){x.off=Qe,x.on=qt,x.wheelEventPixels=Ru,x.Doc=va,x.splitLines=Gr,x.countColumn=Ne,x.findColumn=dn,x.isWordChar=he,x.Pass=Vt,x.signal=mt,x.Line=mr,x.changeEnd=us,x.scrollbarModel=Bu,x.Pos=zt,x.cmpPos=ln,x.modes=Yr,x.mimeModes=Zr,x.resolveMode=Ln,x.getMode=Wn,x.modeExtensions=Er,x.extendMode=St,x.copyState=Le,x.startState=Be,x.innerMode=We,x.commands=Al,x.keyMap=Yi,x.keyName=ul,x.isModifierKey=sc,x.lookupKey=ms,x.normalizeKeyMap=qu,x.StringStream=Oe,x.SharedTextMarker=bi,x.TextMarker=Bs,x.LineWidget=Ml,x.e_preventDefault=Tn,x.e_stopPropagation=Zn,x.e_stop=wr,x.addClass=$t,x.contains=kt,x.rmClass=Ve,x.keyNames=Fo}of(oi),ld(oi);var ys="iter insert remove copy getEditor constructor".split(" ");for(var Oo in va.prototype)va.prototype.hasOwnProperty(Oo)&&xt(ys,Oo)<0&&(oi.prototype[Oo]=function(x){return function(){return x.apply(this.doc,arguments)}}(va.prototype[Oo]));return wn(va),oi.inputStyles={textarea:Ji,contenteditable:Vi},oi.defineMode=function(x){!oi.defaults.mode&&x!="null"&&(oi.defaults.mode=x),dr.apply(this,arguments)},oi.defineMIME=_r,oi.defineMode("null",function(){return{token:function(x){return x.skipToEnd()}}}),oi.defineMIME("text/plain","null"),oi.defineExtension=function(x,z){oi.prototype[x]=z},oi.defineDocExtension=function(x,z){va.prototype[x]=z},oi.fromTextArea=hl,Pl(oi),oi.version="5.58.2",oi})},25419:function(bn,tn,ue){(function(se){se(ue(89780),ue(15525),ue(98101))})(function(se){"use strict";se.defineMode("markdown",function(Te,ze){var ut=se.getMode(Te,"text/html"),xe=ut.name=="null";function Me(Ne){if(se.findModeByName){var be=se.findModeByName(Ne);be&&(Ne=be.mime||be.mimes[0])}var xt=se.getMode(Te,Ne);return xt.name=="null"?null:xt}ze.highlightFormatting===void 0&&(ze.highlightFormatting=!1),ze.maxBlockquoteDepth===void 0&&(ze.maxBlockquoteDepth=0),ze.taskLists===void 0&&(ze.taskLists=!1),ze.strikethrough===void 0&&(ze.strikethrough=!1),ze.emoji===void 0&&(ze.emoji=!1),ze.fencedCodeBlockHighlighting===void 0&&(ze.fencedCodeBlockHighlighting=!0),ze.fencedCodeBlockDefaultMode===void 0&&(ze.fencedCodeBlockDefaultMode="text/plain"),ze.xml===void 0&&(ze.xml=!0),ze.tokenTypeOverrides===void 0&&(ze.tokenTypeOverrides={});var De={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 we in De)De.hasOwnProperty(we)&&ze.tokenTypeOverrides[we]&&(De[we]=ze.tokenTypeOverrides[we]);var _e=/^([*\-_])(?:\s*\1){2,}\s*$/,Re=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,dt=/^\[(x| )\](?=\s)/i,Ae=ze.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,Fe=/^ {0,3}(?:\={1,}|-{2,})\s*$/,ft=/^[^#!\[\]*_\\<>` "'(~:]+/,Ye=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,ot=/^\s*\[[^\]]+?\]:.*$/,at=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,Ct=" ";function jt(Ne,be,xt){return be.f=be.inline=xt,xt(Ne,be)}function it(Ne,be,xt){return be.f=be.block=xt,xt(Ne,be)}function vt(Ne){return!Ne||!/\S/.test(Ne.string)}function $e(Ne){if(Ne.linkTitle=!1,Ne.linkHref=!1,Ne.linkText=!1,Ne.em=!1,Ne.strong=!1,Ne.strikethrough=!1,Ne.quote=0,Ne.indentedCode=!1,Ne.f==Ve){var be=xe;if(!be){var xt=se.innerMode(ut,Ne.htmlState);be=xt.mode.name=="xml"&&xt.state.tagStart===null&&!xt.state.context&&xt.state.tokenize.isInText}be&&(Ne.f=Dt,Ne.block=Ee,Ne.htmlState=null)}return Ne.trailingSpace=0,Ne.trailingSpaceNewLine=!1,Ne.prevLine=Ne.thisLine,Ne.thisLine={stream:null},null}function Ee(Ne,be){var xt=Ne.column()===be.indentation,Qt=vt(be.prevLine.stream),Vt=be.indentedCode,qe=be.prevLine.hr,nt=be.list!==!1,Ot=(be.listStack[be.listStack.length-1]||0)+3;be.indentedCode=!1;var dn=be.indentation;if(be.indentationDiff===null&&(be.indentationDiff=be.indentation,nt)){for(be.list=null;dn<be.listStack[be.listStack.length-1];)be.listStack.pop(),be.listStack.length?be.indentation=be.listStack[be.listStack.length-1]:be.list=!1;be.list!==!1&&(be.indentationDiff=dn-be.listStack[be.listStack.length-1])}var en=!Qt&&!qe&&!be.prevLine.header&&(!nt||!Vt)&&!be.prevLine.fencedCodeEnd,on=(be.list===!1||qe||Qt)&&be.indentation<=Ot&&Ne.match(_e),Xt=null;if(be.indentationDiff>=4&&(Vt||be.prevLine.fencedCodeEnd||be.prevLine.header||Qt))return Ne.skipToEnd(),be.indentedCode=!0,De.code;if(Ne.eatSpace())return null;if(xt&&be.indentation<=Ot&&(Xt=Ne.match(Ae))&&Xt[1].length<=6)return be.quote=0,be.header=Xt[1].length,be.thisLine.header=!0,ze.highlightFormatting&&(be.formatting="header"),be.f=be.inline,Lt(be);if(be.indentation<=Ot&&Ne.eat(">"))return be.quote=xt?1:be.quote+1,ze.highlightFormatting&&(be.formatting="quote"),Ne.eatSpace(),Lt(be);if(!on&&!be.setext&&xt&&be.indentation<=Ot&&(Xt=Ne.match(Re))){var Ut=Xt[1]?"ol":"ul";return be.indentation=dn+Ne.current().length,be.list=!0,be.quote=0,be.listStack.push(be.indentation),be.em=!1,be.strong=!1,be.code=!1,be.strikethrough=!1,ze.taskLists&&Ne.match(dt,!1)&&(be.taskList=!0),be.f=be.inline,ze.highlightFormatting&&(be.formatting=["list","list-"+Ut]),Lt(be)}else{if(xt&&be.indentation<=Ot&&(Xt=Ne.match(Ye,!0)))return be.quote=0,be.fencedEndRE=new RegExp(Xt[1]+"+ *$"),be.localMode=ze.fencedCodeBlockHighlighting&&Me(Xt[2]||ze.fencedCodeBlockDefaultMode),be.localMode&&(be.localState=se.startState(be.localMode)),be.f=be.block=Je,ze.highlightFormatting&&(be.formatting="code-block"),be.code=-1,Lt(be);if(be.setext||(!en||!nt)&&!be.quote&&be.list===!1&&!be.code&&!on&&!ot.test(Ne.string)&&(Xt=Ne.lookAhead(1))&&(Xt=Xt.match(Fe)))return be.setext?(be.header=be.setext,be.setext=0,Ne.skipToEnd(),ze.highlightFormatting&&(be.formatting="header")):(be.header=Xt[0].charAt(0)=="="?1:2,be.setext=be.header),be.thisLine.header=!0,be.f=be.inline,Lt(be);if(on)return Ne.skipToEnd(),be.hr=!0,be.thisLine.hr=!0,De.hr;if(Ne.peek()==="[")return jt(Ne,be,pt)}return jt(Ne,be,be.inline)}function Ve(Ne,be){var xt=ut.token(Ne,be.htmlState);if(!xe){var Qt=se.innerMode(ut,be.htmlState);(Qt.mode.name=="xml"&&Qt.state.tagStart===null&&!Qt.state.context&&Qt.state.tokenize.isInText||be.md_inside&&Ne.current().indexOf(">")>-1)&&(be.f=Dt,be.block=Ee,be.htmlState=null)}return xt}function Je(Ne,be){var xt=be.listStack[be.listStack.length-1]||0,Qt=be.indentation<xt,Vt=xt+3;if(be.fencedEndRE&&be.indentation<=Vt&&(Qt||Ne.match(be.fencedEndRE))){ze.highlightFormatting&&(be.formatting="code-block");var qe;return Qt||(qe=Lt(be)),be.localMode=be.localState=null,be.block=Ee,be.f=Dt,be.fencedEndRE=null,be.code=0,be.thisLine.fencedCodeEnd=!0,Qt?it(Ne,be,be.block):qe}else return be.localMode?be.localMode.token(Ne,be.localState):(Ne.skipToEnd(),De.code)}function Lt(Ne){var be=[];if(Ne.formatting){be.push(De.formatting),typeof Ne.formatting=="string"&&(Ne.formatting=[Ne.formatting]);for(var xt=0;xt<Ne.formatting.length;xt++)be.push(De.formatting+"-"+Ne.formatting[xt]),Ne.formatting[xt]==="header"&&be.push(De.formatting+"-"+Ne.formatting[xt]+"-"+Ne.header),Ne.formatting[xt]==="quote"&&(!ze.maxBlockquoteDepth||ze.maxBlockquoteDepth>=Ne.quote?be.push(De.formatting+"-"+Ne.formatting[xt]+"-"+Ne.quote):be.push("error"))}if(Ne.taskOpen)return be.push("meta"),be.length?be.join(" "):null;if(Ne.taskClosed)return be.push("property"),be.length?be.join(" "):null;if(Ne.linkHref?be.push(De.linkHref,"url"):(Ne.strong&&be.push(De.strong),Ne.em&&be.push(De.em),Ne.strikethrough&&be.push(De.strikethrough),Ne.emoji&&be.push(De.emoji),Ne.linkText&&be.push(De.linkText),Ne.code&&be.push(De.code),Ne.image&&be.push(De.image),Ne.imageAltText&&be.push(De.imageAltText,"link"),Ne.imageMarker&&be.push(De.imageMarker)),Ne.header&&be.push(De.header,De.header+"-"+Ne.header),Ne.quote&&(be.push(De.quote),!ze.maxBlockquoteDepth||ze.maxBlockquoteDepth>=Ne.quote?be.push(De.quote+"-"+Ne.quote):be.push(De.quote+"-"+ze.maxBlockquoteDepth)),Ne.list!==!1){var Qt=(Ne.listStack.length-1)%3;Qt?Qt===1?be.push(De.list2):be.push(De.list3):be.push(De.list1)}return Ne.trailingSpaceNewLine?be.push("trailing-space-new-line"):Ne.trailingSpace&&be.push("trailing-space-"+(Ne.trailingSpace%2?"a":"b")),be.length?be.join(" "):null}function et(Ne,be){if(Ne.match(ft,!0))return Lt(be)}function Dt(Ne,be){var xt=be.text(Ne,be);if(typeof xt!="undefined")return xt;if(be.list)return be.list=null,Lt(be);if(be.taskList){var Qt=Ne.match(dt,!0)[1]===" ";return Qt?be.taskOpen=!0:be.taskClosed=!0,ze.highlightFormatting&&(be.formatting="task"),be.taskList=!1,Lt(be)}if(be.taskOpen=!1,be.taskClosed=!1,be.header&&Ne.match(/^#+$/,!0))return ze.highlightFormatting&&(be.formatting="header"),Lt(be);var Vt=Ne.next();if(be.linkTitle){be.linkTitle=!1;var qe=Vt;Vt==="("&&(qe=")"),qe=(qe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var nt="^\\s*(?:[^"+qe+"\\\\]+|\\\\\\\\|\\\\.)"+qe;if(Ne.match(new RegExp(nt),!0))return De.linkHref}if(Vt==="`"){var Ot=be.formatting;ze.highlightFormatting&&(be.formatting="code"),Ne.eatWhile("`");var dn=Ne.current().length;if(be.code==0&&(!be.quote||dn==1))return be.code=dn,Lt(be);if(dn==be.code){var en=Lt(be);return be.code=0,en}else return be.formatting=Ot,Lt(be)}else if(be.code)return Lt(be);if(Vt==="\\"&&(Ne.next(),ze.highlightFormatting)){var on=Lt(be),Xt=De.formatting+"-escape";return on?on+" "+Xt:Xt}if(Vt==="!"&&Ne.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return be.imageMarker=!0,be.image=!0,ze.highlightFormatting&&(be.formatting="image"),Lt(be);if(Vt==="["&&be.imageMarker&&Ne.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return be.imageMarker=!1,be.imageAltText=!0,ze.highlightFormatting&&(be.formatting="image"),Lt(be);if(Vt==="]"&&be.imageAltText){ze.highlightFormatting&&(be.formatting="image");var on=Lt(be);return be.imageAltText=!1,be.image=!1,be.inline=be.f=kt,on}if(Vt==="["&&!be.image)return be.linkText&&Ne.match(/^.*?\]/)||(be.linkText=!0,ze.highlightFormatting&&(be.formatting="link")),Lt(be);if(Vt==="]"&&be.linkText){ze.highlightFormatting&&(be.formatting="link");var on=Lt(be);return be.linkText=!1,be.inline=be.f=Ne.match(/\(.*?\)| ?\[.*?\]/,!1)?kt:Dt,on}if(Vt==="<"&&Ne.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){be.f=be.inline=Ge,ze.highlightFormatting&&(be.formatting="link");var on=Lt(be);return on?on+=" ":on="",on+De.linkInline}if(Vt==="<"&&Ne.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){be.f=be.inline=Ge,ze.highlightFormatting&&(be.formatting="link");var on=Lt(be);return on?on+=" ":on="",on+De.linkEmail}if(ze.xml&&Vt==="<"&&Ne.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Ut=Ne.string.indexOf(">",Ne.pos);if(Ut!=-1){var Zt=Ne.string.substring(Ne.start,Ut);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Zt)&&(be.md_inside=!0)}return Ne.backUp(1),be.htmlState=se.startState(ut),it(Ne,be,Ve)}if(ze.xml&&Vt==="<"&&Ne.match(/^\/\w*?>/))return be.md_inside=!1,"tag";if(Vt==="*"||Vt==="_"){for(var ye=1,le=Ne.pos==1?" ":Ne.string.charAt(Ne.pos-2);ye<3&&Ne.eat(Vt);)ye++;var oe=Ne.peek()||" ",he=!/\s/.test(oe)&&(!at.test(oe)||/\s/.test(le)||at.test(le)),pe=!/\s/.test(le)&&(!at.test(le)||/\s/.test(oe)||at.test(oe)),ce=null,Ie=null;if(ye%2&&(!be.em&&he&&(Vt==="*"||!pe||at.test(le))?ce=!0:be.em==Vt&&pe&&(Vt==="*"||!he||at.test(oe))&&(ce=!1)),ye>1&&(!be.strong&&he&&(Vt==="*"||!pe||at.test(le))?Ie=!0:be.strong==Vt&&pe&&(Vt==="*"||!he||at.test(oe))&&(Ie=!1)),Ie!=null||ce!=null){ze.highlightFormatting&&(be.formatting=ce==null?"strong":Ie==null?"em":"strong em"),ce===!0&&(be.em=Vt),Ie===!0&&(be.strong=Vt);var en=Lt(be);return ce===!1&&(be.em=!1),Ie===!1&&(be.strong=!1),en}}else if(Vt===" "&&(Ne.eat("*")||Ne.eat("_"))){if(Ne.peek()===" ")return Lt(be);Ne.backUp(1)}if(ze.strikethrough){if(Vt==="~"&&Ne.eatWhile(Vt)){if(be.strikethrough){ze.highlightFormatting&&(be.formatting="strikethrough");var en=Lt(be);return be.strikethrough=!1,en}else if(Ne.match(/^[^\s]/,!1))return be.strikethrough=!0,ze.highlightFormatting&&(be.formatting="strikethrough"),Lt(be)}else if(Vt===" "&&Ne.match(/^~~/,!0)){if(Ne.peek()===" ")return Lt(be);Ne.backUp(2)}}if(ze.emoji&&Vt===":"&&Ne.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){be.emoji=!0,ze.highlightFormatting&&(be.formatting="emoji");var yt=Lt(be);return be.emoji=!1,yt}return Vt===" "&&(Ne.match(/^ +$/,!1)?be.trailingSpace++:be.trailingSpace&&(be.trailingSpaceNewLine=!0)),Lt(be)}function Ge(Ne,be){var xt=Ne.next();if(xt===">"){be.f=be.inline=Dt,ze.highlightFormatting&&(be.formatting="link");var Qt=Lt(be);return Qt?Qt+=" ":Qt="",Qt+De.linkInline}return Ne.match(/^[^>]+/,!0),De.linkInline}function kt(Ne,be){if(Ne.eatSpace())return null;var xt=Ne.next();return xt==="("||xt==="["?(be.f=be.inline=$t(xt==="("?")":"]"),ze.highlightFormatting&&(be.formatting="link-string"),be.linkHref=!0,Lt(be)):"error"}var tt={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function $t(Ne){return function(be,xt){var Qt=be.next();if(Qt===Ne){xt.f=xt.inline=Dt,ze.highlightFormatting&&(xt.formatting="link-string");var Vt=Lt(xt);return xt.linkHref=!1,Vt}return be.match(tt[Ne]),xt.linkHref=!0,Lt(xt)}}function pt(Ne,be){return Ne.match(/^([^\]\\]|\\.)*\]:/,!1)?(be.f=Bt,Ne.next(),ze.highlightFormatting&&(be.formatting="link"),be.linkText=!0,Lt(be)):jt(Ne,be,Dt)}function Bt(Ne,be){if(Ne.match(/^\]:/,!0)){be.f=be.inline=Tt,ze.highlightFormatting&&(be.formatting="link");var xt=Lt(be);return be.linkText=!1,xt}return Ne.match(/^([^\]\\]|\\.)+/,!0),De.linkText}function Tt(Ne,be){return Ne.eatSpace()?null:(Ne.match(/^[^\s]+/,!0),Ne.peek()===void 0?be.linkTitle=!0:Ne.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),be.f=be.inline=Dt,De.linkHref+" url")}var wt={startState:function(){return{f:Ee,prevLine:{stream:null},thisLine:{stream:null},block:Ee,htmlState:null,indentation:0,inline:Dt,text:et,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(Ne){return{f:Ne.f,prevLine:Ne.prevLine,thisLine:Ne.thisLine,block:Ne.block,htmlState:Ne.htmlState&&se.copyState(ut,Ne.htmlState),indentation:Ne.indentation,localMode:Ne.localMode,localState:Ne.localMode?se.copyState(Ne.localMode,Ne.localState):null,inline:Ne.inline,text:Ne.text,formatting:!1,linkText:Ne.linkText,linkTitle:Ne.linkTitle,linkHref:Ne.linkHref,code:Ne.code,em:Ne.em,strong:Ne.strong,strikethrough:Ne.strikethrough,emoji:Ne.emoji,header:Ne.header,setext:Ne.setext,hr:Ne.hr,taskList:Ne.taskList,list:Ne.list,listStack:Ne.listStack.slice(0),quote:Ne.quote,indentedCode:Ne.indentedCode,trailingSpace:Ne.trailingSpace,trailingSpaceNewLine:Ne.trailingSpaceNewLine,md_inside:Ne.md_inside,fencedEndRE:Ne.fencedEndRE}},token:function(Ne,be){if(be.formatting=!1,Ne!=be.thisLine.stream){if(be.header=0,be.hr=!1,Ne.match(/^\s*$/,!0))return $e(be),null;if(be.prevLine=be.thisLine,be.thisLine={stream:Ne},be.taskList=!1,be.trailingSpace=0,be.trailingSpaceNewLine=!1,!be.localState&&(be.f=be.block,be.f!=Ve)){var xt=Ne.match(/^\s*/,!0)[0].replace(/\t/g,Ct).length;if(be.indentation=xt,be.indentationDiff=null,xt>0)return null}}return be.f(Ne,be)},innerMode:function(Ne){return Ne.block==Ve?{state:Ne.htmlState,mode:ut}:Ne.localState?{state:Ne.localState,mode:Ne.localMode}:{state:Ne,mode:wt}},indent:function(Ne,be,xt){return Ne.block==Ve&&ut.indent?ut.indent(Ne.htmlState,be,xt):Ne.localState&&Ne.localMode.indent?Ne.localMode.indent(Ne.localState,be,xt):se.Pass},blankLine:$e,getType:Lt,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return wt},"xml"),se.defineMIME("text/markdown","markdown"),se.defineMIME("text/x-markdown","markdown")})},98101:function(bn,tn,ue){(function(se){se(ue(89780))})(function(se){"use strict";se.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 Te=0;Te<se.modeInfo.length;Te++){var ze=se.modeInfo[Te];ze.mimes&&(ze.mime=ze.mimes[0])}se.findModeByMIME=function(ut){ut=ut.toLowerCase();for(var xe=0;xe<se.modeInfo.length;xe++){var Me=se.modeInfo[xe];if(Me.mime==ut)return Me;if(Me.mimes){for(var De=0;De<Me.mimes.length;De++)if(Me.mimes[De]==ut)return Me}}if(/\+xml$/.test(ut))return se.findModeByMIME("application/xml");if(/\+json$/.test(ut))return se.findModeByMIME("application/json")},se.findModeByExtension=function(ut){ut=ut.toLowerCase();for(var xe=0;xe<se.modeInfo.length;xe++){var Me=se.modeInfo[xe];if(Me.ext){for(var De=0;De<Me.ext.length;De++)if(Me.ext[De]==ut)return Me}}},se.findModeByFileName=function(ut){for(var xe=0;xe<se.modeInfo.length;xe++){var Me=se.modeInfo[xe];if(Me.file&&Me.file.test(ut))return Me}var De=ut.lastIndexOf("."),we=De>-1&&ut.substring(De+1,ut.length);if(we)return se.findModeByExtension(we)},se.findModeByName=function(ut){ut=ut.toLowerCase();for(var xe=0;xe<se.modeInfo.length;xe++){var Me=se.modeInfo[xe];if(Me.name.toLowerCase()==ut)return Me;if(Me.alias){for(var De=0;De<Me.alias.length;De++)if(Me.alias[De].toLowerCase()==ut)return Me}}}})},67549:function(bn,tn,ue){(function(se){se(ue(89780))})(function(se){"use strict";se.defineMode("stex",function(Te,ze){"use strict";function ut(ft,Ye){ft.cmdState.push(Ye)}function xe(ft){return ft.cmdState.length>0?ft.cmdState[ft.cmdState.length-1]:null}function Me(ft){var Ye=ft.cmdState.pop();Ye&&Ye.closeBracket()}function De(ft){for(var Ye=ft.cmdState,ot=Ye.length-1;ot>=0;ot--){var at=Ye[ot];if(at.name!="DEFAULT")return at}return{styleIdentifier:function(){return null}}}function we(ft,Ye,ot){return function(){this.name=ft,this.bracketNo=0,this.style=Ye,this.styles=ot,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var _e={};_e.importmodule=we("importmodule","tag",["string","builtin"]),_e.documentclass=we("documentclass","tag",["","atom"]),_e.usepackage=we("usepackage","tag",["atom"]),_e.begin=we("begin","tag",["atom"]),_e.end=we("end","tag",["atom"]),_e.label=we("label","tag",["atom"]),_e.ref=we("ref","tag",["atom"]),_e.eqref=we("eqref","tag",["atom"]),_e.cite=we("cite","tag",["atom"]),_e.bibitem=we("bibitem","tag",["atom"]),_e.Bibitem=we("Bibitem","tag",["atom"]),_e.RBibitem=we("RBibitem","tag",["atom"]),_e.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function Re(ft,Ye){ft.f=Ye}function dt(ft,Ye){var ot;if(ft.match(/^\\[a-zA-Z@]+/)){var at=ft.current().slice(1);return ot=_e.hasOwnProperty(at)?_e[at]:_e.DEFAULT,ot=new ot,ut(Ye,ot),Re(Ye,Fe),ot.style}if(ft.match(/^\\[$&%#{}_]/)||ft.match(/^\\[,;!\/\\]/))return"tag";if(ft.match("\\["))return Re(Ye,function(jt,it){return Ae(jt,it,"\\]")}),"keyword";if(ft.match("\\("))return Re(Ye,function(jt,it){return Ae(jt,it,"\\)")}),"keyword";if(ft.match("$$"))return Re(Ye,function(jt,it){return Ae(jt,it,"$$")}),"keyword";if(ft.match("$"))return Re(Ye,function(jt,it){return Ae(jt,it,"$")}),"keyword";var Ct=ft.next();if(Ct=="%")return ft.skipToEnd(),"comment";if(Ct=="}"||Ct=="]"){if(ot=xe(Ye),ot)ot.closeBracket(Ct),Re(Ye,Fe);else return"error";return"bracket"}else return Ct=="{"||Ct=="["?(ot=_e.DEFAULT,ot=new ot,ut(Ye,ot),"bracket"):/\d/.test(Ct)?(ft.eatWhile(/[\w.%]/),"atom"):(ft.eatWhile(/[\w\-_]/),ot=De(Ye),ot.name=="begin"&&(ot.argument=ft.current()),ot.styleIdentifier())}function Ae(ft,Ye,ot){if(ft.eatSpace())return null;if(ot&&ft.match(ot))return Re(Ye,dt),"keyword";if(ft.match(/^\\[a-zA-Z@]+/))return"tag";if(ft.match(/^[a-zA-Z]+/))return"variable-2";if(ft.match(/^\\[$&%#{}_]/)||ft.match(/^\\[,;!\/]/)||ft.match(/^[\^_&]/))return"tag";if(ft.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(ft.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var at=ft.next();return at=="{"||at=="}"||at=="["||at=="]"||at=="("||at==")"?"bracket":at=="%"?(ft.skipToEnd(),"comment"):"error"}function Fe(ft,Ye){var ot=ft.peek(),at;return ot=="{"||ot=="["?(at=xe(Ye),at.openBracket(ot),ft.eat(ot),Re(Ye,dt),"bracket"):/[ \t\r]/.test(ot)?(ft.eat(ot),null):(Re(Ye,dt),Me(Ye),dt(ft,Ye))}return{startState:function(){var ft=ze.inMathMode?function(Ye,ot){return Ae(Ye,ot)}:dt;return{cmdState:[],f:ft}},copyState:function(ft){return{cmdState:ft.cmdState.slice(),f:ft.f}},token:function(ft,Ye){return Ye.f(ft,Ye)},blankLine:function(ft){ft.f=dt,ft.cmdState.length=0},lineComment:"%"}}),se.defineMIME("text/x-stex","stex"),se.defineMIME("text/x-latex","stex")})},15525:function(bn,tn,ue){(function(se){se(ue(89780))})(function(se){"use strict";var Te={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},ze={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};se.defineMode("xml",function(ut,xe){var Me=ut.indentUnit,De={},we=xe.htmlMode?Te:ze;for(var _e in we)De[_e]=we[_e];for(var _e in xe)De[_e]=xe[_e];var Re,dt;function Ae(Ge,kt){function tt(Bt){return kt.tokenize=Bt,Bt(Ge,kt)}var $t=Ge.next();if($t=="<")return Ge.eat("!")?Ge.eat("[")?Ge.match("CDATA[")?tt(Ye("atom","]]>")):null:Ge.match("--")?tt(Ye("comment","-->")):Ge.match("DOCTYPE",!0,!0)?(Ge.eatWhile(/[\w\._\-]/),tt(ot(1))):null:Ge.eat("?")?(Ge.eatWhile(/[\w\._\-]/),kt.tokenize=Ye("meta","?>"),"meta"):(Re=Ge.eat("/")?"closeTag":"openTag",kt.tokenize=Fe,"tag bracket");if($t=="&"){var pt;return Ge.eat("#")?Ge.eat("x")?pt=Ge.eatWhile(/[a-fA-F\d]/)&&Ge.eat(";"):pt=Ge.eatWhile(/[\d]/)&&Ge.eat(";"):pt=Ge.eatWhile(/[\w\.\-:]/)&&Ge.eat(";"),pt?"atom":"error"}else return Ge.eatWhile(/[^&<]/),null}Ae.isInText=!0;function Fe(Ge,kt){var tt=Ge.next();if(tt==">"||tt=="/"&&Ge.eat(">"))return kt.tokenize=Ae,Re=tt==">"?"endTag":"selfcloseTag","tag bracket";if(tt=="=")return Re="equals",null;if(tt=="<"){kt.tokenize=Ae,kt.state=it,kt.tagName=kt.tagStart=null;var $t=kt.tokenize(Ge,kt);return $t?$t+" tag error":"tag error"}else return/[\'\"]/.test(tt)?(kt.tokenize=ft(tt),kt.stringStartCol=Ge.column(),kt.tokenize(Ge,kt)):(Ge.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function ft(Ge){var kt=function(tt,$t){for(;!tt.eol();)if(tt.next()==Ge){$t.tokenize=Fe;break}return"string"};return kt.isInAttribute=!0,kt}function Ye(Ge,kt){return function(tt,$t){for(;!tt.eol();){if(tt.match(kt)){$t.tokenize=Ae;break}tt.next()}return Ge}}function ot(Ge){return function(kt,tt){for(var $t;($t=kt.next())!=null;){if($t=="<")return tt.tokenize=ot(Ge+1),tt.tokenize(kt,tt);if($t==">")if(Ge==1){tt.tokenize=Ae;break}else return tt.tokenize=ot(Ge-1),tt.tokenize(kt,tt)}return"meta"}}function at(Ge,kt,tt){this.prev=Ge.context,this.tagName=kt,this.indent=Ge.indented,this.startOfLine=tt,(De.doNotIndent.hasOwnProperty(kt)||Ge.context&&Ge.context.noIndent)&&(this.noIndent=!0)}function Ct(Ge){Ge.context&&(Ge.context=Ge.context.prev)}function jt(Ge,kt){for(var tt;;){if(!Ge.context||(tt=Ge.context.tagName,!De.contextGrabbers.hasOwnProperty(tt)||!De.contextGrabbers[tt].hasOwnProperty(kt)))return;Ct(Ge)}}function it(Ge,kt,tt){return Ge=="openTag"?(tt.tagStart=kt.column(),vt):Ge=="closeTag"?$e:it}function vt(Ge,kt,tt){return Ge=="word"?(tt.tagName=kt.current(),dt="tag",Je):De.allowMissingTagName&&Ge=="endTag"?(dt="tag bracket",Je(Ge,kt,tt)):(dt="error",vt)}function $e(Ge,kt,tt){if(Ge=="word"){var $t=kt.current();return tt.context&&tt.context.tagName!=$t&&De.implicitlyClosed.hasOwnProperty(tt.context.tagName)&&Ct(tt),tt.context&&tt.context.tagName==$t||De.matchClosing===!1?(dt="tag",Ee):(dt="tag error",Ve)}else return De.allowMissingTagName&&Ge=="endTag"?(dt="tag bracket",Ee(Ge,kt,tt)):(dt="error",Ve)}function Ee(Ge,kt,tt){return Ge!="endTag"?(dt="error",Ee):(Ct(tt),it)}function Ve(Ge,kt,tt){return dt="error",Ee(Ge,kt,tt)}function Je(Ge,kt,tt){if(Ge=="word")return dt="attribute",Lt;if(Ge=="endTag"||Ge=="selfcloseTag"){var $t=tt.tagName,pt=tt.tagStart;return tt.tagName=tt.tagStart=null,Ge=="selfcloseTag"||De.autoSelfClosers.hasOwnProperty($t)?jt(tt,$t):(jt(tt,$t),tt.context=new at(tt,$t,pt==tt.indented)),it}return dt="error",Je}function Lt(Ge,kt,tt){return Ge=="equals"?et:(De.allowMissing||(dt="error"),Je(Ge,kt,tt))}function et(Ge,kt,tt){return Ge=="string"?Dt:Ge=="word"&&De.allowUnquoted?(dt="string",Je):(dt="error",Je(Ge,kt,tt))}function Dt(Ge,kt,tt){return Ge=="string"?Dt:Je(Ge,kt,tt)}return{startState:function(Ge){var kt={tokenize:Ae,state:it,indented:Ge||0,tagName:null,tagStart:null,context:null};return Ge!=null&&(kt.baseIndent=Ge),kt},token:function(Ge,kt){if(!kt.tagName&&Ge.sol()&&(kt.indented=Ge.indentation()),Ge.eatSpace())return null;Re=null;var tt=kt.tokenize(Ge,kt);return(tt||Re)&&tt!="comment"&&(dt=null,kt.state=kt.state(Re||tt,Ge,kt),dt&&(tt=dt=="error"?tt+" error":dt)),tt},indent:function(Ge,kt,tt){var $t=Ge.context;if(Ge.tokenize.isInAttribute)return Ge.tagStart==Ge.indented?Ge.stringStartCol+1:Ge.indented+Me;if($t&&$t.noIndent)return se.Pass;if(Ge.tokenize!=Fe&&Ge.tokenize!=Ae)return tt?tt.match(/^(\s*)/)[0].length:0;if(Ge.tagName)return De.multilineTagIndentPastTag!==!1?Ge.tagStart+Ge.tagName.length+2:Ge.tagStart+Me*(De.multilineTagIndentFactor||1);if(De.alignCDATA&&/<!\[CDATA\[/.test(kt))return 0;var pt=kt&&/^<(\/)?([\w_:\.-]*)/.exec(kt);if(pt&&pt[1])for(;$t;)if($t.tagName==pt[2]){$t=$t.prev;break}else if(De.implicitlyClosed.hasOwnProperty($t.tagName))$t=$t.prev;else break;else if(pt)for(;$t;){var Bt=De.contextGrabbers[$t.tagName];if(Bt&&Bt.hasOwnProperty(pt[2]))$t=$t.prev;else break}for(;$t&&$t.prev&&!$t.startOfLine;)$t=$t.prev;return $t?$t.indent+Me:Ge.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:De.htmlMode?"html":"xml",helperType:De.htmlMode?"html":"xml",skipAttribute:function(Ge){Ge.state==et&&(Ge.state=Je)},xmlCurrentTag:function(Ge){return Ge.tagName?{name:Ge.tagName,close:Ge.type=="closeTag"}:null},xmlCurrentContext:function(Ge){for(var kt=[],tt=Ge.context;tt;tt=tt.prev)tt.tagName&&kt.push(tt.tagName);return kt.reverse()}}}),se.defineMIME("text/xml","xml"),se.defineMIME("application/xml","xml"),se.mimeModes.hasOwnProperty("text/html")||se.defineMIME("text/html",{name:"xml",htmlMode:!0})})},2859:function(bn,tn,ue){"use strict";ue.d(tn,{hP:function(){return Zt}});var se=function(ye,le){return(se=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(oe,he){oe.__proto__=he}||function(oe,he){for(var pe in he)Object.prototype.hasOwnProperty.call(he,pe)&&(oe[pe]=he[pe])})(ye,le)};function Te(ye,le){function oe(){this.constructor=ye}se(ye,le),ye.prototype=le===null?Object.create(le):(oe.prototype=le.prototype,new oe)}function ze(ye,le,oe,he){return new(oe||(oe=Promise))(function(pe,ce){function Ie(je){try{Pe(he.next(je))}catch(Rt){ce(Rt)}}function yt(je){try{Pe(he.throw(je))}catch(Rt){ce(Rt)}}function Pe(je){var Rt;je.done?pe(je.value):(Rt=je.value,Rt instanceof oe?Rt:new oe(function(At){At(Rt)})).then(Ie,yt)}Pe((he=he.apply(ye,le||[])).next())})}function ut(ye,le){var oe,he,pe,ce,Ie={label:0,sent:function(){if(1&pe[0])throw pe[1];return pe[1]},trys:[],ops:[]};return ce={next:yt(0),throw:yt(1),return:yt(2)},typeof Symbol=="function"&&(ce[Symbol.iterator]=function(){return this}),ce;function yt(Pe){return function(je){return function(Rt){if(oe)throw new TypeError("Generator is already executing.");for(;Ie;)try{if(oe=1,he&&(pe=2&Rt[0]?he.return:Rt[0]?he.throw||((pe=he.return)&&pe.call(he),0):he.next)&&!(pe=pe.call(he,Rt[1])).done)return pe;switch(he=0,pe&&(Rt=[2&Rt[0],pe.value]),Rt[0]){case 0:case 1:pe=Rt;break;case 4:return Ie.label++,{value:Rt[1],done:!1};case 5:Ie.label++,he=Rt[1],Rt=[0];continue;case 7:Rt=Ie.ops.pop(),Ie.trys.pop();continue;default:if(pe=Ie.trys,!((pe=pe.length>0&&pe[pe.length-1])||Rt[0]!==6&&Rt[0]!==2)){Ie=0;continue}if(Rt[0]===3&&(!pe||Rt[1]>pe[0]&&Rt[1]<pe[3])){Ie.label=Rt[1];break}if(Rt[0]===6&&Ie.label<pe[1]){Ie.label=pe[1],pe=Rt;break}if(pe&&Ie.label<pe[2]){Ie.label=pe[2],Ie.ops.push(Rt);break}pe[2]&&Ie.ops.pop(),Ie.trys.pop();continue}Rt=le.call(ye,Ie)}catch(At){Rt=[6,At],he=0}finally{oe=pe=0}if(5&Rt[0])throw Rt[1];return{value:Rt[0]?Rt[1]:void 0,done:!0}}([Pe,je])}}}function xe(){for(var ye=0,le=0,oe=arguments.length;le<oe;le++)ye+=arguments[le].length;var he=Array(ye),pe=0;for(le=0;le<oe;le++)for(var ce=arguments[le],Ie=0,yt=ce.length;Ie<yt;Ie++,pe++)he[pe]=ce[Ie];return he}var Me=function(){function ye(){}return ye.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ye.setAttributes=function(le,oe){for(var he=0,pe=oe;he<pe.length;he++){var ce=pe[he],Ie=ce[0],yt=ce[1];le.setAttribute(Ie,yt)}},ye.createRect=function(le,oe,he){var pe=document.createElementNS("http://www.w3.org/2000/svg","rect");return pe.setAttribute("width",le.toString()),pe.setAttribute("height",oe.toString()),he&&ye.setAttributes(pe,he),pe},ye.createLine=function(le,oe,he,pe,ce){var Ie=document.createElementNS("http://www.w3.org/2000/svg","line");return Ie.setAttribute("x1",le.toString()),Ie.setAttribute("y1",oe.toString()),Ie.setAttribute("x2",he.toString()),Ie.setAttribute("y2",pe.toString()),ce&&ye.setAttributes(Ie,ce),Ie},ye.createPolygon=function(le,oe){var he=document.createElementNS("http://www.w3.org/2000/svg","polygon");return he.setAttribute("points",le),oe&&ye.setAttributes(he,oe),he},ye.createCircle=function(le,oe){var he=document.createElementNS("http://www.w3.org/2000/svg","circle");return he.setAttribute("cx",(le/2).toString()),he.setAttribute("cy",(le/2).toString()),he.setAttribute("r",le.toString()),oe&&ye.setAttributes(he,oe),he},ye.createEllipse=function(le,oe,he){var pe=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return pe.setAttribute("cx",(le/2).toString()),pe.setAttribute("cy",(oe/2).toString()),pe.setAttribute("rx",(le/2).toString()),pe.setAttribute("ry",(oe/2).toString()),he&&ye.setAttributes(pe,he),pe},ye.createGroup=function(le){var oe=document.createElementNS("http://www.w3.org/2000/svg","g");return le&&ye.setAttributes(oe,le),oe},ye.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ye.createMarker=function(le,oe,he,pe,ce,Ie,yt){var Pe=document.createElementNS("http://www.w3.org/2000/svg","marker");return ye.setAttributes(Pe,[["id",le],["orient",oe],["markerWidth",he.toString()],["markerHeight",pe.toString()],["refX",ce.toString()],["refY",Ie.toString()]]),Pe.appendChild(yt),Pe},ye.createText=function(le){var oe=document.createElementNS("http://www.w3.org/2000/svg","text");return oe.setAttribute("x","0"),oe.setAttribute("y","0"),le&&ye.setAttributes(oe,le),oe},ye.createTSpan=function(le,oe){var he=document.createElementNS("http://www.w3.org/2000/svg","tspan");return he.textContent=le,oe&&ye.setAttributes(he,oe),he},ye.createImage=function(le){var oe=document.createElementNS("http://www.w3.org/2000/svg","image");return le&&ye.setAttributes(oe,le),oe},ye.createPoint=function(le,oe){var he=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return he.x=le,he.y=oe,he},ye.createPath=function(le,oe){var he=document.createElementNS("http://www.w3.org/2000/svg","path");return he.setAttribute("d",le),oe&&ye.setAttributes(he,oe),he},ye}(),De=function(){function ye(){}return ye.addKey=function(le){ye.key=le},Object.defineProperty(ye,"isLicensed",{get:function(){return!!ye.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ye.key)},enumerable:!1,configurable:!0}),ye}(),we=function(){function ye(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return ye.prototype.rasterize=function(le,oe,he){var pe=this;return new Promise(function(ce){var Ie=he!==void 0?he:document.createElement("canvas");le===null&&(pe.markersOnly=!0,pe.naturalSize=!1);var yt=document.createElementNS("http://www.w3.org/2000/svg","svg");yt.setAttribute("xmlns","http://www.w3.org/2000/svg"),yt.setAttribute("width",oe.width.baseVal.valueAsString),yt.setAttribute("height",oe.height.baseVal.valueAsString),yt.setAttribute("viewBox","0 0 "+oe.viewBox.baseVal.width.toString()+" "+oe.viewBox.baseVal.height.toString()),yt.innerHTML=oe.innerHTML,pe.naturalSize===!0?(yt.width.baseVal.value=le.naturalWidth,yt.height.baseVal.value=le.naturalHeight):pe.width!==void 0&&pe.height!==void 0&&(yt.width.baseVal.value=pe.width,yt.height.baseVal.value=pe.height),Ie.width=yt.width.baseVal.value,Ie.height=yt.height.baseVal.value;var Pe=yt.outerHTML,je=Ie.getContext("2d");pe.markersOnly!==!0&&je.drawImage(le,0,0,Ie.width,Ie.height);var Rt=window.URL,At=new Image(Ie.width,Ie.height);At.setAttribute("crossOrigin","anonymous");var rt=new Blob([Pe],{type:"image/svg+xml"}),Ft=Rt.createObjectURL(rt);At.onload=function(){je.drawImage(At,0,0),Rt.revokeObjectURL(Ft);var sn=Ie.toDataURL(pe.imageType,pe.imageQuality);ce(sn)},At.src=Ft})},ye}(),_e=function(){},Re=function(){function ye(le){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+le+"_"}return Object.defineProperty(ye.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ye.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(ye.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),ye.prototype.addClass=function(le){return this.styleSheet===void 0&&this.addStyleSheet(),le.name=""+this.classNamePrefix+le.localName,this.classes.push(le),this.styleSheet.sheet.insertRule("."+le.name+" {"+le.style+"}",this.styleSheet.sheet.cssRules.length),le},ye.prototype.addRule=function(le){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(le),this.styleSheet.sheet.insertRule(le.selector+" {"+le.style+"}",this.styleSheet.sheet.cssRules.length)},ye.prototype.addStyleSheet=function(){var le;this.styleSheet=document.createElement("style"),((le=this.styleSheetRoot)!==null&&le!==void 0?le:document.head).appendChild(this.styleSheet),this.addRule(new dt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new dt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new dt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Ae("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Ae("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},ye.prototype.removeStyleSheet=function(){var le;this.styleSheet&&(((le=this.styleSheetRoot)!==null&&le!==void 0?le:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ye}(),dt=function(ye,le){this.selector=ye,this.style=le},Ae=function(ye,le){this.localName=ye,this.style=le},Fe=function(){function ye(le,oe,he,pe,ce){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=le,this.displayMode=oe,this.markerItems=he,this.uiStyleSettings=pe,this.styles=ce,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return ye.prototype.show=function(le){var oe=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=le,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var he=document.createElement("div");he.className=this.toolbarBlockStyleClass.name,he.style.whiteSpace="nowrap",this.uiContainer.appendChild(he),this.addActionButton(he,'<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(he,'<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(he,'<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(he,'<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(he,'<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(he,'<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(he,'<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(he,'<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 Ie=document.createElement("div");Ie.className=""+oe.toolbarButtonStyleClass.name,Ie.setAttribute("data-type-name",ce.typeName),Ie.innerHTML=ce.icon,Ie.addEventListener("click",function(){oe.markerToolbarButtonClicked(Ie,ce)}),oe.buttons.push(Ie),oe.markerButtons.push(Ie)}),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 pe=document.createElement("div");pe.className=this.toolbarBlockStyleClass.name,pe.style.whiteSpace="nowrap",pe.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(pe),this.addActionButton(pe,'<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(pe,'<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()},ye.prototype.addButtonClickListener=function(le){this.buttonClickListeners.push(le)},ye.prototype.removeButtonClickListener=function(le){this.buttonClickListeners.indexOf(le)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(le),1)},ye.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},ye.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var le=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<le||oe===le&&this.markerButtons.length-1===le?this.markerButtonBlock.appendChild(this.markerButtons[oe]):(oe===le&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[oe]))}},ye.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")},ye.prototype.resetButtonStyles=function(){var le=this;this.buttons.forEach(function(oe){oe.className=oe.className.replace(le.uiStyleSettings.toolbarButtonStyleColorsClassName?le.uiStyleSettings.toolbarButtonStyleColorsClassName:le.toolbarButtonStyleColorsClass.name,"").trim(),oe.className=oe.className.replace(le.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?le.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:le.toolbarActiveButtonStyleColorsClass.name,"").trim(),oe.className+=" "+(le.uiStyleSettings.toolbarButtonStyleColorsClassName?le.uiStyleSettings.toolbarButtonStyleColorsClassName:le.toolbarButtonStyleColorsClass.name)})},ye.prototype.addActionButton=function(le,oe,he){var pe=this,ce=document.createElement("div");switch(ce.className=""+this.toolbarButtonStyleClass.name,ce.innerHTML=oe,ce.setAttribute("data-action",he),ce.addEventListener("click",function(){pe.actionToolbarButtonClicked(ce,he)}),he){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}le.appendChild(ce),this.buttons.push(ce)},ye.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ae("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 Ae("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ae("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Ae("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 Ae("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var le=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ae("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*le)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*le)+`px;
padding: `+le+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ae("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ae("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new dt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new dt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},ye.prototype.markerToolbarButtonClicked=function(le,oe){this.setActiveButton(le),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(he){return he("marker",oe)}),this.markerButtonOverflowBlock.style.display="none"},ye.prototype.actionToolbarButtonClicked=function(le,oe){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(he){return he("action",oe)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},ye.prototype.setActiveButton=function(le){this.resetButtonStyles(),le.className=le.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),le.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},ye.prototype.setActiveMarkerButton=function(le){var oe=this.markerButtons.find(function(he){return he.getAttribute("data-type-name")===le});oe&&this.setActiveButton(oe)},ye.prototype.setCurrentMarker=function(le){var oe=this;this.currentMarker=le,this.buttons.filter(function(he){return/delete|notes/.test(he.getAttribute("data-action"))}).forEach(function(he){oe.currentMarker===void 0?(he.style.fillOpacity="0.4",he.style.pointerEvents="none"):(he.style.fillOpacity="1",he.style.pointerEvents="all")})},ye}(),ft=function(){function ye(le,oe,he,pe){this.panels=[],this.panelButtons=[],this.markerjsContainer=le,this.displayMode=oe,this.uiStyleSettings=he,this.styles=pe,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return ye.prototype.addStyles=function(){var le;this.toolboxStyleClass=this.styles.addClass(new Ae("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 Ae("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var oe=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ae("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ae("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ae("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 Ae("toolbox-panel-row_colors",`
background-color: `+((le=this.uiStyleSettings.toolboxBackgroundColor)!==null&&le!==void 0?le:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ae("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 Ae("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ae("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new dt("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new dt("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},ye.prototype.show=function(le){var oe;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=le,this.uiContainer.className=this.toolboxStyleClass.name+" "+((oe=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&oe!==void 0?oe:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},ye.prototype.setPanelButtons=function(le){var oe,he,pe=this;this.panels=le,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+" "+((he=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&he!==void 0?he:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(ce){var Ie;ce.uiStyleSettings=pe.uiStyleSettings;var yt=document.createElement("div");yt.className=pe.toolboxButtonStyleClass.name+" "+((Ie=pe.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ie!==void 0?Ie:pe.toolboxButtonStyleColorsClass.name),yt.innerHTML=ce.icon,yt.title=ce.title,yt.addEventListener("click",function(){pe.panelButtonClick(ce)}),pe.panelButtons.push(yt),pe.buttonRow.appendChild(yt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},ye.prototype.panelButtonClick=function(le){var oe=this,he=-1;if(le!==this.activePanel){he=this.panels.indexOf(le),this.panelRow.innerHTML="";var pe=le.getUi();pe.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(pe),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=le}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,Ie){var yt,Pe;ce.className=oe.toolboxButtonStyleClass.name+" "+(Ie===he?""+((yt=oe.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&yt!==void 0?yt:oe.toolboxActiveButtonStyleColorsClass.name):""+((Pe=oe.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Pe!==void 0?Pe:oe.toolboxButtonStyleColorsClass.name))})},ye}(),Ye=function(ye,le){this.title=ye,this.icon=le},ot=function(ye){function le(oe,he,pe,ce){var Ie=ye.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 Ie.colors=[],Ie.addTransparent=!1,Ie.colorBoxes=[],Ie.colors=he,Ie.currentColor=pe,Ie.setCurrentColor=Ie.setCurrentColor.bind(Ie),Ie.getColorBox=Ie.getColorBox.bind(Ie),Ie}return Te(le,ye),le.prototype.getUi=function(){var oe=this,he=document.createElement("div");return he.style.overflow="hidden",he.style.whiteSpace="nowrap",this.colors.forEach(function(pe){var ce=oe.getColorBox(pe);he.appendChild(ce),oe.colorBoxes.push(ce)}),he},le.prototype.getColorBox=function(oe){var he=this,pe=this.uiStyleSettings.toolbarHeight/4,ce=this.uiStyleSettings.toolbarHeight-pe,Ie=document.createElement("div");Ie.style.display="inline-block",Ie.style.boxSizing="content-box",Ie.style.width=ce-2+"px",Ie.style.height=ce-2+"px",Ie.style.padding="1px",Ie.style.marginRight="2px",Ie.style.marginBottom="2px",Ie.style.borderWidth="2px",Ie.style.borderStyle="solid",Ie.style.borderRadius=(ce+2)/2+"px",Ie.style.borderColor=oe===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ie.addEventListener("click",function(){he.setCurrentColor(oe,Ie)});var yt=document.createElement("div");return yt.style.display="inline-block",yt.style.width=ce-2+"px",yt.style.height=ce-2+"px",yt.style.backgroundColor=oe,yt.style.borderRadius=ce/2+"px",oe==="transparent"&&(yt.style.fill=this.uiStyleSettings.toolboxAccentColor,yt.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>`),Ie.appendChild(yt),Ie},le.prototype.setCurrentColor=function(oe,he){var pe=this;this.currentColor=oe,this.colorBoxes.forEach(function(ce){ce.style.borderColor=ce===he?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(oe)},le}(Ye),at=function(){function ye(le,oe,he){this._state="new",this._isSelected=!1,this._container=le,this._overlayContainer=oe,this.globalSettings=he,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(ye.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),ye.prototype.ownsTarget=function(le){return!1},Object.defineProperty(ye.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),ye.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},ye.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},ye.prototype.pointerDown=function(le,oe){},ye.prototype.dblClick=function(le,oe){},ye.prototype.manipulate=function(le){},ye.prototype.pointerUp=function(le){this.stateChanged()},ye.prototype.dispose=function(){},ye.prototype.addMarkerVisualToContainer=function(le){this.container.childNodes.length>0?this.container.insertBefore(le,this.container.childNodes[0]):this.container.appendChild(le)},ye.prototype.getState=function(){return{typeName:ye.typeName,state:this.state,notes:this.notes}},ye.prototype.restoreState=function(le){this._state=le.state,this.notes=le.notes},ye.prototype.scale=function(le,oe){},ye.prototype.colorChanged=function(le){this.onColorChanged&&this.onColorChanged(le),this.stateChanged()},ye.prototype.fillColorChanged=function(le){this.onFillColorChanged&&this.onFillColorChanged(le),this.stateChanged()},ye.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var le=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),le.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(le)&&this.onStateChanged(this)}},ye.typeName="MarkerBase",ye}(),Ct=function(){function ye(){this.findGripByVisual=this.findGripByVisual.bind(this)}return ye.prototype.findGripByVisual=function(le){return this.topLeft.ownsTarget(le)?this.topLeft:this.topCenter.ownsTarget(le)?this.topCenter:this.topRight.ownsTarget(le)?this.topRight:this.centerLeft.ownsTarget(le)?this.centerLeft:this.centerRight.ownsTarget(le)?this.centerRight:this.bottomLeft.ownsTarget(le)?this.bottomLeft:this.bottomCenter.ownsTarget(le)?this.bottomCenter:this.bottomRight.ownsTarget(le)?this.bottomRight:void 0},ye}(),jt=function(){function ye(){this.GRIP_SIZE=10,this.visual=Me.createGroup(),this.visual.appendChild(Me.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Me.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ye.prototype.ownsTarget=function(le){return le===this.visual||le===this.visual.childNodes[0]||le===this.visual.childNodes[1]},ye}(),it=function(){function ye(){}return ye.toITransformMatrix=function(le){return{a:le.a,b:le.b,c:le.c,d:le.d,e:le.e,f:le.f}},ye.toSVGMatrix=function(le,oe){return le.a=oe.a,le.b=oe.b,le.c=oe.c,le.d=oe.d,le.e=oe.e,le.f=oe.f,le},ye}(),vt=function(ye){function le(oe,he,pe){var ce=ye.call(this,oe,he,pe)||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(Me.createTransform()),ce.setupControlBox(),ce}return Te(le,ye),Object.defineProperty(le.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"visual",{get:function(){return this._visual},set:function(oe){this._visual=oe;var he=Me.createTransform();this._visual.transform.baseVal.appendItem(he)},enumerable:!1,configurable:!0}),le.prototype.ownsTarget=function(oe){return!!ye.prototype.ownsTarget.call(this,oe)||!!(this.controlGrips.findGripByVisual(oe)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(oe))},le.prototype.pointerDown=function(oe,he){ye.prototype.pointerDown.call(this,oe,he),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 pe=this.unrotatePoint(oe);if(this.manipulationStartX=pe.x,this.manipulationStartY=pe.y,this.offsetX=pe.x-this.left,this.offsetY=pe.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(he),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(he)){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 Ie=this.container.transform.baseVal.getItem(0);Ie.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ie,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},le.prototype.pointerUp=function(oe){var he=this.state;ye.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",he==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},le.prototype.moveVisual=function(oe){this.visual.style.transform="translate("+oe.x+"px, "+oe.y+"px)"},le.prototype.manipulate=function(oe){var he=this.unrotatePoint(oe);this.state==="creating"?this.resize(oe):this.state==="move"?(this.left=this.manipulationStartLeft+(he.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(he.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(he):this.state==="rotate"&&this.rotate(oe)},le.prototype.resize=function(oe){var he=this.manipulationStartLeft,pe=this.manipulationStartWidth,ce=this.manipulationStartTop,Ie=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:he=this.manipulationStartLeft+oe.x-this.manipulationStartX,pe=this.manipulationStartWidth+this.manipulationStartLeft-he;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:pe=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,Ie=this.manipulationStartHeight+this.manipulationStartTop-ce;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ie=this.manipulationStartHeight+oe.y-this.manipulationStartY}pe>=0?(this.left=he,this.width=pe):(this.left=he+pe,this.width=-pe),Ie>=0?(this.top=ce,this.height=Ie):(this.top=ce+Ie,this.height=-Ie),this.setSize()},le.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},le.prototype.rotate=function(oe){if(Math.abs(oe.x-this.centerX)>.1){var he=Math.sign(oe.x-this.centerX);this.rotationAngle=180*Math.atan((oe.y-this.centerY)/(oe.x-this.centerX))/Math.PI+90*he,this.applyRotation()}},le.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)},le.prototype.rotatePoint=function(oe){if(this.rotationAngle===0)return oe;var he=this.container.getCTM(),pe=Me.createPoint(oe.x,oe.y);return{x:(pe=pe.matrixTransform(he)).x,y:pe.y}},le.prototype.unrotatePoint=function(oe){if(this.rotationAngle===0)return oe;var he=this.container.getCTM();he=he.inverse();var pe=Me.createPoint(oe.x,oe.y);return{x:(pe=pe.matrixTransform(he)).x,y:pe.y}},le.prototype.select=function(){ye.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},le.prototype.deselect=function(){ye.prototype.deselect.call(this),this.controlBox.style.display="none"},le.prototype.setupControlBox=function(){this.controlBox=Me.createGroup();var oe=Me.createTransform();oe.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(oe),this.container.appendChild(this.controlBox),this.controlRect=Me.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=Me.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 Ct,this.addControlGrips(),this.controlBox.style.display="none"},le.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()},le.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()},le.prototype.createGrip=function(){var oe=new jt;return oe.visual.transform.baseVal.appendItem(Me.createTransform()),this.controlBox.appendChild(oe.visual),oe},le.prototype.positionGrips=function(){var oe=this.controlGrips.topLeft.GRIP_SIZE,he=-oe/2,pe=he,ce=(this.width+this.CB_DISTANCE)/2-oe/2,Ie=(this.height+this.CB_DISTANCE)/2-oe/2,yt=this.height+this.CB_DISTANCE-oe/2,Pe=this.width+this.CB_DISTANCE-oe/2;this.positionGrip(this.controlGrips.topLeft.visual,he,pe),this.positionGrip(this.controlGrips.topCenter.visual,ce,pe),this.positionGrip(this.controlGrips.topRight.visual,Pe,pe),this.positionGrip(this.controlGrips.centerLeft.visual,he,Ie),this.positionGrip(this.controlGrips.centerRight.visual,Pe,Ie),this.positionGrip(this.controlGrips.bottomLeft.visual,he,yt),this.positionGrip(this.controlGrips.bottomCenter.visual,ce,yt),this.positionGrip(this.controlGrips.bottomRight.visual,Pe,yt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,ce,pe-3*this.CB_DISTANCE)},le.prototype.positionGrip=function(oe,he,pe){var ce=oe.transform.baseVal.getItem(0);ce.setTranslate(he,pe),oe.transform.baseVal.replaceItem(ce,0)},le.prototype.hideControlBox=function(){this.controlBox.style.display="none"},le.prototype.showControlBox=function(){this.controlBox.style.display=""},le.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:it.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:it.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},ye.prototype.getState.call(this))},le.prototype.restoreState=function(oe){ye.prototype.restoreState.call(this,oe);var he=oe;this.left=he.left,this.top=he.top,this.width=he.width,this.height=he.height,this.rotationAngle=he.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(it.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,he.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(it.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,he.containerTransformMatrix))},le.prototype.scale=function(oe,he){ye.prototype.scale.call(this,oe,he);var pe=this.rotatePoint({x:this.left,y:this.top}),ce=this.unrotatePoint({x:pe.x*oe,y:pe.y*he});this.left=ce.x,this.top=ce.y,this.width=this.width*oe,this.height=this.height*he,this.adjustControlBox()},le}(at),$e=function(ye){function le(oe,he,pe){var ce=ye.call(this,oe,he,pe)||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 Te(le,ye),le.prototype.ownsTarget=function(oe){return!(!ye.prototype.ownsTarget.call(this,oe)&&oe!==this.visual)},le.prototype.createVisual=function(){this.visual=Me.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)},le.prototype.pointerDown=function(oe,he){ye.prototype.pointerDown.call(this,oe,he),this.state==="new"&&(this.createVisual(),this.moveVisual(oe),this._state="creating")},le.prototype.manipulate=function(oe){ye.prototype.manipulate.call(this,oe)},le.prototype.resize=function(oe){ye.prototype.resize.call(this,oe),this.setSize()},le.prototype.setSize=function(){ye.prototype.setSize.call(this),Me.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},le.prototype.pointerUp=function(oe){ye.prototype.pointerUp.call(this,oe),this.setSize()},le.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.visual&&Me.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(oe),this.stateChanged()},le.prototype.setFillColor=function(oe){this.fillColor=oe,this.visual&&Me.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},le.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.visual&&Me.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},le.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.visual&&Me.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},le.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ye.prototype.getState.call(this))},le.prototype.restoreState=function(oe){var he=oe;this.fillColor=he.fillColor,this.strokeColor=he.strokeColor,this.strokeWidth=he.strokeWidth,this.strokeDasharray=he.strokeDasharray,this.opacity=he.opacity,this.createVisual(),ye.prototype.restoreState.call(this,oe),this.setSize()},le.prototype.scale=function(oe,he){ye.prototype.scale.call(this,oe,he),this.setSize()},le.title="Rectangle marker",le}(vt),Ee=function(ye){function le(oe,he,pe,ce){var Ie=ye.call(this,oe,ce||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Ie.widths=[],Ie.widthBoxes=[],Ie.widths=he,Ie.currentWidth=pe,Ie.setCurrentWidth=Ie.setCurrentWidth.bind(Ie),Ie}return Te(le,ye),le.prototype.getUi=function(){var oe=this,he=document.createElement("div");return he.style.display="flex",he.style.overflow="hidden",he.style.flexGrow="2",this.widths.forEach(function(pe){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=pe===oe.currentWidth?oe.uiStyleSettings.toolboxAccentColor:"transparent",ce.addEventListener("click",function(){oe.setCurrentWidth(pe,ce)}),he.appendChild(ce);var Ie=document.createElement("div");Ie.innerText=pe.toString(),Ie.style.marginRight="5px",ce.appendChild(Ie);var yt=document.createElement("div");yt.style.minHeight="20px",yt.style.flexGrow="2",yt.style.display="flex",yt.style.alignItems="center";var Pe=document.createElement("hr");Pe.style.minWidth="20px",Pe.style.border="0px",Pe.style.borderTop=pe+"px solid "+oe.uiStyleSettings.toolboxColor,Pe.style.flexGrow="2",yt.appendChild(Pe),ce.appendChild(yt),oe.widthBoxes.push(ce)}),he},le.prototype.setCurrentWidth=function(oe,he){var pe=this;this.currentWidth=oe,this.widthBoxes.forEach(function(ce){ce.style.borderColor=ce===he?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},le}(Ye),Ve=function(ye){function le(oe,he,pe,ce){var Ie=ye.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 Ie.styles=[],Ie.styleBoxes=[],Ie.styles=he,Ie.currentStyle=pe,Ie.setCurrentStyle=Ie.setCurrentStyle.bind(Ie),Ie}return Te(le,ye),le.prototype.getUi=function(){var oe=this,he=document.createElement("div");return he.style.display="flex",he.style.overflow="hidden",he.style.flexGrow="2",this.styles.forEach(function(pe){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=pe===oe.currentStyle?oe.uiStyleSettings.toolboxAccentColor:"transparent",ce.addEventListener("click",function(){oe.setCurrentStyle(pe,ce)}),he.appendChild(ce);var Ie=document.createElement("div");Ie.style.minHeight="20px",Ie.style.flexGrow="2",Ie.style.overflow="hidden";var yt=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+oe.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(pe!==""?'stroke-dasharray="'+pe+'"':"")+` />
</svg>`;Ie.innerHTML=yt,ce.appendChild(Ie),oe.styleBoxes.push(ce)}),he},le.prototype.setCurrentStyle=function(oe,he){var pe=this;this.currentStyle=oe,this.styleBoxes.forEach(function(ce){ce.style.borderColor=ce===he?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},le}(Ye),Je=function(ye){function le(oe,he,pe){var ce=ye.call(this,oe,he,pe)||this;return ce.strokeColor=pe.defaultColor,ce.strokeWidth=pe.defaultStrokeWidth,ce.strokeDasharray=pe.defaultStrokeDasharray,ce.strokePanel=new ot("Line color",pe.defaultColorSet,pe.defaultColor),ce.strokePanel.onColorChanged=ce.setStrokeColor,ce.strokeWidthPanel=new Ee("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),ce.strokeWidthPanel.onWidthChanged=ce.setStrokeWidth,ce.strokeStylePanel=new Ve("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),ce.strokeStylePanel.onStyleChanged=ce.setStrokeDasharray,ce}return Te(le,ye),Object.defineProperty(le.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),le.prototype.getState=function(){var oe=ye.prototype.getState.call(this);return oe.typeName=le.typeName,oe},le.typeName="FrameMarker",le.title="Frame marker",le.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',le}($e),Lt=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"},et=function(ye){function le(oe,he,pe){var ce=ye.call(this,oe,he,pe)||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 Te(le,ye),le.prototype.ownsTarget=function(oe){return!!ye.prototype.ownsTarget.call(this,oe)||!(!this.grip1.ownsTarget(oe)&&!this.grip2.ownsTarget(oe))},le.prototype.pointerDown=function(oe,he){ye.prototype.pointerDown.call(this,oe,he),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(he)?this.activeGrip=this.grip1:this.grip2.ownsTarget(he)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},le.prototype.pointerUp=function(oe){var he=this.state;ye.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",he==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},le.prototype.adjustVisual=function(){},le.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)},le.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()},le.prototype.select=function(){ye.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},le.prototype.deselect=function(){ye.prototype.deselect.call(this),this.controlBox.style.display="none"},le.prototype.setupControlBox=function(){this.controlBox=Me.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},le.prototype.adjustControlBox=function(){this.positionGrips()},le.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},le.prototype.createGrip=function(){var oe=new jt;return oe.visual.transform.baseVal.appendItem(Me.createTransform()),this.controlBox.appendChild(oe.visual),oe},le.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)},le.prototype.positionGrip=function(oe,he,pe){var ce=oe.transform.baseVal.getItem(0);ce.setTranslate(he,pe),oe.transform.baseVal.replaceItem(ce,0)},le.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},ye.prototype.getState.call(this))},le.prototype.restoreState=function(oe){ye.prototype.restoreState.call(this,oe);var he=oe;this.x1=he.x1,this.y1=he.y1,this.x2=he.x2,this.y2=he.y2},le.prototype.scale=function(oe,he){ye.prototype.scale.call(this,oe,he),this.x1=this.x1*oe,this.y1=this.y1*he,this.x2=this.x2*oe,this.y2=this.y2*he,this.adjustVisual(),this.adjustControlBox()},le}(at),Dt=function(ye){function le(oe,he,pe){var ce=ye.call(this,oe,he,pe)||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=pe.defaultColor,ce.strokeWidth=pe.defaultStrokeWidth,ce.strokeDasharray=pe.defaultStrokeDasharray,ce.strokePanel=new ot("Line color",pe.defaultColorSet,pe.defaultColor),ce.strokePanel.onColorChanged=ce.setStrokeColor,ce.strokeWidthPanel=new Ee("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),ce.strokeWidthPanel.onWidthChanged=ce.setStrokeWidth,ce.strokeStylePanel=new Ve("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),ce.strokeStylePanel.onStyleChanged=ce.setStrokeDasharray,ce}return Te(le,ye),le.prototype.ownsTarget=function(oe){return!(!ye.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.selectorLine&&oe!==this.visibleLine)},le.prototype.createVisual=function(){this.visual=Me.createGroup(),this.selectorLine=Me.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=Me.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)},le.prototype.pointerDown=function(oe,he){ye.prototype.pointerDown.call(this,oe,he),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},le.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()),Me.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),Me.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),Me.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},le.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.adjustVisual(),this.colorChanged(oe)},le.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.adjustVisual()},le.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.adjustVisual(),this.stateChanged()},Object.defineProperty(le.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),le.prototype.getState=function(){var oe=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},ye.prototype.getState.call(this));return oe.typeName=le.typeName,oe},le.prototype.restoreState=function(oe){ye.prototype.restoreState.call(this,oe);var he=oe;this.strokeColor=he.strokeColor,this.strokeWidth=he.strokeWidth,this.strokeDasharray=he.strokeDasharray,this.createVisual(),this.adjustVisual()},le.typeName="LineMarker",le.title="Line marker",le.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',le}(et),Ge=function(ye){function le(oe,he,pe,ce){var Ie=ye.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 Ie.fonts=[],Ie.fontBoxes=[],Ie.fonts=he,Ie.currentFont=pe,Ie.setCurrentFont=Ie.setCurrentFont.bind(Ie),Ie}return Te(le,ye),le.prototype.getUi=function(){var oe=this,he=document.createElement("div");return he.style.overflow="hidden",he.style.flexGrow="2",this.fonts.forEach(function(pe){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=pe===oe.currentFont?oe.uiStyleSettings.toolboxAccentColor:"transparent",ce.addEventListener("click",function(){oe.setCurrentFont(pe,ce)}),he.appendChild(ce);var Ie=document.createElement("div");Ie.style.display="flex",Ie.style.minHeight="20px",Ie.style.flexGrow="2",Ie.style.fontFamily=pe,Ie.style.overflow="hidden";var yt=document.createElement("div");yt.style.whiteSpace="nowrap",yt.style.overflow="hidden",yt.style.textOverflow="ellipsis",yt.innerHTML="The quick brown fox jumps over the lazy dog",Ie.appendChild(yt),ce.appendChild(Ie),oe.fontBoxes.push(ce)}),he},le.prototype.setCurrentFont=function(oe,he){var pe=this;this.currentFont=oe,this.fontBoxes.forEach(function(ce){ce.style.borderColor=ce===he?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},le}(Ye),kt=function(ye){function le(oe,he,pe){var ce=ye.call(this,oe,he,pe)||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=pe.defaultColor,ce.fontFamily=pe.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 ot("Color",pe.defaultColorSet,pe.defaultColor),ce.colorPanel.onColorChanged=ce.setColor,ce.fontFamilyPanel=new Ge("Font",pe.defaultFontFamilies,pe.defaultFontFamily),ce.fontFamilyPanel.onFontChanged=ce.setFont,ce}return Te(le,ye),le.prototype.ownsTarget=function(oe){if(ye.prototype.ownsTarget.call(this,oe)||oe===this.visual||oe===this.textElement||oe===this.bgRectangle)return!0;var he=!1;return this.textElement.childNodes.forEach(function(pe){pe===oe&&(he=!0)}),he},le.prototype.createVisual=function(){this.visual=Me.createGroup(),this.bgRectangle=Me.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=Me.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(Me.createTransform()),this.textElement.transform.baseVal.appendItem(Me.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},le.prototype.pointerDown=function(oe,he){ye.prototype.pointerDown.call(this,oe,he),this.isMoved=!1,this.pointerDownPoint=oe,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(oe),this._state="creating")},le.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(he){oe.textElement.appendChild(Me.createTSpan(he.trim()===""?" ":he.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},le.prototype.getTextScale=function(){var oe=this.textElement.getBBox(),he=1;if(oe.width>0&&oe.height>0){var pe=(1*this.width-this.width*this.padding*2/100)/oe.width,ce=(1*this.height-this.height*this.padding*2/100)/oe.height;he=Math.min(pe,ce)}return he},le.prototype.getTextPosition=function(oe){var he=this.textElement.getBBox(),pe=0,ce=0;return he.width>0&&he.height>0&&(pe=(this.width-he.width*oe)/2,ce=this.height/2-he.height*oe/2),{x:pe,y:ce}},le.prototype.sizeText=function(){var oe=this.textElement.getBBox(),he=this.getTextScale(),pe=this.getTextPosition(he);pe.y-=oe.y*he,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+pe.x+"px, "+pe.y+"px) scale("+he+", "+he+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(pe.x,pe.y),this.textElement.transform.baseVal.getItem(1).setScale(he,he))},le.prototype.manipulate=function(oe){ye.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)},le.prototype.resize=function(oe){ye.prototype.resize.call(this,oe),this.isMoved=!0,this.setSize(),this.sizeText()},le.prototype.setSize=function(){ye.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(Me.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Me.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},le.prototype.pointerUp=function(oe){var he=this.state;he==="creating"&&(this._suppressMarkerCreateEvent=!0),ye.prototype.pointerUp.call(this,oe),this.setSize(),(he==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},le.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(he){he.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var he=Number.parseFloat(oe.textEditor.style.fontSize);oe.textEditor.clientWidth>=Number.parseInt(oe.textEditor.style.maxWidth)&&he>.9;)he-=.1,oe.textEditor.style.fontSize=Math.max(he,.9)+"em"}),this.textEditor.addEventListener("keyup",function(he){he.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(he){if(he.clipboardData){var pe=he.clipboardData.getData("text"),ce=window.getSelection();if(!ce.rangeCount)return!1;ce.deleteFromDocument(),ce.getRangeAt(0).insertNode(document.createTextNode(pe)),he.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")},le.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var oe=this.getTextScale(),he=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),pe=this.textElement.getBBox(),ce={x:pe.width*oe,y:pe.height*oe};he.x-=ce.x/2,he.y-=ce.y/2,this.textEditor.style.top=he.y+"px",this.textEditor.style.left=he.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-he.x+"px",this.textEditor.style.fontSize=Math.max(16*oe,12)+"px",this.textElement.style.display="none"}},le.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()},le.prototype.select=function(){ye.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},le.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),ye.prototype.deselect.call(this)},le.prototype.dblClick=function(oe,he){ye.prototype.dblClick.call(this,oe,he),this.showTextEditor()},le.prototype.setColor=function(oe){this.textElement&&Me.setAttributes(this.textElement,[["fill",oe]]),this.color=oe,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(oe)},le.prototype.setFont=function(oe){this.textElement&&Me.setAttributes(this.textElement,[["font-family",oe]]),this.fontFamily=oe,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},le.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},le.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(le.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),le.prototype.getState=function(){var oe=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},ye.prototype.getState.call(this));return oe.typeName=le.typeName,oe},le.prototype.restoreState=function(oe){var he=oe;this.color=he.color,this.fontFamily=he.fontFamily,this.padding=he.padding,this.text=he.text,this.createVisual(),ye.prototype.restoreState.call(this,oe),this.setSize()},le.prototype.scale=function(oe,he){ye.prototype.scale.call(this,oe,he),this.setSize(),this.sizeText(),this.positionTextEditor()},le.typeName="TextMarker",le.title="Text marker",le.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>',le}(vt),tt=function(ye){function le(oe,he,pe){var ce=ye.call(this,oe,he,pe)||this;return ce.color="transparent",ce.lineWidth=3,ce.drawing=!1,ce.pixelRatio=1,ce.color=pe.defaultColor,ce.lineWidth=pe.defaultStrokeWidth,ce.pixelRatio=pe.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 ot("Color",pe.defaultColorSet,pe.defaultColor),ce.colorPanel.onColorChanged=ce.setColor,ce.lineWidthPanel=new Ee("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),ce.lineWidthPanel.onWidthChanged=ce.setLineWidth,ce}return Te(le,ye),le.prototype.ownsTarget=function(oe){return!(!ye.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.drawingImage)},le.prototype.createVisual=function(){this.visual=Me.createGroup(),this.drawingImage=Me.createImage(),this.visual.appendChild(this.drawingImage);var oe=Me.createTransform();this.visual.transform.baseVal.appendItem(oe),this.addMarkerVisualToContainer(this.visual)},le.prototype.pointerDown=function(oe,he){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):ye.prototype.pointerDown.call(this,oe,he)},le.prototype.manipulate=function(oe){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(oe.x,oe.y),this.canvasContext.stroke()):ye.prototype.manipulate.call(this,oe)},le.prototype.resize=function(oe){ye.prototype.resize.call(this,oe),Me.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Me.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},le.prototype.pointerUp=function(oe){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):ye.prototype.pointerUp.call(this,oe)},le.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)},le.prototype.select=function(){this.state==="creating"&&this.finishCreation(),ye.prototype.select.call(this)},le.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),ye.prototype.deselect.call(this)},le.prototype.finishCreation=function(){for(var oe=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),he=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],pe=he[0],ce=he[1],Ie=he[2],yt=he[3],Pe=!1,je=0;je<this.canvasElement.height;je++)for(var Rt=0;Rt<this.canvasElement.width;Rt++)oe.data[je*this.canvasElement.width*4+4*Rt+3]>0&&(Pe=!0,je<ce&&(ce=je),Rt<pe&&(pe=Rt),je>yt&&(yt=je),Rt>Ie&&(Ie=Rt));if(Pe){this.left=pe/this.pixelRatio,this.top=ce/this.pixelRatio,this.width=(Ie-pe)/this.pixelRatio,this.height=(yt-ce)/this.pixelRatio;var At=document.createElement("canvas");At.width=Ie-pe,At.height=yt-ce,At.getContext("2d").putImageData(this.canvasContext.getImageData(pe,ce,Ie-pe,yt-ce),0,0),this.drawingImgUrl=At.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},le.prototype.setDrawingImage=function(){Me.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),Me.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},le.prototype.setColor=function(oe){this.color=oe,this.colorChanged(oe)},le.prototype.setLineWidth=function(oe){this.lineWidth=oe},Object.defineProperty(le.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),le.prototype.getState=function(){var oe=Object.assign({drawingImgUrl:this.drawingImgUrl},ye.prototype.getState.call(this));return oe.typeName=le.typeName,oe},le.prototype.restoreState=function(oe){this.createVisual(),ye.prototype.restoreState.call(this,oe),this.drawingImgUrl=oe.drawingImgUrl,this.setDrawingImage()},le.prototype.scale=function(oe,he){ye.prototype.scale.call(this,oe,he),this.setDrawingImage()},le.typeName="FreehandMarker",le.title="Freehand marker",le.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>',le}(vt),$t=function(ye){function le(oe,he,pe){var ce=ye.call(this,oe,pe||'<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=he,ce.setCurrentType=ce.setCurrentType.bind(ce),ce}return Te(le,ye),le.prototype.getUi=function(){var oe=this,he=document.createElement("div");he.style.display="flex",he.style.overflow="hidden",he.style.flexGrow="2";for(var pe=function(yt){var Pe="both";switch(yt){case 0:Pe="both";break;case 1:Pe="start";break;case 2:Pe="end";break;case 3:Pe="none"}var je=document.createElement("div");if(je.style.display="flex",je.style.flexGrow="2",je.style.alignItems="center",je.style.justifyContent="space-between",je.style.padding="5px",je.style.borderWidth="2px",je.style.borderStyle="solid",je.style.borderColor=Pe===ce.currentType?ce.uiStyleSettings.toolboxAccentColor:"transparent",je.addEventListener("click",function(){oe.setCurrentType(Pe,je)}),he.appendChild(je),Pe==="both"||Pe==="start"){var Rt=document.createElement("div");Rt.style.display="flex",Rt.style.alignItems="center",Rt.style.minHeight="20px",Rt.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>`,Rt.style.marginLeft="5px",je.appendChild(Rt)}var At=document.createElement("div");At.style.display="flex",At.style.alignItems="center",At.style.minHeight="20px",At.style.flexGrow="2";var rt=document.createElement("hr");if(rt.style.minWidth="20px",rt.style.border="0px",rt.style.borderTop="3px solid "+(ce.uiStyleSettings!==void 0?ce.uiStyleSettings.toolboxColor:"#eeeeee"),rt.style.flexGrow="2",At.appendChild(rt),je.appendChild(At),Pe==="both"||Pe==="end"){var Ft=document.createElement("div");Ft.style.display="flex",Ft.style.alignItems="center",Ft.style.minHeight="20px",Ft.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>`,Ft.style.marginRight="5px",je.appendChild(Ft)}ce.typeBoxes.push(je)},ce=this,Ie=0;Ie<4;Ie++)pe(Ie);return he},le.prototype.setCurrentType=function(oe,he){var pe=this;this.currentType=oe,this.typeBoxes.forEach(function(ce){ce.style.borderColor=ce===he?pe.uiStyleSettings!==void 0?pe.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},le}(Ye),pt=function(ye){function le(oe,he,pe){var ce=ye.call(this,oe,he,pe)||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 $t("Arrow type","end"),ce.arrowTypePanel.onArrowTypeChanged=ce.setArrowType,ce}return Te(le,ye),le.prototype.ownsTarget=function(oe){return!(!ye.prototype.ownsTarget.call(this,oe)&&oe!==this.arrow1&&oe!==this.arrow2)},le.prototype.getArrowPoints=function(oe,he){var pe=this.arrowBaseWidth+2*this.strokeWidth,ce=this.arrowBaseHeight+2*this.strokeWidth;return oe-pe/2+","+(he+ce/2)+" "+oe+","+(he-ce/2)+" "+(oe+pe/2)+","+(he+ce/2)},le.prototype.createTips=function(){this.arrow1=Me.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(Me.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=Me.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(Me.createTransform()),this.visual.appendChild(this.arrow2)},le.prototype.pointerDown=function(oe,he){ye.prototype.pointerDown.call(this,oe,he),this.state==="creating"&&this.createTips()},le.prototype.adjustVisual=function(){if(ye.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",Me.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),Me.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 he=this.arrow1.transform.baseVal.getItem(0);he.setRotate(oe,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(he,0);var pe=this.arrow2.transform.baseVal.getItem(0);pe.setRotate(oe+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(pe,0)}},le.prototype.setArrowType=function(oe){this.arrowType=oe,this.adjustVisual(),this.stateChanged()},Object.defineProperty(le.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),le.prototype.getState=function(){var oe=Object.assign({arrowType:this.arrowType},ye.prototype.getState.call(this));return oe.typeName=le.typeName,oe},le.prototype.restoreState=function(oe){ye.prototype.restoreState.call(this,oe);var he=oe;this.arrowType=he.arrowType,this.createTips(),this.adjustVisual()},le.typeName="ArrowMarker",le.title="Arrow marker",le.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',le}(Dt),Bt=function(ye){function le(oe,he,pe){var ce=ye.call(this,oe,he,pe)||this;return ce.fillColor=pe.defaultFillColor,ce.strokeWidth=0,ce.fillPanel=new ot("Color",pe.defaultColorSet,pe.defaultFillColor),ce.fillPanel.onColorChanged=ce.setFillColor,ce}return Te(le,ye),Object.defineProperty(le.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),le.prototype.getState=function(){var oe=ye.prototype.getState.call(this);return oe.typeName=le.typeName,oe},le.typeName="CoverMarker",le.title="Cover marker",le.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',le}($e),Tt=function(ye){function le(oe,he,pe,ce){var Ie=ye.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 Ie.opacities=[],Ie.opacityBoxes=[],Ie.opacities=he,Ie.currentOpacity=pe,Ie.setCurrentOpacity=Ie.setCurrentOpacity.bind(Ie),Ie}return Te(le,ye),le.prototype.getUi=function(){var oe=this,he=document.createElement("div");return he.style.display="flex",he.style.overflow="hidden",he.style.flexGrow="2",he.style.justifyContent="space-between",this.opacities.forEach(function(pe){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=pe===oe.currentOpacity?oe.uiStyleSettings.toolboxAccentColor:"transparent",ce.addEventListener("click",function(){oe.setCurrentOpacity(pe,ce)}),he.appendChild(ce);var Ie=document.createElement("div");Ie.innerText=100*pe+"%",ce.appendChild(Ie),oe.opacityBoxes.push(ce)}),he},le.prototype.setCurrentOpacity=function(oe,he){var pe=this;this.currentOpacity=oe,this.opacityBoxes.forEach(function(ce){ce.style.borderColor=ce===he?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},le}(Ye),wt=function(ye){function le(oe,he,pe){var ce=ye.call(this,oe,he,pe)||this;return ce.setOpacity=ce.setOpacity.bind(ce),ce.fillColor=pe.defaultHighlightColor,ce.strokeWidth=0,ce.opacity=pe.defaultHighlightOpacity,ce.fillPanel=new ot("Color",pe.defaultColorSet,ce.fillColor),ce.fillPanel.onColorChanged=ce.setFillColor,ce.opacityPanel=new Tt("Opacity",pe.defaultOpacitySteps,ce.opacity),ce.opacityPanel.onOpacityChanged=ce.setOpacity,ce}return Te(le,ye),le.prototype.setOpacity=function(oe){this.opacity=oe,this.visual&&Me.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(le.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),le.prototype.getState=function(){var oe=ye.prototype.getState.call(this);return oe.typeName=le.typeName,oe},le.typeName="HighlightMarker",le.title="Highlight marker",le.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>',le}(Bt),Ne='<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>',be='<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>',xt=function(ye){function le(oe,he,pe){var ce=ye.call(this,oe,he,pe)||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=pe.defaultStrokeColor,ce.bgColor=pe.defaultFillColor,ce.fontFamily=pe.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 ot("Text color",pe.defaultColorSet,ce.color,Ne),ce.colorPanel.onColorChanged=ce.setColor,ce.bgColorPanel=new ot("Fill color",pe.defaultColorSet,ce.bgColor,be),ce.bgColorPanel.onColorChanged=ce.setBgColor,ce.fontFamilyPanel=new Ge("Font",pe.defaultFontFamilies,pe.defaultFontFamily),ce.fontFamilyPanel.onFontChanged=ce.setFont,ce.tipGrip=new jt,ce.tipGrip.visual.transform.baseVal.appendItem(Me.createTransform()),ce.controlBox.appendChild(ce.tipGrip.visual),ce}return Te(le,ye),le.prototype.ownsTarget=function(oe){return ye.prototype.ownsTarget.call(this,oe)||this.tipGrip.ownsTarget(oe)||this.tip===oe},le.prototype.createTip=function(){Me.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=Me.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},le.prototype.pointerDown=function(oe,he){this.state==="new"&&ye.prototype.pointerDown.call(this,oe,he),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(he)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):ye.prototype.pointerDown.call(this,oe,he)},le.prototype.pointerUp=function(oe){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,ye.prototype.pointerUp.call(this,oe);else{var he=this.state==="creating";ye.prototype.pointerUp.call(this,oe),this.setTipPoints(he),this.positionTip()}},le.prototype.manipulate=function(oe){if(this.tipMoving){var he=this.unrotatePoint(oe);this.tipPosition={x:he.x-this.manipulationStartLeft,y:he.y-this.manipulationStartTop},this.positionTip()}else ye.prototype.manipulate.call(this,oe)},le.prototype.setBgColor=function(oe){this.bgRectangle&&this.tip&&(Me.setAttributes(this.bgRectangle,[["fill",oe]]),Me.setAttributes(this.tip,[["fill",oe]])),this.bgColor=oe,this.fillColorChanged(oe)},le.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},le.prototype.setTipPoints=function(oe){oe===void 0&&(oe=!1);var he=Math.min(this.height/2,15),pe=this.height/5;oe&&(this.tipPosition={x:he+pe/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))?(pe=this.width/5,he=Math.min(this.width/2,15),this.tipBase1Position={x:he,y:0},this.tipBase2Position={x:he+pe,y:0}):(this.tipBase1Position={x:0,y:he},this.tipBase2Position={x:0,y:he+pe}):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))?(pe=this.width/5,he=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-he-pe,y:0},this.tipBase2Position={x:this.width-he,y:0}):(this.tipBase1Position={x:this.width,y:he},this.tipBase2Position={x:this.width,y:he+pe}):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))?(pe=this.width/5,he=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-he-pe,y:this.height},this.tipBase2Position={x:this.width-he,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-he-pe},this.tipBase2Position={x:this.width,y:this.height-he}):ce<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(pe=this.width/5,he=Math.min(this.width/2,15),this.tipBase1Position={x:he,y:this.height},this.tipBase2Position={x:he+pe,y:this.height}):(this.tipBase1Position={x:0,y:this.height-he},this.tipBase2Position={x:0,y:this.height-he-pe})},le.prototype.resize=function(oe){ye.prototype.resize.call(this,oe),this.positionTip()},le.prototype.positionTip=function(){Me.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(le.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),le.prototype.select=function(){this.positionTip(),ye.prototype.select.call(this)},le.prototype.getState=function(){var oe=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},ye.prototype.getState.call(this));return oe.typeName=le.typeName,oe},le.prototype.restoreState=function(oe){var he=oe;this.bgColor=he.bgColor,this.tipPosition=he.tipPosition,ye.prototype.restoreState.call(this,oe),this.createTip(),this.setTipPoints()},le.prototype.scale=function(oe,he){ye.prototype.scale.call(this,oe,he),this.tipPosition={x:this.tipPosition.x*oe,y:this.tipPosition.y*he},this.positionTip()},le.typeName="CalloutMarker",le.title="Callout marker",le.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>',le}(kt),Qt=function(ye){function le(oe,he,pe){var ce=ye.call(this,oe,he,pe)||this;return ce.fillColor="transparent",ce.strokeColor="transparent",ce.strokeWidth=0,ce.strokeDasharray="",ce.opacity=1,ce.strokeColor=pe.defaultColor,ce.strokeWidth=pe.defaultStrokeWidth,ce.strokeDasharray=pe.defaultStrokeDasharray,ce.fillColor=pe.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 ot("Line color",xe(pe.defaultColorSet,["transparent"]),pe.defaultColor),ce.strokePanel.onColorChanged=ce.setStrokeColor,ce.fillPanel=new ot("Fill color",xe(pe.defaultColorSet,["transparent"]),ce.fillColor,be),ce.fillPanel.onColorChanged=ce.setFillColor,ce.strokeWidthPanel=new Ee("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),ce.strokeWidthPanel.onWidthChanged=ce.setStrokeWidth,ce.strokeStylePanel=new Ve("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),ce.strokeStylePanel.onStyleChanged=ce.setStrokeDasharray,ce.opacityPanel=new Tt("Opacity",pe.defaultOpacitySteps,ce.opacity),ce.opacityPanel.onOpacityChanged=ce.setOpacity,ce}return Te(le,ye),le.prototype.ownsTarget=function(oe){return!(!ye.prototype.ownsTarget.call(this,oe)&&oe!==this.visual)},le.prototype.createVisual=function(){this.visual=Me.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)},le.prototype.pointerDown=function(oe,he){ye.prototype.pointerDown.call(this,oe,he),this.state==="new"&&(this.createVisual(),this.moveVisual(oe),this._state="creating")},le.prototype.manipulate=function(oe){ye.prototype.manipulate.call(this,oe)},le.prototype.resize=function(oe){ye.prototype.resize.call(this,oe),this.setSize()},le.prototype.setSize=function(){ye.prototype.setSize.call(this),Me.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},le.prototype.pointerUp=function(oe){ye.prototype.pointerUp.call(this,oe),this.setSize()},le.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.visual&&Me.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(oe),this.stateChanged()},le.prototype.setFillColor=function(oe){this.fillColor=oe,this.visual&&Me.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(oe),this.stateChanged()},le.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.visual&&Me.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},le.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.visual&&Me.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},le.prototype.setOpacity=function(oe){this.opacity=oe,this.visual&&Me.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(le.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),le.prototype.getState=function(){var oe=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ye.prototype.getState.call(this));return oe.typeName=le.typeName,oe},le.prototype.restoreState=function(oe){var he=oe;this.fillColor=he.fillColor,this.strokeColor=he.strokeColor,this.strokeWidth=he.strokeWidth,this.strokeDasharray=he.strokeDasharray,this.opacity=he.opacity,this.createVisual(),ye.prototype.restoreState.call(this,oe),this.setSize()},le.prototype.scale=function(oe,he){ye.prototype.scale.call(this,oe,he),this.setSize()},le.typeName="EllipseMarker",le.title="Ellipse marker",le.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>',le}(vt),Vt=function(ye){function le(oe,he,pe){return ye.call(this,oe,he,pe)||this}return Te(le,ye),Object.defineProperty(le.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),le.prototype.ownsTarget=function(oe){return!(!ye.prototype.ownsTarget.call(this,oe)&&oe!==this.tip1&&oe!==this.tip2)},le.prototype.createTips=function(){this.tip1=Me.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(Me.createTransform()),this.visual.appendChild(this.tip1),this.tip2=Me.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(Me.createTransform()),this.visual.appendChild(this.tip2)},le.prototype.pointerDown=function(oe,he){ye.prototype.pointerDown.call(this,oe,he),this.state==="creating"&&this.createTips()},le.prototype.adjustVisual=function(){if(ye.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(Me.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()]]),Me.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),he=this.tip1.transform.baseVal.getItem(0);he.setRotate(oe,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(he,0);var pe=this.tip2.transform.baseVal.getItem(0);pe.setRotate(oe+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(pe,0)}},Object.defineProperty(le.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),le.prototype.getState=function(){var oe=ye.prototype.getState.call(this);return oe.typeName=le.typeName,oe},le.prototype.restoreState=function(oe){ye.prototype.restoreState.call(this,oe),this.createTips(),this.adjustVisual()},le.typeName="MeasurementMarker",le.title="Measurement marker",le.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>',le}(Dt),qe=function(ye){function le(oe,he,pe){var ce=ye.call(this,oe,he,pe)||this;return ce.strokePanel.colors=pe.defaultColorSet,ce.fillColor="transparent",ce}return Te(le,ye),Object.defineProperty(le.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),le.prototype.getState=function(){var oe=ye.prototype.getState.call(this);return oe.typeName=le.typeName,oe},le.typeName="EllipseFrameMarker",le.title="Ellipse frame marker",le.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>',le}(Qt),nt=function(){function ye(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(ye.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),ye.prototype.addUndoStep=function(le){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(le)||(this.undoStack.push(le),JSON.stringify(this.lastRedoStep)!==JSON.stringify(le)&&this.redoStack.splice(0,this.redoStack.length))},ye.prototype.replaceLastUndoStep=function(le){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=le)},ye.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},ye.prototype.undo=function(){if(this.undoStack.length>1){var le=this.undoStack.pop();return le!==void 0&&this.redoStack.push(le),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},ye.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},ye}(),Ot=function(ye){function le(oe,he,pe){var ce=ye.call(this,oe,he,pe)||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=pe.defaultColor,ce.strokeWidth=pe.defaultStrokeWidth,ce.strokeDasharray=pe.defaultStrokeDasharray,ce.strokePanel=new ot("Line color",pe.defaultColorSet,pe.defaultColor),ce.strokePanel.onColorChanged=ce.setStrokeColor,ce.strokeWidthPanel=new Ee("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),ce.strokeWidthPanel.onWidthChanged=ce.setStrokeWidth,ce.strokeStylePanel=new Ve("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),ce.strokeStylePanel.onStyleChanged=ce.setStrokeDasharray,ce}return Te(le,ye),le.prototype.ownsTarget=function(oe){return!(!ye.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.selectorCurve&&oe!==this.visibleCurve&&!this.curveGrip.ownsTarget(oe))},le.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},le.prototype.createVisual=function(){this.visual=Me.createGroup(),this.selectorCurve=Me.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=Me.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)},le.prototype.pointerDown=function(oe,he){ye.prototype.pointerDown.call(this,oe,he),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(he)&&(this.activeGrip=this.curveGrip,this._state="resize")},le.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),Me.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),Me.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),Me.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},le.prototype.setupControlBox=function(){ye.prototype.setupControlBox.call(this),this.curveControlLine1=Me.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=Me.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)},le.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,ye.prototype.addControlGrips.call(this)},le.prototype.positionGrips=function(){ye.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()))},le.prototype.manipulate=function(oe){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+oe.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+oe.y-this.manipulationStartY),ye.prototype.manipulate.call(this,oe)},le.prototype.resize=function(oe){this.activeGrip===this.curveGrip&&(this.curveX=oe.x,this.curveY=oe.y),ye.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)},le.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.adjustVisual(),this.colorChanged(oe)},le.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.adjustVisual()},le.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.adjustVisual()},le.prototype.scale=function(oe,he){this.curveX=this.curveX*oe,this.curveY=this.curveY*he,ye.prototype.scale.call(this,oe,he)},Object.defineProperty(le.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),le.prototype.getState=function(){var oe=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},ye.prototype.getState.call(this));return oe.typeName=le.typeName,oe},le.prototype.restoreState=function(oe){ye.prototype.restoreState.call(this,oe);var he=oe;this.strokeColor=he.strokeColor,this.strokeWidth=he.strokeWidth,this.strokeDasharray=he.strokeDasharray,this.curveX=he.curveX,this.curveY=he.curveY,this.createVisual(),this.adjustVisual()},le.typeName="CurveMarker",le.title="Curve marker",le.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>',le}(et),dn=function(ye){function le(oe,he,pe){var ce=ye.call(this,oe,he,pe)||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=pe.defaultColor,ce.strokeWidth=pe.defaultStrokeWidth,ce.strokeDasharray=pe.defaultStrokeDasharray,ce.fillColor=pe.defaultFillColor,ce.textColor=pe.defaultStrokeColor,ce.fontFamily=pe.defaultFontFamily,ce.fontSize=pe.defaultCaptionFontSize,ce.captionText=pe.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 ot("Line color",xe(pe.defaultColorSet,["transparent"]),ce.strokeColor),ce.strokePanel.onColorChanged=ce.setStrokeColor,ce.fillPanel=new ot("Fill color",xe(pe.defaultColorSet,["transparent"]),ce.fillColor,be),ce.fillPanel.onColorChanged=ce.setFillColor,ce.strokeWidthPanel=new Ee("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),ce.strokeWidthPanel.onWidthChanged=ce.setStrokeWidth,ce.strokeStylePanel=new Ve("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),ce.strokeStylePanel.onStyleChanged=ce.setStrokeDasharray,ce.fontFamilyPanel=new Ge("Font",pe.defaultFontFamilies,pe.defaultFontFamily),ce.fontFamilyPanel.onFontChanged=ce.setFont,ce.textColorPanel=new ot("Text color",pe.defaultColorSet,ce.textColor,Ne),ce.textColorPanel.onColorChanged=ce.setTextColor,ce}return Te(le,ye),le.prototype.ownsTarget=function(oe){return!(!ye.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.frame&&oe!==this.captionBg&&oe!==this.captionElement)},le.prototype.createVisual=function(){this.visual=Me.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=Me.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=Me.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=Me.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()},le.prototype.setCaptionText=function(oe){this.captionText=oe,this.captionElement.textContent=this.captionText,this.sizeCaption()},le.prototype.pointerDown=function(oe,he){ye.prototype.pointerDown.call(this,oe,he),this.isMoved=!1,this.pointerDownPoint=oe,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(oe),this._state="creating")},le.prototype.manipulate=function(oe){ye.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)},le.prototype.resize=function(oe){ye.prototype.resize.call(this,oe),this.setSize()},le.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),Me.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')"]]),Me.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')"]])},le.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(he){he.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(he){he.key==="Enter"&&oe.finishTextEditing(oe.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(he){he.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()},le.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"))},le.prototype.finishTextEditing=function(oe){this.setCaptionText(oe.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},le.prototype.setFont=function(oe){this.captionElement&&Me.setAttributes(this.captionElement,[["font-family",oe]]),this.fontFamily=oe,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},le.prototype.setTextColor=function(oe){this.captionElement&&Me.setAttributes(this.captionElement,[["fill",oe]]),this.textColor=oe,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},le.prototype.setSize=function(){ye.prototype.setSize.call(this),Me.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},le.prototype.pointerUp=function(oe){ye.prototype.pointerUp.call(this,oe),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},le.prototype.dblClick=function(oe,he){ye.prototype.dblClick.call(this,oe,he),this.showTextEditor()},le.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.frame&&Me.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(oe),this.stateChanged()},le.prototype.setFillColor=function(oe){this.fillColor=oe,this.captionBg&&Me.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(oe),this.stateChanged()},le.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.frame&&Me.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},le.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.frame&&Me.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(le.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),le.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},ye.prototype.getState.call(this));return oe.typeName=this.typeName,oe},le.prototype.restoreState=function(oe){var he=oe;this.fillColor=he.fillColor,this.strokeColor=he.strokeColor,this.strokeWidth=he.strokeWidth,this.strokeDasharray=he.strokeDasharray,this.textColor=he.textColor,this.fontFamily=he.fontFamily,this.captionText=he.captionText,this.fontSize=he.fontSize,this.createVisual(),ye.prototype.restoreState.call(this,oe),this.setSize()},le.prototype.scale=function(oe,he){ye.prototype.scale.call(this,oe,he),this.setSize()},le.typeName="CaptionFrameMarker",le.title="Caption frame marker",le.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>',le}(vt),en=function(){function ye(le,oe){oe===void 0&&(oe=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=le,this.cancelable=oe}return Object.defineProperty(ye.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),ye.prototype.preventDefault=function(){this._defaultPrevented=!0},ye}(),on=function(ye){function le(oe,he,pe){var ce=ye.call(this,oe,!1)||this;return ce.dataUrl=he,ce.state=pe,ce}return Te(le,ye),le}(en),Xt=function(ye){function le(oe,he,pe){pe===void 0&&(pe=!1);var ce=ye.call(this,oe,pe)||this;return ce.marker=he,ce}return Te(le,ye),le}(en),Ut=function(){function ye(){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 ye.prototype.addEventListener=function(le,oe){this[le].push(oe)},ye.prototype.removeEventListener=function(le,oe){var he=this[le].indexOf(oe);he>-1&&this[le].splice(he,1)},ye}(),Zt=function(){function ye(le){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Lt,this._isOpen=!1,this.undoRedoManager=new nt,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 Ut,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=ye.instanceCounter++,this.styles=new Re(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=le,this.targetRoot=document.body,this.width=le.clientWidth,this.height=le.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(ye.prototype,"ALL_MARKER_TYPES",{get:function(){return[Je,tt,pt,kt,qe,Qt,wt,xt,Vt,Bt,Dt,Ot,dn]},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Je,tt,pt,kt,Qt,wt,xt]},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Je,tt,pt,kt,wt]},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(le){var oe=this;this._availableMarkerTypes.splice(0),le.forEach(function(he){if(typeof he=="string"){var pe=oe.ALL_MARKER_TYPES.find(function(ce){return ce.typeName===he});pe!==void 0&&oe._availableMarkerTypes.push(pe)}else oe._availableMarkerTypes.push(he)})},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(le){this._zoomLevel=le,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(ye.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),ye.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),De.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},ye.prototype.show=function(){var le=this;this.styles.styleSheetRoot===void 0&&_e.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=_e.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(oe){return oe(new en(le))})},ye.prototype.render=function(){return ze(this,void 0,void 0,function(){var le;return ut(this,function(oe){switch(oe.label){case 0:return this.setCurrentMarker(),(le=new we).naturalSize=this.renderAtNaturalSize,le.imageType=this.renderImageType,le.imageQuality=this.renderImageQuality,le.markersOnly=this.renderMarkersOnly,le.width=this.renderWidth,le.height=this.renderHeight,[4,le.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return oe.sent(),[4,le.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,oe.sent()]}})})},ye.prototype.close=function(le){var oe=this;if(le===void 0&&(le=!1),this.isOpen){var he=!1;le||this.eventListeners.beforeclose.forEach(function(pe){var ce=new en(oe,!0);pe(ce),ce.defaultPrevented&&(he=!0)}),he||(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(pe){return pe(new en(oe))}),this.detachEvents(),this._isOpen=!1)}},ye.prototype.addMarkersToToolbar=function(){for(var le,oe=[],he=0;he<arguments.length;he++)oe[he]=arguments[he];(le=this._availableMarkerTypes).push.apply(le,oe)},ye.prototype.addRenderEventListener=function(le){this.addEventListener("render",function(oe){le(oe.dataUrl,oe.state)})},ye.prototype.removeRenderEventListener=function(le){},ye.prototype.addCloseEventListener=function(le){this.addEventListener("close",function(){le()})},ye.prototype.removeCloseEventListener=function(le){},ye.prototype.setupResizeObserver=function(){var le=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){le.resize(le.target.clientWidth,le.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return le.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},ye.prototype.onPopupTargetResize=function(){var le=1*this.target.clientWidth/this.target.clientHeight,oe=this.editorCanvas.clientWidth/le>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*le:this.editorCanvas.clientWidth,he=oe<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/le;this.resize(oe,he)},ye.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ye.prototype.resize=function(le,oe){this._isResizing=!0;var he=le/this.imageWidth,pe=oe/this.imageHeight;this.imageWidth=Math.round(le),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(he,pe),this._isResizing=!1},ye.prototype.scaleMarkers=function(le,oe){var he,pe=this;this._currentMarker&&this._currentMarker instanceof kt?this._currentMarker.scale(le,oe):(he=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(ce){ce!==pe._currentMarker&&ce.scale(le,oe)}),he!==void 0&&this.setCurrentMarker(he)},ye.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"},ye.prototype.setTopLeft=function(){var le=this.editingTarget.getBoundingClientRect(),oe=this.editorCanvas.getBoundingClientRect();this.left=le.left-oe.left,this.top=le.top-oe.top},ye.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)},ye.prototype.addDefs=function(){for(var le,oe=[],he=0;he<arguments.length;he++)oe[he]=arguments[he];this.defs=Me.createDefs(),this.addDefsToImage(),(le=this.defs).append.apply(le,oe)},ye.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},ye.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)},ye.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},ye.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},ye.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)},ye.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},ye.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)},ye.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 le=document.createElement("a");le.href="https://markerjs.com/",le.target="_blank",le.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>',le.title="Powered by marker.js",le.style.display="grid",le.style.alignItems="center",le.style.justifyItems="center",le.style.padding="3px",le.style.width="20px",le.style.height="20px",this.logoUI.appendChild(le),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},ye.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")},ye.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"},ye.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ye.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 le=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=le+"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 Fe(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 ft(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},ye.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ye.prototype.removeMarker=function(le){this.markerImage.removeChild(le.container),this.markers.indexOf(le)>-1&&this.markers.splice(this.markers.indexOf(le),1),le.dispose()},ye.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())},ye.prototype.toolbarButtonClicked=function(le,oe){if(le==="marker"&&oe!==void 0)this.createNewMarker(oe);else if(le==="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()}},ye.prototype.deleteSelectedMarker=function(){var le=this;if(this._currentMarker!==void 0){var oe=!1;if(this.eventListeners.markerbeforedelete.forEach(function(pe){var ce=new Xt(le,le._currentMarker,!0);pe(ce),ce.defaultPrevented&&(oe=!0)}),!oe){var he=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(pe){return pe(new Xt(le,he))})}}},ye.prototype.clear=function(){var le=this,oe=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ie){var yt=new Xt(le,void 0,!0);Ie(yt),yt.defaultPrevented&&(oe=!0)}),!oe)){this.setCurrentMarker();for(var he=function(Ie){var yt=pe.markers[Ie];pe.setCurrentMarker(pe.markers[Ie]),pe._currentMarker.dispose(),pe.markerImage.removeChild(pe._currentMarker.container),pe.markers.splice(pe.markers.indexOf(pe._currentMarker),1),pe.eventListeners.markerdelete.forEach(function(Pe){return Pe(new Xt(le,yt))})},pe=this,ce=this.markers.length-1;ce>=0;ce--)he(ce);this.addUndoStep()}},Object.defineProperty(ye.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),ye.prototype.showNotesEditor=function(){var le;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=(le=this._currentMarker.notes)!==null&&le!==void 0?le:"",this.overlayContainer.appendChild(this.notesArea))},ye.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)},ye.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},ye.prototype.addUndoStep=function(){var le=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var oe=this.getState(),he=this.undoRedoManager.getLastUndoStep();if(!he||he.width===oe.width&&he.height===oe.height){var pe=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(oe),pe<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(ce){return ce(new en(le))})}else this.undoRedoManager.replaceLastUndoStep(oe),this.eventListeners.statechange.forEach(function(ce){return ce(new en(le))})}},ye.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},ye.prototype.undoStep=function(){var le=this,oe=this.undoRedoManager.undo();oe!==void 0&&(this.restoreState(oe),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(he){return he(new en(le))}))},ye.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},ye.prototype.redoStep=function(){var le=this,oe=this.undoRedoManager.redo();oe!==void 0&&(this.restoreState(oe),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(he){return he(new en(le))}))},ye.prototype.stepZoom=function(){var le=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=le<this.zoomSteps.length-1?this.zoomSteps[le+1]:this.zoomSteps[0]},ye.prototype.panTo=function(le){this.contentDiv.scrollBy({left:this.prevPanPoint.x-le.x,top:this.prevPanPoint.y-le.y}),this.prevPanPoint=le},ye.prototype.startRenderAndClose=function(){return ze(this,void 0,void 0,function(){var le,oe,he=this;return ut(this,function(pe){switch(pe.label){case 0:return[4,this.render()];case 1:return le=pe.sent(),oe=this.getState(),this.eventListeners.render.forEach(function(ce){return ce(new on(he,le,oe))}),this.close(!0),[2]}})})},ye.prototype.getState=function(le){le===!0&&this.setCurrentMarker();var oe={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(he){return oe.markers.push(he.getState())}),oe},ye.prototype.restoreState=function(le){var oe=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);le.markers.forEach(function(he){var pe=oe._availableMarkerTypes.find(function(Ie){return Ie.typeName===he.typeName});if(pe!==void 0){var ce=oe.addNewMarker(pe);ce.restoreState(he),oe.markers.push(ce)}}),le.width&&le.height&&(le.width!==this.imageWidth||le.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/le.width,this.imageHeight/le.height),this.eventListeners.restorestate.forEach(function(he){return he(new en(oe))})},ye.prototype.addNewMarker=function(le){var oe=Me.createGroup();return this.markerImage.appendChild(oe),new le(oe,this.overlayContainer,this.settings)},ye.prototype.createNewMarker=function(le){var oe,he=this;(oe=typeof le=="string"?this._availableMarkerTypes.find(function(pe){return pe.typeName===le}):le)&&(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(pe){return pe(new Xt(he,he._currentMarker))}))},ye.prototype.markerCreated=function(le){var oe=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(le),this.setCurrentMarker(le),le instanceof tt&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(tt):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(he){return he(new Xt(oe,oe._currentMarker))})},ye.prototype.colorChanged=function(le){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=le,this.settings.defaultStrokeColor=le)},ye.prototype.fillColorChanged=function(le){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=le)},ye.prototype.markerStateChanged=function(le){var oe=this;this.eventListeners.markerchange.forEach(function(he){return he(new Xt(oe,le))})},ye.prototype.setCurrentMarker=function(le){var oe=this;this._currentMarker!==le&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(he){return he(new Xt(oe,oe._currentMarker))})),this._currentMarker=le,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(he){return he(new Xt(oe,oe._currentMarker))}))},ye.prototype.onPointerDown=function(le){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||le.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(he){return he.ownsTarget(le.target)});oe!==void 0?(this.setCurrentMarker(oe),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(le.clientX,le.clientY),le.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:le.clientX,y:le.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(le.clientX,le.clientY))},ye.prototype.onDblClick=function(le){if(this._isFocused||this.focus(),this.mode==="select"){var oe=this.markers.find(function(he){return he.ownsTarget(le.target)});oe!==void 0&&oe!==this._currentMarker&&this.setCurrentMarker(oe),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(le.clientX,le.clientY),le.target):this.setCurrentMarker()}},ye.prototype.onPointerMove=function(le){this.touchPoints!==1&&le.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||le.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(le.clientX,le.clientY)):this.zoomLevel>1&&this.panTo({x:le.clientX,y:le.clientY}))},ye.prototype.onPointerUp=function(le){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(le.clientX,le.clientY)),this.isDragging=!1,this.addUndoStep()},ye.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},ye.prototype.onKeyUp=function(le){this._currentMarker===void 0||this.notesArea!==void 0||le.key!=="Delete"&&le.key!=="Backspace"||this.deleteSelectedMarker()},ye.prototype.clientToLocalCoordinates=function(le,oe){var he=this.markerImage.getBoundingClientRect();return{x:(le-he.left)/this.zoomLevel,y:(oe-he.top)/this.zoomLevel}},ye.prototype.onWindowResize=function(){this.positionUI()},ye.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var le=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=le+"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()},ye.prototype.addLicenseKey=function(le){De.addKey(le)},ye.prototype.addEventListener=function(le,oe){this.eventListeners.addEventListener(le,oe)},ye.prototype.removeEventListener=function(le,oe){this.eventListeners.removeEventListener(le,oe)},ye.prototype.renderState=function(le){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(le),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(ye.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),ye.prototype.focus=function(){var le=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 en(le))}))},ye.prototype.blur=function(){var le=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(oe){return oe(new en(le))}))},ye.instanceCounter=0,ye}()},5630:function(bn,tn,ue){"use strict";var se=ue(60499),Te=ue(85899),ze=ue(18642),ut=ue(72190),xe=ue(42244),Me=ue(92310),De=ue.n(Me),we=ue(18929),_e=ue(59301),Re=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],dt=(0,_e.forwardRef)(function(Ae,Fe){var ft,Ye=Ae.prefixCls,ot=Ye===void 0?"rc-checkbox":Ye,at=Ae.className,Ct=Ae.style,jt=Ae.checked,it=Ae.disabled,vt=Ae.defaultChecked,$e=vt===void 0?!1:vt,Ee=Ae.type,Ve=Ee===void 0?"checkbox":Ee,Je=Ae.title,Lt=Ae.onChange,et=(0,xe.Z)(Ae,Re),Dt=(0,_e.useRef)(null),Ge=(0,we.Z)($e,{value:jt}),kt=(0,ut.Z)(Ge,2),tt=kt[0],$t=kt[1];(0,_e.useImperativeHandle)(Fe,function(){return{focus:function(){var wt;(wt=Dt.current)===null||wt===void 0||wt.focus()},blur:function(){var wt;(wt=Dt.current)===null||wt===void 0||wt.blur()},input:Dt.current}});var pt=De()(ot,at,(ft={},(0,ze.Z)(ft,"".concat(ot,"-checked"),tt),(0,ze.Z)(ft,"".concat(ot,"-disabled"),it),ft)),Bt=function(wt){it||("checked"in Ae||$t(wt.target.checked),Lt==null||Lt({target:(0,Te.Z)((0,Te.Z)({},Ae),{},{type:Ve,checked:wt.target.checked}),stopPropagation:function(){wt.stopPropagation()},preventDefault:function(){wt.preventDefault()},nativeEvent:wt.nativeEvent}))};return _e.createElement("span",{className:pt,title:Je,style:Ct},_e.createElement("input",(0,se.Z)({},et,{className:"".concat(ot,"-input"),ref:Dt,onChange:Bt,disabled:it,checked:!!tt,type:Ve})),_e.createElement("span",{className:"".concat(ot,"-inner")}))});tn.Z=dt},31561:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return Ve}});var se=ue(60499),Te=ue(18642),ze=ue(72190),ut=ue(42244),xe=ue(35593),Me=ue(92310),De=ue.n(Me),we=ue(8654),_e=ue(59301),Re=ue(10228),dt=ue(16089),Ae=Re.Z.ESC,Fe=Re.Z.TAB;function ft(Je){var Lt=Je.visible,et=Je.triggerRef,Dt=Je.onVisibleChange,Ge=Je.autoFocus,kt=Je.overlayRef,tt=_e.useRef(!1),$t=function(){if(Lt){var wt,Ne;(wt=et.current)===null||wt===void 0||(Ne=wt.focus)===null||Ne===void 0||Ne.call(wt),Dt==null||Dt(!1)}},pt=function(){var wt;return(wt=kt.current)!==null&&wt!==void 0&&wt.focus?(kt.current.focus(),tt.current=!0,!0):!1},Bt=function(wt){switch(wt.keyCode){case Ae:$t();break;case Fe:{var Ne=!1;tt.current||(Ne=pt()),Ne?wt.preventDefault():$t();break}}};_e.useEffect(function(){return Lt?(window.addEventListener("keydown",Bt),Ge&&(0,dt.Z)(pt,3),function(){window.removeEventListener("keydown",Bt),tt.current=!1}):function(){tt.current=!1}},[Lt])}var Ye=(0,_e.forwardRef)(function(Je,Lt){var et=Je.overlay,Dt=Je.arrow,Ge=Je.prefixCls,kt=(0,_e.useMemo)(function(){var $t;return typeof et=="function"?$t=et():$t=et,$t},[et]),tt=(0,we.sQ)(Lt,kt==null?void 0:kt.ref);return _e.createElement(_e.Fragment,null,Dt&&_e.createElement("div",{className:"".concat(Ge,"-arrow")}),_e.cloneElement(kt,{ref:(0,we.Yr)(kt)?tt:void 0}))}),ot=Ye,at={adjustX:1,adjustY:1},Ct=[0,0],jt={topLeft:{points:["bl","tl"],overflow:at,offset:[0,-4],targetOffset:Ct},top:{points:["bc","tc"],overflow:at,offset:[0,-4],targetOffset:Ct},topRight:{points:["br","tr"],overflow:at,offset:[0,-4],targetOffset:Ct},bottomLeft:{points:["tl","bl"],overflow:at,offset:[0,4],targetOffset:Ct},bottom:{points:["tc","bc"],overflow:at,offset:[0,4],targetOffset:Ct},bottomRight:{points:["tr","br"],overflow:at,offset:[0,4],targetOffset:Ct}},it=jt,vt=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function $e(Je,Lt){var et,Dt=Je.arrow,Ge=Dt===void 0?!1:Dt,kt=Je.prefixCls,tt=kt===void 0?"rc-dropdown":kt,$t=Je.transitionName,pt=Je.animation,Bt=Je.align,Tt=Je.placement,wt=Tt===void 0?"bottomLeft":Tt,Ne=Je.placements,be=Ne===void 0?it:Ne,xt=Je.getPopupContainer,Qt=Je.showAction,Vt=Je.hideAction,qe=Je.overlayClassName,nt=Je.overlayStyle,Ot=Je.visible,dn=Je.trigger,en=dn===void 0?["hover"]:dn,on=Je.autoFocus,Xt=Je.overlay,Ut=Je.children,Zt=Je.onVisibleChange,ye=(0,ut.Z)(Je,vt),le=_e.useState(),oe=(0,ze.Z)(le,2),he=oe[0],pe=oe[1],ce="visible"in Je?Ot:he,Ie=_e.useRef(null),yt=_e.useRef(null),Pe=_e.useRef(null);_e.useImperativeHandle(Lt,function(){return Ie.current});var je=function(Qe){pe(Qe),Zt==null||Zt(Qe)};ft({visible:ce,triggerRef:Pe,onVisibleChange:je,autoFocus:on,overlayRef:yt});var Rt=function(Qe){var mt=Je.onOverlayClick;pe(!1),mt&&mt(Qe)},At=function(){return _e.createElement(ot,{ref:yt,overlay:Xt,prefixCls:tt,arrow:Ge})},rt=function(){return typeof Xt=="function"?At:At()},Ft=function(){var Qe=Je.minOverlayWidthMatchTrigger,mt=Je.alignPoint;return"minOverlayWidthMatchTrigger"in Je?Qe:!mt},sn=function(){var Qe=Je.openClassName;return Qe!==void 0?Qe:"".concat(tt,"-open")},ct=_e.cloneElement(Ut,{className:De()((et=Ut.props)===null||et===void 0?void 0:et.className,ce&&sn()),ref:(0,we.Yr)(Ut)?(0,we.sQ)(Pe,Ut.ref):void 0}),qt=Vt;return!qt&&en.indexOf("contextMenu")!==-1&&(qt=["click"]),_e.createElement(xe.Z,(0,se.Z)({builtinPlacements:be},ye,{prefixCls:tt,ref:Ie,popupClassName:De()(qe,(0,Te.Z)({},"".concat(tt,"-show-arrow"),Ge)),popupStyle:nt,action:en,showAction:Qt,hideAction:qt,popupPlacement:wt,popupAlign:Bt,popupTransitionName:$t,popupAnimation:pt,popupVisible:ce,stretch:Ft()?"minWidth":"",popup:rt(),onPopupVisibleChange:je,onPopupClick:Rt,getPopupContainer:xt}),ct)}var Ee=_e.forwardRef($e),Ve=Ee},93681:function(bn,tn,ue){"use strict";ue.r(tn),ue.d(tn,{BaseInput:function(){return Re},default:function(){return jt}});var se=ue(60499),Te=ue(85899),ze=ue(18642),ut=ue(43749),xe=ue(92310),Me=ue.n(xe),De=ue(59301),we=ue(5643),_e=function(vt){var $e,Ee,Ve=vt.inputElement,Je=vt.prefixCls,Lt=vt.prefix,et=vt.suffix,Dt=vt.addonBefore,Ge=vt.addonAfter,kt=vt.className,tt=vt.style,$t=vt.disabled,pt=vt.readOnly,Bt=vt.focused,Tt=vt.triggerFocus,wt=vt.allowClear,Ne=vt.value,be=vt.handleReset,xt=vt.hidden,Qt=vt.classes,Vt=vt.classNames,qe=vt.dataAttrs,nt=vt.styles,Ot=vt.components,dn=(Ot==null?void 0:Ot.affixWrapper)||"span",en=(Ot==null?void 0:Ot.groupWrapper)||"span",on=(Ot==null?void 0:Ot.wrapper)||"span",Xt=(Ot==null?void 0:Ot.groupAddon)||"span",Ut=(0,De.useRef)(null),Zt=function(At){var rt;(rt=Ut.current)!==null&&rt!==void 0&&rt.contains(At.target)&&(Tt==null||Tt())},ye=function(){var At;if(!wt)return null;var rt=!$t&&!pt&&Ne,Ft="".concat(Je,"-clear-icon"),sn=(0,ut.Z)(wt)==="object"&&wt!==null&&wt!==void 0&&wt.clearIcon?wt.clearIcon:"\u2716";return De.createElement("span",{onClick:be,onMouseDown:function(qt){return qt.preventDefault()},className:Me()(Ft,(At={},(0,ze.Z)(At,"".concat(Ft,"-hidden"),!rt),(0,ze.Z)(At,"".concat(Ft,"-has-suffix"),!!et),At)),role:"button",tabIndex:-1},sn)},le=(0,De.cloneElement)(Ve,{value:Ne,hidden:xt,className:Me()(($e=Ve.props)===null||$e===void 0?void 0:$e.className,!(0,we.X3)(vt)&&!(0,we.He)(vt)&&kt)||null,style:(0,Te.Z)((0,Te.Z)({},(Ee=Ve.props)===null||Ee===void 0?void 0:Ee.style),!(0,we.X3)(vt)&&!(0,we.He)(vt)?tt:{})});if((0,we.X3)(vt)){var oe,he="".concat(Je,"-affix-wrapper"),pe=Me()(he,(oe={},(0,ze.Z)(oe,"".concat(he,"-disabled"),$t),(0,ze.Z)(oe,"".concat(he,"-focused"),Bt),(0,ze.Z)(oe,"".concat(he,"-readonly"),pt),(0,ze.Z)(oe,"".concat(he,"-input-with-clear-btn"),et&&wt&&Ne),oe),!(0,we.He)(vt)&&kt,Qt==null?void 0:Qt.affixWrapper,Vt==null?void 0:Vt.affixWrapper),ce=(et||wt)&&De.createElement("span",{className:Me()("".concat(Je,"-suffix"),Vt==null?void 0:Vt.suffix),style:nt==null?void 0:nt.suffix},ye(),et);le=De.createElement(dn,(0,se.Z)({className:pe,style:(0,Te.Z)((0,Te.Z)({},(0,we.He)(vt)?void 0:tt),nt==null?void 0:nt.affixWrapper),hidden:!(0,we.He)(vt)&&xt,onClick:Zt},qe==null?void 0:qe.affixWrapper,{ref:Ut}),Lt&&De.createElement("span",{className:Me()("".concat(Je,"-prefix"),Vt==null?void 0:Vt.prefix),style:nt==null?void 0:nt.prefix},Lt),(0,De.cloneElement)(Ve,{value:Ne,hidden:null}),ce)}if((0,we.He)(vt)){var Ie="".concat(Je,"-group"),yt="".concat(Ie,"-addon"),Pe=Me()("".concat(Je,"-wrapper"),Ie,Qt==null?void 0:Qt.wrapper),je=Me()("".concat(Je,"-group-wrapper"),kt,Qt==null?void 0:Qt.group);return De.createElement(en,{className:je,style:tt,hidden:xt},De.createElement(on,{className:Pe},Dt&&De.createElement(Xt,{className:yt},Dt),(0,De.cloneElement)(le,{hidden:null}),Ge&&De.createElement(Xt,{className:yt},Ge)))}return le},Re=_e,dt=ue(77654),Ae=ue(72190),Fe=ue(42244),ft=ue(18929),Ye=ue(2738),ot=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","classes","classNames","styles"],at=(0,De.forwardRef)(function(it,vt){var $e=it.autoComplete,Ee=it.onChange,Ve=it.onFocus,Je=it.onBlur,Lt=it.onPressEnter,et=it.onKeyDown,Dt=it.prefixCls,Ge=Dt===void 0?"rc-input":Dt,kt=it.disabled,tt=it.htmlSize,$t=it.className,pt=it.maxLength,Bt=it.suffix,Tt=it.showCount,wt=it.type,Ne=wt===void 0?"text":wt,be=it.classes,xt=it.classNames,Qt=it.styles,Vt=(0,Fe.Z)(it,ot),qe=(0,ft.Z)(it.defaultValue,{value:it.value}),nt=(0,Ae.Z)(qe,2),Ot=nt[0],dn=nt[1],en=(0,De.useState)(!1),on=(0,Ae.Z)(en,2),Xt=on[0],Ut=on[1],Zt=(0,De.useRef)(null),ye=function(je){Zt.current&&(0,we.nH)(Zt.current,je)};(0,De.useImperativeHandle)(vt,function(){return{focus:ye,blur:function(){var je;(je=Zt.current)===null||je===void 0||je.blur()},setSelectionRange:function(je,Rt,At){var rt;(rt=Zt.current)===null||rt===void 0||rt.setSelectionRange(je,Rt,At)},select:function(){var je;(je=Zt.current)===null||je===void 0||je.select()},input:Zt.current}}),(0,De.useEffect)(function(){Ut(function(Pe){return Pe&&kt?!1:Pe})},[kt]);var le=function(je){it.value===void 0&&dn(je.target.value),Zt.current&&(0,we.rJ)(Zt.current,je,Ee)},oe=function(je){Lt&&je.key==="Enter"&&Lt(je),et==null||et(je)},he=function(je){Ut(!0),Ve==null||Ve(je)},pe=function(je){Ut(!1),Je==null||Je(je)},ce=function(je){dn(""),ye(),Zt.current&&(0,we.rJ)(Zt.current,je,Ee)},Ie=function(){var je=(0,Ye.Z)(it,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","classes","htmlSize","styles","classNames"]);return De.createElement("input",(0,se.Z)({autoComplete:$e},je,{onChange:le,onFocus:he,onBlur:pe,onKeyDown:oe,className:Me()(Ge,(0,ze.Z)({},"".concat(Ge,"-disabled"),kt),xt==null?void 0:xt.input),style:Qt==null?void 0:Qt.input,ref:Zt,size:tt,type:Ne}))},yt=function(){var je=Number(pt)>0;if(Bt||Tt){var Rt=(0,we.D7)(Ot),At=(0,dt.Z)(Rt).length,rt=(0,ut.Z)(Tt)==="object"?Tt.formatter({value:Rt,count:At,maxLength:pt}):"".concat(At).concat(je?" / ".concat(pt):"");return De.createElement(De.Fragment,null,!!Tt&&De.createElement("span",{className:Me()("".concat(Ge,"-show-count-suffix"),(0,ze.Z)({},"".concat(Ge,"-show-count-has-suffix"),!!Bt),xt==null?void 0:xt.count),style:(0,Te.Z)({},Qt==null?void 0:Qt.count)},rt),Bt)}return null};return De.createElement(Re,(0,se.Z)({},Vt,{prefixCls:Ge,className:$t,inputElement:Ie(),handleReset:ce,value:(0,we.D7)(Ot),focused:Xt,triggerFocus:ye,suffix:yt(),disabled:kt,classes:be,classNames:xt,styles:Qt}))}),Ct=at,jt=Ct},5643:function(bn,tn,ue){"use strict";ue.d(tn,{D7:function(){return xe},He:function(){return se},X3:function(){return Te},nH:function(){return ut},rJ:function(){return ze}});function se(Me){return!!(Me.addonBefore||Me.addonAfter)}function Te(Me){return!!(Me.prefix||Me.suffix||Me.allowClear)}function ze(Me,De,we,_e){if(we){var Re=De;if(De.type==="click"){var dt=Me.cloneNode(!0);Re=Object.create(De,{target:{value:dt},currentTarget:{value:dt}}),dt.value="",we(Re);return}if(_e!==void 0){Re=Object.create(De,{target:{value:Me},currentTarget:{value:Me}}),Me.value=_e,we(Re);return}we(Re)}}function ut(Me,De){if(Me){Me.focus(De);var we=De||{},_e=we.cursor;if(_e){var Re=Me.value.length;switch(_e){case"start":Me.setSelectionRange(0,0);break;case"end":Me.setSelectionRange(Re,Re);break;default:Me.setSelectionRange(0,Re)}}}}function xe(Me){return typeof Me=="undefined"||Me===null?"":String(Me)}},15285:function(bn,tn,ue){"use strict";ue.d(tn,{iz:function(){return xn},ck:function(){return Ar},BW:function(){return fn},sN:function(){return Ar},Wd:function(){return _t},ZP:function(){return pr},Xl:function(){return et}});var se=ue(60499),Te=ue(18642),ze=ue(85899),ut=ue(77654),xe=ue(72190),Me=ue(42244),De=ue(92310),we=ue.n(De),_e=ue(83836),Re=ue(18929),dt=ue(13697),Ae=ue(48736),Fe=ue(59301),ft=ue(4676),Ye=Fe.createContext(null);function ot(ht,Ue){return ht===void 0?null:"".concat(ht,"-").concat(Ue)}function at(ht){var Ue=Fe.useContext(Ye);return ot(Ue,ht)}var Ct=ue(80547),jt=["children","locked"],it=Fe.createContext(null);function vt(ht,Ue){var Xe=(0,ze.Z)({},ht);return Object.keys(Ue).forEach(function(Ze){var gt=Ue[Ze];gt!==void 0&&(Xe[Ze]=gt)}),Xe}function $e(ht){var Ue=ht.children,Xe=ht.locked,Ze=(0,Me.Z)(ht,jt),gt=Fe.useContext(it),Wt=(0,Ct.Z)(function(){return vt(gt,Ze)},[gt,Ze],function(Gt,nn){return!Xe&&(Gt[0]!==nn[0]||!(0,dt.Z)(Gt[1],nn[1],!0))});return Fe.createElement(it.Provider,{value:Wt},Ue)}var Ee=[],Ve=Fe.createContext(null);function Je(){return Fe.useContext(Ve)}var Lt=Fe.createContext(Ee);function et(ht){var Ue=Fe.useContext(Lt);return Fe.useMemo(function(){return ht!==void 0?[].concat((0,ut.Z)(Ue),[ht]):Ue},[Ue,ht])}var Dt=Fe.createContext(null),Ge=Fe.createContext({}),kt=Ge,tt=ue(29194);function $t(ht){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,tt.Z)(ht)){var Xe=ht.nodeName.toLowerCase(),Ze=["input","select","textarea","button"].includes(Xe)||ht.isContentEditable||Xe==="a"&&!!ht.getAttribute("href"),gt=ht.getAttribute("tabindex"),Wt=Number(gt),Gt=null;return gt&&!Number.isNaN(Wt)?Gt=Wt:Ze&&Gt===null&&(Gt=0),Ze&&ht.disabled&&(Gt=null),Gt!==null&&(Gt>=0||Ue&&Gt<0)}return!1}function pt(ht){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Xe=(0,ut.Z)(ht.querySelectorAll("*")).filter(function(Ze){return $t(Ze,Ue)});return $t(ht,Ue)&&Xe.unshift(ht),Xe}var Bt=null;function Tt(){Bt=document.activeElement}function wt(){Bt=null}function Ne(){if(Bt)try{Bt.focus()}catch(ht){}}function be(ht,Ue){if(Ue.keyCode===9){var Xe=pt(ht),Ze=Xe[Ue.shiftKey?0:Xe.length-1],gt=Ze===document.activeElement||ht===document.activeElement;if(gt){var Wt=Xe[Ue.shiftKey?Xe.length-1:0];Wt.focus(),Ue.preventDefault()}}}var xt=ue(10228),Qt=ue(16089),Vt=xt.Z.LEFT,qe=xt.Z.RIGHT,nt=xt.Z.UP,Ot=xt.Z.DOWN,dn=xt.Z.ENTER,en=xt.Z.ESC,on=xt.Z.HOME,Xt=xt.Z.END,Ut=[nt,Ot,Vt,qe];function Zt(ht,Ue,Xe,Ze){var gt,Wt,Gt,nn,Ht="prev",bt="next",Cn="children",kn="parent";if(ht==="inline"&&Ze===dn)return{inlineTrigger:!0};var Jn=(gt={},(0,Te.Z)(gt,nt,Ht),(0,Te.Z)(gt,Ot,bt),gt),Fn=(Wt={},(0,Te.Z)(Wt,Vt,Xe?bt:Ht),(0,Te.Z)(Wt,qe,Xe?Ht:bt),(0,Te.Z)(Wt,Ot,Cn),(0,Te.Z)(Wt,dn,Cn),Wt),Nn=(Gt={},(0,Te.Z)(Gt,nt,Ht),(0,Te.Z)(Gt,Ot,bt),(0,Te.Z)(Gt,dn,Cn),(0,Te.Z)(Gt,en,kn),(0,Te.Z)(Gt,Vt,Xe?Cn:kn),(0,Te.Z)(Gt,qe,Xe?kn:Cn),Gt),_n={inline:Jn,horizontal:Fn,vertical:Nn,inlineSub:Jn,horizontalSub:Nn,verticalSub:Nn},tr=(nn=_n["".concat(ht).concat(Ue?"":"Sub")])===null||nn===void 0?void 0:nn[Ze];switch(tr){case Ht:return{offset:-1,sibling:!0};case bt:return{offset:1,sibling:!0};case kn:return{offset:-1,sibling:!1};case Cn:return{offset:1,sibling:!1};default:return null}}function ye(ht){for(var Ue=ht;Ue;){if(Ue.getAttribute("data-menu-list"))return Ue;Ue=Ue.parentElement}return null}function le(ht,Ue){for(var Xe=ht||document.activeElement;Xe;){if(Ue.has(Xe))return Xe;Xe=Xe.parentElement}return null}function oe(ht,Ue){var Xe=pt(ht,!0);return Xe.filter(function(Ze){return Ue.has(Ze)})}function he(ht,Ue,Xe){var Ze=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!ht)return null;var gt=oe(ht,Ue),Wt=gt.length,Gt=gt.findIndex(function(nn){return Xe===nn});return Ze<0?Gt===-1?Gt=Wt-1:Gt-=1:Ze>0&&(Gt+=1),Gt=(Gt+Wt)%Wt,gt[Gt]}var pe=function(Ue,Xe){var Ze=new Set,gt=new Map,Wt=new Map;return Ue.forEach(function(Gt){var nn=document.querySelector("[data-menu-id='".concat(ot(Xe,Gt),"']"));nn&&(Ze.add(nn),Wt.set(nn,Gt),gt.set(Gt,nn))}),{elements:Ze,key2element:gt,element2key:Wt}};function ce(ht,Ue,Xe,Ze,gt,Wt,Gt,nn,Ht,bt){var Cn=Fe.useRef(),kn=Fe.useRef();kn.current=Ue;var Jn=function(){Qt.Z.cancel(Cn.current)};return Fe.useEffect(function(){return function(){Jn()}},[]),function(Fn){var Nn=Fn.which;if([].concat(Ut,[dn,en,on,Xt]).includes(Nn)){var _n=Wt(),tr=pe(_n,Ze),Xn=tr,In=Xn.elements,zn=Xn.key2element,cr=Xn.element2key,qn=zn.get(Ue),br=le(qn,In),Br=cr.get(br),rr=Zt(ht,Gt(Br,!0).length===1,Xe,Nn);if(!rr&&Nn!==on&&Nn!==Xt)return;(Ut.includes(Nn)||[on,Xt].includes(Nn))&&Fn.preventDefault();var yn=function(Dr){if(Dr){var ei=Dr,$n=Dr.querySelector("a");$n!=null&&$n.getAttribute("href")&&(ei=$n);var Kn=cr.get(Dr);nn(Kn),Jn(),Cn.current=(0,Qt.Z)(function(){kn.current===Kn&&ei.focus()})}};if([on,Xt].includes(Nn)||rr.sibling||!br){var hn;!br||ht==="inline"?hn=gt.current:hn=ye(br);var En,Qn=oe(hn,In);Nn===on?En=Qn[0]:Nn===Xt?En=Qn[Qn.length-1]:En=he(hn,In,br,rr.offset),yn(En)}else if(rr.inlineTrigger)Ht(Br);else if(rr.offset>0)Ht(Br,!0),Jn(),Cn.current=(0,Qt.Z)(function(){tr=pe(_n,Ze);var vr=br.getAttribute("aria-controls"),Dr=document.getElementById(vr),ei=he(Dr,tr.elements);yn(ei)},5);else if(rr.offset<0){var Rn=Gt(Br,!0),Mn=Rn[Rn.length-2],er=zn.get(Mn);Ht(Mn,!1),yn(er)}}bt==null||bt(Fn)}}function Ie(ht){Promise.resolve().then(ht)}var yt="__RC_UTIL_PATH_SPLIT__",Pe=function(Ue){return Ue.join(yt)},je=function(Ue){return Ue.split(yt)},Rt="rc-menu-more";function At(){var ht=Fe.useState({}),Ue=(0,xe.Z)(ht,2),Xe=Ue[1],Ze=(0,Fe.useRef)(new Map),gt=(0,Fe.useRef)(new Map),Wt=Fe.useState([]),Gt=(0,xe.Z)(Wt,2),nn=Gt[0],Ht=Gt[1],bt=(0,Fe.useRef)(0),Cn=(0,Fe.useRef)(!1),kn=function(){Cn.current||Xe({})},Jn=(0,Fe.useCallback)(function(zn,cr){var qn=Pe(cr);gt.current.set(qn,zn),Ze.current.set(zn,qn),bt.current+=1;var br=bt.current;Ie(function(){br===bt.current&&kn()})},[]),Fn=(0,Fe.useCallback)(function(zn,cr){var qn=Pe(cr);gt.current.delete(qn),Ze.current.delete(zn)},[]),Nn=(0,Fe.useCallback)(function(zn){Ht(zn)},[]),_n=(0,Fe.useCallback)(function(zn,cr){var qn=Ze.current.get(zn)||"",br=je(qn);return cr&&nn.includes(br[0])&&br.unshift(Rt),br},[nn]),tr=(0,Fe.useCallback)(function(zn,cr){return zn.some(function(qn){var br=_n(qn,!0);return br.includes(cr)})},[_n]),Xn=function(){var cr=(0,ut.Z)(Ze.current.keys());return nn.length&&cr.push(Rt),cr},In=(0,Fe.useCallback)(function(zn){var cr="".concat(Ze.current.get(zn)).concat(yt),qn=new Set;return(0,ut.Z)(gt.current.keys()).forEach(function(br){br.startsWith(cr)&&qn.add(gt.current.get(br))}),qn},[]);return Fe.useEffect(function(){return function(){Cn.current=!0}},[]),{registerPath:Jn,unregisterPath:Fn,refreshOverflowKeys:Nn,isSubPathKey:tr,getKeyPath:_n,getKeys:Xn,getSubPathKeys:In}}function rt(ht){var Ue=Fe.useRef(ht);Ue.current=ht;var Xe=Fe.useCallback(function(){for(var Ze,gt=arguments.length,Wt=new Array(gt),Gt=0;Gt<gt;Gt++)Wt[Gt]=arguments[Gt];return(Ze=Ue.current)===null||Ze===void 0?void 0:Ze.call.apply(Ze,[Ue].concat(Wt))},[]);return ht?Xe:void 0}var Ft=Math.random().toFixed(5).toString().slice(2),sn=0;function ct(ht){var Ue=(0,Re.Z)(ht,{value:ht}),Xe=(0,xe.Z)(Ue,2),Ze=Xe[0],gt=Xe[1];return Fe.useEffect(function(){sn+=1;var Wt="".concat(Ft,"-").concat(sn);gt("rc-menu-uuid-".concat(Wt))},[]),Ze}var qt=ue(38705),an=ue(17212),Qe=ue(39153),mt=ue(55401),Nt=ue(2738),vn=ue(8654);function mn(ht,Ue,Xe,Ze){var gt=Fe.useContext(it),Wt=gt.activeKey,Gt=gt.onActive,nn=gt.onInactive,Ht={active:Wt===ht};return Ue||(Ht.onMouseEnter=function(bt){Xe==null||Xe({key:ht,domEvent:bt}),Gt(ht)},Ht.onMouseLeave=function(bt){Ze==null||Ze({key:ht,domEvent:bt}),nn(ht)}),Ht}function wn(ht){var Ue=Fe.useContext(it),Xe=Ue.mode,Ze=Ue.rtl,gt=Ue.inlineIndent;if(Xe!=="inline")return null;var Wt=ht;return Ze?{paddingRight:Wt*gt}:{paddingLeft:Wt*gt}}function Tn(ht){var Ue=ht.icon,Xe=ht.props,Ze=ht.children,gt;return Ue===null||Ue===!1?null:(typeof Ue=="function"?gt=Fe.createElement(Ue,(0,ze.Z)({},Xe)):typeof Ue!="boolean"&&(gt=Ue),gt||Ze||null)}var Zn=["item"];function Hn(ht){var Ue=ht.item,Xe=(0,Me.Z)(ht,Zn);return Object.defineProperty(Xe,"item",{get:function(){return(0,Ae.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),Ue}}),Xe}var wr=["title","attribute","elementRef"],Cr=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],Yn=["active"],Nr=function(ht){(0,Qe.Z)(Xe,ht);var Ue=(0,mt.Z)(Xe);function Xe(){return(0,qt.Z)(this,Xe),Ue.apply(this,arguments)}return(0,an.Z)(Xe,[{key:"render",value:function(){var gt=this.props,Wt=gt.title,Gt=gt.attribute,nn=gt.elementRef,Ht=(0,Me.Z)(gt,wr),bt=(0,Nt.Z)(Ht,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,Ae.ZP)(!Gt,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),Fe.createElement(_e.Z.Item,(0,se.Z)({},Gt,{title:typeof Wt=="string"?Wt:void 0},bt,{ref:nn}))}}]),Xe}(Fe.Component),Kr=Fe.forwardRef(function(ht,Ue){var Xe,Ze=ht.style,gt=ht.className,Wt=ht.eventKey,Gt=ht.warnKey,nn=ht.disabled,Ht=ht.itemIcon,bt=ht.children,Cn=ht.role,kn=ht.onMouseEnter,Jn=ht.onMouseLeave,Fn=ht.onClick,Nn=ht.onKeyDown,_n=ht.onFocus,tr=(0,Me.Z)(ht,Cr),Xn=at(Wt),In=Fe.useContext(it),zn=In.prefixCls,cr=In.onItemClick,qn=In.disabled,br=In.overflowDisabled,Br=In.itemIcon,rr=In.selectedKeys,yn=In.onActive,hn=Fe.useContext(kt),En=hn._internalRenderMenuItem,Qn="".concat(zn,"-item"),Rn=Fe.useRef(),Mn=Fe.useRef(),er=qn||nn,vr=(0,vn.x1)(Ue,Mn),Dr=et(Wt),ei=function(ir){return{key:Wt,keyPath:(0,ut.Z)(Dr).reverse(),item:Rn.current,domEvent:ir}},$n=Ht||Br,Kn=mn(Wt,er,kn,Jn),Gn=Kn.active,sr=(0,Me.Z)(Kn,Yn),Wr=rr.includes(Wt),vi=wn(Dr.length),ci=function(ir){if(!er){var mr=ei(ir);Fn==null||Fn(Hn(mr)),cr(mr)}},qr=function(ir){if(Nn==null||Nn(ir),ir.which===xt.Z.ENTER){var mr=ei(ir);Fn==null||Fn(Hn(mr)),cr(mr)}},fi=function(ir){yn(Wt),_n==null||_n(ir)},mi={};ht.role==="option"&&(mi["aria-selected"]=Wr);var lr=Fe.createElement(Nr,(0,se.Z)({ref:Rn,elementRef:vr,role:Cn===null?"none":Cn||"menuitem",tabIndex:nn?null:-1,"data-menu-id":br&&Xn?null:Xn},tr,sr,mi,{component:"li","aria-disabled":nn,style:(0,ze.Z)((0,ze.Z)({},vi),Ze),className:we()(Qn,(Xe={},(0,Te.Z)(Xe,"".concat(Qn,"-active"),Gn),(0,Te.Z)(Xe,"".concat(Qn,"-selected"),Wr),(0,Te.Z)(Xe,"".concat(Qn,"-disabled"),er),Xe),gt),onClick:ci,onKeyDown:qr,onFocus:fi}),bt,Fe.createElement(Tn,{props:(0,ze.Z)((0,ze.Z)({},ht),{},{isSelected:Wr}),icon:$n}));return En&&(lr=En(lr,ht,{selected:Wr})),lr});function Or(ht,Ue){var Xe=ht.eventKey,Ze=Je(),gt=et(Xe);return Fe.useEffect(function(){if(Ze)return Ze.registerPath(Xe,gt),function(){Ze.unregisterPath(Xe,gt)}},[gt]),Ze?null:Fe.createElement(Kr,(0,se.Z)({},ht,{ref:Ue}))}var Ar=Fe.forwardRef(Or),kr=["className","children"],Gr=function(Ue,Xe){var Ze=Ue.className,gt=Ue.children,Wt=(0,Me.Z)(Ue,kr),Gt=Fe.useContext(it),nn=Gt.prefixCls,Ht=Gt.mode,bt=Gt.rtl;return Fe.createElement("ul",(0,se.Z)({className:we()(nn,bt&&"".concat(nn,"-rtl"),"".concat(nn,"-sub"),"".concat(nn,"-").concat(Ht==="inline"?"inline":"vertical"),Ze),role:"menu"},Wt,{"data-menu-list":!0,ref:Xe}),gt)},ar=Fe.forwardRef(Gr);ar.displayName="SubMenuList";var $r=ar,Ur=ue(11592);function Vr(ht,Ue){return(0,Ur.Z)(ht).map(function(Xe,Ze){if(Fe.isValidElement(Xe)){var gt,Wt,Gt=Xe.key,nn=(gt=(Wt=Xe.props)===null||Wt===void 0?void 0:Wt.eventKey)!==null&&gt!==void 0?gt:Gt,Ht=nn==null;Ht&&(nn="tmp_key-".concat([].concat((0,ut.Z)(Ue),[Ze]).join("-")));var bt={key:nn,eventKey:nn};return Fe.cloneElement(Xe,bt)}return Xe})}var Yr=ue(35593),Zr={adjustX:1,adjustY:1},dr={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}},_r={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}},Ln=null;function Wn(ht,Ue,Xe){if(Ue)return Ue;if(Xe)return Xe[ht]||Xe.other}var Er={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function St(ht){var Ue=ht.prefixCls,Xe=ht.visible,Ze=ht.children,gt=ht.popup,Wt=ht.popupStyle,Gt=ht.popupClassName,nn=ht.popupOffset,Ht=ht.disabled,bt=ht.mode,Cn=ht.onVisibleChange,kn=Fe.useContext(it),Jn=kn.getPopupContainer,Fn=kn.rtl,Nn=kn.subMenuOpenDelay,_n=kn.subMenuCloseDelay,tr=kn.builtinPlacements,Xn=kn.triggerSubMenuAction,In=kn.forceSubMenuRender,zn=kn.rootClassName,cr=kn.motion,qn=kn.defaultMotions,br=Fe.useState(!1),Br=(0,xe.Z)(br,2),rr=Br[0],yn=Br[1],hn=Fn?(0,ze.Z)((0,ze.Z)({},_r),tr):(0,ze.Z)((0,ze.Z)({},dr),tr),En=Er[bt],Qn=Wn(bt,cr,qn),Rn=Fe.useRef(Qn);bt!=="inline"&&(Rn.current=Qn);var Mn=(0,ze.Z)((0,ze.Z)({},Rn.current),{},{leavedClassName:"".concat(Ue,"-hidden"),removeOnLeave:!1,motionAppear:!0}),er=Fe.useRef();return Fe.useEffect(function(){return er.current=(0,Qt.Z)(function(){yn(Xe)}),function(){Qt.Z.cancel(er.current)}},[Xe]),Fe.createElement(Yr.Z,{prefixCls:Ue,popupClassName:we()("".concat(Ue,"-popup"),(0,Te.Z)({},"".concat(Ue,"-rtl"),Fn),Gt,zn),stretch:bt==="horizontal"?"minWidth":null,getPopupContainer:Jn,builtinPlacements:hn,popupPlacement:En,popupVisible:rr,popup:gt,popupStyle:Wt,popupAlign:nn&&{offset:nn},action:Ht?[]:[Xn],mouseEnterDelay:Nn,mouseLeaveDelay:_n,onPopupVisibleChange:Cn,forceRender:In,popupMotion:Mn,fresh:!0},Ze)}var Le=ue(77900);function We(ht){var Ue=ht.id,Xe=ht.open,Ze=ht.keyPath,gt=ht.children,Wt="inline",Gt=Fe.useContext(it),nn=Gt.prefixCls,Ht=Gt.forceSubMenuRender,bt=Gt.motion,Cn=Gt.defaultMotions,kn=Gt.mode,Jn=Fe.useRef(!1);Jn.current=kn===Wt;var Fn=Fe.useState(!Jn.current),Nn=(0,xe.Z)(Fn,2),_n=Nn[0],tr=Nn[1],Xn=Jn.current?Xe:!1;Fe.useEffect(function(){Jn.current&&tr(!1)},[kn]);var In=(0,ze.Z)({},Wn(Wt,bt,Cn));Ze.length>1&&(In.motionAppear=!1);var zn=In.onVisibleChanged;return In.onVisibleChanged=function(cr){return!Jn.current&&!cr&&tr(!0),zn==null?void 0:zn(cr)},_n?null:Fe.createElement($e,{mode:Wt,locked:!Jn.current},Fe.createElement(Le.default,(0,se.Z)({visible:Xn},In,{forceRender:Ht,removeOnLeave:!1,leavedClassName:"".concat(nn,"-hidden")}),function(cr){var qn=cr.className,br=cr.style;return Fe.createElement($r,{id:Ue,className:qn,style:br},gt)}))}var Be=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Oe=["active"],lt=function(Ue){var Xe,Ze=Ue.style,gt=Ue.className,Wt=Ue.title,Gt=Ue.eventKey,nn=Ue.warnKey,Ht=Ue.disabled,bt=Ue.internalPopupClose,Cn=Ue.children,kn=Ue.itemIcon,Jn=Ue.expandIcon,Fn=Ue.popupClassName,Nn=Ue.popupOffset,_n=Ue.popupStyle,tr=Ue.onClick,Xn=Ue.onMouseEnter,In=Ue.onMouseLeave,zn=Ue.onTitleClick,cr=Ue.onTitleMouseEnter,qn=Ue.onTitleMouseLeave,br=(0,Me.Z)(Ue,Be),Br=at(Gt),rr=Fe.useContext(it),yn=rr.prefixCls,hn=rr.mode,En=rr.openKeys,Qn=rr.disabled,Rn=rr.overflowDisabled,Mn=rr.activeKey,er=rr.selectedKeys,vr=rr.itemIcon,Dr=rr.expandIcon,ei=rr.onItemClick,$n=rr.onOpenChange,Kn=rr.onActive,Gn=Fe.useContext(kt),sr=Gn._internalRenderSubMenuItem,Wr=Fe.useContext(Dt),vi=Wr.isSubPathKey,ci=et(),qr="".concat(yn,"-submenu"),fi=Qn||Ht,mi=Fe.useRef(),lr=Fe.useRef(),or=kn!=null?kn:vr,ir=Jn!=null?Jn:Dr,mr=En.includes(Gt),ri=!Rn&&mr,pi=vi(er,Gt),yi=mn(Gt,fi,cr,qn),gi=yi.active,si=(0,Me.Z)(yi,Oe),wi=Fe.useState(!1),Hi=(0,xe.Z)(wi,2),Di=Hi[0],aa=Hi[1],Ui=function(Fi){fi||aa(Fi)},Pi=function(Fi){Ui(!0),Xn==null||Xn({key:Gt,domEvent:Fi})},Pa=function(Fi){Ui(!1),In==null||In({key:Gt,domEvent:Fi})},da=Fe.useMemo(function(){return gi||(hn!=="inline"?Di||vi([Mn],Gt):!1)},[hn,gi,Mn,Di,Gt,vi]),oa=wn(ci.length),Xi=function(Fi){fi||(zn==null||zn({key:Gt,domEvent:Fi}),hn==="inline"&&$n(Gt,!mr))},Si=rt(function(Oi){tr==null||tr(Hn(Oi)),ei(Oi)}),Tr=function(Fi){hn!=="inline"&&$n(Gt,Fi)},ti=function(){Kn(Gt)},Hr=Br&&"".concat(Br,"-popup"),Ir=Fe.createElement("div",(0,se.Z)({role:"menuitem",style:oa,className:"".concat(qr,"-title"),tabIndex:fi?null:-1,ref:mi,title:typeof Wt=="string"?Wt:null,"data-menu-id":Rn&&Br?null:Br,"aria-expanded":ri,"aria-haspopup":!0,"aria-controls":Hr,"aria-disabled":fi,onClick:Xi,onFocus:ti},si),Wt,Fe.createElement(Tn,{icon:hn!=="horizontal"?ir:void 0,props:(0,ze.Z)((0,ze.Z)({},Ue),{},{isOpen:ri,isSubMenu:!0})},Fe.createElement("i",{className:"".concat(qr,"-arrow")}))),ni=Fe.useRef(hn);if(hn!=="inline"&&ci.length>1?ni.current="vertical":ni.current=hn,!Rn){var ii=ni.current;Ir=Fe.createElement(St,{mode:ii,prefixCls:qr,visible:!bt&&ri&&hn!=="inline",popupClassName:Fn,popupOffset:Nn,popupStyle:_n,popup:Fe.createElement($e,{mode:ii==="horizontal"?"vertical":ii},Fe.createElement($r,{id:Hr,ref:lr},Cn)),disabled:fi,onVisibleChange:Tr},Ir)}var Bi=Fe.createElement(_e.Z.Item,(0,se.Z)({role:"none"},br,{component:"li",style:Ze,className:we()(qr,"".concat(qr,"-").concat(hn),gt,(Xe={},(0,Te.Z)(Xe,"".concat(qr,"-open"),ri),(0,Te.Z)(Xe,"".concat(qr,"-active"),da),(0,Te.Z)(Xe,"".concat(qr,"-selected"),pi),(0,Te.Z)(Xe,"".concat(qr,"-disabled"),fi),Xe)),onMouseEnter:Pi,onMouseLeave:Pa}),Ir,!Rn&&Fe.createElement(We,{id:Hr,open:ri,keyPath:ci},Cn));return sr&&(Bi=sr(Bi,Ue,{selected:pi,active:da,open:ri,disabled:fi})),Fe.createElement($e,{onItemClick:Si,mode:hn==="horizontal"?"vertical":hn,itemIcon:or,expandIcon:ir},Bi)};function _t(ht){var Ue=ht.eventKey,Xe=ht.children,Ze=et(Ue),gt=Vr(Xe,Ze),Wt=Je();Fe.useEffect(function(){if(Wt)return Wt.registerPath(Ue,Ze),function(){Wt.unregisterPath(Ue,Ze)}},[Ze]);var Gt;return Wt?Gt=gt:Gt=Fe.createElement(lt,ht,gt),Fe.createElement(Lt.Provider,{value:Ze},Gt)}var Yt=ue(43749),Kt=["className","title","eventKey","children"],Jt=["children"],un=function(Ue){var Xe=Ue.className,Ze=Ue.title,gt=Ue.eventKey,Wt=Ue.children,Gt=(0,Me.Z)(Ue,Kt),nn=Fe.useContext(it),Ht=nn.prefixCls,bt="".concat(Ht,"-item-group");return Fe.createElement("li",(0,se.Z)({role:"presentation"},Gt,{onClick:function(kn){return kn.stopPropagation()},className:we()(bt,Xe)}),Fe.createElement("div",{role:"presentation",className:"".concat(bt,"-title"),title:typeof Ze=="string"?Ze:void 0},Ze),Fe.createElement("ul",{role:"group",className:"".concat(bt,"-list")},Wt))};function fn(ht){var Ue=ht.children,Xe=(0,Me.Z)(ht,Jt),Ze=et(Xe.eventKey),gt=Vr(Ue,Ze),Wt=Je();return Wt?gt:Fe.createElement(un,(0,Nt.Z)(Xe,["warnKey"]),gt)}function xn(ht){var Ue=ht.className,Xe=ht.style,Ze=Fe.useContext(it),gt=Ze.prefixCls,Wt=Je();return Wt?null:Fe.createElement("li",{role:"separator",className:we()("".concat(gt,"-item-divider"),Ue),style:Xe})}var zt=["label","children","key","type"];function ln(ht){return(ht||[]).map(function(Ue,Xe){if(Ue&&(0,Yt.Z)(Ue)==="object"){var Ze=Ue,gt=Ze.label,Wt=Ze.children,Gt=Ze.key,nn=Ze.type,Ht=(0,Me.Z)(Ze,zt),bt=Gt!=null?Gt:"tmp-".concat(Xe);return Wt||nn==="group"?nn==="group"?Fe.createElement(fn,(0,se.Z)({key:bt},Ht,{title:gt}),ln(Wt)):Fe.createElement(_t,(0,se.Z)({key:bt},Ht,{title:gt}),ln(Wt)):nn==="divider"?Fe.createElement(xn,(0,se.Z)({key:bt},Ht)):Fe.createElement(Ar,(0,se.Z)({key:bt},Ht),gt)}return null}).filter(function(Ue){return Ue})}function jn(ht,Ue,Xe){var Ze=ht;return Ue&&(Ze=ln(Ue)),Vr(Ze,Xe)}var Dn=["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"],Vn=[],Pn=Fe.forwardRef(function(ht,Ue){var Xe,Ze,gt=ht,Wt=gt.prefixCls,Gt=Wt===void 0?"rc-menu":Wt,nn=gt.rootClassName,Ht=gt.style,bt=gt.className,Cn=gt.tabIndex,kn=Cn===void 0?0:Cn,Jn=gt.items,Fn=gt.children,Nn=gt.direction,_n=gt.id,tr=gt.mode,Xn=tr===void 0?"vertical":tr,In=gt.inlineCollapsed,zn=gt.disabled,cr=gt.disabledOverflow,qn=gt.subMenuOpenDelay,br=qn===void 0?.1:qn,Br=gt.subMenuCloseDelay,rr=Br===void 0?.1:Br,yn=gt.forceSubMenuRender,hn=gt.defaultOpenKeys,En=gt.openKeys,Qn=gt.activeKey,Rn=gt.defaultActiveFirst,Mn=gt.selectable,er=Mn===void 0?!0:Mn,vr=gt.multiple,Dr=vr===void 0?!1:vr,ei=gt.defaultSelectedKeys,$n=gt.selectedKeys,Kn=gt.onSelect,Gn=gt.onDeselect,sr=gt.inlineIndent,Wr=sr===void 0?24:sr,vi=gt.motion,ci=gt.defaultMotions,qr=gt.triggerSubMenuAction,fi=qr===void 0?"hover":qr,mi=gt.builtinPlacements,lr=gt.itemIcon,or=gt.expandIcon,ir=gt.overflowedIndicator,mr=ir===void 0?"...":ir,ri=gt.overflowedIndicatorPopupClassName,pi=gt.getPopupContainer,yi=gt.onClick,gi=gt.onOpenChange,si=gt.onKeyDown,wi=gt.openAnimation,Hi=gt.openTransitionName,Di=gt._internalRenderMenuItem,aa=gt._internalRenderSubMenuItem,Ui=(0,Me.Z)(gt,Dn),Pi=Fe.useMemo(function(){return jn(Fn,Jn,Vn)},[Fn,Jn]),Pa=Fe.useState(!1),da=(0,xe.Z)(Pa,2),oa=da[0],Xi=da[1],Si=Fe.useRef(),Tr=ct(_n),ti=Nn==="rtl",Hr=(0,Re.Z)(hn,{value:En,postState:function(Ii){return Ii||Vn}}),Ir=(0,xe.Z)(Hr,2),ni=Ir[0],ii=Ir[1],Bi=function(Ii){var ji=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Ja(){ii(Ii),gi==null||gi(Ii)}ji?(0,ft.flushSync)(Ja):Ja()},Oi=Fe.useState(ni),Fi=(0,xe.Z)(Oi,2),zi=Fi[0],hi=Fi[1],ui=Fe.useRef(!1),Zi=Fe.useMemo(function(){return(Xn==="inline"||Xn==="vertical")&&In?["vertical",In]:[Xn,!1]},[Xn,In]),ai=(0,xe.Z)(Zi,2),Mi=ai[0],Ti=ai[1],Mo=Mi==="inline",Fa=Fe.useState(Mi),za=(0,xe.Z)(Fa,2),no=za[0],Ss=za[1],fo=Fe.useState(Ti),Ma=(0,xe.Z)(fo,2),ha=Ma[0],bo=Ma[1];Fe.useEffect(function(){Ss(Mi),bo(Ti),ui.current&&(Mo?ii(zi):Bi(Vn))},[Mi,Ti]);var ko=Fe.useState(0),Lo=(0,xe.Z)(ko,2),ns=Lo[0],No=Lo[1],Ya=ns>=Pi.length-1||no!=="horizontal"||cr;Fe.useEffect(function(){Mo&&hi(ni)},[ni]),Fe.useEffect(function(){return ui.current=!0,function(){ui.current=!1}},[]);var Oa=At(),$i=Oa.registerPath,Ao=Oa.unregisterPath,rs=Oa.refreshOverflowKeys,Do=Oa.isSubPathKey,Ci=Oa.getKeyPath,di=Oa.getKeys,Wi=Oa.getSubPathKeys,ka=Fe.useMemo(function(){return{registerPath:$i,unregisterPath:Ao}},[$i,Ao]),qi=Fe.useMemo(function(){return{isSubPathKey:Do}},[Do]);Fe.useEffect(function(){rs(Ya?Vn:Pi.slice(ns+1).map(function(Li){return Li.key}))},[ns,Ya]);var $a=(0,Re.Z)(Qn||Rn&&((Xe=Pi[0])===null||Xe===void 0?void 0:Xe.key),{value:Qn}),Ka=(0,xe.Z)($a,2),ro=Ka[0],Na=Ka[1],so=rt(function(Li){Na(Li)}),lo=rt(function(){Na(void 0)});(0,Fe.useImperativeHandle)(Ue,function(){return{list:Si.current,focus:function(Ii){var ji,Ja=di(),Aa=pe(Ja,Tr),xo=Aa.elements,po=Aa.key2element,Ha=Aa.element2key,Bo=oe(Si.current,xo),To=ro!=null?ro:Bo[0]?Ha.get(Bo[0]):(ji=Pi.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,Ii)}}}});var La=(0,Re.Z)(ei||[],{value:$n,postState:function(Ii){return Array.isArray(Ii)?Ii:Ii==null?Vn:[Ii]}}),bl=(0,xe.Z)(La,2),Vo=bl[0],Ys=bl[1],Kl=function(Ii){if(er){var ji=Ii.key,Ja=Vo.includes(ji),Aa;Dr?Ja?Aa=Vo.filter(function(po){return po!==ji}):Aa=[].concat((0,ut.Z)(Vo),[ji]):Aa=[ji],Ys(Aa);var xo=(0,ze.Z)((0,ze.Z)({},Ii),{},{selectedKeys:Aa});Ja?Gn==null||Gn(xo):Kn==null||Kn(xo)}!Dr&&ni.length&&no!=="inline"&&Bi(Vn)},Hl=rt(function(Li){yi==null||yi(Hn(Li)),Kl(Li)}),Cs=rt(function(Li,Ii){var ji=ni.filter(function(Aa){return Aa!==Li});if(Ii)ji.push(Li);else if(no!=="inline"){var Ja=Wi(Li);ji=ji.filter(function(Aa){return!Ja.has(Aa)})}(0,dt.Z)(ni,ji,!0)||Bi(ji,!0)}),Ec=function(Ii,ji){var Ja=ji!=null?ji:!ni.includes(Ii);Cs(Ii,Ja)},is=ce(no,ro,ti,Tr,Si,di,Ci,Na,Ec,si);Fe.useEffect(function(){Xi(!0)},[]);var xl=Fe.useMemo(function(){return{_internalRenderMenuItem:Di,_internalRenderSubMenuItem:aa}},[Di,aa]),Go=no!=="horizontal"||cr?Pi:Pi.map(function(Li,Ii){return Fe.createElement($e,{key:Li.key,overflowDisabled:Ii>ns},Li)}),as=Fe.createElement(_e.Z,(0,se.Z)({id:_n,ref:Si,prefixCls:"".concat(Gt,"-overflow"),component:"ul",itemComponent:Ar,className:we()(Gt,"".concat(Gt,"-root"),"".concat(Gt,"-").concat(no),bt,(Ze={},(0,Te.Z)(Ze,"".concat(Gt,"-inline-collapsed"),ha),(0,Te.Z)(Ze,"".concat(Gt,"-rtl"),ti),Ze),nn),dir:Nn,style:Ht,role:"menu",tabIndex:kn,data:Go,renderRawItem:function(Ii){return Ii},renderRawRest:function(Ii){var ji=Ii.length,Ja=ji?Pi.slice(-ji):null;return Fe.createElement(_t,{eventKey:Rt,title:mr,disabled:Ya,internalPopupClose:ji===0,popupClassName:ri},Ja)},maxCount:no!=="horizontal"||cr?_e.Z.INVALIDATE:_e.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Ii){No(Ii)},onKeyDown:is},Ui));return Fe.createElement(kt.Provider,{value:xl},Fe.createElement(Ye.Provider,{value:Tr},Fe.createElement($e,{prefixCls:Gt,rootClassName:nn,mode:no,openKeys:ni,rtl:ti,disabled:zn,motion:oa?vi:null,defaultMotions:oa?ci:null,activeKey:ro,onActive:so,onInactive:lo,selectedKeys:Vo,inlineIndent:Wr,subMenuOpenDelay:br,subMenuCloseDelay:rr,forceSubMenuRender:yn,builtinPlacements:mi,triggerSubMenuAction:fi,getPopupContainer:pi,itemIcon:lr,expandIcon:or,onItemClick:Hl,onOpenChange:Cs},Fe.createElement(Dt.Provider,{value:qi},as),Fe.createElement("div",{style:{display:"none"},"aria-hidden":!0},Fe.createElement(Ve.Provider,{value:ka},Pi)))))}),yr=Pn,Sn=yr;Sn.Item=Ar,Sn.SubMenu=_t,Sn.ItemGroup=fn,Sn.Divider=xn;var pr=Sn},83836:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return Tt}});var se=ue(60499),Te=ue(85899),ze=ue(72190),ut=ue(42244),xe=ue(59301),Me=ue(92310),De=ue.n(Me),we=ue(29301),_e=ue(34280),Re=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],dt=void 0;function Ae(wt,Ne){var be=wt.prefixCls,xt=wt.invalidate,Qt=wt.item,Vt=wt.renderItem,qe=wt.responsive,nt=wt.responsiveDisabled,Ot=wt.registerSize,dn=wt.itemKey,en=wt.className,on=wt.style,Xt=wt.children,Ut=wt.display,Zt=wt.order,ye=wt.component,le=ye===void 0?"div":ye,oe=(0,ut.Z)(wt,Re),he=qe&&!Ut;function pe(je){Ot(dn,je)}xe.useEffect(function(){return function(){pe(null)}},[]);var ce=Vt&&Qt!==dt?Vt(Qt,{index:Zt}):Xt,Ie;xt||(Ie={opacity:he?0:1,height:he?0:dt,overflowY:he?"hidden":dt,order:qe?Zt:dt,pointerEvents:he?"none":dt,position:he?"absolute":dt});var yt={};he&&(yt["aria-hidden"]=!0);var Pe=xe.createElement(le,(0,se.Z)({className:De()(!xt&&be,en),style:(0,Te.Z)((0,Te.Z)({},Ie),on)},yt,oe,{ref:Ne}),ce);return qe&&(Pe=xe.createElement(we.Z,{onResize:function(Rt){var At=Rt.offsetWidth;pe(At)},disabled:nt},Pe)),Pe}var Fe=xe.forwardRef(Ae);Fe.displayName="Item";var ft=Fe,Ye=ue(6089),ot=ue(4676),at=ue(16089);function Ct(wt){if(typeof MessageChannel=="undefined")(0,at.Z)(wt);else{var Ne=new MessageChannel;Ne.port1.onmessage=function(){return wt()},Ne.port2.postMessage(void 0)}}function jt(){var wt=xe.useRef(null),Ne=function(xt){wt.current||(wt.current=[],Ct(function(){(0,ot.unstable_batchedUpdates)(function(){wt.current.forEach(function(Qt){Qt()}),wt.current=null})})),wt.current.push(xt)};return Ne}function it(wt,Ne){var be=xe.useState(Ne),xt=(0,ze.Z)(be,2),Qt=xt[0],Vt=xt[1],qe=(0,Ye.Z)(function(nt){wt(function(){Vt(nt)})});return[Qt,qe]}var vt=xe.createContext(null),$e=["component"],Ee=["className"],Ve=["className"],Je=function(Ne,be){var xt=xe.useContext(vt);if(!xt){var Qt=Ne.component,Vt=Qt===void 0?"div":Qt,qe=(0,ut.Z)(Ne,$e);return xe.createElement(Vt,(0,se.Z)({},qe,{ref:be}))}var nt=xt.className,Ot=(0,ut.Z)(xt,Ee),dn=Ne.className,en=(0,ut.Z)(Ne,Ve);return xe.createElement(vt.Provider,{value:null},xe.createElement(ft,(0,se.Z)({ref:be,className:De()(nt,dn)},Ot,en)))},Lt=xe.forwardRef(Je);Lt.displayName="RawItem";var et=Lt,Dt=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","prefix","suffix","component","itemComponent","onVisibleChange"],Ge="responsive",kt="invalidate";function tt(wt){return"+ ".concat(wt.length," ...")}function $t(wt,Ne){var be=wt.prefixCls,xt=be===void 0?"rc-overflow":be,Qt=wt.data,Vt=Qt===void 0?[]:Qt,qe=wt.renderItem,nt=wt.renderRawItem,Ot=wt.itemKey,dn=wt.itemWidth,en=dn===void 0?10:dn,on=wt.ssr,Xt=wt.style,Ut=wt.className,Zt=wt.maxCount,ye=wt.renderRest,le=wt.renderRawRest,oe=wt.prefix,he=wt.suffix,pe=wt.component,ce=pe===void 0?"div":pe,Ie=wt.itemComponent,yt=wt.onVisibleChange,Pe=(0,ut.Z)(wt,Dt),je=on==="full",Rt=jt(),At=it(Rt,null),rt=(0,ze.Z)(At,2),Ft=rt[0],sn=rt[1],ct=Ft||0,qt=it(Rt,new Map),an=(0,ze.Z)(qt,2),Qe=an[0],mt=an[1],Nt=it(Rt,0),vn=(0,ze.Z)(Nt,2),mn=vn[0],wn=vn[1],Tn=it(Rt,0),Zn=(0,ze.Z)(Tn,2),Hn=Zn[0],wr=Zn[1],Cr=it(Rt,0),Yn=(0,ze.Z)(Cr,2),Nr=Yn[0],Kr=Yn[1],Or=it(Rt,0),Ar=(0,ze.Z)(Or,2),kr=Ar[0],Gr=Ar[1],ar=(0,xe.useState)(null),$r=(0,ze.Z)(ar,2),Ur=$r[0],Vr=$r[1],Yr=(0,xe.useState)(null),Zr=(0,ze.Z)(Yr,2),dr=Zr[0],_r=Zr[1],Ln=xe.useMemo(function(){return dr===null&&je?Number.MAX_SAFE_INTEGER:dr||0},[dr,Ft]),Wn=(0,xe.useState)(!1),Er=(0,ze.Z)(Wn,2),St=Er[0],Le=Er[1],We="".concat(xt,"-item"),Be=Math.max(mn,Hn),Oe=Zt===Ge,lt=Vt.length&&Oe,_t=Zt===kt,Yt=lt||typeof Zt=="number"&&Vt.length>Zt,Kt=(0,xe.useMemo)(function(){var Wt=Vt;return lt?Ft===null&&je?Wt=Vt:Wt=Vt.slice(0,Math.min(Vt.length,ct/en)):typeof Zt=="number"&&(Wt=Vt.slice(0,Zt)),Wt},[Vt,en,Ft,Zt,lt]),Jt=(0,xe.useMemo)(function(){return lt?Vt.slice(Ln+1):Vt.slice(Kt.length)},[Vt,Kt,lt,Ln]),un=(0,xe.useCallback)(function(Wt,Gt){var nn;return typeof Ot=="function"?Ot(Wt):(nn=Ot&&(Wt==null?void 0:Wt[Ot]))!==null&&nn!==void 0?nn:Gt},[Ot]),fn=(0,xe.useCallback)(qe||function(Wt){return Wt},[qe]);function xn(Wt,Gt,nn){dr===Wt&&(Gt===void 0||Gt===Ur)||(_r(Wt),nn||(Le(Wt<Vt.length-1),yt==null||yt(Wt)),Gt!==void 0&&Vr(Gt))}function zt(Wt,Gt){sn(Gt.clientWidth)}function ln(Wt,Gt){mt(function(nn){var Ht=new Map(nn);return Gt===null?Ht.delete(Wt):Ht.set(Wt,Gt),Ht})}function jn(Wt,Gt){wr(Gt),wn(Hn)}function Dn(Wt,Gt){Kr(Gt)}function Vn(Wt,Gt){Gr(Gt)}function Pn(Wt){return Qe.get(un(Kt[Wt],Wt))}(0,_e.Z)(function(){if(ct&&typeof Be=="number"&&Kt){var Wt=Nr+kr,Gt=Kt.length,nn=Gt-1;if(!Gt){xn(0,null);return}for(var Ht=0;Ht<Gt;Ht+=1){var bt=Pn(Ht);if(je&&(bt=bt||0),bt===void 0){xn(Ht-1,void 0,!0);break}if(Wt+=bt,nn===0&&Wt<=ct||Ht===nn-1&&Wt+Pn(nn)<=ct){xn(nn,null);break}else if(Wt+Be>ct){xn(Ht-1,Wt-bt-kr+Hn);break}}he&&Pn(0)+kr>ct&&Vr(null)}},[ct,Qe,Hn,Nr,kr,un,Kt]);var yr=St&&!!Jt.length,Sn={};Ur!==null&&lt&&(Sn={position:"absolute",left:Ur,top:0});var pr={prefixCls:We,responsive:lt,component:Ie,invalidate:_t},ht=nt?function(Wt,Gt){var nn=un(Wt,Gt);return xe.createElement(vt.Provider,{key:nn,value:(0,Te.Z)((0,Te.Z)({},pr),{},{order:Gt,item:Wt,itemKey:nn,registerSize:ln,display:Gt<=Ln})},nt(Wt,Gt))}:function(Wt,Gt){var nn=un(Wt,Gt);return xe.createElement(ft,(0,se.Z)({},pr,{order:Gt,key:nn,item:Wt,renderItem:fn,itemKey:nn,registerSize:ln,display:Gt<=Ln}))},Ue={order:yr?Ln:Number.MAX_SAFE_INTEGER,className:"".concat(We,"-rest"),registerSize:jn,display:yr},Xe=ye||tt,Ze=le?xe.createElement(vt.Provider,{value:(0,Te.Z)((0,Te.Z)({},pr),Ue)},le(Jt)):xe.createElement(ft,(0,se.Z)({},pr,Ue),typeof Xe=="function"?Xe(Jt):Xe),gt=xe.createElement(ce,(0,se.Z)({className:De()(!_t&&xt,Ut),style:Xt,ref:Ne},Pe),oe&&xe.createElement(ft,(0,se.Z)({},pr,{responsive:Oe,responsiveDisabled:!lt,order:-1,className:"".concat(We,"-prefix"),registerSize:Dn,display:!0}),oe),Kt.map(ht),Yt?Ze:null,he&&xe.createElement(ft,(0,se.Z)({},pr,{responsive:Oe,responsiveDisabled:!lt,order:Ln,className:"".concat(We,"-suffix"),registerSize:Vn,display:!0,style:Sn}),he));return Oe?xe.createElement(we.Z,{onResize:zt,disabled:!lt},gt):gt}var pt=xe.forwardRef($t);pt.displayName="Overflow",pt.Item=et,pt.RESPONSIVE=Ge,pt.INVALIDATE=kt;var Bt=pt,Tt=Bt},91735:function(bn,tn){"use strict";tn.Z={items_per_page:"\u6761/\u9875",jump_to:"\u8DF3\u81F3",jump_to_confirm:"\u786E\u5B9A",page:"\u9875",prev_page:"\u4E0A\u4E00\u9875",next_page:"\u4E0B\u4E00\u9875",prev_5:"\u5411\u524D 5 \u9875",next_5:"\u5411\u540E 5 \u9875",prev_3:"\u5411\u524D 3 \u9875",next_3:"\u5411\u540E 3 \u9875",page_size:"\u9875\u7801"}},17115:function(bn,tn,ue){"use strict";ue.d(tn,{ZP:function(){return De}});var se=ue(72190),Te=ue(59301),ze=ue(47273),ut=0,xe=(0,ze.Z)();function Me(){var we;return xe?(we=ut,ut+=1):we="TEST_OR_SSR",we}function De(we){var _e=Te.useState(),Re=(0,se.Z)(_e,2),dt=Re[0],Ae=Re[1];return Te.useEffect(function(){Ae("rc_select_".concat(Me()))},[]),we||dt}},77861:function(bn,tn,ue){"use strict";ue.d(tn,{Ac:function(){return Ft},Xo:function(){return Hn},Wx:function(){return Cr},ZP:function(){return We},lk:function(){return vt}});var se=ue(60499),Te=ue(77654),ze=ue(18642),ut=ue(85899),xe=ue(72190),Me=ue(42244),De=ue(43749),we=ue(18929),_e=ue(48736),Re=ue(59301),dt=ue(92310),Ae=ue.n(dt),Fe=ue(34280),ft=ue(49658),Ye=ue(10228),ot=ue(8654),at=function(Oe){var lt=Oe.className,_t=Oe.customizeIcon,Yt=Oe.customizeIconProps,Kt=Oe.onMouseDown,Jt=Oe.onClick,un=Oe.children,fn;return typeof _t=="function"?fn=_t(Yt):fn=_t,Re.createElement("span",{className:lt,onMouseDown:function(zt){zt.preventDefault(),Kt&&Kt(zt)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:Jt,"aria-hidden":!0},fn!==void 0?fn:Re.createElement("span",{className:Ae()(lt.split(/\s+/).map(function(xn){return"".concat(xn,"-icon")}))},un))},Ct=at;function jt(Be,Oe,lt,_t,Yt){var Kt=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,Jt=arguments.length>6?arguments[6]:void 0,un=arguments.length>7?arguments[7]:void 0,fn=Re.useMemo(function(){if((0,De.Z)(_t)==="object")return _t.clearIcon;if(Yt)return Yt},[_t,Yt]),xn=Re.useMemo(function(){return!!(!Kt&&_t&&(lt.length||Jt)&&!(un==="combobox"&&Jt===""))},[_t,Kt,lt.length,Jt,un]);return{allowClear:xn,clearIcon:Re.createElement(Ct,{className:"".concat(Be,"-clear"),onMouseDown:Oe,customizeIcon:fn},"\xD7")}}var it=Re.createContext(null);function vt(){return Re.useContext(it)}function $e(){var Be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,Oe=Re.useState(!1),lt=(0,xe.Z)(Oe,2),_t=lt[0],Yt=lt[1],Kt=Re.useRef(null),Jt=function(){window.clearTimeout(Kt.current)};Re.useEffect(function(){return Jt},[]);var un=function(xn,zt){Jt(),Kt.current=window.setTimeout(function(){Yt(xn),zt&&zt()},Be)};return[_t,un,Jt]}function Ee(){var Be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,Oe=Re.useRef(null),lt=Re.useRef(null);Re.useEffect(function(){return function(){window.clearTimeout(lt.current)}},[]);function _t(Yt){(Yt||Oe.current===null)&&(Oe.current=Yt),window.clearTimeout(lt.current),lt.current=window.setTimeout(function(){Oe.current=null},Be)}return[function(){return Oe.current},_t]}function Ve(Be,Oe,lt,_t){var Yt=Re.useRef(null);Yt.current={open:Oe,triggerOpen:lt,customizedTrigger:_t},Re.useEffect(function(){function Kt(Jt){var un;if(!((un=Yt.current)!==null&&un!==void 0&&un.customizedTrigger)){var fn=Jt.target;fn.shadowRoot&&Jt.composed&&(fn=Jt.composedPath()[0]||fn),Yt.current.open&&Be().filter(function(xn){return xn}).every(function(xn){return!xn.contains(fn)&&xn!==fn})&&Yt.current.triggerOpen(!1)}}return window.addEventListener("mousedown",Kt),function(){return window.removeEventListener("mousedown",Kt)}},[])}var Je=ue(26112),Lt=ue(83836),et=function(Oe,lt){var _t,Yt,Kt=Oe.prefixCls,Jt=Oe.id,un=Oe.inputElement,fn=Oe.disabled,xn=Oe.tabIndex,zt=Oe.autoFocus,ln=Oe.autoComplete,jn=Oe.editable,Dn=Oe.activeDescendantId,Vn=Oe.value,Pn=Oe.maxLength,yr=Oe.onKeyDown,Sn=Oe.onMouseDown,pr=Oe.onChange,ht=Oe.onPaste,Ue=Oe.onCompositionStart,Xe=Oe.onCompositionEnd,Ze=Oe.open,gt=Oe.attrs,Wt=un||Re.createElement("input",null),Gt=Wt,nn=Gt.ref,Ht=Gt.props,bt=Ht.onKeyDown,Cn=Ht.onChange,kn=Ht.onMouseDown,Jn=Ht.onCompositionStart,Fn=Ht.onCompositionEnd,Nn=Ht.style;return(0,_e.Kp)(!("maxLength"in Wt.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),Wt=Re.cloneElement(Wt,(0,ut.Z)((0,ut.Z)((0,ut.Z)({type:"search"},Ht),{},{id:Jt,ref:(0,ot.sQ)(lt,nn),disabled:fn,tabIndex:xn,autoComplete:ln||"off",autoFocus:zt,className:Ae()("".concat(Kt,"-selection-search-input"),(_t=Wt)===null||_t===void 0||(Yt=_t.props)===null||Yt===void 0?void 0:Yt.className),role:"combobox","aria-label":"Search","aria-expanded":Ze||!1,"aria-haspopup":"listbox","aria-owns":"".concat(Jt,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(Jt,"_list"),"aria-activedescendant":Ze?Dn:void 0},gt),{},{value:jn?Vn:"",maxLength:Pn,readOnly:!jn,unselectable:jn?null:"on",style:(0,ut.Z)((0,ut.Z)({},Nn),{},{opacity:jn?null:0}),onKeyDown:function(tr){yr(tr),bt&&bt(tr)},onMouseDown:function(tr){Sn(tr),kn&&kn(tr)},onChange:function(tr){pr(tr),Cn&&Cn(tr)},onCompositionStart:function(tr){Ue(tr),Jn&&Jn(tr)},onCompositionEnd:function(tr){Xe(tr),Fn&&Fn(tr)},onPaste:ht})),Wt},Dt=Re.forwardRef(et);Dt.displayName="Input";var Ge=Dt;function kt(Be){return Array.isArray(Be)?Be:Be!==void 0?[Be]:[]}var tt=typeof window!="undefined"&&window.document&&window.document.documentElement,$t=tt;function pt(Be){return Be!=null}function Bt(Be){return!Be&&Be!==0}function Tt(Be){return["string","number"].includes((0,De.Z)(Be))}function wt(Be){var Oe=void 0;return Be&&(Tt(Be.title)?Oe=Be.title.toString():Tt(Be.label)&&(Oe=Be.label.toString())),Oe}function Ne(Be,Oe){$t?Re.useLayoutEffect(Be,Oe):Re.useEffect(Be,Oe)}function be(Be){var Oe;return(Oe=Be.key)!==null&&Oe!==void 0?Oe:Be.value}var xt=function(Oe){Oe.preventDefault(),Oe.stopPropagation()},Qt=function(Oe){var lt=Oe.id,_t=Oe.prefixCls,Yt=Oe.values,Kt=Oe.open,Jt=Oe.searchValue,un=Oe.autoClearSearchValue,fn=Oe.inputRef,xn=Oe.placeholder,zt=Oe.disabled,ln=Oe.mode,jn=Oe.showSearch,Dn=Oe.autoFocus,Vn=Oe.autoComplete,Pn=Oe.activeDescendantId,yr=Oe.tabIndex,Sn=Oe.removeIcon,pr=Oe.maxTagCount,ht=Oe.maxTagTextLength,Ue=Oe.maxTagPlaceholder,Xe=Ue===void 0?function(Mn){return"+ ".concat(Mn.length," ...")}:Ue,Ze=Oe.tagRender,gt=Oe.onToggleOpen,Wt=Oe.onRemove,Gt=Oe.onInputChange,nn=Oe.onInputPaste,Ht=Oe.onInputKeyDown,bt=Oe.onInputMouseDown,Cn=Oe.onInputCompositionStart,kn=Oe.onInputCompositionEnd,Jn=Re.useRef(null),Fn=(0,Re.useState)(0),Nn=(0,xe.Z)(Fn,2),_n=Nn[0],tr=Nn[1],Xn=(0,Re.useState)(!1),In=(0,xe.Z)(Xn,2),zn=In[0],cr=In[1],qn="".concat(_t,"-selection"),br=Kt||ln==="multiple"&&un===!1||ln==="tags"?Jt:"",Br=ln==="tags"||ln==="multiple"&&un===!1||jn&&(Kt||zn);Ne(function(){tr(Jn.current.scrollWidth)},[br]);function rr(Mn,er,vr,Dr,ei){return Re.createElement("span",{className:Ae()("".concat(qn,"-item"),(0,ze.Z)({},"".concat(qn,"-item-disabled"),vr)),title:wt(Mn)},Re.createElement("span",{className:"".concat(qn,"-item-content")},er),Dr&&Re.createElement(Ct,{className:"".concat(qn,"-item-remove"),onMouseDown:xt,onClick:ei,customizeIcon:Sn},"\xD7"))}function yn(Mn,er,vr,Dr,ei){var $n=function(Gn){xt(Gn),gt(!Kt)};return Re.createElement("span",{onMouseDown:$n},Ze({label:er,value:Mn,disabled:vr,closable:Dr,onClose:ei}))}function hn(Mn){var er=Mn.disabled,vr=Mn.label,Dr=Mn.value,ei=!zt&&!er,$n=vr;if(typeof ht=="number"&&(typeof vr=="string"||typeof vr=="number")){var Kn=String($n);Kn.length>ht&&($n="".concat(Kn.slice(0,ht),"..."))}var Gn=function(Wr){Wr&&Wr.stopPropagation(),Wt(Mn)};return typeof Ze=="function"?yn(Dr,$n,er,ei,Gn):rr(Mn,$n,er,ei,Gn)}function En(Mn){var er=typeof Xe=="function"?Xe(Mn):Xe;return rr({title:er},er,!1)}var Qn=Re.createElement("div",{className:"".concat(qn,"-search"),style:{width:_n},onFocus:function(){cr(!0)},onBlur:function(){cr(!1)}},Re.createElement(Ge,{ref:fn,open:Kt,prefixCls:_t,id:lt,inputElement:null,disabled:zt,autoFocus:Dn,autoComplete:Vn,editable:Br,activeDescendantId:Pn,value:br,onKeyDown:Ht,onMouseDown:bt,onChange:Gt,onPaste:nn,onCompositionStart:Cn,onCompositionEnd:kn,tabIndex:yr,attrs:(0,Je.Z)(Oe,!0)}),Re.createElement("span",{ref:Jn,className:"".concat(qn,"-search-mirror"),"aria-hidden":!0},br,"\xA0")),Rn=Re.createElement(Lt.Z,{prefixCls:"".concat(qn,"-overflow"),data:Yt,renderItem:hn,renderRest:En,suffix:Qn,itemKey:be,maxCount:pr});return Re.createElement(Re.Fragment,null,Rn,!Yt.length&&!br&&Re.createElement("span",{className:"".concat(qn,"-placeholder")},xn))},Vt=Qt,qe=function(Oe){var lt=Oe.inputElement,_t=Oe.prefixCls,Yt=Oe.id,Kt=Oe.inputRef,Jt=Oe.disabled,un=Oe.autoFocus,fn=Oe.autoComplete,xn=Oe.activeDescendantId,zt=Oe.mode,ln=Oe.open,jn=Oe.values,Dn=Oe.placeholder,Vn=Oe.tabIndex,Pn=Oe.showSearch,yr=Oe.searchValue,Sn=Oe.activeValue,pr=Oe.maxLength,ht=Oe.onInputKeyDown,Ue=Oe.onInputMouseDown,Xe=Oe.onInputChange,Ze=Oe.onInputPaste,gt=Oe.onInputCompositionStart,Wt=Oe.onInputCompositionEnd,Gt=Oe.title,nn=Re.useState(!1),Ht=(0,xe.Z)(nn,2),bt=Ht[0],Cn=Ht[1],kn=zt==="combobox",Jn=kn||Pn,Fn=jn[0],Nn=yr||"";kn&&Sn&&!bt&&(Nn=Sn),Re.useEffect(function(){kn&&Cn(!1)},[kn,Sn]);var _n=zt!=="combobox"&&!ln&&!Pn?!1:!!Nn,tr=Gt===void 0?wt(Fn):Gt,Xn=function(){if(Fn)return null;var zn=_n?{visibility:"hidden"}:void 0;return Re.createElement("span",{className:"".concat(_t,"-selection-placeholder"),style:zn},Dn)};return Re.createElement(Re.Fragment,null,Re.createElement("span",{className:"".concat(_t,"-selection-search")},Re.createElement(Ge,{ref:Kt,prefixCls:_t,id:Yt,open:ln,inputElement:lt,disabled:Jt,autoFocus:un,autoComplete:fn,editable:Jn,activeDescendantId:xn,value:Nn,onKeyDown:ht,onMouseDown:Ue,onChange:function(zn){Cn(!0),Xe(zn)},onPaste:Ze,onCompositionStart:gt,onCompositionEnd:Wt,tabIndex:Vn,attrs:(0,Je.Z)(Oe,!0),maxLength:kn?pr:void 0})),!kn&&Fn?Re.createElement("span",{className:"".concat(_t,"-selection-item"),title:tr,style:_n?{visibility:"hidden"}:void 0},Fn.label):null,Xn())},nt=qe;function Ot(Be){return![Ye.Z.ESC,Ye.Z.SHIFT,Ye.Z.BACKSPACE,Ye.Z.TAB,Ye.Z.WIN_KEY,Ye.Z.ALT,Ye.Z.META,Ye.Z.WIN_KEY_RIGHT,Ye.Z.CTRL,Ye.Z.SEMICOLON,Ye.Z.EQUALS,Ye.Z.CAPS_LOCK,Ye.Z.CONTEXT_MENU,Ye.Z.F1,Ye.Z.F2,Ye.Z.F3,Ye.Z.F4,Ye.Z.F5,Ye.Z.F6,Ye.Z.F7,Ye.Z.F8,Ye.Z.F9,Ye.Z.F10,Ye.Z.F11,Ye.Z.F12].includes(Be)}var dn=function(Oe,lt){var _t=(0,Re.useRef)(null),Yt=(0,Re.useRef)(!1),Kt=Oe.prefixCls,Jt=Oe.open,un=Oe.mode,fn=Oe.showSearch,xn=Oe.tokenWithEnter,zt=Oe.autoClearSearchValue,ln=Oe.onSearch,jn=Oe.onSearchSubmit,Dn=Oe.onToggleOpen,Vn=Oe.onInputKeyDown,Pn=Oe.domRef;Re.useImperativeHandle(lt,function(){return{focus:function(){_t.current.focus()},blur:function(){_t.current.blur()}}});var yr=Ee(0),Sn=(0,xe.Z)(yr,2),pr=Sn[0],ht=Sn[1],Ue=function(Nn){var _n=Nn.which;(_n===Ye.Z.UP||_n===Ye.Z.DOWN)&&Nn.preventDefault(),Vn&&Vn(Nn),_n===Ye.Z.ENTER&&un==="tags"&&!Yt.current&&!Jt&&(jn==null||jn(Nn.target.value)),Ot(_n)&&Dn(!0)},Xe=function(){ht(!0)},Ze=(0,Re.useRef)(null),gt=function(Nn){ln(Nn,!0,Yt.current)!==!1&&Dn(!0)},Wt=function(){Yt.current=!0},Gt=function(Nn){Yt.current=!1,un!=="combobox"&&gt(Nn.target.value)},nn=function(Nn){var _n=Nn.target.value;if(xn&&Ze.current&&/[\r\n]/.test(Ze.current)){var tr=Ze.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");_n=_n.replace(tr,Ze.current)}Ze.current=null,gt(_n)},Ht=function(Nn){var _n=Nn.clipboardData,tr=_n.getData("text");Ze.current=tr},bt=function(Nn){var _n=Nn.target;if(_n!==_t.current){var tr=document.body.style.msTouchAction!==void 0;tr?setTimeout(function(){_t.current.focus()}):_t.current.focus()}},Cn=function(Nn){var _n=pr();Nn.target!==_t.current&&!_n&&un!=="combobox"&&Nn.preventDefault(),(un!=="combobox"&&(!fn||!_n)||!Jt)&&(Jt&&zt!==!1&&ln("",!0,!1),Dn())},kn={inputRef:_t,onInputKeyDown:Ue,onInputMouseDown:Xe,onInputChange:nn,onInputPaste:Ht,onInputCompositionStart:Wt,onInputCompositionEnd:Gt},Jn=un==="multiple"||un==="tags"?Re.createElement(Vt,(0,se.Z)({},Oe,kn)):Re.createElement(nt,(0,se.Z)({},Oe,kn));return Re.createElement("div",{ref:Pn,className:"".concat(Kt,"-selector"),onClick:bt,onMouseDown:Cn},Jn)},en=Re.forwardRef(dn);en.displayName="Selector";var on=en,Xt=ue(35593),Ut=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],Zt=function(Oe){var lt=Oe===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:lt,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:lt,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:lt,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:lt,adjustY:1},htmlRegion:"scroll"}}},ye=function(Oe,lt){var _t=Oe.prefixCls,Yt=Oe.disabled,Kt=Oe.visible,Jt=Oe.children,un=Oe.popupElement,fn=Oe.animation,xn=Oe.transitionName,zt=Oe.dropdownStyle,ln=Oe.dropdownClassName,jn=Oe.direction,Dn=jn===void 0?"ltr":jn,Vn=Oe.placement,Pn=Oe.builtinPlacements,yr=Oe.dropdownMatchSelectWidth,Sn=Oe.dropdownRender,pr=Oe.dropdownAlign,ht=Oe.getPopupContainer,Ue=Oe.empty,Xe=Oe.getTriggerDOMNode,Ze=Oe.onPopupVisibleChange,gt=Oe.onPopupMouseEnter,Wt=(0,Me.Z)(Oe,Ut),Gt="".concat(_t,"-dropdown"),nn=un;Sn&&(nn=Sn(un));var Ht=Re.useMemo(function(){return Pn||Zt(yr)},[Pn,yr]),bt=fn?"".concat(Gt,"-").concat(fn):xn,Cn=typeof yr=="number",kn=Re.useMemo(function(){return Cn?null:yr===!1?"minWidth":"width"},[yr,Cn]),Jn=zt;Cn&&(Jn=(0,ut.Z)((0,ut.Z)({},Jn),{},{width:yr}));var Fn=Re.useRef(null);return Re.useImperativeHandle(lt,function(){return{getPopupElement:function(){return Fn.current}}}),Re.createElement(Xt.Z,(0,se.Z)({},Wt,{showAction:Ze?["click"]:[],hideAction:Ze?["click"]:[],popupPlacement:Vn||(Dn==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:Ht,prefixCls:Gt,popupTransitionName:bt,popup:Re.createElement("div",{ref:Fn,onMouseEnter:gt},nn),stretch:kn,popupAlign:pr,popupVisible:Kt,getPopupContainer:ht,popupClassName:Ae()(ln,(0,ze.Z)({},"".concat(Gt,"-empty"),Ue)),popupStyle:Jn,getTriggerDOMNode:Xe,onPopupVisibleChange:Ze}),Jt)},le=Re.forwardRef(ye);le.displayName="SelectTrigger";var oe=le,he=ue(48745);function pe(Be,Oe){var lt=Be.key,_t;return"value"in Be&&(_t=Be.value),lt!=null?lt:_t!==void 0?_t:"rc-index-key-".concat(Oe)}function ce(Be,Oe){var lt=Be||{},_t=lt.label,Yt=lt.value,Kt=lt.options,Jt=lt.groupLabel,un=_t||(Oe?"children":"label");return{label:un,value:Yt||"value",options:Kt||"options",groupLabel:Jt||un}}function Ie(Be){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},lt=Oe.fieldNames,_t=Oe.childrenAsData,Yt=[],Kt=ce(lt,!1),Jt=Kt.label,un=Kt.value,fn=Kt.options,xn=Kt.groupLabel;function zt(ln,jn){ln.forEach(function(Dn){if(jn||!(fn in Dn)){var Vn=Dn[un];Yt.push({key:pe(Dn,Yt.length),groupOption:jn,data:Dn,label:Dn[Jt],value:Vn})}else{var Pn=Dn[xn];Pn===void 0&&_t&&(Pn=Dn.label),Yt.push({key:pe(Dn,Yt.length),group:!0,data:Dn,label:Pn}),zt(Dn[fn],!0)}})}return zt(Be,!1),Yt}function yt(Be){var Oe=(0,ut.Z)({},Be);return"props"in Oe||Object.defineProperty(Oe,"props",{get:function(){return(0,_e.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),Oe}}),Oe}function Pe(Be,Oe){if(!Oe||!Oe.length)return null;var lt=!1;function _t(Kt,Jt){var un=(0,he.Z)(Jt),fn=un[0],xn=un.slice(1);if(!fn)return[Kt];var zt=Kt.split(fn);return lt=lt||zt.length>1,zt.reduce(function(ln,jn){return[].concat((0,Te.Z)(ln),(0,Te.Z)(_t(jn,xn)))},[]).filter(function(ln){return ln})}var Yt=_t(Be,Oe);return lt?Yt:null}var je=["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"],Rt=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function At(Be){return Be==="tags"||Be==="multiple"}var rt=Re.forwardRef(function(Be,Oe){var lt,_t,Yt=Be.id,Kt=Be.prefixCls,Jt=Be.className,un=Be.showSearch,fn=Be.tagRender,xn=Be.direction,zt=Be.omitDomProps,ln=Be.displayValues,jn=Be.onDisplayValuesChange,Dn=Be.emptyOptions,Vn=Be.notFoundContent,Pn=Vn===void 0?"Not Found":Vn,yr=Be.onClear,Sn=Be.mode,pr=Be.disabled,ht=Be.loading,Ue=Be.getInputElement,Xe=Be.getRawInputElement,Ze=Be.open,gt=Be.defaultOpen,Wt=Be.onDropdownVisibleChange,Gt=Be.activeValue,nn=Be.onActiveValueChange,Ht=Be.activeDescendantId,bt=Be.searchValue,Cn=Be.autoClearSearchValue,kn=Be.onSearch,Jn=Be.onSearchSplit,Fn=Be.tokenSeparators,Nn=Be.allowClear,_n=Be.suffixIcon,tr=Be.clearIcon,Xn=Be.OptionList,In=Be.animation,zn=Be.transitionName,cr=Be.dropdownStyle,qn=Be.dropdownClassName,br=Be.dropdownMatchSelectWidth,Br=Be.dropdownRender,rr=Be.dropdownAlign,yn=Be.placement,hn=Be.builtinPlacements,En=Be.getPopupContainer,Qn=Be.showAction,Rn=Qn===void 0?[]:Qn,Mn=Be.onFocus,er=Be.onBlur,vr=Be.onKeyUp,Dr=Be.onKeyDown,ei=Be.onMouseDown,$n=(0,Me.Z)(Be,je),Kn=At(Sn),Gn=(un!==void 0?un:Kn)||Sn==="combobox",sr=(0,ut.Z)({},$n);Rt.forEach(function(Ci){delete sr[Ci]}),zt==null||zt.forEach(function(Ci){delete sr[Ci]});var Wr=Re.useState(!1),vi=(0,xe.Z)(Wr,2),ci=vi[0],qr=vi[1];Re.useEffect(function(){qr((0,ft.Z)())},[]);var fi=Re.useRef(null),mi=Re.useRef(null),lr=Re.useRef(null),or=Re.useRef(null),ir=Re.useRef(null),mr=$e(),ri=(0,xe.Z)(mr,3),pi=ri[0],yi=ri[1],gi=ri[2];Re.useImperativeHandle(Oe,function(){var Ci,di;return{focus:(Ci=or.current)===null||Ci===void 0?void 0:Ci.focus,blur:(di=or.current)===null||di===void 0?void 0:di.blur,scrollTo:function(ka){var qi;return(qi=ir.current)===null||qi===void 0?void 0:qi.scrollTo(ka)}}});var si=Re.useMemo(function(){var Ci;if(Sn!=="combobox")return bt;var di=(Ci=ln[0])===null||Ci===void 0?void 0:Ci.value;return typeof di=="string"||typeof di=="number"?String(di):""},[bt,Sn,ln]),wi=Sn==="combobox"&&typeof Ue=="function"&&Ue()||null,Hi=typeof Xe=="function"&&Xe(),Di=(0,ot.x1)(mi,Hi==null||(lt=Hi.props)===null||lt===void 0?void 0:lt.ref),aa=Re.useState(!1),Ui=(0,xe.Z)(aa,2),Pi=Ui[0],Pa=Ui[1];(0,Fe.Z)(function(){Pa(!0)},[]);var da=(0,we.Z)(!1,{defaultValue:gt,value:Ze}),oa=(0,xe.Z)(da,2),Xi=oa[0],Si=oa[1],Tr=Pi?Xi:!1,ti=!Pn&&Dn;(pr||ti&&Tr&&Sn==="combobox")&&(Tr=!1);var Hr=ti?!1:Tr,Ir=Re.useCallback(function(Ci){var di=Ci!==void 0?Ci:!Tr;pr||(Si(di),Tr!==di&&(Wt==null||Wt(di)))},[pr,Tr,Si,Wt]),ni=Re.useMemo(function(){return(Fn||[]).some(function(Ci){return[`
`,`\r
`].includes(Ci)})},[Fn]),ii=function(di,Wi,ka){var qi=!0,$a=di;nn==null||nn(null);var Ka=ka?null:Pe(di,Fn);return Sn!=="combobox"&&Ka&&($a="",Jn==null||Jn(Ka),Ir(!1),qi=!1),kn&&si!==$a&&kn($a,{source:Wi?"typing":"effect"}),qi},Bi=function(di){!di||!di.trim()||kn(di,{source:"submit"})};Re.useEffect(function(){!Tr&&!Kn&&Sn!=="combobox"&&ii("",!1,!1)},[Tr]),Re.useEffect(function(){Xi&&pr&&Si(!1),pr&&yi(!1)},[pr]);var Oi=Ee(),Fi=(0,xe.Z)(Oi,2),zi=Fi[0],hi=Fi[1],ui=function(di){var Wi=zi(),ka=di.which;if(ka===Ye.Z.ENTER&&(Sn!=="combobox"&&di.preventDefault(),Tr||Ir(!0)),hi(!!si),ka===Ye.Z.BACKSPACE&&!Wi&&Kn&&!si&&ln.length){for(var qi=(0,Te.Z)(ln),$a=null,Ka=qi.length-1;Ka>=0;Ka-=1){var ro=qi[Ka];if(!ro.disabled){qi.splice(Ka,1),$a=ro;break}}$a&&jn(qi,{type:"remove",values:[$a]})}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&&ir.current){var La;(La=ir.current).onKeyDown.apply(La,[di].concat(so))}Dr==null||Dr.apply(void 0,[di].concat(so))},Zi=function(di){for(var Wi=arguments.length,ka=new Array(Wi>1?Wi-1:0),qi=1;qi<Wi;qi++)ka[qi-1]=arguments[qi];if(Tr&&ir.current){var $a;($a=ir.current).onKeyUp.apply($a,[di].concat(ka))}vr==null||vr.apply(void 0,[di].concat(ka))},ai=function(di){var Wi=ln.filter(function(ka){return ka!==di});jn(Wi,{type:"remove",values:[di]})},Mi=Re.useRef(!1),Ti=function(){yi(!0),pr||(Mn&&!Mi.current&&Mn.apply(void 0,arguments),Rn.includes("focus")&&Ir(!0)),Mi.current=!0},Mo=function(){yi(!1,function(){Mi.current=!1,Ir(!1)}),!pr&&(si&&(Sn==="tags"?kn(si,{source:"submit"}):Sn==="multiple"&&kn("",{source:"blur"})),er&&er.apply(void 0,arguments))},Fa=[];Re.useEffect(function(){return function(){Fa.forEach(function(Ci){return clearTimeout(Ci)}),Fa.splice(0,Fa.length)}},[]);var za=function(di){var Wi,ka=di.target,qi=(Wi=lr.current)===null||Wi===void 0?void 0:Wi.getPopupElement();if(qi&&qi.contains(ka)){var $a=setTimeout(function(){var so=Fa.indexOf($a);if(so!==-1&&Fa.splice(so,1),gi(),!ci&&!qi.contains(document.activeElement)){var lo;(lo=or.current)===null||lo===void 0||lo.focus()}});Fa.push($a)}for(var Ka=arguments.length,ro=new Array(Ka>1?Ka-1:0),Na=1;Na<Ka;Na++)ro[Na-1]=arguments[Na];ei==null||ei.apply(void 0,[di].concat(ro))},no=Re.useState({}),Ss=(0,xe.Z)(no,2),fo=Ss[1];function Ma(){fo({})}var ha;Hi&&(ha=function(di){Ir(di)}),Ve(function(){var Ci;return[fi.current,(Ci=lr.current)===null||Ci===void 0?void 0:Ci.getPopupElement()]},Hr,Ir,!!Hi);var bo=Re.useMemo(function(){return(0,ut.Z)((0,ut.Z)({},Be),{},{notFoundContent:Pn,open:Tr,triggerOpen:Hr,id:Yt,showSearch:Gn,multiple:Kn,toggleOpen:Ir})},[Be,Pn,Hr,Tr,Yt,Gn,Kn,Ir]),ko=!!_n||ht,Lo;ko&&(Lo=Re.createElement(Ct,{className:Ae()("".concat(Kt,"-arrow"),(0,ze.Z)({},"".concat(Kt,"-arrow-loading"),ht)),customizeIcon:_n,customizeIconProps:{loading:ht,searchValue:si,open:Tr,focused:pi,showSearch:Gn}}));var ns=function(){var di;yr==null||yr(),(di=or.current)===null||di===void 0||di.focus(),jn([],{type:"clear",values:ln}),ii("",!1,!1)},No=jt(Kt,ns,ln,Nn,tr,pr,si,Sn),Ya=No.allowClear,Oa=No.clearIcon,$i=Re.createElement(Xn,{ref:ir}),Ao=Ae()(Kt,Jt,(_t={},(0,ze.Z)(_t,"".concat(Kt,"-focused"),pi),(0,ze.Z)(_t,"".concat(Kt,"-multiple"),Kn),(0,ze.Z)(_t,"".concat(Kt,"-single"),!Kn),(0,ze.Z)(_t,"".concat(Kt,"-allow-clear"),Nn),(0,ze.Z)(_t,"".concat(Kt,"-show-arrow"),ko),(0,ze.Z)(_t,"".concat(Kt,"-disabled"),pr),(0,ze.Z)(_t,"".concat(Kt,"-loading"),ht),(0,ze.Z)(_t,"".concat(Kt,"-open"),Tr),(0,ze.Z)(_t,"".concat(Kt,"-customize-input"),wi),(0,ze.Z)(_t,"".concat(Kt,"-show-search"),Gn),_t)),rs=Re.createElement(oe,{ref:lr,disabled:pr,prefixCls:Kt,visible:Hr,popupElement:$i,animation:In,transitionName:zn,dropdownStyle:cr,dropdownClassName:qn,direction:xn,dropdownMatchSelectWidth:br,dropdownRender:Br,dropdownAlign:rr,placement:yn,builtinPlacements:hn,getPopupContainer:En,empty:Dn,getTriggerDOMNode:function(){return mi.current},onPopupVisibleChange:ha,onPopupMouseEnter:Ma},Hi?Re.cloneElement(Hi,{ref:Di}):Re.createElement(on,(0,se.Z)({},Be,{domRef:mi,prefixCls:Kt,inputElement:wi,ref:or,id:Yt,showSearch:Gn,autoClearSearchValue:Cn,mode:Sn,activeDescendantId:Ht,tagRender:fn,values:ln,open:Tr,onToggleOpen:Ir,activeValue:Gt,searchValue:si,onSearch:ii,onSearchSubmit:Bi,onRemove:ai,tokenWithEnter:ni}))),Do;return Hi?Do=rs:Do=Re.createElement("div",(0,se.Z)({className:Ao},sr,{ref:fi,onMouseDown:za,onKeyDown:ui,onKeyUp:Zi,onFocus:Ti,onBlur:Mo}),pi&&!Tr&&Re.createElement("span",{style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0},"aria-live":"polite"},"".concat(ln.map(function(Ci){var di=Ci.label,Wi=Ci.value;return["number","string"].includes((0,De.Z)(di))?di:Wi}).join(", "))),rs,Lo,Ya&&Oa),Re.createElement(it.Provider,{value:bo},Do)}),Ft=rt,sn=function(Be,Oe){var lt=Re.useRef({values:new Map,options:new Map}),_t=Re.useMemo(function(){var Kt=lt.current,Jt=Kt.values,un=Kt.options,fn=Be.map(function(ln){if(ln.label===void 0){var jn;return(0,ut.Z)((0,ut.Z)({},ln),{},{label:(jn=Jt.get(ln.value))===null||jn===void 0?void 0:jn.label})}return ln}),xn=new Map,zt=new Map;return fn.forEach(function(ln){xn.set(ln.value,ln),zt.set(ln.value,Oe.get(ln.value)||un.get(ln.value))}),lt.current.values=xn,lt.current.options=zt,fn},[Be,Oe]),Yt=Re.useCallback(function(Kt){return Oe.get(Kt)||lt.current.options.get(Kt)},[Oe]);return[_t,Yt]};function ct(Be,Oe){return kt(Be).join("").toUpperCase().includes(Oe)}var qt=function(Be,Oe,lt,_t,Yt){return Re.useMemo(function(){if(!lt||_t===!1)return Be;var Kt=Oe.options,Jt=Oe.label,un=Oe.value,fn=[],xn=typeof _t=="function",zt=lt.toUpperCase(),ln=xn?_t:function(Dn,Vn){return Yt?ct(Vn[Yt],zt):Vn[Kt]?ct(Vn[Jt!=="children"?Jt:"label"],zt):ct(Vn[un],zt)},jn=xn?function(Dn){return yt(Dn)}:function(Dn){return Dn};return Be.forEach(function(Dn){if(Dn[Kt]){var Vn=ln(lt,jn(Dn));if(Vn)fn.push(Dn);else{var Pn=Dn[Kt].filter(function(yr){return ln(lt,jn(yr))});Pn.length&&fn.push((0,ut.Z)((0,ut.Z)({},Dn),{},(0,ze.Z)({},Kt,Pn)))}return}ln(lt,jn(Dn))&&fn.push(Dn)}),fn},[Be,_t,Yt,lt,Oe])},an=ue(17115),Qe=ue(11592),mt=["children","value"],Nt=["children"];function vn(Be){var Oe=Be,lt=Oe.key,_t=Oe.props,Yt=_t.children,Kt=_t.value,Jt=(0,Me.Z)(_t,mt);return(0,ut.Z)({key:lt,value:Kt!==void 0?Kt:lt,children:Yt},Jt)}function mn(Be){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,Qe.Z)(Be).map(function(lt,_t){if(!Re.isValidElement(lt)||!lt.type)return null;var Yt=lt,Kt=Yt.type.isSelectOptGroup,Jt=Yt.key,un=Yt.props,fn=un.children,xn=(0,Me.Z)(un,Nt);return Oe||!Kt?vn(lt):(0,ut.Z)((0,ut.Z)({key:"__RC_SELECT_GRP__".concat(Jt===null?_t:Jt,"__"),label:Jt},xn),{},{options:mn(fn)})}).filter(function(lt){return lt})}function wn(Be,Oe,lt,_t,Yt){return Re.useMemo(function(){var Kt=Be,Jt=!Be;Jt&&(Kt=mn(Oe));var un=new Map,fn=new Map,xn=function(jn,Dn,Vn){Vn&&typeof Vn=="string"&&jn.set(Dn[Vn],Dn)};function zt(ln){for(var jn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Dn=0;Dn<ln.length;Dn+=1){var Vn=ln[Dn];!Vn[lt.options]||jn?(un.set(Vn[lt.value],Vn),xn(fn,Vn,lt.label),xn(fn,Vn,_t),xn(fn,Vn,Yt)):zt(Vn[lt.options],!0)}}return zt(Kt),{options:Kt,valueOptions:un,labelOptions:fn}},[Be,Oe,lt,_t,Yt])}function Tn(Be){var Oe=Re.useRef();Oe.current=Be;var lt=Re.useCallback(function(){return Oe.current.apply(Oe,arguments)},[]);return lt}var Zn=function(){return null};Zn.isSelectOptGroup=!0;var Hn=Zn,wr=function(){return null};wr.isSelectOption=!0;var Cr=wr,Yn=ue(80547),Nr=ue(2738),Kr=ue(48911),Or=Re.createContext(null),Ar=Or;function kr(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var Gr=["disabled","title","children","style","className"];function ar(Be){return typeof Be=="string"||typeof Be=="number"}var $r=function(Oe,lt){var _t=vt(),Yt=_t.prefixCls,Kt=_t.id,Jt=_t.open,un=_t.multiple,fn=_t.mode,xn=_t.searchValue,zt=_t.toggleOpen,ln=_t.notFoundContent,jn=_t.onPopupScroll,Dn=Re.useContext(Ar),Vn=Dn.flattenOptions,Pn=Dn.onActiveValue,yr=Dn.defaultActiveFirstOption,Sn=Dn.onSelect,pr=Dn.menuItemSelectedIcon,ht=Dn.rawValues,Ue=Dn.fieldNames,Xe=Dn.virtual,Ze=Dn.direction,gt=Dn.listHeight,Wt=Dn.listItemHeight,Gt="".concat(Yt,"-item"),nn=(0,Yn.Z)(function(){return Vn},[Jt,Vn],function(rr,yn){return yn[0]&&rr[1]!==yn[1]}),Ht=Re.useRef(null),bt=function(yn){yn.preventDefault()},Cn=function(yn){Ht.current&&Ht.current.scrollTo(typeof yn=="number"?{index:yn}:yn)},kn=function(yn){for(var hn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,En=nn.length,Qn=0;Qn<En;Qn+=1){var Rn=(yn+Qn*hn+En)%En,Mn=nn[Rn],er=Mn.group,vr=Mn.data;if(!er&&!vr.disabled)return Rn}return-1},Jn=Re.useState(function(){return kn(0)}),Fn=(0,xe.Z)(Jn,2),Nn=Fn[0],_n=Fn[1],tr=function(yn){var hn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;_n(yn);var En={source:hn?"keyboard":"mouse"},Qn=nn[yn];if(!Qn){Pn(null,-1,En);return}Pn(Qn.value,yn,En)};(0,Re.useEffect)(function(){tr(yr!==!1?kn(0):-1)},[nn.length,xn]);var Xn=Re.useCallback(function(rr){return ht.has(rr)&&fn!=="combobox"},[fn,(0,Te.Z)(ht).toString(),ht.size]);(0,Re.useEffect)(function(){var rr=setTimeout(function(){if(!un&&Jt&&ht.size===1){var hn=Array.from(ht)[0],En=nn.findIndex(function(Qn){var Rn=Qn.data;return Rn.value===hn});En!==-1&&(tr(En),Cn(En))}});if(Jt){var yn;(yn=Ht.current)===null||yn===void 0||yn.scrollTo(void 0)}return function(){return clearTimeout(rr)}},[Jt,xn,Vn.length]);var In=function(yn){yn!==void 0&&Sn(yn,{selected:!ht.has(yn)}),un||zt(!1)};if(Re.useImperativeHandle(lt,function(){return{onKeyDown:function(yn){var hn=yn.which,En=yn.ctrlKey;switch(hn){case Ye.Z.N:case Ye.Z.P:case Ye.Z.UP:case Ye.Z.DOWN:{var Qn=0;if(hn===Ye.Z.UP?Qn=-1:hn===Ye.Z.DOWN?Qn=1:kr()&&En&&(hn===Ye.Z.N?Qn=1:hn===Ye.Z.P&&(Qn=-1)),Qn!==0){var Rn=kn(Nn+Qn,Qn);Cn(Rn),tr(Rn,!0)}break}case Ye.Z.ENTER:{var Mn=nn[Nn];Mn&&!Mn.data.disabled?In(Mn.value):In(void 0),Jt&&yn.preventDefault();break}case Ye.Z.ESC:zt(!1),Jt&&yn.stopPropagation()}},onKeyUp:function(){},scrollTo:function(yn){Cn(yn)}}}),nn.length===0)return Re.createElement("div",{role:"listbox",id:"".concat(Kt,"_list"),className:"".concat(Gt,"-empty"),onMouseDown:bt},ln);var zn=Object.keys(Ue).map(function(rr){return Ue[rr]}),cr=function(yn){return yn.label};function qn(rr,yn){var hn=rr.group;return{role:hn?"presentation":"option",id:"".concat(Kt,"_list_").concat(yn)}}var br=function(yn){var hn=nn[yn];if(!hn)return null;var En=hn.data||{},Qn=En.value,Rn=hn.group,Mn=(0,Je.Z)(En,!0),er=cr(hn);return hn?Re.createElement("div",(0,se.Z)({"aria-label":typeof er=="string"&&!Rn?er:null},Mn,{key:yn},qn(hn,yn),{"aria-selected":Xn(Qn)}),Qn):null},Br={role:"listbox",id:"".concat(Kt,"_list")};return Re.createElement(Re.Fragment,null,Xe&&Re.createElement("div",(0,se.Z)({},Br,{style:{height:0,width:0,overflow:"hidden"}}),br(Nn-1),br(Nn),br(Nn+1)),Re.createElement(Kr.Z,{itemKey:"key",ref:Ht,data:nn,height:gt,itemHeight:Wt,fullHeight:!1,onMouseDown:bt,onScroll:jn,virtual:Xe,direction:Ze,innerProps:Xe?null:Br},function(rr,yn){var hn,En=rr.group,Qn=rr.groupOption,Rn=rr.data,Mn=rr.label,er=rr.value,vr=Rn.key;if(En){var Dr,ei=(Dr=Rn.title)!==null&&Dr!==void 0?Dr:ar(Mn)?Mn.toString():void 0;return Re.createElement("div",{className:Ae()(Gt,"".concat(Gt,"-group")),title:ei},Mn!==void 0?Mn:vr)}var $n=Rn.disabled,Kn=Rn.title,Gn=Rn.children,sr=Rn.style,Wr=Rn.className,vi=(0,Me.Z)(Rn,Gr),ci=(0,Nr.Z)(vi,zn),qr=Xn(er),fi="".concat(Gt,"-option"),mi=Ae()(Gt,fi,Wr,(hn={},(0,ze.Z)(hn,"".concat(fi,"-grouped"),Qn),(0,ze.Z)(hn,"".concat(fi,"-active"),Nn===yn&&!$n),(0,ze.Z)(hn,"".concat(fi,"-disabled"),$n),(0,ze.Z)(hn,"".concat(fi,"-selected"),qr),hn)),lr=cr(rr),or=!pr||typeof pr=="function"||qr,ir=typeof lr=="number"?lr:lr||er,mr=ar(ir)?ir.toString():void 0;return Kn!==void 0&&(mr=Kn),Re.createElement("div",(0,se.Z)({},(0,Je.Z)(ci),Xe?{}:qn(rr,yn),{"aria-selected":qr,className:mi,title:mr,onMouseMove:function(){Nn===yn||$n||tr(yn)},onClick:function(){$n||In(er)},style:sr}),Re.createElement("div",{className:"".concat(fi,"-content")},ir),Re.isValidElement(pr)||qr,or&&Re.createElement(Ct,{className:"".concat(Gt,"-option-state"),customizeIcon:pr,customizeIconProps:{isSelected:qr}},qr?"\u2713":null))}))},Ur=Re.forwardRef($r);Ur.displayName="OptionList";var Vr=Ur;function Yr(Be){var Oe=Be.mode,lt=Be.options,_t=Be.children,Yt=Be.backfill,Kt=Be.allowClear,Jt=Be.placeholder,un=Be.getInputElement,fn=Be.showSearch,xn=Be.onSearch,zt=Be.defaultOpen,ln=Be.autoFocus,jn=Be.labelInValue,Dn=Be.value,Vn=Be.inputValue,Pn=Be.optionLabelProp,yr=isMultiple(Oe),Sn=fn!==void 0?fn:yr||Oe==="combobox",pr=lt||convertChildrenToData(_t);if(warning(Oe!=="tags"||pr.every(function(Ze){return!Ze.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Oe==="tags"||Oe==="combobox"){var ht=pr.some(function(Ze){return Ze.options?Ze.options.some(function(gt){return typeof("value"in gt?gt.value:gt.key)=="number"}):typeof("value"in Ze?Ze.value:Ze.key)=="number"});warning(!ht,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(Oe!=="combobox"||!Pn,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(Oe==="combobox"||!Yt,"`backfill` only works with `combobox` mode."),warning(Oe==="combobox"||!un,"`getInputElement` only work with `combobox` mode."),noteOnce(Oe!=="combobox"||!un||!Kt||!Jt,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),xn&&!Sn&&Oe!=="combobox"&&Oe!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!zt||ln,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Dn!=null){var Ue=toArray(Dn);warning(!jn||Ue.every(function(Ze){return _typeof(Ze)==="object"&&("key"in Ze||"value"in Ze)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!yr||Array.isArray(Dn),"`value` should be array when `mode` is `multiple` or `tags`")}if(_t){var Xe=null;toNodeArray(_t).some(function(Ze){if(!React.isValidElement(Ze)||!Ze.type)return!1;var gt=Ze,Wt=gt.type;if(Wt.isSelectOption)return!1;if(Wt.isSelectOptGroup){var Gt=toNodeArray(Ze.props.children).every(function(nn){return!React.isValidElement(nn)||!Ze.type||nn.type.isSelectOption?!0:(Xe=nn.type,!1)});return!Gt}return Xe=Wt,!0}),Xe&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Xe.displayName||Xe.name||Xe,"`.")),warning(Vn===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function Zr(Be,Oe){if(Be){var lt=function _t(Yt){for(var Kt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Jt=0;Jt<Yt.length;Jt++){var un=Yt[Jt];if(un[Oe==null?void 0:Oe.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!Kt&&Array.isArray(un[Oe==null?void 0:Oe.options])&&_t(un[Oe==null?void 0:Oe.options],!0))break}};lt(Be)}}var dr=null,_r=["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"],Ln=["inputValue"];function Wn(Be){return!Be||(0,De.Z)(Be)!=="object"}var Er=Re.forwardRef(function(Be,Oe){var lt=Be.id,_t=Be.mode,Yt=Be.prefixCls,Kt=Yt===void 0?"rc-select":Yt,Jt=Be.backfill,un=Be.fieldNames,fn=Be.inputValue,xn=Be.searchValue,zt=Be.onSearch,ln=Be.autoClearSearchValue,jn=ln===void 0?!0:ln,Dn=Be.onSelect,Vn=Be.onDeselect,Pn=Be.dropdownMatchSelectWidth,yr=Pn===void 0?!0:Pn,Sn=Be.filterOption,pr=Be.filterSort,ht=Be.optionFilterProp,Ue=Be.optionLabelProp,Xe=Be.options,Ze=Be.children,gt=Be.defaultActiveFirstOption,Wt=Be.menuItemSelectedIcon,Gt=Be.virtual,nn=Be.direction,Ht=Be.listHeight,bt=Ht===void 0?200:Ht,Cn=Be.listItemHeight,kn=Cn===void 0?20:Cn,Jn=Be.value,Fn=Be.defaultValue,Nn=Be.labelInValue,_n=Be.onChange,tr=(0,Me.Z)(Be,_r),Xn=(0,an.ZP)(lt),In=At(_t),zn=!!(!Xe&&Ze),cr=Re.useMemo(function(){return Sn===void 0&&_t==="combobox"?!1:Sn},[Sn,_t]),qn=Re.useMemo(function(){return ce(un,zn)},[JSON.stringify(un),zn]),br=(0,we.Z)("",{value:xn!==void 0?xn:fn,postState:function(ti){return ti||""}}),Br=(0,xe.Z)(br,2),rr=Br[0],yn=Br[1],hn=wn(Xe,Ze,qn,ht,Ue),En=hn.valueOptions,Qn=hn.labelOptions,Rn=hn.options,Mn=Re.useCallback(function(Tr){var ti=kt(Tr);return ti.map(function(Hr){var Ir,ni,ii,Bi,Oi;if(Wn(Hr))Ir=Hr;else{var Fi;ii=Hr.key,ni=Hr.label,Ir=(Fi=Hr.value)!==null&&Fi!==void 0?Fi:ii}var zi=En.get(Ir);if(zi){var hi;if(ni===void 0&&(ni=zi==null?void 0:zi[Ue||qn.label]),ii===void 0&&(ii=(hi=zi==null?void 0:zi.key)!==null&&hi!==void 0?hi:Ir),Bi=zi==null?void 0:zi.disabled,Oi=zi==null?void 0:zi.title,0)var ui}return{label:ni,value:Ir,key:ii,disabled:Bi,title:Oi}})},[qn,Ue,En]),er=(0,we.Z)(Fn,{value:Jn}),vr=(0,xe.Z)(er,2),Dr=vr[0],ei=vr[1],$n=Re.useMemo(function(){var Tr,ti=Mn(Dr);return _t==="combobox"&&Bt((Tr=ti[0])===null||Tr===void 0?void 0:Tr.value)?[]:ti},[Dr,Mn,_t]),Kn=sn($n,En),Gn=(0,xe.Z)(Kn,2),sr=Gn[0],Wr=Gn[1],vi=Re.useMemo(function(){if(!_t&&sr.length===1){var Tr=sr[0];if(Tr.value===null&&(Tr.label===null||Tr.label===void 0))return[]}return sr.map(function(ti){var Hr;return(0,ut.Z)((0,ut.Z)({},ti),{},{label:(Hr=ti.label)!==null&&Hr!==void 0?Hr:ti.value})})},[_t,sr]),ci=Re.useMemo(function(){return new Set(sr.map(function(Tr){return Tr.value}))},[sr]);Re.useEffect(function(){if(_t==="combobox"){var Tr,ti=(Tr=sr[0])===null||Tr===void 0?void 0:Tr.value;yn(pt(ti)?String(ti):"")}},[sr]);var qr=Tn(function(Tr,ti){var Hr,Ir=ti!=null?ti:Tr;return Hr={},(0,ze.Z)(Hr,qn.value,Tr),(0,ze.Z)(Hr,qn.label,Ir),Hr}),fi=Re.useMemo(function(){if(_t!=="tags")return Rn;var Tr=(0,Te.Z)(Rn),ti=function(Ir){return En.has(Ir)};return(0,Te.Z)(sr).sort(function(Hr,Ir){return Hr.value<Ir.value?-1:1}).forEach(function(Hr){var Ir=Hr.value;ti(Ir)||Tr.push(qr(Ir,Hr.label))}),Tr},[qr,Rn,En,sr,_t]),mi=qt(fi,qn,rr,cr,ht),lr=Re.useMemo(function(){return _t!=="tags"||!rr||mi.some(function(Tr){return Tr[ht||"value"]===rr})||mi.some(function(Tr){return Tr[qn.value]===rr})?mi:[qr(rr)].concat((0,Te.Z)(mi))},[qr,ht,_t,mi,rr,qn]),or=Re.useMemo(function(){return pr?(0,Te.Z)(lr).sort(function(Tr,ti){return pr(Tr,ti)}):lr},[lr,pr]),ir=Re.useMemo(function(){return Ie(or,{fieldNames:qn,childrenAsData:zn})},[or,qn,zn]),mr=function(ti){var Hr=Mn(ti);if(ei(Hr),_n&&(Hr.length!==sr.length||Hr.some(function(ii,Bi){var Oi;return((Oi=sr[Bi])===null||Oi===void 0?void 0:Oi.value)!==(ii==null?void 0:ii.value)}))){var Ir=Nn?Hr:Hr.map(function(ii){return ii.value}),ni=Hr.map(function(ii){return yt(Wr(ii.value))});_n(In?Ir:Ir[0],In?ni:ni[0])}},ri=Re.useState(null),pi=(0,xe.Z)(ri,2),yi=pi[0],gi=pi[1],si=Re.useState(0),wi=(0,xe.Z)(si,2),Hi=wi[0],Di=wi[1],aa=gt!==void 0?gt:_t!=="combobox",Ui=Re.useCallback(function(Tr,ti){var Hr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Ir=Hr.source,ni=Ir===void 0?"keyboard":Ir;Di(ti),Jt&&_t==="combobox"&&Tr!==null&&ni==="keyboard"&&gi(String(Tr))},[Jt,_t]),Pi=function(ti,Hr,Ir){var ni=function(){var Mi,Ti=Wr(ti);return[Nn?{label:Ti==null?void 0:Ti[qn.label],value:ti,key:(Mi=Ti==null?void 0:Ti.key)!==null&&Mi!==void 0?Mi:ti}:ti,yt(Ti)]};if(Hr&&Dn){var ii=ni(),Bi=(0,xe.Z)(ii,2),Oi=Bi[0],Fi=Bi[1];Dn(Oi,Fi)}else if(!Hr&&Vn&&Ir!=="clear"){var zi=ni(),hi=(0,xe.Z)(zi,2),ui=hi[0],Zi=hi[1];Vn(ui,Zi)}},Pa=Tn(function(Tr,ti){var Hr,Ir=In?ti.selected:!0;Ir?Hr=In?[].concat((0,Te.Z)(sr),[Tr]):[Tr]:Hr=sr.filter(function(ni){return ni.value!==Tr}),mr(Hr),Pi(Tr,Ir),_t==="combobox"?gi(""):(!At||jn)&&(yn(""),gi(""))}),da=function(ti,Hr){mr(ti);var Ir=Hr.type,ni=Hr.values;(Ir==="remove"||Ir==="clear")&&ni.forEach(function(ii){Pi(ii.value,!1,Ir)})},oa=function(ti,Hr){if(yn(ti),gi(null),Hr.source==="submit"){var Ir=(ti||"").trim();if(Ir){var ni=Array.from(new Set([].concat((0,Te.Z)(ci),[Ir])));mr(ni),Pi(Ir,!0),yn("")}return}Hr.source!=="blur"&&(_t==="combobox"&&mr(ti),zt==null||zt(ti))},Xi=function(ti){var Hr=ti;_t!=="tags"&&(Hr=ti.map(function(ni){var ii=Qn.get(ni);return ii==null?void 0:ii.value}).filter(function(ni){return ni!==void 0}));var Ir=Array.from(new Set([].concat((0,Te.Z)(ci),(0,Te.Z)(Hr))));mr(Ir),Ir.forEach(function(ni){Pi(ni,!0)})},Si=Re.useMemo(function(){var Tr=Gt!==!1&&yr!==!1;return(0,ut.Z)((0,ut.Z)({},hn),{},{flattenOptions:ir,onActiveValue:Ui,defaultActiveFirstOption:aa,onSelect:Pa,menuItemSelectedIcon:Wt,rawValues:ci,fieldNames:qn,virtual:Tr,direction:nn,listHeight:bt,listItemHeight:kn,childrenAsData:zn})},[hn,ir,Ui,aa,Pa,Wt,ci,qn,Gt,yr,bt,kn,zn]);return Re.createElement(Ar.Provider,{value:Si},Re.createElement(Ft,(0,se.Z)({},tr,{id:Xn,prefixCls:Kt,ref:Oe,omitDomProps:Ln,mode:_t,displayValues:vi,onDisplayValuesChange:da,direction:nn,searchValue:rr,onSearch:oa,autoClearSearchValue:jn,onSearchSplit:Xi,dropdownMatchSelectWidth:yr,OptionList:Vr,emptyOptions:!ir.length,activeValue:yi,activeDescendantId:"".concat(Xn,"_list_").concat(Hi)})))}),St=Er;St.Option=Cr,St.OptGroup=Hn;var Le=St,We=Le},9296:function(bn,tn,ue){"use strict";ue.r(tn),ue.d(tn,{ResizableTextArea:function(){return Dt},default:function(){return Bt}});var se=ue(60499),Te=ue(85899),ze=ue(18642),ut=ue(43749),xe=ue(72190),Me=ue(42244),De=ue(77654),we=ue(92310),_e=ue.n(we),Re=ue(93681),dt=ue(5643),Ae=ue(18929),Fe=ue(59301),ft=ue(29301),Ye=ue(34280),ot=ue(16089),at=`
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;
`,Ct=["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"],jt={},it;function vt(Tt){var wt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ne=Tt.getAttribute("id")||Tt.getAttribute("data-reactid")||Tt.getAttribute("name");if(wt&&jt[Ne])return jt[Ne];var be=window.getComputedStyle(Tt),xt=be.getPropertyValue("box-sizing")||be.getPropertyValue("-moz-box-sizing")||be.getPropertyValue("-webkit-box-sizing"),Qt=parseFloat(be.getPropertyValue("padding-bottom"))+parseFloat(be.getPropertyValue("padding-top")),Vt=parseFloat(be.getPropertyValue("border-bottom-width"))+parseFloat(be.getPropertyValue("border-top-width")),qe=Ct.map(function(Ot){return"".concat(Ot,":").concat(be.getPropertyValue(Ot))}).join(";"),nt={sizingStyle:qe,paddingSize:Qt,borderSize:Vt,boxSizing:xt};return wt&&Ne&&(jt[Ne]=nt),nt}function $e(Tt){var wt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,be=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;it||(it=document.createElement("textarea"),it.setAttribute("tab-index","-1"),it.setAttribute("aria-hidden","true"),document.body.appendChild(it)),Tt.getAttribute("wrap")?it.setAttribute("wrap",Tt.getAttribute("wrap")):it.removeAttribute("wrap");var xt=vt(Tt,wt),Qt=xt.paddingSize,Vt=xt.borderSize,qe=xt.boxSizing,nt=xt.sizingStyle;it.setAttribute("style","".concat(nt,";").concat(at)),it.value=Tt.value||Tt.placeholder||"";var Ot=void 0,dn=void 0,en,on=it.scrollHeight;if(qe==="border-box"?on+=Vt:qe==="content-box"&&(on-=Qt),Ne!==null||be!==null){it.value=" ";var Xt=it.scrollHeight-Qt;Ne!==null&&(Ot=Xt*Ne,qe==="border-box"&&(Ot=Ot+Qt+Vt),on=Math.max(Ot,on)),be!==null&&(dn=Xt*be,qe==="border-box"&&(dn=dn+Qt+Vt),en=on>dn?"":"hidden",on=Math.min(dn,on))}var Ut={height:on,overflowY:en,resize:"none"};return Ot&&(Ut.minHeight=Ot),dn&&(Ut.maxHeight=dn),Ut}var Ee=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],Ve=0,Je=1,Lt=2,et=Fe.forwardRef(function(Tt,wt){var Ne=Tt,be=Ne.prefixCls,xt=Ne.onPressEnter,Qt=Ne.defaultValue,Vt=Ne.value,qe=Ne.autoSize,nt=Ne.onResize,Ot=Ne.className,dn=Ne.style,en=Ne.disabled,on=Ne.onChange,Xt=Ne.onInternalAutoSize,Ut=(0,Me.Z)(Ne,Ee),Zt=(0,Ae.Z)(Qt,{value:Vt,postState:function(Hn){return Hn!=null?Hn:""}}),ye=(0,xe.Z)(Zt,2),le=ye[0],oe=ye[1],he=function(Hn){oe(Hn.target.value),on==null||on(Hn)},pe=Fe.useRef();Fe.useImperativeHandle(wt,function(){return{textArea:pe.current}});var ce=Fe.useMemo(function(){return qe&&(0,ut.Z)(qe)==="object"?[qe.minRows,qe.maxRows]:[]},[qe]),Ie=(0,xe.Z)(ce,2),yt=Ie[0],Pe=Ie[1],je=!!qe,Rt=function(){try{if(document.activeElement===pe.current){var Hn=pe.current,wr=Hn.selectionStart,Cr=Hn.selectionEnd,Yn=Hn.scrollTop;pe.current.setSelectionRange(wr,Cr),pe.current.scrollTop=Yn}}catch(Nr){}},At=Fe.useState(Lt),rt=(0,xe.Z)(At,2),Ft=rt[0],sn=rt[1],ct=Fe.useState(),qt=(0,xe.Z)(ct,2),an=qt[0],Qe=qt[1],mt=function(){sn(Ve)};(0,Ye.Z)(function(){je&&mt()},[Vt,yt,Pe,je]),(0,Ye.Z)(function(){if(Ft===Ve)sn(Je);else if(Ft===Je){var Zn=$e(pe.current,!1,yt,Pe);sn(Lt),Qe(Zn)}else Rt()},[Ft]);var Nt=Fe.useRef(),vn=function(){ot.Z.cancel(Nt.current)},mn=function(Hn){Ft===Lt&&(nt==null||nt(Hn),qe&&(vn(),Nt.current=(0,ot.Z)(function(){mt()})))};Fe.useEffect(function(){return vn},[]);var wn=je?an:null,Tn=(0,Te.Z)((0,Te.Z)({},dn),wn);return(Ft===Ve||Ft===Je)&&(Tn.overflowY="hidden",Tn.overflowX="hidden"),Fe.createElement(ft.Z,{onResize:mn,disabled:!(qe||nt)},Fe.createElement("textarea",(0,se.Z)({},Ut,{ref:pe,style:Tn,className:_e()(be,Ot,(0,ze.Z)({},"".concat(be,"-disabled"),en)),disabled:en,value:le,onChange:he})))}),Dt=et,Ge=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","classes","showCount","className","style","disabled","hidden","classNames","styles","onResize"];function kt(Tt,wt){return(0,De.Z)(Tt||"").slice(0,wt).join("")}function tt(Tt,wt,Ne,be){var xt=Ne;return Tt?xt=kt(Ne,be):(0,De.Z)(wt||"").length<Ne.length&&(0,De.Z)(Ne||"").length>be&&(xt=wt),xt}var $t=Fe.forwardRef(function(Tt,wt){var Ne,be=Tt.defaultValue,xt=Tt.value,Qt=Tt.onFocus,Vt=Tt.onBlur,qe=Tt.onChange,nt=Tt.allowClear,Ot=Tt.maxLength,dn=Tt.onCompositionStart,en=Tt.onCompositionEnd,on=Tt.suffix,Xt=Tt.prefixCls,Ut=Xt===void 0?"rc-textarea":Xt,Zt=Tt.classes,ye=Tt.showCount,le=Tt.className,oe=Tt.style,he=Tt.disabled,pe=Tt.hidden,ce=Tt.classNames,Ie=Tt.styles,yt=Tt.onResize,Pe=(0,Me.Z)(Tt,Ge),je=(0,Ae.Z)(be,{value:xt,defaultValue:be}),Rt=(0,xe.Z)(je,2),At=Rt[0],rt=Rt[1],Ft=(0,Fe.useRef)(null),sn=Fe.useState(!1),ct=(0,xe.Z)(sn,2),qt=ct[0],an=ct[1],Qe=Fe.useState(!1),mt=(0,xe.Z)(Qe,2),Nt=mt[0],vn=mt[1],mn=Fe.useRef(),wn=Fe.useRef(0),Tn=Fe.useState(null),Zn=(0,xe.Z)(Tn,2),Hn=Zn[0],wr=Zn[1],Cr=function(){var Wn;(Wn=Ft.current)===null||Wn===void 0||Wn.textArea.focus()};(0,Fe.useImperativeHandle)(wt,function(){return{resizableTextArea:Ft.current,focus:Cr,blur:function(){var Wn;(Wn=Ft.current)===null||Wn===void 0||Wn.textArea.blur()}}}),(0,Fe.useEffect)(function(){an(function(Ln){return!he&&Ln})},[he]);var Yn=Number(Ot)>0,Nr=function(Wn){vn(!0),mn.current=At,wn.current=Wn.currentTarget.selectionStart,dn==null||dn(Wn)},Kr=function(Wn){vn(!1);var Er=Wn.currentTarget.value;if(Yn){var St,Le=wn.current>=Ot+1||wn.current===((St=mn.current)===null||St===void 0?void 0:St.length);Er=tt(Le,mn.current,Er,Ot)}Er!==At&&(rt(Er),(0,dt.rJ)(Wn.currentTarget,Wn,qe,Er)),en==null||en(Wn)},Or=function(Wn){var Er=Wn.target.value;if(!Nt&&Yn){var St=Wn.target.selectionStart>=Ot+1||Wn.target.selectionStart===Er.length||!Wn.target.selectionStart;Er=tt(St,At,Er,Ot)}rt(Er),(0,dt.rJ)(Wn.currentTarget,Wn,qe,Er)},Ar=function(Wn){var Er=Pe.onPressEnter,St=Pe.onKeyDown;Wn.key==="Enter"&&Er&&Er(Wn),St==null||St(Wn)},kr=function(Wn){an(!0),Qt==null||Qt(Wn)},Gr=function(Wn){an(!1),Vt==null||Vt(Wn)},ar=function(Wn){var Er;rt(""),Cr(),(0,dt.rJ)((Er=Ft.current)===null||Er===void 0?void 0:Er.textArea,Wn,qe)},$r=(0,dt.D7)(At);!Nt&&Yn&&xt==null&&($r=kt($r,Ot));var Ur=on,Vr;if(ye){var Yr=(0,De.Z)($r).length;(0,ut.Z)(ye)==="object"?Vr=ye.formatter({value:$r,count:Yr,maxLength:Ot}):Vr="".concat(Yr).concat(Yn?" / ".concat(Ot):""),Ur=Fe.createElement(Fe.Fragment,null,Ur,Fe.createElement("span",{className:_e()("".concat(Ut,"-data-count"),ce==null?void 0:ce.count),style:Ie==null?void 0:Ie.count},Vr))}var Zr=function(Wn){var Er;yt==null||yt(Wn),(Er=Ft.current)!==null&&Er!==void 0&&Er.textArea.style.height&&wr(!0)},dr=!Pe.autoSize&&!ye&&!nt,_r=Fe.createElement(Re.BaseInput,{value:$r,allowClear:nt,handleReset:ar,suffix:Ur,prefixCls:Ut,classes:{affixWrapper:_e()(Zt==null?void 0:Zt.affixWrapper,(Ne={},(0,ze.Z)(Ne,"".concat(Ut,"-show-count"),ye),(0,ze.Z)(Ne,"".concat(Ut,"-textarea-allow-clear"),nt),Ne))},disabled:he,focused:qt,className:le,style:(0,Te.Z)((0,Te.Z)({},oe),Hn&&!dr?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof Vr=="string"?Vr:void 0}},hidden:pe,inputElement:Fe.createElement(Dt,(0,se.Z)({},Pe,{onKeyDown:Ar,onChange:Or,onFocus:kr,onBlur:Gr,onCompositionStart:Nr,onCompositionEnd:Kr,className:ce==null?void 0:ce.textarea,style:(0,Te.Z)((0,Te.Z)({},Ie==null?void 0:Ie.textarea),{},{resize:oe==null?void 0:oe.resize}),disabled:he,prefixCls:Ut,onResize:Zr,ref:Ft}))});return _r}),pt=$t,Bt=pt},48911:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return Zt}});var se=ue(60499),Te=ue(43749),ze=ue(85899),ut=ue(18642),xe=ue(72190),Me=ue(42244),De=ue(92310),we=ue.n(De),_e=ue(29301),Re=ue(70425),dt=ue(34280),Ae=ue(59301),Fe=ue(4676),ft=Ae.forwardRef(function(ye,le){var oe=ye.height,he=ye.offsetY,pe=ye.offsetX,ce=ye.children,Ie=ye.prefixCls,yt=ye.onInnerResize,Pe=ye.innerProps,je=ye.rtl,Rt=ye.extra,At={},rt={display:"flex",flexDirection:"column"};return he!==void 0&&(At={height:oe,position:"relative",overflow:"hidden"},rt=(0,ze.Z)((0,ze.Z)({},rt),{},(0,ut.Z)((0,ut.Z)((0,ut.Z)((0,ut.Z)((0,ut.Z)({transform:"translateY(".concat(he,"px)")},je?"marginRight":"marginLeft",-pe),"position","absolute"),"left",0),"right",0),"top",0))),Ae.createElement("div",{style:At},Ae.createElement(_e.Z,{onResize:function(sn){var ct=sn.offsetHeight;ct&&yt&&yt()}},Ae.createElement("div",(0,se.Z)({style:rt,className:we()((0,ut.Z)({},"".concat(Ie,"-holder-inner"),Ie)),ref:le},Pe),ce,Rt)))});ft.displayName="Filler";var Ye=ft;function ot(ye){var le=ye.children,oe=ye.setRef,he=Ae.useCallback(function(pe){oe(pe)},[]);return Ae.cloneElement(le,{ref:he})}function at(ye,le,oe,he,pe,ce,Ie,yt){var Pe=yt.getKey;return ye.slice(le,oe+1).map(function(je,Rt){var At=le+Rt,rt=Ie(je,At,{style:{width:he},offsetX:pe}),Ft=Pe(je);return Ae.createElement(ot,{key:Ft,setRef:function(ct){return ce(je,ct)}},rt)})}function Ct(ye,le,oe,he){var pe=oe-ye,ce=le-oe,Ie=Math.min(pe,ce)*2;if(he<=Ie){var yt=Math.floor(he/2);return he%2?oe+yt+1:oe-yt}return pe>ce?oe-(he-ce):oe+(he-pe)}function jt(ye,le,oe){var he=ye.length,pe=le.length,ce,Ie;if(he===0&&pe===0)return null;he<pe?(ce=ye,Ie=le):(ce=le,Ie=ye);var yt={__EMPTY_ITEM__:!0};function Pe(sn){return sn!==void 0?oe(sn):yt}for(var je=null,Rt=Math.abs(he-pe)!==1,At=0;At<Ie.length;At+=1){var rt=Pe(ce[At]),Ft=Pe(Ie[At]);if(rt!==Ft){je=At,Rt=Rt||rt!==Pe(Ie[At+1]);break}}return je===null?null:{index:je,multiple:Rt}}function it(ye,le,oe){var he=Ae.useState(ye),pe=(0,xe.Z)(he,2),ce=pe[0],Ie=pe[1],yt=Ae.useState(null),Pe=(0,xe.Z)(yt,2),je=Pe[0],Rt=Pe[1];return Ae.useEffect(function(){var At=jt(ce||[],ye||[],le);(At==null?void 0:At.index)!==void 0&&(oe==null||oe(At.index),Rt(ye[At.index])),Ie(ye)},[ye]),[je]}var vt=ue(16089),$e=(typeof navigator=="undefined"?"undefined":(0,Te.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),Ee=$e,Ve=function(ye,le,oe,he){var pe=(0,Ae.useRef)(!1),ce=(0,Ae.useRef)(null);function Ie(){clearTimeout(ce.current),pe.current=!0,ce.current=setTimeout(function(){pe.current=!1},50)}var yt=(0,Ae.useRef)({top:ye,bottom:le,left:oe,right:he});return yt.current.top=ye,yt.current.bottom=le,yt.current.left=oe,yt.current.right=he,function(Pe,je){var Rt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,At=Pe?je<0&&yt.current.left||je>0&&yt.current.right:je<0&&yt.current.top||je>0&&yt.current.bottom;return Rt&&At?(clearTimeout(ce.current),pe.current=!1):(!At||pe.current)&&Ie(),!pe.current&&At}};function Je(ye,le,oe,he,pe,ce,Ie){var yt=(0,Ae.useRef)(0),Pe=(0,Ae.useRef)(null),je=(0,Ae.useRef)(null),Rt=(0,Ae.useRef)(!1),At=Ve(le,oe,he,pe);function rt(Qe,mt){if(vt.Z.cancel(Pe.current),!At(!1,mt)){var Nt=Qe;if(!Nt._virtualHandled)Nt._virtualHandled=!0;else return;yt.current+=mt,je.current=mt,Ee||Nt.preventDefault(),Pe.current=(0,vt.Z)(function(){var vn=Rt.current?10:1;Ie(yt.current*vn,!1),yt.current=0})}}function Ft(Qe,mt){Ie(mt,!0),Ee||Qe.preventDefault()}var sn=(0,Ae.useRef)(null),ct=(0,Ae.useRef)(null);function qt(Qe){if(ye){vt.Z.cancel(ct.current),ct.current=(0,vt.Z)(function(){sn.current=null},2);var mt=Qe.deltaX,Nt=Qe.deltaY,vn=Qe.shiftKey,mn=mt,wn=Nt;(sn.current==="sx"||!sn.current&&vn&&Nt&&!mt)&&(mn=Nt,wn=0,sn.current="sx");var Tn=Math.abs(mn),Zn=Math.abs(wn);sn.current===null&&(sn.current=ce&&Tn>Zn?"x":"y"),sn.current==="y"?rt(Qe,wn):Ft(Qe,mn)}}function an(Qe){ye&&(Rt.current=Qe.detail===je.current)}return[qt,an]}function Lt(ye,le,oe,he){var pe=Ae.useMemo(function(){return[new Map,[]]},[ye,oe.id,he]),ce=(0,xe.Z)(pe,2),Ie=ce[0],yt=ce[1],Pe=function(Rt){var At=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Rt,rt=Ie.get(Rt),Ft=Ie.get(At);if(rt===void 0||Ft===void 0)for(var sn=ye.length,ct=yt.length;ct<sn;ct+=1){var qt,an=ye[ct],Qe=le(an);Ie.set(Qe,ct);var mt=(qt=oe.get(Qe))!==null&&qt!==void 0?qt:he;if(yt[ct]=(yt[ct-1]||0)+mt,Qe===Rt&&(rt=ct),Qe===At&&(Ft=ct),rt!==void 0&&Ft!==void 0)break}return{top:yt[rt-1]||0,bottom:yt[Ft]}};return Pe}var et=ue(38705),Dt=ue(17212),Ge=function(){function ye(){(0,et.Z)(this,ye),(0,ut.Z)(this,"maps",void 0),(0,ut.Z)(this,"id",0),(0,ut.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,Dt.Z)(ye,[{key:"set",value:function(oe,he){this.diffRecords.set(oe,this.maps[oe]),this.maps[oe]=he,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}}]),ye}(),kt=Ge;function tt(ye){var le=parseFloat(ye);return isNaN(le)?0:le}function $t(ye,le,oe){var he=Ae.useState(0),pe=(0,xe.Z)(he,2),ce=pe[0],Ie=pe[1],yt=(0,Ae.useRef)(new Map),Pe=(0,Ae.useRef)(new kt),je=(0,Ae.useRef)(0);function Rt(){je.current+=1}function At(){var Ft=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Rt();var sn=function(){var an=!1;yt.current.forEach(function(Qe,mt){if(Qe&&Qe.offsetParent){var Nt=Qe.offsetHeight,vn=getComputedStyle(Qe),mn=vn.marginTop,wn=vn.marginBottom,Tn=tt(mn),Zn=tt(wn),Hn=Nt+Tn+Zn;Pe.current.get(mt)!==Hn&&(Pe.current.set(mt,Hn),an=!0)}}),an&&Ie(function(Qe){return Qe+1})};if(Ft)sn();else{je.current+=1;var ct=je.current;Promise.resolve().then(function(){ct===je.current&&sn()})}}function rt(Ft,sn){var ct=ye(Ft),qt=yt.current.get(ct);sn?(yt.current.set(ct,sn),At()):yt.current.delete(ct),!qt!=!sn&&(sn?le==null||le(Ft):oe==null||oe(Ft))}return(0,Ae.useEffect)(function(){return Rt},[]),[rt,At,Pe.current,ce]}var pt=14/15;function Bt(ye,le,oe){var he=(0,Ae.useRef)(!1),pe=(0,Ae.useRef)(0),ce=(0,Ae.useRef)(0),Ie=(0,Ae.useRef)(null),yt=(0,Ae.useRef)(null),Pe,je=function(Ft){if(he.current){var sn=Math.ceil(Ft.touches[0].pageX),ct=Math.ceil(Ft.touches[0].pageY),qt=pe.current-sn,an=ce.current-ct,Qe=Math.abs(qt)>Math.abs(an);Qe?pe.current=sn:ce.current=ct;var mt=oe(Qe,Qe?qt:an,!1,Ft);mt&&Ft.preventDefault(),clearInterval(yt.current),mt&&(yt.current=setInterval(function(){Qe?qt*=pt:an*=pt;var Nt=Math.floor(Qe?qt:an);(!oe(Qe,Nt,!0)||Math.abs(Nt)<=.1)&&clearInterval(yt.current)},16))}},Rt=function(){he.current=!1,Pe()},At=function(Ft){Pe(),Ft.touches.length===1&&!he.current&&(he.current=!0,pe.current=Math.ceil(Ft.touches[0].pageX),ce.current=Math.ceil(Ft.touches[0].pageY),Ie.current=Ft.target,Ie.current.addEventListener("touchmove",je,{passive:!1}),Ie.current.addEventListener("touchend",Rt,{passive:!0}))};Pe=function(){Ie.current&&(Ie.current.removeEventListener("touchmove",je),Ie.current.removeEventListener("touchend",Rt))},(0,dt.Z)(function(){return ye&&le.current.addEventListener("touchstart",At,{passive:!0}),function(){var rt;(rt=le.current)===null||rt===void 0||rt.removeEventListener("touchstart",At),Pe(),clearInterval(yt.current)}},[ye])}function Tt(ye){return Math.floor(Math.pow(ye,.5))}function wt(ye,le){var oe="touches"in ye?ye.touches[0]:ye;return oe[le?"pageX":"pageY"]-window[le?"scrollX":"scrollY"]}function Ne(ye,le,oe){Ae.useEffect(function(){var he=le.current;if(ye&&he){var pe=!1,ce,Ie,yt=function(){vt.Z.cancel(ce)},Pe=function rt(){yt(),ce=(0,vt.Z)(function(){oe(Ie),rt()})},je=function(){pe=!1,yt()},Rt=function(Ft){if(!(Ft.target.draggable||Ft.button!==0)){var sn=Ft;sn._virtualHandled||(sn._virtualHandled=!0,pe=!0)}},At=function(Ft){if(pe){var sn=wt(Ft,!1),ct=he.getBoundingClientRect(),qt=ct.top,an=ct.bottom;if(sn<=qt){var Qe=qt-sn;Ie=-Tt(Qe),Pe()}else if(sn>=an){var mt=sn-an;Ie=Tt(mt),Pe()}else yt()}};return he.addEventListener("mousedown",Rt),he.ownerDocument.addEventListener("mouseup",je),he.ownerDocument.addEventListener("mousemove",At),he.ownerDocument.addEventListener("dragend",je),function(){he.removeEventListener("mousedown",Rt),he.ownerDocument.removeEventListener("mouseup",je),he.ownerDocument.removeEventListener("mousemove",At),he.ownerDocument.removeEventListener("dragend",je),yt()}}},[ye])}var be=10;function xt(ye,le,oe,he,pe,ce,Ie,yt){var Pe=Ae.useRef(),je=Ae.useState(null),Rt=(0,xe.Z)(je,2),At=Rt[0],rt=Rt[1];return(0,dt.Z)(function(){if(At&&At.times<be){if(!ye.current){rt(function(Gr){return(0,ze.Z)({},Gr)});return}ce();var Ft=At.targetAlign,sn=At.originAlign,ct=At.index,qt=At.offset,an=ye.current.clientHeight,Qe=!1,mt=Ft,Nt=null;if(an){for(var vn=Ft||sn,mn=0,wn=0,Tn=0,Zn=Math.min(le.length-1,ct),Hn=0;Hn<=Zn;Hn+=1){var wr=pe(le[Hn]);wn=mn;var Cr=oe.get(wr);Tn=wn+(Cr===void 0?he:Cr),mn=Tn}for(var Yn=vn==="top"?qt:an-qt,Nr=Zn;Nr>=0;Nr-=1){var Kr=pe(le[Nr]),Or=oe.get(Kr);if(Or===void 0){Qe=!0;break}if(Yn-=Or,Yn<=0)break}switch(vn){case"top":Nt=wn-qt;break;case"bottom":Nt=Tn-an+qt;break;default:{var Ar=ye.current.scrollTop,kr=Ar+an;wn<Ar?mt="top":Tn>kr&&(mt="bottom")}}Nt!==null&&Ie(Nt),Nt!==At.lastTop&&(Qe=!0)}Qe&&rt((0,ze.Z)((0,ze.Z)({},At),{},{times:At.times+1,targetAlign:mt,lastTop:Nt}))}},[At,ye.current]),function(Ft){if(Ft==null){yt();return}if(vt.Z.cancel(Pe.current),typeof Ft=="number")Ie(Ft);else if(Ft&&(0,Te.Z)(Ft)==="object"){var sn,ct=Ft.align;"index"in Ft?sn=Ft.index:sn=le.findIndex(function(Qe){return pe(Qe)===Ft.key});var qt=Ft.offset,an=qt===void 0?0:qt;rt({times:0,index:sn,offset:an,originAlign:ct})}}}var Qt=Ae.forwardRef(function(ye,le){var oe=ye.prefixCls,he=ye.rtl,pe=ye.scrollOffset,ce=ye.scrollRange,Ie=ye.onStartMove,yt=ye.onStopMove,Pe=ye.onScroll,je=ye.horizontal,Rt=ye.spinSize,At=ye.containerSize,rt=ye.style,Ft=ye.thumbStyle,sn=ye.showScrollBar,ct=Ae.useState(!1),qt=(0,xe.Z)(ct,2),an=qt[0],Qe=qt[1],mt=Ae.useState(null),Nt=(0,xe.Z)(mt,2),vn=Nt[0],mn=Nt[1],wn=Ae.useState(null),Tn=(0,xe.Z)(wn,2),Zn=Tn[0],Hn=Tn[1],wr=!he,Cr=Ae.useRef(),Yn=Ae.useRef(),Nr=Ae.useState(sn),Kr=(0,xe.Z)(Nr,2),Or=Kr[0],Ar=Kr[1],kr=Ae.useRef(),Gr=function(){sn===!0||sn===!1||(clearTimeout(kr.current),Ar(!0),kr.current=setTimeout(function(){Ar(!1)},3e3))},ar=ce-At||0,$r=At-Rt||0,Ur=Ae.useMemo(function(){if(pe===0||ar===0)return 0;var St=pe/ar;return St*$r},[pe,ar,$r]),Vr=function(Le){Le.stopPropagation(),Le.preventDefault()},Yr=Ae.useRef({top:Ur,dragging:an,pageY:vn,startTop:Zn});Yr.current={top:Ur,dragging:an,pageY:vn,startTop:Zn};var Zr=function(Le){Qe(!0),mn(wt(Le,je)),Hn(Yr.current.top),Ie(),Le.stopPropagation(),Le.preventDefault()};Ae.useEffect(function(){var St=function(Oe){Oe.preventDefault()},Le=Cr.current,We=Yn.current;return Le.addEventListener("touchstart",St,{passive:!1}),We.addEventListener("touchstart",Zr,{passive:!1}),function(){Le.removeEventListener("touchstart",St),We.removeEventListener("touchstart",Zr)}},[]);var dr=Ae.useRef();dr.current=ar;var _r=Ae.useRef();_r.current=$r,Ae.useEffect(function(){if(an){var St,Le=function(Oe){var lt=Yr.current,_t=lt.dragging,Yt=lt.pageY,Kt=lt.startTop;vt.Z.cancel(St);var Jt=Cr.current.getBoundingClientRect(),un=At/(je?Jt.width:Jt.height);if(_t){var fn=(wt(Oe,je)-Yt)*un,xn=Kt;!wr&&je?xn-=fn:xn+=fn;var zt=dr.current,ln=_r.current,jn=ln?xn/ln:0,Dn=Math.ceil(jn*zt);Dn=Math.max(Dn,0),Dn=Math.min(Dn,zt),St=(0,vt.Z)(function(){Pe(Dn,je)})}},We=function(){Qe(!1),yt()};return window.addEventListener("mousemove",Le,{passive:!0}),window.addEventListener("touchmove",Le,{passive:!0}),window.addEventListener("mouseup",We,{passive:!0}),window.addEventListener("touchend",We,{passive:!0}),function(){window.removeEventListener("mousemove",Le),window.removeEventListener("touchmove",Le),window.removeEventListener("mouseup",We),window.removeEventListener("touchend",We),vt.Z.cancel(St)}}},[an]),Ae.useEffect(function(){return Gr(),function(){clearTimeout(kr.current)}},[pe]),Ae.useImperativeHandle(le,function(){return{delayHidden:Gr}});var Ln="".concat(oe,"-scrollbar"),Wn={position:"absolute",visibility:Or?null:"hidden"},Er={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return je?(Object.assign(Wn,{height:8,left:0,right:0,bottom:0}),Object.assign(Er,(0,ut.Z)({height:"100%",width:Rt},wr?"left":"right",Ur))):(Object.assign(Wn,(0,ut.Z)({width:8,top:0,bottom:0},wr?"right":"left",0)),Object.assign(Er,{width:"100%",height:Rt,top:Ur})),Ae.createElement("div",{ref:Cr,className:we()(Ln,(0,ut.Z)((0,ut.Z)((0,ut.Z)({},"".concat(Ln,"-horizontal"),je),"".concat(Ln,"-vertical"),!je),"".concat(Ln,"-visible"),Or)),style:(0,ze.Z)((0,ze.Z)({},Wn),rt),onMouseDown:Vr,onMouseMove:Gr},Ae.createElement("div",{ref:Yn,className:we()("".concat(Ln,"-thumb"),(0,ut.Z)({},"".concat(Ln,"-thumb-moving"),an)),style:(0,ze.Z)((0,ze.Z)({},Er),Ft),onMouseDown:Zr}))}),Vt=Qt,qe=20;function nt(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,oe=ye/le*ye;return isNaN(oe)&&(oe=0),oe=Math.max(oe,qe),Math.floor(oe)}var Ot=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],dn=[],en={overflowY:"auto",overflowAnchor:"none"};function on(ye,le){var oe=ye.prefixCls,he=oe===void 0?"rc-virtual-list":oe,pe=ye.className,ce=ye.height,Ie=ye.itemHeight,yt=ye.fullHeight,Pe=yt===void 0?!0:yt,je=ye.style,Rt=ye.data,At=ye.children,rt=ye.itemKey,Ft=ye.virtual,sn=ye.direction,ct=ye.scrollWidth,qt=ye.component,an=qt===void 0?"div":qt,Qe=ye.onScroll,mt=ye.onVirtualScroll,Nt=ye.onVisibleChange,vn=ye.innerProps,mn=ye.extraRender,wn=ye.styles,Tn=ye.showScrollBar,Zn=Tn===void 0?"optional":Tn,Hn=(0,Me.Z)(ye,Ot),wr=Ae.useCallback(function($n){return typeof rt=="function"?rt($n):$n==null?void 0:$n[rt]},[rt]),Cr=$t(wr,null,null),Yn=(0,xe.Z)(Cr,4),Nr=Yn[0],Kr=Yn[1],Or=Yn[2],Ar=Yn[3],kr=!!(Ft!==!1&&ce&&Ie),Gr=Ae.useMemo(function(){return Object.values(Or.maps).reduce(function($n,Kn){return $n+Kn},0)},[Or.id,Or.maps]),ar=kr&&Rt&&(Math.max(Ie*Rt.length,Gr)>ce||!!ct),$r=sn==="rtl",Ur=we()(he,(0,ut.Z)({},"".concat(he,"-rtl"),$r),pe),Vr=Rt||dn,Yr=(0,Ae.useRef)(),Zr=(0,Ae.useRef)(),dr=(0,Ae.useRef)(),_r=(0,Ae.useState)(0),Ln=(0,xe.Z)(_r,2),Wn=Ln[0],Er=Ln[1],St=(0,Ae.useState)(0),Le=(0,xe.Z)(St,2),We=Le[0],Be=Le[1],Oe=(0,Ae.useState)(!1),lt=(0,xe.Z)(Oe,2),_t=lt[0],Yt=lt[1],Kt=function(){Yt(!0)},Jt=function(){Yt(!1)},un={getKey:wr};function fn($n){Er(function(Kn){var Gn;typeof $n=="function"?Gn=$n(Kn):Gn=$n;var sr=kn(Gn);return Yr.current.scrollTop=sr,sr})}var xn=(0,Ae.useRef)({start:0,end:Vr.length}),zt=(0,Ae.useRef)(),ln=it(Vr,wr),jn=(0,xe.Z)(ln,1),Dn=jn[0];zt.current=Dn;var Vn=Ae.useMemo(function(){if(!kr)return{scrollHeight:void 0,start:0,end:Vr.length-1,offset:void 0};if(!ar){var $n;return{scrollHeight:(($n=Zr.current)===null||$n===void 0?void 0:$n.offsetHeight)||0,start:0,end:Vr.length-1,offset:void 0}}for(var Kn=0,Gn,sr,Wr,vi=Vr.length,ci=0;ci<vi;ci+=1){var qr=Vr[ci],fi=wr(qr),mi=Or.get(fi),lr=Kn+(mi===void 0?Ie:mi);lr>=Wn&&Gn===void 0&&(Gn=ci,sr=Kn),lr>Wn+ce&&Wr===void 0&&(Wr=ci),Kn=lr}return Gn===void 0&&(Gn=0,sr=0,Wr=Math.ceil(ce/Ie)),Wr===void 0&&(Wr=Vr.length-1),Wr=Math.min(Wr+1,Vr.length-1),{scrollHeight:Kn,start:Gn,end:Wr,offset:sr}},[ar,kr,Wn,Vr,Ar,ce]),Pn=Vn.scrollHeight,yr=Vn.start,Sn=Vn.end,pr=Vn.offset;xn.current.start=yr,xn.current.end=Sn,Ae.useLayoutEffect(function(){var $n=Or.getRecord();if($n.size===1){var Kn=Array.from($n.keys())[0],Gn=$n.get(Kn),sr=Vr[yr];if(sr&&Gn===void 0){var Wr=wr(sr);if(Wr===Kn){var vi=Or.get(Kn),ci=vi-Ie;fn(function(qr){return qr+ci})}}}Or.resetRecord()},[Pn]);var ht=Ae.useState({width:0,height:ce}),Ue=(0,xe.Z)(ht,2),Xe=Ue[0],Ze=Ue[1],gt=function(Kn){Ze({width:Kn.offsetWidth,height:Kn.offsetHeight})},Wt=(0,Ae.useRef)(),Gt=(0,Ae.useRef)(),nn=Ae.useMemo(function(){return nt(Xe.width,ct)},[Xe.width,ct]),Ht=Ae.useMemo(function(){return nt(Xe.height,Pn)},[Xe.height,Pn]),bt=Pn-ce,Cn=(0,Ae.useRef)(bt);Cn.current=bt;function kn($n){var Kn=$n;return Number.isNaN(Cn.current)||(Kn=Math.min(Kn,Cn.current)),Kn=Math.max(Kn,0),Kn}var Jn=Wn<=0,Fn=Wn>=bt,Nn=We<=0,_n=We>=ct,tr=Ve(Jn,Fn,Nn,_n),Xn=function(){return{x:$r?-We:We,y:Wn}},In=(0,Ae.useRef)(Xn()),zn=(0,Re.useEvent)(function($n){if(mt){var Kn=(0,ze.Z)((0,ze.Z)({},Xn()),$n);(In.current.x!==Kn.x||In.current.y!==Kn.y)&&(mt(Kn),In.current=Kn)}});function cr($n,Kn){var Gn=$n;Kn?((0,Fe.flushSync)(function(){Be(Gn)}),zn()):fn(Gn)}function qn($n){var Kn=$n.currentTarget.scrollTop;Kn!==Wn&&fn(Kn),Qe==null||Qe($n),zn()}var br=function(Kn){var Gn=Kn,sr=ct?ct-Xe.width:0;return Gn=Math.max(Gn,0),Gn=Math.min(Gn,sr),Gn},Br=(0,Re.useEvent)(function($n,Kn){Kn?((0,Fe.flushSync)(function(){Be(function(Gn){var sr=Gn+($r?-$n:$n);return br(sr)})}),zn()):fn(function(Gn){var sr=Gn+$n;return sr})}),rr=Je(kr,Jn,Fn,Nn,_n,!!ct,Br),yn=(0,xe.Z)(rr,2),hn=yn[0],En=yn[1];Bt(kr,Yr,function($n,Kn,Gn,sr){var Wr=sr;return tr($n,Kn,Gn)?!1:!Wr||!Wr._virtualHandled?(Wr&&(Wr._virtualHandled=!0),hn({preventDefault:function(){},deltaX:$n?Kn:0,deltaY:$n?0:Kn}),!0):!1}),Ne(ar,Yr,function($n){fn(function(Kn){return Kn+$n})}),(0,dt.Z)(function(){function $n(Gn){var sr=Jn&&Gn.detail<0,Wr=Fn&&Gn.detail>0;kr&&!sr&&!Wr&&Gn.preventDefault()}var Kn=Yr.current;return Kn.addEventListener("wheel",hn,{passive:!1}),Kn.addEventListener("DOMMouseScroll",En,{passive:!0}),Kn.addEventListener("MozMousePixelScroll",$n,{passive:!1}),function(){Kn.removeEventListener("wheel",hn),Kn.removeEventListener("DOMMouseScroll",En),Kn.removeEventListener("MozMousePixelScroll",$n)}},[kr,Jn,Fn]),(0,dt.Z)(function(){if(ct){var $n=br(We);Be($n),zn({x:$n})}},[Xe.width,ct]);var Qn=function(){var Kn,Gn;(Kn=Wt.current)===null||Kn===void 0||Kn.delayHidden(),(Gn=Gt.current)===null||Gn===void 0||Gn.delayHidden()},Rn=xt(Yr,Vr,Or,Ie,wr,function(){return Kr(!0)},fn,Qn);Ae.useImperativeHandle(le,function(){return{nativeElement:dr.current,getScrollInfo:Xn,scrollTo:function(Kn){function Gn(sr){return sr&&(0,Te.Z)(sr)==="object"&&("left"in sr||"top"in sr)}Gn(Kn)?(Kn.left!==void 0&&Be(br(Kn.left)),Rn(Kn.top)):Rn(Kn)}}}),(0,dt.Z)(function(){if(Nt){var $n=Vr.slice(yr,Sn+1);Nt($n,Vr)}},[yr,Sn,Vr]);var Mn=Lt(Vr,wr,Or,Ie),er=mn==null?void 0:mn({start:yr,end:Sn,virtual:ar,offsetX:We,offsetY:pr,rtl:$r,getSize:Mn}),vr=at(Vr,yr,Sn,ct,We,Nr,At,un),Dr=null;ce&&(Dr=(0,ze.Z)((0,ut.Z)({},Pe?"height":"maxHeight",ce),en),kr&&(Dr.overflowY="hidden",ct&&(Dr.overflowX="hidden"),_t&&(Dr.pointerEvents="none")));var ei={};return $r&&(ei.dir="rtl"),Ae.createElement("div",(0,se.Z)({ref:dr,style:(0,ze.Z)((0,ze.Z)({},je),{},{position:"relative"}),className:Ur},ei,Hn),Ae.createElement(_e.Z,{onResize:gt},Ae.createElement(an,{className:"".concat(he,"-holder"),style:Dr,ref:Yr,onScroll:qn,onMouseEnter:Qn},Ae.createElement(Ye,{prefixCls:he,height:Pn,offsetX:We,offsetY:pr,scrollWidth:ct,onInnerResize:Kr,ref:Zr,innerProps:vn,rtl:$r,extra:er},vr))),ar&&Pn>ce&&Ae.createElement(Vt,{ref:Wt,prefixCls:he,scrollOffset:Wn,scrollRange:Pn,rtl:$r,onScroll:cr,onStartMove:Kt,onStopMove:Jt,spinSize:Ht,containerSize:Xe.height,style:wn==null?void 0:wn.verticalScrollBar,thumbStyle:wn==null?void 0:wn.verticalScrollBarThumb,showScrollBar:Zn}),ar&&ct>Xe.width&&Ae.createElement(Vt,{ref:Gt,prefixCls:he,scrollOffset:We,scrollRange:ct,rtl:$r,onScroll:cr,onStartMove:Kt,onStopMove:Jt,spinSize:nn,containerSize:Xe.width,horizontal:!0,style:wn==null?void 0:wn.horizontalScrollBar,thumbStyle:wn==null?void 0:wn.horizontalScrollBarThumb,showScrollBar:Zn}))}var Xt=Ae.forwardRef(on);Xt.displayName="List";var Ut=Xt,Zt=Ut},48136:function(bn,tn,ue){"use strict";var se=Object.defineProperty,Te=Object.defineProperties,ze=Object.getOwnPropertyDescriptors,ut=Object.getOwnPropertySymbols,xe=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable,De=(a,y,b)=>y in a?se(a,y,{enumerable:!0,configurable:!0,writable:!0,value:b}):a[y]=b,we=(a,y)=>{for(var b in y||(y={}))xe.call(y,b)&&De(a,b,y[b]);if(ut)for(var b of ut(y))Me.call(y,b)&&De(a,b,y[b]);return a},_e=(a,y)=>Te(a,ze(y)),Re=a=>typeof a=="symbol"?a:a+"",dt=(a,y)=>{var b={};for(var E in a)xe.call(a,E)&&y.indexOf(E)<0&&(b[E]=a[E]);if(a!=null&&ut)for(var E of ut(a))y.indexOf(E)<0&&Me.call(a,E)&&(b[E]=a[E]);return b};function Ae(a){return Array.isArray(a)}var Fe={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 ft(){return"window"in globalThis&&"document"in globalThis}function Ye(){return"matchMedia"in window?window.matchMedia("(pointer: coarse)").matches:"ontouchstart"in window||navigator.maxTouchPoints>0}function ot(){return typeof navigator.vibrate=="function"}function at(){var a,y;if(!ft())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 Ct(){if(!ft())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 jt(){return HTMLElement.prototype.hasOwnProperty("popover")}var it={strings:Fe,_locale:"",_dirty:!1,_subscribers:[],_numberFormatter:void 0,get locale(){return it._locale||(it._locale=ft()?navigator.language.slice(0,5):"en-US"),it._locale},set locale(a){it._locale=a,it._numberFormatter=void 0,it.dirty=!0},get numberFormatter(){return it._numberFormatter||(it._numberFormatter=new Intl.NumberFormat(it.locale)),it._numberFormatter},merge(a,y){if(typeof a=="string"&&y)it.strings[a]=we(we({},it.strings[a]),y),it.dirty=!0;else for(const b of Object.keys(a))it.merge(b,a[b])},get dirty(){return it._dirty},set dirty(a){it._dirty||it._dirty===a||(it._dirty=!0,setTimeout(()=>{it._dirty=!1,this._subscribers.forEach(y=>y==null?void 0:y())},0))},subscribe(a){return it._subscribers.push(a),it._subscribers.length-1},unsubscribe(a){a<0||a>=it._subscribers.length||(it._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=vt(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=vt(E);ee&&b.setAttribute("aria-label",ee)}}}};function vt(a,...y){if(a===void 0)return;let b="";const E=it.locale;it.strings[E]&&(b=it.strings[E][a]);const ee=E.slice(0,2);if(!b&&it.strings[ee]&&(b=it.strings[ee][a]),b||(b=it.strings.en[a]),!b)return;const re=/(%@|%([0-9]+)\$@)/g;let ae=re.exec(b),fe=0;for(;ae;){if(y[fe++]){const ve=ae[2]?parseInt(ae[2],10)-1:fe-1;let Se=y[ve];typeof Se=="number"&&(Se=it.numberFormatter.format(Se)),b=b.replace(ae[1],Se)}ae=re.exec(b)}return b=b.replace(/%%/g,"%"),b}var $e={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"},Ve={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"},Je={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"},Lt={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"},et={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 Dt(a){var y,b,E,ee,re,ae;const fe=a.split("!");let me,ve,Se,He=255,st=255,Mt=255,It=-1;const gn=fe.length>0&&fe[0].startsWith("-");gn&&(fe[0]=fe[0].slice(1));for(let hr=0;hr<fe.length;hr++){me=He,ve=st,Se=Mt;const pn=(y=fe[hr].trim().match(/^([A-Za-z\d-]+)/))==null?void 0:y[1],On=pn==null?void 0:pn.toLowerCase(),gr=pn&&(ae=(re=(ee=(E=(b=Je[On])!=null?b:Je[Lt[pn]])!=null?E:Ee[pn])!=null?ee:et[pn])!=null?re:$e[pn])!=null?ae:fe[hr].trim();let Un=gr.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if(Un!=null&&Un[1]&&Un[2]&&Un[3])He=Math.max(0,Math.min(255,Number.parseInt(Un[1],16))),st=Math.max(0,Math.min(255,Number.parseInt(Un[2],16))),Mt=Math.max(0,Math.min(255,Number.parseInt(Un[3],16)));else if(Un=gr.match(/^#([\da-f]{3})$/i),Un!=null&&Un[1]){const zr=Number.parseInt(Un[1][0],16),Xr=Number.parseInt(Un[1][1],16),jr=Number.parseInt(Un[1][2],16);He=Math.max(0,Math.min(255,zr*16+zr)),st=Math.max(0,Math.min(255,Xr*16+Xr)),Mt=Math.max(0,Math.min(255,jr*16+jr))}else if(Un=gr.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i),Un!=null&&Un[1]&&Un[2]&&Un[3])He=Math.max(0,Math.min(255,Number.parseInt(Un[1]))),st=Math.max(0,Math.min(255,Number.parseInt(Un[2]))),Mt=Math.max(0,Math.min(255,Number.parseInt(Un[3])));else return;It>=0&&(He=(1-It)*He+It*me,st=(1-It)*st+It*ve,Mt=(1-It)*Mt+It*Se,It=-1),hr+1<fe.length&&(It=Math.max(0,Math.min(100,Number.parseInt(fe[++hr])))/100)}return It>=0&&(He=It*He+(1-It)*me,st=It*st+(1-It)*ve,Mt=It*Mt+(1-It)*Se),gn&&(He=255-He,st=255-st,Mt=255-Mt),"#"+("00"+Math.round(He).toString(16)).slice(-2)+("00"+Math.round(st).toString(16)).slice(-2)+("00"+Math.round(Mt).toString(16)).slice(-2)}function Ge(a){var y,b;return a=a.trim(),(b=(y=Ve[a.toLowerCase()])!=null?y:Ve[Lt[a]])!=null?b:Dt(a)}function kt(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 tt(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 $t(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*tt(re,ee,y+2)),g:Math.round(255*tt(re,ee,y)),b:Math.round(255*tt(re,ee,y-2))}}function pt(a){return a<0?0:a>255?255:Math.round(a)}function Bt(a){const{r:y,g:b,b:E}=a;let ee=((1<<24)+(pt(y)<<16)+(pt(b)<<8)+pt(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 Tt(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 fe,me;re===ee?fe=0:y===re?fe=(b-E)/ae:b===re?fe=2+(E-y)/ae:E===re&&(fe=4+(y-b)/ae),fe=Math.min(fe*60,360),fe<0&&(fe+=360);const ve=(ee+re)/2;return re===ee?me=0:ve<=.5?me=ae/(re+ee):me=ae/(2-re-ee),{h:fe,s:me,l:ve}}function wt(a){let y=kt(a);if(!y)return a;let{h:b,s:E,l:ee}=Tt(y);return E+=.1,ee-=.1,Bt($t({h:b,s:E,l:ee}))}var Ne={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"},be={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},xt=[{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 Qt(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 xt)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(be[re]||re)}return a}function Vt(a){var y;if((a<119808||a>120831)&&(a<8448||a>8527))return{char:String.fromCodePoint(a)};for(const b in be)if(be[b]===a){a=(y=b.codePointAt(0))!=null?y:0;break}for(const b of xt)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 qe(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=Ne[ee];if(re)re.startsWith("\\")?b+=re+" ":b+=re;else{const{char:ae,variant:fe,style:me}=Vt(ee);switch(re=ae,fe){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(me){case"bold":re=`\\mathbf{${re}}`;break;case"italic":re=`\\mathit{${re}}`;break;case"bolditalic":re=`\\mathbfit{${re}}`;break}b+=re}}return b}function nt(a){return a?Array.isArray(a)?a:typeof a=="object"&&"group"in a?a.group:[]:[]}var Ot={},dn=we({},Ne),en={},on={},Xt={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}"},Ut={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}},ye={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:Ut,primitive:!0},"texvc.sty":{package:Xt,primitive:!1}},le={" ":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!@*()-=+{}\[\]\\';:?/.,~<>`|$%#&^" ]/,he,pe;Ct()?(he=new RegExp("\\p{Letter}","u"),pe=new RegExp("[0-9\\p{Letter}]","u")):(he=/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/,pe=/[\da-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/);function ce(a,y,b="mord",E){y!==void 0&&(Ot[a]={definitionType:"symbol",type:b,variant:E,codepoint:y},dn[y]||(dn[y]=a))}function Ie(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 yt(a,y){for(let b=a;b<=y;b++)ce(String.fromCodePoint(b),b)}function Pe(a){var y;return(y=on[a])!=null?y:null}function je(a,y){var b,E;if(y.length===0||y==="\\"||!y.startsWith("\\"))return[];const ee=[];for(const ae in en)ae.startsWith(y)&&!en[ae].infix&&ee.push({match:ae,frequency:(b=en[ae].frequency)!=null?b:0});for(const ae in Ot)ae.startsWith(y)&&ee.push({match:ae,frequency:(E=Ot[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,fe)=>{var me,ve;return ae.frequency===fe.frequency?ae.match.length===fe.match.length?ae.match<fe.match?-1:1:ae.match.length-fe.match.length:((me=fe.frequency)!=null?me:0)-((ve=ae.frequency)!=null?ve:0)}),ee.map(ae=>ae.match)}function Rt(a){let y="auto";const b=a.match(/:([^=]+)/);return b&&(y=b[1].trim()),y}function At(a){if(!a)return[];const y=[];let b=a.split("]");if(b[0].startsWith("[")){y.push({isOptional:!0,type:Rt(b[0].slice(1))});for(let E=1;E<=b.length;E++)y.push(...At(b[E]))}else if(b=a.split("}"),b[0].startsWith("{")){y.push({isOptional:!1,type:Rt(b[0].slice(1))});for(let E=1;E<=b.length;E++)y.push(...At(b[E]))}return y}function rt(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 Ft(a,y){typeof a=="string"&&(a=[a]);const b={tabular:!1,params:[],createAtom:y};for(const E of a)on[E]=b}function sn(a,y,b){typeof a=="string"&&(a=[a]);const ee={tabular:!0,params:At(y),createAtom:b};for(const re of a)on[re]=ee}function ct(a,y,b){var E,ee;b||(b={});const re={definitionType:"function",params:At(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")en["\\"+a]=re;else for(const ae of a)en["\\"+ae]=re}var qt;function an(a){return qt||(qt=mt(ye)),a?mt(we(we({},qt),a)):qt}function Qe(a,y){var b,E,ee,re;if(typeof a=="string"){let ae=0;const fe=a;return/(^|[^\\])#1/.test(fe)&&(ae=1),/(^|[^\\])#2/.test(fe)&&(ae=2),/(^|[^\\])#3/.test(fe)&&(ae=3),/(^|[^\\])#4/.test(fe)&&(ae=4),/(^|[^\\])#5/.test(fe)&&(ae=5),/(^|[^\\])#6/.test(fe)&&(ae=6),/(^|[^\\])#7/.test(fe)&&(ae=7),/(^|[^\\])#8/.test(fe)&&(ae=8),/(^|[^\\])#9/.test(fe)&&(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:fe}}return we({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 mt(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]=Qe(E.package[ee],{expand:!E.primitive,captureSelection:E.captureSelection});else y[b]=Qe(E)}return y}function Nt(a,y="math"){if(!a||a.length===0)return null;let b=null;if(a.startsWith("\\")){if(b=en[a],b)return!b.ifMode||b.ifMode===y?b:null;y==="math"?b=Ot[a]:le[a]&&(b={definitionType:"symbol",type:"mord",codepoint:le[a]})}else if(y==="math"){if(b=Ot[a],!b&&a.length===1){const E=mn("math",a.codePointAt(0));return E.startsWith("\\")?_e(we({},Nt(E,"math")),{command:E}):null}}else le[a]?b={definitionType:"symbol",type:"mord",codepoint:le[a]}:y==="text"&&(b={definitionType:"symbol",type:"mord",codepoint:a.codePointAt(0)});return b!=null?b:null}function vn(a,y){if(!a.startsWith("\\"))return null;const b=a.slice(1);return y[b]}function mn(a,y){if(y===void 0)return"";if(a==="math"&&dn[y])return dn[y];if(a==="text"){const b=Object.keys(le).find(E=>le[E]===y);return b||String.fromCodePoint(y)}return String.fromCodePoint(y)}var wn=[0,.68889,0,0,.72222],Tn=[0,.68889,0,0,.66667],Zn=[0,.68889,0,0,.77778],Hn=[0,.68889,0,0,.61111],wr=[.16667,.68889,0,0,.77778],Cr=[0,.68889,0,0,.55556],Yn=[0,0,0,0,.25],Nr=[0,.825,0,0,2.33334],Kr=[0,.9,0,0,2.33334],Or=[0,.68889,0,0,.54028],Ar=[-.03598,.46402,0,0,.5],kr=[-.13313,.36687,0,0,1],Gr=[.01354,.52239,0,0,1],ar=[.01354,.52239,0,0,1.11111],$r=[0,.54986,0,0,1],Ur=[0,.69224,0,0,.5],Vr=[0,.43056,0,0,1],Yr=[.08198,.58198,0,0,.77778],Zr=[.19444,.69224,0,0,.41667],dr=[.1808,.675,0,0,1],_r=[.19444,.69224,0,0,.83334],Ln=[.13667,.63667,0,0,1],Wn=[-.064,.437,0,0,1.334],Er=[.08167,.58167,0,0,.77778],St=[0,.69224,0,0,.72222],Le=[0,.69224,0,0,.66667],We=[-.13313,.36687,0,0,.77778],Be=[.06062,.54986,0,0,.77778],Oe=[0,.69224,0,0,.77778],lt=[.25583,.75583,0,0,.77778],_t=[.25142,.75726,0,0,.77778],Yt=[.20576,.70576,0,0,.77778],Kt=[.30274,.79383,0,0,.77778],Jt=[.22958,.72958,0,0,.77778],un=[.1808,.675,0,0,.77778],fn=[.13667,.63667,0,0,.77778],xn=[.13597,.63597,0,0,.77778],zt=[.03517,.54986,0,0,.77778],ln=[0,.675,0,0,.77778],jn=[.19444,.69224,0,0,.61111],Dn=[0,.54986,0,0,.76042],Vn=[0,.54986,0,0,.66667],Pn=[.0391,.5391,0,0,.77778],yr=[.03517,.54986,0,0,1.33334],Sn=[.38569,.88569,0,0,.77778],pr=[.23222,.74111,0,0,.77778],ht=[.19444,.69224,0,0,.77778],Ue=[0,.37788,0,0,.5],Xe=[0,.54986,0,0,.72222],Ze=[0,.69224,0,0,.83334],gt=[.11111,.69224,0,0,.66667],Wt=[.26167,.75726,0,0,.77778],Gt=[.48256,.98256,0,0,.77778],nn=[.28481,.79383,0,0,.77778],Ht=[.08167,.58167,0,0,.22222],bt=[.08167,.58167,0,0,.38889],Cn=[0,.43056,.04028,0,.66667],kn=[.41951,.91951,0,0,.77778],Jn=[.24982,.74947,0,0,.38865],Fn=[.08319,.58283,0,0,.75623],Nn=[0,.10803,0,0,.27764],_n=[0,.47534,0,0,.50181],tr=[.18906,.47534,0,0,.50181],Xn=[0,.69141,0,0,.50181],In=[.24982,.74947,0,0,.27764],zn=[0,.69141,0,0,.21471],cr=[.25,.75,0,0,.44722],qn=[0,.64444,0,0,.575],br=[.08556,.58556,0,0,.89444],Br=[0,.69444,0,0,.89444],rr=[0,.68611,0,0,.9],yn=[0,.68611,0,0,.86944],hn=[.25,.75,0,0,.575],En=[.25,.75,0,0,.31944],Qn=[0,.69444,0,0,.63889],Rn=[0,.69444,0,0,.31944],Mn=[0,.44444,0,0,.63889],er=[0,.44444,0,0,.51111],vr=[0,.69444,0,0,.575],Dr=[.13333,.63333,0,0,.89444],ei=[0,.44444,0,0,.31944],$n=[0,.69444,0,0,.86944],Kn=[0,.68611,0,0,.69166],Gn=[0,.68611,0,0,.83055],sr=[0,.68611,0,0,.89444],Wr=[0,.69444,0,0,.60278],vi=[.19444,.69444,0,0,.51111],ci=[0,.69444,0,0,.83055],qr=[-.10889,.39111,0,0,1.14999],fi=[.19444,.69444,0,0,.575],mi=[.19444,.69444,0,0,1.14999],lr=[.19444,.69444,0,0,.70277],or=[.05556,.75,0,0,.575],ir=[0,.68611,0,0,.95833],mr=[.08556,.58556,0,0,.76666],ri=[-.02639,.47361,0,0,.575],pi=[0,.44444,0,0,.89444],yi=[0,.55556,0,0,.76666],gi=[-.10889,.39111,0,0,.89444],si=[.00222,.50222,0,0,.89444],wi=[.19667,.69667,0,0,.89444],Hi=[.08556,.58556,0,0,1.14999],Di=[0,.69444,0,0,.70277],aa=[-.02778,.47222,0,0,.575],Ui=[.25,.75,0,0,.51111],Pi=[-.13889,.36111,0,0,1.14999],Pa=[.19444,.69444,0,0,1.02222],da=[.12963,.69444,0,0,.89444],oa=[.19444,.69444,0,0,.44722],Xi=[0,.64444,.13167,0,.59111],Si=[.19444,.64444,.13167,0,.59111],Tr=[0,.68611,.17208,0,.8961],ti=[.19444,.44444,.105,0,.53222],Hr=[0,.44444,.085,0,.82666],Ir=[0,.69444,.06709,0,.59111],ni=[0,.69444,.12945,0,.35555],ii=[0,.69444,0,0,.94888],Bi=[0,.69444,.11472,0,.59111],Oi=[0,.68611,.10778,0,.88555],Fi=[0,.69444,.07939,0,.62055],zi=[0,.69444,.12417,0,.30667],hi=[0,.64444,.13556,0,.51111],ui=[.19444,.64444,.13556,0,.51111],Zi=[0,.68333,.16389,0,.74333],ai=[.19444,.43056,.08847,0,.46],Mi=[0,.43056,.07514,0,.71555],Ti=[0,.69444,.06646,0,.51111],Mo=[0,.69444,0,0,.83129],Fa=[0,.69444,.1225,0,.51111],za=[0,.68333,.09403,0,.76666],no=[0,.68333,.11111,0,.76666],Ss=[0,.69444,.06961,0,.51444],fo=[0,.69444,0,0,.27778],Ma=[.25,.75,0,0,.38889],ha=[0,.64444,0,0,.5],bo=[0,.69444,0,0,.77778],ko=[0,.68333,0,0,.75],Lo=[0,.68333,0,0,.77778],ns=[0,.68333,0,0,.68056],No=[0,.68333,0,0,.72222],Ya=[.25,.75,0,0,.5],Oa=[.25,.75,0,0,.27778],$i=[0,.69444,0,0,.5],Ao=[0,.69444,0,0,.55556],rs=[0,.43056,0,0,.44445],Do=[0,.43056,0,0,.5],Ci=[.19444,.43056,0,0,.55556],di=[0,.43056,0,0,.55556],Wi=[.08333,.58333,0,0,.77778],ka=[0,.43056,0,0,.27778],qi=[0,.66786,0,0,.27778],$a=[0,.69444,0,0,.75],Ka=[0,.66786,0,0,.5],ro=[0,.68333,0,0,.625],Na=[.19444,.69444,0,0,.44445],so=[0,.69444,0,0,.72222],lo=[.19444,.69444,0,0,.5],La=[.19444,.69444,0,0,1],bl=[.011,.511,0,0,1.126],Vo=[.19444,.69444,0,0,.61111],Ys=[.05556,.75,0,0,.5],Kl=[0,.68333,0,0,.83334],Hl=[.0391,.5391,0,0,.66667],Cs=[-.05555,.44445,0,0,.5],Ec=[0,.43056,0,0,.77778],is=[0,.55556,0,0,.66667],xl=[-.03625,.46375,0,0,.77778],Go=[-.01688,.48312,0,0,.77778],as=[.0391,.5391,0,0,1],Li=[0,.69444,0,0,.61111],Ii=[-.03472,.46528,0,0,.5],ji=[.25,.75,0,0,.44445],Ja=[-.14236,.35764,0,0,1],Aa=[.244,.744,0,0,.412],xo=[.19444,.69444,0,0,.88889],po=[.12963,.69444,0,0,.77778],Ha=[.19444,.69444,0,0,.38889],Bo=[.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],Eu=[0,.68611,0,0,.80555],Mu=[0,.68611,.08229,0,.98229],Zl=[0,.68611,0,0,.76666],Od=[0,.44444,0,0,.58472],Mc=[.19444,.44444,0,0,.6118],Sl=[.19444,.43056,0,0,.5],ku=[0,.68333,.02778,.08334,.76278],kc=[0,.68333,.08125,.05556,.83125],Js=[0,.43056,0,.05556,.48472],jl=[.19444,.43056,0,.08334,.51702],Lu=[.25,.75,0,0,.42778],Da=[0,.69444,0,0,.55],ss=[0,.69444,0,0,.73334],_s=[0,.69444,0,0,.79445],$d=[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],Gl=[.19444,.45833,0,0,.56111],Au=[0,.45833,0,0,.56111],Es=[0,.69444,0,0,.30556],Du=[0,.69444,0,0,.58056],Ms=[0,.69444,0,0,.67223],tl=[0,.69444,0,0,.85556],ls=[0,.69444,0,0,.55834],mo=[0,.65556,.11156,0,.5],ks=[0,.69444,.08094,0,.70834],Ac=[.17014,0,0,0,.44445],Bu=[0,.69444,.0799,0,.5],Tu=[0,.69444,0,0,.73752],Rd=[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],fa=[0,.65556,0,0,.5],wa=[0,.69444,0,0,.47222],la=[0,.69444,0,0,.66667],Ba=[0,.69444,0,0,.59722],nl=[0,.69444,0,0,.54167],Iu=[0,.69444,0,0,.70834],Ul=[.25,.75,0,0,.28889],Pu=[0,.69444,0,0,.51667],jd=[0,.44444,0,0,.44445],Vd=[.19444,.44444,0,0,.51667],Dc=[0,.44444,0,0,.38333],Ou=[0,.44444,0,0,.51667],Bc=[0,.69444,0,0,.83334],Gd=[.35001,.85,0,0,.45834],Tc=[.35001,.85,0,0,.57778],Ic=[.35001,.85,0,0,.41667],$u=[.35001,.85,0,0,.58334],Xl=[0,.72222,0,0,.55556],Pc=[1e-5,.6,0,0,.66667],Nu=[1e-5,.6,0,0,.77778],Cl=[.25001,.75,0,0,.94445],Ud=[.306,.805,.19445,0,.47222],ql=[.30612,.805,.19445,0,.47222],Wa=[.25001,.75,0,0,.83334],rl=[.35001,.85,0,0,.47222],Ru=[.25001,.75,0,0,1.11111],Fu=[.65002,1.15,0,0,.59722],go=[.65002,1.15,0,0,.81111],Ki=[.65002,1.15,0,0,.47222],Io=[.65002,1.15,0,0,.66667],Ro=[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],$c=[.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],Rc=[.95003,1.45,0,0,1.04445],ds=[.95003,1.45,0,0,.52778],Yl=[.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],Fr=[0,.61111,0,0,.525],So=[.08333,.69444,0,0,.525],Zu=[-.08056,.53055,0,0,.525],qd=[-.05556,.55556,0,0,.525],io=[0,.43056,0,0,.525],Sa=[.22222,.43056,0,0,.525],nc=[0,0,0,0,.525],Yd={"AMS-Regular":{32:Yn,65:wn,66:Tn,67:wn,68:wn,69:Tn,70:Hn,71:Zn,72:Zn,73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:Zn,76:Tn,77:[0,.68889,0,0,.94445],78:wn,79:wr,80:Hn,81:wr,82:wn,83:Cr,84:Tn,85:wn,86:wn,87:[0,.68889,0,0,1],88:wn,89:wn,90:Tn,107:Cr,160:Yn,165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:Cr,295:Or,710:Nr,732:Kr,770:Nr,771:Kr,989:Er,1008:Cn,8245:[0,.54986,0,0,.275],8463:Or,8487:wn,8498:Cr,8502:Tn,8503:[0,.68889,0,0,.44445],8504:Tn,8513:[0,.68889,0,0,.63889],8592:Ar,8594:Ar,8602:kr,8603:kr,8606:Gr,8608:Gr,8610:ar,8611:ar,8619:$r,8620:$r,8621:[-.13313,.37788,0,0,1.38889],8622:kr,8624:Ur,8625:Ur,8630:Vr,8631:Vr,8634:Yr,8635:Yr,8638:Zr,8639:Zr,8642:Zr,8643:Zr,8644:dr,8646:dr,8647:dr,8648:_r,8649:dr,8650:_r,8651:Gr,8652:Gr,8653:kr,8654:kr,8655:kr,8666:Ln,8667:Ln,8669:[-.13313,.37788,0,0,1],8672:Wn,8674:Wn,8705:[0,.825,0,0,.5],8708:Cr,8709:Er,8717:[0,.43056,0,0,.42917],8722:Ar,8724:[.08198,.69224,0,0,.77778],8726:Er,8733:Oe,8736:St,8737:St,8738:[.03517,.52239,0,0,.72222],8739:Ht,8740:[.25142,.74111,0,0,.27778],8741:bt,8742:[.25142,.74111,0,0,.5],8756:Le,8757:Le,8764:We,8765:[-.13313,.37788,0,0,.77778],8769:We,8770:xl,8774:Kt,8776:Go,8778:Er,8782:Be,8783:Be,8785:Yr,8786:Yr,8787:Yr,8790:Oe,8791:Jt,8796:[.08198,.91667,0,0,.77778],8806:lt,8807:lt,8808:_t,8809:_t,8812:[.25583,.75583,0,0,.5],8814:Yt,8815:Yt,8816:Kt,8817:Kt,8818:Jt,8819:Jt,8822:un,8823:un,8828:fn,8829:fn,8830:Jt,8831:Jt,8832:Yt,8833:Yt,8840:Kt,8841:Kt,8842:xn,8843:xn,8847:zt,8848:zt,8858:Yr,8859:Yr,8861:Yr,8862:ln,8863:ln,8864:ln,8865:ln,8872:[0,.69224,0,0,.61111],8873:St,8874:[0,.69224,0,0,.88889],8876:Hn,8877:Hn,8878:wn,8879:wn,8882:zt,8883:zt,8884:fn,8885:fn,8888:[0,.54986,0,0,1.11111],8890:Ci,8891:jn,8892:jn,8901:[0,.54986,0,0,.27778],8903:Er,8905:Er,8906:Er,8907:Oe,8908:Oe,8909:[-.03598,.46402,0,0,.77778],8910:Dn,8911:Dn,8912:zt,8913:zt,8914:Vn,8915:Vn,8916:Le,8918:Pn,8919:Pn,8920:yr,8921:yr,8922:Sn,8923:Sn,8926:fn,8927:fn,8928:Kt,8929:Kt,8934:pr,8935:pr,8936:pr,8937:pr,8938:Yt,8939:Yt,8940:Kt,8941:Kt,8994:ht,8995:ht,9416:[.15559,.69224,0,0,.90222],9484:Ur,9488:Ur,9492:Ue,9496:Ue,9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:ln,9633:ln,9650:Xe,9651:Xe,9654:zt,9660:Xe,9661:Xe,9664:zt,9674:gt,9733:[.19444,.69224,0,0,.94445],10003:Ze,10016:Ze,10731:gt,10846:[.19444,.75583,0,0,.61111],10877:fn,10878:fn,10885:lt,10886:lt,10887:xn,10888:xn,10889:Wt,10890:Wt,10891:Gt,10892:Gt,10901:fn,10902:fn,10933:_t,10934:_t,10935:Wt,10936:Wt,10937:Wt,10938:Wt,10949:lt,10950:lt,10955:nn,10956:nn,57350:Ht,57351:bt,57352:Er,57353:Cn,57356:_t,57357:_t,57358:kn,57359:Kt,57360:Kt,57361:kn,57366:_t,57367:_t,57368:_t,57369:_t,57370:xn,57371:xn},"Caligraphic-Regular":{32:Yn,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:Yn},"Fraktur-Regular":{32:Yn,33:[0,.69141,0,0,.29574],34:zn,38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:Jn,41:Jn,42:[0,.62119,0,0,.27764],43:Fn,44:Nn,45:Fn,46:Nn,47:[.24982,.74947,0,0,.50181],48:_n,49:_n,50:_n,51:tr,52:tr,53:tr,54:Xn,55:tr,56:Xn,57:tr,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:In,93:In,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:Yn,8216:zn,8217:zn,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:Yn,33:[0,.69444,0,0,.35],34:Wr,35:[.19444,.69444,0,0,.95833],36:or,37:[.05556,.75,0,0,.95833],38:Br,39:Rn,40:cr,41:cr,42:[0,.75,0,0,.575],43:Dr,44:[.19444,.15556,0,0,.31944],45:Dc,46:[0,.15556,0,0,.31944],47:hn,48:qn,49:qn,50:qn,51:qn,52:qn,53:qn,54:qn,55:qn,56:qn,57:qn,58:ei,59:[.19444,.44444,0,0,.31944],60:br,61:gi,62:br,63:[0,.69444,0,0,.54305],64:Br,65:yn,66:[0,.68611,0,0,.81805],67:Gn,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:Kn,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:yn,89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:En,92:hn,93:En,94:vr,95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:Qn,99:er,100:Qn,101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:Qn,105:Rn,106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:Rn,109:[0,.44444,0,0,.95833],110:Mn,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:Mn,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:er,123:hn,124:En,125:hn,126:[.35,.34444,0,0,.575],160:Yn,163:[0,.69444,0,0,.86853],168:vr,172:[0,.44444,0,0,.76666],176:$n,177:Dr,184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:Dr,216:[.04861,.73472,0,0,.89444],223:Ba,230:[0,.44444,0,0,.83055],247:Dr,248:[.09722,.54167,0,0,.575],305:ei,338:[0,.68611,0,0,1.16944],339:pi,567:[.19444,.44444,0,0,.35139],710:vr,711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:vr,715:vr,728:vr,729:Rn,730:$n,732:vr,733:vr,915:Kn,916:ir,920:sr,923:Eu,926:Zl,928:rr,931:Gn,933:sr,934:Gn,936:sr,937:Gn,8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:Rn,8217:Rn,8220:Wr,8221:Wr,8224:vi,8225:vi,8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:wl,8465:ci,8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:ci,8501:Di,8592:qr,8593:fi,8594:qr,8595:fi,8596:qr,8597:hn,8598:mi,8599:mi,8600:mi,8601:mi,8636:qr,8637:qr,8640:qr,8641:qr,8656:qr,8657:lr,8658:qr,8659:lr,8660:qr,8661:[.25,.75,0,0,.70277],8704:Qn,8706:[0,.69444,.06389,0,.62847],8707:Qn,8709:or,8711:ir,8712:mr,8715:mr,8722:Dr,8723:Dr,8725:hn,8726:hn,8727:aa,8728:ri,8729:ri,8730:[.18,.82,0,0,.95833],8733:pi,8734:[0,.44444,0,0,1.14999],8736:St,8739:En,8741:hn,8743:yi,8744:yi,8745:yi,8746:yi,8747:[.19444,.69444,.12778,0,.56875],8764:gi,8768:[.19444,.69444,0,0,.31944],8771:si,8776:[.02444,.52444,0,0,.89444],8781:si,8801:si,8804:wi,8805:wi,8810:Hi,8811:Hi,8826:br,8827:br,8834:br,8835:br,8838:wi,8839:wi,8846:yi,8849:wi,8850:wi,8851:yi,8852:yi,8853:Dr,8854:Dr,8855:Dr,8856:Dr,8857:Dr,8866:Di,8867:Di,8868:Br,8869:Br,8900:ri,8901:[-.02639,.47361,0,0,.31944],8902:aa,8968:Ui,8969:Ui,8970:Ui,8971:Ui,8994:Pi,8995:Pi,9651:Pa,9657:aa,9661:Pa,9667:aa,9711:mi,9824:da,9825:da,9826:da,9827:da,9837:[0,.75,0,0,.44722],9838:oa,9839:oa,10216:cr,10217:cr,10815:rr,10927:wi,10928:wi,57376:To},"Main-BoldItalic":{32:Yn,33:[0,.69444,.11417,0,.38611],34:Fi,35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:ni,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:Xi,49:Xi,50:Xi,51:Xi,52:Si,53:Xi,54:Xi,55:Si,56:Xi,57:Xi,58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:Bi,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:Ir,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:ti,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:ti,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:Yn,168:[0,.69444,.11473,0,.59111],176:ii,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:Hr,248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:Hr,567:[.19444,.44444,.04611,0,.385],710:Ir,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:ni,730:ii,732:Bi,733:Bi,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:Oi,934:[0,.68611,.05632,0,.82666],936:Oi,937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:ni,8217:ni,8220:[0,.69444,.16772,0,.62055],8221:Fi},"Main-Italic":{32:Yn,33:zi,34:Ss,35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:zi,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:hi,49:hi,50:hi,51:hi,52:ui,53:hi,54:hi,55:ui,56:hi,57:hi,58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:Fa,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:Zi,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:Zi,79:za,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:Zi,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:Ti,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:ai,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:ai,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:Yn,168:[0,.66786,.10474,0,.51111],176:Mo,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:Mi,248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:Mi,710:Ti,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:Mo,732:[0,.66786,.11585,0,.51111],733:Fa,915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:za,923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:Zi,931:[0,.68333,.12028,0,.71555],933:no,934:[0,.68333,.05986,0,.71555],936:no,937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:zi,8217:zi,8220:[0,.69444,.1685,0,.51444],8221:Ss,8463:Or},"Main-Regular":{32:Yn,33:fo,34:$i,35:zd,36:Ys,37:Kd,38:bo,39:fo,40:Ma,41:Ma,42:Hd,43:Wi,44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:Ya,48:ha,49:ha,50:ha,51:ha,52:ha,53:ha,54:ha,55:ha,56:ha,57:ha,58:ka,59:[.19444,.43056,0,0,.27778],60:Pn,61:We,62:Pn,63:wa,64:bo,65:ko,66:[0,.68333,0,0,.70834],67:No,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:Lo,76:ro,77:[0,.68333,0,0,.91667],78:ko,79:Lo,80:ns,81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:No,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:Ya,93:Oa,94:$i,95:[.31,.12056,.02778,0,.5],97:Do,98:Ao,99:rs,100:Ao,101:rs,102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:Ao,105:qi,106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:fo,109:[0,.43056,0,0,.83334],110:di,111:Do,112:Ci,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:di,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:Ya,124:Oa,125:Ya,126:[.35,.31786,0,0,.5],160:Yn,163:[0,.69444,0,0,.76909],167:Na,168:Ka,172:[0,.43056,0,0,.66667],176:$a,177:Wi,182:Vo,184:Ac,198:[0,.68333,0,0,.90278],215:Wi,216:[.04861,.73194,0,0,.77778],223:$i,230:[0,.43056,0,0,.72222],247:Wi,248:[.09722,.52778,0,0,.5],305:ka,338:[0,.68333,0,0,1.01389],339:Ec,567:[.19444,.43056,0,0,.30556],710:$i,711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:$i,715:$i,728:$i,729:qi,730:$a,732:Ka,733:$i,915:ro,916:Kl,920:Lo,923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:ko,931:No,933:Lo,934:No,936:Lo,937:No,8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:fo,8217:fo,8220:$i,8221:$i,8224:Na,8225:Na,8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:Or,8465:so,8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:so,8501:Li,8592:kr,8593:lo,8594:kr,8595:lo,8596:kr,8597:Ya,8598:La,8599:La,8600:La,8601:La,8614:[.011,.511,0,0,1],8617:bl,8618:bl,8636:kr,8637:kr,8640:kr,8641:kr,8652:[.011,.671,0,0,1],8656:kr,8657:Vo,8658:kr,8659:Vo,8660:kr,8661:[.25,.75,0,0,.61111],8704:Ao,8706:[0,.69444,.05556,.08334,.5309],8707:Ao,8709:Ys,8711:Kl,8712:Hl,8715:Hl,8722:Wi,8723:Wi,8725:Ya,8726:Ya,8727:Ii,8728:Cs,8729:Cs,8730:[.2,.8,0,0,.83334],8733:Ec,8734:Vr,8736:St,8739:Oa,8741:Ya,8743:is,8744:is,8745:is,8746:is,8747:[.19444,.69444,.11111,0,.41667],8764:We,8768:[.19444,.69444,0,0,.27778],8771:xl,8773:[-.022,.589,0,0,1],8776:Go,8781:xl,8784:[-.133,.67,0,0,.778],8801:xl,8804:xn,8805:xn,8810:as,8811:as,8826:Pn,8827:Pn,8834:Pn,8835:Pn,8838:xn,8839:xn,8846:is,8849:xn,8850:xn,8851:is,8852:is,8853:Wi,8854:Wi,8855:Wi,8856:Wi,8857:Wi,8866:Li,8867:Li,8868:bo,8869:bo,8872:[.249,.75,0,0,.867],8900:Cs,8901:[-.05555,.44445,0,0,.27778],8902:Ii,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:Ja,8995:Ja,9136:Aa,9137:Aa,9651:xo,9657:Ii,9661:xo,9667:Ii,9711:La,9824:po,9825:po,9826:po,9827:po,9837:[0,.75,0,0,.38889],9838:Ha,9839:Ha,10216:Ma,10217:Ma,10222:Aa,10223:Aa,10229:[.011,.511,0,0,1.609],10230:Bo,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:Bo,10815:ko,10927:xn,10928:xn,57376:To},"Math-BoldItalic":{32:Yn,48:wo,49:wo,50:wo,51:os,52:os,53:os,54:qn,55:os,56:qn,57:os,65:yn,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:Mu,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:Yn,915:[0,.68611,.15972,0,.65694],916:ir,920:[0,.68611,.03194,0,.86722],923:Eu,926:[0,.68611,.07458,0,.84125],928:Mu,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:Mc,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:Mc,1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:Yn,48:Do,49:Do,50:Do,51:Sl,52:Sl,53:Sl,54:ha,55:Sl,56:ha,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:kc,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:ku,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:Yn,915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:ku,923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:kc,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:Yn,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:Es,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:Da,49:Da,50:Da,51:Da,52:Da,53:Da,54:Da,55:Da,56:Da,57:Da,58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:$d,64:ss,65:ss,66:ss,67:Vl,68:_s,69:[0,.69444,0,0,.64167],70:Li,71:ss,72:_s,73:[0,.69444,0,0,.33056],74:$d,75:Lc,76:Du,77:[0,.69444,0,0,.97778],78:_s,79:_s,80:Vl,81:[.10556,.69444,0,0,.79445],82:Vl,83:Li,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:Ms,91:Qs,93:Qs,94:Da,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:Au,111:[0,.45833,0,0,.55],112:Gl,113:Gl,114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:Au,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:Yn,168:Da,176:ss,180:Da,184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:Da,711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:Da,729:Es,730:ss,732:Da,733:Da,915:Du,916:[0,.69444,0,0,.91667],920:tl,923:Ms,926:ss,928:_s,931:_s,933:tl,934:_s,936:tl,937:_s,8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:Es,8217:Es,8220:ls,8221:ls},"SansSerif-Italic":{32:Yn,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:la,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:ks,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:ks,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:Bu,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:Yn,168:[0,.67937,.06385,0,.5],176:Tu,184:Ac,305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:Bu,711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:Rd,715:$i,728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:Tu,732:[0,.67659,.08826,0,.5],733:Rd,915:[0,.69444,.13372,0,.54167],916:Bc,920:[0,.69444,.07555,0,.77778],923:Li,926:[0,.69444,.12816,0,.66667],928:ks,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:Yn,33:[0,.69444,0,0,.31945],34:$i,35:zd,36:Ys,37:Kd,38:[0,.69444,0,0,.75834],39:fo,40:Ma,41:Ma,42:Hd,43:Wi,44:Wd,45:[0,.44444,0,0,.33333],46:Zd,47:Ya,48:fa,49:fa,50:fa,51:fa,52:fa,53:fa,54:fa,55:fa,56:fa,57:fa,58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:wa,64:la,65:la,66:la,67:Qn,68:[0,.69444,0,0,.72223],69:Ba,70:[0,.69444,0,0,.56945],71:la,72:Iu,73:fo,74:wa,75:[0,.69444,0,0,.69445],76:nl,77:[0,.69444,0,0,.875],78:Iu,79:[0,.69444,0,0,.73611],80:Qn,81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:Ao,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:la,89:[0,.69444,.025,0,.66667],90:Li,91:Ul,93:Ul,94:$i,95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:Pu,99:jd,100:Pu,101:jd,102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:Pu,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:Dc,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:Yn,168:[0,.67937,0,0,.5],176:la,184:Ac,305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:$i,711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:$i,715:$i,728:$i,729:[0,.67937,0,0,.27778],730:la,732:[0,.67659,0,0,.5],733:$i,915:nl,916:Bc,920:bo,923:Li,926:la,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:$i,8221:$i},"Script-Regular":{32:Yn,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:Yn},"Size1-Regular":{32:Yn,40:Gd,41:Gd,47:Tc,91:Ic,92:Tc,93:Ic,123:$u,125:$u,160:Yn,710:Xl,732:Xl,770:Xl,771:Xl,8214:[-99e-5,.601,0,0,.77778],8593:Pc,8595:Pc,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:ql,8748:Ud,8749:Ud,8750:ql,8896:Wa,8897:Wa,8898:Wa,8899:Wa,8968:rl,8969:rl,8970:rl,8971:rl,9168:Zc,10216:rl,10217:rl,10752:Ru,10753:Ru,10754:Ru,10756:Wa,10758:Wa},"Size2-Regular":{32:Yn,40:Fu,41:Fu,47:go,91:Ki,92:go,93:Ki,123:Io,125:Io,160:Yn,710:Ro,732:Ro,770:Ro,771:Ro,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:$c,8969:$c,8970:$c,8971:$c,10216:Nc,10217:Nc,10752:al,10753:al,10754:al,10756:il,10758:il},"Size3-Regular":{32:Yn,40:Ku,41:Ku,47:Rc,91:ds,92:Rc,93:ds,123:Yl,125:Yl,160:Yn,710:Jl,732:Jl,770:Jl,771:Jl,8730:[.95003,1.45,0,0,1],8968:Fc,8969:Fc,8970:Fc,8971:Fc,10216:Yl,10217:Yl},"Size4-Regular":{32:Yn,40:Ql,41:Ql,47:zc,91:Hu,92:zc,93:Hu,123:Kc,125:Kc,160:Yn,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:Fr,34:Fr,35:Fr,36:So,37:So,38:Fr,39:Fr,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:Fr,49:Fr,50:Fr,51:Fr,52:Fr,53:Fr,54:Fr,55:Fr,56:Fr,57:Fr,58:io,59:[.13889,.43056,0,0,.525],60:qd,61:[-.19549,.41562,0,0,.525],62:qd,63:Fr,64:Fr,65:Fr,66:Fr,67:Fr,68:Fr,69:Fr,70:Fr,71:Fr,72:Fr,73:Fr,74:Fr,75:Fr,76:Fr,77:Fr,78:Fr,79:Fr,80:Fr,81:[.13889,.61111,0,0,.525],82:Fr,83:Fr,84:Fr,85:Fr,86:Fr,87:Fr,88:Fr,89:Fr,90:Fr,91:So,92:So,93:So,94:Fr,95:[.09514,0,0,0,.525],96:Fr,97:io,98:Fr,99:io,100:Fr,101:io,102:Fr,103:Sa,104:Fr,105:Fr,106:[.22222,.61111,0,0,.525],107:Fr,108:Fr,109:io,110:io,111:io,112:Sa,113:Sa,114:io,115:io,116:[0,.55358,0,0,.525],117:io,118:io,119:io,120:io,121:Sa,122:io,123:So,124:So,125:So,126:Fr,127:Fr,160:nc,176:Fr,184:[.19445,0,0,0,.525],305:io,567:Sa,711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:Fr,715:Fr,728:Fr,730:Fr,770:Fr,771:Fr,776:Fr,915:Fr,916:Fr,920:Fr,923:Fr,926:Fr,928:Fr,931:Fr,933:Fr,934:Fr,936:Fr,937:Fr,8216:Fr,8217:Fr,8242:Fr,9251:[.11111,.21944,0,0,.525]}},Jd=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,ll=10,ao=.25,Gc=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:[ao,ao,ao],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]},Uc=[0,.5,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],As=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=Yd[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 _l(a){if(cl[a]){const[ve,Se,He]=cl[a],st=`<span class="stretchy" style="height:${He}em"><svg width="100%" height="${He}em" viewBox="0 0 ${ve} ${Se}" preserveAspectRatio="none" ><path fill="currentcolor" d="${Qd[a]}"></path></svg></span>`;return`<span style="display:inline-block;height:${Math.floor(100*He/2)/100}em;min-width:0">${st}</span>`}const[y,b,E,ee]=Xc[a];let re,ae;const fe=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 me=y.map((ve,Se)=>`<span class="${re[Se]}" style=height:${fe}em><svg width=400em height=${fe}em viewBox="0 0 400000 ${E}" preserveAspectRatio="${ae[Se]} slice"><path fill="currentcolor" d="${Qd[ve]}"></path></svg></span>`).join("");return`<span style="display:inline-block;height:${fe}em;min-width:${b}em;">${me}</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=qs(2,16)+re*qs(2,10)+ae,b++}}y.push(E)}return y}var rc=8205,ic=[[rc,1],[65038,2],[127995,5],[129456,4],[917536,96]],Ds,El=[127462,127487];function Ml(a){var y;if(Ds===void 0){Ds={};for(const b of ic)for(let E=b[0];E<=b[0]+b[1]-1;E++)Ds[E]=!0}return(y=Ds[a])!=null?y:!1}function nh(a){return a>=El[0]&&a<=El[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(Ml(re)){const ae=E-1;for(;Ml(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 Bs(a,y){var b,E,ee,re;const ae=[];let fe=a.next();if(fe&&fe!=="\\relax"){if(fe==="\\noexpand")fe=a.next(),fe&&ae.push(fe);else if(fe==="\\obeyspaces")a.obeyspaces=!0;else if(fe==="\\bgroup")ae.push("<{>");else if(fe==="\\egroup")ae.push("<}>");else if(fe==="\\string"){if(fe=a.next(),fe)if(fe.startsWith("\\"))for(const me of fe)ae.push(me==="\\"?"\\backslash":me);else fe==="<{>"?ae.push("\\{"):fe==="<space>"?ae.push("~"):fe==="<}>"&&ae.push("\\}")}else if(fe==="\\csname"){for(;a.peek()==="<space>";)a.next();let me="",ve=!1,Se=[];do{if(Se.length===0)if(/^#[\d?@]$/.test(a.peek())){const He=a.get().slice(1);Se=ps((E=(b=y==null?void 0:y(He))!=null?b:y==null?void 0:y("?"))!=null?E:"\\placeholder{}",y),fe=Se[0]}else fe=a.next(),Se=fe?[fe]:[];ve=Se.length===0,!ve&&fe==="\\endcsname"&&(ve=!0,Se.shift()),ve||(ve=fe==="<$>"||fe==="<$$>"||fe==="<{>"||fe==="<}>"||typeof fe=="string"&&fe.length>1&&fe.startsWith("\\")),ve||(me+=Se.shift())}while(!ve);me&&ae.push("\\"+me),ae.push(...Se)}else if(fe!=="\\endcsname")if(fe.length>1&&fe.startsWith("#")){const me=fe.slice(1);ae.push(...ps((re=(ee=y==null?void 0:y(me))!=null?ee:y==null?void 0:y("?"))!=null?re:"\\placeholder{}",y))}else ae.push(fe)}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 fe=ae.match(/((?:\\%)|[^%])*/);fe!==null&&b.push(fe[0])}const ee=new ih(qe(b.join(""))),re=[];do re.push(...Bs(ee,y));while(!ee.end());return re}function bi(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 na(a,...y){return console.assert(a.startsWith("\\")),y.length===0?a:bi([a,...y.map(b=>`{${b}}`)])}function Ts(a){return bi(a.map(y=>{var b;return(b={"<space>":" ","<$$>":"$$","<$>":"$","<{>":"{","<}>":"}"}[y])!=null?b:y}))}var ah=class Pd{constructor(y){Pd._registry[y]=this}static createAtom(y,b,E){return Pd._registry[y].createAtom(b,Nt(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=Pd._registry[re[0].mode];ee.push(...ae.serialize(re,b))}return bi(ee)}return bi(ef(y,b))}static getFont(y,b,E){return Pd._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 va(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 Gu(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 fe=y.defaultMode;for(const me of va(ae,"color")){const ve=me[0].computedStyle,Se=Co._registry[me[0].mode].serialize(me,_e(we({},y),{defaultMode:fe==="text"?"text":"math"}));!y.skipStyles&&ve.color&&ve.color!=="none"&&(!E||ee!==ve.color)?re.push(na("\\textcolor",(b=ve.verbatimColor)!=null?b:ve.color,bi(Se))):re.push(bi(Se))}}return re}function Qh(a,y){const{parent:b}=a[0],E=b==null?void 0:b.computedStyle.backgroundColor;return va(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 na("\\colorbox",(re=ae.verbatimBackgroundColor)!=null?re:ae.backgroundColor,bi(Gu(ee,_e(we({},y),{defaultMode:"text"}))))}return bi(Gu(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 va(a,"fontSize")){const ae=re[0].computedStyle.fontSize,fe=Qh(re,y);fe&&(ae&&ae!=="auto"&&(!b||E!==ae)?ee.push(["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][ae],...fe):ee.push(...fe))}return ee}function Uu(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 kl(a){if(a.length===0)return"ord";const y=Uu(a[0].type),b=Uu(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 fr=class _p{constructor(y,b){var E,ee,re,ae,fe;if(typeof y=="number"?this.value=String.fromCodePoint(y):typeof y=="string"?this.value=y:Ae(y)?this.children=y.filter(ve=>ve!==null):y&&y instanceof _p&&(this.children=[y]),this.children)for(const ve of this.children)ve.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 me=b==null?void 0:b.fontFamily;b!=null&&b.style&&this.value&&(me=(fe=Co.getFont((ae=b.mode)!=null?ae:"math",this,_e(we({variant:"normal"},b.style),{letterShapeStyle:b.letterShapeStyle})))!=null?fe:void 0),me||(me="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,me)}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 Mt of this.children)re+=Mt.toMarkup();let ae="";if(this.svgBody)ae=_l(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 Mt=(b=this.cssProperties)==null?void 0:b.padding;Mt?(ae+=`top:${Mt};`,ae+=`left:${Mt};`,ae+=`width:calc(100% - 2 * ${Mt} );`):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 fe="";const me=this.classes.split(" ");me.push((E={latex:"ML__raw-latex",placeholder:"ML__placeholder",error:"ML__error"}[this.type])!=null?E:""),this.caret==="latex"&&me.push("ML__latex-caret"),this.isSelected&&me.push("ML__selected");const ve=me.length===1?me[0]:me.filter((Mt,It,gn)=>Mt.length>0&&gn.indexOf(Mt)===It).join(" ");if(ve.length>0&&(fe+=` class="${ve}"`),this.id&&(fe+=` data-atom-id=${this.id}`),this.cssId&&(fe+=` id="${this.cssId.replace(/ /g,"-")}" `),this.attributes&&(fe+=" "+Object.keys(this.attributes).map(Mt=>`${Mt}="${this.attributes[Mt]}"`).join(" ")),this.htmlData){const Mt=this.htmlData.split(",");for(const It of Mt){const gn=It.match(/([^=]+)=(.+$)/);if(gn){const hr=gn[1].trim().replace(/ /g,"-");hr&&(fe+=` data-${hr}="${gn[2]}" `)}else{const hr=It.trim().replace(/ /g,"-");hr&&(fe+=` data-${hr} `)}}}const Se=(ee=this.cssProperties)!=null?ee:{};this.hasExplicitWidth&&Se.width===void 0&&(Se.width=`${Math.ceil(this._width*100)/100}em`);const He=Object.keys(Se).map(Mt=>`${Mt}:${Se[Mt]}`);if(this.scale!==void 0&&this.scale!==1&&(re.length>0||ae.length>0)&&He.push(`font-size: ${Math.ceil(this.scale*1e4)/100}%`),this.htmlStyle){const Mt=this.htmlStyle.split(";");let It="";for(const gn of Mt){const hr=gn.match(/([^=]+):(.+$)/);if(hr){const pn=hr[1].trim().replace(/ /g,"-");pn&&(It+=`${pn}:${hr[2]};`)}}It&&(fe+=` style="${It}"`)}He.length>0&&(fe+=` style="${He.join(";")}"`);let st="";return fe.length>0||ae.length>0?st=`<span${fe}>${re}${ae}</span>`:st=re,this.caret==="text"?st+='<span class="ML__text-caret"></span>':this.caret==="math"&&(st+='<span class="ML__caret"></span>'),st}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 me of["border","border-left","border-right","border-right-width","left","margin","margin-left","margin-right","padding","position","width"])if(y.cssProperties&&me in y.cssProperties||this.cssProperties&&me 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 me of Object.keys(this.cssProperties))if(this.cssProperties[me]!==y.cssProperties[me])return!1}const ae=this.classes.trim().replace(/\s+/g," ").split(" "),fe=y.classes.trim().replace(/\s+/g," ").split(" ");if(ae.length!==fe.length)return!1;ae.sort(),fe.sort();for(const[me,ve]of ae.entries())if(ve==="vertical-separator"||ve!==fe[me])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 qc(a){return a.children&&(a.children=Xu(a.children)),a}function Yc(a,y){if(!a)return new fr(null,y);const b=new fr(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 fr(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 fr(E,_e(we({},y),{type:"lift"}))}function Fo(a){const y=eh(a)/2,b=new fr(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,fe)=>ae+fe.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 fe=y[ae],me=-fe.shift-re-fe.box.depth,ve=me-(b.box.height+b.box.depth);re=re+me,E.push(ve),E.push(fe),b=fe}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 fr(null,{classes:"pstrut"});let re=0;for(const It of b)if(typeof It!="number"){const gn=It.box;re=Math.max(re,gn.maxFontSize,gn.height)}re+=2,ee.height=re,ee.setStyle("height",re,"em");const ae=[];let fe=E,me=E,ve=E,Se=0;for(const It of b){if(typeof It=="number")ve+=It;else{const gn=It.box,hr=(y=It.classes)!=null?y:[],pn=new fr([ee,gn],{classes:hr.join(" "),style:It.style});gn.setStyle("height",gn.height+gn.depth,"em"),gn.setStyle("display","inline-block"),pn.setStyle("top",-re-ve-gn.depth,"em"),It.marginLeft&&pn.setStyle("margin-left",It.marginLeft,"em"),It.marginRight&&pn.setStyle("margin-right",It.marginRight,"em"),ae.push(pn),ve+=gn.height+gn.depth,Se=Math.max(Se,pn.width)}fe=Math.min(fe,ve),me=Math.max(me,ve)}ae.forEach(It=>{It.softWidth=Se});const He=new fr(ae,{classes:"vlist"});if(He.softWidth=Se,He.height=me,He.setStyle("height",me,"em"),fe>=0)return[[new fr(He,{classes:"vlist-r"})],me,-fe];const st=new fr(new fr(null),{classes:"vlist"});st.height=-fe,st.setStyle("height",-fe,"em");const Mt=new fr(8203,{classes:"vlist-s",maxFontSize:0});return Mt.softWidth=0,Mt.height=0,Mt.depth=0,[[new fr([He,Mt],{classes:"vlist-r"}),new fr(st,{classes:"vlist-r"})],me,-fe]}var Yi=class extends fr{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,fe)=>Math.max(ae,fe.width),0)}};function tf(a,y){var b,E,ee,re,ae;const fe=a.metrics,me=new fr(y.base),ve=(b=y.baseShift)!=null?b:0,Se=(E=y.slant)!=null?E:0;let He=0,st=0;y.above&&(He=(ee=y.aboveShift)!=null?ee:Math.max(fe.bigOpSpacing1,fe.bigOpSpacing3-y.above.depth)),y.below&&(st=(re=y.belowShift)!=null?re:Math.max(fe.bigOpSpacing2,fe.bigOpSpacing4-y.below.height));let Mt=null;if(y.below&&y.above){const It=fe.bigOpSpacing5+y.below.height+y.below.depth+st+me.depth+ve;Mt=new Yi({bottom:It,children:[fe.bigOpSpacing5,{box:y.below,marginLeft:-Se,classes:["ML__center"]},st,{box:me,classes:["ML__center"]},He,{box:y.above,marginLeft:Se,classes:["ML__center"]},fe.bigOpSpacing5]}).wrap(a)}else if(y.below&&!y.above)Mt=new Yi({top:me.height-ve,children:[fe.bigOpSpacing5,{box:y.below,marginLeft:-Se,classes:["ML__center"]},st,{box:me,classes:["ML__center"]}]}).wrap(a);else if(!y.below&&y.above){const It=me.depth+ve;Mt=new Yi({bottom:It,children:[{box:me,classes:["ML__center"]},He,{box:y.above,marginLeft:Se,classes:["ML__center"]},fe.bigOpSpacing5]}).wrap(a)}else{const It=me.depth+ve;Mt=new Yi({bottom:It,children:[{box:me},fe.bigOpSpacing5]}).wrap(a)}return new fr(Mt,{type:(ae=y.type)!=null?ae:"op"})}var qu=7,ms=6,sc=5,Is=4,ul=3,oo=2,Po=1,Za=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)=>_e(we({},ee),{[re]:ju[re][E]}),{})}getFontSize(a){return Math.max(1,a+this.sizeDelta)}get sup(){return Xo[[Za,Po,Za,Po,oo,ul,oo,ul][this.id]]}get sub(){return Xo[[Za,Za,Za,Za,oo,oo,oo,oo][this.id]]}get fracNum(){return Xo[[Za,Po,Za,Po,oo,ul,Is,sc][this.id]]}get fracDen(){return Xo[[Za,Za,Za,Za,oo,oo,Is,Is][this.id]]}get cramp(){return Xo[[Za,Za,oo,oo,Is,Is,ms,ms][this.id]]}get isTight(){return this.sizeDelta<0}},dl={7:new Uo(qu,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(oo,-3,!0),1:new Uo(Po,-4,!1),0:new Uo(Za,-4,!0)},Xo=_e(we({},dl),{displaystyle:dl[qu],textstyle:dl[sc],scriptstyle:dl[ul],scriptscriptstyle:dl[Po]});function Al(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=qs(10,y);return Math.round(a.dimension/ll*E*ee)/ee}return a.dimension*E}function Yu(a,y){if(a===null)return 0;const b=Al(a)/ll;if(Number.isFinite(y)){const E=qs(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 Ca(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 qo(a,y){return a==null?null:"number"in a?_e(we({},a),{number:a.number*y}):"register"in a?"factor"in a&&a.factor?_e(we({},a),{factor:a.factor*y}):_e(we({},a),{factor:y}):"dimension"in a?_e(we({},a),{dimension:a.dimension*y}):"glue"in a?a.shrink&&a.grow?{glue:qo(a.glue,y),shrink:qo(a.shrink,y),grow:qo(a.grow,y)}:a.shrink?{glue:qo(a.glue,y),shrink:qo(a.shrink,y)}:a.grow?{glue:qo(a.glue,y),grow:qo(a.grow,y)}:{glue:qo(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 Dl(){return we({},nf)}function Qc(){return{registers:Dl(),smartFence:!1,renderPlaceholder:void 0,placeholderSymbol:"\u25A2",letterShapeStyle:it.locale.startsWith("fr")?"french":"tex",minFontScale:0,colorMap:Dt,backgroundColorMap:Ge,getMacro:a=>vn(a,an())}}var Ei=class Ep{constructor(y,b){var E,ee,re,ae,fe,me,ve,Se,He,st,Mt,It,gn,hr,pn;let On;y!=null&&y.parent?(this.parent=y.parent,On=y.parent,this.registers={}):(On=we(we({},Qc()),(E=y==null?void 0:y.from)!=null?E:{}),this.registers=On.registers),On.atomIdsSettings&&(this.atomIdsSettings=we({},On.atomIdsSettings)),this.renderPlaceholder=On.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=On.letterShapeStyle,this.minFontScale=On.minFontScale,b!=null&&b.color&&b.color!=="none"?this.color=b.color:this.color=(me=(fe=this.parent)==null?void 0:fe.color)!=null?me:"",b!=null&&b.backgroundColor&&b.backgroundColor!=="none"?this.backgroundColor=b.backgroundColor:this.backgroundColor=(Se=(ve=this.parent)==null?void 0:ve.backgroundColor)!=null?Se:"",b!=null&&b.fontSize&&b.fontSize!=="auto"&&b.fontSize!==((He=this.parent)==null?void 0:He.size)?this.size=b.fontSize:this.size=(Mt=(st=this.parent)==null?void 0:st.size)!=null?Mt:As;let gr=(gn=(It=this.parent)==null?void 0:It.mathstyle)!=null?gn:Xo.displaystyle;if(typeof(y==null?void 0:y.mathstyle)=="string"){if(On instanceof Ep)switch(y.mathstyle){case"cramp":gr=gr.cramp;break;case"superscript":gr=gr.sup;break;case"subscript":gr=gr.sub;break;case"numerator":gr=gr.fracNum;break;case"denominator":gr=gr.fracDen;break}switch(y.mathstyle){case"textstyle":gr=Xo.textstyle;break;case"displaystyle":gr=Xo.displaystyle;break;case"scriptstyle":gr=Xo.scriptstyle;break;case"scriptscriptstyle":gr=Xo.scriptscriptstyle;break;case"":case"auto":break}}this.mathstyle=gr,this.smartFence=On.smartFence,this.placeholderSymbol=On.placeholderSymbol,this.colorMap=(hr=On.colorMap)!=null?hr:Un=>Un,this.backgroundColorMap=(pn=On.backgroundColorMap)!=null?pn:Un=>Un,this.getMacro=On.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===qu||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(Uc[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 Yu(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?_e(we({},re),{dimension:E*re.dimension}):"glue"in re?_e(we({},re),{glue:_e(we({},re.glue),{dimension:E*re.glue.dimension}),shrink:re.shrink?_e(we({},re.shrink),{dimension:E*re.shrink.dimension}):void 0,grow:re.grow?_e(we({},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:Al(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}},Bl=["body","above","below","superscript","subscript"];function gs(a){return typeof a=="string"&&Bl.includes(a)}function lc(a){return a!==void 0&&Array.isArray(a)&&a.length===2}var An=class vl{constructor(y){var b,E,ee,re,ae,fe;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=we({},y.style),this.displayContainsHighlight=(re=y.displayContainsHighlight)!=null?re:!1,this.captureSelection=(ae=y.captureSelection)!=null?ae:!1,this.skipBoundary=(fe=y.skipBoundary)!=null?fe:!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 me of re){const ve=me[0].style,Se=ch(y,me,{style:{color:ve.color,backgroundColor:ve.backgroundColor,fontSize:ve.fontSize}});Se&&ae.push(Se)}if(ae.length===0)return null;const fe=((ee=E==null?void 0:E.classes)!=null?ee:"").trim();return ae.length===1&&!fe&&!(E!=null&&E.type)?ae[0].wrap(y):new fr(ae,{classes:fe,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=we({},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=Nt(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):this.body&&this.command?bi([na(this.command,this.bodyToLatex(y)),this.supsubToLatex(y)]):this.body?bi([this.bodyToLatex(y),this.supsubToLatex(y)]):!this.value||this.value==="\u200B"?"":this.command}bodyToLatex(y){var b;return Co.serialize(this.body,_e(we({},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=_e(we({},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 Bl)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=we(we({},(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=we(we({},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 Bl)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=Nt(this.command,this.mode);if(b!=null&&b.render)return b.render(this,y);const E=new Ei({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 fe=null,me=null;const ve=(E=b.isCharacterBox)!=null?E:this.isCharacterBox();let Se=0;if(re){const gn=new Ei({parent:y,mathstyle:"superscript"});fe=vl.createBox(gn,re),ve||(Se=ee.height-y.metrics.supDrop*gn.scalingFactor)}let He=0;if(ae){const gn=new Ei({parent:y,mathstyle:"subscript"});me=vl.createBox(gn,ae),ve||(He=ee.depth+y.metrics.subDrop*gn.scalingFactor)}let st;y.isDisplayStyle?st=y.metrics.sup1:y.isCramped?st=y.metrics.sup3:st=y.metrics.sup2;const Mt=.5/ll/y.scalingFactor;let It=null;if(me&&fe){Se=Math.max(Se,st,fe.depth+.25*y.metrics.xHeight),He=Math.max(He,y.metrics.sub2);const gn=y.metrics.defaultRuleThickness;if(Se-fe.depth-(me.height-He)<4*gn){He=4*gn-(Se-fe.depth)+me.height;const pn=.8*y.metrics.xHeight-(Se-fe.depth);pn>0&&(Se+=pn,He-=pn)}const hr=this.isExtensibleSymbol&&ee.italic?-ee.italic:0;It=new Yi({individualShift:[{box:me,shift:He,marginLeft:hr},{box:fe,shift:-Se}]}).wrap(y)}else me&&!fe?(He=Math.max(He,y.metrics.sub1,me.height-.8*hs),It=new Yi({shift:He,children:[{box:me,marginRight:Mt,marginLeft:this.isCharacterBox()?-ee.italic:0}]})):!me&&fe&&(Se=Math.max(Se,st,fe.depth+.25*hs),It=new Yi({shift:-Se,children:[{box:fe,marginRight:Mt}]}));return new fr([ee,new fr(It,{caret:this.caret,isSelected:this.isSelected,classes:"msubsup"})],{type:b.type})}attachLimits(y,b){const E=this.superscript?vl.createBox(new Ei({parent:y,mathstyle:"superscript"},this.style),this.superscript):null,ee=this.subscript?vl.createBox(new Ei({parent:y,mathstyle:"subscript"},this.style),this.subscript):null;return!E&&!ee?b.base.wrap(y):tf(y,_e(we({},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 fe=(E=this.value)!=null?E:this.body,me=(ee=b==null?void 0:b.boxType)!=null?ee:Uu(this.type);let ve=(re=b==null?void 0:b.classes)!=null?re:"";this.mode==="text"&&(ve+=" ML__text");const Se=typeof fe=="string"||fe===void 0?new fr(fe!=null?fe:null,{type:me,isSelected:this.isSelected,mode:this.mode,maxFontSize:y.scalingFactor,style:_e(we({variant:"normal"},this.style),{fontSize:Math.max(1,y.size+y.mathstyle.sizeDelta)}),letterShapeStyle:y.letterShapeStyle,classes:ve}):(ae=vl.createBox(y,fe,{type:me,classes:ve}))!=null?ae:new fr(null);return y.isTight&&(Se.isTight=!0),(this.mode!=="math"||this.style.variant==="main")&&(Se.italic=0),Se.right=Se.italic,this.bind(y,Se),this.caret&&!this.superscript&&!this.subscript&&(Se.caret=this.caret),Se}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,fe;if(!y||y.length===0)return null;const me=new Ei({parent:a},b.style),ve=!((E=me.atomIdsSettings)!=null&&E.groupNumbers);let Se=[];if(y.length===1){const st=y[0],Mt=st.render(me);Mt&&(ve&&st.isSelected&&Mt.selected(!0),Se=[Mt])}else{let st="",Mt=!0;for(const It of y){(ee=me.atomIdsSettings)!=null&&ee.groupNumbers&&st&&(Mt&&It.isDigit()||!Mt&&Qu(It))&&(me.atomIdsSettings.overrideID=st);const gn=It.render(me);me.atomIdsSettings&&(me.atomIdsSettings.overrideID=void 0),gn&&((re=me.atomIdsSettings)!=null&&re.groupNumbers&&((It.isDigit()||Qu(It))&&(!st||Mt!==It.isDigit())&&(Mt=It.isDigit(),st=(ae=It.id)!=null?ae:""),st&&(!(It.isDigit()||Qu(It))||!It.hasEmptyBranch("superscript")||!It.hasEmptyBranch("subscript"))&&(st="")),ve&&It.isSelected&&gn.selected(!0),Se.push(gn))}}if(Se.length===0)return null;const He=new fr(Se,_e(we({isTight:me.isTight},b),{type:(fe=b.type)!=null?fe:"lift"}));return He.isSelected=Se.every(st=>st.isSelected),He.wrap(me)}function Qu(a){return a.mode==="text"}function ed(a){return a.map(y=>y===null?"<null>":Array.isArray(y)&&y[0]instanceof An?{atoms:y.map(b=>b.toJson())}:typeof y=="object"&&"group"in y?{group:y.group.map(b=>b.toJson())}:y)}var vs=class Mp extends An{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 Mp(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:mn("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 ja(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 Ps(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,fe=!1,me=!1,ve=!1,Se=!1,He=!1,st=!1,Mt=!1,It=!1,gn=!1,hr=!1,pn=a[0],On=0;for(;pn!=null&&pn.type&&/^(subsup|placeholder)$/.test(pn.type);)On+=1,pn=a[On];return b=!pn||pn.type==="first",pn&&(gn=pn.mode==="text",E=!gn&&pn.type==="mord"&&he.test(pn.value),ee=!gn&&pn.type==="mord"&&/\d+$/.test(pn.value),re=!gn&&pn.isFunction,ae=pn.type==="genfrac",fe=pn.type==="surd",me=pn.type==="mbin",ve=pn.type==="mrel",Se=pn.type==="mop"||pn.type==="operator"||pn.type==="extensible-symbol",He=pn.type==="mpunct"||pn.type==="minner",st=pn.type==="array",Mt=pn.type==="mopen",It=pn.type==="mclose"||pn.type==="leftright",hr=pn.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")&&fe||y.after.includes("binop")&&me||y.after.includes("relop")&&ve||y.after.includes("operator")&&Se||y.after.includes("punct")&&He||y.after.includes("array")&&st||y.after.includes("openfence")&&Mt||y.after.includes("closefence")&&It||y.after.includes("text")&&gn||y.after.includes("space")&&hr?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 fe=(b=y.inlineShortcuts)!=null?b:dh;if(!re&&(a.startsWith("^")||a.startsWith("_"))&&(ae=Os(a.slice(1),{inlineShortcuts:fe,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:fe,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:fe,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:fe,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],fe),a+=Qa(ae[2],y),re=!0)),!re&&/^([fgh])[^a-zA-Z]/.test(a)&&(ae=Os(a.slice(1),{inlineShortcuts:fe,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],fe),a+=Qa(ae[2],y),re=!0)),!re)if(ae=Os(a,{inlineShortcuts:fe,noWrap:!0}),ae.match&&ae.rest[0]==="/"){const me=Os(ae.rest.slice(1),{inlineShortcuts:fe,noWrap:!0});me.match&&(a="\\frac{"+ae.match+"}{"+me.match+"}"+Qa(me.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,fe=1;for(;fe<a.length&&ae>0;)a[fe]===ee&&ae++,a[fe]===re&&ae--,fe++;ae===0?(y.noWrap&&ee==="("?b=Qa(a.substring(1,fe-1),y):(ee==="{"&&re==="}"&&(ee="\\{",re="\\}"),b="\\left"+ee+Qa(a.substring(1,fe-1),y)+"\\right"+re),E=a.slice(Math.max(0,fe))):(b=a.substring(1,fe),E="")}else{let ae=a.match(/^([a-zA-Z]+)/);if(ae){let fe=td(null,a,y.inlineShortcuts);if(fe)return fe=fe.replace("_{#?}",""),fe=fe.replace("^{#?}",""),{match:fe,rest:a.slice(fe.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 $s(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]=$s(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]:ja(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]:ja(ee.selection);let ae=ee.getAtoms(re);if(ae.every(fe=>fe.mode==="text"||!fe.mode))b.clipboardData.setData("text/plain",ae.filter(fe=>fe instanceof vs).map(fe=>fe.value).join(""));else if(ae.every(fe=>fe.mode==="latex"))b.clipboardData.setData("text/plain",ee.getAtoms(re,{includeChildren:!0}).map(fe=>{var me;return(me=fe.value)!=null?me:""}).join(""));else{let fe;ae.length===1&&ae[0].verbatimLatex!==void 0?fe=ae[0].verbatimLatex:fe=ee.getValue(re,"latex-expanded"),b.clipboardData.setData("application/x-latex",fe);try{b.clipboardData.setData("text/plain",y.options.onExport(y,fe,re))}catch(me){}if(ae.length===1){const me=ae[0];(me.type==="root"||me.type==="group")&&(ae=me.body.filter(ve=>ve.type!=="first"))}try{b.clipboardData.setData("application/json+mathlive",JSON.stringify(ae.map(me=>me.toJson())))}catch(me){}if((E=window[Symbol.for("io.cortexjs.compute-engine")])!=null&&E.ComputeEngine){const me=window.MathfieldElement.computeEngine;if(me)try{const ve=me.jsonSerializationOptions;me.jsonSerializationOptions={metadata:["latex"]};const Se=me.parse(ee.getValue(re,"latex-unstyled"));me.jsonSerializationOptions=ve;const He=JSON.stringify(Se.json);He&&b.clipboardData.setData("application/json",He)}catch(ve){}}}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 oi=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 zo(a){var y;return((y=a.element)==null?void 0:y.mathfield)===a}function Ko(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=Ko(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),fe=Math.ceil(y.top-E.top);return{left:ae,right:ae+ee,top:fe,bottom:fe+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 Tl(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 me=Math.floor(re.getBoundingClientRect().width)/ae;me=isNaN(me)?1:me;const ve=ad(a,Tl(a,ee),me);if(ve){const Se=id(ee);if(E.has(Se)){const He=E.get(Se);E.set(Se,{left:Math.min(He.left,ve.left),right:Math.max(He.right,ve.right),top:Math.min(He.top,ve.top),bottom:Math.max(He.bottom,ve.bottom)})}else E.set(Se,ve)}}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;
}
`,Ji;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 Pl(a){return Ji||(Ji={}),Ji[a]||(Ji[a]=new CSSStyleSheet,Ji[a].replaceSync(hl(a))),Ji[a]}var ys;function Oo(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=Pl(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=Ji[a];document.adoptedStyleSheets=document.adoptedStyleSheets.filter(b=>b!==y)}}var z=class kp extends An{constructor(y){var b;super(_e(we({},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 kp(y)}toJson(){return _e(we({},super.toJson()),{accentChar:this.accent,svgAccent:this.svgAccent})}render(y){var b;const E=new Ei({parent:y,mathstyle:"cramp"},this.style),ee=(b=An.createBox(E,this.body))!=null?b:new fr("\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),fe;if(this.svgAccent)fe=Fo(this.svgAccent),ae=E.metrics.bigOpSpacing1-ae;else if(this.accent){const ve=new fr(this.accent,{fontFamily:"Main-Regular"});ve.italic=0;const Se=this.accent===8407?" ML__accent-vec":"";fe=new fr(new fr(ve),{classes:"ML__accent-body"+Se})}fe=new Yi({shift:0,children:[{box:new fr(ee)},-ae,{box:fe,marginLeft:ee.left+2*re,classes:["ML__center"]}]});const me=new fr(fe,{type:"lift"});return this.caret&&(me.caret=this.caret),this.bind(E,me.wrap(E)),this.attachSupsub(E,{base:me})}},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 de(a,y,b,E){var ee;const ae=new fr(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)*ao),ae}function ge(a,y,b,E,ee){var re,ae;const fe=new Ei({parent:E,mathstyle:"textstyle"},ee==null?void 0:ee.style),me=new fr(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(fe);return b&&me.setTop((1-fe.scalingFactor)*ao),me}function Ce(a,y,b,E,ee){var re;let ae,fe,me,ve;ae=me=ve=ie(a),fe=null;let Se="Size1-Regular";a==="\\vert"||a==="\\lvert"||a==="\\rvert"||a==="\\mvert"||a==="\\mid"?me=ae=ve=8739:a==="\\Vert"||a==="\\lVert"||a==="\\rVert"||a==="\\mVert"||a==="\\|"?me=ae=ve=8741:a==="\\uparrow"?me=ve=9168:a==="\\Uparrow"?me=ve=8214:a==="\\downarrow"?ae=me=9168:a==="\\Downarrow"?ae=me=8214:a==="\\updownarrow"?(ae=8593,me=9168,ve=8595):a==="\\Updownarrow"?(ae=8657,me=8214,ve=8659):a==="["||a==="\\lbrack"?(ae=9121,me=9122,ve=9123,Se="Size4-Regular"):a==="]"||a==="\\rbrack"?(ae=9124,me=9125,ve=9126,Se="Size4-Regular"):a==="\\lfloor"||a==="\u230A"?(me=ae=9122,ve=9123,Se="Size4-Regular"):a==="\\lceil"||a==="\u2308"?(ae=9121,me=ve=9122,Se="Size4-Regular"):a==="\\rfloor"||a==="\u230B"?(me=ae=9125,ve=9126,Se="Size4-Regular"):a==="\\rceil"||a==="\u2309"?(ae=9124,me=ve=9125,Se="Size4-Regular"):a==="("||a==="\\lparen"?(ae=9115,me=9116,ve=9117,Se="Size4-Regular"):a===")"||a==="\\rparen"?(ae=9118,me=9119,ve=9120,Se="Size4-Regular"):a==="\\{"||a==="\\lbrace"?(ae=9127,fe=9128,ve=9129,me=9130,Se="Size4-Regular"):a==="\\}"||a==="\\rbrace"?(ae=9131,fe=9132,ve=9133,me=9130,Se="Size4-Regular"):a==="\\lgroup"||a==="\u27EE"?(ae=9127,ve=9129,me=9130,Se="Size4-Regular"):a==="\\rgroup"||a==="\u27EF"?(ae=9131,ve=9133,me=9130,Se="Size4-Regular"):a==="\\lmoustache"||a==="\u23B0"?(ae=9127,ve=9133,me=9130,Se="Size4-Regular"):a==="\\rmoustache"||a==="\u23B1"?(ae=9131,ve=9129,me=9130,Se="Size4-Regular"):a==="\\surd"?(ae=57345,ve=9143,me=57344,Se="Size4-Regular"):a==="\\ulcorner"?(ae=9484,me=ve=32):a==="\\urcorner"?(ae=9488,me=ve=32):a==="\\llcorner"?(ve=9492,me=ae=32):a==="\\lrcorner"&&(ae=9496,me=ae=32);const He=fs(ae,Se),st=He.height+He.depth,Mt=fs(me,Se),It=Mt.height+Mt.depth,gn=fs(ve,Se),hr=gn.height+gn.depth;let pn=0,On=1;if(fe!==null){const Xa=fs(fe,Se);pn=Xa.height+Xa.depth,On=2}const gr=st+hr+pn,Un=Math.max(0,Math.ceil((y-gr)/(On*It))),zr=gr+Un*On*It;let Xr=ao;b&&(Xr=Xr*E.scalingFactor);const jr=zr/2-Xr,ki=.008,Gi=[];Gi.push({box:new fr(ve,{fontFamily:Se})}),Gi.push(-ki);const Sr=new fr(me,{fontFamily:Se});if(fe===null)for(let Xa=0;Xa<Un;Xa++)Gi.push({box:Sr});else{for(let Xa=0;Xa<Un;Xa++)Gi.push({box:Sr});Gi.push(-ki),Gi.push({box:new fr(fe,{fontFamily:Se})}),Gi.push(-ki);for(let Xa=0;Xa<Un;Xa++)Gi.push({box:Sr})}Gi.push(-ki),Gi.push({box:new fr(ae,{fontFamily:Se})});let Zo="";Se==="Size1-Regular"?Zo=" delim-size1":Se==="Size4-Regular"&&(Zo=" delim-size4");const js=new Yi({bottom:jr,children:Gi},{classes:Zo});return new fr(js,_e(we({},ee!=null?ee:{}),{classes:((re=ee==null?void 0:ee.classes)!=null?re:"")+" ML__delim-mult"}))}var ke=new Set(["(",")","\\lparen","\\rparen","[","]","\\lbrack","\\rbrack","\\{","\\}","\\lbrace","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd","\u230A","\u230B","\u2308","\u2309"]),Ke=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache","\u27EE","\u27EF","\u23B0","\u23B1"]),Et=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Pt=[0,1.2,1.8,2.4,3];function cn(a,y,b,E){return a===void 0||a==="."?Rr(b,E.classes):(a==="<"||a==="\\lt"||a==="\u27E8"?a="\\langle":(a===">"||a==="\\gt"||a==="\u27E9")&&(a="\\rangle"),ke.has(a)||Et.has(a)?ge(a,y,!1,b,E):Ke.has(a)?Ce(a,Pt[y],!1,b,E):(console.assert(!1,"Unknown delimiter '"+a+"'"),null))}var rn=[{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}],Bn=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"stack"}],nr=[{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 xr(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,xr(b[re]));if(ae.defaultMetrics)return{type:"small",mathstyle:"scriptstyle"};let fe=ae.height+ae.depth;if(b[re].type==="small"&&(b[re].mathstyle==="scriptscriptstyle"?fe*=Math.max(Uc[Math.max(1,E.size-2)],E.minFontScale):b[re].mathstyle==="scriptstyle"&&(fe*=Math.max(Uc[Math.max(1,E.size-1)],E.minFontScale))),fe>y)return b[re]}return b[b.length-1]}function Pr(a,y,b,E,ee,re){if(!y||y.length===0||y===".")return Rr(ee);y==="<"||y==="\\lt"?y="\\langle":(y===">"||y==="\\gt")&&(y="\\rangle");let ae;Et.has(y)?ae=rn:ke.has(y)?ae=nr:ae=Bn;const fe=Lr(ie(y),b,ae,ee),me=new Ei({parent:ee,mathstyle:fe.mathstyle},re==null?void 0:re.style);return fe.type==="small"?de(y,me,E,_e(we({},re),{type:a})):fe.type==="large"?ge(y,fe.size,E,me,_e(we({},re),{type:a})):(console.assert(fe.type==="stack"),Ce(y,b,E,me,_e(we({},re),{type:a})))}function Mr(a,y,b,E,ee,re){if(y===".")return Rr(ee,re==null?void 0:re.classes);const ae=ao*ee.scalingFactor,fe=901,me=5/ll,ve=Math.max(b-ae,E+ae),Se=Math.max(ve/500*fe,2*ve-me);return Pr(a,y,Se,!0,ee,re)}function Rr(a,y){const b=new fr(null,{classes:" nulldelimiter "+(y!=null?y:""),type:"ignore"});return b.width=a.getRegisterAsEm("nulldelimiterspace"),b.wrap(new Ei({parent:a,mathstyle:"textstyle"}))}var Jr=class Lp extends An{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{}"}},Qr=["matrix","matrix*","pmatrix","pmatrix*","bmatrix","bmatrix*","Bmatrix","Bmatrix*","vmatrix","vmatrix*","Vmatrix","Vmatrix*"],xi=["cases","dcases","rcases"],Qi=["align","align*","aligned","gather","gathered","split"],Ra=["array","subequations","eqnarray"];function ca(a){return Ra.concat(Qi).concat(xi).concat(Qr).includes(a)}function co(a){return Qr.includes(a)}function uo(a){return xi.includes(a)}function _a(a){return Qi.includes(a)}function ho(a,y,b){let E=0;for(const ve of b)"align"in ve&&(E+=1);let ee=0;const re=[];for(const ve of y){let Se=0;for(ee=Math.max(ee,Math.min(ve.length,E));Se<ve.length;){const He=[],st=Math.min(ve.length,Se+E);for(;Se<st;){const Mt=ve[Se];Mt.length===0?He.push([new An({type:"first",mode:a.mode})]):Mt[0].type!=="first"?He.push([new An({type:"first",mode:a.mode}),...Mt]):(console.assert(!Mt.slice(1).some(It=>It.type==="first")),He.push(Mt)),Se+=1}re.push(He)}}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 ve of re){if(ve.length!==ee)for(let Se=ve.length;Se<ee;Se++)ve.push([new An({type:"first",mode:a.mode}),new Jr]);ae.push(ve)}let fe=0,me=0;for(const ve of ae){me=0;for(const Se of ve){for(const He of Se)He.parent=a,He.parentBranch=[fe,me];me+=1}fe+=1}return a.isDirty=!0,ae}var li=class Ap extends An{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 Ap(y.environmentName,y.array,y.rowGaps,y)}toJson(){const y=_e(we({},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,fe;const me=new Ei({parent:y,mathstyle:this.mathstyleName},this.style),ve=me.getRegisterAsEm("arrayrulewidth"),Se=me.getRegisterAsEm("arraycolsep"),He=me.getRegisterAsEm("doublerulesep"),st=(E=(b=this.arraystretch)!=null?b:me.getRegisterAsNumber("arraystretch"))!=null?E:1;let Mt=typeof this.arraycolsep=="number"?this.arraycolsep:Se;this.colSeparationType==="small"&&(Mt=.2778*(new Ei({parent:y,mathstyle:"scriptstyle"}).scalingFactor/y.scalingFactor));const It=st*Gc,gn=.7*It,hr=.3*It;let pn=0;const On=[];let gr=0;const Un=this.array.length;for(let ta=0;ta<Un;++ta){const xa=this.array[ta];gr=Math.max(gr,xa.length);const qa=new Ei({parent:me,mathstyle:this.mathstyleName},this.style);let Vs=gn/qa.scalingFactor,Gs=hr/qa.scalingFactor;const Us={cells:[],height:0,depth:0,pos:0};for(const ws of xa){const e0=(ee=An.createBox(qa,ws,{type:"ignore"}))!=null?ee:new fr(null,{type:"ignore"});Gs=Math.max(Gs,e0.depth),Vs=Math.max(Vs,e0.height),Us.cells.push(e0)}let Xs=(re=Yu(this.rowGaps[ta]))!=null?re:0;Xs>0&&(Xs+=hr,Gs=Math.max(Gs,Xs),Xs=0),ta<Un-1&&!co(this.environmentName)&&this.environmentName!=="cases"&&this.environmentName!=="array"&&(Gs+=me.getRegisterAsEm("jot")),Us.height=Vs,Us.depth=Gs,pn+=Vs,Us.pos=pn,pn+=Gs+Xs,On.push(Us)}const zr=pn/2+ao,Xr=[];for(let ta=0;ta<gr;ta++){const xa=[];for(const qa of On){const Vs=qa.cells[ta];Vs.depth=qa.depth,Vs.height=qa.height,xa.push({box:Vs,shift:qa.pos-zr})}xa.length>0&&Xr.push(new Yi({individualShift:xa}))}const jr=[];let ki=!1,Gi=!1,Sr=0,Zo=!this.leftDelim;const{colFormat:js}=this;for(const ta of js){if("align"in ta&&Sr>=Xr.length)break;if("align"in ta)ki?jr.push(ua(2*Mt)):(Gi||Zo)&&jr.push(ua(Mt)),jr.push(new fr(Xr[Sr],{classes:"col-align-"+ta.align})),Sr++,ki=!0,Gi=!1,Zo=!1;else if("gap"in ta){if(typeof ta.gap=="number")jr.push(ua(ta.gap));else{const xa=ma(y,On,zr,ta.gap);xa&&jr.push(xa)}ki=!1,Gi=!1,Zo=!1}else if("separator"in ta){const xa=new fr(null,{classes:"vertical-separator"});xa.height=pn,xa.setStyle("height",pn,"em"),xa.setStyle("border-right",`${ve}em ${ta.separator} currentColor`),xa.setStyle("vertical-align",-(pn-zr),"em");let qa=0;Gi?qa=He-ve:ki&&(qa=Mt-ve),xa.left=qa,jr.push(xa),ki=!1,Gi=!0,Zo=!1}}ki&&!this.rightDelim&&jr.push(ua(Mt));const es=new fr(jr,{classes:"mtable"});if((!this.leftDelim||this.leftDelim===".")&&(!this.rightDelim||this.rightDelim==="."))return this.caret&&(es.caret=this.caret),this.bind(y,es);const Xa=es.height,jo=es.depth,Eo=this.bind(y,new fr([this.bind(y,Mr("open",(ae=this.leftDelim)!=null?ae:".",Xa,jo,me,{isSelected:this.isSelected})),es,this.bind(y,Mr("close",(fe=this.rightDelim)!=null?fe:".",Xa,jo,me,{isSelected:this.isSelected}))],{type:"ord"}));return Eo?(Eo.setStyle("display","inline-block"),this.caret&&(Eo.caret=this.caret),this.bind(y,this.attachSupsub(y,{base:Eo}))):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(An.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}}`),bi(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 An({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(pa(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(pa(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,pa(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,pa(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 pa(a){const y=new An({type:"first",mode:a.mode});y.parent=a;const b=new Jr;return b.parent=a,[y,b]}function ua(a){const y=new fr(null,{classes:"arraycolsep"});return y.width=a,y}function ma(a,y,b,E){if(!E)return null;const ee=[];for(const re of y){const ae=An.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 ya=class Dp extends An{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 Dp(y)}toJson(){return _e(we({},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=An.createBox(y,this.body,{type:"lift"});if(!ae)return null;const fe=y.toEm((b=this.offset)!=null?b:{dimension:0});ae.depth+=fe,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 me=new Ei({parent:y},this.style),ve=me.toEm((E=this.padding)!=null?E:{register:"fboxsep"}),Se=new fr(null,{classes:"ML__box"});Se.height=ae.height+ve,Se.depth=ae.depth+ve,Se.setStyle("box-sizing","border-box"),Se.setStyle("position","absolute"),Se.setStyle("top",-ve+.3,"em"),Se.setStyle("left",0),Se.setStyle("height",Se.height+Se.depth,"em"),Se.setStyle("width","100%"),this.backgroundcolor&&Se.setStyle("background-color",(ee=me.toColor(this.backgroundcolor))!=null?ee:"transparent"),this.framecolor&&Se.setStyle("border",`${me.getRegisterAsEm("fboxrule",2)}em solid ${(re=me.toColor(this.framecolor))!=null?re:"black"}`),this.border&&Se.setStyle("border",this.border);const He=new fr([Se,ae],{type:"lift"});return He.setStyle("display","inline-block"),He.setStyle("position","relative"),He.setStyle("line-height",0),He.height=ae.height+ve+(fe>0?fe:0),He.depth=ae.depth+ve+(fe<0?-fe:0),He.setStyle("padding-left",ve,"em"),He.setStyle("padding-right",ve,"em"),He.setStyle("height",Math.floor(100*(ae.height+ae.depth+2*ve+Math.abs(fe)))/100,"em"),He.setStyle("margin-top",-ve,"em"),He.setStyle("top",Math.floor(100*(ae.depth-ae.height+2*ve-fe))/100,"em"),He.setStyle("vertical-align",Math.floor(100*(ae.depth+2*ve))/100,"em"),this.caret&&(He.caret=this.caret),this.attachSupsub(y,{base:He})}_serialize(y){return y.skipStyles?bi([this.bodyToLatex(y),this.supsubToLatex(y)]):super._serialize(y)}},fl=class Bp extends An{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 Bp(y.value,y)}toJson(){return super.toJson()}get computedStyle(){return{}}render(y){const b=new fr(this.value,{classes:"ML__composition",type:"composition"});return this.bind(y,b),this.caret&&(b.caret=this.caret),b}_serialize(y){return""}},vo=class Tp extends An{constructor(y){super({type:"error",value:y,command:y,mode:"math"}),this.verbatimLatex=y}static fromJson(y){return new Tp(y.command)}toJson(){return super.toJson()}render(y){const b=this.createBox(y,{classes:"ML__error"});return this.caret&&(b.caret=this.caret),b}},Va=class Ip extends An{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=An.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=Nt(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):`{${this.bodyToLatex(y)}}`}},Ni=class Pp extends An{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 Pp((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"?bi(["\\left",(b=this.leftDelim)!=null?b:".",this.bodyToLatex(y),"\\right",ee]):this.variant==="mleft...mright"?bi(["\\mleft",(E=this.leftDelim)!=null?E:".",this.bodyToLatex(y),"\\mright",ee]):bi([!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 Ei({parent:y},this.style);console.assert(this.body!==void 0);const re=new Ei({parent:y,mathstyle:"textstyle"},this.style),ae=(b=An.createBox(ee,this.body,{type:"inner"}))!=null?b:new fr(null,{type:"inner"}),fe=ae.height/re.scalingFactor,me=ae.depth/re.scalingFactor,ve=[];if(this.leftDelim&&ve.push(this.bind(re,Mr("open",this.leftDelim,fe,me,re,{isSelected:this.isSelected,classes:"ML__open"+(this.containsCaret?" ML__contains-caret":""),mode:this.mode,style:this.style}))),ae&&(Ta(ae.children,this,ee,fe,me),ve.push(ae)),this.rightDelim){let Mt=this.containsCaret?" ML__contains-caret":"",It=this.rightDelim;It==="?"&&(ee.smartFence?(It=this.matchingRightDelim(),Mt+=" ML__smart-fence__close"):It="."),ve.push(this.bind(re,Mr("close",It,fe,me,re,{isSelected:this.isSelected,classes:Mt+" ML__close",mode:this.mode,style:this.style})))}let Se=this.variant==="mleft...mright";const He=this.leftSibling;He&&(!Se&&He.isFunction&&(Se=!0),!Se&&He.type==="subsup"&&((E=He.leftSibling)!=null&&E.isFunction)&&(Se=!0));const st=new fr(ve,{type:Se?"close":"inner",classes:"left-right"});return st.setStyle("margin-top",`${-ae.depth}em`),st.setStyle("height",`${ae.height+ae.depth}em`),this.caret&&(st.caret=this.caret),this.bind(ee,st.wrap(ee))}};function Ta(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,Mr("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&&Ta(ae.children,y,b,E,ee)}}var au=class Op extends An{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=An.createBox(y,this.body);return b?(this.caret&&(b.caret=this.caret),this.bind(y,b)):null}},bs=class $p extends An{constructor(){super({type:"macro-argument"})}static fromJson(y){return new $p}toJson(){return super.toJson()}_serialize(y){return""}render(y){return null}},Rs=class Np extends An{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 Ei({parent:y}),E=b.getRegisterAsEm("fboxsep"),ee=E,re=E,ae=An.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 fe=new fr(ae,{type:"ord"});fe.setStyle("display","inline-block"),fe.setStyle("height",ae.height+ae.depth,"em"),fe.setStyle("vertical-align",-re,"em");let me="ML__prompt ";this.locked?me+=" ML__lockedPromptBox ":me+=" ML__editablePromptBox ",this.correctness==="correct"?me+=" ML__correctPromptBox ":this.correctness==="incorrect"&&(me+=" ML__incorrectPromptBox "),this.containsCaret&&(me+=" ML__focusedPromptBox ");const ve=new fr(null,{classes:me,attributes:{part:"prompt"}});ve.height=fe.height+re,ve.depth=fe.depth+re,ve.width=fe.width+2*ee,ve.setStyle("box-sizing","border-box"),ve.setStyle("position","absolute"),ve.setStyle("height",fe.height+fe.depth+2*re,"em"),ee===0&&ve.setStyle("width","100%"),ee!==0&&(ve.setStyle("width",`calc(100% + ${2*ee}em)`),ve.setStyle("top",E,"em"),ve.setStyle("left",-ee,"em")),(!this.body||this.body.length===1)&&(ve.width=3*ee,ve.setStyle("width",`calc(100% + ${3*ee}em)`),ve.setStyle("left",-1.5*ee,"em"));let Se="";this.correctness==="incorrect"&&(Se+='<line x1="3%" y1="97%" x2="97%" y2="3%" stroke-width="0.5" stroke="var(--incorrect-color, var(--ML__incorrect-color))" stroke-linecap="round" />'),Se&&(ve.svgOverlay=Se);const He=new fr([ve,fe],{classes:"ML__prompt-atom"});return He.setStyle("position","relative"),He.setStyle("display","inline-block"),He.setStyle("line-height",0),He.height=fe.height+re+.2,He.depth=fe.depth+re,He.left=ee,He.right=ee,He.setStyle("height",fe.height+re,"em"),He.setStyle("top",fe.depth-fe.height,"em"),He.setStyle("vertical-align",fe.depth+re,"em"),He.setStyle("margin-left",.5,"em"),He.setStyle("margin-right",.5,"em"),this.caret&&(He.caret=this.caret),this.bind(b,this.attachSupsub(y,{base:He}))}_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]"),na(ee,E)}},Yo=class Rp extends An{constructor(y){super({type:"subsup",style:y==null?void 0:y.style}),this.subsupPlacement="auto"}static fromJson(y){const b=new Rp(y);for(const E of Bl)y[E]&&b.setChildren(y[E],E);return b}render(y){var b;const E=new Ei({parent:y,isPhantom:!0}),ee=this.leftSibling,re=(b=ee.render(E))!=null?b:new fr(null),ae=new fr(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 Ea(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 Ei&&!(b!=null&&b.parseMode)&&!b.mathstyle?y:new Ei({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:we({},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(we({before:Ts(this.tokens.slice(this.index,this.index+10)),after:Ts(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 we({},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=Nt(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?Ga(y,{parseMode:this.parseMode,mathstyle:"textstyle"}):[new Jr({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();Ea(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(Ea(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 fe="";for(;this.hasPattern(ae);)fe+=this.get();if(!a&&(this.match(".")||this.match(",")))for(fe+=".";this.hasPattern(ae);)fe+=this.get();const me=a?Number.parseInt(fe,re):Number.parseFloat(fe);return Number.isNaN(me)?null:{number:E?-me:me,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()||!Ea(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=Pe(a);if(!y)return this.onError({code:"unknown-environment",arg:a}),null;const b=[];if(y.params)for(const fe of y.params)if(fe.isOptional)b.push(this.scanOptionalArgument(fe.type));else{const me=this.scanArgument(fe.type);me||this.onError({code:"missing-argument",arg:a}),b.push(me)}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 fe=null;this.skipWhitespace(),this.match("[")&&(fe=this.scanDimen(),this.skipWhitespace(),this.match("]")),ee.push(fe!=null?fe:{dimension:0}),E.push(re),re=[]}else this.mathlist.push(...this.scan(fe=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline"].includes(fe)));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=Nt(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 Va(y,this.parseMode,this.style);return b.verbatimLatex=Ts(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 Ni("",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(!Ea(a)&&!a.startsWith("\\"))return null;this.next();const y=Nt(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 Ni(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 An({type:"mord",command:"\\doubleprime",mode:"math",value:"\u2032\u2032"}),"superscript"):y.addChild(new An({type:"mord",command:"\\prime",mode:"math",value:"\u2032"}),"superscript"):(this.match("^")||this.match("_"))&&y.addChildren(nt(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(Ea(a)){const b=Co.createAtom(this.parseMode,a,we({},this.style));return b?[b]:null}if(y=this.scanMacro(a),y)return[y];if(a.startsWith("\\")){const b=Nt(a,this.parseMode);if(!b)return this.onError({code:"unknown-command",arg:a}),[new vo(a)];if(b.definitionType==="symbol"){const E=we({},this.style);b.variant&&(E.variant=b.variant),y=new An({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 fe=this.scanOptionalArgument("string"),me=this.scanOptionalArgument("math"),ve=An.serialize(me,{defaultMode:"math"});let Se=[],He;!He&&ve==="correct"?He="correct":!He&&ve==="incorrect"?He="incorrect":ve!==""&&(Se=me);const st=this.scanOptionalArgument("string")==="locked",Mt=this.scanArgument("auto");let It;return Mt&&Array.isArray(Mt)&&Mt.length>0?It=Mt:Mt&&typeof Mt=="object"&&"group"in Mt?It=Mt.group:It=Se,fe?[new Rs(fe,He,st,It!=null?It:Se,{mode:this.parseMode,style:this.style})]:[new Jr({mode:this.parseMode,style:this.style})]}if(a==="\\renewcommand"||a==="\\newcommand"||a==="\\providecommand"||a==="\\def"){const fe=this.index,me=this.scanLiteralGroup()||this.next();if(!me)return null;if(this.context.registers[me.substring(1)]){const ve=this.scanArgument("string");ve!==null&&(this.context.registers[me.substring(1)]=ve);const Se=bi([a,Ts(this.tokens.slice(fe,this.index))]);return[new An({type:"text",value:"",verbatimLatex:Se})]}}let ee=this.scanMacro(a);if(ee)return[ee];const re=Nt(a,this.parseMode);if(!re)return this.parseMode==="text"?(/[a-zA-Z]/.test((y=this.peek())!=null?y:"")&&(a+=" "),[...a].map(fe=>new An({type:"text",value:fe,mode:"text",style:this.style}))):(this.onError({code:"unknown-command",arg:a}),[new vo(a)]);const ae=this.index;if(re.definitionType==="symbol"){const fe=we({},this.style);re.variant&&(fe.variant=re.variant),ee=new An({type:re.type,command:a,style:fe,value:String.fromCodePoint(re.codepoint),mode:this.parseMode})}else{if(re.ifMode&&!re.ifMode.includes(this.parseMode))return[];const fe=this.parseMode;re.applyMode&&(this.parseMode=re.applyMode);let me,ve=[];if(re.parse?ve=re.parse(this):[me,ve]=this.scanArguments(re),this.parseMode=fe,re.applyMode&&!re.applyStyle&&!re.createAtom)return nt(ve[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:ve,style:this.style,mode:this.parseMode}),me&&(ee.body=nt(this.scanArgument(me)));else if(typeof re.applyStyle=="function"){const Se=we(we({},this.style),re.applyStyle(a,ve,this.context)),He=this.parseMode;if(re.applyMode&&(this.parseMode=re.applyMode),me){const st=this.style;this.style=Se;const Mt=this.scanArgument(me);return this.style=st,this.parseMode=He,nt(Mt)}this.style=Se}else ee=new An({type:"mord",command:(b=re.command)!=null?b:a,style:we({},this.style),value:a,mode:(E=re.applyMode)!=null?E:this.parseMode})}if(!ee)return null;if(ee instanceof An&&ee.verbatimLatex===void 0&&!/^\\(llap|rlap|class|cssId|htmlData)$/.test(a)){const fe=bi([a,Ts(this.tokens.slice(ae,this.index))]);fe&&(ee.verbatimLatex=fe)}if(ee.verbatimLatex===null&&(ee.verbatimLatex=void 0),ee.isFunction&&this.smartFence){const fe=this.scanSmartFence();if(fe)return[ee,fe]}return[ee]}scanSymbolCommandOrLiteral(){const a=this.get();if(!a)return null;if(Ea(a)){const y=Co.createAtom(this.parseMode,a,we({},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 fe=this.scanLiteralGroup();if(!fe){const me=this.index;this.scanExpression(),fe=Ts(this.tokens.slice(me,this.index))}re[ae]=fe}return new au(a,{expand:b.expand,captureSelection:b.captureSelection,args:E===this.index?null:Ts(this.tokens.slice(E,this.index)),style:this.parsingContext.style,body:Ga(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 Ga(a,y){var b,E,ee,re;const ae=(b=y==null?void 0:y.args)!=null?b:void 0,fe=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:{}}),me=[];for(;!fe.end();)me.push(...fe.scan(()=>!1));return me}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 An{constructor(y,b){super({type:"chem"},{command:y,mode:"math"});const E=sa.go(ur.go(b,y==="\\pu"?"pu":"ce"),!1);this.body=Ga(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 _e(we({},super.toJson()),{arg:this.arg})}render(y){const b=An.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}};ct(["ce","pu"],"{chemformula:balanced-string}",{createAtom:a=>{var y;return new n0(a.command,(y=a.args[0])!=null?y:"")}});var ur={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 fe=ur.stateMachines[y],me=fe.transitions[b]||fe.transitions["*"];e:for(var ve=0;ve<me.length;ve++){var Se=ur.patterns.match_(me[ve].pattern,a);if(Se){for(var He=me[ve].task,st=0;st<He.action_.length;st++){var Mt;if(fe.actions[He.action_[st].type_])Mt=fe.actions[He.action_[st].type_](E,Se.match_,He.action_[st].option);else if(ur.actions[He.action_[st].type_])Mt=ur.actions[He.action_[st].type_](E,Se.match_,He.action_[st].option);else throw["MhchemBugA","mhchem bug A. Please report. ("+He.action_[st].type_+")"];ur.concatArray(ae,Mt)}if(b=He.nextState||b,a.length>0){if(He.revisit||(a=Se.remainder),!He.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=ur.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 ur.patterns.findObserveGroups(a,"^{","","","}")},"^($...$)":function(a){return ur.patterns.findObserveGroups(a,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(a){return ur.patterns.findObserveGroups(a,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(a){return ur.patterns.findObserveGroups(a,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(a){return ur.patterns.findObserveGroups(a,"_{","","","}")},"_($...$)":function(a){return ur.patterns.findObserveGroups(a,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(a){return ur.patterns.findObserveGroups(a,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(a){return ur.patterns.findObserveGroups(a,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(a){return ur.patterns.findObserveGroups(a,"","{","}","")},"{(...)}":function(a){return ur.patterns.findObserveGroups(a,"{","","","}")},"$...$":function(a){return ur.patterns.findObserveGroups(a,"","$","$","")},"${(...)}$":function(a){return ur.patterns.findObserveGroups(a,"${","","","}$")},"$(...)$":function(a){return ur.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 ur.patterns.findObserveGroups(a,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(a){return ur.patterns.findObserveGroups(a,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(a){return ur.patterns.findObserveGroups(a,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(a){return ur.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 ur.patterns.findObserveGroups(a,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(a){return ur.patterns.findObserveGroups(a,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(a){return ur.patterns.findObserveGroups(a,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(a){return ur.patterns.findObserveGroups(a,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(a){return ur.patterns.findObserveGroups(a,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(a){return ur.patterns.findObserveGroups(a,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(a){return ur.patterns.findObserveGroups(a,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(a){return ur.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=ur.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,fe,me,ve){var Se=function(pn,On){if(typeof On=="string")return pn.indexOf(On)!==0?null:On;var gr=pn.match(On);return gr?gr[0]:null},He=function(pn,On,gr){for(var Un=0;On<pn.length;){var zr=pn.charAt(On),Xr=Se(pn.substr(On),gr);if(Xr!==null&&Un===0)return{endMatchBegin:On,endMatchEnd:On+Xr.length};if(zr==="{")Un++;else if(zr==="}"){if(Un===0)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];Un--}On++}return Un>0,null},st=Se(a,y);if(st===null||(a=a.substr(st.length),st=Se(a,b),st===null))return null;var Mt=He(a,st.length,E||ee);if(Mt===null)return null;var It=a.substring(0,E?Mt.endMatchEnd:Mt.endMatchBegin);if(re||ae){var gn=this.findObserveGroups(a.substr(Mt.endMatchEnd),re,ae,fe,me);if(gn===null)return null;var hr=[It,gn.match_];return{match_:ve?hr.join(""):hr,remainder:gn.remainder}}else return{match_:It,remainder:a.substr(Mt.endMatchEnd)}},match_:function(a,y){var b=ur.patterns.patterns[a];if(b===void 0)throw["MhchemBugP","mhchem bug P. Please report. ("+a+")"];if(typeof b=="function")return ur.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 ur.go(y,"text")},"{text}":function(a,y){var b=["{"];return ur.concatArray(b,ur.go(y,"text")),b.push("}"),b},"tex-math":function(a,y){return ur.go(y,"tex-math")},"tex-math tight":function(a,y){return ur.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 ur.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 ur.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 fe=0;fe<ae.action_.length;fe++)typeof ae.action_[fe]=="string"&&(ae.action_[fe]={type_:ae.action_[fe]})}else ae.action_=[];for(var me=y.split("|"),ve=0;ve<me.length;ve++)if(E[ee]==="*")for(var Se in re)re[Se].push({pattern:me[ve],task:ae});else re[E[ee]].push({pattern:me[ve],task:ae})}return re},stateMachines:{}};ur.stateMachines={ce:{transitions:ur.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 ur.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 ur.concatArray(b,this.output(a)),ur.concatArray(b,ur.actions.bond(a,y,"-")),b}else a.d=y},"- after o/d":function(a,y,b){var E=ur.patterns.match_("orbital",a.o||""),ee=ur.patterns.match_("one lowercase greek letter $",a.o||""),re=ur.patterns.match_("one lowercase latin letter $",a.o||""),ae=ur.patterns.match_("$one lowercase latin letter$ $",a.o||""),fe=y==="-"&&(E&&E.remainder===""||ee||re||ae);fe&&!a.a&&!a.b&&!a.p&&!a.d&&!a.q&&!E&&re&&(a.o="$"+a.o+"$");var me=[];return fe?(ur.concatArray(me,this.output(a)),me.push({type_:"hyphen"})):(E=ur.patterns.match_("digits",a.d||""),b&&E&&E.remainder===""?(ur.concatArray(me,ur.actions["d="](a,y)),ur.concatArray(me,this.output(a))):(ur.concatArray(me,this.output(a)),ur.concatArray(me,ur.actions.bond(a,y,"-")))),me},"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:ur.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"&&ur.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:ur.go(a.a,"a"),b:ur.go(a.b,"bd"),p:ur.go(a.p,"pq"),o:ur.go(a.o,"o"),q:ur.go(a.q,"pq"),d:ur.go(a.d,a.dType==="oxidation"?"oxidation":"bd"),dType:a.dType}));else{var ee;a.rdt==="M"?ee=ur.go(a.rd,"tex-math"):a.rdt==="T"?ee=[{type_:"text",p1:a.rd||""}]:ee=ur.go(a.rd);var re;a.rqt==="M"?re=ur.go(a.rq,"tex-math"):a.rqt==="T"?re=[{type_:"text",p1:a.rq||""}]:re=ur.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 ur.concatArray(b,ur.go(y,"oxidation")),b.push("}"),b},"frac-output":function(a,y){return{type_:"frac-ce",p1:ur.go(y[0]),p2:ur.go(y[1])}},"overset-output":function(a,y){return{type_:"overset",p1:ur.go(y[0]),p2:ur.go(y[1])}},"underset-output":function(a,y){return{type_:"underset",p1:ur.go(y[0]),p2:ur.go(y[1])}},"underbrace-output":function(a,y){return{type_:"underbrace",p1:ur.go(y[0]),p2:ur.go(y[1])}},"color-output":function(a,y){return{type_:"color",color1:y[0],color2:ur.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:ur.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:ur.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:ur.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:ur.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:ur.go(y,"o")}},"color-output":function(a,y){return{type_:"color",color1:y[0],color2:ur.go(y[1],"pq")}}}},bd:{transitions:ur.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:ur.go(y[1],"bd")}}}},oxidation:{transitions:ur.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:ur.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:ur.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:ur.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:ur.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]&&(ur.concatArray(b,ur.go(y[1],"pu-9,9")),y[2]&&(y[2].match(/[,.]/)?ur.concatArray(b,ur.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]),ur.concatArray(b,ur.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=ur.patterns.match_("{(...)}",a.d||"");b&&b.remainder===""&&(a.d=b.match_);var E=ur.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:ur.go(a.d,"pu"),q:ur.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_:"/"}),ur.concatArray(y,ee.q))}else y=ur.go(a.d,"pu-2");for(var re in a)delete a[re];return y}}},"pu-2":{transitions:ur.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=ur.patterns.match_("{(...)}",a.rm||"");b&&b.remainder===""?y=ur.go(b.match_,"pu"):y={type_:"rm",p1:a.rm}}for(var E in a)delete a[E];return y}}},"pu-9,9":{transitions:ur.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 sa={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+=sa._go2(re),re.type_==="1st-level escape"&&(E=!0))}return!y&&!E&&b&&(b="{"+b+"}"),b},_goInner:function(a){return a&&sa.go(a,!0)},_go2:function(a){var y;switch(a.type_){case"chemfive":y="";var b={a:sa._goInner(a.a),b:sa._goInner(a.b),p:sa._goInner(a.p),o:sa._goInner(a.o),q:sa._goInner(a.q),d:sa._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 "+sa._goInner(a.p1);break;case"state of aggregation subscript":y="\\mskip1mu "+sa._goInner(a.p1);break;case"bond":if(y=sa._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{"+sa._goInner(a.p1)+"}{"+sa._goInner(a.p2)+"}";y="\\mathchoice{\\textstyle"+ee+"}{"+ee+"}{"+ee+"}{"+ee+"}";break;case"tex-math":y=a.p1+" ";break;case"frac-ce":y="\\frac{"+sa._goInner(a.p1)+"}{"+sa._goInner(a.p2)+"}";break;case"overset":y="\\overset{"+sa._goInner(a.p1)+"}{"+sa._goInner(a.p2)+"}";break;case"underset":y="\\underset{"+sa._goInner(a.p1)+"}{"+sa._goInner(a.p2)+"}";break;case"underbrace":y="\\underbrace{"+sa._goInner(a.p1)+"}_{"+sa._goInner(a.p2)+"}";break;case"color":y="{\\color{"+a.color1+"}{"+sa._goInner(a.color2)+"}}";break;case"color0":y="\\color{"+a.color+"}";break;case"arrow":var re={rd:sa._goInner(a.rd),rq:sa._goInner(a.rq)},ae=sa._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=sa._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 E1(a){}function M1(a){}var r0=class zp extends An{constructor(y){super(_e(we({},y),{type:"delim"})),this.value=y.delim,this.size=y.size}static fromJson(y){return new zp(y)}toJson(){return _e(we({},super.toJson()),{delim:this.value,size:this.size})}render(y){return new fr(this.value,{type:"middle"})}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Nt(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):na(this.command,this.value)}},i0=class Kp extends An{constructor(y){super(_e(we({},y),{type:"sizeddelim",value:y.delim})),this.delimType=y.delimType,this.size=y.size}static fromJson(y){return new Kp(y)}toJson(){return _e(we({},super.toJson()),{delim:this.value,size:this.size,delimType:this.delimType})}render(y){let b=cn(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=Nt(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):na(this.command,this.value)}},cd=class Hp extends An{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 _e(we({},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=Nt(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 na(ee,this.bodyToLatex(y))}render(y){const b=new Ei({parent:y},this.style),E=An.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 fr(null,{classes:"ML__notation"});let fe=E.height+E.depth+2*re;const me=E.width+2*re;let ve="";if(this.notation.horizontalstrike&&(ve+=this.line(3,50,97,50)),this.notation.verticalstrike&&(ve+=this.line(50,3,50,97)),this.notation.updiagonalstrike&&(ve+=this.line(3,97,97,3)),this.notation.downdiagonalstrike&&(ve+=this.line(3,3,97,97)),this.notation.updiagonalarrow){ve+=this.line(re.toString(),(re+E.depth+E.height).toString(),(re+E.width).toString(),re.toString());const It=.03*Math.sqrt(me*me+fe*fe)*1,gn=E.width*It,hr=(E.depth+E.height)*It,pn=re+E.width;let On=re;On+hr-.4*gn<0&&(On=.4*gn-hr),ve+='<polygon points="',ve+=`${pn},${On} ${pn-gn-.4*hr},${On+hr-.4*gn} `,ve+=`${pn-.7*gn},${On+.7*hr} ${pn-gn+.4*hr},${On+hr+.4*gn} `,ve+=`${pn},${On}`,ve+=`" stroke='none' fill="${this.strokeColor}"`,ve+="/>"}let Se=0;if(this.notation.phasorangle){const st=a0(b),Mt=(E.height+E.depth+2*st+re).toString(),It=(E.height+E.depth)/2;ve+=this.line(re.toString(),Mt,(re+It+E.width).toString(),Mt),ve+=this.line(re.toString(),Mt,(re+It).toString(),(re-st).toString()),fe+=st,Se=It,E.left+=fe/2-re}if(this.notation.longdiv){const st=a0(b);fe+=st,ve+=this.line(re.toString(),re.toString(),(re+E.width).toString(),re.toString());const Mt=.3;Se=Mt+st,E.left+=Mt+st,E.setTop(re+st),ve+='<path d="',ve+=`M ${re} ${re} a${Mt} ${(E.depth+E.height+2*st)/2}, 0, 1, 1, 0 ${E.depth+E.height+2*st} "`,ve+=` stroke-width="${am(b)}" stroke="${this.strokeColor}" fill="none"`,ve+="/>"}if(ae.width=E.width+2*re+Se,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*fe)/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),ve){let st="";this.shadow==="auto"&&(st+="filter: drop-shadow(0 0 .5px rgba(255, 255, 255, .7)) drop-shadow(1px 1px 2px #333)"),this.shadow!=="none"&&(st+=`filter: drop-shadow(${this.shadow})`),st+=` stroke-width="${this.strokeWidth}" stroke="${this.strokeColor}"`,st+=' stroke-linecap="round"',this.svgStrokeStyle&&(st+=` stroke-dasharray="${this.svgStrokeStyle}"`),ae.svgStyle=st,ae.svgOverlay=ve}const He=new fr([ae,E]);return He.setStyle("position","relative"),He.setStyle("vertical-align",re,"em"),He.setStyle("height",`${Math.floor(100*(E.height+E.depth+2*re))/100}em`),He.setStyle("display","inline-block"),He.height=ae.height,He.depth=ae.depth,He.width=ae.width-2*re,He.left=re,He.right=re,this.caret&&(He.caret=this.caret),He.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 An{constructor(y,b,E){var ee,re;super(_e(we({},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),we(we({},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 Ei({parent:y,mathstyle:this.mathstyleName},this.style),re=ee.metrics,ae=new Ei({parent:ee,mathstyle:this.continuousFraction?"":"numerator"},this.style),fe=this.numerPrefix?new fr([new fr(this.numerPrefix),An.createBox(ae,this.above)],{isTight:ae.isTight,type:"ignore"}):(b=An.createBox(ae,this.above,{type:"ignore"}))!=null?b:new fr(null,{type:"ignore"}),me=new Ei({parent:ee,mathstyle:this.continuousFraction?"":"denominator"},this.style),ve=this.denomPrefix?new fr([new fr(this.denomPrefix),An.createBox(me,this.below,{type:"ignore"})]):(E=An.createBox(me,this.below,{type:"ignore"}))!=null?E:new fr(null,{type:"ignore"}),Se=this.hasBarLine?re.defaultRuleThickness:0;let He,st=0,Mt;ee.isDisplayStyle?(He=ae.metrics.num1,st=Se>0?3*Se:7*Se,Mt=me.metrics.denom1):(Se>0?(He=ae.metrics.num2,st=Se):(He=ae.metrics.num3,st=3*re.defaultRuleThickness),Mt=me.metrics.denom2);const It=[];this.isSelected&&It.push("ML__selected");const gn=fe.depth,hr=ve.height;let pn;if(Se<=0){const jr=He-gn-(hr-Mt);jr<st&&(He+=(st-jr)/2,Mt+=(st-jr)/2),pn=new Yi({individualShift:[{box:fe,shift:-He,classes:[...It,"ML__center"]},{box:ve,shift:Mt,classes:[...It,"ML__center"]}]}).wrap(ee)}else{const jr=new fr(null,{classes:"ML__frac-line",mode:this.mode,style:this.style});jr.softWidth=Math.max(fe.width,ve.width),jr.height=Se/2,jr.depth=Se/2;const ki=ao+Se/2;He<st+gn+ki&&(He=st+gn+ki);const Gi=ao-Se/2;Mt<st+hr-Gi&&(Mt=st+hr-Gi),pn=new Yi({individualShift:[{box:ve,shift:Mt,classes:[...It,"ML__center"]},{box:jr,shift:-Gi,classes:It},{box:fe,shift:-He,classes:[...It,"ML__center"]}]}).wrap(ee)}const On=ee.isDisplayStyle?re.delim1:re.delim2,gr=this.leftDelim?this.bind(y,Pr("open",this.leftDelim,On,!0,y,{style:this.style,mode:this.mode,isSelected:this.isSelected})):Rr(ee,"open");let Un=null;this.continuousFraction?Un=new fr(null,{type:"close"}):this.rightDelim?Un=this.bind(y,Pr("close",this.rightDelim,On,!0,y,{style:this.style,mode:this.mode,isSelected:this.isSelected})):Un=Rr(ee,"close");const zr=new fr([gr,pn,Un],{isTight:ee.isTight,type:"inner",classes:"mfrac"}),Xr=this.bind(y,zr);return this.caret&&(Xr.caret=this.caret),this.attachSupsub(y,{base:Xr})}},eo=class Zp extends An{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),we({type:"latex",value:this.value},y)}get computedStyle(){return{}}render(y){const b=new fr(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 An{constructor(y){super({type:"latexgroup",mode:"latex"}),this.body=[...y].map(b=>new eo(b)),this.skipBoundary=!1}static fromJson(y){return new jp("")}toJson(){return super.toJson()}render(y){const b=An.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 An{constructor(y,b){super(_e(we({},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 fr(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-ao*y.scalingFactor,ae=ee.italic;ee.setTop(re);let fe=ee;if(this.superscript||this.subscript){const me=(b=this.subsupPlacement)!=null?b:"auto";fe=me==="over-under"||me==="auto"&&y.isDisplayStyle?this.attachLimits(y,{base:ee,baseShift:re,slant:ae}):this.attachSupsub(y,{base:ee})}return new fr(this.bind(y,fe),{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=Nt(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)),bi(E)}},dc=class Gp extends An{constructor(y){const b=y.body;super(_e(we({},y),{type:"overlap",body:typeof b=="string"?[new An({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 Gp(y)}toJson(){const y={};return this.align&&(y.align=this.align),this.boxType&&(y.boxType=this.boxType),we(we({},super.toJson()),y)}render(y){const b=An.createBox(y,this.body,{classes:"inner"});return b?(this.caret&&(b.caret=this.caret),this.bind(y,new fr([b,new fr(null,{classes:"fix"})],{classes:this.align==="right"?"rlap":"llap",type:this.boxType}))):null}},Jo=class Up extends An{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 Up(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?Fo(this.svgBody):An.createBox(y,this.body,{type:"ignore"});const E=new Ei({parent:y,mathstyle:"scriptstyle"},this.style);let ee=null;this.svgAbove?ee=Fo(this.svgAbove):this.above&&(ee=An.createBox(E,this.above,{type:"ignore"}));let re=null;this.svgBelow?re=Fo(this.svgBelow):this.below&&(re=An.createBox(E,this.below,{type:"ignore"})),this.paddedBody&&(b=new fr([Rr(y,"open"),b,Rr(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 fe=new fr(y.base,{type:y.type});return fe.setStyle("position","relative"),fe}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 fe=a.metrics.bigOpSpacing5+y.below.height+y.below.depth+ee.depth+re;E=new Yi({bottom:fe,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 fr(E,{type:y.type})}var dd=class Xp extends An{constructor(y){var b,E,ee,re;super(_e(we({},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),we(we({},super.toJson()),y)}render(y){const b=new Ei({parent:y,isPhantom:!0});if(!this.smashDepth&&!this.smashHeight&&!this.smashWidth)return console.assert(this.isInvisible),An.createBox(b,this.body,{classes:"inner"});const E=An.createBox(this.isInvisible?b:y,this.body);if(!E)return null;if(this.smashWidth){const ee=new fr(null,{classes:"fix"});return new fr([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 qp extends An{constructor(y){var b;super(we({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 qp(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 fr(this.mode==="math"?null:" ");let E;if(this.width!==void 0)E=new fr(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 fr(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=Nt(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}{${Ca(this.width)}}`:`${ee}${Ca(this.width)}`}},o0=class Yp extends An{constructor(y){var b;super(_e(we({},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 Yp(_e(we({},y),{index:y.above}))}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Nt(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")?na(`${E}[${this.aboveToLatex(y)}]`,ee):/^[0-9]$/.test(ee)?`${E}${ee}`:na(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 Ei({parent:y,mathstyle:"cramp"},this.style),ee=(b=An.createBox(E,this.body,{type:"inner"}))!=null?b:new fr(null),re=E.scalingFactor,ae=E.metrics.defaultRuleThickness/re,fe=y.isDisplayStyle?hs:ae,me=new fr(null,{classes:"ML__sqrt-line",style:this.style});me.height=ae,me.softWidth=ee.width;let ve=re*(ae+fe/4);const He=Math.max(re*2*fe,ee.height+ee.depth)+ve+ae,st=new Ei({parent:y},this.style),Mt=this.bind(st,new fr(Pr("inner","\\surd",He,!1,st,{isSelected:this.isSelected}),{isSelected:this.isSelected,classes:"ML__sqrt-sign",style:this.style}));if(!Mt)return null;const It=Mt.height+Mt.depth-ae;It>ee.height+ee.depth+ve&&(ve=(ve+It-(ee.height+ee.depth))/2),Mt.setTop(Mt.height-ee.height-ve);const gn=this.bind(y,new Yi({firstBaseline:[{box:new fr(ee)},ve-2*ae,{box:me},ae]})),hr=An.createBox(new Ei({parent:y,mathstyle:"scriptscriptstyle"}),this.above,{type:"ignore"});if(!hr){const gr=new fr([Mt,gn],{classes:this.containsCaret?"ML__contains-caret":"",type:"inner"});return gr.setStyle("display","inline-block"),gr.setStyle("height",gr.height+gr.depth,"em"),this.caret&&(gr.caret=this.caret),this.bind(y,gr)}const pn=new Yi({shift:-.6*(Math.max(Mt.height,gn.height)-Math.max(Mt.depth,gn.depth)),children:[{box:hr}]}),On=new fr([new fr(pn,{classes:"ML__sqrt-index",type:"ignore"}),Mt,gn],{type:"inner",classes:this.containsCaret?"ML__contains-caret":""});return On.height=Mt.height,On.depth=Mt.depth,this.caret&&(On.caret=this.caret),this.bind(y,On)}},sm=class extends fr{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,fe)=>{var me,ve,Se;if(!ae)return;const He=ae.type,st=fe.isTight?(me=cm[He])!=null?me:null:(ve=lm[He])!=null?ve:null,Mt=(Se=st==null?void 0:st[fe.type])!=null?Se:null;Mt===3&&bh(fe,E),Mt===4&&bh(fe,ee),Mt===5&&bh(fe,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 An{constructor(y){super({type:"tooltip",command:y.command,mode:y.mode,style:y.style,body:y.body,displayContainsHighlight:!0}),this.tooltip=new An({type:"root",mode:y.content,body:y.tooltip,style:{}}),this.skipBoundary=!0,this.captureSelection=!1}static fromJson(y){return new Jp(_e(we({},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 _e(we({},super.toJson()),{tooltip:b})}render(y){const b=An.createBox(new Ei,this.body);if(!b)return null;const E=new Ei({parent:y,mathstyle:"displaystyle"},{fontSize:As}),ee=qc(fd(new fr(this.tooltip.render(E),{classes:"ML__tooltip-content"}),E)),re=new fr([ee,b],{classes:"ML__tooltip-container"});return this.caret&&(re.caret=this.caret),this.bind(y,re)}},hc=class Qp extends An{constructor(y,b){super(_e(we({},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 fr(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 fr(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=Nt(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)),bi(E)}};function Ol(a){if(Ae(a))return a.map(E=>Ol(E));if(typeof a=="string")return An.fromJson(a);a=we({},a);for(const E of Bl)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=li.fromJson(a)),y==="box"&&(b=ya.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=Va.fromJson(a)),y==="latex"&&(b=eo.fromJson(a)),y==="latexgroup"&&(b=ud.fromJson(a)),y==="leftright"&&(b=Ni.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=Jo.fromJson(a)),y==="placeholder"&&(b=Jr.fromJson(a)),y==="prompt"&&(b=Rs.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=An.fromJson(a));for(const E of Bl)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 An({type:"mord",mode:"math",command:a,value:a,style:b});const fe=window.MathfieldElement.isFunction((E=y.command)!=null?E:a);if(y.definitionType==="symbol"){const ve=new An({type:(ee=y.type)!=null?ee:"mord",mode:"math",command:(re=y.command)!=null?re:a,value:String.fromCodePoint(y.codepoint),style:b});return fe&&(ve.isFunction=!0),a.startsWith("\\")&&(ve.verbatimLatex=a),ve}const me=new An({type:"mord",mode:"math",command:(ae=y.command)!=null?ae:a,value:a,style:b});return fe&&(me.isFunction=!0),a.startsWith("\\")&&(me.verbatimLatex=a),me}serialize(a,y){const b=gm(a,_e(we({},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((fe,me)=>{var ve;fe.test(a.value)&&pm[(ve=y.letterShapeStyle)!=null?ve:"tex"][me]==="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=Qt(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 va(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 fe=bi(ee.map(me=>me._serialize(y)));return ae?na(ae,fe):fe})}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 va(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?`{${na("\\fontshape",ee)}${bi(E)}}`:re?na(re,bi(E)):bi(E)})}function bm(a,y){return va(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?`{${na("\\fontseries",ee)}${bi(E)}}`:re?na(re,bi(E)):bi(E)})}function xm(a,y){return va(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} ${bi(re)}`:bi(re)})}function wm(a,y,b){return va(a,"fontFamily").map(E=>{var ee,re;const ae=xm(E,y),fe=(re={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[(ee=E[0].style.fontFamily)!=null?ee:""])!=null?re:"";return fe?`\\${fe}{${bi(ae)}}`:E[0].style.fontFamily?`{\\fontfamily{${E[0].style.fontFamily}} ${bi(ae)}}`:b?`\\text{${bi(ae)}}`:bi(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,_e(we({},y),{defaultMode:"text"}),y.defaultMode!=="text")}getFont(a,y){var b,E,ee,re,ae;const{fontFamily:fe}=y;if(u0[fe]?a.classes+=" "+u0[fe]:fe&&a.setStyle("font-family",fe),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 me=y.fontSeries.match(/(.?[lbm])?(.?[cx])?/);me&&(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=me[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=me[2])!=null?re:""])!=null?ae:"")}return"Main-Regular"}};new Sm;var Cm=class extends Co{constructor(){super("latex")}createAtom(a){return new eo(a)}serialize(a,y){return a.filter(b=>b instanceof eo&&!b.isSuggestion).map(b=>b.value)}getFont(){return null}};new Cm;var _m={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:[")",")",")",")"]}},Em={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:["=","=","=","="]}},Mm={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:["<",">","",""]}},km={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:["=","=","=","="]}},Am={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:["<",">","|",""]}},Dm={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:[".",".",".","."]}},Bm={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"]}},Tm={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 Pm={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(at()){case"macos":case"ios":return"apple";case"windows":return"windows"}return"linux"}function Ho(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=Pm[a])!=null?b:"",E}function $m(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,fe]of y)if(fe[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,_e(we({},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 Rm(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":Ho(mf),Ho(Em),Ho(Bm),Ho(Lm);break;case"windows":Ho(d0),Ho(Mm),Ho(Tm),Ho(Am);break;case"linux":Ho(h0),Ho(km),Ho(Im),Ho(Dm);break}Ho(_m);function vf(a){var y;const b=/macos|ios/.test(at()),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,fe=!1;const me=new AbortController,ve=me.signal;return a.addEventListener("keydown",Se=>{if(re||Se.key==="Process"||Se.code==="CapsLock"||/(Control|Meta|Alt|Shift)(Left|Right)/.test(Se.code)){E=null;return}E=Se,ee=null,b.onKeystroke(Se)?a.textContent="":E=null},{capture:!0,signal:ve}),a.addEventListener("keypress",Se=>{re||(E&&ee&&b.onKeystroke(E),ee=Se)},{capture:!0,signal:ve}),a.addEventListener("compositionstart",Se=>{a.textContent="",re=!0,b.onCompositionStart(Se.data)},{capture:!0,signal:ve}),a.addEventListener("compositionupdate",Se=>{re&&b.onCompositionUpdate(Se.data)},{capture:!0,signal:ve}),a.addEventListener("compositionend",Se=>{a.textContent="",re&&(re=!1,b.onCompositionEnd(Se.data))},{capture:!0,signal:ve}),a.addEventListener("beforeinput",Se=>Se.stopImmediatePropagation(),{signal:ve}),a.addEventListener("input",Se=>{var He;if(!re&&(a.textContent="",Se.inputType!=="insertCompositionText")){if(Se.inputType==="insertFromPaste"){Se.preventDefault(),Se.stopPropagation();return}b.onInput((He=Se.data)!=null?He:""),Se.preventDefault(),Se.stopPropagation()}},{signal:ve}),a.addEventListener("paste",Se=>{a.focus({preventScroll:!0}),a.textContent="",b.onPaste(Se)||Se.preventDefault(),Se.stopImmediatePropagation()},{signal:ve}),a.addEventListener("cut",Se=>b.onCut(Se),{capture:!0,signal:ve}),a.addEventListener("copy",Se=>b.onCopy(Se),{capture:!0,signal:ve}),a.addEventListener("blur",Se=>{var He,st;if(((st=(He=Se.relatedTarget)==null?void 0:He._mathfield)==null?void 0:st.element)===y){a.focus({preventScroll:!0}),Se.preventDefault(),Se.stopPropagation();return}const Mt=Fs.state;if(Mt==="open"||Mt==="opening"){Se.preventDefault(),Se.stopPropagation();return}if(Se.relatedTarget===Se.target.getRootNode().host){Se.preventDefault(),Se.stopPropagation();return}fe||ae||(fe=!0,E=null,ee=null,b.onBlur(),fe=!1)},{capture:!0,signal:ve}),a.addEventListener("focus",Se=>{fe||ae||(ae=!0,b.onFocus(),ae=!1)},{capture:!0,signal:ve}),{dispose:()=>me.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:Se=>a.setAttribute("aria-label",Se),setValue:Se=>{var He;a.textContent=Se,a.style.left="-1000px",(He=window.getSelection())==null||He.selectAllChildren(a)},moveTo:(Se,He)=>{a.style.top=`${He}px`,a.style.left=`${Se}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=$m(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(ft()){const y=at(),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(at()),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 Ae(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];Ae(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=at()==="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 _e(we({},a),{key:su(b)});const ee=Om(b.key,y);if(!ee)return _e(we({},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,_e(we({},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 Gm(a,y){const b=[],E=[];for(const ee of a)try{const re=Vm(ee,y);if(!re)continue;const ae=E.find(fe=>fe.key===re.key&&fe.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 Um=class extends oi{constructor(){super("latex")}createAtom(a){return new eo(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"}),ga(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(ja(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 me of y)oe.test(me)&&re.push(new eo(me));let ae=a.at(a.position);if(ae instanceof ud&&(ae=ae.lastChild),!(ae.parent instanceof ud)){const me=new ud("");ae.parent.addChildAfter(me,ae),ae=me.firstChild}const fe=ae.parent.addChildrenAfter(re,ae);return a.silenceNotifications=ee,b.selectionMode==="before"||(b.selectionMode==="item"?a.setSelection(a.anchor,a.offsetOf(fe)):fe&&(a.position=a.offsetOf(fe))),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 me=a.at(E);ee=me instanceof eo&&me.isSuggestion,ee||E++}if(!ee)return[void 0,void 0];let ae=E,fe=!1;for(;ae<=re&&!fe;){const me=a.at(ae);fe=!(me instanceof eo&&me.isSuggestion),fe||ae++}return[E-1,ae-1]}new Um;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 Se of yd(E))Se.isError=!1;if(!E.selectionIsCollapsed||a.options.popoverPolicy==="off"){uu(a);return}const ee=[];let re=E.at(E.position);for(;re&&re instanceof eo&&/^[a-zA-Z\*]$/.test(re.value);)re=re.leftSibling;if(re&&re instanceof eo&&re.value==="\\")for(ee.push(re),re=re.rightSibling;re&&re instanceof eo&&/^[a-zA-Z\*]$/.test(re.value);)ee.push(re),re=re.rightSibling;const ae=ee.map(Se=>Se.value).join(""),fe=je(a,ae);if(fe.length===0){if(/^\\[a-zA-Z\*]+$/.test(ae))for(const Se of ee)Se.isError=!0;uu(a);return}const me=(b=y==null?void 0:y.atIndex)!=null?b:0;a.suggestionIndex=me<0?fe.length-1:me%fe.length;const ve=fe[a.suggestionIndex];if(ve!==ae){const Se=ee[ee.length-1];Se.parent.addChildrenAfter([...ve.slice(ae.length-ve.length)].map(He=>new eo(He,{isSuggestion:!0})),Se),pc(a,{interactive:!0})}Ym(a,fe)}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 ve=yd(a.model).filter(Se=>Se.isSuggestion);if(ve.length!==0){for(const Se of ve)Se.isSuggestion=!1;a.model.position=a.model.offsetOf(ve[ve.length-1])}if(y==="accept-suggestion")return ve.length!==0}const fe=yd(a.model).filter(ve=>!ve.isSuggestion).map(ve=>ve.value).join(""),me=re.leftSibling;return re.parent.removeChild(re),a.model.position=a.model.offsetOf(me),a.switchMode((E=b==null?void 0:b.mode)!=null?E:"math"),y==="reject"||(oi.insert(a.model,fe,{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 _h(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 qm(a,y){const b=new Ei({from:a.context}),E=new An({mode:"math",type:"root",body:Ga(y,{context:b})}),ee=qc(fd(new fr(E.render(b),{classes:"ML__base"}),b));return Yc(ee,{classes:"ML__latex"}).toMarkup()}function Ym(a,y){var b;if(y.length===0){uu(a);return}let E="";for(const[re,ae]of y.entries()){const fe=ae,me=qm(a,ae),ve=jm(a.keybindings,fe).join("<br>");E+=`<li role="button" data-command="${fe}" ${re===a.suggestionIndex?"class=ML__popover__current":""}><span class="ML__popover__latex">${fe}</span><span class="ML__popover__command">${me}</span>`,ve&&(E+=`<span class="ML__popover__keybinding">${ve}</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"),Eh(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 Eh(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(()=>Eh(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,fe=window.innerHeight-document.documentElement.clientHeight,me=window.mathVirtualKeyboard.boundingRect.height,ve=document.getElementById("mathlive-suggestion-popover");E.x+ve.offsetWidth/2>re-ae?ve.style.left=`${re-ve.offsetWidth-ae}px`:E.x-ve.offsetWidth/2<0?ve.style.left="0":ve.style.left=`${E.x-ve.offsetWidth/2}px`;const Se=E.y-E.height;ee-fe-me-E.y<Se?(ve.classList.add("ML__popover--reverse-direction"),ve.classList.remove("top-tip"),ve.classList.add("bottom-tip"),ve.style.top=`${E.y-E.height-ve.offsetHeight-15}px`):(ve.classList.remove("ML__popover--reverse-direction"),ve.classList.add("top-tip"),ve.classList.remove("bottom-tip"),ve.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=_h("mathlive-suggestion-popover"),Oo("suggestion-popover"),Oo("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"),oi.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 Mh=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(Mh===null)try{const y=yield fetch(wf,{method:"HEAD"});y.status===200&&(Mh=y.url)}catch(y){console.error(`Invalid URL "${a}" (relative to "${wf}")`)}return new URL(a,Mh!=null?Mh:wf).href})}function tg(a,y,b={}){return new FontFace(a,`url(${y}.woff2) format('woff2')`,b)}var Wo="not-loaded";function ng(){return zl(this,null,function*(){return Wo="not-loaded",kh()})}function kh(){return zl(this,null,function*(){var a;if(Wo!=="not-loaded")return;if(Wo="loading",(a=getComputedStyle(document.documentElement).getPropertyValue("--ML__static-fonts"))!=null?a:!1){Wo="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))){Wo="ready";return}if(!window.MathfieldElement.fontsDirectory){Wo="not-loaded";return}const ee=yield x0(window.MathfieldElement.fontsDirectory);if(!ee){document.body.classList.add("ML__fonts-did-not-load"),Wo="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(fe=>{try{return fe.load()}catch(me){}}))).forEach(fe=>document.fonts.add(fe)),Wo="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")}Wo="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 ga(a,y){a&&(a.dirty||(a.dirty=!0,requestAnimationFrame(()=>{zo(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 Ei({from:_e(we({},a.context),{atomIdsSettings:{seed:y.forHighlighting?rg(An.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 Yc(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(!zo(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 fe=a.element.querySelector("[part=menu-toggle]");if(fe&&(a.model.atoms.length<=1||a.disabled||a.readOnly&&!a.hasEditableContent||a.userSelect==="none"?fe.style.display="none":fe.style.display=""),a.model.atoms.length<=1){const me=a.options.contentPlaceholder;me&&(ae+=`<span part=placeholder class="ML__content-placeholder">${Ua(me)}</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 fe of b.querySelectorAll(".ML__selection, .ML__contains-highlight"))fe.remove();!(y!=null&&y)&&Wo!=="error"&&Wo!=="ready"&&setTimeout(()=>{Wo==="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){Eh(a,{deferred:!0});let fe=E.at(E.position);for(;fe&&fe.type!=="prompt"&&!(fe.containsCaret&&fe.displayContainsHighlight);)fe=fe.parent;if(fe!=null&&fe.containsCaret&&fe.displayContainsHighlight){const me=ad(a,Tl(a,fe),ae);if(me){me.left/=ae,me.right/=ae,me.top/=ae,me.bottom/=ae;const ve=document.createElement("div");ve.classList.add("ML__contains-highlight"),ve.style.position="absolute",ve.style.left=`${me.left+1}px`,ve.style.top=`${Math.ceil(me.top)}px`,ve.style.width=`${Math.ceil(me.right-me.left)}px`,ve.style.height=`${Math.ceil(me.bottom-me.top)}px`,b.insertBefore(ve,b.childNodes[0])}}return}for(const fe of ag(sd(a,{excludeAtomsWithBackground:!0}))){fe.left/=ae,fe.right/=ae,fe.top/=ae,fe.bottom/=ae;const me=document.createElement("div");me.classList.add("ML__selection"),me.style.position="absolute",me.style.left=`${fe.left}px`,me.style.top=`${fe.top}px`,me.style.width=`${Math.ceil(fe.right-fe.left)}px`,me.style.height=`${Math.ceil(fe.bottom-fe.top-1)}px`,b.insertBefore(me,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 $o(a,y){y=we({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]=_e(we({},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;Ae(y)?(E=y[0],ee=y.slice(1)):E=y,E=E.replace(/-\w/g,ve=>ve[1].toUpperCase());const fe=zs[E],me=fe==null?void 0:fe.target;if(me==="model"){if(!a.isSelectionEditable&&(fe!=null&&fe.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(me==="virtual-keyboard")ae=(b=window.mathVirtualKeyboard.executeCommand(y))!=null?b:!1,re=!0;else if(zs[E]){if(!a.isSelectionEditable&&(fe!=null&&fe.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 me!=="virtual-keyboard"&&(!a.model.selectionIsCollapsed||fe!=null&&fe.changeSelection&&y!=="deleteBackward")&&(a.flushInlineShortcutBuffer(),fe!=null&&fe.changeContent||a.stopCoalescingUndo(),a.defaultStyle={}),ae&&ga(a),re}function sg(a,y){var b;if(!a)return!1;a.focus(),vp.keypressVibration&&ot()&&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}$o({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}$o({complete:cu},{target:"mathfield",audioFeedback:"return",canUndo:!0,changeContent:!0,changeSelection:!0}),$o({nextSuggestion:lg,previousSuggestion:cg},{target:"mathfield",audioFeedback:"keypress",changeSelection:!0});var Ah="mathlive#virtual-keyboard-message";function Cf(a){var y;return a.type!=="message"?!1:((y=a.data)==null?void 0:y.type)===Ah}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(we({type:Ah,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]"]]}},Dh={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 _0(a,y){var b,E,ee;const re=$l.singleton;if(!re)return;const ae=hu(a),fe=(E=(b=re.getKeycap(ae==null?void 0:ae.id))==null?void 0:b.variants)!=null?E:"";if(typeof fe=="string"&&!E0(fe)||Array.isArray(fe)&&fe.length===0){y==null||y();return}const me={};let ve="";for(const gn of hg(fe)){const hr=k0(gn),pn=Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);me[pn]=hr;const[On,gr]=Bh(hr);ve+=`<div id=${pn} class="item ${gr}">${On}</div>`}const Se=document.createElement("div");Se.setAttribute("aria-hidden","true"),Se.className="MLK__variant-panel",Se.style.height="auto";const He=Object.keys(me).length;let st=5;He===1?st=1:He===2||He===4?st=2:He===3||He===5||He===6?st=3:He>=7&&He<14&&(st=4),Se.style.width=`calc(var(--variant-keycap-length) * ${st} + 12px)`,Se.innerHTML=vp.createHTML(ve),Fs.open({root:(ee=re==null?void 0:re.container)==null?void 0:ee.querySelector(".ML__keyboard"),child:Se}),xd=new AbortController;const{signal:Mt}=xd,It=a==null?void 0:a.getBoundingClientRect();if(It){It.top-Se.clientHeight<0&&(Se.style.width="auto",He<=6?Se.style.height="56px":He<=12?Se.style.height="108px":He<=18?Se.style.height="205px":Se.classList.add("compact"));const gn=Math.max(0,Math.min(window.innerWidth-Se.offsetWidth,(It.left+It.right-Se.offsetWidth)/2)),hr=It.top-Se.clientHeight+5;Se.style.transform=`translate(${gn}px, ${hr}px)`,Se.classList.add("is-visible"),requestAnimationFrame(()=>{Se.addEventListener("pointerup",pn=>{const On=hu(pn.target);!(On!=null&&On.id)||!me[On.id]||(_f(me[On.id]),wd(),y==null||y(),pn.preventDefault())},{capture:!0,passive:!1,signal:Mt}),Se.addEventListener("pointerenter",pn=>{const On=hu(pn.target);!(On!=null&&On.id)||!me[On.id]||On.classList.add("is-active")},{capture:!0,signal:Mt}),Se.addEventListener("pointerleave",pn=>{const On=hu(pn.target);!(On!=null&&On.id)||!me[On.id]||On.classList.remove("is-active")},{capture:!0,signal:Mt}),window.addEventListener("pointercancel",()=>{wd(),y==null||y()},{signal:Mt}),window.addEventListener("pointerup",()=>{wd(),y==null||y()},{signal:Mt})})}}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(Je))y.push({class:"swatch-button",label:'<span style="border: 3px solid '+Je[b]+'"></span>',command:["applyStyle",{color:b}]});return y}if(a==="background-color"){const y=[];for(const b of Object.keys(Ve))y.push({class:"swatch-button",label:'<span style="background:'+Ve[b]+'"></span>',command:["applyStyle",{backgroundColor:b}]});return y}}function E0(a){return Dh[a]!==void 0}function hg(a){var y;return typeof a!="string"?a:(Dh[a]||(Dh[a]=(y=dg(a))!=null?y:[]),Dh[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 Ei,b=new An({mode:"math",type:"root",body:Ga(a,{context:y,args:ee=>ee==="@"?"{\\class{ML__box-placeholder}{\\blacksquare}}":"\\placeholder{}"})}),E=qc(fd(new fr(b.render(y),{classes:"ML__base"}),y));return Yc(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=>k0(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 fe=vd();fe&&(E=fe.virtualLayout),(!E||E==="auto")&&(E=(a={fr:"azerty",be:"azerty",al:"qwertz",ba:"qwertz",cz:"qwertz",de:"qwertz",hu:"qwertz",sk:"qwertz",ch:"qwertz"}[it.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 fe of re){const me=[];for(const ve of fe)/[a-z]/.test(ve)?me.push({label:ve,class:"hide-shift",shift:{label:ve.toUpperCase()},variants:E0(ve)?ve:void 0}):ve==="~"?E!=="dvorak"?me.push("[backspace]"):me.push({label:"[backspace]",width:1}):ve==="^"?me.push("[shift]"):ve===" "&&me.push("[separator-5]");ae.push(me)}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 M0(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}"`),M0(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=dt(ee,["rows"]);y=_e(we({},ae),{layers:Cd({rows:a.rows})})}else if("markup"in a&&typeof a.markup=="string"){const ee=a,{markup:re}=ee,ae=dt(ee,["markup"]);y=_e(we({},ae),{layers:Cd(a.markup)})}else y=we({},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 fe=ae,me=[re===y?"selected":"layer-switch"];fe.tooltip&&me.push("MLK__tooltip"),fe.labelClass&&me.push(...fe.labelClass.split(" ")),ee+=`<div class="${me.join(" ")}"`,fe.tooltip&&(ee+=" data-tooltip='"+((b=vt(fe.tooltip))!=null?b:fe.tooltip)+"' "),re!==y&&(ee+=`data-layer="${fe.layers[0].id}"`),ee+=`>${(E=fe.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='${vt("tooltip.undo")}'>
<svg><use xlink:href='#svg-undo' /></svg>
</div>`,redo:`<div class='action ${y.canRedo===!1?"disabled":""}'
data-command='"redo"'
data-tooltip='${vt("tooltip.redo")}'>
<svg><use xlink:href='#svg-redo' /></svg>
</div>`,cutToClipboard:`
<div class='action'
data-command='"cutToClipboard"'
data-tooltip='${vt("tooltip.cut to clipboard")}'>
<svg><use xlink:href='#svg-cut' /></svg>
</div>
`,copyToClipboard:`
<div class='action'
data-command='"copyToClipboard"'
data-tooltip='${vt("tooltip.copy to clipboard")}'>
<svg><use xlink:href='#svg-copy' /></svg>
</div>
`,pasteFromClipboard:`
<div class='action'
data-command='"pasteFromClipboard"'
data-tooltip='${vt("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=$l.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]=Bh(b);a.innerHTML=window.MathfieldElement.createHTML(E)}}function xg(){Oo("virtual-keyboard"),Oo("core"),kh()}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,fe)=>_g(a,ae,fe)).join(""));const E=document.createElement("div");E.className="MLK__backdrop",E.appendChild(b),y.appendChild(E),y.addEventListener("pointerdown",Mg,{passive:!1});const ee=y.querySelectorAll(".ML__edit-toolbar");if(ee)for(const ae of ee)ae.addEventListener("click",fe=>{var me,ve;let Se=fe.target,He="";for(;Se&&!He;)He=(me=Se==null?void 0:Se.getAttribute("data-command"))!=null?me:"",Se=(ve=Se==null?void 0:Se.parentElement)!=null?ve:null;He&&a.executeCommand(JSON.parse(He))});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",fe=>fe.preventDefault());return a.currentLayer=a.latentLayer,y}function _g(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(Eg(a,ee)),E.push("</div>");return E.join("")}function Eg(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,fe]=Bh(ee);/(^|\s)separator/.test(fe)?b+=`<div class="${fe}"`:b+=`<div tabindex="-1" id="${re}" class="${fe}"`,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 Bh(a,y={shifted:!1}){var b,E,ee,re,ae,fe,me;let ve="",Se=(b=a.class)!=null?b:"";if(y.shifted&&fu(a)&&(Se+=" is-active"),y.shifted&&"shift"in a)typeof a.shift=="string"?ve=Sd(a.shift):typeof a.shift=="object"&&(ve=a.shift.label?a.shift.label:(E=Sd(a.shift.latex||a.shift.insert||"")||a.shift.key)!=null?E:""),typeof a.shift=="object"&&(Se=(re=(ee=a.shift.class)!=null?ee:a.class)!=null?re:"");else{if(ve=a.label?a.label:(ae=Sd(a.latex||a.insert||"")||a.key)!=null?ae:"",a.shift){let He;typeof a.shift=="string"?He=Sd(a.shift):a.shift.label?He=a.shift.label:He=(fe=Sd(a.shift.latex||a.shift.insert||"")||a.shift.key)!=null?fe:"",ve+=`<span class="MLK__shift">${He}</span>`}a.aside&&(ve+=`<aside>${a.aside}</aside>`)}return a.layer&&!/layer-switch/.test(Se)&&(Se+=" layer-switch"),/(^|\s)(separator|action|shift|fnbutton|bigfnbutton)($|\s)/.test(Se)||(Se+=" MLK__keycap"),!/\bw[0-9]+\b/.test(Se)&&a.width&&(Se+=(me={0:" w0",.5:" w5",1.5:" w15",2:" w20",5:" w50"}[a.width])!=null?me:""),[ve,Se||"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 k0(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=_e(we(we({},mc[a.label]),a),{label:mc[a.label].label})),"key"in a&&a.key&&mc[a.key]&&(b=_e(we(we({},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=we(we({},b),window.mathVirtualKeyboard.actionKeycap)),a.label==="[shift]"&&(b=we(we({},b),window.mathVirtualKeyboard.shiftKeycap)),a.label==="[backspace]"&&(b=we(we({},b),window.mathVirtualKeyboard.backspaceKeycap)),a.label==="[tab]"&&(b=we(we({},b),window.mathVirtualKeyboard.tabKeycap)),b):a}var _d;function Mg(a){var y;if(a.button!==0)return;const b=$l.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,fe=ae.signal;ee.classList.add("is-pressed"),ee.addEventListener("pointerenter",Th(ae),{capture:!0,signal:fe}),ee.addEventListener("pointerleave",Th(ae),{capture:!0,signal:fe}),ee.addEventListener("pointercancel",Th(ae),{signal:fe}),ee.addEventListener("pointerup",Th(ae),{signal:fe}),fu(re)&&(ee.classList.add("is-active"),b.shiftPressCount++),re.variants&&(_d&&clearTimeout(_d),_d=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),_0(ee,()=>{ae.abort(),ee==null||ee.classList.remove("is-active")}))},300)),a.preventDefault()}function Th(a){return y=>{const b=hu(y.target);if(!(b!=null&&b.id))return;const E=$l.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"){_d&&clearTimeout(_d),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"}]):_f(ee.shift):_f(ee),E.shiftPressCount===1&&!y.shiftKey&&(E.shiftPressCount=0)),a.abort(),y.preventDefault();return}}}}function _f(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=$l.singleton)==null||y.executeCommand(b)}function kg(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&&!kg(y);)y=y.parentElement;return y!=null?y:void 0}function fu(a){return!!a.class&&/(^|\s)shift($|\s)/.test(a.class)}var $l=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"&&Ye()&&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=>M0(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]=Bh(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)&&_0(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:we({type:Ah,action:y},b)}));return}if(E)E.postMessage(we({type:Ah,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 Ae(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(ft()&&!("mathVirtualKeyboard"in window))if(window===window.top){const a=$l.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(Ae(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(fe=>parseInt(fe.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=$l.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>re})}ee="manual"}y.mathVirtualKeyboardPolicy=ee;break;case"letterShapeStyle":a.letterShapeStyle==="auto"?it.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=mt(a.macros);break;default:Ae(a[b])?y[b]=[...a[b]]:typeof a[b]=="object"&&!(a[b]instanceof Element)&&b!=="computeEngine"?y[b]=we({},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:Ae(a[ee])?E[ee]=[...a[ee]]:typeof a[ee]=="object"&&!(a[ee]instanceof Element)&&ee!=="computeEngine"?E[ee]=we({},a[ee]):E[ee]=a[ee];return typeof y=="string"?E[y]:E}function Ph(){return{readOnly:!1,defaultMode:"math",macros:{},registers:{},colorMap:Dt,backgroundColorMap:Ge,letterShapeStyle:it.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 A0(a){return a.defaultMode==="inline-math"?"math":a.defaultMode}function Nl(a,y){!a||!y||(Ae(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 Ef(a,y,b,E){function ee(ae,fe){for(const me of re)if(me.style[ae]!==fe)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=As),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 Ag(a){const y=a.at(a.position);y.type==="composition"&&(y.parent.removeChild(y),a.position-=1)}Ft(["math","displaymath"],Qo),Ft("center",Qo),ct("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 li("lines",a.args,[],{leftDelim:".",rightDelim:".",columns:[{align:"l"}]})}),sn("array","{columns:colspec}",(a,y,b,E)=>new li(a,Mf(y),b,{columns:E[0],mathstyleName:"textstyle"})),sn(["equation","equation*","subequations"],"",(a,y,b)=>new li(a,Mf(y),b,{columns:[{align:"c"}]})),sn(["multline","multline*"],"",Qo),sn(["align","align*","aligned","eqnarray"],"",Qo),sn("split","",Qo),sn(["gather","gathered"],"",Qo),sn(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],"[columns:colspec]",Qo),sn(["smallmatrix","smallmatrix*"],"[columns:colspec]",Qo),sn(["cases","dcases","rcases"],"",Qo);function Dg(a){for(const y of a)for(const b of y)if(b.length>0)return!1;return!0}function Mf(a,y=1){return Dg(a)?Array(y).fill([[new An({type:"first"}),new Jr]]):a.map(b=>b.length===0?[[new An({type:"first"})]]:b.map(E=>E.length===0?[new An({type:"first"})]:(E[0].type!=="first"&&E.unshift(new An({type:"first"})),E)))}function Qo(a,y=[[[]]],b=[],E=[]){switch(y=Mf(y,["split","align","align*","aligned","eqnarray"].includes(a)?2:1),a){case"math":return new li(a,y,b,{mathstyleName:"textstyle"});case"displaymath":return new li(a,y,b,{mathstyleName:"textstyle"});case"center":return new li(a,y,b,{columns:[{align:"c"}]});case"multline":case"multline*":return new li(a,y,b,{columns:[{align:"m"}],leftDelim:".",rightDelim:"."});case"split":return new li(a,y,b,{columns:[{align:"r"},{align:"l"}],minColumns:2});case"gather":case"gathered":return new li(a,y,b,{columns:[{gap:.25},{align:"c"},{gap:0}]});case"pmatrix":case"pmatrix*":return new li(a,y,b,{mathstyleName:"textstyle",leftDelim:"(",rightDelim:")",columns:vc(E[0])});case"bmatrix":case"bmatrix*":return new li(a,y,b,{mathstyleName:"textstyle",leftDelim:"[",rightDelim:"]",columns:vc(E[0])});case"Bmatrix":case"Bmatrix*":return new li(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\lbrace",rightDelim:"\\rbrace",columns:vc(E[0])});case"vmatrix":case"vmatrix*":return new li(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\vert",rightDelim:"\\vert",columns:vc(E[0])});case"Vmatrix":case"Vmatrix*":return new li(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\Vert",rightDelim:"\\Vert",columns:vc(E[0])});case"matrix":case"matrix*":return new li(a,y,b,{mathstyleName:"textstyle",leftDelim:".",rightDelim:".",columns:vc(E==null?void 0:E[0])});case"smallmatrix":case"smallmatrix*":return new li(a,y,b,{mathstyleName:"scriptstyle",columns:vc(E==null?void 0:E[0]),colSeparationType:"small",arraystretch:.5});case"cases":case"dcases":return new li(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 li(a,y,b,{arraystretch:1.2,leftDelim:".",rightDelim:"\\rbrace",columns:[{align:"l"},{gap:1},{align:"l"}]});case"lines":return new li(a,y,b,{leftDelim:".",rightDelim:".",columns:[{align:"l"}]});case"align":case"align*":case"aligned":case"eqnarray":{let ee=0;for(const fe of y)ee=Math.max(ee,fe.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 li(a,y,b,{arraycolsep:0,columns:re,minColumns:2})}}return new li(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 Bg(a,y){let b=a.at(a.position);for(;b&&!(b.parent instanceof li);)b=b.parent;if(b&&b.type==="array"&&b.environmentName,!b||!(b.parent instanceof li)){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=Qo("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=Qo("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 Ni){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 fe="pmatrix";const me=ee.leftDelim,ve=ee.rightDelim;me==="("&&(ve===")"||ve==="?")?fe="pmatrix":(me==="["||me==="\\lbrack")&&(ve==="]"||ve==="\\rbrack"||ve==="?")?fe="bmatrix":me==="\\vert"&&ve==="\\vert"?fe="vmatrix":me==="\\Vert"&&ve==="\\Vert"?fe="Vmatrix":(me==="{"||me==="\\lbrace")&&(ve==="."||ve==="?")&&(fe="cases");const Se=Qo(fe,y.endsWith("column")?[[ae,re]]:[[ae],[re]]);return ee.parent.addChildBefore(Se,ee),ee.parent.removeChild(ee),yc(Se,0,0)?bc(a,Se,0,0):y.endsWith("column")?yc(Se,0,1)?bc(a,Se,0,1):a.position=a.offsetOf(b):yc(Se,1,0)?bc(a,Se,1,0):a.position=a.offsetOf(b),[void 0,[0,0]]}}return b&&b.parent instanceof li?[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 Tg(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=Tg(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 $h(a,y){const[b,[E,ee]]=Bg(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 D0(a){return a.contentWillChange({inputType:"insertText"})?($h(a,"after row"),a.contentDidChange({inputType:"insertText"}),!0):!1}function Ig(a){return a.contentWillChange({inputType:"insertText"})?($h(a,"before row"),a.contentDidChange({inputType:"insertText"}),!0):!1}function B0(a){return a.contentWillChange({inputType:"insertText"})?($h(a,"after column"),a.contentDidChange({inputType:"insertText"}),!0):!1}function Pg(a){return a.contentWillChange({inputType:"insertText"})?($h(a,"before column"),a.contentDidChange({inputType:"insertText"}),!0):!1}function T0(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 li);)b=b.parent;if(Array.isArray(b==null?void 0:b.parentBranch)&&(b==null?void 0:b.parent)instanceof li){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 $g(a){return a.contentWillChange({inputType:"deleteContent"})?(I0(a,"column"),a.contentDidChange({inputType:"deleteContent"}),!0):!1}$o({addRowAfter:D0,addColumnAfter:B0,addRowBefore:Ig,addColumnBefore:Pg,removeRow:Og,removeColumn:$g,setEnvironment:T0},{target:"model",canUndo:!0,changeContent:!0,changeSelection:!0});function Nh(){return[new Jr]}var P0=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}};P0.maximumDepth=1e3;var Ng=P0;function kf(a,y,b){if(a.at(y).mode!=="text")return y;const E=b==="backward"?-1:1;let ee;if(pe.test(a.at(y).value)){let re=y,ae;do ae=a.at(re).mode==="text"&&pe.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,fe,me,ve;const Se=a.position;(E=b==null?void 0:b.extend)!=null&&E||a.collapseSelection(y);let He=a.at(a.position);if(y==="forward"&&(He.type==="subsup"?(He=He.rightSibling,He||(He=a.at(a.position+1))):He=a.at(a.position+1)),!He)return a.announce("plonk"),!1;let st=a.offsetOf(He);if(He instanceof vs)st=kf(a,st,y);else if(He instanceof eo)if(He.isSuggestion)for(console.assert(y==="forward");He&&He instanceof eo;)He.isSuggestion=!1,st=a.offsetOf(He),He=He.rightSibling;else if(y==="forward"){if(He=He.rightSibling,!He||!(He instanceof eo))return a.announce("plonk"),!1;for(;He&&He instanceof eo&&/[a-zA-Z\*]/.test(He.value);)st=a.offsetOf(He),He=He.rightSibling}else{if(He=He.leftSibling,!He||!(He instanceof eo))return a.announce("plonk"),!1;for(;He&&He instanceof eo&&/[a-zA-Z\*]/.test(He.value);)st=a.offsetOf(He),He=He.leftSibling}else if(y==="forward"&&He.type==="mopen"){let Mt=0;do He.type==="mopen"?Mt+=1:He.type==="mclose"&&(Mt-=1),He=He.rightSibling;while(!He.isLastSibling&&Mt!==0);st=a.offsetOf(He.leftSibling)}else if(y==="backward"&&He.type==="mclose"){let Mt=0;do He.type==="mopen"?Mt+=1:He.type==="mclose"&&(Mt-=1),He=He.leftSibling;while(!He.isFirstSibling&&Mt!==0);st=a.offsetOf(He)}else if(y==="backward")if(He.type==="first")for(;st>0&&He.type==="first";)st-=1,He=a.at(st);else{const Mt=He.type;He.type==="subsup"&&(st=a.offsetOf(a.at(st).leftSibling)),st-=1;let It=(ee=a.at(st))==null?void 0:ee.type;for(;st>=0&&It===Mt;)((re=a.at(st))==null?void 0:re.type)==="subsup"?st=a.offsetOf(a.at(st).leftSibling):st-=1,It=a.at(st).type}else{const{type:Mt}=He;let It=(ae=a.at(st))==null?void 0:ae.type;const{lastOffset:gn}=a;for(;st<=gn&&(It===Mt||It==="subsup");){for(;((fe=a.at(st).rightSibling)==null?void 0:fe.type)==="subsup";)st=a.offsetOf(a.at(st).rightSibling);st+=1,It=(me=a.at(st))==null?void 0:me.type}st-=1}if((ve=b==null?void 0:b.extend)!=null&&ve){if(!a.setSelection(a.anchor,st))return a.announce("plonk"),!1}else{if(st===a.position)return a.announce("plonk"),!1;a.position=st}return a.announce("move",Se),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[fe,me]=g0(a);fe!==void 0&&me!==void 0&&a.deleteAtoms([fe,me])}if(y==="upward")return Fg(a,b);if(y==="downward")return zg(a,b);if(b.extend){let fe=Rh(a,a.position,y);fe<0&&(fe=0),fe>a.lastOffset&&(fe=a.lastOffset);const me=a.setSelection(a.anchor,fe);return a.mathfield.stopCoalescingUndo(),me}if(a.selectionIsPlaceholder){a.collapseSelection(y);const fe=Ks(a,y);return a.mathfield.stopCoalescingUndo(),fe}let re=a.position;const ae=re;if(a.collapseSelection(y)?(re=a.position,O0(a,re)||(re=Rh(a,re,y))):re=Rh(a,re,y),re<0||re>a.lastOffset){let fe=!0;return a.silenceNotifications||(fe=(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),fe&&a.announce("plonk"),fe}return a.setPositionHandlingPlaceholder(re),a.mathfield.stopCoalescingUndo(),a.announce("move",ae),!0}function Rh(a,y,b){return y=y+(b==="forward"?1:-1),y<0||y>a.lastOffset||O0(a,y)?y:Rh(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 Rg(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(ve=>ve.type==="prompt"&&!ve.captureSelection):b,fe=ru(a.mathfield.getHTMLElement(y)).right,me=a.offsetOf(Rg(a.mathfield,ae,fe))-(re?1:0);if(E){const[ve,Se]=a.selection.ranges[0];let He;me<(ee==="up"?ve:Se)?He={ranges:[[me,Se]],direction:"backward"}:He={ranges:[[ve,me]],direction:"forward"},a.setSelection(He)}else a.setPositionHandlingPlaceholder(me);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 me,ve;let Se=!0;return a.silenceNotifications||(Se=(ve=(me=a.mathfield.host)==null?void 0:me.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"upward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?ve:!0),a.announce(Se?"plonk":"line"),Se},ae=a.at(a.position);let fe=ae;for(;fe&&fe.parentBranch!=="below"&&!(Array.isArray(fe.parentBranch)&&fe.parent instanceof li);)fe=fe.parent;if(Array.isArray(fe==null?void 0:fe.parentBranch)&&fe.parent instanceof li){const me=fe.parent;if(fe.parentBranch[0]<1)return re();const ve=fe.parentBranch[0]-1,Se=me.array[ve][fe.parentBranch[1]];if(!Se.some(st=>st.type==="prompt"&&!st.captureSelection)&&a.mathfield.hasEditablePrompts)return re();Fh(a,ae,Se,ee,"up")}else if(fe){const me=(E=fe.parent.branch("above"))!=null?E:fe.parent.createBranch("above");if(!me.some(Se=>Se.type==="prompt"&&Se.placeholderId)&&a.mathfield.hasEditablePrompts)return re();Fh(a,ae,me,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 me,ve;let Se=!0;return a.silenceNotifications||(Se=(ve=(me=a.mathfield.host)==null?void 0:me.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"downward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?ve:!0),a.announce(Se?"plonk":"line"),Se},ae=a.at(a.position);let fe=ae;for(;fe&&fe.parentBranch!=="above"&&!(Array.isArray(fe.parentBranch)&&fe.parent instanceof li);)fe=fe.parent;if(Array.isArray(fe==null?void 0:fe.parentBranch)&&fe.parent instanceof li){const me=fe.parent;if(fe.parentBranch[0]+1>me.array.length-1)return re();const ve=fe.parentBranch[0]+1,Se=me.array[ve][fe.parentBranch[1]];if(!Se.some(st=>st.type==="prompt"&&!st.captureSelection)&&a.mathfield.hasEditablePrompts)return re();Fh(a,ae,Se,ee,"down")}else if(fe){const me=(E=fe.parent.branch("below"))!=null?E:fe.parent.createBranch("below");if(!me.some(Se=>Se.type==="prompt")&&a.mathfield.hasEditablePrompts)return re();Fh(a,ae,me,ee,"down")}else return re();return!0}function $0(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 R0(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(me){const ve=[],Se=[];return[...me.querySelectorAll(`input, select, textarea, a[href], button,
[tabindex], audio[controls], video[controls],
[contenteditable]:not([contenteditable="false"]), details>summary`)].filter(y).forEach((st,Mt)=>{const It=E(st);It===0?ve.push(st):Se.push({documentOrder:Mt,tabIndex:It,node:st})}),Se.sort((st,Mt)=>st.tabIndex===Mt.tabIndex?st.documentOrder-Mt.documentOrder:st.tabIndex-Mt.tabIndex).map(st=>st.node).concat(ve)}function y(me){return!(!b(me)||ee(me)||E(me)<0)}function b(me){return!(me.disabled||me.type==="hidden"&&me.tagName.toUpperCase()==="INPUT"||fe(me))}function E(me){var ve;const Se=Number.parseInt((ve=me.getAttribute("tabindex"))!=null?ve:"NaN",10);return Number.isNaN(Se)?me.contentEditable==="true"||(me.nodeName==="AUDIO"||me.nodeName==="VIDEO")&&me.getAttribute("tabindex")===null?0:me.tabIndex:Se}function ee(me){return me.tagName.toUpperCase()==="INPUT"&&me.type==="radio"&&!ae(me)}function re(me,ve){for(const Se of me)if(Se.checked&&Se.form===ve)return Se;return null}function ae(me){var ve;if(!me.name)return!0;const He=((ve=me.form)!=null?ve:me.ownerDocument).querySelectorAll('input[type="radio"][name="'+me.name+'"]'),st=re(He,me.form);return!st||st===me}function fe(me){if(!ft()||me===document.activeElement||me.contains(document.activeElement))return!1;if(getComputedStyle(me).visibility==="hidden")return!0;const ve=me.getBoundingClientRect();if(ve.width===0||ve.height===0)return!0;for(;me;){if(getComputedStyle(me).display==="none")return!0;me=me.parentElement}return!1}return ft()?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 fe=a.at(a.anchor).parentPrompt;fe?y==="forward"?ae=a.offsetOf(fe)+1:ae=a.offsetOf(fe.leftSibling):ae=Math.max(a.position+re,0);const me=Lf(a,ae,y);if(!me||y==="forward"&&a.offsetOf(me)<ae||y==="backward"&&a.offsetOf(me)>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 Se=Wg();if(!document.activeElement||Se.length<=1)return a.announce("plonk"),!1;let He=Se.indexOf(document.activeElement)+re;return He<0&&(He=Se.length-1),He>=Se.length&&(He=0),Se[He].focus(),a.mathfield.stopCoalescingUndo(),!0}return xs(a,me),!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)}$o({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 fe=b.subsupPlacement?R0(a):N0(a);return a.mathfield.stopCoalescingUndo(),fe}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=>$0(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 st=re;for(;st&&st.mode==="text";)st=st.leftSibling;let Mt=re;for(;((y=Mt.rightSibling)==null?void 0:y.mode)==="text";)Mt=Mt.rightSibling;if(st&&Mt)return yo(a,[st,Mt])}if(re.rightSibling.mode==="text"){let st=re;for(;st&&st.mode==="text";)st=st.rightSibling;return st?(xs(a,(b=st.leftSibling)!=null?b:st),a.mathfield.switchMode("math"),!0):xs(a,a.lastOffset)}}const fe=a.at(a.anchor).parentPrompt,me=fe?a.offsetOf(fe)+1:Math.max(a.position+1,0),ve=Lf(a,me,"forward");if(ve)return xs(a,ve);const Se=F0(a,re,st=>st.type==="leftright"||st.type==="text","forward");if(Se){if(Se.mode==="text"){let st=Se;for(;st&&st.mode==="text";)st=st.rightSibling;return yo(a,[(E=Se.leftSibling)!=null?E:Se,(ee=st.leftSibling)!=null?ee:st])}return yo(a,Se)}const He=re.parent;if(He){if(He.type==="leftright"||He.type==="surd")return yo(a,He);if(re.parentBranch==="superscript"&&He.subscript)return yo(a,He.subscript);if(re.parentBranch==="above"&&He.below)return yo(a,He.below);if(re.parentBranch==="superscript"||re.parentBranch==="subscript")return xs(a,He);if(re.parentBranch==="above"||re.parentBranch==="below")return yo(a,He)}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 fe=b;for(;fe&&fe.mode==="text";)fe=fe.leftSibling;let me=b;for(;((y=me.rightSibling)==null?void 0:y.mode)==="text";)me=me.rightSibling;if(fe&&me)return yo(a,[fe,me])}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 fe=F0(a,b,ve=>ve.type==="leftright"||ve.type==="text","backward");if(fe){if(fe.mode==="text"){let ve=fe;for(;ve&&ve.mode==="text";)ve=ve.leftSibling;return yo(a,[fe,ve])}return yo(a,fe)}const me=b.parent;if(me){if(me.type==="leftright"||me.type==="surd")return yo(a,me);if(b.parentBranch==="subscript"&&me.superscript)return yo(a,me.superscript);if(b.parentBranch==="below"&&me.above)return yo(a,me.above);if(b.parentBranch==="superscript"||b.parentBranch==="subscript")return xs(a,me);if(b.parentBranch==="above"||b.parentBranch==="below")return yo(a,me)}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:R0},{target:"model",changeSelection:!0}),$o({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(An.serialize([ae],{defaultMode:"math"})),ae.mode="math"),E-=1,y-=1}Af(a),a.contentDidChange({data:bi(re),inputType:"insertText"})}function Af(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:fe}=E.at(E.position);if(ae&&fe instanceof Ni&&fe.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 me=E.at(E.position);return me.value="\u22C5",me.style.variant="normal",me.command="\\cdot",me.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 Af(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 Gg(a){if(a.keystrokeCaptionVisible=!a.keystrokeCaptionVisible,a.keystrokeCaptionVisible){const y=z0();y.innerHTML=""}else{const y=_h("mathlive-keystroke-caption-panel");y.style.visibility="hidden"}return!1}function z0(){const a=document.getElementById("mathlive-keystroke-caption-panel");return a||(Oo("keystroke-caption"),Oo("core"),_h("mathlive-keystroke-caption-panel"))}function Ug(){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 Mt=vd();a.keyboardLayout!==Mt.id&&(a.keyboardLayout=Mt.id,a._keybindings=void 0)}if(clearTimeout(a.inlineShortcutBufferFlushTimer),a.inlineShortcutBufferFlushTimer=0,Vg(a,ae),y.isTrusted&&y.defaultPrevented)return a.flushInlineShortcutBuffer(),!1;let fe,me="",ve;const Se=a.inlineShortcutBuffer;if(a.isSelectionEditable){if(re.mode==="math")if(ae==="[Backspace]")Se.pop();else if(!wh(y))a.flushInlineShortcutBuffer();else{const Mt=lu(y),It=[...(E=(b=Se[Se.length-1])==null?void 0:b.keystrokes)!=null?E:[],Mt];Se.push({state:re.getState(),keystrokes:It,leftSiblings:Xg(a)});let gn=0,hr="";for(;!fe&&gn<It.length;)ve=Se.length-(It.length-gn),hr=It.slice(gn).join(""),fe=td(Se[ve].leftSiblings,hr,a.options.inlineShortcuts),!fe&&/^[a-zA-Z][a-zA-Z0-9]+?([_\^][a-zA-Z0-9\*\+\-]+?)?$/.test(hr)&&(fe=a.options.onInlineShortcut(a,hr)),gn+=1;a.flushInlineShortcutBuffer({defer:!0})}a.options.smartMode&&(fe?a.switchMode("math"):jg(a,ae,y)&&(a.switchMode({math:"text",text:"math"}[re.mode]),me=""))}if(!fe){if(me||(me=Zm(a.keybindings,re.mode,y)),!me&&(ae==="[Enter]"||ae==="[Return]")){let Mt=!1;return re.contentWillChange({inputType:"insertLineBreak"})&&(a.host&&(Mt=!a.host.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),Mt||y.preventDefault&&(y.preventDefault(),y.stopPropagation()),re.contentDidChange({inputType:"insertLineBreak"})),Mt}if((!me||ae==="[Space]")&&re.mode==="math"){if(ae==="[Space]"){if(a.adoptStyle="none",a.flushInlineShortcutBuffer(),a.options.mathModeSpace)return oi.insert(re,a.options.mathModeSpace,{format:"latex",mode:"math"}),a.snapshot("insert-space"),me="",a.dirty=!0,a.scrollIntoView(),y.preventDefault&&(y.preventDefault(),y.stopPropagation()),!1;const Mt=re.at(re.position+1),It=re.at(re.position-1);if((Mt==null?void 0:Mt.mode)==="text"||(It==null?void 0:It.mode)==="text")return oi.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)===","&&(me="insertDecimalSeparator")}}if(!fe&&!me){if(re.mathfield.smartFence){if(Bf(re,lu(y),a.effectiveStyle))return a.dirty=!0,a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1}else{const{parent:Mt}=re.at(re.position);if(Mt instanceof Ni&&Mt.rightDelim==="?"&&re.at(re.position).isLastSibling&&/^[)}\]|]$/.test(ae))return a.snapshot(),Mt.isDirty=!0,Mt.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 It=lu(y);if(It==="("||It==="{"||It==="["){const gn={"(":"(","{":"\\lbrace","[":"\\lbrack"}[It],hr={"(":")","{":"\\rbrace","[":"\\rbrack"}[It],[pn,On]=ja(re.selection);return a.snapshot(),re.position=On,oi.insert(re,hr,{format:"latex"}),re.position=pn,oi.insert(re,gn,{format:"latex"}),re.setSelection(pn+1,On+1),re.contentDidChange({data:It,inputType:"insertText"}),a.snapshot("insert-fence"),a.dirty=!0,a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1}}}return!0}const He=re.at(Math.max(re.position,re.anchor)),{parent:st}=He;if(me==="moveAfterParent"&&(st==null?void 0:st.type)==="leftright"&&He.isLastSibling&&a.options.smartFence&&Bf(re,".",a.defaultStyle)&&(me="",ga(a)),a.keyboardDelegate.cancelComposition(),me)a.executeCommand(me);else if(fe){const Mt=a.effectiveStyle;re.setState(Se[ve].state);const It=Se[Se.length-1].keystrokes;for(const gn of It)oi.insert(re,gn,{silenceNotifications:!0,style:Mt});a.snapshot("insert-shortcut"),re.setState(Se[ve].state),re.deferNotifications({content:!0,selection:!0,data:fe,type:"insertText"},()=>(oi.insert(re,fe,{format:"latex",style:Mt}),Af(a.model),fe.endsWith(" ")&&(a.switchMode("text"),oi.insert(re," ",{style:Mt,mode:"text"})),a.snapshot(),re.selectionIsCollapsed||a.flushInlineShortcutBuffer(),!0)),a.dirty=!0,re.announce("replacement")}return a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1}function Df(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(me=>me.toUpperCase())),b.simulateKeystroke){let me=!0;for(const ve of ee)K0(a,new KeyboardEvent("keypress",{key:ve}))&&(me=!1);if(me)return}const ae=E.at(E.position),fe=we(we({},ae.computedStyle),a.defaultStyle);if(E.selectionIsCollapsed||(E.deleteAtoms(ja(E.selection)),a.snapshot("delete")),E.mode==="latex")E.deferNotifications({content:!0,selection:!0,data:y,type:"insertText"},()=>{Ch(a);for(const me of ee)oi.insert(E,me);a.snapshot("insert-latex"),bd(a)});else if(E.mode==="text"){for(const me of ee)oi.insert(E,me,{style:fe});a.snapshot("insert-text")}else if(E.mode==="math")for(const me of ee)qg(a,me,fe,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 qg(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){Yg(ee),oi.insert(ee,y,{style:b}),a.snapshot(),$0(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=we({},b),ae.style.variant&&(b.variant=ae.style.variant),ae.style.variantStyle&&(b.variantStyle=ae.style.variantStyle))}oi.insert(ee,y,{style:b}),a.snapshot(`insert-${ee.at(ee.position).type}`)}function Yg(a){a.selectionIsCollapsed||(a.deleteAtoms(ja(a.selection)),a.mathfield.snapshot("delete"))}function Bf(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],fe=ne[re];if(!a.selectionIsCollapsed){a.mathfield.snapshot();const[me,ve]=ja(a.selection),Se=a.extractAtoms([me,ve]),He=ee.addChildrenAfter([new Ni("left...right",Se,{leftDelim:re,rightDelim:fe})],a.at(me));return a.setSelection(a.offsetOf(He.firstChild),a.offsetOf(He.lastChild)),a.mathfield.snapshot("insert-fence"),a.contentDidChange({data:re,inputType:"insertText"}),!0}if(re==="|"){const me=ee instanceof Ni?ee.leftDelim+ee.rightDelim:"";if(me==="\\lbrace\\rbrace"||me==="\\{\\}"||me==="\\lbrace?")return a.mathfield.snapshot(),oi.insert(a,"\\,\\middle\\vert\\,",{format:"latex",style:b}),a.mathfield.snapshot("insert-fence"),a.contentDidChange({data:re,inputType:"insertText"}),!0}if(fe){if(ee instanceof Ni&&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 Ni)){let He=E;for(;He&&!(He.type==="mclose"&&He.value===fe);)He=He.rightSibling;if(He){a.mathfield.snapshot();const st=a.extractAtoms([a.offsetOf(E),a.offsetOf(He)]);return st.pop(),ee.addChildrenAfter([new Ni("left...right",st,{leftDelim:re,rightDelim:fe})],E),a.position=a.offsetOf(ee.firstChild)+1,a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}}const me=a.offsetOf(E.lastSibling);let ve;for(ve=a.position;ve<=me;ve++){const He=a.at(ve);if(He instanceof Ni&&(He.leftDelim==="?"||He.leftDelim===".")&&H0(re,He.rightDelim))break}const Se=a.at(ve);if(ve<=me&&Se instanceof Ni){Se.leftDelim=re,a.mathfield.snapshot();let He=a.extractAtoms([a.position,ve-1]);return He=He.filter(st=>st.type!=="first"),Se.addChildren(He,Se.parentBranch),a.position+=1,a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}if(ee instanceof Ni&&(ee.leftDelim==="?"||ee.leftDelim===".")&&H0(re,ee.rightDelim)){ee.isDirty=!0,ee.leftDelim=re,a.mathfield.snapshot();const He=a.extractAtoms([a.offsetOf(E.firstSibling),a.position]);for(const st of He)ee.parent.addChildBefore(st,ee);return a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}if(!(ee instanceof Ni&&ee.leftDelim==="|")){if(a.mathfield.snapshot(),oi.insert(a,`\\left${re}\\right?`,{format:"latex",style:b}),E.lastSibling.type!=="first"){const He=a.offsetOf(E.lastSibling),st=a.extractAtoms([a.position,He]);a.at(a.position).body=st,a.position-=1}return a.mathfield.snapshot("insert-fence"),!0}}if(ae){let me=E;for(;me;){if(me.type==="mopen"&&me.value===ae){a.mathfield.snapshot();const Mt=me.leftSibling,It=a.extractAtoms([a.offsetOf(me.leftSibling),a.offsetOf(E)]);It.shift();const gn=new Ni("left...right",It,{leftDelim:ae,rightDelim:re});return ee.addChildrenAfter([gn],Mt),a.position=a.offsetOf(gn),a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}me=me.leftSibling}if(ee instanceof Ni&&E.isLastSibling&&Tf(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 ve=a.offsetOf(E.firstSibling);let Se;for(Se=a.position;Se>=ve;Se--){const Mt=a.at(Se);if(Mt instanceof Ni&&(Mt.rightDelim==="?"||Mt.rightDelim===".")&&Tf(Mt.leftDelim,re))break}const He=a.at(Se);if(Se>=ve&&He instanceof Ni)return a.mathfield.snapshot(),He.rightDelim=re,He.addChildren(a.extractAtoms([Se,a.position]),He.parentBranch),a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0;if(ee instanceof Ni&&(ee.rightDelim==="?"||ee.rightDelim===".")&&Tf(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 st=ee.parent;return st instanceof Ni&&(st.rightDelim==="?"||st.rightDelim===".")&&a.at(a.position).isLastSibling?(a.position=a.offsetOf(st),Bf(a,re,b)):!1}return!1}function Tf(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}$o({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:Gg,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)=>(Df(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}}),$o({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"}),$o({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"}),ga(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=we(we({},a.defaultStyle),b)):a.model.deferNotifications({content:!0,type:"insertText"},()=>{E.selection.ranges.forEach(ee=>Ef(E,ee,b,{operation:"toggle"})),a.snapshot("style-change")}),!0}$o({applyStyle:Jg},{target:"mathfield",canUndo:!0,changeContent:!0});function If(a,y){var b,E,ee,re,ae,fe,me,ve,Se,He;const st={};if(typeof y.color=="string"){const It=(E=a.colorMap((b=y.color)!=null?b:y.verbatimColor))!=null?E:"none";It!==y.color&&(st.verbatimColor=(ee=y.verbatimColor)!=null?ee:y.color),st.color=It}if(typeof y.backgroundColor=="string"){const It=(ae=a.backgroundColorMap((re=y.backgroundColor)!=null?re:y.verbatimBackgroundColor))!=null?ae:"none";It!==y.backgroundColor&&(st.verbatimBackgroundColor=(fe=y.verbatimBackgroundColor)!=null?fe:y.backgroundColor),st.backgroundColor=It}typeof y.fontFamily=="string"&&(st.fontFamily=y.fontFamily),typeof y.series=="string"&&(st.fontSeries=y.series),typeof y.fontSeries=="string"&&(st.fontSeries=y.fontSeries.toLowerCase()),st.fontSeries&&(st.fontSeries=(me={bold:"b",medium:"m",normal:"m"}[st.fontSeries])!=null?me:st.fontSeries),typeof y.shape=="string"&&(st.fontShape=y.shape),typeof y.fontShape=="string"&&(st.fontShape=y.fontShape.toLowerCase()),st.fontShape&&(st.fontShape=(ve={italic:"it",up:"n",upright:"n",normal:"n"}[st.fontShape])!=null?ve:st.fontShape),y.variant&&(st.variant=y.variant.toLowerCase()),y.variantStyle&&(st.variantStyle=y.variantStyle.toLowerCase());const Mt=(Se=y.size)!=null?Se:y.fontSize;return typeof Mt=="number"?st.fontSize=Math.max(1,Math.min(10,Mt)):typeof Mt=="string"&&(st.fontSize=(He={size1:1,size2:2,size3:3,size4:4,size5:5,size6:6,size7:7,size8:8,size9:9,size10:10}[Mt.toLowerCase()])!=null?He:{tiny:1,scriptsize:2,footnotesize:3,small:4,normal:5,normalsize:5,large:6,Large:7,LARGE:8,huge:9,Huge:10}[Mt]),st}function Pf(a){let[y,b]=ja(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 fe=b==="forward"?1:-1;if(ae.mode==="text"){for(;ae&&!(ae.mode!=="text"||!pe.test(ae.value));)y+=fe,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+=fe,ae=a.at(y);else for(;ae&&ae.mode==="latex"&&/[a-zA-Z\*]/.test(ae.value);)y+=fe,ae=a.at(y);else if(ae.value==="{"){if(b==="forward"){for(;ae&&ae.mode==="latex"&&ae.value!=="}";)y+=fe,ae=a.at(y);return y}return y-1}else if(ae.value==="}"){if(b==="backward"){for(;ae&&ae.mode==="latex"&&ae.value!=="{";)y+=fe,ae=a.at(y);return y-1}return y}return y-1}if(ae.mode==="math"){if(ae.isDigit()){for(;(E=a.at(y+fe))!=null&&E.isDigit();)y+=fe;return b==="backward"?y-1:y}if(ae.style.variant||ae.style.variantStyle){let me=(ee=a.at(y))==null?void 0:ee.style;for(;me&&me.variant===ae.style.variant&&me.variantStyle===ae.style.variantStyle;)me=(re=a.at(y+fe))==null?void 0:re.style,y+=fe;return b==="backward"?y-1:y}return y}return y}$o({selectGroup:a=>{const y=Pf(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,Ed=0,Hh=class ts{static start(y,b,E,ee){var re;ts.element=y,(re=ts.controller)==null||re.abort(),ts.controller=new AbortController;const ae={signal:ts.controller.signal};"PointerEvent"in window?(y.addEventListener("pointermove",E,ae),y.addEventListener("pointerup",ee,ae),y.addEventListener("pointercancel",ee,ae),Of(b)&&(ts.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=ts.controller)==null||y.abort(),ts.controller=void 0,typeof ts.pointerId=="number"&&(ts.element.releasePointerCapture(ts.pointerId),ts.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,fe="none",me=!1,ve=!1;const Se=y.clientX,He=y.clientY,st=Date.now(),Mt=E.field,It=setInterval(()=>{me?Mt.scroll({top:0,left:Mt.scrollLeft-16}):ve&&Mt.scroll({top:0,left:Mt.scrollLeft+16})},32);function gn(){Hh.stop(),re=!1,clearInterval(It),a.element.classList.remove("tracking"),y&&y.preventDefault()}function hr(On){if(!E.hasFocus()){gn();return}const gr=On.clientX,Un=On.clientY,zr=Of(On)&&On.pointerType==="touch"?20:5;if(Date.now()<st+500&&Math.abs(Se-gr)<zr&&Math.abs(He-Un)<zr){On.preventDefault(),On.stopPropagation();return}const Xr=Mt.getBoundingClientRect();ve=gr>Xr.right,me=gr<Xr.left;let jr=ee;Of(On)&&(On.isPrimary||(jr=Md(E,On.clientX,On.clientY,{bias:0})));const ki=Md(E,gr,Un,{bias:gr<=Se?gr===Se?0:-1:1});jr>=0&&ki>=0&&(E.model.extendSelectionTo(jr,ki),ga(a)),ae&&Pf(E.model)}wc&&Math.abs(wc.x-Se)<5&&Math.abs(wc.y-He)<5&&Date.now()<wc.time+500?(Ed+=1,wc.time=st):(wc={x:Se,y:He,time:st},Ed=1);const pn=Mt.getBoundingClientRect();if(Se>=pn.left&&Se<=pn.right&&He>=pn.top&&He<=pn.bottom){if(a.flushInlineShortcutBuffer(),a.adoptStyle="left",ee=Md(a,Se,He,{bias:0}),ee>=0){if(a.element.classList.add("tracking"),y.shiftKey){const On=a.model.selectionIsCollapsed;a.model.extendSelectionTo(a.model.anchor,ee),v0(a.model)||On?fe="all":fe="selection"}else a.model.at(ee).type==="placeholder"?(a.model.setSelection(ee-1,ee),fe="selection"):((b=a.model.at(ee).rightSibling)==null?void 0:b.type)==="placeholder"?(a.model.setSelection(ee,ee+1),fe="selection"):(a.model.position=ee,v0(a.model)?fe="all":fe="selection");a.defaultStyle={},y.detail===3||Ed>2?(gn(),(y.detail===3||Ed===3)&&(a.model.selection={ranges:[[0,a.model.lastOffset]]},fe="all")):re||(re=!0,Hh.start(Mt,y,hr,gn),(y.detail===2||Ed===2)&&(ae=!0,Pf(a.model),fe="all"))}a.hasFocus()||(fe="none",a.focus({preventScroll:!0}))}else wc=null;a.stopCoalescingUndo(),fe!=="none"&&(a.model.selectionIsCollapsed&&(fe="all"),ga(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=Tl(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 fe of b.children){const me=j0(a,y,fe,E,ee);me[0]<=ae[0]&&(ae=me)}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 Md(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 fe=[];let me=ae;for(;me;)fe.unshift(me),me=me.parent;for(const Se of fe)if(Se.captureSelection){ae=Se;break}let ve=a.model.offsetOf(ae);if(ve<0)return-1;if(ae.leftSibling)if(E.bias===0&&ae.type!=="placeholder"){const Se=Tl(a,ae);Se&&y<(Se.left+Se.right)/2&&(ve=a.model.offsetOf(ae.leftSibling))}else E.bias<0&&(ve=a.model.offsetOf(ae.leftSibling));return ve}var tv=class extends oi{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:fe}=a;fe.selectionIsCollapsed||fe.deleteAtoms(ja(fe.selection));const me=fe.at(fe.position);if(me.parent instanceof li){console.assert(me.parentBranch!==void 0);const ve=[];let Se=[];ae[0].type==="first"&&ae.shift(),ae[ae.length-1].type==="first"&&ae.pop();for(const It of ae)It.type==="first"&&Se.length>0?(ve.push(Se),Se=[It]):Se.push(It);Se.length>0&&ve.push(Se);let He=Number(me.parentBranch[0]),st=Number(me.parentBranch[1]);const Mt=me.parent.maxColumns;for(;me.parent.colCount-st<ve.length&&me.parent.colCount<Mt;)me.parent.addColumn();me.parent.addChildrenAfter(ve[0],me);for(let It=1;It<ve.length;It++)st++,st>=Mt&&(st=0,me.parent.addRowAfter(He),He++),me.parent.setCell(He,st,ve[It])}else me.parent.addChildrenAfter(ae.filter(ve=>ve.type!=="first"),me);return fe.position=fe.offsetOf(ae[ae.length-1]),fe.contentDidChange({inputType:"insertFromPaste"}),ga(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]=$s(b),E==="auto"&&re&&(E="latex"),a.stopCoalescingUndo(),a.stopRecording(),this.insert(a.model,b,{format:E})&&(a.startRecording(),a.snapshot("paste"),ga(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 fe=a.silenceNotifications;a.silenceNotifications=!0;const me={"?":"\\placeholder{}","@":"\\placeholder{}"};me[0]=b.insertionMode==="replaceAll"?"":a.getValue(a.selection,"latex-unstyled"),b.insertionMode==="replaceSelection"&&!a.selectionIsCollapsed?a.deleteAtoms(ja(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 ve=-1;me[0]?me["@"]=me[0]:typeof y=="string"&&/(^|[^\\])#@/.test(y)&&(ve=rv(a),ve>=0&&(me["@"]=a.getValue(ve,a.position,"latex"))),me[0]||(me[0]=me["?"]);let Se=!1;const He=gr=>(Se=!0,me[gr]);let[st,Mt]=V0(a,y,He,b);if(!Mt)return!1;const It=Mt.length===1&&Mt[0].type==="genfrac";It&&ve>=0&&typeof a.mathfield.options.isImplicitFunction=="function"&&a.mathfield.options.isImplicitFunction(a.at(a.position).command)?(me["@"]=me["?"],Se=!1,[st,Mt]=V0(a,y,He,b)):ve>=0&&a.deleteAtoms([ve,a.position]);const{parent:gn}=a.at(a.position),hr=gn.hasEmptyBranch("body");if(It&&st!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&gn instanceof Ni&&gn.leftDelim==="("&&hr){const gr=gn.parent,Un=gn.parentBranch;gr.removeChild(gn),gr.setChildren(Mt,Un)}const pn=a.at(a.position);pn.parent.addChildrenAfter(Mt,pn),st==="latex"&&typeof y=="string"&&(gn==null?void 0:gn.type)==="root"&&hr&&!Se&&(gn.verbatimLatex=y),a.silenceNotifications=fe;const On=Mt[Mt.length-1];if(b.selectionMode==="placeholder"){const gr=Mt.flatMap(Un=>[Un,...Un.children]).find(Un=>Un.type==="placeholder");if(gr){const Un=a.offsetOf(gr);a.setSelection(Un-1,Un),a.announce("move")}else On&&(a.position=a.offsetOf(On))}else b.selectionMode==="before"||(b.selectionMode==="after"?On&&(a.position=a.offsetOf(On)):b.selectionMode==="item"&&a.setSelection(a.anchor,a.offsetOf(On)));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 fe=window.MathfieldElement.computeEngine;if(!fe)return["math-json",[]];[re,y]=["latex",fe.box(y).latex],ae=Ga(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=Ga(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]=$s(y)),ae=Ga(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 Ni&&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 Ni&&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 li)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||G0(y));)y=y.leftSibling;else{const ee=[];for(;!y.isFirstSibling&&(G0(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 G0(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 oi{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"),ga(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(ja(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),fe=ae.parent.addChildrenAfter(re,ae);return a.silenceNotifications=ee,b.selectionMode==="before"||(b.selectionMode==="item"?a.setSelection(a.anchor,a.offsetOf(fe)):fe&&(a.position=a.offsetOf(fe))),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 "),Ga(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 ra=4,_o=20,Ia=2*(_o+ra),Zh=(a,y)=>`
<line x1="${a+_o}" y1="${y+_o}"
x2="${a>y?a+_o:7*_o+10*ra}"
y2="${a<y?y+_o:7*_o+10*ra}"/>
<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>`,U0=(a,y)=>`
<line x1="${a+_o}" y1="${y+_o}"
x2="${a>y?a+_o:7*_o+10*ra}"
y2="${a<y?y+_o:7*_o+10*ra}"/>
<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*_o+10*ra+5} ${8*_o+10*ra+5}">
<rect
class="MLEP__array-insert-background rows"
x="0"
y="${Ia+ra}"
height="${3*Ia}"
width="${Ia}"
rx="${Ia/2}"/>
<rect
class="MLEP__array-insert-background columns"
x="${Ia+ra}"
y="0"
height="${Ia}"
width="${3*Ia}"
rx="${Ia/2}"/>
<g data-command='"moveDown"'>
${jh(2*(ra+Ia),2*ra+3*Ia,0)}
</g>
<g data-command='"moveUp"'>
${jh(2*(ra+Ia),2*ra+Ia,180)}
</g>
<g data-command='"moveToNextWord"'>
${jh(2*ra+3*Ia,2*(ra+Ia),-90)}
</g>
<g data-command='"moveToPreviousWord"'>
${jh(2*ra+Ia,2*(ra+Ia),90)}
</g>
<g>
<g data-command='"addColumnBefore"'>
${Zh(2*ra+Ia,ra)}
</g>
<g data-command='"removeColumn"'>
${U0(2*ra+2*Ia,ra)}
</g>
<g data-command='"addColumnAfter"'>
${Zh(2*ra+3*Ia,ra)}
</g>
<g data-command='"addRowBefore"'>
${Zh(ra,2*ra+Ia)}
</g>
<g data-command='"removeRow"'>
${U0(ra,2*ra+2*Ia)}
</g>
<g data-command='"addRowAfter"'>
${Zh(ra,2*ra+3*Ia)}
</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>`,$f={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(It=>{(!ee||It.length>ee)&&(ee=It.length)});let re=document.getElementById("mathlive-environment-popover");re||(re=_h("mathlive-environment-popover"),Oo("environment-popover"),Oo("core"),re.setAttribute("aria-hidden","true"));let ae;const fe=re.querySelector(".MLEP__environment-controls");fe?ae=fe:(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 me=[],ve="";const Se=a.model.parentEnvironment.environmentName;if(co(Se)){const It=gv(Se);ve=$f[It]("active");const gn=$f,{[It]:hr}=gn,pn=dt(gn,[Re(It)]);me=Object.values(pn).map(On=>On("inactive"))}else if(uo(Se)){const It=vv(Se);ve=Nf[It]("active");const gn=Nf,{[It]:hr}=gn,pn=dt(gn,[Re(It)]);me=Object.values(pn).map(On=>On("inactive"))}else _a(Se)&&(ve=$f.matrix("active"),me=Object.values(Nf).map(It=>It("inactive")));const He=document.createElement("div");He.className="MLEP__environment-delimiter-controls",He.style.display="flex",He.style.flexDirection="column",He.innerHTML=`
<div class='MLEP__array-delimiter-options'>
${ve}
${me.join("")}
</div>`,ve&&ae.appendChild(He),ae.querySelectorAll("[data-command]").forEach(It=>{const gn=It.dataset.command;let hr=gn;try{hr=JSON.parse(gn)}catch(pn){}It.addEventListener("mousedown",pn=>pn.preventDefault()),hr&&It.addEventListener("click",()=>a.executeCommand(hr))});const Mt=(b=a.field)==null?void 0:b.getBoundingClientRect();Mt&&(re.style.top=`${window.scrollY+(Mt.top-re.clientHeight-15)}px`,re.style.left=`${Mt.left+20}px`,re.classList.add("is-visible"))}function Rf(){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&&ca(b.environmentName)){const E=a.options.environmentPopoverPolicy;y=E==="auto"||E==="on"}}y?pv(a):Rf()}function gv(a){return a.replace("*","")}function vv(a){return a==="dcases"?"cases":a}function q0(a){const y=getComputedStyle(a).direction;return y==="ltr"||y==="rtl"?y:"ltr"}function Y0(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=q0(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(),fe=Number.isFinite(y.maxHeight)?Math.min(y.maxHeight,window.innerHeight):window.innerHeight;let me=Math.min(fe,(E=y.height)!=null?E:ae.height),ve=Ff(y.location.y,me,y.verticalPos,re);ve+me>window.innerHeight-8&&(y.alternateLocation?(ve=Ff(y.alternateLocation.y,me,y.verticalPos,re),ve+me>window.innerHeight-8&&(ve=void 0)):ve=void 0),Number.isFinite(ve)||(ve=Math.max(8,window.innerHeight-8-me),8+me>window.innerHeight-8&&(a.style.bottom="8px")),me=Math.min(ve+me,window.innerHeight-8)-ve;const Se=Number.isFinite(y.maxWidth)?Math.min(y.maxWidth,window.innerWidth):window.innerWidth;let He=Math.min(Se,(ee=y.width)!=null?ee:ae.width),st=Ff(y.location.x,He,y.horizontalPos,re);st+He>window.innerWidth-8&&(y.alternateLocation?(st=yv(y.alternateLocation.x,He,y.verticalPos,re),st+He>window.innerWidth-8&&(st=void 0)):st=void 0),Number.isFinite(st)||(st=Math.max(8,window.innerWidth-8-He),8+He>window.innerWidth-8&&(a.style.right="8px")),He=Math.min(st+He,window.innerWidth-8)-st,re==="rtl"?a.style.right=`${Math.ceil(window.innerWidth-st-He).toString()}px`:a.style.left=`${Math.ceil(st).toString()}px`,a.style.top=`${Math.ceil(ve).toString()}px`,me!==ae.height&&(a.style.height=`${Math.ceil(me).toString()}px`),He!==ae.width&&(a.style.width=`${Math.ceil(He).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=q0(this.element);this.submenu.show({container:this.rootMenu.element.parentNode,location:{x:Y0(b,"trailing",E),y:b.top-4},alternateLocation:{x:Y0(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(),fe=this.element.getBoundingClientRect();ae.left<fe.left+fe.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 _u{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(ve=>ve.updateState(y));const re=this.hasCheck;this.hasCheck=this._menuItems.some(ve=>ve.visible&&ve.hasCheck),this.hasCheck!==re&&this._menuItems.forEach(ve=>ve.updateState(y));let ae,fe=0;for(const ve of this._menuItems)ve.type==="heading"?(ae&&fe===0&&(ae.visible=!1),ae=ve,fe=0):ve.type==="divider"&&ae?(ae.visible=fe>0,ae=void 0,fe=0):ae&&ve.visible&&(fe+=1);ae&&(ae.visible=fe>0);let me=!0;for(const ve of this._menuItems)ve.type==="divider"?(ve.visible=!me,me=!0):ve.visible&&(me=!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 _u._collator||(_u._collator=new Intl.Collator(void 0,{usage:"search",sensitivity:"base"})),_u._collator}findMenuItem(y){var b;this.updateIfDirty();const E=this._menuItems.filter(fe=>fe.type!=="divider"&&fe.visible&&fe.enabled);if(E.length===0)return null;const ee=Math.max(...E.map(fe=>fe.label.length))-y.length;if(ee<0)return null;let re=null,ae=0;for(;ae<ee&&!re;)re=(b=E.find(fe=>_u.collator.compare(y,fe.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),jt()&&(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),jt()&&((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,fe=ae.activeMenuItem;switch(y.key){case" ":case"Space":case"Return":case"Enter":fe==null||fe.select(fc(y));break;case"ArrowRight":if((fe==null?void 0:fe.type)==="submenu")fe.select(fc(y)),this.activeSubmenu.activeMenuItem=this.activeSubmenu.firstMenuItem;else if(!fe)ae.activeMenuItem=ae.firstMenuItem;else{const me=(b=ae.getMenuItemColumn(fe))!=null?b:-1;if(me>=0&&me<((E=ae.columnCount)!=null?E:1)-1){const ve=ae.nextMenuItem(1);ve&&(ae.activeMenuItem=ve)}}break;case"ArrowLeft":if(ae===this.rootMenu)fe||(ae.activeMenuItem=ae.firstMenuItem);else if((fe&&(ee=ae.getMenuItemColumn(fe))!=null?ee:-1)<=0||!fe){ae.hide();const ve=ae.parentMenu.activeMenuItem;if(ve){const{element:Se}=ve;Se==null||Se.focus(),Se==null||Se.classList.remove("is-submenu-open")}}else{const ve=ae.nextMenuItem(-1);ve&&(ae.activeMenuItem=ve)}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 me=ae.findMenuItem(this.typingBuffer);me&&(ae.activeMenuItem=me),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}break;default:if(wh(y)){isFinite(this.typingBufferResetTimer)&&clearTimeout(this.typingBufferResetTimer),this.typingBuffer+=y.key;const me=ae.findMenuItem(this.typingBuffer);me&&(ae.activeMenuItem=me),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(_e(we({},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 Gh=class{};Gh.DELAY=300,Gh.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)<Gh.MAX_DISTANCE)},Gh.DELAY),ae=new AbortController,fe=ae.signal;for(const me of["pointermove","pointerup","pointercancel"])window.addEventListener(me,ve=>{if(ve.type==="pointerup"||ve.type==="pointercancel")clearTimeout(re),ae.abort(),y(!1);else if(ve.type==="pointermove"){const Se=xh(ve);Se&&(ee=Se)}},{passive:!0,signal:fe})})}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};ct(Object.keys(ap),"{body:auto}",{createAtom:a=>new z(_e(we({},a),{body:nt(a.args[0]),accentChar:ap[a.command.slice(1)]}))}),ct(["widehat","widecheck","widetilde"],"{body:auto}",{createAtom:a=>{const y=rt(nt(a.args[0]));return new z(_e(we({},a),{body:nt(a.args[0]),svgAccent:a.command.slice(1)+(y.length>5?"4":["1","1","2","2","3","3"][y.length])}))}}),ct(["overarc","overparen","wideparen"],"{body:auto}",{createAtom:a=>new z(_e(we({},a),{body:nt(a.args[0]),svgAccent:"overarc"}))}),ct(["underarc","underparen"],"{body:auto}",{createAtom:a=>new Jo(_e(we({},a),{body:nt(a.args[0]),svgBelow:"underarc"}))}),ct("utilde","{body:auto}",{createAtom:a=>{const y=nt(a.args[0]),b=rt(y),E="widetilde"+(b.length>5?"4":["1","1","2","2","3","3"][b.length]);return new Jo(_e(we({},a),{body:y,svgBelow:E,boxType:kl(y)}))}}),ct("^","{:string}",{createAtom:a=>{var y;return new An(_e(we({},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:"^"}))}}),ct("`","{:string}",{createAtom:a=>{var y;return new An(_e(we({},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:"`"}))}}),ct("'","{:string}",{createAtom:a=>{var y;return new An(_e(we({},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:"'"}))}}),ct('"',"{:string}",{createAtom:a=>{var y,b;return new An(_e(we({},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]:'"'}))}}),ct(".","{:string}",{createAtom:a=>{var y,b;return new An(_e(we({},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]:"."}))}}),ct("=","{:string}",{createAtom:a=>{var y,b;return new An(_e(we({},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]:"="}))}}),ct("~","{:string}",{createAtom:a=>{var y;return new An(_e(we({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"}))}}),ct("c","{:string}",{createAtom:a=>{var y;return new An(_e(we({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={c:"\xE7",C:"\xC7"}[a.args[0]])!=null?y:""}))}}),ct("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 fe of ae){const me=fe.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(me)ee.strokeWidth=me[1],ee.strokeStyle=me[2],ee.strokeColor=me[3];else{const ve=fe.match(/\s*([a-z]*)\s*=\s*"(.*)"/);ve&&(ve[1]==="mathbackground"?ee.backgroundcolor=ve[2]:ve[1]==="mathcolor"?ee.strokeColor=ve[2]:ve[1]==="padding"?ee.padding=ve[2]:ve[1]==="shadow"&&(ee.shadow=ve[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,nt(E[2]),re,ee)}}),ct("cancel","{body:auto}",{createAtom:a=>{var y;return new cd(a.command,nt(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:{}})}}),ct("bcancel","{body:auto}",{createAtom:a=>{var y;return new cd(a.command,nt(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:{}})}}),ct("xcancel","{body:auto}",{createAtom:a=>{var y;return new cd(a.command,nt(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:{}})}}),ct(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overlinesegment","overgroup"],"{:auto}",{createAtom:a=>{var y;return new Jo(_e(we({},a),{body:nt((y=a.args)==null?void 0:y[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgAbove:a.command.slice(1)}))}}),ct("overbrace","{:auto}",{createAtom:a=>new Jo(_e(we({},a),{body:nt(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgAbove:a.command.slice(1)}))}),ct(["underrightarrow","underleftarrow","underleftrightarrow","underlinesegment","undergroup"],"{:auto}",{createAtom:a=>new Jo(_e(we({},a),{body:nt(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgBelow:a.command.slice(1)}))}),ct(["underbrace"],"{:auto}",{createAtom:a=>new Jo(_e(we({},a),{body:nt(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgBelow:a.command.slice(1)}))}),ct(["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 Jo(_e(we({},a),{svgBody:a.command.slice(1),above:((b=nt((y=a.args)==null?void 0:y[1]))==null?void 0:b.length)===0?void 0:nt((E=a.args)==null?void 0:E[1]),below:(re=nt((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)}`}),ct(["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),_e(we({},a),{limits:"adjacent",isFunction:!0,variant:"main",variantStyle:"up"}))}),ct(["liminf","limsup"],"",{ifMode:"math",createAtom:a=>new hc({"\\liminf":"lim inf","\\limsup":"lim sup"}[a.command],_e(we({},a),{limits:"over-under",variant:"main"}))}),ct(["lim","mod"],"",{ifMode:"math",createAtom:a=>new hc(a.command.slice(1),_e(we({},a),{limits:"over-under",variant:"main"}))}),ct(["det","max","min"],"",{ifMode:"math",isFunction:!0,createAtom:a=>new hc(a.command.slice(1),_e(we({},a),{limits:"over-under",isFunction:!0,variant:"main"}))}),ct(["ang"],"{:math}",{ifMode:"math",createAtom:a=>new An(_e(we({},a),{body:nt(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 fr("\xB0",{style:_e(we({},a.style),{variant:"normal",variantStyle:"up"})});return new fr([b,ee],{type:"inner",isSelected:a.isSelected,caret:E})}}),ct("sqrt","[index:auto]{radicand:expression}",{ifMode:"math",createAtom:a=>new o0(_e(we({},a),{body:nt(a.args[1]),index:a.args[0]?nt(a.args[0]):void 0}))}),ct(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{:expression}{:expression}",{ifMode:"math",createAtom:a=>{const y=we({},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]?nt(E[0]):[new Jr],E[1]?nt(E[1]):[new Jr],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}`:na(a.command,b,E)}}),ct(["brace","brack"],"",{infix:!0,createAtom:a=>new ou(nt(a.args[0]),nt(a.args[1]),_e(we({},a),{hasBarLine:!1,leftDelim:a.command==="\\brace"?"\\lbrace":"\\lbrack",rightDelim:a.command==="\\brace"?"\\rbrace":"\\rbrack"})),serialize:(a,y)=>bi([a.aboveToLatex(y),a.command,a.belowToLatex(y)])}),ct(["over","atop","choose"],"",{infix:!0,createAtom:a=>{let y,b;const E=a.args;return a.command==="\\choose"&&(y="(",b=")"),new ou(nt(E[0]),nt(E[1]),_e(we({},a),{hasBarLine:a.command==="\\over",leftDelim:y,rightDelim:b}))},serialize:(a,y)=>bi([a.aboveToLatex(y),a.command,a.belowToLatex(y)])}),ct(["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(nt(E[0]),nt(E[1]),_e(we({},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)}`}),ct("pdiff","{numerator}{denominator}",{ifMode:"math",createAtom:a=>new ou(nt(a.args[0]),nt(a.args[1]),_e(we({},a),{hasBarLine:!0,numerPrefix:"\u2202",denomPrefix:"\u2202"}))}),ct(["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)],_e(we({},a),{limits:"auto",variant:"main"}))}),ct("smallint","",{ifMode:"math",createAtom:a=>new hc("\u222B",_e(we({},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"};ct(Object.keys(op),"",{ifMode:"math",createAtom:a=>{const y=a.command,b=op[y.slice(1)];return new hf(b,_e(we({},a),{limits:"adjacent",variant:{"\u22D2":"ams","\u22D3":"ams"}[b]}))}}),ct(["Re","Im"],"",{ifMode:"math",createAtom:a=>new hc({"\\Re":"\u211C","\\Im":"\u2111"}[a.command],_e(we({},a),{limits:"adjacent",isFunction:!0,variant:"fraktur"}))}),ct("middle","{:delim}",{ifMode:"math",createAtom:a=>{var y;return new r0(_e(we({},a),{delim:(y=a.args[0])!=null?y:"|",size:1}))}}),ct("the","{:value}",{createAtom:a=>new An(_e(we({},a),{captureSelection:!0,verbatimLatex:null})),render:(a,y)=>{var b;const E=new Ei({parent:y},a.style);let ee="";a.isSelected&&(ee+=" ML__selected");const re=E.evaluate(a.args[0]);return new fr(((b=Ca(re))!=null?b:"").split("").map(ae=>new fr(ae,{type:"ord",classes:ee,mode:a.mode,isSelected:a.isSelected,style:we({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=Ca(a.args[0]))!=null?y:"\\relax"}`}}),ct("mathtip","{:auto}{:math}",{createAtom:a=>new ff(_e(we({},a),{body:nt(a.args[0]),tooltip:nt(a.args[1]),content:"math"})),serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`\\texttip{${a.bodyToLatex(y)}}{${An.serialize([a.tooltip],_e(we({},y),{defaultMode:"math"}))}}`}),ct("texttip","{:auto}{:text}",{createAtom:a=>new ff(_e(we({},a),{body:nt(a.args[0]),tooltip:nt(a.args[1]),content:"text"})),serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`\\texttip{${a.bodyToLatex(y)}}{${An.serialize([a.tooltip],_e(we({},y),{defaultMode:"text"}))}}`}),ct("error","{:math}",{createAtom:a=>new An(_e(we({},a),{body:nt(a.args[0])})),serialize:(a,y)=>`\\error{${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__error"})}),ct("ensuremath","{:math}",{createAtom:a=>new An(_e(we({},a),{body:nt(a.args[0])})),serialize:(a,y)=>`${a.command}{${a.bodyToLatex(_e(we({},y),{defaultMode:"math"}))}}`}),ct("color","{:value}",{applyStyle:(a,y,b)=>{var E,ee;return{verbatimColor:(E=Ca(y[0]))!=null?E:void 0,color:b.toColor((ee=y[0])!=null?ee:{string:"red"})}}}),ct("textcolor","{:value}{content:auto*}",{applyStyle:(a,y,b)=>{var E,ee;return{verbatimColor:(E=Ca(y[0]))!=null?E:void 0,color:b.toColor((ee=y[0])!=null?ee:{string:"red"})}}}),ct("boxed","{content:math}",{createAtom:a=>new ya(_e(we({},a),{body:nt(a.args[0]),framecolor:{string:"black"}}))}),ct("colorbox","{:value}{:text*}",{applyStyle:(a,y,b)=>{var E,ee;return{verbatimBackgroundColor:(E=Ca(y[0]))!=null?E:void 0,backgroundColor:b.toBackgroundColor((ee=y[0])!=null?ee:{string:"yellow"})}}}),ct("fcolorbox","{frame-color:value}{background-color:value}{content:text}",{applyMode:"text",createAtom:a=>{var y,b;return new ya(_e(we({},a),{body:nt(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(_e(we({},y),{defaultMode:"text"})):na(a.command,(b=Ca(a.framecolor))!=null?b:"",(E=Ca(a.backgroundcolor))!=null?E:"",a.bodyToLatex(_e(we({},y),{defaultMode:"text"})))}}),ct("bbox","[:bbox]{body:auto}",{createAtom:a=>{var y;const b=a.args[0],E=nt(a.args[1]);return b?new ya(_e(we({},a),{body:E,padding:b.padding,border:b.border,backgroundcolor:(y=b.backgroundcolor)!=null?y:void 0})):new ya(_e(we({},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=Ca(a.padding))!=null?b:""),a.border&&re.push(`border: ${a.border}`),a.backgroundcolor&&re.push((E=Ca(a.backgroundcolor))!=null?E:""),ee+=`[${re.join(",")}]`}return na(ee,a.bodyToLatex(y))}}),ct(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"],"{:rest}",{createAtom:a=>new An(_e(we({},a),{body:nt(a.args[0])})),render:(a,y)=>{const b=new Ei({parent:y,mathstyle:a.command.slice(1)},a.style),E=An.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):`{${bi([a.command,a.bodyToLatex(y)])}}`}),ct(["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]})}),ct("fontseries","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontSeries:(b=y[0])!=null?b:"auto"}}}),ct("fontshape","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontShape:(b=y[0])!=null?b:"auto"}}}),ct("fontfamily","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontFamily:(b=y[0])!=null?b:"roman"}}}),ct("selectfont","",{ifMode:"text",applyStyle:()=>({})}),ct("bf","{:rest}",{applyStyle:()=>({fontSeries:"b",fontShape:"n",fontFamily:"roman"})}),ct(["boldsymbol","bm"],"{:math}",{applyMode:"math",createAtom:a=>new An(_e(we({},a),{body:nt(a.args[0])})),serialize:(a,y)=>`${a.command}{${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__boldsymbol"})}),ct("bold","{:math*}",{applyMode:"math",applyStyle:()=>({variantStyle:"bold"})}),ct("bfseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),ct("mdseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),ct("upshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),ct("slshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),ct("scshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),ct("textbf","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),ct("textmd","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),ct("textup","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),ct("textnormal","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n",fontSeries:"m"})}),ct("textsl","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),ct("textit","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"it"})}),ct("textsc","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),ct("textrm","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"roman"})}),ct("textsf","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"sans-serif"})}),ct("texttt","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"monospace"})}),ct("mathbf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"bold"})}),ct("mathit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"italic"})}),ct("mathnormal","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"italic"})}),ct("mathbfit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"bolditalic"})}),ct("mathrm","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"up"})}),ct("mathsf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"sans-serif",variantStyle:"up"})}),ct("mathtt","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"monospace",variantStyle:"up"})}),ct("it","{:rest}",{applyStyle:()=>({fontSeries:"m",fontShape:"it",fontFamily:"roman",variantStyle:"italic"})}),ct("rmfamily","",{applyStyle:()=>({fontFamily:"roman"})}),ct("sffamily","",{applyStyle:()=>({fontFamily:"sans-serif"})}),ct("ttfamily","",{applyStyle:()=>({fontFamily:"monospace"})}),ct(["Bbb","mathbb"],"{:math*}",{applyStyle:()=>({variant:"double-struck",variantStyle:"up"})}),ct(["frak","mathfrak"],"{:math*}",{applyStyle:()=>({variant:"fraktur",variantStyle:"up"})}),ct("mathcal","{:math*}",{applyStyle:()=>({variant:"calligraphic",variantStyle:"up"})}),ct("mathscr","{:math*}",{applyStyle:()=>({variant:"script",variantStyle:"up"})}),ct("mbox","{:text}",{ifMode:"math",createAtom:a=>new An(_e(we({},a),{type:"mord",body:nt(a.args[0]),mode:"math"})),serialize:(a,y)=>na("\\mbox",a.bodyToLatex(_e(we({},y),{defaultMode:"text"})))}),ct("text","{:text}",{ifMode:"math",applyMode:"text"}),ct(["class","htmlClass"],"{name:string}{content:auto}",{createAtom:a=>new An(_e(we({},a),{body:nt(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:""})}}),ct(["cssId","htmlId"],"{id:string}{content:auto}",{createAtom:a=>new An(_e(we({},a),{body:nt(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}}),ct("htmlData","{data:string}{content:auto}",{createAtom:a=>new An(_e(we({},a),{body:nt(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}}),ct(["style","htmlStyle"],"{data:string}{content:auto}",{createAtom:a=>new An(_e(we({},a),{body:nt(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}}),ct("em","{:rest}",{createAtom:a=>new An(_e(we({},a),{body:nt(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"})}),ct("emph","{:auto}",{createAtom:a=>new An(_e(we({},a),{body:nt(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}};ct(["bigl","Bigl","biggl","Biggl","bigr","Bigr","biggr","Biggr","bigm","Bigm","biggm","Biggm","big","Big","bigg","Bigg"],"{:delim}",{createAtom:a=>{var y;return new i0(_e(we({},a),{delim:(y=a.args[0])!=null?y:".",size:sp[a.command].size,delimType:sp[a.command].mclass}))}}),ct(["hspace","hspace*"],"{width:value}",{createAtom:a=>{var y;return new hd(_e(we({},a),{width:(y=a.args[0])!=null?y:{dimension:0}}))}}),ct(["mkern","kern","mskip","hskip","mspace"],"{width:value}",{createAtom:a=>{var y;return new hd(_e(we({},a),{width:(y=a.args[0])!=null?y:{dimension:0}}))}}),ct("mathchoice","{:math}{:math}{:math}{:math}",{createAtom:a=>new An(a),render:(a,y)=>{let b=0;const E=y.mathstyle.id;(E===sc||E===Is)&&(b=1),(E===ul||E===oo)&&(b=2),(E===Po||E===Za)&&(b=3);const ee=nt(a.args[b]);return An.createBox(y,ee)},serialize:(a,y)=>`\\mathchoice{${An.serialize(a.args[0],y)}}{${An.serialize(a.args[1],y)}}{${An.serialize(a.args[2],y)}}{${An.serialize(a.args[3],y)}}`}),ct("mathop","{:auto}",{createAtom:a=>new An(_e(we({},a),{type:"mop",body:nt(a.args[0]),limits:"over-under",isFunction:!0,captureSelection:!0})),render:(a,y)=>{var b;let E=An.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 fr(a.bind(y,E),{type:"op",isSelected:a.isSelected,classes:"op-group"})},serialize:(a,y)=>{const b=[na(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)),bi(b)}}),ct(["mathbin","mathrel","mathopen","mathclose","mathpunct","mathord","mathinner"],"{:auto}",{createAtom:a=>new An(_e(we({},a),{type:{"\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[a.command],body:nt(a.args[0])}))}),ct(["operatorname","operatorname*"],"{operator:math}",{createAtom:a=>{const y=nt(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 An(_e(we({},a),{type:"mop",body:y,isFunction:!0,limits:a.command==="\\operatorname"?"adjacent":"over-under"}))},render:(a,y)=>{var b;let E=An.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 fr(a.bind(y,E),{type:"op",isSelected:a.isSelected,classes:"op-group"})},serialize:(a,y)=>{const b=[na(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)),bi(b)}}),ct(["char","unicode"],"{charcode:value}",{createAtom:a=>new An(_e(we({},a),{type:a.mode==="text"?"text":"mord"})),serialize:a=>{var y;return`${a.command}${Ca((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)}}),ct("rule","[raise:value]{width:value}{thickness:value}",{createAtom:a=>new An(a),render:(a,y)=>{var b,E,ee;const re=new Ei({parent:y,mathstyle:"textstyle"},a.style),ae=re.toEm((b=a.args[0])!=null?b:{dimension:0}),fe=re.toEm((E=a.args[1])!=null?E:{dimension:10}),me=re.toEm((ee=a.args[2])!=null?ee:{dimension:10}),ve=new fr(null,{classes:"rule",type:"ord"});return ve.width=fe,ve.height=me+ae,ve.depth=-ae,ve.setStyle("border-right-width",fe,"em"),ve.setStyle("border-top-width",me,"em"),ve.setStyle("border-color",a.style.color),ve.setStyle("vertical-align",ae,"em"),a.isSelected&&ve.setStyle("opacity","50%"),a.bind(re,ve),a.caret&&(ve.caret=a.caret),ve.wrap(y)},serialize:a=>`\\rule${a.args[0]?`[${Ca(a.args[0])}]`:""}{${Ca(a.args[1])}}{${Ca(a.args[2])}}`}),ct(["overline","underline"],"{:auto}",{createAtom:a=>new An(_e(we({},a),{body:nt(a.args[0])})),render:(a,y)=>{const b=a.command.substring(1),E=new Ei({parent:y,mathstyle:"cramp"},a.style),ee=An.createBox(E,a.body);if(!ee)return null;const re=E.metrics.defaultRuleThickness/E.scalingFactor,ae=new fr(null,{classes:b+"-line"});ae.height=re,ae.maxFontSize=re*1.125*E.scalingFactor;let fe;return b==="overline"?fe=new Yi({shift:0,children:[{box:ee},3*re,{box:ae},re]}):fe=new Yi({top:ee.height,children:[re,{box:ae},3*re,{box:ee}]}),a.caret&&(fe.caret=a.caret),new fr(fe,{classes:b,type:"ignore"})}}),ct("overset","{:auto}{base:auto}",{createAtom:a=>{const y=nt(a.args[1]);return new Jo(_e(we({},a),{above:nt(a.args[0]),body:y,skipBoundary:!1,boxType:kl(y)}))},serialize:(a,y)=>na(a.command,a.aboveToLatex(y),a.bodyToLatex(y))}),ct("underset","{:auto}{base:auto}",{createAtom:a=>{const y=nt(a.args[1]);return new Jo(_e(we({},a),{below:nt(a.args[0]),body:y,skipBoundary:!1,boxType:kl(y)}))},serialize:(a,y)=>na(a.command,a.belowToLatex(y),a.bodyToLatex(y))}),ct("overunderset","{above:auto}{below:auto}{base:auto}",{createAtom:a=>{const y=nt(a.args[2]);return new Jo(_e(we({},a),{above:nt(a.args[0]),below:nt(a.args[1]),body:y,skipBoundary:!1,boxType:kl(y)}))},serialize:(a,y)=>na(a.command,a.belowToLatex(y),a.bodyToLatex(y))}),ct(["stackrel","stackbin"],"[below:auto]{above:auto}{base:auto}",{createAtom:a=>new Jo(_e(we({},a),{body:nt(a.args[2]),above:nt(a.args[1]),below:nt(a.args[0]),skipBoundary:!1,boxType:a.command==="\\stackrel"?"rel":"bin"})),serialize:(a,y)=>na(a.command,a.aboveToLatex(y),a.bodyToLatex(y))}),ct("smash","[:string]{:auto}",{createAtom:a=>{var y,b,E,ee;return new dd(_e(we({},a),{body:nt(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}))}}),ct(["vphantom"],"{:auto}",{createAtom:a=>new dd(_e(we({},a),{body:nt(a.args[0]),isInvisible:!0,smashWidth:!0}))}),ct(["hphantom"],"{:auto}",{createAtom:a=>new dd(_e(we({},a),{body:nt(a.args[0]),isInvisible:!0,smashHeight:!0,smashDepth:!0}))}),ct(["phantom"],"{:auto}",{createAtom:a=>new dd(_e(we({},a),{body:nt(a.args[0]),isInvisible:!0}))}),ct("not","{:math}",{createAtom:a=>{const y=nt(a.args[0]);return y.length===0?new An(_e(we({},a),{type:"mrel",value:"\uE020"})):new An(_e(we({},a),{body:[new dc(_e(we({},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{${An.serialize(b.group,y)}}`:`\\not${An.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":kl(nt(a.args[0])),ee=An.createBox(y,a.body,{type:E});return a.caret&&(ee.caret=a.caret),a.bind(y,ee)}}),ct(["ne","neq"],"",{createAtom:a=>new An(_e(we({},a),{type:"mrel",body:[new dc(_e(we({},a),{body:"\uE020",align:"right",boxType:"rel"})),new An(_e(we({},a),{value:"="}))],captureSelection:!0})),serialize:a=>a.command}),ct("rlap","{:auto}",{createAtom:a=>new dc(_e(we({},a),{body:nt(a.args[0]),align:"right"}))}),ct("llap","{:auto}",{createAtom:a=>new dc(_e(we({},a),{body:nt(a.args[0]),align:"left"}))}),ct("mathrlap","{:math}",{createAtom:a=>new dc(_e(we({},a),{body:nt(a.args[0]),align:"left"}))}),ct("mathllap","{:math}",{createAtom:a=>new dc(_e(we({},a),{body:nt(a.args[0]),align:"left"}))}),ct("raisebox","{:value}{:text}",{createAtom:a=>{var y;return new ya(_e(we({},a),{body:nt(a.args[1]),padding:{dimension:0},offset:(y=a.args[0])!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b;return na("\\raisebox",(b=Ca(a.offset))!=null?b:"0pt",a.bodyToLatex(y))}}),ct("raise","{:value}{:auto}",{createAtom:a=>{var y;return new ya(_e(we({},a),{body:nt(a.args[1]),padding:{dimension:0},offset:(y=a.args[0])!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b;return na("\\raise",(b=Ca(a.offset))!=null?b:"0pt",a.bodyToLatex(y))}}),ct("lower","{:value}{:auto}",{createAtom:a=>{var y;return new ya(_e(we({},a),{body:nt(a.args[1]),padding:{dimension:0},offset:(y=qo(a.args[0],-1))!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b,E;return na("\\lower",(E=Ca(qo((b=a.offset)!=null?b:{dimension:0},-1)))!=null?E:"0pt",a.bodyToLatex(y))}}),Ie("0123456789/@.?!"),yt(65,90),yt(97,122),Ie([["\\forall",8704],["\\exists",8707],["\\nexists",8708,"mord","ams"],["\\mid",8739,"mrel"],["\\top",8868],["\\bot",8869]]),Ie([["\\#",35],["\\&",38],["\\parallelogram",9649],["\\spadesuit",9824],["\\heartsuit",9825],["\\diamondsuit",9826],["\\clubsuit",9827],["\\flat",9837],["\\natural",9838],["\\sharp",9839]]),Ie([["\\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]]),Ie([["\\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"),Ie([["\\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"]]),Ie([["\\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"]]),Ie([["\\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"),Ie([["+",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"),Ie([["\\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"),Ie([["\\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]]),Ie([["=",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"),Ie([["\\lnot",172],["\\neg",172],["\\triangle",9651],["\\subsetneq",8842],["\\varsubsetneq",57370],["\\subsetneqq",10955],["\\varsubsetneqq",57367],["\\nsubset",8836],["\\nsupset",8837],["\\nsubseteq",8840],["\\nsupseteq",8841]],"mrel","ams"),Ie([["\\wp",8472],["\\aleph",8501]]),Ie([["\\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"),Ie([["\\ ",160],["~",160]],"space"),ct(["!",",",":",";",">","enskip","enspace","quad","qquad"],"",{createAtom:a=>new hd(a)}),ct("space","",{createAtom:a=>new hd(a)}),Ie([["\\colon",58],["\\cdotp",8901],["\\vdots",8942,"mord"],["\\ldotp",46],[",",44],[";",59]],"mpunct"),Ie([["\\cdots",8943],["\\ddots",8945],["\\ldots",8230],["\\mathellipsis",8230]],"minner"),Ie([["\\/",47],["|",8739,"mord"],["\\imath",305],["\\jmath",567],["\\degree",176],["'",8242],['"',8221]]);var lp="<mo>&#x2061;</mo>",Uh="<mo>&#8290;</mo>";function Xh(a){return a.replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ea(a,y){return!a||!y.generateID?"":` extid="${a}"`}function _v(a,y,b){var E,ee,re,ae,fe,me,ve,Se,He,st,Mt;let It=!1;y=y!=null?y:a.atoms.length;let gn="",hr="",pn=a.atoms[a.index];const On=(ee=(E=pn.style)==null?void 0:E.variant)!=null?ee:"",gr=(ae=(re=pn.style)==null?void 0:re.variantStyle)!=null?ae:"";let Un="";if(On||gr){const Xr=Qt(pn.value,(fe=pn.style)==null?void 0:fe.variant,(me=pn.style)==null?void 0:me.variantStyle);if(Xr!==pn.value)return a.index+=1,gn=`<mi${ea(pn.id,b)}>${Xr}</mi>`,ml(gn,a,b)||(a.mathML+=gn,a.lastType="mi"),!0;Un=(ve={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"}[gr+On])!=null?ve:"",Un=` mathvariant="${Un}"`}const zr={"\\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(pn.command==="!")return a.index+=1,gn="<mo>!</mo>",ml(gn,a,b)||(a.mathML+=gn,a.lastType="mo"),!0;if(zr[pn.command]){a.index+=1;let Xr=`<mi${ea(pn.id,b)}${Un}>${zr[pn.command]}</mi>`;return(a.lastType==="mi"||a.lastType==="mn"||a.lastType==="mtext"||a.lastType==="fence")&&(Xr=Uh+Xr),ml(Xr,a,b)||(a.mathML+=Xr,a.lastType="mi"),!0}if(pn.command==="\\operatorname")hr=vu(pn.body),a.index+=1;else if(On||gr)for(;a.index<y&&(pn.type==="mord"||pn.type==="macro")&&!pn.isDigit()&&On===((He=(Se=pn.style)==null?void 0:Se.variant)!=null?He:"")&&gr===((Mt=(st=pn.style)==null?void 0:st.variantStyle)!=null?Mt:"");)hr+=vu([pn]),a.index+=1,pn=a.atoms[a.index];else(pn.type==="mord"||pn.type==="macro")&&!pn.isDigit()&&(hr+=vu([pn]),a.index+=1);if(hr.length>0){It=!0,gn=`<mi${Un}>${hr}</mi>`;const Xr=a.lastType;gn.endsWith(">f</mi>")||gn.endsWith(">g</mi>")?(gn+=lp,a.lastType="applyfunction"):a.lastType=/^<mo>(.*)<\/mo>$/.test(gn)?"mo":"mi",ml(gn,a,b)||((Xr==="mi"||Xr==="mn"||Xr==="mtext"||Xr==="fence")&&(gn=Uh+gn),a.mathML+=gn)}return It}function Ev(a){return a.index<a.atoms.length&&a.atoms[a.index].superscript&&a.atoms[a.index].type==="subsup"}function Mv(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=Ri(ee.superscript,b);y.lastType="";const fe=Ri(ee.subscript,b);if(y.lastType=re,!ae&&!fe)return!1;let me="";return ae&&fe?me=`<msubsup>${a}${fe}${ae}</msubsup>`:ae?me=`<msup>${a}${ae}</msup>`:fe&&(me=`<msub>${a}${fe}</msub>`),y.mathML+=me,y.lastType="",!0}function kv(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 ${ea(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=Mv(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"+ea(a.atoms[E].id,b)+">"+ee+"</mn>",re<0&&Ev(a)&&(re=a.index,a.index+=1),ml(ee,a,b)||(a.mathML+=ee,a.lastType="mn"),!0)}function Av(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,fe=0;const me=a.index;let ve=-1,Se=me+1;for(;Se<y&&!ae;)a.atoms[Se].type==="mopen"?fe+=1:a.atoms[Se].type==="mclose"&&(fe-=1),fe===-1&&(ae=!0,ve=Se),Se+=1;ae&&(ee="<mrow>",ee+=Sc(a.atoms[me],b),ee+=Ri(a.atoms,b,me+1,ve),ee+=Sc(a.atoms[ve],b),ee+="</mrow>",a.index=ve+1,(a.lastType==="mi"||a.lastType==="mn"||a.lastType==="mfrac"||a.lastType==="fence")&&(a.mathML+=Uh),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 Dv(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 fe={"\\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(fe[ae.command]){a.index+=1;const me=`<mo${ea(ae.id,b)}>${fe[ae.command]}</mo>`;return ml(me,a,b)||(a.mathML+=me,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 me=Sc(ae,b);return ae.superscript&&ae.subscript?(ee+="<munderover>"+me,ee+=Ri(ae.subscript,b),ee+=Ri(ae.superscript,b),ee+="</munderover>"):ae.superscript?(ee+="<mover>"+me,ee+=Ri(ae.superscript,b),ee+="</mover>"):ae.subscript&&(ee+="<munder>"+me,ee+=Ri(ae.subscript,b),ee+="</munder>"),a.mathML+=ee,a.lastType="mo",a.index+=1,!0}{const me=a.atoms[a.index],ve=me.value==="\\operatorname",Se=ve?'<mi class="MathML-Unit"'+ea(me.id,b)+">"+vu(me.value)+"</mi>":Sc(me,b);ee+=Se,!ve&&!/^<mo>(.*)<\/mo>$/.test(Se)?(ee+=lp,re="applyfunction"):re=ve?"mi":"mo"}(a.lastType==="mi"||a.lastType==="mn")&&!/^<mo>(.*)<\/mo>$/.test(ee)&&(ee=Uh+ee),a.index+=1}return ee.length>0&&(E=!0,ml(ee,a,b)||(a.mathML+=ee,a.lastType=re)),E}function Ri(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 An)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(kv(ee,E,y)||Lv(ee,E,y)||_v(ee,E,y)||Dv(ee,E,y)||Av(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"+ea(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,fe,me,ve,Se,He,st,Mt,It,gn,hr,pn,On,gr,Un,zr,Xr,jr;if(a.mode==="text")return`<mi${ea(a.id,y)}>${a.value}</mi>`;const ki={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"},Gi={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\>":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let Sr="",Zo="",js,es,Xa,jo,Eo,ta;const{command:xa}=a;if(a.command==="\\error")return`<merror${ea(a.id,y)}>${Ri(a.body,y)}</merror>`;const qa={"\\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":Sr=Ri(a.body,y);break;case"array":if((a.leftDelim&&a.leftDelim!=="."||a.rightDelim&&a.rightDelim!==".")&&(Sr+="<mrow>",a.leftDelim&&a.leftDelim!=="."&&(Sr+="<mo>"+(qa[a.leftDelim]||a.leftDelim)+"</mo>")),Sr+="<mtable",a.colFormat){for(Sr+=' columnalign="',Xa=0;Xa<a.colFormat.length;Xa++)a.colFormat[Xa].align&&(Sr+={l:"left",c:"center",r:"right"}[a.colFormat[Xa].align]+" ");Sr+='"'}for(Sr+=">",es=0;es<a.array.length;es++){for(Sr+="<mtr>",js=0;js<a.array[es].length;js++)Sr+="<mtd>"+Ri(a.array[es][js],y)+"</mtd>";Sr+="</mtr>"}Sr+="</mtable>",(a.leftDelim&&a.leftDelim!=="."||a.rightDelim&&a.rightDelim!==".")&&(a.rightDelim&&a.rightDelim!=="."&&(Sr+="<mo>"+(qa[a.leftDelim]||a.rightDelim)+"</mo>"),Sr+="</mrow>");break;case"genfrac":(a.leftDelim||a.rightDelim)&&(Sr+="<mrow>"),a.leftDelim&&a.leftDelim!=="."&&(Sr+="<mo"+ea(a.id,y)+">"+(qa[a.leftDelim]||a.leftDelim)+"</mo>"),a.hasBarLine?(Sr+="<mfrac>",Sr+=Ri(a.above,y)||"<mi>&nbsp;</mi>",Sr+=Ri(a.below,y)||"<mi>&nbsp;</mi>",Sr+="</mfrac>"):(Sr+="<mtable"+ea(a.id,y)+">",Sr+="<mtr>"+Ri(a.above,y)+"</mtr>",Sr+="<mtr>"+Ri(a.below,y)+"</mtr>",Sr+="</mtable>"),a.rightDelim&&a.rightDelim!=="."&&(Sr+="<mo"+ea(a.id,y)+">"+(qa[a.rightDelim]||a.rightDelim)+"</mo>"),(a.leftDelim||a.rightDelim)&&(Sr+="</mrow>");break;case"surd":a.hasEmptyBranch("above")?(Sr+="<msqrt"+ea(a.id,y)+">",Sr+=Ri(a.body,y),Sr+="</msqrt>"):(Sr+="<mroot"+ea(a.id,y)+">",Sr+=Ri(a.body,y),Sr+=Ri(a.above,y),Sr+="</mroot>");break;case"leftright":const Gs=a,Us=Gs.leftDelim;Sr="<mrow>",Us&&Us!=="."&&(Sr+=`<mo${ea(a.id,y)}>${(b=qa[Us])!=null?b:Us}</mo>`),a.body&&(Sr+=Ri(a.body,y));const Xs=Gs.matchingRightDelim();Xs&&Xs!=="."&&(Sr+=`<mo${ea(a.id,y)}>${(E=qa[Xs])!=null?E:Xs}</mo>`),Sr+="</mrow>";break;case"sizeddelim":case"delim":Sr+=`<mo${ea(a.id,y)}>${qa[a.value]||a.value}</mo>`;break;case"accent":Sr+='<mover accent="true"'+ea(a.id,y)+">",Sr+=Ri(a.body,y),Sr+="<mo>"+(Vs[xa]||a.accent)+"</mo>",Sr+="</mover>";break;case"line":case"overlap":break;case"overunder":Eo=a.above,jo=a.below,(a.svgAbove||Eo)&&(a.svgBelow||jo)?ta=a.body:Eo&&Eo.length>0?(ta=a.body,(re=(ee=a.body)==null?void 0:ee[0])!=null&&re.below?(jo=a.body[0].below,ta=a.body[0].body):((fe=(ae=a.body)==null?void 0:ae[0])==null?void 0:fe.type)==="first"&&((ve=(me=a.body)==null?void 0:me[1])!=null&&ve.below)&&(jo=a.body[1].below,ta=a.body[1].body)):jo&&jo.length>0&&(ta=a.body,(He=(Se=a.body)==null?void 0:Se[0])!=null&&He.above?(Eo=a.body[0].above,ta=a.body[0].body):((Mt=(st=a.body)==null?void 0:st[0])==null?void 0:Mt.type)==="first"&&((gn=(It=a.body)==null?void 0:It[1])!=null&&gn.above)&&(Eo=a.body[1].overscript,ta=a.body[1].body)),(a.svgAbove||Eo)&&(a.svgBelow||jo)?(Sr+=`<munderover ${ea(a.id,y)}>`,Sr+=(hr=ki[a.svgBody])!=null?hr:Ri(ta,y),Sr+=(pn=ki[a.svgBelow])!=null?pn:Ri(jo,y),Sr+=(On=ki[a.svgAbove])!=null?On:Ri(Eo,y),Sr+="</munderover>"):a.svgAbove||Eo?(Sr+=`<mover ${ea(a.id,y)}>`+((gr=ki[a.svgBody])!=null?gr:Ri(ta,y)),Sr+=(Un=ki[a.svgAbove])!=null?Un:Ri(Eo,y),Sr+="</mover>"):(a.svgBelow||jo)&&(Sr+=`<munder ${ea(a.id,y)}>`+((zr=ki[a.svgBody])!=null?zr:Ri(ta,y)),Sr+=(Xr=ki[a.svgBelow])!=null?Xr:Ri(jo,y),Sr+="</munder>");break;case"placeholder":Sr+="?";break;case"mord":{Sr=typeof a.value=="string"?a.value:xa,xa==="\\char"?Sr="&#x"+("000000"+a.args[0].number.toString(16)).slice(-4)+";":Sr.length>0&&Sr.startsWith("\\")&&(typeof a.value=="string"&&a.value.charCodeAt(0)>255?Sr="&#x"+("000000"+a.value.charCodeAt(0).toString(16)).slice(-4)+";":typeof a.value=="string"?Sr=a.value.charAt(0):(console.error("Did not expect this"),Sr=""));const ws=/\d/.test(Sr)?"mn":"mi";Sr=`<${ws}${ea(a.id,y)}>${Xh(Sr)}</${ws}>`;break}case"mbin":case"mrel":case"minner":Sr=Sc(a,y);break;case"mpunct":Sr='<mo separator="true"'+ea(a.id,y)+">"+xa+"</mo>";break;case"mop":case"operator":case"extensible-symbol":a.body!=="\u200B"&&(Sr="<mo"+ea(a.id,y)+">",Sr+=xa==="\\operatorname"?a.body:xa||a.body,Sr+="</mo>");break;case"box":Sr='<menclose notation="box"',a.backgroundcolor&&(Sr+=' mathbackground="'+a.backgroundcolor+'"'),Sr+=ea(a.id,y)+">"+Ri(a.body,y)+"</menclose>";break;case"spacing":Sr+='<mspace width="'+((jr=Gi[xa])!=null?jr:0)+'em"/>';break;case"enclose":Sr='<menclose notation="';for(const ws in a.notation)Object.prototype.hasOwnProperty.call(a.notation,ws)&&a.notation[ws]&&(Sr+=Zo+ws,Zo=" ");Sr+=ea(a.id,y)+'">'+Ri(a.body,y)+"</menclose>";break;case"prompt":Sr='<menclose notation="roundexbox""">'+Ri(a.body,y)+"</menclose>";break;case"space":Sr+="&nbsp;";break;case"subsup":break;case"phantom":break;case"composition":break;case"rule":break;case"chem":break;case"mopen":Sr+=Sc(a,y);break;case"mclose":Sr+=Sc(a,y);break;case"macro":{const ws=a.command+vu(a.macroArgs);ws&&(Sr+=`<mo ${ea(a.id,y)}>${ws}</mo>`)}break;case"latexgroup":Sr+=Ri(a.body,y);break;case"latex":Sr+="<mtext"+ea(a.id,y)+">"+a.value+"</mtext>";break;case"tooltip":Sr+=Ri(a.body,y);break;case"text":Sr+=`<mtext ${ea(a.id,y)}x>${a.value}</mtext>`;break;default:if(a.command==="\\displaystyle")return`<mrow ${ea(a.id,y)} displaystyle="true">${Ri(a.body,y)}</mrow>`;if(a.command==="\\textstyle")return`<mrow ${ea(a.id,y)} displaystyle="false">${Ri(a.body,y)}</mrow>`;console.info("Unexpected element in conversion to MathML:",a)}return Sr}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 Bv(a){let y="";return a.startsWith("\\")&&(y=" "+a.replace("\\","")+" "),y}function kd(a){let y=0;if(Ae(a))for(const b of a)b.type!=="first"&&(y+=1);return y===1}function Tv(a){if(Ae(a)){for(const y of a)if(y.type!=="first"&&y.id)return y.id.toString()}return""}function cp(a){let y="";if(Ae(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 _i(a,y){var b,E,ee,re,ae;function fe(Se){return window.MathfieldElement.textToSpeechMarkup?/[a-z]/.test(Se)?` <say-as interpret-as="character">${Se}</say-as>`:/[A-Z]/.test(Se)?`capital <say-as interpret-as="character">${Se.toLowerCase()}</say-as>`:Se:/[a-z]/.test(Se)?" '"+Se.toUpperCase()+"'":/[A-Z]/.test(Se)?" 'capital "+Se.toUpperCase()+"'":Se}function me(Se){return"<emphasis>"+Se+"</emphasis>"}if(!y)return"";let ve="";if(Ae(y)){let Se=!1,He=!1;for(let st=0;st<y.length;st++)y[st].type!=="first"&&(y[st].mode!=="text"&&(He=!1),st<y.length-2&&y[st].type==="mopen"&&y[st+2].type==="mclose"&&y[st+1].type==="mord"?(ve+=" of ",ve+=me(_i(a,y[st+1])),st+=2):y[st].mode==="text"?He?ve+=(b=y[st].value)!=null?b:" ":(He=!0,ve+=_i("text",y[st])):y[st].isDigit()?Se?ve+=y[st].asDigit():(Se=!0,ve+=_i(a,y[st])):(Se=!1,ve+=_i(a,y[st])))}else if(y.mode==="text")y.id&&a==="math"&&(ve+='<mark name="'+y.id.toString()+'"/>'),ve+=y.value;else{y.id&&a==="math"&&(ve+='<mark name="'+y.id.toString()+'"/>');let Se="",He="",st="",Mt=!1;const{command:It}=y;switch(It){case"\\vec":return"vector "+_i(a,y.body);case"\\acute":return _i(a,y.body)+" acute";case"\\grave":return _i(a,y.body)+" grave";case"\\dot":return"dot over"+_i(a,y.body);case"\\ddot":return"double dot over"+_i(a,y.body);case"\\mathring":return"ring over"+_i(a,y.body);case"\\tilde":case"\\widetilde":return"tilde over"+_i(a,y.body);case"\\bar":return _i(a,y.body)+" bar";case"\\breve":return _i(a,y.body)+" breve";case"\\check":case"\\widecheck":return"check over "+_i(a,y.body);case"\\hat":case"\\widehat":return"hat over"+_i(a,y.body);case"\\overarc":case"\\overparen":case"\\wideparen":return"arc over "+_i(a,y.body);case"\\underarc":case"\\underparen":return"arc under "+_i(a,y.body)}switch(y.type){case"prompt":const gn=y.body.length>1?'start input . <break time="500ms"/> '+_i(a,y.body)+'. <break time="500ms"/> end input':"blank";ve+=' <break time="300ms"/> '+gn+'. <break time="700ms"/>'+((E=y.correctness)!=null?E:"")+' . <break time="700ms"/> ';break;case"array":const hr=y.array,pn=y.environmentName;if(Object.keys(Zf).includes(pn)){ve+=` begin ${Zf[pn]} `;for(let Un=0;Un<hr.length;Un++){Un>0&&(ve+=","),ve+=` row ${Un+1} `;for(let zr=0;zr<hr[Un].length;zr++)zr>0&&(ve+=","),ve+=` column ${zr+1}: `,ve+=_i("math",hr[Un][zr])}ve+=` end ${Zf[pn]} `}break;case"group":It==="\\ne"?ve+=" not equal ":(It==="\\not"&&(ve+=" not "),ve+=_i("math",y.body));break;case"root":ve+=_i("math",y.body);break;case"genfrac":if(Se=_i("math",y.above),He=_i("math",y.below),kd(y.above)&&kd(y.below)){const zr={"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)];zr?ve=zr:ve+=Se+" over "+He}else ve+=' the fraction <break time="150ms"/>'+Se+' over <break time="150ms"/>'+He+'.<break time="150ms"/> End fraction.<break time="150ms"/>';break;case"surd":if(st=_i("math",y.body),y.hasEmptyBranch("above"))ve+=kd(y.body)?" the square root of "+st+" , ":' the square root of <break time="200ms"/>'+st+'. <break time="200ms"/> End square root';else{let Un=_i("math",y.above);Un=Un.trim();const zr=Un.replace(/<mark([^/]*)\/>/g,"");zr==="3"?ve+=' the cube root of <break time="200ms"/>'+st+'. <break time="200ms"/> End cube root':zr==="n"?ve+=' the nth root of <break time="200ms"/>'+st+'. <break time="200ms"/> End root':ve+=' the root with index: <break time="200ms"/>'+Un+', of <break time="200ms"/>'+st+'. <break time="200ms"/> End root'}break;case"leftright":{const Un=y;ve+=(ee=Un.leftDelim?yu[Un.leftDelim]:void 0)!=null?ee:Un.leftDelim,ve+=_i("math",y.body),ve+=(re=Un.rightDelim?yu[Un.rightDelim]:void 0)!=null?re:Un.rightDelim}break;case"rule":break;case"overunder":break;case"overlap":break;case"macro":const On=It.replace(/^\\/g,""),gr=an()[On];gr&&(gr!=null&&gr.expand?ve+=_i("math",y.body):ve+=`${On} `);break;case"placeholder":ve+="placeholder ";break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":{if(It==="\\mathbin"||It==="\\mathrel"||It==="\\mathopen"||It==="\\mathclose"||It==="\\mathpunct"||It==="\\mathord"||It==="\\mathinner"){ve=_i(a,y.body);break}let Un=y.isDigit()?y.asDigit():y.value,zr=y.command;if((y.type==="delim"||y.type==="sizeddelim")&&(zr=y.value,Un=zr),a==="text")ve+=Un;else{if(y.type==="mbin"&&(ve+='<break time="150ms"/>'),Un){const Xr=yu[Un]||(zr?yu[zr.trim()]:"");if(Xr)ve+=" "+Xr;else{const jr=zr?Bv(zr.trim()):"";ve+=jr||fe(Un)}}else ve+=_i("math",y.body);y.type==="mbin"&&(ve+='<break time="150ms"/>')}break}case"mop":case"operator":case"extensible-symbol":if(y.value!=="\u200B"){const Un=y.command;if(Un==="\\sum")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let zr=_i("math",y.superscript);zr=zr.trim();let Xr=_i("math",y.subscript);Xr=Xr.trim(),ve+=' the summation from <break time="200ms"/>'+Xr+'<break time="200ms"/> to <break time="200ms"/>'+zr+'<break time="200ms"/> of <break time="150ms"/>',Mt=!0}else if(y.hasEmptyBranch("subscript"))ve+=" the summation of";else{let zr=_i("math",y.subscript);zr=zr.trim(),ve+=' the summation from <break time="200ms"/>'+zr+'<break time="200ms"/> of <break time="150ms"/>',Mt=!0}else if(Un==="\\prod")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let zr=_i("math",y.superscript);zr=zr.trim();let Xr=_i("math",y.subscript);Xr=Xr.trim(),ve+=' the product from <break time="200ms"/>'+Xr+'<break time="200ms"/> to <break time="200ms"/>'+zr+'<break time="200ms"/> of <break time="150ms"/>',Mt=!0}else if(y.hasEmptyBranch("subscript"))ve+=" the product of ";else{let zr=_i("math",y.subscript);zr=zr.trim(),ve+=' the product from <break time="200ms"/>'+zr+'<break time="200ms"/> of <break time="150ms"/>',Mt=!0}else if(Un==="\\int")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let zr=_i("math",y.superscript);zr=zr.trim();let Xr=_i("math",y.subscript);Xr=Xr.trim(),ve+=' the integral from <break time="200ms"/>'+me(Xr)+'<break time="200ms"/> to <break time="200ms"/>'+me(zr)+' <break time="200ms"/> of ',Mt=!0}else ve+=' the integral of <break time="200ms"/> ';else if(typeof y.value=="string"){const zr=(ae=yu[y.value])!=null?ae:y.command?yu[y.command]:void 0;ve+=zr||" "+y.value}else y.command&&(y.command==="\\mathop"?ve+=_i("math",y.body):y.command==="\\operatorname"?ve+=Iv(y.body):ve+=y.command.startsWith("\\")?" "+y.command.slice(1):" "+y.command)}break;case"enclose":st=_i("math",y.body),ve+=" crossed out "+st+". End crossed out.";break;case"space":case"spacing":break}if(!Mt&&!y.hasEmptyBranch("superscript")){let gn=_i(a,y.superscript);gn=gn.trim();const hr=gn.replace(/<[^>]*>/g,"");if(kd(y.superscript)){if(a==="math"){const pn=Tv(y.superscript);pn&&(ve+='<mark name="'+pn+'"/>')}hr==="\u2032"?ve+=" prime ":hr==="2"?ve+=" squared ":hr==="3"?ve+=" cubed ":Number.isNaN(Number.parseInt(hr))?ve+=" to the "+gn+"; ":ve+=' to the <say-as interpret-as="ordinal">'+hr+"</say-as> power; "}else Number.isNaN(Number.parseInt(hr))?ve+=" raised to the "+gn+"; ":ve+=' raised to the <say-as interpret-as="ordinal">'+hr+"</say-as> power; "}if(!Mt&&!y.hasEmptyBranch("subscript")){let gn=_i("math",y.subscript);gn=gn.trim(),ve+=kd(y.subscript)?" sub "+gn:" subscript "+gn+". End subscript. "}}return ve}function bu(a){var y,b;if(window.MathfieldElement.textToSpeechRules==="sre"&&("sre"in window||"SRE"in window)){const ee=Ri(a);if(ee){window.MathfieldElement.textToSpeechMarkup&&(window.MathfieldElement.textToSpeechRulesOptions=(y=window.MathfieldElement.textToSpeechRulesOptions)!=null?y:{},window.MathfieldElement.textToSpeechRulesOptions=_e(we({},window.MathfieldElement.textToSpeechRulesOptions),{markup:window.MathfieldElement.textToSpeechMarkup}),window.MathfieldElement.textToSpeechRulesOptions.markup==="ssml"&&(window.MathfieldElement.textToSpeechRulesOptions=_e(we({},window.MathfieldElement.textToSpeechRulesOptions),{markup:"ssml_step"})),window.MathfieldElement.textToSpeechRulesOptions=_e(we({},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(fe){console.error("MathLive 0.98.5: `SRE.toSpeech()` runtime error",fe)}return ae}return""}let E=_i("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"&&at()==="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"},Ad={"\\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 Pv(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 ba(a){var y,b,E,ee,re,ae,fe,me,ve,Se,He,st,Mt;if(!a)return"";if(Ae(a)){if(a.length===0)return"";if(a[0].mode==="latex")return a.map(ba).join("");if(a[0].mode==="text"){let gr=0,Un="";for(;((y=a[gr])==null?void 0:y.mode)==="text";)Un+=a[gr].body?ba(a[gr].body):a[gr].value,gr++;return`"${Un}" ${ba(a.slice(gr))}`}let pn=0;const On=[];for(;a[pn]&&a[pn].mode==="math";){let gr="";for(;a[pn]&&a[pn].type==="mord"&&/\d/.test(a[pn].value);)gr+=a[pn++].value;gr?On.push(gr):On.push(ba(a[pn++]))}return On.push(ba(a.slice(pn))),Pv(On)}if(a.mode==="text")return`"${a.value}"`;let It="";const{command:gn}=a;let hr;if(gn==="\\placeholder")return`(${ba(a.body)})`;switch(a.type){case"accent":const pn={"\\vec":"vec","\\dot":"dot","\\ddot":"ddot","\\bar":"bar","\\hat":"hat","\\acute":"acute;","\\grave":"grave","\\tilde":"tilde","\\breve":"breave","\\check":"check"}[gn];It=`${pn!=null?pn:""} ${ba(a.body)} `;break;case"first":return"";case"latexgroup":return a.body.map(jr=>jr.value).join("");case"group":case"root":It=(b=Ld[gn])!=null?b:ba(a.body);break;case"genfrac":{const jr=a;(jr.leftDelim||jr.rightDelim)&&(It=jr.leftDelim==="."||!jr.leftDelim?"{:":jr.leftDelim),jr.hasBarLine?(It+="(",It+=ba(jr.above),It+=")/(",It+=ba(jr.below),It+=")"):(It+="("+ba(jr.above)+"),",It+="("+ba(jr.below)+")"),(jr.leftDelim||jr.rightDelim)&&(It+=jr.rightDelim==="."||!jr.rightDelim?"{:":jr.rightDelim)}break;case"surd":It+=a.hasEmptyBranch("above")?"sqrt("+ba(a.body)+")":"root("+ba(a.above)+")("+ba(a.body)+")";break;case"latex":It=a.value;break;case"leftright":{const jr=a,ki=jr.leftDelim;It+=ki==="."||!ki?"{:":ki,It+=ba(jr.body);const Gi=jr.matchingRightDelim();It+=Gi==="."||!Gi?":}":Gi}break;case"sizeddelim":case"delim":It=a.value;break;case"overlap":break;case"overunder":break;case"mord":It=(ee=(E=Ld[gn])!=null?E:gn)!=null?ee:typeof a.value=="string"?a.value:"",It.startsWith("\\")&&(It+=" "),hr=gn?gn.match(/{?\\char"([\dabcdefABCDEF]+)}?/):null,hr?It=String.fromCodePoint(Number.parseInt("0x"+hr[1])):It.length>0&&It.startsWith("\\")&&(It=typeof a.value=="string"?a.value.charAt(0):a.command),It=Ov(It,a.style);break;case"mbin":case"mrel":case"minner":It=(ae=(re=Ld[gn])!=null?re:Ad[gn])!=null?ae:a.value;break;case"mopen":case"mclose":It=a.value;break;case"mpunct":It=(fe=Ad[gn])!=null?fe:gn;break;case"mop":case"operator":case"extensible-symbol":a.value!=="\u200B"&&(Ad[gn]?It=Ad[gn]:It=gn==="\\operatorname"?ba(a.body):(me=a.value)!=null?me:gn,It+=" ");break;case"array":const On=a.array,gr=a.environmentName,Un=(ve={bmatrix:["[","]"],"bmatrix*":["[","]"]}[gr])!=null?ve:["(",")"],zr=[];for(const jr of On){const ki=[];for(const Gi of jr)ki.push(Un[0]+ba(Gi)+Un[1]);zr.push(ki.join(","))}const Xr=(Se={bmatrix:["[","]"],"bmatrix*":["[","]"],cases:["{",":}"]}[gr])!=null?Se:["(",")"];It=Xr[0]+zr.join(",")+Xr[1];break;case"box":break;case"spacing":It=(He=Ld[gn])!=null?He:" ";break;case"enclose":It="("+ba(a.body)+")";break;case"space":It=" ";break;case"subsup":It="";break;case"macro":It=(Mt=(st=Ld[gn])!=null?st:Ad[gn])!=null?Mt:ba(a.body);break}if(!a.hasEmptyBranch("subscript")){It+="_";const pn=ba(a.subscript);It+=pn.length!==1?`(${pn})`:pn}if(!a.hasEmptyBranch("superscript")){It+="^";const pn=ba(a.superscript);It+=pn.length!==1?`(${pn})`:pn}return It}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 Ua(a,y){var b,E;y!=null||(y={}),y.mathstyle=(b=y.mathstyle)!=null?b:"displaystyle";const ee=new Ei({from:_e(we({},Qc()),{renderPlaceholder:()=>new fr(160,{maxFontSize:1}),letterShapeStyle:(E=y==null?void 0:y.letterShapeStyle)!=null?E:"tex"}),mathstyle:y.mathstyle}),ae=new An({mode:"math",type:"root",body:Ga(a,{context:ee,parseMode:"math",mathstyle:y.mathstyle})}).render(ee);return ae?(qc(fd(ae,ee)),Yc(ae,{classes:"ML__latex"}).toMarkup()):""}function k1(a){return t0(a,{context:Qc()})}function $v(a,y={}){return Ri(Ga(a,{parseMode:"math",args:()=>"",mathstyle:"displaystyle"}),y)}function Nv(a){const y=Ga(a,{parseMode:"math",mathstyle:"displaystyle"});return bu(y)}var qh;function Rv(a){var y,b;if(!qh){const E=(y=globalThis[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:y.ComputeEngine;E?qh=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=qh==null?void 0:qh.box(a).latex)!=null?b:""}function L1(a,y="math"){return ba(new An({type:"root",body:Ga(a,{parseMode:y})}))}function A1(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,fe={L:y,C:ee,H:ae};return a.alpha!==void 0&&(fe.alpha=a.alpha),fe}function Gf(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),fe=4.076741661347994*ee-3.307711590408193*re+.230969928729428*ae,me=-1.2684380040921763*ee+2.6097574006633715*re-.3413193963102197*ae,ve=-.004196086541837188*ee-.7034186144594493*re+1.7076147009309444*ae,Se=He=>{const st=Math.abs(He);return st<=.0031308?He*12.92:(Math.sign(He)||1)*(1.055*Math.pow(st,1/2.4)-.055)};return[Se(fe),Se(me),Se(ve)]}function Uf(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]=Gf(a);if(Uf([y,b,E]))return Xf([y,b,E],a.alpha);const ee=zv(a);if(ee.C=0,[y,b,E]=Gf(Vf(ee)),!Uf([y,b,E]))return Xf([y,b,E],a.alpha);let re=0,ae=a.L,fe=(re+ae)/2;ee.C=fe;const me=.36/Math.pow(2,12);for(;ae-re>me;)fe=(re+ae)/2,ee.C=fe,[y,b,E]=Gf(Vf(ee)),Uf([y,b,E])?re=fe:ae=fe;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,fe=.65,me=.022,ve=1.414,Se=.1,He=5e-4,st=1.14,Mt=.027,It=1.14,gn=.027;function hr(jr){return jr>=me?jr:jr+qs(me-jr,ve)}function pn(jr){return(jr<0?-1:1)*Math.pow(Math.abs(jr),2.4)}const On=hr(pn(E.r/255)*.2126729+pn(E.g/255)*.7151522+pn(E.b/255)*.072175),gr=hr(pn(b.r/255)*.2126729+pn(b.g/255)*.7151522+pn(b.b/255)*.072175);let Un,zr,Xr;return Math.abs(gr-On)<He?zr=0:gr>On?(Un=qs(gr,ee)-qs(On,re),zr=Un*st):(Un=qs(gr,fe)-qs(On,ae),zr=Un*It),Math.abs(zr)<Se?Xr=0:zr>0?Xr=zr-gn:Xr=zr+Mt,Xr*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 ia(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 ia(a).length>0}function jv(a){return[qf(a,"double-struck","mathbb","tooltip.blackboard"),qf(a,"fraktur","mathfrak","tooltip.fraktur"),qf(a,"calligraphic","mathcal","tooltip.caligraphic"),Yf(a,"up","mathrm","tooltip.roman-upright"),Yf(a,"bold","mathbf","tooltip.bold"),Yf(a,"italic","mathit","tooltip.italic")]}function Vv(a){return[{label:()=>Ua(`\\vec{${ia(a)}}`),visible:()=>ia(a).length===1,onMenuSelect:()=>a.insert("\\vec{#@}",{selectionMode:"item"})},{label:()=>Ua(`\\overrightarrow{${ia(a)}}`),visible:()=>ia(a).length>0,onMenuSelect:()=>a.insert("\\overrightarrow{#@}",{selectionMode:"item"})},{label:()=>Ua(`\\overleftarrow{${ia(a)}}`),visible:()=>ia(a).length>0,onMenuSelect:()=>a.insert("\\overleftarrow{#@}",{selectionMode:"item"})},{label:()=>Ua(`\\dot{${ia(a)}}`),visible:()=>ia(a).length===1,onMenuSelect:()=>a.insert("\\dot{#@}",{selectionMode:"item"})},{label:()=>Ua(`\\ddot{${ia(a)}}`),visible:()=>ia(a).length===1,onMenuSelect:()=>a.insert("\\ddot{#@}",{selectionMode:"item"})},{label:()=>Ua(`\\bar{${ia(a)}}`),visible:()=>ia(a).length===1,onMenuSelect:()=>a.insert("\\bar{#@}",{selectionMode:"item"})},{label:()=>Ua(`\\overline{${ia(a)}}`),visible:()=>ia(a).length>0,onMenuSelect:()=>a.insert("\\overline{#@}",{selectionMode:"item"})},{label:()=>Ua(`\\overgroup{${ia(a)}}`),visible:()=>ia(a).length>0,onMenuSelect:()=>a.insert("\\overgroup{#@}",{selectionMode:"item"})},{label:()=>Ua(`\\overbrace{${ia(a)}}`),visible:()=>ia(a).length>0,onMenuSelect:()=>a.insert("\\overbrace{#@}",{selectionMode:"item"})},{label:()=>Ua(`\\underline{${ia(a)}}`),visible:()=>ia(a).length>0,onMenuSelect:()=>a.insert("\\underline{#@}",{selectionMode:"item"})},{label:()=>Ua(`\\undergroup{${ia(a)}}`),visible:()=>ia(a).length>0,onMenuSelect:()=>a.insert("\\undergroup{#@}",{selectionMode:"item"})},{label:()=>Ua(`\\underbrace{${ia(a)}}`),visible:()=>ia(a).length>0,onMenuSelect:()=>a.insert("\\underbrace{#@}",{selectionMode:"item"})}]}function Gv(a){return[{label:()=>Ua(`\\boxed{${a.getValue(a.model.selection)}}}`),onMenuSelect:()=>a.insert("\\boxed{#@}",{selectionMode:"item"})},{label:()=>Ua(`\\bbox[5px, border: 2px solid red]{${a.getValue(a.model.selection)}}`),onMenuSelect:()=>a.insert("\\bbox[5px, border: 2px solid red]{#@}",{selectionMode:"item"})},{label:()=>Ua(`\\bbox[5px, border: 2px dashed black]{${a.getValue(a.model.selection)}}`),onMenuSelect:()=>a.insert("\\bbox[5px, border: 2px dashed black]{#@}",{selectionMode:"item"})}]}function Uv(a){const y=[];for(const b of Object.keys(Ve))y.push({class:(Hv(hp(Ve[b]))==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${Ve[b]} "></span>`,ariaLabel:()=>{var E;return(E=vt(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(Je))y.push({class:(hp(Je[b])==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${Je[b]} "></span>`,ariaLabel:()=>{var E;return(E=vt(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 qv=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 Yv(a){const y=[];for(let b=1;b<=5;b++)for(let E=1;E<=5;E++)y.push({onCreate:(ee,re)=>new qv(ee,re,b,E),label:"\u2610",tooltip:()=>vt("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:()=>vt("menu.array.add row above"),id:"add-row-above",onMenuSelect:()=>a.executeCommand("addRowBefore"),visible:()=>Cc(a)},{label:()=>vt("menu.array.add row below"),id:"add-row-below",onMenuSelect:()=>a.executeCommand("addRowAfter"),visible:()=>Cc(a)},{label:()=>vt("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:()=>vt("menu.array.add column after"),id:"add-column-after",onMenuSelect:()=>a.executeCommand("addColumnAfter"),visible:()=>Cc(a)},{type:"divider"},{label:()=>vt("menu.array.delete row"),id:"delete-row",onMenuSelect:()=>a.executeCommand("removeRow"),visible:()=>Cc(a)},{label:()=>vt("menu.array.delete column"),id:"delete-column",onMenuSelect:()=>a.executeCommand("removeColumn"),visible:()=>Cc(a)},{type:"divider"},{label:()=>vt("menu.borders"),visible:()=>(Qv(a)||Cc(a))&&a.isSelectionEditable,submenu:[{label:" \u22F1 ",id:"environment-no-border",onMenuSelect:()=>Dd(a,"matrix")},{label:"(\u22F1)",id:"environment-parentheses",onMenuSelect:()=>Dd(a,"pmatrix")},{label:"[\u22F1]",id:"environment-brackets",onMenuSelect:()=>Dd(a,"bmatrix")},{label:"|\u22F1|",id:"environment-bar",onMenuSelect:()=>Dd(a,"vmatrix")},{label:"{\u22F1}",id:"environment-braces",onMenuSelect:()=>Dd(a,"Bmatrix")}],submenuClass:"border-submenu"},{type:"divider"},{label:()=>vt("menu.insert matrix"),id:"insert-matrix",visible:()=>a.isSelectionEditable,submenu:Yv(a),submenuClass:"insert-matrix-submenu",columnCount:5},{label:()=>vt("menu.mode"),id:"mode",visible:()=>a.isSelectionEditable&&a.model.selectionIsCollapsed,submenu:[{label:()=>vt("menu.mode-math"),id:"mode-math",onMenuSelect:()=>{cu(a,"accept-all"),a.executeCommand(["switchMode","math"])},checked:()=>a.model.mode==="math"},{label:()=>vt("menu.mode-text"),id:"mode-text",onMenuSelect:()=>{cu(a,"accept-all"),a.executeCommand(["switchMode","text"])},checked:()=>a.model.mode==="text"},{label:()=>vt("menu.mode-latex"),id:"mode-latex",onMenuSelect:()=>a.executeCommand(["switchMode","latex"]),checked:()=>a.model.mode==="latex"}]},{type:"divider"},{label:()=>vt("menu.font-style"),id:"variant",visible:()=>a.isSelectionEditable,submenu:jv(a),submenuClass:"variant-submenu"},{label:()=>vt("menu.color"),id:"color",visible:()=>a.isSelectionEditable,submenu:Xv(a),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>vt("menu.background-color"),id:"background-color",visible:()=>a.isSelectionEditable,submenu:Uv(a),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>vt("menu.accent"),id:"accent",visible:()=>a.isSelectionEditable,submenu:Vv(a),submenuClass:"variant-submenu"},{label:()=>vt("menu.decoration"),id:"decoration",visible:()=>a.isSelectionEditable&&ia(a).length>0,submenu:Gv(a),submenuClass:"variant-submenu"},{type:"divider"},{label:()=>vt("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:()=>vt("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?vt("menu.solve-for",Ua(b)):vt("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:()=>vt("menu.cut"),onMenuSelect:()=>a.executeCommand("cutToClipboard"),visible:()=>!a.options.readOnly&&a.isSelectionEditable,keyboardShortcut:"meta+X"},{label:()=>vt("menu.copy"),id:"copy",submenu:[{label:()=>vt("menu.copy-as-latex"),id:"copy-latex",onMenuSelect:()=>oi.copyToClipboard(a,"latex"),keyboardShortcut:"meta+C"},{label:()=>vt("menu.copy-as-ascii-math"),id:"copy-ascii-math",onMenuSelect:()=>oi.copyToClipboard(a,"ascii-math")},{label:()=>vt("menu.copy-as-mathml"),id:"copy-math-ml",onMenuSelect:()=>oi.copyToClipboard(a,"math-ml")}]},{label:()=>vt("menu.paste"),id:"paste",onMenuSelect:()=>a.executeCommand("pasteFromClipboard"),visible:()=>a.hasEditableContent,keyboardShortcut:"meta+V"},{label:()=>vt("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 Dd(a,y){Ch(a),a.flushInlineShortcutBuffer(),T0(a.model,y),ga(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 qf(a,y,b,E){return{label:()=>Ua(`\\${b}{${ia(a)}}`),tooltip:()=>{var ee;return(ee=vt(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 Yf(a,y,b,E){return{label:()=>Ua(`\\${b}{${ia(a)}}`),tooltip:()=>{var ee;return(ee=vt(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)}$o({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(Se){let He=null;switch(Se){case"all":He=re.root;break;case"selection":He=re.getAtoms(re.selection);break;case"left":{He=re.getAtoms(re.offsetOf(re.at(re.position).leftSibling),re.position);break}case"right":{He=re.getAtoms(re.position,re.offsetOf(re.at(re.position).rightSibling));break}case"group":He=re.getAtoms(re.getSiblingsRange(re.position));break;case"parent":{const{parent:st}=re.at(re.position);st!=null&&st.parent?He=st:He=re.root;break}default:He=re.root}return He}function fe(Se){let He="";switch(Se){case"all":console.log("Internal failure: speak all failed");break;case"selection":He="no selection";break;case"left":He="at start";break;case"right":He="at end";break;case"group":console.log("Internal failure: speak group failed");break;case"parent":He="no parent";break;default:console.log('unknown speak_ param value: "'+Se+'"');break}return He}const me=ae(y);if(me===null)return(ee=(E=window.MathfieldElement).speakHook)==null||ee.call(E,fe(y)),!1;(b.withHighlighting||window.MathfieldElement.speechEngine==="amazon")&&(window.MathfieldElement.textToSpeechMarkup=window.sre&&window.MathfieldElement.textToSpeechRules==="sre"?"ssml_step":"ssml");const ve=bu(me);return ft()&&b.withHighlighting?(Fl().readAloudMathfield=a,pc(a,{forHighlighting:!0}),window.MathfieldElement.readAloudHook&&window.MathfieldElement.readAloudHook(a.field,ve)):window.MathfieldElement.speakHook&&window.MathfieldElement.speakHook(ve),!1}function r1(a){var y,b;if(!ft()){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 fe=new Uint8Array(ae.AudioStream),me=new Blob([fe.buffer],{type:"audio/mpeg"}),ve=URL.createObjectURL(me);new Audio(ve).play().catch(He=>console.log(He))}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 Se=re.ranges[0][0];if(!this.mathfield.dirty&&!((b=this.at(Se))!=null&&b.parentPrompt)&&this.mathfield.hasEditablePrompts){if((E=this.at(Se-1))!=null&&E.parentPrompt){this._anchor=this.normalizeOffset(Se-1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}if((ee=this.at(Se+1))!=null&&ee.parentPrompt){this._anchor=this.normalizeOffset(Se+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=Se,this._position=Se,this._selection=re;return}const ae=ja(re);re.direction==="backward"?[this._position,this._anchor]=ae:[this._anchor,this._position]=ae;const fe=this.at(ae[0]+1),me=this.at(ae[1]),ve=An.commonAncestor(fe,me);(ve==null?void 0:ve.type)==="array"&&fe.parent===ve&&me.parent===ve?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 eo&&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((ve,Se)=>[...ve,...this.getAtoms(Se,E)],[]);a=a.ranges[0]}let ee,re;if(Ps(a)){if(ee=a,!Ps(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,fe=Math.max(ee,re);if(!E.includeChildren&&ae===1&&fe===this.lastOffset)return[this.root];let me=[];for(let ve=ae;ve<=fe;ve++){const Se=this.atoms[ve];mp(this,Se,ae,fe)&&me.push(Se)}return E.includeChildren||(me=me.filter(ve=>{let Se=!1,{parent:He}=ve;for(;He&&!Se;)Se=mp(this,He,ae,fe),He=He.parent;return!Se})),me}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 An({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 An.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 Ri(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"?ba(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(Ps(a)&&Ps(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 bi(E.map(ae=>An.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 fe=this.root.changeCounter!==ae,me=E!==this._anchor||ee!==this._position||cc(this._selection,b)==="different";return this.silenceNotifications=re,a.content&&fe&&this.contentDidChange({inputType:a.type}),a.selection&&me&&this.selectionDidChange(),fe||me}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(Ps(a)){const ee=this.normalizeOffset(a);if(Ps(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",_e(we({},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 Bd(a,y,b,E){var ee,re,ae,fe,me,ve;const Se=b.parent;if(Se&&b instanceof Ni){const He=!E&&y==="forward"||E==="body"&&y==="backward";let st=He?a.offsetOf(b.firstChild):a.offsetOf(b.lastChild);return He?b.rightDelim!=="?"&&b.rightDelim!=="."?(b.leftDelim=".",b.isDirty=!0):(Se.addChildrenAfter(b.removeBranch("body"),b),Se.removeChild(b),st--):b.leftDelim!=="?"&&b.leftDelim!=="."?(b.rightDelim=".",b.isDirty=!0):(Se.addChildrenAfter(b.removeBranch("body"),b),Se.removeChild(b),st--),a.position=st,!0}if(Se&&b.type==="surd"){if(y==="forward"&&!E||y==="backward"&&E==="body"){const He=b.leftSibling;b.hasChildren&&Se.addChildrenAfter(b.removeBranch("body"),b),Se.removeChild(b),a.position=a.offsetOf(He)}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),Se.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(Se&&(b.type==="box"||b.type==="enclose")){const He=E&&y==="backward"||!E&&y==="forward"?b.leftSibling:b.lastChild;return Se.addChildrenAfter(b.removeBranch("body"),b),Se.removeChild(b),a.position=a.offsetOf(He),!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 He=Td.fractionNavigationOrder==="numerator-denominator"?"above":"below",st=He==="above"?"below":"above";if(Se&&(y==="forward"&&E===He||y==="backward"&&E===st)){const Mt=b.removeBranch(He),It=b.removeBranch(st);return Se.addChildrenAfter([...Mt,...It],b),Se.removeChild(b),a.position=a.offsetOf(Mt.length>0?Mt[Mt.length-1]:It[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 He=y==="forward"?(ae=(ee=b.superscript)==null?void 0:ee[0])!=null?ae:(re=b.subscript)==null?void 0:re[0]:(ve=(fe=b.subscript)==null?void 0:fe[0].lastSibling)!=null?ve:(me=b.superscript)==null?void 0:me[0].lastSibling;return He&&(a.position=a.offsetOf(He)),!0}return!1}if(!b.hasChildren&&b.type==="subsup"){const He=y==="forward"?a.offsetOf(b):Math.max(0,a.offsetOf(b)-1);return b.parent.removeChild(b),a.position=He,!0}if(E==="superscript")if(y==="backward"){const He=a.offsetOf(b.firstChild)-1;console.assert(He>=0),a.position=He}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 He=y==="forward"?a.offsetOf(b):Math.max(0,a.offsetOf(b)-1);b.parent.removeChild(b),a.position=He}return!0}if((Se==null?void 0:Se.type)==="genfrac"&&!E&&b.type!=="first"){let He=a.offsetOf(b.leftSibling);return Se.removeChild(b),Se.hasEmptyBranch("above")&&Se.hasEmptyBranch("below")?(He=a.offsetOf(Se.leftSibling),Se.parent.removeChild(Se),a.announce("delete",void 0,[Se]),a.position=He,!0):(a.announce("delete",void 0,[b]),a.position=He,!0)}if(y==="backward"&&((Se==null?void 0:Se.command)==="\\ln"||(Se==null?void 0:Se.command)==="\\log")&&b.parentBranch!=="body"){const He=a.offsetOf(Se.leftSibling);return Se.parent.removeChild(Se),a.announce("delete",void 0,[Se]),a.position=He,!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&&Bd(a,"backward",y))){if(y!=null&&y.isFirstSibling){if(Bd(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,ja(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&&Bd(a,"forward",E))return;if(E){if(a.at(a.position).isLastSibling&&Bd(a,"forward",E.parent,E.parentBranch))return}else{if(E=a.at(a.position),E.isLastSibling&&Bd(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,ja(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 fe=E[E.length-1];if(ae===ee&&fe===re){const me=E[0].parent;me.parent&&me.type!=="prompt"&&(y=[a.offsetOf(me.leftSibling),a.offsetOf(me)])}if(E.length===1&&E[0].type==="placeholder"&&E[0].parent.type==="genfrac"){const me=E[0].parent,ve=E[0].parentBranch==="below"?"above":"below",Se=a.offsetOf(me.leftSibling);return a.deferNotifications({content:!0,selection:!0,type:b},()=>{var He,st;const Mt=me.removeBranch(ve);if(Mt.length===1&&Mt[0].type==="placeholder")(st=me.parent)==null||st.removeChild(me),a.position=Math.max(0,Se);else{const It=me.parent.addChildrenAfter(Mt,me);(He=me.parent)==null||He.removeChild(me),a.position=a.offsetOf(It)}})}}return a.deferNotifications({content:!0,selection:!0,type:b},()=>a.deleteAtoms(y))}$o({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,kf(a,a.position,"forward")],"deleteWordForward"),deletePreviousWord:a=>a.contentWillChange({inputType:"deleteWordBackward"})&&Zs(a,[a.anchor,kf(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="${vt("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="${vt("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=we(_e(we({},Ph()),{macros:an(),registers:Dl()}),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 fe=A0(this.options),me=new An({type:"root",mode:fe,body:Ga(ae,{context:this.context})});this.model=new s1(this,fe,me),this.undoManager=new Ng(this.model);const ve=[];if(ve.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>"),ve.push('<span part=container class=ML__container aria-hidden=true style="visibility:hidden">'),ve.push("<span part=content class=ML__content>"),ve.push(w0(this)),ve.push("</span>"),window.mathVirtualKeyboard&&(ve.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">`),ve.push(u1),ve.push("</div>")),ve.push('<div part=menu-toggle class=ML__menu-toggle role=button data-l10n-tooltip="tooltip.menu">'),ve.push(d1),ve.push("</div>"),ve.push("</span>"),ve.push("<span class=ML__sr-only>"),ve.push("<span role=status aria-live=assertive aria-atomic=true></span>"),ve.push("</span>"),this.element.innerHTML=window.MathfieldElement.createHTML(ve.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=it.subscribe(()=>it.update(this.element)),it.update(this.element),this.field=this.element.querySelector("[part=content]"),this.field.addEventListener("click",He=>He.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 Se=this.element.querySelector("[part=menu-toggle]");Se==null||Se.addEventListener("pointerdown",He=>{if(He.currentTarget!==Se||this._menu.state!=="closed")return;this.element.classList.add("tracking");const st=Se.getBoundingClientRect();this._menu.modifiers=fc(He),this._menu.show({target:Se,location:{x:st.left,y:st.bottom},onDismiss:()=>this.element.classList.remove("tracking")}),He.preventDefault(),He.stopPropagation()},{signal:re}),(this.model.atoms.length<=1||this.disabled||this.readOnly&&!this.hasEditableContent||this.userSelect==="none")&&(Se.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(()=>ga(this)),this.resizeObserver.observe(this.field),window.mathVirtualKeyboard.addEventListener("virtual-keyboard-toggle",this,{signal:re}),gd&&!it.locale.startsWith(gd.locale)&&Rm(it.locale),Wo!=="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,Rf())}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:Dt(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:Ge(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=An.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=we({},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 me of Object.keys(y)){const ve=this.queryStyle({[me]:y[me]});if(ve==="none")return"none";if(ve==="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 fe=0;for(const me of re){if(me.type==="first"){ae-=1;continue}me.style[E]===ee&&(fe+=1)}return fe===0?"none":fe===ae?"all":"some"}get keybindings(){var a,y;if(this._keybindings)return this._keybindings;const[b,E]=Gm(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=we(we({},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=An.serialize([this.model.root],{expandMacro:!1,defaultMode:this.options.defaultMode});("macros"in a||this.model.getValue()!==E)&&oi.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)&&ga(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(zo(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(()=>zo(this)&&this.onGeometryChange());break;case"scroll":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>zo(this)&&this.onGeometryChange());break;case"wheel":this.onWheel(a);break;default:console.warn("Unexpected event type",a.type)}}})}dispose(){if(!zo(this))return;it.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,Ug(),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();oi.insert(this.model,a,y)&&(ga(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&&ot()&&navigator.vibrate(S0),window.MathfieldElement.playSound("keypress")),a==="\\\\"?D0(this.model):a==="&"?B0(this.model):this.model.selectionIsCollapsed?oi.insert(this.model,a,we({style:this.model.at(this.model.position).computedStyle},y)):oi.insert(this.model,a,y),this.snapshot(`insert-${this.model.at(this.model.position).type}`),ga(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 fe=!1;if(this.flushInlineShortcutBuffer(),this.stopCoalescingUndo(),y&&a!=="latex"){const me=Ga(y,{context:this.context,parseMode:a});ae.collapseSelection("forward");const ve=ae.at(ae.position);ae.position=ae.offsetOf(ve.parent.addChildrenAfter(me,ve)),fe=!0}if(this.model.mode=a,a==="latex"){let me=ae.selectionIsCollapsed;cu(this,"accept");let ve,Se=ae.at(ae.position);if(me)ve="\\";else{const st=ja(ae.selection);ve=this.model.getValue(st,"latex");const Mt=this.model.extractAtoms(st);Mt.length===1&&Mt[0].type==="placeholder"&&(ve=y,me=!0),Se=ae.at(st[0])}const He=new ud(ve);Se.parent.addChildAfter(He,Se),me?ae.position=ae.offsetOf(He.lastChild):ae.setSelection(ae.offsetOf(He.firstChild),ae.offsetOf(He.lastChild))}else yd(ae).forEach(me=>{me.isError=!1});if(b){const me=Ga(b,{context:this.context,parseMode:re});ae.collapseSelection("forward");const ve=ae.at(ae.position);ae.position=ae.offsetOf(ve.parent.addChildrenAfter(me,ve)),fe=!0}return ga(this),this.undoManager.snapshot(a==="latex"?"insert-latex":"insert"),fe}),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=we(we({},this.defaultStyle),re);return}const fe=we({},this.defaultStyle);for(const me of Object.keys(re))fe[me]===re[me]?(me==="color"&&delete fe.verbatimColor,me==="backgroundColor"&&delete fe.verbatimBackgroundColor,delete fe[me]):fe[me]=re[me];this.defaultStyle=fe;return}this.model.deferNotifications({content:!ee.silenceNotifications,type:"insertText"},()=>{if(ee.range===void 0)for(const fe of this.model.selection.ranges)Ef(this.model,fe,re,{operation:ae});else Ef(this.model,ee.range,re,{operation:ae})}),ga(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=Md(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),ga(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,_e(we({},b),{insertionMode:"replaceSelection"}))}b!=null&&b.silenceNotifications&&(this.valueOnFocus=this.getValue()),ga(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),ga(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:A0(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",_e(we({},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})),ga(this),this.focusBlurInProgress=!1,Rf();const E=new AbortController,ee=E.signal;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&document.addEventListener("visibilitychange",()=>{zo(this)&&document.visibilityState==="visible"&&this.focus({preventScroll:!0})},{once:!0,signal:ee})},{once:!0,signal:ee}),setTimeout(()=>E.abort(),100)}onInput(a){Df(this,a)}onKeystroke(a){return K0(this,a)}onCompositionStart(a){this.model.deleteAtoms(ja(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),ga(this)}onCompositionEnd(a){Ag(this.model),Df(this,a,{simulateKeystroke:!0})}onCut(a){if(!this.isSelectionEditable){this.model.announce("plonk");return}this.model.contentWillChange({inputType:"deleteByCut"})&&(this.stopCoalescingUndo(),oi.onCopy(this,a),Zs(this.model,ja(this.model.selection),"deleteByCut"),this.snapshot("cut"),ga(this))}onCopy(a){oi.onCopy(this,a)}onPaste(a){let y=this.isSelectionEditable;return y&&(y=oi.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(),Eh(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=>vn(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(!ft())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 fe=new TextDecoder("utf-8").decode(new Uint8Array(ae.AudioStream));Fl().readAloudMarks=fe.split(`
`).map(me=>me?JSON.parse(me):{}),Fl().readAloudTokens=[];for(const me of Fl().readAloudMarks)me.value&&Fl().readAloudTokens.push(me.value);Fl().readAloudCurrentMark="",ee.OutputFormat="mp3",ee.SpeechMarkTypes=[],E.synthesizeSpeech(ee,(me,ve)=>{if(me){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech("${y}") error:${me}`);return}if(!(ve!=null&&ve.AudioStream))return;const Se=new Uint8Array(ve.AudioStream),He=new Blob([Se.buffer],{type:"audio/mpeg"}),st=URL.createObjectURL(He),Mt=Fl();Mt.readAloudAudio?Mt.readAloudAudio.pause():(Mt.readAloudAudio=new Audio,Mt.readAloudAudio.addEventListener("ended",()=>{const It=Mt.readAloudMathfield;Mt.readAloudStatus="ended",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),It?(pc(It),Mt.readAloudElement=null,Mt.readAloudMathfield=null,Mt.readAloudTokens=[],Mt.readAloudMarks=[],Mt.readAloudCurrentMark=""):gp(Mt.readAloudElement)}),Mt.readAloudAudio.addEventListener("timeupdate",()=>{let It="";const gn=Mt.readAloudAudio.currentTime*1e3+100;for(const hr of Mt.readAloudMarks)hr.time<gn&&(It=hr.value);Mt.readAloudCurrentMark!==It&&(Mt.readAloudCurrentToken=It,It&&It===Mt.readAloudFinalToken?Mt.readAloudAudio.pause():(Mt.readAloudCurrentMark=It,Qf(Mt.readAloudElement,Mt.readAloudCurrentMark)))})),Mt.readAloudAudio.src=st,Mt.readAloudStatus="playing",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),Mt.readAloudAudio.play()})})}ft()||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 Ai=new WeakMap,p1=.5,Rl={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 = ..."},to=class _c 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 it.locale}static set locale(y){y==="auto"&&(y=navigator.language.slice(0,5)),it.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 it.strings}static set strings(y){it.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(Rl[E])if(Rl[E].startsWith("mf."))if(Rl[E].startsWith(`mf.${E}`))b.push(`Option \`${E}\` cannot be used as a constructor option. Use ${Rl[E]}`);else{const ee=Rl[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 ${Rl[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=[Pl("core"),Pl("mathfield"),Pl("mathfield-element"),Pl("ui"),Pl("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=_c.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):Ai.has(this)?we({},gc(we(we({},Ph()),Ih(Ai.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):Ai.has(this)?gc(we(we({},Ph()),Ih(Ai.get(this).options)),y):null}reflectAttributes(){const y=Ph(),b=this._getOptions();Object.keys(_c.optionsAttributes).forEach(E=>{const ee=gl(E);_c.optionsAttributes[E]==="on/off"?y[ee]!==b[ee]?this.setAttribute(E,b[ee]?"on":"off"):this.removeAttribute(E):y[ee]!==b[ee]&&(_c.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(Ai.has(this)){const b=we(we({},Ai.get(this).options),y);Ai.set(this,_e(we({},Ai.get(this)),{selection:{ranges:b.readOnly?[[0,0]]:[[0,-1]]},options:b}))}else Ai.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))Rl[b]&&console.warn(`\`mf.setOptions({${b}:...})\` -> ${Rl[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(Ai.has(this)){let ae,fe,me;if(tu(y)?([ae,fe]=y.ranges[0],me=b):eu(y)?([ae,fe]=y,me=b):Ps(y)&&Ps(b)?(ae=y,fe=b,me=E):(ae=0,fe=-1,me=y),(me===void 0||me==="latex")&&ae===0&&fe===-1)return(re=(ee=Ai.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(Ai.has(this)){const ee=Ai.get(this).options;Ai.set(this,{value:y,selection:{ranges:[[-1,-1]],direction:"forward"},options:ee,menuItems:void 0});return}const E=Id(this);Ai.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?Md(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=Tl(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,fe=re.userSelect!=="none";if(fe)ae.host.addEventListener("pointerdown",this,!0);else{const Se=ae.querySelector("span");Se.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")),fe&&!this.hasAttribute("contenteditable")&&this.setAttribute("contenteditable","true"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");const me=ae.querySelector("slot:not([name])");if(me)try{this._style=me.assignedElements().filter(Se=>Se.tagName.toLowerCase()==="style").map(Se=>Se.textContent).join("")}catch(Se){console.error(Se)}if(this._style){const Se=document.createElement("style");Se.textContent=this._style,ae.appendChild(Se)}let ve="";if(this.hasAttribute("value")?ve=this.getAttribute("value"):ve=(y=me==null?void 0:me.assignedNodes().map(Se=>Se.nodeType===3?Se.textContent:"").join("").trim())!=null?y:"",this._mathfield=new h1(ae.querySelector(":host > span"),_e(we({},(E=(b=Ai.get(this))==null?void 0:b.options)!=null?E:Id(this)),{eventSink:this,value:ve})),!Ai.has(this)){this.upgradeProperty("disabled"),this.upgradeProperty("readonly");for(const Se of Object.keys(_c.optionsAttributes))this.upgradeProperty(gl(Se))}if(!((ee=this._mathfield)!=null&&ee.model)){this._mathfield=null;return}if(Ai.has(this)){const Se=this._mathfield,He=Ai.get(this),st=He.menuItems;Se.model.deferNotifications({content:!1,selection:!1},()=>{const Mt=He.value;Mt!==void 0&&Se.setValue(Mt),Se.model.selection=He.selection,Ai.delete(this)}),st&&(this.menuItems=st)}window.queueMicrotask(()=>{this.isConnected&&this.dispatchEvent(new Event("mount",{cancelable:!1,bubbles:!0,composed:!0}))}),kh()}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(_c.optionsAttributes).map(ee=>gl(ee)));Ai.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":ga(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:_e(we({},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=Ai.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}Ai.has(this)?Ai.set(this,_e(we({},Ai.get(this)),{menuItems:y})):Ai.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:Ai.has(this)?Ai.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,ga(this._mathfield);return}if(Ai.has(this)){Ai.set(this,_e(we({},Ai.get(this)),{selection:y}));return}Ai.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:Ai.has(this)?Ai.get(this).selection.ranges[0][0]:0}set position(y){if(this._mathfield&&(this._mathfield.model.position=y,ga(this._mathfield)),Ai.has(this)){Ai.set(this,_e(we({},Ai.get(this)),{selection:{ranges:[[y,y]]}}));return}Ai.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}};to.version="0.98.5",to._fontsDirectory="./fonts",to._soundsDirectory="./sounds",to.keypressVibration=!0,to._keypressSound={spacebar:"keypress-spacebar.wav",return:"keypress-return.wav",delete:"keypress-delete.wav",default:"keypress-standard.wav"},to._plonkSound="plonk.wav",to.audioBuffers={},to.createHTML=a=>a,to._speechEngineRate="100%",to._speechEngineVoice="Joanna",to._textToSpeechMarkup="",to._textToSpeechRules="mathlive",to._textToSpeechRulesOptions={},to.speakHook=r1,to.readAloudHook=f1,to._decimalSeparator=".",to.fractionNavigationOrder="numerator-denominator",to._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 Td=to;function gl(a){return a.replace(/[^a-zA-Z\d]+(.)/g,(y,b)=>b.toUpperCase())}function Id(a){const y={readOnly:!1},b=Td.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=Td,yp,bp,xp,wp;if(ft()&&!((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=Td,(wp=window.customElements)==null||wp.define("math-field",Td)}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 Yh(a,y,b,E,ee="latex"){const re=[];for(const ae of a)if(ae.type==="text"){const fe=ae.data;let me=!0,ve=0,Se;Se=fe.indexOf(y),Se!==-1&&(ve=Se,ve>0&&re.push({type:"text",data:fe.slice(0,ve)}),me=!1);let He=!1;for(;!He;){if(me){if(Se=fe.indexOf(y,ve),Se===-1){He=!0;break}ve!==Se&&re.push({type:"text",data:fe.slice(ve,Se)}),ve=Se}else{if(Se=m1(b,fe,ve+y.length),Se===-1){He=!0;break}let st=fe.slice(ve+y.length,Se);ee==="ascii-math"&&([,st]=uc(st,{format:"ascii-math"})),re.push({type:"math",data:st,rawData:fe.slice(ve,Se+b.length),mathstyle:E}),ve=Se+b.length}me=!me}ve<fe.length&&re.push({type:"text",data:fe.slice(ve)})}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=Yh(E,ee,re,"textstyle")}),y!=null&&y.display&&y.display.forEach(([ee,re])=>{E=Yh(E,ee,re,"displaystyle")}),b!=null&&b.inline&&b.inline.forEach(([ee,re])=>{E=Yh(E,ee,re,"textstyle","ascii-math")}),b!=null&&b.display&&b.display.forEach(([ee,re])=>{E=Yh(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 fe=document.createElement("span");if(/\bmathml\b/i.test(ae)&&b.renderToMathML&&fe.append(g1(a,b)),/\bspeakable-text\b/i.test(ae)&&b.renderToSpeakableText){const me=document.createElement("span");me.setAttribute("translate","no");const ve=b.renderToSpeakableText(a);me.innerHTML=window.MathfieldElement.createHTML(ve),me.className="ML__sr-only",fe.append(me)}return fe.append(re),fe}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 fe of ae)if(fe.type==="text")re.appendChild(document.createTextNode(fe.data));else{const me=Cu(fe.data,fe.mathstyle==="textstyle"?"textstyle":"displaystyle",y,!0);me&&re.appendChild(me)}}return re}function Cp(a,y){var b,E,ee,re,ae,fe,me,ve,Se,He,st,Mt,It,gn,hr,pn;if(a.childNodes.length===1&&a.childNodes[0].nodeType===3){const On=(b=a.childNodes[0].textContent)!=null?b:"";if((E=y.TeX)!=null&&E.processEnvironments&&/^\s*\\begin/.test(On)){a.textContent="";const Un=Cu(On,"",y,!0);Un&&a.append(Un);return}const gr=Sp(On,(ee=y.TeX)==null?void 0:ee.delimiters,(re=y.asciiMath)==null?void 0:re.delimiters);if(gr.length===1&&gr[0].type==="math"){a.textContent="";const Un=Cu(gr[0].data,gr[0].mathstyle==="textstyle"?"textstyle":"displaystyle",y,!0);Un&&a.append(Un);return}if(gr.length===1&&gr[0].type==="text")return}for(let On=a.childNodes.length-1;On>=0;On--){const gr=a.childNodes[On];if(gr.nodeType===3){const Un=y1((ae=gr.textContent)!=null?ae:"",y);Un&&(On+=Un.childNodes.length-1,gr.replaceWith(Un))}else if(gr.nodeType===1){const Un=gr,zr=gr.nodeName.toLowerCase();if(zr==="script"){const Xr=gr;let jr;if((fe=y.processScriptTypePattern)!=null&&fe.test(Xr.type))jr=(me=Xr.textContent)!=null?me:"";else if((ve=y.processMathJSONScriptTypePattern)!=null&&ve.test(Xr.type))try{jr=(He=y.serializeToLatex)==null?void 0:He.call(y,JSON.parse((Se=Xr.textContent)!=null?Se:""))}catch(ki){console.error(ki)}if(jr){let ki="textstyle";for(const Sr of Xr.type.split(";")){const[Zo,js]=Sr.toLowerCase().split("=");Zo.trim()==="mode"&&(ki=js.trim()==="display"?"displaystyle":"textstyle")}const Gi=Cu(jr,ki,y,!0);Gi&&Xr.parentNode.replaceChild(Gi,Xr)}}else if(((Mt=(st=y.processClassPattern)==null?void 0:st.test(Un.className))!=null?Mt:!1)||!((gn=(It=y.skipTags)==null?void 0:It.includes(zr))!=null&&gn||(pn=(hr=y.ignoreClassPattern)==null?void 0:hr.test(Un.className))!=null&&pn))if(a.childNodes.length===1&&a.childNodes[0].nodeType===3){const jr=a.textContent;a.textContent="";const ki=Cu(jr!=null?jr:"","displaystyle",y,!0);ki&&a.append(ki)}else Cp(Un,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=we(we({},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:""),kh(),Oo("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=$l.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}$o({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 D1(){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 B1(a){_1(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 _1(a,y){var b,E,ee,re;const ae=C1(a);if(!ae)return;const fe=y!=null?y:{};(b=fe.renderToMarkup)!=null||(fe.renderToMarkup=Ua),(E=fe.renderToMathML)!=null||(fe.renderToMathML=$v),(ee=fe.renderToSpeakableText)!=null||(fe.renderToSpeakableText=Nv),(re=fe.serializeToLatex)!=null||(fe.serializeToLatex=Rv),x1(ae,fe)}var T1={mathlive:"0.98.5"}},16722:function(bn,tn,ue){"use strict";ue.d(tn,{Z:function(){return we}});const se=_e=>typeof _e=="object"&&_e!=null&&_e.nodeType===1,Te=(_e,Re)=>(!Re||_e!=="hidden")&&_e!=="visible"&&_e!=="clip",ze=(_e,Re)=>{if(_e.clientHeight<_e.scrollHeight||_e.clientWidth<_e.scrollWidth){const dt=getComputedStyle(_e,null);return Te(dt.overflowY,Re)||Te(dt.overflowX,Re)||(Ae=>{const Fe=(ft=>{if(!ft.ownerDocument||!ft.ownerDocument.defaultView)return null;try{return ft.ownerDocument.defaultView.frameElement}catch(Ye){return null}})(Ae);return!!Fe&&(Fe.clientHeight<Ae.scrollHeight||Fe.clientWidth<Ae.scrollWidth)})(_e)}return!1},ut=(_e,Re,dt,Ae,Fe,ft,Ye,ot)=>ft<_e&&Ye>Re||ft>_e&&Ye<Re?0:ft<=_e&&ot<=dt||Ye>=Re&&ot>=dt?ft-_e-Ae:Ye>Re&&ot<dt||ft<_e&&ot>dt?Ye-Re+Fe:0,xe=_e=>{const Re=_e.parentElement;return Re==null?_e.getRootNode().host||null:Re},Me=(_e,Re)=>{var dt,Ae,Fe,ft;if(typeof document=="undefined")return[];const{scrollMode:Ye,block:ot,inline:at,boundary:Ct,skipOverflowHiddenElements:jt}=Re,it=typeof Ct=="function"?Ct:Vt=>Vt!==Ct;if(!se(_e))throw new TypeError("Invalid target");const vt=document.scrollingElement||document.documentElement,$e=[];let Ee=_e;for(;se(Ee)&&it(Ee);){if(Ee=xe(Ee),Ee===vt){$e.push(Ee);break}Ee!=null&&Ee===document.body&&ze(Ee)&&!ze(document.documentElement)||Ee!=null&&ze(Ee,jt)&&$e.push(Ee)}const Ve=(Ae=(dt=window.visualViewport)==null?void 0:dt.width)!=null?Ae:innerWidth,Je=(ft=(Fe=window.visualViewport)==null?void 0:Fe.height)!=null?ft:innerHeight,{scrollX:Lt,scrollY:et}=window,{height:Dt,width:Ge,top:kt,right:tt,bottom:$t,left:pt}=_e.getBoundingClientRect(),{top:Bt,right:Tt,bottom:wt,left:Ne}=(Vt=>{const qe=window.getComputedStyle(Vt);return{top:parseFloat(qe.scrollMarginTop)||0,right:parseFloat(qe.scrollMarginRight)||0,bottom:parseFloat(qe.scrollMarginBottom)||0,left:parseFloat(qe.scrollMarginLeft)||0}})(_e);let be=ot==="start"||ot==="nearest"?kt-Bt:ot==="end"?$t+wt:kt+Dt/2-Bt+wt,xt=at==="center"?pt+Ge/2-Ne+Tt:at==="end"?tt+Tt:pt-Ne;const Qt=[];for(let Vt=0;Vt<$e.length;Vt++){const qe=$e[Vt],{height:nt,width:Ot,top:dn,right:en,bottom:on,left:Xt}=qe.getBoundingClientRect();if(Ye==="if-needed"&&kt>=0&&pt>=0&&$t<=Je&&tt<=Ve&&(qe===vt&&!ze(qe)||kt>=dn&&$t<=on&&pt>=Xt&&tt<=en))return Qt;const Ut=getComputedStyle(qe),Zt=parseInt(Ut.borderLeftWidth,10),ye=parseInt(Ut.borderTopWidth,10),le=parseInt(Ut.borderRightWidth,10),oe=parseInt(Ut.borderBottomWidth,10);let he=0,pe=0;const ce="offsetWidth"in qe?qe.offsetWidth-qe.clientWidth-Zt-le:0,Ie="offsetHeight"in qe?qe.offsetHeight-qe.clientHeight-ye-oe:0,yt="offsetWidth"in qe?qe.offsetWidth===0?0:Ot/qe.offsetWidth:0,Pe="offsetHeight"in qe?qe.offsetHeight===0?0:nt/qe.offsetHeight:0;if(vt===qe)he=ot==="start"?be:ot==="end"?be-Je:ot==="nearest"?ut(et,et+Je,Je,ye,oe,et+be,et+be+Dt,Dt):be-Je/2,pe=at==="start"?xt:at==="center"?xt-Ve/2:at==="end"?xt-Ve:ut(Lt,Lt+Ve,Ve,Zt,le,Lt+xt,Lt+xt+Ge,Ge),he=Math.max(0,he+et),pe=Math.max(0,pe+Lt);else{he=ot==="start"?be-dn-ye:ot==="end"?be-on+oe+Ie:ot==="nearest"?ut(dn,on,nt,ye,oe+Ie,be,be+Dt,Dt):be-(dn+nt/2)+Ie/2,pe=at==="start"?xt-Xt-Zt:at==="center"?xt-(Xt+Ot/2)+ce/2:at==="end"?xt-en+le+ce:ut(Xt,en,Ot,Zt,le+ce,xt,xt+Ge,Ge);const{scrollLeft:je,scrollTop:Rt}=qe;he=Pe===0?0:Math.max(0,Math.min(Rt+he/Pe,qe.scrollHeight-nt/Pe+Ie)),pe=yt===0?0:Math.max(0,Math.min(je+pe/yt,qe.scrollWidth-Ot/yt+ce)),be+=Rt-he,xt+=je-pe}Qt.push({el:qe,top:he,left:pe})}return Qt},De=_e=>_e===!1?{block:"end",inline:"nearest"}:(Re=>Re===Object(Re)&&Object.keys(Re).length!==0)(_e)?_e:{block:"start",inline:"nearest"};function we(_e,Re){if(!_e.isConnected||!(Fe=>{let ft=Fe;for(;ft&&ft.parentNode;){if(ft.parentNode===document)return!0;ft=ft.parentNode instanceof ShadowRoot?ft.parentNode.host:ft.parentNode}return!1})(_e))return;const dt=(Fe=>{const ft=window.getComputedStyle(Fe);return{top:parseFloat(ft.scrollMarginTop)||0,right:parseFloat(ft.scrollMarginRight)||0,bottom:parseFloat(ft.scrollMarginBottom)||0,left:parseFloat(ft.scrollMarginLeft)||0}})(_e);if((Fe=>typeof Fe=="object"&&typeof Fe.behavior=="function")(Re))return Re.behavior(Me(_e,Re));const Ae=typeof Re=="boolean"||Re==null?void 0:Re.behavior;for(const{el:Fe,top:ft,left:Ye}of Me(_e,De(Re))){const ot=ft-dt.top+dt.bottom,at=Ye-dt.left+dt.right;Fe.scroll({top:ot,left:at,behavior:Ae})}}}}]);
}());