/*! For license information please see HanoiCollab_v2.user.js.LICENSE.txt */ // ==UserScript== // @name HanoiCollab_v2 // @namespace https://trungnt2910.github.io/ // @version 0.2.6 // @description HanoiCollab client for Second Generation HanoiCollab server // @author trungnt2910 // @license MIT // @icon https://www.google.com/s2/favicons?domain=edu.vn // @downloadURL https://raw.githubusercontent.com/trungnt2910/HanoiCollab_v2/master/Clients/HanoiCollab_v2.user.js // @updateURL https://raw.githubusercontent.com/trungnt2910/HanoiCollab_v2/master/Clients/HanoiCollab_v2.meta.js // @connect * // @grant GM_xmlhttpRequest // @grant GM_getValue // @grant GM_setValue // @match https://forms.office.com/Pages/ResponsePage.aspx?* // @match https://shub.edu.vn/* // @match https://azota.vn/* // @match https://quilgo.com/* // @match https://docs.google.com/forms/* // @match https://study.hanoi.edu.vn/lam-bai/* // ==/UserScript== (()=>{var e={8202:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidNumberOfChildrenError=void 0;var n=r(2280);Object.defineProperty(t,"InvalidNumberOfChildrenError",{enumerable:!0,get:function(){return n.InvalidNumberOfChildrenError}})},2280:function(e,t){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},r(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidNumberOfChildrenError=void 0;var o=/** @class */function(e){function t(t,r,n,o){void 0===o&&(o="exactly");var i=e.call(this,t+" tag must have "+o+" "+r+" children. It's actually "+n)||this;return i.name="InvalidNumberOfChildrenError",i}return n(t,e),t}(Error);t.InvalidNumberOfChildrenError=o},4606:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(4423),t),o(r(2597),t),o(r(7460),t),o(r(1012),t)},2597:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JoinWithManySeparators=void 0;var r=/** @class */function(){function e(e){this._separators=e}return e.join=function(t,r){return new e(r)._join(t)},e.prototype._join=function(e){var t=this;return e.reduce((function(e,r,n,o){return e+r+(n===o.length-1?"":t._get(n))}),"")},e.prototype._get=function(e){return this._separators[e]?this._separators[e]:this._separators.length>0?this._separators[this._separators.length-1]:","},e}();t.JoinWithManySeparators=r},7460:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mathMLElementToLaTeXConverter=void 0;var n=r(2303);t.mathMLElementToLaTeXConverter=function(e){return new n.MathMLElementToLatexConverterAdapter(e).toLatexConverter()}},1012:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeWhiteSpaces=void 0;t.normalizeWhiteSpaces=function(e){return e.replace(/\s+/g," ")}},7877:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BracketWrapper=void 0;var n=r(1011),o=/** @class */function(){function e(){this._open="{",this._close="}"}return e.prototype.wrap=function(e){return new n.Wrapper(this._open,this._close).wrap(e)},e}();t.BracketWrapper=o},7577:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GenericWrapper=void 0;var n=r(1011),o=/** @class */function(){function e(e,t){this._open="\\left"+e,this._close="\\right"+t}return e.prototype.wrap=function(e){return new n.Wrapper(this._open,this._close).wrap(e)},e}();t.GenericWrapper=o},4423:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GenericWrapper=t.ParenthesisWrapper=t.BracketWrapper=void 0;var n=r(7877);Object.defineProperty(t,"BracketWrapper",{enumerable:!0,get:function(){return n.BracketWrapper}});var o=r(7807);Object.defineProperty(t,"ParenthesisWrapper",{enumerable:!0,get:function(){return o.ParenthesisWrapper}});var i=r(7577);Object.defineProperty(t,"GenericWrapper",{enumerable:!0,get:function(){return i.GenericWrapper}})},7807:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ParenthesisWrapper=void 0;var n=r(1011),o=/** @class */function(){function e(){this._open="\\left(",this._close="\\right)"}return e.prototype.wrap=function(e){return new n.Wrapper(this._open,this._close).wrap(e)},e.prototype.wrapIfMoreThanOneChar=function(e){return e.length<=1?e:this.wrap(e)},e}();t.ParenthesisWrapper=o},1011:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Wrapper=void 0;var r=/** @class */function(){function e(e,t){this._open=e,this._close=t}return e.prototype.wrap=function(e){return this._open+e+this._close},e}();t.Wrapper=r},1761:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GenericSpacingWrapper=void 0;var n=r(4606),o=/** @class */function(){function e(e){this._mathmlElement=e}return e.prototype.convert=function(){return this._mathmlElement.children.map((function(e){return n.mathMLElementToLaTeXConverter(e)})).map((function(e){return e.convert()})).join(" ")},e}();t.GenericSpacingWrapper=o},1376:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GenericUnderOver=void 0;var n=r(7460),o=r(8202),i=r(8259),a=/** @class */function(){function e(e){this._mathmlElement=e}return e.prototype.convert=function(){var e=this._mathmlElement,t=e.name,r=e.children,i=r.length;if(2!==i)throw new o.InvalidNumberOfChildrenError(t,2,i);var a=n.mathMLElementToLaTeXConverter(r[0]).convert(),s=n.mathMLElementToLaTeXConverter(r[1]).convert();return this._applyCommand(a,s)},e.prototype._applyCommand=function(e,t){var r=this._mathmlElement.name.match(/under/)?s.Under:s.Over;return new l(r).apply(e,t)},e}();t.GenericUnderOver=a;var s,l=/** @class */function(){function e(e){this._type=e}return e.prototype.apply=function(e,t){return i.latexAccents.includes(t)?t+"{"+e+"}":this._defaultCommand+"{"+t+"}{"+e+"}"},Object.defineProperty(e.prototype,"_defaultCommand",{get:function(){return this._type===s.Under?"\\underset":"\\overset"},enumerable:!1,configurable:!0}),e}();!function(e){e[e.Under=0]="Under",e[e.Over=1]="Over"}(s||(s={}))},3053:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GenericUnderOver=t.GenericSpacingWrapper=t.MTr=t.MTable=t.MUnderover=t.MText=t.MMultiscripts=t.MSubsup=t.MSub=t.MSup=t.MPhantom=t.MError=t.MEnclose=t.MAction=t.MRoot=t.MFrac=t.MFenced=t.MSqrt=t.MN=t.MO=t.MI=t.Math=void 0;var n=r(4846);Object.defineProperty(t,"Math",{enumerable:!0,get:function(){return n.Math}});var o=r(1348);Object.defineProperty(t,"MI",{enumerable:!0,get:function(){return o.MI}});var i=r(946);Object.defineProperty(t,"MO",{enumerable:!0,get:function(){return i.MO}});var a=r(2817);Object.defineProperty(t,"MN",{enumerable:!0,get:function(){return a.MN}});var s=r(2403);Object.defineProperty(t,"MSqrt",{enumerable:!0,get:function(){return s.MSqrt}});var l=r(2287);Object.defineProperty(t,"MFenced",{enumerable:!0,get:function(){return l.MFenced}});var c=r(8771);Object.defineProperty(t,"MFrac",{enumerable:!0,get:function(){return c.MFrac}});var u=r(7038);Object.defineProperty(t,"MRoot",{enumerable:!0,get:function(){return u.MRoot}});var h=r(2204);Object.defineProperty(t,"MAction",{enumerable:!0,get:function(){return h.MAction}});var d=r(2068);Object.defineProperty(t,"MEnclose",{enumerable:!0,get:function(){return d.MEnclose}});var p=r(7892);Object.defineProperty(t,"MError",{enumerable:!0,get:function(){return p.MError}});var m=r(1297);Object.defineProperty(t,"MPhantom",{enumerable:!0,get:function(){return m.MPhantom}});var g=r(4045);Object.defineProperty(t,"MSup",{enumerable:!0,get:function(){return g.MSup}});var f=r(2571);Object.defineProperty(t,"MSub",{enumerable:!0,get:function(){return f.MSub}});var w=r(6417);Object.defineProperty(t,"MSubsup",{enumerable:!0,get:function(){return w.MSubsup}});var x=r(9065);Object.defineProperty(t,"MMultiscripts",{enumerable:!0,get:function(){return x.MMultiscripts}});var v=r(5850);Object.defineProperty(t,"MText",{enumerable:!0,get:function(){return v.MText}});var b=r(3873);Object.defineProperty(t,"MUnderover",{enumerable:!0,get:function(){return b.MUnderover}});var y=r(3880);Object.defineProperty(t,"MTable",{enumerable:!0,get:function(){return y.MTable}});var _=r(3275);Object.defineProperty(t,"MTr",{enumerable:!0,get:function(){return _.MTr}});var C=r(1761);Object.defineProperty(t,"GenericSpacingWrapper",{enumerable:!0,get:function(){return C.GenericSpacingWrapper}});var A=r(1376);Object.defineProperty(t,"GenericUnderOver",{enumerable:!0,get:function(){return A.GenericUnderOver}})},2204:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MAction=void 0;var n=r(7460),o=/** @class */function(){function e(e){this._mathmlElement=e}return e.prototype.convert=function(){var e=this._mathmlElement.children;return this._isToggle()?e.map((function(e){return n.mathMLElementToLaTeXConverter(e)})).map((function(e){return e.convert()})).join(" \\Longrightarrow "):n.mathMLElementToLaTeXConverter(e[0]).convert()},e.prototype._isToggle=function(){var e=this._mathmlElement.attributes.actiontype;return"toggle"===e||!e},e}();t.MAction=o},4846:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Math=void 0;var n=r(7460),o=r(1012),i=/** @class */function(){function e(e){this._mathmlElement=e}return e.prototype.convert=function(){var e=this._mathmlElement.children.map((function(e){return n.mathMLElementToLaTeXConverter(e)})).map((function(e){return e.convert()})).join("");return o.normalizeWhiteSpaces(e)},e}();t.Math=i},2068:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MEnclose=void 0;var n=r(7460),o=/** @class */function(){function e(e){this._mathmlElement=e}return e.prototype.convert=function(){var e=this._mathmlElement.children.map((function(e){return n.mathMLElementToLaTeXConverter(e)})).map((function(e){return e.convert()})).join(" ");return"actuarial"===this._notation?"\\overline{\\left."+e+"\\right|}":"radical"===this._notation?"\\sqrt{"+e+"}":["box","roundedbox","circle"].includes(this._notation)?"\\boxed{"+e+"}":"left"===this._notation?"\\left|"+e:"right"===this._notation?e+"\\right|":"top"===this._notation?"\\overline{"+e+"}":"bottom"===this._notation?"\\underline{"+e+"}":"updiagonalstrike"===this._notation?"\\cancel{"+e+"}":"downdiagonalstrike"===this._notation?"\\bcancel{"+e+"}":"updiagonalarrow"===this._notation?"\\cancelto{}{"+e+"}":["verticalstrike","horizontalstrike"].includes(this._notation)?"\\hcancel{"+e+"}":"madruwb"===this._notation?"\\underline{"+e+"\\right|}":"phasorangle"===this._notation?"{\\angle \\underline{"+e+"}}":"\\overline{\\left.\\right)"+e+"}"},Object.defineProperty(e.prototype,"_notation",{get:function(){return this._mathmlElement.attributes.notation||"longdiv"},enumerable:!1,configurable:!0}),e}();t.MEnclose=o},7892:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MError=void 0;var n=r(7460),o=/** @class */function(){function e(e){this._mathmlElement=e}return e.prototype.convert=function(){return"\\color{red}{"+this._mathmlElement.children.map((function(e){return n.mathMLElementToLaTeXConverter(e)})).map((function(e){return e.convert()})).join(" ")+"}"},e}();t.MError=o},2287:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MFenced=void 0;var n=r(7460),o=r(4606),i=/** @class */function(){function e(e){this._mathmlElement=e,this._open=this._mathmlElement.attributes.open||"",this._close=this._mathmlElement.attributes.close||"",this._separators=Array.from(this._mathmlElement.attributes.separators||"")}return e.prototype.convert=function(){var e=this._mathmlElement.children.map((function(e){return n.mathMLElementToLaTeXConverter(e)})).map((function(e){return e.convert()}));return this._isThereRelativeOfName(this._mathmlElement.children,"mtable")?new s(this._open,this._close).apply(e):new a(this._open,this._close,this._separators).apply(e)},e.prototype._isThereRelativeOfName=function(e,t){var r=this;return e.some((function(e){return e.name===t||r._isThereRelativeOfName(e.children,t)}))},e}();t.MFenced=i;var a=/** @class */function(){function e(e,t,r){this._open=e||"(",this._close=t||")",this._separators=r}return e.prototype.apply=function(e){var t=o.JoinWithManySeparators.join(e,this._separators);return new o.GenericWrapper(this._open,this._close).wrap(t)},e}(),s=/** @class */function(){function e(e,t){this._genericCommand="matrix",this._separators=new l(e,t)}return e.prototype.apply=function(e){var t=this._command,r="\\begin{"+t+"}\n"+e.join("")+"\n\\end{"+t+"}";return t===this._genericCommand?this._separators.wrap(r):r},Object.defineProperty(e.prototype,"_command",{get:function(){return this._separators.areParentheses()?"pmatrix":this._separators.areSquareBrackets()?"bmatrix":this._separators.areBrackets()?"Bmatrix":this._separators.areDivides()?"vmatrix":this._separators.areParallels()?"Vmatrix":this._separators.areNotEqual()?this._genericCommand:"bmatrix"},enumerable:!1,configurable:!0}),e}(),l=/** @class */function(){function e(e,t){this._open=e,this._close=t}return e.prototype.wrap=function(e){return new o.GenericWrapper(this._open,this._close).wrap(e)},e.prototype.areParentheses=function(){return this._compare("(",")")},e.prototype.areSquareBrackets=function(){return this._compare("[","]")},e.prototype.areBrackets=function(){return this._compare("{","}")},e.prototype.areDivides=function(){return this._compare("|","|")},e.prototype.areParallels=function(){return this._compare("||","||")},e.prototype.areNotEqual=function(){return this._open!==this._close},e.prototype._compare=function(e,t){return this._open===e&&this._close===t},e}()},8771:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MFrac=void 0;var n=r(8202),o=r(4606),i=/** @class */function(){function e(e){this._mathmlElement=e}return e.prototype.convert=function(){var e=this._mathmlElement,t=e.children,r=e.name,i=t.length;if(2!==i)throw new n.InvalidNumberOfChildrenError(r,2,i);var a=o.mathMLElementToLaTeXConverter(t[0]).convert(),s=o.mathMLElementToLaTeXConverter(t[1]).convert();return this._isBevelled()?this._wrapIfMoreThanOneChar(a)+"/"+this._wrapIfMoreThanOneChar(s):"\\frac{"+a+"}{"+s+"}"},e.prototype._wrapIfMoreThanOneChar=function(e){return(new o.ParenthesisWrapper).wrapIfMoreThanOneChar(e)},e.prototype._isBevelled=function(){return!!this._mathmlElement.attributes.bevelled},e}();t.MFrac=i},1348:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MI=void 0;var n=r(4606),o=r(7704),i=/** @class */function(){function e(e){this._mathmlElement=e}return e.prototype.convert=function(){var e=n.normalizeWhiteSpaces(this._mathmlElement.value);if(" "===e)return a.apply(e);var t=e.trim();return a.apply(t)},e}();t.MI=i;var a=/** @class */function(){function e(e){this._value=e}return e.apply=function(t){return new e(t)._apply()},e.prototype._apply=function(){return this._findByCharacter()||this._findByGlyph()||this._value},e.prototype._findByCharacter=function(){return o.allMathSymbolsByChar[this._value]},e.prototype._findByGlyph=function(){return o.allMathSymbolsByGlyph[this._value]},e}()},9065:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MMultiscripts=void 0;var n=r(4606),o=r(8202),i=/** @class */function(){function e(e){this._mathmlElement=e}return e.prototype.convert=function(){var e=this._mathmlElement,t=e.name,r=e.children,i=r.length;if(i<3)throw new o.InvalidNumberOfChildrenError(t,3,i,"at least");var a=n.mathMLElementToLaTeXConverter(r[0]).convert();return this._prescriptLatex()+this._wrapInParenthesisIfThereIsSpace(a)+this._postscriptLatex()},e.prototype._prescriptLatex=function(){var e,t,r=this._mathmlElement.children;if(this._isPrescripts(r[1]))e=r[2],t=r[3];else{if(!this._isPrescripts(r[3]))return"";e=r[4],t=r[5]}return"\\_{"+n.mathMLElementToLaTeXConverter(e).convert()+"}^{"+n.mathMLElementToLaTeXConverter(t).convert()+"}"},e.prototype._postscriptLatex=function(){var e=this._mathmlElement.children;if(this._isPrescripts(e[1]))return"";var t=e[1],r=e[2];return"_{"+n.mathMLElementToLaTeXConverter(t).convert()+"}^{"+n.mathMLElementToLaTeXConverter(r).convert()+"}"},e.prototype._wrapInParenthesisIfThereIsSpace=function(e){return e.match(/\s+/g)?(new n.ParenthesisWrapper).wrap(e):e},e.prototype._isPrescripts=function(e){return"mprescripts"===(null==e?void 0:e.name)},e}();t.MMultiscripts=i},2817:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MN=void 0;var n=r(4606),o=/** @class */function(){function e(e){this._mathmlElement=e}return e.prototype.convert=function(){return n.normalizeWhiteSpaces(this._mathmlElement.value).trim()},e}();t.MN=o},946:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MO=void 0;var n=r(4606),o=r(7704),i=/** @class */function(){function e(e){this._mathmlElement=e}return e.prototype.convert=function(){var e=n.normalizeWhiteSpaces(this._mathmlElement.value).trim();return a.operate(e)},e}();t.MO=i;var a=/** @class */function(){function e(e){this._value=e}return e.operate=function(t){return new e(t)._operate()},e.prototype._operate=function(){return this._findByCharacter()||this._findByGlyph()||this._value},e.prototype._findByCharacter=function(){return o.allMathOperatorsByChar[this._value]},e.prototype._findByGlyph=function(){return o.allMathOperatorsByGlyph[this._value]},e}()},1297:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MPhantom=void 0;var r=/** @class */function(){function e(e){this._mathmlElement=e}return e.prototype.convert=function(){return""},e}();t.MPhantom=r},7038:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MRoot=void 0;var n=r(4606),o=r(8202),i=/** @class */function(){function e(e){this._mathmlElement=e}return e.prototype.convert=function(){var e=this._mathmlElement,t=e.name,r=e.children,i=r.length;if(2!==i)throw new o.InvalidNumberOfChildrenError(t,2,i);var a=n.mathMLElementToLaTeXConverter(r[0]).convert();return"\\sqrt["+n.mathMLElementToLaTeXConverter(r[1]).convert()+"]{"+a+"}"},e}();t.MRoot=i},2403:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MSqrt=void 0;var n=r(4606),o=/** @class */function(){function e(e){this._mathmlElement=e}return e.prototype.convert=function(){return"\\sqrt{"+this._mathmlElement.children.map((function(e){return n.mathMLElementToLaTeXConverter(e)})).map((function(e){return e.convert()})).join(" ")+"}"},e}();t.MSqrt=o},2571:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MSub=void 0;var n=r(4606),o=r(8202),i=/** @class */function(){function e(e){this._mathmlElement=e}return e.prototype.convert=function(){var e=this._mathmlElement,t=e.name,r=e.children,i=r.length;if(2!==i)throw new o.InvalidNumberOfChildrenError(t,2,i);var a=n.mathMLElementToLaTeXConverter(r[0]).convert(),s=n.mathMLElementToLaTeXConverter(r[1]).convert();return(new n.ParenthesisWrapper).wrapIfMoreThanOneChar(a)+"_"+(new n.BracketWrapper).wrap(s)},e}();t.MSub=i},6417:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MSubsup=void 0;var n=r(4606),o=r(8202),i=/** @class */function(){function e(e){this._mathmlElement=e}return e.prototype.convert=function(){var e=this._mathmlElement,t=e.name,r=e.children,i=r.length;if(3!==i)throw new o.InvalidNumberOfChildrenError(t,3,i);var a=n.mathMLElementToLaTeXConverter(r[0]).convert(),s=n.mathMLElementToLaTeXConverter(r[1]).convert(),l=n.mathMLElementToLaTeXConverter(r[2]).convert(),c=(new n.BracketWrapper).wrap(s),u=(new n.BracketWrapper).wrap(l);return this._wrapInParenthesisIfThereIsSpace(a)+"_"+c+"^"+u},e.prototype._wrapInParenthesisIfThereIsSpace=function(e){return e.match(/\s+/g)?(new n.ParenthesisWrapper).wrap(e):e},e}();t.MSubsup=i},4045:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MSup=void 0;var n=r(4606),o=r(8202),i=/** @class */function(){function e(e){this._mathmlElement=e}return e.prototype.convert=function(){var e=this._mathmlElement,t=e.name,r=e.children,i=r.length;if(2!==i)throw new o.InvalidNumberOfChildrenError(t,2,i);var a=n.mathMLElementToLaTeXConverter(r[0]).convert(),s=n.mathMLElementToLaTeXConverter(r[1]).convert();return(new n.ParenthesisWrapper).wrapIfMoreThanOneChar(a)+"^"+(new n.BracketWrapper).wrap(s)},e}();t.MSup=i},3880:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MTable=void 0;var n=r(4606),o=/** @class */function(){function e(e){this._mathmlElement=e,this._addFlagRecursiveIfName(this._mathmlElement.children,"mtable","innerTable")}return e.prototype.convert=function(){var e=this._mathmlElement.children.map((function(e){return n.mathMLElementToLaTeXConverter(e)})).map((function(e){return e.convert()})).join(" \\\\\n");return this._hasFlag("innerTable")?this._wrap(e):e},e.prototype._wrap=function(e){return"\\begin{matrix}"+e+"\\end{matrix}"},e.prototype._addFlagRecursiveIfName=function(e,t,r){var n=this;e.forEach((function(e){e.name===t&&(e.attributes[r]=r),n._addFlagRecursiveIfName(e.children,t,r)}))},e.prototype._hasFlag=function(e){return!!this._mathmlElement.attributes[e]},e}();t.MTable=o},5850:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MText=void 0;var r=/** @class */function(){function e(e){this._mathmlElement=e}return e.prototype.convert=function(){var e=this._mathmlElement,t=e.attributes,r=e.value;return new n(t.mathvariant).apply(r)},e}();t.MText=r;var n=/** @class */function(){function e(e){this._mathvariant=e||"normal"}return e.prototype.apply=function(e){return this._commands.reduce((function(t,r,n){return 0===n?r+"{"+e+"}":r+"{"+t+"}"}),"")},Object.defineProperty(e.prototype,"_commands",{get:function(){switch(this._mathvariant){case"bold":return["\\textbf"];case"italic":return["\\textit"];case"bold-italic":return["\\textit","\\textbf"];case"double-struck":return["\\mathbb"];case"monospace":return["\\mathtt"];case"bold-fraktur":case"fraktur":return["\\mathfrak"];default:return["\\text"]}},enumerable:!1,configurable:!0}),e}()},3275:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MTr=void 0;var n=r(4606),o=/** @class */function(){function e(e){this._mathmlElement=e}return e.prototype.convert=function(){return this._mathmlElement.children.map((function(e){return n.mathMLElementToLaTeXConverter(e)})).map((function(e){return e.convert()})).join(" & ")},e}();t.MTr=o},3873:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MUnderover=void 0;var n=r(4606),o=r(8202),i=/** @class */function(){function e(e){this._mathmlElement=e}return e.prototype.convert=function(){var e=this._mathmlElement,t=e.name,r=e.children,i=r.length;if(3!==i)throw new o.InvalidNumberOfChildrenError(t,3,i);return n.mathMLElementToLaTeXConverter(r[0]).convert()+"_{"+n.mathMLElementToLaTeXConverter(r[1]).convert()+"}^{"+n.mathMLElementToLaTeXConverter(r[2]).convert()+"}"},e}();t.MUnderover=i},2303:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.MathMLElementToLatexConverterAdapter=void 0;var a=i(r(3053)),s=/** @class */function(){function e(e){this._mathMLElement=e}return e.prototype.toLatexConverter=function(){var e=this._mathMLElement.name;return new(l[e]||a.GenericSpacingWrapper)(this._mathMLElement)},e}();t.MathMLElementToLatexConverterAdapter=s;var l={math:a.Math,mi:a.MI,mo:a.MO,mn:a.MN,msqrt:a.MSqrt,mfenced:a.MFenced,mfrac:a.MFrac,mroot:a.MRoot,maction:a.MAction,menclose:a.MEnclose,merror:a.MError,mphantom:a.MPhantom,msup:a.MSup,msub:a.MSub,msubsup:a.MSubsup,mmultiscripts:a.MMultiscripts,mtext:a.MText,munderover:a.MUnderover,mtable:a.MTable,mtr:a.MTr,mover:a.GenericUnderOver,munder:a.GenericUnderOver,mrow:a.GenericSpacingWrapper,mpadded:a.GenericSpacingWrapper}},9841:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(8928);t.default=n.MathMLToLaTeX,e.exports=n.MathMLToLaTeX},5266:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorHandler=void 0;var r=/** @class */function(){function e(){this._errors=[],this.errorLocator={}}return e.prototype.fixError=function(e,t){return this._isMissingAttributeValueError(t)?(this._errors.push(t),this._fixMissingAttribute(t,e)):e},e.prototype.isThereAnyErrors=function(){return this._errors.length>0},e.prototype.cleanErrors=function(){this._errors=[]},e.prototype._fixMissingAttribute=function(e,t){var r=e.split('"')[1];if(r)return t.replace(this._matchMissingValueForAttribute(r),"");for(;this._mathGenericMissingValue().exec(t);)t=t.replace(this._mathGenericMissingValue(),"$1$3");return t},e.prototype._matchMissingValueForAttribute=function(e){return new RegExp("("+e+"=(?!(\"|')))|("+e+"(?!(\"|')))","gm")},e.prototype._mathGenericMissingValue=function(){return/(\<.* )(\w+=(?!\"|\'))(.*\>)/gm},e.prototype._isMissingAttributeValueError=function(e){return!!e.includes("attribute")&&!!e.includes("missed")||e.includes("attribute value missed")},e}();t.ErrorHandler=r},1557:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(2998),t),o(r(5266),t),o(r(7681),t)},7681:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ElementsToMathMLAdapter=void 0;var r=/** @class */function(){function e(){}return e.prototype.convert=function(e){var t=this;return e.filter((function(e){return void 0!==e.tagName})).map((function(e){return t._convertElement(e)}))},e.prototype._convertElement=function(e){return{name:e.tagName,attributes:this._convertElementAttributes(e.attributes),value:this._hasElementChild(e)?"":e.textContent||"",children:this._hasElementChild(e)?this.convert(Array.from(e.childNodes)):[]}},e.prototype._convertElementAttributes=function(e){return Array.from(e).reduce((function(e,t){var r;return Object.assign(((r={})[t.nodeName]=t.nodeValue===t.nodeName?"":t.nodeValue,r),e)}),{})},e.prototype._hasElementChild=function(e){var t=e.childNodes;return!!t&&0!==t.length&&this._isThereAnyNoTextNode(t)},e.prototype._isThereAnyNoTextNode=function(e){return Array.from(e).some((function(e){return"#text"!==e.nodeName}))},e}();t.ElementsToMathMLAdapter=r},2998:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.XmlToMathMLAdapter=void 0;var o=n(r(647)),i=/** @class */function(){function e(e,t){this._xml="",this._elementsConvertor=e,this._errorHandler=t,this._xmlDOM=new o.default.DOMParser({locator:this._errorHandler.errorLocator,errorHandler:this._fixError.bind(this)})}return e.prototype.convert=function(e){return this._xml=this._removeLineBreaks(e),this._elementsConvertor.convert(this._mathMLElements)},e.prototype._fixError=function(e){this._xml=this._errorHandler.fixError(this._xml,e)},e.prototype._removeLineBreaks=function(e){return e.replace(/\n|\r\n|\r/g,"")},Object.defineProperty(e.prototype,"_mathMLElements",{get:function(){var e=this._xmlDOM.parseFromString(this._xml).getElementsByTagName("math");return this._errorHandler.isThereAnyErrors()&&(this._errorHandler.cleanErrors(),e=this._xmlDOM.parseFromString(this._xml).getElementsByTagName("math")),Array.from(e)},enumerable:!1,configurable:!0}),e}();t.XmlToMathMLAdapter=i},2061:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(5788),t)},5788:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeToMathElementsConverter=void 0;var n=r(1557);t.makeToMathElementsConverter=function(){var e=new n.ElementsToMathMLAdapter,t=new n.ErrorHandler;return new n.XmlToMathMLAdapter(e,t)}},8928:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(9190),t)},9190:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MathMLToLaTeX=void 0;var n=r(2303),o=r(2061),i=/** @class */function(){function e(){}return e.convert=function(e){return o.makeToMathElementsConverter().convert(e).map((function(e){return new n.MathMLElementToLatexConverterAdapter(e).toLatexConverter()})).map((function(e){return e.convert()})).join("")},e}();t.MathMLToLaTeX=i},6102:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.allMathOperatorsByChar=void 0,t.allMathOperatorsByChar={_:"\\underline","⏡":"\\underbrace","⏠":"\\overbrace","⏟":"\\underbrace","⏞":"\\overbrace","⏝":"\\underbrace","⏜":"\\overbrace","⎵":"\\underbrace","⎴":"\\overbrace","⃜":"\\square","⃛":"\\square","⁤":"","⁗":"''''","‾":"\\bar","‷":"```","‶":"``","‵":"`","‴":"'''","″":"''","‟":"``","„":",,","‛":"`","‚":",","̂":"\\hat","˷":"\\sim","˝":"\\sim","˜":"\\sim","˚":"\\circ","˙":"\\cdot","˘":"","ˍ":"\\_","ˋ":"ˋ","ˊ":"ˊ","ˉ":"ˉ","ˇ":"","ˆ":"\\hat","º":"o","¹":"1","¸":"¸","´":"´","³":"3","²":"2","°":"\\circ","¯":"\\bar","ª":"a","¨":"\\cdot\\cdot","~":"\\sim","`":"`","^":"\\hat","--":"--","++":"++","&":"\\&","⁡":"","∜":"\\sqrt[4]{}","∛":"\\sqrt[3]{}","√":"\\sqrt{}","ⅆ":"d","ⅅ":"\\mathbb{D}","?":"?","@":"@","//":"//","!!":"!!","!":"!","♯":"\\#","♮":"","♭":"","′":"'","<>":"<>","**":"\\star\\star","∇":"\\nabla","∂":"\\partial","⊙":"\\bigodot","¬":"\\neg","∢":"\\measuredangle","∡":"\\measuredangle","∠":"\\angle","÷":"\\div","/":"/","∖":"\\backslash","\\":"\\backslash","%":"\\%","⊗":"\\bigotimes","·":"\\cdot","⨿":"\\coprod","⨯":"\\times","⋅":"\\cdot","⊡":"\\boxdot","⊠":"\\boxtimes","⁢":"","⁃":"-","•":"\\cdot","×":"\\times",".":".","*":"\\star","∪":"\\cup","∩":"\\cap","∐":"\\coprod","∏":"\\prod","≀":"","⫿":"","⫼":"\\mid\\mid\\mid","⨉":"\\times","⨈":"","⨇":"","⨆":"\\sqcup","⨅":"\\sqcap","⨂":"\\otimes","⨀":"\\odot","⋂":"\\cap","⋁":"\\vee","⋀":"\\wedge","⨄":"\\uplus","⨃":"\\cup","⋃":"\\cup","⨜":"\\underline{\\int}","⨛":"\\overline{\\int}","⨚":"\\int","⨙":"\\int","⨘":"\\int","⨗":"\\int","⨖":"\\oint","⨕":"\\oint","⨔":"\\int","⨓":"\\int","⨒":"\\int","⨑":"\\int","⨐":"\\int","⨏":"\\bcancel{\\int}","⨎":"","⨍":"\\hcancel{\\int}","⨌":"\\iiiint","∳":"\\oint","∲":"\\oint","∱":"\\int","∰":"\\oiint","∯":"\\oiint","∮":"\\oint","∫":"\\int","⨁":"\\oplus","⊘":"\\oslash","⊖":"\\ominus","⊕":"\\oplus","∭":"\\iiint","∬":"\\iint","⨋":"","⨊":"","∑":"\\sum","⊟":"\\boxminus","⊞":"\\boxplus","∔":"\\dot{+}","∓":"+-","−":"-","±":"\\pm","-":"-","+":"+","⭆":"\\Rrightarrow","⭅":"\\Lleftarrow","⧴":":\\rightarrow","⧯":"","⧟":"\\bullet-\\bullet","⦟":"\\angle","⦞":"\\measuredangle","⦝":"\\measuredangle","⦜":"\\perp","⦛":"\\measuredangle","⦚":"","⦙":"\\vdots","⥿":"","⥾":"","⥽":"\\prec","⥼":"\\succ","⥻":"\\underset{\\rightarrow}{\\supset}","⥺":"","⥹":"\\underset{\\rightarrow}{\\subset}","⥸":"\\underset{\\rightarrow}{>}","⥷":"","⥶":"\\underset{\\leftarrow}{<}","⥵":"\\underset{\\approx}{\\rightarrow}","⥴":"\\underset{\\sim}{\\rightarrow}","⥳":"\\underset{\\sim}{\\leftarrow}","⥲":"\\overset{\\sim}{\\rightarrow}","⥱":"\\overset{=}{\\rightarrow}","⥰":"","⥯":"","⥮":"","⥭":"\\overline{\\rightharpoondown}","⥬":"\\underline{\\rightharpoonup}","⥫":"\\overline{\\leftharpoondown}","⥪":"\\underline{\\leftharpoonup}","⥩":"\\rightleftharpoons","⥨":"\\rightleftharpoons","⥧":"\\rightleftharpoons","⥦":"\\rightleftharpoons","⥥":"\\Downarrow","⥤":"\\Rightarrow","⥣":"\\Uparrow","⥢":"\\Leftarrow","⥡":"\\downarrow","⥠":"\\uparrow","⥟":"\\rightarrow","⥞":"\\leftarrow","⥝":"\\downarrow","⥜":"\\uparrow","⥛":"\\rightarrow","⥚":"\\leftarrow","⥙":"\\downarrow","⥘":"\\uparrow","⥗":"\\rightarrow","⥖":"\\leftarrow","⥕":"\\downarrow","⥔":"\\uparrow","⥓":"\\rightarrow","⥒":"\\leftarrow","⥑":"\\updownarrow","⥐":"\\leftrightarrow","⥏":"\\updownarrow","⥎":"\\leftrightarrow","⥍":"\\updownarrow","⥌":"\\updownarrow","⥋":"\\leftrightarrow","⥊":"\\leftrightarrow","⥉":"","⥈":"\\leftrightarrow","⥇":"\\nrightarrow","⥆":"","⥅":"","⥄":"\\rightleftarrows","⥃":"\\leftrightarrows","⥂":"\\rightleftarrows","⥁":"\\circlearrowright","⥀":"\\circlearrowleft","⤿":"\\rightarrow","⤾":"\\leftarrow","⤽":"","⤼":"","⤻":"","⤺":"","⤹":"","⤸":"","⤷":"\\Rsh","⤶":"\\Lsh","⤵":"\\downarrow","⤴":"\\uparrow","⤳":"\\leadsto","⤲":"","⤱":"","⤰":"","⤯":"","⤮":"","⤭":"","⤬":"\\times","⤫":"\\times","⤪":"","⤩":"","⤨":"","⤧":"","⤦":"","⤥":"","⤤":"","⤣":"","⤢":"","⤡":"","⤠":"\\mapsto\\cdot","⤟":"\\cdot\\leftarrow","⤞":"\\rightarrow\\cdot","⤝":"\\leftarrow","⤜":"\\rightarrow","⤛":"\\leftarrow","⤚":"\\rightarrow","⤙":"\\leftarrow","⤘":"\\rightarrow","⤗":"\\rightarrow","⤖":"\\rightarrow","⤕":"\\rightarrow","⤔":"\\rightarrow","⤓":"\\downarrow","⤒":"\\uparrow","⤑":"\\rightarrow","⤐":"\\rightarrow","⤏":"\\rightarrow","⤎":"\\leftarrow","⤍":"\\rightarrow","⤌":"\\leftarrow","⤋":"\\Downarrow","⤊":"\\Uparrow","⤉":"\\uparrow","⤈":"\\downarrow","⤇":"\\Rightarrow","⤆":"\\Leftarrow","⤅":"\\mapsto","⤄":"\\nLeftrightarrow","⤃":"\\nRightarrow","⤂":"\\nLeftarrow","⤁":"\\rightsquigarrow","⤀":"\\rightsquigarrow","⟿":"\\rightsquigarrow","⟾":"\\Rightarrow","⟽":"\\Leftarrow","⟼":"\\mapsto","⟻":"\\leftarrow","⟺":"\\Longleftrightarrow","⟹":"\\Longrightarrow","⟸":"\\Longleftarrow","⟷":"\\leftrightarrow","⟶":"\\rightarrow","⟵":"\\leftarrow","⟱":"\\Downarrow","⟰":"\\Uparrow","⊸":"\\rightarrow","⇿":"\\leftrightarrow","⇾":"\\rightarrow","⇽":"\\leftarrow","⇼":"\\nleftrightarrow","⇻":"\\nrightarrow","⇺":"\\nleftarrow","⇹":"\\nleftrightarrow","⇸":"\\nrightarrow","⇷":"\\nleftarrow","⇶":"\\Rrightarrow","⇵":"","⇴":"\\rightarrow","⇳":"\\Updownarrow","⇲":"\\searrow","⇱":"\\nwarrow","⇰":"\\Leftarrow","⇯":"\\Uparrow","⇮":"\\Uparrow","⇭":"\\Uparrow","⇬":"\\Uparrow","⇫":"\\Uparrow","⇪":"\\Uparrow","⇩":"\\Downarrow","⇨":"\\Rightarrow","⇧":"\\Uparrow","⇦":"\\Leftarrow","⇥":"\\rightarrow","⇤":"\\leftarrow","⇣":"\\downarrow","⇢":"\\rightarrow","⇡":"\\uparrow","⇠":"\\leftarrow","⇟":"\\downarrow","⇞":"\\uparrow","⇝":"\\rightsquigarrow","⇜":"\\leftarrow","⇛":"\\Rrightarrow","⇚":"\\Lleftarrow","⇙":"\\swarrow","⇘":"\\searrow","⇗":"\\nearrow","⇖":"\\nwarrow","⇕":"\\Updownarrow","⇔":"\\Leftrightarrow","⇓":"\\Downarrow","⇒":"\\Rightarrow","⇑":"\\Uparrow","⇐":"\\Leftarrow","⇏":"\\nRightarrow","⇎":"\\nLeftrightarrow","⇍":"\\nLeftarrow","⇌":"\\rightleftharpoons","⇋":"\\leftrightharpoons","⇊":"\\downdownarrows","⇉":"\\rightrightarrows","⇈":"\\upuparrows","⇇":"\\leftleftarrows","⇆":"\\leftrightarrows","⇅":"","⇄":"\\rightleftarrows","⇃":"\\downharpoonleft","⇂":"\\downharpoonright","⇁":"\\rightharpoondown","⇀":"\\rightharpoonup","↿":"\\upharpoonleft","↾":"\\upharpoonright","↽":"\\leftharpoondown","↼":"\\leftharpoonup","↻":"\\circlearrowright","↺":"\\circlearrowleft","↹":"\\leftrightarrows","↸":"\\overline{\\nwarrow}","↷":"\\curvearrowright","↶":"\\curvearrowleft","↵":"\\swarrow","↴":"\\searrow","↳":"\\Rsh","↲":"\\Lsh","↱":"\\Rsh","↰":"\\Lsh","↯":"\\swarrow","↮":"","↭":"\\leftrightsquigarrow","↬":"\\looparrowright","↫":"\\looparrowleft","↪":"\\hookrightarrow","↩":"\\hookleftarrow","↨":"\\underline{\\updownarrow}","↧":"\\downarrow","↦":"\\rightarrowtail","↥":"\\uparrow","↤":"\\leftarrowtail","↣":"\\rightarrowtail","↢":"\\leftarrowtail","↡":"\\downarrow","↠":"\\twoheadrightarrow","↟":"\\uparrow","↞":"\\twoheadleftarrow","↝":"\\nearrow","↜":"\\nwarrow","↛":"","↚":"","↙":"\\swarrow","↘":"\\searrow","↗":"\\nearrow","↖":"\\nwarrow","↕":"\\updownarrow","↔":"\\leftrightarrow","↓":"\\downarrow","→":"\\rightarrow","↑":"\\uparrow","←":"\\leftarrow","|||":"\\left|||\\right.","||":"\\left||\\right.","|":"\\left|\\right.","⫾":"","⫽":"//","⫻":"///","⫺":"","⫹":"","⫸":"","⫷":"","⫶":"\\vdots","⫵":"","⫴":"","⫳":"","⫲":"\\nparallel","⫱":"","⫰":"","⫯":"","⫮":"\\bcancel{\\mid}","⫭":"","⫬":"","⫫":"","⫪":"","⫩":"","⫨":"\\underline{\\perp}","⫧":"\\overline{\\top}","⫦":"","⫥":"","⫤":"","⫣":"","⫢":"","⫡":"","⫠":"\\perp","⫟":"\\top","⫞":"\\dashv","⫝̸":"","⫝":"","⫛":"\\pitchfork","⫚":"","⫙":"","⫘":"","⫗":"","⫖":"","⫕":"","⫔":"","⫓":"","⫒":"","⫑":"","⫐":"","⫏":"","⫎":"","⫍":"","⫌":"\\underset{\\neq}{\\supset}","⫋":"\\underset{\\neq}{\\subset}","⫊":"\\underset{\\approx}{\\supset}","⫉":"\\underset{\\approx}{\\subset}","⫈":"\\underset{\\sim}{\\supset}","⫇":"\\underset{\\sim}{\\subset}","⫆":"\\supseteqq","⫅":"\\subseteqq","⫄":"\\dot{\\supseteq}","⫃":"\\dot{\\subseteq}","⫂":"\\underset{\\times}{\\supset}","⫁":"\\underset{\\times}{\\subset}","⫀":"\\underset{+}{\\supset}","⪿":"\\underset{+}{\\subset}","⪾":"","⪽":"","⪼":"\\gg ","⪻":"\\ll","⪺":"\\underset{\\cancel{\\approx}}{\\succ}","⪹":"\\underset{\\cancel{\\approx}}{\\prec}","⪸":"\\underset{\\approx}{\\succ}","⪷":"\\underset{\\approx}{\\prec}","⪶":"\\underset{\\cancel{=}}{\\succ}","⪵":"\\underset{\\cancel{=}}{\\prec}","⪴":"\\underset{=}{\\succ}","⪳":"\\underset{=}{\\prec}","⪲":"","⪱":"","⪮":"","⪭":"\\underline{\\hcancel{>}}","⪬":"\\underline{\\hcancel{>}}","⪫":"\\hcancel{>}","⪪":"\\hcancel{<}","⪩":"","⪨":"","⪧":"\\vartriangleright","⪦":"\\vartriangleleft","⪥":"><","⪤":"><","⪣":"\\underline{\\ll}","⪢̸":"\\cancel{\\gg}","⪢":"\\gg","⪡̸":"\\cancel{\\ll}","⪡":"\\ll","⪠":"\\overset{\\sim}{\\geqq}","⪟":"\\overset{\\sim}{\\leqq}","⪞":"\\overset{\\sim}{>}","⪝":"\\overset{\\sim}{<}","⪜":"","⪛":"","⪚":"\\overset{=}{>}","⪙":"\\overset{=}{<}","⪘":"","⪗":"","⪖":"","⪕":"","⪔":"","⪓":"","⪒":"\\underset{=}{\\gtrless}","⪑":"\\underset{=}{\\lessgtr}","⪐":"\\underset{<}{\\gtrsim}","⪏":"\\underset{>}{\\lesssim}","⪎":"\\underset{\\simeq}{>}","⪍":"\\underset{\\simeq}{<}","⪌":"\\gtreqqless","⪋":"\\lesseqqgtr","⪊":"\\underset{\\cancel{\\approx}}{>}","⪉":"\\underset{\\approx}{<}","⪆":"\\underset{\\approx}{>}","⪅":"\\underset{\\approx}{<}","⪄":"","⪃":"","⪂":"","⪁":"","⪀":"","⩿":"","⩾̸":"\\bcancel{\\geq}","⩾":"\\geq","⩽̸":"\\bcancel{\\leq}","⩽":"\\leq","⩼":"","⩻":"","⩺":"","⩹":"","⩸":"\\overset{\\dots}{\\equiv}","⩷":"","⩶":"===","⩵":"==","⩴":"::=","⩳":"","⩲":"\\underset{=}{+}","⩱":"\\overset{=}{+}","⩰":"\\overset{\\approx}{=}","⩯":"\\overset{\\wedge}{=}","⩮":"\\overset{*}{=}","⩭":"\\dot{\\approx}","⩬":"","⩫":"","⩪":"\\dot{\\sim}","⩩":"","⩨":"","⩧":"\\dot{\\equiv}","⩦":"\\underset{\\cdot}{=}","⩥":"","⩤":"","⩣":"\\underset{=}{\\vee}","⩢":"\\overset{=}{\\vee}","⩡":"ul(vv)","⩠":"\\underset{=}{\\wedge}","⩟":"\\underline{\\wedge}","⩞":"\\overset{=}{\\wedge}","⩝":"\\hcancel{\\vee}","⩜":"\\hcancel{\\wedge}","⩛":"","⩚":"","⩙":"","⩘":"\\vee","⩗":"\\wedge","⩖":"","⩕":"","⩔":"","⩓":"","⩒":"\\dot{\\vee}","⩑":"\\dot{\\wedge}","⩐":"","⩏":"","⩎":"","⩍":"\\overline{\\cap}","⩌":"\\overline{\\cup}","⩋":"","⩊":"","⩉":"","⩈":"","⩇":"","⩆":"","⩅":"","⩄":"","⩃":"\\overline{\\cap}","⩂":"\\overline{\\cup}","⩁":"","⩀":"","⨾":"","⨽":"\\llcorner","⨼":"\\lrcorner","⨻":"","⨺":"","⨹":"","⨸":"","⨷":"","⨶":"\\hat{\\otimes}","⨵":"","⨴":"","⨳":"","⨲":"\\underline{\\times}","⨱":"\\underline{\\times}","⨰":"\\dot{\\times}","⨮":"","⨭":"","⨬":"","⨫":"","⨪":"","⨩":"","⨨":"","⨧":"","⨦":"\\underset{\\sim}{+}","⨥":"\\underset{\\circ}{+}","⨤":"\\overset{\\sim}{+}","⨣":"\\hat{+}","⨢":"\\dot{+}","⨡":"\\upharpoonright","⨠":">>","⨟":"","⨞":"\\triangleleft","⨝":"\\bowtie","⧿":"","⧾":"+","⧻":"\\hcancel{|||}","⧺":"\\hcancel{||}","⧹":"\\backslash","⧸":"/","⧷":"hcancel{\backslash}","⧶":"","⧵":"\\backslash","⧲":"\\Phi","⧱":"","⧰":"","⧮":"","⧭":"","⧬":"","⧫":"\\lozenge","⧪":"","⧩":"","⧨":"","⧧":"\\ddagger","⧢":"\\sqcup\\sqcup","⧡":"","⧠":"\\square","⧞":"","⧝":"","⧜":"","⧛":"\\{\\{","⧙":"\\{","⧘":"\\}","⧗":"","⧖":"","⧕":"\\bowtie","⧔":"\\bowtie","⧓":"\\bowtie","⧒":"\\bowtie","⧑":"\\bowtie","⧐̸":"| \\not\\triangleright","⧐":"| \\triangleright","⧏̸":"\\not\\triangleleft |","⧏":"\\triangleleft |","⧎":"","⧍":"\\triangle","⧌":"","⧋":"\\underline{\\triangle}","⧊":"\\dot{\\triangle}","⧉":"","⧈":"\\boxed{\\circ}","⧇":"\\boxed{\\circ}","⧆":"\\boxed{\\rightarrow}","⧅":"\\bcancel{\\square}","⧄":"\\cancel{\\square}","⧃":"\\odot","⧂":"\\odot","⦿":"\\odot","⦾":"\\odot","⦽":"\\varnothing","⦼":"\\oplus","⦻":"\\otimes","⦺":"","⦹":"\\varnothing","⦸":"\\varnothing","⦷":"\\ominus","⦶":"\\ominus","⦵":"\\ominus","⦴":"\\vec{\\varnothing}","⦳":"\\vec{\\varnothing}","⦲":"\\dot{\\varnothing}","⦱":"\\overline{\\varnothing}","⦰":"\\varnothing","⦯":"","⦮":"","⦭":"","⦬":"","⦫":"","⦪":"","⦩":"","⦨":"","⦧":"","⦦":"","⦥":"","⦤":"","⦣":"","⦢":"","⦡":"\\not\\lor","⦠":"\\bcancel{>}","⦂":":","⦁":"\\circ","❘":"|","▲":"\\bigtriangleup","⋿":"\\Epsilon","⋾":"\\overline{\\ni}","⋽":"\\overline{\\ni}","⋼":"\\in","⋻":"\\in","⋺":"\\in","⋹":"\\underline{\\in}","⋸":"\\underline{\\in}","⋷":"\\overline{\\in}","⋶":"\\overline{\\in}","⋵":"\\dot{\\in}","⋴":"\\in","⋳":"\\in","⋲":"\\in","⋰":"\\ddots","⋩":"\\underset{\\sim}{\\succ}","⋨":"\\underset{\\sim}{\\prec}","⋧":"\\underset{\\not\\sim}{>}","⋦":"\\underset{\\not\\sim}{<}","⋥":"\\not\\sqsupseteq","⋤":"\\not\\sqsubseteq","⋣":"\\not\\sqsupseteq","⋢":"\\not\\sqsubseteq","⋡":"\\nsucc","⋠":"\\nprec","⋟":"\\succ","⋞":"\\prec","⋝":"\\overline{>}","⋜":"\\overline{<}","⋛":"\\underset{>}{\\leq}","⋚":"\\underset{<}{\\geq}","⋕":"\\#","⋓":"\\cup","⋒":"\\cap","⋑":"\\supset","⋐":"\\subset","⋏":"\\wedge","⋎":"\\vee","⋍":"\\simeq","⋈":"\\bowtie","⋇":"\\ast","⋆":"\\star","⋄":"\\diamond","⊿":"\\triangle","⊾":"\\measuredangle","⊽":"\\overline{\\lor}","⊼":"\\overline{\\land}","⊻":"\\underline{\\lor}","⊺":"\\top","⊹":"","⊷":"\\circ\\multimap","⊶":"\\circ\\multimap","⊳":"\\triangleright","⊲":"\\triangleleft","⊱":"\\succ","⊰":"\\prec","⊫":"|\\models","⊪":"|\\models","⊧":"\\models","⊦":"\\vdash","⊝":"\\ominus","⊜":"\\ominus","⊛":"\\odot","⊚":"\\odot","⊔":"\\sqcup","⊓":"\\sqcap","⊒":"\\sqsupseteq","⊑":"\\sqsubseteq","⊐̸":"\\not\\sqsupset","⊐":"\\sqsupset","⊏̸":"\\not\\sqsubset","⊏":"\\sqsubset","⊎":"\\cup","⊍":"\\cup","⊌":"\\cup","≿̸":"\\not\\succsim","≿":"\\succsim","≾":"\\precsim","≹":"\\not\\overset{>}{<}","≸":"\\not\\overset{>}{<}","≷":"\\overset{>}{<}","≶":"\\overset{<}{>}","≵":"\\not\\geg","≴":"\\not\\leq","≳":"\\geg","≲":"\\leq","≬":"","≧":"\\geg","≦̸":"\\not\\leq","≦":"\\leq","≣":"\\overset{=}{=} ","≞":"\\overset{m}{=} ","≝":"\\overset{def}{=}","≘":"=","≖":"=","≕":"=:","≓":"\\doteq","≒":"\\doteq","≑":"\\doteq","≐":"\\doteq","≏̸":"","≏":"","≎̸":"","≎":"","≌":"\\approx","≋":"\\approx","≊":"\\approx","≂̸":"\\neq","≂":"=","∿":"\\sim","∾":"\\infty","∽̱":"\\sim","∽":"\\sim","∻":"\\sim","∺":":-:","∹":"-:","∸":"\\bot","∷":"::","∶":":","∣":"|","∟":"\\llcorner","∙":"\\cdot","∘":"\\circ","∗":"*","∕":"/","∎":"\\square","∍":"\\ni","∊":"\\in","∆":"\\Delta","⁄":"/","⪰̸":"\\nsucceq","⪰":"\\succeq","⪯̸":"\\npreceq","⪯":"\\preceq","⪈":"\\ngeqslant","⪇":"\\nleqslant","⧳":"\\Phi","⧦":"\\models","⧥":"\\not\\equiv","⧤":"\\approx\\neq","⧣":"\\neq","⧁":"\\circle","⧀":"\\circle","◦":"\\circle","◗":"\\circle","◖":"\\circle","●":"\\circle","◎":"\\circledcirc","◍":"\\circledcirc","◌":"\\circledcirc","◉":"\\circledcirc","◈":"\\diamond","◇":"\\diamond","◆":"\\diamond","◅":"\\triangleleft","◄":"\\triangleleft","◃":"\\triangleleft","◂":"\\triangleleft","◁":"\\triangleleft","◀":"\\triangleleft","▿":"\\triangledown","▾":"\\triangledown","▽":"\\triangledown","▼":"\\triangledown","▹":"\\triangleright","▸":"\\triangleright","▷":"\\triangleright","▶":"\\triangleright","▵":"\\triangle","▴":"\\triangle","△":"\\triangle","▱":"\\square","▰":"\\square","▯":"\\square","▮":"\\square","▭":"\\square","▫":"\\square","▪":"\\square","□":"\\square","■":"\\square","⋭":"\\not\\triangleright","⋬":"\\not\\triangleleft","⋫":"\\not\\triangleright","⋪":"\\not\\triangleleft","⋙":"\\ggg","⋘":"\\lll","⋗":"*>","⋖":"<*","⋔":"\\pitchfork","⋌":"","⋋":"","⋊":"\\rtimes","⋉":"\\ltimes","⊵":"\\triangleright","⊴":"","⊥":"\\bot","⊁":"\\nsucc","⊀":"\\preceq","≽":"\\succeq","≼":"\\preceq","≻":"\\succ","≺":"\\prec","≱":"\\geq/","≰":"\\leq/","≭":"\\neq","≫̸":"\\not\\gg","≫":"\\gg","≪̸":"\\not\\ll","≪":"\\ll","≩":"\\ngeqslant","≨":"\\nleqslant","≡":"\\equiv","≟":"\\doteq","≜":"\\triangleq","≛":"\\doteq","≚":"\\triangleq","≙":"\\triangleq","≗":"\\doteq","≔":":=","≍":"\\asymp","≇":"\\ncong","≆":"\\ncong","≅":"\\cong","≄":"\\not\\simeq","≃":"\\simeq","≁":"\\not\\sim","∦":"\\not\\parallel","∥":"\\parallel","∤":"\\not|","∝":"\\propto","==":"==","=":"=",":=":":=","/=":"=","-=":"-=","+=":"+=","*=":"*=","!=":"!=","≠":"\\neq","≢":"\\equiv /","≉":"\\approx /","∼":"sim","≈":"\\approx","≮":"/",">=":">=",">":">","≥":"\\geq","≤":"\\leq","<=":"<=","⊋":"\\supsetneq","⊊":"\\subsetneq","⊉":"\\nsupseteq","⊈":"\\nsubseteq","⊇":"\\supseteq","⊆":"\\subseteq","⊅":"\\not\\supset","⊄":"\\not\\subset","⊃⃒":"\\supset |","⊃":"\\supset","⊂⃒":"\\subset |","⊂":"\\subset","∌":"\\not\\in","∉":"\\notin","∈":"\\in","∁":"C","∄":"\\nexists","∃":"\\exists","∀":"\\forall","∧":"\\land","&&":"\\&\\&","∨":"\\lor","⊯":"\\cancel{\\vDash}","⊮":"\\cancel{\\Vdash}","⊭":"\\nvDash","⊬":"\\nvDash","⊩":"\\Vdash","⊨":"\\vDash","⊤":"\\top","⊣":"\\dashv","⊢":"\\vdash","∋":"\\ni","⋱":"\\ddots","⋯":"\\hdots","⋮":"\\vdots","…":"\\hdots","϶":"\\ni",":":":","...":"\\cdots","..":"..","->":"->","∵":"\\because","∴":"\\therefore ","⁣":"",",":",",";":";","⧽":"\\}","⧼":"\\{","⦘":"\\]","⦗":"\\[","⦖":"\\ll","⦕":"\\gg","⦔":"\\gg","⦓":"\\ll","⦒":"\\gg","⦑":"\\ll","⦐":"\\]","⦏":"\\]","⦎":"\\]","⦍":"\\[","⦌":"\\[","⦋":"\\]","⦊":"\\triangleright","⦉":"\\triangleleft","⦈":"|\\)","⦇":"\\(|","⦆":"|\\)","⦅":"\\(\\(","⦄":"|\\}","⦃":"\\{|","⦀":"\\||","⟯":"\\left. \\right]","⟮":"\\left[ \\right.","⟭":"\\left. \\right]]","⟬":"\\left[[ \\right.","⟫":"\\gg","⟪":"\\ll","⟩":"\\rangle","⟨":"\\langle","⟧":"\\left. \\right]]","⟦":"\\left[[ \\right.","❳":"\\left.\\right)","❲":"\\left(\\right.","〉":"\\rangle","〈":"\\langle","⌋":"\\rfloor","⌊":"\\lfloor","⌉":"\\rceil","⌈":"\\lceil","‖":"\\parallel","}":"\\left.\\right}","{":"\\left{\\right.","]":"\\left]\\right.","[":"\\left[\\right.",")":"\\left.\\right)","(":"\\left(\\right.","”":'"',"“":"``","’":"'","‘":"`","%CE%B1":"\\alpha","%CE%B2":"\\beta","%CE%B3":"\\gamma","%CE%93":"\\Gamma","%CE%B4":"\\delta","%CE%94":"\\Delta","%CF%B5":"\\epsilon","%CE%B6":"\\zeta","%CE%B7":"\\eta","%CE%B8":"\\theta","%CE%98":"\\Theta","%CE%B9":"\\iota","%CE%BA":"\\kappa","%CE%BB":"\\lambda","%CE%BC":"\\mu","%CE%BD":"\\nu","%CE%BF":"\\omicron","%CF%80":"\\pi","%CE%A0":"\\Pi","%CF%81":"\\pho","%CF%83":"\\sigma","%CE%A3":"\\Sigma","%CF%84":"\\tau","%CF%85":"\\upsilon","%CE%A5":"\\Upsilon","%CF%95":"\\phi","%CE%A6":"\\Phi","%CF%87":"\\chi","%CF%88":"\\psi","%CE%A8":"\\Psi","%CF%89":"\\omega","%CE%A9":"\\Omega"}},9473:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.allMathOperatorsByGlyph=void 0,t.allMathOperatorsByGlyph={_:"\\underline","⏡":"\\underbrace","⏠":"\\overbrace","⏟":"\\underbrace","⏞":"\\overbrace","⏝":"\\underbrace","⏜":"\\overbrace","⎵":"\\underbrace","⎴":"\\overbrace","⃜":"\\square","⃛":"\\square","⁤":"","⁗":"''''","‾":"\\bar","‷":"```","‶":"``","‵":"`","‴":"'''","″":"''","‟":"``","„":",,","‛":"`","‚":",","^":"\\hat","˷":"\\sim","˝":"\\sim","˜":"\\sim","˚":"\\circ","˙":"\\cdot","˘":"",ˍ:"\\_",ˋ:"ˋ",ˊ:"ˊ",ˉ:"ˉ",ˇ:"",ˆ:"\\hat",º:"o","¹":"1","¸":"¸","´":"´","³":"3","²":"2","°":"\\circ","¯":"\\bar",ª:"a","¨":"\\cdot\\cdot","~":"\\sim","`":"`","--":"--","++":"++","&":"\\&","∜":"\\sqrt[4]{}","∛":"\\sqrt[3]{}","√":"\\sqrt{}",ⅆ:"d",ⅅ:"\\mathbb{D}","?":"?","@":"@","//":"//","!!":"!!","!":"!","♯":"\\#","♮":"","♭":"","′":"'","<>":"<>","**":"\\star\\star","∇":"\\nabla","∂":"\\partial","⊙":"\\bigodot","¬":"\\neg","∢":"\\measuredangle","∡":"\\measuredangle","∠":"\\angle","÷":"\\div","/":"/","∖":"\\backslash","\\":"\\backslash","%":"\\%","⊗":"\\bigotimes","·":"\\cdot","⨿":"\\coprod","⨯":"\\times","⋅":"\\cdot","⊡":"\\boxdot","⊠":"\\boxtimes","⁢":"","⁃":"-","•":"\\cdot","×":"\\times",".":".","*":"\\star","∪":"\\cup","∩":"\\cap","∐":"\\coprod","∏":"\\prod","≀":"","⫿":"","⫼":"\\mid\\mid\\mid","⨉":"\\times","⨈":"","⨇":"","⨆":"\\sqcup","⨅":"\\sqcap","⨂":"\\otimes","⨀":"\\odot","⋂":"\\cap","⋁":"\\vee","⋀":"\\wedge","⨄":"\\uplus","⨃":"\\cup","⋃":"\\cup","⨜":"\\underline{\\int}","⨛":"\\overline{\\int}","⨚":"\\int","⨙":"\\int","⨘":"\\int","⨗":"\\int","⨖":"\\oint","⨕":"\\oint","⨔":"\\int","⨓":"\\int","⨒":"\\int","⨑":"\\int","⨐":"\\int","⨏":"\\bcancel{\\int}","⨎":"","⨍":"\\hcancel{\\int}","⨌":"\\iiiint","∳":"\\oint","∲":"\\oint","∱":"\\int","∰":"\\oiint","∯":"\\oiint","∮":"\\oint","∫":"\\int","⨁":"\\oplus","⊘":"\\oslash","⊖":"\\ominus","⊕":"\\oplus","∭":"\\iiint","∬":"\\iint","⨋":"","⨊":"","∑":"\\sum","⊟":"\\boxminus","⊞":"\\boxplus","∔":"\\dot{+}","∓":"+-","−":"-","±":"\\pm","-":"-","+":"+","⭆":"\\Rrightarrow","⭅":"\\Lleftarrow","⧴":":\\rightarrow","⧯":"","⧟":"\\bullet-\\bullet","⦟":"\\angle","⦞":"\\measuredangle","⦝":"\\measuredangle","⦜":"\\perp","⦛":"\\measuredangle","⦚":"","⦙":"\\vdots","⥿":"","⥾":"","⥽":"\\prec","⥼":"\\succ","⥻":"\\underset{\\rightarrow}{\\supset}","⥺":"","⥹":"\\underset{\\rightarrow}{\\subset}","⥸":"\\underset{\\rightarrow}{>}","⥷":"","⥶":"\\underset{\\leftarrow}{<}","⥵":"\\underset{\\approx}{\\rightarrow}","⥴":"\\underset{\\sim}{\\rightarrow}","⥳":"\\underset{\\sim}{\\leftarrow}","⥲":"\\overset{\\sim}{\\rightarrow}","⥱":"\\overset{=}{\\rightarrow}","⥰":"","⥯":"","⥮":"","⥭":"\\overline{\\rightharpoondown}","⥬":"\\underline{\\rightharpoonup}","⥫":"\\overline{\\leftharpoondown}","⥪":"\\underline{\\leftharpoonup}","⥩":"\\rightleftharpoons","⥨":"\\rightleftharpoons","⥧":"\\rightleftharpoons","⥦":"\\rightleftharpoons","⥥":"\\Downarrow","⥤":"\\Rightarrow","⥣":"\\Uparrow","⥢":"\\Leftarrow","⥡":"\\downarrow","⥠":"\\uparrow","⥟":"\\rightarrow","⥞":"\\leftarrow","⥝":"\\downarrow","⥜":"\\uparrow","⥛":"\\rightarrow","⥚":"\\leftarrow","⥙":"\\downarrow","⥘":"\\uparrow","⥗":"\\rightarrow","⥖":"\\leftarrow","⥕":"\\downarrow","⥔":"\\uparrow","⥓":"\\rightarrow","⥒":"\\leftarrow","⥑":"\\updownarrow","⥐":"\\leftrightarrow","⥏":"\\updownarrow","⥎":"\\leftrightarrow","⥍":"\\updownarrow","⥌":"\\updownarrow","⥋":"\\leftrightarrow","⥊":"\\leftrightarrow","⥉":"","⥈":"\\leftrightarrow","⥇":"\\nrightarrow","⥆":"","⥅":"","⥄":"\\rightleftarrows","⥃":"\\leftrightarrows","⥂":"\\rightleftarrows","⥁":"\\circlearrowright","⥀":"\\circlearrowleft","⤿":"\\rightarrow","⤾":"\\leftarrow","⤽":"","⤼":"","⤻":"","⤺":"","⤹":"","⤸":"","⤷":"\\Rsh","⤶":"\\Lsh","⤵":"\\downarrow","⤴":"\\uparrow","⤳":"\\leadsto","⤲":"","⤱":"","⤰":"","⤯":"","⤮":"","⤭":"","⤬":"\\times","⤫":"\\times","⤪":"","⤩":"","⤨":"","⤧":"","⤦":"","⤥":"","⤤":"","⤣":"","⤢":"","⤡":"","⤠":"\\mapsto\\cdot","⤟":"\\cdot\\leftarrow","⤞":"\\rightarrow\\cdot","⤝":"\\leftarrow","⤜":"\\rightarrow","⤛":"\\leftarrow","⤚":"\\rightarrow","⤙":"\\leftarrow","⤘":"\\rightarrow","⤗":"\\rightarrow","⤖":"\\rightarrow","⤕":"\\rightarrow","⤔":"\\rightarrow","⤓":"\\downarrow","⤒":"\\uparrow","⤑":"\\rightarrow","⤐":"\\rightarrow","⤏":"\\rightarrow","⤎":"\\leftarrow","⤍":"\\rightarrow","⤌":"\\leftarrow","⤋":"\\Downarrow","⤊":"\\Uparrow","⤉":"\\uparrow","⤈":"\\downarrow","⤇":"\\Rightarrow","⤆":"\\Leftarrow","⤅":"\\mapsto","⤄":"\\nLeftrightarrow","⤃":"\\nRightarrow","⤂":"\\nLeftarrow","⤁":"\\rightsquigarrow","⤀":"\\rightsquigarrow","⟿":"\\rightsquigarrow","⟾":"\\Rightarrow","⟽":"\\Leftarrow","⟼":"\\mapsto","⟻":"\\leftarrow","⟺":"\\Longleftrightarrow","⟹":"\\Longrightarrow","⟸":"\\Longleftarrow","⟷":"\\leftrightarrow","⟶":"\\rightarrow","⟵":"\\leftarrow","⟱":"\\Downarrow","⟰":"\\Uparrow","⊸":"\\rightarrow","⇿":"\\leftrightarrow","⇾":"\\rightarrow","⇽":"\\leftarrow","⇼":"\\nleftrightarrow","⇻":"\\nrightarrow","⇺":"\\nleftarrow","⇹":"\\nleftrightarrow","⇸":"\\nrightarrow","⇷":"\\nleftarrow","⇶":"\\Rrightarrow","⇵":"","⇴":"\\rightarrow","⇳":"\\Updownarrow","⇲":"\\searrow","⇱":"\\nwarrow","⇰":"\\Leftarrow","⇯":"\\Uparrow","⇮":"\\Uparrow","⇭":"\\Uparrow","⇬":"\\Uparrow","⇫":"\\Uparrow","⇪":"\\Uparrow","⇩":"\\Downarrow","⇨":"\\Rightarrow","⇧":"\\Uparrow","⇦":"\\Leftarrow","⇥":"\\rightarrow","⇤":"\\leftarrow","⇣":"\\downarrow","⇢":"\\rightarrow","⇡":"\\uparrow","⇠":"\\leftarrow","⇟":"\\downarrow","⇞":"\\uparrow","⇝":"\\rightsquigarrow","⇜":"\\leftarrow","⇛":"\\Rrightarrow","⇚":"\\Lleftarrow","⇙":"\\swarrow","⇘":"\\searrow","⇗":"\\nearrow","⇖":"\\nwarrow","⇕":"\\Updownarrow","⇔":"\\Leftrightarrow","⇓":"\\Downarrow","⇒":"\\Rightarrow","⇑":"\\Uparrow","⇐":"\\Leftarrow","⇏":"\\nRightarrow","⇎":"\\nLeftrightarrow","⇍":"\\nLeftarrow","⇌":"\\rightleftharpoons","⇋":"\\leftrightharpoons","⇊":"\\downdownarrows","⇉":"\\rightrightarrows","⇈":"\\upuparrows","⇇":"\\leftleftarrows","⇆":"\\leftrightarrows","⇅":"","⇄":"\\rightleftarrows","⇃":"\\downharpoonleft","⇂":"\\downharpoonright","⇁":"\\rightharpoondown","⇀":"\\rightharpoonup","↿":"\\upharpoonleft","↾":"\\upharpoonright","↽":"\\leftharpoondown","↼":"\\leftharpoonup","↻":"\\circlearrowright","↺":"\\circlearrowleft","↹":"\\leftrightarrows","↸":"\\overline{\\nwarrow}","↷":"\\curvearrowright","↶":"\\curvearrowleft","↵":"\\swarrow","↴":"\\searrow","↳":"\\Rsh","↲":"\\Lsh","↱":"\\Rsh","↰":"\\Lsh","↯":"\\swarrow","↮":"","↭":"\\leftrightsquigarrow","↬":"\\looparrowright","↫":"\\looparrowleft","↪":"\\hookrightarrow","↩":"\\hookleftarrow","↨":"\\underline{\\updownarrow}","↧":"\\downarrow","↦":"\\rightarrowtail","↥":"\\uparrow","↤":"\\leftarrowtail","↣":"\\rightarrowtail","↢":"\\leftarrowtail","↡":"\\downarrow","↠":"\\twoheadrightarrow","↟":"\\uparrow","↞":"\\twoheadleftarrow","↝":"\\nearrow","↜":"\\nwarrow","↛":"","↚":"","↙":"\\swarrow","↘":"\\searrow","↗":"\\nearrow","↖":"\\nwarrow","↕":"\\updownarrow","↔":"\\leftrightarrow","↓":"\\downarrow","→":"\\rightarrow","↑":"\\uparrow","←":"\\leftarrow","|||":"\\left|||\\right.","||":"\\left||\\right.","|":"\\left|\\right.","⫾":"","⫽":"//","⫻":"///","⫺":"","⫹":"","⫸":"","⫷":"","⫶":"\\vdots","⫵":"","⫴":"","⫳":"","⫲":"\\nparallel","⫱":"","⫰":"","⫯":"","⫮":"\\bcancel{\\mid}","⫭":"","⫬":"","⫫":"","⫪":"","⫩":"","⫨":"\\underline{\\perp}","⫧":"\\overline{\\top}","⫦":"","⫥":"","⫤":"","⫣":"","⫢":"","⫡":"","⫠":"\\perp","⫟":"\\top","⫞":"\\dashv","⫝̸":"","⫝":"","⫛":"\\pitchfork","⫚":"","⫙":"","⫘":"","⫗":"","⫖":"","⫕":"","⫔":"","⫓":"","⫒":"","⫑":"","⫐":"","⫏":"","⫎":"","⫍":"","⫌":"\\underset{\\neq}{\\supset}","⫋":"\\underset{\\neq}{\\subset}","⫊":"\\underset{\\approx}{\\supset}","⫉":"\\underset{\\approx}{\\subset}","⫈":"\\underset{\\sim}{\\supset}","⫇":"\\underset{\\sim}{\\subset}","⫆":"\\supseteqq","⫅":"\\subseteqq","⫄":"\\dot{\\supseteq}","⫃":"\\dot{\\subseteq}","⫂":"\\underset{\\times}{\\supset}","⫁":"\\underset{\\times}{\\subset}","⫀":"\\underset{+}{\\supset}","⪿":"\\underset{+}{\\subset}","⪾":"","⪽":"","⪼":"\\gg ","⪻":"\\ll","⪺":"\\underset{\\cancel{\\approx}}{\\succ}","⪹":"\\underset{\\cancel{\\approx}}{\\prec}","⪸":"\\underset{\\approx}{\\succ}","⪷":"\\underset{\\approx}{\\prec}","⪶":"\\underset{\\cancel{=}}{\\succ}","⪵":"\\underset{\\cancel{=}}{\\prec}","⪴":"\\underset{=}{\\succ}","⪳":"\\underset{=}{\\prec}","⪲":"","⪱":"","⪮":"","⪭":"\\underline{\\hcancel{>}}","⪬":"\\underline{\\hcancel{>}}","⪫":"\\hcancel{>}","⪪":"\\hcancel{<}","⪩":"","⪨":"","⪧":"\\vartriangleright","⪦":"\\vartriangleleft","⪥":"><","⪤":"><","⪣":"\\underline{\\ll}","⪢̸":"\\cancel{\\gg}","⪢":"\\gg","⪡̸":"\\cancel{\\ll}","⪡":"\\ll","⪠":"\\overset{\\sim}{\\geqq}","⪟":"\\overset{\\sim}{\\leqq}","⪞":"\\overset{\\sim}{>}","⪝":"\\overset{\\sim}{<}","⪜":"","⪛":"","⪚":"\\overset{=}{>}","⪙":"\\overset{=}{<}","⪘":"","⪗":"","⪖":"","⪕":"","⪔":"","⪓":"","⪒":"\\underset{=}{\\gtrless}","⪑":"\\underset{=}{\\lessgtr}","⪐":"\\underset{<}{\\gtrsim}","⪏":"\\underset{>}{\\lesssim}","⪎":"\\underset{\\simeq}{>}","⪍":"\\underset{\\simeq}{<}","⪌":"\\gtreqqless","⪋":"\\lesseqqgtr","⪊":"\\underset{\\cancel{\\approx}}{>}","⪉":"\\underset{\\approx}{<}","⪆":"\\underset{\\approx}{>}","⪅":"\\underset{\\approx}{<}","⪄":"","⪃":"","⪂":"","⪁":"","⪀":"","⩿":"","⩾̸":"\\bcancel{\\geq}","⩾":"\\geq","⩽̸":"\\bcancel{\\leq}","⩽":"\\leq","⩼":"","⩻":"","⩺":"","⩹":"","⩸":"\\overset{\\dots}{\\equiv}","⩷":"","⩶":"===","⩵":"==","⩴":"::=","⩳":"","⩲":"\\underset{=}{+}","⩱":"\\overset{=}{+}","⩰":"\\overset{\\approx}{=}","⩯":"\\overset{\\wedge}{=}","⩮":"\\overset{*}{=}","⩭":"\\dot{\\approx}","⩬":"","⩫":"","⩪":"\\dot{\\sim}","⩩":"","⩨":"","⩧":"\\dot{\\equiv}","⩦":"\\underset{\\cdot}{=}","⩥":"","⩤":"","⩣":"\\underset{=}{\\vee}","⩢":"\\overset{=}{\\vee}","⩡":"ul(vv)","⩠":"\\underset{=}{\\wedge}","⩟":"\\underline{\\wedge}","⩞":"\\overset{=}{\\wedge}","⩝":"\\hcancel{\\vee}","⩜":"\\hcancel{\\wedge}","⩛":"","⩚":"","⩙":"","⩘":"\\vee","⩗":"\\wedge","⩖":"","⩕":"","⩔":"","⩓":"","⩒":"\\dot{\\vee}","⩑":"\\dot{\\wedge}","⩐":"","⩏":"","⩎":"","⩍":"\\overline{\\cap}","⩌":"\\overline{\\cup}","⩋":"","⩊":"","⩉":"","⩈":"","⩇":"","⩆":"","⩅":"","⩄":"","⩃":"\\overline{\\cap}","⩂":"\\overline{\\cup}","⩁":"","⩀":"","⨾":"","⨽":"\\llcorner","⨼":"\\lrcorner","⨻":"","⨺":"","⨹":"","⨸":"","⨷":"","⨶":"\\hat{\\otimes}","⨵":"","⨴":"","⨳":"","⨲":"\\underline{\\times}","⨱":"\\underline{\\times}","⨰":"\\dot{\\times}","⨮":"","⨭":"","⨬":"","⨫":"","⨪":"","⨩":"","⨨":"","⨧":"","⨦":"\\underset{\\sim}{+}","⨥":"\\underset{\\circ}{+}","⨤":"\\overset{\\sim}{+}","⨣":"\\hat{+}","⨢":"\\dot{+}","⨡":"\\upharpoonright","⨠":">>","⨟":"","⨞":"\\triangleleft","⨝":"\\bowtie","⧿":"","⧾":"+","⧻":"\\hcancel{|||}","⧺":"\\hcancel{||}","⧹":"\\backslash","⧸":"/","⧷":"hcancel{\backslash}","⧶":"","⧵":"\\backslash","⧲":"\\Phi","⧱":"","⧰":"","⧮":"","⧭":"","⧬":"","⧫":"\\lozenge","⧪":"","⧩":"","⧨":"","⧧":"\\ddagger","⧢":"\\sqcup\\sqcup","⧡":"","⧠":"\\square","⧞":"","⧝":"","⧜":"","⧛":"\\{\\{","⧙":"\\{","⧘":"\\}","⧗":"","⧖":"","⧕":"\\bowtie","⧔":"\\bowtie","⧓":"\\bowtie","⧒":"\\bowtie","⧑":"\\bowtie","⧐̸":"| \\not\\triangleright","⧐":"| \\triangleright","⧏̸":"\\not\\triangleleft |","⧏":"\\triangleleft |","⧎":"","⧍":"\\triangle","⧌":"","⧋":"\\underline{\\triangle}","⧊":"\\dot{\\triangle}","⧉":"","⧈":"\\boxed{\\circ}","⧇":"\\boxed{\\circ}","⧆":"\\boxed{\\rightarrow}","⧅":"\\bcancel{\\square}","⧄":"\\cancel{\\square}","⧃":"\\odot","⧂":"\\odot","⦿":"\\odot","⦾":"\\odot","⦽":"\\varnothing","⦼":"\\oplus","⦻":"\\otimes","⦺":"","⦹":"\\varnothing","⦸":"\\varnothing","⦷":"\\ominus","⦶":"\\ominus","⦵":"\\ominus","⦴":"\\vec{\\varnothing}","⦳":"\\vec{\\varnothing}","⦲":"\\dot{\\varnothing}","⦱":"\\overline{\\varnothing}","⦰":"\\varnothing","⦯":"","⦮":"","⦭":"","⦬":"","⦫":"","⦪":"","⦩":"","⦨":"","⦧":"","⦦":"","⦥":"","⦤":"","⦣":"","⦢":"","⦡":"\\not\\lor","⦠":"\\bcancel{>}","⦂":":","⦁":"\\circ","❘":"|","▲":"\\bigtriangleup","⋿":"\\Epsilon","⋾":"\\overline{\\ni}","⋽":"\\overline{\\ni}","⋼":"\\in","⋻":"\\in","⋺":"\\in","⋹":"\\underline{\\in}","⋸":"\\underline{\\in}","⋷":"\\overline{\\in}","⋶":"\\overline{\\in}","⋵":"\\dot{\\in}","⋴":"\\in","⋳":"\\in","⋲":"\\in","⋰":"\\ddots","⋩":"\\underset{\\sim}{\\succ}","⋨":"\\underset{\\sim}{\\prec}","⋧":"\\underset{\\not\\sim}{>}","⋦":"\\underset{\\not\\sim}{<}","⋥":"\\not\\sqsupseteq","⋤":"\\not\\sqsubseteq","⋣":"\\not\\sqsupseteq","⋢":"\\not\\sqsubseteq","⋡":"\\nsucc","⋠":"\\nprec","⋟":"\\succ","⋞":"\\prec","⋝":"\\overline{>}","⋜":"\\overline{<}","⋛":"\\underset{>}{\\leq}","⋚":"\\underset{<}{\\geq}","⋕":"\\#","⋓":"\\cup","⋒":"\\cap","⋑":"\\supset","⋐":"\\subset","⋏":"\\wedge","⋎":"\\vee","⋍":"\\simeq","⋈":"\\bowtie","⋇":"\\ast","⋆":"\\star","⋄":"\\diamond","⊿":"\\triangle","⊾":"\\measuredangle","⊽":"\\overline{\\lor}","⊼":"\\overline{\\land}","⊻":"\\underline{\\lor}","⊺":"\\top","⊹":"","⊷":"\\circ\\multimap","⊶":"\\circ\\multimap","⊳":"\\triangleright","⊲":"\\triangleleft","⊱":"\\succ","⊰":"\\prec","⊫":"|\\models","⊪":"|\\models","⊧":"\\models","⊦":"\\vdash","⊝":"\\ominus","⊜":"\\ominus","⊛":"\\odot","⊚":"\\odot","⊔":"\\sqcup","⊓":"\\sqcap","⊒":"\\sqsupseteq","⊑":"\\sqsubseteq","⊐̸":"\\not\\sqsupset","⊐":"\\sqsupset","⊏̸":"\\not\\sqsubset","⊏":"\\sqsubset","⊎":"\\cup","⊍":"\\cup","⊌":"\\cup","≿̸":"\\not\\succsim","≿":"\\succsim","≾":"\\precsim","≹":"\\not\\overset{>}{<}","≸":"\\not\\overset{>}{<}","≷":"\\overset{>}{<}","≶":"\\overset{<}{>}","≵":"\\not\\geg","≴":"\\not\\leq","≳":"\\geg","≲":"\\leq","≬":"","≧":"\\geg","≦̸":"\\not\\leq","≦":"\\leq","≣":"\\overset{=}{=} ","≞":"\\overset{m}{=} ","≝":"\\overset{def}{=}","≘":"=","≖":"=","≕":"=:","≓":"\\doteq","≒":"\\doteq","≑":"\\doteq","≐":"\\doteq","≏̸":"","≏":"","≎̸":"","≎":"","≌":"\\approx","≋":"\\approx","≊":"\\approx","≂̸":"\\neq","≂":"=","∿":"\\sim","∾":"\\infty","∽̱":"\\sim","∽":"\\sim","∻":"\\sim","∺":":-:","∹":"-:","∸":"\\bot","∷":"::","∶":":","∣":"|","∟":"\\llcorner","∙":"\\cdot","∘":"\\circ","∗":"*","∕":"/","∎":"\\square","∍":"\\ni","∊":"\\in","∆":"\\Delta","⁄":"/","⪰̸":"\\nsucceq","⪰":"\\succeq","⪯̸":"\\npreceq","⪯":"\\preceq","⪈":"\\ngeqslant","⪇":"\\nleqslant","⧳":"\\Phi","⧦":"\\models","⧥":"\\not\\equiv","⧤":"\\approx\\neq","⧣":"\\neq","⧁":"\\circle","⧀":"\\circle","◦":"\\circle","◗":"\\circle","◖":"\\circle","●":"\\circle","◎":"\\circledcirc","◍":"\\circledcirc","◌":"\\circledcirc","◉":"\\circledcirc","◈":"\\diamond","◇":"\\diamond","◆":"\\diamond","◅":"\\triangleleft","◄":"\\triangleleft","◃":"\\triangleleft","◂":"\\triangleleft","◁":"\\triangleleft","◀":"\\triangleleft","▿":"\\triangledown","▾":"\\triangledown","▽":"\\triangledown","▼":"\\triangledown","▹":"\\triangleright","▸":"\\triangleright","▷":"\\triangleright","▶":"\\triangleright","▵":"\\triangle","▴":"\\triangle","△":"\\triangle","▱":"\\square","▰":"\\square","▯":"\\square","▮":"\\square","▭":"\\square","▫":"\\square","▪":"\\square","□":"\\square","■":"\\square","⋭":"\\not\\triangleright","⋬":"\\not\\triangleleft","⋫":"\\not\\triangleright","⋪":"\\not\\triangleleft","⋙":"\\ggg","⋘":"\\lll","⋗":"*>","⋖":"<*","⋔":"\\pitchfork","⋌":"","⋋":"","⋊":"\\rtimes","⋉":"\\ltimes","⊵":"\\triangleright","\\triangleleft":"","⊥":"\\bot","⊁":"\\nsucc","⊀":"\\preceq","≽":"\\succeq","≼":"\\preceq","≻":"\\succ","≺":"\\prec","≱":"\\geq/","≰":"\\leq/","≭":"\\neq","≫̸":"\\not\\gg","≫":"\\gg","≪̸":"\\not\\ll","≪":"\\ll","≩":"\\ngeqslant","≨":"\\nleqslant","≡":"\\equiv","≟":"\\doteq","≜":"\\triangleq","≛":"\\doteq","≚":"\\triangleq","≙":"\\triangleq","≗":"\\doteq","≔":":=","≍":"\\asymp","≇":"\\ncong","≆":"\\ncong","≅":"\\cong","≄":"\\not\\simeq","≃":"\\simeq","≁":"\\not\\sim","∦":"\\not\\parallel","∥":"\\parallel","∤":"\\not|","∝":"\\propto","==":"==","=":"=",":=":":=","/=":"=","-=":"-=","+=":"+=","*=":"*=","!=":"!=","≠":"\\neq","≢":"\\equiv /","≉":"\\approx /","∼":"sim","≈":"\\approx","≮":"/",">=":">=",">":">","≥":"\\geq","≤":"\\leq","<=":"<=","⊋":"\\supsetneq","⊊":"\\subsetneq","⊉":"\\nsupseteq","⊈":"\\nsubseteq","⊇":"\\supseteq","⊆":"\\subseteq","⊅":"\\not\\supset","⊄":"\\not\\subset","⊃⃒":"\\supset |","⊃":"\\supset","⊂⃒":"\\subset |","⊂":"\\subset","∌":"\\not\\in","∉":"\\notin","∈":"\\in","∁":"C","∄":"\\nexists","∃":"\\exists","∀":"\\forall","∧":"\\land","&&":"\\&\\&","∨":"\\lor","⊯":"\\cancel{\\vDash}","⊮":"\\cancel{\\Vdash}","⊭":"\\nvDash","⊬":"\\nvDash","⊩":"\\Vdash","⊨":"\\vDash","⊤":"\\top","⊣":"\\dashv","⊢":"\\vdash","∋":"\\ni","⋱":"\\ddots","⋯":"\\hdots","⋮":"\\vdots","…":"\\hdots","϶":"\\ni",":":":","...":"\\cdots","..":"..","->":"->","∵":"\\because","∴":"\\therefore ","⁣":"",",":",",";":";","⧽":"\\}","⧼":"\\{","⦘":"\\]","⦗":"\\[","⦖":"\\ll","⦕":"\\gg","⦔":"\\gg","⦓":"\\ll","⦒":"\\gg","⦑":"\\ll","⦐":"\\]","⦏":"\\]","⦎":"\\]","⦍":"\\[","⦌":"\\[","⦋":"\\]","⦊":"\\triangleright","⦉":"\\triangleleft","⦈":"|\\)","⦇":"\\(|","⦆":"|\\)","⦅":"\\(\\(","⦄":"|\\}","⦃":"\\{|","⦀":"\\||","⟯":"\\left. \\right]","⟮":"\\left[ \\right.","⟭":"\\left. \\right]]","⟬":"\\left[[ \\right.","⟫":"\\gg","⟪":"\\ll","⟩":"\\rangle","⟨":"\\langle","⟧":"\\left. \\right]]","⟦":"\\left[[ \\right.","❳":"\\left.\\right)","❲":"\\left(\\right.","〉":"\\rangle","〈":"\\langle","⌋":"\\rfloor","⌊":"\\lfloor","⌉":"\\rceil","⌈":"\\lceil","‖":"\\parallel","}":"\\left.\\right}","{":"\\left{\\right.","]":"\\left]\\right.","[":"\\left[\\right.",")":"\\left.\\right)","(":"\\left(\\right.","”":'"',"“":"``","’":"'","‘":"`",α:"\\alpha",β:"\\beta",γ:"\\gamma",Γ:"\\Gamma",δ:"\\delta",Δ:"\\Delta",ϵ:"\\epsilon",ζ:"\\zeta",η:"\\eta",θ:"\\theta",Θ:"\\Theta",ι:"\\iota",κ:"\\kappa",λ:"\\lambda",μ:"\\mu",ν:"\\nu",ο:"\\omicron",π:"\\pi",Π:"\\Pi",ρ:"\\pho",σ:"\\sigma",Σ:"\\Sigma",τ:"\\tau",υ:"\\upsilon",Υ:"\\Upsilon",ϕ:"\\phi",Φ:"\\Phi",χ:"\\chi",ψ:"\\psi",Ψ:"\\Psi",ω:"\\omega",Ω:"\\Omega"}},2836:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.allMathSymbolsByChar=void 0,t.allMathSymbolsByChar={" ":"\\textrm{ }","∃":"\\exists","∀":"\\forall","⇔":"\\iff","⇒":"=>","¬":"\\neg","ℤ":"\\mathbb{Z}","ℝ":"\\mathbb{R}","ℚ":"\\mathbb{Q}","ℕ":"\\mathbb{N}","ℂ":"CC","□":"\\square","⋄":"\\diamond","△":"\\triangle","⌢":"\\frown","∠":"\\angle","⋱":"\\ddots","⋮":"\\vdots","∵":"\\because","∴":"\\therefore","ℵ":"\\aleph","∅":"\\oslash","±":"\\pm","∇":"\\nabla","∂":"\\partial","∮":"\\oint","∫":"\\int","⋃":"\\cup","∪":"\\cup","⋂":"\\cap","∩":"\\cap","⋁":"\\vee","∨":"\\vee","⋀":"\\wedge","∧":"\\wedge","∏":"\\prod","∑":"\\sum","⊙":"\\bigodot","⊗":"\\bigoplus","⊕":"o+","∘":"@","⋈":"\\bowtie","⋊":"\\rtimes","⋉":"\\ltimes","÷":"\\div","×":"\\times","\\":"\\backslash","⋆":"\\star","∗":"\\star","⋅":"\\cdot","Ω":"\\Omega","ω":"\\omega","Ψ":"\\Psi","ψ":"\\psi","χ":"\\chi","φ":"\\varphi","Φ":"\\Phi","ϕ":"\\phi","υ":"\\upsilon","τ":"\\tau","Σ":"\\Sigma","σ":"\\sigma","ρ":"\\rho","Π":"\\Pi","π":"\\pi","Ξ":"\\Xi","ξ":"\\xi","ν":"\\nu","μ":"\\mu","Λ":"\\Lambda","λ":"\\lambda","κ":"\\kappa","ι":"\\iota","ϑ":"\\vartheta","Θ":"\\Theta","θ":"\\theta","η":"\\eta","ζ":"\\zeta","ɛ":"\\varepsilon","ε":"\\epsilon","Δ":"\\Delta","δ":"\\delta","Γ":"\\Gamma","γ":"\\gamma","β":"\\beta","α":"\\alpha","∞":"\\infty"}},2126:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.allMathSymbolsByGlyph=void 0,t.allMathSymbolsByGlyph={" ":"\\textrm{ }","∃":"\\exists","∀":"\\forall","⇔":"\\iff","⇒":"=>","¬":"\\neg","□":"\\square","⋄":"\\diamond","△":"\\triangle","⌢":"\\frown","∠":"\\angle","⋱":"\\ddots","⋮":"\\vdots","∵":"\\because","∴":"\\therefore",ℵ:"\\aleph","∅":"\\oslash","±":"\\pm","∇":"\\nabla","∂":"\\partial","∮":"\\oint","∫":"\\int","⋃":"\\cup","∪":"\\cup","⋂":"\\cap","∩":"\\cap","⋁":"\\vee","∨":"\\vee","⋀":"\\wedge","∧":"\\wedge","∏":"\\prod","∑":"\\sum","⊙":"\\bigodot","⊗":"\\bigoplus","⊕":"o+","∘":"@","⋈":"\\bowtie","⋊":"\\rtimes","⋉":"\\ltimes","÷":"\\div","×":"\\times","\\":"\\backslash","⋆":"\\star","∗":"\\star","⋅":"\\cdot",Ω:"\\Omega",ω:"\\omega",Ψ:"\\Psi",ψ:"\\psi",χ:"\\chi",φ:"\\varphi",Φ:"\\Phi",ϕ:"\\phi",υ:"\\upsilon",τ:"\\tau",Σ:"\\Sigma",σ:"\\sigma",ρ:"\\rho",Π:"\\Pi",π:"\\pi",Ξ:"\\Xi",ξ:"\\xi",ν:"\\nu",μ:"\\mu",Λ:"\\Lambda",λ:"\\lambda",κ:"\\kappa",ι:"\\iota",ϑ:"\\vartheta",Θ:"\\Theta",θ:"\\theta",η:"\\eta",ζ:"\\zeta",ɛ:"\\varepsilon",ε:"\\epsilon",Δ:"\\Delta",δ:"\\delta",Γ:"\\Gamma",γ:"\\gamma",β:"\\beta",α:"\\alpha","∞":"\\infty"}},7704:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(6102),t),o(r(9473),t),o(r(2836),t),o(r(2126),t),o(r(8259),t)},8259:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.latexAccents=void 0,t.latexAccents=["\\hat","\\bar","\\underbrace","\\overbrace"]},647:(e,t,r)=>{function n(e){this.options=e||{locator:{}}} /** * +ContentHandler+ErrorHandler * +LexicalHandler+EntityResolver2 * -DeclHandler-DTDHandler * * DefaultHandler:EntityResolver, DTDHandler, ContentHandler, ErrorHandler * DefaultHandler2:DefaultHandler,LexicalHandler, DeclHandler, EntityResolver2 * @link http://www.saxproject.org/apidoc/org/xml/sax/helpers/DefaultHandler.html */ function o(){this.cdata=!1}function i(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber} /** * @see org.xml.sax.ContentHandler#startDocument * @link http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html */function a(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function s(e,t,r){return"string"==typeof e?e.substr(t,r):e.length>=t+r||t?new java.lang.String(e,t,r)+"":e} /* * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/LexicalHandler.html * used method of org.xml.sax.ext.LexicalHandler: * #comment(chars, start, length) * #startCDATA() * #endCDATA() * #startDTD(name, publicId, systemId) * * * IGNORED method of org.xml.sax.ext.LexicalHandler: * #endDTD() * #startEntity(name) * #endEntity(name) * * * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/DeclHandler.html * IGNORED method of org.xml.sax.ext.DeclHandler * #attributeDecl(eName, aName, type, mode, value) * #elementDecl(name, model) * #externalEntityDecl(name, publicId, systemId) * #internalEntityDecl(name, value) * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/EntityResolver2.html * IGNORED method of org.xml.sax.EntityResolver2 * #resolveEntity(String name,String publicId,String baseURI,String systemId) * #resolveEntity(publicId, systemId) * #getExternalSubset(name, baseURI) * @link http://www.saxproject.org/apidoc/org/xml/sax/DTDHandler.html * IGNORED method of org.xml.sax.DTDHandler * #notationDecl(name, publicId, systemId) {}; * #unparsedEntityDecl(name, publicId, systemId, notationName) {}; */function l(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}n.prototype.parseFromString=function(e,t){var r=this.options,n=new u,i=r.domBuilder||new o,s=r.errorHandler,l=r.locator,h=r.xmlns||{},d=/\/x?html?$/.test(t),p=d?c.entityMap:{lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return l&&i.setDocumentLocator(l),n.errorHandler=function(e,t,r){if(!e){if(t instanceof o)return t;e=t}var n={},i=e instanceof Function;function s(t){var o=e[t];!o&&i&&(o=2==e.length?function(r){e(t,r)}:e),n[t]=o&&function(e){o("[xmldom "+t+"]\t"+e+a(r))}||function(){}}return r=r||{},s("warning"),s("error"),s("fatalError"),n}(s,i,l),n.domBuilder=r.domBuilder||i,d&&(h[""]="http://www.w3.org/1999/xhtml"),h.xml=h.xml||"http://www.w3.org/XML/1998/namespace",e&&"string"==typeof e?n.parse(e,h,p):n.errorHandler.error("invalid doc source"),i.doc},o.prototype={startDocument:function(){this.doc=(new h).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,r,n){var o=this.doc,a=o.createElementNS(e,r||t),s=n.length;l(this,a),this.currentElement=a,this.locator&&i(this.locator,a);for(var c=0;c{ /* * DOM Level 2 * Object DOMException * @see http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html */ function r(e,t){for(var r in e)t[r]=e[r]}function n(e,t){var n=e.prototype;if(!(n instanceof t)){function o(){}o.prototype=t.prototype,r(n,o=new o),e.prototype=n=o}n.constructor!=e&&("function"!=typeof e&&console.error("unknow Class:"+e),n.constructor=e)}var o={},i=o.ELEMENT_NODE=1,a=o.ATTRIBUTE_NODE=2,s=o.TEXT_NODE=3,l=o.CDATA_SECTION_NODE=4,c=o.ENTITY_REFERENCE_NODE=5,u=o.ENTITY_NODE=6,h=o.PROCESSING_INSTRUCTION_NODE=7,d=o.COMMENT_NODE=8,p=o.DOCUMENT_NODE=9,m=o.DOCUMENT_TYPE_NODE=10,g=o.DOCUMENT_FRAGMENT_NODE=11,f=o.NOTATION_NODE=12,w={},x={},v=(w.INDEX_SIZE_ERR=(x[1]="Index size error",1),w.DOMSTRING_SIZE_ERR=(x[2]="DOMString size error",2),w.HIERARCHY_REQUEST_ERR=(x[3]="Hierarchy request error",3)),b=(w.WRONG_DOCUMENT_ERR=(x[4]="Wrong document",4),w.INVALID_CHARACTER_ERR=(x[5]="Invalid character",5),w.NO_DATA_ALLOWED_ERR=(x[6]="No data allowed",6),w.NO_MODIFICATION_ALLOWED_ERR=(x[7]="No modification allowed",7),w.NOT_FOUND_ERR=(x[8]="Not found",8)),y=(w.NOT_SUPPORTED_ERR=(x[9]="Not supported",9),w.INUSE_ATTRIBUTE_ERR=(x[10]="Attribute in use",10));w.INVALID_STATE_ERR=(x[11]="Invalid state",11),w.SYNTAX_ERR=(x[12]="Syntax error",12),w.INVALID_MODIFICATION_ERR=(x[13]="Invalid modification",13),w.NAMESPACE_ERR=(x[14]="Invalid namespace",14),w.INVALID_ACCESS_ERR=(x[15]="Invalid access",15);function _(e,t){if(t instanceof Error)var r=t;else r=this,Error.call(this,x[e]),this.message=x[e],Error.captureStackTrace&&Error.captureStackTrace(this,_);return r.code=e,t&&(this.message=this.message+": "+t),r} /** * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-536297177 * The NodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented. NodeList objects in the DOM are live. * The items in the NodeList are accessible via an integral index, starting from 0. */ function C(){}function A(e,t){this._node=e,this._refresh=t,E(this)}function E(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var n=e._refresh(e._node);ne(e,"length",n.length),r(n,e),e._inc=t}}function S(){}function T(e,t){for(var r=e.length;r--;)if(e[r]===t)return r}function D(e,t,r,n){if(n?t[T(t,n)]=r:t[t.length++]=r,e){r.ownerElement=e;var o=e.ownerDocument;o&&(n&&F(o,e,n),function(e,t,r){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==r.namespaceURI&&(t._nsMap[r.prefix?r.localName:""]=r.value)}(o,e,r))}}function I(e,t,r){var n=T(t,r);if(!(n>=0))throw _(b,new Error(e.tagName+"@"+r));for(var o=t.length-1;n"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"} /** * @param callback return true for continue,false for break * @return boolean true: break visit; */ function P(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(P(e,t))return!0}while(e=e.nextSibling)}function N(){}function F(e,t,r,n){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==r.namespaceURI&&delete t._nsMap[r.prefix?r.localName:""]}function B(e,t,r){if(e&&e._inc){e._inc++;var n=t.childNodes;if(r)n[n.length++]=r;else{for(var o=t.firstChild,i=0;o;)n[i++]=o,o=o.nextSibling;n.length=i}}}function O(e,t){var r=t.previousSibling,n=t.nextSibling;return r?r.nextSibling=n:e.firstChild=n,n?n.previousSibling=r:e.lastChild=r,B(e.ownerDocument,e),t}function L(e,t,r){var n=t.parentNode;if(n&&n.removeChild(t),t.nodeType===g){var o=t.firstChild;if(null==o)return t;var i=t.lastChild}else o=i=t;var a=r?r.previousSibling:e.lastChild;o.previousSibling=a,i.nextSibling=r,a?a.nextSibling=o:e.firstChild=o,null==r?e.lastChild=i:r.previousSibling=i;do{o.parentNode=e}while(o!==i&&(o=o.nextSibling));return B(e.ownerDocument||e,e),t.nodeType==g&&(t.firstChild=t.lastChild=null),t}function H(){this._nsMap={}}function R(){}function U(){}function j(){}function W(){}function $(){}function V(){}function G(){}function Q(){}function X(){}function z(){}function J(){}function Y(){}function K(e,t){var r=[],n=9==this.nodeType&&this.documentElement||this,o=n.prefix,i=n.namespaceURI;if(i&&null==o&&null==(o=n.lookupPrefix(i)))var a=[{namespace:i,prefix:null}];return ee(this,r,e,t,a),r.join("")}function Z(e,t,r){var n=e.prefix||"",o=e.namespaceURI;if(!n&&!o)return!1;if("xml"===n&&"http://www.w3.org/XML/1998/namespace"===o||"http://www.w3.org/2000/xmlns/"==o)return!1;for(var i=r.length;i--;){var a=r[i];if(a.prefix==n)return a.namespace!=o}return!0}function ee(e,t,r,n,o){if(n){if(!(e=n(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case i:o||(o=[]);o.length;var u=e.attributes,f=u.length,w=e.firstChild,x=e.tagName;r="http://www.w3.org/1999/xhtml"===e.namespaceURI||r,t.push("<",x);for(var v=0;v"),r&&/^script$/i.test(x))for(;w;)w.data?t.push(w.data):ee(w,t,r,n,o),w=w.nextSibling;else for(;w;)ee(w,t,r,n,o),w=w.nextSibling;t.push("")}else t.push("/>");return;case p:case g:for(w=e.firstChild;w;)ee(w,t,r,n,o),w=w.nextSibling;return;case a:return t.push(" ",e.name,'="',e.value.replace(/[<&"]/g,q),'"');case s:return t.push(e.data.replace(/[<&]/g,q));case l:return t.push("");case d:return t.push("\x3c!--",e.data,"--\x3e");case m:var A=e.publicId,E=e.systemId;if(t.push("');else if(E&&"."!=E)t.push(' SYSTEM "',E,'">');else{var S=e.internalSubset;S&&t.push(" [",S,"]"),t.push(">")}return;case h:return t.push("");case c:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function te(e,t,r){var n;switch(t.nodeType){case i:(n=t.cloneNode(!1)).ownerDocument=e;case g:break;case a:r=!0}if(n||(n=t.cloneNode(!1)),n.ownerDocument=e,n.parentNode=null,r)for(var o=t.firstChild;o;)n.appendChild(te(e,o,r)),o=o.nextSibling;return n}function re(e,t,r){var n=new t.constructor;for(var o in t){var s=t[o];"object"!=typeof s&&s!=n[o]&&(n[o]=s)}switch(t.childNodes&&(n.childNodes=new C),n.ownerDocument=e,n.nodeType){case i:var l=t.attributes,c=n.attributes=new S,u=l.length;c._ownerElement=n;for(var h=0;h0},lookupPrefix:function(e){for(var t=this;t;){var r=t._nsMap;if(r)for(var n in r)if(r[n]==e)return n;t=t.nodeType==a?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var r=t._nsMap;if(r&&e in r)return r[e];t=t.nodeType==a?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},r(o,k),r(o,k.prototype),N.prototype={nodeName:"#document",nodeType:p,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==g){for(var r=e.firstChild;r;){var n=r.nextSibling;this.insertBefore(r,t),r=n}return e}return null==this.documentElement&&e.nodeType==i&&(this.documentElement=e),L(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),O(this,e)},importNode:function(e,t){return te(this,e,t)},getElementById:function(e){var t=null;return P(this.documentElement,(function(r){if(r.nodeType==i&&r.getAttribute("id")==e)return t=r,!0})),t},getElementsByClassName:function(e){var t=new RegExp("(^|\\s)"+e+"(\\s|$)");return new A(this,(function(e){var r=[];return P(e.documentElement,(function(n){n!==e&&n.nodeType==i&&t.test(n.getAttribute("class"))&&r.push(n)})),r}))},createElement:function(e){var t=new H;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new C,(t.attributes=new S)._ownerElement=t,t},createDocumentFragment:function(){var e=new z;return e.ownerDocument=this,e.childNodes=new C,e},createTextNode:function(e){var t=new j;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new W;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new $;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var r=new J;return r.ownerDocument=this,r.tagName=r.target=e,r.nodeValue=r.data=t,r},createAttribute:function(e){var t=new R;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new X;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var r=new H,n=t.split(":"),o=r.attributes=new S;return r.childNodes=new C,r.ownerDocument=this,r.nodeName=t,r.tagName=t,r.namespaceURI=e,2==n.length?(r.prefix=n[0],r.localName=n[1]):r.localName=t,o._ownerElement=r,r},createAttributeNS:function(e,t){var r=new R,n=t.split(":");return r.ownerDocument=this,r.nodeName=t,r.name=t,r.namespaceURI=e,r.specified=!0,2==n.length?(r.prefix=n[0],r.localName=n[1]):r.localName=t,r}},n(N,k),H.prototype={nodeType:i,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var r=this.ownerDocument.createAttribute(e);r.value=r.nodeValue=""+t,this.setAttributeNode(r)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===g?this.insertBefore(e,null):function(e,t){var r=t.parentNode;if(r){var n=e.lastChild;r.removeChild(t),n=e.lastChild}return n=e.lastChild,t.parentNode=e,t.previousSibling=n,t.nextSibling=null,n?n.nextSibling=t:e.firstChild=t,e.lastChild=t,B(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var r=this.getAttributeNodeNS(e,t);r&&this.removeAttributeNode(r)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var r=this.getAttributeNodeNS(e,t);return r&&r.value||""},setAttributeNS:function(e,t,r){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+r,this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new A(this,(function(t){var r=[];return P(t,(function(n){n===t||n.nodeType!=i||"*"!==e&&n.tagName!=e||r.push(n)})),r}))},getElementsByTagNameNS:function(e,t){return new A(this,(function(r){var n=[];return P(r,(function(o){o===r||o.nodeType!==i||"*"!==e&&o.namespaceURI!==e||"*"!==t&&o.localName!=t||n.push(o)})),n}))}},N.prototype.getElementsByTagName=H.prototype.getElementsByTagName,N.prototype.getElementsByTagNameNS=H.prototype.getElementsByTagNameNS,n(H,k),R.prototype.nodeType=a,n(R,k),U.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(x[v])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,r){r=this.data.substring(0,e)+r+this.data.substring(e+t),this.nodeValue=this.data=r,this.length=r.length}},n(U,k),j.prototype={nodeName:"#text",nodeType:s,splitText:function(e){var t=this.data,r=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(r);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},n(j,U),W.prototype={nodeName:"#comment",nodeType:d},n(W,U),$.prototype={nodeName:"#cdata-section",nodeType:l},n($,U),V.prototype.nodeType=m,n(V,k),G.prototype.nodeType=f,n(G,k),Q.prototype.nodeType=u,n(Q,k),X.prototype.nodeType=c,n(X,k),z.prototype.nodeName="#document-fragment",z.prototype.nodeType=g,n(z,k),J.prototype.nodeType=h,n(J,k),Y.prototype.serializeToString=function(e,t,r){return K.call(e,t,r)},k.prototype.toString=K;try{if(Object.defineProperty){function oe(e){switch(e.nodeType){case i:case g:var t=[];for(e=e.firstChild;e;)7!==e.nodeType&&8!==e.nodeType&&t.push(oe(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}}Object.defineProperty(A.prototype,"length",{get:function(){return E(this),this.$$length}}),Object.defineProperty(k.prototype,"textContent",{get:function(){return oe(this)},set:function(e){switch(this.nodeType){case i:case g:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),ne=function(e,t,r){e["$$"+t]=r}}}catch(e){}t.DOMImplementation=M,t.XMLSerializer=Y},3791:(e,t)=>{t.entityMap={lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}},8275:(e,t)=>{var r=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,n=new RegExp("[\\-\\.0-9"+r.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),o=new RegExp("^"+r.source+n.source+"*(?::"+r.source+n.source+"*)?$");function i(){}function a(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t} /** * @see #appendElement(source,elStartEnd,el,selfClosed,entityReplacer,domBuilder,parseStack); * @return end of the elementStartPart(end of elementEndPart for selfClosed el) */function s(e,t,r,n,o,i){for(var a,s=++t,l=0;;){var c=e.charAt(s);switch(c){case"=":if(1===l)a=e.slice(t,s),l=3;else{if(2!==l)throw new Error("attribute equal must after attrName");l=3}break;case"'":case'"':if(3===l||1===l){if(1===l&&(i.warning('attribute value must after "="'),a=e.slice(t,s)),t=s+1,!((s=e.indexOf(c,t))>0))throw new Error("attribute value no end '"+c+"' match");u=e.slice(t,s).replace(/&#?\w+;/g,o),r.add(a,u,t-1),l=5}else{if(4!=l)throw new Error('attribute value must after "="');u=e.slice(t,s).replace(/&#?\w+;/g,o),r.add(a,u,t),i.warning('attribute "'+a+'" missed start quot('+c+")!!"),t=s+1,l=5}break;case"/":switch(l){case 0:r.setTagName(e.slice(t,s));case 5:case 6:case 7:l=7,r.closed=!0;case 4:case 1:case 2:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return i.error("unexpected end of input"),0==l&&r.setTagName(e.slice(t,s)),s;case">":switch(l){case 0:r.setTagName(e.slice(t,s));case 5:case 6:case 7:break;case 4:case 1:"/"===(u=e.slice(t,s)).slice(-1)&&(r.closed=!0,u=u.slice(0,-1));case 2:2===l&&(u=a),4==l?(i.warning('attribute "'+u+'" missed quot(")!!'),r.add(a,u.replace(/&#?\w+;/g,o),t)):("http://www.w3.org/1999/xhtml"===n[""]&&u.match(/^(?:disabled|checked|selected)$/i)||i.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),r.add(u,u,t));break;case 3:throw new Error("attribute value missed!!")}return s;case"€":c=" ";default:if(c<=" ")switch(l){case 0:r.setTagName(e.slice(t,s)),l=6;break;case 1:a=e.slice(t,s),l=2;break;case 4:var u=e.slice(t,s).replace(/&#?\w+;/g,o);i.warning('attribute "'+u+'" missed quot(")!!'),r.add(a,u,t);case 5:l=6}else switch(l){case 2:r.tagName;"http://www.w3.org/1999/xhtml"===n[""]&&a.match(/^(?:disabled|checked|selected)$/i)||i.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!'),r.add(a,a,t),t=s,l=1;break;case 5:i.warning('attribute space is required"'+a+'"!!');case 6:l=1,t=s;break;case 3:l=4,t=s;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}s++}} /** * @return true if has new namespace define */function l(e,t,r){for(var n=e.tagName,o=null,i=e.length;i--;){var a=e[i],s=a.qName,l=a.value;if((p=s.indexOf(":"))>0)var c=a.prefix=s.slice(0,p),u=s.slice(p+1),d="xmlns"===c&&u;else u=s,c=null,d="xmlns"===s&&"";a.localName=u,!1!==d&&(null==o&&(o={},h(r,r={})),r[d]=o[d]=l,a.uri="http://www.w3.org/2000/xmlns/",t.startPrefixMapping(d,l))}for(i=e.length;i--;){(c=(a=e[i]).prefix)&&("xml"===c&&(a.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==c&&(a.uri=r[c||""]))}var p;(p=n.indexOf(":"))>0?(c=e.prefix=n.slice(0,p),u=e.localName=n.slice(p+1)):(c=null,u=e.localName=n);var m=e.uri=r[c||""];if(t.startElement(m,u,n,e),!e.closed)return e.currentNSMap=r,e.localNSMap=o,!0;if(t.endElement(m,u,n),o)for(c in o)t.endPrefixMapping(c)}function c(e,t,r,n,o){if(/^(?:script|textarea)$/i.test(r)){var i=e.indexOf("",t),a=e.substring(t+1,i);if(/[&<]/.test(a))return/^script$/i.test(r)?(o.characters(a,0,a.length),i):(a=a.replace(/&#?\w+;/g,n),o.characters(a,0,a.length),i)}return t+1}function u(e,t,r,n){var o=n[r];return null==o&&((o=e.lastIndexOf(""))t?(r.comment(e,t+4,o-t-4),o+3):(n.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(t+3,6)){var o=e.indexOf("]]>",t+9);return r.startCDATA(),r.characters(e,t+9,o-t-9),r.endCDATA(),o+3}var i=function(e,t){var r,n=[],o=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;o.lastIndex=t,o.exec(e);for(;r=o.exec(e);)if(n.push(r),r[1])return n}(e,t),a=i.length;if(a>1&&/!doctype/i.test(i[0][0])){var s=i[1][0],l=!1,c=!1;a>3&&(/^public$/i.test(i[2][0])?(l=i[3][0],c=a>4&&i[4][0]):/^system$/i.test(i[2][0])&&(c=i[3][0]));var u=i[a-1];return r.startDTD(s,l&&l.replace(/^(['"])(.*?)\1$/,"$2"),c&&c.replace(/^(['"])(.*?)\1$/,"$2")),r.endDTD(),u.index+u[0].length}return-1}function p(e,t,r){var n=e.indexOf("?>",t);if(n){var o=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(o){o[0].length;return r.processingInstruction(o[1],o[2]),n+2}return-1}return-1} /** * @param source */function m(e){}i.prototype={parse:function(e,t,r){var n=this.domBuilder;n.startDocument(),h(t,t={}),function(e,t,r,n,o){function i(e){if(e>65535){var t=55296+((e-=65536)>>10),r=56320+(1023&e);return String.fromCharCode(t,r)}return String.fromCharCode(e)}function h(e){var t=e.slice(1,-1);return t in r?r[t]:"#"===t.charAt(0)?i(parseInt(t.substr(1).replace("x","0x"))):(o.error("entity not found:"+e),e)}function g(t){if(t>C){var r=e.substring(C,t).replace(/&#?\w+;/g,h);b&&f(C),n.characters(r,0,t-C),C=t}}function f(t,r){for(;t>=x&&(r=v.exec(e));)w=r.index,x=w+r[0].length,b.lineNumber++;b.columnNumber=t-w+1}var w=0,x=0,v=/.*(?:\r\n?|\n)|.*$/g,b=n.locator,y=[{currentNSMap:t}],_={},C=0;for(;;){try{var A=e.indexOf("<",C);if(A<0){if(!e.substr(C).match(/^\s*$/)){var E=n.doc,S=E.createTextNode(e.substr(C));E.appendChild(S),n.currentElement=S}return}switch(A>C&&g(A),e.charAt(A+1)){case"/":var T=e.indexOf(">",A+3),D=e.substring(A+2,T),I=y.pop();T<0?(D=e.substring(A+2).replace(/[\s<].*/,""),o.error("end tag name: "+D+" is not complete:"+I.tagName),T=A+1+D.length):D.match(/\sC?C=T:g(Math.max(A,C)+1)}}(e,t,r,n,this.errorHandler),n.endDocument()}},m.prototype={setTagName:function(e){if(!o.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},add:function(e,t,r){if(!o.test(e))throw new Error("invalid attribute:"+e);this[this.length++]={qName:e,value:t,offset:r}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},t.G=i}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e,t,n,o=function(){var e=function(){return Math.floor(65536*Math.random()).toString(16)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()};!function(e){e.None="",e.GoogleDocs="docs.google.com",e.Quilgo="quilgo.com",e.Shub="shub.edu.vn",e.Azota="azota.vn",e.MicrosoftForms="forms.office.com",e.HanoiStudy="study.hanoi.edu.vn"}(e||(e={}));class i{constructor(){}PatchScript(e,t){return t}PatchElement(e){}WaitForTestReady(){return Promise.resolve(!1)}SetupElementHooks(){}SetupCommunityAnswersUI(){throw new Error("Not implemented")}FocusQuestion(e){e.HtmlElement.scrollIntoView()}GetType(){return e.None}DisableSandbox(){return!1}ChildProviders(){return[]}GetFormId(){throw new Error("Not implemented")}ExtractResources(){return[]}ExtractQuestions(){return[]}GetQuestionInfos(){return[]}}class a{static createElement(e){var t,r=(new DOMParser).parseFromString(e,"text/html");return null!==(t=r.body.firstChild)&&void 0!==t?t:r.head.firstChild}}!function(e){e.Question="Question"}(t||(t={})),function(e){e.None="",e.MultipleChoice="multipleChoice",e.Written="written",e.Hybrid="hybrid"}(n||(n={}));class s{constructor(e,t,r,o){this.HtmlElement=e,this.Id=t,this.Type=r,this.Index=o,this.CommunityAnswersHtml=a.createElement('\n
\n
Community answers:
\n
\n
Multiple choice:
\n
\n
\n
\n
Written:
\n \n
\n
\n
\n '),this.AddPingButton(),this.Type==n.MultipleChoice&&(this.CommunityAnswersHtml.querySelector(".hanoicollab-community-answers-written").style.display="none"),"written"==this.Type&&(this.CommunityAnswersHtml.querySelector(".hanoicollab-community-answers-multiple-choice").style.display="none");var i=this;this.CommunityAnswersHtml.querySelector("select").addEventListener("change",(function(){i.UpdateWrittenSelect(this)})),this.Answers=[],this.CommunityAnswers=new Array,this.CommunityAnswers.MultipleChoice={},this.SendUserTimeOut=!1,this.NeedsUpdate=!1}IsMultipleChoice(){return"multipleChoice"==this.Type||"hybrid"==this.Type}IsWritten(){return"written"==this.Type||"hybrid"==this.Type}GetUserAnswer(){throw"Not implemented"}SetUserAnswer(e){throw"Not implemented"}UpdateUserAnswer(){var e=this;setTimeout((function(){var t=e.GetUserAnswer();e.SetUserAnswer(t)}),100)}async SendUserAnswer(e){if(S.ExamConnection){var t=this;if(t.SendUserTimeOut)return void(t.NeedsUpdate=!0);t.SendUserTimeOut=!0,t.NeedsUpdate=!1,await S.ExamConnection.invoke("UpdateAnswer",S.ProviderFunctions.GetFormId(),t.Id,""==e?null:e),setTimeout((function(){t.SendUserTimeOut=!1,t.NeedsUpdate&&t.SendUserAnswer(t.GetUserAnswer())}),1e3)}}ClearUserAnswer(){throw"Not implemented"}UpdateWrittenSelect(e){var t,r,n=e.value;n&&(e.parentElement.querySelector(".hanoicollab-community-answers-written-content").innerText=null!==(r=null===(t=this.CommunityAnswers.find((function(e){return e.User==n})))||void 0===t?void 0:t.Answer)&&void 0!==r?r:"")}UpdateCommunityAnswersHtml(){var e=this;if(e.IsMultipleChoice()){var t=(a=e.CommunityAnswers).MultipleChoice,r=e.CommunityAnswersHtml.querySelector(".hanoicollab-community-answers-multiple-choice-contents"),n=S.Document.createElement("div");for(var o of Object.keys(t).sort((function(e,r){return t[e].Alpha.localeCompare(t[r].Alpha)})))if(t[o].Alpha){var i=S.Document.createElement("p");i.innerHTML=`${t[o].Alpha} (${t[o].length}): ${t[o].slice(0,Math.min(t[o].length,10)).join(", ").escapeHTML()}`,n.appendChild(i)}r.innerHTML=n.innerHTML}if(e.IsWritten()){var a=e.CommunityAnswers,s=e.CommunityAnswersHtml.querySelector(".hanoicollab-community-answers-written-select"),l=S.Document.createElement("select");for(var c of a.sort((function(e,t){return e.Answer.length!=t.Answer.length?t.Answer.length-e.Answer.length:e.User.localeCompare(t.User)}))){var u=S.Document.createElement("option");u.value=c.User,u.innerText=`${c.User} (${c.Answer.length}) characters`,l.appendChild(u)}s.innerHTML=l.innerHTML,e.UpdateWrittenSelect(s)}}AddClearButton(){var e=this,t=S.Document.createElement("button");t.innerText="Clear",t.className="hanoicollab-clear-button",t.type="button",t.addEventListener("click",(function(){e.ClearUserAnswer()})),e.HtmlElement.appendChild(t)}async Ping(){S.ExamConnection&&await S.ExamConnection.invoke("Ping",S.ProviderFunctions.GetFormId(),t.Question,this.Id)}AddPingButton(){var e=this,t=S.Document.createElement("button");t.innerText="Ping this question!",t.className="hanoicollab-ping-button",t.type="button",t.addEventListener("click",(function(){e.Ping()})),e.CommunityAnswersHtml.appendChild(t)}}class l{constructor(e,t,r,n,o,i){this.Type=e,this.Description=t,this.Id=r,this.Answers=n,this.Resources=o,this.ImageResources=i}}class c{constructor(e,t,r,n,o){this.Description=e,this.Resources=t,this.Id=r,this.Alpha=n,this.ImageResources=o}}class u{constructor(){this.OriginalLink=window.location.href,this.Resources=S.ProviderFunctions.ExtractResources(),this.Questions=S.ProviderFunctions.ExtractQuestions()}}function h(e){return"string"==typeof e?S.Document.querySelector(e):e}class d extends i{PatchScript(e,t){return(e.includes("main")||e.includes("runtime"))&&(t=(t=t.replace(/document\.head\.appendChild/g,'(function(child)\n {\n if (child.tagName !== "SCRIPT")\n {\n document.head.appendChild(child);\n return;\n }\n if (child.src && child.src.includes("es2015"))\n {\n var request = new XMLHttpRequest();\n request.open("GET", child.src, false);\n request.send(null);\n var scriptContent = request.responseText;\n scriptContent = scriptContent.replace(/constructor\\([a-zA-Z_,]*?\\){super\\([a-zA-Z_,]*?\\),*/gm, (match) => {return match + "this;try{if(!window.HanoiCollabExposedVariables)window.HanoiCollabExposedVariables=[];HanoiCollabExposedVariables.push(this);}catch(e){console.log(e);}"});\n scriptContent = scriptContent.replace(/constructor\\([a-zA-Z_,]*?\\){/gm, (match) => {return match + "try{if(!window.HanoiCollabExposedVariables)window.HanoiCollabExposedVariables=[];HanoiCollabExposedVariables.push(this);}catch(e){console.log(e);}"});\n scriptContent = scriptContent.replace(/checkFullScreen\\(\\){/gm, (match) => {return match + "return true;"});\n scriptContent = scriptContent.replace(/goBackFullScreen\\(\\){/gm, (match) => {return match + `console.log("Blocked monitor action");return;`});\n scriptContent = scriptContent.replace(/exitFullscreen\\(\\){/gm, (match) => {return match + `console.log("Blocked monitor action");return;`});\n scriptContent = scriptContent.replace(/trackInfos:[^,}]*/gm, `trackInfos: null`);\n scriptContent = scriptContent.replace(/resultTrack:[^,}]*/gm, `resultTrack: null`); \n var scriptBlob = new Blob([scriptContent], {type: "application/javascript"});\n var scriptURL = URL.createObjectURL(scriptBlob);\n child.removeAttribute("integrity");\n child.src = scriptURL;\n }\n document.head.appendChild(child);\n })')).replace(/sendMonitorAction\([A-Za-z_,]*?\){/,(e=>e+'console.log("Blocked monitor action.");return;'))),t}WaitForTestReady(){return new Promise((function(e,t){if(top.window.location.href.includes("take-test"))var r=!1,n=setInterval((function(){if(r){if(h(".question-content"))return clearInterval(n),void e(!0)}else if(S.Window.HanoiCollabExposedVariables)for(var t of S.Window.HanoiCollabExposedVariables)if(t.saveToStorage&&t.questionList){S.Window.HanoiCollabExposedVariables.splice(0,S.Window.length),S.Window.HanoiCollabExposedVariables.FormState=t,S.Window.HanoiCollabExposedVariables.push=function(){return 0},r=!0;break}}),1e3);else e(!1)}))}SetupElementHooks(){var e,t=S.Questions;for(let r of t)"multipleChoice"==r.Type?r.HtmlElement.querySelector(".list-answer").addEventListener("click",(function(){r.UpdateUserAnswer()})):r.HtmlElement.querySelector("textarea").addEventListener("blur",(function(){r.UpdateUserAnswer()})),r.AddClearButton(),null===(e=r.HtmlElement.querySelector(".hanoicollab-clear-button"))||void 0===e||e.addEventListener("click",(function(){r.UpdateUserAnswer()}))}GetType(){return e.Azota}DisableSandbox(){return!top.location.href.includes("/take-test")}GetFormId(){return""+S.Window.HanoiCollabExposedVariables.FormState.exam_obj.id}ExtractQuestions(){var e=[],t=S.Window.HanoiCollabExposedVariables.FormState.questionList;for(let p=0;p","\n"),[],r.answerConfigParse[a].key,r.answerConfigParse[a].alpha||r.answerConfigParse[a].content,[]));else for(a=0;a","\n"):s.push(d.url);e.push(new l(i,h,n,o,s,u))}return e}GetQuestionInfos(){for(var e=[],t=Array.from(S.Document.querySelectorAll(".question-content")).map((e=>e)),r=S.Window.HanoiCollabExposedVariables.FormState.questionList,o=0;o":">",'"':""","'":"'","/":"/","`":"`","=":"="};String.prototype.escapeHTML=function(){return String(this).replace(/[&<>"'`=\/]/g,(function(e){return p[e]}))},String.prototype.escapeRegex=function(){return this.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")};class m extends i{PatchScript(e,t){return e.includes("viewer_base")&&(t=(t='\n function setupHook(xhr) {\n function getter() {\n console.log(\'get responseText\');\n \n delete xhr.responseText;\n var ret = xhr.responseText;\n if (ret.includes("history.replaceState"))\n {\n ret = "window.history.replaceState=function(){};console.log(window.history);" + ret;\n ret = ret .replace(/=history\\.pushState/, "=window.parent.history.pushState")\n .replace(/=history\\.replaceState/, "=function(){}"); \n }\n setup();\n return ret;\n }\n \n function setter(str) {\n console.log(\'set responseText: %s\', str);\n }\n \n function setup() {\n Object.defineProperty(xhr, \'responseText\', {\n get: getter,\n set: setter,\n configurable: true\n });\n }\n setup();\n }\n\n XMLHttpRequest.prototype.oldOpen = XMLHttpRequest.prototype.open;\n XMLHttpRequest.prototype.open = function(method, url, async, user, password)\n {\n console.log(url);\n if (!this._HanoiCollabHooked) {\n this._HanoiCollabHooked = true;\n setupHook(this);\n }\n XMLHttpRequest.prototype.oldOpen.call(this, method, url, async, user);\n }\n '+t).replace(/impressionBatch:[^}]+/g,"impressionBatch: []").replace(/this.j.send\(a\)/,"this.j.send((function(a){console.log(a);return a;})(a))").replace(/document\.getElementById\("base-js\"\)\)&&\([A-Za-z]\=[A-Za-z]\.src\?[A-Za-z]\.src.+?length-1]\.src/g,(e=>e.replace(/\.src/g,'.getAttribute("originalSrc")')))),t}WaitForTestReady(){return new Promise(((e,t)=>{if(window.location.href.includes("/viewform")||window.location.href.includes("/formResponse"))var r=setInterval((function(){if(S.Document.querySelectorAll("form").length)return clearInterval(r),void e(!0)}));else e(!1)}))}SetupElementHooks(){var e,t=S.Questions;for(let r of t)r.AddClearButton(),null===(e=r.HtmlElement.querySelector(".hanoicollab-clear-button"))||void 0===e||e.addEventListener("click",(function(){r.UpdateUserAnswer()}));var r=S.Document.querySelector("form").querySelector("input").parentElement;new MutationObserver((function(e){var r,n={};for(var o of e){var i=o.target;(null===(r=null==i?void 0:i.name)||void 0===r?void 0:r.includes("entry"))&&(n[i.name.substring("entry.".length)]=!0)}for(let e of t)n[e.Id]&&e.UpdateUserAnswer()})).observe(r,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0,attributeFilter:["value"]})}SetupCommunityAnswersUI(){for(let e of S.Questions)if("listitem"==e.HtmlElement.getAttribute("role"))e.HtmlElement.appendChild(e.CommunityAnswersHtml);else{e.CommunityAnswersHtml.style.display="none",e.CommunityAnswersHtml.style.position="fixed",e.CommunityAnswersHtml.style.top="-69420px",e.CommunityAnswersHtml.style.margin="0",e.CommunityAnswersHtml.style.padding="0",e.CommunityAnswersHtml.style.background="rgba(0,127,255,0.9)",e.CommunityAnswersHtml.style.zIndex="9997",e.CommunityAnswersHtml.style.minWidth="10%",e.HtmlElement.appendChild(e.CommunityAnswersHtml);const t=10;e.HtmlElement.addEventListener("mouseenter",(function(r){S.IsStealthMode||(e.CommunityAnswersHtml.style.display="block",e.CommunityAnswersHtml.style.left=`${r.clientX+t}`,e.CommunityAnswersHtml.style.top=`${r.clientY+t}`)})),e.HtmlElement.addEventListener("mousemove",(function(r){S.IsStealthMode||(e.CommunityAnswersHtml.style.display="block",e.CommunityAnswersHtml.style.left=`${r.clientX+t}`,e.CommunityAnswersHtml.style.top=`${r.clientY+t}`)})),e.HtmlElement.addEventListener("mouseleave",(function(){S.IsStealthMode||(e.CommunityAnswersHtml.style.display="none",e.CommunityAnswersHtml.style.top="-69420px")}))}}GetType(){return e.GoogleDocs}DisableSandbox(){return!0}GetFormId(){var e;return""+(null!==(e=window.location.href.match("https://docs.google.com/forms/d/e/(.*?)/viewform.*"))&&void 0!==e?e:window.location.href.match("https://docs.google.com/forms/d/e/(.*?)/formResponse.*"))[1]}ExtractResources(){var e=[];for(var t of Array.from(S.Document.querySelectorAll("*")).filter((e=>"listitem"==e.getAttribute("role"))))t.querySelectorAll("input").length||t.querySelectorAll("textarea").length||t.querySelectorAll("label").length||e.push(...Array.from(t.querySelectorAll("img,iframe")).map((e=>e.src)));return e}ExtractQuestions(){var e,t,r,o,i,a=[],s=document.querySelectorAll('[role="listitem"]');for(let q=0;qe.src)),g=Array.from(u.querySelectorAll("iframe")).map((e=>e.src)),f=h[4];u.querySelectorAll('[role="presentation"]');for(let e=0;ee.src)),k=Array.from(I.querySelectorAll("iframe")).map((e=>e.src));T.push(...M),T.push(...k),C.push(new c(S[0],k,S[0].getHashCode(),String.fromCharCode(E.charCodeAt(0)+e),M))}}else if(d==n.Hybrid){E="A";for(let e=0;e<4;++e)C.push(new c("",[],String.fromCharCode(E.charCodeAt(0)+e),String.fromCharCode(E.charCodeAt(0)+e),[]))}b=Array.from(u.querySelectorAll("img")).map((e=>e.src)).filter((e=>!T.includes(e))),y=Array.from(u.querySelectorAll("iframe")).map((e=>e.src)).filter((e=>!T.includes(e)));a.push(new l(d,v,_,C,y,b))}}}return a}GetQuestionInfos(){var e,t,r,o,i,a=[],l=document.querySelectorAll('[role="listitem"]');for(let b=0;be+'console.log("Blocked monitor action");return;'))),t}PatchElement(e){"SCRIPT"==e.tagName&&(e.innerHTML=e.innerHTML.replace(/ShowFullScreen\([\)]*?\)\s*?\{/,(e=>e+'console.log("Blocked full screen request");return;')))}async WaitForTestReady(){var e;if(!await new Promise(((e,t)=>{if(window.location.href.includes("lam-bai"))var r=setInterval((function(){if(S.Document.querySelector(".test-body")&&S.Window.ExamId)return clearInterval(r),void e(!0)}));else e(!1)})))return!1;for(var t of(S.Window.ShowFullScreen=function(){console.log("Blocked full screen request.")},S.Window.LogEvent=function(){console.log("Blocked monitor action.")},S.Document.documentElement.requestFullscreen=function(){return Promise.resolve(console.log("Blocked full screen request."))},S.Document.querySelectorAll(".question-box"))){null===(e=Array.from(t.querySelectorAll("label")).sort(((e,t)=>e.htmlFor.localeCompare(t.htmlFor)))[0].closest(".splip-answer"))||void 0===e||e.appendChild(a.createElement('\n
(Recommended answer)
\n '))}return!0}SetupElementHooks(){var e,t=S.Questions;for(let n of t)for(var r of(n.AddClearButton(),null===(e=n.HtmlElement.querySelector(".hanoicollab-clear-button"))||void 0===e||e.addEventListener("click",(function(){n.UpdateUserAnswer()})),n.HtmlElement.querySelectorAll("input"))){r.addEventListener("click",(function(){n.UpdateUserAnswer()}))}}GetType(){return e.HanoiStudy}DisableSandbox(){return!0}GetFormId(){var e,t;return null!==(t=null===(e=S.Window.ExamId)||void 0===e?void 0:e.toString())&&void 0!==t?t:""}ExtractResources(){return[]}ExtractQuestions(){function e(e){function t(e){var t;return"math/mml"===e.type?w().convert(e.innerHTML):null!==(t=e.textContent)&&void 0!==t?t:""}for(var r=e.cloneNode(!0),n=r.getElementsByClassName("mjx-chtml"),o=Array.from(r.getElementsByTagName("script")).filter((e=>e.type.startsWith("math/"))),i=0;ie.getAttribute("for"))).sort()[0],u=[],h=Array.from(o.querySelector(".question-box-title").querySelectorAll("img")).map((e=>e.src)),d=o.querySelectorAll(".splip-answer");for(let t=0;te.src))))}t.push(new l(i,a,s,u,[],h))}return t}GetQuestionInfos(){var e=[],t=document.querySelectorAll(".question-box");for(let d=0;de.getAttribute("for"))).sort()[0],a=new s(r,i,o,d),l=r.querySelectorAll("label");for(let e=0;ee.checked)).at(0))||void 0===e?void 0:e.parentElement)||void 0===t?void 0:t.querySelector("label"))||void 0===r?void 0:r.getAttribute("for");return n&&0!=n.length?n:""},a.SetUserAnswer=function(e){this.SendUserAnswer&&this.SendUserAnswer(e)},a.ClearUserAnswer=function(){var e,t,r,n,o,i,a,s=this.HtmlElement.getAttribute("data-id"),l=localStorage.getItem(S.Window.localSaveResultKey);if(l){var c,u=JSON.parse(l);-1!=(c=u.findIndex((e=>e.QuestionId==s)))&&u.splice(c,1),localStorage.setItem(S.Window.localSaveResultKey,JSON.stringify(u))}S.Window.testResultLocalObject&&(-1!=(c=S.Window.testResultLocalObject.findIndex((e=>e.QuestionId==s)))&&S.Window.testResultLocalObject.splice(c,1));for(var d of this.HtmlElement.querySelectorAll("input"))d.checked=!1;null===(e=h("#q-prick-"+s))||void 0===e||e.classList.add("box-no-anwser"),null===(t=h("#q-prick-"+s))||void 0===t||t.classList.remove("box-has-anwser"),null===(r=h("#q-prick-"+s+"-mobile"))||void 0===r||r.classList.add("box-no-anwser"),null===(n=h("#q-prick-"+s+"-mobile"))||void 0===n||n.classList.remove("box-has-anwser"),null===(o=h("#q-"+s))||void 0===o||o.classList.remove("question-active"),function(){var e,t,r,n;h("#total-has-answer").innerHTML=null!==(t=null===(e=S.Window.testResultLocalObject)||void 0===e?void 0:e.length.toString())&&void 0!==t?t:"0",h("#total-has-answermobile").innerHTML=null!==(n=null===(r=S.Window.testResultLocalObject)||void 0===r?void 0:r.length.toString())&&void 0!==n?n:"0"}(),null===(i=h("#q-title-"+s))||void 0===i||i.classList.remove("title-index-question-list-active"),null===(a=h("#qm-title-"+s))||void 0===a||a.classList.remove("title-index-question-list-active")},e.push(a)}return e}}function v(e){return S.DistributionRoot+"/Images/"+e}async function b(e){return await new Promise((function(t){GM_xmlhttpRequest({method:"GET",url:e,onload:function(e){t(e)},onerror:function(e){t(e)}})}))}let y;function _(e){if(!y)throw new Error("Name dictionary not loaded.");var t=y[e];if(t)return t;throw new Error("Invalid Office Forms FormState name: "+e)}class C extends i{PatchScript(e,t){return e.includes("page.min")&&(t=t.replace("return(r=r||a.length!==Object.keys(n).length)?i:n","return(r=r||a.length!==Object.keys(n).length)?(function(i){window.HanoiCollabExposedVariables=window.HanoiCollabExposedVariables||[];window.HanoiCollabExposedVariables.FormState=i;return i})(i):n").replace("function s(n){var e=(0,o.cF)","function s(n){window.HanoiCollabExposedVariables=window.HanoiCollabExposedVariables||[];window.HanoiCollabExposedVariables.UpdateLocalStorage=f;var e=(0,o.cF)")),t}WaitForTestReady(){return new Promise(((e,t)=>{if(top.window.location.href.includes("Pages/ResponsePage.aspx"))var r=!1,n=setInterval((function(){if(r){if(h(".office-form-question-content"))return clearInterval(n),void async function(){var e;y=JSON.parse((await b((e="OfficeFormsData.json",`${S.DistributionRoot}/${e}`))).responseText)}().then((()=>e(!0))).catch((e=>t(e)))}else S.Window.HanoiCollabExposedVariables&&S.Window.HanoiCollabExposedVariables.FormState&&(r=!0)}),1e3);else e(!1)}))}SetupElementHooks(){var e,t=S.Questions;for(let n of t){if("multipleChoice"==n.Type)for(var r of n.HtmlElement.getElementsByClassName("office-form-question-choice-row"))r.addEventListener("click",(function(){n.UpdateUserAnswer()}));else n.HtmlElement.querySelector(".office-form-textfield-input").addEventListener("blur",(function(){n.UpdateUserAnswer()}));n.AddClearButton(),null===(e=n.HtmlElement.querySelector(".hanoicollab-clear-button"))||void 0===e||e.addEventListener("click",(function(){n.UpdateUserAnswer()}))}}GetType(){return e.MicrosoftForms}GetFormId(){return""+S.Window.HanoiCollabExposedVariables.FormState[_("Data")][_("Id")]}ExtractQuestions(){var e=[],t=S.Document.querySelectorAll(".office-form-question-content"),r=S.Window.HanoiCollabExposedVariables.FormState[_("Data")][_("Questions")];for(let p=0;p{",'this.checkAndHandleUnfocused=()=>{console.log("Blocked monitor action.");return;').replace(/getSelectedArea\([A-Za-z,]*?\){/g,(e=>e+'return "monitor";')),S.EnableTrackingPrevention&&(t=t.replace(/(new Promise\(\()(\(.,.\))/,"$1 async $2").replace(/validateOptions\(t\){/g,"validateOptions(t){if (t.interval) {window.HanoiCollabExposedVariables = window.HanoiCollabExposedVariables || []; window.HanoiCollabExposedVariables.OldIntervals = window.HanoiCollabExposedVariables.OldIntervals || {}; window.HanoiCollabExposedVariables.OldIntervals[t.id] = t.interval; t.interval = 5000;}").replace(/JSON\.stringify\(([^\)]*?)\.payload\)/,'(await (async function(t){if(!window.HanoiCollabExposedVariables?.HanoiCollabApproveRequest){throw "HanoiCollab blocked";} await window.HanoiCollabExposedVariables.HanoiCollabApproveRequest(t); return JSON.stringify(t.payload);})($1))'))),(e.includes("link.js")||e.includes("app.js")||e.includes("form.js"))&&(t=t.replace(/\/api/g,window.location.origin+"/api").replace(/\/stream/g,window.location.origin+"/stream")),t}PatchElement(e){if(e.classList.contains("form-submitted")&&e.remove(),e.classList.contains("plasm-caliber")){var t=(new DOMParser).parseFromString('\n
\n This is a screen-monitored exam! Please remember to enable Stealth Mode (by pressing Alt + H) before proceeding.\n
\n Furthermore, to prevent HanoiCollab\'s sign in popup to appear during the test, if you haven\'t logged in for more than 20 hours, please renew your \n session by pressing Alt + L and entering your username and password in the dialog box.\n

Good luck, and have fun!

\n
\n ',"text/html").body.firstChild;e.appendChild(t)}}GetType(){return e.Quilgo}DisableSandbox(){return!!document.querySelector("[class='auth-via-email-submit']")}ChildProviders(){return[e.GoogleDocs]}}class E extends i{PatchScript(e,t){return e.includes("_app")&&(t=t.replace('component:"a",href:n','component:"a",href:(function(n){if(!window.HanoiCollabExposedVariables)window.HanoiCollabExposedVariables=[];if(!window.HanoiCollabExposedVariables.ExposedFiles)window.HanoiCollabExposedVariables.ExposedFiles=[];window.HanoiCollabExposedVariables.ExposedFiles.push(n);return n;})(n)')),t}WaitForTestReady(){return new Promise((function(e,t){if(top.window.location.href.endsWith("/test"))var r=setInterval((function(){if(S.Document.querySelectorAll("[id^=cell]"))return clearInterval(r),void e(!0)}));else e(!1)}))}SetupElementHooks(){var e=S.Questions;if("shub.edu.vn"==S.Provider){var t=S.Document.getElementById("inputAnsKey");new MutationObserver((function(e){var t;for(var r of e){S.Questions[Number.parseInt(r.oldValue.substring("Đáp án câu ".length))-1].UpdateUserAnswer();var n=r.target;null===(t=n.closest(".MuiBox-root").querySelector(".hanoicollab-community-answers"))||void 0===t||t.remove(),n.closest(".MuiBox-root").appendChild(S.Questions[Number.parseInt(n.placeholder.substring("Đáp án câu ".length))-1].CommunityAnswersHtml)}})).observe(t,{subtree:!1,childList:!1,attributes:!0,attributeOldValue:!0,attributeFilter:["placeholder"]}),t.setAttribute("autocomplete","off"),t.addEventListener("blur",(function(){for(let t of e)t.HtmlElement.style.border.startsWith("2px")&&t.UpdateUserAnswer()}))}}SetupCommunityAnswersUI(){for(var e of S.Questions)if(e.HtmlElement.style.border.startsWith("2px"))return void e.HtmlElement.closest(".MuiBox-root").appendChild(e.CommunityAnswersHtml);(e=S.Questions[0]).HtmlElement.closest(".MuiBox-root").appendChild(e.CommunityAnswersHtml)}FocusQuestion(e){e.HtmlElement.scrollIntoView(),e.HtmlElement.click()}GetType(){return e.Shub}DisableSandbox(){return!top.location.href.includes("/test")}GetFormId(){return""+top.location.href.match(/homework\/([\d]+?)\/test/)[1]}ExtractResources(){var e,t,r;return null!==(r=null===(t=null===(e=S.Window.HanoiCollabExposedVariables)||void 0===e?void 0:e.ExposedFiles)||void 0===t?void 0:t.filter((function(e,t,r){return r.indexOf(e)===t})))&&void 0!==r?r:[]}ExtractQuestions(){var e=[];for(var t of S.Questions){var r=[];for(var n of t.Answers)r.push(new c("",[],n.Id,n.Alpha,[]));e.push(new l("hybrid","SHUB question #"+(t.Index.valueOf()+1),t.Id,r,[],[]))}return e}GetQuestionInfos(){var e=[],t=S.Document.querySelectorAll("[id^=cell]");for(let i=0;i{},this.Questions=[]}};function T(){S.IsStealthMode=!S.IsStealthMode,I(!0)}function D(e=null){var t;for(var r of(e=e||S.WindowId,window.parent&&window.parent.postMessage({Type:"HanoiCollabStealthMode",Value:S.IsStealthMode,OriginId:e},"*"),document.querySelectorAll("iframe")))null===(t=r.contentWindow)||void 0===t||t.postMessage({Type:"HanoiCollabStealthMode",Value:S.IsStealthMode,OriginId:e},"*")}async function I(e=!1){if(!e){var t=JSON.parse(await GM_getValue("HanoiCollabStealthConfig","{}"));t[S.Provider]&&(S.IsStealthMode=t[S.Provider]),S.StealthModeConfig=t}if(S.Document){var r,n;for(var o of(S.IsStealthMode?((n=a.createElement('\n \n ')).id="hanoicollab-stealth-mode-css",S.Document.body.appendChild(n),S.StealthModeConfig[S.Provider]=!0):(null===(r=h("#hanoicollab-stealth-mode-css"))||void 0===r||r.remove(),S.StealthModeConfig[S.Provider]=!1),S.ProviderFunctions.ChildProviders()||[]))S.StealthModeConfig[o]=S.IsStealthMode;D(),await GM_setValue("HanoiCollabStealthConfig",JSON.stringify(S.StealthModeConfig))}}async function M(e,t=!1){for(;S.NoticePopupPromise;)await S.NoticePopupPromise;return S.NoticePopupPromise=new Promise((async function(r,n){var o,i,s=!1;t&&S.IsStealthMode&&(s=!0,T()),h(S.Document.body).appendChild(a.createElement(`\n
\n

\n
\n ${e.outerHTML}\n
\n
\n `));for(let e of null!==(i=null===(o=S.Document.getElementById("hanoicollab-notice-popup"))||void 0===o?void 0:o.getElementsByTagName("button"))&&void 0!==i?i:[])e.onclick=function(){var t;s&&T(),null===(t=h("#hanoicollab-notice-popup-container"))||void 0===t||t.remove(),S.NoticePopupPromise=null,r(e.value)}})),await S.NoticePopupPromise}i.prototype.SetupCommunityAnswersUI=function(){for(var e of S.Questions)e.HtmlElement.appendChild(e.CommunityAnswersHtml)},window.addEventListener("message",(function(e){var t=e.data;if("HanoiCollabStealthMode"===t.Type){if(t.OriginId==S.WindowId)return;console.log(window.location.href+": Received stealth mode message: "+t.Value+" from "+t.OriginId),S.IsStealthMode=t.Value,I(!0),D(t.OriginId)}}));let k;async function q(e=null,t=!1){return S.Document.getElementById("hanoicollab-login-popup-container")||(S.LoginPopupPromise=new Promise((async function(r,n){var o;if(!t&&k&&Date.now()-k<864e5)n("Login popup suppressed.");else{var i=await GM_getValue("HanoiCollabUsername","");e=e||"Please sign in to use HanoiCollab",h(S.Document.body).appendChild(a.createElement(`\n
\n

\n
\n

${e}

\n \n
\n

Your current HanoiCollab server: ${S.Server}.

\n

Press Alt+S to change your server.

\n
\n\n
\n \n \n
\n\n

Please enter your HanoiCollab username and password.

\n\n
\n \n \n \n \n
\n
\n
\n `)),null===(o=h("#hanoicollab-login-button"))||void 0===o||o.addEventListener("click",(function(){var e=h("#hanoicollab-username").value,t=h("#hanoicollab-password").value;h("#hanoicollab-login-status").innerText="Logging in...",l(),GM_xmlhttpRequest({method:"POST",url:S.Server+"api/Accounts/login",data:JSON.stringify({Name:e,Password:t}),headers:{"Content-Type":"application/json"},onload:function(t){var n;if(200===t.status){var o=JSON.parse(t.responseText);o.Token?(GM_setValue("HanoiCollabUsername",e),GM_setValue("HanoiCollabIdentity",JSON.stringify(o)),null===(n=h("#hanoicollab-login-popup-container"))||void 0===n||n.remove(),S.Identity=o,S.ActiveUsername=e,S.OnIdentityChange&&S.OnIdentityChange(S.Identity),r(o)):(h("#hanoicollab-login-status").innerText="Error: Invalid response from server.",s())}else h("#hanoicollab-login-status").innerText="Error: "+t.statusText,s()},onerror:function(e){h("#hanoicollab-login-status").innerText="Error: "+e.statusText,s()}})})),h("#hanoicollab-register-button").addEventListener("click",(function(){var e=h("#hanoicollab-username").value,t=h("#hanoicollab-password").value;h("#hanoicollab-login-status").innerText="Registering...",l(),GM_xmlhttpRequest({method:"POST",url:S.Server+"api/Accounts/register",data:JSON.stringify({Name:e,Password:t}),headers:{"Content-Type":"application/json"},onload:function(e){var t=JSON.parse(e.responseText);h("#hanoicollab-login-status").innerText=`${t.Status}: ${t.Message}`,s()},onerror:function(e){h("#hanoicollab-login-status").innerText="Error: "+e.statusText}})})),h("#hanoicollab-close-button").addEventListener("click",(function(){h("#hanoicollab-login-popup-container").remove(),n("User cancelled")})),h("#hanoicollab-close-suppress-button").addEventListener("click",(function(){k=Date.now(),GM_setValue("HanoiCollabSuppressLoginPopupTimestamp",JSON.stringify(k)),h("#hanoicollab-login-popup-container").remove(),n("User cancelled")}))}function s(){var e,t;null===(e=h("#hanoicollab-username"))||void 0===e||e.removeAttribute("disabled"),null===(t=h("#hanoicollab-password"))||void 0===t||t.removeAttribute("disabled")}function l(){var e,t;null===(e=h("#hanoicollab-username"))||void 0===e||e.setAttribute("disabled",""),null===(t=h("#hanoicollab-password"))||void 0===t||t.setAttribute("disabled","")}}))),await S.LoginPopupPromise}async function P(){var e=S.Identity;return e||(e=await q()),Date.parse(e.Expiration)<=Date.now()&&await q("Session expired. Please sign in to continue using HanoiCollab."),e.Token}async function N(){var e=prompt("Enter your HanoiCollab server address",""!=S.Server?S.Server:"https://hanoicollab.herokuapp.com/");return e.endsWith("/")||(e+="/"),await GM_setValue("HanoiCollabServer",e),S.Server=e,e}const F={};function B(e,t){F[e]||(F[e]=[]),F[e].push(t)}let O=!1;async function L(){O||(O=!0,await M(a.createElement(`\n
\n \n

Version: ${S.Version}

\n
\n Check for updates\n
\n Join our beta channel for the latest feature previews.\n
\n

Join us!

\n
\n HanoiCollab's Discord Server\n HanoiCollab's GitHub Repo\n
\n
\n

If you enjoy HanoiCollab, please consider sending a Garena game card to AduMaster#0246 on Discord!

\n \n
\n `),!1),O=!1)}const H=[0,2e3,1e4,3e4,null]; /** @private */class R{constructor(e){this._retryDelays=void 0!==e?[...e,null]:H}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}}class U extends Error{ /** Constructs a new instance of {@link @microsoft/signalr.HttpError}. * * @param {string} errorMessage A descriptive error message. * @param {number} statusCode The HTTP status code represented by this error. */ constructor(e,t){const r=new.target.prototype;super(`${e}: Status code '${t}'`),this.statusCode=t,this.__proto__=r}}class j extends Error{ /** Constructs a new instance of {@link @microsoft/signalr.TimeoutError}. * * @param {string} errorMessage A descriptive error message. */ constructor(e="A timeout occurred."){const t=new.target.prototype;super(e),this.__proto__=t}}class W extends Error{ /** Constructs a new instance of {@link AbortError}. * * @param {string} errorMessage A descriptive error message. */ constructor(e="An abort occurred."){const t=new.target.prototype;super(e),this.__proto__=t}} /** @private */class $ extends Error{ /** Constructs a new instance of {@link @microsoft/signalr.UnsupportedTransportError}. * * @param {string} message A descriptive error message. * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occured on. */ constructor(e,t){const r=new.target.prototype;super(e),this.transport=t,this.errorType="UnsupportedTransportError",this.__proto__=r}} /** @private */class V extends Error{ /** Constructs a new instance of {@link @microsoft/signalr.DisabledTransportError}. * * @param {string} message A descriptive error message. * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occured on. */ constructor(e,t){const r=new.target.prototype;super(e),this.transport=t,this.errorType="DisabledTransportError",this.__proto__=r}} /** @private */class G extends Error{ /** Constructs a new instance of {@link @microsoft/signalr.FailedToStartTransportError}. * * @param {string} message A descriptive error message. * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occured on. */ constructor(e,t){const r=new.target.prototype;super(e),this.transport=t,this.errorType="FailedToStartTransportError",this.__proto__=r}} /** @private */class Q extends Error{ /** Constructs a new instance of {@link @microsoft/signalr.FailedToNegotiateWithServerError}. * * @param {string} message A descriptive error message. */ constructor(e){const t=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=t}} /** @private */class X extends Error{ /** Constructs a new instance of {@link @microsoft/signalr.AggregateErrors}. * * @param {string} message A descriptive error message. * @param {Error[]} innerErrors The collection of errors this error is aggregating. */ constructor(e,t){const r=new.target.prototype;super(e),this.innerErrors=t,this.__proto__=r}}class z{constructor(e,t,r){this.statusCode=e,this.statusText=t,this.content=r}}class J{get(e,t){return this.send({...t,method:"GET",url:e})}post(e,t){return this.send({...t,method:"POST",url:e})}delete(e,t){return this.send({...t,method:"DELETE",url:e})} /** Gets all cookies that apply to the specified URL. * * @param url The URL that the cookies are valid for. * @returns {string} A string containing all the key-value cookie pairs for the specified URL. */ // @ts-ignore getCookieString(e){return""}}var Y;!function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Information=2]="Information",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Critical=5]="Critical",e[e.None=6]="None"}(Y||(Y={}));class K{constructor(){} /** @inheritDoc */ log(e,t){}} /** The singleton instance of the {@link @microsoft/signalr.NullLogger}. */K.instance=new K; /** @private */ class Z{static isRequired(e,t){if(null==e)throw new Error(`The '${t}' argument is required.`)}static isNotEmpty(e,t){if(!e||e.match(/^\s*$/))throw new Error(`The '${t}' argument should not be empty.`)}static isIn(e,t,r){if(!(e in t))throw new Error(`Unknown ${r} value: ${e}.`)}} /** @private */class ee{static get isBrowser(){return"object"==typeof window&&"object"==typeof window.document}static get isWebWorker(){return"object"==typeof self&&"importScripts"in self}static get isReactNative(){return"object"==typeof window&&void 0===window.document}static get isNode(){return!this.isBrowser&&!this.isWebWorker&&!this.isReactNative}} /** @private */function te(e,t){let r="";return re(e)?(r=`Binary data of length ${e.byteLength}`,t&&(r+=`. Content: '${ /** @private */ function(e){const t=new Uint8Array(e);let r="";return t.forEach((e=>{r+=`0x${e<16?"0":""}${e.toString(16)} `})),r.substr(0,r.length-1)} /** @private */(e)}'`)):"string"==typeof e&&(r=`String data of length ${e.length}`,t&&(r+=`. Content: '${e}'`)),r}function re(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)} /** @private */async function ne(e,t,r,n,o,i,a){let s={};if(o){const e=await o();e&&(s={Authorization:`Bearer ${e}`})}const[l,c]=ae();s[l]=c,e.log(Y.Trace,`(${t} transport) sending data. ${te(i,a.logMessageContent)}.`);const u=re(i)?"arraybuffer":"text",h=await r.post(n,{content:i,headers:{...s,...a.headers},responseType:u,timeout:a.timeout,withCredentials:a.withCredentials});e.log(Y.Trace,`(${t} transport) request complete. Response status: ${h.statusCode}.`)} /** @private */ /** @private */ class oe{constructor(e,t){this._subject=e,this._observer=t}dispose(){const e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),0===this._subject.observers.length&&this._subject.cancelCallback&&this._subject.cancelCallback().catch((e=>{}))}} /** @private */class ie{constructor(e){this._minLevel=e,this.out=console}log(e,t){if(e>=this._minLevel){const r=`[${(new Date).toISOString()}] ${Y[e]}: ${t}`;switch(e){case Y.Critical:case Y.Error:this.out.error(r);break;case Y.Warning:this.out.warn(r);break;case Y.Information:this.out.info(r);break;default:this.out.log(r)}}}} /** @private */function ae(){let e="X-SignalR-User-Agent";return ee.isNode&&(e="User-Agent"),[e,se("6.0.4",le(),ue(),ce())]} /** @private */function se(e,t,r,n){let o="Microsoft SignalR/";const i=e.split(".");return o+=`${i[0]}.${i[1]}`,o+=` (${e}; `,o+=t&&""!==t?`${t}; `:"Unknown OS; ",o+=`${r}`,o+=n?`; ${n}`:"; Unknown Runtime Version",o+=")",o}function le(){if(!ee.isNode)return"";switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}}function ce(){if(ee.isNode)return process.versions.node}function ue(){return ee.isNode?"NodeJS":"Browser"} /** @private */function he(e){return e.stack?e.stack:e.message?e.message:`${e}`} /** @private */class de extends J{constructor(e){if(super(),this._logger=e,"undefined"==typeof fetch){ // @ts-ignore: TS doesn't know about these names const e=require;this._jar=new(e("tough-cookie").CookieJar),this._fetchType=e("node-fetch"),this._fetchType=e("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("could not find global")}());if("undefined"==typeof AbortController){ // @ts-ignore: TS doesn't know about these names const e=require;this._abortControllerType=e("abort-controller")}else this._abortControllerType=AbortController} /** @inheritDoc */async send(e){if(e.abortSignal&&e.abortSignal.aborted)throw new W;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");const t=new this._abortControllerType;let r;e.abortSignal&&(e.abortSignal.onabort=()=>{t.abort(),r=new W});let n,o=null;if(e.timeout){const n=e.timeout;o=setTimeout((()=>{t.abort(),this._logger.log(Y.Warning,"Timeout from HTTP request."),r=new j}),n)}try{n=await this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:!0===e.withCredentials?"include":"same-origin",headers:{"Content-Type":"text/plain;charset=UTF-8","X-Requested-With":"XMLHttpRequest",...e.headers},method:e.method,mode:"cors",redirect:"follow",signal:t.signal})}catch(e){if(r)throw r;throw this._logger.log(Y.Warning,`Error from HTTP request. ${e}.`),e}finally{o&&clearTimeout(o),e.abortSignal&&(e.abortSignal.onabort=null)}if(!n.ok){const e=await pe(n,"text");throw new U(e||n.statusText,n.status)}const i=pe(n,e.responseType),a=await i;return new z(n.status,n.statusText,a)}getCookieString(e){let t="";return ee.isNode&&this._jar&& // @ts-ignore: unused variable this._jar.getCookies(e,((e,r)=>t=r.join("; "))),t}}function pe(e,t){let r;switch(t){case"arraybuffer":r=e.arrayBuffer();break;case"text":default:r=e.text();break;case"blob":case"document":case"json":throw new Error(`${t} is not supported.`)}return r}class me extends J{constructor(e){super(),this._logger=e} /** @inheritDoc */send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new W):e.method?e.url?new Promise(((t,r)=>{const n=new XMLHttpRequest;n.open(e.method,e.url,!0),n.withCredentials=void 0===e.withCredentials||e.withCredentials,n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.setRequestHeader("Content-Type","text/plain;charset=UTF-8");const o=e.headers;o&&Object.keys(o).forEach((e=>{n.setRequestHeader(e,o[e])})),e.responseType&&(n.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{n.abort(),r(new W)}),e.timeout&&(n.timeout=e.timeout),n.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),n.status>=200&&n.status<300?t(new z(n.status,n.statusText,n.response||n.responseText)):r(new U(n.response||n.responseText||n.statusText,n.status))},n.onerror=()=>{this._logger.log(Y.Warning,`Error from HTTP request. ${n.status}: ${n.statusText}.`),r(new U(n.statusText,n.status))},n.ontimeout=()=>{this._logger.log(Y.Warning,"Timeout from HTTP request."),r(new j)},n.send(e.content||"")})):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}} /** Default implementation of {@link @microsoft/signalr.HttpClient}. */ class ge extends J{ /** Creates a new instance of the {@link @microsoft/signalr.DefaultHttpClient}, using the provided {@link @microsoft/signalr.ILogger} to log messages. */ constructor(e){if(super(),"undefined"!=typeof fetch||ee.isNode)this._httpClient=new de(e);else{if("undefined"==typeof XMLHttpRequest)throw new Error("No usable HttpClient found.");this._httpClient=new me(e)}} /** @inheritDoc */send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new W):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}}class fe{}var we,xe;fe.Authorization="Authorization",fe.Cookie="Cookie",function(e){e[e.None=0]="None",e[e.WebSockets=1]="WebSockets",e[e.ServerSentEvents=2]="ServerSentEvents",e[e.LongPolling=4]="LongPolling"}(we||(we={})),function(e){e[e.Text=1]="Text",e[e.Binary=2]="Binary"}(xe||(xe={})); /** @private */ class ve{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}} /** @private */ class be{constructor(e,t,r,n){this._httpClient=e,this._accessTokenFactory=t,this._logger=r,this._pollAbort=new ve,this._options=n,this._running=!1,this.onreceive=null,this.onclose=null}get pollAborted(){return this._pollAbort.aborted}async connect(e,t){if(Z.isRequired(e,"url"),Z.isRequired(t,"transferFormat"),Z.isIn(t,xe,"transferFormat"),this._url=e,this._logger.log(Y.Trace,"(LongPolling transport) Connecting."),t===xe.Binary&&"undefined"!=typeof XMLHttpRequest&&"string"!=typeof(new XMLHttpRequest).responseType)throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[r,n]=ae(),o={[r]:n,...this._options.headers},i={abortSignal:this._pollAbort.signal,headers:o,timeout:1e5,withCredentials:this._options.withCredentials};t===xe.Binary&&(i.responseType="arraybuffer");const a=await this._getAccessToken();this._updateHeaderToken(i,a);const s=`${e}&_=${Date.now()}`;this._logger.log(Y.Trace,`(LongPolling transport) polling: ${s}.`);const l=await this._httpClient.get(s,i);200!==l.statusCode?(this._logger.log(Y.Error,`(LongPolling transport) Unexpected response code: ${l.statusCode}.`),this._closeError=new U(l.statusText||"",l.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,i)}async _getAccessToken(){return this._accessTokenFactory?await this._accessTokenFactory():null}_updateHeaderToken(e,t){e.headers||(e.headers={}),t?e.headers[fe.Authorization]=`Bearer ${t}`:e.headers[fe.Authorization]&&delete e.headers[fe.Authorization]}async _poll(e,t){try{for(;this._running;){const r=await this._getAccessToken();this._updateHeaderToken(t,r);try{const r=`${e}&_=${Date.now()}`;this._logger.log(Y.Trace,`(LongPolling transport) polling: ${r}.`);const n=await this._httpClient.get(r,t);204===n.statusCode?(this._logger.log(Y.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):200!==n.statusCode?(this._logger.log(Y.Error,`(LongPolling transport) Unexpected response code: ${n.statusCode}.`),this._closeError=new U(n.statusText||"",n.statusCode),this._running=!1):n.content?(this._logger.log(Y.Trace,`(LongPolling transport) data received. ${te(n.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(n.content)):this._logger.log(Y.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(e){this._running?e instanceof j?this._logger.log(Y.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=e,this._running=!1):this._logger.log(Y.Trace,`(LongPolling transport) Poll errored after shutdown: ${e.message}`)}}}finally{this._logger.log(Y.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(e){return this._running?ne(this._logger,"LongPolling",this._httpClient,this._url,this._accessTokenFactory,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(Y.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(Y.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const e={},[t,r]=ae();e[t]=r;const n={headers:{...e,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials},o=await this._getAccessToken();this._updateHeaderToken(n,o),await this._httpClient.delete(this._url,n),this._logger.log(Y.Trace,"(LongPolling transport) DELETE request sent.")}finally{this._logger.log(Y.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(Y.Trace,e),this.onclose(this._closeError)}}} /** @private */ class ye{constructor(e,t,r,n){this._httpClient=e,this._accessTokenFactory=t,this._logger=r,this._options=n,this.onreceive=null,this.onclose=null}async connect(e,t){if(Z.isRequired(e,"url"),Z.isRequired(t,"transferFormat"),Z.isIn(t,xe,"transferFormat"),this._logger.log(Y.Trace,"(SSE transport) Connecting."),this._url=e,this._accessTokenFactory){const t=await this._accessTokenFactory();t&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(t)}`)}return new Promise(((r,n)=>{let o,i=!1;if(t===xe.Text){if(ee.isBrowser||ee.isWebWorker)o=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{const t=this._httpClient.getCookieString(e),r={};r.Cookie=t;const[n,i]=ae();r[n]=i,o=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:{...r,...this._options.headers}})}try{o.onmessage=e=>{if(this.onreceive)try{this._logger.log(Y.Trace,`(SSE transport) data received. ${te(e.data,this._options.logMessageContent)}.`),this.onreceive(e.data)}catch(e){return void this._close(e)}}, // @ts-ignore: not using event on purpose o.onerror=e=>{i?this._close():n(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},o.onopen=()=>{this._logger.log(Y.Information,`SSE connected to ${this._url}`),this._eventSource=o,i=!0,r()}}catch(e){return void n(e)}}else n(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))}))}async send(e){return this._eventSource?ne(this._logger,"SSE",this._httpClient,this._url,this._accessTokenFactory,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}} /** @private */ class _e{constructor(e,t,r,n,o,i){this._logger=r,this._accessTokenFactory=t,this._logMessageContent=n,this._webSocketConstructor=o,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=i}async connect(e,t){if(Z.isRequired(e,"url"),Z.isRequired(t,"transferFormat"),Z.isIn(t,xe,"transferFormat"),this._logger.log(Y.Trace,"(WebSockets transport) Connecting."),this._accessTokenFactory){const t=await this._accessTokenFactory();t&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(t)}`)}return new Promise(((r,n)=>{let o;e=e.replace(/^http/,"ws");const i=this._httpClient.getCookieString(e);let a=!1;if(ee.isNode){const t={},[r,n]=ae();t[r]=n,i&&(t[fe.Cookie]=`${i}`),o=new this._webSocketConstructor(e,void 0,{headers:{...t,...this._headers}})}o||(o=new this._webSocketConstructor(e)),t===xe.Binary&&(o.binaryType="arraybuffer"),o.onopen=t=>{this._logger.log(Y.Information,`WebSocket connected to ${e}.`),this._webSocket=o,a=!0,r()},o.onerror=e=>{let t=null;t="undefined"!=typeof ErrorEvent&&e instanceof ErrorEvent?e.error:"There was an error with the transport",this._logger.log(Y.Information,`(WebSockets transport) ${t}.`)},o.onmessage=e=>{if(this._logger.log(Y.Trace,`(WebSockets transport) data received. ${te(e.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(e.data)}catch(e){return void this._close(e)}},o.onclose=e=>{if(a)this._close(e);else{let t=null;t="undefined"!=typeof ErrorEvent&&e instanceof ErrorEvent?e.error:"WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",n(new Error(t))}}}))}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(Y.Trace,`(WebSockets transport) sending data. ${te(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(Y.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this._isCloseEvent(e)||!1!==e.wasClean&&1e3===e.code?e instanceof Error?this.onclose(e):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)))}_isCloseEvent(e){return e&&"boolean"==typeof e.wasClean&&"number"==typeof e.code}} /** @private */ class Ce{constructor(e,t={}){var r;if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,Z.isRequired(e,"url"),this._logger=void 0===(r=t.logger)?new ie(Y.Information):null===r?K.instance:void 0!==r.log?r:new ie(r),this.baseUrl=this._resolveUrl(e),(t=t||{}).logMessageContent=void 0!==t.logMessageContent&&t.logMessageContent,"boolean"!=typeof t.withCredentials&&void 0!==t.withCredentials)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");t.withCredentials=void 0===t.withCredentials||t.withCredentials,t.timeout=void 0===t.timeout?1e5:t.timeout;let n=null,o=null;if(ee.isNode){ // @ts-ignore: TS doesn't know about these names const e=require;n=e("ws"),o=e("eventsource")}ee.isNode||"undefined"==typeof WebSocket||t.WebSocket?ee.isNode&&!t.WebSocket&&n&&(t.WebSocket=n):t.WebSocket=WebSocket,ee.isNode||"undefined"==typeof EventSource||t.EventSource?ee.isNode&&!t.EventSource&&void 0!==o&&(t.EventSource=o):t.EventSource=EventSource,this._httpClient=t.httpClient||new ge(this._logger),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=t,this.onreceive=null,this.onclose=null}async start(e){if(e=e||xe.Binary,Z.isIn(e,xe,"transferFormat"),this._logger.log(Y.Debug,`Starting connection with transfer format '${xe[e]}'.`),"Disconnected"!==this._connectionState)return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(e),await this._startInternalPromise,"Disconnecting"===this._connectionState){const e="Failed to start the HttpConnection before stop() was called.";return this._logger.log(Y.Error,e),await this._stopPromise,Promise.reject(new Error(e))}if("Connected"!==this._connectionState){const e="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(Y.Error,e),Promise.reject(new Error(e))}this._connectionStarted=!0}send(e){return"Connected"!==this._connectionState?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new Ae(this.transport)),this._sendQueue.send(e))}async stop(e){return"Disconnected"===this._connectionState?(this._logger.log(Y.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):"Disconnecting"===this._connectionState?(this._logger.log(Y.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState="Disconnecting",this._stopPromise=new Promise((e=>{this._stopPromiseResolver=e})),await this._stopInternal(e),void await this._stopPromise)}async _stopInternal(e){this._stopError=e;try{await this._startInternalPromise}catch(e){}if(this.transport){try{await this.transport.stop()}catch(e){this._logger.log(Y.Error,`HttpConnection.transport.stop() threw error '${e}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(Y.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(e){let t=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==we.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(we.WebSockets),await this._startTransport(t,e)}else{let r=null,n=0;do{if(r=await this._getNegotiationResponse(t),"Disconnecting"===this._connectionState||"Disconnected"===this._connectionState)throw new Error("The connection was stopped during negotiation.");if(r.error)throw new Error(r.error);if(r.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(r.url&&(t=r.url),r.accessToken){const e=r.accessToken;this._accessTokenFactory=()=>e}n++}while(r.url&&n<100);if(100===n&&r.url)throw new Error("Negotiate redirection limit exceeded.");await this._createTransport(t,this._options.transport,r,e)}this.transport instanceof be&&(this.features.inherentKeepAlive=!0),"Connecting"===this._connectionState&&(this._logger.log(Y.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(e){return this._logger.log(Y.Error,"Failed to start the connection: "+e),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(e)}}async _getNegotiationResponse(e){const t={};if(this._accessTokenFactory){const e=await this._accessTokenFactory();e&&(t[fe.Authorization]=`Bearer ${e}`)}const[r,n]=ae();t[r]=n;const o=this._resolveNegotiateUrl(e);this._logger.log(Y.Debug,`Sending negotiation request: ${o}.`);try{const e=await this._httpClient.post(o,{content:"",headers:{...t,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(200!==e.statusCode)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${e.statusCode}'`));const r=JSON.parse(e.content);return(!r.negotiateVersion||r.negotiateVersion<1)&&(r.connectionToken=r.connectionId),r}catch(e){let t="Failed to complete negotiation with the server: "+e;return e instanceof U&&404===e.statusCode&&(t+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(Y.Error,t),Promise.reject(new Q(t))}}_createConnectUrl(e,t){return t?e+(-1===e.indexOf("?")?"?":"&")+`id=${t}`:e}async _createTransport(e,t,r,n){let o=this._createConnectUrl(e,r.connectionToken);if(this._isITransport(t))return this._logger.log(Y.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=t,await this._startTransport(o,n),void(this.connectionId=r.connectionId);const i=[],a=r.availableTransports||[];let s=r;for(const r of a){const a=this._resolveTransportOrError(r,t,n);if(a instanceof Error)i.push(`${r.transport} failed:`),i.push(a);else if(this._isITransport(a)){if(this.transport=a,!s){try{s=await this._getNegotiationResponse(e)}catch(e){return Promise.reject(e)}o=this._createConnectUrl(e,s.connectionToken)}try{return await this._startTransport(o,n),void(this.connectionId=s.connectionId)}catch(e){if(this._logger.log(Y.Error,`Failed to start the transport '${r.transport}': ${e}`),s=void 0,i.push(new G(`${r.transport} failed: ${e}`,we[r.transport])),"Connecting"!==this._connectionState){const e="Failed to select transport before stop() was called.";return this._logger.log(Y.Debug,e),Promise.reject(new Error(e))}}}}return i.length>0?Promise.reject(new X(`Unable to connect to the server with any of the available transports. ${i.join(" ")}`,i)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))}_constructTransport(e){switch(e){case we.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new _e(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case we.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new ye(this._httpClient,this._accessTokenFactory,this._logger,this._options);case we.LongPolling:return new be(this._httpClient,this._accessTokenFactory,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,t){return this.transport.onreceive=this.onreceive,this.transport.onclose=e=>this._stopConnection(e),this.transport.connect(e,t)}_resolveTransportOrError(e,t,r){const n=we[e.transport];if(null==n)return this._logger.log(Y.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(!function(e,t){return!e||0!=(t&e)} /** @private */(t,n))return this._logger.log(Y.Debug,`Skipping transport '${we[n]}' because it was disabled by the client.`),new V(`'${we[n]}' is disabled by the client.`,n);if(!(e.transferFormats.map((e=>xe[e])).indexOf(r)>=0))return this._logger.log(Y.Debug,`Skipping transport '${we[n]}' because it does not support the requested transfer format '${xe[r]}'.`),new Error(`'${we[n]}' does not support ${xe[r]}.`);if(n===we.WebSockets&&!this._options.WebSocket||n===we.ServerSentEvents&&!this._options.EventSource)return this._logger.log(Y.Debug,`Skipping transport '${we[n]}' because it is not supported in your environment.'`),new $(`'${we[n]}' is not supported in your environment.`,n);this._logger.log(Y.Debug,`Selecting transport '${we[n]}'.`);try{return this._constructTransport(n)}catch(e){return e}}_isITransport(e){return e&&"object"==typeof e&&"connect"in e}_stopConnection(e){if(this._logger.log(Y.Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,"Disconnected"!==this._connectionState){if("Connecting"===this._connectionState)throw this._logger.log(Y.Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if("Disconnecting"===this._connectionState&&this._stopPromiseResolver(),e?this._logger.log(Y.Error,`Connection disconnected with error '${e}'.`):this._logger.log(Y.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch((e=>{this._logger.log(Y.Error,`TransportSendQueue.stop() threw error '${e}'.`)})),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(t){this._logger.log(Y.Error,`HttpConnection.onclose(${e}) threw error '${t}'.`)}}}else this._logger.log(Y.Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`)}_resolveUrl(e){if(0===e.lastIndexOf("https://",0)||0===e.lastIndexOf("http://",0))return e;if(!ee.isBrowser)throw new Error(`Cannot resolve '${e}'.`);const t=window.document.createElement("a");return t.href=e,this._logger.log(Y.Information,`Normalizing '${e}' to '${t.href}'.`),t.href}_resolveNegotiateUrl(e){const t=e.indexOf("?");let r=e.substring(0,-1===t?e.length:t);return"/"!==r[r.length-1]&&(r+="/"),r+="negotiate",r+=-1===t?"":e.substring(t),-1===r.indexOf("negotiateVersion")&&(r+=-1===t?"?":"&",r+="negotiateVersion="+this._negotiateVersion),r}}class Ae{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new Ee,this._transportResult=new Ee,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new Ee),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}async _sendLoop(){for(;;){if(await this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new Ee;const e=this._transportResult;this._transportResult=void 0;const t="string"==typeof this._buffer[0]?this._buffer.join(""):Ae._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(t),e.resolve()}catch(t){e.reject(t)}}}static _concatBuffers(e){const t=e.map((e=>e.byteLength)).reduce(((e,t)=>e+t)),r=new Uint8Array(t);let n=0;for(const t of e)r.set(new Uint8Array(t),n),n+=t.byteLength;return r.buffer}}class Ee{constructor(){this.promise=new Promise(((e,t)=>[this._resolver,this._rejecter]=[e,t]))}resolve(){this._resolver()}reject(e){this._rejecter(e)}} /** @private */ class Se{static write(e){return`${e}${Se.RecordSeparator}`}static parse(e){if(e[e.length-1]!==Se.RecordSeparator)throw new Error("Message is incomplete.");const t=e.split(Se.RecordSeparator);return t.pop(),t}}Se.RecordSeparatorCode=30,Se.RecordSeparator=String.fromCharCode(Se.RecordSeparatorCode); /** @private */ class Te{writeHandshakeRequest(e){return Se.write(JSON.stringify(e))}parseHandshakeResponse(e){let t,r;if(re(e)){const n=new Uint8Array(e),o=n.indexOf(Se.RecordSeparatorCode);if(-1===o)throw new Error("Message is incomplete.");const i=o+1;t=String.fromCharCode.apply(null,Array.prototype.slice.call(n.slice(0,i))),r=n.byteLength>i?n.slice(i).buffer:null}else{const n=e,o=n.indexOf(Se.RecordSeparator);if(-1===o)throw new Error("Message is incomplete.");const i=o+1;t=n.substring(0,i),r=n.length>i?n.substring(i):null}const n=Se.parse(t),o=JSON.parse(n[0]);if(o.type)throw new Error("Expected a handshake response from the server.");return[r,o]}}var De;!function(e){ /** Indicates the message is an Invocation message and implements the {@link @microsoft/signalr.InvocationMessage} interface. */ e[e.Invocation=1]="Invocation", /** Indicates the message is a StreamItem message and implements the {@link @microsoft/signalr.StreamItemMessage} interface. */ e[e.StreamItem=2]="StreamItem", /** Indicates the message is a Completion message and implements the {@link @microsoft/signalr.CompletionMessage} interface. */ e[e.Completion=3]="Completion", /** Indicates the message is a Stream Invocation message and implements the {@link @microsoft/signalr.StreamInvocationMessage} interface. */ e[e.StreamInvocation=4]="StreamInvocation", /** Indicates the message is a Cancel Invocation message and implements the {@link @microsoft/signalr.CancelInvocationMessage} interface. */ e[e.CancelInvocation=5]="CancelInvocation", /** Indicates the message is a Ping message and implements the {@link @microsoft/signalr.PingMessage} interface. */ e[e.Ping=6]="Ping", /** Indicates the message is a Close message and implements the {@link @microsoft/signalr.CloseMessage} interface. */ e[e.Close=7]="Close"}(De||(De={}));class Ie{constructor(){this.observers=[]}next(e){for(const t of this.observers)t.next(e)}error(e){for(const t of this.observers)t.error&&t.error(e)}complete(){for(const e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new oe(this,e)}}var Me;!function(e){e.Disconnected="Disconnected",e.Connecting="Connecting",e.Connected="Connected",e.Disconnecting="Disconnecting",e.Reconnecting="Reconnecting"}(Me||(Me={}));class ke{constructor(e,t,r,n){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(Y.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://docs.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},Z.isRequired(e,"connection"),Z.isRequired(t,"logger"),Z.isRequired(r,"protocol"),this.serverTimeoutInMilliseconds=3e4,this.keepAliveIntervalInMilliseconds=15e3,this._logger=t,this._protocol=r,this.connection=e,this._reconnectPolicy=n,this._handshakeProtocol=new Te,this.connection.onreceive=e=>this._processIncomingData(e),this.connection.onclose=e=>this._connectionClosed(e),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=Me.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:De.Ping})} /** @internal */ static create(e,t,r,n){return new ke(e,t,r,n)}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""} /** * Sets a new url for the HubConnection. Note that the url can only be changed when the connection is in either the Disconnected or * Reconnecting states. * @param {string} url The url to connect to. */set baseUrl(e){if(this._connectionState!==Me.Disconnected&&this._connectionState!==Me.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e} /** Starts the connection. * * @returns {Promise} A Promise that resolves when the connection has been successfully established, or rejects with an error. */start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}async _startWithStateTransitions(){if(this._connectionState!==Me.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=Me.Connecting,this._logger.log(Y.Debug,"Starting HubConnection.");try{await this._startInternal(),ee.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=Me.Connected,this._connectionStarted=!0,this._logger.log(Y.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=Me.Disconnected,this._logger.log(Y.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}}async _startInternal(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;const e=new Promise(((e,t)=>{this._handshakeResolver=e,this._handshakeRejecter=t}));await this.connection.start(this._protocol.transferFormat);try{const t={protocol:this._protocol.name,version:this._protocol.version};if(this._logger.log(Y.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(t)),this._logger.log(Y.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await e,this._stopDuringStartError) // eslint-disable-next-line @typescript-eslint/no-throw-literal throw this._stopDuringStartError}catch(e){throw this._logger.log(Y.Debug,`Hub handshake failed with error '${e}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(e),e}} /** Stops the connection. * * @returns {Promise} A Promise that resolves when the connection has been successfully terminated, or rejects with an error. */async stop(){const e=this._startPromise;this._stopPromise=this._stopInternal(),await this._stopPromise;try{await e}catch(e){}}_stopInternal(e){return this._connectionState===Me.Disconnected?(this._logger.log(Y.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve()):this._connectionState===Me.Disconnecting?(this._logger.log(Y.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState=Me.Disconnecting,this._logger.log(Y.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(Y.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new Error("The connection was stopped before the hub handshake could complete."),this.connection.stop(e)))} /** Invokes a streaming hub method on the server using the specified name and arguments. * * @typeparam T The type of the items returned by the server. * @param {string} methodName The name of the server method to invoke. * @param {any[]} args The arguments used to invoke the server method. * @returns {IStreamResult} An object that yields results from the server as they are received. */stream(e,...t){const[r,n]=this._replaceStreamingParams(t),o=this._createStreamInvocation(e,t,n);let i;const a=new Ie;return a.cancelCallback=()=>{const e=this._createCancelInvocation(o.invocationId);return delete this._callbacks[o.invocationId],i.then((()=>this._sendWithProtocol(e)))},this._callbacks[o.invocationId]=(e,t)=>{t?a.error(t):e&&(e.type===De.Completion?e.error?a.error(new Error(e.error)):a.complete():a.next(e.item))},i=this._sendWithProtocol(o).catch((e=>{a.error(e),delete this._callbacks[o.invocationId]})),this._launchStreams(r,i),a}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)} /** * Sends a js object to the server. * @param message The js object to serialize and send. */_sendWithProtocol(e){return this._sendMessage(this._protocol.writeMessage(e))} /** Invokes a hub method on the server using the specified name and arguments. Does not wait for a response from the receiver. * * The Promise returned by this method resolves when the client has sent the invocation to the server. The server may still * be processing the invocation. * * @param {string} methodName The name of the server method to invoke. * @param {any[]} args The arguments used to invoke the server method. * @returns {Promise} A Promise that resolves when the invocation has been successfully sent, or rejects with an error. */send(e,...t){const[r,n]=this._replaceStreamingParams(t),o=this._sendWithProtocol(this._createInvocation(e,t,!0,n));return this._launchStreams(r,o),o} /** Invokes a hub method on the server using the specified name and arguments. * * The Promise returned by this method resolves when the server indicates it has finished invoking the method. When the promise * resolves, the server has finished invoking the method. If the server method returns a result, it is produced as the result of * resolving the Promise. * * @typeparam T The expected return type. * @param {string} methodName The name of the server method to invoke. * @param {any[]} args The arguments used to invoke the server method. * @returns {Promise} A Promise that resolves with the result of the server method (if any), or rejects with an error. */invoke(e,...t){const[r,n]=this._replaceStreamingParams(t),o=this._createInvocation(e,t,!1,n);return new Promise(((e,t)=>{this._callbacks[o.invocationId]=(r,n)=>{n?t(n):r&&(r.type===De.Completion?r.error?t(new Error(r.error)):e(r.result):t(new Error(`Unexpected message type: ${r.type}`)))};const n=this._sendWithProtocol(o).catch((e=>{t(e),delete this._callbacks[o.invocationId]}));this._launchStreams(r,n)}))} /** Registers a handler that will be invoked when the hub method with the specified method name is invoked. * * @param {string} methodName The name of the hub method to define. * @param {Function} newMethod The handler that will be raised when the hub method is invoked. */on(e,t){e&&t&&(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),-1===this._methods[e].indexOf(t)&&this._methods[e].push(t))}off(e,t){if(!e)return;e=e.toLowerCase();const r=this._methods[e];if(r)if(t){const n=r.indexOf(t);-1!==n&&(r.splice(n,1),0===r.length&&delete this._methods[e])}else delete this._methods[e]} /** Registers a handler that will be invoked when the connection is closed. * * @param {Function} callback The handler that will be invoked when the connection is closed. Optionally receives a single argument containing the error that caused the connection to close (if any). */onclose(e){e&&this._closedCallbacks.push(e)} /** Registers a handler that will be invoked when the connection starts reconnecting. * * @param {Function} callback The handler that will be invoked when the connection starts reconnecting. Optionally receives a single argument containing the error that caused the connection to start reconnecting (if any). */onreconnecting(e){e&&this._reconnectingCallbacks.push(e)} /** Registers a handler that will be invoked when the connection successfully reconnects. * * @param {Function} callback The handler that will be invoked when the connection successfully reconnects. */onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e){const t=this._protocol.parseMessages(e,this._logger);for(const e of t)switch(e.type){case De.Invocation:this._invokeClientMethod(e);break;case De.StreamItem:case De.Completion:{const t=this._callbacks[e.invocationId];if(t){e.type===De.Completion&&delete this._callbacks[e.invocationId];try{t(e)}catch(e){this._logger.log(Y.Error,`Stream callback threw error: ${he(e)}`)}}break}case De.Ping:break;case De.Close:{this._logger.log(Y.Information,"Close message received from server.");const t=e.error?new Error("Server returned an error on close: "+e.error):void 0;!0===e.allowReconnect? // eslint-disable-next-line @typescript-eslint/no-floating-promises this.connection.stop(t):this._stopPromise=this._stopInternal(t);break}default:this._logger.log(Y.Warning,`Invalid message type: ${e.type}.`)}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let t,r;try{[r,t]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(e){const t="Error parsing handshake response: "+e;this._logger.log(Y.Error,t);const r=new Error(t);throw this._handshakeRejecter(r),r}if(t.error){const e="Server returned handshake error: "+t.error;this._logger.log(Y.Error,e);const r=new Error(e);throw this._handshakeRejecter(r),r}return this._logger.log(Y.Debug,"Server handshake complete."),this._handshakeResolver(),r}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=(new Date).getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if(!(this.connection.features&&this.connection.features.inherentKeepAlive||(this._timeoutHandle=setTimeout((()=>this.serverTimeout()),this.serverTimeoutInMilliseconds),void 0!==this._pingServerHandle))){let e=this._nextKeepAlive-(new Date).getTime();e<0&&(e=0),this._pingServerHandle=setTimeout((async()=>{if(this._connectionState===Me.Connected)try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}}),e)}} // eslint-disable-next-line @typescript-eslint/naming-convention serverTimeout(){ // eslint-disable-next-line @typescript-eslint/no-floating-promises this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}_invokeClientMethod(e){const t=this._methods[e.target.toLowerCase()];if(t){try{t.forEach((t=>t.apply(this,e.arguments)))}catch(t){this._logger.log(Y.Error,`A callback for the method ${e.target.toLowerCase()} threw error '${t}'.`)}if(e.invocationId){const e="Server requested a response, which is not supported in this version of the client.";this._logger.log(Y.Error,e),this._stopPromise=this._stopInternal(new Error(e))}}else this._logger.log(Y.Warning,`No client method with the name '${e.target}' found.`)}_connectionClosed(e){this._logger.log(Y.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new Error("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===Me.Disconnecting?this._completeClose(e):this._connectionState===Me.Connected&&this._reconnectPolicy? // eslint-disable-next-line @typescript-eslint/no-floating-promises this._reconnect(e):this._connectionState===Me.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=Me.Disconnected,this._connectionStarted=!1,ee.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach((t=>t.apply(this,[e])))}catch(t){this._logger.log(Y.Error,`An onclose callback called with error '${e}' threw error '${t}'.`)}}}async _reconnect(e){const t=Date.now();let r=0,n=void 0!==e?e:new Error("Attempting to reconnect due to a unknown error."),o=this._getNextRetryDelay(r++,0,n);if(null===o)return this._logger.log(Y.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(e);if(this._connectionState=Me.Reconnecting,e?this._logger.log(Y.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(Y.Information,"Connection reconnecting."),0!==this._reconnectingCallbacks.length){try{this._reconnectingCallbacks.forEach((t=>t.apply(this,[e])))}catch(t){this._logger.log(Y.Error,`An onreconnecting callback called with error '${e}' threw error '${t}'.`)}if(this._connectionState!==Me.Reconnecting)return void this._logger.log(Y.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;null!==o;){if(this._logger.log(Y.Information,`Reconnect attempt number ${r} will start in ${o} ms.`),await new Promise((e=>{this._reconnectDelayHandle=setTimeout(e,o)})),this._reconnectDelayHandle=void 0,this._connectionState!==Me.Reconnecting)return void this._logger.log(Y.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=Me.Connected,this._logger.log(Y.Information,"HubConnection reconnected successfully."),0!==this._reconnectedCallbacks.length)try{this._reconnectedCallbacks.forEach((e=>e.apply(this,[this.connection.connectionId])))}catch(e){this._logger.log(Y.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${e}'.`)}return}catch(e){if(this._logger.log(Y.Information,`Reconnect attempt failed because of error '${e}'.`),this._connectionState!==Me.Reconnecting)return this._logger.log(Y.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this._connectionState===Me.Disconnecting&&this._completeClose());n=e instanceof Error?e:new Error(e.toString()),o=this._getNextRetryDelay(r++,Date.now()-t,n)}}this._logger.log(Y.Information,`Reconnect retries have been exhausted after ${Date.now()-t} ms and ${r} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(e,t,r){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:t,previousRetryCount:e,retryReason:r})}catch(r){return this._logger.log(Y.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${t}) threw error '${r}'.`),null}}_cancelCallbacksWithError(e){const t=this._callbacks;this._callbacks={},Object.keys(t).forEach((r=>{const n=t[r];try{n(null,e)}catch(t){this._logger.log(Y.Error,`Stream 'error' callback called with '${e}' threw error: ${he(t)}`)}}))}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,t,r,n){if(r)return 0!==n.length?{arguments:t,streamIds:n,target:e,type:De.Invocation}:{arguments:t,target:e,type:De.Invocation};{const r=this._invocationId;return this._invocationId++,0!==n.length?{arguments:t,invocationId:r.toString(),streamIds:n,target:e,type:De.Invocation}:{arguments:t,invocationId:r.toString(),target:e,type:De.Invocation}}}_launchStreams(e,t){if(0!==e.length){t||(t=Promise.resolve());for(const r in e)e[r].subscribe({complete:()=>{t=t.then((()=>this._sendWithProtocol(this._createCompletionMessage(r))))},error:e=>{let n;n=e instanceof Error?e.message:e&&e.toString?e.toString():"Unknown error",t=t.then((()=>this._sendWithProtocol(this._createCompletionMessage(r,n))))},next:e=>{t=t.then((()=>this._sendWithProtocol(this._createStreamItemMessage(r,e))))}})}}_replaceStreamingParams(e){const t=[],r=[];for(let n=0;n\n
\n \n
\n ');h("body").appendChild(o),Fe(o,o.querySelector("#hanoicollab-chat-messages")),null===(t=h("#hanoicollab-chat-input"))||void 0===t||t.addEventListener("keyup",(async function(e){var t;if("Enter"===e.key){var r=h("#hanoicollab-chat-input").value;r&&(h("#hanoicollab-chat-input").value="",await(null===(t=S.ChatConnection)||void 0===t?void 0:t.invoke("SendMessage",S.Channel,r)),e.preventDefault())}})),null===(r=S.ChatConnection)||void 0===r||r.on("ReceiveMessage",(function(e,t){var r,n="",o=("@<"+S.ActiveUsername+">").escapeHTML();(t=t.escapeHTML()).includes(o)&&(n="background-color:rgba(255,255,0,0.9);",t=t.replace(new RegExp(o.escapeRegex(),"g"),`@${S.ActiveUsername}`)),null===(r=h("#hanoicollab-chat-messages"))||void 0===r||r.appendChild(a.createElement(`

${e.escapeHTML()}: ${t}

`)),h("#hanoicollab-chat-messages").scrollTop=h("#hanoicollab-chat-messages").scrollHeight})),await(null===(n=S.ChatConnection)||void 0===n?void 0:n.invoke("JoinChannel",S.Channel)),B("c",(function(){var e=h("#hanoicollab-chat-container");e&&("none"==e.style.display?e.style.display="":e.style.display="none")}))}async function Le(){S.ChatConnection&&(await S.ChatConnection.invoke("LeaveChannel",S.Channel),S.ChatConnection.DeliberateClose=!0,await S.ChatConnection.stop(),S.ChatConnection=null)}class He extends Array{constructor(){super(...arguments),this.Alpha=""}}function Re(){var e,t,r=S.Document.getElementById("hanoicollab-sus-questions-list"),n=S.Document.getElementById("hanoicollab-sus-questions-list-none"),o=S.Questions,i=[];for(var s of o)if(s.IsMultipleChoice()){var l=!1;for(var c in s.CommunityAnswers.MultipleChoice)if(s.CommunityAnswers.MultipleChoice[c].length){if(l){i.push(s);break}l=!0}}if(i.length){r.style.display="block",n.style.display="none";var u=r.cloneNode(!1);u.innerText="";for(let r of i){var h=[];for(var c in r.CommunityAnswers.MultipleChoice)r.CommunityAnswers.MultipleChoice[c].length&&h.push(r.CommunityAnswers.MultipleChoice[c].Alpha);var d=a.createElement(`\n
\n

Question #${r.Index+1}: ${h.join(",")}

\n
\n \n \n
\n

\n
\n `);null===(e=d.querySelector(".hanoicollab-ping-button"))||void 0===e||e.addEventListener("click",(async function(){await r.Ping()})),null===(t=d.querySelector(".hanoicollab-focus-button"))||void 0===t||t.addEventListener("click",(function(){S.ProviderFunctions.FocusQuestion(r)})),u.appendChild(d)}r.replaceWith(u)}else r.style.display="none",n.style.display=""}var Ue;!function(e){e[e.Info=0]="Info",e[e.Success=1]="Success",e[e.Warning=2]="Warning",e[e.Error=3]="Error"}(Ue||(Ue={}));class je{constructor(){this.Text="",this.Function=()=>{}}}function We(e,t,r=5e3,n=[]){if(!S.IsStealthMode){var o="";switch(e){case Ue.Info:o="info";break;case Ue.Success:o="success";break;case Ue.Warning:o="warning";break;case Ue.Error:o="error"}var i=void 0;"string"==typeof t?i=t:t,S.Window.SnackBar({message:i,status:o,dismissible:!0,timeout:r,actions:n.map((e=>({text:e.Text,function:e.Function,dismiss:!0}))),fixed:!0,position:"tr",container:S.Document.body})}}async function $e(){if(S.ExamConnection&&"Connected"===S.ExamConnection.state)return S.ExamConnection;var e=(new Ne).withUrl(S.Server+"hubs/exam",{accessTokenFactory:P}).build();S.ExamConnection=e;var r=S.Questions;return e.on("InitializeExam",(async function(e){for(var t of r)if(t.IsMultipleChoice())for(var n of t.Answers)t.CommunityAnswers.MultipleChoice[n.Id]=new He,t.CommunityAnswers.MultipleChoice[n.Id].Alpha=n.Alpha;for(var o=0;oc&&a.push(""),a[a.length-1]+=l}for(s=0;s{document.addEventListener("readystatechange",(function(){"complete"===document.readyState&&e()})),"complete"===document.readyState&&e()}))},async function(){if(!window.location.origin.startsWith("blob")){S.Provider=function(t){switch(t){case"azota.vn":return e.Azota;case"docs.google.com":return e.GoogleDocs;case"forms.office.com":return e.MicrosoftForms;case"quilgo.com":return e.Quilgo;case"shub.edu.vn":return e.Shub;case"study.hanoi.edu.vn":return e.HanoiStudy;default:return e.None}}(location.hostname),S.Channel=location.href,await document.waitForReady();var t,r=window.history.pushState;window.history.pushState=function(e,t,n){n&&(window.location.href=n.toString()),r(e,t,n)},await async function(){if(S.ProviderFunctions.DisableSandbox())return S.Window=unsafeWindow,S.Document=document,Promise.resolve({Window:S.Window,Document:S.Document});var e=a.createElement("\n \n ");window.document.body.textContent="",window.document.body.appendChild(e);var t=window.document.createElement("iframe");t.id="iframe1",window.document.body.appendChild(t);var r,n=await b(location.href),o=(new DOMParser).parseFromString(n.responseText,"text/html");for(var i of o.getElementsByTagName("base"))i.href=location.origin+"/";for(var s of o.documentElement.getElementsByTagName("*"))Ge(s),await Xe(s),r=s,S.ProviderFunctions.PatchElement(r);var l=new Blob([o.documentElement.outerHTML],{type:"text/html"});return await new Promise((function(e,r){t.onload=function(){new MutationObserver((async function(e){for(var t of e)for(var r of t.addedNodes)if("getAttribute"in r&&"getElementsByTagName"in r){var n=r;for(var o of(Ge(n),await Xe(n),n.getElementsByTagName("*")))Ge(o),await Xe(o)}})).observe(t.contentDocument.documentElement,{childList:!0,subtree:!0}),S.Document=t.contentDocument,S.Window=t.contentWindow,e({Document:t.contentDocument,Window:t.contentWindow})},t.src=URL.createObjectURL(l)}))}(),S.EnableTrackingPrevention&&(S.Window.HanoiCollabExposedVariables=S.Window.HanoiCollabExposedVariables||[],S.Window.HanoiCollabExposedVariables.HanoiCollabApproveRequest=async function(e){if("quilgo.com"!==S.Provider);else if("snapshots"==e.path||"screenshots"==e.path){if(S.AlwaysBlockImage&&S.AlwaysBlockImage[e.path])throw"Image blocked by HanoiCollab";if(S.AlwaysSendImage&&S.AlwaysSendImage[e.path])return;if(S.LoopImage&&S.LoopImage[e.path]){console.log("HanoiCollab is looping an old image for "+e.path),e.payload.image=S.LoopImage[e.path];var t="";switch(e.path){case"snapshots":t="camera";break;case"screenshots":t="screen"}return S.AlwaysBlockImage=S.AlwaysBlockImage||{},S.AlwaysBlockImage[e.path]=!0,console.log("HanoiCollab is restoring original interval...."),void setTimeout((function(){S.AlwaysBlockImage=S.AlwaysBlockImage||{},S.AlwaysBlockImage[e.path]=!1}),S.Window.HanoiCollabExposedVariables.OldIntervals[t])}var r=(new DOMParser).parseFromString(`\n

Quilgo's PLASM engine is trying to record your ${"snapshots"==e.path?"snapshot":"screenshot"}! Choose your action!

\n
\n \n
\n \n \n \n \n \n `,"text/html").body;switch(await M(r,!0)){case"loop":var n=e.payload.image;return S.LoopImage=S.LoopImage||{},void(S.LoopImage[e.path]=n);case"send":return;case"always-send":return S.AlwaysSendImage=S.AlwaysSendImage||{},void(S.AlwaysSendImage[e.path]=!0);case"block":throw"Image blocked by HanoiCollab";case"always-block":throw S.AlwaysBlockImage=S.AlwaysBlockImage||{},S.AlwaysBlockImage[e.path]=!0,"Image blocked by HanoiCollab"}}}),await I(),S.Document.addEventListener("keyup",(function(e){var t;if(e.altKey)for(var r of null!==(t=F[e.key])&&void 0!==t?t:[])r(e)}),!1),B("h",(e=>T())),B("s",(e=>N())),B("l",(e=>q(null,!0))),(t=S.Document.createElement("style")).innerText='\n *[id^="hanoicollab-"], *[class^="hanoicollab-"] {\n box-sizing: border-box;\n font-family: Segoe UI,Segoe WP,Tahoma,Arial,sans-serif;\n font-size: 14px;\n font-stretch: 100%;\n font-style: normal;\n font-variant-caps: normal;\n font-variant-east-asian: normal;\n font-variant-ligatures: normal;\n font-variant-numeric: normal;\n font-weight: 400;\n letter-spacing: normal;\n line-height: 1.5;\n margin: 0;\n margin-block-start: 0px;\n margin-block-end: 0px;\n margin-inline-start: 0px;\n margin-inline-end: 0px;\n padding: 0;\n text-size-adjust: 100%;\n user-select: none;\n -webkit-font-smoothing: antialiased;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n }\n .hanoicollab-basic-container p {\n margin: 0;\n }\n .hanoicollab-button {\n background-color: rgba(0,127,127,0.9);\n border: 1px solid black;\n border-radius: 1ex;\n padding: 0.5em;\n color: white;\n cursor: pointer;\n line-height: 1.5;\n text-transform: unset !important;\n }\n .hanoicollab-section {\n margin-block-start: 0.5em;\n margin-block-end: 0.5em;\n }\n ',S.Document.body.appendChild(t),B("a",L),function(){var e=new Date(Date.now()),t=a.createElement(` \n
\n \n \n
\n

\n ${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}\n
\n ${e.getDate().toString().padStart(2,"0")}/${(e.getMonth()+1).toString().padStart(2,"0")}/${e.getFullYear()}\n

\n
\n
\n
\n `);if(t.style.display="none",window==top){S.Document.body.appendChild(t),h("#hanoicollab-fake-taskbar-time").style.display="none";var r=!1;S.Document.addEventListener("keydown",(function(e){var t;if(e.altKey&&"t"===e.key)if(r=!r,h("#hanoicollab-fake-taskbar-time").style.display=r?"flex":"none",h("#hanoicollab-fake-taskbar").style.display=r?"block":"none",r){var n=S.Document.createElement("style");n.innerHTML="\n ::-webkit-scrollbar {\n display: none;\n }\n ",n.id="hanoicollab-hide-scrollbar-style",S.Document.head.appendChild(n)}else null===(t=S.Document.getElementById("hanoicollab-hide-scrollbar-style"))||void 0===t||t.remove()})),setInterval((function(){var e=new Date(Date.now());h("#hanoicollab-fake-taskbar-time").innerHTML=`\n

\n ${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}\n
\n ${e.getDate().toString().padStart(2,"0")}/${(e.getMonth()+1).toString().padStart(2,"0")}/${e.getFullYear()}\n

\n `}),1e3)}}(),await async function(){var e=(await b("https://raw.githubusercontent.com/mickelsonmichael/js-snackbar/master/dist/js-snackbar.css")).responseText.replace(new RegExp("js-snackbar".escapeRegex(),"g"),"hanoicollab-js-snackbar");S.Document.body.appendChild(a.createElement(`\n \n `));var t=(await b("https://raw.githubusercontent.com/mickelsonmichael/js-snackbar/master/dist/js-snackbar.js")).responseText.replace(new RegExp("js-snackbar".escapeRegex(),"g"),"hanoicollab-js-snackbar");S.Window.eval(t)}(),await async function(){var e=await GM_getValue("HanoiCollabServer",null);return e||(e=N()),S.Server=e,e}();var n=!1;await async function(){var e=JSON.parse(await GM_getValue("HanoiCollabIdentity",null));if(k=JSON.parse(await GM_getValue("HanoiCollabSuppressLoginPopupTimestamp","0")),!e||!e.Token||!e.Expiration||Date.parse(e.Expiration)<=Date.now())try{await q()}catch(e){return console.warn("Failed to log in to HanoiCollab. Some features may be unavailable."),null}var t=await GM_getValue("HanoiCollabUsername",null);return S.Identity=e,S.ActiveUsername=t,S.Identity}()&&(n=!0),n&&(await Be(),await Oe());var o=await S.ProviderFunctions.WaitForTestReady();S.OnIdentityChange=async function(){try{await Le()}catch(e){console.warn("Failed to terminate chat connection.")}if(await Be(),await Oe(),o){try{await Ve()}catch(e){console.warn("Failed to terminate exam connection.")}await $e()}},o&&(S.Questions=S.ProviderFunctions.GetQuestionInfos(),S.ProviderFunctions.SetupElementHooks(),function(){var e;null===(e=S.Document.querySelector("#hanoicollab-sus-questions-container"))||void 0===e||e.remove();var t=a.createElement('\n
\n

ඞඞඞඞSuspicious Questionsඞඞඞඞ

\n \n
\n You\'re doing great! No suspicious questions.\n
\n
\n ');S.Document.body.appendChild(t),Fe(t),B("c",(function(){"none"==t.style.display?t.style.display="":t.style.display="none"}))}(),S.ProviderFunctions.SetupCommunityAnswersUI(),await $e()),window.addEventListener("beforeunload",(async function(){await Le(),await Ve()}))}}()})()})();