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__Three__index.df74bcb4.as...

3456 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 Il=Math.pow;var gc=(Sn,Wt,se)=>new Promise((he,He)=>{var Re=_e=>{try{ve(se.next(_e))}catch(ke){He(ke)}},Ve=_e=>{try{ve(se.throw(_e))}catch(ke){He(ke)}},ve=_e=>_e.done?he(_e.value):Promise.resolve(_e.value).then(Re,Ve);ve((se=se.apply(Sn,Wt)).next())});(self.webpackChunk=self.webpackChunk||[]).push([[8999],{18299:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return ke}});var he=se(87462),He=se(67294),Re={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"},Ve=Re,ve=se(84089),_e=function(me,Ee){return He.createElement(ve.Z,(0,he.Z)({},me,{ref:Ee,icon:Ve}))},ke=He.forwardRef(_e)},84249:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return ke}});var he=se(87462),He=se(67294),Re={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},Ve=Re,ve=se(84089),_e=function(me,Ee){return He.createElement(ve.Z,(0,he.Z)({},me,{ref:Ee,icon:Ve}))},ke=He.forwardRef(_e)},42922:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return ke}});var he=se(87462),He=se(67294),Re={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"},Ve=Re,ve=se(84089),_e=function(me,Ee){return He.createElement(ve.Z,(0,he.Z)({},me,{ref:Ee,icon:Ve}))},ke=He.forwardRef(_e)},90674:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return ke}});var he=se(87462),He=se(67294),Re={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},Ve=Re,ve=se(84089),_e=function(me,Ee){return He.createElement(ve.Z,(0,he.Z)({},me,{ref:Ee,icon:Ve}))},ke=He.forwardRef(_e)},25877:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return ke}});var he=se(87462),He=se(67294),Re={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"},Ve=Re,ve=se(84089),_e=function(me,Ee){return He.createElement(ve.Z,(0,he.Z)({},me,{ref:Ee,icon:Ve}))},ke=He.forwardRef(_e)},55304:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return ke}});var he=se(87462),He=se(67294),Re={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:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},Ve=Re,ve=se(84089),_e=function(me,Ee){return He.createElement(ve.Z,(0,he.Z)({},me,{ref:Ee,icon:Ve}))},ke=He.forwardRef(_e)},63237:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return ke}});var he=se(87462),He=se(67294),Re={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"},Ve=Re,ve=se(84089),_e=function(me,Ee){return He.createElement(ve.Z,(0,he.Z)({},me,{ref:Ee,icon:Ve}))},ke=He.forwardRef(_e)},99569:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return ke}});var he=se(87462),He=se(67294),Re={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"},Ve=Re,ve=se(84089),_e=function(me,Ee){return He.createElement(ve.Z,(0,he.Z)({},me,{ref:Ee,icon:Ve}))},ke=He.forwardRef(_e)},22751:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return ke}});var he=se(87462),He=se(67294),Re={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"},Ve=Re,ve=se(84089),_e=function(me,Ee){return He.createElement(ve.Z,(0,he.Z)({},me,{ref:Ee,icon:Ve}))},ke=He.forwardRef(_e)},38308:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return ke}});var he=se(87462),He=se(67294),Re={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"},Ve=Re,ve=se(84089),_e=function(me,Ee){return He.createElement(ve.Z,(0,he.Z)({},me,{ref:Ee,icon:Ve}))},ke=He.forwardRef(_e)},74664:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return ke}});var he=se(87462),He=se(67294),Re={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 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-8H544V328c0-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 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},Ve=Re,ve=se(84089),_e=function(me,Ee){return He.createElement(ve.Z,(0,he.Z)({},me,{ref:Ee,icon:Ve}))},ke=He.forwardRef(_e)},17663:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return ke}});var he=se(87462),He=se(67294),Re={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"},Ve=Re,ve=se(84089),_e=function(me,Ee){return He.createElement(ve.Z,(0,he.Z)({},me,{ref:Ee,icon:Ve}))},ke=He.forwardRef(_e)},91034:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return ke}});var he=se(87462),He=se(67294),Re={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"},Ve=Re,ve=se(84089),_e=function(me,Ee){return He.createElement(ve.Z,(0,he.Z)({},me,{ref:Ee,icon:Ve}))},ke=He.forwardRef(_e)},72395:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return ke}});var he=se(87462),He=se(67294),Re={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"},Ve=Re,ve=se(84089),_e=function(me,Ee){return He.createElement(ve.Z,(0,he.Z)({},me,{ref:Ee,icon:Ve}))},ke=He.forwardRef(_e)},53978:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return ke}});var he=se(87462),He=se(67294),Re={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"},Ve=Re,ve=se(84089),_e=function(me,Ee){return He.createElement(ve.Z,(0,he.Z)({},me,{ref:Ee,icon:Ve}))},ke=He.forwardRef(_e)},71749:function(){"use strict"},30483:function(){"use strict"},71736:function(Sn,Wt){"use strict";Wt.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},61016: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 Sn={},Wt="5.0",se={},he=null,He=!1,Re=!1,Ve=null,ve=!1,_e=null,ke=null,Se=0;Se<arguments.length;Se++){var me=arguments[Se];if(me!==null)switch(typeof me){case"number":Wt=me.toFixed(1);break;case"string":me.match(new RegExp("^[0-9]\\.[0-9]+$"))?Wt=me:Ve=me;break;case"object":typeof me.is3D!="undefined"?he=me:se=me;break;case"boolean":He=me,Re=!0;break}}he===null&&(he={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},se.material_id!==void 0&&!Re&&(He=!0)),Ve!==null&&se.id===void 0&&(se.id=Ve);var Ee="",tt="",Be=!1,St=null,dt=null,it=null,Ge=!1,De=null,At=null,Xt=null,rt=null,ft=null;se.height!==void 0&&(se.height=Math.round(se.height)),se.width!==void 0&&(se.width=Math.round(se.width));var Ie=function(ot){return parseFloat(ot)>4?parseFloat(ot):5};Sn.setHTML5Codebase=function(ot,nt){ke=ot,Ht(ot,nt)},Sn.setJavaCodebase=Sn.setJavaCodebaseVersion=Sn.isCompiledInstalled=Sn.setPreCompiledScriptPath=Sn.setPreCompiledResourcePath=function(){},Sn.setHTML5CodebaseVersion=function(ot,nt){var Tt=parseFloat(ot);if(Tt!==NaN&&Tt<5){console.log("The GeoGebra HTML5 codebase version "+Tt+" is deprecated. Using version latest instead.");return}_e=ot,Ae(ot,nt)},Sn.getHTML5CodebaseVersion=function(){return dt},Sn.getParameters=function(){return se},Sn.setFontsCSSURL=function(ot){rt=ot},Sn.setGiacJSURL=function(ot){},Sn.setJNLPFile=function(ot){Ee=ot},Sn.setJNLPBaseDir=function(ot){},Sn.inject=function(){function ot(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var nt="auto",Tt=se.id,rn,dn=!1,Ut=0;Ut<arguments.length;Ut++){var Kt=arguments[Ut];typeof Kt=="string"?(Kt=Kt.toLowerCase(),Kt.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?nt=Kt:Tt=arguments[Ut]):typeof Kt=="boolean"?dn=Kt:Kt instanceof HTMLElement&&(rn=Kt)}bn();function bn(){if(!ve){setTimeout(bn,200);return}nt=wr(nt);var nn=rn||document.getElementById(Tt);if(!nn){console.log("possibly bug on ajax loading? ");return}if(Sn.removeExistingApplet(nn,!1),se.width===void 0&&nn.clientWidth&&(se.width=nn.clientWidth),se.height===void 0&&nn.clientHeight&&(se.height=nn.clientHeight),!(se.width&&se.height)&&nt==="html5"&&(delete se.width,delete se.height),St=nt,nt==="screenshot")Pt(nn,se);else{var we=!1;se.hasOwnProperty("playButton")&&se.playButton||se.hasOwnProperty("clickToLoad")&&se.clickToLoad?we=!0:se.hasOwnProperty("playButtonAutoDecide")&&se.playButtonAutoDecide&&(we=(!xe()||ot())&&Ue()),we?(St="screenshot",tn(nn,se,dn,nt)):Rt(nn,se,dn)}}};function xe(){try{return window.self!==window.top}catch(ot){return!0}}function Ue(){return se.hasOwnProperty("screenshotGenerator")&&se.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}Sn.getViews=function(){return he},Sn.isJavaInstalled=function(){return!1};var je=function(ot){var nt=function(Ut){var Kt=JSON.parse(Ut),bn=function(ue){return ue.type=="G"||ue.type=="E"},nn=Kt.elements?Kt.elements.filter(bn)[0]:Kt;if(!nn||!nn.url){Tt();return}se.fileName=nn.url,_t(nn.settings||{}),he.is3D=!0;var we="https://www.geogebra.org/images/";Sn.setPreviewImage(De||nn.previewUrl,we+"GeoGebra_loading.png",we+"applet_play.png"),ot()},Tt=function(){se.onError&&se.onError(),Rn("Error: Fetching material (id "+se.material_id+") failed.",se)},rn=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",dn="/materials/"+se.material_id+"?scope=basic";Ct("https://"+rn+"/api/proxy.php?path="+encodeURIComponent(dn),nt,Tt)};function _t(ot){var nt=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(Tt){ot[Tt]=!!ot[Tt]}),nt.forEach(function(Tt){se[Tt]===void 0&&ot[Tt]!==void 0&&(se[Tt]=ot[Tt])}),se.showToolBarHelp===void 0&&(se.showToolBarHelp=se.showToolBar)}function Ct(ot,nt,Tt){var rn=new XMLHttpRequest;rn.open("GET",ot),rn.onload=function(){nt(rn.responseText)},rn.onerror=Tt,rn.send()}Sn.isHTML5Installed=function(){return!0},Sn.getLoadedAppletType=function(){return St},Sn.setPreviewImage=function(ot,nt,Tt){De=ot,At=nt,Xt=Tt},Sn.removeExistingApplet=function(ot,nt){var Tt;typeof ot=="string"&&(ot=document.getElementById(ot)),St=null;var rn=null;for(Tt=0;Tt<ot.childNodes.length;Tt++){var dn=ot.childNodes[Tt],Ut=dn.className;Ut==="applet_screenshot"?nt?(dn.style.display="block",St="screenshot"):dn.style.display="none":Ut!=="applet_scaler prerender"&&(ot.removeChild(dn),rn=Ut&&Ut.indexOf("appletParameters")!=-1?dn.id:null,Tt--)}var Kt=se.id!==void 0?se.id:rn,bn=window[Kt];bn&&typeof bn.getBase64=="function"&&(bn.remove(),window[Kt]=null)},Sn.refreshHitPoints=function(){if(Ie(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var ot=Sn.getAppletObject();return ot&&typeof ot.recalculateEnvironments=="function"?(ot.recalculateEnvironments(),!0):!1},Sn.startAnimation=function(){var ot=Sn.getAppletObject();return ot&&typeof ot.startAnimation=="function"?(ot.startAnimation(),!0):!1},Sn.stopAnimation=function(){var ot=Sn.getAppletObject();return ot&&typeof ot.stopAnimation=="function"?(ot.stopAnimation(),!0):!1},Sn.getAppletObject=function(){var ot=se.id!==void 0?se.id:"ggbApplet";return window[ot]},Sn.resize=function(){};var Dt=function(ot,nt,Tt){var rn=document.createElement("param");rn.setAttribute("name",nt),rn.setAttribute("value",Tt),ot.appendChild(rn)},qe=function(ot){return ot&&ot!=="false"},Rt=function(ot,nt,Tt){Ie(dt)<=4.2&&(Tt=!0);var rn=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==dt||ggbHTML5LoadedCodebaseIsWebSimple&&!Ge)&&(rn=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var dn=document.createElement("div");dn.classList.add("appletParameters","notranslate");var Ut=nt.width,Kt=nt.height;if(nt.disableAutoScale=nt.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():nt.disableAutoScale,nt.width!==void 0)if(Ie(dt)<=4.4)qe(nt.showToolBar)&&(nt.height-=7),qe(nt.showAlgebraInput)&&(nt.height-=37),nt.width<605&&qe(nt.showToolBar)&&(nt.width=605,Ut=605);else{var bn=100;(qe(nt.showToolBar)||qe(nt.showMenuBar))&&(nt.hasOwnProperty("customToolBar")&&(nt.customToolbar=nt.customToolBar),bn=qe(nt.showMenuBar)?245:155),Ut<bn&&(nt.width=bn,Ut=bn)}dn.style.border="none",dn.style.display="inline-block";for(var nn in nt)nt.hasOwnProperty(nn)&&nn!=="appletOnLoad"&&dn.setAttribute("data-param-"+nn,nt[nn]);rt&&dn.setAttribute("data-param-fontscssurl",rt),Sn.resize=function(){GGBAppletUtils.responsiveResize(ot,nt)},window.addEventListener("resize",function(jt){Sn.resize()});var we=typeof nt.appletOnLoad=="function"?nt.appletOnLoad:function(){};if(!Tt&&nt.width!==void 0){nt.hasOwnProperty("showSplash")||dn.setAttribute("data-param-showSplash","false");var ue=ot.querySelector(".applet_scaler.prerender"),oe=ue!==null;if(oe)var pe=ue.querySelector(".ggb_preview");else{var pe=ur(Ut,Kt,nt.borderColor,!1);ue=document.createElement("div"),ue.className="applet_scaler",ue.style.position="relative",ue.style.display="block",ue.style.width=Ut+"px",ue.style.height=Kt+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(ue,"66%"),Ie(dt)>=5?(nt.appletOnLoad=function(jt){var ir=ot.querySelector(".ggb_preview");ir&&ir.parentNode.removeChild(ir),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(ue),window.GGBT_wsf_view&&$(window).trigger("resize"),we(jt)},oe||ue.appendChild(pe)):dn.appendChild(pe),ue.appendChild(dn),oe||ot.appendChild(ue),setTimeout(function(){Sn.resize()},1)}else{var fe=document.createElement("div");fe.className="applet_scaler",fe.style.position="relative",fe.style.display="block",fe.appendChild(dn),ot.appendChild(fe),nt.appletOnLoad=function(jt){Sn.resize(),we(jt)}}function le(jt,ir){ir&&typeof ir.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(jt,ir.appletOnLoad):renderGGBElement(jt),Rn("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",ir)}function Pe(jt,ir){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:jt,params:ir}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(Cr){le(Cr.article,Cr.params)}),html5AppletsToProcess=null)},Ie(dt)<5&&(jt.className+=" geogebraweb")):le(jt,ir)}if(rn){scriptLoadStarted=!0;for(var Qe=0;Qe<dn.childNodes.length;Qe++){var It=dn.childNodes[Qe].tagName;It==="TABLE"&&(dn.removeChild(dn.childNodes[Qe]),Qe--)}if(ggbHTML5LoadedScript!==null){var Nt=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');Nt!=null&&Nt.parentNode.removeChild(Nt)}var qt=document.createElement("script"),an=function(){Pe(dn,nt)};qt.src=tt+it,ggbHTML5LoadedCodebaseIsWebSimple=Ge,ggbHTML5LoadedCodebaseVersion=dt,ggbHTML5LoadedScript=qt.src,Rn("GeoGebra HTML5 codebase loaded: '"+tt+"'.",nt),!ke&&(!_e||_e=="5.0")?(Ge?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),an()):tt.requirejs?__webpack_require__.e(12).then(function(){var jt=[__webpack_require__(12)];an.apply(null,jt)}.bind(this)).catch(__webpack_require__.oe):(qt.onload=an,ot.appendChild(qt))}else Pe(dn,nt);nt.height=Kt,nt.width=Ut},Pt=function(ot,nt,Tt){var rn=ur(nt.width,nt.height,nt.borderColor,Tt),dn=document.createElement("div");dn.style.position="relative",dn.style.display="block",dn.style.width=nt.width+"px",dn.style.height=nt.height+"px",dn.className="applet_screenshot applet_scaler"+(Tt?" applet_screenshot_play":""),dn.appendChild(rn);var Ut=GGBAppletUtils.getScale(nt,ot,Tt);Tt?(ot.appendChild($n()),window.GGBT_wsf_view||(ot.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(dn,"66%"),ot.appendChild(dn),Ut!==1&&!isNaN(Ut)&&(GGBAppletUtils.scaleElement(dn,Ut),dn.style.width=nt.width+"px",dn.style.height=nt.height+"px",dn.parentNode.style.width=nt.width*Ut+"px",dn.parentNode.style.height=nt.height*Ut+"px"),Sn.resize=function(){En(ot,rn,dn,Tt)},window.addEventListener("resize",function(Kt){Sn.resize()}),Sn.resize()};function En(ot,nt,Tt,rn){if(ot.contains(nt)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(ot.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(ot)}var dn=GGBAppletUtils.getScale(se,ot,rn);Tt.parentNode!==null&&(!isNaN(dn)&&dn!==1?(GGBAppletUtils.scaleElement(Tt,dn),Tt.parentNode.style.width=se.width*dn+"px",Tt.parentNode.style.height=se.height*dn+"px"):(GGBAppletUtils.scaleElement(Tt,1),Tt.parentNode.style.width=se.width+"px",Tt.parentNode.style.height=se.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(ot),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}Sn.onExitFullscreen=function(ot,nt){nt.appendChild(ot)};var tn=function(ot,nt,Tt,rn){Pt(ot,nt,!0);for(var dn=function(){var bn=[];for(Kt=0;Kt<ot.childNodes.length;Kt++)bn.push(ot.childNodes[Kt]);if(window.GGBT_wsf_view){var nn=window.GGBT_wsf_view.renderFullScreen(ot,nt.id),we=document.getElementById("fullscreencontainer"),ue=jQuery(ot).find(".fullscreencontent");ue.length>0?(nn.remove(),ue.attr("id","fullscreencontent").show(),jQuery(we).append(ue),window.dispatchEvent(new Event("resize"))):Rt(nn,nt,!1),window.GGBT_wsf_view.launchFullScreen(we)}else St=rn,Rt(ot,nt,!1);if(!window.GGBT_wsf_view)for(Kt=0;Kt<bn.length;Kt++)ot.removeChild(bn[Kt])},Ut=ot.getElementsByClassName("ggb_preview_play"),Kt=0;Kt<Ut.length;Kt++)Ut[Kt].addEventListener("click",dn,!1),Ut[Kt].addEventListener("ontouchstart",dn,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(ot),Ue()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},$n=function(){var ot=document.createElement("div");if(ot.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");}',Tt=document.createElement("style");Tt.styleSheet?Tt.styleSheet.cssText=nt:Tt.appendChild(document.createTextNode(nt)),document.getElementsByTagName("head")[0].appendChild(Tt)}return ot},ur=function(ot,nt,Tt,rn){var dn=document.createElement("div");dn.className="ggb_preview",dn.style.position="absolute",dn.style.zIndex="90",dn.style.width=ot-2+"px",dn.style.height=nt-2+"px",dn.style.top="0px",dn.style.left="0px",dn.style.overflow="hidden",dn.style.backgroundColor="white";var Ut="lightgrey";Tt!==void 0&&(Tt==="none"?Ut="transparent":Ut=Tt),dn.style.border="1px solid "+Ut;var Kt=document.createElement("img");if(Kt.style.position="relative",Kt.style.zIndex="1000",Kt.style.top="-1px",Kt.style.left="-1px",De!==null&&Kt.setAttribute("src",De),Kt.style.opacity=.7,At!==null){var bn,nn,we;if(!rn){bn=document.createElement("img"),bn.style.position="absolute",bn.style.zIndex="1001",bn.style.opacity=1,Kt.style.opacity=.3,nn=360,nn>ot/4*3&&(nn=ot/4*3),we=nn/5.8,bn.setAttribute("src",At),bn.setAttribute("width",nn),bn.setAttribute("height",we);var ue=(ot-nn)/2,oe=(nt-we)/2;bn.style.left=ue+"px",bn.style.top=oe+"px",dn.appendChild(bn)}}return dn.appendChild(Kt),dn},wr=function(ot){return ot=ot.toLowerCase(),ot==="html5"||ot==="screenshot"?ot:"html5"},Je=["web","webSimple","web3d","tablet","tablet3d","phone"],Ae=function(ot,nt){if(dt=ot,nt){Ht(dt,!0);return}var Tt=!He;if(Tt){var rn=Ie(dt);!isNaN(rn)&&rn<4.4&&(Tt=!1)}var dn,Ut;window.location.protocol.substr(0,4)==="http"?dn=window.location.protocol:dn="http:";var Kt=dt.indexOf("//");Kt>0?Ut=dt:Kt===0?Ut=dn+dt:Ut="https://www.geogebra.org/apps/5.2.814.0/";for(var bn in Je)if(dt.slice(Je[bn].length*-1)===Je[bn]||dt.slice((Je[bn].length+1)*-1)===Je[bn]+"/"){Ht(Ut,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&Tt&&!he.is3D&&!he.AV&&!he.SV&&!he.CV&&!he.EV2&&!he.CP&&!he.PC&&!he.DA&&!he.FI&&!he.PV&&!qe(se.showToolBar)&&!qe(se.showMenuBar)&&!qe(se.showAlgebraInput)&&!qe(se.enableRightClick)&&(!se.appName||se.appName=="classic")?Ut+="webSimple/":Ut+="web3d/",Ht(Ut,!1)},Ht=function(ot,nt){if(ot.requirejs){tt=ot;return}ot.slice(-1)!=="/"&&(ot+="/"),tt=ot,nt===null&&(nt=ot.indexOf("http")===-1),Be=nt,it="web.nocache.js",Ge=!1;var Tt=tt.split("/");Tt.length>1&&(!nt&&Tt[Tt.length-2]==="webSimple"?(it="webSimple.nocache.js",Ge=!0):Je.indexOf(Tt[Tt.length-2])>=0&&(it=Tt[Tt.length-2]+".nocache.js")),Tt=ot.split("/"),dt=Tt[Tt.length-3],dt.substr(0,4)==="test"?dt=dt.substr(4,1)+"."+dt.substr(5,1):(dt.substr(0,3)==="war"||dt.substr(0,4)==="beta")&&(dt="5.0");var rn=parseFloat(dt);rn!==NaN&&rn<5&&ot.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+rn+" is deprecated. Using version latest instead."),Ae("5.0",nt))},Rn=function(ot,nt){window.console&&window.console.log&&(!nt||typeof nt.showLogging=="undefined"||nt.showLogging&&nt.showLogging!=="false")&&console.log(ot)};se.material_id!==void 0?je(yn):yn();function yn(){var ot=Wt;_e!==null?ot=_e:parseFloat(ot)<5&&(ot="5.0"),Ae(ot,!1),ke!==null&&Ht(ke,Be),ve=!0}return Sn},GGBAppletUtils=function(){"use strict";function Sn(){return window.GGBT_wsf_edit!==void 0}function Wt(ve,_e){_e!=1?(ve.style.transformOrigin="0% 0% 0px",ve.style.webkitTransformOrigin="0% 0% 0px",ve.style.transform="scale("+_e+","+_e+")",ve.style.webkitTransform="scale("+_e+","+_e+")",ve.style.maxWidth="initial",ve.querySelector(".ggb_preview")!==null&&(ve.querySelector(".ggb_preview").style.maxWidth="initial"),ve.querySelectorAll(".ggb_preview img")[0]!==void 0&&(ve.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),ve.querySelectorAll(".ggb_preview img")[1]!==void 0&&(ve.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(ve.style.transform="none",ve.style.webkitTransform="none")}function se(ve,_e,ke,Se,me,Ee){var tt=null;if(Ee!=null&&Ee!="")for(var Be=ve.parentNode;Be!=null;)if((" "+Be.className+" ").indexOf(" "+Ee+" ")>-1){tt=Be;break}else Be=Be.parentNode;var St=0,dt=0,it=0,Ge=0,De=0,At=0,Xt=0;if(tt)St=tt.offsetWidth,dt=Math.max(Se?tt.offsetWidth:0,tt.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(St=Math.min(window.innerWidth,document.documentElement.clientWidth),dt=Math.min(window.innerHeight,document.documentElement.clientHeight),it=St):(St=window.innerWidth,dt=window.innerHeight,it=window.innerWidth),ve){var rt=ve.getBoundingClientRect();rt.left>0&&rt.left<=St&&(me===void 0||!me)&&(document.dir==="rtl"?(De=St-rt.width-rt.left,At=it<=480?10:30):(At=rt.left,De=it<=480?10:30),Ge=At+De)}if(ve&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var ft=ve.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(Ge=40,Xt=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(Ge=0,Xt=40)}}return ve&&((ke===void 0||!ke)&&_e>0&&_e+Ge<St?St=_e:St-=Ge,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(ke===void 0||!ke)&&(dt-=Xt)),{width:St,height:dt}}function he(ve,_e,ke,Se,me){if(ve.isScreenshoGenerator)return 1;var Ee=Se!==void 0&&Se,tt=ve.noScaleMargin!=null&&ve.noScaleMargin,Be=function(ft){return ft&&ft!=="false"},St=Be(ve.autoHeight),dt=se(_e,ve.width,ke,St,Ee&&window.GGBT_wsf_view||tt,me),it=parseInt(dt.width),Ge=ve.width,De=ve.height;if(Ge===void 0){var At=_e.querySelector(".appletParameters");At&&(Ge=At.offsetWidth,De=At.offsetHeight)}var Xt=it/Ge,rt=Ee?1:dt.height/De;return ke!==void 0&&!ke&&(Xt=Math.min(1,Xt),rt=Math.min(1,rt)),Math.min(Xt,rt)}function He(ve,_e,ke){var Se=1,me,Ee=!1;if(ve.hasOwnProperty("allowUpscale")&&(Ee=ve.allowUpscale),ve.hasOwnProperty("scale")&&(Se=parseFloat(ve.scale),(isNaN(Se)||Se===null||Se===0)&&(Se=1),Se>1&&(Ee=!0)),_e&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Ee=!0),!(ve.hasOwnProperty("disableAutoScale")&&ve.disableAutoScale))me=he(ve,_e,Ee,ke,ve.scaleContainerClass);else return Se;return Ee&&(!ve.hasOwnProperty("scale")||Se===1)?me:Math.min(Se,me)}function Re(ve){var _e=Math.min(window.innerWidth,document.documentElement.clientWidth),ke=Math.min(window.innerHeight,document.documentElement.clientHeight),Se=ve.getBoundingClientRect(),me=(_e-Se.width)/2,Ee=(ke-Se.height)/2;Ee<0&&(Ee=0),ve.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(me<40?ve.style.left="40px":ve.style.left=me+"px",ve.style.top=Ee+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(Ee<40?ve.style.top="40px":ve.style.top=Ee+"px",ve.style.left=me+"px")}function Ve(ve,_e){var ke=ve.querySelector(".appletParameters");if(ke){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(_e.id!==ke.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(ve)}if(ke.parentElement&&/fullscreen/.test(ke.parentElement.className))return;var Se=He(_e,ve);Sn()&&ke.setAttribute("data-param-scale",Se);for(var me=null,Ee=0;Ee<ve.childNodes.length;Ee++)if(ve.childNodes[Ee].className!==void 0&&ve.childNodes[Ee].className.match(/^applet_scaler/)){me=ve.childNodes[Ee];break}if(me!==null&&me.querySelector(".noscale")!==null)return;var tt=_e.id!==void 0?_e.id:"ggbApplet",Be=window[tt];(Be==null||!Be.recalculateEnvironments)&&me!==null&&!me.className.match(/fullscreen/)&&(me.parentNode.style.transform="",!isNaN(Se)&&Se!==1?(me.parentNode.style.width=_e.width*Se+"px",me.parentNode.style.height=_e.height*Se+"px",Wt(me,Se)):(Wt(me,1),me.parentNode.style.width=_e.width+"px",me.parentNode.style.height=_e.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&Re(ve),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(ke).parents(".content-added-content"))}}return{responsiveResize:Ve,isFlexibleWorksheetEditor:Sn,positionCenter:Re,getScale:He,scaleElement:Wt}}();__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 Sn=n.location.search;return Sn.indexOf(J)!=-1||Sn.indexOf(K)!=-1}function q(Sn,Wt){}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(Sn){var Wt=s[L].bindings;s[L].bindings=function(){for(var se=Wt?Wt():{},he=Sn[webModule.__softPermutationId],He=O;He<he.length;He++){var Re=he[He];se[Re[O]]=Re[P]}return se}};var t;function u(){return v(),t}function v(){if(!t){var Sn=o.createElement(Q);if(Sn.id=L,Sn.style.cssText=R+S,Sn.tabIndex=-1,o.body.appendChild(Sn),t=Sn.contentWindow.document,navigator.userAgent.indexOf(T)==-1){t.open();var Wt=document.compatMode==U?V:W;t.write(Wt+X),t.close()}}}function w(Sn){function Wt(he){function He(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var Re=He();if(Re){he();return}function Ve(){if(!Re){if(!He())return;Re=!0,he(),o.removeEventListener&&o.removeEventListener(Z,Ve,!1),ve&&clearInterval(ve)}}o.addEventListener&&o.addEventListener(Z,Ve,!1);var ve=setInterval(function(){Ve()},$)}function se(he){var He=u(),Re=He.body,Ve=He.createElement(_);Ve.language=ab,Ve.crossOrigin=W,Ve.src=he,webModule.__errFn&&(Ve.onerror=function(){webModule.__errFn(L,new Error(bb+he))}),Re.appendChild(Ve)}Wt(function(){se(Sn)})}webModule.__startLoadingFragment=function(Sn){return C(Sn)},webModule.__installRunAsyncCode=function(Sn){var Wt=u(),se=Wt.body,he=Wt.createElement(_);he.language=ab,he.text=Sn,se.appendChild(he),se.removeChild(he)};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(Sn){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(Sn){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(Sn){var Wt=c[Sn];return Wt==null?null:Wt},r=d,webModule.__errFn=e}function B(){function Sn(ve){var _e=ve.lastIndexOf(rb);_e==-1&&(_e=ve.length);var ke=ve.indexOf(sb);ke==-1&&(ke=ve.length);var Se=ve.lastIndexOf(tb,Math.min(ke,_e));return Se>=O?ve.substring(O,Se+P):W}function Wt(ve){if(!ve.match(/^\w+:\/\//)){var _e=o.createElement(ub);_e.src=ve+vb,ve=Sn(_e.src)}return ve}function se(){var ve=__gwt_getMetaProperty(wb);return ve!=null?ve:W}function he(){for(var ve=o.getElementsByTagName(_),_e=O;_e<ve.length;++_e)if(ve[_e].src.indexOf(xb)!=-1)return Sn(ve[_e].src);return W}function He(){var ve=o.getElementsByTagName(yb);return ve.length>O?ve[ve.length-P].href:W}function Re(){var ve=o.location;return ve.href==ve.protocol+zb+ve.host+ve.pathname+ve.search+ve.hash}var Ve=se();return Ve==W&&(Ve=he()),Ve==W&&(Ve=He()),Ve==W&&Re()&&(Ve=Sn(o.location.href)),Ve=Wt(Ve),Ve}function C(Sn){return Sn.match(/^\//)||Sn.match(/^[a-zA-Z]+:\/\//)?Sn:webModule.__moduleBase+Sn}function D(){var Sn=[],Wt=O,se=[],he=[];function He(ve){var _e=he[ve](),ke=se[ve];if(_e in ke)return _e;var Se=[];for(var me in ke)Se[ke[me]]=me;throw r&&r(ve,Se,_e),null}if(__gwt_isKnownPropertyValue=function(ve,_e){return _e in se[ve]},webModule.__getPropMap=function(){var ve={};for(var _e in se)se.hasOwnProperty(_e)&&(ve[_e]=He(_e));return ve},webModule.__computePropValue=He,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var Re;try{Re=Cb;var Ve=Re.indexOf(Db);Ve!=-1&&(Wt=parseInt(Re.substring(Ve+P),$),Re=Re.substring(O,Ve))}catch(ve){}return webModule.__softPermutationId=Wt,C(Re+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})()},15476:function(Sn,Wt,se){"use strict";se.d(Wt,{Ax:function(){return Ve},Ds:function(){return ve},KI:function(){return ke},SI:function(){return Re},f1:function(){return He}});var he=se(11320);function He(Se){let me=!0;if(Se.length>0){for(let Ee=0;Ee<Se.length;Ee++)if(Se[Ee].compile_success==0||!Se[Ee].compile_success){me=!1;break}}else me=!1;return me}function Re(Se,me=""){let Ee=[];for(let tt=0;tt<Se.length;tt++){let Be=Se[tt],St=me?`${me}/${Be.name}`:`${Be.name}`;Ee.push({title:Be.name,type:Be.type,isLeaf:Be.type!=="tree",key:St})}return Ee}function Ve(Se,me,Ee){for(let tt=0;tt<Se.length;tt++){let Be=Se[tt];if(Be.key===me){Be.children=Ee;break}Be.children&&Ve(Be.children,me,Ee)}return Se}function ve(Se,me,Ee){let tt;return function(){let Be=this,St=arguments,dt=function(){tt=null,Ee||Se.apply(Be,St)},it=Ee&&!tt;clearTimeout(tt),tt=setTimeout(dt,me),it&&Se.apply(Be,St)}}const _e=!0,ke=he.Z.API_SERVER},63205:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return tt}});var he=se(67294),He={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},Re=se(94184),Ve=se.n(Re),ve=se(57953),_e=se(15979),ke=se(33170),Se=se(28706),me=(Be,St,dt)=>new Promise((it,Ge)=>{var De=rt=>{try{Xt(dt.next(rt))}catch(ft){Ge(ft)}},At=rt=>{try{Xt(dt.throw(rt))}catch(ft){Ge(ft)}},Xt=rt=>rt.done?it(rt.value):Promise.resolve(rt.value).then(De,At);Xt((dt=dt.apply(Be,St)).next())}),tt=({data:Be,className:St,fullWidth:dt,style:it={},onClose:Ge,onOk:De,showFullTools:At,noAssociationId:Xt})=>{const rt=(0,he.useRef)(null),ft=(0,he.useRef)(null),Ie=(0,he.useRef)(null),xe=(0,he.useRef)(null),[Ue,je]=(0,he.useState)(!1),[_t,Ct]=(0,he.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,he.useEffect)(()=>{Ie.current||(Ie.current=document.createElement("style"),document.head.appendChild(Ie.current)),Be!=null&&Be.visible?(document.body.setAttribute("data-custom","y-hidden"),Ie.current.innerHTML=" html { overflow-y: hidden; }",Be!=null&&Be.src&&Dt()):(document.body.removeAttribute("data-custom"),Ie.current&&(document.head.removeChild(Ie.current),Ie.current=null))},[Be==null?void 0:Be.visible]);const Dt=()=>me(void 0,null,function*(){je(!0),Ct("\u6B63\u5728\u52A0\u8F7D\u4E2D");const tn=yield(0,Se.ZJ)(Be==null?void 0:Be.src);rt.current.src="",rt.current.src=tn,rt.current.onload=function(){En()},je(!1),Ct("")}),qe=()=>{document.body.removeAttribute("data-custom"),Ie.current.innerHTML=" ",Ge()},Rt=tn=>me(void 0,null,function*(){je(!0),Ct("\u6B63\u5728\u4FDD\u5B58\u4E2D");const $n=yield(0,ke.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Be.title,file:tn.dataUrl}});$n!=null&&$n.id&&!Xt?(yield(0,ke.ZP)(`/api/attachments/${Be.id}/add_subitem.json`,{method:"post",body:{subitem_id:$n==null?void 0:$n.id,settings:JSON.stringify(tn.state)}})).status===0&&De():$n!=null&&$n.id&&De($n),document.body.removeAttribute("data-custom"),Ie.current.innerHTML=" ",je(!1),Ct("")}),Pt=()=>{const tn=document.querySelector('a[href="https://markerjs.com/"]');tn&&tn.parentNode&&(tn.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(ur=>{const wr=document.querySelector(ur.name);wr&&wr.setAttribute("title",ur.title)})},En=()=>{ft.current=new _e.hP(rt.current),ft.current.targetRoot=xe.current,ft.current.addEventListener("render",Rt),ft.current.addEventListener("beforeclose",qe),At&&(ft.current.availableMarkerTypes=ft.current.ALL_MARKER_TYPES,ft.current.uiStyleSettings.redoButtonVisible=!0,ft.current.uiStyleSettings.notesButtonVisible=!0,ft.current.uiStyleSettings.zoomButtonVisible=!0,ft.current.uiStyleSettings.zoomOutButtonVisible=!0,ft.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=ft.current.uiStyleSettings,ft.current.show(),Be!=null&&Be.snapshotData&&ft.current.restoreState(Be.snapshotData),setTimeout(()=>{window.scrollTo(0,0),Pt()},300)};return he.createElement(he.Fragment,null,(Be==null?void 0:Be.visible)&&he.createElement(ve.Z,{spinning:Ue,tip:_t,style:{position:"absolute"}},he.createElement("div",{ref:xe,className:Ve()(He.imageDimensions,St,dt?He.fullWidth:""),style:it},he.createElement("img",{className:He.img,ref:rt}))))}},36527:function(Sn,Wt,se){"use strict";var he=se(67294),He=se(71230),Re=se(15746),Ve=se(66368),ve=se(71577),_e=se(35598),ke=se(71736),Se=se(84279),me=se(67294);const Ee=(0,he.forwardRef)(({callback:tt,showSaveButton:Be,value:St=""},dt)=>{const it=(0,he.useRef)(),Ge=[{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 "}]}]}],De=[{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}`}]}]}],At=ft=>{it.current.setValue(it.current.getValue()+" "+ft.value+" ")},Xt=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:me.createElement(He.Z,{className:ke.Z.lists,gutter:[10,10]},Ge.map((ft,Ie)=>me.createElement(Re.Z,{flex:"110px",className:ke.Z.item},me.createElement("div",null,me.createElement(_e.Z,{value:`$$${ft.value}$$`}),ft.name),me.createElement("div",{className:ke.Z.children},ft.children.map((xe,Ue)=>me.createElement("div",{key:Ue},me.createElement("h1",null,xe.name),me.createElement(He.Z,{gutter:[10,10]},xe.data.map((je,_t)=>me.createElement(Re.Z,{key:_t,onClick:()=>At(je),className:ke.Z.diamond},me.createElement(_e.Z,{value:"`$$"+je.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:me.createElement(He.Z,{className:ke.Z.lists,gutter:[10,10]},De.map((ft,Ie)=>me.createElement(Re.Z,{flex:"110px",className:ke.Z.item},me.createElement("div",null,me.createElement(_e.Z,{value:"`$$"+ft.value+"$$`"}),ft.name),me.createElement("div",{className:ke.Z.children},ft.children.map((xe,Ue)=>me.createElement("div",{key:Ue},xe.name&&me.createElement("h1",null,xe.name),me.createElement(He.Z,{gutter:[10,10]},xe.data.map((je,_t)=>me.createElement(Re.Z,{key:_t,onClick:()=>At(je),className:ke.Z.diamond},me.createElement(_e.Z,{value:"`$$"+je.value+"$$`"}))))))))))}],rt=()=>{var ft=document.createElement("div");ft.innerHTML=it.current.getValue();var Ie=ft.innerText;return tt&&tt(Ie),Ie};return(0,he.useImperativeHandle)(dt,()=>({getData:rt})),me.createElement("div",{className:ke.Z.mathWrap},me.createElement(Ve.default,{defaultActiveKey:"1",items:Xt}),me.createElement("math-field",{locale:"zh_cn",className:ke.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:it,style:{width:800,marginTop:30,fontSize:18}},St||""),Be&&me.createElement("div",{className:ke.Z.button},me.createElement(ve.ZP,{size:"large",onClick:rt,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});Wt.Z=Ee},57444:function(Sn,Wt,se){"use strict";se.d(Wt,{h:function(){return ft}});var he=se(67294),He=se(11713),Re=se(22150),Ve=se(71577),ve=se(4631),_e=se.n(ve),ke=se(71749),Se=se(30483),me=Object.defineProperty,Ee=Object.defineProperties,tt=Object.getOwnPropertyDescriptors,Be=Object.getOwnPropertySymbols,St=Object.prototype.hasOwnProperty,dt=Object.prototype.propertyIsEnumerable,it=(Ie,xe,Ue)=>xe in Ie?me(Ie,xe,{enumerable:!0,configurable:!0,writable:!0,value:Ue}):Ie[xe]=Ue,Ge=(Ie,xe)=>{for(var Ue in xe||(xe={}))St.call(xe,Ue)&&it(Ie,Ue,xe[Ue]);if(Be)for(var Ue of Be(xe))dt.call(xe,Ue)&&it(Ie,Ue,xe[Ue]);return Ie},De=(Ie,xe)=>Ee(Ie,tt(xe));const At=He.default.Option,Xt={labelCol:{span:4},wrapperCol:{span:20}},rt={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"]};Wt.Z=({callback:Ie,onCancel:xe})=>{const[Ue,je]=(0,he.useState)("python");function _t(Dt){je(rt[Dt][1])}function Ct(Dt){Ie(Dt)}return he.createElement(Re.default,De(Ge({},Xt),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:Ct,style:{width:500}}),he.createElement(Re.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},he.createElement(He.default,{getPopupContainer:Dt=>Dt.parentNode,onChange:_t},Object.keys(rt).map(Dt=>he.createElement(At,{key:Dt,value:Dt},rt[Dt][0])))),he.createElement(Re.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},he.createElement(ft,{mode:Ue})),he.createElement("div",{className:"flex-container flex-end"},he.createElement(Ve.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),he.createElement(Ve.ZP,{type:"ghost",onClick:xe},"\u53D6\u6D88")))};function ft({value:Ie,onChange:xe,mode:Ue,options:je={}}){const _t=(0,he.useRef)(),[Ct,Dt]=(0,he.useState)();return(0,he.useEffect)(()=>{if(Ct){let qe=function(Rt){const Pt=Rt.getValue();xe&&xe(Pt)};return Ct.on("change",qe),()=>{Ct.off("change",qe)}}},[Ct,xe]),(0,he.useEffect)(()=>{Ct&&Ct.setOption("mode",Ue)},[Ct,Ue]),(0,he.useEffect)(()=>{Ct&&(Ie!==Ct.getValue()||Ie==="")&&setTimeout(()=>{Ct.setValue(Ie||"")},300)},[Ct,Ie]),(0,he.useEffect)(()=>{if(_t.current&&!Ct){const qe=_e().fromTextArea(_t.current,Ge({mode:Ue,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},je));Dt(qe)}},[_t.current,Ct]),he.createElement("div",{className:"my-codemirror-container"},he.createElement("textarea",{ref:_t}))}},91304:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return gr}});var he=se(67294),He=se(4631),Re=se.n(He),Ve=se(91033),ve=se(71749),_e=se(57341),ke=se(82801),Se=se(88386),me=se(49047),Ee=se(80785),tt=se(35598),Be=({value:Fn="",className:Xe,showTextOnly:ut,showLines:Lt,style:Jt={}})=>{const We=(0,he.useMemo)(()=>"",[Fn]);return he.createElement(he.Fragment,null,he.createElement("div",{dangerouslySetInnerHTML:{__html:We}}))},St=se(67294),dt=Object.defineProperty,it=Object.defineProperties,Ge=Object.getOwnPropertyDescriptors,De=Object.getOwnPropertySymbols,At=Object.prototype.hasOwnProperty,Xt=Object.prototype.propertyIsEnumerable,rt=(Fn,Xe,ut)=>Xe in Fn?dt(Fn,Xe,{enumerable:!0,configurable:!0,writable:!0,value:ut}):Fn[Xe]=ut,ft=(Fn,Xe)=>{for(var ut in Xe||(Xe={}))At.call(Xe,ut)&&rt(Fn,ut,Xe[ut]);if(De)for(var ut of De(Xe))Xt.call(Xe,ut)&&rt(Fn,ut,Xe[ut]);return Fn},Ie=(Fn,Xe)=>it(Fn,Ge(Xe));let xe=[{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 Ue({onActionCallback:Fn,title:Xe,icon:ut,actionName:Lt,className:Jt="",children:We}){function mt(){Fn(Lt)}return St.createElement("a",{title:Xe,className:Jt,onClick:mt},St.createElement("i",{className:`${ut}`}),We)}var je=({watch:Fn,showNullButton:Xe,showNullProgramButton:ut,onActionCallback:Lt,fullScreen:Jt,insertTemp:We,hidetoolBar:mt,extraUse:zt})=>{const Ot=[...xe,{title:`${Fn?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${Fn?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return St.createElement("ul",{className:"markdown-toolbar-container"},!mt&&Ot.map((Vt,Yt)=>St.createElement("li",{key:Yt},Vt.actionName?St.createElement(Ue,Ie(ft({},Vt),{onActionCallback:Lt})):St.createElement("span",{className:"v-line"}))),Xe?St.createElement("li",null,St.createElement(Ue,{icon:"iconfont icon-tianjia5 insert-blank",className:"btn-null ml5",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Lt},St.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u65B0\u589E\u586B\u7A7A\u9879"))):null,ut?St.createElement(St.Fragment,null,St.createElement("li",null,St.createElement(Ue,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:Lt},St.createElement("span",{className:"fill-tip"},"+\u5355\u884C\u586B\u7A7A\u9879"))),St.createElement("li",null,St.createElement(Ue,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:Lt},St.createElement("span",{className:"fill-tip"},"+\u591A\u884C\u586B\u7A7A\u9879")))):null,We&&St.createElement("li",null,St.createElement(Ue,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${We}`,onActionCallback:Lt},St.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),zt&&St.createElement("li",null,zt),St.createElement("li",{className:"btn-full-screen"},St.createElement(Ue,{icon:`${Jt?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:Jt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Lt})))},_t=se(76621),Ct=se(22150),Dt=se(69677),qe=se(71577),Rt=Object.defineProperty,Pt=Object.defineProperties,En=Object.getOwnPropertyDescriptors,tn=Object.getOwnPropertySymbols,$n=Object.prototype.hasOwnProperty,ur=Object.prototype.propertyIsEnumerable,wr=(Fn,Xe,ut)=>Xe in Fn?Rt(Fn,Xe,{enumerable:!0,configurable:!0,writable:!0,value:ut}):Fn[Xe]=ut,Je=(Fn,Xe)=>{for(var ut in Xe||(Xe={}))$n.call(Xe,ut)&&wr(Fn,ut,Xe[ut]);if(tn)for(var ut of tn(Xe))ur.call(Xe,ut)&&wr(Fn,ut,Xe[ut]);return Fn},Ae=(Fn,Xe)=>Pt(Fn,En(Xe));const Ht={labelCol:{span:4},wrapperCol:{span:20}};var Rn=({callback:Fn,onCancel:Xe})=>{function ut(Lt){Fn(Lt)}return he.createElement(Ct.default,Ae(Je({},Ht),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ut,style:{width:500}}),he.createElement(Ct.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},he.createElement(Dt.default,null)),he.createElement(Ct.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},he.createElement(Dt.default,null)),he.createElement("div",{className:"flex-container flex-end"},he.createElement(qe.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),he.createElement(qe.ZP,{type:"ghost",onClick:Xe},"\u53D6\u6D88")))},yn=se(57444),ot=se(70859),nt=se(14446),Tt=se(71230),rn=se(63205),dn=se(67294),Ut=({callback:Fn,onCancel:Xe})=>{const ut=document.createElement("canvas"),Lt=ut.getContext("2d");ut.width=1e3,ut.height=800,Lt.fillStyle="#ffffff",Lt.fillRect(0,0,ut.width,ut.height);const Jt=ut.toDataURL("image/png");return dn.createElement(nt.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},dn.createElement(Tt.Z,{style:{height:"100vh"}},dn.createElement(rn.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:Jt,visible:!0,title:String(Date.now())},onOk:We=>{Fn({src:We.url})},onClose:Xe})))},Kt=se(72565),bn=se(15746),nn=se(2453),we={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re"},ue=se(67294),pe=(0,he.forwardRef)(({onCancel:Fn,editImgId:Xe,callback:ut},Lt)=>{let Jt=(0,he.useRef)(),We=(0,he.useRef)(),mt=(0,he.useRef)(),zt=(0,he.useRef)(!1);const Ot=(0,he.useRef)(!1);console.log("ref:",Lt);const[Vt,Yt]=(0,he.useState)(0),[Hn,_r]=(0,he.useState)("100vh");return(0,he.useEffect)(()=>{Yt(1);try{indexedDB.databases().then(Qn=>{Qn.forEach(qn=>indexedDB.deleteDatabase(qn.name))})}catch(Qn){}},[]),(0,he.useImperativeHandle)(Lt,()=>({setHeight:_r})),ue.createElement("div",{ref:Ot,className:"body-overflow-initial"},ue.createElement(Kt.Z,{width:"100vw",height:Hn,footer:null,closable:!0,placement:"bottom",open:!!Vt,destroyOnClose:!0,maskClosable:!1,mask:!1,rootClassName:`zIndex-9999 ${we.drawerWrap}`,onClose:()=>{window.saveDrawData(Qn=>{ut({src:`/api/attachments/${Qn}`,id:Qn})})},title:ue.createElement(Tt.Z,{align:"middle"},ue.createElement(bn.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),ue.createElement(bn.Z,{onClick:()=>{_r(Hn==="60px"?"100vh":"60px")}},ue.createElement("span",{className:"current c-blue",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77")),ue.createElement(bn.Z,{onClick:()=>{window.saveDrawData(Qn=>{if(Qn===null){nn.ZP.warning({content:"\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u8BF7\u5148\u7ED8\u5236\u6D41\u7A0B\u56FE",key:"saveFlowChart"});return}nn.ZP.success({content:"\u4FDD\u5B58\u6210\u529F",key:"saveFlowChart",style:{zIndex:999999999}}),ut({src:`/api/attachments/${Qn}`,id:Qn,disabledClose:!0})})}},ue.createElement(qe.ZP,{type:"primary",className:"ml20"},"\u4FDD\u5B58")))},ue.createElement("iframe",{src:`${window.ENV==="build"?"/react/build":""}/drawio/src/main/webapp/?id=${Xe||""}&gapi=0&od=0&db=0&gh=0&gl=0&local=0`,width:"100%",height:"100%",frameBorder:"0",ref:We})))}),fe=se(11320),le=se(78045),Pe=se(31795);const Qe=le.ZP.Group,It={margin:"0 8px"};var Nt=({callback:Fn,onCancel:Xe})=>{function ut(Lt){Fn(Lt)}return he.createElement(Ct.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ut},he.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},he.createElement("span",{style:It},"\u5355\u5143\u683C\u6570\uFF1A"),he.createElement("span",{style:It},"\u884C\u6570"),he.createElement(Ct.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},he.createElement(Pe.Z,null)),he.createElement("span",{style:It},"\u5217\u6570"),he.createElement(Ct.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},he.createElement(Pe.Z,null))),he.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},he.createElement("span",{style:It},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),he.createElement(Ct.default.Item,{name:"align"},he.createElement(Qe,null,he.createElement(le.ZP,{value:"default"},he.createElement("i",{className:"fa fa-align-justify"})),he.createElement(le.ZP,{value:"left"},he.createElement("i",{className:"fa fa-align-left"})),he.createElement(le.ZP,{value:"center"},he.createElement("i",{className:"fa fa-align-center"})),he.createElement(le.ZP,{value:"right"},he.createElement("i",{className:"fa fa-align-right"}))))),he.createElement("div",{className:"flex-container flex-end"},he.createElement(qe.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),he.createElement(qe.ZP,{type:"ghost",onClick:Xe},"\u53D6\u6D88")))},qt=se(47897),an=se(61016),jt=se.n(an),Cr=(0,he.forwardRef)(({use3d:Fn,width:Xe,height:ut,callback:Lt,showSaveButton:Jt},We)=>{const mt=(0,he.useRef)(),zt=(0,he.useRef)(),[Ot,Vt]=(0,he.useState)(!1),Yt=(0,he.useRef)({id:mt,appName:"graphing",width:Xe||1e3,height:ut||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,he.useEffect)(()=>{zt.current=new(jt())(Yt.current,!0),window.onload=function(){zt.current.inject("applet_container")}},[]);const Hn=()=>{var _r=window.ggbApplet.getPNGBase64(1,!0,72);return Lt&&Lt(_r),_r};return(0,he.useEffect)(()=>{Yt.current.appName=Ot?"3D":"graphing",zt.current.inject("applet_container")},[Ot]),(0,he.useEffect)(()=>{Vt(Fn)},[Fn]),(0,he.useImperativeHandle)(We,()=>({getImgData:Hn})),he.createElement(he.Fragment,null,he.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:mt}),he.createElement(Tt.Z,{align:"middle"},he.createElement(bn.Z,{flex:1},he.createElement(qt.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:Ot,onChange:_r=>Vt(_r)})),he.createElement(bn.Z,null,he.createElement(qe.ZP,{size:"large",onClick:Hn,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),Bt=se(36527),Mn=se(25934);const Vn="link",br="upload-image",at="add-flowchart",$t="draw-image",In="add-flowchart",Jn="code-block",ar="add-table",Mr="------------",$r={default:Mr,left:`:${Mr}`,center:`:${Mr}:`,right:`${Mr}:`};var Dr=se(99914),Kr=(Fn,Xe,ut)=>new Promise((Lt,Jt)=>{var We=Ot=>{try{zt(ut.next(Ot))}catch(Vt){Jt(Vt)}},mt=Ot=>{try{zt(ut.throw(Ot))}catch(Vt){Jt(Vt)}},zt=Ot=>Ot.done?Lt(Ot.value):Promise.resolve(Ot.value).then(We,mt);zt((ut=ut.apply(Fn,Xe)).next())});function ni(){}let hr=0;const mi=1e4,Ji="\u2581",Ui="@\u2581\u2581@",Vi="@\u2581@",ui=`
**\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`,yt=["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 Cn(Fn){return/^\d+$/.test(Fn)?`${Fn}px`:Fn}const Dn=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",sr={[Dn+"-B"]:"bold",[Dn+"-I"]:"italic"},nr={[Vn]:"\u6DFB\u52A0\u94FE\u63A5",[Jn]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[br]:"\u6DFB\u52A0\u56FE\u7247",[$t]:"\u6DFB\u52A0\u753B\u56FE",[at]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[ar]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var gr=({defaultValue:Fn="",onChange:Xe,width:ut="100%",height:Lt=400,miniToolbar:Jt=!1,isFocus:We=!1,watch:mt,insertTemp:zt,mode:Ot="markdown",id:Vt="markdown-editor-id",showResizeBar:Yt=!1,noStorage:Hn=!1,showNullButton:_r=!1,showNullProgramButton:Qn=!1,hidetoolBar:qn=!1,fullScreen:or=!1,onBlur:lr,onCMBeforeChange:ht,onFullScreen:st,className:bt="",disablePaste:ln=!1,disabled:Pn=!1,disabledFill:cn=!1,placeholder:pn="",values:mn="",extraUse:On,onAddBlank:cr})=>{const[Gt,Jr]=(0,he.useState)(null),[Zr,Bi]=(0,he.useState)(Fn),[Li,gi]=(0,he.useState)(mt),[Yi,xi]=(0,he.useState)(or),[oi,Ri]=(0,he.useState)(""),[ji,Yr]=(0,he.useState)(0),[vi,Wi]=(0,he.useState)(Lt),[la,ta]=(0,he.useState)(!1),ri=(0,he.useRef)((0,Mn.Z)()),xt=(0,he.useRef)(!1),vt=(0,he.useRef)(),[Zt,fn]=(0,he.useState)(0),[Tn,pr]=(0,he.useState)(0),Ar=(0,he.useRef)(),Wr=(0,he.useRef)(),Vr=(0,he.useRef)(),Hr=(0,he.useRef)(),ti=(0,he.useRef)(),yi=(0,he.useRef)(),Lr=()=>Kr(void 0,null,function*(){var xn;const gn=yield Fetch("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:ri.current}});(xn=gn==null?void 0:gn.attachments)!=null&&xn.length&&(console.log("cm:",Gt,Ar),gn.attachments.map(An=>{An.content_type.indexOf("image")>-1?Gt.replaceSelection(`![,](/api/attachments/${An.id}?type=${An.content_type})`):An.content_type.indexOf("video")>-1?Gt.replaceSelection(`<video width="100%" controls src="${fe.Z.API_SERVER}/api/attachments/${data.id}"></video>`):An.content_type.indexOf("pdf")>-1?Gt.replaceSelection(`<a href="${fe.Z.API_SERVER}/api/attachments/${An.id}?type=${An.content_type}&disposition=inline" target="_blank">${An.name}</a>`):Gt.replaceSelection(`[${An.name}](${fe.Z.API_SERVER}/api/attachments/${An.id}?type=${An.content_type})`)}))});(0,he.useEffect)(()=>{const xn=window.scrollY||window.pageYOffset;Bi(mn),Gt==null||Gt.setValue(mn),window.scrollTo(0,xn)},[mn]),(0,he.useEffect)(()=>{st==null||st(Yi)},[Yi]),(0,he.useEffect)(()=>{if(Ar.current){let xn=function(An,Bn){var fr;if(ln){Bn.preventDefault();return}const Gn=Bn.clipboardData;if(Gn){const jn=Gn.types.toString(),er=Gn.items;if(jn==="Files"||Gn.types.indexOf("Files")>-1){if(Bn.preventDefault(),Ot=="stex")return;try{let tr=er[1];((fr=er[0])==null?void 0:fr.kind)==="file"&&(tr=er[0]);const yr=tr.getAsFile(),Oe=yr.name.split(".").pop();(0,ot.I)(yr,Ke=>{var Mt,ct,Ft;Ke.id?((Mt=yr==null?void 0:yr.type)==null?void 0:Mt.indexOf("image"))>-1?gn.replaceSelection(`<img width="100%" src="/api/attachments/${Ke.id}?type=${Ke.content_type})" alt="" />`):((ct=yr==null?void 0:yr.type)==null?void 0:ct.indexOf("video"))>-1?gn.replaceSelection(`<video width="100%" controls src="/api/attachments/${Ke.id}"></video>`):((Ft=yr==null?void 0:yr.type)==null?void 0:Ft.indexOf("pdf"))>-1?gn.replaceSelection(`<a href="/api/attachments/${Ke.id}?type=${yr.type}&disposition=inline" target="_blank">${yr.name}</a>`):yt.includes(Oe)?gn.replaceSelection(`<a href="/api/attachments/${Ke.id}?type=office&disposition=inline" target="_blank">${yr.name}</a>`):gn.replaceSelection(`[${yr.name}](/api/attachments/${Ke.id}?type=${Ke.content_type})`):(Ke==null?void 0:Ke.status)===401&&(nn.ZP.warning((Ke==null?void 0:Ke.message)||"\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C"),document.location.href="/user/login")})}catch(tr){nn.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const gn=Re().fromTextArea(Ar.current,{mode:Ot,lineNumbers:!Jt,lineWrapping:!0,value:Fn,autoCloseTags:!Qn,autoCloseBrackets:!0});return gn.on("keyup",function(An,Bn){Bn.keyCode===8&&(An.getValue()==""?gn.setOption("placeholder",pn):gn.setOption("placeholder",null))}),gn.on("keydown",function(An,Bn){if(Bn.keyCode===8){var fr=Ai(An);fr&&Bn.preventDefault()}}),We&&gn.focus(),gn.on("paste",xn),gn.on("dragleave",function(An,Bn){Wr.current.classList.remove("mouse-hover-md")}),Pn&&gn.on("beforeChange",function(An,Bn){(Bn.origin==="paste"||Bn.origin==="+input")&&Bn.cancel()}),Jr(gn),()=>{gn.off("paste",xn)}}},[]);const hi=(0,he.useCallback)(()=>{if(Wr.current)try{}catch(xn){console.log(xn,"---- to set md editor body height")}},[vi,Wr,Yi]);(0,he.useEffect)(()=>{function xn(){let gn=new Ve.Z(An=>{for(let Bn of An)(Bn.target.offsetHeight>0||Bn.target.offsetWidth>0)&&(hi(),Gt.setSize("100%","100%"),Gt.refresh())});return gn.observe(Ar.current.parentElement),gn}if(Gt){const gn=xn();return()=>{var An,Bn;(An=Ar.current)!=null&&An.parentElement&&gn.unobserve((Bn=Ar.current)==null?void 0:Bn.parentElement)}}},[Gt,hi]),(0,he.useEffect)(()=>{if(Gt){let xn=[];for(const[gn,An]of Object.entries(sr)){let Bn={[gn]:()=>{Mi(An)}};xn.push(Bn),Gt.addKeyMap(Bn)}return vt.current=setInterval(()=>{xt.current&&Lr()},4e3),()=>{clearInterval(vt.current);for(let gn of xn)Gt.removeKeyMap(gn)}}},[Gt]),(0,he.useEffect)(()=>{or!==Yi&&xi(or)},[or]),(0,Dr.Z)(()=>{if(!Hn&&ji>0){let xn=new Date().getTime(),gn=window.sessionStorage.getItem(Vt);xn>=ji+mi&&(!gn||gn!==Zr)&&(window.sessionStorage.setItem(Vt,Zr),ta(!0))}},mi),(0,he.useEffect)(()=>{gi(mt)},[Gt,mt]),(0,he.useEffect)(()=>{Gt&&We&&Gt.focus()},[Gt,We]),(0,he.useEffect)(()=>{if(Li&&Gt){let xn=function(An){let Bn=An.target;if(Hr.current){let fr=Bn.scrollTop/Bn.scrollHeight;Hr.current.scrollTop=Hr.current.scrollHeight*fr}};const gn=Gt.getScrollerElement();return gn.addEventListener("scroll",xn),()=>{gn.removeEventListener("scroll",xn)}}},[Gt,Li]),(0,he.useEffect)(()=>{if(Gt&&ht){let xn=function(gn,An){ht(gn,An)};return Gt.on("beforeChange",xn),()=>{Gt.off("beforeChange",xn)}}},[Gt,ht]),(0,he.useEffect)(()=>{if(Gt&&lr){let xn=function(){lr(Gt.getValue())};return Gt.on("blur",xn),()=>{Gt.off("blur",xn)}}},[Gt,lr]);function Ai(xn,gn){var An=xn.getDoc(),Bn=An.getCursor(),fr=An.getLine(Bn.line),Gn=fr.charAt(Bn.ch-1),jn=fr.lastIndexOf("@\u2581@",Bn.ch),er=fr.lastIndexOf("@\u2581\u2581@",Bn.ch),tr=jn>er?jn:er,yr=jn>er?3:4;if(Ui.indexOf(Gn)===-1)return null;if(console.log("change1:",gn,xn,fr,Bn,tr,jn,er,Gn),tr>=0&&Bn.ch-tr<5){var Oe=tr+yr;return An.replaceRange("",{line:Bn.line,ch:tr},{line:Bn.line,ch:Oe}),{line:Bn.line,ch:Oe}}return null}(0,he.useEffect)(()=>{if(Gt){let xn=function(gn,An){const Bn=gn.getValue();Bi(Bn),Yr(new Date().getTime()),gn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Xe&&(Qn?Xe(Bn,Qt(Bn)):Xe(Bn))};return Gt.on("change",xn),()=>{Gt.off("change",xn)}}},[Gt,Xe]),(0,he.useEffect)(()=>{if(Gt)if(Fn==null)Gt.setValue(""),Bi("");else{const xn=window.scrollY||window.pageYOffset;Fn!==Gt.getValue()&&(Gt.setValue(Fn),Bi(Fn),Gt.setCursor(Pn?1:Gt.lineCount(),0),window.scrollTo(0,xn))}},[Gt,Fn]);const Mi=(0,he.useCallback)(xn=>{const gn=Gt.getCursor(),An=Gt.getSelection();let Bn=An.split(`
`);switch(xn){case"bold":return Gt.replaceSelection("**"+An+"**"),An===""&&Gt.setCursor(gn.line,gn.ch+2),Gt.focus();case"italic":return Gt.replaceSelection("*"+An+"*"),An===""&&Gt.setCursor(gn.line,gn.ch+1),Gt.focus();case"code":return Gt.replaceSelection("`"+An+"`"),An===""&&Gt.setCursor(gn.line,gn.ch+1),Gt.focus();case"inline-latex":return Ri("inline-latex"),Gt.focus();case"latex":return Gt.replaceSelection("```latex\n"+An+"\n```"),Gt.setCursor(gn.line+1,An.length+1),Gt.focus();case"line-break":return Gt.replaceSelection(`<br/>
`),Gt.focus();case"list-ul":return An===""?Gt.replaceSelection("- "+An):Gt.replaceSelection(Bn.map(fr=>fr===""?"":`- ${fr}`).join(`
`)),Gt.focus();case"list-ol":return An===""?Gt.replaceSelection("1. "+An):Gt.replaceSelection(Bn.map((fr,Gn)=>fr===""?"":`${Gn+1}. ${fr}`).join(`
`)),Gt.focus();case"add-null-ch":cr==null||cr();return;case"add-signal":return An===""&&Gt.setCursor(gn.line,gn.ch),Gt.replaceSelection(Vi),Gt.focus();case"add-multiple":return An===""&&Gt.setCursor(gn.line,gn.ch),Gt.replaceSelection(Ui),Gt.focus();case"inster-template-1":return An===""&&Gt.setCursor(gn.line,gn.ch),Gt.replaceSelection(ui),Gt.focus();case"eraser":return Gt.setValue(""),Gt.focus();case"trigger-watch":return gi(!Li),Gt.focus();case"trigger-full-screen":return xi(!Yi),Gt.focus();case Vn:Ri(Vn);return;case Jn:Ri(Jn);return;case br:Ri(br);return;case $t:Ri($t);return;case"maths-latex":Ri("maths-latex");return;case at:ti.current="",sessionStorage.removeItem("file_id"),Ri(at);return;case ar:Ri(ar);return;default:throw new Error}},[Gt,Li,Yi]),Le=(0,he.useCallback)((xn,gn)=>{var An,Bn,fr,Gn,jn,er;Ri("");const{src:tr,alt:yr,id:Oe}=xn||{};switch(oi){case Vn:const{title:un,link:vn}=xn;return Gt.replaceSelection(`[${un}](${vn})`),Gt.focus();case Jn:const{language:Nn,content:kn}=xn;return Gt.replaceSelection(["```"+Nn,kn,"```"].join(`
`)),Gt.focus();case"maths-latex":for(var Ke=atob(xn),Mt=new Uint8Array(Ke.length),ct=0;ct<Ke.length;ct++)Mt[ct]=Ke.charCodeAt(ct);var Ft=new Blob([Mt],{type:"image/png"});(0,ot.I)(Ft,Xr=>{Xr.id?Gt.replaceSelection(`![,](/api/attachments/${Xr.id}?type=${Xr.content_type})`):(Xr==null?void 0:Xr.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":Gt.replaceSelection("`$$"+xn+"$$`");break;case In:if(!Oe)return;Gt.focus(),Gt.getValue().indexOf(tr)===-1?Gt.replaceSelection(`<center><img id="${Oe}" width="80%" src="${tr}" class="draw-flowchart" alt="${yr||""}" /></center>`):document.getElementById(Oe).src=fe.Z.API_SERVER+tr+"?t="+Date.now();try{setTimeout(()=>{lr(Gt.getValue())},100)}catch(Xr){}break;case br:case $t:const on=gn,zn=(fr=(Bn=(An=on==null?void 0:on.name)==null?void 0:An.split("."))==null?void 0:Bn.pop)==null?void 0:fr.call(Bn);return((Gn=on==null?void 0:on.type)==null?void 0:Gn.indexOf("image"))>-1||!(on!=null&&on.type)?on!=null&&on.align||on!=null&&on.width?Gt.replaceSelection(`<p style="text-align:${on.align||"initial"}"><img width="${on.width?on.width+"%":"initial"}" src="${tr}" alt="${yr||""}" /></p>`):Gt.replaceSelection(`<img width="100%" src="${tr}" alt="${yr||""}" />`):((jn=on==null?void 0:on.type)==null?void 0:jn.indexOf("video"))>-1?Gt.replaceSelection(`<video width="100%" controls src="${tr}"></video>`):((er=on==null?void 0:on.type)==null?void 0:er.indexOf("pdf"))>-1?Gt.replaceSelection(`<a href="${tr}?type=${on.type}&disposition=inline" target="_blank">${on.name}</a>`):yt.includes(zn)?Gt.replaceSelection(`<a href="${tr}?type=office&disposition=inline" target="_blank">${on.name}</a>`):Gt.replaceSelection(`[${on.name}](${tr})`),Gt.focus();case ar:const{row:Wn,col:xr,align:Kn}=xn;let Pr=`
`;for(let Xr=0;Xr<Wn;Xr++){let Rr=[],Ur=[];for(let Er=0;Er<xr;Er++)Xr===1&&Ur.push($r[Kn]),Rr.push(" ");Xr===1&&(Pr+=`| ${Ur.join(" | ")} |
`),Pr+=`| ${Rr.join(xr===1?"":" | ")} |
`}return Gt.replaceSelection(Pr+`
`),Gt.focus();default:throw new Error}},[Gt,oi]),Fe=(0,he.useMemo)(()=>{switch(oi){case Vn:return he.createElement(Rn,{callback:Le,onCancel:ze});case Jn:return he.createElement(yn.Z,{callback:Le,onCancel:ze});case br:return he.createElement(ot.Z,{callback:Le,onCancel:ze});case at:return he.createElement(pe,{editImgId:ti.current,callback:Le,onCancel:ze});case ar:return he.createElement(Nt,{callback:Le,onCancel:ze});case"maths-latex":return he.createElement(Cr,{showSaveButton:!0,callback:Le});case"inline-latex":return he.createElement(Bt.Z,{showSaveButton:!0,callback:Le});default:return null}},[oi]);function ze(){Ri("")}(0,he.useEffect)(()=>{if(Vr.current){let xn=function(jn){fr=!0,Gn=jn.pageY},gn=function(){fr=!1},An=function(jn){if(fr){let er=jn.pageY-Gn;er<0&&(er=0),er>300&&(er=300);let tr=Lt+er+"px";Wi(tr)}},Bn=Vr.current,fr=!1,Gn=0;return Bn.addEventListener("mousedown",xn),document.addEventListener("mousemove",An),document.addEventListener("mouseup",gn),()=>{Bn.removeEventListener("mousedown",xn),document.removeEventListener("mousemove",An),document.removeEventListener("mouseup",gn)}}},[Gt,Vr]),(0,he.useEffect)(()=>{Wi(Lt)},[Lt]);const Ze=Cn(ut),et=Cn(vi),lt={width:Ze,height:et},wt=(0,he.useMemo)(()=>{if(ji){let xn=new Date(ji),gn=xn.getHours(),An=xn.getMinutes(),Bn=xn.getSeconds();return gn=gn<10?"0"+gn:gn,An=An<10?"0"+An:An,Bn=Bn<10?"0"+Bn:Bn,`${gn}:${An}:${Bn}`}return 0},[ji]),Qt=xn=>{const gn=[];if(Qn){let An=-1;xn=xn.replace(/(@▁▁@|@▁@)/g,function(Bn,fr,Gn){gn.push({multiLine:Bn!==Vi})})}return gn};function sn(){window.sessionStorage.removeItem(Vt),ta(!1),Yr(0)}function Xn(){ta(!1),Yr(0),Gt.setValue(window.sessionStorage.getItem(Vt))}(0,he.useEffect)(()=>{nr[oi]&&oi!==$t&&oi!==at&&setTimeout(()=>{const xn=document.getElementsByClassName("markdown-popup-form")[0],gn=window.innerWidth/2-xn.offsetWidth/2,An=window.innerHeight/2-xn.offsetHeight/2;fn(gn),pr(An)},0)},[oi]);const vr=xn=>{xn.preventDefault();const gn=xn.clientX-Zt,An=xn.clientY-Tn;document.body.onmousemove=Bn=>{let fr=Bn.clientX-gn,Gn=Bn.clientY-An;const jn=document.getElementsByClassName("markdown-popup-form")[0],er=window.innerWidth-jn.offsetWidth,tr=window.innerHeight-jn.offsetHeight;fr=Math.max(0,Math.min(fr,er)),Gn=Math.max(0,Math.min(Gn,tr)),Zn(Bn.clientX,Bn.clientY,gn,An)&&(fn(fr),pr(Gn))},document.body.onmouseup=function(){document.body.onmousemove=null}},Zn=(xn,gn,An,Bn)=>{const fr=document.body.clientHeight,Gn=document.body.clientWidth;return xn<20&&An>xn||xn>Gn-20&&An<xn||gn<20&&Bn>gn||gn>fr-20&&Bn<gn?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};return he.createElement(he.Fragment,null,he.createElement("div",{className:"markdown-editor-wrapper",ref:Wr},he.createElement("div",{className:`markdown-editor-container ${bt} ${Li?"on-preview":""} ${Jt?"mini":""} ${Yi?"full-screen":""}`,style:lt},he.createElement(je,{insertTemp:zt,watch:Li,fullScreen:Yi,showNullButton:_r,showNullProgramButton:Qn,onActionCallback:Mi,hidetoolBar:qn,extraUse:On}),he.createElement("div",{className:"markdown-editor-body"},he.createElement("div",{className:"codemirror-container"},he.createElement("textarea",{ref:Ar,placeholder:pn})),Li?he.createElement("div",{ref:Hr,className:"preview-container"},Ot==="stex"&&he.createElement(Be,{value:Zr}),Ot!=="stex"&&he.createElement(tt.Z,{edit:!0,disabledFill:cn,showProgramFill:Qn,value:Zr,openEditor:xn=>{var gn;ti.current=xn,(gn=yi.current)==null||gn.setHeight("100vh"),setTimeout(()=>{Ri("add-flowchart")},150)}})):null))),Yt?he.createElement("a",{ref:Vr,className:"editor-resize"}):null,oi===$t&&he.createElement(Ut,{callback:Le,onCancel:ze}),oi===at&&he.createElement(pe,{ref:yi,editImgId:ti.current,callback:Le,onCancel:ze}),he.createElement(_t.Z,null,nr[oi]&&oi!==$t&&oi!==at?he.createElement(nt.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:Zt,top:Tn},title:he.createElement("div",{style:{cursor:"move"},onMouseDown:vr},nr[oi]),open:!0,onCancel:ze,footer:null,destroyOnClose:!0,width:oi===at?"1200px":null,height:oi===at?"80vh":null,className:"markdown-popup-form"},Fe):null))}},70859:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return Ue},I:function(){return _t}});var he=se(22150),He=se(2453),Re=se(69677),Ve=se(93421),ve=se(31795),_e=se(78045),ke=se(71577),Se=se(15476),me=se(67294),Ee=se(52262),tt=se(67294),Be=Object.defineProperty,St=Object.defineProperties,dt=Object.getOwnPropertyDescriptors,it=Object.getOwnPropertySymbols,Ge=Object.prototype.hasOwnProperty,De=Object.prototype.propertyIsEnumerable,At=(Ct,Dt,qe)=>Dt in Ct?Be(Ct,Dt,{enumerable:!0,configurable:!0,writable:!0,value:qe}):Ct[Dt]=qe,Xt=(Ct,Dt)=>{for(var qe in Dt||(Dt={}))Ge.call(Dt,qe)&&At(Ct,qe,Dt[qe]);if(it)for(var qe of it(Dt))De.call(Dt,qe)&&At(Ct,qe,Dt[qe]);return Ct},rt=(Ct,Dt)=>St(Ct,dt(Dt));const{useForm:ft}=he.default,Ie={width:280,marginRight:10},xe={labelCol:{span:5},wrapperCol:{span:19}};var Ue=({callback:Ct,onCancel:Dt})=>{const[qe]=ft();let Rt=(0,me.useRef)();function Pt($n){Rt.current.width=qe.getFieldValue("width"),Rt.current.align=qe.getFieldValue("align"),Ct($n,Rt.current)}function En($n,ur){if($n.status===-1){He.ZP.error($n.message);return}qe.setFieldsValue({src:`/api/attachments/${$n.id}`,type:ur.type})}function tn($n){let ur=$n.target.files[0];Rt.current=ur,_t(ur,En)}return tt.createElement(he.default,rt(Xt({form:qe},xe),{className:"upload-image-panel",onFinish:Pt,style:{width:470,overflow:"hidden"}}),tt.createElement(he.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},tt.createElement("div",{className:"flex-container"},tt.createElement(he.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},tt.createElement(Re.default,{style:Ie})),tt.createElement(je,{onFileChange:tn}))),tt.createElement(he.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},tt.createElement(Re.default,{style:{width:264}})),tt.createElement(he.default.Item,{label:"\u56FE\u7247\u5BBD\u5EA6",name:"width"},tt.createElement(Ve.Z,null,tt.createElement(he.default.Item,{name:"width",style:{margin:0}},tt.createElement(ve.Z,{style:{width:264}})),tt.createElement("span",{className:"ml8"},"%"))),tt.createElement(he.default.Item,{label:"\u5BF9\u9F50\u65B9\u5F0F",name:"align"},tt.createElement(_e.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"}]})),tt.createElement("aside",null,tt.createElement(he.default.Item,{style:{textAlign:"right",position:"relative",right:-98}},tt.createElement(ke.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),tt.createElement(ke.ZP,{type:"default",onClick:Dt},"\u53D6\u6D88"))))};function je({onFileChange:Ct}){return tt.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",tt.createElement("input",{type:"file",onChange:Ct}))}function _t(Ct,Dt){if(!Ct)throw new String("\u6CA1\u6709\u6587\u4EF6");if(!(0,Ee.bg)())throw He.ZP.warning("\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C"),new String("\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C");let qe=new FormData;qe.append("editormd-image-file",Ct),qe.append("file_param_name","editormd-image-file"),qe.append("byxhr","true");var Rt=new window.XMLHttpRequest;Rt.withCredentials=!0,Rt.addEventListener("load",function(Pt){Dt(JSON.parse(Pt.target.responseText),Ct)},!1),Rt.addEventListener("error",function(Pt){console.error(Pt)},!1),Rt.open("POST",`${Se.KI}/api/attachments.json`),Rt.send(qe)}},76621:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return Re}});var he=se(67294),He=se(73935);class Re extends he.Component{constructor(ve){super(ve);const _e=window.document;this.node=_e.createElement("div"),_e.body.appendChild(this.node)}render(){const{children:ve}=this.props;return(0,He.createPortal)(ve,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},99914:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return He}});var he=se(67294);function He(Re,Ve){const ve=(0,he.useRef)();(0,he.useEffect)(()=>{ve.current=Re}),(0,he.useEffect)(()=>{function _e(){ve.current()}if(Ve!==null){let ke=setInterval(_e,Ve);return()=>clearInterval(ke)}},[Ve])}},34294:function(Sn,Wt,se){"use strict";se.r(Wt),se.d(Wt,{default:function(){return ot}});var he=se(67294),He=se(68508),Re=se(97183),Ve=se(2453),ve=se(14446),_e=se(55241),ke=se(11320),Se={flex_box_center:"flex_box_center___GfbI9",flex_space_between:"flex_space_between___m14JJ",flex_box_vertical_center:"flex_box_vertical_center___IKGDg",flex_box_center_end:"flex_box_center_end___JZxvM",flex_box_column:"flex_box_column___WnVa8",SubMentItem:"SubMentItem___P0LXo",MenuItem:"MenuItem___p91mQ",wrp:"wrp___kMQ4i",classroomInfo:"classroomInfo___rb1qC",title:"title___AQndp",titleLeft:"titleLeft___K7c9u",titleRight:"titleRight___BUODH",classroomUser:"classroomUser___NkYxe",headPic:"headPic___RD_it",teacherInfo:"teacherInfo___Gyj_W",classroomDesc:"classroomDesc___ng_AB",classroomDescBg:"classroomDescBg___Dz_DM",joinCouses:"joinCouses___U2D0G",bg:"bg___IcypX",leftMenus:"leftMenus___fF5qD",titleSelected:"titleSelected___Rqtd8",menuText:"menuText___jhrfq",totalCount:"totalCount___fqkbl",actions:"actions___NAYZl",task_count:"task_count___a1sYB",container:"container___djeCS",leftMenuActions:"leftMenuActions___lRhBF"},me=se(33170),Ee=se(35973),tt=se(55304),Be=se(74664),St=se(52262),dt=se(69677),it=(nt,Tt,rn)=>new Promise((dn,Ut)=>{var Kt=we=>{try{nn(rn.next(we))}catch(ue){Ut(ue)}},bn=we=>{try{nn(rn.throw(we))}catch(ue){Ut(ue)}},nn=we=>we.done?dn(we.value):Promise.resolve(we.value).then(Kt,bn);nn((rn=rn.apply(nt,Tt)).next())});function Ge({user:nt,CategoryId:Tt,IsShow:rn,setIsShow:dn,dispatch:Ut,init:Kt}){const[bn,nn]=(0,he.useState)();return he.createElement(ve.default,{title:Tt?"\u65B0\u5EFA\u4E09\u7EA7\u7C7B\u76EE":"\u65B0\u5EFA\u4E8C\u7EA7\u7C7B\u76EE",width:424,onCancel:()=>{dn(!1)},onOk:()=>it(this,null,function*(){if(!bn){Ve.ZP.error("\u680F\u76EE\u540D\u4E0D\u80FD\u4E3A\u7A7A");return}(yield(0,me.ZP)("/api/programas.json",{method:"post",body:{name:bn,parent_id:Tt}})).status===0&&(Ve.ZP.info("\u521B\u5EFA\u6210\u529F"),dn(!1),nn(""),Kt())}),open:rn},he.createElement(dt.default,{value:bn,onChange:we=>nn(we.target.value),placeholder:"\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC710\u4E2A\u6C49\u5B57\u7684\u540D\u79F0",maxLength:10}))}var De=(0,Ee.connect)(({user:nt})=>({user:nt}))(Ge),At=(nt,Tt,rn)=>new Promise((dn,Ut)=>{var Kt=we=>{try{nn(rn.next(we))}catch(ue){Ut(ue)}},bn=we=>{try{nn(rn.throw(we))}catch(ue){Ut(ue)}},nn=we=>we.done?dn(we.value):Promise.resolve(we.value).then(Kt,bn);nn((rn=rn.apply(nt,Tt)).next())});function Xt({user:nt,CategoryId:Tt,name:rn,IsShow:dn,setIsShow:Ut,dispatch:Kt,init:bn}){const[nn,we]=(0,he.useState)();return(0,he.useEffect)(()=>{we(rn)},[rn]),he.createElement(ve.default,{title:"\u76EE\u5F55\u91CD\u547D\u540D",width:424,onCancel:()=>{Ut(!1)},onOk:()=>At(this,null,function*(){if(!nn){Ve.ZP.error("\u680F\u76EE\u540D\u4E0D\u80FD\u4E3A\u7A7A");return}(yield(0,me.ZP)(`/api/programas/${Tt}/rename.json`,{method:"put",body:{name:nn,id:Tt}})).status===0&&(Ve.ZP.info("\u4FEE\u6539\u6210\u529F"),Ut(!1),we(""),bn())}),open:dn},he.createElement(dt.default,{value:nn,onChange:ue=>we(ue.target.value),placeholder:"\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC710\u4E2A\u6C49\u5B57\u7684\u540D\u79F0",maxLength:10}))}var rt=(0,Ee.connect)(({user:nt})=>({user:nt}))(Xt),ft=se(71577),Ie=se(35598);function xe({user:nt,ItemData:Tt,setIssee:rn,dispatch:dn,init:Ut}){var Kt,bn,nn,we;return he.createElement("div",null,he.createElement("div",{style:{textAlign:"right"}},(0,St.Ny)()&&he.createElement(ft.ZP,{onClick:()=>rn(!1)},"\u7F16\u8F91")),he.createElement(Ie.Z,{value:Tt.content}),((Kt=Tt==null?void 0:Tt.attachment)==null?void 0:Kt.id)&&he.createElement("div",null,he.createElement("a",{href:(bn=Tt==null?void 0:Tt.attachment)==null?void 0:bn.url,target:"_self",download:(nn=Tt==null?void 0:Tt.attachment)==null?void 0:nn.title},he.createElement("i",{style:{color:"#29BD8B"},className:"font-14 color-green iconfont icon-fujian mr8"}),he.createElement("span",{style:{color:"#000000"}},(we=Tt==null?void 0:Tt.attachment)==null?void 0:we.title))))}var Ue=(0,Ee.connect)(({user:nt})=>({user:nt}))(xe),je=se(59810),_t=se(91304),Ct=se(78392),Dt=Object.defineProperty,qe=Object.getOwnPropertySymbols,Rt=Object.prototype.hasOwnProperty,Pt=Object.prototype.propertyIsEnumerable,En=(nt,Tt,rn)=>Tt in nt?Dt(nt,Tt,{enumerable:!0,configurable:!0,writable:!0,value:rn}):nt[Tt]=rn,tn=(nt,Tt)=>{for(var rn in Tt||(Tt={}))Rt.call(Tt,rn)&&En(nt,rn,Tt[rn]);if(qe)for(var rn of qe(Tt))Pt.call(Tt,rn)&&En(nt,rn,Tt[rn]);return nt},$n=(nt,Tt,rn)=>new Promise((dn,Ut)=>{var Kt=we=>{try{nn(rn.next(we))}catch(ue){Ut(ue)}},bn=we=>{try{nn(rn.throw(we))}catch(ue){Ut(ue)}},nn=we=>we.done?dn(we.value):Promise.resolve(we.value).then(Kt,bn);nn((rn=rn.apply(nt,Tt)).next())});function ur({user:nt,ItemData:Tt,setIssee:rn,CategoryId:dn,dispatch:Ut,init:Kt}){let[bn,nn]=(0,he.useState)([]);const[we,ue]=(0,he.useState)(Tt.content);function oe(){var Pe;let Qe=[];return(Pe=Tt==null?void 0:Tt.attachments)==null||Pe.map(It=>{let Nt={uid:It==null?void 0:It.id,name:It.title,response:{id:It.id}};Qe.push(Nt)}),Qe}const pe={name:"file",multiple:!0,action:ke.Z.API_SERVER+"/api/attachments.json",defaultFileList:oe(),onRemove(Pe){(0,Ct.y8)({id:Pe.uid})},onChange(Pe){console.log("info",Pe);const{status:Qe}=Pe.file;Qe==="removed"&&nn(Pe.fileList),Qe==="done"?(nn(Pe.fileList),Ve.ZP.success(`${Pe.file.name} \u6587\u4EF6\u4E0A\u4F20\u6210\u529F`)):Qe==="error"&&Ve.ZP.error(`${Pe.file.name} \u6587\u4EF6\u4E0A\u4F20\u5931\u8D25`)},beforeUpload:Pe=>{const Qe=Pe.size/1024/1024<150;return Qe||Ve.ZP.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E150MB"),Qe}};function fe(){return $n(this,null,function*(){(yield(0,me.ZP)(`/api/programas/${dn}/update_content.json`,{method:"put",body:{id:dn,content:we,attachment_id:le(bn)}}))&&(Ve.ZP.info("\u63D0\u4EA4\u6210\u529F"),rn(!0))})}function le(Pe){let Qe;return Pe&&Pe.map(It=>{Qe=It.response.id}),Qe}return he.createElement("div",null,he.createElement(_t.Z,{defaultValue:we,onChange:Pe=>ue(Pe)}),he.createElement(je.default,tn({},pe),he.createElement(ft.ZP,{className:"uploadBtn"},"\u4E0A\u4F20\u9644\u4EF6"),"(\u5355\u4E2A\u6587\u4EF6150M\u4EE5\u5185)"),he.createElement("p",{style:{marginTop:"10px"}},he.createElement(ft.ZP,{style:{width:"90px"},onClick:()=>fe()},"\u63D0\u4EA4"),he.createElement(ft.ZP,{style:{marginLeft:"30px",width:"90px"},type:"primary",onClick:()=>rn(!0)},"\u53D6\u6D88")))}var wr=(0,Ee.connect)(({user:nt})=>({user:nt}))(ur),Je=(nt,Tt,rn)=>new Promise((dn,Ut)=>{var Kt=we=>{try{nn(rn.next(we))}catch(ue){Ut(ue)}},bn=we=>{try{nn(rn.throw(we))}catch(ue){Ut(ue)}},nn=we=>we.done?dn(we.value):Promise.resolve(we.value).then(Kt,bn);nn((rn=rn.apply(nt,Tt)).next())});const{SubMenu:Ae}=He.default,{Content:Ht,Sider:Rn}=Re.default;function yn({user:nt,dispatch:Tt,globalSetting:rn}){var dn;const[Ut,Kt]=(0,he.useState)(),[bn,nn]=(0,he.useState)(!1),[we,ue]=(0,he.useState)();let[oe,pe]=(0,he.useState)();const[fe,le]=(0,he.useState)(!1),[Pe,Qe]=(0,he.useState)(""),[It,Nt]=(0,he.useState)(""),[qt,an]=(0,he.useState)(!0);(0,he.useEffect)(()=>{jt()},[]),console.log("globalSetting",rn);function jt(){return Je(this,null,function*(){const Vn=yield(0,me.ZP)("/api/programas.json",{method:"get"});Vn&&ue(Vn==null?void 0:Vn.programas)})}const ir=(Vn,br,at)=>Je(this,null,function*(){switch(Vn){case 1:pe(br==null?void 0:br.id),nn(!0);break;case 2:pe(br==null?void 0:br.id),le(!0),Qe(br==null?void 0:br.name);break;case 3:(yield(0,me.ZP)(`/api/programas/${br==null?void 0:br.id}/top.json`,{method:"post",body:{id:br==null?void 0:br.id}})).status===0&&jt();break;case 4:Cr(he.createElement("p",null,"\u5220\u9664\u4E4B\u540E\u4E0D\u80FD\u6062\u590D,",he.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),()=>Je(this,null,function*(){(yield(0,me.ZP)(`/api/programas/${br==null?void 0:br.id}.json`,{method:"delete",body:{id:br==null?void 0:br.id}})).status===0&&(Ve.ZP.info("\u5220\u9664\u6210\u529F"),jt())}));break}}),Cr=(Vn,br)=>{ve.default.confirm({centered:!0,title:"\u63D0\u793A",icon:he.createElement(tt.Z,null),content:Vn,okText:"\u786E\u8BA4",onOk:()=>br(),cancelText:"\u53D6\u6D88"})},Bt=(Vn,br)=>he.createElement("div",{className:Se.leftMenuActions},br===1&&he.createElement("p",{className:"current",onClick:()=>ir(1,Vn,br)},"\u65B0\u5EFA"),he.createElement("p",{className:"current",onClick:()=>ir(2,Vn,br)},"\u91CD\u547D\u540D"),he.createElement("p",{className:"current",onClick:()=>ir(3,Vn,br)},"\u7F6E\u9876"),he.createElement("p",{className:"current",onClick:()=>ir(4,Vn,br)},"\u5220\u9664"));function Mn(){return Je(this,null,function*(){const Vn=yield(0,me.ZP)(`/api/programas/${oe}/content.json`,{method:"get",params:{id:oe}});Vn&&Nt(Vn)})}return he.createElement("div",{style:{marginBottom:"40px"}},he.createElement("img",{style:{width:"100%"},src:ke.Z.IMG_SERVER+`/${(dn=rn==null?void 0:rn.setting)==null?void 0:dn.shixun_banner_url}`}),he.createElement("div",{className:"edu-container minH500",style:{display:"flex",width:"1200px"}},he.createElement(Rn,{width:244,className:Se.leftMenus,style:{background:"none",marginTop:"20px",height:"auto"}},he.createElement(He.default,{mode:"inline"},we==null?void 0:we.map((Vn,br)=>{var at,$t;return(Vn==null?void 0:Vn.children.length)>0?he.createElement(Ae,{title:he.createElement("span",{className:"font16"},he.createElement("span",null,Vn.name),!(0,St.Ny)()&&he.createElement("span",null),(0,St.Ny)()&&he.createElement(_e.Z,{placement:"right",content:()=>Bt(Vn,1),trigger:"hover"},he.createElement("span",{className:["iconfont icon-sandian",Se.actions].join(" ")})))},(at=Vn==null?void 0:Vn.children)==null?void 0:at.map((In,Jn)=>{var ar;return he.createElement(He.default.Item,{className:(ar=Se)==null?void 0:ar.SubMentItem,onClick:()=>{pe(In==null?void 0:In.id),oe=In==null?void 0:In.id,Mn()}},he.createElement("span",{style:{flex:"1"}},In==null?void 0:In.name),(0,St.Ny)()&&he.createElement(_e.Z,{placement:"right",content:()=>Bt(In,2),trigger:"hover"},he.createElement("span",{className:["iconfont icon-sandian",Se.actions].join(" ")})))})):he.createElement(He.default.Item,{className:($t=Se)==null?void 0:$t.SubMentItem,onClick:()=>{pe(Vn==null?void 0:Vn.id),oe=Vn==null?void 0:Vn.id,Mn()}},he.createElement("span",{style:{flex:"1"}},Vn==null?void 0:Vn.name),(0,St.Ny)()&&he.createElement(_e.Z,{placement:"right",content:()=>Bt(Vn,1),trigger:"hover"},he.createElement("span",{className:["iconfont icon-sandian",Se.actions].join(" ")})))}),he.createElement(He.default.Item,{onClick:()=>{pe(""),oe="",nn(!0)},style:{color:"#0152d9",fontSize:"16px",height:"40px",display:"flex",alignItems:"center"},icon:he.createElement(Be.Z,{style:{color:"#0152d9",fontSize:"16px"}})},"\u65B0\u589E\u4E8C\u7EA7\u7C7B\u76EE"))),he.createElement("div",{style:{width:"937px",marginLeft:"17px",background:"#fff",padding:"20px"}},qt&&he.createElement(Ue,{ItemData:It,setIssee:an}),qt===!1&&he.createElement(wr,{ItemData:It,setIssee:an,CategoryId:oe}))),he.createElement(De,{CategoryId:oe,IsShow:bn,setIsShow:nn,init:jt}),he.createElement(rt,{CategoryId:oe,name:Pe,IsShow:fe,setIsShow:le,init:jt}))}var ot=(0,Ee.connect)(({user:nt,globalSetting:Tt})=>({user:nt,globalSetting:Tt}))(yn)},81643:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return he}});const he=He=>He?typeof He=="function"?He():He:null},57838:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return He}});var he=se(67294);function He(){const[,Re]=he.useReducer(Ve=>Ve+1,0);return Re}},9708:function(Sn,Wt,se){"use strict";se.d(Wt,{F:function(){return ve},Z:function(){return Ve}});var he=se(94184),He=se.n(he);const Re=null;function Ve(_e,ke,Se){return He()({[`${_e}-status-success`]:ke==="success",[`${_e}-status-warning`]:ke==="warning",[`${_e}-status-error`]:ke==="error",[`${_e}-status-validating`]:ke==="validating",[`${_e}-has-feedback`]:Se})}const ve=(_e,ke)=>ke||_e},88258:function(Sn,Wt,se){"use strict";var he=se(67294),He=se(53124),Re=se(32983);const Ve=ve=>{const{componentName:_e}=ve,{getPrefixCls:ke}=(0,he.useContext)(He.E_),Se=ke("empty");switch(_e){case"Table":case"List":return he.createElement(Re.Z,{image:Re.Z.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return he.createElement(Re.Z,{image:Re.Z.PRESENTED_IMAGE_SIMPLE,className:`${Se}-small`});default:return he.createElement(Re.Z,null)}};Wt.Z=Ve},72565:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return ri}});var he=se(94184),He=se.n(he),Re=se(1413),Ve=se(97685),ve=se(67294),_e=se(73935);function ke(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Se={};function me(xt,vt){}function Ee(xt,vt){}function tt(){Se={}}function Be(xt,vt,Zt){!vt&&!Se[Zt]&&(xt(!1,Zt),Se[Zt]=!0)}function St(xt,vt){Be(me,xt,vt)}function dt(xt,vt){Be(Ee,xt,vt)}var it=null,Ge=se(71002),De=se(18459);function At(xt,vt,Zt){var fn=ve.useRef({});return(!("value"in fn.current)||Zt(fn.current.condition,vt))&&(fn.current.value=xt(),fn.current.condition=vt),fn.current.value}function Xt(xt,vt){typeof xt=="function"?xt(vt):(0,Ge.Z)(xt)==="object"&&xt&&"current"in xt&&(xt.current=vt)}function rt(){for(var xt=arguments.length,vt=new Array(xt),Zt=0;Zt<xt;Zt++)vt[Zt]=arguments[Zt];var fn=vt.filter(function(Tn){return Tn});return fn.length<=1?fn[0]:function(Tn){vt.forEach(function(pr){Xt(pr,Tn)})}}function ft(){for(var xt=arguments.length,vt=new Array(xt),Zt=0;Zt<xt;Zt++)vt[Zt]=arguments[Zt];return At(function(){return rt.apply(void 0,vt)},vt,function(fn,Tn){return fn.length===Tn.length&&fn.every(function(pr,Ar){return pr===Tn[Ar]})})}function Ie(xt){var vt,Zt,fn=(0,De.isMemo)(xt)?xt.type.type:xt.type;return!(typeof fn=="function"&&!((vt=fn.prototype)!==null&&vt!==void 0&&vt.render)||typeof xt=="function"&&!((Zt=xt.prototype)!==null&&Zt!==void 0&&Zt.render))}var xe=ve.createContext(null),Ue=xe,je=se(74902),_t=ke()?ve.useLayoutEffect:ve.useEffect,Ct=_t,Dt=function(vt,Zt){var fn=React.useRef(!0);_t(function(){if(!fn.current)return vt()},Zt),_t(function(){return fn.current=!1,function(){fn.current=!0}},[])},qe=[];function Rt(xt,vt){var Zt=ve.useState(function(){if(!ke())return null;var Ai=document.createElement("div");return Ai}),fn=(0,Ve.Z)(Zt,1),Tn=fn[0],pr=ve.useRef(!1),Ar=ve.useContext(Ue),Wr=ve.useState(qe),Vr=(0,Ve.Z)(Wr,2),Hr=Vr[0],ti=Vr[1],yi=Ar||(pr.current?void 0:function(Ai){ti(function(Mi){var Le=[Ai].concat((0,je.Z)(Mi));return Le})});function Lr(){Tn.parentElement||document.body.appendChild(Tn),pr.current=!0}function hi(){var Ai;(Ai=Tn.parentElement)===null||Ai===void 0||Ai.removeChild(Tn),pr.current=!1}return Ct(function(){return xt?Ar?Ar(Lr):Lr():hi(),hi},[xt]),Ct(function(){Hr.length&&(Hr.forEach(function(Ai){return Ai()}),ti(qe))},[Hr]),[Tn,yi]}function Pt(xt,vt){if(!xt)return!1;if(xt.contains)return xt.contains(vt);for(var Zt=vt;Zt;){if(Zt===xt)return!0;Zt=Zt.parentNode}return!1}var En="data-rc-order",tn="rc-util-key",$n=new Map;function ur(){var xt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},vt=xt.mark;return vt?vt.startsWith("data-")?vt:"data-".concat(vt):tn}function wr(xt){if(xt.attachTo)return xt.attachTo;var vt=document.querySelector("head");return vt||document.body}function Je(xt){return xt==="queue"?"prependQueue":xt?"prepend":"append"}function Ae(xt){return Array.from(($n.get(xt)||xt).children).filter(function(vt){return vt.tagName==="STYLE"})}function Ht(xt){var vt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!ke())return null;var Zt=vt.csp,fn=vt.prepend,Tn=document.createElement("style");Tn.setAttribute(En,Je(fn)),Zt!=null&&Zt.nonce&&(Tn.nonce=Zt==null?void 0:Zt.nonce),Tn.innerHTML=xt;var pr=wr(vt),Ar=pr.firstChild;if(fn){if(fn==="queue"){var Wr=Ae(pr).filter(function(Vr){return["prepend","prependQueue"].includes(Vr.getAttribute(En))});if(Wr.length)return pr.insertBefore(Tn,Wr[Wr.length-1].nextSibling),Tn}pr.insertBefore(Tn,Ar)}else pr.appendChild(Tn);return Tn}function Rn(xt){var vt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Zt=wr(vt);return Ae(Zt).find(function(fn){return fn.getAttribute(ur(vt))===xt})}function yn(xt){var vt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Zt=Rn(xt,vt);if(Zt){var fn=wr(vt);fn.removeChild(Zt)}}function ot(xt,vt){var Zt=$n.get(xt);if(!Zt||!Pt(document,Zt)){var fn=Ht("",vt),Tn=fn.parentNode;$n.set(xt,Tn),xt.removeChild(fn)}}function nt(){$n.clear()}function Tt(xt,vt){var Zt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},fn=wr(Zt);ot(fn,Zt);var Tn=Rn(vt,Zt);if(Tn){var pr,Ar;if((pr=Zt.csp)!==null&&pr!==void 0&&pr.nonce&&Tn.nonce!==((Ar=Zt.csp)===null||Ar===void 0?void 0:Ar.nonce)){var Wr;Tn.nonce=(Wr=Zt.csp)===null||Wr===void 0?void 0:Wr.nonce}return Tn.innerHTML!==xt&&(Tn.innerHTML=xt),Tn}var Vr=Ht(xt,Zt);return Vr.setAttribute(ur(Zt),vt),Vr}var rn;function dn(xt){if(typeof document=="undefined")return 0;if(xt||rn===void 0){var vt=document.createElement("div");vt.style.width="100%",vt.style.height="200px";var Zt=document.createElement("div"),fn=Zt.style;fn.position="absolute",fn.top="0",fn.left="0",fn.pointerEvents="none",fn.visibility="hidden",fn.width="200px",fn.height="150px",fn.overflow="hidden",Zt.appendChild(vt),document.body.appendChild(Zt);var Tn=vt.offsetWidth;Zt.style.overflow="scroll";var pr=vt.offsetWidth;Tn===pr&&(pr=Zt.clientWidth),document.body.removeChild(Zt),rn=Tn-pr}return rn}function Ut(xt){var vt=xt.match(/^(.*)px$/),Zt=Number(vt==null?void 0:vt[1]);return Number.isNaN(Zt)?dn():Zt}function Kt(xt){if(typeof document=="undefined"||!xt||!(xt instanceof Element))return{width:0,height:0};var vt=getComputedStyle(xt,"::-webkit-scrollbar"),Zt=vt.width,fn=vt.height;return{width:Ut(Zt),height:Ut(fn)}}function bn(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var nn="rc-util-locker-".concat(Date.now()),we=0;function ue(xt){var vt=!!xt,Zt=ve.useState(function(){return we+=1,"".concat(nn,"_").concat(we)}),fn=(0,Ve.Z)(Zt,1),Tn=fn[0];Ct(function(){if(vt){var pr=Kt(document.body).width,Ar=bn();Tt(`
html body {
overflow-y: hidden;
`.concat(Ar?"width: calc(100% - ".concat(pr,"px);"):"",`
}`),Tn)}else yn(Tn);return function(){yn(Tn)}},[vt,Tn])}var oe=!1;function pe(xt){return typeof xt=="boolean"&&(oe=xt),oe}var fe=function(vt){return vt===!1?!1:!ke()||!vt?null:typeof vt=="string"?document.querySelector(vt):typeof vt=="function"?vt():vt},le=ve.forwardRef(function(xt,vt){var Zt=xt.open,fn=xt.autoLock,Tn=xt.getContainer,pr=xt.debug,Ar=xt.autoDestroy,Wr=Ar===void 0?!0:Ar,Vr=xt.children,Hr=ve.useState(Zt),ti=(0,Ve.Z)(Hr,2),yi=ti[0],Lr=ti[1],hi=yi||Zt;ve.useEffect(function(){(Wr||Zt)&&Lr(Zt)},[Zt,Wr]);var Ai=ve.useState(function(){return fe(Tn)}),Mi=(0,Ve.Z)(Ai,2),Le=Mi[0],Fe=Mi[1];ve.useEffect(function(){var xn=fe(Tn);Fe(xn!=null?xn:null)});var ze=Rt(hi&&!Le,pr),Ze=(0,Ve.Z)(ze,2),et=Ze[0],lt=Ze[1],wt=Le!=null?Le:et;ue(fn&&Zt&&ke()&&(wt===et||wt===document.body));var Qt=null;if(Vr&&Ie(Vr)&&vt){var sn=Vr;Qt=sn.ref}var Xn=ft(Qt,vt);if(!hi||!ke()||Le===void 0)return null;var vr=wt===!1||pe(),Zn=Vr;return vt&&(Zn=ve.cloneElement(Vr,{ref:Xn})),ve.createElement(Ue.Provider,{value:lt},vr?Zn:(0,_e.createPortal)(Zn,wt))}),Pe=le,Qe=Pe;function It(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Nt=It()?ve.useLayoutEffect:ve.useEffect,qt=function(vt,Zt){var fn=ve.useRef(!0);Nt(function(){return vt(fn.current)},Zt),Nt(function(){return fn.current=!1,function(){fn.current=!0}},[])},an=function(vt,Zt){qt(function(fn){if(!fn)return vt()},Zt)},jt=qt,ir=ve.createContext(null),Cr=ve.createContext({}),Bt=ir,Mn=se(4942),Vn=se(87462),br=se(62874),at={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(vt){var Zt=vt.keyCode;if(vt.altKey&&!vt.ctrlKey||vt.metaKey||Zt>=at.F1&&Zt<=at.F12)return!1;switch(Zt){case at.ALT:case at.CAPS_LOCK:case at.CONTEXT_MENU:case at.CTRL:case at.DOWN:case at.END:case at.ESC:case at.HOME:case at.INSERT:case at.LEFT:case at.MAC_FF_META:case at.META:case at.NUMLOCK:case at.NUM_CENTER:case at.PAGE_DOWN:case at.PAGE_UP:case at.PAUSE:case at.PRINT_SCREEN:case at.RIGHT:case at.SHIFT:case at.UP:case at.WIN_KEY:case at.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(vt){if(vt>=at.ZERO&&vt<=at.NINE||vt>=at.NUM_ZERO&&vt<=at.NUM_MULTIPLY||vt>=at.A&&vt<=at.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&vt===0)return!0;switch(vt){case at.SPACE:case at.QUESTION_MARK:case at.NUM_PLUS:case at.NUM_MINUS:case at.NUM_PERIOD:case at.NUM_DIVISION:case at.SEMICOLON:case at.DASH:case at.EQUALS:case at.COMMA:case at.PERIOD:case at.SLASH:case at.APOSTROPHE:case at.SINGLE_QUOTE:case at.OPEN_SQUARE_BRACKET:case at.BACKSLASH:case at.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},$t=at,In=`accept acceptCharset accessKey action allowFullScreen allowTransparency
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
charSet checked classID className colSpan cols content contentEditable contextMenu
controls coords crossOrigin data dateTime default defer dir disabled download draggable
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
mediaGroup method min minLength multiple muted name noValidate nonce open
optimum pattern placeholder poster preload radioGroup readOnly rel required
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
summary tabIndex target title type useMap value width wmode wrap`,Jn=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,ar="".concat(In," ").concat(Jn).split(/[\s\n]+/),Mr="aria-",$r="data-";function Dr(xt,vt){return xt.indexOf(vt)===0}function Kr(xt){var vt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Zt;vt===!1?Zt={aria:!0,data:!0,attr:!0}:vt===!0?Zt={aria:!0}:Zt=(0,Re.Z)({},vt);var fn={};return Object.keys(xt).forEach(function(Tn){(Zt.aria&&(Tn==="role"||Dr(Tn,Mr))||Zt.data&&Dr(Tn,$r)||Zt.attr&&ar.includes(Tn))&&(fn[Tn]=xt[Tn])}),fn}function ni(xt){var vt=React.useRef();vt.current=xt;var Zt=React.useCallback(function(){for(var fn,Tn=arguments.length,pr=new Array(Tn),Ar=0;Ar<Tn;Ar++)pr[Ar]=arguments[Ar];return(fn=vt.current)===null||fn===void 0?void 0:fn.call.apply(fn,[vt].concat(pr))},[]);return Zt}function hr(xt){var vt=React.useRef(!1),Zt=React.useState(xt),fn=_slicedToArray(Zt,2),Tn=fn[0],pr=fn[1];React.useEffect(function(){return vt.current=!1,function(){vt.current=!0}},[]);function Ar(Wr,Vr){Vr&&vt.current||pr(Wr)}return[Tn,Ar]}function mi(xt){return xt!==void 0}function Ji(xt,vt){var Zt=vt||{},fn=Zt.defaultValue,Tn=Zt.value,pr=Zt.onChange,Ar=Zt.postState,Wr=useState(function(){return mi(Tn)?Tn:mi(fn)?typeof fn=="function"?fn():fn:typeof xt=="function"?xt():xt}),Vr=_slicedToArray(Wr,2),Hr=Vr[0],ti=Vr[1],yi=Tn!==void 0?Tn:Hr,Lr=Ar?Ar(yi):yi,hi=useEvent(pr),Ai=useState([yi]),Mi=_slicedToArray(Ai,2),Le=Mi[0],Fe=Mi[1];useLayoutUpdateEffect(function(){var Ze=Le[0];Hr!==Ze&&hi(Hr,Ze)},[Le]),useLayoutUpdateEffect(function(){mi(Tn)||ti(Tn)},[Tn]);var ze=useEvent(function(Ze,et){ti(Ze,et),Fe([yi],et)});return[Lr,ze]}var Ui=se(33993);function Vi(xt,vt,Zt){var fn=ve.useRef({});return(!("value"in fn.current)||Zt(fn.current.condition,vt))&&(fn.current.value=xt(),fn.current.condition=vt),fn.current.value}function ui(xt,vt){typeof xt=="function"?xt(vt):(0,Ge.Z)(xt)==="object"&&xt&&"current"in xt&&(xt.current=vt)}function yt(){for(var xt=arguments.length,vt=new Array(xt),Zt=0;Zt<xt;Zt++)vt[Zt]=arguments[Zt];var fn=vt.filter(function(Tn){return Tn});return fn.length<=1?fn[0]:function(Tn){vt.forEach(function(pr){ui(pr,Tn)})}}function Cn(){for(var xt=arguments.length,vt=new Array(xt),Zt=0;Zt<xt;Zt++)vt[Zt]=arguments[Zt];return Vi(function(){return yt.apply(void 0,vt)},vt,function(fn,Tn){return fn.length!==Tn.length||fn.every(function(pr,Ar){return pr!==Tn[Ar]})})}function Ln(xt){var vt,Zt,fn=isMemo(xt)?xt.type.type:xt.type;return!(typeof fn=="function"&&!((vt=fn.prototype)!==null&&vt!==void 0&&vt.render)||typeof xt=="function"&&!((Zt=xt.prototype)!==null&&Zt!==void 0&&Zt.render))}function Dn(xt){return!isValidElement(xt)||isFragment(xt)?!1:Ln(xt)}function sr(xt,vt,Zt,fn){if(!vt.length)return Zt;var Tn=_toArray(vt),pr=Tn[0],Ar=Tn.slice(1),Wr;return!xt&&typeof pr=="number"?Wr=[]:Array.isArray(xt)?Wr=_toConsumableArray(xt):Wr=_objectSpread({},xt),fn&&Zt===void 0&&Ar.length===1?delete Wr[pr][Ar[0]]:Wr[pr]=sr(Wr[pr],Ar,Zt,fn),Wr}function nr(xt,vt,Zt){var fn=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return vt.length&&fn&&Zt===void 0&&!get(xt,vt.slice(0,-1))?xt:sr(xt,vt,Zt,fn)}function gr(xt){return _typeof(xt)==="object"&&xt!==null&&Object.getPrototypeOf(xt)===Object.prototype}function Fn(xt){return Array.isArray(xt)?[]:{}}var Xe=typeof Reflect=="undefined"?Object.keys:Reflect.ownKeys;function ut(){for(var xt=arguments.length,vt=new Array(xt),Zt=0;Zt<xt;Zt++)vt[Zt]=arguments[Zt];var fn=Fn(vt[0]);return vt.forEach(function(Tn){function pr(Ar,Wr){var Vr=new Set(Wr),Hr=get(Tn,Ar),ti=Array.isArray(Hr);if(ti||gr(Hr)){if(!Vr.has(Hr)){Vr.add(Hr);var yi=get(fn,Ar);ti?fn=nr(fn,Ar,[]):(!yi||_typeof(yi)!=="object")&&(fn=nr(fn,Ar,Fn(Hr))),Xe(Hr).forEach(function(Lr){pr([].concat(_toConsumableArray(Ar),[Lr]),Vr)})}}else fn=nr(fn,Ar,Hr)}pr([])}),fn}var Lt={},Jt=[],We=function(vt){Jt.push(vt)};function mt(xt,vt){if(0)var Zt}function zt(xt,vt){if(0)var Zt}function Ot(){Lt={}}function Vt(xt,vt,Zt){!vt&&!Lt[Zt]&&(xt(!1,Zt),Lt[Zt]=!0)}function Yt(xt,vt){Vt(mt,xt,vt)}function Hn(xt,vt){Vt(zt,xt,vt)}Yt.preMessage=We,Yt.resetWarned=Ot,Yt.noteOnce=Hn;var _r=Yt,Qn=function(vt){var Zt=vt.prefixCls,fn=vt.className,Tn=vt.style,pr=vt.children,Ar=vt.containerRef,Wr=vt.id,Vr=vt.onMouseEnter,Hr=vt.onMouseOver,ti=vt.onMouseLeave,yi=vt.onClick,Lr=vt.onKeyDown,hi=vt.onKeyUp,Ai={onMouseEnter:Vr,onMouseOver:Hr,onMouseLeave:ti,onClick:yi,onKeyDown:Lr,onKeyUp:hi},Mi=ve.useContext(Cr),Le=Mi.panel,Fe=Cn(Le,Ar);return ve.createElement(ve.Fragment,null,ve.createElement("div",(0,Vn.Z)({id:Wr,className:He()("".concat(Zt,"-content"),fn),style:(0,Re.Z)({},Tn),"aria-modal":"true",role:"dialog",ref:Fe},Ai),pr))},qn=Qn;function or(xt){return typeof xt=="string"&&String(Number(xt))===xt?(_r(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(xt)):xt}function lr(xt){warning(!("wrapperClassName"in xt),"'wrapperClassName' is removed. Please use 'rootClassName' instead."),warning(canUseDom()||!xt.open,"Drawer with 'open' in SSR is not work since no place to createPortal. Please move to 'useEffect' instead.")}var ht={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function st(xt,vt){var Zt,fn,Tn,pr,Ar=xt.prefixCls,Wr=xt.open,Vr=xt.placement,Hr=xt.inline,ti=xt.push,yi=xt.forceRender,Lr=xt.autoFocus,hi=xt.keyboard,Ai=xt.rootClassName,Mi=xt.rootStyle,Le=xt.zIndex,Fe=xt.className,ze=xt.id,Ze=xt.style,et=xt.motion,lt=xt.width,wt=xt.height,Qt=xt.children,sn=xt.contentWrapperStyle,Xn=xt.mask,vr=xt.maskClosable,Zn=xt.maskMotion,xn=xt.maskClassName,gn=xt.maskStyle,An=xt.afterOpenChange,Bn=xt.onClose,fr=xt.onMouseEnter,Gn=xt.onMouseOver,jn=xt.onMouseLeave,er=xt.onClick,tr=xt.onKeyDown,yr=xt.onKeyUp,Oe=ve.useRef(),Ke=ve.useRef(),Mt=ve.useRef();ve.useImperativeHandle(vt,function(){return Oe.current});var ct=function(Fr){var Qr=Fr.keyCode,si=Fr.shiftKey;switch(Qr){case $t.TAB:{if(Qr===$t.TAB){if(!si&&document.activeElement===Mt.current){var Nr;(Nr=Ke.current)===null||Nr===void 0||Nr.focus({preventScroll:!0})}else if(si&&document.activeElement===Ke.current){var di;(di=Mt.current)===null||di===void 0||di.focus({preventScroll:!0})}}break}case $t.ESC:{Bn&&hi&&(Fr.stopPropagation(),Bn(Fr));break}}};ve.useEffect(function(){if(Wr&&Lr){var Er;(Er=Oe.current)===null||Er===void 0||Er.focus({preventScroll:!0})}},[Wr]);var Ft=ve.useState(!1),un=(0,Ve.Z)(Ft,2),vn=un[0],Nn=un[1],kn=ve.useContext(Bt),on;ti===!1?on={distance:0}:ti===!0?on={}:on=ti||{};var zn=(Zt=(fn=(Tn=on)===null||Tn===void 0?void 0:Tn.distance)!==null&&fn!==void 0?fn:kn==null?void 0:kn.pushDistance)!==null&&Zt!==void 0?Zt:180,Wn=ve.useMemo(function(){return{pushDistance:zn,push:function(){Nn(!0)},pull:function(){Nn(!1)}}},[zn]);ve.useEffect(function(){if(Wr){var Er;kn==null||(Er=kn.push)===null||Er===void 0||Er.call(kn)}else{var Fr;kn==null||(Fr=kn.pull)===null||Fr===void 0||Fr.call(kn)}},[Wr]),ve.useEffect(function(){return function(){var Er;kn==null||(Er=kn.pull)===null||Er===void 0||Er.call(kn)}},[]);var xr=Xn&&ve.createElement(br.Z,(0,Vn.Z)({key:"mask"},Zn,{visible:Wr}),function(Er,Fr){var Qr=Er.className,si=Er.style;return ve.createElement("div",{className:He()("".concat(Ar,"-mask"),Qr,xn),style:(0,Re.Z)((0,Re.Z)({},si),gn),onClick:vr&&Wr?Bn:void 0,ref:Fr})}),Kn=typeof et=="function"?et(Vr):et,Pr={};if(vn&&zn)switch(Vr){case"top":Pr.transform="translateY(".concat(zn,"px)");break;case"bottom":Pr.transform="translateY(".concat(-zn,"px)");break;case"left":Pr.transform="translateX(".concat(zn,"px)");break;default:Pr.transform="translateX(".concat(-zn,"px)");break}Vr==="left"||Vr==="right"?Pr.width=or(lt):Pr.height=or(wt);var Xr={onMouseEnter:fr,onMouseOver:Gn,onMouseLeave:jn,onClick:er,onKeyDown:tr,onKeyUp:yr},Rr=ve.createElement(br.Z,(0,Vn.Z)({key:"panel"},Kn,{visible:Wr,forceRender:yi,onVisibleChanged:function(Fr){An==null||An(Fr)},removeOnLeave:!1,leavedClassName:"".concat(Ar,"-content-wrapper-hidden")}),function(Er,Fr){var Qr=Er.className,si=Er.style;return ve.createElement("div",(0,Vn.Z)({className:He()("".concat(Ar,"-content-wrapper"),Qr),style:(0,Re.Z)((0,Re.Z)((0,Re.Z)({},Pr),si),sn)},Kr(xt,{data:!0})),ve.createElement(qn,(0,Vn.Z)({id:ze,containerRef:Fr,prefixCls:Ar,className:Fe,style:Ze},Xr),Qt))}),Ur=(0,Re.Z)({},Mi);return Le&&(Ur.zIndex=Le),ve.createElement(Bt.Provider,{value:Wn},ve.createElement("div",{className:He()(Ar,"".concat(Ar,"-").concat(Vr),Ai,(pr={},(0,Mn.Z)(pr,"".concat(Ar,"-open"),Wr),(0,Mn.Z)(pr,"".concat(Ar,"-inline"),Hr),pr)),style:Ur,tabIndex:-1,ref:Oe,onKeyDown:ct},xr,ve.createElement("div",{tabIndex:0,ref:Ke,style:ht,"aria-hidden":"true","data-sentinel":"start"}),Rr,ve.createElement("div",{tabIndex:0,ref:Mt,style:ht,"aria-hidden":"true","data-sentinel":"end"})))}var bt=ve.forwardRef(st),ln=bt,Pn=function(vt){var Zt=vt.open,fn=Zt===void 0?!1:Zt,Tn=vt.prefixCls,pr=Tn===void 0?"rc-drawer":Tn,Ar=vt.placement,Wr=Ar===void 0?"right":Ar,Vr=vt.autoFocus,Hr=Vr===void 0?!0:Vr,ti=vt.keyboard,yi=ti===void 0?!0:ti,Lr=vt.width,hi=Lr===void 0?378:Lr,Ai=vt.mask,Mi=Ai===void 0?!0:Ai,Le=vt.maskClosable,Fe=Le===void 0?!0:Le,ze=vt.getContainer,Ze=vt.forceRender,et=vt.afterOpenChange,lt=vt.destroyOnClose,wt=vt.onMouseEnter,Qt=vt.onMouseOver,sn=vt.onMouseLeave,Xn=vt.onClick,vr=vt.onKeyDown,Zn=vt.onKeyUp,xn=vt.panelRef,gn=ve.useState(!1),An=(0,Ve.Z)(gn,2),Bn=An[0],fr=An[1],Gn=ve.useState(!1),jn=(0,Ve.Z)(Gn,2),er=jn[0],tr=jn[1];jt(function(){tr(!0)},[]);var yr=er?fn:!1,Oe=ve.useRef(),Ke=ve.useRef();jt(function(){yr&&(Ke.current=document.activeElement)},[yr]);var Mt=function(Nn){var kn;if(fr(Nn),et==null||et(Nn),!Nn&&Ke.current&&!((kn=Oe.current)!==null&&kn!==void 0&&kn.contains(Ke.current))){var on;(on=Ke.current)===null||on===void 0||on.focus({preventScroll:!0})}},ct=ve.useMemo(function(){return{panel:xn}},[xn]);if(!Ze&&!Bn&&!yr&&lt)return null;var Ft={onMouseEnter:wt,onMouseOver:Qt,onMouseLeave:sn,onClick:Xn,onKeyDown:vr,onKeyUp:Zn},un=(0,Re.Z)((0,Re.Z)({},vt),{},{open:yr,prefixCls:pr,placement:Wr,autoFocus:Hr,keyboard:yi,width:hi,mask:Mi,maskClosable:Fe,inline:ze===!1,afterOpenChange:Mt,ref:Oe},Ft);return ve.createElement(Cr.Provider,{value:ct},ve.createElement(Qe,{open:yr||Ze||Bn,autoDestroy:!1,getContainer:ze,autoLock:Mi&&(yr||Bn)},ve.createElement(ln,un)))},cn=Pn,pn=cn,mn=se(33603),On=se(53124),cr=se(65223),Gt=se(69760),Zr=xt=>{const{prefixCls:vt,title:Zt,footer:fn,extra:Tn,closeIcon:pr,closable:Ar,onClose:Wr,headerStyle:Vr,drawerStyle:Hr,bodyStyle:ti,footerStyle:yi,children:Lr}=xt,hi=ve.useCallback(ze=>ve.createElement("button",{type:"button",onClick:Wr,"aria-label":"Close",className:`${vt}-close`},ze),[Wr]),[Ai,Mi]=(0,Gt.Z)(Ar,pr,hi,void 0,!0),Le=ve.useMemo(()=>!Zt&&!Ai?null:ve.createElement("div",{style:Vr,className:He()(`${vt}-header`,{[`${vt}-header-close-only`]:Ai&&!Zt&&!Tn})},ve.createElement("div",{className:`${vt}-header-title`},Mi,Zt&&ve.createElement("div",{className:`${vt}-title`},Zt)),Tn&&ve.createElement("div",{className:`${vt}-extra`},Tn)),[Ai,Mi,Tn,Vr,vt,Zt]),Fe=ve.useMemo(()=>{if(!fn)return null;const ze=`${vt}-footer`;return ve.createElement("div",{className:ze,style:yi},fn)},[fn,yi,vt]);return ve.createElement("div",{className:`${vt}-wrapper-body`,style:Hr},Le,ve.createElement("div",{className:`${vt}-body`,style:ti},Lr),Fe)},Bi=se(4173),Li=se(67968),gi=se(45503),xi=xt=>{const{componentCls:vt,motionDurationSlow:Zt}=xt,fn={"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${Zt}`}}};return{[vt]:{[`${vt}-mask-motion`]:{"&-enter, &-appear, &-leave":{"&-active":{transition:`all ${Zt}`}},"&-enter, &-appear":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}}},[`${vt}-panel-motion`]:{"&-left":[fn,{"&-enter, &-appear":{"&-start":{transform:"translateX(-100%) !important"},"&-active":{transform:"translateX(0)"}},"&-leave":{transform:"translateX(0)","&-active":{transform:"translateX(-100%)"}}}],"&-right":[fn,{"&-enter, &-appear":{"&-start":{transform:"translateX(100%) !important"},"&-active":{transform:"translateX(0)"}},"&-leave":{transform:"translateX(0)","&-active":{transform:"translateX(100%)"}}}],"&-top":[fn,{"&-enter, &-appear":{"&-start":{transform:"translateY(-100%) !important"},"&-active":{transform:"translateY(0)"}},"&-leave":{transform:"translateY(0)","&-active":{transform:"translateY(-100%)"}}}],"&-bottom":[fn,{"&-enter, &-appear":{"&-start":{transform:"translateY(100%) !important"},"&-active":{transform:"translateY(0)"}},"&-leave":{transform:"translateY(0)","&-active":{transform:"translateY(100%)"}}}]}}}};const oi=xt=>{const{componentCls:vt,zIndexPopup:Zt,colorBgMask:fn,colorBgElevated:Tn,motionDurationSlow:pr,motionDurationMid:Ar,padding:Wr,paddingLG:Vr,fontSizeLG:Hr,lineHeightLG:ti,lineWidth:yi,lineType:Lr,colorSplit:hi,marginSM:Ai,colorIcon:Mi,colorIconHover:Le,colorText:Fe,fontWeightStrong:ze,footerPaddingBlock:Ze,footerPaddingInline:et}=xt,lt=`${vt}-content-wrapper`;return{[vt]:{position:"fixed",inset:0,zIndex:Zt,pointerEvents:"none","&-pure":{position:"relative",background:Tn,[`&${vt}-left`]:{boxShadow:xt.boxShadowDrawerLeft},[`&${vt}-right`]:{boxShadow:xt.boxShadowDrawerRight},[`&${vt}-top`]:{boxShadow:xt.boxShadowDrawerUp},[`&${vt}-bottom`]:{boxShadow:xt.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${vt}-mask`]:{position:"absolute",inset:0,zIndex:Zt,background:fn,pointerEvents:"auto"},[lt]:{position:"absolute",zIndex:Zt,maxWidth:"100vw",transition:`all ${pr}`,"&-hidden":{display:"none"}},[`&-left > ${lt}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:xt.boxShadowDrawerLeft},[`&-right > ${lt}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:xt.boxShadowDrawerRight},[`&-top > ${lt}`]:{top:0,insetInline:0,boxShadow:xt.boxShadowDrawerUp},[`&-bottom > ${lt}`]:{bottom:0,insetInline:0,boxShadow:xt.boxShadowDrawerDown},[`${vt}-content`]:{width:"100%",height:"100%",overflow:"auto",background:Tn,pointerEvents:"auto"},[`${vt}-wrapper-body`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%"},[`${vt}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${Wr}px ${Vr}px`,fontSize:Hr,lineHeight:ti,borderBottom:`${yi}px ${Lr} ${hi}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${vt}-extra`]:{flex:"none"},[`${vt}-close`]:{display:"inline-block",marginInlineEnd:Ai,color:Mi,fontWeight:ze,fontSize:Hr,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,outline:0,cursor:"pointer",transition:`color ${Ar}`,textRendering:"auto","&:focus, &:hover":{color:Le,textDecoration:"none"}},[`${vt}-title`]:{flex:1,margin:0,color:Fe,fontWeight:xt.fontWeightStrong,fontSize:Hr,lineHeight:ti},[`${vt}-body`]:{flex:1,minWidth:0,minHeight:0,padding:Vr,overflow:"auto"},[`${vt}-footer`]:{flexShrink:0,padding:`${Ze}px ${et}px`,borderTop:`${yi}px ${Lr} ${hi}`},"&-rtl":{direction:"rtl"}}}};var Ri=(0,Li.Z)("Drawer",xt=>{const vt=(0,gi.TS)(xt,{});return[oi(vt),xi(vt)]},xt=>({zIndexPopup:xt.zIndexPopupBase,footerPaddingBlock:xt.paddingXS,footerPaddingInline:xt.padding})),ji=se(16569),Yr=function(xt,vt){var Zt={};for(var fn in xt)Object.prototype.hasOwnProperty.call(xt,fn)&&vt.indexOf(fn)<0&&(Zt[fn]=xt[fn]);if(xt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Tn=0,fn=Object.getOwnPropertySymbols(xt);Tn<fn.length;Tn++)vt.indexOf(fn[Tn])<0&&Object.prototype.propertyIsEnumerable.call(xt,fn[Tn])&&(Zt[fn[Tn]]=xt[fn[Tn]]);return Zt};const vi=null,Wi={distance:180},la=xt=>{var vt;const{rootClassName:Zt,width:fn,height:Tn,size:pr="default",mask:Ar=!0,push:Wr=Wi,open:Vr,afterOpenChange:Hr,onClose:ti,prefixCls:yi,getContainer:Lr,style:hi,className:Ai,visible:Mi,afterVisibleChange:Le}=xt,Fe=Yr(xt,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","style","className","visible","afterVisibleChange"]),{getPopupContainer:ze,getPrefixCls:Ze,direction:et,drawer:lt}=ve.useContext(On.E_),wt=Ze("drawer",yi),[Qt,sn]=Ri(wt),Xn=Lr===void 0&&ze?()=>ze(document.body):Lr,vr=He()({"no-mask":!Ar,[`${wt}-rtl`]:et==="rtl"},Zt,sn),Zn=ve.useMemo(()=>fn!=null?fn:pr==="large"?736:378,[fn,pr]),xn=ve.useMemo(()=>Tn!=null?Tn:pr==="large"?736:378,[Tn,pr]),gn={motionName:(0,mn.m)(wt,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},An=fr=>({motionName:(0,mn.m)(wt,`panel-motion-${fr}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500}),Bn=(0,ji.H)();return Qt(ve.createElement(Bi.BR,null,ve.createElement(cr.Ux,{status:!0,override:!0},ve.createElement(pn,Object.assign({prefixCls:wt,onClose:ti,maskMotion:gn,motion:An},Fe,{open:Vr!=null?Vr:Mi,mask:Ar,push:Wr,width:Zn,height:xn,style:Object.assign(Object.assign({},lt==null?void 0:lt.style),hi),className:He()(lt==null?void 0:lt.className,Ai),rootClassName:vr,getContainer:Xn,afterOpenChange:Hr!=null?Hr:Le,panelRef:Bn}),ve.createElement(Zr,Object.assign({prefixCls:wt},Fe,{onClose:ti}))))))},ta=xt=>{const{prefixCls:vt,style:Zt,className:fn,placement:Tn="right"}=xt,pr=Yr(xt,["prefixCls","style","className","placement"]),{getPrefixCls:Ar}=ve.useContext(On.E_),Wr=Ar("drawer",vt),[Vr,Hr]=Ri(Wr),ti=He()(Wr,`${Wr}-pure`,`${Wr}-${Tn}`,Hr,fn);return Vr(ve.createElement("div",{className:ti,style:Zt},ve.createElement(Zr,Object.assign({prefixCls:Wr},pr))))};la._InternalPanelDoNotUseOrYouWillBeFired=ta;var ri=la},32983:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return rt}});var he=se(94184),He=se.n(he),Re=se(67294),Ve=se(53124),ve=se(10110),_e=se(84780),ke=se(29691),me=()=>{const[,ft]=(0,ke.Z)(),xe=new _e.C(ft.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return Re.createElement("svg",{style:xe,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},Re.createElement("g",{fill:"none",fillRule:"evenodd"},Re.createElement("g",{transform:"translate(24 31.67)"},Re.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),Re.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"}),Re.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)"}),Re.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"}),Re.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"})),Re.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"}),Re.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},Re.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),Re.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},tt=()=>{const[,ft]=(0,ke.Z)(),{colorFill:Ie,colorFillTertiary:xe,colorFillQuaternary:Ue,colorBgContainer:je}=ft,{borderColor:_t,shadowColor:Ct,contentColor:Dt}=(0,Re.useMemo)(()=>({borderColor:new _e.C(Ie).onBackground(je).toHexShortString(),shadowColor:new _e.C(xe).onBackground(je).toHexShortString(),contentColor:new _e.C(Ue).onBackground(je).toHexShortString()}),[Ie,xe,Ue,je]);return Re.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},Re.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},Re.createElement("ellipse",{fill:Ct,cx:"32",cy:"33",rx:"32",ry:"7"}),Re.createElement("g",{fillRule:"nonzero",stroke:_t},Re.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"}),Re.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}))))},Be=se(67968),St=se(45503);const dt=ft=>{const{componentCls:Ie,margin:xe,marginXS:Ue,marginXL:je,fontSize:_t,lineHeight:Ct}=ft;return{[Ie]:{marginInline:Ue,fontSize:_t,lineHeight:Ct,textAlign:"center",[`${Ie}-image`]:{height:ft.emptyImgHeight,marginBottom:Ue,opacity:ft.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${Ie}-description`]:{color:ft.colorText},[`${Ie}-footer`]:{marginTop:xe},"&-normal":{marginBlock:je,color:ft.colorTextDisabled,[`${Ie}-description`]:{color:ft.colorTextDisabled},[`${Ie}-image`]:{height:ft.emptyImgHeightMD}},"&-small":{marginBlock:Ue,color:ft.colorTextDisabled,[`${Ie}-image`]:{height:ft.emptyImgHeightSM}}}}};var it=(0,Be.Z)("Empty",ft=>{const{componentCls:Ie,controlHeightLG:xe}=ft,Ue=(0,St.TS)(ft,{emptyImgCls:`${Ie}-img`,emptyImgHeight:xe*2.5,emptyImgHeightMD:xe,emptyImgHeightSM:xe*.875});return[dt(Ue)]}),Ge=function(ft,Ie){var xe={};for(var Ue in ft)Object.prototype.hasOwnProperty.call(ft,Ue)&&Ie.indexOf(Ue)<0&&(xe[Ue]=ft[Ue]);if(ft!=null&&typeof Object.getOwnPropertySymbols=="function")for(var je=0,Ue=Object.getOwnPropertySymbols(ft);je<Ue.length;je++)Ie.indexOf(Ue[je])<0&&Object.prototype.propertyIsEnumerable.call(ft,Ue[je])&&(xe[Ue[je]]=ft[Ue[je]]);return xe};const De=Re.createElement(me,null),At=Re.createElement(tt,null),Xt=ft=>{var{className:Ie,rootClassName:xe,prefixCls:Ue,image:je=De,description:_t,children:Ct,imageStyle:Dt,style:qe}=ft,Rt=Ge(ft,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);const{getPrefixCls:Pt,direction:En,empty:tn}=Re.useContext(Ve.E_),$n=Pt("empty",Ue),[ur,wr]=it($n),[Je]=(0,ve.Z)("Empty"),Ae=typeof _t!="undefined"?_t:Je==null?void 0:Je.description,Ht=typeof Ae=="string"?Ae:"empty";let Rn=null;return typeof je=="string"?Rn=Re.createElement("img",{alt:Ht,src:je}):Rn=je,ur(Re.createElement("div",Object.assign({className:He()(wr,$n,tn==null?void 0:tn.className,{[`${$n}-normal`]:je===At,[`${$n}-rtl`]:En==="rtl"},Ie,xe),style:Object.assign(Object.assign({},tn==null?void 0:tn.style),qe)},Rt),Re.createElement("div",{className:`${$n}-image`,style:Dt},Rn),Ae&&Re.createElement("div",{className:`${$n}-description`},Ae),Ct&&Re.createElement("div",{className:`${$n}-footer`},Ct)))};Xt.PRESENTED_IMAGE_DEFAULT=De,Xt.PRESENTED_IMAGE_SIMPLE=At;var rt=Xt},22150:function(Sn,Wt,se){"use strict";se.d(Wt,{default:function(){return Jt}});var he=se(74902),He=se(94184),Re=se.n(He),Ve=se(38379),ve=se(67294),_e=se(33603),ke=se(65223);function Se(We){const[mt,zt]=ve.useState(We);return ve.useEffect(()=>{const Ot=setTimeout(()=>{zt(We)},We.length?0:10);return()=>{clearTimeout(Ot)}},[We]),mt}var me=se(14747),Ee=se(50438),tt=se(33507),Be=se(45503),St=se(67968),it=We=>{const{componentCls:mt}=We,zt=`${mt}-show-help`,Ot=`${mt}-show-help-item`;return{[zt]:{transition:`opacity ${We.motionDurationSlow} ${We.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[Ot]:{overflow:"hidden",transition:`height ${We.motionDurationSlow} ${We.motionEaseInOut},
opacity ${We.motionDurationSlow} ${We.motionEaseInOut},
transform ${We.motionDurationSlow} ${We.motionEaseInOut} !important`,[`&${Ot}-appear, &${Ot}-enter`]:{transform:"translateY(-5px)",opacity:0,"&-active":{transform:"translateY(0)",opacity:1}},[`&${Ot}-leave-active`]:{transform:"translateY(-5px)"}}}}};const Ge=We=>({legend:{display:"block",width:"100%",marginBottom:We.marginLG,padding:0,color:We.colorTextDescription,fontSize:We.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:`${We.lineWidth}px ${We.lineType} ${We.colorBorder}`},label:{fontSize:We.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 ${We.controlOutlineWidth}px ${We.controlOutline}`},output:{display:"block",paddingTop:15,color:We.colorText,fontSize:We.fontSize,lineHeight:We.lineHeight}}),De=(We,mt)=>{const{formItemCls:zt}=We;return{[zt]:{[`${zt}-label > label`]:{height:mt},[`${zt}-control-input`]:{minHeight:mt}}}},At=We=>{const{componentCls:mt}=We;return{[We.componentCls]:Object.assign(Object.assign(Object.assign({},(0,me.Wf)(We)),Ge(We)),{[`${mt}-text`]:{display:"inline-block",paddingInlineEnd:We.paddingSM},"&-small":Object.assign({},De(We,We.controlHeightSM)),"&-large":Object.assign({},De(We,We.controlHeightLG))})}},Xt=We=>{const{formItemCls:mt,iconCls:zt,componentCls:Ot,rootPrefixCls:Vt,labelRequiredMarkColor:Yt,labelColor:Hn,labelFontSize:_r,labelHeight:Qn,labelColonMarginInlineStart:qn,labelColonMarginInlineEnd:or,itemMarginBottom:lr}=We;return{[mt]:Object.assign(Object.assign({},(0,me.Wf)(We)),{marginBottom:lr,verticalAlign:"top","&-with-help":{transition:"none"},[`&-hidden,
&-hidden.${Vt}-row`]:{display:"none"},"&-has-warning":{[`${mt}-split`]:{color:We.colorError}},"&-has-error":{[`${mt}-split`]:{color:We.colorWarning}},[`${mt}-label`]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:`${We.lineHeight} - 0.25em`,whiteSpace:"unset"},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:Qn,color:Hn,fontSize:_r,[`> ${zt}`]:{fontSize:We.fontSize,verticalAlign:"top"},[`&${mt}-required:not(${mt}-required-mark-optional)::before`]:{display:"inline-block",marginInlineEnd:We.marginXXS,color:Yt,fontSize:We.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"',[`${Ot}-hide-required-mark &`]:{display:"none"}},[`${mt}-optional`]:{display:"inline-block",marginInlineStart:We.marginXXS,color:We.colorTextDescription,[`${Ot}-hide-required-mark &`]:{display:"none"}},[`${mt}-tooltip`]:{color:We.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:We.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:qn,marginInlineEnd:or},[`&${mt}-no-colon::after`]:{content:'"\\a0"'}}},[`${mt}-control`]:{"--ant-display":"flex",flexDirection:"column",flexGrow:1,[`&:first-child:not([class^="'${Vt}-col-'"]):not([class*="' ${Vt}-col-'"])`]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:We.controlHeight,"&-content":{flex:"auto",maxWidth:"100%"}}},[mt]:{"&-explain, &-extra":{clear:"both",color:We.colorTextDescription,fontSize:We.fontSize,lineHeight:We.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:We.controlHeightSM,transition:`color ${We.motionDurationMid} ${We.motionEaseOut}`},"&-explain":{"&-error":{color:We.colorError},"&-warning":{color:We.colorWarning}}},[`&-with-help ${mt}-explain`]:{height:"auto",opacity:1},[`${mt}-feedback-icon`]:{fontSize:We.fontSize,textAlign:"center",visibility:"visible",animationName:Ee.kr,animationDuration:We.motionDurationMid,animationTimingFunction:We.motionEaseOutBack,pointerEvents:"none","&-success":{color:We.colorSuccess},"&-error":{color:We.colorError},"&-warning":{color:We.colorWarning},"&-validating":{color:We.colorPrimary}}})}},rt=We=>{const{componentCls:mt,formItemCls:zt}=We;return{[`${mt}-horizontal`]:{[`${zt}-label`]:{flexGrow:0},[`${zt}-control`]:{flex:"1 1 0",minWidth:0},[`${zt}-label[class$='-24'], ${zt}-label[class*='-24 ']`]:{[`& + ${zt}-control`]:{minWidth:"unset"}}}}},ft=We=>{const{componentCls:mt,formItemCls:zt}=We;return{[`${mt}-inline`]:{display:"flex",flexWrap:"wrap",[zt]:{flex:"none",marginInlineEnd:We.margin,marginBottom:0,"&-row":{flexWrap:"nowrap"},[`> ${zt}-label,
> ${zt}-control`]:{display:"inline-block",verticalAlign:"top"},[`> ${zt}-label`]:{flex:"none"},[`${mt}-text`]:{display:"inline-block"},[`${zt}-has-feedback`]:{display:"inline-block"}}}}},Ie=We=>({padding:We.verticalLabelPadding,margin:We.verticalLabelMargin,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{visibility:"hidden"}}}),xe=We=>{const{componentCls:mt,formItemCls:zt,rootPrefixCls:Ot}=We;return{[`${zt} ${zt}-label`]:Ie(We),[mt]:{[zt]:{flexWrap:"wrap",[`${zt}-label, ${zt}-control`]:{[`&:not([class*=" ${Ot}-col-xs"])`]:{flex:"0 0 100%",maxWidth:"100%"}}}}}},Ue=We=>{const{componentCls:mt,formItemCls:zt,rootPrefixCls:Ot}=We;return{[`${mt}-vertical`]:{[zt]:{"&-row":{flexDirection:"column"},"&-label > label":{height:"auto"},[`${mt}-item-control`]:{width:"100%"}}},[`${mt}-vertical ${zt}-label,
.${Ot}-col-24${zt}-label,
.${Ot}-col-xl-24${zt}-label`]:Ie(We),[`@media (max-width: ${We.screenXSMax}px)`]:[xe(We),{[mt]:{[`.${Ot}-col-xs-24${zt}-label`]:Ie(We)}}],[`@media (max-width: ${We.screenSMMax}px)`]:{[mt]:{[`.${Ot}-col-sm-24${zt}-label`]:Ie(We)}},[`@media (max-width: ${We.screenMDMax}px)`]:{[mt]:{[`.${Ot}-col-md-24${zt}-label`]:Ie(We)}},[`@media (max-width: ${We.screenLGMax}px)`]:{[mt]:{[`.${Ot}-col-lg-24${zt}-label`]:Ie(We)}}}},je=(We,mt)=>(0,Be.TS)(We,{formItemCls:`${We.componentCls}-item`,rootPrefixCls:mt});var _t=(0,St.Z)("Form",(We,mt)=>{let{rootPrefixCls:zt}=mt;const Ot=je(We,zt);return[At(Ot),Xt(Ot),it(Ot),rt(Ot),ft(Ot),Ue(Ot),(0,tt.Z)(Ot),Ee.kr]},We=>({labelRequiredMarkColor:We.colorError,labelColor:We.colorTextHeading,labelFontSize:We.fontSize,labelHeight:We.controlHeight,labelColonMarginInlineStart:We.marginXXS/2,labelColonMarginInlineEnd:We.marginXS,itemMarginBottom:We.marginLG,verticalLabelPadding:`0 0 ${We.paddingXS}px`,verticalLabelMargin:0}),{order:-1e3});const Ct=[];function Dt(We,mt,zt){let Ot=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return{key:typeof We=="string"?We:`${mt}-${Ot}`,error:We,errorStatus:zt}}var Rt=We=>{let{help:mt,helpStatus:zt,errors:Ot=Ct,warnings:Vt=Ct,className:Yt,fieldId:Hn,onVisibleChanged:_r}=We;const{prefixCls:Qn}=ve.useContext(ke.Rk),qn=`${Qn}-item-explain`,[,or]=_t(Qn),lr=(0,ve.useMemo)(()=>(0,_e.Z)(Qn),[Qn]),ht=Se(Ot),st=Se(Vt),bt=ve.useMemo(()=>mt!=null?[Dt(mt,"help",zt)]:[].concat((0,he.Z)(ht.map((Pn,cn)=>Dt(Pn,"error","error",cn))),(0,he.Z)(st.map((Pn,cn)=>Dt(Pn,"warning","warning",cn)))),[mt,zt,ht,st]),ln={};return Hn&&(ln.id=`${Hn}_help`),ve.createElement(Ve.default,{motionDeadline:lr.motionDeadline,motionName:`${Qn}-show-help`,visible:!!bt.length,onVisibleChanged:_r},Pn=>{const{className:cn,style:pn}=Pn;return ve.createElement("div",Object.assign({},ln,{className:Re()(qn,cn,Yt,or),style:pn,role:"alert"}),ve.createElement(Ve.CSSMotionList,Object.assign({keys:bt},(0,_e.Z)(Qn),{motionName:`${Qn}-show-help-item`,component:!1}),mn=>{const{key:On,error:cr,errorStatus:Gt,className:Jr,style:Zr}=mn;return ve.createElement("div",{key:On,className:Re()(Jr,{[`${qn}-${Gt}`]:Gt}),style:Zr},cr)}))})},Pt=se(46660),En=se(53124),tn=se(98866),$n=se(97647),ur=se(98675),wr=se(17423);const Je=["parentNode"],Ae="form_item";function Ht(We){return We===void 0||We===!1?[]:Array.isArray(We)?We:[We]}function Rn(We,mt){if(!We.length)return;const zt=We.join("_");return mt?`${mt}_${zt}`:Je.includes(zt)?`${Ae}_${zt}`:zt}function yn(We,mt,zt,Ot,Vt,Yt){let Hn=Ot;return Yt!==void 0?Hn=Yt:zt.validating?Hn="validating":We.length?Hn="error":mt.length?Hn="warning":(zt.touched||Vt&&zt.validated)&&(Hn="success"),Hn}function ot(We){return Ht(We).join("_")}function nt(We){const[mt]=(0,Pt.useForm)(),zt=ve.useRef({}),Ot=ve.useMemo(()=>We!=null?We:Object.assign(Object.assign({},mt),{__INTERNAL__:{itemRef:Vt=>Yt=>{const Hn=ot(Vt);Yt?zt.current[Hn]=Yt:delete zt.current[Hn]}},scrollToField:function(Vt){let Yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const Hn=Ht(Vt),_r=Rn(Hn,Ot.__INTERNAL__.name),Qn=_r?document.getElementById(_r):null;Qn&&(0,wr.Z)(Qn,Object.assign({scrollMode:"if-needed",block:"nearest"},Yt))},getFieldInstance:Vt=>{const Yt=ot(Vt);return zt.current[Yt]}}),[We,mt]);return[Ot]}var Tt=se(37920),rn=function(We,mt){var zt={};for(var Ot in We)Object.prototype.hasOwnProperty.call(We,Ot)&&mt.indexOf(Ot)<0&&(zt[Ot]=We[Ot]);if(We!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Vt=0,Ot=Object.getOwnPropertySymbols(We);Vt<Ot.length;Vt++)mt.indexOf(Ot[Vt])<0&&Object.prototype.propertyIsEnumerable.call(We,Ot[Vt])&&(zt[Ot[Vt]]=We[Ot[Vt]]);return zt};const dn=(We,mt)=>{const zt=ve.useContext(tn.Z),{getPrefixCls:Ot,direction:Vt,form:Yt}=ve.useContext(En.E_),{prefixCls:Hn,className:_r,rootClassName:Qn,size:qn,disabled:or=zt,form:lr,colon:ht,labelAlign:st,labelWrap:bt,labelCol:ln,wrapperCol:Pn,hideRequiredMark:cn,layout:pn="horizontal",scrollToFirstError:mn,requiredMark:On,onFinishFailed:cr,name:Gt,style:Jr,feedbackIcons:Zr}=We,Bi=rn(We,["prefixCls","className","rootClassName","size","disabled","form","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","style","feedbackIcons"]),Li=(0,ur.Z)(qn),gi=ve.useContext(Tt.Z),Yi=(0,ve.useMemo)(()=>On!==void 0?On:Yt&&Yt.requiredMark!==void 0?Yt.requiredMark:!cn,[cn,On,Yt]),xi=ht!=null?ht:Yt==null?void 0:Yt.colon,oi=Ot("form",Hn),[Ri,ji]=_t(oi),Yr=Re()(oi,`${oi}-${pn}`,{[`${oi}-hide-required-mark`]:Yi===!1,[`${oi}-rtl`]:Vt==="rtl",[`${oi}-${Li}`]:Li},ji,Yt==null?void 0:Yt.className,_r,Qn),[vi]=nt(lr),{__INTERNAL__:Wi}=vi;Wi.name=Gt;const la=(0,ve.useMemo)(()=>({name:Gt,labelAlign:st,labelCol:ln,labelWrap:bt,wrapperCol:Pn,vertical:pn==="vertical",colon:xi,requiredMark:Yi,itemRef:Wi.itemRef,form:vi,feedbackIcons:Zr}),[Gt,st,ln,Pn,pn,xi,Yi,vi,Zr]);ve.useImperativeHandle(mt,()=>vi);const ta=(xt,vt)=>{if(xt){let Zt={block:"nearest"};typeof xt=="object"&&(Zt=xt),vi.scrollToField(vt,Zt)}},ri=xt=>{if(cr==null||cr(xt),xt.errorFields.length){const vt=xt.errorFields[0].name;if(mn!==void 0){ta(mn,vt);return}Yt&&Yt.scrollToFirstError!==void 0&&ta(Yt.scrollToFirstError,vt)}};return Ri(ve.createElement(tn.n,{disabled:or},ve.createElement($n.q,{size:Li},ve.createElement(ke.RV,Object.assign({},{validateMessages:gi}),ve.createElement(ke.q3.Provider,{value:la},ve.createElement(Pt.default,Object.assign({id:Gt},Bi,{name:Gt,onFinishFailed:ri,form:vi,style:Object.assign(Object.assign({},Yt==null?void 0:Yt.style),Jr),className:Yr})))))))};var Kt=ve.forwardRef(dn),bn=se(9475),nn=se(17799),we=se(96159),ue=se(37419);function oe(We){if(typeof We=="function")return We;const mt=(0,ue.Z)(We);return mt.length<=1?mt[0]:mt}const pe=()=>{const{status:We,errors:mt=[],warnings:zt=[]}=(0,ve.useContext)(ke.aM);return{status:We,errors:mt,warnings:zt}};pe.Context=ke.aM;var fe=pe,le=se(96523);function Pe(We){const[mt,zt]=ve.useState(We),Ot=(0,ve.useRef)(null),Vt=(0,ve.useRef)([]),Yt=(0,ve.useRef)(!1);ve.useEffect(()=>(Yt.current=!1,()=>{Yt.current=!0,le.Z.cancel(Ot.current),Ot.current=null}),[]);function Hn(_r){Yt.current||(Ot.current===null&&(Vt.current=[],Ot.current=(0,le.Z)(()=>{Ot.current=null,zt(Qn=>{let qn=Qn;return Vt.current.forEach(or=>{qn=or(qn)}),qn})})),Vt.current.push(_r))}return[mt,Hn]}function Qe(){const{itemRef:We}=ve.useContext(ke.q3),mt=ve.useRef({});function zt(Ot,Vt){const Yt=Vt&&typeof Vt=="object"&&Vt.ref,Hn=Ot.join("_");return(mt.current.name!==Hn||mt.current.originRef!==Yt)&&(mt.current.name=Hn,mt.current.originRef=Yt,mt.current.ref=(0,nn.sQ)(We(Ot),Yt)),mt.current.ref}return zt}var It=se(48130),Nt=se(14075),qt=se(10366),an=se(92820),jt=se(21584);const ir=We=>{const{formItemCls:mt}=We;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${mt}-control`]:{display:"flex"}}}};var Cr=(0,St.b)(["Form","item-item"],(We,mt)=>{let{rootPrefixCls:zt}=mt;const Ot=je(We,zt);return[ir(Ot)]}),Mn=We=>{const{prefixCls:mt,status:zt,wrapperCol:Ot,children:Vt,errors:Yt,warnings:Hn,_internalItemRender:_r,extra:Qn,help:qn,fieldId:or,marginBottom:lr,onErrorVisibleChanged:ht}=We,st=`${mt}-item`,bt=ve.useContext(ke.q3),ln=Ot||bt.wrapperCol||{},Pn=Re()(`${st}-control`,ln.className),cn=ve.useMemo(()=>Object.assign({},bt),[bt]);delete cn.labelCol,delete cn.wrapperCol;const pn=ve.createElement("div",{className:`${st}-control-input`},ve.createElement("div",{className:`${st}-control-input-content`},Vt)),mn=ve.useMemo(()=>({prefixCls:mt,status:zt}),[mt,zt]),On=lr!==null||Yt.length||Hn.length?ve.createElement("div",{style:{display:"flex",flexWrap:"nowrap"}},ve.createElement(ke.Rk.Provider,{value:mn},ve.createElement(Rt,{fieldId:or,errors:Yt,warnings:Hn,help:qn,helpStatus:zt,className:`${st}-explain-connected`,onVisibleChanged:ht})),!!lr&&ve.createElement("div",{style:{width:0,height:lr}})):null,cr={};or&&(cr.id=`${or}_extra`);const Gt=Qn?ve.createElement("div",Object.assign({},cr,{className:`${st}-extra`}),Qn):null,Jr=_r&&_r.mark==="pro_table_render"&&_r.render?_r.render(We,{input:pn,errorList:On,extra:Gt}):ve.createElement(ve.Fragment,null,pn,On,Gt);return ve.createElement(ke.q3.Provider,{value:cn},ve.createElement(jt.Z,Object.assign({},ln,{className:Pn}),Jr),ve.createElement(Cr,{prefixCls:mt}))},Vn=se(17663),br=se(24457),at=se(10110),$t=se(83062),In=function(We,mt){var zt={};for(var Ot in We)Object.prototype.hasOwnProperty.call(We,Ot)&&mt.indexOf(Ot)<0&&(zt[Ot]=We[Ot]);if(We!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Vt=0,Ot=Object.getOwnPropertySymbols(We);Vt<Ot.length;Vt++)mt.indexOf(Ot[Vt])<0&&Object.prototype.propertyIsEnumerable.call(We,Ot[Vt])&&(zt[Ot[Vt]]=We[Ot[Vt]]);return zt};function Jn(We){return We?typeof We=="object"&&!ve.isValidElement(We)?We:{title:We}:null}var Mr=We=>{let{prefixCls:mt,label:zt,htmlFor:Ot,labelCol:Vt,labelAlign:Yt,colon:Hn,required:_r,requiredMark:Qn,tooltip:qn}=We;var or;const[lr]=(0,at.Z)("Form"),{vertical:ht,labelAlign:st,labelCol:bt,labelWrap:ln,colon:Pn}=ve.useContext(ke.q3);if(!zt)return null;const cn=Vt||bt||{},pn=Yt||st,mn=`${mt}-item-label`,On=Re()(mn,pn==="left"&&`${mn}-left`,cn.className,{[`${mn}-wrap`]:!!ln});let cr=zt;const Gt=Hn===!0||Pn!==!1&&Hn!==!1;Gt&&!ht&&typeof zt=="string"&&zt.trim()!==""&&(cr=zt.replace(/[:|]\s*$/,""));const Zr=Jn(qn);if(Zr){const{icon:Yi=ve.createElement(Vn.Z,null)}=Zr,xi=In(Zr,["icon"]),oi=ve.createElement($t.Z,Object.assign({},xi),ve.cloneElement(Yi,{className:`${mt}-item-tooltip`,title:""}));cr=ve.createElement(ve.Fragment,null,cr,oi)}const Bi=Qn==="optional",Li=typeof Qn=="function";Li?cr=Qn(cr,{required:!!_r}):Bi&&!_r&&(cr=ve.createElement(ve.Fragment,null,cr,ve.createElement("span",{className:`${mt}-item-optional`,title:""},(lr==null?void 0:lr.optional)||((or=br.Z.Form)===null||or===void 0?void 0:or.optional))));const gi=Re()({[`${mt}-item-required`]:_r,[`${mt}-item-required-mark-optional`]:Bi||Li,[`${mt}-item-no-colon`]:!Gt});return ve.createElement(jt.Z,Object.assign({},cn,{className:On}),ve.createElement("label",{htmlFor:Ot,className:gi,title:typeof zt=="string"?zt:""},cr))},$r=se(87725),Dr=se(16646),Kr=se(87995),ni=se(3407);const hr={success:$r.Z,warning:Kr.Z,error:Dr.Z,validating:ni.Z};function mi(We){let{children:mt,errors:zt,warnings:Ot,hasFeedback:Vt,validateStatus:Yt,prefixCls:Hn,meta:_r,noStyle:Qn}=We;const qn=`${Hn}-item`,{feedbackIcons:or}=ve.useContext(ke.q3),lr=yn(zt,Ot,_r,null,!!Vt,Yt),{isFormItemInput:ht,status:st}=ve.useContext(ke.aM),bt=ve.useMemo(()=>{var ln;let Pn;if(Vt){const mn=Vt!==!0&&Vt.icons||or,On=lr&&((ln=mn==null?void 0:mn({status:lr,errors:zt,warnings:Ot}))===null||ln===void 0?void 0:ln[lr]),cr=lr&&hr[lr];Pn=On!==!1&&cr?ve.createElement("span",{className:Re()(`${qn}-feedback-icon`,`${qn}-feedback-icon-${lr}`)},On||ve.createElement(cr,null)):null}let cn=!0,pn=lr||"";return Qn&&(cn=ht,pn=(lr!=null?lr:st)||""),{status:pn,errors:zt,warnings:Ot,hasFeedback:!!Vt,feedbackIcon:Pn,isFormItemInput:cn}},[lr,Vt,Qn,ht,st]);return ve.createElement(ke.aM.Provider,{value:bt},mt)}var Ji=function(We,mt){var zt={};for(var Ot in We)Object.prototype.hasOwnProperty.call(We,Ot)&&mt.indexOf(Ot)<0&&(zt[Ot]=We[Ot]);if(We!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Vt=0,Ot=Object.getOwnPropertySymbols(We);Vt<Ot.length;Vt++)mt.indexOf(Ot[Vt])<0&&Object.prototype.propertyIsEnumerable.call(We,Ot[Vt])&&(zt[Ot[Vt]]=We[Ot[Vt]]);return zt};function Ui(We){const{prefixCls:mt,className:zt,rootClassName:Ot,style:Vt,help:Yt,errors:Hn,warnings:_r,validateStatus:Qn,meta:qn,hasFeedback:or,hidden:lr,children:ht,fieldId:st,required:bt,isRequired:ln,onSubItemMetaChange:Pn}=We,cn=Ji(We,["prefixCls","className","rootClassName","style","help","errors","warnings","validateStatus","meta","hasFeedback","hidden","children","fieldId","required","isRequired","onSubItemMetaChange"]),pn=`${mt}-item`,{requiredMark:mn}=ve.useContext(ke.q3),On=ve.useRef(null),cr=Se(Hn),Gt=Se(_r),Jr=Yt!=null,Zr=!!(Jr||Hn.length||_r.length),Bi=!!On.current&&(0,It.Z)(On.current),[Li,gi]=ve.useState(null);(0,Nt.Z)(()=>{if(Zr&&On.current){const ji=getComputedStyle(On.current);gi(parseInt(ji.marginBottom,10))}},[Zr,Bi]);const Yi=ji=>{ji||gi(null)},oi=function(){let ji=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const Yr=ji?cr:qn.errors,vi=ji?Gt:qn.warnings;return yn(Yr,vi,qn,"",!!or,Qn)}(),Ri=Re()(pn,zt,Ot,{[`${pn}-with-help`]:Jr||cr.length||Gt.length,[`${pn}-has-feedback`]:oi&&or,[`${pn}-has-success`]:oi==="success",[`${pn}-has-warning`]:oi==="warning",[`${pn}-has-error`]:oi==="error",[`${pn}-is-validating`]:oi==="validating",[`${pn}-hidden`]:lr});return ve.createElement("div",{className:Ri,style:Vt,ref:On},ve.createElement(an.Z,Object.assign({className:`${pn}-row`},(0,qt.Z)(cn,["_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"])),ve.createElement(Mr,Object.assign({htmlFor:st},We,{requiredMark:mn,required:bt!=null?bt:ln,prefixCls:mt})),ve.createElement(Mn,Object.assign({},We,qn,{errors:cr,warnings:Gt,prefixCls:mt,status:oi,help:Yt,marginBottom:Li,onErrorVisibleChanged:Yi}),ve.createElement(ke.qI.Provider,{value:Pn},ve.createElement(mi,{prefixCls:mt,meta:qn,errors:qn.errors,warnings:qn.warnings,hasFeedback:or,validateStatus:oi},ht)))),!!Li&&ve.createElement("div",{className:`${pn}-margin-offset`,style:{marginBottom:-Li}}))}const Vi="__SPLIT__",ui=null,yt=ve.memo(We=>{let{children:mt}=We;return mt},(We,mt)=>We.value===mt.value&&We.update===mt.update&&We.childProps.length===mt.childProps.length&&We.childProps.every((zt,Ot)=>zt===mt.childProps[Ot]));function Cn(We){return We!=null}function Ln(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}function Dn(We){const{name:mt,noStyle:zt,className:Ot,dependencies:Vt,prefixCls:Yt,shouldUpdate:Hn,rules:_r,children:Qn,required:qn,label:or,messageVariables:lr,trigger:ht="onChange",validateTrigger:st,hidden:bt,help:ln}=We,{getPrefixCls:Pn}=ve.useContext(En.E_),{name:cn}=ve.useContext(ke.q3),pn=oe(Qn),mn=typeof pn=="function",On=ve.useContext(ke.qI),{validateTrigger:cr}=ve.useContext(Pt.FieldContext),Gt=st!==void 0?st:cr,Jr=Cn(mt),Zr=Pn("form",Yt),[Bi,Li]=_t(Zr),gi=ve.useContext(Pt.ListContext),Yi=ve.useRef(),[xi,oi]=Pe({}),[Ri,ji]=(0,bn.Z)(()=>Ln()),Yr=vt=>{const Zt=gi==null?void 0:gi.getKey(vt.name);if(ji(vt.destroy?Ln():vt,!0),zt&&ln!==!1&&On){let fn=vt.name;if(vt.destroy)fn=Yi.current||fn;else if(Zt!==void 0){const[Tn,pr]=Zt;fn=[Tn].concat((0,he.Z)(pr)),Yi.current=fn}On(vt,fn)}},vi=(vt,Zt)=>{oi(fn=>{const Tn=Object.assign({},fn),Ar=[].concat((0,he.Z)(vt.name.slice(0,-1)),(0,he.Z)(Zt)).join(Vi);return vt.destroy?delete Tn[Ar]:Tn[Ar]=vt,Tn})},[Wi,la]=ve.useMemo(()=>{const vt=(0,he.Z)(Ri.errors),Zt=(0,he.Z)(Ri.warnings);return Object.values(xi).forEach(fn=>{vt.push.apply(vt,(0,he.Z)(fn.errors||[])),Zt.push.apply(Zt,(0,he.Z)(fn.warnings||[]))}),[vt,Zt]},[xi,Ri.errors,Ri.warnings]),ta=Qe();function ri(vt,Zt,fn){return zt&&!bt?ve.createElement(mi,{prefixCls:Zr,hasFeedback:We.hasFeedback,validateStatus:We.validateStatus,meta:Ri,errors:Wi,warnings:la,noStyle:!0},vt):ve.createElement(Ui,Object.assign({key:"row"},We,{className:Re()(Ot,Li),prefixCls:Zr,fieldId:Zt,isRequired:fn,errors:Wi,warnings:la,meta:Ri,onSubItemMetaChange:vi}),vt)}if(!Jr&&!mn&&!Vt)return Bi(ri(pn));let xt={};return typeof or=="string"?xt.label=or:mt&&(xt.label=String(mt)),lr&&(xt=Object.assign(Object.assign({},xt),lr)),Bi(ve.createElement(Pt.Field,Object.assign({},We,{messageVariables:xt,trigger:ht,validateTrigger:Gt,onMetaChange:Yr}),(vt,Zt,fn)=>{const Tn=Ht(mt).length&&Zt?Zt.name:[],pr=Rn(Tn,cn),Ar=qn!==void 0?qn:!!(_r&&_r.some(Hr=>{if(Hr&&typeof Hr=="object"&&Hr.required&&!Hr.warningOnly)return!0;if(typeof Hr=="function"){const ti=Hr(fn);return ti&&ti.required&&!ti.warningOnly}return!1})),Wr=Object.assign({},vt);let Vr=null;if(Array.isArray(pn)&&Jr)Vr=pn;else if(!(mn&&(!(Hn||Vt)||Jr))){if(!(Vt&&!mn&&!Jr))if((0,we.l$)(pn)){const Hr=Object.assign(Object.assign({},pn.props),Wr);if(Hr.id||(Hr.id=pr),ln||Wi.length>0||la.length>0||We.extra){const Lr=[];(ln||Wi.length>0)&&Lr.push(`${pr}_help`),We.extra&&Lr.push(`${pr}_extra`),Hr["aria-describedby"]=Lr.join(" ")}Wi.length>0&&(Hr["aria-invalid"]="true"),Ar&&(Hr["aria-required"]="true"),(0,nn.Yr)(pn)&&(Hr.ref=ta(Tn,pn)),new Set([].concat((0,he.Z)(Ht(ht)),(0,he.Z)(Ht(Gt)))).forEach(Lr=>{Hr[Lr]=function(){for(var hi,Ai,Mi,Le,Fe,ze=arguments.length,Ze=new Array(ze),et=0;et<ze;et++)Ze[et]=arguments[et];(Mi=Wr[Lr])===null||Mi===void 0||(hi=Mi).call.apply(hi,[Wr].concat(Ze)),(Fe=(Le=pn.props)[Lr])===null||Fe===void 0||(Ai=Fe).call.apply(Ai,[Le].concat(Ze))}});const yi=[Hr["aria-required"],Hr["aria-invalid"],Hr["aria-describedby"]];Vr=ve.createElement(yt,{value:Wr[We.valuePropName||"value"],update:pn,childProps:yi},(0,we.Tm)(pn,Hr))}else mn&&(Hn||Vt)&&!Jr?Vr=pn(fn):Vr=pn}return ri(Vr,pr,Ar)}))}const sr=Dn;sr.useStatus=fe;var nr=sr,gr=function(We,mt){var zt={};for(var Ot in We)Object.prototype.hasOwnProperty.call(We,Ot)&&mt.indexOf(Ot)<0&&(zt[Ot]=We[Ot]);if(We!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Vt=0,Ot=Object.getOwnPropertySymbols(We);Vt<Ot.length;Vt++)mt.indexOf(Ot[Vt])<0&&Object.prototype.propertyIsEnumerable.call(We,Ot[Vt])&&(zt[Ot[Vt]]=We[Ot[Vt]]);return zt},Xe=We=>{var{prefixCls:mt,children:zt}=We,Ot=gr(We,["prefixCls","children"]);const{getPrefixCls:Vt}=ve.useContext(En.E_),Yt=Vt("form",mt),Hn=ve.useMemo(()=>({prefixCls:Yt,status:"error"}),[Yt]);return ve.createElement(Pt.List,Object.assign({},Ot),(_r,Qn,qn)=>ve.createElement(ke.Rk.Provider,{value:Hn},zt(_r.map(or=>Object.assign(Object.assign({},or),{fieldKey:or.key})),Qn,{errors:qn.errors,warnings:qn.warnings})))};function ut(){const{form:We}=(0,ve.useContext)(ke.q3);return We}const Lt=Kt;Lt.Item=nr,Lt.List=Xe,Lt.ErrorList=Rt,Lt.useForm=nt,Lt.useFormInstance=ut,Lt.useWatch=Pt.useWatch,Lt.Provider=ke.RV,Lt.create=()=>{};var Jt=Lt},31795:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return Fn}});var he=se(42922),He=se(53978),Re=se(94184),Ve=se.n(Re),ve=se(87462),_e=se(4942),ke=se(71002),Se=se(97685),me=se(45987),Ee=se(15671),tt=se(43144);function Be(){return typeof BigInt=="function"}function St(Xe){return!Xe&&Xe!==0&&!Number.isNaN(Xe)||!String(Xe).trim()}function dt(Xe){var ut=Xe.trim(),Lt=ut.startsWith("-");Lt&&(ut=ut.slice(1)),ut=ut.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),ut.startsWith(".")&&(ut="0".concat(ut));var Jt=ut||"0",We=Jt.split("."),mt=We[0]||"0",zt=We[1]||"0";mt==="0"&&zt==="0"&&(Lt=!1);var Ot=Lt?"-":"";return{negative:Lt,negativeStr:Ot,trimStr:Jt,integerStr:mt,decimalStr:zt,fullStr:"".concat(Ot).concat(Jt)}}function it(Xe){var ut=String(Xe);return!Number.isNaN(Number(ut))&&ut.includes("e")}function Ge(Xe){var ut=String(Xe);if(it(Xe)){var Lt=Number(ut.slice(ut.indexOf("e-")+2)),Jt=ut.match(/\.(\d+)/);return Jt!=null&&Jt[1]&&(Lt+=Jt[1].length),Lt}return ut.includes(".")&&At(ut)?ut.length-ut.indexOf(".")-1:0}function De(Xe){var ut=String(Xe);if(it(Xe)){if(Xe>Number.MAX_SAFE_INTEGER)return String(Be()?BigInt(Xe).toString():Number.MAX_SAFE_INTEGER);if(Xe<Number.MIN_SAFE_INTEGER)return String(Be()?BigInt(Xe).toString():Number.MIN_SAFE_INTEGER);ut=Xe.toFixed(Ge(ut))}return dt(ut).fullStr}function At(Xe){return typeof Xe=="number"?!Number.isNaN(Xe):Xe?/^\s*-?\d+(\.\d+)?\s*$/.test(Xe)||/^\s*-?\d+\.\s*$/.test(Xe)||/^\s*-?\.\d+\s*$/.test(Xe):!1}var Xt=function(){function Xe(ut){if((0,Ee.Z)(this,Xe),(0,_e.Z)(this,"origin",""),(0,_e.Z)(this,"negative",void 0),(0,_e.Z)(this,"integer",void 0),(0,_e.Z)(this,"decimal",void 0),(0,_e.Z)(this,"decimalLen",void 0),(0,_e.Z)(this,"empty",void 0),(0,_e.Z)(this,"nan",void 0),St(ut)){this.empty=!0;return}if(this.origin=String(ut),ut==="-"||Number.isNaN(ut)){this.nan=!0;return}var Lt=ut;if(it(Lt)&&(Lt=Number(Lt)),Lt=typeof Lt=="string"?Lt:De(Lt),At(Lt)){var Jt=dt(Lt);this.negative=Jt.negative;var We=Jt.trimStr.split(".");this.integer=BigInt(We[0]);var mt=We[1]||"0";this.decimal=BigInt(mt),this.decimalLen=mt.length}else this.nan=!0}return(0,tt.Z)(Xe,[{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(Lt){var Jt="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(Lt,"0"));return BigInt(Jt)}},{key:"negate",value:function(){var Lt=new Xe(this.toString());return Lt.negative=!Lt.negative,Lt}},{key:"cal",value:function(Lt,Jt,We){var mt=Math.max(this.getDecimalStr().length,Lt.getDecimalStr().length),zt=this.alignDecimal(mt),Ot=Lt.alignDecimal(mt),Vt=Jt(zt,Ot).toString(),Yt=We(mt),Hn=dt(Vt),_r=Hn.negativeStr,Qn=Hn.trimStr,qn="".concat(_r).concat(Qn.padStart(Yt+1,"0"));return new Xe("".concat(qn.slice(0,-Yt),".").concat(qn.slice(-Yt)))}},{key:"add",value:function(Lt){if(this.isInvalidate())return new Xe(Lt);var Jt=new Xe(Lt);return Jt.isInvalidate()?this:this.cal(Jt,function(We,mt){return We+mt},function(We){return We})}},{key:"multi",value:function(Lt){var Jt=new Xe(Lt);return this.isInvalidate()||Jt.isInvalidate()?new Xe(NaN):this.cal(Jt,function(We,mt){return We*mt},function(We){return We*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(Lt){return this.toString()===(Lt==null?void 0:Lt.toString())}},{key:"lessEquals",value:function(Lt){return this.add(Lt.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var Lt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return Lt?this.isInvalidate()?"":dt("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),Xe}(),rt=function(){function Xe(ut){if((0,Ee.Z)(this,Xe),(0,_e.Z)(this,"origin",""),(0,_e.Z)(this,"number",void 0),(0,_e.Z)(this,"empty",void 0),St(ut)){this.empty=!0;return}this.origin=String(ut),this.number=Number(ut)}return(0,tt.Z)(Xe,[{key:"negate",value:function(){return new Xe(-this.toNumber())}},{key:"add",value:function(Lt){if(this.isInvalidate())return new Xe(Lt);var Jt=Number(Lt);if(Number.isNaN(Jt))return this;var We=this.number+Jt;if(We>Number.MAX_SAFE_INTEGER)return new Xe(Number.MAX_SAFE_INTEGER);if(We<Number.MIN_SAFE_INTEGER)return new Xe(Number.MIN_SAFE_INTEGER);var mt=Math.max(Ge(this.number),Ge(Jt));return new Xe(We.toFixed(mt))}},{key:"multi",value:function(Lt){var Jt=Number(Lt);if(this.isInvalidate()||Number.isNaN(Jt))return new Xe(NaN);var We=this.number*Jt;if(We>Number.MAX_SAFE_INTEGER)return new Xe(Number.MAX_SAFE_INTEGER);if(We<Number.MIN_SAFE_INTEGER)return new Xe(Number.MIN_SAFE_INTEGER);var mt=Math.max(Ge(this.number),Ge(Jt));return new Xe(We.toFixed(mt))}},{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(Lt){return this.toNumber()===(Lt==null?void 0:Lt.toNumber())}},{key:"lessEquals",value:function(Lt){return this.add(Lt.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var Lt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return Lt?this.isInvalidate()?"":De(this.number):this.origin}}]),Xe}();function ft(Xe){return Be()?new Xt(Xe):new rt(Xe)}function Ie(Xe,ut,Lt){var Jt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(Xe==="")return"";var We=dt(Xe),mt=We.negativeStr,zt=We.integerStr,Ot=We.decimalStr,Vt="".concat(ut).concat(Ot),Yt="".concat(mt).concat(zt);if(Lt>=0){var Hn=Number(Ot[Lt]);if(Hn>=5&&!Jt){var _r=ft(Xe).add("".concat(mt,"0.").concat("0".repeat(Lt)).concat(10-Hn));return Ie(_r.toString(),ut,Lt,Jt)}return Lt===0?Yt:"".concat(Yt).concat(ut).concat(Ot.padEnd(Lt,"0").slice(0,Lt))}return Vt===".0"?Yt:"".concat(Yt).concat(Vt)}var xe=ft,Ue=se(67656),je=se(67294);function _t(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Ct=_t()?je.useLayoutEffect:je.useEffect,Dt=function(ut,Lt){var Jt=je.useRef(!0);Ct(function(){return ut(Jt.current)},Lt),Ct(function(){return Jt.current=!1,function(){Jt.current=!0}},[])},qe=function(ut,Lt){Dt(function(Jt){if(!Jt)return ut()},Lt)},Rt=Dt,Pt=se(27183);function En(Xe,ut,Lt){var Jt=React.useRef({});return(!("value"in Jt.current)||Lt(Jt.current.condition,ut))&&(Jt.current.value=Xe(),Jt.current.condition=ut),Jt.current.value}function tn(Xe,ut){typeof Xe=="function"?Xe(ut):(0,ke.Z)(Xe)==="object"&&Xe&&"current"in Xe&&(Xe.current=ut)}function $n(){for(var Xe=arguments.length,ut=new Array(Xe),Lt=0;Lt<Xe;Lt++)ut[Lt]=arguments[Lt];var Jt=ut.filter(function(We){return We});return Jt.length<=1?Jt[0]:function(We){ut.forEach(function(mt){tn(mt,We)})}}function ur(){for(var Xe=arguments.length,ut=new Array(Xe),Lt=0;Lt<Xe;Lt++)ut[Lt]=arguments[Lt];return useMemo(function(){return $n.apply(void 0,ut)},ut,function(Jt,We){return Jt.length!==We.length||Jt.every(function(mt,zt){return mt!==We[zt]})})}function wr(Xe){var ut,Lt,Jt=isMemo(Xe)?Xe.type.type:Xe.type;return!(typeof Jt=="function"&&!((ut=Jt.prototype)!==null&&ut!==void 0&&ut.render)||typeof Xe=="function"&&!((Lt=Xe.prototype)!==null&&Lt!==void 0&&Lt.render))}function Je(Xe){return!isValidElement(Xe)||isFragment(Xe)?!1:wr(Xe)}var Ae={},Ht=[],Rn=function(ut){Ht.push(ut)};function yn(Xe,ut){if(0)var Lt}function ot(Xe,ut){if(0)var Lt}function nt(){Ae={}}function Tt(Xe,ut,Lt){!ut&&!Ae[Lt]&&(Xe(!1,Lt),Ae[Lt]=!0)}function rn(Xe,ut){Tt(yn,Xe,ut)}function dn(Xe,ut){Tt(ot,Xe,ut)}rn.preMessage=Rn,rn.resetWarned=nt,rn.noteOnce=dn;var Ut=rn;function Kt(Xe,ut){var Lt=(0,je.useRef)(null);function Jt(){try{var mt=Xe.selectionStart,zt=Xe.selectionEnd,Ot=Xe.value,Vt=Ot.substring(0,mt),Yt=Ot.substring(zt);Lt.current={start:mt,end:zt,value:Ot,beforeTxt:Vt,afterTxt:Yt}}catch(Hn){}}function We(){if(Xe&&Lt.current&&ut)try{var mt=Xe.value,zt=Lt.current,Ot=zt.beforeTxt,Vt=zt.afterTxt,Yt=zt.start,Hn=mt.length;if(mt.endsWith(Vt))Hn=mt.length-Lt.current.afterTxt.length;else if(mt.startsWith(Ot))Hn=Ot.length;else{var _r=Ot[Yt-1],Qn=mt.indexOf(_r,Yt-1);Qn!==-1&&(Hn=Qn+1)}Xe.setSelectionRange(Hn,Hn)}catch(qn){Ut(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(qn.message))}}return[Jt,We]}var bn=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Xe=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Xe)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Xe==null?void 0:Xe.substr(0,4))},nn=function(){var ut=(0,je.useState)(!1),Lt=(0,Se.Z)(ut,2),Jt=Lt[0],We=Lt[1];return Rt(function(){We(bn())},[]),Jt},we=nn,ue=function(ut){return+setTimeout(ut,16)},oe=function(ut){return clearTimeout(ut)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(ue=function(ut){return window.requestAnimationFrame(ut)},oe=function(ut){return window.cancelAnimationFrame(ut)});var pe=0,fe=new Map;function le(Xe){fe.delete(Xe)}var Pe=function(ut){var Lt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;pe+=1;var Jt=pe;function We(mt){if(mt===0)le(Jt),ut();else{var zt=ue(function(){We(mt-1)});fe.set(Jt,zt)}}return We(Lt),Jt};Pe.cancel=function(Xe){var ut=fe.get(Xe);return le(ut),oe(ut)};var Qe=Pe,It=200,Nt=600;function qt(Xe){var ut=Xe.prefixCls,Lt=Xe.upNode,Jt=Xe.downNode,We=Xe.upDisabled,mt=Xe.downDisabled,zt=Xe.onStep,Ot=je.useRef(),Vt=je.useRef([]),Yt=je.useRef();Yt.current=zt;var Hn=function(){clearTimeout(Ot.current)},_r=function(ln,Pn){ln.preventDefault(),Hn(),Yt.current(Pn);function cn(){Yt.current(Pn),Ot.current=setTimeout(cn,It)}Ot.current=setTimeout(cn,Nt)};je.useEffect(function(){return function(){Hn(),Vt.current.forEach(function(bt){return Qe.cancel(bt)})}},[]);var Qn=we();if(Qn)return null;var qn="".concat(ut,"-handler"),or=Ve()(qn,"".concat(qn,"-up"),(0,_e.Z)({},"".concat(qn,"-up-disabled"),We)),lr=Ve()(qn,"".concat(qn,"-down"),(0,_e.Z)({},"".concat(qn,"-down-disabled"),mt)),ht=function(){return Vt.current.push(Qe(Hn))},st={unselectable:"on",role:"button",onMouseUp:ht,onMouseLeave:ht};return je.createElement("div",{className:"".concat(qn,"-wrap")},je.createElement("span",(0,ve.Z)({},st,{onMouseDown:function(ln){_r(ln,!0)},"aria-label":"Increase Value","aria-disabled":We,className:or}),Lt||je.createElement("span",{unselectable:"on",className:"".concat(ut,"-handler-up-inner")})),je.createElement("span",(0,ve.Z)({},st,{onMouseDown:function(ln){_r(ln,!1)},"aria-label":"Decrease Value","aria-disabled":mt,className:lr}),Jt||je.createElement("span",{unselectable:"on",className:"".concat(ut,"-handler-down-inner")})))}function an(Xe){var ut=typeof Xe=="number"?De(Xe):dt(Xe).fullStr,Lt=ut.includes(".");return Lt?dt(ut.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:Xe+"0"}var jt=se(87887),ir=function(){var Xe=(0,je.useRef)(0),ut=function(){Qe.cancel(Xe.current)};return(0,je.useEffect)(function(){return ut},[]),function(Lt){ut(),Xe.current=Qe(function(){Lt()})}},Cr=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],Bt=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","classes","className","classNames"],Mn=function(ut,Lt){return ut||Lt.isEmpty()?Lt.toString():Lt.toNumber()},Vn=function(ut){var Lt=xe(ut);return Lt.isInvalidate()?null:Lt},br=je.forwardRef(function(Xe,ut){var Lt,Jt=Xe.prefixCls,We=Jt===void 0?"rc-input-number":Jt,mt=Xe.className,zt=Xe.style,Ot=Xe.min,Vt=Xe.max,Yt=Xe.step,Hn=Yt===void 0?1:Yt,_r=Xe.defaultValue,Qn=Xe.value,qn=Xe.disabled,or=Xe.readOnly,lr=Xe.upHandler,ht=Xe.downHandler,st=Xe.keyboard,bt=Xe.controls,ln=bt===void 0?!0:bt,Pn=Xe.classNames,cn=Xe.stringMode,pn=Xe.parser,mn=Xe.formatter,On=Xe.precision,cr=Xe.decimalSeparator,Gt=Xe.onChange,Jr=Xe.onInput,Zr=Xe.onPressEnter,Bi=Xe.onStep,Li=(0,me.Z)(Xe,Cr),gi="".concat(We,"-input"),Yi=je.useRef(null),xi=je.useState(!1),oi=(0,Se.Z)(xi,2),Ri=oi[0],ji=oi[1],Yr=je.useRef(!1),vi=je.useRef(!1),Wi=je.useRef(!1),la=je.useState(function(){return xe(Qn!=null?Qn:_r)}),ta=(0,Se.Z)(la,2),ri=ta[0],xt=ta[1];function vt(Gn){Qn===void 0&&xt(Gn)}var Zt=je.useCallback(function(Gn,jn){if(!jn)return On>=0?On:Math.max(Ge(Gn),Ge(Hn))},[On,Hn]),fn=je.useCallback(function(Gn){var jn=String(Gn);if(pn)return pn(jn);var er=jn;return cr&&(er=er.replace(cr,".")),er.replace(/[^\w.-]+/g,"")},[pn,cr]),Tn=je.useRef(""),pr=je.useCallback(function(Gn,jn){if(mn)return mn(Gn,{userTyping:jn,input:String(Tn.current)});var er=typeof Gn=="number"?De(Gn):Gn;if(!jn){var tr=Zt(er,jn);if(At(er)&&(cr||tr>=0)){var yr=cr||".";er=Ie(er,yr,tr)}}return er},[mn,Zt,cr]),Ar=je.useState(function(){var Gn=_r!=null?_r:Qn;return ri.isInvalidate()&&["string","number"].includes((0,ke.Z)(Gn))?Number.isNaN(Gn)?"":Gn:pr(ri.toString(),!1)}),Wr=(0,Se.Z)(Ar,2),Vr=Wr[0],Hr=Wr[1];Tn.current=Vr;function ti(Gn,jn){Hr(pr(Gn.isInvalidate()?Gn.toString(!1):Gn.toString(!jn),jn))}var yi=je.useMemo(function(){return Vn(Vt)},[Vt,On]),Lr=je.useMemo(function(){return Vn(Ot)},[Ot,On]),hi=je.useMemo(function(){return!yi||!ri||ri.isInvalidate()?!1:yi.lessEquals(ri)},[yi,ri]),Ai=je.useMemo(function(){return!Lr||!ri||ri.isInvalidate()?!1:ri.lessEquals(Lr)},[Lr,ri]),Mi=Kt(Yi.current,Ri),Le=(0,Se.Z)(Mi,2),Fe=Le[0],ze=Le[1],Ze=function(jn){return yi&&!jn.lessEquals(yi)?yi:Lr&&!Lr.lessEquals(jn)?Lr:null},et=function(jn){return!Ze(jn)},lt=function(jn,er){var tr=jn,yr=et(tr)||tr.isEmpty();if(!tr.isEmpty()&&!er&&(tr=Ze(tr)||tr,yr=!0),!or&&!qn&&yr){var Oe=tr.toString(),Ke=Zt(Oe,er);return Ke>=0&&(tr=xe(Ie(Oe,".",Ke)),et(tr)||(tr=xe(Ie(Oe,".",Ke,!0)))),tr.equals(ri)||(vt(tr),Gt==null||Gt(tr.isEmpty()?null:Mn(cn,tr)),Qn===void 0&&ti(tr,er)),tr}return ri},wt=ir(),Qt=function Gn(jn){if(Fe(),Tn.current=jn,Hr(jn),!vi.current){var er=fn(jn),tr=xe(er);tr.isNaN()||lt(tr,!0)}Jr==null||Jr(jn),wt(function(){var yr=jn;pn||(yr=jn.replace(/。/g,".")),yr!==jn&&Gn(yr)})},sn=function(){vi.current=!0},Xn=function(){vi.current=!1,Qt(Yi.current.value)},vr=function(jn){Qt(jn.target.value)},Zn=function(jn){var er;if(!(jn&&hi||!jn&&Ai)){Yr.current=!1;var tr=xe(Wi.current?an(Hn):Hn);jn||(tr=tr.negate());var yr=(ri||xe(0)).add(tr.toString()),Oe=lt(yr,!1);Bi==null||Bi(Mn(cn,Oe),{offset:Wi.current?an(Hn):Hn,type:jn?"up":"down"}),(er=Yi.current)===null||er===void 0||er.focus()}},xn=function(jn){var er=xe(fn(Vr)),tr=er;er.isNaN()?tr=lt(ri,jn):tr=lt(er,jn),Qn!==void 0?ti(ri,!1):tr.isNaN()||ti(tr,!1)},gn=function(){Yr.current=!0},An=function(jn){var er=jn.key,tr=jn.shiftKey;Yr.current=!0,Wi.current=tr,er==="Enter"&&(vi.current||(Yr.current=!1),xn(!1),Zr==null||Zr(jn)),st!==!1&&!vi.current&&["Up","ArrowUp","Down","ArrowDown"].includes(er)&&(Zn(er==="Up"||er==="ArrowUp"),jn.preventDefault())},Bn=function(){Yr.current=!1,Wi.current=!1},fr=function(){xn(!1),ji(!1),Yr.current=!1};return qe(function(){ri.isInvalidate()||ti(ri,!1)},[On]),qe(function(){var Gn=xe(Qn);xt(Gn);var jn=xe(fn(Vr));(!Gn.equals(jn)||!Yr.current||mn)&&ti(Gn,Yr.current)},[Qn]),qe(function(){mn&&ze()},[Vr]),je.createElement("div",{className:Ve()(We,Pn==null?void 0:Pn.input,mt,(Lt={},(0,_e.Z)(Lt,"".concat(We,"-focused"),Ri),(0,_e.Z)(Lt,"".concat(We,"-disabled"),qn),(0,_e.Z)(Lt,"".concat(We,"-readonly"),or),(0,_e.Z)(Lt,"".concat(We,"-not-a-number"),ri.isNaN()),(0,_e.Z)(Lt,"".concat(We,"-out-of-range"),!ri.isInvalidate()&&!et(ri)),Lt)),style:zt,onFocus:function(){ji(!0)},onBlur:fr,onKeyDown:An,onKeyUp:Bn,onCompositionStart:sn,onCompositionEnd:Xn,onBeforeInput:gn},ln&&je.createElement(qt,{prefixCls:We,upNode:lr,downNode:ht,upDisabled:hi,downDisabled:Ai,onStep:Zn}),je.createElement("div",{className:"".concat(gi,"-wrap")},je.createElement("input",(0,ve.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":Ot,"aria-valuemax":Vt,"aria-valuenow":ri.isInvalidate()?null:ri.toString(),step:Hn},Li,{ref:$n(Yi,ut),className:gi,value:Vr,onChange:vr,disabled:qn,readOnly:or}))))}),at=je.forwardRef(function(Xe,ut){var Lt=Xe.disabled,Jt=Xe.style,We=Xe.prefixCls,mt=Xe.value,zt=Xe.prefix,Ot=Xe.suffix,Vt=Xe.addonBefore,Yt=Xe.addonAfter,Hn=Xe.classes,_r=Xe.className,Qn=Xe.classNames,qn=(0,me.Z)(Xe,Bt),or=je.useRef(null),lr=function(st){or.current&&(0,jt.nH)(or.current,st)};return je.createElement(Ue.BaseInput,{inputElement:je.createElement(br,(0,ve.Z)({prefixCls:We,disabled:Lt,classNames:Qn,ref:$n(or,ut)},qn)),className:_r,triggerFocus:lr,prefixCls:We,value:mt,disabled:Lt,style:Jt,prefix:zt,suffix:Ot,addonAfter:Yt,addonBefore:Vt,classes:Hn,classNames:Qn,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}})});at.displayName="InputNumber";var $t=at,In=$t,Jn=se(9708),ar=se(53124),Mr=se(46735),$r=se(98866),Dr=se(98675),Kr=se(65223),ni=se(4173),hr=se(47673),mi=se(14747),Ji=se(80110),Ui=se(67968),Vi=se(45503);const ui=(Xe,ut)=>{let{componentCls:Lt,borderRadiusSM:Jt,borderRadiusLG:We}=Xe;const mt=ut==="lg"?We:Jt;return{[`&-${ut}`]:{[`${Lt}-handler-wrap`]:{borderStartEndRadius:mt,borderEndEndRadius:mt},[`${Lt}-handler-up`]:{borderStartEndRadius:mt},[`${Lt}-handler-down`]:{borderEndEndRadius:mt}}}},yt=Xe=>{const{componentCls:ut,lineWidth:Lt,lineType:Jt,colorBorder:We,borderRadius:mt,fontSizeLG:zt,controlHeightLG:Ot,controlHeightSM:Vt,colorError:Yt,paddingInlineSM:Hn,colorTextDescription:_r,motionDurationMid:Qn,handleHoverColor:qn,paddingInline:or,paddingBlock:lr,handleBg:ht,handleActiveBg:st,colorTextDisabled:bt,borderRadiusSM:ln,borderRadiusLG:Pn,controlWidth:cn,handleVisible:pn,handleBorderColor:mn}=Xe;return[{[ut]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,mi.Wf)(Xe)),(0,hr.ik)(Xe)),(0,hr.bi)(Xe,ut)),{display:"inline-block",width:cn,margin:0,padding:0,border:`${Lt}px ${Jt} ${We}`,borderRadius:mt,"&-rtl":{direction:"rtl",[`${ut}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:zt,borderRadius:Pn,[`input${ut}-input`]:{height:Ot-2*Lt}},"&-sm":{padding:0,borderRadius:ln,[`input${ut}-input`]:{height:Vt-2*Lt,padding:`0 ${Hn}px`}},"&:hover":Object.assign({},(0,hr.pU)(Xe)),"&-focused":Object.assign({},(0,hr.M1)(Xe)),"&-out-of-range":{[`${ut}-input-wrap`]:{input:{color:Yt}}},"&-group":Object.assign(Object.assign(Object.assign({},(0,mi.Wf)(Xe)),(0,hr.s7)(Xe)),{"&-wrapper":{display:"inline-block",textAlign:"start",verticalAlign:"top",[`${ut}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${ut}-group-addon`]:{borderRadius:Pn,fontSize:Xe.fontSizeLG}},"&-sm":{[`${ut}-group-addon`]:{borderRadius:ln}},[`${ut}-wrapper-disabled > ${ut}-group-addon`]:Object.assign({},(0,hr.Xy)(Xe))}}),[`&-disabled ${ut}-input`]:{cursor:"not-allowed"},[ut]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},(0,mi.Wf)(Xe)),{width:"100%",padding:`${lr}px ${or}px`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:mt,outline:0,transition:`all ${Qn} linear`,appearance:"textfield",fontSize:"inherit"}),(0,hr.nz)(Xe.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[ut]:Object.assign(Object.assign(Object.assign({[`&:hover ${ut}-handler-wrap, &-focused ${ut}-handler-wrap`]:{opacity:1},[`${ut}-handler-wrap`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:Xe.handleWidth,height:"100%",background:ht,borderStartStartRadius:0,borderStartEndRadius:mt,borderEndEndRadius:mt,borderEndStartRadius:0,opacity:pn===!0?1:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`opacity ${Qn} linear ${Qn}`,[`${ut}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[`
${ut}-handler-up-inner,
${ut}-handler-down-inner
`]:{marginInlineEnd:0,fontSize:Xe.handleFontSize}}},[`${ut}-handler`]:{height:"50%",overflow:"hidden",color:_r,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:`${Lt}px ${Jt} ${mn}`,transition:`all ${Qn} linear`,"&:active":{background:st},"&:hover":{height:"60%",[`
${ut}-handler-up-inner,
${ut}-handler-down-inner
`]:{color:qn}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},(0,mi.Ro)()),{color:_r,transition:`all ${Qn} linear`,userSelect:"none"})},[`${ut}-handler-up`]:{borderStartEndRadius:mt},[`${ut}-handler-down`]:{borderBlockStart:`${Lt}px ${Jt} ${mn}`,borderEndEndRadius:mt}},ui(Xe,"lg")),ui(Xe,"sm")),{"&-disabled, &-readonly":{[`${ut}-handler-wrap`]:{display:"none"},[`${ut}-input`]:{color:"inherit"}},[`
${ut}-handler-up-disabled,
${ut}-handler-down-disabled
`]:{cursor:"not-allowed"},[`
${ut}-handler-up-disabled:hover &-handler-up-inner,
${ut}-handler-down-disabled:hover &-handler-down-inner
`]:{color:bt}})},{[`${ut}-borderless`]:{borderColor:"transparent",boxShadow:"none",[`${ut}-handler-down`]:{borderBlockStartWidth:0}}}]},Cn=Xe=>{const{componentCls:ut,paddingBlock:Lt,paddingInline:Jt,inputAffixPadding:We,controlWidth:mt,borderRadiusLG:zt,borderRadiusSM:Ot}=Xe;return{[`${ut}-affix-wrapper`]:Object.assign(Object.assign(Object.assign({},(0,hr.ik)(Xe)),(0,hr.bi)(Xe,`${ut}-affix-wrapper`)),{position:"relative",display:"inline-flex",width:mt,padding:0,paddingInlineStart:Jt,"&-lg":{borderRadius:zt},"&-sm":{borderRadius:Ot},[`&:not(${ut}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},(0,hr.pU)(Xe)),{zIndex:1}),"&-focused, &:focus":{zIndex:1},[`&-disabled > ${ut}-disabled`]:{background:"transparent"},[`> div${ut}`]:{width:"100%",border:"none",outline:"none",[`&${ut}-focused`]:{boxShadow:"none !important"}},[`input${ut}-input`]:{padding:`${Lt}px 0`},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${ut}-handler-wrap`]:{zIndex:2},[ut]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:We},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:Jt,marginInlineStart:We}}})}};var Ln=(0,Ui.Z)("InputNumber",Xe=>{const ut=(0,Vi.TS)(Xe,(0,hr.e5)(Xe));return[yt(ut),Cn(ut),(0,Ji.c)(ut)]},Xe=>Object.assign(Object.assign({},(0,hr.TM)(Xe)),{controlWidth:90,handleWidth:Xe.controlHeightSM-Xe.lineWidth*2,handleFontSize:Xe.fontSize/2,handleVisible:"auto",handleActiveBg:Xe.colorFillAlter,handleBg:Xe.colorBgContainer,handleHoverColor:Xe.colorPrimary,handleBorderColor:Xe.colorBorder})),Dn=function(Xe,ut){var Lt={};for(var Jt in Xe)Object.prototype.hasOwnProperty.call(Xe,Jt)&&ut.indexOf(Jt)<0&&(Lt[Jt]=Xe[Jt]);if(Xe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var We=0,Jt=Object.getOwnPropertySymbols(Xe);We<Jt.length;We++)ut.indexOf(Jt[We])<0&&Object.prototype.propertyIsEnumerable.call(Xe,Jt[We])&&(Lt[Jt[We]]=Xe[Jt[We]]);return Lt};const sr=je.forwardRef((Xe,ut)=>{const{getPrefixCls:Lt,direction:Jt}=je.useContext(ar.E_),We=je.useRef(null);je.useImperativeHandle(ut,()=>We.current);const{className:mt,rootClassName:zt,size:Ot,disabled:Vt,prefixCls:Yt,addonBefore:Hn,addonAfter:_r,prefix:Qn,bordered:qn=!0,readOnly:or,status:lr,controls:ht}=Xe,st=Dn(Xe,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls"]),bt=Lt("input-number",Yt),[ln,Pn]=Ln(bt),{compactSize:cn,compactItemClassnames:pn}=(0,ni.ri)(bt,Jt);let mn=je.createElement(He.Z,{className:`${bt}-handler-up-inner`}),On=je.createElement(he.Z,{className:`${bt}-handler-down-inner`});const cr=typeof ht=="boolean"?ht:void 0;typeof ht=="object"&&(mn=typeof ht.upIcon=="undefined"?mn:je.createElement("span",{className:`${bt}-handler-up-inner`},ht.upIcon),On=typeof ht.downIcon=="undefined"?On:je.createElement("span",{className:`${bt}-handler-down-inner`},ht.downIcon));const{hasFeedback:Gt,status:Jr,isFormItemInput:Zr,feedbackIcon:Bi}=je.useContext(Kr.aM),Li=(0,Jn.F)(Jr,lr),gi=(0,Dr.Z)(Yr=>{var vi;return(vi=Ot!=null?Ot:cn)!==null&&vi!==void 0?vi:Yr}),Yi=je.useContext($r.Z),xi=Vt!=null?Vt:Yi,oi=Ve()({[`${bt}-lg`]:gi==="large",[`${bt}-sm`]:gi==="small",[`${bt}-rtl`]:Jt==="rtl",[`${bt}-borderless`]:!qn,[`${bt}-in-form-item`]:Zr},(0,Jn.Z)(bt,Li),pn,Pn),Ri=`${bt}-group`,ji=je.createElement(In,Object.assign({ref:We,disabled:xi,className:Ve()(mt,zt),upHandler:mn,downHandler:On,prefixCls:bt,readOnly:or,controls:cr,prefix:Qn,suffix:Gt&&Bi,addonAfter:_r&&je.createElement(ni.BR,null,je.createElement(Kr.Ux,{override:!0,status:!0},_r)),addonBefore:Hn&&je.createElement(ni.BR,null,je.createElement(Kr.Ux,{override:!0,status:!0},Hn)),classNames:{input:oi},classes:{affixWrapper:Ve()((0,Jn.Z)(`${bt}-affix-wrapper`,Li,Gt),{[`${bt}-affix-wrapper-sm`]:gi==="small",[`${bt}-affix-wrapper-lg`]:gi==="large",[`${bt}-affix-wrapper-rtl`]:Jt==="rtl",[`${bt}-affix-wrapper-borderless`]:!qn},Pn),wrapper:Ve()({[`${Ri}-rtl`]:Jt==="rtl",[`${bt}-wrapper-disabled`]:xi},Pn),group:Ve()({[`${bt}-group-wrapper-sm`]:gi==="small",[`${bt}-group-wrapper-lg`]:gi==="large",[`${bt}-group-wrapper-rtl`]:Jt==="rtl"},(0,Jn.Z)(`${bt}-group-wrapper`,Li,Gt),Pn)}},st));return ln(ji)}),nr=sr,gr=Xe=>je.createElement(Mr.ZP,{theme:{components:{InputNumber:{handleVisible:!0}}}},je.createElement(sr,Object.assign({},Xe)));nr._InternalPanelDoNotUseOrYouWillBeFired=gr;var Fn=nr},82586:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return Xt},n:function(){return De}});var he=se(16646),He=se(94184),Re=se.n(He),Ve=se(67656),ve=se(17799),_e=se(67294),ke=se(9708),Se=se(53124),me=se(98866),Ee=se(98675),tt=se(65223),Be=se(4173),St=se(72922),dt=se(47673);function it(rt){return!!(rt.prefix||rt.suffix||rt.allowClear)}var Ge=function(rt,ft){var Ie={};for(var xe in rt)Object.prototype.hasOwnProperty.call(rt,xe)&&ft.indexOf(xe)<0&&(Ie[xe]=rt[xe]);if(rt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ue=0,xe=Object.getOwnPropertySymbols(rt);Ue<xe.length;Ue++)ft.indexOf(xe[Ue])<0&&Object.prototype.propertyIsEnumerable.call(rt,xe[Ue])&&(Ie[xe[Ue]]=rt[xe[Ue]]);return Ie};function De(rt,ft){if(!rt)return;rt.focus(ft);const{cursor:Ie}=ft||{};if(Ie){const xe=rt.value.length;switch(Ie){case"start":rt.setSelectionRange(0,0);break;case"end":rt.setSelectionRange(xe,xe);break;default:rt.setSelectionRange(0,xe);break}}}var Xt=(0,_e.forwardRef)((rt,ft)=>{var Ie;const{prefixCls:xe,bordered:Ue=!0,status:je,size:_t,disabled:Ct,onBlur:Dt,onFocus:qe,suffix:Rt,allowClear:Pt,addonAfter:En,addonBefore:tn,className:$n,style:ur,styles:wr,rootClassName:Je,onChange:Ae,classNames:Ht}=rt,Rn=Ge(rt,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames"]),{getPrefixCls:yn,direction:ot,input:nt}=_e.useContext(Se.E_),Tt=yn("input",xe),rn=(0,_e.useRef)(null),[dn,Ut]=(0,dt.ZP)(Tt),{compactSize:Kt,compactItemClassnames:bn}=(0,Be.ri)(Tt,ot),nn=(0,Ee.Z)(Cr=>{var Bt;return(Bt=_t!=null?_t:Kt)!==null&&Bt!==void 0?Bt:Cr}),we=_e.useContext(me.Z),ue=Ct!=null?Ct:we,{status:oe,hasFeedback:pe,feedbackIcon:fe}=(0,_e.useContext)(tt.aM),le=(0,ke.F)(oe,je),Pe=it(rt)||!!pe,Qe=(0,_e.useRef)(Pe);(0,_e.useEffect)(()=>{var Cr;Pe&&Qe.current,Qe.current=Pe},[Pe]);const It=(0,St.Z)(rn,!0),Nt=Cr=>{It(),Dt==null||Dt(Cr)},qt=Cr=>{It(),qe==null||qe(Cr)},an=Cr=>{It(),Ae==null||Ae(Cr)},jt=(pe||Rt)&&_e.createElement(_e.Fragment,null,Rt,pe&&fe);let ir;return typeof Pt=="object"&&(Pt!=null&&Pt.clearIcon)?ir=Pt:Pt&&(ir={clearIcon:_e.createElement(he.Z,null)}),dn(_e.createElement(Ve.default,Object.assign({ref:(0,ve.sQ)(ft,rn),prefixCls:Tt,autoComplete:nt==null?void 0:nt.autoComplete},Rn,{disabled:ue,onBlur:Nt,onFocus:qt,style:Object.assign(Object.assign({},nt==null?void 0:nt.style),ur),styles:Object.assign(Object.assign({},nt==null?void 0:nt.styles),wr),suffix:jt,allowClear:ir,className:Re()($n,Je,bn,nt==null?void 0:nt.className),onChange:an,addonAfter:En&&_e.createElement(Be.BR,null,_e.createElement(tt.Ux,{override:!0,status:!0},En)),addonBefore:tn&&_e.createElement(Be.BR,null,_e.createElement(tt.Ux,{override:!0,status:!0},tn)),classNames:Object.assign(Object.assign(Object.assign({},Ht),nt==null?void 0:nt.classNames),{input:Re()({[`${Tt}-sm`]:nn==="small",[`${Tt}-lg`]:nn==="large",[`${Tt}-rtl`]:ot==="rtl",[`${Tt}-borderless`]:!Ue},!Pe&&(0,ke.Z)(Tt,le),Ht==null?void 0:Ht.input,(Ie=nt==null?void 0:nt.classNames)===null||Ie===void 0?void 0:Ie.input,Ut)}),classes:{affixWrapper:Re()({[`${Tt}-affix-wrapper-sm`]:nn==="small",[`${Tt}-affix-wrapper-lg`]:nn==="large",[`${Tt}-affix-wrapper-rtl`]:ot==="rtl",[`${Tt}-affix-wrapper-borderless`]:!Ue},(0,ke.Z)(`${Tt}-affix-wrapper`,le,pe),Ut),wrapper:Re()({[`${Tt}-group-rtl`]:ot==="rtl"},Ut),group:Re()({[`${Tt}-group-wrapper-sm`]:nn==="small",[`${Tt}-group-wrapper-lg`]:nn==="large",[`${Tt}-group-wrapper-rtl`]:ot==="rtl",[`${Tt}-group-wrapper-disabled`]:ue},(0,ke.Z)(`${Tt}-group-wrapper`,le,pe),Ut)}})))})},96330:function(Sn,Wt,se){"use strict";var he=se(16646),He=se(94184),Re=se.n(He),Ve=se(64701),ve=se(67294),_e=se(9708),ke=se(53124),Se=se(98866),me=se(98675),Ee=se(65223),tt=se(82586),Be=se(47673),St=function(it,Ge){var De={};for(var At in it)Object.prototype.hasOwnProperty.call(it,At)&&Ge.indexOf(At)<0&&(De[At]=it[At]);if(it!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Xt=0,At=Object.getOwnPropertySymbols(it);Xt<At.length;Xt++)Ge.indexOf(At[Xt])<0&&Object.prototype.propertyIsEnumerable.call(it,At[Xt])&&(De[At[Xt]]=it[At[Xt]]);return De};const dt=(0,ve.forwardRef)((it,Ge)=>{const{prefixCls:De,bordered:At=!0,size:Xt,disabled:rt,status:ft,allowClear:Ie,showCount:xe,classNames:Ue,rootClassName:je,className:_t}=it,Ct=St(it,["prefixCls","bordered","size","disabled","status","allowClear","showCount","classNames","rootClassName","className"]),{getPrefixCls:Dt,direction:qe}=ve.useContext(ke.E_),Rt=(0,me.Z)(Xt),Pt=ve.useContext(Se.Z),En=rt!=null?rt:Pt,{status:tn,hasFeedback:$n,feedbackIcon:ur}=ve.useContext(Ee.aM),wr=(0,_e.F)(tn,ft),Je=ve.useRef(null);ve.useImperativeHandle(Ge,()=>{var ot;return{resizableTextArea:(ot=Je.current)===null||ot===void 0?void 0:ot.resizableTextArea,focus:nt=>{var Tt,rn;(0,tt.n)((rn=(Tt=Je.current)===null||Tt===void 0?void 0:Tt.resizableTextArea)===null||rn===void 0?void 0:rn.textArea,nt)},blur:()=>{var nt;return(nt=Je.current)===null||nt===void 0?void 0:nt.blur()}}});const Ae=Dt("input",De);let Ht;typeof Ie=="object"&&(Ie!=null&&Ie.clearIcon)?Ht=Ie:Ie&&(Ht={clearIcon:ve.createElement(he.Z,null)});const[Rn,yn]=(0,Be.ZP)(Ae);return Rn(ve.createElement(Ve.default,Object.assign({},Ct,{disabled:En,allowClear:Ht,className:Re()(_t,je),classes:{affixWrapper:Re()(`${Ae}-textarea-affix-wrapper`,{[`${Ae}-affix-wrapper-rtl`]:qe==="rtl",[`${Ae}-affix-wrapper-borderless`]:!At,[`${Ae}-affix-wrapper-sm`]:Rt==="small",[`${Ae}-affix-wrapper-lg`]:Rt==="large",[`${Ae}-textarea-show-count`]:xe},(0,_e.Z)(`${Ae}-affix-wrapper`,wr),yn)},classNames:Object.assign(Object.assign({},Ue),{textarea:Re()({[`${Ae}-borderless`]:!At,[`${Ae}-sm`]:Rt==="small",[`${Ae}-lg`]:Rt==="large"},(0,_e.Z)(Ae,wr),yn,Ue==null?void 0:Ue.textarea)}),prefixCls:Ae,suffix:$n&&ve.createElement("span",{className:`${Ae}-textarea-suffix`},ur),showCount:xe,ref:Je})))});Wt.Z=dt},72922:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return He}});var he=se(67294);function He(Re,Ve){const ve=(0,he.useRef)([]),_e=()=>{ve.current.push(setTimeout(()=>{var ke,Se,me,Ee;!((ke=Re.current)===null||ke===void 0)&&ke.input&&((Se=Re.current)===null||Se===void 0?void 0:Se.input.getAttribute("type"))==="password"&&(!((me=Re.current)===null||me===void 0)&&me.input.hasAttribute("value"))&&((Ee=Re.current)===null||Ee===void 0||Ee.input.removeAttribute("value"))}))};return(0,he.useEffect)(()=>(Ve&&_e(),()=>ve.current.forEach(ke=>{ke&&clearTimeout(ke)})),[]),_e}},69677:function(Sn,Wt,se){"use strict";se.d(Wt,{default:function(){return Rt}});var he=se(94184),He=se.n(he),Re=se(67294),Ve=se(53124),ve=se(65223),_e=se(47673),Se=Pt=>{const{getPrefixCls:En,direction:tn}=(0,Re.useContext)(Ve.E_),{prefixCls:$n,className:ur}=Pt,wr=En("input-group",$n),Je=En("input"),[Ae,Ht]=(0,_e.ZP)(Je),Rn=He()(wr,{[`${wr}-lg`]:Pt.size==="large",[`${wr}-sm`]:Pt.size==="small",[`${wr}-compact`]:Pt.compact,[`${wr}-rtl`]:tn==="rtl"},Ht,ur),yn=(0,Re.useContext)(ve.aM),ot=(0,Re.useMemo)(()=>Object.assign(Object.assign({},yn),{isFormItemInput:!1}),[yn]);return Ae(Re.createElement("span",{className:Rn,style:Pt.style,onMouseEnter:Pt.onMouseEnter,onMouseLeave:Pt.onMouseLeave,onFocus:Pt.onFocus,onBlur:Pt.onBlur},Re.createElement(ve.aM.Provider,{value:ot},Pt.children)))},me=se(82586),Ee=se(63237),tt=se(99569),Be=se(10366),St=se(17799),dt=se(72922),it=function(Pt,En){var tn={};for(var $n in Pt)Object.prototype.hasOwnProperty.call(Pt,$n)&&En.indexOf($n)<0&&(tn[$n]=Pt[$n]);if(Pt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ur=0,$n=Object.getOwnPropertySymbols(Pt);ur<$n.length;ur++)En.indexOf($n[ur])<0&&Object.prototype.propertyIsEnumerable.call(Pt,$n[ur])&&(tn[$n[ur]]=Pt[$n[ur]]);return tn};const Ge=Pt=>Pt?Re.createElement(tt.Z,null):Re.createElement(Ee.Z,null),De={click:"onClick",hover:"onMouseOver"};var Xt=Re.forwardRef((Pt,En)=>{const{visibilityToggle:tn=!0}=Pt,$n=typeof tn=="object"&&tn.visible!==void 0,[ur,wr]=(0,Re.useState)(()=>$n?tn.visible:!1),Je=(0,Re.useRef)(null);Re.useEffect(()=>{$n&&wr(tn.visible)},[$n,tn]);const Ae=(0,dt.Z)(Je),Ht=()=>{const{disabled:ue}=Pt;ue||(ur&&Ae(),wr(oe=>{var pe;const fe=!oe;return typeof tn=="object"&&((pe=tn.onVisibleChange)===null||pe===void 0||pe.call(tn,fe)),fe}))},Rn=ue=>{const{action:oe="click",iconRender:pe=Ge}=Pt,fe=De[oe]||"",le=pe(ur),Pe={[fe]:Ht,className:`${ue}-icon`,key:"passwordIcon",onMouseDown:Qe=>{Qe.preventDefault()},onMouseUp:Qe=>{Qe.preventDefault()}};return Re.cloneElement(Re.isValidElement(le)?le:Re.createElement("span",null,le),Pe)},{className:yn,prefixCls:ot,inputPrefixCls:nt,size:Tt}=Pt,rn=it(Pt,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:dn}=Re.useContext(Ve.E_),Ut=dn("input",nt),Kt=dn("input-password",ot),bn=tn&&Rn(Kt),nn=He()(Kt,yn,{[`${Kt}-${Tt}`]:!!Tt}),we=Object.assign(Object.assign({},(0,Be.Z)(rn,["suffix","iconRender","visibilityToggle"])),{type:ur?"text":"password",className:nn,prefixCls:Ut,suffix:bn});return Tt&&(we.size=Tt),Re.createElement(me.Z,Object.assign({ref:(0,St.sQ)(En,Je)},we))}),rt=se(72395),ft=se(96159),Ie=se(71577),xe=se(98675),Ue=se(4173),je=function(Pt,En){var tn={};for(var $n in Pt)Object.prototype.hasOwnProperty.call(Pt,$n)&&En.indexOf($n)<0&&(tn[$n]=Pt[$n]);if(Pt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ur=0,$n=Object.getOwnPropertySymbols(Pt);ur<$n.length;ur++)En.indexOf($n[ur])<0&&Object.prototype.propertyIsEnumerable.call(Pt,$n[ur])&&(tn[$n[ur]]=Pt[$n[ur]]);return tn},Ct=Re.forwardRef((Pt,En)=>{const{prefixCls:tn,inputPrefixCls:$n,className:ur,size:wr,suffix:Je,enterButton:Ae=!1,addonAfter:Ht,loading:Rn,disabled:yn,onSearch:ot,onChange:nt,onCompositionStart:Tt,onCompositionEnd:rn}=Pt,dn=je(Pt,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:Ut,direction:Kt}=Re.useContext(Ve.E_),bn=Re.useRef(!1),nn=Ut("input-search",tn),we=Ut("input",$n),{compactSize:ue}=(0,Ue.ri)(nn,Kt),oe=(0,xe.Z)(Mn=>{var Vn;return(Vn=wr!=null?wr:ue)!==null&&Vn!==void 0?Vn:Mn}),pe=Re.useRef(null),fe=Mn=>{Mn&&Mn.target&&Mn.type==="click"&&ot&&ot(Mn.target.value,Mn,{source:"clear"}),nt&&nt(Mn)},le=Mn=>{var Vn;document.activeElement===((Vn=pe.current)===null||Vn===void 0?void 0:Vn.input)&&Mn.preventDefault()},Pe=Mn=>{var Vn,br;ot&&ot((br=(Vn=pe.current)===null||Vn===void 0?void 0:Vn.input)===null||br===void 0?void 0:br.value,Mn,{source:"input"})},Qe=Mn=>{bn.current||Rn||Pe(Mn)},It=typeof Ae=="boolean"?Re.createElement(rt.Z,null):null,Nt=`${nn}-button`;let qt;const an=Ae||{},jt=an.type&&an.type.__ANT_BUTTON===!0;jt||an.type==="button"?qt=(0,ft.Tm)(an,Object.assign({onMouseDown:le,onClick:Mn=>{var Vn,br;(br=(Vn=an==null?void 0:an.props)===null||Vn===void 0?void 0:Vn.onClick)===null||br===void 0||br.call(Vn,Mn),Pe(Mn)},key:"enterButton"},jt?{className:Nt,size:oe}:{})):qt=Re.createElement(Ie.ZP,{className:Nt,type:Ae?"primary":void 0,size:oe,disabled:yn,key:"enterButton",onMouseDown:le,onClick:Pe,loading:Rn,icon:It},Ae),Ht&&(qt=[qt,(0,ft.Tm)(Ht,{key:"addonAfter"})]);const ir=He()(nn,{[`${nn}-rtl`]:Kt==="rtl",[`${nn}-${oe}`]:!!oe,[`${nn}-with-button`]:!!Ae},ur),Cr=Mn=>{bn.current=!0,Tt==null||Tt(Mn)},Bt=Mn=>{bn.current=!1,rn==null||rn(Mn)};return Re.createElement(me.Z,Object.assign({ref:(0,St.sQ)(pe,En),onPressEnter:Qe},dn,{size:oe,onCompositionStart:Cr,onCompositionEnd:Bt,prefixCls:we,addonAfter:qt,suffix:Je,onChange:fe,className:ir,disabled:yn}))}),Dt=se(96330);const qe=me.Z;qe.Group=Se,qe.Search=Ct,qe.TextArea=Dt.Z,qe.Password=Xt;var Rt=qe},47673:function(Sn,Wt,se){"use strict";se.d(Wt,{M1:function(){return ke},TM:function(){return ft},Xy:function(){return Se},bi:function(){return tt},e5:function(){return rt},ik:function(){return Be},nz:function(){return ve},pU:function(){return _e},s7:function(){return St},x0:function(){return Ee}});var he=se(14747),He=se(80110),Re=se(45503),Ve=se(67968);const ve=Ie=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:Ie,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),_e=Ie=>({borderColor:Ie.hoverBorderColor}),ke=Ie=>({borderColor:Ie.activeBorderColor,boxShadow:Ie.activeShadow,outline:0}),Se=Ie=>({color:Ie.colorTextDisabled,backgroundColor:Ie.colorBgContainerDisabled,borderColor:Ie.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},_e((0,Re.TS)(Ie,{hoverBorderColor:Ie.colorBorder})))}),me=Ie=>{const{paddingBlockLG:xe,fontSizeLG:Ue,lineHeightLG:je,borderRadiusLG:_t,paddingInlineLG:Ct}=Ie;return{padding:`${xe}px ${Ct}px`,fontSize:Ue,lineHeight:je,borderRadius:_t}},Ee=Ie=>({padding:`${Ie.paddingBlockSM}px ${Ie.paddingInlineSM}px`,borderRadius:Ie.borderRadiusSM}),tt=(Ie,xe)=>{const{componentCls:Ue,colorError:je,colorWarning:_t,errorActiveShadow:Ct,warningActiveShadow:Dt,colorErrorBorderHover:qe,colorWarningBorderHover:Rt}=Ie;return{[`&-status-error:not(${xe}-disabled):not(${xe}-borderless)${xe}`]:{borderColor:je,"&:hover":{borderColor:qe},"&:focus, &-focused":Object.assign({},ke((0,Re.TS)(Ie,{activeBorderColor:je,activeShadow:Ct}))),[`${Ue}-prefix, ${Ue}-suffix`]:{color:je}},[`&-status-warning:not(${xe}-disabled):not(${xe}-borderless)${xe}`]:{borderColor:_t,"&:hover":{borderColor:Rt},"&:focus, &-focused":Object.assign({},ke((0,Re.TS)(Ie,{activeBorderColor:_t,activeShadow:Dt}))),[`${Ue}-prefix, ${Ue}-suffix`]:{color:_t}}}},Be=Ie=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${Ie.paddingBlock}px ${Ie.paddingInline}px`,color:Ie.colorText,fontSize:Ie.fontSize,lineHeight:Ie.lineHeight,backgroundColor:Ie.colorBgContainer,backgroundImage:"none",borderWidth:Ie.lineWidth,borderStyle:Ie.lineType,borderColor:Ie.colorBorder,borderRadius:Ie.borderRadius,transition:`all ${Ie.motionDurationMid}`},ve(Ie.colorTextPlaceholder)),{"&:hover":Object.assign({},_e(Ie)),"&:focus, &-focused":Object.assign({},ke(Ie)),"&-disabled, &[disabled]":Object.assign({},Se(Ie)),"&-borderless":{"&, &:hover, &:focus, &-focused, &-disabled, &[disabled]":{backgroundColor:"transparent",border:"none",boxShadow:"none"}},"textarea&":{maxWidth:"100%",height:"auto",minHeight:Ie.controlHeight,lineHeight:Ie.lineHeight,verticalAlign:"bottom",transition:`all ${Ie.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},me(Ie)),"&-sm":Object.assign({},Ee(Ie)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),St=Ie=>{const{componentCls:xe,antCls:Ue}=Ie;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:Ie.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${xe}, &-lg > ${xe}-group-addon`]:Object.assign({},me(Ie)),[`&-sm ${xe}, &-sm > ${xe}-group-addon`]:Object.assign({},Ee(Ie)),[`&-lg ${Ue}-select-single ${Ue}-select-selector`]:{height:Ie.controlHeightLG},[`&-sm ${Ue}-select-single ${Ue}-select-selector`]:{height:Ie.controlHeightSM},[`> ${xe}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${xe}-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 ${Ie.paddingInline}px`,color:Ie.colorText,fontWeight:"normal",fontSize:Ie.fontSize,textAlign:"center",backgroundColor:Ie.colorFillAlter,border:`${Ie.lineWidth}px ${Ie.lineType} ${Ie.colorBorder}`,borderRadius:Ie.borderRadius,transition:`all ${Ie.motionDurationSlow}`,lineHeight:1,[`${Ue}-select`]:{margin:`-${Ie.paddingBlock+1}px -${Ie.paddingInline}px`,[`&${Ue}-select-single:not(${Ue}-select-customize-input)`]:{[`${Ue}-select-selector`]:{backgroundColor:"inherit",border:`${Ie.lineWidth}px ${Ie.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${Ue}-select-selector`]:{color:Ie.colorPrimary}}},[`${Ue}-cascader-picker`]:{margin:`-9px -${Ie.paddingInline}px`,backgroundColor:"transparent",[`${Ue}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${xe}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${xe}-search-with-button &`]:{zIndex:0}}},[`> ${xe}:first-child, ${xe}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${Ue}-select ${Ue}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${xe}-affix-wrapper`]:{[`&:not(:first-child) ${xe}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${xe}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${xe}:last-child, ${xe}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${Ue}-select ${Ue}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${xe}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${xe}-search &`]:{borderStartStartRadius:Ie.borderRadius,borderEndStartRadius:Ie.borderRadius}},[`&:not(:first-child), ${xe}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${xe}-group-compact`]:Object.assign(Object.assign({display:"block"},(0,he.dF)()),{[`${xe}-group-addon, ${xe}-group-wrap, > ${xe}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:Ie.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[`
& > ${xe}-affix-wrapper,
& > ${xe}-number-affix-wrapper,
& > ${Ue}-picker-range
`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-Ie.lineWidth,borderInlineEndWidth:Ie.lineWidth},[`${xe}`]:{float:"none"},[`& > ${Ue}-select > ${Ue}-select-selector,
& > ${Ue}-select-auto-complete ${xe},
& > ${Ue}-cascader-picker ${xe},
& > ${xe}-group-wrapper ${xe}`]:{borderInlineEndWidth:Ie.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},[`& > ${Ue}-select-focused`]:{zIndex:1},[`& > ${Ue}-select > ${Ue}-select-arrow`]:{zIndex:1},[`& > *:first-child,
& > ${Ue}-select:first-child > ${Ue}-select-selector,
& > ${Ue}-select-auto-complete:first-child ${xe},
& > ${Ue}-cascader-picker:first-child ${xe}`]:{borderStartStartRadius:Ie.borderRadius,borderEndStartRadius:Ie.borderRadius},[`& > *:last-child,
& > ${Ue}-select:last-child > ${Ue}-select-selector,
& > ${Ue}-cascader-picker:last-child ${xe},
& > ${Ue}-cascader-picker-focused:last-child ${xe}`]:{borderInlineEndWidth:Ie.lineWidth,borderStartEndRadius:Ie.borderRadius,borderEndEndRadius:Ie.borderRadius},[`& > ${Ue}-select-auto-complete ${xe}`]:{verticalAlign:"top"},[`${xe}-group-wrapper + ${xe}-group-wrapper`]:{marginInlineStart:-Ie.lineWidth,[`${xe}-affix-wrapper`]:{borderRadius:0}},[`${xe}-group-wrapper:not(:last-child)`]:{[`&${xe}-search > ${xe}-group`]:{[`& > ${xe}-group-addon > ${xe}-search-button`]:{borderRadius:0},[`& > ${xe}`]:{borderStartStartRadius:Ie.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:Ie.borderRadius}}}})}},dt=Ie=>{const{componentCls:xe,controlHeightSM:Ue,lineWidth:je}=Ie,Ct=(Ue-je*2-16)/2;return{[xe]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,he.Wf)(Ie)),Be(Ie)),tt(Ie,xe)),{'&[type="color"]':{height:Ie.controlHeight,[`&${xe}-lg`]:{height:Ie.controlHeightLG},[`&${xe}-sm`]:{height:Ue,paddingTop:Ct,paddingBottom:Ct}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},it=Ie=>{const{componentCls:xe}=Ie;return{[`${xe}-clear-icon`]:{margin:0,color:Ie.colorTextQuaternary,fontSize:Ie.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${Ie.motionDurationSlow}`,"&:hover":{color:Ie.colorTextTertiary},"&:active":{color:Ie.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${Ie.inputAffixPadding}px`}}}},Ge=Ie=>{const{componentCls:xe,inputAffixPadding:Ue,colorTextDescription:je,motionDurationSlow:_t,colorIcon:Ct,colorIconHover:Dt,iconCls:qe}=Ie;return{[`${xe}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Be(Ie)),{display:"inline-flex",[`&:not(${xe}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},_e(Ie)),{zIndex:1,[`${xe}-search-with-button &`]:{zIndex:0}}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${xe}[disabled]`]:{background:"transparent"}},[`> input${xe}`]:{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"'},[`${xe}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:Ie.paddingXS}},"&-show-count-suffix":{color:je},"&-show-count-has-suffix":{marginInlineEnd:Ie.paddingXXS},"&-prefix":{marginInlineEnd:Ue},"&-suffix":{marginInlineStart:Ue}}}),it(Ie)),{[`${qe}${xe}-password-icon`]:{color:Ct,cursor:"pointer",transition:`all ${_t}`,"&:hover":{color:Dt}}}),tt(Ie,`${xe}-affix-wrapper`))}},De=Ie=>{const{componentCls:xe,colorError:Ue,colorWarning:je,borderRadiusLG:_t,borderRadiusSM:Ct}=Ie;return{[`${xe}-group`]:Object.assign(Object.assign(Object.assign({},(0,he.Wf)(Ie)),St(Ie)),{"&-rtl":{direction:"rtl"},"&-wrapper":{display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${xe}-group-addon`]:{borderRadius:_t,fontSize:Ie.fontSizeLG}},"&-sm":{[`${xe}-group-addon`]:{borderRadius:Ct}},"&-status-error":{[`${xe}-group-addon`]:{color:Ue,borderColor:Ue}},"&-status-warning":{[`${xe}-group-addon`]:{color:je,borderColor:je}},"&-disabled":{[`${xe}-group-addon`]:Object.assign({},Se(Ie))},[`&:not(${xe}-compact-first-item):not(${xe}-compact-last-item)${xe}-compact-item`]:{[`${xe}, ${xe}-group-addon`]:{borderRadius:0}},[`&:not(${xe}-compact-last-item)${xe}-compact-first-item`]:{[`${xe}, ${xe}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${xe}-compact-first-item)${xe}-compact-last-item`]:{[`${xe}, ${xe}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}})}},At=Ie=>{const{componentCls:xe,antCls:Ue}=Ie,je=`${xe}-search`;return{[je]:{[`${xe}`]:{"&:hover, &:focus":{borderColor:Ie.colorPrimaryHover,[`+ ${xe}-group-addon ${je}-button:not(${Ue}-btn-primary)`]:{borderInlineStartColor:Ie.colorPrimaryHover}}},[`${xe}-affix-wrapper`]:{borderRadius:0},[`${xe}-lg`]:{lineHeight:Ie.lineHeightLG-2e-4},[`> ${xe}-group`]:{[`> ${xe}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${je}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:Ie.borderRadius,borderEndEndRadius:Ie.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${je}-button:not(${Ue}-btn-primary)`]:{color:Ie.colorTextDescription,"&:hover":{color:Ie.colorPrimaryHover},"&:active":{color:Ie.colorPrimaryActive},[`&${Ue}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${je}-button`]:{height:Ie.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${je}-button`]:{height:Ie.controlHeightLG},[`&-small ${je}-button`]:{height:Ie.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${xe}-compact-item`]:{[`&:not(${xe}-compact-last-item)`]:{[`${xe}-group-addon`]:{[`${xe}-search-button`]:{marginInlineEnd:-Ie.lineWidth,borderRadius:0}}},[`&:not(${xe}-compact-first-item)`]:{[`${xe},${xe}-affix-wrapper`]:{borderRadius:0}},[`> ${xe}-group-addon ${xe}-search-button,
> ${xe},
${xe}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${xe}-affix-wrapper-focused`]:{zIndex:2}}}}},Xt=Ie=>{const{componentCls:xe,paddingLG:Ue}=Ie,je=`${xe}-textarea`;return{[je]:{position:"relative","&-show-count":{[`> ${xe}`]:{height:"100%"},[`${xe}-data-count`]:{position:"absolute",bottom:-Ie.fontSize*Ie.lineHeight,insetInlineEnd:0,color:Ie.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${xe}`]:{paddingInlineEnd:Ue}},[`&-affix-wrapper${je}-has-feedback`]:{[`${xe}`]:{paddingInlineEnd:Ue}},[`&-affix-wrapper${xe}-affix-wrapper`]:{padding:0,[`> textarea${xe}`]:{fontSize:"inherit",border:"none",outline:"none","&:focus":{boxShadow:"none !important"}},[`${xe}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${xe}-clear-icon`]:{position:"absolute",insetInlineEnd:Ie.paddingXS,insetBlockStart:Ie.paddingXS},[`${je}-suffix`]:{position:"absolute",top:0,insetInlineEnd:Ie.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}};function rt(Ie){return(0,Re.TS)(Ie,{inputAffixPadding:Ie.paddingXXS})}const ft=Ie=>{const{controlHeight:xe,fontSize:Ue,lineHeight:je,lineWidth:_t,controlHeightSM:Ct,controlHeightLG:Dt,fontSizeLG:qe,lineHeightLG:Rt,paddingSM:Pt,controlPaddingHorizontalSM:En,controlPaddingHorizontal:tn,colorFillAlter:$n,colorPrimaryHover:ur,controlOutlineWidth:wr,controlOutline:Je,colorErrorOutline:Ae,colorWarningOutline:Ht}=Ie;return{paddingBlock:Math.max(Math.round((xe-Ue*je)/2*10)/10-_t,3),paddingBlockSM:Math.max(Math.round((Ct-Ue*je)/2*10)/10-_t,0),paddingBlockLG:Math.ceil((Dt-qe*Rt)/2*10)/10-_t,paddingInline:Pt-_t,paddingInlineSM:En-_t,paddingInlineLG:tn-_t,addonBg:$n,activeBorderColor:ur,hoverBorderColor:ur,activeShadow:`0 0 0 ${wr}px ${Je}`,errorActiveShadow:`0 0 0 ${wr}px ${Ae}`,warningActiveShadow:`0 0 0 ${wr}px ${Ht}`}};Wt.ZP=(0,Ve.Z)("Input",Ie=>{const xe=(0,Re.TS)(Ie,rt(Ie));return[dt(xe),Xt(xe),Ge(xe),De(xe),At(xe),(0,He.c)(xe)]},ft)},71322:function(Sn,Wt,se){"use strict";se.d(Wt,{D:function(){return Xt},Z:function(){return Ie}});var he=se(87462),He=se(67294),Re={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"},Ve=Re,ve=se(84089),_e=function(Ue,je){return He.createElement(ve.Z,(0,he.Z)({},Ue,{ref:je,icon:Ve}))},ke=He.forwardRef(_e),Se=se(22751),me=se(91034),Ee=se(94184),tt=se.n(Ee),Be=se(10366),dt=xe=>!isNaN(parseFloat(xe))&&isFinite(xe),it=se(53124),Ge=se(84321),De=function(xe,Ue){var je={};for(var _t in xe)Object.prototype.hasOwnProperty.call(xe,_t)&&Ue.indexOf(_t)<0&&(je[_t]=xe[_t]);if(xe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ct=0,_t=Object.getOwnPropertySymbols(xe);Ct<_t.length;Ct++)Ue.indexOf(_t[Ct])<0&&Object.prototype.propertyIsEnumerable.call(xe,_t[Ct])&&(je[_t[Ct]]=xe[_t[Ct]]);return je};const At={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px"},Xt=He.createContext({}),rt=(()=>{let xe=0;return function(){let Ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return xe+=1,`${Ue}${xe}`}})();var Ie=He.forwardRef((xe,Ue)=>{const{prefixCls:je,className:_t,trigger:Ct,children:Dt,defaultCollapsed:qe=!1,theme:Rt="dark",style:Pt={},collapsible:En=!1,reverseArrow:tn=!1,width:$n=200,collapsedWidth:ur=80,zeroWidthTriggerStyle:wr,breakpoint:Je,onCollapse:Ae,onBreakpoint:Ht}=xe,Rn=De(xe,["prefixCls","className","trigger","children","defaultCollapsed","theme","style","collapsible","reverseArrow","width","collapsedWidth","zeroWidthTriggerStyle","breakpoint","onCollapse","onBreakpoint"]),{siderHook:yn}=(0,He.useContext)(Ge.Gs),[ot,nt]=(0,He.useState)("collapsed"in xe?xe.collapsed:qe),[Tt,rn]=(0,He.useState)(!1);(0,He.useEffect)(()=>{"collapsed"in xe&&nt(xe.collapsed)},[xe.collapsed]);const dn=(ue,oe)=>{"collapsed"in xe||nt(ue),Ae==null||Ae(ue,oe)},Ut=(0,He.useRef)();Ut.current=ue=>{rn(ue.matches),Ht==null||Ht(ue.matches),ot!==ue.matches&&dn(ue.matches,"responsive")},(0,He.useEffect)(()=>{function ue(pe){return Ut.current(pe)}let oe;if(typeof window!="undefined"){const{matchMedia:pe}=window;if(pe&&Je&&Je in At){oe=pe(`(max-width: ${At[Je]})`);try{oe.addEventListener("change",ue)}catch(fe){oe.addListener(ue)}ue(oe)}}return()=>{try{oe==null||oe.removeEventListener("change",ue)}catch(pe){oe==null||oe.removeListener(ue)}}},[Je]),(0,He.useEffect)(()=>{const ue=rt("ant-sider-");return yn.addSider(ue),()=>yn.removeSider(ue)},[]);const Kt=()=>{dn(!ot,"clickTrigger")},{getPrefixCls:bn}=(0,He.useContext)(it.E_),nn=()=>{const ue=bn("layout-sider",je),oe=(0,Be.Z)(Rn,["collapsed"]),pe=ot?ur:$n,fe=dt(pe)?`${pe}px`:String(pe),le=parseFloat(String(ur||0))===0?He.createElement("span",{onClick:Kt,className:tt()(`${ue}-zero-width-trigger`,`${ue}-zero-width-trigger-${tn?"right":"left"}`),style:wr},Ct||He.createElement(ke,null)):null,It={expanded:tn?He.createElement(me.Z,null):He.createElement(Se.Z,null),collapsed:tn?He.createElement(Se.Z,null):He.createElement(me.Z,null)}[ot?"collapsed":"expanded"],Nt=Ct!==null?le||He.createElement("div",{className:`${ue}-trigger`,onClick:Kt,style:{width:fe}},Ct||It):null,qt=Object.assign(Object.assign({},Pt),{flex:`0 0 ${fe}`,maxWidth:fe,minWidth:fe,width:fe}),an=tt()(ue,`${ue}-${Rt}`,{[`${ue}-collapsed`]:!!ot,[`${ue}-has-trigger`]:En&&Ct!==null&&!le,[`${ue}-below`]:!!Tt,[`${ue}-zero-width`]:parseFloat(fe)===0},_t);return He.createElement("aside",Object.assign({className:an},oe,{style:qt,ref:Ue}),He.createElement("div",{className:`${ue}-children`},Dt),En||Tt&&le?Nt:null)},we=He.useMemo(()=>({siderCollapsed:ot}),[ot]);return He.createElement(Xt.Provider,{value:we},nn())})},97183:function(Sn,Wt,se){"use strict";var he=se(84321),He=se(71322);const Re=he.ZP;Re.Header=he.h4,Re.Footer=he.$_,Re.Content=he.VY,Re.Sider=He.Z,Wt.default=Re},84321:function(Sn,Wt,se){"use strict";se.d(Wt,{VY:function(){return rt},$_:function(){return Xt},h4:function(){return At},Gs:function(){return St},ZP:function(){return ft}});var he=se(74902),He=se(94184),Re=se.n(He),Ve=se(10366),ve=se(67294),_e=se(53124),ke=se(67968),me=Ie=>{const{componentCls:xe,bodyBg:Ue,lightSiderBg:je,lightTriggerBg:_t,lightTriggerColor:Ct}=Ie;return{[`${xe}-sider-light`]:{background:je,[`${xe}-sider-trigger`]:{color:Ct,background:_t},[`${xe}-sider-zero-width-trigger`]:{color:Ct,background:_t,border:`1px solid ${Ue}`,borderInlineStart:0}}}};const Ee=Ie=>{const{antCls:xe,componentCls:Ue,colorText:je,triggerColor:_t,footerBg:Ct,triggerBg:Dt,headerHeight:qe,headerPadding:Rt,headerColor:Pt,footerPadding:En,triggerHeight:tn,zeroTriggerHeight:$n,zeroTriggerWidth:ur,motionDurationMid:wr,motionDurationSlow:Je,fontSize:Ae,borderRadius:Ht,bodyBg:Rn,headerBg:yn,siderBg:ot}=Ie;return{[Ue]:Object.assign(Object.assign({display:"flex",flex:"auto",flexDirection:"column",minHeight:0,background:Rn,"&, *":{boxSizing:"border-box"},[`&${Ue}-has-sider`]:{flexDirection:"row",[`> ${Ue}, > ${Ue}-content`]:{width:0}},[`${Ue}-header, &${Ue}-footer`]:{flex:"0 0 auto"},[`${Ue}-sider`]:{position:"relative",minWidth:0,background:ot,transition:`all ${wr}, background 0s`,"&-children":{height:"100%",marginTop:-.1,paddingTop:.1,[`${xe}-menu${xe}-menu-inline-collapsed`]:{width:"auto"}},"&-has-trigger":{paddingBottom:tn},"&-right":{order:1},"&-trigger":{position:"fixed",bottom:0,zIndex:1,height:tn,color:_t,lineHeight:`${tn}px`,textAlign:"center",background:Dt,cursor:"pointer",transition:`all ${wr}`},"&-zero-width":{"> *":{overflow:"hidden"},"&-trigger":{position:"absolute",top:qe,insetInlineEnd:-ur,zIndex:1,width:ur,height:$n,color:_t,fontSize:Ie.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:ot,borderStartStartRadius:0,borderStartEndRadius:Ht,borderEndEndRadius:Ht,borderEndStartRadius:0,cursor:"pointer",transition:`background ${Je} ease`,"&::after":{position:"absolute",inset:0,background:"transparent",transition:`all ${Je}`,content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:-ur,borderStartStartRadius:Ht,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:Ht}}}}},me(Ie)),{"&-rtl":{direction:"rtl"}}),[`${Ue}-header`]:{height:qe,padding:Rt,color:Pt,lineHeight:`${qe}px`,background:yn,[`${xe}-menu`]:{lineHeight:"inherit"}},[`${Ue}-footer`]:{padding:En,color:je,fontSize:Ae,background:Ct},[`${Ue}-content`]:{flex:"auto",minHeight:0}}};var tt=(0,ke.Z)("Layout",Ie=>[Ee(Ie)],Ie=>{const{colorBgLayout:xe,controlHeight:Ue,controlHeightLG:je,colorText:_t,controlHeightSM:Ct,marginXXS:Dt,colorTextLightSolid:qe,colorBgContainer:Rt}=Ie,Pt=je*1.25;return{colorBgHeader:"#001529",colorBgBody:xe,colorBgTrigger:"#002140",bodyBg:xe,headerBg:"#001529",headerHeight:Ue*2,headerPadding:`0 ${Pt}px`,headerColor:_t,footerPadding:`${Ct}px ${Pt}px`,footerBg:xe,siderBg:"#001529",triggerHeight:je+Dt*2,triggerBg:"#002140",triggerColor:qe,zeroTriggerWidth:je,zeroTriggerHeight:je,lightSiderBg:Rt,lightTriggerBg:Rt,lightTriggerColor:_t}},{deprecatedTokens:[["colorBgBody","bodyBg"],["colorBgHeader","headerBg"],["colorBgTrigger","triggerBg"]]}),Be=function(Ie,xe){var Ue={};for(var je in Ie)Object.prototype.hasOwnProperty.call(Ie,je)&&xe.indexOf(je)<0&&(Ue[je]=Ie[je]);if(Ie!=null&&typeof Object.getOwnPropertySymbols=="function")for(var _t=0,je=Object.getOwnPropertySymbols(Ie);_t<je.length;_t++)xe.indexOf(je[_t])<0&&Object.prototype.propertyIsEnumerable.call(Ie,je[_t])&&(Ue[je[_t]]=Ie[je[_t]]);return Ue};const St=ve.createContext({siderHook:{addSider:()=>null,removeSider:()=>null}});function dt(Ie){let{suffixCls:xe,tagName:Ue,displayName:je}=Ie;return _t=>ve.forwardRef((Dt,qe)=>ve.createElement(_t,Object.assign({ref:qe,suffixCls:xe,tagName:Ue},Dt)))}const it=ve.forwardRef((Ie,xe)=>{const{prefixCls:Ue,suffixCls:je,className:_t,tagName:Ct}=Ie,Dt=Be(Ie,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:qe}=ve.useContext(_e.E_),Rt=qe("layout",Ue),[Pt,En]=tt(Rt),tn=je?`${Rt}-${je}`:Rt;return Pt(ve.createElement(Ct,Object.assign({className:Re()(Ue||tn,_t,En),ref:xe},Dt)))}),Ge=ve.forwardRef((Ie,xe)=>{const{direction:Ue}=ve.useContext(_e.E_),[je,_t]=ve.useState([]),{prefixCls:Ct,className:Dt,rootClassName:qe,children:Rt,hasSider:Pt,tagName:En,style:tn}=Ie,$n=Be(Ie,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),ur=(0,Ve.Z)($n,["suffixCls"]),{getPrefixCls:wr,layout:Je}=ve.useContext(_e.E_),Ae=wr("layout",Ct),[Ht,Rn]=tt(Ae),yn=Re()(Ae,{[`${Ae}-has-sider`]:typeof Pt=="boolean"?Pt:je.length>0,[`${Ae}-rtl`]:Ue==="rtl"},Je==null?void 0:Je.className,Dt,qe,Rn),ot=ve.useMemo(()=>({siderHook:{addSider:nt=>{_t(Tt=>[].concat((0,he.Z)(Tt),[nt]))},removeSider:nt=>{_t(Tt=>Tt.filter(rn=>rn!==nt))}}}),[]);return Ht(ve.createElement(St.Provider,{value:ot},ve.createElement(En,Object.assign({ref:xe,className:yn,style:Object.assign(Object.assign({},Je==null?void 0:Je.style),tn)},ur),Rt)))}),De=dt({tagName:"div",displayName:"Layout"})(Ge),At=dt({suffixCls:"header",tagName:"header",displayName:"Header"})(it),Xt=dt({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(it),rt=dt({suffixCls:"content",tagName:"main",displayName:"Content"})(it);var ft=De},76529:function(Sn,Wt,se){"use strict";se.d(Wt,{J:function(){return _e}});var he=se(67294),He=se(4173),Re=se(60276),Ve=function(ke,Se){var me={};for(var Ee in ke)Object.prototype.hasOwnProperty.call(ke,Ee)&&Se.indexOf(Ee)<0&&(me[Ee]=ke[Ee]);if(ke!=null&&typeof Object.getOwnPropertySymbols=="function")for(var tt=0,Ee=Object.getOwnPropertySymbols(ke);tt<Ee.length;tt++)Se.indexOf(Ee[tt])<0&&Object.prototype.propertyIsEnumerable.call(ke,Ee[tt])&&(me[Ee[tt]]=ke[Ee[tt]]);return me};const ve=he.createContext(null),_e=he.forwardRef((ke,Se)=>{const{children:me}=ke,Ee=Ve(ke,["children"]),tt=he.useContext(ve),Be=he.useMemo(()=>Object.assign(Object.assign({},tt),Ee),[tt,Ee.prefixCls,Ee.mode,Ee.selectable]);return he.createElement(ve.Provider,{value:Be},he.createElement(He.BR,null,(0,Re.supportNodeRef)(me)?he.cloneElement(me,{ref:Se}):me))});Wt.Z=ve},68508:function(Sn,Wt,se){"use strict";se.d(Wt,{default:function(){return ue}});var he=se(78595),He=se(67294),Re=se(71322),Ve=se(94184),ve=se.n(Ve),_e=se(53124),ke=function(oe,pe){var fe={};for(var le in oe)Object.prototype.hasOwnProperty.call(oe,le)&&pe.indexOf(le)<0&&(fe[le]=oe[le]);if(oe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Pe=0,le=Object.getOwnPropertySymbols(oe);Pe<le.length;Pe++)pe.indexOf(le[Pe])<0&&Object.prototype.propertyIsEnumerable.call(oe,le[Pe])&&(fe[le[Pe]]=oe[le[Pe]]);return fe},me=oe=>{const{prefixCls:pe,className:fe,dashed:le}=oe,Pe=ke(oe,["prefixCls","className","dashed"]),{getPrefixCls:Qe}=He.useContext(_e.E_),It=Qe("menu",pe),Nt=ve()({[`${It}-item-divider-dashed`]:!!le},fe);return He.createElement(he.iz,Object.assign({className:Nt},Pe))},Ee=se(37419),tt=se(10366),Be=se(83062),St=se(96159),it=(0,He.createContext)({prefixCls:"",firstLevel:!0,inlineCollapsed:!1}),De=oe=>{var pe;const{className:fe,children:le,icon:Pe,title:Qe,danger:It}=oe,{prefixCls:Nt,firstLevel:qt,direction:an,disableMenuItemTitleTooltip:jt,inlineCollapsed:ir}=He.useContext(it),Cr=$t=>{const In=He.createElement("span",{className:`${Nt}-title-content`},le);return(!Pe||(0,St.l$)(le)&&le.type==="span")&&le&&$t&&qt&&typeof le=="string"?He.createElement("div",{className:`${Nt}-inline-collapsed-noicon`},le.charAt(0)):In},{siderCollapsed:Bt}=He.useContext(Re.D);let Mn=Qe;typeof Qe=="undefined"?Mn=qt?le:"":Qe===!1&&(Mn="");const Vn={title:Mn};!Bt&&!ir&&(Vn.title=null,Vn.open=!1);const br=(0,Ee.Z)(le).length;let at=He.createElement(he.ck,Object.assign({},(0,tt.Z)(oe,["title","icon","danger"]),{className:ve()({[`${Nt}-item-danger`]:It,[`${Nt}-item-only-child`]:(Pe?br+1:br)===1},fe),title:typeof Qe=="string"?Qe:void 0}),(0,St.Tm)(Pe,{className:ve()((0,St.l$)(Pe)?(pe=Pe.props)===null||pe===void 0?void 0:pe.className:"",`${Nt}-item-icon`)}),Cr(ir));return jt||(at=He.createElement(Be.Z,Object.assign({},Vn,{placement:an==="rtl"?"left":"right",overlayClassName:`${Nt}-inline-collapsed-tooltip`}),at)),at},Xt=oe=>{var pe;const{popupClassName:fe,icon:le,title:Pe,theme:Qe}=oe,It=He.useContext(it),{prefixCls:Nt,inlineCollapsed:qt,theme:an}=It,jt=(0,he.Xl)();let ir;if(!le)ir=qt&&!jt.length&&Pe&&typeof Pe=="string"?He.createElement("div",{className:`${Nt}-inline-collapsed-noicon`},Pe.charAt(0)):He.createElement("span",{className:`${Nt}-title-content`},Pe);else{const Bt=(0,St.l$)(Pe)&&Pe.type==="span";ir=He.createElement(He.Fragment,null,(0,St.Tm)(le,{className:ve()((0,St.l$)(le)?(pe=le.props)===null||pe===void 0?void 0:pe.className:"",`${Nt}-item-icon`)}),Bt?Pe:He.createElement("span",{className:`${Nt}-title-content`},Pe))}const Cr=He.useMemo(()=>Object.assign(Object.assign({},It),{firstLevel:!1}),[It]);return He.createElement(it.Provider,{value:Cr},He.createElement(he.Wd,Object.assign({},(0,tt.Z)(oe,["icon"]),{title:ir,popupClassName:ve()(Nt,fe,`${Nt}-${Qe||an}`)})))},rt=se(25877),ft=se(60276),Ie=se(33603),xe=se(76529),Ue=function(oe,pe){var fe={};for(var le in oe)Object.prototype.hasOwnProperty.call(oe,le)&&pe.indexOf(le)<0&&(fe[le]=oe[le]);if(oe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Pe=0,le=Object.getOwnPropertySymbols(oe);Pe<le.length;Pe++)pe.indexOf(le[Pe])<0&&Object.prototype.propertyIsEnumerable.call(oe,le[Pe])&&(fe[le[Pe]]=oe[le[Pe]]);return fe};function je(oe){return(oe||[]).map((pe,fe)=>{if(pe&&typeof pe=="object"){const le=pe,{label:Pe,children:Qe,key:It,type:Nt}=le,qt=Ue(le,["label","children","key","type"]),an=It!=null?It:`tmp-${fe}`;return Qe||Nt==="group"?Nt==="group"?He.createElement(he.BW,Object.assign({key:an},qt,{title:Pe}),je(Qe)):He.createElement(Xt,Object.assign({key:an},qt,{title:Pe}),je(Qe)):Nt==="divider"?He.createElement(me,Object.assign({key:an},qt)):He.createElement(De,Object.assign({key:an},qt),Pe)}return null}).filter(pe=>pe)}function _t(oe){return He.useMemo(()=>oe&&je(oe),[oe])}var Ct=se(84780),Dt=se(14747),qe=se(33507),Rt=se(67771),Pt=se(50438),En=se(67968),tn=se(45503),ur=oe=>{const{componentCls:pe,motionDurationSlow:fe,horizontalLineHeight:le,colorSplit:Pe,lineWidth:Qe,lineType:It,itemPaddingInline:Nt}=oe;return{[`${pe}-horizontal`]:{lineHeight:le,border:0,borderBottom:`${Qe}px ${It} ${Pe}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${pe}-item, ${pe}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:Nt},[`> ${pe}-item:hover,
> ${pe}-item-active,
> ${pe}-submenu ${pe}-submenu-title:hover`]:{backgroundColor:"transparent"},[`${pe}-item, ${pe}-submenu-title`]:{transition:[`border-color ${fe}`,`background ${fe}`].join(",")},[`${pe}-submenu-arrow`]:{display:"none"}}}},Je=oe=>{let{componentCls:pe,menuArrowOffset:fe}=oe;return{[`${pe}-rtl`]:{direction:"rtl"},[`${pe}-submenu-rtl`]:{transformOrigin:"100% 0"},[`${pe}-rtl${pe}-vertical,
${pe}-submenu-rtl ${pe}-vertical`]:{[`${pe}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(-${fe})`},"&::after":{transform:`rotate(45deg) translateY(${fe})`}}}}};const Ae=oe=>Object.assign({},(0,Dt.oN)(oe));var Rn=(oe,pe)=>{const{componentCls:fe,itemColor:le,itemSelectedColor:Pe,groupTitleColor:Qe,itemBg:It,subMenuItemBg:Nt,itemSelectedBg:qt,activeBarHeight:an,activeBarWidth:jt,activeBarBorderWidth:ir,motionDurationSlow:Cr,motionEaseInOut:Bt,motionEaseOut:Mn,itemPaddingInline:Vn,motionDurationMid:br,itemHoverColor:at,lineType:$t,colorSplit:In,itemDisabledColor:Jn,dangerItemColor:ar,dangerItemHoverColor:Mr,dangerItemSelectedColor:$r,dangerItemActiveBg:Dr,dangerItemSelectedBg:Kr,itemHoverBg:ni,itemActiveBg:hr,menuSubMenuBg:mi,horizontalItemSelectedColor:Ji,horizontalItemSelectedBg:Ui,horizontalItemBorderRadius:Vi,horizontalItemHoverBg:ui,popupBg:yt}=oe;return{[`${fe}-${pe}, ${fe}-${pe} > ${fe}`]:{color:le,background:It,[`&${fe}-root:focus-visible`]:Object.assign({},Ae(oe)),[`${fe}-item-group-title`]:{color:Qe},[`${fe}-submenu-selected`]:{[`> ${fe}-submenu-title`]:{color:Pe}},[`${fe}-item-disabled, ${fe}-submenu-disabled`]:{color:`${Jn} !important`},[`${fe}-item:not(${fe}-item-selected):not(${fe}-submenu-selected)`]:{[`&:hover, > ${fe}-submenu-title:hover`]:{color:at}},[`&:not(${fe}-horizontal)`]:{[`${fe}-item:not(${fe}-item-selected)`]:{"&:hover":{backgroundColor:ni},"&:active":{backgroundColor:hr}},[`${fe}-submenu-title`]:{"&:hover":{backgroundColor:ni},"&:active":{backgroundColor:hr}}},[`${fe}-item-danger`]:{color:ar,[`&${fe}-item:hover`]:{[`&:not(${fe}-item-selected):not(${fe}-submenu-selected)`]:{color:Mr}},[`&${fe}-item:active`]:{background:Dr}},[`${fe}-item a`]:{"&, &:hover":{color:"inherit"}},[`${fe}-item-selected`]:{color:Pe,[`&${fe}-item-danger`]:{color:$r},"a, a:hover":{color:"inherit"}},[`& ${fe}-item-selected`]:{backgroundColor:qt,[`&${fe}-item-danger`]:{backgroundColor:Kr}},[`${fe}-item, ${fe}-submenu-title`]:{[`&:not(${fe}-item-disabled):focus-visible`]:Object.assign({},Ae(oe))},[`&${fe}-submenu > ${fe}`]:{backgroundColor:mi},[`&${fe}-popup > ${fe}`]:{backgroundColor:yt},[`&${fe}-horizontal`]:Object.assign(Object.assign({},pe==="dark"?{borderBottom:0}:{}),{[`> ${fe}-item, > ${fe}-submenu`]:{top:ir,marginTop:-ir,marginBottom:0,borderRadius:Vi,"&::after":{position:"absolute",insetInline:Vn,bottom:0,borderBottom:`${an}px solid transparent`,transition:`border-color ${Cr} ${Bt}`,content:'""'},"&:hover, &-active, &-open":{background:ui,"&::after":{borderBottomWidth:an,borderBottomColor:Ji}},"&-selected":{color:Ji,backgroundColor:Ui,"&:hover":{backgroundColor:Ui},"&::after":{borderBottomWidth:an,borderBottomColor:Ji}}}}),[`&${fe}-root`]:{[`&${fe}-inline, &${fe}-vertical`]:{borderInlineEnd:`${ir}px ${$t} ${In}`}},[`&${fe}-inline`]:{[`${fe}-sub${fe}-inline`]:{background:Nt},[`${fe}-item, ${fe}-submenu-title`]:ir&&jt?{width:`calc(100% + ${ir}px)`}:{},[`${fe}-item`]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${jt}px solid ${Pe}`,transform:"scaleY(0.0001)",opacity:0,transition:[`transform ${br} ${Mn}`,`opacity ${br} ${Mn}`].join(","),content:'""'},[`&${fe}-item-danger`]:{"&::after":{borderInlineEndColor:$r}}},[`${fe}-selected, ${fe}-item-selected`]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:[`transform ${br} ${Bt}`,`opacity ${br} ${Bt}`].join(",")}}}}}};const yn=oe=>{const{componentCls:pe,itemHeight:fe,itemMarginInline:le,padding:Pe,menuArrowSize:Qe,marginXS:It,itemMarginBlock:Nt}=oe,qt=Pe+Qe+It;return{[`${pe}-item`]:{position:"relative",overflow:"hidden"},[`${pe}-item, ${pe}-submenu-title`]:{height:fe,lineHeight:`${fe}px`,paddingInline:Pe,overflow:"hidden",textOverflow:"ellipsis",marginInline:le,marginBlock:Nt,width:`calc(100% - ${le*2}px)`},[`> ${pe}-item,
> ${pe}-submenu > ${pe}-submenu-title`]:{height:fe,lineHeight:`${fe}px`},[`${pe}-item-group-list ${pe}-submenu-title,
${pe}-submenu-title`]:{paddingInlineEnd:qt}}};var nt=oe=>{const{componentCls:pe,iconCls:fe,itemHeight:le,colorTextLightSolid:Pe,dropdownWidth:Qe,controlHeightLG:It,motionDurationMid:Nt,motionEaseOut:qt,paddingXL:an,itemMarginInline:jt,fontSizeLG:ir,motionDurationSlow:Cr,paddingXS:Bt,boxShadowSecondary:Mn,collapsedWidth:Vn,collapsedIconSize:br}=oe,at={height:le,lineHeight:`${le}px`,listStylePosition:"inside",listStyleType:"disc"};return[{[pe]:{"&-inline, &-vertical":Object.assign({[`&${pe}-root`]:{boxShadow:"none"}},yn(oe))},[`${pe}-submenu-popup`]:{[`${pe}-vertical`]:Object.assign(Object.assign({},yn(oe)),{boxShadow:Mn})}},{[`${pe}-submenu-popup ${pe}-vertical${pe}-sub`]:{minWidth:Qe,maxHeight:`calc(100vh - ${It*2.5}px)`,padding:"0",overflow:"hidden",borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:"hidden",overflowY:"auto"}}},{[`${pe}-inline`]:{width:"100%",[`&${pe}-root`]:{[`${pe}-item, ${pe}-submenu-title`]:{display:"flex",alignItems:"center",transition:[`border-color ${Cr}`,`background ${Cr}`,`padding ${Nt} ${qt}`].join(","),[`> ${pe}-title-content`]:{flex:"auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},"> *":{flex:"none"}}},[`${pe}-sub${pe}-inline`]:{padding:0,border:0,borderRadius:0,boxShadow:"none",[`& > ${pe}-submenu > ${pe}-submenu-title`]:at,[`& ${pe}-item-group-title`]:{paddingInlineStart:an}},[`${pe}-item`]:at}},{[`${pe}-inline-collapsed`]:{width:Vn,[`&${pe}-root`]:{[`${pe}-item, ${pe}-submenu ${pe}-submenu-title`]:{[`> ${pe}-inline-collapsed-noicon`]:{fontSize:ir,textAlign:"center"}}},[`> ${pe}-item,
> ${pe}-item-group > ${pe}-item-group-list > ${pe}-item,
> ${pe}-item-group > ${pe}-item-group-list > ${pe}-submenu > ${pe}-submenu-title,
> ${pe}-submenu > ${pe}-submenu-title`]:{insetInlineStart:0,paddingInline:`calc(50% - ${ir/2}px - ${jt}px)`,textOverflow:"clip",[`
${pe}-submenu-arrow,
${pe}-submenu-expand-icon
`]:{opacity:0},[`${pe}-item-icon, ${fe}`]:{margin:0,fontSize:br,lineHeight:`${le}px`,"+ span":{display:"inline-block",opacity:0}}},[`${pe}-item-icon, ${fe}`]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",[`${pe}-item-icon, ${fe}`]:{display:"none"},"a, a:hover":{color:Pe}},[`${pe}-item-group-title`]:Object.assign(Object.assign({},Dt.vS),{paddingInline:Bt})}}]};const Tt=oe=>{const{componentCls:pe,motionDurationSlow:fe,motionDurationMid:le,motionEaseInOut:Pe,motionEaseOut:Qe,iconCls:It,iconSize:Nt,iconMarginInlineEnd:qt}=oe;return{[`${pe}-item, ${pe}-submenu-title`]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:[`border-color ${fe}`,`background ${fe}`,`padding ${fe} ${Pe}`].join(","),[`${pe}-item-icon, ${It}`]:{minWidth:Nt,fontSize:Nt,transition:[`font-size ${le} ${Qe}`,`margin ${fe} ${Pe}`,`color ${fe}`].join(","),"+ span":{marginInlineStart:qt,opacity:1,transition:[`opacity ${fe} ${Pe}`,`margin ${fe}`,`color ${fe}`].join(",")}},[`${pe}-item-icon`]:Object.assign({},(0,Dt.Ro)()),[`&${pe}-item-only-child`]:{[`> ${It}, > ${pe}-item-icon`]:{marginInlineEnd:0}}},[`${pe}-item-disabled, ${pe}-submenu-disabled`]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important"},[`> ${pe}-submenu-title`]:{color:"inherit !important",cursor:"not-allowed"}}}},rn=oe=>{const{componentCls:pe,motionDurationSlow:fe,motionEaseInOut:le,borderRadius:Pe,menuArrowSize:Qe,menuArrowOffset:It}=oe;return{[`${pe}-submenu`]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:oe.margin,width:Qe,color:"currentcolor",transform:"translateY(-50%)",transition:`transform ${fe} ${le}, opacity ${fe}`},"&-arrow":{"&::before, &::after":{position:"absolute",width:Qe*.6,height:Qe*.15,backgroundColor:"currentcolor",borderRadius:Pe,transition:[`background ${fe} ${le}`,`transform ${fe} ${le}`,`top ${fe} ${le}`,`color ${fe} ${le}`].join(","),content:'""'},"&::before":{transform:`rotate(45deg) translateY(-${It})`},"&::after":{transform:`rotate(-45deg) translateY(${It})`}}}}},dn=oe=>{const{antCls:pe,componentCls:fe,fontSize:le,motionDurationSlow:Pe,motionDurationMid:Qe,motionEaseInOut:It,paddingXS:Nt,padding:qt,colorSplit:an,lineWidth:jt,zIndexPopup:ir,borderRadiusLG:Cr,subMenuItemBorderRadius:Bt,menuArrowSize:Mn,menuArrowOffset:Vn,lineType:br,menuPanelMaskInset:at,groupTitleLineHeight:$t,groupTitleFontSize:In}=oe;return[{"":{[`${fe}`]:Object.assign(Object.assign({},(0,Dt.dF)()),{"&-hidden":{display:"none"}})},[`${fe}-submenu-hidden`]:{display:"none"}},{[fe]: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:le,lineHeight:0,listStyle:"none",outline:"none",transition:`width ${Pe} cubic-bezier(0.2, 0, 0, 1) 0s`,"ul, ol":{margin:0,padding:0,listStyle:"none"},"&-overflow":{display:"flex",[`${fe}-item`]:{flex:"none"}},[`${fe}-item, ${fe}-submenu, ${fe}-submenu-title`]:{borderRadius:oe.itemBorderRadius},[`${fe}-item-group-title`]:{padding:`${Nt}px ${qt}px`,fontSize:In,lineHeight:$t,transition:`all ${Pe}`},[`&-horizontal ${fe}-submenu`]:{transition:[`border-color ${Pe} ${It}`,`background ${Pe} ${It}`].join(",")},[`${fe}-submenu, ${fe}-submenu-inline`]:{transition:[`border-color ${Pe} ${It}`,`background ${Pe} ${It}`,`padding ${Qe} ${It}`].join(",")},[`${fe}-submenu ${fe}-sub`]:{cursor:"initial",transition:[`background ${Pe} ${It}`,`padding ${Pe} ${It}`].join(",")},[`${fe}-title-content`]:{transition:`color ${Pe}`},[`${fe}-item a`]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},[`${fe}-item-divider`]:{overflow:"hidden",lineHeight:0,borderColor:an,borderStyle:br,borderWidth:0,borderTopWidth:jt,marginBlock:jt,padding:0,"&-dashed":{borderStyle:"dashed"}}}),Tt(oe)),{[`${fe}-item-group`]:{[`${fe}-item-group-list`]:{margin:0,padding:0,[`${fe}-item, ${fe}-submenu-title`]:{paddingInline:`${le*2}px ${qt}px`}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:ir,borderRadius:Cr,boxShadow:"none",transformOrigin:"0 0",[`&${fe}-submenu`]:{background:"transparent"},"&::before":{position:"absolute",inset:`${at}px 0 0`,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'}},"&-placement-rightTop::before":{top:0,insetInlineStart:at},"\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},[`> ${fe}`]:Object.assign(Object.assign(Object.assign({borderRadius:Cr},Tt(oe)),rn(oe)),{[`${fe}-item, ${fe}-submenu > ${fe}-submenu-title`]:{borderRadius:Bt},[`${fe}-submenu-title::after`]:{transition:`transform ${Pe} ${It}`}})}}),rn(oe)),{[`&-inline-collapsed ${fe}-submenu-arrow,
&-inline ${fe}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${Vn})`},"&::after":{transform:`rotate(45deg) translateX(-${Vn})`}},[`${fe}-submenu-open${fe}-submenu-inline > ${fe}-submenu-title > ${fe}-submenu-arrow`]:{transform:`translateY(-${Mn*.2}px)`,"&::after":{transform:`rotate(-45deg) translateX(-${Vn})`},"&::before":{transform:`rotate(45deg) translateX(${Vn})`}}})},{[`${pe}-layout-header`]:{[fe]:{lineHeight:"inherit"}}}]};var Ut=(oe,pe)=>(0,En.Z)("Menu",le=>{if(pe===!1)return[];const{colorBgElevated:Pe,colorPrimary:Qe,colorTextLightSolid:It,controlHeightLG:Nt,fontSize:qt,darkItemColor:an,darkDangerItemColor:jt,darkItemBg:ir,darkSubMenuItemBg:Cr,darkItemSelectedColor:Bt,darkItemSelectedBg:Mn,darkDangerItemSelectedBg:Vn,darkItemHoverBg:br,darkGroupTitleColor:at,darkItemHoverColor:$t,darkItemDisabledColor:In,darkDangerItemHoverColor:Jn,darkDangerItemSelectedColor:ar,darkDangerItemActiveBg:Mr}=le,$r=qt/7*5,Dr=(0,tn.TS)(le,{menuArrowSize:$r,menuHorizontalHeight:Nt*1.15,menuArrowOffset:`${$r*.25}px`,menuPanelMaskInset:-7,menuSubMenuBg:Pe}),Kr=(0,tn.TS)(Dr,{itemColor:an,itemHoverColor:$t,groupTitleColor:at,itemSelectedColor:Bt,itemBg:ir,popupBg:ir,subMenuItemBg:Cr,itemActiveBg:"transparent",itemSelectedBg:Mn,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:br,itemDisabledColor:In,dangerItemColor:jt,dangerItemHoverColor:Jn,dangerItemSelectedColor:ar,dangerItemActiveBg:Mr,dangerItemSelectedBg:Vn,menuSubMenuBg:Cr,horizontalItemSelectedColor:It,horizontalItemSelectedBg:Qe});return[dn(Dr),ur(Dr),nt(Dr),Rn(Dr,"light"),Rn(Kr,"dark"),Je(Dr),(0,qe.Z)(Dr),(0,Rt.oN)(Dr,"slide-up"),(0,Rt.oN)(Dr,"slide-down"),(0,Pt._y)(Dr,"zoom-big")]},le=>{const{colorPrimary:Pe,colorError:Qe,colorTextDisabled:It,colorErrorBg:Nt,colorText:qt,colorTextDescription:an,colorBgContainer:jt,colorFillAlter:ir,colorFillContent:Cr,lineWidth:Bt,lineWidthBold:Mn,controlItemBgActive:Vn,colorBgTextHover:br,controlHeightLG:at,lineHeight:$t,colorBgElevated:In,marginXXS:Jn,padding:ar,fontSize:Mr,controlHeightSM:$r,fontSizeLG:Dr,colorTextLightSolid:Kr,colorErrorHover:ni}=le,hr=new Ct.C(Kr).setAlpha(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:le.zIndexPopupBase+50,radiusItem:le.borderRadiusLG,itemBorderRadius:le.borderRadiusLG,radiusSubMenuItem:le.borderRadiusSM,subMenuItemBorderRadius:le.borderRadiusSM,colorItemText:qt,itemColor:qt,colorItemTextHover:qt,itemHoverColor:qt,colorItemTextHoverHorizontal:Pe,horizontalItemHoverColor:Pe,colorGroupTitle:an,groupTitleColor:an,colorItemTextSelected:Pe,itemSelectedColor:Pe,colorItemTextSelectedHorizontal:Pe,horizontalItemSelectedColor:Pe,colorItemBg:jt,itemBg:jt,colorItemBgHover:br,itemHoverBg:br,colorItemBgActive:Cr,itemActiveBg:Vn,colorSubItemBg:ir,subMenuItemBg:ir,colorItemBgSelected:Vn,itemSelectedBg:Vn,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:0,colorActiveBarHeight:Mn,activeBarHeight:Mn,colorActiveBarBorderSize:Bt,activeBarBorderWidth:Bt,colorItemTextDisabled:It,itemDisabledColor:It,colorDangerItemText:Qe,dangerItemColor:Qe,colorDangerItemTextHover:Qe,dangerItemHoverColor:Qe,colorDangerItemTextSelected:Qe,dangerItemSelectedColor:Qe,colorDangerItemBgActive:Nt,dangerItemActiveBg:Nt,colorDangerItemBgSelected:Nt,dangerItemSelectedBg:Nt,itemMarginInline:le.marginXXS,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:at,groupTitleLineHeight:$t,collapsedWidth:at*2,popupBg:In,itemMarginBlock:Jn,itemPaddingInline:ar,horizontalLineHeight:`${at*1.15}px`,iconSize:Mr,iconMarginInlineEnd:$r-Mr,collapsedIconSize:Dr,groupTitleFontSize:Mr,darkItemDisabledColor:new Ct.C(Kr).setAlpha(.25).toRgbString(),darkItemColor:hr,darkDangerItemColor:Qe,darkItemBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:Kr,darkItemSelectedBg:Pe,darkDangerItemSelectedBg:Qe,darkItemHoverBg:"transparent",darkGroupTitleColor:hr,darkItemHoverColor:Kr,darkDangerItemHoverColor:ni,darkDangerItemSelectedColor:Kr,darkDangerItemActiveBg:Qe}},{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),Kt=function(oe,pe){var fe={};for(var le in oe)Object.prototype.hasOwnProperty.call(oe,le)&&pe.indexOf(le)<0&&(fe[le]=oe[le]);if(oe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Pe=0,le=Object.getOwnPropertySymbols(oe);Pe<le.length;Pe++)pe.indexOf(le[Pe])<0&&Object.prototype.propertyIsEnumerable.call(oe,le[Pe])&&(fe[le[Pe]]=oe[le[Pe]]);return fe},nn=(0,He.forwardRef)((oe,pe)=>{var fe,le;const Pe=He.useContext(xe.Z),Qe=Pe||{},{getPrefixCls:It,getPopupContainer:Nt,direction:qt,menu:an}=He.useContext(_e.E_),jt=It(),{prefixCls:ir,className:Cr,style:Bt,theme:Mn="light",expandIcon:Vn,_internalDisableMenuItemTitleTooltip:br,inlineCollapsed:at,siderCollapsed:$t,items:In,children:Jn,rootClassName:ar,mode:Mr,selectable:$r,onClick:Dr,overflowedIndicatorPopupClassName:Kr}=oe,ni=Kt(oe,["prefixCls","className","style","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","items","children","rootClassName","mode","selectable","onClick","overflowedIndicatorPopupClassName"]),hr=(0,tt.Z)(ni,["collapsedWidth"]),mi=_t(In)||Jn;(fe=Qe.validator)===null||fe===void 0||fe.call(Qe,{mode:Mr});const Ji=(0,ft.useEvent)(function(){var Fn;Dr==null||Dr.apply(void 0,arguments),(Fn=Qe.onClick)===null||Fn===void 0||Fn.call(Qe)}),Ui=Qe.mode||Mr,Vi=$r!=null?$r:Qe.selectable,ui=He.useMemo(()=>$t!==void 0?$t:at,[at,$t]),yt={horizontal:{motionName:`${jt}-slide-up`},inline:(0,Ie.Z)(jt),other:{motionName:`${jt}-zoom-big`}},Cn=It("menu",ir||Qe.prefixCls),[Ln,Dn]=Ut(Cn,!Pe),sr=ve()(`${Cn}-${Mn}`,an==null?void 0:an.className,Cr);let nr;if(typeof Vn=="function")nr=Vn;else if(Vn===null||Vn===!1)nr=null;else if(Qe.expandIcon===null||Qe.expandIcon===!1)nr=null;else{const Fn=Vn!=null?Vn:Qe.expandIcon;nr=(0,St.Tm)(Fn,{className:ve()(`${Cn}-submenu-expand-icon`,(0,St.l$)(Fn)?(le=Fn.props)===null||le===void 0?void 0:le.className:"")})}const gr=He.useMemo(()=>({prefixCls:Cn,inlineCollapsed:ui||!1,direction:qt,firstLevel:!0,theme:Mn,mode:Ui,disableMenuItemTitleTooltip:br}),[Cn,ui,qt,br,Mn]);return Ln(He.createElement(xe.Z.Provider,{value:null},He.createElement(it.Provider,{value:gr},He.createElement(he.ZP,Object.assign({getPopupContainer:Nt,overflowedIndicator:He.createElement(rt.Z,null),overflowedIndicatorPopupClassName:ve()(Cn,`${Cn}-${Mn}`,Kr),mode:Ui,selectable:Vi,onClick:Ji},hr,{inlineCollapsed:ui,style:Object.assign(Object.assign({},an==null?void 0:an.style),Bt),className:sr,prefixCls:Cn,direction:qt,defaultMotions:yt,expandIcon:nr,ref:pe,rootClassName:ve()(ar,Dn)}),mi))))});const we=(0,He.forwardRef)((oe,pe)=>{const fe=(0,He.useRef)(null),le=He.useContext(Re.D);return(0,He.useImperativeHandle)(pe,()=>({menu:fe.current,focus:Pe=>{var Qe;(Qe=fe.current)===null||Qe===void 0||Qe.focus(Pe)}})),He.createElement(nn,Object.assign({ref:fe},oe,le))});we.Item=De,we.SubMenu=Xt,we.Divider=me,we.ItemGroup=he.BW;var ue=we},66330:function(Sn,Wt,se){"use strict";se.d(Wt,{t5:function(){return Ee}});var he=se(94184),He=se.n(he),Re=se(92419),Ve=se(67294),ve=se(53124),_e=se(81643),ke=se(20136),Se=function(Be,St){var dt={};for(var it in Be)Object.prototype.hasOwnProperty.call(Be,it)&&St.indexOf(it)<0&&(dt[it]=Be[it]);if(Be!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ge=0,it=Object.getOwnPropertySymbols(Be);Ge<it.length;Ge++)St.indexOf(it[Ge])<0&&Object.prototype.propertyIsEnumerable.call(Be,it[Ge])&&(dt[it[Ge]]=Be[it[Ge]]);return dt};const me=(Be,St,dt)=>{if(!(!St&&!dt))return Ve.createElement(Ve.Fragment,null,St&&Ve.createElement("div",{className:`${Be}-title`},(0,_e.Z)(St)),Ve.createElement("div",{className:`${Be}-inner-content`},(0,_e.Z)(dt)))},Ee=Be=>{const{hashId:St,prefixCls:dt,className:it,style:Ge,placement:De="top",title:At,content:Xt,children:rt}=Be;return Ve.createElement("div",{className:He()(St,dt,`${dt}-pure`,`${dt}-placement-${De}`,it),style:Ge},Ve.createElement("div",{className:`${dt}-arrow`}),Ve.createElement(Re.G,Object.assign({},Be,{className:St,prefixCls:dt}),rt||me(dt,At,Xt)))},tt=Be=>{const{prefixCls:St}=Be,dt=Se(Be,["prefixCls"]),{getPrefixCls:it}=Ve.useContext(ve.E_),Ge=it("popover",St),[De,At]=(0,ke.Z)(Ge);return De(Ve.createElement(Ee,Object.assign({},dt,{prefixCls:Ge,hashId:At})))};Wt.ZP=tt},55241:function(Sn,Wt,se){"use strict";var he=se(94184),He=se.n(he),Re=se(67294),Ve=se(81643),ve=se(33603),_e=se(53124),ke=se(83062),Se=se(66330),me=se(20136),Ee=function(St,dt){var it={};for(var Ge in St)Object.prototype.hasOwnProperty.call(St,Ge)&&dt.indexOf(Ge)<0&&(it[Ge]=St[Ge]);if(St!=null&&typeof Object.getOwnPropertySymbols=="function")for(var De=0,Ge=Object.getOwnPropertySymbols(St);De<Ge.length;De++)dt.indexOf(Ge[De])<0&&Object.prototype.propertyIsEnumerable.call(St,Ge[De])&&(it[Ge[De]]=St[Ge[De]]);return it};const tt=St=>{let{title:dt,content:it,prefixCls:Ge}=St;return Re.createElement(Re.Fragment,null,dt&&Re.createElement("div",{className:`${Ge}-title`},(0,Ve.Z)(dt)),Re.createElement("div",{className:`${Ge}-inner-content`},(0,Ve.Z)(it)))},Be=Re.forwardRef((St,dt)=>{const{prefixCls:it,title:Ge,content:De,overlayClassName:At,placement:Xt="top",trigger:rt="hover",mouseEnterDelay:ft=.1,mouseLeaveDelay:Ie=.1,overlayStyle:xe={}}=St,Ue=Ee(St,["prefixCls","title","content","overlayClassName","placement","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle"]),{getPrefixCls:je}=Re.useContext(_e.E_),_t=je("popover",it),[Ct,Dt]=(0,me.Z)(_t),qe=je(),Rt=He()(At,Dt);return Ct(Re.createElement(ke.Z,Object.assign({placement:Xt,trigger:rt,mouseEnterDelay:ft,mouseLeaveDelay:Ie,overlayStyle:xe},Ue,{prefixCls:_t,overlayClassName:Rt,ref:dt,overlay:Ge||De?Re.createElement(tt,{prefixCls:_t,title:Ge,content:De}):null,transitionName:(0,ve.m)(qe,"zoom-big",Ue.transitionName),"data-popover-inject":!0})))});Be._InternalPanelDoNotUseOrYouWillBeFired=Se.ZP,Wt.Z=Be},20136:function(Sn,Wt,se){"use strict";var he=se(14747),He=se(50438),Re=se(97414),Ve=se(8796),ve=se(67968),_e=se(45503);const ke=Ee=>{const{componentCls:tt,popoverColor:Be,minWidth:St,fontWeightStrong:dt,popoverPadding:it,boxShadowSecondary:Ge,colorTextHeading:De,borderRadiusLG:At,zIndexPopup:Xt,marginXS:rt,colorBgElevated:ft,popoverBg:Ie}=Ee;return[{[tt]:Object.assign(Object.assign({},(0,he.Wf)(Ee)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:Xt,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","--antd-arrow-background-color":ft,"&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${tt}-content`]:{position:"relative"},[`${tt}-inner`]:{backgroundColor:Ie,backgroundClip:"padding-box",borderRadius:At,boxShadow:Ge,padding:it},[`${tt}-title`]:{minWidth:St,marginBottom:rt,color:De,fontWeight:dt},[`${tt}-inner-content`]:{color:Be}})},(0,Re.ZP)(Ee,{colorBg:"var(--antd-arrow-background-color)"}),{[`${tt}-pure`]:{position:"relative",maxWidth:"none",margin:Ee.sizePopupArrow,display:"inline-block",[`${tt}-content`]:{display:"inline-block"}}}]},Se=Ee=>{const{componentCls:tt}=Ee;return{[tt]:Ve.i.map(Be=>{const St=Ee[`${Be}6`];return{[`&${tt}-${Be}`]:{"--antd-arrow-background-color":St,[`${tt}-inner`]:{backgroundColor:St},[`${tt}-arrow`]:{background:"transparent"}}}})}},me=Ee=>{const{componentCls:tt,lineWidth:Be,lineType:St,colorSplit:dt,paddingSM:it,controlHeight:Ge,fontSize:De,lineHeight:At,padding:Xt}=Ee,rt=Ge-Math.round(De*At),ft=rt/2,Ie=rt/2-Be,xe=Xt;return{[tt]:{[`${tt}-inner`]:{padding:0},[`${tt}-title`]:{margin:0,padding:`${ft}px ${xe}px ${Ie}px`,borderBottom:`${Be}px ${St} ${dt}`},[`${tt}-inner-content`]:{padding:`${it}px ${xe}px`}}}};Wt.Z=(0,ve.Z)("Popover",Ee=>{const{colorBgElevated:tt,colorText:Be,wireframe:St}=Ee,dt=(0,_e.TS)(Ee,{popoverPadding:12,popoverBg:tt,popoverColor:Be});return[ke(dt),Se(dt),St&&me(dt),(0,He._y)(dt,"zoom-big")]},Ee=>({width:177,minWidth:177,zIndexPopup:Ee.zIndexPopupBase+30}),{resetStyle:!1,deprecatedTokens:[["width","minWidth"]]})},38703:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return br}});var he=se(67294),He=se(87725),Re=se(18299),Ve=se(16646),ve=se(73475),_e=se(94184),ke=se.n(_e),Se=se(10366),me=se(53124),Ee=se(87462),tt=se(1413),Be=se(45987),St={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},dt=function(){var $t=(0,he.useRef)([]),In=(0,he.useRef)(null);return(0,he.useEffect)(function(){var Jn=Date.now(),ar=!1;$t.current.forEach(function(Mr){if(Mr){ar=!0;var $r=Mr.style;$r.transitionDuration=".3s, .3s, .3s, .06s",In.current&&Jn-In.current<100&&($r.transitionDuration="0s, 0s")}}),ar&&(In.current=Date.now())}),$t.current},it=["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"],Ge=function($t){var In=(0,tt.Z)((0,tt.Z)({},St),$t),Jn=In.className,ar=In.percent,Mr=In.prefixCls,$r=In.strokeColor,Dr=In.strokeLinecap,Kr=In.strokeWidth,ni=In.style,hr=In.trailColor,mi=In.trailWidth,Ji=In.transition,Ui=(0,Be.Z)(In,it);delete Ui.gapPosition;var Vi=Array.isArray(ar)?ar:[ar],ui=Array.isArray($r)?$r:[$r],yt=dt(),Cn=Kr/2,Ln=100-Kr/2,Dn="M ".concat(Dr==="round"?Cn:0,",").concat(Cn,`
L `).concat(Dr==="round"?Ln:100,",").concat(Cn),sr="0 0 100 ".concat(Kr),nr=0;return he.createElement("svg",(0,Ee.Z)({className:ke()("".concat(Mr,"-line"),Jn),viewBox:sr,preserveAspectRatio:"none",style:ni},Ui),he.createElement("path",{className:"".concat(Mr,"-line-trail"),d:Dn,strokeLinecap:Dr,stroke:hr,strokeWidth:mi||Kr,fillOpacity:"0"}),Vi.map(function(gr,Fn){var Xe=1;switch(Dr){case"round":Xe=1-Kr/100;break;case"square":Xe=1-Kr/2/100;break;default:Xe=1;break}var ut={strokeDasharray:"".concat(gr*Xe,"px, 100px"),strokeDashoffset:"-".concat(nr,"px"),transition:Ji||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Lt=ui[Fn]||ui[ui.length-1];return nr+=gr,he.createElement("path",{key:Fn,className:"".concat(Mr,"-line-path"),d:Dn,strokeLinecap:Dr,stroke:Lt,strokeWidth:Kr,fillOpacity:"0",ref:function(We){yt[Fn]=We},style:ut})}))},De=Ge,At=se(71002),Xt=se(97685),rt=se(98924),ft=0,Ie=(0,rt.Z)();function xe(){var at;return Ie?(at=ft,ft+=1):at="TEST_OR_SSR",at}var Ue=function(at){var $t=he.useState(),In=(0,Xt.Z)($t,2),Jn=In[0],ar=In[1];return he.useEffect(function(){ar("rc_progress_".concat(xe()))},[]),at||Jn},je=function($t){var In=$t.bg,Jn=$t.children;return he.createElement("div",{style:{width:"100%",height:"100%",background:In}},Jn)};function _t(at,$t){return Object.keys(at).map(function(In){var Jn=parseFloat(In),ar="".concat(Math.floor(Jn*$t),"%");return"".concat(at[In]," ").concat(ar)})}var Ct=he.forwardRef(function(at,$t){var In=at.prefixCls,Jn=at.color,ar=at.gradientId,Mr=at.radius,$r=at.style,Dr=at.ptg,Kr=at.strokeLinecap,ni=at.strokeWidth,hr=at.size,mi=at.gapDegree,Ji=Jn&&(0,At.Z)(Jn)==="object",Ui=Ji?"#FFF":void 0,Vi=hr/2,ui=he.createElement("circle",{className:"".concat(In,"-circle-path"),r:Mr,cx:Vi,cy:Vi,stroke:Ui,strokeLinecap:Kr,strokeWidth:ni,opacity:Dr===0?0:1,style:$r,ref:$t});if(!Ji)return ui;var yt="".concat(ar,"-conic"),Cn=mi?"".concat(180+mi/2,"deg"):"0deg",Ln=_t(Jn,(360-mi)/360),Dn=_t(Jn,1),sr="conic-gradient(from ".concat(Cn,", ").concat(Ln.join(", "),")"),nr="linear-gradient(to ".concat(mi?"bottom":"top",", ").concat(Dn.join(", "),")");return he.createElement(he.Fragment,null,he.createElement("mask",{id:yt},ui),he.createElement("foreignObject",{x:0,y:0,width:hr,height:hr,mask:"url(#".concat(yt,")")},he.createElement(je,{bg:nr},he.createElement(je,{bg:sr}))))}),Dt=Ct,qe=100,Rt=function($t,In,Jn,ar,Mr,$r,Dr,Kr,ni,hr){var mi=arguments.length>10&&arguments[10]!==void 0?arguments[10]:0,Ji=Jn/100*360*((360-$r)/360),Ui=$r===0?0:{bottom:0,top:180,left:90,right:-90}[Dr],Vi=(100-ar)/100*In;ni==="round"&&ar!==100&&(Vi+=hr/2,Vi>=In&&(Vi=In-.01));var ui=qe/2;return{stroke:typeof Kr=="string"?Kr:void 0,strokeDasharray:"".concat(In,"px ").concat($t),strokeDashoffset:Vi+mi,transform:"rotate(".concat(Mr+Ji+Ui,"deg)"),transformOrigin:"".concat(ui,"px ").concat(ui,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},Pt=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function En(at){var $t=at!=null?at:[];return Array.isArray($t)?$t:[$t]}var tn=function($t){var In=(0,tt.Z)((0,tt.Z)({},St),$t),Jn=In.id,ar=In.prefixCls,Mr=In.steps,$r=In.strokeWidth,Dr=In.trailWidth,Kr=In.gapDegree,ni=Kr===void 0?0:Kr,hr=In.gapPosition,mi=In.trailColor,Ji=In.strokeLinecap,Ui=In.style,Vi=In.className,ui=In.strokeColor,yt=In.percent,Cn=(0,Be.Z)(In,Pt),Ln=qe/2,Dn=Ue(Jn),sr="".concat(Dn,"-gradient"),nr=Ln-$r/2,gr=Math.PI*2*nr,Fn=ni>0?90+ni/2:-90,Xe=gr*((360-ni)/360),ut=(0,At.Z)(Mr)==="object"?Mr:{count:Mr,space:2},Lt=ut.count,Jt=ut.space,We=En(yt),mt=En(ui),zt=mt.find(function(qn){return qn&&(0,At.Z)(qn)==="object"}),Ot=zt&&(0,At.Z)(zt)==="object",Vt=Ot?"butt":Ji,Yt=Rt(gr,Xe,0,100,Fn,ni,hr,mi,Vt,$r),Hn=dt(),_r=function(){var or=0;return We.map(function(lr,ht){var st=mt[ht]||mt[mt.length-1],bt=Rt(gr,Xe,or,lr,Fn,ni,hr,st,Vt,$r);return or+=lr,he.createElement(Dt,{key:ht,color:st,ptg:lr,radius:nr,prefixCls:ar,gradientId:sr,style:bt,strokeLinecap:Vt,strokeWidth:$r,gapDegree:ni,ref:function(Pn){Hn[ht]=Pn},size:qe})}).reverse()},Qn=function(){var or=Math.round(Lt*(We[0]/100)),lr=100/Lt,ht=0;return new Array(Lt).fill(null).map(function(st,bt){var ln=bt<=or-1?mt[0]:mi,Pn=ln&&(0,At.Z)(ln)==="object"?"url(#".concat(sr,")"):void 0,cn=Rt(gr,Xe,ht,lr,Fn,ni,hr,ln,"butt",$r,Jt);return ht+=(Xe-cn.strokeDashoffset+Jt)*100/Xe,he.createElement("circle",{key:bt,className:"".concat(ar,"-circle-path"),r:nr,cx:Ln,cy:Ln,stroke:Pn,strokeWidth:$r,opacity:1,style:cn,ref:function(mn){Hn[bt]=mn}})})};return he.createElement("svg",(0,Ee.Z)({className:ke()("".concat(ar,"-circle"),Vi),viewBox:"0 0 ".concat(qe," ").concat(qe),style:Ui,id:Jn,role:"presentation"},Cn),!Lt&&he.createElement("circle",{className:"".concat(ar,"-circle-trail"),r:nr,cx:Ln,cy:Ln,stroke:mi,strokeLinecap:Vt,strokeWidth:Dr||$r,style:Yt}),Lt?Qn():_r())},$n=tn,ur={Line:De,Circle:$n},wr=se(83062),Je=se(16397);function Ae(at){return!at||at<0?0:at>100?100:at}function Ht(at){let{success:$t,successPercent:In}=at,Jn=In;return $t&&"progress"in $t&&(Jn=$t.progress),$t&&"percent"in $t&&(Jn=$t.percent),Jn}const Rn=at=>{let{percent:$t,success:In,successPercent:Jn}=at;const ar=Ae(Ht({success:In,successPercent:Jn}));return[ar,Ae(Ae($t)-ar)]},yn=at=>{let{success:$t={},strokeColor:In}=at;const{strokeColor:Jn}=$t;return[Jn||Je.presetPrimaryColors.green,In||null]},ot=(at,$t,In)=>{var Jn,ar,Mr,$r;let Dr=-1,Kr=-1;if($t==="step"){const ni=In.steps,hr=In.strokeWidth;typeof at=="string"||typeof at=="undefined"?(Dr=at==="small"?2:14,Kr=hr!=null?hr:8):typeof at=="number"?[Dr,Kr]=[at,at]:[Dr=14,Kr=8]=at,Dr*=ni}else if($t==="line"){const ni=In==null?void 0:In.strokeWidth;typeof at=="string"||typeof at=="undefined"?Kr=ni||(at==="small"?6:8):typeof at=="number"?[Dr,Kr]=[at,at]:[Dr=-1,Kr=8]=at}else($t==="circle"||$t==="dashboard")&&(typeof at=="string"||typeof at=="undefined"?[Dr,Kr]=at==="small"?[60,60]:[120,120]:typeof at=="number"?[Dr,Kr]=[at,at]:(Dr=(ar=(Jn=at[0])!==null&&Jn!==void 0?Jn:at[1])!==null&&ar!==void 0?ar:120,Kr=($r=(Mr=at[0])!==null&&Mr!==void 0?Mr:at[1])!==null&&$r!==void 0?$r:120));return[Dr,Kr]},nt=3,Tt=at=>nt/at*100;var dn=at=>{const{prefixCls:$t,trailColor:In=null,strokeLinecap:Jn="round",gapPosition:ar,gapDegree:Mr,width:$r=120,type:Dr,children:Kr,success:ni,size:hr=$r}=at,[mi,Ji]=ot(hr,"circle");let{strokeWidth:Ui}=at;Ui===void 0&&(Ui=Math.max(Tt(mi),6));const Vi={width:mi,height:Ji,fontSize:mi*.15+6},ui=he.useMemo(()=>{if(Mr||Mr===0)return Mr;if(Dr==="dashboard")return 75},[Mr,Dr]),yt=ar||Dr==="dashboard"&&"bottom"||void 0,Cn=Object.prototype.toString.call(at.strokeColor)==="[object Object]",Ln=yn({success:ni,strokeColor:at.strokeColor}),Dn=ke()(`${$t}-inner`,{[`${$t}-circle-gradient`]:Cn}),sr=he.createElement($n,{percent:Rn(at),strokeWidth:Ui,trailWidth:Ui,strokeColor:Ln,strokeLinecap:Jn,trailColor:In,prefixCls:$t,gapDegree:ui,gapPosition:yt});return he.createElement("div",{className:Dn,style:Vi},mi<=20?he.createElement(wr.Z,{title:Kr},he.createElement("span",null,sr)):he.createElement(he.Fragment,null,sr,Kr))},Ut=function(at,$t){var In={};for(var Jn in at)Object.prototype.hasOwnProperty.call(at,Jn)&&$t.indexOf(Jn)<0&&(In[Jn]=at[Jn]);if(at!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ar=0,Jn=Object.getOwnPropertySymbols(at);ar<Jn.length;ar++)$t.indexOf(Jn[ar])<0&&Object.prototype.propertyIsEnumerable.call(at,Jn[ar])&&(In[Jn[ar]]=at[Jn[ar]]);return In};const Kt=at=>{let $t=[];return Object.keys(at).forEach(In=>{const Jn=parseFloat(In.replace(/%/g,""));isNaN(Jn)||$t.push({key:Jn,value:at[In]})}),$t=$t.sort((In,Jn)=>In.key-Jn.key),$t.map(In=>{let{key:Jn,value:ar}=In;return`${ar} ${Jn}%`}).join(", ")},bn=(at,$t)=>{const{from:In=Je.presetPrimaryColors.blue,to:Jn=Je.presetPrimaryColors.blue,direction:ar=$t==="rtl"?"to left":"to right"}=at,Mr=Ut(at,["from","to","direction"]);if(Object.keys(Mr).length!==0){const $r=Kt(Mr);return{backgroundImage:`linear-gradient(${ar}, ${$r})`}}return{backgroundImage:`linear-gradient(${ar}, ${In}, ${Jn})`}};var we=at=>{const{prefixCls:$t,direction:In,percent:Jn,size:ar,strokeWidth:Mr,strokeColor:$r,strokeLinecap:Dr="round",children:Kr,trailColor:ni=null,success:hr}=at,mi=$r&&typeof $r!="string"?bn($r,In):{backgroundColor:$r},Ji=Dr==="square"||Dr==="butt"?0:void 0,Ui={backgroundColor:ni||void 0,borderRadius:Ji},Vi=ar!=null?ar:[-1,Mr||(ar==="small"?6:8)],[ui,yt]=ot(Vi,"line",{strokeWidth:Mr}),Cn=Object.assign({width:`${Ae(Jn)}%`,height:yt,borderRadius:Ji},mi),Ln=Ht(at),Dn={width:`${Ae(Ln)}%`,height:yt,borderRadius:Ji,backgroundColor:hr==null?void 0:hr.strokeColor},sr={width:ui<0?"100%":ui,height:yt};return he.createElement(he.Fragment,null,he.createElement("div",{className:`${$t}-outer`,style:sr},he.createElement("div",{className:`${$t}-inner`,style:Ui},he.createElement("div",{className:`${$t}-bg`,style:Cn}),Ln!==void 0?he.createElement("div",{className:`${$t}-success-bg`,style:Dn}):null)),Kr)},oe=at=>{const{size:$t,steps:In,percent:Jn=0,strokeWidth:ar=8,strokeColor:Mr,trailColor:$r=null,prefixCls:Dr,children:Kr}=at,ni=Math.round(In*(Jn/100)),hr=$t==="small"?2:14,mi=$t!=null?$t:[hr,ar],[Ji,Ui]=ot(mi,"step",{steps:In,strokeWidth:ar}),Vi=Ji/In,ui=new Array(In);for(let yt=0;yt<In;yt++){const Cn=Array.isArray(Mr)?Mr[yt]:Mr;ui[yt]=he.createElement("div",{key:yt,className:ke()(`${Dr}-steps-item`,{[`${Dr}-steps-item-active`]:yt<=ni-1}),style:{backgroundColor:yt<=ni-1?Cn:$r,width:Vi,height:Ui}})}return he.createElement("div",{className:`${Dr}-steps-outer`},ui,Kr)},pe=se(34367),fe=se(14747),le=se(67968),Pe=se(45503);const Qe=at=>{const $t=at?"100%":"-100%";return new pe.Keyframes(`antProgress${at?"RTL":"LTR"}Active`,{"0%":{transform:`translateX(${$t}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${$t}) scaleX(0)`,opacity:.5},to:{transform:"translateX(0) scaleX(1)",opacity:0}})},It=at=>{const{componentCls:$t,iconCls:In}=at;return{[$t]:Object.assign(Object.assign({},(0,fe.Wf)(at)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:at.fontSize,marginInlineEnd:at.marginXS,marginBottom:at.marginXS},[`${$t}-outer`]:{display:"inline-block",width:"100%"},[`&${$t}-show-info`]:{[`${$t}-outer`]:{marginInlineEnd:`calc(-2em - ${at.marginXS}px)`,paddingInlineEnd:`calc(2em + ${at.paddingXS}px)`}},[`${$t}-inner`]:{position:"relative",display:"inline-block",width:"100%",overflow:"hidden",verticalAlign:"middle",backgroundColor:at.remainingColor,borderRadius:at.lineBorderRadius},[`${$t}-inner:not(${$t}-circle-gradient)`]:{[`${$t}-circle-path`]:{stroke:at.defaultColor}},[`${$t}-success-bg, ${$t}-bg`]:{position:"relative",backgroundColor:at.defaultColor,borderRadius:at.lineBorderRadius,transition:`all ${at.motionDurationSlow} ${at.motionEaseInOutCirc}`},[`${$t}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:at.colorSuccess},[`${$t}-text`]:{display:"inline-block",width:"2em",marginInlineStart:at.marginXS,color:at.colorText,lineHeight:1,whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[In]:{fontSize:at.fontSize}},[`&${$t}-status-active`]:{[`${$t}-bg::before`]:{position:"absolute",inset:0,backgroundColor:at.colorBgContainer,borderRadius:at.lineBorderRadius,opacity:0,animationName:Qe(),animationDuration:at.progressActiveMotionDuration,animationTimingFunction:at.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${$t}-rtl${$t}-status-active`]:{[`${$t}-bg::before`]:{animationName:Qe(!0)}},[`&${$t}-status-exception`]:{[`${$t}-bg`]:{backgroundColor:at.colorError},[`${$t}-text`]:{color:at.colorError}},[`&${$t}-status-exception ${$t}-inner:not(${$t}-circle-gradient)`]:{[`${$t}-circle-path`]:{stroke:at.colorError}},[`&${$t}-status-success`]:{[`${$t}-bg`]:{backgroundColor:at.colorSuccess},[`${$t}-text`]:{color:at.colorSuccess}},[`&${$t}-status-success ${$t}-inner:not(${$t}-circle-gradient)`]:{[`${$t}-circle-path`]:{stroke:at.colorSuccess}}})}},Nt=at=>{const{componentCls:$t,iconCls:In}=at;return{[$t]:{[`${$t}-circle-trail`]:{stroke:at.remainingColor},[`&${$t}-circle ${$t}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${$t}-circle ${$t}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:at.circleTextColor,fontSize:at.circleTextFontSize,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[In]:{fontSize:`${at.fontSize/at.fontSizeSM}em`}},[`${$t}-circle&-status-exception`]:{[`${$t}-text`]:{color:at.colorError}},[`${$t}-circle&-status-success`]:{[`${$t}-text`]:{color:at.colorSuccess}}},[`${$t}-inline-circle`]:{lineHeight:1,[`${$t}-inner`]:{verticalAlign:"bottom"}}}},qt=at=>{const{componentCls:$t}=at;return{[$t]:{[`${$t}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:at.progressStepMinWidth,marginInlineEnd:at.progressStepMarginInlineEnd,backgroundColor:at.remainingColor,transition:`all ${at.motionDurationSlow}`,"&-active":{backgroundColor:at.defaultColor}}}}}},an=at=>{const{componentCls:$t,iconCls:In}=at;return{[$t]:{[`${$t}-small&-line, ${$t}-small&-line ${$t}-text ${In}`]:{fontSize:at.fontSizeSM}}}};var jt=(0,le.Z)("Progress",at=>{const $t=at.marginXXS/2,In=(0,Pe.TS)(at,{progressStepMarginInlineEnd:$t,progressStepMinWidth:$t,progressActiveMotionDuration:"2.4s"});return[It(In),Nt(In),qt(In),an(In)]},at=>({circleTextColor:at.colorText,defaultColor:at.colorInfo,remainingColor:at.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:"1em"})),ir=function(at,$t){var In={};for(var Jn in at)Object.prototype.hasOwnProperty.call(at,Jn)&&$t.indexOf(Jn)<0&&(In[Jn]=at[Jn]);if(at!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ar=0,Jn=Object.getOwnPropertySymbols(at);ar<Jn.length;ar++)$t.indexOf(Jn[ar])<0&&Object.prototype.propertyIsEnumerable.call(at,Jn[ar])&&(In[Jn[ar]]=at[Jn[ar]]);return In};const Cr=null,Bt=["normal","exception","active","success"];var Vn=he.forwardRef((at,$t)=>{const{prefixCls:In,className:Jn,rootClassName:ar,steps:Mr,strokeColor:$r,percent:Dr=0,size:Kr="default",showInfo:ni=!0,type:hr="line",status:mi,format:Ji,style:Ui}=at,Vi=ir(at,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format","style"]),ui=he.useMemo(()=>{var We,mt;const zt=Ht(at);return parseInt(zt!==void 0?(We=zt!=null?zt:0)===null||We===void 0?void 0:We.toString():(mt=Dr!=null?Dr:0)===null||mt===void 0?void 0:mt.toString(),10)},[Dr,at.success,at.successPercent]),yt=he.useMemo(()=>!Bt.includes(mi)&&ui>=100?"success":mi||"normal",[mi,ui]),{getPrefixCls:Cn,direction:Ln,progress:Dn}=he.useContext(me.E_),sr=Cn("progress",In),[nr,gr]=jt(sr),Fn=he.useMemo(()=>{if(!ni)return null;const We=Ht(at);let mt;const zt=Ji||(Vt=>`${Vt}%`),Ot=hr==="line";return Ji||yt!=="exception"&&yt!=="success"?mt=zt(Ae(Dr),Ae(We)):yt==="exception"?mt=Ot?he.createElement(Ve.Z,null):he.createElement(ve.Z,null):yt==="success"&&(mt=Ot?he.createElement(He.Z,null):he.createElement(Re.Z,null)),he.createElement("span",{className:`${sr}-text`,title:typeof mt=="string"?mt:void 0},mt)},[ni,Dr,ui,yt,hr,sr,Ji]),Xe=Array.isArray($r)?$r[0]:$r,ut=typeof $r=="string"||Array.isArray($r)?$r:void 0;let Lt;hr==="line"?Lt=Mr?he.createElement(oe,Object.assign({},at,{strokeColor:ut,prefixCls:sr,steps:Mr}),Fn):he.createElement(we,Object.assign({},at,{strokeColor:Xe,prefixCls:sr,direction:Ln}),Fn):(hr==="circle"||hr==="dashboard")&&(Lt=he.createElement(dn,Object.assign({},at,{strokeColor:Xe,prefixCls:sr,progressStatus:yt}),Fn));const Jt=ke()(sr,`${sr}-status-${yt}`,`${sr}-${hr==="dashboard"&&"circle"||Mr&&"steps"||hr}`,{[`${sr}-inline-circle`]:hr==="circle"&&ot(Kr,"circle")[0]<=20,[`${sr}-show-info`]:ni,[`${sr}-${Kr}`]:typeof Kr=="string",[`${sr}-rtl`]:Ln==="rtl"},Dn==null?void 0:Dn.className,Jn,ar,gr);return nr(he.createElement("div",Object.assign({ref:$t,style:Object.assign(Object.assign({},Dn==null?void 0:Dn.style),Ui),className:Jt,role:"progressbar","aria-valuenow":ui},(0,Se.Z)(Vi,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),Lt))}),br=Vn},78045:function(Sn,Wt,se){"use strict";se.d(Wt,{ZP:function(){return Je}});var he=se(94184),He=se.n(he),Re=se(5663),Ve=se(1337),ve=se(67294),_e=se(53124),ke=se(98675);const Se=ve.createContext(null),me=Se.Provider;var Ee=Se;const tt=ve.createContext(null),Be=tt.Provider;var St=se(95860),dt=se(17799),it=se(98866),Ge=se(65223),De=se(14747),At=se(67968),Xt=se(45503);const rt=Ae=>{const{componentCls:Ht,antCls:Rn}=Ae,yn=`${Ht}-group`;return{[yn]:Object.assign(Object.assign({},(0,De.Wf)(Ae)),{display:"inline-block",fontSize:0,[`&${yn}-rtl`]:{direction:"rtl"},[`${Rn}-badge ${Rn}-badge-count`]:{zIndex:1},[`> ${Rn}-badge:not(:first-child) > ${Rn}-button-wrapper`]:{borderInlineStart:"none"}})}},ft=Ae=>{const{componentCls:Ht,wrapperMarginInlineEnd:Rn,colorPrimary:yn,radioSize:ot,motionDurationSlow:nt,motionDurationMid:Tt,motionEaseInOutCirc:rn,colorBgContainer:dn,colorBorder:Ut,lineWidth:Kt,dotSize:bn,colorBgContainerDisabled:nn,colorTextDisabled:we,paddingXS:ue,dotColorDisabled:oe,lineType:pe,radioDotDisabledSize:fe,wireframe:le,colorWhite:Pe}=Ae,Qe=`${Ht}-inner`;return{[`${Ht}-wrapper`]:Object.assign(Object.assign({},(0,De.Wf)(Ae)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:Rn,cursor:"pointer",[`&${Ht}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:Ae.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},[`${Ht}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${Kt}px ${pe} ${yn}`,borderRadius:"50%",visibility:"hidden",content:'""'},[Ht]:Object.assign(Object.assign({},(0,De.Wf)(Ae)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${Ht}-wrapper:hover &,
&:hover ${Qe}`]:{borderColor:yn},[`${Ht}-input:focus-visible + ${Qe}`]:Object.assign({},(0,De.oN)(Ae)),[`${Ht}:hover::after, ${Ht}-wrapper:hover &::after`]:{visibility:"visible"},[`${Ht}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:ot,height:ot,marginBlockStart:ot/-2,marginInlineStart:ot/-2,backgroundColor:le?yn:Pe,borderBlockStart:0,borderInlineStart:0,borderRadius:ot,transform:"scale(0)",opacity:0,transition:`all ${nt} ${rn}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:ot,height:ot,backgroundColor:dn,borderColor:Ut,borderStyle:"solid",borderWidth:Kt,borderRadius:"50%",transition:`all ${Tt}`},[`${Ht}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${Ht}-checked`]:{[Qe]:{borderColor:yn,backgroundColor:le?dn:yn,"&::after":{transform:`scale(${bn/ot})`,opacity:1,transition:`all ${nt} ${rn}`}}},[`${Ht}-disabled`]:{cursor:"not-allowed",[Qe]:{backgroundColor:nn,borderColor:Ut,cursor:"not-allowed","&::after":{backgroundColor:oe}},[`${Ht}-input`]:{cursor:"not-allowed"},[`${Ht}-disabled + span`]:{color:we,cursor:"not-allowed"},[`&${Ht}-checked`]:{[Qe]:{"&::after":{transform:`scale(${fe/ot})`}}}},[`span${Ht} + *`]:{paddingInlineStart:ue,paddingInlineEnd:ue}})}},Ie=Ae=>{const{buttonColor:Ht,controlHeight:Rn,componentCls:yn,lineWidth:ot,lineType:nt,colorBorder:Tt,motionDurationSlow:rn,motionDurationMid:dn,buttonPaddingInline:Ut,fontSize:Kt,buttonBg:bn,fontSizeLG:nn,controlHeightLG:we,controlHeightSM:ue,paddingXS:oe,borderRadius:pe,borderRadiusSM:fe,borderRadiusLG:le,buttonCheckedBg:Pe,buttonSolidCheckedColor:Qe,colorTextDisabled:It,colorBgContainerDisabled:Nt,buttonCheckedBgDisabled:qt,buttonCheckedColorDisabled:an,colorPrimary:jt,colorPrimaryHover:ir,colorPrimaryActive:Cr,buttonSolidCheckedBg:Bt,buttonSolidCheckedHoverBg:Mn,buttonSolidCheckedActiveBg:Vn}=Ae;return{[`${yn}-button-wrapper`]:{position:"relative",display:"inline-block",height:Rn,margin:0,paddingInline:Ut,paddingBlock:0,color:Ht,fontSize:Kt,lineHeight:`${Rn-ot*2}px`,background:bn,border:`${ot}px ${nt} ${Tt}`,borderBlockStartWidth:ot+.02,borderInlineStartWidth:0,borderInlineEndWidth:ot,cursor:"pointer",transition:[`color ${dn}`,`background ${dn}`,`box-shadow ${dn}`].join(","),a:{color:Ht},[`> ${yn}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:-ot,insetInlineStart:-ot,display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:ot,paddingInline:0,backgroundColor:Tt,transition:`background-color ${rn}`,content:'""'}},"&:first-child":{borderInlineStart:`${ot}px ${nt} ${Tt}`,borderStartStartRadius:pe,borderEndStartRadius:pe},"&:last-child":{borderStartEndRadius:pe,borderEndEndRadius:pe},"&:first-child:last-child":{borderRadius:pe},[`${yn}-group-large &`]:{height:we,fontSize:nn,lineHeight:`${we-ot*2}px`,"&:first-child":{borderStartStartRadius:le,borderEndStartRadius:le},"&:last-child":{borderStartEndRadius:le,borderEndEndRadius:le}},[`${yn}-group-small &`]:{height:ue,paddingInline:oe-ot,paddingBlock:0,lineHeight:`${ue-ot*2}px`,"&:first-child":{borderStartStartRadius:fe,borderEndStartRadius:fe},"&:last-child":{borderStartEndRadius:fe,borderEndEndRadius:fe}},"&:hover":{position:"relative",color:jt},"&:has(:focus-visible)":Object.assign({},(0,De.oN)(Ae)),[`${yn}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${yn}-button-wrapper-disabled)`]:{zIndex:1,color:jt,background:Pe,borderColor:jt,"&::before":{backgroundColor:jt},"&:first-child":{borderColor:jt},"&:hover":{color:ir,borderColor:ir,"&::before":{backgroundColor:ir}},"&:active":{color:Cr,borderColor:Cr,"&::before":{backgroundColor:Cr}}},[`${yn}-group-solid &-checked:not(${yn}-button-wrapper-disabled)`]:{color:Qe,background:Bt,borderColor:Bt,"&:hover":{color:Qe,background:Mn,borderColor:Mn},"&:active":{color:Qe,background:Vn,borderColor:Vn}},"&-disabled":{color:It,backgroundColor:Nt,borderColor:Tt,cursor:"not-allowed","&:first-child, &:hover":{color:It,backgroundColor:Nt,borderColor:Tt}},[`&-disabled${yn}-button-wrapper-checked`]:{color:an,backgroundColor:qt,borderColor:Tt,boxShadow:"none"}}}},xe=Ae=>Ae-4*2;var Ue=(0,At.Z)("Radio",Ae=>{const{controlOutline:Ht,controlOutlineWidth:Rn,radioSize:yn}=Ae,ot=`0 0 0 ${Rn}px ${Ht}`,nt=ot,Tt=xe(yn),rn=(0,Xt.TS)(Ae,{radioDotDisabledSize:Tt,radioFocusShadow:ot,radioButtonFocusShadow:nt});return[rt(rn),ft(rn),Ie(rn)]},Ae=>{const{wireframe:Ht,padding:Rn,marginXS:yn,lineWidth:ot,fontSizeLG:nt,colorText:Tt,colorBgContainer:rn,colorTextDisabled:dn,controlItemBgActiveDisabled:Ut,colorTextLightSolid:Kt,colorPrimary:bn,colorPrimaryHover:nn,colorPrimaryActive:we}=Ae,ue=4,oe=nt,pe=Ht?xe(oe):oe-(ue+ot)*2;return{radioSize:oe,dotSize:pe,dotColorDisabled:dn,buttonSolidCheckedColor:Kt,buttonSolidCheckedBg:bn,buttonSolidCheckedHoverBg:nn,buttonSolidCheckedActiveBg:we,buttonBg:rn,buttonCheckedBg:rn,buttonColor:Tt,buttonCheckedBgDisabled:Ut,buttonCheckedColorDisabled:dn,buttonPaddingInline:Rn-ot,wrapperMarginInlineEnd:yn}}),je=se(45353),_t=se(92429),Ct=function(Ae,Ht){var Rn={};for(var yn in Ae)Object.prototype.hasOwnProperty.call(Ae,yn)&&Ht.indexOf(yn)<0&&(Rn[yn]=Ae[yn]);if(Ae!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ot=0,yn=Object.getOwnPropertySymbols(Ae);ot<yn.length;ot++)Ht.indexOf(yn[ot])<0&&Object.prototype.propertyIsEnumerable.call(Ae,yn[ot])&&(Rn[yn[ot]]=Ae[yn[ot]]);return Rn};const Dt=(Ae,Ht)=>{var Rn,yn;const ot=ve.useContext(Ee),nt=ve.useContext(tt),{getPrefixCls:Tt,direction:rn,radio:dn}=ve.useContext(_e.E_),Ut=ve.useRef(null),Kt=(0,dt.sQ)(Ht,Ut),{isFormItemInput:bn}=ve.useContext(Ge.aM),nn=Cr=>{var Bt,Mn;(Bt=Ae.onChange)===null||Bt===void 0||Bt.call(Ae,Cr),(Mn=ot==null?void 0:ot.onChange)===null||Mn===void 0||Mn.call(ot,Cr)},{prefixCls:we,className:ue,rootClassName:oe,children:pe,style:fe}=Ae,le=Ct(Ae,["prefixCls","className","rootClassName","children","style"]),Pe=Tt("radio",we),Qe=((ot==null?void 0:ot.optionType)||nt)==="button",It=Qe?`${Pe}-button`:Pe,[Nt,qt]=Ue(Pe),an=Object.assign({},le),jt=ve.useContext(it.Z);ot&&(an.name=ot.name,an.onChange=nn,an.checked=Ae.value===ot.value,an.disabled=(Rn=an.disabled)!==null&&Rn!==void 0?Rn:ot.disabled),an.disabled=(yn=an.disabled)!==null&&yn!==void 0?yn:jt;const ir=He()(`${It}-wrapper`,{[`${It}-wrapper-checked`]:an.checked,[`${It}-wrapper-disabled`]:an.disabled,[`${It}-wrapper-rtl`]:rn==="rtl",[`${It}-wrapper-in-form-item`]:bn},dn==null?void 0:dn.className,ue,oe,qt);return Nt(ve.createElement(je.Z,{component:"Radio",disabled:an.disabled},ve.createElement("label",{className:ir,style:Object.assign(Object.assign({},dn==null?void 0:dn.style),fe),onMouseEnter:Ae.onMouseEnter,onMouseLeave:Ae.onMouseLeave},ve.createElement(St.Z,Object.assign({},an,{className:He()(an.className,!Qe&&_t.A),type:"radio",prefixCls:It,ref:Kt})),pe!==void 0?ve.createElement("span",null,pe):null)))};var Rt=ve.forwardRef(Dt);const Pt=ve.forwardRef((Ae,Ht)=>{const{getPrefixCls:Rn,direction:yn}=ve.useContext(_e.E_),[ot,nt]=(0,Re.Z)(Ae.defaultValue,{value:Ae.value}),Tt=Bt=>{const Mn=ot,Vn=Bt.target.value;"value"in Ae||nt(Vn);const{onChange:br}=Ae;br&&Vn!==Mn&&br(Bt)},{prefixCls:rn,className:dn,rootClassName:Ut,options:Kt,buttonStyle:bn="outline",disabled:nn,children:we,size:ue,style:oe,id:pe,onMouseEnter:fe,onMouseLeave:le,onFocus:Pe,onBlur:Qe}=Ae,It=Rn("radio",rn),Nt=`${It}-group`,[qt,an]=Ue(It);let jt=we;Kt&&Kt.length>0&&(jt=Kt.map(Bt=>typeof Bt=="string"||typeof Bt=="number"?ve.createElement(Rt,{key:Bt.toString(),prefixCls:It,disabled:nn,value:Bt,checked:ot===Bt},Bt):ve.createElement(Rt,{key:`radio-group-value-options-${Bt.value}`,prefixCls:It,disabled:Bt.disabled||nn,value:Bt.value,checked:ot===Bt.value,title:Bt.title,style:Bt.style},Bt.label)));const ir=(0,ke.Z)(ue),Cr=He()(Nt,`${Nt}-${bn}`,{[`${Nt}-${ir}`]:ir,[`${Nt}-rtl`]:yn==="rtl"},dn,Ut,an);return qt(ve.createElement("div",Object.assign({},(0,Ve.Z)(Ae,{aria:!0,data:!0}),{className:Cr,style:oe,onMouseEnter:fe,onMouseLeave:le,onFocus:Pe,onBlur:Qe,id:pe,ref:Ht}),ve.createElement(me,{value:{onChange:Tt,value:ot,disabled:Ae.disabled,name:Ae.name,optionType:Ae.optionType}},jt)))});var En=ve.memo(Pt),tn=function(Ae,Ht){var Rn={};for(var yn in Ae)Object.prototype.hasOwnProperty.call(Ae,yn)&&Ht.indexOf(yn)<0&&(Rn[yn]=Ae[yn]);if(Ae!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ot=0,yn=Object.getOwnPropertySymbols(Ae);ot<yn.length;ot++)Ht.indexOf(yn[ot])<0&&Object.prototype.propertyIsEnumerable.call(Ae,yn[ot])&&(Rn[yn[ot]]=Ae[yn[ot]]);return Rn};const $n=(Ae,Ht)=>{const{getPrefixCls:Rn}=ve.useContext(_e.E_),{prefixCls:yn}=Ae,ot=tn(Ae,["prefixCls"]),nt=Rn("radio",yn);return ve.createElement(Be,{value:"button"},ve.createElement(Rt,Object.assign({prefixCls:nt},ot,{type:"radio",ref:Ht})))};var ur=ve.forwardRef($n);const wr=Rt;wr.Button=ur,wr.Group=En,wr.__ANT_RADIO=!0;var Je=wr},11713:function(Sn,Wt,se){"use strict";se.d(Wt,{default:function(){return yr}});var he=se(94184),He=se.n(he),Re=se(87462),Ve=se(74902),ve=se(4942),_e=se(1413),ke=se(97685),Se=se(45987),me=se(71002),Ee=se(67294);function tt(Oe){var Ke=Ee.useRef();Ke.current=Oe;var Mt=Ee.useCallback(function(){for(var ct,Ft=arguments.length,un=new Array(Ft),vn=0;vn<Ft;vn++)un[vn]=arguments[vn];return(ct=Ke.current)===null||ct===void 0?void 0:ct.call.apply(ct,[Ke].concat(un))},[]);return Mt}function Be(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var St=Be()?Ee.useLayoutEffect:Ee.useEffect,dt=St,it=function(Ke,Mt){var ct=Ee.useRef(!0);St(function(){if(!ct.current)return Ke()},Mt),St(function(){return ct.current=!1,function(){ct.current=!0}},[])};function Ge(Oe){var Ke=Ee.useRef(!1),Mt=Ee.useState(Oe),ct=(0,ke.Z)(Mt,2),Ft=ct[0],un=ct[1];Ee.useEffect(function(){return Ke.current=!1,function(){Ke.current=!0}},[]);function vn(Nn,kn){kn&&Ke.current||un(Nn)}return[Ft,vn]}function De(Oe){return Oe!==void 0}function At(Oe,Ke){var Mt=Ke||{},ct=Mt.defaultValue,Ft=Mt.value,un=Mt.onChange,vn=Mt.postState,Nn=Ge(function(){return De(Ft)?Ft:De(ct)?typeof ct=="function"?ct():ct:typeof Oe=="function"?Oe():Oe}),kn=(0,ke.Z)(Nn,2),on=kn[0],zn=kn[1],Wn=Ft!==void 0?Ft:on,xr=vn?vn(Wn):Wn,Kn=tt(un),Pr=Ge([Wn]),Xr=(0,ke.Z)(Pr,2),Rr=Xr[0],Ur=Xr[1];it(function(){var Fr=Rr[0];on!==Fr&&Kn(on,Fr)},[Rr]),it(function(){De(Ft)||zn(Ft)},[Ft]);var Er=tt(function(Fr,Qr){zn(Fr,Qr),Ur([Wn],Qr)});return[xr,Er]}var Xt={};function rt(Oe,Ke){}function ft(Oe,Ke){}function Ie(){Xt={}}function xe(Oe,Ke,Mt){!Ke&&!Xt[Mt]&&(Oe(!1,Mt),Xt[Mt]=!0)}function Ue(Oe,Ke){xe(rt,Oe,Ke)}function je(Oe,Ke){xe(ft,Oe,Ke)}var _t=Ue,Ct=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Oe=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Oe)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Oe==null?void 0:Oe.substr(0,4))},Dt={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(Ke){var Mt=Ke.keyCode;if(Ke.altKey&&!Ke.ctrlKey||Ke.metaKey||Mt>=Dt.F1&&Mt<=Dt.F12)return!1;switch(Mt){case Dt.ALT:case Dt.CAPS_LOCK:case Dt.CONTEXT_MENU:case Dt.CTRL:case Dt.DOWN:case Dt.END:case Dt.ESC:case Dt.HOME:case Dt.INSERT:case Dt.LEFT:case Dt.MAC_FF_META:case Dt.META:case Dt.NUMLOCK:case Dt.NUM_CENTER:case Dt.PAGE_DOWN:case Dt.PAGE_UP:case Dt.PAUSE:case Dt.PRINT_SCREEN:case Dt.RIGHT:case Dt.SHIFT:case Dt.UP:case Dt.WIN_KEY:case Dt.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(Ke){if(Ke>=Dt.ZERO&&Ke<=Dt.NINE||Ke>=Dt.NUM_ZERO&&Ke<=Dt.NUM_MULTIPLY||Ke>=Dt.A&&Ke<=Dt.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&Ke===0)return!0;switch(Ke){case Dt.SPACE:case Dt.QUESTION_MARK:case Dt.NUM_PLUS:case Dt.NUM_MINUS:case Dt.NUM_PERIOD:case Dt.NUM_DIVISION:case Dt.SEMICOLON:case Dt.DASH:case Dt.EQUALS:case Dt.COMMA:case Dt.PERIOD:case Dt.SLASH:case Dt.APOSTROPHE:case Dt.SINGLE_QUOTE:case Dt.OPEN_SQUARE_BRACKET:case Dt.BACKSLASH:case Dt.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},qe=Dt,Rt=se(47655);function Pt(Oe,Ke,Mt){var ct=Ee.useRef({});return(!("value"in ct.current)||Mt(ct.current.condition,Ke))&&(ct.current.value=Oe(),ct.current.condition=Ke),ct.current.value}function En(Oe,Ke){typeof Oe=="function"?Oe(Ke):(0,me.Z)(Oe)==="object"&&Oe&&"current"in Oe&&(Oe.current=Ke)}function tn(){for(var Oe=arguments.length,Ke=new Array(Oe),Mt=0;Mt<Oe;Mt++)Ke[Mt]=arguments[Mt];var ct=Ke.filter(function(Ft){return Ft});return ct.length<=1?ct[0]:function(Ft){Ke.forEach(function(un){En(un,Ft)})}}function $n(){for(var Oe=arguments.length,Ke=new Array(Oe),Mt=0;Mt<Oe;Mt++)Ke[Mt]=arguments[Mt];return Pt(function(){return tn.apply(void 0,Ke)},Ke,function(ct,Ft){return ct.length===Ft.length&&ct.every(function(un,vn){return un===Ft[vn]})})}function ur(Oe){var Ke,Mt,ct=isMemo(Oe)?Oe.type.type:Oe.type;return!(typeof ct=="function"&&!((Ke=ct.prototype)!==null&&Ke!==void 0&&Ke.render)||typeof Oe=="function"&&!((Mt=Oe.prototype)!==null&&Mt!==void 0&&Mt.render))}var wr=function(Ke){var Mt=Ke.className,ct=Ke.customizeIcon,Ft=Ke.customizeIconProps,un=Ke.onMouseDown,vn=Ke.onClick,Nn=Ke.children,kn;return typeof ct=="function"?kn=ct(Ft):kn=ct,Ee.createElement("span",{className:Mt,onMouseDown:function(zn){zn.preventDefault(),un&&un(zn)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:vn,"aria-hidden":!0},kn!==void 0?kn:Ee.createElement("span",{className:He()(Mt.split(/\s+/).map(function(on){return"".concat(on,"-icon")}))},Nn))},Je=wr;function Ae(Oe,Ke,Mt,ct,Ft){var un=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,vn=arguments.length>6?arguments[6]:void 0,Nn=arguments.length>7?arguments[7]:void 0,kn=Ee.useMemo(function(){if((0,me.Z)(ct)==="object")return ct.clearIcon;if(Ft)return Ft},[ct,Ft]),on=Ee.useMemo(function(){return!!(!un&&ct&&(Mt.length||vn)&&!(Nn==="combobox"&&vn===""))},[ct,un,Mt.length,vn,Nn]);return{allowClear:on,clearIcon:Ee.createElement(Je,{className:"".concat(Oe,"-clear"),onMouseDown:Ke,customizeIcon:kn},"\xD7")}}var Ht=Ee.createContext(null);function Rn(){return Ee.useContext(Ht)}function yn(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,Ke=Ee.useState(!1),Mt=(0,ke.Z)(Ke,2),ct=Mt[0],Ft=Mt[1],un=Ee.useRef(null),vn=function(){window.clearTimeout(un.current)};Ee.useEffect(function(){return vn},[]);var Nn=function(on,zn){vn(),un.current=window.setTimeout(function(){Ft(on),zn&&zn()},Oe)};return[ct,Nn,vn]}function ot(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,Ke=Ee.useRef(null),Mt=Ee.useRef(null);Ee.useEffect(function(){return function(){window.clearTimeout(Mt.current)}},[]);function ct(Ft){(Ft||Ke.current===null)&&(Ke.current=Ft),window.clearTimeout(Mt.current),Mt.current=window.setTimeout(function(){Ke.current=null},Oe)}return[function(){return Ke.current},ct]}function nt(Oe,Ke,Mt,ct){var Ft=Ee.useRef(null);Ft.current={open:Ke,triggerOpen:Mt,customizedTrigger:ct},Ee.useEffect(function(){function un(vn){var Nn;if(!((Nn=Ft.current)!==null&&Nn!==void 0&&Nn.customizedTrigger)){var kn=vn.target;kn.shadowRoot&&vn.composed&&(kn=vn.composedPath()[0]||kn),Ft.current.open&&Oe().filter(function(on){return on}).every(function(on){return!on.contains(kn)&&on!==kn})&&Ft.current.triggerOpen(!1)}}return window.addEventListener("mousedown",un),function(){return window.removeEventListener("mousedown",un)}},[])}var Tt=`accept acceptCharset accessKey action allowFullScreen allowTransparency
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
charSet checked classID className colSpan cols content contentEditable contextMenu
controls coords crossOrigin data dateTime default defer dir disabled download draggable
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
mediaGroup method min minLength multiple muted name noValidate nonce open
optimum pattern placeholder poster preload radioGroup readOnly rel required
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
summary tabIndex target title type useMap value width wmode wrap`,rn=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,dn="".concat(Tt," ").concat(rn).split(/[\s\n]+/),Ut="aria-",Kt="data-";function bn(Oe,Ke){return Oe.indexOf(Ke)===0}function nn(Oe){var Ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Mt;Ke===!1?Mt={aria:!0,data:!0,attr:!0}:Ke===!0?Mt={aria:!0}:Mt=(0,_e.Z)({},Ke);var ct={};return Object.keys(Oe).forEach(function(Ft){(Mt.aria&&(Ft==="role"||bn(Ft,Ut))||Mt.data&&bn(Ft,Kt)||Mt.attr&&dn.includes(Ft))&&(ct[Ft]=Oe[Ft])}),ct}var we=se(48555),ue=se(14075),oe=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],pe=void 0;function fe(Oe,Ke){var Mt=Oe.prefixCls,ct=Oe.invalidate,Ft=Oe.item,un=Oe.renderItem,vn=Oe.responsive,Nn=Oe.responsiveDisabled,kn=Oe.registerSize,on=Oe.itemKey,zn=Oe.className,Wn=Oe.style,xr=Oe.children,Kn=Oe.display,Pr=Oe.order,Xr=Oe.component,Rr=Xr===void 0?"div":Xr,Ur=(0,Se.Z)(Oe,oe),Er=vn&&!Kn;function Fr(Pi){kn(on,Pi)}Ee.useEffect(function(){return function(){Fr(null)}},[]);var Qr=un&&Ft!==pe?un(Ft):xr,si;ct||(si={opacity:Er?0:1,height:Er?0:pe,overflowY:Er?"hidden":pe,order:vn?Pr:pe,pointerEvents:Er?"none":pe,position:Er?"absolute":pe});var Nr={};Er&&(Nr["aria-hidden"]=!0);var di=Ee.createElement(Rr,(0,Re.Z)({className:He()(!ct&&Mt,zn),style:(0,_e.Z)((0,_e.Z)({},si),Wn)},Nr,Ur,{ref:Ke}),Qr);return vn&&(di=Ee.createElement(we.Z,{onResize:function(na){var Gi=na.offsetWidth;Fr(Gi)},disabled:Nn},di)),di}var le=Ee.forwardRef(fe);le.displayName="Item";var Pe=le,Qe=se(77527),It=se(73935),Nt=se(96523);function qt(Oe){if(typeof MessageChannel=="undefined")(0,Nt.Z)(Oe);else{var Ke=new MessageChannel;Ke.port1.onmessage=function(){return Oe()},Ke.port2.postMessage(void 0)}}function an(){var Oe=Ee.useRef(null),Ke=function(ct){Oe.current||(Oe.current=[],qt(function(){(0,It.unstable_batchedUpdates)(function(){Oe.current.forEach(function(Ft){Ft()}),Oe.current=null})})),Oe.current.push(ct)};return Ke}function jt(Oe,Ke){var Mt=Ee.useState(Ke),ct=(0,ke.Z)(Mt,2),Ft=ct[0],un=ct[1],vn=(0,Qe.Z)(function(Nn){Oe(function(){un(Nn)})});return[Ft,vn]}var ir=Ee.createContext(null),Cr=["component"],Bt=["className"],Mn=["className"],Vn=function(Ke,Mt){var ct=Ee.useContext(ir);if(!ct){var Ft=Ke.component,un=Ft===void 0?"div":Ft,vn=(0,Se.Z)(Ke,Cr);return Ee.createElement(un,(0,Re.Z)({},vn,{ref:Mt}))}var Nn=ct.className,kn=(0,Se.Z)(ct,Bt),on=Ke.className,zn=(0,Se.Z)(Ke,Mn);return Ee.createElement(ir.Provider,{value:null},Ee.createElement(Pe,(0,Re.Z)({ref:Mt,className:He()(Nn,on)},kn,zn)))},br=Ee.forwardRef(Vn);br.displayName="RawItem";var at=br,$t=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],In="responsive",Jn="invalidate";function ar(Oe){return"+ ".concat(Oe.length," ...")}function Mr(Oe,Ke){var Mt=Oe.prefixCls,ct=Mt===void 0?"rc-overflow":Mt,Ft=Oe.data,un=Ft===void 0?[]:Ft,vn=Oe.renderItem,Nn=Oe.renderRawItem,kn=Oe.itemKey,on=Oe.itemWidth,zn=on===void 0?10:on,Wn=Oe.ssr,xr=Oe.style,Kn=Oe.className,Pr=Oe.maxCount,Xr=Oe.renderRest,Rr=Oe.renderRawRest,Ur=Oe.suffix,Er=Oe.component,Fr=Er===void 0?"div":Er,Qr=Oe.itemComponent,si=Oe.onVisibleChange,Nr=(0,Se.Z)(Oe,$t),di=Wn==="full",Pi=an(),na=jt(Pi,null),Gi=(0,ke.Z)(na,2),Ni=Gi[0],qi=Gi[1],Qi=Ni||0,wi=jt(Pi,new Map),$i=(0,ke.Z)(wi,2),qr=$i[0],fi=$i[1],Ti=jt(Pi,0),Xi=(0,ke.Z)(Ti,2),Na=Xi[0],$a=Xi[1],Aa=jt(Pi,0),ca=(0,ke.Z)(Aa,2),ea=ca[0],Ei=ca[1],Oa=jt(Pi,0),ki=(0,ke.Z)(Oa,2),ei=ki[0],zi=ki[1],ua=(0,Ee.useState)(null),Zi=(0,ke.Z)(ua,2),aa=Zi[0],pi=Zi[1],pa=(0,Ee.useState)(null),xa=(0,ke.Z)(pa,2),fa=xa[0],wa=xa[1],Ea=Ee.useMemo(function(){return fa===null&&di?Number.MAX_SAFE_INTEGER:fa||0},[fa,Ni]),ja=(0,Ee.useState)(!1),ha=(0,ke.Z)(ja,2),ka=ha[0],Ja=ha[1],Ga="".concat(ct,"-item"),so=Math.max(Na,ea),Fa=Pr===In,Ca=un.length&&Fa,_i=Pr===Jn,Ki=Ca||typeof Pr=="number"&&un.length>Pr,da=(0,Ee.useMemo)(function(){var oa=un;return Ca?Ni===null&&di?oa=un:oa=un.slice(0,Math.min(un.length,Qi/zn)):typeof Pr=="number"&&(oa=un.slice(0,Pr)),oa},[un,zn,Ni,Pr,Ca]),Sa=(0,Ee.useMemo)(function(){return Ca?un.slice(Ea+1):un.slice(da.length)},[un,da,Ca,Ea]),Ka=(0,Ee.useCallback)(function(oa,Or){var Si;return typeof kn=="function"?kn(oa):(Si=kn&&(oa==null?void 0:oa[kn]))!==null&&Si!==void 0?Si:Or},[kn]),io=(0,Ee.useCallback)(vn||function(oa){return oa},[vn]);function ho(oa,Or,Si){fa===oa&&(Or===void 0||Or===aa)||(wa(oa),Si||(Ja(oa<un.length-1),si==null||si(oa)),Or!==void 0&&pi(Or))}function Oo(oa,Or){qi(Or.clientWidth)}function Bo(oa,Or){fi(function(Si){var Ci=new Map(Si);return Or===null?Ci.delete(oa):Ci.set(oa,Or),Ci})}function lo(oa,Or){Ei(Or),$a(ea)}function Ao(oa,Or){zi(Or)}function ra(oa){return qr.get(Ka(da[oa],oa))}(0,ue.Z)(function(){if(Qi&&typeof so=="number"&&da){var oa=ei,Or=da.length,Si=Or-1;if(!Or){ho(0,null);return}for(var Ci=0;Ci<Or;Ci+=1){var Di=ra(Ci);if(di&&(Di=Di||0),Di===void 0){ho(Ci-1,void 0,!0);break}if(oa+=Di,Si===0&&oa<=Qi||Ci===Si-1&&oa+ra(Si)<=Qi){ho(Si,null);break}else if(oa+so>Qi){ho(Ci-1,oa-Di-ei+ea);break}}Ur&&ra(0)+ei>Qi&&pi(null)}},[Qi,qr,ea,ei,Ka,da]);var Oi=ka&&!!Sa.length,Ta={};aa!==null&&Ca&&(Ta={position:"absolute",left:aa,top:0});var _a={prefixCls:Ga,responsive:Ca,component:Qr,invalidate:_i},co=Nn?function(oa,Or){var Si=Ka(oa,Or);return Ee.createElement(ir.Provider,{key:Si,value:(0,_e.Z)((0,_e.Z)({},_a),{},{order:Or,item:oa,itemKey:Si,registerSize:Bo,display:Or<=Ea})},Nn(oa,Or))}:function(oa,Or){var Si=Ka(oa,Or);return Ee.createElement(Pe,(0,Re.Z)({},_a,{order:Or,key:Si,item:oa,renderItem:io,itemKey:Si,registerSize:Bo,display:Or<=Ea}))},ao,hs={order:Oi?Ea:Number.MAX_SAFE_INTEGER,className:"".concat(Ga,"-rest"),registerSize:lo,display:Oi};if(Rr)Rr&&(ao=Ee.createElement(ir.Provider,{value:(0,_e.Z)((0,_e.Z)({},_a),hs)},Rr(Sa)));else{var Qo=Xr||ar;ao=Ee.createElement(Pe,(0,Re.Z)({},_a,hs),typeof Qo=="function"?Qo(Sa):Qo)}var ps=Ee.createElement(Fr,(0,Re.Z)({className:He()(!_i&&ct,Kn),style:xr,ref:Ke},Nr),da.map(co),Ki?ao:null,Ur&&Ee.createElement(Pe,(0,Re.Z)({},_a,{responsive:Fa,responsiveDisabled:!Ca,order:Ea,className:"".concat(Ga,"-suffix"),registerSize:Ao,display:!0,style:Ta}),Ur));return Fa&&(ps=Ee.createElement(we.Z,{onResize:Oo,disabled:!Ca},ps)),ps}var $r=Ee.forwardRef(Mr);$r.displayName="Overflow",$r.Item=at,$r.RESPONSIVE=In,$r.INVALIDATE=Jn;var Dr=$r,Kr=Dr,ni=function(Ke,Mt){var ct,Ft,un=Ke.prefixCls,vn=Ke.id,Nn=Ke.inputElement,kn=Ke.disabled,on=Ke.tabIndex,zn=Ke.autoFocus,Wn=Ke.autoComplete,xr=Ke.editable,Kn=Ke.activeDescendantId,Pr=Ke.value,Xr=Ke.maxLength,Rr=Ke.onKeyDown,Ur=Ke.onMouseDown,Er=Ke.onChange,Fr=Ke.onPaste,Qr=Ke.onCompositionStart,si=Ke.onCompositionEnd,Nr=Ke.open,di=Ke.attrs,Pi=Nn||Ee.createElement("input",null),na=Pi,Gi=na.ref,Ni=na.props,qi=Ni.onKeyDown,Qi=Ni.onChange,wi=Ni.onMouseDown,$i=Ni.onCompositionStart,qr=Ni.onCompositionEnd,fi=Ni.style;return"maxLength"in Pi.props,Pi=Ee.cloneElement(Pi,(0,_e.Z)((0,_e.Z)((0,_e.Z)({type:"search"},Ni),{},{id:vn,ref:tn(Mt,Gi),disabled:kn,tabIndex:on,autoComplete:Wn||"off",autoFocus:zn,className:He()("".concat(un,"-selection-search-input"),(ct=Pi)===null||ct===void 0||(Ft=ct.props)===null||Ft===void 0?void 0:Ft.className),role:"combobox","aria-label":"Search","aria-expanded":Nr||!1,"aria-haspopup":"listbox","aria-owns":"".concat(vn,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(vn,"_list"),"aria-activedescendant":Nr?Kn:void 0},di),{},{value:xr?Pr:"",maxLength:Xr,readOnly:!xr,unselectable:xr?null:"on",style:(0,_e.Z)((0,_e.Z)({},fi),{},{opacity:xr?null:0}),onKeyDown:function(Xi){Rr(Xi),qi&&qi(Xi)},onMouseDown:function(Xi){Ur(Xi),wi&&wi(Xi)},onChange:function(Xi){Er(Xi),Qi&&Qi(Xi)},onCompositionStart:function(Xi){Qr(Xi),$i&&$i(Xi)},onCompositionEnd:function(Xi){si(Xi),qr&&qr(Xi)},onPaste:Fr})),Pi},hr=Ee.forwardRef(ni);hr.displayName="Input";var mi=hr;function Ji(Oe){return Array.isArray(Oe)?Oe:Oe!==void 0?[Oe]:[]}var Ui=typeof window!="undefined"&&window.document&&window.document.documentElement,Vi=Ui;function ui(Oe){return Oe!=null}function yt(Oe){return!Oe&&Oe!==0}function Cn(Oe){return["string","number"].includes((0,me.Z)(Oe))}function Ln(Oe){var Ke=void 0;return Oe&&(Cn(Oe.title)?Ke=Oe.title.toString():Cn(Oe.label)&&(Ke=Oe.label.toString())),Ke}function Dn(Oe,Ke){Vi?Ee.useLayoutEffect(Oe,Ke):Ee.useEffect(Oe,Ke)}function sr(Oe){var Ke;return(Ke=Oe.key)!==null&&Ke!==void 0?Ke:Oe.value}var nr=function(Ke){Ke.preventDefault(),Ke.stopPropagation()},gr=function(Ke){var Mt=Ke.id,ct=Ke.prefixCls,Ft=Ke.values,un=Ke.open,vn=Ke.searchValue,Nn=Ke.autoClearSearchValue,kn=Ke.inputRef,on=Ke.placeholder,zn=Ke.disabled,Wn=Ke.mode,xr=Ke.showSearch,Kn=Ke.autoFocus,Pr=Ke.autoComplete,Xr=Ke.activeDescendantId,Rr=Ke.tabIndex,Ur=Ke.removeIcon,Er=Ke.maxTagCount,Fr=Ke.maxTagTextLength,Qr=Ke.maxTagPlaceholder,si=Qr===void 0?function(pi){return"+ ".concat(pi.length," ...")}:Qr,Nr=Ke.tagRender,di=Ke.onToggleOpen,Pi=Ke.onRemove,na=Ke.onInputChange,Gi=Ke.onInputPaste,Ni=Ke.onInputKeyDown,qi=Ke.onInputMouseDown,Qi=Ke.onInputCompositionStart,wi=Ke.onInputCompositionEnd,$i=Ee.useRef(null),qr=(0,Ee.useState)(0),fi=(0,ke.Z)(qr,2),Ti=fi[0],Xi=fi[1],Na=(0,Ee.useState)(!1),$a=(0,ke.Z)(Na,2),Aa=$a[0],ca=$a[1],ea="".concat(ct,"-selection"),Ei=un||Wn==="multiple"&&Nn===!1||Wn==="tags"?vn:"",Oa=Wn==="tags"||Wn==="multiple"&&Nn===!1||xr&&(un||Aa);Dn(function(){Xi($i.current.scrollWidth)},[Ei]);function ki(pi,pa,xa,fa,wa){return Ee.createElement("span",{className:He()("".concat(ea,"-item"),(0,ve.Z)({},"".concat(ea,"-item-disabled"),xa)),title:Ln(pi)},Ee.createElement("span",{className:"".concat(ea,"-item-content")},pa),fa&&Ee.createElement(Je,{className:"".concat(ea,"-item-remove"),onMouseDown:nr,onClick:wa,customizeIcon:Ur},"\xD7"))}function ei(pi,pa,xa,fa,wa){var Ea=function(ha){nr(ha),di(!un)};return Ee.createElement("span",{onMouseDown:Ea},Nr({label:pa,value:pi,disabled:xa,closable:fa,onClose:wa}))}function zi(pi){var pa=pi.disabled,xa=pi.label,fa=pi.value,wa=!zn&&!pa,Ea=xa;if(typeof Fr=="number"&&(typeof xa=="string"||typeof xa=="number")){var ja=String(Ea);ja.length>Fr&&(Ea="".concat(ja.slice(0,Fr),"..."))}var ha=function(Ja){Ja&&Ja.stopPropagation(),Pi(pi)};return typeof Nr=="function"?ei(fa,Ea,pa,wa,ha):ki(pi,Ea,pa,wa,ha)}function ua(pi){var pa=typeof si=="function"?si(pi):si;return ki({title:pa},pa,!1)}var Zi=Ee.createElement("div",{className:"".concat(ea,"-search"),style:{width:Ti},onFocus:function(){ca(!0)},onBlur:function(){ca(!1)}},Ee.createElement(mi,{ref:kn,open:un,prefixCls:ct,id:Mt,inputElement:null,disabled:zn,autoFocus:Kn,autoComplete:Pr,editable:Oa,activeDescendantId:Xr,value:Ei,onKeyDown:Ni,onMouseDown:qi,onChange:na,onPaste:Gi,onCompositionStart:Qi,onCompositionEnd:wi,tabIndex:Rr,attrs:nn(Ke,!0)}),Ee.createElement("span",{ref:$i,className:"".concat(ea,"-search-mirror"),"aria-hidden":!0},Ei,"\xA0")),aa=Ee.createElement(Kr,{prefixCls:"".concat(ea,"-overflow"),data:Ft,renderItem:zi,renderRest:ua,suffix:Zi,itemKey:sr,maxCount:Er});return Ee.createElement(Ee.Fragment,null,aa,!Ft.length&&!Ei&&Ee.createElement("span",{className:"".concat(ea,"-placeholder")},on))},Fn=gr,Xe=function(Ke){var Mt=Ke.inputElement,ct=Ke.prefixCls,Ft=Ke.id,un=Ke.inputRef,vn=Ke.disabled,Nn=Ke.autoFocus,kn=Ke.autoComplete,on=Ke.activeDescendantId,zn=Ke.mode,Wn=Ke.open,xr=Ke.values,Kn=Ke.placeholder,Pr=Ke.tabIndex,Xr=Ke.showSearch,Rr=Ke.searchValue,Ur=Ke.activeValue,Er=Ke.maxLength,Fr=Ke.onInputKeyDown,Qr=Ke.onInputMouseDown,si=Ke.onInputChange,Nr=Ke.onInputPaste,di=Ke.onInputCompositionStart,Pi=Ke.onInputCompositionEnd,na=Ke.title,Gi=Ee.useState(!1),Ni=(0,ke.Z)(Gi,2),qi=Ni[0],Qi=Ni[1],wi=zn==="combobox",$i=wi||Xr,qr=xr[0],fi=Rr||"";wi&&Ur&&!qi&&(fi=Ur),Ee.useEffect(function(){wi&&Qi(!1)},[wi,Ur]);var Ti=zn!=="combobox"&&!Wn&&!Xr?!1:!!fi,Xi=na===void 0?Ln(qr):na,Na=function(){if(qr)return null;var Aa=Ti?{visibility:"hidden"}:void 0;return Ee.createElement("span",{className:"".concat(ct,"-selection-placeholder"),style:Aa},Kn)};return Ee.createElement(Ee.Fragment,null,Ee.createElement("span",{className:"".concat(ct,"-selection-search")},Ee.createElement(mi,{ref:un,prefixCls:ct,id:Ft,open:Wn,inputElement:Mt,disabled:vn,autoFocus:Nn,autoComplete:kn,editable:$i,activeDescendantId:on,value:fi,onKeyDown:Fr,onMouseDown:Qr,onChange:function(Aa){Qi(!0),si(Aa)},onPaste:Nr,onCompositionStart:di,onCompositionEnd:Pi,tabIndex:Pr,attrs:nn(Ke,!0),maxLength:wi?Er:void 0})),!wi&&qr?Ee.createElement("span",{className:"".concat(ct,"-selection-item"),title:Xi,style:Ti?{visibility:"hidden"}:void 0},qr.label):null,Na())},ut=Xe;function Lt(Oe){return![qe.ESC,qe.SHIFT,qe.BACKSPACE,qe.TAB,qe.WIN_KEY,qe.ALT,qe.META,qe.WIN_KEY_RIGHT,qe.CTRL,qe.SEMICOLON,qe.EQUALS,qe.CAPS_LOCK,qe.CONTEXT_MENU,qe.F1,qe.F2,qe.F3,qe.F4,qe.F5,qe.F6,qe.F7,qe.F8,qe.F9,qe.F10,qe.F11,qe.F12].includes(Oe)}var Jt=function(Ke,Mt){var ct=(0,Ee.useRef)(null),Ft=(0,Ee.useRef)(!1),un=Ke.prefixCls,vn=Ke.open,Nn=Ke.mode,kn=Ke.showSearch,on=Ke.tokenWithEnter,zn=Ke.autoClearSearchValue,Wn=Ke.onSearch,xr=Ke.onSearchSubmit,Kn=Ke.onToggleOpen,Pr=Ke.onInputKeyDown,Xr=Ke.domRef;Ee.useImperativeHandle(Mt,function(){return{focus:function(){ct.current.focus()},blur:function(){ct.current.blur()}}});var Rr=ot(0),Ur=(0,ke.Z)(Rr,2),Er=Ur[0],Fr=Ur[1],Qr=function(fi){var Ti=fi.which;(Ti===qe.UP||Ti===qe.DOWN)&&fi.preventDefault(),Pr&&Pr(fi),Ti===qe.ENTER&&Nn==="tags"&&!Ft.current&&!vn&&(xr==null||xr(fi.target.value)),Lt(Ti)&&Kn(!0)},si=function(){Fr(!0)},Nr=(0,Ee.useRef)(null),di=function(fi){Wn(fi,!0,Ft.current)!==!1&&Kn(!0)},Pi=function(){Ft.current=!0},na=function(fi){Ft.current=!1,Nn!=="combobox"&&di(fi.target.value)},Gi=function(fi){var Ti=fi.target.value;if(on&&Nr.current&&/[\r\n]/.test(Nr.current)){var Xi=Nr.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");Ti=Ti.replace(Xi,Nr.current)}Nr.current=null,di(Ti)},Ni=function(fi){var Ti=fi.clipboardData,Xi=Ti.getData("text");Nr.current=Xi},qi=function(fi){var Ti=fi.target;if(Ti!==ct.current){var Xi=document.body.style.msTouchAction!==void 0;Xi?setTimeout(function(){ct.current.focus()}):ct.current.focus()}},Qi=function(fi){var Ti=Er();fi.target!==ct.current&&!Ti&&Nn!=="combobox"&&fi.preventDefault(),(Nn!=="combobox"&&(!kn||!Ti)||!vn)&&(vn&&zn!==!1&&Wn("",!0,!1),Kn())},wi={inputRef:ct,onInputKeyDown:Qr,onInputMouseDown:si,onInputChange:Gi,onInputPaste:Ni,onInputCompositionStart:Pi,onInputCompositionEnd:na},$i=Nn==="multiple"||Nn==="tags"?Ee.createElement(Fn,(0,Re.Z)({},Ke,wi)):Ee.createElement(ut,(0,Re.Z)({},Ke,wi));return Ee.createElement("div",{ref:Xr,className:"".concat(un,"-selector"),onClick:qi,onMouseDown:Qi},$i)},We=Ee.forwardRef(Jt);We.displayName="Selector";var mt=We,zt=se(62709),Ot=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],Vt=function(Ke){var Mt=Ke===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:Mt,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:Mt,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:Mt,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:Mt,adjustY:1},htmlRegion:"scroll"}}},Yt=function(Ke,Mt){var ct=Ke.prefixCls,Ft=Ke.disabled,un=Ke.visible,vn=Ke.children,Nn=Ke.popupElement,kn=Ke.animation,on=Ke.transitionName,zn=Ke.dropdownStyle,Wn=Ke.dropdownClassName,xr=Ke.direction,Kn=xr===void 0?"ltr":xr,Pr=Ke.placement,Xr=Ke.builtinPlacements,Rr=Ke.dropdownMatchSelectWidth,Ur=Ke.dropdownRender,Er=Ke.dropdownAlign,Fr=Ke.getPopupContainer,Qr=Ke.empty,si=Ke.getTriggerDOMNode,Nr=Ke.onPopupVisibleChange,di=Ke.onPopupMouseEnter,Pi=(0,Se.Z)(Ke,Ot),na="".concat(ct,"-dropdown"),Gi=Nn;Ur&&(Gi=Ur(Nn));var Ni=Ee.useMemo(function(){return Xr||Vt(Rr)},[Xr,Rr]),qi=kn?"".concat(na,"-").concat(kn):on,Qi=typeof Rr=="number",wi=Ee.useMemo(function(){return Qi?null:Rr===!1?"minWidth":"width"},[Rr,Qi]),$i=zn;Qi&&($i=(0,_e.Z)((0,_e.Z)({},$i),{},{width:Rr}));var qr=Ee.useRef(null);return Ee.useImperativeHandle(Mt,function(){return{getPopupElement:function(){return qr.current}}}),Ee.createElement(zt.Z,(0,Re.Z)({},Pi,{showAction:Nr?["click"]:[],hideAction:Nr?["click"]:[],popupPlacement:Pr||(Kn==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:Ni,prefixCls:na,popupTransitionName:qi,popup:Ee.createElement("div",{ref:qr,onMouseEnter:di},Gi),stretch:wi,popupAlign:Er,popupVisible:un,getPopupContainer:Fr,popupClassName:He()(Wn,(0,ve.Z)({},"".concat(na,"-empty"),Qr)),popupStyle:$i,getTriggerDOMNode:si,onPopupVisibleChange:Nr}),vn)},Hn=Ee.forwardRef(Yt);Hn.displayName="SelectTrigger";var _r=Hn,Qn=se(84506);function qn(Oe,Ke){var Mt=Oe.key,ct;return"value"in Oe&&(ct=Oe.value),Mt!=null?Mt:ct!==void 0?ct:"rc-index-key-".concat(Ke)}function or(Oe,Ke){var Mt=Oe||{},ct=Mt.label,Ft=Mt.value,un=Mt.options,vn=Mt.groupLabel,Nn=ct||(Ke?"children":"label");return{label:Nn,value:Ft||"value",options:un||"options",groupLabel:vn||Nn}}function lr(Oe){var Ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Mt=Ke.fieldNames,ct=Ke.childrenAsData,Ft=[],un=or(Mt,!1),vn=un.label,Nn=un.value,kn=un.options,on=un.groupLabel;function zn(Wn,xr){Wn.forEach(function(Kn){if(xr||!(kn in Kn)){var Pr=Kn[Nn];Ft.push({key:qn(Kn,Ft.length),groupOption:xr,data:Kn,label:Kn[vn],value:Pr})}else{var Xr=Kn[on];Xr===void 0&&ct&&(Xr=Kn.label),Ft.push({key:qn(Kn,Ft.length),group:!0,data:Kn,label:Xr}),zn(Kn[kn],!0)}})}return zn(Oe,!1),Ft}function ht(Oe){var Ke=(0,_e.Z)({},Oe);return"props"in Ke||Object.defineProperty(Ke,"props",{get:function(){return _t(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),Ke}}),Ke}function st(Oe,Ke){if(!Ke||!Ke.length)return null;var Mt=!1;function ct(un,vn){var Nn=(0,Qn.Z)(vn),kn=Nn[0],on=Nn.slice(1);if(!kn)return[un];var zn=un.split(kn);return Mt=Mt||zn.length>1,zn.reduce(function(Wn,xr){return[].concat((0,Ve.Z)(Wn),(0,Ve.Z)(ct(xr,on)))},[]).filter(function(Wn){return Wn})}var Ft=ct(Oe,Ke);return Mt?Ft:null}var bt=["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"],ln=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function Pn(Oe){return Oe==="tags"||Oe==="multiple"}var cn=Ee.forwardRef(function(Oe,Ke){var Mt,ct,Ft=Oe.id,un=Oe.prefixCls,vn=Oe.className,Nn=Oe.showSearch,kn=Oe.tagRender,on=Oe.direction,zn=Oe.omitDomProps,Wn=Oe.displayValues,xr=Oe.onDisplayValuesChange,Kn=Oe.emptyOptions,Pr=Oe.notFoundContent,Xr=Pr===void 0?"Not Found":Pr,Rr=Oe.onClear,Ur=Oe.mode,Er=Oe.disabled,Fr=Oe.loading,Qr=Oe.getInputElement,si=Oe.getRawInputElement,Nr=Oe.open,di=Oe.defaultOpen,Pi=Oe.onDropdownVisibleChange,na=Oe.activeValue,Gi=Oe.onActiveValueChange,Ni=Oe.activeDescendantId,qi=Oe.searchValue,Qi=Oe.autoClearSearchValue,wi=Oe.onSearch,$i=Oe.onSearchSplit,qr=Oe.tokenSeparators,fi=Oe.allowClear,Ti=Oe.suffixIcon,Xi=Oe.clearIcon,Na=Oe.OptionList,$a=Oe.animation,Aa=Oe.transitionName,ca=Oe.dropdownStyle,ea=Oe.dropdownClassName,Ei=Oe.dropdownMatchSelectWidth,Oa=Oe.dropdownRender,ki=Oe.dropdownAlign,ei=Oe.placement,zi=Oe.builtinPlacements,ua=Oe.getPopupContainer,Zi=Oe.showAction,aa=Zi===void 0?[]:Zi,pi=Oe.onFocus,pa=Oe.onBlur,xa=Oe.onKeyUp,fa=Oe.onKeyDown,wa=Oe.onMouseDown,Ea=(0,Se.Z)(Oe,bt),ja=Pn(Ur),ha=(Nn!==void 0?Nn:ja)||Ur==="combobox",ka=(0,_e.Z)({},Ea);ln.forEach(function(Ia){delete ka[Ia]}),zn==null||zn.forEach(function(Ia){delete ka[Ia]});var Ja=Ee.useState(!1),Ga=(0,ke.Z)(Ja,2),so=Ga[0],Fa=Ga[1];Ee.useEffect(function(){Fa(Ct())},[]);var Ca=Ee.useRef(null),_i=Ee.useRef(null),Ki=Ee.useRef(null),da=Ee.useRef(null),Sa=Ee.useRef(null),Ka=yn(),io=(0,ke.Z)(Ka,3),ho=io[0],Oo=io[1],Bo=io[2];Ee.useImperativeHandle(Ke,function(){var Ia,ma;return{focus:(Ia=da.current)===null||Ia===void 0?void 0:Ia.focus,blur:(ma=da.current)===null||ma===void 0?void 0:ma.blur,scrollTo:function(es){var ga;return(ga=Sa.current)===null||ga===void 0?void 0:ga.scrollTo(es)}}});var lo=Ee.useMemo(function(){var Ia;if(Ur!=="combobox")return qi;var ma=(Ia=Wn[0])===null||Ia===void 0?void 0:Ia.value;return typeof ma=="string"||typeof ma=="number"?String(ma):""},[qi,Ur,Wn]),Ao=Ur==="combobox"&&typeof Qr=="function"&&Qr()||null,ra=typeof si=="function"&&si(),Oi=$n(_i,ra==null||(Mt=ra.props)===null||Mt===void 0?void 0:Mt.ref),Ta=Ee.useState(!1),_a=(0,ke.Z)(Ta,2),co=_a[0],ao=_a[1];dt(function(){ao(!0)},[]);var hs=At(!1,{defaultValue:di,value:Nr}),Qo=(0,ke.Z)(hs,2),ps=Qo[0],oa=Qo[1],Or=co?ps:!1,Si=!Xr&&Kn;(Er||Si&&Or&&Ur==="combobox")&&(Or=!1);var Ci=Si?!1:Or,Di=Ee.useCallback(function(Ia){var ma=Ia!==void 0?Ia:!Or;Er||(oa(ma),Or!==ma&&(Pi==null||Pi(ma)))},[Er,Or,oa,Pi]),Ha=Ee.useMemo(function(){return(qr||[]).some(function(Ia){return[`
`,`\r
`].includes(Ia)})},[qr]),Va=function(ma,Ho,es){var ga=!0,za=ma;Gi==null||Gi(null);var Ba=es?null:st(ma,qr);return Ur!=="combobox"&&Ba&&(za="",$i==null||$i(Ba),Di(!1),ga=!1),wi&&lo!==za&&wi(za,{source:Ho?"typing":"effect"}),ga},Fo=function(ma){!ma||!ma.trim()||wi(ma,{source:"submit"})};Ee.useEffect(function(){!Or&&!ja&&Ur!=="combobox"&&Va("",!1,!1)},[Or]),Ee.useEffect(function(){ps&&Er&&oa(!1),Er&&Oo(!1)},[Er]);var Zo=ot(),ls=(0,ke.Z)(Zo,2),va=ls[0],Ro=ls[1],cs=function(ma){var Ho=va(),es=ma.which;if(es===qe.ENTER&&(Ur!=="combobox"&&ma.preventDefault(),Or||Di(!0)),Ro(!!lo),es===qe.BACKSPACE&&!Ho&&ja&&!lo&&Wn.length){for(var ga=(0,Ve.Z)(Wn),za=null,Ba=ga.length-1;Ba>=0;Ba-=1){var po=ga[Ba];if(!po.disabled){ga.splice(Ba,1),za=po;break}}za&&xr(ga,{type:"remove",values:[za]})}for(var is=arguments.length,Hs=new Array(is>1?is-1:0),gs=1;gs<is;gs++)Hs[gs-1]=arguments[gs];if(Or&&Sa.current){var Jl;(Jl=Sa.current).onKeyDown.apply(Jl,[ma].concat(Hs))}fa==null||fa.apply(void 0,[ma].concat(Hs))},ul=function(ma){for(var Ho=arguments.length,es=new Array(Ho>1?Ho-1:0),ga=1;ga<Ho;ga++)es[ga-1]=arguments[ga];if(Or&&Sa.current){var za;(za=Sa.current).onKeyUp.apply(za,[ma].concat(es))}xa==null||xa.apply(void 0,[ma].concat(es))},As=function(ma){var Ho=Wn.filter(function(es){return es!==ma});xr(Ho,{type:"remove",values:[ma]})},ms=Ee.useRef(!1),zo=function(){Oo(!0),Er||(pi&&!ms.current&&pi.apply(void 0,arguments),aa.includes("focus")&&Di(!0)),ms.current=!0},Ts=function(){Oo(!1,function(){ms.current=!1,Di(!1)}),!Er&&(lo&&(Ur==="tags"?wi(lo,{source:"submit"}):Ur==="multiple"&&wi("",{source:"blur"})),pa&&pa.apply(void 0,arguments))},Ds=[];Ee.useEffect(function(){return function(){Ds.forEach(function(Ia){return clearTimeout(Ia)}),Ds.splice(0,Ds.length)}},[]);var qs=function(ma){var Ho,es=ma.target,ga=(Ho=Ki.current)===null||Ho===void 0?void 0:Ho.getPopupElement();if(ga&&ga.contains(es)){var za=setTimeout(function(){var Hs=Ds.indexOf(za);if(Hs!==-1&&Ds.splice(Hs,1),Bo(),!so&&!ga.contains(document.activeElement)){var gs;(gs=da.current)===null||gs===void 0||gs.focus()}});Ds.push(za)}for(var Ba=arguments.length,po=new Array(Ba>1?Ba-1:0),is=1;is<Ba;is++)po[is-1]=arguments[is];wa==null||wa.apply(void 0,[ma].concat(po))},oo=Ee.useState({}),Da=(0,ke.Z)(oo,2),Xa=Da[1];function go(){Xa({})}var yo;ra&&(yo=function(ma){Di(ma)}),nt(function(){var Ia;return[Ca.current,(Ia=Ki.current)===null||Ia===void 0?void 0:Ia.getPopupElement()]},Ci,Di,!!ra);var Ko=Ee.useMemo(function(){return(0,_e.Z)((0,_e.Z)({},Oe),{},{notFoundContent:Xr,open:Or,triggerOpen:Ci,id:Ft,showSearch:ha,multiple:ja,toggleOpen:Di})},[Oe,Xr,Ci,Or,Ft,ha,ja,Di]),wo=!!Ti||Fr,xs;wo&&(xs=Ee.createElement(Je,{className:He()("".concat(un,"-arrow"),(0,ve.Z)({},"".concat(un,"-arrow-loading"),Fr)),customizeIcon:Ti,customizeIconProps:{loading:Fr,searchValue:lo,open:Or,focused:ho,showSearch:ha}}));var Xl=function(){var ma;Rr==null||Rr(),(ma=da.current)===null||ma===void 0||ma.focus(),xr([],{type:"clear",values:Wn}),Va("",!1,!1)},Yl=Ae(un,Xl,Wn,fi,Xi,Er,lo,Ur),vc=Yl.allowClear,Xc=Yl.clearIcon,Ks=Ee.createElement(Na,{ref:Sa}),Is=He()(un,vn,(ct={},(0,ve.Z)(ct,"".concat(un,"-focused"),ho),(0,ve.Z)(ct,"".concat(un,"-multiple"),ja),(0,ve.Z)(ct,"".concat(un,"-single"),!ja),(0,ve.Z)(ct,"".concat(un,"-allow-clear"),fi),(0,ve.Z)(ct,"".concat(un,"-show-arrow"),wo),(0,ve.Z)(ct,"".concat(un,"-disabled"),Er),(0,ve.Z)(ct,"".concat(un,"-loading"),Fr),(0,ve.Z)(ct,"".concat(un,"-open"),Or),(0,ve.Z)(ct,"".concat(un,"-customize-input"),Ao),(0,ve.Z)(ct,"".concat(un,"-show-search"),ha),ct)),yc=Ee.createElement(_r,{ref:Ki,disabled:Er,prefixCls:un,visible:Ci,popupElement:Ks,animation:$a,transitionName:Aa,dropdownStyle:ca,dropdownClassName:ea,direction:on,dropdownMatchSelectWidth:Ei,dropdownRender:Oa,dropdownAlign:ki,placement:ei,builtinPlacements:zi,getPopupContainer:ua,empty:Kn,getTriggerDOMNode:function(){return _i.current},onPopupVisibleChange:yo,onPopupMouseEnter:go},ra?Ee.cloneElement(ra,{ref:Oi}):Ee.createElement(mt,(0,Re.Z)({},Oe,{domRef:_i,prefixCls:un,inputElement:Ao,ref:da,id:Ft,showSearch:ha,autoClearSearchValue:Qi,mode:Ur,activeDescendantId:Ni,tagRender:kn,values:Wn,open:Or,onToggleOpen:Di,activeValue:na,searchValue:lo,onSearch:Va,onSearchSubmit:Fo,onRemove:As,tokenWithEnter:Ha}))),ql;return ra?ql=yc:ql=Ee.createElement("div",(0,Re.Z)({className:Is},ka,{ref:Ca,onMouseDown:qs,onKeyDown:cs,onKeyUp:ul,onFocus:zo,onBlur:Ts}),ho&&!Or&&Ee.createElement("span",{style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0},"aria-live":"polite"},"".concat(Wn.map(function(Ia){var ma=Ia.label,Ho=Ia.value;return["number","string"].includes((0,me.Z)(ma))?ma:Ho}).join(", "))),yc,xs,vc&&Xc),Ee.createElement(Ht.Provider,{value:Ko},ql)}),pn=cn,mn=function(Oe,Ke){var Mt=Ee.useRef({values:new Map,options:new Map}),ct=Ee.useMemo(function(){var un=Mt.current,vn=un.values,Nn=un.options,kn=Oe.map(function(Wn){if(Wn.label===void 0){var xr;return(0,_e.Z)((0,_e.Z)({},Wn),{},{label:(xr=vn.get(Wn.value))===null||xr===void 0?void 0:xr.label})}return Wn}),on=new Map,zn=new Map;return kn.forEach(function(Wn){on.set(Wn.value,Wn),zn.set(Wn.value,Ke.get(Wn.value)||Nn.get(Wn.value))}),Mt.current.values=on,Mt.current.options=zn,kn},[Oe,Ke]),Ft=Ee.useCallback(function(un){return Ke.get(un)||Mt.current.options.get(un)},[Ke]);return[ct,Ft]};function On(Oe,Ke){return Ji(Oe).join("").toUpperCase().includes(Ke)}var cr=function(Oe,Ke,Mt,ct,Ft){return Ee.useMemo(function(){if(!Mt||ct===!1)return Oe;var un=Ke.options,vn=Ke.label,Nn=Ke.value,kn=[],on=typeof ct=="function",zn=Mt.toUpperCase(),Wn=on?ct:function(Kn,Pr){return Ft?On(Pr[Ft],zn):Pr[un]?On(Pr[vn!=="children"?vn:"label"],zn):On(Pr[Nn],zn)},xr=on?function(Kn){return ht(Kn)}:function(Kn){return Kn};return Oe.forEach(function(Kn){if(Kn[un]){var Pr=Wn(Mt,xr(Kn));if(Pr)kn.push(Kn);else{var Xr=Kn[un].filter(function(Rr){return Wn(Mt,xr(Rr))});Xr.length&&kn.push((0,_e.Z)((0,_e.Z)({},Kn),{},(0,ve.Z)({},un,Xr)))}return}Wn(Mt,xr(Kn))&&kn.push(Kn)}),kn},[Oe,ct,Ft,Mt,Ke])},Gt=0,Jr=Be();function Zr(){var Oe;return Jr?(Oe=Gt,Gt+=1):Oe="TEST_OR_SSR",Oe}function Bi(Oe){var Ke=Ee.useState(),Mt=(0,ke.Z)(Ke,2),ct=Mt[0],Ft=Mt[1];return Ee.useEffect(function(){Ft("rc_select_".concat(Zr()))},[]),Oe||ct}function Li(Oe){var Ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Mt=[];return Ee.Children.forEach(Oe,function(ct){ct==null&&!Ke.keepEmpty||(Array.isArray(ct)?Mt=Mt.concat(Li(ct)):(0,Rt.isFragment)(ct)&&ct.props?Mt=Mt.concat(Li(ct.props.children,Ke)):Mt.push(ct))}),Mt}var gi=["children","value"],Yi=["children"];function xi(Oe){var Ke=Oe,Mt=Ke.key,ct=Ke.props,Ft=ct.children,un=ct.value,vn=(0,Se.Z)(ct,gi);return(0,_e.Z)({key:Mt,value:un!==void 0?un:Mt,children:Ft},vn)}function oi(Oe){var Ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Li(Oe).map(function(Mt,ct){if(!Ee.isValidElement(Mt)||!Mt.type)return null;var Ft=Mt,un=Ft.type.isSelectOptGroup,vn=Ft.key,Nn=Ft.props,kn=Nn.children,on=(0,Se.Z)(Nn,Yi);return Ke||!un?xi(Mt):(0,_e.Z)((0,_e.Z)({key:"__RC_SELECT_GRP__".concat(vn===null?ct:vn,"__"),label:vn},on),{},{options:oi(kn)})}).filter(function(Mt){return Mt})}function Ri(Oe,Ke,Mt,ct,Ft){return Ee.useMemo(function(){var un=Oe,vn=!Oe;vn&&(un=oi(Ke));var Nn=new Map,kn=new Map,on=function(xr,Kn,Pr){Pr&&typeof Pr=="string"&&xr.set(Kn[Pr],Kn)};function zn(Wn){for(var xr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Kn=0;Kn<Wn.length;Kn+=1){var Pr=Wn[Kn];!Pr[Mt.options]||xr?(Nn.set(Pr[Mt.value],Pr),on(kn,Pr,Mt.label),on(kn,Pr,ct),on(kn,Pr,Ft)):zn(Pr[Mt.options],!0)}}return zn(un),{options:un,valueOptions:Nn,labelOptions:kn}},[Oe,Ke,Mt,ct,Ft])}function ji(Oe){var Ke=Ee.useRef();Ke.current=Oe;var Mt=Ee.useCallback(function(){return Ke.current.apply(Ke,arguments)},[]);return Mt}var Yr=function(){return null};Yr.isSelectOptGroup=!0;var vi=Yr,Wi=function(){return null};Wi.isSelectOption=!0;var la=Wi;function ta(Oe,Ke){var Mt=(0,_e.Z)({},Oe);return Array.isArray(Ke)&&Ke.forEach(function(ct){delete Mt[ct]}),Mt}var ri=se(73299),xt=Ee.createContext(null),vt=xt;function Zt(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var fn=["disabled","title","children","style","className"];function Tn(Oe){return typeof Oe=="string"||typeof Oe=="number"}var pr=function(Ke,Mt){var ct=Rn(),Ft=ct.prefixCls,un=ct.id,vn=ct.open,Nn=ct.multiple,kn=ct.mode,on=ct.searchValue,zn=ct.toggleOpen,Wn=ct.notFoundContent,xr=ct.onPopupScroll,Kn=Ee.useContext(vt),Pr=Kn.flattenOptions,Xr=Kn.onActiveValue,Rr=Kn.defaultActiveFirstOption,Ur=Kn.onSelect,Er=Kn.menuItemSelectedIcon,Fr=Kn.rawValues,Qr=Kn.fieldNames,si=Kn.virtual,Nr=Kn.direction,di=Kn.listHeight,Pi=Kn.listItemHeight,na="".concat(Ft,"-item"),Gi=Pt(function(){return Pr},[vn,Pr],function(ki,ei){return ei[0]&&ki[1]!==ei[1]}),Ni=Ee.useRef(null),qi=function(ei){ei.preventDefault()},Qi=function(ei){Ni.current&&Ni.current.scrollTo(typeof ei=="number"?{index:ei}:ei)},wi=function(ei){for(var zi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ua=Gi.length,Zi=0;Zi<ua;Zi+=1){var aa=(ei+Zi*zi+ua)%ua,pi=Gi[aa],pa=pi.group,xa=pi.data;if(!pa&&!xa.disabled)return aa}return-1},$i=Ee.useState(function(){return wi(0)}),qr=(0,ke.Z)($i,2),fi=qr[0],Ti=qr[1],Xi=function(ei){var zi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Ti(ei);var ua={source:zi?"keyboard":"mouse"},Zi=Gi[ei];if(!Zi){Xr(null,-1,ua);return}Xr(Zi.value,ei,ua)};(0,Ee.useEffect)(function(){Xi(Rr!==!1?wi(0):-1)},[Gi.length,on]);var Na=Ee.useCallback(function(ki){return Fr.has(ki)&&kn!=="combobox"},[kn,(0,Ve.Z)(Fr).toString(),Fr.size]);(0,Ee.useEffect)(function(){var ki=setTimeout(function(){if(!Nn&&vn&&Fr.size===1){var zi=Array.from(Fr)[0],ua=Gi.findIndex(function(Zi){var aa=Zi.data;return aa.value===zi});ua!==-1&&(Xi(ua),Qi(ua))}});if(vn){var ei;(ei=Ni.current)===null||ei===void 0||ei.scrollTo(void 0)}return function(){return clearTimeout(ki)}},[vn,on,Pr.length]);var $a=function(ei){ei!==void 0&&Ur(ei,{selected:!Fr.has(ei)}),Nn||zn(!1)};if(Ee.useImperativeHandle(Mt,function(){return{onKeyDown:function(ei){var zi=ei.which,ua=ei.ctrlKey;switch(zi){case qe.N:case qe.P:case qe.UP:case qe.DOWN:{var Zi=0;if(zi===qe.UP?Zi=-1:zi===qe.DOWN?Zi=1:Zt()&&ua&&(zi===qe.N?Zi=1:zi===qe.P&&(Zi=-1)),Zi!==0){var aa=wi(fi+Zi,Zi);Qi(aa),Xi(aa,!0)}break}case qe.ENTER:{var pi=Gi[fi];pi&&!pi.data.disabled?$a(pi.value):$a(void 0),vn&&ei.preventDefault();break}case qe.ESC:zn(!1),vn&&ei.stopPropagation()}},onKeyUp:function(){},scrollTo:function(ei){Qi(ei)}}}),Gi.length===0)return Ee.createElement("div",{role:"listbox",id:"".concat(un,"_list"),className:"".concat(na,"-empty"),onMouseDown:qi},Wn);var Aa=Object.keys(Qr).map(function(ki){return Qr[ki]}),ca=function(ei){return ei.label};function ea(ki,ei){var zi=ki.group;return{role:zi?"presentation":"option",id:"".concat(un,"_list_").concat(ei)}}var Ei=function(ei){var zi=Gi[ei];if(!zi)return null;var ua=zi.data||{},Zi=ua.value,aa=zi.group,pi=nn(ua,!0),pa=ca(zi);return zi?Ee.createElement("div",(0,Re.Z)({"aria-label":typeof pa=="string"&&!aa?pa:null},pi,{key:ei},ea(zi,ei),{"aria-selected":Na(Zi)}),Zi):null},Oa={role:"listbox",id:"".concat(un,"_list")};return Ee.createElement(Ee.Fragment,null,si&&Ee.createElement("div",(0,Re.Z)({},Oa,{style:{height:0,width:0,overflow:"hidden"}}),Ei(fi-1),Ei(fi),Ei(fi+1)),Ee.createElement(ri.Z,{itemKey:"key",ref:Ni,data:Gi,height:di,itemHeight:Pi,fullHeight:!1,onMouseDown:qi,onScroll:xr,virtual:si,direction:Nr,innerProps:si?null:Oa},function(ki,ei){var zi,ua=ki.group,Zi=ki.groupOption,aa=ki.data,pi=ki.label,pa=ki.value,xa=aa.key;if(ua){var fa,wa=(fa=aa.title)!==null&&fa!==void 0?fa:Tn(pi)?pi.toString():void 0;return Ee.createElement("div",{className:He()(na,"".concat(na,"-group")),title:wa},pi!==void 0?pi:xa)}var Ea=aa.disabled,ja=aa.title,ha=aa.children,ka=aa.style,Ja=aa.className,Ga=(0,Se.Z)(aa,fn),so=ta(Ga,Aa),Fa=Na(pa),Ca="".concat(na,"-option"),_i=He()(na,Ca,Ja,(zi={},(0,ve.Z)(zi,"".concat(Ca,"-grouped"),Zi),(0,ve.Z)(zi,"".concat(Ca,"-active"),fi===ei&&!Ea),(0,ve.Z)(zi,"".concat(Ca,"-disabled"),Ea),(0,ve.Z)(zi,"".concat(Ca,"-selected"),Fa),zi)),Ki=ca(ki),da=!Er||typeof Er=="function"||Fa,Sa=typeof Ki=="number"?Ki:Ki||pa,Ka=Tn(Sa)?Sa.toString():void 0;return ja!==void 0&&(Ka=ja),Ee.createElement("div",(0,Re.Z)({},nn(so),si?{}:ea(ki,ei),{"aria-selected":Fa,className:_i,title:Ka,onMouseMove:function(){fi===ei||Ea||Xi(ei)},onClick:function(){Ea||$a(pa)},style:ka}),Ee.createElement("div",{className:"".concat(Ca,"-content")},Sa),Ee.isValidElement(Er)||Fa,da&&Ee.createElement(Je,{className:"".concat(na,"-option-state"),customizeIcon:Er,customizeIconProps:{isSelected:Fa}},Fa?"\u2713":null))}))},Ar=Ee.forwardRef(pr);Ar.displayName="OptionList";var Wr=Ar;function Vr(Oe){var Ke=Oe.mode,Mt=Oe.options,ct=Oe.children,Ft=Oe.backfill,un=Oe.allowClear,vn=Oe.placeholder,Nn=Oe.getInputElement,kn=Oe.showSearch,on=Oe.onSearch,zn=Oe.defaultOpen,Wn=Oe.autoFocus,xr=Oe.labelInValue,Kn=Oe.value,Pr=Oe.inputValue,Xr=Oe.optionLabelProp,Rr=isMultiple(Ke),Ur=kn!==void 0?kn:Rr||Ke==="combobox",Er=Mt||convertChildrenToData(ct);if(warning(Ke!=="tags"||Er.every(function(Nr){return!Nr.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Ke==="tags"||Ke==="combobox"){var Fr=Er.some(function(Nr){return Nr.options?Nr.options.some(function(di){return typeof("value"in di?di.value:di.key)=="number"}):typeof("value"in Nr?Nr.value:Nr.key)=="number"});warning(!Fr,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(Ke!=="combobox"||!Xr,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(Ke==="combobox"||!Ft,"`backfill` only works with `combobox` mode."),warning(Ke==="combobox"||!Nn,"`getInputElement` only work with `combobox` mode."),noteOnce(Ke!=="combobox"||!Nn||!un||!vn,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),on&&!Ur&&Ke!=="combobox"&&Ke!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!zn||Wn,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Kn!=null){var Qr=toArray(Kn);warning(!xr||Qr.every(function(Nr){return _typeof(Nr)==="object"&&("key"in Nr||"value"in Nr)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!Rr||Array.isArray(Kn),"`value` should be array when `mode` is `multiple` or `tags`")}if(ct){var si=null;toNodeArray(ct).some(function(Nr){if(!React.isValidElement(Nr)||!Nr.type)return!1;var di=Nr,Pi=di.type;if(Pi.isSelectOption)return!1;if(Pi.isSelectOptGroup){var na=toNodeArray(Nr.props.children).every(function(Gi){return!React.isValidElement(Gi)||!Nr.type||Gi.type.isSelectOption?!0:(si=Gi.type,!1)});return!na}return si=Pi,!0}),si&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(si.displayName||si.name||si,"`.")),warning(Pr===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function Hr(Oe,Ke){if(Oe){var Mt=function ct(Ft){for(var un=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,vn=0;vn<Ft.length;vn++){var Nn=Ft[vn];if(Nn[Ke==null?void 0:Ke.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!un&&Array.isArray(Nn[Ke==null?void 0:Ke.options])&&ct(Nn[Ke==null?void 0:Ke.options],!0))break}};Mt(Oe)}}var ti=null,yi=["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"],Lr=["inputValue"];function hi(Oe){return!Oe||(0,me.Z)(Oe)!=="object"}var Ai=Ee.forwardRef(function(Oe,Ke){var Mt=Oe.id,ct=Oe.mode,Ft=Oe.prefixCls,un=Ft===void 0?"rc-select":Ft,vn=Oe.backfill,Nn=Oe.fieldNames,kn=Oe.inputValue,on=Oe.searchValue,zn=Oe.onSearch,Wn=Oe.autoClearSearchValue,xr=Wn===void 0?!0:Wn,Kn=Oe.onSelect,Pr=Oe.onDeselect,Xr=Oe.dropdownMatchSelectWidth,Rr=Xr===void 0?!0:Xr,Ur=Oe.filterOption,Er=Oe.filterSort,Fr=Oe.optionFilterProp,Qr=Oe.optionLabelProp,si=Oe.options,Nr=Oe.children,di=Oe.defaultActiveFirstOption,Pi=Oe.menuItemSelectedIcon,na=Oe.virtual,Gi=Oe.direction,Ni=Oe.listHeight,qi=Ni===void 0?200:Ni,Qi=Oe.listItemHeight,wi=Qi===void 0?20:Qi,$i=Oe.value,qr=Oe.defaultValue,fi=Oe.labelInValue,Ti=Oe.onChange,Xi=(0,Se.Z)(Oe,yi),Na=Bi(Mt),$a=Pn(ct),Aa=!!(!si&&Nr),ca=Ee.useMemo(function(){return Ur===void 0&&ct==="combobox"?!1:Ur},[Ur,ct]),ea=Ee.useMemo(function(){return or(Nn,Aa)},[JSON.stringify(Nn),Aa]),Ei=At("",{value:on!==void 0?on:kn,postState:function(Si){return Si||""}}),Oa=(0,ke.Z)(Ei,2),ki=Oa[0],ei=Oa[1],zi=Ri(si,Nr,ea,Fr,Qr),ua=zi.valueOptions,Zi=zi.labelOptions,aa=zi.options,pi=Ee.useCallback(function(Or){var Si=Ji(Or);return Si.map(function(Ci){var Di,Ha,Va,Fo,Zo;if(hi(Ci))Di=Ci;else{var ls;Va=Ci.key,Ha=Ci.label,Di=(ls=Ci.value)!==null&&ls!==void 0?ls:Va}var va=ua.get(Di);if(va){var Ro;if(Ha===void 0&&(Ha=va==null?void 0:va[Qr||ea.label]),Va===void 0&&(Va=(Ro=va==null?void 0:va.key)!==null&&Ro!==void 0?Ro:Di),Fo=va==null?void 0:va.disabled,Zo=va==null?void 0:va.title,0)var cs}return{label:Ha,value:Di,key:Va,disabled:Fo,title:Zo}})},[ea,Qr,ua]),pa=At(qr,{value:$i}),xa=(0,ke.Z)(pa,2),fa=xa[0],wa=xa[1],Ea=Ee.useMemo(function(){var Or,Si=pi(fa);return ct==="combobox"&&yt((Or=Si[0])===null||Or===void 0?void 0:Or.value)?[]:Si},[fa,pi,ct]),ja=mn(Ea,ua),ha=(0,ke.Z)(ja,2),ka=ha[0],Ja=ha[1],Ga=Ee.useMemo(function(){if(!ct&&ka.length===1){var Or=ka[0];if(Or.value===null&&(Or.label===null||Or.label===void 0))return[]}return ka.map(function(Si){var Ci;return(0,_e.Z)((0,_e.Z)({},Si),{},{label:(Ci=Si.label)!==null&&Ci!==void 0?Ci:Si.value})})},[ct,ka]),so=Ee.useMemo(function(){return new Set(ka.map(function(Or){return Or.value}))},[ka]);Ee.useEffect(function(){if(ct==="combobox"){var Or,Si=(Or=ka[0])===null||Or===void 0?void 0:Or.value;ei(ui(Si)?String(Si):"")}},[ka]);var Fa=ji(function(Or,Si){var Ci,Di=Si!=null?Si:Or;return Ci={},(0,ve.Z)(Ci,ea.value,Or),(0,ve.Z)(Ci,ea.label,Di),Ci}),Ca=Ee.useMemo(function(){if(ct!=="tags")return aa;var Or=(0,Ve.Z)(aa),Si=function(Di){return ua.has(Di)};return(0,Ve.Z)(ka).sort(function(Ci,Di){return Ci.value<Di.value?-1:1}).forEach(function(Ci){var Di=Ci.value;Si(Di)||Or.push(Fa(Di,Ci.label))}),Or},[Fa,aa,ua,ka,ct]),_i=cr(Ca,ea,ki,ca,Fr),Ki=Ee.useMemo(function(){return ct!=="tags"||!ki||_i.some(function(Or){return Or[Fr||"value"]===ki})||_i.some(function(Or){return Or[ea.value]===ki})?_i:[Fa(ki)].concat((0,Ve.Z)(_i))},[Fa,Fr,ct,_i,ki,ea]),da=Ee.useMemo(function(){return Er?(0,Ve.Z)(Ki).sort(function(Or,Si){return Er(Or,Si)}):Ki},[Ki,Er]),Sa=Ee.useMemo(function(){return lr(da,{fieldNames:ea,childrenAsData:Aa})},[da,ea,Aa]),Ka=function(Si){var Ci=pi(Si);if(wa(Ci),Ti&&(Ci.length!==ka.length||Ci.some(function(Va,Fo){var Zo;return((Zo=ka[Fo])===null||Zo===void 0?void 0:Zo.value)!==(Va==null?void 0:Va.value)}))){var Di=fi?Ci:Ci.map(function(Va){return Va.value}),Ha=Ci.map(function(Va){return ht(Ja(Va.value))});Ti($a?Di:Di[0],$a?Ha:Ha[0])}},io=Ee.useState(null),ho=(0,ke.Z)(io,2),Oo=ho[0],Bo=ho[1],lo=Ee.useState(0),Ao=(0,ke.Z)(lo,2),ra=Ao[0],Oi=Ao[1],Ta=di!==void 0?di:ct!=="combobox",_a=Ee.useCallback(function(Or,Si){var Ci=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Di=Ci.source,Ha=Di===void 0?"keyboard":Di;Oi(Si),vn&&ct==="combobox"&&Or!==null&&Ha==="keyboard"&&Bo(String(Or))},[vn,ct]),co=function(Si,Ci,Di){var Ha=function(){var ms,zo=Ja(Si);return[fi?{label:zo==null?void 0:zo[ea.label],value:Si,key:(ms=zo==null?void 0:zo.key)!==null&&ms!==void 0?ms:Si}:Si,ht(zo)]};if(Ci&&Kn){var Va=Ha(),Fo=(0,ke.Z)(Va,2),Zo=Fo[0],ls=Fo[1];Kn(Zo,ls)}else if(!Ci&&Pr&&Di!=="clear"){var va=Ha(),Ro=(0,ke.Z)(va,2),cs=Ro[0],ul=Ro[1];Pr(cs,ul)}},ao=ji(function(Or,Si){var Ci,Di=$a?Si.selected:!0;Di?Ci=$a?[].concat((0,Ve.Z)(ka),[Or]):[Or]:Ci=ka.filter(function(Ha){return Ha.value!==Or}),Ka(Ci),co(Or,Di),ct==="combobox"?Bo(""):(!Pn||xr)&&(ei(""),Bo(""))}),hs=function(Si,Ci){Ka(Si);var Di=Ci.type,Ha=Ci.values;(Di==="remove"||Di==="clear")&&Ha.forEach(function(Va){co(Va.value,!1,Di)})},Qo=function(Si,Ci){if(ei(Si),Bo(null),Ci.source==="submit"){var Di=(Si||"").trim();if(Di){var Ha=Array.from(new Set([].concat((0,Ve.Z)(so),[Di])));Ka(Ha),co(Di,!0),ei("")}return}Ci.source!=="blur"&&(ct==="combobox"&&Ka(Si),zn==null||zn(Si))},ps=function(Si){var Ci=Si;ct!=="tags"&&(Ci=Si.map(function(Ha){var Va=Zi.get(Ha);return Va==null?void 0:Va.value}).filter(function(Ha){return Ha!==void 0}));var Di=Array.from(new Set([].concat((0,Ve.Z)(so),(0,Ve.Z)(Ci))));Ka(Di),Di.forEach(function(Ha){co(Ha,!0)})},oa=Ee.useMemo(function(){var Or=na!==!1&&Rr!==!1;return(0,_e.Z)((0,_e.Z)({},zi),{},{flattenOptions:Sa,onActiveValue:_a,defaultActiveFirstOption:Ta,onSelect:ao,menuItemSelectedIcon:Pi,rawValues:so,fieldNames:ea,virtual:Or,direction:Gi,listHeight:qi,listItemHeight:wi,childrenAsData:Aa})},[zi,Sa,_a,Ta,ao,Pi,so,ea,na,Rr,qi,wi,Aa]);return Ee.createElement(vt.Provider,{value:oa},Ee.createElement(pn,(0,Re.Z)({},Xi,{id:Na,prefixCls:un,ref:Ke,omitDomProps:Lr,mode:ct,displayValues:Ga,onDisplayValuesChange:hs,direction:Gi,searchValue:ki,onSearch:Qo,autoClearSearchValue:xr,onSearchSplit:ps,dropdownMatchSelectWidth:Rr,OptionList:Wr,emptyOptions:!Sa.length,activeValue:Oo,activeDescendantId:"".concat(Na,"_list_").concat(ra)})))}),Mi=Ai;Mi.Option=la,Mi.OptGroup=vi;var Le=Mi,Fe=Le,ze=se(10366),Ze=se(8745),et=se(33603),lt=se(9708),wt=se(53124),Qt=se(98866),sn=se(88258),Xn=se(98675),vr=se(65223),Zn=se(4173),xn=se(87244),gn=se(13458),An=se(78642),Bn=se(46163),fr=function(Oe,Ke){var Mt={};for(var ct in Oe)Object.prototype.hasOwnProperty.call(Oe,ct)&&Ke.indexOf(ct)<0&&(Mt[ct]=Oe[ct]);if(Oe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ft=0,ct=Object.getOwnPropertySymbols(Oe);Ft<ct.length;Ft++)Ke.indexOf(ct[Ft])<0&&Object.prototype.propertyIsEnumerable.call(Oe,ct[Ft])&&(Mt[ct[Ft]]=Oe[ct[Ft]]);return Mt};const Gn="SECRET_COMBOBOX_MODE_DO_NOT_USE",jn=(Oe,Ke)=>{var Mt,{prefixCls:ct,bordered:Ft=!0,className:un,rootClassName:vn,getPopupContainer:Nn,popupClassName:kn,dropdownClassName:on,listHeight:zn=256,placement:Wn,listItemHeight:xr=24,size:Kn,disabled:Pr,notFoundContent:Xr,status:Rr,builtinPlacements:Ur,dropdownMatchSelectWidth:Er,popupMatchSelectWidth:Fr,direction:Qr,style:si,allowClear:Nr}=Oe,di=fr(Oe,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:Pi,getPrefixCls:na,renderEmpty:Gi,direction:Ni,virtual:qi,popupMatchSelectWidth:Qi,popupOverflow:wi,select:$i}=Ee.useContext(wt.E_),qr=na("select",ct),fi=na(),Ti=Qr!=null?Qr:Ni,{compactSize:Xi,compactItemClassnames:Na}=(0,Zn.ri)(qr,Ti),[$a,Aa]=(0,xn.Z)(qr),ca=Ee.useMemo(()=>{const{mode:Ca}=di;if(Ca!=="combobox")return Ca===Gn?"combobox":Ca},[di.mode]),ea=ca==="multiple"||ca==="tags",Ei=(0,An.Z)(di.suffixIcon,di.showArrow),Oa=(Mt=Fr!=null?Fr:Er)!==null&&Mt!==void 0?Mt:Qi,{status:ki,hasFeedback:ei,isFormItemInput:zi,feedbackIcon:ua}=Ee.useContext(vr.aM),Zi=(0,lt.F)(ki,Rr);let aa;Xr!==void 0?aa=Xr:ca==="combobox"?aa=null:aa=(Gi==null?void 0:Gi("Select"))||Ee.createElement(sn.Z,{componentName:"Select"});const{suffixIcon:pi,itemIcon:pa,removeIcon:xa,clearIcon:fa}=(0,Bn.Z)(Object.assign(Object.assign({},di),{multiple:ea,hasFeedback:ei,feedbackIcon:ua,showSuffixIcon:Ei,prefixCls:qr,showArrow:di.showArrow,componentName:"Select"})),wa=Nr===!0?{clearIcon:fa}:Nr,Ea=(0,ze.Z)(di,["suffixIcon","itemIcon"]),ja=He()(kn||on,{[`${qr}-dropdown-${Ti}`]:Ti==="rtl"},vn,Aa),ha=(0,Xn.Z)(Ca=>{var _i;return(_i=Kn!=null?Kn:Xi)!==null&&_i!==void 0?_i:Ca}),ka=Ee.useContext(Qt.Z),Ja=Pr!=null?Pr:ka,Ga=He()({[`${qr}-lg`]:ha==="large",[`${qr}-sm`]:ha==="small",[`${qr}-rtl`]:Ti==="rtl",[`${qr}-borderless`]:!Ft,[`${qr}-in-form-item`]:zi},(0,lt.Z)(qr,Zi,ei),Na,$i==null?void 0:$i.className,un,vn,Aa),so=Ee.useMemo(()=>Wn!==void 0?Wn:Ti==="rtl"?"bottomRight":"bottomLeft",[Wn,Ti]),Fa=(0,gn.Z)(Ur,wi);return $a(Ee.createElement(Fe,Object.assign({ref:Ke,virtual:qi,showSearch:$i==null?void 0:$i.showSearch},Ea,{style:Object.assign(Object.assign({},$i==null?void 0:$i.style),si),dropdownMatchSelectWidth:Oa,builtinPlacements:Fa,transitionName:(0,et.m)(fi,"slide-up",di.transitionName),listHeight:zn,listItemHeight:xr,mode:ca,prefixCls:qr,placement:so,direction:Ti,suffixIcon:pi,menuItemSelectedIcon:pa,removeIcon:xa,allowClear:wa,notFoundContent:aa,className:Ga,getPopupContainer:Nn||Pi,dropdownClassName:ja,disabled:Ja})))},er=Ee.forwardRef(jn),tr=(0,Ze.Z)(er);er.SECRET_COMBOBOX_MODE_DO_NOT_USE=Gn,er.Option=la,er.OptGroup=vi,er._InternalPanelDoNotUseOrYouWillBeFired=tr;var yr=er},87244:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return Ie}});var he=se(14747),He=se(80110),Re=se(45503),Ve=se(67968),ve=se(67771),_e=se(33297);const ke=xe=>{const{optionHeight:Ue,optionFontSize:je,optionLineHeight:_t,optionPadding:Ct}=xe;return{position:"relative",display:"block",minHeight:Ue,padding:Ct,color:xe.colorText,fontWeight:"normal",fontSize:je,lineHeight:_t,boxSizing:"border-box"}};var me=xe=>{const{antCls:Ue,componentCls:je}=xe,_t=`${je}-item`,Ct=`&${Ue}-slide-up-enter${Ue}-slide-up-enter-active`,Dt=`&${Ue}-slide-up-appear${Ue}-slide-up-appear-active`,qe=`&${Ue}-slide-up-leave${Ue}-slide-up-leave-active`,Rt=`${je}-dropdown-placement-`;return[{[`${je}-dropdown`]:Object.assign(Object.assign({},(0,he.Wf)(xe)),{position:"absolute",top:-9999,zIndex:xe.zIndexPopup,boxSizing:"border-box",padding:xe.paddingXXS,overflow:"hidden",fontSize:xe.fontSize,fontVariant:"initial",backgroundColor:xe.colorBgElevated,borderRadius:xe.borderRadiusLG,outline:"none",boxShadow:xe.boxShadowSecondary,[`
${Ct}${Rt}bottomLeft,
${Dt}${Rt}bottomLeft
`]:{animationName:ve.fJ},[`
${Ct}${Rt}topLeft,
${Dt}${Rt}topLeft,
${Ct}${Rt}topRight,
${Dt}${Rt}topRight
`]:{animationName:ve.Qt},[`${qe}${Rt}bottomLeft`]:{animationName:ve.Uw},[`
${qe}${Rt}topLeft,
${qe}${Rt}topRight
`]:{animationName:ve.ly},"&-hidden":{display:"none"},[`${_t}`]:Object.assign(Object.assign({},ke(xe)),{cursor:"pointer",transition:`background ${xe.motionDurationSlow} ease`,borderRadius:xe.borderRadiusSM,"&-group":{color:xe.colorTextDescription,fontSize:xe.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},he.vS),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${_t}-option-disabled)`]:{backgroundColor:xe.optionActiveBg},[`&-selected:not(${_t}-option-disabled)`]:{color:xe.optionSelectedColor,fontWeight:xe.optionSelectedFontWeight,backgroundColor:xe.optionSelectedBg,[`${_t}-option-state`]:{color:xe.colorPrimary}},"&-disabled":{[`&${_t}-option-selected`]:{backgroundColor:xe.colorBgContainerDisabled},color:xe.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:xe.controlPaddingHorizontal*2}}}),"&-rtl":{direction:"rtl"}})},(0,ve.oN)(xe,"slide-up"),(0,ve.oN)(xe,"slide-down"),(0,_e.Fm)(xe,"move-up"),(0,_e.Fm)(xe,"move-down")]};const Ee=2,tt=xe=>{let{controlHeightSM:Ue,controlHeight:je,lineWidth:_t}=xe;const Ct=(je-Ue)/2-_t,Dt=Math.ceil(Ct/2);return[Ct,Dt]};function Be(xe,Ue){const{componentCls:je,iconCls:_t}=xe,Ct=`${je}-selection-overflow`,Dt=xe.multipleSelectItemHeight,[qe]=tt(xe),Rt=Ue?`${je}-${Ue}`:"";return{[`${je}-multiple${Rt}`]:{fontSize:xe.fontSize,[Ct]:{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:`${qe-Ee}px ${Ee*2}px`,borderRadius:xe.borderRadius,[`${je}-show-search&`]:{cursor:"text"},[`${je}-disabled&`]:{background:xe.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${Ee}px 0`,lineHeight:`${Dt}px`,visibility:"hidden",content:'"\\a0"'}},[`
&${je}-show-arrow ${je}-selector,
&${je}-allow-clear ${je}-selector
`]:{paddingInlineEnd:xe.fontSizeIcon+xe.controlPaddingHorizontal},[`${je}-selection-item`]:{position:"relative",display:"flex",flex:"none",boxSizing:"border-box",maxWidth:"100%",height:Dt,marginTop:Ee,marginBottom:Ee,lineHeight:`${Dt-xe.lineWidth*2}px`,background:xe.multipleItemBg,border:`${xe.lineWidth}px ${xe.lineType} ${xe.multipleItemBorderColor}`,borderRadius:xe.borderRadiusSM,cursor:"default",transition:`font-size ${xe.motionDurationSlow}, line-height ${xe.motionDurationSlow}, height ${xe.motionDurationSlow}`,userSelect:"none",marginInlineEnd:Ee*2,paddingInlineStart:xe.paddingXS,paddingInlineEnd:xe.paddingXS/2,[`${je}-disabled&`]:{color:xe.multipleItemColorDisabled,borderColor:xe.multipleItemBorderColorDisabled,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:xe.paddingXS/2,overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},(0,he.Ro)()),{display:"inline-flex",alignItems:"center",color:xe.colorIcon,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${_t}`]:{verticalAlign:"-0.2em"},"&:hover":{color:xe.colorIconHover}})},[`${Ct}-item + ${Ct}-item`]:{[`${je}-selection-search`]:{marginInlineStart:0}},[`${je}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:xe.inputPaddingHorizontalBase-qe,"\n &-input,\n &-mirror\n ":{height:Dt,fontFamily:xe.fontFamily,lineHeight:`${Dt}px`,transition:`all ${xe.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:xe.inputPaddingHorizontalBase,insetInlineEnd:xe.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${xe.motionDurationSlow}`}}}}var dt=xe=>{const{componentCls:Ue}=xe,je=(0,Re.TS)(xe,{controlHeight:xe.controlHeightSM,multipleSelectItemHeight:xe.controlHeightXS,borderRadius:xe.borderRadiusSM,borderRadiusSM:xe.borderRadiusXS}),_t=(0,Re.TS)(xe,{fontSize:xe.fontSizeLG,controlHeight:xe.controlHeightLG,multipleSelectItemHeight:xe.multipleItemHeightLG,borderRadius:xe.borderRadiusLG,borderRadiusSM:xe.borderRadius}),[,Ct]=tt(xe);return[Be(xe),Be(je,"sm"),{[`${Ue}-multiple${Ue}-sm`]:{[`${Ue}-selection-placeholder`]:{insetInline:xe.controlPaddingHorizontalSM-xe.lineWidth},[`${Ue}-selection-search`]:{marginInlineStart:Ct}}},Be(_t,"lg")]};function it(xe,Ue){const{componentCls:je,inputPaddingHorizontalBase:_t,borderRadius:Ct}=xe,Dt=xe.controlHeight-xe.lineWidth*2,qe=Math.ceil(xe.fontSize*1.25),Rt=Ue?`${je}-${Ue}`:"";return{[`${je}-single${Rt}`]:{fontSize:xe.fontSize,[`${je}-selector`]:Object.assign(Object.assign({},(0,he.Wf)(xe)),{display:"flex",borderRadius:Ct,[`${je}-selection-search`]:{position:"absolute",top:0,insetInlineStart:_t,insetInlineEnd:_t,bottom:0,"&-input":{width:"100%"}},[`
${je}-selection-item,
${je}-selection-placeholder
`]:{padding:0,lineHeight:`${Dt}px`,transition:`all ${xe.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:qe},[`&${je}-open ${je}-selection-item`]:{color:xe.colorTextPlaceholder},[`&:not(${je}-customize-input)`]:{[`${je}-selector`]:{width:"100%",height:xe.controlHeight,padding:`0 ${_t}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 ${_t}px`,"&:after":{display:"none"}}}}}}}function Ge(xe){const{componentCls:Ue}=xe,je=xe.controlPaddingHorizontalSM-xe.lineWidth;return[it(xe),it((0,Re.TS)(xe,{controlHeight:xe.controlHeightSM,borderRadius:xe.borderRadiusSM}),"sm"),{[`${Ue}-single${Ue}-sm`]:{[`&:not(${Ue}-customize-input)`]:{[`${Ue}-selection-search`]:{insetInlineStart:je,insetInlineEnd:je},[`${Ue}-selector`]:{padding:`0 ${je}px`},[`&${Ue}-show-arrow ${Ue}-selection-search`]:{insetInlineEnd:je+xe.fontSize*1.5},[`
&${Ue}-show-arrow ${Ue}-selection-item,
&${Ue}-show-arrow ${Ue}-selection-placeholder
`]:{paddingInlineEnd:xe.fontSize*1.5}}}},it((0,Re.TS)(xe,{controlHeight:xe.singleItemHeightLG,fontSize:xe.fontSizeLG,borderRadius:xe.borderRadiusLG}),"lg")]}const De=xe=>{const{componentCls:Ue,selectorBg:je}=xe;return{position:"relative",backgroundColor:je,border:`${xe.lineWidth}px ${xe.lineType} ${xe.colorBorder}`,transition:`all ${xe.motionDurationMid} ${xe.motionEaseInOut}`,input:{cursor:"pointer"},[`${Ue}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit"}},[`${Ue}-disabled&`]:{color:xe.colorTextDisabled,background:xe.colorBgContainerDisabled,cursor:"not-allowed",[`${Ue}-multiple&`]:{background:xe.multipleSelectorBgDisabled},input:{cursor:"not-allowed"}}}},At=function(xe,Ue){let je=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const{componentCls:_t,borderHoverColor:Ct,outlineColor:Dt,antCls:qe}=Ue,Rt=je?{[`${_t}-selector`]:{borderColor:Ct}}:{};return{[xe]:{[`&:not(${_t}-disabled):not(${_t}-customize-input):not(${qe}-pagination-size-changer)`]:Object.assign(Object.assign({},Rt),{[`${_t}-focused& ${_t}-selector`]:{borderColor:Ct,boxShadow:`0 0 0 ${Ue.controlOutlineWidth}px ${Dt}`,outline:0},[`&:hover ${_t}-selector`]:{borderColor:Ct}})}}},Xt=xe=>{const{componentCls:Ue}=xe;return{[`${Ue}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},rt=xe=>{const{componentCls:Ue,inputPaddingHorizontalBase:je,iconCls:_t}=xe;return{[Ue]:Object.assign(Object.assign({},(0,he.Wf)(xe)),{position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${Ue}-customize-input) ${Ue}-selector`]:Object.assign(Object.assign({},De(xe)),Xt(xe)),[`${Ue}-selection-item`]:Object.assign({flex:1,fontWeight:"normal"},he.vS),[`${Ue}-selection-placeholder`]:Object.assign(Object.assign({},he.vS),{flex:1,color:xe.colorTextPlaceholder,pointerEvents:"none"}),[`${Ue}-arrow`]:Object.assign(Object.assign({},(0,he.Ro)()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:je,height:xe.fontSizeIcon,marginTop:-xe.fontSizeIcon/2,color:xe.colorTextQuaternary,fontSize:xe.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",[_t]:{verticalAlign:"top",transition:`transform ${xe.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${Ue}-suffix)`]:{pointerEvents:"auto"}},[`${Ue}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${Ue}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:je,zIndex:1,display:"inline-block",width:xe.fontSizeIcon,height:xe.fontSizeIcon,marginTop:-xe.fontSizeIcon/2,color:xe.colorTextQuaternary,fontSize:xe.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",background:xe.clearBg,cursor:"pointer",opacity:0,transition:`color ${xe.motionDurationMid} ease, opacity ${xe.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:xe.colorTextTertiary}},"&:hover":{[`${Ue}-clear`]:{opacity:1}}}),[`${Ue}-has-feedback`]:{[`${Ue}-clear`]:{insetInlineEnd:je+xe.fontSize+xe.paddingXS}}}},ft=xe=>{const{componentCls:Ue}=xe;return[{[Ue]:{[`&-borderless ${Ue}-selector`]:{backgroundColor:"transparent !important",borderColor:"transparent !important",boxShadow:"none !important"},[`&${Ue}-in-form-item`]:{width:"100%"}}},rt(xe),Ge(xe),dt(xe),me(xe),{[`${Ue}-rtl`]:{direction:"rtl"}},At(Ue,(0,Re.TS)(xe,{borderHoverColor:xe.colorPrimaryHover,outlineColor:xe.controlOutline})),At(`${Ue}-status-error`,(0,Re.TS)(xe,{borderHoverColor:xe.colorErrorHover,outlineColor:xe.colorErrorOutline}),!0),At(`${Ue}-status-warning`,(0,Re.TS)(xe,{borderHoverColor:xe.colorWarningHover,outlineColor:xe.colorWarningOutline}),!0),(0,He.c)(xe,{borderElCls:`${Ue}-selector`,focusElCls:`${Ue}-focused`})]};var Ie=(0,Ve.Z)("Select",(xe,Ue)=>{let{rootPrefixCls:je}=Ue;const _t=(0,Re.TS)(xe,{rootPrefixCls:je,inputPaddingHorizontalBase:xe.paddingSM-1,multipleSelectItemHeight:xe.multipleItemHeight});return[ft(_t)]},xe=>{const{fontSize:Ue,lineHeight:je,controlHeight:_t,controlPaddingHorizontal:Ct,zIndexPopupBase:Dt,colorText:qe,fontWeightStrong:Rt,controlItemBgActive:Pt,controlItemBgHover:En,colorBgContainer:tn,colorFillSecondary:$n,controlHeightLG:ur,controlHeightSM:wr,colorBgContainerDisabled:Je,colorTextDisabled:Ae}=xe;return{zIndexPopup:Dt+50,optionSelectedColor:qe,optionSelectedFontWeight:Rt,optionSelectedBg:Pt,optionActiveBg:En,optionPadding:`${(_t-Ue*je)/2}px ${Ct}px`,optionFontSize:Ue,optionLineHeight:je,optionHeight:_t,selectorBg:tn,clearBg:tn,singleItemHeightLG:ur,multipleItemBg:$n,multipleItemBorderColor:"transparent",multipleItemHeight:wr,multipleItemHeightLG:_t,multipleSelectorBgDisabled:Je,multipleItemColorDisabled:Ae,multipleItemBorderColorDisabled:"transparent"}})},13458:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return He}});const he=Re=>{const ve={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:Re==="scroll"?"scroll":"visible",_experimental:{dynamicInset:!0}};return{bottomLeft:Object.assign(Object.assign({},ve),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},ve),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},ve),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},ve),{points:["br","tr"],offset:[0,-4]})}};function He(Re,Ve){return Re||he(Ve)}},78642:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return he}});function he(He,Re){return Re!==void 0?Re:He!==null}},46163:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return Se}});var he=se(18299),He=se(16646),Re=se(73475),Ve=se(42922),ve=se(3407),_e=se(72395),ke=se(67294);function Se(me){let{suffixIcon:Ee,clearIcon:tt,menuItemSelectedIcon:Be,removeIcon:St,loading:dt,multiple:it,hasFeedback:Ge,prefixCls:De,showSuffixIcon:At,feedbackIcon:Xt,showArrow:rt,componentName:ft}=me;const Ie=tt!=null?tt:ke.createElement(He.Z,null),xe=Ct=>Ee===null&&!Ge&&!rt?null:ke.createElement(ke.Fragment,null,At!==!1&&Ct,Ge&&Xt);let Ue=null;if(Ee!==void 0)Ue=xe(Ee);else if(dt)Ue=xe(ke.createElement(ve.Z,{spin:!0}));else{const Ct=`${De}-suffix`;Ue=Dt=>{let{open:qe,showSearch:Rt}=Dt;return xe(qe&&Rt?ke.createElement(_e.Z,{className:Ct}):ke.createElement(Ve.Z,{className:Ct}))}}let je=null;Be!==void 0?je=Be:it?je=ke.createElement(he.Z,null):je=null;let _t=null;return St!==void 0?_t=St:_t=ke.createElement(Re.Z,null),{clearIcon:Ie,suffixIcon:Ue,itemIcon:je,removeIcon:_t}}},33507:function(Sn,Wt){"use strict";const se=he=>({[he.componentCls]:{[`${he.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${he.motionDurationMid} ${he.motionEaseInOut},
opacity ${he.motionDurationMid} ${he.motionEaseInOut} !important`}},[`${he.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${he.motionDurationMid} ${he.motionEaseInOut},
opacity ${he.motionDurationMid} ${he.motionEaseInOut} !important`}}});Wt.Z=se},33297:function(Sn,Wt,se){"use strict";se.d(Wt,{Fm:function(){return Be}});var he=se(34367),He=se(93590);const Re=new he.Keyframes("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Ve=new he.Keyframes("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),ve=new he.Keyframes("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),_e=new he.Keyframes("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),ke=new he.Keyframes("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Se=new he.Keyframes("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),me=new he.Keyframes("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Ee=new he.Keyframes("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),tt={"move-up":{inKeyframes:me,outKeyframes:Ee},"move-down":{inKeyframes:Re,outKeyframes:Ve},"move-left":{inKeyframes:ve,outKeyframes:_e},"move-right":{inKeyframes:ke,outKeyframes:Se}},Be=(St,dt)=>{const{antCls:it}=St,Ge=`${it}-${dt}`,{inKeyframes:De,outKeyframes:At}=tt[dt];return[(0,He.R)(Ge,De,At,St.motionDurationMid),{[`
${Ge}-enter,
${Ge}-appear
`]:{opacity:0,animationTimingFunction:St.motionEaseOutCirc},[`${Ge}-leave`]:{animationTimingFunction:St.motionEaseInOutCirc}}]}},67771:function(Sn,Wt,se){"use strict";se.d(Wt,{Qt:function(){return ve},Uw:function(){return Ve},fJ:function(){return Re},ly:function(){return _e},oN:function(){return Be}});var he=se(34367),He=se(93590);const Re=new he.Keyframes("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),Ve=new he.Keyframes("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),ve=new he.Keyframes("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),_e=new he.Keyframes("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),ke=new he.Keyframes("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),Se=new he.Keyframes("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),me=new he.Keyframes("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),Ee=new he.Keyframes("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),tt={"slide-up":{inKeyframes:Re,outKeyframes:Ve},"slide-down":{inKeyframes:ve,outKeyframes:_e},"slide-left":{inKeyframes:ke,outKeyframes:Se},"slide-right":{inKeyframes:me,outKeyframes:Ee}},Be=(St,dt)=>{const{antCls:it}=St,Ge=`${it}-${dt}`,{inKeyframes:De,outKeyframes:At}=tt[dt];return[(0,He.R)(Ge,De,At,St.motionDurationMid),{[`
${Ge}-enter,
${Ge}-appear
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:St.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${Ge}-leave`]:{animationTimingFunction:St.motionEaseInQuint}}]}},47897:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return pe}});var he=se(3407),He=se(94184),Re=se.n(He);function Ve(){return Ve=Object.assign?Object.assign.bind():function(fe){for(var le=1;le<arguments.length;le++){var Pe=arguments[le];for(var Qe in Pe)Object.prototype.hasOwnProperty.call(Pe,Qe)&&(fe[Qe]=Pe[Qe])}return fe},Ve.apply(this,arguments)}function ve(fe){"@babel/helpers - typeof";return ve=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(le){return typeof le}:function(le){return le&&typeof Symbol=="function"&&le.constructor===Symbol&&le!==Symbol.prototype?"symbol":typeof le},ve(fe)}function _e(fe,le){if(ve(fe)!=="object"||fe===null)return fe;var Pe=fe[Symbol.toPrimitive];if(Pe!==void 0){var Qe=Pe.call(fe,le||"default");if(ve(Qe)!=="object")return Qe;throw new TypeError("@@toPrimitive must return a primitive value.")}return(le==="string"?String:Number)(fe)}function ke(fe){var le=_e(fe,"string");return ve(le)==="symbol"?le:String(le)}function Se(fe,le,Pe){return le=ke(le),le in fe?Object.defineProperty(fe,le,{value:Pe,enumerable:!0,configurable:!0,writable:!0}):fe[le]=Pe,fe}function me(fe){if(Array.isArray(fe))return fe}function Ee(fe,le){var Pe=fe==null?null:typeof Symbol!="undefined"&&fe[Symbol.iterator]||fe["@@iterator"];if(Pe!=null){var Qe,It,Nt,qt,an=[],jt=!0,ir=!1;try{if(Nt=(Pe=Pe.call(fe)).next,le===0){if(Object(Pe)!==Pe)return;jt=!1}else for(;!(jt=(Qe=Nt.call(Pe)).done)&&(an.push(Qe.value),an.length!==le);jt=!0);}catch(Cr){ir=!0,It=Cr}finally{try{if(!jt&&Pe.return!=null&&(qt=Pe.return(),Object(qt)!==qt))return}finally{if(ir)throw It}}return an}}function tt(fe,le){(le==null||le>fe.length)&&(le=fe.length);for(var Pe=0,Qe=new Array(le);Pe<le;Pe++)Qe[Pe]=fe[Pe];return Qe}function Be(fe,le){if(fe){if(typeof fe=="string")return tt(fe,le);var Pe=Object.prototype.toString.call(fe).slice(8,-1);if(Pe==="Object"&&fe.constructor&&(Pe=fe.constructor.name),Pe==="Map"||Pe==="Set")return Array.from(fe);if(Pe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Pe))return tt(fe,le)}}function St(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dt(fe,le){return me(fe)||Ee(fe,le)||Be(fe,le)||St()}function it(fe,le){if(fe==null)return{};var Pe={},Qe=Object.keys(fe),It,Nt;for(Nt=0;Nt<Qe.length;Nt++)It=Qe[Nt],!(le.indexOf(It)>=0)&&(Pe[It]=fe[It]);return Pe}function Ge(fe,le){if(fe==null)return{};var Pe=it(fe,le),Qe,It;if(Object.getOwnPropertySymbols){var Nt=Object.getOwnPropertySymbols(fe);for(It=0;It<Nt.length;It++)Qe=Nt[It],!(le.indexOf(Qe)>=0)&&Object.prototype.propertyIsEnumerable.call(fe,Qe)&&(Pe[Qe]=fe[Qe])}return Pe}var De=se(67294);function At(fe){if(Array.isArray(fe))return fe}function Xt(fe,le){var Pe=fe==null?null:typeof Symbol!="undefined"&&fe[Symbol.iterator]||fe["@@iterator"];if(Pe!=null){var Qe,It,Nt,qt,an=[],jt=!0,ir=!1;try{if(Nt=(Pe=Pe.call(fe)).next,le===0){if(Object(Pe)!==Pe)return;jt=!1}else for(;!(jt=(Qe=Nt.call(Pe)).done)&&(an.push(Qe.value),an.length!==le);jt=!0);}catch(Cr){ir=!0,It=Cr}finally{try{if(!jt&&Pe.return!=null&&(qt=Pe.return(),Object(qt)!==qt))return}finally{if(ir)throw It}}return an}}function rt(fe,le){(le==null||le>fe.length)&&(le=fe.length);for(var Pe=0,Qe=new Array(le);Pe<le;Pe++)Qe[Pe]=fe[Pe];return Qe}function ft(fe,le){if(fe){if(typeof fe=="string")return rt(fe,le);var Pe=Object.prototype.toString.call(fe).slice(8,-1);if(Pe==="Object"&&fe.constructor&&(Pe=fe.constructor.name),Pe==="Map"||Pe==="Set")return Array.from(fe);if(Pe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Pe))return rt(fe,le)}}function Ie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xe(fe,le){return At(fe)||Xt(fe,le)||ft(fe,le)||Ie()}function Ue(fe){var le=De.useRef();le.current=fe;var Pe=De.useCallback(function(){for(var Qe,It=arguments.length,Nt=new Array(It),qt=0;qt<It;qt++)Nt[qt]=arguments[qt];return(Qe=le.current)===null||Qe===void 0?void 0:Qe.call.apply(Qe,[le].concat(Nt))},[]);return Pe}function je(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var _t=je()?De.useLayoutEffect:De.useEffect,Ct=function(le,Pe){var Qe=De.useRef(!0);_t(function(){return le(Qe.current)},Pe),_t(function(){return Qe.current=!1,function(){Qe.current=!0}},[])},Dt=function(le,Pe){Ct(function(Qe){if(!Qe)return le()},Pe)},qe=null;function Rt(fe){var le=De.useRef(!1),Pe=De.useState(fe),Qe=xe(Pe,2),It=Qe[0],Nt=Qe[1];De.useEffect(function(){return le.current=!1,function(){le.current=!0}},[]);function qt(an,jt){jt&&le.current||Nt(an)}return[It,qt]}function Pt(fe){return fe!==void 0}function En(fe,le){var Pe=le||{},Qe=Pe.defaultValue,It=Pe.value,Nt=Pe.onChange,qt=Pe.postState,an=Rt(function(){return Pt(It)?It:Pt(Qe)?typeof Qe=="function"?Qe():Qe:typeof fe=="function"?fe():fe}),jt=xe(an,2),ir=jt[0],Cr=jt[1],Bt=It!==void 0?It:ir,Mn=qt?qt(Bt):Bt,Vn=Ue(Nt),br=Rt([Bt]),at=xe(br,2),$t=at[0],In=at[1];Dt(function(){var ar=$t[0];ir!==ar&&Vn(ir,ar)},[$t]),Dt(function(){Pt(It)||Cr(It)},[It]);var Jn=Ue(function(ar,Mr){Cr(ar,Mr),In([Bt],Mr)});return[Mn,Jn]}var tn={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(le){var Pe=le.keyCode;if(le.altKey&&!le.ctrlKey||le.metaKey||Pe>=tn.F1&&Pe<=tn.F12)return!1;switch(Pe){case tn.ALT:case tn.CAPS_LOCK:case tn.CONTEXT_MENU:case tn.CTRL:case tn.DOWN:case tn.END:case tn.ESC:case tn.HOME:case tn.INSERT:case tn.LEFT:case tn.MAC_FF_META:case tn.META:case tn.NUMLOCK:case tn.NUM_CENTER:case tn.PAGE_DOWN:case tn.PAGE_UP:case tn.PAUSE:case tn.PRINT_SCREEN:case tn.RIGHT:case tn.SHIFT:case tn.UP:case tn.WIN_KEY:case tn.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(le){if(le>=tn.ZERO&&le<=tn.NINE||le>=tn.NUM_ZERO&&le<=tn.NUM_MULTIPLY||le>=tn.A&&le<=tn.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&le===0)return!0;switch(le){case tn.SPACE:case tn.QUESTION_MARK:case tn.NUM_PLUS:case tn.NUM_MINUS:case tn.NUM_PERIOD:case tn.NUM_DIVISION:case tn.SEMICOLON:case tn.DASH:case tn.EQUALS:case tn.COMMA:case tn.PERIOD:case tn.SLASH:case tn.APOSTROPHE:case tn.SINGLE_QUOTE:case tn.OPEN_SQUARE_BRACKET:case tn.BACKSLASH:case tn.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},$n=tn,ur=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],wr=De.forwardRef(function(fe,le){var Pe,Qe=fe.prefixCls,It=Qe===void 0?"rc-switch":Qe,Nt=fe.className,qt=fe.checked,an=fe.defaultChecked,jt=fe.disabled,ir=fe.loadingIcon,Cr=fe.checkedChildren,Bt=fe.unCheckedChildren,Mn=fe.onClick,Vn=fe.onChange,br=fe.onKeyDown,at=Ge(fe,ur),$t=En(!1,{value:qt,defaultValue:an}),In=dt($t,2),Jn=In[0],ar=In[1];function Mr(ni,hr){var mi=Jn;return jt||(mi=ni,ar(mi),Vn==null||Vn(mi,hr)),mi}function $r(ni){ni.which===$n.LEFT?Mr(!1,ni):ni.which===$n.RIGHT&&Mr(!0,ni),br==null||br(ni)}function Dr(ni){var hr=Mr(!Jn,ni);Mn==null||Mn(hr,ni)}var Kr=Re()(It,Nt,(Pe={},Se(Pe,"".concat(It,"-checked"),Jn),Se(Pe,"".concat(It,"-disabled"),jt),Pe));return De.createElement("button",Ve({},at,{type:"button",role:"switch","aria-checked":Jn,disabled:jt,className:Kr,ref:le,onKeyDown:$r,onClick:Dr}),ir,De.createElement("span",{className:"".concat(It,"-inner")},De.createElement("span",{className:"".concat(It,"-inner-checked")},Cr),De.createElement("span",{className:"".concat(It,"-inner-unchecked")},Bt)))});wr.displayName="Switch";var Je=wr,Ae=se(45353),Ht=se(53124),Rn=se(98866),yn=se(98675),ot=se(84780),nt=se(14747),Tt=se(67968),rn=se(45503);const dn=fe=>{const{componentCls:le,trackHeightSM:Pe,trackPadding:Qe,trackMinWidthSM:It,innerMinMarginSM:Nt,innerMaxMarginSM:qt,handleSizeSM:an}=fe,jt=`${le}-inner`;return{[le]:{[`&${le}-small`]:{minWidth:It,height:Pe,lineHeight:`${Pe}px`,[`${le}-inner`]:{paddingInlineStart:qt,paddingInlineEnd:Nt,[`${jt}-checked`]:{marginInlineStart:`calc(-100% + ${an+Qe*2}px - ${qt*2}px)`,marginInlineEnd:`calc(100% - ${an+Qe*2}px + ${qt*2}px)`},[`${jt}-unchecked`]:{marginTop:-Pe,marginInlineStart:0,marginInlineEnd:0}},[`${le}-handle`]:{width:an,height:an},[`${le}-loading-icon`]:{top:(an-fe.switchLoadingIconSize)/2,fontSize:fe.switchLoadingIconSize},[`&${le}-checked`]:{[`${le}-inner`]:{paddingInlineStart:Nt,paddingInlineEnd:qt,[`${jt}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${jt}-unchecked`]:{marginInlineStart:`calc(100% - ${an+Qe*2}px + ${qt*2}px)`,marginInlineEnd:`calc(-100% + ${an+Qe*2}px - ${qt*2}px)`}},[`${le}-handle`]:{insetInlineStart:`calc(100% - ${an+Qe}px)`}},[`&:not(${le}-disabled):active`]:{[`&:not(${le}-checked) ${jt}`]:{[`${jt}-unchecked`]:{marginInlineStart:fe.marginXXS/2,marginInlineEnd:-fe.marginXXS/2}},[`&${le}-checked ${jt}`]:{[`${jt}-checked`]:{marginInlineStart:-fe.marginXXS/2,marginInlineEnd:fe.marginXXS/2}}}}}}},Ut=fe=>{const{componentCls:le,handleSize:Pe}=fe;return{[le]:{[`${le}-loading-icon${fe.iconCls}`]:{position:"relative",top:(Pe-fe.fontSize)/2,color:fe.switchLoadingIconColor,verticalAlign:"top"},[`&${le}-checked ${le}-loading-icon`]:{color:fe.switchColor}}}},Kt=fe=>{const{componentCls:le,motion:Pe,trackPadding:Qe,handleBg:It,handleShadow:Nt,handleSize:qt}=fe,an=`${le}-handle`;return{[le]:{[an]:{position:"absolute",top:Qe,insetInlineStart:Qe,width:qt,height:qt,transition:`all ${fe.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:It,borderRadius:qt/2,boxShadow:Nt,transition:`all ${fe.switchDuration} ease-in-out`,content:'""'}},[`&${le}-checked ${an}`]:{insetInlineStart:`calc(100% - ${qt+Qe}px)`},[`&:not(${le}-disabled):active`]:Pe?{[`${an}::before`]:{insetInlineEnd:fe.switchHandleActiveInset,insetInlineStart:0},[`&${le}-checked ${an}::before`]:{insetInlineEnd:0,insetInlineStart:fe.switchHandleActiveInset}}:{}}}},bn=fe=>{const{componentCls:le,trackHeight:Pe,trackPadding:Qe,innerMinMargin:It,innerMaxMargin:Nt,handleSize:qt}=fe,an=`${le}-inner`;return{[le]:{[an]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:Nt,paddingInlineEnd:It,transition:`padding-inline-start ${fe.switchDuration} ease-in-out, padding-inline-end ${fe.switchDuration} ease-in-out`,[`${an}-checked, ${an}-unchecked`]:{display:"block",color:fe.colorTextLightSolid,fontSize:fe.fontSizeSM,transition:`margin-inline-start ${fe.switchDuration} ease-in-out, margin-inline-end ${fe.switchDuration} ease-in-out`,pointerEvents:"none"},[`${an}-checked`]:{marginInlineStart:`calc(-100% + ${qt+Qe*2}px - ${Nt*2}px)`,marginInlineEnd:`calc(100% - ${qt+Qe*2}px + ${Nt*2}px)`},[`${an}-unchecked`]:{marginTop:-Pe,marginInlineStart:0,marginInlineEnd:0}},[`&${le}-checked ${an}`]:{paddingInlineStart:It,paddingInlineEnd:Nt,[`${an}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${an}-unchecked`]:{marginInlineStart:`calc(100% - ${qt+Qe*2}px + ${Nt*2}px)`,marginInlineEnd:`calc(-100% + ${qt+Qe*2}px - ${Nt*2}px)`}},[`&:not(${le}-disabled):active`]:{[`&:not(${le}-checked) ${an}`]:{[`${an}-unchecked`]:{marginInlineStart:Qe*2,marginInlineEnd:-Qe*2}},[`&${le}-checked ${an}`]:{[`${an}-checked`]:{marginInlineStart:-Qe*2,marginInlineEnd:Qe*2}}}}}},nn=fe=>{const{componentCls:le,trackHeight:Pe,trackMinWidth:Qe}=fe;return{[le]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,nt.Wf)(fe)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:Qe,height:Pe,lineHeight:`${Pe}px`,verticalAlign:"middle",background:fe.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${fe.motionDurationMid}`,userSelect:"none",[`&:hover:not(${le}-disabled)`]:{background:fe.colorTextTertiary}}),(0,nt.Qy)(fe)),{[`&${le}-checked`]:{background:fe.switchColor,[`&:hover:not(${le}-disabled)`]:{background:fe.colorPrimaryHover}},[`&${le}-loading, &${le}-disabled`]:{cursor:"not-allowed",opacity:fe.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${le}-rtl`]:{direction:"rtl"}})}};var we=(0,Tt.Z)("Switch",fe=>{const le=(0,rn.TS)(fe,{switchDuration:fe.motionDurationMid,switchColor:fe.colorPrimary,switchDisabledOpacity:fe.opacityLoading,switchLoadingIconSize:fe.fontSizeIcon*.75,switchLoadingIconColor:`rgba(0, 0, 0, ${fe.opacityLoading})`,switchHandleActiveInset:"-30%"});return[nn(le),bn(le),Kt(le),Ut(le),dn(le)]},fe=>{const{fontSize:le,lineHeight:Pe,controlHeight:Qe,colorWhite:It}=fe,Nt=le*Pe,qt=Qe/2,an=2,jt=Nt-an*2,ir=qt-an*2;return{trackHeight:Nt,trackHeightSM:qt,trackMinWidth:jt*2+an*4,trackMinWidthSM:ir*2+an*2,trackPadding:an,handleBg:It,handleSize:jt,handleSizeSM:ir,handleShadow:`0 2px 4px 0 ${new ot.C("#00230b").setAlpha(.2).toRgbString()}`,innerMinMargin:jt/2,innerMaxMargin:jt+an+an*2,innerMinMarginSM:ir/2,innerMaxMarginSM:ir+an+an*2}}),ue=function(fe,le){var Pe={};for(var Qe in fe)Object.prototype.hasOwnProperty.call(fe,Qe)&&le.indexOf(Qe)<0&&(Pe[Qe]=fe[Qe]);if(fe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var It=0,Qe=Object.getOwnPropertySymbols(fe);It<Qe.length;It++)le.indexOf(Qe[It])<0&&Object.prototype.propertyIsEnumerable.call(fe,Qe[It])&&(Pe[Qe[It]]=fe[Qe[It]]);return Pe};const oe=De.forwardRef((fe,le)=>{const{prefixCls:Pe,size:Qe,disabled:It,loading:Nt,className:qt,rootClassName:an,style:jt}=fe,ir=ue(fe,["prefixCls","size","disabled","loading","className","rootClassName","style"]),{getPrefixCls:Cr,direction:Bt,switch:Mn}=De.useContext(Ht.E_),Vn=De.useContext(Rn.Z),br=(It!=null?It:Vn)||Nt,at=Cr("switch",Pe),$t=De.createElement("div",{className:`${at}-handle`},Nt&&De.createElement(he.Z,{className:`${at}-loading-icon`})),[In,Jn]=we(at),ar=(0,yn.Z)(Qe),Mr=Re()(Mn==null?void 0:Mn.className,{[`${at}-small`]:ar==="small",[`${at}-loading`]:Nt,[`${at}-rtl`]:Bt==="rtl"},qt,an,Jn),$r=Object.assign(Object.assign({},Mn==null?void 0:Mn.style),jt);return In(De.createElement(Ae.Z,{component:"Switch"},De.createElement(Je,Object.assign({},ir,{prefixCls:at,className:Mr,style:$r,disabled:br,ref:le,loadingIcon:$t}))))});oe.__ANT_SWITCH=!0;var pe=oe},66368:function(Sn,Wt,se){"use strict";se.d(Wt,{default:function(){return Mi}});var he=se(73475),He=se(25877),Re=se(38308),Ve=se(94184),ve=se.n(Ve),_e=se(87462),ke=se(4942),Se=se(1413),me=se(97685),Ee=se(71002),tt=se(45987),Be=se(67294),St=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Le=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Le)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Le==null?void 0:Le.substr(0,4))};function dt(Le){var Fe=Be.useRef();Fe.current=Le;var ze=Be.useCallback(function(){for(var Ze,et=arguments.length,lt=new Array(et),wt=0;wt<et;wt++)lt[wt]=arguments[wt];return(Ze=Fe.current)===null||Ze===void 0?void 0:Ze.call.apply(Ze,[Fe].concat(lt))},[]);return ze}function it(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Ge=it()?Be.useLayoutEffect:Be.useEffect,De=function(Fe,ze){var Ze=Be.useRef(!0);Ge(function(){return Fe(Ze.current)},ze),Ge(function(){return Ze.current=!1,function(){Ze.current=!0}},[])},At=function(Fe,ze){De(function(Ze){if(!Ze)return Fe()},ze)},Xt=null;function rt(Le){var Fe=Be.useRef(!1),ze=Be.useState(Le),Ze=(0,me.Z)(ze,2),et=Ze[0],lt=Ze[1];Be.useEffect(function(){return Fe.current=!1,function(){Fe.current=!0}},[]);function wt(Qt,sn){sn&&Fe.current||lt(Qt)}return[et,wt]}function ft(Le){return Le!==void 0}function Ie(Le,Fe){var ze=Fe||{},Ze=ze.defaultValue,et=ze.value,lt=ze.onChange,wt=ze.postState,Qt=rt(function(){return ft(et)?et:ft(Ze)?typeof Ze=="function"?Ze():Ze:typeof Le=="function"?Le():Le}),sn=(0,me.Z)(Qt,2),Xn=sn[0],vr=sn[1],Zn=et!==void 0?et:Xn,xn=wt?wt(Zn):Zn,gn=dt(lt),An=rt([Zn]),Bn=(0,me.Z)(An,2),fr=Bn[0],Gn=Bn[1];At(function(){var er=fr[0];Xn!==er&&gn(Xn,er)},[fr]),At(function(){ft(et)||vr(et)},[et]);var jn=dt(function(er,tr){vr(er,tr),Gn([Zn],tr)});return[xn,jn]}var xe=se(62874),Ue=(0,Be.createContext)(null),je=Be.forwardRef(function(Le,Fe){var ze=Le.prefixCls,Ze=Le.className,et=Le.style,lt=Le.id,wt=Le.active,Qt=Le.tabKey,sn=Le.children;return Be.createElement("div",{id:lt&&"".concat(lt,"-panel-").concat(Qt),role:"tabpanel",tabIndex:wt?0:-1,"aria-labelledby":lt&&"".concat(lt,"-tab-").concat(Qt),"aria-hidden":!wt,style:et,className:ve()(ze,wt&&"".concat(ze,"-active"),Ze),ref:Fe},sn)}),_t=je,Ct=["key","forceRender","style","className"];function Dt(Le){var Fe=Le.id,ze=Le.activeKey,Ze=Le.animated,et=Le.tabPosition,lt=Le.destroyInactiveTabPane,wt=Be.useContext(Ue),Qt=wt.prefixCls,sn=wt.tabs,Xn=Ze.tabPane,vr="".concat(Qt,"-tabpane");return Be.createElement("div",{className:ve()("".concat(Qt,"-content-holder"))},Be.createElement("div",{className:ve()("".concat(Qt,"-content"),"".concat(Qt,"-content-").concat(et),(0,ke.Z)({},"".concat(Qt,"-content-animated"),Xn))},sn.map(function(Zn){var xn=Zn.key,gn=Zn.forceRender,An=Zn.style,Bn=Zn.className,fr=(0,tt.Z)(Zn,Ct),Gn=xn===ze;return Be.createElement(xe.Z,(0,_e.Z)({key:xn,visible:Gn,forceRender:gn,removeOnLeave:!!lt,leavedClassName:"".concat(vr,"-hidden")},Ze.tabPaneMotion),function(jn,er){var tr=jn.style,yr=jn.className;return Be.createElement(_t,(0,_e.Z)({},fr,{prefixCls:vr,id:Fe,tabKey:xn,animated:Xn,active:Gn,style:(0,Se.Z)((0,Se.Z)({},An),tr),className:ve()(Bn,yr),ref:er}))})})))}var qe=se(74902),Rt=se(48555),Pt=se(59864);function En(Le,Fe,ze){var Ze=Be.useRef({});return(!("value"in Ze.current)||ze(Ze.current.condition,Fe))&&(Ze.current.value=Le(),Ze.current.condition=Fe),Ze.current.value}function tn(Le,Fe){typeof Le=="function"?Le(Fe):(0,Ee.Z)(Le)==="object"&&Le&&"current"in Le&&(Le.current=Fe)}function $n(){for(var Le=arguments.length,Fe=new Array(Le),ze=0;ze<Le;ze++)Fe[ze]=arguments[ze];var Ze=Fe.filter(function(et){return et});return Ze.length<=1?Ze[0]:function(et){Fe.forEach(function(lt){tn(lt,et)})}}function ur(){for(var Le=arguments.length,Fe=new Array(Le),ze=0;ze<Le;ze++)Fe[ze]=arguments[ze];return En(function(){return $n.apply(void 0,Fe)},Fe,function(Ze,et){return Ze.length===et.length&&Ze.every(function(lt,wt){return lt===et[wt]})})}function wr(Le){var Fe,ze,Ze=isMemo(Le)?Le.type.type:Le.type;return!(typeof Ze=="function"&&!((Fe=Ze.prototype)!==null&&Fe!==void 0&&Fe.render)||typeof Le=="function"&&!((ze=Le.prototype)!==null&&ze!==void 0&&ze.render))}var Je={width:0,height:0,left:0,top:0};function Ae(Le,Fe,ze){return(0,Be.useMemo)(function(){for(var Ze,et=new Map,lt=Fe.get((Ze=Le[0])===null||Ze===void 0?void 0:Ze.key)||Je,wt=lt.left+lt.width,Qt=0;Qt<Le.length;Qt+=1){var sn=Le[Qt].key,Xn=Fe.get(sn);if(!Xn){var vr;Xn=Fe.get((vr=Le[Qt-1])===null||vr===void 0?void 0:vr.key)||Je}var Zn=et.get(sn)||(0,Se.Z)({},Xn);Zn.right=wt-Zn.left-Zn.width,et.set(sn,Zn)}return et},[Le.map(function(Ze){return Ze.key}).join("_"),Fe,ze])}function Ht(Le,Fe){var ze=Be.useRef(Le),Ze=Be.useState({}),et=(0,me.Z)(Ze,2),lt=et[1];function wt(Qt){var sn=typeof Qt=="function"?Qt(ze.current):Qt;sn!==ze.current&&Fe(sn,ze.current),ze.current=sn,lt({})}return[ze.current,wt]}var Rn=.1,yn=.01,ot=20,nt=Math.pow(.995,ot);function Tt(Le,Fe){var ze=(0,Be.useState)(),Ze=(0,me.Z)(ze,2),et=Ze[0],lt=Ze[1],wt=(0,Be.useState)(0),Qt=(0,me.Z)(wt,2),sn=Qt[0],Xn=Qt[1],vr=(0,Be.useState)(0),Zn=(0,me.Z)(vr,2),xn=Zn[0],gn=Zn[1],An=(0,Be.useState)(),Bn=(0,me.Z)(An,2),fr=Bn[0],Gn=Bn[1],jn=(0,Be.useRef)();function er(ct){var Ft=ct.touches[0],un=Ft.screenX,vn=Ft.screenY;lt({x:un,y:vn}),window.clearInterval(jn.current)}function tr(ct){if(et){ct.preventDefault();var Ft=ct.touches[0],un=Ft.screenX,vn=Ft.screenY;lt({x:un,y:vn});var Nn=un-et.x,kn=vn-et.y;Fe(Nn,kn);var on=Date.now();Xn(on),gn(on-sn),Gn({x:Nn,y:kn})}}function yr(){if(et&&(lt(null),Gn(null),fr)){var ct=fr.x/xn,Ft=fr.y/xn,un=Math.abs(ct),vn=Math.abs(Ft);if(Math.max(un,vn)<Rn)return;var Nn=ct,kn=Ft;jn.current=window.setInterval(function(){if(Math.abs(Nn)<yn&&Math.abs(kn)<yn){window.clearInterval(jn.current);return}Nn*=nt,kn*=nt,Fe(Nn*ot,kn*ot)},ot)}}var Oe=(0,Be.useRef)();function Ke(ct){var Ft=ct.deltaX,un=ct.deltaY,vn=0,Nn=Math.abs(Ft),kn=Math.abs(un);Nn===kn?vn=Oe.current==="x"?Ft:un:Nn>kn?(vn=Ft,Oe.current="x"):(vn=un,Oe.current="y"),Fe(-vn,-vn)&&ct.preventDefault()}var Mt=(0,Be.useRef)(null);Mt.current={onTouchStart:er,onTouchMove:tr,onTouchEnd:yr,onWheel:Ke},Be.useEffect(function(){function ct(Nn){Mt.current.onTouchStart(Nn)}function Ft(Nn){Mt.current.onTouchMove(Nn)}function un(Nn){Mt.current.onTouchEnd(Nn)}function vn(Nn){Mt.current.onWheel(Nn)}return document.addEventListener("touchmove",Ft,{passive:!1}),document.addEventListener("touchend",un,{passive:!1}),Le.current.addEventListener("touchstart",ct,{passive:!1}),Le.current.addEventListener("wheel",vn),function(){document.removeEventListener("touchmove",Ft),document.removeEventListener("touchend",un)}},[])}function rn(Le){var Fe=(0,Be.useState)(0),ze=(0,me.Z)(Fe,2),Ze=ze[0],et=ze[1],lt=(0,Be.useRef)(0),wt=(0,Be.useRef)();return wt.current=Le,At(function(){var Qt;(Qt=wt.current)===null||Qt===void 0||Qt.call(wt)},[Ze]),function(){lt.current===Ze&&(lt.current+=1,et(lt.current))}}function dn(Le){var Fe=(0,Be.useRef)([]),ze=(0,Be.useState)({}),Ze=(0,me.Z)(ze,2),et=Ze[1],lt=(0,Be.useRef)(typeof Le=="function"?Le():Le),wt=rn(function(){var sn=lt.current;Fe.current.forEach(function(Xn){sn=Xn(sn)}),Fe.current=[],lt.current=sn,et({})});function Qt(sn){Fe.current.push(sn),wt()}return[lt.current,Qt]}var Ut={width:0,height:0,left:0,top:0,right:0};function Kt(Le,Fe,ze,Ze,et,lt,wt){var Qt=wt.tabs,sn=wt.tabPosition,Xn=wt.rtl,vr,Zn,xn;return["top","bottom"].includes(sn)?(vr="width",Zn=Xn?"right":"left",xn=Math.abs(ze)):(vr="height",Zn="top",xn=-ze),(0,Be.useMemo)(function(){if(!Qt.length)return[0,0];for(var gn=Qt.length,An=gn,Bn=0;Bn<gn;Bn+=1){var fr=Le.get(Qt[Bn].key)||Ut;if(fr[Zn]+fr[vr]>xn+Fe){An=Bn-1;break}}for(var Gn=0,jn=gn-1;jn>=0;jn-=1){var er=Le.get(Qt[jn].key)||Ut;if(er[Zn]<xn){Gn=jn+1;break}}return Gn>=An?[0,0]:[Gn,An]},[Le,Fe,Ze,et,lt,xn,sn,Qt.map(function(gn){return gn.key}).join("_"),Xn])}function bn(Le){var Fe;return Le instanceof Map?(Fe={},Le.forEach(function(ze,Ze){Fe[Ze]=ze})):Fe=Le,JSON.stringify(Fe)}var nn="TABS_DQ";function we(Le){return String(Le).replace(/"/g,nn)}function ue(Le,Fe,ze,Ze){return!(!ze||Ze||Le===!1||Le===void 0&&(Fe===!1||Fe===null))}function oe(Le,Fe){var ze=Le.prefixCls,Ze=Le.editable,et=Le.locale,lt=Le.style;return!Ze||Ze.showAdd===!1?null:Be.createElement("button",{ref:Fe,type:"button",className:"".concat(ze,"-nav-add"),style:lt,"aria-label":(et==null?void 0:et.addAriaLabel)||"Add tab",onClick:function(Qt){Ze.onEdit("add",{event:Qt})}},Ze.addIcon||"+")}var pe=Be.forwardRef(oe),fe=Be.forwardRef(function(Le,Fe){var ze=Le.position,Ze=Le.prefixCls,et=Le.extra;if(!et)return null;var lt,wt={};return(0,Ee.Z)(et)==="object"&&!Be.isValidElement(et)?wt=et:wt.right=et,ze==="right"&&(lt=wt.right),ze==="left"&&(lt=wt.left),lt?Be.createElement("div",{className:"".concat(Ze,"-extra-content"),ref:Fe},lt):null}),le=fe,Pe=se(62709);function Qe(Le,Fe,ze){var Ze=React.useRef({});return(!("value"in Ze.current)||ze(Ze.current.condition,Fe))&&(Ze.current.value=Le(),Ze.current.condition=Fe),Ze.current.value}function It(Le,Fe){typeof Le=="function"?Le(Fe):(0,Ee.Z)(Le)==="object"&&Le&&"current"in Le&&(Le.current=Fe)}function Nt(){for(var Le=arguments.length,Fe=new Array(Le),ze=0;ze<Le;ze++)Fe[ze]=arguments[ze];var Ze=Fe.filter(function(et){return et});return Ze.length<=1?Ze[0]:function(et){Fe.forEach(function(lt){It(lt,et)})}}function qt(){for(var Le=arguments.length,Fe=new Array(Le),ze=0;ze<Le;ze++)Fe[ze]=arguments[ze];return useMemo(function(){return Nt.apply(void 0,Fe)},Fe,function(Ze,et){return Ze.length===et.length&&Ze.every(function(lt,wt){return lt===et[wt]})})}function an(Le){var Fe,ze,Ze=(0,Pt.isMemo)(Le)?Le.type.type:Le.type;return!(typeof Ze=="function"&&!((Fe=Ze.prototype)!==null&&Fe!==void 0&&Fe.render)||typeof Le=="function"&&!((ze=Le.prototype)!==null&&ze!==void 0&&ze.render))}var jt={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(Fe){var ze=Fe.keyCode;if(Fe.altKey&&!Fe.ctrlKey||Fe.metaKey||ze>=jt.F1&&ze<=jt.F12)return!1;switch(ze){case jt.ALT:case jt.CAPS_LOCK:case jt.CONTEXT_MENU:case jt.CTRL:case jt.DOWN:case jt.END:case jt.ESC:case jt.HOME:case jt.INSERT:case jt.LEFT:case jt.MAC_FF_META:case jt.META:case jt.NUMLOCK:case jt.NUM_CENTER:case jt.PAGE_DOWN:case jt.PAGE_UP:case jt.PAUSE:case jt.PRINT_SCREEN:case jt.RIGHT:case jt.SHIFT:case jt.UP:case jt.WIN_KEY:case jt.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(Fe){if(Fe>=jt.ZERO&&Fe<=jt.NINE||Fe>=jt.NUM_ZERO&&Fe<=jt.NUM_MULTIPLY||Fe>=jt.A&&Fe<=jt.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&Fe===0)return!0;switch(Fe){case jt.SPACE:case jt.QUESTION_MARK:case jt.NUM_PLUS:case jt.NUM_MINUS:case jt.NUM_PERIOD:case jt.NUM_DIVISION:case jt.SEMICOLON:case jt.DASH:case jt.EQUALS:case jt.COMMA:case jt.PERIOD:case jt.SLASH:case jt.APOSTROPHE:case jt.SINGLE_QUOTE:case jt.OPEN_SQUARE_BRACKET:case jt.BACKSLASH:case jt.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},ir=jt,Cr=function(Fe){return+setTimeout(Fe,16)},Bt=function(Fe){return clearTimeout(Fe)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(Cr=function(Fe){return window.requestAnimationFrame(Fe)},Bt=function(Fe){return window.cancelAnimationFrame(Fe)});var Mn=0,Vn=new Map;function br(Le){Vn.delete(Le)}var at=function(Fe){var ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Mn+=1;var Ze=Mn;function et(lt){if(lt===0)br(Ze),Fe();else{var wt=Cr(function(){et(lt-1)});Vn.set(Ze,wt)}}return et(ze),Ze};at.cancel=function(Le){var Fe=Vn.get(Le);return br(Fe),Bt(Fe)};var $t=at,In=ir.ESC,Jn=ir.TAB;function ar(Le){var Fe=Le.visible,ze=Le.triggerRef,Ze=Le.onVisibleChange,et=Le.autoFocus,lt=Le.overlayRef,wt=Be.useRef(!1),Qt=function(){if(Fe){var Zn,xn;(Zn=ze.current)===null||Zn===void 0||(xn=Zn.focus)===null||xn===void 0||xn.call(Zn),Ze==null||Ze(!1)}},sn=function(){var Zn;return(Zn=lt.current)!==null&&Zn!==void 0&&Zn.focus?(lt.current.focus(),wt.current=!0,!0):!1},Xn=function(Zn){switch(Zn.keyCode){case In:Qt();break;case Jn:{var xn=!1;wt.current||(xn=sn()),xn?Zn.preventDefault():Qt();break}}};Be.useEffect(function(){return Fe?(window.addEventListener("keydown",Xn),et&&$t(sn,3),function(){window.removeEventListener("keydown",Xn),wt.current=!1}):function(){wt.current=!1}},[Fe])}var Mr=(0,Be.forwardRef)(function(Le,Fe){var ze=Le.overlay,Ze=Le.arrow,et=Le.prefixCls,lt=(0,Be.useMemo)(function(){var Qt;return typeof ze=="function"?Qt=ze():Qt=ze,Qt},[ze]),wt=Nt(Fe,lt==null?void 0:lt.ref);return Be.createElement(Be.Fragment,null,Ze&&Be.createElement("div",{className:"".concat(et,"-arrow")}),Be.cloneElement(lt,{ref:an(lt)?wt:void 0}))}),$r=Mr,Dr={adjustX:1,adjustY:1},Kr=[0,0],ni={topLeft:{points:["bl","tl"],overflow:Dr,offset:[0,-4],targetOffset:Kr},top:{points:["bc","tc"],overflow:Dr,offset:[0,-4],targetOffset:Kr},topRight:{points:["br","tr"],overflow:Dr,offset:[0,-4],targetOffset:Kr},bottomLeft:{points:["tl","bl"],overflow:Dr,offset:[0,4],targetOffset:Kr},bottom:{points:["tc","bc"],overflow:Dr,offset:[0,4],targetOffset:Kr},bottomRight:{points:["tr","br"],overflow:Dr,offset:[0,4],targetOffset:Kr}},hr=ni,mi=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function Ji(Le,Fe){var ze,Ze=Le.arrow,et=Ze===void 0?!1:Ze,lt=Le.prefixCls,wt=lt===void 0?"rc-dropdown":lt,Qt=Le.transitionName,sn=Le.animation,Xn=Le.align,vr=Le.placement,Zn=vr===void 0?"bottomLeft":vr,xn=Le.placements,gn=xn===void 0?hr:xn,An=Le.getPopupContainer,Bn=Le.showAction,fr=Le.hideAction,Gn=Le.overlayClassName,jn=Le.overlayStyle,er=Le.visible,tr=Le.trigger,yr=tr===void 0?["hover"]:tr,Oe=Le.autoFocus,Ke=Le.overlay,Mt=Le.children,ct=Le.onVisibleChange,Ft=(0,tt.Z)(Le,mi),un=Be.useState(),vn=(0,me.Z)(un,2),Nn=vn[0],kn=vn[1],on="visible"in Le?er:Nn,zn=Be.useRef(null),Wn=Be.useRef(null),xr=Be.useRef(null);Be.useImperativeHandle(Fe,function(){return zn.current});var Kn=function(Nr){kn(Nr),ct==null||ct(Nr)};ar({visible:on,triggerRef:xr,onVisibleChange:Kn,autoFocus:Oe,overlayRef:Wn});var Pr=function(Nr){var di=Le.onOverlayClick;kn(!1),di&&di(Nr)},Xr=function(){return Be.createElement($r,{ref:Wn,overlay:Ke,prefixCls:wt,arrow:et})},Rr=function(){return typeof Ke=="function"?Xr:Xr()},Ur=function(){var Nr=Le.minOverlayWidthMatchTrigger,di=Le.alignPoint;return"minOverlayWidthMatchTrigger"in Le?Nr:!di},Er=function(){var Nr=Le.openClassName;return Nr!==void 0?Nr:"".concat(wt,"-open")},Fr=Be.cloneElement(Mt,{className:ve()((ze=Mt.props)===null||ze===void 0?void 0:ze.className,on&&Er()),ref:an(Mt)?Nt(xr,Mt.ref):void 0}),Qr=fr;return!Qr&&yr.indexOf("contextMenu")!==-1&&(Qr=["click"]),Be.createElement(Pe.Z,(0,_e.Z)({builtinPlacements:gn},Ft,{prefixCls:wt,ref:zn,popupClassName:ve()(Gn,(0,ke.Z)({},"".concat(wt,"-show-arrow"),et)),popupStyle:jn,action:yr,showAction:Bn,hideAction:Qr,popupPlacement:Zn,popupAlign:Xn,popupTransitionName:Qt,popupAnimation:sn,popupVisible:on,stretch:Ur()?"minWidth":"",popup:Rr(),onPopupVisibleChange:Kn,onPopupClick:Pr,getPopupContainer:An}),Fr)}var Ui=Be.forwardRef(Ji),Vi=Ui,ui=se(78595),yt={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(Fe){var ze=Fe.keyCode;if(Fe.altKey&&!Fe.ctrlKey||Fe.metaKey||ze>=yt.F1&&ze<=yt.F12)return!1;switch(ze){case yt.ALT:case yt.CAPS_LOCK:case yt.CONTEXT_MENU:case yt.CTRL:case yt.DOWN:case yt.END:case yt.ESC:case yt.HOME:case yt.INSERT:case yt.LEFT:case yt.MAC_FF_META:case yt.META:case yt.NUMLOCK:case yt.NUM_CENTER:case yt.PAGE_DOWN:case yt.PAGE_UP:case yt.PAUSE:case yt.PRINT_SCREEN:case yt.RIGHT:case yt.SHIFT:case yt.UP:case yt.WIN_KEY:case yt.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(Fe){if(Fe>=yt.ZERO&&Fe<=yt.NINE||Fe>=yt.NUM_ZERO&&Fe<=yt.NUM_MULTIPLY||Fe>=yt.A&&Fe<=yt.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&Fe===0)return!0;switch(Fe){case yt.SPACE:case yt.QUESTION_MARK:case yt.NUM_PLUS:case yt.NUM_MINUS:case yt.NUM_PERIOD:case yt.NUM_DIVISION:case yt.SEMICOLON:case yt.DASH:case yt.EQUALS:case yt.COMMA:case yt.PERIOD:case yt.SLASH:case yt.APOSTROPHE:case yt.SINGLE_QUOTE:case yt.OPEN_SQUARE_BRACKET:case yt.BACKSLASH:case yt.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Cn=yt;function Ln(Le,Fe){var ze=Le.prefixCls,Ze=Le.id,et=Le.tabs,lt=Le.locale,wt=Le.mobile,Qt=Le.moreIcon,sn=Qt===void 0?"More":Qt,Xn=Le.moreTransitionName,vr=Le.style,Zn=Le.className,xn=Le.editable,gn=Le.tabBarGutter,An=Le.rtl,Bn=Le.removeAriaLabel,fr=Le.onTabClick,Gn=Le.getPopupContainer,jn=Le.popupClassName,er=(0,Be.useState)(!1),tr=(0,me.Z)(er,2),yr=tr[0],Oe=tr[1],Ke=(0,Be.useState)(null),Mt=(0,me.Z)(Ke,2),ct=Mt[0],Ft=Mt[1],un="".concat(Ze,"-more-popup"),vn="".concat(ze,"-dropdown"),Nn=ct!==null?"".concat(un,"-").concat(ct):null,kn=lt==null?void 0:lt.dropdownAriaLabel;function on(Rr,Ur){Rr.preventDefault(),Rr.stopPropagation(),xn.onEdit("remove",{key:Ur,event:Rr})}var zn=Be.createElement(ui.ZP,{onClick:function(Ur){var Er=Ur.key,Fr=Ur.domEvent;fr(Er,Fr),Oe(!1)},prefixCls:"".concat(vn,"-menu"),id:un,tabIndex:-1,role:"listbox","aria-activedescendant":Nn,selectedKeys:[ct],"aria-label":kn!==void 0?kn:"expanded dropdown"},et.map(function(Rr){var Ur=Rr.closable,Er=Rr.disabled,Fr=Rr.closeIcon,Qr=Rr.key,si=Rr.label,Nr=ue(Ur,Fr,xn,Er);return Be.createElement(ui.sN,{key:Qr,id:"".concat(un,"-").concat(Qr),role:"option","aria-controls":Ze&&"".concat(Ze,"-panel-").concat(Qr),disabled:Er},Be.createElement("span",null,si),Nr&&Be.createElement("button",{type:"button","aria-label":Bn||"remove",tabIndex:0,className:"".concat(vn,"-menu-item-remove"),onClick:function(Pi){Pi.stopPropagation(),on(Pi,Qr)}},Fr||xn.removeIcon||"\xD7"))}));function Wn(Rr){for(var Ur=et.filter(function(Nr){return!Nr.disabled}),Er=Ur.findIndex(function(Nr){return Nr.key===ct})||0,Fr=Ur.length,Qr=0;Qr<Fr;Qr+=1){Er=(Er+Rr+Fr)%Fr;var si=Ur[Er];if(!si.disabled){Ft(si.key);return}}}function xr(Rr){var Ur=Rr.which;if(!yr){[Cn.DOWN,Cn.SPACE,Cn.ENTER].includes(Ur)&&(Oe(!0),Rr.preventDefault());return}switch(Ur){case Cn.UP:Wn(-1),Rr.preventDefault();break;case Cn.DOWN:Wn(1),Rr.preventDefault();break;case Cn.ESC:Oe(!1);break;case Cn.SPACE:case Cn.ENTER:ct!==null&&fr(ct,Rr);break}}(0,Be.useEffect)(function(){var Rr=document.getElementById(Nn);Rr&&Rr.scrollIntoView&&Rr.scrollIntoView(!1)},[ct]),(0,Be.useEffect)(function(){yr||Ft(null)},[yr]);var Kn=(0,ke.Z)({},An?"marginRight":"marginLeft",gn);et.length||(Kn.visibility="hidden",Kn.order=1);var Pr=ve()((0,ke.Z)({},"".concat(vn,"-rtl"),An)),Xr=wt?null:Be.createElement(Vi,{prefixCls:vn,overlay:zn,trigger:["hover"],visible:et.length?yr:!1,transitionName:Xn,onVisibleChange:Oe,overlayClassName:ve()(Pr,jn),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:Gn},Be.createElement("button",{type:"button",className:"".concat(ze,"-nav-more"),style:Kn,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":un,id:"".concat(Ze,"-more"),"aria-expanded":yr,onKeyDown:xr},sn));return Be.createElement("div",{className:ve()("".concat(ze,"-nav-operations"),Zn),style:vr,ref:Fe},Xr,Be.createElement(pe,{prefixCls:ze,locale:lt,editable:xn}))}var Dn=Be.memo(Be.forwardRef(Ln),function(Le,Fe){return Fe.tabMoving});function sr(Le){var Fe,ze=Le.prefixCls,Ze=Le.id,et=Le.active,lt=Le.tab,wt=lt.key,Qt=lt.label,sn=lt.disabled,Xn=lt.closeIcon,vr=Le.closable,Zn=Le.renderWrapper,xn=Le.removeAriaLabel,gn=Le.editable,An=Le.onClick,Bn=Le.onFocus,fr=Le.style,Gn="".concat(ze,"-tab"),jn=ue(vr,Xn,gn,sn);function er(Oe){sn||An(Oe)}function tr(Oe){Oe.preventDefault(),Oe.stopPropagation(),gn.onEdit("remove",{key:wt,event:Oe})}var yr=Be.createElement("div",{key:wt,"data-node-key":we(wt),className:ve()(Gn,(Fe={},(0,ke.Z)(Fe,"".concat(Gn,"-with-remove"),jn),(0,ke.Z)(Fe,"".concat(Gn,"-active"),et),(0,ke.Z)(Fe,"".concat(Gn,"-disabled"),sn),Fe)),style:fr,onClick:er},Be.createElement("div",{role:"tab","aria-selected":et,id:Ze&&"".concat(Ze,"-tab-").concat(wt),className:"".concat(Gn,"-btn"),"aria-controls":Ze&&"".concat(Ze,"-panel-").concat(wt),"aria-disabled":sn,tabIndex:sn?null:0,onClick:function(Ke){Ke.stopPropagation(),er(Ke)},onKeyDown:function(Ke){[Cn.SPACE,Cn.ENTER].includes(Ke.which)&&(Ke.preventDefault(),er(Ke))},onFocus:Bn},Qt),jn&&Be.createElement("button",{type:"button","aria-label":xn||"remove",tabIndex:0,className:"".concat(Gn,"-remove"),onClick:function(Ke){Ke.stopPropagation(),tr(Ke)}},Xn||gn.removeIcon||"\xD7"));return Zn?Zn(yr):yr}var nr=sr,gr=function(Fe){return+setTimeout(Fe,16)},Fn=function(Fe){return clearTimeout(Fe)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(gr=function(Fe){return window.requestAnimationFrame(Fe)},Fn=function(Fe){return window.cancelAnimationFrame(Fe)});var Xe=0,ut=new Map;function Lt(Le){ut.delete(Le)}var Jt=function(Fe){var ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Xe+=1;var Ze=Xe;function et(lt){if(lt===0)Lt(Ze),Fe();else{var wt=gr(function(){et(lt-1)});ut.set(Ze,wt)}}return et(ze),Ze};Jt.cancel=function(Le){var Fe=ut.get(Le);return Lt(Fe),Fn(Fe)};var We=Jt,mt=function(Fe){var ze=Fe.activeTabOffset,Ze=Fe.horizontal,et=Fe.rtl,lt=Fe.indicatorSize,wt=(0,Be.useState)(),Qt=(0,me.Z)(wt,2),sn=Qt[0],Xn=Qt[1],vr=(0,Be.useRef)(),Zn=function(An){return typeof lt=="function"?lt(An):typeof lt=="number"?lt:An};function xn(){We.cancel(vr.current)}return(0,Be.useEffect)(function(){var gn={};return ze&&(Ze?(et?(gn.right=ze.right+ze.width/2,gn.transform="translateX(50%)"):(gn.left=ze.left+ze.width/2,gn.transform="translateX(-50%)"),gn.width=Zn(ze.width)):(gn.top=ze.top+ze.height/2,gn.transform="translateY(-50%)",gn.height=Zn(ze.height))),xn(),vr.current=We(function(){Xn(gn)}),xn},[ze,Ze,et,lt]),{style:sn}},zt=mt,Ot=function(Fe){var ze=Fe.current||{},Ze=ze.offsetWidth,et=Ze===void 0?0:Ze,lt=ze.offsetHeight,wt=lt===void 0?0:lt;return[et,wt]},Vt=function(Fe,ze){return Fe[ze?0:1]};function Yt(Le,Fe){var ze,Ze=Be.useContext(Ue),et=Ze.prefixCls,lt=Ze.tabs,wt=Le.className,Qt=Le.style,sn=Le.id,Xn=Le.animated,vr=Le.activeKey,Zn=Le.rtl,xn=Le.extra,gn=Le.editable,An=Le.locale,Bn=Le.tabPosition,fr=Le.tabBarGutter,Gn=Le.children,jn=Le.onTabClick,er=Le.onTabScroll,tr=Le.indicatorSize,yr=(0,Be.useRef)(),Oe=(0,Be.useRef)(),Ke=(0,Be.useRef)(),Mt=(0,Be.useRef)(),ct=(0,Be.useRef)(),Ft=(0,Be.useRef)(),un=(0,Be.useRef)(),vn=Bn==="top"||Bn==="bottom",Nn=Ht(0,function(ra,Oi){vn&&er&&er({direction:ra>Oi?"left":"right"})}),kn=(0,me.Z)(Nn,2),on=kn[0],zn=kn[1],Wn=Ht(0,function(ra,Oi){!vn&&er&&er({direction:ra>Oi?"top":"bottom"})}),xr=(0,me.Z)(Wn,2),Kn=xr[0],Pr=xr[1],Xr=(0,Be.useState)([0,0]),Rr=(0,me.Z)(Xr,2),Ur=Rr[0],Er=Rr[1],Fr=(0,Be.useState)([0,0]),Qr=(0,me.Z)(Fr,2),si=Qr[0],Nr=Qr[1],di=(0,Be.useState)([0,0]),Pi=(0,me.Z)(di,2),na=Pi[0],Gi=Pi[1],Ni=(0,Be.useState)([0,0]),qi=(0,me.Z)(Ni,2),Qi=qi[0],wi=qi[1],$i=dn(new Map),qr=(0,me.Z)($i,2),fi=qr[0],Ti=qr[1],Xi=Ae(lt,fi,si[0]),Na=Vt(Ur,vn),$a=Vt(si,vn),Aa=Vt(na,vn),ca=Vt(Qi,vn),ea=Na<$a+Aa,Ei=ea?Na-ca:Na-Aa,Oa="".concat(et,"-nav-operations-hidden"),ki=0,ei=0;vn&&Zn?(ki=0,ei=Math.max(0,$a-Ei)):(ki=Math.min(0,Ei-$a),ei=0);function zi(ra){return ra<ki?ki:ra>ei?ei:ra}var ua=(0,Be.useRef)(),Zi=(0,Be.useState)(),aa=(0,me.Z)(Zi,2),pi=aa[0],pa=aa[1];function xa(){pa(Date.now())}function fa(){window.clearTimeout(ua.current)}Tt(Mt,function(ra,Oi){function Ta(_a,co){_a(function(ao){var hs=zi(ao+co);return hs})}return ea?(vn?Ta(zn,ra):Ta(Pr,Oi),fa(),xa(),!0):!1}),(0,Be.useEffect)(function(){return fa(),pi&&(ua.current=window.setTimeout(function(){pa(0)},100)),fa},[pi]);var wa=Kt(Xi,Ei,vn?on:Kn,$a,Aa,ca,(0,Se.Z)((0,Se.Z)({},Le),{},{tabs:lt})),Ea=(0,me.Z)(wa,2),ja=Ea[0],ha=Ea[1],ka=dt(function(){var ra=arguments.length>0&&arguments[0]!==void 0?arguments[0]:vr,Oi=Xi.get(ra)||{width:0,height:0,left:0,right:0,top:0};if(vn){var Ta=on;Zn?Oi.right<on?Ta=Oi.right:Oi.right+Oi.width>on+Ei&&(Ta=Oi.right+Oi.width-Ei):Oi.left<-on?Ta=-Oi.left:Oi.left+Oi.width>-on+Ei&&(Ta=-(Oi.left+Oi.width-Ei)),Pr(0),zn(zi(Ta))}else{var _a=Kn;Oi.top<-Kn?_a=-Oi.top:Oi.top+Oi.height>-Kn+Ei&&(_a=-(Oi.top+Oi.height-Ei)),zn(0),Pr(zi(_a))}}),Ja={};Bn==="top"||Bn==="bottom"?Ja[Zn?"marginRight":"marginLeft"]=fr:Ja.marginTop=fr;var Ga=lt.map(function(ra,Oi){var Ta=ra.key;return Be.createElement(nr,{id:sn,prefixCls:et,key:Ta,tab:ra,style:Oi===0?void 0:Ja,closable:ra.closable,editable:gn,active:Ta===vr,renderWrapper:Gn,removeAriaLabel:An==null?void 0:An.removeAriaLabel,onClick:function(co){jn(Ta,co)},onFocus:function(){ka(Ta),xa(),Mt.current&&(Zn||(Mt.current.scrollLeft=0),Mt.current.scrollTop=0)}})}),so=function(){return Ti(function(){var Oi=new Map;return lt.forEach(function(Ta){var _a,co=Ta.key,ao=(_a=ct.current)===null||_a===void 0?void 0:_a.querySelector('[data-node-key="'.concat(we(co),'"]'));ao&&Oi.set(co,{width:ao.offsetWidth,height:ao.offsetHeight,left:ao.offsetLeft,top:ao.offsetTop})}),Oi})};(0,Be.useEffect)(function(){so()},[lt.map(function(ra){return ra.key}).join("_")]);var Fa=rn(function(){var ra=Ot(yr),Oi=Ot(Oe),Ta=Ot(Ke);Er([ra[0]-Oi[0]-Ta[0],ra[1]-Oi[1]-Ta[1]]);var _a=Ot(un);Gi(_a);var co=Ot(Ft);wi(co);var ao=Ot(ct);Nr([ao[0]-_a[0],ao[1]-_a[1]]),so()}),Ca=lt.slice(0,ja),_i=lt.slice(ha+1),Ki=[].concat((0,qe.Z)(Ca),(0,qe.Z)(_i)),da=Xi.get(vr),Sa=zt({activeTabOffset:da,horizontal:vn,rtl:Zn,indicatorSize:tr}),Ka=Sa.style;(0,Be.useEffect)(function(){ka()},[vr,ki,ei,bn(da),bn(Xi),vn]),(0,Be.useEffect)(function(){Fa()},[Zn]);var io=!!Ki.length,ho="".concat(et,"-nav-wrap"),Oo,Bo,lo,Ao;return vn?Zn?(Bo=on>0,Oo=on!==ei):(Oo=on<0,Bo=on!==ki):(lo=Kn<0,Ao=Kn!==ki),Be.createElement(Rt.Z,{onResize:Fa},Be.createElement("div",{ref:ur(Fe,yr),role:"tablist",className:ve()("".concat(et,"-nav"),wt),style:Qt,onKeyDown:function(){xa()}},Be.createElement(le,{ref:Oe,position:"left",extra:xn,prefixCls:et}),Be.createElement(Rt.Z,{onResize:Fa},Be.createElement("div",{className:ve()(ho,(ze={},(0,ke.Z)(ze,"".concat(ho,"-ping-left"),Oo),(0,ke.Z)(ze,"".concat(ho,"-ping-right"),Bo),(0,ke.Z)(ze,"".concat(ho,"-ping-top"),lo),(0,ke.Z)(ze,"".concat(ho,"-ping-bottom"),Ao),ze)),ref:Mt},Be.createElement(Rt.Z,{onResize:Fa},Be.createElement("div",{ref:ct,className:"".concat(et,"-nav-list"),style:{transform:"translate(".concat(on,"px, ").concat(Kn,"px)"),transition:pi?"none":void 0}},Ga,Be.createElement(pe,{ref:un,prefixCls:et,locale:An,editable:gn,style:(0,Se.Z)((0,Se.Z)({},Ga.length===0?void 0:Ja),{},{visibility:io?"hidden":null})}),Be.createElement("div",{className:ve()("".concat(et,"-ink-bar"),(0,ke.Z)({},"".concat(et,"-ink-bar-animated"),Xn.inkBar)),style:Ka}))))),Be.createElement(Dn,(0,_e.Z)({},Le,{removeAriaLabel:An==null?void 0:An.removeAriaLabel,ref:Ft,prefixCls:et,tabs:Ki,className:!io&&Oa,tabMoving:!!pi})),Be.createElement(le,{ref:Ke,position:"right",extra:xn,prefixCls:et})))}var Hn=Be.forwardRef(Yt),_r=["renderTabBar"],Qn=["label","key"];function qn(Le){var Fe=Le.renderTabBar,ze=(0,tt.Z)(Le,_r),Ze=Be.useContext(Ue),et=Ze.tabs;if(Fe){var lt=(0,Se.Z)((0,Se.Z)({},ze),{},{panes:et.map(function(wt){var Qt=wt.label,sn=wt.key,Xn=(0,tt.Z)(wt,Qn);return Be.createElement(_t,(0,_e.Z)({tab:Qt,key:sn,tabKey:sn},Xn))})});return Fe(lt,Hn)}return Be.createElement(Hn,ze)}var or={},lr=[],ht=function(Fe){lr.push(Fe)};function st(Le,Fe){if(0)var ze}function bt(Le,Fe){if(0)var ze}function ln(){or={}}function Pn(Le,Fe,ze){!Fe&&!or[ze]&&(Le(!1,ze),or[ze]=!0)}function cn(Le,Fe){Pn(st,Le,Fe)}function pn(Le,Fe){Pn(bt,Le,Fe)}cn.preMessage=ht,cn.resetWarned=ln,cn.noteOnce=pn;var mn=null;function On(){var Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},Fe;return Le===!1?Fe={inkBar:!1,tabPane:!1}:Le===!0?Fe={inkBar:!0,tabPane:!1}:Fe=(0,Se.Z)({inkBar:!0},(0,Ee.Z)(Le)==="object"?Le:{}),Fe.tabPaneMotion&&Fe.tabPane===void 0&&(Fe.tabPane=!0),!Fe.tabPaneMotion&&Fe.tabPane&&(Fe.tabPane=!1),Fe}var cr=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicatorSize"],Gt=0;function Jr(Le,Fe){var ze,Ze=Le.id,et=Le.prefixCls,lt=et===void 0?"rc-tabs":et,wt=Le.className,Qt=Le.items,sn=Le.direction,Xn=Le.activeKey,vr=Le.defaultActiveKey,Zn=Le.editable,xn=Le.animated,gn=Le.tabPosition,An=gn===void 0?"top":gn,Bn=Le.tabBarGutter,fr=Le.tabBarStyle,Gn=Le.tabBarExtraContent,jn=Le.locale,er=Le.moreIcon,tr=Le.moreTransitionName,yr=Le.destroyInactiveTabPane,Oe=Le.renderTabBar,Ke=Le.onChange,Mt=Le.onTabClick,ct=Le.onTabScroll,Ft=Le.getPopupContainer,un=Le.popupClassName,vn=Le.indicatorSize,Nn=(0,tt.Z)(Le,cr),kn=Be.useMemo(function(){return(Qt||[]).filter(function(wi){return wi&&(0,Ee.Z)(wi)==="object"&&"key"in wi})},[Qt]),on=sn==="rtl",zn=On(xn),Wn=(0,Be.useState)(!1),xr=(0,me.Z)(Wn,2),Kn=xr[0],Pr=xr[1];(0,Be.useEffect)(function(){Pr(St())},[]);var Xr=Ie(function(){var wi;return(wi=kn[0])===null||wi===void 0?void 0:wi.key},{value:Xn,defaultValue:vr}),Rr=(0,me.Z)(Xr,2),Ur=Rr[0],Er=Rr[1],Fr=(0,Be.useState)(function(){return kn.findIndex(function(wi){return wi.key===Ur})}),Qr=(0,me.Z)(Fr,2),si=Qr[0],Nr=Qr[1];(0,Be.useEffect)(function(){var wi=kn.findIndex(function(qr){return qr.key===Ur});if(wi===-1){var $i;wi=Math.max(0,Math.min(si,kn.length-1)),Er(($i=kn[wi])===null||$i===void 0?void 0:$i.key)}Nr(wi)},[kn.map(function(wi){return wi.key}).join("_"),Ur,si]);var di=Ie(null,{value:Ze}),Pi=(0,me.Z)(di,2),na=Pi[0],Gi=Pi[1];(0,Be.useEffect)(function(){Ze||(Gi("rc-tabs-".concat(Gt)),Gt+=1)},[]);function Ni(wi,$i){Mt==null||Mt(wi,$i);var qr=wi!==Ur;Er(wi),qr&&(Ke==null||Ke(wi))}var qi={id:na,activeKey:Ur,animated:zn,tabPosition:An,rtl:on,mobile:Kn},Qi=(0,Se.Z)((0,Se.Z)({},qi),{},{editable:Zn,locale:jn,moreIcon:er,moreTransitionName:tr,tabBarGutter:Bn,onTabClick:Ni,onTabScroll:ct,extra:Gn,style:fr,panes:null,getPopupContainer:Ft,popupClassName:un,indicatorSize:vn});return Be.createElement(Ue.Provider,{value:{tabs:kn,prefixCls:lt}},Be.createElement("div",(0,_e.Z)({ref:Fe,id:Ze,className:ve()(lt,"".concat(lt,"-").concat(An),(ze={},(0,ke.Z)(ze,"".concat(lt,"-mobile"),Kn),(0,ke.Z)(ze,"".concat(lt,"-editable"),Zn),(0,ke.Z)(ze,"".concat(lt,"-rtl"),on),ze),wt)},Nn),Be.createElement(qn,(0,_e.Z)({},Qi,{renderTabBar:Oe})),Be.createElement(Dt,(0,_e.Z)({destroyInactiveTabPane:yr},qi,{animated:zn}))))}var Zr=Be.forwardRef(Jr),Bi=Zr,Li=Bi,gi=se(53124),Yi=se(98675),oi=()=>null,Ri=se(33603);const ji={motionAppear:!1,motionEnter:!0,motionLeave:!0};function Yr(Le){let Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},ze;return Fe===!1?ze={inkBar:!1,tabPane:!1}:Fe===!0?ze={inkBar:!0,tabPane:!0}:ze=Object.assign({inkBar:!0},typeof Fe=="object"?Fe:{}),ze.tabPane&&(ze.tabPaneMotion=Object.assign(Object.assign({},ji),{motionName:(0,Ri.m)(Le,"switch")})),ze}var vi=se(37419),Wi=function(Le,Fe){var ze={};for(var Ze in Le)Object.prototype.hasOwnProperty.call(Le,Ze)&&Fe.indexOf(Ze)<0&&(ze[Ze]=Le[Ze]);if(Le!=null&&typeof Object.getOwnPropertySymbols=="function")for(var et=0,Ze=Object.getOwnPropertySymbols(Le);et<Ze.length;et++)Fe.indexOf(Ze[et])<0&&Object.prototype.propertyIsEnumerable.call(Le,Ze[et])&&(ze[Ze[et]]=Le[Ze[et]]);return ze};function la(Le){return Le.filter(Fe=>Fe)}function ta(Le,Fe){if(Le)return Le;const ze=(0,vi.Z)(Fe).map(Ze=>{if(Be.isValidElement(Ze)){const{key:et,props:lt}=Ze,wt=lt||{},{tab:Qt}=wt,sn=Wi(wt,["tab"]);return Object.assign(Object.assign({key:String(et)},sn),{label:Qt})}return null});return la(ze)}var ri=se(14747),xt=se(67968),vt=se(45503),Zt=se(67771),Tn=Le=>{const{componentCls:Fe,motionDurationSlow:ze}=Le;return[{[Fe]:{[`${Fe}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${ze}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${ze}`}}}}},[(0,Zt.oN)(Le,"slide-up"),(0,Zt.oN)(Le,"slide-down")]]};const pr=Le=>{const{componentCls:Fe,tabsCardPadding:ze,cardBg:Ze,cardGutter:et,colorBorderSecondary:lt,itemSelectedColor:wt}=Le;return{[`${Fe}-card`]:{[`> ${Fe}-nav, > div > ${Fe}-nav`]:{[`${Fe}-tab`]:{margin:0,padding:ze,background:Ze,border:`${Le.lineWidth}px ${Le.lineType} ${lt}`,transition:`all ${Le.motionDurationSlow} ${Le.motionEaseInOut}`},[`${Fe}-tab-active`]:{color:wt,background:Le.colorBgContainer},[`${Fe}-ink-bar`]:{visibility:"hidden"}},[`&${Fe}-top, &${Fe}-bottom`]:{[`> ${Fe}-nav, > div > ${Fe}-nav`]:{[`${Fe}-tab + ${Fe}-tab`]:{marginLeft:{_skip_check_:!0,value:`${et}px`}}}},[`&${Fe}-top`]:{[`> ${Fe}-nav, > div > ${Fe}-nav`]:{[`${Fe}-tab`]:{borderRadius:`${Le.borderRadiusLG}px ${Le.borderRadiusLG}px 0 0`},[`${Fe}-tab-active`]:{borderBottomColor:Le.colorBgContainer}}},[`&${Fe}-bottom`]:{[`> ${Fe}-nav, > div > ${Fe}-nav`]:{[`${Fe}-tab`]:{borderRadius:`0 0 ${Le.borderRadiusLG}px ${Le.borderRadiusLG}px`},[`${Fe}-tab-active`]:{borderTopColor:Le.colorBgContainer}}},[`&${Fe}-left, &${Fe}-right`]:{[`> ${Fe}-nav, > div > ${Fe}-nav`]:{[`${Fe}-tab + ${Fe}-tab`]:{marginTop:`${et}px`}}},[`&${Fe}-left`]:{[`> ${Fe}-nav, > div > ${Fe}-nav`]:{[`${Fe}-tab`]:{borderRadius:{_skip_check_:!0,value:`${Le.borderRadiusLG}px 0 0 ${Le.borderRadiusLG}px`}},[`${Fe}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:Le.colorBgContainer}}}},[`&${Fe}-right`]:{[`> ${Fe}-nav, > div > ${Fe}-nav`]:{[`${Fe}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${Le.borderRadiusLG}px ${Le.borderRadiusLG}px 0`}},[`${Fe}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:Le.colorBgContainer}}}}}}},Ar=Le=>{const{componentCls:Fe,itemHoverColor:ze,dropdownEdgeChildVerticalPadding:Ze}=Le;return{[`${Fe}-dropdown`]:Object.assign(Object.assign({},(0,ri.Wf)(Le)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:Le.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${Fe}-dropdown-menu`]:{maxHeight:Le.tabsDropdownHeight,margin:0,padding:`${Ze}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({},ri.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:ze}},"&:hover":{background:Le.controlItemBgHover},"&-disabled":{"&, &:hover":{color:Le.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},Wr=Le=>{const{componentCls:Fe,margin:ze,colorBorderSecondary:Ze,horizontalMargin:et,verticalItemPadding:lt,verticalItemMargin:wt}=Le;return{[`${Fe}-top, ${Fe}-bottom`]:{flexDirection:"column",[`> ${Fe}-nav, > div > ${Fe}-nav`]:{margin:et,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${Le.lineWidth}px ${Le.lineType} ${Ze}`,content:"''"},[`${Fe}-ink-bar`]:{height:Le.lineWidthBold,"&-animated":{transition:`width ${Le.motionDurationSlow}, left ${Le.motionDurationSlow},
right ${Le.motionDurationSlow}`}},[`${Fe}-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},[`&${Fe}-nav-wrap-ping-left::before`]:{opacity:1},[`&${Fe}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${Fe}-top`]:{[`> ${Fe}-nav,
> div > ${Fe}-nav`]:{"&::before":{bottom:0},[`${Fe}-ink-bar`]:{bottom:0}}},[`${Fe}-bottom`]:{[`> ${Fe}-nav, > div > ${Fe}-nav`]:{order:1,marginTop:`${ze}px`,marginBottom:0,"&::before":{top:0},[`${Fe}-ink-bar`]:{top:0}},[`> ${Fe}-content-holder, > div > ${Fe}-content-holder`]:{order:0}},[`${Fe}-left, ${Fe}-right`]:{[`> ${Fe}-nav, > div > ${Fe}-nav`]:{flexDirection:"column",minWidth:Le.controlHeight*1.25,[`${Fe}-tab`]:{padding:lt,textAlign:"center"},[`${Fe}-tab + ${Fe}-tab`]:{margin:wt},[`${Fe}-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},[`&${Fe}-nav-wrap-ping-top::before`]:{opacity:1},[`&${Fe}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${Fe}-ink-bar`]:{width:Le.lineWidthBold,"&-animated":{transition:`height ${Le.motionDurationSlow}, top ${Le.motionDurationSlow}`}},[`${Fe}-nav-list, ${Fe}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${Fe}-left`]:{[`> ${Fe}-nav, > div > ${Fe}-nav`]:{[`${Fe}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${Fe}-content-holder, > div > ${Fe}-content-holder`]:{marginLeft:{_skip_check_:!0,value:`-${Le.lineWidth}px`},borderLeft:{_skip_check_:!0,value:`${Le.lineWidth}px ${Le.lineType} ${Le.colorBorder}`},[`> ${Fe}-content > ${Fe}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:Le.paddingLG}}}},[`${Fe}-right`]:{[`> ${Fe}-nav, > div > ${Fe}-nav`]:{order:1,[`${Fe}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${Fe}-content-holder, > div > ${Fe}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:-Le.lineWidth},borderRight:{_skip_check_:!0,value:`${Le.lineWidth}px ${Le.lineType} ${Le.colorBorder}`},[`> ${Fe}-content > ${Fe}-tabpane`]:{paddingRight:{_skip_check_:!0,value:Le.paddingLG}}}}}},Vr=Le=>{const{componentCls:Fe,cardPaddingSM:ze,cardPaddingLG:Ze,horizontalItemPaddingSM:et,horizontalItemPaddingLG:lt}=Le;return{[Fe]:{"&-small":{[`> ${Fe}-nav`]:{[`${Fe}-tab`]:{padding:et,fontSize:Le.titleFontSizeSM}}},"&-large":{[`> ${Fe}-nav`]:{[`${Fe}-tab`]:{padding:lt,fontSize:Le.titleFontSizeLG}}}},[`${Fe}-card`]:{[`&${Fe}-small`]:{[`> ${Fe}-nav`]:{[`${Fe}-tab`]:{padding:ze}},[`&${Fe}-bottom`]:{[`> ${Fe}-nav ${Fe}-tab`]:{borderRadius:`0 0 ${Le.borderRadius}px ${Le.borderRadius}px`}},[`&${Fe}-top`]:{[`> ${Fe}-nav ${Fe}-tab`]:{borderRadius:`${Le.borderRadius}px ${Le.borderRadius}px 0 0`}},[`&${Fe}-right`]:{[`> ${Fe}-nav ${Fe}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${Le.borderRadius}px ${Le.borderRadius}px 0`}}},[`&${Fe}-left`]:{[`> ${Fe}-nav ${Fe}-tab`]:{borderRadius:{_skip_check_:!0,value:`${Le.borderRadius}px 0 0 ${Le.borderRadius}px`}}}},[`&${Fe}-large`]:{[`> ${Fe}-nav`]:{[`${Fe}-tab`]:{padding:Ze}}}}}},Hr=Le=>{const{componentCls:Fe,itemActiveColor:ze,itemHoverColor:Ze,iconCls:et,tabsHorizontalItemMargin:lt,horizontalItemPadding:wt,itemSelectedColor:Qt,itemColor:sn}=Le,Xn=`${Fe}-tab`;return{[Xn]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:wt,fontSize:Le.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:sn,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:ze}},(0,ri.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:Ze},[`&${Xn}-active ${Xn}-btn`]:{color:Qt,textShadow:Le.tabsActiveTextShadow},[`&${Xn}-disabled`]:{color:Le.colorTextDisabled,cursor:"not-allowed"},[`&${Xn}-disabled ${Xn}-btn, &${Xn}-disabled ${Fe}-remove`]:{"&:focus, &:active":{color:Le.colorTextDisabled}},[`& ${Xn}-remove ${et}`]:{margin:0},[et]:{marginRight:{_skip_check_:!0,value:Le.marginSM}}},[`${Xn} + ${Xn}`]:{margin:{_skip_check_:!0,value:lt}}}},ti=Le=>{const{componentCls:Fe,tabsHorizontalItemMarginRTL:ze,iconCls:Ze,cardGutter:et}=Le;return{[`${Fe}-rtl`]:{direction:"rtl",[`${Fe}-nav`]:{[`${Fe}-tab`]:{margin:{_skip_check_:!0,value:ze},[`${Fe}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[Ze]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:`${Le.marginSM}px`}},[`${Fe}-tab-remove`]:{marginRight:{_skip_check_:!0,value:`${Le.marginXS}px`},marginLeft:{_skip_check_:!0,value:`-${Le.marginXXS}px`},[Ze]:{margin:0}}}},[`&${Fe}-left`]:{[`> ${Fe}-nav`]:{order:1},[`> ${Fe}-content-holder`]:{order:0}},[`&${Fe}-right`]:{[`> ${Fe}-nav`]:{order:0},[`> ${Fe}-content-holder`]:{order:1}},[`&${Fe}-card${Fe}-top, &${Fe}-card${Fe}-bottom`]:{[`> ${Fe}-nav, > div > ${Fe}-nav`]:{[`${Fe}-tab + ${Fe}-tab`]:{marginRight:{_skip_check_:!0,value:et},marginLeft:{_skip_check_:!0,value:0}}}}},[`${Fe}-dropdown-rtl`]:{direction:"rtl"},[`${Fe}-menu-item`]:{[`${Fe}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},yi=Le=>{const{componentCls:Fe,tabsCardPadding:ze,cardHeight:Ze,cardGutter:et,itemHoverColor:lt,itemActiveColor:wt,colorBorderSecondary:Qt}=Le;return{[Fe]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,ri.Wf)(Le)),{display:"flex",[`> ${Fe}-nav, > div > ${Fe}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${Fe}-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"}},[`${Fe}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${Le.motionDurationSlow}`},[`${Fe}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${Fe}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${Fe}-nav-more`]:{position:"relative",padding:ze,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:"''"}},[`${Fe}-nav-add`]:Object.assign({minWidth:Ze,marginLeft:{_skip_check_:!0,value:et},padding:`0 ${Le.paddingXS}px`,background:"transparent",border:`${Le.lineWidth}px ${Le.lineType} ${Qt}`,borderRadius:`${Le.borderRadiusLG}px ${Le.borderRadiusLG}px 0 0`,outline:"none",cursor:"pointer",color:Le.colorText,transition:`all ${Le.motionDurationSlow} ${Le.motionEaseInOut}`,"&:hover":{color:lt},"&:active, &:focus:not(:focus-visible)":{color:wt}},(0,ri.Qy)(Le))},[`${Fe}-extra-content`]:{flex:"none"},[`${Fe}-ink-bar`]:{position:"absolute",background:Le.inkBarColor,pointerEvents:"none"}}),Hr(Le)),{[`${Fe}-content`]:{position:"relative",width:"100%"},[`${Fe}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${Fe}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${Fe}-centered`]:{[`> ${Fe}-nav, > div > ${Fe}-nav`]:{[`${Fe}-nav-wrap`]:{[`&:not([class*='${Fe}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}};var Lr=(0,xt.Z)("Tabs",Le=>{const Fe=(0,vt.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[Vr(Fe),ti(Fe),Wr(Fe),Ar(Fe),pr(Fe),yi(Fe),Tn(Fe)]},Le=>{const Fe=Le.controlHeightLG;return{zIndexPopup:Le.zIndexPopupBase+50,cardBg:Le.colorFillAlter,cardHeight:Fe,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}}),hi=function(Le,Fe){var ze={};for(var Ze in Le)Object.prototype.hasOwnProperty.call(Le,Ze)&&Fe.indexOf(Ze)<0&&(ze[Ze]=Le[Ze]);if(Le!=null&&typeof Object.getOwnPropertySymbols=="function")for(var et=0,Ze=Object.getOwnPropertySymbols(Le);et<Ze.length;et++)Fe.indexOf(Ze[et])<0&&Object.prototype.propertyIsEnumerable.call(Le,Ze[et])&&(ze[Ze[et]]=Le[Ze[et]]);return ze};const Ai=Le=>{const{type:Fe,className:ze,rootClassName:Ze,size:et,onEdit:lt,hideAdd:wt,centered:Qt,addIcon:sn,popupClassName:Xn,children:vr,items:Zn,animated:xn,style:gn,indicatorSize:An}=Le,Bn=hi(Le,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize"]),{prefixCls:fr,moreIcon:Gn=Be.createElement(He.Z,null)}=Bn,{direction:jn,tabs:er,getPrefixCls:tr,getPopupContainer:yr}=Be.useContext(gi.E_),Oe=tr("tabs",fr),[Ke,Mt]=Lr(Oe);let ct;Fe==="editable-card"&&(ct={onEdit:(on,zn)=>{let{key:Wn,event:xr}=zn;lt==null||lt(on==="add"?xr:Wn,on)},removeIcon:Be.createElement(he.Z,null),addIcon:sn||Be.createElement(Re.Z,null),showAdd:wt!==!0});const Ft=tr(),un=ta(Zn,vr),vn=Yr(Oe,xn),Nn=(0,Yi.Z)(et),kn=Object.assign(Object.assign({},er==null?void 0:er.style),gn);return Ke(Be.createElement(Li,Object.assign({direction:jn,getPopupContainer:yr,moreTransitionName:`${Ft}-slide-up`},Bn,{items:un,className:ve()({[`${Oe}-${Nn}`]:Nn,[`${Oe}-card`]:["card","editable-card"].includes(Fe),[`${Oe}-editable-card`]:Fe==="editable-card",[`${Oe}-centered`]:Qt},er==null?void 0:er.className,ze,Ze,Mt),popupClassName:ve()(Xn,Mt),style:kn,editable:ct,moreIcon:Gn,prefixCls:Oe,animated:vn,indicatorSize:An!=null?An:er==null?void 0:er.indicatorSize})))};Ai.TabPane=oi;var Mi=Ai},59810:function(Sn,Wt,se){"use strict";se.d(Wt,{default:function(){return lr}});var he=se(67294),He=se(74902),Re=se(94184),Ve=se.n(Re),ve=se(87462),_e=se(15671),ke=se(43144),Se=se(60136),me=se(51630),Ee=se(4942),tt=se(45987),Be=se(74165),St=se(71002),dt=se(15861),it=se(64217);function Ge(ht,st){var bt="cannot ".concat(ht.method," ").concat(ht.action," ").concat(st.status,"'"),ln=new Error(bt);return ln.status=st.status,ln.method=ht.method,ln.url=ht.action,ln}function De(ht){var st=ht.responseText||ht.response;if(!st)return st;try{return JSON.parse(st)}catch(bt){return st}}function At(ht){var st=new XMLHttpRequest;ht.onProgress&&st.upload&&(st.upload.onprogress=function(cn){cn.total>0&&(cn.percent=cn.loaded/cn.total*100),ht.onProgress(cn)});var bt=new FormData;ht.data&&Object.keys(ht.data).forEach(function(Pn){var cn=ht.data[Pn];if(Array.isArray(cn)){cn.forEach(function(pn){bt.append("".concat(Pn,"[]"),pn)});return}bt.append(Pn,cn)}),ht.file instanceof Blob?bt.append(ht.filename,ht.file,ht.file.name):bt.append(ht.filename,ht.file),st.onerror=function(cn){ht.onError(cn)},st.onload=function(){return st.status<200||st.status>=300?ht.onError(Ge(ht,st),De(st)):ht.onSuccess(De(st),st)},st.open(ht.method,ht.action,!0),ht.withCredentials&&"withCredentials"in st&&(st.withCredentials=!0);var ln=ht.headers||{};return ln["X-Requested-With"]!==null&&st.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(ln).forEach(function(Pn){ln[Pn]!==null&&st.setRequestHeader(Pn,ln[Pn])}),st.send(bt),{abort:function(){st.abort()}}}var Xt=+new Date,rt=0;function ft(){return"rc-upload-".concat(Xt,"-").concat(++rt)}var Ie=se(80334),xe=function(ht,st){if(ht&&st){var bt=Array.isArray(st)?st:st.split(","),ln=ht.name||"",Pn=ht.type||"",cn=Pn.replace(/\/.*$/,"");return bt.some(function(pn){var mn=pn.trim();if(/^\*(\/\*)?$/.test(pn))return!0;if(mn.charAt(0)==="."){var On=ln.toLowerCase(),cr=mn.toLowerCase(),Gt=[cr];return(cr===".jpg"||cr===".jpeg")&&(Gt=[".jpg",".jpeg"]),Gt.some(function(Jr){return On.endsWith(Jr)})}return/\/\*$/.test(mn)?cn===mn.replace(/\/.*$/,""):Pn===mn?!0:/^\w+$/.test(mn)?((0,Ie.ZP)(!1,"Upload takes an invalidate 'accept' type '".concat(mn,"'.Skip for check.")),!0):!1})}return!0};function Ue(ht,st){var bt=ht.createReader(),ln=[];function Pn(){bt.readEntries(function(cn){var pn=Array.prototype.slice.apply(cn);ln=ln.concat(pn);var mn=!pn.length;mn?st(ln):Pn()})}Pn()}var je=function(st,bt,ln){var Pn=function cn(pn,mn){pn&&(pn.path=mn||"",pn.isFile?pn.file(function(On){ln(On)&&(pn.fullPath&&!On.webkitRelativePath&&(Object.defineProperties(On,{webkitRelativePath:{writable:!0}}),On.webkitRelativePath=pn.fullPath.replace(/^\//,""),Object.defineProperties(On,{webkitRelativePath:{writable:!1}})),bt([On]))}):pn.isDirectory&&Ue(pn,function(On){On.forEach(function(cr){cn(cr,"".concat(mn).concat(pn.name,"/"))})}))};st.forEach(function(cn){Pn(cn.webkitGetAsEntry())})},_t=je,Ct=["component","prefixCls","className","disabled","id","style","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"],Dt=function(ht){(0,Se.Z)(bt,ht);var st=(0,me.Z)(bt);function bt(){var ln;(0,_e.Z)(this,bt);for(var Pn=arguments.length,cn=new Array(Pn),pn=0;pn<Pn;pn++)cn[pn]=arguments[pn];return ln=st.call.apply(st,[this].concat(cn)),ln.state={uid:ft()},ln.reqs={},ln.fileInput=void 0,ln._isMounted=void 0,ln.onChange=function(mn){var On=ln.props,cr=On.accept,Gt=On.directory,Jr=mn.target.files,Zr=(0,He.Z)(Jr).filter(function(Bi){return!Gt||xe(Bi,cr)});ln.uploadFiles(Zr),ln.reset()},ln.onClick=function(mn){var On=ln.fileInput;if(On){var cr=ln.props,Gt=cr.children,Jr=cr.onClick;if(Gt&&Gt.type==="button"){var Zr=On.parentNode;Zr.focus(),Zr.querySelector("button").blur()}On.click(),Jr&&Jr(mn)}},ln.onKeyDown=function(mn){mn.key==="Enter"&&ln.onClick(mn)},ln.onFileDrop=function(mn){var On=ln.props.multiple;if(mn.preventDefault(),mn.type!=="dragover")if(ln.props.directory)_t(Array.prototype.slice.call(mn.dataTransfer.items),ln.uploadFiles,function(Gt){return xe(Gt,ln.props.accept)});else{var cr=(0,He.Z)(mn.dataTransfer.files).filter(function(Gt){return xe(Gt,ln.props.accept)});On===!1&&(cr=cr.slice(0,1)),ln.uploadFiles(cr)}},ln.uploadFiles=function(mn){var On=(0,He.Z)(mn),cr=On.map(function(Gt){return Gt.uid=ft(),ln.processFile(Gt,On)});Promise.all(cr).then(function(Gt){var Jr=ln.props.onBatchStart;Jr==null||Jr(Gt.map(function(Zr){var Bi=Zr.origin,Li=Zr.parsedFile;return{file:Bi,parsedFile:Li}})),Gt.filter(function(Zr){return Zr.parsedFile!==null}).forEach(function(Zr){ln.post(Zr)})})},ln.processFile=function(){var mn=(0,dt.Z)((0,Be.Z)().mark(function On(cr,Gt){var Jr,Zr,Bi,Li,gi,Yi,xi,oi,Ri;return(0,Be.Z)().wrap(function(Yr){for(;;)switch(Yr.prev=Yr.next){case 0:if(Jr=ln.props.beforeUpload,Zr=cr,!Jr){Yr.next=14;break}return Yr.prev=3,Yr.next=6,Jr(cr,Gt);case 6:Zr=Yr.sent,Yr.next=12;break;case 9:Yr.prev=9,Yr.t0=Yr.catch(3),Zr=!1;case 12:if(Zr!==!1){Yr.next=14;break}return Yr.abrupt("return",{origin:cr,parsedFile:null,action:null,data:null});case 14:if(Bi=ln.props.action,typeof Bi!="function"){Yr.next=21;break}return Yr.next=18,Bi(cr);case 18:Li=Yr.sent,Yr.next=22;break;case 21:Li=Bi;case 22:if(gi=ln.props.data,typeof gi!="function"){Yr.next=29;break}return Yr.next=26,gi(cr);case 26:Yi=Yr.sent,Yr.next=30;break;case 29:Yi=gi;case 30:return xi=((0,St.Z)(Zr)==="object"||typeof Zr=="string")&&Zr?Zr:cr,xi instanceof File?oi=xi:oi=new File([xi],cr.name,{type:cr.type}),Ri=oi,Ri.uid=cr.uid,Yr.abrupt("return",{origin:cr,data:Yi,parsedFile:Ri,action:Li});case 35:case"end":return Yr.stop()}},On,null,[[3,9]])}));return function(On,cr){return mn.apply(this,arguments)}}(),ln.saveFileInput=function(mn){ln.fileInput=mn},ln}return(0,ke.Z)(bt,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"post",value:function(Pn){var cn=this,pn=Pn.data,mn=Pn.origin,On=Pn.action,cr=Pn.parsedFile;if(this._isMounted){var Gt=this.props,Jr=Gt.onStart,Zr=Gt.customRequest,Bi=Gt.name,Li=Gt.headers,gi=Gt.withCredentials,Yi=Gt.method,xi=mn.uid,oi=Zr||At,Ri={action:On,filename:Bi,data:pn,file:cr,headers:Li,withCredentials:gi,method:Yi||"post",onProgress:function(Yr){var vi=cn.props.onProgress;vi==null||vi(Yr,cr)},onSuccess:function(Yr,vi){var Wi=cn.props.onSuccess;Wi==null||Wi(Yr,cr,vi),delete cn.reqs[xi]},onError:function(Yr,vi){var Wi=cn.props.onError;Wi==null||Wi(Yr,vi,cr),delete cn.reqs[xi]}};Jr(mn),this.reqs[xi]=oi(Ri)}}},{key:"reset",value:function(){this.setState({uid:ft()})}},{key:"abort",value:function(Pn){var cn=this.reqs;if(Pn){var pn=Pn.uid?Pn.uid:Pn;cn[pn]&&cn[pn].abort&&cn[pn].abort(),delete cn[pn]}else Object.keys(cn).forEach(function(mn){cn[mn]&&cn[mn].abort&&cn[mn].abort(),delete cn[mn]})}},{key:"render",value:function(){var Pn,cn=this.props,pn=cn.component,mn=cn.prefixCls,On=cn.className,cr=cn.disabled,Gt=cn.id,Jr=cn.style,Zr=cn.multiple,Bi=cn.accept,Li=cn.capture,gi=cn.children,Yi=cn.directory,xi=cn.openFileDialogOnClick,oi=cn.onMouseEnter,Ri=cn.onMouseLeave,ji=(0,tt.Z)(cn,Ct),Yr=Ve()((Pn={},(0,Ee.Z)(Pn,mn,!0),(0,Ee.Z)(Pn,"".concat(mn,"-disabled"),cr),(0,Ee.Z)(Pn,On,On),Pn)),vi=Yi?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},Wi=cr?{}:{onClick:xi?this.onClick:function(){},onKeyDown:xi?this.onKeyDown:function(){},onMouseEnter:oi,onMouseLeave:Ri,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return he.createElement(pn,(0,ve.Z)({},Wi,{className:Yr,role:"button",style:Jr}),he.createElement("input",(0,ve.Z)({},(0,it.Z)(ji,{aria:!0,data:!0}),{id:Gt,disabled:cr,type:"file",ref:this.saveFileInput,onClick:function(ta){return ta.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:Bi},vi,{multiple:Zr,onChange:this.onChange},Li!=null?{capture:Li}:{})),gi)}}]),bt}(he.Component),qe=Dt;function Rt(){}var Pt=function(ht){(0,Se.Z)(bt,ht);var st=(0,me.Z)(bt);function bt(){var ln;(0,_e.Z)(this,bt);for(var Pn=arguments.length,cn=new Array(Pn),pn=0;pn<Pn;pn++)cn[pn]=arguments[pn];return ln=st.call.apply(st,[this].concat(cn)),ln.uploader=void 0,ln.saveUploader=function(mn){ln.uploader=mn},ln}return(0,ke.Z)(bt,[{key:"abort",value:function(Pn){this.uploader.abort(Pn)}},{key:"render",value:function(){return he.createElement(qe,(0,ve.Z)({},this.props,{ref:this.saveUploader}))}}]),bt}(he.Component);Pt.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:Rt,onError:Rt,onSuccess:Rt,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var En=Pt,tn=En,$n=se(5663),ur=se(73935),wr=se(53124),Je=se(98866),Ae=se(10110),Ht=se(24457),Rn={icon:function(st,bt){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:bt}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:st}}]}},name:"file",theme:"twotone"},yn=Rn,ot=se(84089),nt=function(st,bt){return he.createElement(ot.Z,(0,ve.Z)({},st,{ref:bt,icon:yn}))},Tt=he.forwardRef(nt),rn=se(3407),dn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},Ut=dn,Kt=function(st,bt){return he.createElement(ot.Z,(0,ve.Z)({},st,{ref:bt,icon:Ut}))},bn=he.forwardRef(Kt),nn={icon:function(st,bt){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:st}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:bt}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:bt}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:bt}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:st}}]}},name:"picture",theme:"twotone"},we=nn,ue=function(st,bt){return he.createElement(ot.Z,(0,ve.Z)({},st,{ref:bt,icon:we}))},oe=he.forwardRef(ue),pe=se(38379),fe=se(57838),le=se(33603),Pe=se(96159),Qe=se(71577);function It(ht){return Object.assign(Object.assign({},ht),{lastModified:ht.lastModified,lastModifiedDate:ht.lastModifiedDate,name:ht.name,size:ht.size,type:ht.type,uid:ht.uid,percent:0,originFileObj:ht})}function Nt(ht,st){const bt=(0,He.Z)(st),ln=bt.findIndex(Pn=>{let{uid:cn}=Pn;return cn===ht.uid});return ln===-1?bt.push(ht):bt[ln]=ht,bt}function qt(ht,st){const bt=ht.uid!==void 0?"uid":"name";return st.filter(ln=>ln[bt]===ht[bt])[0]}function an(ht,st){const bt=ht.uid!==void 0?"uid":"name",ln=st.filter(Pn=>Pn[bt]!==ht[bt]);return ln.length===st.length?null:ln}const jt=function(){const st=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"").split("/"),ln=st[st.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(ln)||[""])[0]},ir=ht=>ht.indexOf("image/")===0,Cr=ht=>{if(ht.type&&!ht.thumbUrl)return ir(ht.type);const st=ht.thumbUrl||ht.url||"",bt=jt(st);return/^data:image\//.test(st)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(bt)?!0:!(/^data:/.test(st)||bt)},Bt=200;function Mn(ht){return new Promise(st=>{if(!ht.type||!ir(ht.type)){st("");return}const bt=document.createElement("canvas");bt.width=Bt,bt.height=Bt,bt.style.cssText=`position: fixed; left: 0; top: 0; width: ${Bt}px; height: ${Bt}px; z-index: 9999; display: none;`,document.body.appendChild(bt);const ln=bt.getContext("2d"),Pn=new Image;if(Pn.onload=()=>{const{width:cn,height:pn}=Pn;let mn=Bt,On=Bt,cr=0,Gt=0;cn>pn?(On=pn*(Bt/cn),Gt=-(On-mn)/2):(mn=cn*(Bt/pn),cr=-(mn-On)/2),ln.drawImage(Pn,cr,Gt,mn,On);const Jr=bt.toDataURL();document.body.removeChild(bt),window.URL.revokeObjectURL(Pn.src),st(Jr)},Pn.crossOrigin="anonymous",ht.type.startsWith("image/svg+xml")){const cn=new FileReader;cn.onload=()=>{cn.result&&(Pn.src=cn.result)},cn.readAsDataURL(ht)}else if(ht.type.startsWith("image/gif")){const cn=new FileReader;cn.onload=()=>{cn.result&&st(cn.result)},cn.readAsDataURL(ht)}else Pn.src=window.URL.createObjectURL(ht)})}var Vn=se(84249),br=se(90674),at=se(99569),$t=se(38703),In=se(83062),ar=he.forwardRef((ht,st)=>{let{prefixCls:bt,className:ln,style:Pn,locale:cn,listType:pn,file:mn,items:On,progress:cr,iconRender:Gt,actionIconRender:Jr,itemRender:Zr,isImgUrl:Bi,showPreviewIcon:Li,showRemoveIcon:gi,showDownloadIcon:Yi,previewIcon:xi,removeIcon:oi,downloadIcon:Ri,onPreview:ji,onDownload:Yr,onClose:vi}=ht;var Wi,la;const{status:ta}=mn,[ri,xt]=he.useState(ta);he.useEffect(()=>{ta!=="removed"&&xt(ta)},[ta]);const[vt,Zt]=he.useState(!1);he.useEffect(()=>{const et=setTimeout(()=>{Zt(!0)},300);return()=>{clearTimeout(et)}},[]);const fn=Gt(mn);let Tn=he.createElement("div",{className:`${bt}-icon`},fn);if(pn==="picture"||pn==="picture-card"||pn==="picture-circle")if(ri==="uploading"||!mn.thumbUrl&&!mn.url){const et=Ve()(`${bt}-list-item-thumbnail`,{[`${bt}-list-item-file`]:ri!=="uploading"});Tn=he.createElement("div",{className:et},fn)}else{const et=Bi!=null&&Bi(mn)?he.createElement("img",{src:mn.thumbUrl||mn.url,alt:mn.name,className:`${bt}-list-item-image`,crossOrigin:mn.crossOrigin}):fn,lt=Ve()(`${bt}-list-item-thumbnail`,{[`${bt}-list-item-file`]:Bi&&!Bi(mn)});Tn=he.createElement("a",{className:lt,onClick:wt=>ji(mn,wt),href:mn.url||mn.thumbUrl,target:"_blank",rel:"noopener noreferrer"},et)}const pr=Ve()(`${bt}-list-item`,`${bt}-list-item-${ri}`),Ar=typeof mn.linkProps=="string"?JSON.parse(mn.linkProps):mn.linkProps,Wr=gi?Jr((typeof oi=="function"?oi(mn):oi)||he.createElement(Vn.Z,null),()=>vi(mn),bt,cn.removeFile):null,Vr=Yi&&ri==="done"?Jr((typeof Ri=="function"?Ri(mn):Ri)||he.createElement(br.Z,null),()=>Yr(mn),bt,cn.downloadFile):null,Hr=pn!=="picture-card"&&pn!=="picture-circle"&&he.createElement("span",{key:"download-delete",className:Ve()(`${bt}-list-item-actions`,{picture:pn==="picture"})},Vr,Wr),ti=Ve()(`${bt}-list-item-name`),yi=mn.url?[he.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:ti,title:mn.name},Ar,{href:mn.url,onClick:et=>ji(mn,et)}),mn.name),Hr]:[he.createElement("span",{key:"view",className:ti,onClick:et=>ji(mn,et),title:mn.name},mn.name),Hr],Lr={pointerEvents:"none",opacity:.5},hi=Li?he.createElement("a",{href:mn.url||mn.thumbUrl,target:"_blank",rel:"noopener noreferrer",style:mn.url||mn.thumbUrl?void 0:Lr,onClick:et=>ji(mn,et),title:cn.previewFile},typeof xi=="function"?xi(mn):xi||he.createElement(at.Z,null)):null,Ai=(pn==="picture-card"||pn==="picture-circle")&&ri!=="uploading"&&he.createElement("span",{className:`${bt}-list-item-actions`},hi,ri==="done"&&Vr,Wr),{getPrefixCls:Mi}=he.useContext(wr.E_),Le=Mi(),Fe=he.createElement("div",{className:pr},Tn,yi,Ai,vt&&he.createElement(pe.default,{motionName:`${Le}-fade`,visible:ri==="uploading",motionDeadline:2e3},et=>{let{className:lt}=et;const wt="percent"in mn?he.createElement($t.Z,Object.assign({},cr,{type:"line",percent:mn.percent,"aria-label":mn["aria-label"],"aria-labelledby":mn["aria-labelledby"]})):null;return he.createElement("div",{className:Ve()(`${bt}-list-item-progress`,lt)},wt)})),ze=mn.response&&typeof mn.response=="string"?mn.response:((Wi=mn.error)===null||Wi===void 0?void 0:Wi.statusText)||((la=mn.error)===null||la===void 0?void 0:la.message)||cn.uploadError,Ze=ri==="error"?he.createElement(In.Z,{title:ze,getPopupContainer:et=>et.parentNode},Fe):Fe;return he.createElement("div",{className:Ve()(`${bt}-list-item-container`,ln),style:Pn,ref:st},Zr?Zr(Ze,mn,On,{download:Yr.bind(null,mn),preview:ji.bind(null,mn),remove:vi.bind(null,mn)}):Ze)});const Mr=(ht,st)=>{const{listType:bt="text",previewFile:ln=Mn,onPreview:Pn,onDownload:cn,onRemove:pn,locale:mn,iconRender:On,isImageUrl:cr=Cr,prefixCls:Gt,items:Jr=[],showPreviewIcon:Zr=!0,showRemoveIcon:Bi=!0,showDownloadIcon:Li=!1,removeIcon:gi,previewIcon:Yi,downloadIcon:xi,progress:oi={size:[-1,2],showInfo:!1},appendAction:Ri,appendActionVisible:ji=!0,itemRender:Yr,disabled:vi}=ht,Wi=(0,fe.Z)(),[la,ta]=he.useState(!1);he.useEffect(()=>{bt!=="picture"&&bt!=="picture-card"&&bt!=="picture-circle"||(Jr||[]).forEach(Lr=>{typeof document=="undefined"||typeof window=="undefined"||!window.FileReader||!window.File||!(Lr.originFileObj instanceof File||Lr.originFileObj instanceof Blob)||Lr.thumbUrl!==void 0||(Lr.thumbUrl="",ln&&ln(Lr.originFileObj).then(hi=>{Lr.thumbUrl=hi||"",Wi()}))})},[bt,Jr,ln]),he.useEffect(()=>{ta(!0)},[]);const ri=(Lr,hi)=>{if(Pn)return hi==null||hi.preventDefault(),Pn(Lr)},xt=Lr=>{typeof cn=="function"?cn(Lr):Lr.url&&window.open(Lr.url)},vt=Lr=>{pn==null||pn(Lr)},Zt=Lr=>{if(On)return On(Lr,bt);const hi=Lr.status==="uploading",Ai=cr&&cr(Lr)?he.createElement(oe,null):he.createElement(Tt,null);let Mi=hi?he.createElement(rn.Z,null):he.createElement(bn,null);return bt==="picture"?Mi=hi?he.createElement(rn.Z,null):Ai:(bt==="picture-card"||bt==="picture-circle")&&(Mi=hi?mn.uploading:Ai),Mi},fn=(Lr,hi,Ai,Mi)=>{const Le={type:"text",size:"small",title:Mi,onClick:Fe=>{hi(),(0,Pe.l$)(Lr)&&Lr.props.onClick&&Lr.props.onClick(Fe)},className:`${Ai}-list-item-action`,disabled:vi};if((0,Pe.l$)(Lr)){const Fe=(0,Pe.Tm)(Lr,Object.assign(Object.assign({},Lr.props),{onClick:()=>{}}));return he.createElement(Qe.ZP,Object.assign({},Le,{icon:Fe}))}return he.createElement(Qe.ZP,Object.assign({},Le),he.createElement("span",null,Lr))};he.useImperativeHandle(st,()=>({handlePreview:ri,handleDownload:xt}));const{getPrefixCls:Tn}=he.useContext(wr.E_),pr=Tn("upload",Gt),Ar=Tn(),Wr=Ve()(`${pr}-list`,`${pr}-list-${bt}`),Vr=(0,He.Z)(Jr.map(Lr=>({key:Lr.uid,file:Lr})));let ti={motionDeadline:2e3,motionName:`${pr}-${bt==="picture-card"||bt==="picture-circle"?"animate-inline":"animate"}`,keys:Vr,motionAppear:la};const yi=he.useMemo(()=>{const Lr=Object.assign({},(0,le.Z)(Ar));return delete Lr.onAppearEnd,delete Lr.onEnterEnd,delete Lr.onLeaveEnd,Lr},[Ar]);return bt!=="picture-card"&&bt!=="picture-circle"&&(ti=Object.assign(Object.assign({},yi),ti)),he.createElement("div",{className:Wr},he.createElement(pe.CSSMotionList,Object.assign({},ti,{component:!1}),Lr=>{let{key:hi,file:Ai,className:Mi,style:Le}=Lr;return he.createElement(ar,{key:hi,locale:mn,prefixCls:pr,className:Mi,style:Le,file:Ai,items:Jr,progress:oi,listType:bt,isImgUrl:cr,showPreviewIcon:Zr,showRemoveIcon:Bi,showDownloadIcon:Li,removeIcon:gi,previewIcon:Yi,downloadIcon:xi,iconRender:Zt,actionIconRender:fn,itemRender:Yr,onPreview:ri,onDownload:xt,onClose:vt})}),Ri&&he.createElement(pe.default,Object.assign({},ti,{visible:ji,forceRender:!0}),Lr=>{let{className:hi,style:Ai}=Lr;return(0,Pe.Tm)(Ri,Mi=>({className:Ve()(Mi.className,hi),style:Object.assign(Object.assign(Object.assign({},Ai),{pointerEvents:hi?"none":void 0}),Mi.style)}))}))};var Dr=he.forwardRef(Mr),Kr=se(14747),ni=se(33507),hr=se(67968),mi=se(45503),Ui=ht=>{const{componentCls:st,iconCls:bt}=ht;return{[`${st}-wrapper`]:{[`${st}-drag`]:{position:"relative",width:"100%",height:"100%",textAlign:"center",background:ht.colorFillAlter,border:`${ht.lineWidth}px dashed ${ht.colorBorder}`,borderRadius:ht.borderRadiusLG,cursor:"pointer",transition:`border-color ${ht.motionDurationSlow}`,[st]:{padding:`${ht.padding}px 0`},[`${st}-btn`]:{display:"table",width:"100%",height:"100%",outline:"none"},[`${st}-drag-container`]:{display:"table-cell",verticalAlign:"middle"},[`&:not(${st}-disabled):hover`]:{borderColor:ht.colorPrimaryHover},[`p${st}-drag-icon`]:{marginBottom:ht.margin,[bt]:{color:ht.colorPrimary,fontSize:ht.uploadThumbnailSize}},[`p${st}-text`]:{margin:`0 0 ${ht.marginXXS}px`,color:ht.colorTextHeading,fontSize:ht.fontSizeLG},[`p${st}-hint`]:{color:ht.colorTextDescription,fontSize:ht.fontSize},[`&${st}-disabled`]:{cursor:"not-allowed",[`p${st}-drag-icon ${bt},
p${st}-text,
p${st}-hint
`]:{color:ht.colorTextDisabled}}}}}},ui=ht=>{const{componentCls:st,antCls:bt,iconCls:ln,fontSize:Pn,lineHeight:cn}=ht,pn=`${st}-list-item`,mn=`${pn}-actions`,On=`${pn}-action`,cr=Math.round(Pn*cn);return{[`${st}-wrapper`]:{[`${st}-list`]:Object.assign(Object.assign({},(0,Kr.dF)()),{lineHeight:ht.lineHeight,[pn]:{position:"relative",height:ht.lineHeight*Pn,marginTop:ht.marginXS,fontSize:Pn,display:"flex",alignItems:"center",transition:`background-color ${ht.motionDurationSlow}`,"&:hover":{backgroundColor:ht.controlItemBgHover},[`${pn}-name`]:Object.assign(Object.assign({},Kr.vS),{padding:`0 ${ht.paddingXS}px`,lineHeight:cn,flex:"auto",transition:`all ${ht.motionDurationSlow}`}),[mn]:{[On]:{opacity:0},[`${On}${bt}-btn-sm`]:{height:cr,border:0,lineHeight:1,"> span":{transform:"scale(1)"}},[`
${On}:focus-visible,
&.picture ${On}
`]:{opacity:1},[ln]:{color:ht.actionsColor,transition:`all ${ht.motionDurationSlow}`},[`&:hover ${ln}`]:{color:ht.colorText}},[`${st}-icon ${ln}`]:{color:ht.colorTextDescription,fontSize:Pn},[`${pn}-progress`]:{position:"absolute",bottom:-ht.uploadProgressOffset,width:"100%",paddingInlineStart:Pn+ht.paddingXS,fontSize:Pn,lineHeight:0,pointerEvents:"none","> div":{margin:0}}},[`${pn}:hover ${On}`]:{opacity:1,color:ht.colorText},[`${pn}-error`]:{color:ht.colorError,[`${pn}-name, ${st}-icon ${ln}`]:{color:ht.colorError},[mn]:{[`${ln}, ${ln}:hover`]:{color:ht.colorError},[On]:{opacity:1}}},[`${st}-list-item-container`]:{transition:`opacity ${ht.motionDurationSlow}, height ${ht.motionDurationSlow}`,"&::before":{display:"table",width:0,height:0,content:'""'}}})}}},yt=se(34367),Cn=se(16932);const Ln=new yt.Keyframes("uploadAnimateInlineIn",{from:{width:0,height:0,margin:0,padding:0,opacity:0}}),Dn=new yt.Keyframes("uploadAnimateInlineOut",{to:{width:0,height:0,margin:0,padding:0,opacity:0}});var nr=ht=>{const{componentCls:st}=ht,bt=`${st}-animate-inline`;return[{[`${st}-wrapper`]:{[`${bt}-appear, ${bt}-enter, ${bt}-leave`]:{animationDuration:ht.motionDurationSlow,animationTimingFunction:ht.motionEaseInOutCirc,animationFillMode:"forwards"},[`${bt}-appear, ${bt}-enter`]:{animationName:Ln},[`${bt}-leave`]:{animationName:Dn}}},{[`${st}-wrapper`]:(0,Cn.J$)(ht)},Ln,Dn]},gr=se(16397),Fn=se(84780);const Xe=ht=>{const{componentCls:st,iconCls:bt,uploadThumbnailSize:ln,uploadProgressOffset:Pn}=ht,cn=`${st}-list`,pn=`${cn}-item`;return{[`${st}-wrapper`]:{[`
${cn}${cn}-picture,
${cn}${cn}-picture-card,
${cn}${cn}-picture-circle
`]:{[pn]:{position:"relative",height:ln+ht.lineWidth*2+ht.paddingXS*2,padding:ht.paddingXS,border:`${ht.lineWidth}px ${ht.lineType} ${ht.colorBorder}`,borderRadius:ht.borderRadiusLG,"&:hover":{background:"transparent"},[`${pn}-thumbnail`]:Object.assign(Object.assign({},Kr.vS),{width:ln,height:ln,lineHeight:`${ln+ht.paddingSM}px`,textAlign:"center",flex:"none",[bt]:{fontSize:ht.fontSizeHeading2,color:ht.colorPrimary},img:{display:"block",width:"100%",height:"100%",overflow:"hidden"}}),[`${pn}-progress`]:{bottom:Pn,width:`calc(100% - ${ht.paddingSM*2}px)`,marginTop:0,paddingInlineStart:ln+ht.paddingXS}},[`${pn}-error`]:{borderColor:ht.colorError,[`${pn}-thumbnail ${bt}`]:{[`svg path[fill='${gr.blue[0]}']`]:{fill:ht.colorErrorBg},[`svg path[fill='${gr.blue.primary}']`]:{fill:ht.colorError}}},[`${pn}-uploading`]:{borderStyle:"dashed",[`${pn}-name`]:{marginBottom:Pn}}},[`${cn}${cn}-picture-circle ${pn}`]:{[`&, &::before, ${pn}-thumbnail`]:{borderRadius:"50%"}}}}},ut=ht=>{const{componentCls:st,iconCls:bt,fontSizeLG:ln,colorTextLightSolid:Pn}=ht,cn=`${st}-list`,pn=`${cn}-item`,mn=ht.uploadPicCardSize;return{[`
${st}-wrapper${st}-picture-card-wrapper,
${st}-wrapper${st}-picture-circle-wrapper
`]:Object.assign(Object.assign({},(0,Kr.dF)()),{display:"inline-block",width:"100%",[`${st}${st}-select`]:{width:mn,height:mn,marginInlineEnd:ht.marginXS,marginBottom:ht.marginXS,textAlign:"center",verticalAlign:"top",backgroundColor:ht.colorFillAlter,border:`${ht.lineWidth}px dashed ${ht.colorBorder}`,borderRadius:ht.borderRadiusLG,cursor:"pointer",transition:`border-color ${ht.motionDurationSlow}`,[`> ${st}`]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",textAlign:"center"},[`&:not(${st}-disabled):hover`]:{borderColor:ht.colorPrimary}},[`${cn}${cn}-picture-card, ${cn}${cn}-picture-circle`]:{[`${cn}-item-container`]:{display:"inline-block",width:mn,height:mn,marginBlock:`0 ${ht.marginXS}px`,marginInline:`0 ${ht.marginXS}px`,verticalAlign:"top"},"&::after":{display:"none"},[pn]:{height:"100%",margin:0,"&::before":{position:"absolute",zIndex:1,width:`calc(100% - ${ht.paddingXS*2}px)`,height:`calc(100% - ${ht.paddingXS*2}px)`,backgroundColor:ht.colorBgMask,opacity:0,transition:`all ${ht.motionDurationSlow}`,content:'" "'}},[`${pn}:hover`]:{[`&::before, ${pn}-actions`]:{opacity:1}},[`${pn}-actions`]:{position:"absolute",insetInlineStart:0,zIndex:10,width:"100%",whiteSpace:"nowrap",textAlign:"center",opacity:0,transition:`all ${ht.motionDurationSlow}`,[`${bt}-eye, ${bt}-download, ${bt}-delete`]:{zIndex:10,width:ln,margin:`0 ${ht.marginXXS}px`,fontSize:ln,cursor:"pointer",transition:`all ${ht.motionDurationSlow}`,svg:{verticalAlign:"baseline"}}},[`${pn}-actions, ${pn}-actions:hover`]:{[`${bt}-eye, ${bt}-download, ${bt}-delete`]:{color:new Fn.C(Pn).setAlpha(.65).toRgbString(),"&:hover":{color:Pn}}},[`${pn}-thumbnail, ${pn}-thumbnail img`]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},[`${pn}-name`]:{display:"none",textAlign:"center"},[`${pn}-file + ${pn}-name`]:{position:"absolute",bottom:ht.margin,display:"block",width:`calc(100% - ${ht.paddingXS*2}px)`},[`${pn}-uploading`]:{[`&${pn}`]:{backgroundColor:ht.colorFillAlter},[`&::before, ${bt}-eye, ${bt}-download, ${bt}-delete`]:{display:"none"}},[`${pn}-progress`]:{bottom:ht.marginXL,width:`calc(100% - ${ht.paddingXS*2}px)`,paddingInlineStart:0}}}),[`${st}-wrapper${st}-picture-circle-wrapper`]:{[`${st}${st}-select`]:{borderRadius:"50%"}}}};var Jt=ht=>{const{componentCls:st}=ht;return{[`${st}-rtl`]:{direction:"rtl"}}};const We=ht=>{const{componentCls:st,colorTextDisabled:bt}=ht;return{[`${st}-wrapper`]:Object.assign(Object.assign({},(0,Kr.Wf)(ht)),{[st]:{outline:0,"input[type='file']":{cursor:"pointer"}},[`${st}-select`]:{display:"inline-block"},[`${st}-disabled`]:{color:bt,cursor:"not-allowed"}})}};var mt=(0,hr.Z)("Upload",ht=>{const{fontSizeHeading3:st,fontSize:bt,lineHeight:ln,lineWidth:Pn,controlHeightLG:cn}=ht,pn=Math.round(bt*ln),mn=(0,mi.TS)(ht,{uploadThumbnailSize:st*2,uploadProgressOffset:pn/2+Pn,uploadPicCardSize:cn*2.55});return[We(mn),Ui(mn),Xe(mn),ut(mn),ui(mn),nr(mn),Jt(mn),(0,ni.Z)(mn)]},ht=>({actionsColor:ht.colorTextDescription})),zt=function(ht,st,bt,ln){function Pn(cn){return cn instanceof bt?cn:new bt(function(pn){pn(cn)})}return new(bt||(bt=Promise))(function(cn,pn){function mn(Gt){try{cr(ln.next(Gt))}catch(Jr){pn(Jr)}}function On(Gt){try{cr(ln.throw(Gt))}catch(Jr){pn(Jr)}}function cr(Gt){Gt.done?cn(Gt.value):Pn(Gt.value).then(mn,On)}cr((ln=ln.apply(ht,st||[])).next())})};const Ot=`__LIST_IGNORE_${Date.now()}__`,Vt=(ht,st)=>{const{fileList:bt,defaultFileList:ln,onRemove:Pn,showUploadList:cn=!0,listType:pn="text",onPreview:mn,onDownload:On,onChange:cr,onDrop:Gt,previewFile:Jr,disabled:Zr,locale:Bi,iconRender:Li,isImageUrl:gi,progress:Yi,prefixCls:xi,className:oi,type:Ri="select",children:ji,style:Yr,itemRender:vi,maxCount:Wi,data:la={},multiple:ta=!1,action:ri="",accept:xt="",supportServerRender:vt=!0,rootClassName:Zt}=ht,fn=he.useContext(Je.Z),Tn=Zr!=null?Zr:fn,[pr,Ar]=(0,$n.Z)(ln||[],{value:bt,postState:Oe=>Oe!=null?Oe:[]}),[Wr,Vr]=he.useState("drop"),Hr=he.useRef(null);he.useMemo(()=>{const Oe=Date.now();(bt||[]).forEach((Ke,Mt)=>{!Ke.uid&&!Object.isFrozen(Ke)&&(Ke.uid=`__AUTO__${Oe}_${Mt}__`)})},[bt]);const ti=(Oe,Ke,Mt)=>{let ct=(0,He.Z)(Ke),Ft=!1;Wi===1?ct=ct.slice(-1):Wi&&(Ft=ct.length>Wi,ct=ct.slice(0,Wi)),(0,ur.flushSync)(()=>{Ar(ct)});const un={file:Oe,fileList:ct};Mt&&(un.event=Mt),(!Ft||ct.some(vn=>vn.uid===Oe.uid))&&(0,ur.flushSync)(()=>{cr==null||cr(un)})},yi=(Oe,Ke)=>zt(void 0,void 0,void 0,function*(){const{beforeUpload:Mt,transformFile:ct}=ht;let Ft=Oe;if(Mt){const un=yield Mt(Oe,Ke);if(un===!1)return!1;if(delete Oe[Ot],un===Ot)return Object.defineProperty(Oe,Ot,{value:!0,configurable:!0}),!1;typeof un=="object"&&un&&(Ft=un)}return ct&&(Ft=yield ct(Ft)),Ft}),Lr=Oe=>{const Ke=Oe.filter(Ft=>!Ft.file[Ot]);if(!Ke.length)return;const Mt=Ke.map(Ft=>It(Ft.file));let ct=(0,He.Z)(pr);Mt.forEach(Ft=>{ct=Nt(Ft,ct)}),Mt.forEach((Ft,un)=>{let vn=Ft;if(Ke[un].parsedFile)Ft.status="uploading";else{const{originFileObj:Nn}=Ft;let kn;try{kn=new File([Nn],Nn.name,{type:Nn.type})}catch(on){kn=new Blob([Nn],{type:Nn.type}),kn.name=Nn.name,kn.lastModifiedDate=new Date,kn.lastModified=new Date().getTime()}kn.uid=Ft.uid,vn=kn}ti(vn,ct)})},hi=(Oe,Ke,Mt)=>{try{typeof Oe=="string"&&(Oe=JSON.parse(Oe))}catch(un){}if(!qt(Ke,pr))return;const ct=It(Ke);ct.status="done",ct.percent=100,ct.response=Oe,ct.xhr=Mt;const Ft=Nt(ct,pr);ti(ct,Ft)},Ai=(Oe,Ke)=>{if(!qt(Ke,pr))return;const Mt=It(Ke);Mt.status="uploading",Mt.percent=Oe.percent;const ct=Nt(Mt,pr);ti(Mt,ct,Oe)},Mi=(Oe,Ke,Mt)=>{if(!qt(Mt,pr))return;const ct=It(Mt);ct.error=Oe,ct.response=Ke,ct.status="error";const Ft=Nt(ct,pr);ti(ct,Ft)},Le=Oe=>{let Ke;Promise.resolve(typeof Pn=="function"?Pn(Oe):Pn).then(Mt=>{var ct;if(Mt===!1)return;const Ft=an(Oe,pr);Ft&&(Ke=Object.assign(Object.assign({},Oe),{status:"removed"}),pr==null||pr.forEach(un=>{const vn=Ke.uid!==void 0?"uid":"name";un[vn]===Ke[vn]&&!Object.isFrozen(un)&&(un.status="removed")}),(ct=Hr.current)===null||ct===void 0||ct.abort(Ke),ti(Ke,Ft))})},Fe=Oe=>{Vr(Oe.type),Oe.type==="drop"&&(Gt==null||Gt(Oe))};he.useImperativeHandle(st,()=>({onBatchStart:Lr,onSuccess:hi,onProgress:Ai,onError:Mi,fileList:pr,upload:Hr.current}));const{getPrefixCls:ze,direction:Ze,upload:et}=he.useContext(wr.E_),lt=ze("upload",xi),wt=Object.assign(Object.assign({onBatchStart:Lr,onError:Mi,onProgress:Ai,onSuccess:hi},ht),{data:la,multiple:ta,action:ri,accept:xt,supportServerRender:vt,prefixCls:lt,disabled:Tn,beforeUpload:yi,onChange:void 0});delete wt.className,delete wt.style,(!ji||Tn)&&delete wt.id;const[Qt,sn]=mt(lt),[Xn]=(0,Ae.Z)("Upload",Ht.Z.Upload),{showRemoveIcon:vr,showPreviewIcon:Zn,showDownloadIcon:xn,removeIcon:gn,previewIcon:An,downloadIcon:Bn}=typeof cn=="boolean"?{}:cn,fr=(Oe,Ke)=>cn?he.createElement(Dr,{prefixCls:lt,listType:pn,items:pr,previewFile:Jr,onPreview:mn,onDownload:On,onRemove:Le,showRemoveIcon:!Tn&&vr,showPreviewIcon:Zn,showDownloadIcon:xn,removeIcon:gn,previewIcon:An,downloadIcon:Bn,iconRender:Li,locale:Object.assign(Object.assign({},Xn),Bi),isImageUrl:gi,progress:Yi,appendAction:Oe,appendActionVisible:Ke,itemRender:vi,disabled:Tn}):Oe,Gn=Ve()(`${lt}-wrapper`,oi,Zt,sn,et==null?void 0:et.className,{[`${lt}-rtl`]:Ze==="rtl",[`${lt}-picture-card-wrapper`]:pn==="picture-card",[`${lt}-picture-circle-wrapper`]:pn==="picture-circle"}),jn=Object.assign(Object.assign({},et==null?void 0:et.style),Yr);if(Ri==="drag"){const Oe=Ve()(sn,lt,`${lt}-drag`,{[`${lt}-drag-uploading`]:pr.some(Ke=>Ke.status==="uploading"),[`${lt}-drag-hover`]:Wr==="dragover",[`${lt}-disabled`]:Tn,[`${lt}-rtl`]:Ze==="rtl"});return Qt(he.createElement("span",{className:Gn},he.createElement("div",{className:Oe,style:jn,onDrop:Fe,onDragOver:Fe,onDragLeave:Fe},he.createElement(tn,Object.assign({},wt,{ref:Hr,className:`${lt}-btn`}),he.createElement("div",{className:`${lt}-drag-container`},ji))),fr()))}const er=Ve()(lt,`${lt}-select`,{[`${lt}-disabled`]:Tn}),yr=(Oe=>he.createElement("div",{className:er,style:Oe},he.createElement(tn,Object.assign({},wt,{ref:Hr}))))(ji?void 0:{display:"none"});return Qt(pn==="picture-card"||pn==="picture-circle"?he.createElement("span",{className:Gn},fr(yr,!!ji)):he.createElement("span",{className:Gn},yr,fr()))};var Hn=he.forwardRef(Vt),_r=function(ht,st){var bt={};for(var ln in ht)Object.prototype.hasOwnProperty.call(ht,ln)&&st.indexOf(ln)<0&&(bt[ln]=ht[ln]);if(ht!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Pn=0,ln=Object.getOwnPropertySymbols(ht);Pn<ln.length;Pn++)st.indexOf(ln[Pn])<0&&Object.prototype.propertyIsEnumerable.call(ht,ln[Pn])&&(bt[ln[Pn]]=ht[ln[Pn]]);return bt},qn=he.forwardRef((ht,st)=>{var{style:bt,height:ln}=ht,Pn=_r(ht,["style","height"]);return he.createElement(Hn,Object.assign({ref:st},Pn,{type:"drag",style:Object.assign(Object.assign({},bt),{height:ln})}))});const or=Hn;or.Dragger=qn,or.LIST_IGNORE=Ot;var lr=or},41771:function(Sn,Wt){"use strict";var se;var he=typeof Symbol=="function"&&Symbol.for,He=he?Symbol.for("react.element"):60103,Re=he?Symbol.for("react.portal"):60106,Ve=he?Symbol.for("react.fragment"):60107,ve=he?Symbol.for("react.strict_mode"):60108,_e=he?Symbol.for("react.profiler"):60114,ke=he?Symbol.for("react.provider"):60109,Se=he?Symbol.for("react.context"):60110,me=he?Symbol.for("react.async_mode"):60111,Ee=he?Symbol.for("react.concurrent_mode"):60111,tt=he?Symbol.for("react.forward_ref"):60112,Be=he?Symbol.for("react.suspense"):60113,St=he?Symbol.for("react.suspense_list"):60120,dt=he?Symbol.for("react.memo"):60115,it=he?Symbol.for("react.lazy"):60116,Ge=he?Symbol.for("react.block"):60121,De=he?Symbol.for("react.fundamental"):60117,At=he?Symbol.for("react.responder"):60118,Xt=he?Symbol.for("react.scope"):60119;function rt(Ie){if(typeof Ie=="object"&&Ie!==null){var xe=Ie.$$typeof;switch(xe){case He:switch(Ie=Ie.type,Ie){case me:case Ee:case Ve:case _e:case ve:case Be:return Ie;default:switch(Ie=Ie&&Ie.$$typeof,Ie){case Se:case tt:case it:case dt:case ke:return Ie;default:return xe}}case Re:return xe}}}function ft(Ie){return rt(Ie)===Ee}se=me,se=Ee,se=Se,se=ke,se=He,se=tt,se=Ve,se=it,se=dt,se=Re,se=_e,se=ve,se=Be,se=function(Ie){return ft(Ie)||rt(Ie)===me},se=ft,se=function(Ie){return rt(Ie)===Se},se=function(Ie){return rt(Ie)===ke},se=function(Ie){return typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===He},se=function(Ie){return rt(Ie)===tt},Wt.isFragment=function(Ie){return rt(Ie)===Ve},se=function(Ie){return rt(Ie)===it},se=function(Ie){return rt(Ie)===dt},se=function(Ie){return rt(Ie)===Re},se=function(Ie){return rt(Ie)===_e},se=function(Ie){return rt(Ie)===ve},se=function(Ie){return rt(Ie)===Be},se=function(Ie){return typeof Ie=="string"||typeof Ie=="function"||Ie===Ve||Ie===Ee||Ie===_e||Ie===ve||Ie===Be||Ie===St||typeof Ie=="object"&&Ie!==null&&(Ie.$$typeof===it||Ie.$$typeof===dt||Ie.$$typeof===ke||Ie.$$typeof===Se||Ie.$$typeof===tt||Ie.$$typeof===De||Ie.$$typeof===At||Ie.$$typeof===Xt||Ie.$$typeof===Ge)},se=rt},47655:function(Sn,Wt,se){"use strict";Sn.exports=se(41771)},64701:function(Sn,Wt,se){"use strict";se.r(Wt),se.d(Wt,{ResizableTextArea:function(){return Rn},default:function(){return dn}});var he=se(87462),He=se(1413),Re=se(4942),Ve=se(71002),ve=se(97685),_e=se(45987),ke=se(74902),Se=se(94184),me=se.n(Se),Ee=se(67656),tt=se(87887),Be=se(67294);function St(Ut){var Kt=Be.useRef();Kt.current=Ut;var bn=Be.useCallback(function(){for(var nn,we=arguments.length,ue=new Array(we),oe=0;oe<we;oe++)ue[oe]=arguments[oe];return(nn=Kt.current)===null||nn===void 0?void 0:nn.call.apply(nn,[Kt].concat(ue))},[]);return bn}function dt(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var it=dt()?Be.useLayoutEffect:Be.useEffect,Ge=it,De=function(Kt,bn){var nn=Be.useRef(!0);it(function(){if(!nn.current)return Kt()},bn),it(function(){return nn.current=!1,function(){nn.current=!0}},[])};function At(Ut){var Kt=Be.useRef(!1),bn=Be.useState(Ut),nn=(0,ve.Z)(bn,2),we=nn[0],ue=nn[1];Be.useEffect(function(){return Kt.current=!1,function(){Kt.current=!0}},[]);function oe(pe,fe){fe&&Kt.current||ue(pe)}return[we,oe]}function Xt(Ut){return Ut!==void 0}function rt(Ut,Kt){var bn=Kt||{},nn=bn.defaultValue,we=bn.value,ue=bn.onChange,oe=bn.postState,pe=At(function(){return Xt(we)?we:Xt(nn)?typeof nn=="function"?nn():nn:typeof Ut=="function"?Ut():Ut}),fe=(0,ve.Z)(pe,2),le=fe[0],Pe=fe[1],Qe=we!==void 0?we:le,It=oe?oe(Qe):Qe,Nt=St(ue),qt=At([Qe]),an=(0,ve.Z)(qt,2),jt=an[0],ir=an[1];De(function(){var Bt=jt[0];le!==Bt&&Nt(le,Bt)},[jt]),De(function(){Xt(we)||Pe(we)},[we]);var Cr=St(function(Bt,Mn){Pe(Bt,Mn),ir([Qe],Mn)});return[It,Cr]}var ft=se(48555),Ie=function(Kt){return+setTimeout(Kt,16)},xe=function(Kt){return clearTimeout(Kt)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(Ie=function(Kt){return window.requestAnimationFrame(Kt)},xe=function(Kt){return window.cancelAnimationFrame(Kt)});var Ue=0,je=new Map;function _t(Ut){je.delete(Ut)}var Ct=function(Kt){var bn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Ue+=1;var nn=Ue;function we(ue){if(ue===0)_t(nn),Kt();else{var oe=Ie(function(){we(ue-1)});je.set(nn,oe)}}return we(bn),nn};Ct.cancel=function(Ut){var Kt=je.get(Ut);return _t(Kt),xe(Kt)};var Dt=Ct,qe=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important;
pointer-events: none !important;
`,Rt=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],Pt={},En;function tn(Ut){var Kt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,bn=Ut.getAttribute("id")||Ut.getAttribute("data-reactid")||Ut.getAttribute("name");if(Kt&&Pt[bn])return Pt[bn];var nn=window.getComputedStyle(Ut),we=nn.getPropertyValue("box-sizing")||nn.getPropertyValue("-moz-box-sizing")||nn.getPropertyValue("-webkit-box-sizing"),ue=parseFloat(nn.getPropertyValue("padding-bottom"))+parseFloat(nn.getPropertyValue("padding-top")),oe=parseFloat(nn.getPropertyValue("border-bottom-width"))+parseFloat(nn.getPropertyValue("border-top-width")),pe=Rt.map(function(le){return"".concat(le,":").concat(nn.getPropertyValue(le))}).join(";"),fe={sizingStyle:pe,paddingSize:ue,borderSize:oe,boxSizing:we};return Kt&&bn&&(Pt[bn]=fe),fe}function $n(Ut){var Kt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,bn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,nn=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;En||(En=document.createElement("textarea"),En.setAttribute("tab-index","-1"),En.setAttribute("aria-hidden","true"),document.body.appendChild(En)),Ut.getAttribute("wrap")?En.setAttribute("wrap",Ut.getAttribute("wrap")):En.removeAttribute("wrap");var we=tn(Ut,Kt),ue=we.paddingSize,oe=we.borderSize,pe=we.boxSizing,fe=we.sizingStyle;En.setAttribute("style","".concat(fe,";").concat(qe)),En.value=Ut.value||Ut.placeholder||"";var le=void 0,Pe=void 0,Qe,It=En.scrollHeight;if(pe==="border-box"?It+=oe:pe==="content-box"&&(It-=ue),bn!==null||nn!==null){En.value=" ";var Nt=En.scrollHeight-ue;bn!==null&&(le=Nt*bn,pe==="border-box"&&(le=le+ue+oe),It=Math.max(le,It)),nn!==null&&(Pe=Nt*nn,pe==="border-box"&&(Pe=Pe+ue+oe),Qe=It>Pe?"":"hidden",It=Math.min(Pe,It))}var qt={height:It,overflowY:Qe,resize:"none"};return le&&(qt.minHeight=le),Pe&&(qt.maxHeight=Pe),qt}var ur=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],wr=0,Je=1,Ae=2,Ht=Be.forwardRef(function(Ut,Kt){var bn=Ut,nn=bn.prefixCls,we=bn.onPressEnter,ue=bn.defaultValue,oe=bn.value,pe=bn.autoSize,fe=bn.onResize,le=bn.className,Pe=bn.style,Qe=bn.disabled,It=bn.onChange,Nt=bn.onInternalAutoSize,qt=(0,_e.Z)(bn,ur),an=rt(ue,{value:oe,postState:function(Dn){return Dn!=null?Dn:""}}),jt=(0,ve.Z)(an,2),ir=jt[0],Cr=jt[1],Bt=function(Dn){Cr(Dn.target.value),It==null||It(Dn)},Mn=Be.useRef();Be.useImperativeHandle(Kt,function(){return{textArea:Mn.current}});var Vn=Be.useMemo(function(){return pe&&(0,Ve.Z)(pe)==="object"?[pe.minRows,pe.maxRows]:[]},[pe]),br=(0,ve.Z)(Vn,2),at=br[0],$t=br[1],In=!!pe,Jn=function(){try{if(document.activeElement===Mn.current){var Dn=Mn.current,sr=Dn.selectionStart,nr=Dn.selectionEnd,gr=Dn.scrollTop;Mn.current.setSelectionRange(sr,nr),Mn.current.scrollTop=gr}}catch(Fn){}},ar=Be.useState(Ae),Mr=(0,ve.Z)(ar,2),$r=Mr[0],Dr=Mr[1],Kr=Be.useState(),ni=(0,ve.Z)(Kr,2),hr=ni[0],mi=ni[1],Ji=function(){Dr(wr)};Ge(function(){In&&Ji()},[oe,at,$t,In]),Ge(function(){if($r===wr)Dr(Je);else if($r===Je){var Ln=$n(Mn.current,!1,at,$t);Dr(Ae),mi(Ln)}else Jn()},[$r]);var Ui=Be.useRef(),Vi=function(){Dt.cancel(Ui.current)},ui=function(Dn){$r===Ae&&(fe==null||fe(Dn),pe&&(Vi(),Ui.current=Dt(function(){Ji()})))};Be.useEffect(function(){return Vi},[]);var yt=In?hr:null,Cn=(0,He.Z)((0,He.Z)({},Pe),yt);return($r===wr||$r===Je)&&(Cn.overflowY="hidden",Cn.overflowX="hidden"),Be.createElement(ft.Z,{onResize:ui,disabled:!(pe||fe)},Be.createElement("textarea",(0,he.Z)({},qt,{ref:Mn,style:Cn,className:me()(nn,le,(0,Re.Z)({},"".concat(nn,"-disabled"),Qe)),disabled:Qe,value:ir,onChange:Bt})))}),Rn=Ht,yn=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","classes","showCount","className","style","disabled","hidden","classNames","styles","onResize"];function ot(Ut,Kt){return(0,ke.Z)(Ut||"").slice(0,Kt).join("")}function nt(Ut,Kt,bn,nn){var we=bn;return Ut?we=ot(bn,nn):(0,ke.Z)(Kt||"").length<bn.length&&(0,ke.Z)(bn||"").length>nn&&(we=Kt),we}var Tt=Be.forwardRef(function(Ut,Kt){var bn,nn=Ut.defaultValue,we=Ut.value,ue=Ut.onFocus,oe=Ut.onBlur,pe=Ut.onChange,fe=Ut.allowClear,le=Ut.maxLength,Pe=Ut.onCompositionStart,Qe=Ut.onCompositionEnd,It=Ut.suffix,Nt=Ut.prefixCls,qt=Nt===void 0?"rc-textarea":Nt,an=Ut.classes,jt=Ut.showCount,ir=Ut.className,Cr=Ut.style,Bt=Ut.disabled,Mn=Ut.hidden,Vn=Ut.classNames,br=Ut.styles,at=Ut.onResize,$t=(0,_e.Z)(Ut,yn),In=rt(nn,{value:we,defaultValue:nn}),Jn=(0,ve.Z)(In,2),ar=Jn[0],Mr=Jn[1],$r=(0,Be.useRef)(null),Dr=Be.useState(!1),Kr=(0,ve.Z)(Dr,2),ni=Kr[0],hr=Kr[1],mi=Be.useState(!1),Ji=(0,ve.Z)(mi,2),Ui=Ji[0],Vi=Ji[1],ui=Be.useRef(),yt=Be.useRef(0),Cn=Be.useState(null),Ln=(0,ve.Z)(Cn,2),Dn=Ln[0],sr=Ln[1],nr=function(){var or;(or=$r.current)===null||or===void 0||or.textArea.focus()};(0,Be.useImperativeHandle)(Kt,function(){return{resizableTextArea:$r.current,focus:nr,blur:function(){var or;(or=$r.current)===null||or===void 0||or.textArea.blur()}}}),(0,Be.useEffect)(function(){hr(function(qn){return!Bt&&qn})},[Bt]);var gr=Number(le)>0,Fn=function(or){Vi(!0),ui.current=ar,yt.current=or.currentTarget.selectionStart,Pe==null||Pe(or)},Xe=function(or){Vi(!1);var lr=or.currentTarget.value;if(gr){var ht,st=yt.current>=le+1||yt.current===((ht=ui.current)===null||ht===void 0?void 0:ht.length);lr=nt(st,ui.current,lr,le)}lr!==ar&&(Mr(lr),(0,tt.rJ)(or.currentTarget,or,pe,lr)),Qe==null||Qe(or)},ut=function(or){var lr=or.target.value;if(!Ui&&gr){var ht=or.target.selectionStart>=le+1||or.target.selectionStart===lr.length||!or.target.selectionStart;lr=nt(ht,ar,lr,le)}Mr(lr),(0,tt.rJ)(or.currentTarget,or,pe,lr)},Lt=function(or){var lr=$t.onPressEnter,ht=$t.onKeyDown;or.key==="Enter"&&lr&&lr(or),ht==null||ht(or)},Jt=function(or){hr(!0),ue==null||ue(or)},We=function(or){hr(!1),oe==null||oe(or)},mt=function(or){var lr;Mr(""),nr(),(0,tt.rJ)((lr=$r.current)===null||lr===void 0?void 0:lr.textArea,or,pe)},zt=(0,tt.D7)(ar);!Ui&&gr&&we==null&&(zt=ot(zt,le));var Ot=It,Vt;if(jt){var Yt=(0,ke.Z)(zt).length;(0,Ve.Z)(jt)==="object"?Vt=jt.formatter({value:zt,count:Yt,maxLength:le}):Vt="".concat(Yt).concat(gr?" / ".concat(le):""),Ot=Be.createElement(Be.Fragment,null,Ot,Be.createElement("span",{className:me()("".concat(qt,"-data-count"),Vn==null?void 0:Vn.count),style:br==null?void 0:br.count},Vt))}var Hn=function(or){var lr;at==null||at(or),(lr=$r.current)!==null&&lr!==void 0&&lr.textArea.style.height&&sr(!0)},_r=!$t.autoSize&&!jt&&!fe,Qn=Be.createElement(Ee.BaseInput,{value:zt,allowClear:fe,handleReset:mt,suffix:Ot,prefixCls:qt,classes:{affixWrapper:me()(an==null?void 0:an.affixWrapper,(bn={},(0,Re.Z)(bn,"".concat(qt,"-show-count"),jt),(0,Re.Z)(bn,"".concat(qt,"-textarea-allow-clear"),fe),bn))},disabled:Bt,focused:ni,className:ir,style:(0,He.Z)((0,He.Z)({},Cr),Dn&&!_r?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof Vt=="string"?Vt:void 0}},hidden:Mn,inputElement:Be.createElement(Rn,(0,he.Z)({},$t,{onKeyDown:Lt,onChange:ut,onFocus:Jt,onBlur:We,onCompositionStart:Fn,onCompositionEnd:Xe,className:Vn==null?void 0:Vn.textarea,style:(0,He.Z)((0,He.Z)({},br==null?void 0:br.textarea),{},{resize:Cr==null?void 0:Cr.resize}),disabled:Bt,prefixCls:qt,onResize:Hn,ref:$r}))});return Qn}),rn=Tt,dn=rn},1337:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return Se}});var he=se(1413),He=`accept acceptCharset accessKey action allowFullScreen allowTransparency
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
charSet checked classID className colSpan cols content contentEditable contextMenu
controls coords crossOrigin data dateTime default defer dir disabled download draggable
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
mediaGroup method min minLength multiple muted name noValidate nonce open
optimum pattern placeholder poster preload radioGroup readOnly rel required
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
summary tabIndex target title type useMap value width wmode wrap`,Re=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,Ve="".concat(He," ").concat(Re).split(/[\s\n]+/),ve="aria-",_e="data-";function ke(me,Ee){return me.indexOf(Ee)===0}function Se(me){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,tt;Ee===!1?tt={aria:!0,data:!0,attr:!0}:Ee===!0?tt={aria:!0}:tt=(0,he.Z)({},Ee);var Be={};return Object.keys(me).forEach(function(St){(tt.aria&&(St==="role"||ke(St,ve))||tt.data&&ke(St,_e)||tt.attr&&Ve.includes(St))&&(Be[St]=me[St])}),Be}},88386:function(Sn,Wt,se){(function(he){he(se(4631))})(function(he){he.defineOption("placeholder","",function(Se,me,Ee){var tt=Ee&&Ee!=he.Init;if(me&&!tt)Se.on("blur",ve),Se.on("change",_e),Se.on("swapDoc",_e),he.on(Se.getInputField(),"compositionupdate",Se.state.placeholderCompose=function(){Ve(Se)}),_e(Se);else if(!me&&tt){Se.off("blur",ve),Se.off("change",_e),Se.off("swapDoc",_e),he.off(Se.getInputField(),"compositionupdate",Se.state.placeholderCompose),He(Se);var Be=Se.getWrapperElement();Be.className=Be.className.replace(" CodeMirror-empty","")}me&&!Se.hasFocus()&&ve(Se)});function He(Se){Se.state.placeholder&&(Se.state.placeholder.parentNode.removeChild(Se.state.placeholder),Se.state.placeholder=null)}function Re(Se){He(Se);var me=Se.state.placeholder=document.createElement("pre");me.style.cssText="height: 0; overflow: visible",me.style.direction=Se.getOption("direction"),me.className="CodeMirror-placeholder CodeMirror-line-like";var Ee=Se.getOption("placeholder");typeof Ee=="string"&&(Ee=document.createTextNode(Ee)),me.appendChild(Ee),Se.display.lineSpace.insertBefore(me,Se.display.lineSpace.firstChild)}function Ve(Se){setTimeout(function(){var me=!1,Ee=Se.getInputField();Ee.nodeName=="TEXTAREA"?me=!Ee.value:Se.lineCount()==1&&(me=!/[^\u200b]/.test(Ee.querySelector(".CodeMirror-line").textContent)),me?Re(Se):He(Se)},20)}function ve(Se){ke(Se)&&Re(Se)}function _e(Se){var me=Se.getWrapperElement(),Ee=ke(Se);me.className=me.className.replace(" CodeMirror-empty","")+(Ee?" CodeMirror-empty":""),Ee?Re(Se):He(Se)}function ke(Se){return Se.lineCount()===1&&Se.getLine(0)===""}})},82801:function(Sn,Wt,se){(function(he){he(se(4631))})(function(he){var He={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},Re=he.Pos;he.defineOption("autoCloseBrackets",!1,function(it,Ge,De){De&&De!=he.Init&&(it.removeKeyMap(ve),it.state.closeBrackets=null),Ge&&(_e(Ve(Ge,"pairs")),it.state.closeBrackets=Ge,it.addKeyMap(ve))});function Ve(it,Ge){return Ge=="pairs"&&typeof it=="string"?it:typeof it=="object"&&it[Ge]!=null?it[Ge]:He[Ge]}var ve={Backspace:me,Enter:Ee};function _e(it){for(var Ge=0;Ge<it.length;Ge++){var De=it.charAt(Ge),At="'"+De+"'";ve[At]||(ve[At]=ke(De))}}_e(He.pairs+"`");function ke(it){return function(Ge){return Be(Ge,it)}}function Se(it){var Ge=it.state.closeBrackets;if(!Ge||Ge.override)return Ge;var De=it.getModeAt(it.getCursor());return De.closeBrackets||Ge}function me(it){var Ge=Se(it);if(!Ge||it.getOption("disableInput"))return he.Pass;for(var De=Ve(Ge,"pairs"),At=it.listSelections(),Xt=0;Xt<At.length;Xt++){if(!At[Xt].empty())return he.Pass;var rt=St(it,At[Xt].head);if(!rt||De.indexOf(rt)%2!=0)return he.Pass}for(var Xt=At.length-1;Xt>=0;Xt--){var ft=At[Xt].head;it.replaceRange("",Re(ft.line,ft.ch-1),Re(ft.line,ft.ch+1),"+delete")}}function Ee(it){var Ge=Se(it),De=Ge&&Ve(Ge,"explode");if(!De||it.getOption("disableInput"))return he.Pass;for(var At=it.listSelections(),Xt=0;Xt<At.length;Xt++){if(!At[Xt].empty())return he.Pass;var rt=St(it,At[Xt].head);if(!rt||De.indexOf(rt)%2!=0)return he.Pass}it.operation(function(){var ft=it.lineSeparator()||`
`;it.replaceSelection(ft+ft,null),it.execCommand("goCharLeft"),At=it.listSelections();for(var Ie=0;Ie<At.length;Ie++){var xe=At[Ie].head.line;it.indentLine(xe,null,!0),it.indentLine(xe+1,null,!0)}})}function tt(it){var Ge=he.cmpPos(it.anchor,it.head)>0;return{anchor:new Re(it.anchor.line,it.anchor.ch+(Ge?-1:1)),head:new Re(it.head.line,it.head.ch+(Ge?1:-1))}}function Be(it,Ge){var De=Se(it);if(!De||it.getOption("disableInput"))return he.Pass;var At=Ve(De,"pairs"),Xt=At.indexOf(Ge);if(Xt==-1)return he.Pass;for(var rt=Ve(De,"closeBefore"),ft=Ve(De,"triples"),Ie=At.charAt(Xt+1)==Ge,xe=it.listSelections(),Ue=Xt%2==0,je,_t=0;_t<xe.length;_t++){var Ct=xe[_t],Dt=Ct.head,qe,Rt=it.getRange(Dt,Re(Dt.line,Dt.ch+1));if(Ue&&!Ct.empty())qe="surround";else if((Ie||!Ue)&&Rt==Ge)Ie&&dt(it,Dt)?qe="both":ft.indexOf(Ge)>=0&&it.getRange(Dt,Re(Dt.line,Dt.ch+3))==Ge+Ge+Ge?qe="skipThree":qe="skip";else if(Ie&&Dt.ch>1&&ft.indexOf(Ge)>=0&&it.getRange(Re(Dt.line,Dt.ch-2),Dt)==Ge+Ge){if(Dt.ch>2&&/\bstring/.test(it.getTokenTypeAt(Re(Dt.line,Dt.ch-2))))return he.Pass;qe="addFour"}else if(Ie){var Pt=Dt.ch==0?" ":it.getRange(Re(Dt.line,Dt.ch-1),Dt);if(!he.isWordChar(Rt)&&Pt!=Ge&&!he.isWordChar(Pt))qe="both";else return he.Pass}else if(Ue&&(Rt.length===0||/\s/.test(Rt)||rt.indexOf(Rt)>-1))qe="both";else return he.Pass;if(!je)je=qe;else if(je!=qe)return he.Pass}var En=Xt%2?At.charAt(Xt-1):Ge,tn=Xt%2?Ge:At.charAt(Xt+1);it.operation(function(){if(je=="skip")it.execCommand("goCharRight");else if(je=="skipThree")for(var $n=0;$n<3;$n++)it.execCommand("goCharRight");else if(je=="surround"){for(var ur=it.getSelections(),$n=0;$n<ur.length;$n++)ur[$n]=En+ur[$n]+tn;it.replaceSelections(ur,"around"),ur=it.listSelections().slice();for(var $n=0;$n<ur.length;$n++)ur[$n]=tt(ur[$n]);it.setSelections(ur)}else je=="both"?(it.replaceSelection(En+tn,null),it.triggerElectric(En+tn),it.execCommand("goCharLeft")):je=="addFour"&&(it.replaceSelection(En+En+En+En,"before"),it.execCommand("goCharRight"))})}function St(it,Ge){var De=it.getRange(Re(Ge.line,Ge.ch-1),Re(Ge.line,Ge.ch+1));return De.length==2?De:null}function dt(it,Ge){var De=it.getTokenAt(Re(Ge.line,Ge.ch+1));return/\bstring/.test(De.type)&&De.start==Ge.ch&&(Ge.ch==0||!/\bstring/.test(it.getTokenTypeAt(Ge)))}})},57341:function(Sn,Wt,se){(function(he){he(se(4631),se(4786))})(function(he){he.defineOption("autoCloseTags",!1,function(me,Ee,tt){if(tt!=he.Init&&tt&&me.removeKeyMap("autoCloseTags"),!!Ee){var Be={name:"autoCloseTags"};(typeof Ee!="object"||Ee.whenClosing!==!1)&&(Be["'/'"]=function(St){return _e(St)}),(typeof Ee!="object"||Ee.whenOpening!==!1)&&(Be["'>'"]=function(St){return Ve(St)}),me.addKeyMap(Be)}});var He=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],Re=["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 Ve(me){if(me.getOption("disableInput"))return he.Pass;for(var Ee=me.listSelections(),tt=[],Be=me.getOption("autoCloseTags"),St=0;St<Ee.length;St++){if(!Ee[St].empty())return he.Pass;var dt=Ee[St].head,it=me.getTokenAt(dt),Ge=he.innerMode(me.getMode(),it.state),De=Ge.state,At=Ge.mode.xmlCurrentTag&&Ge.mode.xmlCurrentTag(De),Xt=At&&At.name;if(!Xt)return he.Pass;var rt=Ge.mode.configuration=="html",ft=typeof Be=="object"&&Be.dontCloseTags||rt&&He,Ie=typeof Be=="object"&&Be.indentTags||rt&&Re;it.end>dt.ch&&(Xt=Xt.slice(0,Xt.length-it.end+dt.ch));var xe=Xt.toLowerCase();if(!Xt||it.type=="string"&&(it.end!=dt.ch||!/[\"\']/.test(it.string.charAt(it.string.length-1))||it.string.length==1)||it.type=="tag"&&At.close||it.string.indexOf("/")==dt.ch-it.start-1||ft&&ke(ft,xe)>-1||Se(me,Ge.mode.xmlCurrentContext&&Ge.mode.xmlCurrentContext(De)||[],Xt,dt,!0))return he.Pass;var Ue=typeof Be=="object"&&Be.emptyTags;if(Ue&&ke(Ue,Xt)>-1){tt[St]={text:"/>",newPos:he.Pos(dt.line,dt.ch+2)};continue}var je=Ie&&ke(Ie,xe)>-1;tt[St]={indent:je,text:">"+(je?`
`:"")+"</"+Xt+">",newPos:je?he.Pos(dt.line+1,0):he.Pos(dt.line,dt.ch+1)}}for(var _t=typeof Be=="object"&&Be.dontIndentOnAutoClose,St=Ee.length-1;St>=0;St--){var Ct=tt[St];me.replaceRange(Ct.text,Ee[St].head,Ee[St].anchor,"+insert");var Dt=me.listSelections().slice(0);Dt[St]={head:Ct.newPos,anchor:Ct.newPos},me.setSelections(Dt),!_t&&Ct.indent&&(me.indentLine(Ct.newPos.line,null,!0),me.indentLine(Ct.newPos.line+1,null,!0))}}function ve(me,Ee){for(var tt=me.listSelections(),Be=[],St=Ee?"/":"</",dt=me.getOption("autoCloseTags"),it=typeof dt=="object"&&dt.dontIndentOnSlash,Ge=0;Ge<tt.length;Ge++){if(!tt[Ge].empty())return he.Pass;var De=tt[Ge].head,At=me.getTokenAt(De),Xt=he.innerMode(me.getMode(),At.state),rt=Xt.state;if(Ee&&(At.type=="string"||At.string.charAt(0)!="<"||At.start!=De.ch-1))return he.Pass;var ft,Ie=Xt.mode.name!="xml"&&me.getMode().name=="htmlmixed";if(Ie&&Xt.mode.name=="javascript")ft=St+"script";else if(Ie&&Xt.mode.name=="css")ft=St+"style";else{var xe=Xt.mode.xmlCurrentContext&&Xt.mode.xmlCurrentContext(rt);if(!xe||xe.length&&Se(me,xe,xe[xe.length-1],De))return he.Pass;ft=St+xe[xe.length-1]}me.getLine(De.line).charAt(At.end)!=">"&&(ft+=">"),Be[Ge]=ft}if(me.replaceSelections(Be),tt=me.listSelections(),!it)for(var Ge=0;Ge<tt.length;Ge++)(Ge==tt.length-1||tt[Ge].head.line<tt[Ge+1].head.line)&&me.indentLine(tt[Ge].head.line)}function _e(me){return me.getOption("disableInput")?he.Pass:ve(me,!0)}he.commands.closeTag=function(me){return ve(me)};function ke(me,Ee){if(me.indexOf)return me.indexOf(Ee);for(var tt=0,Be=me.length;tt<Be;++tt)if(me[tt]==Ee)return tt;return-1}function Se(me,Ee,tt,Be,St){if(!he.scanForClosingTag)return!1;var dt=Math.min(me.lastLine()+1,Be.line+500),it=he.scanForClosingTag(me,Be,null,dt);if(!it||it.tag!=tt)return!1;for(var Ge=St?1:0,De=Ee.length-1;De>=0&&Ee[De]==tt;De--)++Ge;Be=it.to;for(var De=1;De<Ge;De++){var At=he.scanForClosingTag(me,Be,null,dt);if(!At||At.tag!=tt)return!1;Be=At.to}return!0}})},4786:function(Sn,Wt,se){(function(he){he(se(4631))})(function(he){"use strict";var He=he.Pos;function Re(De,At){return De.line-At.line||De.ch-At.ch}var Ve="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",ve=Ve+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",_e=new RegExp("<(/?)(["+Ve+"]["+ve+"]*)","g");function ke(De,At,Xt,rt){this.line=At,this.ch=Xt,this.cm=De,this.text=De.getLine(At),this.min=rt?Math.max(rt.from,De.firstLine()):De.firstLine(),this.max=rt?Math.min(rt.to-1,De.lastLine()):De.lastLine()}function Se(De,At){var Xt=De.cm.getTokenTypeAt(He(De.line,At));return Xt&&/\btag\b/.test(Xt)}function me(De){if(!(De.line>=De.max))return De.ch=0,De.text=De.cm.getLine(++De.line),!0}function Ee(De){if(!(De.line<=De.min))return De.text=De.cm.getLine(--De.line),De.ch=De.text.length,!0}function tt(De){for(;;){var At=De.text.indexOf(">",De.ch);if(At==-1){if(me(De))continue;return}if(!Se(De,At+1)){De.ch=At+1;continue}var Xt=De.text.lastIndexOf("/",At),rt=Xt>-1&&!/\S/.test(De.text.slice(Xt+1,At));return De.ch=At+1,rt?"selfClose":"regular"}}function Be(De){for(;;){var At=De.ch?De.text.lastIndexOf("<",De.ch-1):-1;if(At==-1){if(Ee(De))continue;return}if(!Se(De,At+1)){De.ch=At;continue}_e.lastIndex=At,De.ch=At;var Xt=_e.exec(De.text);if(Xt&&Xt.index==At)return Xt}}function St(De){for(;;){_e.lastIndex=De.ch;var At=_e.exec(De.text);if(!At){if(me(De))continue;return}if(!Se(De,At.index+1)){De.ch=At.index+1;continue}return De.ch=At.index+At[0].length,At}}function dt(De){for(;;){var At=De.ch?De.text.lastIndexOf(">",De.ch-1):-1;if(At==-1){if(Ee(De))continue;return}if(!Se(De,At+1)){De.ch=At;continue}var Xt=De.text.lastIndexOf("/",At),rt=Xt>-1&&!/\S/.test(De.text.slice(Xt+1,At));return De.ch=At+1,rt?"selfClose":"regular"}}function it(De,At){for(var Xt=[];;){var rt=St(De),ft,Ie=De.line,xe=De.ch-(rt?rt[0].length:0);if(!rt||!(ft=tt(De)))return;if(ft!="selfClose")if(rt[1]){for(var Ue=Xt.length-1;Ue>=0;--Ue)if(Xt[Ue]==rt[2]){Xt.length=Ue;break}if(Ue<0&&(!At||At==rt[2]))return{tag:rt[2],from:He(Ie,xe),to:He(De.line,De.ch)}}else Xt.push(rt[2])}}function Ge(De,At){for(var Xt=[];;){var rt=dt(De);if(!rt)return;if(rt=="selfClose"){Be(De);continue}var ft=De.line,Ie=De.ch,xe=Be(De);if(!xe)return;if(xe[1])Xt.push(xe[2]);else{for(var Ue=Xt.length-1;Ue>=0;--Ue)if(Xt[Ue]==xe[2]){Xt.length=Ue;break}if(Ue<0&&(!At||At==xe[2]))return{tag:xe[2],from:He(De.line,De.ch),to:He(ft,Ie)}}}}he.registerHelper("fold","xml",function(De,At){for(var Xt=new ke(De,At.line,0);;){var rt=St(Xt);if(!rt||Xt.line!=At.line)return;var ft=tt(Xt);if(!ft)return;if(!rt[1]&&ft!="selfClose"){var Ie=He(Xt.line,Xt.ch),xe=it(Xt,rt[2]);return xe&&Re(xe.from,Ie)>0?{from:Ie,to:xe.from}:null}}}),he.findMatchingTag=function(De,At,Xt){var rt=new ke(De,At.line,At.ch,Xt);if(!(rt.text.indexOf(">")==-1&&rt.text.indexOf("<")==-1)){var ft=tt(rt),Ie=ft&&He(rt.line,rt.ch),xe=ft&&Be(rt);if(!(!ft||!xe||Re(rt,At)>0)){var Ue={from:He(rt.line,rt.ch),to:Ie,tag:xe[2]};return ft=="selfClose"?{open:Ue,close:null,at:"open"}:xe[1]?{open:Ge(rt,xe[2]),close:Ue,at:"close"}:(rt=new ke(De,Ie.line,Ie.ch,Xt),{open:Ue,close:it(rt,xe[2]),at:"open"})}}},he.findEnclosingTag=function(De,At,Xt,rt){for(var ft=new ke(De,At.line,At.ch,Xt);;){var Ie=Ge(ft,rt);if(!Ie)break;var xe=new ke(De,At.line,At.ch,Xt),Ue=it(xe,Ie.tag);if(Ue)return{open:Ie,close:Ue}}},he.scanForClosingTag=function(De,At,Xt,rt){var ft=new ke(De,At.line,At.ch,rt?{from:0,to:rt}:null);return it(ft,Xt)}})},4631:function(Sn){(function(Wt,se){Sn.exports=se()})(this,function(){"use strict";var Wt=navigator.userAgent,se=navigator.platform,he=/gecko\/\d/i.test(Wt),He=/MSIE \d/.test(Wt),Re=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Wt),Ve=/Edge\/(\d+)/.exec(Wt),ve=He||Re||Ve,_e=ve&&(He?document.documentMode||6:+(Ve||Re)[1]),ke=!Ve&&/WebKit\//.test(Wt),Se=ke&&/Qt\/\d+\.\d+/.test(Wt),me=!Ve&&/Chrome\//.test(Wt),Ee=/Opera\//.test(Wt),tt=/Apple Computer/.test(navigator.vendor),Be=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Wt),St=/PhantomJS/.test(Wt),dt=!Ve&&/AppleWebKit/.test(Wt)&&/Mobile\/\w+/.test(Wt),it=/Android/.test(Wt),Ge=dt||it||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Wt),De=dt||/Mac/.test(se),At=/\bCrOS\b/.test(Wt),Xt=/win/i.test(se),rt=Ee&&Wt.match(/Version\/(\d*\.\d*)/);rt&&(rt=Number(rt[1])),rt&&rt>=15&&(Ee=!1,ke=!0);var ft=De&&(Se||Ee&&(rt==null||rt<12.11)),Ie=he||ve&&_e>=9;function xe(x){return new RegExp("(^|\\s)"+x+"(?:$|\\s)\\s*")}var Ue=function(x,z){var ne=x.className,te=xe(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 _t(x,z){return je(x).appendChild(z)}function Ct(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 ce=0;ce<z.length;++ce)ie.appendChild(z[ce]);return ie}function Dt(x,z,ne,te){var ie=Ct(x,z,ne,te);return ie.setAttribute("role","presentation"),ie}var qe;document.createRange?qe=function(x,z,ne,te){var ie=document.createRange();return ie.setEnd(te||x,ne),ie.setStart(x,z),ie}:qe=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 Rt(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 Pt(){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 En(x,z){var ne=x.className;xe(z).test(ne)||(x.className+=(ne?" ":"")+z)}function tn(x,z){for(var ne=x.split(" "),te=0;te<ne.length;te++)ne[te]&&!xe(ne[te]).test(z)&&(z+=" "+ne[te]);return z}var $n=function(x){x.select()};dt?$n=function(x){x.selectionStart=0,x.selectionEnd=x.value.length}:ve&&($n=function(x){try{x.select()}catch(z){}});function ur(x){var z=Array.prototype.slice.call(arguments,1);return function(){return x.apply(null,z)}}function wr(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 Je(x,z,ne,te,ie){z==null&&(z=x.search(/[^\s\u00a0]/),z==-1&&(z=x.length));for(var ce=te||0,ye=ie||0;;){var Me=x.indexOf(" ",ce);if(Me<0||Me>=z)return ye+(z-ce);ye+=Me-ce,ye+=ne-ye%ne,ce=Me+1}}var Ae=function(){this.id=null,this.f=null,this.time=0,this.handler=ur(this.onTimeout,this)};Ae.prototype.onTimeout=function(x){x.id=0,x.time<=+new Date?x.f():setTimeout(x.handler,x.time-+new Date)},Ae.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 Ht(x,z){for(var ne=0;ne<x.length;++ne)if(x[ne]==z)return ne;return-1}var Rn=50,yn={toString:function(){return"CodeMirror.Pass"}},ot={scroll:!1},nt={origin:"*mouse"},Tt={origin:"+move"};function rn(x,z,ne){for(var te=0,ie=0;;){var ce=x.indexOf(" ",te);ce==-1&&(ce=x.length);var ye=ce-te;if(ce==x.length||ie+ye>=z)return te+Math.min(ye,z-ie);if(ie+=ce-te,ie+=ne-ie%ne,te=ce+1,ie>=z)return te}}var dn=[""];function Ut(x){for(;dn.length<=x;)dn.push(Kt(dn)+" ");return dn[x]}function Kt(x){return x[x.length-1]}function bn(x,z){for(var ne=[],te=0;te<x.length;te++)ne[te]=z(x[te],te);return ne}function nn(x,z,ne){for(var te=0,ie=ne(z);te<x.length&&ne(x[te])<=ie;)te++;x.splice(te,0,z)}function we(){}function ue(x,z){var ne;return Object.create?ne=Object.create(x):(we.prototype=x,ne=new we),z&&wr(z,ne),ne}var oe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function pe(x){return/\w/.test(x)||x>"\x80"&&(x.toUpperCase()!=x.toLowerCase()||oe.test(x))}function fe(x,z){return z?z.source.indexOf("\\w")>-1&&pe(x)?!0:z.test(x):pe(x)}function le(x){for(var z in x)if(x.hasOwnProperty(z)&&x[z])return!1;return!0}var Pe=/[\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 Qe(x){return x.charCodeAt(0)>=768&&Pe.test(x)}function It(x,z,ne){for(;(ne<0?z>0:z<x.length)&&Qe(x.charAt(z));)z+=ne;return z}function Nt(x,z,ne){for(var te=z>ne?-1:1;;){if(z==ne)return z;var ie=(z+ne)/2,ce=te<0?Math.ceil(ie):Math.floor(ie);if(ce==z)return x(ce)?z:ne;x(ce)?ne=ce:z=ce+te}}function qt(x,z,ne,te){if(!x)return te(z,ne,"ltr",0);for(var ie=!1,ce=0;ce<x.length;++ce){var ye=x[ce];(ye.from<ne&&ye.to>z||z==ne&&ye.to==z)&&(te(Math.max(ye.from,z),Math.min(ye.to,ne),ye.level==1?"rtl":"ltr",ce),ie=!0)}ie||te(z,ne,"ltr")}var an=null;function jt(x,z,ne){var te;an=null;for(var ie=0;ie<x.length;++ie){var ce=x[ie];if(ce.from<z&&ce.to>z)return ie;ce.to==z&&(ce.from!=ce.to&&ne=="before"?te=ie:an=ie),ce.from==z&&(ce.from!=ce.to&&ne!="before"?te=ie:an=ie)}return te!=null?te:an}var ir=function(){var x="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",z="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function ne(Ne){return Ne<=247?x.charAt(Ne):1424<=Ne&&Ne<=1524?"R":1536<=Ne&&Ne<=1785?z.charAt(Ne-1536):1774<=Ne&&Ne<=2220?"r":8192<=Ne&&Ne<=8203?"w":Ne==8204?"b":"L"}var te=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,ie=/[stwN]/,ce=/[LRr]/,ye=/[Lb1n]/,Me=/[1n]/;function Te(Ne,pt,kt){this.level=Ne,this.from=pt,this.to=kt}return function(Ne,pt){var kt=pt=="ltr"?"L":"R";if(Ne.length==0||pt=="ltr"&&!te.test(Ne))return!1;for(var hn=Ne.length,en=[],Yn=0;Yn<hn;++Yn)en.push(ne(Ne.charCodeAt(Yn)));for(var mr=0,Br=kt;mr<hn;++mr){var Gr=en[mr];Gr=="m"?en[mr]=Br:Br=Gr}for(var ii=0,jr=kt;ii<hn;++ii){var ai=en[ii];ai=="1"&&jr=="r"?en[ii]="n":ce.test(ai)&&(jr=ai,ai=="r"&&(en[ii]="R"))}for(var Fi=1,Hi=en[0];Fi<hn-1;++Fi){var ba=en[Fi];ba=="+"&&Hi=="1"&&en[Fi+1]=="1"?en[Fi]="1":ba==","&&Hi==en[Fi+1]&&(Hi=="1"||Hi=="n")&&(en[Fi]=Hi),Hi=ba}for(var to=0;to<hn;++to){var Wo=en[to];if(Wo==",")en[to]="N";else if(Wo=="%"){var bo=void 0;for(bo=to+1;bo<hn&&en[bo]=="%";++bo);for(var us=to&&en[to-1]=="!"||bo<hn&&en[bo]=="1"?"1":"N",ds=to;ds<bo;++ds)en[ds]=us;to=bo-1}}for(var Io=0,fs=kt;Io<hn;++Io){var sa=en[Io];fs=="L"&&sa=="1"?en[Io]="L":ce.test(sa)&&(fs=sa)}for(var So=0;So<hn;++So)if(ie.test(en[So])){var xo=void 0;for(xo=So+1;xo<hn&&ie.test(en[xo]);++xo);for(var Co=(So?en[So-1]:kt)=="L",ko=(xo<hn?en[xo]:kt)=="L",Wl=Co==ko?Co?"L":"R":kt,ys=So;ys<xo;++ys)en[ys]=Wl;So=xo-1}for(var Go=[],Wa,No=0;No<hn;)if(ye.test(en[No])){var Eu=No;for(++No;No<hn&&ye.test(en[No]);++No);Go.push(new Te(0,Eu,No))}else{var sl=No,xl=Go.length,js=pt=="rtl"?1:0;for(++No;No<hn&&en[No]!="L";++No);for(var Po=sl;Po<No;)if(Me.test(en[Po])){sl<Po&&(Go.splice(xl,0,new Te(1,sl,Po)),xl+=js);var Zl=Po;for(++Po;Po<No&&Me.test(en[Po]);++Po);Go.splice(xl,0,new Te(2,Zl,Po)),xl+=js,sl=Po}else++Po;sl<No&&Go.splice(xl,0,new Te(1,sl,No))}return pt=="ltr"&&(Go[0].level==1&&(Wa=Ne.match(/^\s+/))&&(Go[0].from=Wa[0].length,Go.unshift(new Te(0,0,Wa[0].length))),Kt(Go).level==1&&(Wa=Ne.match(/\s+$/))&&(Kt(Go).to-=Wa[0].length,Go.push(new Te(0,hn-Wa[0].length,hn)))),pt=="rtl"?Go.reverse():Go}}();function Cr(x,z){var ne=x.order;return ne==null&&(ne=x.order=ir(x.text,z)),ne}var Bt=[],Mn=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]||Bt).concat(ne)}};function Vn(x,z){return x._handlers&&x._handlers[z]||Bt}function br(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 ce=Ht(ie,ne);ce>-1&&(te[z]=ie.slice(0,ce).concat(ie.slice(ce+1)))}}}function at(x,z){var ne=Vn(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 $t(x,z,ne){return typeof z=="string"&&(z={type:z,preventDefault:function(){this.defaultPrevented=!0}}),at(x,ne||z.type,x,z),Dr(z)||z.codemirrorIgnore}function In(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)Ht(ne,z[te])==-1&&ne.push(z[te])}function Jn(x,z){return Vn(x,z).length>0}function ar(x){x.prototype.on=function(z,ne){Mn(this,z,ne)},x.prototype.off=function(z,ne){br(this,z,ne)}}function Mr(x){x.preventDefault?x.preventDefault():x.returnValue=!1}function $r(x){x.stopPropagation?x.stopPropagation():x.cancelBubble=!0}function Dr(x){return x.defaultPrevented!=null?x.defaultPrevented:x.returnValue==!1}function Kr(x){Mr(x),$r(x)}function ni(x){return x.target||x.srcElement}function hr(x){var z=x.which;return z==null&&(x.button&1?z=1:x.button&2?z=3:x.button&4&&(z=2)),De&&x.ctrlKey&&z==1&&(z=3),z}var mi=function(){if(ve&&_e<9)return!1;var x=Ct("div");return"draggable"in x||"dragDrop"in x}(),Ji;function Ui(x){if(Ji==null){var z=Ct("span","\u200B");_t(x,Ct("span",[z,document.createTextNode("x")])),x.firstChild.offsetHeight!=0&&(Ji=z.offsetWidth<=1&&z.offsetHeight>2&&!(ve&&_e<8))}var ne=Ji?Ct("span","\u200B"):Ct("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return ne.setAttribute("cm-text",""),ne}var Vi;function ui(x){if(Vi!=null)return Vi;var z=_t(x,document.createTextNode("A\u062EA")),ne=qe(z,0,1).getBoundingClientRect(),te=qe(z,1,2).getBoundingClientRect();return je(x),!ne||ne.left==ne.right?!1:Vi=te.right-ne.right<3}var yt=`
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 ce=x.slice(z,x.charAt(ie-1)=="\r"?ie-1:ie),ye=ce.indexOf("\r");ye!=-1?(ne.push(ce.slice(0,ye)),z+=ye+1):(ne.push(ce),z=ie+1)}return ne}:function(x){return x.split(/\r\n?|\n/)},Cn=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},Ln=function(){var x=Ct("div");return"oncopy"in x?!0:(x.setAttribute("oncopy","return;"),typeof x.oncopy=="function")}(),Dn=null;function sr(x){if(Dn!=null)return Dn;var z=_t(x,Ct("span","x")),ne=z.getBoundingClientRect(),te=qe(z,0,1).getBoundingClientRect();return Dn=Math.abs(ne.left-te.left)>1}var nr={},gr={};function Fn(x,z){arguments.length>2&&(z.dependencies=Array.prototype.slice.call(arguments,2)),nr[x]=z}function Xe(x,z){gr[x]=z}function ut(x){if(typeof x=="string"&&gr.hasOwnProperty(x))x=gr[x];else if(x&&typeof x.name=="string"&&gr.hasOwnProperty(x.name)){var z=gr[x.name];typeof z=="string"&&(z={name:z}),x=ue(z,x),x.name=z.name}else{if(typeof x=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(x))return ut("application/xml");if(typeof x=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(x))return ut("application/json")}return typeof x=="string"?{name:x}:x||{name:"null"}}function Lt(x,z){z=ut(z);var ne=nr[z.name];if(!ne)return Lt(x,"text/plain");var te=ne(x,z);if(Jt.hasOwnProperty(z.name)){var ie=Jt[z.name];for(var ce in ie)ie.hasOwnProperty(ce)&&(te.hasOwnProperty(ce)&&(te["_"+ce]=te[ce]),te[ce]=ie[ce])}if(te.name=z.name,z.helperType&&(te.helperType=z.helperType),z.modeProps)for(var ye in z.modeProps)te[ye]=z.modeProps[ye];return te}var Jt={};function We(x,z){var ne=Jt.hasOwnProperty(x)?Jt[x]:Jt[x]={};wr(z,ne)}function mt(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 zt(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 Ot(x,z,ne){return x.startState?x.startState(z,ne):!0}var Vt=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};Vt.prototype.eol=function(){return this.pos>=this.string.length},Vt.prototype.sol=function(){return this.pos==this.lineStart},Vt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Vt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Vt.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},Vt.prototype.eatWhile=function(x){for(var z=this.pos;this.eat(x););return this.pos>z},Vt.prototype.eatSpace=function(){for(var x=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>x},Vt.prototype.skipToEnd=function(){this.pos=this.string.length},Vt.prototype.skipTo=function(x){var z=this.string.indexOf(x,this.pos);if(z>-1)return this.pos=z,!0},Vt.prototype.backUp=function(x){this.pos-=x},Vt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Je(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Je(this.string,this.lineStart,this.tabSize):0)},Vt.prototype.indentation=function(){return Je(this.string,null,this.tabSize)-(this.lineStart?Je(this.string,this.lineStart,this.tabSize):0)},Vt.prototype.match=function(x,z,ne){if(typeof x=="string"){var te=function(ye){return ne?ye.toLowerCase():ye},ie=this.string.substr(this.pos,x.length);if(te(ie)==te(x))return z!==!1&&(this.pos+=x.length),!0}else{var ce=this.string.slice(this.pos).match(x);return ce&&ce.index>0?null:(ce&&z!==!1&&(this.pos+=ce[0].length),ce)}},Vt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Vt.prototype.hideFirstChars=function(x,z){this.lineStart+=x;try{return z()}finally{this.lineStart-=x}},Vt.prototype.lookAhead=function(x){var z=this.lineOracle;return z&&z.lookAhead(x)},Vt.prototype.baseToken=function(){var x=this.lineOracle;return x&&x.baseToken(this.pos)};function Yt(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],ce=ie.chunkSize();if(z<ce){ne=ie;break}z-=ce}return ne.lines[z]}function Hn(x,z,ne){var te=[],ie=z.line;return x.iter(z.line,ne.line+1,function(ce){var ye=ce.text;ie==ne.line&&(ye=ye.slice(0,ne.ch)),ie==z.line&&(ye=ye.slice(z.ch)),te.push(ye),++ie}),te}function _r(x,z,ne){var te=[];return x.iter(z,ne,function(ie){te.push(ie.text)}),te}function Qn(x,z){var ne=z-x.height;if(ne)for(var te=x;te;te=te.parent)te.height+=ne}function qn(x){if(x.parent==null)return null;for(var z=x.parent,ne=Ht(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 or(x,z){var ne=x.first;e:do{for(var te=0;te<x.children.length;++te){var ie=x.children[te],ce=ie.height;if(z<ce){x=ie;continue e}z-=ce,ne+=ie.chunkSize()}return ne}while(!x.lines);for(var ye=0;ye<x.lines.length;++ye){var Me=x.lines[ye],Te=Me.height;if(z<Te)break;z-=Te}return ne+ye}function lr(x,z){return z>=x.first&&z<x.first+x.size}function ht(x,z){return String(x.lineNumberFormatter(z+x.firstLineNumber))}function st(x,z,ne){if(ne===void 0&&(ne=null),!(this instanceof st))return new st(x,z,ne);this.line=x,this.ch=z,this.sticky=ne}function bt(x,z){return x.line-z.line||x.ch-z.ch}function ln(x,z){return x.sticky==z.sticky&&bt(x,z)==0}function Pn(x){return st(x.line,x.ch)}function cn(x,z){return bt(x,z)<0?z:x}function pn(x,z){return bt(x,z)<0?x:z}function mn(x,z){return Math.max(x.first,Math.min(z,x.first+x.size-1))}function On(x,z){if(z.line<x.first)return st(x.first,0);var ne=x.first+x.size-1;return z.line>ne?st(ne,Yt(x,ne).text.length):cr(z,Yt(x,z.line).text.length)}function cr(x,z){var ne=x.ch;return ne==null||ne>z?st(x.line,z):ne<0?st(x.line,0):x}function Gt(x,z){for(var ne=[],te=0;te<z.length;te++)ne[te]=On(x,z[te]);return ne}var Jr=function(x,z){this.state=x,this.lookAhead=z},Zr=function(x,z,ne,te){this.state=z,this.doc=x,this.line=ne,this.maxLookAhead=te||0,this.baseTokens=null,this.baseTokenPos=1};Zr.prototype.lookAhead=function(x){var z=this.doc.getLine(this.line+x);return z!=null&&x>this.maxLookAhead&&(this.maxLookAhead=x),z},Zr.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}},Zr.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Zr.fromSaved=function(x,z,ne){return z instanceof Jr?new Zr(x,mt(x.mode,z.state),ne,z.lookAhead):new Zr(x,mt(x.mode,z),ne)},Zr.prototype.save=function(x){var z=x!==!1?mt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Jr(z,this.maxLookAhead):z};function Bi(x,z,ne,te){var ie=[x.state.modeGen],ce={};vi(x,z.text,x.doc.mode,ne,function(Ne,pt){return ie.push(Ne,pt)},ce,te);for(var ye=ne.state,Me=function(Ne){ne.baseTokens=ie;var pt=x.state.overlays[Ne],kt=1,hn=0;ne.state=!0,vi(x,z.text,pt.mode,ne,function(en,Yn){for(var mr=kt;hn<en;){var Br=ie[kt];Br>en&&ie.splice(kt,1,en,ie[kt+1],Br),kt+=2,hn=Math.min(en,Br)}if(Yn)if(pt.opaque)ie.splice(mr,kt-mr,en,"overlay "+Yn),kt=mr+2;else for(;mr<kt;mr+=2){var Gr=ie[mr+1];ie[mr+1]=(Gr?Gr+" ":"")+"overlay "+Yn}},ce),ne.state=ye,ne.baseTokens=null,ne.baseTokenPos=1},Te=0;Te<x.state.overlays.length;++Te)Me(Te);return{styles:ie,classes:ce.bgClass||ce.textClass?ce:null}}function Li(x,z,ne){if(!z.styles||z.styles[0]!=x.state.modeGen){var te=gi(x,qn(z)),ie=z.text.length>x.options.maxHighlightLength&&mt(x.doc.mode,te.state),ce=Bi(x,z,te);ie&&(te.state=ie),z.stateAfter=te.save(!ie),z.styles=ce.styles,ce.classes?z.styleClasses=ce.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 gi(x,z,ne){var te=x.doc,ie=x.display;if(!te.mode.startState)return new Zr(te,!0,z);var ce=Wi(x,z,ne),ye=ce>te.first&&Yt(te,ce-1).stateAfter,Me=ye?Zr.fromSaved(te,ye,ce):new Zr(te,Ot(te.mode),ce);return te.iter(ce,z,function(Te){Yi(x,Te.text,Me);var Ne=Me.line;Te.stateAfter=Ne==z-1||Ne%5==0||Ne>=ie.viewFrom&&Ne<ie.viewTo?Me.save():null,Me.nextLine()}),ne&&(te.modeFrontier=Me.line),Me}function Yi(x,z,ne,te){var ie=x.doc.mode,ce=new Vt(z,x.options.tabSize,ne);for(ce.start=ce.pos=te||0,z==""&&xi(ie,ne.state);!ce.eol();)oi(ie,ce,ne.state),ce.start=ce.pos}function xi(x,z){if(x.blankLine)return x.blankLine(z);if(x.innerMode){var ne=zt(x,z);if(ne.mode.blankLine)return ne.mode.blankLine(ne.state)}}function oi(x,z,ne,te){for(var ie=0;ie<10;ie++){te&&(te[0]=zt(x,ne).mode);var ce=x.token(z,ne);if(z.pos>z.start)return ce}throw new Error("Mode "+x.name+" failed to advance stream.")}var Ri=function(x,z,ne){this.start=x.start,this.end=x.pos,this.string=x.current(),this.type=z||null,this.state=ne};function ji(x,z,ne,te){var ie=x.doc,ce=ie.mode,ye;z=On(ie,z);var Me=Yt(ie,z.line),Te=gi(x,z.line,ne),Ne=new Vt(Me.text,x.options.tabSize,Te),pt;for(te&&(pt=[]);(te||Ne.pos<z.ch)&&!Ne.eol();)Ne.start=Ne.pos,ye=oi(ce,Ne,Te.state),te&&pt.push(new Ri(Ne,ye,mt(ie.mode,Te.state)));return te?pt:new Ri(Ne,ye,Te.state)}function Yr(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 vi(x,z,ne,te,ie,ce,ye){var Me=ne.flattenSpans;Me==null&&(Me=x.options.flattenSpans);var Te=0,Ne=null,pt=new Vt(z,x.options.tabSize,te),kt,hn=x.options.addModeClass&&[null];for(z==""&&Yr(xi(ne,te.state),ce);!pt.eol();){if(pt.pos>x.options.maxHighlightLength?(Me=!1,ye&&Yi(x,z,te,pt.pos),pt.pos=z.length,kt=null):kt=Yr(oi(ne,pt,te.state,hn),ce),hn){var en=hn[0].name;en&&(kt="m-"+(kt?en+" "+kt:en))}if(!Me||Ne!=kt){for(;Te<pt.start;)Te=Math.min(pt.start,Te+5e3),ie(Te,Ne);Ne=kt}pt.start=pt.pos}for(;Te<pt.pos;){var Yn=Math.min(pt.pos,Te+5e3);ie(Yn,Ne),Te=Yn}}function Wi(x,z,ne){for(var te,ie,ce=x.doc,ye=ne?-1:z-(x.doc.mode.innerMode?1e3:100),Me=z;Me>ye;--Me){if(Me<=ce.first)return ce.first;var Te=Yt(ce,Me-1),Ne=Te.stateAfter;if(Ne&&(!ne||Me+(Ne instanceof Jr?Ne.lookAhead:0)<=ce.modeFrontier))return Me;var pt=Je(Te.text,null,x.options.tabSize);(ie==null||te>pt)&&(ie=Me-1,te=pt)}return ie}function la(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=Yt(x,te).stateAfter;if(ie&&(!(ie instanceof Jr)||te+ie.lookAhead<z)){ne=te+1;break}}x.highlightFrontier=Math.min(x.highlightFrontier,ne)}}var ta=!1,ri=!1;function xt(){ta=!0}function vt(){ri=!0}function Zt(x,z,ne){this.marker=x,this.from=z,this.to=ne}function fn(x,z){if(x)for(var ne=0;ne<x.length;++ne){var te=x[ne];if(te.marker==z)return te}}function Tn(x,z){for(var ne,te=0;te<x.length;++te)x[te]!=z&&(ne||(ne=[])).push(x[te]);return ne}function pr(x,z){x.markedSpans=x.markedSpans?x.markedSpans.concat([z]):[z],z.marker.attachLine(x)}function Ar(x,z,ne){var te;if(x)for(var ie=0;ie<x.length;++ie){var ce=x[ie],ye=ce.marker,Me=ce.from==null||(ye.inclusiveLeft?ce.from<=z:ce.from<z);if(Me||ce.from==z&&ye.type=="bookmark"&&(!ne||!ce.marker.insertLeft)){var Te=ce.to==null||(ye.inclusiveRight?ce.to>=z:ce.to>z);(te||(te=[])).push(new Zt(ye,ce.from,Te?null:ce.to))}}return te}function Wr(x,z,ne){var te;if(x)for(var ie=0;ie<x.length;++ie){var ce=x[ie],ye=ce.marker,Me=ce.to==null||(ye.inclusiveRight?ce.to>=z:ce.to>z);if(Me||ce.from==z&&ye.type=="bookmark"&&(!ne||ce.marker.insertLeft)){var Te=ce.from==null||(ye.inclusiveLeft?ce.from<=z:ce.from<z);(te||(te=[])).push(new Zt(ye,Te?null:ce.from-z,ce.to==null?null:ce.to-z))}}return te}function Vr(x,z){if(z.full)return null;var ne=lr(x,z.from.line)&&Yt(x,z.from.line).markedSpans,te=lr(x,z.to.line)&&Yt(x,z.to.line).markedSpans;if(!ne&&!te)return null;var ie=z.from.ch,ce=z.to.ch,ye=bt(z.from,z.to)==0,Me=Ar(ne,ie,ye),Te=Wr(te,ce,ye),Ne=z.text.length==1,pt=Kt(z.text).length+(Ne?ie:0);if(Me)for(var kt=0;kt<Me.length;++kt){var hn=Me[kt];if(hn.to==null){var en=fn(Te,hn.marker);en?Ne&&(hn.to=en.to==null?null:en.to+pt):hn.to=ie}}if(Te)for(var Yn=0;Yn<Te.length;++Yn){var mr=Te[Yn];if(mr.to!=null&&(mr.to+=pt),mr.from==null){var Br=fn(Me,mr.marker);Br||(mr.from=pt,Ne&&(Me||(Me=[])).push(mr))}else mr.from+=pt,Ne&&(Me||(Me=[])).push(mr)}Me&&(Me=Hr(Me)),Te&&Te!=Me&&(Te=Hr(Te));var Gr=[Me];if(!Ne){var ii=z.text.length-2,jr;if(ii>0&&Me)for(var ai=0;ai<Me.length;++ai)Me[ai].to==null&&(jr||(jr=[])).push(new Zt(Me[ai].marker,null,null));for(var Fi=0;Fi<ii;++Fi)Gr.push(jr);Gr.push(Te)}return Gr}function Hr(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 ti(x,z,ne){var te=null;if(x.iter(z.line,ne.line+1,function(en){if(en.markedSpans)for(var Yn=0;Yn<en.markedSpans.length;++Yn){var mr=en.markedSpans[Yn].marker;mr.readOnly&&(!te||Ht(te,mr)==-1)&&(te||(te=[])).push(mr)}}),!te)return null;for(var ie=[{from:z,to:ne}],ce=0;ce<te.length;++ce)for(var ye=te[ce],Me=ye.find(0),Te=0;Te<ie.length;++Te){var Ne=ie[Te];if(!(bt(Ne.to,Me.from)<0||bt(Ne.from,Me.to)>0)){var pt=[Te,1],kt=bt(Ne.from,Me.from),hn=bt(Ne.to,Me.to);(kt<0||!ye.inclusiveLeft&&!kt)&&pt.push({from:Ne.from,to:Me.from}),(hn>0||!ye.inclusiveRight&&!hn)&&pt.push({from:Me.to,to:Ne.to}),ie.splice.apply(ie,pt),Te+=pt.length-3}}return ie}function yi(x){var z=x.markedSpans;if(z){for(var ne=0;ne<z.length;++ne)z[ne].marker.detachLine(x);x.markedSpans=null}}function Lr(x,z){if(z){for(var ne=0;ne<z.length;++ne)z[ne].marker.attachLine(x);x.markedSpans=z}}function hi(x){return x.inclusiveLeft?-1:0}function Ai(x){return x.inclusiveRight?1:0}function Mi(x,z){var ne=x.lines.length-z.lines.length;if(ne!=0)return ne;var te=x.find(),ie=z.find(),ce=bt(te.from,ie.from)||hi(x)-hi(z);if(ce)return-ce;var ye=bt(te.to,ie.to)||Ai(x)-Ai(z);return ye||z.id-x.id}function Le(x,z){var ne=ri&&x.markedSpans,te;if(ne)for(var ie=void 0,ce=0;ce<ne.length;++ce)ie=ne[ce],ie.marker.collapsed&&(z?ie.from:ie.to)==null&&(!te||Mi(te,ie.marker)<0)&&(te=ie.marker);return te}function Fe(x){return Le(x,!0)}function ze(x){return Le(x,!1)}function Ze(x,z){var ne=ri&&x.markedSpans,te;if(ne)for(var ie=0;ie<ne.length;++ie){var ce=ne[ie];ce.marker.collapsed&&(ce.from==null||ce.from<z)&&(ce.to==null||ce.to>z)&&(!te||Mi(te,ce.marker)<0)&&(te=ce.marker)}return te}function et(x,z,ne,te,ie){var ce=Yt(x,z),ye=ri&&ce.markedSpans;if(ye)for(var Me=0;Me<ye.length;++Me){var Te=ye[Me];if(Te.marker.collapsed){var Ne=Te.marker.find(0),pt=bt(Ne.from,ne)||hi(Te.marker)-hi(ie),kt=bt(Ne.to,te)||Ai(Te.marker)-Ai(ie);if(!(pt>=0&&kt<=0||pt<=0&&kt>=0)&&(pt<=0&&(Te.marker.inclusiveRight&&ie.inclusiveLeft?bt(Ne.to,ne)>=0:bt(Ne.to,ne)>0)||pt>=0&&(Te.marker.inclusiveRight&&ie.inclusiveLeft?bt(Ne.from,te)<=0:bt(Ne.from,te)<0)))return!0}}}function lt(x){for(var z;z=Fe(x);)x=z.find(-1,!0).line;return x}function wt(x){for(var z;z=ze(x);)x=z.find(1,!0).line;return x}function Qt(x){for(var z,ne;z=ze(x);)x=z.find(1,!0).line,(ne||(ne=[])).push(x);return ne}function sn(x,z){var ne=Yt(x,z),te=lt(ne);return ne==te?z:qn(te)}function Xn(x,z){if(z>x.lastLine())return z;var ne=Yt(x,z),te;if(!vr(x,ne))return z;for(;te=ze(ne);)ne=te.find(1,!0).line;return qn(ne)+1}function vr(x,z){var ne=ri&&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&&Zn(x,z,te))return!0}}}function Zn(x,z,ne){if(ne.to==null){var te=ne.marker.find(1,!0);return Zn(x,te.line,fn(te.line.markedSpans,ne.marker))}if(ne.marker.inclusiveRight&&ne.to==z.text.length)return!0;for(var ie=void 0,ce=0;ce<z.markedSpans.length;++ce)if(ie=z.markedSpans[ce],ie.marker.collapsed&&!ie.marker.widgetNode&&ie.from==ne.to&&(ie.to==null||ie.to!=ne.from)&&(ie.marker.inclusiveLeft||ne.marker.inclusiveRight)&&Zn(x,z,ie))return!0}function xn(x){x=lt(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 ce=ne.parent;ce;ne=ce,ce=ne.parent)for(var ye=0;ye<ce.children.length;++ye){var Me=ce.children[ye];if(Me==ne)break;z+=Me.height}return z}function gn(x){if(x.height==0)return 0;for(var z=x.text.length,ne,te=x;ne=Fe(te);){var ie=ne.find(0,!0);te=ie.from.line,z+=ie.from.ch-ie.to.ch}for(te=x;ne=ze(te);){var ce=ne.find(0,!0);z-=te.text.length-ce.from.ch,te=ce.to.line,z+=te.text.length-ce.to.ch}return z}function An(x){var z=x.display,ne=x.doc;z.maxLine=Yt(ne,ne.first),z.maxLineLength=gn(z.maxLine),z.maxLineChanged=!0,ne.iter(function(te){var ie=gn(te);ie>z.maxLineLength&&(z.maxLineLength=ie,z.maxLine=te)})}var Bn=function(x,z,ne){this.text=x,Lr(this,z),this.height=ne?ne(this):1};Bn.prototype.lineNo=function(){return qn(this)},ar(Bn);function fr(x,z,ne,te){x.text=z,x.stateAfter&&(x.stateAfter=null),x.styles&&(x.styles=null),x.order!=null&&(x.order=null),yi(x),Lr(x,ne);var ie=te?te(x):1;ie!=x.height&&Qn(x,ie)}function Gn(x){x.parent=null,yi(x)}var jn={},er={};function tr(x,z){if(!x||/^\s*$/.test(x))return null;var ne=z.addModeClass?er:jn;return ne[x]||(ne[x]=x.replace(/\S+/g,"cm-$&"))}function yr(x,z){var ne=Dt("span",null,null,ke?"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 ce=ie?z.rest[ie-1]:z.line,ye=void 0;te.pos=0,te.addToken=Ke,ui(x.display.measure)&&(ye=Cr(ce,x.doc.direction))&&(te.addToken=ct(te.addToken,ye)),te.map=[];var Me=z!=x.display.externalMeasured&&qn(ce);un(ce,te,Li(x,ce,Me)),ce.styleClasses&&(ce.styleClasses.bgClass&&(te.bgClass=tn(ce.styleClasses.bgClass,te.bgClass||"")),ce.styleClasses.textClass&&(te.textClass=tn(ce.styleClasses.textClass,te.textClass||""))),te.map.length==0&&te.map.push(0,0,te.content.appendChild(Ui(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(ke){var Te=te.content.lastChild;(/\bcm-tab\b/.test(Te.className)||Te.querySelector&&Te.querySelector(".cm-tab"))&&(te.content.className="cm-tab-wrap-hack")}return at(x,"renderLine",x,z.line,te.pre),te.pre.className&&(te.textClass=tn(te.pre.className,te.textClass||"")),te}function Oe(x){var z=Ct("span","\u2022","cm-invalidchar");return z.title="\\u"+x.charCodeAt(0).toString(16),z.setAttribute("aria-label",z.title),z}function Ke(x,z,ne,te,ie,ce,ye){if(z){var Me=x.splitSpaces?Mt(z,x.trailingSpace):z,Te=x.cm.state.specialChars,Ne=!1,pt;if(!Te.test(z))x.col+=z.length,pt=document.createTextNode(Me),x.map.push(x.pos,x.pos+z.length,pt),ve&&_e<9&&(Ne=!0),x.pos+=z.length;else{pt=document.createDocumentFragment();for(var kt=0;;){Te.lastIndex=kt;var hn=Te.exec(z),en=hn?hn.index-kt:z.length-kt;if(en){var Yn=document.createTextNode(Me.slice(kt,kt+en));ve&&_e<9?pt.appendChild(Ct("span",[Yn])):pt.appendChild(Yn),x.map.push(x.pos,x.pos+en,Yn),x.col+=en,x.pos+=en}if(!hn)break;kt+=en+1;var mr=void 0;if(hn[0]==" "){var Br=x.cm.options.tabSize,Gr=Br-x.col%Br;mr=pt.appendChild(Ct("span",Ut(Gr),"cm-tab")),mr.setAttribute("role","presentation"),mr.setAttribute("cm-text"," "),x.col+=Gr}else hn[0]=="\r"||hn[0]==`
`?(mr=pt.appendChild(Ct("span",hn[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),mr.setAttribute("cm-text",hn[0]),x.col+=1):(mr=x.cm.options.specialCharPlaceholder(hn[0]),mr.setAttribute("cm-text",hn[0]),ve&&_e<9?pt.appendChild(Ct("span",[mr])):pt.appendChild(mr),x.col+=1);x.map.push(x.pos,x.pos+1,mr),x.pos++}}if(x.trailingSpace=Me.charCodeAt(z.length-1)==32,ne||te||ie||Ne||ce||ye){var ii=ne||"";te&&(ii+=te),ie&&(ii+=ie);var jr=Ct("span",[pt],ii,ce);if(ye)for(var ai in ye)ye.hasOwnProperty(ai)&&ai!="style"&&ai!="class"&&jr.setAttribute(ai,ye[ai]);return x.content.appendChild(jr)}x.content.appendChild(pt)}}function Mt(x,z){if(x.length>1&&!/ /.test(x))return x;for(var ne=z,te="",ie=0;ie<x.length;ie++){var ce=x.charAt(ie);ce==" "&&ne&&(ie==x.length-1||x.charCodeAt(ie+1)==32)&&(ce="\xA0"),te+=ce,ne=ce==" "}return te}function ct(x,z){return function(ne,te,ie,ce,ye,Me,Te){ie=ie?ie+" cm-force-border":"cm-force-border";for(var Ne=ne.pos,pt=Ne+te.length;;){for(var kt=void 0,hn=0;hn<z.length&&(kt=z[hn],!(kt.to>Ne&&kt.from<=Ne));hn++);if(kt.to>=pt)return x(ne,te,ie,ce,ye,Me,Te);x(ne,te.slice(0,kt.to-Ne),ie,ce,null,Me,Te),ce=null,te=te.slice(kt.to-Ne),Ne=kt.to}}}function Ft(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 un(x,z,ne){var te=x.markedSpans,ie=x.text,ce=0;if(!te){for(var ye=1;ye<ne.length;ye+=2)z.addToken(z,ie.slice(ce,ce=ne[ye]),tr(ne[ye+1],z.cm.options));return}for(var Me=ie.length,Te=0,Ne=1,pt="",kt,hn,en=0,Yn,mr,Br,Gr,ii;;){if(en==Te){Yn=mr=Br=hn="",ii=null,Gr=null,en=1/0;for(var jr=[],ai=void 0,Fi=0;Fi<te.length;++Fi){var Hi=te[Fi],ba=Hi.marker;if(ba.type=="bookmark"&&Hi.from==Te&&ba.widgetNode)jr.push(ba);else if(Hi.from<=Te&&(Hi.to==null||Hi.to>Te||ba.collapsed&&Hi.to==Te&&Hi.from==Te)){if(Hi.to!=null&&Hi.to!=Te&&en>Hi.to&&(en=Hi.to,mr=""),ba.className&&(Yn+=" "+ba.className),ba.css&&(hn=(hn?hn+";":"")+ba.css),ba.startStyle&&Hi.from==Te&&(Br+=" "+ba.startStyle),ba.endStyle&&Hi.to==en&&(ai||(ai=[])).push(ba.endStyle,Hi.to),ba.title&&((ii||(ii={})).title=ba.title),ba.attributes)for(var to in ba.attributes)(ii||(ii={}))[to]=ba.attributes[to];ba.collapsed&&(!Gr||Mi(Gr.marker,ba)<0)&&(Gr=Hi)}else Hi.from>Te&&en>Hi.from&&(en=Hi.from)}if(ai)for(var Wo=0;Wo<ai.length;Wo+=2)ai[Wo+1]==en&&(mr+=" "+ai[Wo]);if(!Gr||Gr.from==Te)for(var bo=0;bo<jr.length;++bo)Ft(z,0,jr[bo]);if(Gr&&(Gr.from||0)==Te){if(Ft(z,(Gr.to==null?Me+1:Gr.to)-Te,Gr.marker,Gr.from==null),Gr.to==null)return;Gr.to==Te&&(Gr=!1)}}if(Te>=Me)break;for(var us=Math.min(Me,en);;){if(pt){var ds=Te+pt.length;if(!Gr){var Io=ds>us?pt.slice(0,us-Te):pt;z.addToken(z,Io,kt?kt+Yn:Yn,Br,Te+Io.length==en?mr:"",hn,ii)}if(ds>=us){pt=pt.slice(us-Te),Te=us;break}Te=ds,Br=""}pt=ie.slice(ce,ce=ne[Ne++]),kt=tr(ne[Ne++],z.cm.options)}}}function vn(x,z,ne){this.line=z,this.rest=Qt(z),this.size=this.rest?qn(Kt(this.rest))-ne+1:1,this.node=this.text=null,this.hidden=vr(x,z)}function Nn(x,z,ne){for(var te=[],ie,ce=z;ce<ne;ce=ie){var ye=new vn(x.doc,Yt(x.doc,ce),ce);ie=ce+ye.size,te.push(ye)}return te}var kn=null;function on(x){kn?kn.ops.push(x):x.ownsGroup=kn={ops:[x],delayedCallbacks:[]}}function zn(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 Wn(x,z){var ne=x.ownsGroup;if(ne)try{zn(ne)}finally{kn=null,z(ne)}}var xr=null;function Kn(x,z){var ne=Vn(x,z);if(ne.length){var te=Array.prototype.slice.call(arguments,2),ie;kn?ie=kn.delayedCallbacks:xr?ie=xr:(ie=xr=[],setTimeout(Pr,0));for(var ce=function(Me){ie.push(function(){return ne[Me].apply(null,te)})},ye=0;ye<ne.length;++ye)ce(ye)}}function Pr(){var x=xr;xr=null;for(var z=0;z<x.length;++z)x[z]()}function Xr(x,z,ne,te){for(var ie=0;ie<z.changes.length;ie++){var ce=z.changes[ie];ce=="text"?Fr(x,z):ce=="gutter"?si(x,z,ne,te):ce=="class"?Qr(x,z):ce=="widget"&&Nr(x,z,te)}z.changes=null}function Rr(x){return x.node==x.text&&(x.node=Ct("div",null,null,"position: relative"),x.text.parentNode&&x.text.parentNode.replaceChild(x.node,x.text),x.node.appendChild(x.text),ve&&_e<8&&(x.node.style.zIndex=2)),x.node}function Ur(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=Rr(z);z.background=te.insertBefore(Ct("div",null,ne),te.firstChild),x.display.input.setUneditable(z.background)}}function Er(x,z){var ne=x.display.externalMeasured;return ne&&ne.line==z.line?(x.display.externalMeasured=null,z.measure=ne.measure,ne.built):yr(x,z)}function Fr(x,z){var ne=z.text.className,te=Er(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,Qr(x,z)):ne&&(z.text.className=ne)}function Qr(x,z){Ur(x,z),z.line.wrapClass?Rr(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 si(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=Rr(z);z.gutterBackground=Ct("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 ce=z.line.gutterMarkers;if(x.options.lineNumbers||ce){var ye=Rr(z),Me=z.gutter=Ct("div",null,"CodeMirror-gutter-wrapper","left: "+(x.options.fixedGutter?te.fixedPos:-te.gutterTotalWidth)+"px");if(x.display.input.setUneditable(Me),ye.insertBefore(Me,z.text),z.line.gutterClass&&(Me.className+=" "+z.line.gutterClass),x.options.lineNumbers&&(!ce||!ce["CodeMirror-linenumbers"])&&(z.lineNumber=Me.appendChild(Ct("div",ht(x.options,ne),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+te.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+x.display.lineNumInnerWidth+"px"))),ce)for(var Te=0;Te<x.display.gutterSpecs.length;++Te){var Ne=x.display.gutterSpecs[Te].className,pt=ce.hasOwnProperty(Ne)&&ce[Ne];pt&&Me.appendChild(Ct("div",[pt],"CodeMirror-gutter-elt","left: "+te.gutterLeft[Ne]+"px; width: "+te.gutterWidth[Ne]+"px"))}}}function Nr(x,z,ne){z.alignable&&(z.alignable=null);for(var te=xe("CodeMirror-linewidget"),ie=z.node.firstChild,ce=void 0;ie;ie=ce)ce=ie.nextSibling,te.test(ie.className)&&z.node.removeChild(ie);Pi(x,z,ne)}function di(x,z,ne,te){var ie=Er(x,z);return z.text=z.node=ie.pre,ie.bgClass&&(z.bgClass=ie.bgClass),ie.textClass&&(z.textClass=ie.textClass),Qr(x,z),si(x,z,ne,te),Pi(x,z,te),z.node}function Pi(x,z,ne){if(na(x,z.line,z,ne,!0),z.rest)for(var te=0;te<z.rest.length;te++)na(x,z.rest[te],z,ne,!1)}function na(x,z,ne,te,ie){if(z.widgets)for(var ce=Rr(ne),ye=0,Me=z.widgets;ye<Me.length;++ye){var Te=Me[ye],Ne=Ct("div",[Te.node],"CodeMirror-linewidget"+(Te.className?" "+Te.className:""));Te.handleMouseEvents||Ne.setAttribute("cm-ignore-events","true"),Gi(Te,Ne,ne,te),x.display.input.setUneditable(Ne),ie&&Te.above?ce.insertBefore(Ne,ne.gutter||ne.text):ce.appendChild(Ne),Kn(Te,"redraw")}}function Gi(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 Ni(x){if(x.height!=null)return x.height;var z=x.doc.cm;if(!z)return 0;if(!Rt(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;"),_t(z.display.measure,Ct("div",[x.node],null,ne))}return x.height=x.node.parentNode.offsetHeight}function qi(x,z){for(var ne=ni(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 Qi(x){return x.lineSpace.offsetTop}function wi(x){return x.mover.offsetHeight-x.lineSpace.offsetHeight}function $i(x){if(x.cachedPaddingH)return x.cachedPaddingH;var z=_t(x.measure,Ct("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 qr(x){return Rn-x.display.nativeBarWidth}function fi(x){return x.display.scroller.clientWidth-qr(x)-x.display.barWidth}function Ti(x){return x.display.scroller.clientHeight-qr(x)-x.display.barHeight}function Xi(x,z,ne){var te=x.options.lineWrapping,ie=te&&fi(x);if(!z.measure.heights||te&&z.measure.width!=ie){var ce=z.measure.heights=[];if(te){z.measure.width=ie;for(var ye=z.text.firstChild.getClientRects(),Me=0;Me<ye.length-1;Me++){var Te=ye[Me],Ne=ye[Me+1];Math.abs(Te.bottom-Ne.bottom)>2&&ce.push((Te.bottom+Ne.top)/2-ne.top)}}ce.push(ne.bottom-ne.top)}}function Na(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(qn(x.rest[ie])>ne)return{map:x.measure.maps[ie],cache:x.measure.caches[ie],before:!0}}function $a(x,z){z=lt(z);var ne=qn(z),te=x.display.externalMeasured=new vn(x.doc,z,ne);te.lineN=ne;var ie=te.built=yr(x,te);return te.text=ie.pre,_t(x.display.lineMeasure,ie.pre),te}function Aa(x,z,ne,te){return Ei(x,ea(x,z),ne,te)}function ca(x,z){if(z>=x.display.viewFrom&&z<x.display.viewTo)return x.display.view[ra(x,z)];var ne=x.display.externalMeasured;if(ne&&z>=ne.lineN&&z<ne.lineN+ne.size)return ne}function ea(x,z){var ne=qn(z),te=ca(x,ne);te&&!te.text?te=null:te&&te.changes&&(Xr(x,te,ne,ho(x)),x.curOp.forceUpdate=!0),te||(te=$a(x,z));var ie=Na(te,z,ne);return{line:z,view:te,rect:null,map:ie.map,cache:ie.cache,before:ie.before,hasHeights:!1}}function Ei(x,z,ne,te,ie){z.before&&(ne=-1);var ce=ne+(te||""),ye;return z.cache.hasOwnProperty(ce)?ye=z.cache[ce]:(z.rect||(z.rect=z.view.text.getBoundingClientRect()),z.hasHeights||(Xi(x,z.view,z.rect),z.hasHeights=!0),ye=zi(x,z,ne,te),ye.bogus||(z.cache[ce]=ye)),{left:ye.left,right:ye.right,top:ie?ye.rtop:ye.top,bottom:ie?ye.rbottom:ye.bottom}}var Oa={left:0,right:0,top:0,bottom:0};function ki(x,z,ne){for(var te,ie,ce,ye,Me,Te,Ne=0;Ne<x.length;Ne+=3)if(Me=x[Ne],Te=x[Ne+1],z<Me?(ie=0,ce=1,ye="left"):z<Te?(ie=z-Me,ce=ie+1):(Ne==x.length-3||z==Te&&x[Ne+3]>z)&&(ce=Te-Me,ie=ce-1,z>=Te&&(ye="right")),ie!=null){if(te=x[Ne+2],Me==Te&&ne==(te.insertLeft?"left":"right")&&(ye=ne),ne=="left"&&ie==0)for(;Ne&&x[Ne-2]==x[Ne-3]&&x[Ne-1].insertLeft;)te=x[(Ne-=3)+2],ye="left";if(ne=="right"&&ie==Te-Me)for(;Ne<x.length-3&&x[Ne+3]==x[Ne+4]&&!x[Ne+5].insertLeft;)te=x[(Ne+=3)+2],ye="right";break}return{node:te,start:ie,end:ce,collapse:ye,coverStart:Me,coverEnd:Te}}function ei(x,z){var ne=Oa;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 zi(x,z,ne,te){var ie=ki(z.map,ne,te),ce=ie.node,ye=ie.start,Me=ie.end,Te=ie.collapse,Ne;if(ce.nodeType==3){for(var pt=0;pt<4;pt++){for(;ye&&Qe(z.line.text.charAt(ie.coverStart+ye));)--ye;for(;ie.coverStart+Me<ie.coverEnd&&Qe(z.line.text.charAt(ie.coverStart+Me));)++Me;if(ve&&_e<9&&ye==0&&Me==ie.coverEnd-ie.coverStart?Ne=ce.parentNode.getBoundingClientRect():Ne=ei(qe(ce,ye,Me).getClientRects(),te),Ne.left||Ne.right||ye==0)break;Me=ye,ye=ye-1,Te="right"}ve&&_e<11&&(Ne=ua(x.display.measure,Ne))}else{ye>0&&(Te=te="right");var kt;x.options.lineWrapping&&(kt=ce.getClientRects()).length>1?Ne=kt[te=="right"?kt.length-1:0]:Ne=ce.getBoundingClientRect()}if(ve&&_e<9&&!ye&&(!Ne||!Ne.left&&!Ne.right)){var hn=ce.parentNode.getClientRects()[0];hn?Ne={left:hn.left,right:hn.left+io(x.display),top:hn.top,bottom:hn.bottom}:Ne=Oa}for(var en=Ne.top-z.rect.top,Yn=Ne.bottom-z.rect.top,mr=(en+Yn)/2,Br=z.view.measure.heights,Gr=0;Gr<Br.length-1&&!(mr<Br[Gr]);Gr++);var ii=Gr?Br[Gr-1]:0,jr=Br[Gr],ai={left:(Te=="right"?Ne.right:Ne.left)-z.rect.left,right:(Te=="left"?Ne.left:Ne.right)-z.rect.left,top:ii,bottom:jr};return!Ne.left&&!Ne.right&&(ai.bogus=!0),x.options.singleCursorHeightPerLine||(ai.rtop=en,ai.rbottom=Yn),ai}function ua(x,z){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!sr(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 Zi(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 aa(x){x.display.externalMeasure=null,je(x.display.lineMeasure);for(var z=0;z<x.display.view.length;z++)Zi(x.display.view[z])}function pi(x){aa(x),x.display.cachedCharWidth=x.display.cachedTextHeight=x.display.cachedPaddingH=null,x.options.lineWrapping||(x.display.maxLineChanged=!0),x.display.lineNumChars=null}function pa(){return me&&it?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function xa(){return me&&it?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function fa(x){var z=0;if(x.widgets)for(var ne=0;ne<x.widgets.length;++ne)x.widgets[ne].above&&(z+=Ni(x.widgets[ne]));return z}function wa(x,z,ne,te,ie){if(!ie){var ce=fa(z);ne.top+=ce,ne.bottom+=ce}if(te=="line")return ne;te||(te="local");var ye=xn(z);if(te=="local"?ye+=Qi(x.display):ye-=x.display.viewOffset,te=="page"||te=="window"){var Me=x.display.lineSpace.getBoundingClientRect();ye+=Me.top+(te=="window"?0:xa());var Te=Me.left+(te=="window"?0:pa());ne.left+=Te,ne.right+=Te}return ne.top+=ye,ne.bottom+=ye,ne}function Ea(x,z,ne){if(ne=="div")return z;var te=z.left,ie=z.top;if(ne=="page")te-=pa(),ie-=xa();else if(ne=="local"||!ne){var ce=x.display.sizer.getBoundingClientRect();te+=ce.left,ie+=ce.top}var ye=x.display.lineSpace.getBoundingClientRect();return{left:te-ye.left,top:ie-ye.top}}function ja(x,z,ne,te,ie){return te||(te=Yt(x.doc,z.line)),wa(x,te,Aa(x,te,z.ch,ie),ne)}function ha(x,z,ne,te,ie,ce){te=te||Yt(x.doc,z.line),ie||(ie=ea(x,te));function ye(Yn,mr){var Br=Ei(x,ie,Yn,mr?"right":"left",ce);return mr?Br.left=Br.right:Br.right=Br.left,wa(x,te,Br,ne)}var Me=Cr(te,x.doc.direction),Te=z.ch,Ne=z.sticky;if(Te>=te.text.length?(Te=te.text.length,Ne="before"):Te<=0&&(Te=0,Ne="after"),!Me)return ye(Ne=="before"?Te-1:Te,Ne=="before");function pt(Yn,mr,Br){var Gr=Me[mr],ii=Gr.level==1;return ye(Br?Yn-1:Yn,ii!=Br)}var kt=jt(Me,Te,Ne),hn=an,en=pt(Te,kt,Ne=="before");return hn!=null&&(en.other=pt(Te,hn,Ne!="before")),en}function ka(x,z){var ne=0;z=On(x.doc,z),x.options.lineWrapping||(ne=io(x.display)*z.ch);var te=Yt(x.doc,z.line),ie=xn(te)+Qi(x.display);return{left:ne,right:ne,top:ie,bottom:ie+te.height}}function Ja(x,z,ne,te,ie){var ce=st(x,z,ne);return ce.xRel=ie,te&&(ce.outside=te),ce}function Ga(x,z,ne){var te=x.doc;if(ne+=x.display.viewOffset,ne<0)return Ja(te.first,0,null,-1,-1);var ie=or(te,ne),ce=te.first+te.size-1;if(ie>ce)return Ja(te.first+te.size-1,Yt(te,ce).text.length,null,1,1);z<0&&(z=0);for(var ye=Yt(te,ie);;){var Me=_i(x,ye,ie,z,ne),Te=Ze(ye,Me.ch+(Me.xRel>0||Me.outside>0?1:0));if(!Te)return Me;var Ne=Te.find(1);if(Ne.line==ie)return Ne;ye=Yt(te,ie=Ne.line)}}function so(x,z,ne,te){te-=fa(z);var ie=z.text.length,ce=Nt(function(ye){return Ei(x,ne,ye-1).bottom<=te},ie,0);return ie=Nt(function(ye){return Ei(x,ne,ye).top>te},ce,ie),{begin:ce,end:ie}}function Fa(x,z,ne,te){ne||(ne=ea(x,z));var ie=wa(x,z,Ei(x,ne,te),"line").top;return so(x,z,ne,ie)}function Ca(x,z,ne,te){return x.bottom<=ne?!1:x.top>ne?!0:(te?x.left:x.right)>z}function _i(x,z,ne,te,ie){ie-=xn(z);var ce=ea(x,z),ye=fa(z),Me=0,Te=z.text.length,Ne=!0,pt=Cr(z,x.doc.direction);if(pt){var kt=(x.options.lineWrapping?da:Ki)(x,z,ne,ce,pt,te,ie);Ne=kt.level!=1,Me=Ne?kt.from:kt.to-1,Te=Ne?kt.to:kt.from-1}var hn=null,en=null,Yn=Nt(function(Fi){var Hi=Ei(x,ce,Fi);return Hi.top+=ye,Hi.bottom+=ye,Ca(Hi,te,ie,!1)?(Hi.top<=ie&&Hi.left<=te&&(hn=Fi,en=Hi),!0):!1},Me,Te),mr,Br,Gr=!1;if(en){var ii=te-en.left<en.right-te,jr=ii==Ne;Yn=hn+(jr?0:1),Br=jr?"after":"before",mr=ii?en.left:en.right}else{!Ne&&(Yn==Te||Yn==Me)&&Yn++,Br=Yn==0?"after":Yn==z.text.length?"before":Ei(x,ce,Yn-(Ne?1:0)).bottom+ye<=ie==Ne?"after":"before";var ai=ha(x,st(ne,Yn,Br),"line",z,ce);mr=ai.left,Gr=ie<ai.top?-1:ie>=ai.bottom?1:0}return Yn=It(z.text,Yn,1),Ja(ne,Yn,Br,Gr,te-mr)}function Ki(x,z,ne,te,ie,ce,ye){var Me=Nt(function(kt){var hn=ie[kt],en=hn.level!=1;return Ca(ha(x,st(ne,en?hn.to:hn.from,en?"before":"after"),"line",z,te),ce,ye,!0)},0,ie.length-1),Te=ie[Me];if(Me>0){var Ne=Te.level!=1,pt=ha(x,st(ne,Ne?Te.from:Te.to,Ne?"after":"before"),"line",z,te);Ca(pt,ce,ye,!0)&&pt.top>ye&&(Te=ie[Me-1])}return Te}function da(x,z,ne,te,ie,ce,ye){var Me=so(x,z,te,ye),Te=Me.begin,Ne=Me.end;/\s/.test(z.text.charAt(Ne-1))&&Ne--;for(var pt=null,kt=null,hn=0;hn<ie.length;hn++){var en=ie[hn];if(!(en.from>=Ne||en.to<=Te)){var Yn=en.level!=1,mr=Ei(x,te,Yn?Math.min(Ne,en.to)-1:Math.max(Te,en.from)).right,Br=mr<ce?ce-mr+1e9:mr-ce;(!pt||kt>Br)&&(pt=en,kt=Br)}}return pt||(pt=ie[ie.length-1]),pt.from<Te&&(pt={from:Te,to:pt.to,level:pt.level}),pt.to>Ne&&(pt={from:pt.from,to:Ne,level:pt.level}),pt}var Sa;function Ka(x){if(x.cachedTextHeight!=null)return x.cachedTextHeight;if(Sa==null){Sa=Ct("pre",null,"CodeMirror-line-like");for(var z=0;z<49;++z)Sa.appendChild(document.createTextNode("x")),Sa.appendChild(Ct("br"));Sa.appendChild(document.createTextNode("x"))}_t(x.measure,Sa);var ne=Sa.offsetHeight/50;return ne>3&&(x.cachedTextHeight=ne),je(x.measure),ne||1}function io(x){if(x.cachedCharWidth!=null)return x.cachedCharWidth;var z=Ct("span","xxxxxxxxxx"),ne=Ct("pre",[z],"CodeMirror-line-like");_t(x.measure,ne);var te=z.getBoundingClientRect(),ie=(te.right-te.left)/10;return ie>2&&(x.cachedCharWidth=ie),ie||10}function ho(x){for(var z=x.display,ne={},te={},ie=z.gutters.clientLeft,ce=z.gutters.firstChild,ye=0;ce;ce=ce.nextSibling,++ye){var Me=x.display.gutterSpecs[ye].className;ne[Me]=ce.offsetLeft+ce.clientLeft+ie,te[Me]=ce.clientWidth}return{fixedPos:Oo(z),gutterTotalWidth:z.gutters.offsetWidth,gutterLeft:ne,gutterWidth:te,wrapperWidth:z.wrapper.clientWidth}}function Oo(x){return x.scroller.getBoundingClientRect().left-x.sizer.getBoundingClientRect().left}function Bo(x){var z=Ka(x.display),ne=x.options.lineWrapping,te=ne&&Math.max(5,x.display.scroller.clientWidth/io(x.display)-3);return function(ie){if(vr(x.doc,ie))return 0;var ce=0;if(ie.widgets)for(var ye=0;ye<ie.widgets.length;ye++)ie.widgets[ye].height&&(ce+=ie.widgets[ye].height);return ne?ce+(Math.ceil(ie.text.length/te)||1)*z:ce+z}}function lo(x){var z=x.doc,ne=Bo(x);z.iter(function(te){var ie=ne(te);ie!=te.height&&Qn(te,ie)})}function Ao(x,z,ne,te){var ie=x.display;if(!ne&&ni(z).getAttribute("cm-not-content")=="true")return null;var ce,ye,Me=ie.lineSpace.getBoundingClientRect();try{ce=z.clientX-Me.left,ye=z.clientY-Me.top}catch(kt){return null}var Te=Ga(x,ce,ye),Ne;if(te&&Te.xRel>0&&(Ne=Yt(x.doc,Te.line).text).length==Te.ch){var pt=Je(Ne,Ne.length,x.options.tabSize)-Ne.length;Te=st(Te.line,Math.max(0,Math.round((ce-$i(x.display).left)/io(x.display))-pt))}return Te}function ra(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 Oi(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)ri&&sn(x.doc,z)<ie.viewTo&&_a(x);else if(ne<=ie.viewFrom)ri&&Xn(x.doc,ne+te)>ie.viewFrom?_a(x):(ie.viewFrom+=te,ie.viewTo+=te);else if(z<=ie.viewFrom&&ne>=ie.viewTo)_a(x);else if(z<=ie.viewFrom){var ce=co(x,ne,ne+te,1);ce?(ie.view=ie.view.slice(ce.index),ie.viewFrom=ce.lineN,ie.viewTo+=te):_a(x)}else if(ne>=ie.viewTo){var ye=co(x,z,z,-1);ye?(ie.view=ie.view.slice(0,ye.index),ie.viewTo=ye.lineN):_a(x)}else{var Me=co(x,z,z,-1),Te=co(x,ne,ne+te,1);Me&&Te?(ie.view=ie.view.slice(0,Me.index).concat(Nn(x,Me.lineN,Te.lineN)).concat(ie.view.slice(Te.index)),ie.viewTo+=te):_a(x)}var Ne=ie.externalMeasured;Ne&&(ne<Ne.lineN?Ne.lineN+=te:z<Ne.lineN+Ne.size&&(ie.externalMeasured=null))}function Ta(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 ce=te.view[ra(x,z)];if(ce.node!=null){var ye=ce.changes||(ce.changes=[]);Ht(ye,ne)==-1&&ye.push(ne)}}}function _a(x){x.display.viewFrom=x.display.viewTo=x.doc.first,x.display.view=[],x.display.viewOffset=0}function co(x,z,ne,te){var ie=ra(x,z),ce,ye=x.display.view;if(!ri||ne==x.doc.first+x.doc.size)return{index:ie,lineN:ne};for(var Me=x.display.viewFrom,Te=0;Te<ie;Te++)Me+=ye[Te].size;if(Me!=z){if(te>0){if(ie==ye.length-1)return null;ce=Me+ye[ie].size-z,ie++}else ce=Me-z;z+=ce,ne+=ce}for(;sn(x.doc,ne)!=ne;){if(ie==(te<0?0:ye.length-1))return null;ne+=te*ye[ie-(te<0?1:0)].size,ie+=te}return{index:ie,lineN:ne}}function ao(x,z,ne){var te=x.display,ie=te.view;ie.length==0||z>=te.viewTo||ne<=te.viewFrom?(te.view=Nn(x,z,ne),te.viewFrom=z):(te.viewFrom>z?te.view=Nn(x,z,te.viewFrom).concat(te.view):te.viewFrom<z&&(te.view=te.view.slice(ra(x,z))),te.viewFrom=z,te.viewTo<ne?te.view=te.view.concat(Nn(x,te.viewTo,ne)):te.viewTo>ne&&(te.view=te.view.slice(0,ra(x,ne)))),te.viewTo=ne}function hs(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 Qo(x){x.display.input.showSelection(x.display.input.prepareSelection())}function ps(x,z){z===void 0&&(z=!0);for(var ne=x.doc,te={},ie=te.cursors=document.createDocumentFragment(),ce=te.selection=document.createDocumentFragment(),ye=0;ye<ne.sel.ranges.length;ye++)if(!(!z&&ye==ne.sel.primIndex)){var Me=ne.sel.ranges[ye];if(!(Me.from().line>=x.display.viewTo||Me.to().line<x.display.viewFrom)){var Te=Me.empty();(Te||x.options.showCursorWhenSelecting)&&oa(x,Me.head,ie),Te||Si(x,Me,ce)}}return te}function oa(x,z,ne){var te=ha(x,z,"div",null,null,!x.options.singleCursorHeightPerLine),ie=ne.appendChild(Ct("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 ce=ne.appendChild(Ct("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));ce.style.display="",ce.style.left=te.other.left+"px",ce.style.top=te.other.top+"px",ce.style.height=(te.other.bottom-te.other.top)*.85+"px"}}function Or(x,z){return x.top-z.top||x.left-z.left}function Si(x,z,ne){var te=x.display,ie=x.doc,ce=document.createDocumentFragment(),ye=$i(x.display),Me=ye.left,Te=Math.max(te.sizerWidth,fi(x)-te.sizer.offsetLeft)-ye.right,Ne=ie.direction=="ltr";function pt(jr,ai,Fi,Hi){ai<0&&(ai=0),ai=Math.round(ai),Hi=Math.round(Hi),ce.appendChild(Ct("div",null,"CodeMirror-selected","position: absolute; left: "+jr+`px;
top: `+ai+"px; width: "+(Fi==null?Te-jr:Fi)+`px;
height: `+(Hi-ai)+"px"))}function kt(jr,ai,Fi){var Hi=Yt(ie,jr),ba=Hi.text.length,to,Wo;function bo(Io,fs){return ja(x,st(jr,Io),"div",Hi,fs)}function us(Io,fs,sa){var So=Fa(x,Hi,null,Io),xo=fs=="ltr"==(sa=="after")?"left":"right",Co=sa=="after"?So.begin:So.end-(/\s/.test(Hi.text.charAt(So.end-1))?2:1);return bo(Co,xo)[xo]}var ds=Cr(Hi,ie.direction);return qt(ds,ai||0,Fi==null?ba:Fi,function(Io,fs,sa,So){var xo=sa=="ltr",Co=bo(Io,xo?"left":"right"),ko=bo(fs-1,xo?"right":"left"),Wl=ai==null&&Io==0,ys=Fi==null&&fs==ba,Go=So==0,Wa=!ds||So==ds.length-1;if(ko.top-Co.top<=3){var No=(Ne?Wl:ys)&&Go,Eu=(Ne?ys:Wl)&&Wa,sl=No?Me:(xo?Co:ko).left,xl=Eu?Te:(xo?ko:Co).right;pt(sl,Co.top,xl-sl,Co.bottom)}else{var js,Po,Zl,Xo;xo?(js=Ne&&Wl&&Go?Me:Co.left,Po=Ne?Te:us(Io,sa,"before"),Zl=Ne?Me:us(fs,sa,"after"),Xo=Ne&&ys&&Wa?Te:ko.right):(js=Ne?us(Io,sa,"before"):Me,Po=!Ne&&Wl&&Go?Te:Co.right,Zl=!Ne&&ys&&Wa?Me:ko.left,Xo=Ne?us(fs,sa,"after"):Te),pt(js,Co.top,Po-js,Co.bottom),Co.bottom<ko.top&&pt(Me,Co.bottom,null,ko.top),pt(Zl,ko.top,Xo-Zl,ko.bottom)}(!to||Or(Co,to)<0)&&(to=Co),Or(ko,to)<0&&(to=ko),(!Wo||Or(Co,Wo)<0)&&(Wo=Co),Or(ko,Wo)<0&&(Wo=ko)}),{start:to,end:Wo}}var hn=z.from(),en=z.to();if(hn.line==en.line)kt(hn.line,hn.ch,en.ch);else{var Yn=Yt(ie,hn.line),mr=Yt(ie,en.line),Br=lt(Yn)==lt(mr),Gr=kt(hn.line,hn.ch,Br?Yn.text.length+1:null).end,ii=kt(en.line,Br?0:null,en.ch).start;Br&&(Gr.top<ii.top-2?(pt(Gr.right,Gr.top,null,Gr.bottom),pt(Me,ii.top,ii.left,ii.bottom)):pt(Gr.right,Gr.top,ii.left-Gr.right,Gr.bottom)),Gr.bottom<ii.top&&pt(Me,Gr.bottom,null,ii.top)}ne.appendChild(ce)}function Ci(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()||Fo(x),z.cursorDiv.style.visibility=(ne=!ne)?"":"hidden"},x.options.cursorBlinkRate):x.options.cursorBlinkRate<0&&(z.cursorDiv.style.visibility="hidden")}}function Di(x){x.state.focused||(x.display.input.focus(),Va(x))}function Ha(x){x.state.delayingBlurEvent=!0,setTimeout(function(){x.state.delayingBlurEvent&&(x.state.delayingBlurEvent=!1,Fo(x))},100)}function Va(x,z){x.state.delayingBlurEvent&&(x.state.delayingBlurEvent=!1),x.options.readOnly!="nocursor"&&(x.state.focused||(at(x,"focus",x,z),x.state.focused=!0,En(x.display.wrapper,"CodeMirror-focused"),!x.curOp&&x.display.selForContextMenu!=x.doc.sel&&(x.display.input.reset(),ke&&setTimeout(function(){return x.display.input.reset(!0)},20)),x.display.input.receivedFocus()),Ci(x))}function Fo(x,z){x.state.delayingBlurEvent||(x.state.focused&&(at(x,"blur",x,z),x.state.focused=!1,Ue(x.display.wrapper,"CodeMirror-focused")),clearInterval(x.display.blinker),setTimeout(function(){x.state.focused||(x.display.shift=!1)},150))}function Zo(x){for(var z=x.display,ne=z.lineDiv.offsetTop,te=0;te<z.view.length;te++){var ie=z.view[te],ce=x.options.lineWrapping,ye=void 0,Me=0;if(!ie.hidden){if(ve&&_e<8){var Te=ie.node.offsetTop+ie.node.offsetHeight;ye=Te-ne,ne=Te}else{var Ne=ie.node.getBoundingClientRect();ye=Ne.bottom-Ne.top,!ce&&ie.text.firstChild&&(Me=ie.text.firstChild.getBoundingClientRect().right-Ne.left-1)}var pt=ie.line.height-ye;if((pt>.005||pt<-.005)&&(Qn(ie.line,ye),ls(ie.line),ie.rest))for(var kt=0;kt<ie.rest.length;kt++)ls(ie.rest[kt]);if(Me>x.display.sizerWidth){var hn=Math.ceil(Me/io(x.display));hn>x.display.maxLineLength&&(x.display.maxLineLength=hn,x.display.maxLine=ie.line,x.display.maxLineChanged=!0)}}}}function ls(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 va(x,z,ne){var te=ne&&ne.top!=null?Math.max(0,ne.top):x.scroller.scrollTop;te=Math.floor(te-Qi(x));var ie=ne&&ne.bottom!=null?ne.bottom:te+x.wrapper.clientHeight,ce=or(z,te),ye=or(z,ie);if(ne&&ne.ensure){var Me=ne.ensure.from.line,Te=ne.ensure.to.line;Me<ce?(ce=Me,ye=or(z,xn(Yt(z,Me))+x.wrapper.clientHeight)):Math.min(Te,z.lastLine())>=ye&&(ce=or(z,xn(Yt(z,Te))-x.wrapper.clientHeight),ye=Te)}return{from:ce,to:Math.max(ye,ce+1)}}function Ro(x,z){if(!$t(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&&!St){var ce=Ct("div","\u200B",null,`position: absolute;
top: `+(z.top-ne.viewOffset-Qi(x.display))+`px;
height: `+(z.bottom-z.top+qr(x)+ne.barHeight)+`px;
left: `+z.left+"px; width: "+Math.max(2,z.right-z.left)+"px;");x.display.lineSpace.appendChild(ce),ce.scrollIntoView(ie),x.display.lineSpace.removeChild(ce)}}}function cs(x,z,ne,te){te==null&&(te=0);var ie;!x.options.lineWrapping&&z==ne&&(z=z.ch?st(z.line,z.sticky=="before"?z.ch-1:z.ch,"after"):z,ne=z.sticky=="before"?st(z.line,z.ch+1,"before"):z);for(var ce=0;ce<5;ce++){var ye=!1,Me=ha(x,z),Te=!ne||ne==z?Me:ha(x,ne);ie={left:Math.min(Me.left,Te.left),top:Math.min(Me.top,Te.top)-te,right:Math.max(Me.left,Te.left),bottom:Math.max(Me.bottom,Te.bottom)+te};var Ne=As(x,ie),pt=x.doc.scrollTop,kt=x.doc.scrollLeft;if(Ne.scrollTop!=null&&(Da(x,Ne.scrollTop),Math.abs(x.doc.scrollTop-pt)>1&&(ye=!0)),Ne.scrollLeft!=null&&(go(x,Ne.scrollLeft),Math.abs(x.doc.scrollLeft-kt)>1&&(ye=!0)),!ye)break}return ie}function ul(x,z){var ne=As(x,z);ne.scrollTop!=null&&Da(x,ne.scrollTop),ne.scrollLeft!=null&&go(x,ne.scrollLeft)}function As(x,z){var ne=x.display,te=Ka(x.display);z.top<0&&(z.top=0);var ie=x.curOp&&x.curOp.scrollTop!=null?x.curOp.scrollTop:ne.scroller.scrollTop,ce=Ti(x),ye={};z.bottom-z.top>ce&&(z.bottom=z.top+ce);var Me=x.doc.height+wi(ne),Te=z.top<te,Ne=z.bottom>Me-te;if(z.top<ie)ye.scrollTop=Te?0:z.top;else if(z.bottom>ie+ce){var pt=Math.min(z.top,(Ne?Me:z.bottom)-ce);pt!=ie&&(ye.scrollTop=pt)}var kt=x.options.fixedGutter?0:ne.gutters.offsetWidth,hn=x.curOp&&x.curOp.scrollLeft!=null?x.curOp.scrollLeft:ne.scroller.scrollLeft-kt,en=fi(x)-ne.gutters.offsetWidth,Yn=z.right-z.left>en;return Yn&&(z.right=z.left+en),z.left<10?ye.scrollLeft=0:z.left<hn?ye.scrollLeft=Math.max(0,z.left+kt-(Yn?0:10)):z.right>en+hn-3&&(ye.scrollLeft=z.right+(Yn?0:10)-en),ye}function ms(x,z){z!=null&&(qs(x),x.curOp.scrollTop=(x.curOp.scrollTop==null?x.doc.scrollTop:x.curOp.scrollTop)+z)}function zo(x){qs(x);var z=x.getCursor();x.curOp.scrollToPos={from:z,to:z,margin:x.options.cursorScrollMargin}}function Ts(x,z,ne){(z!=null||ne!=null)&&qs(x),z!=null&&(x.curOp.scrollLeft=z),ne!=null&&(x.curOp.scrollTop=ne)}function Ds(x,z){qs(x),x.curOp.scrollToPos=z}function qs(x){var z=x.curOp.scrollToPos;if(z){x.curOp.scrollToPos=null;var ne=ka(x,z.from),te=ka(x,z.to);oo(x,ne,te,z.margin)}}function oo(x,z,ne,te){var ie=As(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});Ts(x,ie.scrollLeft,ie.scrollTop)}function Da(x,z){Math.abs(x.doc.scrollTop-z)<2||(he||qc(x,{top:z}),Xa(x,z,!0),he&&qc(x),is(x,100))}function Xa(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 go(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,ju(x),x.display.scroller.scrollLeft!=z&&(x.display.scroller.scrollLeft=z),x.display.scrollbars.setScrollLeft(z))}function yo(x){var z=x.display,ne=z.gutters.offsetWidth,te=Math.round(x.doc.height+wi(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+qr(x)+z.barHeight,nativeBarWidth:z.nativeBarWidth,gutterWidth:ne}}var Ko=function(x,z,ne){this.cm=ne;var te=this.vert=Ct("div",[Ct("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),ie=this.horiz=Ct("div",[Ct("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");te.tabIndex=ie.tabIndex=-1,x(te),x(ie),Mn(te,"scroll",function(){te.clientHeight&&z(te.scrollTop,"vertical")}),Mn(ie,"scroll",function(){ie.clientWidth&&z(ie.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,ve&&_e<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ko.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 ce=x.viewWidth-x.barLeft-(ne?te:0);this.horiz.firstChild.style.width=Math.max(0,x.scrollWidth-x.clientWidth+ce)+"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}},Ko.prototype.setScrollLeft=function(x){this.horiz.scrollLeft!=x&&(this.horiz.scrollLeft=x),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Ko.prototype.setScrollTop=function(x){this.vert.scrollTop!=x&&(this.vert.scrollTop=x),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Ko.prototype.zeroWidthHack=function(){var x=De&&!Be?"12px":"18px";this.horiz.style.height=this.vert.style.width=x,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Ae,this.disableVert=new Ae},Ko.prototype.enableZeroWidthBar=function(x,z,ne){x.style.pointerEvents="auto";function te(){var ie=x.getBoundingClientRect(),ce=ne=="vert"?document.elementFromPoint(ie.right-1,(ie.top+ie.bottom)/2):document.elementFromPoint((ie.right+ie.left)/2,ie.bottom-1);ce!=x?x.style.pointerEvents="none":z.set(1e3,te)}z.set(1e3,te)},Ko.prototype.clear=function(){var x=this.horiz.parentNode;x.removeChild(this.horiz),x.removeChild(this.vert)};var wo=function(){};wo.prototype.update=function(){return{bottom:0,right:0}},wo.prototype.setScrollLeft=function(){},wo.prototype.setScrollTop=function(){},wo.prototype.clear=function(){};function xs(x,z){z||(z=yo(x));var ne=x.display.barWidth,te=x.display.barHeight;Xl(x,z);for(var ie=0;ie<4&&ne!=x.display.barWidth||te!=x.display.barHeight;ie++)ne!=x.display.barWidth&&x.options.lineWrapping&&Zo(x),Xl(x,yo(x)),ne=x.display.barWidth,te=x.display.barHeight}function Xl(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 Yl={native:Ko,null:wo};function vc(x){x.display.scrollbars&&(x.display.scrollbars.clear(),x.display.scrollbars.addClass&&Ue(x.display.wrapper,x.display.scrollbars.addClass)),x.display.scrollbars=new Yl[x.options.scrollbarStyle](function(z){x.display.wrapper.insertBefore(z,x.display.scrollbarFiller),Mn(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"?go(x,z):Da(x,z)},x),x.display.scrollbars.addClass&&En(x.display.wrapper,x.display.scrollbars.addClass)}var Xc=0;function Ks(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:++Xc},on(x.curOp)}function Is(x){var z=x.curOp;z&&Wn(z,function(ne){for(var te=0;te<ne.ops.length;te++)ne.ops[te].cm.curOp=null;yc(ne)})}function yc(x){for(var z=x.ops,ne=0;ne<z.length;ne++)ql(z[ne]);for(var te=0;te<z.length;te++)Ia(z[te]);for(var ie=0;ie<z.length;ie++)ma(z[ie]);for(var ce=0;ce<z.length;ce++)Ho(z[ce]);for(var ye=0;ye<z.length;ye++)es(z[ye])}function ql(x){var z=x.cm,ne=z.display;Jl(z),x.updateMaxLine&&An(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 gs(z,x.mustUpdate&&{top:x.scrollTop,ensure:x.scrollToPos},x.forceUpdate)}function Ia(x){x.updatedDisplay=x.mustUpdate&&Yc(x.cm,x.update)}function ma(x){var z=x.cm,ne=z.display;x.updatedDisplay&&Zo(z),x.barMeasure=yo(z),ne.maxLineChanged&&!z.options.lineWrapping&&(x.adjustWidthTo=Aa(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+qr(z)+z.display.barWidth),x.maxScrollLeft=Math.max(0,ne.sizer.offsetLeft+x.adjustWidthTo-fi(z))),(x.updatedDisplay||x.selectionChanged)&&(x.preparedSelection=ne.input.prepareSelection())}function Ho(x){var z=x.cm;x.adjustWidthTo!=null&&(z.display.sizer.style.minWidth=x.adjustWidthTo+"px",x.maxScrollLeft<z.doc.scrollLeft&&go(z,Math.min(z.display.scroller.scrollLeft,x.maxScrollLeft),!0),z.display.maxLineChanged=!1);var ne=x.focus&&x.focus==Pt();x.preparedSelection&&z.display.input.showSelection(x.preparedSelection,ne),(x.updatedDisplay||x.startHeight!=z.doc.height)&&xs(z,x.barMeasure),x.updatedDisplay&&Qc(z,x.barMeasure),x.selectionChanged&&Ci(z),z.state.focused&&x.updateInput&&z.display.input.reset(x.typing),ne&&Di(x.cm)}function es(x){var z=x.cm,ne=z.display,te=z.doc;if(x.updatedDisplay&&Uu(z,x.update),ne.wheelStartX!=null&&(x.scrollTop!=null||x.scrollLeft!=null||x.scrollToPos)&&(ne.wheelStartX=ne.wheelStartY=null),x.scrollTop!=null&&Xa(z,x.scrollTop,x.forceScroll),x.scrollLeft!=null&&go(z,x.scrollLeft,!0,!0),x.scrollToPos){var ie=cs(z,On(te,x.scrollToPos.from),On(te,x.scrollToPos.to),x.scrollToPos.margin);Ro(z,ie)}var ce=x.maybeHiddenMarkers,ye=x.maybeUnhiddenMarkers;if(ce)for(var Me=0;Me<ce.length;++Me)ce[Me].lines.length||at(ce[Me],"hide");if(ye)for(var Te=0;Te<ye.length;++Te)ye[Te].lines.length&&at(ye[Te],"unhide");ne.wrapper.offsetHeight&&(te.scrollTop=z.display.scroller.scrollTop),x.changeObjs&&at(z,"changes",z,x.changeObjs),x.update&&x.update.finish()}function ga(x,z){if(x.curOp)return z();Ks(x);try{return z()}finally{Is(x)}}function za(x,z){return function(){if(x.curOp)return z.apply(x,arguments);Ks(x);try{return z.apply(x,arguments)}finally{Is(x)}}}function Ba(x){return function(){if(this.curOp)return x.apply(this,arguments);Ks(this);try{return x.apply(this,arguments)}finally{Is(this)}}}function po(x){return function(){var z=this.cm;if(!z||z.curOp)return x.apply(this,arguments);Ks(z);try{return x.apply(this,arguments)}finally{Is(z)}}}function is(x,z){x.doc.highlightFrontier<x.display.viewTo&&x.state.highlight.set(z,ur(Hs,x))}function Hs(x){var z=x.doc;if(!(z.highlightFrontier>=x.display.viewTo)){var ne=+new Date+x.options.workTime,te=gi(x,z.highlightFrontier),ie=[];z.iter(te.line,Math.min(z.first+z.size,x.display.viewTo+500),function(ce){if(te.line>=x.display.viewFrom){var ye=ce.styles,Me=ce.text.length>x.options.maxHighlightLength?mt(z.mode,te.state):null,Te=Bi(x,ce,te,!0);Me&&(te.state=Me),ce.styles=Te.styles;var Ne=ce.styleClasses,pt=Te.classes;pt?ce.styleClasses=pt:Ne&&(ce.styleClasses=null);for(var kt=!ye||ye.length!=ce.styles.length||Ne!=pt&&(!Ne||!pt||Ne.bgClass!=pt.bgClass||Ne.textClass!=pt.textClass),hn=0;!kt&&hn<ye.length;++hn)kt=ye[hn]!=ce.styles[hn];kt&&ie.push(te.line),ce.stateAfter=te.save(),te.nextLine()}else ce.text.length<=x.options.maxHighlightLength&&Yi(x,ce.text,te),ce.stateAfter=te.line%5==0?te.save():null,te.nextLine();if(+new Date>ne)return is(x,x.options.workDelay),!0}),z.highlightFrontier=te.line,z.modeFrontier=Math.max(z.modeFrontier,te.line),ie.length&&ga(x,function(){for(var ce=0;ce<ie.length;ce++)Ta(x,ie[ce],"text")})}}var gs=function(x,z,ne){var te=x.display;this.viewport=z,this.visible=va(te,x.doc,z),this.editorIsHidden=!te.wrapper.offsetWidth,this.wrapperHeight=te.wrapper.clientHeight,this.wrapperWidth=te.wrapper.clientWidth,this.oldDisplayWidth=fi(x),this.force=ne,this.dims=ho(x),this.events=[]};gs.prototype.signal=function(x,z){Jn(x,z)&&this.events.push(arguments)},gs.prototype.finish=function(){for(var x=0;x<this.events.length;x++)at.apply(null,this.events[x])};function Jl(x){var z=x.display;!z.scrollbarsClipped&&z.scroller.offsetWidth&&(z.nativeBarWidth=z.scroller.offsetWidth-z.scroller.clientWidth,z.heightForcer.style.height=qr(x)+"px",z.sizer.style.marginBottom=-z.nativeBarWidth+"px",z.sizer.style.borderRightWidth=qr(x)+"px",z.scrollbarsClipped=!0)}function Ud(x){if(x.hasFocus())return null;var z=Pt();if(!z||!Rt(x.display.lineDiv,z))return null;var ne={activeElt:z};if(window.getSelection){var te=window.getSelection();te.anchorNode&&te.extend&&Rt(x.display.lineDiv,te.anchorNode)&&(ne.anchorNode=te.anchorNode,ne.anchorOffset=te.anchorOffset,ne.focusNode=te.focusNode,ne.focusOffset=te.focusOffset)}return ne}function jd(x){if(!(!x||!x.activeElt||x.activeElt==Pt())&&(x.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(x.activeElt.nodeName)&&x.anchorNode&&Rt(document.body,x.anchorNode)&&Rt(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 Yc(x,z){var ne=x.display,te=x.doc;if(z.editorIsHidden)return _a(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&&hs(x)==0)return!1;bc(x)&&(_a(x),z.dims=ho(x));var ie=te.first+te.size,ce=Math.max(z.visible.from-x.options.viewportMargin,te.first),ye=Math.min(ie,z.visible.to+x.options.viewportMargin);ne.viewFrom<ce&&ce-ne.viewFrom<20&&(ce=Math.max(te.first,ne.viewFrom)),ne.viewTo>ye&&ne.viewTo-ye<20&&(ye=Math.min(ie,ne.viewTo)),ri&&(ce=sn(x.doc,ce),ye=Xn(x.doc,ye));var Me=ce!=ne.viewFrom||ye!=ne.viewTo||ne.lastWrapHeight!=z.wrapperHeight||ne.lastWrapWidth!=z.wrapperWidth;ao(x,ce,ye),ne.viewOffset=xn(Yt(x.doc,ne.viewFrom)),x.display.mover.style.top=ne.viewOffset+"px";var Te=hs(x);if(!Me&&Te==0&&!z.force&&ne.renderedView==ne.view&&(ne.updateLineNumbers==null||ne.updateLineNumbers>=ne.viewTo))return!1;var Ne=Ud(x);return Te>4&&(ne.lineDiv.style.display="none"),Vd(x,ne.updateLineNumbers,z.dims),Te>4&&(ne.lineDiv.style.display=""),ne.renderedView=ne.view,jd(Ne),je(ne.cursorDiv),je(ne.selectionDiv),ne.gutters.style.height=ne.sizer.style.minHeight=0,Me&&(ne.lastWrapHeight=z.wrapperHeight,ne.lastWrapWidth=z.wrapperWidth,is(x,400)),ne.updateLineNumbers=null,!0}function Uu(x,z){for(var ne=z.viewport,te=!0;;te=!1){if(!te||!x.options.lineWrapping||z.oldDisplayWidth==fi(x)){if(ne&&ne.top!=null&&(ne={top:Math.min(x.doc.height+wi(x.display)-Ti(x),ne.top)}),z.visible=va(x.display,x.doc,ne),z.visible.from>=x.display.viewFrom&&z.visible.to<=x.display.viewTo)break}else te&&(z.visible=va(x.display,x.doc,ne));if(!Yc(x,z))break;Zo(x);var ie=yo(x);Qo(x),xs(x,ie),Qc(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 qc(x,z){var ne=new gs(x,z);if(Yc(x,ne)){Zo(x),Uu(x,ne);var te=yo(x);Qo(x),xs(x,te),Qc(x,te),ne.finish()}}function Vd(x,z,ne){var te=x.display,ie=x.options.lineNumbers,ce=te.lineDiv,ye=ce.firstChild;function Me(Yn){var mr=Yn.nextSibling;return ke&&De&&x.display.currentWheelTarget==Yn?Yn.style.display="none":Yn.parentNode.removeChild(Yn),mr}for(var Te=te.view,Ne=te.viewFrom,pt=0;pt<Te.length;pt++){var kt=Te[pt];if(!kt.hidden)if(!kt.node||kt.node.parentNode!=ce){var hn=di(x,kt,Ne,ne);ce.insertBefore(hn,ye)}else{for(;ye!=kt.node;)ye=Me(ye);var en=ie&&z!=null&&z<=Ne&&kt.lineNumber;kt.changes&&(Ht(kt.changes,"gutter")>-1&&(en=!1),Xr(x,kt,Ne,ne)),en&&(je(kt.lineNumber),kt.lineNumber.appendChild(document.createTextNode(ht(x.options,Ne)))),ye=kt.node.nextSibling}Ne+=kt.size}for(;ye;)ye=Me(ye)}function Jc(x){var z=x.gutters.offsetWidth;x.sizer.style.marginLeft=z+"px"}function Qc(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+qr(x)+"px"}function ju(x){var z=x.display,ne=z.view;if(!(!z.alignWidgets&&(!z.gutters.firstChild||!x.options.fixedGutter))){for(var te=Oo(z)-z.scroller.scrollLeft+x.doc.scrollLeft,ie=z.gutters.offsetWidth,ce=te+"px",ye=0;ye<ne.length;ye++)if(!ne[ye].hidden){x.options.fixedGutter&&(ne[ye].gutter&&(ne[ye].gutter.style.left=ce),ne[ye].gutterBackground&&(ne[ye].gutterBackground.style.left=ce));var Me=ne[ye].alignable;if(Me)for(var Te=0;Te<Me.length;Te++)Me[Te].style.left=ce}x.options.fixedGutter&&(z.gutters.style.left=te+ie+"px")}}function bc(x){if(!x.options.lineNumbers)return!1;var z=x.doc,ne=ht(x.options,z.first+z.size-1),te=x.display;if(ne.length!=te.lineNumChars){var ie=te.measure.appendChild(Ct("div",[Ct("div",ne)],"CodeMirror-linenumber CodeMirror-gutter-elt")),ce=ie.firstChild.offsetWidth,ye=ie.offsetWidth-ce;return te.lineGutter.style.width="",te.lineNumInnerWidth=Math.max(ce,te.lineGutter.offsetWidth-ye)+1,te.lineNumWidth=te.lineNumInnerWidth+ye,te.lineNumChars=te.lineNumInnerWidth?ne.length:-1,te.lineGutter.style.width=te.lineNumWidth+"px",Jc(x.display),!0}return!1}function eu(x,z){for(var ne=[],te=!1,ie=0;ie<x.length;ie++){var ce=x[ie],ye=null;if(typeof ce!="string"&&(ye=ce.style,ce=ce.className),ce=="CodeMirror-linenumbers")if(z)te=!0;else continue;ne.push({className:ce,style:ye})}return z&&!te&&ne.push({className:"CodeMirror-linenumbers",style:null}),ne}function Vu(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],ce=ie.className,ye=ie.style,Me=z.appendChild(Ct("div",null,"CodeMirror-gutter "+ce));ye&&(Me.style.cssText=ye),ce=="CodeMirror-linenumbers"&&(x.lineGutter=Me,Me.style.width=(x.lineNumWidth||1)+"px")}z.style.display=ne.length?"":"none",Jc(x)}function Ql(x){Vu(x.display),Oi(x),ju(x)}function Gd(x,z,ne,te){var ie=this;this.input=ne,ie.scrollbarFiller=Ct("div",null,"CodeMirror-scrollbar-filler"),ie.scrollbarFiller.setAttribute("cm-not-content","true"),ie.gutterFiller=Ct("div",null,"CodeMirror-gutter-filler"),ie.gutterFiller.setAttribute("cm-not-content","true"),ie.lineDiv=Dt("div",null,"CodeMirror-code"),ie.selectionDiv=Ct("div",null,null,"position: relative; z-index: 1"),ie.cursorDiv=Ct("div",null,"CodeMirror-cursors"),ie.measure=Ct("div",null,"CodeMirror-measure"),ie.lineMeasure=Ct("div",null,"CodeMirror-measure"),ie.lineSpace=Dt("div",[ie.measure,ie.lineMeasure,ie.selectionDiv,ie.cursorDiv,ie.lineDiv],null,"position: relative; outline: none");var ce=Dt("div",[ie.lineSpace],"CodeMirror-lines");ie.mover=Ct("div",[ce],null,"position: relative"),ie.sizer=Ct("div",[ie.mover],"CodeMirror-sizer"),ie.sizerWidth=null,ie.heightForcer=Ct("div",null,null,"position: absolute; height: "+Rn+"px; width: 1px;"),ie.gutters=Ct("div",null,"CodeMirror-gutters"),ie.lineGutter=null,ie.scroller=Ct("div",[ie.sizer,ie.heightForcer,ie.gutters],"CodeMirror-scroll"),ie.scroller.setAttribute("tabIndex","-1"),ie.wrapper=Ct("div",[ie.scrollbarFiller,ie.gutterFiller,ie.scroller],"CodeMirror"),ve&&_e<8&&(ie.gutters.style.zIndex=-1,ie.scroller.style.paddingRight=0),!ke&&!(he&&Ge)&&(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=eu(te.gutters,te.lineNumbers),Vu(ie),ne.init(ie)}var xc=0,Uo=null;ve?Uo=-.53:he?Uo=15:me?Uo=-.7:tt&&(Uo=-1/3);function Pl(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 Gu(x){var z=Pl(x);return z.x*=Uo,z.y*=Uo,z}function Xu(x,z){var ne=Pl(z),te=ne.x,ie=ne.y,ce=x.display,ye=ce.scroller,Me=ye.scrollWidth>ye.clientWidth,Te=ye.scrollHeight>ye.clientHeight;if(te&&Me||ie&&Te){if(ie&&De&&ke){e:for(var Ne=z.target,pt=ce.view;Ne!=ye;Ne=Ne.parentNode)for(var kt=0;kt<pt.length;kt++)if(pt[kt].node==Ne){x.display.currentWheelTarget=Ne;break e}}if(te&&!he&&!Ee&&Uo!=null){ie&&Te&&Da(x,Math.max(0,ye.scrollTop+ie*Uo)),go(x,Math.max(0,ye.scrollLeft+te*Uo)),(!ie||ie&&Te)&&Mr(z),ce.wheelStartX=null;return}if(ie&&Uo!=null){var hn=ie*Uo,en=x.doc.scrollTop,Yn=en+ce.wrapper.clientHeight;hn<0?en=Math.max(0,en+hn-50):Yn=Math.min(x.doc.height,Yn+hn+50),qc(x,{top:en,bottom:Yn})}xc<20&&(ce.wheelStartX==null?(ce.wheelStartX=ye.scrollLeft,ce.wheelStartY=ye.scrollTop,ce.wheelDX=te,ce.wheelDY=ie,setTimeout(function(){if(ce.wheelStartX!=null){var mr=ye.scrollLeft-ce.wheelStartX,Br=ye.scrollTop-ce.wheelStartY,Gr=Br&&ce.wheelDY&&Br/ce.wheelDY||mr&&ce.wheelDX&&mr/ce.wheelDX;ce.wheelStartX=ce.wheelStartY=null,Gr&&(Uo=(Uo*xc+Gr)/(xc+1),++xc)}},200)):(ce.wheelDX+=te,ce.wheelDY+=ie))}}var vs=function(x,z){this.ranges=x,this.primIndex=z};vs.prototype.primary=function(){return this.ranges[this.primIndex]},vs.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(!ln(ne.anchor,te.anchor)||!ln(ne.head,te.head))return!1}return!0},vs.prototype.deepCopy=function(){for(var x=[],z=0;z<this.ranges.length;z++)x[z]=new Ua(Pn(this.ranges[z].anchor),Pn(this.ranges[z].head));return new vs(x,this.primIndex)},vs.prototype.somethingSelected=function(){for(var x=0;x<this.ranges.length;x++)if(!this.ranges[x].empty())return!0;return!1},vs.prototype.contains=function(x,z){z||(z=x);for(var ne=0;ne<this.ranges.length;ne++){var te=this.ranges[ne];if(bt(z,te.from())>=0&&bt(x,te.to())<=0)return ne}return-1};var Ua=function(x,z){this.anchor=x,this.head=z};Ua.prototype.from=function(){return pn(this.anchor,this.head)},Ua.prototype.to=function(){return cn(this.anchor,this.head)},Ua.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Es(x,z,ne){var te=x&&x.options.selectionsMayTouch,ie=z[ne];z.sort(function(hn,en){return bt(hn.from(),en.from())}),ne=Ht(z,ie);for(var ce=1;ce<z.length;ce++){var ye=z[ce],Me=z[ce-1],Te=bt(Me.to(),ye.from());if(te&&!ye.empty()?Te>0:Te>=0){var Ne=pn(Me.from(),ye.from()),pt=cn(Me.to(),ye.to()),kt=Me.empty()?ye.from()==ye.head:Me.from()==Me.head;ce<=ne&&--ne,z.splice(--ce,2,new Ua(kt?pt:Ne,kt?Ne:pt))}}return new vs(z,ne)}function Ps(x,z){return new vs([new Ua(x,z||x)],0)}function Js(x){return x.text?st(x.from.line+x.text.length-1,Kt(x.text).length+(x.text.length==1?x.from.ch:0)):x.to}function Yu(x,z){if(bt(x,z.from)<0)return x;if(bt(x,z.to)<=0)return Js(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+=Js(z).ch-z.to.ch),st(ne,te)}function tu(x,z){for(var ne=[],te=0;te<x.sel.ranges.length;te++){var ie=x.sel.ranges[te];ne.push(new Ua(Yu(ie.anchor,z),Yu(ie.head,z)))}return Es(x.cm,ne,x.sel.primIndex)}function Ol(x,z,ne){return x.line==z.line?st(ne.line,x.ch-z.ch+ne.ch):st(ne.line+(x.line-z.line),x.ch)}function nu(x,z,ne){for(var te=[],ie=st(x.first,0),ce=ie,ye=0;ye<z.length;ye++){var Me=z[ye],Te=Ol(Me.from,ie,ce),Ne=Ol(Js(Me),ie,ce);if(ie=Me.to,ce=Ne,ne=="around"){var pt=x.sel.ranges[ye],kt=bt(pt.head,pt.anchor)<0;te[ye]=new Ua(kt?Ne:Te,kt?Te:Ne)}else te[ye]=new Ua(Te,Te)}return new vs(te,x.sel.primIndex)}function ru(x){x.doc.mode=Lt(x.options,x.doc.modeOption),Bl(x)}function Bl(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,is(x,100),x.state.modeGen++,x.curOp&&Oi(x)}function qu(x,z){return z.from.ch==0&&z.to.ch==0&&Kt(z.text)==""&&(!x.cm||x.cm.options.wholeLineUpdateBefore)}function iu(x,z,ne,te){function ie(ii){return ne?ne[ii]:null}function ce(ii,jr,ai){fr(ii,jr,ai,te),Kn(ii,"change",ii,z)}function ye(ii,jr){for(var ai=[],Fi=ii;Fi<jr;++Fi)ai.push(new Bn(Ne[Fi],ie(Fi),te));return ai}var Me=z.from,Te=z.to,Ne=z.text,pt=Yt(x,Me.line),kt=Yt(x,Te.line),hn=Kt(Ne),en=ie(Ne.length-1),Yn=Te.line-Me.line;if(z.full)x.insert(0,ye(0,Ne.length)),x.remove(Ne.length,x.size-Ne.length);else if(qu(x,z)){var mr=ye(0,Ne.length-1);ce(kt,kt.text,en),Yn&&x.remove(Me.line,Yn),mr.length&&x.insert(Me.line,mr)}else if(pt==kt)if(Ne.length==1)ce(pt,pt.text.slice(0,Me.ch)+hn+pt.text.slice(Te.ch),en);else{var Br=ye(1,Ne.length-1);Br.push(new Bn(hn+pt.text.slice(Te.ch),en,te)),ce(pt,pt.text.slice(0,Me.ch)+Ne[0],ie(0)),x.insert(Me.line+1,Br)}else if(Ne.length==1)ce(pt,pt.text.slice(0,Me.ch)+Ne[0]+kt.text.slice(Te.ch),ie(0)),x.remove(Me.line+1,Yn);else{ce(pt,pt.text.slice(0,Me.ch)+Ne[0],ie(0)),ce(kt,hn+kt.text.slice(Te.ch),en);var Gr=ye(1,Ne.length-1);Yn>1&&x.remove(Me.line+1,Yn-1),x.insert(Me.line+1,Gr)}Kn(x,"change",x,z)}function Qs(x,z,ne){function te(ie,ce,ye){if(ie.linked)for(var Me=0;Me<ie.linked.length;++Me){var Te=ie.linked[Me];if(Te.doc!=ce){var Ne=ye&&Te.sharedHist;ne&&!Ne||(z(Te.doc,Ne),te(Te.doc,ie,Ne))}}}te(x,null,!0)}function wc(x,z){if(z.cm)throw new Error("This document is already in use.");x.doc=z,z.cm=x,lo(x),ru(x),Sc(x),x.options.lineWrapping||An(x),x.options.mode=z.modeOption,Oi(x)}function Sc(x){(x.doc.direction=="rtl"?En:Ue)(x.display.lineDiv,"CodeMirror-rtl")}function au(x){ga(x,function(){Sc(x),Oi(x)})}function Cc(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 ou(x,z){var ne={from:Pn(z.from),to:Js(z),text:Hn(x,z.from,z.to)};return uu(x,ne,z.from.line,z.to.line+1),Qs(x,function(te){return uu(te,ne,z.from.line,z.to.line+1)},!0),ne}function Ju(x){for(;x.length;){var z=Kt(x);if(z.ranges)x.pop();else break}}function su(x,z){if(z)return Ju(x.done),Kt(x.done);if(x.done.length&&!Kt(x.done).ranges)return Kt(x.done);if(x.done.length>1&&!x.done[x.done.length-2].ranges)return x.done.pop(),Kt(x.done)}function Mc(x,z,ne,te){var ie=x.history;ie.undone.length=0;var ce=+new Date,ye,Me;if((ie.lastOp==te||ie.lastOrigin==z.origin&&z.origin&&(z.origin.charAt(0)=="+"&&ie.lastModTime>ce-(x.cm?x.cm.options.historyEventDelay:500)||z.origin.charAt(0)=="*"))&&(ye=su(ie,ie.lastOp==te)))Me=Kt(ye.changes),bt(z.from,z.to)==0&&bt(z.from,Me.to)==0?Me.to=Js(z):ye.changes.push(ou(x,z));else{var Te=Kt(ie.done);for((!Te||!Te.ranges)&&Ec(x.sel,ie.done),ye={changes:[ou(x,z)],generation:ie.generation},ie.done.push(ye);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=ce,ie.lastOp=ie.lastSelOp=te,ie.lastOrigin=ie.lastSelOrigin=z.origin,Me||at(x,"historyAdded")}function lu(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 cu(x,z,ne,te){var ie=x.history,ce=te&&te.origin;ne==ie.lastSelOp||ce&&ie.lastSelOrigin==ce&&(ie.lastModTime==ie.lastSelTime&&ie.lastOrigin==ce||lu(x,ce,Kt(ie.done),z))?ie.done[ie.done.length-1]=z:Ec(z,ie.done),ie.lastSelTime=+new Date,ie.lastSelOrigin=ce,ie.lastSelOp=ne,te&&te.clearRedo!==!1&&Ju(ie.undone)}function Ec(x,z){var ne=Kt(z);ne&&ne.ranges&&ne.equals(x)||z.push(x)}function uu(x,z,ne,te){var ie=z["spans_"+x.id],ce=0;x.iter(Math.max(x.first,ne),Math.min(x.first+x.size,te),function(ye){ye.markedSpans&&((ie||(ie=z["spans_"+x.id]={}))[ce]=ye.markedSpans),++ce})}function du(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(du(ne[ie]));return te}function Qu(x,z){var ne=Xd(x,z),te=Vr(x,z);if(!ne)return te;if(!te)return ne;for(var ie=0;ie<ne.length;++ie){var ce=ne[ie],ye=te[ie];if(ce&&ye)e:for(var Me=0;Me<ye.length;++Me){for(var Te=ye[Me],Ne=0;Ne<ce.length;++Ne)if(ce[Ne].marker==Te.marker)continue e;ce.push(Te)}else ye&&(ne[ie]=ye)}return ne}function Rl(x,z,ne){for(var te=[],ie=0;ie<x.length;++ie){var ce=x[ie];if(ce.ranges){te.push(ne?vs.prototype.deepCopy.call(ce):ce);continue}var ye=ce.changes,Me=[];te.push({changes:Me});for(var Te=0;Te<ye.length;++Te){var Ne=ye[Te],pt=void 0;if(Me.push({from:Ne.from,to:Ne.to,text:Ne.text}),z)for(var kt in Ne)(pt=kt.match(/^spans_(\d+)$/))&&Ht(z,Number(pt[1]))>-1&&(Kt(Me)[kt]=Ne[kt],delete Ne[kt])}}return te}function fu(x,z,ne,te){if(te){var ie=x.anchor;if(ne){var ce=bt(z,ie)<0;ce!=bt(ne,ie)<0?(ie=z,z=ne):ce!=bt(z,ne)<0&&(z=ne)}return new Ua(ie,z)}else return new Ua(ne||z,z)}function Nl(x,z,ne,te,ie){ie==null&&(ie=x.cm&&(x.cm.display.shift||x.extend)),To(x,new vs([fu(x.sel.primary(),z,ne,ie)],0),te)}function li(x,z,ne){for(var te=[],ie=x.cm&&(x.cm.display.shift||x.extend),ce=0;ce<x.sel.ranges.length;ce++)te[ce]=fu(x.sel.ranges[ce],z[ce],null,ie);var ye=Es(x.cm,te,x.sel.primIndex);To(x,ye,ne)}function ws(x,z,ne,te){var ie=x.sel.ranges.slice(0);ie[z]=ne,To(x,Es(x.cm,ie,x.sel.primIndex),te)}function ed(x,z,ne,te){To(x,Ps(z,ne),te)}function Yd(x,z,ne){var te={ranges:z.ranges,update:function(ie){this.ranges=[];for(var ce=0;ce<ie.length;ce++)this.ranges[ce]=new Ua(On(x,ie[ce].anchor),On(x,ie[ce].head))},origin:ne&&ne.origin};return at(x,"beforeSelectionChange",x,te),x.cm&&at(x.cm,"beforeSelectionChange",x.cm,te),te.ranges!=z.ranges?Es(x.cm,te.ranges,te.ranges.length-1):z}function as(x,z,ne){var te=x.history.done,ie=Kt(te);ie&&ie.ranges?(te[te.length-1]=z,kc(x,z,ne)):To(x,z,ne)}function To(x,z,ne){kc(x,z,ne),cu(x,x.sel,x.cm?x.cm.curOp.id:NaN,ne)}function kc(x,z,ne){(Jn(x,"beforeSelectionChange")||x.cm&&Jn(x.cm,"beforeSelectionChange"))&&(z=Yd(x,z,ne));var te=ne&&ne.bias||(bt(z.primary().head,x.sel.primary().head)<0?-1:1);qd(x,$l(x,z,te,!0)),!(ne&&ne.scroll===!1)&&x.cm&&zo(x.cm)}function qd(x,z){z.equals(x.sel)||(x.sel=z,x.cm&&(x.cm.curOp.updateInput=1,x.cm.curOp.selectionChanged=!0,In(x.cm)),Kn(x,"cursorActivity",x))}function Jd(x){qd(x,$l(x,x.sel,null,!1))}function $l(x,z,ne,te){for(var ie,ce=0;ce<z.ranges.length;ce++){var ye=z.ranges[ce],Me=z.ranges.length==x.sel.ranges.length&&x.sel.ranges[ce],Te=hu(x,ye.anchor,Me&&Me.anchor,ne,te),Ne=hu(x,ye.head,Me&&Me.head,ne,te);(ie||Te!=ye.anchor||Ne!=ye.head)&&(ie||(ie=z.ranges.slice(0,ce)),ie[ce]=new Ua(Te,Ne))}return ie?Es(x.cm,ie,z.primIndex):z}function os(x,z,ne,te,ie){var ce=Yt(x,z.line);if(ce.markedSpans)for(var ye=0;ye<ce.markedSpans.length;++ye){var Me=ce.markedSpans[ye],Te=Me.marker,Ne="selectLeft"in Te?!Te.selectLeft:Te.inclusiveLeft,pt="selectRight"in Te?!Te.selectRight:Te.inclusiveRight;if((Me.from==null||(Ne?Me.from<=z.ch:Me.from<z.ch))&&(Me.to==null||(pt?Me.to>=z.ch:Me.to>z.ch))){if(ie&&(at(Te,"beforeCursorEnter"),Te.explicitlyCleared))if(ce.markedSpans){--ye;continue}else break;if(!Te.atomic)continue;if(ne){var kt=Te.find(te<0?1:-1),hn=void 0;if((te<0?pt:Ne)&&(kt=el(x,kt,-te,kt&&kt.line==z.line?ce:null)),kt&&kt.line==z.line&&(hn=bt(kt,ne))&&(te<0?hn<0:hn>0))return os(x,kt,z,te,ie)}var en=Te.find(te<0?-1:1);return(te<0?Ne:pt)&&(en=el(x,en,te,en.line==z.line?ce:null)),en?os(x,en,z,te,ie):null}}return z}function hu(x,z,ne,te,ie){var ce=te||1,ye=os(x,z,ne,ce,ie)||!ie&&os(x,z,ne,ce,!0)||os(x,z,ne,-ce,ie)||!ie&&os(x,z,ne,-ce,!0);return ye||(x.cantEdit=!0,st(x.first,0))}function el(x,z,ne,te){return ne<0&&z.ch==0?z.line>x.first?On(x,st(z.line-1)):null:ne>0&&z.ch==(te||Yt(x,z.line)).text.length?z.line<x.first+x.size-1?st(z.line+1,0):null:new st(z.line,z.ch+ne)}function td(x){x.setSelection(st(x.firstLine(),0),st(x.lastLine()),ot)}function pu(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,ce,ye,Me){ie&&(te.from=On(x,ie)),ce&&(te.to=On(x,ce)),ye&&(te.text=ye),Me!==void 0&&(te.origin=Me)}),at(x,"beforeChange",x,te),x.cm&&at(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 dl(x,z,ne){if(x.cm){if(!x.cm.curOp)return za(x.cm,dl)(x,z,ne);if(x.cm.state.suppressEdits)return}if(!((Jn(x,"beforeChange")||x.cm&&Jn(x.cm,"beforeChange"))&&(z=pu(x,z,!0),!z))){var te=ta&&!ne&&ti(x,z.from,z.to);if(te)for(var ie=te.length-1;ie>=0;--ie)nd(x,{from:te[ie].from,to:te[ie].to,text:ie?[""]:z.text,origin:z.origin});else nd(x,z)}}function nd(x,z){if(!(z.text.length==1&&z.text[0]==""&&bt(z.from,z.to)==0)){var ne=tu(x,z);Mc(x,z,ne,x.cm?x.cm.curOp.id:NaN),Fl(x,z,ne,Vr(x,z));var te=[];Qs(x,function(ie,ce){!ce&&Ht(te,ie.history)==-1&&(_c(ie.history,z),te.push(ie.history)),Fl(ie,z,null,Vr(ie,z))})}}function tl(x,z,ne){var te=x.cm&&x.cm.state.suppressEdits;if(!(te&&!ne)){for(var ie=x.history,ce,ye=x.sel,Me=z=="undo"?ie.done:ie.undone,Te=z=="undo"?ie.undone:ie.done,Ne=0;Ne<Me.length&&(ce=Me[Ne],!(ne?ce.ranges&&!ce.equals(x.sel):!ce.ranges));Ne++);if(Ne!=Me.length){for(ie.lastOrigin=ie.lastSelOrigin=null;;)if(ce=Me.pop(),ce.ranges){if(Ec(ce,Te),ne&&!ce.equals(x.sel)){To(x,ce,{clearRedo:!1});return}ye=ce}else if(te){Me.push(ce);return}else break;var pt=[];Ec(ye,Te),Te.push({changes:pt,generation:ie.generation}),ie.generation=ce.generation||++ie.maxGeneration;for(var kt=Jn(x,"beforeChange")||x.cm&&Jn(x.cm,"beforeChange"),hn=function(mr){var Br=ce.changes[mr];if(Br.origin=z,kt&&!pu(x,Br,!1))return Me.length=0,{};pt.push(ou(x,Br));var Gr=mr?tu(x,Br):Kt(Me);Fl(x,Br,Gr,Qu(x,Br)),!mr&&x.cm&&x.cm.scrollIntoView({from:Br.from,to:Js(Br)});var ii=[];Qs(x,function(jr,ai){!ai&&Ht(ii,jr.history)==-1&&(_c(jr.history,Br),ii.push(jr.history)),Fl(jr,Br,null,Qu(jr,Br))})},en=ce.changes.length-1;en>=0;--en){var Yn=hn(en);if(Yn)return Yn.v}}}}function mu(x,z){if(z!=0&&(x.first+=z,x.sel=new vs(bn(x.sel.ranges,function(ie){return new Ua(st(ie.anchor.line+z,ie.anchor.ch),st(ie.head.line+z,ie.head.ch))}),x.sel.primIndex),x.cm)){Oi(x.cm,x.first,x.first-z,z);for(var ne=x.cm.display,te=ne.viewFrom;te<ne.viewTo;te++)Ta(x.cm,te,"gutter")}}function Fl(x,z,ne,te){if(x.cm&&!x.cm.curOp)return za(x.cm,Fl)(x,z,ne,te);if(z.to.line<x.first){mu(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);mu(x,ie),z={from:st(x.first,0),to:st(z.to.line+ie,z.to.ch),text:[Kt(z.text)],origin:z.origin}}var ce=x.lastLine();z.to.line>ce&&(z={from:z.from,to:st(ce,Yt(x,ce).text.length),text:[z.text[0]],origin:z.origin}),z.removed=Hn(x,z.from,z.to),ne||(ne=tu(x,z)),x.cm?Qd(x.cm,z,te):iu(x,z,te),kc(x,ne,ot),x.cantEdit&&hu(x,st(x.firstLine(),0))&&(x.cantEdit=!1)}}function Qd(x,z,ne){var te=x.doc,ie=x.display,ce=z.from,ye=z.to,Me=!1,Te=ce.line;x.options.lineWrapping||(Te=qn(lt(Yt(te,ce.line))),te.iter(Te,ye.line+1,function(en){if(en==ie.maxLine)return Me=!0,!0})),te.sel.contains(z.from,z.to)>-1&&In(x),iu(te,z,ne,Bo(x)),x.options.lineWrapping||(te.iter(Te,ce.line+z.text.length,function(en){var Yn=gn(en);Yn>ie.maxLineLength&&(ie.maxLine=en,ie.maxLineLength=Yn,ie.maxLineChanged=!0,Me=!1)}),Me&&(x.curOp.updateMaxLine=!0)),la(te,ce.line),is(x,400);var Ne=z.text.length-(ye.line-ce.line)-1;z.full?Oi(x):ce.line==ye.line&&z.text.length==1&&!qu(x.doc,z)?Ta(x,ce.line,"text"):Oi(x,ce.line,ye.line+1,Ne);var pt=Jn(x,"changes"),kt=Jn(x,"change");if(kt||pt){var hn={from:ce,to:ye,text:z.text,removed:z.removed,origin:z.origin};kt&&Kn(x,"change",x,hn),pt&&(x.curOp.changeObjs||(x.curOp.changeObjs=[])).push(hn)}x.display.selForContextMenu=null}function ec(x,z,ne,te,ie){var ce;te||(te=ne),bt(te,ne)<0&&(ce=[te,ne],ne=ce[0],te=ce[1]),typeof z=="string"&&(z=x.splitLines(z)),dl(x,{from:ne,to:te,text:z,origin:ie})}function ef(x,z,ne,te){ne<x.line?x.line+=te:z<x.line&&(x.line=z,x.ch=0)}function tf(x,z,ne,te){for(var ie=0;ie<x.length;++ie){var ce=x[ie],ye=!0;if(ce.ranges){ce.copied||(ce=x[ie]=ce.deepCopy(),ce.copied=!0);for(var Me=0;Me<ce.ranges.length;Me++)ef(ce.ranges[Me].anchor,z,ne,te),ef(ce.ranges[Me].head,z,ne,te);continue}for(var Te=0;Te<ce.changes.length;++Te){var Ne=ce.changes[Te];if(ne<Ne.from.line)Ne.from=st(Ne.from.line+te,Ne.from.ch),Ne.to=st(Ne.to.line+te,Ne.to.ch);else if(z<=Ne.to.line){ye=!1;break}}ye||(x.splice(0,ie+1),ie=0)}}function _c(x,z){var ne=z.from.line,te=z.to.line,ie=z.text.length-(te-ne)-1;tf(x.done,ne,te,ie),tf(x.undone,ne,te,ie)}function Lc(x,z,ne,te){var ie=z,ce=z;return typeof z=="number"?ce=Yt(x,mn(x,z)):ie=qn(z),ie==null?null:(te(ce,ie)&&x.cm&&Ta(x.cm,ie,ne),ce)}function fl(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}fl.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,Gn(ie),Kn(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 tc(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}tc.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 ce=Math.min(z,ie-x),ye=te.height;if(te.removeInner(x,ce),this.height-=ye-te.height,ie==ce&&(this.children.splice(ne--,1),te.parent=null),(z-=ce)==0)break;x=0}else x-=ie}if(this.size-z<25&&(this.children.length>1||!(this.children[0]instanceof fl))){var Me=[];this.collapse(Me),this.children=[new fl(Me)],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],ce=ie.chunkSize();if(x<=ce){if(ie.insertInner(x,z,ne),ie.lines&&ie.lines.length>50){for(var ye=ie.lines.length%25+25,Me=ye;Me<ie.lines.length;){var Te=new fl(ie.lines.slice(Me,Me+=25));ie.height-=Te.height,this.children.splice(++te,0,Te),Te.parent=this}ie.lines=ie.lines.slice(0,ye),this.maybeSpill()}break}x-=ce}},maybeSpill:function(){if(!(this.children.length<=10)){var x=this;do{var z=x.children.splice(x.children.length-5,5),ne=new tc(z);if(x.parent){x.size-=ne.size,x.height-=ne.height;var ie=Ht(x.parent.children,x);x.parent.children.splice(ie+1,0,ne)}else{var te=new tc(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],ce=ie.chunkSize();if(x<ce){var ye=Math.min(z,ce-x);if(ie.iterN(x,ye,ne))return!0;if((z-=ye)==0)break;x=0}else x-=ce}}};var nc=function(x,z,ne){if(ne)for(var te in ne)ne.hasOwnProperty(te)&&(this[te]=ne[te]);this.doc=x,this.node=z};nc.prototype.clear=function(){var x=this.doc.cm,z=this.line.widgets,ne=this.line,te=qn(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 ce=Ni(this);Qn(ne,Math.max(0,ne.height-ce)),x&&(ga(x,function(){nf(x,ne,-ce),Ta(x,te,"widget")}),Kn(x,"lineWidgetCleared",x,this,te))}},nc.prototype.changed=function(){var x=this,z=this.height,ne=this.doc.cm,te=this.line;this.height=null;var ie=Ni(this)-z;ie&&(vr(this.doc,te)||Qn(te,te.height+ie),ne&&ga(ne,function(){ne.curOp.forceUpdate=!0,nf(ne,te,ie),Kn(ne,"lineWidgetChanged",ne,x,qn(te))}))},ar(nc);function nf(x,z,ne){xn(z)<(x.curOp&&x.curOp.scrollTop||x.doc.scrollTop)&&ms(x,ne)}function rf(x,z,ne,te){var ie=new nc(x,ne,te),ce=x.cm;return ce&&ie.noHScroll&&(ce.display.alignWidgets=!0),Lc(x,z,"widget",function(ye){var Me=ye.widgets||(ye.widgets=[]);if(ie.insertAt==null?Me.push(ie):Me.splice(Math.min(Me.length-1,Math.max(0,ie.insertAt)),0,ie),ie.line=ye,ce&&!vr(x,ye)){var Te=xn(ye)<x.scrollTop;Qn(ye,ye.height+Ni(ie)),Te&&ms(ce,ie.height),ce.curOp.forceUpdate=!0}return!0}),ce&&Kn(ce,"lineWidgetAdded",ce,ie,typeof z=="number"?z:qn(z)),ie}var af=0,hl=function(x,z){this.lines=[],this.type=z,this.doc=x,this.id=++af};hl.prototype.clear=function(){if(!this.explicitlyCleared){var x=this.doc.cm,z=x&&!x.curOp;if(z&&Ks(x),Jn(this,"clear")){var ne=this.find();ne&&Kn(this,"clear",ne.from,ne.to)}for(var te=null,ie=null,ce=0;ce<this.lines.length;++ce){var ye=this.lines[ce],Me=fn(ye.markedSpans,this);x&&!this.collapsed?Ta(x,qn(ye),"text"):x&&(Me.to!=null&&(ie=qn(ye)),Me.from!=null&&(te=qn(ye))),ye.markedSpans=Tn(ye.markedSpans,Me),Me.from==null&&this.collapsed&&!vr(this.doc,ye)&&x&&Qn(ye,Ka(x.display))}if(x&&this.collapsed&&!x.options.lineWrapping)for(var Te=0;Te<this.lines.length;++Te){var Ne=lt(this.lines[Te]),pt=gn(Ne);pt>x.display.maxLineLength&&(x.display.maxLine=Ne,x.display.maxLineLength=pt,x.display.maxLineChanged=!0)}te!=null&&x&&this.collapsed&&Oi(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&&Kn(x,"markerCleared",x,this,te,ie),z&&Is(x),this.parent&&this.parent.clear()}},hl.prototype.find=function(x,z){x==null&&this.type=="bookmark"&&(x=1);for(var ne,te,ie=0;ie<this.lines.length;++ie){var ce=this.lines[ie],ye=fn(ce.markedSpans,this);if(ye.from!=null&&(ne=st(z?ce:qn(ce),ye.from),x==-1))return ne;if(ye.to!=null&&(te=st(z?ce:qn(ce),ye.to),x==1))return te}return ne&&{from:ne,to:te}},hl.prototype.changed=function(){var x=this,z=this.find(-1,!0),ne=this,te=this.doc.cm;!z||!te||ga(te,function(){var ie=z.line,ce=qn(z.line),ye=ca(te,ce);if(ye&&(Zi(ye),te.curOp.selectionChanged=te.curOp.forceUpdate=!0),te.curOp.updateMaxLine=!0,!vr(ne.doc,ie)&&ne.height!=null){var Me=ne.height;ne.height=null;var Te=Ni(ne)-Me;Te&&Qn(ie,ie.height+Te)}Kn(te,"markerChanged",te,x)})},hl.prototype.attachLine=function(x){if(!this.lines.length&&this.doc.cm){var z=this.doc.cm.curOp;(!z.maybeHiddenMarkers||Ht(z.maybeHiddenMarkers,this)==-1)&&(z.maybeUnhiddenMarkers||(z.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(x)},hl.prototype.detachLine=function(x){if(this.lines.splice(Ht(this.lines,x),1),!this.lines.length&&this.doc.cm){var z=this.doc.cm.curOp;(z.maybeHiddenMarkers||(z.maybeHiddenMarkers=[])).push(this)}},ar(hl);function nl(x,z,ne,te,ie){if(te&&te.shared)return uo(x,z,ne,te,ie);if(x.cm&&!x.cm.curOp)return za(x.cm,nl)(x,z,ne,te,ie);var ce=new hl(x,ie),ye=bt(z,ne);if(te&&wr(te,ce,!1),ye>0||ye==0&&ce.clearWhenEmpty!==!1)return ce;if(ce.replacedWith&&(ce.collapsed=!0,ce.widgetNode=Dt("span",[ce.replacedWith],"CodeMirror-widget"),te.handleMouseEvents||ce.widgetNode.setAttribute("cm-ignore-events","true"),te.insertLeft&&(ce.widgetNode.insertLeft=!0)),ce.collapsed){if(et(x,z.line,z,ne,ce)||z.line!=ne.line&&et(x,ne.line,z,ne,ce))throw new Error("Inserting collapsed marker partially overlapping an existing one");vt()}ce.addToHistory&&Mc(x,{from:z,to:ne,origin:"markText"},x.sel,NaN);var Me=z.line,Te=x.cm,Ne;if(x.iter(Me,ne.line+1,function(kt){Te&&ce.collapsed&&!Te.options.lineWrapping&&lt(kt)==Te.display.maxLine&&(Ne=!0),ce.collapsed&&Me!=z.line&&Qn(kt,0),pr(kt,new Zt(ce,Me==z.line?z.ch:null,Me==ne.line?ne.ch:null)),++Me}),ce.collapsed&&x.iter(z.line,ne.line+1,function(kt){vr(x,kt)&&Qn(kt,0)}),ce.clearOnEnter&&Mn(ce,"beforeCursorEnter",function(){return ce.clear()}),ce.readOnly&&(xt(),(x.history.done.length||x.history.undone.length)&&x.clearHistory()),ce.collapsed&&(ce.id=++af,ce.atomic=!0),Te){if(Ne&&(Te.curOp.updateMaxLine=!0),ce.collapsed)Oi(Te,z.line,ne.line+1);else if(ce.className||ce.startStyle||ce.endStyle||ce.css||ce.attributes||ce.title)for(var pt=z.line;pt<=ne.line;pt++)Ta(Te,pt,"text");ce.atomic&&Jd(Te.doc),Kn(Te,"markerAdded",Te,ce)}return ce}var ya=function(x,z){this.markers=x,this.primary=z;for(var ne=0;ne<x.length;++ne)x[ne].parent=this};ya.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var x=0;x<this.markers.length;++x)this.markers[x].clear();Kn(this,"clear")}},ya.prototype.find=function(x,z){return this.primary.find(x,z)},ar(ya);function uo(x,z,ne,te,ie){te=wr(te),te.shared=!1;var ce=[nl(x,z,ne,te,ie)],ye=ce[0],Me=te.widgetNode;return Qs(x,function(Te){Me&&(te.widgetNode=Me.cloneNode(!0)),ce.push(nl(Te,On(Te,z),On(Te,ne),te,ie));for(var Ne=0;Ne<Te.linked.length;++Ne)if(Te.linked[Ne].isParent)return;ye=Kt(ce)}),new ya(ce,ye)}function pl(x){return x.findMarks(st(x.first,0),x.clipPos(st(x.lastLine())),function(z){return z.parent})}function of(x,z){for(var ne=0;ne<z.length;ne++){var te=z[ne],ie=te.find(),ce=x.clipPos(ie.from),ye=x.clipPos(ie.to);if(bt(ce,ye)){var Me=nl(x,ce,ye,te.primary,te.primary.type);te.markers.push(Me),Me.parent=te}}}function Ss(x){for(var z=function(te){var ie=x[te],ce=[ie.primary.doc];Qs(ie.primary.doc,function(Te){return ce.push(Te)});for(var ye=0;ye<ie.markers.length;ye++){var Me=ie.markers[ye];Ht(ce,Me.doc)==-1&&(Me.parent=null,ie.markers.splice(ye--,1))}},ne=0;ne<x.length;ne++)z(ne)}var sf=0,Eo=function(x,z,ne,te,ie){if(!(this instanceof Eo))return new Eo(x,z,ne,te,ie);ne==null&&(ne=0),tc.call(this,[new fl([new Bn("",null)])]),this.first=ne,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=ne;var ce=st(ne,0);this.sel=Ps(ce),this.history=new Cc(null),this.id=++sf,this.modeOption=z,this.lineSep=te,this.direction=ie=="rtl"?"rtl":"ltr",this.extend=!1,typeof x=="string"&&(x=this.splitLines(x)),iu(this,{from:ce,to:ce,text:x}),To(this,Ps(ce),ot)};Eo.prototype=ue(tc.prototype,{constructor:Eo,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=_r(this,this.first,this.first+this.size);return x===!1?z:z.join(x||this.lineSeparator())},setValue:po(function(x){var z=st(this.first,0),ne=this.first+this.size-1;dl(this,{from:z,to:st(ne,Yt(this,ne).text.length),text:this.splitLines(x),origin:"setValue",full:!0},!0),this.cm&&Ts(this.cm,0,0),To(this,Ps(z),ot)}),replaceRange:function(x,z,ne,te){z=On(this,z),ne=ne?On(this,ne):z,ec(this,x,z,ne,te)},getRange:function(x,z,ne){var te=Hn(this,On(this,x),On(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(lr(this,x))return Yt(this,x)},getLineNumber:function(x){return qn(x)},getLineHandleVisualStart:function(x){return typeof x=="number"&&(x=Yt(this,x)),lt(x)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(x){return On(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:po(function(x,z,ne){ed(this,On(this,typeof x=="number"?st(x,z||0):x),null,ne)}),setSelection:po(function(x,z,ne){ed(this,On(this,x),On(this,z||x),ne)}),extendSelection:po(function(x,z,ne){Nl(this,On(this,x),z&&On(this,z),ne)}),extendSelections:po(function(x,z){li(this,Gt(this,x),z)}),extendSelectionsBy:po(function(x,z){var ne=bn(this.sel.ranges,x);li(this,Gt(this,ne),z)}),setSelections:po(function(x,z,ne){if(x.length){for(var te=[],ie=0;ie<x.length;ie++)te[ie]=new Ua(On(this,x[ie].anchor),On(this,x[ie].head));z==null&&(z=Math.min(x.length-1,this.sel.primIndex)),To(this,Es(this.cm,te,z),ne)}}),addSelection:po(function(x,z,ne){var te=this.sel.ranges.slice(0);te.push(new Ua(On(this,x),On(this,z||x))),To(this,Es(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=Hn(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=Hn(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:po(function(x,z,ne){for(var te=[],ie=this.sel,ce=0;ce<ie.ranges.length;ce++){var ye=ie.ranges[ce];te[ce]={from:ye.from(),to:ye.to(),text:this.splitLines(x[ce]),origin:ne}}for(var Me=z&&z!="end"&&nu(this,te,z),Te=te.length-1;Te>=0;Te--)dl(this,te[Te]);Me?as(this,Me):this.cm&&zo(this.cm)}),undo:po(function(){tl(this,"undo")}),redo:po(function(){tl(this,"redo")}),undoSelection:po(function(){tl(this,"undo",!0)}),redoSelection:po(function(){tl(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 Cc(this.history.maxGeneration),Qs(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:Rl(this.history.done),undone:Rl(this.history.undone)}},setHistory:function(x){var z=this.history=new Cc(this.history.maxGeneration);z.done=Rl(x.done.slice(0),null,!0),z.undone=Rl(x.undone.slice(0),null,!0)},setGutterMarker:po(function(x,z,ne){return Lc(this,x,"gutter",function(te){var ie=te.gutterMarkers||(te.gutterMarkers={});return ie[z]=ne,!ne&&le(ie)&&(te.gutterMarkers=null),!0})}),clearGutter:po(function(x){var z=this;this.iter(function(ne){ne.gutterMarkers&&ne.gutterMarkers[x]&&Lc(z,ne,"gutter",function(){return ne.gutterMarkers[x]=null,le(ne.gutterMarkers)&&(ne.gutterMarkers=null),!0})})}),lineInfo:function(x){var z;if(typeof x=="number"){if(!lr(this,x)||(z=x,x=Yt(this,x),!x))return null}else if(z=qn(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:po(function(x,z,ne){return Lc(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(xe(ne).test(te[ie]))return!1;te[ie]+=" "+ne}return!0})}),removeLineClass:po(function(x,z,ne){return Lc(this,x,z=="gutter"?"gutter":"class",function(te){var ie=z=="text"?"textClass":z=="background"?"bgClass":z=="gutter"?"gutterClass":"wrapClass",ce=te[ie];if(ce)if(ne==null)te[ie]=null;else{var ye=ce.match(xe(ne));if(!ye)return!1;var Me=ye.index+ye[0].length;te[ie]=ce.slice(0,ye.index)+(!ye.index||Me==ce.length?"":" ")+ce.slice(Me)||null}else return!1;return!0})}),addLineWidget:po(function(x,z,ne){return rf(this,x,z,ne)}),removeLineWidget:function(x){x.clear()},markText:function(x,z,ne){return nl(this,On(this,x),On(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=On(this,x),nl(this,x,x,ne,"bookmark")},findMarksAt:function(x){x=On(this,x);var z=[],ne=Yt(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=On(this,x),z=On(this,z);var te=[],ie=x.line;return this.iter(x.line,z.line+1,function(ce){var ye=ce.markedSpans;if(ye)for(var Me=0;Me<ye.length;Me++){var Te=ye[Me];!(Te.to!=null&&ie==x.line&&x.ch>=Te.to||Te.from==null&&ie!=x.line||Te.from!=null&&ie==z.line&&Te.from>=z.ch)&&(!ne||ne(Te.marker))&&te.push(Te.marker.parent||Te.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 ce=ie.text.length+te;if(ce>x)return z=x,!0;x-=ce,++ne}),On(this,st(ne,z))},indexFromPos:function(x){x=On(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 Eo(_r(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 Eo(_r(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}],of(te,pl(this)),te},unlinkDoc:function(x){if(x instanceof ia&&(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),Ss(pl(this));break}}if(x.history==this.history){var te=[x.id];Qs(x,function(ie){return te.push(ie.id)},!0),x.history=new Cc(null),x.history.done=Rl(this.history.done,te),x.history.undone=Rl(this.history.undone,te)}},iterLinkedDocs:function(x){Qs(this,x)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(x){return this.lineSep?x.split(this.lineSep):yt(x)},lineSeparator:function(){return this.lineSep||`
`},setDirection:po(function(x){x!="rtl"&&(x="ltr"),x!=this.direction&&(this.direction=x,this.iter(function(z){return z.order=null}),this.cm&&au(this.cm))})}),Eo.prototype.eachLine=Eo.prototype.iter;var rd=0;function eh(x){var z=this;if(rc(z),!($t(z,x)||qi(z.display,x))){Mr(x),ve&&(rd=+new Date);var ne=Ao(z,x,!0),te=x.dataTransfer.files;if(!(!ne||z.isReadOnly()))if(te&&te.length&&window.FileReader&&window.File)for(var ie=te.length,ce=Array(ie),ye=0,Me=function(){++ye==ie&&za(z,function(){ne=On(z.doc,ne);var en={from:ne,to:ne,text:z.doc.splitLines(ce.filter(function(Yn){return Yn!=null}).join(z.doc.lineSeparator())),origin:"paste"};dl(z.doc,en),as(z.doc,Ps(On(z.doc,ne),On(z.doc,Js(en))))})()},Te=function(en,Yn){if(z.options.allowDropFileTypes&&Ht(z.options.allowDropFileTypes,en.type)==-1){Me();return}var mr=new FileReader;mr.onerror=function(){return Me()},mr.onload=function(){var Br=mr.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Br)){Me();return}ce[Yn]=Br,Me()},mr.readAsText(en)},Ne=0;Ne<te.length;Ne++)Te(te[Ne],Ne);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 pt=x.dataTransfer.getData("Text");if(pt){var kt;if(z.state.draggingText&&!z.state.draggingText.copy&&(kt=z.listSelections()),kc(z.doc,Ps(ne,ne)),kt)for(var hn=0;hn<kt.length;++hn)ec(z.doc,"",kt[hn].anchor,kt[hn].head,"drag");z.replaceSelection(pt,"around","paste"),z.display.input.focus()}}catch(en){}}}}function th(x,z){if(ve&&(!x.state.draggingText||+new Date-rd<100)){Kr(z);return}if(!($t(x,z)||qi(x.display,z))&&(z.dataTransfer.setData("Text",x.getSelection()),z.dataTransfer.effectAllowed="copyMove",z.dataTransfer.setDragImage&&!tt)){var ne=Ct("img",null,null,"position: fixed; left: 0; top: 0;");ne.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Ee&&(ne.width=ne.height=1,x.display.wrapper.appendChild(ne),ne._top=ne.offsetTop),z.dataTransfer.setDragImage(ne,0,0),Ee&&ne.parentNode.removeChild(ne)}}function id(x,z){var ne=Ao(x,z);if(ne){var te=document.createDocumentFragment();oa(x,ne,te),x.display.dragCursor||(x.display.dragCursor=Ct("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),x.display.lineSpace.insertBefore(x.display.dragCursor,x.display.cursorDiv)),_t(x.display.dragCursor,te)}}function rc(x){x.display.dragCursor&&(x.display.lineSpace.removeChild(x.display.dragCursor),x.display.dragCursor=null)}function ic(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 ce=0;ce<ne.length;ce++)x(ne[ce])})}}var Tr=!1;function ad(){Tr||(gu(),Tr=!0)}function gu(){var x;Mn(window,"resize",function(){x==null&&(x=setTimeout(function(){x=null,ic(vu)},100))}),Mn(window,"blur",function(){return ic(Fo)})}function vu(x){var z=x.display;z.cachedCharWidth=z.cachedTextHeight=z.cachedPaddingH=null,z.scrollbarsClipped=!1,x.setSize()}for(var Os={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++)Os[Ac+48]=Os[Ac+96]=String(Ac);for(var yu=65;yu<=90;yu++)Os[yu]=String.fromCharCode(yu);for(var Tc=1;Tc<=12;Tc++)Os[Tc+111]=Os[Tc+63235]="F"+Tc;var Qa={};Qa.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"},Qa.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"},Qa.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"},Qa.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"]},Qa.default=De?Qa.macDefault:Qa.pcDefault;function nh(x){var z=x.split(/-(?!$)/);x=z[z.length-1];for(var ne,te,ie,ce,ye=0;ye<z.length-1;ye++){var Me=z[ye];if(/^(cmd|meta|m)$/i.test(Me))ce=!0;else if(/^a(lt)?$/i.test(Me))ne=!0;else if(/^(c|ctrl|control)$/i.test(Me))te=!0;else if(/^s(hift)?$/i.test(Me))ie=!0;else throw new Error("Unrecognized modifier name: "+Me)}return ne&&(x="Alt-"+x),te&&(x="Ctrl-"+x),ce&&(x="Cmd-"+x),ie&&(x="Shift-"+x),x}function od(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=bn(ne.split(" "),nh),ce=0;ce<ie.length;ce++){var ye=void 0,Me=void 0;ce==ie.length-1?(Me=ie.join(" "),ye=te):(Me=ie.slice(0,ce+1).join(" "),ye="...");var Te=z[Me];if(!Te)z[Me]=ye;else if(Te!=ye)throw new Error("Inconsistent bindings for "+Me)}delete x[ne]}for(var Ne in z)x[Ne]=z[Ne];return x}function rl(x,z,ne,te){z=ss(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 rl(x,z.fallthrough,ne,te);for(var ce=0;ce<z.fallthrough.length;ce++){var ye=rl(x,z.fallthrough[ce],ne,te);if(ye)return ye}}}function Dc(x){var z=typeof x=="string"?x:Os[x.keyCode];return z=="Ctrl"||z=="Alt"||z=="Shift"||z=="Mod"}function ml(x,z,ne){var te=x;return z.altKey&&te!="Alt"&&(x="Alt-"+x),(ft?z.metaKey:z.ctrlKey)&&te!="Ctrl"&&(x="Ctrl-"+x),(ft?z.ctrlKey:z.metaKey)&&te!="Mod"&&(x="Cmd-"+x),!ne&&z.shiftKey&&te!="Shift"&&(x="Shift-"+x),x}function zl(x,z){if(Ee&&x.keyCode==34&&x.char)return!1;var ne=Os[x.keyCode];return ne==null||x.altGraphKey?!1:(x.keyCode==3&&x.code&&(ne=x.code),ml(ne,x,z))}function ss(x){return typeof x=="string"?Qa[x]:x}function ks(x,z){for(var ne=x.doc.sel.ranges,te=[],ie=0;ie<ne.length;ie++){for(var ce=z(ne[ie]);te.length&&bt(ce.from,Kt(te).to)<=0;){var ye=te.pop();if(bt(ye.from,ce.from)<0){ce.from=ye.from;break}}te.push(ce)}ga(x,function(){for(var Me=te.length-1;Me>=0;Me--)ec(x.doc,"",te[Me].from,te[Me].to,"+delete");zo(x)})}function jo(x,z,ne){var te=It(x.text,z+ne,ne);return te<0||te>x.text.length?null:te}function Ws(x,z,ne){var te=jo(x,z.ch,ne);return te==null?null:new st(z.line,te,ne<0?"after":"before")}function Kl(x,z,ne,te,ie){if(x){z.doc.direction=="rtl"&&(ie=-ie);var ce=Cr(ne,z.doc.direction);if(ce){var ye=ie<0?Kt(ce):ce[0],Me=ie<0==(ye.level==1),Te=Me?"after":"before",Ne;if(ye.level>0||z.doc.direction=="rtl"){var pt=ea(z,ne);Ne=ie<0?ne.text.length-1:0;var kt=Ei(z,pt,Ne).top;Ne=Nt(function(hn){return Ei(z,pt,hn).top==kt},ie<0==(ye.level==1)?ye.from:ye.to-1,Ne),Te=="before"&&(Ne=jo(ne,Ne,1))}else Ne=ie<0?ye.to:ye.from;return new st(te,Ne,Te)}}return new st(te,ie<0?ne.text.length:0,ie<0?"before":"after")}function Zs(x,z,ne,te){var ie=Cr(z,x.doc.direction);if(!ie)return Ws(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 ce=jt(ie,ne.ch,ne.sticky),ye=ie[ce];if(x.doc.direction=="ltr"&&ye.level%2==0&&(te>0?ye.to>ne.ch:ye.from<ne.ch))return Ws(z,ne,te);var Me=function(Gr,ii){return jo(z,Gr instanceof st?Gr.ch:Gr,ii)},Te,Ne=function(Gr){return x.options.lineWrapping?(Te=Te||ea(x,z),Fa(x,z,Te,Gr)):{begin:0,end:z.text.length}},pt=Ne(ne.sticky=="before"?Me(ne,-1):ne.ch);if(x.doc.direction=="rtl"||ye.level==1){var kt=ye.level==1==te<0,hn=Me(ne,kt?1:-1);if(hn!=null&&(kt?hn<=ye.to&&hn<=pt.end:hn>=ye.from&&hn>=pt.begin)){var en=kt?"before":"after";return new st(ne.line,hn,en)}}var Yn=function(Gr,ii,jr){for(var ai=function(to,Wo){return Wo?new st(ne.line,Me(to,1),"before"):new st(ne.line,to,"after")};Gr>=0&&Gr<ie.length;Gr+=ii){var Fi=ie[Gr],Hi=ii>0==(Fi.level!=1),ba=Hi?jr.begin:Me(jr.end,-1);if(Fi.from<=ba&&ba<Fi.to||(ba=Hi?Fi.from:Me(Fi.to,-1),jr.begin<=ba&&ba<jr.end))return ai(ba,Hi)}},mr=Yn(ce+te,te,pt);if(mr)return mr;var Br=te>0?pt.end:Me(pt.begin,-1);return Br!=null&&!(te>0&&Br==z.text.length)&&(mr=Yn(te>0?0:ie.length-1,te,Ne(Br)),mr)?mr:null}var ac={selectAll:td,singleSelection:function(x){return x.setSelection(x.getCursor("anchor"),x.getCursor("head"),ot)},killLine:function(x){return ks(x,function(z){if(z.empty()){var ne=Yt(x.doc,z.head.line).text.length;return z.head.ch==ne&&z.head.line<x.lastLine()?{from:z.head,to:st(z.head.line+1,0)}:{from:z.head,to:st(z.head.line,ne)}}else return{from:z.from(),to:z.to()}})},deleteLine:function(x){return ks(x,function(z){return{from:st(z.from().line,0),to:On(x.doc,st(z.to().line+1,0))}})},delLineLeft:function(x){return ks(x,function(z){return{from:st(z.from().line,0),to:z.from()}})},delWrappedLineLeft:function(x){return ks(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 ks(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(st(x.firstLine(),0))},goDocEnd:function(x){return x.extendSelection(st(x.lastLine()))},goLineStart:function(x){return x.extendSelectionsBy(function(z){return sd(x,z.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(x){return x.extendSelectionsBy(function(z){return lf(x,z.head)},{origin:"+move",bias:1})},goLineEnd:function(x){return x.extendSelectionsBy(function(z){return ld(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")},Tt)},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")},Tt)},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/)?lf(x,z.head):te},Tt)},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 ce=ne[ie].from(),ye=Je(x.getLine(ce.line),ce.ch,te);z.push(Ut(te-ye%te))}x.replaceSelections(z)},defaultTab:function(x){x.somethingSelected()?x.indentSelection("add"):x.execCommand("insertTab")},transposeChars:function(x){return ga(x,function(){for(var z=x.listSelections(),ne=[],te=0;te<z.length;te++)if(z[te].empty()){var ie=z[te].head,ce=Yt(x.doc,ie.line).text;if(ce){if(ie.ch==ce.length&&(ie=new st(ie.line,ie.ch-1)),ie.ch>0)ie=new st(ie.line,ie.ch+1),x.replaceRange(ce.charAt(ie.ch-1)+ce.charAt(ie.ch-2),st(ie.line,ie.ch-2),ie,"+transpose");else if(ie.line>x.doc.first){var ye=Yt(x.doc,ie.line-1).text;ye&&(ie=new st(ie.line,1),x.replaceRange(ce.charAt(0)+x.doc.lineSeparator()+ye.charAt(ye.length-1),st(ie.line-1,ye.length-1),ie,"+transpose"))}}ne.push(new Ua(ie,ie))}x.setSelections(ne)})},newlineAndIndent:function(x){return ga(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);zo(x)})},openLine:function(x){return x.replaceSelection(`
`,"start")},toggleOverwrite:function(x){return x.toggleOverwrite()}};function sd(x,z){var ne=Yt(x.doc,z),te=lt(ne);return te!=ne&&(z=qn(te)),Kl(!0,x,te,z,1)}function ld(x,z){var ne=Yt(x.doc,z),te=wt(ne);return te!=ne&&(z=qn(te)),Kl(!0,x,ne,z,-1)}function lf(x,z){var ne=sd(x,z.line),te=Yt(x.doc,ne.line),ie=Cr(te,x.doc.direction);if(!ie||ie[0].level==0){var ce=Math.max(ne.ch,te.text.search(/\S/)),ye=z.line==ne.line&&z.ch<=ce&&z.ch;return st(ne.line,ye?0:ce,ne.sticky)}return ne}function Do(x,z,ne){if(typeof z=="string"&&(z=ac[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)!=yn}finally{x.display.shift=te,x.state.suppressEdits=!1}return ie}function Us(x,z,ne){for(var te=0;te<x.state.keyMaps.length;te++){var ie=rl(z,x.state.keyMaps[te],ne,x);if(ie)return ie}return x.options.extraKeys&&rl(z,x.options.extraKeys,ne,x)||rl(z,x.options.keyMap,ne,x)}var rh=new Ae;function oc(x,z,ne,te){var ie=x.state.keySeq;if(ie){if(Dc(z))return"handled";if(/\'$/.test(z)?x.state.keySeq=null:rh.set(50,function(){x.state.keySeq==ie&&(x.state.keySeq=null,x.display.input.reset())}),bu(x,ie+" "+z,ne,te))return!0}return bu(x,z,ne,te)}function bu(x,z,ne,te){var ie=Us(x,z,te);return ie=="multi"&&(x.state.keySeq=z),ie=="handled"&&Kn(x,"keyHandled",x,z,ne),(ie=="handled"||ie=="multi")&&(Mr(ne),Ci(x)),!!ie}function La(x,z){var ne=zl(z,!0);return ne?z.shiftKey&&!x.state.keySeq?oc(x,"Shift-"+ne,z,function(te){return Do(x,te,!0)})||oc(x,ne,z,function(te){if(typeof te=="string"?/^go[A-Z]/.test(te):te.motion)return Do(x,te)}):oc(x,ne,z,function(te){return Do(x,te)}):!1}function sc(x,z,ne){return oc(x,"'"+ne+"'",z,function(te){return Do(x,te,!0)})}var il=null;function Ic(x){var z=this;if(!(x.target&&x.target!=z.display.input.getField())&&(z.curOp.focus=Pt(),!$t(z,x))){ve&&_e<11&&x.keyCode==27&&(x.returnValue=!1);var ne=x.keyCode;z.display.shift=ne==16||x.shiftKey;var te=La(z,x);Ee&&(il=te?ne:null,!te&&ne==88&&!Ln&&(De?x.metaKey:x.ctrlKey)&&z.replaceSelection("",null,"cut")),he&&!De&&!te&&ne==46&&x.shiftKey&&!x.ctrlKey&&document.execCommand&&document.execCommand("cut"),ne==18&&!/\bCodeMirror-crosshair\b/.test(z.display.lineDiv.className)&&Un(z)}}function Un(x){var z=x.display.lineDiv;En(z,"CodeMirror-crosshair");function ne(te){(te.keyCode==18||!te.altKey)&&(Ue(z,"CodeMirror-crosshair"),br(document,"keyup",ne),br(document,"mouseover",ne))}Mn(document,"keyup",ne),Mn(document,"mouseover",ne)}function cf(x){x.keyCode==16&&(this.doc.sel.shift=!1),$t(this,x)}function uf(x){var z=this;if(!(x.target&&x.target!=z.display.input.getField())&&!(qi(z.display,x)||$t(z,x)||x.ctrlKey&&!x.altKey||De&&x.metaKey)){var ne=x.keyCode,te=x.charCode;if(Ee&&ne==il){il=null,Mr(x);return}if(!(Ee&&(!x.which||x.which<10)&&La(z,x))){var ie=String.fromCharCode(te==null?ne:te);ie!="\b"&&(sc(z,x,ie)||z.display.input.onKeyPress(x))}}}var cd=400,ud=function(x,z,ne){this.time=x,this.pos=z,this.button=ne};ud.prototype.compare=function(x,z,ne){return this.time+cd>x&&bt(z,this.pos)==0&&ne==this.button};var al,Pc;function ih(x,z){var ne=+new Date;return Pc&&Pc.compare(ne,x,z)?(al=Pc=null,"triple"):al&&al.compare(ne,x,z)?(Pc=new ud(ne,x,z),al=null,"double"):(al=new ud(ne,x,z),Pc=null,"single")}function Vo(x){var z=this,ne=z.display;if(!($t(z,x)||ne.activeTouch&&ne.input.supportsTouch())){if(ne.input.ensurePolled(),ne.shift=x.shiftKey,qi(ne,x)){ke||(ne.scroller.draggable=!1,setTimeout(function(){return ne.scroller.draggable=!0},100));return}if(!ts(z,x)){var te=Ao(z,x),ie=hr(x),ce=te?ih(te,ie):"single";window.focus(),ie==1&&z.state.selectingText&&z.state.selectingText(x),!(te&&gl(z,ie,te,ce,x))&&(ie==1?te?wu(z,te,ce,x):ni(x)==ne.scroller&&Mr(x):ie==2?(te&&Nl(z.doc,te),setTimeout(function(){return ne.input.focus()},20)):ie==3&&(Ie?z.display.input.onContextMenu(x):Ha(z)))}}}function gl(x,z,ne,te,ie){var ce="Click";return te=="double"?ce="Double"+ce:te=="triple"&&(ce="Triple"+ce),ce=(z==1?"Left":z==2?"Middle":"Right")+ce,oc(x,ml(ce,ie),ie,function(ye){if(typeof ye=="string"&&(ye=ac[ye]),!ye)return!1;var Me=!1;try{x.isReadOnly()&&(x.state.suppressEdits=!0),Me=ye(x,ne)!=yn}finally{x.state.suppressEdits=!1}return Me})}function xu(x,z,ne){var te=x.getOption("configureMouse"),ie=te?te(x,z,ne):{};if(ie.unit==null){var ce=At?ne.shiftKey&&ne.metaKey:ne.altKey;ie.unit=ce?"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=De?ne.metaKey:ne.ctrlKey),ie.moveOnDrag==null&&(ie.moveOnDrag=!(De?ne.altKey:ne.ctrlKey)),ie}function wu(x,z,ne,te){ve?setTimeout(ur(Di,x),0):x.curOp.focus=Pt();var ie=xu(x,ne,te),ce=x.doc.sel,ye;x.options.dragDrop&&mi&&!x.isReadOnly()&&ne=="single"&&(ye=ce.contains(z))>-1&&(bt((ye=ce.ranges[ye]).from(),z)<0||z.xRel>0)&&(bt(ye.to(),z)>0||z.xRel<0)?ah(x,te,z,ie):dd(x,te,z,ie)}function ah(x,z,ne,te){var ie=x.display,ce=!1,ye=za(x,function(Ne){ke&&(ie.scroller.draggable=!1),x.state.draggingText=!1,br(ie.wrapper.ownerDocument,"mouseup",ye),br(ie.wrapper.ownerDocument,"mousemove",Me),br(ie.scroller,"dragstart",Te),br(ie.scroller,"drop",ye),ce||(Mr(Ne),te.addNew||Nl(x.doc,ne,null,null,te.extend),ke&&!tt||ve&&_e==9?setTimeout(function(){ie.wrapper.ownerDocument.body.focus({preventScroll:!0}),ie.input.focus()},20):ie.input.focus())}),Me=function(Ne){ce=ce||Math.abs(z.clientX-Ne.clientX)+Math.abs(z.clientY-Ne.clientY)>=10},Te=function(){return ce=!0};ke&&(ie.scroller.draggable=!0),x.state.draggingText=ye,ye.copy=!te.moveOnDrag,ie.scroller.dragDrop&&ie.scroller.dragDrop(),Mn(ie.wrapper.ownerDocument,"mouseup",ye),Mn(ie.wrapper.ownerDocument,"mousemove",Me),Mn(ie.scroller,"dragstart",Te),Mn(ie.scroller,"drop",ye),Ha(x),setTimeout(function(){return ie.input.focus()},20)}function df(x,z,ne){if(ne=="char")return new Ua(z,z);if(ne=="word")return x.findWordAt(z);if(ne=="line")return new Ua(st(z.line,0),On(x.doc,st(z.line+1,0)));var te=ne(x,z);return new Ua(te.from,te.to)}function dd(x,z,ne,te){var ie=x.display,ce=x.doc;Mr(z);var ye,Me,Te=ce.sel,Ne=Te.ranges;if(te.addNew&&!te.extend?(Me=ce.sel.contains(ne),Me>-1?ye=Ne[Me]:ye=new Ua(ne,ne)):(ye=ce.sel.primary(),Me=ce.sel.primIndex),te.unit=="rectangle")te.addNew||(ye=new Ua(ne,ne)),ne=Ao(x,z,!0,!0),Me=-1;else{var pt=df(x,ne,te.unit);te.extend?ye=fu(ye,pt.anchor,pt.head,te.extend):ye=pt}te.addNew?Me==-1?(Me=Ne.length,To(ce,Es(x,Ne.concat([ye]),Me),{scroll:!1,origin:"*mouse"})):Ne.length>1&&Ne[Me].empty()&&te.unit=="char"&&!te.extend?(To(ce,Es(x,Ne.slice(0,Me).concat(Ne.slice(Me+1)),0),{scroll:!1,origin:"*mouse"}),Te=ce.sel):ws(ce,Me,ye,nt):(Me=0,To(ce,new vs([ye],0),nt),Te=ce.sel);var kt=ne;function hn(jr){if(bt(kt,jr)!=0)if(kt=jr,te.unit=="rectangle"){for(var ai=[],Fi=x.options.tabSize,Hi=Je(Yt(ce,ne.line).text,ne.ch,Fi),ba=Je(Yt(ce,jr.line).text,jr.ch,Fi),to=Math.min(Hi,ba),Wo=Math.max(Hi,ba),bo=Math.min(ne.line,jr.line),us=Math.min(x.lastLine(),Math.max(ne.line,jr.line));bo<=us;bo++){var ds=Yt(ce,bo).text,Io=rn(ds,to,Fi);to==Wo?ai.push(new Ua(st(bo,Io),st(bo,Io))):ds.length>Io&&ai.push(new Ua(st(bo,Io),st(bo,rn(ds,Wo,Fi))))}ai.length||ai.push(new Ua(ne,ne)),To(ce,Es(x,Te.ranges.slice(0,Me).concat(ai),Me),{origin:"*mouse",scroll:!1}),x.scrollIntoView(jr)}else{var fs=ye,sa=df(x,jr,te.unit),So=fs.anchor,xo;bt(sa.anchor,So)>0?(xo=sa.head,So=pn(fs.from(),sa.anchor)):(xo=sa.anchor,So=cn(fs.to(),sa.head));var Co=Te.ranges.slice(0);Co[Me]=ff(x,new Ua(On(ce,So),xo)),To(ce,Es(x,Co,Me),nt)}}var en=ie.wrapper.getBoundingClientRect(),Yn=0;function mr(jr){var ai=++Yn,Fi=Ao(x,jr,!0,te.unit=="rectangle");if(Fi)if(bt(Fi,kt)!=0){x.curOp.focus=Pt(),hn(Fi);var Hi=va(ie,ce);(Fi.line>=Hi.to||Fi.line<Hi.from)&&setTimeout(za(x,function(){Yn==ai&&mr(jr)}),150)}else{var ba=jr.clientY<en.top?-20:jr.clientY>en.bottom?20:0;ba&&setTimeout(za(x,function(){Yn==ai&&(ie.scroller.scrollTop+=ba,mr(jr))}),50)}}function Br(jr){x.state.selectingText=!1,Yn=1/0,jr&&(Mr(jr),ie.input.focus()),br(ie.wrapper.ownerDocument,"mousemove",Gr),br(ie.wrapper.ownerDocument,"mouseup",ii),ce.history.lastSelOrigin=null}var Gr=za(x,function(jr){jr.buttons===0||!hr(jr)?Br(jr):mr(jr)}),ii=za(x,Br);x.state.selectingText=ii,Mn(ie.wrapper.ownerDocument,"mousemove",Gr),Mn(ie.wrapper.ownerDocument,"mouseup",ii)}function ff(x,z){var ne=z.anchor,te=z.head,ie=Yt(x.doc,ne.line);if(bt(ne,te)==0&&ne.sticky==te.sticky)return z;var ce=Cr(ie);if(!ce)return z;var ye=jt(ce,ne.ch,ne.sticky),Me=ce[ye];if(Me.from!=ne.ch&&Me.to!=ne.ch)return z;var Te=ye+(Me.from==ne.ch==(Me.level!=1)?0:1);if(Te==0||Te==ce.length)return z;var Ne;if(te.line!=ne.line)Ne=(te.line-ne.line)*(x.doc.direction=="ltr"?1:-1)>0;else{var pt=jt(ce,te.ch,te.sticky),kt=pt-ye||(te.ch-ne.ch)*(Me.level==1?-1:1);pt==Te-1||pt==Te?Ne=kt<0:Ne=kt>0}var hn=ce[Te+(Ne?-1:0)],en=Ne==(hn.level==1),Yn=en?hn.from:hn.to,mr=en?"after":"before";return ne.ch==Yn&&ne.sticky==mr?z:new Ua(new st(ne.line,Yn,mr),te)}function Oc(x,z,ne,te){var ie,ce;if(z.touches)ie=z.touches[0].clientX,ce=z.touches[0].clientY;else try{ie=z.clientX,ce=z.clientY}catch(hn){return!1}if(ie>=Math.floor(x.display.gutters.getBoundingClientRect().right))return!1;te&&Mr(z);var ye=x.display,Me=ye.lineDiv.getBoundingClientRect();if(ce>Me.bottom||!Jn(x,ne))return Dr(z);ce-=Me.top-ye.viewOffset;for(var Te=0;Te<x.display.gutterSpecs.length;++Te){var Ne=ye.gutters.childNodes[Te];if(Ne&&Ne.getBoundingClientRect().right>=ie){var pt=or(x.doc,ce),kt=x.display.gutterSpecs[Te];return at(x,ne,x,pt,kt.className,z),Dr(z)}}}function ts(x,z){return Oc(x,z,"gutterClick",!0)}function vl(x,z){qi(x.display,z)||hf(x,z)||$t(x,z,"contextmenu")||Ie||x.display.input.onContextMenu(z)}function hf(x,z){return Jn(x,"gutterContextMenu")?Oc(x,z,"gutterContextMenu",!1):!1}function fd(x){x.display.wrapper.className=x.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+x.options.theme.replace(/(^|\s)\s*/g," cm-s-"),pi(x)}var yl={toString:function(){return"CodeMirror.Init"}},pf={},Su={};function oh(x){var z=x.optionHandlers;function ne(te,ie,ce,ye){x.defaults[te]=ie,ce&&(z[te]=ye?function(Me,Te,Ne){Ne!=yl&&ce(Me,Te,Ne)}:ce)}x.defineOption=ne,x.Init=yl,ne("value","",function(te,ie){return te.setValue(ie)},!0),ne("mode",null,function(te,ie){te.doc.modeOption=ie,ru(te)},!0),ne("indentUnit",2,ru,!0),ne("indentWithTabs",!1),ne("smartIndent",!0),ne("tabSize",4,function(te){Bl(te),pi(te),Oi(te)},!0),ne("lineSeparator",null,function(te,ie){if(te.doc.lineSep=ie,!!ie){var ce=[],ye=te.doc.first;te.doc.iter(function(Te){for(var Ne=0;;){var pt=Te.text.indexOf(ie,Ne);if(pt==-1)break;Ne=pt+ie.length,ce.push(st(ye,pt))}ye++});for(var Me=ce.length-1;Me>=0;Me--)ec(te.doc,ie,ce[Me],st(ce[Me].line,ce[Me].ch+ie.length))}}),ne("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(te,ie,ce){te.state.specialChars=new RegExp(ie.source+(ie.test(" ")?"":"| "),"g"),ce!=yl&&te.refresh()}),ne("specialCharPlaceholder",Oe,function(te){return te.refresh()},!0),ne("electricChars",!0),ne("inputStyle",Ge?"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",!Xt),ne("wholeLineUpdateBefore",!0),ne("theme","default",function(te){fd(te),Ql(te)},!0),ne("keyMap","default",function(te,ie,ce){var ye=ss(ie),Me=ce!=yl&&ss(ce);Me&&Me.detach&&Me.detach(te,ye),ye.attach&&ye.attach(te,Me||null)}),ne("extraKeys",null),ne("configureMouse",null),ne("lineWrapping",!1,mf,!0),ne("gutters",[],function(te,ie){te.display.gutterSpecs=eu(ie,te.options.lineNumbers),Ql(te)},!0),ne("fixedGutter",!0,function(te,ie){te.display.gutters.style.left=ie?Oo(te.display)+"px":"0",te.refresh()},!0),ne("coverGutterNextToScrollbar",!1,function(te){return xs(te)},!0),ne("scrollbarStyle","native",function(te){vc(te),xs(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=eu(te.options.gutters,ie),Ql(te)},!0),ne("firstLineNumber",1,Ql,!0),ne("lineNumberFormatter",function(te){return te},Ql,!0),ne("showCursorWhenSelecting",!1,Qo,!0),ne("resetSelectionOnContextMenu",!0),ne("lineWiseCopyCut",!0),ne("pasteLinesPerSelection",!0),ne("selectionsMayTouch",!1),ne("readOnly",!1,function(te,ie){ie=="nocursor"&&(Fo(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,sh),ne("allowDropFileTypes",null),ne("cursorBlinkRate",530),ne("cursorScrollMargin",0),ne("cursorHeight",1,Qo,!0),ne("singleCursorHeightPerLine",!0,Qo,!0),ne("workTime",100),ne("workDelay",100),ne("flattenSpans",!0,Bl,!0),ne("addModeClass",!1,Bl,!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,Bl,!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 sh(x,z,ne){var te=ne&&ne!=yl;if(!z!=!te){var ie=x.display.dragFunctions,ce=z?Mn:br;ce(x.display.scroller,"dragstart",ie.start),ce(x.display.scroller,"dragenter",ie.enter),ce(x.display.scroller,"dragover",ie.over),ce(x.display.scroller,"dragleave",ie.leave),ce(x.display.scroller,"drop",ie.drop)}}function mf(x){x.options.lineWrapping?(En(x.display.wrapper,"CodeMirror-wrap"),x.display.sizer.style.minWidth="",x.display.sizerWidth=null):(Ue(x.display.wrapper,"CodeMirror-wrap"),An(x)),lo(x),Oi(x),pi(x),setTimeout(function(){return xs(x)},100)}function ia(x,z){var ne=this;if(!(this instanceof ia))return new ia(x,z);this.options=z=z?wr(z):{},wr(pf,z,!1);var te=z.value;typeof te=="string"?te=new Eo(te,z.mode,null,z.lineSeparator,z.direction):z.mode&&(te.modeOption=z.mode),this.doc=te;var ie=new ia.inputStyles[z.inputStyle](this),ce=this.display=new Gd(x,te,ie,z);ce.wrapper.CodeMirror=this,fd(this),z.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),vc(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 Ae,keySeq:null,specialChars:null},z.autofocus&&!Ge&&ce.input.focus(),ve&&_e<11&&setTimeout(function(){return ne.display.input.reset(!0)},20),lh(this),ad(),Ks(this),this.curOp.forceUpdate=!0,wc(this,te),z.autofocus&&!Ge||this.hasFocus()?setTimeout(function(){ne.hasFocus()&&!ne.state.focused&&Va(ne)},20):Fo(this);for(var ye in Su)Su.hasOwnProperty(ye)&&Su[ye](this,z[ye],yl);bc(this),z.finishInit&&z.finishInit(this);for(var Me=0;Me<hd.length;++Me)hd[Me](this);Is(this),ke&&z.lineWrapping&&getComputedStyle(ce.lineDiv).textRendering=="optimizelegibility"&&(ce.lineDiv.style.textRendering="auto")}ia.defaults=pf,ia.optionHandlers=Su;function lh(x){var z=x.display;Mn(z.scroller,"mousedown",za(x,Vo)),ve&&_e<11?Mn(z.scroller,"dblclick",za(x,function(Te){if(!$t(x,Te)){var Ne=Ao(x,Te);if(!(!Ne||ts(x,Te)||qi(x.display,Te))){Mr(Te);var pt=x.findWordAt(Ne);Nl(x.doc,pt.anchor,pt.head)}}})):Mn(z.scroller,"dblclick",function(Te){return $t(x,Te)||Mr(Te)}),Mn(z.scroller,"contextmenu",function(Te){return vl(x,Te)}),Mn(z.input.getField(),"contextmenu",function(Te){z.scroller.contains(Te.target)||vl(x,Te)});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 ce(Te){if(Te.touches.length!=1)return!1;var Ne=Te.touches[0];return Ne.radiusX<=1&&Ne.radiusY<=1}function ye(Te,Ne){if(Ne.left==null)return!0;var pt=Ne.left-Te.left,kt=Ne.top-Te.top;return pt*pt+kt*kt>20*20}Mn(z.scroller,"touchstart",function(Te){if(!$t(x,Te)&&!ce(Te)&&!ts(x,Te)){z.input.ensurePolled(),clearTimeout(ne);var Ne=+new Date;z.activeTouch={start:Ne,moved:!1,prev:Ne-te.end<=300?te:null},Te.touches.length==1&&(z.activeTouch.left=Te.touches[0].pageX,z.activeTouch.top=Te.touches[0].pageY)}}),Mn(z.scroller,"touchmove",function(){z.activeTouch&&(z.activeTouch.moved=!0)}),Mn(z.scroller,"touchend",function(Te){var Ne=z.activeTouch;if(Ne&&!qi(z,Te)&&Ne.left!=null&&!Ne.moved&&new Date-Ne.start<300){var pt=x.coordsChar(z.activeTouch,"page"),kt;!Ne.prev||ye(Ne,Ne.prev)?kt=new Ua(pt,pt):!Ne.prev.prev||ye(Ne,Ne.prev.prev)?kt=x.findWordAt(pt):kt=new Ua(st(pt.line,0),On(x.doc,st(pt.line+1,0))),x.setSelection(kt.anchor,kt.head),x.focus(),Mr(Te)}ie()}),Mn(z.scroller,"touchcancel",ie),Mn(z.scroller,"scroll",function(){z.scroller.clientHeight&&(Da(x,z.scroller.scrollTop),go(x,z.scroller.scrollLeft,!0),at(x,"scroll",x))}),Mn(z.scroller,"mousewheel",function(Te){return Xu(x,Te)}),Mn(z.scroller,"DOMMouseScroll",function(Te){return Xu(x,Te)}),Mn(z.wrapper,"scroll",function(){return z.wrapper.scrollTop=z.wrapper.scrollLeft=0}),z.dragFunctions={enter:function(Te){$t(x,Te)||Kr(Te)},over:function(Te){$t(x,Te)||(id(x,Te),Kr(Te))},start:function(Te){return th(x,Te)},drop:za(x,eh),leave:function(Te){$t(x,Te)||rc(x)}};var Me=z.input.getField();Mn(Me,"keyup",function(Te){return cf.call(x,Te)}),Mn(Me,"keydown",za(x,Ic)),Mn(Me,"keypress",za(x,uf)),Mn(Me,"focus",function(Te){return Va(x,Te)}),Mn(Me,"blur",function(Te){return Fo(x,Te)})}var hd=[];ia.defineInitHook=function(x){return hd.push(x)};function Bs(x,z,ne,te){var ie=x.doc,ce;ne==null&&(ne="add"),ne=="smart"&&(ie.mode.indent?ce=gi(x,z).state:ne="prev");var ye=x.options.tabSize,Me=Yt(ie,z),Te=Je(Me.text,null,ye);Me.stateAfter&&(Me.stateAfter=null);var Ne=Me.text.match(/^\s*/)[0],pt;if(!te&&!/\S/.test(Me.text))pt=0,ne="not";else if(ne=="smart"&&(pt=ie.mode.indent(ce,Me.text.slice(Ne.length),Me.text),pt==yn||pt>150)){if(!te)return;ne="prev"}ne=="prev"?z>ie.first?pt=Je(Yt(ie,z-1).text,null,ye):pt=0:ne=="add"?pt=Te+x.options.indentUnit:ne=="subtract"?pt=Te-x.options.indentUnit:typeof ne=="number"&&(pt=Te+ne),pt=Math.max(0,pt);var kt="",hn=0;if(x.options.indentWithTabs)for(var en=Math.floor(pt/ye);en;--en)hn+=ye,kt+=" ";if(hn<pt&&(kt+=Ut(pt-hn)),kt!=Ne)return ec(ie,kt,st(z,0),st(z,Ne.length),"+input"),Me.stateAfter=null,!0;for(var Yn=0;Yn<ie.sel.ranges.length;Yn++){var mr=ie.sel.ranges[Yn];if(mr.head.line==z&&mr.head.ch<Ne.length){var Br=st(z,Ne.length);ws(ie,Yn,new Ua(Br,Br));break}}}var Rs=null;function bl(x){Rs=x}function pd(x,z,ne,te,ie){var ce=x.doc;x.display.shift=!1,te||(te=ce.sel);var ye=+new Date-200,Me=ie=="paste"||x.state.pasteIncoming>ye,Te=yt(z),Ne=null;if(Me&&te.ranges.length>1)if(Rs&&Rs.text.join(`
`)==z){if(te.ranges.length%Rs.text.length==0){Ne=[];for(var pt=0;pt<Rs.text.length;pt++)Ne.push(ce.splitLines(Rs.text[pt]))}}else Te.length==te.ranges.length&&x.options.pasteLinesPerSelection&&(Ne=bn(Te,function(Gr){return[Gr]}));for(var kt=x.curOp.updateInput,hn=te.ranges.length-1;hn>=0;hn--){var en=te.ranges[hn],Yn=en.from(),mr=en.to();en.empty()&&(ne&&ne>0?Yn=st(Yn.line,Yn.ch-ne):x.state.overwrite&&!Me?mr=st(mr.line,Math.min(Yt(ce,mr.line).text.length,mr.ch+Kt(Te).length)):Me&&Rs&&Rs.lineWise&&Rs.text.join(`
`)==Te.join(`
`)&&(Yn=mr=st(Yn.line,0)));var Br={from:Yn,to:mr,text:Ne?Ne[hn%Ne.length]:Te,origin:ie||(Me?"paste":x.state.cutIncoming>ye?"cut":"+input")};dl(x.doc,Br),Kn(x,"inputRead",x,Br)}z&&!Me&&gd(x,z),zo(x),x.curOp.updateInput<2&&(x.curOp.updateInput=kt),x.curOp.typing=!0,x.state.pasteIncoming=x.state.cutIncoming=-1}function md(x,z){var ne=x.clipboardData&&x.clipboardData.getData("Text");if(ne)return x.preventDefault(),!z.isReadOnly()&&!z.options.disableInput&&ga(z,function(){return pd(z,ne,0,null,"paste")}),!0}function gd(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 ce=x.getModeAt(ie.head),ye=!1;if(ce.electricChars){for(var Me=0;Me<ce.electricChars.length;Me++)if(z.indexOf(ce.electricChars.charAt(Me))>-1){ye=Bs(x,ie.head.line,"smart");break}}else ce.electricInput&&ce.electricInput.test(Yt(x.doc,ie.head.line).text.slice(0,ie.head.ch))&&(ye=Bs(x,ie.head.line,"smart"));ye&&Kn(x,"electricInput",x,ie.head.line)}}}function lc(x){for(var z=[],ne=[],te=0;te<x.doc.sel.ranges.length;te++){var ie=x.doc.sel.ranges[te].head.line,ce={anchor:st(ie,0),head:st(ie+1,0)};ne.push(ce),z.push(x.getRange(ce.anchor,ce.head))}return{text:z,ranges:ne}}function gf(x,z,ne,te){x.setAttribute("autocorrect",ne?"":"off"),x.setAttribute("autocapitalize",te?"":"off"),x.setAttribute("spellcheck",!!z)}function vd(){var x=Ct("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),z=Ct("div",[x],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return ke?x.style.width="1000px":x.setAttribute("wrap","off"),dt&&(x.style.border="1px solid black"),gf(x),z}function yd(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 ce=this.options,ye=ce[te];ce[te]==ie&&te!="mode"||(ce[te]=ie,z.hasOwnProperty(te)&&za(this,z[te])(this,ie,ye),at(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"](ss(te))},removeKeyMap:function(te){for(var ie=this.state.keyMaps,ce=0;ce<ie.length;++ce)if(ie[ce]==te||ie[ce].name==te)return ie.splice(ce,1),!0},addOverlay:Ba(function(te,ie){var ce=te.token?te:x.getMode(this.options,te);if(ce.startState)throw new Error("Overlays may not be stateful.");nn(this.state.overlays,{mode:ce,modeSpec:te,opaque:ie&&ie.opaque,priority:ie&&ie.priority||0},function(ye){return ye.priority}),this.state.modeGen++,Oi(this)}),removeOverlay:Ba(function(te){for(var ie=this.state.overlays,ce=0;ce<ie.length;++ce){var ye=ie[ce].modeSpec;if(ye==te||typeof te=="string"&&ye.name==te){ie.splice(ce,1),this.state.modeGen++,Oi(this);return}}}),indentLine:Ba(function(te,ie,ce){typeof ie!="string"&&typeof ie!="number"&&(ie==null?ie=this.options.smartIndent?"smart":"prev":ie=ie?"add":"subtract"),lr(this.doc,te)&&Bs(this,te,ie,ce)}),indentSelection:Ba(function(te){for(var ie=this.doc.sel.ranges,ce=-1,ye=0;ye<ie.length;ye++){var Me=ie[ye];if(Me.empty())Me.head.line>ce&&(Bs(this,Me.head.line,te,!0),ce=Me.head.line,ye==this.doc.sel.primIndex&&zo(this));else{var Te=Me.from(),Ne=Me.to(),pt=Math.max(ce,Te.line);ce=Math.min(this.lastLine(),Ne.line-(Ne.ch?0:1))+1;for(var kt=pt;kt<ce;++kt)Bs(this,kt,te);var hn=this.doc.sel.ranges;Te.ch==0&&ie.length==hn.length&&hn[ye].from().ch>0&&ws(this.doc,ye,new Ua(Te,hn[ye].to()),ot)}}}),getTokenAt:function(te,ie){return ji(this,te,ie)},getLineTokens:function(te,ie){return ji(this,st(te),ie,!0)},getTokenTypeAt:function(te){te=On(this.doc,te);var ie=Li(this,Yt(this.doc,te.line)),ce=0,ye=(ie.length-1)/2,Me=te.ch,Te;if(Me==0)Te=ie[2];else for(;;){var Ne=ce+ye>>1;if((Ne?ie[Ne*2-1]:0)>=Me)ye=Ne;else if(ie[Ne*2+1]<Me)ce=Ne+1;else{Te=ie[Ne*2+2];break}}var pt=Te?Te.indexOf("overlay "):-1;return pt<0?Te:pt==0?null:Te.slice(0,pt-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 ce=[];if(!ne.hasOwnProperty(ie))return ce;var ye=ne[ie],Me=this.getModeAt(te);if(typeof Me[ie]=="string")ye[Me[ie]]&&ce.push(ye[Me[ie]]);else if(Me[ie])for(var Te=0;Te<Me[ie].length;Te++){var Ne=ye[Me[ie][Te]];Ne&&ce.push(Ne)}else Me.helperType&&ye[Me.helperType]?ce.push(ye[Me.helperType]):ye[Me.name]&&ce.push(ye[Me.name]);for(var pt=0;pt<ye._global.length;pt++){var kt=ye._global[pt];kt.pred(Me,this)&&Ht(ce,kt.val)==-1&&ce.push(kt.val)}return ce},getStateAfter:function(te,ie){var ce=this.doc;return te=mn(ce,te==null?ce.first+ce.size-1:te),gi(this,te+1,ie).state},cursorCoords:function(te,ie){var ce,ye=this.doc.sel.primary();return te==null?ce=ye.head:typeof te=="object"?ce=On(this.doc,te):ce=te?ye.from():ye.to(),ha(this,ce,ie||"page")},charCoords:function(te,ie){return ja(this,On(this.doc,te),ie||"page")},coordsChar:function(te,ie){return te=Ea(this,te,ie||"page"),Ga(this,te.left,te.top)},lineAtHeight:function(te,ie){return te=Ea(this,{top:te,left:0},ie||"page").top,or(this.doc,te+this.display.viewOffset)},heightAtLine:function(te,ie,ce){var ye=!1,Me;if(typeof te=="number"){var Te=this.doc.first+this.doc.size-1;te<this.doc.first?te=this.doc.first:te>Te&&(te=Te,ye=!0),Me=Yt(this.doc,te)}else Me=te;return wa(this,Me,{top:0,left:0},ie||"page",ce||ye).top+(ye?this.doc.height-xn(Me):0)},defaultTextHeight:function(){return Ka(this.display)},defaultCharWidth:function(){return io(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(te,ie,ce,ye,Me){var Te=this.display;te=ha(this,On(this.doc,te));var Ne=te.bottom,pt=te.left;if(ie.style.position="absolute",ie.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(ie),Te.sizer.appendChild(ie),ye=="over")Ne=te.top;else if(ye=="above"||ye=="near"){var kt=Math.max(Te.wrapper.clientHeight,this.doc.height),hn=Math.max(Te.sizer.clientWidth,Te.lineSpace.clientWidth);(ye=="above"||te.bottom+ie.offsetHeight>kt)&&te.top>ie.offsetHeight?Ne=te.top-ie.offsetHeight:te.bottom+ie.offsetHeight<=kt&&(Ne=te.bottom),pt+ie.offsetWidth>hn&&(pt=hn-ie.offsetWidth)}ie.style.top=Ne+"px",ie.style.left=ie.style.right="",Me=="right"?(pt=Te.sizer.clientWidth-ie.offsetWidth,ie.style.right="0px"):(Me=="left"?pt=0:Me=="middle"&&(pt=(Te.sizer.clientWidth-ie.offsetWidth)/2),ie.style.left=pt+"px"),ce&&ul(this,{left:pt,top:Ne,right:pt+ie.offsetWidth,bottom:Ne+ie.offsetHeight})},triggerOnKeyDown:Ba(Ic),triggerOnKeyPress:Ba(uf),triggerOnKeyUp:cf,triggerOnMouseDown:Ba(Vo),execCommand:function(te){if(ac.hasOwnProperty(te))return ac[te].call(null,this)},triggerElectric:Ba(function(te){gd(this,te)}),findPosH:function(te,ie,ce,ye){var Me=1;ie<0&&(Me=-1,ie=-ie);for(var Te=On(this.doc,te),Ne=0;Ne<ie&&(Te=Cu(this.doc,Te,Me,ce,ye),!Te.hitSide);++Ne);return Te},moveH:Ba(function(te,ie){var ce=this;this.extendSelectionsBy(function(ye){return ce.display.shift||ce.doc.extend||ye.empty()?Cu(ce.doc,ye.head,te,ie,ce.options.rtlMoveVisually):te<0?ye.from():ye.to()},Tt)}),deleteH:Ba(function(te,ie){var ce=this.doc.sel,ye=this.doc;ce.somethingSelected()?ye.replaceSelection("",null,"+delete"):ks(this,function(Me){var Te=Cu(ye,Me.head,te,ie,!1);return te<0?{from:Te,to:Me.head}:{from:Me.head,to:Te}})}),findPosV:function(te,ie,ce,ye){var Me=1,Te=ye;ie<0&&(Me=-1,ie=-ie);for(var Ne=On(this.doc,te),pt=0;pt<ie;++pt){var kt=ha(this,Ne,"div");if(Te==null?Te=kt.left:kt.left=Te,Ne=vf(this,kt,Me,ce),Ne.hitSide)break}return Ne},moveV:Ba(function(te,ie){var ce=this,ye=this.doc,Me=[],Te=!this.display.shift&&!ye.extend&&ye.sel.somethingSelected();if(ye.extendSelectionsBy(function(pt){if(Te)return te<0?pt.from():pt.to();var kt=ha(ce,pt.head,"div");pt.goalColumn!=null&&(kt.left=pt.goalColumn),Me.push(kt.left);var hn=vf(ce,kt,te,ie);return ie=="page"&&pt==ye.sel.primary()&&ms(ce,ja(ce,hn,"div").top-kt.top),hn},Tt),Me.length)for(var Ne=0;Ne<ye.sel.ranges.length;Ne++)ye.sel.ranges[Ne].goalColumn=Me[Ne]}),findWordAt:function(te){var ie=this.doc,ce=Yt(ie,te.line).text,ye=te.ch,Me=te.ch;if(ce){var Te=this.getHelper(te,"wordChars");(te.sticky=="before"||Me==ce.length)&&ye?--ye:++Me;for(var Ne=ce.charAt(ye),pt=fe(Ne,Te)?function(kt){return fe(kt,Te)}:/\s/.test(Ne)?function(kt){return/\s/.test(kt)}:function(kt){return!/\s/.test(kt)&&!fe(kt)};ye>0&&pt(ce.charAt(ye-1));)--ye;for(;Me<ce.length&&pt(ce.charAt(Me));)++Me}return new Ua(st(te.line,ye),st(te.line,Me))},toggleOverwrite:function(te){te!=null&&te==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?En(this.display.cursorDiv,"CodeMirror-overwrite"):Ue(this.display.cursorDiv,"CodeMirror-overwrite"),at(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Pt()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Ba(function(te,ie){Ts(this,te,ie)}),getScrollInfo:function(){var te=this.display.scroller;return{left:te.scrollLeft,top:te.scrollTop,height:te.scrollHeight-qr(this)-this.display.barHeight,width:te.scrollWidth-qr(this)-this.display.barWidth,clientHeight:Ti(this),clientWidth:fi(this)}},scrollIntoView:Ba(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:st(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?Ds(this,te):oo(this,te.from,te.to,te.margin)}),setSize:Ba(function(te,ie){var ce=this,ye=function(Te){return typeof Te=="number"||/^\d+$/.test(String(Te))?Te+"px":Te};te!=null&&(this.display.wrapper.style.width=ye(te)),ie!=null&&(this.display.wrapper.style.height=ye(ie)),this.options.lineWrapping&&aa(this);var Me=this.display.viewFrom;this.doc.iter(Me,this.display.viewTo,function(Te){if(Te.widgets){for(var Ne=0;Ne<Te.widgets.length;Ne++)if(Te.widgets[Ne].noHScroll){Ta(ce,Me,"widget");break}}++Me}),this.curOp.forceUpdate=!0,at(this,"refresh",this)}),operation:function(te){return ga(this,te)},startOperation:function(){return Ks(this)},endOperation:function(){return Is(this)},refresh:Ba(function(){var te=this.display.cachedTextHeight;Oi(this),this.curOp.forceUpdate=!0,pi(this),Ts(this,this.doc.scrollLeft,this.doc.scrollTop),Jc(this.display),(te==null||Math.abs(te-Ka(this.display))>.5||this.options.lineWrapping)&&lo(this),at(this,"refresh",this)}),swapDoc:Ba(function(te){var ie=this.doc;return ie.cm=null,this.state.selectingText&&this.state.selectingText(),wc(this,te),pi(this),this.display.input.reset(),Ts(this,te.scrollLeft,te.scrollTop),this.curOp.forceScroll=!0,Kn(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}},ar(x),x.registerHelper=function(te,ie,ce){ne.hasOwnProperty(te)||(ne[te]=x[te]={_global:[]}),ne[te][ie]=ce},x.registerGlobalHelper=function(te,ie,ce,ye){x.registerHelper(te,ie,ye),ne[te]._global.push({pred:ce,val:ye})}}function Cu(x,z,ne,te,ie){var ce=z,ye=ne,Me=Yt(x,z.line),Te=ie&&x.direction=="rtl"?-ne:ne;function Ne(){var ii=z.line+Te;return ii<x.first||ii>=x.first+x.size?!1:(z=new st(ii,z.ch,z.sticky),Me=Yt(x,ii))}function pt(ii){var jr;if(te=="codepoint"){var ai=Me.text.charCodeAt(z.ch+(te>0?0:-1));isNaN(ai)?jr=null:jr=new st(z.line,Math.max(0,Math.min(Me.text.length,z.ch+ne*(ai>=55296&&ai<56320?2:1))),-ne)}else ie?jr=Zs(x.cm,Me,z,ne):jr=Ws(Me,z,ne);if(jr==null)if(!ii&&Ne())z=Kl(ie,x.cm,Me,z.line,Te);else return!1;else z=jr;return!0}if(te=="char"||te=="codepoint")pt();else if(te=="column")pt(!0);else if(te=="word"||te=="group")for(var kt=null,hn=te=="group",en=x.cm&&x.cm.getHelper(z,"wordChars"),Yn=!0;!(ne<0&&!pt(!Yn));Yn=!1){var mr=Me.text.charAt(z.ch)||`
`,Br=fe(mr,en)?"w":hn&&mr==`
`?"n":!hn||/\s/.test(mr)?null:"p";if(hn&&!Yn&&!Br&&(Br="s"),kt&&kt!=Br){ne<0&&(ne=1,pt(),z.sticky="after");break}if(Br&&(kt=Br),ne>0&&!pt(!Yn))break}var Gr=hu(x,z,ce,ye,!0);return ln(ce,Gr)&&(Gr.hitSide=!0),Gr}function vf(x,z,ne,te){var ie=x.doc,ce=z.left,ye;if(te=="page"){var Me=Math.min(x.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Te=Math.max(Me-.5*Ka(x.display),3);ye=(ne>0?z.bottom:z.top)+ne*Te}else te=="line"&&(ye=ne>0?z.bottom+3:z.top-3);for(var Ne;Ne=Ga(x,ce,ye),!!Ne.outside;){if(ne<0?ye<=0:ye>=ie.height){Ne.hitSide=!0;break}ye+=ne*5}return Ne}var Ya=function(x){this.cm=x,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ae,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ya.prototype.init=function(x){var z=this,ne=this,te=ne.cm,ie=ne.div=x.lineDiv;gf(ie,te.options.spellcheck,te.options.autocorrect,te.options.autocapitalize);function ce(Me){for(var Te=Me.target;Te;Te=Te.parentNode){if(Te==ie)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Te.className))break}return!1}Mn(ie,"paste",function(Me){!ce(Me)||$t(te,Me)||md(Me,te)||_e<=11&&setTimeout(za(te,function(){return z.updateFromDOM()}),20)}),Mn(ie,"compositionstart",function(Me){z.composing={data:Me.data,done:!1}}),Mn(ie,"compositionupdate",function(Me){z.composing||(z.composing={data:Me.data,done:!1})}),Mn(ie,"compositionend",function(Me){z.composing&&(Me.data!=z.composing.data&&z.readFromDOMSoon(),z.composing.done=!0)}),Mn(ie,"touchstart",function(){return ne.forceCompositionEnd()}),Mn(ie,"input",function(){z.composing||z.readFromDOMSoon()});function ye(Me){if(!(!ce(Me)||$t(te,Me))){if(te.somethingSelected())bl({lineWise:!1,text:te.getSelections()}),Me.type=="cut"&&te.replaceSelection("",null,"cut");else if(te.options.lineWiseCopyCut){var Te=lc(te);bl({lineWise:!0,text:Te.text}),Me.type=="cut"&&te.operation(function(){te.setSelections(Te.ranges,0,ot),te.replaceSelection("",null,"cut")})}else return;if(Me.clipboardData){Me.clipboardData.clearData();var Ne=Rs.text.join(`
`);if(Me.clipboardData.setData("Text",Ne),Me.clipboardData.getData("Text")==Ne){Me.preventDefault();return}}var pt=vd(),kt=pt.firstChild;te.display.lineSpace.insertBefore(pt,te.display.lineSpace.firstChild),kt.value=Rs.text.join(`
`);var hn=document.activeElement;$n(kt),setTimeout(function(){te.display.lineSpace.removeChild(pt),hn.focus(),hn==ie&&ne.showPrimarySelection()},50)}}Mn(ie,"copy",ye),Mn(ie,"cut",ye)},Ya.prototype.screenReaderLabelChanged=function(x){x?this.div.setAttribute("aria-label",x):this.div.removeAttribute("aria-label")},Ya.prototype.prepareSelection=function(){var x=ps(this.cm,!1);return x.focus=document.activeElement==this.div,x},Ya.prototype.showSelection=function(x,z){!x||!this.cm.display.view.length||((x.focus||z)&&this.showPrimarySelection(),this.showMultipleSelections(x))},Ya.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ya.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 ce=Mu(z,x.anchorNode,x.anchorOffset),ye=Mu(z,x.focusNode,x.focusOffset);if(!(ce&&!ce.bad&&ye&&!ye.bad&&bt(pn(ce,ye),te)==0&&bt(cn(ce,ye),ie)==0)){var Me=z.display.view,Te=te.line>=z.display.viewFrom&&yf(z,te)||{node:Me[0].measure.map[2],offset:0},Ne=ie.line<z.display.viewTo&&yf(z,ie);if(!Ne){var pt=Me[Me.length-1].measure,kt=pt.maps?pt.maps[pt.maps.length-1]:pt.map;Ne={node:kt[kt.length-1],offset:kt[kt.length-2]-kt[kt.length-3]}}if(!Te||!Ne){x.removeAllRanges();return}var hn=x.rangeCount&&x.getRangeAt(0),en;try{en=qe(Te.node,Te.offset,Ne.offset,Ne.node)}catch(Yn){}en&&(!he&&z.state.focused?(x.collapse(Te.node,Te.offset),en.collapsed||(x.removeAllRanges(),x.addRange(en))):(x.removeAllRanges(),x.addRange(en)),hn&&x.anchorNode==null?x.addRange(hn):he&&this.startGracePeriod()),this.rememberSelection()}},Ya.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)},Ya.prototype.showMultipleSelections=function(x){_t(this.cm.display.cursorDiv,x.cursors),_t(this.cm.display.selectionDiv,x.selection)},Ya.prototype.rememberSelection=function(){var x=this.getSelection();this.lastAnchorNode=x.anchorNode,this.lastAnchorOffset=x.anchorOffset,this.lastFocusNode=x.focusNode,this.lastFocusOffset=x.focusOffset},Ya.prototype.selectionInEditor=function(){var x=this.getSelection();if(!x.rangeCount)return!1;var z=x.getRangeAt(0).commonAncestorContainer;return Rt(this.div,z)},Ya.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ya.prototype.blur=function(){this.div.blur()},Ya.prototype.getField=function(){return this.div},Ya.prototype.supportsTouch=function(){return!0},Ya.prototype.receivedFocus=function(){var x=this;this.selectionInEditor()?this.pollSelection():ga(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)},Ya.prototype.selectionChanged=function(){var x=this.getSelection();return x.anchorNode!=this.lastAnchorNode||x.anchorOffset!=this.lastAnchorOffset||x.focusNode!=this.lastFocusNode||x.focusOffset!=this.lastFocusOffset},Ya.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var x=this.getSelection(),z=this.cm;if(it&&me&&this.cm.display.gutterSpecs.length&&ch(x.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var ne=Mu(z,x.anchorNode,x.anchorOffset),te=Mu(z,x.focusNode,x.focusOffset);ne&&te&&ga(z,function(){To(z.doc,Ps(ne,te),ot),(ne.bad||te.bad)&&(z.curOp.selectionChanged=!0)})}}},Ya.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=st(te.line-1,Yt(x.doc,te.line-1).length)),ie.ch==Yt(x.doc,ie.line).text.length&&ie.line<x.lastLine()&&(ie=st(ie.line+1,0)),te.line<z.viewFrom||ie.line>z.viewTo-1)return!1;var ce,ye,Me;te.line==z.viewFrom||(ce=ra(x,te.line))==0?(ye=qn(z.view[0].line),Me=z.view[0].node):(ye=qn(z.view[ce].line),Me=z.view[ce-1].node.nextSibling);var Te=ra(x,ie.line),Ne,pt;if(Te==z.view.length-1?(Ne=z.viewTo-1,pt=z.lineDiv.lastChild):(Ne=qn(z.view[Te+1].line)-1,pt=z.view[Te+1].node.previousSibling),!Me)return!1;for(var kt=x.doc.splitLines(uh(x,Me,pt,ye,Ne)),hn=Hn(x.doc,st(ye,0),st(Ne,Yt(x.doc,Ne).text.length));kt.length>1&&hn.length>1;)if(Kt(kt)==Kt(hn))kt.pop(),hn.pop(),Ne--;else if(kt[0]==hn[0])kt.shift(),hn.shift(),ye++;else break;for(var en=0,Yn=0,mr=kt[0],Br=hn[0],Gr=Math.min(mr.length,Br.length);en<Gr&&mr.charCodeAt(en)==Br.charCodeAt(en);)++en;for(var ii=Kt(kt),jr=Kt(hn),ai=Math.min(ii.length-(kt.length==1?en:0),jr.length-(hn.length==1?en:0));Yn<ai&&ii.charCodeAt(ii.length-Yn-1)==jr.charCodeAt(jr.length-Yn-1);)++Yn;if(kt.length==1&&hn.length==1&&ye==te.line)for(;en&&en>te.ch&&ii.charCodeAt(ii.length-Yn-1)==jr.charCodeAt(jr.length-Yn-1);)en--,Yn++;kt[kt.length-1]=ii.slice(0,ii.length-Yn).replace(/^\u200b+/,""),kt[0]=kt[0].slice(en).replace(/\u200b+$/,"");var Fi=st(ye,en),Hi=st(Ne,hn.length?Kt(hn).length-Yn:0);if(kt.length>1||kt[0]||bt(Fi,Hi))return ec(x.doc,kt,Fi,Hi,"+input"),!0},Ya.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ya.prototype.reset=function(){this.forceCompositionEnd()},Ya.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ya.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))},Ya.prototype.updateFromDOM=function(){var x=this;(this.cm.isReadOnly()||!this.pollContent())&&ga(this.cm,function(){return Oi(x.cm)})},Ya.prototype.setUneditable=function(x){x.contentEditable="false"},Ya.prototype.onKeyPress=function(x){x.charCode==0||this.composing||(x.preventDefault(),this.cm.isReadOnly()||za(this.cm,pd)(this.cm,String.fromCharCode(x.charCode==null?x.keyCode:x.charCode),0))},Ya.prototype.readOnlyChanged=function(x){this.div.contentEditable=String(x!="nocursor")},Ya.prototype.onContextMenu=function(){},Ya.prototype.resetPosition=function(){},Ya.prototype.needsContentAttribute=!0;function yf(x,z){var ne=ca(x,z.line);if(!ne||ne.hidden)return null;var te=Yt(x.doc,z.line),ie=Na(ne,te,z.line),ce=Cr(te,x.doc.direction),ye="left";if(ce){var Me=jt(ce,z.ch);ye=Me%2?"right":"left"}var Te=ki(ie.map,z.ch,ye);return Te.offset=Te.collapse=="right"?Te.end:Te.start,Te}function ch(x){for(var z=x;z;z=z.parentNode)if(/CodeMirror-gutter-wrapper/.test(z.className))return!0;return!1}function cc(x,z){return z&&(x.bad=!0),x}function uh(x,z,ne,te,ie){var ce="",ye=!1,Me=x.doc.lineSeparator(),Te=!1;function Ne(en){return function(Yn){return Yn.id==en}}function pt(){ye&&(ce+=Me,Te&&(ce+=Me),ye=Te=!1)}function kt(en){en&&(pt(),ce+=en)}function hn(en){if(en.nodeType==1){var Yn=en.getAttribute("cm-text");if(Yn){kt(Yn);return}var mr=en.getAttribute("cm-marker"),Br;if(mr){var Gr=x.findMarks(st(te,0),st(ie+1,0),Ne(+mr));Gr.length&&(Br=Gr[0].find(0))&&kt(Hn(x.doc,Br.from,Br.to).join(Me));return}if(en.getAttribute("contenteditable")=="false")return;var ii=/^(pre|div|p|li|table|br)$/i.test(en.nodeName);if(!/^br$/i.test(en.nodeName)&&en.textContent.length==0)return;ii&&pt();for(var jr=0;jr<en.childNodes.length;jr++)hn(en.childNodes[jr]);/^(pre|p)$/i.test(en.nodeName)&&(Te=!0),ii&&(ye=!0)}else en.nodeType==3&&kt(en.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;hn(z),z!=ne;)z=z.nextSibling,Te=!1;return ce}function Mu(x,z,ne){var te;if(z==x.display.lineDiv){if(te=x.display.lineDiv.childNodes[ne],!te)return cc(x.clipPos(st(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 ce=x.display.view[ie];if(ce.node==te)return dh(ce,z,ne)}}function dh(x,z,ne){var te=x.text.firstChild,ie=!1;if(!z||!Rt(te,z))return cc(st(qn(x.line),0),!0);if(z==te&&(ie=!0,z=te.childNodes[ne],ne=0,!z)){var ce=x.rest?Kt(x.rest):x.line;return cc(st(qn(ce),ce.text.length),ie)}var ye=z.nodeType==3?z:null,Me=z;for(!ye&&z.childNodes.length==1&&z.firstChild.nodeType==3&&(ye=z.firstChild,ne&&(ne=ye.nodeValue.length));Me.parentNode!=te;)Me=Me.parentNode;var Te=x.measure,Ne=Te.maps;function pt(Br,Gr,ii){for(var jr=-1;jr<(Ne?Ne.length:0);jr++)for(var ai=jr<0?Te.map:Ne[jr],Fi=0;Fi<ai.length;Fi+=3){var Hi=ai[Fi+2];if(Hi==Br||Hi==Gr){var ba=qn(jr<0?x.line:x.rest[jr]),to=ai[Fi]+ii;return(ii<0||Hi!=Br)&&(to=ai[Fi+(ii?1:0)]),st(ba,to)}}}var kt=pt(ye,Me,ne);if(kt)return cc(kt,ie);for(var hn=Me.nextSibling,en=ye?ye.nodeValue.length-ne:0;hn;hn=hn.nextSibling){if(kt=pt(hn,hn.firstChild,0),kt)return cc(st(kt.line,kt.ch-en),ie);en+=hn.textContent.length}for(var Yn=Me.previousSibling,mr=ne;Yn;Yn=Yn.previousSibling){if(kt=pt(Yn,Yn.firstChild,-1),kt)return cc(st(kt.line,kt.ch+mr),ie);mr+=Yn.textContent.length}}var eo=function(x){this.cm=x,this.prevInput="",this.pollingFast=!1,this.polling=new Ae,this.hasSelection=!1,this.composing=null};eo.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),dt&&(ie.style.width="0px"),Mn(ie,"input",function(){ve&&_e>=9&&z.hasSelection&&(z.hasSelection=null),ne.poll()}),Mn(ie,"paste",function(ye){$t(te,ye)||md(ye,te)||(te.state.pasteIncoming=+new Date,ne.fastPoll())});function ce(ye){if(!$t(te,ye)){if(te.somethingSelected())bl({lineWise:!1,text:te.getSelections()});else if(te.options.lineWiseCopyCut){var Me=lc(te);bl({lineWise:!0,text:Me.text}),ye.type=="cut"?te.setSelections(Me.ranges,null,ot):(ne.prevInput="",ie.value=Me.text.join(`
`),$n(ie))}else return;ye.type=="cut"&&(te.state.cutIncoming=+new Date)}}Mn(ie,"cut",ce),Mn(ie,"copy",ce),Mn(x.scroller,"paste",function(ye){if(!(qi(x,ye)||$t(te,ye))){if(!ie.dispatchEvent){te.state.pasteIncoming=+new Date,ne.focus();return}var Me=new Event("paste");Me.clipboardData=ye.clipboardData,ie.dispatchEvent(Me)}}),Mn(x.lineSpace,"selectstart",function(ye){qi(x,ye)||Mr(ye)}),Mn(ie,"compositionstart",function(){var ye=te.getCursor("from");ne.composing&&ne.composing.range.clear(),ne.composing={start:ye,range:te.markText(ye,te.getCursor("to"),{className:"CodeMirror-composing"})}}),Mn(ie,"compositionend",function(){ne.composing&&(ne.poll(),ne.composing.range.clear(),ne.composing=null)})},eo.prototype.createField=function(x){this.wrapper=vd(),this.textarea=this.wrapper.firstChild},eo.prototype.screenReaderLabelChanged=function(x){x?this.textarea.setAttribute("aria-label",x):this.textarea.removeAttribute("aria-label")},eo.prototype.prepareSelection=function(){var x=this.cm,z=x.display,ne=x.doc,te=ps(x);if(x.options.moveInputWithCursor){var ie=ha(x,ne.sel.primary().head,"div"),ce=z.wrapper.getBoundingClientRect(),ye=z.lineDiv.getBoundingClientRect();te.teTop=Math.max(0,Math.min(z.wrapper.clientHeight-10,ie.top+ye.top-ce.top)),te.teLeft=Math.max(0,Math.min(z.wrapper.clientWidth-10,ie.left+ye.left-ce.left))}return te},eo.prototype.showSelection=function(x){var z=this.cm,ne=z.display;_t(ne.cursorDiv,x.cursors),_t(ne.selectionDiv,x.selection),x.teTop!=null&&(this.wrapper.style.top=x.teTop+"px",this.wrapper.style.left=x.teLeft+"px")},eo.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&&$n(this.textarea),ve&&_e>=9&&(this.hasSelection=ne)}else x||(this.prevInput=this.textarea.value="",ve&&_e>=9&&(this.hasSelection=null))}},eo.prototype.getField=function(){return this.textarea},eo.prototype.supportsTouch=function(){return!1},eo.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!Ge||Pt()!=this.textarea))try{this.textarea.focus()}catch(x){}},eo.prototype.blur=function(){this.textarea.blur()},eo.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},eo.prototype.receivedFocus=function(){this.slowPoll()},eo.prototype.slowPoll=function(){var x=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){x.poll(),x.cm.state.focused&&x.slowPoll()})},eo.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)},eo.prototype.poll=function(){var x=this,z=this.cm,ne=this.textarea,te=this.prevInput;if(this.contextMenuPending||!z.state.focused||Cn(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(ve&&_e>=9&&this.hasSelection===ie||De&&/[\uf700-\uf7ff]/.test(ie))return z.display.input.reset(),!1;if(z.doc.sel==z.display.selForContextMenu){var ce=ie.charCodeAt(0);if(ce==8203&&!te&&(te="\u200B"),ce==8666)return this.reset(),this.cm.execCommand("undo")}for(var ye=0,Me=Math.min(te.length,ie.length);ye<Me&&te.charCodeAt(ye)==ie.charCodeAt(ye);)++ye;return ga(z,function(){pd(z,ie.slice(ye),te.length-ye,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},eo.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},eo.prototype.onKeyPress=function(){ve&&_e>=9&&(this.hasSelection=null),this.fastPoll()},eo.prototype.onContextMenu=function(x){var z=this,ne=z.cm,te=ne.display,ie=z.textarea;z.contextMenuPending&&z.contextMenuPending();var ce=Ao(ne,x),ye=te.scroller.scrollTop;if(!ce||Ee)return;var Me=ne.options.resetSelectionOnContextMenu;Me&&ne.doc.sel.contains(ce)==-1&&za(ne,To)(ne.doc,Ps(ce),ot);var Te=ie.style.cssText,Ne=z.wrapper.style.cssText,pt=z.wrapper.offsetParent.getBoundingClientRect();z.wrapper.style.cssText="position: static",ie.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(x.clientY-pt.top-5)+"px; left: "+(x.clientX-pt.left-5)+`px;
z-index: 1000; background: `+(ve?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var kt;ke&&(kt=window.scrollY),te.input.focus(),ke&&window.scrollTo(null,kt),te.input.reset(),ne.somethingSelected()||(ie.value=z.prevInput=" "),z.contextMenuPending=en,te.selForContextMenu=ne.doc.sel,clearTimeout(te.detectingSelectAll);function hn(){if(ie.selectionStart!=null){var mr=ne.somethingSelected(),Br="\u200B"+(mr?ie.value:"");ie.value="\u21DA",ie.value=Br,z.prevInput=mr?"":"\u200B",ie.selectionStart=1,ie.selectionEnd=Br.length,te.selForContextMenu=ne.doc.sel}}function en(){if(z.contextMenuPending==en&&(z.contextMenuPending=!1,z.wrapper.style.cssText=Ne,ie.style.cssText=Te,ve&&_e<9&&te.scrollbars.setScrollTop(te.scroller.scrollTop=ye),ie.selectionStart!=null)){(!ve||ve&&_e<9)&&hn();var mr=0,Br=function(){te.selForContextMenu==ne.doc.sel&&ie.selectionStart==0&&ie.selectionEnd>0&&z.prevInput=="\u200B"?za(ne,td)(ne):mr++<10?te.detectingSelectAll=setTimeout(Br,500):(te.selForContextMenu=null,te.input.reset())};te.detectingSelectAll=setTimeout(Br,200)}}if(ve&&_e>=9&&hn(),Ie){Kr(x);var Yn=function(){br(window,"mouseup",Yn),setTimeout(en,20)};Mn(window,"mouseup",Yn)}else setTimeout(en,50)},eo.prototype.readOnlyChanged=function(x){x||this.reset(),this.textarea.disabled=x=="nocursor",this.textarea.readOnly=!!x},eo.prototype.setUneditable=function(){},eo.prototype.needsContentAttribute=!1;function Hl(x,z){if(z=z?wr(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=Pt();z.autofocus=ne==x||x.getAttribute("autofocus")!=null&&ne==document.body}function te(){x.value=Me.getValue()}var ie;if(x.form&&(Mn(x.form,"submit",te),!z.leaveSubmitMethodAlone)){var ce=x.form;ie=ce.submit;try{var ye=ce.submit=function(){te(),ce.submit=ie,ce.submit(),ce.submit=ye}}catch(Te){}}z.finishInit=function(Te){Te.save=te,Te.getTextArea=function(){return x},Te.toTextArea=function(){Te.toTextArea=isNaN,te(),x.parentNode.removeChild(Te.getWrapperElement()),x.style.display="",x.form&&(br(x.form,"submit",te),!z.leaveSubmitMethodAlone&&typeof x.form.submit=="function"&&(x.form.submit=ie))}},x.style.display="none";var Me=ia(function(Te){return x.parentNode.insertBefore(Te,x.nextSibling)},z);return Me}function uc(x){x.off=br,x.on=Mn,x.wheelEventPixels=Gu,x.Doc=Eo,x.splitLines=yt,x.countColumn=Je,x.findColumn=rn,x.isWordChar=pe,x.Pass=yn,x.signal=at,x.Line=Bn,x.changeEnd=Js,x.scrollbarModel=Yl,x.Pos=st,x.cmpPos=bt,x.modes=nr,x.mimeModes=gr,x.resolveMode=ut,x.getMode=Lt,x.modeExtensions=Jt,x.extendMode=We,x.copyState=mt,x.startState=Ot,x.innerMode=zt,x.commands=ac,x.keyMap=Qa,x.keyName=zl,x.isModifierKey=Dc,x.lookupKey=rl,x.normalizeKeyMap=od,x.StringStream=Vt,x.SharedTextMarker=ya,x.TextMarker=hl,x.LineWidget=nc,x.e_preventDefault=Mr,x.e_stopPropagation=$r,x.e_stop=Kr,x.addClass=En,x.contains=Rt,x.rmClass=Ue,x.keyNames=Os}oh(ia),yd(ia);var ol="iter insert remove copy getEditor constructor".split(" ");for(var _s in Eo.prototype)Eo.prototype.hasOwnProperty(_s)&&Ht(ol,_s)<0&&(ia.prototype[_s]=function(x){return function(){return x.apply(this.doc,arguments)}}(Eo.prototype[_s]));return ar(Eo),ia.inputStyles={textarea:eo,contenteditable:Ya},ia.defineMode=function(x){!ia.defaults.mode&&x!="null"&&(ia.defaults.mode=x),Fn.apply(this,arguments)},ia.defineMIME=Xe,ia.defineMode("null",function(){return{token:function(x){return x.skipToEnd()}}}),ia.defineMIME("text/plain","null"),ia.defineExtension=function(x,z){ia.prototype[x]=z},ia.defineDocExtension=function(x,z){Eo.prototype[x]=z},ia.fromTextArea=Hl,uc(ia),ia.version="5.58.2",ia})},49047:function(Sn,Wt,se){(function(he){he(se(4631),se(29589),se(52539))})(function(he){"use strict";he.defineMode("markdown",function(He,Re){var Ve=he.getMode(He,"text/html"),ve=Ve.name=="null";function _e(Je){if(he.findModeByName){var Ae=he.findModeByName(Je);Ae&&(Je=Ae.mime||Ae.mimes[0])}var Ht=he.getMode(He,Je);return Ht.name=="null"?null:Ht}Re.highlightFormatting===void 0&&(Re.highlightFormatting=!1),Re.maxBlockquoteDepth===void 0&&(Re.maxBlockquoteDepth=0),Re.taskLists===void 0&&(Re.taskLists=!1),Re.strikethrough===void 0&&(Re.strikethrough=!1),Re.emoji===void 0&&(Re.emoji=!1),Re.fencedCodeBlockHighlighting===void 0&&(Re.fencedCodeBlockHighlighting=!0),Re.fencedCodeBlockDefaultMode===void 0&&(Re.fencedCodeBlockDefaultMode="text/plain"),Re.xml===void 0&&(Re.xml=!0),Re.tokenTypeOverrides===void 0&&(Re.tokenTypeOverrides={});var ke={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 Se in ke)ke.hasOwnProperty(Se)&&Re.tokenTypeOverrides[Se]&&(ke[Se]=Re.tokenTypeOverrides[Se]);var me=/^([*\-_])(?:\s*\1){2,}\s*$/,Ee=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,tt=/^\[(x| )\](?=\s)/i,Be=Re.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,St=/^ {0,3}(?:\={1,}|-{2,})\s*$/,dt=/^[^#!\[\]*_\\<>` "'(~:]+/,it=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,Ge=/^\s*\[[^\]]+?\]:.*$/,De=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,At=" ";function Xt(Je,Ae,Ht){return Ae.f=Ae.inline=Ht,Ht(Je,Ae)}function rt(Je,Ae,Ht){return Ae.f=Ae.block=Ht,Ht(Je,Ae)}function ft(Je){return!Je||!/\S/.test(Je.string)}function Ie(Je){if(Je.linkTitle=!1,Je.linkHref=!1,Je.linkText=!1,Je.em=!1,Je.strong=!1,Je.strikethrough=!1,Je.quote=0,Je.indentedCode=!1,Je.f==Ue){var Ae=ve;if(!Ae){var Ht=he.innerMode(Ve,Je.htmlState);Ae=Ht.mode.name=="xml"&&Ht.state.tagStart===null&&!Ht.state.context&&Ht.state.tokenize.isInText}Ae&&(Je.f=Dt,Je.block=xe,Je.htmlState=null)}return Je.trailingSpace=0,Je.trailingSpaceNewLine=!1,Je.prevLine=Je.thisLine,Je.thisLine={stream:null},null}function xe(Je,Ae){var Ht=Je.column()===Ae.indentation,Rn=ft(Ae.prevLine.stream),yn=Ae.indentedCode,ot=Ae.prevLine.hr,nt=Ae.list!==!1,Tt=(Ae.listStack[Ae.listStack.length-1]||0)+3;Ae.indentedCode=!1;var rn=Ae.indentation;if(Ae.indentationDiff===null&&(Ae.indentationDiff=Ae.indentation,nt)){for(Ae.list=null;rn<Ae.listStack[Ae.listStack.length-1];)Ae.listStack.pop(),Ae.listStack.length?Ae.indentation=Ae.listStack[Ae.listStack.length-1]:Ae.list=!1;Ae.list!==!1&&(Ae.indentationDiff=rn-Ae.listStack[Ae.listStack.length-1])}var dn=!Rn&&!ot&&!Ae.prevLine.header&&(!nt||!yn)&&!Ae.prevLine.fencedCodeEnd,Ut=(Ae.list===!1||ot||Rn)&&Ae.indentation<=Tt&&Je.match(me),Kt=null;if(Ae.indentationDiff>=4&&(yn||Ae.prevLine.fencedCodeEnd||Ae.prevLine.header||Rn))return Je.skipToEnd(),Ae.indentedCode=!0,ke.code;if(Je.eatSpace())return null;if(Ht&&Ae.indentation<=Tt&&(Kt=Je.match(Be))&&Kt[1].length<=6)return Ae.quote=0,Ae.header=Kt[1].length,Ae.thisLine.header=!0,Re.highlightFormatting&&(Ae.formatting="header"),Ae.f=Ae.inline,_t(Ae);if(Ae.indentation<=Tt&&Je.eat(">"))return Ae.quote=Ht?1:Ae.quote+1,Re.highlightFormatting&&(Ae.formatting="quote"),Je.eatSpace(),_t(Ae);if(!Ut&&!Ae.setext&&Ht&&Ae.indentation<=Tt&&(Kt=Je.match(Ee))){var bn=Kt[1]?"ol":"ul";return Ae.indentation=rn+Je.current().length,Ae.list=!0,Ae.quote=0,Ae.listStack.push(Ae.indentation),Ae.em=!1,Ae.strong=!1,Ae.code=!1,Ae.strikethrough=!1,Re.taskLists&&Je.match(tt,!1)&&(Ae.taskList=!0),Ae.f=Ae.inline,Re.highlightFormatting&&(Ae.formatting=["list","list-"+bn]),_t(Ae)}else{if(Ht&&Ae.indentation<=Tt&&(Kt=Je.match(it,!0)))return Ae.quote=0,Ae.fencedEndRE=new RegExp(Kt[1]+"+ *$"),Ae.localMode=Re.fencedCodeBlockHighlighting&&_e(Kt[2]||Re.fencedCodeBlockDefaultMode),Ae.localMode&&(Ae.localState=he.startState(Ae.localMode)),Ae.f=Ae.block=je,Re.highlightFormatting&&(Ae.formatting="code-block"),Ae.code=-1,_t(Ae);if(Ae.setext||(!dn||!nt)&&!Ae.quote&&Ae.list===!1&&!Ae.code&&!Ut&&!Ge.test(Je.string)&&(Kt=Je.lookAhead(1))&&(Kt=Kt.match(St)))return Ae.setext?(Ae.header=Ae.setext,Ae.setext=0,Je.skipToEnd(),Re.highlightFormatting&&(Ae.formatting="header")):(Ae.header=Kt[0].charAt(0)=="="?1:2,Ae.setext=Ae.header),Ae.thisLine.header=!0,Ae.f=Ae.inline,_t(Ae);if(Ut)return Je.skipToEnd(),Ae.hr=!0,Ae.thisLine.hr=!0,ke.hr;if(Je.peek()==="[")return Xt(Je,Ae,tn)}return Xt(Je,Ae,Ae.inline)}function Ue(Je,Ae){var Ht=Ve.token(Je,Ae.htmlState);if(!ve){var Rn=he.innerMode(Ve,Ae.htmlState);(Rn.mode.name=="xml"&&Rn.state.tagStart===null&&!Rn.state.context&&Rn.state.tokenize.isInText||Ae.md_inside&&Je.current().indexOf(">")>-1)&&(Ae.f=Dt,Ae.block=xe,Ae.htmlState=null)}return Ht}function je(Je,Ae){var Ht=Ae.listStack[Ae.listStack.length-1]||0,Rn=Ae.indentation<Ht,yn=Ht+3;if(Ae.fencedEndRE&&Ae.indentation<=yn&&(Rn||Je.match(Ae.fencedEndRE))){Re.highlightFormatting&&(Ae.formatting="code-block");var ot;return Rn||(ot=_t(Ae)),Ae.localMode=Ae.localState=null,Ae.block=xe,Ae.f=Dt,Ae.fencedEndRE=null,Ae.code=0,Ae.thisLine.fencedCodeEnd=!0,Rn?rt(Je,Ae,Ae.block):ot}else return Ae.localMode?Ae.localMode.token(Je,Ae.localState):(Je.skipToEnd(),ke.code)}function _t(Je){var Ae=[];if(Je.formatting){Ae.push(ke.formatting),typeof Je.formatting=="string"&&(Je.formatting=[Je.formatting]);for(var Ht=0;Ht<Je.formatting.length;Ht++)Ae.push(ke.formatting+"-"+Je.formatting[Ht]),Je.formatting[Ht]==="header"&&Ae.push(ke.formatting+"-"+Je.formatting[Ht]+"-"+Je.header),Je.formatting[Ht]==="quote"&&(!Re.maxBlockquoteDepth||Re.maxBlockquoteDepth>=Je.quote?Ae.push(ke.formatting+"-"+Je.formatting[Ht]+"-"+Je.quote):Ae.push("error"))}if(Je.taskOpen)return Ae.push("meta"),Ae.length?Ae.join(" "):null;if(Je.taskClosed)return Ae.push("property"),Ae.length?Ae.join(" "):null;if(Je.linkHref?Ae.push(ke.linkHref,"url"):(Je.strong&&Ae.push(ke.strong),Je.em&&Ae.push(ke.em),Je.strikethrough&&Ae.push(ke.strikethrough),Je.emoji&&Ae.push(ke.emoji),Je.linkText&&Ae.push(ke.linkText),Je.code&&Ae.push(ke.code),Je.image&&Ae.push(ke.image),Je.imageAltText&&Ae.push(ke.imageAltText,"link"),Je.imageMarker&&Ae.push(ke.imageMarker)),Je.header&&Ae.push(ke.header,ke.header+"-"+Je.header),Je.quote&&(Ae.push(ke.quote),!Re.maxBlockquoteDepth||Re.maxBlockquoteDepth>=Je.quote?Ae.push(ke.quote+"-"+Je.quote):Ae.push(ke.quote+"-"+Re.maxBlockquoteDepth)),Je.list!==!1){var Rn=(Je.listStack.length-1)%3;Rn?Rn===1?Ae.push(ke.list2):Ae.push(ke.list3):Ae.push(ke.list1)}return Je.trailingSpaceNewLine?Ae.push("trailing-space-new-line"):Je.trailingSpace&&Ae.push("trailing-space-"+(Je.trailingSpace%2?"a":"b")),Ae.length?Ae.join(" "):null}function Ct(Je,Ae){if(Je.match(dt,!0))return _t(Ae)}function Dt(Je,Ae){var Ht=Ae.text(Je,Ae);if(typeof Ht!="undefined")return Ht;if(Ae.list)return Ae.list=null,_t(Ae);if(Ae.taskList){var Rn=Je.match(tt,!0)[1]===" ";return Rn?Ae.taskOpen=!0:Ae.taskClosed=!0,Re.highlightFormatting&&(Ae.formatting="task"),Ae.taskList=!1,_t(Ae)}if(Ae.taskOpen=!1,Ae.taskClosed=!1,Ae.header&&Je.match(/^#+$/,!0))return Re.highlightFormatting&&(Ae.formatting="header"),_t(Ae);var yn=Je.next();if(Ae.linkTitle){Ae.linkTitle=!1;var ot=yn;yn==="("&&(ot=")"),ot=(ot+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var nt="^\\s*(?:[^"+ot+"\\\\]+|\\\\\\\\|\\\\.)"+ot;if(Je.match(new RegExp(nt),!0))return ke.linkHref}if(yn==="`"){var Tt=Ae.formatting;Re.highlightFormatting&&(Ae.formatting="code"),Je.eatWhile("`");var rn=Je.current().length;if(Ae.code==0&&(!Ae.quote||rn==1))return Ae.code=rn,_t(Ae);if(rn==Ae.code){var dn=_t(Ae);return Ae.code=0,dn}else return Ae.formatting=Tt,_t(Ae)}else if(Ae.code)return _t(Ae);if(yn==="\\"&&(Je.next(),Re.highlightFormatting)){var Ut=_t(Ae),Kt=ke.formatting+"-escape";return Ut?Ut+" "+Kt:Kt}if(yn==="!"&&Je.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return Ae.imageMarker=!0,Ae.image=!0,Re.highlightFormatting&&(Ae.formatting="image"),_t(Ae);if(yn==="["&&Ae.imageMarker&&Je.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return Ae.imageMarker=!1,Ae.imageAltText=!0,Re.highlightFormatting&&(Ae.formatting="image"),_t(Ae);if(yn==="]"&&Ae.imageAltText){Re.highlightFormatting&&(Ae.formatting="image");var Ut=_t(Ae);return Ae.imageAltText=!1,Ae.image=!1,Ae.inline=Ae.f=Rt,Ut}if(yn==="["&&!Ae.image)return Ae.linkText&&Je.match(/^.*?\]/)||(Ae.linkText=!0,Re.highlightFormatting&&(Ae.formatting="link")),_t(Ae);if(yn==="]"&&Ae.linkText){Re.highlightFormatting&&(Ae.formatting="link");var Ut=_t(Ae);return Ae.linkText=!1,Ae.inline=Ae.f=Je.match(/\(.*?\)| ?\[.*?\]/,!1)?Rt:Dt,Ut}if(yn==="<"&&Je.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){Ae.f=Ae.inline=qe,Re.highlightFormatting&&(Ae.formatting="link");var Ut=_t(Ae);return Ut?Ut+=" ":Ut="",Ut+ke.linkInline}if(yn==="<"&&Je.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){Ae.f=Ae.inline=qe,Re.highlightFormatting&&(Ae.formatting="link");var Ut=_t(Ae);return Ut?Ut+=" ":Ut="",Ut+ke.linkEmail}if(Re.xml&&yn==="<"&&Je.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var bn=Je.string.indexOf(">",Je.pos);if(bn!=-1){var nn=Je.string.substring(Je.start,bn);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(nn)&&(Ae.md_inside=!0)}return Je.backUp(1),Ae.htmlState=he.startState(Ve),rt(Je,Ae,Ue)}if(Re.xml&&yn==="<"&&Je.match(/^\/\w*?>/))return Ae.md_inside=!1,"tag";if(yn==="*"||yn==="_"){for(var we=1,ue=Je.pos==1?" ":Je.string.charAt(Je.pos-2);we<3&&Je.eat(yn);)we++;var oe=Je.peek()||" ",pe=!/\s/.test(oe)&&(!De.test(oe)||/\s/.test(ue)||De.test(ue)),fe=!/\s/.test(ue)&&(!De.test(ue)||/\s/.test(oe)||De.test(oe)),le=null,Pe=null;if(we%2&&(!Ae.em&&pe&&(yn==="*"||!fe||De.test(ue))?le=!0:Ae.em==yn&&fe&&(yn==="*"||!pe||De.test(oe))&&(le=!1)),we>1&&(!Ae.strong&&pe&&(yn==="*"||!fe||De.test(ue))?Pe=!0:Ae.strong==yn&&fe&&(yn==="*"||!pe||De.test(oe))&&(Pe=!1)),Pe!=null||le!=null){Re.highlightFormatting&&(Ae.formatting=le==null?"strong":Pe==null?"em":"strong em"),le===!0&&(Ae.em=yn),Pe===!0&&(Ae.strong=yn);var dn=_t(Ae);return le===!1&&(Ae.em=!1),Pe===!1&&(Ae.strong=!1),dn}}else if(yn===" "&&(Je.eat("*")||Je.eat("_"))){if(Je.peek()===" ")return _t(Ae);Je.backUp(1)}if(Re.strikethrough){if(yn==="~"&&Je.eatWhile(yn)){if(Ae.strikethrough){Re.highlightFormatting&&(Ae.formatting="strikethrough");var dn=_t(Ae);return Ae.strikethrough=!1,dn}else if(Je.match(/^[^\s]/,!1))return Ae.strikethrough=!0,Re.highlightFormatting&&(Ae.formatting="strikethrough"),_t(Ae)}else if(yn===" "&&Je.match(/^~~/,!0)){if(Je.peek()===" ")return _t(Ae);Je.backUp(2)}}if(Re.emoji&&yn===":"&&Je.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){Ae.emoji=!0,Re.highlightFormatting&&(Ae.formatting="emoji");var Qe=_t(Ae);return Ae.emoji=!1,Qe}return yn===" "&&(Je.match(/^ +$/,!1)?Ae.trailingSpace++:Ae.trailingSpace&&(Ae.trailingSpaceNewLine=!0)),_t(Ae)}function qe(Je,Ae){var Ht=Je.next();if(Ht===">"){Ae.f=Ae.inline=Dt,Re.highlightFormatting&&(Ae.formatting="link");var Rn=_t(Ae);return Rn?Rn+=" ":Rn="",Rn+ke.linkInline}return Je.match(/^[^>]+/,!0),ke.linkInline}function Rt(Je,Ae){if(Je.eatSpace())return null;var Ht=Je.next();return Ht==="("||Ht==="["?(Ae.f=Ae.inline=En(Ht==="("?")":"]"),Re.highlightFormatting&&(Ae.formatting="link-string"),Ae.linkHref=!0,_t(Ae)):"error"}var Pt={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function En(Je){return function(Ae,Ht){var Rn=Ae.next();if(Rn===Je){Ht.f=Ht.inline=Dt,Re.highlightFormatting&&(Ht.formatting="link-string");var yn=_t(Ht);return Ht.linkHref=!1,yn}return Ae.match(Pt[Je]),Ht.linkHref=!0,_t(Ht)}}function tn(Je,Ae){return Je.match(/^([^\]\\]|\\.)*\]:/,!1)?(Ae.f=$n,Je.next(),Re.highlightFormatting&&(Ae.formatting="link"),Ae.linkText=!0,_t(Ae)):Xt(Je,Ae,Dt)}function $n(Je,Ae){if(Je.match(/^\]:/,!0)){Ae.f=Ae.inline=ur,Re.highlightFormatting&&(Ae.formatting="link");var Ht=_t(Ae);return Ae.linkText=!1,Ht}return Je.match(/^([^\]\\]|\\.)+/,!0),ke.linkText}function ur(Je,Ae){return Je.eatSpace()?null:(Je.match(/^[^\s]+/,!0),Je.peek()===void 0?Ae.linkTitle=!0:Je.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),Ae.f=Ae.inline=Dt,ke.linkHref+" url")}var wr={startState:function(){return{f:xe,prevLine:{stream:null},thisLine:{stream:null},block:xe,htmlState:null,indentation:0,inline:Dt,text:Ct,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(Je){return{f:Je.f,prevLine:Je.prevLine,thisLine:Je.thisLine,block:Je.block,htmlState:Je.htmlState&&he.copyState(Ve,Je.htmlState),indentation:Je.indentation,localMode:Je.localMode,localState:Je.localMode?he.copyState(Je.localMode,Je.localState):null,inline:Je.inline,text:Je.text,formatting:!1,linkText:Je.linkText,linkTitle:Je.linkTitle,linkHref:Je.linkHref,code:Je.code,em:Je.em,strong:Je.strong,strikethrough:Je.strikethrough,emoji:Je.emoji,header:Je.header,setext:Je.setext,hr:Je.hr,taskList:Je.taskList,list:Je.list,listStack:Je.listStack.slice(0),quote:Je.quote,indentedCode:Je.indentedCode,trailingSpace:Je.trailingSpace,trailingSpaceNewLine:Je.trailingSpaceNewLine,md_inside:Je.md_inside,fencedEndRE:Je.fencedEndRE}},token:function(Je,Ae){if(Ae.formatting=!1,Je!=Ae.thisLine.stream){if(Ae.header=0,Ae.hr=!1,Je.match(/^\s*$/,!0))return Ie(Ae),null;if(Ae.prevLine=Ae.thisLine,Ae.thisLine={stream:Je},Ae.taskList=!1,Ae.trailingSpace=0,Ae.trailingSpaceNewLine=!1,!Ae.localState&&(Ae.f=Ae.block,Ae.f!=Ue)){var Ht=Je.match(/^\s*/,!0)[0].replace(/\t/g,At).length;if(Ae.indentation=Ht,Ae.indentationDiff=null,Ht>0)return null}}return Ae.f(Je,Ae)},innerMode:function(Je){return Je.block==Ue?{state:Je.htmlState,mode:Ve}:Je.localState?{state:Je.localState,mode:Je.localMode}:{state:Je,mode:wr}},indent:function(Je,Ae,Ht){return Je.block==Ue&&Ve.indent?Ve.indent(Je.htmlState,Ae,Ht):Je.localState&&Je.localMode.indent?Je.localMode.indent(Je.localState,Ae,Ht):he.Pass},blankLine:Ie,getType:_t,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return wr},"xml"),he.defineMIME("text/markdown","markdown"),he.defineMIME("text/x-markdown","markdown")})},52539:function(Sn,Wt,se){(function(he){he(se(4631))})(function(he){"use strict";he.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 He=0;He<he.modeInfo.length;He++){var Re=he.modeInfo[He];Re.mimes&&(Re.mime=Re.mimes[0])}he.findModeByMIME=function(Ve){Ve=Ve.toLowerCase();for(var ve=0;ve<he.modeInfo.length;ve++){var _e=he.modeInfo[ve];if(_e.mime==Ve)return _e;if(_e.mimes){for(var ke=0;ke<_e.mimes.length;ke++)if(_e.mimes[ke]==Ve)return _e}}if(/\+xml$/.test(Ve))return he.findModeByMIME("application/xml");if(/\+json$/.test(Ve))return he.findModeByMIME("application/json")},he.findModeByExtension=function(Ve){Ve=Ve.toLowerCase();for(var ve=0;ve<he.modeInfo.length;ve++){var _e=he.modeInfo[ve];if(_e.ext){for(var ke=0;ke<_e.ext.length;ke++)if(_e.ext[ke]==Ve)return _e}}},he.findModeByFileName=function(Ve){for(var ve=0;ve<he.modeInfo.length;ve++){var _e=he.modeInfo[ve];if(_e.file&&_e.file.test(Ve))return _e}var ke=Ve.lastIndexOf("."),Se=ke>-1&&Ve.substring(ke+1,Ve.length);if(Se)return he.findModeByExtension(Se)},he.findModeByName=function(Ve){Ve=Ve.toLowerCase();for(var ve=0;ve<he.modeInfo.length;ve++){var _e=he.modeInfo[ve];if(_e.name.toLowerCase()==Ve)return _e;if(_e.alias){for(var ke=0;ke<_e.alias.length;ke++)if(_e.alias[ke].toLowerCase()==Ve)return _e}}}})},80785:function(Sn,Wt,se){(function(he){he(se(4631))})(function(he){"use strict";he.defineMode("stex",function(He,Re){"use strict";function Ve(dt,it){dt.cmdState.push(it)}function ve(dt){return dt.cmdState.length>0?dt.cmdState[dt.cmdState.length-1]:null}function _e(dt){var it=dt.cmdState.pop();it&&it.closeBracket()}function ke(dt){for(var it=dt.cmdState,Ge=it.length-1;Ge>=0;Ge--){var De=it[Ge];if(De.name!="DEFAULT")return De}return{styleIdentifier:function(){return null}}}function Se(dt,it,Ge){return function(){this.name=dt,this.bracketNo=0,this.style=it,this.styles=Ge,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var me={};me.importmodule=Se("importmodule","tag",["string","builtin"]),me.documentclass=Se("documentclass","tag",["","atom"]),me.usepackage=Se("usepackage","tag",["atom"]),me.begin=Se("begin","tag",["atom"]),me.end=Se("end","tag",["atom"]),me.label=Se("label","tag",["atom"]),me.ref=Se("ref","tag",["atom"]),me.eqref=Se("eqref","tag",["atom"]),me.cite=Se("cite","tag",["atom"]),me.bibitem=Se("bibitem","tag",["atom"]),me.Bibitem=Se("Bibitem","tag",["atom"]),me.RBibitem=Se("RBibitem","tag",["atom"]),me.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function Ee(dt,it){dt.f=it}function tt(dt,it){var Ge;if(dt.match(/^\\[a-zA-Z@]+/)){var De=dt.current().slice(1);return Ge=me.hasOwnProperty(De)?me[De]:me.DEFAULT,Ge=new Ge,Ve(it,Ge),Ee(it,St),Ge.style}if(dt.match(/^\\[$&%#{}_]/)||dt.match(/^\\[,;!\/\\]/))return"tag";if(dt.match("\\["))return Ee(it,function(Xt,rt){return Be(Xt,rt,"\\]")}),"keyword";if(dt.match("\\("))return Ee(it,function(Xt,rt){return Be(Xt,rt,"\\)")}),"keyword";if(dt.match("$$"))return Ee(it,function(Xt,rt){return Be(Xt,rt,"$$")}),"keyword";if(dt.match("$"))return Ee(it,function(Xt,rt){return Be(Xt,rt,"$")}),"keyword";var At=dt.next();if(At=="%")return dt.skipToEnd(),"comment";if(At=="}"||At=="]"){if(Ge=ve(it),Ge)Ge.closeBracket(At),Ee(it,St);else return"error";return"bracket"}else return At=="{"||At=="["?(Ge=me.DEFAULT,Ge=new Ge,Ve(it,Ge),"bracket"):/\d/.test(At)?(dt.eatWhile(/[\w.%]/),"atom"):(dt.eatWhile(/[\w\-_]/),Ge=ke(it),Ge.name=="begin"&&(Ge.argument=dt.current()),Ge.styleIdentifier())}function Be(dt,it,Ge){if(dt.eatSpace())return null;if(Ge&&dt.match(Ge))return Ee(it,tt),"keyword";if(dt.match(/^\\[a-zA-Z@]+/))return"tag";if(dt.match(/^[a-zA-Z]+/))return"variable-2";if(dt.match(/^\\[$&%#{}_]/)||dt.match(/^\\[,;!\/]/)||dt.match(/^[\^_&]/))return"tag";if(dt.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(dt.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var De=dt.next();return De=="{"||De=="}"||De=="["||De=="]"||De=="("||De==")"?"bracket":De=="%"?(dt.skipToEnd(),"comment"):"error"}function St(dt,it){var Ge=dt.peek(),De;return Ge=="{"||Ge=="["?(De=ve(it),De.openBracket(Ge),dt.eat(Ge),Ee(it,tt),"bracket"):/[ \t\r]/.test(Ge)?(dt.eat(Ge),null):(Ee(it,tt),_e(it),tt(dt,it))}return{startState:function(){var dt=Re.inMathMode?function(it,Ge){return Be(it,Ge)}:tt;return{cmdState:[],f:dt}},copyState:function(dt){return{cmdState:dt.cmdState.slice(),f:dt.f}},token:function(dt,it){return it.f(dt,it)},blankLine:function(dt){dt.f=tt,dt.cmdState.length=0},lineComment:"%"}}),he.defineMIME("text/x-stex","stex"),he.defineMIME("text/x-latex","stex")})},29589:function(Sn,Wt,se){(function(he){he(se(4631))})(function(he){"use strict";var He={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},Re={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};he.defineMode("xml",function(Ve,ve){var _e=Ve.indentUnit,ke={},Se=ve.htmlMode?He:Re;for(var me in Se)ke[me]=Se[me];for(var me in ve)ke[me]=ve[me];var Ee,tt;function Be(qe,Rt){function Pt($n){return Rt.tokenize=$n,$n(qe,Rt)}var En=qe.next();if(En=="<")return qe.eat("!")?qe.eat("[")?qe.match("CDATA[")?Pt(it("atom","]]>")):null:qe.match("--")?Pt(it("comment","-->")):qe.match("DOCTYPE",!0,!0)?(qe.eatWhile(/[\w\._\-]/),Pt(Ge(1))):null:qe.eat("?")?(qe.eatWhile(/[\w\._\-]/),Rt.tokenize=it("meta","?>"),"meta"):(Ee=qe.eat("/")?"closeTag":"openTag",Rt.tokenize=St,"tag bracket");if(En=="&"){var tn;return qe.eat("#")?qe.eat("x")?tn=qe.eatWhile(/[a-fA-F\d]/)&&qe.eat(";"):tn=qe.eatWhile(/[\d]/)&&qe.eat(";"):tn=qe.eatWhile(/[\w\.\-:]/)&&qe.eat(";"),tn?"atom":"error"}else return qe.eatWhile(/[^&<]/),null}Be.isInText=!0;function St(qe,Rt){var Pt=qe.next();if(Pt==">"||Pt=="/"&&qe.eat(">"))return Rt.tokenize=Be,Ee=Pt==">"?"endTag":"selfcloseTag","tag bracket";if(Pt=="=")return Ee="equals",null;if(Pt=="<"){Rt.tokenize=Be,Rt.state=rt,Rt.tagName=Rt.tagStart=null;var En=Rt.tokenize(qe,Rt);return En?En+" tag error":"tag error"}else return/[\'\"]/.test(Pt)?(Rt.tokenize=dt(Pt),Rt.stringStartCol=qe.column(),Rt.tokenize(qe,Rt)):(qe.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function dt(qe){var Rt=function(Pt,En){for(;!Pt.eol();)if(Pt.next()==qe){En.tokenize=St;break}return"string"};return Rt.isInAttribute=!0,Rt}function it(qe,Rt){return function(Pt,En){for(;!Pt.eol();){if(Pt.match(Rt)){En.tokenize=Be;break}Pt.next()}return qe}}function Ge(qe){return function(Rt,Pt){for(var En;(En=Rt.next())!=null;){if(En=="<")return Pt.tokenize=Ge(qe+1),Pt.tokenize(Rt,Pt);if(En==">")if(qe==1){Pt.tokenize=Be;break}else return Pt.tokenize=Ge(qe-1),Pt.tokenize(Rt,Pt)}return"meta"}}function De(qe,Rt,Pt){this.prev=qe.context,this.tagName=Rt,this.indent=qe.indented,this.startOfLine=Pt,(ke.doNotIndent.hasOwnProperty(Rt)||qe.context&&qe.context.noIndent)&&(this.noIndent=!0)}function At(qe){qe.context&&(qe.context=qe.context.prev)}function Xt(qe,Rt){for(var Pt;;){if(!qe.context||(Pt=qe.context.tagName,!ke.contextGrabbers.hasOwnProperty(Pt)||!ke.contextGrabbers[Pt].hasOwnProperty(Rt)))return;At(qe)}}function rt(qe,Rt,Pt){return qe=="openTag"?(Pt.tagStart=Rt.column(),ft):qe=="closeTag"?Ie:rt}function ft(qe,Rt,Pt){return qe=="word"?(Pt.tagName=Rt.current(),tt="tag",je):ke.allowMissingTagName&&qe=="endTag"?(tt="tag bracket",je(qe,Rt,Pt)):(tt="error",ft)}function Ie(qe,Rt,Pt){if(qe=="word"){var En=Rt.current();return Pt.context&&Pt.context.tagName!=En&&ke.implicitlyClosed.hasOwnProperty(Pt.context.tagName)&&At(Pt),Pt.context&&Pt.context.tagName==En||ke.matchClosing===!1?(tt="tag",xe):(tt="tag error",Ue)}else return ke.allowMissingTagName&&qe=="endTag"?(tt="tag bracket",xe(qe,Rt,Pt)):(tt="error",Ue)}function xe(qe,Rt,Pt){return qe!="endTag"?(tt="error",xe):(At(Pt),rt)}function Ue(qe,Rt,Pt){return tt="error",xe(qe,Rt,Pt)}function je(qe,Rt,Pt){if(qe=="word")return tt="attribute",_t;if(qe=="endTag"||qe=="selfcloseTag"){var En=Pt.tagName,tn=Pt.tagStart;return Pt.tagName=Pt.tagStart=null,qe=="selfcloseTag"||ke.autoSelfClosers.hasOwnProperty(En)?Xt(Pt,En):(Xt(Pt,En),Pt.context=new De(Pt,En,tn==Pt.indented)),rt}return tt="error",je}function _t(qe,Rt,Pt){return qe=="equals"?Ct:(ke.allowMissing||(tt="error"),je(qe,Rt,Pt))}function Ct(qe,Rt,Pt){return qe=="string"?Dt:qe=="word"&&ke.allowUnquoted?(tt="string",je):(tt="error",je(qe,Rt,Pt))}function Dt(qe,Rt,Pt){return qe=="string"?Dt:je(qe,Rt,Pt)}return{startState:function(qe){var Rt={tokenize:Be,state:rt,indented:qe||0,tagName:null,tagStart:null,context:null};return qe!=null&&(Rt.baseIndent=qe),Rt},token:function(qe,Rt){if(!Rt.tagName&&qe.sol()&&(Rt.indented=qe.indentation()),qe.eatSpace())return null;Ee=null;var Pt=Rt.tokenize(qe,Rt);return(Pt||Ee)&&Pt!="comment"&&(tt=null,Rt.state=Rt.state(Ee||Pt,qe,Rt),tt&&(Pt=tt=="error"?Pt+" error":tt)),Pt},indent:function(qe,Rt,Pt){var En=qe.context;if(qe.tokenize.isInAttribute)return qe.tagStart==qe.indented?qe.stringStartCol+1:qe.indented+_e;if(En&&En.noIndent)return he.Pass;if(qe.tokenize!=St&&qe.tokenize!=Be)return Pt?Pt.match(/^(\s*)/)[0].length:0;if(qe.tagName)return ke.multilineTagIndentPastTag!==!1?qe.tagStart+qe.tagName.length+2:qe.tagStart+_e*(ke.multilineTagIndentFactor||1);if(ke.alignCDATA&&/<!\[CDATA\[/.test(Rt))return 0;var tn=Rt&&/^<(\/)?([\w_:\.-]*)/.exec(Rt);if(tn&&tn[1])for(;En;)if(En.tagName==tn[2]){En=En.prev;break}else if(ke.implicitlyClosed.hasOwnProperty(En.tagName))En=En.prev;else break;else if(tn)for(;En;){var $n=ke.contextGrabbers[En.tagName];if($n&&$n.hasOwnProperty(tn[2]))En=En.prev;else break}for(;En&&En.prev&&!En.startOfLine;)En=En.prev;return En?En.indent+_e:qe.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:ke.htmlMode?"html":"xml",helperType:ke.htmlMode?"html":"xml",skipAttribute:function(qe){qe.state==Ct&&(qe.state=je)},xmlCurrentTag:function(qe){return qe.tagName?{name:qe.tagName,close:qe.type=="closeTag"}:null},xmlCurrentContext:function(qe){for(var Rt=[],Pt=qe.context;Pt;Pt=Pt.prev)Pt.tagName&&Rt.push(Pt.tagName);return Rt.reverse()}}}),he.defineMIME("text/xml","xml"),he.defineMIME("application/xml","xml"),he.mimeModes.hasOwnProperty("text/html")||he.defineMIME("text/html",{name:"xml",htmlMode:!0})})},15979:function(Sn,Wt,se){"use strict";se.d(Wt,{hP:function(){return nn}});var he=function(we,ue){return(he=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(oe,pe){oe.__proto__=pe}||function(oe,pe){for(var fe in pe)Object.prototype.hasOwnProperty.call(pe,fe)&&(oe[fe]=pe[fe])})(we,ue)};function He(we,ue){function oe(){this.constructor=we}he(we,ue),we.prototype=ue===null?Object.create(ue):(oe.prototype=ue.prototype,new oe)}function Re(we,ue,oe,pe){return new(oe||(oe=Promise))(function(fe,le){function Pe(Nt){try{It(pe.next(Nt))}catch(qt){le(qt)}}function Qe(Nt){try{It(pe.throw(Nt))}catch(qt){le(qt)}}function It(Nt){var qt;Nt.done?fe(Nt.value):(qt=Nt.value,qt instanceof oe?qt:new oe(function(an){an(qt)})).then(Pe,Qe)}It((pe=pe.apply(we,ue||[])).next())})}function Ve(we,ue){var oe,pe,fe,le,Pe={label:0,sent:function(){if(1&fe[0])throw fe[1];return fe[1]},trys:[],ops:[]};return le={next:Qe(0),throw:Qe(1),return:Qe(2)},typeof Symbol=="function"&&(le[Symbol.iterator]=function(){return this}),le;function Qe(It){return function(Nt){return function(qt){if(oe)throw new TypeError("Generator is already executing.");for(;Pe;)try{if(oe=1,pe&&(fe=2&qt[0]?pe.return:qt[0]?pe.throw||((fe=pe.return)&&fe.call(pe),0):pe.next)&&!(fe=fe.call(pe,qt[1])).done)return fe;switch(pe=0,fe&&(qt=[2&qt[0],fe.value]),qt[0]){case 0:case 1:fe=qt;break;case 4:return Pe.label++,{value:qt[1],done:!1};case 5:Pe.label++,pe=qt[1],qt=[0];continue;case 7:qt=Pe.ops.pop(),Pe.trys.pop();continue;default:if(fe=Pe.trys,!((fe=fe.length>0&&fe[fe.length-1])||qt[0]!==6&&qt[0]!==2)){Pe=0;continue}if(qt[0]===3&&(!fe||qt[1]>fe[0]&&qt[1]<fe[3])){Pe.label=qt[1];break}if(qt[0]===6&&Pe.label<fe[1]){Pe.label=fe[1],fe=qt;break}if(fe&&Pe.label<fe[2]){Pe.label=fe[2],Pe.ops.push(qt);break}fe[2]&&Pe.ops.pop(),Pe.trys.pop();continue}qt=ue.call(we,Pe)}catch(an){qt=[6,an],pe=0}finally{oe=fe=0}if(5&qt[0])throw qt[1];return{value:qt[0]?qt[1]:void 0,done:!0}}([It,Nt])}}}function ve(){for(var we=0,ue=0,oe=arguments.length;ue<oe;ue++)we+=arguments[ue].length;var pe=Array(we),fe=0;for(ue=0;ue<oe;ue++)for(var le=arguments[ue],Pe=0,Qe=le.length;Pe<Qe;Pe++,fe++)pe[fe]=le[Pe];return pe}var _e=function(){function we(){}return we.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},we.setAttributes=function(ue,oe){for(var pe=0,fe=oe;pe<fe.length;pe++){var le=fe[pe],Pe=le[0],Qe=le[1];ue.setAttribute(Pe,Qe)}},we.createRect=function(ue,oe,pe){var fe=document.createElementNS("http://www.w3.org/2000/svg","rect");return fe.setAttribute("width",ue.toString()),fe.setAttribute("height",oe.toString()),pe&&we.setAttributes(fe,pe),fe},we.createLine=function(ue,oe,pe,fe,le){var Pe=document.createElementNS("http://www.w3.org/2000/svg","line");return Pe.setAttribute("x1",ue.toString()),Pe.setAttribute("y1",oe.toString()),Pe.setAttribute("x2",pe.toString()),Pe.setAttribute("y2",fe.toString()),le&&we.setAttributes(Pe,le),Pe},we.createPolygon=function(ue,oe){var pe=document.createElementNS("http://www.w3.org/2000/svg","polygon");return pe.setAttribute("points",ue),oe&&we.setAttributes(pe,oe),pe},we.createCircle=function(ue,oe){var pe=document.createElementNS("http://www.w3.org/2000/svg","circle");return pe.setAttribute("cx",(ue/2).toString()),pe.setAttribute("cy",(ue/2).toString()),pe.setAttribute("r",ue.toString()),oe&&we.setAttributes(pe,oe),pe},we.createEllipse=function(ue,oe,pe){var fe=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return fe.setAttribute("cx",(ue/2).toString()),fe.setAttribute("cy",(oe/2).toString()),fe.setAttribute("rx",(ue/2).toString()),fe.setAttribute("ry",(oe/2).toString()),pe&&we.setAttributes(fe,pe),fe},we.createGroup=function(ue){var oe=document.createElementNS("http://www.w3.org/2000/svg","g");return ue&&we.setAttributes(oe,ue),oe},we.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},we.createMarker=function(ue,oe,pe,fe,le,Pe,Qe){var It=document.createElementNS("http://www.w3.org/2000/svg","marker");return we.setAttributes(It,[["id",ue],["orient",oe],["markerWidth",pe.toString()],["markerHeight",fe.toString()],["refX",le.toString()],["refY",Pe.toString()]]),It.appendChild(Qe),It},we.createText=function(ue){var oe=document.createElementNS("http://www.w3.org/2000/svg","text");return oe.setAttribute("x","0"),oe.setAttribute("y","0"),ue&&we.setAttributes(oe,ue),oe},we.createTSpan=function(ue,oe){var pe=document.createElementNS("http://www.w3.org/2000/svg","tspan");return pe.textContent=ue,oe&&we.setAttributes(pe,oe),pe},we.createImage=function(ue){var oe=document.createElementNS("http://www.w3.org/2000/svg","image");return ue&&we.setAttributes(oe,ue),oe},we.createPoint=function(ue,oe){var pe=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return pe.x=ue,pe.y=oe,pe},we.createPath=function(ue,oe){var pe=document.createElementNS("http://www.w3.org/2000/svg","path");return pe.setAttribute("d",ue),oe&&we.setAttributes(pe,oe),pe},we}(),ke=function(){function we(){}return we.addKey=function(ue){we.key=ue},Object.defineProperty(we,"isLicensed",{get:function(){return!!we.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(we.key)},enumerable:!1,configurable:!0}),we}(),Se=function(){function we(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return we.prototype.rasterize=function(ue,oe,pe){var fe=this;return new Promise(function(le){var Pe=pe!==void 0?pe:document.createElement("canvas");ue===null&&(fe.markersOnly=!0,fe.naturalSize=!1);var Qe=document.createElementNS("http://www.w3.org/2000/svg","svg");Qe.setAttribute("xmlns","http://www.w3.org/2000/svg"),Qe.setAttribute("width",oe.width.baseVal.valueAsString),Qe.setAttribute("height",oe.height.baseVal.valueAsString),Qe.setAttribute("viewBox","0 0 "+oe.viewBox.baseVal.width.toString()+" "+oe.viewBox.baseVal.height.toString()),Qe.innerHTML=oe.innerHTML,fe.naturalSize===!0?(Qe.width.baseVal.value=ue.naturalWidth,Qe.height.baseVal.value=ue.naturalHeight):fe.width!==void 0&&fe.height!==void 0&&(Qe.width.baseVal.value=fe.width,Qe.height.baseVal.value=fe.height),Pe.width=Qe.width.baseVal.value,Pe.height=Qe.height.baseVal.value;var It=Qe.outerHTML,Nt=Pe.getContext("2d");fe.markersOnly!==!0&&Nt.drawImage(ue,0,0,Pe.width,Pe.height);var qt=window.URL,an=new Image(Pe.width,Pe.height);an.setAttribute("crossOrigin","anonymous");var jt=new Blob([It],{type:"image/svg+xml"}),ir=qt.createObjectURL(jt);an.onload=function(){Nt.drawImage(an,0,0),qt.revokeObjectURL(ir);var Cr=Pe.toDataURL(fe.imageType,fe.imageQuality);le(Cr)},an.src=ir})},we}(),me=function(){},Ee=function(){function we(ue){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+ue+"_"}return Object.defineProperty(we.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(we.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(we.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),we.prototype.addClass=function(ue){return this.styleSheet===void 0&&this.addStyleSheet(),ue.name=""+this.classNamePrefix+ue.localName,this.classes.push(ue),this.styleSheet.sheet.insertRule("."+ue.name+" {"+ue.style+"}",this.styleSheet.sheet.cssRules.length),ue},we.prototype.addRule=function(ue){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(ue),this.styleSheet.sheet.insertRule(ue.selector+" {"+ue.style+"}",this.styleSheet.sheet.cssRules.length)},we.prototype.addStyleSheet=function(){var ue;this.styleSheet=document.createElement("style"),((ue=this.styleSheetRoot)!==null&&ue!==void 0?ue:document.head).appendChild(this.styleSheet),this.addRule(new tt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new tt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new tt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Be("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Be("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},we.prototype.removeStyleSheet=function(){var ue;this.styleSheet&&(((ue=this.styleSheetRoot)!==null&&ue!==void 0?ue:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},we}(),tt=function(we,ue){this.selector=we,this.style=ue},Be=function(we,ue){this.localName=we,this.style=ue},St=function(){function we(ue,oe,pe,fe,le){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=ue,this.displayMode=oe,this.markerItems=pe,this.uiStyleSettings=fe,this.styles=le,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return we.prototype.show=function(ue){var oe=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=ue,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var pe=document.createElement("div");pe.className=this.toolbarBlockStyleClass.name,pe.style.whiteSpace="nowrap",this.uiContainer.appendChild(pe),this.addActionButton(pe,'<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(pe,'<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(pe,'<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(pe,'<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(pe,'<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(pe,'<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(pe,'<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(pe,'<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(le){var Pe=document.createElement("div");Pe.className=""+oe.toolbarButtonStyleClass.name,Pe.setAttribute("data-type-name",le.typeName),Pe.innerHTML=le.icon,Pe.addEventListener("click",function(){oe.markerToolbarButtonClicked(Pe,le)}),oe.buttons.push(Pe),oe.markerButtons.push(Pe)}),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 fe=document.createElement("div");fe.className=this.toolbarBlockStyleClass.name,fe.style.whiteSpace="nowrap",fe.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(fe),this.addActionButton(fe,'<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(fe,'<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()},we.prototype.addButtonClickListener=function(ue){this.buttonClickListeners.push(ue)},we.prototype.removeButtonClickListener=function(ue){this.buttonClickListeners.indexOf(ue)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(ue),1)},we.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},we.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var ue=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<ue||oe===ue&&this.markerButtons.length-1===ue?this.markerButtonBlock.appendChild(this.markerButtons[oe]):(oe===ue&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[oe]))}},we.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")},we.prototype.resetButtonStyles=function(){var ue=this;this.buttons.forEach(function(oe){oe.className=oe.className.replace(ue.uiStyleSettings.toolbarButtonStyleColorsClassName?ue.uiStyleSettings.toolbarButtonStyleColorsClassName:ue.toolbarButtonStyleColorsClass.name,"").trim(),oe.className=oe.className.replace(ue.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?ue.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:ue.toolbarActiveButtonStyleColorsClass.name,"").trim(),oe.className+=" "+(ue.uiStyleSettings.toolbarButtonStyleColorsClassName?ue.uiStyleSettings.toolbarButtonStyleColorsClassName:ue.toolbarButtonStyleColorsClass.name)})},we.prototype.addActionButton=function(ue,oe,pe){var fe=this,le=document.createElement("div");switch(le.className=""+this.toolbarButtonStyleClass.name,le.innerHTML=oe,le.setAttribute("data-action",pe),le.addEventListener("click",function(){fe.actionToolbarButtonClicked(le,pe)}),pe){case"select":le.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":le.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":le.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":le.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":le.style.fill=this.uiStyleSettings.closeButtonColor}ue.appendChild(le),this.buttons.push(le)},we.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Be("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 Be("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Be("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Be("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 Be("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var ue=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Be("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*ue)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*ue)+`px;
padding: `+ue+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Be("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Be("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new tt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new tt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},we.prototype.markerToolbarButtonClicked=function(ue,oe){this.setActiveButton(ue),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(pe){return pe("marker",oe)}),this.markerButtonOverflowBlock.style.display="none"},we.prototype.actionToolbarButtonClicked=function(ue,oe){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(pe){return pe("action",oe)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},we.prototype.setActiveButton=function(ue){this.resetButtonStyles(),ue.className=ue.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),ue.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},we.prototype.setActiveMarkerButton=function(ue){var oe=this.markerButtons.find(function(pe){return pe.getAttribute("data-type-name")===ue});oe&&this.setActiveButton(oe)},we.prototype.setCurrentMarker=function(ue){var oe=this;this.currentMarker=ue,this.buttons.filter(function(pe){return/delete|notes/.test(pe.getAttribute("data-action"))}).forEach(function(pe){oe.currentMarker===void 0?(pe.style.fillOpacity="0.4",pe.style.pointerEvents="none"):(pe.style.fillOpacity="1",pe.style.pointerEvents="all")})},we}(),dt=function(){function we(ue,oe,pe,fe){this.panels=[],this.panelButtons=[],this.markerjsContainer=ue,this.displayMode=oe,this.uiStyleSettings=pe,this.styles=fe,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return we.prototype.addStyles=function(){var ue;this.toolboxStyleClass=this.styles.addClass(new Be("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 Be("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var oe=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Be("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Be("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Be("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 Be("toolbox-panel-row_colors",`
background-color: `+((ue=this.uiStyleSettings.toolboxBackgroundColor)!==null&&ue!==void 0?ue:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Be("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 Be("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Be("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new tt("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new tt("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},we.prototype.show=function(ue){var oe;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=ue,this.uiContainer.className=this.toolboxStyleClass.name+" "+((oe=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&oe!==void 0?oe:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},we.prototype.setPanelButtons=function(ue){var oe,pe,fe=this;this.panels=ue,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+" "+((pe=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&pe!==void 0?pe:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(le){var Pe;le.uiStyleSettings=fe.uiStyleSettings;var Qe=document.createElement("div");Qe.className=fe.toolboxButtonStyleClass.name+" "+((Pe=fe.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Pe!==void 0?Pe:fe.toolboxButtonStyleColorsClass.name),Qe.innerHTML=le.icon,Qe.title=le.title,Qe.addEventListener("click",function(){fe.panelButtonClick(le)}),fe.panelButtons.push(Qe),fe.buttonRow.appendChild(Qe)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},we.prototype.panelButtonClick=function(ue){var oe=this,pe=-1;if(ue!==this.activePanel){pe=this.panels.indexOf(ue),this.panelRow.innerHTML="";var fe=ue.getUi();fe.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(fe),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=ue}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(le,Pe){var Qe,It;le.className=oe.toolboxButtonStyleClass.name+" "+(Pe===pe?""+((Qe=oe.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Qe!==void 0?Qe:oe.toolboxActiveButtonStyleColorsClass.name):""+((It=oe.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&It!==void 0?It:oe.toolboxButtonStyleColorsClass.name))})},we}(),it=function(we,ue){this.title=we,this.icon=ue},Ge=function(we){function ue(oe,pe,fe,le){var Pe=we.call(this,oe,le||'<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 Pe.colors=[],Pe.addTransparent=!1,Pe.colorBoxes=[],Pe.colors=pe,Pe.currentColor=fe,Pe.setCurrentColor=Pe.setCurrentColor.bind(Pe),Pe.getColorBox=Pe.getColorBox.bind(Pe),Pe}return He(ue,we),ue.prototype.getUi=function(){var oe=this,pe=document.createElement("div");return pe.style.overflow="hidden",pe.style.whiteSpace="nowrap",this.colors.forEach(function(fe){var le=oe.getColorBox(fe);pe.appendChild(le),oe.colorBoxes.push(le)}),pe},ue.prototype.getColorBox=function(oe){var pe=this,fe=this.uiStyleSettings.toolbarHeight/4,le=this.uiStyleSettings.toolbarHeight-fe,Pe=document.createElement("div");Pe.style.display="inline-block",Pe.style.boxSizing="content-box",Pe.style.width=le-2+"px",Pe.style.height=le-2+"px",Pe.style.padding="1px",Pe.style.marginRight="2px",Pe.style.marginBottom="2px",Pe.style.borderWidth="2px",Pe.style.borderStyle="solid",Pe.style.borderRadius=(le+2)/2+"px",Pe.style.borderColor=oe===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Pe.addEventListener("click",function(){pe.setCurrentColor(oe,Pe)});var Qe=document.createElement("div");return Qe.style.display="inline-block",Qe.style.width=le-2+"px",Qe.style.height=le-2+"px",Qe.style.backgroundColor=oe,Qe.style.borderRadius=le/2+"px",oe==="transparent"&&(Qe.style.fill=this.uiStyleSettings.toolboxAccentColor,Qe.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>`),Pe.appendChild(Qe),Pe},ue.prototype.setCurrentColor=function(oe,pe){var fe=this;this.currentColor=oe,this.colorBoxes.forEach(function(le){le.style.borderColor=le===pe?fe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(oe)},ue}(it),De=function(){function we(ue,oe,pe){this._state="new",this._isSelected=!1,this._container=ue,this._overlayContainer=oe,this.globalSettings=pe,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(we.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),we.prototype.ownsTarget=function(ue){return!1},Object.defineProperty(we.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),we.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},we.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},we.prototype.pointerDown=function(ue,oe){},we.prototype.dblClick=function(ue,oe){},we.prototype.manipulate=function(ue){},we.prototype.pointerUp=function(ue){this.stateChanged()},we.prototype.dispose=function(){},we.prototype.addMarkerVisualToContainer=function(ue){this.container.childNodes.length>0?this.container.insertBefore(ue,this.container.childNodes[0]):this.container.appendChild(ue)},we.prototype.getState=function(){return{typeName:we.typeName,state:this.state,notes:this.notes}},we.prototype.restoreState=function(ue){this._state=ue.state,this.notes=ue.notes},we.prototype.scale=function(ue,oe){},we.prototype.colorChanged=function(ue){this.onColorChanged&&this.onColorChanged(ue),this.stateChanged()},we.prototype.fillColorChanged=function(ue){this.onFillColorChanged&&this.onFillColorChanged(ue),this.stateChanged()},we.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var ue=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),ue.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(ue)&&this.onStateChanged(this)}},we.typeName="MarkerBase",we}(),At=function(){function we(){this.findGripByVisual=this.findGripByVisual.bind(this)}return we.prototype.findGripByVisual=function(ue){return this.topLeft.ownsTarget(ue)?this.topLeft:this.topCenter.ownsTarget(ue)?this.topCenter:this.topRight.ownsTarget(ue)?this.topRight:this.centerLeft.ownsTarget(ue)?this.centerLeft:this.centerRight.ownsTarget(ue)?this.centerRight:this.bottomLeft.ownsTarget(ue)?this.bottomLeft:this.bottomCenter.ownsTarget(ue)?this.bottomCenter:this.bottomRight.ownsTarget(ue)?this.bottomRight:void 0},we}(),Xt=function(){function we(){this.GRIP_SIZE=10,this.visual=_e.createGroup(),this.visual.appendChild(_e.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(_e.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return we.prototype.ownsTarget=function(ue){return ue===this.visual||ue===this.visual.childNodes[0]||ue===this.visual.childNodes[1]},we}(),rt=function(){function we(){}return we.toITransformMatrix=function(ue){return{a:ue.a,b:ue.b,c:ue.c,d:ue.d,e:ue.e,f:ue.f}},we.toSVGMatrix=function(ue,oe){return ue.a=oe.a,ue.b=oe.b,ue.c=oe.c,ue.d=oe.d,ue.e=oe.e,ue.f=oe.f,ue},we}(),ft=function(we){function ue(oe,pe,fe){var le=we.call(this,oe,pe,fe)||this;return le.left=0,le.top=0,le.width=0,le.height=0,le.defaultSize={x:50,y:20},le.offsetX=0,le.offsetY=0,le.rotationAngle=0,le.CB_DISTANCE=10,le._suppressMarkerCreateEvent=!1,le.container.transform.baseVal.appendItem(_e.createTransform()),le.setupControlBox(),le}return He(ue,we),Object.defineProperty(ue.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"visual",{get:function(){return this._visual},set:function(oe){this._visual=oe;var pe=_e.createTransform();this._visual.transform.baseVal.appendItem(pe)},enumerable:!1,configurable:!0}),ue.prototype.ownsTarget=function(oe){return!!we.prototype.ownsTarget.call(this,oe)||!!(this.controlGrips.findGripByVisual(oe)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(oe))},ue.prototype.pointerDown=function(oe,pe){we.prototype.pointerDown.call(this,oe,pe),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 fe=this.unrotatePoint(oe);if(this.manipulationStartX=fe.x,this.manipulationStartY=fe.y,this.offsetX=fe.x-this.left,this.offsetY=fe.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(pe),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(pe)){this.activeGrip=this.rotatorGrip;var le=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=le.x-this.width/2,this.top=le.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Pe=this.container.transform.baseVal.getItem(0);Pe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Pe,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},ue.prototype.pointerUp=function(oe){var pe=this.state;we.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",pe==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},ue.prototype.moveVisual=function(oe){this.visual.style.transform="translate("+oe.x+"px, "+oe.y+"px)"},ue.prototype.manipulate=function(oe){var pe=this.unrotatePoint(oe);this.state==="creating"?this.resize(oe):this.state==="move"?(this.left=this.manipulationStartLeft+(pe.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(pe.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(pe):this.state==="rotate"&&this.rotate(oe)},ue.prototype.resize=function(oe){var pe=this.manipulationStartLeft,fe=this.manipulationStartWidth,le=this.manipulationStartTop,Pe=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:pe=this.manipulationStartLeft+oe.x-this.manipulationStartX,fe=this.manipulationStartWidth+this.manipulationStartLeft-pe;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:fe=this.manipulationStartWidth+oe.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:le=this.manipulationStartTop+oe.y-this.manipulationStartY,Pe=this.manipulationStartHeight+this.manipulationStartTop-le;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Pe=this.manipulationStartHeight+oe.y-this.manipulationStartY}fe>=0?(this.left=pe,this.width=fe):(this.left=pe+fe,this.width=-fe),Pe>=0?(this.top=le,this.height=Pe):(this.top=le+Pe,this.height=-Pe),this.setSize()},ue.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},ue.prototype.rotate=function(oe){if(Math.abs(oe.x-this.centerX)>.1){var pe=Math.sign(oe.x-this.centerX);this.rotationAngle=180*Math.atan((oe.y-this.centerY)/(oe.x-this.centerX))/Math.PI+90*pe,this.applyRotation()}},ue.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)},ue.prototype.rotatePoint=function(oe){if(this.rotationAngle===0)return oe;var pe=this.container.getCTM(),fe=_e.createPoint(oe.x,oe.y);return{x:(fe=fe.matrixTransform(pe)).x,y:fe.y}},ue.prototype.unrotatePoint=function(oe){if(this.rotationAngle===0)return oe;var pe=this.container.getCTM();pe=pe.inverse();var fe=_e.createPoint(oe.x,oe.y);return{x:(fe=fe.matrixTransform(pe)).x,y:fe.y}},ue.prototype.select=function(){we.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},ue.prototype.deselect=function(){we.prototype.deselect.call(this),this.controlBox.style.display="none"},ue.prototype.setupControlBox=function(){this.controlBox=_e.createGroup();var oe=_e.createTransform();oe.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(oe),this.container.appendChild(this.controlBox),this.controlRect=_e.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=_e.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 At,this.addControlGrips(),this.controlBox.style.display="none"},ue.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()},ue.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()},ue.prototype.createGrip=function(){var oe=new Xt;return oe.visual.transform.baseVal.appendItem(_e.createTransform()),this.controlBox.appendChild(oe.visual),oe},ue.prototype.positionGrips=function(){var oe=this.controlGrips.topLeft.GRIP_SIZE,pe=-oe/2,fe=pe,le=(this.width+this.CB_DISTANCE)/2-oe/2,Pe=(this.height+this.CB_DISTANCE)/2-oe/2,Qe=this.height+this.CB_DISTANCE-oe/2,It=this.width+this.CB_DISTANCE-oe/2;this.positionGrip(this.controlGrips.topLeft.visual,pe,fe),this.positionGrip(this.controlGrips.topCenter.visual,le,fe),this.positionGrip(this.controlGrips.topRight.visual,It,fe),this.positionGrip(this.controlGrips.centerLeft.visual,pe,Pe),this.positionGrip(this.controlGrips.centerRight.visual,It,Pe),this.positionGrip(this.controlGrips.bottomLeft.visual,pe,Qe),this.positionGrip(this.controlGrips.bottomCenter.visual,le,Qe),this.positionGrip(this.controlGrips.bottomRight.visual,It,Qe),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,le,fe-3*this.CB_DISTANCE)},ue.prototype.positionGrip=function(oe,pe,fe){var le=oe.transform.baseVal.getItem(0);le.setTranslate(pe,fe),oe.transform.baseVal.replaceItem(le,0)},ue.prototype.hideControlBox=function(){this.controlBox.style.display="none"},ue.prototype.showControlBox=function(){this.controlBox.style.display=""},ue.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:rt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:rt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},we.prototype.getState.call(this))},ue.prototype.restoreState=function(oe){we.prototype.restoreState.call(this,oe);var pe=oe;this.left=pe.left,this.top=pe.top,this.width=pe.width,this.height=pe.height,this.rotationAngle=pe.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(rt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,pe.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(rt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,pe.containerTransformMatrix))},ue.prototype.scale=function(oe,pe){we.prototype.scale.call(this,oe,pe);var fe=this.rotatePoint({x:this.left,y:this.top}),le=this.unrotatePoint({x:fe.x*oe,y:fe.y*pe});this.left=le.x,this.top=le.y,this.width=this.width*oe,this.height=this.height*pe,this.adjustControlBox()},ue}(De),Ie=function(we){function ue(oe,pe,fe){var le=we.call(this,oe,pe,fe)||this;return le.fillColor="transparent",le.strokeColor="transparent",le.strokeWidth=0,le.strokeDasharray="",le.opacity=1,le.setStrokeColor=le.setStrokeColor.bind(le),le.setFillColor=le.setFillColor.bind(le),le.setStrokeWidth=le.setStrokeWidth.bind(le),le.setStrokeDasharray=le.setStrokeDasharray.bind(le),le.createVisual=le.createVisual.bind(le),le}return He(ue,we),ue.prototype.ownsTarget=function(oe){return!(!we.prototype.ownsTarget.call(this,oe)&&oe!==this.visual)},ue.prototype.createVisual=function(){this.visual=_e.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)},ue.prototype.pointerDown=function(oe,pe){we.prototype.pointerDown.call(this,oe,pe),this.state==="new"&&(this.createVisual(),this.moveVisual(oe),this._state="creating")},ue.prototype.manipulate=function(oe){we.prototype.manipulate.call(this,oe)},ue.prototype.resize=function(oe){we.prototype.resize.call(this,oe),this.setSize()},ue.prototype.setSize=function(){we.prototype.setSize.call(this),_e.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},ue.prototype.pointerUp=function(oe){we.prototype.pointerUp.call(this,oe),this.setSize()},ue.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.visual&&_e.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(oe),this.stateChanged()},ue.prototype.setFillColor=function(oe){this.fillColor=oe,this.visual&&_e.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},ue.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.visual&&_e.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},ue.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.visual&&_e.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},ue.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},we.prototype.getState.call(this))},ue.prototype.restoreState=function(oe){var pe=oe;this.fillColor=pe.fillColor,this.strokeColor=pe.strokeColor,this.strokeWidth=pe.strokeWidth,this.strokeDasharray=pe.strokeDasharray,this.opacity=pe.opacity,this.createVisual(),we.prototype.restoreState.call(this,oe),this.setSize()},ue.prototype.scale=function(oe,pe){we.prototype.scale.call(this,oe,pe),this.setSize()},ue.title="Rectangle marker",ue}(ft),xe=function(we){function ue(oe,pe,fe,le){var Pe=we.call(this,oe,le||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Pe.widths=[],Pe.widthBoxes=[],Pe.widths=pe,Pe.currentWidth=fe,Pe.setCurrentWidth=Pe.setCurrentWidth.bind(Pe),Pe}return He(ue,we),ue.prototype.getUi=function(){var oe=this,pe=document.createElement("div");return pe.style.display="flex",pe.style.overflow="hidden",pe.style.flexGrow="2",this.widths.forEach(function(fe){var le=document.createElement("div");le.style.display="flex",le.style.flexGrow="2",le.style.alignItems="center",le.style.justifyContent="space-between",le.style.padding="5px",le.style.borderWidth="2px",le.style.borderStyle="solid",le.style.borderColor=fe===oe.currentWidth?oe.uiStyleSettings.toolboxAccentColor:"transparent",le.addEventListener("click",function(){oe.setCurrentWidth(fe,le)}),pe.appendChild(le);var Pe=document.createElement("div");Pe.innerText=fe.toString(),Pe.style.marginRight="5px",le.appendChild(Pe);var Qe=document.createElement("div");Qe.style.minHeight="20px",Qe.style.flexGrow="2",Qe.style.display="flex",Qe.style.alignItems="center";var It=document.createElement("hr");It.style.minWidth="20px",It.style.border="0px",It.style.borderTop=fe+"px solid "+oe.uiStyleSettings.toolboxColor,It.style.flexGrow="2",Qe.appendChild(It),le.appendChild(Qe),oe.widthBoxes.push(le)}),pe},ue.prototype.setCurrentWidth=function(oe,pe){var fe=this;this.currentWidth=oe,this.widthBoxes.forEach(function(le){le.style.borderColor=le===pe?fe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},ue}(it),Ue=function(we){function ue(oe,pe,fe,le){var Pe=we.call(this,oe,le||'<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 Pe.styles=[],Pe.styleBoxes=[],Pe.styles=pe,Pe.currentStyle=fe,Pe.setCurrentStyle=Pe.setCurrentStyle.bind(Pe),Pe}return He(ue,we),ue.prototype.getUi=function(){var oe=this,pe=document.createElement("div");return pe.style.display="flex",pe.style.overflow="hidden",pe.style.flexGrow="2",this.styles.forEach(function(fe){var le=document.createElement("div");le.style.display="flex",le.style.alignItems="center",le.style.justifyContent="space-between",le.style.padding="5px",le.style.borderWidth="2px",le.style.borderStyle="solid",le.style.overflow="hidden",le.style.maxWidth=100/oe.styles.length-5+"%",le.style.borderColor=fe===oe.currentStyle?oe.uiStyleSettings.toolboxAccentColor:"transparent",le.addEventListener("click",function(){oe.setCurrentStyle(fe,le)}),pe.appendChild(le);var Pe=document.createElement("div");Pe.style.minHeight="20px",Pe.style.flexGrow="2",Pe.style.overflow="hidden";var Qe=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+oe.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(fe!==""?'stroke-dasharray="'+fe+'"':"")+` />
</svg>`;Pe.innerHTML=Qe,le.appendChild(Pe),oe.styleBoxes.push(le)}),pe},ue.prototype.setCurrentStyle=function(oe,pe){var fe=this;this.currentStyle=oe,this.styleBoxes.forEach(function(le){le.style.borderColor=le===pe?fe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},ue}(it),je=function(we){function ue(oe,pe,fe){var le=we.call(this,oe,pe,fe)||this;return le.strokeColor=fe.defaultColor,le.strokeWidth=fe.defaultStrokeWidth,le.strokeDasharray=fe.defaultStrokeDasharray,le.strokePanel=new Ge("Line color",fe.defaultColorSet,fe.defaultColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.strokeWidthPanel=new xe("Line width",fe.defaultStrokeWidths,fe.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new Ue("Line style",fe.defaultStrokeDasharrays,fe.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le}return He(ue,we),Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),ue.prototype.getState=function(){var oe=we.prototype.getState.call(this);return oe.typeName=ue.typeName,oe},ue.typeName="FrameMarker",ue.title="Frame marker",ue.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',ue}(Ie),_t=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"},Ct=function(we){function ue(oe,pe,fe){var le=we.call(this,oe,pe,fe)||this;return le.x1=0,le.y1=0,le.x2=0,le.y2=0,le.defaultLength=50,le.manipulationStartX=0,le.manipulationStartY=0,le.manipulationStartX1=0,le.manipulationStartY1=0,le.manipulationStartX2=0,le.manipulationStartY2=0,le.setupControlBox(),le}return He(ue,we),ue.prototype.ownsTarget=function(oe){return!!we.prototype.ownsTarget.call(this,oe)||!(!this.grip1.ownsTarget(oe)&&!this.grip2.ownsTarget(oe))},ue.prototype.pointerDown=function(oe,pe){we.prototype.pointerDown.call(this,oe,pe),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(pe)?this.activeGrip=this.grip1:this.grip2.ownsTarget(pe)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},ue.prototype.pointerUp=function(oe){var pe=this.state;we.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",pe==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},ue.prototype.adjustVisual=function(){},ue.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)},ue.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()},ue.prototype.select=function(){we.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},ue.prototype.deselect=function(){we.prototype.deselect.call(this),this.controlBox.style.display="none"},ue.prototype.setupControlBox=function(){this.controlBox=_e.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},ue.prototype.adjustControlBox=function(){this.positionGrips()},ue.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},ue.prototype.createGrip=function(){var oe=new Xt;return oe.visual.transform.baseVal.appendItem(_e.createTransform()),this.controlBox.appendChild(oe.visual),oe},ue.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)},ue.prototype.positionGrip=function(oe,pe,fe){var le=oe.transform.baseVal.getItem(0);le.setTranslate(pe,fe),oe.transform.baseVal.replaceItem(le,0)},ue.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},we.prototype.getState.call(this))},ue.prototype.restoreState=function(oe){we.prototype.restoreState.call(this,oe);var pe=oe;this.x1=pe.x1,this.y1=pe.y1,this.x2=pe.x2,this.y2=pe.y2},ue.prototype.scale=function(oe,pe){we.prototype.scale.call(this,oe,pe),this.x1=this.x1*oe,this.y1=this.y1*pe,this.x2=this.x2*oe,this.y2=this.y2*pe,this.adjustVisual(),this.adjustControlBox()},ue}(De),Dt=function(we){function ue(oe,pe,fe){var le=we.call(this,oe,pe,fe)||this;return le.strokeColor="transparent",le.strokeWidth=0,le.strokeDasharray="",le.setStrokeColor=le.setStrokeColor.bind(le),le.setStrokeWidth=le.setStrokeWidth.bind(le),le.setStrokeDasharray=le.setStrokeDasharray.bind(le),le.strokeColor=fe.defaultColor,le.strokeWidth=fe.defaultStrokeWidth,le.strokeDasharray=fe.defaultStrokeDasharray,le.strokePanel=new Ge("Line color",fe.defaultColorSet,fe.defaultColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.strokeWidthPanel=new xe("Line width",fe.defaultStrokeWidths,fe.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new Ue("Line style",fe.defaultStrokeDasharrays,fe.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le}return He(ue,we),ue.prototype.ownsTarget=function(oe){return!(!we.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.selectorLine&&oe!==this.visibleLine)},ue.prototype.createVisual=function(){this.visual=_e.createGroup(),this.selectorLine=_e.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=_e.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)},ue.prototype.pointerDown=function(oe,pe){we.prototype.pointerDown.call(this,oe,pe),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},ue.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()),_e.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),_e.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),_e.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},ue.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.adjustVisual(),this.colorChanged(oe)},ue.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.adjustVisual()},ue.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.adjustVisual(),this.stateChanged()},Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),ue.prototype.getState=function(){var oe=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},we.prototype.getState.call(this));return oe.typeName=ue.typeName,oe},ue.prototype.restoreState=function(oe){we.prototype.restoreState.call(this,oe);var pe=oe;this.strokeColor=pe.strokeColor,this.strokeWidth=pe.strokeWidth,this.strokeDasharray=pe.strokeDasharray,this.createVisual(),this.adjustVisual()},ue.typeName="LineMarker",ue.title="Line marker",ue.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',ue}(Ct),qe=function(we){function ue(oe,pe,fe,le){var Pe=we.call(this,oe,le||'<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 Pe.fonts=[],Pe.fontBoxes=[],Pe.fonts=pe,Pe.currentFont=fe,Pe.setCurrentFont=Pe.setCurrentFont.bind(Pe),Pe}return He(ue,we),ue.prototype.getUi=function(){var oe=this,pe=document.createElement("div");return pe.style.overflow="hidden",pe.style.flexGrow="2",this.fonts.forEach(function(fe){var le=document.createElement("div");le.style.display="inline-block",le.style.alignItems="center",le.style.justifyContent="space-between",le.style.padding="5px",le.style.borderWidth="2px",le.style.borderStyle="solid",le.style.overflow="hidden",le.style.maxWidth=100/oe.fonts.length-5+"%",le.style.borderColor=fe===oe.currentFont?oe.uiStyleSettings.toolboxAccentColor:"transparent",le.addEventListener("click",function(){oe.setCurrentFont(fe,le)}),pe.appendChild(le);var Pe=document.createElement("div");Pe.style.display="flex",Pe.style.minHeight="20px",Pe.style.flexGrow="2",Pe.style.fontFamily=fe,Pe.style.overflow="hidden";var Qe=document.createElement("div");Qe.style.whiteSpace="nowrap",Qe.style.overflow="hidden",Qe.style.textOverflow="ellipsis",Qe.innerHTML="The quick brown fox jumps over the lazy dog",Pe.appendChild(Qe),le.appendChild(Pe),oe.fontBoxes.push(le)}),pe},ue.prototype.setCurrentFont=function(oe,pe){var fe=this;this.currentFont=oe,this.fontBoxes.forEach(function(le){le.style.borderColor=le===pe?fe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},ue}(it),Rt=function(we){function ue(oe,pe,fe){var le=we.call(this,oe,pe,fe)||this;return le.color="transparent",le.padding=5,le.DEFAULT_TEXT="\u8BF7\u8F93\u5165\u6587\u672C",le.text=le.DEFAULT_TEXT,le.isMoved=!1,le.color=fe.defaultColor,le.fontFamily=fe.defaultFontFamily,le.defaultSize={x:100,y:30},le.setColor=le.setColor.bind(le),le.setFont=le.setFont.bind(le),le.renderText=le.renderText.bind(le),le.sizeText=le.sizeText.bind(le),le.textEditDivClicked=le.textEditDivClicked.bind(le),le.showTextEditor=le.showTextEditor.bind(le),le.setSize=le.setSize.bind(le),le.positionTextEditor=le.positionTextEditor.bind(le),le.colorPanel=new Ge("Color",fe.defaultColorSet,fe.defaultColor),le.colorPanel.onColorChanged=le.setColor,le.fontFamilyPanel=new qe("Font",fe.defaultFontFamilies,fe.defaultFontFamily),le.fontFamilyPanel.onFontChanged=le.setFont,le}return He(ue,we),ue.prototype.ownsTarget=function(oe){if(we.prototype.ownsTarget.call(this,oe)||oe===this.visual||oe===this.textElement||oe===this.bgRectangle)return!0;var pe=!1;return this.textElement.childNodes.forEach(function(fe){fe===oe&&(pe=!0)}),pe},ue.prototype.createVisual=function(){this.visual=_e.createGroup(),this.bgRectangle=_e.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=_e.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(_e.createTransform()),this.textElement.transform.baseVal.appendItem(_e.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},ue.prototype.pointerDown=function(oe,pe){we.prototype.pointerDown.call(this,oe,pe),this.isMoved=!1,this.pointerDownPoint=oe,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(oe),this._state="creating")},ue.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(pe){oe.textElement.appendChild(_e.createTSpan(pe.trim()===""?" ":pe.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},ue.prototype.getTextScale=function(){var oe=this.textElement.getBBox(),pe=1;if(oe.width>0&&oe.height>0){var fe=(1*this.width-this.width*this.padding*2/100)/oe.width,le=(1*this.height-this.height*this.padding*2/100)/oe.height;pe=Math.min(fe,le)}return pe},ue.prototype.getTextPosition=function(oe){var pe=this.textElement.getBBox(),fe=0,le=0;return pe.width>0&&pe.height>0&&(fe=(this.width-pe.width*oe)/2,le=this.height/2-pe.height*oe/2),{x:fe,y:le}},ue.prototype.sizeText=function(){var oe=this.textElement.getBBox(),pe=this.getTextScale(),fe=this.getTextPosition(pe);fe.y-=oe.y*pe,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+fe.x+"px, "+fe.y+"px) scale("+pe+", "+pe+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(fe.x,fe.y),this.textElement.transform.baseVal.getItem(1).setScale(pe,pe))},ue.prototype.manipulate=function(oe){we.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)},ue.prototype.resize=function(oe){we.prototype.resize.call(this,oe),this.isMoved=!0,this.setSize(),this.sizeText()},ue.prototype.setSize=function(){we.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(_e.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),_e.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},ue.prototype.pointerUp=function(oe){var pe=this.state;pe==="creating"&&(this._suppressMarkerCreateEvent=!0),we.prototype.pointerUp.call(this,oe),this.setSize(),(pe==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},ue.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(pe){pe.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var pe=Number.parseFloat(oe.textEditor.style.fontSize);oe.textEditor.clientWidth>=Number.parseInt(oe.textEditor.style.maxWidth)&&pe>.9;)pe-=.1,oe.textEditor.style.fontSize=Math.max(pe,.9)+"em"}),this.textEditor.addEventListener("keyup",function(pe){pe.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(pe){if(pe.clipboardData){var fe=pe.clipboardData.getData("text"),le=window.getSelection();if(!le.rangeCount)return!1;le.deleteFromDocument(),le.getRangeAt(0).insertNode(document.createTextNode(fe)),pe.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")},ue.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var oe=this.getTextScale(),pe=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),fe=this.textElement.getBBox(),le={x:fe.width*oe,y:fe.height*oe};pe.x-=le.x/2,pe.y-=le.y/2,this.textEditor.style.top=pe.y+"px",this.textEditor.style.left=pe.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-pe.x+"px",this.textEditor.style.fontSize=Math.max(16*oe,12)+"px",this.textElement.style.display="none"}},ue.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()},ue.prototype.select=function(){we.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},ue.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),we.prototype.deselect.call(this)},ue.prototype.dblClick=function(oe,pe){we.prototype.dblClick.call(this,oe,pe),this.showTextEditor()},ue.prototype.setColor=function(oe){this.textElement&&_e.setAttributes(this.textElement,[["fill",oe]]),this.color=oe,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(oe)},ue.prototype.setFont=function(oe){this.textElement&&_e.setAttributes(this.textElement,[["font-family",oe]]),this.fontFamily=oe,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},ue.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},ue.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),ue.prototype.getState=function(){var oe=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},we.prototype.getState.call(this));return oe.typeName=ue.typeName,oe},ue.prototype.restoreState=function(oe){var pe=oe;this.color=pe.color,this.fontFamily=pe.fontFamily,this.padding=pe.padding,this.text=pe.text,this.createVisual(),we.prototype.restoreState.call(this,oe),this.setSize()},ue.prototype.scale=function(oe,pe){we.prototype.scale.call(this,oe,pe),this.setSize(),this.sizeText(),this.positionTextEditor()},ue.typeName="TextMarker",ue.title="Text marker",ue.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>',ue}(ft),Pt=function(we){function ue(oe,pe,fe){var le=we.call(this,oe,pe,fe)||this;return le.color="transparent",le.lineWidth=3,le.drawing=!1,le.pixelRatio=1,le.color=fe.defaultColor,le.lineWidth=fe.defaultStrokeWidth,le.pixelRatio=fe.freehandPixelRatio,le.setColor=le.setColor.bind(le),le.addCanvas=le.addCanvas.bind(le),le.finishCreation=le.finishCreation.bind(le),le.setLineWidth=le.setLineWidth.bind(le),le.colorPanel=new Ge("Color",fe.defaultColorSet,fe.defaultColor),le.colorPanel.onColorChanged=le.setColor,le.lineWidthPanel=new xe("Line width",fe.defaultStrokeWidths,fe.defaultStrokeWidth),le.lineWidthPanel.onWidthChanged=le.setLineWidth,le}return He(ue,we),ue.prototype.ownsTarget=function(oe){return!(!we.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.drawingImage)},ue.prototype.createVisual=function(){this.visual=_e.createGroup(),this.drawingImage=_e.createImage(),this.visual.appendChild(this.drawingImage);var oe=_e.createTransform();this.visual.transform.baseVal.appendItem(oe),this.addMarkerVisualToContainer(this.visual)},ue.prototype.pointerDown=function(oe,pe){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):we.prototype.pointerDown.call(this,oe,pe)},ue.prototype.manipulate=function(oe){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(oe.x,oe.y),this.canvasContext.stroke()):we.prototype.manipulate.call(this,oe)},ue.prototype.resize=function(oe){we.prototype.resize.call(this,oe),_e.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),_e.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},ue.prototype.pointerUp=function(oe){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):we.prototype.pointerUp.call(this,oe)},ue.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)},ue.prototype.select=function(){this.state==="creating"&&this.finishCreation(),we.prototype.select.call(this)},ue.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),we.prototype.deselect.call(this)},ue.prototype.finishCreation=function(){for(var oe=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),pe=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],fe=pe[0],le=pe[1],Pe=pe[2],Qe=pe[3],It=!1,Nt=0;Nt<this.canvasElement.height;Nt++)for(var qt=0;qt<this.canvasElement.width;qt++)oe.data[Nt*this.canvasElement.width*4+4*qt+3]>0&&(It=!0,Nt<le&&(le=Nt),qt<fe&&(fe=qt),Nt>Qe&&(Qe=Nt),qt>Pe&&(Pe=qt));if(It){this.left=fe/this.pixelRatio,this.top=le/this.pixelRatio,this.width=(Pe-fe)/this.pixelRatio,this.height=(Qe-le)/this.pixelRatio;var an=document.createElement("canvas");an.width=Pe-fe,an.height=Qe-le,an.getContext("2d").putImageData(this.canvasContext.getImageData(fe,le,Pe-fe,Qe-le),0,0),this.drawingImgUrl=an.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},ue.prototype.setDrawingImage=function(){_e.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),_e.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},ue.prototype.setColor=function(oe){this.color=oe,this.colorChanged(oe)},ue.prototype.setLineWidth=function(oe){this.lineWidth=oe},Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),ue.prototype.getState=function(){var oe=Object.assign({drawingImgUrl:this.drawingImgUrl},we.prototype.getState.call(this));return oe.typeName=ue.typeName,oe},ue.prototype.restoreState=function(oe){this.createVisual(),we.prototype.restoreState.call(this,oe),this.drawingImgUrl=oe.drawingImgUrl,this.setDrawingImage()},ue.prototype.scale=function(oe,pe){we.prototype.scale.call(this,oe,pe),this.setDrawingImage()},ue.typeName="FreehandMarker",ue.title="Freehand marker",ue.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>',ue}(ft),En=function(we){function ue(oe,pe,fe){var le=we.call(this,oe,fe||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return le.typeBoxes=[],le.currentType=pe,le.setCurrentType=le.setCurrentType.bind(le),le}return He(ue,we),ue.prototype.getUi=function(){var oe=this,pe=document.createElement("div");pe.style.display="flex",pe.style.overflow="hidden",pe.style.flexGrow="2";for(var fe=function(Qe){var It="both";switch(Qe){case 0:It="both";break;case 1:It="start";break;case 2:It="end";break;case 3:It="none"}var Nt=document.createElement("div");if(Nt.style.display="flex",Nt.style.flexGrow="2",Nt.style.alignItems="center",Nt.style.justifyContent="space-between",Nt.style.padding="5px",Nt.style.borderWidth="2px",Nt.style.borderStyle="solid",Nt.style.borderColor=It===le.currentType?le.uiStyleSettings.toolboxAccentColor:"transparent",Nt.addEventListener("click",function(){oe.setCurrentType(It,Nt)}),pe.appendChild(Nt),It==="both"||It==="start"){var qt=document.createElement("div");qt.style.display="flex",qt.style.alignItems="center",qt.style.minHeight="20px",qt.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="`+(le.uiStyleSettings!==void 0?le.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,qt.style.marginLeft="5px",Nt.appendChild(qt)}var an=document.createElement("div");an.style.display="flex",an.style.alignItems="center",an.style.minHeight="20px",an.style.flexGrow="2";var jt=document.createElement("hr");if(jt.style.minWidth="20px",jt.style.border="0px",jt.style.borderTop="3px solid "+(le.uiStyleSettings!==void 0?le.uiStyleSettings.toolboxColor:"#eeeeee"),jt.style.flexGrow="2",an.appendChild(jt),Nt.appendChild(an),It==="both"||It==="end"){var ir=document.createElement("div");ir.style.display="flex",ir.style.alignItems="center",ir.style.minHeight="20px",ir.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="`+(le.uiStyleSettings!==void 0?le.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,ir.style.marginRight="5px",Nt.appendChild(ir)}le.typeBoxes.push(Nt)},le=this,Pe=0;Pe<4;Pe++)fe(Pe);return pe},ue.prototype.setCurrentType=function(oe,pe){var fe=this;this.currentType=oe,this.typeBoxes.forEach(function(le){le.style.borderColor=le===pe?fe.uiStyleSettings!==void 0?fe.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},ue}(it),tn=function(we){function ue(oe,pe,fe){var le=we.call(this,oe,pe,fe)||this;return le.arrowType="end",le.arrowBaseHeight=10,le.arrowBaseWidth=10,le.getArrowPoints=le.getArrowPoints.bind(le),le.setArrowType=le.setArrowType.bind(le),le.arrowTypePanel=new En("Arrow type","end"),le.arrowTypePanel.onArrowTypeChanged=le.setArrowType,le}return He(ue,we),ue.prototype.ownsTarget=function(oe){return!(!we.prototype.ownsTarget.call(this,oe)&&oe!==this.arrow1&&oe!==this.arrow2)},ue.prototype.getArrowPoints=function(oe,pe){var fe=this.arrowBaseWidth+2*this.strokeWidth,le=this.arrowBaseHeight+2*this.strokeWidth;return oe-fe/2+","+(pe+le/2)+" "+oe+","+(pe-le/2)+" "+(oe+fe/2)+","+(pe+le/2)},ue.prototype.createTips=function(){this.arrow1=_e.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(_e.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=_e.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(_e.createTransform()),this.visual.appendChild(this.arrow2)},ue.prototype.pointerDown=function(oe,pe){we.prototype.pointerDown.call(this,oe,pe),this.state==="creating"&&this.createTips()},ue.prototype.adjustVisual=function(){if(we.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",_e.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),_e.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 pe=this.arrow1.transform.baseVal.getItem(0);pe.setRotate(oe,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(pe,0);var fe=this.arrow2.transform.baseVal.getItem(0);fe.setRotate(oe+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(fe,0)}},ue.prototype.setArrowType=function(oe){this.arrowType=oe,this.adjustVisual(),this.stateChanged()},Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),ue.prototype.getState=function(){var oe=Object.assign({arrowType:this.arrowType},we.prototype.getState.call(this));return oe.typeName=ue.typeName,oe},ue.prototype.restoreState=function(oe){we.prototype.restoreState.call(this,oe);var pe=oe;this.arrowType=pe.arrowType,this.createTips(),this.adjustVisual()},ue.typeName="ArrowMarker",ue.title="Arrow marker",ue.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',ue}(Dt),$n=function(we){function ue(oe,pe,fe){var le=we.call(this,oe,pe,fe)||this;return le.fillColor=fe.defaultFillColor,le.strokeWidth=0,le.fillPanel=new Ge("Color",fe.defaultColorSet,fe.defaultFillColor),le.fillPanel.onColorChanged=le.setFillColor,le}return He(ue,we),Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),ue.prototype.getState=function(){var oe=we.prototype.getState.call(this);return oe.typeName=ue.typeName,oe},ue.typeName="CoverMarker",ue.title="Cover marker",ue.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',ue}(Ie),ur=function(we){function ue(oe,pe,fe,le){var Pe=we.call(this,oe,le||'<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 Pe.opacities=[],Pe.opacityBoxes=[],Pe.opacities=pe,Pe.currentOpacity=fe,Pe.setCurrentOpacity=Pe.setCurrentOpacity.bind(Pe),Pe}return He(ue,we),ue.prototype.getUi=function(){var oe=this,pe=document.createElement("div");return pe.style.display="flex",pe.style.overflow="hidden",pe.style.flexGrow="2",pe.style.justifyContent="space-between",this.opacities.forEach(function(fe){var le=document.createElement("div");le.style.display="flex",le.style.alignItems="center",le.style.justifyContent="center",le.style.padding="5px",le.style.borderWidth="2px",le.style.borderStyle="solid",le.style.borderColor=fe===oe.currentOpacity?oe.uiStyleSettings.toolboxAccentColor:"transparent",le.addEventListener("click",function(){oe.setCurrentOpacity(fe,le)}),pe.appendChild(le);var Pe=document.createElement("div");Pe.innerText=100*fe+"%",le.appendChild(Pe),oe.opacityBoxes.push(le)}),pe},ue.prototype.setCurrentOpacity=function(oe,pe){var fe=this;this.currentOpacity=oe,this.opacityBoxes.forEach(function(le){le.style.borderColor=le===pe?fe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},ue}(it),wr=function(we){function ue(oe,pe,fe){var le=we.call(this,oe,pe,fe)||this;return le.setOpacity=le.setOpacity.bind(le),le.fillColor=fe.defaultHighlightColor,le.strokeWidth=0,le.opacity=fe.defaultHighlightOpacity,le.fillPanel=new Ge("Color",fe.defaultColorSet,le.fillColor),le.fillPanel.onColorChanged=le.setFillColor,le.opacityPanel=new ur("Opacity",fe.defaultOpacitySteps,le.opacity),le.opacityPanel.onOpacityChanged=le.setOpacity,le}return He(ue,we),ue.prototype.setOpacity=function(oe){this.opacity=oe,this.visual&&_e.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),ue.prototype.getState=function(){var oe=we.prototype.getState.call(this);return oe.typeName=ue.typeName,oe},ue.typeName="HighlightMarker",ue.title="Highlight marker",ue.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>',ue}($n),Je='<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>',Ae='<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>',Ht=function(we){function ue(oe,pe,fe){var le=we.call(this,oe,pe,fe)||this;return le.bgColor="transparent",le.tipPosition={x:0,y:0},le.tipBase1Position={x:0,y:0},le.tipBase2Position={x:0,y:0},le.tipMoving=!1,le.color=fe.defaultStrokeColor,le.bgColor=fe.defaultFillColor,le.fontFamily=fe.defaultFontFamily,le.defaultSize={x:100,y:30},le.setBgColor=le.setBgColor.bind(le),le.getTipPoints=le.getTipPoints.bind(le),le.positionTip=le.positionTip.bind(le),le.setTipPoints=le.setTipPoints.bind(le),le.colorPanel=new Ge("Text color",fe.defaultColorSet,le.color,Je),le.colorPanel.onColorChanged=le.setColor,le.bgColorPanel=new Ge("Fill color",fe.defaultColorSet,le.bgColor,Ae),le.bgColorPanel.onColorChanged=le.setBgColor,le.fontFamilyPanel=new qe("Font",fe.defaultFontFamilies,fe.defaultFontFamily),le.fontFamilyPanel.onFontChanged=le.setFont,le.tipGrip=new Xt,le.tipGrip.visual.transform.baseVal.appendItem(_e.createTransform()),le.controlBox.appendChild(le.tipGrip.visual),le}return He(ue,we),ue.prototype.ownsTarget=function(oe){return we.prototype.ownsTarget.call(this,oe)||this.tipGrip.ownsTarget(oe)||this.tip===oe},ue.prototype.createTip=function(){_e.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=_e.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},ue.prototype.pointerDown=function(oe,pe){this.state==="new"&&we.prototype.pointerDown.call(this,oe,pe),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(pe)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):we.prototype.pointerDown.call(this,oe,pe)},ue.prototype.pointerUp=function(oe){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,we.prototype.pointerUp.call(this,oe);else{var pe=this.state==="creating";we.prototype.pointerUp.call(this,oe),this.setTipPoints(pe),this.positionTip()}},ue.prototype.manipulate=function(oe){if(this.tipMoving){var pe=this.unrotatePoint(oe);this.tipPosition={x:pe.x-this.manipulationStartLeft,y:pe.y-this.manipulationStartTop},this.positionTip()}else we.prototype.manipulate.call(this,oe)},ue.prototype.setBgColor=function(oe){this.bgRectangle&&this.tip&&(_e.setAttributes(this.bgRectangle,[["fill",oe]]),_e.setAttributes(this.tip,[["fill",oe]])),this.bgColor=oe,this.fillColorChanged(oe)},ue.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},ue.prototype.setTipPoints=function(oe){oe===void 0&&(oe=!1);var pe=Math.min(this.height/2,15),fe=this.height/5;oe&&(this.tipPosition={x:pe+fe/2,y:this.height+20});var le=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?le<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(fe=this.width/5,pe=Math.min(this.width/2,15),this.tipBase1Position={x:pe,y:0},this.tipBase2Position={x:pe+fe,y:0}):(this.tipBase1Position={x:0,y:pe},this.tipBase2Position={x:0,y:pe+fe}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?le<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(fe=this.width/5,pe=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-pe-fe,y:0},this.tipBase2Position={x:this.width-pe,y:0}):(this.tipBase1Position={x:this.width,y:pe},this.tipBase2Position={x:this.width,y:pe+fe}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?le<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(fe=this.width/5,pe=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-pe-fe,y:this.height},this.tipBase2Position={x:this.width-pe,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-pe-fe},this.tipBase2Position={x:this.width,y:this.height-pe}):le<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(fe=this.width/5,pe=Math.min(this.width/2,15),this.tipBase1Position={x:pe,y:this.height},this.tipBase2Position={x:pe+fe,y:this.height}):(this.tipBase1Position={x:0,y:this.height-pe},this.tipBase2Position={x:0,y:this.height-pe-fe})},ue.prototype.resize=function(oe){we.prototype.resize.call(this,oe),this.positionTip()},ue.prototype.positionTip=function(){_e.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(ue.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),ue.prototype.select=function(){this.positionTip(),we.prototype.select.call(this)},ue.prototype.getState=function(){var oe=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},we.prototype.getState.call(this));return oe.typeName=ue.typeName,oe},ue.prototype.restoreState=function(oe){var pe=oe;this.bgColor=pe.bgColor,this.tipPosition=pe.tipPosition,we.prototype.restoreState.call(this,oe),this.createTip(),this.setTipPoints()},ue.prototype.scale=function(oe,pe){we.prototype.scale.call(this,oe,pe),this.tipPosition={x:this.tipPosition.x*oe,y:this.tipPosition.y*pe},this.positionTip()},ue.typeName="CalloutMarker",ue.title="Callout marker",ue.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>',ue}(Rt),Rn=function(we){function ue(oe,pe,fe){var le=we.call(this,oe,pe,fe)||this;return le.fillColor="transparent",le.strokeColor="transparent",le.strokeWidth=0,le.strokeDasharray="",le.opacity=1,le.strokeColor=fe.defaultColor,le.strokeWidth=fe.defaultStrokeWidth,le.strokeDasharray=fe.defaultStrokeDasharray,le.fillColor=fe.defaultFillColor,le.setStrokeColor=le.setStrokeColor.bind(le),le.setFillColor=le.setFillColor.bind(le),le.setStrokeWidth=le.setStrokeWidth.bind(le),le.setStrokeDasharray=le.setStrokeDasharray.bind(le),le.setOpacity=le.setOpacity.bind(le),le.createVisual=le.createVisual.bind(le),le.strokePanel=new Ge("Line color",ve(fe.defaultColorSet,["transparent"]),fe.defaultColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.fillPanel=new Ge("Fill color",ve(fe.defaultColorSet,["transparent"]),le.fillColor,Ae),le.fillPanel.onColorChanged=le.setFillColor,le.strokeWidthPanel=new xe("Line width",fe.defaultStrokeWidths,fe.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new Ue("Line style",fe.defaultStrokeDasharrays,fe.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le.opacityPanel=new ur("Opacity",fe.defaultOpacitySteps,le.opacity),le.opacityPanel.onOpacityChanged=le.setOpacity,le}return He(ue,we),ue.prototype.ownsTarget=function(oe){return!(!we.prototype.ownsTarget.call(this,oe)&&oe!==this.visual)},ue.prototype.createVisual=function(){this.visual=_e.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)},ue.prototype.pointerDown=function(oe,pe){we.prototype.pointerDown.call(this,oe,pe),this.state==="new"&&(this.createVisual(),this.moveVisual(oe),this._state="creating")},ue.prototype.manipulate=function(oe){we.prototype.manipulate.call(this,oe)},ue.prototype.resize=function(oe){we.prototype.resize.call(this,oe),this.setSize()},ue.prototype.setSize=function(){we.prototype.setSize.call(this),_e.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},ue.prototype.pointerUp=function(oe){we.prototype.pointerUp.call(this,oe),this.setSize()},ue.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.visual&&_e.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(oe),this.stateChanged()},ue.prototype.setFillColor=function(oe){this.fillColor=oe,this.visual&&_e.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(oe),this.stateChanged()},ue.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.visual&&_e.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},ue.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.visual&&_e.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},ue.prototype.setOpacity=function(oe){this.opacity=oe,this.visual&&_e.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),ue.prototype.getState=function(){var oe=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},we.prototype.getState.call(this));return oe.typeName=ue.typeName,oe},ue.prototype.restoreState=function(oe){var pe=oe;this.fillColor=pe.fillColor,this.strokeColor=pe.strokeColor,this.strokeWidth=pe.strokeWidth,this.strokeDasharray=pe.strokeDasharray,this.opacity=pe.opacity,this.createVisual(),we.prototype.restoreState.call(this,oe),this.setSize()},ue.prototype.scale=function(oe,pe){we.prototype.scale.call(this,oe,pe),this.setSize()},ue.typeName="EllipseMarker",ue.title="Ellipse marker",ue.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>',ue}(ft),yn=function(we){function ue(oe,pe,fe){return we.call(this,oe,pe,fe)||this}return He(ue,we),Object.defineProperty(ue.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),ue.prototype.ownsTarget=function(oe){return!(!we.prototype.ownsTarget.call(this,oe)&&oe!==this.tip1&&oe!==this.tip2)},ue.prototype.createTips=function(){this.tip1=_e.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(_e.createTransform()),this.visual.appendChild(this.tip1),this.tip2=_e.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(_e.createTransform()),this.visual.appendChild(this.tip2)},ue.prototype.pointerDown=function(oe,pe){we.prototype.pointerDown.call(this,oe,pe),this.state==="creating"&&this.createTips()},ue.prototype.adjustVisual=function(){if(we.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(_e.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()]]),_e.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),pe=this.tip1.transform.baseVal.getItem(0);pe.setRotate(oe,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(pe,0);var fe=this.tip2.transform.baseVal.getItem(0);fe.setRotate(oe+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(fe,0)}},Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),ue.prototype.getState=function(){var oe=we.prototype.getState.call(this);return oe.typeName=ue.typeName,oe},ue.prototype.restoreState=function(oe){we.prototype.restoreState.call(this,oe),this.createTips(),this.adjustVisual()},ue.typeName="MeasurementMarker",ue.title="Measurement marker",ue.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>',ue}(Dt),ot=function(we){function ue(oe,pe,fe){var le=we.call(this,oe,pe,fe)||this;return le.strokePanel.colors=fe.defaultColorSet,le.fillColor="transparent",le}return He(ue,we),Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),ue.prototype.getState=function(){var oe=we.prototype.getState.call(this);return oe.typeName=ue.typeName,oe},ue.typeName="EllipseFrameMarker",ue.title="Ellipse frame marker",ue.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>',ue}(Rn),nt=function(){function we(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(we.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),we.prototype.addUndoStep=function(ue){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(ue)||(this.undoStack.push(ue),JSON.stringify(this.lastRedoStep)!==JSON.stringify(ue)&&this.redoStack.splice(0,this.redoStack.length))},we.prototype.replaceLastUndoStep=function(ue){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=ue)},we.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},we.prototype.undo=function(){if(this.undoStack.length>1){var ue=this.undoStack.pop();return ue!==void 0&&this.redoStack.push(ue),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},we.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},we}(),Tt=function(we){function ue(oe,pe,fe){var le=we.call(this,oe,pe,fe)||this;return le.strokeColor="transparent",le.strokeWidth=0,le.strokeDasharray="",le.curveX=0,le.curveY=0,le.manipulationStartCurveX=0,le.manipulationStartCurveY=0,le.setStrokeColor=le.setStrokeColor.bind(le),le.setStrokeWidth=le.setStrokeWidth.bind(le),le.setStrokeDasharray=le.setStrokeDasharray.bind(le),le.positionGrips=le.positionGrips.bind(le),le.addControlGrips=le.addControlGrips.bind(le),le.adjustVisual=le.adjustVisual.bind(le),le.setupControlBox=le.setupControlBox.bind(le),le.resize=le.resize.bind(le),le.strokeColor=fe.defaultColor,le.strokeWidth=fe.defaultStrokeWidth,le.strokeDasharray=fe.defaultStrokeDasharray,le.strokePanel=new Ge("Line color",fe.defaultColorSet,fe.defaultColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.strokeWidthPanel=new xe("Line width",fe.defaultStrokeWidths,fe.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new Ue("Line style",fe.defaultStrokeDasharrays,fe.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le}return He(ue,we),ue.prototype.ownsTarget=function(oe){return!(!we.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.selectorCurve&&oe!==this.visibleCurve&&!this.curveGrip.ownsTarget(oe))},ue.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},ue.prototype.createVisual=function(){this.visual=_e.createGroup(),this.selectorCurve=_e.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=_e.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)},ue.prototype.pointerDown=function(oe,pe){we.prototype.pointerDown.call(this,oe,pe),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(pe)&&(this.activeGrip=this.curveGrip,this._state="resize")},ue.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),_e.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),_e.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),_e.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},ue.prototype.setupControlBox=function(){we.prototype.setupControlBox.call(this),this.curveControlLine1=_e.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=_e.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)},ue.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,we.prototype.addControlGrips.call(this)},ue.prototype.positionGrips=function(){we.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()))},ue.prototype.manipulate=function(oe){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+oe.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+oe.y-this.manipulationStartY),we.prototype.manipulate.call(this,oe)},ue.prototype.resize=function(oe){this.activeGrip===this.curveGrip&&(this.curveX=oe.x,this.curveY=oe.y),we.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)},ue.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.adjustVisual(),this.colorChanged(oe)},ue.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.adjustVisual()},ue.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.adjustVisual()},ue.prototype.scale=function(oe,pe){this.curveX=this.curveX*oe,this.curveY=this.curveY*pe,we.prototype.scale.call(this,oe,pe)},Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),ue.prototype.getState=function(){var oe=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},we.prototype.getState.call(this));return oe.typeName=ue.typeName,oe},ue.prototype.restoreState=function(oe){we.prototype.restoreState.call(this,oe);var pe=oe;this.strokeColor=pe.strokeColor,this.strokeWidth=pe.strokeWidth,this.strokeDasharray=pe.strokeDasharray,this.curveX=pe.curveX,this.curveY=pe.curveY,this.createVisual(),this.adjustVisual()},ue.typeName="CurveMarker",ue.title="Curve marker",ue.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>',ue}(Ct),rn=function(we){function ue(oe,pe,fe){var le=we.call(this,oe,pe,fe)||this;return le.fillColor="transparent",le.strokeColor="transparent",le.strokeWidth=0,le.strokeDasharray="",le.textColor="transparent",le.fontSize="1rem",le.isMoved=!1,le.captionText="Caption",le.PADDING=5,le.captionBoxWidth=0,le.captionBoxHeight=0,le.strokeColor=fe.defaultColor,le.strokeWidth=fe.defaultStrokeWidth,le.strokeDasharray=fe.defaultStrokeDasharray,le.fillColor=fe.defaultFillColor,le.textColor=fe.defaultStrokeColor,le.fontFamily=fe.defaultFontFamily,le.fontSize=fe.defaultCaptionFontSize,le.captionText=fe.defaultCaptionText,le.setStrokeColor=le.setStrokeColor.bind(le),le.setFillColor=le.setFillColor.bind(le),le.setStrokeWidth=le.setStrokeWidth.bind(le),le.setStrokeDasharray=le.setStrokeDasharray.bind(le),le.createVisual=le.createVisual.bind(le),le.sizeCaption=le.sizeCaption.bind(le),le.setCaptionText=le.setCaptionText.bind(le),le.showTextEditor=le.showTextEditor.bind(le),le.positionTextEditor=le.positionTextEditor.bind(le),le.finishTextEditing=le.finishTextEditing.bind(le),le.setFont=le.setFont.bind(le),le.setTextColor=le.setTextColor.bind(le),le.strokePanel=new Ge("Line color",ve(fe.defaultColorSet,["transparent"]),le.strokeColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.fillPanel=new Ge("Fill color",ve(fe.defaultColorSet,["transparent"]),le.fillColor,Ae),le.fillPanel.onColorChanged=le.setFillColor,le.strokeWidthPanel=new xe("Line width",fe.defaultStrokeWidths,fe.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new Ue("Line style",fe.defaultStrokeDasharrays,fe.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le.fontFamilyPanel=new qe("Font",fe.defaultFontFamilies,fe.defaultFontFamily),le.fontFamilyPanel.onFontChanged=le.setFont,le.textColorPanel=new Ge("Text color",fe.defaultColorSet,le.textColor,Je),le.textColorPanel.onColorChanged=le.setTextColor,le}return He(ue,we),ue.prototype.ownsTarget=function(oe){return!(!we.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.frame&&oe!==this.captionBg&&oe!==this.captionElement)},ue.prototype.createVisual=function(){this.visual=_e.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=_e.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=_e.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=_e.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()},ue.prototype.setCaptionText=function(oe){this.captionText=oe,this.captionElement.textContent=this.captionText,this.sizeCaption()},ue.prototype.pointerDown=function(oe,pe){we.prototype.pointerDown.call(this,oe,pe),this.isMoved=!1,this.pointerDownPoint=oe,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(oe),this._state="creating")},ue.prototype.manipulate=function(oe){we.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)},ue.prototype.resize=function(oe){we.prototype.resize.call(this,oe),this.setSize()},ue.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),_e.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')"]]),_e.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')"]])},ue.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(pe){pe.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(pe){pe.key==="Enter"&&oe.finishTextEditing(oe.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(pe){pe.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()},ue.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"))},ue.prototype.finishTextEditing=function(oe){this.setCaptionText(oe.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},ue.prototype.setFont=function(oe){this.captionElement&&_e.setAttributes(this.captionElement,[["font-family",oe]]),this.fontFamily=oe,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},ue.prototype.setTextColor=function(oe){this.captionElement&&_e.setAttributes(this.captionElement,[["fill",oe]]),this.textColor=oe,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},ue.prototype.setSize=function(){we.prototype.setSize.call(this),_e.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},ue.prototype.pointerUp=function(oe){we.prototype.pointerUp.call(this,oe),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},ue.prototype.dblClick=function(oe,pe){we.prototype.dblClick.call(this,oe,pe),this.showTextEditor()},ue.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.frame&&_e.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(oe),this.stateChanged()},ue.prototype.setFillColor=function(oe){this.fillColor=oe,this.captionBg&&_e.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(oe),this.stateChanged()},ue.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.frame&&_e.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},ue.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.frame&&_e.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),ue.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},we.prototype.getState.call(this));return oe.typeName=this.typeName,oe},ue.prototype.restoreState=function(oe){var pe=oe;this.fillColor=pe.fillColor,this.strokeColor=pe.strokeColor,this.strokeWidth=pe.strokeWidth,this.strokeDasharray=pe.strokeDasharray,this.textColor=pe.textColor,this.fontFamily=pe.fontFamily,this.captionText=pe.captionText,this.fontSize=pe.fontSize,this.createVisual(),we.prototype.restoreState.call(this,oe),this.setSize()},ue.prototype.scale=function(oe,pe){we.prototype.scale.call(this,oe,pe),this.setSize()},ue.typeName="CaptionFrameMarker",ue.title="Caption frame marker",ue.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>',ue}(ft),dn=function(){function we(ue,oe){oe===void 0&&(oe=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=ue,this.cancelable=oe}return Object.defineProperty(we.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),we.prototype.preventDefault=function(){this._defaultPrevented=!0},we}(),Ut=function(we){function ue(oe,pe,fe){var le=we.call(this,oe,!1)||this;return le.dataUrl=pe,le.state=fe,le}return He(ue,we),ue}(dn),Kt=function(we){function ue(oe,pe,fe){fe===void 0&&(fe=!1);var le=we.call(this,oe,fe)||this;return le.marker=pe,le}return He(ue,we),ue}(dn),bn=function(){function we(){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 we.prototype.addEventListener=function(ue,oe){this[ue].push(oe)},we.prototype.removeEventListener=function(ue,oe){var pe=this[ue].indexOf(oe);pe>-1&&this[ue].splice(pe,1)},we}(),nn=function(){function we(ue){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new _t,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 bn,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=we.instanceCounter++,this.styles=new Ee(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=ue,this.targetRoot=document.body,this.width=ue.clientWidth,this.height=ue.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(we.prototype,"ALL_MARKER_TYPES",{get:function(){return[je,Pt,tn,Rt,ot,Rn,wr,Ht,yn,$n,Dt,Tt,rn]},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[je,Pt,tn,Rt,Rn,wr,Ht]},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"BASIC_MARKER_TYPES",{get:function(){return[je,Pt,tn,Rt,wr]},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(ue){var oe=this;this._availableMarkerTypes.splice(0),ue.forEach(function(pe){if(typeof pe=="string"){var fe=oe.ALL_MARKER_TYPES.find(function(le){return le.typeName===pe});fe!==void 0&&oe._availableMarkerTypes.push(fe)}else oe._availableMarkerTypes.push(pe)})},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(we.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(ue){this._zoomLevel=ue,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(we.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),we.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ke.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},we.prototype.show=function(){var ue=this;this.styles.styleSheetRoot===void 0&&me.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=me.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(oe){return oe(new dn(ue))})},we.prototype.render=function(){return Re(this,void 0,void 0,function(){var ue;return Ve(this,function(oe){switch(oe.label){case 0:return this.setCurrentMarker(),(ue=new Se).naturalSize=this.renderAtNaturalSize,ue.imageType=this.renderImageType,ue.imageQuality=this.renderImageQuality,ue.markersOnly=this.renderMarkersOnly,ue.width=this.renderWidth,ue.height=this.renderHeight,[4,ue.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return oe.sent(),[4,ue.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,oe.sent()]}})})},we.prototype.close=function(ue){var oe=this;if(ue===void 0&&(ue=!1),this.isOpen){var pe=!1;ue||this.eventListeners.beforeclose.forEach(function(fe){var le=new dn(oe,!0);fe(le),le.defaultPrevented&&(pe=!0)}),pe||(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(fe){return fe(new dn(oe))}),this.detachEvents(),this._isOpen=!1)}},we.prototype.addMarkersToToolbar=function(){for(var ue,oe=[],pe=0;pe<arguments.length;pe++)oe[pe]=arguments[pe];(ue=this._availableMarkerTypes).push.apply(ue,oe)},we.prototype.addRenderEventListener=function(ue){this.addEventListener("render",function(oe){ue(oe.dataUrl,oe.state)})},we.prototype.removeRenderEventListener=function(ue){},we.prototype.addCloseEventListener=function(ue){this.addEventListener("close",function(){ue()})},we.prototype.removeCloseEventListener=function(ue){},we.prototype.setupResizeObserver=function(){var ue=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){ue.resize(ue.target.clientWidth,ue.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return ue.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},we.prototype.onPopupTargetResize=function(){var ue=1*this.target.clientWidth/this.target.clientHeight,oe=this.editorCanvas.clientWidth/ue>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*ue:this.editorCanvas.clientWidth,pe=oe<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/ue;this.resize(oe,pe)},we.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},we.prototype.resize=function(ue,oe){this._isResizing=!0;var pe=ue/this.imageWidth,fe=oe/this.imageHeight;this.imageWidth=Math.round(ue),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(pe,fe),this._isResizing=!1},we.prototype.scaleMarkers=function(ue,oe){var pe,fe=this;this._currentMarker&&this._currentMarker instanceof Rt?this._currentMarker.scale(ue,oe):(pe=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(le){le!==fe._currentMarker&&le.scale(ue,oe)}),pe!==void 0&&this.setCurrentMarker(pe)},we.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"},we.prototype.setTopLeft=function(){var ue=this.editingTarget.getBoundingClientRect(),oe=this.editorCanvas.getBoundingClientRect();this.left=ue.left-oe.left,this.top=ue.top-oe.top},we.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)},we.prototype.addDefs=function(){for(var ue,oe=[],pe=0;pe<arguments.length;pe++)oe[pe]=arguments[pe];this.defs=_e.createDefs(),this.addDefsToImage(),(ue=this.defs).append.apply(ue,oe)},we.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},we.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)},we.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},we.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},we.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)},we.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},we.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)},we.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 ue=document.createElement("a");ue.href="https://markerjs.com/",ue.target="_blank",ue.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>',ue.title="Powered by marker.js",ue.style.display="grid",ue.style.alignItems="center",ue.style.justifyItems="center",ue.style.padding="3px",ue.style.width="20px",ue.style.height="20px",this.logoUI.appendChild(ue),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},we.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")},we.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"},we.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},we.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 ue=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=ue+"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 St(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 dt(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},we.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},we.prototype.removeMarker=function(ue){this.markerImage.removeChild(ue.container),this.markers.indexOf(ue)>-1&&this.markers.splice(this.markers.indexOf(ue),1),ue.dispose()},we.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())},we.prototype.toolbarButtonClicked=function(ue,oe){if(ue==="marker"&&oe!==void 0)this.createNewMarker(oe);else if(ue==="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()}},we.prototype.deleteSelectedMarker=function(){var ue=this;if(this._currentMarker!==void 0){var oe=!1;if(this.eventListeners.markerbeforedelete.forEach(function(fe){var le=new Kt(ue,ue._currentMarker,!0);fe(le),le.defaultPrevented&&(oe=!0)}),!oe){var pe=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(fe){return fe(new Kt(ue,pe))})}}},we.prototype.clear=function(){var ue=this,oe=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Pe){var Qe=new Kt(ue,void 0,!0);Pe(Qe),Qe.defaultPrevented&&(oe=!0)}),!oe)){this.setCurrentMarker();for(var pe=function(Pe){var Qe=fe.markers[Pe];fe.setCurrentMarker(fe.markers[Pe]),fe._currentMarker.dispose(),fe.markerImage.removeChild(fe._currentMarker.container),fe.markers.splice(fe.markers.indexOf(fe._currentMarker),1),fe.eventListeners.markerdelete.forEach(function(It){return It(new Kt(ue,Qe))})},fe=this,le=this.markers.length-1;le>=0;le--)pe(le);this.addUndoStep()}},Object.defineProperty(we.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),we.prototype.showNotesEditor=function(){var ue;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=(ue=this._currentMarker.notes)!==null&&ue!==void 0?ue:"",this.overlayContainer.appendChild(this.notesArea))},we.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)},we.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},we.prototype.addUndoStep=function(){var ue=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var oe=this.getState(),pe=this.undoRedoManager.getLastUndoStep();if(!pe||pe.width===oe.width&&pe.height===oe.height){var fe=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(oe),fe<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(le){return le(new dn(ue))})}else this.undoRedoManager.replaceLastUndoStep(oe),this.eventListeners.statechange.forEach(function(le){return le(new dn(ue))})}},we.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},we.prototype.undoStep=function(){var ue=this,oe=this.undoRedoManager.undo();oe!==void 0&&(this.restoreState(oe),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(pe){return pe(new dn(ue))}))},we.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},we.prototype.redoStep=function(){var ue=this,oe=this.undoRedoManager.redo();oe!==void 0&&(this.restoreState(oe),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(pe){return pe(new dn(ue))}))},we.prototype.stepZoom=function(){var ue=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=ue<this.zoomSteps.length-1?this.zoomSteps[ue+1]:this.zoomSteps[0]},we.prototype.panTo=function(ue){this.contentDiv.scrollBy({left:this.prevPanPoint.x-ue.x,top:this.prevPanPoint.y-ue.y}),this.prevPanPoint=ue},we.prototype.startRenderAndClose=function(){return Re(this,void 0,void 0,function(){var ue,oe,pe=this;return Ve(this,function(fe){switch(fe.label){case 0:return[4,this.render()];case 1:return ue=fe.sent(),oe=this.getState(),this.eventListeners.render.forEach(function(le){return le(new Ut(pe,ue,oe))}),this.close(!0),[2]}})})},we.prototype.getState=function(ue){ue===!0&&this.setCurrentMarker();var oe={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(pe){return oe.markers.push(pe.getState())}),oe},we.prototype.restoreState=function(ue){var oe=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);ue.markers.forEach(function(pe){var fe=oe._availableMarkerTypes.find(function(Pe){return Pe.typeName===pe.typeName});if(fe!==void 0){var le=oe.addNewMarker(fe);le.restoreState(pe),oe.markers.push(le)}}),ue.width&&ue.height&&(ue.width!==this.imageWidth||ue.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/ue.width,this.imageHeight/ue.height),this.eventListeners.restorestate.forEach(function(pe){return pe(new dn(oe))})},we.prototype.addNewMarker=function(ue){var oe=_e.createGroup();return this.markerImage.appendChild(oe),new ue(oe,this.overlayContainer,this.settings)},we.prototype.createNewMarker=function(ue){var oe,pe=this;(oe=typeof ue=="string"?this._availableMarkerTypes.find(function(fe){return fe.typeName===ue}):ue)&&(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(fe){return fe(new Kt(pe,pe._currentMarker))}))},we.prototype.markerCreated=function(ue){var oe=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(ue),this.setCurrentMarker(ue),ue instanceof Pt&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Pt):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(pe){return pe(new Kt(oe,oe._currentMarker))})},we.prototype.colorChanged=function(ue){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=ue,this.settings.defaultStrokeColor=ue)},we.prototype.fillColorChanged=function(ue){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=ue)},we.prototype.markerStateChanged=function(ue){var oe=this;this.eventListeners.markerchange.forEach(function(pe){return pe(new Kt(oe,ue))})},we.prototype.setCurrentMarker=function(ue){var oe=this;this._currentMarker!==ue&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(pe){return pe(new Kt(oe,oe._currentMarker))})),this._currentMarker=ue,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(pe){return pe(new Kt(oe,oe._currentMarker))}))},we.prototype.onPointerDown=function(ue){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||ue.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(pe){return pe.ownsTarget(ue.target)});oe!==void 0?(this.setCurrentMarker(oe),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(ue.clientX,ue.clientY),ue.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:ue.clientX,y:ue.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(ue.clientX,ue.clientY))},we.prototype.onDblClick=function(ue){if(this._isFocused||this.focus(),this.mode==="select"){var oe=this.markers.find(function(pe){return pe.ownsTarget(ue.target)});oe!==void 0&&oe!==this._currentMarker&&this.setCurrentMarker(oe),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(ue.clientX,ue.clientY),ue.target):this.setCurrentMarker()}},we.prototype.onPointerMove=function(ue){this.touchPoints!==1&&ue.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||ue.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(ue.clientX,ue.clientY)):this.zoomLevel>1&&this.panTo({x:ue.clientX,y:ue.clientY}))},we.prototype.onPointerUp=function(ue){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(ue.clientX,ue.clientY)),this.isDragging=!1,this.addUndoStep()},we.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},we.prototype.onKeyUp=function(ue){this._currentMarker===void 0||this.notesArea!==void 0||ue.key!=="Delete"&&ue.key!=="Backspace"||this.deleteSelectedMarker()},we.prototype.clientToLocalCoordinates=function(ue,oe){var pe=this.markerImage.getBoundingClientRect();return{x:(ue-pe.left)/this.zoomLevel,y:(oe-pe.top)/this.zoomLevel}},we.prototype.onWindowResize=function(){this.positionUI()},we.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var ue=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=ue+"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()},we.prototype.addLicenseKey=function(ue){ke.addKey(ue)},we.prototype.addEventListener=function(ue,oe){this.eventListeners.addEventListener(ue,oe)},we.prototype.removeEventListener=function(ue,oe){this.eventListeners.removeEventListener(ue,oe)},we.prototype.renderState=function(ue){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(ue),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(we.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),we.prototype.focus=function(){var ue=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 dn(ue))}))},we.prototype.blur=function(){var ue=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(oe){return oe(new dn(ue))}))},we.instanceCounter=0,we}()},95860:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return rt}});var he=se(87462),He=se(1413),Re=se(4942),Ve=se(97685),ve=se(45987),_e=se(94184),ke=se.n(_e),Se=se(67294);function me(ft){var Ie=Se.useRef();Ie.current=ft;var xe=Se.useCallback(function(){for(var Ue,je=arguments.length,_t=new Array(je),Ct=0;Ct<je;Ct++)_t[Ct]=arguments[Ct];return(Ue=Ie.current)===null||Ue===void 0?void 0:Ue.call.apply(Ue,[Ie].concat(_t))},[]);return xe}function Ee(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var tt=Ee()?Se.useLayoutEffect:Se.useEffect,Be=function(Ie,xe){var Ue=Se.useRef(!0);tt(function(){return Ie(Ue.current)},xe),tt(function(){return Ue.current=!1,function(){Ue.current=!0}},[])},St=function(Ie,xe){Be(function(Ue){if(!Ue)return Ie()},xe)},dt=null;function it(ft){var Ie=Se.useRef(!1),xe=Se.useState(ft),Ue=(0,Ve.Z)(xe,2),je=Ue[0],_t=Ue[1];Se.useEffect(function(){return Ie.current=!1,function(){Ie.current=!0}},[]);function Ct(Dt,qe){qe&&Ie.current||_t(Dt)}return[je,Ct]}function Ge(ft){return ft!==void 0}function De(ft,Ie){var xe=Ie||{},Ue=xe.defaultValue,je=xe.value,_t=xe.onChange,Ct=xe.postState,Dt=it(function(){return Ge(je)?je:Ge(Ue)?typeof Ue=="function"?Ue():Ue:typeof ft=="function"?ft():ft}),qe=(0,Ve.Z)(Dt,2),Rt=qe[0],Pt=qe[1],En=je!==void 0?je:Rt,tn=Ct?Ct(En):En,$n=me(_t),ur=it([En]),wr=(0,Ve.Z)(ur,2),Je=wr[0],Ae=wr[1];St(function(){var Rn=Je[0];Rt!==Rn&&$n(Rt,Rn)},[Je]),St(function(){Ge(je)||Pt(je)},[je]);var Ht=me(function(Rn,yn){Pt(Rn,yn),Ae([En],yn)});return[tn,Ht]}var At=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],Xt=(0,Se.forwardRef)(function(ft,Ie){var xe,Ue=ft.prefixCls,je=Ue===void 0?"rc-checkbox":Ue,_t=ft.className,Ct=ft.style,Dt=ft.checked,qe=ft.disabled,Rt=ft.defaultChecked,Pt=Rt===void 0?!1:Rt,En=ft.type,tn=En===void 0?"checkbox":En,$n=ft.title,ur=ft.onChange,wr=(0,ve.Z)(ft,At),Je=(0,Se.useRef)(null),Ae=De(Pt,{value:Dt}),Ht=(0,Ve.Z)(Ae,2),Rn=Ht[0],yn=Ht[1];(0,Se.useImperativeHandle)(Ie,function(){return{focus:function(){var rn;(rn=Je.current)===null||rn===void 0||rn.focus()},blur:function(){var rn;(rn=Je.current)===null||rn===void 0||rn.blur()},input:Je.current}});var ot=ke()(je,_t,(xe={},(0,Re.Z)(xe,"".concat(je,"-checked"),Rn),(0,Re.Z)(xe,"".concat(je,"-disabled"),qe),xe)),nt=function(rn){qe||("checked"in ft||yn(rn.target.checked),ur==null||ur({target:(0,He.Z)((0,He.Z)({},ft),{},{type:tn,checked:rn.target.checked}),stopPropagation:function(){rn.stopPropagation()},preventDefault:function(){rn.preventDefault()},nativeEvent:rn.nativeEvent}))};return Se.createElement("span",{className:ot,title:$n,style:Ct},Se.createElement("input",(0,he.Z)({},wr,{className:"".concat(je,"-input"),ref:Je,onChange:nt,disabled:qe,checked:!!Rn,type:tn})),Se.createElement("span",{className:"".concat(je,"-inner")}))}),rt=Xt},26819:function(Sn,Wt){"use strict";var se;var he=typeof Symbol=="function"&&Symbol.for,He=he?Symbol.for("react.element"):60103,Re=he?Symbol.for("react.portal"):60106,Ve=he?Symbol.for("react.fragment"):60107,ve=he?Symbol.for("react.strict_mode"):60108,_e=he?Symbol.for("react.profiler"):60114,ke=he?Symbol.for("react.provider"):60109,Se=he?Symbol.for("react.context"):60110,me=he?Symbol.for("react.async_mode"):60111,Ee=he?Symbol.for("react.concurrent_mode"):60111,tt=he?Symbol.for("react.forward_ref"):60112,Be=he?Symbol.for("react.suspense"):60113,St=he?Symbol.for("react.suspense_list"):60120,dt=he?Symbol.for("react.memo"):60115,it=he?Symbol.for("react.lazy"):60116,Ge=he?Symbol.for("react.block"):60121,De=he?Symbol.for("react.fundamental"):60117,At=he?Symbol.for("react.responder"):60118,Xt=he?Symbol.for("react.scope"):60119;function rt(Ie){if(typeof Ie=="object"&&Ie!==null){var xe=Ie.$$typeof;switch(xe){case He:switch(Ie=Ie.type,Ie){case me:case Ee:case Ve:case _e:case ve:case Be:return Ie;default:switch(Ie=Ie&&Ie.$$typeof,Ie){case Se:case tt:case it:case dt:case ke:return Ie;default:return xe}}case Re:return xe}}}function ft(Ie){return rt(Ie)===Ee}se=me,se=Ee,se=Se,se=ke,se=He,se=tt,se=Ve,se=it,se=dt,se=Re,se=_e,se=ve,se=Be,se=function(Ie){return ft(Ie)||rt(Ie)===me},se=ft,se=function(Ie){return rt(Ie)===Se},se=function(Ie){return rt(Ie)===ke},se=function(Ie){return typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===He},se=function(Ie){return rt(Ie)===tt},se=function(Ie){return rt(Ie)===Ve},se=function(Ie){return rt(Ie)===it},Wt.isMemo=function(Ie){return rt(Ie)===dt},se=function(Ie){return rt(Ie)===Re},se=function(Ie){return rt(Ie)===_e},se=function(Ie){return rt(Ie)===ve},se=function(Ie){return rt(Ie)===Be},se=function(Ie){return typeof Ie=="string"||typeof Ie=="function"||Ie===Ve||Ie===Ee||Ie===_e||Ie===ve||Ie===Be||Ie===St||typeof Ie=="object"&&Ie!==null&&(Ie.$$typeof===it||Ie.$$typeof===dt||Ie.$$typeof===ke||Ie.$$typeof===Se||Ie.$$typeof===tt||Ie.$$typeof===De||Ie.$$typeof===At||Ie.$$typeof===Xt||Ie.$$typeof===Ge)},se=rt},18459:function(Sn,Wt,se){"use strict";Sn.exports=se(26819)},16651:function(Sn,Wt){"use strict";var se;var he=Symbol.for("react.element"),He=Symbol.for("react.portal"),Re=Symbol.for("react.fragment"),Ve=Symbol.for("react.strict_mode"),ve=Symbol.for("react.profiler"),_e=Symbol.for("react.provider"),ke=Symbol.for("react.context"),Se=Symbol.for("react.server_context"),me=Symbol.for("react.forward_ref"),Ee=Symbol.for("react.suspense"),tt=Symbol.for("react.suspense_list"),Be=Symbol.for("react.memo"),St=Symbol.for("react.lazy"),dt=Symbol.for("react.offscreen"),it;it=Symbol.for("react.module.reference");function Ge(De){if(typeof De=="object"&&De!==null){var At=De.$$typeof;switch(At){case he:switch(De=De.type,De){case Re:case ve:case Ve:case Ee:case tt:return De;default:switch(De=De&&De.$$typeof,De){case Se:case ke:case me:case St:case Be:case _e:return De;default:return At}}case He:return At}}}se=ke,se=_e,se=he,se=me,se=Re,se=St,se=Be,se=He,se=ve,se=Ve,se=Ee,se=tt,se=function(){return!1},se=function(){return!1},se=function(De){return Ge(De)===ke},se=function(De){return Ge(De)===_e},se=function(De){return typeof De=="object"&&De!==null&&De.$$typeof===he},se=function(De){return Ge(De)===me},se=function(De){return Ge(De)===Re},se=function(De){return Ge(De)===St},se=function(De){return Ge(De)===Be},se=function(De){return Ge(De)===He},se=function(De){return Ge(De)===ve},se=function(De){return Ge(De)===Ve},se=function(De){return Ge(De)===Ee},se=function(De){return Ge(De)===tt},se=function(De){return typeof De=="string"||typeof De=="function"||De===Re||De===ve||De===Ve||De===Ee||De===tt||De===dt||typeof De=="object"&&De!==null&&(De.$$typeof===St||De.$$typeof===Be||De.$$typeof===_e||De.$$typeof===ke||De.$$typeof===me||De.$$typeof===it||De.getModuleId!==void 0)},se=Ge},33993:function(Sn,Wt,se){"use strict";se(16651)},82523:function(Sn,Wt){"use strict";var se;var he=Symbol.for("react.element"),He=Symbol.for("react.portal"),Re=Symbol.for("react.fragment"),Ve=Symbol.for("react.strict_mode"),ve=Symbol.for("react.profiler"),_e=Symbol.for("react.provider"),ke=Symbol.for("react.context"),Se=Symbol.for("react.server_context"),me=Symbol.for("react.forward_ref"),Ee=Symbol.for("react.suspense"),tt=Symbol.for("react.suspense_list"),Be=Symbol.for("react.memo"),St=Symbol.for("react.lazy"),dt=Symbol.for("react.offscreen"),it;it=Symbol.for("react.module.reference");function Ge(De){if(typeof De=="object"&&De!==null){var At=De.$$typeof;switch(At){case he:switch(De=De.type,De){case Re:case ve:case Ve:case Ee:case tt:return De;default:switch(De=De&&De.$$typeof,De){case Se:case ke:case me:case St:case Be:case _e:return De;default:return At}}case He:return At}}}se=ke,se=_e,se=he,se=me,se=Re,se=St,se=Be,se=He,se=ve,se=Ve,se=Ee,se=tt,se=function(){return!1},se=function(){return!1},se=function(De){return Ge(De)===ke},se=function(De){return Ge(De)===_e},se=function(De){return typeof De=="object"&&De!==null&&De.$$typeof===he},se=function(De){return Ge(De)===me},se=function(De){return Ge(De)===Re},se=function(De){return Ge(De)===St},se=function(De){return Ge(De)===Be},se=function(De){return Ge(De)===He},se=function(De){return Ge(De)===ve},se=function(De){return Ge(De)===Ve},se=function(De){return Ge(De)===Ee},se=function(De){return Ge(De)===tt},se=function(De){return typeof De=="string"||typeof De=="function"||De===Re||De===ve||De===Ve||De===Ee||De===tt||De===dt||typeof De=="object"&&De!==null&&(De.$$typeof===St||De.$$typeof===Be||De.$$typeof===_e||De.$$typeof===ke||De.$$typeof===me||De.$$typeof===it||De.getModuleId!==void 0)},se=Ge},27183:function(Sn,Wt,se){"use strict";se(82523)},67656:function(Sn,Wt,se){"use strict";se.r(Wt),se.d(Wt,{BaseInput:function(){return Ee},default:function(){return Xt}});var he=se(87462),He=se(1413),Re=se(4942),Ve=se(71002),ve=se(94184),_e=se.n(ve),ke=se(67294),Se=se(87887),me=function(ft){var Ie,xe,Ue=ft.inputElement,je=ft.prefixCls,_t=ft.prefix,Ct=ft.suffix,Dt=ft.addonBefore,qe=ft.addonAfter,Rt=ft.className,Pt=ft.style,En=ft.disabled,tn=ft.readOnly,$n=ft.focused,ur=ft.triggerFocus,wr=ft.allowClear,Je=ft.value,Ae=ft.handleReset,Ht=ft.hidden,Rn=ft.classes,yn=ft.classNames,ot=ft.dataAttrs,nt=ft.styles,Tt=ft.components,rn=(Tt==null?void 0:Tt.affixWrapper)||"span",dn=(Tt==null?void 0:Tt.groupWrapper)||"span",Ut=(Tt==null?void 0:Tt.wrapper)||"span",Kt=(Tt==null?void 0:Tt.groupAddon)||"span",bn=(0,ke.useRef)(null),nn=function(an){var jt;(jt=bn.current)!==null&&jt!==void 0&&jt.contains(an.target)&&(ur==null||ur())},we=function(){var an;if(!wr)return null;var jt=!En&&!tn&&Je,ir="".concat(je,"-clear-icon"),Cr=(0,Ve.Z)(wr)==="object"&&wr!==null&&wr!==void 0&&wr.clearIcon?wr.clearIcon:"\u2716";return ke.createElement("span",{onClick:Ae,onMouseDown:function(Mn){return Mn.preventDefault()},className:_e()(ir,(an={},(0,Re.Z)(an,"".concat(ir,"-hidden"),!jt),(0,Re.Z)(an,"".concat(ir,"-has-suffix"),!!Ct),an)),role:"button",tabIndex:-1},Cr)},ue=(0,ke.cloneElement)(Ue,{value:Je,hidden:Ht,className:_e()((Ie=Ue.props)===null||Ie===void 0?void 0:Ie.className,!(0,Se.X3)(ft)&&!(0,Se.He)(ft)&&Rt)||null,style:(0,He.Z)((0,He.Z)({},(xe=Ue.props)===null||xe===void 0?void 0:xe.style),!(0,Se.X3)(ft)&&!(0,Se.He)(ft)?Pt:{})});if((0,Se.X3)(ft)){var oe,pe="".concat(je,"-affix-wrapper"),fe=_e()(pe,(oe={},(0,Re.Z)(oe,"".concat(pe,"-disabled"),En),(0,Re.Z)(oe,"".concat(pe,"-focused"),$n),(0,Re.Z)(oe,"".concat(pe,"-readonly"),tn),(0,Re.Z)(oe,"".concat(pe,"-input-with-clear-btn"),Ct&&wr&&Je),oe),!(0,Se.He)(ft)&&Rt,Rn==null?void 0:Rn.affixWrapper,yn==null?void 0:yn.affixWrapper),le=(Ct||wr)&&ke.createElement("span",{className:_e()("".concat(je,"-suffix"),yn==null?void 0:yn.suffix),style:nt==null?void 0:nt.suffix},we(),Ct);ue=ke.createElement(rn,(0,he.Z)({className:fe,style:(0,He.Z)((0,He.Z)({},(0,Se.He)(ft)?void 0:Pt),nt==null?void 0:nt.affixWrapper),hidden:!(0,Se.He)(ft)&&Ht,onClick:nn},ot==null?void 0:ot.affixWrapper,{ref:bn}),_t&&ke.createElement("span",{className:_e()("".concat(je,"-prefix"),yn==null?void 0:yn.prefix),style:nt==null?void 0:nt.prefix},_t),(0,ke.cloneElement)(Ue,{value:Je,hidden:null}),le)}if((0,Se.He)(ft)){var Pe="".concat(je,"-group"),Qe="".concat(Pe,"-addon"),It=_e()("".concat(je,"-wrapper"),Pe,Rn==null?void 0:Rn.wrapper),Nt=_e()("".concat(je,"-group-wrapper"),Rt,Rn==null?void 0:Rn.group);return ke.createElement(dn,{className:Nt,style:Pt,hidden:Ht},ke.createElement(Ut,{className:It},Dt&&ke.createElement(Kt,{className:Qe},Dt),(0,ke.cloneElement)(ue,{hidden:null}),qe&&ke.createElement(Kt,{className:Qe},qe)))}return ue},Ee=me,tt=se(74902),Be=se(97685),St=se(45987),dt=se(21770),it=se(98423),Ge=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","classes","classNames","styles"],De=(0,ke.forwardRef)(function(rt,ft){var Ie=rt.autoComplete,xe=rt.onChange,Ue=rt.onFocus,je=rt.onBlur,_t=rt.onPressEnter,Ct=rt.onKeyDown,Dt=rt.prefixCls,qe=Dt===void 0?"rc-input":Dt,Rt=rt.disabled,Pt=rt.htmlSize,En=rt.className,tn=rt.maxLength,$n=rt.suffix,ur=rt.showCount,wr=rt.type,Je=wr===void 0?"text":wr,Ae=rt.classes,Ht=rt.classNames,Rn=rt.styles,yn=(0,St.Z)(rt,Ge),ot=(0,dt.Z)(rt.defaultValue,{value:rt.value}),nt=(0,Be.Z)(ot,2),Tt=nt[0],rn=nt[1],dn=(0,ke.useState)(!1),Ut=(0,Be.Z)(dn,2),Kt=Ut[0],bn=Ut[1],nn=(0,ke.useRef)(null),we=function(Nt){nn.current&&(0,Se.nH)(nn.current,Nt)};(0,ke.useImperativeHandle)(ft,function(){return{focus:we,blur:function(){var Nt;(Nt=nn.current)===null||Nt===void 0||Nt.blur()},setSelectionRange:function(Nt,qt,an){var jt;(jt=nn.current)===null||jt===void 0||jt.setSelectionRange(Nt,qt,an)},select:function(){var Nt;(Nt=nn.current)===null||Nt===void 0||Nt.select()},input:nn.current}}),(0,ke.useEffect)(function(){bn(function(It){return It&&Rt?!1:It})},[Rt]);var ue=function(Nt){rt.value===void 0&&rn(Nt.target.value),nn.current&&(0,Se.rJ)(nn.current,Nt,xe)},oe=function(Nt){_t&&Nt.key==="Enter"&&_t(Nt),Ct==null||Ct(Nt)},pe=function(Nt){bn(!0),Ue==null||Ue(Nt)},fe=function(Nt){bn(!1),je==null||je(Nt)},le=function(Nt){rn(""),we(),nn.current&&(0,Se.rJ)(nn.current,Nt,xe)},Pe=function(){var Nt=(0,it.Z)(rt,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","classes","htmlSize","styles","classNames"]);return ke.createElement("input",(0,he.Z)({autoComplete:Ie},Nt,{onChange:ue,onFocus:pe,onBlur:fe,onKeyDown:oe,className:_e()(qe,(0,Re.Z)({},"".concat(qe,"-disabled"),Rt),Ht==null?void 0:Ht.input),style:Rn==null?void 0:Rn.input,ref:nn,size:Pt,type:Je}))},Qe=function(){var Nt=Number(tn)>0;if($n||ur){var qt=(0,Se.D7)(Tt),an=(0,tt.Z)(qt).length,jt=(0,Ve.Z)(ur)==="object"?ur.formatter({value:qt,count:an,maxLength:tn}):"".concat(an).concat(Nt?" / ".concat(tn):"");return ke.createElement(ke.Fragment,null,!!ur&&ke.createElement("span",{className:_e()("".concat(qe,"-show-count-suffix"),(0,Re.Z)({},"".concat(qe,"-show-count-has-suffix"),!!$n),Ht==null?void 0:Ht.count),style:(0,He.Z)({},Rn==null?void 0:Rn.count)},jt),$n)}return null};return ke.createElement(Ee,(0,he.Z)({},yn,{prefixCls:qe,className:En,inputElement:Pe(),handleReset:le,value:(0,Se.D7)(Tt),focused:Kt,triggerFocus:we,suffix:Qe(),disabled:Rt,classes:Ae,classNames:Ht,styles:Rn}))}),At=De,Xt=At},87887:function(Sn,Wt,se){"use strict";se.d(Wt,{D7:function(){return ve},He:function(){return he},X3:function(){return He},nH:function(){return Ve},rJ:function(){return Re}});function he(_e){return!!(_e.addonBefore||_e.addonAfter)}function He(_e){return!!(_e.prefix||_e.suffix||_e.allowClear)}function Re(_e,ke,Se,me){if(Se){var Ee=ke;if(ke.type==="click"){var tt=_e.cloneNode(!0);Ee=Object.create(ke,{target:{value:tt},currentTarget:{value:tt}}),tt.value="",Se(Ee);return}if(me!==void 0){Ee=Object.create(ke,{target:{value:_e},currentTarget:{value:_e}}),_e.value=me,Se(Ee);return}Se(Ee)}}function Ve(_e,ke){if(_e){_e.focus(ke);var Se=ke||{},me=Se.cursor;if(me){var Ee=_e.value.length;switch(me){case"start":_e.setSelectionRange(0,0);break;case"end":_e.setSelectionRange(Ee,Ee);break;default:_e.setSelectionRange(0,Ee)}}}}function ve(_e){return typeof _e=="undefined"||_e===null?"":String(_e)}},78595:function(Sn,Wt,se){"use strict";se.d(Wt,{iz:function(){return Vr},ck:function(){return cr},BW:function(){return Wr},sN:function(){return cr},Wd:function(){return Zt},ZP:function(){return Fe},Xl:function(){return jt}});var he=se(87462),He=se(4942),Re=se(1413),Ve=se(74902),ve=se(97685),_e=se(45987),ke=se(94184),Se=se.n(ke),me=se(67294),Ee=se(48555);function tt(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Be=tt()?me.useLayoutEffect:me.useEffect,St=function(Ze,et){var lt=me.useRef(!0);Be(function(){return Ze(lt.current)},et),Be(function(){return lt.current=!1,function(){lt.current=!0}},[])},dt=function(Ze,et){St(function(lt){if(!lt)return Ze()},et)},it=St,Ge=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],De=void 0;function At(ze,Ze){var et=ze.prefixCls,lt=ze.invalidate,wt=ze.item,Qt=ze.renderItem,sn=ze.responsive,Xn=ze.responsiveDisabled,vr=ze.registerSize,Zn=ze.itemKey,xn=ze.className,gn=ze.style,An=ze.children,Bn=ze.display,fr=ze.order,Gn=ze.component,jn=Gn===void 0?"div":Gn,er=(0,_e.Z)(ze,Ge),tr=sn&&!Bn;function yr(Ft){vr(Zn,Ft)}me.useEffect(function(){return function(){yr(null)}},[]);var Oe=Qt&&wt!==De?Qt(wt):An,Ke;lt||(Ke={opacity:tr?0:1,height:tr?0:De,overflowY:tr?"hidden":De,order:sn?fr:De,pointerEvents:tr?"none":De,position:tr?"absolute":De});var Mt={};tr&&(Mt["aria-hidden"]=!0);var ct=me.createElement(jn,(0,he.Z)({className:Se()(!lt&&et,xn),style:(0,Re.Z)((0,Re.Z)({},Ke),gn)},Mt,er,{ref:Ze}),Oe);return sn&&(ct=me.createElement(Ee.Z,{onResize:function(un){var vn=un.offsetWidth;yr(vn)},disabled:Xn},ct)),ct}var Xt=me.forwardRef(At);Xt.displayName="Item";var rt=Xt;function ft(ze){var Ze=me.useRef();Ze.current=ze;var et=me.useCallback(function(){for(var lt,wt=arguments.length,Qt=new Array(wt),sn=0;sn<wt;sn++)Qt[sn]=arguments[sn];return(lt=Ze.current)===null||lt===void 0?void 0:lt.call.apply(lt,[Ze].concat(Qt))},[]);return et}var Ie=se(73935),xe=function(Ze){return+setTimeout(Ze,16)},Ue=function(Ze){return clearTimeout(Ze)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(xe=function(Ze){return window.requestAnimationFrame(Ze)},Ue=function(Ze){return window.cancelAnimationFrame(Ze)});var je=0,_t=new Map;function Ct(ze){_t.delete(ze)}var Dt=function(Ze){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;je+=1;var lt=je;function wt(Qt){if(Qt===0)Ct(lt),Ze();else{var sn=xe(function(){wt(Qt-1)});_t.set(lt,sn)}}return wt(et),lt};Dt.cancel=function(ze){var Ze=_t.get(ze);return Ct(Ze),Ue(Ze)};var qe=Dt;function Rt(ze){if(typeof MessageChannel=="undefined")qe(ze);else{var Ze=new MessageChannel;Ze.port1.onmessage=function(){return ze()},Ze.port2.postMessage(void 0)}}function Pt(){var ze=me.useRef(null),Ze=function(lt){ze.current||(ze.current=[],Rt(function(){(0,Ie.unstable_batchedUpdates)(function(){ze.current.forEach(function(wt){wt()}),ze.current=null})})),ze.current.push(lt)};return Ze}function En(ze,Ze){var et=me.useState(Ze),lt=(0,ve.Z)(et,2),wt=lt[0],Qt=lt[1],sn=ft(function(Xn){ze(function(){Qt(Xn)})});return[wt,sn]}var tn=me.createContext(null),$n=["component"],ur=["className"],wr=["className"],Je=function(Ze,et){var lt=me.useContext(tn);if(!lt){var wt=Ze.component,Qt=wt===void 0?"div":wt,sn=(0,_e.Z)(Ze,$n);return me.createElement(Qt,(0,he.Z)({},sn,{ref:et}))}var Xn=lt.className,vr=(0,_e.Z)(lt,ur),Zn=Ze.className,xn=(0,_e.Z)(Ze,wr);return me.createElement(tn.Provider,{value:null},me.createElement(rt,(0,he.Z)({ref:et,className:Se()(Xn,Zn)},vr,xn)))},Ae=me.forwardRef(Je);Ae.displayName="RawItem";var Ht=Ae,Rn=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],yn="responsive",ot="invalidate";function nt(ze){return"+ ".concat(ze.length," ...")}function Tt(ze,Ze){var et=ze.prefixCls,lt=et===void 0?"rc-overflow":et,wt=ze.data,Qt=wt===void 0?[]:wt,sn=ze.renderItem,Xn=ze.renderRawItem,vr=ze.itemKey,Zn=ze.itemWidth,xn=Zn===void 0?10:Zn,gn=ze.ssr,An=ze.style,Bn=ze.className,fr=ze.maxCount,Gn=ze.renderRest,jn=ze.renderRawRest,er=ze.suffix,tr=ze.component,yr=tr===void 0?"div":tr,Oe=ze.itemComponent,Ke=ze.onVisibleChange,Mt=(0,_e.Z)(ze,Rn),ct=gn==="full",Ft=Pt(),un=En(Ft,null),vn=(0,ve.Z)(un,2),Nn=vn[0],kn=vn[1],on=Nn||0,zn=En(Ft,new Map),Wn=(0,ve.Z)(zn,2),xr=Wn[0],Kn=Wn[1],Pr=En(Ft,0),Xr=(0,ve.Z)(Pr,2),Rr=Xr[0],Ur=Xr[1],Er=En(Ft,0),Fr=(0,ve.Z)(Er,2),Qr=Fr[0],si=Fr[1],Nr=En(Ft,0),di=(0,ve.Z)(Nr,2),Pi=di[0],na=di[1],Gi=(0,me.useState)(null),Ni=(0,ve.Z)(Gi,2),qi=Ni[0],Qi=Ni[1],wi=(0,me.useState)(null),$i=(0,ve.Z)(wi,2),qr=$i[0],fi=$i[1],Ti=me.useMemo(function(){return qr===null&&ct?Number.MAX_SAFE_INTEGER:qr||0},[qr,Nn]),Xi=(0,me.useState)(!1),Na=(0,ve.Z)(Xi,2),$a=Na[0],Aa=Na[1],ca="".concat(lt,"-item"),ea=Math.max(Rr,Qr),Ei=fr===yn,Oa=Qt.length&&Ei,ki=fr===ot,ei=Oa||typeof fr=="number"&&Qt.length>fr,zi=(0,me.useMemo)(function(){var _i=Qt;return Oa?Nn===null&&ct?_i=Qt:_i=Qt.slice(0,Math.min(Qt.length,on/xn)):typeof fr=="number"&&(_i=Qt.slice(0,fr)),_i},[Qt,xn,Nn,fr,Oa]),ua=(0,me.useMemo)(function(){return Oa?Qt.slice(Ti+1):Qt.slice(zi.length)},[Qt,zi,Oa,Ti]),Zi=(0,me.useCallback)(function(_i,Ki){var da;return typeof vr=="function"?vr(_i):(da=vr&&(_i==null?void 0:_i[vr]))!==null&&da!==void 0?da:Ki},[vr]),aa=(0,me.useCallback)(sn||function(_i){return _i},[sn]);function pi(_i,Ki,da){qr===_i&&(Ki===void 0||Ki===qi)||(fi(_i),da||(Aa(_i<Qt.length-1),Ke==null||Ke(_i)),Ki!==void 0&&Qi(Ki))}function pa(_i,Ki){kn(Ki.clientWidth)}function xa(_i,Ki){Kn(function(da){var Sa=new Map(da);return Ki===null?Sa.delete(_i):Sa.set(_i,Ki),Sa})}function fa(_i,Ki){si(Ki),Ur(Qr)}function wa(_i,Ki){na(Ki)}function Ea(_i){return xr.get(Zi(zi[_i],_i))}it(function(){if(on&&typeof ea=="number"&&zi){var _i=Pi,Ki=zi.length,da=Ki-1;if(!Ki){pi(0,null);return}for(var Sa=0;Sa<Ki;Sa+=1){var Ka=Ea(Sa);if(ct&&(Ka=Ka||0),Ka===void 0){pi(Sa-1,void 0,!0);break}if(_i+=Ka,da===0&&_i<=on||Sa===da-1&&_i+Ea(da)<=on){pi(da,null);break}else if(_i+ea>on){pi(Sa-1,_i-Ka-Pi+Qr);break}}er&&Ea(0)+Pi>on&&Qi(null)}},[on,xr,Qr,Pi,Zi,zi]);var ja=$a&&!!ua.length,ha={};qi!==null&&Oa&&(ha={position:"absolute",left:qi,top:0});var ka={prefixCls:ca,responsive:Oa,component:Oe,invalidate:ki},Ja=Xn?function(_i,Ki){var da=Zi(_i,Ki);return me.createElement(tn.Provider,{key:da,value:(0,Re.Z)((0,Re.Z)({},ka),{},{order:Ki,item:_i,itemKey:da,registerSize:xa,display:Ki<=Ti})},Xn(_i,Ki))}:function(_i,Ki){var da=Zi(_i,Ki);return me.createElement(rt,(0,he.Z)({},ka,{order:Ki,key:da,item:_i,renderItem:aa,itemKey:da,registerSize:xa,display:Ki<=Ti}))},Ga,so={order:ja?Ti:Number.MAX_SAFE_INTEGER,className:"".concat(ca,"-rest"),registerSize:fa,display:ja};if(jn)jn&&(Ga=me.createElement(tn.Provider,{value:(0,Re.Z)((0,Re.Z)({},ka),so)},jn(ua)));else{var Fa=Gn||nt;Ga=me.createElement(rt,(0,he.Z)({},ka,so),typeof Fa=="function"?Fa(ua):Fa)}var Ca=me.createElement(yr,(0,he.Z)({className:Se()(!ki&&lt,Bn),style:An,ref:Ze},Mt),zi.map(Ja),ei?Ga:null,er&&me.createElement(rt,(0,he.Z)({},ka,{responsive:Ei,responsiveDisabled:!Oa,order:Ti,className:"".concat(ca,"-suffix"),registerSize:wa,display:!0,style:ha}),er));return Ei&&(Ca=me.createElement(Ee.Z,{onResize:pa,disabled:!Oa},Ca)),Ca}var rn=me.forwardRef(Tt);rn.displayName="Overflow",rn.Item=Ht,rn.RESPONSIVE=yn,rn.INVALIDATE=ot;var dn=rn,Ut=dn,Kt=se(21770),bn=se(80334),nn=se(91881),we=me.createContext(null);function ue(ze,Ze){return ze===void 0?null:"".concat(ze,"-").concat(Ze)}function oe(ze){var Ze=me.useContext(we);return ue(Ze,ze)}var pe=se(56982),fe=["children","locked"],le=me.createContext(null);function Pe(ze,Ze){var et=(0,Re.Z)({},ze);return Object.keys(Ze).forEach(function(lt){var wt=Ze[lt];wt!==void 0&&(et[lt]=wt)}),et}function Qe(ze){var Ze=ze.children,et=ze.locked,lt=(0,_e.Z)(ze,fe),wt=me.useContext(le),Qt=(0,pe.Z)(function(){return Pe(wt,lt)},[wt,lt],function(sn,Xn){return!et&&(sn[0]!==Xn[0]||!(0,nn.Z)(sn[1],Xn[1],!0))});return me.createElement(le.Provider,{value:Qt},Ze)}var It=[],Nt=me.createContext(null);function qt(){return me.useContext(Nt)}var an=me.createContext(It);function jt(ze){var Ze=me.useContext(an);return me.useMemo(function(){return ze!==void 0?[].concat((0,Ve.Z)(Ze),[ze]):Ze},[Ze,ze])}var ir=me.createContext(null),Cr=me.createContext({}),Bt=Cr,Mn=se(15105),Vn=se(75164),br=function(ze){if(!ze)return!1;if(ze instanceof Element){if(ze.offsetParent)return!0;if(ze.getBBox){var Ze=ze.getBBox(),et=Ze.width,lt=Ze.height;if(et||lt)return!0}if(ze.getBoundingClientRect){var wt=ze.getBoundingClientRect(),Qt=wt.width,sn=wt.height;if(Qt||sn)return!0}}return!1};function at(ze){var Ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(br(ze)){var et=ze.nodeName.toLowerCase(),lt=["input","select","textarea","button"].includes(et)||ze.isContentEditable||et==="a"&&!!ze.getAttribute("href"),wt=ze.getAttribute("tabindex"),Qt=Number(wt),sn=null;return wt&&!Number.isNaN(Qt)?sn=Qt:lt&&sn===null&&(sn=0),lt&&ze.disabled&&(sn=null),sn!==null&&(sn>=0||Ze&&sn<0)}return!1}function $t(ze){var Ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,et=(0,Ve.Z)(ze.querySelectorAll("*")).filter(function(lt){return at(lt,Ze)});return at(ze,Ze)&&et.unshift(ze),et}var In=null;function Jn(){In=document.activeElement}function ar(){In=null}function Mr(){if(In)try{In.focus()}catch(ze){}}function $r(ze,Ze){if(Ze.keyCode===9){var et=$t(ze),lt=et[Ze.shiftKey?0:et.length-1],wt=lt===document.activeElement||ze===document.activeElement;if(wt){var Qt=et[Ze.shiftKey?et.length-1:0];Qt.focus(),Ze.preventDefault()}}}var Dr=Mn.Z.LEFT,Kr=Mn.Z.RIGHT,ni=Mn.Z.UP,hr=Mn.Z.DOWN,mi=Mn.Z.ENTER,Ji=Mn.Z.ESC,Ui=Mn.Z.HOME,Vi=Mn.Z.END,ui=[ni,hr,Dr,Kr];function yt(ze,Ze,et,lt){var wt,Qt,sn,Xn,vr="prev",Zn="next",xn="children",gn="parent";if(ze==="inline"&&lt===mi)return{inlineTrigger:!0};var An=(wt={},(0,He.Z)(wt,ni,vr),(0,He.Z)(wt,hr,Zn),wt),Bn=(Qt={},(0,He.Z)(Qt,Dr,et?Zn:vr),(0,He.Z)(Qt,Kr,et?vr:Zn),(0,He.Z)(Qt,hr,xn),(0,He.Z)(Qt,mi,xn),Qt),fr=(sn={},(0,He.Z)(sn,ni,vr),(0,He.Z)(sn,hr,Zn),(0,He.Z)(sn,mi,xn),(0,He.Z)(sn,Ji,gn),(0,He.Z)(sn,Dr,et?xn:gn),(0,He.Z)(sn,Kr,et?gn:xn),sn),Gn={inline:An,horizontal:Bn,vertical:fr,inlineSub:An,horizontalSub:fr,verticalSub:fr},jn=(Xn=Gn["".concat(ze).concat(Ze?"":"Sub")])===null||Xn===void 0?void 0:Xn[lt];switch(jn){case vr:return{offset:-1,sibling:!0};case Zn:return{offset:1,sibling:!0};case gn:return{offset:-1,sibling:!1};case xn:return{offset:1,sibling:!1};default:return null}}function Cn(ze){for(var Ze=ze;Ze;){if(Ze.getAttribute("data-menu-list"))return Ze;Ze=Ze.parentElement}return null}function Ln(ze,Ze){for(var et=ze||document.activeElement;et;){if(Ze.has(et))return et;et=et.parentElement}return null}function Dn(ze,Ze){var et=$t(ze,!0);return et.filter(function(lt){return Ze.has(lt)})}function sr(ze,Ze,et){var lt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!ze)return null;var wt=Dn(ze,Ze),Qt=wt.length,sn=wt.findIndex(function(Xn){return et===Xn});return lt<0?sn===-1?sn=Qt-1:sn-=1:lt>0&&(sn+=1),sn=(sn+Qt)%Qt,wt[sn]}function nr(ze,Ze,et,lt,wt,Qt,sn,Xn,vr,Zn){var xn=me.useRef(),gn=me.useRef();gn.current=Ze;var An=function(){Vn.Z.cancel(xn.current)};return me.useEffect(function(){return function(){An()}},[]),function(Bn){var fr=Bn.which;if([].concat(ui,[mi,Ji,Ui,Vi]).includes(fr)){var Gn,jn,er,tr=function(){Gn=new Set,jn=new Map,er=new Map;var Wn=Qt();return Wn.forEach(function(xr){var Kn=document.querySelector("[data-menu-id='".concat(ue(lt,xr),"']"));Kn&&(Gn.add(Kn),er.set(Kn,xr),jn.set(xr,Kn))}),Gn};tr();var yr=jn.get(Ze),Oe=Ln(yr,Gn),Ke=er.get(Oe),Mt=yt(ze,sn(Ke,!0).length===1,et,fr);if(!Mt&&fr!==Ui&&fr!==Vi)return;(ui.includes(fr)||[Ui,Vi].includes(fr))&&Bn.preventDefault();var ct=function(Wn){if(Wn){var xr=Wn,Kn=Wn.querySelector("a");Kn!=null&&Kn.getAttribute("href")&&(xr=Kn);var Pr=er.get(Wn);Xn(Pr),An(),xn.current=(0,Vn.Z)(function(){gn.current===Pr&&xr.focus()})}};if([Ui,Vi].includes(fr)||Mt.sibling||!Oe){var Ft;!Oe||ze==="inline"?Ft=wt.current:Ft=Cn(Oe);var un,vn=Dn(Ft,Gn);fr===Ui?un=vn[0]:fr===Vi?un=vn[vn.length-1]:un=sr(Ft,Gn,Oe,Mt.offset),ct(un)}else if(Mt.inlineTrigger)vr(Ke);else if(Mt.offset>0)vr(Ke,!0),An(),xn.current=(0,Vn.Z)(function(){tr();var zn=Oe.getAttribute("aria-controls"),Wn=document.getElementById(zn),xr=sr(Wn,Gn);ct(xr)},5);else if(Mt.offset<0){var Nn=sn(Ke,!0),kn=Nn[Nn.length-2],on=jn.get(kn);vr(kn,!1),ct(on)}}Zn==null||Zn(Bn)}}function gr(ze){Promise.resolve().then(ze)}var Fn="__RC_UTIL_PATH_SPLIT__",Xe=function(Ze){return Ze.join(Fn)},ut=function(Ze){return Ze.split(Fn)},Lt="rc-menu-more";function Jt(){var ze=me.useState({}),Ze=(0,ve.Z)(ze,2),et=Ze[1],lt=(0,me.useRef)(new Map),wt=(0,me.useRef)(new Map),Qt=me.useState([]),sn=(0,ve.Z)(Qt,2),Xn=sn[0],vr=sn[1],Zn=(0,me.useRef)(0),xn=(0,me.useRef)(!1),gn=function(){xn.current||et({})},An=(0,me.useCallback)(function(yr,Oe){var Ke=Xe(Oe);wt.current.set(Ke,yr),lt.current.set(yr,Ke),Zn.current+=1;var Mt=Zn.current;gr(function(){Mt===Zn.current&&gn()})},[]),Bn=(0,me.useCallback)(function(yr,Oe){var Ke=Xe(Oe);wt.current.delete(Ke),lt.current.delete(yr)},[]),fr=(0,me.useCallback)(function(yr){vr(yr)},[]),Gn=(0,me.useCallback)(function(yr,Oe){var Ke=lt.current.get(yr)||"",Mt=ut(Ke);return Oe&&Xn.includes(Mt[0])&&Mt.unshift(Lt),Mt},[Xn]),jn=(0,me.useCallback)(function(yr,Oe){return yr.some(function(Ke){var Mt=Gn(Ke,!0);return Mt.includes(Oe)})},[Gn]),er=function(){var Oe=(0,Ve.Z)(lt.current.keys());return Xn.length&&Oe.push(Lt),Oe},tr=(0,me.useCallback)(function(yr){var Oe="".concat(lt.current.get(yr)).concat(Fn),Ke=new Set;return(0,Ve.Z)(wt.current.keys()).forEach(function(Mt){Mt.startsWith(Oe)&&Ke.add(wt.current.get(Mt))}),Ke},[]);return me.useEffect(function(){return function(){xn.current=!0}},[]),{registerPath:An,unregisterPath:Bn,refreshOverflowKeys:fr,isSubPathKey:jn,getKeyPath:Gn,getKeys:er,getSubPathKeys:tr}}function We(ze){var Ze=me.useRef(ze);Ze.current=ze;var et=me.useCallback(function(){for(var lt,wt=arguments.length,Qt=new Array(wt),sn=0;sn<wt;sn++)Qt[sn]=arguments[sn];return(lt=Ze.current)===null||lt===void 0?void 0:lt.call.apply(lt,[Ze].concat(Qt))},[]);return ze?et:void 0}var mt=Math.random().toFixed(5).toString().slice(2),zt=0;function Ot(ze){var Ze=(0,Kt.Z)(ze,{value:ze}),et=(0,ve.Z)(Ze,2),lt=et[0],wt=et[1];return me.useEffect(function(){zt+=1;var Qt="".concat(mt,"-").concat(zt);wt("rc-menu-uuid-".concat(Qt))},[]),lt}var Vt=se(15671),Yt=se(43144),Hn=se(60136),_r=se(51630),Qn=se(98423),qn=se(42550);function or(ze,Ze,et,lt){var wt=me.useContext(le),Qt=wt.activeKey,sn=wt.onActive,Xn=wt.onInactive,vr={active:Qt===ze};return Ze||(vr.onMouseEnter=function(Zn){et==null||et({key:ze,domEvent:Zn}),sn(ze)},vr.onMouseLeave=function(Zn){lt==null||lt({key:ze,domEvent:Zn}),Xn(ze)}),vr}function lr(ze){var Ze=me.useContext(le),et=Ze.mode,lt=Ze.rtl,wt=Ze.inlineIndent;if(et!=="inline")return null;var Qt=ze;return lt?{paddingRight:Qt*wt}:{paddingLeft:Qt*wt}}function ht(ze){var Ze=ze.icon,et=ze.props,lt=ze.children,wt;return Ze===null||Ze===!1?null:(typeof Ze=="function"?wt=me.createElement(Ze,(0,Re.Z)({},et)):typeof Ze!="boolean"&&(wt=Ze),wt||lt||null)}var st=["item"];function bt(ze){var Ze=ze.item,et=(0,_e.Z)(ze,st);return Object.defineProperty(et,"item",{get:function(){return(0,bn.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),Ze}}),et}var ln=["title","attribute","elementRef"],Pn=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],cn=["active"],pn=function(ze){(0,Hn.Z)(et,ze);var Ze=(0,_r.Z)(et);function et(){return(0,Vt.Z)(this,et),Ze.apply(this,arguments)}return(0,Yt.Z)(et,[{key:"render",value:function(){var wt=this.props,Qt=wt.title,sn=wt.attribute,Xn=wt.elementRef,vr=(0,_e.Z)(wt,ln),Zn=(0,Qn.Z)(vr,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,bn.ZP)(!sn,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),me.createElement(Ut.Item,(0,he.Z)({},sn,{title:typeof Qt=="string"?Qt:void 0},Zn,{ref:Xn}))}}]),et}(me.Component),mn=me.forwardRef(function(ze,Ze){var et,lt=ze.style,wt=ze.className,Qt=ze.eventKey,sn=ze.warnKey,Xn=ze.disabled,vr=ze.itemIcon,Zn=ze.children,xn=ze.role,gn=ze.onMouseEnter,An=ze.onMouseLeave,Bn=ze.onClick,fr=ze.onKeyDown,Gn=ze.onFocus,jn=(0,_e.Z)(ze,Pn),er=oe(Qt),tr=me.useContext(le),yr=tr.prefixCls,Oe=tr.onItemClick,Ke=tr.disabled,Mt=tr.overflowDisabled,ct=tr.itemIcon,Ft=tr.selectedKeys,un=tr.onActive,vn=me.useContext(Bt),Nn=vn._internalRenderMenuItem,kn="".concat(yr,"-item"),on=me.useRef(),zn=me.useRef(),Wn=Ke||Xn,xr=(0,qn.x1)(Ze,zn),Kn=jt(Qt),Pr=function(Ni){return{key:Qt,keyPath:(0,Ve.Z)(Kn).reverse(),item:on.current,domEvent:Ni}},Xr=vr||ct,Rr=or(Qt,Wn,gn,An),Ur=Rr.active,Er=(0,_e.Z)(Rr,cn),Fr=Ft.includes(Qt),Qr=lr(Kn.length),si=function(Ni){if(!Wn){var qi=Pr(Ni);Bn==null||Bn(bt(qi)),Oe(qi)}},Nr=function(Ni){if(fr==null||fr(Ni),Ni.which===Mn.Z.ENTER){var qi=Pr(Ni);Bn==null||Bn(bt(qi)),Oe(qi)}},di=function(Ni){un(Qt),Gn==null||Gn(Ni)},Pi={};ze.role==="option"&&(Pi["aria-selected"]=Fr);var na=me.createElement(pn,(0,he.Z)({ref:on,elementRef:xr,role:xn===null?"none":xn||"menuitem",tabIndex:Xn?null:-1,"data-menu-id":Mt&&er?null:er},jn,Er,Pi,{component:"li","aria-disabled":Xn,style:(0,Re.Z)((0,Re.Z)({},Qr),lt),className:Se()(kn,(et={},(0,He.Z)(et,"".concat(kn,"-active"),Ur),(0,He.Z)(et,"".concat(kn,"-selected"),Fr),(0,He.Z)(et,"".concat(kn,"-disabled"),Wn),et),wt),onClick:si,onKeyDown:Nr,onFocus:di}),Zn,me.createElement(ht,{props:(0,Re.Z)((0,Re.Z)({},ze),{},{isSelected:Fr}),icon:Xr}));return Nn&&(na=Nn(na,ze,{selected:Fr})),na});function On(ze,Ze){var et=ze.eventKey,lt=qt(),wt=jt(et);return me.useEffect(function(){if(lt)return lt.registerPath(et,wt),function(){lt.unregisterPath(et,wt)}},[wt]),lt?null:me.createElement(mn,(0,he.Z)({},ze,{ref:Ze}))}var cr=me.forwardRef(On),Gt=["className","children"],Jr=function(Ze,et){var lt=Ze.className,wt=Ze.children,Qt=(0,_e.Z)(Ze,Gt),sn=me.useContext(le),Xn=sn.prefixCls,vr=sn.mode,Zn=sn.rtl;return me.createElement("ul",(0,he.Z)({className:Se()(Xn,Zn&&"".concat(Xn,"-rtl"),"".concat(Xn,"-sub"),"".concat(Xn,"-").concat(vr==="inline"?"inline":"vertical"),lt),role:"menu"},Qt,{"data-menu-list":!0,ref:et}),wt)},Zr=me.forwardRef(Jr);Zr.displayName="SubMenuList";var Bi=Zr,Li=se(50344);function gi(ze,Ze){return(0,Li.Z)(ze).map(function(et,lt){if(me.isValidElement(et)){var wt,Qt,sn=et.key,Xn=(wt=(Qt=et.props)===null||Qt===void 0?void 0:Qt.eventKey)!==null&&wt!==void 0?wt:sn,vr=Xn==null;vr&&(Xn="tmp_key-".concat([].concat((0,Ve.Z)(Ze),[lt]).join("-")));var Zn={key:Xn,eventKey:Xn};return me.cloneElement(et,Zn)}return et})}var Yi=se(62709),xi={adjustX:1,adjustY:1},oi={topLeft:{points:["bl","tl"],overflow:xi},topRight:{points:["br","tr"],overflow:xi},bottomLeft:{points:["tl","bl"],overflow:xi},bottomRight:{points:["tr","br"],overflow:xi},leftTop:{points:["tr","tl"],overflow:xi},leftBottom:{points:["br","bl"],overflow:xi},rightTop:{points:["tl","tr"],overflow:xi},rightBottom:{points:["bl","br"],overflow:xi}},Ri={topLeft:{points:["bl","tl"],overflow:xi},topRight:{points:["br","tr"],overflow:xi},bottomLeft:{points:["tl","bl"],overflow:xi},bottomRight:{points:["tr","br"],overflow:xi},rightTop:{points:["tr","tl"],overflow:xi},rightBottom:{points:["br","bl"],overflow:xi},leftTop:{points:["tl","tr"],overflow:xi},leftBottom:{points:["bl","br"],overflow:xi}},ji=null;function Yr(ze,Ze,et){if(Ze)return Ze;if(et)return et[ze]||et.other}var vi={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function Wi(ze){var Ze=ze.prefixCls,et=ze.visible,lt=ze.children,wt=ze.popup,Qt=ze.popupStyle,sn=ze.popupClassName,Xn=ze.popupOffset,vr=ze.disabled,Zn=ze.mode,xn=ze.onVisibleChange,gn=me.useContext(le),An=gn.getPopupContainer,Bn=gn.rtl,fr=gn.subMenuOpenDelay,Gn=gn.subMenuCloseDelay,jn=gn.builtinPlacements,er=gn.triggerSubMenuAction,tr=gn.forceSubMenuRender,yr=gn.rootClassName,Oe=gn.motion,Ke=gn.defaultMotions,Mt=me.useState(!1),ct=(0,ve.Z)(Mt,2),Ft=ct[0],un=ct[1],vn=Bn?(0,Re.Z)((0,Re.Z)({},Ri),jn):(0,Re.Z)((0,Re.Z)({},oi),jn),Nn=vi[Zn],kn=Yr(Zn,Oe,Ke),on=me.useRef(kn);Zn!=="inline"&&(on.current=kn);var zn=(0,Re.Z)((0,Re.Z)({},on.current),{},{leavedClassName:"".concat(Ze,"-hidden"),removeOnLeave:!1,motionAppear:!0}),Wn=me.useRef();return me.useEffect(function(){return Wn.current=(0,Vn.Z)(function(){un(et)}),function(){Vn.Z.cancel(Wn.current)}},[et]),me.createElement(Yi.Z,{prefixCls:Ze,popupClassName:Se()("".concat(Ze,"-popup"),(0,He.Z)({},"".concat(Ze,"-rtl"),Bn),sn,yr),stretch:Zn==="horizontal"?"minWidth":null,getPopupContainer:An,builtinPlacements:vn,popupPlacement:Nn,popupVisible:Ft,popup:wt,popupStyle:Qt,popupAlign:Xn&&{offset:Xn},action:vr?[]:[er],mouseEnterDelay:fr,mouseLeaveDelay:Gn,onPopupVisibleChange:xn,forceRender:tr,popupMotion:zn,fresh:!0},lt)}var la=se(62874);function ta(ze){var Ze=ze.id,et=ze.open,lt=ze.keyPath,wt=ze.children,Qt="inline",sn=me.useContext(le),Xn=sn.prefixCls,vr=sn.forceSubMenuRender,Zn=sn.motion,xn=sn.defaultMotions,gn=sn.mode,An=me.useRef(!1);An.current=gn===Qt;var Bn=me.useState(!An.current),fr=(0,ve.Z)(Bn,2),Gn=fr[0],jn=fr[1],er=An.current?et:!1;me.useEffect(function(){An.current&&jn(!1)},[gn]);var tr=(0,Re.Z)({},Yr(Qt,Zn,xn));lt.length>1&&(tr.motionAppear=!1);var yr=tr.onVisibleChanged;return tr.onVisibleChanged=function(Oe){return!An.current&&!Oe&&jn(!0),yr==null?void 0:yr(Oe)},Gn?null:me.createElement(Qe,{mode:Qt,locked:!An.current},me.createElement(la.Z,(0,he.Z)({visible:er},tr,{forceRender:vr,removeOnLeave:!1,leavedClassName:"".concat(Xn,"-hidden")}),function(Oe){var Ke=Oe.className,Mt=Oe.style;return me.createElement(Bi,{id:Ze,className:Ke,style:Mt},wt)}))}var ri=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],xt=["active"],vt=function(Ze){var et,lt=Ze.style,wt=Ze.className,Qt=Ze.title,sn=Ze.eventKey,Xn=Ze.warnKey,vr=Ze.disabled,Zn=Ze.internalPopupClose,xn=Ze.children,gn=Ze.itemIcon,An=Ze.expandIcon,Bn=Ze.popupClassName,fr=Ze.popupOffset,Gn=Ze.popupStyle,jn=Ze.onClick,er=Ze.onMouseEnter,tr=Ze.onMouseLeave,yr=Ze.onTitleClick,Oe=Ze.onTitleMouseEnter,Ke=Ze.onTitleMouseLeave,Mt=(0,_e.Z)(Ze,ri),ct=oe(sn),Ft=me.useContext(le),un=Ft.prefixCls,vn=Ft.mode,Nn=Ft.openKeys,kn=Ft.disabled,on=Ft.overflowDisabled,zn=Ft.activeKey,Wn=Ft.selectedKeys,xr=Ft.itemIcon,Kn=Ft.expandIcon,Pr=Ft.onItemClick,Xr=Ft.onOpenChange,Rr=Ft.onActive,Ur=me.useContext(Bt),Er=Ur._internalRenderSubMenuItem,Fr=me.useContext(ir),Qr=Fr.isSubPathKey,si=jt(),Nr="".concat(un,"-submenu"),di=kn||vr,Pi=me.useRef(),na=me.useRef(),Gi=gn!=null?gn:xr,Ni=An!=null?An:Kn,qi=Nn.includes(sn),Qi=!on&&qi,wi=Qr(Wn,sn),$i=or(sn,di,Oe,Ke),qr=$i.active,fi=(0,_e.Z)($i,xt),Ti=me.useState(!1),Xi=(0,ve.Z)(Ti,2),Na=Xi[0],$a=Xi[1],Aa=function(wa){di||$a(wa)},ca=function(wa){Aa(!0),er==null||er({key:sn,domEvent:wa})},ea=function(wa){Aa(!1),tr==null||tr({key:sn,domEvent:wa})},Ei=me.useMemo(function(){return qr||(vn!=="inline"?Na||Qr([zn],sn):!1)},[vn,qr,zn,Na,sn,Qr]),Oa=lr(si.length),ki=function(wa){di||(yr==null||yr({key:sn,domEvent:wa}),vn==="inline"&&Xr(sn,!qi))},ei=We(function(fa){jn==null||jn(bt(fa)),Pr(fa)}),zi=function(wa){vn!=="inline"&&Xr(sn,wa)},ua=function(){Rr(sn)},Zi=ct&&"".concat(ct,"-popup"),aa=me.createElement("div",(0,he.Z)({role:"menuitem",style:Oa,className:"".concat(Nr,"-title"),tabIndex:di?null:-1,ref:Pi,title:typeof Qt=="string"?Qt:null,"data-menu-id":on&&ct?null:ct,"aria-expanded":Qi,"aria-haspopup":!0,"aria-controls":Zi,"aria-disabled":di,onClick:ki,onFocus:ua},fi),Qt,me.createElement(ht,{icon:vn!=="horizontal"?Ni:void 0,props:(0,Re.Z)((0,Re.Z)({},Ze),{},{isOpen:Qi,isSubMenu:!0})},me.createElement("i",{className:"".concat(Nr,"-arrow")}))),pi=me.useRef(vn);if(vn!=="inline"&&si.length>1?pi.current="vertical":pi.current=vn,!on){var pa=pi.current;aa=me.createElement(Wi,{mode:pa,prefixCls:Nr,visible:!Zn&&Qi&&vn!=="inline",popupClassName:Bn,popupOffset:fr,popupStyle:Gn,popup:me.createElement(Qe,{mode:pa==="horizontal"?"vertical":pa},me.createElement(Bi,{id:Zi,ref:na},xn)),disabled:di,onVisibleChange:zi},aa)}var xa=me.createElement(Ut.Item,(0,he.Z)({role:"none"},Mt,{component:"li",style:lt,className:Se()(Nr,"".concat(Nr,"-").concat(vn),wt,(et={},(0,He.Z)(et,"".concat(Nr,"-open"),Qi),(0,He.Z)(et,"".concat(Nr,"-active"),Ei),(0,He.Z)(et,"".concat(Nr,"-selected"),wi),(0,He.Z)(et,"".concat(Nr,"-disabled"),di),et)),onMouseEnter:ca,onMouseLeave:ea}),aa,!on&&me.createElement(ta,{id:Zi,open:Qi,keyPath:si},xn));return Er&&(xa=Er(xa,Ze,{selected:wi,active:Ei,open:Qi,disabled:di})),me.createElement(Qe,{onItemClick:ei,mode:vn==="horizontal"?"vertical":vn,itemIcon:Gi,expandIcon:Ni},xa)};function Zt(ze){var Ze=ze.eventKey,et=ze.children,lt=jt(Ze),wt=gi(et,lt),Qt=qt();me.useEffect(function(){if(Qt)return Qt.registerPath(Ze,lt),function(){Qt.unregisterPath(Ze,lt)}},[lt]);var sn;return Qt?sn=wt:sn=me.createElement(vt,ze,wt),me.createElement(an.Provider,{value:lt},sn)}var fn=se(71002),Tn=["className","title","eventKey","children"],pr=["children"],Ar=function(Ze){var et=Ze.className,lt=Ze.title,wt=Ze.eventKey,Qt=Ze.children,sn=(0,_e.Z)(Ze,Tn),Xn=me.useContext(le),vr=Xn.prefixCls,Zn="".concat(vr,"-item-group");return me.createElement("li",(0,he.Z)({role:"presentation"},sn,{onClick:function(gn){return gn.stopPropagation()},className:Se()(Zn,et)}),me.createElement("div",{role:"presentation",className:"".concat(Zn,"-title"),title:typeof lt=="string"?lt:void 0},lt),me.createElement("ul",{role:"group",className:"".concat(Zn,"-list")},Qt))};function Wr(ze){var Ze=ze.children,et=(0,_e.Z)(ze,pr),lt=jt(et.eventKey),wt=gi(Ze,lt),Qt=qt();return Qt?wt:me.createElement(Ar,(0,Qn.Z)(et,["warnKey"]),wt)}function Vr(ze){var Ze=ze.className,et=ze.style,lt=me.useContext(le),wt=lt.prefixCls,Qt=qt();return Qt?null:me.createElement("li",{role:"separator",className:Se()("".concat(wt,"-item-divider"),Ze),style:et})}var Hr=["label","children","key","type"];function ti(ze){return(ze||[]).map(function(Ze,et){if(Ze&&(0,fn.Z)(Ze)==="object"){var lt=Ze,wt=lt.label,Qt=lt.children,sn=lt.key,Xn=lt.type,vr=(0,_e.Z)(lt,Hr),Zn=sn!=null?sn:"tmp-".concat(et);return Qt||Xn==="group"?Xn==="group"?me.createElement(Wr,(0,he.Z)({key:Zn},vr,{title:wt}),ti(Qt)):me.createElement(Zt,(0,he.Z)({key:Zn},vr,{title:wt}),ti(Qt)):Xn==="divider"?me.createElement(Vr,(0,he.Z)({key:Zn},vr)):me.createElement(cr,(0,he.Z)({key:Zn},vr),wt)}return null}).filter(function(Ze){return Ze})}function yi(ze,Ze,et){var lt=ze;return Ze&&(lt=ti(Ze)),gi(lt,et)}var Lr=["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"],hi=[],Ai=me.forwardRef(function(ze,Ze){var et,lt,wt=ze,Qt=wt.prefixCls,sn=Qt===void 0?"rc-menu":Qt,Xn=wt.rootClassName,vr=wt.style,Zn=wt.className,xn=wt.tabIndex,gn=xn===void 0?0:xn,An=wt.items,Bn=wt.children,fr=wt.direction,Gn=wt.id,jn=wt.mode,er=jn===void 0?"vertical":jn,tr=wt.inlineCollapsed,yr=wt.disabled,Oe=wt.disabledOverflow,Ke=wt.subMenuOpenDelay,Mt=Ke===void 0?.1:Ke,ct=wt.subMenuCloseDelay,Ft=ct===void 0?.1:ct,un=wt.forceSubMenuRender,vn=wt.defaultOpenKeys,Nn=wt.openKeys,kn=wt.activeKey,on=wt.defaultActiveFirst,zn=wt.selectable,Wn=zn===void 0?!0:zn,xr=wt.multiple,Kn=xr===void 0?!1:xr,Pr=wt.defaultSelectedKeys,Xr=wt.selectedKeys,Rr=wt.onSelect,Ur=wt.onDeselect,Er=wt.inlineIndent,Fr=Er===void 0?24:Er,Qr=wt.motion,si=wt.defaultMotions,Nr=wt.triggerSubMenuAction,di=Nr===void 0?"hover":Nr,Pi=wt.builtinPlacements,na=wt.itemIcon,Gi=wt.expandIcon,Ni=wt.overflowedIndicator,qi=Ni===void 0?"...":Ni,Qi=wt.overflowedIndicatorPopupClassName,wi=wt.getPopupContainer,$i=wt.onClick,qr=wt.onOpenChange,fi=wt.onKeyDown,Ti=wt.openAnimation,Xi=wt.openTransitionName,Na=wt._internalRenderMenuItem,$a=wt._internalRenderSubMenuItem,Aa=(0,_e.Z)(wt,Lr),ca=me.useMemo(function(){return yi(Bn,An,hi)},[Bn,An]),ea=me.useState(!1),Ei=(0,ve.Z)(ea,2),Oa=Ei[0],ki=Ei[1],ei=me.useRef(),zi=Ot(Gn),ua=fr==="rtl",Zi=(0,Kt.Z)(vn,{value:Nn,postState:function(Da){return Da||hi}}),aa=(0,ve.Z)(Zi,2),pi=aa[0],pa=aa[1],xa=function(Da){var Xa=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function go(){pa(Da),qr==null||qr(Da)}Xa?(0,Ie.flushSync)(go):go()},fa=me.useState(pi),wa=(0,ve.Z)(fa,2),Ea=wa[0],ja=wa[1],ha=me.useRef(!1),ka=me.useMemo(function(){return(er==="inline"||er==="vertical")&&tr?["vertical",tr]:[er,!1]},[er,tr]),Ja=(0,ve.Z)(ka,2),Ga=Ja[0],so=Ja[1],Fa=Ga==="inline",Ca=me.useState(Ga),_i=(0,ve.Z)(Ca,2),Ki=_i[0],da=_i[1],Sa=me.useState(so),Ka=(0,ve.Z)(Sa,2),io=Ka[0],ho=Ka[1];me.useEffect(function(){da(Ga),ho(so),ha.current&&(Fa?pa(Ea):xa(hi))},[Ga,so]);var Oo=me.useState(0),Bo=(0,ve.Z)(Oo,2),lo=Bo[0],Ao=Bo[1],ra=lo>=ca.length-1||Ki!=="horizontal"||Oe;me.useEffect(function(){Fa&&ja(pi)},[pi]),me.useEffect(function(){return ha.current=!0,function(){ha.current=!1}},[]);var Oi=Jt(),Ta=Oi.registerPath,_a=Oi.unregisterPath,co=Oi.refreshOverflowKeys,ao=Oi.isSubPathKey,hs=Oi.getKeyPath,Qo=Oi.getKeys,ps=Oi.getSubPathKeys,oa=me.useMemo(function(){return{registerPath:Ta,unregisterPath:_a}},[Ta,_a]),Or=me.useMemo(function(){return{isSubPathKey:ao}},[ao]);me.useEffect(function(){co(ra?hi:ca.slice(lo+1).map(function(oo){return oo.key}))},[lo,ra]);var Si=(0,Kt.Z)(kn||on&&((et=ca[0])===null||et===void 0?void 0:et.key),{value:kn}),Ci=(0,ve.Z)(Si,2),Di=Ci[0],Ha=Ci[1],Va=We(function(oo){Ha(oo)}),Fo=We(function(){Ha(void 0)});(0,me.useImperativeHandle)(Ze,function(){return{list:ei.current,focus:function(Da){var Xa,go=Di!=null?Di:(Xa=ca.find(function(xs){return!xs.props.disabled}))===null||Xa===void 0?void 0:Xa.key;if(go){var yo,Ko,wo;(yo=ei.current)===null||yo===void 0||(Ko=yo.querySelector("li[data-menu-id='".concat(ue(zi,go),"']")))===null||Ko===void 0||(wo=Ko.focus)===null||wo===void 0||wo.call(Ko,Da)}}}});var Zo=(0,Kt.Z)(Pr||[],{value:Xr,postState:function(Da){return Array.isArray(Da)?Da:Da==null?hi:[Da]}}),ls=(0,ve.Z)(Zo,2),va=ls[0],Ro=ls[1],cs=function(Da){if(Wn){var Xa=Da.key,go=va.includes(Xa),yo;Kn?go?yo=va.filter(function(wo){return wo!==Xa}):yo=[].concat((0,Ve.Z)(va),[Xa]):yo=[Xa],Ro(yo);var Ko=(0,Re.Z)((0,Re.Z)({},Da),{},{selectedKeys:yo});go?Ur==null||Ur(Ko):Rr==null||Rr(Ko)}!Kn&&pi.length&&Ki!=="inline"&&xa(hi)},ul=We(function(oo){$i==null||$i(bt(oo)),cs(oo)}),As=We(function(oo,Da){var Xa=pi.filter(function(yo){return yo!==oo});if(Da)Xa.push(oo);else if(Ki!=="inline"){var go=ps(oo);Xa=Xa.filter(function(yo){return!go.has(yo)})}(0,nn.Z)(pi,Xa,!0)||xa(Xa,!0)}),ms=function(Da,Xa){var go=Xa!=null?Xa:!pi.includes(Da);As(Da,go)},zo=nr(Ki,Di,ua,zi,ei,Qo,hs,Ha,ms,fi);me.useEffect(function(){ki(!0)},[]);var Ts=me.useMemo(function(){return{_internalRenderMenuItem:Na,_internalRenderSubMenuItem:$a}},[Na,$a]),Ds=Ki!=="horizontal"||Oe?ca:ca.map(function(oo,Da){return me.createElement(Qe,{key:oo.key,overflowDisabled:Da>lo},oo)}),qs=me.createElement(Ut,(0,he.Z)({id:Gn,ref:ei,prefixCls:"".concat(sn,"-overflow"),component:"ul",itemComponent:cr,className:Se()(sn,"".concat(sn,"-root"),"".concat(sn,"-").concat(Ki),Zn,(lt={},(0,He.Z)(lt,"".concat(sn,"-inline-collapsed"),io),(0,He.Z)(lt,"".concat(sn,"-rtl"),ua),lt),Xn),dir:fr,style:vr,role:"menu",tabIndex:gn,data:Ds,renderRawItem:function(Da){return Da},renderRawRest:function(Da){var Xa=Da.length,go=Xa?ca.slice(-Xa):null;return me.createElement(Zt,{eventKey:Lt,title:qi,disabled:ra,internalPopupClose:Xa===0,popupClassName:Qi},go)},maxCount:Ki!=="horizontal"||Oe?Ut.INVALIDATE:Ut.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Da){Ao(Da)},onKeyDown:zo},Aa));return me.createElement(Bt.Provider,{value:Ts},me.createElement(we.Provider,{value:zi},me.createElement(Qe,{prefixCls:sn,rootClassName:Xn,mode:Ki,openKeys:pi,rtl:ua,disabled:yr,motion:Oa?Qr:null,defaultMotions:Oa?si:null,activeKey:Di,onActive:Va,onInactive:Fo,selectedKeys:va,inlineIndent:Fr,subMenuOpenDelay:Mt,subMenuCloseDelay:Ft,forceSubMenuRender:un,builtinPlacements:Pi,triggerSubMenuAction:di,getPopupContainer:wi,itemIcon:na,expandIcon:Gi,onItemClick:ul,onOpenChange:As},me.createElement(ir.Provider,{value:Or},qs),me.createElement("div",{style:{display:"none"},"aria-hidden":!0},me.createElement(Nt.Provider,{value:oa},ca)))))}),Mi=Ai,Le=Mi;Le.Item=cr,Le.SubMenu=Zt,Le.ItemGroup=Wr,Le.Divider=Vr;var Fe=Le},66680:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return He}});var he=se(67294);function He(Re){var Ve=he.useRef();Ve.current=Re;var ve=he.useCallback(function(){for(var _e,ke=arguments.length,Se=new Array(ke),me=0;me<ke;me++)Se[me]=arguments[me];return(_e=Ve.current)===null||_e===void 0?void 0:_e.call.apply(_e,[Ve].concat(Se))},[]);return ve}},21770:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return _e}});var he=se(97685),He=se(66680),Re=se(8410),Ve=se(63896);function ve(ke){return ke!==void 0}function _e(ke,Se){var me=Se||{},Ee=me.defaultValue,tt=me.value,Be=me.onChange,St=me.postState,dt=(0,Ve.Z)(function(){return ve(tt)?tt:ve(Ee)?typeof Ee=="function"?Ee():Ee:typeof ke=="function"?ke():ke}),it=(0,he.Z)(dt,2),Ge=it[0],De=it[1],At=tt!==void 0?tt:Ge,Xt=St?St(At):At,rt=(0,He.Z)(Be),ft=(0,Ve.Z)([At]),Ie=(0,he.Z)(ft,2),xe=Ie[0],Ue=Ie[1];(0,Re.o)(function(){var _t=xe[0];Ge!==_t&&rt(Ge,_t)},[xe]),(0,Re.o)(function(){ve(tt)||De(tt)},[tt]);var je=(0,He.Z)(function(_t,Ct){De(_t,Ct),Ue([At],Ct)});return[Xt,je]}},91881:function(Sn,Wt,se){"use strict";var he=se(71002),He=se(80334);function Re(Ve,ve){var _e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,ke=new Set;function Se(me,Ee){var tt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,Be=ke.has(me);if((0,He.ZP)(!Be,"Warning: There may be circular references"),Be)return!1;if(me===Ee)return!0;if(_e&&tt>1)return!1;ke.add(me);var St=tt+1;if(Array.isArray(me)){if(!Array.isArray(Ee)||me.length!==Ee.length)return!1;for(var dt=0;dt<me.length;dt++)if(!Se(me[dt],Ee[dt],St))return!1;return!0}if(me&&Ee&&(0,he.Z)(me)==="object"&&(0,he.Z)(Ee)==="object"){var it=Object.keys(me);return it.length!==Object.keys(Ee).length?!1:it.every(function(Ge){return Se(me[Ge],Ee[Ge],St)})}return!1}return Se(Ve,ve)}Wt.Z=Re},98423:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return He}});var he=se(1413);function He(Re,Ve){var ve=(0,he.Z)({},Re);return Array.isArray(Ve)&&Ve.forEach(function(_e){delete ve[_e]}),ve}},64217:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return Se}});var he=se(1413),He=`accept acceptCharset accessKey action allowFullScreen allowTransparency
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
charSet checked classID className colSpan cols content contentEditable contextMenu
controls coords crossOrigin data dateTime default defer dir disabled download draggable
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
mediaGroup method min minLength multiple muted name noValidate nonce open
optimum pattern placeholder poster preload radioGroup readOnly rel required
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
summary tabIndex target title type useMap value width wmode wrap`,Re=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,Ve="".concat(He," ").concat(Re).split(/[\s\n]+/),ve="aria-",_e="data-";function ke(me,Ee){return me.indexOf(Ee)===0}function Se(me){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,tt;Ee===!1?tt={aria:!0,data:!0,attr:!0}:Ee===!0?tt={aria:!0}:tt=(0,he.Z)({},Ee);var Be={};return Object.keys(me).forEach(function(St){(tt.aria&&(St==="role"||ke(St,ve))||tt.data&&ke(St,_e)||tt.attr&&Ve.includes(St))&&(Be[St]=me[St])}),Be}},73299:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return ui}});var he=se(87462),He=se(1413),Re=se(71002),Ve=se(97685),ve=se(4942),_e=se(45987),ke=se(67294),Se=se(73935),me=se(94184),Ee=se.n(me),tt=se(48555),Be=ke.forwardRef(function(yt,Cn){var Ln=yt.height,Dn=yt.offsetY,sr=yt.offsetX,nr=yt.children,gr=yt.prefixCls,Fn=yt.onInnerResize,Xe=yt.innerProps,ut=yt.rtl,Lt=yt.extra,Jt={},We={display:"flex",flexDirection:"column"};if(Dn!==void 0){var mt;Jt={height:Ln,position:"relative",overflow:"hidden"},We=(0,He.Z)((0,He.Z)({},We),{},(mt={transform:"translateY(".concat(Dn,"px)")},(0,ve.Z)(mt,ut?"marginRight":"marginLeft",-sr),(0,ve.Z)(mt,"position","absolute"),(0,ve.Z)(mt,"left",0),(0,ve.Z)(mt,"right",0),(0,ve.Z)(mt,"top",0),mt))}return ke.createElement("div",{style:Jt},ke.createElement(tt.Z,{onResize:function(Ot){var Vt=Ot.offsetHeight;Vt&&Fn&&Fn()}},ke.createElement("div",(0,he.Z)({style:We,className:Ee()((0,ve.Z)({},"".concat(gr,"-holder-inner"),gr)),ref:Cn},Xe),nr,Lt)))});Be.displayName="Filler";var St=Be,dt=function(Cn){return+setTimeout(Cn,16)},it=function(Cn){return clearTimeout(Cn)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(dt=function(Cn){return window.requestAnimationFrame(Cn)},it=function(Cn){return window.cancelAnimationFrame(Cn)});var Ge=0,De=new Map;function At(yt){De.delete(yt)}var Xt=function(Cn){var Ln=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Ge+=1;var Dn=Ge;function sr(nr){if(nr===0)At(Dn),Cn();else{var gr=dt(function(){sr(nr-1)});De.set(Dn,gr)}}return sr(Ln),Dn};Xt.cancel=function(yt){var Cn=De.get(yt);return At(Cn),it(Cn)};var rt=Xt;function ft(yt,Cn){var Ln="touches"in yt?yt.touches[0]:yt;return Ln[Cn?"pageX":"pageY"]}var Ie=ke.forwardRef(function(yt,Cn){var Ln,Dn=yt.prefixCls,sr=yt.rtl,nr=yt.scrollOffset,gr=yt.scrollRange,Fn=yt.onStartMove,Xe=yt.onStopMove,ut=yt.onScroll,Lt=yt.horizontal,Jt=yt.spinSize,We=yt.containerSize,mt=yt.style,zt=yt.thumbStyle,Ot=ke.useState(!1),Vt=(0,Ve.Z)(Ot,2),Yt=Vt[0],Hn=Vt[1],_r=ke.useState(null),Qn=(0,Ve.Z)(_r,2),qn=Qn[0],or=Qn[1],lr=ke.useState(null),ht=(0,Ve.Z)(lr,2),st=ht[0],bt=ht[1],ln=!sr,Pn=ke.useRef(),cn=ke.useRef(),pn=ke.useState(!1),mn=(0,Ve.Z)(pn,2),On=mn[0],cr=mn[1],Gt=ke.useRef(),Jr=function(){clearTimeout(Gt.current),cr(!0),Gt.current=setTimeout(function(){cr(!1)},3e3)},Zr=gr-We||0,Bi=We-Jt||0,Li=Zr>0,gi=ke.useMemo(function(){if(nr===0||Zr===0)return 0;var la=nr/Zr;return la*Bi},[nr,Zr,Bi]),Yi=function(ta){ta.stopPropagation(),ta.preventDefault()},xi=ke.useRef({top:gi,dragging:Yt,pageY:qn,startTop:st});xi.current={top:gi,dragging:Yt,pageY:qn,startTop:st};var oi=function(ta){Hn(!0),or(ft(ta,Lt)),bt(xi.current.top),Fn(),ta.stopPropagation(),ta.preventDefault()};ke.useEffect(function(){var la=function(vt){vt.preventDefault()},ta=Pn.current,ri=cn.current;return ta.addEventListener("touchstart",la),ri.addEventListener("touchstart",oi),function(){ta.removeEventListener("touchstart",la),ri.removeEventListener("touchstart",oi)}},[]);var Ri=ke.useRef();Ri.current=Zr;var ji=ke.useRef();ji.current=Bi,ke.useEffect(function(){if(Yt){var la,ta=function(vt){var Zt=xi.current,fn=Zt.dragging,Tn=Zt.pageY,pr=Zt.startTop;if(rt.cancel(la),fn){var Ar=ft(vt,Lt)-Tn,Wr=pr;!ln&&Lt?Wr-=Ar:Wr+=Ar;var Vr=Ri.current,Hr=ji.current,ti=Hr?Wr/Hr:0,yi=Math.ceil(ti*Vr);yi=Math.max(yi,0),yi=Math.min(yi,Vr),la=rt(function(){ut(yi,Lt)})}},ri=function(){Hn(!1),Xe()};return window.addEventListener("mousemove",ta),window.addEventListener("touchmove",ta),window.addEventListener("mouseup",ri),window.addEventListener("touchend",ri),function(){window.removeEventListener("mousemove",ta),window.removeEventListener("touchmove",ta),window.removeEventListener("mouseup",ri),window.removeEventListener("touchend",ri),rt.cancel(la)}}},[Yt]),ke.useEffect(function(){Jr()},[nr]),ke.useImperativeHandle(Cn,function(){return{delayHidden:Jr}});var Yr="".concat(Dn,"-scrollbar"),vi={position:"absolute",visibility:On&&Li?null:"hidden"},Wi={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return Lt?(vi.height=8,vi.left=0,vi.right=0,vi.bottom=0,Wi.height="100%",Wi.width=Jt,ln?Wi.left=gi:Wi.right=gi):(vi.width=8,vi.top=0,vi.bottom=0,ln?vi.right=0:vi.left=0,Wi.width="100%",Wi.height=Jt,Wi.top=gi),ke.createElement("div",{ref:Pn,className:Ee()(Yr,(Ln={},(0,ve.Z)(Ln,"".concat(Yr,"-horizontal"),Lt),(0,ve.Z)(Ln,"".concat(Yr,"-vertical"),!Lt),(0,ve.Z)(Ln,"".concat(Yr,"-visible"),On),Ln)),style:(0,He.Z)((0,He.Z)({},vi),mt),onMouseDown:Yi,onMouseMove:Jr},ke.createElement("div",{ref:cn,className:Ee()("".concat(Yr,"-thumb"),(0,ve.Z)({},"".concat(Yr,"-thumb-moving"),Yt)),style:(0,He.Z)((0,He.Z)({},Wi),zt),onMouseDown:oi}))}),xe=Ie;function Ue(yt){var Cn=yt.children,Ln=yt.setRef,Dn=ke.useCallback(function(sr){Ln(sr)},[]);return ke.cloneElement(Cn,{ref:Dn})}function je(yt,Cn,Ln,Dn,sr,nr,gr){var Fn=gr.getKey;return yt.slice(Cn,Ln+1).map(function(Xe,ut){var Lt=Cn+ut,Jt=nr(Xe,Lt,{style:{width:Dn}}),We=Fn(Xe);return ke.createElement(Ue,{key:We,setRef:function(zt){return sr(Xe,zt)}},Jt)})}function _t(yt){return yt instanceof HTMLElement||yt instanceof SVGElement}function Ct(yt){return _t(yt)?yt:yt instanceof ke.Component?Se.findDOMNode(yt):null}var Dt=se(15671),qe=se(43144),Rt=function(){function yt(){(0,Dt.Z)(this,yt),this.maps=void 0,this.id=0,this.maps=Object.create(null)}return(0,qe.Z)(yt,[{key:"set",value:function(Ln,Dn){this.maps[Ln]=Dn,this.id+=1}},{key:"get",value:function(Ln){return this.maps[Ln]}}]),yt}(),Pt=Rt;function En(yt,Cn,Ln){var Dn=ke.useState(0),sr=(0,Ve.Z)(Dn,2),nr=sr[0],gr=sr[1],Fn=(0,ke.useRef)(new Map),Xe=(0,ke.useRef)(new Pt),ut=(0,ke.useRef)();function Lt(){rt.cancel(ut.current)}function Jt(){var mt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Lt();var zt=function(){Fn.current.forEach(function(Vt,Yt){if(Vt&&Vt.offsetParent){var Hn=Ct(Vt),_r=Hn.offsetHeight;Xe.current.get(Yt)!==_r&&Xe.current.set(Yt,Hn.offsetHeight)}}),gr(function(Vt){return Vt+1})};mt?zt():ut.current=rt(zt)}function We(mt,zt){var Ot=yt(mt),Vt=Fn.current.get(Ot);zt?(Fn.current.set(Ot,zt),Jt()):Fn.current.delete(Ot),!Vt!=!zt&&(zt?Cn==null||Cn(mt):Ln==null||Ln(mt))}return(0,ke.useEffect)(function(){return Lt},[]),[We,Jt,Xe.current,nr]}function tn(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var $n=tn()?ke.useLayoutEffect:ke.useEffect,ur=function(Cn,Ln){var Dn=ke.useRef(!0);$n(function(){return Cn(Dn.current)},Ln),$n(function(){return Dn.current=!1,function(){Dn.current=!0}},[])},wr=function(Cn,Ln){ur(function(Dn){if(!Dn)return Cn()},Ln)},Je=ur;function Ae(yt){var Cn=ke.useRef();Cn.current=yt;var Ln=ke.useCallback(function(){for(var Dn,sr=arguments.length,nr=new Array(sr),gr=0;gr<sr;gr++)nr[gr]=arguments[gr];return(Dn=Cn.current)===null||Dn===void 0?void 0:Dn.call.apply(Dn,[Cn].concat(nr))},[]);return Ln}function Ht(yt){var Cn=React.useRef(!1),Ln=React.useState(yt),Dn=_slicedToArray(Ln,2),sr=Dn[0],nr=Dn[1];React.useEffect(function(){return Cn.current=!1,function(){Cn.current=!0}},[]);function gr(Fn,Xe){Xe&&Cn.current||nr(Fn)}return[sr,gr]}function Rn(yt){return yt!==void 0}function yn(yt,Cn){var Ln=Cn||{},Dn=Ln.defaultValue,sr=Ln.value,nr=Ln.onChange,gr=Ln.postState,Fn=useState(function(){return Rn(sr)?sr:Rn(Dn)?typeof Dn=="function"?Dn():Dn:typeof yt=="function"?yt():yt}),Xe=_slicedToArray(Fn,2),ut=Xe[0],Lt=Xe[1],Jt=sr!==void 0?sr:ut,We=gr?gr(Jt):Jt,mt=useEvent(nr),zt=useState([Jt]),Ot=_slicedToArray(zt,2),Vt=Ot[0],Yt=Ot[1];useLayoutUpdateEffect(function(){var _r=Vt[0];ut!==_r&&mt(ut,_r)},[Vt]),useLayoutUpdateEffect(function(){Rn(sr)||Lt(sr)},[sr]);var Hn=useEvent(function(_r,Qn){Lt(_r,Qn),Yt([Jt],Qn)});return[We,Hn]}var ot=se(31461);function nt(yt,Cn,Ln){var Dn=React.useRef({});return(!("value"in Dn.current)||Ln(Dn.current.condition,Cn))&&(Dn.current.value=yt(),Dn.current.condition=Cn),Dn.current.value}function Tt(yt,Cn){typeof yt=="function"?yt(Cn):_typeof(yt)==="object"&&yt&&"current"in yt&&(yt.current=Cn)}function rn(){for(var yt=arguments.length,Cn=new Array(yt),Ln=0;Ln<yt;Ln++)Cn[Ln]=arguments[Ln];var Dn=Cn.filter(function(sr){return sr});return Dn.length<=1?Dn[0]:function(sr){Cn.forEach(function(nr){Tt(nr,sr)})}}function dn(){for(var yt=arguments.length,Cn=new Array(yt),Ln=0;Ln<yt;Ln++)Cn[Ln]=arguments[Ln];return useMemo(function(){return rn.apply(void 0,Cn)},Cn,function(Dn,sr){return Dn.length!==sr.length||Dn.every(function(nr,gr){return nr!==sr[gr]})})}function Ut(yt){var Cn,Ln,Dn=isMemo(yt)?yt.type.type:yt.type;return!(typeof Dn=="function"&&!((Cn=Dn.prototype)!==null&&Cn!==void 0&&Cn.render)||typeof yt=="function"&&!((Ln=yt.prototype)!==null&&Ln!==void 0&&Ln.render))}function Kt(yt){return!isValidElement(yt)||isFragment(yt)?!1:Ut(yt)}function bn(yt,Cn,Ln,Dn){if(!Cn.length)return Ln;var sr=_toArray(Cn),nr=sr[0],gr=sr.slice(1),Fn;return!yt&&typeof nr=="number"?Fn=[]:Array.isArray(yt)?Fn=_toConsumableArray(yt):Fn=_objectSpread({},yt),Dn&&Ln===void 0&&gr.length===1?delete Fn[nr][gr[0]]:Fn[nr]=bn(Fn[nr],gr,Ln,Dn),Fn}function nn(yt,Cn,Ln){var Dn=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return Cn.length&&Dn&&Ln===void 0&&!get(yt,Cn.slice(0,-1))?yt:bn(yt,Cn,Ln,Dn)}function we(yt){return _typeof(yt)==="object"&&yt!==null&&Object.getPrototypeOf(yt)===Object.prototype}function ue(yt){return Array.isArray(yt)?[]:{}}var oe=typeof Reflect=="undefined"?Object.keys:Reflect.ownKeys;function pe(){for(var yt=arguments.length,Cn=new Array(yt),Ln=0;Ln<yt;Ln++)Cn[Ln]=arguments[Ln];var Dn=ue(Cn[0]);return Cn.forEach(function(sr){function nr(gr,Fn){var Xe=new Set(Fn),ut=get(sr,gr),Lt=Array.isArray(ut);if(Lt||we(ut)){if(!Xe.has(ut)){Xe.add(ut);var Jt=get(Dn,gr);Lt?Dn=nn(Dn,gr,[]):(!Jt||_typeof(Jt)!=="object")&&(Dn=nn(Dn,gr,ue(ut))),oe(ut).forEach(function(We){nr([].concat(_toConsumableArray(gr),[We]),Xe)})}}else Dn=nn(Dn,gr,ut)}nr([])}),Dn}var fe={},le=[],Pe=function(Cn){le.push(Cn)};function Qe(yt,Cn){if(0)var Ln}function It(yt,Cn){if(0)var Ln}function Nt(){fe={}}function qt(yt,Cn,Ln){!Cn&&!fe[Ln]&&(yt(!1,Ln),fe[Ln]=!0)}function an(yt,Cn){qt(Qe,yt,Cn)}function jt(yt,Cn){qt(It,yt,Cn)}an.preMessage=Pe,an.resetWarned=Nt,an.noteOnce=jt;var ir=null,Cr=10;function Bt(yt,Cn,Ln,Dn,sr,nr,gr,Fn){var Xe=ke.useRef(),ut=ke.useState(null),Lt=(0,Ve.Z)(ut,2),Jt=Lt[0],We=Lt[1];return Je(function(){if(Jt&&Jt.times<Cr){if(!yt.current){We(function(Jr){return(0,He.Z)({},Jr)});return}nr();var mt=Jt.targetAlign,zt=Jt.originAlign,Ot=Jt.index,Vt=Jt.offset,Yt=yt.current.clientHeight,Hn=!1,_r=mt,Qn=null;if(Yt){for(var qn=mt||zt,or=0,lr=0,ht=0,st=Math.min(Cn.length-1,Ot),bt=0;bt<=st;bt+=1){var ln=sr(Cn[bt]);lr=or;var Pn=Ln.get(ln);ht=lr+(Pn===void 0?Dn:Pn),or=ht}for(var cn=qn==="top"?Vt:Yt-Vt,pn=st;pn>=0;pn-=1){var mn=sr(Cn[pn]),On=Ln.get(mn);if(On===void 0){Hn=!0;break}if(cn-=On,cn<=0)break}switch(qn){case"top":Qn=lr-Vt;break;case"bottom":Qn=ht-Yt+Vt;break;default:{var cr=yt.current.scrollTop,Gt=cr+Yt;lr<cr?_r="top":ht>Gt&&(_r="bottom")}}Qn!==null&&gr(Qn),Qn!==Jt.lastTop&&(Hn=!0)}Hn&&We(function(Jr){return(0,He.Z)((0,He.Z)({},Jr),{},{times:Jr.times+1,targetAlign:_r,lastTop:Qn})})}},[Jt,yt.current]),function(mt){if(mt==null){Fn();return}if(rt.cancel(Xe.current),typeof mt=="number")gr(mt);else if(mt&&(0,Re.Z)(mt)==="object"){var zt,Ot=mt.align;"index"in mt?zt=mt.index:zt=Cn.findIndex(function(Hn){return sr(Hn)===mt.key});var Vt=mt.offset,Yt=Vt===void 0?0:Vt;We({times:0,index:zt,offset:Yt,originAlign:Ot})}}}function Mn(yt,Cn,Ln,Dn){var sr=Ln-yt,nr=Cn-Ln,gr=Math.min(sr,nr)*2;if(Dn<=gr){var Fn=Math.floor(Dn/2);return Dn%2?Ln+Fn+1:Ln-Fn}return sr>nr?Ln-(Dn-nr):Ln+(Dn-sr)}function Vn(yt,Cn,Ln){var Dn=yt.length,sr=Cn.length,nr,gr;if(Dn===0&&sr===0)return null;Dn<sr?(nr=yt,gr=Cn):(nr=Cn,gr=yt);var Fn={__EMPTY_ITEM__:!0};function Xe(zt){return zt!==void 0?Ln(zt):Fn}for(var ut=null,Lt=Math.abs(Dn-sr)!==1,Jt=0;Jt<gr.length;Jt+=1){var We=Xe(nr[Jt]),mt=Xe(gr[Jt]);if(We!==mt){ut=Jt,Lt=Lt||We!==Xe(gr[Jt+1]);break}}return ut===null?null:{index:ut,multiple:Lt}}function br(yt,Cn,Ln){var Dn=ke.useState(yt),sr=(0,Ve.Z)(Dn,2),nr=sr[0],gr=sr[1],Fn=ke.useState(null),Xe=(0,Ve.Z)(Fn,2),ut=Xe[0],Lt=Xe[1];return ke.useEffect(function(){var Jt=Vn(nr||[],yt||[],Cn);(Jt==null?void 0:Jt.index)!==void 0&&(Ln==null||Ln(Jt.index),Lt(yt[Jt.index])),gr(yt)},[yt]),[ut]}var at=(typeof navigator=="undefined"?"undefined":(0,Re.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),$t=at,In=function(yt,Cn){var Ln=(0,ke.useRef)(!1),Dn=(0,ke.useRef)(null);function sr(){clearTimeout(Dn.current),Ln.current=!0,Dn.current=setTimeout(function(){Ln.current=!1},50)}var nr=(0,ke.useRef)({top:yt,bottom:Cn});return nr.current.top=yt,nr.current.bottom=Cn,function(gr){var Fn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Xe=gr<0&&nr.current.top||gr>0&&nr.current.bottom;return Fn&&Xe?(clearTimeout(Dn.current),Ln.current=!1):(!Xe||Ln.current)&&sr(),!Ln.current&&Xe}};function Jn(yt,Cn,Ln,Dn,sr){var nr=(0,ke.useRef)(0),gr=(0,ke.useRef)(null),Fn=(0,ke.useRef)(null),Xe=(0,ke.useRef)(!1),ut=In(Cn,Ln);function Lt(Vt,Yt){rt.cancel(gr.current),nr.current+=Yt,Fn.current=Yt,!ut(Yt)&&($t||Vt.preventDefault(),gr.current=rt(function(){var Hn=Xe.current?10:1;sr(nr.current*Hn),nr.current=0}))}function Jt(Vt,Yt){sr(Yt,!0),$t||Vt.preventDefault()}var We=(0,ke.useRef)(null),mt=(0,ke.useRef)(null);function zt(Vt){if(yt){rt.cancel(mt.current),mt.current=rt(function(){We.current=null},2);var Yt=Vt.deltaX,Hn=Vt.deltaY,_r=Vt.shiftKey,Qn=Yt,qn=Hn;(We.current==="sx"||!We.current&&_r&&Hn&&!Yt)&&(Qn=Hn,qn=0,We.current="sx");var or=Math.abs(Qn),lr=Math.abs(qn);We.current===null&&(We.current=Dn&&or>lr?"x":"y"),We.current==="y"?Lt(Vt,qn):Jt(Vt,Qn)}}function Ot(Vt){yt&&(Xe.current=Vt.detail===Fn.current)}return[zt,Ot]}var ar=14/15;function Mr(yt,Cn,Ln){var Dn=(0,ke.useRef)(!1),sr=(0,ke.useRef)(0),nr=(0,ke.useRef)(null),gr=(0,ke.useRef)(null),Fn,Xe=function(We){if(Dn.current){var mt=Math.ceil(We.touches[0].pageY),zt=sr.current-mt;sr.current=mt,Ln(zt)&&We.preventDefault(),clearInterval(gr.current),gr.current=setInterval(function(){zt*=ar,(!Ln(zt,!0)||Math.abs(zt)<=.1)&&clearInterval(gr.current)},16)}},ut=function(){Dn.current=!1,Fn()},Lt=function(We){Fn(),We.touches.length===1&&!Dn.current&&(Dn.current=!0,sr.current=Math.ceil(We.touches[0].pageY),nr.current=We.target,nr.current.addEventListener("touchmove",Xe),nr.current.addEventListener("touchend",ut))};Fn=function(){nr.current&&(nr.current.removeEventListener("touchmove",Xe),nr.current.removeEventListener("touchend",ut))},Je(function(){return yt&&Cn.current.addEventListener("touchstart",Lt),function(){var Jt;(Jt=Cn.current)===null||Jt===void 0||Jt.removeEventListener("touchstart",Lt),Fn(),clearInterval(gr.current)}},[yt])}var $r=20;function Dr(){var yt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Cn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Ln=yt/Cn*100;return isNaN(Ln)&&(Ln=0),Ln=Math.max(Ln,$r),Ln=Math.min(Ln,yt/2),Math.floor(Ln)}function Kr(yt,Cn,Ln,Dn){var sr=ke.useMemo(function(){return[new Map,[]]},[yt,Ln.id,Dn]),nr=(0,Ve.Z)(sr,2),gr=nr[0],Fn=nr[1],Xe=function(Lt){var Jt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Lt,We=gr.get(Lt),mt=gr.get(Jt);if(We===void 0||mt===void 0)for(var zt=yt.length,Ot=Fn.length;Ot<zt;Ot+=1){var Vt,Yt=yt[Ot],Hn=Cn(Yt);gr.set(Hn,Ot);var _r=(Vt=Ln.get(Hn))!==null&&Vt!==void 0?Vt:Dn;if(Fn[Ot]=(Fn[Ot-1]||0)+_r,Hn===Lt&&(We=Ot),Hn===Jt&&(mt=Ot),We!==void 0&&mt!==void 0)break}return{top:Fn[We-1]||0,bottom:Fn[mt]}};return Xe}var ni=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles"],hr=[],mi={overflowY:"auto",overflowAnchor:"none"};function Ji(yt,Cn){var Ln=yt.prefixCls,Dn=Ln===void 0?"rc-virtual-list":Ln,sr=yt.className,nr=yt.height,gr=yt.itemHeight,Fn=yt.fullHeight,Xe=Fn===void 0?!0:Fn,ut=yt.style,Lt=yt.data,Jt=yt.children,We=yt.itemKey,mt=yt.virtual,zt=yt.direction,Ot=yt.scrollWidth,Vt=yt.component,Yt=Vt===void 0?"div":Vt,Hn=yt.onScroll,_r=yt.onVirtualScroll,Qn=yt.onVisibleChange,qn=yt.innerProps,or=yt.extraRender,lr=yt.styles,ht=(0,_e.Z)(yt,ni),st=!!(mt!==!1&&nr&&gr),bt=st&&Lt&&(gr*Lt.length>nr||!!Ot),ln=zt==="rtl",Pn=Ee()(Dn,(0,ve.Z)({},"".concat(Dn,"-rtl"),ln),sr),cn=Lt||hr,pn=(0,ke.useRef)(),mn=(0,ke.useRef)(),On=(0,ke.useState)(0),cr=(0,Ve.Z)(On,2),Gt=cr[0],Jr=cr[1],Zr=(0,ke.useState)(0),Bi=(0,Ve.Z)(Zr,2),Li=Bi[0],gi=Bi[1],Yi=(0,ke.useState)(!1),xi=(0,Ve.Z)(Yi,2),oi=xi[0],Ri=xi[1],ji=function(){Ri(!0)},Yr=function(){Ri(!1)},vi=ke.useCallback(function(on){return typeof We=="function"?We(on):on==null?void 0:on[We]},[We]),Wi={getKey:vi};function la(on){Jr(function(zn){var Wn;typeof on=="function"?Wn=on(zn):Wn=on;var xr=Xn(Wn);return pn.current.scrollTop=xr,xr})}var ta=(0,ke.useRef)({start:0,end:cn.length}),ri=(0,ke.useRef)(),xt=br(cn,vi),vt=(0,Ve.Z)(xt,1),Zt=vt[0];ri.current=Zt;var fn=En(vi,null,null),Tn=(0,Ve.Z)(fn,4),pr=Tn[0],Ar=Tn[1],Wr=Tn[2],Vr=Tn[3],Hr=ke.useMemo(function(){if(!st)return{scrollHeight:void 0,start:0,end:cn.length-1,offset:void 0};if(!bt){var on;return{scrollHeight:((on=mn.current)===null||on===void 0?void 0:on.offsetHeight)||0,start:0,end:cn.length-1,offset:void 0}}for(var zn=0,Wn,xr,Kn,Pr=cn.length,Xr=0;Xr<Pr;Xr+=1){var Rr=cn[Xr],Ur=vi(Rr),Er=Wr.get(Ur),Fr=zn+(Er===void 0?gr:Er);Fr>=Gt&&Wn===void 0&&(Wn=Xr,xr=zn),Fr>Gt+nr&&Kn===void 0&&(Kn=Xr),zn=Fr}return Wn===void 0&&(Wn=0,xr=0,Kn=Math.ceil(nr/gr)),Kn===void 0&&(Kn=cn.length-1),Kn=Math.min(Kn+1,cn.length-1),{scrollHeight:zn,start:Wn,end:Kn,offset:xr}},[bt,st,Gt,cn,Vr,nr]),ti=Hr.scrollHeight,yi=Hr.start,Lr=Hr.end,hi=Hr.offset;ta.current.start=yi,ta.current.end=Lr;var Ai=ke.useState({width:0,height:nr}),Mi=(0,Ve.Z)(Ai,2),Le=Mi[0],Fe=Mi[1],ze=function(zn){Fe({width:zn.width||zn.offsetWidth,height:zn.height||zn.offsetHeight})},Ze=(0,ke.useRef)(),et=(0,ke.useRef)(),lt=ke.useMemo(function(){return Dr(Le.width,Ot)},[Le.width,Ot]),wt=ke.useMemo(function(){return Dr(Le.height,ti)},[Le.height,ti]),Qt=ti-nr,sn=(0,ke.useRef)(Qt);sn.current=Qt;function Xn(on){var zn=on;return Number.isNaN(sn.current)||(zn=Math.min(zn,sn.current)),zn=Math.max(zn,0),zn}var vr=Gt<=0,Zn=Gt>=Qt,xn=In(vr,Zn),gn=function(){return{x:ln?-Li:Li,y:Gt}},An=(0,ke.useRef)(gn()),Bn=Ae(function(){if(_r){var on=gn();(An.current.x!==on.x||An.current.y!==on.y)&&(_r(on),An.current=on)}});function fr(on,zn){var Wn=on;zn?((0,Se.flushSync)(function(){gi(Wn)}),Bn()):la(Wn)}function Gn(on){var zn=on.currentTarget.scrollTop;zn!==Gt&&la(zn),Hn==null||Hn(on),Bn()}var jn=function(zn){var Wn=zn,xr=Ot-Le.width;return Wn=Math.max(Wn,0),Wn=Math.min(Wn,xr),Wn},er=Ae(function(on,zn){zn?((0,Se.flushSync)(function(){gi(function(Wn){var xr=Wn+(ln?-on:on);return jn(xr)})}),Bn()):la(function(Wn){var xr=Wn+on;return xr})}),tr=Jn(st,vr,Zn,!!Ot,er),yr=(0,Ve.Z)(tr,2),Oe=yr[0],Ke=yr[1];Mr(st,pn,function(on,zn){return xn(on,zn)?!1:(Oe({preventDefault:function(){},deltaY:on}),!0)}),Je(function(){function on(Wn){st&&Wn.preventDefault()}var zn=pn.current;return zn.addEventListener("wheel",Oe),zn.addEventListener("DOMMouseScroll",Ke),zn.addEventListener("MozMousePixelScroll",on),function(){zn.removeEventListener("wheel",Oe),zn.removeEventListener("DOMMouseScroll",Ke),zn.removeEventListener("MozMousePixelScroll",on)}},[st]),Je(function(){Ot&&gi(function(on){return jn(on)})},[Le.width,Ot]);var Mt=function(){var zn,Wn;(zn=Ze.current)===null||zn===void 0||zn.delayHidden(),(Wn=et.current)===null||Wn===void 0||Wn.delayHidden()},ct=Bt(pn,cn,Wr,gr,vi,function(){return Ar(!0)},la,Mt);ke.useImperativeHandle(Cn,function(){return{getScrollInfo:gn,scrollTo:function(zn){function Wn(xr){return xr&&(0,Re.Z)(xr)==="object"&&("left"in xr||"top"in xr)}Wn(zn)?(zn.left!==void 0&&gi(jn(zn.left)),ct(zn.top)):ct(zn)}}}),Je(function(){if(Qn){var on=cn.slice(yi,Lr+1);Qn(on,cn)}},[yi,Lr,cn]);var Ft=Kr(cn,vi,Wr,gr),un=or==null?void 0:or({start:yi,end:Lr,virtual:bt,offsetX:Li,offsetY:hi,rtl:ln,getSize:Ft}),vn=je(cn,yi,Lr,Ot,pr,Jt,Wi),Nn=null;nr&&(Nn=(0,He.Z)((0,ve.Z)({},Xe?"height":"maxHeight",nr),mi),st&&(Nn.overflowY="hidden",Ot&&(Nn.overflowX="hidden"),oi&&(Nn.pointerEvents="none")));var kn={};return ln&&(kn.dir="rtl"),ke.createElement("div",(0,he.Z)({style:(0,He.Z)((0,He.Z)({},ut),{},{position:"relative"}),className:Pn},kn,ht),ke.createElement(tt.Z,{onResize:ze},ke.createElement(Yt,{className:"".concat(Dn,"-holder"),style:Nn,ref:pn,onScroll:Gn,onMouseEnter:Mt},ke.createElement(St,{prefixCls:Dn,height:ti,offsetX:Li,offsetY:hi,scrollWidth:Ot,onInnerResize:Ar,ref:mn,innerProps:qn,rtl:ln,extra:un},vn))),bt&&ti>nr&&ke.createElement(xe,{ref:Ze,prefixCls:Dn,scrollOffset:Gt,scrollRange:ti,rtl:ln,onScroll:fr,onStartMove:ji,onStopMove:Yr,spinSize:wt,containerSize:Le.height,style:lr==null?void 0:lr.verticalScrollBar,thumbStyle:lr==null?void 0:lr.verticalScrollBarThumb}),bt&&Ot&&ke.createElement(xe,{ref:et,prefixCls:Dn,scrollOffset:Li,scrollRange:Ot,rtl:ln,onScroll:fr,onStartMove:ji,onStopMove:Yr,spinSize:lt,containerSize:Le.width,horizontal:!0,style:lr==null?void 0:lr.horizontalScrollBar,thumbStyle:lr==null?void 0:lr.horizontalScrollBarThumb}))}var Ui=ke.forwardRef(Ji);Ui.displayName="List";var Vi=Ui,ui=Vi},66392:function(Sn,Wt){"use strict";var se;var he=Symbol.for("react.element"),He=Symbol.for("react.portal"),Re=Symbol.for("react.fragment"),Ve=Symbol.for("react.strict_mode"),ve=Symbol.for("react.profiler"),_e=Symbol.for("react.provider"),ke=Symbol.for("react.context"),Se=Symbol.for("react.server_context"),me=Symbol.for("react.forward_ref"),Ee=Symbol.for("react.suspense"),tt=Symbol.for("react.suspense_list"),Be=Symbol.for("react.memo"),St=Symbol.for("react.lazy"),dt=Symbol.for("react.offscreen"),it;it=Symbol.for("react.module.reference");function Ge(De){if(typeof De=="object"&&De!==null){var At=De.$$typeof;switch(At){case he:switch(De=De.type,De){case Re:case ve:case Ve:case Ee:case tt:return De;default:switch(De=De&&De.$$typeof,De){case Se:case ke:case me:case St:case Be:case _e:return De;default:return At}}case He:return At}}}se=ke,se=_e,se=he,se=me,se=Re,se=St,se=Be,se=He,se=ve,se=Ve,se=Ee,se=tt,se=function(){return!1},se=function(){return!1},se=function(De){return Ge(De)===ke},se=function(De){return Ge(De)===_e},se=function(De){return typeof De=="object"&&De!==null&&De.$$typeof===he},se=function(De){return Ge(De)===me},se=function(De){return Ge(De)===Re},se=function(De){return Ge(De)===St},se=function(De){return Ge(De)===Be},se=function(De){return Ge(De)===He},se=function(De){return Ge(De)===ve},se=function(De){return Ge(De)===Ve},se=function(De){return Ge(De)===Ee},se=function(De){return Ge(De)===tt},se=function(De){return typeof De=="string"||typeof De=="function"||De===Re||De===ve||De===Ve||De===Ee||De===tt||De===dt||typeof De=="object"&&De!==null&&(De.$$typeof===St||De.$$typeof===Be||De.$$typeof===_e||De.$$typeof===ke||De.$$typeof===me||De.$$typeof===it||De.getModuleId!==void 0)},se=Ge},31461:function(Sn,Wt,se){"use strict";se(66392)},84279:function(Sn,Wt,se){"use strict";var he=Object.defineProperty,He=Object.defineProperties,Re=Object.getOwnPropertyDescriptors,Ve=Object.getOwnPropertySymbols,ve=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable,ke=(a,y,b)=>y in a?he(a,y,{enumerable:!0,configurable:!0,writable:!0,value:b}):a[y]=b,Se=(a,y)=>{for(var b in y||(y={}))ve.call(y,b)&&ke(a,b,y[b]);if(Ve)for(var b of Ve(y))_e.call(y,b)&&ke(a,b,y[b]);return a},me=(a,y)=>He(a,Re(y)),Ee=a=>typeof a=="symbol"?a:a+"",tt=(a,y)=>{var b={};for(var E in a)ve.call(a,E)&&y.indexOf(E)<0&&(b[E]=a[E]);if(a!=null&&Ve)for(var E of Ve(a))y.indexOf(E)<0&&_e.call(a,E)&&(b[E]=a[E]);return b};function Be(a){return Array.isArray(a)}var St={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 dt(){return"window"in globalThis&&"document"in globalThis}function it(){return"matchMedia"in window?window.matchMedia("(pointer: coarse)").matches:"ontouchstart"in window||navigator.maxTouchPoints>0}function Ge(){return typeof navigator.vibrate=="function"}function De(){var a,y;if(!dt())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 At(){if(!dt())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 Xt(){return HTMLElement.prototype.hasOwnProperty("popover")}var rt={strings:St,_locale:"",_dirty:!1,_subscribers:[],_numberFormatter:void 0,get locale(){return rt._locale||(rt._locale=dt()?navigator.language.slice(0,5):"en-US"),rt._locale},set locale(a){rt._locale=a,rt._numberFormatter=void 0,rt.dirty=!0},get numberFormatter(){return rt._numberFormatter||(rt._numberFormatter=new Intl.NumberFormat(rt.locale)),rt._numberFormatter},merge(a,y){if(typeof a=="string"&&y)rt.strings[a]=Se(Se({},rt.strings[a]),y),rt.dirty=!0;else for(const b of Object.keys(a))rt.merge(b,a[b])},get dirty(){return rt._dirty},set dirty(a){rt._dirty||rt._dirty===a||(rt._dirty=!0,setTimeout(()=>{rt._dirty=!1,this._subscribers.forEach(y=>y==null?void 0:y())},0))},subscribe(a){return rt._subscribers.push(a),rt._subscribers.length-1},unsubscribe(a){a<0||a>=rt._subscribers.length||(rt._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=ft(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=ft(E);ee&&b.setAttribute("aria-label",ee)}}}};function ft(a,...y){if(a===void 0)return;let b="";const E=rt.locale;rt.strings[E]&&(b=rt.strings[E][a]);const ee=E.slice(0,2);if(!b&&rt.strings[ee]&&(b=rt.strings[ee][a]),b||(b=rt.strings.en[a]),!b)return;const re=/(%@|%([0-9]+)\$@)/g;let ae=re.exec(b),de=0;for(;ae;){if(y[de++]){const be=ae[2]?parseInt(ae[2],10)-1:de-1;let Ce=y[be];typeof Ce=="number"&&(Ce=rt.numberFormatter.format(Ce)),b=b.replace(ae[1],Ce)}ae=re.exec(b)}return b=b.replace(/%%/g,"%"),b}var Ie={m0:"#3F3D99",m1:"#993D71",m2:"#998B3D",m3:"#3D9956",m4:"#3D5A99",m5:"#993D90",m6:"#996D3D",m7:"#43993D",m8:"#3D7999",m9:"#843D99"},xe={blue:"#0072BD",orange:"#D95319",yellow:"#EDB120",purple:"#7E2F8E",green:"#77AC30",cyan:"#4DBEEE",red:"#A2142F"},Ue={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"},_t={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"},Ct={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 de=a.split("!");let ge,be,Ce,$e=255,Ye=255,gt=255,Et=-1;const _n=de.length>0&&de[0].startsWith("-");_n&&(de[0]=de[0].slice(1));for(let kr=0;kr<de.length;kr++){ge=$e,be=Ye,Ce=gt;const wn=(y=de[kr].trim().match(/^([A-Za-z\d-]+)/))==null?void 0:y[1],rr=wn==null?void 0:wn.toLowerCase(),Ir=wn&&(ae=(re=(ee=(E=(b=je[rr])!=null?b:je[_t[wn]])!=null?E:xe[wn])!=null?ee:Ct[wn])!=null?re:Ie[wn])!=null?ae:de[kr].trim();let dr=Ir.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if(dr!=null&&dr[1]&&dr[2]&&dr[3])$e=Math.max(0,Math.min(255,Number.parseInt(dr[1],16))),Ye=Math.max(0,Math.min(255,Number.parseInt(dr[2],16))),gt=Math.max(0,Math.min(255,Number.parseInt(dr[3],16)));else if(dr=Ir.match(/^#([\da-f]{3})$/i),dr!=null&&dr[1]){const ci=Number.parseInt(dr[1][0],16),Ii=Number.parseInt(dr[1][1],16),bi=Number.parseInt(dr[1][2],16);$e=Math.max(0,Math.min(255,ci*16+ci)),Ye=Math.max(0,Math.min(255,Ii*16+Ii)),gt=Math.max(0,Math.min(255,bi*16+bi))}else if(dr=Ir.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i),dr!=null&&dr[1]&&dr[2]&&dr[3])$e=Math.max(0,Math.min(255,Number.parseInt(dr[1]))),Ye=Math.max(0,Math.min(255,Number.parseInt(dr[2]))),gt=Math.max(0,Math.min(255,Number.parseInt(dr[3])));else return;Et>=0&&($e=(1-Et)*$e+Et*ge,Ye=(1-Et)*Ye+Et*be,gt=(1-Et)*gt+Et*Ce,Et=-1),kr+1<de.length&&(Et=Math.max(0,Math.min(100,Number.parseInt(de[++kr])))/100)}return Et>=0&&($e=Et*$e+(1-Et)*ge,Ye=Et*Ye+(1-Et)*be,gt=Et*gt+(1-Et)*Ce),_n&&($e=255-$e,Ye=255-Ye,gt=255-gt),"#"+("00"+Math.round($e).toString(16)).slice(-2)+("00"+Math.round(Ye).toString(16)).slice(-2)+("00"+Math.round(gt).toString(16)).slice(-2)}function qe(a){var y,b;return a=a.trim(),(b=(y=Ue[a.toLowerCase()])!=null?y:Ue[_t[a]])!=null?b:Dt(a)}function Rt(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 Pt(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 En(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*Pt(re,ee,y+2)),g:Math.round(255*Pt(re,ee,y)),b:Math.round(255*Pt(re,ee,y-2))}}function tn(a){return a<0?0:a>255?255:Math.round(a)}function $n(a){const{r:y,g:b,b:E}=a;let ee=((1<<24)+(tn(y)<<16)+(tn(b)<<8)+tn(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 ur(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 de,ge;re===ee?de=0:y===re?de=(b-E)/ae:b===re?de=2+(E-y)/ae:E===re&&(de=4+(y-b)/ae),de=Math.min(de*60,360),de<0&&(de+=360);const be=(ee+re)/2;return re===ee?ge=0:be<=.5?ge=ae/(re+ee):ge=ae/(2-re-ee),{h:de,s:ge,l:be}}function wr(a){let y=Rt(a);if(!y)return a;let{h:b,s:E,l:ee}=ur(y);return E+=.1,ee-=.1,$n(En({h:b,s:E,l:ee}))}var Je={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"},Ae={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},Ht=[{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 Rn(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 Ht)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(Ae[re]||re)}return a}function yn(a){var y;if((a<119808||a>120831)&&(a<8448||a>8527))return{char:String.fromCodePoint(a)};for(const b in Ae)if(Ae[b]===a){a=(y=b.codePointAt(0))!=null?y:0;break}for(const b of Ht)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 ot(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=Je[ee];if(re)re.startsWith("\\")?b+=re+" ":b+=re;else{const{char:ae,variant:de,style:ge}=yn(ee);switch(re=ae,de){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(ge){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 Tt={},rn=Se({},Je),dn={},Ut={},Kt={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}"},bn={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}},nn={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}},we={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:nn},"amsmath.sty":{package:bn,primitive:!0},"texvc.sty":{package:Kt,primitive:!1}},ue={" ":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!@*()-=+{}\[\]\\';:?/.,~<>`|$%#&^" ]/,pe,fe;At()?(pe=new RegExp("\\p{Letter}","u"),fe=new RegExp("[0-9\\p{Letter}]","u")):(pe=/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/,fe=/[\da-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/);function le(a,y,b="mord",E){y!==void 0&&(Tt[a]={definitionType:"symbol",type:b,variant:E,codepoint:y},rn[y]||(rn[y]=a))}function Pe(a,y,b){if(typeof a=="string"){for(let E=0;E<a.length;E++){const ee=a.charAt(E);le(ee,ee.codePointAt(0))}return}for(const[E,ee,re,ae]of a)le(E,ee,re!=null?re:y,ae!=null?ae:b)}function Qe(a,y){for(let b=a;b<=y;b++)le(String.fromCodePoint(b),b)}function It(a){var y;return(y=Ut[a])!=null?y:null}function Nt(a,y){var b,E;if(y.length===0||y==="\\"||!y.startsWith("\\"))return[];const ee=[];for(const ae in dn)ae.startsWith(y)&&!dn[ae].infix&&ee.push({match:ae,frequency:(b=dn[ae].frequency)!=null?b:0});for(const ae in Tt)ae.startsWith(y)&&ee.push({match:ae,frequency:(E=Tt[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,de)=>{var ge,be;return ae.frequency===de.frequency?ae.match.length===de.match.length?ae.match<de.match?-1:1:ae.match.length-de.match.length:((ge=de.frequency)!=null?ge:0)-((be=ae.frequency)!=null?be:0)}),ee.map(ae=>ae.match)}function qt(a){let y="auto";const b=a.match(/:([^=]+)/);return b&&(y=b[1].trim()),y}function an(a){if(!a)return[];const y=[];let b=a.split("]");if(b[0].startsWith("[")){y.push({isOptional:!0,type:qt(b[0].slice(1))});for(let E=1;E<=b.length;E++)y.push(...an(b[E]))}else if(b=a.split("}"),b[0].startsWith("{")){y.push({isOptional:!1,type:qt(b[0].slice(1))});for(let E=1;E<=b.length;E++)y.push(...an(b[E]))}return y}function jt(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 ir(a,y){typeof a=="string"&&(a=[a]);const b={tabular:!1,params:[],createAtom:y};for(const E of a)Ut[E]=b}function Cr(a,y,b){typeof a=="string"&&(a=[a]);const ee={tabular:!0,params:an(y),createAtom:b};for(const re of a)Ut[re]=ee}function Bt(a,y,b){var E,ee;b||(b={});const re={definitionType:"function",params:an(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")dn["\\"+a]=re;else for(const ae of a)dn["\\"+ae]=re}var Mn;function Vn(a){return Mn||(Mn=at(we)),a?at(Se(Se({},Mn),a)):Mn}function br(a,y){var b,E,ee,re;if(typeof a=="string"){let ae=0;const de=a;return/(^|[^\\])#1/.test(de)&&(ae=1),/(^|[^\\])#2/.test(de)&&(ae=2),/(^|[^\\])#3/.test(de)&&(ae=3),/(^|[^\\])#4/.test(de)&&(ae=4),/(^|[^\\])#5/.test(de)&&(ae=5),/(^|[^\\])#6/.test(de)&&(ae=6),/(^|[^\\])#7/.test(de)&&(ae=7),/(^|[^\\])#8/.test(de)&&(ae=8),/(^|[^\\])#9/.test(de)&&(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:de}}return Se({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 at(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]=br(E.package[ee],{expand:!E.primitive,captureSelection:E.captureSelection});else y[b]=br(E)}return y}function $t(a,y="math"){if(!a||a.length===0)return null;let b=null;if(a.startsWith("\\")){if(b=dn[a],b)return!b.ifMode||b.ifMode===y?b:null;y==="math"?b=Tt[a]:ue[a]&&(b={definitionType:"symbol",type:"mord",codepoint:ue[a]})}else if(y==="math"){if(b=Tt[a],!b&&a.length===1){const E=Jn("math",a.codePointAt(0));return E.startsWith("\\")?me(Se({},$t(E,"math")),{command:E}):null}}else ue[a]?b={definitionType:"symbol",type:"mord",codepoint:ue[a]}:y==="text"&&(b={definitionType:"symbol",type:"mord",codepoint:a.codePointAt(0)});return b!=null?b:null}function In(a,y){if(!a.startsWith("\\"))return null;const b=a.slice(1);return y[b]}function Jn(a,y){if(y===void 0)return"";if(a==="math"&&rn[y])return rn[y];if(a==="text"){const b=Object.keys(ue).find(E=>ue[E]===y);return b||String.fromCodePoint(y)}return String.fromCodePoint(y)}var ar=[0,.68889,0,0,.72222],Mr=[0,.68889,0,0,.66667],$r=[0,.68889,0,0,.77778],Dr=[0,.68889,0,0,.61111],Kr=[.16667,.68889,0,0,.77778],ni=[0,.68889,0,0,.55556],hr=[0,0,0,0,.25],mi=[0,.825,0,0,2.33334],Ji=[0,.9,0,0,2.33334],Ui=[0,.68889,0,0,.54028],Vi=[-.03598,.46402,0,0,.5],ui=[-.13313,.36687,0,0,1],yt=[.01354,.52239,0,0,1],Cn=[.01354,.52239,0,0,1.11111],Ln=[0,.54986,0,0,1],Dn=[0,.69224,0,0,.5],sr=[0,.43056,0,0,1],nr=[.08198,.58198,0,0,.77778],gr=[.19444,.69224,0,0,.41667],Fn=[.1808,.675,0,0,1],Xe=[.19444,.69224,0,0,.83334],ut=[.13667,.63667,0,0,1],Lt=[-.064,.437,0,0,1.334],Jt=[.08167,.58167,0,0,.77778],We=[0,.69224,0,0,.72222],mt=[0,.69224,0,0,.66667],zt=[-.13313,.36687,0,0,.77778],Ot=[.06062,.54986,0,0,.77778],Vt=[0,.69224,0,0,.77778],Yt=[.25583,.75583,0,0,.77778],Hn=[.25142,.75726,0,0,.77778],_r=[.20576,.70576,0,0,.77778],Qn=[.30274,.79383,0,0,.77778],qn=[.22958,.72958,0,0,.77778],or=[.1808,.675,0,0,.77778],lr=[.13667,.63667,0,0,.77778],ht=[.13597,.63597,0,0,.77778],st=[.03517,.54986,0,0,.77778],bt=[0,.675,0,0,.77778],ln=[.19444,.69224,0,0,.61111],Pn=[0,.54986,0,0,.76042],cn=[0,.54986,0,0,.66667],pn=[.0391,.5391,0,0,.77778],mn=[.03517,.54986,0,0,1.33334],On=[.38569,.88569,0,0,.77778],cr=[.23222,.74111,0,0,.77778],Gt=[.19444,.69224,0,0,.77778],Jr=[0,.37788,0,0,.5],Zr=[0,.54986,0,0,.72222],Bi=[0,.69224,0,0,.83334],Li=[.11111,.69224,0,0,.66667],gi=[.26167,.75726,0,0,.77778],Yi=[.48256,.98256,0,0,.77778],xi=[.28481,.79383,0,0,.77778],oi=[.08167,.58167,0,0,.22222],Ri=[.08167,.58167,0,0,.38889],ji=[0,.43056,.04028,0,.66667],Yr=[.41951,.91951,0,0,.77778],vi=[.24982,.74947,0,0,.38865],Wi=[.08319,.58283,0,0,.75623],la=[0,.10803,0,0,.27764],ta=[0,.47534,0,0,.50181],ri=[.18906,.47534,0,0,.50181],xt=[0,.69141,0,0,.50181],vt=[.24982,.74947,0,0,.27764],Zt=[0,.69141,0,0,.21471],fn=[.25,.75,0,0,.44722],Tn=[0,.64444,0,0,.575],pr=[.08556,.58556,0,0,.89444],Ar=[0,.69444,0,0,.89444],Wr=[0,.68611,0,0,.9],Vr=[0,.68611,0,0,.86944],Hr=[.25,.75,0,0,.575],ti=[.25,.75,0,0,.31944],yi=[0,.69444,0,0,.63889],Lr=[0,.69444,0,0,.31944],hi=[0,.44444,0,0,.63889],Ai=[0,.44444,0,0,.51111],Mi=[0,.69444,0,0,.575],Le=[.13333,.63333,0,0,.89444],Fe=[0,.44444,0,0,.31944],ze=[0,.69444,0,0,.86944],Ze=[0,.68611,0,0,.69166],et=[0,.68611,0,0,.83055],lt=[0,.68611,0,0,.89444],wt=[0,.69444,0,0,.60278],Qt=[.19444,.69444,0,0,.51111],sn=[0,.69444,0,0,.83055],Xn=[-.10889,.39111,0,0,1.14999],vr=[.19444,.69444,0,0,.575],Zn=[.19444,.69444,0,0,1.14999],xn=[.19444,.69444,0,0,.70277],gn=[.05556,.75,0,0,.575],An=[0,.68611,0,0,.95833],Bn=[.08556,.58556,0,0,.76666],fr=[-.02639,.47361,0,0,.575],Gn=[0,.44444,0,0,.89444],jn=[0,.55556,0,0,.76666],er=[-.10889,.39111,0,0,.89444],tr=[.00222,.50222,0,0,.89444],yr=[.19667,.69667,0,0,.89444],Oe=[.08556,.58556,0,0,1.14999],Ke=[0,.69444,0,0,.70277],Mt=[-.02778,.47222,0,0,.575],ct=[.25,.75,0,0,.51111],Ft=[-.13889,.36111,0,0,1.14999],un=[.19444,.69444,0,0,1.02222],vn=[.12963,.69444,0,0,.89444],Nn=[.19444,.69444,0,0,.44722],kn=[0,.64444,.13167,0,.59111],on=[.19444,.64444,.13167,0,.59111],zn=[0,.68611,.17208,0,.8961],Wn=[.19444,.44444,.105,0,.53222],xr=[0,.44444,.085,0,.82666],Kn=[0,.69444,.06709,0,.59111],Pr=[0,.69444,.12945,0,.35555],Xr=[0,.69444,0,0,.94888],Rr=[0,.69444,.11472,0,.59111],Ur=[0,.68611,.10778,0,.88555],Er=[0,.69444,.07939,0,.62055],Fr=[0,.69444,.12417,0,.30667],Qr=[0,.64444,.13556,0,.51111],si=[.19444,.64444,.13556,0,.51111],Nr=[0,.68333,.16389,0,.74333],di=[.19444,.43056,.08847,0,.46],Pi=[0,.43056,.07514,0,.71555],na=[0,.69444,.06646,0,.51111],Gi=[0,.69444,0,0,.83129],Ni=[0,.69444,.1225,0,.51111],qi=[0,.68333,.09403,0,.76666],Qi=[0,.68333,.11111,0,.76666],wi=[0,.69444,.06961,0,.51444],$i=[0,.69444,0,0,.27778],qr=[.25,.75,0,0,.38889],fi=[0,.64444,0,0,.5],Ti=[0,.69444,0,0,.77778],Xi=[0,.68333,0,0,.75],Na=[0,.68333,0,0,.77778],$a=[0,.68333,0,0,.68056],Aa=[0,.68333,0,0,.72222],ca=[.25,.75,0,0,.5],ea=[.25,.75,0,0,.27778],Ei=[0,.69444,0,0,.5],Oa=[0,.69444,0,0,.55556],ki=[0,.43056,0,0,.44445],ei=[0,.43056,0,0,.5],zi=[.19444,.43056,0,0,.55556],ua=[0,.43056,0,0,.55556],Zi=[.08333,.58333,0,0,.77778],aa=[0,.43056,0,0,.27778],pi=[0,.66786,0,0,.27778],pa=[0,.69444,0,0,.75],xa=[0,.66786,0,0,.5],fa=[0,.68333,0,0,.625],wa=[.19444,.69444,0,0,.44445],Ea=[0,.69444,0,0,.72222],ja=[.19444,.69444,0,0,.5],ha=[.19444,.69444,0,0,1],ka=[.011,.511,0,0,1.126],Ja=[.19444,.69444,0,0,.61111],Ga=[.05556,.75,0,0,.5],so=[0,.68333,0,0,.83334],Fa=[.0391,.5391,0,0,.66667],Ca=[-.05555,.44445,0,0,.5],_i=[0,.43056,0,0,.77778],Ki=[0,.55556,0,0,.66667],da=[-.03625,.46375,0,0,.77778],Sa=[-.01688,.48312,0,0,.77778],Ka=[.0391,.5391,0,0,1],io=[0,.69444,0,0,.61111],ho=[-.03472,.46528,0,0,.5],Oo=[.25,.75,0,0,.44445],Bo=[-.14236,.35764,0,0,1],lo=[.244,.744,0,0,.412],Ao=[.19444,.69444,0,0,.88889],ra=[.12963,.69444,0,0,.77778],Oi=[.19444,.69444,0,0,.38889],Ta=[.011,.511,0,0,1.638],_a=[.19444,.69444,0,0,0],co=[0,.44444,0,0,.575],ao=[.19444,.44444,0,0,.575],hs=[0,.68611,0,0,.75555],Qo=[0,.69444,0,0,.66759],ps=[0,.68611,0,0,.80555],oa=[0,.68611,.08229,0,.98229],Or=[0,.68611,0,0,.76666],Si=[0,.44444,0,0,.58472],Ci=[.19444,.44444,0,0,.6118],Di=[.19444,.43056,0,0,.5],Ha=[0,.68333,.02778,.08334,.76278],Va=[0,.68333,.08125,.05556,.83125],Fo=[0,.43056,0,.05556,.48472],Zo=[.19444,.43056,0,.08334,.51702],ls=[.25,.75,0,0,.42778],va=[0,.69444,0,0,.55],Ro=[0,.69444,0,0,.73334],cs=[0,.69444,0,0,.79445],ul=[0,.69444,0,0,.51945],As=[0,.69444,0,0,.70278],ms=[0,.69444,0,0,.76389],zo=[.25,.75,0,0,.34306],Ts=[0,.69444,0,0,.56111],Ds=[0,.69444,0,0,.25556],qs=[.19444,.45833,0,0,.56111],oo=[0,.45833,0,0,.56111],Da=[0,.69444,0,0,.30556],Xa=[0,.69444,0,0,.58056],go=[0,.69444,0,0,.67223],yo=[0,.69444,0,0,.85556],Ko=[0,.69444,0,0,.55834],wo=[0,.65556,.11156,0,.5],xs=[0,.69444,.08094,0,.70834],Xl=[.17014,0,0,0,.44445],Yl=[0,.69444,.0799,0,.5],vc=[0,.69444,0,0,.73752],Xc=[0,.69444,.09205,0,.5],Ks=[0,.69444,.09031,0,.77778],Is=[0,.69444,.07816,0,.27778],yc=[0,.69444,.00316,0,.5],ql=[.19444,.69444,0,0,.83334],Ia=[.05556,.75,0,0,.83334],ma=[0,.75,0,0,.5],Ho=[.125,.08333,0,0,.27778],es=[0,.08333,0,0,.27778],ga=[0,.65556,0,0,.5],za=[0,.69444,0,0,.47222],Ba=[0,.69444,0,0,.66667],po=[0,.69444,0,0,.59722],is=[0,.69444,0,0,.54167],Hs=[0,.69444,0,0,.70834],gs=[.25,.75,0,0,.28889],Jl=[0,.69444,0,0,.51667],Ud=[0,.44444,0,0,.44445],jd=[.19444,.44444,0,0,.51667],Yc=[0,.44444,0,0,.38333],Uu=[0,.44444,0,0,.51667],qc=[0,.69444,0,0,.83334],Vd=[.35001,.85,0,0,.45834],Jc=[.35001,.85,0,0,.57778],Qc=[.35001,.85,0,0,.41667],ju=[.35001,.85,0,0,.58334],bc=[0,.72222,0,0,.55556],eu=[1e-5,.6,0,0,.66667],Vu=[1e-5,.6,0,0,.77778],Ql=[.25001,.75,0,0,.94445],Gd=[.306,.805,.19445,0,.47222],xc=[.30612,.805,.19445,0,.47222],Uo=[.25001,.75,0,0,.83334],Pl=[.35001,.85,0,0,.47222],Gu=[.25001,.75,0,0,1.11111],Xu=[.65002,1.15,0,0,.59722],vs=[.65002,1.15,0,0,.81111],Ua=[.65002,1.15,0,0,.47222],Es=[.65002,1.15,0,0,.66667],Ps=[0,.75,0,0,1],Js=[.55001,1.05,0,0,1.27778],Yu=[.862,1.36,.44445,0,.55556],tu=[.86225,1.36,.44445,0,.55556],Ol=[.55001,1.05,0,0,1.11111],nu=[.65002,1.15,0,0,.52778],ru=[.65002,1.15,0,0,.61111],Bl=[.55001,1.05,0,0,1.51112],qu=[.95003,1.45,0,0,.73611],iu=[.95003,1.45,0,0,1.04445],Qs=[.95003,1.45,0,0,.52778],wc=[.95003,1.45,0,0,.75],Sc=[0,.75,0,0,1.44445],au=[.95003,1.45,0,0,.58334],Cc=[1.25003,1.75,0,0,.79167],ou=[1.25003,1.75,0,0,1.27778],Ju=[1.25003,1.75,0,0,.58334],su=[1.25003,1.75,0,0,.80556],Mc=[0,.825,0,0,1.8889],lu=[1.25003,1.75,0,0,.63889],cu=[.64502,1.155,0,0,.875],Ec=[1e-5,.6,0,0,.875],uu=[-99e-5,.601,0,0,.66667],du=[.64502,1.155,0,0,.66667],Xd=[1e-5,.9,0,0,.88889],Qu=[.65002,1.15,0,0,.88889],Rl=[.90001,0,0,0,.88889],fu=[-.00499,.605,0,0,1.05556],Nl=[0,.12,0,0,.45],li=[0,.61111,0,0,.525],ws=[.08333,.69444,0,0,.525],ed=[-.08056,.53055,0,0,.525],Yd=[-.05556,.55556,0,0,.525],as=[0,.43056,0,0,.525],To=[.22222,.43056,0,0,.525],kc=[0,0,0,0,.525],qd={"AMS-Regular":{32:hr,65:ar,66:Mr,67:ar,68:ar,69:Mr,70:Dr,71:$r,72:$r,73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:$r,76:Mr,77:[0,.68889,0,0,.94445],78:ar,79:Kr,80:Dr,81:Kr,82:ar,83:ni,84:Mr,85:ar,86:ar,87:[0,.68889,0,0,1],88:ar,89:ar,90:Mr,107:ni,160:hr,165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:ni,295:Ui,710:mi,732:Ji,770:mi,771:Ji,989:Jt,1008:ji,8245:[0,.54986,0,0,.275],8463:Ui,8487:ar,8498:ni,8502:Mr,8503:[0,.68889,0,0,.44445],8504:Mr,8513:[0,.68889,0,0,.63889],8592:Vi,8594:Vi,8602:ui,8603:ui,8606:yt,8608:yt,8610:Cn,8611:Cn,8619:Ln,8620:Ln,8621:[-.13313,.37788,0,0,1.38889],8622:ui,8624:Dn,8625:Dn,8630:sr,8631:sr,8634:nr,8635:nr,8638:gr,8639:gr,8642:gr,8643:gr,8644:Fn,8646:Fn,8647:Fn,8648:Xe,8649:Fn,8650:Xe,8651:yt,8652:yt,8653:ui,8654:ui,8655:ui,8666:ut,8667:ut,8669:[-.13313,.37788,0,0,1],8672:Lt,8674:Lt,8705:[0,.825,0,0,.5],8708:ni,8709:Jt,8717:[0,.43056,0,0,.42917],8722:Vi,8724:[.08198,.69224,0,0,.77778],8726:Jt,8733:Vt,8736:We,8737:We,8738:[.03517,.52239,0,0,.72222],8739:oi,8740:[.25142,.74111,0,0,.27778],8741:Ri,8742:[.25142,.74111,0,0,.5],8756:mt,8757:mt,8764:zt,8765:[-.13313,.37788,0,0,.77778],8769:zt,8770:da,8774:Qn,8776:Sa,8778:Jt,8782:Ot,8783:Ot,8785:nr,8786:nr,8787:nr,8790:Vt,8791:qn,8796:[.08198,.91667,0,0,.77778],8806:Yt,8807:Yt,8808:Hn,8809:Hn,8812:[.25583,.75583,0,0,.5],8814:_r,8815:_r,8816:Qn,8817:Qn,8818:qn,8819:qn,8822:or,8823:or,8828:lr,8829:lr,8830:qn,8831:qn,8832:_r,8833:_r,8840:Qn,8841:Qn,8842:ht,8843:ht,8847:st,8848:st,8858:nr,8859:nr,8861:nr,8862:bt,8863:bt,8864:bt,8865:bt,8872:[0,.69224,0,0,.61111],8873:We,8874:[0,.69224,0,0,.88889],8876:Dr,8877:Dr,8878:ar,8879:ar,8882:st,8883:st,8884:lr,8885:lr,8888:[0,.54986,0,0,1.11111],8890:zi,8891:ln,8892:ln,8901:[0,.54986,0,0,.27778],8903:Jt,8905:Jt,8906:Jt,8907:Vt,8908:Vt,8909:[-.03598,.46402,0,0,.77778],8910:Pn,8911:Pn,8912:st,8913:st,8914:cn,8915:cn,8916:mt,8918:pn,8919:pn,8920:mn,8921:mn,8922:On,8923:On,8926:lr,8927:lr,8928:Qn,8929:Qn,8934:cr,8935:cr,8936:cr,8937:cr,8938:_r,8939:_r,8940:Qn,8941:Qn,8994:Gt,8995:Gt,9416:[.15559,.69224,0,0,.90222],9484:Dn,9488:Dn,9492:Jr,9496:Jr,9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:bt,9633:bt,9650:Zr,9651:Zr,9654:st,9660:Zr,9661:Zr,9664:st,9674:Li,9733:[.19444,.69224,0,0,.94445],10003:Bi,10016:Bi,10731:Li,10846:[.19444,.75583,0,0,.61111],10877:lr,10878:lr,10885:Yt,10886:Yt,10887:ht,10888:ht,10889:gi,10890:gi,10891:Yi,10892:Yi,10901:lr,10902:lr,10933:Hn,10934:Hn,10935:gi,10936:gi,10937:gi,10938:gi,10949:Yt,10950:Yt,10955:xi,10956:xi,57350:oi,57351:Ri,57352:Jt,57353:ji,57356:Hn,57357:Hn,57358:Yr,57359:Qn,57360:Qn,57361:Yr,57366:Hn,57367:Hn,57368:Hn,57369:Hn,57370:ht,57371:ht},"Caligraphic-Regular":{32:hr,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:hr},"Fraktur-Regular":{32:hr,33:[0,.69141,0,0,.29574],34:Zt,38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:vi,41:vi,42:[0,.62119,0,0,.27764],43:Wi,44:la,45:Wi,46:la,47:[.24982,.74947,0,0,.50181],48:ta,49:ta,50:ta,51:ri,52:ri,53:ri,54:xt,55:ri,56:xt,57:ri,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:vt,93:vt,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:hr,8216:Zt,8217:Zt,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:hr,33:[0,.69444,0,0,.35],34:wt,35:[.19444,.69444,0,0,.95833],36:gn,37:[.05556,.75,0,0,.95833],38:Ar,39:Lr,40:fn,41:fn,42:[0,.75,0,0,.575],43:Le,44:[.19444,.15556,0,0,.31944],45:Yc,46:[0,.15556,0,0,.31944],47:Hr,48:Tn,49:Tn,50:Tn,51:Tn,52:Tn,53:Tn,54:Tn,55:Tn,56:Tn,57:Tn,58:Fe,59:[.19444,.44444,0,0,.31944],60:pr,61:er,62:pr,63:[0,.69444,0,0,.54305],64:Ar,65:Vr,66:[0,.68611,0,0,.81805],67:et,68:[0,.68611,0,0,.88194],69:hs,70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:Wr,73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:Ze,77:[0,.68611,0,0,1.09166],78:Wr,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:Vr,89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:ti,92:Hr,93:ti,94:Mi,95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:yi,99:Ai,100:yi,101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:yi,105:Lr,106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:Lr,109:[0,.44444,0,0,.95833],110:hi,111:co,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:hi,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:Ai,123:Hr,124:ti,125:Hr,126:[.35,.34444,0,0,.575],160:hr,163:[0,.69444,0,0,.86853],168:Mi,172:[0,.44444,0,0,.76666],176:ze,177:Le,184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:Le,216:[.04861,.73472,0,0,.89444],223:po,230:[0,.44444,0,0,.83055],247:Le,248:[.09722,.54167,0,0,.575],305:Fe,338:[0,.68611,0,0,1.16944],339:Gn,567:[.19444,.44444,0,0,.35139],710:Mi,711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:Mi,715:Mi,728:Mi,729:Lr,730:ze,732:Mi,733:Mi,915:Ze,916:An,920:lt,923:ps,926:Or,928:Wr,931:et,933:lt,934:et,936:lt,937:et,8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:Lr,8217:Lr,8220:wt,8221:wt,8224:Qt,8225:Qt,8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:Qo,8465:sn,8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:sn,8501:Ke,8592:Xn,8593:vr,8594:Xn,8595:vr,8596:Xn,8597:Hr,8598:Zn,8599:Zn,8600:Zn,8601:Zn,8636:Xn,8637:Xn,8640:Xn,8641:Xn,8656:Xn,8657:xn,8658:Xn,8659:xn,8660:Xn,8661:[.25,.75,0,0,.70277],8704:yi,8706:[0,.69444,.06389,0,.62847],8707:yi,8709:gn,8711:An,8712:Bn,8715:Bn,8722:Le,8723:Le,8725:Hr,8726:Hr,8727:Mt,8728:fr,8729:fr,8730:[.18,.82,0,0,.95833],8733:Gn,8734:[0,.44444,0,0,1.14999],8736:We,8739:ti,8741:Hr,8743:jn,8744:jn,8745:jn,8746:jn,8747:[.19444,.69444,.12778,0,.56875],8764:er,8768:[.19444,.69444,0,0,.31944],8771:tr,8776:[.02444,.52444,0,0,.89444],8781:tr,8801:tr,8804:yr,8805:yr,8810:Oe,8811:Oe,8826:pr,8827:pr,8834:pr,8835:pr,8838:yr,8839:yr,8846:jn,8849:yr,8850:yr,8851:jn,8852:jn,8853:Le,8854:Le,8855:Le,8856:Le,8857:Le,8866:Ke,8867:Ke,8868:Ar,8869:Ar,8900:fr,8901:[-.02639,.47361,0,0,.31944],8902:Mt,8968:ct,8969:ct,8970:ct,8971:ct,8994:Ft,8995:Ft,9651:un,9657:Mt,9661:un,9667:Mt,9711:Zn,9824:vn,9825:vn,9826:vn,9827:vn,9837:[0,.75,0,0,.44722],9838:Nn,9839:Nn,10216:fn,10217:fn,10815:Wr,10927:yr,10928:yr,57376:_a},"Main-BoldItalic":{32:hr,33:[0,.69444,.11417,0,.38611],34:Er,35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:Pr,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:kn,49:kn,50:kn,51:kn,52:on,53:kn,54:kn,55:on,56:kn,57:kn,58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:Rr,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:zn,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:zn,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:Kn,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:Wn,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:Wn,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:hr,168:[0,.69444,.11473,0,.59111],176:Xr,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:xr,248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:xr,567:[.19444,.44444,.04611,0,.385],710:Kn,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:Pr,730:Xr,732:Rr,733:Rr,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:zn,931:[0,.68611,.11431,0,.82666],933:Ur,934:[0,.68611,.05632,0,.82666],936:Ur,937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:Pr,8217:Pr,8220:[0,.69444,.16772,0,.62055],8221:Er},"Main-Italic":{32:hr,33:Fr,34:wi,35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:Fr,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:Qr,49:Qr,50:Qr,51:Qr,52:si,53:Qr,54:Qr,55:si,56:Qr,57:Qr,58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:Ni,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:Nr,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:Nr,79:qi,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:Nr,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:na,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:di,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:di,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:hr,168:[0,.66786,.10474,0,.51111],176:Gi,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:Pi,248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:Pi,710:na,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:Gi,732:[0,.66786,.11585,0,.51111],733:Ni,915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:qi,923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:Nr,931:[0,.68333,.12028,0,.71555],933:Qi,934:[0,.68333,.05986,0,.71555],936:Qi,937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:Fr,8217:Fr,8220:[0,.69444,.1685,0,.51444],8221:wi,8463:Ui},"Main-Regular":{32:hr,33:$i,34:Ei,35:ql,36:Ga,37:Ia,38:Ti,39:$i,40:qr,41:qr,42:ma,43:Zi,44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:ca,48:fi,49:fi,50:fi,51:fi,52:fi,53:fi,54:fi,55:fi,56:fi,57:fi,58:aa,59:[.19444,.43056,0,0,.27778],60:pn,61:zt,62:pn,63:za,64:Ti,65:Xi,66:[0,.68333,0,0,.70834],67:Aa,68:[0,.68333,0,0,.76389],69:$a,70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:Xi,73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:Na,76:fa,77:[0,.68333,0,0,.91667],78:Xi,79:Na,80:$a,81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:Aa,85:Xi,86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:Xi,89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:ea,92:ca,93:ea,94:Ei,95:[.31,.12056,.02778,0,.5],97:ei,98:Oa,99:ki,100:Oa,101:ki,102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:Oa,105:pi,106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:$i,109:[0,.43056,0,0,.83334],110:ua,111:ei,112:zi,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:ua,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:ki,123:ca,124:ea,125:ca,126:[.35,.31786,0,0,.5],160:hr,163:[0,.69444,0,0,.76909],167:wa,168:xa,172:[0,.43056,0,0,.66667],176:pa,177:Zi,182:Ja,184:Xl,198:[0,.68333,0,0,.90278],215:Zi,216:[.04861,.73194,0,0,.77778],223:Ei,230:[0,.43056,0,0,.72222],247:Zi,248:[.09722,.52778,0,0,.5],305:aa,338:[0,.68333,0,0,1.01389],339:_i,567:[.19444,.43056,0,0,.30556],710:Ei,711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:Ei,715:Ei,728:Ei,729:pi,730:pa,732:xa,733:Ei,915:fa,916:so,920:Na,923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:Xi,931:Aa,933:Na,934:Aa,936:Na,937:Aa,8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:$i,8217:$i,8220:Ei,8221:Ei,8224:wa,8225:wa,8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:Ui,8465:Ea,8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:Ea,8501:io,8592:ui,8593:ja,8594:ui,8595:ja,8596:ui,8597:ca,8598:ha,8599:ha,8600:ha,8601:ha,8614:[.011,.511,0,0,1],8617:ka,8618:ka,8636:ui,8637:ui,8640:ui,8641:ui,8652:[.011,.671,0,0,1],8656:ui,8657:Ja,8658:ui,8659:Ja,8660:ui,8661:[.25,.75,0,0,.61111],8704:Oa,8706:[0,.69444,.05556,.08334,.5309],8707:Oa,8709:Ga,8711:so,8712:Fa,8715:Fa,8722:Zi,8723:Zi,8725:ca,8726:ca,8727:ho,8728:Ca,8729:Ca,8730:[.2,.8,0,0,.83334],8733:_i,8734:sr,8736:We,8739:ea,8741:ca,8743:Ki,8744:Ki,8745:Ki,8746:Ki,8747:[.19444,.69444,.11111,0,.41667],8764:zt,8768:[.19444,.69444,0,0,.27778],8771:da,8773:[-.022,.589,0,0,1],8776:Sa,8781:da,8784:[-.133,.67,0,0,.778],8801:da,8804:ht,8805:ht,8810:Ka,8811:Ka,8826:pn,8827:pn,8834:pn,8835:pn,8838:ht,8839:ht,8846:Ki,8849:ht,8850:ht,8851:Ki,8852:Ki,8853:Zi,8854:Zi,8855:Zi,8856:Zi,8857:Zi,8866:io,8867:io,8868:Ti,8869:Ti,8872:[.249,.75,0,0,.867],8900:Ca,8901:[-.05555,.44445,0,0,.27778],8902:ho,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:Oo,8969:Oo,8970:Oo,8971:Oo,8994:Bo,8995:Bo,9136:lo,9137:lo,9651:Ao,9657:ho,9661:Ao,9667:ho,9711:ha,9824:ra,9825:ra,9826:ra,9827:ra,9837:[0,.75,0,0,.38889],9838:Oi,9839:Oi,10216:qr,10217:qr,10222:lo,10223:lo,10229:[.011,.511,0,0,1.609],10230:Ta,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:Ta,10815:Xi,10927:ht,10928:ht,57376:_a},"Math-BoldItalic":{32:hr,48:co,49:co,50:co,51:ao,52:ao,53:ao,54:Tn,55:ao,56:Tn,57:ao,65:Vr,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:oa,73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:hs,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:Qo,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:Si,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:hr,915:[0,.68611,.15972,0,.65694],916:An,920:[0,.68611,.03194,0,.86722],923:ps,926:[0,.68611,.07458,0,.84125],928:oa,931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:Or,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:Si,960:[0,.44444,.03704,0,.68241],961:Ci,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:Ci,1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:hr,48:ei,49:ei,50:ei,51:Di,52:Di,53:Di,54:fi,55:Di,56:fi,57:Di,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:Va,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:Ha,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:Fo,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:hr,915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:Ha,923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:Va,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:Fo,960:[0,.43056,.03588,0,.57003],961:Zo,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:Zo,1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:hr,33:[0,.69444,0,0,.36667],34:Ko,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:Da,40:ls,41:ls,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:va,49:va,50:va,51:va,52:va,53:va,54:va,55:va,56:va,57:va,58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:ul,64:Ro,65:Ro,66:Ro,67:As,68:cs,69:[0,.69444,0,0,.64167],70:io,71:Ro,72:cs,73:[0,.69444,0,0,.33056],74:ul,75:ms,76:Xa,77:[0,.69444,0,0,.97778],78:cs,79:cs,80:As,81:[.10556,.69444,0,0,.79445],82:As,83:io,84:Ro,85:ms,86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:Ro,89:[0,.69444,.0275,0,.73334],90:go,91:zo,93:zo,94:va,95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:Ts,99:[0,.45833,0,0,.48889],100:Ts,101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:Ts,105:Ds,106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:Ds,109:[0,.45833,0,0,.86667],110:oo,111:[0,.45833,0,0,.55],112:qs,113:qs,114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:oo,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:hr,168:va,176:Ro,180:va,184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:va,711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:va,729:Da,730:Ro,732:va,733:va,915:Xa,916:[0,.69444,0,0,.91667],920:yo,923:go,926:Ro,928:cs,931:cs,933:yo,934:cs,936:yo,937:cs,8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:Da,8217:Da,8220:Ko,8221:Ko},"SansSerif-Italic":{32:hr,33:[0,.69444,.05733,0,.31945],34:yc,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:Is,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:Ho,45:[0,.44444,.01946,0,.33333],46:es,47:[.25,.75,.13164,0,.5],48:wo,49:wo,50:wo,51:wo,52:wo,53:wo,54:wo,55:wo,56:wo,57:wo,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:Ba,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:xs,73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:is,77:[0,.69444,.08094,0,.875],78:xs,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:Yl,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:hr,168:[0,.67937,.06385,0,.5],176:vc,184:Xl,305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:Yl,711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:Xc,715:Ei,728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:vc,732:[0,.67659,.08826,0,.5],733:Xc,915:[0,.69444,.13372,0,.54167],916:qc,920:[0,.69444,.07555,0,.77778],923:io,926:[0,.69444,.12816,0,.66667],928:xs,931:[0,.69444,.11983,0,.72222],933:Ks,934:[0,.69444,.04603,0,.72222],936:Ks,937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:Is,8217:Is,8220:[0,.69444,.14205,0,.5],8221:yc},"SansSerif-Regular":{32:hr,33:[0,.69444,0,0,.31945],34:Ei,35:ql,36:Ga,37:Ia,38:[0,.69444,0,0,.75834],39:$i,40:qr,41:qr,42:ma,43:Zi,44:Ho,45:[0,.44444,0,0,.33333],46:es,47:ca,48:ga,49:ga,50:ga,51:ga,52:ga,53:ga,54:ga,55:ga,56:ga,57:ga,58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:za,64:Ba,65:Ba,66:Ba,67:yi,68:[0,.69444,0,0,.72223],69:po,70:[0,.69444,0,0,.56945],71:Ba,72:Hs,73:$i,74:za,75:[0,.69444,0,0,.69445],76:is,77:[0,.69444,0,0,.875],78:Hs,79:[0,.69444,0,0,.73611],80:yi,81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:Oa,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:Ba,89:[0,.69444,.025,0,.66667],90:io,91:gs,93:gs,94:Ei,95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:Jl,99:Ud,100:Jl,101:Ud,102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:Jl,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:Uu,111:[0,.44444,0,0,.5],112:jd,113:jd,114:[0,.44444,.01389,0,.34167],115:Yc,116:[0,.57143,0,0,.36111],117:Uu,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:hr,168:[0,.67937,0,0,.5],176:Ba,184:Xl,305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:Ei,711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:Ei,715:Ei,728:Ei,729:[0,.67937,0,0,.27778],730:Ba,732:[0,.67659,0,0,.5],733:Ei,915:is,916:qc,920:Ti,923:io,926:Ba,928:Hs,931:Ea,933:Ti,934:Ea,936:Ti,937:Ea,8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:$i,8217:$i,8220:Ei,8221:Ei},"Script-Regular":{32:hr,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:hr},"Size1-Regular":{32:hr,40:Vd,41:Vd,47:Jc,91:Qc,92:Jc,93:Qc,123:ju,125:ju,160:hr,710:bc,732:bc,770:bc,771:bc,8214:[-99e-5,.601,0,0,.77778],8593:eu,8595:eu,8657:Vu,8659:Vu,8719:Ql,8720:Ql,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:xc,8748:Gd,8749:Gd,8750:xc,8896:Uo,8897:Uo,8898:Uo,8899:Uo,8968:Pl,8969:Pl,8970:Pl,8971:Pl,9168:uu,10216:Pl,10217:Pl,10752:Gu,10753:Gu,10754:Gu,10756:Uo,10758:Uo},"Size2-Regular":{32:hr,40:Xu,41:Xu,47:vs,91:Ua,92:vs,93:Ua,123:Es,125:Es,160:hr,710:Ps,732:Ps,770:Ps,771:Ps,8719:Js,8720:Js,8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:tu,8748:Yu,8749:Yu,8750:tu,8896:Ol,8897:Ol,8898:Ol,8899:Ol,8968:nu,8969:nu,8970:nu,8971:nu,10216:ru,10217:ru,10752:Bl,10753:Bl,10754:Bl,10756:Ol,10758:Ol},"Size3-Regular":{32:hr,40:qu,41:qu,47:iu,91:Qs,92:iu,93:Qs,123:wc,125:wc,160:hr,710:Sc,732:Sc,770:Sc,771:Sc,8730:[.95003,1.45,0,0,1],8968:au,8969:au,8970:au,8971:au,10216:wc,10217:wc},"Size4-Regular":{32:hr,40:Cc,41:Cc,47:ou,91:Ju,92:ou,93:Ju,123:su,125:su,160:hr,710:Mc,732:Mc,770:Mc,771:Mc,8730:[1.25003,1.75,0,0,1],8968:lu,8969:lu,8970:lu,8971:lu,9115:cu,9116:Ec,9117:cu,9118:cu,9119:Ec,9120:cu,9121:du,9122:uu,9123:du,9124:du,9125:uu,9126:du,9127:Xd,9128:Qu,9129:Rl,9130:[0,.3,0,0,.88889],9131:Xd,9132:Qu,9133:Rl,9143:[.88502,.915,0,0,1.05556],10216:su,10217:su,57344:fu,57345:fu,57680:Nl,57681:Nl,57682:Nl,57683:Nl},"Typewriter-Regular":{32:kc,33:li,34:li,35:li,36:ws,37:ws,38:li,39:li,40:ws,41:ws,42:[0,.52083,0,0,.525],43:ed,44:[.13889,.125,0,0,.525],45:ed,46:[0,.125,0,0,.525],47:ws,48:li,49:li,50:li,51:li,52:li,53:li,54:li,55:li,56:li,57:li,58:as,59:[.13889,.43056,0,0,.525],60:Yd,61:[-.19549,.41562,0,0,.525],62:Yd,63:li,64:li,65:li,66:li,67:li,68:li,69:li,70:li,71:li,72:li,73:li,74:li,75:li,76:li,77:li,78:li,79:li,80:li,81:[.13889,.61111,0,0,.525],82:li,83:li,84:li,85:li,86:li,87:li,88:li,89:li,90:li,91:ws,92:ws,93:ws,94:li,95:[.09514,0,0,0,.525],96:li,97:as,98:li,99:as,100:li,101:as,102:li,103:To,104:li,105:li,106:[.22222,.61111,0,0,.525],107:li,108:li,109:as,110:as,111:as,112:To,113:To,114:as,115:as,116:[0,.55358,0,0,.525],117:as,118:as,119:as,120:as,121:To,122:as,123:ws,124:ws,125:ws,126:li,127:li,160:kc,176:li,184:[.19445,0,0,0,.525],305:as,567:To,711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:li,715:li,728:li,730:li,770:li,771:li,776:li,915:li,916:li,920:li,923:li,926:li,928:li,931:li,933:li,934:li,936:li,937:li,8216:li,8217:li,8242:li,9251:[.11111,.21944,0,0,.525]}},Jd=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,$l=10,os=.25,hu=1.2,el=.431,td={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[el,el,el],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:[os,os,os],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]},pu=[0,.5,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],dl=5,nd={"\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 tl(a,y){a===void 0&&(a=77);const b=qd[y][a];if(b)return{defaultMetrics:!1,depth:b[0],height:b[1],italic:b[2],skew:b[3],width:b[4]};if(a===11034)return{defaultMetrics:!0,depth:.2,height:.8,italic:0,skew:0,width:.8};const E=String.fromCodePoint(a);if(E in nd)a=nd[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 mu={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]},Fl={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 ec(a){if(Fl[a]){const[be,Ce,$e]=Fl[a],Ye=`<span class="stretchy" style="height:${$e}em"><svg width="100%" height="${$e}em" viewBox="0 0 ${be} ${Ce}" preserveAspectRatio="none" ><path fill="currentcolor" d="${Qd[a]}"></path></svg></span>`;return`<span style="display:inline-block;height:${Math.floor(100*$e/2)/100}em;min-width:0">${Ye}</span>`}const[y,b,E,ee]=mu[a];let re,ae;const de=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 ge=y.map((be,Ce)=>`<span class="${re[Ce]}" style=height:${de}em><svg width=400em height=${de}em viewBox="0 0 400000 ${E}" preserveAspectRatio="${ae[Ce]} slice"><path fill="currentcolor" d="${Qd[be]}"></path></svg></span>`).join("");return`<span style="display:inline-block;height:${de}em;min-width:${b}em;">${ge}</span>`}function ef(a){return mu[a]?mu[a][2]/1e3:Fl[a][2]}function tf(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=Il(2,16)+re*Il(2,10)+ae,b++}}y.push(E)}return y}var _c=8205,Lc=[[_c,1],[65038,2],[127995,5],[129456,4],[917536,96]],fl,tc=[127462,127487];function nc(a){var y;if(fl===void 0){fl={};for(const b of Lc)for(let E=b[0];E<=b[0]+b[1]-1;E++)fl[E]=!0}return(y=fl[a])!=null?y:!1}function nf(a){return a>=tc[0]&&a<=tc[1]}function rf(a){if(/^[\u0020-\u00FF]*$/.test(a))return a;const y=[],b=tf(a);let E=0;for(;E<b.length;){const ee=b[E++],re=b[E];if(re===_c){const ae=E-1;for(E+=2;b[E]===_c;)E+=2;y.push(String.fromCodePoint(...b.slice(ae,E-ae+1)))}else if(nc(re)){const ae=E-1;for(;nc(b[E]);)E+=b[E]===_c?2:1;y.push(String.fromCodePoint(...b.slice(ae,2*E-ae-1)))}else nf(ee)?(E+=1,y.push(String.fromCodePoint(...b.slice(E-2,2)))):y.push(String.fromCodePoint(ee))}return y}var af=class{constructor(a){this.obeyspaces=!1,this.pos=0,this.s=rf(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 hl(a,y){var b,E,ee,re;const ae=[];let de=a.next();if(de&&de!=="\\relax"){if(de==="\\noexpand")de=a.next(),de&&ae.push(de);else if(de==="\\obeyspaces")a.obeyspaces=!0;else if(de==="\\bgroup")ae.push("<{>");else if(de==="\\egroup")ae.push("<}>");else if(de==="\\string"){if(de=a.next(),de)if(de.startsWith("\\"))for(const ge of de)ae.push(ge==="\\"?"\\backslash":ge);else de==="<{>"?ae.push("\\{"):de==="<space>"?ae.push("~"):de==="<}>"&&ae.push("\\}")}else if(de==="\\csname"){for(;a.peek()==="<space>";)a.next();let ge="",be=!1,Ce=[];do{if(Ce.length===0)if(/^#[\d?@]$/.test(a.peek())){const $e=a.get().slice(1);Ce=nl((E=(b=y==null?void 0:y($e))!=null?b:y==null?void 0:y("?"))!=null?E:"\\placeholder{}",y),de=Ce[0]}else de=a.next(),Ce=de?[de]:[];be=Ce.length===0,!be&&de==="\\endcsname"&&(be=!0,Ce.shift()),be||(be=de==="<$>"||de==="<$$>"||de==="<{>"||de==="<}>"||typeof de=="string"&&de.length>1&&de.startsWith("\\")),be||(ge+=Ce.shift())}while(!be);ge&&ae.push("\\"+ge),ae.push(...Ce)}else if(de!=="\\endcsname")if(de.length>1&&de.startsWith("#")){const ge=de.slice(1);ae.push(...nl((re=(ee=y==null?void 0:y(ge))!=null?ee:y==null?void 0:y("?"))!=null?re:"\\placeholder{}",y))}else ae.push(de)}return ae}function nl(a,y=null){const b=[];let E="";for(const ae of a.toString().split(/\r?\n/)){E&&b.push(E),E=" ";const de=ae.match(/((?:\\%)|[^%])*/);de!==null&&b.push(de[0])}const ee=new af(ot(b.join(""))),re=[];do re.push(...hl(ee,y));while(!ee.end());return re}function ya(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 uo(a,...y){return console.assert(a.startsWith("\\")),y.length===0?a:ya([a,...y.map(b=>`{${b}}`)])}function pl(a){return ya(a.map(y=>{var b;return(b={"<space>":" ","<$$>":"$$","<$>":"$","<{>":"{","<}>":"}"}[y])!=null?b:y}))}var of=class Zd{constructor(y){Zd._registry[y]=this}static createAtom(y,b,E){return Zd._registry[y].createAtom(b,$t(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 sf(y)){const ae=Zd._registry[re[0].mode];ee.push(...ae.serialize(re,b))}return ya(ee)}return ya(th(y,b))}static getFont(y,b,E){return Zd._registry[y].getFont(b,E)}};of._registry={};var Ss=of;function sf(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 Eo(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 rd(a,y){var b;const{parent:E}=a[0],ee=E==null?void 0:E.computedStyle.color,re=[];for(const ae of sf(a)){const de=y.defaultMode;for(const ge of Eo(ae,"color")){const be=ge[0].computedStyle,Ce=Ss._registry[ge[0].mode].serialize(ge,me(Se({},y),{defaultMode:de==="text"?"text":"math"}));!y.skipStyles&&be.color&&be.color!=="none"&&(!E||ee!==be.color)?re.push(uo("\\textcolor",(b=be.verbatimColor)!=null?b:be.color,ya(Ce))):re.push(ya(Ce))}}return re}function eh(a,y){const{parent:b}=a[0],E=b==null?void 0:b.computedStyle.backgroundColor;return Eo(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 uo("\\colorbox",(re=ae.verbatimBackgroundColor)!=null?re:ae.backgroundColor,ya(rd(ee,me(Se({},y),{defaultMode:"text"}))))}return ya(rd(ee,y))})}function th(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 Eo(a,"fontSize")){const ae=re[0].computedStyle.fontSize,de=eh(re,y);de&&(ae&&ae!=="auto"&&(!b||E!==ae)?ee.push(["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][ae],...de):ee.push(...de))}return ee}function id(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 rc(a){if(a.length===0)return"ord";const y=id(a[0].type),b=id(a[a.length-1].type);return y&&y===b?y:"ord"}function ic(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 Tr=class Mp{constructor(y,b){var E,ee,re,ae,de;if(typeof y=="number"?this.value=String.fromCodePoint(y):typeof y=="string"?this.value=y:Be(y)?this.children=y.filter(be=>be!==null):y&&y instanceof Mp&&(this.children=[y]),this.children)for(const be of this.children)be.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 ge=b==null?void 0:b.fontFamily;b!=null&&b.style&&this.value&&(ge=(de=Ss.getFont((ae=b.mode)!=null?ae:"math",this,me(Se({variant:"normal"},b.style),{letterShapeStyle:b.letterShapeStyle})))!=null?de:void 0),ge||(ge="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,ge)}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=ic(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=ic(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"]=ic(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"]=ic(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"]=ic(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=wr(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 gt of this.children)re+=gt.toMarkup();let ae="";if(this.svgBody)ae=ec(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 gt=(b=this.cssProperties)==null?void 0:b.padding;gt?(ae+=`top:${gt};`,ae+=`left:${gt};`,ae+=`width:calc(100% - 2 * ${gt} );`):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 de="";const ge=this.classes.split(" ");ge.push((E={latex:"ML__raw-latex",placeholder:"ML__placeholder",error:"ML__error"}[this.type])!=null?E:""),this.caret==="latex"&&ge.push("ML__latex-caret"),this.isSelected&&ge.push("ML__selected");const be=ge.length===1?ge[0]:ge.filter((gt,Et,_n)=>gt.length>0&&_n.indexOf(gt)===Et).join(" ");if(be.length>0&&(de+=` class="${be}"`),this.id&&(de+=` data-atom-id=${this.id}`),this.cssId&&(de+=` id="${this.cssId.replace(/ /g,"-")}" `),this.attributes&&(de+=" "+Object.keys(this.attributes).map(gt=>`${gt}="${this.attributes[gt]}"`).join(" ")),this.htmlData){const gt=this.htmlData.split(",");for(const Et of gt){const _n=Et.match(/([^=]+)=(.+$)/);if(_n){const kr=_n[1].trim().replace(/ /g,"-");kr&&(de+=` data-${kr}="${_n[2]}" `)}else{const kr=Et.trim().replace(/ /g,"-");kr&&(de+=` data-${kr} `)}}}const Ce=(ee=this.cssProperties)!=null?ee:{};this.hasExplicitWidth&&Ce.width===void 0&&(Ce.width=`${Math.ceil(this._width*100)/100}em`);const $e=Object.keys(Ce).map(gt=>`${gt}:${Ce[gt]}`);if(this.scale!==void 0&&this.scale!==1&&(re.length>0||ae.length>0)&&$e.push(`font-size: ${Math.ceil(this.scale*1e4)/100}%`),this.htmlStyle){const gt=this.htmlStyle.split(";");let Et="";for(const _n of gt){const kr=_n.match(/([^=]+):(.+$)/);if(kr){const wn=kr[1].trim().replace(/ /g,"-");wn&&(Et+=`${wn}:${kr[2]};`)}}Et&&(de+=` style="${Et}"`)}$e.length>0&&(de+=` style="${$e.join(";")}"`);let Ye="";return de.length>0||ae.length>0?Ye=`<span${de}>${re}${ae}</span>`:Ye=re,this.caret==="text"?Ye+='<span class="ML__text-caret"></span>':this.caret==="math"&&(Ye+='<span class="ML__caret"></span>'),Ye}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 ge of["border","border-left","border-right","border-right-width","left","margin","margin-left","margin-right","padding","position","width"])if(y.cssProperties&&ge in y.cssProperties||this.cssProperties&&ge 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 ge of Object.keys(this.cssProperties))if(this.cssProperties[ge]!==y.cssProperties[ge])return!1}const ae=this.classes.trim().replace(/\s+/g," ").split(" "),de=y.classes.trim().replace(/\s+/g," ").split(" ");if(ae.length!==de.length)return!1;ae.sort(),de.sort();for(const[ge,be]of ae.entries())if(be==="vertical-separator"||be!==de[ge])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 ad(a){if(!a||a.length===0)return[];a[0].children=ad(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=ad(a[b].children),y.push(a[b]));return y}function gu(a){return a.children&&(a.children=ad(a.children)),a}function vu(a,y){if(!a)return new Tr(null,y);const b=new Tr(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 Tr(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 Tr(E,me(Se({},y),{type:"lift"}))}function Os(a){const y=ef(a)/2,b=new Tr(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=tl(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,de)=>ae+de.width,0),a.maxFontSize=re}}function yu(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 de=y[ae],ge=-de.shift-re-de.box.depth,be=ge-(b.box.height+b.box.depth);re=re+ge,E.push(be),E.push(de),b=de}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 Tc(a){var y;const[b,E]=yu(a);if(!b)return[[],0,0];const ee=new Tr(null,{classes:"pstrut"});let re=0;for(const Et of b)if(typeof Et!="number"){const _n=Et.box;re=Math.max(re,_n.maxFontSize,_n.height)}re+=2,ee.height=re,ee.setStyle("height",re,"em");const ae=[];let de=E,ge=E,be=E,Ce=0;for(const Et of b){if(typeof Et=="number")be+=Et;else{const _n=Et.box,kr=(y=Et.classes)!=null?y:[],wn=new Tr([ee,_n],{classes:kr.join(" "),style:Et.style});_n.setStyle("height",_n.height+_n.depth,"em"),_n.setStyle("display","inline-block"),wn.setStyle("top",-re-be-_n.depth,"em"),Et.marginLeft&&wn.setStyle("margin-left",Et.marginLeft,"em"),Et.marginRight&&wn.setStyle("margin-right",Et.marginRight,"em"),ae.push(wn),be+=_n.height+_n.depth,Ce=Math.max(Ce,wn.width)}de=Math.min(de,be),ge=Math.max(ge,be)}ae.forEach(Et=>{Et.softWidth=Ce});const $e=new Tr(ae,{classes:"vlist"});if($e.softWidth=Ce,$e.height=ge,$e.setStyle("height",ge,"em"),de>=0)return[[new Tr($e,{classes:"vlist-r"})],ge,-de];const Ye=new Tr(new Tr(null),{classes:"vlist"});Ye.height=-de,Ye.setStyle("height",-de,"em");const gt=new Tr(8203,{classes:"vlist-s",maxFontSize:0});return gt.softWidth=0,gt.height=0,gt.depth=0,[[new Tr([$e,gt],{classes:"vlist-r"}),new Tr(Ye,{classes:"vlist-r"})],ge,-de]}var Qa=class extends Tr{constructor(a,y){var b;const[E,ee,re]=Tc(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,de)=>Math.max(ae,de.width),0)}};function nh(a,y){var b,E,ee,re,ae;const de=a.metrics,ge=new Tr(y.base),be=(b=y.baseShift)!=null?b:0,Ce=(E=y.slant)!=null?E:0;let $e=0,Ye=0;y.above&&($e=(ee=y.aboveShift)!=null?ee:Math.max(de.bigOpSpacing1,de.bigOpSpacing3-y.above.depth)),y.below&&(Ye=(re=y.belowShift)!=null?re:Math.max(de.bigOpSpacing2,de.bigOpSpacing4-y.below.height));let gt=null;if(y.below&&y.above){const Et=de.bigOpSpacing5+y.below.height+y.below.depth+Ye+ge.depth+be;gt=new Qa({bottom:Et,children:[de.bigOpSpacing5,{box:y.below,marginLeft:-Ce,classes:["ML__center"]},Ye,{box:ge,classes:["ML__center"]},$e,{box:y.above,marginLeft:Ce,classes:["ML__center"]},de.bigOpSpacing5]}).wrap(a)}else if(y.below&&!y.above)gt=new Qa({top:ge.height-be,children:[de.bigOpSpacing5,{box:y.below,marginLeft:-Ce,classes:["ML__center"]},Ye,{box:ge,classes:["ML__center"]}]}).wrap(a);else if(!y.below&&y.above){const Et=ge.depth+be;gt=new Qa({bottom:Et,children:[{box:ge,classes:["ML__center"]},$e,{box:y.above,marginLeft:Ce,classes:["ML__center"]},de.bigOpSpacing5]}).wrap(a)}else{const Et=ge.depth+be;gt=new Qa({bottom:Et,children:[{box:ge},de.bigOpSpacing5]}).wrap(a)}return new Tr(gt,{type:(ae=y.type)!=null?ae:"op"})}var od=7,rl=6,Dc=5,ml=4,zl=3,ss=2,ks=1,jo=0,Ws=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(td).reduce((ee,re)=>me(Se({},ee),{[re]:td[re][E]}),{})}getFontSize(a){return Math.max(1,a+this.sizeDelta)}get sup(){return Zs[[jo,ks,jo,ks,ss,zl,ss,zl][this.id]]}get sub(){return Zs[[jo,jo,jo,jo,ss,ss,ss,ss][this.id]]}get fracNum(){return Zs[[jo,ks,jo,ks,ss,zl,ml,Dc][this.id]]}get fracDen(){return Zs[[jo,jo,jo,jo,ss,ss,ml,ml][this.id]]}get cramp(){return Zs[[jo,jo,ss,ss,ml,ml,rl,rl][this.id]]}get isTight(){return this.sizeDelta<0}},Kl={7:new Ws(od,0,!1),6:new Ws(rl,0,!0),5:new Ws(Dc,0,!1),4:new Ws(ml,0,!0),3:new Ws(zl,-3,!1),2:new Ws(ss,-3,!0),1:new Ws(ks,-4,!1),0:new Ws(jo,-4,!0)},Zs=me(Se({},Kl),{displaystyle:Kl[od],textstyle:Kl[Dc],scriptstyle:Kl[zl],scriptscriptstyle:Kl[ks]});function ac(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:$l,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=Il(10,y);return Math.round(a.dimension/$l*E*ee)/ee}return a.dimension*E}function sd(a,y){if(a===null)return 0;const b=ac(a)/$l;if(Number.isFinite(y)){const E=Il(10,y);return Math.round(b*E)/E}return b}function ld(a){var y;return`${a.dimension}${(y=a.unit)!=null?y:"pt"}`}function lf(a){let y=ld(a.glue);return a.grow&&a.grow.dimension!==0&&(y+=` plus ${ld(a.grow)}`),a.shrink&&a.shrink.dimension!==0&&(y+=` minus ${ld(a.shrink)}`),y}function Do(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=lf(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 Us(a,y){return a==null?null:"number"in a?me(Se({},a),{number:a.number*y}):"register"in a?"factor"in a&&a.factor?me(Se({},a),{factor:a.factor*y}):me(Se({},a),{factor:y}):"dimension"in a?me(Se({},a),{dimension:a.dimension*y}):"glue"in a?a.shrink&&a.grow?{glue:Us(a.glue,y),shrink:Us(a.shrink,y),grow:Us(a.grow,y)}:a.shrink?{glue:Us(a.glue,y),shrink:Us(a.shrink,y)}:a.grow?{glue:Us(a.glue,y),grow:Us(a.grow,y)}:{glue:Us(a.glue,y)}:null}var rh={"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 oc(){return Se({},rh)}function bu(){return{registers:oc(),smartFence:!1,renderPlaceholder:void 0,placeholderSymbol:"\u25A2",letterShapeStyle:rt.locale.startsWith("fr")?"french":"tex",minFontScale:0,colorMap:Dt,backgroundColorMap:qe,getMacro:a=>In(a,Vn())}}var La=class Ep{constructor(y,b){var E,ee,re,ae,de,ge,be,Ce,$e,Ye,gt,Et,_n,kr,wn;let rr;y!=null&&y.parent?(this.parent=y.parent,rr=y.parent,this.registers={}):(rr=Se(Se({},bu()),(E=y==null?void 0:y.from)!=null?E:{}),this.registers=rr.registers),rr.atomIdsSettings&&(this.atomIdsSettings=Se({},rr.atomIdsSettings)),this.renderPlaceholder=rr.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=rr.letterShapeStyle,this.minFontScale=rr.minFontScale,b!=null&&b.color&&b.color!=="none"?this.color=b.color:this.color=(ge=(de=this.parent)==null?void 0:de.color)!=null?ge:"",b!=null&&b.backgroundColor&&b.backgroundColor!=="none"?this.backgroundColor=b.backgroundColor:this.backgroundColor=(Ce=(be=this.parent)==null?void 0:be.backgroundColor)!=null?Ce:"",b!=null&&b.fontSize&&b.fontSize!=="auto"&&b.fontSize!==(($e=this.parent)==null?void 0:$e.size)?this.size=b.fontSize:this.size=(gt=(Ye=this.parent)==null?void 0:Ye.size)!=null?gt:dl;let Ir=(_n=(Et=this.parent)==null?void 0:Et.mathstyle)!=null?_n:Zs.displaystyle;if(typeof(y==null?void 0:y.mathstyle)=="string"){if(rr instanceof Ep)switch(y.mathstyle){case"cramp":Ir=Ir.cramp;break;case"superscript":Ir=Ir.sup;break;case"subscript":Ir=Ir.sub;break;case"numerator":Ir=Ir.fracNum;break;case"denominator":Ir=Ir.fracDen;break}switch(y.mathstyle){case"textstyle":Ir=Zs.textstyle;break;case"displaystyle":Ir=Zs.displaystyle;break;case"scriptstyle":Ir=Zs.scriptstyle;break;case"scriptscriptstyle":Ir=Zs.scriptscriptstyle;break;case"":case"auto":break}}this.mathstyle=Ir,this.smartFence=rr.smartFence,this.placeholderSymbol=rr.placeholderSymbol,this.colorMap=(kr=rr.colorMap)!=null?kr:dr=>dr,this.backgroundColorMap=(wn=rr.backgroundColorMap)!=null?wn:dr=>dr,this.getMacro=rr.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===od||this.mathstyle.id===rl}get isCramped(){return this.mathstyle.cramped}get isTight(){return this.mathstyle.isTight}get metrics(){return this.mathstyle.metrics}get effectiveFontSize(){return Math.max(pu[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 sd(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?me(Se({},re),{dimension:E*re.dimension}):"glue"in re?me(Se({},re),{glue:me(Se({},re.glue),{dimension:E*re.glue.dimension}),shrink:re.shrink?me(Se({},re.shrink),{dimension:E*re.shrink.dimension}):void 0,grow:re.grow?me(Se({},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:ac(E,b)/$l}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}},sc=["body","above","below","superscript","subscript"];function il(a){return typeof a=="string"&&sc.includes(a)}function Ic(a){return a!==void 0&&Array.isArray(a)&&a.length===2}var Un=class Vl{constructor(y){var b,E,ee,re,ae,de;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=Se({},y.style),this.displayContainsHighlight=(re=y.displayContainsHighlight)!=null?re:!1,this.captureSelection=(ae=y.captureSelection)!=null?ae:!1,this.skipBoundary=(de=y.skipBoundary)!=null?de:!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=cf(b),ae=[];for(const ge of re){const be=ge[0].style,Ce=uf(y,ge,{style:{color:be.color,backgroundColor:be.backgroundColor,fontSize:be.fontSize}});Ce&&ae.push(Ce)}if(ae.length===0)return null;const de=((ee=E==null?void 0:E.classes)!=null?ee:"").trim();return ae.length===1&&!de&&!(E!=null&&E.type)?ae[0].wrap(y):new Tr(ae,{classes:de,type:E==null?void 0:E.type}).wrap(y)}static serialize(y,b){return Ss.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=Se({},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=ud(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=$t(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):this.body&&this.command?ya([uo(this.command,this.bodyToLatex(y)),this.supsubToLatex(y)]):this.body?ya([this.bodyToLatex(y),this.supsubToLatex(y)]):!this.value||this.value==="\u200B"?"":this.command}bodyToLatex(y){var b;return Ss.serialize(this.body,me(Se({},y),{defaultMode:(b=y.defaultMode)!=null?b:this.latexMode}))}aboveToLatex(y){return Ss.serialize(this.above,y)}belowToLatex(y){return Ss.serialize(this.below,y)}supsubToLatex(y){let b="";if(y=me(Se({},y),{defaultMode:"math"}),this.branch("subscript")!==void 0){const E=Ss.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=Ss.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(il(y)&&this._branches)return this._branches[y]}get branches(){if(!this._branches)return[];const y=[];for(const b of sc)this._branches[b]&&y.push(b);return y}createBranch(y){return console.assert(il(y)),il(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 Ic(this.parentBranch)?this.parentBranch[0]:-1}get col(){return Ic(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=Se(Se({},(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=Se(Se({},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(il(b)),!il(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(il(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 sc)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=$t(this.command,this.mode);if(b!=null&&b.render)return b.render(this,y);const E=new La({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 de=null,ge=null;const be=(E=b.isCharacterBox)!=null?E:this.isCharacterBox();let Ce=0;if(re){const _n=new La({parent:y,mathstyle:"superscript"});de=Vl.createBox(_n,re),be||(Ce=ee.height-y.metrics.supDrop*_n.scalingFactor)}let $e=0;if(ae){const _n=new La({parent:y,mathstyle:"subscript"});ge=Vl.createBox(_n,ae),be||($e=ee.depth+y.metrics.subDrop*_n.scalingFactor)}let Ye;y.isDisplayStyle?Ye=y.metrics.sup1:y.isCramped?Ye=y.metrics.sup3:Ye=y.metrics.sup2;const gt=.5/$l/y.scalingFactor;let Et=null;if(ge&&de){Ce=Math.max(Ce,Ye,de.depth+.25*y.metrics.xHeight),$e=Math.max($e,y.metrics.sub2);const _n=y.metrics.defaultRuleThickness;if(Ce-de.depth-(ge.height-$e)<4*_n){$e=4*_n-(Ce-de.depth)+ge.height;const wn=.8*y.metrics.xHeight-(Ce-de.depth);wn>0&&(Ce+=wn,$e-=wn)}const kr=this.isExtensibleSymbol&&ee.italic?-ee.italic:0;Et=new Qa({individualShift:[{box:ge,shift:$e,marginLeft:kr},{box:de,shift:-Ce}]}).wrap(y)}else ge&&!de?($e=Math.max($e,y.metrics.sub1,ge.height-.8*el),Et=new Qa({shift:$e,children:[{box:ge,marginRight:gt,marginLeft:this.isCharacterBox()?-ee.italic:0}]})):!ge&&de&&(Ce=Math.max(Ce,Ye,de.depth+.25*el),Et=new Qa({shift:-Ce,children:[{box:de,marginRight:gt}]}));return new Tr([ee,new Tr(Et,{caret:this.caret,isSelected:this.isSelected,classes:"msubsup"})],{type:b.type})}attachLimits(y,b){const E=this.superscript?Vl.createBox(new La({parent:y,mathstyle:"superscript"},this.style),this.superscript):null,ee=this.subscript?Vl.createBox(new La({parent:y,mathstyle:"subscript"},this.style),this.subscript):null;return!E&&!ee?b.base.wrap(y):nh(y,me(Se({},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 de=(E=this.value)!=null?E:this.body,ge=(ee=b==null?void 0:b.boxType)!=null?ee:id(this.type);let be=(re=b==null?void 0:b.classes)!=null?re:"";this.mode==="text"&&(be+=" ML__text");const Ce=typeof de=="string"||de===void 0?new Tr(de!=null?de:null,{type:ge,isSelected:this.isSelected,mode:this.mode,maxFontSize:y.scalingFactor,style:me(Se({variant:"normal"},this.style),{fontSize:Math.max(1,y.size+y.mathstyle.sizeDelta)}),letterShapeStyle:y.letterShapeStyle,classes:be}):(ae=Vl.createBox(y,de,{type:ge,classes:be}))!=null?ae:new Tr(null);return y.isTight&&(Ce.isTight=!0),(this.mode!=="math"||this.style.variant==="main")&&(Ce.italic=0),Ce.right=Ce.italic,this.bind(y,Ce),this.caret&&!this.superscript&&!this.subscript&&(Ce.caret=this.caret),Ce}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 cf(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 uf(a,y,b){var E,ee,re,ae,de;if(!y||y.length===0)return null;const ge=new La({parent:a},b.style),be=!((E=ge.atomIdsSettings)!=null&&E.groupNumbers);let Ce=[];if(y.length===1){const Ye=y[0],gt=Ye.render(ge);gt&&(be&&Ye.isSelected&&gt.selected(!0),Ce=[gt])}else{let Ye="",gt=!0;for(const Et of y){(ee=ge.atomIdsSettings)!=null&&ee.groupNumbers&&Ye&&(gt&&Et.isDigit()||!gt&&cd(Et))&&(ge.atomIdsSettings.overrideID=Ye);const _n=Et.render(ge);ge.atomIdsSettings&&(ge.atomIdsSettings.overrideID=void 0),_n&&((re=ge.atomIdsSettings)!=null&&re.groupNumbers&&((Et.isDigit()||cd(Et))&&(!Ye||gt!==Et.isDigit())&&(gt=Et.isDigit(),Ye=(ae=Et.id)!=null?ae:""),Ye&&(!(Et.isDigit()||cd(Et))||!Et.hasEmptyBranch("superscript")||!Et.hasEmptyBranch("subscript"))&&(Ye="")),be&&Et.isSelected&&_n.selected(!0),Ce.push(_n))}}if(Ce.length===0)return null;const $e=new Tr(Ce,me(Se({isTight:ge.isTight},b),{type:(de=b.type)!=null?de:"lift"}));return $e.isSelected=Ce.every(Ye=>Ye.isSelected),$e.wrap(ge)}function cd(a){return a.mode==="text"}function ud(a){return a.map(y=>y===null?"<null>":Array.isArray(y)&&y[0]instanceof Un?{atoms:y.map(b=>b.toJson())}:typeof y=="object"&&"group"in y?{group:y.group.map(b=>b.toJson())}:y)}var al=class kp extends Un{constructor(y,b,E){super({type:"text",command:y,mode:"text",displayContainsHighlight:!0}),this.value=b,this.verbatimLatex=b,this.applyStyle(E)}static fromJson(y){return new kp(y.command,y.value,y.style)}render(y){const b=this.createBox(y);return this.caret&&(b.caret=this.caret),b}_serialize(y){var b;return(b=this.verbatimLatex)!=null?b:Jn("text",this.value.codePointAt(0))}};function Pc(a,y){if(a.direction===y.direction){const b=a.ranges.length;if(y.ranges.length===b){let E=0;for(;E<b&&ih(a.ranges[E],y.ranges[E])==="equal";)E++;return E===b?"equal":"different"}}return"different"}function ih(a,y){return a[0]===y[0]&&a[1]===y[1]?"equal":"different"}function Vo(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 gl(a){return typeof a=="number"&&!Number.isNaN(a)}function xu(a){return Array.isArray(a)&&a.length===2}function wu(a){return a!=null&&typeof a=="object"&&"ranges"in a&&Array.isArray(a.ranges)}function ah(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 df(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,de=!1,ge=!1,be=!1,Ce=!1,$e=!1,Ye=!1,gt=!1,Et=!1,_n=!1,kr=!1,wn=a[0],rr=0;for(;wn!=null&&wn.type&&/^(subsup|placeholder)$/.test(wn.type);)rr+=1,wn=a[rr];return b=!wn||wn.type==="first",wn&&(_n=wn.mode==="text",E=!_n&&wn.type==="mord"&&pe.test(wn.value),ee=!_n&&wn.type==="mord"&&/\d+$/.test(wn.value),re=!_n&&wn.isFunction,ae=wn.type==="genfrac",de=wn.type==="surd",ge=wn.type==="mbin",be=wn.type==="mrel",Ce=wn.type==="mop"||wn.type==="operator"||wn.type==="extensible-symbol",$e=wn.type==="mpunct"||wn.type==="minner",Ye=wn.type==="array",gt=wn.type==="mopen",Et=wn.type==="mclose"||wn.type==="leftright",kr=wn.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")&&de||y.after.includes("binop")&&ge||y.after.includes("relop")&&be||y.after.includes("operator")&&Ce||y.after.includes("punct")&&$e||y.after.includes("array")&&Ye||y.after.includes("openfence")&&gt||y.after.includes("closefence")&&Et||y.after.includes("text")&&_n||y.after.includes("space")&&kr?y.value:""}function dd(a,y,b){return b?df(a,b[y]):""}var ff={"&":"\\&","%":"\\%",$:"\\$","''":"^{\\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 Oc(a,y){var b;let E=(b=y==null?void 0:y.format)!=null?b:"auto";return E==="auto"&&([E,a]=pf(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",ts(a,{inlineShortcuts:y==null?void 0:y.inlineShortcuts})]):["latex",a]}function ts(a,y){var b,E,ee;if(!a)return"";let re=!1,ae;const de=(b=y.inlineShortcuts)!=null?b:ff;if(!re&&(a.startsWith("^")||a.startsWith("_"))&&(ae=vl(a.slice(1),{inlineShortcuts:de,noWrap:!0}),a=a[0]+"{"+ae.match+"}",a+=ts(ae.rest,y),re=!0),re||(ae=a.match(/^(sqrt|\u221A)(.*)/),ae&&(ae=vl(ae[2],{inlineShortcuts:de,noWrap:!0}),a="\\sqrt{"+((E=ae.match)!=null?E:"\\placeholder{}")+"}",a+=ts(ae.rest,y),re=!0)),re||(ae=a.match(/^(\\cbrt|\u221B)(.*)/),ae&&(ae=vl(ae[2],{inlineShortcuts:de,noWrap:!0}),a="\\sqrt[3]{"+((ee=ae.match)!=null?ee:"\\placeholder{}")+"}",a+=ts(ae.rest,y),re=!0)),re||(ae=a.match(/^abs(.*)/),ae&&(ae=vl(ae[1],{inlineShortcuts:de,noWrap:!0}),a="\\left|"+ae.match+"\\right|",a+=ts(ae.rest,y),re=!0)),re||(ae=a.match(/^["”“](.*?)["”“](.*)/),ae&&(a="\\text{"+ae[1]+"}",a+=ts(ae[2],y),re=!0)),re||(ae=a.match(/^([^a-zA-Z\(\{\[\_\^\\\s"]+)(.*)/),ae&&(a=hf(ae[1],de),a+=ts(ae[2],y),re=!0)),!re&&/^([fgh])[^a-zA-Z]/.test(a)&&(ae=vl(a.slice(1),{inlineShortcuts:de,noWrap:!0}),a=a[1]==="("?a[0]+"\\left("+ae.match+"\\right)":a[0]+ae.match,a+=ts(ae.rest,y),re=!0),re||(ae=a.match(/^([a-zA-Z]+)(.*)/),ae&&(a=hf(ae[1],de),a+=ts(ae[2],y),re=!0)),!re)if(ae=vl(a,{inlineShortcuts:de,noWrap:!0}),ae.match&&ae.rest[0]==="/"){const ge=vl(ae.rest.slice(1),{inlineShortcuts:de,noWrap:!0});ge.match&&(a="\\frac{"+ae.match+"}{"+ge.match+"}"+ts(ge.rest,y)),re=!0}else ae.match&&(a=a.startsWith("(")?"\\left("+ae.match+"\\right)"+ts(ae.rest,y):ae.match+ts(ae.rest,y),re=!0);return re||(ae=a.match(/^(\s+)(.*)$/),ae&&(a=" "+ts(ae[2],y),re=!0)),a}function vl(a,y){let b="";a=a.trim();let E=a,ee=a.charAt(0),re={"(":")","{":"}","[":"]"}[ee];if(re){let ae=1,de=1;for(;de<a.length&&ae>0;)a[de]===ee&&ae++,a[de]===re&&ae--,de++;ae===0?(y.noWrap&&ee==="("?b=ts(a.substring(1,de-1),y):(ee==="{"&&re==="}"&&(ee="\\{",re="\\}"),b="\\left"+ee+ts(a.substring(1,de-1),y)+"\\right"+re),E=a.slice(Math.max(0,de))):(b=a.substring(1,de),E="")}else{let ae=a.match(/^([a-zA-Z]+)/);if(ae){let de=dd(null,a,y.inlineShortcuts);if(de)return de=de.replace("_{#?}",""),de=de.replace("^{#?}",""),{match:de,rest:a.slice(de.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 hf(a,y){let b=dd(null,a,y);return b?(b=b.replace("_{#?}",""),b=b.replace("^{#?}",""),b+=" "):b=a,b}var fd=[["\\[","\\]"],["\\(","\\)"],["$$","$$"],["$","$"],["\\begin{math}","\\end{math}"],["\\begin{displaymath}","\\end{displaymath}"],["\\begin{equation}","\\end{equation}"],["\\begin{equation*}","\\end{equation*}"]];function yl(a){const y=a.trim();for(const b of fd)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 pf(a){if(a=a.trim(),a.length<=1)return["latex",a];let y;return[y,a]=yl(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 Su="$$",oh="$$",sh=(a,y,b)=>(fd.some(E=>y.startsWith(E[0])&&y.endsWith(E[1]))||(y=`${Su} ${y} ${oh}`),y),mf=class Qf{constructor(y){Qf._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)?Qf._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]:Vo(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]:Vo(ee.selection);let ae=ee.getAtoms(re);if(ae.every(de=>de.mode==="text"||!de.mode))b.clipboardData.setData("text/plain",ae.filter(de=>de instanceof al).map(de=>de.value).join(""));else if(ae.every(de=>de.mode==="latex"))b.clipboardData.setData("text/plain",ee.getAtoms(re,{includeChildren:!0}).map(de=>{var ge;return(ge=de.value)!=null?ge:""}).join(""));else{let de;ae.length===1&&ae[0].verbatimLatex!==void 0?de=ae[0].verbatimLatex:de=ee.getValue(re,"latex-expanded"),b.clipboardData.setData("application/x-latex",de);try{b.clipboardData.setData("text/plain",y.options.onExport(y,de,re))}catch(ge){}if(ae.length===1){const ge=ae[0];(ge.type==="root"||ge.type==="group")&&(ae=ge.body.filter(be=>be.type!=="first"))}try{b.clipboardData.setData("application/json+mathlive",JSON.stringify(ae.map(ge=>ge.toJson())))}catch(ge){}if((E=window[Symbol.for("io.cortexjs.compute-engine")])!=null&&E.ComputeEngine){const ge=window.MathfieldElement.computeEngine;if(ge)try{const be=ge.jsonSerializationOptions;ge.jsonSerializationOptions={metadata:["latex"]};const Ce=ge.parse(ee.getValue(re,"latex-unstyled"));ge.jsonSerializationOptions=be;const $e=JSON.stringify(Ce.json);$e&&b.clipboardData.setData("application/json",$e)}catch(be){}}}b.preventDefault()}static insert(y,b,E={}){var ee;const re=E.mode==="auto"?y.mode:(ee=E.mode)!=null?ee:y.mode;return Qf._modes[re].insert(y,b,E)}onPaste(y,b){return!1}insert(y,b,E){return!1}};mf._modes={};var ia=mf,lh=[{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","^"]}],hd={"\\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 Bs(a){var y;return((y=a.element)==null?void 0:y.mathfield)===a}function Rs(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 bl(a){const y=Rs(a);if(!y)return null;const b=y.getBoundingClientRect();return{x:b.right,y:b.bottom,height:b.height}}function pd(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 md(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),de=Math.ceil(y.top-E.top);return{left:ae,right:ae+ee,top:de,bottom:de+re}}function gd(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=gd(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 lc(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?gd(re):null,a.atomBoundsCache&&(ee?a.atomBoundsCache.set(y.id,ee):a.atomBoundsCache.delete(y.id)),ee!=null?ee:null}function gf(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 ge=Math.floor(re.getBoundingClientRect().width)/ae;ge=isNaN(ge)?1:ge;const be=md(a,lc(a,ee),ge);if(be){const Ce=pd(ee);if(E.has(Ce)){const $e=E.get(Ce);E.set(Ce,{left:Math.min($e.left,be.left),right:Math.max($e.right,be.right),top:Math.min($e.top,be.top),bottom:Math.max($e.bottom,be.bottom)})}else E.set(Ce,be)}}return[...E.values()]}function vd(a,y){return a.model.selection.ranges.reduce((b,E)=>b.concat(...gf(a,E,y)),[])}function yd(a,y){return a==="*"||y==="none"?!0:y==="same-origin"?!window.origin||a===window.origin:typeof y=="function"?y(a):!1}function Cu(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 vf=`@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;
}
`,Ya=`.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);
}
`,yf=`#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);
}
`,ch=`/* 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;
}
`,cc=`/* 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);*/
}
`,uh=`.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));
}
`,Mu=`: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;
}
`,dh=`.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;
}
`,eo;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=Ya;break;case"mathfield":y=vf;break;case"environment-popover":y=yf;break;case"suggestion-popover":y=ch;break;case"keystroke-caption":y=cc;break;case"virtual-keyboard":y=uh;break;case"ui":y=Mu;break;case"menu":y=dh;break;default:debugger}return y}function uc(a){return eo||(eo={}),eo[a]||(eo[a]=new CSSStyleSheet,eo[a].replaceSync(Hl(a))),eo[a]}var ol;function _s(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(ol||(ol={}),((y=ol[a])!=null?y:0)!==0)ol[a]+=1;else{const b=uc(a);document.adoptedStyleSheets=[...document.adoptedStyleSheets,b],ol[a]=1}}function x(a){if("adoptedStyleSheets"in document&&ol!=null&&ol[a]&&(ol[a]-=1,ol[a]<=0)){const y=eo[a];document.adoptedStyleSheets=document.adoptedStyleSheets.filter(b=>b!==y)}}var z=class _p extends Un{constructor(y){var b;super(me(Se({},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 _p(y)}toJson(){return me(Se({},super.toJson()),{accentChar:this.accent,svgAccent:this.svgAccent})}render(y){var b;const E=new La({parent:y,mathstyle:"cramp"},this.style),ee=(b=Un.createBox(E,this.body))!=null?b:new Tr("\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,el),de;if(this.svgAccent)de=Os(this.svgAccent),ae=E.metrics.bigOpSpacing1-ae;else if(this.accent){const be=new Tr(this.accent,{fontFamily:"Main-Regular"});be.italic=0;const Ce=this.accent===8407?" ML__accent-vec":"";de=new Tr(new Tr(be),{classes:"ML__accent-body"+Ce})}de=new Qa({shift:0,children:[{box:new Tr(ee)},-ae,{box:de,marginLeft:ee.left+2*re,classes:["ML__center"]}]});const ge=new Tr(de,{type:"lift"});return this.caret&&(ge.caret=this.caret),this.bind(E,ge.wrap(E)),this.attachSupsub(E,{base:ge})}},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 ce(a,y,b,E){var ee;const ae=new Tr(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)*os),ae}function ye(a,y,b,E,ee){var re,ae;const de=new La({parent:E,mathstyle:"textstyle"},ee==null?void 0:ee.style),ge=new Tr(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(de);return b&&ge.setTop((1-de.scalingFactor)*os),ge}function Me(a,y,b,E,ee){var re;let ae,de,ge,be;ae=ge=be=ie(a),de=null;let Ce="Size1-Regular";a==="\\vert"||a==="\\lvert"||a==="\\rvert"||a==="\\mvert"||a==="\\mid"?ge=ae=be=8739:a==="\\Vert"||a==="\\lVert"||a==="\\rVert"||a==="\\mVert"||a==="\\|"?ge=ae=be=8741:a==="\\uparrow"?ge=be=9168:a==="\\Uparrow"?ge=be=8214:a==="\\downarrow"?ae=ge=9168:a==="\\Downarrow"?ae=ge=8214:a==="\\updownarrow"?(ae=8593,ge=9168,be=8595):a==="\\Updownarrow"?(ae=8657,ge=8214,be=8659):a==="["||a==="\\lbrack"?(ae=9121,ge=9122,be=9123,Ce="Size4-Regular"):a==="]"||a==="\\rbrack"?(ae=9124,ge=9125,be=9126,Ce="Size4-Regular"):a==="\\lfloor"||a==="\u230A"?(ge=ae=9122,be=9123,Ce="Size4-Regular"):a==="\\lceil"||a==="\u2308"?(ae=9121,ge=be=9122,Ce="Size4-Regular"):a==="\\rfloor"||a==="\u230B"?(ge=ae=9125,be=9126,Ce="Size4-Regular"):a==="\\rceil"||a==="\u2309"?(ae=9124,ge=be=9125,Ce="Size4-Regular"):a==="("||a==="\\lparen"?(ae=9115,ge=9116,be=9117,Ce="Size4-Regular"):a===")"||a==="\\rparen"?(ae=9118,ge=9119,be=9120,Ce="Size4-Regular"):a==="\\{"||a==="\\lbrace"?(ae=9127,de=9128,be=9129,ge=9130,Ce="Size4-Regular"):a==="\\}"||a==="\\rbrace"?(ae=9131,de=9132,be=9133,ge=9130,Ce="Size4-Regular"):a==="\\lgroup"||a==="\u27EE"?(ae=9127,be=9129,ge=9130,Ce="Size4-Regular"):a==="\\rgroup"||a==="\u27EF"?(ae=9131,be=9133,ge=9130,Ce="Size4-Regular"):a==="\\lmoustache"||a==="\u23B0"?(ae=9127,be=9133,ge=9130,Ce="Size4-Regular"):a==="\\rmoustache"||a==="\u23B1"?(ae=9131,be=9129,ge=9130,Ce="Size4-Regular"):a==="\\surd"?(ae=57345,be=9143,ge=57344,Ce="Size4-Regular"):a==="\\ulcorner"?(ae=9484,ge=be=32):a==="\\urcorner"?(ae=9488,ge=be=32):a==="\\llcorner"?(be=9492,ge=ae=32):a==="\\lrcorner"&&(ae=9496,ge=ae=32);const $e=tl(ae,Ce),Ye=$e.height+$e.depth,gt=tl(ge,Ce),Et=gt.height+gt.depth,_n=tl(be,Ce),kr=_n.height+_n.depth;let wn=0,rr=1;if(de!==null){const qo=tl(de,Ce);wn=qo.height+qo.depth,rr=2}const Ir=Ye+kr+wn,dr=Math.max(0,Math.ceil((y-Ir)/(rr*Et))),ci=Ir+dr*rr*Et;let Ii=os;b&&(Ii=Ii*E.scalingFactor);const bi=ci/2-Ii,Pa=.008,qa=[];qa.push({box:new Tr(be,{fontFamily:Ce})}),qa.push(-Pa);const zr=new Tr(ge,{fontFamily:Ce});if(de===null)for(let qo=0;qo<dr;qo++)qa.push({box:zr});else{for(let qo=0;qo<dr;qo++)qa.push({box:zr});qa.push(-Pa),qa.push({box:new Tr(de,{fontFamily:Ce})}),qa.push(-Pa);for(let qo=0;qo<dr;qo++)qa.push({box:zr})}qa.push(-Pa),qa.push({box:new Tr(ae,{fontFamily:Ce})});let Fs="";Ce==="Size1-Regular"?Fs=" delim-size1":Ce==="Size4-Regular"&&(Fs=" delim-size4");const _l=new Qa({bottom:bi,children:qa},{classes:Fs});return new Tr(_l,me(Se({},ee!=null?ee:{}),{classes:((re=ee==null?void 0:ee.classes)!=null?re:"")+" ML__delim-mult"}))}var Te=new Set(["(",")","\\lparen","\\rparen","[","]","\\lbrack","\\rbrack","\\{","\\}","\\lbrace","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd","\u230A","\u230B","\u2308","\u2309"]),Ne=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache","\u27EE","\u27EF","\u23B0","\u23B1"]),pt=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),kt=[0,1.2,1.8,2.4,3];function hn(a,y,b,E){return a===void 0||a==="."?ai(b,E.classes):(a==="<"||a==="\\lt"||a==="\u27E8"?a="\\langle":(a===">"||a==="\\gt"||a==="\u27E9")&&(a="\\rangle"),Te.has(a)||pt.has(a)?ye(a,y,!1,b,E):Ne.has(a)?Me(a,kt[y],!1,b,E):(console.assert(!1,"Unknown delimiter '"+a+"'"),null))}var en=[{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}],Yn=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"stack"}],mr=[{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 Br(a){return a.type==="small"?"Main-Regular":a.type==="large"?"Size"+a.size+"-Regular":(console.assert(a.type==="stack"),"Size4-Regular")}function Gr(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=tl(a,Br(b[re]));if(ae.defaultMetrics)return{type:"small",mathstyle:"scriptstyle"};let de=ae.height+ae.depth;if(b[re].type==="small"&&(b[re].mathstyle==="scriptscriptstyle"?de*=Math.max(pu[Math.max(1,E.size-2)],E.minFontScale):b[re].mathstyle==="scriptstyle"&&(de*=Math.max(pu[Math.max(1,E.size-1)],E.minFontScale))),de>y)return b[re]}return b[b.length-1]}function ii(a,y,b,E,ee,re){if(!y||y.length===0||y===".")return ai(ee);y==="<"||y==="\\lt"?y="\\langle":(y===">"||y==="\\gt")&&(y="\\rangle");let ae;pt.has(y)?ae=en:Te.has(y)?ae=mr:ae=Yn;const de=Gr(ie(y),b,ae,ee),ge=new La({parent:ee,mathstyle:de.mathstyle},re==null?void 0:re.style);return de.type==="small"?ce(y,ge,E,me(Se({},re),{type:a})):de.type==="large"?ye(y,de.size,E,ge,me(Se({},re),{type:a})):(console.assert(de.type==="stack"),Me(y,b,E,ge,me(Se({},re),{type:a})))}function jr(a,y,b,E,ee,re){if(y===".")return ai(ee,re==null?void 0:re.classes);const ae=os*ee.scalingFactor,de=901,ge=5/$l,be=Math.max(b-ae,E+ae),Ce=Math.max(be/500*de,2*be-ge);return ii(a,y,Ce,!0,ee,re)}function ai(a,y){const b=new Tr(null,{classes:" nulldelimiter "+(y!=null?y:""),type:"ignore"});return b.width=a.getRegisterAsEm("nulldelimiterspace"),b.wrap(new La({parent:a,mathstyle:"textstyle"}))}var Fi=class Lp extends Un{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{}"}},Hi=["matrix","matrix*","pmatrix","pmatrix*","bmatrix","bmatrix*","Bmatrix","Bmatrix*","vmatrix","vmatrix*","Vmatrix","Vmatrix*"],ba=["cases","dcases","rcases"],to=["align","align*","aligned","gather","gathered","split"],Wo=["array","subequations","eqnarray"];function bo(a){return Wo.concat(to).concat(ba).concat(Hi).includes(a)}function us(a){return Hi.includes(a)}function ds(a){return ba.includes(a)}function Io(a){return to.includes(a)}function fs(a,y,b){let E=0;for(const be of b)"align"in be&&(E+=1);let ee=0;const re=[];for(const be of y){let Ce=0;for(ee=Math.max(ee,Math.min(be.length,E));Ce<be.length;){const $e=[],Ye=Math.min(be.length,Ce+E);for(;Ce<Ye;){const gt=be[Ce];gt.length===0?$e.push([new Un({type:"first",mode:a.mode})]):gt[0].type!=="first"?$e.push([new Un({type:"first",mode:a.mode}),...gt]):(console.assert(!gt.slice(1).some(Et=>Et.type==="first")),$e.push(gt)),Ce+=1}re.push($e)}}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 be of re){if(be.length!==ee)for(let Ce=be.length;Ce<ee;Ce++)be.push([new Un({type:"first",mode:a.mode}),new Fi]);ae.push(be)}let de=0,ge=0;for(const be of ae){ge=0;for(const Ce of be){for(const $e of Ce)$e.parent=a,$e.parentBranch=[de,ge];ge+=1}de+=1}return a.isDirty=!0,ae}var sa=class Ap extends Un{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=fs(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=me(Se({},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(Ic(y))return(b=this.array[y[0]][y[1]])!=null?b:void 0}createBranch(y){var b;return Ic(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(il(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,de;const ge=new La({parent:y,mathstyle:this.mathstyleName},this.style),be=ge.getRegisterAsEm("arrayrulewidth"),Ce=ge.getRegisterAsEm("arraycolsep"),$e=ge.getRegisterAsEm("doublerulesep"),Ye=(E=(b=this.arraystretch)!=null?b:ge.getRegisterAsNumber("arraystretch"))!=null?E:1;let gt=typeof this.arraycolsep=="number"?this.arraycolsep:Ce;this.colSeparationType==="small"&&(gt=.2778*(new La({parent:y,mathstyle:"scriptstyle"}).scalingFactor/y.scalingFactor));const Et=Ye*hu,_n=.7*Et,kr=.3*Et;let wn=0;const rr=[];let Ir=0;const dr=this.array.length;for(let ro=0;ro<dr;++ro){const Lo=this.array[ro];Ir=Math.max(Ir,Lo.length);const Jo=new La({parent:ge,mathstyle:this.mathstyleName},this.style);let Ll=_n/Jo.scalingFactor,Al=kr/Jo.scalingFactor;const Tl={cells:[],height:0,depth:0,pos:0};for(const cl of Lo){const e0=(ee=Un.createBox(Jo,cl,{type:"ignore"}))!=null?ee:new Tr(null,{type:"ignore"});Al=Math.max(Al,e0.depth),Ll=Math.max(Ll,e0.height),Tl.cells.push(e0)}let Dl=(re=sd(this.rowGaps[ro]))!=null?re:0;Dl>0&&(Dl+=kr,Al=Math.max(Al,Dl),Dl=0),ro<dr-1&&!us(this.environmentName)&&this.environmentName!=="cases"&&this.environmentName!=="array"&&(Al+=ge.getRegisterAsEm("jot")),Tl.height=Ll,Tl.depth=Al,wn+=Ll,Tl.pos=wn,wn+=Al+Dl,rr.push(Tl)}const ci=wn/2+os,Ii=[];for(let ro=0;ro<Ir;ro++){const Lo=[];for(const Jo of rr){const Ll=Jo.cells[ro];Ll.depth=Jo.depth,Ll.height=Jo.height,Lo.push({box:Ll,shift:Jo.pos-ci})}Lo.length>0&&Ii.push(new Qa({individualShift:Lo}))}const bi=[];let Pa=!1,qa=!1,zr=0,Fs=!this.leftDelim;const{colFormat:_l}=this;for(const ro of _l){if("align"in ro&&zr>=Ii.length)break;if("align"in ro)Pa?bi.push(xo(2*gt)):(qa||Fs)&&bi.push(xo(gt)),bi.push(new Tr(Ii[zr],{classes:"col-align-"+ro.align})),zr++,Pa=!0,qa=!1,Fs=!1;else if("gap"in ro){if(typeof ro.gap=="number")bi.push(xo(ro.gap));else{const Lo=Co(y,rr,ci,ro.gap);Lo&&bi.push(Lo)}Pa=!1,qa=!1,Fs=!1}else if("separator"in ro){const Lo=new Tr(null,{classes:"vertical-separator"});Lo.height=wn,Lo.setStyle("height",wn,"em"),Lo.setStyle("border-right",`${be}em ${ro.separator} currentColor`),Lo.setStyle("vertical-align",-(wn-ci),"em");let Jo=0;qa?Jo=$e-be:Pa&&(Jo=gt-be),Lo.left=Jo,bi.push(Lo),Pa=!1,qa=!0,Fs=!1}}Pa&&!this.rightDelim&&bi.push(xo(gt));const Xs=new Tr(bi,{classes:"mtable"});if((!this.leftDelim||this.leftDelim===".")&&(!this.rightDelim||this.rightDelim==="."))return this.caret&&(Xs.caret=this.caret),this.bind(y,Xs);const qo=Xs.height,zs=Xs.depth,Ms=this.bind(y,new Tr([this.bind(y,jr("open",(ae=this.leftDelim)!=null?ae:".",qo,zs,ge,{isSelected:this.isSelected})),Xs,this.bind(y,jr("close",(de=this.rightDelim)!=null?de:".",qo,zs,ge,{isSelected:this.isSelected}))],{type:"ord"}));return Ms?(Ms.setStyle("display","inline-block"),this.caret&&(Ms.caret=this.caret),this.bind(y,this.attachSupsub(y,{base:Ms}))):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(Un.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}}`),ya(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 Un({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(So(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(So(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,So(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,So(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 So(a){const y=new Un({type:"first",mode:a.mode});y.parent=a;const b=new Fi;return b.parent=a,[y,b]}function xo(a){const y=new Tr(null,{classes:"arraycolsep"});return y.width=a,y}function Co(a,y,b,E){if(!E)return null;const ee=[];for(const re of y){const ae=Un.createBox(a,E,{type:"ignore"});ae&&(ae.depth=re.depth,ae.height=re.height,ee.push({box:ae,shift:re.pos-b}))}return new Qa({individualShift:ee}).wrap(a)}var ko=class Tp extends Un{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 Tp(y)}toJson(){return me(Se({},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=Un.createBox(y,this.body,{type:"lift"});if(!ae)return null;const de=y.toEm((b=this.offset)!=null?b:{dimension:0});ae.depth+=de,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 ge=new La({parent:y},this.style),be=ge.toEm((E=this.padding)!=null?E:{register:"fboxsep"}),Ce=new Tr(null,{classes:"ML__box"});Ce.height=ae.height+be,Ce.depth=ae.depth+be,Ce.setStyle("box-sizing","border-box"),Ce.setStyle("position","absolute"),Ce.setStyle("top",-be+.3,"em"),Ce.setStyle("left",0),Ce.setStyle("height",Ce.height+Ce.depth,"em"),Ce.setStyle("width","100%"),this.backgroundcolor&&Ce.setStyle("background-color",(ee=ge.toColor(this.backgroundcolor))!=null?ee:"transparent"),this.framecolor&&Ce.setStyle("border",`${ge.getRegisterAsEm("fboxrule",2)}em solid ${(re=ge.toColor(this.framecolor))!=null?re:"black"}`),this.border&&Ce.setStyle("border",this.border);const $e=new Tr([Ce,ae],{type:"lift"});return $e.setStyle("display","inline-block"),$e.setStyle("position","relative"),$e.setStyle("line-height",0),$e.height=ae.height+be+(de>0?de:0),$e.depth=ae.depth+be+(de<0?-de:0),$e.setStyle("padding-left",be,"em"),$e.setStyle("padding-right",be,"em"),$e.setStyle("height",Math.floor(100*(ae.height+ae.depth+2*be+Math.abs(de)))/100,"em"),$e.setStyle("margin-top",-be,"em"),$e.setStyle("top",Math.floor(100*(ae.depth-ae.height+2*be-de))/100,"em"),$e.setStyle("vertical-align",Math.floor(100*(ae.depth+2*be))/100,"em"),this.caret&&($e.caret=this.caret),this.attachSupsub(y,{base:$e})}_serialize(y){return y.skipStyles?ya([this.bodyToLatex(y),this.supsubToLatex(y)]):super._serialize(y)}},Wl=class Dp extends Un{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 Dp(y.value,y)}toJson(){return super.toJson()}get computedStyle(){return{}}render(y){const b=new Tr(this.value,{classes:"ML__composition",type:"composition"});return this.bind(y,b),this.caret&&(b.caret=this.caret),b}_serialize(y){return""}},ys=class Ip extends Un{constructor(y){super({type:"error",value:y,command:y,mode:"math"}),this.verbatimLatex=y}static fromJson(y){return new Ip(y.command)}toJson(){return super.toJson()}render(y){const b=this.createBox(y,{classes:"ML__error"});return this.caret&&(b.caret=this.caret),b}},Go=class Pp extends Un{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 Pp(y.body,y.mode,y.style)}render(y){const b=Un.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=$t(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):`{${this.bodyToLatex(y)}}`}},Wa=class Op extends Un{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 Op((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"?ya(["\\left",(b=this.leftDelim)!=null?b:".",this.bodyToLatex(y),"\\right",ee]):this.variant==="mleft...mright"?ya(["\\mleft",(E=this.leftDelim)!=null?E:".",this.bodyToLatex(y),"\\mright",ee]):ya([!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 La({parent:y},this.style);console.assert(this.body!==void 0);const re=new La({parent:y,mathstyle:"textstyle"},this.style),ae=(b=Un.createBox(ee,this.body,{type:"inner"}))!=null?b:new Tr(null,{type:"inner"}),de=ae.height/re.scalingFactor,ge=ae.depth/re.scalingFactor,be=[];if(this.leftDelim&&be.push(this.bind(re,jr("open",this.leftDelim,de,ge,re,{isSelected:this.isSelected,classes:"ML__open"+(this.containsCaret?" ML__contains-caret":""),mode:this.mode,style:this.style}))),ae&&(No(ae.children,this,ee,de,ge),be.push(ae)),this.rightDelim){let gt=this.containsCaret?" ML__contains-caret":"",Et=this.rightDelim;Et==="?"&&(ee.smartFence?(Et=this.matchingRightDelim(),gt+=" ML__smart-fence__close"):Et="."),be.push(this.bind(re,jr("close",Et,de,ge,re,{isSelected:this.isSelected,classes:gt+" ML__close",mode:this.mode,style:this.style})))}let Ce=this.variant==="mleft...mright";const $e=this.leftSibling;$e&&(!Ce&&$e.isFunction&&(Ce=!0),!Ce&&$e.type==="subsup"&&((E=$e.leftSibling)!=null&&E.isFunction)&&(Ce=!0));const Ye=new Tr(be,{type:Ce?"close":"inner",classes:"left-right"});return Ye.setStyle("margin-top",`${-ae.depth}em`),Ye.setStyle("height",`${ae.height+ae.depth}em`),this.caret&&(Ye.caret=this.caret),this.bind(ee,Ye.wrap(ee))}};function No(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,jr("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&&No(ae.children,y,b,E,ee)}}var Eu=class Bp extends Un{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 Bp(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=Un.createBox(y,this.body);return b?(this.caret&&(b.caret=this.caret),this.bind(y,b)):null}},sl=class Rp extends Un{constructor(){super({type:"macro-argument"})}static fromJson(y){return new Rp}toJson(){return super.toJson()}_serialize(y){return""}render(y){return null}},xl=class Np extends Un{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 La({parent:y}),E=b.getRegisterAsEm("fboxsep"),ee=E,re=E,ae=Un.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 de=new Tr(ae,{type:"ord"});de.setStyle("display","inline-block"),de.setStyle("height",ae.height+ae.depth,"em"),de.setStyle("vertical-align",-re,"em");let ge="ML__prompt ";this.locked?ge+=" ML__lockedPromptBox ":ge+=" ML__editablePromptBox ",this.correctness==="correct"?ge+=" ML__correctPromptBox ":this.correctness==="incorrect"&&(ge+=" ML__incorrectPromptBox "),this.containsCaret&&(ge+=" ML__focusedPromptBox ");const be=new Tr(null,{classes:ge,attributes:{part:"prompt"}});be.height=de.height+re,be.depth=de.depth+re,be.width=de.width+2*ee,be.setStyle("box-sizing","border-box"),be.setStyle("position","absolute"),be.setStyle("height",de.height+de.depth+2*re,"em"),ee===0&&be.setStyle("width","100%"),ee!==0&&(be.setStyle("width",`calc(100% + ${2*ee}em)`),be.setStyle("top",E,"em"),be.setStyle("left",-ee,"em")),(!this.body||this.body.length===1)&&(be.width=3*ee,be.setStyle("width",`calc(100% + ${3*ee}em)`),be.setStyle("left",-1.5*ee,"em"));let Ce="";this.correctness==="incorrect"&&(Ce+='<line x1="3%" y1="97%" x2="97%" y2="3%" stroke-width="0.5" stroke="var(--incorrect-color, var(--ML__incorrect-color))" stroke-linecap="round" />'),Ce&&(be.svgOverlay=Ce);const $e=new Tr([be,de],{classes:"ML__prompt-atom"});return $e.setStyle("position","relative"),$e.setStyle("display","inline-block"),$e.setStyle("line-height",0),$e.height=de.height+re+.2,$e.depth=de.depth+re,$e.left=ee,$e.right=ee,$e.setStyle("height",de.height+re,"em"),$e.setStyle("top",de.depth-de.height,"em"),$e.setStyle("vertical-align",de.depth+re,"em"),$e.setStyle("margin-left",.5,"em"),$e.setStyle("margin-right",.5,"em"),this.caret&&($e.caret=this.caret),this.bind(b,this.attachSupsub(y,{base:$e}))}_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]"),uo(ee,E)}},js=class $p extends Un{constructor(y){super({type:"subsup",style:y==null?void 0:y.style}),this.subsupPlacement="auto"}static fromJson(y){const b=new $p(y);for(const E of sc)y[E]&&b.setChildren(y[E],E);return b}render(y){var b;const E=new La({parent:y,isPhantom:!0}),ee=this.leftSibling,re=(b=ee.render(E))!=null?b:new Tr(null),ae=new Tr(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 Po(a){return a?!/^(<$$>|<$>|<space>|<{>|<}>|#[0-9\?]|\\.+)$/.test(a):!1}var Zl=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 La&&!(b!=null&&b.parseMode)&&!b.mathstyle?y:new La({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:Se({},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(Se({before:pl(this.tokens.slice(this.index,this.index+10)),after:pl(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 Se({},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 js({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=$t(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?Xo(y,{parseMode:this.parseMode,mathstyle:"textstyle"}):[new Fi({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();Po(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(Po(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 de="";for(;this.hasPattern(ae);)de+=this.get();if(!a&&(this.match(".")||this.match(",")))for(de+=".";this.hasPattern(ae);)de+=this.get();const ge=a?Number.parseInt(de,re):Number.parseFloat(de);return Number.isNaN(ge)?null:{number:E?-ge:ge,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()||!Po(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=It(a);if(!y)return this.onError({code:"unknown-environment",arg:a}),null;const b=[];if(y.params)for(const de of y.params)if(de.isOptional)b.push(this.scanOptionalArgument(de.type));else{const ge=this.scanArgument(de.type);ge||this.onError({code:"missing-argument",arg:a}),b.push(ge)}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 de=null;this.skipWhitespace(),this.match("[")&&(de=this.scanDimen(),this.skipWhitespace(),this.match("]")),ee.push(de!=null?de:{dimension:0}),E.push(re),re=[]}else this.mathlist.push(...this.scan(de=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline"].includes(de)));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=$t(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 Go(y,this.parseMode,this.style);return b.verbatimLatex=pl(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 Wa("",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(!Po(a)&&!a.startsWith("\\"))return null;this.next();const y=$t(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 ys("\\right");if(this.match("\\mright"))return this.onError({code:"unbalanced-braces"}),new ys("\\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 ys(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 Wa(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 Un({type:"mord",command:"\\doubleprime",mode:"math",value:"\u2032\u2032"}),"superscript"):y.addChild(new Un({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(Po(a)){const b=Ss.createAtom(this.parseMode,a,Se({},this.style));return b?[b]:null}if(y=this.scanMacro(a),y)return[y];if(a.startsWith("\\")){const b=$t(a,this.parseMode);if(!b)return this.onError({code:"unknown-command",arg:a}),[new ys(a)];if(b.definitionType==="symbol"){const E=Se({},this.style);b.variant&&(E.variant=b.variant),y=new Un({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 ys(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 de=this.scanOptionalArgument("string"),ge=this.scanOptionalArgument("math"),be=Un.serialize(ge,{defaultMode:"math"});let Ce=[],$e;!$e&&be==="correct"?$e="correct":!$e&&be==="incorrect"?$e="incorrect":be!==""&&(Ce=ge);const Ye=this.scanOptionalArgument("string")==="locked",gt=this.scanArgument("auto");let Et;return gt&&Array.isArray(gt)&&gt.length>0?Et=gt:gt&&typeof gt=="object"&&"group"in gt?Et=gt.group:Et=Ce,de?[new xl(de,$e,Ye,Et!=null?Et:Ce,{mode:this.parseMode,style:this.style})]:[new Fi({mode:this.parseMode,style:this.style})]}if(a==="\\renewcommand"||a==="\\newcommand"||a==="\\providecommand"||a==="\\def"){const de=this.index,ge=this.scanLiteralGroup()||this.next();if(!ge)return null;if(this.context.registers[ge.substring(1)]){const be=this.scanArgument("string");be!==null&&(this.context.registers[ge.substring(1)]=be);const Ce=ya([a,pl(this.tokens.slice(de,this.index))]);return[new Un({type:"text",value:"",verbatimLatex:Ce})]}}let ee=this.scanMacro(a);if(ee)return[ee];const re=$t(a,this.parseMode);if(!re)return this.parseMode==="text"?(/[a-zA-Z]/.test((y=this.peek())!=null?y:"")&&(a+=" "),[...a].map(de=>new Un({type:"text",value:de,mode:"text",style:this.style}))):(this.onError({code:"unknown-command",arg:a}),[new ys(a)]);const ae=this.index;if(re.definitionType==="symbol"){const de=Se({},this.style);re.variant&&(de.variant=re.variant),ee=new Un({type:re.type,command:a,style:de,value:String.fromCodePoint(re.codepoint),mode:this.parseMode})}else{if(re.ifMode&&!re.ifMode.includes(this.parseMode))return[];const de=this.parseMode;re.applyMode&&(this.parseMode=re.applyMode);let ge,be=[];if(re.parse?be=re.parse(this):[ge,be]=this.scanArguments(re),this.parseMode=de,re.applyMode&&!re.applyStyle&&!re.createAtom)return nt(be[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:be,style:this.style,mode:this.parseMode}),ge&&(ee.body=nt(this.scanArgument(ge)));else if(typeof re.applyStyle=="function"){const Ce=Se(Se({},this.style),re.applyStyle(a,be,this.context)),$e=this.parseMode;if(re.applyMode&&(this.parseMode=re.applyMode),ge){const Ye=this.style;this.style=Ce;const gt=this.scanArgument(ge);return this.style=Ye,this.parseMode=$e,nt(gt)}this.style=Ce}else ee=new Un({type:"mord",command:(b=re.command)!=null?b:a,style:Se({},this.style),value:a,mode:(E=re.applyMode)!=null?E:this.parseMode})}if(!ee)return null;if(ee instanceof Un&&ee.verbatimLatex===void 0&&!/^\\(llap|rlap|class|cssId|htmlData)$/.test(a)){const de=ya([a,pl(this.tokens.slice(ae,this.index))]);de&&(ee.verbatimLatex=de)}if(ee.verbatimLatex===null&&(ee.verbatimLatex=void 0),ee.isFunction&&this.smartFence){const de=this.scanSmartFence();if(de)return[ee,de]}return[ee]}scanSymbolCommandOrLiteral(){const a=this.get();if(!a)return null;if(Po(a)){const y=Ss.createAtom(this.parseMode,a,Se({},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 al(" "," ",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 de=this.scanLiteralGroup();if(!de){const ge=this.index;this.scanExpression(),de=pl(this.tokens.slice(ge,this.index))}re[ae]=de}return new Eu(a,{expand:b.expand,captureSelection:b.captureSelection,args:E===this.index?null:pl(this.tokens.slice(E,this.index)),style:this.parsingContext.style,body:Xo(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 Xo(a,y){var b,E,ee,re;const ae=(b=y==null?void 0:y.args)!=null?b:void 0,de=new Zl(nl(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:{}}),ge=[];for(;!de.end();)ge.push(...de.scan(()=>!1));return ge}function t0(a,y){var b;const E=new Zl(nl(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 Un{constructor(y,b){super({type:"chem"},{command:y,mode:"math"});const E=vo.go(Sr.go(b,y==="\\pu"?"pu":"ce"),!1);this.body=Xo(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 me(Se({},super.toJson()),{arg:this.arg})}render(y){const b=Un.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}};Bt(["ce","pu"],"{chemformula:balanced-string}",{createAtom:a=>{var y;return new n0(a.command,(y=a.args[0])!=null?y:"")}});var Sr={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 de=Sr.stateMachines[y],ge=de.transitions[b]||de.transitions["*"];e:for(var be=0;be<ge.length;be++){var Ce=Sr.patterns.match_(ge[be].pattern,a);if(Ce){for(var $e=ge[be].task,Ye=0;Ye<$e.action_.length;Ye++){var gt;if(de.actions[$e.action_[Ye].type_])gt=de.actions[$e.action_[Ye].type_](E,Ce.match_,$e.action_[Ye].option);else if(Sr.actions[$e.action_[Ye].type_])gt=Sr.actions[$e.action_[Ye].type_](E,Ce.match_,$e.action_[Ye].option);else throw["MhchemBugA","mhchem bug A. Please report. ("+$e.action_[Ye].type_+")"];Sr.concatArray(ae,gt)}if(b=$e.nextState||b,a.length>0){if($e.revisit||(a=Ce.remainder),!$e.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=Sr.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 Sr.patterns.findObserveGroups(a,"^{","","","}")},"^($...$)":function(a){return Sr.patterns.findObserveGroups(a,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(a){return Sr.patterns.findObserveGroups(a,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(a){return Sr.patterns.findObserveGroups(a,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(a){return Sr.patterns.findObserveGroups(a,"_{","","","}")},"_($...$)":function(a){return Sr.patterns.findObserveGroups(a,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(a){return Sr.patterns.findObserveGroups(a,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(a){return Sr.patterns.findObserveGroups(a,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(a){return Sr.patterns.findObserveGroups(a,"","{","}","")},"{(...)}":function(a){return Sr.patterns.findObserveGroups(a,"{","","","}")},"$...$":function(a){return Sr.patterns.findObserveGroups(a,"","$","$","")},"${(...)}$":function(a){return Sr.patterns.findObserveGroups(a,"${","","","}$")},"$(...)$":function(a){return Sr.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 Sr.patterns.findObserveGroups(a,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(a){return Sr.patterns.findObserveGroups(a,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(a){return Sr.patterns.findObserveGroups(a,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(a){return Sr.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 Sr.patterns.findObserveGroups(a,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(a){return Sr.patterns.findObserveGroups(a,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(a){return Sr.patterns.findObserveGroups(a,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(a){return Sr.patterns.findObserveGroups(a,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(a){return Sr.patterns.findObserveGroups(a,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(a){return Sr.patterns.findObserveGroups(a,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(a){return Sr.patterns.findObserveGroups(a,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(a){return Sr.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=Sr.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,de,ge,be){var Ce=function(wn,rr){if(typeof rr=="string")return wn.indexOf(rr)!==0?null:rr;var Ir=wn.match(rr);return Ir?Ir[0]:null},$e=function(wn,rr,Ir){for(var dr=0;rr<wn.length;){var ci=wn.charAt(rr),Ii=Ce(wn.substr(rr),Ir);if(Ii!==null&&dr===0)return{endMatchBegin:rr,endMatchEnd:rr+Ii.length};if(ci==="{")dr++;else if(ci==="}"){if(dr===0)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];dr--}rr++}return dr>0,null},Ye=Ce(a,y);if(Ye===null||(a=a.substr(Ye.length),Ye=Ce(a,b),Ye===null))return null;var gt=$e(a,Ye.length,E||ee);if(gt===null)return null;var Et=a.substring(0,E?gt.endMatchEnd:gt.endMatchBegin);if(re||ae){var _n=this.findObserveGroups(a.substr(gt.endMatchEnd),re,ae,de,ge);if(_n===null)return null;var kr=[Et,_n.match_];return{match_:be?kr.join(""):kr,remainder:_n.remainder}}else return{match_:Et,remainder:a.substr(gt.endMatchEnd)}},match_:function(a,y){var b=Sr.patterns.patterns[a];if(b===void 0)throw["MhchemBugP","mhchem bug P. Please report. ("+a+")"];if(typeof b=="function")return Sr.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 Sr.go(y,"text")},"{text}":function(a,y){var b=["{"];return Sr.concatArray(b,Sr.go(y,"text")),b.push("}"),b},"tex-math":function(a,y){return Sr.go(y,"tex-math")},"tex-math tight":function(a,y){return Sr.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 Sr.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 Sr.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 de=0;de<ae.action_.length;de++)typeof ae.action_[de]=="string"&&(ae.action_[de]={type_:ae.action_[de]})}else ae.action_=[];for(var ge=y.split("|"),be=0;be<ge.length;be++)if(E[ee]==="*")for(var Ce in re)re[Ce].push({pattern:ge[be],task:ae});else re[E[ee]].push({pattern:ge[be],task:ae})}return re},stateMachines:{}};Sr.stateMachines={ce:{transitions:Sr.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 Sr.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 Sr.concatArray(b,this.output(a)),Sr.concatArray(b,Sr.actions.bond(a,y,"-")),b}else a.d=y},"- after o/d":function(a,y,b){var E=Sr.patterns.match_("orbital",a.o||""),ee=Sr.patterns.match_("one lowercase greek letter $",a.o||""),re=Sr.patterns.match_("one lowercase latin letter $",a.o||""),ae=Sr.patterns.match_("$one lowercase latin letter$ $",a.o||""),de=y==="-"&&(E&&E.remainder===""||ee||re||ae);de&&!a.a&&!a.b&&!a.p&&!a.d&&!a.q&&!E&&re&&(a.o="$"+a.o+"$");var ge=[];return de?(Sr.concatArray(ge,this.output(a)),ge.push({type_:"hyphen"})):(E=Sr.patterns.match_("digits",a.d||""),b&&E&&E.remainder===""?(Sr.concatArray(ge,Sr.actions["d="](a,y)),Sr.concatArray(ge,this.output(a))):(Sr.concatArray(ge,this.output(a)),Sr.concatArray(ge,Sr.actions.bond(a,y,"-")))),ge},"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:Sr.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"&&Sr.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:Sr.go(a.a,"a"),b:Sr.go(a.b,"bd"),p:Sr.go(a.p,"pq"),o:Sr.go(a.o,"o"),q:Sr.go(a.q,"pq"),d:Sr.go(a.d,a.dType==="oxidation"?"oxidation":"bd"),dType:a.dType}));else{var ee;a.rdt==="M"?ee=Sr.go(a.rd,"tex-math"):a.rdt==="T"?ee=[{type_:"text",p1:a.rd||""}]:ee=Sr.go(a.rd);var re;a.rqt==="M"?re=Sr.go(a.rq,"tex-math"):a.rqt==="T"?re=[{type_:"text",p1:a.rq||""}]:re=Sr.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 Sr.concatArray(b,Sr.go(y,"oxidation")),b.push("}"),b},"frac-output":function(a,y){return{type_:"frac-ce",p1:Sr.go(y[0]),p2:Sr.go(y[1])}},"overset-output":function(a,y){return{type_:"overset",p1:Sr.go(y[0]),p2:Sr.go(y[1])}},"underset-output":function(a,y){return{type_:"underset",p1:Sr.go(y[0]),p2:Sr.go(y[1])}},"underbrace-output":function(a,y){return{type_:"underbrace",p1:Sr.go(y[0]),p2:Sr.go(y[1])}},"color-output":function(a,y){return{type_:"color",color1:y[0],color2:Sr.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:Sr.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:Sr.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:Sr.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:Sr.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:Sr.go(y,"o")}},"color-output":function(a,y){return{type_:"color",color1:y[0],color2:Sr.go(y[1],"pq")}}}},bd:{transitions:Sr.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:Sr.go(y[1],"bd")}}}},oxidation:{transitions:Sr.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:Sr.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:Sr.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:Sr.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:Sr.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]&&(Sr.concatArray(b,Sr.go(y[1],"pu-9,9")),y[2]&&(y[2].match(/[,.]/)?Sr.concatArray(b,Sr.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]),Sr.concatArray(b,Sr.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=Sr.patterns.match_("{(...)}",a.d||"");b&&b.remainder===""&&(a.d=b.match_);var E=Sr.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:Sr.go(a.d,"pu"),q:Sr.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_:"/"}),Sr.concatArray(y,ee.q))}else y=Sr.go(a.d,"pu-2");for(var re in a)delete a[re];return y}}},"pu-2":{transitions:Sr.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=Sr.patterns.match_("{(...)}",a.rm||"");b&&b.remainder===""?y=Sr.go(b.match_,"pu"):y={type_:"rm",p1:a.rm}}for(var E in a)delete a[E];return y}}},"pu-9,9":{transitions:Sr.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 vo={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+=vo._go2(re),re.type_==="1st-level escape"&&(E=!0))}return!y&&!E&&b&&(b="{"+b+"}"),b},_goInner:function(a){return a&&vo.go(a,!0)},_go2:function(a){var y;switch(a.type_){case"chemfive":y="";var b={a:vo._goInner(a.a),b:vo._goInner(a.b),p:vo._goInner(a.p),o:vo._goInner(a.o),q:vo._goInner(a.q),d:vo._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 "+vo._goInner(a.p1);break;case"state of aggregation subscript":y="\\mskip1mu "+vo._goInner(a.p1);break;case"bond":if(y=vo._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{"+vo._goInner(a.p1)+"}{"+vo._goInner(a.p2)+"}";y="\\mathchoice{\\textstyle"+ee+"}{"+ee+"}{"+ee+"}{"+ee+"}";break;case"tex-math":y=a.p1+" ";break;case"frac-ce":y="\\frac{"+vo._goInner(a.p1)+"}{"+vo._goInner(a.p2)+"}";break;case"overset":y="\\overset{"+vo._goInner(a.p1)+"}{"+vo._goInner(a.p2)+"}";break;case"underset":y="\\underset{"+vo._goInner(a.p1)+"}{"+vo._goInner(a.p2)+"}";break;case"underbrace":y="\\underbrace{"+vo._goInner(a.p1)+"}_{"+vo._goInner(a.p2)+"}";break;case"color":y="{\\color{"+a.color1+"}{"+vo._goInner(a.color2)+"}}";break;case"color0":y="\\color{"+a.color+"}";break;case"arrow":var re={rd:vo._goInner(a.rd),rq:vo._goInner(a.rq)},ae=vo._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=vo._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 k1(a){}var r0=class zp extends Un{constructor(y){super(me(Se({},y),{type:"delim"})),this.value=y.delim,this.size=y.size}static fromJson(y){return new zp(y)}toJson(){return me(Se({},super.toJson()),{delim:this.value,size:this.size})}render(y){return new Tr(this.value,{type:"middle"})}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=$t(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):uo(this.command,this.value)}},i0=class Kp extends Un{constructor(y){super(me(Se({},y),{type:"sizeddelim",value:y.delim})),this.delimType=y.delimType,this.size=y.size}static fromJson(y){return new Kp(y)}toJson(){return me(Se({},super.toJson()),{delim:this.value,size:this.size,delimType:this.delimType})}render(y){let b=hn(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=$t(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):uo(this.command,this.value)}},bd=class Hp extends Un{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 me(Se({},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=$t(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 uo(ee,this.bodyToLatex(y))}render(y){const b=new La({parent:y},this.style),E=Un.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 Tr(null,{classes:"ML__notation"});let de=E.height+E.depth+2*re;const ge=E.width+2*re;let be="";if(this.notation.horizontalstrike&&(be+=this.line(3,50,97,50)),this.notation.verticalstrike&&(be+=this.line(50,3,50,97)),this.notation.updiagonalstrike&&(be+=this.line(3,97,97,3)),this.notation.downdiagonalstrike&&(be+=this.line(3,3,97,97)),this.notation.updiagonalarrow){be+=this.line(re.toString(),(re+E.depth+E.height).toString(),(re+E.width).toString(),re.toString());const Et=.03*Math.sqrt(ge*ge+de*de)*1,_n=E.width*Et,kr=(E.depth+E.height)*Et,wn=re+E.width;let rr=re;rr+kr-.4*_n<0&&(rr=.4*_n-kr),be+='<polygon points="',be+=`${wn},${rr} ${wn-_n-.4*kr},${rr+kr-.4*_n} `,be+=`${wn-.7*_n},${rr+.7*kr} ${wn-_n+.4*kr},${rr+kr+.4*_n} `,be+=`${wn},${rr}`,be+=`" stroke='none' fill="${this.strokeColor}"`,be+="/>"}let Ce=0;if(this.notation.phasorangle){const Ye=a0(b),gt=(E.height+E.depth+2*Ye+re).toString(),Et=(E.height+E.depth)/2;be+=this.line(re.toString(),gt,(re+Et+E.width).toString(),gt),be+=this.line(re.toString(),gt,(re+Et).toString(),(re-Ye).toString()),de+=Ye,Ce=Et,E.left+=de/2-re}if(this.notation.longdiv){const Ye=a0(b);de+=Ye,be+=this.line(re.toString(),re.toString(),(re+E.width).toString(),re.toString());const gt=.3;Ce=gt+Ye,E.left+=gt+Ye,E.setTop(re+Ye),be+='<path d="',be+=`M ${re} ${re} a${gt} ${(E.depth+E.height+2*Ye)/2}, 0, 1, 1, 0 ${E.depth+E.height+2*Ye} "`,be+=` stroke-width="${am(b)}" stroke="${this.strokeColor}" fill="none"`,be+="/>"}if(ae.width=E.width+2*re+Ce,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*de)/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),be){let Ye="";this.shadow==="auto"&&(Ye+="filter: drop-shadow(0 0 .5px rgba(255, 255, 255, .7)) drop-shadow(1px 1px 2px #333)"),this.shadow!=="none"&&(Ye+=`filter: drop-shadow(${this.shadow})`),Ye+=` stroke-width="${this.strokeWidth}" stroke="${this.strokeColor}"`,Ye+=' stroke-linecap="round"',this.svgStrokeStyle&&(Ye+=` stroke-dasharray="${this.svgStrokeStyle}"`),ae.svgStyle=Ye,ae.svgOverlay=be}const $e=new Tr([ae,E]);return $e.setStyle("position","relative"),$e.setStyle("vertical-align",re,"em"),$e.setStyle("height",`${Math.floor(100*(E.height+E.depth+2*re))/100}em`),$e.setStyle("display","inline-block"),$e.height=ae.height,$e.depth=ae.depth,$e.width=ae.width-2*re,$e.left=re,$e.right=re,this.caret&&($e.caret=this.caret),$e.wrap(b)}line(y,b,E,ee){return`<line x1="${bf(y)}" y1="${bf(b)}" x2="${bf(E)}" y2="${bf(ee)}" vector-effect="non-scaling-stroke"></line>`}};function bf(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?el:a.metrics.defaultRuleThickness;return a.metrics.defaultRuleThickness+a.scalingFactor*y/4}var ku=class Wp extends Un{constructor(y,b,E){var ee,re;super(me(Se({},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),Se(Se({},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 La({parent:y,mathstyle:this.mathstyleName},this.style),re=ee.metrics,ae=new La({parent:ee,mathstyle:this.continuousFraction?"":"numerator"},this.style),de=this.numerPrefix?new Tr([new Tr(this.numerPrefix),Un.createBox(ae,this.above)],{isTight:ae.isTight,type:"ignore"}):(b=Un.createBox(ae,this.above,{type:"ignore"}))!=null?b:new Tr(null,{type:"ignore"}),ge=new La({parent:ee,mathstyle:this.continuousFraction?"":"denominator"},this.style),be=this.denomPrefix?new Tr([new Tr(this.denomPrefix),Un.createBox(ge,this.below,{type:"ignore"})]):(E=Un.createBox(ge,this.below,{type:"ignore"}))!=null?E:new Tr(null,{type:"ignore"}),Ce=this.hasBarLine?re.defaultRuleThickness:0;let $e,Ye=0,gt;ee.isDisplayStyle?($e=ae.metrics.num1,Ye=Ce>0?3*Ce:7*Ce,gt=ge.metrics.denom1):(Ce>0?($e=ae.metrics.num2,Ye=Ce):($e=ae.metrics.num3,Ye=3*re.defaultRuleThickness),gt=ge.metrics.denom2);const Et=[];this.isSelected&&Et.push("ML__selected");const _n=de.depth,kr=be.height;let wn;if(Ce<=0){const bi=$e-_n-(kr-gt);bi<Ye&&($e+=(Ye-bi)/2,gt+=(Ye-bi)/2),wn=new Qa({individualShift:[{box:de,shift:-$e,classes:[...Et,"ML__center"]},{box:be,shift:gt,classes:[...Et,"ML__center"]}]}).wrap(ee)}else{const bi=new Tr(null,{classes:"ML__frac-line",mode:this.mode,style:this.style});bi.softWidth=Math.max(de.width,be.width),bi.height=Ce/2,bi.depth=Ce/2;const Pa=os+Ce/2;$e<Ye+_n+Pa&&($e=Ye+_n+Pa);const qa=os-Ce/2;gt<Ye+kr-qa&&(gt=Ye+kr-qa),wn=new Qa({individualShift:[{box:be,shift:gt,classes:[...Et,"ML__center"]},{box:bi,shift:-qa,classes:Et},{box:de,shift:-$e,classes:[...Et,"ML__center"]}]}).wrap(ee)}const rr=ee.isDisplayStyle?re.delim1:re.delim2,Ir=this.leftDelim?this.bind(y,ii("open",this.leftDelim,rr,!0,y,{style:this.style,mode:this.mode,isSelected:this.isSelected})):ai(ee,"open");let dr=null;this.continuousFraction?dr=new Tr(null,{type:"close"}):this.rightDelim?dr=this.bind(y,ii("close",this.rightDelim,rr,!0,y,{style:this.style,mode:this.mode,isSelected:this.isSelected})):dr=ai(ee,"close");const ci=new Tr([Ir,wn,dr],{isTight:ee.isTight,type:"inner",classes:"mfrac"}),Ii=this.bind(y,ci);return this.caret&&(Ii.caret=this.caret),this.attachSupsub(y,{base:Ii})}},ns=class Zp extends Un{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),Se({type:"latex",value:this.value},y)}get computedStyle(){return{}}render(y){const b=new Tr(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}},xd=class Up extends Un{constructor(y){super({type:"latexgroup",mode:"latex"}),this.body=[...y].map(b=>new ns(b)),this.skipBoundary=!1}static fromJson(y){return new Up("")}toJson(){return super.toJson()}render(y){const b=Un.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:""}},fh=class jp extends Un{constructor(y,b){super(me(Se({},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 jp(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 Tr(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-os*y.scalingFactor,ae=ee.italic;ee.setTop(re);let de=ee;if(this.superscript||this.subscript){const ge=(b=this.subsupPlacement)!=null?b:"auto";de=ge==="over-under"||ge==="auto"&&y.isDisplayStyle?this.attachLimits(y,{base:ee,baseShift:re,slant:ae}):this.attachSupsub(y,{base:ee})}return new Tr(this.bind(y,de),{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=$t(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)),ya(E)}},Bc=class Vp extends Un{constructor(y){const b=y.body;super(me(Se({},y),{type:"overlap",body:typeof b=="string"?[new Un({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 Vp(y)}toJson(){const y={};return this.align&&(y.align=this.align),this.boxType&&(y.boxType=this.boxType),Se(Se({},super.toJson()),y)}render(y){const b=Un.createBox(y,this.body,{classes:"inner"});return b?(this.caret&&(b.caret=this.caret),this.bind(y,new Tr([b,new Tr(null,{classes:"fix"})],{classes:this.align==="right"?"rlap":"llap",type:this.boxType}))):null}},Vs=class Gp extends Un{constructor(y){var b,E,ee,re;super({type:"overunder",command:y.command,style:y.style,mode:y.mode,body:y.body,skipBoundary:(b=y.skipBoundary)!=null?b:!0}),this.subsupPlacement=y.supsubPlacement,this.svgAbove=y.svgAbove,this.svgBelow=y.svgBelow,this.svgBody=y.svgBody,this.above=y.above,this.below=y.below,this.boxType=(E=y.boxType)!=null?E:"ord",this.paddedBody=(ee=y.paddedBody)!=null?ee:!1,this.paddedLabels=(re=y.paddedLabels)!=null?re:!1}static fromJson(y){return new Gp(y)}toJson(){const y=super.toJson();return this.skipBoundary||(y.skipBoundary=!1),this.subsupPlacement&&(y.subsupPlacement=this.subsupPlacement),this.svgAbove&&(y.svgAbove=this.svgAbove),this.svgBelow&&(y.svgBelow=this.svgBelow),this.svgBody&&(y.svgBody=this.svgBody),this.boxType!=="ord"&&(y.boxType=this.boxType),this.paddedBody&&(y.paddedBody=!0),this.paddedLabels&&(y.paddedLabels=!0),y}render(y){let b=this.svgBody?Os(this.svgBody):Un.createBox(y,this.body,{type:"ignore"});const E=new La({parent:y,mathstyle:"scriptstyle"},this.style);let ee=null;this.svgAbove?ee=Os(this.svgAbove):this.above&&(ee=Un.createBox(E,this.above,{type:"ignore"}));let re=null;this.svgBelow?re=Os(this.svgBelow):this.below&&(re=Un.createBox(E,this.below,{type:"ignore"})),this.paddedBody&&(b=new Tr([ai(y,"open"),b,ai(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 de=new Tr(y.base,{type:y.type});return de.setStyle("position","relative"),de}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 de=a.metrics.bigOpSpacing5+y.below.height+y.below.depth+ee.depth+re;E=new Qa({bottom:de,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 Qa({top:ee.height-re,children:[a.metrics.bigOpSpacing5,{box:y.below,classes:ae},{box:ee,classes:["ML__center"]}]}):y.above&&(E=new Qa({bottom:ee.depth+re,children:[{box:ee,classes:["ML__center"]},b,{box:y.above,classes:ae},a.metrics.bigOpSpacing5]}));return new Tr(E,{type:y.type})}var wd=class Xp extends Un{constructor(y){var b,E,ee,re;super(me(Se({},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),Se(Se({},super.toJson()),y)}render(y){const b=new La({parent:y,isPhantom:!0});if(!this.smashDepth&&!this.smashHeight&&!this.smashWidth)return console.assert(this.isInvisible),Un.createBox(b,this.body,{classes:"inner"});const E=Un.createBox(this.isInvisible?b:y,this.body);if(!E)return null;if(this.smashWidth){const ee=new Tr(null,{classes:"fix"});return new Tr([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 Qa({firstBaseline:[{box:E}]},{type:E.type}).wrap(y)}},Sd=class Yp extends Un{constructor(y){var b;super(Se({type:"spacing"},y)),this.width=y==null?void 0:y.width,this._braced=(b=y==null?void 0:y.braced)!=null?b:!1}static fromJson(y){return new Yp(y)}toJson(){const y=super.toJson();return this.width!==void 0&&(y.width=this.width),this._braced&&(y.braced=!0),y}render(y){var b;if(this.command==="space")return new Tr(this.mode==="math"?null:" ");let E;if(this.width!==void 0)E=new Tr(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 Tr(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=$t(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}{${Do(this.width)}}`:`${ee}${Do(this.width)}`}},o0=class qp extends Un{constructor(y){var b;super(me(Se({},y),{type:"surd",mode:(b=y.mode)!=null?b:"math",style:y.style,displayContainsHighlight:!0,body:y.body})),this.above=y.index}static fromJson(y){return new qp(me(Se({},y),{index:y.above}))}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=$t(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")?uo(`${E}[${this.aboveToLatex(y)}]`,ee):/^[0-9]$/.test(ee)?`${E}${ee}`:uo(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 La({parent:y,mathstyle:"cramp"},this.style),ee=(b=Un.createBox(E,this.body,{type:"inner"}))!=null?b:new Tr(null),re=E.scalingFactor,ae=E.metrics.defaultRuleThickness/re,de=y.isDisplayStyle?el:ae,ge=new Tr(null,{classes:"ML__sqrt-line",style:this.style});ge.height=ae,ge.softWidth=ee.width;let be=re*(ae+de/4);const $e=Math.max(re*2*de,ee.height+ee.depth)+be+ae,Ye=new La({parent:y},this.style),gt=this.bind(Ye,new Tr(ii("inner","\\surd",$e,!1,Ye,{isSelected:this.isSelected}),{isSelected:this.isSelected,classes:"ML__sqrt-sign",style:this.style}));if(!gt)return null;const Et=gt.height+gt.depth-ae;Et>ee.height+ee.depth+be&&(be=(be+Et-(ee.height+ee.depth))/2),gt.setTop(gt.height-ee.height-be);const _n=this.bind(y,new Qa({firstBaseline:[{box:new Tr(ee)},be-2*ae,{box:ge},ae]})),kr=Un.createBox(new La({parent:y,mathstyle:"scriptscriptstyle"}),this.above,{type:"ignore"});if(!kr){const Ir=new Tr([gt,_n],{classes:this.containsCaret?"ML__contains-caret":"",type:"inner"});return Ir.setStyle("display","inline-block"),Ir.setStyle("height",Ir.height+Ir.depth,"em"),this.caret&&(Ir.caret=this.caret),this.bind(y,Ir)}const wn=new Qa({shift:-.6*(Math.max(gt.height,_n.height)-Math.max(gt.depth,_n.depth)),children:[{box:kr}]}),rr=new Tr([new Tr(wn,{classes:"ML__sqrt-index",type:"ignore"}),gt,_n],{type:"inner",classes:this.containsCaret?"ML__contains-caret":""});return rr.height=gt.height,rr.depth=gt.depth,this.caret&&(rr.caret=this.caret),this.bind(y,rr)}},sm=class extends Tr{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 xf(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"){xf(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){Md(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 Cd(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 Md(b,(ae,de)=>{var ge,be,Ce;if(!ae)return;const $e=ae.type,Ye=de.isTight?(ge=cm[$e])!=null?ge:null:(be=lm[$e])!=null?be:null,gt=(Ce=Ye==null?void 0:Ye[de.type])!=null?Ce:null;gt===3&&xf(de,E),gt===4&&xf(de,ee),gt===5&&xf(de,re)}),a}function Md(a,y,b=void 0){if(!a)return b;a=[...a];for(const E of a)E.type==="lift"?b=Md(E.children,y,b):E.type==="ignore"?Md(E.children,y):(y(b,E),Md(E.children,y),b=E);return b}var hh=class Jp extends Un{constructor(y){super({type:"tooltip",command:y.command,mode:y.mode,style:y.style,body:y.body,displayContainsHighlight:!0}),this.tooltip=new Un({type:"root",mode:y.content,body:y.tooltip,style:{}}),this.skipBoundary=!0,this.captureSelection=!1}static fromJson(y){return new Jp(me(Se({},y),{tooltip:dc(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 me(Se({},super.toJson()),{tooltip:b})}render(y){const b=Un.createBox(new La,this.body);if(!b)return null;const E=new La({parent:y,mathstyle:"displaystyle"},{fontSize:dl}),ee=gu(Cd(new Tr(this.tooltip.render(E),{classes:"ML__tooltip-content"}),E)),re=new Tr([ee,b],{classes:"ML__tooltip-container"});return this.caret&&(re.caret=this.caret),this.bind(y,re)}},Rc=class Qp extends Un{constructor(y,b){super(me(Se({},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 Tr(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 Tr(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=$t(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)),ya(E)}};function dc(a){if(Be(a))return a.map(E=>dc(E));if(typeof a=="string")return Un.fromJson(a);a=Se({},a);for(const E of sc)a[E]&&(a[E]=dc(a[E]));a.args&&(a.args=dm(a.args)),a.array&&(a.array=dc(a.array));const y=a.type;let b;y==="accent"&&(b=z.fromJson(a)),y==="array"&&(b=sa.fromJson(a)),y==="box"&&(b=ko.fromJson(a)),y==="chem"&&(b=n0.fromJson(a)),y==="composition"&&(b=Wl.fromJson(a)),y==="delim"&&(b=r0.fromJson(a)),y==="enclose"&&(b=bd.fromJson(a)),y==="error"&&(b=ys.fromJson(a)),y==="extensible-symbol"&&(b=fh.fromJson(a)),y==="genfrac"&&(b=ku.fromJson(a)),y==="group"&&(b=Go.fromJson(a)),y==="latex"&&(b=ns.fromJson(a)),y==="latexgroup"&&(b=xd.fromJson(a)),y==="leftright"&&(b=Wa.fromJson(a)),y==="macro"&&(b=Eu.fromJson(a)),y==="macro-argument"&&(b=sl.fromJson(a)),y==="operator"&&(b=Rc.fromJson(a)),y==="overlap"&&(b=Bc.fromJson(a)),y==="overunder"&&(b=Vs.fromJson(a)),y==="placeholder"&&(b=Fi.fromJson(a)),y==="prompt"&&(b=xl.fromJson(a)),y==="phantom"&&(b=wd.fromJson(a)),y==="sizeddelim"&&(b=i0.fromJson(a)),y==="spacing"&&(b=Sd.fromJson(a)),y==="subsup"&&(b=js.fromJson(a)),y==="surd"&&(b=o0.fromJson(a)),y==="text"&&(b=al.fromJson(a)),y==="tooltip"&&(b=hh.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=Un.fromJson(a));for(const E of sc)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=>dc(b))}:typeof y=="object"&&"atoms"in y?y.atoms.map(b=>dc(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"]},ph={"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]$/,fm=/^[\u0393|\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A6\u03A8\u03A9]$/,hm=[/^[a-z]$/,/^[A-Z]$/,l0,fm],pm={iso:["it","it","it","it"],tex:["it","it","it","up"],french:["it","up","up","up"],upright:["up","up","up","up"]},mm=class extends Ss{constructor(){super("math")}createAtom(a,y,b){var E,ee,re,ae;if(y===null)return new Un({type:"mord",mode:"math",command:a,value:a,style:b});const de=window.MathfieldElement.isFunction((E=y.command)!=null?E:a);if(y.definitionType==="symbol"){const be=new Un({type:(ee=y.type)!=null?ee:"mord",mode:"math",command:(re=y.command)!=null?re:a,value:String.fromCodePoint(y.codepoint),style:b});return de&&(be.isFunction=!0),a.startsWith("\\")&&(be.verbatimLatex=a),be}const ge=new Un({type:"mord",mode:"math",command:(ae=y.command)!=null?ae:a,value:a,style:b});return de&&(ge.isFunction=!0),a.startsWith("\\")&&(ge.verbatimLatex=a),ge}serialize(a,y){const b=gm(a,me(Se({},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&&hm.forEach((de,ge)=>{var be;de.test(a.value)&&pm[(be=y.letterShapeStyle)!=null?be:"tex"][ge]==="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 ph[b]&&!ph[b].test(a.value)?(a.value=Rn(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 Eo(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 de=ya(ee.map(ge=>ge._serialize(y)));return ae?uo(ae,de):de})}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 Eo(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?`{${uo("\\fontshape",ee)}${ya(E)}}`:re?uo(re,ya(E)):ya(E)})}function bm(a,y){return Eo(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?`{${uo("\\fontseries",ee)}${ya(E)}}`:re?uo(re,ya(E)):ya(E)})}function xm(a,y){return Eo(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} ${ya(re)}`:ya(re)})}function wm(a,y,b){return Eo(a,"fontFamily").map(E=>{var ee,re;const ae=xm(E,y),de=(re={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[(ee=E[0].style.fontFamily)!=null?ee:""])!=null?re:"";return de?`\\${de}{${ya(ae)}}`:E[0].style.fontFamily?`{\\fontfamily{${E[0].style.fontFamily}} ${ya(ae)}}`:b?`\\text{${ya(ae)}}`:ya(ae)})}var u0={roman:"","sans-serif":"ML__sans",monospace:"ML__tt"},Sm=class extends Ss{constructor(){super("text")}createAtom(a,y,b){return y&&y.definitionType==="symbol"?new al(a,String.fromCodePoint(y.codepoint),b!=null?b:{}):null}serialize(a,y){return wm(a,me(Se({},y),{defaultMode:"text"}),y.defaultMode!=="text")}getFont(a,y){var b,E,ee,re,ae;const{fontFamily:de}=y;if(u0[de]?a.classes+=" "+u0[de]:de&&a.setStyle("font-family",de),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 ge=y.fontSeries.match(/(.?[lbm])?(.?[cx])?/);ge&&(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=ge[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=ge[2])!=null?re:""])!=null?ae:"")}return"Main-Regular"}};new Sm;var Cm=class extends Ss{constructor(){super("latex")}createAtom(a){return new ns(a)}serialize(a,y){return a.filter(b=>b instanceof ns&&!b.isSuggestion).map(b=>b.value)}getFont(){return null}};new Cm;var Mm={id:"dvorak",locale:"en",displayName:"Dvorak",virtualLayout:"dvorak",platform:"",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["x","X","\u2248","\u02DB"],KeyC:["j","J","\u2206","\xD4"],KeyD:["e","E","\xB4","\xB4"],KeyE:[".",">","\u2265","\u02D8"],KeyF:["u","U","\xA8","\xA8"],KeyG:["i","I","\u02C6","\u02C6"],KeyH:["d","D","\u2202","\xCE"],KeyI:["c","C","\xE7","\xC7"],KeyJ:["h","H","\u02D9","\xD3"],KeyK:["t","T","\u2020","\u02C7"],KeyL:["n","N","\u02DC","\u02DC"],KeyM:["m","M","\xB5","\xC2"],KeyN:["b","B","\u222B","\u0131"],KeyO:["r","R","\xAE","\u2030"],KeyP:["l","L","\xAC","\xD2"],KeyQ:["'",'"',"\xE6","\xC6"],KeyR:["p","P","\u03C0","\u220F"],KeyS:["o","O","\xF8","\xD8"],KeyT:["y","Y","\xA5","\xC1"],KeyU:["g","G","\xA9","\u02DD"],KeyV:["k","K","\u02DA","\uF8FF"],KeyW:[",","<","\u2264","\xAF"],KeyX:["q","Q","\u0153","\u0152"],KeyY:["f","F","\u0192","\xCF"],KeyZ:[";",":","\u2026","\xDA"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["[","{","\u201C","\u201D"],Equal:["]","}","\u2018","\u2019"],BracketLeft:["/","?","\xF7","\xBF"],BracketRight:["=","+","\u2260","\xB1"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:["s","S","\xDF","\xCD"],Quote:["-","_","\u2013","\u2014"],Backquote:["`","~","`","`"],Comma:["w","W","\u2211","\u201E"],Period:["v","V","\u221A","\u25CA"],Slash:["z","Z","\u03A9","\xB8"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},mh={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:["\\","|","",""]}},f0={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:["=","=","=","="]}},km={id:"windows.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"windows",score:0,mapping:{KeyA:["q","Q","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:[",","?","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["a","A","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["z","Z","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["w","W","",""],Digit1:["&","1","",""],Digit2:["\xE9","2","~",""],Digit3:['"',"3","#",""],Digit4:["'","4","{",""],Digit5:["(","5","[",""],Digit6:["-","6","|",""],Digit7:["\xE8","7","`",""],Digit8:["_","8","\\",""],Digit9:["\xE7","9","^",""],Digit0:["\xE0","0","@",""],Space:[" "," ","",""],Minus:[")","\xB0","]",""],Equal:["=","+","}",""],BracketLeft:["^","\xA8","",""],BracketRight:["$","\xA3","\xA4",""],Backslash:["*","\xB5","",""],Semicolon:["m","M","",""],Quote:["\xF9","%","",""],Backquote:["\xB2","","",""],Comma:[";",".","",""],Period:[":","/","",""],Slash:["!","\xA7","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},_m={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:["<",">","|",""]}},Tm={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:[".",".",".","."]}},Dm={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"]}},Im={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:["<",">","",""]}},Pm={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 h0(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 _u(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 Om={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]"},Ed=[],kd;function gh(){switch(De()){case"macos":case"ios":return"apple";case"windows":return"windows"}return"linux"}function Ns(a){(!a.platform||a.platform===gh())&&Ed.push(a)}function Bm(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=Om[a])!=null?b:"",E}function Rm(a){if(a.code)return a;const y=Object.entries(_d().mapping);let b=!1,E=!1,ee="";for(let re=0;re<4;re++){for(const[ae,de]of y)if(de[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,me(Se({},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 Ed)((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);Ed.sort((ee,re)=>re.score-ee.score)}function $m(a){kd=Ed.find(y=>a.startsWith(y.locale))}function _d(){return kd!=null?kd:Ed[0]}function Fm(){switch(gh()){case"apple":return mh;case"windows":return d0;case"linux":return f0}return mh}switch(gh()){case"apple":Ns(mh),Ns(Em),Ns(Dm),Ns(Lm);break;case"windows":Ns(d0),Ns(km),Ns(Im),Ns(Am);break;case"linux":Ns(f0),Ns(_m),Ns(Pm),Ns(Tm);break}Ns(Mm);function vh(a){var y;const b=/macos|ios/.test(De()),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 wf(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 Nc(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 Sf(a){return a.ctrlKey||a.metaKey||["Dead","Process"].includes(a.key)?!1:a.code===""?!0:Km.has(a.code)}function Cf(){var a;let y=document.activeElement;for(;(a=y==null?void 0:y.shadowRoot)!=null&&a.activeElement;)y=y.shadowRoot.activeElement;return y}var wl=class Gl{static get scrim(){return Gl._scrim||(Gl._scrim=new Gl),Gl._scrim}static open(y){Gl.scrim.open(y)}static close(){Gl.scrim.close()}static get state(){return Gl.scrim.state}static get element(){return Gl.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=Cf();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:"",Cf()!==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,de=!1;const ge=new AbortController,be=ge.signal;return a.addEventListener("keydown",Ce=>{if(re||Ce.key==="Process"||Ce.code==="CapsLock"||/(Control|Meta|Alt|Shift)(Left|Right)/.test(Ce.code)){E=null;return}E=Ce,ee=null,b.onKeystroke(Ce)?a.textContent="":E=null},{capture:!0,signal:be}),a.addEventListener("keypress",Ce=>{re||(E&&ee&&b.onKeystroke(E),ee=Ce)},{capture:!0,signal:be}),a.addEventListener("compositionstart",Ce=>{a.textContent="",re=!0,b.onCompositionStart(Ce.data)},{capture:!0,signal:be}),a.addEventListener("compositionupdate",Ce=>{re&&b.onCompositionUpdate(Ce.data)},{capture:!0,signal:be}),a.addEventListener("compositionend",Ce=>{a.textContent="",re&&(re=!1,b.onCompositionEnd(Ce.data))},{capture:!0,signal:be}),a.addEventListener("beforeinput",Ce=>Ce.stopImmediatePropagation(),{signal:be}),a.addEventListener("input",Ce=>{var $e;if(!re&&(a.textContent="",Ce.inputType!=="insertCompositionText")){if(Ce.inputType==="insertFromPaste"){Ce.preventDefault(),Ce.stopPropagation();return}b.onInput(($e=Ce.data)!=null?$e:""),Ce.preventDefault(),Ce.stopPropagation()}},{signal:be}),a.addEventListener("paste",Ce=>{a.focus({preventScroll:!0}),a.textContent="",b.onPaste(Ce)||Ce.preventDefault(),Ce.stopImmediatePropagation()},{signal:be}),a.addEventListener("cut",Ce=>b.onCut(Ce),{capture:!0,signal:be}),a.addEventListener("copy",Ce=>b.onCopy(Ce),{capture:!0,signal:be}),a.addEventListener("blur",Ce=>{var $e,Ye;if(((Ye=($e=Ce.relatedTarget)==null?void 0:$e._mathfield)==null?void 0:Ye.element)===y){a.focus({preventScroll:!0}),Ce.preventDefault(),Ce.stopPropagation();return}const gt=wl.state;if(gt==="open"||gt==="opening"){Ce.preventDefault(),Ce.stopPropagation();return}if(Ce.relatedTarget===Ce.target.getRootNode().host){Ce.preventDefault(),Ce.stopPropagation();return}de||ae||(de=!0,E=null,ee=null,b.onBlur(),de=!1)},{capture:!0,signal:be}),a.addEventListener("focus",Ce=>{de||ae||(ae=!0,b.onFocus(),ae=!1)},{capture:!0,signal:be}),{dispose:()=>ge.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:()=>Cf()===a,setAriaLabel:Ce=>a.setAttribute("aria-label",Ce),setValue:Ce=>{var $e;a.textContent=Ce,a.style.left="-1000px",($e=window.getSelection())==null||$e.selectAllChildren(a)},moveTo:(Ce,$e)=>{a.style.top=`${$e}px`,a.style.left=`${Ce}px`}}}function Lu(a){var y;if(!a||!Sf(a))return"";let b;return a.key==="Unidentified"&&a.target&&(b=a.target.value),b=(y=b!=null?b:a.key)!=null?y:a.code,/^(Dead|Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(b)&&(b=""),b}function p0(a){a=Rm(a);const y=[];return a.ctrlKey&&y.push("ctrl"),a.metaKey&&y.push("meta"),a.altKey&&y.push("alt"),a.shiftKey&&y.push("shift"),y.length===0?`[${a.code}]`:(y.push(`[${a.code}]`),y.join("+"))}function Wm(a){if(dt()){const y=De(),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=_u(h0(p0(b))),ee=_u({key:b.key,shift:b.shiftKey,alt:b.altKey,ctrl:b.ctrlKey,meta:b.metaKey||b.ctrlKey&&/macos|ios/.test(De()),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 Be(y)&&(y=y.length>0?y[0]+"("+y.slice(1).join("")+")":""),y}function Um(a,y){let b=[];if(typeof y=="string"){const re=hd[y];Be(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(vh)}function jm(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=h0(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=De()==="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 me(Se({},a),{key:_u(b)});const ee=Bm(b.key,y);if(!ee)return me(Se({},a),{key:_u(b)});if(ee.shift&&b.shift||ee.alt&&b.alt)throw new Error(`The keybinding ${a.key} (${yh(a.command)}) is conflicting with the key combination ${_u(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,me(Se({},a),{key:_u(ee)})}function yh(a){if(Array.isArray(a)){const y=[...a];return y.shift()+"("+y.map(b=>typeof b=="string"?`"${b}"`:b.toString()).join(", ")+")"}return a}function Vm(a,y){const b=[],E=[];for(const ee of a)try{const re=jm(ee,y);if(!re)continue;const ae=E.find(de=>de.key===re.key&&de.ifMode===re.ifMode);if(ae)throw new Error(`Ambiguous key binding ${ee.key} (${yh(ee.command)}) matches ${ae.key} (${yh(ae.command)}) with the ${y.displayName} keyboard layout`);E.push(re)}catch(re){re instanceof Error&&b.push(re.message)}return[E,b]}var Gm=class extends ia{constructor(){super("latex")}createAtom(a){return new ns(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"}),Mo(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(Vo(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 ge of y)oe.test(ge)&&re.push(new ns(ge));let ae=a.at(a.position);if(ae instanceof xd&&(ae=ae.lastChild),!(ae.parent instanceof xd)){const ge=new xd("");ae.parent.addChildAfter(ge,ae),ae=ge.firstChild}const de=ae.parent.addChildrenAfter(re,ae);return a.silenceNotifications=ee,b.selectionMode==="before"||(b.selectionMode==="item"?a.setSelection(a.anchor,a.offsetOf(de)):de&&(a.position=a.offsetOf(de))),a.contentDidChange({data:y,inputType:"insertText"}),a.silenceNotifications=E,!0}};function Xm(a){return a.atoms.find(y=>y.type==="latexgroup")}function Ld(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 ge=a.at(E);ee=ge instanceof ns&&ge.isSuggestion,ee||E++}if(!ee)return[void 0,void 0];let ae=E,de=!1;for(;ae<=re&&!de;){const ge=a.at(ae);de=!(ge instanceof ns&&ge.isSuggestion),de||ae++}return[E-1,ae-1]}new Gm;function Mf(a){const y=Ld(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 Ad(a,y){var b;const{model:E}=a;Mf(a);for(const Ce of Ld(E))Ce.isError=!1;if(!E.selectionIsCollapsed||a.options.popoverPolicy==="off"){Tu(a);return}const ee=[];let re=E.at(E.position);for(;re&&re instanceof ns&&/^[a-zA-Z\*]$/.test(re.value);)re=re.leftSibling;if(re&&re instanceof ns&&re.value==="\\")for(ee.push(re),re=re.rightSibling;re&&re instanceof ns&&/^[a-zA-Z\*]$/.test(re.value);)ee.push(re),re=re.rightSibling;const ae=ee.map(Ce=>Ce.value).join(""),de=Nt(a,ae);if(de.length===0){if(/^\\[a-zA-Z\*]+$/.test(ae))for(const Ce of ee)Ce.isError=!0;Tu(a);return}const ge=(b=y==null?void 0:y.atIndex)!=null?b:0;a.suggestionIndex=ge<0?de.length-1:ge%de.length;const be=de[a.suggestionIndex];if(be!==ae){const Ce=ee[ee.length-1];Ce.parent.addChildrenAfter([...be.slice(ae.length-be.length)].map($e=>new ns($e,{isSuggestion:!0})),Ce),$c(a,{interactive:!0})}qm(a,de)}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 Au(a,y="accept",b){var E,ee;Tu(a);const re=Xm(a.model);if(!re)return!1;if(y==="accept-suggestion"||y==="accept-all"){const be=Ld(a.model).filter(Ce=>Ce.isSuggestion);if(be.length!==0){for(const Ce of be)Ce.isSuggestion=!1;a.model.position=a.model.offsetOf(be[be.length-1])}if(y==="accept-suggestion")return be.length!==0}const de=Ld(a.model).filter(be=>!be.isSuggestion).map(be=>be.value).join(""),ge=re.leftSibling;return re.parent.removeChild(re),a.model.position=a.model.offsetOf(ge),a.switchMode((E=b==null?void 0:b.mode)!=null?E:"math"),y==="reject"||(ia.insert(a.model,de,{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 Ef(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 bh(a){var y;const b=document.getElementById(a);if(!b)return;const E=Number.parseInt((y=b.getAttribute("data-refcount"))!=null?y:"0");E<=1?b.remove():b.dataset.refcount=Number(E-1).toString()}function Ym(a,y){const b=new La({from:a.context}),E=new Un({mode:"math",type:"root",body:Xo(y,{context:b})}),ee=gu(Cd(new Tr(E.render(b),{classes:"ML__base"}),b));return vu(ee,{classes:"ML__latex"}).toMarkup()}function qm(a,y){var b;if(y.length===0){Tu(a);return}let E="";for(const[re,ae]of y.entries()){const de=ae,ge=Ym(a,ae),be=Um(a.keybindings,de).join("<br>");E+=`<li role="button" data-command="${de}" ${re===a.suggestionIndex?"class=ML__popover__current":""}><span class="ML__popover__latex">${de}</span><span class="ML__popover__command">${ge}</span>`,be&&(E+=`<span class="ML__popover__keybinding">${be}</span>`),E+="</li>"}const ee=Jm(a,`<ul>${E}</ul>`);xh()&&((b=ee.querySelector(".ML__popover__current"))==null||b.scrollIntoView({block:"nearest",inline:"nearest"})),setTimeout(()=>{var re;ee&&!xh()&&(ee.classList.add("is-visible"),kf(a),(re=ee.querySelector(".ML__popover__current"))==null||re.scrollIntoView({block:"nearest",inline:"nearest"}))},32)}function xh(){const a=document.getElementById("mathlive-suggestion-popover");return a?a.classList.contains("is-visible"):!1}function kf(a,y){var b;if(!a.element||a.element.mathfield!==a||!xh())return;if(((b=a.model.at(a.model.position))==null?void 0:b.type)!=="latex"){Tu(a);return}if(y!=null&&y.deferred){setTimeout(()=>kf(a),32);return}const E=bl(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,de=window.innerHeight-document.documentElement.clientHeight,ge=window.mathVirtualKeyboard.boundingRect.height,be=document.getElementById("mathlive-suggestion-popover");E.x+be.offsetWidth/2>re-ae?be.style.left=`${re-be.offsetWidth-ae}px`:E.x-be.offsetWidth/2<0?be.style.left="0":be.style.left=`${E.x-be.offsetWidth/2}px`;const Ce=E.y-E.height;ee-de-ge-E.y<Ce?(be.classList.add("ML__popover--reverse-direction"),be.classList.remove("top-tip"),be.classList.add("bottom-tip"),be.style.top=`${E.y-E.height-be.offsetHeight-15}px`):(be.classList.remove("ML__popover--reverse-direction"),be.classList.add("top-tip"),be.classList.remove("bottom-tip"),be.style.top=`${E.y+15}px`)}function Tu(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=Ef("mathlive-suggestion-popover"),_s("suggestion-popover"),_s("core"),b.addEventListener("pointerdown",E=>E.preventDefault()),b.addEventListener("click",E=>{let ee=E.target;for(;ee&&!ee.dataset.command;)ee=ee.parentElement;ee&&(Au(a,"reject"),ia.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")&&(bh("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 _f=null,y0,b0,wh=((b0=(y0=globalThis==null?void 0:globalThis.document)==null?void 0:y0.currentScript)==null?void 0:b0.src)||eg();function x0(a){return gc(this,null,function*(){if(/^(?:[a-z+]+:)?\/\//i.test(a))return new URL(a).href;if(_f===null)try{const y=yield fetch(wh,{method:"HEAD"});y.status===200&&(_f=y.url)}catch(y){console.error(`Invalid URL "${a}" (relative to "${wh}")`)}return new URL(a,_f!=null?_f:wh).href})}function tg(a,y,b={}){return new FontFace(a,`url(${y}.woff2) format('woff2')`,b)}var $s="not-loaded";function ng(){return gc(this,null,function*(){return $s="not-loaded",Lf()})}function Lf(){return gc(this,null,function*(){var a;if($s!=="not-loaded")return;if($s="loading",(a=getComputedStyle(document.documentElement).getPropertyValue("--ML__static-fonts"))!=null?a:!1){$s="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))){$s="ready";return}if(!window.MathfieldElement.fontsDirectory){$s="not-loaded";return}const ee=yield x0(window.MathfieldElement.fontsDirectory);if(!ee){document.body.classList.add("ML__fonts-did-not-load"),$s="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(de=>{try{return de.load()}catch(ge){}}))).forEach(de=>document.fonts.add(de)),$s="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")}$s="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 Mo(a,y){a&&(a.dirty||(a.dirty=!0,requestAnimationFrame(()=>{Bs(a)&&a.dirty&&(a.atomBoundsCache=new Map,$c(a,y),a.atomBoundsCache=void 0)})))}function ig(a,y){var b;y=y!=null?y:{};const E=new La({from:me(Se({},a.context),{atomIdsSettings:{seed:y.forHighlighting?rg(Un.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 vu(Cd(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 $c(a,y){if(!Bs(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 de=a.element.querySelector("[part=menu-toggle]");if(de&&(a.model.atoms.length<=1||a.disabled||a.readOnly&&!a.hasEditableContent||a.userSelect==="none"?de.style.display="none":de.style.display=""),a.model.atoms.length<=1){const ge=a.options.contentPlaceholder;ge&&(ae+=`<span part=placeholder class="ML__content-placeholder">${Yo(ge)}</span>`)}E.innerHTML=window.MathfieldElement.createHTML(ae),Af(a,y.interactive),a.dirty=!1}function Af(a,y){const b=a.field;if(!b)return;for(const de of b.querySelectorAll(".ML__selection, .ML__contains-highlight"))de.remove();!(y!=null&&y)&&$s!=="error"&&$s!=="ready"&&setTimeout(()=>{$s==="ready"?Af(a):setTimeout(()=>Af(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){kf(a,{deferred:!0});let de=E.at(E.position);for(;de&&de.type!=="prompt"&&!(de.containsCaret&&de.displayContainsHighlight);)de=de.parent;if(de!=null&&de.containsCaret&&de.displayContainsHighlight){const ge=md(a,lc(a,de),ae);if(ge){ge.left/=ae,ge.right/=ae,ge.top/=ae,ge.bottom/=ae;const be=document.createElement("div");be.classList.add("ML__contains-highlight"),be.style.position="absolute",be.style.left=`${ge.left+1}px`,be.style.top=`${Math.ceil(ge.top)}px`,be.style.width=`${Math.ceil(ge.right-ge.left)}px`,be.style.height=`${Math.ceil(ge.bottom-ge.top)}px`,b.insertBefore(be,b.childNodes[0])}}return}for(const de of ag(vd(a,{excludeAtomsWithBackground:!0}))){de.left/=ae,de.right/=ae,de.top/=ae,de.bottom/=ae;const ge=document.createElement("div");ge.classList.add("ML__selection"),ge.style.position="absolute",ge.style.left=`${de.left}px`,ge.style.top=`${de.top}px`,ge.style.width=`${Math.ceil(de.right-de.left)}px`,ge.style.height=`${Math.ceil(de.bottom-de.top-1)}px`,b.insertBefore(ge,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,Sl;function Ls(a,y){y=Se({target:"mathfield",canUndo:!1,audioFeedback:void 0,changeContent:!1,changeSelection:!1},y!=null?y:{}),Sl||(Sl={});for(const b of Object.keys(a))console.assert(!Sl[b],"Selector already defined: ",b),Sl[b]=me(Se({},y),{fn:a[b]})}function Sh(a){let y;if(Array.isArray(a)){if(a[0]==="performWithFeedback")return Sh(a[1]);y=a[0]}else y=a;return y=y.replace(/-\w/g,b=>b[1].toUpperCase()),Sl[y]}function Du(a){var y;return(y=Sh(a))==null?void 0:y.target}function og(a,y){var b;if(!y)return!1;let E,ee=[],re=!1,ae=!1;Be(y)?(E=y[0],ee=y.slice(1)):E=y,E=E.replace(/-\w/g,be=>be[1].toUpperCase());const de=Sl[E],ge=de==null?void 0:de.target;if(ge==="model"){if(!a.isSelectionEditable&&(de!=null&&de.changeContent))return a.model.announce("plonk"),!1;/^(delete|add)/.test(E)&&(E!=="deleteBackward"&&a.flushInlineShortcutBuffer(),a.snapshot(E)),/^complete/.test(E)||Mf(a),Sl[E].fn(a.model,...ee),Ad(a),ae=!0,re=!0}else if(ge==="virtual-keyboard")ae=(b=window.mathVirtualKeyboard.executeCommand(y))!=null?b:!1,re=!0;else if(Sl[E]){if(!a.isSelectionEditable&&(de!=null&&de.changeContent))return a.model.announce("plonk"),!1;/^(undo|redo)/.test(E)&&a.flushInlineShortcutBuffer(),ae=Sl[E].fn(a,...ee),re=!0}else throw new Error(`Unknown command "${E}"`);return ge!=="virtual-keyboard"&&(!a.model.selectionIsCollapsed||de!=null&&de.changeSelection&&y!=="deleteBackward")&&(a.flushInlineShortcutBuffer(),de!=null&&de.changeContent||a.stopCoalescingUndo(),a.defaultStyle={}),ae&&Mo(a),re}function sg(a,y){var b;if(!a)return!1;a.focus(),vp.keypressVibration&&Ge()&&navigator.vibrate(S0);const E=Sh(y);window.MathfieldElement.playSound((b=E==null?void 0:E.audioFeedback)!=null?b:"keypress");const ee=a.executeCommand(y);return a.scrollIntoView(),ee}Ls({performWithFeedback:(a,y)=>sg(a,y)});function lg(a){return Ad(a,{atIndex:a.suggestionIndex+1}),!1}function cg(a){return Ad(a,{atIndex:a.suggestionIndex-1}),!1}Ls({complete:Au},{target:"mathfield",audioFeedback:"return",canUndo:!0,changeContent:!0,changeSelection:!0}),Ls({nextSuggestion:lg,previousSuggestion:cg},{target:"mathfield",audioFeedback:"keypress",changeSelection:!0});var Tf="mathlive#virtual-keyboard-message";function Ch(a){var y;return a.type!=="message"?!1:((y=a.data)==null?void 0:y.type)===Tf}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(Ch(y)){if(!yd(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(Se({type:Tf,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]"]]}},Df={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"}]},Td;function M0(a,y){var b,E,ee;const re=fc.singleton;if(!re)return;const ae=Iu(a),de=(E=(b=re.getKeycap(ae==null?void 0:ae.id))==null?void 0:b.variants)!=null?E:"";if(typeof de=="string"&&!E0(de)||Array.isArray(de)&&de.length===0){y==null||y();return}const ge={};let be="";for(const _n of fg(de)){const kr=_0(_n),wn=Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);ge[wn]=kr;const[rr,Ir]=If(kr);be+=`<div id=${wn} class="item ${Ir}">${rr}</div>`}const Ce=document.createElement("div");Ce.setAttribute("aria-hidden","true"),Ce.className="MLK__variant-panel",Ce.style.height="auto";const $e=Object.keys(ge).length;let Ye=5;$e===1?Ye=1:$e===2||$e===4?Ye=2:$e===3||$e===5||$e===6?Ye=3:$e>=7&&$e<14&&(Ye=4),Ce.style.width=`calc(var(--variant-keycap-length) * ${Ye} + 12px)`,Ce.innerHTML=vp.createHTML(be),wl.open({root:(ee=re==null?void 0:re.container)==null?void 0:ee.querySelector(".ML__keyboard"),child:Ce}),Td=new AbortController;const{signal:gt}=Td,Et=a==null?void 0:a.getBoundingClientRect();if(Et){Et.top-Ce.clientHeight<0&&(Ce.style.width="auto",$e<=6?Ce.style.height="56px":$e<=12?Ce.style.height="108px":$e<=18?Ce.style.height="205px":Ce.classList.add("compact"));const _n=Math.max(0,Math.min(window.innerWidth-Ce.offsetWidth,(Et.left+Et.right-Ce.offsetWidth)/2)),kr=Et.top-Ce.clientHeight+5;Ce.style.transform=`translate(${_n}px, ${kr}px)`,Ce.classList.add("is-visible"),requestAnimationFrame(()=>{Ce.addEventListener("pointerup",wn=>{const rr=Iu(wn.target);!(rr!=null&&rr.id)||!ge[rr.id]||(Mh(ge[rr.id]),Dd(),y==null||y(),wn.preventDefault())},{capture:!0,passive:!1,signal:gt}),Ce.addEventListener("pointerenter",wn=>{const rr=Iu(wn.target);!(rr!=null&&rr.id)||!ge[rr.id]||rr.classList.add("is-active")},{capture:!0,signal:gt}),Ce.addEventListener("pointerleave",wn=>{const rr=Iu(wn.target);!(rr!=null&&rr.id)||!ge[rr.id]||rr.classList.remove("is-active")},{capture:!0,signal:gt}),window.addEventListener("pointercancel",()=>{Dd(),y==null||y()},{signal:gt}),window.addEventListener("pointerup",()=>{Dd(),y==null||y()},{signal:gt})})}}function Dd(){Td==null||Td.abort(),Td=null,wl.state==="open"&&wl.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(Ue))y.push({class:"swatch-button",label:'<span style="background:'+Ue[b]+'"></span>',command:["applyStyle",{backgroundColor:b}]});return y}}function E0(a){return Df[a]!==void 0}function fg(a){var y;return typeof a!="string"?a:(Df[a]||(Df[a]=(y=dg(a))!=null?y:[]),Df[a])}function hg(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} {${hg(a[y])}}`).join("")}function Id(a){if(!a)return"";const y=new La,b=new Un({mode:"math",type:"root",body:Xo(a,{context:y,args:ee=>ee==="@"?"{\\class{ML__box-placeholder}{\\blacksquare}}":"\\placeholder{}"})}),E=gu(Cd(new Tr(b.render(y),{classes:"ML__base"}),y));return vu(E,{classes:"ML__latex"}).toMarkup()}function Pd(a){var y;if(Array.isArray(a))return a.map(E=>Pd(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=>_0(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 de=_d();de&&(E=de.virtualLayout),(!E||E==="auto")&&(E=(a={fr:"azerty",be:"azerty",al:"qwertz",ba:"qwertz",cz:"qwertz",de:"qwertz",hu:"qwertz",sk:"qwertz",ch:"qwertz"}[rt.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 de of re){const ge=[];for(const be of de)/[a-z]/.test(be)?ge.push({label:be,class:"hide-shift",shift:{label:be.toUpperCase()},variants:E0(be)?be:void 0}):be==="~"?E!=="dvorak"?ge.push("[backspace]"):ge.push({label:"[backspace]",width:1}):be==="^"?ge.push("[shift]"):be===" "&&ge.push("[separator-5]");ae.push(ge)}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:Pd({rows:ae})}}function k0(a){if(a==="alphabetic")return mg();if(typeof a=="string")return console.assert(C0[a]!==void 0,`MathLive 0.98.5: unknown keyboard layout "${a}"`),k0(C0[a]);let y;if("rows"in a&&Array.isArray(a.rows)){console.assert(!("layers"in a||"markup"in a),'MathLive 0.98.5: when providing a "rows" property, "layers" and "markup" are ignored');const ee=a,{rows:re}=ee,ae=tt(ee,["rows"]);y=me(Se({},ae),{layers:Pd({rows:a.rows})})}else if("markup"in a&&typeof a.markup=="string"){const ee=a,{markup:re}=ee,ae=tt(ee,["markup"]);y=me(Se({},ae),{layers:Pd(a.markup)})}else y=Se({},a),"layers"in a?y.layers=Pd(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()){Pu(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 de=ae,ge=[re===y?"selected":"layer-switch"];de.tooltip&&ge.push("MLK__tooltip"),de.labelClass&&ge.push(...de.labelClass.split(" ")),ee+=`<div class="${ge.join(" ")}"`,de.tooltip&&(ee+=" data-tooltip='"+((b=ft(de.tooltip))!=null?b:de.tooltip)+"' "),re!==y&&(ee+=`data-layer="${de.layers[0].id}"`),ee+=`>${(E=de.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='${ft("tooltip.undo")}'>
<svg><use xlink:href='#svg-undo' /></svg>
</div>`,redo:`<div class='action ${y.canRedo===!1?"disabled":""}'
data-command='"redo"'
data-tooltip='${ft("tooltip.redo")}'>
<svg><use xlink:href='#svg-redo' /></svg>
</div>`,cutToClipboard:`
<div class='action'
data-command='"cutToClipboard"'
data-tooltip='${ft("tooltip.cut to clipboard")}'>
<svg><use xlink:href='#svg-cut' /></svg>
</div>
`,copyToClipboard:`
<div class='action'
data-command='"copyToClipboard"'
data-tooltip='${ft("tooltip.copy to clipboard")}'>
<svg><use xlink:href='#svg-copy' /></svg>
</div>
`,pasteFromClipboard:`
<div class='action'
data-command='"pasteFromClipboard"'
data-tooltip='${ft("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=fc.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]=If(b);a.innerHTML=window.MathfieldElement.createHTML(E)}}function xg(){_s("virtual-keyboard"),_s("core"),Lf()}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,de)=>Mg(a,ae,de)).join(""));const E=document.createElement("div");E.className="MLK__backdrop",E.appendChild(b),y.appendChild(E),y.addEventListener("pointerdown",kg,{passive:!1});const ee=y.querySelectorAll(".ML__edit-toolbar");if(ee)for(const ae of ee)ae.addEventListener("click",de=>{var ge,be;let Ce=de.target,$e="";for(;Ce&&!$e;)$e=(ge=Ce==null?void 0:Ce.getAttribute("data-command"))!=null?ge:"",Ce=(be=Ce==null?void 0:Ce.parentElement)!=null?be:null;$e&&a.executeCommand(JSON.parse($e))});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",de=>de.preventDefault());return a.currentLayer=a.latentLayer,y}function Mg(a,y,b){const E=[];if(!("layers"in y))return"";for(const ee of y.layers)E.push(`<div tabindex="-1" class="MLK__layer" id="${ee.id}">`),(a.normalizedLayouts.length>1||y.displayEditToolbar)&&(E.push("<div class='MLK__toolbar' role='toolbar'>"),E.push(gg(a,b)),y.displayEditToolbar&&E.push('<div class="ML__edit-toolbar right"></div>'),E.push("</div>")),E.push(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,de]=If(ee);/(^|\s)separator/.test(de)?b+=`<div class="${de}"`:b+=`<div tabindex="-1" id="${re}" class="${de}"`,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 If(a,y={shifted:!1}){var b,E,ee,re,ae,de,ge;let be="",Ce=(b=a.class)!=null?b:"";if(y.shifted&&Pu(a)&&(Ce+=" is-active"),y.shifted&&"shift"in a)typeof a.shift=="string"?be=Id(a.shift):typeof a.shift=="object"&&(be=a.shift.label?a.shift.label:(E=Id(a.shift.latex||a.shift.insert||"")||a.shift.key)!=null?E:""),typeof a.shift=="object"&&(Ce=(re=(ee=a.shift.class)!=null?ee:a.class)!=null?re:"");else{if(be=a.label?a.label:(ae=Id(a.latex||a.insert||"")||a.key)!=null?ae:"",a.shift){let $e;typeof a.shift=="string"?$e=Id(a.shift):a.shift.label?$e=a.shift.label:$e=(de=Id(a.shift.latex||a.shift.insert||"")||a.shift.key)!=null?de:"",be+=`<span class="MLK__shift">${$e}</span>`}a.aside&&(be+=`<aside>${a.aside}</aside>`)}return a.layer&&!/layer-switch/.test(Ce)&&(Ce+=" layer-switch"),/(^|\s)(separator|action|shift|fnbutton|bigfnbutton)($|\s)/.test(Ce)||(Ce+=" MLK__keycap"),!/\bw[0-9]+\b/.test(Ce)&&a.width&&(Ce+=(ge={0:" w0",.5:" w5",1.5:" w15",2:" w20",5:" w50"}[a.width])!=null?ge:""),[be,Ce||"MLK__keycap"]}var Fc={"[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 _0(a){var y;if(typeof a=="string"){if(a==="[.]"&&window.MathfieldElement.decimalSeparator===","&&(a="[,]"),!Fc[a])return{latex:a};a={label:a}}let b;return"label"in a&&a.label&&Fc[a.label]&&(b=me(Se(Se({},Fc[a.label]),a),{label:Fc[a.label].label})),"key"in a&&a.key&&Fc[a.key]&&(b=me(Se(Se({},Fc[a.key]),a),{key:Fc[a.key].key})),b?(b.command==="insertDecimalSeparator"&&(b.label=(y=window.MathfieldElement.decimalSeparator)!=null?y:"."),a.label==="[action]"&&(b=Se(Se({},b),window.mathVirtualKeyboard.actionKeycap)),a.label==="[shift]"&&(b=Se(Se({},b),window.mathVirtualKeyboard.shiftKeycap)),a.label==="[backspace]"&&(b=Se(Se({},b),window.mathVirtualKeyboard.backspaceKeycap)),a.label==="[tab]"&&(b=Se(Se({},b),window.mathVirtualKeyboard.tabKeycap)),b):a}var Od;function kg(a){var y;if(a.button!==0)return;const b=fc.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=Iu(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,de=ae.signal;ee.classList.add("is-pressed"),ee.addEventListener("pointerenter",Pf(ae),{capture:!0,signal:de}),ee.addEventListener("pointerleave",Pf(ae),{capture:!0,signal:de}),ee.addEventListener("pointercancel",Pf(ae),{signal:de}),ee.addEventListener("pointerup",Pf(ae),{signal:de}),Pu(re)&&(ee.classList.add("is-active"),b.shiftPressCount++),re.variants&&(Od&&clearTimeout(Od),Od=setTimeout(()=>{ee.classList.contains("is-pressed")&&(ee.classList.remove("is-pressed"),ee.classList.add("is-active"),a.target&&"releasePointerCapture"in a.target&&a.target.releasePointerCapture(a.pointerId),M0(ee,()=>{ae.abort(),ee==null||ee.classList.remove("is-active")}))},300)),a.preventDefault()}function Pf(a){return y=>{const b=Iu(y.target);if(!(b!=null&&b.id))return;const E=fc.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"),Pu(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"),Pu(ee)&&(E.shiftPressCount--,b.classList.toggle("is-active",E.isShifted));return}if(y.type==="pointerup"){Od&&clearTimeout(Od),Pu(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"}]):Mh(ee.shift):Mh(ee),E.shiftPressCount===1&&!y.shiftKey&&(E.shiftPressCount=0)),a.abort(),y.preventDefault();return}}}}function Mh(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=fc.singleton)==null||y.executeCommand(b)}function _g(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 Iu(a){if(!a)return;let y=a;for(;y&&!_g(y);)y=y.parentElement;return y!=null?y:void 0}function Pu(a){return!!a.class&&/(^|\s)shift($|\s)/.test(a.class)}var fc=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"&&it()&&this.show({animate:!0})},300)}),document.addEventListener("focusout",ee=>{ee.target.mathVirtualKeyboardPolicy!=="manual"&&setTimeout(()=>{L0()||this.hide()},300)})}get currentLayer(){var y,b,E;return(E=(b=(y=this._element)==null?void 0:y.querySelector(".MLK__layer.is-visible"))==null?void 0:b.id)!=null?E:""}set currentLayer(y){var b;if(!this._element){this.latentLayer=y;return}let E=y?this._element.querySelector(`#${y}.MLK__layer`):null;E||(E=this._element.querySelector(".MLK__layer")),E&&((b=this._element.querySelector(".MLK__layer.is-visible"))==null||b.classList.remove("is-visible"),E.classList.add("is-visible")),this.render()}get shiftPressCount(){return this._shiftPressCount}set shiftPressCount(y){var b;this._shiftPressCount=y>2||y<0?0:y,(b=this._element)==null||b.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.render()}get isShifted(){return this._shiftPressCount>0}resetKeycapRegistry(){this.keycapRegistry={}}registerKeycap(y){const b="ML__k"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);return this.keycapRegistry[b]=y,b}getKeycap(y){return y?this.keycapRegistry[y]:void 0}getLayer(y){const b=this.normalizedLayouts;for(const E of b)for(const ee of E.layers)if(ee.id===y)return ee}get alphabeticLayout(){return this._alphabeticLayout}set alphabeticLayout(y){this._alphabeticLayout=y,this.rebuild()}get actionKeycap(){return this._actionKeycap}set actionKeycap(y){this._actionKeycap=typeof y=="string"?{label:y}:y}get shiftKeycap(){return this._shiftKeycap}set shiftKeycap(y){this._shiftKeycap=typeof y=="string"?{label:y}:y}get backspaceKeycap(){return this._backspaceKeycap}set backspaceKeycap(y){this._backspaceKeycap=typeof y=="string"?{label:y}:y}get tabKeycap(){return this._tabKeycap}set tabKeycap(y){this._tabKeycap=typeof y=="string"?{label:y}:y}get layouts(){return this._layouts}set layouts(y){this.updateNormalizedLayouts(y),this.rebuild()}updateNormalizedLayouts(y){const b=Array.isArray(y)?[...y]:[y],E=b.findIndex(ee=>ee==="default");E>=0&&b.splice(E,1,"numeric","symbols","alphabetic","greek"),this._layouts=Object.freeze(b),this._normalizedLayouts=b.map(ee=>k0(ee))}get normalizedLayouts(){return this._normalizedLayouts||this.updateNormalizedLayouts(this._layouts),this._normalizedLayouts}get editToolbar(){return this._editToolbar}set editToolbar(y){this._editToolbar=y,this.rebuild()}get container(){return this._container}set container(y){this._container=y,this.rebuild()}static get singleton(){if(this._singleton===void 0)try{this._singleton=new tm}catch(y){this._singleton=null}return this._singleton}get style(){return this._style}addEventListener(y,b,E){this.listeners[y]||(this.listeners[y]=new Set),this.listeners[y].has(b)||this.listeners[y].add(b)}dispatchEvent(y){return!this.listeners[y.type]||this.listeners[y.type].size===0?!0:(this.listeners[y.type].forEach(b=>{typeof b=="function"?b(y):b==null||b.handleEvent(y)}),!y.defaultPrevented)}removeEventListener(y,b,E){this.listeners[y]&&this.listeners[y].delete(b)}get element(){return this._element}set element(y){var b;this._element!==y&&((b=this._element)==null||b.remove(),this._element=y)}get visible(){return this._visible}set visible(y){y?this.show():this.hide()}get boundingRect(){var y;if(!this._visible)return new DOMRect;const b=(y=this._element)==null?void 0:y.getElementsByClassName("MLK__plate")[0];return b?b.getBoundingClientRect():new DOMRect}adjustBoundingRect(){var y,b;const E=this.boundingRect.height;if(this.container===document.body){(y=this._element)==null||y.style.setProperty("--_keyboard-height",`calc(${E}px + var(--_padding-top) + var(--_padding-bottom) + env(safe-area-inset-bottom, 0))`);const ee=E-1;this.container.style.paddingBottom=this.originalContainerBottomPadding?`calc(${this.originalContainerBottomPadding} + ${ee}px)`:`${ee}px`}else(b=this._element)==null||b.style.setProperty("--_keyboard-height",`${E}px`)}rebuild(){if(this._rebuilding||!this._element)return;this._rebuilding=!0;const y=this.currentLayer;requestAnimationFrame(()=>{this._rebuilding=!1,this._element&&(this._element.remove(),this._element=void 0),this.visible&&(this.buildAndAttachElement(),this.currentLayer=y,this.render(),this.adjustBoundingRect(),this._element.classList.add("is-visible"))})}render(){if(!this._element)return;const y=this.getLayer(this.currentLayer);this._element.classList.toggle("backdrop-is-transparent",!!(y&&(y.backdrop||y.container)));const b=this._element.querySelectorAll(".MLK__layer.is-visible .MLK__keycap, .MLK__layer.is-visible .action, .fnbutton, .MLK__layer.is-visible .bigfnbutton, .MLK__layer.is-visible .shift");if(b)for(const E of b){const ee=this.getKeycap(E.id);if(ee){const[re,ae]=If(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}),Dd(),wg(),(b=this._element)==null||b.remove(),this._element=void 0,this.originalContainerBottomPadding!==null&&(E.style.paddingBottom=this.originalContainerBottomPadding)}this.stateChanged()}}get height(){var y,b;return(b=(y=this.element)==null?void 0:y.offsetHeight)!=null?b:0}buildAndAttachElement(){var y;console.assert(!this.element),this.element=Cg(this),window.addEventListener("contextmenu",this,{capture:!0}),this.element.addEventListener("contextmenu",b=>{b.shiftKey||((b.ctrlKey||b.button===2)&&M0(b.target),b.preventDefault(),b.stopPropagation())},{capture:!0}),(y=this.container)==null||y.appendChild(this.element)}handleEvent(y){if(Ch(y)){if(!yd(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:Se({type:Tf,action:y},b)}));return}if(E)E.postMessage(Se({type:Tf,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 Be(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"?Sl[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=Cf(),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(dt()&&!("mathVirtualKeyboard"in window))if(window===window.top){const a=fc.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>a})}else Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>ug.singleton,configurable:!0});function Of(a){const y={};for(const b of Object.keys(a))switch(b){case"scriptDepth":const E=a.scriptDepth;if(Be(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(de=>parseInt(de.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=fc.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>re})}ee="manual"}y.mathVirtualKeyboardPolicy=ee;break;case"letterShapeStyle":a.letterShapeStyle==="auto"?rt.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=at(a.macros);break;default:Be(a[b])?y[b]=[...a[b]]:typeof a[b]=="object"&&!(a[b]instanceof Element)&&b!=="computeEngine"?y[b]=Se({},a[b]):y[b]=a[b]}return y}function zc(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:Be(a[ee])?E[ee]=[...a[ee]]:typeof a[ee]=="object"&&!(a[ee]instanceof Element)&&ee!=="computeEngine"?E[ee]=Se({},a[ee]):E[ee]=a[ee];return typeof y=="string"?E[y]:E}function Bf(){return{readOnly:!1,defaultMode:"math",macros:{},registers:{},colorMap:Dt,backgroundColorMap:qe,letterShapeStyle:rt.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:lh,inlineShortcuts:ff,inlineShortcutTimeout:0,mathVirtualKeyboardPolicy:"auto",virtualKeyboardTargetOrigin:window==null?void 0:window.origin,originValidator:"none",onInlineShortcut:()=>"",onScrollIntoView:null,onExport:sh,value:""}}function A0(a){return a.defaultMode==="inline-math"?"math":a.defaultMode}function hc(a,y){!a||!y||(Be(a)?a.forEach(b=>hc(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),hc(a.body,y),hc(a.above,y),hc(a.below,y),hc(a.subscript,y),hc(a.superscript,y)))}function Eh(a,y,b,E){function ee(ae,de){for(const ge of re)if(ge.style[ae]!==de)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=dl),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 Wl(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)}ir(["math","displaymath"],Gs),ir("center",Gs),Bt("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 sa("lines",a.args,[],{leftDelim:".",rightDelim:".",columns:[{align:"l"}]})}),Cr("array","{columns:colspec}",(a,y,b,E)=>new sa(a,kh(y),b,{columns:E[0],mathstyleName:"textstyle"})),Cr(["equation","equation*","subequations"],"",(a,y,b)=>new sa(a,kh(y),b,{columns:[{align:"c"}]})),Cr(["multline","multline*"],"",Gs),Cr(["align","align*","aligned","eqnarray"],"",Gs),Cr("split","",Gs),Cr(["gather","gathered"],"",Gs),Cr(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],"[columns:colspec]",Gs),Cr(["smallmatrix","smallmatrix*"],"[columns:colspec]",Gs),Cr(["cases","dcases","rcases"],"",Gs);function Tg(a){for(const y of a)for(const b of y)if(b.length>0)return!1;return!0}function kh(a,y=1){return Tg(a)?Array(y).fill([[new Un({type:"first"}),new Fi]]):a.map(b=>b.length===0?[[new Un({type:"first"})]]:b.map(E=>E.length===0?[new Un({type:"first"})]:(E[0].type!=="first"&&E.unshift(new Un({type:"first"})),E)))}function Gs(a,y=[[[]]],b=[],E=[]){switch(y=kh(y,["split","align","align*","aligned","eqnarray"].includes(a)?2:1),a){case"math":return new sa(a,y,b,{mathstyleName:"textstyle"});case"displaymath":return new sa(a,y,b,{mathstyleName:"textstyle"});case"center":return new sa(a,y,b,{columns:[{align:"c"}]});case"multline":case"multline*":return new sa(a,y,b,{columns:[{align:"m"}],leftDelim:".",rightDelim:"."});case"split":return new sa(a,y,b,{columns:[{align:"r"},{align:"l"}],minColumns:2});case"gather":case"gathered":return new sa(a,y,b,{columns:[{gap:.25},{align:"c"},{gap:0}]});case"pmatrix":case"pmatrix*":return new sa(a,y,b,{mathstyleName:"textstyle",leftDelim:"(",rightDelim:")",columns:Kc(E[0])});case"bmatrix":case"bmatrix*":return new sa(a,y,b,{mathstyleName:"textstyle",leftDelim:"[",rightDelim:"]",columns:Kc(E[0])});case"Bmatrix":case"Bmatrix*":return new sa(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\lbrace",rightDelim:"\\rbrace",columns:Kc(E[0])});case"vmatrix":case"vmatrix*":return new sa(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\vert",rightDelim:"\\vert",columns:Kc(E[0])});case"Vmatrix":case"Vmatrix*":return new sa(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\Vert",rightDelim:"\\Vert",columns:Kc(E[0])});case"matrix":case"matrix*":return new sa(a,y,b,{mathstyleName:"textstyle",leftDelim:".",rightDelim:".",columns:Kc(E==null?void 0:E[0])});case"smallmatrix":case"smallmatrix*":return new sa(a,y,b,{mathstyleName:"scriptstyle",columns:Kc(E==null?void 0:E[0]),colSeparationType:"small",arraystretch:.5});case"cases":case"dcases":return new sa(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 sa(a,y,b,{arraystretch:1.2,leftDelim:".",rightDelim:"\\rbrace",columns:[{align:"l"},{gap:1},{align:"l"}]});case"lines":return new sa(a,y,b,{leftDelim:".",rightDelim:".",columns:[{align:"l"}]});case"align":case"align*":case"aligned":case"eqnarray":{let ee=0;for(const de of y)ee=Math.max(ee,de.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 sa(a,y,b,{arraycolsep:0,columns:re,minColumns:2})}}return new sa(a,y,b,{mathstyleName:"textstyle"})}function Kc(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 Dg(a,y){let b=a.at(a.position);for(;b&&!(b.parent instanceof sa);)b=b.parent;if(b&&b.type==="array"&&b.environmentName,!b||!(b.parent instanceof sa)){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=$f()),ee.length===0&&(ee=$f());let ae;return y.endsWith("column")?(ae=Gs("split",[[re,ee]]),a.root=ae,Hc(ae,0,0)?Wc(a,ae,0,0):Hc(ae,0,1)?Wc(a,ae,0,1):a.position=a.offsetOf(E)):(ae=Gs("lines",[[re],[ee]]),a.root=ae,Hc(ae,0,0)?Wc(a,ae,0,0):Hc(ae,1,0)?Wc(a,ae,1,0):a.position=a.offsetOf(E)),[void 0,[0,0]]}if(b.parent instanceof Wa){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=$f()),re.length===0&&(re=$f());let de="pmatrix";const ge=ee.leftDelim,be=ee.rightDelim;ge==="("&&(be===")"||be==="?")?de="pmatrix":(ge==="["||ge==="\\lbrack")&&(be==="]"||be==="\\rbrack"||be==="?")?de="bmatrix":ge==="\\vert"&&be==="\\vert"?de="vmatrix":ge==="\\Vert"&&be==="\\Vert"?de="Vmatrix":(ge==="{"||ge==="\\lbrace")&&(be==="."||be==="?")&&(de="cases");const Ce=Gs(de,y.endsWith("column")?[[ae,re]]:[[ae],[re]]);return ee.parent.addChildBefore(Ce,ee),ee.parent.removeChild(ee),Hc(Ce,0,0)?Wc(a,Ce,0,0):y.endsWith("column")?Hc(Ce,0,1)?Wc(a,Ce,0,1):a.position=a.offsetOf(b):Hc(Ce,1,0)?Wc(a,Ce,1,0):a.position=a.offsetOf(b),[void 0,[0,0]]}}return b&&b.parent instanceof sa?[b.parent,b.parentBranch]:[void 0,[0,0]]}function Hc(a,y,b){const E=a.getCell(y,b);return!E||E.length!==2?!1:E[1].type==="placeholder"}function Ig(a,y,b,E){const ee=y.getCell(b,E);return ee?[a.offsetOf(ee[0]),a.offsetOf(ee[ee.length-1])]:-1}function Wc(a,y,b,E){const ee=Ig(a,y,b,E);typeof ee!="number"&&a.setSelection(ee)}function Rf(a,y,b,E,ee){const re=y.getCell(b,E);re&&a.setPositionHandlingPlaceholder(a.offsetOf(re[ee==="start"?0:re.length-1]))}function Nf(a,y){const[b,[E,ee]]=Dg(a,y);if(b)switch(y){case"after row":b.addRowAfter(E),Rf(a,b,E+1,0,"end");break;case"after column":if(b.maxColumns<=b.colCount){a.announce("plonk");return}b.addColumnAfter(ee),Rf(a,b,E,ee+1,"end");break;case"before row":b.addRowBefore(E),Rf(a,b,E,0,"start");break;case"before column":if(b.maxColumns<=b.colCount){a.announce("plonk");return}b.addColumnBefore(ee),Rf(a,b,E,ee,"start");break}}function T0(a){return a.contentWillChange({inputType:"insertText"})?(Nf(a,"after row"),a.contentDidChange({inputType:"insertText"}),!0):!1}function Pg(a){return a.contentWillChange({inputType:"insertText"})?(Nf(a,"before row"),a.contentDidChange({inputType:"insertText"}),!0):!1}function D0(a){return a.contentWillChange({inputType:"insertText"})?(Nf(a,"after column"),a.contentDidChange({inputType:"insertText"}),!0):!1}function Og(a){return a.contentWillChange({inputType:"insertText"})?(Nf(a,"before column"),a.contentDidChange({inputType:"insertText"}),!0):!1}function I0(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 P0(a,y){let b=a.at(a.position);for(;b&&!(Array.isArray(b.parentBranch)&&b.parent instanceof sa);)b=b.parent;if(Array.isArray(b==null?void 0:b.parentBranch)&&(b==null?void 0:b.parent)instanceof sa){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 Bg(a){return a.contentWillChange({inputType:"deleteContent"})?(P0(a,"row"),a.contentDidChange({inputType:"deleteContent"}),!0):!1}function Rg(a){return a.contentWillChange({inputType:"deleteContent"})?(P0(a,"column"),a.contentDidChange({inputType:"deleteContent"}),!0):!1}Ls({addRowAfter:T0,addColumnAfter:D0,addRowBefore:Pg,addColumnBefore:Og,removeRow:Bg,removeColumn:Rg,setEnvironment:I0},{target:"model",canUndo:!0,changeContent:!0,changeSelection:!0});function $f(){return[new Fi]}var O0=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}};O0.maximumDepth=1e3;var Ng=O0;function _h(a,y,b){if(a.at(y).mode!=="text")return y;const E=b==="backward"?-1:1;let ee;if(fe.test(a.at(y).value)){let re=y,ae;do ae=a.at(re).mode==="text"&&fe.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 Ou(a,y,b){var E,ee,re,ae,de,ge,be;const Ce=a.position;(E=b==null?void 0:b.extend)!=null&&E||a.collapseSelection(y);let $e=a.at(a.position);if(y==="forward"&&($e.type==="subsup"?($e=$e.rightSibling,$e||($e=a.at(a.position+1))):$e=a.at(a.position+1)),!$e)return a.announce("plonk"),!1;let Ye=a.offsetOf($e);if($e instanceof al)Ye=_h(a,Ye,y);else if($e instanceof ns)if($e.isSuggestion)for(console.assert(y==="forward");$e&&$e instanceof ns;)$e.isSuggestion=!1,Ye=a.offsetOf($e),$e=$e.rightSibling;else if(y==="forward"){if($e=$e.rightSibling,!$e||!($e instanceof ns))return a.announce("plonk"),!1;for(;$e&&$e instanceof ns&&/[a-zA-Z\*]/.test($e.value);)Ye=a.offsetOf($e),$e=$e.rightSibling}else{if($e=$e.leftSibling,!$e||!($e instanceof ns))return a.announce("plonk"),!1;for(;$e&&$e instanceof ns&&/[a-zA-Z\*]/.test($e.value);)Ye=a.offsetOf($e),$e=$e.leftSibling}else if(y==="forward"&&$e.type==="mopen"){let gt=0;do $e.type==="mopen"?gt+=1:$e.type==="mclose"&&(gt-=1),$e=$e.rightSibling;while(!$e.isLastSibling&&gt!==0);Ye=a.offsetOf($e.leftSibling)}else if(y==="backward"&&$e.type==="mclose"){let gt=0;do $e.type==="mopen"?gt+=1:$e.type==="mclose"&&(gt-=1),$e=$e.leftSibling;while(!$e.isFirstSibling&&gt!==0);Ye=a.offsetOf($e)}else if(y==="backward")if($e.type==="first")for(;Ye>0&&$e.type==="first";)Ye-=1,$e=a.at(Ye);else{const gt=$e.type;$e.type==="subsup"&&(Ye=a.offsetOf(a.at(Ye).leftSibling)),Ye-=1;let Et=(ee=a.at(Ye))==null?void 0:ee.type;for(;Ye>=0&&Et===gt;)((re=a.at(Ye))==null?void 0:re.type)==="subsup"?Ye=a.offsetOf(a.at(Ye).leftSibling):Ye-=1,Et=a.at(Ye).type}else{const{type:gt}=$e;let Et=(ae=a.at(Ye))==null?void 0:ae.type;const{lastOffset:_n}=a;for(;Ye<=_n&&(Et===gt||Et==="subsup");){for(;((de=a.at(Ye).rightSibling)==null?void 0:de.type)==="subsup";)Ye=a.offsetOf(a.at(Ye).rightSibling);Ye+=1,Et=(ge=a.at(Ye))==null?void 0:ge.type}Ye-=1}if((be=b==null?void 0:b.extend)!=null&&be){if(!a.setSelection(a.anchor,Ye))return a.announce("plonk"),!1}else{if(Ye===a.position)return a.announce("plonk"),!1;a.position=Ye}return a.announce("move",Ce),a.mathfield.stopCoalescingUndo(),!0}function Cl(a,y,b){var E,ee;if(b=b!=null?b:{extend:!1},a.mathfield.adoptStyle=y==="backward"?"right":"left",y!=="forward"){const[de,ge]=g0(a);de!==void 0&&ge!==void 0&&a.deleteAtoms([de,ge])}if(y==="upward")return Fg(a,b);if(y==="downward")return zg(a,b);if(b.extend){let de=Ff(a,a.position,y);de<0&&(de=0),de>a.lastOffset&&(de=a.lastOffset);const ge=a.setSelection(a.anchor,de);return a.mathfield.stopCoalescingUndo(),ge}if(a.selectionIsPlaceholder){a.collapseSelection(y);const de=Cl(a,y);return a.mathfield.stopCoalescingUndo(),de}let re=a.position;const ae=re;if(a.collapseSelection(y)?(re=a.position,B0(a,re)||(re=Ff(a,re,y))):re=Ff(a,re,y),re<0||re>a.lastOffset){let de=!0;return a.silenceNotifications||(de=(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),de&&a.announce("plonk"),de}return a.setPositionHandlingPlaceholder(re),a.mathfield.stopCoalescingUndo(),a.announce("move",ae),!0}function Ff(a,y,b){return y=y+(b==="forward"?1:-1),y<0||y>a.lastOffset||B0(a,y)?y:Ff(a,y,b)}function B0(a,y){var b;const E=a.at(y);let ee=E.parent;for(;ee&&!ee.inCaptureSelection;)ee=ee.parent;return!(ee!=null&&ee.inCaptureSelection||(b=E.parent)!=null&&b.skipBoundary&&(!E.isFirstSibling&&E.isLastSibling||E.type==="first")||a.mathfield.hasEditablePrompts&&!E.parentPrompt)}function $g(a,y,b){let E=1/0,ee=0;for(;ee<y.length;ee++){const re=Cu(a.getHTMLElement(y[ee])).right,ae=Math.abs(b-re);if(ae<=E)E=ae;else break}return y[ee-1]}function zf(a,y,b,E,ee){const re=a.mathfield.hasEditablePrompts,ae=re?b.filter(be=>be.type==="prompt"&&!be.captureSelection):b,de=Cu(a.mathfield.getHTMLElement(y)).right,ge=a.offsetOf($g(a.mathfield,ae,de))-(re?1:0);if(E){const[be,Ce]=a.selection.ranges[0];let $e;ge<(ee==="up"?be:Ce)?$e={ranges:[[ge,Ce]],direction:"backward"}:$e={ranges:[[be,ge]],direction:"forward"},a.setSelection($e)}else a.setPositionHandlingPlaceholder(ge);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 ge,be;let Ce=!0;return a.silenceNotifications||(Ce=(be=(ge=a.mathfield.host)==null?void 0:ge.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"upward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?be:!0),a.announce(Ce?"plonk":"line"),Ce},ae=a.at(a.position);let de=ae;for(;de&&de.parentBranch!=="below"&&!(Array.isArray(de.parentBranch)&&de.parent instanceof sa);)de=de.parent;if(Array.isArray(de==null?void 0:de.parentBranch)&&de.parent instanceof sa){const ge=de.parent;if(de.parentBranch[0]<1)return re();const be=de.parentBranch[0]-1,Ce=ge.array[be][de.parentBranch[1]];if(!Ce.some(Ye=>Ye.type==="prompt"&&!Ye.captureSelection)&&a.mathfield.hasEditablePrompts)return re();zf(a,ae,Ce,ee,"up")}else if(de){const ge=(E=de.parent.branch("above"))!=null?E:de.parent.createBranch("above");if(!ge.some(Ce=>Ce.type==="prompt"&&Ce.placeholderId)&&a.mathfield.hasEditablePrompts)return re();zf(a,ae,ge,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 ge,be;let Ce=!0;return a.silenceNotifications||(Ce=(be=(ge=a.mathfield.host)==null?void 0:ge.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"downward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?be:!0),a.announce(Ce?"plonk":"line"),Ce},ae=a.at(a.position);let de=ae;for(;de&&de.parentBranch!=="above"&&!(Array.isArray(de.parentBranch)&&de.parent instanceof sa);)de=de.parent;if(Array.isArray(de==null?void 0:de.parentBranch)&&de.parent instanceof sa){const ge=de.parent;if(de.parentBranch[0]+1>ge.array.length-1)return re();const be=de.parentBranch[0]+1,Ce=ge.array[be][de.parentBranch[1]];if(!Ce.some(Ye=>Ye.type==="prompt"&&!Ye.captureSelection)&&a.mathfield.hasEditablePrompts)return re();zf(a,ae,Ce,ee,"down")}else if(de){const ge=(E=de.parent.branch("below"))!=null?E:de.parent.createBranch("below");if(!ge.some(Ce=>Ce.type==="prompt")&&a.mathfield.hasEditablePrompts)return re();zf(a,ae,ge,ee,"down")}else return re();return!0}function R0(a){const y=a.position,b=a.at(y).parent;return b!=null&&b.parent?(a.position=a.offsetOf(b),a.mathfield.stopCoalescingUndo(),a.announce("move",y),!0):(a.announce("plonk"),!1)}function Kg(a){let y=0,b=a.at(a.position),E=!1;for(;b;)(!b.hasEmptyBranch("superscript")||!b.hasEmptyBranch("subscript"))&&(y+=1),b.hasEmptyBranch("superscript")?b.hasEmptyBranch("subscript")||(E=!1):E=!0,b=b.parent;return E?y:0}function Hg(a){let y=0,b=a.at(a.position),E=!1;for(;b;)(!b.hasEmptyBranch("superscript")||!b.hasEmptyBranch("subscript"))&&(y+=1),b.hasEmptyBranch("superscript")?b.hasEmptyBranch("subscript")||(E=!0):E=!1,b=b.parent;return E?y:0}function N0(a){var y;if(a.collapseSelection(),Kg(a)>=a.mathfield.options.scriptDepth[1])return a.announce("plonk"),!1;let b=a.at(a.position);return b.subsupPlacement===void 0&&(((y=b.rightSibling)==null?void 0:y.type)!=="subsup"&&b.parent.addChildAfter(new js({style:b.computedStyle}),b),b=b.rightSibling),b.createBranch("superscript"),a.setSelection(a.getSiblingsRange(a.offsetOf(b.superscript[0]))),!0}function $0(a){var y;if(a.collapseSelection(),Hg(a)>=a.mathfield.options.scriptDepth[0])return a.announce("plonk"),!1;let b=a.at(a.position);return b.subsupPlacement===void 0&&(((y=a.at(a.position+1))==null?void 0:y.type)!=="subsup"&&b.parent.addChildAfter(new js({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(ge){const be=[],Ce=[];return[...ge.querySelectorAll(`input, select, textarea, a[href], button,
[tabindex], audio[controls], video[controls],
[contenteditable]:not([contenteditable="false"]), details>summary`)].filter(y).forEach((Ye,gt)=>{const Et=E(Ye);Et===0?be.push(Ye):Ce.push({documentOrder:gt,tabIndex:Et,node:Ye})}),Ce.sort((Ye,gt)=>Ye.tabIndex===gt.tabIndex?Ye.documentOrder-gt.documentOrder:Ye.tabIndex-gt.tabIndex).map(Ye=>Ye.node).concat(be)}function y(ge){return!(!b(ge)||ee(ge)||E(ge)<0)}function b(ge){return!(ge.disabled||ge.type==="hidden"&&ge.tagName.toUpperCase()==="INPUT"||de(ge))}function E(ge){var be;const Ce=Number.parseInt((be=ge.getAttribute("tabindex"))!=null?be:"NaN",10);return Number.isNaN(Ce)?ge.contentEditable==="true"||(ge.nodeName==="AUDIO"||ge.nodeName==="VIDEO")&&ge.getAttribute("tabindex")===null?0:ge.tabIndex:Ce}function ee(ge){return ge.tagName.toUpperCase()==="INPUT"&&ge.type==="radio"&&!ae(ge)}function re(ge,be){for(const Ce of ge)if(Ce.checked&&Ce.form===be)return Ce;return null}function ae(ge){var be;if(!ge.name)return!0;const $e=((be=ge.form)!=null?be:ge.ownerDocument).querySelectorAll('input[type="radio"][name="'+ge.name+'"]'),Ye=re($e,ge.form);return!Ye||Ye===ge}function de(ge){if(!dt()||ge===document.activeElement||ge.contains(document.activeElement))return!1;if(getComputedStyle(ge).visibility==="hidden")return!0;const be=ge.getBoundingClientRect();if(be.width===0||be.height===0)return!0;for(;ge;){if(getComputedStyle(ge).display==="none")return!0;ge=ge.parentElement}return!1}return dt()?a(document.body):[]}function bs(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"?bs(a,[y.leftSibling,y]):bs(a,[y,y.leftSibling])}function ll(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 Kf(a,y,b=!0){var E,ee;const re=y==="forward"?1:-1;a.at(a.anchor).type==="placeholder"&&Cl(a,y);let ae;const de=a.at(a.anchor).parentPrompt;de?y==="forward"?ae=a.offsetOf(de)+1:ae=a.offsetOf(de.leftSibling):ae=Math.max(a.position+re,0);const ge=Lh(a,ae,y);if(!ge||y==="forward"&&a.offsetOf(ge)<ae||y==="backward"&&a.offsetOf(ge)>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 Ce=Wg();if(!document.activeElement||Ce.length<=1)return a.announce("plonk"),!1;let $e=Ce.indexOf(document.activeElement)+re;return $e<0&&($e=Ce.length-1),$e>=Ce.length&&($e=0),Ce[$e].focus(),a.mathfield.stopCoalescingUndo(),!0}return ll(a,ge),!0}function Lh(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)}Ls({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 de=b.subsupPlacement?$0(a):N0(a);return a.mathfield.stopCoalescingUndo(),de}E.branch(re)||E.createBranch(re);const ae=a.setSelection(a.getBranchRange(a.offsetOf(E),re));return a.mathfield.stopCoalescingUndo(),ae},moveBeforeParent:a=>{const{parent:y}=a.at(a.position);return y?(a.position=a.offsetOf(y),a.mathfield.stopCoalescingUndo(),!0):(a.announce("plonk"),!1)},moveAfterParent:a=>R0(a),moveToNextChar:a=>Cl(a,"forward"),moveToPreviousChar:a=>Cl(a,"backward"),moveUp:a=>Cl(a,"upward"),moveDown:a=>Cl(a,"downward"),moveToNextWord:a=>Ou(a,"forward"),moveToPreviousWord:a=>Ou(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 Kf(a,"forward");const re=a.at(a.position);if(re.mode==="text"){if(a.selectionIsCollapsed){let Ye=re;for(;Ye&&Ye.mode==="text";)Ye=Ye.leftSibling;let gt=re;for(;((y=gt.rightSibling)==null?void 0:y.mode)==="text";)gt=gt.rightSibling;if(Ye&&gt)return bs(a,[Ye,gt])}if(re.rightSibling.mode==="text"){let Ye=re;for(;Ye&&Ye.mode==="text";)Ye=Ye.rightSibling;return Ye?(ll(a,(b=Ye.leftSibling)!=null?b:Ye),a.mathfield.switchMode("math"),!0):ll(a,a.lastOffset)}}const de=a.at(a.anchor).parentPrompt,ge=de?a.offsetOf(de)+1:Math.max(a.position+1,0),be=Lh(a,ge,"forward");if(be)return ll(a,be);const Ce=F0(a,re,Ye=>Ye.type==="leftright"||Ye.type==="text","forward");if(Ce){if(Ce.mode==="text"){let Ye=Ce;for(;Ye&&Ye.mode==="text";)Ye=Ye.rightSibling;return bs(a,[(E=Ce.leftSibling)!=null?E:Ce,(ee=Ye.leftSibling)!=null?ee:Ye])}return bs(a,Ce)}const $e=re.parent;if($e){if($e.type==="leftright"||$e.type==="surd")return bs(a,$e);if(re.parentBranch==="superscript"&&$e.subscript)return bs(a,$e.subscript);if(re.parentBranch==="above"&&$e.below)return bs(a,$e.below);if(re.parentBranch==="superscript"||re.parentBranch==="subscript")return ll(a,$e);if(re.parentBranch==="above"||re.parentBranch==="below")return bs(a,$e)}return ll(a,a.lastOffset)},moveToPreviousGroup:a=>{var y;if(a.position===0&&a.anchor===0)return Kf(a,"backward");let b=a.at(a.position);const E=b.mode;if(E==="text"){if(a.selectionIsCollapsed){let de=b;for(;de&&de.mode==="text";)de=de.leftSibling;let ge=b;for(;((y=ge.rightSibling)==null?void 0:y.mode)==="text";)ge=ge.rightSibling;if(de&&ge)return bs(a,[de,ge])}for(;b&&b.mode==="text";)b=b.leftSibling;return b?ll(a,b):ll(a,0)}const ee=a.at(a.anchor).parentPrompt,re=ee?a.offsetOf(ee.leftSibling):Math.max(a.position-1,0),ae=Lh(a,re,"backward");if(ae)return ll(a,ae);if(E==="math"){const de=F0(a,b,be=>be.type==="leftright"||be.type==="text","backward");if(de){if(de.mode==="text"){let be=de;for(;be&&be.mode==="text";)be=be.leftSibling;return bs(a,[de,be])}return bs(a,de)}const ge=b.parent;if(ge){if(ge.type==="leftright"||ge.type==="surd")return bs(a,ge);if(b.parentBranch==="subscript"&&ge.superscript)return bs(a,ge.superscript);if(b.parentBranch==="below"&&ge.above)return bs(a,ge.above);if(b.parentBranch==="superscript"||b.parentBranch==="subscript")return ll(a,ge);if(b.parentBranch==="above"||b.parentBranch==="below")return bs(a,ge)}return ll(a,0)}return!1},moveToMathfieldStart:a=>a.selectionIsCollapsed&&a.position===0?(a.announce("plonk"),!1):(a.position=0,a.mathfield.stopCoalescingUndo(),!0),moveToMathfieldEnd:a=>a.selectionIsCollapsed&&a.position===a.lastOffset?(a.announce("plonk"),!1):(a.position=a.lastOffset,a.mathfield.stopCoalescingUndo(),!0),moveToSuperscript:N0,moveToSubscript:$0},{target:"model",changeSelection:!0}),Ls({moveToNextPlaceholder:a=>Kf(a,"forward"),moveToPreviousPlaceholder:a=>Kf(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 Hf(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 Zc(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(Un.serialize([ae],{defaultMode:"math"})),ae.mode="math"),E-=1,y-=1}Ah(a),a.contentDidChange({data:ya(re),inputType:"insertText"})}function Ah(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 Ug(a,y,b){const{model:E}=a;if(E.mode==="latex"||!E.at(E.position).isLastSibling||!b||!Sf(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)&&Zc(E,1),!0;const ae={")":"(","}":"{","]":"["}[ee],{parent:de}=E.at(E.position);if(ae&&de instanceof Wa&&de.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 Zc(E,1),!1;if(/\D\.[^\d\s]$/.test(re)){Zc(E,1);const ge=E.at(E.position);return ge.value="\u22C5",ge.style.variant="normal",ge.command="\\cdot",ge.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 Zc(E,1),!0;if(/\([a-z][,;]$/.test(re))return Zc(E,2),!0;if(/[\d+\-=><*|]$/.test(ee))return Ah(E),!0}else{if(y==="[Space]")return Hf(E,void 0,ae=>/[a-z][:,;.]$/.test(ae.value)),!0;if(/[a-zA-Z]{3,}$/.test(re)&&!/(dxd|abc|xyz|uvw)$/.test(re))return Hf(E,void 0,ae=>/[a-zA-Z]/.test(ae.value)),!0;if(/(^|\W)(if)$/i.test(re))return Hf(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 Hf(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 jg(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>"+(vh(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 Vg(a){if(a.keystrokeCaptionVisible=!a.keystrokeCaptionVisible,a.keystrokeCaptionVisible){const y=z0();y.innerHTML=""}else{const y=Ef("mathlive-keystroke-caption-panel");y.style.visibility="hidden"}return!1}function z0(){const a=document.getElementById("mathlive-keystroke-caption-panel");return a||(_s("keystroke-caption"),_s("core"),Ef("mathlive-keystroke-caption-panel"))}function Gg(){document.getElementById("mathlive-keystroke-caption-panel")&&(bh("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 gt=_d();a.keyboardLayout!==gt.id&&(a.keyboardLayout=gt.id,a._keybindings=void 0)}if(clearTimeout(a.inlineShortcutBufferFlushTimer),a.inlineShortcutBufferFlushTimer=0,jg(a,ae),y.isTrusted&&y.defaultPrevented)return a.flushInlineShortcutBuffer(),!1;let de,ge="",be;const Ce=a.inlineShortcutBuffer;if(a.isSelectionEditable){if(re.mode==="math")if(ae==="[Backspace]")Ce.pop();else if(!Sf(y))a.flushInlineShortcutBuffer();else{const gt=Lu(y),Et=[...(E=(b=Ce[Ce.length-1])==null?void 0:b.keystrokes)!=null?E:[],gt];Ce.push({state:re.getState(),keystrokes:Et,leftSiblings:Xg(a)});let _n=0,kr="";for(;!de&&_n<Et.length;)be=Ce.length-(Et.length-_n),kr=Et.slice(_n).join(""),de=dd(Ce[be].leftSiblings,kr,a.options.inlineShortcuts),!de&&/^[a-zA-Z][a-zA-Z0-9]+?([_\^][a-zA-Z0-9\*\+\-]+?)?$/.test(kr)&&(de=a.options.onInlineShortcut(a,kr)),_n+=1;a.flushInlineShortcutBuffer({defer:!0})}a.options.smartMode&&(de?a.switchMode("math"):Ug(a,ae,y)&&(a.switchMode({math:"text",text:"math"}[re.mode]),ge=""))}if(!de){if(ge||(ge=Zm(a.keybindings,re.mode,y)),!ge&&(ae==="[Enter]"||ae==="[Return]")){let gt=!1;return re.contentWillChange({inputType:"insertLineBreak"})&&(a.host&&(gt=!a.host.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),gt||y.preventDefault&&(y.preventDefault(),y.stopPropagation()),re.contentDidChange({inputType:"insertLineBreak"})),gt}if((!ge||ae==="[Space]")&&re.mode==="math"){if(ae==="[Space]"){if(a.adoptStyle="none",a.flushInlineShortcutBuffer(),a.options.mathModeSpace)return ia.insert(re,a.options.mathModeSpace,{format:"latex",mode:"math"}),a.snapshot("insert-space"),ge="",a.dirty=!0,a.scrollIntoView(),y.preventDefault&&(y.preventDefault(),y.stopPropagation()),!1;const gt=re.at(re.position+1),Et=re.at(re.position-1);if((gt==null?void 0:gt.mode)==="text"||(Et==null?void 0:Et.mode)==="text")return ia.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)===","&&(ge="insertDecimalSeparator")}}if(!de&&!ge){if(re.mathfield.smartFence){if(Dh(re,Lu(y),a.effectiveStyle))return a.dirty=!0,a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1}else{const{parent:gt}=re.at(re.position);if(gt instanceof Wa&&gt.rightDelim==="?"&&re.at(re.position).isLastSibling&&/^[)}\]|]$/.test(ae))return a.snapshot(),gt.isDirty=!0,gt.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 Et=Lu(y);if(Et==="("||Et==="{"||Et==="["){const _n={"(":"(","{":"\\lbrace","[":"\\lbrack"}[Et],kr={"(":")","{":"\\rbrace","[":"\\rbrack"}[Et],[wn,rr]=Vo(re.selection);return a.snapshot(),re.position=rr,ia.insert(re,kr,{format:"latex"}),re.position=wn,ia.insert(re,_n,{format:"latex"}),re.setSelection(wn+1,rr+1),re.contentDidChange({data:Et,inputType:"insertText"}),a.snapshot("insert-fence"),a.dirty=!0,a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1}}}return!0}const $e=re.at(Math.max(re.position,re.anchor)),{parent:Ye}=$e;if(ge==="moveAfterParent"&&(Ye==null?void 0:Ye.type)==="leftright"&&$e.isLastSibling&&a.options.smartFence&&Dh(re,".",a.defaultStyle)&&(ge="",Mo(a)),a.keyboardDelegate.cancelComposition(),ge)a.executeCommand(ge);else if(de){const gt=a.effectiveStyle;re.setState(Ce[be].state);const Et=Ce[Ce.length-1].keystrokes;for(const _n of Et)ia.insert(re,_n,{silenceNotifications:!0,style:gt});a.snapshot("insert-shortcut"),re.setState(Ce[be].state),re.deferNotifications({content:!0,selection:!0,data:de,type:"insertText"},()=>(ia.insert(re,de,{format:"latex",style:gt}),Ah(a.model),de.endsWith(" ")&&(a.switchMode("text"),ia.insert(re," ",{style:gt,mode:"text"})),a.snapshot(),re.selectionIsCollapsed||a.flushInlineShortcutBuffer(),!0)),a.dirty=!0,re.announce("replacement")}return a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1}function Th(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=rf(y);const re=window.mathVirtualKeyboard;if(re!=null&&re.isShifted&&(ee=typeof ee=="string"?ee.toUpperCase():ee.map(ge=>ge.toUpperCase())),b.simulateKeystroke){let ge=!0;for(const be of ee)K0(a,new KeyboardEvent("keypress",{key:be}))&&(ge=!1);if(ge)return}const ae=E.at(E.position),de=Se(Se({},ae.computedStyle),a.defaultStyle);if(E.selectionIsCollapsed||(E.deleteAtoms(Vo(E.selection)),a.snapshot("delete")),E.mode==="latex")E.deferNotifications({content:!0,selection:!0,data:y,type:"insertText"},()=>{Mf(a);for(const ge of ee)ia.insert(E,ge);a.snapshot("insert-latex"),Ad(a)});else if(E.mode==="text"){for(const ge of ee)ia.insert(E,ge,{style:de});a.snapshot("insert-text")}else if(E.mode==="math")for(const ge of ee)Yg(a,ge,de,ae);a.dirty=!0,a.scrollIntoView()}function Xg(a){const y=a.model,b=[];let E=y.at(Math.min(y.position,y.anchor));for(;E.type!=="first";)b.push(E),E=E.leftSibling;return b}function Yg(a,y,b,E){const ee=a.model;let re={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[y];if(y===" "&&a.options.mathModeSpace&&(re=["insert",a.options.mathModeSpace]),re){a.executeCommand(re);return}if(/\d/.test(y)&&a.options.smartSuperscript&&E.parentBranch==="superscript"&&E.parent.type!=="mop"&&E.parent.type!=="operator"&&E.parent.type!=="extensible-symbol"&&E.hasNoSiblings){qg(ee),ia.insert(ee,y,{style:b}),a.snapshot(),R0(ee),a.snapshot();return}if(/[a-zA-Z0-9]/.test(y)&&a.adoptStyle!=="none"){const ae=a.adoptStyle==="left"?E:E.parent?E.rightSibling:null;(ae==null?void 0:ae.type)==="mord"&&/[a-zA-Z0-9]/.test(ae.value)&&(b=Se({},b),ae.style.variant&&(b.variant=ae.style.variant),ae.style.variantStyle&&(b.variantStyle=ae.style.variantStyle))}ia.insert(ee,y,{style:b}),a.snapshot(`insert-${ee.at(ee.position).type}`)}function qg(a){a.selectionIsCollapsed||(a.deleteAtoms(Vo(a.selection)),a.mathfield.snapshot("delete"))}function Dh(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],de=ne[re];if(!a.selectionIsCollapsed){a.mathfield.snapshot();const[ge,be]=Vo(a.selection),Ce=a.extractAtoms([ge,be]),$e=ee.addChildrenAfter([new Wa("left...right",Ce,{leftDelim:re,rightDelim:de})],a.at(ge));return a.setSelection(a.offsetOf($e.firstChild),a.offsetOf($e.lastChild)),a.mathfield.snapshot("insert-fence"),a.contentDidChange({data:re,inputType:"insertText"}),!0}if(re==="|"){const ge=ee instanceof Wa?ee.leftDelim+ee.rightDelim:"";if(ge==="\\lbrace\\rbrace"||ge==="\\{\\}"||ge==="\\lbrace?")return a.mathfield.snapshot(),ia.insert(a,"\\,\\middle\\vert\\,",{format:"latex",style:b}),a.mathfield.snapshot("insert-fence"),a.contentDidChange({data:re,inputType:"insertText"}),!0}if(de){if(ee instanceof Wa&&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 Wa)){let $e=E;for(;$e&&!($e.type==="mclose"&&$e.value===de);)$e=$e.rightSibling;if($e){a.mathfield.snapshot();const Ye=a.extractAtoms([a.offsetOf(E),a.offsetOf($e)]);return Ye.pop(),ee.addChildrenAfter([new Wa("left...right",Ye,{leftDelim:re,rightDelim:de})],E),a.position=a.offsetOf(ee.firstChild)+1,a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}}const ge=a.offsetOf(E.lastSibling);let be;for(be=a.position;be<=ge;be++){const $e=a.at(be);if($e instanceof Wa&&($e.leftDelim==="?"||$e.leftDelim===".")&&H0(re,$e.rightDelim))break}const Ce=a.at(be);if(be<=ge&&Ce instanceof Wa){Ce.leftDelim=re,a.mathfield.snapshot();let $e=a.extractAtoms([a.position,be-1]);return $e=$e.filter(Ye=>Ye.type!=="first"),Ce.addChildren($e,Ce.parentBranch),a.position+=1,a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}if(ee instanceof Wa&&(ee.leftDelim==="?"||ee.leftDelim===".")&&H0(re,ee.rightDelim)){ee.isDirty=!0,ee.leftDelim=re,a.mathfield.snapshot();const $e=a.extractAtoms([a.offsetOf(E.firstSibling),a.position]);for(const Ye of $e)ee.parent.addChildBefore(Ye,ee);return a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}if(!(ee instanceof Wa&&ee.leftDelim==="|")){if(a.mathfield.snapshot(),ia.insert(a,`\\left${re}\\right?`,{format:"latex",style:b}),E.lastSibling.type!=="first"){const $e=a.offsetOf(E.lastSibling),Ye=a.extractAtoms([a.position,$e]);a.at(a.position).body=Ye,a.position-=1}return a.mathfield.snapshot("insert-fence"),!0}}if(ae){let ge=E;for(;ge;){if(ge.type==="mopen"&&ge.value===ae){a.mathfield.snapshot();const gt=ge.leftSibling,Et=a.extractAtoms([a.offsetOf(ge.leftSibling),a.offsetOf(E)]);Et.shift();const _n=new Wa("left...right",Et,{leftDelim:ae,rightDelim:re});return ee.addChildrenAfter([_n],gt),a.position=a.offsetOf(_n),a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}ge=ge.leftSibling}if(ee instanceof Wa&&E.isLastSibling&&Ih(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 be=a.offsetOf(E.firstSibling);let Ce;for(Ce=a.position;Ce>=be;Ce--){const gt=a.at(Ce);if(gt instanceof Wa&&(gt.rightDelim==="?"||gt.rightDelim===".")&&Ih(gt.leftDelim,re))break}const $e=a.at(Ce);if(Ce>=be&&$e instanceof Wa)return a.mathfield.snapshot(),$e.rightDelim=re,$e.addChildren(a.extractAtoms([Ce,a.position]),$e.parentBranch),a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0;if(ee instanceof Wa&&(ee.rightDelim==="?"||ee.rightDelim===".")&&Ih(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 Ye=ee.parent;return Ye instanceof Wa&&(Ye.rightDelim==="?"||Ye.rightDelim===".")&&a.at(a.position).isLastSibling?(a.position=a.offsetOf(Ye),Dh(a,re,b)):!1}return!1}function Ih(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}Ls({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:Vg,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)=>(Th(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}}),Ls({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"}),Ls({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})&&(Ad(a),a.startRecording(),a.snapshot("paste"),a.model.contentDidChange({inputType:"insertFromPaste"}),Mo(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=Ph(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=Se(Se({},a.defaultStyle),b)):a.model.deferNotifications({content:!0,type:"insertText"},()=>{E.selection.ranges.forEach(ee=>Eh(E,ee,b,{operation:"toggle"})),a.snapshot("style-change")}),!0}Ls({applyStyle:Jg},{target:"mathfield",canUndo:!0,changeContent:!0});function Ph(a,y){var b,E,ee,re,ae,de,ge,be,Ce,$e;const Ye={};if(typeof y.color=="string"){const Et=(E=a.colorMap((b=y.color)!=null?b:y.verbatimColor))!=null?E:"none";Et!==y.color&&(Ye.verbatimColor=(ee=y.verbatimColor)!=null?ee:y.color),Ye.color=Et}if(typeof y.backgroundColor=="string"){const Et=(ae=a.backgroundColorMap((re=y.backgroundColor)!=null?re:y.verbatimBackgroundColor))!=null?ae:"none";Et!==y.backgroundColor&&(Ye.verbatimBackgroundColor=(de=y.verbatimBackgroundColor)!=null?de:y.backgroundColor),Ye.backgroundColor=Et}typeof y.fontFamily=="string"&&(Ye.fontFamily=y.fontFamily),typeof y.series=="string"&&(Ye.fontSeries=y.series),typeof y.fontSeries=="string"&&(Ye.fontSeries=y.fontSeries.toLowerCase()),Ye.fontSeries&&(Ye.fontSeries=(ge={bold:"b",medium:"m",normal:"m"}[Ye.fontSeries])!=null?ge:Ye.fontSeries),typeof y.shape=="string"&&(Ye.fontShape=y.shape),typeof y.fontShape=="string"&&(Ye.fontShape=y.fontShape.toLowerCase()),Ye.fontShape&&(Ye.fontShape=(be={italic:"it",up:"n",upright:"n",normal:"n"}[Ye.fontShape])!=null?be:Ye.fontShape),y.variant&&(Ye.variant=y.variant.toLowerCase()),y.variantStyle&&(Ye.variantStyle=y.variantStyle.toLowerCase());const gt=(Ce=y.size)!=null?Ce:y.fontSize;return typeof gt=="number"?Ye.fontSize=Math.max(1,Math.min(10,gt)):typeof gt=="string"&&(Ye.fontSize=($e={size1:1,size2:2,size3:3,size4:4,size5:5,size6:6,size7:7,size8:8,size9:9,size10:10}[gt.toLowerCase()])!=null?$e:{tiny:1,scriptsize:2,footnotesize:3,small:4,normal:5,normalsize:5,large:6,Large:7,LARGE:8,huge:9,Huge:10}[gt]),Ye}function Oh(a){let[y,b]=Vo(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 de=b==="forward"?1:-1;if(ae.mode==="text"){for(;ae&&!(ae.mode!=="text"||!fe.test(ae.value));)y+=de,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+=de,ae=a.at(y);else for(;ae&&ae.mode==="latex"&&/[a-zA-Z\*]/.test(ae.value);)y+=de,ae=a.at(y);else if(ae.value==="{"){if(b==="forward"){for(;ae&&ae.mode==="latex"&&ae.value!=="}";)y+=de,ae=a.at(y);return y}return y-1}else if(ae.value==="}"){if(b==="backward"){for(;ae&&ae.mode==="latex"&&ae.value!=="{";)y+=de,ae=a.at(y);return y-1}return y}return y-1}if(ae.mode==="math"){if(ae.isDigit()){for(;(E=a.at(y+de))!=null&&E.isDigit();)y+=de;return b==="backward"?y-1:y}if(ae.style.variant||ae.style.variantStyle){let ge=(ee=a.at(y))==null?void 0:ee.style;for(;ge&&ge.variant===ae.style.variant&&ge.variantStyle===ae.style.variantStyle;)ge=(re=a.at(y+de))==null?void 0:re.style,y+=de;return b==="backward"?y-1:y}return y}return y}Ls({selectGroup:a=>{const y=Oh(a);return y||a.announce("plonk"),y},selectAll:a=>a.setSelection(0,a.lastOffset),extendSelectionForward:a=>Cl(a,"forward",{extend:!0}),extendSelectionBackward:a=>Cl(a,"backward",{extend:!0}),extendToNextWord:a=>Ou(a,"forward",{extend:!0}),extendToPreviousWord:a=>Ou(a,"backward",{extend:!0}),extendSelectionUpward:a=>Cl(a,"upward",{extend:!0}),extendSelectionDownward:a=>Cl(a,"downward",{extend:!0}),extendToNextBoundary:a=>Ou(a,"forward",{extend:!0}),extendToPreviousBoundary:a=>Ou(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 Uc=null,Bd=0,Wf=class Ys{static start(y,b,E,ee){var re;Ys.element=y,(re=Ys.controller)==null||re.abort(),Ys.controller=new AbortController;const ae={signal:Ys.controller.signal};"PointerEvent"in window?(y.addEventListener("pointermove",E,ae),y.addEventListener("pointerup",ee,ae),y.addEventListener("pointercancel",ee,ae),Bh(b)&&(Ys.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=Ys.controller)==null||y.abort(),Ys.controller=void 0,typeof Ys.pointerId=="number"&&(Ys.element.releasePointerCapture(Ys.pointerId),Ys.pointerId=void 0)}};function Bh(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,de="none",ge=!1,be=!1;const Ce=y.clientX,$e=y.clientY,Ye=Date.now(),gt=E.field,Et=setInterval(()=>{ge?gt.scroll({top:0,left:gt.scrollLeft-16}):be&&gt.scroll({top:0,left:gt.scrollLeft+16})},32);function _n(){Wf.stop(),re=!1,clearInterval(Et),a.element.classList.remove("tracking"),y&&y.preventDefault()}function kr(rr){if(!E.hasFocus()){_n();return}const Ir=rr.clientX,dr=rr.clientY,ci=Bh(rr)&&rr.pointerType==="touch"?20:5;if(Date.now()<Ye+500&&Math.abs(Ce-Ir)<ci&&Math.abs($e-dr)<ci){rr.preventDefault(),rr.stopPropagation();return}const Ii=gt.getBoundingClientRect();be=Ir>Ii.right,ge=Ir<Ii.left;let bi=ee;Bh(rr)&&(rr.isPrimary||(bi=Rd(E,rr.clientX,rr.clientY,{bias:0})));const Pa=Rd(E,Ir,dr,{bias:Ir<=Ce?Ir===Ce?0:-1:1});bi>=0&&Pa>=0&&(E.model.extendSelectionTo(bi,Pa),Mo(a)),ae&&Oh(E.model)}Uc&&Math.abs(Uc.x-Ce)<5&&Math.abs(Uc.y-$e)<5&&Date.now()<Uc.time+500?(Bd+=1,Uc.time=Ye):(Uc={x:Ce,y:$e,time:Ye},Bd=1);const wn=gt.getBoundingClientRect();if(Ce>=wn.left&&Ce<=wn.right&&$e>=wn.top&&$e<=wn.bottom){if(a.flushInlineShortcutBuffer(),a.adoptStyle="left",ee=Rd(a,Ce,$e,{bias:0}),ee>=0){if(a.element.classList.add("tracking"),y.shiftKey){const rr=a.model.selectionIsCollapsed;a.model.extendSelectionTo(a.model.anchor,ee),v0(a.model)||rr?de="all":de="selection"}else a.model.at(ee).type==="placeholder"?(a.model.setSelection(ee-1,ee),de="selection"):((b=a.model.at(ee).rightSibling)==null?void 0:b.type)==="placeholder"?(a.model.setSelection(ee,ee+1),de="selection"):(a.model.position=ee,v0(a.model)?de="all":de="selection");a.defaultStyle={},y.detail===3||Bd>2?(_n(),(y.detail===3||Bd===3)&&(a.model.selection={ranges:[[0,a.model.lastOffset]]},de="all")):re||(re=!0,Wf.start(gt,y,kr,_n),(y.detail===2||Bd===2)&&(ae=!0,Oh(a.model),de="all"))}a.hasFocus()||(de="none",a.focus({preventScroll:!0}))}else Uc=null;a.stopCoalescingUndo(),de!=="none"&&(a.model.selectionIsCollapsed&&(de="all"),Mo(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 U0(a,y,b,E,ee){if(!b.id)return[1/0,null];if(y.has(b.id))return y.get(b.id);const re=lc(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 de of b.children){const ge=U0(a,y,de,E,ee);ge[0]<=ae[0]&&(ae=ge)}return ae[1]||(ae=[Qg(E,ee,re),b]),y.set(b.id,ae),ae}function ev(a,y,b){const[,E]=U0(a,new Map,a.model.root,y,b);return E}function Rd(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 de=[];let ge=ae;for(;ge;)de.unshift(ge),ge=ge.parent;for(const Ce of de)if(Ce.captureSelection){ae=Ce;break}let be=a.model.offsetOf(ae);if(be<0)return-1;if(ae.leftSibling)if(E.bias===0&&ae.type!=="placeholder"){const Ce=lc(a,ae);Ce&&y<(Ce.left+Ce.right)/2&&(be=a.model.offsetOf(ae.leftSibling))}else E.bias<0&&(be=a.model.offsetOf(ae.leftSibling));return be}var tv=class extends ia{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=dc(re),{model:de}=a;de.selectionIsCollapsed||de.deleteAtoms(Vo(de.selection));const ge=de.at(de.position);if(ge.parent instanceof sa){console.assert(ge.parentBranch!==void 0);const be=[];let Ce=[];ae[0].type==="first"&&ae.shift(),ae[ae.length-1].type==="first"&&ae.pop();for(const Et of ae)Et.type==="first"&&Ce.length>0?(be.push(Ce),Ce=[Et]):Ce.push(Et);Ce.length>0&&be.push(Ce);let $e=Number(ge.parentBranch[0]),Ye=Number(ge.parentBranch[1]);const gt=ge.parent.maxColumns;for(;ge.parent.colCount-Ye<be.length&&ge.parent.colCount<gt;)ge.parent.addColumn();ge.parent.addChildrenAfter(be[0],ge);for(let Et=1;Et<be.length;Et++)Ye++,Ye>=gt&&(Ye=0,ge.parent.addRowAfter($e),$e++),ge.parent.setCell($e,Ye,be[Et])}else ge.parent.addChildrenAfter(ae.filter(be=>be.type!=="first"),ge);return de.position=de.offsetOf(ae[ae.length-1]),de.contentDidChange({inputType:"insertFromPaste"}),Mo(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]=yl(b),E==="auto"&&re&&(E="latex"),a.stopCoalescingUndo(),a.stopRecording(),this.insert(a.model,b,{format:E})&&(a.startRecording(),a.snapshot("paste"),Mo(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 de=a.silenceNotifications;a.silenceNotifications=!0;const ge={"?":"\\placeholder{}","@":"\\placeholder{}"};ge[0]=b.insertionMode==="replaceAll"?"":a.getValue(a.selection,"latex-unstyled"),b.insertionMode==="replaceSelection"&&!a.selectionIsCollapsed?a.deleteAtoms(Vo(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 be=-1;ge[0]?ge["@"]=ge[0]:typeof y=="string"&&/(^|[^\\])#@/.test(y)&&(be=rv(a),be>=0&&(ge["@"]=a.getValue(be,a.position,"latex"))),ge[0]||(ge[0]=ge["?"]);let Ce=!1;const $e=Ir=>(Ce=!0,ge[Ir]);let[Ye,gt]=j0(a,y,$e,b);if(!gt)return!1;const Et=gt.length===1&&gt[0].type==="genfrac";Et&&be>=0&&typeof a.mathfield.options.isImplicitFunction=="function"&&a.mathfield.options.isImplicitFunction(a.at(a.position).command)?(ge["@"]=ge["?"],Ce=!1,[Ye,gt]=j0(a,y,$e,b)):be>=0&&a.deleteAtoms([be,a.position]);const{parent:_n}=a.at(a.position),kr=_n.hasEmptyBranch("body");if(Et&&Ye!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&_n instanceof Wa&&_n.leftDelim==="("&&kr){const Ir=_n.parent,dr=_n.parentBranch;Ir.removeChild(_n),Ir.setChildren(gt,dr)}const wn=a.at(a.position);wn.parent.addChildrenAfter(gt,wn),Ye==="latex"&&typeof y=="string"&&(_n==null?void 0:_n.type)==="root"&&kr&&!Ce&&(_n.verbatimLatex=y),a.silenceNotifications=de;const rr=gt[gt.length-1];if(b.selectionMode==="placeholder"){const Ir=gt.flatMap(dr=>[dr,...dr.children]).find(dr=>dr.type==="placeholder");if(Ir){const dr=a.offsetOf(Ir);a.setSelection(dr-1,dr),a.announce("move")}else rr&&(a.position=a.offsetOf(rr))}else b.selectionMode==="before"||(b.selectionMode==="after"?rr&&(a.position=a.offsetOf(rr)):b.selectionMode==="item"&&a.setSelection(a.anchor,a.offsetOf(rr)));return a.contentDidChange({data:re,inputType:"insertText"}),a.silenceNotifications=ae,!0}};function j0(a,y,b,E){var ee;let re,ae=[];if(typeof y!="string"||E.format==="math-json"){const de=window.MathfieldElement.computeEngine;if(!de)return["math-json",[]];[re,y]=["latex",de.box(y).latex],ae=Xo(y,{context:a.mathfield.context})}else typeof y=="string"&&E.format==="ascii-math"?([re,y]=Oc(y,{format:"ascii-math",inlineShortcuts:a.mathfield.options.inlineShortcuts}),ae=Xo(y,{context:a.mathfield.context}),re!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&Zf(ae)):(E.format==="auto"||(ee=E.format)!=null&&ee.startsWith("latex"))&&(E.format==="auto"&&([re,y]=Oc(y,{format:"auto",inlineShortcuts:a.mathfield.options.inlineShortcuts})),E.format==="latex"&&([,y]=yl(y)),ae=Xo(y,{context:a.mathfield.context,args:b}),E.format!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&Zf(ae));return hc(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 Wa&&y.leftDelim==="("&&y.rightDelim===")"?y.removeBranch("body"):null}function Zf(a){if(a){for(let y=0;a[y];y++){const b=a[y];if(b instanceof Wa&&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)){Zf(y.branch(b));const E=nv(y.branch(b));E&&y.setChildren(E,b)}if(y instanceof sa)for(const b of y.cells)Zf(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||V0(y));)y=y.leftSibling;else{const ee=[];for(;!y.isFirstSibling&&(V0(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 V0(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 ia{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"),Mo(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(Vo(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(hc(re,b.style),!re)return!1;const ae=a.at(a.position),de=ae.parent.addChildrenAfter(re,ae);return a.silenceNotifications=ee,b.selectionMode==="before"||(b.selectionMode==="item"?a.setSelection(a.anchor,a.offsetOf(de)):de&&(a.position=a.offsetOf(de))),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 "),Xo(a,{context:y,parseMode:"text"})}new iv;function Ml(a){return{value:a.model.getValue(),selectionIsCollapsed:a.model.selectionIsCollapsed,canUndo:a.canUndo(),canRedo:a.canRedo(),style:a.selectionStyle,mode:a.model.mode}}var fo=4,Cs=20,$o=2*(Cs+fo),Uf=(a,y)=>`
<line x1="${a+Cs}" y1="${y+Cs}"
x2="${a>y?a+Cs:7*Cs+10*fo}"
y2="${a<y?y+Cs:7*Cs+10*fo}"/>
<svg id="plus" viewBox="0 0 40 40" x="${a}" y="${y}" width="40" height="40">
<circle class="cls-2" cx="20" cy="20" r="20"/>
<path class="font" d="m33.33,20c0,1.84-1.49,3.34-3.33,3.34h-6.67v6.66c0,1.84-1.49,3.34-3.33,3.34s-3.34-1.5-3.34-3.34v-6.66h-6.66c-1.84,0-3.34-1.5-3.34-3.34s1.5-3.33,3.34-3.33h6.66v-6.67c0-1.84,1.5-3.33,3.34-3.33s3.33,1.49,3.33,3.33v6.67h6.67c1.84,0,3.33,1.49,3.33,3.33Z"/>
</svg>`,G0=(a,y)=>`
<line x1="${a+Cs}" y1="${y+Cs}"
x2="${a>y?a+Cs:7*Cs+10*fo}"
y2="${a<y?y+Cs:7*Cs+10*fo}"/>
<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>`,jf=(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*Cs+10*fo+5} ${8*Cs+10*fo+5}">
<rect
class="MLEP__array-insert-background rows"
x="0"
y="${$o+fo}"
height="${3*$o}"
width="${$o}"
rx="${$o/2}"/>
<rect
class="MLEP__array-insert-background columns"
x="${$o+fo}"
y="0"
height="${$o}"
width="${3*$o}"
rx="${$o/2}"/>
<g data-command='"moveDown"'>
${jf(2*(fo+$o),2*fo+3*$o,0)}
</g>
<g data-command='"moveUp"'>
${jf(2*(fo+$o),2*fo+$o,180)}
</g>
<g data-command='"moveToNextWord"'>
${jf(2*fo+3*$o,2*(fo+$o),-90)}
</g>
<g data-command='"moveToPreviousWord"'>
${jf(2*fo+$o,2*(fo+$o),90)}
</g>
<g>
<g data-command='"addColumnBefore"'>
${Uf(2*fo+$o,fo)}
</g>
<g data-command='"removeColumn"'>
${G0(2*fo+2*$o,fo)}
</g>
<g data-command='"addColumnAfter"'>
${Uf(2*fo+3*$o,fo)}
</g>
<g data-command='"addRowBefore"'>
${Uf(fo,2*fo+$o)}
</g>
<g data-command='"removeRow"'>
${G0(fo,2*fo+2*$o)}
</g>
<g data-command='"addRowAfter"'>
${Uf(fo,2*fo+3*$o)}
</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>`,fv=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>`,hv=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>`,Rh={matrix:sv,pmatrix:lv,bmatrix:cv,Bmatrix:X0,vmatrix:uv,Vmatrix:dv},Nh={cases:fv,rcases:hv,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(Et=>{(!ee||Et.length>ee)&&(ee=Et.length)});let re=document.getElementById("mathlive-environment-popover");re||(re=Ef("mathlive-environment-popover"),_s("environment-popover"),_s("core"),re.setAttribute("aria-hidden","true"));let ae;const de=re.querySelector(".MLEP__environment-controls");de?ae=de:(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 ge=[],be="";const Ce=a.model.parentEnvironment.environmentName;if(us(Ce)){const Et=gv(Ce);be=Rh[Et]("active");const _n=Rh,{[Et]:kr}=_n,wn=tt(_n,[Ee(Et)]);ge=Object.values(wn).map(rr=>rr("inactive"))}else if(ds(Ce)){const Et=vv(Ce);be=Nh[Et]("active");const _n=Nh,{[Et]:kr}=_n,wn=tt(_n,[Ee(Et)]);ge=Object.values(wn).map(rr=>rr("inactive"))}else Io(Ce)&&(be=Rh.matrix("active"),ge=Object.values(Nh).map(Et=>Et("inactive")));const $e=document.createElement("div");$e.className="MLEP__environment-delimiter-controls",$e.style.display="flex",$e.style.flexDirection="column",$e.innerHTML=`
<div class='MLEP__array-delimiter-options'>
${be}
${ge.join("")}
</div>`,be&&ae.appendChild($e),ae.querySelectorAll("[data-command]").forEach(Et=>{const _n=Et.dataset.command;let kr=_n;try{kr=JSON.parse(_n)}catch(wn){}Et.addEventListener("mousedown",wn=>wn.preventDefault()),kr&&Et.addEventListener("click",()=>a.executeCommand(kr))});const gt=(b=a.field)==null?void 0:b.getBoundingClientRect();gt&&(re.style.top=`${window.scrollY+(gt.top-re.clientHeight-15)}px`,re.style.left=`${gt.left+20}px`,re.classList.add("is-visible"))}function $h(){const a=document.getElementById("mathlive-environment-popover");a==null||a.classList.remove("is-visible")}function mv(){document.getElementById("mathlive-environment-popover")&&(bh("mathlive-environment-popover"),x("environment-popover"),x("core"))}function Vf(a){if(!a.hasFocus())return;let y=!1;if(a.model.mode==="math"){const b=a.model.parentEnvironment;if(b!=null&&b.array&&bo(b.environmentName)){const E=a.options.environmentPopoverPolicy;y=E==="auto"||E==="on"}}y?pv(a):$h()}function gv(a){return a.replace("*","")}function vv(a){return a==="dcases"?"cases":a}function Y0(a){const y=getComputedStyle(a).direction;return y==="ltr"||y==="rtl"?y:"ltr"}function q0(a,y,b){return y==="left"||y==="leading"&&b==="ltr"||y==="trailing"&&b==="rtl"?a.left:a.right}function Fh(a,y,b,E){return b==="middle"?a-y/2:b==="start"&&E==="rtl"||b==="end"&&E==="ltr"||b==="top"||b==="right"?Math.max(0,a-y):a}function yv(a,y,b,E){return b==="middle"?a-y/2:b==="start"&&E==="ltr"||b==="end"&&E==="rtl"||b==="top"||b==="right"?a:a-y}function bv(a,y){var b,E,ee;const re=(b=Y0(a))!=null?b:"ltr";a.style.position="fixed",a.style.left="",a.style.top="",a.style.right="",a.style.bottom="",a.style.height="",a.style.width="";const ae=a.getBoundingClientRect(),de=Number.isFinite(y.maxHeight)?Math.min(y.maxHeight,window.innerHeight):window.innerHeight;let ge=Math.min(de,(E=y.height)!=null?E:ae.height),be=Fh(y.location.y,ge,y.verticalPos,re);be+ge>window.innerHeight-8&&(y.alternateLocation?(be=Fh(y.alternateLocation.y,ge,y.verticalPos,re),be+ge>window.innerHeight-8&&(be=void 0)):be=void 0),Number.isFinite(be)||(be=Math.max(8,window.innerHeight-8-ge),8+ge>window.innerHeight-8&&(a.style.bottom="8px")),ge=Math.min(be+ge,window.innerHeight-8)-be;const Ce=Number.isFinite(y.maxWidth)?Math.min(y.maxWidth,window.innerWidth):window.innerWidth;let $e=Math.min(Ce,(ee=y.width)!=null?ee:ae.width),Ye=Fh(y.location.x,$e,y.horizontalPos,re);Ye+$e>window.innerWidth-8&&(y.alternateLocation?(Ye=yv(y.alternateLocation.x,$e,y.verticalPos,re),Ye+$e>window.innerWidth-8&&(Ye=void 0)):Ye=void 0),Number.isFinite(Ye)||(Ye=Math.max(8,window.innerWidth-8-$e),8+$e>window.innerWidth-8&&(a.style.right="8px")),$e=Math.min(Ye+$e,window.innerWidth-8)-Ye,re==="rtl"?a.style.right=`${Math.ceil(window.innerWidth-Ye-$e).toString()}px`:a.style.left=`${Math.ceil(Ye).toString()}px`,a.style.top=`${Math.ceil(be).toString()}px`,ge!==ae.height&&(a.style.height=`${Math.ceil(ge).toString()}px`),$e!==ae.width&&(a.style.width=`${Math.ceil($e).toString()}px`)}function xv(a,y){return Math.hypot(y.x-a.x,y.y-a.y)}function Bu(a){return"submenu"in a}function El(a){return"type"in a&&a.type==="command"||"onMenuSelect"in a||"id"in a}function zh(a){return"type"in a&&a.type==="divider"}function Kh(a){return"type"in a&&a.type==="heading"}var J0={};function Hh(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,Bu(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=El(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(zh(ee)){this.enabled=!1,this.checked=!1;return}Kh(ee)&&(this.enabled=!1,this.checked=!1,this.visible=!0),El(ee)&&(this.checked=El(ee)&&((y=Ru(ee.checked,a))!=null?y:!1)),(El(ee)||Bu(ee))&&(this.enabled=(b=Ru(ee.enabled,a))!=null?b:!0,this.visible=(E=Ru(ee.visible,a))!=null?E:!0,this.visible&&this.enabled&&this.submenu&&(this.submenu.updateState(a),this.submenu.visible||(this.visible=!1))),(El(ee)||Kh(ee)||Bu(ee))&&(this.label=Ru(ee.label,a),this.tooltip=Ru(ee.tooltip,a),this.ariaLabel=Ru(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(Hh("checkmark"))):this.checked==="mixed"?(a.setAttribute("aria-checked","mixed"),a.append(Hh("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),El(this._declaration)&&this._declaration.keyboardShortcut){const b=document.createElement("kbd");b.innerHTML=vh(this._declaration.keyboardShortcut),a.append(b)}this.type==="submenu"&&a.append(Hh("trailing-chevron"))}get element(){if(this._element)return this._element;if(zh(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,(El(this._declaration)||Kh(this._declaration)||Bu(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(!El(this._declaration))return;const a=new CustomEvent("menu-select",{cancelable:!0,bubbles:!0,detail:{modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data}});this.parentMenu.dispatchEvent(a)&&typeof this._declaration.onMenuSelect=="function"&&this._declaration.onMenuSelect({modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data})}handleEvent(a){var y;if(!(!this.visible||!this.enabled)){if(a.type==="click"){this.rootMenu.state==="modal"&&this.select(),a.stopPropagation(),a.preventDefault();return}if(a.type==="pointerenter"){const b=a;this.rootMenu.cancelDelayedOperation(),this.parentMenu.isSubmenuOpen&&((y=this.parentMenu.activeMenuItem)!=null&&y.movingTowardSubmenu(b))?this.rootMenu.scheduleOperation(()=>{this.parentMenu.activeMenuItem=this,this.openSubmenu()}):(this.parentMenu.activeMenuItem=this,this.openSubmenu({withDelay:!0}));return}if(a.type==="pointerleave"){this.rootMenu.activeSubmenu===this.parentMenu&&(this.parentMenu.activeMenuItem=null);return}if(a.type==="pointerup"){this.rootMenu.state!=="modal"&&this.select(),a.stopPropagation(),a.preventDefault();return}}}select(){if(this.rootMenu.cancelDelayedOperation(),this.type==="submenu"){this.openSubmenu();return}this.active=!1,setTimeout(()=>{this.active=!0,setTimeout(()=>{this.rootMenu.hide(),this.dispatchSelect()},Q0)},Q0)}openSubmenu(a){var y;if(this.type!=="submenu"||!this.element)return;if((y=a==null?void 0:a.withDelay)!=null&&y){this.rootMenu.scheduleOperation(()=>this.openSubmenu());return}const b=this.element.getBoundingClientRect(),E=Y0(this.element);this.submenu.show({container:this.rootMenu.element.parentNode,location:{x:q0(b,"trailing",E),y:b.top-4},alternateLocation:{x:q0(b,"leading",E),y:b.top-4}})}movingTowardSubmenu(a){if(!this.element||this.type!=="submenu")return!1;const y=this.rootMenu.lastMoveEvent;if(!y)return!1;const b=a.timeStamp-y.timeStamp;if(b>500)return!1;const E=a.clientX-y.clientX;if(wv(E,y.clientY-a.clientY,b)<=.2)return!1;let re="right";if(this.submenu.element){const ae=this.submenu.element.getBoundingClientRect(),de=this.element.getBoundingClientRect();ae.left<de.left+de.width/2&&(re="left")}return re==="right"?E>0:E<0}};function wv(a,y,b){return Math.hypot(a,y)/b}function Ru(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 Zu{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(be=>be.updateState(y));const re=this.hasCheck;this.hasCheck=this._menuItems.some(be=>be.visible&&be.hasCheck),this.hasCheck!==re&&this._menuItems.forEach(be=>be.updateState(y));let ae,de=0;for(const be of this._menuItems)be.type==="heading"?(ae&&de===0&&(ae.visible=!1),ae=be,de=0):be.type==="divider"&&ae?(ae.visible=de>0,ae=void 0,de=0):ae&&be.visible&&(de+=1);ae&&(ae.visible=de>0);let ge=!0;for(const be of this._menuItems)be.type==="divider"?(be.visible=!ge,ge=!0):be.visible&&(ge=!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 Zu._collator||(Zu._collator=new Intl.Collator(void 0,{usage:"search",sensitivity:"base"})),Zu._collator}findMenuItem(y){var b;this.updateIfDirty();const E=this._menuItems.filter(de=>de.type!=="divider"&&de.visible&&de.enabled);if(E.length===0)return null;const ee=Math.max(...E.map(de=>de.label.length))-y.length;if(ee<0)return null;let re=null,ae=0;for(;ae<ee&&!re;)re=(b=E.find(de=>Zu.collator.compare(y,de.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),Xt()&&(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),Xt()&&((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=Nc(y)),y.stopImmediatePropagation()}handleKeydownEvent(y){var b,E,ee;if(y.key==="Tab"||y.key==="Escape"){this.hide();return}this.isDynamic&&(this.modifiers=Nc(y));let re=!0;const ae=this.activeSubmenu,de=ae.activeMenuItem;switch(y.key){case" ":case"Space":case"Return":case"Enter":de==null||de.select(Nc(y));break;case"ArrowRight":if((de==null?void 0:de.type)==="submenu")de.select(Nc(y)),this.activeSubmenu.activeMenuItem=this.activeSubmenu.firstMenuItem;else if(!de)ae.activeMenuItem=ae.firstMenuItem;else{const ge=(b=ae.getMenuItemColumn(de))!=null?b:-1;if(ge>=0&&ge<((E=ae.columnCount)!=null?E:1)-1){const be=ae.nextMenuItem(1);be&&(ae.activeMenuItem=be)}}break;case"ArrowLeft":if(ae===this.rootMenu)de||(ae.activeMenuItem=ae.firstMenuItem);else if((de&&(ee=ae.getMenuItemColumn(de))!=null?ee:-1)<=0||!de){ae.hide();const be=ae.parentMenu.activeMenuItem;if(be){const{element:Ce}=be;Ce==null||Ce.focus(),Ce==null||Ce.classList.remove("is-submenu-open")}}else{const be=ae.nextMenuItem(-1);be&&(ae.activeMenuItem=be)}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 ge=ae.findMenuItem(this.typingBuffer);ge&&(ae.activeMenuItem=ge),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}break;default:if(Sf(y)){isFinite(this.typingBufferResetTimer)&&clearTimeout(this.typingBufferResetTimer),this.typingBuffer+=y.key;const ge=ae.findMenuItem(this.typingBuffer);ge&&(ae.activeMenuItem=ge),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 wl.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),wl.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),wl.state==="open"&&wl.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(me(Se({},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,wl.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 zh(a)?!1:typeof a.label=="function"||typeof a.ariaLabel=="function"||typeof a.tooltip=="function"||(El(a)||Bu(a))&&(typeof a.enabled=="function"||typeof a.visible=="function")||El(a)&&typeof a.checked=="function"?!0:Bu(a)?a.submenu.some(rp):!1}var Gf=class{};Gf.DELAY=300,Gf.MAX_DISTANCE=10;function Cv(a){return new Promise((y,b)=>{const E=wf(a);E||y(!1);let ee=E;const re=setTimeout(()=>{ae.abort(),y(xv(ee,E)<Gf.MAX_DISTANCE)},Gf.DELAY),ae=new AbortController,de=ae.signal;for(const ge of["pointermove","pointerup","pointercancel"])window.addEventListener(ge,be=>{if(be.type==="pointerup"||be.type==="pointercancel")clearTimeout(re),ae.abort(),y(!1);else if(be.type==="pointermove"){const Ce=wf(be);Ce&&(ee=Ce)}},{passive:!0,signal:de})})}function ip(a,y,b){return gc(this,null,function*(){if(a.type==="contextmenu"){const E=a;if(b.show({target:y,location:wf(E),modifiers:Nc(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:Nc(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=wf(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};Bt(Object.keys(ap),"{body:auto}",{createAtom:a=>new z(me(Se({},a),{body:nt(a.args[0]),accentChar:ap[a.command.slice(1)]}))}),Bt(["widehat","widecheck","widetilde"],"{body:auto}",{createAtom:a=>{const y=jt(nt(a.args[0]));return new z(me(Se({},a),{body:nt(a.args[0]),svgAccent:a.command.slice(1)+(y.length>5?"4":["1","1","2","2","3","3"][y.length])}))}}),Bt(["overarc","overparen","wideparen"],"{body:auto}",{createAtom:a=>new z(me(Se({},a),{body:nt(a.args[0]),svgAccent:"overarc"}))}),Bt(["underarc","underparen"],"{body:auto}",{createAtom:a=>new Vs(me(Se({},a),{body:nt(a.args[0]),svgBelow:"underarc"}))}),Bt("utilde","{body:auto}",{createAtom:a=>{const y=nt(a.args[0]),b=jt(y),E="widetilde"+(b.length>5?"4":["1","1","2","2","3","3"][b.length]);return new Vs(me(Se({},a),{body:y,svgBelow:E,boxType:rc(y)}))}}),Bt("^","{:string}",{createAtom:a=>{var y;return new Un(me(Se({},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:"^"}))}}),Bt("`","{:string}",{createAtom:a=>{var y;return new Un(me(Se({},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:"`"}))}}),Bt("'","{:string}",{createAtom:a=>{var y;return new Un(me(Se({},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:"'"}))}}),Bt('"',"{:string}",{createAtom:a=>{var y,b;return new Un(me(Se({},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]:'"'}))}}),Bt(".","{:string}",{createAtom:a=>{var y,b;return new Un(me(Se({},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]:"."}))}}),Bt("=","{:string}",{createAtom:a=>{var y,b;return new Un(me(Se({},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]:"="}))}}),Bt("~","{:string}",{createAtom:a=>{var y;return new Un(me(Se({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"}))}}),Bt("c","{:string}",{createAtom:a=>{var y;return new Un(me(Se({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={c:"\xE7",C:"\xC7"}[a.args[0]])!=null?y:""}))}}),Bt("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 de of ae){const ge=de.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(ge)ee.strokeWidth=ge[1],ee.strokeStyle=ge[2],ee.strokeColor=ge[3];else{const be=de.match(/\s*([a-z]*)\s*=\s*"(.*)"/);be&&(be[1]==="mathbackground"?ee.backgroundcolor=be[2]:be[1]==="mathcolor"?ee.strokeColor=be[2]:be[1]==="padding"?ee.padding=be[2]:be[1]==="shadow"&&(ee.shadow=be[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 bd(a.command,nt(E[2]),re,ee)}}),Bt("cancel","{body:auto}",{createAtom:a=>{var y;return new bd(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:{}})}}),Bt("bcancel","{body:auto}",{createAtom:a=>{var y;return new bd(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:{}})}}),Bt("xcancel","{body:auto}",{createAtom:a=>{var y;return new bd(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:{}})}}),Bt(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overlinesegment","overgroup"],"{:auto}",{createAtom:a=>{var y;return new Vs(me(Se({},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)}))}}),Bt("overbrace","{:auto}",{createAtom:a=>new Vs(me(Se({},a),{body:nt(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgAbove:a.command.slice(1)}))}),Bt(["underrightarrow","underleftarrow","underleftrightarrow","underlinesegment","undergroup"],"{:auto}",{createAtom:a=>new Vs(me(Se({},a),{body:nt(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgBelow:a.command.slice(1)}))}),Bt(["underbrace"],"{:auto}",{createAtom:a=>new Vs(me(Se({},a),{body:nt(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgBelow:a.command.slice(1)}))}),Bt(["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 Vs(me(Se({},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)}`}),Bt(["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 Rc(a.command.slice(1),me(Se({},a),{limits:"adjacent",isFunction:!0,variant:"main",variantStyle:"up"}))}),Bt(["liminf","limsup"],"",{ifMode:"math",createAtom:a=>new Rc({"\\liminf":"lim inf","\\limsup":"lim sup"}[a.command],me(Se({},a),{limits:"over-under",variant:"main"}))}),Bt(["lim","mod"],"",{ifMode:"math",createAtom:a=>new Rc(a.command.slice(1),me(Se({},a),{limits:"over-under",variant:"main"}))}),Bt(["det","max","min"],"",{ifMode:"math",isFunction:!0,createAtom:a=>new Rc(a.command.slice(1),me(Se({},a),{limits:"over-under",isFunction:!0,variant:"main"}))}),Bt(["ang"],"{:math}",{ifMode:"math",createAtom:a=>new Un(me(Se({},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 Tr("\xB0",{style:me(Se({},a.style),{variant:"normal",variantStyle:"up"})});return new Tr([b,ee],{type:"inner",isSelected:a.isSelected,caret:E})}}),Bt("sqrt","[index:auto]{radicand:expression}",{ifMode:"math",createAtom:a=>new o0(me(Se({},a),{body:nt(a.args[1]),index:a.args[0]?nt(a.args[0]):void 0}))}),Bt(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{:expression}{:expression}",{ifMode:"math",createAtom:a=>{const y=Se({},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 ku(E[0]?nt(E[0]):[new Fi],E[1]?nt(E[1]):[new Fi],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}`:uo(a.command,b,E)}}),Bt(["brace","brack"],"",{infix:!0,createAtom:a=>new ku(nt(a.args[0]),nt(a.args[1]),me(Se({},a),{hasBarLine:!1,leftDelim:a.command==="\\brace"?"\\lbrace":"\\lbrack",rightDelim:a.command==="\\brace"?"\\rbrace":"\\rbrack"})),serialize:(a,y)=>ya([a.aboveToLatex(y),a.command,a.belowToLatex(y)])}),Bt(["over","atop","choose"],"",{infix:!0,createAtom:a=>{let y,b;const E=a.args;return a.command==="\\choose"&&(y="(",b=")"),new ku(nt(E[0]),nt(E[1]),me(Se({},a),{hasBarLine:a.command==="\\over",leftDelim:y,rightDelim:b}))},serialize:(a,y)=>ya([a.aboveToLatex(y),a.command,a.belowToLatex(y)])}),Bt(["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 ku(nt(E[0]),nt(E[1]),me(Se({},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)}`}),Bt("pdiff","{numerator}{denominator}",{ifMode:"math",createAtom:a=>new ku(nt(a.args[0]),nt(a.args[1]),me(Se({},a),{hasBarLine:!0,numerPrefix:"\u2202",denomPrefix:"\u2202"}))}),Bt(["sum","prod","bigcup","bigcap","coprod","bigvee","bigwedge","biguplus","bigotimes","bigoplus","bigodot","bigsqcup","intop"],"",{ifMode:"math",createAtom:a=>new fh({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)],me(Se({},a),{limits:"auto",variant:"main"}))}),Bt("smallint","",{ifMode:"math",createAtom:a=>new Rc("\u222B",me(Se({},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"};Bt(Object.keys(op),"",{ifMode:"math",createAtom:a=>{const y=a.command,b=op[y.slice(1)];return new fh(b,me(Se({},a),{limits:"adjacent",variant:{"\u22D2":"ams","\u22D3":"ams"}[b]}))}}),Bt(["Re","Im"],"",{ifMode:"math",createAtom:a=>new Rc({"\\Re":"\u211C","\\Im":"\u2111"}[a.command],me(Se({},a),{limits:"adjacent",isFunction:!0,variant:"fraktur"}))}),Bt("middle","{:delim}",{ifMode:"math",createAtom:a=>{var y;return new r0(me(Se({},a),{delim:(y=a.args[0])!=null?y:"|",size:1}))}}),Bt("the","{:value}",{createAtom:a=>new Un(me(Se({},a),{captureSelection:!0,verbatimLatex:null})),render:(a,y)=>{var b;const E=new La({parent:y},a.style);let ee="";a.isSelected&&(ee+=" ML__selected");const re=E.evaluate(a.args[0]);return new Tr(((b=Do(re))!=null?b:"").split("").map(ae=>new Tr(ae,{type:"ord",classes:ee,mode:a.mode,isSelected:a.isSelected,style:Se({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=Do(a.args[0]))!=null?y:"\\relax"}`}}),Bt("mathtip","{:auto}{:math}",{createAtom:a=>new hh(me(Se({},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)}}{${Un.serialize([a.tooltip],me(Se({},y),{defaultMode:"math"}))}}`}),Bt("texttip","{:auto}{:text}",{createAtom:a=>new hh(me(Se({},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)}}{${Un.serialize([a.tooltip],me(Se({},y),{defaultMode:"text"}))}}`}),Bt("error","{:math}",{createAtom:a=>new Un(me(Se({},a),{body:nt(a.args[0])})),serialize:(a,y)=>`\\error{${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__error"})}),Bt("ensuremath","{:math}",{createAtom:a=>new Un(me(Se({},a),{body:nt(a.args[0])})),serialize:(a,y)=>`${a.command}{${a.bodyToLatex(me(Se({},y),{defaultMode:"math"}))}}`}),Bt("color","{:value}",{applyStyle:(a,y,b)=>{var E,ee;return{verbatimColor:(E=Do(y[0]))!=null?E:void 0,color:b.toColor((ee=y[0])!=null?ee:{string:"red"})}}}),Bt("textcolor","{:value}{content:auto*}",{applyStyle:(a,y,b)=>{var E,ee;return{verbatimColor:(E=Do(y[0]))!=null?E:void 0,color:b.toColor((ee=y[0])!=null?ee:{string:"red"})}}}),Bt("boxed","{content:math}",{createAtom:a=>new ko(me(Se({},a),{body:nt(a.args[0]),framecolor:{string:"black"}}))}),Bt("colorbox","{:value}{:text*}",{applyStyle:(a,y,b)=>{var E,ee;return{verbatimBackgroundColor:(E=Do(y[0]))!=null?E:void 0,backgroundColor:b.toBackgroundColor((ee=y[0])!=null?ee:{string:"yellow"})}}}),Bt("fcolorbox","{frame-color:value}{background-color:value}{content:text}",{applyMode:"text",createAtom:a=>{var y,b;return new ko(me(Se({},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(me(Se({},y),{defaultMode:"text"})):uo(a.command,(b=Do(a.framecolor))!=null?b:"",(E=Do(a.backgroundcolor))!=null?E:"",a.bodyToLatex(me(Se({},y),{defaultMode:"text"})))}}),Bt("bbox","[:bbox]{body:auto}",{createAtom:a=>{var y;const b=a.args[0],E=nt(a.args[1]);return b?new ko(me(Se({},a),{body:E,padding:b.padding,border:b.border,backgroundcolor:(y=b.backgroundcolor)!=null?y:void 0})):new ko(me(Se({},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=Do(a.padding))!=null?b:""),a.border&&re.push(`border: ${a.border}`),a.backgroundcolor&&re.push((E=Do(a.backgroundcolor))!=null?E:""),ee+=`[${re.join(",")}]`}return uo(ee,a.bodyToLatex(y))}}),Bt(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"],"{:rest}",{createAtom:a=>new Un(me(Se({},a),{body:nt(a.args[0])})),render:(a,y)=>{const b=new La({parent:y,mathstyle:a.command.slice(1)},a.style),E=Un.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):`{${ya([a.command,a.bodyToLatex(y)])}}`}),Bt(["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]})}),Bt("fontseries","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontSeries:(b=y[0])!=null?b:"auto"}}}),Bt("fontshape","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontShape:(b=y[0])!=null?b:"auto"}}}),Bt("fontfamily","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontFamily:(b=y[0])!=null?b:"roman"}}}),Bt("selectfont","",{ifMode:"text",applyStyle:()=>({})}),Bt("bf","{:rest}",{applyStyle:()=>({fontSeries:"b",fontShape:"n",fontFamily:"roman"})}),Bt(["boldsymbol","bm"],"{:math}",{applyMode:"math",createAtom:a=>new Un(me(Se({},a),{body:nt(a.args[0])})),serialize:(a,y)=>`${a.command}{${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__boldsymbol"})}),Bt("bold","{:math*}",{applyMode:"math",applyStyle:()=>({variantStyle:"bold"})}),Bt("bfseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),Bt("mdseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),Bt("upshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),Bt("slshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),Bt("scshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),Bt("textbf","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),Bt("textmd","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),Bt("textup","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),Bt("textnormal","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n",fontSeries:"m"})}),Bt("textsl","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),Bt("textit","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"it"})}),Bt("textsc","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),Bt("textrm","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"roman"})}),Bt("textsf","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"sans-serif"})}),Bt("texttt","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"monospace"})}),Bt("mathbf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"bold"})}),Bt("mathit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"italic"})}),Bt("mathnormal","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"italic"})}),Bt("mathbfit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"bolditalic"})}),Bt("mathrm","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"up"})}),Bt("mathsf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"sans-serif",variantStyle:"up"})}),Bt("mathtt","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"monospace",variantStyle:"up"})}),Bt("it","{:rest}",{applyStyle:()=>({fontSeries:"m",fontShape:"it",fontFamily:"roman",variantStyle:"italic"})}),Bt("rmfamily","",{applyStyle:()=>({fontFamily:"roman"})}),Bt("sffamily","",{applyStyle:()=>({fontFamily:"sans-serif"})}),Bt("ttfamily","",{applyStyle:()=>({fontFamily:"monospace"})}),Bt(["Bbb","mathbb"],"{:math*}",{applyStyle:()=>({variant:"double-struck",variantStyle:"up"})}),Bt(["frak","mathfrak"],"{:math*}",{applyStyle:()=>({variant:"fraktur",variantStyle:"up"})}),Bt("mathcal","{:math*}",{applyStyle:()=>({variant:"calligraphic",variantStyle:"up"})}),Bt("mathscr","{:math*}",{applyStyle:()=>({variant:"script",variantStyle:"up"})}),Bt("mbox","{:text}",{ifMode:"math",createAtom:a=>new Un(me(Se({},a),{type:"mord",body:nt(a.args[0]),mode:"math"})),serialize:(a,y)=>uo("\\mbox",a.bodyToLatex(me(Se({},y),{defaultMode:"text"})))}),Bt("text","{:text}",{ifMode:"math",applyMode:"text"}),Bt(["class","htmlClass"],"{name:string}{content:auto}",{createAtom:a=>new Un(me(Se({},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:""})}}),Bt(["cssId","htmlId"],"{id:string}{content:auto}",{createAtom:a=>new Un(me(Se({},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}}),Bt("htmlData","{data:string}{content:auto}",{createAtom:a=>new Un(me(Se({},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}}),Bt(["style","htmlStyle"],"{data:string}{content:auto}",{createAtom:a=>new Un(me(Se({},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}}),Bt("em","{:rest}",{createAtom:a=>new Un(me(Se({},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"})}),Bt("emph","{:auto}",{createAtom:a=>new Un(me(Se({},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}};Bt(["bigl","Bigl","biggl","Biggl","bigr","Bigr","biggr","Biggr","bigm","Bigm","biggm","Biggm","big","Big","bigg","Bigg"],"{:delim}",{createAtom:a=>{var y;return new i0(me(Se({},a),{delim:(y=a.args[0])!=null?y:".",size:sp[a.command].size,delimType:sp[a.command].mclass}))}}),Bt(["hspace","hspace*"],"{width:value}",{createAtom:a=>{var y;return new Sd(me(Se({},a),{width:(y=a.args[0])!=null?y:{dimension:0}}))}}),Bt(["mkern","kern","mskip","hskip","mspace"],"{width:value}",{createAtom:a=>{var y;return new Sd(me(Se({},a),{width:(y=a.args[0])!=null?y:{dimension:0}}))}}),Bt("mathchoice","{:math}{:math}{:math}{:math}",{createAtom:a=>new Un(a),render:(a,y)=>{let b=0;const E=y.mathstyle.id;(E===Dc||E===ml)&&(b=1),(E===zl||E===ss)&&(b=2),(E===ks||E===jo)&&(b=3);const ee=nt(a.args[b]);return Un.createBox(y,ee)},serialize:(a,y)=>`\\mathchoice{${Un.serialize(a.args[0],y)}}{${Un.serialize(a.args[1],y)}}{${Un.serialize(a.args[2],y)}}{${Un.serialize(a.args[3],y)}}`}),Bt("mathop","{:auto}",{createAtom:a=>new Un(me(Se({},a),{type:"mop",body:nt(a.args[0]),limits:"over-under",isFunction:!0,captureSelection:!0})),render:(a,y)=>{var b;let E=Un.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 Tr(a.bind(y,E),{type:"op",isSelected:a.isSelected,classes:"op-group"})},serialize:(a,y)=>{const b=[uo(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)),ya(b)}}),Bt(["mathbin","mathrel","mathopen","mathclose","mathpunct","mathord","mathinner"],"{:auto}",{createAtom:a=>new Un(me(Se({},a),{type:{"\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[a.command],body:nt(a.args[0])}))}),Bt(["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 Un(me(Se({},a),{type:"mop",body:y,isFunction:!0,limits:a.command==="\\operatorname"?"adjacent":"over-under"}))},render:(a,y)=>{var b;let E=Un.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 Tr(a.bind(y,E),{type:"op",isSelected:a.isSelected,classes:"op-group"})},serialize:(a,y)=>{const b=[uo(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)),ya(b)}}),Bt(["char","unicode"],"{charcode:value}",{createAtom:a=>new Un(me(Se({},a),{type:a.mode==="text"?"text":"mord"})),serialize:a=>{var y;return`${a.command}${Do((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)}}),Bt("rule","[raise:value]{width:value}{thickness:value}",{createAtom:a=>new Un(a),render:(a,y)=>{var b,E,ee;const re=new La({parent:y,mathstyle:"textstyle"},a.style),ae=re.toEm((b=a.args[0])!=null?b:{dimension:0}),de=re.toEm((E=a.args[1])!=null?E:{dimension:10}),ge=re.toEm((ee=a.args[2])!=null?ee:{dimension:10}),be=new Tr(null,{classes:"rule",type:"ord"});return be.width=de,be.height=ge+ae,be.depth=-ae,be.setStyle("border-right-width",de,"em"),be.setStyle("border-top-width",ge,"em"),be.setStyle("border-color",a.style.color),be.setStyle("vertical-align",ae,"em"),a.isSelected&&be.setStyle("opacity","50%"),a.bind(re,be),a.caret&&(be.caret=a.caret),be.wrap(y)},serialize:a=>`\\rule${a.args[0]?`[${Do(a.args[0])}]`:""}{${Do(a.args[1])}}{${Do(a.args[2])}}`}),Bt(["overline","underline"],"{:auto}",{createAtom:a=>new Un(me(Se({},a),{body:nt(a.args[0])})),render:(a,y)=>{const b=a.command.substring(1),E=new La({parent:y,mathstyle:"cramp"},a.style),ee=Un.createBox(E,a.body);if(!ee)return null;const re=E.metrics.defaultRuleThickness/E.scalingFactor,ae=new Tr(null,{classes:b+"-line"});ae.height=re,ae.maxFontSize=re*1.125*E.scalingFactor;let de;return b==="overline"?de=new Qa({shift:0,children:[{box:ee},3*re,{box:ae},re]}):de=new Qa({top:ee.height,children:[re,{box:ae},3*re,{box:ee}]}),a.caret&&(de.caret=a.caret),new Tr(de,{classes:b,type:"ignore"})}}),Bt("overset","{:auto}{base:auto}",{createAtom:a=>{const y=nt(a.args[1]);return new Vs(me(Se({},a),{above:nt(a.args[0]),body:y,skipBoundary:!1,boxType:rc(y)}))},serialize:(a,y)=>uo(a.command,a.aboveToLatex(y),a.bodyToLatex(y))}),Bt("underset","{:auto}{base:auto}",{createAtom:a=>{const y=nt(a.args[1]);return new Vs(me(Se({},a),{below:nt(a.args[0]),body:y,skipBoundary:!1,boxType:rc(y)}))},serialize:(a,y)=>uo(a.command,a.belowToLatex(y),a.bodyToLatex(y))}),Bt("overunderset","{above:auto}{below:auto}{base:auto}",{createAtom:a=>{const y=nt(a.args[2]);return new Vs(me(Se({},a),{above:nt(a.args[0]),below:nt(a.args[1]),body:y,skipBoundary:!1,boxType:rc(y)}))},serialize:(a,y)=>uo(a.command,a.belowToLatex(y),a.bodyToLatex(y))}),Bt(["stackrel","stackbin"],"[below:auto]{above:auto}{base:auto}",{createAtom:a=>new Vs(me(Se({},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)=>uo(a.command,a.aboveToLatex(y),a.bodyToLatex(y))}),Bt("smash","[:string]{:auto}",{createAtom:a=>{var y,b,E,ee;return new wd(me(Se({},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}))}}),Bt(["vphantom"],"{:auto}",{createAtom:a=>new wd(me(Se({},a),{body:nt(a.args[0]),isInvisible:!0,smashWidth:!0}))}),Bt(["hphantom"],"{:auto}",{createAtom:a=>new wd(me(Se({},a),{body:nt(a.args[0]),isInvisible:!0,smashHeight:!0,smashDepth:!0}))}),Bt(["phantom"],"{:auto}",{createAtom:a=>new wd(me(Se({},a),{body:nt(a.args[0]),isInvisible:!0}))}),Bt("not","{:math}",{createAtom:a=>{const y=nt(a.args[0]);return y.length===0?new Un(me(Se({},a),{type:"mrel",value:"\uE020"})):new Un(me(Se({},a),{body:[new Bc(me(Se({},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{${Un.serialize(b.group,y)}}`:`\\not${Un.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":rc(nt(a.args[0])),ee=Un.createBox(y,a.body,{type:E});return a.caret&&(ee.caret=a.caret),a.bind(y,ee)}}),Bt(["ne","neq"],"",{createAtom:a=>new Un(me(Se({},a),{type:"mrel",body:[new Bc(me(Se({},a),{body:"\uE020",align:"right",boxType:"rel"})),new Un(me(Se({},a),{value:"="}))],captureSelection:!0})),serialize:a=>a.command}),Bt("rlap","{:auto}",{createAtom:a=>new Bc(me(Se({},a),{body:nt(a.args[0]),align:"right"}))}),Bt("llap","{:auto}",{createAtom:a=>new Bc(me(Se({},a),{body:nt(a.args[0]),align:"left"}))}),Bt("mathrlap","{:math}",{createAtom:a=>new Bc(me(Se({},a),{body:nt(a.args[0]),align:"left"}))}),Bt("mathllap","{:math}",{createAtom:a=>new Bc(me(Se({},a),{body:nt(a.args[0]),align:"left"}))}),Bt("raisebox","{:value}{:text}",{createAtom:a=>{var y;return new ko(me(Se({},a),{body:nt(a.args[1]),padding:{dimension:0},offset:(y=a.args[0])!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b;return uo("\\raisebox",(b=Do(a.offset))!=null?b:"0pt",a.bodyToLatex(y))}}),Bt("raise","{:value}{:auto}",{createAtom:a=>{var y;return new ko(me(Se({},a),{body:nt(a.args[1]),padding:{dimension:0},offset:(y=a.args[0])!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b;return uo("\\raise",(b=Do(a.offset))!=null?b:"0pt",a.bodyToLatex(y))}}),Bt("lower","{:value}{:auto}",{createAtom:a=>{var y;return new ko(me(Se({},a),{body:nt(a.args[1]),padding:{dimension:0},offset:(y=Us(a.args[0],-1))!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b,E;return uo("\\lower",(E=Do(Us((b=a.offset)!=null?b:{dimension:0},-1)))!=null?E:"0pt",a.bodyToLatex(y))}}),Pe("0123456789/@.?!"),Qe(65,90),Qe(97,122),Pe([["\\forall",8704],["\\exists",8707],["\\nexists",8708,"mord","ams"],["\\mid",8739,"mrel"],["\\top",8868],["\\bot",8869]]),Pe([["\\#",35],["\\&",38],["\\parallelogram",9649],["\\spadesuit",9824],["\\heartsuit",9825],["\\diamondsuit",9826],["\\clubsuit",9827],["\\flat",9837],["\\natural",9838],["\\sharp",9839]]),Pe([["\\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]]),Pe([["\\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"),Pe([["\\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"]]),Pe([["\\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"]]),Pe([["\\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"),Pe([["+",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"),Pe([["\\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"),Pe([["\\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]]),Pe([["=",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"),Pe([["\\lnot",172],["\\neg",172],["\\triangle",9651],["\\subsetneq",8842],["\\varsubsetneq",57370],["\\subsetneqq",10955],["\\varsubsetneqq",57367],["\\nsubset",8836],["\\nsupset",8837],["\\nsubseteq",8840],["\\nsupseteq",8841]],"mrel","ams"),Pe([["\\wp",8472],["\\aleph",8501]]),Pe([["\\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"),Pe([["\\ ",160],["~",160]],"space"),Bt(["!",",",":",";",">","enskip","enspace","quad","qquad"],"",{createAtom:a=>new Sd(a)}),Bt("space","",{createAtom:a=>new Sd(a)}),Pe([["\\colon",58],["\\cdotp",8901],["\\vdots",8942,"mord"],["\\ldotp",46],[",",44],[";",59]],"mpunct"),Pe([["\\cdots",8943],["\\ddots",8945],["\\ldots",8230],["\\mathellipsis",8230]],"minner"),Pe([["\\/",47],["|",8739,"mord"],["\\imath",305],["\\jmath",567],["\\degree",176],["'",8242],['"',8221]]);var lp="<mo>&#x2061;</mo>",Xf="<mo>&#8290;</mo>";function Yf(a){return a.replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function no(a,y){return!a||!y.generateID?"":` extid="${a}"`}function Mv(a,y,b){var E,ee,re,ae,de,ge,be,Ce,$e,Ye,gt;let Et=!1;y=y!=null?y:a.atoms.length;let _n="",kr="",wn=a.atoms[a.index];const rr=(ee=(E=wn.style)==null?void 0:E.variant)!=null?ee:"",Ir=(ae=(re=wn.style)==null?void 0:re.variantStyle)!=null?ae:"";let dr="";if(rr||Ir){const Ii=Rn(wn.value,(de=wn.style)==null?void 0:de.variant,(ge=wn.style)==null?void 0:ge.variantStyle);if(Ii!==wn.value)return a.index+=1,_n=`<mi${no(wn.id,b)}>${Ii}</mi>`,Ul(_n,a,b)||(a.mathML+=_n,a.lastType="mi"),!0;dr=(be={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"}[Ir+rr])!=null?be:"",dr=` mathvariant="${dr}"`}const ci={"\\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(wn.command==="!")return a.index+=1,_n="<mo>!</mo>",Ul(_n,a,b)||(a.mathML+=_n,a.lastType="mo"),!0;if(ci[wn.command]){a.index+=1;let Ii=`<mi${no(wn.id,b)}${dr}>${ci[wn.command]}</mi>`;return(a.lastType==="mi"||a.lastType==="mn"||a.lastType==="mtext"||a.lastType==="fence")&&(Ii=Xf+Ii),Ul(Ii,a,b)||(a.mathML+=Ii,a.lastType="mi"),!0}if(wn.command==="\\operatorname")kr=Nu(wn.body),a.index+=1;else if(rr||Ir)for(;a.index<y&&(wn.type==="mord"||wn.type==="macro")&&!wn.isDigit()&&rr===(($e=(Ce=wn.style)==null?void 0:Ce.variant)!=null?$e:"")&&Ir===((gt=(Ye=wn.style)==null?void 0:Ye.variantStyle)!=null?gt:"");)kr+=Nu([wn]),a.index+=1,wn=a.atoms[a.index];else(wn.type==="mord"||wn.type==="macro")&&!wn.isDigit()&&(kr+=Nu([wn]),a.index+=1);if(kr.length>0){Et=!0,_n=`<mi${dr}>${kr}</mi>`;const Ii=a.lastType;_n.endsWith(">f</mi>")||_n.endsWith(">g</mi>")?(_n+=lp,a.lastType="applyfunction"):a.lastType=/^<mo>(.*)<\/mo>$/.test(_n)?"mo":"mi",Ul(_n,a,b)||((Ii==="mi"||Ii==="mn"||Ii==="mtext"||Ii==="fence")&&(_n=Xf+_n),a.mathML+=_n)}return Et}function Ev(a){return a.index<a.atoms.length&&a.atoms[a.index].superscript&&a.atoms[a.index].type==="subsup"}function kv(a){let y=-1,b=a.index,E=!1,ee=!1;for(;b<a.atoms.length&&!E&&!ee;){const re=a.atoms[b];E=!re.isDigit(),ee=!E&&re.superscript!==void 0,b++}return ee&&(y=b-1),y}function Ul(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=Za(ee.superscript,b);y.lastType="";const de=Za(ee.subscript,b);if(y.lastType=re,!ae&&!de)return!1;let ge="";return ae&&de?ge=`<msubsup>${a}${de}${ae}</msubsup>`:ae?ge=`<msup>${a}${ae}</msup>`:de&&(ge=`<msub>${a}${de}</msub>`),y.mathML+=ge,y.lastType="",!0}function _v(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 ${no(a.atoms[E].id,b)}>${ee}</mtext>`,a.lastType="mtext",!0):!1}function Lv(a,y,b){y=y!=null?y:a.atoms.length;const E=a.index;let ee="",re=kv(a);for(re>=0&&re<y&&(y=re);a.index<y&&a.atoms[a.index].isDigit();)ee+=a.atoms[a.index].asDigit(),a.index+=1;return ee.length<=0?!1:(ee="<mn"+no(a.atoms[E].id,b)+">"+ee+"</mn>",re<0&&Ev(a)&&(re=a.index,a.index+=1),Ul(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,de=0;const ge=a.index;let be=-1,Ce=ge+1;for(;Ce<y&&!ae;)a.atoms[Ce].type==="mopen"?de+=1:a.atoms[Ce].type==="mclose"&&(de-=1),de===-1&&(ae=!0,be=Ce),Ce+=1;ae&&(ee="<mrow>",ee+=jc(a.atoms[ge],b),ee+=Za(a.atoms,b,ge+1,be),ee+=jc(a.atoms[be],b),ee+="</mrow>",a.index=be+1,(a.lastType==="mi"||a.lastType==="mn"||a.lastType==="mfrac"||a.lastType==="fence")&&(a.mathML+=Xf),Ul(ee,a,b)&&(E=!0,a.lastType="",ee=""),re="fence")}return ee.length>0&&(E=!0,a.mathML+=ee,a.lastType=re),E}function Tv(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 de={"\\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(de[ae.command]){a.index+=1;const ge=`<mo${no(ae.id,b)}>${de[ae.command]}</mo>`;return Ul(ge,a,b)||(a.mathML+=ge,a.lastType="mo"),!0}if(a.index<y&&(ae.type==="mbin"||ae.type==="mrel"))ee+=Wh(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 ge=jc(ae,b);return ae.superscript&&ae.subscript?(ee+="<munderover>"+ge,ee+=Za(ae.subscript,b),ee+=Za(ae.superscript,b),ee+="</munderover>"):ae.superscript?(ee+="<mover>"+ge,ee+=Za(ae.superscript,b),ee+="</mover>"):ae.subscript&&(ee+="<munder>"+ge,ee+=Za(ae.subscript,b),ee+="</munder>"),a.mathML+=ee,a.lastType="mo",a.index+=1,!0}{const ge=a.atoms[a.index],be=ge.value==="\\operatorname",Ce=be?'<mi class="MathML-Unit"'+no(ge.id,b)+">"+Nu(ge.value)+"</mi>":jc(ge,b);ee+=Ce,!be&&!/^<mo>(.*)<\/mo>$/.test(Ce)?(ee+=lp,re="applyfunction"):re=be?"mi":"mo"}(a.lastType==="mi"||a.lastType==="mn")&&!/^<mo>(.*)<\/mo>$/.test(ee)&&(ee=Xf+ee),a.index+=1}return ee.length>0&&(E=!0,Ul(ee,a,b)||(a.mathML+=ee,a.lastType=re)),E}function Za(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 Un)ee.mathML=Wh(a,y);else if(Array.isArray(a)){ee.atoms=a;let re=0;for(E=E||(a?a.length:0);ee.index<E;)if(_v(ee,E,y)||Lv(ee,E,y)||Mv(ee,E,y)||Tv(ee,E,y)||Av(ee,E,y))re+=1;else if(ee.index<E){let ae=Wh(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,Ul(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 jc(a,y){let b="";const E=Nu(a.value);return E&&(b="<mo"+no(a.id,y)+">"+E+"</mo>"),b}function Nu(a){if(!a)return"";if(typeof a=="string")return Yf(a);if(!Array.isArray(a)&&typeof a.body=="string")return Yf(a.body);let y="";for(const b of a)typeof b.value=="string"&&(y+=b.value);return Yf(y)}function Wh(a,y){var b,E,ee,re,ae,de,ge,be,Ce,$e,Ye,gt,Et,_n,kr,wn,rr,Ir,dr,ci,Ii,bi;if(a.mode==="text")return`<mi${no(a.id,y)}>${a.value}</mi>`;const Pa={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"},qa={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\>":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let zr="",Fs="",_l,Xs,qo,zs,Ms,ro;const{command:Lo}=a;if(a.command==="\\error")return`<merror${no(a.id,y)}>${Za(a.body,y)}</merror>`;const Jo={"\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\lbrack":"[","\\rbrack":"]","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"},Ll={"\\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":zr=Za(a.body,y);break;case"array":if((a.leftDelim&&a.leftDelim!=="."||a.rightDelim&&a.rightDelim!==".")&&(zr+="<mrow>",a.leftDelim&&a.leftDelim!=="."&&(zr+="<mo>"+(Jo[a.leftDelim]||a.leftDelim)+"</mo>")),zr+="<mtable",a.colFormat){for(zr+=' columnalign="',qo=0;qo<a.colFormat.length;qo++)a.colFormat[qo].align&&(zr+={l:"left",c:"center",r:"right"}[a.colFormat[qo].align]+" ");zr+='"'}for(zr+=">",Xs=0;Xs<a.array.length;Xs++){for(zr+="<mtr>",_l=0;_l<a.array[Xs].length;_l++)zr+="<mtd>"+Za(a.array[Xs][_l],y)+"</mtd>";zr+="</mtr>"}zr+="</mtable>",(a.leftDelim&&a.leftDelim!=="."||a.rightDelim&&a.rightDelim!==".")&&(a.rightDelim&&a.rightDelim!=="."&&(zr+="<mo>"+(Jo[a.leftDelim]||a.rightDelim)+"</mo>"),zr+="</mrow>");break;case"genfrac":(a.leftDelim||a.rightDelim)&&(zr+="<mrow>"),a.leftDelim&&a.leftDelim!=="."&&(zr+="<mo"+no(a.id,y)+">"+(Jo[a.leftDelim]||a.leftDelim)+"</mo>"),a.hasBarLine?(zr+="<mfrac>",zr+=Za(a.above,y)||"<mi>&nbsp;</mi>",zr+=Za(a.below,y)||"<mi>&nbsp;</mi>",zr+="</mfrac>"):(zr+="<mtable"+no(a.id,y)+">",zr+="<mtr>"+Za(a.above,y)+"</mtr>",zr+="<mtr>"+Za(a.below,y)+"</mtr>",zr+="</mtable>"),a.rightDelim&&a.rightDelim!=="."&&(zr+="<mo"+no(a.id,y)+">"+(Jo[a.rightDelim]||a.rightDelim)+"</mo>"),(a.leftDelim||a.rightDelim)&&(zr+="</mrow>");break;case"surd":a.hasEmptyBranch("above")?(zr+="<msqrt"+no(a.id,y)+">",zr+=Za(a.body,y),zr+="</msqrt>"):(zr+="<mroot"+no(a.id,y)+">",zr+=Za(a.body,y),zr+=Za(a.above,y),zr+="</mroot>");break;case"leftright":const Al=a,Tl=Al.leftDelim;zr="<mrow>",Tl&&Tl!=="."&&(zr+=`<mo${no(a.id,y)}>${(b=Jo[Tl])!=null?b:Tl}</mo>`),a.body&&(zr+=Za(a.body,y));const Dl=Al.matchingRightDelim();Dl&&Dl!=="."&&(zr+=`<mo${no(a.id,y)}>${(E=Jo[Dl])!=null?E:Dl}</mo>`),zr+="</mrow>";break;case"sizeddelim":case"delim":zr+=`<mo${no(a.id,y)}>${Jo[a.value]||a.value}</mo>`;break;case"accent":zr+='<mover accent="true"'+no(a.id,y)+">",zr+=Za(a.body,y),zr+="<mo>"+(Ll[Lo]||a.accent)+"</mo>",zr+="</mover>";break;case"line":case"overlap":break;case"overunder":Ms=a.above,zs=a.below,(a.svgAbove||Ms)&&(a.svgBelow||zs)?ro=a.body:Ms&&Ms.length>0?(ro=a.body,(re=(ee=a.body)==null?void 0:ee[0])!=null&&re.below?(zs=a.body[0].below,ro=a.body[0].body):((de=(ae=a.body)==null?void 0:ae[0])==null?void 0:de.type)==="first"&&((be=(ge=a.body)==null?void 0:ge[1])!=null&&be.below)&&(zs=a.body[1].below,ro=a.body[1].body)):zs&&zs.length>0&&(ro=a.body,($e=(Ce=a.body)==null?void 0:Ce[0])!=null&&$e.above?(Ms=a.body[0].above,ro=a.body[0].body):((gt=(Ye=a.body)==null?void 0:Ye[0])==null?void 0:gt.type)==="first"&&((_n=(Et=a.body)==null?void 0:Et[1])!=null&&_n.above)&&(Ms=a.body[1].overscript,ro=a.body[1].body)),(a.svgAbove||Ms)&&(a.svgBelow||zs)?(zr+=`<munderover ${no(a.id,y)}>`,zr+=(kr=Pa[a.svgBody])!=null?kr:Za(ro,y),zr+=(wn=Pa[a.svgBelow])!=null?wn:Za(zs,y),zr+=(rr=Pa[a.svgAbove])!=null?rr:Za(Ms,y),zr+="</munderover>"):a.svgAbove||Ms?(zr+=`<mover ${no(a.id,y)}>`+((Ir=Pa[a.svgBody])!=null?Ir:Za(ro,y)),zr+=(dr=Pa[a.svgAbove])!=null?dr:Za(Ms,y),zr+="</mover>"):(a.svgBelow||zs)&&(zr+=`<munder ${no(a.id,y)}>`+((ci=Pa[a.svgBody])!=null?ci:Za(ro,y)),zr+=(Ii=Pa[a.svgBelow])!=null?Ii:Za(zs,y),zr+="</munder>");break;case"placeholder":zr+="?";break;case"mord":{zr=typeof a.value=="string"?a.value:Lo,Lo==="\\char"?zr="&#x"+("000000"+a.args[0].number.toString(16)).slice(-4)+";":zr.length>0&&zr.startsWith("\\")&&(typeof a.value=="string"&&a.value.charCodeAt(0)>255?zr="&#x"+("000000"+a.value.charCodeAt(0).toString(16)).slice(-4)+";":typeof a.value=="string"?zr=a.value.charAt(0):(console.error("Did not expect this"),zr=""));const cl=/\d/.test(zr)?"mn":"mi";zr=`<${cl}${no(a.id,y)}>${Yf(zr)}</${cl}>`;break}case"mbin":case"mrel":case"minner":zr=jc(a,y);break;case"mpunct":zr='<mo separator="true"'+no(a.id,y)+">"+Lo+"</mo>";break;case"mop":case"operator":case"extensible-symbol":a.body!=="\u200B"&&(zr="<mo"+no(a.id,y)+">",zr+=Lo==="\\operatorname"?a.body:Lo||a.body,zr+="</mo>");break;case"box":zr='<menclose notation="box"',a.backgroundcolor&&(zr+=' mathbackground="'+a.backgroundcolor+'"'),zr+=no(a.id,y)+">"+Za(a.body,y)+"</menclose>";break;case"spacing":zr+='<mspace width="'+((bi=qa[Lo])!=null?bi:0)+'em"/>';break;case"enclose":zr='<menclose notation="';for(const cl in a.notation)Object.prototype.hasOwnProperty.call(a.notation,cl)&&a.notation[cl]&&(zr+=Fs+cl,Fs=" ");zr+=no(a.id,y)+'">'+Za(a.body,y)+"</menclose>";break;case"prompt":zr='<menclose notation="roundexbox""">'+Za(a.body,y)+"</menclose>";break;case"space":zr+="&nbsp;";break;case"subsup":break;case"phantom":break;case"composition":break;case"rule":break;case"chem":break;case"mopen":zr+=jc(a,y);break;case"mclose":zr+=jc(a,y);break;case"macro":{const cl=a.command+Nu(a.macroArgs);cl&&(zr+=`<mo ${no(a.id,y)}>${cl}</mo>`)}break;case"latexgroup":zr+=Za(a.body,y);break;case"latex":zr+="<mtext"+no(a.id,y)+">"+a.value+"</mtext>";break;case"tooltip":zr+=Za(a.body,y);break;case"text":zr+=`<mtext ${no(a.id,y)}x>${a.value}</mtext>`;break;default:if(a.command==="\\displaystyle")return`<mrow ${no(a.id,y)} displaystyle="true">${Za(a.body,y)}</mrow>`;if(a.command==="\\textstyle")return`<mrow ${no(a.id,y)} displaystyle="false">${Za(a.body,y)}</mrow>`;console.info("Unexpected element in conversion to MathML:",a)}return zr}var $u={"\\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"},Zh={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 Dv(a){let y="";return a.startsWith("\\")&&(y=" "+a.replace("\\","")+" "),y}function Nd(a){let y=0;if(Be(a))for(const b of a)b.type!=="first"&&(y+=1);return y===1}function Iv(a){if(Be(a)){for(const y of a)if(y.type!=="first"&&y.id)return y.id.toString()}return""}function cp(a){let y="";if(Be(a))for(const b of a)b.type!=="first"&&typeof b.value=="string"&&(y+=b.value);return y}function Pv(a){return a?a.map(y=>y.value).join(""):""}function Ma(a,y){var b,E,ee,re,ae;function de(Ce){return window.MathfieldElement.textToSpeechMarkup?/[a-z]/.test(Ce)?` <say-as interpret-as="character">${Ce}</say-as>`:/[A-Z]/.test(Ce)?`capital <say-as interpret-as="character">${Ce.toLowerCase()}</say-as>`:Ce:/[a-z]/.test(Ce)?" '"+Ce.toUpperCase()+"'":/[A-Z]/.test(Ce)?" 'capital "+Ce.toUpperCase()+"'":Ce}function ge(Ce){return"<emphasis>"+Ce+"</emphasis>"}if(!y)return"";let be="";if(Be(y)){let Ce=!1,$e=!1;for(let Ye=0;Ye<y.length;Ye++)y[Ye].type!=="first"&&(y[Ye].mode!=="text"&&($e=!1),Ye<y.length-2&&y[Ye].type==="mopen"&&y[Ye+2].type==="mclose"&&y[Ye+1].type==="mord"?(be+=" of ",be+=ge(Ma(a,y[Ye+1])),Ye+=2):y[Ye].mode==="text"?$e?be+=(b=y[Ye].value)!=null?b:" ":($e=!0,be+=Ma("text",y[Ye])):y[Ye].isDigit()?Ce?be+=y[Ye].asDigit():(Ce=!0,be+=Ma(a,y[Ye])):(Ce=!1,be+=Ma(a,y[Ye])))}else if(y.mode==="text")y.id&&a==="math"&&(be+='<mark name="'+y.id.toString()+'"/>'),be+=y.value;else{y.id&&a==="math"&&(be+='<mark name="'+y.id.toString()+'"/>');let Ce="",$e="",Ye="",gt=!1;const{command:Et}=y;switch(Et){case"\\vec":return"vector "+Ma(a,y.body);case"\\acute":return Ma(a,y.body)+" acute";case"\\grave":return Ma(a,y.body)+" grave";case"\\dot":return"dot over"+Ma(a,y.body);case"\\ddot":return"double dot over"+Ma(a,y.body);case"\\mathring":return"ring over"+Ma(a,y.body);case"\\tilde":case"\\widetilde":return"tilde over"+Ma(a,y.body);case"\\bar":return Ma(a,y.body)+" bar";case"\\breve":return Ma(a,y.body)+" breve";case"\\check":case"\\widecheck":return"check over "+Ma(a,y.body);case"\\hat":case"\\widehat":return"hat over"+Ma(a,y.body);case"\\overarc":case"\\overparen":case"\\wideparen":return"arc over "+Ma(a,y.body);case"\\underarc":case"\\underparen":return"arc under "+Ma(a,y.body)}switch(y.type){case"prompt":const _n=y.body.length>1?'start input . <break time="500ms"/> '+Ma(a,y.body)+'. <break time="500ms"/> end input':"blank";be+=' <break time="300ms"/> '+_n+'. <break time="700ms"/>'+((E=y.correctness)!=null?E:"")+' . <break time="700ms"/> ';break;case"array":const kr=y.array,wn=y.environmentName;if(Object.keys(Zh).includes(wn)){be+=` begin ${Zh[wn]} `;for(let dr=0;dr<kr.length;dr++){dr>0&&(be+=","),be+=` row ${dr+1} `;for(let ci=0;ci<kr[dr].length;ci++)ci>0&&(be+=","),be+=` column ${ci+1}: `,be+=Ma("math",kr[dr][ci])}be+=` end ${Zh[wn]} `}break;case"group":Et==="\\ne"?be+=" not equal ":(Et==="\\not"&&(be+=" not "),be+=Ma("math",y.body));break;case"root":be+=Ma("math",y.body);break;case"genfrac":if(Ce=Ma("math",y.above),$e=Ma("math",y.below),Nd(y.above)&&Nd(y.below)){const ci={"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)];ci?be=ci:be+=Ce+" over "+$e}else be+=' the fraction <break time="150ms"/>'+Ce+' over <break time="150ms"/>'+$e+'.<break time="150ms"/> End fraction.<break time="150ms"/>';break;case"surd":if(Ye=Ma("math",y.body),y.hasEmptyBranch("above"))be+=Nd(y.body)?" the square root of "+Ye+" , ":' the square root of <break time="200ms"/>'+Ye+'. <break time="200ms"/> End square root';else{let dr=Ma("math",y.above);dr=dr.trim();const ci=dr.replace(/<mark([^/]*)\/>/g,"");ci==="3"?be+=' the cube root of <break time="200ms"/>'+Ye+'. <break time="200ms"/> End cube root':ci==="n"?be+=' the nth root of <break time="200ms"/>'+Ye+'. <break time="200ms"/> End root':be+=' the root with index: <break time="200ms"/>'+dr+', of <break time="200ms"/>'+Ye+'. <break time="200ms"/> End root'}break;case"leftright":{const dr=y;be+=(ee=dr.leftDelim?$u[dr.leftDelim]:void 0)!=null?ee:dr.leftDelim,be+=Ma("math",y.body),be+=(re=dr.rightDelim?$u[dr.rightDelim]:void 0)!=null?re:dr.rightDelim}break;case"rule":break;case"overunder":break;case"overlap":break;case"macro":const rr=Et.replace(/^\\/g,""),Ir=Vn()[rr];Ir&&(Ir!=null&&Ir.expand?be+=Ma("math",y.body):be+=`${rr} `);break;case"placeholder":be+="placeholder ";break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":{if(Et==="\\mathbin"||Et==="\\mathrel"||Et==="\\mathopen"||Et==="\\mathclose"||Et==="\\mathpunct"||Et==="\\mathord"||Et==="\\mathinner"){be=Ma(a,y.body);break}let dr=y.isDigit()?y.asDigit():y.value,ci=y.command;if((y.type==="delim"||y.type==="sizeddelim")&&(ci=y.value,dr=ci),a==="text")be+=dr;else{if(y.type==="mbin"&&(be+='<break time="150ms"/>'),dr){const Ii=$u[dr]||(ci?$u[ci.trim()]:"");if(Ii)be+=" "+Ii;else{const bi=ci?Dv(ci.trim()):"";be+=bi||de(dr)}}else be+=Ma("math",y.body);y.type==="mbin"&&(be+='<break time="150ms"/>')}break}case"mop":case"operator":case"extensible-symbol":if(y.value!=="\u200B"){const dr=y.command;if(dr==="\\sum")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let ci=Ma("math",y.superscript);ci=ci.trim();let Ii=Ma("math",y.subscript);Ii=Ii.trim(),be+=' the summation from <break time="200ms"/>'+Ii+'<break time="200ms"/> to <break time="200ms"/>'+ci+'<break time="200ms"/> of <break time="150ms"/>',gt=!0}else if(y.hasEmptyBranch("subscript"))be+=" the summation of";else{let ci=Ma("math",y.subscript);ci=ci.trim(),be+=' the summation from <break time="200ms"/>'+ci+'<break time="200ms"/> of <break time="150ms"/>',gt=!0}else if(dr==="\\prod")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let ci=Ma("math",y.superscript);ci=ci.trim();let Ii=Ma("math",y.subscript);Ii=Ii.trim(),be+=' the product from <break time="200ms"/>'+Ii+'<break time="200ms"/> to <break time="200ms"/>'+ci+'<break time="200ms"/> of <break time="150ms"/>',gt=!0}else if(y.hasEmptyBranch("subscript"))be+=" the product of ";else{let ci=Ma("math",y.subscript);ci=ci.trim(),be+=' the product from <break time="200ms"/>'+ci+'<break time="200ms"/> of <break time="150ms"/>',gt=!0}else if(dr==="\\int")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let ci=Ma("math",y.superscript);ci=ci.trim();let Ii=Ma("math",y.subscript);Ii=Ii.trim(),be+=' the integral from <break time="200ms"/>'+ge(Ii)+'<break time="200ms"/> to <break time="200ms"/>'+ge(ci)+' <break time="200ms"/> of ',gt=!0}else be+=' the integral of <break time="200ms"/> ';else if(typeof y.value=="string"){const ci=(ae=$u[y.value])!=null?ae:y.command?$u[y.command]:void 0;be+=ci||" "+y.value}else y.command&&(y.command==="\\mathop"?be+=Ma("math",y.body):y.command==="\\operatorname"?be+=Pv(y.body):be+=y.command.startsWith("\\")?" "+y.command.slice(1):" "+y.command)}break;case"enclose":Ye=Ma("math",y.body),be+=" crossed out "+Ye+". End crossed out.";break;case"space":case"spacing":break}if(!gt&&!y.hasEmptyBranch("superscript")){let _n=Ma(a,y.superscript);_n=_n.trim();const kr=_n.replace(/<[^>]*>/g,"");if(Nd(y.superscript)){if(a==="math"){const wn=Iv(y.superscript);wn&&(be+='<mark name="'+wn+'"/>')}kr==="\u2032"?be+=" prime ":kr==="2"?be+=" squared ":kr==="3"?be+=" cubed ":Number.isNaN(Number.parseInt(kr))?be+=" to the "+_n+"; ":be+=' to the <say-as interpret-as="ordinal">'+kr+"</say-as> power; "}else Number.isNaN(Number.parseInt(kr))?be+=" raised to the "+_n+"; ":be+=' raised to the <say-as interpret-as="ordinal">'+kr+"</say-as> power; "}if(!gt&&!y.hasEmptyBranch("subscript")){let _n=Ma("math",y.subscript);_n=_n.trim(),be+=Nd(y.subscript)?" sub "+_n:" subscript "+_n+". End subscript. "}}return be}function Fu(a){var y,b;if(window.MathfieldElement.textToSpeechRules==="sre"&&("sre"in window||"SRE"in window)){const ee=Za(a);if(ee){window.MathfieldElement.textToSpeechMarkup&&(window.MathfieldElement.textToSpeechRulesOptions=(y=window.MathfieldElement.textToSpeechRulesOptions)!=null?y:{},window.MathfieldElement.textToSpeechRulesOptions=me(Se({},window.MathfieldElement.textToSpeechRulesOptions),{markup:window.MathfieldElement.textToSpeechMarkup}),window.MathfieldElement.textToSpeechRulesOptions.markup==="ssml"&&(window.MathfieldElement.textToSpeechRulesOptions=me(Se({},window.MathfieldElement.textToSpeechRulesOptions),{markup:"ssml_step"})),window.MathfieldElement.textToSpeechRulesOptions=me(Se({},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(de){console.error("MathLive 0.98.5: `SRE.toSpeech()` runtime error",de)}return ae}return""}let E=Ma("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"&&De()==="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 $d={"\\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"},Fd={"\\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 Ov(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 _o(a){var y,b,E,ee,re,ae,de,ge,be,Ce,$e,Ye,gt;if(!a)return"";if(Be(a)){if(a.length===0)return"";if(a[0].mode==="latex")return a.map(_o).join("");if(a[0].mode==="text"){let Ir=0,dr="";for(;((y=a[Ir])==null?void 0:y.mode)==="text";)dr+=a[Ir].body?_o(a[Ir].body):a[Ir].value,Ir++;return`"${dr}" ${_o(a.slice(Ir))}`}let wn=0;const rr=[];for(;a[wn]&&a[wn].mode==="math";){let Ir="";for(;a[wn]&&a[wn].type==="mord"&&/\d/.test(a[wn].value);)Ir+=a[wn++].value;Ir?rr.push(Ir):rr.push(_o(a[wn++]))}return rr.push(_o(a.slice(wn))),Ov(rr)}if(a.mode==="text")return`"${a.value}"`;let Et="";const{command:_n}=a;let kr;if(_n==="\\placeholder")return`(${_o(a.body)})`;switch(a.type){case"accent":const wn={"\\vec":"vec","\\dot":"dot","\\ddot":"ddot","\\bar":"bar","\\hat":"hat","\\acute":"acute;","\\grave":"grave","\\tilde":"tilde","\\breve":"breave","\\check":"check"}[_n];Et=`${wn!=null?wn:""} ${_o(a.body)} `;break;case"first":return"";case"latexgroup":return a.body.map(bi=>bi.value).join("");case"group":case"root":Et=(b=$d[_n])!=null?b:_o(a.body);break;case"genfrac":{const bi=a;(bi.leftDelim||bi.rightDelim)&&(Et=bi.leftDelim==="."||!bi.leftDelim?"{:":bi.leftDelim),bi.hasBarLine?(Et+="(",Et+=_o(bi.above),Et+=")/(",Et+=_o(bi.below),Et+=")"):(Et+="("+_o(bi.above)+"),",Et+="("+_o(bi.below)+")"),(bi.leftDelim||bi.rightDelim)&&(Et+=bi.rightDelim==="."||!bi.rightDelim?"{:":bi.rightDelim)}break;case"surd":Et+=a.hasEmptyBranch("above")?"sqrt("+_o(a.body)+")":"root("+_o(a.above)+")("+_o(a.body)+")";break;case"latex":Et=a.value;break;case"leftright":{const bi=a,Pa=bi.leftDelim;Et+=Pa==="."||!Pa?"{:":Pa,Et+=_o(bi.body);const qa=bi.matchingRightDelim();Et+=qa==="."||!qa?":}":qa}break;case"sizeddelim":case"delim":Et=a.value;break;case"overlap":break;case"overunder":break;case"mord":Et=(ee=(E=$d[_n])!=null?E:_n)!=null?ee:typeof a.value=="string"?a.value:"",Et.startsWith("\\")&&(Et+=" "),kr=_n?_n.match(/{?\\char"([\dabcdefABCDEF]+)}?/):null,kr?Et=String.fromCodePoint(Number.parseInt("0x"+kr[1])):Et.length>0&&Et.startsWith("\\")&&(Et=typeof a.value=="string"?a.value.charAt(0):a.command),Et=Bv(Et,a.style);break;case"mbin":case"mrel":case"minner":Et=(ae=(re=$d[_n])!=null?re:Fd[_n])!=null?ae:a.value;break;case"mopen":case"mclose":Et=a.value;break;case"mpunct":Et=(de=Fd[_n])!=null?de:_n;break;case"mop":case"operator":case"extensible-symbol":a.value!=="\u200B"&&(Fd[_n]?Et=Fd[_n]:Et=_n==="\\operatorname"?_o(a.body):(ge=a.value)!=null?ge:_n,Et+=" ");break;case"array":const rr=a.array,Ir=a.environmentName,dr=(be={bmatrix:["[","]"],"bmatrix*":["[","]"]}[Ir])!=null?be:["(",")"],ci=[];for(const bi of rr){const Pa=[];for(const qa of bi)Pa.push(dr[0]+_o(qa)+dr[1]);ci.push(Pa.join(","))}const Ii=(Ce={bmatrix:["[","]"],"bmatrix*":["[","]"],cases:["{",":}"]}[Ir])!=null?Ce:["(",")"];Et=Ii[0]+ci.join(",")+Ii[1];break;case"box":break;case"spacing":Et=($e=$d[_n])!=null?$e:" ";break;case"enclose":Et="("+_o(a.body)+")";break;case"space":Et=" ";break;case"subsup":Et="";break;case"macro":Et=(gt=(Ye=$d[_n])!=null?Ye:Fd[_n])!=null?gt:_o(a.body);break}if(!a.hasEmptyBranch("subscript")){Et+="_";const wn=_o(a.subscript);Et+=wn.length!==1?`(${wn})`:wn}if(!a.hasEmptyBranch("superscript")){Et+="^";const wn=_o(a.superscript);Et+=wn.length!==1?`(${wn})`:wn}return Et}function Bv(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 Yo(a,y){var b,E;y!=null||(y={}),y.mathstyle=(b=y.mathstyle)!=null?b:"displaystyle";const ee=new La({from:me(Se({},bu()),{renderPlaceholder:()=>new Tr(160,{maxFontSize:1}),letterShapeStyle:(E=y==null?void 0:y.letterShapeStyle)!=null?E:"tex"}),mathstyle:y.mathstyle}),ae=new Un({mode:"math",type:"root",body:Xo(a,{context:ee,parseMode:"math",mathstyle:y.mathstyle})}).render(ee);return ae?(gu(Cd(ae,ee)),vu(ae,{classes:"ML__latex"}).toMarkup()):""}function _1(a){return t0(a,{context:bu()})}function Rv(a,y={}){return Za(Xo(a,{parseMode:"math",args:()=>"",mathstyle:"displaystyle"}),y)}function Nv(a){const y=Xo(a,{parseMode:"math",mathstyle:"displaystyle"});return Fu(y)}var qf;function $v(a){var y,b;if(!qf){const E=(y=globalThis[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:y.ComputeEngine;E?qf=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=qf==null?void 0:qf.box(a).latex)!=null?b:""}function L1(a,y="math"){return _o(new Un({type:"root",body:Xo(a,{parseMode:y})}))}function A1(a){return Oc(a,{format:"ascii-math"})[1]}function Uh(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 zu(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 jh(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,de={L:y,C:ee,H:ae};return a.alpha!==void 0&&(de.alpha=a.alpha),de}function Vh(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),de=4.076741661347994*ee-3.307711590408193*re+.230969928729428*ae,ge=-1.2684380040921763*ee+2.6097574006633715*re-.3413193963102197*ae,be=-.004196086541837188*ee-.7034186144594493*re+1.7076147009309444*ae,Ce=$e=>{const Ye=Math.abs($e);return Ye<=.0031308?$e*12.92:(Math.sign($e)||1)*(1.055*Math.pow(Ye,1/2.4)-.055)};return[Ce(de),Ce(ge),Ce(be)]}function Gh(a){const[y,b,E]=a;return y>=0&&y<=1&&b>=0&&b<=1&&E>=0&&E<=1}function Xh(a,y){let[b,E,ee]=a;return b=zu(b*255),E=zu(E*255),ee=zu(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]=Vh(a);if(Gh([y,b,E]))return Xh([y,b,E],a.alpha);const ee=zv(a);if(ee.C=0,[y,b,E]=Vh(jh(ee)),!Gh([y,b,E]))return Xh([y,b,E],a.alpha);let re=0,ae=a.L,de=(re+ae)/2;ee.C=de;const ge=.36/Math.pow(2,12);for(;ae-re>ge;)de=(re+ae)/2,ee.C=de,[y,b,E]=Vh(jh(ee)),Gh([y,b,E])?re=de:ae=de;return Xh([y,b,E],a.alpha)}function Kv(a){return up(jh(a))}function dp(a,y){const b=Uh(a),E=Uh(y),ee=.56,re=.57,ae=.62,de=.65,ge=.022,be=1.414,Ce=.1,$e=5e-4,Ye=1.14,gt=.027,Et=1.14,_n=.027;function kr(bi){return bi>=ge?bi:bi+Il(ge-bi,be)}function wn(bi){return(bi<0?-1:1)*Math.pow(Math.abs(bi),2.4)}const rr=kr(wn(E.r/255)*.2126729+wn(E.g/255)*.7151522+wn(E.b/255)*.072175),Ir=kr(wn(b.r/255)*.2126729+wn(b.g/255)*.7151522+wn(b.b/255)*.072175);let dr,ci,Ii;return Math.abs(Ir-rr)<$e?ci=0:Ir>rr?(dr=Il(Ir,ee)-Il(rr,re),ci=dr*Ye):(dr=Il(Ir,de)-Il(rr,ae),ci=dr*Et),Math.abs(ci)<Ce?Ii=0:ci>0?Ii=ci-_n:Ii=ci+gt,Ii*100}function fp(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=Uh(a);let b=((1<<24)+(zu(y.r)<<16)+(zu(y.g)<<8)+zu(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 mo(a){const y=hp(a);let b="";for(const E of y){if(typeof E.value!="string")return"";b+=E.value}return b}function hp(a){const b=a.model.selection.ranges;return b.length!==1?[]:a.model.getAtoms(b[0])}function Wv(a,y){const b=hp(a);if(b.length!==1)return!1;const E=ph[y];return E?!!E.test(b[0].value):!1}function Zv(a,y){return mo(a).length>0}function Uv(a){return[Yh(a,"double-struck","mathbb","tooltip.blackboard"),Yh(a,"fraktur","mathfrak","tooltip.fraktur"),Yh(a,"calligraphic","mathcal","tooltip.caligraphic"),qh(a,"up","mathrm","tooltip.roman-upright"),qh(a,"bold","mathbf","tooltip.bold"),qh(a,"italic","mathit","tooltip.italic")]}function jv(a){return[{label:()=>Yo(`\\vec{${mo(a)}}`),visible:()=>mo(a).length===1,onMenuSelect:()=>a.insert("\\vec{#@}",{selectionMode:"item"})},{label:()=>Yo(`\\overrightarrow{${mo(a)}}`),visible:()=>mo(a).length>0,onMenuSelect:()=>a.insert("\\overrightarrow{#@}",{selectionMode:"item"})},{label:()=>Yo(`\\overleftarrow{${mo(a)}}`),visible:()=>mo(a).length>0,onMenuSelect:()=>a.insert("\\overleftarrow{#@}",{selectionMode:"item"})},{label:()=>Yo(`\\dot{${mo(a)}}`),visible:()=>mo(a).length===1,onMenuSelect:()=>a.insert("\\dot{#@}",{selectionMode:"item"})},{label:()=>Yo(`\\ddot{${mo(a)}}`),visible:()=>mo(a).length===1,onMenuSelect:()=>a.insert("\\ddot{#@}",{selectionMode:"item"})},{label:()=>Yo(`\\bar{${mo(a)}}`),visible:()=>mo(a).length===1,onMenuSelect:()=>a.insert("\\bar{#@}",{selectionMode:"item"})},{label:()=>Yo(`\\overline{${mo(a)}}`),visible:()=>mo(a).length>0,onMenuSelect:()=>a.insert("\\overline{#@}",{selectionMode:"item"})},{label:()=>Yo(`\\overgroup{${mo(a)}}`),visible:()=>mo(a).length>0,onMenuSelect:()=>a.insert("\\overgroup{#@}",{selectionMode:"item"})},{label:()=>Yo(`\\overbrace{${mo(a)}}`),visible:()=>mo(a).length>0,onMenuSelect:()=>a.insert("\\overbrace{#@}",{selectionMode:"item"})},{label:()=>Yo(`\\underline{${mo(a)}}`),visible:()=>mo(a).length>0,onMenuSelect:()=>a.insert("\\underline{#@}",{selectionMode:"item"})},{label:()=>Yo(`\\undergroup{${mo(a)}}`),visible:()=>mo(a).length>0,onMenuSelect:()=>a.insert("\\undergroup{#@}",{selectionMode:"item"})},{label:()=>Yo(`\\underbrace{${mo(a)}}`),visible:()=>mo(a).length>0,onMenuSelect:()=>a.insert("\\underbrace{#@}",{selectionMode:"item"})}]}function Vv(a){return[{label:()=>Yo(`\\boxed{${a.getValue(a.model.selection)}}}`),onMenuSelect:()=>a.insert("\\boxed{#@}",{selectionMode:"item"})},{label:()=>Yo(`\\bbox[5px, border: 2px solid red]{${a.getValue(a.model.selection)}}`),onMenuSelect:()=>a.insert("\\bbox[5px, border: 2px solid red]{#@}",{selectionMode:"item"})},{label:()=>Yo(`\\bbox[5px, border: 2px dashed black]{${a.getValue(a.model.selection)}}`),onMenuSelect:()=>a.insert("\\bbox[5px, border: 2px dashed black]{#@}",{selectionMode:"item"})}]}function Gv(a){const y=[];for(const b of Object.keys(Ue))y.push({class:(Hv(fp(Ue[b]))==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${Ue[b]} "></span>`,ariaLabel:()=>{var E;return(E=ft(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:(fp(je[b])==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${je[b]} "></span>`,ariaLabel:()=>{var E;return(E=ft(b))!=null?E:b},checked:()=>{var E;return{some:"mixed",all:!0}[(E=a.queryStyle({color:b}))!=null?E:!1]},onMenuSelect:()=>{a.applyStyle({color:b},{operation:"toggle"}),a.adoptStyle="none"}});return y}var Yv=class extends ep{constructor(a,y,b,E){super(a,y),this.row=b,this.col=E}set active(a){const y=this.parentMenu.children;if(a)for(const b of y)b.element.classList.toggle("active",b.row<=this.row&&b.col<=this.col);else for(const b of y)b.element.classList.remove("active")}};function qv(a){const y=[];for(let b=1;b<=5;b++)for(let E=1;E<=5;E++)y.push({onCreate:(ee,re)=>new Yv(ee,re,b,E),label:"\u2610",tooltip:()=>ft("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:()=>ft("menu.array.add row above"),id:"add-row-above",onMenuSelect:()=>a.executeCommand("addRowBefore"),visible:()=>Vc(a)},{label:()=>ft("menu.array.add row below"),id:"add-row-below",onMenuSelect:()=>a.executeCommand("addRowAfter"),visible:()=>Vc(a)},{label:()=>ft("menu.array.add column before"),id:"add-column-before",onMenuSelect:()=>a.executeCommand("addColumnBefore"),visible:()=>Vc(a),enabled:()=>{const y=a.model.parentEnvironment;if(!y)return!1;const[b,E]=e1(a);return b<y.maxColumns}},{label:()=>ft("menu.array.add column after"),id:"add-column-after",onMenuSelect:()=>a.executeCommand("addColumnAfter"),visible:()=>Vc(a)},{type:"divider"},{label:()=>ft("menu.array.delete row"),id:"delete-row",onMenuSelect:()=>a.executeCommand("removeRow"),visible:()=>Vc(a)},{label:()=>ft("menu.array.delete column"),id:"delete-column",onMenuSelect:()=>a.executeCommand("removeColumn"),visible:()=>Vc(a)},{type:"divider"},{label:()=>ft("menu.borders"),visible:()=>(Qv(a)||Vc(a))&&a.isSelectionEditable,submenu:[{label:" \u22F1 ",id:"environment-no-border",onMenuSelect:()=>zd(a,"matrix")},{label:"(\u22F1)",id:"environment-parentheses",onMenuSelect:()=>zd(a,"pmatrix")},{label:"[\u22F1]",id:"environment-brackets",onMenuSelect:()=>zd(a,"bmatrix")},{label:"|\u22F1|",id:"environment-bar",onMenuSelect:()=>zd(a,"vmatrix")},{label:"{\u22F1}",id:"environment-braces",onMenuSelect:()=>zd(a,"Bmatrix")}],submenuClass:"border-submenu"},{type:"divider"},{label:()=>ft("menu.insert matrix"),id:"insert-matrix",visible:()=>a.isSelectionEditable,submenu:qv(a),submenuClass:"insert-matrix-submenu",columnCount:5},{label:()=>ft("menu.mode"),id:"mode",visible:()=>a.isSelectionEditable&&a.model.selectionIsCollapsed,submenu:[{label:()=>ft("menu.mode-math"),id:"mode-math",onMenuSelect:()=>{Au(a,"accept-all"),a.executeCommand(["switchMode","math"])},checked:()=>a.model.mode==="math"},{label:()=>ft("menu.mode-text"),id:"mode-text",onMenuSelect:()=>{Au(a,"accept-all"),a.executeCommand(["switchMode","text"])},checked:()=>a.model.mode==="text"},{label:()=>ft("menu.mode-latex"),id:"mode-latex",onMenuSelect:()=>a.executeCommand(["switchMode","latex"]),checked:()=>a.model.mode==="latex"}]},{type:"divider"},{label:()=>ft("menu.font-style"),id:"variant",visible:()=>a.isSelectionEditable,submenu:Uv(a),submenuClass:"variant-submenu"},{label:()=>ft("menu.color"),id:"color",visible:()=>a.isSelectionEditable,submenu:Xv(a),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>ft("menu.background-color"),id:"background-color",visible:()=>a.isSelectionEditable,submenu:Gv(a),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>ft("menu.accent"),id:"accent",visible:()=>a.isSelectionEditable,submenu:jv(a),submenuClass:"variant-submenu"},{label:()=>ft("menu.decoration"),id:"decoration",visible:()=>a.isSelectionEditable&&mo(a).length>0,submenu:Vv(a),submenuClass:"variant-submenu"},{type:"divider"},{label:()=>ft("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:()=>ft("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?ft("menu.solve-for",Yo(b)):ft("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:()=>ft("menu.cut"),onMenuSelect:()=>a.executeCommand("cutToClipboard"),visible:()=>!a.options.readOnly&&a.isSelectionEditable,keyboardShortcut:"meta+X"},{label:()=>ft("menu.copy"),id:"copy",submenu:[{label:()=>ft("menu.copy-as-latex"),id:"copy-latex",onMenuSelect:()=>ia.copyToClipboard(a,"latex"),keyboardShortcut:"meta+C"},{label:()=>ft("menu.copy-as-ascii-math"),id:"copy-ascii-math",onMenuSelect:()=>ia.copyToClipboard(a,"ascii-math")},{label:()=>ft("menu.copy-as-mathml"),id:"copy-math-ml",onMenuSelect:()=>ia.copyToClipboard(a,"math-ml")}]},{label:()=>ft("menu.paste"),id:"paste",onMenuSelect:()=>a.executeCommand("pasteFromClipboard"),visible:()=>a.hasEditableContent,keyboardShortcut:"meta+V"},{label:()=>ft("menu.select-all"),id:"select-all",keyboardShortcut:"meta+A",onMenuSelect:()=>a.executeCommand("selectAll")}]}function Vc(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 zd(a,y){Mf(a),a.flushInlineShortcutBuffer(),I0(a.model,y),Mo(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 Yh(a,y,b,E){return{label:()=>Yo(`\\${b}{${mo(a)}}`),tooltip:()=>{var ee;return(ee=ft(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 qh(a,y,b,E){return{label:()=>Yo(`\\${b}{${mo(a)}}`),tooltip:()=>{var ee;return(ee=ft(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 Ku(a,y){return a+Fu(y)}Ls({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(Ce){let $e=null;switch(Ce){case"all":$e=re.root;break;case"selection":$e=re.getAtoms(re.selection);break;case"left":{$e=re.getAtoms(re.offsetOf(re.at(re.position).leftSibling),re.position);break}case"right":{$e=re.getAtoms(re.position,re.offsetOf(re.at(re.position).rightSibling));break}case"group":$e=re.getAtoms(re.getSiblingsRange(re.position));break;case"parent":{const{parent:Ye}=re.at(re.position);Ye!=null&&Ye.parent?$e=Ye:$e=re.root;break}default:$e=re.root}return $e}function de(Ce){let $e="";switch(Ce){case"all":console.log("Internal failure: speak all failed");break;case"selection":$e="no selection";break;case"left":$e="at start";break;case"right":$e="at end";break;case"group":console.log("Internal failure: speak group failed");break;case"parent":$e="no parent";break;default:console.log('unknown speak_ param value: "'+Ce+'"');break}return $e}const ge=ae(y);if(ge===null)return(ee=(E=window.MathfieldElement).speakHook)==null||ee.call(E,de(y)),!1;(b.withHighlighting||window.MathfieldElement.speechEngine==="amazon")&&(window.MathfieldElement.textToSpeechMarkup=window.sre&&window.MathfieldElement.textToSpeechRules==="sre"?"ssml_step":"ssml");const be=Fu(ge);return dt()&&b.withHighlighting?(mc().readAloudMathfield=a,$c(a,{forHighlighting:!0}),window.MathfieldElement.readAloudHook&&window.MathfieldElement.readAloudHook(a.field,be)):window.MathfieldElement.speakHook&&window.MathfieldElement.speakHook(be),!1}function r1(a){var y,b;if(!dt()){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 de=new Uint8Array(ae.AudioStream),ge=new Blob([de.buffer],{type:"audio/mpeg"}),be=URL.createObjectURL(ge);new Audio(be).play().catch($e=>console.log($e))}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=Ku("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=Ku("",a.model.at(a.model.position));else if(y==="line"){const re=Ku("",a.model.root);a.keyboardDelegate.setAriaLabel(re)}else ee=E?Ku(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 Ku("",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+=Ku("",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=dc(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 Ce=re.ranges[0][0];if(!this.mathfield.dirty&&!((b=this.at(Ce))!=null&&b.parentPrompt)&&this.mathfield.hasEditablePrompts){if((E=this.at(Ce-1))!=null&&E.parentPrompt){this._anchor=this.normalizeOffset(Ce-1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}if((ee=this.at(Ce+1))!=null&&ee.parentPrompt){this._anchor=this.normalizeOffset(Ce+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=Ce,this._position=Ce,this._selection=re;return}const ae=Vo(re);re.direction==="backward"?[this._position,this._anchor]=ae:[this._anchor,this._position]=ae;const de=this.at(ae[0]+1),ge=this.at(ae[1]),be=Un.commonAncestor(de,ge);(be==null?void 0:be.type)==="array"&&de.parent===be&&ge.parent===be?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 ns&&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(wu(a)){if(E=y!=null?y:{},a.ranges.length>1)return a.ranges.reduce((be,Ce)=>[...be,...this.getAtoms(Ce,E)],[]);a=a.ranges[0]}let ee,re;if(gl(a)){if(ee=a,!gl(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,de=Math.max(ee,re);if(!E.includeChildren&&ae===1&&de===this.lastOffset)return[this.root];let ge=[];for(let be=ae;be<=de;be++){const Ce=this.atoms[be];mp(this,Ce,ae,de)&&ge.push(Ce)}return E.includeChildren||(ge=ge.filter(be=>{let Ce=!1,{parent:$e}=be;for(;$e&&!Ce;)Ce=mp(this,$e,ae,de),$e=$e.parent;return!Ce})),ge}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 Un({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 Un.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 Za(a);if(b==="spoken")return Fu(a);if(b==="spoken-text"){const E=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="";const ee=Fu(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=Fu(a);return window.MathfieldElement.textToSpeechMarkup=E,ee}return b==="ascii-math"?_o(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(gl(a)&&gl(y)?(E=[this.normalizeRange([a,y])],ee=b):xu(a)?(E=[this.normalizeRange(a)],ee=y):wu(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 ya(E.map(ae=>Un.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&&Jh(this,re,[E,ee]);)ee=this.offsetOf(re),re=re.parent;for(re=this.at(E).parent;re!==this.root&&Jh(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&&Jh(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 de=this.root.changeCounter!==ae,ge=E!==this._anchor||ee!==this._position||Pc(this._selection,b)==="different";return this.silenceNotifications=re,a.content&&de&&this.contentDidChange({inputType:a.type}),a.selection&&ge&&this.selectionDidChange(),de||ge}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(gl(a)){const ee=this.normalizeOffset(a);if(gl(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(xu(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 wu(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(Ml(this.mathfield)),this.silenceNotifications||!this.mathfield.host||!this.mathfield)return;const b=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.host.dispatchEvent(new InputEvent("input",me(Se({},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(Ml(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 Jh(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 Kd(a,y,b,E){var ee,re,ae,de,ge,be;const Ce=b.parent;if(Ce&&b instanceof Wa){const $e=!E&&y==="forward"||E==="body"&&y==="backward";let Ye=$e?a.offsetOf(b.firstChild):a.offsetOf(b.lastChild);return $e?b.rightDelim!=="?"&&b.rightDelim!=="."?(b.leftDelim=".",b.isDirty=!0):(Ce.addChildrenAfter(b.removeBranch("body"),b),Ce.removeChild(b),Ye--):b.leftDelim!=="?"&&b.leftDelim!=="."?(b.rightDelim=".",b.isDirty=!0):(Ce.addChildrenAfter(b.removeBranch("body"),b),Ce.removeChild(b),Ye--),a.position=Ye,!0}if(Ce&&b.type==="surd"){if(y==="forward"&&!E||y==="backward"&&E==="body"){const $e=b.leftSibling;b.hasChildren&&Ce.addChildrenAfter(b.removeBranch("body"),b),Ce.removeChild(b),a.position=a.offsetOf($e)}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),Ce.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(Ce&&(b.type==="box"||b.type==="enclose")){const $e=E&&y==="backward"||!E&&y==="forward"?b.leftSibling:b.lastChild;return Ce.addChildrenAfter(b.removeBranch("body"),b),Ce.removeChild(b),a.position=a.offsetOf($e),!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 $e=Hd.fractionNavigationOrder==="numerator-denominator"?"above":"below",Ye=$e==="above"?"below":"above";if(Ce&&(y==="forward"&&E===$e||y==="backward"&&E===Ye)){const gt=b.removeBranch($e),Et=b.removeBranch(Ye);return Ce.addChildrenAfter([...gt,...Et],b),Ce.removeChild(b),a.position=a.offsetOf(gt.length>0?gt[gt.length-1]:Et[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 $e=y==="forward"?(ae=(ee=b.superscript)==null?void 0:ee[0])!=null?ae:(re=b.subscript)==null?void 0:re[0]:(be=(de=b.subscript)==null?void 0:de[0].lastSibling)!=null?be:(ge=b.superscript)==null?void 0:ge[0].lastSibling;return $e&&(a.position=a.offsetOf($e)),!0}return!1}if(!b.hasChildren&&b.type==="subsup"){const $e=y==="forward"?a.offsetOf(b):Math.max(0,a.offsetOf(b)-1);return b.parent.removeChild(b),a.position=$e,!0}if(E==="superscript")if(y==="backward"){const $e=a.offsetOf(b.firstChild)-1;console.assert($e>=0),a.position=$e}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 $e=y==="forward"?a.offsetOf(b):Math.max(0,a.offsetOf(b)-1);b.parent.removeChild(b),a.position=$e}return!0}if((Ce==null?void 0:Ce.type)==="genfrac"&&!E&&b.type!=="first"){let $e=a.offsetOf(b.leftSibling);return Ce.removeChild(b),Ce.hasEmptyBranch("above")&&Ce.hasEmptyBranch("below")?($e=a.offsetOf(Ce.leftSibling),Ce.parent.removeChild(Ce),a.announce("delete",void 0,[Ce]),a.position=$e,!0):(a.announce("delete",void 0,[b]),a.position=$e,!0)}if(y==="backward"&&((Ce==null?void 0:Ce.command)==="\\ln"||(Ce==null?void 0:Ce.command)==="\\log")&&b.parentBranch!=="body"){const $e=a.offsetOf(Ce.leftSibling);return Ce.parent.removeChild(Ce),a.announce("delete",void 0,[Ce]),a.position=$e,!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&&Kd(a,"backward",y))){if(y!=null&&y.isFirstSibling){if(Kd(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])}}):kl(a,Vo(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&&Kd(a,"forward",E))return;if(E){if(a.at(a.position).isLastSibling&&Kd(a,"forward",E.parent,E.parentBranch))return}else{if(E=a.at(a.position),E.isLastSibling&&Kd(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])}):kl(a,Vo(a.selection),"deleteContentForward")}function kl(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 de=E[E.length-1];if(ae===ee&&de===re){const ge=E[0].parent;ge.parent&&ge.type!=="prompt"&&(y=[a.offsetOf(ge.leftSibling),a.offsetOf(ge)])}if(E.length===1&&E[0].type==="placeholder"&&E[0].parent.type==="genfrac"){const ge=E[0].parent,be=E[0].parentBranch==="below"?"above":"below",Ce=a.offsetOf(ge.leftSibling);return a.deferNotifications({content:!0,selection:!0,type:b},()=>{var $e,Ye;const gt=ge.removeBranch(be);if(gt.length===1&&gt[0].type==="placeholder")(Ye=ge.parent)==null||Ye.removeChild(ge),a.position=Math.max(0,Ce);else{const Et=ge.parent.addChildrenAfter(gt,ge);($e=ge.parent)==null||$e.removeChild(ge),a.position=a.offsetOf(Et)}})}}return a.deferNotifications({content:!0,selection:!0,type:b},()=>a.deleteAtoms(y))}Ls({deleteAll:a=>a.contentWillChange({inputType:"deleteContent"})&&kl(a,[0,-1],"deleteContent"),deleteForward:a=>c1(a),deleteBackward:a=>l1(a),deleteNextWord:a=>a.contentWillChange({inputType:"deleteWordForward"})&&kl(a,[a.anchor,_h(a,a.position,"forward")],"deleteWordForward"),deletePreviousWord:a=>a.contentWillChange({inputType:"deleteWordBackward"})&&kl(a,[a.anchor,_h(a,a.position,"backward")],"deleteWordBackward"),deleteToGroupStart:a=>a.contentWillChange({inputType:"deleteSoftLineBackward"})&&kl(a,[a.anchor,a.offsetOf(a.at(a.position).firstSibling)],"deleteSoftLineBackward"),deleteToGroupEnd:a=>a.contentWillChange({inputType:"deleteSoftLineForward"})&&kl(a,[a.anchor,a.offsetOf(a.at(a.position).lastSibling)],"deleteSoftLineForward"),deleteToMathFieldStart:a=>a.contentWillChange({inputType:"deleteHardLineBackward"})&&kl(a,[a.anchor,0],"deleteHardLineBackward"),deleteToMathFieldEnd:a=>a.contentWillChange({inputType:"deleteHardLineForward"})&&kl(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="${ft("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="${ft("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>`,f1=class{constructor(a,y){this.focusBlurInProgress=!1;var b,E,ee;this.options=Se(me(Se({},Bf()),{macros:Vn(),registers:oc()}),Of(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 de=A0(this.options),ge=new Un({type:"root",mode:de,body:Xo(ae,{context:this.context})});this.model=new s1(this,de,ge),this.undoManager=new Ng(this.model);const be=[];if(be.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>"),be.push('<span part=container class=ML__container aria-hidden=true style="visibility:hidden">'),be.push("<span part=content class=ML__content>"),be.push(w0(this)),be.push("</span>"),window.mathVirtualKeyboard&&(be.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">`),be.push(u1),be.push("</div>")),be.push('<div part=menu-toggle class=ML__menu-toggle role=button data-l10n-tooltip="tooltip.menu">'),be.push(d1),be.push("</div>"),be.push("</span>"),be.push("<span class=ML__sr-only>"),be.push("<span role=status aria-live=assertive aria-atomic=true></span>"),be.push("</span>"),this.element.innerHTML=window.MathfieldElement.createHTML(be.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=rt.subscribe(()=>rt.update(this.element)),rt.update(this.element),this.field=this.element.querySelector("[part=content]"),this.field.addEventListener("click",$e=>$e.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(Ml(this)))},{signal:re}),this._menu=new Sv(Jv(this),{host:this.host}),this.field.addEventListener("contextmenu",this,{signal:re});const Ce=this.element.querySelector("[part=menu-toggle]");Ce==null||Ce.addEventListener("pointerdown",$e=>{if($e.currentTarget!==Ce||this._menu.state!=="closed")return;this.element.classList.add("tracking");const Ye=Ce.getBoundingClientRect();this._menu.modifiers=Nc($e),this._menu.show({target:Ce,location:{x:Ye.left,y:Ye.bottom},onDismiss:()=>this.element.classList.remove("tracking")}),$e.preventDefault(),$e.stopPropagation()},{signal:re}),(this.model.atoms.length<=1||this.disabled||this.readOnly&&!this.hasEditableContent||this.userSelect==="none")&&(Ce.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(()=>Mo(this)),this.resizeObserver.observe(this.field),window.mathVirtualKeyboard.addEventListener("virtual-keyboard-toggle",this,{signal:re}),kd&&!rt.locale.startsWith(kd.locale)&&$m(rt.locale),$s!=="ready"&&document.fonts.ready.then(()=>Af(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(Ml(this)),Vf(this))}disconnectFromVirtualKeyboard(){this.connectedToVirtualKeyboard&&(window.removeEventListener("message",this),window.mathVirtualKeyboard.disconnect(),this.connectedToVirtualKeyboard=!1,$h())}showMenu(a){var y,b;const E=(b=(y=a==null?void 0:a.location)!=null?y:bl(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:qe(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=Un.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=Se({},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=Ph(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 ge of Object.keys(y)){const be=this.queryStyle({[ge]:y[ge]});if(be==="none")return"none";if(be==="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 de=0;for(const ge of re){if(ge.type==="first"){ae-=1;continue}ge.style[E]===ee&&(de+=1)}return de===0?"none":de===ae?"all":"some"}get keybindings(){var a,y;if(this._keybindings)return this._keybindings;const[b,E]=Vm(this.options.keybindings,(a=_d())!=null?a:Fm());return((y=_d())==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=Se(Se({},this.options),Of(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=Un.serialize([this.model.root],{expandMacro:!1,defaultMode:this.options.defaultMode});("macros"in a||this.model.getValue()!==E)&&ia.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)&&Mo(this)}getOptions(a){return zc(this.options,a)}getOption(a){return zc(this.options,a)}handleEvent(a){return gc(this,null,function*(){var y;if(Bs(this)){if(Ch(a)){if(!yd(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))&&Wf.stop());break;case"contextmenu":this.userSelect!=="none"&&a.shiftKey===!1&&(yield ip(a,this.element.querySelector("[part=container]"),this._menu))&&Wf.stop();break;case"virtual-keyboard-toggle":this.hasFocus()&&Vf(this);break;case"resize":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>Bs(this)&&this.onGeometryChange());break;case"scroll":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>Bs(this)&&this.onGeometryChange());break;case"wheel":this.onWheel(a);break;default:console.warn("Unexpected event type",a.type)}}})}dispose(){if(!Bs(this))return;rt.unsubscribe(this._l10Subscription),this.keyboardDelegate.dispose(),this.keyboardDelegate=void 0,this.eventController.abort(),this.eventController=void 0,this.resizeObserver.disconnect(),window.mathVirtualKeyboard.removeEventListener("virtual-keyboard-toggle",this),this.disconnectFromVirtualKeyboard(),this.model.dispose();const a=this.element;delete a.mathfield,this.element=void 0,this.host=void 0,this.field=void 0,this.ariaLiveText=void 0,Gg(),Qm(),mv()}flushInlineShortcutBuffer(a){if(a!=null||(a={defer:!1}),!a.defer){this.inlineShortcutBuffer=[],clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=0;return}this.options.inlineShortcutTimeout>0&&(clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=setTimeout(()=>this.flushInlineShortcutBuffer(),this.options.inlineShortcutTimeout))}executeCommand(a){return Du(a)==="virtual-keyboard"?(this.focus({preventScroll:!0}),window.mathVirtualKeyboard.executeCommand(a),requestAnimationFrame(()=>window.mathVirtualKeyboard.update(Ml(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=ah(this.model,this.model.position))!=null?b:"math");const E=this.undoManager.canUndo();ia.insert(this.model,a,y)&&(Mo(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&&$c(this,{interactive:!0});const y=this.field.getBoundingClientRect();let b=null;if(this.model.selectionIsCollapsed)b=bl(this.field);else{const E=vd(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&&Ge()&&navigator.vibrate(S0),window.MathfieldElement.playSound("keypress")),a==="\\\\"?T0(this.model):a==="&"?D0(this.model):this.model.selectionIsCollapsed?ia.insert(this.model,a,Se({style:this.model.at(this.model.position).computedStyle},y)):ia.insert(this.model,a,y),this.snapshot(`insert-${this.model.at(this.model.position).type}`),Mo(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 de=!1;if(this.flushInlineShortcutBuffer(),this.stopCoalescingUndo(),y&&a!=="latex"){const ge=Xo(y,{context:this.context,parseMode:a});ae.collapseSelection("forward");const be=ae.at(ae.position);ae.position=ae.offsetOf(be.parent.addChildrenAfter(ge,be)),de=!0}if(this.model.mode=a,a==="latex"){let ge=ae.selectionIsCollapsed;Au(this,"accept");let be,Ce=ae.at(ae.position);if(ge)be="\\";else{const Ye=Vo(ae.selection);be=this.model.getValue(Ye,"latex");const gt=this.model.extractAtoms(Ye);gt.length===1&&gt[0].type==="placeholder"&&(be=y,ge=!0),Ce=ae.at(Ye[0])}const $e=new xd(be);Ce.parent.addChildAfter($e,Ce),ge?ae.position=ae.offsetOf($e.lastChild):ae.setSelection(ae.offsetOf($e.firstChild),ae.offsetOf($e.lastChild))}else Ld(ae).forEach(ge=>{ge.isError=!1});if(b){const ge=Xo(b,{context:this.context,parseMode:re});ae.collapseSelection("forward");const be=ae.at(ae.position);ae.position=ae.offsetOf(be.parent.addChildrenAfter(ge,be)),de=!0}return Mo(this),this.undoManager.snapshot(a==="latex"?"insert-latex":"insert"),de}),this.model.mode=a,window.mathVirtualKeyboard.update(Ml(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};xu(y)?ee.range=y:(y.operation==="toggle"&&(ee.operation="toggle"),ee.range=y.range,ee.silenceNotifications=(b=y.silenceNotifications)!=null?b:!1);const re=Ph(this,a),ae=(E=ee.operation)!=null?E:"set";if(ee.range===void 0&&this.model.selectionIsCollapsed){if(ae==="set"){this.defaultStyle=Se(Se({},this.defaultStyle),re);return}const de=Se({},this.defaultStyle);for(const ge of Object.keys(re))de[ge]===re[ge]?(ge==="color"&&delete de.verbatimColor,ge==="backgroundColor"&&delete de.verbatimBackgroundColor,delete de[ge]):de[ge]=re[ge];this.defaultStyle=de;return}this.model.deferNotifications({content:!ee.silenceNotifications,type:"insertText"},()=>{if(ee.range===void 0)for(const de of this.model.selection.ranges)Eh(this.model,de,re,{operation:ae});else Eh(this.model,ee.range,re,{operation:ae})}),Mo(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=bl(this.field);return a?{x:a.x,y:a.y}:null}setCaretPoint(a,y){const b=Rd(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),Mo(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,me(Se({},b),{insertionMode:"replaceSelection"}))}b!=null&&b.silenceNotifications&&(this.valueOnFocus=this.getValue()),Mo(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),Mo(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(Ml(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(Ml(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(Ml(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"?(Au(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(Ml(this)),Vf(this)}onContentWillChange(a){var y,b,E;return(E=(b=this.host)==null?void 0:b.dispatchEvent(new InputEvent("beforeinput",me(Se({},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(),$c(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="",Tu(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})),Mo(this),this.focusBlurInProgress=!1,$h();const E=new AbortController,ee=E.signal;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&document.addEventListener("visibilitychange",()=>{Bs(this)&&document.visibilityState==="visible"&&this.focus({preventScroll:!0})},{once:!0,signal:ee})},{once:!0,signal:ee}),setTimeout(()=>E.abort(),100)}onInput(a){Th(this,a)}onKeystroke(a){return K0(this,a)}onCompositionStart(a){this.model.deleteAtoms(Vo(this.model.selection));const y=bl(this.field);y&&requestAnimationFrame(()=>{$c(this),this.keyboardDelegate.moveTo(y.x,y.y-y.height)})}onCompositionUpdate(a){Lg(this.model,a),Mo(this)}onCompositionEnd(a){Ag(this.model),Th(this,a,{simulateKeystroke:!0})}onCut(a){if(!this.isSelectionEditable){this.model.announce("plonk");return}this.model.contentWillChange({inputType:"deleteByCut"})&&(this.stopCoalescingUndo(),ia.onCopy(this,a),kl(this.model,Vo(this.model.selection),"deleteByCut"),this.snapshot("cut"),Mo(this))}onCopy(a){ia.onCopy(this,a)}onPaste(a){let y=this.isSelectionEditable;return y&&(y=ia.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(),kf(this),Vf(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=>In(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 Qh(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&&Qh(E)})):(a.classList.remove("ML__highlight"),a.children&&a.children.length>0&&[...a.children].forEach(E=>{E instanceof HTMLElement&&Qh(E,y)})))}function h1(a,y){var b;if(!dt())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"]};mc().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 de=new TextDecoder("utf-8").decode(new Uint8Array(ae.AudioStream));mc().readAloudMarks=de.split(`
`).map(ge=>ge?JSON.parse(ge):{}),mc().readAloudTokens=[];for(const ge of mc().readAloudMarks)ge.value&&mc().readAloudTokens.push(ge.value);mc().readAloudCurrentMark="",ee.OutputFormat="mp3",ee.SpeechMarkTypes=[],E.synthesizeSpeech(ee,(ge,be)=>{if(ge){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech("${y}") error:${ge}`);return}if(!(be!=null&&be.AudioStream))return;const Ce=new Uint8Array(be.AudioStream),$e=new Blob([Ce.buffer],{type:"audio/mpeg"}),Ye=URL.createObjectURL($e),gt=mc();gt.readAloudAudio?gt.readAloudAudio.pause():(gt.readAloudAudio=new Audio,gt.readAloudAudio.addEventListener("ended",()=>{const Et=gt.readAloudMathfield;gt.readAloudStatus="ended",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),Et?($c(Et),gt.readAloudElement=null,gt.readAloudMathfield=null,gt.readAloudTokens=[],gt.readAloudMarks=[],gt.readAloudCurrentMark=""):gp(gt.readAloudElement)}),gt.readAloudAudio.addEventListener("timeupdate",()=>{let Et="";const _n=gt.readAloudAudio.currentTime*1e3+100;for(const kr of gt.readAloudMarks)kr.time<_n&&(Et=kr.value);gt.readAloudCurrentMark!==Et&&(gt.readAloudCurrentToken=Et,Et&&Et===gt.readAloudFinalToken?gt.readAloudAudio.pause():(gt.readAloudCurrentMark=Et,Qh(gt.readAloudElement,gt.readAloudCurrentMark)))})),gt.readAloudAudio.src=Ye,gt.readAloudStatus="playing",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),gt.readAloudAudio.play()})})}dt()||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 Ra=new WeakMap,p1=.5,pc={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 = ..."},rs=class Gc extends HTMLElement{static get formAssociated(){return Hu()}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 rt.locale}static set locale(y){y==="auto"&&(y=navigator.language.slice(0,5)),rt.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 rt.strings}static set strings(y){rt.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 gc(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 gc(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(pc[E])if(pc[E].startsWith("mf."))if(pc[E].startsWith(`mf.${E}`))b.push(`Option \`${E}\` cannot be used as a constructor option. Use ${pc[E]}`);else{const ee=pc[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 ${pc[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(Hu()&&(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=[uc("core"),uc("mathfield"),uc("mathfield-element"),uc("ui"),uc("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=Gc.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?zc(this._mathfield.options,y):Ra.has(this)?Se({},zc(Se(Se({},Bf()),Of(Ra.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?zc(this._mathfield.options,y):Ra.has(this)?zc(Se(Se({},Bf()),Of(Ra.get(this).options)),y):null}reflectAttributes(){const y=Bf(),b=this._getOptions();Object.keys(Gc.optionsAttributes).forEach(E=>{const ee=jl(E);Gc.optionsAttributes[E]==="on/off"?y[ee]!==b[ee]?this.setAttribute(E,b[ee]?"on":"off"):this.removeAttribute(E):y[ee]!==b[ee]&&(Gc.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(Ra.has(this)){const b=Se(Se({},Ra.get(this).options),y);Ra.set(this,me(Se({},Ra.get(this)),{selection:{ranges:b.readOnly?[[0,0]]:[[0,-1]]},options:b}))}else Ra.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))pc[b]&&console.warn(`\`mf.setOptions({${b}:...})\` -> ${pc[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(Ra.has(this)){let ae,de,ge;if(wu(y)?([ae,de]=y.ranges[0],ge=b):xu(y)?([ae,de]=y,ge=b):gl(y)&&gl(b)?(ae=y,de=b,ge=E):(ae=0,de=-1,ge=y),(ge===void 0||ge==="latex")&&ae===0&&de===-1)return(re=(ee=Ra.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(Ra.has(this)){const ee=Ra.get(this).options;Ra.set(this,{value:y,selection:{ranges:[[-1,-1]],direction:"forward"},options:ee,menuItems:void 0});return}const E=Wd(this);Ra.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?Rd(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=lc(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;wl.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,de=re.userSelect!=="none";if(de)ae.host.addEventListener("pointerdown",this,!0);else{const Ce=ae.querySelector("span");Ce.style.pointerEvents="none"}ae.host.addEventListener("focus",this,!0),ae.host.addEventListener("blur",this,!0),Hu()||(this.hasAttribute("role")||this.setAttribute("role","math"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","math input field"),this.setAttribute("aria-multiline","false")),de&&!this.hasAttribute("contenteditable")&&this.setAttribute("contenteditable","true"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");const ge=ae.querySelector("slot:not([name])");if(ge)try{this._style=ge.assignedElements().filter(Ce=>Ce.tagName.toLowerCase()==="style").map(Ce=>Ce.textContent).join("")}catch(Ce){console.error(Ce)}if(this._style){const Ce=document.createElement("style");Ce.textContent=this._style,ae.appendChild(Ce)}let be="";if(this.hasAttribute("value")?be=this.getAttribute("value"):be=(y=ge==null?void 0:ge.assignedNodes().map(Ce=>Ce.nodeType===3?Ce.textContent:"").join("").trim())!=null?y:"",this._mathfield=new f1(ae.querySelector(":host > span"),me(Se({},(E=(b=Ra.get(this))==null?void 0:b.options)!=null?E:Wd(this)),{eventSink:this,value:be})),!Ra.has(this)){this.upgradeProperty("disabled"),this.upgradeProperty("readonly");for(const Ce of Object.keys(Gc.optionsAttributes))this.upgradeProperty(jl(Ce))}if(!((ee=this._mathfield)!=null&&ee.model)){this._mathfield=null;return}if(Ra.has(this)){const Ce=this._mathfield,$e=Ra.get(this),Ye=$e.menuItems;Ce.model.deferNotifications({content:!1,selection:!1},()=>{const gt=$e.value;gt!==void 0&&Ce.setValue(gt),Ce.model.selection=$e.selection,Ra.delete(this)}),Ye&&(this.menuItems=Ye)}window.queueMicrotask(()=>{this.isConnected&&this.dispatchEvent(new Event("mount",{cancelable:!1,bubbles:!0,composed:!0}))}),Lf()}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=zc(this._mathfield.options,Object.keys(Gc.optionsAttributes).map(ee=>jl(ee)));Ra.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":Mo(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",""),Hu()?this._internals.ariaReadOnly="true":this.setAttribute("aria-readonly","true"),this.setAttribute("aria-readonly","true")):(Hu()?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"),Hu()?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:me(Se({},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=Ra.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}Ra.has(this)?Ra.set(this,me(Se({},Ra.get(this)),{menuItems:y})):Ra.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:Wd(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:Ra.has(this)?Ra.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,Mo(this._mathfield);return}if(Ra.has(this)){Ra.set(this,me(Se({},Ra.get(this)),{selection:y}));return}Ra.set(this,{value:void 0,selection:y,options:Wd(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:Ra.has(this)?Ra.get(this).selection.ranges[0][0]:0}set position(y){if(this._mathfield&&(this._mathfield.model.position=y,Mo(this._mathfield)),Ra.has(this)){Ra.set(this,me(Se({},Ra.get(this)),{selection:{ranges:[[y,y]]}}));return}Ra.set(this,{value:void 0,selection:{ranges:[[y,y]]},options:Wd(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}};rs.version="0.98.5",rs._fontsDirectory="./fonts",rs._soundsDirectory="./sounds",rs.keypressVibration=!0,rs._keypressSound={spacebar:"keypress-spacebar.wav",return:"keypress-return.wav",delete:"keypress-delete.wav",default:"keypress-standard.wav"},rs._plonkSound="plonk.wav",rs.audioBuffers={},rs.createHTML=a=>a,rs._speechEngineRate="100%",rs._speechEngineVoice="Joanna",rs._textToSpeechMarkup="",rs._textToSpeechRules="mathlive",rs._textToSpeechRulesOptions={},rs.speakHook=r1,rs.readAloudHook=h1,rs._decimalSeparator=".",rs.fractionNavigationOrder="numerator-denominator",rs._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 Hd=rs;function jl(a){return a.replace(/[^a-zA-Z\d]+(.)/g,(y,b)=>b.toUpperCase())}function Wd(a){const y={readOnly:!1},b=Hd.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[jl(E)]=!0:b[E]==="on/off"?ee==="on"?y[jl(E)]=!0:ee==="off"?y[jl(E)]=!1:y[jl(E)]=void 0:b[E]==="number"?y[jl(E)]=Number.parseFloat(ee!=null?ee:"0"):y[jl(E)]=ee}}),y}function Hu(){return!(!("ElementInternals"in window)||!HTMLElement.prototype.attachInternals||!("role"in window.ElementInternals.prototype))}var vp=Hd,yp,bp,xp,wp;if(dt()&&!((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=Hd,(wp=window.customElements)==null||wp.define("math-field",Hd)}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 Jf(a,y,b,E,ee="latex"){const re=[];for(const ae of a)if(ae.type==="text"){const de=ae.data;let ge=!0,be=0,Ce;Ce=de.indexOf(y),Ce!==-1&&(be=Ce,be>0&&re.push({type:"text",data:de.slice(0,be)}),ge=!1);let $e=!1;for(;!$e;){if(ge){if(Ce=de.indexOf(y,be),Ce===-1){$e=!0;break}be!==Ce&&re.push({type:"text",data:de.slice(be,Ce)}),be=Ce}else{if(Ce=m1(b,de,be+y.length),Ce===-1){$e=!0;break}let Ye=de.slice(be+y.length,Ce);ee==="ascii-math"&&([,Ye]=Oc(Ye,{format:"ascii-math"})),re.push({type:"math",data:Ye,rawData:de.slice(be,Ce+b.length),mathstyle:E}),be=Ce+b.length}ge=!ge}be<de.length&&re.push({type:"text",data:de.slice(be)})}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=Jf(E,ee,re,"textstyle")}),y!=null&&y.display&&y.display.forEach(([ee,re])=>{E=Jf(E,ee,re,"displaystyle")}),b!=null&&b.inline&&b.inline.forEach(([ee,re])=>{E=Jf(E,ee,re,"textstyle","ascii-math")}),b!=null&&b.display&&b.display.forEach(([ee,re])=>{E=Jf(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 Wu(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 de=document.createElement("span");if(/\bmathml\b/i.test(ae)&&b.renderToMathML&&de.append(g1(a,b)),/\bspeakable-text\b/i.test(ae)&&b.renderToSpeakableText){const ge=document.createElement("span");ge.setAttribute("translate","no");const be=b.renderToSpeakableText(a);ge.innerHTML=window.MathfieldElement.createHTML(be),ge.className="ML__sr-only",de.append(ge)}return de.append(re),de}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=Wu(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 de of ae)if(de.type==="text")re.appendChild(document.createTextNode(de.data));else{const ge=Wu(de.data,de.mathstyle==="textstyle"?"textstyle":"displaystyle",y,!0);ge&&re.appendChild(ge)}}return re}function Cp(a,y){var b,E,ee,re,ae,de,ge,be,Ce,$e,Ye,gt,Et,_n,kr,wn;if(a.childNodes.length===1&&a.childNodes[0].nodeType===3){const rr=(b=a.childNodes[0].textContent)!=null?b:"";if((E=y.TeX)!=null&&E.processEnvironments&&/^\s*\\begin/.test(rr)){a.textContent="";const dr=Wu(rr,"",y,!0);dr&&a.append(dr);return}const Ir=Sp(rr,(ee=y.TeX)==null?void 0:ee.delimiters,(re=y.asciiMath)==null?void 0:re.delimiters);if(Ir.length===1&&Ir[0].type==="math"){a.textContent="";const dr=Wu(Ir[0].data,Ir[0].mathstyle==="textstyle"?"textstyle":"displaystyle",y,!0);dr&&a.append(dr);return}if(Ir.length===1&&Ir[0].type==="text")return}for(let rr=a.childNodes.length-1;rr>=0;rr--){const Ir=a.childNodes[rr];if(Ir.nodeType===3){const dr=y1((ae=Ir.textContent)!=null?ae:"",y);dr&&(rr+=dr.childNodes.length-1,Ir.replaceWith(dr))}else if(Ir.nodeType===1){const dr=Ir,ci=Ir.nodeName.toLowerCase();if(ci==="script"){const Ii=Ir;let bi;if((de=y.processScriptTypePattern)!=null&&de.test(Ii.type))bi=(ge=Ii.textContent)!=null?ge:"";else if((be=y.processMathJSONScriptTypePattern)!=null&&be.test(Ii.type))try{bi=($e=y.serializeToLatex)==null?void 0:$e.call(y,JSON.parse((Ce=Ii.textContent)!=null?Ce:""))}catch(Pa){console.error(Pa)}if(bi){let Pa="textstyle";for(const zr of Ii.type.split(";")){const[Fs,_l]=zr.toLowerCase().split("=");Fs.trim()==="mode"&&(Pa=_l.trim()==="display"?"displaystyle":"textstyle")}const qa=Wu(bi,Pa,y,!0);qa&&Ii.parentNode.replaceChild(qa,Ii)}}else if(((gt=(Ye=y.processClassPattern)==null?void 0:Ye.test(dr.className))!=null?gt:!1)||!((_n=(Et=y.skipTags)==null?void 0:Et.includes(ci))!=null&&_n||(wn=(kr=y.ignoreClassPattern)==null?void 0:kr.test(dr.className))!=null&&wn))if(a.childNodes.length===1&&a.childNodes[0].nodeType===3){const bi=a.textContent;a.textContent="";const Pa=Wu(bi!=null?bi:"","displaystyle",y,!0);Pa&&a.append(Pa)}else Cp(dr,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=Se(Se({},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:""),Lf(),_s("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=fc.singleton;return b?(b.show(),Dd(),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}Ls({switchKeyboardLayer:w1,toggleVirtualKeyboard:S1,hideVirtualKeyboard:()=>(window.mathVirtualKeyboard.hide({animate:!0}),!1),showVirtualKeyboard:()=>(window.mathVirtualKeyboard.show({animate:!0}),!1)},{target:"virtual-keyboard"});function mc(){var a,y;return(y=globalThis[a=Symbol.for("io.cortexjs.mathlive")])!=null||(globalThis[a]={}),globalThis[Symbol.for("io.cortexjs.mathlive")]}function T1(){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 D1(a){M1(document.body,a)}function C1(a){if(typeof a=="string"){const y=document.getElementById(a);if(y===null)throw new Error(`The element with ID "${a}" could not be found.`);return y}return typeof a=="string"?null:a}function M1(a,y){var b,E,ee,re;const ae=C1(a);if(!ae)return;const de=y!=null?y:{};(b=de.renderToMarkup)!=null||(de.renderToMarkup=Yo),(E=de.renderToMathML)!=null||(de.renderToMathML=Rv),(ee=de.renderToSpeakableText)!=null||(de.renderToSpeakableText=Nv),(re=de.serializeToLatex)!=null||(de.serializeToLatex=$v),x1(ae,de)}var I1={mathlive:"0.98.5"}},17423:function(Sn,Wt,se){"use strict";se.d(Wt,{Z:function(){return Se}});const he=me=>typeof me=="object"&&me!=null&&me.nodeType===1,He=(me,Ee)=>(!Ee||me!=="hidden")&&me!=="visible"&&me!=="clip",Re=(me,Ee)=>{if(me.clientHeight<me.scrollHeight||me.clientWidth<me.scrollWidth){const tt=getComputedStyle(me,null);return He(tt.overflowY,Ee)||He(tt.overflowX,Ee)||(Be=>{const St=(dt=>{if(!dt.ownerDocument||!dt.ownerDocument.defaultView)return null;try{return dt.ownerDocument.defaultView.frameElement}catch(it){return null}})(Be);return!!St&&(St.clientHeight<Be.scrollHeight||St.clientWidth<Be.scrollWidth)})(me)}return!1},Ve=(me,Ee,tt,Be,St,dt,it,Ge)=>dt<me&&it>Ee||dt>me&&it<Ee?0:dt<=me&&Ge<=tt||it>=Ee&&Ge>=tt?dt-me-Be:it>Ee&&Ge<tt||dt<me&&Ge>tt?it-Ee+St:0,ve=me=>{const Ee=me.parentElement;return Ee==null?me.getRootNode().host||null:Ee},_e=(me,Ee)=>{var tt,Be,St,dt;if(typeof document=="undefined")return[];const{scrollMode:it,block:Ge,inline:De,boundary:At,skipOverflowHiddenElements:Xt}=Ee,rt=typeof At=="function"?At:yn=>yn!==At;if(!he(me))throw new TypeError("Invalid target");const ft=document.scrollingElement||document.documentElement,Ie=[];let xe=me;for(;he(xe)&&rt(xe);){if(xe=ve(xe),xe===ft){Ie.push(xe);break}xe!=null&&xe===document.body&&Re(xe)&&!Re(document.documentElement)||xe!=null&&Re(xe,Xt)&&Ie.push(xe)}const Ue=(Be=(tt=window.visualViewport)==null?void 0:tt.width)!=null?Be:innerWidth,je=(dt=(St=window.visualViewport)==null?void 0:St.height)!=null?dt:innerHeight,{scrollX:_t,scrollY:Ct}=window,{height:Dt,width:qe,top:Rt,right:Pt,bottom:En,left:tn}=me.getBoundingClientRect(),{top:$n,right:ur,bottom:wr,left:Je}=(yn=>{const ot=window.getComputedStyle(yn);return{top:parseFloat(ot.scrollMarginTop)||0,right:parseFloat(ot.scrollMarginRight)||0,bottom:parseFloat(ot.scrollMarginBottom)||0,left:parseFloat(ot.scrollMarginLeft)||0}})(me);let Ae=Ge==="start"||Ge==="nearest"?Rt-$n:Ge==="end"?En+wr:Rt+Dt/2-$n+wr,Ht=De==="center"?tn+qe/2-Je+ur:De==="end"?Pt+ur:tn-Je;const Rn=[];for(let yn=0;yn<Ie.length;yn++){const ot=Ie[yn],{height:nt,width:Tt,top:rn,right:dn,bottom:Ut,left:Kt}=ot.getBoundingClientRect();if(it==="if-needed"&&Rt>=0&&tn>=0&&En<=je&&Pt<=Ue&&Rt>=rn&&En<=Ut&&tn>=Kt&&Pt<=dn)return Rn;const bn=getComputedStyle(ot),nn=parseInt(bn.borderLeftWidth,10),we=parseInt(bn.borderTopWidth,10),ue=parseInt(bn.borderRightWidth,10),oe=parseInt(bn.borderBottomWidth,10);let pe=0,fe=0;const le="offsetWidth"in ot?ot.offsetWidth-ot.clientWidth-nn-ue:0,Pe="offsetHeight"in ot?ot.offsetHeight-ot.clientHeight-we-oe:0,Qe="offsetWidth"in ot?ot.offsetWidth===0?0:Tt/ot.offsetWidth:0,It="offsetHeight"in ot?ot.offsetHeight===0?0:nt/ot.offsetHeight:0;if(ft===ot)pe=Ge==="start"?Ae:Ge==="end"?Ae-je:Ge==="nearest"?Ve(Ct,Ct+je,je,we,oe,Ct+Ae,Ct+Ae+Dt,Dt):Ae-je/2,fe=De==="start"?Ht:De==="center"?Ht-Ue/2:De==="end"?Ht-Ue:Ve(_t,_t+Ue,Ue,nn,ue,_t+Ht,_t+Ht+qe,qe),pe=Math.max(0,pe+Ct),fe=Math.max(0,fe+_t);else{pe=Ge==="start"?Ae-rn-we:Ge==="end"?Ae-Ut+oe+Pe:Ge==="nearest"?Ve(rn,Ut,nt,we,oe+Pe,Ae,Ae+Dt,Dt):Ae-(rn+nt/2)+Pe/2,fe=De==="start"?Ht-Kt-nn:De==="center"?Ht-(Kt+Tt/2)+le/2:De==="end"?Ht-dn+ue+le:Ve(Kt,dn,Tt,nn,ue+le,Ht,Ht+qe,qe);const{scrollLeft:Nt,scrollTop:qt}=ot;pe=It===0?0:Math.max(0,Math.min(qt+pe/It,ot.scrollHeight-nt/It+Pe)),fe=Qe===0?0:Math.max(0,Math.min(Nt+fe/Qe,ot.scrollWidth-Tt/Qe+le)),Ae+=qt-pe,Ht+=Nt-fe}Rn.push({el:ot,top:pe,left:fe})}return Rn},ke=me=>me===!1?{block:"end",inline:"nearest"}:(Ee=>Ee===Object(Ee)&&Object.keys(Ee).length!==0)(me)?me:{block:"start",inline:"nearest"};function Se(me,Ee){if(!me.isConnected||!(St=>{let dt=St;for(;dt&&dt.parentNode;){if(dt.parentNode===document)return!0;dt=dt.parentNode instanceof ShadowRoot?dt.parentNode.host:dt.parentNode}return!1})(me))return;const tt=(St=>{const dt=window.getComputedStyle(St);return{top:parseFloat(dt.scrollMarginTop)||0,right:parseFloat(dt.scrollMarginRight)||0,bottom:parseFloat(dt.scrollMarginBottom)||0,left:parseFloat(dt.scrollMarginLeft)||0}})(me);if((St=>typeof St=="object"&&typeof St.behavior=="function")(Ee))return Ee.behavior(_e(me,Ee));const Be=typeof Ee=="boolean"||Ee==null?void 0:Ee.behavior;for(const{el:St,top:dt,left:it}of _e(me,ke(Ee))){const Ge=dt-tt.top+tt.bottom,De=it-tt.left+tt.right;St.scroll({top:Ge,left:De,behavior:Be})}}}}]);
}());