Object.defineProperty(e,"__esModule",{value:!0}),e.mhchemParser=void0;varo=function(){functiont(){}returnt.toTex=function(t,e){returnr.go(a.go(t,e),"tex"!==e)},t}();functionn(t){vare,o,n={};for(eint)for(oint[e]){vara=o.split("|");t[e][o].stateArray=a;for(varr=0;r<a.length;r++)n[a[r]]=[]}for(eint)for(oint[e])for(a=t[e][o].stateArray||[],r=0;r<a.length;r++){vari=t[e][o];i.action_=[].concat(i.action_);for(varp=0;p<i.action_.length;p++)"string"==typeofi.action_[p]&&(i.action_[p]={type_:i.action_[p]});for(varc=e.split("|"),u=0;u<c.length;u++)if("*"===a[r]){vars=void0;for(sinn)n[s].push({pattern:c[u],task:i})}elsen[a[r]].push({pattern:c[u],task:i})}returnn}e.mhchemParser=o;vara={go:function(t,e){if(!t)return[];void0===e&&(e="ce");varo,n="0",r={};r.parenthesisLevel=0,t=(t=(t=t.replace(/\n/g," ")).replace(/[\u2212\u2013\u2014\u2010]/g,"-")).replace(/[\u2026]/g,"...");for(vari=10,p=[];;){o!==t?(i=10,o=t):i--;varc=a.stateMachines[e],u=c.transitions[n]||c.transitions["*"];t:for(vars=0;s<u.length;s++){var_=a.patterns.match_(u[s].pattern,t);if(_){for(vard=u[s].task,m=0;m<d.action_.length;m++){varh=void0;if(c.actions[d.action_[m].type_])h=c.actions[d.action_[m].type_](r,_.match_,d.action_[m].option);else{if(!a.actions[d.action_[m].type_])throw["MhchemBugA","mhchem bug A. Please report. ("+d.action_[m].type_+")"];h=a.actions[d.action_[m].type_](r,_.match_,d.action_[m].option)}a.concatArray(p,h)}if(n=d.nextState||n,!(t.length>0))returnp;if(d.revisit||(t=_.remainder),!d.toContinue)breakt}}if(i<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(t,e){if(e)if(Array.isArray(e))for(varo=0;o<e.length;o++)t.push(e[o]);elset.push(e)},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(t){vare=t.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]+\}))?/);returne&&e[0]?{match_:e.slice(1),remainder:t.substr(e[0].length)}:null},"(-)(9)^(-9)":/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/,"state of aggregation $":function(t){vare=a.patterns.findObserveGroups(t,"",/^\([a-z]{1,3}(?=[\),])/,")","");if(e&&e.remainder.match(/^($|[\s,;\)\]\}])/))returne;varo=t.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);returno?{match_:o[0],remainder:t.substr(o[0].length)}:null},"_{(state of aggregation)}$":/^_\{(\([a-z]{1,3}\))\}/,"{[(":/^(?:\\\{|\[|\()/,")]}":/^(?:\)|\]|\\\})/,", ":/^[,;]\s*/,",":/^[,;]/,".":/^[.]/,". __* ":/^([.\u22C5\u00B7\u2022]|[*])\s*/,"...":/^\.\.\.(?=$|[^.])/,"^{(...)}":function(t){returna.patterns.findObserveGroups(t,"^{","","","}")},"^($...$)":function(t){returna.patterns.findObserveGroups(t,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(t){returna.patterns.findObserveGroups(t,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(t){returna.patterns.f