"use strict";(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[1408],{11408:(e,t,a)=>{a.r(t),a.d(t,{MathJaxTypesetter:()=>s,default:()=>o});var n,i=a(46142);!function(e){e.copy="mathjax:clipboard",e.scale="mathjax:scale"}(n||(n={}));class s{constructor(){this._initialized=!1}async _ensureInitialized(){if(this._initialized)return;await Promise.all([a.e(7969),a.e(5115),a.e(792)]).then(a.t.bind(a,20792,23));const{mathjax:e}=await a.e(4971).then(a.bind(a,44971)),{CHTML:t}=await Promise.all([a.e(7969),a.e(28),a.e(2065),a.e(7369)]).then(a.t.bind(a,57369,23)),{TeX:n}=await Promise.all([a.e(7969),a.e(5115),a.e(7154),a.e(7582)]).then(a.t.bind(a,27582,23)),{TeXFont:i}=await Promise.all([a.e(2065),a.e(4498)]).then(a.t.bind(a,42065,23)),{AllPackages:s}=await Promise.all([a.e(7969),a.e(5115),a.e(7154),a.e(8845)]).then(a.bind(a,78845)),{SafeHandler:o}=await a.e(8285).then(a.t.bind(a,78285,23)),{HTMLHandler:c}=await Promise.all([a.e(7969),a.e(28),a.e(2666),a.e(7471)]).then(a.t.bind(a,97471,23)),{browserAdaptor:r}=await a.e(270).then(a.bind(a,90270)),{AssistiveMmlHandler:l}=await Promise.all([a.e(7969),a.e(28),a.e(2666),a.e(4105)]).then(a.t.bind(a,74105,23));e.handlers.register(l(o(new c(r()))));const d=new t({font:new class extends i{constructor(){super(...arguments),this.defaultFonts={}}}}),h=new n({packages:s.concat("require"),inlineMath:[["$","$"],["\\(","\\)"]],displayMath:[["$$","$$"],["\\[","\\]"]],processEscapes:!0,processEnvironments:!0});this._mathDocument=e.document(window.document,{InputJax:h,OutputJax:d}),this._initialized=!0}async mathDocument(){return await this._ensureInitialized(),this._mathDocument}async typeset(e){try{await this._ensureInitialized()}catch(e){return void console.error(e)}this._mathDocument.options.elements=[e],this._mathDocument.clear().render(),delete this._mathDocument.options.elements}}const o={id:"@jupyterlab/mathjax-extension:plugin",provides:i.ILatexTypesetter,activate:e=>{const t=new s;return e.commands.addCommand(n.copy,{execute:async()=>{const e=(await t.mathDocument()).outputJax;await navigator.clipboard.writeText(e.math.math)},label:"MathJax Copy Latex"}),e.commands.addCommand(n.scale,{execute:async e=>{const a=await t.mathDocument(),n=e.scale||1;a.outputJax.options.scale=n,a.rerender()},label:e=>"Mathjax Scale "+(e.scale?`x${e.scale}`:"Reset")}),t},autoStart:!0}}}]);