mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-21 05:35:45 +01:00
1 line
87 KiB
JavaScript
1 line
87 KiB
JavaScript
|
!function(){"use strict";var t,e,n,o,i,r,s={21:function(t,e,n){var o,i=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 n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[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 n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.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.")},s=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s};Object.defineProperty(e,"__esModule",{value:!0}),e.MJContextMenu=void 0;var a=n(964),u=n(745),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.mathItem=null,e.annotation="",e.annotationTypes={},e}return i(e,t),e.prototype.post=function(e,n){if(this.mathItem){if(void 0!==n){var o=this.mathItem.inputJax.name,i=this.findID("Show","Original");i.content="MathML"===o?"Original MathML":o+" Commands",this.findID("Copy","Original").content=i.content;var r=this.findID("Settings","semantics");"MathML"===o?r.disable():r.enable(),this.getAnnotationMenu(),this.dynamicSubmenus()}t.prototype.post.call(this,e,n)}},e.prototype.unpost=function(){t.prototype.unpost.call(this),this.mathItem=null},e.prototype.findID=function(){for(var t,e,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var i=this,s=null;try{for(var a=r(n),l=a.next();!l.done;l=a.next()){var c=l.value;i?(s=i.find(c),i=s instanceof u.Submenu?s.submenu:null):s=null}}catch(e){t={error:e}}finally{try{l&&!l.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return s},e.prototype.getAnnotationMenu=function(){var t=this,e=this.getAnnotations(this.getSemanticNode());this.createAnnotationMenu("Show",e,(function(){return t.showAnnotation.post()})),this.createAnnotationMenu("Copy",e,(function(){return t.copyAnnotation()}))},e.prototype.getSemanticNode=function(){for(var t=this.mathItem.root;t&&!t.isKind("semantics");){if(t.isToken||1!==t.childNodes.length)return null;t=t.childNodes[0]}return t},e.prototype.getAnnotations=function(t){var e,n,o=[];if(!t)return o;try{for(var i=r(t.childNodes),s=i.next();!s.done;s=i.next()){var a=s.value;if(a.isKind("annotation")){var u=this.annotationMatch(a);if(u){var l=a.childNodes.reduce((function(t,e){return t+e.toString()}),"");o.push([u,l])}}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return o},e.prototype.annotationMatch=function(t){var e,n,o=t.attributes.get("encoding");try{for(var i=r(Object.keys(this.annotationTypes)),s=i.next();!s.done;s=i.next()){var a=s.value;if(this.annotationTypes[a].indexOf(o)>=0)return a}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return null},e.prototype.createAnnotationMenu=function(t,e,n){var o=this,i=this.findID(t,"Annotation");i.submenu=this.factory.get("subMenu")(this.factory,{items:e.map((function(t){var e=s(t,2),i=e[0],r=e[1];return{type:"command",id:i,content:i,action:function(){o.annotation=r,n()}}})),id:"annotations"},i),e.length?i.enable():i.disable()},e.prototype.dynamicSubmenus=function(){var t,n;try{for(var o=r(e.DynamicSubmenus),i=o.next();!i.done;i=o.next()){var a=s(i.value,2),u=a[0],l=a[1],c=this.find(u);if(c){var p=l(this,c);c.submenu=p,p.items.length?c.enable():c.disable()}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}},e.DynamicSubmenus=new Map,e}(a.ContextMenu);
|