ocaml
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Replace vendored theme with submodule

+3 -8783
+3
.gitmodules
··· 1 + [submodule "bin/forester/theme"] 2 + path = bin/forester/theme 3 + url = https://git.sr.ht/~jonsterling/forester-base-theme
-29
bin/forester/theme/REUSE.toml
··· 1 - # SPDX-FileCopyrightText: 2024 The Forester Project Contributors 2 - # 3 - # SPDX-License-Identifier: GPL-3.0-or-later 4 - 5 - version = 3 6 - 7 - [[annotations]] 8 - path = ["fonts/KaTeX*", "katex.min.css"] 9 - precedence = "override" 10 - SPDX-FileCopyrightText = "2013-2020 Khan Academy and other contributors" 11 - SPDX-License-Identifier = "MIT" 12 - 13 - [[annotations]] 14 - path = ["fonts/inria-sans*"] 15 - precedence = "override" 16 - SPDX-FileCopyrightText = "2017 The Inria Sans Project Authors" 17 - SPDX-License-Identifier = "OFL-1.1" 18 - 19 - [[annotations]] 20 - path = ["*.xsl", "*.png", "*.css", "*.sh", "*.ico", "*.json", "**/**.js", "index.html"] 21 - precedence = "override" 22 - SPDX-FileCopyrightText = "2024 The Forester Project Contributors" 23 - SPDX-License-Identifier = "CC0-1.0" 24 - 25 - [[annotations]] 26 - path = ["htmx.js"] 27 - precedence = "override" 28 - SPDX-FileCopyrightText = "2020, Big Sky Software" 29 - SPDX-License-Identifier = "0BSD"
bin/forester/theme/android-chrome-192x192.png

This is a binary file and will not be displayed.

bin/forester/theme/android-chrome-512x512.png

This is a binary file and will not be displayed.

bin/forester/theme/apple-touch-icon.png

This is a binary file and will not be displayed.

-7
bin/forester/theme/bundle-js.sh
··· 1 - #!/bin/bash 2 - 3 - npm install 4 - 5 - ./node_modules/.bin/esbuild --minify --bundle javascript-source/forester.js --outfile=forester.js 6 - 7 -
-130
bin/forester/theme/core.xsl
··· 1 - <?xml version="1.0"?> 2 - <!-- SPDX-License-Identifier: CC0-1.0 --> 3 - <xsl:stylesheet version="1.0" 4 - xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 5 - xmlns:f="http://www.jonmsterling.com/jms-005P.xml" 6 - xmlns:mml="http://www.w3.org/1998/Math/MathML" 7 - xmlns:html="http://www.w3.org/1999/xhtml"> 8 - 9 - <!-- The following ensures that node not matched by a template will show up as an error. --> 10 - <xsl:template match="node()|@*"> 11 - <xsl:copy> 12 - <span style="background-color:red"> 13 - <xsl:text>[</xsl:text> 14 - <xsl:value-of select="name(.)" /> 15 - <xsl:text>]</xsl:text> 16 - </span> 17 - <span style="background-color:red"> 18 - <xsl:apply-templates select="node()|@*" /> 19 - </span> 20 - </xsl:copy> 21 - </xsl:template> 22 - 23 - <!-- HTML and MathML nodes should be copied with namespace prefixes stripped.--> 24 - <xsl:template match="html:*"> 25 - <xsl:element namespace="http://www.w3.org/1999/xhtml" name="{local-name()}"> 26 - <xsl:apply-templates select="@* | node()" /> 27 - </xsl:element> 28 - </xsl:template> 29 - 30 - <xsl:template match="mml:*"> 31 - <xsl:element namespace="http://www.w3.org/1998/Math/MathML" name="{local-name()}"> 32 - <xsl:apply-templates select="@* | node()" /> 33 - </xsl:element> 34 - </xsl:template> 35 - 36 - <xsl:template match="f:figure"> 37 - <figure> 38 - <xsl:apply-templates /> 39 - </figure> 40 - </xsl:template> 41 - 42 - <xsl:template match="f:figcaption"> 43 - <figcaption> 44 - <xsl:apply-templates /> 45 - </figcaption> 46 - </xsl:template> 47 - 48 - <xsl:template match="f:p"> 49 - <p> 50 - <xsl:apply-templates /> 51 - </p> 52 - </xsl:template> 53 - 54 - <xsl:template match="f:code"> 55 - <code> 56 - <xsl:apply-templates /> 57 - </code> 58 - </xsl:template> 59 - 60 - <xsl:template match="f:pre"> 61 - <pre> 62 - <xsl:apply-templates /> 63 - </pre> 64 - </xsl:template> 65 - 66 - <xsl:template match="f:em"> 67 - <em> 68 - <xsl:apply-templates /> 69 - </em> 70 - </xsl:template> 71 - 72 - <xsl:template match="f:strong"> 73 - <strong> 74 - <xsl:apply-templates /> 75 - </strong> 76 - </xsl:template> 77 - 78 - <xsl:template match="f:ol"> 79 - <ol> 80 - <xsl:apply-templates /> 81 - </ol> 82 - </xsl:template> 83 - 84 - <xsl:template match="f:ul"> 85 - <ul> 86 - <xsl:apply-templates /> 87 - </ul> 88 - </xsl:template> 89 - 90 - <xsl:template match="f:li"> 91 - <li> 92 - <xsl:apply-templates /> 93 - </li> 94 - </xsl:template> 95 - 96 - <xsl:template match="f:blockquote"> 97 - <blockquote> 98 - <xsl:apply-templates /> 99 - </blockquote> 100 - </xsl:template> 101 - 102 - <xsl:template match="f:img[@src]"> 103 - <img src="{@src}" /> 104 - </xsl:template> 105 - 106 - <xsl:template match="f:error | f:info"> 107 - <span class="error"> 108 - <xsl:apply-templates /> 109 - </span> 110 - </xsl:template> 111 - 112 - <xsl:template match="f:info"> 113 - <span class="info"> 114 - <xsl:apply-templates /> 115 - </span> 116 - </xsl:template> 117 - 118 - <xsl:template match="f:tex[@display='block']"> 119 - <xsl:text>\[</xsl:text> 120 - <xsl:value-of select="." /> 121 - <xsl:text>\]</xsl:text> 122 - </xsl:template> 123 - 124 - <xsl:template match="f:tex[not(@display='block')]"> 125 - <xsl:text>\(</xsl:text> 126 - <xsl:value-of select="." /> 127 - <xsl:text>\)</xsl:text> 128 - </xsl:template> 129 - 130 - </xsl:stylesheet>
-14
bin/forester/theme/default.xsl
··· 1 - <?xml version="1.0"?> 2 - <!-- SPDX-License-Identifier: CC0-1.0 --> 3 - <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 4 - 5 - <xsl:output method="html" encoding="utf-8" indent="yes" doctype-public="" doctype-system="" /> 6 - 7 - <xsl:include href="core.xsl" /> 8 - <xsl:include href="metadata.xsl" /> 9 - <xsl:include href="links.xsl" /> 10 - <xsl:include href="tree.xsl" /> 11 - 12 - <!-- <xsl:template match="pause"></xsl:template> --> 13 - 14 - </xsl:stylesheet>
bin/forester/theme/favicon-16x16.png

This is a binary file and will not be displayed.

bin/forester/theme/favicon-32x32.png

This is a binary file and will not be displayed.

bin/forester/theme/favicon.ico

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_AMS-Regular.ttf

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_AMS-Regular.woff

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_AMS-Regular.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Caligraphic-Bold.ttf

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Caligraphic-Bold.woff

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Caligraphic-Bold.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Caligraphic-Regular.ttf

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Caligraphic-Regular.woff

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Caligraphic-Regular.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Fraktur-Bold.ttf

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Fraktur-Bold.woff

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Fraktur-Bold.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Fraktur-Regular.ttf

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Fraktur-Regular.woff

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Fraktur-Regular.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Main-Bold.ttf

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Main-Bold.woff

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Main-Bold.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Main-BoldItalic.ttf

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Main-BoldItalic.woff

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Main-BoldItalic.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Main-Italic.ttf

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Main-Italic.woff

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Main-Italic.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Main-Regular.ttf

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Main-Regular.woff

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Main-Regular.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Math-BoldItalic.ttf

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Math-BoldItalic.woff

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Math-BoldItalic.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Math-Italic.ttf

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Math-Italic.woff

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Math-Italic.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_SansSerif-Bold.ttf

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_SansSerif-Bold.woff

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_SansSerif-Bold.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_SansSerif-Italic.ttf

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_SansSerif-Italic.woff

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_SansSerif-Italic.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_SansSerif-Regular.ttf

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_SansSerif-Regular.woff

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_SansSerif-Regular.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Script-Regular.ttf

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Script-Regular.woff

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Script-Regular.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Size1-Regular.ttf

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Size1-Regular.woff

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Size1-Regular.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Size2-Regular.ttf

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Size2-Regular.woff

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Size2-Regular.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Size3-Regular.ttf

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Size3-Regular.woff

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Size3-Regular.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Size4-Regular.ttf

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Size4-Regular.woff

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Size4-Regular.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Typewriter-Regular.ttf

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Typewriter-Regular.woff

This is a binary file and will not be displayed.

bin/forester/theme/fonts/KaTeX_Typewriter-Regular.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/inria-sans-v14-latin_latin-ext-300.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/inria-sans-v14-latin_latin-ext-300italic.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/inria-sans-v14-latin_latin-ext-700.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/inria-sans-v14-latin_latin-ext-700italic.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/inria-sans-v14-latin_latin-ext-italic.woff2

This is a binary file and will not be displayed.

bin/forester/theme/fonts/inria-sans-v14-latin_latin-ext-regular.woff2

This is a binary file and will not be displayed.

-876
bin/forester/theme/forester.js
··· 1 - (()=>{var ht=window,ct=ht.ShadowRoot&&(ht.ShadyCSS===void 0||ht.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,or=Symbol(),ba=new WeakMap,qe=class{constructor(e,t,a){if(this._$cssResult$=!0,a!==or)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(ct&&e===void 0){let a=t!==void 0&&t.length===1;a&&(e=ba.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),a&&ba.set(t,e))}return e}toString(){return this.cssText}},xa=r=>new qe(typeof r=="string"?r:r+"",void 0,or),j0=(r,...e)=>{let t=r.length===1?r[0]:e.reduce((a,n,i)=>a+(l=>{if(l._$cssResult$===!0)return l.cssText;if(typeof l=="number")return l;throw Error("Value passed to 'css' function must be a 'css' function result: "+l+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+r[i+1],r[0]);return new qe(t,r,or)},ur=(r,e)=>{ct?r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(t=>{let a=document.createElement("style"),n=ht.litNonce;n!==void 0&&a.setAttribute("nonce",n),a.textContent=t.cssText,r.appendChild(a)})},dt=ct?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let a of e.cssRules)t+=a.cssText;return xa(t)})(r):r;var hr,mt=window,wa=mt.trustedTypes,Ii=wa?wa.emptyScript:"",ka=mt.reactiveElementPolyfillSupport,dr={toAttribute(r,e){switch(e){case Boolean:r=r?Ii:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},Sa=(r,e)=>e!==r&&(e==e||r==r),cr={attribute:!0,type:String,converter:dr,reflect:!1,hasChanged:Sa},mr="finalized",F0=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var t;this.finalize(),((t=this.h)!==null&&t!==void 0?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((t,a)=>{let n=this._$Ep(a,t);n!==void 0&&(this._$Ev.set(n,a),e.push(n))}),e}static createProperty(e,t=cr){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){let a=typeof e=="symbol"?Symbol():"__"+e,n=this.getPropertyDescriptor(e,a,t);n!==void 0&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,t,a){return{get(){return this[t]},set(n){let i=this[e];this[t]=n,this.requestUpdate(e,i,a)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||cr}static finalize(){if(this.hasOwnProperty(mr))return!1;this[mr]=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let t=this.properties,a=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(let n of a)this.createProperty(n,t[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let a=new Set(e.flat(1/0).reverse());for(let n of a)t.unshift(dt(n))}else e!==void 0&&t.push(dt(e));return t}static _$Ep(e,t){let a=t.attribute;return a===!1?void 0:typeof a=="string"?a:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(t=>t(this))}addController(e){var t,a;((t=this._$ES)!==null&&t!==void 0?t:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((a=e.hostConnected)===null||a===void 0||a.call(e))}removeController(e){var t;(t=this._$ES)===null||t===void 0||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;let t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return ur(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(t=>{var a;return(a=t.hostConnected)===null||a===void 0?void 0:a.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(t=>{var a;return(a=t.hostDisconnected)===null||a===void 0?void 0:a.call(t)})}attributeChangedCallback(e,t,a){this._$AK(e,a)}_$EO(e,t,a=cr){var n;let i=this.constructor._$Ep(e,a);if(i!==void 0&&a.reflect===!0){let l=(((n=a.converter)===null||n===void 0?void 0:n.toAttribute)!==void 0?a.converter:dr).toAttribute(t,a.type);this._$El=e,l==null?this.removeAttribute(i):this.setAttribute(i,l),this._$El=null}}_$AK(e,t){var a;let n=this.constructor,i=n._$Ev.get(e);if(i!==void 0&&this._$El!==i){let l=n.getPropertyOptions(i),u=typeof l.converter=="function"?{fromAttribute:l.converter}:((a=l.converter)===null||a===void 0?void 0:a.fromAttribute)!==void 0?l.converter:dr;this._$El=i,this[i]=u.fromAttribute(t,l.type),this._$El=null}}requestUpdate(e,t,a){let n=!0;e!==void 0&&(((a=a||this.constructor.getPropertyOptions(e)).hasChanged||Sa)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),a.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,a))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((n,i)=>this[i]=n),this._$Ei=void 0);let t=!1,a=this._$AL;try{t=this.shouldUpdate(a),t?(this.willUpdate(a),(e=this._$ES)===null||e===void 0||e.forEach(n=>{var i;return(i=n.hostUpdate)===null||i===void 0?void 0:i.call(n)}),this.update(a)):this._$Ek()}catch(n){throw t=!1,this._$Ek(),n}t&&this._$AE(a)}willUpdate(e){}_$AE(e){var t;(t=this._$ES)===null||t===void 0||t.forEach(a=>{var n;return(n=a.hostUpdated)===null||n===void 0?void 0:n.call(a)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((t,a)=>this._$EO(a,this[a],t)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};F0[mr]=!0,F0.elementProperties=new Map,F0.elementStyles=[],F0.shadowRootOptions={mode:"open"},ka?.({ReactiveElement:F0}),((hr=mt.reactiveElementVersions)!==null&&hr!==void 0?hr:mt.reactiveElementVersions=[]).push("1.6.3");var fr,ft=window,Ce=ft.trustedTypes,Aa=Ce?Ce.createPolicy("lit-html",{createHTML:r=>r}):void 0,pt="$lit$",V0=`lit$${(Math.random()+"").slice(9)}$`,vr="?"+V0,Pi=`<${vr}>`,me=document,Pe=()=>me.createComment(""),Le=r=>r===null||typeof r!="object"&&typeof r!="function",Da=Array.isArray,$a=r=>Da(r)||typeof r?.[Symbol.iterator]=="function",pr=`[ 2 - \f\r]`,Ie=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ma=/-->/g,Ta=/>/g,ce=RegExp(`>|${pr}(?:([^\\s"'>=/]+)(${pr}*=${pr}*(?:[^ 3 - \f\r"'\`<>=]|("|')|))|$)`,"g"),za=/'/g,Ca=/"/g,Na=/^(?:script|style|textarea|title)$/i,Oa=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),r0=Oa(1),ol=Oa(2),o0=Symbol.for("lit-noChange"),G=Symbol.for("lit-nothing"),Ea=new WeakMap,de=me.createTreeWalker(me,129,null,!1);function Ra(r,e){if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Aa!==void 0?Aa.createHTML(e):e}var _a=(r,e)=>{let t=r.length-1,a=[],n,i=e===2?"<svg>":"",l=Ie;for(let u=0;u<t;u++){let h=r[u],m,v,g=-1,b=0;for(;b<h.length&&(l.lastIndex=b,v=l.exec(h),v!==null);)b=l.lastIndex,l===Ie?v[1]==="!--"?l=Ma:v[1]!==void 0?l=Ta:v[2]!==void 0?(Na.test(v[2])&&(n=RegExp("</"+v[2],"g")),l=ce):v[3]!==void 0&&(l=ce):l===ce?v[0]===">"?(l=n??Ie,g=-1):v[1]===void 0?g=-2:(g=l.lastIndex-v[2].length,m=v[1],l=v[3]===void 0?ce:v[3]==='"'?Ca:za):l===Ca||l===za?l=ce:l===Ma||l===Ta?l=Ie:(l=ce,n=void 0);let x=l===ce&&r[u+1].startsWith("/>")?" ":"";i+=l===Ie?h+Pi:g>=0?(a.push(m),h.slice(0,g)+pt+h.slice(g)+V0+x):h+V0+(g===-2?(a.push(void 0),u):x)}return[Ra(r,i+(r[t]||"<?>")+(e===2?"</svg>":"")),a]},je=class r{constructor({strings:e,_$litType$:t},a){let n;this.parts=[];let i=0,l=0,u=e.length-1,h=this.parts,[m,v]=_a(e,t);if(this.el=r.createElement(m,a),de.currentNode=this.el.content,t===2){let g=this.el.content,b=g.firstChild;b.remove(),g.append(...b.childNodes)}for(;(n=de.nextNode())!==null&&h.length<u;){if(n.nodeType===1){if(n.hasAttributes()){let g=[];for(let b of n.getAttributeNames())if(b.endsWith(pt)||b.startsWith(V0)){let x=v[l++];if(g.push(b),x!==void 0){let k=n.getAttribute(x.toLowerCase()+pt).split(V0),A=/([.?@])?(.*)/.exec(x);h.push({type:1,index:i,name:A[2],strings:k,ctor:A[1]==="."?gt:A[1]==="?"?yt:A[1]==="@"?bt:pe})}else h.push({type:6,index:i})}for(let b of g)n.removeAttribute(b)}if(Na.test(n.tagName)){let g=n.textContent.split(V0),b=g.length-1;if(b>0){n.textContent=Ce?Ce.emptyScript:"";for(let x=0;x<b;x++)n.append(g[x],Pe()),de.nextNode(),h.push({type:2,index:++i});n.append(g[b],Pe())}}}else if(n.nodeType===8)if(n.data===vr)h.push({type:2,index:i});else{let g=-1;for(;(g=n.data.indexOf(V0,g+1))!==-1;)h.push({type:7,index:i}),g+=V0.length-1}i++}}static createElement(e,t){let a=me.createElement("template");return a.innerHTML=e,a}};function fe(r,e,t=r,a){var n,i,l,u;if(e===o0)return e;let h=a!==void 0?(n=t._$Co)===null||n===void 0?void 0:n[a]:t._$Cl,m=Le(e)?void 0:e._$litDirective$;return h?.constructor!==m&&((i=h?._$AO)===null||i===void 0||i.call(h,!1),m===void 0?h=void 0:(h=new m(r),h._$AT(r,t,a)),a!==void 0?((l=(u=t)._$Co)!==null&&l!==void 0?l:u._$Co=[])[a]=h:t._$Cl=h),h!==void 0&&(e=fe(r,h._$AS(r,e.values),h,a)),e}var vt=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var t;let{el:{content:a},parts:n}=this._$AD,i=((t=e?.creationScope)!==null&&t!==void 0?t:me).importNode(a,!0);de.currentNode=i;let l=de.nextNode(),u=0,h=0,m=n[0];for(;m!==void 0;){if(u===m.index){let v;m.type===2?v=new Ee(l,l.nextSibling,this,e):m.type===1?v=new m.ctor(l,m.name,m.strings,this,e):m.type===6&&(v=new xt(l,this,e)),this._$AV.push(v),m=n[++h]}u!==m?.index&&(l=de.nextNode(),u++)}return de.currentNode=me,i}v(e){let t=0;for(let a of this._$AV)a!==void 0&&(a.strings!==void 0?(a._$AI(e,a,t),t+=a.strings.length-2):a._$AI(e[t])),t++}},Ee=class r{constructor(e,t,a,n){var i;this.type=2,this._$AH=G,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=a,this.options=n,this._$Cp=(i=n?.isConnected)===null||i===void 0||i}get _$AU(){var e,t;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t:this._$Cp}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=fe(this,e,t),Le(e)?e===G||e==null||e===""?(this._$AH!==G&&this._$AR(),this._$AH=G):e!==this._$AH&&e!==o0&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):$a(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==G&&Le(this._$AH)?this._$AA.nextSibling.data=e:this.$(me.createTextNode(e)),this._$AH=e}g(e){var t;let{values:a,_$litType$:n}=e,i=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=je.createElement(Ra(n.h,n.h[0]),this.options)),n);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===i)this._$AH.v(a);else{let l=new vt(i,this),u=l.u(this.options);l.v(a),this.$(u),this._$AH=l}}_$AC(e){let t=Ea.get(e.strings);return t===void 0&&Ea.set(e.strings,t=new je(e)),t}T(e){Da(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,a,n=0;for(let i of e)n===t.length?t.push(a=new r(this.k(Pe()),this.k(Pe()),this,this.options)):a=t[n],a._$AI(i),n++;n<t.length&&(this._$AR(a&&a._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){var a;for((a=this._$AP)===null||a===void 0||a.call(this,!1,!0,t);e&&e!==this._$AB;){let n=e.nextSibling;e.remove(),e=n}}setConnected(e){var t;this._$AM===void 0&&(this._$Cp=e,(t=this._$AP)===null||t===void 0||t.call(this,e))}},pe=class{constructor(e,t,a,n,i){this.type=1,this._$AH=G,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=i,a.length>2||a[0]!==""||a[1]!==""?(this._$AH=Array(a.length-1).fill(new String),this.strings=a):this._$AH=G}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,a,n){let i=this.strings,l=!1;if(i===void 0)e=fe(this,e,t,0),l=!Le(e)||e!==this._$AH&&e!==o0,l&&(this._$AH=e);else{let u=e,h,m;for(e=i[0],h=0;h<i.length-1;h++)m=fe(this,u[a+h],t,h),m===o0&&(m=this._$AH[h]),l||(l=!Le(m)||m!==this._$AH[h]),m===G?e=G:e!==G&&(e+=(m??"")+i[h+1]),this._$AH[h]=m}l&&!n&&this.j(e)}j(e){e===G?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},gt=class extends pe{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===G?void 0:e}},Li=Ce?Ce.emptyScript:"",yt=class extends pe{constructor(){super(...arguments),this.type=4}j(e){e&&e!==G?this.element.setAttribute(this.name,Li):this.element.removeAttribute(this.name)}},bt=class extends pe{constructor(e,t,a,n,i){super(e,t,a,n,i),this.type=5}_$AI(e,t=this){var a;if((e=(a=fe(this,e,t,0))!==null&&a!==void 0?a:G)===o0)return;let n=this._$AH,i=e===G&&n!==G||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,l=e!==G&&(n===G||i);i&&this.element.removeEventListener(this.name,this,n),l&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,a;typeof this._$AH=="function"?this._$AH.call((a=(t=this.options)===null||t===void 0?void 0:t.host)!==null&&a!==void 0?a:this.element,e):this._$AH.handleEvent(e)}},xt=class{constructor(e,t,a){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=a}get _$AU(){return this._$AM._$AU}_$AI(e){fe(this,e)}},Ha={O:pt,P:V0,A:vr,C:1,M:_a,L:vt,R:$a,D:fe,I:Ee,V:pe,H:yt,N:bt,U:gt,F:xt},Ba=ft.litHtmlPolyfillSupport;Ba?.(je,Ee),((fr=ft.litHtmlVersions)!==null&&fr!==void 0?fr:ft.litHtmlVersions=[]).push("2.8.0");var qa=(r,e,t)=>{var a,n;let i=(a=t?.renderBefore)!==null&&a!==void 0?a:e,l=i._$litPart$;if(l===void 0){let u=(n=t?.renderBefore)!==null&&n!==void 0?n:null;i._$litPart$=l=new Ee(e.insertBefore(Pe(),u),u,void 0,t??{})}return l._$AI(r),l};var gr,yr;var g0=class extends F0{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;let a=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=a.firstChild),a}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=qa(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return o0}};g0.finalized=!0,g0._$litElement$=!0,(gr=globalThis.litElementHydrateSupport)===null||gr===void 0||gr.call(globalThis,{LitElement:g0});var Ia=globalThis.litElementPolyfillSupport;Ia?.({LitElement:g0});((yr=globalThis.litElementVersions)!==null&&yr!==void 0?yr:globalThis.litElementVersions=[]).push("3.3.3");var ae=r=>e=>typeof e=="function"?((t,a)=>(customElements.define(t,a),a))(r,e):((t,a)=>{let{kind:n,elements:i}=a;return{kind:n,elements:i,finisher(l){customElements.define(t,l)}}})(r,e);var ji=(r,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(t){t.createProperty(e.key,r)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(t){t.createProperty(e.key,r)}},Fi=(r,e,t)=>{e.constructor.createProperty(t,r)};function W(r){return(e,t)=>t!==void 0?Fi(r,e,t):ji(r,e)}function U0(r){return W({...r,state:!0})}var br,Nl=((br=window.HTMLSlotElement)===null||br===void 0?void 0:br.prototype.assignedElements)!=null?(r,e)=>r.assignedElements(e):(r,e)=>r.assignedNodes(e).filter(t=>t.nodeType===Node.ELEMENT_NODE);var c0={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},D0=r=>(...e)=>({_$litDirective$:r,values:e}),S0=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,a){this._$Ct=e,this._$AM=t,this._$Ci=a}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:Vi}=Ha;var wt=r=>r.strings===void 0,Pa=()=>document.createComment(""),Be=(r,e,t)=>{var a;let n=r._$AA.parentNode,i=e===void 0?r._$AB:e._$AA;if(t===void 0){let l=n.insertBefore(Pa(),i),u=n.insertBefore(Pa(),i);t=new Vi(l,u,r,r.options)}else{let l=t._$AB.nextSibling,u=t._$AM,h=u!==r;if(h){let m;(a=t._$AQ)===null||a===void 0||a.call(t,r),t._$AM=r,t._$AP!==void 0&&(m=r._$AU)!==u._$AU&&t._$AP(m)}if(l!==i||h){let m=t._$AA;for(;m!==l;){let v=m.nextSibling;n.insertBefore(m,i),m=v}}}return t},ne=(r,e,t=r)=>(r._$AI(e,t),r),Ui={},kt=(r,e=Ui)=>r._$AH=e,La=r=>r._$AH,St=r=>{var e;(e=r._$AP)===null||e===void 0||e.call(r,!1,!0);let t=r._$AA,a=r._$AB.nextSibling;for(;t!==a;){let n=t.nextSibling;t.remove(),t=n}};var ja=(r,e,t)=>{let a=new Map;for(let n=e;n<=t;n++)a.set(r[n],n);return a},Fa=D0(class extends S0{constructor(r){if(super(r),r.type!==c0.CHILD)throw Error("repeat() can only be used in text expressions")}ct(r,e,t){let a;t===void 0?t=e:e!==void 0&&(a=e);let n=[],i=[],l=0;for(let u of r)n[l]=a?a(u,l):l,i[l]=t(u,l),l++;return{values:i,keys:n}}render(r,e,t){return this.ct(r,e,t).values}update(r,[e,t,a]){var n;let i=La(r),{values:l,keys:u}=this.ct(e,t,a);if(!Array.isArray(i))return this.ut=u,l;let h=(n=this.ut)!==null&&n!==void 0?n:this.ut=[],m=[],v,g,b=0,x=i.length-1,k=0,A=l.length-1;for(;b<=x&&k<=A;)if(i[b]===null)b++;else if(i[x]===null)x--;else if(h[b]===u[k])m[k]=ne(i[b],l[k]),b++,k++;else if(h[x]===u[A])m[A]=ne(i[x],l[A]),x--,A--;else if(h[b]===u[A])m[A]=ne(i[b],l[A]),Be(r,m[A+1],i[b]),b++,A--;else if(h[x]===u[k])m[k]=ne(i[x],l[k]),Be(r,i[b],i[x]),x--,k++;else if(v===void 0&&(v=ja(u,k,A),g=ja(h,b,x)),v.has(h[b]))if(v.has(h[x])){let C=g.get(u[k]),D=C!==void 0?i[C]:null;if(D===null){let R=Be(r,i[b]);ne(R,l[k]),m[k]=R}else m[k]=ne(D,l[k]),Be(r,i[b],D),i[C]=null;k++}else St(i[x]),x--;else St(i[b]),b++;for(;k<=A;){let C=Be(r,m[A+1]);ne(C,l[k]),m[k++]=C}for(;b<=x;){let C=i[b++];C!==null&&St(C)}return this.ut=u,kt(r,m),o0}});var Va=D0(class extends S0{constructor(r){if(super(r),r.type!==c0.PROPERTY&&r.type!==c0.ATTRIBUTE&&r.type!==c0.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!wt(r))throw Error("`live` bindings can only contain a single expression")}render(r){return r}update(r,[e]){if(e===o0||e===G)return e;let t=r.element,a=r.name;if(r.type===c0.PROPERTY){if(e===t[a])return o0}else if(r.type===c0.BOOLEAN_ATTRIBUTE){if(!!e===t.hasAttribute(a))return o0}else if(r.type===c0.ATTRIBUTE&&t.getAttribute(a)===e+"")return o0;return kt(r),e}});var Ve=(r,e)=>{var t,a;let n=r._$AN;if(n===void 0)return!1;for(let i of n)(a=(t=i)._$AO)===null||a===void 0||a.call(t,e,!1),Ve(i,e);return!0},At=r=>{let e,t;do{if((e=r._$AM)===void 0)break;t=e._$AN,t.delete(r),r=e}while(t?.size===0)},Ua=r=>{for(let e;e=r._$AM;r=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(r))break;t.add(r),Wi(e)}};function Gi(r){this._$AN!==void 0?(At(this),this._$AM=r,Ua(this)):this._$AM=r}function Ki(r,e=!1,t=0){let a=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(e)if(Array.isArray(a))for(let i=t;i<a.length;i++)Ve(a[i],!1),At(a[i]);else a!=null&&(Ve(a,!1),At(a));else Ve(this,r)}var Wi=r=>{var e,t,a,n;r.type==c0.CHILD&&((e=(a=r)._$AP)!==null&&e!==void 0||(a._$AP=Ki),(t=(n=r)._$AQ)!==null&&t!==void 0||(n._$AQ=Gi))},Mt=class extends S0{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,a){super._$AT(e,t,a),Ua(this),this.isConnected=e._$AU}_$AO(e,t=!0){var a,n;e!==this.isConnected&&(this.isConnected=e,e?(a=this.reconnected)===null||a===void 0||a.call(this):(n=this.disconnected)===null||n===void 0||n.call(this)),t&&(Ve(this,e),At(this))}setValue(e){if(wt(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};var Tt=()=>new wr,wr=class{},xr=new WeakMap,zt=D0(class extends Mt{render(r){return G}update(r,[e]){var t;let a=e!==this.G;return a&&this.G!==void 0&&this.ot(void 0),(a||this.rt!==this.lt)&&(this.G=e,this.dt=(t=r.options)===null||t===void 0?void 0:t.host,this.ot(this.lt=r.element)),G}ot(r){var e;if(typeof this.G=="function"){let t=(e=this.dt)!==null&&e!==void 0?e:globalThis,a=xr.get(t);a===void 0&&(a=new WeakMap,xr.set(t,a)),a.get(this.G)!==void 0&&this.G.call(this.dt,void 0),a.set(this.G,r),r!==void 0&&this.G.call(this.dt,r)}else this.G.value=r}get rt(){var r,e,t;return typeof this.G=="function"?(e=xr.get((r=this.dt)!==null&&r!==void 0?r:globalThis))===null||e===void 0?void 0:e.get(this.G):(t=this.G)===null||t===void 0?void 0:t.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}});var Ue=D0(class extends S0{constructor(r){var e;if(super(r),r.type!==c0.ATTRIBUTE||r.name!=="class"||((e=r.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(r){return" "+Object.keys(r).filter(e=>r[e]).join(" ")+" "}update(r,[e]){var t,a;if(this.it===void 0){this.it=new Set,r.strings!==void 0&&(this.nt=new Set(r.strings.join(" ").split(/\s/).filter(i=>i!=="")));for(let i in e)e[i]&&!(!((t=this.nt)===null||t===void 0)&&t.has(i))&&this.it.add(i);return this.render(e)}let n=r.element.classList;this.it.forEach(i=>{i in e||(n.remove(i),this.it.delete(i))});for(let i in e){let l=!!e[i];l===this.it.has(i)||!((a=this.nt)===null||a===void 0)&&a.has(i)||(l?(n.add(i),this.it.add(i)):(n.remove(i),this.it.delete(i)))}return o0}});var kr=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Sr(r,e,t){r.addEventListener?r.addEventListener(e,t,!1):r.attachEvent&&r.attachEvent("on".concat(e),function(){t(window.event)})}function Xa(r,e){for(var t=e.slice(0,e.length-1),a=0;a<t.length;a++)t[a]=r[t[a].toLowerCase()];return t}function Za(r){typeof r!="string"&&(r=""),r=r.replace(/\s/g,"");for(var e=r.split(","),t=e.lastIndexOf("");t>=0;)e[t-1]+=",",e.splice(t,1),t=e.lastIndexOf("");return e}function Yi(r,e){for(var t=r.length>=e.length?r:e,a=r.length>=e.length?e:r,n=!0,i=0;i<t.length;i++)a.indexOf(t[i])===-1&&(n=!1);return n}var Ja={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"\u21EA":20,",":188,".":190,"/":191,"`":192,"-":kr?173:189,"=":kr?61:187,";":kr?59:186,"'":222,"[":219,"]":221,"\\":220},ve={"\u21E7":16,shift:16,"\u2325":18,alt:18,option:18,"\u2303":17,ctrl:17,control:17,"\u2318":91,cmd:91,command:91},Ga={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},h0={16:!1,18:!1,17:!1,91:!1},u0={};for(Ge=1;Ge<20;Ge++)Ja["f".concat(Ge)]=111+Ge;var Ge,Y=[],Qa="all",en=[],Et=function(e){return Ja[e.toLowerCase()]||ve[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function tn(r){Qa=r||"all"}function Ke(){return Qa||"all"}function Xi(){return Y.slice(0)}function Zi(r){var e=r.target||r.srcElement,t=e.tagName,a=!0;return(e.isContentEditable||(t==="INPUT"||t==="TEXTAREA"||t==="SELECT")&&!e.readOnly)&&(a=!1),a}function Ji(r){return typeof r=="string"&&(r=Et(r)),Y.indexOf(r)!==-1}function Qi(r,e){var t,a;r||(r=Ke());for(var n in u0)if(Object.prototype.hasOwnProperty.call(u0,n))for(t=u0[n],a=0;a<t.length;)t[a].scope===r?t.splice(a,1):a++;Ke()===r&&tn(e||"all")}function es(r){var e=r.keyCode||r.which||r.charCode,t=Y.indexOf(e);if(t>=0&&Y.splice(t,1),r.key&&r.key.toLowerCase()==="meta"&&Y.splice(0,Y.length),(e===93||e===224)&&(e=91),e in h0){h0[e]=!1;for(var a in ve)ve[a]===e&&(G0[a]=!1)}}function ts(r){if(!r)Object.keys(u0).forEach(function(l){return delete u0[l]});else if(Array.isArray(r))r.forEach(function(l){l.key&&Ar(l)});else if(typeof r=="object")r.key&&Ar(r);else if(typeof r=="string"){for(var e=arguments.length,t=new Array(e>1?e-1:0),a=1;a<e;a++)t[a-1]=arguments[a];var n=t[0],i=t[1];typeof n=="function"&&(i=n,n=""),Ar({key:r,scope:n,method:i,splitKey:"+"})}}var Ar=function(e){var t=e.key,a=e.scope,n=e.method,i=e.splitKey,l=i===void 0?"+":i,u=Za(t);u.forEach(function(h){var m=h.split(l),v=m.length,g=m[v-1],b=g==="*"?"*":Et(g);if(u0[b]){a||(a=Ke());var x=v>1?Xa(ve,m):[];u0[b]=u0[b].map(function(k){var A=n?k.method===n:!0;return A&&k.scope===a&&Yi(k.mods,x)?{}:k})}})};function Ka(r,e,t){var a;if(e.scope===t||e.scope==="all"){a=e.mods.length>0;for(var n in h0)Object.prototype.hasOwnProperty.call(h0,n)&&(!h0[n]&&e.mods.indexOf(+n)>-1||h0[n]&&e.mods.indexOf(+n)===-1)&&(a=!1);(e.mods.length===0&&!h0[16]&&!h0[18]&&!h0[17]&&!h0[91]||a||e.shortcut==="*")&&e.method(r,e)===!1&&(r.preventDefault?r.preventDefault():r.returnValue=!1,r.stopPropagation&&r.stopPropagation(),r.cancelBubble&&(r.cancelBubble=!0))}}function Wa(r){var e=u0["*"],t=r.keyCode||r.which||r.charCode;if(G0.filter.call(this,r)){if((t===93||t===224)&&(t=91),Y.indexOf(t)===-1&&t!==229&&Y.push(t),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(x){var k=Ga[x];r[x]&&Y.indexOf(k)===-1?Y.push(k):!r[x]&&Y.indexOf(k)>-1?Y.splice(Y.indexOf(k),1):x==="metaKey"&&r[x]&&Y.length===3&&(r.ctrlKey||r.shiftKey||r.altKey||(Y=Y.slice(Y.indexOf(k))))}),t in h0){h0[t]=!0;for(var a in ve)ve[a]===t&&(G0[a]=!0);if(!e)return}for(var n in h0)Object.prototype.hasOwnProperty.call(h0,n)&&(h0[n]=r[Ga[n]]);r.getModifierState&&!(r.altKey&&!r.ctrlKey)&&r.getModifierState("AltGraph")&&(Y.indexOf(17)===-1&&Y.push(17),Y.indexOf(18)===-1&&Y.push(18),h0[17]=!0,h0[18]=!0);var i=Ke();if(e)for(var l=0;l<e.length;l++)e[l].scope===i&&(r.type==="keydown"&&e[l].keydown||r.type==="keyup"&&e[l].keyup)&&Ka(r,e[l],i);if(t in u0){for(var u=0;u<u0[t].length;u++)if((r.type==="keydown"&&u0[t][u].keydown||r.type==="keyup"&&u0[t][u].keyup)&&u0[t][u].key){for(var h=u0[t][u],m=h.splitKey,v=h.key.split(m),g=[],b=0;b<v.length;b++)g.push(Et(v[b]));g.sort().join("")===Y.sort().join("")&&Ka(r,h,i)}}}}function rs(r){return en.indexOf(r)>-1}function G0(r,e,t){Y=[];var a=Za(r),n=[],i="all",l=document,u=0,h=!1,m=!0,v="+";for(t===void 0&&typeof e=="function"&&(t=e),Object.prototype.toString.call(e)==="[object Object]"&&(e.scope&&(i=e.scope),e.element&&(l=e.element),e.keyup&&(h=e.keyup),e.keydown!==void 0&&(m=e.keydown),typeof e.splitKey=="string"&&(v=e.splitKey)),typeof e=="string"&&(i=e);u<a.length;u++)r=a[u].split(v),n=[],r.length>1&&(n=Xa(ve,r)),r=r[r.length-1],r=r==="*"?"*":Et(r),r in u0||(u0[r]=[]),u0[r].push({keyup:h,keydown:m,scope:i,mods:n,shortcut:a[u],method:t,key:a[u],splitKey:v});typeof l<"u"&&!rs(l)&&window&&(en.push(l),Sr(l,"keydown",function(g){Wa(g)}),Sr(window,"focus",function(){Y=[]}),Sr(l,"keyup",function(g){Wa(g),es(g)}))}var Mr={setScope:tn,getScope:Ke,deleteScope:Qi,getPressedKeyCodes:Xi,isPressed:Ji,filter:Zi,unbind:ts};for(Ct in Mr)Object.prototype.hasOwnProperty.call(Mr,Ct)&&(G0[Ct]=Mr[Ct]);var Ct;typeof window<"u"&&(Ya=window.hotkeys,G0.noConflict=function(r){return r&&window.hotkeys===G0&&(window.hotkeys=Ya),G0},window.hotkeys=G0);var Ya,y0=G0;var We=function(r,e,t,a){var n=arguments.length,i=n<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,t):a,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,a);else for(var u=r.length-1;u>=0;u--)(l=r[u])&&(i=(n<3?l(i):n>3?l(e,t,i):l(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i},ge=class extends g0{constructor(){super(...arguments),this.placeholder="",this.hideBreadcrumbs=!1,this.breadcrumbHome="Home",this.breadcrumbs=[],this._inputRef=Tt()}render(){let e="";if(!this.hideBreadcrumbs){let t=[];for(let a of this.breadcrumbs)t.push(r0`<button 4 - tabindex="-1" 5 - @click=${()=>this.selectParent(a)} 6 - class="breadcrumb" 7 - > 8 - ${a} 9 - </button>`);e=r0`<div class="breadcrumb-list"> 10 - <button 11 - tabindex="-1" 12 - @click=${()=>this.selectParent()} 13 - class="breadcrumb" 14 - > 15 - ${this.breadcrumbHome} 16 - </button> 17 - ${t} 18 - </div>`}return r0` 19 - ${e} 20 - <div part="ninja-input-wrapper" class="search-wrapper"> 21 - <input 22 - part="ninja-input" 23 - type="text" 24 - id="search" 25 - spellcheck="false" 26 - autocomplete="off" 27 - @input="${this._handleInput}" 28 - ${zt(this._inputRef)} 29 - placeholder="${this.placeholder}" 30 - class="search" 31 - /> 32 - </div> 33 - `}setSearch(e){this._inputRef.value&&(this._inputRef.value.value=e)}focusSearch(){requestAnimationFrame(()=>this._inputRef.value.focus())}_handleInput(e){let t=e.target;this.dispatchEvent(new CustomEvent("change",{detail:{search:t.value},bubbles:!1,composed:!1}))}selectParent(e){this.dispatchEvent(new CustomEvent("setParent",{detail:{parent:e},bubbles:!0,composed:!0}))}firstUpdated(){this.focusSearch()}_close(){this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}};ge.styles=j0` 34 - :host { 35 - flex: 1; 36 - position: relative; 37 - } 38 - .search { 39 - padding: 1.25em; 40 - flex-grow: 1; 41 - flex-shrink: 0; 42 - margin: 0px; 43 - border: none; 44 - appearance: none; 45 - font-size: 1.125em; 46 - background: transparent; 47 - caret-color: var(--ninja-accent-color); 48 - color: var(--ninja-text-color); 49 - outline: none; 50 - font-family: var(--ninja-font-family); 51 - } 52 - .search::placeholder { 53 - color: var(--ninja-placeholder-color); 54 - } 55 - .breadcrumb-list { 56 - padding: 1em 4em 0 1em; 57 - display: flex; 58 - flex-direction: row; 59 - align-items: stretch; 60 - justify-content: flex-start; 61 - flex: initial; 62 - } 63 - 64 - .breadcrumb { 65 - background: var(--ninja-secondary-background-color); 66 - text-align: center; 67 - line-height: 1.2em; 68 - border-radius: var(--ninja-key-border-radius); 69 - border: 0; 70 - cursor: pointer; 71 - padding: 0.1em 0.5em; 72 - color: var(--ninja-secondary-text-color); 73 - margin-right: 0.5em; 74 - outline: none; 75 - font-family: var(--ninja-font-family); 76 - } 77 - 78 - .search-wrapper { 79 - display: flex; 80 - border-bottom: var(--ninja-separate-border); 81 - } 82 - `;We([W()],ge.prototype,"placeholder",void 0);We([W({type:Boolean})],ge.prototype,"hideBreadcrumbs",void 0);We([W()],ge.prototype,"breadcrumbHome",void 0);We([W({type:Array})],ge.prototype,"breadcrumbs",void 0);ge=We([ae("ninja-header")],ge);var Ye=class extends S0{constructor(e){if(super(e),this.et=G,e.type!==c0.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===G||e==null)return this.ft=void 0,this.et=e;if(e===o0)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.et)return this.ft;this.et=e;let t=[e];return t.raw=t,this.ft={_$litType$:this.constructor.resultType,strings:t,values:[]}}};Ye.directiveName="unsafeHTML",Ye.resultType=1;var rn=D0(Ye);function*an(r,e){let t=typeof e=="function";if(r!==void 0){let a=-1;for(let n of r)a>-1&&(yield t?e(a):e),a++,yield n}}function nn(r,e,t,a){var n=arguments.length,i=n<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,t):a,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,a);else for(var u=r.length-1;u>=0;u--)(l=r[u])&&(i=(n<3?l(i):n>3?l(e,t,i):l(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i}var sn=j0`:host{font-family:var(--mdc-icon-font, "Material Icons");font-weight:normal;font-style:normal;font-size:var(--mdc-icon-size, 24px);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga"}`;var Tr=class extends g0{render(){return r0`<span><slot></slot></span>`}};Tr.styles=[sn];Tr=nn([ae("mwc-icon")],Tr);var Bt=function(r,e,t,a){var n=arguments.length,i=n<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,t):a,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,a);else for(var u=r.length-1;u>=0;u--)(l=r[u])&&(i=(n<3?l(i):n>3?l(e,t,i):l(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i},De=class extends g0{constructor(){super(),this.selected=!1,this.hotKeysJoinedView=!0,this.addEventListener("click",this.click)}ensureInView(){requestAnimationFrame(()=>this.scrollIntoView({block:"nearest"}))}click(){this.dispatchEvent(new CustomEvent("actionsSelected",{detail:this.action,bubbles:!0,composed:!0}))}updated(e){e.has("selected")&&this.selected&&this.ensureInView()}render(){let e;this.action.mdIcon?e=r0`<mwc-icon part="ninja-icon" class="ninja-icon" 83 - >${this.action.mdIcon}</mwc-icon 84 - >`:this.action.icon&&(e=rn(this.action.icon||""));let t;this.action.hotkey&&(this.hotKeysJoinedView?t=this.action.hotkey.split(",").map(n=>{let i=n.split("+"),l=r0`${an(i.map(u=>r0`<kbd>${u}</kbd>`),"+")}`;return r0`<div class="ninja-hotkey ninja-hotkeys"> 85 - ${l} 86 - </div>`}):t=this.action.hotkey.split(",").map(n=>{let l=n.split("+").map(u=>r0`<kbd class="ninja-hotkey">${u}</kbd>`);return r0`<kbd class="ninja-hotkeys">${l}</kbd>`}));let a={selected:this.selected,"ninja-action":!0};return r0` 87 - <div 88 - class="ninja-action" 89 - part="ninja-action ${this.selected?"ninja-selected":""}" 90 - class=${Ue(a)} 91 - > 92 - ${e} 93 - <div class="ninja-title">${this.action.title}</div> 94 - ${t} 95 - </div> 96 - `}};De.styles=j0` 97 - :host { 98 - display: flex; 99 - width: 100%; 100 - } 101 - .ninja-action { 102 - padding: 0.75em 1em; 103 - display: flex; 104 - border-left: 2px solid transparent; 105 - align-items: center; 106 - justify-content: start; 107 - outline: none; 108 - transition: color 0s ease 0s; 109 - width: 100%; 110 - } 111 - .ninja-action.selected { 112 - cursor: pointer; 113 - color: var(--ninja-selected-text-color); 114 - background-color: var(--ninja-selected-background); 115 - border-left: 2px solid var(--ninja-accent-color); 116 - outline: none; 117 - } 118 - .ninja-action.selected .ninja-icon { 119 - color: var(--ninja-selected-text-color); 120 - } 121 - .ninja-icon { 122 - font-size: var(--ninja-icon-size); 123 - max-width: var(--ninja-icon-size); 124 - max-height: var(--ninja-icon-size); 125 - margin-right: 1em; 126 - color: var(--ninja-icon-color); 127 - margin-right: 1em; 128 - position: relative; 129 - } 130 - 131 - .ninja-title { 132 - flex-shrink: 0.01; 133 - margin-right: 0.5em; 134 - flex-grow: 1; 135 - font-size: 0.8125em; 136 - white-space: nowrap; 137 - overflow: hidden; 138 - text-overflow: ellipsis; 139 - } 140 - .ninja-hotkeys { 141 - flex-shrink: 0; 142 - width: min-content; 143 - display: flex; 144 - } 145 - 146 - .ninja-hotkeys kbd { 147 - font-family: inherit; 148 - } 149 - .ninja-hotkey { 150 - background: var(--ninja-secondary-background-color); 151 - padding: 0.06em 0.25em; 152 - border-radius: var(--ninja-key-border-radius); 153 - text-transform: capitalize; 154 - color: var(--ninja-secondary-text-color); 155 - font-size: 0.75em; 156 - font-family: inherit; 157 - } 158 - 159 - .ninja-hotkey + .ninja-hotkey { 160 - margin-left: 0.5em; 161 - } 162 - .ninja-hotkeys + .ninja-hotkeys { 163 - margin-left: 1em; 164 - } 165 - `;Bt([W({type:Object})],De.prototype,"action",void 0);Bt([W({type:Boolean})],De.prototype,"selected",void 0);Bt([W({type:Boolean})],De.prototype,"hotKeysJoinedView",void 0);De=Bt([ae("ninja-action")],De);var ln=r0` <div class="modal-footer" slot="footer"> 166 - <span class="help"> 167 - <svg 168 - version="1.0" 169 - class="ninja-examplekey" 170 - xmlns="http://www.w3.org/2000/svg" 171 - viewBox="0 0 1280 1280" 172 - > 173 - <path 174 - d="M1013 376c0 73.4-.4 113.3-1.1 120.2a159.9 159.9 0 0 1-90.2 127.3c-20 9.6-36.7 14-59.2 15.5-7.1.5-121.9.9-255 1h-242l95.5-95.5 95.5-95.5-38.3-38.2-38.2-38.3-160 160c-88 88-160 160.4-160 161 0 .6 72 73 160 161l160 160 38.2-38.3 38.3-38.2-95.5-95.5-95.5-95.5h251.1c252.9 0 259.8-.1 281.4-3.6 72.1-11.8 136.9-54.1 178.5-116.4 8.6-12.9 22.6-40.5 28-55.4 4.4-12 10.7-36.1 13.1-50.6 1.6-9.6 1.8-21 2.1-132.8l.4-122.2H1013v110z" 175 - /> 176 - </svg> 177 - 178 - to select 179 - </span> 180 - <span class="help"> 181 - <svg 182 - xmlns="http://www.w3.org/2000/svg" 183 - class="ninja-examplekey" 184 - viewBox="0 0 24 24" 185 - > 186 - <path d="M0 0h24v24H0V0z" fill="none" /> 187 - <path 188 - d="M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z" 189 - /> 190 - </svg> 191 - <svg 192 - xmlns="http://www.w3.org/2000/svg" 193 - class="ninja-examplekey" 194 - viewBox="0 0 24 24" 195 - > 196 - <path d="M0 0h24v24H0V0z" fill="none" /> 197 - <path d="M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z" /> 198 - </svg> 199 - to navigate 200 - </span> 201 - <span class="help"> 202 - <span class="ninja-examplekey esc">esc</span> 203 - to close 204 - </span> 205 - <span class="help"> 206 - <svg 207 - xmlns="http://www.w3.org/2000/svg" 208 - class="ninja-examplekey backspace" 209 - viewBox="0 0 20 20" 210 - fill="currentColor" 211 - > 212 - <path 213 - fill-rule="evenodd" 214 - d="M6.707 4.879A3 3 0 018.828 4H15a3 3 0 013 3v6a3 3 0 01-3 3H8.828a3 3 0 01-2.12-.879l-4.415-4.414a1 1 0 010-1.414l4.414-4.414zm4 2.414a1 1 0 00-1.414 1.414L10.586 10l-1.293 1.293a1 1 0 101.414 1.414L12 11.414l1.293 1.293a1 1 0 001.414-1.414L13.414 10l1.293-1.293a1 1 0 00-1.414-1.414L12 8.586l-1.293-1.293z" 215 - clip-rule="evenodd" 216 - /> 217 - </svg> 218 - move to parent 219 - </span> 220 - </div>`;var on=j0` 221 - :host { 222 - --ninja-width: 640px; 223 - --ninja-backdrop-filter: none; 224 - --ninja-overflow-background: rgba(255, 255, 255, 0.5); 225 - --ninja-text-color: rgb(60, 65, 73); 226 - --ninja-font-size: 16px; 227 - --ninja-top: 20%; 228 - 229 - --ninja-key-border-radius: 0.25em; 230 - --ninja-accent-color: rgb(110, 94, 210); 231 - --ninja-secondary-background-color: rgb(239, 241, 244); 232 - --ninja-secondary-text-color: rgb(107, 111, 118); 233 - 234 - --ninja-selected-background: rgb(248, 249, 251); 235 - 236 - --ninja-icon-color: var(--ninja-secondary-text-color); 237 - --ninja-icon-size: 1.2em; 238 - --ninja-separate-border: 1px solid var(--ninja-secondary-background-color); 239 - 240 - --ninja-modal-background: #fff; 241 - --ninja-modal-shadow: rgb(0 0 0 / 50%) 0px 16px 70px; 242 - 243 - --ninja-actions-height: 300px; 244 - --ninja-group-text-color: rgb(144, 149, 157); 245 - 246 - --ninja-footer-background: rgba(242, 242, 242, 0.4); 247 - 248 - --ninja-placeholder-color: #8e8e8e; 249 - 250 - font-size: var(--ninja-font-size); 251 - 252 - --ninja-z-index: 1; 253 - } 254 - 255 - :host(.dark) { 256 - --ninja-backdrop-filter: none; 257 - --ninja-overflow-background: rgba(0, 0, 0, 0.7); 258 - --ninja-text-color: #7d7d7d; 259 - 260 - --ninja-modal-background: rgba(17, 17, 17, 0.85); 261 - --ninja-accent-color: rgb(110, 94, 210); 262 - --ninja-secondary-background-color: rgba(51, 51, 51, 0.44); 263 - --ninja-secondary-text-color: #888; 264 - 265 - --ninja-selected-text-color: #eaeaea; 266 - --ninja-selected-background: rgba(51, 51, 51, 0.44); 267 - 268 - --ninja-icon-color: var(--ninja-secondary-text-color); 269 - --ninja-separate-border: 1px solid var(--ninja-secondary-background-color); 270 - 271 - --ninja-modal-shadow: 0 16px 70px rgba(0, 0, 0, 0.2); 272 - 273 - --ninja-group-text-color: rgb(144, 149, 157); 274 - 275 - --ninja-footer-background: rgba(30, 30, 30, 85%); 276 - } 277 - 278 - .modal { 279 - display: none; 280 - position: fixed; 281 - z-index: var(--ninja-z-index); 282 - left: 0; 283 - top: 0; 284 - width: 100%; 285 - height: 100%; 286 - overflow: auto; 287 - background: var(--ninja-overflow-background); 288 - -webkit-font-smoothing: antialiased; 289 - -moz-osx-font-smoothing: grayscale; 290 - -webkit-backdrop-filter: var(--ninja-backdrop-filter); 291 - backdrop-filter: var(--ninja-backdrop-filter); 292 - text-align: left; 293 - color: var(--ninja-text-color); 294 - font-family: var(--ninja-font-family); 295 - } 296 - .modal.visible { 297 - display: block; 298 - } 299 - 300 - .modal-content { 301 - position: relative; 302 - top: var(--ninja-top); 303 - margin: auto; 304 - padding: 0; 305 - display: flex; 306 - flex-direction: column; 307 - flex-shrink: 1; 308 - -webkit-box-flex: 1; 309 - flex-grow: 1; 310 - min-width: 0px; 311 - will-change: transform; 312 - background: var(--ninja-modal-background); 313 - border-radius: 0.5em; 314 - box-shadow: var(--ninja-modal-shadow); 315 - max-width: var(--ninja-width); 316 - overflow: hidden; 317 - } 318 - 319 - .bump { 320 - animation: zoom-in-zoom-out 0.2s ease; 321 - } 322 - 323 - @keyframes zoom-in-zoom-out { 324 - 0% { 325 - transform: scale(0.99); 326 - } 327 - 50% { 328 - transform: scale(1.01, 1.01); 329 - } 330 - 100% { 331 - transform: scale(1, 1); 332 - } 333 - } 334 - 335 - .ninja-github { 336 - color: var(--ninja-keys-text-color); 337 - font-weight: normal; 338 - text-decoration: none; 339 - } 340 - 341 - .actions-list { 342 - max-height: var(--ninja-actions-height); 343 - overflow: auto; 344 - scroll-behavior: smooth; 345 - position: relative; 346 - margin: 0; 347 - padding: 0.5em 0; 348 - list-style: none; 349 - scroll-behavior: smooth; 350 - } 351 - 352 - .group-header { 353 - height: 1.375em; 354 - line-height: 1.375em; 355 - padding-left: 1.25em; 356 - padding-top: 0.5em; 357 - text-overflow: ellipsis; 358 - white-space: nowrap; 359 - overflow: hidden; 360 - font-size: 0.75em; 361 - line-height: 1em; 362 - color: var(--ninja-group-text-color); 363 - margin: 1px 0; 364 - } 365 - 366 - .modal-footer { 367 - background: var(--ninja-footer-background); 368 - padding: 0.5em 1em; 369 - display: flex; 370 - /* font-size: 0.75em; */ 371 - border-top: var(--ninja-separate-border); 372 - color: var(--ninja-secondary-text-color); 373 - } 374 - 375 - .modal-footer .help { 376 - display: flex; 377 - margin-right: 1em; 378 - align-items: center; 379 - font-size: 0.75em; 380 - } 381 - 382 - .ninja-examplekey { 383 - background: var(--ninja-secondary-background-color); 384 - padding: 0.06em 0.25em; 385 - border-radius: var(--ninja-key-border-radius); 386 - color: var(--ninja-secondary-text-color); 387 - width: 1em; 388 - height: 1em; 389 - margin-right: 0.5em; 390 - font-size: 1.25em; 391 - fill: currentColor; 392 - } 393 - .ninja-examplekey.esc { 394 - width: auto; 395 - height: auto; 396 - font-size: 1.1em; 397 - } 398 - .ninja-examplekey.backspace { 399 - opacity: 0.7; 400 - } 401 - `;var a0=function(r,e,t,a){var n=arguments.length,i=n<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,t):a,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,a);else for(var u=r.length-1;u>=0;u--)(l=r[u])&&(i=(n<3?l(i):n>3?l(e,t,i):l(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i},J=class extends g0{constructor(){super(...arguments),this.placeholder="Type a command or search...",this.disableHotkeys=!1,this.hideBreadcrumbs=!1,this.openHotkey="cmd+k,ctrl+k",this.navigationUpHotkey="up,shift+tab",this.navigationDownHotkey="down,tab",this.closeHotkey="esc",this.goBackHotkey="backspace",this.selectHotkey="enter",this.hotKeysJoinedView=!1,this.noAutoLoadMdIcons=!1,this.data=[],this.visible=!1,this._bump=!0,this._actionMatches=[],this._search="",this._flatData=[],this._headerRef=Tt()}open(e={}){this._bump=!0,this.visible=!0,this._headerRef.value.focusSearch(),this._actionMatches.length>0&&(this._selected=this._actionMatches[0]),this.setParent(e.parent)}close(){this._bump=!1,this.visible=!1}setParent(e){e?this._currentRoot=e:this._currentRoot=void 0,this._selected=void 0,this._search="",this._headerRef.value.setSearch("")}get breadcrumbs(){var e;let t=[],a=(e=this._selected)===null||e===void 0?void 0:e.parent;if(a)for(t.push(a);a;){let n=this._flatData.find(i=>i.id===a);n?.parent&&t.push(n.parent),a=n?n.parent:void 0}return t.reverse()}connectedCallback(){super.connectedCallback(),this.noAutoLoadMdIcons||document.fonts.load("24px Material Icons","apps").then(()=>{}),this._registerInternalHotkeys()}disconnectedCallback(){super.disconnectedCallback(),this._unregisterInternalHotkeys()}_flattern(e,t){let a=[];return e||(e=[]),e.map(n=>{let i=n.children&&n.children.some(u=>typeof u=="string"),l={...n,parent:n.parent||t};return i||(l.children&&l.children.length&&(t=n.id,a=[...a,...l.children]),l.children=l.children?l.children.map(u=>u.id):[]),l}).concat(a.length?this._flattern(a,t):a)}update(e){e.has("data")&&!this.disableHotkeys&&(this._flatData=this._flattern(this.data),this._flatData.filter(t=>!!t.hotkey).forEach(t=>{y0(t.hotkey,a=>{a.preventDefault(),t.handler&&t.handler(t)})})),super.update(e)}_registerInternalHotkeys(){this.openHotkey&&y0(this.openHotkey,e=>{e.preventDefault(),this.visible?this.close():this.open()}),this.selectHotkey&&y0(this.selectHotkey,e=>{this.visible&&(e.preventDefault(),this._actionSelected(this._actionMatches[this._selectedIndex]))}),this.goBackHotkey&&y0(this.goBackHotkey,e=>{this.visible&&(this._search||(e.preventDefault(),this._goBack()))}),this.navigationDownHotkey&&y0(this.navigationDownHotkey,e=>{this.visible&&(e.preventDefault(),this._selectedIndex>=this._actionMatches.length-1?this._selected=this._actionMatches[0]:this._selected=this._actionMatches[this._selectedIndex+1])}),this.navigationUpHotkey&&y0(this.navigationUpHotkey,e=>{this.visible&&(e.preventDefault(),this._selectedIndex===0?this._selected=this._actionMatches[this._actionMatches.length-1]:this._selected=this._actionMatches[this._selectedIndex-1])}),this.closeHotkey&&y0(this.closeHotkey,()=>{this.visible&&this.close()})}_unregisterInternalHotkeys(){this.openHotkey&&y0.unbind(this.openHotkey),this.selectHotkey&&y0.unbind(this.selectHotkey),this.goBackHotkey&&y0.unbind(this.goBackHotkey),this.navigationDownHotkey&&y0.unbind(this.navigationDownHotkey),this.navigationUpHotkey&&y0.unbind(this.navigationUpHotkey),this.closeHotkey&&y0.unbind(this.closeHotkey)}_actionFocused(e,t){this._selected=e,t.target.ensureInView()}_onTransitionEnd(){this._bump=!1}_goBack(){let e=this.breadcrumbs.length>1?this.breadcrumbs[this.breadcrumbs.length-2]:void 0;this.setParent(e)}render(){let e={bump:this._bump,"modal-content":!0},t={visible:this.visible,modal:!0},n=this._flatData.filter(u=>{var h;let m=new RegExp(this._search,"gi"),v=u.title.match(m)||((h=u.keywords)===null||h===void 0?void 0:h.match(m));return(!this._currentRoot&&this._search||u.parent===this._currentRoot)&&v}).reduce((u,h)=>u.set(h.section,[...u.get(h.section)||[],h]),new Map);this._actionMatches=[...n.values()].flat(),this._actionMatches.length>0&&this._selectedIndex===-1&&(this._selected=this._actionMatches[0]),this._actionMatches.length===0&&(this._selected=void 0);let i=u=>r0` ${Fa(u,h=>h.id,h=>{var m;return r0`<ninja-action 402 - exportparts="ninja-action,ninja-selected,ninja-icon" 403 - .selected=${Va(h.id===((m=this._selected)===null||m===void 0?void 0:m.id))} 404 - .hotKeysJoinedView=${this.hotKeysJoinedView} 405 - @mouseover=${v=>this._actionFocused(h,v)} 406 - @actionsSelected=${v=>this._actionSelected(v.detail)} 407 - .action=${h} 408 - ></ninja-action>`})}`,l=[];return n.forEach((u,h)=>{let m=h?r0`<div class="group-header">${h}</div>`:void 0;l.push(r0`${m}${i(u)}`)}),r0` 409 - <div @click=${this._overlayClick} class=${Ue(t)}> 410 - <div class=${Ue(e)} @animationend=${this._onTransitionEnd}> 411 - <ninja-header 412 - exportparts="ninja-input,ninja-input-wrapper" 413 - ${zt(this._headerRef)} 414 - .placeholder=${this.placeholder} 415 - .hideBreadcrumbs=${this.hideBreadcrumbs} 416 - .breadcrumbs=${this.breadcrumbs} 417 - @change=${this._handleInput} 418 - @setParent=${u=>this.setParent(u.detail.parent)} 419 - @close=${this.close} 420 - > 421 - </ninja-header> 422 - <div class="modal-body"> 423 - <div class="actions-list" part="actions-list">${l}</div> 424 - </div> 425 - <slot name="footer"> ${ln} </slot> 426 - </div> 427 - </div> 428 - `}get _selectedIndex(){return this._selected?this._actionMatches.indexOf(this._selected):-1}_actionSelected(e){var t;if(this.dispatchEvent(new CustomEvent("selected",{detail:{search:this._search,action:e},bubbles:!0,composed:!0})),!!e){if(e.children&&((t=e.children)===null||t===void 0?void 0:t.length)>0&&(this._currentRoot=e.id,this._search=""),this._headerRef.value.setSearch(""),this._headerRef.value.focusSearch(),e.handler){let a=e.handler(e);a?.keepOpen||this.close()}this._bump=!0}}async _handleInput(e){this._search=e.detail.search,await this.updateComplete,this.dispatchEvent(new CustomEvent("change",{detail:{search:this._search,actions:this._actionMatches},bubbles:!0,composed:!0}))}_overlayClick(e){var t;!((t=e.target)===null||t===void 0)&&t.classList.contains("modal")&&this.close()}};J.styles=[on];a0([W({type:String})],J.prototype,"placeholder",void 0);a0([W({type:Boolean})],J.prototype,"disableHotkeys",void 0);a0([W({type:Boolean})],J.prototype,"hideBreadcrumbs",void 0);a0([W()],J.prototype,"openHotkey",void 0);a0([W()],J.prototype,"navigationUpHotkey",void 0);a0([W()],J.prototype,"navigationDownHotkey",void 0);a0([W()],J.prototype,"closeHotkey",void 0);a0([W()],J.prototype,"goBackHotkey",void 0);a0([W()],J.prototype,"selectHotkey",void 0);a0([W({type:Boolean})],J.prototype,"hotKeysJoinedView",void 0);a0([W({type:Boolean})],J.prototype,"noAutoLoadMdIcons",void 0);a0([W({type:Array,hasChanged(){return!0}})],J.prototype,"data",void 0);a0([U0()],J.prototype,"visible",void 0);a0([U0()],J.prototype,"_bump",void 0);a0([U0()],J.prototype,"_actionMatches",void 0);a0([U0()],J.prototype,"_search",void 0);a0([U0()],J.prototype,"_currentRoot",void 0);a0([U0()],J.prototype,"_flatData",void 0);a0([U0()],J.prototype,"breadcrumbs",null);a0([U0()],J.prototype,"_selected",void 0);J=a0([ae("ninja-keys")],J);var A0=class r{constructor(e,t,a){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=a}static range(e,t){return t?!e||!e.loc||!t.loc||e.loc.lexer!==t.loc.lexer?null:new r(e.loc.lexer,e.loc.start,t.loc.end):e&&e.loc}},C0=class r{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new r(t,A0.range(this,e))}},T=class r{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var a="KaTeX parse error: "+e,n,i,l=t&&t.loc;if(l&&l.start<=l.end){var u=l.lexer.input;n=l.start,i=l.end,n===u.length?a+=" at end of input: ":a+=" at position "+(n+1)+": ";var h=u.slice(n,i).replace(/[^]/g,"$&\u0332"),m;n>15?m="\u2026"+u.slice(n-15,n):m=u.slice(0,n);var v;i+15<u.length?v=u.slice(i,i+15)+"\u2026":v=u.slice(i),a+=m+h+v}var g=new Error(a);return g.name="ParseError",g.__proto__=r.prototype,g.position=n,n!=null&&i!=null&&(g.length=i-n),g.rawMessage=e,g}};T.prototype.__proto__=Error.prototype;var as=function(e,t){return e.indexOf(t)!==-1},ns=function(e,t){return e===void 0?t:e},is=/([A-Z])/g,ss=function(e){return e.replace(is,"-$1").toLowerCase()},ls={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},os=/[&><"']/g;function us(r){return String(r).replace(os,e=>ls[e])}var Pn=function r(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?r(e.body[0]):e:e.type==="font"?r(e.body):e},hs=function(e){var t=Pn(e);return t.type==="mathord"||t.type==="textord"||t.type==="atom"},cs=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},ds=function(e){var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},$={contains:as,deflt:ns,escape:us,hyphenate:ss,getBaseElem:Pn,isCharacterBox:hs,protocolFromUrl:ds},jt={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:r=>"#"+r},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(r,e)=>(e.push(r),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:r=>Math.max(0,r),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:r=>Math.max(0,r),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:r=>Math.max(0,r),cli:"-e, --max-expand <n>",cliProcessor:r=>r==="Infinity"?1/0:parseInt(r)},globalGroup:{type:"boolean",cli:!1}};function ms(r){if(r.default)return r.default;var e=r.type,t=Array.isArray(e)?e[0]:e;if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}var et=class{constructor(e){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var t in jt)if(jt.hasOwnProperty(t)){var a=jt[t];this[t]=e[t]!==void 0?a.processor?a.processor(e[t]):e[t]:ms(a)}}reportNonstrict(e,t,a){var n=this.strict;if(typeof n=="function"&&(n=n(e,t,a)),!(!n||n==="ignore")){if(n===!0||n==="error")throw new T("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+e+"]"),a);n==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+n+"': "+t+" ["+e+"]"))}}useStrictBehavior(e,t,a){var n=this.strict;if(typeof n=="function")try{n=n(e,t,a)}catch{n="error"}return!n||n==="ignore"?!1:n===!0||n==="error"?!0:n==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+n+"': "+t+" ["+e+"]")),!1)}isTrusted(e){if(e.url&&!e.protocol){var t=$.protocolFromUrl(e.url);if(t==null)return!1;e.protocol=t}var a=typeof this.trust=="function"?this.trust(e):this.trust;return!!a}},O0=class{constructor(e,t,a){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=a}sup(){return R0[fs[this.id]]}sub(){return R0[ps[this.id]]}fracNum(){return R0[vs[this.id]]}fracDen(){return R0[gs[this.id]]}cramp(){return R0[ys[this.id]]}text(){return R0[bs[this.id]]}isTight(){return this.size>=2}},Zr=0,Vt=1,Ne=2,Y0=3,tt=4,z0=5,Oe=6,f0=7,R0=[new O0(Zr,0,!1),new O0(Vt,0,!0),new O0(Ne,1,!1),new O0(Y0,1,!0),new O0(tt,2,!1),new O0(z0,2,!0),new O0(Oe,3,!1),new O0(f0,3,!0)],fs=[tt,z0,tt,z0,Oe,f0,Oe,f0],ps=[z0,z0,z0,z0,f0,f0,f0,f0],vs=[Ne,Y0,tt,z0,Oe,f0,Oe,f0],gs=[Y0,Y0,z0,z0,f0,f0,f0,f0],ys=[Vt,Vt,Y0,Y0,z0,z0,f0,f0],bs=[Zr,Vt,Ne,Y0,Ne,Y0,Ne,Y0],O={DISPLAY:R0[Zr],TEXT:R0[Ne],SCRIPT:R0[tt],SCRIPTSCRIPT:R0[Oe]},Ir=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function xs(r){for(var e=0;e<Ir.length;e++)for(var t=Ir[e],a=0;a<t.blocks.length;a++){var n=t.blocks[a];if(r>=n[0]&&r<=n[1])return t.name}return null}var Ft=[];Ir.forEach(r=>r.blocks.forEach(e=>Ft.push(...e)));function Ln(r){for(var e=0;e<Ft.length;e+=2)if(r>=Ft[e]&&r<=Ft[e+1])return!0;return!1}var $e=80,ws=function(e,t){return"M95,"+(622+e+t)+` 429 - c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 430 - c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 431 - c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 432 - s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 433 - c69,-144,104.5,-217.7,106.5,-221 434 - l`+e/2.075+" -"+e+` 435 - c5.3,-9.3,12,-14,20,-14 436 - H400000v`+(40+e)+`H845.2724 437 - s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 438 - c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z 439 - M`+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},ks=function(e,t){return"M263,"+(601+e+t)+`c0.7,0,18,39.7,52,119 440 - c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 441 - c340,-704.7,510.7,-1060.3,512,-1067 442 - l`+e/2.084+" -"+e+` 443 - c4.7,-7.3,11,-11,19,-11 444 - H40000v`+(40+e)+`H1012.3 445 - s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232 446 - c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 447 - s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 448 - c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z 449 - M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},Ss=function(e,t){return"M983 "+(10+e+t)+` 450 - l`+e/3.13+" -"+e+` 451 - c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+` 452 - H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 453 - s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744 454 - c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 455 - c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 456 - c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 457 - c53.7,-170.3,84.5,-266.8,92.5,-289.5z 458 - M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},As=function(e,t){return"M424,"+(2398+e+t)+` 459 - c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 460 - c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 461 - s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 462 - s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081 463 - l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000 464 - v`+(40+e)+`H1014.6 465 - s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 466 - c-2,6,-10,9,-24,9 467 - c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+t+` 468 - h400000v`+(40+e)+"h-400000z"},Ms=function(e,t){return"M473,"+(2713+e+t)+` 469 - c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+` 470 - c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7 471 - s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 472 - c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 473 - c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 474 - s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, 475 - 606zM`+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"},Ts=function(e){var t=e/2;return"M400000 "+e+" H0 L"+t+" 0 l65 45 L145 "+(e-80)+" H400000z"},zs=function(e,t,a){var n=a-54-t-e;return"M702 "+(e+t)+"H400000"+(40+e)+` 476 - H742v`+n+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 477 - h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 478 - c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 479 - 219 661 l218 661zM702 `+t+"H400000v"+(40+e)+"H742z"},Cs=function(e,t,a){t=1e3*t;var n="";switch(e){case"sqrtMain":n=ws(t,$e);break;case"sqrtSize1":n=ks(t,$e);break;case"sqrtSize2":n=Ss(t,$e);break;case"sqrtSize3":n=As(t,$e);break;case"sqrtSize4":n=Ms(t,$e);break;case"sqrtTall":n=zs(t,$e,a)}return n},Es=function(e,t){switch(e){case"\u239C":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"\u2223":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"\u2225":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z"+("M367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z");case"\u239F":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"\u23A2":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"\u23A5":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"\u23AA":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"\u23D0":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"\u2016":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257z"+("M478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z");default:return""}},un={doubleleftarrow:`M262 157 480 - l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 481 - 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 482 - 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 483 - c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5 484 - 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87 485 - -86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7 486 - -2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z 487 - m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l 488 - -10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5 489 - 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88 490 - -33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68 491 - -17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18 492 - -13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782 493 - c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3 494 - -107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120 495 - 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8 496 - -5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247 497 - c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208 498 - 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3 499 - 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202 500 - l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117 501 - -45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7 502 - 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13 503 - 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688 504 - 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7 505 - -331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80 506 - H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0 507 - 435 0h399565z`,leftgroupunder:`M400000 262 508 - H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219 509 - 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3 510 - -3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5 511 - -18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7 512 - -196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5 513 - 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3 514 - -4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7 515 - -10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z 516 - m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333 517 - 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5 518 - 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667 519 - -152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12 520 - 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7 521 - -2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0 522 - v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 523 - -83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 524 - -68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 525 - 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z 526 - M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z 527 - M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 528 - -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 529 - c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 530 - 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z 531 - M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334 532 - c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 533 - -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 534 - 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 535 - 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214 536 - c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14 537 - 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3 538 - 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0 539 - -5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6 540 - -320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z 541 - m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8 542 - 60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8 543 - -451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z 544 - m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2 545 - c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6 546 - -480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z 547 - m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0 548 - 85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8 549 - -707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z 550 - m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1 551 - c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128 552 - -16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 553 - 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 554 - 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85 555 - -40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 556 - -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 557 - 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l 558 - -6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5 559 - s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1 560 - c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3 561 - 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237 562 - -174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0 563 - 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18 564 - 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3 565 - -3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2 566 - -10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 567 - 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11 568 - -18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7 569 - 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z 570 - m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8 571 - 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5 572 - -7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95 573 - -27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8 574 - 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 575 - 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3 576 - -64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z 577 - m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 578 - 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 579 - -13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 580 - 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z 581 - M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 582 - 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 583 - -52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 584 - -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 585 - 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69 586 - -70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3 587 - -40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19 588 - -37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101 589 - 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167 590 - c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 591 - 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42 592 - 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333 593 - -19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70 594 - 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7 595 - -2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0 596 - 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0 597 - 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128 598 - -68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418 599 - -8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9 600 - 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114 601 - c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751 602 - 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457 603 - -11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0 604 - 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697 605 - 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696 606 - -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345 607 - -11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409 608 - 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9 609 - 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409 610 - -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5 611 - 3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11 612 - 10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63 613 - -1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1 614 - -7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59 615 - H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359 616 - c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22 617 - c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10 618 - -11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10 619 - -11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10 620 - -11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1, 621 - -5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, 622 - -11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, 623 - -11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, 624 - -11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202 625 - c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5 626 - c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130 627 - s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47 628 - 121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6 629 - s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11 630 - c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z 631 - M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32 632 - -27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0 633 - 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39 634 - -84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5 635 - -119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 636 - -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 637 - 151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 638 - c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17 639 - c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21 640 - c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40 641 - c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z 642 - M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0 643 - c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, 644 - -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 645 - c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z 646 - M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 647 - c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9, 648 - 1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7, 649 - -152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z 650 - M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0 651 - c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, 652 - -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 653 - c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z 654 - M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},Bs=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v1759 h347 v-84 655 - H403z M403 1759 V0 H319 V1759 v`+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v1759 H0 v84 H347z 656 - M347 1759 V0 H263 V1759 v`+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15 657 - c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 658 - c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15 659 - c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 660 - c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z 661 - M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15 662 - c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 663 - c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+` v1715 h263 v84 H319z 664 - MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+` v1799 H0 v-84 H319z 665 - MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v602 h84z 666 - M403 1759 V0 H319 V1759 v`+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v602 h84z 667 - M347 1759 V0 h-84 V1759 v`+t+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1 668 - c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349, 669 - -36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210, 670 - 949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9 671 - c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5, 672 - -544.7,-112.5,-882c-2,-104,-3,-167,-3,-189 673 - l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3, 674 - -210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3, 675 - 63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5 676 - c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+` 677 - c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664 678 - c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11 679 - c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 680 - c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 681 - l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, 682 - -470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}},xe=class{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return $.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){var e=t=>t.toText();return this.children.map(e).join("")}},_0={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Dt={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},hn={\u00C5:"A",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};function Ds(r,e){_0[r]=e}function Jr(r,e,t){if(!_0[e])throw new Error("Font metrics not found for font: "+e+".");var a=r.charCodeAt(0),n=_0[e][a];if(!n&&r[0]in hn&&(a=hn[r[0]].charCodeAt(0),n=_0[e][a]),!n&&t==="text"&&Ln(a)&&(n=_0[e][77]),n)return{depth:n[0],height:n[1],italic:n[2],skew:n[3],width:n[4]}}var zr={};function $s(r){var e;if(r>=5?e=0:r>=3?e=1:e=2,!zr[e]){var t=zr[e]={cssEmPerMu:Dt.quad[e]/18};for(var a in Dt)Dt.hasOwnProperty(a)&&(t[a]=Dt[a][e])}return zr[e]}var Ns=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],cn=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],dn=function(e,t){return t.size<2?e:Ns[e-1][t.size-1]},Ut=class r{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||r.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=cn[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a]);return new r(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:dn(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:cn[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=dn(r.BASESIZE,e);return this.size===t&&this.textSize===r.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==r.BASESIZE?["sizing","reset-size"+this.size,"size"+r.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=$s(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}};Ut.BASESIZE=6;var Pr={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},Os={ex:!0,em:!0,mu:!0},jn=function(e){return typeof e!="string"&&(e=e.unit),e in Pr||e in Os||e==="ex"},t0=function(e,t){var a;if(e.unit in Pr)a=Pr[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit==="mu")a=t.fontMetrics().cssEmPerMu;else{var n;if(t.style.isTight()?n=t.havingStyle(t.style.text()):n=t,e.unit==="ex")a=n.fontMetrics().xHeight;else if(e.unit==="em")a=n.fontMetrics().quad;else throw new T("Invalid unit: '"+e.unit+"'");n!==t&&(a*=n.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*a,t.maxSize)},z=function(e){return+e.toFixed(4)+"em"},le=function(e){return e.filter(t=>t).join(" ")},Fn=function(e,t,a){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=a||{},t){t.style.isTight()&&this.classes.push("mtight");var n=t.getColor();n&&(this.style.color=n)}},Vn=function(e){var t=document.createElement(e);t.className=le(this.classes);for(var a in this.style)this.style.hasOwnProperty(a)&&(t.style[a]=this.style[a]);for(var n in this.attributes)this.attributes.hasOwnProperty(n)&&t.setAttribute(n,this.attributes[n]);for(var i=0;i<this.children.length;i++)t.appendChild(this.children[i].toNode());return t},Un=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+$.escape(le(this.classes))+'"');var a="";for(var n in this.style)this.style.hasOwnProperty(n)&&(a+=$.hyphenate(n)+":"+this.style[n]+";");a&&(t+=' style="'+$.escape(a)+'"');for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&(t+=" "+i+'="'+$.escape(this.attributes[i])+'"');t+=">";for(var l=0;l<this.children.length;l++)t+=this.children[l].toMarkup();return t+="</"+e+">",t},we=class{constructor(e,t,a,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,Fn.call(this,e,a,n),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return $.contains(this.classes,e)}toNode(){return Vn.call(this,"span")}toMarkup(){return Un.call(this,"span")}},rt=class{constructor(e,t,a,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Fn.call(this,t,n),this.children=a||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return $.contains(this.classes,e)}toNode(){return Vn.call(this,"a")}toMarkup(){return Un.call(this,"a")}},Lr=class{constructor(e,t,a){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=a}hasClass(e){return $.contains(this.classes,e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var t in this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e='<img src="'+$.escape(this.src)+'"'+(' alt="'+$.escape(this.alt)+'"'),t="";for(var a in this.style)this.style.hasOwnProperty(a)&&(t+=$.hyphenate(a)+":"+this.style[a]+";");return t&&(e+=' style="'+$.escape(t)+'"'),e+="'/>",e}},Rs={\u00EE:"\u0131\u0302",\u00EF:"\u0131\u0308",\u00ED:"\u0131\u0301",\u00EC:"\u0131\u0300"},w0=class{constructor(e,t,a,n,i,l,u,h){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=a||0,this.italic=n||0,this.skew=i||0,this.width=l||0,this.classes=u||[],this.style=h||{},this.maxFontSize=0;var m=xs(this.text.charCodeAt(0));m&&this.classes.push(m+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=Rs[this.text])}hasClass(e){return $.contains(this.classes,e)}toNode(){var e=document.createTextNode(this.text),t=null;this.italic>0&&(t=document.createElement("span"),t.style.marginRight=z(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=le(this.classes));for(var a in this.style)this.style.hasOwnProperty(a)&&(t=t||document.createElement("span"),t.style[a]=this.style[a]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=$.escape(le(this.classes)),t+='"');var a="";this.italic>0&&(a+="margin-right:"+this.italic+"em;");for(var n in this.style)this.style.hasOwnProperty(n)&&(a+=$.hyphenate(n)+":"+this.style[n]+";");a&&(e=!0,t+=' style="'+$.escape(a)+'"');var i=$.escape(this.text);return e?(t+=">",t+=i,t+="</span>",t):i}},N0=class{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");for(var a in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,a)&&t.setAttribute(a,this.attributes[a]);for(var n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+$.escape(this.attributes[t])+'"');e+=">";for(var a=0;a<this.children.length;a++)e+=this.children[a].toMarkup();return e+="</svg>",e}},H0=class{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"path");return this.alternate?t.setAttribute("d",this.alternate):t.setAttribute("d",un[this.pathName]),t}toMarkup(){return this.alternate?'<path d="'+$.escape(this.alternate)+'"/>':'<path d="'+$.escape(un[this.pathName])+'"/>'}},at=class{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"line");for(var a in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,a)&&t.setAttribute(a,this.attributes[a]);return t}toMarkup(){var e="<line";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="'+$.escape(this.attributes[t])+'"');return e+="/>",e}};function mn(r){if(r instanceof w0)return r;throw new Error("Expected symbolNode but got "+String(r)+".")}function _s(r){if(r instanceof we)return r;throw new Error("Expected span<HtmlDomNode> but got "+String(r)+".")}var Hs={bin:1,close:1,inner:1,open:1,punct:1,rel:1},qs={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},K={math:{},text:{}};function s(r,e,t,a,n,i){K[r][n]={font:e,group:t,replace:a},i&&a&&(K[r][a]=K[r][n])}var o="math",S="text",c="main",f="ams",X="accent-token",B="bin",p0="close",Re="inner",N="mathord",i0="op-token",M0="open",Jt="punct",p="rel",Q0="spacing",y="textord";s(o,c,p,"\u2261","\\equiv",!0);s(o,c,p,"\u227A","\\prec",!0);s(o,c,p,"\u227B","\\succ",!0);s(o,c,p,"\u223C","\\sim",!0);s(o,c,p,"\u22A5","\\perp");s(o,c,p,"\u2AAF","\\preceq",!0);s(o,c,p,"\u2AB0","\\succeq",!0);s(o,c,p,"\u2243","\\simeq",!0);s(o,c,p,"\u2223","\\mid",!0);s(o,c,p,"\u226A","\\ll",!0);s(o,c,p,"\u226B","\\gg",!0);s(o,c,p,"\u224D","\\asymp",!0);s(o,c,p,"\u2225","\\parallel");s(o,c,p,"\u22C8","\\bowtie",!0);s(o,c,p,"\u2323","\\smile",!0);s(o,c,p,"\u2291","\\sqsubseteq",!0);s(o,c,p,"\u2292","\\sqsupseteq",!0);s(o,c,p,"\u2250","\\doteq",!0);s(o,c,p,"\u2322","\\frown",!0);s(o,c,p,"\u220B","\\ni",!0);s(o,c,p,"\u221D","\\propto",!0);s(o,c,p,"\u22A2","\\vdash",!0);s(o,c,p,"\u22A3","\\dashv",!0);s(o,c,p,"\u220B","\\owns");s(o,c,Jt,".","\\ldotp");s(o,c,Jt,"\u22C5","\\cdotp");s(o,c,y,"#","\\#");s(S,c,y,"#","\\#");s(o,c,y,"&","\\&");s(S,c,y,"&","\\&");s(o,c,y,"\u2135","\\aleph",!0);s(o,c,y,"\u2200","\\forall",!0);s(o,c,y,"\u210F","\\hbar",!0);s(o,c,y,"\u2203","\\exists",!0);s(o,c,y,"\u2207","\\nabla",!0);s(o,c,y,"\u266D","\\flat",!0);s(o,c,y,"\u2113","\\ell",!0);s(o,c,y,"\u266E","\\natural",!0);s(o,c,y,"\u2663","\\clubsuit",!0);s(o,c,y,"\u2118","\\wp",!0);s(o,c,y,"\u266F","\\sharp",!0);s(o,c,y,"\u2662","\\diamondsuit",!0);s(o,c,y,"\u211C","\\Re",!0);s(o,c,y,"\u2661","\\heartsuit",!0);s(o,c,y,"\u2111","\\Im",!0);s(o,c,y,"\u2660","\\spadesuit",!0);s(o,c,y,"\xA7","\\S",!0);s(S,c,y,"\xA7","\\S");s(o,c,y,"\xB6","\\P",!0);s(S,c,y,"\xB6","\\P");s(o,c,y,"\u2020","\\dag");s(S,c,y,"\u2020","\\dag");s(S,c,y,"\u2020","\\textdagger");s(o,c,y,"\u2021","\\ddag");s(S,c,y,"\u2021","\\ddag");s(S,c,y,"\u2021","\\textdaggerdbl");s(o,c,p0,"\u23B1","\\rmoustache",!0);s(o,c,M0,"\u23B0","\\lmoustache",!0);s(o,c,p0,"\u27EF","\\rgroup",!0);s(o,c,M0,"\u27EE","\\lgroup",!0);s(o,c,B,"\u2213","\\mp",!0);s(o,c,B,"\u2296","\\ominus",!0);s(o,c,B,"\u228E","\\uplus",!0);s(o,c,B,"\u2293","\\sqcap",!0);s(o,c,B,"\u2217","\\ast");s(o,c,B,"\u2294","\\sqcup",!0);s(o,c,B,"\u25EF","\\bigcirc",!0);s(o,c,B,"\u2219","\\bullet",!0);s(o,c,B,"\u2021","\\ddagger");s(o,c,B,"\u2240","\\wr",!0);s(o,c,B,"\u2A3F","\\amalg");s(o,c,B,"&","\\And");s(o,c,p,"\u27F5","\\longleftarrow",!0);s(o,c,p,"\u21D0","\\Leftarrow",!0);s(o,c,p,"\u27F8","\\Longleftarrow",!0);s(o,c,p,"\u27F6","\\longrightarrow",!0);s(o,c,p,"\u21D2","\\Rightarrow",!0);s(o,c,p,"\u27F9","\\Longrightarrow",!0);s(o,c,p,"\u2194","\\leftrightarrow",!0);s(o,c,p,"\u27F7","\\longleftrightarrow",!0);s(o,c,p,"\u21D4","\\Leftrightarrow",!0);s(o,c,p,"\u27FA","\\Longleftrightarrow",!0);s(o,c,p,"\u21A6","\\mapsto",!0);s(o,c,p,"\u27FC","\\longmapsto",!0);s(o,c,p,"\u2197","\\nearrow",!0);s(o,c,p,"\u21A9","\\hookleftarrow",!0);s(o,c,p,"\u21AA","\\hookrightarrow",!0);s(o,c,p,"\u2198","\\searrow",!0);s(o,c,p,"\u21BC","\\leftharpoonup",!0);s(o,c,p,"\u21C0","\\rightharpoonup",!0);s(o,c,p,"\u2199","\\swarrow",!0);s(o,c,p,"\u21BD","\\leftharpoondown",!0);s(o,c,p,"\u21C1","\\rightharpoondown",!0);s(o,c,p,"\u2196","\\nwarrow",!0);s(o,c,p,"\u21CC","\\rightleftharpoons",!0);s(o,f,p,"\u226E","\\nless",!0);s(o,f,p,"\uE010","\\@nleqslant");s(o,f,p,"\uE011","\\@nleqq");s(o,f,p,"\u2A87","\\lneq",!0);s(o,f,p,"\u2268","\\lneqq",!0);s(o,f,p,"\uE00C","\\@lvertneqq");s(o,f,p,"\u22E6","\\lnsim",!0);s(o,f,p,"\u2A89","\\lnapprox",!0);s(o,f,p,"\u2280","\\nprec",!0);s(o,f,p,"\u22E0","\\npreceq",!0);s(o,f,p,"\u22E8","\\precnsim",!0);s(o,f,p,"\u2AB9","\\precnapprox",!0);s(o,f,p,"\u2241","\\nsim",!0);s(o,f,p,"\uE006","\\@nshortmid");s(o,f,p,"\u2224","\\nmid",!0);s(o,f,p,"\u22AC","\\nvdash",!0);s(o,f,p,"\u22AD","\\nvDash",!0);s(o,f,p,"\u22EA","\\ntriangleleft");s(o,f,p,"\u22EC","\\ntrianglelefteq",!0);s(o,f,p,"\u228A","\\subsetneq",!0);s(o,f,p,"\uE01A","\\@varsubsetneq");s(o,f,p,"\u2ACB","\\subsetneqq",!0);s(o,f,p,"\uE017","\\@varsubsetneqq");s(o,f,p,"\u226F","\\ngtr",!0);s(o,f,p,"\uE00F","\\@ngeqslant");s(o,f,p,"\uE00E","\\@ngeqq");s(o,f,p,"\u2A88","\\gneq",!0);s(o,f,p,"\u2269","\\gneqq",!0);s(o,f,p,"\uE00D","\\@gvertneqq");s(o,f,p,"\u22E7","\\gnsim",!0);s(o,f,p,"\u2A8A","\\gnapprox",!0);s(o,f,p,"\u2281","\\nsucc",!0);s(o,f,p,"\u22E1","\\nsucceq",!0);s(o,f,p,"\u22E9","\\succnsim",!0);s(o,f,p,"\u2ABA","\\succnapprox",!0);s(o,f,p,"\u2246","\\ncong",!0);s(o,f,p,"\uE007","\\@nshortparallel");s(o,f,p,"\u2226","\\nparallel",!0);s(o,f,p,"\u22AF","\\nVDash",!0);s(o,f,p,"\u22EB","\\ntriangleright");s(o,f,p,"\u22ED","\\ntrianglerighteq",!0);s(o,f,p,"\uE018","\\@nsupseteqq");s(o,f,p,"\u228B","\\supsetneq",!0);s(o,f,p,"\uE01B","\\@varsupsetneq");s(o,f,p,"\u2ACC","\\supsetneqq",!0);s(o,f,p,"\uE019","\\@varsupsetneqq");s(o,f,p,"\u22AE","\\nVdash",!0);s(o,f,p,"\u2AB5","\\precneqq",!0);s(o,f,p,"\u2AB6","\\succneqq",!0);s(o,f,p,"\uE016","\\@nsubseteqq");s(o,f,B,"\u22B4","\\unlhd");s(o,f,B,"\u22B5","\\unrhd");s(o,f,p,"\u219A","\\nleftarrow",!0);s(o,f,p,"\u219B","\\nrightarrow",!0);s(o,f,p,"\u21CD","\\nLeftarrow",!0);s(o,f,p,"\u21CF","\\nRightarrow",!0);s(o,f,p,"\u21AE","\\nleftrightarrow",!0);s(o,f,p,"\u21CE","\\nLeftrightarrow",!0);s(o,f,p,"\u25B3","\\vartriangle");s(o,f,y,"\u210F","\\hslash");s(o,f,y,"\u25BD","\\triangledown");s(o,f,y,"\u25CA","\\lozenge");s(o,f,y,"\u24C8","\\circledS");s(o,f,y,"\xAE","\\circledR");s(S,f,y,"\xAE","\\circledR");s(o,f,y,"\u2221","\\measuredangle",!0);s(o,f,y,"\u2204","\\nexists");s(o,f,y,"\u2127","\\mho");s(o,f,y,"\u2132","\\Finv",!0);s(o,f,y,"\u2141","\\Game",!0);s(o,f,y,"\u2035","\\backprime");s(o,f,y,"\u25B2","\\blacktriangle");s(o,f,y,"\u25BC","\\blacktriangledown");s(o,f,y,"\u25A0","\\blacksquare");s(o,f,y,"\u29EB","\\blacklozenge");s(o,f,y,"\u2605","\\bigstar");s(o,f,y,"\u2222","\\sphericalangle",!0);s(o,f,y,"\u2201","\\complement",!0);s(o,f,y,"\xF0","\\eth",!0);s(S,c,y,"\xF0","\xF0");s(o,f,y,"\u2571","\\diagup");s(o,f,y,"\u2572","\\diagdown");s(o,f,y,"\u25A1","\\square");s(o,f,y,"\u25A1","\\Box");s(o,f,y,"\u25CA","\\Diamond");s(o,f,y,"\xA5","\\yen",!0);s(S,f,y,"\xA5","\\yen",!0);s(o,f,y,"\u2713","\\checkmark",!0);s(S,f,y,"\u2713","\\checkmark");s(o,f,y,"\u2136","\\beth",!0);s(o,f,y,"\u2138","\\daleth",!0);s(o,f,y,"\u2137","\\gimel",!0);s(o,f,y,"\u03DD","\\digamma",!0);s(o,f,y,"\u03F0","\\varkappa");s(o,f,M0,"\u250C","\\@ulcorner",!0);s(o,f,p0,"\u2510","\\@urcorner",!0);s(o,f,M0,"\u2514","\\@llcorner",!0);s(o,f,p0,"\u2518","\\@lrcorner",!0);s(o,f,p,"\u2266","\\leqq",!0);s(o,f,p,"\u2A7D","\\leqslant",!0);s(o,f,p,"\u2A95","\\eqslantless",!0);s(o,f,p,"\u2272","\\lesssim",!0);s(o,f,p,"\u2A85","\\lessapprox",!0);s(o,f,p,"\u224A","\\approxeq",!0);s(o,f,B,"\u22D6","\\lessdot");s(o,f,p,"\u22D8","\\lll",!0);s(o,f,p,"\u2276","\\lessgtr",!0);s(o,f,p,"\u22DA","\\lesseqgtr",!0);s(o,f,p,"\u2A8B","\\lesseqqgtr",!0);s(o,f,p,"\u2251","\\doteqdot");s(o,f,p,"\u2253","\\risingdotseq",!0);s(o,f,p,"\u2252","\\fallingdotseq",!0);s(o,f,p,"\u223D","\\backsim",!0);s(o,f,p,"\u22CD","\\backsimeq",!0);s(o,f,p,"\u2AC5","\\subseteqq",!0);s(o,f,p,"\u22D0","\\Subset",!0);s(o,f,p,"\u228F","\\sqsubset",!0);s(o,f,p,"\u227C","\\preccurlyeq",!0);s(o,f,p,"\u22DE","\\curlyeqprec",!0);s(o,f,p,"\u227E","\\precsim",!0);s(o,f,p,"\u2AB7","\\precapprox",!0);s(o,f,p,"\u22B2","\\vartriangleleft");s(o,f,p,"\u22B4","\\trianglelefteq");s(o,f,p,"\u22A8","\\vDash",!0);s(o,f,p,"\u22AA","\\Vvdash",!0);s(o,f,p,"\u2323","\\smallsmile");s(o,f,p,"\u2322","\\smallfrown");s(o,f,p,"\u224F","\\bumpeq",!0);s(o,f,p,"\u224E","\\Bumpeq",!0);s(o,f,p,"\u2267","\\geqq",!0);s(o,f,p,"\u2A7E","\\geqslant",!0);s(o,f,p,"\u2A96","\\eqslantgtr",!0);s(o,f,p,"\u2273","\\gtrsim",!0);s(o,f,p,"\u2A86","\\gtrapprox",!0);s(o,f,B,"\u22D7","\\gtrdot");s(o,f,p,"\u22D9","\\ggg",!0);s(o,f,p,"\u2277","\\gtrless",!0);s(o,f,p,"\u22DB","\\gtreqless",!0);s(o,f,p,"\u2A8C","\\gtreqqless",!0);s(o,f,p,"\u2256","\\eqcirc",!0);s(o,f,p,"\u2257","\\circeq",!0);s(o,f,p,"\u225C","\\triangleq",!0);s(o,f,p,"\u223C","\\thicksim");s(o,f,p,"\u2248","\\thickapprox");s(o,f,p,"\u2AC6","\\supseteqq",!0);s(o,f,p,"\u22D1","\\Supset",!0);s(o,f,p,"\u2290","\\sqsupset",!0);s(o,f,p,"\u227D","\\succcurlyeq",!0);s(o,f,p,"\u22DF","\\curlyeqsucc",!0);s(o,f,p,"\u227F","\\succsim",!0);s(o,f,p,"\u2AB8","\\succapprox",!0);s(o,f,p,"\u22B3","\\vartriangleright");s(o,f,p,"\u22B5","\\trianglerighteq");s(o,f,p,"\u22A9","\\Vdash",!0);s(o,f,p,"\u2223","\\shortmid");s(o,f,p,"\u2225","\\shortparallel");s(o,f,p,"\u226C","\\between",!0);s(o,f,p,"\u22D4","\\pitchfork",!0);s(o,f,p,"\u221D","\\varpropto");s(o,f,p,"\u25C0","\\blacktriangleleft");s(o,f,p,"\u2234","\\therefore",!0);s(o,f,p,"\u220D","\\backepsilon");s(o,f,p,"\u25B6","\\blacktriangleright");s(o,f,p,"\u2235","\\because",!0);s(o,f,p,"\u22D8","\\llless");s(o,f,p,"\u22D9","\\gggtr");s(o,f,B,"\u22B2","\\lhd");s(o,f,B,"\u22B3","\\rhd");s(o,f,p,"\u2242","\\eqsim",!0);s(o,c,p,"\u22C8","\\Join");s(o,f,p,"\u2251","\\Doteq",!0);s(o,f,B,"\u2214","\\dotplus",!0);s(o,f,B,"\u2216","\\smallsetminus");s(o,f,B,"\u22D2","\\Cap",!0);s(o,f,B,"\u22D3","\\Cup",!0);s(o,f,B,"\u2A5E","\\doublebarwedge",!0);s(o,f,B,"\u229F","\\boxminus",!0);s(o,f,B,"\u229E","\\boxplus",!0);s(o,f,B,"\u22C7","\\divideontimes",!0);s(o,f,B,"\u22C9","\\ltimes",!0);s(o,f,B,"\u22CA","\\rtimes",!0);s(o,f,B,"\u22CB","\\leftthreetimes",!0);s(o,f,B,"\u22CC","\\rightthreetimes",!0);s(o,f,B,"\u22CF","\\curlywedge",!0);s(o,f,B,"\u22CE","\\curlyvee",!0);s(o,f,B,"\u229D","\\circleddash",!0);s(o,f,B,"\u229B","\\circledast",!0);s(o,f,B,"\u22C5","\\centerdot");s(o,f,B,"\u22BA","\\intercal",!0);s(o,f,B,"\u22D2","\\doublecap");s(o,f,B,"\u22D3","\\doublecup");s(o,f,B,"\u22A0","\\boxtimes",!0);s(o,f,p,"\u21E2","\\dashrightarrow",!0);s(o,f,p,"\u21E0","\\dashleftarrow",!0);s(o,f,p,"\u21C7","\\leftleftarrows",!0);s(o,f,p,"\u21C6","\\leftrightarrows",!0);s(o,f,p,"\u21DA","\\Lleftarrow",!0);s(o,f,p,"\u219E","\\twoheadleftarrow",!0);s(o,f,p,"\u21A2","\\leftarrowtail",!0);s(o,f,p,"\u21AB","\\looparrowleft",!0);s(o,f,p,"\u21CB","\\leftrightharpoons",!0);s(o,f,p,"\u21B6","\\curvearrowleft",!0);s(o,f,p,"\u21BA","\\circlearrowleft",!0);s(o,f,p,"\u21B0","\\Lsh",!0);s(o,f,p,"\u21C8","\\upuparrows",!0);s(o,f,p,"\u21BF","\\upharpoonleft",!0);s(o,f,p,"\u21C3","\\downharpoonleft",!0);s(o,c,p,"\u22B6","\\origof",!0);s(o,c,p,"\u22B7","\\imageof",!0);s(o,f,p,"\u22B8","\\multimap",!0);s(o,f,p,"\u21AD","\\leftrightsquigarrow",!0);s(o,f,p,"\u21C9","\\rightrightarrows",!0);s(o,f,p,"\u21C4","\\rightleftarrows",!0);s(o,f,p,"\u21A0","\\twoheadrightarrow",!0);s(o,f,p,"\u21A3","\\rightarrowtail",!0);s(o,f,p,"\u21AC","\\looparrowright",!0);s(o,f,p,"\u21B7","\\curvearrowright",!0);s(o,f,p,"\u21BB","\\circlearrowright",!0);s(o,f,p,"\u21B1","\\Rsh",!0);s(o,f,p,"\u21CA","\\downdownarrows",!0);s(o,f,p,"\u21BE","\\upharpoonright",!0);s(o,f,p,"\u21C2","\\downharpoonright",!0);s(o,f,p,"\u21DD","\\rightsquigarrow",!0);s(o,f,p,"\u21DD","\\leadsto");s(o,f,p,"\u21DB","\\Rrightarrow",!0);s(o,f,p,"\u21BE","\\restriction");s(o,c,y,"\u2018","`");s(o,c,y,"$","\\$");s(S,c,y,"$","\\$");s(S,c,y,"$","\\textdollar");s(o,c,y,"%","\\%");s(S,c,y,"%","\\%");s(o,c,y,"_","\\_");s(S,c,y,"_","\\_");s(S,c,y,"_","\\textunderscore");s(o,c,y,"\u2220","\\angle",!0);s(o,c,y,"\u221E","\\infty",!0);s(o,c,y,"\u2032","\\prime");s(o,c,y,"\u25B3","\\triangle");s(o,c,y,"\u0393","\\Gamma",!0);s(o,c,y,"\u0394","\\Delta",!0);s(o,c,y,"\u0398","\\Theta",!0);s(o,c,y,"\u039B","\\Lambda",!0);s(o,c,y,"\u039E","\\Xi",!0);s(o,c,y,"\u03A0","\\Pi",!0);s(o,c,y,"\u03A3","\\Sigma",!0);s(o,c,y,"\u03A5","\\Upsilon",!0);s(o,c,y,"\u03A6","\\Phi",!0);s(o,c,y,"\u03A8","\\Psi",!0);s(o,c,y,"\u03A9","\\Omega",!0);s(o,c,y,"A","\u0391");s(o,c,y,"B","\u0392");s(o,c,y,"E","\u0395");s(o,c,y,"Z","\u0396");s(o,c,y,"H","\u0397");s(o,c,y,"I","\u0399");s(o,c,y,"K","\u039A");s(o,c,y,"M","\u039C");s(o,c,y,"N","\u039D");s(o,c,y,"O","\u039F");s(o,c,y,"P","\u03A1");s(o,c,y,"T","\u03A4");s(o,c,y,"X","\u03A7");s(o,c,y,"\xAC","\\neg",!0);s(o,c,y,"\xAC","\\lnot");s(o,c,y,"\u22A4","\\top");s(o,c,y,"\u22A5","\\bot");s(o,c,y,"\u2205","\\emptyset");s(o,f,y,"\u2205","\\varnothing");s(o,c,N,"\u03B1","\\alpha",!0);s(o,c,N,"\u03B2","\\beta",!0);s(o,c,N,"\u03B3","\\gamma",!0);s(o,c,N,"\u03B4","\\delta",!0);s(o,c,N,"\u03F5","\\epsilon",!0);s(o,c,N,"\u03B6","\\zeta",!0);s(o,c,N,"\u03B7","\\eta",!0);s(o,c,N,"\u03B8","\\theta",!0);s(o,c,N,"\u03B9","\\iota",!0);s(o,c,N,"\u03BA","\\kappa",!0);s(o,c,N,"\u03BB","\\lambda",!0);s(o,c,N,"\u03BC","\\mu",!0);s(o,c,N,"\u03BD","\\nu",!0);s(o,c,N,"\u03BE","\\xi",!0);s(o,c,N,"\u03BF","\\omicron",!0);s(o,c,N,"\u03C0","\\pi",!0);s(o,c,N,"\u03C1","\\rho",!0);s(o,c,N,"\u03C3","\\sigma",!0);s(o,c,N,"\u03C4","\\tau",!0);s(o,c,N,"\u03C5","\\upsilon",!0);s(o,c,N,"\u03D5","\\phi",!0);s(o,c,N,"\u03C7","\\chi",!0);s(o,c,N,"\u03C8","\\psi",!0);s(o,c,N,"\u03C9","\\omega",!0);s(o,c,N,"\u03B5","\\varepsilon",!0);s(o,c,N,"\u03D1","\\vartheta",!0);s(o,c,N,"\u03D6","\\varpi",!0);s(o,c,N,"\u03F1","\\varrho",!0);s(o,c,N,"\u03C2","\\varsigma",!0);s(o,c,N,"\u03C6","\\varphi",!0);s(o,c,B,"\u2217","*",!0);s(o,c,B,"+","+");s(o,c,B,"\u2212","-",!0);s(o,c,B,"\u22C5","\\cdot",!0);s(o,c,B,"\u2218","\\circ",!0);s(o,c,B,"\xF7","\\div",!0);s(o,c,B,"\xB1","\\pm",!0);s(o,c,B,"\xD7","\\times",!0);s(o,c,B,"\u2229","\\cap",!0);s(o,c,B,"\u222A","\\cup",!0);s(o,c,B,"\u2216","\\setminus",!0);s(o,c,B,"\u2227","\\land");s(o,c,B,"\u2228","\\lor");s(o,c,B,"\u2227","\\wedge",!0);s(o,c,B,"\u2228","\\vee",!0);s(o,c,y,"\u221A","\\surd");s(o,c,M0,"\u27E8","\\langle",!0);s(o,c,M0,"\u2223","\\lvert");s(o,c,M0,"\u2225","\\lVert");s(o,c,p0,"?","?");s(o,c,p0,"!","!");s(o,c,p0,"\u27E9","\\rangle",!0);s(o,c,p0,"\u2223","\\rvert");s(o,c,p0,"\u2225","\\rVert");s(o,c,p,"=","=");s(o,c,p,":",":");s(o,c,p,"\u2248","\\approx",!0);s(o,c,p,"\u2245","\\cong",!0);s(o,c,p,"\u2265","\\ge");s(o,c,p,"\u2265","\\geq",!0);s(o,c,p,"\u2190","\\gets");s(o,c,p,">","\\gt",!0);s(o,c,p,"\u2208","\\in",!0);s(o,c,p,"\uE020","\\@not");s(o,c,p,"\u2282","\\subset",!0);s(o,c,p,"\u2283","\\supset",!0);s(o,c,p,"\u2286","\\subseteq",!0);s(o,c,p,"\u2287","\\supseteq",!0);s(o,f,p,"\u2288","\\nsubseteq",!0);s(o,f,p,"\u2289","\\nsupseteq",!0);s(o,c,p,"\u22A8","\\models");s(o,c,p,"\u2190","\\leftarrow",!0);s(o,c,p,"\u2264","\\le");s(o,c,p,"\u2264","\\leq",!0);s(o,c,p,"<","\\lt",!0);s(o,c,p,"\u2192","\\rightarrow",!0);s(o,c,p,"\u2192","\\to");s(o,f,p,"\u2271","\\ngeq",!0);s(o,f,p,"\u2270","\\nleq",!0);s(o,c,Q0,"\xA0","\\ ");s(o,c,Q0,"\xA0","\\space");s(o,c,Q0,"\xA0","\\nobreakspace");s(S,c,Q0,"\xA0","\\ ");s(S,c,Q0,"\xA0"," ");s(S,c,Q0,"\xA0","\\space");s(S,c,Q0,"\xA0","\\nobreakspace");s(o,c,Q0,null,"\\nobreak");s(o,c,Q0,null,"\\allowbreak");s(o,c,Jt,",",",");s(o,c,Jt,";",";");s(o,f,B,"\u22BC","\\barwedge",!0);s(o,f,B,"\u22BB","\\veebar",!0);s(o,c,B,"\u2299","\\odot",!0);s(o,c,B,"\u2295","\\oplus",!0);s(o,c,B,"\u2297","\\otimes",!0);s(o,c,y,"\u2202","\\partial",!0);s(o,c,B,"\u2298","\\oslash",!0);s(o,f,B,"\u229A","\\circledcirc",!0);s(o,f,B,"\u22A1","\\boxdot",!0);s(o,c,B,"\u25B3","\\bigtriangleup");s(o,c,B,"\u25BD","\\bigtriangledown");s(o,c,B,"\u2020","\\dagger");s(o,c,B,"\u22C4","\\diamond");s(o,c,B,"\u22C6","\\star");s(o,c,B,"\u25C3","\\triangleleft");s(o,c,B,"\u25B9","\\triangleright");s(o,c,M0,"{","\\{");s(S,c,y,"{","\\{");s(S,c,y,"{","\\textbraceleft");s(o,c,p0,"}","\\}");s(S,c,y,"}","\\}");s(S,c,y,"}","\\textbraceright");s(o,c,M0,"{","\\lbrace");s(o,c,p0,"}","\\rbrace");s(o,c,M0,"[","\\lbrack",!0);s(S,c,y,"[","\\lbrack",!0);s(o,c,p0,"]","\\rbrack",!0);s(S,c,y,"]","\\rbrack",!0);s(o,c,M0,"(","\\lparen",!0);s(o,c,p0,")","\\rparen",!0);s(S,c,y,"<","\\textless",!0);s(S,c,y,">","\\textgreater",!0);s(o,c,M0,"\u230A","\\lfloor",!0);s(o,c,p0,"\u230B","\\rfloor",!0);s(o,c,M0,"\u2308","\\lceil",!0);s(o,c,p0,"\u2309","\\rceil",!0);s(o,c,y,"\\","\\backslash");s(o,c,y,"\u2223","|");s(o,c,y,"\u2223","\\vert");s(S,c,y,"|","\\textbar",!0);s(o,c,y,"\u2225","\\|");s(o,c,y,"\u2225","\\Vert");s(S,c,y,"\u2225","\\textbardbl");s(S,c,y,"~","\\textasciitilde");s(S,c,y,"\\","\\textbackslash");s(S,c,y,"^","\\textasciicircum");s(o,c,p,"\u2191","\\uparrow",!0);s(o,c,p,"\u21D1","\\Uparrow",!0);s(o,c,p,"\u2193","\\downarrow",!0);s(o,c,p,"\u21D3","\\Downarrow",!0);s(o,c,p,"\u2195","\\updownarrow",!0);s(o,c,p,"\u21D5","\\Updownarrow",!0);s(o,c,i0,"\u2210","\\coprod");s(o,c,i0,"\u22C1","\\bigvee");s(o,c,i0,"\u22C0","\\bigwedge");s(o,c,i0,"\u2A04","\\biguplus");s(o,c,i0,"\u22C2","\\bigcap");s(o,c,i0,"\u22C3","\\bigcup");s(o,c,i0,"\u222B","\\int");s(o,c,i0,"\u222B","\\intop");s(o,c,i0,"\u222C","\\iint");s(o,c,i0,"\u222D","\\iiint");s(o,c,i0,"\u220F","\\prod");s(o,c,i0,"\u2211","\\sum");s(o,c,i0,"\u2A02","\\bigotimes");s(o,c,i0,"\u2A01","\\bigoplus");s(o,c,i0,"\u2A00","\\bigodot");s(o,c,i0,"\u222E","\\oint");s(o,c,i0,"\u222F","\\oiint");s(o,c,i0,"\u2230","\\oiiint");s(o,c,i0,"\u2A06","\\bigsqcup");s(o,c,i0,"\u222B","\\smallint");s(S,c,Re,"\u2026","\\textellipsis");s(o,c,Re,"\u2026","\\mathellipsis");s(S,c,Re,"\u2026","\\ldots",!0);s(o,c,Re,"\u2026","\\ldots",!0);s(o,c,Re,"\u22EF","\\@cdots",!0);s(o,c,Re,"\u22F1","\\ddots",!0);s(o,c,y,"\u22EE","\\varvdots");s(o,c,X,"\u02CA","\\acute");s(o,c,X,"\u02CB","\\grave");s(o,c,X,"\xA8","\\ddot");s(o,c,X,"~","\\tilde");s(o,c,X,"\u02C9","\\bar");s(o,c,X,"\u02D8","\\breve");s(o,c,X,"\u02C7","\\check");s(o,c,X,"^","\\hat");s(o,c,X,"\u20D7","\\vec");s(o,c,X,"\u02D9","\\dot");s(o,c,X,"\u02DA","\\mathring");s(o,c,N,"\uE131","\\@imath");s(o,c,N,"\uE237","\\@jmath");s(o,c,y,"\u0131","\u0131");s(o,c,y,"\u0237","\u0237");s(S,c,y,"\u0131","\\i",!0);s(S,c,y,"\u0237","\\j",!0);s(S,c,y,"\xDF","\\ss",!0);s(S,c,y,"\xE6","\\ae",!0);s(S,c,y,"\u0153","\\oe",!0);s(S,c,y,"\xF8","\\o",!0);s(S,c,y,"\xC6","\\AE",!0);s(S,c,y,"\u0152","\\OE",!0);s(S,c,y,"\xD8","\\O",!0);s(S,c,X,"\u02CA","\\'");s(S,c,X,"\u02CB","\\`");s(S,c,X,"\u02C6","\\^");s(S,c,X,"\u02DC","\\~");s(S,c,X,"\u02C9","\\=");s(S,c,X,"\u02D8","\\u");s(S,c,X,"\u02D9","\\.");s(S,c,X,"\xB8","\\c");s(S,c,X,"\u02DA","\\r");s(S,c,X,"\u02C7","\\v");s(S,c,X,"\xA8",'\\"');s(S,c,X,"\u02DD","\\H");s(S,c,X,"\u25EF","\\textcircled");var Gn={"--":!0,"---":!0,"``":!0,"''":!0};s(S,c,y,"\u2013","--",!0);s(S,c,y,"\u2013","\\textendash");s(S,c,y,"\u2014","---",!0);s(S,c,y,"\u2014","\\textemdash");s(S,c,y,"\u2018","`",!0);s(S,c,y,"\u2018","\\textquoteleft");s(S,c,y,"\u2019","'",!0);s(S,c,y,"\u2019","\\textquoteright");s(S,c,y,"\u201C","``",!0);s(S,c,y,"\u201C","\\textquotedblleft");s(S,c,y,"\u201D","''",!0);s(S,c,y,"\u201D","\\textquotedblright");s(o,c,y,"\xB0","\\degree",!0);s(S,c,y,"\xB0","\\degree");s(S,c,y,"\xB0","\\textdegree",!0);s(o,c,y,"\xA3","\\pounds");s(o,c,y,"\xA3","\\mathsterling",!0);s(S,c,y,"\xA3","\\pounds");s(S,c,y,"\xA3","\\textsterling",!0);s(o,f,y,"\u2720","\\maltese");s(S,f,y,"\u2720","\\maltese");var fn='0123456789/@."';for($t=0;$t<fn.length;$t++)Cr=fn.charAt($t),s(o,c,y,Cr,Cr);var Cr,$t,pn='0123456789!@*()-=+";:?/.,';for(Nt=0;Nt<pn.length;Nt++)Er=pn.charAt(Nt),s(S,c,y,Er,Er);var Er,Nt,Gt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(Ot=0;Ot<Gt.length;Ot++)Xe=Gt.charAt(Ot),s(o,c,N,Xe,Xe),s(S,c,y,Xe,Xe);var Xe,Ot;s(o,f,y,"C","\u2102");s(S,f,y,"C","\u2102");s(o,f,y,"H","\u210D");s(S,f,y,"H","\u210D");s(o,f,y,"N","\u2115");s(S,f,y,"N","\u2115");s(o,f,y,"P","\u2119");s(S,f,y,"P","\u2119");s(o,f,y,"Q","\u211A");s(S,f,y,"Q","\u211A");s(o,f,y,"R","\u211D");s(S,f,y,"R","\u211D");s(o,f,y,"Z","\u2124");s(S,f,y,"Z","\u2124");s(o,c,N,"h","\u210E");s(S,c,N,"h","\u210E");var _="";for(d0=0;d0<Gt.length;d0++)Q=Gt.charAt(d0),_=String.fromCharCode(55349,56320+d0),s(o,c,N,Q,_),s(S,c,y,Q,_),_=String.fromCharCode(55349,56372+d0),s(o,c,N,Q,_),s(S,c,y,Q,_),_=String.fromCharCode(55349,56424+d0),s(o,c,N,Q,_),s(S,c,y,Q,_),_=String.fromCharCode(55349,56580+d0),s(o,c,N,Q,_),s(S,c,y,Q,_),_=String.fromCharCode(55349,56684+d0),s(o,c,N,Q,_),s(S,c,y,Q,_),_=String.fromCharCode(55349,56736+d0),s(o,c,N,Q,_),s(S,c,y,Q,_),_=String.fromCharCode(55349,56788+d0),s(o,c,N,Q,_),s(S,c,y,Q,_),_=String.fromCharCode(55349,56840+d0),s(o,c,N,Q,_),s(S,c,y,Q,_),_=String.fromCharCode(55349,56944+d0),s(o,c,N,Q,_),s(S,c,y,Q,_),d0<26&&(_=String.fromCharCode(55349,56632+d0),s(o,c,N,Q,_),s(S,c,y,Q,_),_=String.fromCharCode(55349,56476+d0),s(o,c,N,Q,_),s(S,c,y,Q,_));var Q,d0;_=String.fromCharCode(55349,56668);s(o,c,N,"k",_);s(S,c,y,"k",_);for(ie=0;ie<10;ie++)K0=ie.toString(),_=String.fromCharCode(55349,57294+ie),s(o,c,N,K0,_),s(S,c,y,K0,_),_=String.fromCharCode(55349,57314+ie),s(o,c,N,K0,_),s(S,c,y,K0,_),_=String.fromCharCode(55349,57324+ie),s(o,c,N,K0,_),s(S,c,y,K0,_),_=String.fromCharCode(55349,57334+ie),s(o,c,N,K0,_),s(S,c,y,K0,_);var K0,ie,jr="\xD0\xDE\xFE";for(Rt=0;Rt<jr.length;Rt++)Ze=jr.charAt(Rt),s(o,c,N,Ze,Ze),s(S,c,y,Ze,Ze);var Ze,Rt,_t=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],vn=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],Is=function(e,t){var a=e.charCodeAt(0),n=e.charCodeAt(1),i=(a-55296)*1024+(n-56320)+65536,l=t==="math"?0:1;if(119808<=i&&i<120484){var u=Math.floor((i-119808)/26);return[_t[u][2],_t[u][l]]}else if(120782<=i&&i<=120831){var h=Math.floor((i-120782)/10);return[vn[h][2],vn[h][l]]}else{if(i===120485||i===120486)return[_t[0][2],_t[0][l]];if(120486<i&&i<120782)return["",""];throw new T("Unsupported character: "+e)}},Qt=function(e,t,a){return K[a][e]&&K[a][e].replace&&(e=K[a][e].replace),{value:e,metrics:Jr(e,t,a)}},$0=function(e,t,a,n,i){var l=Qt(e,t,a),u=l.metrics;e=l.value;var h;if(u){var m=u.italic;(a==="text"||n&&n.font==="mathit")&&(m=0),h=new w0(e,u.height,u.depth,m,u.skew,u.width,i)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+e+"' in style '"+t+"' and mode '"+a+"'")),h=new w0(e,0,0,0,0,0,i);if(n){h.maxFontSize=n.sizeMultiplier,n.style.isTight()&&h.classes.push("mtight");var v=n.getColor();v&&(h.style.color=v)}return h},Ps=function(e,t,a,n){return n===void 0&&(n=[]),a.font==="boldsymbol"&&Qt(e,"Main-Bold",t).metrics?$0(e,"Main-Bold",t,a,n.concat(["mathbf"])):e==="\\"||K[t][e].font==="main"?$0(e,"Main-Regular",t,a,n):$0(e,"AMS-Regular",t,a,n.concat(["amsrm"]))},Ls=function(e,t,a,n,i){return i!=="textord"&&Qt(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},js=function(e,t,a){var n=e.mode,i=e.text,l=["mord"],u=n==="math"||n==="text"&&t.font,h=u?t.font:t.fontFamily,m="",v="";if(i.charCodeAt(0)===55349&&([m,v]=Is(i,n)),m.length>0)return $0(i,m,n,t,l.concat(v));if(h){var g,b;if(h==="boldsymbol"){var x=Ls(i,n,t,l,a);g=x.fontName,b=[x.fontClass]}else u?(g=Yn[h].fontName,b=[h]):(g=Ht(h,t.fontWeight,t.fontShape),b=[h,t.fontWeight,t.fontShape]);if(Qt(i,g,n).metrics)return $0(i,g,n,t,l.concat(b));if(Gn.hasOwnProperty(i)&&g.slice(0,10)==="Typewriter"){for(var k=[],A=0;A<i.length;A++)k.push($0(i[A],g,n,t,l.concat(b)));return Wn(k)}}if(a==="mathord")return $0(i,"Math-Italic",n,t,l.concat(["mathnormal"]));if(a==="textord"){var C=K[n][i]&&K[n][i].font;if(C==="ams"){var D=Ht("amsrm",t.fontWeight,t.fontShape);return $0(i,D,n,t,l.concat("amsrm",t.fontWeight,t.fontShape))}else if(C==="main"||!C){var R=Ht("textrm",t.fontWeight,t.fontShape);return $0(i,R,n,t,l.concat(t.fontWeight,t.fontShape))}else{var H=Ht(C,t.fontWeight,t.fontShape);return $0(i,H,n,t,l.concat(H,t.fontWeight,t.fontShape))}}else throw new Error("unexpected type: "+a+" in makeOrd")},Fs=(r,e)=>{if(le(r.classes)!==le(e.classes)||r.skew!==e.skew||r.maxFontSize!==e.maxFontSize)return!1;if(r.classes.length===1){var t=r.classes[0];if(t==="mbin"||t==="mord")return!1}for(var a in r.style)if(r.style.hasOwnProperty(a)&&r.style[a]!==e.style[a])return!1;for(var n in e.style)if(e.style.hasOwnProperty(n)&&r.style[n]!==e.style[n])return!1;return!0},Vs=r=>{for(var e=0;e<r.length-1;e++){var t=r[e],a=r[e+1];t instanceof w0&&a instanceof w0&&Fs(t,a)&&(t.text+=a.text,t.height=Math.max(t.height,a.height),t.depth=Math.max(t.depth,a.depth),t.italic=a.italic,r.splice(e+1,1),e--)}return r},Qr=function(e){for(var t=0,a=0,n=0,i=0;i<e.children.length;i++){var l=e.children[i];l.height>t&&(t=l.height),l.depth>a&&(a=l.depth),l.maxFontSize>n&&(n=l.maxFontSize)}e.height=t,e.depth=a,e.maxFontSize=n},b0=function(e,t,a,n){var i=new we(e,t,a,n);return Qr(i),i},Kn=(r,e,t,a)=>new we(r,e,t,a),Us=function(e,t,a){var n=b0([e],[],t);return n.height=Math.max(a||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),n.style.borderBottomWidth=z(n.height),n.maxFontSize=1,n},Gs=function(e,t,a,n){var i=new rt(e,t,a,n);return Qr(i),i},Wn=function(e){var t=new xe(e);return Qr(t),t},Ks=function(e,t){return e instanceof xe?b0([],[e],t):e},Ws=function(e){if(e.positionType==="individualShift"){for(var t=e.children,a=[t[0]],n=-t[0].shift-t[0].elem.depth,i=n,l=1;l<t.length;l++){var u=-t[l].shift-i-t[l].elem.depth,h=u-(t[l-1].elem.height+t[l-1].elem.depth);i=i+u,a.push({type:"kern",size:h}),a.push(t[l])}return{children:a,depth:n}}var m;if(e.positionType==="top"){for(var v=e.positionData,g=0;g<e.children.length;g++){var b=e.children[g];v-=b.type==="kern"?b.size:b.elem.height+b.elem.depth}m=v}else if(e.positionType==="bottom")m=-e.positionData;else{var x=e.children[0];if(x.type!=="elem")throw new Error('First child must have type "elem".');if(e.positionType==="shift")m=-x.elem.depth-e.positionData;else if(e.positionType==="firstBaseline")m=-x.elem.depth;else throw new Error("Invalid positionType "+e.positionType+".")}return{children:e.children,depth:m}},Ys=function(e,t){for(var{children:a,depth:n}=Ws(e),i=0,l=0;l<a.length;l++){var u=a[l];if(u.type==="elem"){var h=u.elem;i=Math.max(i,h.maxFontSize,h.height)}}i+=2;var m=b0(["pstrut"],[]);m.style.height=z(i);for(var v=[],g=n,b=n,x=n,k=0;k<a.length;k++){var A=a[k];if(A.type==="kern")x+=A.size;else{var C=A.elem,D=A.wrapperClasses||[],R=A.wrapperStyle||{},H=b0(D,[m,C],void 0,R);H.style.top=z(-i-x-C.depth),A.marginLeft&&(H.style.marginLeft=A.marginLeft),A.marginRight&&(H.style.marginRight=A.marginRight),v.push(H),x+=C.height+C.depth}g=Math.min(g,x),b=Math.max(b,x)}var j=b0(["vlist"],v);j.style.height=z(b);var I;if(g<0){var F=b0([],[]),L=b0(["vlist"],[F]);L.style.height=z(-g);var Z=b0(["vlist-s"],[new w0("\u200B")]);I=[b0(["vlist-r"],[j,Z]),b0(["vlist-r"],[L])]}else I=[b0(["vlist-r"],[j])];var V=b0(["vlist-t"],I);return I.length===2&&V.classes.push("vlist-t2"),V.height=b,V.depth=-g,V},Xs=(r,e)=>{var t=b0(["mspace"],[],e),a=t0(r,e);return t.style.marginRight=z(a),t},Ht=function(e,t,a){var n="";switch(e){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=e}var i;return t==="textbf"&&a==="textit"?i="BoldItalic":t==="textbf"?i="Bold":t==="textit"?i="Italic":i="Regular",n+"-"+i},Yn={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Xn={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Zs=function(e,t){var[a,n,i]=Xn[e],l=new H0(a),u=new N0([l],{width:z(n),height:z(i),style:"width:"+z(n),viewBox:"0 0 "+1e3*n+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),h=Kn(["overlay"],[u],t);return h.height=i,h.style.height=z(i),h.style.width=z(n),h},w={fontMap:Yn,makeSymbol:$0,mathsym:Ps,makeSpan:b0,makeSvgSpan:Kn,makeLineSpan:Us,makeAnchor:Gs,makeFragment:Wn,wrapFragment:Ks,makeVList:Ys,makeOrd:js,makeGlue:Xs,staticSvg:Zs,svgData:Xn,tryCombineChars:Vs},e0={number:3,unit:"mu"},ye={number:4,unit:"mu"},W0={number:5,unit:"mu"},Js={mord:{mop:e0,mbin:ye,mrel:W0,minner:e0},mop:{mord:e0,mop:e0,mrel:W0,minner:e0},mbin:{mord:ye,mop:ye,mopen:ye,minner:ye},mrel:{mord:W0,mop:W0,mopen:W0,minner:W0},mopen:{},mclose:{mop:e0,mbin:ye,mrel:W0,minner:e0},mpunct:{mord:e0,mop:e0,mrel:W0,mopen:e0,mclose:e0,mpunct:e0,minner:e0},minner:{mord:e0,mop:e0,mbin:ye,mrel:W0,mopen:e0,mpunct:e0,minner:e0}},Qs={mord:{mop:e0},mop:{mord:e0,mop:e0},mbin:{},mrel:{},mopen:{},mclose:{mop:e0},mpunct:{},minner:{mop:e0}},Zn={},Kt={},Wt={};function E(r){for(var{type:e,names:t,props:a,handler:n,htmlBuilder:i,mathmlBuilder:l}=r,u={type:e,numArgs:a.numArgs,argTypes:a.argTypes,allowedInArgument:!!a.allowedInArgument,allowedInText:!!a.allowedInText,allowedInMath:a.allowedInMath===void 0?!0:a.allowedInMath,numOptionalArgs:a.numOptionalArgs||0,infix:!!a.infix,primitive:!!a.primitive,handler:n},h=0;h<t.length;++h)Zn[t[h]]=u;e&&(i&&(Kt[e]=i),l&&(Wt[e]=l))}function ke(r){var{type:e,htmlBuilder:t,mathmlBuilder:a}=r;E({type:e,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:t,mathmlBuilder:a})}var Yt=function(e){return e.type==="ordgroup"&&e.body.length===1?e.body[0]:e},n0=function(e){return e.type==="ordgroup"?e.body:[e]},Z0=w.makeSpan,e1=["leftmost","mbin","mopen","mrel","mop","mpunct"],t1=["rightmost","mrel","mclose","mpunct"],r1={display:O.DISPLAY,text:O.TEXT,script:O.SCRIPT,scriptscript:O.SCRIPTSCRIPT},a1={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},l0=function(e,t,a,n){n===void 0&&(n=[null,null]);for(var i=[],l=0;l<e.length;l++){var u=P(e[l],t);if(u instanceof xe){var h=u.children;i.push(...h)}else i.push(u)}if(w.tryCombineChars(i),!a)return i;var m=t;if(e.length===1){var v=e[0];v.type==="sizing"?m=t.havingSize(v.size):v.type==="styling"&&(m=t.havingStyle(r1[v.style]))}var g=Z0([n[0]||"leftmost"],[],t),b=Z0([n[1]||"rightmost"],[],t),x=a==="root";return gn(i,(k,A)=>{var C=A.classes[0],D=k.classes[0];C==="mbin"&&$.contains(t1,D)?A.classes[0]="mord":D==="mbin"&&$.contains(e1,C)&&(k.classes[0]="mord")},{node:g},b,x),gn(i,(k,A)=>{var C=Fr(A),D=Fr(k),R=C&&D?k.hasClass("mtight")?Qs[C][D]:Js[C][D]:null;if(R)return w.makeGlue(R,m)},{node:g},b,x),i},gn=function r(e,t,a,n,i){n&&e.push(n);for(var l=0;l<e.length;l++){var u=e[l],h=Jn(u);if(h){r(h.children,t,a,null,i);continue}var m=!u.hasClass("mspace");if(m){var v=t(u,a.node);v&&(a.insertAfter?a.insertAfter(v):(e.unshift(v),l++))}m?a.node=u:i&&u.hasClass("newline")&&(a.node=Z0(["leftmost"])),a.insertAfter=(g=>b=>{e.splice(g+1,0,b),l++})(l)}n&&e.pop()},Jn=function(e){return e instanceof xe||e instanceof rt||e instanceof we&&e.hasClass("enclosing")?e:null},n1=function r(e,t){var a=Jn(e);if(a){var n=a.children;if(n.length){if(t==="right")return r(n[n.length-1],"right");if(t==="left")return r(n[0],"left")}}return e},Fr=function(e,t){return e?(t&&(e=n1(e,t)),a1[e.classes[0]]||null):null},nt=function(e,t){var a=["nulldelimiter"].concat(e.baseSizingClasses());return Z0(t.concat(a))},P=function(e,t,a){if(!e)return Z0();if(Kt[e.type]){var n=Kt[e.type](e,t);if(a&&t.size!==a.size){n=Z0(t.sizingClasses(a),[n],t);var i=t.sizeMultiplier/a.sizeMultiplier;n.height*=i,n.depth*=i}return n}else throw new T("Got group of unknown type: '"+e.type+"'")};function qt(r,e){var t=Z0(["base"],r,e),a=Z0(["strut"]);return a.style.height=z(t.height+t.depth),t.depth&&(a.style.verticalAlign=z(-t.depth)),t.children.unshift(a),t}function Vr(r,e){var t=null;r.length===1&&r[0].type==="tag"&&(t=r[0].tag,r=r[0].body);var a=l0(r,e,"root"),n;a.length===2&&a[1].hasClass("tag")&&(n=a.pop());for(var i=[],l=[],u=0;u<a.length;u++)if(l.push(a[u]),a[u].hasClass("mbin")||a[u].hasClass("mrel")||a[u].hasClass("allowbreak")){for(var h=!1;u<a.length-1&&a[u+1].hasClass("mspace")&&!a[u+1].hasClass("newline");)u++,l.push(a[u]),a[u].hasClass("nobreak")&&(h=!0);h||(i.push(qt(l,e)),l=[])}else a[u].hasClass("newline")&&(l.pop(),l.length>0&&(i.push(qt(l,e)),l=[]),i.push(a[u]));l.length>0&&i.push(qt(l,e));var m;t?(m=qt(l0(t,e,!0)),m.classes=["tag"],i.push(m)):n&&i.push(n);var v=Z0(["katex-html"],i);if(v.setAttribute("aria-hidden","true"),m){var g=m.children[0];g.style.height=z(v.height+v.depth),v.depth&&(g.style.verticalAlign=z(-v.depth))}return v}function Qn(r){return new xe(r)}var x0=class{constructor(e,t,a){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=a||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=le(this.classes));for(var a=0;a<this.children.length;a++)e.appendChild(this.children[a].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=$.escape(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+$.escape(le(this.classes))+'"'),e+=">";for(var a=0;a<this.children.length;a++)e+=this.children[a].toMarkup();return e+="</"+this.type+">",e}toText(){return this.children.map(e=>e.toText()).join("")}},be=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return $.escape(this.toText())}toText(){return this.text}},Ur=class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character="\u200A":e>=.1666&&e<=.1667?this.character="\u2009":e>=.2222&&e<=.2223?this.character="\u2005":e>=.2777&&e<=.2778?this.character="\u2005\u200A":e>=-.05556&&e<=-.05555?this.character="\u200A\u2063":e>=-.1667&&e<=-.1666?this.character="\u2009\u2063":e>=-.2223&&e<=-.2222?this.character="\u205F\u2063":e>=-.2778&&e<=-.2777?this.character="\u2005\u2063":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",z(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+z(this.width)+'"/>'}toText(){return this.character?this.character:" "}},M={MathNode:x0,TextNode:be,SpaceNode:Ur,newDocumentFragment:Qn},E0=function(e,t,a){return K[t][e]&&K[t][e].replace&&e.charCodeAt(0)!==55349&&!(Gn.hasOwnProperty(e)&&a&&(a.fontFamily&&a.fontFamily.slice(4,6)==="tt"||a.font&&a.font.slice(4,6)==="tt"))&&(e=K[t][e].replace),new M.TextNode(e)},ea=function(e){return e.length===1?e[0]:new M.MathNode("mrow",e)},ta=function(e,t){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold";var a=t.font;if(!a||a==="mathnormal")return null;var n=e.mode;if(a==="mathit")return"italic";if(a==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(a==="mathbf")return"bold";if(a==="mathbb")return"double-struck";if(a==="mathfrak")return"fraktur";if(a==="mathscr"||a==="mathcal")return"script";if(a==="mathsf")return"sans-serif";if(a==="mathtt")return"monospace";var i=e.text;if($.contains(["\\imath","\\jmath"],i))return null;K[n][i]&&K[n][i].replace&&(i=K[n][i].replace);var l=w.fontMap[a].fontName;return Jr(i,l,n)?w.fontMap[a].variant:null},k0=function(e,t,a){if(e.length===1){var n=U(e[0],t);return a&&n instanceof x0&&n.type==="mo"&&(n.setAttribute("lspace","0em"),n.setAttribute("rspace","0em")),[n]}for(var i=[],l,u=0;u<e.length;u++){var h=U(e[u],t);if(h instanceof x0&&l instanceof x0){if(h.type==="mtext"&&l.type==="mtext"&&h.getAttribute("mathvariant")===l.getAttribute("mathvariant")){l.children.push(...h.children);continue}else if(h.type==="mn"&&l.type==="mn"){l.children.push(...h.children);continue}else if(h.type==="mi"&&h.children.length===1&&l.type==="mn"){var m=h.children[0];if(m instanceof be&&m.text==="."){l.children.push(...h.children);continue}}else if(l.type==="mi"&&l.children.length===1){var v=l.children[0];if(v instanceof be&&v.text==="\u0338"&&(h.type==="mo"||h.type==="mi"||h.type==="mn")){var g=h.children[0];g instanceof be&&g.text.length>0&&(g.text=g.text.slice(0,1)+"\u0338"+g.text.slice(1),i.pop())}}}i.push(h),l=h}return i},oe=function(e,t,a){return ea(k0(e,t,a))},U=function(e,t){if(!e)return new M.MathNode("mrow");if(Wt[e.type]){var a=Wt[e.type](e,t);return a}else throw new T("Got group of unknown type: '"+e.type+"'")};function yn(r,e,t,a,n){var i=k0(r,t),l;i.length===1&&i[0]instanceof x0&&$.contains(["mrow","mtable"],i[0].type)?l=i[0]:l=new M.MathNode("mrow",i);var u=new M.MathNode("annotation",[new M.TextNode(e)]);u.setAttribute("encoding","application/x-tex");var h=new M.MathNode("semantics",[l,u]),m=new M.MathNode("math",[h]);m.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),a&&m.setAttribute("display","block");var v=n?"katex":"katex-mathml";return w.makeSpan([v],[m])}var ei=function(e){return new Ut({style:e.displayMode?O.DISPLAY:O.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},ti=function(e,t){if(t.displayMode){var a=["katex-display"];t.leqno&&a.push("leqno"),t.fleqn&&a.push("fleqn"),e=w.makeSpan(a,[e])}return e},i1=function(e,t,a){var n=ei(a),i;if(a.output==="mathml")return yn(e,t,n,a.displayMode,!0);if(a.output==="html"){var l=Vr(e,n);i=w.makeSpan(["katex"],[l])}else{var u=yn(e,t,n,a.displayMode,!1),h=Vr(e,n);i=w.makeSpan(["katex"],[u,h])}return ti(i,a)},s1=function(e,t,a){var n=ei(a),i=Vr(e,n),l=w.makeSpan(["katex"],[i]);return ti(l,a)},l1={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xrightleftarrows:"\u21C4",xrightequilibrium:"\u21CC",xleftequilibrium:"\u21CB","\\cdrightarrow":"\u2192","\\cdleftarrow":"\u2190","\\cdlongequal":"="},o1=function(e){var t=new M.MathNode("mo",[new M.TextNode(l1[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},u1={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},h1=function(e){return e.type==="ordgroup"?e.body.length:1},c1=function(e,t){function a(){var u=4e5,h=e.label.slice(1);if($.contains(["widehat","widecheck","widetilde","utilde"],h)){var m=e,v=h1(m.base),g,b,x;if(v>5)h==="widehat"||h==="widecheck"?(g=420,u=2364,x=.42,b=h+"4"):(g=312,u=2340,x=.34,b="tilde4");else{var k=[1,1,2,2,3,3][v];h==="widehat"||h==="widecheck"?(u=[0,1062,2364,2364,2364][k],g=[0,239,300,360,420][k],x=[0,.24,.3,.3,.36,.42][k],b=h+k):(u=[0,600,1033,2339,2340][k],g=[0,260,286,306,312][k],x=[0,.26,.286,.3,.306,.34][k],b="tilde"+k)}var A=new H0(b),C=new N0([A],{width:"100%",height:z(x),viewBox:"0 0 "+u+" "+g,preserveAspectRatio:"none"});return{span:w.makeSvgSpan([],[C],t),minWidth:0,height:x}}else{var D=[],R=u1[h],[H,j,I]=R,F=I/1e3,L=H.length,Z,V;if(L===1){var L0=R[3];Z=["hide-tail"],V=[L0]}else if(L===2)Z=["halfarrow-left","halfarrow-right"],V=["xMinYMin","xMaxYMin"];else if(L===3)Z=["brace-left","brace-center","brace-right"],V=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support 683 - `+L+" children.");for(var m0=0;m0<L;m0++){var s0=new H0(H[m0]),he=new N0([s0],{width:"400em",height:z(F),viewBox:"0 0 "+u+" "+I,preserveAspectRatio:V[m0]+" slice"}),v0=w.makeSvgSpan([Z[m0]],[he],t);if(L===1)return{span:v0,minWidth:j,height:F};v0.style.height=z(F),D.push(v0)}return{span:w.makeSpan(["stretchy"],D,t),minWidth:j,height:F}}}var{span:n,minWidth:i,height:l}=a();return n.height=l,n.style.height=z(l),i>0&&(n.style.minWidth=z(i)),n},d1=function(e,t,a,n,i){var l,u=e.height+e.depth+a+n;if(/fbox|color|angl/.test(t)){if(l=w.makeSpan(["stretchy",t],[],i),t==="fbox"){var h=i.color&&i.getColor();h&&(l.style.borderColor=h)}}else{var m=[];/^[bx]cancel$/.test(t)&&m.push(new at({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&m.push(new at({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var v=new N0(m,{width:"100%",height:z(u)});l=w.makeSvgSpan([],[v],i)}return l.height=u,l.style.height=z(u),l},J0={encloseSpan:d1,mathMLnode:o1,svgSpan:c1};function q(r,e){if(!r||r.type!==e)throw new Error("Expected node of type "+e+", but got "+(r?"node of type "+r.type:String(r)));return r}function ra(r){var e=er(r);if(!e)throw new Error("Expected node of symbol group type, but got "+(r?"node of type "+r.type:String(r)));return e}function er(r){return r&&(r.type==="atom"||qs.hasOwnProperty(r.type))?r:null}var aa=(r,e)=>{var t,a,n;r&&r.type==="supsub"?(a=q(r.base,"accent"),t=a.base,r.base=t,n=_s(P(r,e)),r.base=a):(a=q(r,"accent"),t=a.base);var i=P(t,e.havingCrampedStyle()),l=a.isShifty&&$.isCharacterBox(t),u=0;if(l){var h=$.getBaseElem(t),m=P(h,e.havingCrampedStyle());u=mn(m).skew}var v=a.label==="\\c",g=v?i.height+i.depth:Math.min(i.height,e.fontMetrics().xHeight),b;if(a.isStretchy)b=J0.svgSpan(a,e),b=w.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:b,wrapperClasses:["svg-align"],wrapperStyle:u>0?{width:"calc(100% - "+z(2*u)+")",marginLeft:z(2*u)}:void 0}]},e);else{var x,k;a.label==="\\vec"?(x=w.staticSvg("vec",e),k=w.svgData.vec[1]):(x=w.makeOrd({mode:a.mode,text:a.label},e,"textord"),x=mn(x),x.italic=0,k=x.width,v&&(g+=x.depth)),b=w.makeSpan(["accent-body"],[x]);var A=a.label==="\\textcircled";A&&(b.classes.push("accent-full"),g=i.height);var C=u;A||(C-=k/2),b.style.left=z(C),a.label==="\\textcircled"&&(b.style.top=".2em"),b=w.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-g},{type:"elem",elem:b}]},e)}var D=w.makeSpan(["mord","accent"],[b],e);return n?(n.children[0]=D,n.height=Math.max(D.height,n.height),n.classes[0]="mord",n):D},ri=(r,e)=>{var t=r.isStretchy?J0.mathMLnode(r.label):new M.MathNode("mo",[E0(r.label,r.mode)]),a=new M.MathNode("mover",[U(r.base,e),t]);return a.setAttribute("accent","true"),a},m1=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(r=>"\\"+r).join("|"));E({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(r,e)=>{var t=Yt(e[0]),a=!m1.test(r.funcName),n=!a||r.funcName==="\\widehat"||r.funcName==="\\widetilde"||r.funcName==="\\widecheck";return{type:"accent",mode:r.parser.mode,label:r.funcName,isStretchy:a,isShifty:n,base:t}},htmlBuilder:aa,mathmlBuilder:ri});E({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(r,e)=>{var t=e[0],a=r.parser.mode;return a==="math"&&(r.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+r.funcName+" works only in text mode"),a="text"),{type:"accent",mode:a,label:r.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:aa,mathmlBuilder:ri});E({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0];return{type:"accentUnder",mode:t.mode,label:a,base:n}},htmlBuilder:(r,e)=>{var t=P(r.base,e),a=J0.svgSpan(r,e),n=r.label==="\\utilde"?.12:0,i=w.makeVList({positionType:"top",positionData:t.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:n},{type:"elem",elem:t}]},e);return w.makeSpan(["mord","accentunder"],[i],e)},mathmlBuilder:(r,e)=>{var t=J0.mathMLnode(r.label),a=new M.MathNode("munder",[U(r.base,e),t]);return a.setAttribute("accentunder","true"),a}});var It=r=>{var e=new M.MathNode("mpadded",r?[r]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};E({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:a,funcName:n}=r;return{type:"xArrow",mode:a.mode,label:n,body:e[0],below:t[0]}},htmlBuilder(r,e){var t=e.style,a=e.havingStyle(t.sup()),n=w.wrapFragment(P(r.body,a,e),e),i=r.label.slice(0,2)==="\\x"?"x":"cd";n.classes.push(i+"-arrow-pad");var l;r.below&&(a=e.havingStyle(t.sub()),l=w.wrapFragment(P(r.below,a,e),e),l.classes.push(i+"-arrow-pad"));var u=J0.svgSpan(r,e),h=-e.fontMetrics().axisHeight+.5*u.height,m=-e.fontMetrics().axisHeight-.5*u.height-.111;(n.depth>.25||r.label==="\\xleftequilibrium")&&(m-=n.depth);var v;if(l){var g=-e.fontMetrics().axisHeight+l.height+.5*u.height+.111;v=w.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:m},{type:"elem",elem:u,shift:h},{type:"elem",elem:l,shift:g}]},e)}else v=w.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:m},{type:"elem",elem:u,shift:h}]},e);return v.children[0].children[0].children[1].classes.push("svg-align"),w.makeSpan(["mrel","x-arrow"],[v],e)},mathmlBuilder(r,e){var t=J0.mathMLnode(r.label);t.setAttribute("minsize",r.label.charAt(0)==="x"?"1.75em":"3.0em");var a;if(r.body){var n=It(U(r.body,e));if(r.below){var i=It(U(r.below,e));a=new M.MathNode("munderover",[t,i,n])}else a=new M.MathNode("mover",[t,n])}else if(r.below){var l=It(U(r.below,e));a=new M.MathNode("munder",[t,l])}else a=It(),a=new M.MathNode("mover",[t,a]);return a}});var f1=w.makeSpan;function ai(r,e){var t=l0(r.body,e,!0);return f1([r.mclass],t,e)}function ni(r,e){var t,a=k0(r.body,e);return r.mclass==="minner"?t=new M.MathNode("mpadded",a):r.mclass==="mord"?r.isCharacterBox?(t=a[0],t.type="mi"):t=new M.MathNode("mi",a):(r.isCharacterBox?(t=a[0],t.type="mo"):t=new M.MathNode("mo",a),r.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):r.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):r.mclass==="mopen"||r.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):r.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}E({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(r,e){var{parser:t,funcName:a}=r,n=e[0];return{type:"mclass",mode:t.mode,mclass:"m"+a.slice(5),body:n0(n),isCharacterBox:$.isCharacterBox(n)}},htmlBuilder:ai,mathmlBuilder:ni});var tr=r=>{var e=r.type==="ordgroup"&&r.body.length?r.body[0]:r;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};E({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(r,e){var{parser:t}=r;return{type:"mclass",mode:t.mode,mclass:tr(e[0]),body:n0(e[1]),isCharacterBox:$.isCharacterBox(e[1])}}});E({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(r,e){var{parser:t,funcName:a}=r,n=e[1],i=e[0],l;a!=="\\stackrel"?l=tr(n):l="mrel";var u={type:"op",mode:n.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:a!=="\\stackrel",body:n0(n)},h={type:"supsub",mode:i.mode,base:u,sup:a==="\\underset"?null:i,sub:a==="\\underset"?i:null};return{type:"mclass",mode:t.mode,mclass:l,body:[h],isCharacterBox:$.isCharacterBox(h)}},htmlBuilder:ai,mathmlBuilder:ni});E({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"pmb",mode:t.mode,mclass:tr(e[0]),body:n0(e[0])}},htmlBuilder(r,e){var t=l0(r.body,e,!0),a=w.makeSpan([r.mclass],t,e);return a.style.textShadow="0.02em 0.01em 0.04px",a},mathmlBuilder(r,e){var t=k0(r.body,e),a=new M.MathNode("mstyle",t);return a.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),a}});var p1={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},bn=()=>({type:"styling",body:[],mode:"math",style:"display"}),xn=r=>r.type==="textord"&&r.text==="@",v1=(r,e)=>(r.type==="mathord"||r.type==="atom")&&r.text===e;function g1(r,e,t){var a=p1[r];switch(a){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(a,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var n=t.callFunction("\\\\cdleft",[e[0]],[]),i={type:"atom",text:a,mode:"math",family:"rel"},l=t.callFunction("\\Big",[i],[]),u=t.callFunction("\\\\cdright",[e[1]],[]),h={type:"ordgroup",mode:"math",body:[n,l,u]};return t.callFunction("\\\\cdparent",[h],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var m={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[m],[])}default:return{type:"textord",text:" ",mode:"math"}}}function y1(r){var e=[];for(r.gullet.beginGroup(),r.gullet.macros.set("\\cr","\\\\\\relax"),r.gullet.beginGroup();;){e.push(r.parseExpression(!1,"\\\\")),r.gullet.endGroup(),r.gullet.beginGroup();var t=r.fetch().text;if(t==="&"||t==="\\\\")r.consume();else if(t==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new T("Expected \\\\ or \\cr or \\end",r.nextToken)}for(var a=[],n=[a],i=0;i<e.length;i++){for(var l=e[i],u=bn(),h=0;h<l.length;h++)if(!xn(l[h]))u.body.push(l[h]);else{a.push(u),h+=1;var m=ra(l[h]).text,v=new Array(2);if(v[0]={type:"ordgroup",mode:"math",body:[]},v[1]={type:"ordgroup",mode:"math",body:[]},!("=|.".indexOf(m)>-1))if("<>AV".indexOf(m)>-1)for(var g=0;g<2;g++){for(var b=!0,x=h+1;x<l.length;x++){if(v1(l[x],m)){b=!1,h=x;break}if(xn(l[x]))throw new T("Missing a "+m+" character to complete a CD arrow.",l[x]);v[g].body.push(l[x])}if(b)throw new T("Missing a "+m+" character to complete a CD arrow.",l[h])}else throw new T('Expected one of "<>AV=|." after @',l[h]);var k=g1(m,v,r),A={type:"styling",body:[k],mode:"math",style:"display"};a.push(A),u=bn()}i%2===0?a.push(u):a.shift(),a=[],n.push(a)}r.gullet.endGroup(),r.gullet.endGroup();var C=new Array(n[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:n,arraystretch:1,addJot:!0,rowGaps:[null],cols:C,colSeparationType:"CD",hLinesBeforeRow:new Array(n.length+1).fill([])}}E({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:a}=r;return{type:"cdlabel",mode:t.mode,side:a.slice(4),label:e[0]}},htmlBuilder(r,e){var t=e.havingStyle(e.style.sup()),a=w.wrapFragment(P(r.label,t,e),e);return a.classes.push("cd-label-"+r.side),a.style.bottom=z(.8-a.depth),a.height=0,a.depth=0,a},mathmlBuilder(r,e){var t=new M.MathNode("mrow",[U(r.label,e)]);return t=new M.MathNode("mpadded",[t]),t.setAttribute("width","0"),r.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new M.MathNode("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});E({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(r,e){var{parser:t}=r;return{type:"cdlabelparent",mode:t.mode,fragment:e[0]}},htmlBuilder(r,e){var t=w.wrapFragment(P(r.fragment,e),e);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(r,e){return new M.MathNode("mrow",[U(r.fragment,e)])}});E({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(r,e){for(var{parser:t}=r,a=q(e[0],"ordgroup"),n=a.body,i="",l=0;l<n.length;l++){var u=q(n[l],"textord");i+=u.text}var h=parseInt(i),m;if(isNaN(h))throw new T("\\@char has non-numeric argument "+i);if(h<0||h>=1114111)throw new T("\\@char with invalid code point "+i);return h<=65535?m=String.fromCharCode(h):(h-=65536,m=String.fromCharCode((h>>10)+55296,(h&1023)+56320)),{type:"textord",mode:t.mode,text:m}}});var ii=(r,e)=>{var t=l0(r.body,e.withColor(r.color),!1);return w.makeFragment(t)},si=(r,e)=>{var t=k0(r.body,e.withColor(r.color)),a=new M.MathNode("mstyle",t);return a.setAttribute("mathcolor",r.color),a};E({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(r,e){var{parser:t}=r,a=q(e[0],"color-token").color,n=e[1];return{type:"color",mode:t.mode,color:a,body:n0(n)}},htmlBuilder:ii,mathmlBuilder:si});E({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(r,e){var{parser:t,breakOnTokenText:a}=r,n=q(e[0],"color-token").color;t.gullet.macros.set("\\current@color",n);var i=t.parseExpression(!0,a);return{type:"color",mode:t.mode,color:n,body:i}},htmlBuilder:ii,mathmlBuilder:si});E({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(r,e,t){var{parser:a}=r,n=a.gullet.future().text==="["?a.parseSizeGroup(!0):null,i=!a.settings.displayMode||!a.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:a.mode,newLine:i,size:n&&q(n,"size").value}},htmlBuilder(r,e){var t=w.makeSpan(["mspace"],[],e);return r.newLine&&(t.classes.push("newline"),r.size&&(t.style.marginTop=z(t0(r.size,e)))),t},mathmlBuilder(r,e){var t=new M.MathNode("mspace");return r.newLine&&(t.setAttribute("linebreak","newline"),r.size&&t.setAttribute("height",z(t0(r.size,e)))),t}});var Gr={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},li=r=>{var e=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new T("Expected a control sequence",r);return e},b1=r=>{var e=r.gullet.popToken();return e.text==="="&&(e=r.gullet.popToken(),e.text===" "&&(e=r.gullet.popToken())),e},oi=(r,e,t,a)=>{var n=r.gullet.macros.get(t.text);n==null&&(t.noexpand=!0,n={tokens:[t],numArgs:0,unexpandable:!r.gullet.isExpandable(t.text)}),r.gullet.macros.set(e,n,a)};E({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(r){var{parser:e,funcName:t}=r;e.consumeSpaces();var a=e.fetch();if(Gr[a.text])return(t==="\\global"||t==="\\\\globallong")&&(a.text=Gr[a.text]),q(e.parseFunction(),"internal");throw new T("Invalid token after macro prefix",a)}});E({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,a=e.gullet.popToken(),n=a.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(n))throw new T("Expected a control sequence",a);for(var i=0,l,u=[[]];e.gullet.future().text!=="{";)if(a=e.gullet.popToken(),a.text==="#"){if(e.gullet.future().text==="{"){l=e.gullet.future(),u[i].push("{");break}if(a=e.gullet.popToken(),!/^[1-9]$/.test(a.text))throw new T('Invalid argument number "'+a.text+'"');if(parseInt(a.text)!==i+1)throw new T('Argument number "'+a.text+'" out of order');i++,u.push([])}else{if(a.text==="EOF")throw new T("Expected a macro definition");u[i].push(a.text)}var{tokens:h}=e.gullet.consumeArg();return l&&h.unshift(l),(t==="\\edef"||t==="\\xdef")&&(h=e.gullet.expandTokens(h),h.reverse()),e.gullet.macros.set(n,{tokens:h,numArgs:i,delimiters:u},t===Gr[t]),{type:"internal",mode:e.mode}}});E({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,a=li(e.gullet.popToken());e.gullet.consumeSpaces();var n=b1(e);return oi(e,a,n,t==="\\\\globallet"),{type:"internal",mode:e.mode}}});E({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,a=li(e.gullet.popToken()),n=e.gullet.popToken(),i=e.gullet.popToken();return oi(e,a,i,t==="\\\\globalfuture"),e.gullet.pushToken(i),e.gullet.pushToken(n),{type:"internal",mode:e.mode}}});var Je=function(e,t,a){var n=K.math[e]&&K.math[e].replace,i=Jr(n||e,t,a);if(!i)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return i},na=function(e,t,a,n){var i=a.havingBaseStyle(t),l=w.makeSpan(n.concat(i.sizingClasses(a)),[e],a),u=i.sizeMultiplier/a.sizeMultiplier;return l.height*=u,l.depth*=u,l.maxFontSize=i.sizeMultiplier,l},ui=function(e,t,a){var n=t.havingBaseStyle(a),i=(1-t.sizeMultiplier/n.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=z(i),e.height-=i,e.depth+=i},x1=function(e,t,a,n,i,l){var u=w.makeSymbol(e,"Main-Regular",i,n),h=na(u,t,n,l);return a&&ui(h,n,t),h},w1=function(e,t,a,n){return w.makeSymbol(e,"Size"+t+"-Regular",a,n)},hi=function(e,t,a,n,i,l){var u=w1(e,t,i,n),h=na(w.makeSpan(["delimsizing","size"+t],[u],n),O.TEXT,n,l);return a&&ui(h,n,O.TEXT),h},Br=function(e,t,a){var n;t==="Size1-Regular"?n="delim-size1":n="delim-size4";var i=w.makeSpan(["delimsizinginner",n],[w.makeSpan([],[w.makeSymbol(e,t,a)])]);return{type:"elem",elem:i}},Dr=function(e,t,a){var n=_0["Size4-Regular"][e.charCodeAt(0)]?_0["Size4-Regular"][e.charCodeAt(0)][4]:_0["Size1-Regular"][e.charCodeAt(0)][4],i=new H0("inner",Es(e,Math.round(1e3*t))),l=new N0([i],{width:z(n),height:z(t),style:"width:"+z(n),viewBox:"0 0 "+1e3*n+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),u=w.makeSvgSpan([],[l],a);return u.height=t,u.style.height=z(t),u.style.width=z(n),{type:"elem",elem:u}},Kr=.008,Pt={type:"kern",size:-1*Kr},k1=["|","\\lvert","\\rvert","\\vert"],S1=["\\|","\\lVert","\\rVert","\\Vert"],ci=function(e,t,a,n,i,l){var u,h,m,v,g="",b=0;u=m=v=e,h=null;var x="Size1-Regular";e==="\\uparrow"?m=v="\u23D0":e==="\\Uparrow"?m=v="\u2016":e==="\\downarrow"?u=m="\u23D0":e==="\\Downarrow"?u=m="\u2016":e==="\\updownarrow"?(u="\\uparrow",m="\u23D0",v="\\downarrow"):e==="\\Updownarrow"?(u="\\Uparrow",m="\u2016",v="\\Downarrow"):$.contains(k1,e)?(m="\u2223",g="vert",b=333):$.contains(S1,e)?(m="\u2225",g="doublevert",b=556):e==="["||e==="\\lbrack"?(u="\u23A1",m="\u23A2",v="\u23A3",x="Size4-Regular",g="lbrack",b=667):e==="]"||e==="\\rbrack"?(u="\u23A4",m="\u23A5",v="\u23A6",x="Size4-Regular",g="rbrack",b=667):e==="\\lfloor"||e==="\u230A"?(m=u="\u23A2",v="\u23A3",x="Size4-Regular",g="lfloor",b=667):e==="\\lceil"||e==="\u2308"?(u="\u23A1",m=v="\u23A2",x="Size4-Regular",g="lceil",b=667):e==="\\rfloor"||e==="\u230B"?(m=u="\u23A5",v="\u23A6",x="Size4-Regular",g="rfloor",b=667):e==="\\rceil"||e==="\u2309"?(u="\u23A4",m=v="\u23A5",x="Size4-Regular",g="rceil",b=667):e==="("||e==="\\lparen"?(u="\u239B",m="\u239C",v="\u239D",x="Size4-Regular",g="lparen",b=875):e===")"||e==="\\rparen"?(u="\u239E",m="\u239F",v="\u23A0",x="Size4-Regular",g="rparen",b=875):e==="\\{"||e==="\\lbrace"?(u="\u23A7",h="\u23A8",v="\u23A9",m="\u23AA",x="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(u="\u23AB",h="\u23AC",v="\u23AD",m="\u23AA",x="Size4-Regular"):e==="\\lgroup"||e==="\u27EE"?(u="\u23A7",v="\u23A9",m="\u23AA",x="Size4-Regular"):e==="\\rgroup"||e==="\u27EF"?(u="\u23AB",v="\u23AD",m="\u23AA",x="Size4-Regular"):e==="\\lmoustache"||e==="\u23B0"?(u="\u23A7",v="\u23AD",m="\u23AA",x="Size4-Regular"):(e==="\\rmoustache"||e==="\u23B1")&&(u="\u23AB",v="\u23A9",m="\u23AA",x="Size4-Regular");var k=Je(u,x,i),A=k.height+k.depth,C=Je(m,x,i),D=C.height+C.depth,R=Je(v,x,i),H=R.height+R.depth,j=0,I=1;if(h!==null){var F=Je(h,x,i);j=F.height+F.depth,I=2}var L=A+H+j,Z=Math.max(0,Math.ceil((t-L)/(I*D))),V=L+Z*I*D,L0=n.fontMetrics().axisHeight;a&&(L0*=n.sizeMultiplier);var m0=V/2-L0,s0=[];if(g.length>0){var he=V-A-H,v0=Math.round(V*1e3),B0=Bs(g,Math.round(he*1e3)),ee=new H0(g,B0),Se=(b/1e3).toFixed(3)+"em",Ae=(v0/1e3).toFixed(3)+"em",nr=new N0([ee],{width:Se,height:Ae,viewBox:"0 0 "+b+" "+v0}),te=w.makeSvgSpan([],[nr],n);te.height=v0/1e3,te.style.width=Se,te.style.height=Ae,s0.push({type:"elem",elem:te})}else{if(s0.push(Br(v,x,i)),s0.push(Pt),h===null){var re=V-A-H+2*Kr;s0.push(Dr(m,re,n))}else{var T0=(V-A-H-j)/2+2*Kr;s0.push(Dr(m,T0,n)),s0.push(Pt),s0.push(Br(h,x,i)),s0.push(Pt),s0.push(Dr(m,T0,n))}s0.push(Pt),s0.push(Br(u,x,i))}var He=n.havingBaseStyle(O.TEXT),ir=w.makeVList({positionType:"bottom",positionData:m0,children:s0},He);return na(w.makeSpan(["delimsizing","mult"],[ir],He),O.TEXT,n,l)},$r=80,Nr=.08,Or=function(e,t,a,n,i){var l=Cs(e,n,a),u=new H0(e,l),h=new N0([u],{width:"400em",height:z(t),viewBox:"0 0 400000 "+a,preserveAspectRatio:"xMinYMin slice"});return w.makeSvgSpan(["hide-tail"],[h],i)},A1=function(e,t){var a=t.havingBaseSizing(),n=pi("\\surd",e*a.sizeMultiplier,fi,a),i=a.sizeMultiplier,l=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),u,h=0,m=0,v=0,g;return n.type==="small"?(v=1e3+1e3*l+$r,e<1?i=1:e<1.4&&(i=.7),h=(1+l+Nr)/i,m=(1+l)/i,u=Or("sqrtMain",h,v,l,t),u.style.minWidth="0.853em",g=.833/i):n.type==="large"?(v=(1e3+$r)*Qe[n.size],m=(Qe[n.size]+l)/i,h=(Qe[n.size]+l+Nr)/i,u=Or("sqrtSize"+n.size,h,v,l,t),u.style.minWidth="1.02em",g=1/i):(h=e+l+Nr,m=e+l,v=Math.floor(1e3*e+l)+$r,u=Or("sqrtTall",h,v,l,t),u.style.minWidth="0.742em",g=1.056),u.height=m,u.style.height=z(h),{span:u,advanceWidth:g,ruleWidth:(t.fontMetrics().sqrtRuleThickness+l)*i}},di=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","\\surd"],M1=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1"],mi=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Qe=[0,1.2,1.8,2.4,3],T1=function(e,t,a,n,i){if(e==="<"||e==="\\lt"||e==="\u27E8"?e="\\langle":(e===">"||e==="\\gt"||e==="\u27E9")&&(e="\\rangle"),$.contains(di,e)||$.contains(mi,e))return hi(e,t,!1,a,n,i);if($.contains(M1,e))return ci(e,Qe[t],!1,a,n,i);throw new T("Illegal delimiter: '"+e+"'")},z1=[{type:"small",style:O.SCRIPTSCRIPT},{type:"small",style:O.SCRIPT},{type:"small",style:O.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],C1=[{type:"small",style:O.SCRIPTSCRIPT},{type:"small",style:O.SCRIPT},{type:"small",style:O.TEXT},{type:"stack"}],fi=[{type:"small",style:O.SCRIPTSCRIPT},{type:"small",style:O.SCRIPT},{type:"small",style:O.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],E1=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},pi=function(e,t,a,n){for(var i=Math.min(2,3-n.style.size),l=i;l<a.length&&a[l].type!=="stack";l++){var u=Je(e,E1(a[l]),"math"),h=u.height+u.depth;if(a[l].type==="small"){var m=n.havingBaseStyle(a[l].style);h*=m.sizeMultiplier}if(h>t)return a[l]}return a[a.length-1]},vi=function(e,t,a,n,i,l){e==="<"||e==="\\lt"||e==="\u27E8"?e="\\langle":(e===">"||e==="\\gt"||e==="\u27E9")&&(e="\\rangle");var u;$.contains(mi,e)?u=z1:$.contains(di,e)?u=fi:u=C1;var h=pi(e,t,u,n);return h.type==="small"?x1(e,h.style,a,n,i,l):h.type==="large"?hi(e,h.size,a,n,i,l):ci(e,t,a,n,i,l)},B1=function(e,t,a,n,i,l){var u=n.fontMetrics().axisHeight*n.sizeMultiplier,h=901,m=5/n.fontMetrics().ptPerEm,v=Math.max(t-u,a+u),g=Math.max(v/500*h,2*v-m);return vi(e,g,!0,n,i,l)},X0={sqrtImage:A1,sizedDelim:T1,sizeToMaxHeight:Qe,customSizedDelim:vi,leftRightDelim:B1},wn={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},D1=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230A","\u230B","\\lceil","\\rceil","\u2308","\u2309","<",">","\\langle","\u27E8","\\rangle","\u27E9","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27EE","\u27EF","\\lmoustache","\\rmoustache","\u23B0","\u23B1","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function rr(r,e){var t=er(r);if(t&&$.contains(D1,t.text))return t;throw t?new T("Invalid delimiter '"+t.text+"' after '"+e.funcName+"'",r):new T("Invalid delimiter type '"+r.type+"'",r)}E({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(r,e)=>{var t=rr(e[0],r);return{type:"delimsizing",mode:r.parser.mode,size:wn[r.funcName].size,mclass:wn[r.funcName].mclass,delim:t.text}},htmlBuilder:(r,e)=>r.delim==="."?w.makeSpan([r.mclass]):X0.sizedDelim(r.delim,r.size,e,r.mode,[r.mclass]),mathmlBuilder:r=>{var e=[];r.delim!=="."&&e.push(E0(r.delim,r.mode));var t=new M.MathNode("mo",e);r.mclass==="mopen"||r.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var a=z(X0.sizeToMaxHeight[r.size]);return t.setAttribute("minsize",a),t.setAttribute("maxsize",a),t}});function kn(r){if(!r.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}E({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=r.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new T("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:r.parser.mode,delim:rr(e[0],r).text,color:t}}});E({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=rr(e[0],r),a=r.parser;++a.leftrightDepth;var n=a.parseExpression(!1);--a.leftrightDepth,a.expect("\\right",!1);var i=q(a.parseFunction(),"leftright-right");return{type:"leftright",mode:a.mode,body:n,left:t.text,right:i.delim,rightColor:i.color}},htmlBuilder:(r,e)=>{kn(r);for(var t=l0(r.body,e,!0,["mopen","mclose"]),a=0,n=0,i=!1,l=0;l<t.length;l++)t[l].isMiddle?i=!0:(a=Math.max(t[l].height,a),n=Math.max(t[l].depth,n));a*=e.sizeMultiplier,n*=e.sizeMultiplier;var u;if(r.left==="."?u=nt(e,["mopen"]):u=X0.leftRightDelim(r.left,a,n,e,r.mode,["mopen"]),t.unshift(u),i)for(var h=1;h<t.length;h++){var m=t[h],v=m.isMiddle;v&&(t[h]=X0.leftRightDelim(v.delim,a,n,v.options,r.mode,[]))}var g;if(r.right===".")g=nt(e,["mclose"]);else{var b=r.rightColor?e.withColor(r.rightColor):e;g=X0.leftRightDelim(r.right,a,n,b,r.mode,["mclose"])}return t.push(g),w.makeSpan(["minner"],t,e)},mathmlBuilder:(r,e)=>{kn(r);var t=k0(r.body,e);if(r.left!=="."){var a=new M.MathNode("mo",[E0(r.left,r.mode)]);a.setAttribute("fence","true"),t.unshift(a)}if(r.right!=="."){var n=new M.MathNode("mo",[E0(r.right,r.mode)]);n.setAttribute("fence","true"),r.rightColor&&n.setAttribute("mathcolor",r.rightColor),t.push(n)}return ea(t)}});E({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=rr(e[0],r);if(!r.parser.leftrightDepth)throw new T("\\middle without preceding \\left",t);return{type:"middle",mode:r.parser.mode,delim:t.text}},htmlBuilder:(r,e)=>{var t;if(r.delim===".")t=nt(e,[]);else{t=X0.sizedDelim(r.delim,1,e,r.mode,[]);var a={delim:r.delim,options:e};t.isMiddle=a}return t},mathmlBuilder:(r,e)=>{var t=r.delim==="\\vert"||r.delim==="|"?E0("|","text"):E0(r.delim,r.mode),a=new M.MathNode("mo",[t]);return a.setAttribute("fence","true"),a.setAttribute("lspace","0.05em"),a.setAttribute("rspace","0.05em"),a}});var ia=(r,e)=>{var t=w.wrapFragment(P(r.body,e),e),a=r.label.slice(1),n=e.sizeMultiplier,i,l=0,u=$.isCharacterBox(r.body);if(a==="sout")i=w.makeSpan(["stretchy","sout"]),i.height=e.fontMetrics().defaultRuleThickness/n,l=-.5*e.fontMetrics().xHeight;else if(a==="phase"){var h=t0({number:.6,unit:"pt"},e),m=t0({number:.35,unit:"ex"},e),v=e.havingBaseSizing();n=n/v.sizeMultiplier;var g=t.height+t.depth+h+m;t.style.paddingLeft=z(g/2+h);var b=Math.floor(1e3*g*n),x=Ts(b),k=new N0([new H0("phase",x)],{width:"400em",height:z(b/1e3),viewBox:"0 0 400000 "+b,preserveAspectRatio:"xMinYMin slice"});i=w.makeSvgSpan(["hide-tail"],[k],e),i.style.height=z(g),l=t.depth+h+m}else{/cancel/.test(a)?u||t.classes.push("cancel-pad"):a==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var A=0,C=0,D=0;/box/.test(a)?(D=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),A=e.fontMetrics().fboxsep+(a==="colorbox"?0:D),C=A):a==="angl"?(D=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),A=4*D,C=Math.max(0,.25-t.depth)):(A=u?.2:0,C=A),i=J0.encloseSpan(t,a,A,C,e),/fbox|boxed|fcolorbox/.test(a)?(i.style.borderStyle="solid",i.style.borderWidth=z(D)):a==="angl"&&D!==.049&&(i.style.borderTopWidth=z(D),i.style.borderRightWidth=z(D)),l=t.depth+C,r.backgroundColor&&(i.style.backgroundColor=r.backgroundColor,r.borderColor&&(i.style.borderColor=r.borderColor))}var R;if(r.backgroundColor)R=w.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:l},{type:"elem",elem:t,shift:0}]},e);else{var H=/cancel|phase/.test(a)?["svg-align"]:[];R=w.makeVList({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:i,shift:l,wrapperClasses:H}]},e)}return/cancel/.test(a)&&(R.height=t.height,R.depth=t.depth),/cancel/.test(a)&&!u?w.makeSpan(["mord","cancel-lap"],[R],e):w.makeSpan(["mord"],[R],e)},sa=(r,e)=>{var t=0,a=new M.MathNode(r.label.indexOf("colorbox")>-1?"mpadded":"menclose",[U(r.body,e)]);switch(r.label){case"\\cancel":a.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":a.setAttribute("notation","downdiagonalstrike");break;case"\\phase":a.setAttribute("notation","phasorangle");break;case"\\sout":a.setAttribute("notation","horizontalstrike");break;case"\\fbox":a.setAttribute("notation","box");break;case"\\angl":a.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,a.setAttribute("width","+"+2*t+"pt"),a.setAttribute("height","+"+2*t+"pt"),a.setAttribute("lspace",t+"pt"),a.setAttribute("voffset",t+"pt"),r.label==="\\fcolorbox"){var n=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);a.setAttribute("style","border: "+n+"em solid "+String(r.borderColor))}break;case"\\xcancel":a.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return r.backgroundColor&&a.setAttribute("mathbackground",r.backgroundColor),a};E({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(r,e,t){var{parser:a,funcName:n}=r,i=q(e[0],"color-token").color,l=e[1];return{type:"enclose",mode:a.mode,label:n,backgroundColor:i,body:l}},htmlBuilder:ia,mathmlBuilder:sa});E({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(r,e,t){var{parser:a,funcName:n}=r,i=q(e[0],"color-token").color,l=q(e[1],"color-token").color,u=e[2];return{type:"enclose",mode:a.mode,label:n,backgroundColor:l,borderColor:i,body:u}},htmlBuilder:ia,mathmlBuilder:sa});E({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\fbox",body:e[0]}}});E({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:a}=r,n=e[0];return{type:"enclose",mode:t.mode,label:a,body:n}},htmlBuilder:ia,mathmlBuilder:sa});E({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\angl",body:e[0]}}});var gi={};function q0(r){for(var{type:e,names:t,props:a,handler:n,htmlBuilder:i,mathmlBuilder:l}=r,u={type:e,numArgs:a.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:n},h=0;h<t.length;++h)gi[t[h]]=u;i&&(Kt[e]=i),l&&(Wt[e]=l)}var yi={};function d(r,e){yi[r]=e}function Sn(r){var e=[];r.consumeSpaces();var t=r.fetch().text;for(t==="\\relax"&&(r.consume(),r.consumeSpaces(),t=r.fetch().text);t==="\\hline"||t==="\\hdashline";)r.consume(),e.push(t==="\\hdashline"),r.consumeSpaces(),t=r.fetch().text;return e}var ar=r=>{var e=r.parser.settings;if(!e.displayMode)throw new T("{"+r.envName+"} can be used only in display mode.")};function la(r){if(r.indexOf("ed")===-1)return r.indexOf("*")===-1}function ue(r,e,t){var{hskipBeforeAndAfter:a,addJot:n,cols:i,arraystretch:l,colSeparationType:u,autoTag:h,singleRow:m,emptySingleRow:v,maxNumCols:g,leqno:b}=e;if(r.gullet.beginGroup(),m||r.gullet.macros.set("\\cr","\\\\\\relax"),!l){var x=r.gullet.expandMacroAsText("\\arraystretch");if(x==null)l=1;else if(l=parseFloat(x),!l||l<0)throw new T("Invalid \\arraystretch: "+x)}r.gullet.beginGroup();var k=[],A=[k],C=[],D=[],R=h!=null?[]:void 0;function H(){h&&r.gullet.macros.set("\\@eqnsw","1",!0)}function j(){R&&(r.gullet.macros.get("\\df@tag")?(R.push(r.subparse([new C0("\\df@tag")])),r.gullet.macros.set("\\df@tag",void 0,!0)):R.push(!!h&&r.gullet.macros.get("\\@eqnsw")==="1"))}for(H(),D.push(Sn(r));;){var I=r.parseExpression(!1,m?"\\end":"\\\\");r.gullet.endGroup(),r.gullet.beginGroup(),I={type:"ordgroup",mode:r.mode,body:I},t&&(I={type:"styling",mode:r.mode,style:t,body:[I]}),k.push(I);var F=r.fetch().text;if(F==="&"){if(g&&k.length===g){if(m||u)throw new T("Too many tab characters: &",r.nextToken);r.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}r.consume()}else if(F==="\\end"){j(),k.length===1&&I.type==="styling"&&I.body[0].body.length===0&&(A.length>1||!v)&&A.pop(),D.length<A.length+1&&D.push([]);break}else if(F==="\\\\"){r.consume();var L=void 0;r.gullet.future().text!==" "&&(L=r.parseSizeGroup(!0)),C.push(L?L.value:null),j(),D.push(Sn(r)),k=[],A.push(k),H()}else throw new T("Expected & or \\\\ or \\cr or \\end",r.nextToken)}return r.gullet.endGroup(),r.gullet.endGroup(),{type:"array",mode:r.mode,addJot:n,arraystretch:l,body:A,cols:i,rowGaps:C,hskipBeforeAndAfter:a,hLinesBeforeRow:D,colSeparationType:u,tags:R,leqno:b}}function oa(r){return r.slice(0,1)==="d"?"display":"text"}var I0=function(e,t){var a,n,i=e.body.length,l=e.hLinesBeforeRow,u=0,h=new Array(i),m=[],v=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),g=1/t.fontMetrics().ptPerEm,b=5*g;if(e.colSeparationType&&e.colSeparationType==="small"){var x=t.havingStyle(O.SCRIPT).sizeMultiplier;b=.2778*(x/t.sizeMultiplier)}var k=e.colSeparationType==="CD"?t0({number:3,unit:"ex"},t):12*g,A=3*g,C=e.arraystretch*k,D=.7*C,R=.3*C,H=0;function j(ot){for(var ut=0;ut<ot.length;++ut)ut>0&&(H+=.25),m.push({pos:H,isDashed:ot[ut]})}for(j(l[0]),a=0;a<e.body.length;++a){var I=e.body[a],F=D,L=R;u<I.length&&(u=I.length);var Z=new Array(I.length);for(n=0;n<I.length;++n){var V=P(I[n],t);L<V.depth&&(L=V.depth),F<V.height&&(F=V.height),Z[n]=V}var L0=e.rowGaps[a],m0=0;L0&&(m0=t0(L0,t),m0>0&&(m0+=R,L<m0&&(L=m0),m0=0)),e.addJot&&(L+=A),Z.height=F,Z.depth=L,H+=F,Z.pos=H,H+=L+m0,h[a]=Z,j(l[a+1])}var s0=H/2+t.fontMetrics().axisHeight,he=e.cols||[],v0=[],B0,ee,Se=[];if(e.tags&&e.tags.some(ot=>ot))for(a=0;a<i;++a){var Ae=h[a],nr=Ae.pos-s0,te=e.tags[a],re=void 0;te===!0?re=w.makeSpan(["eqn-num"],[],t):te===!1?re=w.makeSpan([],[],t):re=w.makeSpan([],l0(te,t,!0),t),re.depth=Ae.depth,re.height=Ae.height,Se.push({type:"elem",elem:re,shift:nr})}for(n=0,ee=0;n<u||ee<he.length;++n,++ee){for(var T0=he[ee]||{},He=!0;T0.type==="separator";){if(He||(B0=w.makeSpan(["arraycolsep"],[]),B0.style.width=z(t.fontMetrics().doubleRuleSep),v0.push(B0)),T0.separator==="|"||T0.separator===":"){var ir=T0.separator==="|"?"solid":"dashed",Me=w.makeSpan(["vertical-separator"],[],t);Me.style.height=z(H),Me.style.borderRightWidth=z(v),Me.style.borderRightStyle=ir,Me.style.margin="0 "+z(-v/2);var va=H-s0;va&&(Me.style.verticalAlign=z(-va)),v0.push(Me)}else throw new T("Invalid separator type: "+T0.separator);ee++,T0=he[ee]||{},He=!1}if(!(n>=u)){var Te=void 0;(n>0||e.hskipBeforeAndAfter)&&(Te=$.deflt(T0.pregap,b),Te!==0&&(B0=w.makeSpan(["arraycolsep"],[]),B0.style.width=z(Te),v0.push(B0)));var ze=[];for(a=0;a<i;++a){var st=h[a],lt=st[n];if(lt){var _i=st.pos-s0;lt.depth=st.depth,lt.height=st.height,ze.push({type:"elem",elem:lt,shift:_i})}}ze=w.makeVList({positionType:"individualShift",children:ze},t),ze=w.makeSpan(["col-align-"+(T0.align||"c")],[ze]),v0.push(ze),(n<u-1||e.hskipBeforeAndAfter)&&(Te=$.deflt(T0.postgap,b),Te!==0&&(B0=w.makeSpan(["arraycolsep"],[]),B0.style.width=z(Te),v0.push(B0)))}}if(h=w.makeSpan(["mtable"],v0),m.length>0){for(var Hi=w.makeLineSpan("hline",t,v),qi=w.makeLineSpan("hdashline",t,v),sr=[{type:"elem",elem:h,shift:0}];m.length>0;){var ga=m.pop(),ya=ga.pos-s0;ga.isDashed?sr.push({type:"elem",elem:qi,shift:ya}):sr.push({type:"elem",elem:Hi,shift:ya})}h=w.makeVList({positionType:"individualShift",children:sr},t)}if(Se.length===0)return w.makeSpan(["mord"],[h],t);var lr=w.makeVList({positionType:"individualShift",children:Se},t);return lr=w.makeSpan(["tag"],[lr],t),w.makeFragment([h,lr])},$1={c:"center ",l:"left ",r:"right "},P0=function(e,t){for(var a=[],n=new M.MathNode("mtd",[],["mtr-glue"]),i=new M.MathNode("mtd",[],["mml-eqn-num"]),l=0;l<e.body.length;l++){for(var u=e.body[l],h=[],m=0;m<u.length;m++)h.push(new M.MathNode("mtd",[U(u[m],t)]));e.tags&&e.tags[l]&&(h.unshift(n),h.push(n),e.leqno?h.unshift(i):h.push(i)),a.push(new M.MathNode("mtr",h))}var v=new M.MathNode("mtable",a),g=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);v.setAttribute("rowspacing",z(g));var b="",x="";if(e.cols&&e.cols.length>0){var k=e.cols,A="",C=!1,D=0,R=k.length;k[0].type==="separator"&&(b+="top ",D=1),k[k.length-1].type==="separator"&&(b+="bottom ",R-=1);for(var H=D;H<R;H++)k[H].type==="align"?(x+=$1[k[H].align],C&&(A+="none "),C=!0):k[H].type==="separator"&&C&&(A+=k[H].separator==="|"?"solid ":"dashed ",C=!1);v.setAttribute("columnalign",x.trim()),/[sd]/.test(A)&&v.setAttribute("columnlines",A.trim())}if(e.colSeparationType==="align"){for(var j=e.cols||[],I="",F=1;F<j.length;F++)I+=F%2?"0em ":"1em ";v.setAttribute("columnspacing",I.trim())}else e.colSeparationType==="alignat"||e.colSeparationType==="gather"?v.setAttribute("columnspacing","0em"):e.colSeparationType==="small"?v.setAttribute("columnspacing","0.2778em"):e.colSeparationType==="CD"?v.setAttribute("columnspacing","0.5em"):v.setAttribute("columnspacing","1em");var L="",Z=e.hLinesBeforeRow;b+=Z[0].length>0?"left ":"",b+=Z[Z.length-1].length>0?"right ":"";for(var V=1;V<Z.length-1;V++)L+=Z[V].length===0?"none ":Z[V][0]?"dashed ":"solid ";return/[sd]/.test(L)&&v.setAttribute("rowlines",L.trim()),b!==""&&(v=new M.MathNode("menclose",[v]),v.setAttribute("notation",b.trim())),e.arraystretch&&e.arraystretch<1&&(v=new M.MathNode("mstyle",[v]),v.setAttribute("scriptlevel","1")),v},bi=function(e,t){e.envName.indexOf("ed")===-1&&ar(e);var a=[],n=e.envName.indexOf("at")>-1?"alignat":"align",i=e.envName==="split",l=ue(e.parser,{cols:a,addJot:!0,autoTag:i?void 0:la(e.envName),emptySingleRow:!0,colSeparationType:n,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},"display"),u,h=0,m={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&t[0].type==="ordgroup"){for(var v="",g=0;g<t[0].body.length;g++){var b=q(t[0].body[g],"textord");v+=b.text}u=Number(v),h=u*2}var x=!h;l.body.forEach(function(D){for(var R=1;R<D.length;R+=2){var H=q(D[R],"styling"),j=q(H.body[0],"ordgroup");j.body.unshift(m)}if(x)h<D.length&&(h=D.length);else{var I=D.length/2;if(u<I)throw new T("Too many math in a row: "+("expected "+u+", but got "+I),D[0])}});for(var k=0;k<h;++k){var A="r",C=0;k%2===1?A="l":k>0&&x&&(C=1),a[k]={type:"align",align:A,pregap:C,postgap:0}}return l.colSeparationType=x?"align":"alignat",l};q0({type:"array",names:["array","darray"],props:{numArgs:1},handler(r,e){var t=er(e[0]),a=t?[e[0]]:q(e[0],"ordgroup").body,n=a.map(function(l){var u=ra(l),h=u.text;if("lcr".indexOf(h)!==-1)return{type:"align",align:h};if(h==="|")return{type:"separator",separator:"|"};if(h===":")return{type:"separator",separator:":"};throw new T("Unknown column alignment: "+h,l)}),i={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return ue(r.parser,i,oa(r.envName))},htmlBuilder:I0,mathmlBuilder:P0});q0({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(r){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[r.envName.replace("*","")],t="c",a={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(r.envName.charAt(r.envName.length-1)==="*"){var n=r.parser;if(n.consumeSpaces(),n.fetch().text==="["){if(n.consume(),n.consumeSpaces(),t=n.fetch().text,"lcr".indexOf(t)===-1)throw new T("Expected l or c or r",n.nextToken);n.consume(),n.consumeSpaces(),n.expect("]"),n.consume(),a.cols=[{type:"align",align:t}]}}var i=ue(r.parser,a,oa(r.envName)),l=Math.max(0,...i.body.map(u=>u.length));return i.cols=new Array(l).fill({type:"align",align:t}),e?{type:"leftright",mode:r.mode,body:[i],left:e[0],right:e[1],rightColor:void 0}:i},htmlBuilder:I0,mathmlBuilder:P0});q0({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(r){var e={arraystretch:.5},t=ue(r.parser,e,"script");return t.colSeparationType="small",t},htmlBuilder:I0,mathmlBuilder:P0});q0({type:"array",names:["subarray"],props:{numArgs:1},handler(r,e){var t=er(e[0]),a=t?[e[0]]:q(e[0],"ordgroup").body,n=a.map(function(l){var u=ra(l),h=u.text;if("lc".indexOf(h)!==-1)return{type:"align",align:h};throw new T("Unknown column alignment: "+h,l)});if(n.length>1)throw new T("{subarray} can contain only one column");var i={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if(i=ue(r.parser,i,"script"),i.body.length>0&&i.body[0].length>1)throw new T("{subarray} can contain only one column");return i},htmlBuilder:I0,mathmlBuilder:P0});q0({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(r){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=ue(r.parser,e,oa(r.envName));return{type:"leftright",mode:r.mode,body:[t],left:r.envName.indexOf("r")>-1?".":"\\{",right:r.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:I0,mathmlBuilder:P0});q0({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:bi,htmlBuilder:I0,mathmlBuilder:P0});q0({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(r){$.contains(["gather","gather*"],r.envName)&&ar(r);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:la(r.envName),emptySingleRow:!0,leqno:r.parser.settings.leqno};return ue(r.parser,e,"display")},htmlBuilder:I0,mathmlBuilder:P0});q0({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:bi,htmlBuilder:I0,mathmlBuilder:P0});q0({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(r){ar(r);var e={autoTag:la(r.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:r.parser.settings.leqno};return ue(r.parser,e,"display")},htmlBuilder:I0,mathmlBuilder:P0});q0({type:"array",names:["CD"],props:{numArgs:0},handler(r){return ar(r),y1(r.parser)},htmlBuilder:I0,mathmlBuilder:P0});d("\\nonumber","\\gdef\\@eqnsw{0}");d("\\notag","\\nonumber");E({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(r,e){throw new T(r.funcName+" valid only within array environment")}});var An=gi;E({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(r,e){var{parser:t,funcName:a}=r,n=e[0];if(n.type!=="ordgroup")throw new T("Invalid environment name",n);for(var i="",l=0;l<n.body.length;++l)i+=q(n.body[l],"textord").text;if(a==="\\begin"){if(!An.hasOwnProperty(i))throw new T("No such environment: "+i,n);var u=An[i],{args:h,optArgs:m}=t.parseArguments("\\begin{"+i+"}",u),v={mode:t.mode,envName:i,parser:t},g=u.handler(v,h,m);t.expect("\\end",!1);var b=t.nextToken,x=q(t.parseFunction(),"environment");if(x.name!==i)throw new T("Mismatch: \\begin{"+i+"} matched by \\end{"+x.name+"}",b);return g}return{type:"environment",mode:t.mode,name:i,nameGroup:n}}});var xi=(r,e)=>{var t=r.font,a=e.withFont(t);return P(r.body,a)},wi=(r,e)=>{var t=r.font,a=e.withFont(t);return U(r.body,a)},Mn={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};E({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=Yt(e[0]),i=a;return i in Mn&&(i=Mn[i]),{type:"font",mode:t.mode,font:i.slice(1),body:n}},htmlBuilder:xi,mathmlBuilder:wi});E({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(r,e)=>{var{parser:t}=r,a=e[0],n=$.isCharacterBox(a);return{type:"mclass",mode:t.mode,mclass:tr(a),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:a}],isCharacterBox:n}}});E({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:a,breakOnTokenText:n}=r,{mode:i}=t,l=t.parseExpression(!0,n),u="math"+a.slice(1);return{type:"font",mode:i,font:u,body:{type:"ordgroup",mode:t.mode,body:l}}},htmlBuilder:xi,mathmlBuilder:wi});var ki=(r,e)=>{var t=e;return r==="display"?t=t.id>=O.SCRIPT.id?t.text():O.DISPLAY:r==="text"&&t.size===O.DISPLAY.size?t=O.TEXT:r==="script"?t=O.SCRIPT:r==="scriptscript"&&(t=O.SCRIPTSCRIPT),t},ua=(r,e)=>{var t=ki(r.size,e.style),a=t.fracNum(),n=t.fracDen(),i;i=e.havingStyle(a);var l=P(r.numer,i,e);if(r.continued){var u=8.5/e.fontMetrics().ptPerEm,h=3.5/e.fontMetrics().ptPerEm;l.height=l.height<u?u:l.height,l.depth=l.depth<h?h:l.depth}i=e.havingStyle(n);var m=P(r.denom,i,e),v,g,b;r.hasBarLine?(r.barSize?(g=t0(r.barSize,e),v=w.makeLineSpan("frac-line",e,g)):v=w.makeLineSpan("frac-line",e),g=v.height,b=v.height):(v=null,g=0,b=e.fontMetrics().defaultRuleThickness);var x,k,A;t.size===O.DISPLAY.size||r.size==="display"?(x=e.fontMetrics().num1,g>0?k=3*b:k=7*b,A=e.fontMetrics().denom1):(g>0?(x=e.fontMetrics().num2,k=b):(x=e.fontMetrics().num3,k=3*b),A=e.fontMetrics().denom2);var C;if(v){var R=e.fontMetrics().axisHeight;x-l.depth-(R+.5*g)<k&&(x+=k-(x-l.depth-(R+.5*g))),R-.5*g-(m.height-A)<k&&(A+=k-(R-.5*g-(m.height-A)));var H=-(R-.5*g);C=w.makeVList({positionType:"individualShift",children:[{type:"elem",elem:m,shift:A},{type:"elem",elem:v,shift:H},{type:"elem",elem:l,shift:-x}]},e)}else{var D=x-l.depth-(m.height-A);D<k&&(x+=.5*(k-D),A+=.5*(k-D)),C=w.makeVList({positionType:"individualShift",children:[{type:"elem",elem:m,shift:A},{type:"elem",elem:l,shift:-x}]},e)}i=e.havingStyle(t),C.height*=i.sizeMultiplier/e.sizeMultiplier,C.depth*=i.sizeMultiplier/e.sizeMultiplier;var j;t.size===O.DISPLAY.size?j=e.fontMetrics().delim1:t.size===O.SCRIPTSCRIPT.size?j=e.havingStyle(O.SCRIPT).fontMetrics().delim2:j=e.fontMetrics().delim2;var I,F;return r.leftDelim==null?I=nt(e,["mopen"]):I=X0.customSizedDelim(r.leftDelim,j,!0,e.havingStyle(t),r.mode,["mopen"]),r.continued?F=w.makeSpan([]):r.rightDelim==null?F=nt(e,["mclose"]):F=X0.customSizedDelim(r.rightDelim,j,!0,e.havingStyle(t),r.mode,["mclose"]),w.makeSpan(["mord"].concat(i.sizingClasses(e)),[I,w.makeSpan(["mfrac"],[C]),F],e)},ha=(r,e)=>{var t=new M.MathNode("mfrac",[U(r.numer,e),U(r.denom,e)]);if(!r.hasBarLine)t.setAttribute("linethickness","0px");else if(r.barSize){var a=t0(r.barSize,e);t.setAttribute("linethickness",z(a))}var n=ki(r.size,e.style);if(n.size!==e.style.size){t=new M.MathNode("mstyle",[t]);var i=n.size===O.DISPLAY.size?"true":"false";t.setAttribute("displaystyle",i),t.setAttribute("scriptlevel","0")}if(r.leftDelim!=null||r.rightDelim!=null){var l=[];if(r.leftDelim!=null){var u=new M.MathNode("mo",[new M.TextNode(r.leftDelim.replace("\\",""))]);u.setAttribute("fence","true"),l.push(u)}if(l.push(t),r.rightDelim!=null){var h=new M.MathNode("mo",[new M.TextNode(r.rightDelim.replace("\\",""))]);h.setAttribute("fence","true"),l.push(h)}return ea(l)}return t};E({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0],i=e[1],l,u=null,h=null,m="auto";switch(a){case"\\dfrac":case"\\frac":case"\\tfrac":l=!0;break;case"\\\\atopfrac":l=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":l=!1,u="(",h=")";break;case"\\\\bracefrac":l=!1,u="\\{",h="\\}";break;case"\\\\brackfrac":l=!1,u="[",h="]";break;default:throw new Error("Unrecognized genfrac command")}switch(a){case"\\dfrac":case"\\dbinom":m="display";break;case"\\tfrac":case"\\tbinom":m="text";break}return{type:"genfrac",mode:t.mode,continued:!1,numer:n,denom:i,hasBarLine:l,leftDelim:u,rightDelim:h,size:m,barSize:null}},htmlBuilder:ua,mathmlBuilder:ha});E({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0],i=e[1];return{type:"genfrac",mode:t.mode,continued:!0,numer:n,denom:i,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});E({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(r){var{parser:e,funcName:t,token:a}=r,n;switch(t){case"\\over":n="\\frac";break;case"\\choose":n="\\binom";break;case"\\atop":n="\\\\atopfrac";break;case"\\brace":n="\\\\bracefrac";break;case"\\brack":n="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:n,token:a}}});var Tn=["display","text","script","scriptscript"],zn=function(e){var t=null;return e.length>0&&(t=e,t=t==="."?null:t),t};E({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(r,e){var{parser:t}=r,a=e[4],n=e[5],i=Yt(e[0]),l=i.type==="atom"&&i.family==="open"?zn(i.text):null,u=Yt(e[1]),h=u.type==="atom"&&u.family==="close"?zn(u.text):null,m=q(e[2],"size"),v,g=null;m.isBlank?v=!0:(g=m.value,v=g.number>0);var b="auto",x=e[3];if(x.type==="ordgroup"){if(x.body.length>0){var k=q(x.body[0],"textord");b=Tn[Number(k.text)]}}else x=q(x,"textord"),b=Tn[Number(x.text)];return{type:"genfrac",mode:t.mode,numer:a,denom:n,continued:!1,hasBarLine:v,barSize:g,leftDelim:l,rightDelim:h,size:b}},htmlBuilder:ua,mathmlBuilder:ha});E({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(r,e){var{parser:t,funcName:a,token:n}=r;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:q(e[0],"size").value,token:n}}});E({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0],i=cs(q(e[1],"infix").size),l=e[2],u=i.number>0;return{type:"genfrac",mode:t.mode,numer:n,denom:l,continued:!1,hasBarLine:u,barSize:i,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:ua,mathmlBuilder:ha});var Si=(r,e)=>{var t=e.style,a,n;r.type==="supsub"?(a=r.sup?P(r.sup,e.havingStyle(t.sup()),e):P(r.sub,e.havingStyle(t.sub()),e),n=q(r.base,"horizBrace")):n=q(r,"horizBrace");var i=P(n.base,e.havingBaseStyle(O.DISPLAY)),l=J0.svgSpan(n,e),u;if(n.isOver?(u=w.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:l}]},e),u.children[0].children[0].children[1].classes.push("svg-align")):(u=w.makeVList({positionType:"bottom",positionData:i.depth+.1+l.height,children:[{type:"elem",elem:l},{type:"kern",size:.1},{type:"elem",elem:i}]},e),u.children[0].children[0].children[0].classes.push("svg-align")),a){var h=w.makeSpan(["mord",n.isOver?"mover":"munder"],[u],e);n.isOver?u=w.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:h},{type:"kern",size:.2},{type:"elem",elem:a}]},e):u=w.makeVList({positionType:"bottom",positionData:h.depth+.2+a.height+a.depth,children:[{type:"elem",elem:a},{type:"kern",size:.2},{type:"elem",elem:h}]},e)}return w.makeSpan(["mord",n.isOver?"mover":"munder"],[u],e)},N1=(r,e)=>{var t=J0.mathMLnode(r.label);return new M.MathNode(r.isOver?"mover":"munder",[U(r.base,e),t])};E({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:a}=r;return{type:"horizBrace",mode:t.mode,label:a,isOver:/^\\over/.test(a),base:e[0]}},htmlBuilder:Si,mathmlBuilder:N1});E({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,a=e[1],n=q(e[0],"url").url;return t.settings.isTrusted({command:"\\href",url:n})?{type:"href",mode:t.mode,href:n,body:n0(a)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(r,e)=>{var t=l0(r.body,e,!1);return w.makeAnchor(r.href,[],t,e)},mathmlBuilder:(r,e)=>{var t=oe(r.body,e);return t instanceof x0||(t=new x0("mrow",[t])),t.setAttribute("href",r.href),t}});E({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,a=q(e[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:a}))return t.formatUnsupportedCmd("\\url");for(var n=[],i=0;i<a.length;i++){var l=a[i];l==="~"&&(l="\\textasciitilde"),n.push({type:"textord",mode:"text",text:l})}var u={type:"text",mode:t.mode,font:"\\texttt",body:n};return{type:"href",mode:t.mode,href:a,body:n0(u)}}});E({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(r,e){var{parser:t}=r;return{type:"hbox",mode:t.mode,body:n0(e[0])}},htmlBuilder(r,e){var t=l0(r.body,e,!1);return w.makeFragment(t)},mathmlBuilder(r,e){return new M.MathNode("mrow",k0(r.body,e))}});E({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:a,token:n}=r,i=q(e[0],"raw").string,l=e[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var u,h={};switch(a){case"\\htmlClass":h.class=i,u={command:"\\htmlClass",class:i};break;case"\\htmlId":h.id=i,u={command:"\\htmlId",id:i};break;case"\\htmlStyle":h.style=i,u={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var m=i.split(","),v=0;v<m.length;v++){var g=m[v].split("=");if(g.length!==2)throw new T("Error parsing key-value for \\htmlData");h["data-"+g[0].trim()]=g[1].trim()}u={command:"\\htmlData",attributes:h};break}default:throw new Error("Unrecognized html command")}return t.settings.isTrusted(u)?{type:"html",mode:t.mode,attributes:h,body:n0(l)}:t.formatUnsupportedCmd(a)},htmlBuilder:(r,e)=>{var t=l0(r.body,e,!1),a=["enclosing"];r.attributes.class&&a.push(...r.attributes.class.trim().split(/\s+/));var n=w.makeSpan(a,t,e);for(var i in r.attributes)i!=="class"&&r.attributes.hasOwnProperty(i)&&n.setAttribute(i,r.attributes[i]);return n},mathmlBuilder:(r,e)=>oe(r.body,e)});E({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"htmlmathml",mode:t.mode,html:n0(e[0]),mathml:n0(e[1])}},htmlBuilder:(r,e)=>{var t=l0(r.html,e,!1);return w.makeFragment(t)},mathmlBuilder:(r,e)=>oe(r.mathml,e)});var Rr=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new T("Invalid size: '"+e+"' in \\includegraphics");var a={number:+(t[1]+t[2]),unit:t[3]};if(!jn(a))throw new T("Invalid unit: '"+a.unit+"' in \\includegraphics.");return a};E({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(r,e,t)=>{var{parser:a}=r,n={number:0,unit:"em"},i={number:.9,unit:"em"},l={number:0,unit:"em"},u="";if(t[0])for(var h=q(t[0],"raw").string,m=h.split(","),v=0;v<m.length;v++){var g=m[v].split("=");if(g.length===2){var b=g[1].trim();switch(g[0].trim()){case"alt":u=b;break;case"width":n=Rr(b);break;case"height":i=Rr(b);break;case"totalheight":l=Rr(b);break;default:throw new T("Invalid key: '"+g[0]+"' in \\includegraphics.")}}}var x=q(e[0],"url").url;return u===""&&(u=x,u=u.replace(/^.*[\\/]/,""),u=u.substring(0,u.lastIndexOf("."))),a.settings.isTrusted({command:"\\includegraphics",url:x})?{type:"includegraphics",mode:a.mode,alt:u,width:n,height:i,totalheight:l,src:x}:a.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(r,e)=>{var t=t0(r.height,e),a=0;r.totalheight.number>0&&(a=t0(r.totalheight,e)-t);var n=0;r.width.number>0&&(n=t0(r.width,e));var i={height:z(t+a)};n>0&&(i.width=z(n)),a>0&&(i.verticalAlign=z(-a));var l=new Lr(r.src,r.alt,i);return l.height=t,l.depth=a,l},mathmlBuilder:(r,e)=>{var t=new M.MathNode("mglyph",[]);t.setAttribute("alt",r.alt);var a=t0(r.height,e),n=0;if(r.totalheight.number>0&&(n=t0(r.totalheight,e)-a,t.setAttribute("valign",z(-n))),t.setAttribute("height",z(a+n)),r.width.number>0){var i=t0(r.width,e);t.setAttribute("width",z(i))}return t.setAttribute("src",r.src),t}});E({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:a}=r,n=q(e[0],"size");if(t.settings.strict){var i=a[1]==="m",l=n.value.unit==="mu";i?(l||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" supports only mu units, "+("not "+n.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" works only in math mode")):l&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:n.value}},htmlBuilder(r,e){return w.makeGlue(r.dimension,e)},mathmlBuilder(r,e){var t=t0(r.dimension,e);return new M.SpaceNode(t)}});E({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0];return{type:"lap",mode:t.mode,alignment:a.slice(5),body:n}},htmlBuilder:(r,e)=>{var t;r.alignment==="clap"?(t=w.makeSpan([],[P(r.body,e)]),t=w.makeSpan(["inner"],[t],e)):t=w.makeSpan(["inner"],[P(r.body,e)]);var a=w.makeSpan(["fix"],[]),n=w.makeSpan([r.alignment],[t,a],e),i=w.makeSpan(["strut"]);return i.style.height=z(n.height+n.depth),n.depth&&(i.style.verticalAlign=z(-n.depth)),n.children.unshift(i),n=w.makeSpan(["thinbox"],[n],e),w.makeSpan(["mord","vbox"],[n],e)},mathmlBuilder:(r,e)=>{var t=new M.MathNode("mpadded",[U(r.body,e)]);if(r.alignment!=="rlap"){var a=r.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",a+"width")}return t.setAttribute("width","0px"),t}});E({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){var{funcName:t,parser:a}=r,n=a.mode;a.switchMode("math");var i=t==="\\("?"\\)":"$",l=a.parseExpression(!1,i);return a.expect(i),a.switchMode(n),{type:"styling",mode:a.mode,style:"text",body:l}}});E({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){throw new T("Mismatched "+r.funcName)}});var Cn=(r,e)=>{switch(e.style.size){case O.DISPLAY.size:return r.display;case O.TEXT.size:return r.text;case O.SCRIPT.size:return r.script;case O.SCRIPTSCRIPT.size:return r.scriptscript;default:return r.text}};E({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"mathchoice",mode:t.mode,display:n0(e[0]),text:n0(e[1]),script:n0(e[2]),scriptscript:n0(e[3])}},htmlBuilder:(r,e)=>{var t=Cn(r,e),a=l0(t,e,!1);return w.makeFragment(a)},mathmlBuilder:(r,e)=>{var t=Cn(r,e);return oe(t,e)}});var Ai=(r,e,t,a,n,i,l)=>{r=w.makeSpan([],[r]);var u=t&&$.isCharacterBox(t),h,m;if(e){var v=P(e,a.havingStyle(n.sup()),a);m={elem:v,kern:Math.max(a.fontMetrics().bigOpSpacing1,a.fontMetrics().bigOpSpacing3-v.depth)}}if(t){var g=P(t,a.havingStyle(n.sub()),a);h={elem:g,kern:Math.max(a.fontMetrics().bigOpSpacing2,a.fontMetrics().bigOpSpacing4-g.height)}}var b;if(m&&h){var x=a.fontMetrics().bigOpSpacing5+h.elem.height+h.elem.depth+h.kern+r.depth+l;b=w.makeVList({positionType:"bottom",positionData:x,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:h.elem,marginLeft:z(-i)},{type:"kern",size:h.kern},{type:"elem",elem:r},{type:"kern",size:m.kern},{type:"elem",elem:m.elem,marginLeft:z(i)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]},a)}else if(h){var k=r.height-l;b=w.makeVList({positionType:"top",positionData:k,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:h.elem,marginLeft:z(-i)},{type:"kern",size:h.kern},{type:"elem",elem:r}]},a)}else if(m){var A=r.depth+l;b=w.makeVList({positionType:"bottom",positionData:A,children:[{type:"elem",elem:r},{type:"kern",size:m.kern},{type:"elem",elem:m.elem,marginLeft:z(i)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]},a)}else return r;var C=[b];if(h&&i!==0&&!u){var D=w.makeSpan(["mspace"],[],a);D.style.marginRight=z(i),C.unshift(D)}return w.makeSpan(["mop","op-limits"],C,a)},Mi=["\\smallint"],_e=(r,e)=>{var t,a,n=!1,i;r.type==="supsub"?(t=r.sup,a=r.sub,i=q(r.base,"op"),n=!0):i=q(r,"op");var l=e.style,u=!1;l.size===O.DISPLAY.size&&i.symbol&&!$.contains(Mi,i.name)&&(u=!0);var h;if(i.symbol){var m=u?"Size2-Regular":"Size1-Regular",v="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(v=i.name.slice(1),i.name=v==="oiint"?"\\iint":"\\iiint"),h=w.makeSymbol(i.name,m,"math",e,["mop","op-symbol",u?"large-op":"small-op"]),v.length>0){var g=h.italic,b=w.staticSvg(v+"Size"+(u?"2":"1"),e);h=w.makeVList({positionType:"individualShift",children:[{type:"elem",elem:h,shift:0},{type:"elem",elem:b,shift:u?.08:0}]},e),i.name="\\"+v,h.classes.unshift("mop"),h.italic=g}}else if(i.body){var x=l0(i.body,e,!0);x.length===1&&x[0]instanceof w0?(h=x[0],h.classes[0]="mop"):h=w.makeSpan(["mop"],x,e)}else{for(var k=[],A=1;A<i.name.length;A++)k.push(w.mathsym(i.name[A],i.mode,e));h=w.makeSpan(["mop"],k,e)}var C=0,D=0;return(h instanceof w0||i.name==="\\oiint"||i.name==="\\oiiint")&&!i.suppressBaseShift&&(C=(h.height-h.depth)/2-e.fontMetrics().axisHeight,D=h.italic),n?Ai(h,t,a,e,l,D,C):(C&&(h.style.position="relative",h.style.top=z(C)),h)},it=(r,e)=>{var t;if(r.symbol)t=new x0("mo",[E0(r.name,r.mode)]),$.contains(Mi,r.name)&&t.setAttribute("largeop","false");else if(r.body)t=new x0("mo",k0(r.body,e));else{t=new x0("mi",[new be(r.name.slice(1))]);var a=new x0("mo",[E0("\u2061","text")]);r.parentIsSupSub?t=new x0("mrow",[t,a]):t=Qn([t,a])}return t},O1={"\u220F":"\\prod","\u2210":"\\coprod","\u2211":"\\sum","\u22C0":"\\bigwedge","\u22C1":"\\bigvee","\u22C2":"\\bigcap","\u22C3":"\\bigcup","\u2A00":"\\bigodot","\u2A01":"\\bigoplus","\u2A02":"\\bigotimes","\u2A04":"\\biguplus","\u2A06":"\\bigsqcup"};E({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\u220F","\u2210","\u2211","\u22C0","\u22C1","\u22C2","\u22C3","\u2A00","\u2A01","\u2A02","\u2A04","\u2A06"],props:{numArgs:0},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=a;return n.length===1&&(n=O1[n]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:_e,mathmlBuilder:it});E({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var{parser:t}=r,a=e[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:n0(a)}},htmlBuilder:_e,mathmlBuilder:it});var R1={"\u222B":"\\int","\u222C":"\\iint","\u222D":"\\iiint","\u222E":"\\oint","\u222F":"\\oiint","\u2230":"\\oiiint"};E({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:_e,mathmlBuilder:it});E({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:_e,mathmlBuilder:it});E({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\u222B","\u222C","\u222D","\u222E","\u222F","\u2230"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r,a=t;return a.length===1&&(a=R1[a]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:a}},htmlBuilder:_e,mathmlBuilder:it});var Ti=(r,e)=>{var t,a,n=!1,i;r.type==="supsub"?(t=r.sup,a=r.sub,i=q(r.base,"operatorname"),n=!0):i=q(r,"operatorname");var l;if(i.body.length>0){for(var u=i.body.map(g=>{var b=g.text;return typeof b=="string"?{type:"textord",mode:g.mode,text:b}:g}),h=l0(u,e.withFont("mathrm"),!0),m=0;m<h.length;m++){var v=h[m];v instanceof w0&&(v.text=v.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}l=w.makeSpan(["mop"],h,e)}else l=w.makeSpan(["mop"],[],e);return n?Ai(l,t,a,e,e.style,0,0):l},_1=(r,e)=>{for(var t=k0(r.body,e.withFont("mathrm")),a=!0,n=0;n<t.length;n++){var i=t[n];if(!(i instanceof M.SpaceNode))if(i instanceof M.MathNode)switch(i.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var l=i.children[0];i.children.length===1&&l instanceof M.TextNode?l.text=l.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):a=!1;break}default:a=!1}else a=!1}if(a){var u=t.map(v=>v.toText()).join("");t=[new M.TextNode(u)]}var h=new M.MathNode("mi",t);h.setAttribute("mathvariant","normal");var m=new M.MathNode("mo",[E0("\u2061","text")]);return r.parentIsSupSub?new M.MathNode("mrow",[h,m]):M.newDocumentFragment([h,m])};E({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0];return{type:"operatorname",mode:t.mode,body:n0(n),alwaysHandleSupSub:a==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:Ti,mathmlBuilder:_1});d("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");ke({type:"ordgroup",htmlBuilder(r,e){return r.semisimple?w.makeFragment(l0(r.body,e,!1)):w.makeSpan(["mord"],l0(r.body,e,!0),e)},mathmlBuilder(r,e){return oe(r.body,e,!0)}});E({type:"overline",names:["\\overline"],props:{numArgs:1},handler(r,e){var{parser:t}=r,a=e[0];return{type:"overline",mode:t.mode,body:a}},htmlBuilder(r,e){var t=P(r.body,e.havingCrampedStyle()),a=w.makeLineSpan("overline-line",e),n=e.fontMetrics().defaultRuleThickness,i=w.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*n},{type:"elem",elem:a},{type:"kern",size:n}]},e);return w.makeSpan(["mord","overline"],[i],e)},mathmlBuilder(r,e){var t=new M.MathNode("mo",[new M.TextNode("\u203E")]);t.setAttribute("stretchy","true");var a=new M.MathNode("mover",[U(r.body,e),t]);return a.setAttribute("accent","true"),a}});E({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,a=e[0];return{type:"phantom",mode:t.mode,body:n0(a)}},htmlBuilder:(r,e)=>{var t=l0(r.body,e.withPhantom(),!1);return w.makeFragment(t)},mathmlBuilder:(r,e)=>{var t=k0(r.body,e);return new M.MathNode("mphantom",t)}});E({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,a=e[0];return{type:"hphantom",mode:t.mode,body:a}},htmlBuilder:(r,e)=>{var t=w.makeSpan([],[P(r.body,e.withPhantom())]);if(t.height=0,t.depth=0,t.children)for(var a=0;a<t.children.length;a++)t.children[a].height=0,t.children[a].depth=0;return t=w.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t}]},e),w.makeSpan(["mord"],[t],e)},mathmlBuilder:(r,e)=>{var t=k0(n0(r.body),e),a=new M.MathNode("mphantom",t),n=new M.MathNode("mpadded",[a]);return n.setAttribute("height","0px"),n.setAttribute("depth","0px"),n}});E({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,a=e[0];return{type:"vphantom",mode:t.mode,body:a}},htmlBuilder:(r,e)=>{var t=w.makeSpan(["inner"],[P(r.body,e.withPhantom())]),a=w.makeSpan(["fix"],[]);return w.makeSpan(["mord","rlap"],[t,a],e)},mathmlBuilder:(r,e)=>{var t=k0(n0(r.body),e),a=new M.MathNode("mphantom",t),n=new M.MathNode("mpadded",[a]);return n.setAttribute("width","0px"),n}});E({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r,a=q(e[0],"size").value,n=e[1];return{type:"raisebox",mode:t.mode,dy:a,body:n}},htmlBuilder(r,e){var t=P(r.body,e),a=t0(r.dy,e);return w.makeVList({positionType:"shift",positionData:-a,children:[{type:"elem",elem:t}]},e)},mathmlBuilder(r,e){var t=new M.MathNode("mpadded",[U(r.body,e)]),a=r.dy.number+r.dy.unit;return t.setAttribute("voffset",a),t}});E({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(r){var{parser:e}=r;return{type:"internal",mode:e.mode}}});E({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler(r,e,t){var{parser:a}=r,n=t[0],i=q(e[0],"size"),l=q(e[1],"size");return{type:"rule",mode:a.mode,shift:n&&q(n,"size").value,width:i.value,height:l.value}},htmlBuilder(r,e){var t=w.makeSpan(["mord","rule"],[],e),a=t0(r.width,e),n=t0(r.height,e),i=r.shift?t0(r.shift,e):0;return t.style.borderRightWidth=z(a),t.style.borderTopWidth=z(n),t.style.bottom=z(i),t.width=a,t.height=n+i,t.depth=-i,t.maxFontSize=n*1.125*e.sizeMultiplier,t},mathmlBuilder(r,e){var t=t0(r.width,e),a=t0(r.height,e),n=r.shift?t0(r.shift,e):0,i=e.color&&e.getColor()||"black",l=new M.MathNode("mspace");l.setAttribute("mathbackground",i),l.setAttribute("width",z(t)),l.setAttribute("height",z(a));var u=new M.MathNode("mpadded",[l]);return n>=0?u.setAttribute("height",z(n)):(u.setAttribute("height",z(n)),u.setAttribute("depth",z(-n))),u.setAttribute("voffset",z(n)),u}});function zi(r,e,t){for(var a=l0(r,e,!1),n=e.sizeMultiplier/t.sizeMultiplier,i=0;i<a.length;i++){var l=a[i].classes.indexOf("sizing");l<0?Array.prototype.push.apply(a[i].classes,e.sizingClasses(t)):a[i].classes[l+1]==="reset-size"+e.size&&(a[i].classes[l+1]="reset-size"+t.size),a[i].height*=n,a[i].depth*=n}return w.makeFragment(a)}var En=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],H1=(r,e)=>{var t=e.havingSize(r.size);return zi(r.body,t,e)};E({type:"sizing",names:En,props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{breakOnTokenText:t,funcName:a,parser:n}=r,i=n.parseExpression(!1,t);return{type:"sizing",mode:n.mode,size:En.indexOf(a)+1,body:i}},htmlBuilder:H1,mathmlBuilder:(r,e)=>{var t=e.havingSize(r.size),a=k0(r.body,t),n=new M.MathNode("mstyle",a);return n.setAttribute("mathsize",z(t.sizeMultiplier)),n}});E({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(r,e,t)=>{var{parser:a}=r,n=!1,i=!1,l=t[0]&&q(t[0],"ordgroup");if(l)for(var u="",h=0;h<l.body.length;++h){var m=l.body[h];if(u=m.text,u==="t")n=!0;else if(u==="b")i=!0;else{n=!1,i=!1;break}}else n=!0,i=!0;var v=e[0];return{type:"smash",mode:a.mode,body:v,smashHeight:n,smashDepth:i}},htmlBuilder:(r,e)=>{var t=w.makeSpan([],[P(r.body,e)]);if(!r.smashHeight&&!r.smashDepth)return t;if(r.smashHeight&&(t.height=0,t.children))for(var a=0;a<t.children.length;a++)t.children[a].height=0;if(r.smashDepth&&(t.depth=0,t.children))for(var n=0;n<t.children.length;n++)t.children[n].depth=0;var i=w.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t}]},e);return w.makeSpan(["mord"],[i],e)},mathmlBuilder:(r,e)=>{var t=new M.MathNode("mpadded",[U(r.body,e)]);return r.smashHeight&&t.setAttribute("height","0px"),r.smashDepth&&t.setAttribute("depth","0px"),t}});E({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:a}=r,n=t[0],i=e[0];return{type:"sqrt",mode:a.mode,body:i,index:n}},htmlBuilder(r,e){var t=P(r.body,e.havingCrampedStyle());t.height===0&&(t.height=e.fontMetrics().xHeight),t=w.wrapFragment(t,e);var a=e.fontMetrics(),n=a.defaultRuleThickness,i=n;e.style.id<O.TEXT.id&&(i=e.fontMetrics().xHeight);var l=n+i/4,u=t.height+t.depth+l+n,{span:h,ruleWidth:m,advanceWidth:v}=X0.sqrtImage(u,e),g=h.height-m;g>t.height+t.depth+l&&(l=(l+g-t.height-t.depth)/2);var b=h.height-t.height-l-m;t.style.paddingLeft=z(v);var x=w.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+b)},{type:"elem",elem:h},{type:"kern",size:m}]},e);if(r.index){var k=e.havingStyle(O.SCRIPTSCRIPT),A=P(r.index,k,e),C=.6*(x.height-x.depth),D=w.makeVList({positionType:"shift",positionData:-C,children:[{type:"elem",elem:A}]},e),R=w.makeSpan(["root"],[D]);return w.makeSpan(["mord","sqrt"],[R,x],e)}else return w.makeSpan(["mord","sqrt"],[x],e)},mathmlBuilder(r,e){var{body:t,index:a}=r;return a?new M.MathNode("mroot",[U(t,e),U(a,e)]):new M.MathNode("msqrt",[U(t,e)])}});var Bn={display:O.DISPLAY,text:O.TEXT,script:O.SCRIPT,scriptscript:O.SCRIPTSCRIPT};E({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r,e){var{breakOnTokenText:t,funcName:a,parser:n}=r,i=n.parseExpression(!0,t),l=a.slice(1,a.length-5);return{type:"styling",mode:n.mode,style:l,body:i}},htmlBuilder(r,e){var t=Bn[r.style],a=e.havingStyle(t).withFont("");return zi(r.body,a,e)},mathmlBuilder(r,e){var t=Bn[r.style],a=e.havingStyle(t),n=k0(r.body,a),i=new M.MathNode("mstyle",n),l={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},u=l[r.style];return i.setAttribute("scriptlevel",u[0]),i.setAttribute("displaystyle",u[1]),i}});var q1=function(e,t){var a=e.base;if(a)if(a.type==="op"){var n=a.limits&&(t.style.size===O.DISPLAY.size||a.alwaysHandleSupSub);return n?_e:null}else if(a.type==="operatorname"){var i=a.alwaysHandleSupSub&&(t.style.size===O.DISPLAY.size||a.limits);return i?Ti:null}else{if(a.type==="accent")return $.isCharacterBox(a.base)?aa:null;if(a.type==="horizBrace"){var l=!e.sub;return l===a.isOver?Si:null}else return null}else return null};ke({type:"supsub",htmlBuilder(r,e){var t=q1(r,e);if(t)return t(r,e);var{base:a,sup:n,sub:i}=r,l=P(a,e),u,h,m=e.fontMetrics(),v=0,g=0,b=a&&$.isCharacterBox(a);if(n){var x=e.havingStyle(e.style.sup());u=P(n,x,e),b||(v=l.height-x.fontMetrics().supDrop*x.sizeMultiplier/e.sizeMultiplier)}if(i){var k=e.havingStyle(e.style.sub());h=P(i,k,e),b||(g=l.depth+k.fontMetrics().subDrop*k.sizeMultiplier/e.sizeMultiplier)}var A;e.style===O.DISPLAY?A=m.sup1:e.style.cramped?A=m.sup3:A=m.sup2;var C=e.sizeMultiplier,D=z(.5/m.ptPerEm/C),R=null;if(h){var H=r.base&&r.base.type==="op"&&r.base.name&&(r.base.name==="\\oiint"||r.base.name==="\\oiiint");(l instanceof w0||H)&&(R=z(-l.italic))}var j;if(u&&h){v=Math.max(v,A,u.depth+.25*m.xHeight),g=Math.max(g,m.sub2);var I=m.defaultRuleThickness,F=4*I;if(v-u.depth-(h.height-g)<F){g=F-(v-u.depth)+h.height;var L=.8*m.xHeight-(v-u.depth);L>0&&(v+=L,g-=L)}var Z=[{type:"elem",elem:h,shift:g,marginRight:D,marginLeft:R},{type:"elem",elem:u,shift:-v,marginRight:D}];j=w.makeVList({positionType:"individualShift",children:Z},e)}else if(h){g=Math.max(g,m.sub1,h.height-.8*m.xHeight);var V=[{type:"elem",elem:h,marginLeft:R,marginRight:D}];j=w.makeVList({positionType:"shift",positionData:g,children:V},e)}else if(u)v=Math.max(v,A,u.depth+.25*m.xHeight),j=w.makeVList({positionType:"shift",positionData:-v,children:[{type:"elem",elem:u,marginRight:D}]},e);else throw new Error("supsub must have either sup or sub.");var L0=Fr(l,"right")||"mord";return w.makeSpan([L0],[l,w.makeSpan(["msupsub"],[j])],e)},mathmlBuilder(r,e){var t=!1,a,n;r.base&&r.base.type==="horizBrace"&&(n=!!r.sup,n===r.base.isOver&&(t=!0,a=r.base.isOver)),r.base&&(r.base.type==="op"||r.base.type==="operatorname")&&(r.base.parentIsSupSub=!0);var i=[U(r.base,e)];r.sub&&i.push(U(r.sub,e)),r.sup&&i.push(U(r.sup,e));var l;if(t)l=a?"mover":"munder";else if(r.sub)if(r.sup){var m=r.base;m&&m.type==="op"&&m.limits&&e.style===O.DISPLAY||m&&m.type==="operatorname"&&m.alwaysHandleSupSub&&(e.style===O.DISPLAY||m.limits)?l="munderover":l="msubsup"}else{var h=r.base;h&&h.type==="op"&&h.limits&&(e.style===O.DISPLAY||h.alwaysHandleSupSub)||h&&h.type==="operatorname"&&h.alwaysHandleSupSub&&(h.limits||e.style===O.DISPLAY)?l="munder":l="msub"}else{var u=r.base;u&&u.type==="op"&&u.limits&&(e.style===O.DISPLAY||u.alwaysHandleSupSub)||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(u.limits||e.style===O.DISPLAY)?l="mover":l="msup"}return new M.MathNode(l,i)}});ke({type:"atom",htmlBuilder(r,e){return w.mathsym(r.text,r.mode,e,["m"+r.family])},mathmlBuilder(r,e){var t=new M.MathNode("mo",[E0(r.text,r.mode)]);if(r.family==="bin"){var a=ta(r,e);a==="bold-italic"&&t.setAttribute("mathvariant",a)}else r.family==="punct"?t.setAttribute("separator","true"):(r.family==="open"||r.family==="close")&&t.setAttribute("stretchy","false");return t}});var Ci={mi:"italic",mn:"normal",mtext:"normal"};ke({type:"mathord",htmlBuilder(r,e){return w.makeOrd(r,e,"mathord")},mathmlBuilder(r,e){var t=new M.MathNode("mi",[E0(r.text,r.mode,e)]),a=ta(r,e)||"italic";return a!==Ci[t.type]&&t.setAttribute("mathvariant",a),t}});ke({type:"textord",htmlBuilder(r,e){return w.makeOrd(r,e,"textord")},mathmlBuilder(r,e){var t=E0(r.text,r.mode,e),a=ta(r,e)||"normal",n;return r.mode==="text"?n=new M.MathNode("mtext",[t]):/[0-9]/.test(r.text)?n=new M.MathNode("mn",[t]):r.text==="\\prime"?n=new M.MathNode("mo",[t]):n=new M.MathNode("mi",[t]),a!==Ci[n.type]&&n.setAttribute("mathvariant",a),n}});var _r={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Hr={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};ke({type:"spacing",htmlBuilder(r,e){if(Hr.hasOwnProperty(r.text)){var t=Hr[r.text].className||"";if(r.mode==="text"){var a=w.makeOrd(r,e,"textord");return a.classes.push(t),a}else return w.makeSpan(["mspace",t],[w.mathsym(r.text,r.mode,e)],e)}else{if(_r.hasOwnProperty(r.text))return w.makeSpan(["mspace",_r[r.text]],[],e);throw new T('Unknown type of space "'+r.text+'"')}},mathmlBuilder(r,e){var t;if(Hr.hasOwnProperty(r.text))t=new M.MathNode("mtext",[new M.TextNode("\xA0")]);else{if(_r.hasOwnProperty(r.text))return new M.MathNode("mspace");throw new T('Unknown type of space "'+r.text+'"')}return t}});var Dn=()=>{var r=new M.MathNode("mtd",[]);return r.setAttribute("width","50%"),r};ke({type:"tag",mathmlBuilder(r,e){var t=new M.MathNode("mtable",[new M.MathNode("mtr",[Dn(),new M.MathNode("mtd",[oe(r.body,e)]),Dn(),new M.MathNode("mtd",[oe(r.tag,e)])])]);return t.setAttribute("width","100%"),t}});var $n={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Nn={"\\textbf":"textbf","\\textmd":"textmd"},I1={"\\textit":"textit","\\textup":"textup"},On=(r,e)=>{var t=r.font;if(t){if($n[t])return e.withTextFontFamily($n[t]);if(Nn[t])return e.withTextFontWeight(Nn[t]);if(t==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(I1[t])};E({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:a}=r,n=e[0];return{type:"text",mode:t.mode,body:n0(n),font:a}},htmlBuilder(r,e){var t=On(r,e),a=l0(r.body,t,!0);return w.makeSpan(["mord","text"],a,t)},mathmlBuilder(r,e){var t=On(r,e);return oe(r.body,t)}});E({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"underline",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=P(r.body,e),a=w.makeLineSpan("underline-line",e),n=e.fontMetrics().defaultRuleThickness,i=w.makeVList({positionType:"top",positionData:t.height,children:[{type:"kern",size:n},{type:"elem",elem:a},{type:"kern",size:3*n},{type:"elem",elem:t}]},e);return w.makeSpan(["mord","underline"],[i],e)},mathmlBuilder(r,e){var t=new M.MathNode("mo",[new M.TextNode("\u203E")]);t.setAttribute("stretchy","true");var a=new M.MathNode("munder",[U(r.body,e),t]);return a.setAttribute("accentunder","true"),a}});E({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"vcenter",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=P(r.body,e),a=e.fontMetrics().axisHeight,n=.5*(t.height-a-(t.depth+a));return w.makeVList({positionType:"shift",positionData:n,children:[{type:"elem",elem:t}]},e)},mathmlBuilder(r,e){return new M.MathNode("mpadded",[U(r.body,e)],["vcenter"])}});E({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(r,e,t){throw new T("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(r,e){for(var t=Rn(r),a=[],n=e.havingStyle(e.style.text()),i=0;i<t.length;i++){var l=t[i];l==="~"&&(l="\\textasciitilde"),a.push(w.makeSymbol(l,"Typewriter-Regular",r.mode,n,["mord","texttt"]))}return w.makeSpan(["mord","text"].concat(n.sizingClasses(e)),w.tryCombineChars(a),n)},mathmlBuilder(r,e){var t=new M.TextNode(Rn(r)),a=new M.MathNode("mtext",[t]);return a.setAttribute("mathvariant","monospace"),a}});var Rn=r=>r.body.replace(/ /g,r.star?"\u2423":"\xA0"),se=Zn,Ei=`[ \r 684 - ]`,P1="\\\\[a-zA-Z@]+",L1="\\\\[^\uD800-\uDFFF]",j1="("+P1+")"+Ei+"*",F1=`\\\\( 685 - |[ \r ]+ 686 - ?)[ \r ]*`,Wr="[\u0300-\u036F]",V1=new RegExp(Wr+"+$"),U1="("+Ei+"+)|"+(F1+"|")+"([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]"+(Wr+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Wr+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+j1)+("|"+L1+")"),Xt=class{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(U1,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new C0("EOF",new A0(this,t,t));var a=this.tokenRegex.exec(e);if(a===null||a.index!==t)throw new T("Unexpected character: '"+e[t]+"'",new C0(e[t],new A0(this,t,t+1)));var n=a[6]||a[3]||(a[2]?"\\ ":" ");if(this.catcodes[n]===14){var i=e.indexOf(` 687 - `,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new C0(n,new A0(this,t,this.tokenRegex.lastIndex))}},Yr=class{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new T("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,a){if(a===void 0&&(a=!1),a){for(var n=0;n<this.undefStack.length;n++)delete this.undefStack[n][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}},G1=yi;d("\\noexpand",function(r){var e=r.popToken();return r.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});d("\\expandafter",function(r){var e=r.popToken();return r.expandOnce(!0),{tokens:[e],numArgs:0}});d("\\@firstoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[0],numArgs:0}});d("\\@secondoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[1],numArgs:0}});d("\\@ifnextchar",function(r){var e=r.consumeArgs(3);r.consumeSpaces();var t=r.future();return e[0].length===1&&e[0][0].text===t.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});d("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");d("\\TextOrMath",function(r){var e=r.consumeArgs(2);return r.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var _n={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};d("\\char",function(r){var e=r.popToken(),t,a="";if(e.text==="'")t=8,e=r.popToken();else if(e.text==='"')t=16,e=r.popToken();else if(e.text==="`")if(e=r.popToken(),e.text[0]==="\\")a=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new T("\\char` missing argument");a=e.text.charCodeAt(0)}else t=10;if(t){if(a=_n[e.text],a==null||a>=t)throw new T("Invalid base-"+t+" digit "+e.text);for(var n;(n=_n[r.future().text])!=null&&n<t;)a*=t,a+=n,r.popToken()}return"\\@char{"+a+"}"});var ca=(r,e,t)=>{var a=r.consumeArg().tokens;if(a.length!==1)throw new T("\\newcommand's first argument must be a macro name");var n=a[0].text,i=r.isDefined(n);if(i&&!e)throw new T("\\newcommand{"+n+"} attempting to redefine "+(n+"; use \\renewcommand"));if(!i&&!t)throw new T("\\renewcommand{"+n+"} when command "+n+" does not yet exist; use \\newcommand");var l=0;if(a=r.consumeArg().tokens,a.length===1&&a[0].text==="["){for(var u="",h=r.expandNextToken();h.text!=="]"&&h.text!=="EOF";)u+=h.text,h=r.expandNextToken();if(!u.match(/^\s*[0-9]+\s*$/))throw new T("Invalid number of arguments: "+u);l=parseInt(u),a=r.consumeArg().tokens}return r.macros.set(n,{tokens:a,numArgs:l}),""};d("\\newcommand",r=>ca(r,!1,!0));d("\\renewcommand",r=>ca(r,!0,!1));d("\\providecommand",r=>ca(r,!0,!0));d("\\message",r=>{var e=r.consumeArgs(1)[0];return console.log(e.reverse().map(t=>t.text).join("")),""});d("\\errmessage",r=>{var e=r.consumeArgs(1)[0];return console.error(e.reverse().map(t=>t.text).join("")),""});d("\\show",r=>{var e=r.popToken(),t=e.text;return console.log(e,r.macros.get(t),se[t],K.math[t],K.text[t]),""});d("\\bgroup","{");d("\\egroup","}");d("~","\\nobreakspace");d("\\lq","`");d("\\rq","'");d("\\aa","\\r a");d("\\AA","\\r A");d("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`\xA9}");d("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");d("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`\xAE}");d("\u212C","\\mathscr{B}");d("\u2130","\\mathscr{E}");d("\u2131","\\mathscr{F}");d("\u210B","\\mathscr{H}");d("\u2110","\\mathscr{I}");d("\u2112","\\mathscr{L}");d("\u2133","\\mathscr{M}");d("\u211B","\\mathscr{R}");d("\u212D","\\mathfrak{C}");d("\u210C","\\mathfrak{H}");d("\u2128","\\mathfrak{Z}");d("\\Bbbk","\\Bbb{k}");d("\xB7","\\cdotp");d("\\llap","\\mathllap{\\textrm{#1}}");d("\\rlap","\\mathrlap{\\textrm{#1}}");d("\\clap","\\mathclap{\\textrm{#1}}");d("\\mathstrut","\\vphantom{(}");d("\\underbar","\\underline{\\text{#1}}");d("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');d("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`\u2260}}");d("\\ne","\\neq");d("\u2260","\\neq");d("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`\u2209}}");d("\u2209","\\notin");d("\u2258","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`\u2258}}");d("\u2259","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}");d("\u225A","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225A}}");d("\u225B","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`\u225B}}");d("\u225D","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`\u225D}}");d("\u225E","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`\u225E}}");d("\u225F","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225F}}");d("\u27C2","\\perp");d("\u203C","\\mathclose{!\\mkern-0.8mu!}");d("\u220C","\\notni");d("\u231C","\\ulcorner");d("\u231D","\\urcorner");d("\u231E","\\llcorner");d("\u231F","\\lrcorner");d("\xA9","\\copyright");d("\xAE","\\textregistered");d("\uFE0F","\\textregistered");d("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');d("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');d("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');d("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');d("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}");d("\u22EE","\\vdots");d("\\varGamma","\\mathit{\\Gamma}");d("\\varDelta","\\mathit{\\Delta}");d("\\varTheta","\\mathit{\\Theta}");d("\\varLambda","\\mathit{\\Lambda}");d("\\varXi","\\mathit{\\Xi}");d("\\varPi","\\mathit{\\Pi}");d("\\varSigma","\\mathit{\\Sigma}");d("\\varUpsilon","\\mathit{\\Upsilon}");d("\\varPhi","\\mathit{\\Phi}");d("\\varPsi","\\mathit{\\Psi}");d("\\varOmega","\\mathit{\\Omega}");d("\\substack","\\begin{subarray}{c}#1\\end{subarray}");d("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");d("\\boxed","\\fbox{$\\displaystyle{#1}$}");d("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");d("\\implies","\\DOTSB\\;\\Longrightarrow\\;");d("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var Hn={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};d("\\dots",function(r){var e="\\dotso",t=r.expandAfterFuture().text;return t in Hn?e=Hn[t]:(t.slice(0,4)==="\\not"||t in K.math&&$.contains(["bin","rel"],K.math[t].group))&&(e="\\dotsb"),e});var da={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};d("\\dotso",function(r){var e=r.future().text;return e in da?"\\ldots\\,":"\\ldots"});d("\\dotsc",function(r){var e=r.future().text;return e in da&&e!==","?"\\ldots\\,":"\\ldots"});d("\\cdots",function(r){var e=r.future().text;return e in da?"\\@cdots\\,":"\\@cdots"});d("\\dotsb","\\cdots");d("\\dotsm","\\cdots");d("\\dotsi","\\!\\cdots");d("\\dotsx","\\ldots\\,");d("\\DOTSI","\\relax");d("\\DOTSB","\\relax");d("\\DOTSX","\\relax");d("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");d("\\,","\\tmspace+{3mu}{.1667em}");d("\\thinspace","\\,");d("\\>","\\mskip{4mu}");d("\\:","\\tmspace+{4mu}{.2222em}");d("\\medspace","\\:");d("\\;","\\tmspace+{5mu}{.2777em}");d("\\thickspace","\\;");d("\\!","\\tmspace-{3mu}{.1667em}");d("\\negthinspace","\\!");d("\\negmedspace","\\tmspace-{4mu}{.2222em}");d("\\negthickspace","\\tmspace-{5mu}{.277em}");d("\\enspace","\\kern.5em ");d("\\enskip","\\hskip.5em\\relax");d("\\quad","\\hskip1em\\relax");d("\\qquad","\\hskip2em\\relax");d("\\tag","\\@ifstar\\tag@literal\\tag@paren");d("\\tag@paren","\\tag@literal{({#1})}");d("\\tag@literal",r=>{if(r.macros.get("\\df@tag"))throw new T("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});d("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");d("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");d("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");d("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");d("\\newline","\\\\\\relax");d("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Bi=z(_0["Main-Regular"]["T".charCodeAt(0)][1]-.7*_0["Main-Regular"]["A".charCodeAt(0)][1]);d("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+Bi+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");d("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+Bi+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");d("\\hspace","\\@ifstar\\@hspacer\\@hspace");d("\\@hspace","\\hskip #1\\relax");d("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");d("\\ordinarycolon",":");d("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");d("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');d("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');d("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');d("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');d("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');d("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');d("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');d("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');d("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');d("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');d("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');d("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');d("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');d("\u2237","\\dblcolon");d("\u2239","\\eqcolon");d("\u2254","\\coloneqq");d("\u2255","\\eqqcolon");d("\u2A74","\\Coloneqq");d("\\ratio","\\vcentcolon");d("\\coloncolon","\\dblcolon");d("\\colonequals","\\coloneqq");d("\\coloncolonequals","\\Coloneqq");d("\\equalscolon","\\eqqcolon");d("\\equalscoloncolon","\\Eqqcolon");d("\\colonminus","\\coloneq");d("\\coloncolonminus","\\Coloneq");d("\\minuscolon","\\eqcolon");d("\\minuscoloncolon","\\Eqcolon");d("\\coloncolonapprox","\\Colonapprox");d("\\coloncolonsim","\\Colonsim");d("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");d("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");d("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");d("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");d("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220C}}");d("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");d("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");d("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");d("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");d("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");d("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");d("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");d("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");d("\\gvertneqq","\\html@mathml{\\@gvertneqq}{\u2269}");d("\\lvertneqq","\\html@mathml{\\@lvertneqq}{\u2268}");d("\\ngeqq","\\html@mathml{\\@ngeqq}{\u2271}");d("\\ngeqslant","\\html@mathml{\\@ngeqslant}{\u2271}");d("\\nleqq","\\html@mathml{\\@nleqq}{\u2270}");d("\\nleqslant","\\html@mathml{\\@nleqslant}{\u2270}");d("\\nshortmid","\\html@mathml{\\@nshortmid}{\u2224}");d("\\nshortparallel","\\html@mathml{\\@nshortparallel}{\u2226}");d("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{\u2288}");d("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{\u2289}");d("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{\u228A}");d("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{\u2ACB}");d("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{\u228B}");d("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{\u2ACC}");d("\\imath","\\html@mathml{\\@imath}{\u0131}");d("\\jmath","\\html@mathml{\\@jmath}{\u0237}");d("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27E6}}");d("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27E7}}");d("\u27E6","\\llbracket");d("\u27E7","\\rrbracket");d("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}");d("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}");d("\u2983","\\lBrace");d("\u2984","\\rBrace");d("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`\u29B5}}");d("\u29B5","\\minuso");d("\\darr","\\downarrow");d("\\dArr","\\Downarrow");d("\\Darr","\\Downarrow");d("\\lang","\\langle");d("\\rang","\\rangle");d("\\uarr","\\uparrow");d("\\uArr","\\Uparrow");d("\\Uarr","\\Uparrow");d("\\N","\\mathbb{N}");d("\\R","\\mathbb{R}");d("\\Z","\\mathbb{Z}");d("\\alef","\\aleph");d("\\alefsym","\\aleph");d("\\Alpha","\\mathrm{A}");d("\\Beta","\\mathrm{B}");d("\\bull","\\bullet");d("\\Chi","\\mathrm{X}");d("\\clubs","\\clubsuit");d("\\cnums","\\mathbb{C}");d("\\Complex","\\mathbb{C}");d("\\Dagger","\\ddagger");d("\\diamonds","\\diamondsuit");d("\\empty","\\emptyset");d("\\Epsilon","\\mathrm{E}");d("\\Eta","\\mathrm{H}");d("\\exist","\\exists");d("\\harr","\\leftrightarrow");d("\\hArr","\\Leftrightarrow");d("\\Harr","\\Leftrightarrow");d("\\hearts","\\heartsuit");d("\\image","\\Im");d("\\infin","\\infty");d("\\Iota","\\mathrm{I}");d("\\isin","\\in");d("\\Kappa","\\mathrm{K}");d("\\larr","\\leftarrow");d("\\lArr","\\Leftarrow");d("\\Larr","\\Leftarrow");d("\\lrarr","\\leftrightarrow");d("\\lrArr","\\Leftrightarrow");d("\\Lrarr","\\Leftrightarrow");d("\\Mu","\\mathrm{M}");d("\\natnums","\\mathbb{N}");d("\\Nu","\\mathrm{N}");d("\\Omicron","\\mathrm{O}");d("\\plusmn","\\pm");d("\\rarr","\\rightarrow");d("\\rArr","\\Rightarrow");d("\\Rarr","\\Rightarrow");d("\\real","\\Re");d("\\reals","\\mathbb{R}");d("\\Reals","\\mathbb{R}");d("\\Rho","\\mathrm{P}");d("\\sdot","\\cdot");d("\\sect","\\S");d("\\spades","\\spadesuit");d("\\sub","\\subset");d("\\sube","\\subseteq");d("\\supe","\\supseteq");d("\\Tau","\\mathrm{T}");d("\\thetasym","\\vartheta");d("\\weierp","\\wp");d("\\Zeta","\\mathrm{Z}");d("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");d("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");d("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");d("\\bra","\\mathinner{\\langle{#1}|}");d("\\ket","\\mathinner{|{#1}\\rangle}");d("\\braket","\\mathinner{\\langle{#1}\\rangle}");d("\\Bra","\\left\\langle#1\\right|");d("\\Ket","\\left|#1\\right\\rangle");var Di=r=>e=>{var t=e.consumeArg().tokens,a=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,l=e.macros.get("|"),u=e.macros.get("\\|");e.macros.beginGroup();var h=g=>b=>{r&&(b.macros.set("|",l),n.length&&b.macros.set("\\|",u));var x=g;if(!g&&n.length){var k=b.future();k.text==="|"&&(b.popToken(),x=!0)}return{tokens:x?n:a,numArgs:0}};e.macros.set("|",h(!1)),n.length&&e.macros.set("\\|",h(!0));var m=e.consumeArg().tokens,v=e.expandTokens([...i,...m,...t]);return e.macros.endGroup(),{tokens:v.reverse(),numArgs:0}};d("\\bra@ket",Di(!1));d("\\bra@set",Di(!0));d("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");d("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");d("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");d("\\angln","{\\angl n}");d("\\blue","\\textcolor{##6495ed}{#1}");d("\\orange","\\textcolor{##ffa500}{#1}");d("\\pink","\\textcolor{##ff00af}{#1}");d("\\red","\\textcolor{##df0030}{#1}");d("\\green","\\textcolor{##28ae7b}{#1}");d("\\gray","\\textcolor{gray}{#1}");d("\\purple","\\textcolor{##9d38bd}{#1}");d("\\blueA","\\textcolor{##ccfaff}{#1}");d("\\blueB","\\textcolor{##80f6ff}{#1}");d("\\blueC","\\textcolor{##63d9ea}{#1}");d("\\blueD","\\textcolor{##11accd}{#1}");d("\\blueE","\\textcolor{##0c7f99}{#1}");d("\\tealA","\\textcolor{##94fff5}{#1}");d("\\tealB","\\textcolor{##26edd5}{#1}");d("\\tealC","\\textcolor{##01d1c1}{#1}");d("\\tealD","\\textcolor{##01a995}{#1}");d("\\tealE","\\textcolor{##208170}{#1}");d("\\greenA","\\textcolor{##b6ffb0}{#1}");d("\\greenB","\\textcolor{##8af281}{#1}");d("\\greenC","\\textcolor{##74cf70}{#1}");d("\\greenD","\\textcolor{##1fab54}{#1}");d("\\greenE","\\textcolor{##0d923f}{#1}");d("\\goldA","\\textcolor{##ffd0a9}{#1}");d("\\goldB","\\textcolor{##ffbb71}{#1}");d("\\goldC","\\textcolor{##ff9c39}{#1}");d("\\goldD","\\textcolor{##e07d10}{#1}");d("\\goldE","\\textcolor{##a75a05}{#1}");d("\\redA","\\textcolor{##fca9a9}{#1}");d("\\redB","\\textcolor{##ff8482}{#1}");d("\\redC","\\textcolor{##f9685d}{#1}");d("\\redD","\\textcolor{##e84d39}{#1}");d("\\redE","\\textcolor{##bc2612}{#1}");d("\\maroonA","\\textcolor{##ffbde0}{#1}");d("\\maroonB","\\textcolor{##ff92c6}{#1}");d("\\maroonC","\\textcolor{##ed5fa6}{#1}");d("\\maroonD","\\textcolor{##ca337c}{#1}");d("\\maroonE","\\textcolor{##9e034e}{#1}");d("\\purpleA","\\textcolor{##ddd7ff}{#1}");d("\\purpleB","\\textcolor{##c6b9fc}{#1}");d("\\purpleC","\\textcolor{##aa87ff}{#1}");d("\\purpleD","\\textcolor{##7854ab}{#1}");d("\\purpleE","\\textcolor{##543b78}{#1}");d("\\mintA","\\textcolor{##f5f9e8}{#1}");d("\\mintB","\\textcolor{##edf2df}{#1}");d("\\mintC","\\textcolor{##e0e5cc}{#1}");d("\\grayA","\\textcolor{##f6f7f7}{#1}");d("\\grayB","\\textcolor{##f0f1f2}{#1}");d("\\grayC","\\textcolor{##e3e5e6}{#1}");d("\\grayD","\\textcolor{##d6d8da}{#1}");d("\\grayE","\\textcolor{##babec2}{#1}");d("\\grayF","\\textcolor{##888d93}{#1}");d("\\grayG","\\textcolor{##626569}{#1}");d("\\grayH","\\textcolor{##3b3e40}{#1}");d("\\grayI","\\textcolor{##21242c}{#1}");d("\\kaBlue","\\textcolor{##314453}{#1}");d("\\kaGreen","\\textcolor{##71B307}{#1}");var $i={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},Xr=class{constructor(e,t,a){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new Yr(G1,t.macros),this.mode=a,this.stack=[]}feed(e){this.lexer=new Xt(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,a,n;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:n,end:a}=this.consumeArg(["]"])}else({tokens:n,start:t,end:a}=this.consumeArg());return this.pushToken(new C0("EOF",a.loc)),this.pushTokens(n),t.range(a,"")}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var t=[],a=e&&e.length>0;a||this.consumeSpaces();var n=this.future(),i,l=0,u=0;do{if(i=this.popToken(),t.push(i),i.text==="{")++l;else if(i.text==="}"){if(--l,l===-1)throw new T("Extra }",i)}else if(i.text==="EOF")throw new T("Unexpected end of input in a macro argument, expected '"+(e&&a?e[u]:"}")+"'",i);if(e&&a)if((l===0||l===1&&e[u]==="{")&&i.text===e[u]){if(++u,u===e.length){t.splice(-u,u);break}}else u=0}while(l!==0||a);return n.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:n,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new T("The length of delimiters doesn't match the number of args!");for(var a=t[0],n=0;n<a.length;n++){var i=this.popToken();if(a[n]!==i.text)throw new T("Use of the macro doesn't match its definition",i)}}for(var l=[],u=0;u<e;u++)l.push(this.consumeArg(t&&t[u+1]).tokens);return l}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new T("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),a=t.text,n=t.noexpand?null:this._getExpansion(a);if(n==null||e&&n.unexpandable){if(e&&n==null&&a[0]==="\\"&&!this.isDefined(a))throw new T("Undefined control sequence: "+a);return this.pushToken(t),!1}this.countExpansion(1);var i=n.tokens,l=this.consumeArgs(n.numArgs,n.delimiters);if(n.numArgs){i=i.slice();for(var u=i.length-1;u>=0;--u){var h=i[u];if(h.text==="#"){if(u===0)throw new T("Incomplete placeholder at end of macro body",h);if(h=i[--u],h.text==="#")i.splice(u+1,1);else if(/^[1-9]$/.test(h.text))i.splice(u,2,...l[+h.text-1]);else throw new T("Not a valid argument number",h)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new C0(e)]):void 0}expandTokens(e){var t=[],a=this.stack.length;for(this.pushTokens(e);this.stack.length>a;)if(this.expandOnce(!0)===!1){var n=this.stack.pop();n.treatAsRelax&&(n.noexpand=!1,n.treatAsRelax=!1),t.push(n)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(a=>a.text).join("")}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var a=this.lexer.catcodes[e];if(a!=null&&a!==13)return}var n=typeof t=="function"?t(this):t;if(typeof n=="string"){var i=0;if(n.indexOf("#")!==-1)for(var l=n.replace(/##/g,"");l.indexOf("#"+(i+1))!==-1;)++i;for(var u=new Xt(n,this.settings),h=[],m=u.lex();m.text!=="EOF";)h.push(m),m=u.lex();h.reverse();var v={tokens:h,numArgs:i};return v}return n}isDefined(e){return this.macros.has(e)||se.hasOwnProperty(e)||K.math.hasOwnProperty(e)||K.text.hasOwnProperty(e)||$i.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:se.hasOwnProperty(e)&&!se[e].primitive}},qn=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Lt=Object.freeze({"\u208A":"+","\u208B":"-","\u208C":"=","\u208D":"(","\u208E":")","\u2080":"0","\u2081":"1","\u2082":"2","\u2083":"3","\u2084":"4","\u2085":"5","\u2086":"6","\u2087":"7","\u2088":"8","\u2089":"9","\u2090":"a","\u2091":"e","\u2095":"h","\u1D62":"i","\u2C7C":"j","\u2096":"k","\u2097":"l","\u2098":"m","\u2099":"n","\u2092":"o","\u209A":"p","\u1D63":"r","\u209B":"s","\u209C":"t","\u1D64":"u","\u1D65":"v","\u2093":"x","\u1D66":"\u03B2","\u1D67":"\u03B3","\u1D68":"\u03C1","\u1D69":"\u03D5","\u1D6A":"\u03C7","\u207A":"+","\u207B":"-","\u207C":"=","\u207D":"(","\u207E":")","\u2070":"0","\xB9":"1","\xB2":"2","\xB3":"3","\u2074":"4","\u2075":"5","\u2076":"6","\u2077":"7","\u2078":"8","\u2079":"9","\u1D2C":"A","\u1D2E":"B","\u1D30":"D","\u1D31":"E","\u1D33":"G","\u1D34":"H","\u1D35":"I","\u1D36":"J","\u1D37":"K","\u1D38":"L","\u1D39":"M","\u1D3A":"N","\u1D3C":"O","\u1D3E":"P","\u1D3F":"R","\u1D40":"T","\u1D41":"U","\u2C7D":"V","\u1D42":"W","\u1D43":"a","\u1D47":"b","\u1D9C":"c","\u1D48":"d","\u1D49":"e","\u1DA0":"f","\u1D4D":"g",\u02B0:"h","\u2071":"i",\u02B2:"j","\u1D4F":"k",\u02E1:"l","\u1D50":"m",\u207F:"n","\u1D52":"o","\u1D56":"p",\u02B3:"r",\u02E2:"s","\u1D57":"t","\u1D58":"u","\u1D5B":"v",\u02B7:"w",\u02E3:"x",\u02B8:"y","\u1DBB":"z","\u1D5D":"\u03B2","\u1D5E":"\u03B3","\u1D5F":"\u03B4","\u1D60":"\u03D5","\u1D61":"\u03C7","\u1DBF":"\u03B8"}),qr={"\u0301":{text:"\\'",math:"\\acute"},"\u0300":{text:"\\`",math:"\\grave"},"\u0308":{text:'\\"',math:"\\ddot"},"\u0303":{text:"\\~",math:"\\tilde"},"\u0304":{text:"\\=",math:"\\bar"},"\u0306":{text:"\\u",math:"\\breve"},"\u030C":{text:"\\v",math:"\\check"},"\u0302":{text:"\\^",math:"\\hat"},"\u0307":{text:"\\.",math:"\\dot"},"\u030A":{text:"\\r",math:"\\mathring"},"\u030B":{text:"\\H"},"\u0327":{text:"\\c"}},In={\u00E1:"a\u0301",\u00E0:"a\u0300",\u00E4:"a\u0308",\u01DF:"a\u0308\u0304",\u00E3:"a\u0303",\u0101:"a\u0304",\u0103:"a\u0306",\u1EAF:"a\u0306\u0301",\u1EB1:"a\u0306\u0300",\u1EB5:"a\u0306\u0303",\u01CE:"a\u030C",\u00E2:"a\u0302",\u1EA5:"a\u0302\u0301",\u1EA7:"a\u0302\u0300",\u1EAB:"a\u0302\u0303",\u0227:"a\u0307",\u01E1:"a\u0307\u0304",\u00E5:"a\u030A",\u01FB:"a\u030A\u0301",\u1E03:"b\u0307",\u0107:"c\u0301",\u1E09:"c\u0327\u0301",\u010D:"c\u030C",\u0109:"c\u0302",\u010B:"c\u0307",\u00E7:"c\u0327",\u010F:"d\u030C",\u1E0B:"d\u0307",\u1E11:"d\u0327",\u00E9:"e\u0301",\u00E8:"e\u0300",\u00EB:"e\u0308",\u1EBD:"e\u0303",\u0113:"e\u0304",\u1E17:"e\u0304\u0301",\u1E15:"e\u0304\u0300",\u0115:"e\u0306",\u1E1D:"e\u0327\u0306",\u011B:"e\u030C",\u00EA:"e\u0302",\u1EBF:"e\u0302\u0301",\u1EC1:"e\u0302\u0300",\u1EC5:"e\u0302\u0303",\u0117:"e\u0307",\u0229:"e\u0327",\u1E1F:"f\u0307",\u01F5:"g\u0301",\u1E21:"g\u0304",\u011F:"g\u0306",\u01E7:"g\u030C",\u011D:"g\u0302",\u0121:"g\u0307",\u0123:"g\u0327",\u1E27:"h\u0308",\u021F:"h\u030C",\u0125:"h\u0302",\u1E23:"h\u0307",\u1E29:"h\u0327",\u00ED:"i\u0301",\u00EC:"i\u0300",\u00EF:"i\u0308",\u1E2F:"i\u0308\u0301",\u0129:"i\u0303",\u012B:"i\u0304",\u012D:"i\u0306",\u01D0:"i\u030C",\u00EE:"i\u0302",\u01F0:"j\u030C",\u0135:"j\u0302",\u1E31:"k\u0301",\u01E9:"k\u030C",\u0137:"k\u0327",\u013A:"l\u0301",\u013E:"l\u030C",\u013C:"l\u0327",\u1E3F:"m\u0301",\u1E41:"m\u0307",\u0144:"n\u0301",\u01F9:"n\u0300",\u00F1:"n\u0303",\u0148:"n\u030C",\u1E45:"n\u0307",\u0146:"n\u0327",\u00F3:"o\u0301",\u00F2:"o\u0300",\u00F6:"o\u0308",\u022B:"o\u0308\u0304",\u00F5:"o\u0303",\u1E4D:"o\u0303\u0301",\u1E4F:"o\u0303\u0308",\u022D:"o\u0303\u0304",\u014D:"o\u0304",\u1E53:"o\u0304\u0301",\u1E51:"o\u0304\u0300",\u014F:"o\u0306",\u01D2:"o\u030C",\u00F4:"o\u0302",\u1ED1:"o\u0302\u0301",\u1ED3:"o\u0302\u0300",\u1ED7:"o\u0302\u0303",\u022F:"o\u0307",\u0231:"o\u0307\u0304",\u0151:"o\u030B",\u1E55:"p\u0301",\u1E57:"p\u0307",\u0155:"r\u0301",\u0159:"r\u030C",\u1E59:"r\u0307",\u0157:"r\u0327",\u015B:"s\u0301",\u1E65:"s\u0301\u0307",\u0161:"s\u030C",\u1E67:"s\u030C\u0307",\u015D:"s\u0302",\u1E61:"s\u0307",\u015F:"s\u0327",\u1E97:"t\u0308",\u0165:"t\u030C",\u1E6B:"t\u0307",\u0163:"t\u0327",\u00FA:"u\u0301",\u00F9:"u\u0300",\u00FC:"u\u0308",\u01D8:"u\u0308\u0301",\u01DC:"u\u0308\u0300",\u01D6:"u\u0308\u0304",\u01DA:"u\u0308\u030C",\u0169:"u\u0303",\u1E79:"u\u0303\u0301",\u016B:"u\u0304",\u1E7B:"u\u0304\u0308",\u016D:"u\u0306",\u01D4:"u\u030C",\u00FB:"u\u0302",\u016F:"u\u030A",\u0171:"u\u030B",\u1E7D:"v\u0303",\u1E83:"w\u0301",\u1E81:"w\u0300",\u1E85:"w\u0308",\u0175:"w\u0302",\u1E87:"w\u0307",\u1E98:"w\u030A",\u1E8D:"x\u0308",\u1E8B:"x\u0307",\u00FD:"y\u0301",\u1EF3:"y\u0300",\u00FF:"y\u0308",\u1EF9:"y\u0303",\u0233:"y\u0304",\u0177:"y\u0302",\u1E8F:"y\u0307",\u1E99:"y\u030A",\u017A:"z\u0301",\u017E:"z\u030C",\u1E91:"z\u0302",\u017C:"z\u0307",\u00C1:"A\u0301",\u00C0:"A\u0300",\u00C4:"A\u0308",\u01DE:"A\u0308\u0304",\u00C3:"A\u0303",\u0100:"A\u0304",\u0102:"A\u0306",\u1EAE:"A\u0306\u0301",\u1EB0:"A\u0306\u0300",\u1EB4:"A\u0306\u0303",\u01CD:"A\u030C",\u00C2:"A\u0302",\u1EA4:"A\u0302\u0301",\u1EA6:"A\u0302\u0300",\u1EAA:"A\u0302\u0303",\u0226:"A\u0307",\u01E0:"A\u0307\u0304",\u00C5:"A\u030A",\u01FA:"A\u030A\u0301",\u1E02:"B\u0307",\u0106:"C\u0301",\u1E08:"C\u0327\u0301",\u010C:"C\u030C",\u0108:"C\u0302",\u010A:"C\u0307",\u00C7:"C\u0327",\u010E:"D\u030C",\u1E0A:"D\u0307",\u1E10:"D\u0327",\u00C9:"E\u0301",\u00C8:"E\u0300",\u00CB:"E\u0308",\u1EBC:"E\u0303",\u0112:"E\u0304",\u1E16:"E\u0304\u0301",\u1E14:"E\u0304\u0300",\u0114:"E\u0306",\u1E1C:"E\u0327\u0306",\u011A:"E\u030C",\u00CA:"E\u0302",\u1EBE:"E\u0302\u0301",\u1EC0:"E\u0302\u0300",\u1EC4:"E\u0302\u0303",\u0116:"E\u0307",\u0228:"E\u0327",\u1E1E:"F\u0307",\u01F4:"G\u0301",\u1E20:"G\u0304",\u011E:"G\u0306",\u01E6:"G\u030C",\u011C:"G\u0302",\u0120:"G\u0307",\u0122:"G\u0327",\u1E26:"H\u0308",\u021E:"H\u030C",\u0124:"H\u0302",\u1E22:"H\u0307",\u1E28:"H\u0327",\u00CD:"I\u0301",\u00CC:"I\u0300",\u00CF:"I\u0308",\u1E2E:"I\u0308\u0301",\u0128:"I\u0303",\u012A:"I\u0304",\u012C:"I\u0306",\u01CF:"I\u030C",\u00CE:"I\u0302",\u0130:"I\u0307",\u0134:"J\u0302",\u1E30:"K\u0301",\u01E8:"K\u030C",\u0136:"K\u0327",\u0139:"L\u0301",\u013D:"L\u030C",\u013B:"L\u0327",\u1E3E:"M\u0301",\u1E40:"M\u0307",\u0143:"N\u0301",\u01F8:"N\u0300",\u00D1:"N\u0303",\u0147:"N\u030C",\u1E44:"N\u0307",\u0145:"N\u0327",\u00D3:"O\u0301",\u00D2:"O\u0300",\u00D6:"O\u0308",\u022A:"O\u0308\u0304",\u00D5:"O\u0303",\u1E4C:"O\u0303\u0301",\u1E4E:"O\u0303\u0308",\u022C:"O\u0303\u0304",\u014C:"O\u0304",\u1E52:"O\u0304\u0301",\u1E50:"O\u0304\u0300",\u014E:"O\u0306",\u01D1:"O\u030C",\u00D4:"O\u0302",\u1ED0:"O\u0302\u0301",\u1ED2:"O\u0302\u0300",\u1ED6:"O\u0302\u0303",\u022E:"O\u0307",\u0230:"O\u0307\u0304",\u0150:"O\u030B",\u1E54:"P\u0301",\u1E56:"P\u0307",\u0154:"R\u0301",\u0158:"R\u030C",\u1E58:"R\u0307",\u0156:"R\u0327",\u015A:"S\u0301",\u1E64:"S\u0301\u0307",\u0160:"S\u030C",\u1E66:"S\u030C\u0307",\u015C:"S\u0302",\u1E60:"S\u0307",\u015E:"S\u0327",\u0164:"T\u030C",\u1E6A:"T\u0307",\u0162:"T\u0327",\u00DA:"U\u0301",\u00D9:"U\u0300",\u00DC:"U\u0308",\u01D7:"U\u0308\u0301",\u01DB:"U\u0308\u0300",\u01D5:"U\u0308\u0304",\u01D9:"U\u0308\u030C",\u0168:"U\u0303",\u1E78:"U\u0303\u0301",\u016A:"U\u0304",\u1E7A:"U\u0304\u0308",\u016C:"U\u0306",\u01D3:"U\u030C",\u00DB:"U\u0302",\u016E:"U\u030A",\u0170:"U\u030B",\u1E7C:"V\u0303",\u1E82:"W\u0301",\u1E80:"W\u0300",\u1E84:"W\u0308",\u0174:"W\u0302",\u1E86:"W\u0307",\u1E8C:"X\u0308",\u1E8A:"X\u0307",\u00DD:"Y\u0301",\u1EF2:"Y\u0300",\u0178:"Y\u0308",\u1EF8:"Y\u0303",\u0232:"Y\u0304",\u0176:"Y\u0302",\u1E8E:"Y\u0307",\u0179:"Z\u0301",\u017D:"Z\u030C",\u1E90:"Z\u0302",\u017B:"Z\u0307",\u03AC:"\u03B1\u0301",\u1F70:"\u03B1\u0300",\u1FB1:"\u03B1\u0304",\u1FB0:"\u03B1\u0306",\u03AD:"\u03B5\u0301",\u1F72:"\u03B5\u0300",\u03AE:"\u03B7\u0301",\u1F74:"\u03B7\u0300",\u03AF:"\u03B9\u0301",\u1F76:"\u03B9\u0300",\u03CA:"\u03B9\u0308",\u0390:"\u03B9\u0308\u0301",\u1FD2:"\u03B9\u0308\u0300",\u1FD1:"\u03B9\u0304",\u1FD0:"\u03B9\u0306",\u03CC:"\u03BF\u0301",\u1F78:"\u03BF\u0300",\u03CD:"\u03C5\u0301",\u1F7A:"\u03C5\u0300",\u03CB:"\u03C5\u0308",\u03B0:"\u03C5\u0308\u0301",\u1FE2:"\u03C5\u0308\u0300",\u1FE1:"\u03C5\u0304",\u1FE0:"\u03C5\u0306",\u03CE:"\u03C9\u0301",\u1F7C:"\u03C9\u0300",\u038E:"\u03A5\u0301",\u1FEA:"\u03A5\u0300",\u03AB:"\u03A5\u0308",\u1FE9:"\u03A5\u0304",\u1FE8:"\u03A5\u0306",\u038F:"\u03A9\u0301",\u1FFA:"\u03A9\u0300"},Zt=class r{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Xr(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new T("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new C0("}")),this.gullet.pushTokens(e);var a=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,a}parseExpression(e,t){for(var a=[];;){this.mode==="math"&&this.consumeSpaces();var n=this.fetch();if(r.endOfExpression.indexOf(n.text)!==-1||t&&n.text===t||e&&se[n.text]&&se[n.text].infix)break;var i=this.parseAtom(t);if(i){if(i.type==="internal")continue}else break;a.push(i)}return this.mode==="text"&&this.formLigatures(a),this.handleInfixNodes(a)}handleInfixNodes(e){for(var t=-1,a,n=0;n<e.length;n++)if(e[n].type==="infix"){if(t!==-1)throw new T("only one infix operator per group",e[n].token);t=n,a=e[n].replaceWith}if(t!==-1&&a){var i,l,u=e.slice(0,t),h=e.slice(t+1);u.length===1&&u[0].type==="ordgroup"?i=u[0]:i={type:"ordgroup",mode:this.mode,body:u},h.length===1&&h[0].type==="ordgroup"?l=h[0]:l={type:"ordgroup",mode:this.mode,body:h};var m;return a==="\\\\abovefrac"?m=this.callFunction(a,[i,e[t],l],[]):m=this.callFunction(a,[i,l],[]),[m]}else return e}handleSupSubscript(e){var t=this.fetch(),a=t.text;this.consume(),this.consumeSpaces();var n=this.parseGroup(e);if(!n)throw new T("Expected group after '"+a+"'",t);return n}formatUnsupportedCmd(e){for(var t=[],a=0;a<e.length;a++)t.push({type:"textord",mode:"text",text:e[a]});var n={type:"text",mode:this.mode,body:t},i={type:"color",mode:this.mode,color:this.settings.errorColor,body:[n]};return i}parseAtom(e){var t=this.parseGroup("atom",e);if(this.mode==="text")return t;for(var a,n;;){this.consumeSpaces();var i=this.fetch();if(i.text==="\\limits"||i.text==="\\nolimits"){if(t&&t.type==="op"){var l=i.text==="\\limits";t.limits=l,t.alwaysHandleSupSub=!0}else if(t&&t.type==="operatorname")t.alwaysHandleSupSub&&(t.limits=i.text==="\\limits");else throw new T("Limit controls must follow a math operator",i);this.consume()}else if(i.text==="^"){if(a)throw new T("Double superscript",i);a=this.handleSupSubscript("superscript")}else if(i.text==="_"){if(n)throw new T("Double subscript",i);n=this.handleSupSubscript("subscript")}else if(i.text==="'"){if(a)throw new T("Double superscript",i);var u={type:"textord",mode:this.mode,text:"\\prime"},h=[u];for(this.consume();this.fetch().text==="'";)h.push(u),this.consume();this.fetch().text==="^"&&h.push(this.handleSupSubscript("superscript")),a={type:"ordgroup",mode:this.mode,body:h}}else if(Lt[i.text]){var m=qn.test(i.text),v=[];for(v.push(new C0(Lt[i.text])),this.consume();;){var g=this.fetch().text;if(!Lt[g]||qn.test(g)!==m)break;v.unshift(new C0(Lt[g])),this.consume()}var b=this.subparse(v);m?n={type:"ordgroup",mode:"math",body:b}:a={type:"ordgroup",mode:"math",body:b}}else break}return a||n?{type:"supsub",mode:this.mode,base:t,sup:a,sub:n}:t}parseFunction(e,t){var a=this.fetch(),n=a.text,i=se[n];if(!i)return null;if(this.consume(),t&&t!=="atom"&&!i.allowedInArgument)throw new T("Got function '"+n+"' with no arguments"+(t?" as "+t:""),a);if(this.mode==="text"&&!i.allowedInText)throw new T("Can't use function '"+n+"' in text mode",a);if(this.mode==="math"&&i.allowedInMath===!1)throw new T("Can't use function '"+n+"' in math mode",a);var{args:l,optArgs:u}=this.parseArguments(n,i);return this.callFunction(n,l,u,a,e)}callFunction(e,t,a,n,i){var l={funcName:e,parser:this,token:n,breakOnTokenText:i},u=se[e];if(u&&u.handler)return u.handler(l,t,a);throw new T("No function handler for "+e)}parseArguments(e,t){var a=t.numArgs+t.numOptionalArgs;if(a===0)return{args:[],optArgs:[]};for(var n=[],i=[],l=0;l<a;l++){var u=t.argTypes&&t.argTypes[l],h=l<t.numOptionalArgs;(t.primitive&&u==null||t.type==="sqrt"&&l===1&&i[0]==null)&&(u="primitive");var m=this.parseGroupOfType("argument to '"+e+"'",u,h);if(h)i.push(m);else if(m!=null)n.push(m);else throw new T("Null argument, please report this as a bug")}return{args:n,optArgs:i}}parseGroupOfType(e,t,a){switch(t){case"color":return this.parseColorGroup(a);case"size":return this.parseSizeGroup(a);case"url":return this.parseUrlGroup(a);case"math":case"text":return this.parseArgumentGroup(a,t);case"hbox":{var n=this.parseArgumentGroup(a,"text");return n!=null?{type:"styling",mode:n.mode,body:[n],style:"text"}:null}case"raw":{var i=this.parseStringGroup("raw",a);return i!=null?{type:"raw",mode:"text",string:i.text}:null}case"primitive":{if(a)throw new T("A primitive argument cannot be optional");var l=this.parseGroup(e);if(l==null)throw new T("Expected group as "+e,this.fetch());return l}case"original":case null:case void 0:return this.parseArgumentGroup(a);default:throw new T("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(e,t){var a=this.gullet.scanArgument(t);if(a==null)return null;for(var n="",i;(i=this.fetch()).text!=="EOF";)n+=i.text,this.consume();return this.consume(),a.text=n,a}parseRegexGroup(e,t){for(var a=this.fetch(),n=a,i="",l;(l=this.fetch()).text!=="EOF"&&e.test(i+l.text);)n=l,i+=n.text,this.consume();if(i==="")throw new T("Invalid "+t+": '"+a.text+"'",a);return a.range(n,i)}parseColorGroup(e){var t=this.parseStringGroup("color",e);if(t==null)return null;var a=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!a)throw new T("Invalid color: '"+t.text+"'",t);var n=a[0];return/^[0-9a-f]{6}$/i.test(n)&&(n="#"+n),{type:"color-token",mode:this.mode,color:n}}parseSizeGroup(e){var t,a=!1;if(this.gullet.consumeSpaces(),!e&&this.gullet.future().text!=="{"?t=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):t=this.parseStringGroup("size",e),!t)return null;!e&&t.text.length===0&&(t.text="0pt",a=!0);var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!n)throw new T("Invalid size: '"+t.text+"'",t);var i={number:+(n[1]+n[2]),unit:n[3]};if(!jn(i))throw new T("Invalid unit: '"+i.unit+"'",t);return{type:"size",mode:this.mode,value:i,isBlank:a}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),t==null)return null;var a=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:a}}parseArgumentGroup(e,t){var a=this.gullet.scanArgument(e);if(a==null)return null;var n=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var i=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var l={type:"ordgroup",mode:this.mode,loc:a.loc,body:i};return t&&this.switchMode(n),l}parseGroup(e,t){var a=this.fetch(),n=a.text,i;if(n==="{"||n==="\\begingroup"){this.consume();var l=n==="{"?"}":"\\endgroup";this.gullet.beginGroup();var u=this.parseExpression(!1,l),h=this.fetch();this.expect(l),this.gullet.endGroup(),i={type:"ordgroup",mode:this.mode,loc:A0.range(a,h),body:u,semisimple:n==="\\begingroup"||void 0}}else if(i=this.parseFunction(t,e)||this.parseSymbol(),i==null&&n[0]==="\\"&&!$i.hasOwnProperty(n)){if(this.settings.throwOnError)throw new T("Undefined control sequence: "+n,a);i=this.formatUnsupportedCmd(n),this.consume()}return i}formLigatures(e){for(var t=e.length-1,a=0;a<t;++a){var n=e[a],i=n.text;i==="-"&&e[a+1].text==="-"&&(a+1<t&&e[a+2].text==="-"?(e.splice(a,3,{type:"textord",mode:"text",loc:A0.range(n,e[a+2]),text:"---"}),t-=2):(e.splice(a,2,{type:"textord",mode:"text",loc:A0.range(n,e[a+1]),text:"--"}),t-=1)),(i==="'"||i==="`")&&e[a+1].text===i&&(e.splice(a,2,{type:"textord",mode:"text",loc:A0.range(n,e[a+1]),text:i+i}),t-=1)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var a=t.slice(5),n=a.charAt(0)==="*";if(n&&(a=a.slice(1)),a.length<2||a.charAt(0)!==a.slice(-1))throw new T(`\\verb assertion failed -- 688 - please report what input caused this bug`);return a=a.slice(1,-1),{type:"verb",mode:"text",body:a,star:n}}In.hasOwnProperty(t[0])&&!K[this.mode][t[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=In[t[0]]+t.slice(1));var i=V1.exec(t);i&&(t=t.substring(0,i.index),t==="i"?t="\u0131":t==="j"&&(t="\u0237"));var l;if(K[this.mode][t]){this.settings.strict&&this.mode==="math"&&jr.indexOf(t)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var u=K[this.mode][t].group,h=A0.range(e),m;if(Hs.hasOwnProperty(u)){var v=u;m={type:"atom",mode:this.mode,family:v,loc:h,text:t}}else m={type:u,mode:this.mode,loc:h,text:t};l=m}else if(t.charCodeAt(0)>=128)this.settings.strict&&(Ln(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),e)),l={type:"textord",mode:"text",loc:A0.range(e),text:t};else return null;if(this.consume(),i)for(var g=0;g<i[0].length;g++){var b=i[0][g];if(!qr[b])throw new T("Unknown accent ' "+b+"'",e);var x=qr[b][this.mode]||qr[b].text;if(!x)throw new T("Accent "+b+" unsupported in "+this.mode+" mode",e);l={type:"accent",mode:this.mode,loc:A0.range(e),label:x,isStretchy:!1,isShifty:!0,base:l}}return l}};Zt.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var ma=function(e,t){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var a=new Zt(e,t);delete a.gullet.macros.current["\\df@tag"];var n=a.parse();if(delete a.gullet.macros.current["\\current@color"],delete a.gullet.macros.current["\\color"],a.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new T("\\tag works only in display equations");n=[{type:"tag",mode:"text",body:n,tag:a.subparse([new C0("\\df@tag")])}]}return n},Ni=function(e,t,a){t.textContent="";var n=fa(e,a).toNode();t.appendChild(n)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Ni=function(){throw new T("KaTeX doesn't work in quirks mode.")});var K1=function(e,t){var a=fa(e,t).toMarkup();return a},W1=function(e,t){var a=new et(t);return ma(e,a)},Oi=function(e,t,a){if(a.throwOnError||!(e instanceof T))throw e;var n=w.makeSpan(["katex-error"],[new w0(t)]);return n.setAttribute("title",e.toString()),n.setAttribute("style","color:"+a.errorColor),n},fa=function(e,t){var a=new et(t);try{var n=ma(e,a);return i1(n,e,a)}catch(i){return Oi(i,e,a)}},Y1=function(e,t){var a=new et(t);try{var n=ma(e,a);return s1(n,e,a)}catch(i){return Oi(i,e,a)}},pa={version:"0.16.11",render:Ni,renderToString:K1,ParseError:T,SETTINGS_SCHEMA:jt,__parse:W1,__renderToDomTree:fa,__renderToHTMLTree:Y1,__setFontMetrics:Ds,__defineSymbol:s,__defineFunction:E,__defineMacro:d,__domTree:{Span:we,Anchor:rt,SymbolNode:w0,SvgNode:N0,PathNode:H0,LineNode:at}};var X1=function(e,t,a){for(var n=a,i=0,l=e.length;n<t.length;){var u=t[n];if(i<=0&&t.slice(n,n+l)===e)return n;u==="\\"?n++:u==="{"?i++:u==="}"&&i--,n++}return-1},Z1=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")},J1=/^\\begin{/,Q1=function(e,t){for(var a,n=[],i=new RegExp("("+t.map(m=>Z1(m.left)).join("|")+")");a=e.search(i),a!==-1;){a>0&&(n.push({type:"text",data:e.slice(0,a)}),e=e.slice(a));var l=t.findIndex(m=>e.startsWith(m.left));if(a=X1(t[l].right,e,t[l].left.length),a===-1)break;var u=e.slice(0,a+t[l].right.length),h=J1.test(u)?u:e.slice(t[l].left.length,a);n.push({type:"math",data:h,rawData:u,display:t[l].display}),e=e.slice(a+t[l].right.length)}return e!==""&&n.push({type:"text",data:e}),n},el=function(e,t){var a=Q1(e,t.delimiters);if(a.length===1&&a[0].type==="text")return null;for(var n=document.createDocumentFragment(),i=0;i<a.length;i++)if(a[i].type==="text")n.appendChild(document.createTextNode(a[i].data));else{var l=document.createElement("span"),u=a[i].data;t.displayMode=a[i].display;try{t.preProcess&&(u=t.preProcess(u)),pa.render(u,l,t)}catch(h){if(!(h instanceof pa.ParseError))throw h;t.errorCallback("KaTeX auto-render: Failed to parse `"+a[i].data+"` with ",h),n.appendChild(document.createTextNode(a[i].rawData));continue}n.appendChild(l)}return n},tl=function r(e,t){for(var a=0;a<e.childNodes.length;a++){var n=e.childNodes[a];if(n.nodeType===3){for(var i=n.textContent,l=n.nextSibling,u=0;l&&l.nodeType===Node.TEXT_NODE;)i+=l.textContent,l=l.nextSibling,u++;var h=el(i,t);if(h){for(var m=0;m<u;m++)n.nextSibling.remove();a+=h.childNodes.length-1,e.replaceChild(h,n)}else a+=u}else n.nodeType===1&&function(){var v=" "+n.className+" ",g=t.ignoredTags.indexOf(n.nodeName.toLowerCase())===-1&&t.ignoredClasses.every(b=>v.indexOf(" "+b+" ")===-1);g&&r(n,t)}()}},Ri=function(e,t){if(!e)throw new Error("No element provided to render");var a={};for(var n in t)t.hasOwnProperty(n)&&(a[n]=t[n]);a.delimiters=a.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}],a.ignoredTags=a.ignoredTags||["script","noscript","style","textarea","pre","code","option"],a.ignoredClasses=a.ignoredClasses||[],a.errorCallback=a.errorCallback||console.error,a.macros=a.macros||{},tl(e,a)};function rl(r,e){return r.reduce(([t,a],n)=>e(n)?[[...t,n],a]:[t,[...a,n]],[[],[]])}window.addEventListener("load",r=>{Ri(document.body);let e=a=>{for(;a!=null;)a.nodeName=="DETAILS"&&(a.open=!0),a=a.parentNode},t=a=>{if(a.target.tagName==="A")return;let i=a.target.closest("span[data-target]").getAttribute("data-target"),l=document.querySelector(i);e(l),window.location=i};[...document.querySelectorAll("[data-target^='#']")].forEach(a=>a.addEventListener("click",t))});var al=document.querySelector("ninja-keys");fetch("./forest.json").then(r=>r.json()).then(r=>{let e=[],t='<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path d="M480-120v-71l216-216 71 71-216 216h-71ZM120-330v-60h300v60H120Zm690-49-71-71 29-29q8-8 21-8t21 8l29 29q8 8 8 21t-8 21l-29 29ZM120-495v-60h470v60H120Zm0-165v-60h470v60H120Z"/></svg>',a='<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path d="M120-40v-700q0-24 18-42t42-18h480q24 0 42.5 18t18.5 42v700L420-167 120-40Zm60-91 240-103 240 103v-609H180v609Zm600 1v-730H233v-60h547q24 0 42 18t18 42v730h-60ZM180-740h480-480Z"/></svg>';window.sourcePath&&e.push({id:"edit",title:"Edit current tree in Visual Studio Code",section:"Commands",hotkey:"cmd+e",icon:t,handler:()=>{window.location.href=`vscode://file/${window.sourcePath}`}});let n=h=>{let m=r[h];return m.tags?m.tags.includes("top"):!1},i=(h,m,v)=>{let g=r[h],x=`${g.taxon?g.title?`${g.taxon}. ${g.title}`:g.taxon:g.title?g.title:"Untitled"} [${h}]`;e.push({id:h,title:x,section:m,icon:v,handler:()=>{window.location.href=g.route}})},[l,u]=rl(Object.keys(r),n);l.forEach(h=>i(h,"Top Trees",a)),u.forEach(h=>i(h,"All Trees",null)),al.data=e});})(); 689 - /*! Bundled license information: 690 - 691 - @lit/reactive-element/css-tag.js: 692 - (** 693 - * @license 694 - * Copyright 2019 Google LLC 695 - * SPDX-License-Identifier: BSD-3-Clause 696 - *) 697 - 698 - @lit/reactive-element/reactive-element.js: 699 - (** 700 - * @license 701 - * Copyright 2017 Google LLC 702 - * SPDX-License-Identifier: BSD-3-Clause 703 - *) 704 - 705 - lit-html/lit-html.js: 706 - (** 707 - * @license 708 - * Copyright 2017 Google LLC 709 - * SPDX-License-Identifier: BSD-3-Clause 710 - *) 711 - 712 - lit-element/lit-element.js: 713 - (** 714 - * @license 715 - * Copyright 2017 Google LLC 716 - * SPDX-License-Identifier: BSD-3-Clause 717 - *) 718 - 719 - @lit/reactive-element/decorators/custom-element.js: 720 - (** 721 - * @license 722 - * Copyright 2017 Google LLC 723 - * SPDX-License-Identifier: BSD-3-Clause 724 - *) 725 - 726 - @lit/reactive-element/decorators/property.js: 727 - (** 728 - * @license 729 - * Copyright 2017 Google LLC 730 - * SPDX-License-Identifier: BSD-3-Clause 731 - *) 732 - 733 - @lit/reactive-element/decorators/state.js: 734 - (** 735 - * @license 736 - * Copyright 2017 Google LLC 737 - * SPDX-License-Identifier: BSD-3-Clause 738 - *) 739 - 740 - @lit/reactive-element/decorators/base.js: 741 - (** 742 - * @license 743 - * Copyright 2017 Google LLC 744 - * SPDX-License-Identifier: BSD-3-Clause 745 - *) 746 - 747 - @lit/reactive-element/decorators/event-options.js: 748 - (** 749 - * @license 750 - * Copyright 2017 Google LLC 751 - * SPDX-License-Identifier: BSD-3-Clause 752 - *) 753 - 754 - @lit/reactive-element/decorators/query.js: 755 - (** 756 - * @license 757 - * Copyright 2017 Google LLC 758 - * SPDX-License-Identifier: BSD-3-Clause 759 - *) 760 - 761 - @lit/reactive-element/decorators/query-all.js: 762 - (** 763 - * @license 764 - * Copyright 2017 Google LLC 765 - * SPDX-License-Identifier: BSD-3-Clause 766 - *) 767 - 768 - @lit/reactive-element/decorators/query-async.js: 769 - (** 770 - * @license 771 - * Copyright 2017 Google LLC 772 - * SPDX-License-Identifier: BSD-3-Clause 773 - *) 774 - 775 - @lit/reactive-element/decorators/query-assigned-elements.js: 776 - (** 777 - * @license 778 - * Copyright 2021 Google LLC 779 - * SPDX-License-Identifier: BSD-3-Clause 780 - *) 781 - 782 - @lit/reactive-element/decorators/query-assigned-nodes.js: 783 - (** 784 - * @license 785 - * Copyright 2017 Google LLC 786 - * SPDX-License-Identifier: BSD-3-Clause 787 - *) 788 - 789 - lit-html/directive.js: 790 - (** 791 - * @license 792 - * Copyright 2017 Google LLC 793 - * SPDX-License-Identifier: BSD-3-Clause 794 - *) 795 - 796 - lit-html/directive-helpers.js: 797 - (** 798 - * @license 799 - * Copyright 2020 Google LLC 800 - * SPDX-License-Identifier: BSD-3-Clause 801 - *) 802 - 803 - lit-html/directives/repeat.js: 804 - (** 805 - * @license 806 - * Copyright 2017 Google LLC 807 - * SPDX-License-Identifier: BSD-3-Clause 808 - *) 809 - 810 - lit-html/directives/live.js: 811 - (** 812 - * @license 813 - * Copyright 2020 Google LLC 814 - * SPDX-License-Identifier: BSD-3-Clause 815 - *) 816 - 817 - lit-html/async-directive.js: 818 - (** 819 - * @license 820 - * Copyright 2017 Google LLC 821 - * SPDX-License-Identifier: BSD-3-Clause 822 - *) 823 - 824 - lit-html/directives/ref.js: 825 - (** 826 - * @license 827 - * Copyright 2020 Google LLC 828 - * SPDX-License-Identifier: BSD-3-Clause 829 - *) 830 - 831 - lit-html/directives/class-map.js: 832 - (** 833 - * @license 834 - * Copyright 2018 Google LLC 835 - * SPDX-License-Identifier: BSD-3-Clause 836 - *) 837 - 838 - hotkeys-js/dist/hotkeys.esm.js: 839 - (*! 840 - * hotkeys-js v3.8.7 841 - * A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies. 842 - * 843 - * Copyright (c) 2021 kenny wong <wowohoo@qq.com> 844 - * http://jaywcjlove.github.io/hotkeys 845 - * 846 - * Licensed under the MIT license. 847 - *) 848 - 849 - lit-html/directives/unsafe-html.js: 850 - (** 851 - * @license 852 - * Copyright 2017 Google LLC 853 - * SPDX-License-Identifier: BSD-3-Clause 854 - *) 855 - 856 - lit-html/directives/join.js: 857 - (** 858 - * @license 859 - * Copyright 2021 Google LLC 860 - * SPDX-License-Identifier: BSD-3-Clause 861 - *) 862 - 863 - @material/mwc-icon/mwc-icon-host.css.js: 864 - (** 865 - * @license 866 - * Copyright 2021 Google LLC 867 - * SPDX-LIcense-Identifier: Apache-2.0 868 - *) 869 - 870 - @material/mwc-icon/mwc-icon.js: 871 - (** 872 - * @license 873 - * Copyright 2018 Google LLC 874 - * SPDX-License-Identifier: Apache-2.0 875 - *) 876 - */
-5829
bin/forester/theme/htmx.js
··· 1 - var htmx = (function () { 2 - "use strict"; 3 - 4 - // Public API 5 - const htmx = { 6 - // Tsc madness here, assigning the functions directly results in an invalid TypeScript output, but reassigning is fine 7 - /* Event processing */ 8 - /** @type {typeof onLoadHelper} */ 9 - onLoad: null, 10 - /** @type {typeof processNode} */ 11 - process: null, 12 - /** @type {typeof addEventListenerImpl} */ 13 - on: null, 14 - /** @type {typeof removeEventListenerImpl} */ 15 - off: null, 16 - /** @type {typeof triggerEvent} */ 17 - trigger: null, 18 - /** @type {typeof ajaxHelper} */ 19 - ajax: null, 20 - /* DOM querying helpers */ 21 - /** @type {typeof find} */ 22 - find: null, 23 - /** @type {typeof findAll} */ 24 - findAll: null, 25 - /** @type {typeof closest} */ 26 - closest: null, 27 - /** 28 - * Returns the input values that would resolve for a given element via the htmx value resolution mechanism 29 - * 30 - * @see https://htmx.org/api/#values 31 - * 32 - * @param {Element} elt the element to resolve values on 33 - * @param {HttpVerb} type the request type (e.g. **get** or **post**) non-GET's will include the enclosing form of the element. Defaults to **post** 34 - * @returns {Object} 35 - */ 36 - values: function (elt, type) { 37 - const inputValues = getInputValues(elt, type || "post"); 38 - return inputValues.values; 39 - }, 40 - /* DOM manipulation helpers */ 41 - /** @type {typeof removeElement} */ 42 - remove: null, 43 - /** @type {typeof addClassToElement} */ 44 - addClass: null, 45 - /** @type {typeof removeClassFromElement} */ 46 - removeClass: null, 47 - /** @type {typeof toggleClassOnElement} */ 48 - toggleClass: null, 49 - /** @type {typeof takeClassForElement} */ 50 - takeClass: null, 51 - /** @type {typeof swap} */ 52 - swap: null, 53 - /* Extension entrypoints */ 54 - /** @type {typeof defineExtension} */ 55 - defineExtension: null, 56 - /** @type {typeof removeExtension} */ 57 - removeExtension: null, 58 - /* Debugging */ 59 - /** @type {typeof logAll} */ 60 - logAll: null, 61 - /** @type {typeof logNone} */ 62 - logNone: null, 63 - /* Debugging */ 64 - /** 65 - * The logger htmx uses to log with 66 - * 67 - * @see https://htmx.org/api/#logger 68 - */ 69 - logger: null, 70 - /** 71 - * A property holding the configuration htmx uses at runtime. 72 - * 73 - * Note that using a [meta tag](https://htmx.org/docs/#config) is the preferred mechanism for setting these properties. 74 - * 75 - * @see https://htmx.org/api/#config 76 - */ 77 - config: { 78 - /** 79 - * Whether to use history. 80 - * @type boolean 81 - * @default true 82 - */ 83 - historyEnabled: true, 84 - /** 85 - * The number of pages to keep in **localStorage** for history support. 86 - * @type number 87 - * @default 10 88 - */ 89 - historyCacheSize: 10, 90 - /** 91 - * @type boolean 92 - * @default false 93 - */ 94 - refreshOnHistoryMiss: false, 95 - /** 96 - * The default swap style to use if **[hx-swap](https://htmx.org/attributes/hx-swap)** is omitted. 97 - * @type HtmxSwapStyle 98 - * @default 'innerHTML' 99 - */ 100 - defaultSwapStyle: "innerHTML", 101 - /** 102 - * The default delay between receiving a response from the server and doing the swap. 103 - * @type number 104 - * @default 0 105 - */ 106 - defaultSwapDelay: 0, 107 - /** 108 - * The default delay between completing the content swap and settling attributes. 109 - * @type number 110 - * @default 20 111 - */ 112 - defaultSettleDelay: 20, 113 - /** 114 - * If true, htmx will inject a small amount of CSS into the page to make indicators invisible unless the **htmx-indicator** class is present. 115 - * @type boolean 116 - * @default true 117 - */ 118 - includeIndicatorStyles: true, 119 - /** 120 - * The class to place on indicators when a request is in flight. 121 - * @type string 122 - * @default 'htmx-indicator' 123 - */ 124 - indicatorClass: "htmx-indicator", 125 - /** 126 - * The class to place on triggering elements when a request is in flight. 127 - * @type string 128 - * @default 'htmx-request' 129 - */ 130 - requestClass: "htmx-request", 131 - /** 132 - * The class to temporarily place on elements that htmx has added to the DOM. 133 - * @type string 134 - * @default 'htmx-added' 135 - */ 136 - addedClass: "htmx-added", 137 - /** 138 - * The class to place on target elements when htmx is in the settling phase. 139 - * @type string 140 - * @default 'htmx-settling' 141 - */ 142 - settlingClass: "htmx-settling", 143 - /** 144 - * The class to place on target elements when htmx is in the swapping phase. 145 - * @type string 146 - * @default 'htmx-swapping' 147 - */ 148 - swappingClass: "htmx-swapping", 149 - /** 150 - * Allows the use of eval-like functionality in htmx, to enable **hx-vars**, trigger conditions & script tag evaluation. Can be set to **false** for CSP compatibility. 151 - * @type boolean 152 - * @default true 153 - */ 154 - allowEval: true, 155 - /** 156 - * If set to false, disables the interpretation of script tags. 157 - * @type boolean 158 - * @default true 159 - */ 160 - allowScriptTags: true, 161 - /** 162 - * If set, the nonce will be added to inline scripts. 163 - * @type string 164 - * @default '' 165 - */ 166 - inlineScriptNonce: "", 167 - /** 168 - * If set, the nonce will be added to inline styles. 169 - * @type string 170 - * @default '' 171 - */ 172 - inlineStyleNonce: "", 173 - /** 174 - * The attributes to settle during the settling phase. 175 - * @type string[] 176 - * @default ['class', 'style', 'width', 'height'] 177 - */ 178 - attributesToSettle: ["class", "style", "width", "height"], 179 - /** 180 - * Allow cross-site Access-Control requests using credentials such as cookies, authorization headers or TLS client certificates. 181 - * @type boolean 182 - * @default false 183 - */ 184 - withCredentials: false, 185 - /** 186 - * @type number 187 - * @default 0 188 - */ 189 - timeout: 0, 190 - /** 191 - * The default implementation of **getWebSocketReconnectDelay** for reconnecting after unexpected connection loss by the event code **Abnormal Closure**, **Service Restart** or **Try Again Later**. 192 - * @type {'full-jitter' | ((retryCount:number) => number)} 193 - * @default "full-jitter" 194 - */ 195 - wsReconnectDelay: "full-jitter", 196 - /** 197 - * The type of binary data being received over the WebSocket connection 198 - * @type BinaryType 199 - * @default 'blob' 200 - */ 201 - wsBinaryType: "blob", 202 - /** 203 - * @type string 204 - * @default '[hx-disable], [data-hx-disable]' 205 - */ 206 - disableSelector: "[hx-disable], [data-hx-disable]", 207 - /** 208 - * @type {'auto' | 'instant' | 'smooth'} 209 - * @default 'instant' 210 - */ 211 - scrollBehavior: "instant", 212 - /** 213 - * If the focused element should be scrolled into view. 214 - * @type boolean 215 - * @default false 216 - */ 217 - defaultFocusScroll: false, 218 - /** 219 - * If set to true htmx will include a cache-busting parameter in GET requests to avoid caching partial responses by the browser 220 - * @type boolean 221 - * @default false 222 - */ 223 - getCacheBusterParam: false, 224 - /** 225 - * If set to true, htmx will use the View Transition API when swapping in new content. 226 - * @type boolean 227 - * @default false 228 - */ 229 - globalViewTransitions: false, 230 - /** 231 - * htmx will format requests with these methods by encoding their parameters in the URL, not the request body 232 - * @type {(HttpVerb)[]} 233 - * @default ['get', 'delete'] 234 - */ 235 - methodsThatUseUrlParams: ["get", "delete"], 236 - /** 237 - * If set to true, disables htmx-based requests to non-origin hosts. 238 - * @type boolean 239 - * @default false 240 - */ 241 - selfRequestsOnly: true, 242 - /** 243 - * If set to true htmx will not update the title of the document when a title tag is found in new content 244 - * @type boolean 245 - * @default false 246 - */ 247 - ignoreTitle: false, 248 - /** 249 - * Whether the target of a boosted element is scrolled into the viewport. 250 - * @type boolean 251 - * @default true 252 - */ 253 - scrollIntoViewOnBoost: true, 254 - /** 255 - * The cache to store evaluated trigger specifications into. 256 - * You may define a simple object to use a never-clearing cache, or implement your own system using a [proxy object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy) 257 - * @type {Object|null} 258 - * @default null 259 - */ 260 - triggerSpecsCache: null, 261 - /** @type boolean */ 262 - disableInheritance: false, 263 - /** @type HtmxResponseHandlingConfig[] */ 264 - responseHandling: [ 265 - { code: "204", swap: false }, 266 - { code: "[23]..", swap: true }, 267 - { code: "[45]..", swap: false, error: true }, 268 - ], 269 - /** 270 - * Whether to process OOB swaps on elements that are nested within the main response element. 271 - * @type boolean 272 - * @default true 273 - */ 274 - allowNestedOobSwaps: true, 275 - }, 276 - /** @type {typeof parseInterval} */ 277 - parseInterval: null, 278 - /** @type {typeof internalEval} */ 279 - _: null, 280 - version: "2.0.4", 281 - }; 282 - // Tsc madness part 2 283 - htmx.onLoad = onLoadHelper; 284 - htmx.process = processNode; 285 - htmx.on = addEventListenerImpl; 286 - htmx.off = removeEventListenerImpl; 287 - htmx.trigger = triggerEvent; 288 - htmx.ajax = ajaxHelper; 289 - htmx.find = find; 290 - htmx.findAll = findAll; 291 - htmx.closest = closest; 292 - htmx.remove = removeElement; 293 - htmx.addClass = addClassToElement; 294 - htmx.removeClass = removeClassFromElement; 295 - htmx.toggleClass = toggleClassOnElement; 296 - htmx.takeClass = takeClassForElement; 297 - htmx.swap = swap; 298 - htmx.defineExtension = defineExtension; 299 - htmx.removeExtension = removeExtension; 300 - htmx.logAll = logAll; 301 - htmx.logNone = logNone; 302 - htmx.parseInterval = parseInterval; 303 - htmx._ = internalEval; 304 - 305 - const internalAPI = { 306 - addTriggerHandler, 307 - bodyContains, 308 - canAccessLocalStorage, 309 - findThisElement, 310 - filterValues, 311 - swap, 312 - hasAttribute, 313 - getAttributeValue, 314 - getClosestAttributeValue, 315 - getClosestMatch, 316 - getExpressionVars, 317 - getHeaders, 318 - getInputValues, 319 - getInternalData, 320 - getSwapSpecification, 321 - getTriggerSpecs, 322 - getTarget, 323 - makeFragment, 324 - mergeObjects, 325 - makeSettleInfo, 326 - oobSwap, 327 - querySelectorExt, 328 - settleImmediately, 329 - shouldCancel, 330 - triggerEvent, 331 - triggerErrorEvent, 332 - withExtensions, 333 - }; 334 - 335 - const VERBS = ["get", "post", "put", "delete", "patch"]; 336 - const VERB_SELECTOR = VERBS.map(function (verb) { 337 - return "[hx-" + verb + "], [data-hx-" + verb + "]"; 338 - }).join(", "); 339 - 340 - //= =================================================================== 341 - // Utilities 342 - //= =================================================================== 343 - 344 - /** 345 - * Parses an interval string consistent with the way htmx does. Useful for plugins that have timing-related attributes. 346 - * 347 - * Caution: Accepts an int followed by either **s** or **ms**. All other values use **parseFloat** 348 - * 349 - * @see https://htmx.org/api/#parseInterval 350 - * 351 - * @param {string} str timing string 352 - * @returns {number|undefined} 353 - */ 354 - function parseInterval(str) { 355 - if (str == undefined) { 356 - return undefined; 357 - } 358 - 359 - let interval = NaN; 360 - if (str.slice(-2) == "ms") { 361 - interval = parseFloat(str.slice(0, -2)); 362 - } else if (str.slice(-1) == "s") { 363 - interval = parseFloat(str.slice(0, -1)) * 1000; 364 - } else if (str.slice(-1) == "m") { 365 - interval = parseFloat(str.slice(0, -1)) * 1000 * 60; 366 - } else { 367 - interval = parseFloat(str); 368 - } 369 - return isNaN(interval) ? undefined : interval; 370 - } 371 - 372 - /** 373 - * @param {Node} elt 374 - * @param {string} name 375 - * @returns {(string | null)} 376 - */ 377 - function getRawAttribute(elt, name) { 378 - return elt instanceof Element && elt.getAttribute(name); 379 - } 380 - 381 - /** 382 - * @param {Element} elt 383 - * @param {string} qualifiedName 384 - * @returns {boolean} 385 - */ 386 - // resolve with both hx and data-hx prefixes 387 - function hasAttribute(elt, qualifiedName) { 388 - return ( 389 - !!elt.hasAttribute && 390 - (elt.hasAttribute(qualifiedName) || 391 - elt.hasAttribute("data-" + qualifiedName)) 392 - ); 393 - } 394 - 395 - /** 396 - * 397 - * @param {Node} elt 398 - * @param {string} qualifiedName 399 - * @returns {(string | null)} 400 - */ 401 - function getAttributeValue(elt, qualifiedName) { 402 - return ( 403 - getRawAttribute(elt, qualifiedName) || 404 - getRawAttribute(elt, "data-" + qualifiedName) 405 - ); 406 - } 407 - 408 - /** 409 - * @param {Node} elt 410 - * @returns {Node | null} 411 - */ 412 - function parentElt(elt) { 413 - const parent = elt.parentElement; 414 - if (!parent && elt.parentNode instanceof ShadowRoot) return elt.parentNode; 415 - return parent; 416 - } 417 - 418 - /** 419 - * @returns {Document} 420 - */ 421 - function getDocument() { 422 - return document; 423 - } 424 - 425 - /** 426 - * @param {Node} elt 427 - * @param {boolean} global 428 - * @returns {Node|Document} 429 - */ 430 - function getRootNode(elt, global) { 431 - return elt.getRootNode 432 - ? elt.getRootNode({ composed: global }) 433 - : getDocument(); 434 - } 435 - 436 - /** 437 - * @param {Node} elt 438 - * @param {(e:Node) => boolean} condition 439 - * @returns {Node | null} 440 - */ 441 - function getClosestMatch(elt, condition) { 442 - while (elt && !condition(elt)) { 443 - elt = parentElt(elt); 444 - } 445 - 446 - return elt || null; 447 - } 448 - 449 - /** 450 - * @param {Element} initialElement 451 - * @param {Element} ancestor 452 - * @param {string} attributeName 453 - * @returns {string|null} 454 - */ 455 - function getAttributeValueWithDisinheritance( 456 - initialElement, 457 - ancestor, 458 - attributeName, 459 - ) { 460 - const attributeValue = getAttributeValue(ancestor, attributeName); 461 - const disinherit = getAttributeValue(ancestor, "hx-disinherit"); 462 - var inherit = getAttributeValue(ancestor, "hx-inherit"); 463 - if (initialElement !== ancestor) { 464 - if (htmx.config.disableInheritance) { 465 - if ( 466 - inherit && 467 - (inherit === "*" || inherit.split(" ").indexOf(attributeName) >= 0) 468 - ) { 469 - return attributeValue; 470 - } else { 471 - return null; 472 - } 473 - } 474 - if ( 475 - disinherit && 476 - (disinherit === "*" || 477 - disinherit.split(" ").indexOf(attributeName) >= 0) 478 - ) { 479 - return "unset"; 480 - } 481 - } 482 - return attributeValue; 483 - } 484 - 485 - /** 486 - * @param {Element} elt 487 - * @param {string} attributeName 488 - * @returns {string | null} 489 - */ 490 - function getClosestAttributeValue(elt, attributeName) { 491 - let closestAttr = null; 492 - getClosestMatch(elt, function (e) { 493 - return !!(closestAttr = getAttributeValueWithDisinheritance( 494 - elt, 495 - asElement(e), 496 - attributeName, 497 - )); 498 - }); 499 - if (closestAttr !== "unset") { 500 - return closestAttr; 501 - } 502 - } 503 - 504 - /** 505 - * @param {Node} elt 506 - * @param {string} selector 507 - * @returns {boolean} 508 - */ 509 - function matches(elt, selector) { 510 - // @ts-ignore: non-standard properties for browser compatibility 511 - // noinspection JSUnresolvedVariable 512 - const matchesFunction = 513 - elt instanceof Element && 514 - (elt.matches || 515 - elt.matchesSelector || 516 - elt.msMatchesSelector || 517 - elt.mozMatchesSelector || 518 - elt.webkitMatchesSelector || 519 - elt.oMatchesSelector); 520 - return !!matchesFunction && matchesFunction.call(elt, selector); 521 - } 522 - 523 - /** 524 - * @param {string} str 525 - * @returns {string} 526 - */ 527 - function getStartTag(str) { 528 - const tagMatcher = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i; 529 - const match = tagMatcher.exec(str); 530 - if (match) { 531 - return match[1].toLowerCase(); 532 - } else { 533 - return ""; 534 - } 535 - } 536 - 537 - /** 538 - * @param {string} resp 539 - * @returns {Document} 540 - */ 541 - function parseHTML(resp) { 542 - const parser = new DOMParser(); 543 - return parser.parseFromString(resp, "text/html"); 544 - } 545 - 546 - /** 547 - * @param {DocumentFragment} fragment 548 - * @param {Node} elt 549 - */ 550 - function takeChildrenFor(fragment, elt) { 551 - while (elt.childNodes.length > 0) { 552 - fragment.append(elt.childNodes[0]); 553 - } 554 - } 555 - 556 - /** 557 - * @param {HTMLScriptElement} script 558 - * @returns {HTMLScriptElement} 559 - */ 560 - function duplicateScript(script) { 561 - const newScript = getDocument().createElement("script"); 562 - forEach(script.attributes, function (attr) { 563 - newScript.setAttribute(attr.name, attr.value); 564 - }); 565 - newScript.textContent = script.textContent; 566 - newScript.async = false; 567 - if (htmx.config.inlineScriptNonce) { 568 - newScript.nonce = htmx.config.inlineScriptNonce; 569 - } 570 - return newScript; 571 - } 572 - 573 - /** 574 - * @param {HTMLScriptElement} script 575 - * @returns {boolean} 576 - */ 577 - function isJavaScriptScriptNode(script) { 578 - return ( 579 - script.matches("script") && 580 - (script.type === "text/javascript" || 581 - script.type === "module" || 582 - script.type === "") 583 - ); 584 - } 585 - 586 - /** 587 - * we have to make new copies of script tags that we are going to insert because 588 - * SOME browsers (not saying who, but it involves an element and an animal) don't 589 - * execute scripts created in <template> tags when they are inserted into the DOM 590 - * and all the others do lmao 591 - * @param {DocumentFragment} fragment 592 - */ 593 - function normalizeScriptTags(fragment) { 594 - Array.from(fragment.querySelectorAll("script")).forEach( 595 - /** @param {HTMLScriptElement} script */ (script) => { 596 - if (isJavaScriptScriptNode(script)) { 597 - const newScript = duplicateScript(script); 598 - const parent = script.parentNode; 599 - try { 600 - parent.insertBefore(newScript, script); 601 - } catch (e) { 602 - logError(e); 603 - } finally { 604 - script.remove(); 605 - } 606 - } 607 - }, 608 - ); 609 - } 610 - 611 - /** 612 - * @typedef {DocumentFragment & {title?: string}} DocumentFragmentWithTitle 613 - * @description a document fragment representing the response HTML, including 614 - * a `title` property for any title information found 615 - */ 616 - 617 - /** 618 - * @param {string} response HTML 619 - * @returns {DocumentFragmentWithTitle} 620 - */ 621 - function makeFragment(response) { 622 - // strip head tag to determine shape of response we are dealing with 623 - const responseWithNoHead = response.replace( 624 - /<head(\s[^>]*)?>[\s\S]*?<\/head>/i, 625 - "", 626 - ); 627 - const startTag = getStartTag(responseWithNoHead); 628 - /** @type DocumentFragmentWithTitle */ 629 - let fragment; 630 - if (startTag === "html") { 631 - // if it is a full document, parse it and return the body 632 - fragment = /** @type DocumentFragmentWithTitle */ ( 633 - new DocumentFragment() 634 - ); 635 - const doc = parseHTML(response); 636 - takeChildrenFor(fragment, doc.body); 637 - fragment.title = doc.title; 638 - } else if (startTag === "body") { 639 - // parse body w/o wrapping in template 640 - fragment = /** @type DocumentFragmentWithTitle */ ( 641 - new DocumentFragment() 642 - ); 643 - const doc = parseHTML(responseWithNoHead); 644 - takeChildrenFor(fragment, doc.body); 645 - fragment.title = doc.title; 646 - } else { 647 - // otherwise we have non-body partial HTML content, so wrap it in a template to maximize parsing flexibility 648 - const doc = parseHTML( 649 - '<body><template class="internal-htmx-wrapper">' + 650 - responseWithNoHead + 651 - "</template></body>", 652 - ); 653 - fragment = /** @type DocumentFragmentWithTitle */ ( 654 - doc.querySelector("template").content 655 - ); 656 - // extract title into fragment for later processing 657 - fragment.title = doc.title; 658 - 659 - // for legacy reasons we support a title tag at the root level of non-body responses, so we need to handle it 660 - var titleElement = fragment.querySelector("title"); 661 - if (titleElement && titleElement.parentNode === fragment) { 662 - titleElement.remove(); 663 - fragment.title = titleElement.innerText; 664 - } 665 - } 666 - if (fragment) { 667 - if (htmx.config.allowScriptTags) { 668 - normalizeScriptTags(fragment); 669 - } else { 670 - // remove all script tags if scripts are disabled 671 - fragment 672 - .querySelectorAll("script") 673 - .forEach((script) => script.remove()); 674 - } 675 - } 676 - return fragment; 677 - } 678 - 679 - /** 680 - * @param {Function} func 681 - */ 682 - function maybeCall(func) { 683 - if (func) { 684 - func(); 685 - } 686 - } 687 - 688 - /** 689 - * @param {any} o 690 - * @param {string} type 691 - * @returns 692 - */ 693 - function isType(o, type) { 694 - return Object.prototype.toString.call(o) === "[object " + type + "]"; 695 - } 696 - 697 - /** 698 - * @param {*} o 699 - * @returns {o is Function} 700 - */ 701 - function isFunction(o) { 702 - return typeof o === "function"; 703 - } 704 - 705 - /** 706 - * @param {*} o 707 - * @returns {o is Object} 708 - */ 709 - function isRawObject(o) { 710 - return isType(o, "Object"); 711 - } 712 - 713 - /** 714 - * @typedef {Object} OnHandler 715 - * @property {(keyof HTMLElementEventMap)|string} event 716 - * @property {EventListener} listener 717 - */ 718 - 719 - /** 720 - * @typedef {Object} ListenerInfo 721 - * @property {string} trigger 722 - * @property {EventListener} listener 723 - * @property {EventTarget} on 724 - */ 725 - 726 - /** 727 - * @typedef {Object} HtmxNodeInternalData 728 - * Element data 729 - * @property {number} [initHash] 730 - * @property {boolean} [boosted] 731 - * @property {OnHandler[]} [onHandlers] 732 - * @property {number} [timeout] 733 - * @property {ListenerInfo[]} [listenerInfos] 734 - * @property {boolean} [cancelled] 735 - * @property {boolean} [triggeredOnce] 736 - * @property {number} [delayed] 737 - * @property {number|null} [throttle] 738 - * @property {WeakMap<HtmxTriggerSpecification,WeakMap<EventTarget,string>>} [lastValue] 739 - * @property {boolean} [loaded] 740 - * @property {string} [path] 741 - * @property {string} [verb] 742 - * @property {boolean} [polling] 743 - * @property {HTMLButtonElement|HTMLInputElement|null} [lastButtonClicked] 744 - * @property {number} [requestCount] 745 - * @property {XMLHttpRequest} [xhr] 746 - * @property {(() => void)[]} [queuedRequests] 747 - * @property {boolean} [abortable] 748 - * @property {boolean} [firstInitCompleted] 749 - * 750 - * Event data 751 - * @property {HtmxTriggerSpecification} [triggerSpec] 752 - * @property {EventTarget[]} [handledFor] 753 - */ 754 - 755 - /** 756 - * getInternalData retrieves "private" data stored by htmx within an element 757 - * @param {EventTarget|Event} elt 758 - * @returns {HtmxNodeInternalData} 759 - */ 760 - function getInternalData(elt) { 761 - const dataProp = "htmx-internal-data"; 762 - let data = elt[dataProp]; 763 - if (!data) { 764 - data = elt[dataProp] = {}; 765 - } 766 - return data; 767 - } 768 - 769 - /** 770 - * toArray converts an ArrayLike object into a real array. 771 - * @template T 772 - * @param {ArrayLike<T>} arr 773 - * @returns {T[]} 774 - */ 775 - function toArray(arr) { 776 - const returnArr = []; 777 - if (arr) { 778 - for (let i = 0; i < arr.length; i++) { 779 - returnArr.push(arr[i]); 780 - } 781 - } 782 - return returnArr; 783 - } 784 - 785 - /** 786 - * @template T 787 - * @param {T[]|NamedNodeMap|HTMLCollection|HTMLFormControlsCollection|ArrayLike<T>} arr 788 - * @param {(T) => void} func 789 - */ 790 - function forEach(arr, func) { 791 - if (arr) { 792 - for (let i = 0; i < arr.length; i++) { 793 - func(arr[i]); 794 - } 795 - } 796 - } 797 - 798 - /** 799 - * @param {Element} el 800 - * @returns {boolean} 801 - */ 802 - function isScrolledIntoView(el) { 803 - const rect = el.getBoundingClientRect(); 804 - const elemTop = rect.top; 805 - const elemBottom = rect.bottom; 806 - return elemTop < window.innerHeight && elemBottom >= 0; 807 - } 808 - 809 - /** 810 - * Checks whether the element is in the document (includes shadow roots). 811 - * This function this is a slight misnomer; it will return true even for elements in the head. 812 - * 813 - * @param {Node} elt 814 - * @returns {boolean} 815 - */ 816 - function bodyContains(elt) { 817 - return elt.getRootNode({ composed: true }) === document; 818 - } 819 - 820 - /** 821 - * @param {string} trigger 822 - * @returns {string[]} 823 - */ 824 - function splitOnWhitespace(trigger) { 825 - return trigger.trim().split(/\s+/); 826 - } 827 - 828 - /** 829 - * mergeObjects takes all the keys from 830 - * obj2 and duplicates them into obj1 831 - * @template T1 832 - * @template T2 833 - * @param {T1} obj1 834 - * @param {T2} obj2 835 - * @returns {T1 & T2} 836 - */ 837 - function mergeObjects(obj1, obj2) { 838 - for (const key in obj2) { 839 - if (obj2.hasOwnProperty(key)) { 840 - // @ts-ignore tsc doesn't seem to properly handle types merging 841 - obj1[key] = obj2[key]; 842 - } 843 - } 844 - // @ts-ignore tsc doesn't seem to properly handle types merging 845 - return obj1; 846 - } 847 - 848 - /** 849 - * @param {string} jString 850 - * @returns {any|null} 851 - */ 852 - function parseJSON(jString) { 853 - try { 854 - return JSON.parse(jString); 855 - } catch (error) { 856 - logError(error); 857 - return null; 858 - } 859 - } 860 - 861 - /** 862 - * @returns {boolean} 863 - */ 864 - function canAccessLocalStorage() { 865 - const test = "htmx:localStorageTest"; 866 - try { 867 - localStorage.setItem(test, test); 868 - localStorage.removeItem(test); 869 - return true; 870 - } catch (e) { 871 - return false; 872 - } 873 - } 874 - 875 - /** 876 - * @param {string} path 877 - * @returns {string} 878 - */ 879 - function normalizePath(path) { 880 - try { 881 - const url = new URL(path); 882 - if (url) { 883 - path = url.pathname + url.search; 884 - } 885 - // remove trailing slash, unless index page 886 - if (!/^\/$/.test(path)) { 887 - path = path.replace(/\/+$/, ""); 888 - } 889 - return path; 890 - } catch (e) { 891 - // be kind to IE11, which doesn't support URL() 892 - return path; 893 - } 894 - } 895 - 896 - //= ========================================================================================= 897 - // public API 898 - //= ========================================================================================= 899 - 900 - /** 901 - * @param {string} str 902 - * @returns {any} 903 - */ 904 - function internalEval(str) { 905 - return maybeEval(getDocument().body, function () { 906 - return eval(str); 907 - }); 908 - } 909 - 910 - /** 911 - * Adds a callback for the **htmx:load** event. This can be used to process new content, for example initializing the content with a javascript library 912 - * 913 - * @see https://htmx.org/api/#onLoad 914 - * 915 - * @param {(elt: Node) => void} callback the callback to call on newly loaded content 916 - * @returns {EventListener} 917 - */ 918 - function onLoadHelper(callback) { 919 - const value = htmx.on( 920 - "htmx:load", 921 - /** @param {CustomEvent} evt */ function (evt) { 922 - callback(evt.detail.elt); 923 - }, 924 - ); 925 - return value; 926 - } 927 - 928 - /** 929 - * Log all htmx events, useful for debugging. 930 - * 931 - * @see https://htmx.org/api/#logAll 932 - */ 933 - function logAll() { 934 - htmx.logger = function (elt, event, data) { 935 - if (console) { 936 - console.log(event, elt, data); 937 - } 938 - }; 939 - } 940 - 941 - function logNone() { 942 - htmx.logger = null; 943 - } 944 - 945 - /** 946 - * Finds an element matching the selector 947 - * 948 - * @see https://htmx.org/api/#find 949 - * 950 - * @param {ParentNode|string} eltOrSelector the root element to find the matching element in, inclusive | the selector to match 951 - * @param {string} [selector] the selector to match 952 - * @returns {Element|null} 953 - */ 954 - function find(eltOrSelector, selector) { 955 - if (typeof eltOrSelector !== "string") { 956 - return eltOrSelector.querySelector(selector); 957 - } else { 958 - return find(getDocument(), eltOrSelector); 959 - } 960 - } 961 - 962 - /** 963 - * Finds all elements matching the selector 964 - * 965 - * @see https://htmx.org/api/#findAll 966 - * 967 - * @param {ParentNode|string} eltOrSelector the root element to find the matching elements in, inclusive | the selector to match 968 - * @param {string} [selector] the selector to match 969 - * @returns {NodeListOf<Element>} 970 - */ 971 - function findAll(eltOrSelector, selector) { 972 - if (typeof eltOrSelector !== "string") { 973 - return eltOrSelector.querySelectorAll(selector); 974 - } else { 975 - return findAll(getDocument(), eltOrSelector); 976 - } 977 - } 978 - 979 - /** 980 - * @returns Window 981 - */ 982 - function getWindow() { 983 - return window; 984 - } 985 - 986 - /** 987 - * Removes an element from the DOM 988 - * 989 - * @see https://htmx.org/api/#remove 990 - * 991 - * @param {Node} elt 992 - * @param {number} [delay] 993 - */ 994 - function removeElement(elt, delay) { 995 - elt = resolveTarget(elt); 996 - if (delay) { 997 - getWindow().setTimeout(function () { 998 - removeElement(elt); 999 - elt = null; 1000 - }, delay); 1001 - } else { 1002 - parentElt(elt).removeChild(elt); 1003 - } 1004 - } 1005 - 1006 - /** 1007 - * @param {any} elt 1008 - * @return {Element|null} 1009 - */ 1010 - function asElement(elt) { 1011 - return elt instanceof Element ? elt : null; 1012 - } 1013 - 1014 - /** 1015 - * @param {any} elt 1016 - * @return {HTMLElement|null} 1017 - */ 1018 - function asHtmlElement(elt) { 1019 - return elt instanceof HTMLElement ? elt : null; 1020 - } 1021 - 1022 - /** 1023 - * @param {any} value 1024 - * @return {string|null} 1025 - */ 1026 - function asString(value) { 1027 - return typeof value === "string" ? value : null; 1028 - } 1029 - 1030 - /** 1031 - * @param {EventTarget} elt 1032 - * @return {ParentNode|null} 1033 - */ 1034 - function asParentNode(elt) { 1035 - return elt instanceof Element || 1036 - elt instanceof Document || 1037 - elt instanceof DocumentFragment 1038 - ? elt 1039 - : null; 1040 - } 1041 - 1042 - /** 1043 - * This method adds a class to the given element. 1044 - * 1045 - * @see https://htmx.org/api/#addClass 1046 - * 1047 - * @param {Element|string} elt the element to add the class to 1048 - * @param {string} clazz the class to add 1049 - * @param {number} [delay] the delay (in milliseconds) before class is added 1050 - */ 1051 - function addClassToElement(elt, clazz, delay) { 1052 - elt = asElement(resolveTarget(elt)); 1053 - if (!elt) { 1054 - return; 1055 - } 1056 - if (delay) { 1057 - getWindow().setTimeout(function () { 1058 - addClassToElement(elt, clazz); 1059 - elt = null; 1060 - }, delay); 1061 - } else { 1062 - elt.classList && elt.classList.add(clazz); 1063 - } 1064 - } 1065 - 1066 - /** 1067 - * Removes a class from the given element 1068 - * 1069 - * @see https://htmx.org/api/#removeClass 1070 - * 1071 - * @param {Node|string} node element to remove the class from 1072 - * @param {string} clazz the class to remove 1073 - * @param {number} [delay] the delay (in milliseconds before class is removed) 1074 - */ 1075 - function removeClassFromElement(node, clazz, delay) { 1076 - let elt = asElement(resolveTarget(node)); 1077 - if (!elt) { 1078 - return; 1079 - } 1080 - if (delay) { 1081 - getWindow().setTimeout(function () { 1082 - removeClassFromElement(elt, clazz); 1083 - elt = null; 1084 - }, delay); 1085 - } else { 1086 - if (elt.classList) { 1087 - elt.classList.remove(clazz); 1088 - // if there are no classes left, remove the class attribute 1089 - if (elt.classList.length === 0) { 1090 - elt.removeAttribute("class"); 1091 - } 1092 - } 1093 - } 1094 - } 1095 - 1096 - /** 1097 - * Toggles the given class on an element 1098 - * 1099 - * @see https://htmx.org/api/#toggleClass 1100 - * 1101 - * @param {Element|string} elt the element to toggle the class on 1102 - * @param {string} clazz the class to toggle 1103 - */ 1104 - function toggleClassOnElement(elt, clazz) { 1105 - elt = resolveTarget(elt); 1106 - elt.classList.toggle(clazz); 1107 - } 1108 - 1109 - /** 1110 - * Takes the given class from its siblings, so that among its siblings, only the given element will have the class. 1111 - * 1112 - * @see https://htmx.org/api/#takeClass 1113 - * 1114 - * @param {Node|string} elt the element that will take the class 1115 - * @param {string} clazz the class to take 1116 - */ 1117 - function takeClassForElement(elt, clazz) { 1118 - elt = resolveTarget(elt); 1119 - forEach(elt.parentElement.children, function (child) { 1120 - removeClassFromElement(child, clazz); 1121 - }); 1122 - addClassToElement(asElement(elt), clazz); 1123 - } 1124 - 1125 - /** 1126 - * Finds the closest matching element in the given elements parentage, inclusive of the element 1127 - * 1128 - * @see https://htmx.org/api/#closest 1129 - * 1130 - * @param {Element|string} elt the element to find the selector from 1131 - * @param {string} selector the selector to find 1132 - * @returns {Element|null} 1133 - */ 1134 - function closest(elt, selector) { 1135 - elt = asElement(resolveTarget(elt)); 1136 - if (elt && elt.closest) { 1137 - return elt.closest(selector); 1138 - } else { 1139 - // TODO remove when IE goes away 1140 - do { 1141 - if (elt == null || matches(elt, selector)) { 1142 - return elt; 1143 - } 1144 - } while ((elt = elt && asElement(parentElt(elt)))); 1145 - return null; 1146 - } 1147 - } 1148 - 1149 - /** 1150 - * @param {string} str 1151 - * @param {string} prefix 1152 - * @returns {boolean} 1153 - */ 1154 - function startsWith(str, prefix) { 1155 - return str.substring(0, prefix.length) === prefix; 1156 - } 1157 - 1158 - /** 1159 - * @param {string} str 1160 - * @param {string} suffix 1161 - * @returns {boolean} 1162 - */ 1163 - function endsWith(str, suffix) { 1164 - return str.substring(str.length - suffix.length) === suffix; 1165 - } 1166 - 1167 - /** 1168 - * @param {string} selector 1169 - * @returns {string} 1170 - */ 1171 - function normalizeSelector(selector) { 1172 - const trimmedSelector = selector.trim(); 1173 - if (startsWith(trimmedSelector, "<") && endsWith(trimmedSelector, "/>")) { 1174 - return trimmedSelector.substring(1, trimmedSelector.length - 2); 1175 - } else { 1176 - return trimmedSelector; 1177 - } 1178 - } 1179 - 1180 - /** 1181 - * @param {Node|Element|Document|string} elt 1182 - * @param {string} selector 1183 - * @param {boolean=} global 1184 - * @returns {(Node|Window)[]} 1185 - */ 1186 - function querySelectorAllExt(elt, selector, global) { 1187 - if (selector.indexOf("global ") === 0) { 1188 - return querySelectorAllExt(elt, selector.slice(7), true); 1189 - } 1190 - 1191 - elt = resolveTarget(elt); 1192 - 1193 - const parts = []; 1194 - { 1195 - let chevronsCount = 0; 1196 - let offset = 0; 1197 - for (let i = 0; i < selector.length; i++) { 1198 - const char = selector[i]; 1199 - if (char === "," && chevronsCount === 0) { 1200 - parts.push(selector.substring(offset, i)); 1201 - offset = i + 1; 1202 - continue; 1203 - } 1204 - if (char === "<") { 1205 - chevronsCount++; 1206 - } else if ( 1207 - char === "/" && 1208 - i < selector.length - 1 && 1209 - selector[i + 1] === ">" 1210 - ) { 1211 - chevronsCount--; 1212 - } 1213 - } 1214 - if (offset < selector.length) { 1215 - parts.push(selector.substring(offset)); 1216 - } 1217 - } 1218 - 1219 - const result = []; 1220 - const unprocessedParts = []; 1221 - while (parts.length > 0) { 1222 - const selector = normalizeSelector(parts.shift()); 1223 - let item; 1224 - if (selector.indexOf("closest ") === 0) { 1225 - item = closest(asElement(elt), normalizeSelector(selector.substr(8))); 1226 - } else if (selector.indexOf("find ") === 0) { 1227 - item = find(asParentNode(elt), normalizeSelector(selector.substr(5))); 1228 - } else if (selector === "next" || selector === "nextElementSibling") { 1229 - item = asElement(elt).nextElementSibling; 1230 - } else if (selector.indexOf("next ") === 0) { 1231 - item = scanForwardQuery( 1232 - elt, 1233 - normalizeSelector(selector.substr(5)), 1234 - !!global, 1235 - ); 1236 - } else if ( 1237 - selector === "previous" || 1238 - selector === "previousElementSibling" 1239 - ) { 1240 - item = asElement(elt).previousElementSibling; 1241 - } else if (selector.indexOf("previous ") === 0) { 1242 - item = scanBackwardsQuery( 1243 - elt, 1244 - normalizeSelector(selector.substr(9)), 1245 - !!global, 1246 - ); 1247 - } else if (selector === "document") { 1248 - item = document; 1249 - } else if (selector === "window") { 1250 - item = window; 1251 - } else if (selector === "body") { 1252 - item = document.body; 1253 - } else if (selector === "root") { 1254 - item = getRootNode(elt, !!global); 1255 - } else if (selector === "host") { 1256 - item = /** @type ShadowRoot */ (elt.getRootNode()).host; 1257 - } else { 1258 - unprocessedParts.push(selector); 1259 - } 1260 - 1261 - if (item) { 1262 - result.push(item); 1263 - } 1264 - } 1265 - 1266 - if (unprocessedParts.length > 0) { 1267 - const standardSelector = unprocessedParts.join(","); 1268 - const rootNode = asParentNode(getRootNode(elt, !!global)); 1269 - result.push(...toArray(rootNode.querySelectorAll(standardSelector))); 1270 - } 1271 - 1272 - return result; 1273 - } 1274 - 1275 - /** 1276 - * @param {Node} start 1277 - * @param {string} match 1278 - * @param {boolean} global 1279 - * @returns {Element} 1280 - */ 1281 - var scanForwardQuery = function (start, match, global) { 1282 - const results = asParentNode(getRootNode(start, global)).querySelectorAll( 1283 - match, 1284 - ); 1285 - for (let i = 0; i < results.length; i++) { 1286 - const elt = results[i]; 1287 - if ( 1288 - elt.compareDocumentPosition(start) === Node.DOCUMENT_POSITION_PRECEDING 1289 - ) { 1290 - return elt; 1291 - } 1292 - } 1293 - }; 1294 - 1295 - /** 1296 - * @param {Node} start 1297 - * @param {string} match 1298 - * @param {boolean} global 1299 - * @returns {Element} 1300 - */ 1301 - var scanBackwardsQuery = function (start, match, global) { 1302 - const results = asParentNode(getRootNode(start, global)).querySelectorAll( 1303 - match, 1304 - ); 1305 - for (let i = results.length - 1; i >= 0; i--) { 1306 - const elt = results[i]; 1307 - if ( 1308 - elt.compareDocumentPosition(start) === Node.DOCUMENT_POSITION_FOLLOWING 1309 - ) { 1310 - return elt; 1311 - } 1312 - } 1313 - }; 1314 - 1315 - /** 1316 - * @param {Node|string} eltOrSelector 1317 - * @param {string=} selector 1318 - * @returns {Node|Window} 1319 - */ 1320 - function querySelectorExt(eltOrSelector, selector) { 1321 - if (typeof eltOrSelector !== "string") { 1322 - return querySelectorAllExt(eltOrSelector, selector)[0]; 1323 - } else { 1324 - return querySelectorAllExt(getDocument().body, eltOrSelector)[0]; 1325 - } 1326 - } 1327 - 1328 - /** 1329 - * @template {EventTarget} T 1330 - * @param {T|string} eltOrSelector 1331 - * @param {T} [context] 1332 - * @returns {Element|T|null} 1333 - */ 1334 - function resolveTarget(eltOrSelector, context) { 1335 - if (typeof eltOrSelector === "string") { 1336 - return find(asParentNode(context) || document, eltOrSelector); 1337 - } else { 1338 - return eltOrSelector; 1339 - } 1340 - } 1341 - 1342 - /** 1343 - * @typedef {keyof HTMLElementEventMap|string} AnyEventName 1344 - */ 1345 - 1346 - /** 1347 - * @typedef {Object} EventArgs 1348 - * @property {EventTarget} target 1349 - * @property {AnyEventName} event 1350 - * @property {EventListener} listener 1351 - * @property {Object|boolean} options 1352 - */ 1353 - 1354 - /** 1355 - * @param {EventTarget|AnyEventName} arg1 1356 - * @param {AnyEventName|EventListener} arg2 1357 - * @param {EventListener|Object|boolean} [arg3] 1358 - * @param {Object|boolean} [arg4] 1359 - * @returns {EventArgs} 1360 - */ 1361 - function processEventArgs(arg1, arg2, arg3, arg4) { 1362 - if (isFunction(arg2)) { 1363 - return { 1364 - target: getDocument().body, 1365 - event: asString(arg1), 1366 - listener: arg2, 1367 - options: arg3, 1368 - }; 1369 - } else { 1370 - return { 1371 - target: resolveTarget(arg1), 1372 - event: asString(arg2), 1373 - listener: arg3, 1374 - options: arg4, 1375 - }; 1376 - } 1377 - } 1378 - 1379 - /** 1380 - * Adds an event listener to an element 1381 - * 1382 - * @see https://htmx.org/api/#on 1383 - * 1384 - * @param {EventTarget|string} arg1 the element to add the listener to | the event name to add the listener for 1385 - * @param {string|EventListener} arg2 the event name to add the listener for | the listener to add 1386 - * @param {EventListener|Object|boolean} [arg3] the listener to add | options to add 1387 - * @param {Object|boolean} [arg4] options to add 1388 - * @returns {EventListener} 1389 - */ 1390 - function addEventListenerImpl(arg1, arg2, arg3, arg4) { 1391 - ready(function () { 1392 - const eventArgs = processEventArgs(arg1, arg2, arg3, arg4); 1393 - eventArgs.target.addEventListener( 1394 - eventArgs.event, 1395 - eventArgs.listener, 1396 - eventArgs.options, 1397 - ); 1398 - }); 1399 - const b = isFunction(arg2); 1400 - return b ? arg2 : arg3; 1401 - } 1402 - 1403 - /** 1404 - * Removes an event listener from an element 1405 - * 1406 - * @see https://htmx.org/api/#off 1407 - * 1408 - * @param {EventTarget|string} arg1 the element to remove the listener from | the event name to remove the listener from 1409 - * @param {string|EventListener} arg2 the event name to remove the listener from | the listener to remove 1410 - * @param {EventListener} [arg3] the listener to remove 1411 - * @returns {EventListener} 1412 - */ 1413 - function removeEventListenerImpl(arg1, arg2, arg3) { 1414 - ready(function () { 1415 - const eventArgs = processEventArgs(arg1, arg2, arg3); 1416 - eventArgs.target.removeEventListener(eventArgs.event, eventArgs.listener); 1417 - }); 1418 - return isFunction(arg2) ? arg2 : arg3; 1419 - } 1420 - 1421 - //= =================================================================== 1422 - // Node processing 1423 - //= =================================================================== 1424 - 1425 - const DUMMY_ELT = getDocument().createElement("output"); // dummy element for bad selectors 1426 - /** 1427 - * @param {Element} elt 1428 - * @param {string} attrName 1429 - * @returns {(Node|Window)[]} 1430 - */ 1431 - function findAttributeTargets(elt, attrName) { 1432 - const attrTarget = getClosestAttributeValue(elt, attrName); 1433 - if (attrTarget) { 1434 - if (attrTarget === "this") { 1435 - return [findThisElement(elt, attrName)]; 1436 - } else { 1437 - const result = querySelectorAllExt(elt, attrTarget); 1438 - if (result.length === 0) { 1439 - logError( 1440 - 'The selector "' + 1441 - attrTarget + 1442 - '" on ' + 1443 - attrName + 1444 - " returned no matches!", 1445 - ); 1446 - return [DUMMY_ELT]; 1447 - } else { 1448 - return result; 1449 - } 1450 - } 1451 - } 1452 - } 1453 - 1454 - /** 1455 - * @param {Element} elt 1456 - * @param {string} attribute 1457 - * @returns {Element|null} 1458 - */ 1459 - function findThisElement(elt, attribute) { 1460 - return asElement( 1461 - getClosestMatch(elt, function (elt) { 1462 - return getAttributeValue(asElement(elt), attribute) != null; 1463 - }), 1464 - ); 1465 - } 1466 - 1467 - /** 1468 - * @param {Element} elt 1469 - * @returns {Node|Window|null} 1470 - */ 1471 - function getTarget(elt) { 1472 - const targetStr = getClosestAttributeValue(elt, "hx-target"); 1473 - if (targetStr) { 1474 - if (targetStr === "this") { 1475 - return findThisElement(elt, "hx-target"); 1476 - } else { 1477 - return querySelectorExt(elt, targetStr); 1478 - } 1479 - } else { 1480 - const data = getInternalData(elt); 1481 - if (data.boosted) { 1482 - return getDocument().body; 1483 - } else { 1484 - return elt; 1485 - } 1486 - } 1487 - } 1488 - 1489 - /** 1490 - * @param {string} name 1491 - * @returns {boolean} 1492 - */ 1493 - function shouldSettleAttribute(name) { 1494 - const attributesToSettle = htmx.config.attributesToSettle; 1495 - for (let i = 0; i < attributesToSettle.length; i++) { 1496 - if (name === attributesToSettle[i]) { 1497 - return true; 1498 - } 1499 - } 1500 - return false; 1501 - } 1502 - 1503 - /** 1504 - * @param {Element} mergeTo 1505 - * @param {Element} mergeFrom 1506 - */ 1507 - function cloneAttributes(mergeTo, mergeFrom) { 1508 - forEach(mergeTo.attributes, function (attr) { 1509 - if ( 1510 - !mergeFrom.hasAttribute(attr.name) && 1511 - shouldSettleAttribute(attr.name) 1512 - ) { 1513 - mergeTo.removeAttribute(attr.name); 1514 - } 1515 - }); 1516 - forEach(mergeFrom.attributes, function (attr) { 1517 - if (shouldSettleAttribute(attr.name)) { 1518 - mergeTo.setAttribute(attr.name, attr.value); 1519 - } 1520 - }); 1521 - } 1522 - 1523 - /** 1524 - * @param {HtmxSwapStyle} swapStyle 1525 - * @param {Element} target 1526 - * @returns {boolean} 1527 - */ 1528 - function isInlineSwap(swapStyle, target) { 1529 - const extensions = getExtensions(target); 1530 - for (let i = 0; i < extensions.length; i++) { 1531 - const extension = extensions[i]; 1532 - try { 1533 - if (extension.isInlineSwap(swapStyle)) { 1534 - return true; 1535 - } 1536 - } catch (e) { 1537 - logError(e); 1538 - } 1539 - } 1540 - return swapStyle === "outerHTML"; 1541 - } 1542 - 1543 - /** 1544 - * @param {string} oobValue 1545 - * @param {Element} oobElement 1546 - * @param {HtmxSettleInfo} settleInfo 1547 - * @param {Node|Document} [rootNode] 1548 - * @returns 1549 - */ 1550 - function oobSwap(oobValue, oobElement, settleInfo, rootNode) { 1551 - rootNode = rootNode || getDocument(); 1552 - let selector = "#" + getRawAttribute(oobElement, "id"); 1553 - /** @type HtmxSwapStyle */ 1554 - let swapStyle = "outerHTML"; 1555 - if (oobValue === "true") { 1556 - // do nothing 1557 - } else if (oobValue.indexOf(":") > 0) { 1558 - swapStyle = oobValue.substring(0, oobValue.indexOf(":")); 1559 - selector = oobValue.substring(oobValue.indexOf(":") + 1); 1560 - } else { 1561 - swapStyle = oobValue; 1562 - } 1563 - oobElement.removeAttribute("hx-swap-oob"); 1564 - oobElement.removeAttribute("data-hx-swap-oob"); 1565 - 1566 - const targets = querySelectorAllExt(rootNode, selector, false); 1567 - if (targets) { 1568 - forEach(targets, function (target) { 1569 - let fragment; 1570 - const oobElementClone = oobElement.cloneNode(true); 1571 - fragment = getDocument().createDocumentFragment(); 1572 - fragment.appendChild(oobElementClone); 1573 - if (!isInlineSwap(swapStyle, target)) { 1574 - fragment = asParentNode(oobElementClone); // if this is not an inline swap, we use the content of the node, not the node itself 1575 - } 1576 - 1577 - const beforeSwapDetails = { shouldSwap: true, target, fragment }; 1578 - if (!triggerEvent(target, "htmx:oobBeforeSwap", beforeSwapDetails)) 1579 - return; 1580 - 1581 - target = beforeSwapDetails.target; // allow re-targeting 1582 - if (beforeSwapDetails.shouldSwap) { 1583 - handlePreservedElements(fragment); 1584 - swapWithStyle(swapStyle, target, target, fragment, settleInfo); 1585 - restorePreservedElements(); 1586 - } 1587 - forEach(settleInfo.elts, function (elt) { 1588 - triggerEvent(elt, "htmx:oobAfterSwap", beforeSwapDetails); 1589 - }); 1590 - }); 1591 - oobElement.parentNode.removeChild(oobElement); 1592 - } else { 1593 - oobElement.parentNode.removeChild(oobElement); 1594 - triggerErrorEvent(getDocument().body, "htmx:oobErrorNoTarget", { 1595 - content: oobElement, 1596 - }); 1597 - } 1598 - return oobValue; 1599 - } 1600 - 1601 - function restorePreservedElements() { 1602 - const pantry = find("#--htmx-preserve-pantry--"); 1603 - if (pantry) { 1604 - for (const preservedElt of [...pantry.children]) { 1605 - const existingElement = find("#" + preservedElt.id); 1606 - // @ts-ignore - use proposed moveBefore feature 1607 - existingElement.parentNode.moveBefore(preservedElt, existingElement); 1608 - existingElement.remove(); 1609 - } 1610 - pantry.remove(); 1611 - } 1612 - } 1613 - 1614 - /** 1615 - * @param {DocumentFragment|ParentNode} fragment 1616 - */ 1617 - function handlePreservedElements(fragment) { 1618 - forEach( 1619 - findAll(fragment, "[hx-preserve], [data-hx-preserve]"), 1620 - function (preservedElt) { 1621 - const id = getAttributeValue(preservedElt, "id"); 1622 - const existingElement = getDocument().getElementById(id); 1623 - if (existingElement != null) { 1624 - if (preservedElt.moveBefore) { 1625 - // if the moveBefore API exists, use it 1626 - // get or create a storage spot for stuff 1627 - let pantry = find("#--htmx-preserve-pantry--"); 1628 - if (pantry == null) { 1629 - getDocument().body.insertAdjacentHTML( 1630 - "afterend", 1631 - "<div id='--htmx-preserve-pantry--'></div>", 1632 - ); 1633 - pantry = find("#--htmx-preserve-pantry--"); 1634 - } 1635 - // @ts-ignore - use proposed moveBefore feature 1636 - pantry.moveBefore(existingElement, null); 1637 - } else { 1638 - preservedElt.parentNode.replaceChild(existingElement, preservedElt); 1639 - } 1640 - } 1641 - }, 1642 - ); 1643 - } 1644 - 1645 - /** 1646 - * @param {Node} parentNode 1647 - * @param {ParentNode} fragment 1648 - * @param {HtmxSettleInfo} settleInfo 1649 - */ 1650 - function handleAttributes(parentNode, fragment, settleInfo) { 1651 - forEach(fragment.querySelectorAll("[id]"), function (newNode) { 1652 - const id = getRawAttribute(newNode, "id"); 1653 - if (id && id.length > 0) { 1654 - const normalizedId = id.replace("'", "\\'"); 1655 - const normalizedTag = newNode.tagName.replace(":", "\\:"); 1656 - const parentElt = asParentNode(parentNode); 1657 - const oldNode = 1658 - parentElt && 1659 - parentElt.querySelector( 1660 - normalizedTag + "[id='" + normalizedId + "']", 1661 - ); 1662 - if (oldNode && oldNode !== parentElt) { 1663 - const newAttributes = newNode.cloneNode(); 1664 - cloneAttributes(newNode, oldNode); 1665 - settleInfo.tasks.push(function () { 1666 - cloneAttributes(newNode, newAttributes); 1667 - }); 1668 - } 1669 - } 1670 - }); 1671 - } 1672 - 1673 - /** 1674 - * @param {Node} child 1675 - * @returns {HtmxSettleTask} 1676 - */ 1677 - function makeAjaxLoadTask(child) { 1678 - return function () { 1679 - removeClassFromElement(child, htmx.config.addedClass); 1680 - processNode(asElement(child)); 1681 - processFocus(asParentNode(child)); 1682 - triggerEvent(child, "htmx:load"); 1683 - }; 1684 - } 1685 - 1686 - /** 1687 - * @param {ParentNode} child 1688 - */ 1689 - function processFocus(child) { 1690 - const autofocus = "[autofocus]"; 1691 - const autoFocusedElt = asHtmlElement( 1692 - matches(child, autofocus) ? child : child.querySelector(autofocus), 1693 - ); 1694 - if (autoFocusedElt != null) { 1695 - autoFocusedElt.focus(); 1696 - } 1697 - } 1698 - 1699 - /** 1700 - * @param {Node} parentNode 1701 - * @param {Node} insertBefore 1702 - * @param {ParentNode} fragment 1703 - * @param {HtmxSettleInfo} settleInfo 1704 - */ 1705 - function insertNodesBefore(parentNode, insertBefore, fragment, settleInfo) { 1706 - handleAttributes(parentNode, fragment, settleInfo); 1707 - while (fragment.childNodes.length > 0) { 1708 - const child = fragment.firstChild; 1709 - addClassToElement(asElement(child), htmx.config.addedClass); 1710 - parentNode.insertBefore(child, insertBefore); 1711 - if ( 1712 - child.nodeType !== Node.TEXT_NODE && 1713 - child.nodeType !== Node.COMMENT_NODE 1714 - ) { 1715 - settleInfo.tasks.push(makeAjaxLoadTask(child)); 1716 - } 1717 - } 1718 - } 1719 - 1720 - /** 1721 - * based on https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0, 1722 - * derived from Java's string hashcode implementation 1723 - * @param {string} string 1724 - * @param {number} hash 1725 - * @returns {number} 1726 - */ 1727 - function stringHash(string, hash) { 1728 - let char = 0; 1729 - while (char < string.length) { 1730 - hash = ((hash << 5) - hash + string.charCodeAt(char++)) | 0; // bitwise or ensures we have a 32-bit int 1731 - } 1732 - return hash; 1733 - } 1734 - 1735 - /** 1736 - * @param {Element} elt 1737 - * @returns {number} 1738 - */ 1739 - function attributeHash(elt) { 1740 - let hash = 0; 1741 - // IE fix 1742 - if (elt.attributes) { 1743 - for (let i = 0; i < elt.attributes.length; i++) { 1744 - const attribute = elt.attributes[i]; 1745 - if (attribute.value) { 1746 - // only include attributes w/ actual values (empty is same as non-existent) 1747 - hash = stringHash(attribute.name, hash); 1748 - hash = stringHash(attribute.value, hash); 1749 - } 1750 - } 1751 - } 1752 - return hash; 1753 - } 1754 - 1755 - /** 1756 - * @param {EventTarget} elt 1757 - */ 1758 - function deInitOnHandlers(elt) { 1759 - const internalData = getInternalData(elt); 1760 - if (internalData.onHandlers) { 1761 - for (let i = 0; i < internalData.onHandlers.length; i++) { 1762 - const handlerInfo = internalData.onHandlers[i]; 1763 - removeEventListenerImpl(elt, handlerInfo.event, handlerInfo.listener); 1764 - } 1765 - delete internalData.onHandlers; 1766 - } 1767 - } 1768 - 1769 - /** 1770 - * @param {Node} element 1771 - */ 1772 - function deInitNode(element) { 1773 - const internalData = getInternalData(element); 1774 - if (internalData.timeout) { 1775 - clearTimeout(internalData.timeout); 1776 - } 1777 - if (internalData.listenerInfos) { 1778 - forEach(internalData.listenerInfos, function (info) { 1779 - if (info.on) { 1780 - removeEventListenerImpl(info.on, info.trigger, info.listener); 1781 - } 1782 - }); 1783 - } 1784 - deInitOnHandlers(element); 1785 - forEach(Object.keys(internalData), function (key) { 1786 - if (key !== "firstInitCompleted") delete internalData[key]; 1787 - }); 1788 - } 1789 - 1790 - /** 1791 - * @param {Node} element 1792 - */ 1793 - function cleanUpElement(element) { 1794 - triggerEvent(element, "htmx:beforeCleanupElement"); 1795 - deInitNode(element); 1796 - // @ts-ignore IE11 code 1797 - // noinspection JSUnresolvedReference 1798 - if (element.children) { 1799 - // IE 1800 - // @ts-ignore 1801 - forEach(element.children, function (child) { 1802 - cleanUpElement(child); 1803 - }); 1804 - } 1805 - } 1806 - 1807 - /** 1808 - * @param {Node} target 1809 - * @param {ParentNode} fragment 1810 - * @param {HtmxSettleInfo} settleInfo 1811 - */ 1812 - function swapOuterHTML(target, fragment, settleInfo) { 1813 - if (target instanceof Element && target.tagName === "BODY") { 1814 - // special case the body to innerHTML because DocumentFragments can't contain a body elt unfortunately 1815 - return swapInnerHTML(target, fragment, settleInfo); 1816 - } 1817 - /** @type {Node} */ 1818 - let newElt; 1819 - const eltBeforeNewContent = target.previousSibling; 1820 - const parentNode = parentElt(target); 1821 - if (!parentNode) { 1822 - // when parent node disappears, we can't do anything 1823 - return; 1824 - } 1825 - insertNodesBefore(parentNode, target, fragment, settleInfo); 1826 - if (eltBeforeNewContent == null) { 1827 - newElt = parentNode.firstChild; 1828 - } else { 1829 - newElt = eltBeforeNewContent.nextSibling; 1830 - } 1831 - settleInfo.elts = settleInfo.elts.filter(function (e) { 1832 - return e !== target; 1833 - }); 1834 - // scan through all newly added content and add all elements to the settle info so we trigger 1835 - // events properly on them 1836 - while (newElt && newElt !== target) { 1837 - if (newElt instanceof Element) { 1838 - settleInfo.elts.push(newElt); 1839 - } 1840 - newElt = newElt.nextSibling; 1841 - } 1842 - cleanUpElement(target); 1843 - if (target instanceof Element) { 1844 - target.remove(); 1845 - } else { 1846 - target.parentNode.removeChild(target); 1847 - } 1848 - } 1849 - 1850 - /** 1851 - * @param {Node} target 1852 - * @param {ParentNode} fragment 1853 - * @param {HtmxSettleInfo} settleInfo 1854 - */ 1855 - function swapAfterBegin(target, fragment, settleInfo) { 1856 - return insertNodesBefore(target, target.firstChild, fragment, settleInfo); 1857 - } 1858 - 1859 - /** 1860 - * @param {Node} target 1861 - * @param {ParentNode} fragment 1862 - * @param {HtmxSettleInfo} settleInfo 1863 - */ 1864 - function swapBeforeBegin(target, fragment, settleInfo) { 1865 - return insertNodesBefore(parentElt(target), target, fragment, settleInfo); 1866 - } 1867 - 1868 - /** 1869 - * @param {Node} target 1870 - * @param {ParentNode} fragment 1871 - * @param {HtmxSettleInfo} settleInfo 1872 - */ 1873 - function swapBeforeEnd(target, fragment, settleInfo) { 1874 - return insertNodesBefore(target, null, fragment, settleInfo); 1875 - } 1876 - 1877 - /** 1878 - * @param {Node} target 1879 - * @param {ParentNode} fragment 1880 - * @param {HtmxSettleInfo} settleInfo 1881 - */ 1882 - function swapAfterEnd(target, fragment, settleInfo) { 1883 - return insertNodesBefore( 1884 - parentElt(target), 1885 - target.nextSibling, 1886 - fragment, 1887 - settleInfo, 1888 - ); 1889 - } 1890 - 1891 - /** 1892 - * @param {Node} target 1893 - */ 1894 - function swapDelete(target) { 1895 - cleanUpElement(target); 1896 - const parent = parentElt(target); 1897 - if (parent) { 1898 - return parent.removeChild(target); 1899 - } 1900 - } 1901 - 1902 - /** 1903 - * @param {Node} target 1904 - * @param {ParentNode} fragment 1905 - * @param {HtmxSettleInfo} settleInfo 1906 - */ 1907 - function swapInnerHTML(target, fragment, settleInfo) { 1908 - const firstChild = target.firstChild; 1909 - insertNodesBefore(target, firstChild, fragment, settleInfo); 1910 - if (firstChild) { 1911 - while (firstChild.nextSibling) { 1912 - cleanUpElement(firstChild.nextSibling); 1913 - target.removeChild(firstChild.nextSibling); 1914 - } 1915 - cleanUpElement(firstChild); 1916 - target.removeChild(firstChild); 1917 - } 1918 - } 1919 - 1920 - /** 1921 - * @param {HtmxSwapStyle} swapStyle 1922 - * @param {Element} elt 1923 - * @param {Node} target 1924 - * @param {ParentNode} fragment 1925 - * @param {HtmxSettleInfo} settleInfo 1926 - */ 1927 - function swapWithStyle(swapStyle, elt, target, fragment, settleInfo) { 1928 - switch (swapStyle) { 1929 - case "none": 1930 - return; 1931 - case "outerHTML": 1932 - swapOuterHTML(target, fragment, settleInfo); 1933 - return; 1934 - case "afterbegin": 1935 - swapAfterBegin(target, fragment, settleInfo); 1936 - return; 1937 - case "beforebegin": 1938 - swapBeforeBegin(target, fragment, settleInfo); 1939 - return; 1940 - case "beforeend": 1941 - swapBeforeEnd(target, fragment, settleInfo); 1942 - return; 1943 - case "afterend": 1944 - swapAfterEnd(target, fragment, settleInfo); 1945 - return; 1946 - case "delete": 1947 - swapDelete(target); 1948 - return; 1949 - default: 1950 - var extensions = getExtensions(elt); 1951 - for (let i = 0; i < extensions.length; i++) { 1952 - const ext = extensions[i]; 1953 - try { 1954 - const newElements = ext.handleSwap( 1955 - swapStyle, 1956 - target, 1957 - fragment, 1958 - settleInfo, 1959 - ); 1960 - if (newElements) { 1961 - if (Array.isArray(newElements)) { 1962 - // if handleSwap returns an array (like) of elements, we handle them 1963 - for (let j = 0; j < newElements.length; j++) { 1964 - const child = newElements[j]; 1965 - if ( 1966 - child.nodeType !== Node.TEXT_NODE && 1967 - child.nodeType !== Node.COMMENT_NODE 1968 - ) { 1969 - settleInfo.tasks.push(makeAjaxLoadTask(child)); 1970 - } 1971 - } 1972 - } 1973 - return; 1974 - } 1975 - } catch (e) { 1976 - logError(e); 1977 - } 1978 - } 1979 - if (swapStyle === "innerHTML") { 1980 - swapInnerHTML(target, fragment, settleInfo); 1981 - } else { 1982 - swapWithStyle( 1983 - htmx.config.defaultSwapStyle, 1984 - elt, 1985 - target, 1986 - fragment, 1987 - settleInfo, 1988 - ); 1989 - } 1990 - } 1991 - } 1992 - 1993 - /** 1994 - * @param {DocumentFragment} fragment 1995 - * @param {HtmxSettleInfo} settleInfo 1996 - * @param {Node|Document} [rootNode] 1997 - */ 1998 - function findAndSwapOobElements(fragment, settleInfo, rootNode) { 1999 - var oobElts = findAll(fragment, "[hx-swap-oob], [data-hx-swap-oob]"); 2000 - forEach(oobElts, function (oobElement) { 2001 - if ( 2002 - htmx.config.allowNestedOobSwaps || 2003 - oobElement.parentElement === null 2004 - ) { 2005 - const oobValue = getAttributeValue(oobElement, "hx-swap-oob"); 2006 - if (oobValue != null) { 2007 - oobSwap(oobValue, oobElement, settleInfo, rootNode); 2008 - } 2009 - } else { 2010 - oobElement.removeAttribute("hx-swap-oob"); 2011 - oobElement.removeAttribute("data-hx-swap-oob"); 2012 - } 2013 - }); 2014 - return oobElts.length > 0; 2015 - } 2016 - 2017 - /** 2018 - * Implements complete swapping pipeline, including: focus and selection preservation, 2019 - * title updates, scroll, OOB swapping, normal swapping and settling 2020 - * @param {string|Element} target 2021 - * @param {string} content 2022 - * @param {HtmxSwapSpecification} swapSpec 2023 - * @param {SwapOptions} [swapOptions] 2024 - */ 2025 - function swap(target, content, swapSpec, swapOptions) { 2026 - if (!swapOptions) { 2027 - swapOptions = {}; 2028 - } 2029 - 2030 - target = resolveTarget(target); 2031 - const rootNode = swapOptions.contextElement 2032 - ? getRootNode(swapOptions.contextElement, false) 2033 - : getDocument(); 2034 - 2035 - // preserve focus and selection 2036 - const activeElt = document.activeElement; 2037 - let selectionInfo = {}; 2038 - try { 2039 - selectionInfo = { 2040 - elt: activeElt, 2041 - // @ts-ignore 2042 - start: activeElt ? activeElt.selectionStart : null, 2043 - // @ts-ignore 2044 - end: activeElt ? activeElt.selectionEnd : null, 2045 - }; 2046 - } catch (e) { 2047 - // safari issue - see https://github.com/microsoft/playwright/issues/5894 2048 - } 2049 - const settleInfo = makeSettleInfo(target); 2050 - 2051 - // For text content swaps, don't parse the response as HTML, just insert it 2052 - if (swapSpec.swapStyle === "textContent") { 2053 - target.textContent = content; 2054 - // Otherwise, make the fragment and process it 2055 - } else { 2056 - let fragment = makeFragment(content); 2057 - 2058 - settleInfo.title = fragment.title; 2059 - 2060 - // select-oob swaps 2061 - if (swapOptions.selectOOB) { 2062 - const oobSelectValues = swapOptions.selectOOB.split(","); 2063 - for (let i = 0; i < oobSelectValues.length; i++) { 2064 - const oobSelectValue = oobSelectValues[i].split(":", 2); 2065 - let id = oobSelectValue[0].trim(); 2066 - if (id.indexOf("#") === 0) { 2067 - id = id.substring(1); 2068 - } 2069 - const oobValue = oobSelectValue[1] || "true"; 2070 - const oobElement = fragment.querySelector("#" + id); 2071 - if (oobElement) { 2072 - oobSwap(oobValue, oobElement, settleInfo, rootNode); 2073 - } 2074 - } 2075 - } 2076 - // oob swaps 2077 - findAndSwapOobElements(fragment, settleInfo, rootNode); 2078 - forEach( 2079 - findAll(fragment, "template"), 2080 - /** @param {HTMLTemplateElement} template */ function (template) { 2081 - if ( 2082 - template.content && 2083 - findAndSwapOobElements(template.content, settleInfo, rootNode) 2084 - ) { 2085 - // Avoid polluting the DOM with empty templates that were only used to encapsulate oob swap 2086 - template.remove(); 2087 - } 2088 - }, 2089 - ); 2090 - 2091 - // normal swap 2092 - if (swapOptions.select) { 2093 - const newFragment = getDocument().createDocumentFragment(); 2094 - forEach(fragment.querySelectorAll(swapOptions.select), function (node) { 2095 - newFragment.appendChild(node); 2096 - }); 2097 - fragment = newFragment; 2098 - } 2099 - handlePreservedElements(fragment); 2100 - swapWithStyle( 2101 - swapSpec.swapStyle, 2102 - swapOptions.contextElement, 2103 - target, 2104 - fragment, 2105 - settleInfo, 2106 - ); 2107 - restorePreservedElements(); 2108 - } 2109 - 2110 - // apply saved focus and selection information to swapped content 2111 - if ( 2112 - selectionInfo.elt && 2113 - !bodyContains(selectionInfo.elt) && 2114 - getRawAttribute(selectionInfo.elt, "id") 2115 - ) { 2116 - const newActiveElt = document.getElementById( 2117 - getRawAttribute(selectionInfo.elt, "id"), 2118 - ); 2119 - const focusOptions = { 2120 - preventScroll: 2121 - swapSpec.focusScroll !== undefined 2122 - ? !swapSpec.focusScroll 2123 - : !htmx.config.defaultFocusScroll, 2124 - }; 2125 - if (newActiveElt) { 2126 - // @ts-ignore 2127 - if (selectionInfo.start && newActiveElt.setSelectionRange) { 2128 - try { 2129 - // @ts-ignore 2130 - newActiveElt.setSelectionRange( 2131 - selectionInfo.start, 2132 - selectionInfo.end, 2133 - ); 2134 - } catch (e) { 2135 - // the setSelectionRange method is present on fields that don't support it, so just let this fail 2136 - } 2137 - } 2138 - newActiveElt.focus(focusOptions); 2139 - } 2140 - } 2141 - 2142 - target.classList.remove(htmx.config.swappingClass); 2143 - forEach(settleInfo.elts, function (elt) { 2144 - if (elt.classList) { 2145 - elt.classList.add(htmx.config.settlingClass); 2146 - } 2147 - triggerEvent(elt, "htmx:afterSwap", swapOptions.eventInfo); 2148 - }); 2149 - if (swapOptions.afterSwapCallback) { 2150 - swapOptions.afterSwapCallback(); 2151 - } 2152 - 2153 - // merge in new title after swap but before settle 2154 - if (!swapSpec.ignoreTitle) { 2155 - handleTitle(settleInfo.title); 2156 - } 2157 - 2158 - // settle 2159 - const doSettle = function () { 2160 - forEach(settleInfo.tasks, function (task) { 2161 - task.call(); 2162 - }); 2163 - forEach(settleInfo.elts, function (elt) { 2164 - if (elt.classList) { 2165 - elt.classList.remove(htmx.config.settlingClass); 2166 - } 2167 - triggerEvent(elt, "htmx:afterSettle", swapOptions.eventInfo); 2168 - }); 2169 - 2170 - if (swapOptions.anchor) { 2171 - const anchorTarget = asElement(resolveTarget("#" + swapOptions.anchor)); 2172 - if (anchorTarget) { 2173 - anchorTarget.scrollIntoView({ block: "start", behavior: "auto" }); 2174 - } 2175 - } 2176 - 2177 - updateScrollState(settleInfo.elts, swapSpec); 2178 - if (swapOptions.afterSettleCallback) { 2179 - swapOptions.afterSettleCallback(); 2180 - } 2181 - }; 2182 - 2183 - if (swapSpec.settleDelay > 0) { 2184 - getWindow().setTimeout(doSettle, swapSpec.settleDelay); 2185 - } else { 2186 - doSettle(); 2187 - } 2188 - } 2189 - 2190 - /** 2191 - * @param {XMLHttpRequest} xhr 2192 - * @param {string} header 2193 - * @param {EventTarget} elt 2194 - */ 2195 - function handleTriggerHeader(xhr, header, elt) { 2196 - const triggerBody = xhr.getResponseHeader(header); 2197 - if (triggerBody.indexOf("{") === 0) { 2198 - const triggers = parseJSON(triggerBody); 2199 - for (const eventName in triggers) { 2200 - if (triggers.hasOwnProperty(eventName)) { 2201 - let detail = triggers[eventName]; 2202 - if (isRawObject(detail)) { 2203 - // @ts-ignore 2204 - elt = detail.target !== undefined ? detail.target : elt; 2205 - } else { 2206 - detail = { value: detail }; 2207 - } 2208 - triggerEvent(elt, eventName, detail); 2209 - } 2210 - } 2211 - } else { 2212 - const eventNames = triggerBody.split(","); 2213 - for (let i = 0; i < eventNames.length; i++) { 2214 - triggerEvent(elt, eventNames[i].trim(), []); 2215 - } 2216 - } 2217 - } 2218 - 2219 - const WHITESPACE = /\s/; 2220 - const WHITESPACE_OR_COMMA = /[\s,]/; 2221 - const SYMBOL_START = /[_$a-zA-Z]/; 2222 - const SYMBOL_CONT = /[_$a-zA-Z0-9]/; 2223 - const STRINGISH_START = ['"', "'", "/"]; 2224 - const NOT_WHITESPACE = /[^\s]/; 2225 - const COMBINED_SELECTOR_START = /[{(]/; 2226 - const COMBINED_SELECTOR_END = /[})]/; 2227 - 2228 - /** 2229 - * @param {string} str 2230 - * @returns {string[]} 2231 - */ 2232 - function tokenizeString(str) { 2233 - /** @type string[] */ 2234 - const tokens = []; 2235 - let position = 0; 2236 - while (position < str.length) { 2237 - if (SYMBOL_START.exec(str.charAt(position))) { 2238 - var startPosition = position; 2239 - while (SYMBOL_CONT.exec(str.charAt(position + 1))) { 2240 - position++; 2241 - } 2242 - tokens.push(str.substring(startPosition, position + 1)); 2243 - } else if (STRINGISH_START.indexOf(str.charAt(position)) !== -1) { 2244 - const startChar = str.charAt(position); 2245 - var startPosition = position; 2246 - position++; 2247 - while (position < str.length && str.charAt(position) !== startChar) { 2248 - if (str.charAt(position) === "\\") { 2249 - position++; 2250 - } 2251 - position++; 2252 - } 2253 - tokens.push(str.substring(startPosition, position + 1)); 2254 - } else { 2255 - const symbol = str.charAt(position); 2256 - tokens.push(symbol); 2257 - } 2258 - position++; 2259 - } 2260 - return tokens; 2261 - } 2262 - 2263 - /** 2264 - * @param {string} token 2265 - * @param {string|null} last 2266 - * @param {string} paramName 2267 - * @returns {boolean} 2268 - */ 2269 - function isPossibleRelativeReference(token, last, paramName) { 2270 - return ( 2271 - SYMBOL_START.exec(token.charAt(0)) && 2272 - token !== "true" && 2273 - token !== "false" && 2274 - token !== "this" && 2275 - token !== paramName && 2276 - last !== "." 2277 - ); 2278 - } 2279 - 2280 - /** 2281 - * @param {EventTarget|string} elt 2282 - * @param {string[]} tokens 2283 - * @param {string} paramName 2284 - * @returns {ConditionalFunction|null} 2285 - */ 2286 - function maybeGenerateConditional(elt, tokens, paramName) { 2287 - if (tokens[0] === "[") { 2288 - tokens.shift(); 2289 - let bracketCount = 1; 2290 - let conditionalSource = " return (function(" + paramName + "){ return ("; 2291 - let last = null; 2292 - while (tokens.length > 0) { 2293 - const token = tokens[0]; 2294 - // @ts-ignore For some reason tsc doesn't understand the shift call, and thinks we're comparing the same value here, i.e. '[' vs ']' 2295 - if (token === "]") { 2296 - bracketCount--; 2297 - if (bracketCount === 0) { 2298 - if (last === null) { 2299 - conditionalSource = conditionalSource + "true"; 2300 - } 2301 - tokens.shift(); 2302 - conditionalSource += ")})"; 2303 - try { 2304 - const conditionFunction = maybeEval( 2305 - elt, 2306 - function () { 2307 - return Function(conditionalSource)(); 2308 - }, 2309 - function () { 2310 - return true; 2311 - }, 2312 - ); 2313 - conditionFunction.source = conditionalSource; 2314 - return conditionFunction; 2315 - } catch (e) { 2316 - triggerErrorEvent(getDocument().body, "htmx:syntax:error", { 2317 - error: e, 2318 - source: conditionalSource, 2319 - }); 2320 - return null; 2321 - } 2322 - } 2323 - } else if (token === "[") { 2324 - bracketCount++; 2325 - } 2326 - if (isPossibleRelativeReference(token, last, paramName)) { 2327 - conditionalSource += 2328 - "((" + 2329 - paramName + 2330 - "." + 2331 - token + 2332 - ") ? (" + 2333 - paramName + 2334 - "." + 2335 - token + 2336 - ") : (window." + 2337 - token + 2338 - "))"; 2339 - } else { 2340 - conditionalSource = conditionalSource + token; 2341 - } 2342 - last = tokens.shift(); 2343 - } 2344 - } 2345 - } 2346 - 2347 - /** 2348 - * @param {string[]} tokens 2349 - * @param {RegExp} match 2350 - * @returns {string} 2351 - */ 2352 - function consumeUntil(tokens, match) { 2353 - let result = ""; 2354 - while (tokens.length > 0 && !match.test(tokens[0])) { 2355 - result += tokens.shift(); 2356 - } 2357 - return result; 2358 - } 2359 - 2360 - /** 2361 - * @param {string[]} tokens 2362 - * @returns {string} 2363 - */ 2364 - function consumeCSSSelector(tokens) { 2365 - let result; 2366 - if (tokens.length > 0 && COMBINED_SELECTOR_START.test(tokens[0])) { 2367 - tokens.shift(); 2368 - result = consumeUntil(tokens, COMBINED_SELECTOR_END).trim(); 2369 - tokens.shift(); 2370 - } else { 2371 - result = consumeUntil(tokens, WHITESPACE_OR_COMMA); 2372 - } 2373 - return result; 2374 - } 2375 - 2376 - const INPUT_SELECTOR = "input, textarea, select"; 2377 - 2378 - /** 2379 - * @param {Element} elt 2380 - * @param {string} explicitTrigger 2381 - * @param {Object} cache for trigger specs 2382 - * @returns {HtmxTriggerSpecification[]} 2383 - */ 2384 - function parseAndCacheTrigger(elt, explicitTrigger, cache) { 2385 - /** @type HtmxTriggerSpecification[] */ 2386 - const triggerSpecs = []; 2387 - const tokens = tokenizeString(explicitTrigger); 2388 - do { 2389 - consumeUntil(tokens, NOT_WHITESPACE); 2390 - const initialLength = tokens.length; 2391 - const trigger = consumeUntil(tokens, /[,\[\s]/); 2392 - if (trigger !== "") { 2393 - if (trigger === "every") { 2394 - /** @type HtmxTriggerSpecification */ 2395 - const every = { trigger: "every" }; 2396 - consumeUntil(tokens, NOT_WHITESPACE); 2397 - every.pollInterval = parseInterval(consumeUntil(tokens, /[,\[\s]/)); 2398 - consumeUntil(tokens, NOT_WHITESPACE); 2399 - var eventFilter = maybeGenerateConditional(elt, tokens, "event"); 2400 - if (eventFilter) { 2401 - every.eventFilter = eventFilter; 2402 - } 2403 - triggerSpecs.push(every); 2404 - } else { 2405 - /** @type HtmxTriggerSpecification */ 2406 - const triggerSpec = { trigger }; 2407 - var eventFilter = maybeGenerateConditional(elt, tokens, "event"); 2408 - if (eventFilter) { 2409 - triggerSpec.eventFilter = eventFilter; 2410 - } 2411 - consumeUntil(tokens, NOT_WHITESPACE); 2412 - while (tokens.length > 0 && tokens[0] !== ",") { 2413 - const token = tokens.shift(); 2414 - if (token === "changed") { 2415 - triggerSpec.changed = true; 2416 - } else if (token === "once") { 2417 - triggerSpec.once = true; 2418 - } else if (token === "consume") { 2419 - triggerSpec.consume = true; 2420 - } else if (token === "delay" && tokens[0] === ":") { 2421 - tokens.shift(); 2422 - triggerSpec.delay = parseInterval( 2423 - consumeUntil(tokens, WHITESPACE_OR_COMMA), 2424 - ); 2425 - } else if (token === "from" && tokens[0] === ":") { 2426 - tokens.shift(); 2427 - if (COMBINED_SELECTOR_START.test(tokens[0])) { 2428 - var from_arg = consumeCSSSelector(tokens); 2429 - } else { 2430 - var from_arg = consumeUntil(tokens, WHITESPACE_OR_COMMA); 2431 - if ( 2432 - from_arg === "closest" || 2433 - from_arg === "find" || 2434 - from_arg === "next" || 2435 - from_arg === "previous" 2436 - ) { 2437 - tokens.shift(); 2438 - const selector = consumeCSSSelector(tokens); 2439 - // `next` and `previous` allow a selector-less syntax 2440 - if (selector.length > 0) { 2441 - from_arg += " " + selector; 2442 - } 2443 - } 2444 - } 2445 - triggerSpec.from = from_arg; 2446 - } else if (token === "target" && tokens[0] === ":") { 2447 - tokens.shift(); 2448 - triggerSpec.target = consumeCSSSelector(tokens); 2449 - } else if (token === "throttle" && tokens[0] === ":") { 2450 - tokens.shift(); 2451 - triggerSpec.throttle = parseInterval( 2452 - consumeUntil(tokens, WHITESPACE_OR_COMMA), 2453 - ); 2454 - } else if (token === "queue" && tokens[0] === ":") { 2455 - tokens.shift(); 2456 - triggerSpec.queue = consumeUntil(tokens, WHITESPACE_OR_COMMA); 2457 - } else if (token === "root" && tokens[0] === ":") { 2458 - tokens.shift(); 2459 - triggerSpec[token] = consumeCSSSelector(tokens); 2460 - } else if (token === "threshold" && tokens[0] === ":") { 2461 - tokens.shift(); 2462 - triggerSpec[token] = consumeUntil(tokens, WHITESPACE_OR_COMMA); 2463 - } else { 2464 - triggerErrorEvent(elt, "htmx:syntax:error", { 2465 - token: tokens.shift(), 2466 - }); 2467 - } 2468 - consumeUntil(tokens, NOT_WHITESPACE); 2469 - } 2470 - triggerSpecs.push(triggerSpec); 2471 - } 2472 - } 2473 - if (tokens.length === initialLength) { 2474 - triggerErrorEvent(elt, "htmx:syntax:error", { token: tokens.shift() }); 2475 - } 2476 - consumeUntil(tokens, NOT_WHITESPACE); 2477 - } while (tokens[0] === "," && tokens.shift()); 2478 - if (cache) { 2479 - cache[explicitTrigger] = triggerSpecs; 2480 - } 2481 - return triggerSpecs; 2482 - } 2483 - 2484 - /** 2485 - * @param {Element} elt 2486 - * @returns {HtmxTriggerSpecification[]} 2487 - */ 2488 - function getTriggerSpecs(elt) { 2489 - const explicitTrigger = getAttributeValue(elt, "hx-trigger"); 2490 - let triggerSpecs = []; 2491 - if (explicitTrigger) { 2492 - const cache = htmx.config.triggerSpecsCache; 2493 - triggerSpecs = 2494 - (cache && cache[explicitTrigger]) || 2495 - parseAndCacheTrigger(elt, explicitTrigger, cache); 2496 - } 2497 - 2498 - if (triggerSpecs.length > 0) { 2499 - return triggerSpecs; 2500 - } else if (matches(elt, "form")) { 2501 - return [{ trigger: "submit" }]; 2502 - } else if (matches(elt, 'input[type="button"], input[type="submit"]')) { 2503 - return [{ trigger: "click" }]; 2504 - } else if (matches(elt, INPUT_SELECTOR)) { 2505 - return [{ trigger: "change" }]; 2506 - } else { 2507 - return [{ trigger: "click" }]; 2508 - } 2509 - } 2510 - 2511 - /** 2512 - * @param {Element} elt 2513 - */ 2514 - function cancelPolling(elt) { 2515 - getInternalData(elt).cancelled = true; 2516 - } 2517 - 2518 - /** 2519 - * @param {Element} elt 2520 - * @param {TriggerHandler} handler 2521 - * @param {HtmxTriggerSpecification} spec 2522 - */ 2523 - function processPolling(elt, handler, spec) { 2524 - const nodeData = getInternalData(elt); 2525 - nodeData.timeout = getWindow().setTimeout(function () { 2526 - if (bodyContains(elt) && nodeData.cancelled !== true) { 2527 - if ( 2528 - !maybeFilterEvent( 2529 - spec, 2530 - elt, 2531 - makeEvent("hx:poll:trigger", { 2532 - triggerSpec: spec, 2533 - target: elt, 2534 - }), 2535 - ) 2536 - ) { 2537 - handler(elt); 2538 - } 2539 - processPolling(elt, handler, spec); 2540 - } 2541 - }, spec.pollInterval); 2542 - } 2543 - 2544 - /** 2545 - * @param {HTMLAnchorElement} elt 2546 - * @returns {boolean} 2547 - */ 2548 - function isLocalLink(elt) { 2549 - return ( 2550 - location.hostname === elt.hostname && 2551 - getRawAttribute(elt, "href") && 2552 - getRawAttribute(elt, "href").indexOf("#") !== 0 2553 - ); 2554 - } 2555 - 2556 - /** 2557 - * @param {Element} elt 2558 - */ 2559 - function eltIsDisabled(elt) { 2560 - return closest(elt, htmx.config.disableSelector); 2561 - } 2562 - 2563 - /** 2564 - * @param {Element} elt 2565 - * @param {HtmxNodeInternalData} nodeData 2566 - * @param {HtmxTriggerSpecification[]} triggerSpecs 2567 - */ 2568 - function boostElement(elt, nodeData, triggerSpecs) { 2569 - if ( 2570 - (elt instanceof HTMLAnchorElement && 2571 - isLocalLink(elt) && 2572 - (elt.target === "" || elt.target === "_self")) || 2573 - (elt.tagName === "FORM" && 2574 - String(getRawAttribute(elt, "method")).toLowerCase() !== "dialog") 2575 - ) { 2576 - nodeData.boosted = true; 2577 - let verb, path; 2578 - if (elt.tagName === "A") { 2579 - verb = /** @type HttpVerb */ ("get"); 2580 - path = getRawAttribute(elt, "href"); 2581 - } else { 2582 - const rawAttribute = getRawAttribute(elt, "method"); 2583 - verb = /** @type HttpVerb */ ( 2584 - rawAttribute ? rawAttribute.toLowerCase() : "get" 2585 - ); 2586 - path = getRawAttribute(elt, "action"); 2587 - if (path == null || path === "") { 2588 - // if there is no action attribute on the form set path to current href before the 2589 - // following logic to properly clear parameters on a GET (not on a POST!) 2590 - path = getDocument().location.href; 2591 - } 2592 - if (verb === "get" && path.includes("?")) { 2593 - path = path.replace(/\?[^#]+/, ""); 2594 - } 2595 - } 2596 - triggerSpecs.forEach(function (triggerSpec) { 2597 - addEventListener( 2598 - elt, 2599 - function (node, evt) { 2600 - const elt = asElement(node); 2601 - if (eltIsDisabled(elt)) { 2602 - cleanUpElement(elt); 2603 - return; 2604 - } 2605 - issueAjaxRequest(verb, path, elt, evt); 2606 - }, 2607 - nodeData, 2608 - triggerSpec, 2609 - true, 2610 - ); 2611 - }); 2612 - } 2613 - } 2614 - 2615 - /** 2616 - * @param {Event} evt 2617 - * @param {Node} node 2618 - * @returns {boolean} 2619 - */ 2620 - function shouldCancel(evt, node) { 2621 - const elt = asElement(node); 2622 - if (!elt) { 2623 - return false; 2624 - } 2625 - if (evt.type === "submit" || evt.type === "click") { 2626 - if (elt.tagName === "FORM") { 2627 - return true; 2628 - } 2629 - if ( 2630 - matches(elt, 'input[type="submit"], button') && 2631 - (matches(elt, "[form]") || closest(elt, "form") !== null) 2632 - ) { 2633 - return true; 2634 - } 2635 - if ( 2636 - elt instanceof HTMLAnchorElement && 2637 - elt.href && 2638 - (elt.getAttribute("href") === "#" || 2639 - elt.getAttribute("href").indexOf("#") !== 0) 2640 - ) { 2641 - return true; 2642 - } 2643 - } 2644 - return false; 2645 - } 2646 - 2647 - /** 2648 - * @param {Node} elt 2649 - * @param {Event|MouseEvent|KeyboardEvent|TouchEvent} evt 2650 - * @returns {boolean} 2651 - */ 2652 - function ignoreBoostedAnchorCtrlClick(elt, evt) { 2653 - return ( 2654 - getInternalData(elt).boosted && 2655 - elt instanceof HTMLAnchorElement && 2656 - evt.type === "click" && 2657 - // @ts-ignore this will resolve to undefined for events that don't define those properties, which is fine 2658 - (evt.ctrlKey || evt.metaKey) 2659 - ); 2660 - } 2661 - 2662 - /** 2663 - * @param {HtmxTriggerSpecification} triggerSpec 2664 - * @param {Node} elt 2665 - * @param {Event} evt 2666 - * @returns {boolean} 2667 - */ 2668 - function maybeFilterEvent(triggerSpec, elt, evt) { 2669 - const eventFilter = triggerSpec.eventFilter; 2670 - if (eventFilter) { 2671 - try { 2672 - return eventFilter.call(elt, evt) !== true; 2673 - } catch (e) { 2674 - const source = eventFilter.source; 2675 - triggerErrorEvent(getDocument().body, "htmx:eventFilter:error", { 2676 - error: e, 2677 - source, 2678 - }); 2679 - return true; 2680 - } 2681 - } 2682 - return false; 2683 - } 2684 - 2685 - /** 2686 - * @param {Node} elt 2687 - * @param {TriggerHandler} handler 2688 - * @param {HtmxNodeInternalData} nodeData 2689 - * @param {HtmxTriggerSpecification} triggerSpec 2690 - * @param {boolean} [explicitCancel] 2691 - */ 2692 - function addEventListener( 2693 - elt, 2694 - handler, 2695 - nodeData, 2696 - triggerSpec, 2697 - explicitCancel, 2698 - ) { 2699 - const elementData = getInternalData(elt); 2700 - /** @type {(Node|Window)[]} */ 2701 - let eltsToListenOn; 2702 - if (triggerSpec.from) { 2703 - eltsToListenOn = querySelectorAllExt(elt, triggerSpec.from); 2704 - } else { 2705 - eltsToListenOn = [elt]; 2706 - } 2707 - // store the initial values of the elements, so we can tell if they change 2708 - if (triggerSpec.changed) { 2709 - if (!("lastValue" in elementData)) { 2710 - elementData.lastValue = new WeakMap(); 2711 - } 2712 - eltsToListenOn.forEach(function (eltToListenOn) { 2713 - if (!elementData.lastValue.has(triggerSpec)) { 2714 - elementData.lastValue.set(triggerSpec, new WeakMap()); 2715 - } 2716 - // @ts-ignore value will be undefined for non-input elements, which is fine 2717 - elementData.lastValue 2718 - .get(triggerSpec) 2719 - .set(eltToListenOn, eltToListenOn.value); 2720 - }); 2721 - } 2722 - forEach(eltsToListenOn, function (eltToListenOn) { 2723 - /** @type EventListener */ 2724 - const eventListener = function (evt) { 2725 - if (!bodyContains(elt)) { 2726 - eltToListenOn.removeEventListener(triggerSpec.trigger, eventListener); 2727 - return; 2728 - } 2729 - if (ignoreBoostedAnchorCtrlClick(elt, evt)) { 2730 - return; 2731 - } 2732 - if (explicitCancel || shouldCancel(evt, elt)) { 2733 - evt.preventDefault(); 2734 - } 2735 - if (maybeFilterEvent(triggerSpec, elt, evt)) { 2736 - return; 2737 - } 2738 - const eventData = getInternalData(evt); 2739 - eventData.triggerSpec = triggerSpec; 2740 - if (eventData.handledFor == null) { 2741 - eventData.handledFor = []; 2742 - } 2743 - if (eventData.handledFor.indexOf(elt) < 0) { 2744 - eventData.handledFor.push(elt); 2745 - if (triggerSpec.consume) { 2746 - evt.stopPropagation(); 2747 - } 2748 - if (triggerSpec.target && evt.target) { 2749 - if (!matches(asElement(evt.target), triggerSpec.target)) { 2750 - return; 2751 - } 2752 - } 2753 - if (triggerSpec.once) { 2754 - if (elementData.triggeredOnce) { 2755 - return; 2756 - } else { 2757 - elementData.triggeredOnce = true; 2758 - } 2759 - } 2760 - if (triggerSpec.changed) { 2761 - const node = event.target; 2762 - // @ts-ignore value will be undefined for non-input elements, which is fine 2763 - const value = node.value; 2764 - const lastValue = elementData.lastValue.get(triggerSpec); 2765 - if (lastValue.has(node) && lastValue.get(node) === value) { 2766 - return; 2767 - } 2768 - lastValue.set(node, value); 2769 - } 2770 - if (elementData.delayed) { 2771 - clearTimeout(elementData.delayed); 2772 - } 2773 - if (elementData.throttle) { 2774 - return; 2775 - } 2776 - 2777 - if (triggerSpec.throttle > 0) { 2778 - if (!elementData.throttle) { 2779 - triggerEvent(elt, "htmx:trigger"); 2780 - handler(elt, evt); 2781 - elementData.throttle = getWindow().setTimeout(function () { 2782 - elementData.throttle = null; 2783 - }, triggerSpec.throttle); 2784 - } 2785 - } else if (triggerSpec.delay > 0) { 2786 - elementData.delayed = getWindow().setTimeout(function () { 2787 - triggerEvent(elt, "htmx:trigger"); 2788 - handler(elt, evt); 2789 - }, triggerSpec.delay); 2790 - } else { 2791 - triggerEvent(elt, "htmx:trigger"); 2792 - handler(elt, evt); 2793 - } 2794 - } 2795 - }; 2796 - if (nodeData.listenerInfos == null) { 2797 - nodeData.listenerInfos = []; 2798 - } 2799 - nodeData.listenerInfos.push({ 2800 - trigger: triggerSpec.trigger, 2801 - listener: eventListener, 2802 - on: eltToListenOn, 2803 - }); 2804 - eltToListenOn.addEventListener(triggerSpec.trigger, eventListener); 2805 - }); 2806 - } 2807 - 2808 - let windowIsScrolling = false; // used by initScrollHandler 2809 - let scrollHandler = null; 2810 - function initScrollHandler() { 2811 - if (!scrollHandler) { 2812 - scrollHandler = function () { 2813 - windowIsScrolling = true; 2814 - }; 2815 - window.addEventListener("scroll", scrollHandler); 2816 - window.addEventListener("resize", scrollHandler); 2817 - setInterval(function () { 2818 - if (windowIsScrolling) { 2819 - windowIsScrolling = false; 2820 - forEach( 2821 - getDocument().querySelectorAll( 2822 - "[hx-trigger*='revealed'],[data-hx-trigger*='revealed']", 2823 - ), 2824 - function (elt) { 2825 - maybeReveal(elt); 2826 - }, 2827 - ); 2828 - } 2829 - }, 200); 2830 - } 2831 - } 2832 - 2833 - /** 2834 - * @param {Element} elt 2835 - */ 2836 - function maybeReveal(elt) { 2837 - if (!hasAttribute(elt, "data-hx-revealed") && isScrolledIntoView(elt)) { 2838 - elt.setAttribute("data-hx-revealed", "true"); 2839 - const nodeData = getInternalData(elt); 2840 - if (nodeData.initHash) { 2841 - triggerEvent(elt, "revealed"); 2842 - } else { 2843 - // if the node isn't initialized, wait for it before triggering the request 2844 - elt.addEventListener( 2845 - "htmx:afterProcessNode", 2846 - function () { 2847 - triggerEvent(elt, "revealed"); 2848 - }, 2849 - { once: true }, 2850 - ); 2851 - } 2852 - } 2853 - } 2854 - 2855 - //= =================================================================== 2856 - 2857 - /** 2858 - * @param {Element} elt 2859 - * @param {TriggerHandler} handler 2860 - * @param {HtmxNodeInternalData} nodeData 2861 - * @param {number} delay 2862 - */ 2863 - function loadImmediately(elt, handler, nodeData, delay) { 2864 - const load = function () { 2865 - if (!nodeData.loaded) { 2866 - nodeData.loaded = true; 2867 - triggerEvent(elt, "htmx:trigger"); 2868 - handler(elt); 2869 - } 2870 - }; 2871 - if (delay > 0) { 2872 - getWindow().setTimeout(load, delay); 2873 - } else { 2874 - load(); 2875 - } 2876 - } 2877 - 2878 - /** 2879 - * @param {Element} elt 2880 - * @param {HtmxNodeInternalData} nodeData 2881 - * @param {HtmxTriggerSpecification[]} triggerSpecs 2882 - * @returns {boolean} 2883 - */ 2884 - function processVerbs(elt, nodeData, triggerSpecs) { 2885 - let explicitAction = false; 2886 - forEach(VERBS, function (verb) { 2887 - if (hasAttribute(elt, "hx-" + verb)) { 2888 - const path = getAttributeValue(elt, "hx-" + verb); 2889 - explicitAction = true; 2890 - nodeData.path = path; 2891 - nodeData.verb = verb; 2892 - triggerSpecs.forEach(function (triggerSpec) { 2893 - addTriggerHandler(elt, triggerSpec, nodeData, function (node, evt) { 2894 - const elt = asElement(node); 2895 - if (closest(elt, htmx.config.disableSelector)) { 2896 - cleanUpElement(elt); 2897 - return; 2898 - } 2899 - issueAjaxRequest(verb, path, elt, evt); 2900 - }); 2901 - }); 2902 - } 2903 - }); 2904 - return explicitAction; 2905 - } 2906 - 2907 - /** 2908 - * @callback TriggerHandler 2909 - * @param {Node} elt 2910 - * @param {Event} [evt] 2911 - */ 2912 - 2913 - /** 2914 - * @param {Node} elt 2915 - * @param {HtmxTriggerSpecification} triggerSpec 2916 - * @param {HtmxNodeInternalData} nodeData 2917 - * @param {TriggerHandler} handler 2918 - */ 2919 - function addTriggerHandler(elt, triggerSpec, nodeData, handler) { 2920 - if (triggerSpec.trigger === "revealed") { 2921 - initScrollHandler(); 2922 - addEventListener(elt, handler, nodeData, triggerSpec); 2923 - maybeReveal(asElement(elt)); 2924 - } else if (triggerSpec.trigger === "intersect") { 2925 - const observerOptions = {}; 2926 - if (triggerSpec.root) { 2927 - observerOptions.root = querySelectorExt(elt, triggerSpec.root); 2928 - } 2929 - if (triggerSpec.threshold) { 2930 - observerOptions.threshold = parseFloat(triggerSpec.threshold); 2931 - } 2932 - const observer = new IntersectionObserver(function (entries) { 2933 - for (let i = 0; i < entries.length; i++) { 2934 - const entry = entries[i]; 2935 - if (entry.isIntersecting) { 2936 - triggerEvent(elt, "intersect"); 2937 - break; 2938 - } 2939 - } 2940 - }, observerOptions); 2941 - observer.observe(asElement(elt)); 2942 - addEventListener(asElement(elt), handler, nodeData, triggerSpec); 2943 - } else if (!nodeData.firstInitCompleted && triggerSpec.trigger === "load") { 2944 - if (!maybeFilterEvent(triggerSpec, elt, makeEvent("load", { elt }))) { 2945 - loadImmediately(asElement(elt), handler, nodeData, triggerSpec.delay); 2946 - } 2947 - } else if (triggerSpec.pollInterval > 0) { 2948 - nodeData.polling = true; 2949 - processPolling(asElement(elt), handler, triggerSpec); 2950 - } else { 2951 - addEventListener(elt, handler, nodeData, triggerSpec); 2952 - } 2953 - } 2954 - 2955 - /** 2956 - * @param {Node} node 2957 - * @returns {boolean} 2958 - */ 2959 - function shouldProcessHxOn(node) { 2960 - const elt = asElement(node); 2961 - if (!elt) { 2962 - return false; 2963 - } 2964 - const attributes = elt.attributes; 2965 - for (let j = 0; j < attributes.length; j++) { 2966 - const attrName = attributes[j].name; 2967 - if ( 2968 - startsWith(attrName, "hx-on:") || 2969 - startsWith(attrName, "data-hx-on:") || 2970 - startsWith(attrName, "hx-on-") || 2971 - startsWith(attrName, "data-hx-on-") 2972 - ) { 2973 - return true; 2974 - } 2975 - } 2976 - return false; 2977 - } 2978 - 2979 - /** 2980 - * @param {Node} elt 2981 - * @returns {Element[]} 2982 - */ 2983 - const HX_ON_QUERY = new XPathEvaluator().createExpression( 2984 - './/*[@*[ starts-with(name(), "hx-on:") or starts-with(name(), "data-hx-on:") or' + 2985 - ' starts-with(name(), "hx-on-") or starts-with(name(), "data-hx-on-") ]]', 2986 - ); 2987 - 2988 - function processHXOnRoot(elt, elements) { 2989 - if (shouldProcessHxOn(elt)) { 2990 - elements.push(asElement(elt)); 2991 - } 2992 - const iter = HX_ON_QUERY.evaluate(elt); 2993 - let node = null; 2994 - while ((node = iter.iterateNext())) elements.push(asElement(node)); 2995 - } 2996 - 2997 - function findHxOnWildcardElements(elt) { 2998 - /** @type {Element[]} */ 2999 - const elements = []; 3000 - if (elt instanceof DocumentFragment) { 3001 - for (const child of elt.childNodes) { 3002 - processHXOnRoot(child, elements); 3003 - } 3004 - } else { 3005 - processHXOnRoot(elt, elements); 3006 - } 3007 - return elements; 3008 - } 3009 - 3010 - /** 3011 - * @param {Element} elt 3012 - * @returns {NodeListOf<Element>|[]} 3013 - */ 3014 - function findElementsToProcess(elt) { 3015 - if (elt.querySelectorAll) { 3016 - const boostedSelector = 3017 - ", [hx-boost] a, [data-hx-boost] a, a[hx-boost], a[data-hx-boost]"; 3018 - 3019 - const extensionSelectors = []; 3020 - for (const e in extensions) { 3021 - const extension = extensions[e]; 3022 - if (extension.getSelectors) { 3023 - var selectors = extension.getSelectors(); 3024 - if (selectors) { 3025 - extensionSelectors.push(selectors); 3026 - } 3027 - } 3028 - } 3029 - 3030 - const results = elt.querySelectorAll( 3031 - VERB_SELECTOR + 3032 - boostedSelector + 3033 - ", form, [type='submit']," + 3034 - " [hx-ext], [data-hx-ext], [hx-trigger], [data-hx-trigger]" + 3035 - extensionSelectors 3036 - .flat() 3037 - .map((s) => ", " + s) 3038 - .join(""), 3039 - ); 3040 - 3041 - return results; 3042 - } else { 3043 - return []; 3044 - } 3045 - } 3046 - 3047 - /** 3048 - * Handle submit buttons/inputs that have the form attribute set 3049 - * see https://developer.mozilla.org/docs/Web/HTML/Element/button 3050 - * @param {Event} evt 3051 - */ 3052 - function maybeSetLastButtonClicked(evt) { 3053 - const elt = /** @type {HTMLButtonElement|HTMLInputElement} */ ( 3054 - closest(asElement(evt.target), "button, input[type='submit']") 3055 - ); 3056 - const internalData = getRelatedFormData(evt); 3057 - if (internalData) { 3058 - internalData.lastButtonClicked = elt; 3059 - } 3060 - } 3061 - 3062 - /** 3063 - * @param {Event} evt 3064 - */ 3065 - function maybeUnsetLastButtonClicked(evt) { 3066 - const internalData = getRelatedFormData(evt); 3067 - if (internalData) { 3068 - internalData.lastButtonClicked = null; 3069 - } 3070 - } 3071 - 3072 - /** 3073 - * @param {Event} evt 3074 - * @returns {HtmxNodeInternalData|undefined} 3075 - */ 3076 - function getRelatedFormData(evt) { 3077 - const elt = closest(asElement(evt.target), "button, input[type='submit']"); 3078 - if (!elt) { 3079 - return; 3080 - } 3081 - const form = 3082 - resolveTarget("#" + getRawAttribute(elt, "form"), elt.getRootNode()) || 3083 - closest(elt, "form"); 3084 - if (!form) { 3085 - return; 3086 - } 3087 - return getInternalData(form); 3088 - } 3089 - 3090 - /** 3091 - * @param {EventTarget} elt 3092 - */ 3093 - function initButtonTracking(elt) { 3094 - // need to handle both click and focus in: 3095 - // focusin - in case someone tabs in to a button and hits the space bar 3096 - // click - on OSX buttons do not focus on click see https://bugs.webkit.org/show_bug.cgi?id=13724 3097 - elt.addEventListener("click", maybeSetLastButtonClicked); 3098 - elt.addEventListener("focusin", maybeSetLastButtonClicked); 3099 - elt.addEventListener("focusout", maybeUnsetLastButtonClicked); 3100 - } 3101 - 3102 - /** 3103 - * @param {Element} elt 3104 - * @param {string} eventName 3105 - * @param {string} code 3106 - */ 3107 - function addHxOnEventHandler(elt, eventName, code) { 3108 - const nodeData = getInternalData(elt); 3109 - if (!Array.isArray(nodeData.onHandlers)) { 3110 - nodeData.onHandlers = []; 3111 - } 3112 - let func; 3113 - /** @type EventListener */ 3114 - const listener = function (e) { 3115 - maybeEval(elt, function () { 3116 - if (eltIsDisabled(elt)) { 3117 - return; 3118 - } 3119 - if (!func) { 3120 - func = new Function("event", code); 3121 - } 3122 - func.call(elt, e); 3123 - }); 3124 - }; 3125 - elt.addEventListener(eventName, listener); 3126 - nodeData.onHandlers.push({ event: eventName, listener }); 3127 - } 3128 - 3129 - /** 3130 - * @param {Element} elt 3131 - */ 3132 - function processHxOnWildcard(elt) { 3133 - // wipe any previous on handlers so that this function takes precedence 3134 - deInitOnHandlers(elt); 3135 - 3136 - for (let i = 0; i < elt.attributes.length; i++) { 3137 - const name = elt.attributes[i].name; 3138 - const value = elt.attributes[i].value; 3139 - if (startsWith(name, "hx-on") || startsWith(name, "data-hx-on")) { 3140 - const afterOnPosition = name.indexOf("-on") + 3; 3141 - const nextChar = name.slice(afterOnPosition, afterOnPosition + 1); 3142 - if (nextChar === "-" || nextChar === ":") { 3143 - let eventName = name.slice(afterOnPosition + 1); 3144 - // if the eventName starts with a colon or dash, prepend "htmx" for shorthand support 3145 - if (startsWith(eventName, ":")) { 3146 - eventName = "htmx" + eventName; 3147 - } else if (startsWith(eventName, "-")) { 3148 - eventName = "htmx:" + eventName.slice(1); 3149 - } else if (startsWith(eventName, "htmx-")) { 3150 - eventName = "htmx:" + eventName.slice(5); 3151 - } 3152 - 3153 - addHxOnEventHandler(elt, eventName, value); 3154 - } 3155 - } 3156 - } 3157 - } 3158 - 3159 - /** 3160 - * @param {Element|HTMLInputElement} elt 3161 - */ 3162 - function initNode(elt) { 3163 - if (closest(elt, htmx.config.disableSelector)) { 3164 - cleanUpElement(elt); 3165 - return; 3166 - } 3167 - const nodeData = getInternalData(elt); 3168 - const attrHash = attributeHash(elt); 3169 - if (nodeData.initHash !== attrHash) { 3170 - // clean up any previously processed info 3171 - deInitNode(elt); 3172 - 3173 - nodeData.initHash = attrHash; 3174 - 3175 - triggerEvent(elt, "htmx:beforeProcessNode"); 3176 - 3177 - const triggerSpecs = getTriggerSpecs(elt); 3178 - const hasExplicitHttpAction = processVerbs(elt, nodeData, triggerSpecs); 3179 - 3180 - if (!hasExplicitHttpAction) { 3181 - if (getClosestAttributeValue(elt, "hx-boost") === "true") { 3182 - boostElement(elt, nodeData, triggerSpecs); 3183 - } else if (hasAttribute(elt, "hx-trigger")) { 3184 - triggerSpecs.forEach(function (triggerSpec) { 3185 - // For "naked" triggers, don't do anything at all 3186 - addTriggerHandler(elt, triggerSpec, nodeData, function () {}); 3187 - }); 3188 - } 3189 - } 3190 - 3191 - // Handle submit buttons/inputs that have the form attribute set 3192 - // see https://developer.mozilla.org/docs/Web/HTML/Element/button 3193 - if ( 3194 - elt.tagName === "FORM" || 3195 - (getRawAttribute(elt, "type") === "submit" && hasAttribute(elt, "form")) 3196 - ) { 3197 - initButtonTracking(elt); 3198 - } 3199 - 3200 - nodeData.firstInitCompleted = true; 3201 - triggerEvent(elt, "htmx:afterProcessNode"); 3202 - } 3203 - } 3204 - 3205 - /** 3206 - * Processes new content, enabling htmx behavior. This can be useful if you have content that is added to the DOM outside of the normal htmx request cycle but still want htmx attributes to work. 3207 - * 3208 - * @see https://htmx.org/api/#process 3209 - * 3210 - * @param {Element|string} elt element to process 3211 - */ 3212 - function processNode(elt) { 3213 - elt = resolveTarget(elt); 3214 - if (closest(elt, htmx.config.disableSelector)) { 3215 - cleanUpElement(elt); 3216 - return; 3217 - } 3218 - initNode(elt); 3219 - forEach(findElementsToProcess(elt), function (child) { 3220 - initNode(child); 3221 - }); 3222 - forEach(findHxOnWildcardElements(elt), processHxOnWildcard); 3223 - } 3224 - 3225 - //= =================================================================== 3226 - // Event/Log Support 3227 - //= =================================================================== 3228 - 3229 - /** 3230 - * @param {string} str 3231 - * @returns {string} 3232 - */ 3233 - function kebabEventName(str) { 3234 - return str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(); 3235 - } 3236 - 3237 - /** 3238 - * @param {string} eventName 3239 - * @param {any} detail 3240 - * @returns {CustomEvent} 3241 - */ 3242 - function makeEvent(eventName, detail) { 3243 - let evt; 3244 - if (window.CustomEvent && typeof window.CustomEvent === "function") { 3245 - // TODO: `composed: true` here is a hack to make global event handlers work with events in shadow DOM 3246 - // This breaks expected encapsulation but needs to be here until decided otherwise by core devs 3247 - evt = new CustomEvent(eventName, { 3248 - bubbles: true, 3249 - cancelable: true, 3250 - composed: true, 3251 - detail, 3252 - }); 3253 - } else { 3254 - evt = getDocument().createEvent("CustomEvent"); 3255 - evt.initCustomEvent(eventName, true, true, detail); 3256 - } 3257 - return evt; 3258 - } 3259 - 3260 - /** 3261 - * @param {EventTarget|string} elt 3262 - * @param {string} eventName 3263 - * @param {any=} detail 3264 - */ 3265 - function triggerErrorEvent(elt, eventName, detail) { 3266 - triggerEvent(elt, eventName, mergeObjects({ error: eventName }, detail)); 3267 - } 3268 - 3269 - /** 3270 - * @param {string} eventName 3271 - * @returns {boolean} 3272 - */ 3273 - function ignoreEventForLogging(eventName) { 3274 - return eventName === "htmx:afterProcessNode"; 3275 - } 3276 - 3277 - /** 3278 - * `withExtensions` locates all active extensions for a provided element, then 3279 - * executes the provided function using each of the active extensions. It should 3280 - * be called internally at every extendable execution point in htmx. 3281 - * 3282 - * @param {Element} elt 3283 - * @param {(extension:HtmxExtension) => void} toDo 3284 - * @returns void 3285 - */ 3286 - function withExtensions(elt, toDo) { 3287 - forEach(getExtensions(elt), function (extension) { 3288 - try { 3289 - toDo(extension); 3290 - } catch (e) { 3291 - logError(e); 3292 - } 3293 - }); 3294 - } 3295 - 3296 - function logError(msg) { 3297 - if (console.error) { 3298 - console.error(msg); 3299 - } else if (console.log) { 3300 - console.log("ERROR: ", msg); 3301 - } 3302 - } 3303 - 3304 - /** 3305 - * Triggers a given event on an element 3306 - * 3307 - * @see https://htmx.org/api/#trigger 3308 - * 3309 - * @param {EventTarget|string} elt the element to trigger the event on 3310 - * @param {string} eventName the name of the event to trigger 3311 - * @param {any=} detail details for the event 3312 - * @returns {boolean} 3313 - */ 3314 - function triggerEvent(elt, eventName, detail) { 3315 - elt = resolveTarget(elt); 3316 - if (detail == null) { 3317 - detail = {}; 3318 - } 3319 - detail.elt = elt; 3320 - const event = makeEvent(eventName, detail); 3321 - if (htmx.logger && !ignoreEventForLogging(eventName)) { 3322 - htmx.logger(elt, eventName, detail); 3323 - } 3324 - if (detail.error) { 3325 - logError(detail.error); 3326 - triggerEvent(elt, "htmx:error", { errorInfo: detail }); 3327 - } 3328 - let eventResult = elt.dispatchEvent(event); 3329 - const kebabName = kebabEventName(eventName); 3330 - if (eventResult && kebabName !== eventName) { 3331 - const kebabedEvent = makeEvent(kebabName, event.detail); 3332 - eventResult = eventResult && elt.dispatchEvent(kebabedEvent); 3333 - } 3334 - withExtensions(asElement(elt), function (extension) { 3335 - eventResult = 3336 - eventResult && 3337 - extension.onEvent(eventName, event) !== false && 3338 - !event.defaultPrevented; 3339 - }); 3340 - return eventResult; 3341 - } 3342 - 3343 - //= =================================================================== 3344 - // History Support 3345 - //= =================================================================== 3346 - let currentPathForHistory = location.pathname + location.search; 3347 - 3348 - /** 3349 - * @returns {Element} 3350 - */ 3351 - function getHistoryElement() { 3352 - const historyElt = getDocument().querySelector( 3353 - "[hx-history-elt],[data-hx-history-elt]", 3354 - ); 3355 - return historyElt || getDocument().body; 3356 - } 3357 - 3358 - /** 3359 - * @param {string} url 3360 - * @param {Element} rootElt 3361 - */ 3362 - function saveToHistoryCache(url, rootElt) { 3363 - if (!canAccessLocalStorage()) { 3364 - return; 3365 - } 3366 - 3367 - // get state to save 3368 - const innerHTML = cleanInnerHtmlForHistory(rootElt); 3369 - const title = getDocument().title; 3370 - const scroll = window.scrollY; 3371 - 3372 - if (htmx.config.historyCacheSize <= 0) { 3373 - // make sure that an eventually already existing cache is purged 3374 - localStorage.removeItem("htmx-history-cache"); 3375 - return; 3376 - } 3377 - 3378 - url = normalizePath(url); 3379 - 3380 - const historyCache = 3381 - parseJSON(localStorage.getItem("htmx-history-cache")) || []; 3382 - for (let i = 0; i < historyCache.length; i++) { 3383 - if (historyCache[i].url === url) { 3384 - historyCache.splice(i, 1); 3385 - break; 3386 - } 3387 - } 3388 - 3389 - /** @type HtmxHistoryItem */ 3390 - const newHistoryItem = { url, content: innerHTML, title, scroll }; 3391 - 3392 - triggerEvent(getDocument().body, "htmx:historyItemCreated", { 3393 - item: newHistoryItem, 3394 - cache: historyCache, 3395 - }); 3396 - 3397 - historyCache.push(newHistoryItem); 3398 - while (historyCache.length > htmx.config.historyCacheSize) { 3399 - historyCache.shift(); 3400 - } 3401 - 3402 - // keep trying to save the cache until it succeeds or is empty 3403 - while (historyCache.length > 0) { 3404 - try { 3405 - localStorage.setItem( 3406 - "htmx-history-cache", 3407 - JSON.stringify(historyCache), 3408 - ); 3409 - break; 3410 - } catch (e) { 3411 - triggerErrorEvent(getDocument().body, "htmx:historyCacheError", { 3412 - cause: e, 3413 - cache: historyCache, 3414 - }); 3415 - historyCache.shift(); // shrink the cache and retry 3416 - } 3417 - } 3418 - } 3419 - 3420 - /** 3421 - * @typedef {Object} HtmxHistoryItem 3422 - * @property {string} url 3423 - * @property {string} content 3424 - * @property {string} title 3425 - * @property {number} scroll 3426 - */ 3427 - 3428 - /** 3429 - * @param {string} url 3430 - * @returns {HtmxHistoryItem|null} 3431 - */ 3432 - function getCachedHistory(url) { 3433 - if (!canAccessLocalStorage()) { 3434 - return null; 3435 - } 3436 - 3437 - url = normalizePath(url); 3438 - 3439 - const historyCache = 3440 - parseJSON(localStorage.getItem("htmx-history-cache")) || []; 3441 - for (let i = 0; i < historyCache.length; i++) { 3442 - if (historyCache[i].url === url) { 3443 - return historyCache[i]; 3444 - } 3445 - } 3446 - return null; 3447 - } 3448 - 3449 - /** 3450 - * @param {Element} elt 3451 - * @returns {string} 3452 - */ 3453 - function cleanInnerHtmlForHistory(elt) { 3454 - const className = htmx.config.requestClass; 3455 - const clone = /** @type Element */ (elt.cloneNode(true)); 3456 - forEach(findAll(clone, "." + className), function (child) { 3457 - removeClassFromElement(child, className); 3458 - }); 3459 - // remove the disabled attribute for any element disabled due to an htmx request 3460 - forEach(findAll(clone, "[data-disabled-by-htmx]"), function (child) { 3461 - child.removeAttribute("disabled"); 3462 - }); 3463 - return clone.innerHTML; 3464 - } 3465 - 3466 - function saveCurrentPageToHistory() { 3467 - const elt = getHistoryElement(); 3468 - const path = currentPathForHistory || location.pathname + location.search; 3469 - 3470 - // Allow history snapshot feature to be disabled where hx-history="false" 3471 - // is present *anywhere* in the current document we're about to save, 3472 - // so we can prevent privileged data entering the cache. 3473 - // The page will still be reachable as a history entry, but htmx will fetch it 3474 - // live from the server onpopstate rather than look in the localStorage cache 3475 - let disableHistoryCache; 3476 - try { 3477 - disableHistoryCache = getDocument().querySelector( 3478 - '[hx-history="false" i],[data-hx-history="false" i]', 3479 - ); 3480 - } catch (e) { 3481 - // IE11: insensitive modifier not supported so fallback to case sensitive selector 3482 - disableHistoryCache = getDocument().querySelector( 3483 - '[hx-history="false"],[data-hx-history="false"]', 3484 - ); 3485 - } 3486 - if (!disableHistoryCache) { 3487 - triggerEvent(getDocument().body, "htmx:beforeHistorySave", { 3488 - path, 3489 - historyElt: elt, 3490 - }); 3491 - saveToHistoryCache(path, elt); 3492 - } 3493 - 3494 - if (htmx.config.historyEnabled) 3495 - history.replaceState( 3496 - { htmx: true }, 3497 - getDocument().title, 3498 - window.location.href, 3499 - ); 3500 - } 3501 - 3502 - /** 3503 - * @param {string} path 3504 - */ 3505 - function pushUrlIntoHistory(path) { 3506 - // remove the cache buster parameter, if any 3507 - if (htmx.config.getCacheBusterParam) { 3508 - path = path.replace(/org\.htmx\.cache-buster=[^&]*&?/, ""); 3509 - if (endsWith(path, "&") || endsWith(path, "?")) { 3510 - path = path.slice(0, -1); 3511 - } 3512 - } 3513 - if (htmx.config.historyEnabled) { 3514 - history.pushState({ htmx: true }, "", path); 3515 - } 3516 - currentPathForHistory = path; 3517 - } 3518 - 3519 - /** 3520 - * @param {string} path 3521 - */ 3522 - function replaceUrlInHistory(path) { 3523 - if (htmx.config.historyEnabled) 3524 - history.replaceState({ htmx: true }, "", path); 3525 - currentPathForHistory = path; 3526 - } 3527 - 3528 - /** 3529 - * @param {HtmxSettleTask[]} tasks 3530 - */ 3531 - function settleImmediately(tasks) { 3532 - forEach(tasks, function (task) { 3533 - task.call(undefined); 3534 - }); 3535 - } 3536 - 3537 - /** 3538 - * @param {string} path 3539 - */ 3540 - function loadHistoryFromServer(path) { 3541 - const request = new XMLHttpRequest(); 3542 - const details = { path, xhr: request }; 3543 - triggerEvent(getDocument().body, "htmx:historyCacheMiss", details); 3544 - request.open("GET", path, true); 3545 - request.setRequestHeader("HX-Request", "true"); 3546 - request.setRequestHeader("HX-History-Restore-Request", "true"); 3547 - request.setRequestHeader("HX-Current-URL", getDocument().location.href); 3548 - request.onload = function () { 3549 - if (this.status >= 200 && this.status < 400) { 3550 - triggerEvent(getDocument().body, "htmx:historyCacheMissLoad", details); 3551 - const fragment = makeFragment(this.response); 3552 - /** @type ParentNode */ 3553 - const content = 3554 - fragment.querySelector("[hx-history-elt],[data-hx-history-elt]") || 3555 - fragment; 3556 - const historyElement = getHistoryElement(); 3557 - const settleInfo = makeSettleInfo(historyElement); 3558 - handleTitle(fragment.title); 3559 - 3560 - handlePreservedElements(fragment); 3561 - swapInnerHTML(historyElement, content, settleInfo); 3562 - restorePreservedElements(); 3563 - settleImmediately(settleInfo.tasks); 3564 - currentPathForHistory = path; 3565 - triggerEvent(getDocument().body, "htmx:historyRestore", { 3566 - path, 3567 - cacheMiss: true, 3568 - serverResponse: this.response, 3569 - }); 3570 - } else { 3571 - triggerErrorEvent( 3572 - getDocument().body, 3573 - "htmx:historyCacheMissLoadError", 3574 - details, 3575 - ); 3576 - } 3577 - }; 3578 - request.send(); 3579 - } 3580 - 3581 - /** 3582 - * @param {string} [path] 3583 - */ 3584 - function restoreHistory(path) { 3585 - saveCurrentPageToHistory(); 3586 - path = path || location.pathname + location.search; 3587 - const cached = getCachedHistory(path); 3588 - if (cached) { 3589 - const fragment = makeFragment(cached.content); 3590 - const historyElement = getHistoryElement(); 3591 - const settleInfo = makeSettleInfo(historyElement); 3592 - handleTitle(cached.title); 3593 - handlePreservedElements(fragment); 3594 - swapInnerHTML(historyElement, fragment, settleInfo); 3595 - restorePreservedElements(); 3596 - settleImmediately(settleInfo.tasks); 3597 - getWindow().setTimeout(function () { 3598 - window.scrollTo(0, cached.scroll); 3599 - }, 0); // next 'tick', so browser has time to render layout 3600 - currentPathForHistory = path; 3601 - triggerEvent(getDocument().body, "htmx:historyRestore", { 3602 - path, 3603 - item: cached, 3604 - }); 3605 - } else { 3606 - if (htmx.config.refreshOnHistoryMiss) { 3607 - // @ts-ignore: optional parameter in reload() function throws error 3608 - // noinspection JSUnresolvedReference 3609 - window.location.reload(true); 3610 - } else { 3611 - loadHistoryFromServer(path); 3612 - } 3613 - } 3614 - } 3615 - 3616 - /** 3617 - * @param {Element} elt 3618 - * @returns {Element[]} 3619 - */ 3620 - function addRequestIndicatorClasses(elt) { 3621 - let indicators = /** @type Element[] */ ( 3622 - findAttributeTargets(elt, "hx-indicator") 3623 - ); 3624 - if (indicators == null) { 3625 - indicators = [elt]; 3626 - } 3627 - forEach(indicators, function (ic) { 3628 - const internalData = getInternalData(ic); 3629 - internalData.requestCount = (internalData.requestCount || 0) + 1; 3630 - ic.classList.add.call(ic.classList, htmx.config.requestClass); 3631 - }); 3632 - return indicators; 3633 - } 3634 - 3635 - /** 3636 - * @param {Element} elt 3637 - * @returns {Element[]} 3638 - */ 3639 - function disableElements(elt) { 3640 - let disabledElts = /** @type Element[] */ ( 3641 - findAttributeTargets(elt, "hx-disabled-elt") 3642 - ); 3643 - if (disabledElts == null) { 3644 - disabledElts = []; 3645 - } 3646 - forEach(disabledElts, function (disabledElement) { 3647 - const internalData = getInternalData(disabledElement); 3648 - internalData.requestCount = (internalData.requestCount || 0) + 1; 3649 - disabledElement.setAttribute("disabled", ""); 3650 - disabledElement.setAttribute("data-disabled-by-htmx", ""); 3651 - }); 3652 - return disabledElts; 3653 - } 3654 - 3655 - /** 3656 - * @param {Element[]} indicators 3657 - * @param {Element[]} disabled 3658 - */ 3659 - function removeRequestIndicators(indicators, disabled) { 3660 - forEach(indicators.concat(disabled), function (ele) { 3661 - const internalData = getInternalData(ele); 3662 - internalData.requestCount = (internalData.requestCount || 1) - 1; 3663 - }); 3664 - forEach(indicators, function (ic) { 3665 - const internalData = getInternalData(ic); 3666 - if (internalData.requestCount === 0) { 3667 - ic.classList.remove.call(ic.classList, htmx.config.requestClass); 3668 - } 3669 - }); 3670 - forEach(disabled, function (disabledElement) { 3671 - const internalData = getInternalData(disabledElement); 3672 - if (internalData.requestCount === 0) { 3673 - disabledElement.removeAttribute("disabled"); 3674 - disabledElement.removeAttribute("data-disabled-by-htmx"); 3675 - } 3676 - }); 3677 - } 3678 - 3679 - //= =================================================================== 3680 - // Input Value Processing 3681 - //= =================================================================== 3682 - 3683 - /** 3684 - * @param {Element[]} processed 3685 - * @param {Element} elt 3686 - * @returns {boolean} 3687 - */ 3688 - function haveSeenNode(processed, elt) { 3689 - for (let i = 0; i < processed.length; i++) { 3690 - const node = processed[i]; 3691 - if (node.isSameNode(elt)) { 3692 - return true; 3693 - } 3694 - } 3695 - return false; 3696 - } 3697 - 3698 - /** 3699 - * @param {Element} element 3700 - * @return {boolean} 3701 - */ 3702 - function shouldInclude(element) { 3703 - // Cast to trick tsc, undefined values will work fine here 3704 - const elt = /** @type {HTMLInputElement} */ (element); 3705 - if ( 3706 - elt.name === "" || 3707 - elt.name == null || 3708 - elt.disabled || 3709 - closest(elt, "fieldset[disabled]") 3710 - ) { 3711 - return false; 3712 - } 3713 - // ignore "submitter" types (see jQuery src/serialize.js) 3714 - if ( 3715 - elt.type === "button" || 3716 - elt.type === "submit" || 3717 - elt.tagName === "image" || 3718 - elt.tagName === "reset" || 3719 - elt.tagName === "file" 3720 - ) { 3721 - return false; 3722 - } 3723 - if (elt.type === "checkbox" || elt.type === "radio") { 3724 - return elt.checked; 3725 - } 3726 - return true; 3727 - } 3728 - 3729 - /** @param {string} name 3730 - * @param {string|Array|FormDataEntryValue} value 3731 - * @param {FormData} formData */ 3732 - function addValueToFormData(name, value, formData) { 3733 - if (name != null && value != null) { 3734 - if (Array.isArray(value)) { 3735 - value.forEach(function (v) { 3736 - formData.append(name, v); 3737 - }); 3738 - } else { 3739 - formData.append(name, value); 3740 - } 3741 - } 3742 - } 3743 - 3744 - /** @param {string} name 3745 - * @param {string|Array} value 3746 - * @param {FormData} formData */ 3747 - function removeValueFromFormData(name, value, formData) { 3748 - if (name != null && value != null) { 3749 - let values = formData.getAll(name); 3750 - if (Array.isArray(value)) { 3751 - values = values.filter((v) => value.indexOf(v) < 0); 3752 - } else { 3753 - values = values.filter((v) => v !== value); 3754 - } 3755 - formData.delete(name); 3756 - forEach(values, (v) => formData.append(name, v)); 3757 - } 3758 - } 3759 - 3760 - /** 3761 - * @param {Element[]} processed 3762 - * @param {FormData} formData 3763 - * @param {HtmxElementValidationError[]} errors 3764 - * @param {Element|HTMLInputElement|HTMLSelectElement|HTMLFormElement} elt 3765 - * @param {boolean} validate 3766 - */ 3767 - function processInputValue(processed, formData, errors, elt, validate) { 3768 - if (elt == null || haveSeenNode(processed, elt)) { 3769 - return; 3770 - } else { 3771 - processed.push(elt); 3772 - } 3773 - if (shouldInclude(elt)) { 3774 - const name = getRawAttribute(elt, "name"); 3775 - // @ts-ignore value will be undefined for non-input elements, which is fine 3776 - let value = elt.value; 3777 - if (elt instanceof HTMLSelectElement && elt.multiple) { 3778 - value = toArray(elt.querySelectorAll("option:checked")).map( 3779 - function (e) { 3780 - return /** @type HTMLOptionElement */ (e).value; 3781 - }, 3782 - ); 3783 - } 3784 - // include file inputs 3785 - if (elt instanceof HTMLInputElement && elt.files) { 3786 - value = toArray(elt.files); 3787 - } 3788 - addValueToFormData(name, value, formData); 3789 - if (validate) { 3790 - validateElement(elt, errors); 3791 - } 3792 - } 3793 - if (elt instanceof HTMLFormElement) { 3794 - forEach(elt.elements, function (input) { 3795 - if (processed.indexOf(input) >= 0) { 3796 - // The input has already been processed and added to the values, but the FormData that will be 3797 - // constructed right after on the form, will include it once again. So remove that input's value 3798 - // now to avoid duplicates 3799 - removeValueFromFormData(input.name, input.value, formData); 3800 - } else { 3801 - processed.push(input); 3802 - } 3803 - if (validate) { 3804 - validateElement(input, errors); 3805 - } 3806 - }); 3807 - new FormData(elt).forEach(function (value, name) { 3808 - if (value instanceof File && value.name === "") { 3809 - return; // ignore no-name files 3810 - } 3811 - addValueToFormData(name, value, formData); 3812 - }); 3813 - } 3814 - } 3815 - 3816 - /** 3817 - * 3818 - * @param {Element} elt 3819 - * @param {HtmxElementValidationError[]} errors 3820 - */ 3821 - function validateElement(elt, errors) { 3822 - const element = /** @type {HTMLElement & ElementInternals} */ (elt); 3823 - if (element.willValidate) { 3824 - triggerEvent(element, "htmx:validation:validate"); 3825 - if (!element.checkValidity()) { 3826 - errors.push({ 3827 - elt: element, 3828 - message: element.validationMessage, 3829 - validity: element.validity, 3830 - }); 3831 - triggerEvent(element, "htmx:validation:failed", { 3832 - message: element.validationMessage, 3833 - validity: element.validity, 3834 - }); 3835 - } 3836 - } 3837 - } 3838 - 3839 - /** 3840 - * Override values in the one FormData with those from another. 3841 - * @param {FormData} receiver the formdata that will be mutated 3842 - * @param {FormData} donor the formdata that will provide the overriding values 3843 - * @returns {FormData} the {@linkcode receiver} 3844 - */ 3845 - function overrideFormData(receiver, donor) { 3846 - for (const key of donor.keys()) { 3847 - receiver.delete(key); 3848 - } 3849 - donor.forEach(function (value, key) { 3850 - receiver.append(key, value); 3851 - }); 3852 - return receiver; 3853 - } 3854 - 3855 - /** 3856 - * @param {Element|HTMLFormElement} elt 3857 - * @param {HttpVerb} verb 3858 - * @returns {{errors: HtmxElementValidationError[], formData: FormData, values: Object}} 3859 - */ 3860 - function getInputValues(elt, verb) { 3861 - /** @type Element[] */ 3862 - const processed = []; 3863 - const formData = new FormData(); 3864 - const priorityFormData = new FormData(); 3865 - /** @type HtmxElementValidationError[] */ 3866 - const errors = []; 3867 - const internalData = getInternalData(elt); 3868 - if ( 3869 - internalData.lastButtonClicked && 3870 - !bodyContains(internalData.lastButtonClicked) 3871 - ) { 3872 - internalData.lastButtonClicked = null; 3873 - } 3874 - 3875 - // only validate when form is directly submitted and novalidate or formnovalidate are not set 3876 - // or if the element has an explicit hx-validate="true" on it 3877 - let validate = 3878 - (elt instanceof HTMLFormElement && elt.noValidate !== true) || 3879 - getAttributeValue(elt, "hx-validate") === "true"; 3880 - if (internalData.lastButtonClicked) { 3881 - validate = 3882 - validate && internalData.lastButtonClicked.formNoValidate !== true; 3883 - } 3884 - 3885 - // for a non-GET include the closest form 3886 - if (verb !== "get") { 3887 - processInputValue( 3888 - processed, 3889 - priorityFormData, 3890 - errors, 3891 - closest(elt, "form"), 3892 - validate, 3893 - ); 3894 - } 3895 - 3896 - // include the element itself 3897 - processInputValue(processed, formData, errors, elt, validate); 3898 - 3899 - // if a button or submit was clicked last, include its value 3900 - if ( 3901 - internalData.lastButtonClicked || 3902 - elt.tagName === "BUTTON" || 3903 - (elt.tagName === "INPUT" && getRawAttribute(elt, "type") === "submit") 3904 - ) { 3905 - const button = 3906 - internalData.lastButtonClicked || 3907 - /** @type HTMLInputElement|HTMLButtonElement */ (elt); 3908 - const name = getRawAttribute(button, "name"); 3909 - addValueToFormData(name, button.value, priorityFormData); 3910 - } 3911 - 3912 - // include any explicit includes 3913 - const includes = findAttributeTargets(elt, "hx-include"); 3914 - forEach(includes, function (node) { 3915 - processInputValue(processed, formData, errors, asElement(node), validate); 3916 - // if a non-form is included, include any input values within it 3917 - if (!matches(node, "form")) { 3918 - forEach( 3919 - asParentNode(node).querySelectorAll(INPUT_SELECTOR), 3920 - function (descendant) { 3921 - processInputValue( 3922 - processed, 3923 - formData, 3924 - errors, 3925 - descendant, 3926 - validate, 3927 - ); 3928 - }, 3929 - ); 3930 - } 3931 - }); 3932 - 3933 - // values from a <form> take precedence, overriding the regular values 3934 - overrideFormData(formData, priorityFormData); 3935 - 3936 - return { errors, formData, values: formDataProxy(formData) }; 3937 - } 3938 - 3939 - /** 3940 - * @param {string} returnStr 3941 - * @param {string} name 3942 - * @param {any} realValue 3943 - * @returns {string} 3944 - */ 3945 - function appendParam(returnStr, name, realValue) { 3946 - if (returnStr !== "") { 3947 - returnStr += "&"; 3948 - } 3949 - if (String(realValue) === "[object Object]") { 3950 - realValue = JSON.stringify(realValue); 3951 - } 3952 - const s = encodeURIComponent(realValue); 3953 - returnStr += encodeURIComponent(name) + "=" + s; 3954 - return returnStr; 3955 - } 3956 - 3957 - /** 3958 - * @param {FormData|Object} values 3959 - * @returns string 3960 - */ 3961 - function urlEncode(values) { 3962 - values = formDataFromObject(values); 3963 - let returnStr = ""; 3964 - values.forEach(function (value, key) { 3965 - returnStr = appendParam(returnStr, key, value); 3966 - }); 3967 - return returnStr; 3968 - } 3969 - 3970 - //= =================================================================== 3971 - // Ajax 3972 - //= =================================================================== 3973 - 3974 - /** 3975 - * @param {Element} elt 3976 - * @param {Element} target 3977 - * @param {string} prompt 3978 - * @returns {HtmxHeaderSpecification} 3979 - */ 3980 - function getHeaders(elt, target, prompt) { 3981 - /** @type HtmxHeaderSpecification */ 3982 - const headers = { 3983 - "HX-Request": "true", 3984 - "HX-Trigger": getRawAttribute(elt, "id"), 3985 - "HX-Trigger-Name": getRawAttribute(elt, "name"), 3986 - "HX-Target": getAttributeValue(target, "id"), 3987 - "HX-Current-URL": getDocument().location.href, 3988 - }; 3989 - getValuesForElement(elt, "hx-headers", false, headers); 3990 - if (prompt !== undefined) { 3991 - headers["HX-Prompt"] = prompt; 3992 - } 3993 - if (getInternalData(elt).boosted) { 3994 - headers["HX-Boosted"] = "true"; 3995 - } 3996 - return headers; 3997 - } 3998 - 3999 - /** 4000 - * filterValues takes an object containing form input values 4001 - * and returns a new object that only contains keys that are 4002 - * specified by the closest "hx-params" attribute 4003 - * @param {FormData} inputValues 4004 - * @param {Element} elt 4005 - * @returns {FormData} 4006 - */ 4007 - function filterValues(inputValues, elt) { 4008 - const paramsValue = getClosestAttributeValue(elt, "hx-params"); 4009 - if (paramsValue) { 4010 - if (paramsValue === "none") { 4011 - return new FormData(); 4012 - } else if (paramsValue === "*") { 4013 - return inputValues; 4014 - } else if (paramsValue.indexOf("not ") === 0) { 4015 - forEach(paramsValue.slice(4).split(","), function (name) { 4016 - name = name.trim(); 4017 - inputValues.delete(name); 4018 - }); 4019 - return inputValues; 4020 - } else { 4021 - const newValues = new FormData(); 4022 - forEach(paramsValue.split(","), function (name) { 4023 - name = name.trim(); 4024 - if (inputValues.has(name)) { 4025 - inputValues.getAll(name).forEach(function (value) { 4026 - newValues.append(name, value); 4027 - }); 4028 - } 4029 - }); 4030 - return newValues; 4031 - } 4032 - } else { 4033 - return inputValues; 4034 - } 4035 - } 4036 - 4037 - /** 4038 - * @param {Element} elt 4039 - * @return {boolean} 4040 - */ 4041 - function isAnchorLink(elt) { 4042 - return ( 4043 - !!getRawAttribute(elt, "href") && 4044 - getRawAttribute(elt, "href").indexOf("#") >= 0 4045 - ); 4046 - } 4047 - 4048 - /** 4049 - * @param {Element} elt 4050 - * @param {HtmxSwapStyle} [swapInfoOverride] 4051 - * @returns {HtmxSwapSpecification} 4052 - */ 4053 - function getSwapSpecification(elt, swapInfoOverride) { 4054 - const swapInfo = 4055 - swapInfoOverride || getClosestAttributeValue(elt, "hx-swap"); 4056 - /** @type HtmxSwapSpecification */ 4057 - const swapSpec = { 4058 - swapStyle: getInternalData(elt).boosted 4059 - ? "innerHTML" 4060 - : htmx.config.defaultSwapStyle, 4061 - swapDelay: htmx.config.defaultSwapDelay, 4062 - settleDelay: htmx.config.defaultSettleDelay, 4063 - }; 4064 - if ( 4065 - htmx.config.scrollIntoViewOnBoost && 4066 - getInternalData(elt).boosted && 4067 - !isAnchorLink(elt) 4068 - ) { 4069 - swapSpec.show = "top"; 4070 - } 4071 - if (swapInfo) { 4072 - const split = splitOnWhitespace(swapInfo); 4073 - if (split.length > 0) { 4074 - for (let i = 0; i < split.length; i++) { 4075 - const value = split[i]; 4076 - if (value.indexOf("swap:") === 0) { 4077 - swapSpec.swapDelay = parseInterval(value.slice(5)); 4078 - } else if (value.indexOf("settle:") === 0) { 4079 - swapSpec.settleDelay = parseInterval(value.slice(7)); 4080 - } else if (value.indexOf("transition:") === 0) { 4081 - swapSpec.transition = value.slice(11) === "true"; 4082 - } else if (value.indexOf("ignoreTitle:") === 0) { 4083 - swapSpec.ignoreTitle = value.slice(12) === "true"; 4084 - } else if (value.indexOf("scroll:") === 0) { 4085 - const scrollSpec = value.slice(7); 4086 - var splitSpec = scrollSpec.split(":"); 4087 - const scrollVal = splitSpec.pop(); 4088 - var selectorVal = splitSpec.length > 0 ? splitSpec.join(":") : null; 4089 - // @ts-ignore 4090 - swapSpec.scroll = scrollVal; 4091 - swapSpec.scrollTarget = selectorVal; 4092 - } else if (value.indexOf("show:") === 0) { 4093 - const showSpec = value.slice(5); 4094 - var splitSpec = showSpec.split(":"); 4095 - const showVal = splitSpec.pop(); 4096 - var selectorVal = splitSpec.length > 0 ? splitSpec.join(":") : null; 4097 - swapSpec.show = showVal; 4098 - swapSpec.showTarget = selectorVal; 4099 - } else if (value.indexOf("focus-scroll:") === 0) { 4100 - const focusScrollVal = value.slice("focus-scroll:".length); 4101 - swapSpec.focusScroll = focusScrollVal == "true"; 4102 - } else if (i == 0) { 4103 - swapSpec.swapStyle = value; 4104 - } else { 4105 - logError("Unknown modifier in hx-swap: " + value); 4106 - } 4107 - } 4108 - } 4109 - } 4110 - return swapSpec; 4111 - } 4112 - 4113 - /** 4114 - * @param {Element} elt 4115 - * @return {boolean} 4116 - */ 4117 - function usesFormData(elt) { 4118 - return ( 4119 - getClosestAttributeValue(elt, "hx-encoding") === "multipart/form-data" || 4120 - (matches(elt, "form") && 4121 - getRawAttribute(elt, "enctype") === "multipart/form-data") 4122 - ); 4123 - } 4124 - 4125 - /** 4126 - * @param {XMLHttpRequest} xhr 4127 - * @param {Element} elt 4128 - * @param {FormData} filteredParameters 4129 - * @returns {*|string|null} 4130 - */ 4131 - function encodeParamsForBody(xhr, elt, filteredParameters) { 4132 - let encodedParameters = null; 4133 - withExtensions(elt, function (extension) { 4134 - if (encodedParameters == null) { 4135 - encodedParameters = extension.encodeParameters( 4136 - xhr, 4137 - filteredParameters, 4138 - elt, 4139 - ); 4140 - } 4141 - }); 4142 - if (encodedParameters != null) { 4143 - return encodedParameters; 4144 - } else { 4145 - if (usesFormData(elt)) { 4146 - // Force conversion to an actual FormData object in case filteredParameters is a formDataProxy 4147 - // See https://github.com/bigskysoftware/htmx/issues/2317 4148 - return overrideFormData( 4149 - new FormData(), 4150 - formDataFromObject(filteredParameters), 4151 - ); 4152 - } else { 4153 - return urlEncode(filteredParameters); 4154 - } 4155 - } 4156 - } 4157 - 4158 - /** 4159 - * 4160 - * @param {Element} target 4161 - * @returns {HtmxSettleInfo} 4162 - */ 4163 - function makeSettleInfo(target) { 4164 - return { tasks: [], elts: [target] }; 4165 - } 4166 - 4167 - /** 4168 - * @param {Element[]} content 4169 - * @param {HtmxSwapSpecification} swapSpec 4170 - */ 4171 - function updateScrollState(content, swapSpec) { 4172 - const first = content[0]; 4173 - const last = content[content.length - 1]; 4174 - if (swapSpec.scroll) { 4175 - var target = null; 4176 - if (swapSpec.scrollTarget) { 4177 - target = asElement(querySelectorExt(first, swapSpec.scrollTarget)); 4178 - } 4179 - if (swapSpec.scroll === "top" && (first || target)) { 4180 - target = target || first; 4181 - target.scrollTop = 0; 4182 - } 4183 - if (swapSpec.scroll === "bottom" && (last || target)) { 4184 - target = target || last; 4185 - target.scrollTop = target.scrollHeight; 4186 - } 4187 - } 4188 - if (swapSpec.show) { 4189 - var target = null; 4190 - if (swapSpec.showTarget) { 4191 - let targetStr = swapSpec.showTarget; 4192 - if (swapSpec.showTarget === "window") { 4193 - targetStr = "body"; 4194 - } 4195 - target = asElement(querySelectorExt(first, targetStr)); 4196 - } 4197 - if (swapSpec.show === "top" && (first || target)) { 4198 - target = target || first; 4199 - // @ts-ignore For some reason tsc doesn't recognize "instant" as a valid option for now 4200 - target.scrollIntoView({ 4201 - block: "start", 4202 - behavior: htmx.config.scrollBehavior, 4203 - }); 4204 - } 4205 - if (swapSpec.show === "bottom" && (last || target)) { 4206 - target = target || last; 4207 - // @ts-ignore For some reason tsc doesn't recognize "instant" as a valid option for now 4208 - target.scrollIntoView({ 4209 - block: "end", 4210 - behavior: htmx.config.scrollBehavior, 4211 - }); 4212 - } 4213 - } 4214 - } 4215 - 4216 - /** 4217 - * @param {Element} elt 4218 - * @param {string} attr 4219 - * @param {boolean=} evalAsDefault 4220 - * @param {Object=} values 4221 - * @returns {Object} 4222 - */ 4223 - function getValuesForElement(elt, attr, evalAsDefault, values) { 4224 - if (values == null) { 4225 - values = {}; 4226 - } 4227 - if (elt == null) { 4228 - return values; 4229 - } 4230 - const attributeValue = getAttributeValue(elt, attr); 4231 - if (attributeValue) { 4232 - let str = attributeValue.trim(); 4233 - let evaluateValue = evalAsDefault; 4234 - if (str === "unset") { 4235 - return null; 4236 - } 4237 - if (str.indexOf("javascript:") === 0) { 4238 - str = str.slice(11); 4239 - evaluateValue = true; 4240 - } else if (str.indexOf("js:") === 0) { 4241 - str = str.slice(3); 4242 - evaluateValue = true; 4243 - } 4244 - if (str.indexOf("{") !== 0) { 4245 - str = "{" + str + "}"; 4246 - } 4247 - let varsValues; 4248 - if (evaluateValue) { 4249 - varsValues = maybeEval( 4250 - elt, 4251 - function () { 4252 - return Function("return (" + str + ")")(); 4253 - }, 4254 - {}, 4255 - ); 4256 - } else { 4257 - varsValues = parseJSON(str); 4258 - } 4259 - for (const key in varsValues) { 4260 - if (varsValues.hasOwnProperty(key)) { 4261 - if (values[key] == null) { 4262 - values[key] = varsValues[key]; 4263 - } 4264 - } 4265 - } 4266 - } 4267 - return getValuesForElement( 4268 - asElement(parentElt(elt)), 4269 - attr, 4270 - evalAsDefault, 4271 - values, 4272 - ); 4273 - } 4274 - 4275 - /** 4276 - * @param {EventTarget|string} elt 4277 - * @param {() => any} toEval 4278 - * @param {any=} defaultVal 4279 - * @returns {any} 4280 - */ 4281 - function maybeEval(elt, toEval, defaultVal) { 4282 - if (htmx.config.allowEval) { 4283 - return toEval(); 4284 - } else { 4285 - triggerErrorEvent(elt, "htmx:evalDisallowedError"); 4286 - return defaultVal; 4287 - } 4288 - } 4289 - 4290 - /** 4291 - * @param {Element} elt 4292 - * @param {*?} expressionVars 4293 - * @returns 4294 - */ 4295 - function getHXVarsForElement(elt, expressionVars) { 4296 - return getValuesForElement(elt, "hx-vars", true, expressionVars); 4297 - } 4298 - 4299 - /** 4300 - * @param {Element} elt 4301 - * @param {*?} expressionVars 4302 - * @returns 4303 - */ 4304 - function getHXValsForElement(elt, expressionVars) { 4305 - return getValuesForElement(elt, "hx-vals", false, expressionVars); 4306 - } 4307 - 4308 - /** 4309 - * @param {Element} elt 4310 - * @returns {FormData} 4311 - */ 4312 - function getExpressionVars(elt) { 4313 - return mergeObjects(getHXVarsForElement(elt), getHXValsForElement(elt)); 4314 - } 4315 - 4316 - /** 4317 - * @param {XMLHttpRequest} xhr 4318 - * @param {string} header 4319 - * @param {string|null} headerValue 4320 - */ 4321 - function safelySetHeaderValue(xhr, header, headerValue) { 4322 - if (headerValue !== null) { 4323 - try { 4324 - xhr.setRequestHeader(header, headerValue); 4325 - } catch (e) { 4326 - // On an exception, try to set the header URI encoded instead 4327 - xhr.setRequestHeader(header, encodeURIComponent(headerValue)); 4328 - xhr.setRequestHeader(header + "-URI-AutoEncoded", "true"); 4329 - } 4330 - } 4331 - } 4332 - 4333 - /** 4334 - * @param {XMLHttpRequest} xhr 4335 - * @return {string} 4336 - */ 4337 - function getPathFromResponse(xhr) { 4338 - // NB: IE11 does not support this stuff 4339 - if (xhr.responseURL && typeof URL !== "undefined") { 4340 - try { 4341 - const url = new URL(xhr.responseURL); 4342 - return url.pathname + url.search; 4343 - } catch (e) { 4344 - triggerErrorEvent(getDocument().body, "htmx:badResponseUrl", { 4345 - url: xhr.responseURL, 4346 - }); 4347 - } 4348 - } 4349 - } 4350 - 4351 - /** 4352 - * @param {XMLHttpRequest} xhr 4353 - * @param {RegExp} regexp 4354 - * @return {boolean} 4355 - */ 4356 - function hasHeader(xhr, regexp) { 4357 - return regexp.test(xhr.getAllResponseHeaders()); 4358 - } 4359 - 4360 - /** 4361 - * Issues an htmx-style AJAX request 4362 - * 4363 - * @see https://htmx.org/api/#ajax 4364 - * 4365 - * @param {HttpVerb} verb 4366 - * @param {string} path the URL path to make the AJAX 4367 - * @param {Element|string|HtmxAjaxHelperContext} context the element to target (defaults to the **body**) | a selector for the target | a context object that contains any of the following 4368 - * @return {Promise<void>} Promise that resolves immediately if no request is sent, or when the request is complete 4369 - */ 4370 - function ajaxHelper(verb, path, context) { 4371 - verb = /** @type HttpVerb */ (verb.toLowerCase()); 4372 - if (context) { 4373 - if (context instanceof Element || typeof context === "string") { 4374 - return issueAjaxRequest(verb, path, null, null, { 4375 - targetOverride: resolveTarget(context) || DUMMY_ELT, 4376 - returnPromise: true, 4377 - }); 4378 - } else { 4379 - let resolvedTarget = resolveTarget(context.target); 4380 - // If target is supplied but can't resolve OR source is supplied but both target and source can't be resolved 4381 - // then use DUMMY_ELT to abort the request with htmx:targetError to avoid it replacing body by mistake 4382 - if ( 4383 - (context.target && !resolvedTarget) || 4384 - (context.source && !resolvedTarget && !resolveTarget(context.source)) 4385 - ) { 4386 - resolvedTarget = DUMMY_ELT; 4387 - } 4388 - return issueAjaxRequest( 4389 - verb, 4390 - path, 4391 - resolveTarget(context.source), 4392 - context.event, 4393 - { 4394 - handler: context.handler, 4395 - headers: context.headers, 4396 - values: context.values, 4397 - targetOverride: resolvedTarget, 4398 - swapOverride: context.swap, 4399 - select: context.select, 4400 - returnPromise: true, 4401 - }, 4402 - ); 4403 - } 4404 - } else { 4405 - return issueAjaxRequest(verb, path, null, null, { 4406 - returnPromise: true, 4407 - }); 4408 - } 4409 - } 4410 - 4411 - /** 4412 - * @param {Element} elt 4413 - * @return {Element[]} 4414 - */ 4415 - function hierarchyForElt(elt) { 4416 - const arr = []; 4417 - while (elt) { 4418 - arr.push(elt); 4419 - elt = elt.parentElement; 4420 - } 4421 - return arr; 4422 - } 4423 - 4424 - /** 4425 - * @param {Element} elt 4426 - * @param {string} path 4427 - * @param {HtmxRequestConfig} requestConfig 4428 - * @return {boolean} 4429 - */ 4430 - function verifyPath(elt, path, requestConfig) { 4431 - let sameHost; 4432 - let url; 4433 - if (typeof URL === "function") { 4434 - url = new URL(path, document.location.href); 4435 - const origin = document.location.origin; 4436 - sameHost = origin === url.origin; 4437 - } else { 4438 - // IE11 doesn't support URL 4439 - url = path; 4440 - sameHost = startsWith(path, document.location.origin); 4441 - } 4442 - 4443 - if (htmx.config.selfRequestsOnly) { 4444 - if (!sameHost) { 4445 - return false; 4446 - } 4447 - } 4448 - return triggerEvent( 4449 - elt, 4450 - "htmx:validateUrl", 4451 - mergeObjects({ url, sameHost }, requestConfig), 4452 - ); 4453 - } 4454 - 4455 - /** 4456 - * @param {Object|FormData} obj 4457 - * @return {FormData} 4458 - */ 4459 - function formDataFromObject(obj) { 4460 - if (obj instanceof FormData) return obj; 4461 - const formData = new FormData(); 4462 - for (const key in obj) { 4463 - if (obj.hasOwnProperty(key)) { 4464 - if (obj[key] && typeof obj[key].forEach === "function") { 4465 - obj[key].forEach(function (v) { 4466 - formData.append(key, v); 4467 - }); 4468 - } else if ( 4469 - typeof obj[key] === "object" && 4470 - !(obj[key] instanceof Blob) 4471 - ) { 4472 - formData.append(key, JSON.stringify(obj[key])); 4473 - } else { 4474 - formData.append(key, obj[key]); 4475 - } 4476 - } 4477 - } 4478 - return formData; 4479 - } 4480 - 4481 - /** 4482 - * @param {FormData} formData 4483 - * @param {string} name 4484 - * @param {Array} array 4485 - * @returns {Array} 4486 - */ 4487 - function formDataArrayProxy(formData, name, array) { 4488 - // mutating the array should mutate the underlying form data 4489 - return new Proxy(array, { 4490 - get: function (target, key) { 4491 - if (typeof key === "number") return target[key]; 4492 - if (key === "length") return target.length; 4493 - if (key === "push") { 4494 - return function (value) { 4495 - target.push(value); 4496 - formData.append(name, value); 4497 - }; 4498 - } 4499 - if (typeof target[key] === "function") { 4500 - return function () { 4501 - target[key].apply(target, arguments); 4502 - formData.delete(name); 4503 - target.forEach(function (v) { 4504 - formData.append(name, v); 4505 - }); 4506 - }; 4507 - } 4508 - 4509 - if (target[key] && target[key].length === 1) { 4510 - return target[key][0]; 4511 - } else { 4512 - return target[key]; 4513 - } 4514 - }, 4515 - set: function (target, index, value) { 4516 - target[index] = value; 4517 - formData.delete(name); 4518 - target.forEach(function (v) { 4519 - formData.append(name, v); 4520 - }); 4521 - return true; 4522 - }, 4523 - }); 4524 - } 4525 - 4526 - /** 4527 - * @param {FormData} formData 4528 - * @returns {Object} 4529 - */ 4530 - function formDataProxy(formData) { 4531 - return new Proxy(formData, { 4532 - get: function (target, name) { 4533 - if (typeof name === "symbol") { 4534 - // Forward symbol calls to the FormData itself directly 4535 - const result = Reflect.get(target, name); 4536 - // Wrap in function with apply to correctly bind the FormData context, as a direct call would result in an illegal invocation error 4537 - if (typeof result === "function") { 4538 - return function () { 4539 - return result.apply(formData, arguments); 4540 - }; 4541 - } else { 4542 - return result; 4543 - } 4544 - } 4545 - if (name === "toJSON") { 4546 - // Support JSON.stringify call on proxy 4547 - return () => Object.fromEntries(formData); 4548 - } 4549 - if (name in target) { 4550 - // Wrap in function with apply to correctly bind the FormData context, as a direct call would result in an illegal invocation error 4551 - if (typeof target[name] === "function") { 4552 - return function () { 4553 - return formData[name].apply(formData, arguments); 4554 - }; 4555 - } else { 4556 - return target[name]; 4557 - } 4558 - } 4559 - const array = formData.getAll(name); 4560 - // Those 2 undefined & single value returns are for retro-compatibility as we weren't using FormData before 4561 - if (array.length === 0) { 4562 - return undefined; 4563 - } else if (array.length === 1) { 4564 - return array[0]; 4565 - } else { 4566 - return formDataArrayProxy(target, name, array); 4567 - } 4568 - }, 4569 - set: function (target, name, value) { 4570 - if (typeof name !== "string") { 4571 - return false; 4572 - } 4573 - target.delete(name); 4574 - if (value && typeof value.forEach === "function") { 4575 - value.forEach(function (v) { 4576 - target.append(name, v); 4577 - }); 4578 - } else if (typeof value === "object" && !(value instanceof Blob)) { 4579 - target.append(name, JSON.stringify(value)); 4580 - } else { 4581 - target.append(name, value); 4582 - } 4583 - return true; 4584 - }, 4585 - deleteProperty: function (target, name) { 4586 - if (typeof name === "string") { 4587 - target.delete(name); 4588 - } 4589 - return true; 4590 - }, 4591 - // Support Object.assign call from proxy 4592 - ownKeys: function (target) { 4593 - return Reflect.ownKeys(Object.fromEntries(target)); 4594 - }, 4595 - getOwnPropertyDescriptor: function (target, prop) { 4596 - return Reflect.getOwnPropertyDescriptor( 4597 - Object.fromEntries(target), 4598 - prop, 4599 - ); 4600 - }, 4601 - }); 4602 - } 4603 - 4604 - /** 4605 - * @param {HttpVerb} verb 4606 - * @param {string} path 4607 - * @param {Element} elt 4608 - * @param {Event} event 4609 - * @param {HtmxAjaxEtc} [etc] 4610 - * @param {boolean} [confirmed] 4611 - * @return {Promise<void>} 4612 - */ 4613 - function issueAjaxRequest(verb, path, elt, event, etc, confirmed) { 4614 - let resolve = null; 4615 - let reject = null; 4616 - etc = etc != null ? etc : {}; 4617 - if (etc.returnPromise && typeof Promise !== "undefined") { 4618 - var promise = new Promise(function (_resolve, _reject) { 4619 - resolve = _resolve; 4620 - reject = _reject; 4621 - }); 4622 - } 4623 - if (elt == null) { 4624 - elt = getDocument().body; 4625 - } 4626 - const responseHandler = etc.handler || handleAjaxResponse; 4627 - const select = etc.select || null; 4628 - 4629 - if (!bodyContains(elt)) { 4630 - // do not issue requests for elements removed from the DOM 4631 - maybeCall(resolve); 4632 - return promise; 4633 - } 4634 - const target = etc.targetOverride || asElement(getTarget(elt)); 4635 - if (target == null || target == DUMMY_ELT) { 4636 - triggerErrorEvent(elt, "htmx:targetError", { 4637 - target: getAttributeValue(elt, "hx-target"), 4638 - }); 4639 - maybeCall(reject); 4640 - return promise; 4641 - } 4642 - 4643 - let eltData = getInternalData(elt); 4644 - const submitter = eltData.lastButtonClicked; 4645 - 4646 - if (submitter) { 4647 - const buttonPath = getRawAttribute(submitter, "formaction"); 4648 - if (buttonPath != null) { 4649 - path = buttonPath; 4650 - } 4651 - 4652 - const buttonVerb = getRawAttribute(submitter, "formmethod"); 4653 - if (buttonVerb != null) { 4654 - // ignore buttons with formmethod="dialog" 4655 - if (buttonVerb.toLowerCase() !== "dialog") { 4656 - verb = /** @type HttpVerb */ (buttonVerb); 4657 - } 4658 - } 4659 - } 4660 - 4661 - const confirmQuestion = getClosestAttributeValue(elt, "hx-confirm"); 4662 - // allow event-based confirmation w/ a callback 4663 - if (confirmed === undefined) { 4664 - const issueRequest = function (skipConfirmation) { 4665 - return issueAjaxRequest( 4666 - verb, 4667 - path, 4668 - elt, 4669 - event, 4670 - etc, 4671 - !!skipConfirmation, 4672 - ); 4673 - }; 4674 - const confirmDetails = { 4675 - target, 4676 - elt, 4677 - path, 4678 - verb, 4679 - triggeringEvent: event, 4680 - etc, 4681 - issueRequest, 4682 - question: confirmQuestion, 4683 - }; 4684 - if (triggerEvent(elt, "htmx:confirm", confirmDetails) === false) { 4685 - maybeCall(resolve); 4686 - return promise; 4687 - } 4688 - } 4689 - 4690 - let syncElt = elt; 4691 - let syncStrategy = getClosestAttributeValue(elt, "hx-sync"); 4692 - let queueStrategy = null; 4693 - let abortable = false; 4694 - if (syncStrategy) { 4695 - const syncStrings = syncStrategy.split(":"); 4696 - const selector = syncStrings[0].trim(); 4697 - if (selector === "this") { 4698 - syncElt = findThisElement(elt, "hx-sync"); 4699 - } else { 4700 - syncElt = asElement(querySelectorExt(elt, selector)); 4701 - } 4702 - // default to the drop strategy 4703 - syncStrategy = (syncStrings[1] || "drop").trim(); 4704 - eltData = getInternalData(syncElt); 4705 - if ( 4706 - syncStrategy === "drop" && 4707 - eltData.xhr && 4708 - eltData.abortable !== true 4709 - ) { 4710 - maybeCall(resolve); 4711 - return promise; 4712 - } else if (syncStrategy === "abort") { 4713 - if (eltData.xhr) { 4714 - maybeCall(resolve); 4715 - return promise; 4716 - } else { 4717 - abortable = true; 4718 - } 4719 - } else if (syncStrategy === "replace") { 4720 - triggerEvent(syncElt, "htmx:abort"); // abort the current request and continue 4721 - } else if (syncStrategy.indexOf("queue") === 0) { 4722 - const queueStrArray = syncStrategy.split(" "); 4723 - queueStrategy = (queueStrArray[1] || "last").trim(); 4724 - } 4725 - } 4726 - 4727 - if (eltData.xhr) { 4728 - if (eltData.abortable) { 4729 - triggerEvent(syncElt, "htmx:abort"); // abort the current request and continue 4730 - } else { 4731 - if (queueStrategy == null) { 4732 - if (event) { 4733 - const eventData = getInternalData(event); 4734 - if ( 4735 - eventData && 4736 - eventData.triggerSpec && 4737 - eventData.triggerSpec.queue 4738 - ) { 4739 - queueStrategy = eventData.triggerSpec.queue; 4740 - } 4741 - } 4742 - if (queueStrategy == null) { 4743 - queueStrategy = "last"; 4744 - } 4745 - } 4746 - if (eltData.queuedRequests == null) { 4747 - eltData.queuedRequests = []; 4748 - } 4749 - if (queueStrategy === "first" && eltData.queuedRequests.length === 0) { 4750 - eltData.queuedRequests.push(function () { 4751 - issueAjaxRequest(verb, path, elt, event, etc); 4752 - }); 4753 - } else if (queueStrategy === "all") { 4754 - eltData.queuedRequests.push(function () { 4755 - issueAjaxRequest(verb, path, elt, event, etc); 4756 - }); 4757 - } else if (queueStrategy === "last") { 4758 - eltData.queuedRequests = []; // dump existing queue 4759 - eltData.queuedRequests.push(function () { 4760 - issueAjaxRequest(verb, path, elt, event, etc); 4761 - }); 4762 - } 4763 - maybeCall(resolve); 4764 - return promise; 4765 - } 4766 - } 4767 - 4768 - const xhr = new XMLHttpRequest(); 4769 - eltData.xhr = xhr; 4770 - eltData.abortable = abortable; 4771 - const endRequestLock = function () { 4772 - eltData.xhr = null; 4773 - eltData.abortable = false; 4774 - if (eltData.queuedRequests != null && eltData.queuedRequests.length > 0) { 4775 - const queuedRequest = eltData.queuedRequests.shift(); 4776 - queuedRequest(); 4777 - } 4778 - }; 4779 - const promptQuestion = getClosestAttributeValue(elt, "hx-prompt"); 4780 - if (promptQuestion) { 4781 - var promptResponse = prompt(promptQuestion); 4782 - // prompt returns null if cancelled and empty string if accepted with no entry 4783 - if ( 4784 - promptResponse === null || 4785 - !triggerEvent(elt, "htmx:prompt", { prompt: promptResponse, target }) 4786 - ) { 4787 - maybeCall(resolve); 4788 - endRequestLock(); 4789 - return promise; 4790 - } 4791 - } 4792 - 4793 - if (confirmQuestion && !confirmed) { 4794 - if (!confirm(confirmQuestion)) { 4795 - maybeCall(resolve); 4796 - endRequestLock(); 4797 - return promise; 4798 - } 4799 - } 4800 - 4801 - let headers = getHeaders(elt, target, promptResponse); 4802 - 4803 - if (verb !== "get" && !usesFormData(elt)) { 4804 - headers["Content-Type"] = "application/x-www-form-urlencoded"; 4805 - } 4806 - 4807 - if (etc.headers) { 4808 - headers = mergeObjects(headers, etc.headers); 4809 - } 4810 - const results = getInputValues(elt, verb); 4811 - let errors = results.errors; 4812 - const rawFormData = results.formData; 4813 - if (etc.values) { 4814 - overrideFormData(rawFormData, formDataFromObject(etc.values)); 4815 - } 4816 - const expressionVars = formDataFromObject(getExpressionVars(elt)); 4817 - const allFormData = overrideFormData(rawFormData, expressionVars); 4818 - let filteredFormData = filterValues(allFormData, elt); 4819 - 4820 - if (htmx.config.getCacheBusterParam && verb === "get") { 4821 - filteredFormData.set( 4822 - "org.htmx.cache-buster", 4823 - getRawAttribute(target, "id") || "true", 4824 - ); 4825 - } 4826 - 4827 - // behavior of anchors w/ empty href is to use the current URL 4828 - if (path == null || path === "") { 4829 - path = getDocument().location.href; 4830 - } 4831 - 4832 - /** 4833 - * @type {Object} 4834 - * @property {boolean} [credentials] 4835 - * @property {number} [timeout] 4836 - * @property {boolean} [noHeaders] 4837 - */ 4838 - const requestAttrValues = getValuesForElement(elt, "hx-request"); 4839 - 4840 - const eltIsBoosted = getInternalData(elt).boosted; 4841 - 4842 - let useUrlParams = htmx.config.methodsThatUseUrlParams.indexOf(verb) >= 0; 4843 - 4844 - /** @type HtmxRequestConfig */ 4845 - const requestConfig = { 4846 - boosted: eltIsBoosted, 4847 - useUrlParams, 4848 - formData: filteredFormData, 4849 - parameters: formDataProxy(filteredFormData), 4850 - unfilteredFormData: allFormData, 4851 - unfilteredParameters: formDataProxy(allFormData), 4852 - headers, 4853 - target, 4854 - verb, 4855 - errors, 4856 - withCredentials: 4857 - etc.credentials || 4858 - requestAttrValues.credentials || 4859 - htmx.config.withCredentials, 4860 - timeout: etc.timeout || requestAttrValues.timeout || htmx.config.timeout, 4861 - path, 4862 - triggeringEvent: event, 4863 - }; 4864 - 4865 - if (!triggerEvent(elt, "htmx:configRequest", requestConfig)) { 4866 - maybeCall(resolve); 4867 - endRequestLock(); 4868 - return promise; 4869 - } 4870 - 4871 - // copy out in case the object was overwritten 4872 - path = requestConfig.path; 4873 - verb = requestConfig.verb; 4874 - headers = requestConfig.headers; 4875 - filteredFormData = formDataFromObject(requestConfig.parameters); 4876 - errors = requestConfig.errors; 4877 - useUrlParams = requestConfig.useUrlParams; 4878 - 4879 - if (errors && errors.length > 0) { 4880 - triggerEvent(elt, "htmx:validation:halted", requestConfig); 4881 - maybeCall(resolve); 4882 - endRequestLock(); 4883 - return promise; 4884 - } 4885 - 4886 - const splitPath = path.split("#"); 4887 - const pathNoAnchor = splitPath[0]; 4888 - const anchor = splitPath[1]; 4889 - 4890 - let finalPath = path; 4891 - if (useUrlParams) { 4892 - finalPath = pathNoAnchor; 4893 - const hasValues = !filteredFormData.keys().next().done; 4894 - if (hasValues) { 4895 - if (finalPath.indexOf("?") < 0) { 4896 - finalPath += "?"; 4897 - } else { 4898 - finalPath += "&"; 4899 - } 4900 - finalPath += urlEncode(filteredFormData); 4901 - if (anchor) { 4902 - finalPath += "#" + anchor; 4903 - } 4904 - } 4905 - } 4906 - 4907 - if (!verifyPath(elt, finalPath, requestConfig)) { 4908 - triggerErrorEvent(elt, "htmx:invalidPath", requestConfig); 4909 - maybeCall(reject); 4910 - return promise; 4911 - } 4912 - 4913 - xhr.open(verb.toUpperCase(), finalPath, true); 4914 - xhr.overrideMimeType("text/html"); 4915 - xhr.withCredentials = requestConfig.withCredentials; 4916 - xhr.timeout = requestConfig.timeout; 4917 - 4918 - // request headers 4919 - if (requestAttrValues.noHeaders) { 4920 - // ignore all headers 4921 - } else { 4922 - for (const header in headers) { 4923 - if (headers.hasOwnProperty(header)) { 4924 - const headerValue = headers[header]; 4925 - safelySetHeaderValue(xhr, header, headerValue); 4926 - } 4927 - } 4928 - } 4929 - 4930 - /** @type {HtmxResponseInfo} */ 4931 - const responseInfo = { 4932 - xhr, 4933 - target, 4934 - requestConfig, 4935 - etc, 4936 - boosted: eltIsBoosted, 4937 - select, 4938 - pathInfo: { 4939 - requestPath: path, 4940 - finalRequestPath: finalPath, 4941 - responsePath: null, 4942 - anchor, 4943 - }, 4944 - }; 4945 - 4946 - xhr.onload = function () { 4947 - try { 4948 - const hierarchy = hierarchyForElt(elt); 4949 - responseInfo.pathInfo.responsePath = getPathFromResponse(xhr); 4950 - responseHandler(elt, responseInfo); 4951 - if (responseInfo.keepIndicators !== true) { 4952 - removeRequestIndicators(indicators, disableElts); 4953 - } 4954 - triggerEvent(elt, "htmx:afterRequest", responseInfo); 4955 - triggerEvent(elt, "htmx:afterOnLoad", responseInfo); 4956 - // if the body no longer contains the element, trigger the event on the closest parent 4957 - // remaining in the DOM 4958 - if (!bodyContains(elt)) { 4959 - let secondaryTriggerElt = null; 4960 - while (hierarchy.length > 0 && secondaryTriggerElt == null) { 4961 - const parentEltInHierarchy = hierarchy.shift(); 4962 - if (bodyContains(parentEltInHierarchy)) { 4963 - secondaryTriggerElt = parentEltInHierarchy; 4964 - } 4965 - } 4966 - if (secondaryTriggerElt) { 4967 - triggerEvent( 4968 - secondaryTriggerElt, 4969 - "htmx:afterRequest", 4970 - responseInfo, 4971 - ); 4972 - triggerEvent(secondaryTriggerElt, "htmx:afterOnLoad", responseInfo); 4973 - } 4974 - } 4975 - maybeCall(resolve); 4976 - endRequestLock(); 4977 - } catch (e) { 4978 - triggerErrorEvent( 4979 - elt, 4980 - "htmx:onLoadError", 4981 - mergeObjects({ error: e }, responseInfo), 4982 - ); 4983 - throw e; 4984 - } 4985 - }; 4986 - xhr.onerror = function () { 4987 - removeRequestIndicators(indicators, disableElts); 4988 - triggerErrorEvent(elt, "htmx:afterRequest", responseInfo); 4989 - triggerErrorEvent(elt, "htmx:sendError", responseInfo); 4990 - maybeCall(reject); 4991 - endRequestLock(); 4992 - }; 4993 - xhr.onabort = function () { 4994 - removeRequestIndicators(indicators, disableElts); 4995 - triggerErrorEvent(elt, "htmx:afterRequest", responseInfo); 4996 - triggerErrorEvent(elt, "htmx:sendAbort", responseInfo); 4997 - maybeCall(reject); 4998 - endRequestLock(); 4999 - }; 5000 - xhr.ontimeout = function () { 5001 - removeRequestIndicators(indicators, disableElts); 5002 - triggerErrorEvent(elt, "htmx:afterRequest", responseInfo); 5003 - triggerErrorEvent(elt, "htmx:timeout", responseInfo); 5004 - maybeCall(reject); 5005 - endRequestLock(); 5006 - }; 5007 - if (!triggerEvent(elt, "htmx:beforeRequest", responseInfo)) { 5008 - maybeCall(resolve); 5009 - endRequestLock(); 5010 - return promise; 5011 - } 5012 - var indicators = addRequestIndicatorClasses(elt); 5013 - var disableElts = disableElements(elt); 5014 - 5015 - forEach( 5016 - ["loadstart", "loadend", "progress", "abort"], 5017 - function (eventName) { 5018 - forEach([xhr, xhr.upload], function (target) { 5019 - target.addEventListener(eventName, function (event) { 5020 - triggerEvent(elt, "htmx:xhr:" + eventName, { 5021 - lengthComputable: event.lengthComputable, 5022 - loaded: event.loaded, 5023 - total: event.total, 5024 - }); 5025 - }); 5026 - }); 5027 - }, 5028 - ); 5029 - triggerEvent(elt, "htmx:beforeSend", responseInfo); 5030 - const params = useUrlParams 5031 - ? null 5032 - : encodeParamsForBody(xhr, elt, filteredFormData); 5033 - xhr.send(params); 5034 - return promise; 5035 - } 5036 - 5037 - /** 5038 - * @typedef {Object} HtmxHistoryUpdate 5039 - * @property {string|null} [type] 5040 - * @property {string|null} [path] 5041 - */ 5042 - 5043 - /** 5044 - * @param {Element} elt 5045 - * @param {HtmxResponseInfo} responseInfo 5046 - * @return {HtmxHistoryUpdate} 5047 - */ 5048 - function determineHistoryUpdates(elt, responseInfo) { 5049 - const xhr = responseInfo.xhr; 5050 - 5051 - //= ========================================== 5052 - // First consult response headers 5053 - //= ========================================== 5054 - let pathFromHeaders = null; 5055 - let typeFromHeaders = null; 5056 - if (hasHeader(xhr, /HX-Push:/i)) { 5057 - pathFromHeaders = xhr.getResponseHeader("HX-Push"); 5058 - typeFromHeaders = "push"; 5059 - } else if (hasHeader(xhr, /HX-Push-Url:/i)) { 5060 - pathFromHeaders = xhr.getResponseHeader("HX-Push-Url"); 5061 - typeFromHeaders = "push"; 5062 - } else if (hasHeader(xhr, /HX-Replace-Url:/i)) { 5063 - pathFromHeaders = xhr.getResponseHeader("HX-Replace-Url"); 5064 - typeFromHeaders = "replace"; 5065 - } 5066 - 5067 - // if there was a response header, that has priority 5068 - if (pathFromHeaders) { 5069 - if (pathFromHeaders === "false") { 5070 - return {}; 5071 - } else { 5072 - return { 5073 - type: typeFromHeaders, 5074 - path: pathFromHeaders, 5075 - }; 5076 - } 5077 - } 5078 - 5079 - //= ========================================== 5080 - // Next resolve via DOM values 5081 - //= ========================================== 5082 - const requestPath = responseInfo.pathInfo.finalRequestPath; 5083 - const responsePath = responseInfo.pathInfo.responsePath; 5084 - 5085 - const pushUrl = getClosestAttributeValue(elt, "hx-push-url"); 5086 - const replaceUrl = getClosestAttributeValue(elt, "hx-replace-url"); 5087 - const elementIsBoosted = getInternalData(elt).boosted; 5088 - 5089 - let saveType = null; 5090 - let path = null; 5091 - 5092 - if (pushUrl) { 5093 - saveType = "push"; 5094 - path = pushUrl; 5095 - } else if (replaceUrl) { 5096 - saveType = "replace"; 5097 - path = replaceUrl; 5098 - } else if (elementIsBoosted) { 5099 - saveType = "push"; 5100 - path = responsePath || requestPath; // if there is no response path, go with the original request path 5101 - } 5102 - 5103 - if (path) { 5104 - // false indicates no push, return empty object 5105 - if (path === "false") { 5106 - return {}; 5107 - } 5108 - 5109 - // true indicates we want to follow wherever the server ended up sending us 5110 - if (path === "true") { 5111 - path = responsePath || requestPath; // if there is no response path, go with the original request path 5112 - } 5113 - 5114 - // restore any anchor associated with the request 5115 - if (responseInfo.pathInfo.anchor && path.indexOf("#") === -1) { 5116 - path = path + "#" + responseInfo.pathInfo.anchor; 5117 - } 5118 - 5119 - return { 5120 - type: saveType, 5121 - path, 5122 - }; 5123 - } else { 5124 - return {}; 5125 - } 5126 - } 5127 - 5128 - /** 5129 - * @param {HtmxResponseHandlingConfig} responseHandlingConfig 5130 - * @param {number} status 5131 - * @return {boolean} 5132 - */ 5133 - function codeMatches(responseHandlingConfig, status) { 5134 - var regExp = new RegExp(responseHandlingConfig.code); 5135 - return regExp.test(status.toString(10)); 5136 - } 5137 - 5138 - /** 5139 - * @param {XMLHttpRequest} xhr 5140 - * @return {HtmxResponseHandlingConfig} 5141 - */ 5142 - function resolveResponseHandling(xhr) { 5143 - for (var i = 0; i < htmx.config.responseHandling.length; i++) { 5144 - /** @type HtmxResponseHandlingConfig */ 5145 - var responseHandlingElement = htmx.config.responseHandling[i]; 5146 - if (codeMatches(responseHandlingElement, xhr.status)) { 5147 - return responseHandlingElement; 5148 - } 5149 - } 5150 - // no matches, return no swap 5151 - return { 5152 - swap: false, 5153 - }; 5154 - } 5155 - 5156 - /** 5157 - * @param {string} title 5158 - */ 5159 - function handleTitle(title) { 5160 - if (title) { 5161 - const titleElt = find("title"); 5162 - if (titleElt) { 5163 - titleElt.innerHTML = title; 5164 - } else { 5165 - window.document.title = title; 5166 - } 5167 - } 5168 - } 5169 - 5170 - /** 5171 - * @param {Element} elt 5172 - * @param {HtmxResponseInfo} responseInfo 5173 - */ 5174 - function handleAjaxResponse(elt, responseInfo) { 5175 - const xhr = responseInfo.xhr; 5176 - let target = responseInfo.target; 5177 - const etc = responseInfo.etc; 5178 - const responseInfoSelect = responseInfo.select; 5179 - 5180 - if (!triggerEvent(elt, "htmx:beforeOnLoad", responseInfo)) return; 5181 - 5182 - if (hasHeader(xhr, /HX-Trigger:/i)) { 5183 - handleTriggerHeader(xhr, "HX-Trigger", elt); 5184 - } 5185 - 5186 - if (hasHeader(xhr, /HX-Location:/i)) { 5187 - saveCurrentPageToHistory(); 5188 - let redirectPath = xhr.getResponseHeader("HX-Location"); 5189 - /** @type {HtmxAjaxHelperContext&{path:string}} */ 5190 - var redirectSwapSpec; 5191 - if (redirectPath.indexOf("{") === 0) { 5192 - redirectSwapSpec = parseJSON(redirectPath); 5193 - // what's the best way to throw an error if the user didn't include this 5194 - redirectPath = redirectSwapSpec.path; 5195 - delete redirectSwapSpec.path; 5196 - } 5197 - ajaxHelper("get", redirectPath, redirectSwapSpec).then(function () { 5198 - pushUrlIntoHistory(redirectPath); 5199 - }); 5200 - return; 5201 - } 5202 - 5203 - const shouldRefresh = 5204 - hasHeader(xhr, /HX-Refresh:/i) && 5205 - xhr.getResponseHeader("HX-Refresh") === "true"; 5206 - 5207 - if (hasHeader(xhr, /HX-Redirect:/i)) { 5208 - responseInfo.keepIndicators = true; 5209 - location.href = xhr.getResponseHeader("HX-Redirect"); 5210 - shouldRefresh && location.reload(); 5211 - return; 5212 - } 5213 - 5214 - if (shouldRefresh) { 5215 - responseInfo.keepIndicators = true; 5216 - location.reload(); 5217 - return; 5218 - } 5219 - 5220 - if (hasHeader(xhr, /HX-Retarget:/i)) { 5221 - if (xhr.getResponseHeader("HX-Retarget") === "this") { 5222 - responseInfo.target = elt; 5223 - } else { 5224 - responseInfo.target = asElement( 5225 - querySelectorExt(elt, xhr.getResponseHeader("HX-Retarget")), 5226 - ); 5227 - } 5228 - } 5229 - 5230 - const historyUpdate = determineHistoryUpdates(elt, responseInfo); 5231 - 5232 - const responseHandling = resolveResponseHandling(xhr); 5233 - const shouldSwap = responseHandling.swap; 5234 - let isError = !!responseHandling.error; 5235 - let ignoreTitle = htmx.config.ignoreTitle || responseHandling.ignoreTitle; 5236 - let selectOverride = responseHandling.select; 5237 - if (responseHandling.target) { 5238 - responseInfo.target = asElement( 5239 - querySelectorExt(elt, responseHandling.target), 5240 - ); 5241 - } 5242 - var swapOverride = etc.swapOverride; 5243 - if (swapOverride == null && responseHandling.swapOverride) { 5244 - swapOverride = responseHandling.swapOverride; 5245 - } 5246 - 5247 - // response headers override response handling config 5248 - if (hasHeader(xhr, /HX-Retarget:/i)) { 5249 - if (xhr.getResponseHeader("HX-Retarget") === "this") { 5250 - responseInfo.target = elt; 5251 - } else { 5252 - responseInfo.target = asElement( 5253 - querySelectorExt(elt, xhr.getResponseHeader("HX-Retarget")), 5254 - ); 5255 - } 5256 - } 5257 - if (hasHeader(xhr, /HX-Reswap:/i)) { 5258 - swapOverride = xhr.getResponseHeader("HX-Reswap"); 5259 - } 5260 - 5261 - var serverResponse = xhr.response; 5262 - /** @type HtmxBeforeSwapDetails */ 5263 - var beforeSwapDetails = mergeObjects( 5264 - { 5265 - shouldSwap, 5266 - serverResponse, 5267 - isError, 5268 - ignoreTitle, 5269 - selectOverride, 5270 - swapOverride, 5271 - }, 5272 - responseInfo, 5273 - ); 5274 - 5275 - if ( 5276 - responseHandling.event && 5277 - !triggerEvent(target, responseHandling.event, beforeSwapDetails) 5278 - ) 5279 - return; 5280 - 5281 - if (!triggerEvent(target, "htmx:beforeSwap", beforeSwapDetails)) return; 5282 - 5283 - target = beforeSwapDetails.target; // allow re-targeting 5284 - serverResponse = beforeSwapDetails.serverResponse; // allow updating content 5285 - isError = beforeSwapDetails.isError; // allow updating error 5286 - ignoreTitle = beforeSwapDetails.ignoreTitle; // allow updating ignoring title 5287 - selectOverride = beforeSwapDetails.selectOverride; // allow updating select override 5288 - swapOverride = beforeSwapDetails.swapOverride; // allow updating swap override 5289 - 5290 - responseInfo.target = target; // Make updated target available to response events 5291 - responseInfo.failed = isError; // Make failed property available to response events 5292 - responseInfo.successful = !isError; // Make successful property available to response events 5293 - 5294 - if (beforeSwapDetails.shouldSwap) { 5295 - if (xhr.status === 286) { 5296 - cancelPolling(elt); 5297 - } 5298 - 5299 - withExtensions(elt, function (extension) { 5300 - serverResponse = extension.transformResponse(serverResponse, xhr, elt); 5301 - }); 5302 - 5303 - // Save current page if there will be a history update 5304 - if (historyUpdate.type) { 5305 - saveCurrentPageToHistory(); 5306 - } 5307 - 5308 - var swapSpec = getSwapSpecification(elt, swapOverride); 5309 - 5310 - if (!swapSpec.hasOwnProperty("ignoreTitle")) { 5311 - swapSpec.ignoreTitle = ignoreTitle; 5312 - } 5313 - 5314 - target.classList.add(htmx.config.swappingClass); 5315 - 5316 - // optional transition API promise callbacks 5317 - let settleResolve = null; 5318 - let settleReject = null; 5319 - 5320 - if (responseInfoSelect) { 5321 - selectOverride = responseInfoSelect; 5322 - } 5323 - 5324 - if (hasHeader(xhr, /HX-Reselect:/i)) { 5325 - selectOverride = xhr.getResponseHeader("HX-Reselect"); 5326 - } 5327 - 5328 - const selectOOB = getClosestAttributeValue(elt, "hx-select-oob"); 5329 - const select = getClosestAttributeValue(elt, "hx-select"); 5330 - 5331 - let doSwap = function () { 5332 - try { 5333 - // if we need to save history, do so, before swapping so that relative resources have the correct base URL 5334 - if (historyUpdate.type) { 5335 - triggerEvent( 5336 - getDocument().body, 5337 - "htmx:beforeHistoryUpdate", 5338 - mergeObjects({ history: historyUpdate }, responseInfo), 5339 - ); 5340 - if (historyUpdate.type === "push") { 5341 - pushUrlIntoHistory(historyUpdate.path); 5342 - triggerEvent(getDocument().body, "htmx:pushedIntoHistory", { 5343 - path: historyUpdate.path, 5344 - }); 5345 - } else { 5346 - replaceUrlInHistory(historyUpdate.path); 5347 - triggerEvent(getDocument().body, "htmx:replacedInHistory", { 5348 - path: historyUpdate.path, 5349 - }); 5350 - } 5351 - } 5352 - 5353 - swap(target, serverResponse, swapSpec, { 5354 - select: selectOverride || select, 5355 - selectOOB, 5356 - eventInfo: responseInfo, 5357 - anchor: responseInfo.pathInfo.anchor, 5358 - contextElement: elt, 5359 - afterSwapCallback: function () { 5360 - if (hasHeader(xhr, /HX-Trigger-After-Swap:/i)) { 5361 - let finalElt = elt; 5362 - if (!bodyContains(elt)) { 5363 - finalElt = getDocument().body; 5364 - } 5365 - handleTriggerHeader(xhr, "HX-Trigger-After-Swap", finalElt); 5366 - } 5367 - }, 5368 - afterSettleCallback: function () { 5369 - if (hasHeader(xhr, /HX-Trigger-After-Settle:/i)) { 5370 - let finalElt = elt; 5371 - if (!bodyContains(elt)) { 5372 - finalElt = getDocument().body; 5373 - } 5374 - handleTriggerHeader(xhr, "HX-Trigger-After-Settle", finalElt); 5375 - } 5376 - maybeCall(settleResolve); 5377 - }, 5378 - }); 5379 - } catch (e) { 5380 - triggerErrorEvent(elt, "htmx:swapError", responseInfo); 5381 - maybeCall(settleReject); 5382 - throw e; 5383 - } 5384 - }; 5385 - 5386 - let shouldTransition = htmx.config.globalViewTransitions; 5387 - if (swapSpec.hasOwnProperty("transition")) { 5388 - shouldTransition = swapSpec.transition; 5389 - } 5390 - 5391 - if ( 5392 - shouldTransition && 5393 - triggerEvent(elt, "htmx:beforeTransition", responseInfo) && 5394 - typeof Promise !== "undefined" && 5395 - // @ts-ignore experimental feature atm 5396 - document.startViewTransition 5397 - ) { 5398 - const settlePromise = new Promise(function (_resolve, _reject) { 5399 - settleResolve = _resolve; 5400 - settleReject = _reject; 5401 - }); 5402 - // wrap the original doSwap() in a call to startViewTransition() 5403 - const innerDoSwap = doSwap; 5404 - doSwap = function () { 5405 - // @ts-ignore experimental feature atm 5406 - document.startViewTransition(function () { 5407 - innerDoSwap(); 5408 - return settlePromise; 5409 - }); 5410 - }; 5411 - } 5412 - 5413 - if (swapSpec.swapDelay > 0) { 5414 - getWindow().setTimeout(doSwap, swapSpec.swapDelay); 5415 - } else { 5416 - doSwap(); 5417 - } 5418 - } 5419 - if (isError) { 5420 - triggerErrorEvent( 5421 - elt, 5422 - "htmx:responseError", 5423 - mergeObjects( 5424 - { 5425 - error: 5426 - "Response Status Error Code " + 5427 - xhr.status + 5428 - " from " + 5429 - responseInfo.pathInfo.requestPath, 5430 - }, 5431 - responseInfo, 5432 - ), 5433 - ); 5434 - } 5435 - } 5436 - 5437 - //= =================================================================== 5438 - // Extensions API 5439 - //= =================================================================== 5440 - 5441 - /** @type {Object<string, HtmxExtension>} */ 5442 - const extensions = {}; 5443 - 5444 - /** 5445 - * extensionBase defines the default functions for all extensions. 5446 - * @returns {HtmxExtension} 5447 - */ 5448 - function extensionBase() { 5449 - return { 5450 - init: function (api) { 5451 - return null; 5452 - }, 5453 - getSelectors: function () { 5454 - return null; 5455 - }, 5456 - onEvent: function (name, evt) { 5457 - return true; 5458 - }, 5459 - transformResponse: function (text, xhr, elt) { 5460 - return text; 5461 - }, 5462 - isInlineSwap: function (swapStyle) { 5463 - return false; 5464 - }, 5465 - handleSwap: function (swapStyle, target, fragment, settleInfo) { 5466 - return false; 5467 - }, 5468 - encodeParameters: function (xhr, parameters, elt) { 5469 - return null; 5470 - }, 5471 - }; 5472 - } 5473 - 5474 - /** 5475 - * defineExtension initializes the extension and adds it to the htmx registry 5476 - * 5477 - * @see https://htmx.org/api/#defineExtension 5478 - * 5479 - * @param {string} name the extension name 5480 - * @param {Partial<HtmxExtension>} extension the extension definition 5481 - */ 5482 - function defineExtension(name, extension) { 5483 - if (extension.init) { 5484 - extension.init(internalAPI); 5485 - } 5486 - extensions[name] = mergeObjects(extensionBase(), extension); 5487 - } 5488 - 5489 - /** 5490 - * removeExtension removes an extension from the htmx registry 5491 - * 5492 - * @see https://htmx.org/api/#removeExtension 5493 - * 5494 - * @param {string} name 5495 - */ 5496 - function removeExtension(name) { 5497 - delete extensions[name]; 5498 - } 5499 - 5500 - /** 5501 - * getExtensions searches up the DOM tree to return all extensions that can be applied to a given element 5502 - * 5503 - * @param {Element} elt 5504 - * @param {HtmxExtension[]=} extensionsToReturn 5505 - * @param {string[]=} extensionsToIgnore 5506 - * @returns {HtmxExtension[]} 5507 - */ 5508 - function getExtensions(elt, extensionsToReturn, extensionsToIgnore) { 5509 - if (extensionsToReturn == undefined) { 5510 - extensionsToReturn = []; 5511 - } 5512 - if (elt == undefined) { 5513 - return extensionsToReturn; 5514 - } 5515 - if (extensionsToIgnore == undefined) { 5516 - extensionsToIgnore = []; 5517 - } 5518 - const extensionsForElement = getAttributeValue(elt, "hx-ext"); 5519 - if (extensionsForElement) { 5520 - forEach(extensionsForElement.split(","), function (extensionName) { 5521 - extensionName = extensionName.replace(/ /g, ""); 5522 - if (extensionName.slice(0, 7) == "ignore:") { 5523 - extensionsToIgnore.push(extensionName.slice(7)); 5524 - return; 5525 - } 5526 - if (extensionsToIgnore.indexOf(extensionName) < 0) { 5527 - const extension = extensions[extensionName]; 5528 - if (extension && extensionsToReturn.indexOf(extension) < 0) { 5529 - extensionsToReturn.push(extension); 5530 - } 5531 - } 5532 - }); 5533 - } 5534 - return getExtensions( 5535 - asElement(parentElt(elt)), 5536 - extensionsToReturn, 5537 - extensionsToIgnore, 5538 - ); 5539 - } 5540 - 5541 - //= =================================================================== 5542 - // Initialization 5543 - //= =================================================================== 5544 - var isReady = false; 5545 - getDocument().addEventListener("DOMContentLoaded", function () { 5546 - isReady = true; 5547 - }); 5548 - 5549 - /** 5550 - * Execute a function now if DOMContentLoaded has fired, otherwise listen for it. 5551 - * 5552 - * This function uses isReady because there is no reliable way to ask the browser whether 5553 - * the DOMContentLoaded event has already been fired; there's a gap between DOMContentLoaded 5554 - * firing and readystate=complete. 5555 - */ 5556 - function ready(fn) { 5557 - // Checking readyState here is a failsafe in case the htmx script tag entered the DOM by 5558 - // some means other than the initial page load. 5559 - if (isReady || getDocument().readyState === "complete") { 5560 - fn(); 5561 - } else { 5562 - getDocument().addEventListener("DOMContentLoaded", fn); 5563 - } 5564 - } 5565 - 5566 - function insertIndicatorStyles() { 5567 - if (htmx.config.includeIndicatorStyles !== false) { 5568 - const nonceAttribute = htmx.config.inlineStyleNonce 5569 - ? ` nonce="${htmx.config.inlineStyleNonce}"` 5570 - : ""; 5571 - getDocument().head.insertAdjacentHTML( 5572 - "beforeend", 5573 - "<style" + 5574 - nonceAttribute + 5575 - ">\ 5576 - ." + 5577 - htmx.config.indicatorClass + 5578 - "{opacity:0}\ 5579 - ." + 5580 - htmx.config.requestClass + 5581 - " ." + 5582 - htmx.config.indicatorClass + 5583 - "{opacity:1; transition: opacity 200ms ease-in;}\ 5584 - ." + 5585 - htmx.config.requestClass + 5586 - "." + 5587 - htmx.config.indicatorClass + 5588 - "{opacity:1; transition: opacity 200ms ease-in;}\ 5589 - </style>", 5590 - ); 5591 - } 5592 - } 5593 - 5594 - function getMetaConfig() { 5595 - /** @type HTMLMetaElement */ 5596 - const element = getDocument().querySelector('meta[name="htmx-config"]'); 5597 - if (element) { 5598 - return parseJSON(element.content); 5599 - } else { 5600 - return null; 5601 - } 5602 - } 5603 - 5604 - function mergeMetaConfig() { 5605 - const metaConfig = getMetaConfig(); 5606 - if (metaConfig) { 5607 - htmx.config = mergeObjects(htmx.config, metaConfig); 5608 - } 5609 - } 5610 - 5611 - // initialize the document 5612 - ready(function () { 5613 - mergeMetaConfig(); 5614 - insertIndicatorStyles(); 5615 - let body = getDocument().body; 5616 - processNode(body); 5617 - const restoredElts = getDocument().querySelectorAll( 5618 - "[hx-trigger='restored'],[data-hx-trigger='restored']", 5619 - ); 5620 - body.addEventListener("htmx:abort", function (evt) { 5621 - const target = evt.target; 5622 - const internalData = getInternalData(target); 5623 - if (internalData && internalData.xhr) { 5624 - internalData.xhr.abort(); 5625 - } 5626 - }); 5627 - /** @type {(ev: PopStateEvent) => any} */ 5628 - const originalPopstate = window.onpopstate 5629 - ? window.onpopstate.bind(window) 5630 - : null; 5631 - /** @type {(ev: PopStateEvent) => any} */ 5632 - window.onpopstate = function (event) { 5633 - if (event.state && event.state.htmx) { 5634 - restoreHistory(); 5635 - forEach(restoredElts, function (elt) { 5636 - triggerEvent(elt, "htmx:restored", { 5637 - document: getDocument(), 5638 - triggerEvent, 5639 - }); 5640 - }); 5641 - } else { 5642 - if (originalPopstate) { 5643 - originalPopstate(event); 5644 - } 5645 - } 5646 - }; 5647 - getWindow().setTimeout(function () { 5648 - triggerEvent(body, "htmx:load", {}); // give ready handlers a chance to load up before firing this event 5649 - body = null; // kill reference for gc 5650 - }, 0); 5651 - }); 5652 - 5653 - return htmx; 5654 - })(); 5655 - 5656 - /** @typedef {'get'|'head'|'post'|'put'|'delete'|'connect'|'options'|'trace'|'patch'} HttpVerb */ 5657 - 5658 - /** 5659 - * @typedef {Object} SwapOptions 5660 - * @property {string} [select] 5661 - * @property {string} [selectOOB] 5662 - * @property {*} [eventInfo] 5663 - * @property {string} [anchor] 5664 - * @property {Element} [contextElement] 5665 - * @property {swapCallback} [afterSwapCallback] 5666 - * @property {swapCallback} [afterSettleCallback] 5667 - */ 5668 - 5669 - /** 5670 - * @callback swapCallback 5671 - */ 5672 - 5673 - /** 5674 - * @typedef {'innerHTML' | 'outerHTML' | 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend' | 'delete' | 'none' | string} HtmxSwapStyle 5675 - */ 5676 - 5677 - /** 5678 - * @typedef HtmxSwapSpecification 5679 - * @property {HtmxSwapStyle} swapStyle 5680 - * @property {number} swapDelay 5681 - * @property {number} settleDelay 5682 - * @property {boolean} [transition] 5683 - * @property {boolean} [ignoreTitle] 5684 - * @property {string} [head] 5685 - * @property {'top' | 'bottom'} [scroll] 5686 - * @property {string} [scrollTarget] 5687 - * @property {string} [show] 5688 - * @property {string} [showTarget] 5689 - * @property {boolean} [focusScroll] 5690 - */ 5691 - 5692 - /** 5693 - * @typedef {((this:Node, evt:Event) => boolean) & {source: string}} ConditionalFunction 5694 - */ 5695 - 5696 - /** 5697 - * @typedef {Object} HtmxTriggerSpecification 5698 - * @property {string} trigger 5699 - * @property {number} [pollInterval] 5700 - * @property {ConditionalFunction} [eventFilter] 5701 - * @property {boolean} [changed] 5702 - * @property {boolean} [once] 5703 - * @property {boolean} [consume] 5704 - * @property {number} [delay] 5705 - * @property {string} [from] 5706 - * @property {string} [target] 5707 - * @property {number} [throttle] 5708 - * @property {string} [queue] 5709 - * @property {string} [root] 5710 - * @property {string} [threshold] 5711 - */ 5712 - 5713 - /** 5714 - * @typedef {{elt: Element, message: string, validity: ValidityState}} HtmxElementValidationError 5715 - */ 5716 - 5717 - /** 5718 - * @typedef {Record<string, string>} HtmxHeaderSpecification 5719 - * @property {'true'} HX-Request 5720 - * @property {string|null} HX-Trigger 5721 - * @property {string|null} HX-Trigger-Name 5722 - * @property {string|null} HX-Target 5723 - * @property {string} HX-Current-URL 5724 - * @property {string} [HX-Prompt] 5725 - * @property {'true'} [HX-Boosted] 5726 - * @property {string} [Content-Type] 5727 - * @property {'true'} [HX-History-Restore-Request] 5728 - */ 5729 - 5730 - /** @typedef HtmxAjaxHelperContext 5731 - * @property {Element|string} [source] 5732 - * @property {Event} [event] 5733 - * @property {HtmxAjaxHandler} [handler] 5734 - * @property {Element|string} [target] 5735 - * @property {HtmxSwapStyle} [swap] 5736 - * @property {Object|FormData} [values] 5737 - * @property {Record<string,string>} [headers] 5738 - * @property {string} [select] 5739 - */ 5740 - 5741 - /** 5742 - * @typedef {Object} HtmxRequestConfig 5743 - * @property {boolean} boosted 5744 - * @property {boolean} useUrlParams 5745 - * @property {FormData} formData 5746 - * @property {Object} parameters formData proxy 5747 - * @property {FormData} unfilteredFormData 5748 - * @property {Object} unfilteredParameters unfilteredFormData proxy 5749 - * @property {HtmxHeaderSpecification} headers 5750 - * @property {Element} target 5751 - * @property {HttpVerb} verb 5752 - * @property {HtmxElementValidationError[]} errors 5753 - * @property {boolean} withCredentials 5754 - * @property {number} timeout 5755 - * @property {string} path 5756 - * @property {Event} triggeringEvent 5757 - */ 5758 - 5759 - /** 5760 - * @typedef {Object} HtmxResponseInfo 5761 - * @property {XMLHttpRequest} xhr 5762 - * @property {Element} target 5763 - * @property {HtmxRequestConfig} requestConfig 5764 - * @property {HtmxAjaxEtc} etc 5765 - * @property {boolean} boosted 5766 - * @property {string} select 5767 - * @property {{requestPath: string, finalRequestPath: string, responsePath: string|null, anchor: string}} pathInfo 5768 - * @property {boolean} [failed] 5769 - * @property {boolean} [successful] 5770 - * @property {boolean} [keepIndicators] 5771 - */ 5772 - 5773 - /** 5774 - * @typedef {Object} HtmxAjaxEtc 5775 - * @property {boolean} [returnPromise] 5776 - * @property {HtmxAjaxHandler} [handler] 5777 - * @property {string} [select] 5778 - * @property {Element} [targetOverride] 5779 - * @property {HtmxSwapStyle} [swapOverride] 5780 - * @property {Record<string,string>} [headers] 5781 - * @property {Object|FormData} [values] 5782 - * @property {boolean} [credentials] 5783 - * @property {number} [timeout] 5784 - */ 5785 - 5786 - /** 5787 - * @typedef {Object} HtmxResponseHandlingConfig 5788 - * @property {string} [code] 5789 - * @property {boolean} swap 5790 - * @property {boolean} [error] 5791 - * @property {boolean} [ignoreTitle] 5792 - * @property {string} [select] 5793 - * @property {string} [target] 5794 - * @property {string} [swapOverride] 5795 - * @property {string} [event] 5796 - */ 5797 - 5798 - /** 5799 - * @typedef {HtmxResponseInfo & {shouldSwap: boolean, serverResponse: any, isError: boolean, ignoreTitle: boolean, selectOverride:string, swapOverride:string}} HtmxBeforeSwapDetails 5800 - */ 5801 - 5802 - /** 5803 - * @callback HtmxAjaxHandler 5804 - * @param {Element} elt 5805 - * @param {HtmxResponseInfo} responseInfo 5806 - */ 5807 - 5808 - /** 5809 - * @typedef {(() => void)} HtmxSettleTask 5810 - */ 5811 - 5812 - /** 5813 - * @typedef {Object} HtmxSettleInfo 5814 - * @property {HtmxSettleTask[]} tasks 5815 - * @property {Element[]} elts 5816 - * @property {string} [title] 5817 - */ 5818 - 5819 - /** 5820 - * @see https://github.com/bigskysoftware/htmx-extensions/blob/main/README.md 5821 - * @typedef {Object} HtmxExtension 5822 - * @property {(api: any) => void} init 5823 - * @property {(name: string, event: Event|CustomEvent) => boolean} onEvent 5824 - * @property {(text: string, xhr: XMLHttpRequest, elt: Element) => string} transformResponse 5825 - * @property {(swapStyle: HtmxSwapStyle) => boolean} isInlineSwap 5826 - * @property {(swapStyle: HtmxSwapStyle, target: Node, fragment: Node, settleInfo: HtmxSettleInfo) => boolean|Node[]} handleSwap 5827 - * @property {(xhr: XMLHttpRequest, parameters: FormData, elt: Node) => *|string|null} encodeParameters 5828 - * @property {() => string[]|null} getSelectors 5829 - */
-96
bin/forester/theme/javascript-source/forester.js
··· 1 - import 'ninja-keys'; 2 - import 'katex'; 3 - 4 - import autoRenderMath from 'katex/contrib/auto-render'; 5 - 6 - function partition(array, isValid) { 7 - return array.reduce(([pass, fail], elem) => { 8 - return isValid(elem) ? [[...pass, elem], fail] : [pass, [...fail, elem]]; 9 - }, [[], []]); 10 - } 11 - 12 - window.addEventListener("load", (event) => { 13 - autoRenderMath(document.body) 14 - 15 - const openAllDetailsAbove = elt => { 16 - while (elt != null) { 17 - if (elt.nodeName == 'DETAILS') { 18 - elt.open = true 19 - } 20 - 21 - elt = elt.parentNode; 22 - } 23 - } 24 - 25 - const jumpToSubtree = evt => { 26 - if (evt.target.tagName === "A") { 27 - return; 28 - } 29 - 30 - const link = evt.target.closest('span[data-target]') 31 - const selector = link.getAttribute('data-target') 32 - const tree = document.querySelector(selector) 33 - openAllDetailsAbove(tree) 34 - window.location = selector 35 - } 36 - 37 - 38 - [...document.querySelectorAll("[data-target^='#']")].forEach( 39 - el => el.addEventListener("click", jumpToSubtree) 40 - ); 41 - }); 42 - 43 - const ninja = document.querySelector('ninja-keys'); 44 - 45 - fetch("./forest.json") 46 - .then((res) => res.json()) 47 - .then((data) => { 48 - const items = [] 49 - 50 - const editIcon = '<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path d="M480-120v-71l216-216 71 71-216 216h-71ZM120-330v-60h300v60H120Zm690-49-71-71 29-29q8-8 21-8t21 8l29 29q8 8 8 21t-8 21l-29 29ZM120-495v-60h470v60H120Zm0-165v-60h470v60H120Z"/></svg>' 51 - const bookmarkIcon = '<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20"><path d="M120-40v-700q0-24 18-42t42-18h480q24 0 42.5 18t18.5 42v700L420-167 120-40Zm60-91 240-103 240 103v-609H180v609Zm600 1v-730H233v-60h547q24 0 42 18t18 42v730h-60ZM180-740h480-480Z"/></svg>' 52 - 53 - if (window.sourcePath) { 54 - items.push({ 55 - id: 'edit', 56 - title: 'Edit current tree in Visual Studio Code', 57 - section: 'Commands', 58 - hotkey: 'cmd+e', 59 - icon: editIcon, 60 - handler: () => { 61 - window.location.href = `vscode://file/${window.sourcePath}` 62 - } 63 - }) 64 - } 65 - 66 - const isTopTree = (addr) => { 67 - const item = data[addr] 68 - return item.tags ? item.tags.includes('top') : false 69 - } 70 - 71 - const addItemToSection = (addr, section, icon) => { 72 - const item = data[addr] 73 - const title = 74 - item.taxon 75 - ? (item.title ? `${item.taxon}. ${item.title}` : item.taxon) 76 - : (item.title ? item.title : "Untitled") 77 - const fullTitle = `${title} [${addr}]` 78 - items.push({ 79 - id: addr, 80 - title: fullTitle, 81 - section: section, 82 - icon: icon, 83 - handler: () => { 84 - window.location.href = item.route 85 - } 86 - }) 87 - } 88 - 89 - const [top, rest] = partition(Object.keys(data), isTopTree) 90 - top.forEach((addr) => addItemToSection(addr, "Top Trees", bookmarkIcon)) 91 - rest.forEach((addr) => addItemToSection(addr, "All Trees", null)) 92 - 93 - ninja.data = items 94 - }); 95 - 96 -
-1
bin/forester/theme/katex.min.css
··· 1 - @font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(fonts/KaTeX_AMS-Regular.woff2) format("woff2"),url(fonts/KaTeX_AMS-Regular.woff) format("woff"),url(fonts/KaTeX_AMS-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Bold.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Regular.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Fraktur-Bold.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Bold.woff) format("woff"),url(fonts/KaTeX_Fraktur-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Fraktur-Regular.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Regular.woff) format("woff"),url(fonts/KaTeX_Fraktur-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Main-Bold.woff2) format("woff2"),url(fonts/KaTeX_Main-Bold.woff) format("woff"),url(fonts/KaTeX_Main-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Main-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Main-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Main-BoldItalic.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Main-Italic.woff2) format("woff2"),url(fonts/KaTeX_Main-Italic.woff) format("woff"),url(fonts/KaTeX_Main-Italic.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Main-Regular.woff2) format("woff2"),url(fonts/KaTeX_Main-Regular.woff) format("woff"),url(fonts/KaTeX_Main-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Math-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Math-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Math-BoldItalic.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Math-Italic.woff2) format("woff2"),url(fonts/KaTeX_Math-Italic.woff) format("woff"),url(fonts/KaTeX_Math-Italic.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(fonts/KaTeX_SansSerif-Bold.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Bold.woff) format("woff"),url(fonts/KaTeX_SansSerif-Bold.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(fonts/KaTeX_SansSerif-Italic.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Italic.woff) format("woff"),url(fonts/KaTeX_SansSerif-Italic.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:url(fonts/KaTeX_SansSerif-Regular.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Regular.woff) format("woff"),url(fonts/KaTeX_SansSerif-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Script-Regular.woff2) format("woff2"),url(fonts/KaTeX_Script-Regular.woff) format("woff"),url(fonts/KaTeX_Script-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size1-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size1-Regular.woff) format("woff"),url(fonts/KaTeX_Size1-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size2-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size2-Regular.woff) format("woff"),url(fonts/KaTeX_Size2-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size3-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size3-Regular.woff) format("woff"),url(fonts/KaTeX_Size3-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size4-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size4-Regular.woff) format("woff"),url(fonts/KaTeX_Size4-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Typewriter-Regular.woff2) format("woff2"),url(fonts/KaTeX_Typewriter-Regular.woff) format("woff"),url(fonts/KaTeX_Typewriter-Regular.ttf) format("truetype")}.katex{text-rendering:auto;font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.8"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.27777778em;margin-right:-.55555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.83333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.16666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.66666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.45666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.14666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.71428571em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.85714286em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.14285714em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.28571429em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.42857143em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.71428571em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.05714286em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.46857143em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.96285714em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.55428571em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.55555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.66666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.77777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.88888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.11111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.30444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.76444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.41666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.58333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.66666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.83333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.72833333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.07333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.34722222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.41666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.48611111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.55555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.69444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.83333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.44027778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.72777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.28935185em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.34722222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.40509259em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.46296296em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.52083333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.69444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.83333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.20023148em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.43981481em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.24108004em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.28929605em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.33751205em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.38572806em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.43394407em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.48216008em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.57859209em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.69431051em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.83317261em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.19961427em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.20096463em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.24115756em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.28135048em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.32154341em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.36173633em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.40192926em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.48231511em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.57877814em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.69453376em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.83360129em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}
-34
bin/forester/theme/links.xsl
··· 1 - <?xml version="1.0"?> 2 - <!-- SPDX-License-Identifier: CC0-1.0 --> 3 - <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:f="http://www.jonmsterling.com/jms-005P.xml"> 4 - 5 - <!-- The purpose of this module is to perform flattening of nested links. --> 6 - <xsl:template match="f:link"> 7 - <span class="link {@type}"> 8 - <xsl:apply-templates mode="link-flattening" /> 9 - </span> 10 - </xsl:template> 11 - 12 - <xsl:template match="f:link//node()[not(f:link)]" mode="link-flattening"> 13 - <a href="{ancestor::f:link[1]/@href}"> 14 - <xsl:choose> 15 - <xsl:when test="ancestor::f:link[1]/@addr"> 16 - <xsl:attribute name="title"> 17 - <xsl:value-of select="ancestor::f:link[1]/@title" /> 18 - <xsl:text> [</xsl:text> 19 - <xsl:value-of 20 - select="ancestor::f:link[1]/@addr" /> 21 - <xsl:text>]</xsl:text> 22 - </xsl:attribute> 23 - </xsl:when> 24 - <xsl:otherwise> 25 - <xsl:attribute name="title"> 26 - <xsl:value-of select="ancestor::f:link[1]/@title" /> 27 - </xsl:attribute> 28 - </xsl:otherwise> 29 - </xsl:choose> 30 - <xsl:apply-templates select="." /> 31 - </a> 32 - </xsl:template> 33 - 34 - </xsl:stylesheet>
-165
bin/forester/theme/metadata.xsl
··· 1 - <?xml version="1.0"?> 2 - <!-- SPDX-License-Identifier: CC0-1.0 --> 3 - <xsl:stylesheet version="1.0" 4 - xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 5 - xmlns:f="http://www.jonmsterling.com/jms-005P.xml"> 6 - 7 - <xsl:template match="f:month[.='1']"> 8 - <xsl:text>January</xsl:text> 9 - </xsl:template> 10 - 11 - <xsl:template match="f:month[.='2']"> 12 - <xsl:text>February</xsl:text> 13 - </xsl:template> 14 - 15 - <xsl:template match="f:month[.='3']"> 16 - <xsl:text>March</xsl:text> 17 - </xsl:template> 18 - 19 - <xsl:template match="f:month[.='4']"> 20 - <xsl:text>April</xsl:text> 21 - </xsl:template> 22 - 23 - <xsl:template match="f:month[.='5']"> 24 - <xsl:text>May</xsl:text> 25 - </xsl:template> 26 - 27 - <xsl:template match="f:month[.='6']"> 28 - <xsl:text>June</xsl:text> 29 - </xsl:template> 30 - 31 - <xsl:template match="f:month[.='7']"> 32 - <xsl:text>July</xsl:text> 33 - </xsl:template> 34 - 35 - <xsl:template match="f:month[.='8']"> 36 - <xsl:text>August</xsl:text> 37 - </xsl:template> 38 - 39 - <xsl:template match="f:month[.='9']"> 40 - <xsl:text>September</xsl:text> 41 - </xsl:template> 42 - 43 - <xsl:template match="f:month[.='10']"> 44 - <xsl:text>October</xsl:text> 45 - </xsl:template> 46 - 47 - <xsl:template match="f:month[.='11']"> 48 - <xsl:text>November</xsl:text> 49 - </xsl:template> 50 - 51 - <xsl:template match="f:month[.='12']"> 52 - <xsl:text>December</xsl:text> 53 - </xsl:template> 54 - 55 - <xsl:template match="f:year"> 56 - <xsl:apply-templates /> 57 - </xsl:template> 58 - 59 - <xsl:template match="f:day"> 60 - <xsl:apply-templates /> 61 - </xsl:template> 62 - 63 - <xsl:template match="f:date" mode="date-inner"> 64 - <xsl:apply-templates select="f:month" /> 65 - <xsl:if test="f:day"> 66 - <xsl:text>&#160;</xsl:text> 67 - <xsl:apply-templates select="f:day" /> 68 - </xsl:if> 69 - <xsl:if test="f:month"> 70 - <xsl:text>,&#160;</xsl:text> 71 - </xsl:if> 72 - <xsl:apply-templates select="f:year" /> 73 - </xsl:template> 74 - 75 - <xsl:template match="f:date[@href]"> 76 - <li class="meta-item"> 77 - <a class="link local" href="{@href}"> 78 - <xsl:apply-templates select="." mode="date-inner" /> 79 - </a> 80 - </li> 81 - </xsl:template> 82 - 83 - <xsl:template match="f:date[not(@href)]"> 84 - <li class="meta-item"> 85 - <xsl:apply-templates select="." mode="date-inner" /> 86 - </li> 87 - </xsl:template> 88 - 89 - <xsl:template match="f:authors"> 90 - <xsl:if test="f:author or f:contributor"> 91 - <li class="meta-item"> 92 - <address class="author"> 93 - <xsl:for-each select="f:author"> 94 - <xsl:apply-templates /> 95 - <xsl:if test="position()!=last()"> 96 - <xsl:text>, &#x20;</xsl:text> 97 - </xsl:if> 98 - </xsl:for-each> 99 - <xsl:if test="f:contributor"> 100 - <xsl:text>&#x20;with contributions from&#x20;</xsl:text> 101 - <xsl:for-each select="f:contributor"> 102 - <xsl:apply-templates /> 103 - <xsl:if test="position()!=last()"> 104 - <xsl:text>,&#x20;</xsl:text> 105 - </xsl:if> 106 - </xsl:for-each> 107 - </xsl:if> 108 - </address> 109 - </li> 110 - </xsl:if> 111 - </xsl:template> 112 - 113 - <xsl:template match="f:meta[@name='doi']"> 114 - <li class="meta-item"> 115 - <a class="doi link" href="{concat('https://www.doi.org/', .)}"> 116 - <xsl:value-of select="." /> 117 - </a> 118 - </li> 119 - </xsl:template> 120 - 121 - <xsl:template match="f:meta[@name='orcid']"> 122 - <li class="meta-item"> 123 - <a class="orcid" href="{concat('https://orcid.org/', .)}"> 124 - <xsl:value-of select="." /> 125 - </a> 126 - </li> 127 - </xsl:template> 128 - 129 - <xsl:template match="f:meta[@name='bibtex']"> 130 - <pre> 131 - <xsl:value-of select="." /> 132 - </pre> 133 - </xsl:template> 134 - 135 - <xsl:template match="f:meta[@name='venue']|f:meta[@name='position']|f:meta[@name='institution']|f:meta[@name='source']"> 136 - <li class="meta-item"> 137 - <xsl:apply-templates /> 138 - </li> 139 - </xsl:template> 140 - 141 - <xsl:template match="f:meta[@name='external']"> 142 - <li class="meta-item"> 143 - <a class="link external" href="{.}"> 144 - <xsl:value-of select="." /> 145 - </a> 146 - </li> 147 - </xsl:template> 148 - 149 - <xsl:template match="f:meta[@name='slides']"> 150 - <li class="meta-item"> 151 - <a class="link external" href="{.}"> 152 - <xsl:text>Slides</xsl:text> 153 - </a> 154 - </li> 155 - </xsl:template> 156 - 157 - <xsl:template match="f:meta[@name='video']"> 158 - <li class="meta-item"> 159 - <a class="link external" href="{.}"> 160 - <xsl:text>Video</xsl:text> 161 - </a> 162 - </li> 163 - </xsl:template> 164 - 165 - </xsl:stylesheet>
-514
bin/forester/theme/package-lock.json
··· 1 - { 2 - "name": "theme", 3 - "lockfileVersion": 3, 4 - "requires": true, 5 - "packages": { 6 - "": { 7 - "dependencies": { 8 - "esbuild": "^0.18.15", 9 - "katex": "^0.16.8", 10 - "ninja-keys": "^1.2.2" 11 - } 12 - }, 13 - "node_modules/@esbuild/android-arm": { 14 - "version": "0.18.20", 15 - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", 16 - "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", 17 - "cpu": [ 18 - "arm" 19 - ], 20 - "license": "MIT", 21 - "optional": true, 22 - "os": [ 23 - "android" 24 - ], 25 - "engines": { 26 - "node": ">=12" 27 - } 28 - }, 29 - "node_modules/@esbuild/android-arm64": { 30 - "version": "0.18.20", 31 - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", 32 - "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", 33 - "cpu": [ 34 - "arm64" 35 - ], 36 - "license": "MIT", 37 - "optional": true, 38 - "os": [ 39 - "android" 40 - ], 41 - "engines": { 42 - "node": ">=12" 43 - } 44 - }, 45 - "node_modules/@esbuild/android-x64": { 46 - "version": "0.18.20", 47 - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", 48 - "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", 49 - "cpu": [ 50 - "x64" 51 - ], 52 - "license": "MIT", 53 - "optional": true, 54 - "os": [ 55 - "android" 56 - ], 57 - "engines": { 58 - "node": ">=12" 59 - } 60 - }, 61 - "node_modules/@esbuild/darwin-arm64": { 62 - "version": "0.18.20", 63 - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", 64 - "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", 65 - "cpu": [ 66 - "arm64" 67 - ], 68 - "license": "MIT", 69 - "optional": true, 70 - "os": [ 71 - "darwin" 72 - ], 73 - "engines": { 74 - "node": ">=12" 75 - } 76 - }, 77 - "node_modules/@esbuild/darwin-x64": { 78 - "version": "0.18.20", 79 - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", 80 - "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", 81 - "cpu": [ 82 - "x64" 83 - ], 84 - "license": "MIT", 85 - "optional": true, 86 - "os": [ 87 - "darwin" 88 - ], 89 - "engines": { 90 - "node": ">=12" 91 - } 92 - }, 93 - "node_modules/@esbuild/freebsd-arm64": { 94 - "version": "0.18.20", 95 - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", 96 - "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", 97 - "cpu": [ 98 - "arm64" 99 - ], 100 - "license": "MIT", 101 - "optional": true, 102 - "os": [ 103 - "freebsd" 104 - ], 105 - "engines": { 106 - "node": ">=12" 107 - } 108 - }, 109 - "node_modules/@esbuild/freebsd-x64": { 110 - "version": "0.18.20", 111 - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", 112 - "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", 113 - "cpu": [ 114 - "x64" 115 - ], 116 - "license": "MIT", 117 - "optional": true, 118 - "os": [ 119 - "freebsd" 120 - ], 121 - "engines": { 122 - "node": ">=12" 123 - } 124 - }, 125 - "node_modules/@esbuild/linux-arm": { 126 - "version": "0.18.20", 127 - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", 128 - "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", 129 - "cpu": [ 130 - "arm" 131 - ], 132 - "license": "MIT", 133 - "optional": true, 134 - "os": [ 135 - "linux" 136 - ], 137 - "engines": { 138 - "node": ">=12" 139 - } 140 - }, 141 - "node_modules/@esbuild/linux-arm64": { 142 - "version": "0.18.20", 143 - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", 144 - "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", 145 - "cpu": [ 146 - "arm64" 147 - ], 148 - "license": "MIT", 149 - "optional": true, 150 - "os": [ 151 - "linux" 152 - ], 153 - "engines": { 154 - "node": ">=12" 155 - } 156 - }, 157 - "node_modules/@esbuild/linux-ia32": { 158 - "version": "0.18.20", 159 - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", 160 - "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", 161 - "cpu": [ 162 - "ia32" 163 - ], 164 - "license": "MIT", 165 - "optional": true, 166 - "os": [ 167 - "linux" 168 - ], 169 - "engines": { 170 - "node": ">=12" 171 - } 172 - }, 173 - "node_modules/@esbuild/linux-loong64": { 174 - "version": "0.18.20", 175 - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", 176 - "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", 177 - "cpu": [ 178 - "loong64" 179 - ], 180 - "license": "MIT", 181 - "optional": true, 182 - "os": [ 183 - "linux" 184 - ], 185 - "engines": { 186 - "node": ">=12" 187 - } 188 - }, 189 - "node_modules/@esbuild/linux-mips64el": { 190 - "version": "0.18.20", 191 - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", 192 - "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", 193 - "cpu": [ 194 - "mips64el" 195 - ], 196 - "license": "MIT", 197 - "optional": true, 198 - "os": [ 199 - "linux" 200 - ], 201 - "engines": { 202 - "node": ">=12" 203 - } 204 - }, 205 - "node_modules/@esbuild/linux-ppc64": { 206 - "version": "0.18.20", 207 - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", 208 - "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", 209 - "cpu": [ 210 - "ppc64" 211 - ], 212 - "license": "MIT", 213 - "optional": true, 214 - "os": [ 215 - "linux" 216 - ], 217 - "engines": { 218 - "node": ">=12" 219 - } 220 - }, 221 - "node_modules/@esbuild/linux-riscv64": { 222 - "version": "0.18.20", 223 - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", 224 - "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", 225 - "cpu": [ 226 - "riscv64" 227 - ], 228 - "license": "MIT", 229 - "optional": true, 230 - "os": [ 231 - "linux" 232 - ], 233 - "engines": { 234 - "node": ">=12" 235 - } 236 - }, 237 - "node_modules/@esbuild/linux-s390x": { 238 - "version": "0.18.20", 239 - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", 240 - "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", 241 - "cpu": [ 242 - "s390x" 243 - ], 244 - "license": "MIT", 245 - "optional": true, 246 - "os": [ 247 - "linux" 248 - ], 249 - "engines": { 250 - "node": ">=12" 251 - } 252 - }, 253 - "node_modules/@esbuild/linux-x64": { 254 - "version": "0.18.20", 255 - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", 256 - "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", 257 - "cpu": [ 258 - "x64" 259 - ], 260 - "license": "MIT", 261 - "optional": true, 262 - "os": [ 263 - "linux" 264 - ], 265 - "engines": { 266 - "node": ">=12" 267 - } 268 - }, 269 - "node_modules/@esbuild/netbsd-x64": { 270 - "version": "0.18.20", 271 - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", 272 - "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", 273 - "cpu": [ 274 - "x64" 275 - ], 276 - "license": "MIT", 277 - "optional": true, 278 - "os": [ 279 - "netbsd" 280 - ], 281 - "engines": { 282 - "node": ">=12" 283 - } 284 - }, 285 - "node_modules/@esbuild/openbsd-x64": { 286 - "version": "0.18.20", 287 - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", 288 - "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", 289 - "cpu": [ 290 - "x64" 291 - ], 292 - "license": "MIT", 293 - "optional": true, 294 - "os": [ 295 - "openbsd" 296 - ], 297 - "engines": { 298 - "node": ">=12" 299 - } 300 - }, 301 - "node_modules/@esbuild/sunos-x64": { 302 - "version": "0.18.20", 303 - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", 304 - "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", 305 - "cpu": [ 306 - "x64" 307 - ], 308 - "license": "MIT", 309 - "optional": true, 310 - "os": [ 311 - "sunos" 312 - ], 313 - "engines": { 314 - "node": ">=12" 315 - } 316 - }, 317 - "node_modules/@esbuild/win32-arm64": { 318 - "version": "0.18.20", 319 - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", 320 - "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", 321 - "cpu": [ 322 - "arm64" 323 - ], 324 - "license": "MIT", 325 - "optional": true, 326 - "os": [ 327 - "win32" 328 - ], 329 - "engines": { 330 - "node": ">=12" 331 - } 332 - }, 333 - "node_modules/@esbuild/win32-ia32": { 334 - "version": "0.18.20", 335 - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", 336 - "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", 337 - "cpu": [ 338 - "ia32" 339 - ], 340 - "license": "MIT", 341 - "optional": true, 342 - "os": [ 343 - "win32" 344 - ], 345 - "engines": { 346 - "node": ">=12" 347 - } 348 - }, 349 - "node_modules/@esbuild/win32-x64": { 350 - "version": "0.18.20", 351 - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", 352 - "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", 353 - "cpu": [ 354 - "x64" 355 - ], 356 - "license": "MIT", 357 - "optional": true, 358 - "os": [ 359 - "win32" 360 - ], 361 - "engines": { 362 - "node": ">=12" 363 - } 364 - }, 365 - "node_modules/@lit-labs/ssr-dom-shim": { 366 - "version": "1.2.0", 367 - "resolved": "https://registry.npmjs.org/@lit-labs/ssr-dom-shim/-/ssr-dom-shim-1.2.0.tgz", 368 - "integrity": "sha512-yWJKmpGE6lUURKAaIltoPIE/wrbY3TEkqQt+X0m+7fQNnAv0keydnYvbiJFP1PnMhizmIWRWOG5KLhYyc/xl+g==", 369 - "license": "BSD-3-Clause" 370 - }, 371 - "node_modules/@lit/reactive-element": { 372 - "version": "1.6.3", 373 - "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-1.6.3.tgz", 374 - "integrity": "sha512-QuTgnG52Poic7uM1AN5yJ09QMe0O28e10XzSvWDz02TJiiKee4stsiownEIadWm8nYzyDAyT+gKzUoZmiWQtsQ==", 375 - "license": "BSD-3-Clause", 376 - "dependencies": { 377 - "@lit-labs/ssr-dom-shim": "^1.0.0" 378 - } 379 - }, 380 - "node_modules/@material/mwc-icon": { 381 - "version": "0.25.3", 382 - "resolved": "https://registry.npmjs.org/@material/mwc-icon/-/mwc-icon-0.25.3.tgz", 383 - "integrity": "sha512-36076AWZIRSr8qYOLjuDDkxej/HA0XAosrj7TS1ZeLlUBnLUtbDtvc1S7KSa0hqez7ouzOqGaWK24yoNnTa2OA==", 384 - "deprecated": "MWC beta is longer supported. Please upgrade to @material/web", 385 - "license": "Apache-2.0", 386 - "dependencies": { 387 - "lit": "^2.0.0", 388 - "tslib": "^2.0.1" 389 - } 390 - }, 391 - "node_modules/@types/trusted-types": { 392 - "version": "2.0.7", 393 - "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", 394 - "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", 395 - "license": "MIT" 396 - }, 397 - "node_modules/commander": { 398 - "version": "8.3.0", 399 - "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", 400 - "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", 401 - "license": "MIT", 402 - "engines": { 403 - "node": ">= 12" 404 - } 405 - }, 406 - "node_modules/esbuild": { 407 - "version": "0.18.20", 408 - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", 409 - "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", 410 - "hasInstallScript": true, 411 - "license": "MIT", 412 - "bin": { 413 - "esbuild": "bin/esbuild" 414 - }, 415 - "engines": { 416 - "node": ">=12" 417 - }, 418 - "optionalDependencies": { 419 - "@esbuild/android-arm": "0.18.20", 420 - "@esbuild/android-arm64": "0.18.20", 421 - "@esbuild/android-x64": "0.18.20", 422 - "@esbuild/darwin-arm64": "0.18.20", 423 - "@esbuild/darwin-x64": "0.18.20", 424 - "@esbuild/freebsd-arm64": "0.18.20", 425 - "@esbuild/freebsd-x64": "0.18.20", 426 - "@esbuild/linux-arm": "0.18.20", 427 - "@esbuild/linux-arm64": "0.18.20", 428 - "@esbuild/linux-ia32": "0.18.20", 429 - "@esbuild/linux-loong64": "0.18.20", 430 - "@esbuild/linux-mips64el": "0.18.20", 431 - "@esbuild/linux-ppc64": "0.18.20", 432 - "@esbuild/linux-riscv64": "0.18.20", 433 - "@esbuild/linux-s390x": "0.18.20", 434 - "@esbuild/linux-x64": "0.18.20", 435 - "@esbuild/netbsd-x64": "0.18.20", 436 - "@esbuild/openbsd-x64": "0.18.20", 437 - "@esbuild/sunos-x64": "0.18.20", 438 - "@esbuild/win32-arm64": "0.18.20", 439 - "@esbuild/win32-ia32": "0.18.20", 440 - "@esbuild/win32-x64": "0.18.20" 441 - } 442 - }, 443 - "node_modules/hotkeys-js": { 444 - "version": "3.8.7", 445 - "resolved": "https://registry.npmjs.org/hotkeys-js/-/hotkeys-js-3.8.7.tgz", 446 - "integrity": "sha512-ckAx3EkUr5XjDwjEHDorHxRO2Kb7z6Z2Sxul4MbBkN8Nho7XDslQsgMJT+CiJ5Z4TgRxxvKHEpuLE3imzqy4Lg==", 447 - "license": "MIT" 448 - }, 449 - "node_modules/katex": { 450 - "version": "0.16.11", 451 - "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.11.tgz", 452 - "integrity": "sha512-RQrI8rlHY92OLf3rho/Ts8i/XvjgguEjOkO1BEXcU3N8BqPpSzBNwV/G0Ukr+P/l3ivvJUE/Fa/CwbS6HesGNQ==", 453 - "funding": [ 454 - "https://opencollective.com/katex", 455 - "https://github.com/sponsors/katex" 456 - ], 457 - "license": "MIT", 458 - "dependencies": { 459 - "commander": "^8.3.0" 460 - }, 461 - "bin": { 462 - "katex": "cli.js" 463 - } 464 - }, 465 - "node_modules/lit": { 466 - "version": "2.2.6", 467 - "resolved": "https://registry.npmjs.org/lit/-/lit-2.2.6.tgz", 468 - "integrity": "sha512-K2vkeGABfSJSfkhqHy86ujchJs3NR9nW1bEEiV+bXDkbiQ60Tv5GUausYN2mXigZn8lC1qXuc46ArQRKYmumZw==", 469 - "license": "BSD-3-Clause", 470 - "dependencies": { 471 - "@lit/reactive-element": "^1.3.0", 472 - "lit-element": "^3.2.0", 473 - "lit-html": "^2.2.0" 474 - } 475 - }, 476 - "node_modules/lit-element": { 477 - "version": "3.3.3", 478 - "resolved": "https://registry.npmjs.org/lit-element/-/lit-element-3.3.3.tgz", 479 - "integrity": "sha512-XbeRxmTHubXENkV4h8RIPyr8lXc+Ff28rkcQzw3G6up2xg5E8Zu1IgOWIwBLEQsu3cOVFqdYwiVi0hv0SlpqUA==", 480 - "license": "BSD-3-Clause", 481 - "dependencies": { 482 - "@lit-labs/ssr-dom-shim": "^1.1.0", 483 - "@lit/reactive-element": "^1.3.0", 484 - "lit-html": "^2.8.0" 485 - } 486 - }, 487 - "node_modules/lit-html": { 488 - "version": "2.8.0", 489 - "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-2.8.0.tgz", 490 - "integrity": "sha512-o9t+MQM3P4y7M7yNzqAyjp7z+mQGa4NS4CxiyLqFPyFWyc4O+nodLrkrxSaCTrla6M5YOLaT3RpbbqjszB5g3Q==", 491 - "license": "BSD-3-Clause", 492 - "dependencies": { 493 - "@types/trusted-types": "^2.0.2" 494 - } 495 - }, 496 - "node_modules/ninja-keys": { 497 - "version": "1.2.2", 498 - "resolved": "https://registry.npmjs.org/ninja-keys/-/ninja-keys-1.2.2.tgz", 499 - "integrity": "sha512-ylo8jzKowi3XBHkgHRjBJaKQkl32WRLr7kRiA0ajiku11vHRDJ2xANtTScR5C7XlDwKEOYvUPesCKacUeeLAYw==", 500 - "license": "MIT", 501 - "dependencies": { 502 - "@material/mwc-icon": "0.25.3", 503 - "hotkeys-js": "3.8.7", 504 - "lit": "2.2.6" 505 - } 506 - }, 507 - "node_modules/tslib": { 508 - "version": "2.6.3", 509 - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", 510 - "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", 511 - "license": "0BSD" 512 - } 513 - } 514 - }
-7
bin/forester/theme/package.json
··· 1 - { 2 - "dependencies": { 3 - "esbuild": "^0.18.15", 4 - "katex": "^0.16.8", 5 - "ninja-keys": "^1.2.2" 6 - } 7 - }
-686
bin/forester/theme/style.css
··· 1 - /* SPDX-License-Identifier: CC0-1.0 */ 2 - 3 - .search-result-item { 4 - padding: 0.75em 1em; 5 - display: flex; 6 - border-left: 2px solid transparent; 7 - align-items: center; 8 - justify-content: start; 9 - outline: none; 10 - transition: color; 11 - width: 100%; 12 - } 13 - 14 - #search-results { 15 - list-style: none; 16 - } 17 - 18 - #search-results:empty { 19 - display: none; 20 - } 21 - 22 - #search-modal-trigger { 23 - display: none; 24 - } 25 - 26 - .search-form { 27 - display: grid; 28 - } 29 - 30 - .search { 31 - padding: 1.25em; 32 - font-size: 1.25em; 33 - flex-grow: 1; 34 - } 35 - 36 - .modal-content { 37 - position: fixed; 38 - top: 50%; 39 - left: 50%; 40 - transform: translate(-50%, -50%); 41 - width: 600px; 42 - max-width: 100%; 43 - height: 400px; 44 - max-height: 100%; 45 - border-radius: 0.5em; 46 - box-shadow: rgb(0 0 0 / 50%) 0px 16px 70px; 47 - } 48 - 49 - .modal-overlay { 50 - z-index: 100; 51 - position: fixed; 52 - top: 0; 53 - left: 0; 54 - width: 100%; 55 - height: 100%; 56 - backdrop-filter: blur(10px); 57 - } 58 - 59 - .katex { 60 - font-size: 1.15em !important; 61 - } 62 - 63 - /* inria-sans-300 - latin_latin-ext */ 64 - @font-face { 65 - font-display: swap; 66 - /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */ 67 - font-family: "Inria Sans"; 68 - font-style: normal; 69 - font-weight: 300; 70 - src: url("fonts/inria-sans-v14-latin_latin-ext-300.woff2") format("woff2"); 71 - /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ 72 - } 73 - 74 - /* inria-sans-300italic - latin_latin-ext */ 75 - @font-face { 76 - font-display: swap; 77 - /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */ 78 - font-family: "Inria Sans"; 79 - font-style: italic; 80 - font-weight: 300; 81 - src: url("fonts/inria-sans-v14-latin_latin-ext-300italic.woff2") 82 - format("woff2"); 83 - /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ 84 - } 85 - 86 - /* inria-sans-regular - latin_latin-ext */ 87 - @font-face { 88 - font-display: swap; 89 - /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */ 90 - font-family: "Inria Sans"; 91 - font-style: normal; 92 - font-weight: 400; 93 - src: url("fonts/inria-sans-v14-latin_latin-ext-regular.woff2") format("woff2"); 94 - /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ 95 - } 96 - 97 - /* inria-sans-italic - latin_latin-ext */ 98 - @font-face { 99 - font-display: swap; 100 - /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */ 101 - font-family: "Inria Sans"; 102 - font-style: italic; 103 - font-weight: 400; 104 - src: url("fonts/inria-sans-v14-latin_latin-ext-italic.woff2") format("woff2"); 105 - /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ 106 - } 107 - 108 - /* inria-sans-700 - latin_latin-ext */ 109 - @font-face { 110 - font-display: swap; 111 - /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */ 112 - font-family: "Inria Sans"; 113 - font-style: normal; 114 - font-weight: 700; 115 - src: url("fonts/inria-sans-v14-latin_latin-ext-700.woff2") format("woff2"); 116 - /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ 117 - } 118 - 119 - /* inria-sans-700italic - latin_latin-ext */ 120 - @font-face { 121 - font-display: swap; 122 - /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */ 123 - font-family: "Inria Sans"; 124 - font-style: italic; 125 - font-weight: 700; 126 - src: url("fonts/inria-sans-v14-latin_latin-ext-700italic.woff2") 127 - format("woff2"); 128 - /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */ 129 - } 130 - 131 - :root { 132 - --content-gap: 15px; 133 - --radius: 5px; 134 - } 135 - 136 - h1, 137 - h2, 138 - h3, 139 - h4, 140 - h5, 141 - h6 { 142 - line-height: 1.2; 143 - margin-bottom: 0; 144 - } 145 - 146 - h5, 147 - h6, 148 - p { 149 - margin-top: 0; 150 - } 151 - 152 - h1, 153 - h2, 154 - h3, 155 - h4 { 156 - margin-top: 0.5em; 157 - } 158 - 159 - pre, 160 - img, 161 - .katex-display, 162 - section, 163 - center { 164 - overflow-y: hidden; 165 - } 166 - 167 - pre { 168 - border-radius: var(--radius); 169 - background-color: rgba(0, 100, 100, 0.04); 170 - padding: 0.5em; 171 - font-size: 11pt; 172 - margin-top: 0em; 173 - overflow-x: auto; 174 - white-space: pre-wrap; 175 - white-space: -moz-pre-wrap; 176 - white-space: -pre-wrap; 177 - white-space: -o-pre-wrap; 178 - word-wrap: break-word; 179 - } 180 - 181 - code { 182 - border-radius: var(--radius); 183 - background-color: rgba(0, 100, 100, 0.04); 184 - padding: 0.2em; 185 - font-size: 0.9em; 186 - } 187 - 188 - body { 189 - font-family: "Inria Sans"; 190 - font-size: 12pt; 191 - line-height: 1.55; 192 - } 193 - 194 - math { 195 - font-size: 1.12em; 196 - } 197 - 198 - mrow:hover { 199 - background-color: rgba(0, 100, 255, 0.04); 200 - } 201 - 202 - .logo { 203 - font-weight: 1000; 204 - font-size: 24px; 205 - } 206 - 207 - .logo a { 208 - color: #666; 209 - text-decoration: none; 210 - } 211 - 212 - .logo a:hover { 213 - color: #aaa; 214 - } 215 - 216 - .block.hide-metadata > details > summary > header > .metadata { 217 - display: none; 218 - } 219 - 220 - article > section > details > summary > header > h1 > .taxon { 221 - display: block; 222 - font-size: 0.9em; 223 - color: #888; 224 - padding-bottom: 5pt; 225 - } 226 - 227 - section 228 - section[data-taxon="Reference"] 229 - > details 230 - > summary 231 - > header 232 - > h1 233 - > .taxon, 234 - section 235 - section[data-taxon="Person"] 236 - > details 237 - > summary 238 - > header 239 - > h1 240 - > .taxon { 241 - display: none; 242 - } 243 - 244 - footer > section { 245 - margin-bottom: 1em; 246 - } 247 - 248 - footer h2 { 249 - font-size: 14pt; 250 - } 251 - 252 - .metadata > address { 253 - display: inline; 254 - } 255 - 256 - @media only screen and (max-width: 1000px) { 257 - body { 258 - margin-top: 1em; 259 - margin-left: 0.5em; 260 - margin-right: 0.5em; 261 - transition: ease all 0.2s; 262 - } 263 - 264 - #grid-wrapper > nav { 265 - display: none; 266 - transition: ease all 0.2s; 267 - } 268 - } 269 - 270 - @media only screen and (min-width: 1000px) { 271 - body { 272 - margin-top: 2em; 273 - margin-left: 2em; 274 - transition: ease all 0.2s; 275 - } 276 - 277 - #grid-wrapper { 278 - display: grid; 279 - grid-template-columns: 90ex; 280 - } 281 - } 282 - 283 - body > header { 284 - margin-bottom: 0.5em; 285 - } 286 - 287 - #grid-wrapper > article { 288 - max-width: 90ex; 289 - margin-right: auto; 290 - grid-column: 1; 291 - } 292 - 293 - #grid-wrapper > nav { 294 - grid-column: 2; 295 - } 296 - 297 - details > summary > header { 298 - display: inline; 299 - } 300 - 301 - a.heading-link { 302 - box-shadow: none; 303 - } 304 - 305 - details h1 { 306 - font-size: 13pt; 307 - display: inline; 308 - } 309 - 310 - section .block[data-taxon] details > summary > header > h1 { 311 - font-size: 12pt; 312 - } 313 - 314 - span.taxon { 315 - color: #444; 316 - font-weight: bolder; 317 - } 318 - 319 - .link-list > section > details > summary > header h1 { 320 - font-size: 12pt; 321 - } 322 - 323 - article > section > details > summary > header > h1 { 324 - font-size: 1.5em; 325 - } 326 - 327 - details > summary { 328 - list-style-type: none; 329 - } 330 - 331 - details > summary::marker, 332 - details > summary::-webkit-details-marker { 333 - display: none; 334 - } 335 - 336 - article > section > details > summary > header { 337 - display: block; 338 - margin-bottom: 0.5em; 339 - } 340 - 341 - section.block > details { 342 - margin-bottom: 0.4em; 343 - } 344 - 345 - section.block > details[open] { 346 - margin-bottom: 1em; 347 - } 348 - 349 - .link-list > section.block > details { 350 - margin-bottom: 0.25em; 351 - } 352 - 353 - nav#toc { 354 - margin-left: 1em; 355 - } 356 - 357 - nav#toc h1 { 358 - margin-top: 0; 359 - font-size: 16pt; 360 - } 361 - 362 - nav#toc, 363 - nav#toc a { 364 - color: #555; 365 - } 366 - 367 - nav#toc .link { 368 - box-shadow: none; 369 - text-decoration: none; 370 - } 371 - 372 - nav#toc a.bullet { 373 - opacity: 0.7; 374 - margin-left: 0.4em; 375 - margin-right: 0.3em; 376 - padding-left: 0.2em; 377 - padding-right: 0.2em; 378 - text-decoration: none; 379 - } 380 - 381 - nav#toc h2 { 382 - font-size: 1.1em; 383 - } 384 - 385 - nav#toc ul { 386 - list-style-type: none; 387 - } 388 - 389 - nav#toc li > ul { 390 - padding-left: 1em; 391 - } 392 - 393 - nav#toc li { 394 - list-style-position: inside; 395 - } 396 - 397 - .block { 398 - border-radius: var(--radius); 399 - } 400 - 401 - .block:hover { 402 - background-color: rgba(0, 100, 255, 0.04); 403 - } 404 - 405 - .block.highlighted { 406 - border-style: solid; 407 - border-width: 1pt; 408 - } 409 - 410 - .highlighted { 411 - background-color: rgba(255, 255, 140, 0.3); 412 - border-color: #ccc; 413 - } 414 - 415 - .highlighted:hover { 416 - background-color: rgba(255, 255, 140, 0.6); 417 - border-color: #aaa; 418 - } 419 - 420 - .slug, 421 - .doi, 422 - .orcid { 423 - color: gray; 424 - font-weight: 200; 425 - } 426 - 427 - .edit-button { 428 - color: rgb(180, 180, 180); 429 - font-weight: 200; 430 - } 431 - 432 - .block { 433 - padding-left: 5px; 434 - padding-right: 10px; 435 - padding-bottom: 2px; 436 - border-radius: 5px; 437 - } 438 - 439 - .link.external { 440 - text-decoration: underline; 441 - } 442 - 443 - a.link.local, 444 - .link.local a, 445 - a.slug { 446 - box-shadow: none; 447 - text-decoration-line: underline; 448 - text-decoration-style: dotted; 449 - } 450 - 451 - ninja-keys::part(ninja-action) { 452 - white-space: nowrap; 453 - } 454 - 455 - body { 456 - hyphens: auto; 457 - } 458 - 459 - table { 460 - margin-bottom: 1em; 461 - } 462 - 463 - table.macros { 464 - overflow-x: visible; 465 - overflow-y: visible; 466 - font-size: 0.9em; 467 - } 468 - 469 - table.macros td { 470 - padding-left: 5pt; 471 - padding-right: 15pt; 472 - vertical-align: baseline; 473 - } 474 - 475 - th { 476 - text-align: left; 477 - } 478 - 479 - th, 480 - td { 481 - padding: 0 15px; 482 - vertical-align: top; 483 - } 484 - 485 - td.macro-name, 486 - td.macro-body { 487 - white-space: nowrap; 488 - } 489 - 490 - td.macro-doc { 491 - font-size: 0.9em; 492 - } 493 - 494 - .enclosing.macro-scope > .enclosing { 495 - border-radius: 2px; 496 - } 497 - 498 - .enclosing.macro-scope > .enclosing:hover { 499 - background-color: rgba(0, 100, 255, 0.1); 500 - } 501 - 502 - [aria-label][role~="tooltip"]::after { 503 - font-family: "Inria Sans"; 504 - } 505 - 506 - .tooltip { 507 - position: relative; 508 - } 509 - 510 - .inline.tooltip { 511 - display: inline-block; 512 - } 513 - 514 - .display.tooltip { 515 - display: block; 516 - } 517 - 518 - /* The tooltip class is applied to the span element that is the tooltip */ 519 - 520 - .tooltip .tooltiptext { 521 - visibility: hidden; 522 - white-space: nowrap; 523 - min-width: fit-content; 524 - background-color: black; 525 - color: #fff; 526 - padding-left: 5px; 527 - padding-top: 5px; 528 - padding-right: 10px; 529 - border-radius: 6px; 530 - position: absolute; 531 - z-index: 1; 532 - top: 100%; 533 - left: 50%; 534 - margin-left: -60px; 535 - opacity: 0; 536 - transition: opacity 0.3s; 537 - } 538 - 539 - .tooltip .tooltiptext::after { 540 - content: ""; 541 - position: absolute; 542 - top: 100%; 543 - left: 50%; 544 - margin-left: -5px; 545 - border-width: 5px; 546 - } 547 - 548 - /* Show the tooltip */ 549 - 550 - .tooltip:hover .tooltiptext { 551 - visibility: visible; 552 - opacity: 1; 553 - } 554 - 555 - .tooltiptext a { 556 - color: white; 557 - } 558 - 559 - .macro-doc { 560 - font-style: italic; 561 - } 562 - 563 - .macro-name { 564 - white-space: nowrap; 565 - } 566 - 567 - .macro-is-private { 568 - color: var(--secondary); 569 - } 570 - 571 - blockquote { 572 - border-inline-start: 1px solid var(--secondary); 573 - } 574 - 575 - a.slug:hover, 576 - a.bullet:hover, 577 - .edit-button:hover, 578 - .link:hover { 579 - background-color: rgba(0, 100, 255, 0.1); 580 - } 581 - 582 - .link { 583 - cursor: pointer; 584 - } 585 - 586 - a { 587 - color: black; 588 - text-decoration: inherit; 589 - } 590 - 591 - .nowrap { 592 - white-space: nowrap; 593 - } 594 - 595 - .nocite { 596 - display: none; 597 - } 598 - 599 - blockquote { 600 - font-style: italic; 601 - } 602 - 603 - address { 604 - display: inline; 605 - } 606 - 607 - .metadata ul { 608 - padding-left: 0; 609 - display: inline; 610 - } 611 - 612 - .metadata li::after { 613 - content: " \00B7 "; 614 - } 615 - 616 - .metadata li:last-child::after { 617 - content: ""; 618 - } 619 - 620 - .metadata ul li { 621 - display: inline; 622 - } 623 - 624 - img { 625 - object-fit: cover; 626 - max-width: 100%; 627 - } 628 - 629 - figure { 630 - text-align: center; 631 - } 632 - 633 - figcaption { 634 - font-style: italic; 635 - padding: 3px; 636 - } 637 - 638 - mark { 639 - background-color: rgb(255, 255, 151); 640 - } 641 - 642 - hr { 643 - margin-top: 10px; 644 - margin-bottom: 20px; 645 - background-color: gainsboro; 646 - border: 0 none; 647 - width: 100%; 648 - height: 2px; 649 - } 650 - 651 - ul, 652 - ol { 653 - padding-bottom: 0.5em; 654 - } 655 - 656 - ol { 657 - list-style-type: decimal; 658 - } 659 - 660 - ol li ol { 661 - list-style-type: lower-alpha; 662 - } 663 - 664 - ol li ol li ol { 665 - list-style-type: lower-roman; 666 - } 667 - 668 - .error, 669 - .info { 670 - border-radius: 4pt; 671 - padding-left: 3pt; 672 - padding-right: 3pt; 673 - padding-top: 1pt; 674 - padding-bottom: 2pt; 675 - font-weight: bold; 676 - } 677 - 678 - .error { 679 - background-color: red; 680 - color: white; 681 - } 682 - 683 - .info { 684 - background-color: #bbb; 685 - color: white; 686 - }
-395
bin/forester/theme/tree.xsl
··· 1 - <?xml version="1.0"?> 2 - <!-- SPDX-License-Identifier: CC0-1.0 --> 3 - <xsl:stylesheet version="1.0" 4 - xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 5 - xmlns:f="http://www.jonmsterling.com/jms-005P.xml"> 6 - 7 - <xsl:key name="tree-with-addr" match="/f:tree/f:mainmatter//f:tree" use="f:frontmatter/f:addr/text()" /> 8 - 9 - <xsl:template match="/"> 10 - <html> 11 - <head> 12 - <meta name="viewport" content="width=device-width" /> 13 - <link rel="stylesheet" href="style.css" /> 14 - <link rel="stylesheet" href="katex.min.css" /> 15 - <script type="text/javascript"> 16 - <xsl:if test="/f:tree/f:frontmatter/f:source-path"> 17 - <xsl:text>window.sourcePath = '</xsl:text> 18 - <xsl:value-of select="/f:tree/f:frontmatter/f:source-path" /> 19 - <xsl:text>'</xsl:text> 20 - </xsl:if> 21 - </script> 22 - <script type="module" src="forester.js"></script> 23 - <title> 24 - <xsl:value-of select="/f:tree/f:frontmatter/f:title[@text]" /> 25 - </title> 26 - </head> 27 - <body> 28 - <ninja-keys placeholder="Start typing a note title or ID"></ninja-keys> 29 - <xsl:if test="not(/f:tree[@root = 'true'])"> 30 - <header class="header"> 31 - <nav class="nav"> 32 - <div class="logo"> 33 - <a href="index.xml" title="Home"> 34 - <xsl:text>« Home</xsl:text> 35 - </a> 36 - </div> 37 - </nav> 38 - </header> 39 - </xsl:if> 40 - <div id="grid-wrapper"> 41 - <article> 42 - <xsl:apply-templates select="f:tree" /> 43 - </article> 44 - <xsl:if test="f:tree/f:mainmatter/f:tree[not(@toc='false')] and not(/f:tree/f:frontmatter/f:meta[@name = 'toc']/.='false')"> 45 - <nav id="toc"> 46 - <div class="block"> 47 - <h1>Table of Contents</h1> 48 - <xsl:apply-templates select="f:tree/f:mainmatter" mode="toc" /> 49 - </div> 50 - </nav> 51 - </xsl:if> 52 - </div> 53 - </body> 54 - </html> 55 - </xsl:template> 56 - 57 - <xsl:template match="f:tree" mode="tree-taxon-with-number"> 58 - <xsl:param name="suffix" select="''" /> 59 - <xsl:param name="taxon" select="f:frontmatter/f:taxon" /> 60 - <xsl:param name="number" select="f:frontmatter/f:number" /> 61 - <xsl:param name="fallback-number" /> 62 - <xsl:param name="in-backmatter" select="ancestor::f:backmatter" /> 63 - 64 - <xsl:variable name="tree-is-root" select="not(parent::*)" /> 65 - 66 - <xsl:variable name="explicitly-unnumbered" select="boolean(ancestor-or-self::f:tree[@numbered='false' or @toc='false'])" /> 67 - <xsl:variable name="implicitly-unnumbered" select="count(../f:tree) = 1 and not(count(f:mainmatter/f:tree) > 1)" /> 68 - 69 - <xsl:variable name="should-number" select="$number != '' or (not($in-backmatter) and not($tree-is-root) and not($explicitly-unnumbered)) and not($implicitly-unnumbered)" /> 70 - 71 - <xsl:if test="$taxon != ''"> 72 - <xsl:value-of select="$taxon" /> 73 - <xsl:if test="$should-number or $fallback-number != ''"> 74 - <xsl:text>&#160;</xsl:text> 75 - </xsl:if> 76 - </xsl:if> 77 - 78 - <xsl:choose> 79 - <xsl:when test="$should-number"> 80 - <xsl:choose> 81 - <xsl:when test="$number != ''"> 82 - <xsl:value-of select="$number" /> 83 - </xsl:when> 84 - <xsl:otherwise> 85 - <xsl:number format="1.1" count="f:tree[ancestor::f:tree and (not(@toc='false' or @numbered='false'))]" level="multiple" /> 86 - </xsl:otherwise> 87 - </xsl:choose> 88 - </xsl:when> 89 - <xsl:when test="$fallback-number != ''"> 90 - <xsl:value-of select="$fallback-number" /> 91 - </xsl:when> 92 - </xsl:choose> 93 - 94 - <xsl:if test="$taxon != '' or $fallback-number != '' or $should-number"> 95 - <xsl:value-of select="$suffix" /> 96 - </xsl:if> 97 - </xsl:template> 98 - 99 - <xsl:template match="f:tree" mode="contextual-number"> 100 - <xsl:param name="suffix" select="''" /> 101 - <xsl:param name="number" select="f:frontmatter/f:number" /> 102 - <xsl:param name="fallback-number" /> 103 - <xsl:param name="in-backmatter" select="ancestor::f:backmatter" /> 104 - 105 - <xsl:variable name="tree-is-root" select="not(parent::*)" /> 106 - 107 - <xsl:variable name="explicitly-unnumbered" select="boolean(ancestor-or-self::f:tree[@numbered='false' or @toc='false'])" /> 108 - <xsl:variable name="implicitly-unnumbered" select="count(../f:tree) = 1 and not(count(f:mainmatter/f:tree) > 1)" /> 109 - 110 - <xsl:variable name="should-number" select="$number != '' or (not($in-backmatter) and not($tree-is-root) and not($explicitly-unnumbered)) and not($implicitly-unnumbered)" /> 111 - 112 - <xsl:choose> 113 - <xsl:when test="$should-number"> 114 - <xsl:choose> 115 - <xsl:when test="$number != ''"> 116 - <xsl:value-of select="$number" /> 117 - </xsl:when> 118 - <xsl:otherwise> 119 - <xsl:number format="1.1" count="f:tree[ancestor::f:tree and (not(@toc='false' or @numbered='false'))]" level="multiple" /> 120 - </xsl:otherwise> 121 - </xsl:choose> 122 - </xsl:when> 123 - <xsl:when test="$fallback-number != ''"> 124 - <xsl:value-of select="$fallback-number" /> 125 - </xsl:when> 126 - </xsl:choose> 127 - 128 - <xsl:if test="$fallback-number != '' or $should-number"> 129 - <xsl:value-of select="$suffix" /> 130 - </xsl:if> 131 - </xsl:template> 132 - 133 - <xsl:template match="f:tree" mode="toc"> 134 - <li> 135 - <xsl:for-each select="f:frontmatter"> 136 - <a class="bullet"> 137 - <xsl:choose> 138 - <xsl:when test="f:addr and f:route"> 139 - <xsl:attribute name="href"> 140 - <xsl:value-of select="f:route" /> 141 - </xsl:attribute> 142 - <xsl:attribute name="title"> 143 - <xsl:value-of select="f:title[@text]" /> 144 - <xsl:text>&#160;[</xsl:text> 145 - <xsl:value-of select="f:addr" /> 146 - <xsl:text>]</xsl:text> 147 - </xsl:attribute> 148 - </xsl:when> 149 - <xsl:otherwise> 150 - <xsl:attribute name="href"> 151 - <xsl:text>#</xsl:text> 152 - <xsl:value-of select="generate-id(..)" /> 153 - </xsl:attribute> 154 - <xsl:attribute name="title"> 155 - <xsl:value-of select="f:title" /> 156 - </xsl:attribute> 157 - </xsl:otherwise> 158 - </xsl:choose> 159 - <xsl:text>■</xsl:text> 160 - </a> 161 - <span class="link local" data-target="#{generate-id(..)}"> 162 - <span class="taxon"> 163 - <xsl:apply-templates select=".." mode="tree-taxon-with-number"> 164 - <xsl:with-param name="suffix">.&#160;</xsl:with-param> 165 - </xsl:apply-templates> 166 - </span> 167 - 168 - <xsl:apply-templates select="f:title" /> 169 - </span> 170 - </xsl:for-each> 171 - <xsl:apply-templates select="f:mainmatter" mode="toc" /> 172 - </li> 173 - </xsl:template> 174 - 175 - <xsl:template match="f:mainmatter" mode="toc"> 176 - <ul class="block"> 177 - <xsl:apply-templates select="f:tree[not(@toc='false')]" mode="toc" /> 178 - </ul> 179 - </xsl:template> 180 - 181 - <xsl:template match="f:frontmatter/f:title"> 182 - <xsl:apply-templates /> 183 - </xsl:template> 184 - 185 - <xsl:template match="f:mainmatter"> 186 - <div class="tree-content"> 187 - <xsl:apply-templates /> 188 - </div> 189 - </xsl:template> 190 - 191 - <xsl:template match="f:addr[../f:route]"> 192 - <a class="slug" href="{../f:route}"> 193 - <xsl:text>[</xsl:text> 194 - <xsl:value-of select="." /> 195 - <xsl:text>]</xsl:text> 196 - </a> 197 - </xsl:template> 198 - 199 - <xsl:template match="f:addr[not(../f:route)]"> 200 - </xsl:template> 201 - 202 - <xsl:template match="f:resource"> 203 - <xsl:apply-templates select="f:resource-content" /> 204 - </xsl:template> 205 - 206 - <xsl:template match="f:resource-content"> 207 - <xsl:apply-templates /> 208 - </xsl:template> 209 - 210 - <xsl:template match="f:source-path"> 211 - <a class="edit-button" href="{concat('vscode://file', .)}"> 212 - <xsl:text>[edit]</xsl:text> 213 - </a> 214 - </xsl:template> 215 - 216 - <xsl:template match="f:taxon"> 217 - <xsl:value-of select="." /> 218 - </xsl:template> 219 - 220 - <xsl:template match="f:frontmatter"> 221 - <header> 222 - <h1> 223 - <span class="taxon"> 224 - <xsl:apply-templates select=".." mode="tree-taxon-with-number"> 225 - <xsl:with-param name="suffix">.&#160;</xsl:with-param> 226 - </xsl:apply-templates> 227 - </span> 228 - 229 - <xsl:apply-templates select="f:title" /> 230 - <xsl:text>&#032;</xsl:text> 231 - <xsl:apply-templates select="f:addr" /> 232 - <xsl:text>&#032;</xsl:text> 233 - <xsl:apply-templates select="f:source-path" /> 234 - </h1> 235 - <div class="metadata"> 236 - <ul> 237 - <xsl:apply-templates select="f:date" /> 238 - <xsl:if test="not(f:meta[@name = 'author']/.='false')"> 239 - <xsl:apply-templates select="f:authors" /> 240 - </xsl:if> 241 - <xsl:apply-templates select="f:meta[@name='position']" /> 242 - <xsl:apply-templates select="f:meta[@name='institution']" /> 243 - <xsl:apply-templates select="f:meta[@name='venue']" /> 244 - <xsl:apply-templates select="f:meta[@name='source']" /> 245 - <xsl:apply-templates select="f:meta[@name='doi']" /> 246 - <xsl:apply-templates select="f:meta[@name='orcid']" /> 247 - <xsl:apply-templates select="f:meta[@name='external']" /> 248 - <xsl:apply-templates select="f:meta[@name='slides']" /> 249 - <xsl:apply-templates select="f:meta[@name='video']" /> 250 - </ul> 251 - </div> 252 - </header> 253 - </xsl:template> 254 - 255 - <xsl:template match="f:ref"> 256 - <xsl:variable name="fallback-number"> 257 - <xsl:text>[</xsl:text> 258 - <xsl:value-of select="@addr" /> 259 - <xsl:text>]</xsl:text> 260 - </xsl:variable> 261 - 262 - <xsl:variable name="taxon"> 263 - <xsl:choose> 264 - <xsl:when test="@taxon"> 265 - <xsl:value-of select="@taxon" /> 266 - </xsl:when> 267 - <xsl:otherwise> 268 - <xsl:text>§</xsl:text> 269 - </xsl:otherwise> 270 - </xsl:choose> 271 - </xsl:variable> 272 - 273 - <a class="link local"> 274 - <xsl:attribute name="href"> 275 - <xsl:choose> 276 - <xsl:when test="key('tree-with-addr',current()/@addr)"> 277 - <xsl:text>#</xsl:text> 278 - <xsl:value-of select="generate-id(key('tree-with-addr',current()/@addr))" /> 279 - </xsl:when> 280 - <xsl:otherwise> 281 - <xsl:value-of select="@href" /> 282 - </xsl:otherwise> 283 - </xsl:choose> 284 - </xsl:attribute> 285 - 286 - <xsl:choose> 287 - <xsl:when test="key('tree-with-addr', current()/@addr)"> 288 - <xsl:apply-templates select="key('tree-with-addr', current()/@addr)" mode="tree-taxon-with-number"> 289 - <xsl:with-param name="in-backmatter" select="boolean(ancestor::f:backmatter)" /> 290 - <xsl:with-param name="number" select="@number" /> 291 - <xsl:with-param name="fallback-number" select="$fallback-number" /> 292 - <xsl:with-param name="taxon" select="$taxon" /> 293 - </xsl:apply-templates> 294 - </xsl:when> 295 - <xsl:otherwise> 296 - <xsl:value-of select="$taxon" /> 297 - <xsl:text>&#160;</xsl:text> 298 - <xsl:choose> 299 - <xsl:when test="@number"> 300 - <xsl:value-of select="@number" /> 301 - </xsl:when> 302 - <xsl:otherwise> 303 - <xsl:value-of select="$fallback-number" /> 304 - </xsl:otherwise> 305 - </xsl:choose> 306 - </xsl:otherwise> 307 - </xsl:choose> 308 - </a> 309 - </xsl:template> 310 - 311 - <xsl:template match="f:contextual-number[@addr]"> 312 - <xsl:variable name="fallback-number"> 313 - <xsl:text>[</xsl:text> 314 - <xsl:value-of select="@addr" /> 315 - <xsl:text>]</xsl:text> 316 - </xsl:variable> 317 - 318 - <xsl:choose> 319 - <xsl:when test="key('tree-with-addr', current()/@addr)"> 320 - <xsl:apply-templates select="key('tree-with-addr', current()/@addr)" mode="contextual-number"> 321 - <xsl:with-param name="in-backmatter" select="boolean(ancestor::f:backmatter)" /> 322 - <xsl:with-param name="fallback-number" select="$fallback-number" /> 323 - </xsl:apply-templates> 324 - </xsl:when> 325 - <xsl:otherwise> 326 - <xsl:value-of select="$fallback-number" /> 327 - </xsl:otherwise> 328 - </xsl:choose> 329 - </xsl:template> 330 - 331 - <xsl:template match="/f:tree[@root='true']/f:backmatter"> 332 - </xsl:template> 333 - 334 - <xsl:template match="/f:tree[not(@root='true')]/f:backmatter"> 335 - <footer> 336 - <xsl:apply-templates /> 337 - </footer> 338 - </xsl:template> 339 - 340 - <xsl:template match="f:mainmatter//f:backmatter"> 341 - </xsl:template> 342 - 343 - <xsl:template match="f:backmatter//f:backmatter"> 344 - </xsl:template> 345 - 346 - <xsl:template match="f:tree[f:mainmatter[*] or not(@hidden-when-empty = 'true')]"> 347 - <section> 348 - <xsl:attribute name="lang"> 349 - <xsl:choose> 350 - <xsl:when test="f:frontmatter/f:meta[@name='lang']"> 351 - <xsl:value-of select="f:frontmatter/f:meta[@name='lang']" /> 352 - </xsl:when> 353 - <xsl:otherwise>en</xsl:otherwise> 354 - </xsl:choose> 355 - </xsl:attribute> 356 - 357 - <xsl:choose> 358 - <xsl:when test="@show-metadata = 'false'"> 359 - <xsl:attribute name="class">block hide-metadata</xsl:attribute> 360 - </xsl:when> 361 - <xsl:otherwise> 362 - <xsl:attribute name="class">block</xsl:attribute> 363 - </xsl:otherwise> 364 - </xsl:choose> 365 - <xsl:if test="f:frontmatter/f:taxon"> 366 - <xsl:attribute name="data-taxon"> 367 - <xsl:value-of select="f:frontmatter/f:taxon" /> 368 - </xsl:attribute> 369 - </xsl:if> 370 - 371 - <xsl:choose> 372 - <xsl:when test="not(@show-heading='false')"> 373 - <details id="{generate-id(.)}"> 374 - <xsl:if test="not(@expanded = 'false')"> 375 - <xsl:attribute name="open">open</xsl:attribute> 376 - </xsl:if> 377 - <summary> 378 - <xsl:apply-templates select="f:frontmatter" /> 379 - </summary> 380 - <xsl:apply-templates select="f:mainmatter" /> 381 - <xsl:apply-templates select="f:frontmatter/f:meta[@name='bibtex']" /> 382 - </details> 383 - </xsl:when> 384 - <xsl:otherwise> 385 - <xsl:apply-templates select="f:mainmatter" /> 386 - </xsl:otherwise> 387 - </xsl:choose> 388 - </section> 389 - 390 - <xsl:apply-templates select="f:backmatter" /> 391 - </xsl:template> 392 - 393 - <xsl:template match="f:tree"></xsl:template> 394 - 395 - </xsl:stylesheet>