S2OJ/web/js/mathjax3/input/tex/extensions/cases.js

1 line
6.9 KiB
JavaScript
Raw Normal View History

2022-09-20 02:24:04 +00:00
!function(){"use strict";var t,e,a,n={667:function(t,e){e.q=void 0,e.q="3.2.2"},530:function(t,e,a){var n,s,r=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function a(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(a.prototype=e.prototype,new a)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.CasesConfiguration=e.CasesMethods=e.CasesTags=e.CasesBeginItem=void 0;var i=a(251),u=a(871),m=o(a(398)),p=o(a(360)),l=o(a(402)),c=a(935),h=a(379),x=a(446),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),Object.defineProperty(e.prototype,"kind",{get:function(){return"cases-begin"},enumerable:!1,configurable:!0}),e.prototype.checkItem=function(e){return e.isKind("end")&&e.getName()===this.getName()&&this.getProperty("end")?(this.setProperty("end",!1),[[],!0]):t.prototype.checkItem.call(this,e)},e}(c.BeginItem);e.CasesBeginItem=f;var M=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.subcounter=0,e}return r(e,t),e.prototype.start=function(e,a,n){this.subcounter=0,t.prototype.start.call(this,e,a,n)},e.prototype.autoTag=function(){null==this.currentTag.tag&&("subnumcases"===this.currentTag.env?(0===this.subcounter&&this.counter++,this.subcounter++,this.tag(this.formatNumber(this.counter,this.subcounter),!1)):(0!==this.subcounter&&"numcases-left"===this.currentTag.env||this.counter++,this.tag(this.formatNumber(this.counter),!1)))},e.prototype.formatNumber=function(t,e){return void 0===e&&(e=null),t.toString()+(null===e?"":String.fromCharCode(96+e))},e}(h.AmsTags);e.CasesTags=M,e.CasesMethods={NumCases:function(t,e){if(t.stack.env.closing===e.getName()){delete t.stack.env.closing,t.Push(t.itemFactory.create("end").setProperty("name",e.getName()));var a=t.stack.Top(),n=a.Last,s=m.default.copyNode(n,t),r=a.getProperty("left");return x.EmpheqUtil.left(n,s,r+"\\empheqlbrace\\,",t,"numcases-left"),t.Push(t.itemFactory.create("end").setProperty("name",e.getName())),null}r=t.GetArgument("\\begin{"+e.getName()+"}");e.setProperty("left",r);var o=p.default.EqnArray(t,e,!0,!0,"ll");return o.arraydef.displaystyle=!1,o.arraydef.rowspacing=".2em",o.setProperty("numCases",!0),t.Push(e),o},Entry:function(t,e){if(!t.stack.Top().getProperty("numCases"))return p.default.Entry(t,e);t.Push(t.itemFactory.create("cell").setProperties({isEntry:!0,name:e}));for(var a=t.string,n=0,s=t.i,r=a.length;s<r;){var o=a.charAt(s);if("{"===o)n++,s++;else if("}"===o){if(0===n)break;n--,s++}else{if("&"===o&&0===n)throw new l.default("ExtraCasesAlignTab","Extra alignment tab in text for numcase environment");if("\\"===o&&0===n){var i=(a.slice(s+1).match(/^[a-z]+|./i)||[])[0];if("\\"===i||"cr"===i||"end"===i||"label"===i)break;s+=i.length}else s++}}var u=a.substr(t.i,s-t.i).replace(/^\s*/,"");t.PushAll(m.default.internalMath(t,u,0)),t.i=s}},new u.EnvironmentMap("cases-env",x.EmpheqUtil.environment,{numcases:["NumCases","cases"],subnumcases:["NumCases","cases"]},e.CasesMethods),new u.MacroMap("cases-macros",{"&":"Entry"},e.CasesMethods),e.CasesConfiguration=i.Configuration.create("cases",{handler:{environment:["cases-env"],character:["cases-macros"]},items:(s={},s[f.prototype.kind]=f,s),tags:{cases:M}})},955:function(t,e){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,e.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},251:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Configuration=MathJax._.input.tex.Configuration.Configuration,e.ConfigurationHandler=MathJax._.input.tex.Configuration.ConfigurationHandler,e.ParserConfiguration=MathJax._.input.tex.Configuration.ParserCon