"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[8773],{58773:(e,t,a)=>{a.r(t),a.d(t,{MathJaxTypesetter:()=>r,default:()=>u});var i=a(62246),n=a(40488),o=a(90182),s=a(68211);class r{constructor(e){this._initPromise=new s.PromiseDelegate,this._initialized=!1,this._url=e.url,this._config=e.config}typeset(e){this._initialized||this._init(),this._initPromise.promise.then((()=>{MathJax.Hub.Queue(["Typeset",MathJax.Hub,e]);try{MathJax.Hub.Queue(["Require",MathJax.Ajax,"[MathJax]/extensions/TeX/AMSmath.js"],(()=>{MathJax.InputJax.TeX.resetEquationNumbers()}))}catch(e){console.error("Error queueing resetEquationNumbers:",e)}}))}_init(){const e=document.getElementsByTagName("head")[0],t=document.createElement("script");t.type="text/javascript",t.src=`${this._url}?config=${this._config}&amp;delayStartupUntil=configured`,t.charset="utf-8",e.appendChild(t),t.addEventListener("load",(()=>{this._onLoad()})),this._initialized=!0}_onLoad(){MathJax.Hub.Config({tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]],displayMath:[["$$","$$"],["\\[","\\]"]],processEscapes:!0,processEnvironments:!0},displayAlign:"center",CommonHTML:{linebreaks:{automatic:!0}},"HTML-CSS":{availableFonts:[],imageFont:null,preferredFont:null,webFont:"STIX-Web",styles:{".MathJax_Display":{margin:0}},linebreaks:{automatic:!0}},skipStartupTypeset:!0,messageStyle:"none"}),MathJax.Hub.Register.StartupHook("End Config",(()=>{var e,t,a,i,n,o;null===(a=null===(t=null===(e=MathJax.Hub)||void 0===e?void 0:e.config)||void 0===t?void 0:t.MathEvents)||void 0===a||delete a.styles[".MathJax_Hover_Arrow:hover span"],null===(o=null===(n=null===(i=MathJax.Hub)||void 0===i?void 0:i.config)||void 0===n?void 0:n.MathMenu)||void 0===o||delete o.styles[".MathJax_MenuClose:hover span"]})),MathJax.Hub.Configured(),this._initPromise.resolve(void 0)}}const l={id:"@jupyterlab/mathjax2-extension:plugin",autoStart:!0,provides:n.ILatexTypesetter,optional:[o.ITranslator],activate:(e,t)=>{const a=(null!=t?t:o.nullTranslator).load("jupyterlab"),[n,s]=["fullMathjaxUrl","mathjaxConfig"],u=i.PageConfig.getOption(n),h=i.PageConfig.getOption(s);if(!u){const e=a.__("%1 uses '%2' and '%3' in PageConfig to operate but '%4' was not found.",l.id,n,s,n);throw new Error(e)}return new r({url:u,config:h})}},u=l}}]);