10
2
Fork 0
has-writeup/mathjax/a11y/assistive-mml.js

1 line
6.3 KiB
JavaScript

!function(i){var o={};function n(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return i[t].call(e.exports,e,e.exports,n),e.l=!0,e.exports}n.m=i,n.c=o,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(t,e,i){"use strict";var o,n=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),s=this&&this.__assign||function(){return(s=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)},r=this&&this.__read||function(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var o,n,r=i.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(o=r.next()).done;)s.push(o.value)}catch(t){n={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}return s},a=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(r(arguments[e]));return t},l=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],o=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0});var u=i(2),c=i(3),p=i(4);function h(t){return n(e,i=t),e.prototype.assistiveMml=function(t){if(!(this.state()>=u.STATE.ASSISTIVEMML||this.isEscaped)){this.state(u.STATE.ASSISTIVEMML);var e=t.adaptor,i=t.toMML(this.root).replace(/\n */g,"").replace(/<!--.*?-->/g,""),o=e.firstChild(e.body(e.parse(i,"text/html"))),n=e.node("mjx-assistive-mml",{role:"presentation",unselectable:"on",display:this.display?"block":"inline"},[o]);e.setAttribute(this.typesetRoot,"role","presentation"),e.setAttribute(e.firstChild(this.typesetRoot),"aria-hidden","true"),e.setStyle(this.typesetRoot,"position","relative"),e.append(this.typesetRoot,n)}},e;function e(){return null!==i&&i.apply(this,arguments)||this}var i}function f(t){var e,r;return n(i,r=t),i.prototype.toMML=function(t){return this.visitor.visitTree(t)},i.prototype.assistiveMml=function(){var e,t;if(!this.processed.isSet("assistive-mml")){try{for(var i=l(this.math),o=i.next();!o.done;o=i.next())o.value.assistiveMml(this)}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}this.processed.set("assistive-mml")}return this},i.prototype.state=function(t,e){return void 0===e&&(e=!1),r.prototype.state.call(this,t,e),t<u.STATE.ASSISTIVEMML&&this.processed.clear("assistive-mml"),this},(e=i).OPTIONS=s(s({},t.OPTIONS),{renderActions:p.expandable(s(s({},t.OPTIONS.renderActions),{assistiveMml:[u.STATE.ASSISTIVEMML]}))}),e.assistiveStyles={"mjx-assistive-mml":{position:"absolute !important",top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)",padding:"1px 0px 0px 0px !important",border:"0px !important",display:"block !important",width:"auto !important",overflow:"hidden !important","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"},'mjx-assistive-mml[display="block"]':{width:"100% !important"}},e;function i(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=r.apply(this,a(t))||this,o=i.constructor,n=o.ProcessBits;return n.has("assistive-mml")||n.allocate("assistive-mml"),i.visitor=new c.SerializedMmlVisitor(i.mmlFactory),i.options.MathItem=h(i.options.MathItem),"addStyles"in i&&i.addStyles(o.assistiveStyles),i}}u.newState("ASSISTIVEMML",153),e.AssistiveMmlMathItemMixin=h,e.AssistiveMmlMathDocumentMixin=f,e.AssistiveMmlHandler=function(t){return t.documentClass=f(t.documentClass),t}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isObject=MathJax._.components.global.isObject,e.combineConfig=MathJax._.components.global.combineConfig,e.combineDefaults=MathJax._.components.global.combineDefaults,e.combineWithMathJax=MathJax._.components.global.combineWithMathJax,e.MathJax=MathJax._.components.global.MathJax},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.protoItem=MathJax._.core.MathItem.protoItem,e.AbstractMathItem=MathJax._.core.MathItem.AbstractMathItem,e.STATE=MathJax._.core.MathItem.STATE,e.newState=MathJax._.core.MathItem.newState},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DATAMJX=MathJax._.core.MmlTree.SerializedMmlVisitor.DATAMJX,e.SerializedMmlVisitor=MathJax._.core.MmlTree.SerializedMmlVisitor.SerializedMmlVisitor},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.APPEND=MathJax._.util.Options.APPEND,e.REMOVE=MathJax._.util.Options.REMOVE,e.Expandable=MathJax._.util.Options.Expandable,e.expandable=MathJax._.util.Options.expandable,e.makeArray=MathJax._.util.Options.makeArray,e.keys=MathJax._.util.Options.keys,e.copy=MathJax._.util.Options.copy,e.insert=MathJax._.util.Options.insert,e.defaultOptions=MathJax._.util.Options.defaultOptions,e.userOptions=MathJax._.util.Options.userOptions,e.selectOptions=MathJax._.util.Options.selectOptions,e.selectOptionsFromKeys=MathJax._.util.Options.selectOptionsFromKeys,e.separateOptions=MathJax._.util.Options.separateOptions},function(t,e,i){"use strict";i.r(e);var o=i(1),n=i(0);Object(o.combineWithMathJax)({_:{a11y:{"assistive-mml":n}}}),MathJax.startup&&MathJax.startup.extendHandler(function(t){return Object(n.AssistiveMmlHandler)(t)})}]);