aboutsummaryrefslogtreecommitdiff
path: root/utility/katex/katex.min.js
blob: d574cc3fd73abeed67833976d5c791ac8c400b1d (plain)
1
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.katex=t():e.katex=t()}(this,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=79)}([function(e,t,r){"use strict";var n=r(31),a=r.n(n),i=r(70),o=r.n(i),s=r(13),l=r(36),u=r(28),c=r(8),h=r(141),p=r(21),m=["\\imath","\u0131","\\jmath","\u0237","\\pounds","\\mathsterling","\\textsterling","\xa3"],f=function(e,t,r){return u.a[r][e]&&u.a[r][e].replace&&(e=u.a[r][e].replace),{value:e,metrics:l.a.getCharacterMetrics(e,t,r)}},d=function(e,t,r,n,a){var i=f(e,t,r),o=i.metrics;e=i.value;var l=void 0;if(o){var u=o.italic;"text"===r&&(u=0),l=new s.a.symbolNode(e,o.height,o.depth,u,o.skew,o.width,a)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+e+"' in style '"+t+"'"),l=new s.a.symbolNode(e,0,0,0,0,0,a);if(n){l.maxFontSize=n.sizeMultiplier,n.style.isTight()&&l.classes.push("mtight");var c=n.getColor();c&&(l.style.color=c)}return l},v=function(e,t,r,n,a){if("mathord"===a){var i=g(e,t,r,n);return d(e,i.fontName,t,r,n.concat([i.fontClass]))}if("textord"===a){if("ams"===(u.a[t][e]&&u.a[t][e].font)){var o=w("amsrm",r.fontWeight,r.fontShape);return d(e,o,t,r,n.concat("amsrm",r.fontWeight,r.fontShape))}var s=w("textrm",r.fontWeight,r.fontShape);return d(e,s,t,r,n.concat(r.fontWeight,r.fontShape))}throw new Error("unexpected type: "+a+" in mathDefault")},g=function(e,t,r,n){return/[0-9]/.test(e.charAt(0))||c.a.contains(m,e)?{fontName:"Main-Italic",fontClass:"mainit"}:{fontName:"Math-Italic",fontClass:"mathit"}},b=function(e){var t=0,r=0,n=0,i=!0,o=!1,s=void 0;try{for(var l,u=a()(e.children);!(i=(l=u.next()).done);i=!0){var c=l.value;c.height>t&&(t=c.height),c.depth>r&&(r=c.depth),c.maxFontSize>n&&(n=c.maxFontSize)}}catch(e){o=!0,s=e}finally{try{!i&&u.return&&u.return()}finally{if(o)throw s}}e.height=t,e.depth=r,e.maxFontSize=n},y=function(e,t,r,n){var a=new s.a.span(e,t,r,n);return b(a),a},x=function(e,t,r,n){return new s.a.span(e,t,r,n)},w=function(e,t,r){var n="";switch(e){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:throw new Error("Invalid font provided: "+e)}return n+"-"+("textbf"===t&&"textit"===r?"BoldItalic":"textbf"===t?"Bold":"textit"===t?"Italic":"Regular")},k={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},S={vec:["vec",.471,.714]};t.a={fontMap:k,makeSymbol:d,mathsym:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return r&&r.font&&"boldsymbol"===r.font&&f(e,"Main-Bold",t).metrics?d(e,"Main-Bold",t,r,n.concat(["mathbf"])):"\\"===e||"main"===u.a[t][e].font?d(e,"Main-Regular",t,r,n):d(e,"AMS-Regular",t,r,n.concat(["amsrm"]))},makeSpan:y,makeSvgSpan:x,makeLineSpan:function(e,t,r){var n=y([e],[],t);return n.height=r||t.fontMetrics().defaultRuleThickness,n.style.borderBottomWidth=n.height+"em",n.maxFontSize=1,n},makeAnchor:function(e,t,r,n){var a=new s.a.anchor(e,t,r,n);return b(a),a},makeFragment:function(e){var t=new s.a.documentFragment(e);return b(t),t},makeVList:function(e,t){var r=function(e){if("individualShift"===e.positionType){for(var t=e.children,r=[t[0]],n=-t[0].shift-t[0].elem.depth,i=n,o=1;o<t.length;o++){var s=-t[o].shift-i-t[o].elem.depth,l=s-(t[o-1].elem.height+t[o-1].elem.depth);i+=s,r.push({type:"kern",size:l}),r.push(t[o])}return{children:r,depth:n}}var u=void 0;if("top"===e.positionType){var c=e.positionData,h=!0,p=!1,m=void 0;try{for(var f,d=a()(e.children);!(h=(f=d.next()).done);h=!0){var v=f.value;c-="kern"===v.type?v.size:v.elem.height+v.elem.depth}}catch(e){p=!0,m=e}finally{try{!h&&d.return&&d.return()}finally{if(p)throw m}}u=c}else if("bottom"===e.positionType)u=-e.positionData;else{var g=e.children[0];if("elem"!==g.type)throw new Error('First child must have type "elem".');if("shift"===e.positionType)u=-g.elem.depth-e.positionData;else{if("firstBaseline"!==e.positionType)throw new Error("Invalid positionType "+e.positionType+".");u=-g.elem.depth}}return{children:e.children,depth:u}}(e),n=r.children,i=r.depth,o=0,l=!0,u=!1,c=void 0;try{for(var h,p=a()(n);!(l=(h=p.next()).done);l=!0){var m=h.value;if("elem"===m.type){var f=m.elem;o=Math.max(o,f.maxFontSize,f.height)}}}catch(e){u=!0,c=e}finally{try{!l&&p.return&&p.return()}finally{if(u)throw c}}o+=2;var d=y(["pstrut"],[]);d.style