diff --git a/README.md b/README.md index 52316df8cc6206d4c37c89985a7833e124961c1f..e57612a178f59751de31a1bfe43df92ad9df99d7 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ app_file: space.py --- # `gradio_tokenizertextbox` -Static Badge +PyPI - Version Textbox tokenizer @@ -30,7 +30,7 @@ import gradio as gr from gradio_tokenizertextbox import TokenizerTextBox import json - +# --- Data and Helper Functions --- TOKENIZER_OPTIONS = { "Xenova/clip-vit-large-patch14": "CLIP ViT-L/14", @@ -47,11 +47,8 @@ TOKENIZER_OPTIONS = { "Xenova/c4ai-command-r-v01-tokenizer": "Cohere Command-R", "Xenova/t5-small": "T5", "Xenova/bert-base-cased": "bert-base-cased", - } -# 2. Prepare the choices for the gr.Dropdown component -# The format is a list of tuples: [(display_name, internal_value)] dropdown_choices = [ (display_name, model_name) for model_name, display_name in TOKENIZER_OPTIONS.items() @@ -66,18 +63,17 @@ def process_output(tokenization_data): return tokenization_data # --- Gradio Application --- -with gr.Blocks() as demo: +with gr.Blocks(theme=gr.themes.Soft()) as demo: + # --- Header and Information --- gr.Markdown("# TokenizerTextBox Component Demo") - gr.Markdown("# Component idea taken from the original example application on [Xenova Tokenizer Playground](https://github.com/huggingface/transformers.js-examples/tree/main/the-tokenizer-playground) ") - gr.Markdown("## Select a tokenizer from the dropdown menu to see how it processes your text in real-time.") - gr.Markdown("## For more models, check out the [Xenova Transformers Models](https://huggingface.co/Xenova/models) page.") + gr.Markdown("Component idea taken from the original example application on [Xenova Tokenizer Playground](https://github.com/huggingface/transformers.js-examples/tree/main/the-tokenizer-playground)") + # --- Global Controls (affect both tabs) --- with gr.Row(): - # 3. Create the Dropdown for model selection model_selector = gr.Dropdown( label="Select a Tokenizer", choices=dropdown_choices, - value="Xenova/clip-vit-large-patch14", # Set a default value + value="Xenova/clip-vit-large-patch14", ) display_mode_radio = gr.Radio( @@ -85,49 +81,74 @@ with gr.Blocks() as demo: label="Display Mode", value="text" ) - - # 4. Initialize the component with a default model - tokenizer_input = TokenizerTextBox( - label="Type your text here", - value="Gradio is an awesome tool for building ML demos!", - model="Xenova/clip-vit-large-patch14", # Must match the dropdown's default value - display_mode="text", - ) - - output_info = gr.JSON(label="Component Output (from preprocess)") - - # --- Event Listeners --- - # A. When the tokenizer component changes, update the JSON output - tokenizer_input.change( - fn=process_output, - inputs=tokenizer_input, - outputs=output_info - ) - - # B. When the dropdown value changes, update the 'model' prop of our component - def update_tokenizer_model(selected_model): - return gr.update(model=selected_model) + # --- Tabbed Interface for Different Modes --- + with gr.Tabs(): + # --- Tab 1: Standalone Mode --- + with gr.TabItem("Standalone Mode"): + gr.Markdown("### In this mode, the component acts as its own interactive textbox.") + + standalone_tokenizer = TokenizerTextBox( + label="Type your text here", + value="Gradio is an awesome tool for building ML demos!", + model="Xenova/clip-vit-large-patch14", + display_mode="text", + ) + + standalone_output = gr.JSON(label="Component Output") + standalone_tokenizer.change(process_output, standalone_tokenizer, standalone_output) + + # --- Tab 2: Listener ("Push") Mode --- + with gr.TabItem("Listener Mode"): + gr.Markdown("### In this mode, the component is a read-only visualizer for other text inputs.") + + with gr.Row(): + prompt_1 = gr.Textbox(label="Prompt Part 1", value="A photorealistic image of an astronaut") + prompt_2 = gr.Textbox(label="Prompt Part 2", value="riding a horse on Mars") + + visualizer = TokenizerTextBox( + label="Concatenated Prompt Visualization", + hide_input=True, # Hides the internal textbox + model="Xenova/clip-vit-large-patch14", + display_mode="text", + ) + + visualizer_output = gr.JSON(label="Visualizer Component Output") + + # --- "Push" Logic --- + def update_visualizer_text(p1, p2): + concatenated_text = f"{p1}, {p2}" + # Return a new value for the visualizer. + # The postprocess method will correctly handle this string. + return gr.update(value=concatenated_text) + + # Listen for changes on the source textboxes + prompt_1.change(update_visualizer_text, [prompt_1, prompt_2], visualizer) + prompt_2.change(update_visualizer_text, [prompt_1, prompt_2], visualizer) + + # Also connect the visualizer to its own JSON output + visualizer.change(process_output, visualizer, visualizer_output) + + # Run once on load to show the initial state + demo.load(update_visualizer_text, [prompt_1, prompt_2], visualizer) + + # --- Link Global Controls to Both Components --- + # Create a list of all TokenizerTextBox components that need to be updated + all_tokenizers = [standalone_tokenizer, visualizer] model_selector.change( - fn=update_tokenizer_model, + fn=lambda model: [gr.update(model=model) for _ in all_tokenizers], inputs=model_selector, - outputs=tokenizer_input + outputs=all_tokenizers ) - - # C. When the radio button value changes, update the 'display_mode' prop - def update_display_mode(mode): - return gr.update(display_mode=mode) - display_mode_radio.change( - fn=update_display_mode, + fn=lambda mode: [gr.update(display_mode=mode) for _ in all_tokenizers], inputs=display_mode_radio, - outputs=tokenizer_input + outputs=all_tokenizers ) if __name__ == '__main__': demo.launch() - ``` ## `TokenizerTextBox` @@ -185,6 +206,19 @@ str Controls the content of the token visualization panel. Can be 'text' (default), 'token_ids', or 'hidden'. + +hide_input + + +```python +bool +``` + + +False +If True, the component's own textbox is hidden, turning it into a read-only visualizer. Defaults to False. + + lines diff --git a/app.py b/app.py index ac12d75e3376f1121da913c30b6ba2b4a6d4b76d..3aea9d9093e2e437bb03251418994530cfbaef44 100644 --- a/app.py +++ b/app.py @@ -5,7 +5,7 @@ import gradio as gr from gradio_tokenizertextbox import TokenizerTextBox import json - +# --- Data and Helper Functions --- TOKENIZER_OPTIONS = { "Xenova/clip-vit-large-patch14": "CLIP ViT-L/14", @@ -22,11 +22,8 @@ TOKENIZER_OPTIONS = { "Xenova/c4ai-command-r-v01-tokenizer": "Cohere Command-R", "Xenova/t5-small": "T5", "Xenova/bert-base-cased": "bert-base-cased", - } -# 2. Prepare the choices for the gr.Dropdown component -# The format is a list of tuples: [(display_name, internal_value)] dropdown_choices = [ (display_name, model_name) for model_name, display_name in TOKENIZER_OPTIONS.items() @@ -41,18 +38,17 @@ def process_output(tokenization_data): return tokenization_data # --- Gradio Application --- -with gr.Blocks() as demo: +with gr.Blocks(theme=gr.themes.Soft()) as demo: + # --- Header and Information --- gr.Markdown("# TokenizerTextBox Component Demo") - gr.Markdown("# Component idea taken from the original example application on [Xenova Tokenizer Playground](https://github.com/huggingface/transformers.js-examples/tree/main/the-tokenizer-playground) ") - gr.Markdown("## Select a tokenizer from the dropdown menu to see how it processes your text in real-time.") - gr.Markdown("## For more models, check out the [Xenova Transformers Models](https://huggingface.co/Xenova/models) page.") + gr.Markdown("Component idea taken from the original example application on [Xenova Tokenizer Playground](https://github.com/huggingface/transformers.js-examples/tree/main/the-tokenizer-playground)") + # --- Global Controls (affect both tabs) --- with gr.Row(): - # 3. Create the Dropdown for model selection model_selector = gr.Dropdown( label="Select a Tokenizer", choices=dropdown_choices, - value="Xenova/clip-vit-large-patch14", # Set a default value + value="Xenova/clip-vit-large-patch14", ) display_mode_radio = gr.Radio( @@ -60,45 +56,71 @@ with gr.Blocks() as demo: label="Display Mode", value="text" ) - - # 4. Initialize the component with a default model - tokenizer_input = TokenizerTextBox( - label="Type your text here", - value="Gradio is an awesome tool for building ML demos!", - model="Xenova/clip-vit-large-patch14", # Must match the dropdown's default value - display_mode="text", - ) - - output_info = gr.JSON(label="Component Output (from preprocess)") - # --- Event Listeners --- + # --- Tabbed Interface for Different Modes --- + with gr.Tabs(): + # --- Tab 1: Standalone Mode --- + with gr.TabItem("Standalone Mode"): + gr.Markdown("### In this mode, the component acts as its own interactive textbox.") + + standalone_tokenizer = TokenizerTextBox( + label="Type your text here", + value="Gradio is an awesome tool for building ML demos!", + model="Xenova/clip-vit-large-patch14", + display_mode="text", + ) + + standalone_output = gr.JSON(label="Component Output") + standalone_tokenizer.change(process_output, standalone_tokenizer, standalone_output) - # A. When the tokenizer component changes, update the JSON output - tokenizer_input.change( - fn=process_output, - inputs=tokenizer_input, - outputs=output_info - ) + # --- Tab 2: Listener ("Push") Mode --- + with gr.TabItem("Listener Mode"): + gr.Markdown("### In this mode, the component is a read-only visualizer for other text inputs.") + + with gr.Row(): + prompt_1 = gr.Textbox(label="Prompt Part 1", value="A photorealistic image of an astronaut") + prompt_2 = gr.Textbox(label="Prompt Part 2", value="riding a horse on Mars") + + visualizer = TokenizerTextBox( + label="Concatenated Prompt Visualization", + hide_input=True, # Hides the internal textbox + model="Xenova/clip-vit-large-patch14", + display_mode="text", + ) + + visualizer_output = gr.JSON(label="Visualizer Component Output") - # B. When the dropdown value changes, update the 'model' prop of our component - def update_tokenizer_model(selected_model): - return gr.update(model=selected_model) + # --- "Push" Logic --- + def update_visualizer_text(p1, p2): + concatenated_text = f"{p1}, {p2}" + # Return a new value for the visualizer. + # The postprocess method will correctly handle this string. + return gr.update(value=concatenated_text) + + # Listen for changes on the source textboxes + prompt_1.change(update_visualizer_text, [prompt_1, prompt_2], visualizer) + prompt_2.change(update_visualizer_text, [prompt_1, prompt_2], visualizer) + + # Also connect the visualizer to its own JSON output + visualizer.change(process_output, visualizer, visualizer_output) + + # Run once on load to show the initial state + demo.load(update_visualizer_text, [prompt_1, prompt_2], visualizer) + + # --- Link Global Controls to Both Components --- + # Create a list of all TokenizerTextBox components that need to be updated + all_tokenizers = [standalone_tokenizer, visualizer] model_selector.change( - fn=update_tokenizer_model, + fn=lambda model: [gr.update(model=model) for _ in all_tokenizers], inputs=model_selector, - outputs=tokenizer_input + outputs=all_tokenizers ) - - # C. When the radio button value changes, update the 'display_mode' prop - def update_display_mode(mode): - return gr.update(display_mode=mode) - display_mode_radio.change( - fn=update_display_mode, + fn=lambda mode: [gr.update(display_mode=mode) for _ in all_tokenizers], inputs=display_mode_radio, - outputs=tokenizer_input + outputs=all_tokenizers ) if __name__ == '__main__': - demo.launch() + demo.launch() \ No newline at end of file diff --git a/space.py b/space.py index 38f04ef5843705e7eb67ec5abcc79a37eeb435e7..d90def0e51d883d7909ea8691a6d489ab46e192f 100644 --- a/space.py +++ b/space.py @@ -3,7 +3,7 @@ import gradio as gr from app import demo as app import os -_docs = {'TokenizerTextBox': {'description': "Creates a textarea for user to enter string input or display string output,\nwith built-in, client-side tokenization visualization powered by Transformers.js.\nThe component's value is a JSON object containing the text and tokenization results.", 'members': {'__init__': {'value': {'type': 'typing.Union[str, dict, typing.Callable, NoneType][\n str, dict, Callable, None\n]', 'default': 'None', 'description': 'The initial value. Can be a string to initialize the text, or a dictionary for full state. If a function is provided, it will be called when the app loads to set the initial value.'}, 'model': {'type': 'str', 'default': '"Xenova/gpt-3"', 'description': 'The name of a Hugging Face tokenizer to use (must be compatible with Transformers.js). Defaults to "Xenova/gpt-2".'}, 'display_mode': {'type': '"text" | "token_ids" | "hidden"', 'default': '"text"', 'description': "Controls the content of the token visualization panel. Can be 'text' (default), 'token_ids', or 'hidden'."}, 'lines': {'type': 'int', 'default': '2', 'description': 'The minimum number of line rows for the textarea.'}, 'max_lines': {'type': 'int | None', 'default': 'None', 'description': 'The maximum number of line rows for the textarea.'}, 'placeholder': {'type': 'str | None', 'default': 'None', 'description': 'A placeholder hint to display in the textarea when it is empty.'}, 'autofocus': {'type': 'bool', 'default': 'False', 'description': 'If True, will focus on the textbox when the page loads.'}, 'autoscroll': {'type': 'bool', 'default': 'True', 'description': 'If True, will automatically scroll to the bottom of the textbox when the value changes.'}, 'text_align': {'type': 'typing.Optional[typing.Literal["left", "right"]][\n "left" | "right", None\n]', 'default': 'None', 'description': 'How to align the text in the textbox, can be: "left" or "right".'}, 'rtl': {'type': 'bool', 'default': 'False', 'description': 'If True, sets the direction of the text to right-to-left.'}, 'show_copy_button': {'type': 'bool', 'default': 'False', 'description': 'If True, a copy button will be shown.'}, 'max_length': {'type': 'int | None', 'default': 'None', 'description': 'The maximum number of characters allowed in the textbox.'}, 'label': {'type': 'str | None', 'default': 'None', 'description': 'The label for this component, displayed above the component.'}, 'info': {'type': 'str | None', 'default': 'None', 'description': 'Additional component description, displayed below the label.'}, 'every': {'type': 'float | None', 'default': 'None', 'description': 'If `value` is a callable, this sets a timer to run the function repeatedly.'}, 'show_label': {'type': 'bool', 'default': 'True', 'description': 'If False, the label is not displayed.'}, 'container': {'type': 'bool', 'default': 'True', 'description': 'If False, the component will not be wrapped in a container.'}, 'scale': {'type': 'int | None', 'default': 'None', 'description': 'The relative size of the component compared to others in a `gr.Row` or `gr.Column`.'}, 'min_width': {'type': 'int', 'default': '160', 'description': 'The minimum-width of the component in pixels.'}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': 'If False, the user will not be able to edit the text.'}, 'visible': {'type': 'bool', 'default': 'True', 'description': 'If False, the component will be hidden.'}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': 'An optional string that is assigned as the id of this component in the HTML DOM.'}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': 'An optional list of strings that are assigned as the classes of this component in the HTML DOM.'}}, 'postprocess': {'value': {'type': 'str | dict | None', 'description': 'The value to set for the component, can be a string or a dictionary.'}}, 'preprocess': {'return': {'type': 'dict | None', 'description': "A dictionary enriched with 'char_count' and 'token_count'."}, 'value': None}}, 'events': {'change': {'type': None, 'default': None, 'description': 'Triggered when the value of the TokenizerTextBox changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input.'}, 'input': {'type': None, 'default': None, 'description': 'This listener is triggered when the user changes the value of the TokenizerTextBox.'}, 'submit': {'type': None, 'default': None, 'description': 'This listener is triggered when the user presses the Enter key while the TokenizerTextBox is focused.'}, 'blur': {'type': None, 'default': None, 'description': 'This listener is triggered when the TokenizerTextBox is unfocused/blurred.'}, 'select': {'type': None, 'default': None, 'description': 'Event listener for when the user selects or deselects the TokenizerTextBox. Uses event data gradio.SelectData to carry `value` referring to the label of the TokenizerTextBox, and `selected` to refer to state of the TokenizerTextBox. See EventData documentation on how to use this event data'}}}, '__meta__': {'additional_interfaces': {}, 'user_fn_refs': {'TokenizerTextBox': []}}} +_docs = {'TokenizerTextBox': {'description': "Creates a textarea for user to enter string input or display string output,\nwith built-in, client-side tokenization visualization powered by Transformers.js.\nThe component's value is a JSON object containing the text and tokenization results.", 'members': {'__init__': {'value': {'type': 'typing.Union[str, dict, typing.Callable, NoneType][\n str, dict, Callable, None\n]', 'default': 'None', 'description': 'The initial value. Can be a string to initialize the text, or a dictionary for full state. If a function is provided, it will be called when the app loads to set the initial value.'}, 'model': {'type': 'str', 'default': '"Xenova/gpt-3"', 'description': 'The name of a Hugging Face tokenizer to use (must be compatible with Transformers.js). Defaults to "Xenova/gpt-2".'}, 'display_mode': {'type': '"text" | "token_ids" | "hidden"', 'default': '"text"', 'description': "Controls the content of the token visualization panel. Can be 'text' (default), 'token_ids', or 'hidden'."}, 'hide_input': {'type': 'bool', 'default': 'False', 'description': "If True, the component's own textbox is hidden, turning it into a read-only visualizer. Defaults to False."}, 'lines': {'type': 'int', 'default': '2', 'description': 'The minimum number of line rows for the textarea.'}, 'max_lines': {'type': 'int | None', 'default': 'None', 'description': 'The maximum number of line rows for the textarea.'}, 'placeholder': {'type': 'str | None', 'default': 'None', 'description': 'A placeholder hint to display in the textarea when it is empty.'}, 'autofocus': {'type': 'bool', 'default': 'False', 'description': 'If True, will focus on the textbox when the page loads.'}, 'autoscroll': {'type': 'bool', 'default': 'True', 'description': 'If True, will automatically scroll to the bottom of the textbox when the value changes.'}, 'text_align': {'type': 'typing.Optional[typing.Literal["left", "right"]][\n "left" | "right", None\n]', 'default': 'None', 'description': 'How to align the text in the textbox, can be: "left" or "right".'}, 'rtl': {'type': 'bool', 'default': 'False', 'description': 'If True, sets the direction of the text to right-to-left.'}, 'show_copy_button': {'type': 'bool', 'default': 'False', 'description': 'If True, a copy button will be shown.'}, 'max_length': {'type': 'int | None', 'default': 'None', 'description': 'The maximum number of characters allowed in the textbox.'}, 'label': {'type': 'str | None', 'default': 'None', 'description': 'The label for this component, displayed above the component.'}, 'info': {'type': 'str | None', 'default': 'None', 'description': 'Additional component description, displayed below the label.'}, 'every': {'type': 'float | None', 'default': 'None', 'description': 'If `value` is a callable, this sets a timer to run the function repeatedly.'}, 'show_label': {'type': 'bool', 'default': 'True', 'description': 'If False, the label is not displayed.'}, 'container': {'type': 'bool', 'default': 'True', 'description': 'If False, the component will not be wrapped in a container.'}, 'scale': {'type': 'int | None', 'default': 'None', 'description': 'The relative size of the component compared to others in a `gr.Row` or `gr.Column`.'}, 'min_width': {'type': 'int', 'default': '160', 'description': 'The minimum-width of the component in pixels.'}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': 'If False, the user will not be able to edit the text.'}, 'visible': {'type': 'bool', 'default': 'True', 'description': 'If False, the component will be hidden.'}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': 'An optional string that is assigned as the id of this component in the HTML DOM.'}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': 'An optional list of strings that are assigned as the classes of this component in the HTML DOM.'}}, 'postprocess': {'value': {'type': 'str | dict | None', 'description': 'The value to set for the component, can be a string or a dictionary.'}}, 'preprocess': {'return': {'type': 'dict | None', 'description': "A dictionary enriched with 'char_count' and 'token_count'."}, 'value': None}}, 'events': {'change': {'type': None, 'default': None, 'description': 'Triggered when the value of the TokenizerTextBox changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input.'}, 'input': {'type': None, 'default': None, 'description': 'This listener is triggered when the user changes the value of the TokenizerTextBox.'}, 'submit': {'type': None, 'default': None, 'description': 'This listener is triggered when the user presses the Enter key while the TokenizerTextBox is focused.'}, 'blur': {'type': None, 'default': None, 'description': 'This listener is triggered when the TokenizerTextBox is unfocused/blurred.'}, 'select': {'type': None, 'default': None, 'description': 'Event listener for when the user selects or deselects the TokenizerTextBox. Uses event data gradio.SelectData to carry `value` referring to the label of the TokenizerTextBox, and `selected` to refer to state of the TokenizerTextBox. See EventData documentation on how to use this event data'}}}, '__meta__': {'additional_interfaces': {}, 'user_fn_refs': {'TokenizerTextBox': []}}} abs_path = os.path.join(os.path.dirname(__file__), "css.css") @@ -21,7 +21,7 @@ with gr.Blocks( # `gradio_tokenizertextbox`
-Static Badge +PyPI - Version
Textbox tokenizer @@ -45,7 +45,7 @@ import gradio as gr from gradio_tokenizertextbox import TokenizerTextBox import json - +# --- Data and Helper Functions --- TOKENIZER_OPTIONS = { "Xenova/clip-vit-large-patch14": "CLIP ViT-L/14", @@ -62,11 +62,8 @@ TOKENIZER_OPTIONS = { "Xenova/c4ai-command-r-v01-tokenizer": "Cohere Command-R", "Xenova/t5-small": "T5", "Xenova/bert-base-cased": "bert-base-cased", - } -# 2. Prepare the choices for the gr.Dropdown component -# The format is a list of tuples: [(display_name, internal_value)] dropdown_choices = [ (display_name, model_name) for model_name, display_name in TOKENIZER_OPTIONS.items() @@ -81,18 +78,17 @@ def process_output(tokenization_data): return tokenization_data # --- Gradio Application --- -with gr.Blocks() as demo: +with gr.Blocks(theme=gr.themes.Soft()) as demo: + # --- Header and Information --- gr.Markdown("# TokenizerTextBox Component Demo") - gr.Markdown("# Component idea taken from the original example application on [Xenova Tokenizer Playground](https://github.com/huggingface/transformers.js-examples/tree/main/the-tokenizer-playground) ") - gr.Markdown("## Select a tokenizer from the dropdown menu to see how it processes your text in real-time.") - gr.Markdown("## For more models, check out the [Xenova Transformers Models](https://huggingface.co/Xenova/models) page.") + gr.Markdown("Component idea taken from the original example application on [Xenova Tokenizer Playground](https://github.com/huggingface/transformers.js-examples/tree/main/the-tokenizer-playground)") + # --- Global Controls (affect both tabs) --- with gr.Row(): - # 3. Create the Dropdown for model selection model_selector = gr.Dropdown( label="Select a Tokenizer", choices=dropdown_choices, - value="Xenova/clip-vit-large-patch14", # Set a default value + value="Xenova/clip-vit-large-patch14", ) display_mode_radio = gr.Radio( @@ -100,49 +96,74 @@ with gr.Blocks() as demo: label="Display Mode", value="text" ) - - # 4. Initialize the component with a default model - tokenizer_input = TokenizerTextBox( - label="Type your text here", - value="Gradio is an awesome tool for building ML demos!", - model="Xenova/clip-vit-large-patch14", # Must match the dropdown's default value - display_mode="text", - ) - - output_info = gr.JSON(label="Component Output (from preprocess)") - - # --- Event Listeners --- - # A. When the tokenizer component changes, update the JSON output - tokenizer_input.change( - fn=process_output, - inputs=tokenizer_input, - outputs=output_info - ) - - # B. When the dropdown value changes, update the 'model' prop of our component - def update_tokenizer_model(selected_model): - return gr.update(model=selected_model) + # --- Tabbed Interface for Different Modes --- + with gr.Tabs(): + # --- Tab 1: Standalone Mode --- + with gr.TabItem("Standalone Mode"): + gr.Markdown("### In this mode, the component acts as its own interactive textbox.") + + standalone_tokenizer = TokenizerTextBox( + label="Type your text here", + value="Gradio is an awesome tool for building ML demos!", + model="Xenova/clip-vit-large-patch14", + display_mode="text", + ) + + standalone_output = gr.JSON(label="Component Output") + standalone_tokenizer.change(process_output, standalone_tokenizer, standalone_output) + + # --- Tab 2: Listener ("Push") Mode --- + with gr.TabItem("Listener Mode"): + gr.Markdown("### In this mode, the component is a read-only visualizer for other text inputs.") + + with gr.Row(): + prompt_1 = gr.Textbox(label="Prompt Part 1", value="A photorealistic image of an astronaut") + prompt_2 = gr.Textbox(label="Prompt Part 2", value="riding a horse on Mars") + + visualizer = TokenizerTextBox( + label="Concatenated Prompt Visualization", + hide_input=True, # Hides the internal textbox + model="Xenova/clip-vit-large-patch14", + display_mode="text", + ) + + visualizer_output = gr.JSON(label="Visualizer Component Output") + + # --- "Push" Logic --- + def update_visualizer_text(p1, p2): + concatenated_text = f"{p1}, {p2}" + # Return a new value for the visualizer. + # The postprocess method will correctly handle this string. + return gr.update(value=concatenated_text) + + # Listen for changes on the source textboxes + prompt_1.change(update_visualizer_text, [prompt_1, prompt_2], visualizer) + prompt_2.change(update_visualizer_text, [prompt_1, prompt_2], visualizer) + + # Also connect the visualizer to its own JSON output + visualizer.change(process_output, visualizer, visualizer_output) + + # Run once on load to show the initial state + demo.load(update_visualizer_text, [prompt_1, prompt_2], visualizer) + + # --- Link Global Controls to Both Components --- + # Create a list of all TokenizerTextBox components that need to be updated + all_tokenizers = [standalone_tokenizer, visualizer] model_selector.change( - fn=update_tokenizer_model, + fn=lambda model: [gr.update(model=model) for _ in all_tokenizers], inputs=model_selector, - outputs=tokenizer_input + outputs=all_tokenizers ) - - # C. When the radio button value changes, update the 'display_mode' prop - def update_display_mode(mode): - return gr.update(display_mode=mode) - display_mode_radio.change( - fn=update_display_mode, + fn=lambda mode: [gr.update(display_mode=mode) for _ in all_tokenizers], inputs=display_mode_radio, - outputs=tokenizer_input + outputs=all_tokenizers ) if __name__ == '__main__': demo.launch() - ``` """, elem_classes=["md-custom"], header_links=True) diff --git a/src/README.md b/src/README.md index 52316df8cc6206d4c37c89985a7833e124961c1f..e57612a178f59751de31a1bfe43df92ad9df99d7 100644 --- a/src/README.md +++ b/src/README.md @@ -10,7 +10,7 @@ app_file: space.py --- # `gradio_tokenizertextbox` -Static Badge +PyPI - Version Textbox tokenizer @@ -30,7 +30,7 @@ import gradio as gr from gradio_tokenizertextbox import TokenizerTextBox import json - +# --- Data and Helper Functions --- TOKENIZER_OPTIONS = { "Xenova/clip-vit-large-patch14": "CLIP ViT-L/14", @@ -47,11 +47,8 @@ TOKENIZER_OPTIONS = { "Xenova/c4ai-command-r-v01-tokenizer": "Cohere Command-R", "Xenova/t5-small": "T5", "Xenova/bert-base-cased": "bert-base-cased", - } -# 2. Prepare the choices for the gr.Dropdown component -# The format is a list of tuples: [(display_name, internal_value)] dropdown_choices = [ (display_name, model_name) for model_name, display_name in TOKENIZER_OPTIONS.items() @@ -66,18 +63,17 @@ def process_output(tokenization_data): return tokenization_data # --- Gradio Application --- -with gr.Blocks() as demo: +with gr.Blocks(theme=gr.themes.Soft()) as demo: + # --- Header and Information --- gr.Markdown("# TokenizerTextBox Component Demo") - gr.Markdown("# Component idea taken from the original example application on [Xenova Tokenizer Playground](https://github.com/huggingface/transformers.js-examples/tree/main/the-tokenizer-playground) ") - gr.Markdown("## Select a tokenizer from the dropdown menu to see how it processes your text in real-time.") - gr.Markdown("## For more models, check out the [Xenova Transformers Models](https://huggingface.co/Xenova/models) page.") + gr.Markdown("Component idea taken from the original example application on [Xenova Tokenizer Playground](https://github.com/huggingface/transformers.js-examples/tree/main/the-tokenizer-playground)") + # --- Global Controls (affect both tabs) --- with gr.Row(): - # 3. Create the Dropdown for model selection model_selector = gr.Dropdown( label="Select a Tokenizer", choices=dropdown_choices, - value="Xenova/clip-vit-large-patch14", # Set a default value + value="Xenova/clip-vit-large-patch14", ) display_mode_radio = gr.Radio( @@ -85,49 +81,74 @@ with gr.Blocks() as demo: label="Display Mode", value="text" ) - - # 4. Initialize the component with a default model - tokenizer_input = TokenizerTextBox( - label="Type your text here", - value="Gradio is an awesome tool for building ML demos!", - model="Xenova/clip-vit-large-patch14", # Must match the dropdown's default value - display_mode="text", - ) - - output_info = gr.JSON(label="Component Output (from preprocess)") - - # --- Event Listeners --- - # A. When the tokenizer component changes, update the JSON output - tokenizer_input.change( - fn=process_output, - inputs=tokenizer_input, - outputs=output_info - ) - - # B. When the dropdown value changes, update the 'model' prop of our component - def update_tokenizer_model(selected_model): - return gr.update(model=selected_model) + # --- Tabbed Interface for Different Modes --- + with gr.Tabs(): + # --- Tab 1: Standalone Mode --- + with gr.TabItem("Standalone Mode"): + gr.Markdown("### In this mode, the component acts as its own interactive textbox.") + + standalone_tokenizer = TokenizerTextBox( + label="Type your text here", + value="Gradio is an awesome tool for building ML demos!", + model="Xenova/clip-vit-large-patch14", + display_mode="text", + ) + + standalone_output = gr.JSON(label="Component Output") + standalone_tokenizer.change(process_output, standalone_tokenizer, standalone_output) + + # --- Tab 2: Listener ("Push") Mode --- + with gr.TabItem("Listener Mode"): + gr.Markdown("### In this mode, the component is a read-only visualizer for other text inputs.") + + with gr.Row(): + prompt_1 = gr.Textbox(label="Prompt Part 1", value="A photorealistic image of an astronaut") + prompt_2 = gr.Textbox(label="Prompt Part 2", value="riding a horse on Mars") + + visualizer = TokenizerTextBox( + label="Concatenated Prompt Visualization", + hide_input=True, # Hides the internal textbox + model="Xenova/clip-vit-large-patch14", + display_mode="text", + ) + + visualizer_output = gr.JSON(label="Visualizer Component Output") + + # --- "Push" Logic --- + def update_visualizer_text(p1, p2): + concatenated_text = f"{p1}, {p2}" + # Return a new value for the visualizer. + # The postprocess method will correctly handle this string. + return gr.update(value=concatenated_text) + + # Listen for changes on the source textboxes + prompt_1.change(update_visualizer_text, [prompt_1, prompt_2], visualizer) + prompt_2.change(update_visualizer_text, [prompt_1, prompt_2], visualizer) + + # Also connect the visualizer to its own JSON output + visualizer.change(process_output, visualizer, visualizer_output) + + # Run once on load to show the initial state + demo.load(update_visualizer_text, [prompt_1, prompt_2], visualizer) + + # --- Link Global Controls to Both Components --- + # Create a list of all TokenizerTextBox components that need to be updated + all_tokenizers = [standalone_tokenizer, visualizer] model_selector.change( - fn=update_tokenizer_model, + fn=lambda model: [gr.update(model=model) for _ in all_tokenizers], inputs=model_selector, - outputs=tokenizer_input + outputs=all_tokenizers ) - - # C. When the radio button value changes, update the 'display_mode' prop - def update_display_mode(mode): - return gr.update(display_mode=mode) - display_mode_radio.change( - fn=update_display_mode, + fn=lambda mode: [gr.update(display_mode=mode) for _ in all_tokenizers], inputs=display_mode_radio, - outputs=tokenizer_input + outputs=all_tokenizers ) if __name__ == '__main__': demo.launch() - ``` ## `TokenizerTextBox` @@ -185,6 +206,19 @@ str Controls the content of the token visualization panel. Can be 'text' (default), 'token_ids', or 'hidden'. + +hide_input + + +```python +bool +``` + + +False +If True, the component's own textbox is hidden, turning it into a read-only visualizer. Defaults to False. + + lines diff --git a/src/backend/gradio_tokenizertextbox/templates/component/Index-DlSje_b9.js b/src/backend/gradio_tokenizertextbox/templates/component/Index-DlSje_b9.js new file mode 100644 index 0000000000000000000000000000000000000000..272ac0f896cdbd6520b5e35dc204c56f4ee3f022 --- /dev/null +++ b/src/backend/gradio_tokenizertextbox/templates/component/Index-DlSje_b9.js @@ -0,0 +1,45511 @@ +var Bn = Object.defineProperty; +var On = (s) => { + throw TypeError(s); +}; +var zn = (s, e, r) => e in s ? Bn(s, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : s[e] = r; +var be = (s, e, r) => zn(s, typeof e != "symbol" ? e + "" : e, r), Vn = (s, e, r) => e.has(s) || On("Cannot " + r); +var Cn = (s, e, r) => e.has(s) ? On("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, r); +var en = (s, e, r) => (Vn(s, e, "access private method"), r); +function _mergeNamespaces(s, e) { + for (var r = 0; r < e.length; r++) { + const o = e[r]; + if (typeof o != "string" && !Array.isArray(o)) { + for (const m in o) + if (m !== "default" && !(m in s)) { + const _ = Object.getOwnPropertyDescriptor(o, m); + _ && Object.defineProperty(s, m, _.get ? _ : { + enumerable: !0, + get: () => o[m] + }); + } + } + } + return Object.freeze(Object.defineProperty(s, Symbol.toStringTag, { value: "Module" })); +} +const { + SvelteComponent: SvelteComponent$1u, + append_hydration: append_hydration$1m, + assign: assign$1, + attr: attr$1s, + binding_callbacks: binding_callbacks$5, + children: children$1s, + claim_element: claim_element$h, + claim_space: claim_space$a, + claim_svg_element: claim_svg_element$1c, + create_slot: create_slot$6, + detach: detach$1t, + element: element_1, + empty: empty$8, + get_all_dirty_from_scope: get_all_dirty_from_scope$6, + get_slot_changes: get_slot_changes$6, + get_spread_update: get_spread_update$1, + init: init$1u, + insert_hydration: insert_hydration$1t, + listen: listen$5, + noop: noop$1i, + safe_not_equal: safe_not_equal$1u, + set_dynamic_element_data, + set_style: set_style$8, + space: space$a, + svg_element: svg_element$1c, + toggle_class: toggle_class$c, + transition_in: transition_in$g, + transition_out: transition_out$g, + update_slot_base: update_slot_base$6 +} = window.__gradio__svelte__internal; +function create_if_block_1$3(s) { + let e, r, o, m, _; + return { + c() { + e = svg_element$1c("svg"), r = svg_element$1c("line"), o = svg_element$1c("line"), this.h(); + }, + l(g) { + e = claim_svg_element$1c(g, "svg", { class: !0, xmlns: !0, viewBox: !0 }); + var y = children$1s(e); + r = claim_svg_element$1c(y, "line", { + x1: !0, + y1: !0, + x2: !0, + y2: !0, + stroke: !0, + "stroke-width": !0 + }), children$1s(r).forEach(detach$1t), o = claim_svg_element$1c(y, "line", { + x1: !0, + y1: !0, + x2: !0, + y2: !0, + stroke: !0, + "stroke-width": !0 + }), children$1s(o).forEach(detach$1t), y.forEach(detach$1t), this.h(); + }, + h() { + attr$1s(r, "x1", "1"), attr$1s(r, "y1", "9"), attr$1s(r, "x2", "9"), attr$1s(r, "y2", "1"), attr$1s(r, "stroke", "gray"), attr$1s(r, "stroke-width", "0.5"), attr$1s(o, "x1", "5"), attr$1s(o, "y1", "9"), attr$1s(o, "x2", "9"), attr$1s(o, "y2", "5"), attr$1s(o, "stroke", "gray"), attr$1s(o, "stroke-width", "0.5"), attr$1s(e, "class", "resize-handle svelte-239wnu"), attr$1s(e, "xmlns", "http://www.w3.org/2000/svg"), attr$1s(e, "viewBox", "0 0 10 10"); + }, + m(g, y) { + insert_hydration$1t(g, e, y), append_hydration$1m(e, r), append_hydration$1m(e, o), m || (_ = listen$5( + e, + "mousedown", + /*resize*/ + s[27] + ), m = !0); + }, + p: noop$1i, + d(g) { + g && detach$1t(e), m = !1, _(); + } + }; +} +function create_dynamic_element(s) { + var h; + let e, r, o, m, _; + const g = ( + /*#slots*/ + s[31].default + ), y = create_slot$6( + g, + s, + /*$$scope*/ + s[30], + null + ); + let E = ( + /*resizable*/ + s[19] && create_if_block_1$3(s) + ), x = [ + { "data-testid": ( + /*test_id*/ + s[11] + ) }, + { id: ( + /*elem_id*/ + s[6] + ) }, + { + class: o = "block " + /*elem_classes*/ + (((h = s[7]) == null ? void 0 : h.join(" ")) || "") + " svelte-239wnu" + }, + { + dir: m = /*rtl*/ + s[20] ? "rtl" : "ltr" + } + ], v = {}; + for (let a = 0; a < x.length; a += 1) + v = assign$1(v, x[a]); + return { + c() { + e = element_1( + /*tag*/ + s[25] + ), y && y.c(), r = space$a(), E && E.c(), this.h(); + }, + l(a) { + e = claim_element$h( + a, + /*tag*/ + (s[25] || "null").toUpperCase(), + { + "data-testid": !0, + id: !0, + class: !0, + dir: !0 + } + ); + var b = children$1s(e); + y && y.l(b), r = claim_space$a(b), E && E.l(b), b.forEach(detach$1t), this.h(); + }, + h() { + set_dynamic_element_data( + /*tag*/ + s[25] + )(e, v), toggle_class$c( + e, + "hidden", + /*visible*/ + s[14] === !1 + ), toggle_class$c( + e, + "padded", + /*padding*/ + s[10] + ), toggle_class$c( + e, + "flex", + /*flex*/ + s[1] + ), toggle_class$c( + e, + "border_focus", + /*border_mode*/ + s[9] === "focus" + ), toggle_class$c( + e, + "border_contrast", + /*border_mode*/ + s[9] === "contrast" + ), toggle_class$c(e, "hide-container", !/*explicit_call*/ + s[12] && !/*container*/ + s[13]), toggle_class$c( + e, + "fullscreen", + /*fullscreen*/ + s[0] + ), toggle_class$c( + e, + "animating", + /*fullscreen*/ + s[0] && /*preexpansionBoundingRect*/ + s[24] !== null + ), toggle_class$c( + e, + "auto-margin", + /*scale*/ + s[17] === null + ), set_style$8( + e, + "height", + /*fullscreen*/ + s[0] ? void 0 : ( + /*get_dimension*/ + s[26]( + /*height*/ + s[2] + ) + ) + ), set_style$8( + e, + "min-height", + /*fullscreen*/ + s[0] ? void 0 : ( + /*get_dimension*/ + s[26]( + /*min_height*/ + s[3] + ) + ) + ), set_style$8( + e, + "max-height", + /*fullscreen*/ + s[0] ? void 0 : ( + /*get_dimension*/ + s[26]( + /*max_height*/ + s[4] + ) + ) + ), set_style$8( + e, + "--start-top", + /*preexpansionBoundingRect*/ + s[24] ? `${/*preexpansionBoundingRect*/ + s[24].top}px` : "0px" + ), set_style$8( + e, + "--start-left", + /*preexpansionBoundingRect*/ + s[24] ? `${/*preexpansionBoundingRect*/ + s[24].left}px` : "0px" + ), set_style$8( + e, + "--start-width", + /*preexpansionBoundingRect*/ + s[24] ? `${/*preexpansionBoundingRect*/ + s[24].width}px` : "0px" + ), set_style$8( + e, + "--start-height", + /*preexpansionBoundingRect*/ + s[24] ? `${/*preexpansionBoundingRect*/ + s[24].height}px` : "0px" + ), set_style$8( + e, + "width", + /*fullscreen*/ + s[0] ? void 0 : typeof /*width*/ + s[5] == "number" ? `calc(min(${/*width*/ + s[5]}px, 100%))` : ( + /*get_dimension*/ + s[26]( + /*width*/ + s[5] + ) + ) + ), set_style$8( + e, + "border-style", + /*variant*/ + s[8] + ), set_style$8( + e, + "overflow", + /*allow_overflow*/ + s[15] ? ( + /*overflow_behavior*/ + s[16] + ) : "hidden" + ), set_style$8( + e, + "flex-grow", + /*scale*/ + s[17] + ), set_style$8(e, "min-width", `calc(min(${/*min_width*/ + s[18]}px, 100%))`), set_style$8(e, "border-width", "var(--block-border-width)"); + }, + m(a, b) { + insert_hydration$1t(a, e, b), y && y.m(e, null), append_hydration$1m(e, r), E && E.m(e, null), s[32](e), _ = !0; + }, + p(a, b) { + var w; + y && y.p && (!_ || b[0] & /*$$scope*/ + 1073741824) && update_slot_base$6( + y, + g, + a, + /*$$scope*/ + a[30], + _ ? get_slot_changes$6( + g, + /*$$scope*/ + a[30], + b, + null + ) : get_all_dirty_from_scope$6( + /*$$scope*/ + a[30] + ), + null + ), /*resizable*/ + a[19] ? E ? E.p(a, b) : (E = create_if_block_1$3(a), E.c(), E.m(e, null)) : E && (E.d(1), E = null), set_dynamic_element_data( + /*tag*/ + a[25] + )(e, v = get_spread_update$1(x, [ + (!_ || b[0] & /*test_id*/ + 2048) && { "data-testid": ( + /*test_id*/ + a[11] + ) }, + (!_ || b[0] & /*elem_id*/ + 64) && { id: ( + /*elem_id*/ + a[6] + ) }, + (!_ || b[0] & /*elem_classes*/ + 128 && o !== (o = "block " + /*elem_classes*/ + (((w = a[7]) == null ? void 0 : w.join(" ")) || "") + " svelte-239wnu")) && { class: o }, + (!_ || b[0] & /*rtl*/ + 1048576 && m !== (m = /*rtl*/ + a[20] ? "rtl" : "ltr")) && { dir: m } + ])), toggle_class$c( + e, + "hidden", + /*visible*/ + a[14] === !1 + ), toggle_class$c( + e, + "padded", + /*padding*/ + a[10] + ), toggle_class$c( + e, + "flex", + /*flex*/ + a[1] + ), toggle_class$c( + e, + "border_focus", + /*border_mode*/ + a[9] === "focus" + ), toggle_class$c( + e, + "border_contrast", + /*border_mode*/ + a[9] === "contrast" + ), toggle_class$c(e, "hide-container", !/*explicit_call*/ + a[12] && !/*container*/ + a[13]), toggle_class$c( + e, + "fullscreen", + /*fullscreen*/ + a[0] + ), toggle_class$c( + e, + "animating", + /*fullscreen*/ + a[0] && /*preexpansionBoundingRect*/ + a[24] !== null + ), toggle_class$c( + e, + "auto-margin", + /*scale*/ + a[17] === null + ), b[0] & /*fullscreen, height*/ + 5 && set_style$8( + e, + "height", + /*fullscreen*/ + a[0] ? void 0 : ( + /*get_dimension*/ + a[26]( + /*height*/ + a[2] + ) + ) + ), b[0] & /*fullscreen, min_height*/ + 9 && set_style$8( + e, + "min-height", + /*fullscreen*/ + a[0] ? void 0 : ( + /*get_dimension*/ + a[26]( + /*min_height*/ + a[3] + ) + ) + ), b[0] & /*fullscreen, max_height*/ + 17 && set_style$8( + e, + "max-height", + /*fullscreen*/ + a[0] ? void 0 : ( + /*get_dimension*/ + a[26]( + /*max_height*/ + a[4] + ) + ) + ), b[0] & /*preexpansionBoundingRect*/ + 16777216 && set_style$8( + e, + "--start-top", + /*preexpansionBoundingRect*/ + a[24] ? `${/*preexpansionBoundingRect*/ + a[24].top}px` : "0px" + ), b[0] & /*preexpansionBoundingRect*/ + 16777216 && set_style$8( + e, + "--start-left", + /*preexpansionBoundingRect*/ + a[24] ? `${/*preexpansionBoundingRect*/ + a[24].left}px` : "0px" + ), b[0] & /*preexpansionBoundingRect*/ + 16777216 && set_style$8( + e, + "--start-width", + /*preexpansionBoundingRect*/ + a[24] ? `${/*preexpansionBoundingRect*/ + a[24].width}px` : "0px" + ), b[0] & /*preexpansionBoundingRect*/ + 16777216 && set_style$8( + e, + "--start-height", + /*preexpansionBoundingRect*/ + a[24] ? `${/*preexpansionBoundingRect*/ + a[24].height}px` : "0px" + ), b[0] & /*fullscreen, width*/ + 33 && set_style$8( + e, + "width", + /*fullscreen*/ + a[0] ? void 0 : typeof /*width*/ + a[5] == "number" ? `calc(min(${/*width*/ + a[5]}px, 100%))` : ( + /*get_dimension*/ + a[26]( + /*width*/ + a[5] + ) + ) + ), b[0] & /*variant*/ + 256 && set_style$8( + e, + "border-style", + /*variant*/ + a[8] + ), b[0] & /*allow_overflow, overflow_behavior*/ + 98304 && set_style$8( + e, + "overflow", + /*allow_overflow*/ + a[15] ? ( + /*overflow_behavior*/ + a[16] + ) : "hidden" + ), b[0] & /*scale*/ + 131072 && set_style$8( + e, + "flex-grow", + /*scale*/ + a[17] + ), b[0] & /*min_width*/ + 262144 && set_style$8(e, "min-width", `calc(min(${/*min_width*/ + a[18]}px, 100%))`); + }, + i(a) { + _ || (transition_in$g(y, a), _ = !0); + }, + o(a) { + transition_out$g(y, a), _ = !1; + }, + d(a) { + a && detach$1t(e), y && y.d(a), E && E.d(), s[32](null); + } + }; +} +function create_if_block$5(s) { + let e; + return { + c() { + e = element_1("div"), this.h(); + }, + l(r) { + e = claim_element$h(r, "DIV", { class: !0 }), children$1s(e).forEach(detach$1t), this.h(); + }, + h() { + attr$1s(e, "class", "placeholder svelte-239wnu"), set_style$8( + e, + "height", + /*placeholder_height*/ + s[22] + "px" + ), set_style$8( + e, + "width", + /*placeholder_width*/ + s[23] + "px" + ); + }, + m(r, o) { + insert_hydration$1t(r, e, o); + }, + p(r, o) { + o[0] & /*placeholder_height*/ + 4194304 && set_style$8( + e, + "height", + /*placeholder_height*/ + r[22] + "px" + ), o[0] & /*placeholder_width*/ + 8388608 && set_style$8( + e, + "width", + /*placeholder_width*/ + r[23] + "px" + ); + }, + d(r) { + r && detach$1t(e); + } + }; +} +function create_fragment$d(s) { + let e, r, o, m = ( + /*tag*/ + s[25] && create_dynamic_element(s) + ), _ = ( + /*fullscreen*/ + s[0] && create_if_block$5(s) + ); + return { + c() { + m && m.c(), e = space$a(), _ && _.c(), r = empty$8(); + }, + l(g) { + m && m.l(g), e = claim_space$a(g), _ && _.l(g), r = empty$8(); + }, + m(g, y) { + m && m.m(g, y), insert_hydration$1t(g, e, y), _ && _.m(g, y), insert_hydration$1t(g, r, y), o = !0; + }, + p(g, y) { + /*tag*/ + g[25] && m.p(g, y), /*fullscreen*/ + g[0] ? _ ? _.p(g, y) : (_ = create_if_block$5(g), _.c(), _.m(r.parentNode, r)) : _ && (_.d(1), _ = null); + }, + i(g) { + o || (transition_in$g(m, g), o = !0); + }, + o(g) { + transition_out$g(m, g), o = !1; + }, + d(g) { + g && (detach$1t(e), detach$1t(r)), m && m.d(g), _ && _.d(g); + } + }; +} +function instance$9(s, e, r) { + let { $$slots: o = {}, $$scope: m } = e, { height: _ = void 0 } = e, { min_height: g = void 0 } = e, { max_height: y = void 0 } = e, { width: E = void 0 } = e, { elem_id: x = "" } = e, { elem_classes: v = [] } = e, { variant: h = "solid" } = e, { border_mode: a = "base" } = e, { padding: b = !0 } = e, { type: w = "normal" } = e, { test_id: k = void 0 } = e, { explicit_call: A = !1 } = e, { container: M = !0 } = e, { visible: $ = !0 } = e, { allow_overflow: O = !0 } = e, { overflow_behavior: C = "auto" } = e, { scale: P = null } = e, { min_width: I = 0 } = e, { flex: N = !1 } = e, { resizable: R = !1 } = e, { rtl: F = !1 } = e, { fullscreen: B = !1 } = e, G = B, Q, ee = w === "fieldset" ? "fieldset" : "div", Y = 0, W = 0, j = null; + function J(oe) { + B && oe.key === "Escape" && r(0, B = !1); + } + const me = (oe) => { + if (oe !== void 0) { + if (typeof oe == "number") + return oe + "px"; + if (typeof oe == "string") + return oe; + } + }, pe = (oe) => { + let we = oe.clientY; + const Se = (de) => { + const Oe = de.clientY - we; + we = de.clientY, r(21, Q.style.height = `${Q.offsetHeight + Oe}px`, Q); + }, Me = () => { + window.removeEventListener("mousemove", Se), window.removeEventListener("mouseup", Me); + }; + window.addEventListener("mousemove", Se), window.addEventListener("mouseup", Me); + }; + function ye(oe) { + binding_callbacks$5[oe ? "unshift" : "push"](() => { + Q = oe, r(21, Q); + }); + } + return s.$$set = (oe) => { + "height" in oe && r(2, _ = oe.height), "min_height" in oe && r(3, g = oe.min_height), "max_height" in oe && r(4, y = oe.max_height), "width" in oe && r(5, E = oe.width), "elem_id" in oe && r(6, x = oe.elem_id), "elem_classes" in oe && r(7, v = oe.elem_classes), "variant" in oe && r(8, h = oe.variant), "border_mode" in oe && r(9, a = oe.border_mode), "padding" in oe && r(10, b = oe.padding), "type" in oe && r(28, w = oe.type), "test_id" in oe && r(11, k = oe.test_id), "explicit_call" in oe && r(12, A = oe.explicit_call), "container" in oe && r(13, M = oe.container), "visible" in oe && r(14, $ = oe.visible), "allow_overflow" in oe && r(15, O = oe.allow_overflow), "overflow_behavior" in oe && r(16, C = oe.overflow_behavior), "scale" in oe && r(17, P = oe.scale), "min_width" in oe && r(18, I = oe.min_width), "flex" in oe && r(1, N = oe.flex), "resizable" in oe && r(19, R = oe.resizable), "rtl" in oe && r(20, F = oe.rtl), "fullscreen" in oe && r(0, B = oe.fullscreen), "$$scope" in oe && r(30, m = oe.$$scope); + }, s.$$.update = () => { + s.$$.dirty[0] & /*fullscreen, old_fullscreen, element*/ + 538968065 && B !== G && (r(29, G = B), B ? (r(24, j = Q.getBoundingClientRect()), r(22, Y = Q.offsetHeight), r(23, W = Q.offsetWidth), window.addEventListener("keydown", J)) : (r(24, j = null), window.removeEventListener("keydown", J))), s.$$.dirty[0] & /*visible*/ + 16384 && ($ || r(1, N = !1)); + }, [ + B, + N, + _, + g, + y, + E, + x, + v, + h, + a, + b, + k, + A, + M, + $, + O, + C, + P, + I, + R, + F, + Q, + Y, + W, + j, + ee, + me, + pe, + w, + G, + m, + o, + ye + ]; +} +class Block extends SvelteComponent$1u { + constructor(e) { + super(), init$1u( + this, + e, + instance$9, + create_fragment$d, + safe_not_equal$1u, + { + height: 2, + min_height: 3, + max_height: 4, + width: 5, + elem_id: 6, + elem_classes: 7, + variant: 8, + border_mode: 9, + padding: 10, + type: 28, + test_id: 11, + explicit_call: 12, + container: 13, + visible: 14, + allow_overflow: 15, + overflow_behavior: 16, + scale: 17, + min_width: 18, + flex: 1, + resizable: 19, + rtl: 20, + fullscreen: 0 + }, + null, + [-1, -1] + ); + } +} +class SourceLocation { + // The + prefix indicates that these fields aren't writeable + // Lexer holding the input string. + // Start offset, zero-based inclusive. + // End offset, zero-based exclusive. + constructor(e, r, o) { + this.lexer = void 0, this.start = void 0, this.end = void 0, this.lexer = e, this.start = r, this.end = o; + } + /** + * Merges two `SourceLocation`s from location providers, given they are + * provided in order of appearance. + * - Returns the first one's location if only the first is provided. + * - Returns a merged range of the first and the last if both are provided + * and their lexers match. + * - Otherwise, returns null. + */ + static range(e, r) { + return r ? !e || !e.loc || !r.loc || e.loc.lexer !== r.loc.lexer ? null : new SourceLocation(e.loc.lexer, e.loc.start, r.loc.end) : e && e.loc; + } +} +let Token$1 = class Fn { + // don't expand the token + // used in \noexpand + constructor(e, r) { + this.text = void 0, this.loc = void 0, this.noexpand = void 0, this.treatAsRelax = void 0, this.text = e, this.loc = r; + } + /** + * Given a pair of tokens (this and endToken), compute a `Token` encompassing + * the whole input range enclosed by these two. + */ + range(e, r) { + return new Fn(r, SourceLocation.range(this, e)); + } +}; +class ParseError { + // Error start position based on passed-in Token or ParseNode. + // Length of affected text based on passed-in Token or ParseNode. + // The underlying error message without any context added. + constructor(e, r) { + this.name = void 0, this.position = void 0, this.length = void 0, this.rawMessage = void 0; + var o = "KaTeX parse error: " + e, m, _, g = r && r.loc; + if (g && g.start <= g.end) { + var y = g.lexer.input; + m = g.start, _ = g.end, m === y.length ? o += " at end of input: " : o += " at position " + (m + 1) + ": "; + var E = y.slice(m, _).replace(/[^]/g, "$&̲"), x; + m > 15 ? x = "…" + y.slice(m - 15, m) : x = y.slice(0, m); + var v; + _ + 15 < y.length ? v = y.slice(_, _ + 15) + "…" : v = y.slice(_), o += x + E + v; + } + var h = new Error(o); + return h.name = "ParseError", h.__proto__ = ParseError.prototype, h.position = m, m != null && _ != null && (h.length = _ - m), h.rawMessage = e, h; + } +} +ParseError.prototype.__proto__ = Error.prototype; +var contains = function(e, r) { + return e.indexOf(r) !== -1; +}, deflt = function(e, r) { + return e === void 0 ? r : e; +}, uppercase = /([A-Z])/g, hyphenate = function(e) { + return e.replace(uppercase, "-$1").toLowerCase(); +}, ESCAPE_LOOKUP = { + "&": "&", + ">": ">", + "<": "<", + '"': """, + "'": "'" +}, ESCAPE_REGEX = /[&><"']/g; +function escape$3(s) { + return String(s).replace(ESCAPE_REGEX, (e) => ESCAPE_LOOKUP[e]); +} +var getBaseElem = function s(e) { + return e.type === "ordgroup" || e.type === "color" ? e.body.length === 1 ? s(e.body[0]) : e : e.type === "font" ? s(e.body) : e; +}, isCharacterBox = function(e) { + var r = getBaseElem(e); + return r.type === "mathord" || r.type === "textord" || r.type === "atom"; +}, assert = function(e) { + if (!e) + throw new Error("Expected non-null, but got " + String(e)); + return e; +}, protocolFromUrl = function(e) { + var r = /^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e); + return r ? r[2] !== ":" || !/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(r[1]) ? null : r[1].toLowerCase() : "_relative"; +}, utils = { + contains, + deflt, + escape: escape$3, + hyphenate, + getBaseElem, + isCharacterBox, + protocolFromUrl +}, SETTINGS_SCHEMA = { + 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 " + }, + 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 ", + 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: (s) => "#" + s + }, + macros: { + type: "object", + cli: "-m, --macro ", + cliDescription: "Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).", + cliDefault: [], + cliProcessor: (s, e) => (e.push(s), 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: (s) => Math.max(0, s), + cli: "--min-rule-thickness ", + 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: (s) => Math.max(0, s), + cli: "-s, --max-size ", + 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: (s) => Math.max(0, s), + cli: "-e, --max-expand ", + cliProcessor: (s) => s === "Infinity" ? 1 / 0 : parseInt(s) + }, + globalGroup: { + type: "boolean", + cli: !1 + } +}; +function getDefaultValue(s) { + if (s.default) + return s.default; + var e = s.type, r = Array.isArray(e) ? e[0] : e; + if (typeof r != "string") + return r.enum[0]; + switch (r) { + case "boolean": + return !1; + case "string": + return ""; + case "number": + return 0; + case "object": + return {}; + } +} +class Settings { + 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 r in SETTINGS_SCHEMA) + if (SETTINGS_SCHEMA.hasOwnProperty(r)) { + var o = SETTINGS_SCHEMA[r]; + this[r] = e[r] !== void 0 ? o.processor ? o.processor(e[r]) : e[r] : getDefaultValue(o); + } + } + /** + * Report nonstrict (non-LaTeX-compatible) input. + * Can safely not be called if `this.strict` is false in JavaScript. + */ + reportNonstrict(e, r, o) { + var m = this.strict; + if (typeof m == "function" && (m = m(e, r, o)), !(!m || m === "ignore")) { + if (m === !0 || m === "error") + throw new ParseError("LaTeX-incompatible input and strict mode is set to 'error': " + (r + " [" + e + "]"), o); + m === "warn" ? typeof console < "u" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (r + " [" + e + "]")) : typeof console < "u" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + m + "': " + r + " [" + e + "]")); + } + } + /** + * Check whether to apply strict (LaTeX-adhering) behavior for unusual + * input (like `\\`). Unlike `nonstrict`, will not throw an error; + * instead, "error" translates to a return value of `true`, while "ignore" + * translates to a return value of `false`. May still print a warning: + * "warn" prints a warning and returns `false`. + * This is for the second category of `errorCode`s listed in the README. + */ + useStrictBehavior(e, r, o) { + var m = this.strict; + if (typeof m == "function") + try { + m = m(e, r, o); + } catch { + m = "error"; + } + return !m || m === "ignore" ? !1 : m === !0 || m === "error" ? !0 : m === "warn" ? (typeof console < "u" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (r + " [" + e + "]")), !1) : (typeof console < "u" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + m + "': " + r + " [" + e + "]")), !1); + } + /** + * Check whether to test potentially dangerous input, and return + * `true` (trusted) or `false` (untrusted). The sole argument `context` + * should be an object with `command` field specifying the relevant LaTeX + * command (as a string starting with `\`), and any other arguments, etc. + * If `context` has a `url` field, a `protocol` field will automatically + * get added by this function (changing the specified object). + */ + isTrusted(e) { + if (e.url && !e.protocol) { + var r = utils.protocolFromUrl(e.url); + if (r == null) + return !1; + e.protocol = r; + } + var o = typeof this.trust == "function" ? this.trust(e) : this.trust; + return !!o; + } +} +class Style { + constructor(e, r, o) { + this.id = void 0, this.size = void 0, this.cramped = void 0, this.id = e, this.size = r, this.cramped = o; + } + /** + * Get the style of a superscript given a base in the current style. + */ + sup() { + return styles[sup[this.id]]; + } + /** + * Get the style of a subscript given a base in the current style. + */ + sub() { + return styles[sub[this.id]]; + } + /** + * Get the style of a fraction numerator given the fraction in the current + * style. + */ + fracNum() { + return styles[fracNum[this.id]]; + } + /** + * Get the style of a fraction denominator given the fraction in the current + * style. + */ + fracDen() { + return styles[fracDen[this.id]]; + } + /** + * Get the cramped version of a style (in particular, cramping a cramped style + * doesn't change the style). + */ + cramp() { + return styles[cramp[this.id]]; + } + /** + * Get a text or display version of this style. + */ + text() { + return styles[text$1$1[this.id]]; + } + /** + * Return true if this style is tightly spaced (scriptstyle/scriptscriptstyle) + */ + isTight() { + return this.size >= 2; + } +} +var D = 0, Dc = 1, T = 2, Tc = 3, S = 4, Sc = 5, SS = 6, SSc = 7, styles = [new Style(D, 0, !1), new Style(Dc, 0, !0), new Style(T, 1, !1), new Style(Tc, 1, !0), new Style(S, 2, !1), new Style(Sc, 2, !0), new Style(SS, 3, !1), new Style(SSc, 3, !0)], sup = [S, Sc, S, Sc, SS, SSc, SS, SSc], sub = [Sc, Sc, Sc, Sc, SSc, SSc, SSc, SSc], fracNum = [T, Tc, S, Sc, SS, SSc, SS, SSc], fracDen = [Tc, Tc, Sc, Sc, SSc, SSc, SSc, SSc], cramp = [Dc, Dc, Tc, Tc, Sc, Sc, SSc, SSc], text$1$1 = [D, Dc, T, Tc, T, Tc, T, Tc], Style$1 = { + DISPLAY: styles[D], + TEXT: styles[T], + SCRIPT: styles[S], + SCRIPTSCRIPT: styles[SS] +}, scriptData = [{ + // Latin characters beyond the Latin-1 characters we have metrics for. + // Needed for Czech, Hungarian and Turkish text, for example. + name: "latin", + blocks: [ + [256, 591], + // Latin Extended-A and Latin Extended-B + [768, 879] + // Combining Diacritical marks + ] +}, { + // The Cyrillic script used by Russian and related languages. + // A Cyrillic subset used to be supported as explicitly defined + // symbols in symbols.js + name: "cyrillic", + blocks: [[1024, 1279]] +}, { + // Armenian + name: "armenian", + blocks: [[1328, 1423]] +}, { + // The Brahmic scripts of South and Southeast Asia + // Devanagari (0900–097F) + // Bengali (0980–09FF) + // Gurmukhi (0A00–0A7F) + // Gujarati (0A80–0AFF) + // Oriya (0B00–0B7F) + // Tamil (0B80–0BFF) + // Telugu (0C00–0C7F) + // Kannada (0C80–0CFF) + // Malayalam (0D00–0D7F) + // Sinhala (0D80–0DFF) + // Thai (0E00–0E7F) + // Lao (0E80–0EFF) + // Tibetan (0F00–0FFF) + // Myanmar (1000–109F) + name: "brahmic", + blocks: [[2304, 4255]] +}, { + name: "georgian", + blocks: [[4256, 4351]] +}, { + // Chinese and Japanese. + // The "k" in cjk is for Korean, but we've separated Korean out + name: "cjk", + blocks: [ + [12288, 12543], + // CJK symbols and punctuation, Hiragana, Katakana + [19968, 40879], + // CJK ideograms + [65280, 65376] + // Fullwidth punctuation + // TODO: add halfwidth Katakana and Romanji glyphs + ] +}, { + // Korean + name: "hangul", + blocks: [[44032, 55215]] +}]; +function scriptFromCodepoint(s) { + for (var e = 0; e < scriptData.length; e++) + for (var r = scriptData[e], o = 0; o < r.blocks.length; o++) { + var m = r.blocks[o]; + if (s >= m[0] && s <= m[1]) + return r.name; + } + return null; +} +var allBlocks = []; +scriptData.forEach((s) => s.blocks.forEach((e) => allBlocks.push(...e))); +function supportedCodepoint(s) { + for (var e = 0; e < allBlocks.length; e += 2) + if (s >= allBlocks[e] && s <= allBlocks[e + 1]) + return !0; + return !1; +} +var hLinePad = 80, sqrtMain = function(e, r) { + return "M95," + (622 + e + r) + ` +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +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 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l` + e / 2.075 + " -" + e + ` +c5.3,-9.3,12,-14,20,-14 +H400000v` + (40 + e) + `H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M` + (834 + e) + " " + r + "h400000v" + (40 + e) + "h-400000z"; +}, sqrtSize1 = function(e, r) { + return "M263," + (601 + e + r) + `c0.7,0,18,39.7,52,119 +c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 +c340,-704.7,510.7,-1060.3,512,-1067 +l` + e / 2.084 + " -" + e + ` +c4.7,-7.3,11,-11,19,-11 +H40000v` + (40 + e) + `H1012.3 +s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232 +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 +s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 +c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z +M` + (1001 + e) + " " + r + "h400000v" + (40 + e) + "h-400000z"; +}, sqrtSize2 = function(e, r) { + return "M983 " + (10 + e + r) + ` +l` + e / 3.13 + " -" + e + ` +c4,-6.7,10,-10,18,-10 H400000v` + (40 + e) + ` +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 +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 +c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 +c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 +c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 +c53.7,-170.3,84.5,-266.8,92.5,-289.5z +M` + (1001 + e) + " " + r + "h400000v" + (40 + e) + "h-400000z"; +}, sqrtSize3 = function(e, r) { + return "M424," + (2398 + e + r) + ` +c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 +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 +s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 +s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081 +l` + e / 4.223 + " -" + e + `c4,-6.7,10,-10,18,-10 H400000 +v` + (40 + e) + `H1014.6 +s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 +c-2,6,-10,9,-24,9 +c-8,0,-12,-0.7,-12,-2z M` + (1001 + e) + " " + r + ` +h400000v` + (40 + e) + "h-400000z"; +}, sqrtSize4 = function(e, r) { + return "M473," + (2713 + e + r) + ` +c339.3,-1799.3,509.3,-2700,510,-2702 l` + e / 5.298 + " -" + e + ` +c3.3,-7.3,9.3,-11,18,-11 H400000v` + (40 + e) + `H1017.7 +s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 +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 +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 +s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, +606zM` + (1001 + e) + " " + r + "h400000v" + (40 + e) + "H1017.7z"; +}, phasePath = function(e) { + var r = e / 2; + return "M400000 " + e + " H0 L" + r + " 0 l65 45 L145 " + (e - 80) + " H400000z"; +}, sqrtTall = function(e, r, o) { + var m = o - 54 - r - e; + return "M702 " + (e + r) + "H400000" + (40 + e) + ` +H742v` + m + `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 +h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 +c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 +219 661 l218 661zM702 ` + r + "H400000v" + (40 + e) + "H742z"; +}, sqrtPath = function(e, r, o) { + r = 1e3 * r; + var m = ""; + switch (e) { + case "sqrtMain": + m = sqrtMain(r, hLinePad); + break; + case "sqrtSize1": + m = sqrtSize1(r, hLinePad); + break; + case "sqrtSize2": + m = sqrtSize2(r, hLinePad); + break; + case "sqrtSize3": + m = sqrtSize3(r, hLinePad); + break; + case "sqrtSize4": + m = sqrtSize4(r, hLinePad); + break; + case "sqrtTall": + m = sqrtTall(r, hLinePad, o); + } + return m; +}, innerPath = function(e, r) { + switch (e) { + case "⎜": + return "M291 0 H417 V" + r + " H291z M291 0 H417 V" + r + " H291z"; + case "∣": + return "M145 0 H188 V" + r + " H145z M145 0 H188 V" + r + " H145z"; + case "∥": + return "M145 0 H188 V" + r + " H145z M145 0 H188 V" + r + " H145z" + ("M367 0 H410 V" + r + " H367z M367 0 H410 V" + r + " H367z"); + case "⎟": + return "M457 0 H583 V" + r + " H457z M457 0 H583 V" + r + " H457z"; + case "⎢": + return "M319 0 H403 V" + r + " H319z M319 0 H403 V" + r + " H319z"; + case "⎥": + return "M263 0 H347 V" + r + " H263z M263 0 H347 V" + r + " H263z"; + case "⎪": + return "M384 0 H504 V" + r + " H384z M384 0 H504 V" + r + " H384z"; + case "⏐": + return "M312 0 H355 V" + r + " H312z M312 0 H355 V" + r + " H312z"; + case "‖": + return "M257 0 H300 V" + r + " H257z M257 0 H300 V" + r + " H257z" + ("M478 0 H521 V" + r + " H478z M478 0 H521 V" + r + " H478z"); + default: + return ""; + } +}, path = { + // The doubleleftarrow geometry is from glyph U+21D0 in the font KaTeX Main + doubleleftarrow: `M262 157 +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 + 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 + 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 +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 + 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 +-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7 +-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z +m8 0v40h399730v-40zm0 194v40h399730v-40z`, + // doublerightarrow is from glyph U+21D2 in font KaTeX Main + doublerightarrow: `M399738 392l +-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 + 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 +-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 +-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 +-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782 +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 +-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`, + // leftarrow is from glyph U+2190 in font KaTeX Main + leftarrow: `M400000 241H110l3-3c68.7-52.7 113.7-120 + 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 +-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 +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 + 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 + 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 + l-3-3h399890zM100 241v40h399900v-40z`, + // overbrace is from glyphs U+23A9/23A8/23A7 in font KaTeX_Size4-Regular + leftbrace: `M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117 +-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7 + 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 + 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 + 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7 +-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`, + // overgroup is from the MnSymbol package (public domain) + leftgroup: `M400000 80 +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 + 435 0h399565z`, + leftgroupunder: `M400000 262 +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 + 435 219h399565z`, + // Harpoons are from glyph U+21BD in font KaTeX Main + leftharpoon: `M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3 +-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 +-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 +-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 + 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 +-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 +-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z +m0 0v40h400000v-40z`, + leftharpoondown: `M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333 + 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5 + 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 +-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 + 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 +-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0 +v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`, + // hook is from glyph U+21A9 in font KaTeX Main + lefthook: `M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 +-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 +-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 + 71.5 23h399859zM103 281v-40h399897v40z`, + leftlinesegment: `M40 281 V428 H0 V94 H40 V241 H400000 v40z +M40 281 V428 H0 V94 H40 V241 H400000 v40z`, + leftmapsto: `M40 281 V448H0V74H40V241H400000v40z +M40 281 V448H0V74H40V241H400000v40z`, + // tofrom is from glyph U+21C4 in font KaTeX AMS Regular + leftToFrom: `M0 147h400000v40H0zm0 214c68 40 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-70-101l-7-8h399905v-40H95l7-8 +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 + 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`, + longequal: `M0 50 h400000 v40H0z m0 194h40000v40H0z +M0 50 h400000 v40H0z m0 194h40000v40H0z`, + midbrace: `M200428 334 +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 +-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 + 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 + 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`, + midbraceunder: `M199572 214 +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 + 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3 + 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 +-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 +-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z +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 +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 +-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z +m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2 +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 +-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z +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 +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 +-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z +m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1 +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 +-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 + 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 + 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 +-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 +-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 + 151.7 139 205zm0 0v40h399900v-40z`, + rightbrace: `M400000 542l +-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 +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 +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 + 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237 +-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 + 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 + 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 +-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 +-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 + 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 +-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 + 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 +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 + 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 +-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 +-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 + 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 + 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 +-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z +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 + 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 +-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 + 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 +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 + 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 +-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 +-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`, + // twoheadleftarrow is from glyph U+219E in font KaTeX AMS Regular + twoheadleftarrow: `M0 167c68 40 + 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 +-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3 +-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19 +-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101 + 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 +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 + 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 + 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333 +-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70 + 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 is a modified version of a glyph from the MnSymbol package + tilde1: `M200 55.538c-77 0-168 73.953-177 73.953-3 0-7 +-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 + 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 + 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128 +-68.267.847-113-73.952-191-73.952z`, + // ditto tilde2, tilde3, & tilde4 + tilde2: `M344 55.266c-142 0-300.638 81.316-311.5 86.418 +-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 + 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114 +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 + 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 +-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0 + 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697 + 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696 + -338 0-409-156.573-744-156.573z`, + tilde4: `M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345 +-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409 + 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9 + 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409 + -175.236-744-175.236z`, + // vec is from glyph U+20D7 in font KaTeX Main + vec: `M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5 +3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11 +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 +-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 +-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59 +H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359 +c-16-25.333-24-45-24-59z`, + // widehat1 is a modified version of a glyph from the MnSymbol package + widehat1: `M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22 +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`, + // ditto widehat2, widehat3, & widehat4 + widehat2: `M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10 +-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 +-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 +-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`, + // widecheck paths are all inverted versions of widehat + widecheck1: `M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1, +-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, +-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, +-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, +-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`, + // The next ten paths support reaction arrows from the mhchem package. + // Arrows for \ce{<-->} are offset from xAxis by 0.22ex, per mhchem in LaTeX + // baraboveleftarrow is mostly from glyph U+2190 in font KaTeX Main + baraboveleftarrow: `M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202 +c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5 +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 +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 +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 +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 +c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z +M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`, + // rightarrowabovebar is mostly from glyph U+2192, KaTeX Main + rightarrowabovebar: `M0 241v40h399891c-47.3 35.3-84 78-110 128-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 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 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-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 +-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 +151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`, + // The short left harpoon has 0.5em (i.e. 500 units) kern on the left end. + // Ref from mhchem.sty: \rlap{\raisebox{-.22ex}{$\kern0.5em + baraboveshortleftharpoon: `M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 +c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17 +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 +c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40 +c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z +M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`, + rightharpoonaboveshortbar: `M0,241 l0,40c399126,0,399993,0,399993,0 +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, +-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 +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 +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 +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, +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, +-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z +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 +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, +-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 +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 +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z` +}, tallDelim = function(e, r) { + switch (e) { + case "lbrack": + return "M403 1759 V84 H666 V0 H319 V1759 v" + r + ` v1759 h347 v-84 +H403z M403 1759 V0 H319 V1759 v` + r + " v1759 h84z"; + case "rbrack": + return "M347 1759 V0 H0 V84 H263 V1759 v" + r + ` v1759 H0 v84 H347z +M347 1759 V0 H263 V1759 v` + r + " v1759 h84z"; + case "vert": + return "M145 15 v585 v" + r + ` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v` + -r + ` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v` + r + " v585 h43z"; + case "doublevert": + return "M145 15 v585 v" + r + ` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v` + -r + ` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v` + r + ` v585 h43z +M367 15 v585 v` + r + ` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v` + -r + ` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v` + r + " v585 h43z"; + case "lfloor": + return "M319 602 V0 H403 V602 v" + r + ` v1715 h263 v84 H319z +MM319 602 V0 H403 V602 v` + r + " v1715 H319z"; + case "rfloor": + return "M319 602 V0 H403 V602 v" + r + ` v1799 H0 v-84 H319z +MM319 602 V0 H403 V602 v` + r + " v1715 H319z"; + case "lceil": + return "M403 1759 V84 H666 V0 H319 V1759 v" + r + ` v602 h84z +M403 1759 V0 H319 V1759 v` + r + " v602 h84z"; + case "rceil": + return "M347 1759 V0 H0 V84 H263 V1759 v" + r + ` v602 h84z +M347 1759 V0 h-84 V1759 v` + r + " 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 +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, +-36,557 l0,` + (r + 84) + `c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210, +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 +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, +-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189 +l0,-` + (r + 92) + `c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3, +-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, +63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5 +c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,` + (r + 9) + ` +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 +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 +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 +c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 +l0,-` + (r + 144) + `c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, +-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."); + } +}; +class DocumentFragment { + // HtmlDomNode + // Never used; needed for satisfying interface. + 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 utils.contains(this.classes, e); + } + /** Convert the fragment into a node. */ + toNode() { + for (var e = document.createDocumentFragment(), r = 0; r < this.children.length; r++) + e.appendChild(this.children[r].toNode()); + return e; + } + /** Convert the fragment into HTML markup. */ + toMarkup() { + for (var e = "", r = 0; r < this.children.length; r++) + e += this.children[r].toMarkup(); + return e; + } + /** + * Converts the math node into a string, similar to innerText. Applies to + * MathDomNode's only. + */ + toText() { + var e = (r) => r.toText(); + return this.children.map(e).join(""); + } +} +var fontMetricsData = { + "AMS-Regular": { + 32: [0, 0, 0, 0, 0.25], + 65: [0, 0.68889, 0, 0, 0.72222], + 66: [0, 0.68889, 0, 0, 0.66667], + 67: [0, 0.68889, 0, 0, 0.72222], + 68: [0, 0.68889, 0, 0, 0.72222], + 69: [0, 0.68889, 0, 0, 0.66667], + 70: [0, 0.68889, 0, 0, 0.61111], + 71: [0, 0.68889, 0, 0, 0.77778], + 72: [0, 0.68889, 0, 0, 0.77778], + 73: [0, 0.68889, 0, 0, 0.38889], + 74: [0.16667, 0.68889, 0, 0, 0.5], + 75: [0, 0.68889, 0, 0, 0.77778], + 76: [0, 0.68889, 0, 0, 0.66667], + 77: [0, 0.68889, 0, 0, 0.94445], + 78: [0, 0.68889, 0, 0, 0.72222], + 79: [0.16667, 0.68889, 0, 0, 0.77778], + 80: [0, 0.68889, 0, 0, 0.61111], + 81: [0.16667, 0.68889, 0, 0, 0.77778], + 82: [0, 0.68889, 0, 0, 0.72222], + 83: [0, 0.68889, 0, 0, 0.55556], + 84: [0, 0.68889, 0, 0, 0.66667], + 85: [0, 0.68889, 0, 0, 0.72222], + 86: [0, 0.68889, 0, 0, 0.72222], + 87: [0, 0.68889, 0, 0, 1], + 88: [0, 0.68889, 0, 0, 0.72222], + 89: [0, 0.68889, 0, 0, 0.72222], + 90: [0, 0.68889, 0, 0, 0.66667], + 107: [0, 0.68889, 0, 0, 0.55556], + 160: [0, 0, 0, 0, 0.25], + 165: [0, 0.675, 0.025, 0, 0.75], + 174: [0.15559, 0.69224, 0, 0, 0.94666], + 240: [0, 0.68889, 0, 0, 0.55556], + 295: [0, 0.68889, 0, 0, 0.54028], + 710: [0, 0.825, 0, 0, 2.33334], + 732: [0, 0.9, 0, 0, 2.33334], + 770: [0, 0.825, 0, 0, 2.33334], + 771: [0, 0.9, 0, 0, 2.33334], + 989: [0.08167, 0.58167, 0, 0, 0.77778], + 1008: [0, 0.43056, 0.04028, 0, 0.66667], + 8245: [0, 0.54986, 0, 0, 0.275], + 8463: [0, 0.68889, 0, 0, 0.54028], + 8487: [0, 0.68889, 0, 0, 0.72222], + 8498: [0, 0.68889, 0, 0, 0.55556], + 8502: [0, 0.68889, 0, 0, 0.66667], + 8503: [0, 0.68889, 0, 0, 0.44445], + 8504: [0, 0.68889, 0, 0, 0.66667], + 8513: [0, 0.68889, 0, 0, 0.63889], + 8592: [-0.03598, 0.46402, 0, 0, 0.5], + 8594: [-0.03598, 0.46402, 0, 0, 0.5], + 8602: [-0.13313, 0.36687, 0, 0, 1], + 8603: [-0.13313, 0.36687, 0, 0, 1], + 8606: [0.01354, 0.52239, 0, 0, 1], + 8608: [0.01354, 0.52239, 0, 0, 1], + 8610: [0.01354, 0.52239, 0, 0, 1.11111], + 8611: [0.01354, 0.52239, 0, 0, 1.11111], + 8619: [0, 0.54986, 0, 0, 1], + 8620: [0, 0.54986, 0, 0, 1], + 8621: [-0.13313, 0.37788, 0, 0, 1.38889], + 8622: [-0.13313, 0.36687, 0, 0, 1], + 8624: [0, 0.69224, 0, 0, 0.5], + 8625: [0, 0.69224, 0, 0, 0.5], + 8630: [0, 0.43056, 0, 0, 1], + 8631: [0, 0.43056, 0, 0, 1], + 8634: [0.08198, 0.58198, 0, 0, 0.77778], + 8635: [0.08198, 0.58198, 0, 0, 0.77778], + 8638: [0.19444, 0.69224, 0, 0, 0.41667], + 8639: [0.19444, 0.69224, 0, 0, 0.41667], + 8642: [0.19444, 0.69224, 0, 0, 0.41667], + 8643: [0.19444, 0.69224, 0, 0, 0.41667], + 8644: [0.1808, 0.675, 0, 0, 1], + 8646: [0.1808, 0.675, 0, 0, 1], + 8647: [0.1808, 0.675, 0, 0, 1], + 8648: [0.19444, 0.69224, 0, 0, 0.83334], + 8649: [0.1808, 0.675, 0, 0, 1], + 8650: [0.19444, 0.69224, 0, 0, 0.83334], + 8651: [0.01354, 0.52239, 0, 0, 1], + 8652: [0.01354, 0.52239, 0, 0, 1], + 8653: [-0.13313, 0.36687, 0, 0, 1], + 8654: [-0.13313, 0.36687, 0, 0, 1], + 8655: [-0.13313, 0.36687, 0, 0, 1], + 8666: [0.13667, 0.63667, 0, 0, 1], + 8667: [0.13667, 0.63667, 0, 0, 1], + 8669: [-0.13313, 0.37788, 0, 0, 1], + 8672: [-0.064, 0.437, 0, 0, 1.334], + 8674: [-0.064, 0.437, 0, 0, 1.334], + 8705: [0, 0.825, 0, 0, 0.5], + 8708: [0, 0.68889, 0, 0, 0.55556], + 8709: [0.08167, 0.58167, 0, 0, 0.77778], + 8717: [0, 0.43056, 0, 0, 0.42917], + 8722: [-0.03598, 0.46402, 0, 0, 0.5], + 8724: [0.08198, 0.69224, 0, 0, 0.77778], + 8726: [0.08167, 0.58167, 0, 0, 0.77778], + 8733: [0, 0.69224, 0, 0, 0.77778], + 8736: [0, 0.69224, 0, 0, 0.72222], + 8737: [0, 0.69224, 0, 0, 0.72222], + 8738: [0.03517, 0.52239, 0, 0, 0.72222], + 8739: [0.08167, 0.58167, 0, 0, 0.22222], + 8740: [0.25142, 0.74111, 0, 0, 0.27778], + 8741: [0.08167, 0.58167, 0, 0, 0.38889], + 8742: [0.25142, 0.74111, 0, 0, 0.5], + 8756: [0, 0.69224, 0, 0, 0.66667], + 8757: [0, 0.69224, 0, 0, 0.66667], + 8764: [-0.13313, 0.36687, 0, 0, 0.77778], + 8765: [-0.13313, 0.37788, 0, 0, 0.77778], + 8769: [-0.13313, 0.36687, 0, 0, 0.77778], + 8770: [-0.03625, 0.46375, 0, 0, 0.77778], + 8774: [0.30274, 0.79383, 0, 0, 0.77778], + 8776: [-0.01688, 0.48312, 0, 0, 0.77778], + 8778: [0.08167, 0.58167, 0, 0, 0.77778], + 8782: [0.06062, 0.54986, 0, 0, 0.77778], + 8783: [0.06062, 0.54986, 0, 0, 0.77778], + 8785: [0.08198, 0.58198, 0, 0, 0.77778], + 8786: [0.08198, 0.58198, 0, 0, 0.77778], + 8787: [0.08198, 0.58198, 0, 0, 0.77778], + 8790: [0, 0.69224, 0, 0, 0.77778], + 8791: [0.22958, 0.72958, 0, 0, 0.77778], + 8796: [0.08198, 0.91667, 0, 0, 0.77778], + 8806: [0.25583, 0.75583, 0, 0, 0.77778], + 8807: [0.25583, 0.75583, 0, 0, 0.77778], + 8808: [0.25142, 0.75726, 0, 0, 0.77778], + 8809: [0.25142, 0.75726, 0, 0, 0.77778], + 8812: [0.25583, 0.75583, 0, 0, 0.5], + 8814: [0.20576, 0.70576, 0, 0, 0.77778], + 8815: [0.20576, 0.70576, 0, 0, 0.77778], + 8816: [0.30274, 0.79383, 0, 0, 0.77778], + 8817: [0.30274, 0.79383, 0, 0, 0.77778], + 8818: [0.22958, 0.72958, 0, 0, 0.77778], + 8819: [0.22958, 0.72958, 0, 0, 0.77778], + 8822: [0.1808, 0.675, 0, 0, 0.77778], + 8823: [0.1808, 0.675, 0, 0, 0.77778], + 8828: [0.13667, 0.63667, 0, 0, 0.77778], + 8829: [0.13667, 0.63667, 0, 0, 0.77778], + 8830: [0.22958, 0.72958, 0, 0, 0.77778], + 8831: [0.22958, 0.72958, 0, 0, 0.77778], + 8832: [0.20576, 0.70576, 0, 0, 0.77778], + 8833: [0.20576, 0.70576, 0, 0, 0.77778], + 8840: [0.30274, 0.79383, 0, 0, 0.77778], + 8841: [0.30274, 0.79383, 0, 0, 0.77778], + 8842: [0.13597, 0.63597, 0, 0, 0.77778], + 8843: [0.13597, 0.63597, 0, 0, 0.77778], + 8847: [0.03517, 0.54986, 0, 0, 0.77778], + 8848: [0.03517, 0.54986, 0, 0, 0.77778], + 8858: [0.08198, 0.58198, 0, 0, 0.77778], + 8859: [0.08198, 0.58198, 0, 0, 0.77778], + 8861: [0.08198, 0.58198, 0, 0, 0.77778], + 8862: [0, 0.675, 0, 0, 0.77778], + 8863: [0, 0.675, 0, 0, 0.77778], + 8864: [0, 0.675, 0, 0, 0.77778], + 8865: [0, 0.675, 0, 0, 0.77778], + 8872: [0, 0.69224, 0, 0, 0.61111], + 8873: [0, 0.69224, 0, 0, 0.72222], + 8874: [0, 0.69224, 0, 0, 0.88889], + 8876: [0, 0.68889, 0, 0, 0.61111], + 8877: [0, 0.68889, 0, 0, 0.61111], + 8878: [0, 0.68889, 0, 0, 0.72222], + 8879: [0, 0.68889, 0, 0, 0.72222], + 8882: [0.03517, 0.54986, 0, 0, 0.77778], + 8883: [0.03517, 0.54986, 0, 0, 0.77778], + 8884: [0.13667, 0.63667, 0, 0, 0.77778], + 8885: [0.13667, 0.63667, 0, 0, 0.77778], + 8888: [0, 0.54986, 0, 0, 1.11111], + 8890: [0.19444, 0.43056, 0, 0, 0.55556], + 8891: [0.19444, 0.69224, 0, 0, 0.61111], + 8892: [0.19444, 0.69224, 0, 0, 0.61111], + 8901: [0, 0.54986, 0, 0, 0.27778], + 8903: [0.08167, 0.58167, 0, 0, 0.77778], + 8905: [0.08167, 0.58167, 0, 0, 0.77778], + 8906: [0.08167, 0.58167, 0, 0, 0.77778], + 8907: [0, 0.69224, 0, 0, 0.77778], + 8908: [0, 0.69224, 0, 0, 0.77778], + 8909: [-0.03598, 0.46402, 0, 0, 0.77778], + 8910: [0, 0.54986, 0, 0, 0.76042], + 8911: [0, 0.54986, 0, 0, 0.76042], + 8912: [0.03517, 0.54986, 0, 0, 0.77778], + 8913: [0.03517, 0.54986, 0, 0, 0.77778], + 8914: [0, 0.54986, 0, 0, 0.66667], + 8915: [0, 0.54986, 0, 0, 0.66667], + 8916: [0, 0.69224, 0, 0, 0.66667], + 8918: [0.0391, 0.5391, 0, 0, 0.77778], + 8919: [0.0391, 0.5391, 0, 0, 0.77778], + 8920: [0.03517, 0.54986, 0, 0, 1.33334], + 8921: [0.03517, 0.54986, 0, 0, 1.33334], + 8922: [0.38569, 0.88569, 0, 0, 0.77778], + 8923: [0.38569, 0.88569, 0, 0, 0.77778], + 8926: [0.13667, 0.63667, 0, 0, 0.77778], + 8927: [0.13667, 0.63667, 0, 0, 0.77778], + 8928: [0.30274, 0.79383, 0, 0, 0.77778], + 8929: [0.30274, 0.79383, 0, 0, 0.77778], + 8934: [0.23222, 0.74111, 0, 0, 0.77778], + 8935: [0.23222, 0.74111, 0, 0, 0.77778], + 8936: [0.23222, 0.74111, 0, 0, 0.77778], + 8937: [0.23222, 0.74111, 0, 0, 0.77778], + 8938: [0.20576, 0.70576, 0, 0, 0.77778], + 8939: [0.20576, 0.70576, 0, 0, 0.77778], + 8940: [0.30274, 0.79383, 0, 0, 0.77778], + 8941: [0.30274, 0.79383, 0, 0, 0.77778], + 8994: [0.19444, 0.69224, 0, 0, 0.77778], + 8995: [0.19444, 0.69224, 0, 0, 0.77778], + 9416: [0.15559, 0.69224, 0, 0, 0.90222], + 9484: [0, 0.69224, 0, 0, 0.5], + 9488: [0, 0.69224, 0, 0, 0.5], + 9492: [0, 0.37788, 0, 0, 0.5], + 9496: [0, 0.37788, 0, 0, 0.5], + 9585: [0.19444, 0.68889, 0, 0, 0.88889], + 9586: [0.19444, 0.74111, 0, 0, 0.88889], + 9632: [0, 0.675, 0, 0, 0.77778], + 9633: [0, 0.675, 0, 0, 0.77778], + 9650: [0, 0.54986, 0, 0, 0.72222], + 9651: [0, 0.54986, 0, 0, 0.72222], + 9654: [0.03517, 0.54986, 0, 0, 0.77778], + 9660: [0, 0.54986, 0, 0, 0.72222], + 9661: [0, 0.54986, 0, 0, 0.72222], + 9664: [0.03517, 0.54986, 0, 0, 0.77778], + 9674: [0.11111, 0.69224, 0, 0, 0.66667], + 9733: [0.19444, 0.69224, 0, 0, 0.94445], + 10003: [0, 0.69224, 0, 0, 0.83334], + 10016: [0, 0.69224, 0, 0, 0.83334], + 10731: [0.11111, 0.69224, 0, 0, 0.66667], + 10846: [0.19444, 0.75583, 0, 0, 0.61111], + 10877: [0.13667, 0.63667, 0, 0, 0.77778], + 10878: [0.13667, 0.63667, 0, 0, 0.77778], + 10885: [0.25583, 0.75583, 0, 0, 0.77778], + 10886: [0.25583, 0.75583, 0, 0, 0.77778], + 10887: [0.13597, 0.63597, 0, 0, 0.77778], + 10888: [0.13597, 0.63597, 0, 0, 0.77778], + 10889: [0.26167, 0.75726, 0, 0, 0.77778], + 10890: [0.26167, 0.75726, 0, 0, 0.77778], + 10891: [0.48256, 0.98256, 0, 0, 0.77778], + 10892: [0.48256, 0.98256, 0, 0, 0.77778], + 10901: [0.13667, 0.63667, 0, 0, 0.77778], + 10902: [0.13667, 0.63667, 0, 0, 0.77778], + 10933: [0.25142, 0.75726, 0, 0, 0.77778], + 10934: [0.25142, 0.75726, 0, 0, 0.77778], + 10935: [0.26167, 0.75726, 0, 0, 0.77778], + 10936: [0.26167, 0.75726, 0, 0, 0.77778], + 10937: [0.26167, 0.75726, 0, 0, 0.77778], + 10938: [0.26167, 0.75726, 0, 0, 0.77778], + 10949: [0.25583, 0.75583, 0, 0, 0.77778], + 10950: [0.25583, 0.75583, 0, 0, 0.77778], + 10955: [0.28481, 0.79383, 0, 0, 0.77778], + 10956: [0.28481, 0.79383, 0, 0, 0.77778], + 57350: [0.08167, 0.58167, 0, 0, 0.22222], + 57351: [0.08167, 0.58167, 0, 0, 0.38889], + 57352: [0.08167, 0.58167, 0, 0, 0.77778], + 57353: [0, 0.43056, 0.04028, 0, 0.66667], + 57356: [0.25142, 0.75726, 0, 0, 0.77778], + 57357: [0.25142, 0.75726, 0, 0, 0.77778], + 57358: [0.41951, 0.91951, 0, 0, 0.77778], + 57359: [0.30274, 0.79383, 0, 0, 0.77778], + 57360: [0.30274, 0.79383, 0, 0, 0.77778], + 57361: [0.41951, 0.91951, 0, 0, 0.77778], + 57366: [0.25142, 0.75726, 0, 0, 0.77778], + 57367: [0.25142, 0.75726, 0, 0, 0.77778], + 57368: [0.25142, 0.75726, 0, 0, 0.77778], + 57369: [0.25142, 0.75726, 0, 0, 0.77778], + 57370: [0.13597, 0.63597, 0, 0, 0.77778], + 57371: [0.13597, 0.63597, 0, 0, 0.77778] + }, + "Caligraphic-Regular": { + 32: [0, 0, 0, 0, 0.25], + 65: [0, 0.68333, 0, 0.19445, 0.79847], + 66: [0, 0.68333, 0.03041, 0.13889, 0.65681], + 67: [0, 0.68333, 0.05834, 0.13889, 0.52653], + 68: [0, 0.68333, 0.02778, 0.08334, 0.77139], + 69: [0, 0.68333, 0.08944, 0.11111, 0.52778], + 70: [0, 0.68333, 0.09931, 0.11111, 0.71875], + 71: [0.09722, 0.68333, 0.0593, 0.11111, 0.59487], + 72: [0, 0.68333, 965e-5, 0.11111, 0.84452], + 73: [0, 0.68333, 0.07382, 0, 0.54452], + 74: [0.09722, 0.68333, 0.18472, 0.16667, 0.67778], + 75: [0, 0.68333, 0.01445, 0.05556, 0.76195], + 76: [0, 0.68333, 0, 0.13889, 0.68972], + 77: [0, 0.68333, 0, 0.13889, 1.2009], + 78: [0, 0.68333, 0.14736, 0.08334, 0.82049], + 79: [0, 0.68333, 0.02778, 0.11111, 0.79611], + 80: [0, 0.68333, 0.08222, 0.08334, 0.69556], + 81: [0.09722, 0.68333, 0, 0.11111, 0.81667], + 82: [0, 0.68333, 0, 0.08334, 0.8475], + 83: [0, 0.68333, 0.075, 0.13889, 0.60556], + 84: [0, 0.68333, 0.25417, 0, 0.54464], + 85: [0, 0.68333, 0.09931, 0.08334, 0.62583], + 86: [0, 0.68333, 0.08222, 0, 0.61278], + 87: [0, 0.68333, 0.08222, 0.08334, 0.98778], + 88: [0, 0.68333, 0.14643, 0.13889, 0.7133], + 89: [0.09722, 0.68333, 0.08222, 0.08334, 0.66834], + 90: [0, 0.68333, 0.07944, 0.13889, 0.72473], + 160: [0, 0, 0, 0, 0.25] + }, + "Fraktur-Regular": { + 32: [0, 0, 0, 0, 0.25], + 33: [0, 0.69141, 0, 0, 0.29574], + 34: [0, 0.69141, 0, 0, 0.21471], + 38: [0, 0.69141, 0, 0, 0.73786], + 39: [0, 0.69141, 0, 0, 0.21201], + 40: [0.24982, 0.74947, 0, 0, 0.38865], + 41: [0.24982, 0.74947, 0, 0, 0.38865], + 42: [0, 0.62119, 0, 0, 0.27764], + 43: [0.08319, 0.58283, 0, 0, 0.75623], + 44: [0, 0.10803, 0, 0, 0.27764], + 45: [0.08319, 0.58283, 0, 0, 0.75623], + 46: [0, 0.10803, 0, 0, 0.27764], + 47: [0.24982, 0.74947, 0, 0, 0.50181], + 48: [0, 0.47534, 0, 0, 0.50181], + 49: [0, 0.47534, 0, 0, 0.50181], + 50: [0, 0.47534, 0, 0, 0.50181], + 51: [0.18906, 0.47534, 0, 0, 0.50181], + 52: [0.18906, 0.47534, 0, 0, 0.50181], + 53: [0.18906, 0.47534, 0, 0, 0.50181], + 54: [0, 0.69141, 0, 0, 0.50181], + 55: [0.18906, 0.47534, 0, 0, 0.50181], + 56: [0, 0.69141, 0, 0, 0.50181], + 57: [0.18906, 0.47534, 0, 0, 0.50181], + 58: [0, 0.47534, 0, 0, 0.21606], + 59: [0.12604, 0.47534, 0, 0, 0.21606], + 61: [-0.13099, 0.36866, 0, 0, 0.75623], + 63: [0, 0.69141, 0, 0, 0.36245], + 65: [0, 0.69141, 0, 0, 0.7176], + 66: [0, 0.69141, 0, 0, 0.88397], + 67: [0, 0.69141, 0, 0, 0.61254], + 68: [0, 0.69141, 0, 0, 0.83158], + 69: [0, 0.69141, 0, 0, 0.66278], + 70: [0.12604, 0.69141, 0, 0, 0.61119], + 71: [0, 0.69141, 0, 0, 0.78539], + 72: [0.06302, 0.69141, 0, 0, 0.7203], + 73: [0, 0.69141, 0, 0, 0.55448], + 74: [0.12604, 0.69141, 0, 0, 0.55231], + 75: [0, 0.69141, 0, 0, 0.66845], + 76: [0, 0.69141, 0, 0, 0.66602], + 77: [0, 0.69141, 0, 0, 1.04953], + 78: [0, 0.69141, 0, 0, 0.83212], + 79: [0, 0.69141, 0, 0, 0.82699], + 80: [0.18906, 0.69141, 0, 0, 0.82753], + 81: [0.03781, 0.69141, 0, 0, 0.82699], + 82: [0, 0.69141, 0, 0, 0.82807], + 83: [0, 0.69141, 0, 0, 0.82861], + 84: [0, 0.69141, 0, 0, 0.66899], + 85: [0, 0.69141, 0, 0, 0.64576], + 86: [0, 0.69141, 0, 0, 0.83131], + 87: [0, 0.69141, 0, 0, 1.04602], + 88: [0, 0.69141, 0, 0, 0.71922], + 89: [0.18906, 0.69141, 0, 0, 0.83293], + 90: [0.12604, 0.69141, 0, 0, 0.60201], + 91: [0.24982, 0.74947, 0, 0, 0.27764], + 93: [0.24982, 0.74947, 0, 0, 0.27764], + 94: [0, 0.69141, 0, 0, 0.49965], + 97: [0, 0.47534, 0, 0, 0.50046], + 98: [0, 0.69141, 0, 0, 0.51315], + 99: [0, 0.47534, 0, 0, 0.38946], + 100: [0, 0.62119, 0, 0, 0.49857], + 101: [0, 0.47534, 0, 0, 0.40053], + 102: [0.18906, 0.69141, 0, 0, 0.32626], + 103: [0.18906, 0.47534, 0, 0, 0.5037], + 104: [0.18906, 0.69141, 0, 0, 0.52126], + 105: [0, 0.69141, 0, 0, 0.27899], + 106: [0, 0.69141, 0, 0, 0.28088], + 107: [0, 0.69141, 0, 0, 0.38946], + 108: [0, 0.69141, 0, 0, 0.27953], + 109: [0, 0.47534, 0, 0, 0.76676], + 110: [0, 0.47534, 0, 0, 0.52666], + 111: [0, 0.47534, 0, 0, 0.48885], + 112: [0.18906, 0.52396, 0, 0, 0.50046], + 113: [0.18906, 0.47534, 0, 0, 0.48912], + 114: [0, 0.47534, 0, 0, 0.38919], + 115: [0, 0.47534, 0, 0, 0.44266], + 116: [0, 0.62119, 0, 0, 0.33301], + 117: [0, 0.47534, 0, 0, 0.5172], + 118: [0, 0.52396, 0, 0, 0.5118], + 119: [0, 0.52396, 0, 0, 0.77351], + 120: [0.18906, 0.47534, 0, 0, 0.38865], + 121: [0.18906, 0.47534, 0, 0, 0.49884], + 122: [0.18906, 0.47534, 0, 0, 0.39054], + 160: [0, 0, 0, 0, 0.25], + 8216: [0, 0.69141, 0, 0, 0.21471], + 8217: [0, 0.69141, 0, 0, 0.21471], + 58112: [0, 0.62119, 0, 0, 0.49749], + 58113: [0, 0.62119, 0, 0, 0.4983], + 58114: [0.18906, 0.69141, 0, 0, 0.33328], + 58115: [0.18906, 0.69141, 0, 0, 0.32923], + 58116: [0.18906, 0.47534, 0, 0, 0.50343], + 58117: [0, 0.69141, 0, 0, 0.33301], + 58118: [0, 0.62119, 0, 0, 0.33409], + 58119: [0, 0.47534, 0, 0, 0.50073] + }, + "Main-Bold": { + 32: [0, 0, 0, 0, 0.25], + 33: [0, 0.69444, 0, 0, 0.35], + 34: [0, 0.69444, 0, 0, 0.60278], + 35: [0.19444, 0.69444, 0, 0, 0.95833], + 36: [0.05556, 0.75, 0, 0, 0.575], + 37: [0.05556, 0.75, 0, 0, 0.95833], + 38: [0, 0.69444, 0, 0, 0.89444], + 39: [0, 0.69444, 0, 0, 0.31944], + 40: [0.25, 0.75, 0, 0, 0.44722], + 41: [0.25, 0.75, 0, 0, 0.44722], + 42: [0, 0.75, 0, 0, 0.575], + 43: [0.13333, 0.63333, 0, 0, 0.89444], + 44: [0.19444, 0.15556, 0, 0, 0.31944], + 45: [0, 0.44444, 0, 0, 0.38333], + 46: [0, 0.15556, 0, 0, 0.31944], + 47: [0.25, 0.75, 0, 0, 0.575], + 48: [0, 0.64444, 0, 0, 0.575], + 49: [0, 0.64444, 0, 0, 0.575], + 50: [0, 0.64444, 0, 0, 0.575], + 51: [0, 0.64444, 0, 0, 0.575], + 52: [0, 0.64444, 0, 0, 0.575], + 53: [0, 0.64444, 0, 0, 0.575], + 54: [0, 0.64444, 0, 0, 0.575], + 55: [0, 0.64444, 0, 0, 0.575], + 56: [0, 0.64444, 0, 0, 0.575], + 57: [0, 0.64444, 0, 0, 0.575], + 58: [0, 0.44444, 0, 0, 0.31944], + 59: [0.19444, 0.44444, 0, 0, 0.31944], + 60: [0.08556, 0.58556, 0, 0, 0.89444], + 61: [-0.10889, 0.39111, 0, 0, 0.89444], + 62: [0.08556, 0.58556, 0, 0, 0.89444], + 63: [0, 0.69444, 0, 0, 0.54305], + 64: [0, 0.69444, 0, 0, 0.89444], + 65: [0, 0.68611, 0, 0, 0.86944], + 66: [0, 0.68611, 0, 0, 0.81805], + 67: [0, 0.68611, 0, 0, 0.83055], + 68: [0, 0.68611, 0, 0, 0.88194], + 69: [0, 0.68611, 0, 0, 0.75555], + 70: [0, 0.68611, 0, 0, 0.72361], + 71: [0, 0.68611, 0, 0, 0.90416], + 72: [0, 0.68611, 0, 0, 0.9], + 73: [0, 0.68611, 0, 0, 0.43611], + 74: [0, 0.68611, 0, 0, 0.59444], + 75: [0, 0.68611, 0, 0, 0.90138], + 76: [0, 0.68611, 0, 0, 0.69166], + 77: [0, 0.68611, 0, 0, 1.09166], + 78: [0, 0.68611, 0, 0, 0.9], + 79: [0, 0.68611, 0, 0, 0.86388], + 80: [0, 0.68611, 0, 0, 0.78611], + 81: [0.19444, 0.68611, 0, 0, 0.86388], + 82: [0, 0.68611, 0, 0, 0.8625], + 83: [0, 0.68611, 0, 0, 0.63889], + 84: [0, 0.68611, 0, 0, 0.8], + 85: [0, 0.68611, 0, 0, 0.88472], + 86: [0, 0.68611, 0.01597, 0, 0.86944], + 87: [0, 0.68611, 0.01597, 0, 1.18888], + 88: [0, 0.68611, 0, 0, 0.86944], + 89: [0, 0.68611, 0.02875, 0, 0.86944], + 90: [0, 0.68611, 0, 0, 0.70277], + 91: [0.25, 0.75, 0, 0, 0.31944], + 92: [0.25, 0.75, 0, 0, 0.575], + 93: [0.25, 0.75, 0, 0, 0.31944], + 94: [0, 0.69444, 0, 0, 0.575], + 95: [0.31, 0.13444, 0.03194, 0, 0.575], + 97: [0, 0.44444, 0, 0, 0.55902], + 98: [0, 0.69444, 0, 0, 0.63889], + 99: [0, 0.44444, 0, 0, 0.51111], + 100: [0, 0.69444, 0, 0, 0.63889], + 101: [0, 0.44444, 0, 0, 0.52708], + 102: [0, 0.69444, 0.10903, 0, 0.35139], + 103: [0.19444, 0.44444, 0.01597, 0, 0.575], + 104: [0, 0.69444, 0, 0, 0.63889], + 105: [0, 0.69444, 0, 0, 0.31944], + 106: [0.19444, 0.69444, 0, 0, 0.35139], + 107: [0, 0.69444, 0, 0, 0.60694], + 108: [0, 0.69444, 0, 0, 0.31944], + 109: [0, 0.44444, 0, 0, 0.95833], + 110: [0, 0.44444, 0, 0, 0.63889], + 111: [0, 0.44444, 0, 0, 0.575], + 112: [0.19444, 0.44444, 0, 0, 0.63889], + 113: [0.19444, 0.44444, 0, 0, 0.60694], + 114: [0, 0.44444, 0, 0, 0.47361], + 115: [0, 0.44444, 0, 0, 0.45361], + 116: [0, 0.63492, 0, 0, 0.44722], + 117: [0, 0.44444, 0, 0, 0.63889], + 118: [0, 0.44444, 0.01597, 0, 0.60694], + 119: [0, 0.44444, 0.01597, 0, 0.83055], + 120: [0, 0.44444, 0, 0, 0.60694], + 121: [0.19444, 0.44444, 0.01597, 0, 0.60694], + 122: [0, 0.44444, 0, 0, 0.51111], + 123: [0.25, 0.75, 0, 0, 0.575], + 124: [0.25, 0.75, 0, 0, 0.31944], + 125: [0.25, 0.75, 0, 0, 0.575], + 126: [0.35, 0.34444, 0, 0, 0.575], + 160: [0, 0, 0, 0, 0.25], + 163: [0, 0.69444, 0, 0, 0.86853], + 168: [0, 0.69444, 0, 0, 0.575], + 172: [0, 0.44444, 0, 0, 0.76666], + 176: [0, 0.69444, 0, 0, 0.86944], + 177: [0.13333, 0.63333, 0, 0, 0.89444], + 184: [0.17014, 0, 0, 0, 0.51111], + 198: [0, 0.68611, 0, 0, 1.04166], + 215: [0.13333, 0.63333, 0, 0, 0.89444], + 216: [0.04861, 0.73472, 0, 0, 0.89444], + 223: [0, 0.69444, 0, 0, 0.59722], + 230: [0, 0.44444, 0, 0, 0.83055], + 247: [0.13333, 0.63333, 0, 0, 0.89444], + 248: [0.09722, 0.54167, 0, 0, 0.575], + 305: [0, 0.44444, 0, 0, 0.31944], + 338: [0, 0.68611, 0, 0, 1.16944], + 339: [0, 0.44444, 0, 0, 0.89444], + 567: [0.19444, 0.44444, 0, 0, 0.35139], + 710: [0, 0.69444, 0, 0, 0.575], + 711: [0, 0.63194, 0, 0, 0.575], + 713: [0, 0.59611, 0, 0, 0.575], + 714: [0, 0.69444, 0, 0, 0.575], + 715: [0, 0.69444, 0, 0, 0.575], + 728: [0, 0.69444, 0, 0, 0.575], + 729: [0, 0.69444, 0, 0, 0.31944], + 730: [0, 0.69444, 0, 0, 0.86944], + 732: [0, 0.69444, 0, 0, 0.575], + 733: [0, 0.69444, 0, 0, 0.575], + 915: [0, 0.68611, 0, 0, 0.69166], + 916: [0, 0.68611, 0, 0, 0.95833], + 920: [0, 0.68611, 0, 0, 0.89444], + 923: [0, 0.68611, 0, 0, 0.80555], + 926: [0, 0.68611, 0, 0, 0.76666], + 928: [0, 0.68611, 0, 0, 0.9], + 931: [0, 0.68611, 0, 0, 0.83055], + 933: [0, 0.68611, 0, 0, 0.89444], + 934: [0, 0.68611, 0, 0, 0.83055], + 936: [0, 0.68611, 0, 0, 0.89444], + 937: [0, 0.68611, 0, 0, 0.83055], + 8211: [0, 0.44444, 0.03194, 0, 0.575], + 8212: [0, 0.44444, 0.03194, 0, 1.14999], + 8216: [0, 0.69444, 0, 0, 0.31944], + 8217: [0, 0.69444, 0, 0, 0.31944], + 8220: [0, 0.69444, 0, 0, 0.60278], + 8221: [0, 0.69444, 0, 0, 0.60278], + 8224: [0.19444, 0.69444, 0, 0, 0.51111], + 8225: [0.19444, 0.69444, 0, 0, 0.51111], + 8242: [0, 0.55556, 0, 0, 0.34444], + 8407: [0, 0.72444, 0.15486, 0, 0.575], + 8463: [0, 0.69444, 0, 0, 0.66759], + 8465: [0, 0.69444, 0, 0, 0.83055], + 8467: [0, 0.69444, 0, 0, 0.47361], + 8472: [0.19444, 0.44444, 0, 0, 0.74027], + 8476: [0, 0.69444, 0, 0, 0.83055], + 8501: [0, 0.69444, 0, 0, 0.70277], + 8592: [-0.10889, 0.39111, 0, 0, 1.14999], + 8593: [0.19444, 0.69444, 0, 0, 0.575], + 8594: [-0.10889, 0.39111, 0, 0, 1.14999], + 8595: [0.19444, 0.69444, 0, 0, 0.575], + 8596: [-0.10889, 0.39111, 0, 0, 1.14999], + 8597: [0.25, 0.75, 0, 0, 0.575], + 8598: [0.19444, 0.69444, 0, 0, 1.14999], + 8599: [0.19444, 0.69444, 0, 0, 1.14999], + 8600: [0.19444, 0.69444, 0, 0, 1.14999], + 8601: [0.19444, 0.69444, 0, 0, 1.14999], + 8636: [-0.10889, 0.39111, 0, 0, 1.14999], + 8637: [-0.10889, 0.39111, 0, 0, 1.14999], + 8640: [-0.10889, 0.39111, 0, 0, 1.14999], + 8641: [-0.10889, 0.39111, 0, 0, 1.14999], + 8656: [-0.10889, 0.39111, 0, 0, 1.14999], + 8657: [0.19444, 0.69444, 0, 0, 0.70277], + 8658: [-0.10889, 0.39111, 0, 0, 1.14999], + 8659: [0.19444, 0.69444, 0, 0, 0.70277], + 8660: [-0.10889, 0.39111, 0, 0, 1.14999], + 8661: [0.25, 0.75, 0, 0, 0.70277], + 8704: [0, 0.69444, 0, 0, 0.63889], + 8706: [0, 0.69444, 0.06389, 0, 0.62847], + 8707: [0, 0.69444, 0, 0, 0.63889], + 8709: [0.05556, 0.75, 0, 0, 0.575], + 8711: [0, 0.68611, 0, 0, 0.95833], + 8712: [0.08556, 0.58556, 0, 0, 0.76666], + 8715: [0.08556, 0.58556, 0, 0, 0.76666], + 8722: [0.13333, 0.63333, 0, 0, 0.89444], + 8723: [0.13333, 0.63333, 0, 0, 0.89444], + 8725: [0.25, 0.75, 0, 0, 0.575], + 8726: [0.25, 0.75, 0, 0, 0.575], + 8727: [-0.02778, 0.47222, 0, 0, 0.575], + 8728: [-0.02639, 0.47361, 0, 0, 0.575], + 8729: [-0.02639, 0.47361, 0, 0, 0.575], + 8730: [0.18, 0.82, 0, 0, 0.95833], + 8733: [0, 0.44444, 0, 0, 0.89444], + 8734: [0, 0.44444, 0, 0, 1.14999], + 8736: [0, 0.69224, 0, 0, 0.72222], + 8739: [0.25, 0.75, 0, 0, 0.31944], + 8741: [0.25, 0.75, 0, 0, 0.575], + 8743: [0, 0.55556, 0, 0, 0.76666], + 8744: [0, 0.55556, 0, 0, 0.76666], + 8745: [0, 0.55556, 0, 0, 0.76666], + 8746: [0, 0.55556, 0, 0, 0.76666], + 8747: [0.19444, 0.69444, 0.12778, 0, 0.56875], + 8764: [-0.10889, 0.39111, 0, 0, 0.89444], + 8768: [0.19444, 0.69444, 0, 0, 0.31944], + 8771: [222e-5, 0.50222, 0, 0, 0.89444], + 8773: [0.027, 0.638, 0, 0, 0.894], + 8776: [0.02444, 0.52444, 0, 0, 0.89444], + 8781: [222e-5, 0.50222, 0, 0, 0.89444], + 8801: [222e-5, 0.50222, 0, 0, 0.89444], + 8804: [0.19667, 0.69667, 0, 0, 0.89444], + 8805: [0.19667, 0.69667, 0, 0, 0.89444], + 8810: [0.08556, 0.58556, 0, 0, 1.14999], + 8811: [0.08556, 0.58556, 0, 0, 1.14999], + 8826: [0.08556, 0.58556, 0, 0, 0.89444], + 8827: [0.08556, 0.58556, 0, 0, 0.89444], + 8834: [0.08556, 0.58556, 0, 0, 0.89444], + 8835: [0.08556, 0.58556, 0, 0, 0.89444], + 8838: [0.19667, 0.69667, 0, 0, 0.89444], + 8839: [0.19667, 0.69667, 0, 0, 0.89444], + 8846: [0, 0.55556, 0, 0, 0.76666], + 8849: [0.19667, 0.69667, 0, 0, 0.89444], + 8850: [0.19667, 0.69667, 0, 0, 0.89444], + 8851: [0, 0.55556, 0, 0, 0.76666], + 8852: [0, 0.55556, 0, 0, 0.76666], + 8853: [0.13333, 0.63333, 0, 0, 0.89444], + 8854: [0.13333, 0.63333, 0, 0, 0.89444], + 8855: [0.13333, 0.63333, 0, 0, 0.89444], + 8856: [0.13333, 0.63333, 0, 0, 0.89444], + 8857: [0.13333, 0.63333, 0, 0, 0.89444], + 8866: [0, 0.69444, 0, 0, 0.70277], + 8867: [0, 0.69444, 0, 0, 0.70277], + 8868: [0, 0.69444, 0, 0, 0.89444], + 8869: [0, 0.69444, 0, 0, 0.89444], + 8900: [-0.02639, 0.47361, 0, 0, 0.575], + 8901: [-0.02639, 0.47361, 0, 0, 0.31944], + 8902: [-0.02778, 0.47222, 0, 0, 0.575], + 8968: [0.25, 0.75, 0, 0, 0.51111], + 8969: [0.25, 0.75, 0, 0, 0.51111], + 8970: [0.25, 0.75, 0, 0, 0.51111], + 8971: [0.25, 0.75, 0, 0, 0.51111], + 8994: [-0.13889, 0.36111, 0, 0, 1.14999], + 8995: [-0.13889, 0.36111, 0, 0, 1.14999], + 9651: [0.19444, 0.69444, 0, 0, 1.02222], + 9657: [-0.02778, 0.47222, 0, 0, 0.575], + 9661: [0.19444, 0.69444, 0, 0, 1.02222], + 9667: [-0.02778, 0.47222, 0, 0, 0.575], + 9711: [0.19444, 0.69444, 0, 0, 1.14999], + 9824: [0.12963, 0.69444, 0, 0, 0.89444], + 9825: [0.12963, 0.69444, 0, 0, 0.89444], + 9826: [0.12963, 0.69444, 0, 0, 0.89444], + 9827: [0.12963, 0.69444, 0, 0, 0.89444], + 9837: [0, 0.75, 0, 0, 0.44722], + 9838: [0.19444, 0.69444, 0, 0, 0.44722], + 9839: [0.19444, 0.69444, 0, 0, 0.44722], + 10216: [0.25, 0.75, 0, 0, 0.44722], + 10217: [0.25, 0.75, 0, 0, 0.44722], + 10815: [0, 0.68611, 0, 0, 0.9], + 10927: [0.19667, 0.69667, 0, 0, 0.89444], + 10928: [0.19667, 0.69667, 0, 0, 0.89444], + 57376: [0.19444, 0.69444, 0, 0, 0] + }, + "Main-BoldItalic": { + 32: [0, 0, 0, 0, 0.25], + 33: [0, 0.69444, 0.11417, 0, 0.38611], + 34: [0, 0.69444, 0.07939, 0, 0.62055], + 35: [0.19444, 0.69444, 0.06833, 0, 0.94444], + 37: [0.05556, 0.75, 0.12861, 0, 0.94444], + 38: [0, 0.69444, 0.08528, 0, 0.88555], + 39: [0, 0.69444, 0.12945, 0, 0.35555], + 40: [0.25, 0.75, 0.15806, 0, 0.47333], + 41: [0.25, 0.75, 0.03306, 0, 0.47333], + 42: [0, 0.75, 0.14333, 0, 0.59111], + 43: [0.10333, 0.60333, 0.03306, 0, 0.88555], + 44: [0.19444, 0.14722, 0, 0, 0.35555], + 45: [0, 0.44444, 0.02611, 0, 0.41444], + 46: [0, 0.14722, 0, 0, 0.35555], + 47: [0.25, 0.75, 0.15806, 0, 0.59111], + 48: [0, 0.64444, 0.13167, 0, 0.59111], + 49: [0, 0.64444, 0.13167, 0, 0.59111], + 50: [0, 0.64444, 0.13167, 0, 0.59111], + 51: [0, 0.64444, 0.13167, 0, 0.59111], + 52: [0.19444, 0.64444, 0.13167, 0, 0.59111], + 53: [0, 0.64444, 0.13167, 0, 0.59111], + 54: [0, 0.64444, 0.13167, 0, 0.59111], + 55: [0.19444, 0.64444, 0.13167, 0, 0.59111], + 56: [0, 0.64444, 0.13167, 0, 0.59111], + 57: [0, 0.64444, 0.13167, 0, 0.59111], + 58: [0, 0.44444, 0.06695, 0, 0.35555], + 59: [0.19444, 0.44444, 0.06695, 0, 0.35555], + 61: [-0.10889, 0.39111, 0.06833, 0, 0.88555], + 63: [0, 0.69444, 0.11472, 0, 0.59111], + 64: [0, 0.69444, 0.09208, 0, 0.88555], + 65: [0, 0.68611, 0, 0, 0.86555], + 66: [0, 0.68611, 0.0992, 0, 0.81666], + 67: [0, 0.68611, 0.14208, 0, 0.82666], + 68: [0, 0.68611, 0.09062, 0, 0.87555], + 69: [0, 0.68611, 0.11431, 0, 0.75666], + 70: [0, 0.68611, 0.12903, 0, 0.72722], + 71: [0, 0.68611, 0.07347, 0, 0.89527], + 72: [0, 0.68611, 0.17208, 0, 0.8961], + 73: [0, 0.68611, 0.15681, 0, 0.47166], + 74: [0, 0.68611, 0.145, 0, 0.61055], + 75: [0, 0.68611, 0.14208, 0, 0.89499], + 76: [0, 0.68611, 0, 0, 0.69777], + 77: [0, 0.68611, 0.17208, 0, 1.07277], + 78: [0, 0.68611, 0.17208, 0, 0.8961], + 79: [0, 0.68611, 0.09062, 0, 0.85499], + 80: [0, 0.68611, 0.0992, 0, 0.78721], + 81: [0.19444, 0.68611, 0.09062, 0, 0.85499], + 82: [0, 0.68611, 0.02559, 0, 0.85944], + 83: [0, 0.68611, 0.11264, 0, 0.64999], + 84: [0, 0.68611, 0.12903, 0, 0.7961], + 85: [0, 0.68611, 0.17208, 0, 0.88083], + 86: [0, 0.68611, 0.18625, 0, 0.86555], + 87: [0, 0.68611, 0.18625, 0, 1.15999], + 88: [0, 0.68611, 0.15681, 0, 0.86555], + 89: [0, 0.68611, 0.19803, 0, 0.86555], + 90: [0, 0.68611, 0.14208, 0, 0.70888], + 91: [0.25, 0.75, 0.1875, 0, 0.35611], + 93: [0.25, 0.75, 0.09972, 0, 0.35611], + 94: [0, 0.69444, 0.06709, 0, 0.59111], + 95: [0.31, 0.13444, 0.09811, 0, 0.59111], + 97: [0, 0.44444, 0.09426, 0, 0.59111], + 98: [0, 0.69444, 0.07861, 0, 0.53222], + 99: [0, 0.44444, 0.05222, 0, 0.53222], + 100: [0, 0.69444, 0.10861, 0, 0.59111], + 101: [0, 0.44444, 0.085, 0, 0.53222], + 102: [0.19444, 0.69444, 0.21778, 0, 0.4], + 103: [0.19444, 0.44444, 0.105, 0, 0.53222], + 104: [0, 0.69444, 0.09426, 0, 0.59111], + 105: [0, 0.69326, 0.11387, 0, 0.35555], + 106: [0.19444, 0.69326, 0.1672, 0, 0.35555], + 107: [0, 0.69444, 0.11111, 0, 0.53222], + 108: [0, 0.69444, 0.10861, 0, 0.29666], + 109: [0, 0.44444, 0.09426, 0, 0.94444], + 110: [0, 0.44444, 0.09426, 0, 0.64999], + 111: [0, 0.44444, 0.07861, 0, 0.59111], + 112: [0.19444, 0.44444, 0.07861, 0, 0.59111], + 113: [0.19444, 0.44444, 0.105, 0, 0.53222], + 114: [0, 0.44444, 0.11111, 0, 0.50167], + 115: [0, 0.44444, 0.08167, 0, 0.48694], + 116: [0, 0.63492, 0.09639, 0, 0.385], + 117: [0, 0.44444, 0.09426, 0, 0.62055], + 118: [0, 0.44444, 0.11111, 0, 0.53222], + 119: [0, 0.44444, 0.11111, 0, 0.76777], + 120: [0, 0.44444, 0.12583, 0, 0.56055], + 121: [0.19444, 0.44444, 0.105, 0, 0.56166], + 122: [0, 0.44444, 0.13889, 0, 0.49055], + 126: [0.35, 0.34444, 0.11472, 0, 0.59111], + 160: [0, 0, 0, 0, 0.25], + 168: [0, 0.69444, 0.11473, 0, 0.59111], + 176: [0, 0.69444, 0, 0, 0.94888], + 184: [0.17014, 0, 0, 0, 0.53222], + 198: [0, 0.68611, 0.11431, 0, 1.02277], + 216: [0.04861, 0.73472, 0.09062, 0, 0.88555], + 223: [0.19444, 0.69444, 0.09736, 0, 0.665], + 230: [0, 0.44444, 0.085, 0, 0.82666], + 248: [0.09722, 0.54167, 0.09458, 0, 0.59111], + 305: [0, 0.44444, 0.09426, 0, 0.35555], + 338: [0, 0.68611, 0.11431, 0, 1.14054], + 339: [0, 0.44444, 0.085, 0, 0.82666], + 567: [0.19444, 0.44444, 0.04611, 0, 0.385], + 710: [0, 0.69444, 0.06709, 0, 0.59111], + 711: [0, 0.63194, 0.08271, 0, 0.59111], + 713: [0, 0.59444, 0.10444, 0, 0.59111], + 714: [0, 0.69444, 0.08528, 0, 0.59111], + 715: [0, 0.69444, 0, 0, 0.59111], + 728: [0, 0.69444, 0.10333, 0, 0.59111], + 729: [0, 0.69444, 0.12945, 0, 0.35555], + 730: [0, 0.69444, 0, 0, 0.94888], + 732: [0, 0.69444, 0.11472, 0, 0.59111], + 733: [0, 0.69444, 0.11472, 0, 0.59111], + 915: [0, 0.68611, 0.12903, 0, 0.69777], + 916: [0, 0.68611, 0, 0, 0.94444], + 920: [0, 0.68611, 0.09062, 0, 0.88555], + 923: [0, 0.68611, 0, 0, 0.80666], + 926: [0, 0.68611, 0.15092, 0, 0.76777], + 928: [0, 0.68611, 0.17208, 0, 0.8961], + 931: [0, 0.68611, 0.11431, 0, 0.82666], + 933: [0, 0.68611, 0.10778, 0, 0.88555], + 934: [0, 0.68611, 0.05632, 0, 0.82666], + 936: [0, 0.68611, 0.10778, 0, 0.88555], + 937: [0, 0.68611, 0.0992, 0, 0.82666], + 8211: [0, 0.44444, 0.09811, 0, 0.59111], + 8212: [0, 0.44444, 0.09811, 0, 1.18221], + 8216: [0, 0.69444, 0.12945, 0, 0.35555], + 8217: [0, 0.69444, 0.12945, 0, 0.35555], + 8220: [0, 0.69444, 0.16772, 0, 0.62055], + 8221: [0, 0.69444, 0.07939, 0, 0.62055] + }, + "Main-Italic": { + 32: [0, 0, 0, 0, 0.25], + 33: [0, 0.69444, 0.12417, 0, 0.30667], + 34: [0, 0.69444, 0.06961, 0, 0.51444], + 35: [0.19444, 0.69444, 0.06616, 0, 0.81777], + 37: [0.05556, 0.75, 0.13639, 0, 0.81777], + 38: [0, 0.69444, 0.09694, 0, 0.76666], + 39: [0, 0.69444, 0.12417, 0, 0.30667], + 40: [0.25, 0.75, 0.16194, 0, 0.40889], + 41: [0.25, 0.75, 0.03694, 0, 0.40889], + 42: [0, 0.75, 0.14917, 0, 0.51111], + 43: [0.05667, 0.56167, 0.03694, 0, 0.76666], + 44: [0.19444, 0.10556, 0, 0, 0.30667], + 45: [0, 0.43056, 0.02826, 0, 0.35778], + 46: [0, 0.10556, 0, 0, 0.30667], + 47: [0.25, 0.75, 0.16194, 0, 0.51111], + 48: [0, 0.64444, 0.13556, 0, 0.51111], + 49: [0, 0.64444, 0.13556, 0, 0.51111], + 50: [0, 0.64444, 0.13556, 0, 0.51111], + 51: [0, 0.64444, 0.13556, 0, 0.51111], + 52: [0.19444, 0.64444, 0.13556, 0, 0.51111], + 53: [0, 0.64444, 0.13556, 0, 0.51111], + 54: [0, 0.64444, 0.13556, 0, 0.51111], + 55: [0.19444, 0.64444, 0.13556, 0, 0.51111], + 56: [0, 0.64444, 0.13556, 0, 0.51111], + 57: [0, 0.64444, 0.13556, 0, 0.51111], + 58: [0, 0.43056, 0.0582, 0, 0.30667], + 59: [0.19444, 0.43056, 0.0582, 0, 0.30667], + 61: [-0.13313, 0.36687, 0.06616, 0, 0.76666], + 63: [0, 0.69444, 0.1225, 0, 0.51111], + 64: [0, 0.69444, 0.09597, 0, 0.76666], + 65: [0, 0.68333, 0, 0, 0.74333], + 66: [0, 0.68333, 0.10257, 0, 0.70389], + 67: [0, 0.68333, 0.14528, 0, 0.71555], + 68: [0, 0.68333, 0.09403, 0, 0.755], + 69: [0, 0.68333, 0.12028, 0, 0.67833], + 70: [0, 0.68333, 0.13305, 0, 0.65277], + 71: [0, 0.68333, 0.08722, 0, 0.77361], + 72: [0, 0.68333, 0.16389, 0, 0.74333], + 73: [0, 0.68333, 0.15806, 0, 0.38555], + 74: [0, 0.68333, 0.14028, 0, 0.525], + 75: [0, 0.68333, 0.14528, 0, 0.76888], + 76: [0, 0.68333, 0, 0, 0.62722], + 77: [0, 0.68333, 0.16389, 0, 0.89666], + 78: [0, 0.68333, 0.16389, 0, 0.74333], + 79: [0, 0.68333, 0.09403, 0, 0.76666], + 80: [0, 0.68333, 0.10257, 0, 0.67833], + 81: [0.19444, 0.68333, 0.09403, 0, 0.76666], + 82: [0, 0.68333, 0.03868, 0, 0.72944], + 83: [0, 0.68333, 0.11972, 0, 0.56222], + 84: [0, 0.68333, 0.13305, 0, 0.71555], + 85: [0, 0.68333, 0.16389, 0, 0.74333], + 86: [0, 0.68333, 0.18361, 0, 0.74333], + 87: [0, 0.68333, 0.18361, 0, 0.99888], + 88: [0, 0.68333, 0.15806, 0, 0.74333], + 89: [0, 0.68333, 0.19383, 0, 0.74333], + 90: [0, 0.68333, 0.14528, 0, 0.61333], + 91: [0.25, 0.75, 0.1875, 0, 0.30667], + 93: [0.25, 0.75, 0.10528, 0, 0.30667], + 94: [0, 0.69444, 0.06646, 0, 0.51111], + 95: [0.31, 0.12056, 0.09208, 0, 0.51111], + 97: [0, 0.43056, 0.07671, 0, 0.51111], + 98: [0, 0.69444, 0.06312, 0, 0.46], + 99: [0, 0.43056, 0.05653, 0, 0.46], + 100: [0, 0.69444, 0.10333, 0, 0.51111], + 101: [0, 0.43056, 0.07514, 0, 0.46], + 102: [0.19444, 0.69444, 0.21194, 0, 0.30667], + 103: [0.19444, 0.43056, 0.08847, 0, 0.46], + 104: [0, 0.69444, 0.07671, 0, 0.51111], + 105: [0, 0.65536, 0.1019, 0, 0.30667], + 106: [0.19444, 0.65536, 0.14467, 0, 0.30667], + 107: [0, 0.69444, 0.10764, 0, 0.46], + 108: [0, 0.69444, 0.10333, 0, 0.25555], + 109: [0, 0.43056, 0.07671, 0, 0.81777], + 110: [0, 0.43056, 0.07671, 0, 0.56222], + 111: [0, 0.43056, 0.06312, 0, 0.51111], + 112: [0.19444, 0.43056, 0.06312, 0, 0.51111], + 113: [0.19444, 0.43056, 0.08847, 0, 0.46], + 114: [0, 0.43056, 0.10764, 0, 0.42166], + 115: [0, 0.43056, 0.08208, 0, 0.40889], + 116: [0, 0.61508, 0.09486, 0, 0.33222], + 117: [0, 0.43056, 0.07671, 0, 0.53666], + 118: [0, 0.43056, 0.10764, 0, 0.46], + 119: [0, 0.43056, 0.10764, 0, 0.66444], + 120: [0, 0.43056, 0.12042, 0, 0.46389], + 121: [0.19444, 0.43056, 0.08847, 0, 0.48555], + 122: [0, 0.43056, 0.12292, 0, 0.40889], + 126: [0.35, 0.31786, 0.11585, 0, 0.51111], + 160: [0, 0, 0, 0, 0.25], + 168: [0, 0.66786, 0.10474, 0, 0.51111], + 176: [0, 0.69444, 0, 0, 0.83129], + 184: [0.17014, 0, 0, 0, 0.46], + 198: [0, 0.68333, 0.12028, 0, 0.88277], + 216: [0.04861, 0.73194, 0.09403, 0, 0.76666], + 223: [0.19444, 0.69444, 0.10514, 0, 0.53666], + 230: [0, 0.43056, 0.07514, 0, 0.71555], + 248: [0.09722, 0.52778, 0.09194, 0, 0.51111], + 338: [0, 0.68333, 0.12028, 0, 0.98499], + 339: [0, 0.43056, 0.07514, 0, 0.71555], + 710: [0, 0.69444, 0.06646, 0, 0.51111], + 711: [0, 0.62847, 0.08295, 0, 0.51111], + 713: [0, 0.56167, 0.10333, 0, 0.51111], + 714: [0, 0.69444, 0.09694, 0, 0.51111], + 715: [0, 0.69444, 0, 0, 0.51111], + 728: [0, 0.69444, 0.10806, 0, 0.51111], + 729: [0, 0.66786, 0.11752, 0, 0.30667], + 730: [0, 0.69444, 0, 0, 0.83129], + 732: [0, 0.66786, 0.11585, 0, 0.51111], + 733: [0, 0.69444, 0.1225, 0, 0.51111], + 915: [0, 0.68333, 0.13305, 0, 0.62722], + 916: [0, 0.68333, 0, 0, 0.81777], + 920: [0, 0.68333, 0.09403, 0, 0.76666], + 923: [0, 0.68333, 0, 0, 0.69222], + 926: [0, 0.68333, 0.15294, 0, 0.66444], + 928: [0, 0.68333, 0.16389, 0, 0.74333], + 931: [0, 0.68333, 0.12028, 0, 0.71555], + 933: [0, 0.68333, 0.11111, 0, 0.76666], + 934: [0, 0.68333, 0.05986, 0, 0.71555], + 936: [0, 0.68333, 0.11111, 0, 0.76666], + 937: [0, 0.68333, 0.10257, 0, 0.71555], + 8211: [0, 0.43056, 0.09208, 0, 0.51111], + 8212: [0, 0.43056, 0.09208, 0, 1.02222], + 8216: [0, 0.69444, 0.12417, 0, 0.30667], + 8217: [0, 0.69444, 0.12417, 0, 0.30667], + 8220: [0, 0.69444, 0.1685, 0, 0.51444], + 8221: [0, 0.69444, 0.06961, 0, 0.51444], + 8463: [0, 0.68889, 0, 0, 0.54028] + }, + "Main-Regular": { + 32: [0, 0, 0, 0, 0.25], + 33: [0, 0.69444, 0, 0, 0.27778], + 34: [0, 0.69444, 0, 0, 0.5], + 35: [0.19444, 0.69444, 0, 0, 0.83334], + 36: [0.05556, 0.75, 0, 0, 0.5], + 37: [0.05556, 0.75, 0, 0, 0.83334], + 38: [0, 0.69444, 0, 0, 0.77778], + 39: [0, 0.69444, 0, 0, 0.27778], + 40: [0.25, 0.75, 0, 0, 0.38889], + 41: [0.25, 0.75, 0, 0, 0.38889], + 42: [0, 0.75, 0, 0, 0.5], + 43: [0.08333, 0.58333, 0, 0, 0.77778], + 44: [0.19444, 0.10556, 0, 0, 0.27778], + 45: [0, 0.43056, 0, 0, 0.33333], + 46: [0, 0.10556, 0, 0, 0.27778], + 47: [0.25, 0.75, 0, 0, 0.5], + 48: [0, 0.64444, 0, 0, 0.5], + 49: [0, 0.64444, 0, 0, 0.5], + 50: [0, 0.64444, 0, 0, 0.5], + 51: [0, 0.64444, 0, 0, 0.5], + 52: [0, 0.64444, 0, 0, 0.5], + 53: [0, 0.64444, 0, 0, 0.5], + 54: [0, 0.64444, 0, 0, 0.5], + 55: [0, 0.64444, 0, 0, 0.5], + 56: [0, 0.64444, 0, 0, 0.5], + 57: [0, 0.64444, 0, 0, 0.5], + 58: [0, 0.43056, 0, 0, 0.27778], + 59: [0.19444, 0.43056, 0, 0, 0.27778], + 60: [0.0391, 0.5391, 0, 0, 0.77778], + 61: [-0.13313, 0.36687, 0, 0, 0.77778], + 62: [0.0391, 0.5391, 0, 0, 0.77778], + 63: [0, 0.69444, 0, 0, 0.47222], + 64: [0, 0.69444, 0, 0, 0.77778], + 65: [0, 0.68333, 0, 0, 0.75], + 66: [0, 0.68333, 0, 0, 0.70834], + 67: [0, 0.68333, 0, 0, 0.72222], + 68: [0, 0.68333, 0, 0, 0.76389], + 69: [0, 0.68333, 0, 0, 0.68056], + 70: [0, 0.68333, 0, 0, 0.65278], + 71: [0, 0.68333, 0, 0, 0.78472], + 72: [0, 0.68333, 0, 0, 0.75], + 73: [0, 0.68333, 0, 0, 0.36111], + 74: [0, 0.68333, 0, 0, 0.51389], + 75: [0, 0.68333, 0, 0, 0.77778], + 76: [0, 0.68333, 0, 0, 0.625], + 77: [0, 0.68333, 0, 0, 0.91667], + 78: [0, 0.68333, 0, 0, 0.75], + 79: [0, 0.68333, 0, 0, 0.77778], + 80: [0, 0.68333, 0, 0, 0.68056], + 81: [0.19444, 0.68333, 0, 0, 0.77778], + 82: [0, 0.68333, 0, 0, 0.73611], + 83: [0, 0.68333, 0, 0, 0.55556], + 84: [0, 0.68333, 0, 0, 0.72222], + 85: [0, 0.68333, 0, 0, 0.75], + 86: [0, 0.68333, 0.01389, 0, 0.75], + 87: [0, 0.68333, 0.01389, 0, 1.02778], + 88: [0, 0.68333, 0, 0, 0.75], + 89: [0, 0.68333, 0.025, 0, 0.75], + 90: [0, 0.68333, 0, 0, 0.61111], + 91: [0.25, 0.75, 0, 0, 0.27778], + 92: [0.25, 0.75, 0, 0, 0.5], + 93: [0.25, 0.75, 0, 0, 0.27778], + 94: [0, 0.69444, 0, 0, 0.5], + 95: [0.31, 0.12056, 0.02778, 0, 0.5], + 97: [0, 0.43056, 0, 0, 0.5], + 98: [0, 0.69444, 0, 0, 0.55556], + 99: [0, 0.43056, 0, 0, 0.44445], + 100: [0, 0.69444, 0, 0, 0.55556], + 101: [0, 0.43056, 0, 0, 0.44445], + 102: [0, 0.69444, 0.07778, 0, 0.30556], + 103: [0.19444, 0.43056, 0.01389, 0, 0.5], + 104: [0, 0.69444, 0, 0, 0.55556], + 105: [0, 0.66786, 0, 0, 0.27778], + 106: [0.19444, 0.66786, 0, 0, 0.30556], + 107: [0, 0.69444, 0, 0, 0.52778], + 108: [0, 0.69444, 0, 0, 0.27778], + 109: [0, 0.43056, 0, 0, 0.83334], + 110: [0, 0.43056, 0, 0, 0.55556], + 111: [0, 0.43056, 0, 0, 0.5], + 112: [0.19444, 0.43056, 0, 0, 0.55556], + 113: [0.19444, 0.43056, 0, 0, 0.52778], + 114: [0, 0.43056, 0, 0, 0.39167], + 115: [0, 0.43056, 0, 0, 0.39445], + 116: [0, 0.61508, 0, 0, 0.38889], + 117: [0, 0.43056, 0, 0, 0.55556], + 118: [0, 0.43056, 0.01389, 0, 0.52778], + 119: [0, 0.43056, 0.01389, 0, 0.72222], + 120: [0, 0.43056, 0, 0, 0.52778], + 121: [0.19444, 0.43056, 0.01389, 0, 0.52778], + 122: [0, 0.43056, 0, 0, 0.44445], + 123: [0.25, 0.75, 0, 0, 0.5], + 124: [0.25, 0.75, 0, 0, 0.27778], + 125: [0.25, 0.75, 0, 0, 0.5], + 126: [0.35, 0.31786, 0, 0, 0.5], + 160: [0, 0, 0, 0, 0.25], + 163: [0, 0.69444, 0, 0, 0.76909], + 167: [0.19444, 0.69444, 0, 0, 0.44445], + 168: [0, 0.66786, 0, 0, 0.5], + 172: [0, 0.43056, 0, 0, 0.66667], + 176: [0, 0.69444, 0, 0, 0.75], + 177: [0.08333, 0.58333, 0, 0, 0.77778], + 182: [0.19444, 0.69444, 0, 0, 0.61111], + 184: [0.17014, 0, 0, 0, 0.44445], + 198: [0, 0.68333, 0, 0, 0.90278], + 215: [0.08333, 0.58333, 0, 0, 0.77778], + 216: [0.04861, 0.73194, 0, 0, 0.77778], + 223: [0, 0.69444, 0, 0, 0.5], + 230: [0, 0.43056, 0, 0, 0.72222], + 247: [0.08333, 0.58333, 0, 0, 0.77778], + 248: [0.09722, 0.52778, 0, 0, 0.5], + 305: [0, 0.43056, 0, 0, 0.27778], + 338: [0, 0.68333, 0, 0, 1.01389], + 339: [0, 0.43056, 0, 0, 0.77778], + 567: [0.19444, 0.43056, 0, 0, 0.30556], + 710: [0, 0.69444, 0, 0, 0.5], + 711: [0, 0.62847, 0, 0, 0.5], + 713: [0, 0.56778, 0, 0, 0.5], + 714: [0, 0.69444, 0, 0, 0.5], + 715: [0, 0.69444, 0, 0, 0.5], + 728: [0, 0.69444, 0, 0, 0.5], + 729: [0, 0.66786, 0, 0, 0.27778], + 730: [0, 0.69444, 0, 0, 0.75], + 732: [0, 0.66786, 0, 0, 0.5], + 733: [0, 0.69444, 0, 0, 0.5], + 915: [0, 0.68333, 0, 0, 0.625], + 916: [0, 0.68333, 0, 0, 0.83334], + 920: [0, 0.68333, 0, 0, 0.77778], + 923: [0, 0.68333, 0, 0, 0.69445], + 926: [0, 0.68333, 0, 0, 0.66667], + 928: [0, 0.68333, 0, 0, 0.75], + 931: [0, 0.68333, 0, 0, 0.72222], + 933: [0, 0.68333, 0, 0, 0.77778], + 934: [0, 0.68333, 0, 0, 0.72222], + 936: [0, 0.68333, 0, 0, 0.77778], + 937: [0, 0.68333, 0, 0, 0.72222], + 8211: [0, 0.43056, 0.02778, 0, 0.5], + 8212: [0, 0.43056, 0.02778, 0, 1], + 8216: [0, 0.69444, 0, 0, 0.27778], + 8217: [0, 0.69444, 0, 0, 0.27778], + 8220: [0, 0.69444, 0, 0, 0.5], + 8221: [0, 0.69444, 0, 0, 0.5], + 8224: [0.19444, 0.69444, 0, 0, 0.44445], + 8225: [0.19444, 0.69444, 0, 0, 0.44445], + 8230: [0, 0.123, 0, 0, 1.172], + 8242: [0, 0.55556, 0, 0, 0.275], + 8407: [0, 0.71444, 0.15382, 0, 0.5], + 8463: [0, 0.68889, 0, 0, 0.54028], + 8465: [0, 0.69444, 0, 0, 0.72222], + 8467: [0, 0.69444, 0, 0.11111, 0.41667], + 8472: [0.19444, 0.43056, 0, 0.11111, 0.63646], + 8476: [0, 0.69444, 0, 0, 0.72222], + 8501: [0, 0.69444, 0, 0, 0.61111], + 8592: [-0.13313, 0.36687, 0, 0, 1], + 8593: [0.19444, 0.69444, 0, 0, 0.5], + 8594: [-0.13313, 0.36687, 0, 0, 1], + 8595: [0.19444, 0.69444, 0, 0, 0.5], + 8596: [-0.13313, 0.36687, 0, 0, 1], + 8597: [0.25, 0.75, 0, 0, 0.5], + 8598: [0.19444, 0.69444, 0, 0, 1], + 8599: [0.19444, 0.69444, 0, 0, 1], + 8600: [0.19444, 0.69444, 0, 0, 1], + 8601: [0.19444, 0.69444, 0, 0, 1], + 8614: [0.011, 0.511, 0, 0, 1], + 8617: [0.011, 0.511, 0, 0, 1.126], + 8618: [0.011, 0.511, 0, 0, 1.126], + 8636: [-0.13313, 0.36687, 0, 0, 1], + 8637: [-0.13313, 0.36687, 0, 0, 1], + 8640: [-0.13313, 0.36687, 0, 0, 1], + 8641: [-0.13313, 0.36687, 0, 0, 1], + 8652: [0.011, 0.671, 0, 0, 1], + 8656: [-0.13313, 0.36687, 0, 0, 1], + 8657: [0.19444, 0.69444, 0, 0, 0.61111], + 8658: [-0.13313, 0.36687, 0, 0, 1], + 8659: [0.19444, 0.69444, 0, 0, 0.61111], + 8660: [-0.13313, 0.36687, 0, 0, 1], + 8661: [0.25, 0.75, 0, 0, 0.61111], + 8704: [0, 0.69444, 0, 0, 0.55556], + 8706: [0, 0.69444, 0.05556, 0.08334, 0.5309], + 8707: [0, 0.69444, 0, 0, 0.55556], + 8709: [0.05556, 0.75, 0, 0, 0.5], + 8711: [0, 0.68333, 0, 0, 0.83334], + 8712: [0.0391, 0.5391, 0, 0, 0.66667], + 8715: [0.0391, 0.5391, 0, 0, 0.66667], + 8722: [0.08333, 0.58333, 0, 0, 0.77778], + 8723: [0.08333, 0.58333, 0, 0, 0.77778], + 8725: [0.25, 0.75, 0, 0, 0.5], + 8726: [0.25, 0.75, 0, 0, 0.5], + 8727: [-0.03472, 0.46528, 0, 0, 0.5], + 8728: [-0.05555, 0.44445, 0, 0, 0.5], + 8729: [-0.05555, 0.44445, 0, 0, 0.5], + 8730: [0.2, 0.8, 0, 0, 0.83334], + 8733: [0, 0.43056, 0, 0, 0.77778], + 8734: [0, 0.43056, 0, 0, 1], + 8736: [0, 0.69224, 0, 0, 0.72222], + 8739: [0.25, 0.75, 0, 0, 0.27778], + 8741: [0.25, 0.75, 0, 0, 0.5], + 8743: [0, 0.55556, 0, 0, 0.66667], + 8744: [0, 0.55556, 0, 0, 0.66667], + 8745: [0, 0.55556, 0, 0, 0.66667], + 8746: [0, 0.55556, 0, 0, 0.66667], + 8747: [0.19444, 0.69444, 0.11111, 0, 0.41667], + 8764: [-0.13313, 0.36687, 0, 0, 0.77778], + 8768: [0.19444, 0.69444, 0, 0, 0.27778], + 8771: [-0.03625, 0.46375, 0, 0, 0.77778], + 8773: [-0.022, 0.589, 0, 0, 0.778], + 8776: [-0.01688, 0.48312, 0, 0, 0.77778], + 8781: [-0.03625, 0.46375, 0, 0, 0.77778], + 8784: [-0.133, 0.673, 0, 0, 0.778], + 8801: [-0.03625, 0.46375, 0, 0, 0.77778], + 8804: [0.13597, 0.63597, 0, 0, 0.77778], + 8805: [0.13597, 0.63597, 0, 0, 0.77778], + 8810: [0.0391, 0.5391, 0, 0, 1], + 8811: [0.0391, 0.5391, 0, 0, 1], + 8826: [0.0391, 0.5391, 0, 0, 0.77778], + 8827: [0.0391, 0.5391, 0, 0, 0.77778], + 8834: [0.0391, 0.5391, 0, 0, 0.77778], + 8835: [0.0391, 0.5391, 0, 0, 0.77778], + 8838: [0.13597, 0.63597, 0, 0, 0.77778], + 8839: [0.13597, 0.63597, 0, 0, 0.77778], + 8846: [0, 0.55556, 0, 0, 0.66667], + 8849: [0.13597, 0.63597, 0, 0, 0.77778], + 8850: [0.13597, 0.63597, 0, 0, 0.77778], + 8851: [0, 0.55556, 0, 0, 0.66667], + 8852: [0, 0.55556, 0, 0, 0.66667], + 8853: [0.08333, 0.58333, 0, 0, 0.77778], + 8854: [0.08333, 0.58333, 0, 0, 0.77778], + 8855: [0.08333, 0.58333, 0, 0, 0.77778], + 8856: [0.08333, 0.58333, 0, 0, 0.77778], + 8857: [0.08333, 0.58333, 0, 0, 0.77778], + 8866: [0, 0.69444, 0, 0, 0.61111], + 8867: [0, 0.69444, 0, 0, 0.61111], + 8868: [0, 0.69444, 0, 0, 0.77778], + 8869: [0, 0.69444, 0, 0, 0.77778], + 8872: [0.249, 0.75, 0, 0, 0.867], + 8900: [-0.05555, 0.44445, 0, 0, 0.5], + 8901: [-0.05555, 0.44445, 0, 0, 0.27778], + 8902: [-0.03472, 0.46528, 0, 0, 0.5], + 8904: [5e-3, 0.505, 0, 0, 0.9], + 8942: [0.03, 0.903, 0, 0, 0.278], + 8943: [-0.19, 0.313, 0, 0, 1.172], + 8945: [-0.1, 0.823, 0, 0, 1.282], + 8968: [0.25, 0.75, 0, 0, 0.44445], + 8969: [0.25, 0.75, 0, 0, 0.44445], + 8970: [0.25, 0.75, 0, 0, 0.44445], + 8971: [0.25, 0.75, 0, 0, 0.44445], + 8994: [-0.14236, 0.35764, 0, 0, 1], + 8995: [-0.14236, 0.35764, 0, 0, 1], + 9136: [0.244, 0.744, 0, 0, 0.412], + 9137: [0.244, 0.745, 0, 0, 0.412], + 9651: [0.19444, 0.69444, 0, 0, 0.88889], + 9657: [-0.03472, 0.46528, 0, 0, 0.5], + 9661: [0.19444, 0.69444, 0, 0, 0.88889], + 9667: [-0.03472, 0.46528, 0, 0, 0.5], + 9711: [0.19444, 0.69444, 0, 0, 1], + 9824: [0.12963, 0.69444, 0, 0, 0.77778], + 9825: [0.12963, 0.69444, 0, 0, 0.77778], + 9826: [0.12963, 0.69444, 0, 0, 0.77778], + 9827: [0.12963, 0.69444, 0, 0, 0.77778], + 9837: [0, 0.75, 0, 0, 0.38889], + 9838: [0.19444, 0.69444, 0, 0, 0.38889], + 9839: [0.19444, 0.69444, 0, 0, 0.38889], + 10216: [0.25, 0.75, 0, 0, 0.38889], + 10217: [0.25, 0.75, 0, 0, 0.38889], + 10222: [0.244, 0.744, 0, 0, 0.412], + 10223: [0.244, 0.745, 0, 0, 0.412], + 10229: [0.011, 0.511, 0, 0, 1.609], + 10230: [0.011, 0.511, 0, 0, 1.638], + 10231: [0.011, 0.511, 0, 0, 1.859], + 10232: [0.024, 0.525, 0, 0, 1.609], + 10233: [0.024, 0.525, 0, 0, 1.638], + 10234: [0.024, 0.525, 0, 0, 1.858], + 10236: [0.011, 0.511, 0, 0, 1.638], + 10815: [0, 0.68333, 0, 0, 0.75], + 10927: [0.13597, 0.63597, 0, 0, 0.77778], + 10928: [0.13597, 0.63597, 0, 0, 0.77778], + 57376: [0.19444, 0.69444, 0, 0, 0] + }, + "Math-BoldItalic": { + 32: [0, 0, 0, 0, 0.25], + 48: [0, 0.44444, 0, 0, 0.575], + 49: [0, 0.44444, 0, 0, 0.575], + 50: [0, 0.44444, 0, 0, 0.575], + 51: [0.19444, 0.44444, 0, 0, 0.575], + 52: [0.19444, 0.44444, 0, 0, 0.575], + 53: [0.19444, 0.44444, 0, 0, 0.575], + 54: [0, 0.64444, 0, 0, 0.575], + 55: [0.19444, 0.44444, 0, 0, 0.575], + 56: [0, 0.64444, 0, 0, 0.575], + 57: [0.19444, 0.44444, 0, 0, 0.575], + 65: [0, 0.68611, 0, 0, 0.86944], + 66: [0, 0.68611, 0.04835, 0, 0.8664], + 67: [0, 0.68611, 0.06979, 0, 0.81694], + 68: [0, 0.68611, 0.03194, 0, 0.93812], + 69: [0, 0.68611, 0.05451, 0, 0.81007], + 70: [0, 0.68611, 0.15972, 0, 0.68889], + 71: [0, 0.68611, 0, 0, 0.88673], + 72: [0, 0.68611, 0.08229, 0, 0.98229], + 73: [0, 0.68611, 0.07778, 0, 0.51111], + 74: [0, 0.68611, 0.10069, 0, 0.63125], + 75: [0, 0.68611, 0.06979, 0, 0.97118], + 76: [0, 0.68611, 0, 0, 0.75555], + 77: [0, 0.68611, 0.11424, 0, 1.14201], + 78: [0, 0.68611, 0.11424, 0, 0.95034], + 79: [0, 0.68611, 0.03194, 0, 0.83666], + 80: [0, 0.68611, 0.15972, 0, 0.72309], + 81: [0.19444, 0.68611, 0, 0, 0.86861], + 82: [0, 0.68611, 421e-5, 0, 0.87235], + 83: [0, 0.68611, 0.05382, 0, 0.69271], + 84: [0, 0.68611, 0.15972, 0, 0.63663], + 85: [0, 0.68611, 0.11424, 0, 0.80027], + 86: [0, 0.68611, 0.25555, 0, 0.67778], + 87: [0, 0.68611, 0.15972, 0, 1.09305], + 88: [0, 0.68611, 0.07778, 0, 0.94722], + 89: [0, 0.68611, 0.25555, 0, 0.67458], + 90: [0, 0.68611, 0.06979, 0, 0.77257], + 97: [0, 0.44444, 0, 0, 0.63287], + 98: [0, 0.69444, 0, 0, 0.52083], + 99: [0, 0.44444, 0, 0, 0.51342], + 100: [0, 0.69444, 0, 0, 0.60972], + 101: [0, 0.44444, 0, 0, 0.55361], + 102: [0.19444, 0.69444, 0.11042, 0, 0.56806], + 103: [0.19444, 0.44444, 0.03704, 0, 0.5449], + 104: [0, 0.69444, 0, 0, 0.66759], + 105: [0, 0.69326, 0, 0, 0.4048], + 106: [0.19444, 0.69326, 0.0622, 0, 0.47083], + 107: [0, 0.69444, 0.01852, 0, 0.6037], + 108: [0, 0.69444, 88e-4, 0, 0.34815], + 109: [0, 0.44444, 0, 0, 1.0324], + 110: [0, 0.44444, 0, 0, 0.71296], + 111: [0, 0.44444, 0, 0, 0.58472], + 112: [0.19444, 0.44444, 0, 0, 0.60092], + 113: [0.19444, 0.44444, 0.03704, 0, 0.54213], + 114: [0, 0.44444, 0.03194, 0, 0.5287], + 115: [0, 0.44444, 0, 0, 0.53125], + 116: [0, 0.63492, 0, 0, 0.41528], + 117: [0, 0.44444, 0, 0, 0.68102], + 118: [0, 0.44444, 0.03704, 0, 0.56666], + 119: [0, 0.44444, 0.02778, 0, 0.83148], + 120: [0, 0.44444, 0, 0, 0.65903], + 121: [0.19444, 0.44444, 0.03704, 0, 0.59028], + 122: [0, 0.44444, 0.04213, 0, 0.55509], + 160: [0, 0, 0, 0, 0.25], + 915: [0, 0.68611, 0.15972, 0, 0.65694], + 916: [0, 0.68611, 0, 0, 0.95833], + 920: [0, 0.68611, 0.03194, 0, 0.86722], + 923: [0, 0.68611, 0, 0, 0.80555], + 926: [0, 0.68611, 0.07458, 0, 0.84125], + 928: [0, 0.68611, 0.08229, 0, 0.98229], + 931: [0, 0.68611, 0.05451, 0, 0.88507], + 933: [0, 0.68611, 0.15972, 0, 0.67083], + 934: [0, 0.68611, 0, 0, 0.76666], + 936: [0, 0.68611, 0.11653, 0, 0.71402], + 937: [0, 0.68611, 0.04835, 0, 0.8789], + 945: [0, 0.44444, 0, 0, 0.76064], + 946: [0.19444, 0.69444, 0.03403, 0, 0.65972], + 947: [0.19444, 0.44444, 0.06389, 0, 0.59003], + 948: [0, 0.69444, 0.03819, 0, 0.52222], + 949: [0, 0.44444, 0, 0, 0.52882], + 950: [0.19444, 0.69444, 0.06215, 0, 0.50833], + 951: [0.19444, 0.44444, 0.03704, 0, 0.6], + 952: [0, 0.69444, 0.03194, 0, 0.5618], + 953: [0, 0.44444, 0, 0, 0.41204], + 954: [0, 0.44444, 0, 0, 0.66759], + 955: [0, 0.69444, 0, 0, 0.67083], + 956: [0.19444, 0.44444, 0, 0, 0.70787], + 957: [0, 0.44444, 0.06898, 0, 0.57685], + 958: [0.19444, 0.69444, 0.03021, 0, 0.50833], + 959: [0, 0.44444, 0, 0, 0.58472], + 960: [0, 0.44444, 0.03704, 0, 0.68241], + 961: [0.19444, 0.44444, 0, 0, 0.6118], + 962: [0.09722, 0.44444, 0.07917, 0, 0.42361], + 963: [0, 0.44444, 0.03704, 0, 0.68588], + 964: [0, 0.44444, 0.13472, 0, 0.52083], + 965: [0, 0.44444, 0.03704, 0, 0.63055], + 966: [0.19444, 0.44444, 0, 0, 0.74722], + 967: [0.19444, 0.44444, 0, 0, 0.71805], + 968: [0.19444, 0.69444, 0.03704, 0, 0.75833], + 969: [0, 0.44444, 0.03704, 0, 0.71782], + 977: [0, 0.69444, 0, 0, 0.69155], + 981: [0.19444, 0.69444, 0, 0, 0.7125], + 982: [0, 0.44444, 0.03194, 0, 0.975], + 1009: [0.19444, 0.44444, 0, 0, 0.6118], + 1013: [0, 0.44444, 0, 0, 0.48333], + 57649: [0, 0.44444, 0, 0, 0.39352], + 57911: [0.19444, 0.44444, 0, 0, 0.43889] + }, + "Math-Italic": { + 32: [0, 0, 0, 0, 0.25], + 48: [0, 0.43056, 0, 0, 0.5], + 49: [0, 0.43056, 0, 0, 0.5], + 50: [0, 0.43056, 0, 0, 0.5], + 51: [0.19444, 0.43056, 0, 0, 0.5], + 52: [0.19444, 0.43056, 0, 0, 0.5], + 53: [0.19444, 0.43056, 0, 0, 0.5], + 54: [0, 0.64444, 0, 0, 0.5], + 55: [0.19444, 0.43056, 0, 0, 0.5], + 56: [0, 0.64444, 0, 0, 0.5], + 57: [0.19444, 0.43056, 0, 0, 0.5], + 65: [0, 0.68333, 0, 0.13889, 0.75], + 66: [0, 0.68333, 0.05017, 0.08334, 0.75851], + 67: [0, 0.68333, 0.07153, 0.08334, 0.71472], + 68: [0, 0.68333, 0.02778, 0.05556, 0.82792], + 69: [0, 0.68333, 0.05764, 0.08334, 0.7382], + 70: [0, 0.68333, 0.13889, 0.08334, 0.64306], + 71: [0, 0.68333, 0, 0.08334, 0.78625], + 72: [0, 0.68333, 0.08125, 0.05556, 0.83125], + 73: [0, 0.68333, 0.07847, 0.11111, 0.43958], + 74: [0, 0.68333, 0.09618, 0.16667, 0.55451], + 75: [0, 0.68333, 0.07153, 0.05556, 0.84931], + 76: [0, 0.68333, 0, 0.02778, 0.68056], + 77: [0, 0.68333, 0.10903, 0.08334, 0.97014], + 78: [0, 0.68333, 0.10903, 0.08334, 0.80347], + 79: [0, 0.68333, 0.02778, 0.08334, 0.76278], + 80: [0, 0.68333, 0.13889, 0.08334, 0.64201], + 81: [0.19444, 0.68333, 0, 0.08334, 0.79056], + 82: [0, 0.68333, 773e-5, 0.08334, 0.75929], + 83: [0, 0.68333, 0.05764, 0.08334, 0.6132], + 84: [0, 0.68333, 0.13889, 0.08334, 0.58438], + 85: [0, 0.68333, 0.10903, 0.02778, 0.68278], + 86: [0, 0.68333, 0.22222, 0, 0.58333], + 87: [0, 0.68333, 0.13889, 0, 0.94445], + 88: [0, 0.68333, 0.07847, 0.08334, 0.82847], + 89: [0, 0.68333, 0.22222, 0, 0.58056], + 90: [0, 0.68333, 0.07153, 0.08334, 0.68264], + 97: [0, 0.43056, 0, 0, 0.52859], + 98: [0, 0.69444, 0, 0, 0.42917], + 99: [0, 0.43056, 0, 0.05556, 0.43276], + 100: [0, 0.69444, 0, 0.16667, 0.52049], + 101: [0, 0.43056, 0, 0.05556, 0.46563], + 102: [0.19444, 0.69444, 0.10764, 0.16667, 0.48959], + 103: [0.19444, 0.43056, 0.03588, 0.02778, 0.47697], + 104: [0, 0.69444, 0, 0, 0.57616], + 105: [0, 0.65952, 0, 0, 0.34451], + 106: [0.19444, 0.65952, 0.05724, 0, 0.41181], + 107: [0, 0.69444, 0.03148, 0, 0.5206], + 108: [0, 0.69444, 0.01968, 0.08334, 0.29838], + 109: [0, 0.43056, 0, 0, 0.87801], + 110: [0, 0.43056, 0, 0, 0.60023], + 111: [0, 0.43056, 0, 0.05556, 0.48472], + 112: [0.19444, 0.43056, 0, 0.08334, 0.50313], + 113: [0.19444, 0.43056, 0.03588, 0.08334, 0.44641], + 114: [0, 0.43056, 0.02778, 0.05556, 0.45116], + 115: [0, 0.43056, 0, 0.05556, 0.46875], + 116: [0, 0.61508, 0, 0.08334, 0.36111], + 117: [0, 0.43056, 0, 0.02778, 0.57246], + 118: [0, 0.43056, 0.03588, 0.02778, 0.48472], + 119: [0, 0.43056, 0.02691, 0.08334, 0.71592], + 120: [0, 0.43056, 0, 0.02778, 0.57153], + 121: [0.19444, 0.43056, 0.03588, 0.05556, 0.49028], + 122: [0, 0.43056, 0.04398, 0.05556, 0.46505], + 160: [0, 0, 0, 0, 0.25], + 915: [0, 0.68333, 0.13889, 0.08334, 0.61528], + 916: [0, 0.68333, 0, 0.16667, 0.83334], + 920: [0, 0.68333, 0.02778, 0.08334, 0.76278], + 923: [0, 0.68333, 0, 0.16667, 0.69445], + 926: [0, 0.68333, 0.07569, 0.08334, 0.74236], + 928: [0, 0.68333, 0.08125, 0.05556, 0.83125], + 931: [0, 0.68333, 0.05764, 0.08334, 0.77986], + 933: [0, 0.68333, 0.13889, 0.05556, 0.58333], + 934: [0, 0.68333, 0, 0.08334, 0.66667], + 936: [0, 0.68333, 0.11, 0.05556, 0.61222], + 937: [0, 0.68333, 0.05017, 0.08334, 0.7724], + 945: [0, 0.43056, 37e-4, 0.02778, 0.6397], + 946: [0.19444, 0.69444, 0.05278, 0.08334, 0.56563], + 947: [0.19444, 0.43056, 0.05556, 0, 0.51773], + 948: [0, 0.69444, 0.03785, 0.05556, 0.44444], + 949: [0, 0.43056, 0, 0.08334, 0.46632], + 950: [0.19444, 0.69444, 0.07378, 0.08334, 0.4375], + 951: [0.19444, 0.43056, 0.03588, 0.05556, 0.49653], + 952: [0, 0.69444, 0.02778, 0.08334, 0.46944], + 953: [0, 0.43056, 0, 0.05556, 0.35394], + 954: [0, 0.43056, 0, 0, 0.57616], + 955: [0, 0.69444, 0, 0, 0.58334], + 956: [0.19444, 0.43056, 0, 0.02778, 0.60255], + 957: [0, 0.43056, 0.06366, 0.02778, 0.49398], + 958: [0.19444, 0.69444, 0.04601, 0.11111, 0.4375], + 959: [0, 0.43056, 0, 0.05556, 0.48472], + 960: [0, 0.43056, 0.03588, 0, 0.57003], + 961: [0.19444, 0.43056, 0, 0.08334, 0.51702], + 962: [0.09722, 0.43056, 0.07986, 0.08334, 0.36285], + 963: [0, 0.43056, 0.03588, 0, 0.57141], + 964: [0, 0.43056, 0.1132, 0.02778, 0.43715], + 965: [0, 0.43056, 0.03588, 0.02778, 0.54028], + 966: [0.19444, 0.43056, 0, 0.08334, 0.65417], + 967: [0.19444, 0.43056, 0, 0.05556, 0.62569], + 968: [0.19444, 0.69444, 0.03588, 0.11111, 0.65139], + 969: [0, 0.43056, 0.03588, 0, 0.62245], + 977: [0, 0.69444, 0, 0.08334, 0.59144], + 981: [0.19444, 0.69444, 0, 0.08334, 0.59583], + 982: [0, 0.43056, 0.02778, 0, 0.82813], + 1009: [0.19444, 0.43056, 0, 0.08334, 0.51702], + 1013: [0, 0.43056, 0, 0.05556, 0.4059], + 57649: [0, 0.43056, 0, 0.02778, 0.32246], + 57911: [0.19444, 0.43056, 0, 0.08334, 0.38403] + }, + "SansSerif-Bold": { + 32: [0, 0, 0, 0, 0.25], + 33: [0, 0.69444, 0, 0, 0.36667], + 34: [0, 0.69444, 0, 0, 0.55834], + 35: [0.19444, 0.69444, 0, 0, 0.91667], + 36: [0.05556, 0.75, 0, 0, 0.55], + 37: [0.05556, 0.75, 0, 0, 1.02912], + 38: [0, 0.69444, 0, 0, 0.83056], + 39: [0, 0.69444, 0, 0, 0.30556], + 40: [0.25, 0.75, 0, 0, 0.42778], + 41: [0.25, 0.75, 0, 0, 0.42778], + 42: [0, 0.75, 0, 0, 0.55], + 43: [0.11667, 0.61667, 0, 0, 0.85556], + 44: [0.10556, 0.13056, 0, 0, 0.30556], + 45: [0, 0.45833, 0, 0, 0.36667], + 46: [0, 0.13056, 0, 0, 0.30556], + 47: [0.25, 0.75, 0, 0, 0.55], + 48: [0, 0.69444, 0, 0, 0.55], + 49: [0, 0.69444, 0, 0, 0.55], + 50: [0, 0.69444, 0, 0, 0.55], + 51: [0, 0.69444, 0, 0, 0.55], + 52: [0, 0.69444, 0, 0, 0.55], + 53: [0, 0.69444, 0, 0, 0.55], + 54: [0, 0.69444, 0, 0, 0.55], + 55: [0, 0.69444, 0, 0, 0.55], + 56: [0, 0.69444, 0, 0, 0.55], + 57: [0, 0.69444, 0, 0, 0.55], + 58: [0, 0.45833, 0, 0, 0.30556], + 59: [0.10556, 0.45833, 0, 0, 0.30556], + 61: [-0.09375, 0.40625, 0, 0, 0.85556], + 63: [0, 0.69444, 0, 0, 0.51945], + 64: [0, 0.69444, 0, 0, 0.73334], + 65: [0, 0.69444, 0, 0, 0.73334], + 66: [0, 0.69444, 0, 0, 0.73334], + 67: [0, 0.69444, 0, 0, 0.70278], + 68: [0, 0.69444, 0, 0, 0.79445], + 69: [0, 0.69444, 0, 0, 0.64167], + 70: [0, 0.69444, 0, 0, 0.61111], + 71: [0, 0.69444, 0, 0, 0.73334], + 72: [0, 0.69444, 0, 0, 0.79445], + 73: [0, 0.69444, 0, 0, 0.33056], + 74: [0, 0.69444, 0, 0, 0.51945], + 75: [0, 0.69444, 0, 0, 0.76389], + 76: [0, 0.69444, 0, 0, 0.58056], + 77: [0, 0.69444, 0, 0, 0.97778], + 78: [0, 0.69444, 0, 0, 0.79445], + 79: [0, 0.69444, 0, 0, 0.79445], + 80: [0, 0.69444, 0, 0, 0.70278], + 81: [0.10556, 0.69444, 0, 0, 0.79445], + 82: [0, 0.69444, 0, 0, 0.70278], + 83: [0, 0.69444, 0, 0, 0.61111], + 84: [0, 0.69444, 0, 0, 0.73334], + 85: [0, 0.69444, 0, 0, 0.76389], + 86: [0, 0.69444, 0.01528, 0, 0.73334], + 87: [0, 0.69444, 0.01528, 0, 1.03889], + 88: [0, 0.69444, 0, 0, 0.73334], + 89: [0, 0.69444, 0.0275, 0, 0.73334], + 90: [0, 0.69444, 0, 0, 0.67223], + 91: [0.25, 0.75, 0, 0, 0.34306], + 93: [0.25, 0.75, 0, 0, 0.34306], + 94: [0, 0.69444, 0, 0, 0.55], + 95: [0.35, 0.10833, 0.03056, 0, 0.55], + 97: [0, 0.45833, 0, 0, 0.525], + 98: [0, 0.69444, 0, 0, 0.56111], + 99: [0, 0.45833, 0, 0, 0.48889], + 100: [0, 0.69444, 0, 0, 0.56111], + 101: [0, 0.45833, 0, 0, 0.51111], + 102: [0, 0.69444, 0.07639, 0, 0.33611], + 103: [0.19444, 0.45833, 0.01528, 0, 0.55], + 104: [0, 0.69444, 0, 0, 0.56111], + 105: [0, 0.69444, 0, 0, 0.25556], + 106: [0.19444, 0.69444, 0, 0, 0.28611], + 107: [0, 0.69444, 0, 0, 0.53056], + 108: [0, 0.69444, 0, 0, 0.25556], + 109: [0, 0.45833, 0, 0, 0.86667], + 110: [0, 0.45833, 0, 0, 0.56111], + 111: [0, 0.45833, 0, 0, 0.55], + 112: [0.19444, 0.45833, 0, 0, 0.56111], + 113: [0.19444, 0.45833, 0, 0, 0.56111], + 114: [0, 0.45833, 0.01528, 0, 0.37222], + 115: [0, 0.45833, 0, 0, 0.42167], + 116: [0, 0.58929, 0, 0, 0.40417], + 117: [0, 0.45833, 0, 0, 0.56111], + 118: [0, 0.45833, 0.01528, 0, 0.5], + 119: [0, 0.45833, 0.01528, 0, 0.74445], + 120: [0, 0.45833, 0, 0, 0.5], + 121: [0.19444, 0.45833, 0.01528, 0, 0.5], + 122: [0, 0.45833, 0, 0, 0.47639], + 126: [0.35, 0.34444, 0, 0, 0.55], + 160: [0, 0, 0, 0, 0.25], + 168: [0, 0.69444, 0, 0, 0.55], + 176: [0, 0.69444, 0, 0, 0.73334], + 180: [0, 0.69444, 0, 0, 0.55], + 184: [0.17014, 0, 0, 0, 0.48889], + 305: [0, 0.45833, 0, 0, 0.25556], + 567: [0.19444, 0.45833, 0, 0, 0.28611], + 710: [0, 0.69444, 0, 0, 0.55], + 711: [0, 0.63542, 0, 0, 0.55], + 713: [0, 0.63778, 0, 0, 0.55], + 728: [0, 0.69444, 0, 0, 0.55], + 729: [0, 0.69444, 0, 0, 0.30556], + 730: [0, 0.69444, 0, 0, 0.73334], + 732: [0, 0.69444, 0, 0, 0.55], + 733: [0, 0.69444, 0, 0, 0.55], + 915: [0, 0.69444, 0, 0, 0.58056], + 916: [0, 0.69444, 0, 0, 0.91667], + 920: [0, 0.69444, 0, 0, 0.85556], + 923: [0, 0.69444, 0, 0, 0.67223], + 926: [0, 0.69444, 0, 0, 0.73334], + 928: [0, 0.69444, 0, 0, 0.79445], + 931: [0, 0.69444, 0, 0, 0.79445], + 933: [0, 0.69444, 0, 0, 0.85556], + 934: [0, 0.69444, 0, 0, 0.79445], + 936: [0, 0.69444, 0, 0, 0.85556], + 937: [0, 0.69444, 0, 0, 0.79445], + 8211: [0, 0.45833, 0.03056, 0, 0.55], + 8212: [0, 0.45833, 0.03056, 0, 1.10001], + 8216: [0, 0.69444, 0, 0, 0.30556], + 8217: [0, 0.69444, 0, 0, 0.30556], + 8220: [0, 0.69444, 0, 0, 0.55834], + 8221: [0, 0.69444, 0, 0, 0.55834] + }, + "SansSerif-Italic": { + 32: [0, 0, 0, 0, 0.25], + 33: [0, 0.69444, 0.05733, 0, 0.31945], + 34: [0, 0.69444, 316e-5, 0, 0.5], + 35: [0.19444, 0.69444, 0.05087, 0, 0.83334], + 36: [0.05556, 0.75, 0.11156, 0, 0.5], + 37: [0.05556, 0.75, 0.03126, 0, 0.83334], + 38: [0, 0.69444, 0.03058, 0, 0.75834], + 39: [0, 0.69444, 0.07816, 0, 0.27778], + 40: [0.25, 0.75, 0.13164, 0, 0.38889], + 41: [0.25, 0.75, 0.02536, 0, 0.38889], + 42: [0, 0.75, 0.11775, 0, 0.5], + 43: [0.08333, 0.58333, 0.02536, 0, 0.77778], + 44: [0.125, 0.08333, 0, 0, 0.27778], + 45: [0, 0.44444, 0.01946, 0, 0.33333], + 46: [0, 0.08333, 0, 0, 0.27778], + 47: [0.25, 0.75, 0.13164, 0, 0.5], + 48: [0, 0.65556, 0.11156, 0, 0.5], + 49: [0, 0.65556, 0.11156, 0, 0.5], + 50: [0, 0.65556, 0.11156, 0, 0.5], + 51: [0, 0.65556, 0.11156, 0, 0.5], + 52: [0, 0.65556, 0.11156, 0, 0.5], + 53: [0, 0.65556, 0.11156, 0, 0.5], + 54: [0, 0.65556, 0.11156, 0, 0.5], + 55: [0, 0.65556, 0.11156, 0, 0.5], + 56: [0, 0.65556, 0.11156, 0, 0.5], + 57: [0, 0.65556, 0.11156, 0, 0.5], + 58: [0, 0.44444, 0.02502, 0, 0.27778], + 59: [0.125, 0.44444, 0.02502, 0, 0.27778], + 61: [-0.13, 0.37, 0.05087, 0, 0.77778], + 63: [0, 0.69444, 0.11809, 0, 0.47222], + 64: [0, 0.69444, 0.07555, 0, 0.66667], + 65: [0, 0.69444, 0, 0, 0.66667], + 66: [0, 0.69444, 0.08293, 0, 0.66667], + 67: [0, 0.69444, 0.11983, 0, 0.63889], + 68: [0, 0.69444, 0.07555, 0, 0.72223], + 69: [0, 0.69444, 0.11983, 0, 0.59722], + 70: [0, 0.69444, 0.13372, 0, 0.56945], + 71: [0, 0.69444, 0.11983, 0, 0.66667], + 72: [0, 0.69444, 0.08094, 0, 0.70834], + 73: [0, 0.69444, 0.13372, 0, 0.27778], + 74: [0, 0.69444, 0.08094, 0, 0.47222], + 75: [0, 0.69444, 0.11983, 0, 0.69445], + 76: [0, 0.69444, 0, 0, 0.54167], + 77: [0, 0.69444, 0.08094, 0, 0.875], + 78: [0, 0.69444, 0.08094, 0, 0.70834], + 79: [0, 0.69444, 0.07555, 0, 0.73611], + 80: [0, 0.69444, 0.08293, 0, 0.63889], + 81: [0.125, 0.69444, 0.07555, 0, 0.73611], + 82: [0, 0.69444, 0.08293, 0, 0.64584], + 83: [0, 0.69444, 0.09205, 0, 0.55556], + 84: [0, 0.69444, 0.13372, 0, 0.68056], + 85: [0, 0.69444, 0.08094, 0, 0.6875], + 86: [0, 0.69444, 0.1615, 0, 0.66667], + 87: [0, 0.69444, 0.1615, 0, 0.94445], + 88: [0, 0.69444, 0.13372, 0, 0.66667], + 89: [0, 0.69444, 0.17261, 0, 0.66667], + 90: [0, 0.69444, 0.11983, 0, 0.61111], + 91: [0.25, 0.75, 0.15942, 0, 0.28889], + 93: [0.25, 0.75, 0.08719, 0, 0.28889], + 94: [0, 0.69444, 0.0799, 0, 0.5], + 95: [0.35, 0.09444, 0.08616, 0, 0.5], + 97: [0, 0.44444, 981e-5, 0, 0.48056], + 98: [0, 0.69444, 0.03057, 0, 0.51667], + 99: [0, 0.44444, 0.08336, 0, 0.44445], + 100: [0, 0.69444, 0.09483, 0, 0.51667], + 101: [0, 0.44444, 0.06778, 0, 0.44445], + 102: [0, 0.69444, 0.21705, 0, 0.30556], + 103: [0.19444, 0.44444, 0.10836, 0, 0.5], + 104: [0, 0.69444, 0.01778, 0, 0.51667], + 105: [0, 0.67937, 0.09718, 0, 0.23889], + 106: [0.19444, 0.67937, 0.09162, 0, 0.26667], + 107: [0, 0.69444, 0.08336, 0, 0.48889], + 108: [0, 0.69444, 0.09483, 0, 0.23889], + 109: [0, 0.44444, 0.01778, 0, 0.79445], + 110: [0, 0.44444, 0.01778, 0, 0.51667], + 111: [0, 0.44444, 0.06613, 0, 0.5], + 112: [0.19444, 0.44444, 0.0389, 0, 0.51667], + 113: [0.19444, 0.44444, 0.04169, 0, 0.51667], + 114: [0, 0.44444, 0.10836, 0, 0.34167], + 115: [0, 0.44444, 0.0778, 0, 0.38333], + 116: [0, 0.57143, 0.07225, 0, 0.36111], + 117: [0, 0.44444, 0.04169, 0, 0.51667], + 118: [0, 0.44444, 0.10836, 0, 0.46111], + 119: [0, 0.44444, 0.10836, 0, 0.68334], + 120: [0, 0.44444, 0.09169, 0, 0.46111], + 121: [0.19444, 0.44444, 0.10836, 0, 0.46111], + 122: [0, 0.44444, 0.08752, 0, 0.43472], + 126: [0.35, 0.32659, 0.08826, 0, 0.5], + 160: [0, 0, 0, 0, 0.25], + 168: [0, 0.67937, 0.06385, 0, 0.5], + 176: [0, 0.69444, 0, 0, 0.73752], + 184: [0.17014, 0, 0, 0, 0.44445], + 305: [0, 0.44444, 0.04169, 0, 0.23889], + 567: [0.19444, 0.44444, 0.04169, 0, 0.26667], + 710: [0, 0.69444, 0.0799, 0, 0.5], + 711: [0, 0.63194, 0.08432, 0, 0.5], + 713: [0, 0.60889, 0.08776, 0, 0.5], + 714: [0, 0.69444, 0.09205, 0, 0.5], + 715: [0, 0.69444, 0, 0, 0.5], + 728: [0, 0.69444, 0.09483, 0, 0.5], + 729: [0, 0.67937, 0.07774, 0, 0.27778], + 730: [0, 0.69444, 0, 0, 0.73752], + 732: [0, 0.67659, 0.08826, 0, 0.5], + 733: [0, 0.69444, 0.09205, 0, 0.5], + 915: [0, 0.69444, 0.13372, 0, 0.54167], + 916: [0, 0.69444, 0, 0, 0.83334], + 920: [0, 0.69444, 0.07555, 0, 0.77778], + 923: [0, 0.69444, 0, 0, 0.61111], + 926: [0, 0.69444, 0.12816, 0, 0.66667], + 928: [0, 0.69444, 0.08094, 0, 0.70834], + 931: [0, 0.69444, 0.11983, 0, 0.72222], + 933: [0, 0.69444, 0.09031, 0, 0.77778], + 934: [0, 0.69444, 0.04603, 0, 0.72222], + 936: [0, 0.69444, 0.09031, 0, 0.77778], + 937: [0, 0.69444, 0.08293, 0, 0.72222], + 8211: [0, 0.44444, 0.08616, 0, 0.5], + 8212: [0, 0.44444, 0.08616, 0, 1], + 8216: [0, 0.69444, 0.07816, 0, 0.27778], + 8217: [0, 0.69444, 0.07816, 0, 0.27778], + 8220: [0, 0.69444, 0.14205, 0, 0.5], + 8221: [0, 0.69444, 316e-5, 0, 0.5] + }, + "SansSerif-Regular": { + 32: [0, 0, 0, 0, 0.25], + 33: [0, 0.69444, 0, 0, 0.31945], + 34: [0, 0.69444, 0, 0, 0.5], + 35: [0.19444, 0.69444, 0, 0, 0.83334], + 36: [0.05556, 0.75, 0, 0, 0.5], + 37: [0.05556, 0.75, 0, 0, 0.83334], + 38: [0, 0.69444, 0, 0, 0.75834], + 39: [0, 0.69444, 0, 0, 0.27778], + 40: [0.25, 0.75, 0, 0, 0.38889], + 41: [0.25, 0.75, 0, 0, 0.38889], + 42: [0, 0.75, 0, 0, 0.5], + 43: [0.08333, 0.58333, 0, 0, 0.77778], + 44: [0.125, 0.08333, 0, 0, 0.27778], + 45: [0, 0.44444, 0, 0, 0.33333], + 46: [0, 0.08333, 0, 0, 0.27778], + 47: [0.25, 0.75, 0, 0, 0.5], + 48: [0, 0.65556, 0, 0, 0.5], + 49: [0, 0.65556, 0, 0, 0.5], + 50: [0, 0.65556, 0, 0, 0.5], + 51: [0, 0.65556, 0, 0, 0.5], + 52: [0, 0.65556, 0, 0, 0.5], + 53: [0, 0.65556, 0, 0, 0.5], + 54: [0, 0.65556, 0, 0, 0.5], + 55: [0, 0.65556, 0, 0, 0.5], + 56: [0, 0.65556, 0, 0, 0.5], + 57: [0, 0.65556, 0, 0, 0.5], + 58: [0, 0.44444, 0, 0, 0.27778], + 59: [0.125, 0.44444, 0, 0, 0.27778], + 61: [-0.13, 0.37, 0, 0, 0.77778], + 63: [0, 0.69444, 0, 0, 0.47222], + 64: [0, 0.69444, 0, 0, 0.66667], + 65: [0, 0.69444, 0, 0, 0.66667], + 66: [0, 0.69444, 0, 0, 0.66667], + 67: [0, 0.69444, 0, 0, 0.63889], + 68: [0, 0.69444, 0, 0, 0.72223], + 69: [0, 0.69444, 0, 0, 0.59722], + 70: [0, 0.69444, 0, 0, 0.56945], + 71: [0, 0.69444, 0, 0, 0.66667], + 72: [0, 0.69444, 0, 0, 0.70834], + 73: [0, 0.69444, 0, 0, 0.27778], + 74: [0, 0.69444, 0, 0, 0.47222], + 75: [0, 0.69444, 0, 0, 0.69445], + 76: [0, 0.69444, 0, 0, 0.54167], + 77: [0, 0.69444, 0, 0, 0.875], + 78: [0, 0.69444, 0, 0, 0.70834], + 79: [0, 0.69444, 0, 0, 0.73611], + 80: [0, 0.69444, 0, 0, 0.63889], + 81: [0.125, 0.69444, 0, 0, 0.73611], + 82: [0, 0.69444, 0, 0, 0.64584], + 83: [0, 0.69444, 0, 0, 0.55556], + 84: [0, 0.69444, 0, 0, 0.68056], + 85: [0, 0.69444, 0, 0, 0.6875], + 86: [0, 0.69444, 0.01389, 0, 0.66667], + 87: [0, 0.69444, 0.01389, 0, 0.94445], + 88: [0, 0.69444, 0, 0, 0.66667], + 89: [0, 0.69444, 0.025, 0, 0.66667], + 90: [0, 0.69444, 0, 0, 0.61111], + 91: [0.25, 0.75, 0, 0, 0.28889], + 93: [0.25, 0.75, 0, 0, 0.28889], + 94: [0, 0.69444, 0, 0, 0.5], + 95: [0.35, 0.09444, 0.02778, 0, 0.5], + 97: [0, 0.44444, 0, 0, 0.48056], + 98: [0, 0.69444, 0, 0, 0.51667], + 99: [0, 0.44444, 0, 0, 0.44445], + 100: [0, 0.69444, 0, 0, 0.51667], + 101: [0, 0.44444, 0, 0, 0.44445], + 102: [0, 0.69444, 0.06944, 0, 0.30556], + 103: [0.19444, 0.44444, 0.01389, 0, 0.5], + 104: [0, 0.69444, 0, 0, 0.51667], + 105: [0, 0.67937, 0, 0, 0.23889], + 106: [0.19444, 0.67937, 0, 0, 0.26667], + 107: [0, 0.69444, 0, 0, 0.48889], + 108: [0, 0.69444, 0, 0, 0.23889], + 109: [0, 0.44444, 0, 0, 0.79445], + 110: [0, 0.44444, 0, 0, 0.51667], + 111: [0, 0.44444, 0, 0, 0.5], + 112: [0.19444, 0.44444, 0, 0, 0.51667], + 113: [0.19444, 0.44444, 0, 0, 0.51667], + 114: [0, 0.44444, 0.01389, 0, 0.34167], + 115: [0, 0.44444, 0, 0, 0.38333], + 116: [0, 0.57143, 0, 0, 0.36111], + 117: [0, 0.44444, 0, 0, 0.51667], + 118: [0, 0.44444, 0.01389, 0, 0.46111], + 119: [0, 0.44444, 0.01389, 0, 0.68334], + 120: [0, 0.44444, 0, 0, 0.46111], + 121: [0.19444, 0.44444, 0.01389, 0, 0.46111], + 122: [0, 0.44444, 0, 0, 0.43472], + 126: [0.35, 0.32659, 0, 0, 0.5], + 160: [0, 0, 0, 0, 0.25], + 168: [0, 0.67937, 0, 0, 0.5], + 176: [0, 0.69444, 0, 0, 0.66667], + 184: [0.17014, 0, 0, 0, 0.44445], + 305: [0, 0.44444, 0, 0, 0.23889], + 567: [0.19444, 0.44444, 0, 0, 0.26667], + 710: [0, 0.69444, 0, 0, 0.5], + 711: [0, 0.63194, 0, 0, 0.5], + 713: [0, 0.60889, 0, 0, 0.5], + 714: [0, 0.69444, 0, 0, 0.5], + 715: [0, 0.69444, 0, 0, 0.5], + 728: [0, 0.69444, 0, 0, 0.5], + 729: [0, 0.67937, 0, 0, 0.27778], + 730: [0, 0.69444, 0, 0, 0.66667], + 732: [0, 0.67659, 0, 0, 0.5], + 733: [0, 0.69444, 0, 0, 0.5], + 915: [0, 0.69444, 0, 0, 0.54167], + 916: [0, 0.69444, 0, 0, 0.83334], + 920: [0, 0.69444, 0, 0, 0.77778], + 923: [0, 0.69444, 0, 0, 0.61111], + 926: [0, 0.69444, 0, 0, 0.66667], + 928: [0, 0.69444, 0, 0, 0.70834], + 931: [0, 0.69444, 0, 0, 0.72222], + 933: [0, 0.69444, 0, 0, 0.77778], + 934: [0, 0.69444, 0, 0, 0.72222], + 936: [0, 0.69444, 0, 0, 0.77778], + 937: [0, 0.69444, 0, 0, 0.72222], + 8211: [0, 0.44444, 0.02778, 0, 0.5], + 8212: [0, 0.44444, 0.02778, 0, 1], + 8216: [0, 0.69444, 0, 0, 0.27778], + 8217: [0, 0.69444, 0, 0, 0.27778], + 8220: [0, 0.69444, 0, 0, 0.5], + 8221: [0, 0.69444, 0, 0, 0.5] + }, + "Script-Regular": { + 32: [0, 0, 0, 0, 0.25], + 65: [0, 0.7, 0.22925, 0, 0.80253], + 66: [0, 0.7, 0.04087, 0, 0.90757], + 67: [0, 0.7, 0.1689, 0, 0.66619], + 68: [0, 0.7, 0.09371, 0, 0.77443], + 69: [0, 0.7, 0.18583, 0, 0.56162], + 70: [0, 0.7, 0.13634, 0, 0.89544], + 71: [0, 0.7, 0.17322, 0, 0.60961], + 72: [0, 0.7, 0.29694, 0, 0.96919], + 73: [0, 0.7, 0.19189, 0, 0.80907], + 74: [0.27778, 0.7, 0.19189, 0, 1.05159], + 75: [0, 0.7, 0.31259, 0, 0.91364], + 76: [0, 0.7, 0.19189, 0, 0.87373], + 77: [0, 0.7, 0.15981, 0, 1.08031], + 78: [0, 0.7, 0.3525, 0, 0.9015], + 79: [0, 0.7, 0.08078, 0, 0.73787], + 80: [0, 0.7, 0.08078, 0, 1.01262], + 81: [0, 0.7, 0.03305, 0, 0.88282], + 82: [0, 0.7, 0.06259, 0, 0.85], + 83: [0, 0.7, 0.19189, 0, 0.86767], + 84: [0, 0.7, 0.29087, 0, 0.74697], + 85: [0, 0.7, 0.25815, 0, 0.79996], + 86: [0, 0.7, 0.27523, 0, 0.62204], + 87: [0, 0.7, 0.27523, 0, 0.80532], + 88: [0, 0.7, 0.26006, 0, 0.94445], + 89: [0, 0.7, 0.2939, 0, 0.70961], + 90: [0, 0.7, 0.24037, 0, 0.8212], + 160: [0, 0, 0, 0, 0.25] + }, + "Size1-Regular": { + 32: [0, 0, 0, 0, 0.25], + 40: [0.35001, 0.85, 0, 0, 0.45834], + 41: [0.35001, 0.85, 0, 0, 0.45834], + 47: [0.35001, 0.85, 0, 0, 0.57778], + 91: [0.35001, 0.85, 0, 0, 0.41667], + 92: [0.35001, 0.85, 0, 0, 0.57778], + 93: [0.35001, 0.85, 0, 0, 0.41667], + 123: [0.35001, 0.85, 0, 0, 0.58334], + 125: [0.35001, 0.85, 0, 0, 0.58334], + 160: [0, 0, 0, 0, 0.25], + 710: [0, 0.72222, 0, 0, 0.55556], + 732: [0, 0.72222, 0, 0, 0.55556], + 770: [0, 0.72222, 0, 0, 0.55556], + 771: [0, 0.72222, 0, 0, 0.55556], + 8214: [-99e-5, 0.601, 0, 0, 0.77778], + 8593: [1e-5, 0.6, 0, 0, 0.66667], + 8595: [1e-5, 0.6, 0, 0, 0.66667], + 8657: [1e-5, 0.6, 0, 0, 0.77778], + 8659: [1e-5, 0.6, 0, 0, 0.77778], + 8719: [0.25001, 0.75, 0, 0, 0.94445], + 8720: [0.25001, 0.75, 0, 0, 0.94445], + 8721: [0.25001, 0.75, 0, 0, 1.05556], + 8730: [0.35001, 0.85, 0, 0, 1], + 8739: [-599e-5, 0.606, 0, 0, 0.33333], + 8741: [-599e-5, 0.606, 0, 0, 0.55556], + 8747: [0.30612, 0.805, 0.19445, 0, 0.47222], + 8748: [0.306, 0.805, 0.19445, 0, 0.47222], + 8749: [0.306, 0.805, 0.19445, 0, 0.47222], + 8750: [0.30612, 0.805, 0.19445, 0, 0.47222], + 8896: [0.25001, 0.75, 0, 0, 0.83334], + 8897: [0.25001, 0.75, 0, 0, 0.83334], + 8898: [0.25001, 0.75, 0, 0, 0.83334], + 8899: [0.25001, 0.75, 0, 0, 0.83334], + 8968: [0.35001, 0.85, 0, 0, 0.47222], + 8969: [0.35001, 0.85, 0, 0, 0.47222], + 8970: [0.35001, 0.85, 0, 0, 0.47222], + 8971: [0.35001, 0.85, 0, 0, 0.47222], + 9168: [-99e-5, 0.601, 0, 0, 0.66667], + 10216: [0.35001, 0.85, 0, 0, 0.47222], + 10217: [0.35001, 0.85, 0, 0, 0.47222], + 10752: [0.25001, 0.75, 0, 0, 1.11111], + 10753: [0.25001, 0.75, 0, 0, 1.11111], + 10754: [0.25001, 0.75, 0, 0, 1.11111], + 10756: [0.25001, 0.75, 0, 0, 0.83334], + 10758: [0.25001, 0.75, 0, 0, 0.83334] + }, + "Size2-Regular": { + 32: [0, 0, 0, 0, 0.25], + 40: [0.65002, 1.15, 0, 0, 0.59722], + 41: [0.65002, 1.15, 0, 0, 0.59722], + 47: [0.65002, 1.15, 0, 0, 0.81111], + 91: [0.65002, 1.15, 0, 0, 0.47222], + 92: [0.65002, 1.15, 0, 0, 0.81111], + 93: [0.65002, 1.15, 0, 0, 0.47222], + 123: [0.65002, 1.15, 0, 0, 0.66667], + 125: [0.65002, 1.15, 0, 0, 0.66667], + 160: [0, 0, 0, 0, 0.25], + 710: [0, 0.75, 0, 0, 1], + 732: [0, 0.75, 0, 0, 1], + 770: [0, 0.75, 0, 0, 1], + 771: [0, 0.75, 0, 0, 1], + 8719: [0.55001, 1.05, 0, 0, 1.27778], + 8720: [0.55001, 1.05, 0, 0, 1.27778], + 8721: [0.55001, 1.05, 0, 0, 1.44445], + 8730: [0.65002, 1.15, 0, 0, 1], + 8747: [0.86225, 1.36, 0.44445, 0, 0.55556], + 8748: [0.862, 1.36, 0.44445, 0, 0.55556], + 8749: [0.862, 1.36, 0.44445, 0, 0.55556], + 8750: [0.86225, 1.36, 0.44445, 0, 0.55556], + 8896: [0.55001, 1.05, 0, 0, 1.11111], + 8897: [0.55001, 1.05, 0, 0, 1.11111], + 8898: [0.55001, 1.05, 0, 0, 1.11111], + 8899: [0.55001, 1.05, 0, 0, 1.11111], + 8968: [0.65002, 1.15, 0, 0, 0.52778], + 8969: [0.65002, 1.15, 0, 0, 0.52778], + 8970: [0.65002, 1.15, 0, 0, 0.52778], + 8971: [0.65002, 1.15, 0, 0, 0.52778], + 10216: [0.65002, 1.15, 0, 0, 0.61111], + 10217: [0.65002, 1.15, 0, 0, 0.61111], + 10752: [0.55001, 1.05, 0, 0, 1.51112], + 10753: [0.55001, 1.05, 0, 0, 1.51112], + 10754: [0.55001, 1.05, 0, 0, 1.51112], + 10756: [0.55001, 1.05, 0, 0, 1.11111], + 10758: [0.55001, 1.05, 0, 0, 1.11111] + }, + "Size3-Regular": { + 32: [0, 0, 0, 0, 0.25], + 40: [0.95003, 1.45, 0, 0, 0.73611], + 41: [0.95003, 1.45, 0, 0, 0.73611], + 47: [0.95003, 1.45, 0, 0, 1.04445], + 91: [0.95003, 1.45, 0, 0, 0.52778], + 92: [0.95003, 1.45, 0, 0, 1.04445], + 93: [0.95003, 1.45, 0, 0, 0.52778], + 123: [0.95003, 1.45, 0, 0, 0.75], + 125: [0.95003, 1.45, 0, 0, 0.75], + 160: [0, 0, 0, 0, 0.25], + 710: [0, 0.75, 0, 0, 1.44445], + 732: [0, 0.75, 0, 0, 1.44445], + 770: [0, 0.75, 0, 0, 1.44445], + 771: [0, 0.75, 0, 0, 1.44445], + 8730: [0.95003, 1.45, 0, 0, 1], + 8968: [0.95003, 1.45, 0, 0, 0.58334], + 8969: [0.95003, 1.45, 0, 0, 0.58334], + 8970: [0.95003, 1.45, 0, 0, 0.58334], + 8971: [0.95003, 1.45, 0, 0, 0.58334], + 10216: [0.95003, 1.45, 0, 0, 0.75], + 10217: [0.95003, 1.45, 0, 0, 0.75] + }, + "Size4-Regular": { + 32: [0, 0, 0, 0, 0.25], + 40: [1.25003, 1.75, 0, 0, 0.79167], + 41: [1.25003, 1.75, 0, 0, 0.79167], + 47: [1.25003, 1.75, 0, 0, 1.27778], + 91: [1.25003, 1.75, 0, 0, 0.58334], + 92: [1.25003, 1.75, 0, 0, 1.27778], + 93: [1.25003, 1.75, 0, 0, 0.58334], + 123: [1.25003, 1.75, 0, 0, 0.80556], + 125: [1.25003, 1.75, 0, 0, 0.80556], + 160: [0, 0, 0, 0, 0.25], + 710: [0, 0.825, 0, 0, 1.8889], + 732: [0, 0.825, 0, 0, 1.8889], + 770: [0, 0.825, 0, 0, 1.8889], + 771: [0, 0.825, 0, 0, 1.8889], + 8730: [1.25003, 1.75, 0, 0, 1], + 8968: [1.25003, 1.75, 0, 0, 0.63889], + 8969: [1.25003, 1.75, 0, 0, 0.63889], + 8970: [1.25003, 1.75, 0, 0, 0.63889], + 8971: [1.25003, 1.75, 0, 0, 0.63889], + 9115: [0.64502, 1.155, 0, 0, 0.875], + 9116: [1e-5, 0.6, 0, 0, 0.875], + 9117: [0.64502, 1.155, 0, 0, 0.875], + 9118: [0.64502, 1.155, 0, 0, 0.875], + 9119: [1e-5, 0.6, 0, 0, 0.875], + 9120: [0.64502, 1.155, 0, 0, 0.875], + 9121: [0.64502, 1.155, 0, 0, 0.66667], + 9122: [-99e-5, 0.601, 0, 0, 0.66667], + 9123: [0.64502, 1.155, 0, 0, 0.66667], + 9124: [0.64502, 1.155, 0, 0, 0.66667], + 9125: [-99e-5, 0.601, 0, 0, 0.66667], + 9126: [0.64502, 1.155, 0, 0, 0.66667], + 9127: [1e-5, 0.9, 0, 0, 0.88889], + 9128: [0.65002, 1.15, 0, 0, 0.88889], + 9129: [0.90001, 0, 0, 0, 0.88889], + 9130: [0, 0.3, 0, 0, 0.88889], + 9131: [1e-5, 0.9, 0, 0, 0.88889], + 9132: [0.65002, 1.15, 0, 0, 0.88889], + 9133: [0.90001, 0, 0, 0, 0.88889], + 9143: [0.88502, 0.915, 0, 0, 1.05556], + 10216: [1.25003, 1.75, 0, 0, 0.80556], + 10217: [1.25003, 1.75, 0, 0, 0.80556], + 57344: [-499e-5, 0.605, 0, 0, 1.05556], + 57345: [-499e-5, 0.605, 0, 0, 1.05556], + 57680: [0, 0.12, 0, 0, 0.45], + 57681: [0, 0.12, 0, 0, 0.45], + 57682: [0, 0.12, 0, 0, 0.45], + 57683: [0, 0.12, 0, 0, 0.45] + }, + "Typewriter-Regular": { + 32: [0, 0, 0, 0, 0.525], + 33: [0, 0.61111, 0, 0, 0.525], + 34: [0, 0.61111, 0, 0, 0.525], + 35: [0, 0.61111, 0, 0, 0.525], + 36: [0.08333, 0.69444, 0, 0, 0.525], + 37: [0.08333, 0.69444, 0, 0, 0.525], + 38: [0, 0.61111, 0, 0, 0.525], + 39: [0, 0.61111, 0, 0, 0.525], + 40: [0.08333, 0.69444, 0, 0, 0.525], + 41: [0.08333, 0.69444, 0, 0, 0.525], + 42: [0, 0.52083, 0, 0, 0.525], + 43: [-0.08056, 0.53055, 0, 0, 0.525], + 44: [0.13889, 0.125, 0, 0, 0.525], + 45: [-0.08056, 0.53055, 0, 0, 0.525], + 46: [0, 0.125, 0, 0, 0.525], + 47: [0.08333, 0.69444, 0, 0, 0.525], + 48: [0, 0.61111, 0, 0, 0.525], + 49: [0, 0.61111, 0, 0, 0.525], + 50: [0, 0.61111, 0, 0, 0.525], + 51: [0, 0.61111, 0, 0, 0.525], + 52: [0, 0.61111, 0, 0, 0.525], + 53: [0, 0.61111, 0, 0, 0.525], + 54: [0, 0.61111, 0, 0, 0.525], + 55: [0, 0.61111, 0, 0, 0.525], + 56: [0, 0.61111, 0, 0, 0.525], + 57: [0, 0.61111, 0, 0, 0.525], + 58: [0, 0.43056, 0, 0, 0.525], + 59: [0.13889, 0.43056, 0, 0, 0.525], + 60: [-0.05556, 0.55556, 0, 0, 0.525], + 61: [-0.19549, 0.41562, 0, 0, 0.525], + 62: [-0.05556, 0.55556, 0, 0, 0.525], + 63: [0, 0.61111, 0, 0, 0.525], + 64: [0, 0.61111, 0, 0, 0.525], + 65: [0, 0.61111, 0, 0, 0.525], + 66: [0, 0.61111, 0, 0, 0.525], + 67: [0, 0.61111, 0, 0, 0.525], + 68: [0, 0.61111, 0, 0, 0.525], + 69: [0, 0.61111, 0, 0, 0.525], + 70: [0, 0.61111, 0, 0, 0.525], + 71: [0, 0.61111, 0, 0, 0.525], + 72: [0, 0.61111, 0, 0, 0.525], + 73: [0, 0.61111, 0, 0, 0.525], + 74: [0, 0.61111, 0, 0, 0.525], + 75: [0, 0.61111, 0, 0, 0.525], + 76: [0, 0.61111, 0, 0, 0.525], + 77: [0, 0.61111, 0, 0, 0.525], + 78: [0, 0.61111, 0, 0, 0.525], + 79: [0, 0.61111, 0, 0, 0.525], + 80: [0, 0.61111, 0, 0, 0.525], + 81: [0.13889, 0.61111, 0, 0, 0.525], + 82: [0, 0.61111, 0, 0, 0.525], + 83: [0, 0.61111, 0, 0, 0.525], + 84: [0, 0.61111, 0, 0, 0.525], + 85: [0, 0.61111, 0, 0, 0.525], + 86: [0, 0.61111, 0, 0, 0.525], + 87: [0, 0.61111, 0, 0, 0.525], + 88: [0, 0.61111, 0, 0, 0.525], + 89: [0, 0.61111, 0, 0, 0.525], + 90: [0, 0.61111, 0, 0, 0.525], + 91: [0.08333, 0.69444, 0, 0, 0.525], + 92: [0.08333, 0.69444, 0, 0, 0.525], + 93: [0.08333, 0.69444, 0, 0, 0.525], + 94: [0, 0.61111, 0, 0, 0.525], + 95: [0.09514, 0, 0, 0, 0.525], + 96: [0, 0.61111, 0, 0, 0.525], + 97: [0, 0.43056, 0, 0, 0.525], + 98: [0, 0.61111, 0, 0, 0.525], + 99: [0, 0.43056, 0, 0, 0.525], + 100: [0, 0.61111, 0, 0, 0.525], + 101: [0, 0.43056, 0, 0, 0.525], + 102: [0, 0.61111, 0, 0, 0.525], + 103: [0.22222, 0.43056, 0, 0, 0.525], + 104: [0, 0.61111, 0, 0, 0.525], + 105: [0, 0.61111, 0, 0, 0.525], + 106: [0.22222, 0.61111, 0, 0, 0.525], + 107: [0, 0.61111, 0, 0, 0.525], + 108: [0, 0.61111, 0, 0, 0.525], + 109: [0, 0.43056, 0, 0, 0.525], + 110: [0, 0.43056, 0, 0, 0.525], + 111: [0, 0.43056, 0, 0, 0.525], + 112: [0.22222, 0.43056, 0, 0, 0.525], + 113: [0.22222, 0.43056, 0, 0, 0.525], + 114: [0, 0.43056, 0, 0, 0.525], + 115: [0, 0.43056, 0, 0, 0.525], + 116: [0, 0.55358, 0, 0, 0.525], + 117: [0, 0.43056, 0, 0, 0.525], + 118: [0, 0.43056, 0, 0, 0.525], + 119: [0, 0.43056, 0, 0, 0.525], + 120: [0, 0.43056, 0, 0, 0.525], + 121: [0.22222, 0.43056, 0, 0, 0.525], + 122: [0, 0.43056, 0, 0, 0.525], + 123: [0.08333, 0.69444, 0, 0, 0.525], + 124: [0.08333, 0.69444, 0, 0, 0.525], + 125: [0.08333, 0.69444, 0, 0, 0.525], + 126: [0, 0.61111, 0, 0, 0.525], + 127: [0, 0.61111, 0, 0, 0.525], + 160: [0, 0, 0, 0, 0.525], + 176: [0, 0.61111, 0, 0, 0.525], + 184: [0.19445, 0, 0, 0, 0.525], + 305: [0, 0.43056, 0, 0, 0.525], + 567: [0.22222, 0.43056, 0, 0, 0.525], + 711: [0, 0.56597, 0, 0, 0.525], + 713: [0, 0.56555, 0, 0, 0.525], + 714: [0, 0.61111, 0, 0, 0.525], + 715: [0, 0.61111, 0, 0, 0.525], + 728: [0, 0.61111, 0, 0, 0.525], + 730: [0, 0.61111, 0, 0, 0.525], + 770: [0, 0.61111, 0, 0, 0.525], + 771: [0, 0.61111, 0, 0, 0.525], + 776: [0, 0.61111, 0, 0, 0.525], + 915: [0, 0.61111, 0, 0, 0.525], + 916: [0, 0.61111, 0, 0, 0.525], + 920: [0, 0.61111, 0, 0, 0.525], + 923: [0, 0.61111, 0, 0, 0.525], + 926: [0, 0.61111, 0, 0, 0.525], + 928: [0, 0.61111, 0, 0, 0.525], + 931: [0, 0.61111, 0, 0, 0.525], + 933: [0, 0.61111, 0, 0, 0.525], + 934: [0, 0.61111, 0, 0, 0.525], + 936: [0, 0.61111, 0, 0, 0.525], + 937: [0, 0.61111, 0, 0, 0.525], + 8216: [0, 0.61111, 0, 0, 0.525], + 8217: [0, 0.61111, 0, 0, 0.525], + 8242: [0, 0.61111, 0, 0, 0.525], + 9251: [0.11111, 0.21944, 0, 0, 0.525] + } +}, sigmasAndXis = { + slant: [0.25, 0.25, 0.25], + // sigma1 + space: [0, 0, 0], + // sigma2 + stretch: [0, 0, 0], + // sigma3 + shrink: [0, 0, 0], + // sigma4 + xHeight: [0.431, 0.431, 0.431], + // sigma5 + quad: [1, 1.171, 1.472], + // sigma6 + extraSpace: [0, 0, 0], + // sigma7 + num1: [0.677, 0.732, 0.925], + // sigma8 + num2: [0.394, 0.384, 0.387], + // sigma9 + num3: [0.444, 0.471, 0.504], + // sigma10 + denom1: [0.686, 0.752, 1.025], + // sigma11 + denom2: [0.345, 0.344, 0.532], + // sigma12 + sup1: [0.413, 0.503, 0.504], + // sigma13 + sup2: [0.363, 0.431, 0.404], + // sigma14 + sup3: [0.289, 0.286, 0.294], + // sigma15 + sub1: [0.15, 0.143, 0.2], + // sigma16 + sub2: [0.247, 0.286, 0.4], + // sigma17 + supDrop: [0.386, 0.353, 0.494], + // sigma18 + subDrop: [0.05, 0.071, 0.1], + // sigma19 + delim1: [2.39, 1.7, 1.98], + // sigma20 + delim2: [1.01, 1.157, 1.42], + // sigma21 + axisHeight: [0.25, 0.25, 0.25], + // sigma22 + // These font metrics are extracted from TeX by using tftopl on cmex10.tfm; + // they correspond to the font parameters of the extension fonts (family 3). + // See the TeXbook, page 441. In AMSTeX, the extension fonts scale; to + // match cmex7, we'd use cmex7.tfm values for script and scriptscript + // values. + defaultRuleThickness: [0.04, 0.049, 0.049], + // xi8; cmex7: 0.049 + bigOpSpacing1: [0.111, 0.111, 0.111], + // xi9 + bigOpSpacing2: [0.166, 0.166, 0.166], + // xi10 + bigOpSpacing3: [0.2, 0.2, 0.2], + // xi11 + bigOpSpacing4: [0.6, 0.611, 0.611], + // xi12; cmex7: 0.611 + bigOpSpacing5: [0.1, 0.143, 0.143], + // xi13; cmex7: 0.143 + // The \sqrt rule width is taken from the height of the surd character. + // Since we use the same font at all sizes, this thickness doesn't scale. + sqrtRuleThickness: [0.04, 0.04, 0.04], + // This value determines how large a pt is, for metrics which are defined + // in terms of pts. + // This value is also used in katex.scss; if you change it make sure the + // values match. + ptPerEm: [10, 10, 10], + // The space between adjacent `|` columns in an array definition. From + // `\showthe\doublerulesep` in LaTeX. Equals 2.0 / ptPerEm. + doubleRuleSep: [0.2, 0.2, 0.2], + // The width of separator lines in {array} environments. From + // `\showthe\arrayrulewidth` in LaTeX. Equals 0.4 / ptPerEm. + arrayRuleWidth: [0.04, 0.04, 0.04], + // Two values from LaTeX source2e: + fboxsep: [0.3, 0.3, 0.3], + // 3 pt / ptPerEm + fboxrule: [0.04, 0.04, 0.04] + // 0.4 pt / ptPerEm +}, extraCharacterMap = { + // Latin-1 + Å: "A", + Ð: "D", + Þ: "o", + å: "a", + ð: "d", + þ: "o", + // Cyrillic + А: "A", + Б: "B", + В: "B", + Г: "F", + Д: "A", + Е: "E", + Ж: "K", + З: "3", + И: "N", + Й: "N", + К: "K", + Л: "N", + М: "M", + Н: "H", + О: "O", + П: "N", + Р: "P", + С: "C", + Т: "T", + У: "y", + Ф: "O", + Х: "X", + Ц: "U", + Ч: "h", + Ш: "W", + Щ: "W", + Ъ: "B", + Ы: "X", + Ь: "B", + Э: "3", + Ю: "X", + Я: "R", + а: "a", + б: "b", + в: "a", + г: "r", + д: "y", + е: "e", + ж: "m", + з: "e", + и: "n", + й: "n", + к: "n", + л: "n", + м: "m", + н: "n", + о: "o", + п: "n", + р: "p", + с: "c", + т: "o", + у: "y", + ф: "b", + х: "x", + ц: "n", + ч: "n", + ш: "w", + щ: "w", + ъ: "a", + ы: "m", + ь: "a", + э: "e", + ю: "m", + я: "r" +}; +function setFontMetrics(s, e) { + fontMetricsData[s] = e; +} +function getCharacterMetrics(s, e, r) { + if (!fontMetricsData[e]) + throw new Error("Font metrics not found for font: " + e + "."); + var o = s.charCodeAt(0), m = fontMetricsData[e][o]; + if (!m && s[0] in extraCharacterMap && (o = extraCharacterMap[s[0]].charCodeAt(0), m = fontMetricsData[e][o]), !m && r === "text" && supportedCodepoint(o) && (m = fontMetricsData[e][77]), m) + return { + depth: m[0], + height: m[1], + italic: m[2], + skew: m[3], + width: m[4] + }; +} +var fontMetricsBySizeIndex = {}; +function getGlobalMetrics(s) { + var e; + if (s >= 5 ? e = 0 : s >= 3 ? e = 1 : e = 2, !fontMetricsBySizeIndex[e]) { + var r = fontMetricsBySizeIndex[e] = { + cssEmPerMu: sigmasAndXis.quad[e] / 18 + }; + for (var o in sigmasAndXis) + sigmasAndXis.hasOwnProperty(o) && (r[o] = sigmasAndXis[o][e]); + } + return fontMetricsBySizeIndex[e]; +} +var sizeStyleMap = [ + // Each element contains [textsize, scriptsize, scriptscriptsize]. + // The size mappings are taken from TeX with \normalsize=10pt. + [1, 1, 1], + // size1: [5, 5, 5] \tiny + [2, 1, 1], + // size2: [6, 5, 5] + [3, 1, 1], + // size3: [7, 5, 5] \scriptsize + [4, 2, 1], + // size4: [8, 6, 5] \footnotesize + [5, 2, 1], + // size5: [9, 6, 5] \small + [6, 3, 1], + // size6: [10, 7, 5] \normalsize + [7, 4, 2], + // size7: [12, 8, 6] \large + [8, 6, 3], + // size8: [14.4, 10, 7] \Large + [9, 7, 6], + // size9: [17.28, 12, 10] \LARGE + [10, 8, 7], + // size10: [20.74, 14.4, 12] \huge + [11, 10, 9] + // size11: [24.88, 20.74, 17.28] \HUGE +], sizeMultipliers = [ + // fontMetrics.js:getGlobalMetrics also uses size indexes, so if + // you change size indexes, change that function. + 0.5, + 0.6, + 0.7, + 0.8, + 0.9, + 1, + 1.2, + 1.44, + 1.728, + 2.074, + 2.488 +], sizeAtStyle = function(e, r) { + return r.size < 2 ? e : sizeStyleMap[e - 1][r.size - 1]; +}; +class Options { + // A font family applies to a group of fonts (i.e. SansSerif), while a font + // represents a specific font (i.e. SansSerif Bold). + // See: https://tex.stackexchange.com/questions/22350/difference-between-textrm-and-mathrm + /** + * The base size index. + */ + 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 || Options.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 = sizeMultipliers[this.size - 1], this.maxSize = e.maxSize, this.minRuleThickness = e.minRuleThickness, this._fontMetrics = void 0; + } + /** + * Returns a new options object with the same properties as "this". Properties + * from "extension" will be copied to the new options object. + */ + extend(e) { + var r = { + 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 o in e) + e.hasOwnProperty(o) && (r[o] = e[o]); + return new Options(r); + } + /** + * Return an options object with the given style. If `this.style === style`, + * returns `this`. + */ + havingStyle(e) { + return this.style === e ? this : this.extend({ + style: e, + size: sizeAtStyle(this.textSize, e) + }); + } + /** + * Return an options object with a cramped version of the current style. If + * the current style is cramped, returns `this`. + */ + havingCrampedStyle() { + return this.havingStyle(this.style.cramp()); + } + /** + * Return an options object with the given size and in at least `\textstyle`. + * Returns `this` if appropriate. + */ + havingSize(e) { + return this.size === e && this.textSize === e ? this : this.extend({ + style: this.style.text(), + size: e, + textSize: e, + sizeMultiplier: sizeMultipliers[e - 1] + }); + } + /** + * Like `this.havingSize(BASESIZE).havingStyle(style)`. If `style` is omitted, + * changes to at least `\textstyle`. + */ + havingBaseStyle(e) { + e = e || this.style.text(); + var r = sizeAtStyle(Options.BASESIZE, e); + return this.size === r && this.textSize === Options.BASESIZE && this.style === e ? this : this.extend({ + style: e, + size: r + }); + } + /** + * Remove the effect of sizing changes such as \Huge. + * Keep the effect of the current style, such as \scriptstyle. + */ + 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 + }); + } + /** + * Create a new options object with the given color. + */ + withColor(e) { + return this.extend({ + color: e + }); + } + /** + * Create a new options object with "phantom" set to true. + */ + withPhantom() { + return this.extend({ + phantom: !0 + }); + } + /** + * Creates a new options object with the given math font or old text font. + * @type {[type]} + */ + withFont(e) { + return this.extend({ + font: e + }); + } + /** + * Create a new options objects with the given fontFamily. + */ + withTextFontFamily(e) { + return this.extend({ + fontFamily: e, + font: "" + }); + } + /** + * Creates a new options object with the given font weight + */ + withTextFontWeight(e) { + return this.extend({ + fontWeight: e, + font: "" + }); + } + /** + * Creates a new options object with the given font weight + */ + withTextFontShape(e) { + return this.extend({ + fontShape: e, + font: "" + }); + } + /** + * Return the CSS sizing classes required to switch from enclosing options + * `oldOptions` to `this`. Returns an array of classes. + */ + sizingClasses(e) { + return e.size !== this.size ? ["sizing", "reset-size" + e.size, "size" + this.size] : []; + } + /** + * Return the CSS sizing classes required to switch to the base size. Like + * `this.havingSize(BASESIZE).sizingClasses(this)`. + */ + baseSizingClasses() { + return this.size !== Options.BASESIZE ? ["sizing", "reset-size" + this.size, "size" + Options.BASESIZE] : []; + } + /** + * Return the font metrics for this size. + */ + fontMetrics() { + return this._fontMetrics || (this._fontMetrics = getGlobalMetrics(this.size)), this._fontMetrics; + } + /** + * Gets the CSS color of the current options object + */ + getColor() { + return this.phantom ? "transparent" : this.color; + } +} +Options.BASESIZE = 6; +var ptPerUnit = { + // https://en.wikibooks.org/wiki/LaTeX/Lengths and + // https://tex.stackexchange.com/a/8263 + pt: 1, + // TeX point + mm: 7227 / 2540, + // millimeter + cm: 7227 / 254, + // centimeter + in: 72.27, + // inch + bp: 803 / 800, + // big (PostScript) points + pc: 12, + // pica + dd: 1238 / 1157, + // didot + cc: 14856 / 1157, + // cicero (12 didot) + nd: 685 / 642, + // new didot + nc: 1370 / 107, + // new cicero (12 new didot) + sp: 1 / 65536, + // scaled point (TeX's internal smallest unit) + // https://tex.stackexchange.com/a/41371 + px: 803 / 800 + // \pdfpxdimen defaults to 1 bp in pdfTeX and LuaTeX +}, relativeUnit = { + ex: !0, + em: !0, + mu: !0 +}, validUnit = function(e) { + return typeof e != "string" && (e = e.unit), e in ptPerUnit || e in relativeUnit || e === "ex"; +}, calculateSize$1 = function(e, r) { + var o; + if (e.unit in ptPerUnit) + o = ptPerUnit[e.unit] / r.fontMetrics().ptPerEm / r.sizeMultiplier; + else if (e.unit === "mu") + o = r.fontMetrics().cssEmPerMu; + else { + var m; + if (r.style.isTight() ? m = r.havingStyle(r.style.text()) : m = r, e.unit === "ex") + o = m.fontMetrics().xHeight; + else if (e.unit === "em") + o = m.fontMetrics().quad; + else + throw new ParseError("Invalid unit: '" + e.unit + "'"); + m !== r && (o *= m.sizeMultiplier / r.sizeMultiplier); + } + return Math.min(e.number * o, r.maxSize); +}, makeEm = function(e) { + return +e.toFixed(4) + "em"; +}, createClass = function(e) { + return e.filter((r) => r).join(" "); +}, initNode = function(e, r, o) { + if (this.classes = e || [], this.attributes = {}, this.height = 0, this.depth = 0, this.maxFontSize = 0, this.style = o || {}, r) { + r.style.isTight() && this.classes.push("mtight"); + var m = r.getColor(); + m && (this.style.color = m); + } +}, toNode = function(e) { + var r = document.createElement(e); + r.className = createClass(this.classes); + for (var o in this.style) + this.style.hasOwnProperty(o) && (r.style[o] = this.style[o]); + for (var m in this.attributes) + this.attributes.hasOwnProperty(m) && r.setAttribute(m, this.attributes[m]); + for (var _ = 0; _ < this.children.length; _++) + r.appendChild(this.children[_].toNode()); + return r; +}, invalidAttributeNameRegex = /[\s"'>/=\x00-\x1f]/, toMarkup = function(e) { + var r = "<" + e; + this.classes.length && (r += ' class="' + utils.escape(createClass(this.classes)) + '"'); + var o = ""; + for (var m in this.style) + this.style.hasOwnProperty(m) && (o += utils.hyphenate(m) + ":" + this.style[m] + ";"); + o && (r += ' style="' + utils.escape(o) + '"'); + for (var _ in this.attributes) + if (this.attributes.hasOwnProperty(_)) { + if (invalidAttributeNameRegex.test(_)) + throw new ParseError("Invalid attribute name '" + _ + "'"); + r += " " + _ + '="' + utils.escape(this.attributes[_]) + '"'; + } + r += ">"; + for (var g = 0; g < this.children.length; g++) + r += this.children[g].toMarkup(); + return r += "", r; +}; +class Span { + constructor(e, r, o, m) { + 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, initNode.call(this, e, o, m), this.children = r || []; + } + /** + * Sets an arbitrary attribute on the span. Warning: use this wisely. Not + * all browsers support attributes the same, and having too many custom + * attributes is probably bad. + */ + setAttribute(e, r) { + this.attributes[e] = r; + } + hasClass(e) { + return utils.contains(this.classes, e); + } + toNode() { + return toNode.call(this, "span"); + } + toMarkup() { + return toMarkup.call(this, "span"); + } +} +class Anchor { + constructor(e, r, o, m) { + 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, initNode.call(this, r, m), this.children = o || [], this.setAttribute("href", e); + } + setAttribute(e, r) { + this.attributes[e] = r; + } + hasClass(e) { + return utils.contains(this.classes, e); + } + toNode() { + return toNode.call(this, "a"); + } + toMarkup() { + return toMarkup.call(this, "a"); + } +} +class Img { + constructor(e, r, o) { + 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 = r, this.src = e, this.classes = ["mord"], this.style = o; + } + hasClass(e) { + return utils.contains(this.classes, e); + } + toNode() { + var e = document.createElement("img"); + e.src = this.src, e.alt = this.alt, e.className = "mord"; + for (var r in this.style) + this.style.hasOwnProperty(r) && (e.style[r] = this.style[r]); + return e; + } + toMarkup() { + var e = '' + utils.escape(this.alt) + ' 0 && (r = document.createElement("span"), r.style.marginRight = makeEm(this.italic)), this.classes.length > 0 && (r = r || document.createElement("span"), r.className = createClass(this.classes)); + for (var o in this.style) + this.style.hasOwnProperty(o) && (r = r || document.createElement("span"), r.style[o] = this.style[o]); + return r ? (r.appendChild(e), r) : e; + } + /** + * Creates markup for a symbol node. + */ + toMarkup() { + var e = !1, r = " 0 && (o += "margin-right:" + this.italic + "em;"); + for (var m in this.style) + this.style.hasOwnProperty(m) && (o += utils.hyphenate(m) + ":" + this.style[m] + ";"); + o && (e = !0, r += ' style="' + utils.escape(o) + '"'); + var _ = utils.escape(this.text); + return e ? (r += ">", r += _, r += "", r) : _; + } +} +class SvgNode { + constructor(e, r) { + this.children = void 0, this.attributes = void 0, this.children = e || [], this.attributes = r || {}; + } + toNode() { + var e = "http://www.w3.org/2000/svg", r = document.createElementNS(e, "svg"); + for (var o in this.attributes) + Object.prototype.hasOwnProperty.call(this.attributes, o) && r.setAttribute(o, this.attributes[o]); + for (var m = 0; m < this.children.length; m++) + r.appendChild(this.children[m].toNode()); + return r; + } + toMarkup() { + var e = '' : ''; + } +} +class LineNode { + constructor(e) { + this.attributes = void 0, this.attributes = e || {}; + } + toNode() { + var e = "http://www.w3.org/2000/svg", r = document.createElementNS(e, "line"); + for (var o in this.attributes) + Object.prototype.hasOwnProperty.call(this.attributes, o) && r.setAttribute(o, this.attributes[o]); + return r; + } + toMarkup() { + var e = " but got " + String(s) + "."); +} +var ATOMS = { + bin: 1, + close: 1, + inner: 1, + open: 1, + punct: 1, + rel: 1 +}, NON_ATOMS = { + "accent-token": 1, + mathord: 1, + "op-token": 1, + spacing: 1, + textord: 1 +}, symbols = { + math: {}, + text: {} +}; +function defineSymbol(s, e, r, o, m, _) { + symbols[s][m] = { + font: e, + group: r, + replace: o + }, _ && o && (symbols[s][o] = symbols[s][m]); +} +var math = "math", text$c = "text", main = "main", ams = "ams", accent = "accent-token", bin = "bin", close = "close", inner = "inner", mathord = "mathord", op = "op-token", open = "open", punct = "punct", rel = "rel", spacing = "spacing", textord = "textord"; +defineSymbol(math, main, rel, "≡", "\\equiv", !0); +defineSymbol(math, main, rel, "≺", "\\prec", !0); +defineSymbol(math, main, rel, "≻", "\\succ", !0); +defineSymbol(math, main, rel, "∼", "\\sim", !0); +defineSymbol(math, main, rel, "⊥", "\\perp"); +defineSymbol(math, main, rel, "⪯", "\\preceq", !0); +defineSymbol(math, main, rel, "⪰", "\\succeq", !0); +defineSymbol(math, main, rel, "≃", "\\simeq", !0); +defineSymbol(math, main, rel, "∣", "\\mid", !0); +defineSymbol(math, main, rel, "≪", "\\ll", !0); +defineSymbol(math, main, rel, "≫", "\\gg", !0); +defineSymbol(math, main, rel, "≍", "\\asymp", !0); +defineSymbol(math, main, rel, "∥", "\\parallel"); +defineSymbol(math, main, rel, "⋈", "\\bowtie", !0); +defineSymbol(math, main, rel, "⌣", "\\smile", !0); +defineSymbol(math, main, rel, "⊑", "\\sqsubseteq", !0); +defineSymbol(math, main, rel, "⊒", "\\sqsupseteq", !0); +defineSymbol(math, main, rel, "≐", "\\doteq", !0); +defineSymbol(math, main, rel, "⌢", "\\frown", !0); +defineSymbol(math, main, rel, "∋", "\\ni", !0); +defineSymbol(math, main, rel, "∝", "\\propto", !0); +defineSymbol(math, main, rel, "⊢", "\\vdash", !0); +defineSymbol(math, main, rel, "⊣", "\\dashv", !0); +defineSymbol(math, main, rel, "∋", "\\owns"); +defineSymbol(math, main, punct, ".", "\\ldotp"); +defineSymbol(math, main, punct, "⋅", "\\cdotp"); +defineSymbol(math, main, textord, "#", "\\#"); +defineSymbol(text$c, main, textord, "#", "\\#"); +defineSymbol(math, main, textord, "&", "\\&"); +defineSymbol(text$c, main, textord, "&", "\\&"); +defineSymbol(math, main, textord, "ℵ", "\\aleph", !0); +defineSymbol(math, main, textord, "∀", "\\forall", !0); +defineSymbol(math, main, textord, "ℏ", "\\hbar", !0); +defineSymbol(math, main, textord, "∃", "\\exists", !0); +defineSymbol(math, main, textord, "∇", "\\nabla", !0); +defineSymbol(math, main, textord, "♭", "\\flat", !0); +defineSymbol(math, main, textord, "ℓ", "\\ell", !0); +defineSymbol(math, main, textord, "♮", "\\natural", !0); +defineSymbol(math, main, textord, "♣", "\\clubsuit", !0); +defineSymbol(math, main, textord, "℘", "\\wp", !0); +defineSymbol(math, main, textord, "♯", "\\sharp", !0); +defineSymbol(math, main, textord, "♢", "\\diamondsuit", !0); +defineSymbol(math, main, textord, "ℜ", "\\Re", !0); +defineSymbol(math, main, textord, "♡", "\\heartsuit", !0); +defineSymbol(math, main, textord, "ℑ", "\\Im", !0); +defineSymbol(math, main, textord, "♠", "\\spadesuit", !0); +defineSymbol(math, main, textord, "§", "\\S", !0); +defineSymbol(text$c, main, textord, "§", "\\S"); +defineSymbol(math, main, textord, "¶", "\\P", !0); +defineSymbol(text$c, main, textord, "¶", "\\P"); +defineSymbol(math, main, textord, "†", "\\dag"); +defineSymbol(text$c, main, textord, "†", "\\dag"); +defineSymbol(text$c, main, textord, "†", "\\textdagger"); +defineSymbol(math, main, textord, "‡", "\\ddag"); +defineSymbol(text$c, main, textord, "‡", "\\ddag"); +defineSymbol(text$c, main, textord, "‡", "\\textdaggerdbl"); +defineSymbol(math, main, close, "⎱", "\\rmoustache", !0); +defineSymbol(math, main, open, "⎰", "\\lmoustache", !0); +defineSymbol(math, main, close, "⟯", "\\rgroup", !0); +defineSymbol(math, main, open, "⟮", "\\lgroup", !0); +defineSymbol(math, main, bin, "∓", "\\mp", !0); +defineSymbol(math, main, bin, "⊖", "\\ominus", !0); +defineSymbol(math, main, bin, "⊎", "\\uplus", !0); +defineSymbol(math, main, bin, "⊓", "\\sqcap", !0); +defineSymbol(math, main, bin, "∗", "\\ast"); +defineSymbol(math, main, bin, "⊔", "\\sqcup", !0); +defineSymbol(math, main, bin, "◯", "\\bigcirc", !0); +defineSymbol(math, main, bin, "∙", "\\bullet", !0); +defineSymbol(math, main, bin, "‡", "\\ddagger"); +defineSymbol(math, main, bin, "≀", "\\wr", !0); +defineSymbol(math, main, bin, "⨿", "\\amalg"); +defineSymbol(math, main, bin, "&", "\\And"); +defineSymbol(math, main, rel, "⟵", "\\longleftarrow", !0); +defineSymbol(math, main, rel, "⇐", "\\Leftarrow", !0); +defineSymbol(math, main, rel, "⟸", "\\Longleftarrow", !0); +defineSymbol(math, main, rel, "⟶", "\\longrightarrow", !0); +defineSymbol(math, main, rel, "⇒", "\\Rightarrow", !0); +defineSymbol(math, main, rel, "⟹", "\\Longrightarrow", !0); +defineSymbol(math, main, rel, "↔", "\\leftrightarrow", !0); +defineSymbol(math, main, rel, "⟷", "\\longleftrightarrow", !0); +defineSymbol(math, main, rel, "⇔", "\\Leftrightarrow", !0); +defineSymbol(math, main, rel, "⟺", "\\Longleftrightarrow", !0); +defineSymbol(math, main, rel, "↦", "\\mapsto", !0); +defineSymbol(math, main, rel, "⟼", "\\longmapsto", !0); +defineSymbol(math, main, rel, "↗", "\\nearrow", !0); +defineSymbol(math, main, rel, "↩", "\\hookleftarrow", !0); +defineSymbol(math, main, rel, "↪", "\\hookrightarrow", !0); +defineSymbol(math, main, rel, "↘", "\\searrow", !0); +defineSymbol(math, main, rel, "↼", "\\leftharpoonup", !0); +defineSymbol(math, main, rel, "⇀", "\\rightharpoonup", !0); +defineSymbol(math, main, rel, "↙", "\\swarrow", !0); +defineSymbol(math, main, rel, "↽", "\\leftharpoondown", !0); +defineSymbol(math, main, rel, "⇁", "\\rightharpoondown", !0); +defineSymbol(math, main, rel, "↖", "\\nwarrow", !0); +defineSymbol(math, main, rel, "⇌", "\\rightleftharpoons", !0); +defineSymbol(math, ams, rel, "≮", "\\nless", !0); +defineSymbol(math, ams, rel, "", "\\@nleqslant"); +defineSymbol(math, ams, rel, "", "\\@nleqq"); +defineSymbol(math, ams, rel, "⪇", "\\lneq", !0); +defineSymbol(math, ams, rel, "≨", "\\lneqq", !0); +defineSymbol(math, ams, rel, "", "\\@lvertneqq"); +defineSymbol(math, ams, rel, "⋦", "\\lnsim", !0); +defineSymbol(math, ams, rel, "⪉", "\\lnapprox", !0); +defineSymbol(math, ams, rel, "⊀", "\\nprec", !0); +defineSymbol(math, ams, rel, "⋠", "\\npreceq", !0); +defineSymbol(math, ams, rel, "⋨", "\\precnsim", !0); +defineSymbol(math, ams, rel, "⪹", "\\precnapprox", !0); +defineSymbol(math, ams, rel, "≁", "\\nsim", !0); +defineSymbol(math, ams, rel, "", "\\@nshortmid"); +defineSymbol(math, ams, rel, "∤", "\\nmid", !0); +defineSymbol(math, ams, rel, "⊬", "\\nvdash", !0); +defineSymbol(math, ams, rel, "⊭", "\\nvDash", !0); +defineSymbol(math, ams, rel, "⋪", "\\ntriangleleft"); +defineSymbol(math, ams, rel, "⋬", "\\ntrianglelefteq", !0); +defineSymbol(math, ams, rel, "⊊", "\\subsetneq", !0); +defineSymbol(math, ams, rel, "", "\\@varsubsetneq"); +defineSymbol(math, ams, rel, "⫋", "\\subsetneqq", !0); +defineSymbol(math, ams, rel, "", "\\@varsubsetneqq"); +defineSymbol(math, ams, rel, "≯", "\\ngtr", !0); +defineSymbol(math, ams, rel, "", "\\@ngeqslant"); +defineSymbol(math, ams, rel, "", "\\@ngeqq"); +defineSymbol(math, ams, rel, "⪈", "\\gneq", !0); +defineSymbol(math, ams, rel, "≩", "\\gneqq", !0); +defineSymbol(math, ams, rel, "", "\\@gvertneqq"); +defineSymbol(math, ams, rel, "⋧", "\\gnsim", !0); +defineSymbol(math, ams, rel, "⪊", "\\gnapprox", !0); +defineSymbol(math, ams, rel, "⊁", "\\nsucc", !0); +defineSymbol(math, ams, rel, "⋡", "\\nsucceq", !0); +defineSymbol(math, ams, rel, "⋩", "\\succnsim", !0); +defineSymbol(math, ams, rel, "⪺", "\\succnapprox", !0); +defineSymbol(math, ams, rel, "≆", "\\ncong", !0); +defineSymbol(math, ams, rel, "", "\\@nshortparallel"); +defineSymbol(math, ams, rel, "∦", "\\nparallel", !0); +defineSymbol(math, ams, rel, "⊯", "\\nVDash", !0); +defineSymbol(math, ams, rel, "⋫", "\\ntriangleright"); +defineSymbol(math, ams, rel, "⋭", "\\ntrianglerighteq", !0); +defineSymbol(math, ams, rel, "", "\\@nsupseteqq"); +defineSymbol(math, ams, rel, "⊋", "\\supsetneq", !0); +defineSymbol(math, ams, rel, "", "\\@varsupsetneq"); +defineSymbol(math, ams, rel, "⫌", "\\supsetneqq", !0); +defineSymbol(math, ams, rel, "", "\\@varsupsetneqq"); +defineSymbol(math, ams, rel, "⊮", "\\nVdash", !0); +defineSymbol(math, ams, rel, "⪵", "\\precneqq", !0); +defineSymbol(math, ams, rel, "⪶", "\\succneqq", !0); +defineSymbol(math, ams, rel, "", "\\@nsubseteqq"); +defineSymbol(math, ams, bin, "⊴", "\\unlhd"); +defineSymbol(math, ams, bin, "⊵", "\\unrhd"); +defineSymbol(math, ams, rel, "↚", "\\nleftarrow", !0); +defineSymbol(math, ams, rel, "↛", "\\nrightarrow", !0); +defineSymbol(math, ams, rel, "⇍", "\\nLeftarrow", !0); +defineSymbol(math, ams, rel, "⇏", "\\nRightarrow", !0); +defineSymbol(math, ams, rel, "↮", "\\nleftrightarrow", !0); +defineSymbol(math, ams, rel, "⇎", "\\nLeftrightarrow", !0); +defineSymbol(math, ams, rel, "△", "\\vartriangle"); +defineSymbol(math, ams, textord, "ℏ", "\\hslash"); +defineSymbol(math, ams, textord, "▽", "\\triangledown"); +defineSymbol(math, ams, textord, "◊", "\\lozenge"); +defineSymbol(math, ams, textord, "Ⓢ", "\\circledS"); +defineSymbol(math, ams, textord, "®", "\\circledR"); +defineSymbol(text$c, ams, textord, "®", "\\circledR"); +defineSymbol(math, ams, textord, "∡", "\\measuredangle", !0); +defineSymbol(math, ams, textord, "∄", "\\nexists"); +defineSymbol(math, ams, textord, "℧", "\\mho"); +defineSymbol(math, ams, textord, "Ⅎ", "\\Finv", !0); +defineSymbol(math, ams, textord, "⅁", "\\Game", !0); +defineSymbol(math, ams, textord, "‵", "\\backprime"); +defineSymbol(math, ams, textord, "▲", "\\blacktriangle"); +defineSymbol(math, ams, textord, "▼", "\\blacktriangledown"); +defineSymbol(math, ams, textord, "■", "\\blacksquare"); +defineSymbol(math, ams, textord, "⧫", "\\blacklozenge"); +defineSymbol(math, ams, textord, "★", "\\bigstar"); +defineSymbol(math, ams, textord, "∢", "\\sphericalangle", !0); +defineSymbol(math, ams, textord, "∁", "\\complement", !0); +defineSymbol(math, ams, textord, "ð", "\\eth", !0); +defineSymbol(text$c, main, textord, "ð", "ð"); +defineSymbol(math, ams, textord, "╱", "\\diagup"); +defineSymbol(math, ams, textord, "╲", "\\diagdown"); +defineSymbol(math, ams, textord, "□", "\\square"); +defineSymbol(math, ams, textord, "□", "\\Box"); +defineSymbol(math, ams, textord, "◊", "\\Diamond"); +defineSymbol(math, ams, textord, "¥", "\\yen", !0); +defineSymbol(text$c, ams, textord, "¥", "\\yen", !0); +defineSymbol(math, ams, textord, "✓", "\\checkmark", !0); +defineSymbol(text$c, ams, textord, "✓", "\\checkmark"); +defineSymbol(math, ams, textord, "ℶ", "\\beth", !0); +defineSymbol(math, ams, textord, "ℸ", "\\daleth", !0); +defineSymbol(math, ams, textord, "ℷ", "\\gimel", !0); +defineSymbol(math, ams, textord, "ϝ", "\\digamma", !0); +defineSymbol(math, ams, textord, "ϰ", "\\varkappa"); +defineSymbol(math, ams, open, "┌", "\\@ulcorner", !0); +defineSymbol(math, ams, close, "┐", "\\@urcorner", !0); +defineSymbol(math, ams, open, "└", "\\@llcorner", !0); +defineSymbol(math, ams, close, "┘", "\\@lrcorner", !0); +defineSymbol(math, ams, rel, "≦", "\\leqq", !0); +defineSymbol(math, ams, rel, "⩽", "\\leqslant", !0); +defineSymbol(math, ams, rel, "⪕", "\\eqslantless", !0); +defineSymbol(math, ams, rel, "≲", "\\lesssim", !0); +defineSymbol(math, ams, rel, "⪅", "\\lessapprox", !0); +defineSymbol(math, ams, rel, "≊", "\\approxeq", !0); +defineSymbol(math, ams, bin, "⋖", "\\lessdot"); +defineSymbol(math, ams, rel, "⋘", "\\lll", !0); +defineSymbol(math, ams, rel, "≶", "\\lessgtr", !0); +defineSymbol(math, ams, rel, "⋚", "\\lesseqgtr", !0); +defineSymbol(math, ams, rel, "⪋", "\\lesseqqgtr", !0); +defineSymbol(math, ams, rel, "≑", "\\doteqdot"); +defineSymbol(math, ams, rel, "≓", "\\risingdotseq", !0); +defineSymbol(math, ams, rel, "≒", "\\fallingdotseq", !0); +defineSymbol(math, ams, rel, "∽", "\\backsim", !0); +defineSymbol(math, ams, rel, "⋍", "\\backsimeq", !0); +defineSymbol(math, ams, rel, "⫅", "\\subseteqq", !0); +defineSymbol(math, ams, rel, "⋐", "\\Subset", !0); +defineSymbol(math, ams, rel, "⊏", "\\sqsubset", !0); +defineSymbol(math, ams, rel, "≼", "\\preccurlyeq", !0); +defineSymbol(math, ams, rel, "⋞", "\\curlyeqprec", !0); +defineSymbol(math, ams, rel, "≾", "\\precsim", !0); +defineSymbol(math, ams, rel, "⪷", "\\precapprox", !0); +defineSymbol(math, ams, rel, "⊲", "\\vartriangleleft"); +defineSymbol(math, ams, rel, "⊴", "\\trianglelefteq"); +defineSymbol(math, ams, rel, "⊨", "\\vDash", !0); +defineSymbol(math, ams, rel, "⊪", "\\Vvdash", !0); +defineSymbol(math, ams, rel, "⌣", "\\smallsmile"); +defineSymbol(math, ams, rel, "⌢", "\\smallfrown"); +defineSymbol(math, ams, rel, "≏", "\\bumpeq", !0); +defineSymbol(math, ams, rel, "≎", "\\Bumpeq", !0); +defineSymbol(math, ams, rel, "≧", "\\geqq", !0); +defineSymbol(math, ams, rel, "⩾", "\\geqslant", !0); +defineSymbol(math, ams, rel, "⪖", "\\eqslantgtr", !0); +defineSymbol(math, ams, rel, "≳", "\\gtrsim", !0); +defineSymbol(math, ams, rel, "⪆", "\\gtrapprox", !0); +defineSymbol(math, ams, bin, "⋗", "\\gtrdot"); +defineSymbol(math, ams, rel, "⋙", "\\ggg", !0); +defineSymbol(math, ams, rel, "≷", "\\gtrless", !0); +defineSymbol(math, ams, rel, "⋛", "\\gtreqless", !0); +defineSymbol(math, ams, rel, "⪌", "\\gtreqqless", !0); +defineSymbol(math, ams, rel, "≖", "\\eqcirc", !0); +defineSymbol(math, ams, rel, "≗", "\\circeq", !0); +defineSymbol(math, ams, rel, "≜", "\\triangleq", !0); +defineSymbol(math, ams, rel, "∼", "\\thicksim"); +defineSymbol(math, ams, rel, "≈", "\\thickapprox"); +defineSymbol(math, ams, rel, "⫆", "\\supseteqq", !0); +defineSymbol(math, ams, rel, "⋑", "\\Supset", !0); +defineSymbol(math, ams, rel, "⊐", "\\sqsupset", !0); +defineSymbol(math, ams, rel, "≽", "\\succcurlyeq", !0); +defineSymbol(math, ams, rel, "⋟", "\\curlyeqsucc", !0); +defineSymbol(math, ams, rel, "≿", "\\succsim", !0); +defineSymbol(math, ams, rel, "⪸", "\\succapprox", !0); +defineSymbol(math, ams, rel, "⊳", "\\vartriangleright"); +defineSymbol(math, ams, rel, "⊵", "\\trianglerighteq"); +defineSymbol(math, ams, rel, "⊩", "\\Vdash", !0); +defineSymbol(math, ams, rel, "∣", "\\shortmid"); +defineSymbol(math, ams, rel, "∥", "\\shortparallel"); +defineSymbol(math, ams, rel, "≬", "\\between", !0); +defineSymbol(math, ams, rel, "⋔", "\\pitchfork", !0); +defineSymbol(math, ams, rel, "∝", "\\varpropto"); +defineSymbol(math, ams, rel, "◀", "\\blacktriangleleft"); +defineSymbol(math, ams, rel, "∴", "\\therefore", !0); +defineSymbol(math, ams, rel, "∍", "\\backepsilon"); +defineSymbol(math, ams, rel, "▶", "\\blacktriangleright"); +defineSymbol(math, ams, rel, "∵", "\\because", !0); +defineSymbol(math, ams, rel, "⋘", "\\llless"); +defineSymbol(math, ams, rel, "⋙", "\\gggtr"); +defineSymbol(math, ams, bin, "⊲", "\\lhd"); +defineSymbol(math, ams, bin, "⊳", "\\rhd"); +defineSymbol(math, ams, rel, "≂", "\\eqsim", !0); +defineSymbol(math, main, rel, "⋈", "\\Join"); +defineSymbol(math, ams, rel, "≑", "\\Doteq", !0); +defineSymbol(math, ams, bin, "∔", "\\dotplus", !0); +defineSymbol(math, ams, bin, "∖", "\\smallsetminus"); +defineSymbol(math, ams, bin, "⋒", "\\Cap", !0); +defineSymbol(math, ams, bin, "⋓", "\\Cup", !0); +defineSymbol(math, ams, bin, "⩞", "\\doublebarwedge", !0); +defineSymbol(math, ams, bin, "⊟", "\\boxminus", !0); +defineSymbol(math, ams, bin, "⊞", "\\boxplus", !0); +defineSymbol(math, ams, bin, "⋇", "\\divideontimes", !0); +defineSymbol(math, ams, bin, "⋉", "\\ltimes", !0); +defineSymbol(math, ams, bin, "⋊", "\\rtimes", !0); +defineSymbol(math, ams, bin, "⋋", "\\leftthreetimes", !0); +defineSymbol(math, ams, bin, "⋌", "\\rightthreetimes", !0); +defineSymbol(math, ams, bin, "⋏", "\\curlywedge", !0); +defineSymbol(math, ams, bin, "⋎", "\\curlyvee", !0); +defineSymbol(math, ams, bin, "⊝", "\\circleddash", !0); +defineSymbol(math, ams, bin, "⊛", "\\circledast", !0); +defineSymbol(math, ams, bin, "⋅", "\\centerdot"); +defineSymbol(math, ams, bin, "⊺", "\\intercal", !0); +defineSymbol(math, ams, bin, "⋒", "\\doublecap"); +defineSymbol(math, ams, bin, "⋓", "\\doublecup"); +defineSymbol(math, ams, bin, "⊠", "\\boxtimes", !0); +defineSymbol(math, ams, rel, "⇢", "\\dashrightarrow", !0); +defineSymbol(math, ams, rel, "⇠", "\\dashleftarrow", !0); +defineSymbol(math, ams, rel, "⇇", "\\leftleftarrows", !0); +defineSymbol(math, ams, rel, "⇆", "\\leftrightarrows", !0); +defineSymbol(math, ams, rel, "⇚", "\\Lleftarrow", !0); +defineSymbol(math, ams, rel, "↞", "\\twoheadleftarrow", !0); +defineSymbol(math, ams, rel, "↢", "\\leftarrowtail", !0); +defineSymbol(math, ams, rel, "↫", "\\looparrowleft", !0); +defineSymbol(math, ams, rel, "⇋", "\\leftrightharpoons", !0); +defineSymbol(math, ams, rel, "↶", "\\curvearrowleft", !0); +defineSymbol(math, ams, rel, "↺", "\\circlearrowleft", !0); +defineSymbol(math, ams, rel, "↰", "\\Lsh", !0); +defineSymbol(math, ams, rel, "⇈", "\\upuparrows", !0); +defineSymbol(math, ams, rel, "↿", "\\upharpoonleft", !0); +defineSymbol(math, ams, rel, "⇃", "\\downharpoonleft", !0); +defineSymbol(math, main, rel, "⊶", "\\origof", !0); +defineSymbol(math, main, rel, "⊷", "\\imageof", !0); +defineSymbol(math, ams, rel, "⊸", "\\multimap", !0); +defineSymbol(math, ams, rel, "↭", "\\leftrightsquigarrow", !0); +defineSymbol(math, ams, rel, "⇉", "\\rightrightarrows", !0); +defineSymbol(math, ams, rel, "⇄", "\\rightleftarrows", !0); +defineSymbol(math, ams, rel, "↠", "\\twoheadrightarrow", !0); +defineSymbol(math, ams, rel, "↣", "\\rightarrowtail", !0); +defineSymbol(math, ams, rel, "↬", "\\looparrowright", !0); +defineSymbol(math, ams, rel, "↷", "\\curvearrowright", !0); +defineSymbol(math, ams, rel, "↻", "\\circlearrowright", !0); +defineSymbol(math, ams, rel, "↱", "\\Rsh", !0); +defineSymbol(math, ams, rel, "⇊", "\\downdownarrows", !0); +defineSymbol(math, ams, rel, "↾", "\\upharpoonright", !0); +defineSymbol(math, ams, rel, "⇂", "\\downharpoonright", !0); +defineSymbol(math, ams, rel, "⇝", "\\rightsquigarrow", !0); +defineSymbol(math, ams, rel, "⇝", "\\leadsto"); +defineSymbol(math, ams, rel, "⇛", "\\Rrightarrow", !0); +defineSymbol(math, ams, rel, "↾", "\\restriction"); +defineSymbol(math, main, textord, "‘", "`"); +defineSymbol(math, main, textord, "$", "\\$"); +defineSymbol(text$c, main, textord, "$", "\\$"); +defineSymbol(text$c, main, textord, "$", "\\textdollar"); +defineSymbol(math, main, textord, "%", "\\%"); +defineSymbol(text$c, main, textord, "%", "\\%"); +defineSymbol(math, main, textord, "_", "\\_"); +defineSymbol(text$c, main, textord, "_", "\\_"); +defineSymbol(text$c, main, textord, "_", "\\textunderscore"); +defineSymbol(math, main, textord, "∠", "\\angle", !0); +defineSymbol(math, main, textord, "∞", "\\infty", !0); +defineSymbol(math, main, textord, "′", "\\prime"); +defineSymbol(math, main, textord, "△", "\\triangle"); +defineSymbol(math, main, textord, "Γ", "\\Gamma", !0); +defineSymbol(math, main, textord, "Δ", "\\Delta", !0); +defineSymbol(math, main, textord, "Θ", "\\Theta", !0); +defineSymbol(math, main, textord, "Λ", "\\Lambda", !0); +defineSymbol(math, main, textord, "Ξ", "\\Xi", !0); +defineSymbol(math, main, textord, "Π", "\\Pi", !0); +defineSymbol(math, main, textord, "Σ", "\\Sigma", !0); +defineSymbol(math, main, textord, "Υ", "\\Upsilon", !0); +defineSymbol(math, main, textord, "Φ", "\\Phi", !0); +defineSymbol(math, main, textord, "Ψ", "\\Psi", !0); +defineSymbol(math, main, textord, "Ω", "\\Omega", !0); +defineSymbol(math, main, textord, "A", "Α"); +defineSymbol(math, main, textord, "B", "Β"); +defineSymbol(math, main, textord, "E", "Ε"); +defineSymbol(math, main, textord, "Z", "Ζ"); +defineSymbol(math, main, textord, "H", "Η"); +defineSymbol(math, main, textord, "I", "Ι"); +defineSymbol(math, main, textord, "K", "Κ"); +defineSymbol(math, main, textord, "M", "Μ"); +defineSymbol(math, main, textord, "N", "Ν"); +defineSymbol(math, main, textord, "O", "Ο"); +defineSymbol(math, main, textord, "P", "Ρ"); +defineSymbol(math, main, textord, "T", "Τ"); +defineSymbol(math, main, textord, "X", "Χ"); +defineSymbol(math, main, textord, "¬", "\\neg", !0); +defineSymbol(math, main, textord, "¬", "\\lnot"); +defineSymbol(math, main, textord, "⊤", "\\top"); +defineSymbol(math, main, textord, "⊥", "\\bot"); +defineSymbol(math, main, textord, "∅", "\\emptyset"); +defineSymbol(math, ams, textord, "∅", "\\varnothing"); +defineSymbol(math, main, mathord, "α", "\\alpha", !0); +defineSymbol(math, main, mathord, "β", "\\beta", !0); +defineSymbol(math, main, mathord, "γ", "\\gamma", !0); +defineSymbol(math, main, mathord, "δ", "\\delta", !0); +defineSymbol(math, main, mathord, "ϵ", "\\epsilon", !0); +defineSymbol(math, main, mathord, "ζ", "\\zeta", !0); +defineSymbol(math, main, mathord, "η", "\\eta", !0); +defineSymbol(math, main, mathord, "θ", "\\theta", !0); +defineSymbol(math, main, mathord, "ι", "\\iota", !0); +defineSymbol(math, main, mathord, "κ", "\\kappa", !0); +defineSymbol(math, main, mathord, "λ", "\\lambda", !0); +defineSymbol(math, main, mathord, "μ", "\\mu", !0); +defineSymbol(math, main, mathord, "ν", "\\nu", !0); +defineSymbol(math, main, mathord, "ξ", "\\xi", !0); +defineSymbol(math, main, mathord, "ο", "\\omicron", !0); +defineSymbol(math, main, mathord, "π", "\\pi", !0); +defineSymbol(math, main, mathord, "ρ", "\\rho", !0); +defineSymbol(math, main, mathord, "σ", "\\sigma", !0); +defineSymbol(math, main, mathord, "τ", "\\tau", !0); +defineSymbol(math, main, mathord, "υ", "\\upsilon", !0); +defineSymbol(math, main, mathord, "ϕ", "\\phi", !0); +defineSymbol(math, main, mathord, "χ", "\\chi", !0); +defineSymbol(math, main, mathord, "ψ", "\\psi", !0); +defineSymbol(math, main, mathord, "ω", "\\omega", !0); +defineSymbol(math, main, mathord, "ε", "\\varepsilon", !0); +defineSymbol(math, main, mathord, "ϑ", "\\vartheta", !0); +defineSymbol(math, main, mathord, "ϖ", "\\varpi", !0); +defineSymbol(math, main, mathord, "ϱ", "\\varrho", !0); +defineSymbol(math, main, mathord, "ς", "\\varsigma", !0); +defineSymbol(math, main, mathord, "φ", "\\varphi", !0); +defineSymbol(math, main, bin, "∗", "*", !0); +defineSymbol(math, main, bin, "+", "+"); +defineSymbol(math, main, bin, "−", "-", !0); +defineSymbol(math, main, bin, "⋅", "\\cdot", !0); +defineSymbol(math, main, bin, "∘", "\\circ", !0); +defineSymbol(math, main, bin, "÷", "\\div", !0); +defineSymbol(math, main, bin, "±", "\\pm", !0); +defineSymbol(math, main, bin, "×", "\\times", !0); +defineSymbol(math, main, bin, "∩", "\\cap", !0); +defineSymbol(math, main, bin, "∪", "\\cup", !0); +defineSymbol(math, main, bin, "∖", "\\setminus", !0); +defineSymbol(math, main, bin, "∧", "\\land"); +defineSymbol(math, main, bin, "∨", "\\lor"); +defineSymbol(math, main, bin, "∧", "\\wedge", !0); +defineSymbol(math, main, bin, "∨", "\\vee", !0); +defineSymbol(math, main, textord, "√", "\\surd"); +defineSymbol(math, main, open, "⟨", "\\langle", !0); +defineSymbol(math, main, open, "∣", "\\lvert"); +defineSymbol(math, main, open, "∥", "\\lVert"); +defineSymbol(math, main, close, "?", "?"); +defineSymbol(math, main, close, "!", "!"); +defineSymbol(math, main, close, "⟩", "\\rangle", !0); +defineSymbol(math, main, close, "∣", "\\rvert"); +defineSymbol(math, main, close, "∥", "\\rVert"); +defineSymbol(math, main, rel, "=", "="); +defineSymbol(math, main, rel, ":", ":"); +defineSymbol(math, main, rel, "≈", "\\approx", !0); +defineSymbol(math, main, rel, "≅", "\\cong", !0); +defineSymbol(math, main, rel, "≥", "\\ge"); +defineSymbol(math, main, rel, "≥", "\\geq", !0); +defineSymbol(math, main, rel, "←", "\\gets"); +defineSymbol(math, main, rel, ">", "\\gt", !0); +defineSymbol(math, main, rel, "∈", "\\in", !0); +defineSymbol(math, main, rel, "", "\\@not"); +defineSymbol(math, main, rel, "⊂", "\\subset", !0); +defineSymbol(math, main, rel, "⊃", "\\supset", !0); +defineSymbol(math, main, rel, "⊆", "\\subseteq", !0); +defineSymbol(math, main, rel, "⊇", "\\supseteq", !0); +defineSymbol(math, ams, rel, "⊈", "\\nsubseteq", !0); +defineSymbol(math, ams, rel, "⊉", "\\nsupseteq", !0); +defineSymbol(math, main, rel, "⊨", "\\models"); +defineSymbol(math, main, rel, "←", "\\leftarrow", !0); +defineSymbol(math, main, rel, "≤", "\\le"); +defineSymbol(math, main, rel, "≤", "\\leq", !0); +defineSymbol(math, main, rel, "<", "\\lt", !0); +defineSymbol(math, main, rel, "→", "\\rightarrow", !0); +defineSymbol(math, main, rel, "→", "\\to"); +defineSymbol(math, ams, rel, "≱", "\\ngeq", !0); +defineSymbol(math, ams, rel, "≰", "\\nleq", !0); +defineSymbol(math, main, spacing, " ", "\\ "); +defineSymbol(math, main, spacing, " ", "\\space"); +defineSymbol(math, main, spacing, " ", "\\nobreakspace"); +defineSymbol(text$c, main, spacing, " ", "\\ "); +defineSymbol(text$c, main, spacing, " ", " "); +defineSymbol(text$c, main, spacing, " ", "\\space"); +defineSymbol(text$c, main, spacing, " ", "\\nobreakspace"); +defineSymbol(math, main, spacing, null, "\\nobreak"); +defineSymbol(math, main, spacing, null, "\\allowbreak"); +defineSymbol(math, main, punct, ",", ","); +defineSymbol(math, main, punct, ";", ";"); +defineSymbol(math, ams, bin, "⊼", "\\barwedge", !0); +defineSymbol(math, ams, bin, "⊻", "\\veebar", !0); +defineSymbol(math, main, bin, "⊙", "\\odot", !0); +defineSymbol(math, main, bin, "⊕", "\\oplus", !0); +defineSymbol(math, main, bin, "⊗", "\\otimes", !0); +defineSymbol(math, main, textord, "∂", "\\partial", !0); +defineSymbol(math, main, bin, "⊘", "\\oslash", !0); +defineSymbol(math, ams, bin, "⊚", "\\circledcirc", !0); +defineSymbol(math, ams, bin, "⊡", "\\boxdot", !0); +defineSymbol(math, main, bin, "△", "\\bigtriangleup"); +defineSymbol(math, main, bin, "▽", "\\bigtriangledown"); +defineSymbol(math, main, bin, "†", "\\dagger"); +defineSymbol(math, main, bin, "⋄", "\\diamond"); +defineSymbol(math, main, bin, "⋆", "\\star"); +defineSymbol(math, main, bin, "◃", "\\triangleleft"); +defineSymbol(math, main, bin, "▹", "\\triangleright"); +defineSymbol(math, main, open, "{", "\\{"); +defineSymbol(text$c, main, textord, "{", "\\{"); +defineSymbol(text$c, main, textord, "{", "\\textbraceleft"); +defineSymbol(math, main, close, "}", "\\}"); +defineSymbol(text$c, main, textord, "}", "\\}"); +defineSymbol(text$c, main, textord, "}", "\\textbraceright"); +defineSymbol(math, main, open, "{", "\\lbrace"); +defineSymbol(math, main, close, "}", "\\rbrace"); +defineSymbol(math, main, open, "[", "\\lbrack", !0); +defineSymbol(text$c, main, textord, "[", "\\lbrack", !0); +defineSymbol(math, main, close, "]", "\\rbrack", !0); +defineSymbol(text$c, main, textord, "]", "\\rbrack", !0); +defineSymbol(math, main, open, "(", "\\lparen", !0); +defineSymbol(math, main, close, ")", "\\rparen", !0); +defineSymbol(text$c, main, textord, "<", "\\textless", !0); +defineSymbol(text$c, main, textord, ">", "\\textgreater", !0); +defineSymbol(math, main, open, "⌊", "\\lfloor", !0); +defineSymbol(math, main, close, "⌋", "\\rfloor", !0); +defineSymbol(math, main, open, "⌈", "\\lceil", !0); +defineSymbol(math, main, close, "⌉", "\\rceil", !0); +defineSymbol(math, main, textord, "\\", "\\backslash"); +defineSymbol(math, main, textord, "∣", "|"); +defineSymbol(math, main, textord, "∣", "\\vert"); +defineSymbol(text$c, main, textord, "|", "\\textbar", !0); +defineSymbol(math, main, textord, "∥", "\\|"); +defineSymbol(math, main, textord, "∥", "\\Vert"); +defineSymbol(text$c, main, textord, "∥", "\\textbardbl"); +defineSymbol(text$c, main, textord, "~", "\\textasciitilde"); +defineSymbol(text$c, main, textord, "\\", "\\textbackslash"); +defineSymbol(text$c, main, textord, "^", "\\textasciicircum"); +defineSymbol(math, main, rel, "↑", "\\uparrow", !0); +defineSymbol(math, main, rel, "⇑", "\\Uparrow", !0); +defineSymbol(math, main, rel, "↓", "\\downarrow", !0); +defineSymbol(math, main, rel, "⇓", "\\Downarrow", !0); +defineSymbol(math, main, rel, "↕", "\\updownarrow", !0); +defineSymbol(math, main, rel, "⇕", "\\Updownarrow", !0); +defineSymbol(math, main, op, "∐", "\\coprod"); +defineSymbol(math, main, op, "⋁", "\\bigvee"); +defineSymbol(math, main, op, "⋀", "\\bigwedge"); +defineSymbol(math, main, op, "⨄", "\\biguplus"); +defineSymbol(math, main, op, "⋂", "\\bigcap"); +defineSymbol(math, main, op, "⋃", "\\bigcup"); +defineSymbol(math, main, op, "∫", "\\int"); +defineSymbol(math, main, op, "∫", "\\intop"); +defineSymbol(math, main, op, "∬", "\\iint"); +defineSymbol(math, main, op, "∭", "\\iiint"); +defineSymbol(math, main, op, "∏", "\\prod"); +defineSymbol(math, main, op, "∑", "\\sum"); +defineSymbol(math, main, op, "⨂", "\\bigotimes"); +defineSymbol(math, main, op, "⨁", "\\bigoplus"); +defineSymbol(math, main, op, "⨀", "\\bigodot"); +defineSymbol(math, main, op, "∮", "\\oint"); +defineSymbol(math, main, op, "∯", "\\oiint"); +defineSymbol(math, main, op, "∰", "\\oiiint"); +defineSymbol(math, main, op, "⨆", "\\bigsqcup"); +defineSymbol(math, main, op, "∫", "\\smallint"); +defineSymbol(text$c, main, inner, "…", "\\textellipsis"); +defineSymbol(math, main, inner, "…", "\\mathellipsis"); +defineSymbol(text$c, main, inner, "…", "\\ldots", !0); +defineSymbol(math, main, inner, "…", "\\ldots", !0); +defineSymbol(math, main, inner, "⋯", "\\@cdots", !0); +defineSymbol(math, main, inner, "⋱", "\\ddots", !0); +defineSymbol(math, main, textord, "⋮", "\\varvdots"); +defineSymbol(text$c, main, textord, "⋮", "\\varvdots"); +defineSymbol(math, main, accent, "ˊ", "\\acute"); +defineSymbol(math, main, accent, "ˋ", "\\grave"); +defineSymbol(math, main, accent, "¨", "\\ddot"); +defineSymbol(math, main, accent, "~", "\\tilde"); +defineSymbol(math, main, accent, "ˉ", "\\bar"); +defineSymbol(math, main, accent, "˘", "\\breve"); +defineSymbol(math, main, accent, "ˇ", "\\check"); +defineSymbol(math, main, accent, "^", "\\hat"); +defineSymbol(math, main, accent, "⃗", "\\vec"); +defineSymbol(math, main, accent, "˙", "\\dot"); +defineSymbol(math, main, accent, "˚", "\\mathring"); +defineSymbol(math, main, mathord, "", "\\@imath"); +defineSymbol(math, main, mathord, "", "\\@jmath"); +defineSymbol(math, main, textord, "ı", "ı"); +defineSymbol(math, main, textord, "ȷ", "ȷ"); +defineSymbol(text$c, main, textord, "ı", "\\i", !0); +defineSymbol(text$c, main, textord, "ȷ", "\\j", !0); +defineSymbol(text$c, main, textord, "ß", "\\ss", !0); +defineSymbol(text$c, main, textord, "æ", "\\ae", !0); +defineSymbol(text$c, main, textord, "œ", "\\oe", !0); +defineSymbol(text$c, main, textord, "ø", "\\o", !0); +defineSymbol(text$c, main, textord, "Æ", "\\AE", !0); +defineSymbol(text$c, main, textord, "Œ", "\\OE", !0); +defineSymbol(text$c, main, textord, "Ø", "\\O", !0); +defineSymbol(text$c, main, accent, "ˊ", "\\'"); +defineSymbol(text$c, main, accent, "ˋ", "\\`"); +defineSymbol(text$c, main, accent, "ˆ", "\\^"); +defineSymbol(text$c, main, accent, "˜", "\\~"); +defineSymbol(text$c, main, accent, "ˉ", "\\="); +defineSymbol(text$c, main, accent, "˘", "\\u"); +defineSymbol(text$c, main, accent, "˙", "\\."); +defineSymbol(text$c, main, accent, "¸", "\\c"); +defineSymbol(text$c, main, accent, "˚", "\\r"); +defineSymbol(text$c, main, accent, "ˇ", "\\v"); +defineSymbol(text$c, main, accent, "¨", '\\"'); +defineSymbol(text$c, main, accent, "˝", "\\H"); +defineSymbol(text$c, main, accent, "◯", "\\textcircled"); +var ligatures = { + "--": !0, + "---": !0, + "``": !0, + "''": !0 +}; +defineSymbol(text$c, main, textord, "–", "--", !0); +defineSymbol(text$c, main, textord, "–", "\\textendash"); +defineSymbol(text$c, main, textord, "—", "---", !0); +defineSymbol(text$c, main, textord, "—", "\\textemdash"); +defineSymbol(text$c, main, textord, "‘", "`", !0); +defineSymbol(text$c, main, textord, "‘", "\\textquoteleft"); +defineSymbol(text$c, main, textord, "’", "'", !0); +defineSymbol(text$c, main, textord, "’", "\\textquoteright"); +defineSymbol(text$c, main, textord, "“", "``", !0); +defineSymbol(text$c, main, textord, "“", "\\textquotedblleft"); +defineSymbol(text$c, main, textord, "”", "''", !0); +defineSymbol(text$c, main, textord, "”", "\\textquotedblright"); +defineSymbol(math, main, textord, "°", "\\degree", !0); +defineSymbol(text$c, main, textord, "°", "\\degree"); +defineSymbol(text$c, main, textord, "°", "\\textdegree", !0); +defineSymbol(math, main, textord, "£", "\\pounds"); +defineSymbol(math, main, textord, "£", "\\mathsterling", !0); +defineSymbol(text$c, main, textord, "£", "\\pounds"); +defineSymbol(text$c, main, textord, "£", "\\textsterling", !0); +defineSymbol(math, ams, textord, "✠", "\\maltese"); +defineSymbol(text$c, ams, textord, "✠", "\\maltese"); +var mathTextSymbols = '0123456789/@."'; +for (var i = 0; i < mathTextSymbols.length; i++) { + var ch = mathTextSymbols.charAt(i); + defineSymbol(math, main, textord, ch, ch); +} +var textSymbols = '0123456789!@*()-=+";:?/.,'; +for (var _i = 0; _i < textSymbols.length; _i++) { + var _ch = textSymbols.charAt(_i); + defineSymbol(text$c, main, textord, _ch, _ch); +} +var letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; +for (var _i2 = 0; _i2 < letters.length; _i2++) { + var _ch2 = letters.charAt(_i2); + defineSymbol(math, main, mathord, _ch2, _ch2), defineSymbol(text$c, main, textord, _ch2, _ch2); +} +defineSymbol(math, ams, textord, "C", "ℂ"); +defineSymbol(text$c, ams, textord, "C", "ℂ"); +defineSymbol(math, ams, textord, "H", "ℍ"); +defineSymbol(text$c, ams, textord, "H", "ℍ"); +defineSymbol(math, ams, textord, "N", "ℕ"); +defineSymbol(text$c, ams, textord, "N", "ℕ"); +defineSymbol(math, ams, textord, "P", "ℙ"); +defineSymbol(text$c, ams, textord, "P", "ℙ"); +defineSymbol(math, ams, textord, "Q", "ℚ"); +defineSymbol(text$c, ams, textord, "Q", "ℚ"); +defineSymbol(math, ams, textord, "R", "ℝ"); +defineSymbol(text$c, ams, textord, "R", "ℝ"); +defineSymbol(math, ams, textord, "Z", "ℤ"); +defineSymbol(text$c, ams, textord, "Z", "ℤ"); +defineSymbol(math, main, mathord, "h", "ℎ"); +defineSymbol(text$c, main, mathord, "h", "ℎ"); +var wideChar = ""; +for (var _i3 = 0; _i3 < letters.length; _i3++) { + var _ch3 = letters.charAt(_i3); + wideChar = String.fromCharCode(55349, 56320 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$c, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56372 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$c, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56424 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$c, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56580 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$c, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56684 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$c, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56736 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$c, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56788 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$c, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56840 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$c, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56944 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$c, main, textord, _ch3, wideChar), _i3 < 26 && (wideChar = String.fromCharCode(55349, 56632 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$c, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56476 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$c, main, textord, _ch3, wideChar)); +} +wideChar = "𝕜"; +defineSymbol(math, main, mathord, "k", wideChar); +defineSymbol(text$c, main, textord, "k", wideChar); +for (var _i4 = 0; _i4 < 10; _i4++) { + var _ch4 = _i4.toString(); + wideChar = String.fromCharCode(55349, 57294 + _i4), defineSymbol(math, main, mathord, _ch4, wideChar), defineSymbol(text$c, main, textord, _ch4, wideChar), wideChar = String.fromCharCode(55349, 57314 + _i4), defineSymbol(math, main, mathord, _ch4, wideChar), defineSymbol(text$c, main, textord, _ch4, wideChar), wideChar = String.fromCharCode(55349, 57324 + _i4), defineSymbol(math, main, mathord, _ch4, wideChar), defineSymbol(text$c, main, textord, _ch4, wideChar), wideChar = String.fromCharCode(55349, 57334 + _i4), defineSymbol(math, main, mathord, _ch4, wideChar), defineSymbol(text$c, main, textord, _ch4, wideChar); +} +var extraLatin = "ÐÞþ"; +for (var _i5 = 0; _i5 < extraLatin.length; _i5++) { + var _ch5 = extraLatin.charAt(_i5); + defineSymbol(math, main, mathord, _ch5, _ch5), defineSymbol(text$c, main, textord, _ch5, _ch5); +} +var wideLatinLetterData = [ + ["mathbf", "textbf", "Main-Bold"], + // A-Z bold upright + ["mathbf", "textbf", "Main-Bold"], + // a-z bold upright + ["mathnormal", "textit", "Math-Italic"], + // A-Z italic + ["mathnormal", "textit", "Math-Italic"], + // a-z italic + ["boldsymbol", "boldsymbol", "Main-BoldItalic"], + // A-Z bold italic + ["boldsymbol", "boldsymbol", "Main-BoldItalic"], + // a-z bold italic + // Map fancy A-Z letters to script, not calligraphic. + // This aligns with unicode-math and math fonts (except Cambria Math). + ["mathscr", "textscr", "Script-Regular"], + // A-Z script + ["", "", ""], + // a-z script. No font + ["", "", ""], + // A-Z bold script. No font + ["", "", ""], + // a-z bold script. No font + ["mathfrak", "textfrak", "Fraktur-Regular"], + // A-Z Fraktur + ["mathfrak", "textfrak", "Fraktur-Regular"], + // a-z Fraktur + ["mathbb", "textbb", "AMS-Regular"], + // A-Z double-struck + ["mathbb", "textbb", "AMS-Regular"], + // k double-struck + // Note that we are using a bold font, but font metrics for regular Fraktur. + ["mathboldfrak", "textboldfrak", "Fraktur-Regular"], + // A-Z bold Fraktur + ["mathboldfrak", "textboldfrak", "Fraktur-Regular"], + // a-z bold Fraktur + ["mathsf", "textsf", "SansSerif-Regular"], + // A-Z sans-serif + ["mathsf", "textsf", "SansSerif-Regular"], + // a-z sans-serif + ["mathboldsf", "textboldsf", "SansSerif-Bold"], + // A-Z bold sans-serif + ["mathboldsf", "textboldsf", "SansSerif-Bold"], + // a-z bold sans-serif + ["mathitsf", "textitsf", "SansSerif-Italic"], + // A-Z italic sans-serif + ["mathitsf", "textitsf", "SansSerif-Italic"], + // a-z italic sans-serif + ["", "", ""], + // A-Z bold italic sans. No font + ["", "", ""], + // a-z bold italic sans. No font + ["mathtt", "texttt", "Typewriter-Regular"], + // A-Z monospace + ["mathtt", "texttt", "Typewriter-Regular"] + // a-z monospace +], wideNumeralData = [ + ["mathbf", "textbf", "Main-Bold"], + // 0-9 bold + ["", "", ""], + // 0-9 double-struck. No KaTeX font. + ["mathsf", "textsf", "SansSerif-Regular"], + // 0-9 sans-serif + ["mathboldsf", "textboldsf", "SansSerif-Bold"], + // 0-9 bold sans-serif + ["mathtt", "texttt", "Typewriter-Regular"] + // 0-9 monospace +], wideCharacterFont = function(e, r) { + var o = e.charCodeAt(0), m = e.charCodeAt(1), _ = (o - 55296) * 1024 + (m - 56320) + 65536, g = r === "math" ? 0 : 1; + if (119808 <= _ && _ < 120484) { + var y = Math.floor((_ - 119808) / 26); + return [wideLatinLetterData[y][2], wideLatinLetterData[y][g]]; + } else if (120782 <= _ && _ <= 120831) { + var E = Math.floor((_ - 120782) / 10); + return [wideNumeralData[E][2], wideNumeralData[E][g]]; + } else { + if (_ === 120485 || _ === 120486) + return [wideLatinLetterData[0][2], wideLatinLetterData[0][g]]; + if (120486 < _ && _ < 120782) + return ["", ""]; + throw new ParseError("Unsupported character: " + e); + } +}, lookupSymbol = function(e, r, o) { + return symbols[o][e] && symbols[o][e].replace && (e = symbols[o][e].replace), { + value: e, + metrics: getCharacterMetrics(e, r, o) + }; +}, makeSymbol = function(e, r, o, m, _) { + var g = lookupSymbol(e, r, o), y = g.metrics; + e = g.value; + var E; + if (y) { + var x = y.italic; + (o === "text" || m && m.font === "mathit") && (x = 0), E = new SymbolNode(e, y.height, y.depth, x, y.skew, y.width, _); + } else + typeof console < "u" && console.warn("No character metrics " + ("for '" + e + "' in style '" + r + "' and mode '" + o + "'")), E = new SymbolNode(e, 0, 0, 0, 0, 0, _); + if (m) { + E.maxFontSize = m.sizeMultiplier, m.style.isTight() && E.classes.push("mtight"); + var v = m.getColor(); + v && (E.style.color = v); + } + return E; +}, mathsym = function(e, r, o, m) { + return m === void 0 && (m = []), o.font === "boldsymbol" && lookupSymbol(e, "Main-Bold", r).metrics ? makeSymbol(e, "Main-Bold", r, o, m.concat(["mathbf"])) : e === "\\" || symbols[r][e].font === "main" ? makeSymbol(e, "Main-Regular", r, o, m) : makeSymbol(e, "AMS-Regular", r, o, m.concat(["amsrm"])); +}, boldsymbol = function(e, r, o, m, _) { + return _ !== "textord" && lookupSymbol(e, "Math-BoldItalic", r).metrics ? { + fontName: "Math-BoldItalic", + fontClass: "boldsymbol" + } : { + fontName: "Main-Bold", + fontClass: "mathbf" + }; +}, makeOrd = function(e, r, o) { + var m = e.mode, _ = e.text, g = ["mord"], y = m === "math" || m === "text" && r.font, E = y ? r.font : r.fontFamily, x = "", v = ""; + if (_.charCodeAt(0) === 55349 && ([x, v] = wideCharacterFont(_, m)), x.length > 0) + return makeSymbol(_, x, m, r, g.concat(v)); + if (E) { + var h, a; + if (E === "boldsymbol") { + var b = boldsymbol(_, m, r, g, o); + h = b.fontName, a = [b.fontClass]; + } else y ? (h = fontMap[E].fontName, a = [E]) : (h = retrieveTextFontName(E, r.fontWeight, r.fontShape), a = [E, r.fontWeight, r.fontShape]); + if (lookupSymbol(_, h, m).metrics) + return makeSymbol(_, h, m, r, g.concat(a)); + if (ligatures.hasOwnProperty(_) && h.slice(0, 10) === "Typewriter") { + for (var w = [], k = 0; k < _.length; k++) + w.push(makeSymbol(_[k], h, m, r, g.concat(a))); + return makeFragment(w); + } + } + if (o === "mathord") + return makeSymbol(_, "Math-Italic", m, r, g.concat(["mathnormal"])); + if (o === "textord") { + var A = symbols[m][_] && symbols[m][_].font; + if (A === "ams") { + var M = retrieveTextFontName("amsrm", r.fontWeight, r.fontShape); + return makeSymbol(_, M, m, r, g.concat("amsrm", r.fontWeight, r.fontShape)); + } else if (A === "main" || !A) { + var $ = retrieveTextFontName("textrm", r.fontWeight, r.fontShape); + return makeSymbol(_, $, m, r, g.concat(r.fontWeight, r.fontShape)); + } else { + var O = retrieveTextFontName(A, r.fontWeight, r.fontShape); + return makeSymbol(_, O, m, r, g.concat(O, r.fontWeight, r.fontShape)); + } + } else + throw new Error("unexpected type: " + o + " in makeOrd"); +}, canCombine = (s, e) => { + if (createClass(s.classes) !== createClass(e.classes) || s.skew !== e.skew || s.maxFontSize !== e.maxFontSize) + return !1; + if (s.classes.length === 1) { + var r = s.classes[0]; + if (r === "mbin" || r === "mord") + return !1; + } + for (var o in s.style) + if (s.style.hasOwnProperty(o) && s.style[o] !== e.style[o]) + return !1; + for (var m in e.style) + if (e.style.hasOwnProperty(m) && s.style[m] !== e.style[m]) + return !1; + return !0; +}, tryCombineChars = (s) => { + for (var e = 0; e < s.length - 1; e++) { + var r = s[e], o = s[e + 1]; + r instanceof SymbolNode && o instanceof SymbolNode && canCombine(r, o) && (r.text += o.text, r.height = Math.max(r.height, o.height), r.depth = Math.max(r.depth, o.depth), r.italic = o.italic, s.splice(e + 1, 1), e--); + } + return s; +}, sizeElementFromChildren = function(e) { + for (var r = 0, o = 0, m = 0, _ = 0; _ < e.children.length; _++) { + var g = e.children[_]; + g.height > r && (r = g.height), g.depth > o && (o = g.depth), g.maxFontSize > m && (m = g.maxFontSize); + } + e.height = r, e.depth = o, e.maxFontSize = m; +}, makeSpan$2 = function(e, r, o, m) { + var _ = new Span(e, r, o, m); + return sizeElementFromChildren(_), _; +}, makeSvgSpan = (s, e, r, o) => new Span(s, e, r, o), makeLineSpan = function(e, r, o) { + var m = makeSpan$2([e], [], r); + return m.height = Math.max(o || r.fontMetrics().defaultRuleThickness, r.minRuleThickness), m.style.borderBottomWidth = makeEm(m.height), m.maxFontSize = 1, m; +}, makeAnchor = function(e, r, o, m) { + var _ = new Anchor(e, r, o, m); + return sizeElementFromChildren(_), _; +}, makeFragment = function(e) { + var r = new DocumentFragment(e); + return sizeElementFromChildren(r), r; +}, wrapFragment = function(e, r) { + return e instanceof DocumentFragment ? makeSpan$2([], [e], r) : e; +}, getVListChildrenAndDepth = function(e) { + if (e.positionType === "individualShift") { + for (var r = e.children, o = [r[0]], m = -r[0].shift - r[0].elem.depth, _ = m, g = 1; g < r.length; g++) { + var y = -r[g].shift - _ - r[g].elem.depth, E = y - (r[g - 1].elem.height + r[g - 1].elem.depth); + _ = _ + y, o.push({ + type: "kern", + size: E + }), o.push(r[g]); + } + return { + children: o, + depth: m + }; + } + var x; + if (e.positionType === "top") { + for (var v = e.positionData, h = 0; h < e.children.length; h++) { + var a = e.children[h]; + v -= a.type === "kern" ? a.size : a.elem.height + a.elem.depth; + } + x = v; + } else if (e.positionType === "bottom") + x = -e.positionData; + else { + var b = e.children[0]; + if (b.type !== "elem") + throw new Error('First child must have type "elem".'); + if (e.positionType === "shift") + x = -b.elem.depth - e.positionData; + else if (e.positionType === "firstBaseline") + x = -b.elem.depth; + else + throw new Error("Invalid positionType " + e.positionType + "."); + } + return { + children: e.children, + depth: x + }; +}, makeVList = function(e, r) { + for (var { + children: o, + depth: m + } = getVListChildrenAndDepth(e), _ = 0, g = 0; g < o.length; g++) { + var y = o[g]; + if (y.type === "elem") { + var E = y.elem; + _ = Math.max(_, E.maxFontSize, E.height); + } + } + _ += 2; + var x = makeSpan$2(["pstrut"], []); + x.style.height = makeEm(_); + for (var v = [], h = m, a = m, b = m, w = 0; w < o.length; w++) { + var k = o[w]; + if (k.type === "kern") + b += k.size; + else { + var A = k.elem, M = k.wrapperClasses || [], $ = k.wrapperStyle || {}, O = makeSpan$2(M, [x, A], void 0, $); + O.style.top = makeEm(-_ - b - A.depth), k.marginLeft && (O.style.marginLeft = k.marginLeft), k.marginRight && (O.style.marginRight = k.marginRight), v.push(O), b += A.height + A.depth; + } + h = Math.min(h, b), a = Math.max(a, b); + } + var C = makeSpan$2(["vlist"], v); + C.style.height = makeEm(a); + var P; + if (h < 0) { + var I = makeSpan$2([], []), N = makeSpan$2(["vlist"], [I]); + N.style.height = makeEm(-h); + var R = makeSpan$2(["vlist-s"], [new SymbolNode("​")]); + P = [makeSpan$2(["vlist-r"], [C, R]), makeSpan$2(["vlist-r"], [N])]; + } else + P = [makeSpan$2(["vlist-r"], [C])]; + var F = makeSpan$2(["vlist-t"], P); + return P.length === 2 && F.classes.push("vlist-t2"), F.height = a, F.depth = -h, F; +}, makeGlue = (s, e) => { + var r = makeSpan$2(["mspace"], [], e), o = calculateSize$1(s, e); + return r.style.marginRight = makeEm(o), r; +}, retrieveTextFontName = function(e, r, o) { + var m = ""; + switch (e) { + case "amsrm": + m = "AMS"; + break; + case "textrm": + m = "Main"; + break; + case "textsf": + m = "SansSerif"; + break; + case "texttt": + m = "Typewriter"; + break; + default: + m = e; + } + var _; + return r === "textbf" && o === "textit" ? _ = "BoldItalic" : r === "textbf" ? _ = "Bold" : r === "textit" ? _ = "Italic" : _ = "Regular", m + "-" + _; +}, fontMap = { + // styles + 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" + }, + mathsfit: { + variant: "sans-serif-italic", + fontName: "SansSerif-Italic" + }, + // "boldsymbol" is missing because they require the use of multiple fonts: + // Math-BoldItalic and Main-Bold. This is handled by a special case in + // makeOrd which ends up calling boldsymbol. + // families + 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" + } +}, svgData = { + // path, width, height + vec: ["vec", 0.471, 0.714], + // values from the font glyph + oiintSize1: ["oiintSize1", 0.957, 0.499], + // oval to overlay the integrand + oiintSize2: ["oiintSize2", 1.472, 0.659], + oiiintSize1: ["oiiintSize1", 1.304, 0.499], + oiiintSize2: ["oiiintSize2", 1.98, 0.659] +}, staticSvg = function(e, r) { + var [o, m, _] = svgData[e], g = new PathNode(o), y = new SvgNode([g], { + width: makeEm(m), + height: makeEm(_), + // Override CSS rule `.katex svg { width: 100% }` + style: "width:" + makeEm(m), + viewBox: "0 0 " + 1e3 * m + " " + 1e3 * _, + preserveAspectRatio: "xMinYMin" + }), E = makeSvgSpan(["overlay"], [y], r); + return E.height = _, E.style.height = makeEm(_), E.style.width = makeEm(m), E; +}, buildCommon = { + fontMap, + makeSymbol, + mathsym, + makeSpan: makeSpan$2, + makeSvgSpan, + makeLineSpan, + makeAnchor, + makeFragment, + wrapFragment, + makeVList, + makeOrd, + makeGlue, + staticSvg, + svgData, + tryCombineChars +}, thinspace = { + number: 3, + unit: "mu" +}, mediumspace = { + number: 4, + unit: "mu" +}, thickspace = { + number: 5, + unit: "mu" +}, spacings = { + mord: { + mop: thinspace, + mbin: mediumspace, + mrel: thickspace, + minner: thinspace + }, + mop: { + mord: thinspace, + mop: thinspace, + mrel: thickspace, + minner: thinspace + }, + mbin: { + mord: mediumspace, + mop: mediumspace, + mopen: mediumspace, + minner: mediumspace + }, + mrel: { + mord: thickspace, + mop: thickspace, + mopen: thickspace, + minner: thickspace + }, + mopen: {}, + mclose: { + mop: thinspace, + mbin: mediumspace, + mrel: thickspace, + minner: thinspace + }, + mpunct: { + mord: thinspace, + mop: thinspace, + mrel: thickspace, + mopen: thinspace, + mclose: thinspace, + mpunct: thinspace, + minner: thinspace + }, + minner: { + mord: thinspace, + mop: thinspace, + mbin: mediumspace, + mrel: thickspace, + mopen: thinspace, + mpunct: thinspace, + minner: thinspace + } +}, tightSpacings = { + mord: { + mop: thinspace + }, + mop: { + mord: thinspace, + mop: thinspace + }, + mbin: {}, + mrel: {}, + mopen: {}, + mclose: { + mop: thinspace + }, + mpunct: {}, + minner: { + mop: thinspace + } +}, _functions = {}, _htmlGroupBuilders = {}, _mathmlGroupBuilders = {}; +function defineFunction(s) { + for (var { + type: e, + names: r, + props: o, + handler: m, + htmlBuilder: _, + mathmlBuilder: g + } = s, y = { + type: e, + numArgs: o.numArgs, + argTypes: o.argTypes, + allowedInArgument: !!o.allowedInArgument, + allowedInText: !!o.allowedInText, + allowedInMath: o.allowedInMath === void 0 ? !0 : o.allowedInMath, + numOptionalArgs: o.numOptionalArgs || 0, + infix: !!o.infix, + primitive: !!o.primitive, + handler: m + }, E = 0; E < r.length; ++E) + _functions[r[E]] = y; + e && (_ && (_htmlGroupBuilders[e] = _), g && (_mathmlGroupBuilders[e] = g)); +} +function defineFunctionBuilders(s) { + var { + type: e, + htmlBuilder: r, + mathmlBuilder: o + } = s; + defineFunction({ + type: e, + names: [], + props: { + numArgs: 0 + }, + handler() { + throw new Error("Should never be called."); + }, + htmlBuilder: r, + mathmlBuilder: o + }); +} +var normalizeArgument = function(e) { + return e.type === "ordgroup" && e.body.length === 1 ? e.body[0] : e; +}, ordargument = function(e) { + return e.type === "ordgroup" ? e.body : [e]; +}, makeSpan$1 = buildCommon.makeSpan, binLeftCanceller = ["leftmost", "mbin", "mopen", "mrel", "mop", "mpunct"], binRightCanceller = ["rightmost", "mrel", "mclose", "mpunct"], styleMap$1 = { + display: Style$1.DISPLAY, + text: Style$1.TEXT, + script: Style$1.SCRIPT, + scriptscript: Style$1.SCRIPTSCRIPT +}, DomEnum = { + mord: "mord", + mop: "mop", + mbin: "mbin", + mrel: "mrel", + mopen: "mopen", + mclose: "mclose", + mpunct: "mpunct", + minner: "minner" +}, buildExpression$1 = function(e, r, o, m) { + m === void 0 && (m = [null, null]); + for (var _ = [], g = 0; g < e.length; g++) { + var y = buildGroup$1(e[g], r); + if (y instanceof DocumentFragment) { + var E = y.children; + _.push(...E); + } else + _.push(y); + } + if (buildCommon.tryCombineChars(_), !o) + return _; + var x = r; + if (e.length === 1) { + var v = e[0]; + v.type === "sizing" ? x = r.havingSize(v.size) : v.type === "styling" && (x = r.havingStyle(styleMap$1[v.style])); + } + var h = makeSpan$1([m[0] || "leftmost"], [], r), a = makeSpan$1([m[1] || "rightmost"], [], r), b = o === "root"; + return traverseNonSpaceNodes(_, (w, k) => { + var A = k.classes[0], M = w.classes[0]; + A === "mbin" && utils.contains(binRightCanceller, M) ? k.classes[0] = "mord" : M === "mbin" && utils.contains(binLeftCanceller, A) && (w.classes[0] = "mord"); + }, { + node: h + }, a, b), traverseNonSpaceNodes(_, (w, k) => { + var A = getTypeOfDomTree(k), M = getTypeOfDomTree(w), $ = A && M ? w.hasClass("mtight") ? tightSpacings[A][M] : spacings[A][M] : null; + if ($) + return buildCommon.makeGlue($, x); + }, { + node: h + }, a, b), _; +}, traverseNonSpaceNodes = function s(e, r, o, m, _) { + m && e.push(m); + for (var g = 0; g < e.length; g++) { + var y = e[g], E = checkPartialGroup(y); + if (E) { + s(E.children, r, o, null, _); + continue; + } + var x = !y.hasClass("mspace"); + if (x) { + var v = r(y, o.node); + v && (o.insertAfter ? o.insertAfter(v) : (e.unshift(v), g++)); + } + x ? o.node = y : _ && y.hasClass("newline") && (o.node = makeSpan$1(["leftmost"])), o.insertAfter = /* @__PURE__ */ ((h) => (a) => { + e.splice(h + 1, 0, a), g++; + })(g); + } + m && e.pop(); +}, checkPartialGroup = function(e) { + return e instanceof DocumentFragment || e instanceof Anchor || e instanceof Span && e.hasClass("enclosing") ? e : null; +}, getOutermostNode = function s(e, r) { + var o = checkPartialGroup(e); + if (o) { + var m = o.children; + if (m.length) { + if (r === "right") + return s(m[m.length - 1], "right"); + if (r === "left") + return s(m[0], "left"); + } + } + return e; +}, getTypeOfDomTree = function(e, r) { + return e ? (r && (e = getOutermostNode(e, r)), DomEnum[e.classes[0]] || null) : null; +}, makeNullDelimiter = function(e, r) { + var o = ["nulldelimiter"].concat(e.baseSizingClasses()); + return makeSpan$1(r.concat(o)); +}, buildGroup$1 = function(e, r, o) { + if (!e) + return makeSpan$1(); + if (_htmlGroupBuilders[e.type]) { + var m = _htmlGroupBuilders[e.type](e, r); + if (o && r.size !== o.size) { + m = makeSpan$1(r.sizingClasses(o), [m], r); + var _ = r.sizeMultiplier / o.sizeMultiplier; + m.height *= _, m.depth *= _; + } + return m; + } else + throw new ParseError("Got group of unknown type: '" + e.type + "'"); +}; +function buildHTMLUnbreakable(s, e) { + var r = makeSpan$1(["base"], s, e), o = makeSpan$1(["strut"]); + return o.style.height = makeEm(r.height + r.depth), r.depth && (o.style.verticalAlign = makeEm(-r.depth)), r.children.unshift(o), r; +} +function buildHTML(s, e) { + var r = null; + s.length === 1 && s[0].type === "tag" && (r = s[0].tag, s = s[0].body); + var o = buildExpression$1(s, e, "root"), m; + o.length === 2 && o[1].hasClass("tag") && (m = o.pop()); + for (var _ = [], g = [], y = 0; y < o.length; y++) + if (g.push(o[y]), o[y].hasClass("mbin") || o[y].hasClass("mrel") || o[y].hasClass("allowbreak")) { + for (var E = !1; y < o.length - 1 && o[y + 1].hasClass("mspace") && !o[y + 1].hasClass("newline"); ) + y++, g.push(o[y]), o[y].hasClass("nobreak") && (E = !0); + E || (_.push(buildHTMLUnbreakable(g, e)), g = []); + } else o[y].hasClass("newline") && (g.pop(), g.length > 0 && (_.push(buildHTMLUnbreakable(g, e)), g = []), _.push(o[y])); + g.length > 0 && _.push(buildHTMLUnbreakable(g, e)); + var x; + r ? (x = buildHTMLUnbreakable(buildExpression$1(r, e, !0)), x.classes = ["tag"], _.push(x)) : m && _.push(m); + var v = makeSpan$1(["katex-html"], _); + if (v.setAttribute("aria-hidden", "true"), x) { + var h = x.children[0]; + h.style.height = makeEm(v.height + v.depth), v.depth && (h.style.verticalAlign = makeEm(-v.depth)); + } + return v; +} +function newDocumentFragment(s) { + return new DocumentFragment(s); +} +class MathNode { + constructor(e, r, o) { + this.type = void 0, this.attributes = void 0, this.children = void 0, this.classes = void 0, this.type = e, this.attributes = {}, this.children = r || [], this.classes = o || []; + } + /** + * Sets an attribute on a MathML node. MathML depends on attributes to convey a + * semantic content, so this is used heavily. + */ + setAttribute(e, r) { + this.attributes[e] = r; + } + /** + * Gets an attribute on a MathML node. + */ + getAttribute(e) { + return this.attributes[e]; + } + /** + * Converts the math node into a MathML-namespaced DOM element. + */ + toNode() { + var e = document.createElementNS("http://www.w3.org/1998/Math/MathML", this.type); + for (var r in this.attributes) + Object.prototype.hasOwnProperty.call(this.attributes, r) && e.setAttribute(r, this.attributes[r]); + this.classes.length > 0 && (e.className = createClass(this.classes)); + for (var o = 0; o < this.children.length; o++) + if (this.children[o] instanceof TextNode && this.children[o + 1] instanceof TextNode) { + for (var m = this.children[o].toText() + this.children[++o].toText(); this.children[o + 1] instanceof TextNode; ) + m += this.children[++o].toText(); + e.appendChild(new TextNode(m).toNode()); + } else + e.appendChild(this.children[o].toNode()); + return e; + } + /** + * Converts the math node into an HTML markup string. + */ + toMarkup() { + var e = "<" + this.type; + for (var r in this.attributes) + Object.prototype.hasOwnProperty.call(this.attributes, r) && (e += " " + r + '="', e += utils.escape(this.attributes[r]), e += '"'); + this.classes.length > 0 && (e += ' class ="' + utils.escape(createClass(this.classes)) + '"'), e += ">"; + for (var o = 0; o < this.children.length; o++) + e += this.children[o].toMarkup(); + return e += "", e; + } + /** + * Converts the math node into a string, similar to innerText, but escaped. + */ + toText() { + return this.children.map((e) => e.toText()).join(""); + } +} +class TextNode { + constructor(e) { + this.text = void 0, this.text = e; + } + /** + * Converts the text node into a DOM text node. + */ + toNode() { + return document.createTextNode(this.text); + } + /** + * Converts the text node into escaped HTML markup + * (representing the text itself). + */ + toMarkup() { + return utils.escape(this.toText()); + } + /** + * Converts the text node into a string + * (representing the text itself). + */ + toText() { + return this.text; + } +} +class SpaceNode { + /** + * Create a Space node with width given in CSS ems. + */ + constructor(e) { + this.width = void 0, this.character = void 0, this.width = e, e >= 0.05555 && e <= 0.05556 ? this.character = " " : e >= 0.1666 && e <= 0.1667 ? this.character = " " : e >= 0.2222 && e <= 0.2223 ? this.character = " " : e >= 0.2777 && e <= 0.2778 ? this.character = "  " : e >= -0.05556 && e <= -0.05555 ? this.character = " ⁣" : e >= -0.1667 && e <= -0.1666 ? this.character = " ⁣" : e >= -0.2223 && e <= -0.2222 ? this.character = " ⁣" : e >= -0.2778 && e <= -0.2777 ? this.character = " ⁣" : this.character = null; + } + /** + * Converts the math node into a MathML-namespaced DOM element. + */ + 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", makeEm(this.width)), e; + } + /** + * Converts the math node into an HTML markup string. + */ + toMarkup() { + return this.character ? "" + this.character + "" : ''; + } + /** + * Converts the math node into a string, similar to innerText. + */ + toText() { + return this.character ? this.character : " "; + } +} +var mathMLTree = { + MathNode, + TextNode, + SpaceNode, + newDocumentFragment +}, makeText = function(e, r, o) { + return symbols[r][e] && symbols[r][e].replace && e.charCodeAt(0) !== 55349 && !(ligatures.hasOwnProperty(e) && o && (o.fontFamily && o.fontFamily.slice(4, 6) === "tt" || o.font && o.font.slice(4, 6) === "tt")) && (e = symbols[r][e].replace), new mathMLTree.TextNode(e); +}, makeRow = function(e) { + return e.length === 1 ? e[0] : new mathMLTree.MathNode("mrow", e); +}, getVariant = function(e, r) { + if (r.fontFamily === "texttt") + return "monospace"; + if (r.fontFamily === "textsf") + return r.fontShape === "textit" && r.fontWeight === "textbf" ? "sans-serif-bold-italic" : r.fontShape === "textit" ? "sans-serif-italic" : r.fontWeight === "textbf" ? "bold-sans-serif" : "sans-serif"; + if (r.fontShape === "textit" && r.fontWeight === "textbf") + return "bold-italic"; + if (r.fontShape === "textit") + return "italic"; + if (r.fontWeight === "textbf") + return "bold"; + var o = r.font; + if (!o || o === "mathnormal") + return null; + var m = e.mode; + if (o === "mathit") + return "italic"; + if (o === "boldsymbol") + return e.type === "textord" ? "bold" : "bold-italic"; + if (o === "mathbf") + return "bold"; + if (o === "mathbb") + return "double-struck"; + if (o === "mathsfit") + return "sans-serif-italic"; + if (o === "mathfrak") + return "fraktur"; + if (o === "mathscr" || o === "mathcal") + return "script"; + if (o === "mathsf") + return "sans-serif"; + if (o === "mathtt") + return "monospace"; + var _ = e.text; + if (utils.contains(["\\imath", "\\jmath"], _)) + return null; + symbols[m][_] && symbols[m][_].replace && (_ = symbols[m][_].replace); + var g = buildCommon.fontMap[o].fontName; + return getCharacterMetrics(_, g, m) ? buildCommon.fontMap[o].variant : null; +}; +function isNumberPunctuation(s) { + if (!s) + return !1; + if (s.type === "mi" && s.children.length === 1) { + var e = s.children[0]; + return e instanceof TextNode && e.text === "."; + } else if (s.type === "mo" && s.children.length === 1 && s.getAttribute("separator") === "true" && s.getAttribute("lspace") === "0em" && s.getAttribute("rspace") === "0em") { + var r = s.children[0]; + return r instanceof TextNode && r.text === ","; + } else + return !1; +} +var buildExpression = function(e, r, o) { + if (e.length === 1) { + var m = buildGroup(e[0], r); + return o && m instanceof MathNode && m.type === "mo" && (m.setAttribute("lspace", "0em"), m.setAttribute("rspace", "0em")), [m]; + } + for (var _ = [], g, y = 0; y < e.length; y++) { + var E = buildGroup(e[y], r); + if (E instanceof MathNode && g instanceof MathNode) { + if (E.type === "mtext" && g.type === "mtext" && E.getAttribute("mathvariant") === g.getAttribute("mathvariant")) { + g.children.push(...E.children); + continue; + } else if (E.type === "mn" && g.type === "mn") { + g.children.push(...E.children); + continue; + } else if (isNumberPunctuation(E) && g.type === "mn") { + g.children.push(...E.children); + continue; + } else if (E.type === "mn" && isNumberPunctuation(g)) + E.children = [...g.children, ...E.children], _.pop(); + else if ((E.type === "msup" || E.type === "msub") && E.children.length >= 1 && (g.type === "mn" || isNumberPunctuation(g))) { + var x = E.children[0]; + x instanceof MathNode && x.type === "mn" && (x.children = [...g.children, ...x.children], _.pop()); + } else if (g.type === "mi" && g.children.length === 1) { + var v = g.children[0]; + if (v instanceof TextNode && v.text === "̸" && (E.type === "mo" || E.type === "mi" || E.type === "mn")) { + var h = E.children[0]; + h instanceof TextNode && h.text.length > 0 && (h.text = h.text.slice(0, 1) + "̸" + h.text.slice(1), _.pop()); + } + } + } + _.push(E), g = E; + } + return _; +}, buildExpressionRow = function(e, r, o) { + return makeRow(buildExpression(e, r, o)); +}, buildGroup = function(e, r) { + if (!e) + return new mathMLTree.MathNode("mrow"); + if (_mathmlGroupBuilders[e.type]) { + var o = _mathmlGroupBuilders[e.type](e, r); + return o; + } else + throw new ParseError("Got group of unknown type: '" + e.type + "'"); +}; +function buildMathML(s, e, r, o, m) { + var _ = buildExpression(s, r), g; + _.length === 1 && _[0] instanceof MathNode && utils.contains(["mrow", "mtable"], _[0].type) ? g = _[0] : g = new mathMLTree.MathNode("mrow", _); + var y = new mathMLTree.MathNode("annotation", [new mathMLTree.TextNode(e)]); + y.setAttribute("encoding", "application/x-tex"); + var E = new mathMLTree.MathNode("semantics", [g, y]), x = new mathMLTree.MathNode("math", [E]); + x.setAttribute("xmlns", "http://www.w3.org/1998/Math/MathML"), o && x.setAttribute("display", "block"); + var v = m ? "katex" : "katex-mathml"; + return buildCommon.makeSpan([v], [x]); +} +var optionsFromSettings = function(e) { + return new Options({ + style: e.displayMode ? Style$1.DISPLAY : Style$1.TEXT, + maxSize: e.maxSize, + minRuleThickness: e.minRuleThickness + }); +}, displayWrap = function(e, r) { + if (r.displayMode) { + var o = ["katex-display"]; + r.leqno && o.push("leqno"), r.fleqn && o.push("fleqn"), e = buildCommon.makeSpan(o, [e]); + } + return e; +}, buildTree = function(e, r, o) { + var m = optionsFromSettings(o), _; + if (o.output === "mathml") + return buildMathML(e, r, m, o.displayMode, !0); + if (o.output === "html") { + var g = buildHTML(e, m); + _ = buildCommon.makeSpan(["katex"], [g]); + } else { + var y = buildMathML(e, r, m, o.displayMode, !1), E = buildHTML(e, m); + _ = buildCommon.makeSpan(["katex"], [y, E]); + } + return displayWrap(_, o); +}, buildHTMLTree = function(e, r, o) { + var m = optionsFromSettings(o), _ = buildHTML(e, m), g = buildCommon.makeSpan(["katex"], [_]); + return displayWrap(g, o); +}, stretchyCodePoint = { + widehat: "^", + widecheck: "ˇ", + widetilde: "~", + utilde: "~", + overleftarrow: "←", + underleftarrow: "←", + xleftarrow: "←", + overrightarrow: "→", + underrightarrow: "→", + xrightarrow: "→", + underbrace: "⏟", + overbrace: "⏞", + overgroup: "⏠", + undergroup: "⏡", + overleftrightarrow: "↔", + underleftrightarrow: "↔", + xleftrightarrow: "↔", + Overrightarrow: "⇒", + xRightarrow: "⇒", + overleftharpoon: "↼", + xleftharpoonup: "↼", + overrightharpoon: "⇀", + xrightharpoonup: "⇀", + xLeftarrow: "⇐", + xLeftrightarrow: "⇔", + xhookleftarrow: "↩", + xhookrightarrow: "↪", + xmapsto: "↦", + xrightharpoondown: "⇁", + xleftharpoondown: "↽", + xrightleftharpoons: "⇌", + xleftrightharpoons: "⇋", + xtwoheadleftarrow: "↞", + xtwoheadrightarrow: "↠", + xlongequal: "=", + xtofrom: "⇄", + xrightleftarrows: "⇄", + xrightequilibrium: "⇌", + // Not a perfect match. + xleftequilibrium: "⇋", + // None better available. + "\\cdrightarrow": "→", + "\\cdleftarrow": "←", + "\\cdlongequal": "=" +}, mathMLnode = function(e) { + var r = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(stretchyCodePoint[e.replace(/^\\/, "")])]); + return r.setAttribute("stretchy", "true"), r; +}, katexImagesData = { + // path(s), minWidth, height, align + overrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"], + overleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"], + underrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"], + underleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"], + xrightarrow: [["rightarrow"], 1.469, 522, "xMaxYMin"], + "\\cdrightarrow": [["rightarrow"], 3, 522, "xMaxYMin"], + // CD minwwidth2.5pc + xleftarrow: [["leftarrow"], 1.469, 522, "xMinYMin"], + "\\cdleftarrow": [["leftarrow"], 3, 522, "xMinYMin"], + Overrightarrow: [["doublerightarrow"], 0.888, 560, "xMaxYMin"], + xRightarrow: [["doublerightarrow"], 1.526, 560, "xMaxYMin"], + xLeftarrow: [["doubleleftarrow"], 1.526, 560, "xMinYMin"], + overleftharpoon: [["leftharpoon"], 0.888, 522, "xMinYMin"], + xleftharpoonup: [["leftharpoon"], 0.888, 522, "xMinYMin"], + xleftharpoondown: [["leftharpoondown"], 0.888, 522, "xMinYMin"], + overrightharpoon: [["rightharpoon"], 0.888, 522, "xMaxYMin"], + xrightharpoonup: [["rightharpoon"], 0.888, 522, "xMaxYMin"], + xrightharpoondown: [["rightharpoondown"], 0.888, 522, "xMaxYMin"], + xlongequal: [["longequal"], 0.888, 334, "xMinYMin"], + "\\cdlongequal": [["longequal"], 3, 334, "xMinYMin"], + xtwoheadleftarrow: [["twoheadleftarrow"], 0.888, 334, "xMinYMin"], + xtwoheadrightarrow: [["twoheadrightarrow"], 0.888, 334, "xMaxYMin"], + overleftrightarrow: [["leftarrow", "rightarrow"], 0.888, 522], + overbrace: [["leftbrace", "midbrace", "rightbrace"], 1.6, 548], + underbrace: [["leftbraceunder", "midbraceunder", "rightbraceunder"], 1.6, 548], + underleftrightarrow: [["leftarrow", "rightarrow"], 0.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"], 0.888, 522], + underlinesegment: [["leftlinesegment", "rightlinesegment"], 0.888, 522], + overgroup: [["leftgroup", "rightgroup"], 0.888, 342], + undergroup: [["leftgroupunder", "rightgroupunder"], 0.888, 342], + xmapsto: [["leftmapsto", "rightarrow"], 1.5, 522], + xtofrom: [["leftToFrom", "rightToFrom"], 1.75, 528], + // The next three arrows are from the mhchem package. + // In mhchem.sty, min-length is 2.0em. But these arrows might appear in the + // document as \xrightarrow or \xrightleftharpoons. Those have + // min-length = 1.75em, so we set min-length on these next three to match. + xrightleftarrows: [["baraboveleftarrow", "rightarrowabovebar"], 1.75, 901], + xrightequilibrium: [["baraboveshortleftharpoon", "rightharpoonaboveshortbar"], 1.75, 716], + xleftequilibrium: [["shortbaraboveleftharpoon", "shortrightharpoonabovebar"], 1.75, 716] +}, groupLength = function(e) { + return e.type === "ordgroup" ? e.body.length : 1; +}, svgSpan = function(e, r) { + function o() { + var y = 4e5, E = e.label.slice(1); + if (utils.contains(["widehat", "widecheck", "widetilde", "utilde"], E)) { + var x = e, v = groupLength(x.base), h, a, b; + if (v > 5) + E === "widehat" || E === "widecheck" ? (h = 420, y = 2364, b = 0.42, a = E + "4") : (h = 312, y = 2340, b = 0.34, a = "tilde4"); + else { + var w = [1, 1, 2, 2, 3, 3][v]; + E === "widehat" || E === "widecheck" ? (y = [0, 1062, 2364, 2364, 2364][w], h = [0, 239, 300, 360, 420][w], b = [0, 0.24, 0.3, 0.3, 0.36, 0.42][w], a = E + w) : (y = [0, 600, 1033, 2339, 2340][w], h = [0, 260, 286, 306, 312][w], b = [0, 0.26, 0.286, 0.3, 0.306, 0.34][w], a = "tilde" + w); + } + var k = new PathNode(a), A = new SvgNode([k], { + width: "100%", + height: makeEm(b), + viewBox: "0 0 " + y + " " + h, + preserveAspectRatio: "none" + }); + return { + span: buildCommon.makeSvgSpan([], [A], r), + minWidth: 0, + height: b + }; + } else { + var M = [], $ = katexImagesData[E], [O, C, P] = $, I = P / 1e3, N = O.length, R, F; + if (N === 1) { + var B = $[3]; + R = ["hide-tail"], F = [B]; + } else if (N === 2) + R = ["halfarrow-left", "halfarrow-right"], F = ["xMinYMin", "xMaxYMin"]; + else if (N === 3) + R = ["brace-left", "brace-center", "brace-right"], F = ["xMinYMin", "xMidYMin", "xMaxYMin"]; + else + throw new Error(`Correct katexImagesData or update code here to support + ` + N + " children."); + for (var G = 0; G < N; G++) { + var Q = new PathNode(O[G]), ee = new SvgNode([Q], { + width: "400em", + height: makeEm(I), + viewBox: "0 0 " + y + " " + P, + preserveAspectRatio: F[G] + " slice" + }), Y = buildCommon.makeSvgSpan([R[G]], [ee], r); + if (N === 1) + return { + span: Y, + minWidth: C, + height: I + }; + Y.style.height = makeEm(I), M.push(Y); + } + return { + span: buildCommon.makeSpan(["stretchy"], M, r), + minWidth: C, + height: I + }; + } + } + var { + span: m, + minWidth: _, + height: g + } = o(); + return m.height = g, m.style.height = makeEm(g), _ > 0 && (m.style.minWidth = makeEm(_)), m; +}, encloseSpan = function(e, r, o, m, _) { + var g, y = e.height + e.depth + o + m; + if (/fbox|color|angl/.test(r)) { + if (g = buildCommon.makeSpan(["stretchy", r], [], _), r === "fbox") { + var E = _.color && _.getColor(); + E && (g.style.borderColor = E); + } + } else { + var x = []; + /^[bx]cancel$/.test(r) && x.push(new LineNode({ + x1: "0", + y1: "0", + x2: "100%", + y2: "100%", + "stroke-width": "0.046em" + })), /^x?cancel$/.test(r) && x.push(new LineNode({ + x1: "0", + y1: "100%", + x2: "100%", + y2: "0", + "stroke-width": "0.046em" + })); + var v = new SvgNode(x, { + width: "100%", + height: makeEm(y) + }); + g = buildCommon.makeSvgSpan([], [v], _); + } + return g.height = y, g.style.height = makeEm(y), g; +}, stretchy = { + encloseSpan, + mathMLnode, + svgSpan +}; +function assertNodeType(s, e) { + if (!s || s.type !== e) + throw new Error("Expected node of type " + e + ", but got " + (s ? "node of type " + s.type : String(s))); + return s; +} +function assertSymbolNodeType(s) { + var e = checkSymbolNodeType(s); + if (!e) + throw new Error("Expected node of symbol group type, but got " + (s ? "node of type " + s.type : String(s))); + return e; +} +function checkSymbolNodeType(s) { + return s && (s.type === "atom" || NON_ATOMS.hasOwnProperty(s.type)) ? s : null; +} +var htmlBuilder$a = (s, e) => { + var r, o, m; + s && s.type === "supsub" ? (o = assertNodeType(s.base, "accent"), r = o.base, s.base = r, m = assertSpan(buildGroup$1(s, e)), s.base = o) : (o = assertNodeType(s, "accent"), r = o.base); + var _ = buildGroup$1(r, e.havingCrampedStyle()), g = o.isShifty && utils.isCharacterBox(r), y = 0; + if (g) { + var E = utils.getBaseElem(r), x = buildGroup$1(E, e.havingCrampedStyle()); + y = assertSymbolDomNode(x).skew; + } + var v = o.label === "\\c", h = v ? _.height + _.depth : Math.min(_.height, e.fontMetrics().xHeight), a; + if (o.isStretchy) + a = stretchy.svgSpan(o, e), a = buildCommon.makeVList({ + positionType: "firstBaseline", + children: [{ + type: "elem", + elem: _ + }, { + type: "elem", + elem: a, + wrapperClasses: ["svg-align"], + wrapperStyle: y > 0 ? { + width: "calc(100% - " + makeEm(2 * y) + ")", + marginLeft: makeEm(2 * y) + } : void 0 + }] + }, e); + else { + var b, w; + o.label === "\\vec" ? (b = buildCommon.staticSvg("vec", e), w = buildCommon.svgData.vec[1]) : (b = buildCommon.makeOrd({ + mode: o.mode, + text: o.label + }, e, "textord"), b = assertSymbolDomNode(b), b.italic = 0, w = b.width, v && (h += b.depth)), a = buildCommon.makeSpan(["accent-body"], [b]); + var k = o.label === "\\textcircled"; + k && (a.classes.push("accent-full"), h = _.height); + var A = y; + k || (A -= w / 2), a.style.left = makeEm(A), o.label === "\\textcircled" && (a.style.top = ".2em"), a = buildCommon.makeVList({ + positionType: "firstBaseline", + children: [{ + type: "elem", + elem: _ + }, { + type: "kern", + size: -h + }, { + type: "elem", + elem: a + }] + }, e); + } + var M = buildCommon.makeSpan(["mord", "accent"], [a], e); + return m ? (m.children[0] = M, m.height = Math.max(M.height, m.height), m.classes[0] = "mord", m) : M; +}, mathmlBuilder$9 = (s, e) => { + var r = s.isStretchy ? stretchy.mathMLnode(s.label) : new mathMLTree.MathNode("mo", [makeText(s.label, s.mode)]), o = new mathMLTree.MathNode("mover", [buildGroup(s.base, e), r]); + return o.setAttribute("accent", "true"), o; +}, NON_STRETCHY_ACCENT_REGEX = new RegExp(["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring"].map((s) => "\\" + s).join("|")); +defineFunction({ + 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: (s, e) => { + var r = normalizeArgument(e[0]), o = !NON_STRETCHY_ACCENT_REGEX.test(s.funcName), m = !o || s.funcName === "\\widehat" || s.funcName === "\\widetilde" || s.funcName === "\\widecheck"; + return { + type: "accent", + mode: s.parser.mode, + label: s.funcName, + isStretchy: o, + isShifty: m, + base: r + }; + }, + htmlBuilder: htmlBuilder$a, + mathmlBuilder: mathmlBuilder$9 +}); +defineFunction({ + type: "accent", + names: ["\\'", "\\`", "\\^", "\\~", "\\=", "\\u", "\\.", '\\"', "\\c", "\\r", "\\H", "\\v", "\\textcircled"], + props: { + numArgs: 1, + allowedInText: !0, + allowedInMath: !0, + // unless in strict mode + argTypes: ["primitive"] + }, + handler: (s, e) => { + var r = e[0], o = s.parser.mode; + return o === "math" && (s.parser.settings.reportNonstrict("mathVsTextAccents", "LaTeX's accent " + s.funcName + " works only in text mode"), o = "text"), { + type: "accent", + mode: o, + label: s.funcName, + isStretchy: !1, + isShifty: !0, + base: r + }; + }, + htmlBuilder: htmlBuilder$a, + mathmlBuilder: mathmlBuilder$9 +}); +defineFunction({ + type: "accentUnder", + names: ["\\underleftarrow", "\\underrightarrow", "\\underleftrightarrow", "\\undergroup", "\\underlinesegment", "\\utilde"], + props: { + numArgs: 1 + }, + handler: (s, e) => { + var { + parser: r, + funcName: o + } = s, m = e[0]; + return { + type: "accentUnder", + mode: r.mode, + label: o, + base: m + }; + }, + htmlBuilder: (s, e) => { + var r = buildGroup$1(s.base, e), o = stretchy.svgSpan(s, e), m = s.label === "\\utilde" ? 0.12 : 0, _ = buildCommon.makeVList({ + positionType: "top", + positionData: r.height, + children: [{ + type: "elem", + elem: o, + wrapperClasses: ["svg-align"] + }, { + type: "kern", + size: m + }, { + type: "elem", + elem: r + }] + }, e); + return buildCommon.makeSpan(["mord", "accentunder"], [_], e); + }, + mathmlBuilder: (s, e) => { + var r = stretchy.mathMLnode(s.label), o = new mathMLTree.MathNode("munder", [buildGroup(s.base, e), r]); + return o.setAttribute("accentunder", "true"), o; + } +}); +var paddedNode = (s) => { + var e = new mathMLTree.MathNode("mpadded", s ? [s] : []); + return e.setAttribute("width", "+0.6em"), e.setAttribute("lspace", "0.3em"), e; +}; +defineFunction({ + type: "xArrow", + names: [ + "\\xleftarrow", + "\\xrightarrow", + "\\xLeftarrow", + "\\xRightarrow", + "\\xleftrightarrow", + "\\xLeftrightarrow", + "\\xhookleftarrow", + "\\xhookrightarrow", + "\\xmapsto", + "\\xrightharpoondown", + "\\xrightharpoonup", + "\\xleftharpoondown", + "\\xleftharpoonup", + "\\xrightleftharpoons", + "\\xleftrightharpoons", + "\\xlongequal", + "\\xtwoheadrightarrow", + "\\xtwoheadleftarrow", + "\\xtofrom", + // The next 3 functions are here to support the mhchem extension. + // Direct use of these functions is discouraged and may break someday. + "\\xrightleftarrows", + "\\xrightequilibrium", + "\\xleftequilibrium", + // The next 3 functions are here only to support the {CD} environment. + "\\\\cdrightarrow", + "\\\\cdleftarrow", + "\\\\cdlongequal" + ], + props: { + numArgs: 1, + numOptionalArgs: 1 + }, + handler(s, e, r) { + var { + parser: o, + funcName: m + } = s; + return { + type: "xArrow", + mode: o.mode, + label: m, + body: e[0], + below: r[0] + }; + }, + // Flow is unable to correctly infer the type of `group`, even though it's + // unambiguously determined from the passed-in `type` above. + htmlBuilder(s, e) { + var r = e.style, o = e.havingStyle(r.sup()), m = buildCommon.wrapFragment(buildGroup$1(s.body, o, e), e), _ = s.label.slice(0, 2) === "\\x" ? "x" : "cd"; + m.classes.push(_ + "-arrow-pad"); + var g; + s.below && (o = e.havingStyle(r.sub()), g = buildCommon.wrapFragment(buildGroup$1(s.below, o, e), e), g.classes.push(_ + "-arrow-pad")); + var y = stretchy.svgSpan(s, e), E = -e.fontMetrics().axisHeight + 0.5 * y.height, x = -e.fontMetrics().axisHeight - 0.5 * y.height - 0.111; + (m.depth > 0.25 || s.label === "\\xleftequilibrium") && (x -= m.depth); + var v; + if (g) { + var h = -e.fontMetrics().axisHeight + g.height + 0.5 * y.height + 0.111; + v = buildCommon.makeVList({ + positionType: "individualShift", + children: [{ + type: "elem", + elem: m, + shift: x + }, { + type: "elem", + elem: y, + shift: E + }, { + type: "elem", + elem: g, + shift: h + }] + }, e); + } else + v = buildCommon.makeVList({ + positionType: "individualShift", + children: [{ + type: "elem", + elem: m, + shift: x + }, { + type: "elem", + elem: y, + shift: E + }] + }, e); + return v.children[0].children[0].children[1].classes.push("svg-align"), buildCommon.makeSpan(["mrel", "x-arrow"], [v], e); + }, + mathmlBuilder(s, e) { + var r = stretchy.mathMLnode(s.label); + r.setAttribute("minsize", s.label.charAt(0) === "x" ? "1.75em" : "3.0em"); + var o; + if (s.body) { + var m = paddedNode(buildGroup(s.body, e)); + if (s.below) { + var _ = paddedNode(buildGroup(s.below, e)); + o = new mathMLTree.MathNode("munderover", [r, _, m]); + } else + o = new mathMLTree.MathNode("mover", [r, m]); + } else if (s.below) { + var g = paddedNode(buildGroup(s.below, e)); + o = new mathMLTree.MathNode("munder", [r, g]); + } else + o = paddedNode(), o = new mathMLTree.MathNode("mover", [r, o]); + return o; + } +}); +var makeSpan = buildCommon.makeSpan; +function htmlBuilder$9(s, e) { + var r = buildExpression$1(s.body, e, !0); + return makeSpan([s.mclass], r, e); +} +function mathmlBuilder$8(s, e) { + var r, o = buildExpression(s.body, e); + return s.mclass === "minner" ? r = new mathMLTree.MathNode("mpadded", o) : s.mclass === "mord" ? s.isCharacterBox ? (r = o[0], r.type = "mi") : r = new mathMLTree.MathNode("mi", o) : (s.isCharacterBox ? (r = o[0], r.type = "mo") : r = new mathMLTree.MathNode("mo", o), s.mclass === "mbin" ? (r.attributes.lspace = "0.22em", r.attributes.rspace = "0.22em") : s.mclass === "mpunct" ? (r.attributes.lspace = "0em", r.attributes.rspace = "0.17em") : s.mclass === "mopen" || s.mclass === "mclose" ? (r.attributes.lspace = "0em", r.attributes.rspace = "0em") : s.mclass === "minner" && (r.attributes.lspace = "0.0556em", r.attributes.width = "+0.1111em")), r; +} +defineFunction({ + type: "mclass", + names: ["\\mathord", "\\mathbin", "\\mathrel", "\\mathopen", "\\mathclose", "\\mathpunct", "\\mathinner"], + props: { + numArgs: 1, + primitive: !0 + }, + handler(s, e) { + var { + parser: r, + funcName: o + } = s, m = e[0]; + return { + type: "mclass", + mode: r.mode, + mclass: "m" + o.slice(5), + // TODO(kevinb): don't prefix with 'm' + body: ordargument(m), + isCharacterBox: utils.isCharacterBox(m) + }; + }, + htmlBuilder: htmlBuilder$9, + mathmlBuilder: mathmlBuilder$8 +}); +var binrelClass = (s) => { + var e = s.type === "ordgroup" && s.body.length ? s.body[0] : s; + return e.type === "atom" && (e.family === "bin" || e.family === "rel") ? "m" + e.family : "mord"; +}; +defineFunction({ + type: "mclass", + names: ["\\@binrel"], + props: { + numArgs: 2 + }, + handler(s, e) { + var { + parser: r + } = s; + return { + type: "mclass", + mode: r.mode, + mclass: binrelClass(e[0]), + body: ordargument(e[1]), + isCharacterBox: utils.isCharacterBox(e[1]) + }; + } +}); +defineFunction({ + type: "mclass", + names: ["\\stackrel", "\\overset", "\\underset"], + props: { + numArgs: 2 + }, + handler(s, e) { + var { + parser: r, + funcName: o + } = s, m = e[1], _ = e[0], g; + o !== "\\stackrel" ? g = binrelClass(m) : g = "mrel"; + var y = { + type: "op", + mode: m.mode, + limits: !0, + alwaysHandleSupSub: !0, + parentIsSupSub: !1, + symbol: !1, + suppressBaseShift: o !== "\\stackrel", + body: ordargument(m) + }, E = { + type: "supsub", + mode: _.mode, + base: y, + sup: o === "\\underset" ? null : _, + sub: o === "\\underset" ? _ : null + }; + return { + type: "mclass", + mode: r.mode, + mclass: g, + body: [E], + isCharacterBox: utils.isCharacterBox(E) + }; + }, + htmlBuilder: htmlBuilder$9, + mathmlBuilder: mathmlBuilder$8 +}); +defineFunction({ + type: "pmb", + names: ["\\pmb"], + props: { + numArgs: 1, + allowedInText: !0 + }, + handler(s, e) { + var { + parser: r + } = s; + return { + type: "pmb", + mode: r.mode, + mclass: binrelClass(e[0]), + body: ordargument(e[0]) + }; + }, + htmlBuilder(s, e) { + var r = buildExpression$1(s.body, e, !0), o = buildCommon.makeSpan([s.mclass], r, e); + return o.style.textShadow = "0.02em 0.01em 0.04px", o; + }, + mathmlBuilder(s, e) { + var r = buildExpression(s.body, e), o = new mathMLTree.MathNode("mstyle", r); + return o.setAttribute("style", "text-shadow: 0.02em 0.01em 0.04px"), o; + } +}); +var cdArrowFunctionName = { + ">": "\\\\cdrightarrow", + "<": "\\\\cdleftarrow", + "=": "\\\\cdlongequal", + A: "\\uparrow", + V: "\\downarrow", + "|": "\\Vert", + ".": "no arrow" +}, newCell = () => ({ + type: "styling", + body: [], + mode: "math", + style: "display" +}), isStartOfArrow = (s) => s.type === "textord" && s.text === "@", isLabelEnd = (s, e) => (s.type === "mathord" || s.type === "atom") && s.text === e; +function cdArrow(s, e, r) { + var o = cdArrowFunctionName[s]; + switch (o) { + case "\\\\cdrightarrow": + case "\\\\cdleftarrow": + return r.callFunction(o, [e[0]], [e[1]]); + case "\\uparrow": + case "\\downarrow": { + var m = r.callFunction("\\\\cdleft", [e[0]], []), _ = { + type: "atom", + text: o, + mode: "math", + family: "rel" + }, g = r.callFunction("\\Big", [_], []), y = r.callFunction("\\\\cdright", [e[1]], []), E = { + type: "ordgroup", + mode: "math", + body: [m, g, y] + }; + return r.callFunction("\\\\cdparent", [E], []); + } + case "\\\\cdlongequal": + return r.callFunction("\\\\cdlongequal", [], []); + case "\\Vert": { + var x = { + type: "textord", + text: "\\Vert", + mode: "math" + }; + return r.callFunction("\\Big", [x], []); + } + default: + return { + type: "textord", + text: " ", + mode: "math" + }; + } +} +function parseCD(s) { + var e = []; + for (s.gullet.beginGroup(), s.gullet.macros.set("\\cr", "\\\\\\relax"), s.gullet.beginGroup(); ; ) { + e.push(s.parseExpression(!1, "\\\\")), s.gullet.endGroup(), s.gullet.beginGroup(); + var r = s.fetch().text; + if (r === "&" || r === "\\\\") + s.consume(); + else if (r === "\\end") { + e[e.length - 1].length === 0 && e.pop(); + break; + } else + throw new ParseError("Expected \\\\ or \\cr or \\end", s.nextToken); + } + for (var o = [], m = [o], _ = 0; _ < e.length; _++) { + for (var g = e[_], y = newCell(), E = 0; E < g.length; E++) + if (!isStartOfArrow(g[E])) + y.body.push(g[E]); + else { + o.push(y), E += 1; + var x = assertSymbolNodeType(g[E]).text, v = new Array(2); + if (v[0] = { + type: "ordgroup", + mode: "math", + body: [] + }, v[1] = { + type: "ordgroup", + mode: "math", + body: [] + }, !("=|.".indexOf(x) > -1)) if ("<>AV".indexOf(x) > -1) + for (var h = 0; h < 2; h++) { + for (var a = !0, b = E + 1; b < g.length; b++) { + if (isLabelEnd(g[b], x)) { + a = !1, E = b; + break; + } + if (isStartOfArrow(g[b])) + throw new ParseError("Missing a " + x + " character to complete a CD arrow.", g[b]); + v[h].body.push(g[b]); + } + if (a) + throw new ParseError("Missing a " + x + " character to complete a CD arrow.", g[E]); + } + else + throw new ParseError('Expected one of "<>AV=|." after @', g[E]); + var w = cdArrow(x, v, s), k = { + type: "styling", + body: [w], + mode: "math", + style: "display" + // CD is always displaystyle. + }; + o.push(k), y = newCell(); + } + _ % 2 === 0 ? o.push(y) : o.shift(), o = [], m.push(o); + } + s.gullet.endGroup(), s.gullet.endGroup(); + var A = new Array(m[0].length).fill({ + type: "align", + align: "c", + pregap: 0.25, + // CD package sets \enskip between columns. + postgap: 0.25 + // So pre and post each get half an \enskip, i.e. 0.25em. + }); + return { + type: "array", + mode: "math", + body: m, + arraystretch: 1, + addJot: !0, + rowGaps: [null], + cols: A, + colSeparationType: "CD", + hLinesBeforeRow: new Array(m.length + 1).fill([]) + }; +} +defineFunction({ + type: "cdlabel", + names: ["\\\\cdleft", "\\\\cdright"], + props: { + numArgs: 1 + }, + handler(s, e) { + var { + parser: r, + funcName: o + } = s; + return { + type: "cdlabel", + mode: r.mode, + side: o.slice(4), + label: e[0] + }; + }, + htmlBuilder(s, e) { + var r = e.havingStyle(e.style.sup()), o = buildCommon.wrapFragment(buildGroup$1(s.label, r, e), e); + return o.classes.push("cd-label-" + s.side), o.style.bottom = makeEm(0.8 - o.depth), o.height = 0, o.depth = 0, o; + }, + mathmlBuilder(s, e) { + var r = new mathMLTree.MathNode("mrow", [buildGroup(s.label, e)]); + return r = new mathMLTree.MathNode("mpadded", [r]), r.setAttribute("width", "0"), s.side === "left" && r.setAttribute("lspace", "-1width"), r.setAttribute("voffset", "0.7em"), r = new mathMLTree.MathNode("mstyle", [r]), r.setAttribute("displaystyle", "false"), r.setAttribute("scriptlevel", "1"), r; + } +}); +defineFunction({ + type: "cdlabelparent", + names: ["\\\\cdparent"], + props: { + numArgs: 1 + }, + handler(s, e) { + var { + parser: r + } = s; + return { + type: "cdlabelparent", + mode: r.mode, + fragment: e[0] + }; + }, + htmlBuilder(s, e) { + var r = buildCommon.wrapFragment(buildGroup$1(s.fragment, e), e); + return r.classes.push("cd-vert-arrow"), r; + }, + mathmlBuilder(s, e) { + return new mathMLTree.MathNode("mrow", [buildGroup(s.fragment, e)]); + } +}); +defineFunction({ + type: "textord", + names: ["\\@char"], + props: { + numArgs: 1, + allowedInText: !0 + }, + handler(s, e) { + for (var { + parser: r + } = s, o = assertNodeType(e[0], "ordgroup"), m = o.body, _ = "", g = 0; g < m.length; g++) { + var y = assertNodeType(m[g], "textord"); + _ += y.text; + } + var E = parseInt(_), x; + if (isNaN(E)) + throw new ParseError("\\@char has non-numeric argument " + _); + if (E < 0 || E >= 1114111) + throw new ParseError("\\@char with invalid code point " + _); + return E <= 65535 ? x = String.fromCharCode(E) : (E -= 65536, x = String.fromCharCode((E >> 10) + 55296, (E & 1023) + 56320)), { + type: "textord", + mode: r.mode, + text: x + }; + } +}); +var htmlBuilder$8 = (s, e) => { + var r = buildExpression$1(s.body, e.withColor(s.color), !1); + return buildCommon.makeFragment(r); +}, mathmlBuilder$7 = (s, e) => { + var r = buildExpression(s.body, e.withColor(s.color)), o = new mathMLTree.MathNode("mstyle", r); + return o.setAttribute("mathcolor", s.color), o; +}; +defineFunction({ + type: "color", + names: ["\\textcolor"], + props: { + numArgs: 2, + allowedInText: !0, + argTypes: ["color", "original"] + }, + handler(s, e) { + var { + parser: r + } = s, o = assertNodeType(e[0], "color-token").color, m = e[1]; + return { + type: "color", + mode: r.mode, + color: o, + body: ordargument(m) + }; + }, + htmlBuilder: htmlBuilder$8, + mathmlBuilder: mathmlBuilder$7 +}); +defineFunction({ + type: "color", + names: ["\\color"], + props: { + numArgs: 1, + allowedInText: !0, + argTypes: ["color"] + }, + handler(s, e) { + var { + parser: r, + breakOnTokenText: o + } = s, m = assertNodeType(e[0], "color-token").color; + r.gullet.macros.set("\\current@color", m); + var _ = r.parseExpression(!0, o); + return { + type: "color", + mode: r.mode, + color: m, + body: _ + }; + }, + htmlBuilder: htmlBuilder$8, + mathmlBuilder: mathmlBuilder$7 +}); +defineFunction({ + type: "cr", + names: ["\\\\"], + props: { + numArgs: 0, + numOptionalArgs: 0, + allowedInText: !0 + }, + handler(s, e, r) { + var { + parser: o + } = s, m = o.gullet.future().text === "[" ? o.parseSizeGroup(!0) : null, _ = !o.settings.displayMode || !o.settings.useStrictBehavior("newLineInDisplayMode", "In LaTeX, \\\\ or \\newline does nothing in display mode"); + return { + type: "cr", + mode: o.mode, + newLine: _, + size: m && assertNodeType(m, "size").value + }; + }, + // The following builders are called only at the top level, + // not within tabular/array environments. + htmlBuilder(s, e) { + var r = buildCommon.makeSpan(["mspace"], [], e); + return s.newLine && (r.classes.push("newline"), s.size && (r.style.marginTop = makeEm(calculateSize$1(s.size, e)))), r; + }, + mathmlBuilder(s, e) { + var r = new mathMLTree.MathNode("mspace"); + return s.newLine && (r.setAttribute("linebreak", "newline"), s.size && r.setAttribute("height", makeEm(calculateSize$1(s.size, e)))), r; + } +}); +var globalMap = { + "\\global": "\\global", + "\\long": "\\\\globallong", + "\\\\globallong": "\\\\globallong", + "\\def": "\\gdef", + "\\gdef": "\\gdef", + "\\edef": "\\xdef", + "\\xdef": "\\xdef", + "\\let": "\\\\globallet", + "\\futurelet": "\\\\globalfuture" +}, checkControlSequence = (s) => { + var e = s.text; + if (/^(?:[\\{}$&#^_]|EOF)$/.test(e)) + throw new ParseError("Expected a control sequence", s); + return e; +}, getRHS = (s) => { + var e = s.gullet.popToken(); + return e.text === "=" && (e = s.gullet.popToken(), e.text === " " && (e = s.gullet.popToken())), e; +}, letCommand = (s, e, r, o) => { + var m = s.gullet.macros.get(r.text); + m == null && (r.noexpand = !0, m = { + tokens: [r], + numArgs: 0, + // reproduce the same behavior in expansion + unexpandable: !s.gullet.isExpandable(r.text) + }), s.gullet.macros.set(e, m, o); +}; +defineFunction({ + type: "internal", + names: [ + "\\global", + "\\long", + "\\\\globallong" + // can’t be entered directly + ], + props: { + numArgs: 0, + allowedInText: !0 + }, + handler(s) { + var { + parser: e, + funcName: r + } = s; + e.consumeSpaces(); + var o = e.fetch(); + if (globalMap[o.text]) + return (r === "\\global" || r === "\\\\globallong") && (o.text = globalMap[o.text]), assertNodeType(e.parseFunction(), "internal"); + throw new ParseError("Invalid token after macro prefix", o); + } +}); +defineFunction({ + type: "internal", + names: ["\\def", "\\gdef", "\\edef", "\\xdef"], + props: { + numArgs: 0, + allowedInText: !0, + primitive: !0 + }, + handler(s) { + var { + parser: e, + funcName: r + } = s, o = e.gullet.popToken(), m = o.text; + if (/^(?:[\\{}$&#^_]|EOF)$/.test(m)) + throw new ParseError("Expected a control sequence", o); + for (var _ = 0, g, y = [[]]; e.gullet.future().text !== "{"; ) + if (o = e.gullet.popToken(), o.text === "#") { + if (e.gullet.future().text === "{") { + g = e.gullet.future(), y[_].push("{"); + break; + } + if (o = e.gullet.popToken(), !/^[1-9]$/.test(o.text)) + throw new ParseError('Invalid argument number "' + o.text + '"'); + if (parseInt(o.text) !== _ + 1) + throw new ParseError('Argument number "' + o.text + '" out of order'); + _++, y.push([]); + } else { + if (o.text === "EOF") + throw new ParseError("Expected a macro definition"); + y[_].push(o.text); + } + var { + tokens: E + } = e.gullet.consumeArg(); + return g && E.unshift(g), (r === "\\edef" || r === "\\xdef") && (E = e.gullet.expandTokens(E), E.reverse()), e.gullet.macros.set(m, { + tokens: E, + numArgs: _, + delimiters: y + }, r === globalMap[r]), { + type: "internal", + mode: e.mode + }; + } +}); +defineFunction({ + type: "internal", + names: [ + "\\let", + "\\\\globallet" + // can’t be entered directly + ], + props: { + numArgs: 0, + allowedInText: !0, + primitive: !0 + }, + handler(s) { + var { + parser: e, + funcName: r + } = s, o = checkControlSequence(e.gullet.popToken()); + e.gullet.consumeSpaces(); + var m = getRHS(e); + return letCommand(e, o, m, r === "\\\\globallet"), { + type: "internal", + mode: e.mode + }; + } +}); +defineFunction({ + type: "internal", + names: [ + "\\futurelet", + "\\\\globalfuture" + // can’t be entered directly + ], + props: { + numArgs: 0, + allowedInText: !0, + primitive: !0 + }, + handler(s) { + var { + parser: e, + funcName: r + } = s, o = checkControlSequence(e.gullet.popToken()), m = e.gullet.popToken(), _ = e.gullet.popToken(); + return letCommand(e, o, _, r === "\\\\globalfuture"), e.gullet.pushToken(_), e.gullet.pushToken(m), { + type: "internal", + mode: e.mode + }; + } +}); +var getMetrics = function(e, r, o) { + var m = symbols.math[e] && symbols.math[e].replace, _ = getCharacterMetrics(m || e, r, o); + if (!_) + throw new Error("Unsupported symbol " + e + " and font size " + r + "."); + return _; +}, styleWrap = function(e, r, o, m) { + var _ = o.havingBaseStyle(r), g = buildCommon.makeSpan(m.concat(_.sizingClasses(o)), [e], o), y = _.sizeMultiplier / o.sizeMultiplier; + return g.height *= y, g.depth *= y, g.maxFontSize = _.sizeMultiplier, g; +}, centerSpan = function(e, r, o) { + var m = r.havingBaseStyle(o), _ = (1 - r.sizeMultiplier / m.sizeMultiplier) * r.fontMetrics().axisHeight; + e.classes.push("delimcenter"), e.style.top = makeEm(_), e.height -= _, e.depth += _; +}, makeSmallDelim = function(e, r, o, m, _, g) { + var y = buildCommon.makeSymbol(e, "Main-Regular", _, m), E = styleWrap(y, r, m, g); + return o && centerSpan(E, m, r), E; +}, mathrmSize = function(e, r, o, m) { + return buildCommon.makeSymbol(e, "Size" + r + "-Regular", o, m); +}, makeLargeDelim = function(e, r, o, m, _, g) { + var y = mathrmSize(e, r, _, m), E = styleWrap(buildCommon.makeSpan(["delimsizing", "size" + r], [y], m), Style$1.TEXT, m, g); + return o && centerSpan(E, m, Style$1.TEXT), E; +}, makeGlyphSpan = function(e, r, o) { + var m; + r === "Size1-Regular" ? m = "delim-size1" : m = "delim-size4"; + var _ = buildCommon.makeSpan(["delimsizinginner", m], [buildCommon.makeSpan([], [buildCommon.makeSymbol(e, r, o)])]); + return { + type: "elem", + elem: _ + }; +}, makeInner = function(e, r, o) { + var m = fontMetricsData["Size4-Regular"][e.charCodeAt(0)] ? fontMetricsData["Size4-Regular"][e.charCodeAt(0)][4] : fontMetricsData["Size1-Regular"][e.charCodeAt(0)][4], _ = new PathNode("inner", innerPath(e, Math.round(1e3 * r))), g = new SvgNode([_], { + width: makeEm(m), + height: makeEm(r), + // Override CSS rule `.katex svg { width: 100% }` + style: "width:" + makeEm(m), + viewBox: "0 0 " + 1e3 * m + " " + Math.round(1e3 * r), + preserveAspectRatio: "xMinYMin" + }), y = buildCommon.makeSvgSpan([], [g], o); + return y.height = r, y.style.height = makeEm(r), y.style.width = makeEm(m), { + type: "elem", + elem: y + }; +}, lapInEms = 8e-3, lap = { + type: "kern", + size: -1 * lapInEms +}, verts = ["|", "\\lvert", "\\rvert", "\\vert"], doubleVerts = ["\\|", "\\lVert", "\\rVert", "\\Vert"], makeStackedDelim = function(e, r, o, m, _, g) { + var y, E, x, v, h = "", a = 0; + y = x = v = e, E = null; + var b = "Size1-Regular"; + e === "\\uparrow" ? x = v = "⏐" : e === "\\Uparrow" ? x = v = "‖" : e === "\\downarrow" ? y = x = "⏐" : e === "\\Downarrow" ? y = x = "‖" : e === "\\updownarrow" ? (y = "\\uparrow", x = "⏐", v = "\\downarrow") : e === "\\Updownarrow" ? (y = "\\Uparrow", x = "‖", v = "\\Downarrow") : utils.contains(verts, e) ? (x = "∣", h = "vert", a = 333) : utils.contains(doubleVerts, e) ? (x = "∥", h = "doublevert", a = 556) : e === "[" || e === "\\lbrack" ? (y = "⎡", x = "⎢", v = "⎣", b = "Size4-Regular", h = "lbrack", a = 667) : e === "]" || e === "\\rbrack" ? (y = "⎤", x = "⎥", v = "⎦", b = "Size4-Regular", h = "rbrack", a = 667) : e === "\\lfloor" || e === "⌊" ? (x = y = "⎢", v = "⎣", b = "Size4-Regular", h = "lfloor", a = 667) : e === "\\lceil" || e === "⌈" ? (y = "⎡", x = v = "⎢", b = "Size4-Regular", h = "lceil", a = 667) : e === "\\rfloor" || e === "⌋" ? (x = y = "⎥", v = "⎦", b = "Size4-Regular", h = "rfloor", a = 667) : e === "\\rceil" || e === "⌉" ? (y = "⎤", x = v = "⎥", b = "Size4-Regular", h = "rceil", a = 667) : e === "(" || e === "\\lparen" ? (y = "⎛", x = "⎜", v = "⎝", b = "Size4-Regular", h = "lparen", a = 875) : e === ")" || e === "\\rparen" ? (y = "⎞", x = "⎟", v = "⎠", b = "Size4-Regular", h = "rparen", a = 875) : e === "\\{" || e === "\\lbrace" ? (y = "⎧", E = "⎨", v = "⎩", x = "⎪", b = "Size4-Regular") : e === "\\}" || e === "\\rbrace" ? (y = "⎫", E = "⎬", v = "⎭", x = "⎪", b = "Size4-Regular") : e === "\\lgroup" || e === "⟮" ? (y = "⎧", v = "⎩", x = "⎪", b = "Size4-Regular") : e === "\\rgroup" || e === "⟯" ? (y = "⎫", v = "⎭", x = "⎪", b = "Size4-Regular") : e === "\\lmoustache" || e === "⎰" ? (y = "⎧", v = "⎭", x = "⎪", b = "Size4-Regular") : (e === "\\rmoustache" || e === "⎱") && (y = "⎫", v = "⎩", x = "⎪", b = "Size4-Regular"); + var w = getMetrics(y, b, _), k = w.height + w.depth, A = getMetrics(x, b, _), M = A.height + A.depth, $ = getMetrics(v, b, _), O = $.height + $.depth, C = 0, P = 1; + if (E !== null) { + var I = getMetrics(E, b, _); + C = I.height + I.depth, P = 2; + } + var N = k + O + C, R = Math.max(0, Math.ceil((r - N) / (P * M))), F = N + R * P * M, B = m.fontMetrics().axisHeight; + o && (B *= m.sizeMultiplier); + var G = F / 2 - B, Q = []; + if (h.length > 0) { + var ee = F - k - O, Y = Math.round(F * 1e3), W = tallDelim(h, Math.round(ee * 1e3)), j = new PathNode(h, W), J = (a / 1e3).toFixed(3) + "em", me = (Y / 1e3).toFixed(3) + "em", pe = new SvgNode([j], { + width: J, + height: me, + viewBox: "0 0 " + a + " " + Y + }), ye = buildCommon.makeSvgSpan([], [pe], m); + ye.height = Y / 1e3, ye.style.width = J, ye.style.height = me, Q.push({ + type: "elem", + elem: ye + }); + } else { + if (Q.push(makeGlyphSpan(v, b, _)), Q.push(lap), E === null) { + var oe = F - k - O + 2 * lapInEms; + Q.push(makeInner(x, oe, m)); + } else { + var we = (F - k - O - C) / 2 + 2 * lapInEms; + Q.push(makeInner(x, we, m)), Q.push(lap), Q.push(makeGlyphSpan(E, b, _)), Q.push(lap), Q.push(makeInner(x, we, m)); + } + Q.push(lap), Q.push(makeGlyphSpan(y, b, _)); + } + var Se = m.havingBaseStyle(Style$1.TEXT), Me = buildCommon.makeVList({ + positionType: "bottom", + positionData: G, + children: Q + }, Se); + return styleWrap(buildCommon.makeSpan(["delimsizing", "mult"], [Me], Se), Style$1.TEXT, m, g); +}, vbPad = 80, emPad = 0.08, sqrtSvg = function(e, r, o, m, _) { + var g = sqrtPath(e, m, o), y = new PathNode(e, g), E = new SvgNode([y], { + // Note: 1000:1 ratio of viewBox to document em width. + width: "400em", + height: makeEm(r), + viewBox: "0 0 400000 " + o, + preserveAspectRatio: "xMinYMin slice" + }); + return buildCommon.makeSvgSpan(["hide-tail"], [E], _); +}, makeSqrtImage = function(e, r) { + var o = r.havingBaseSizing(), m = traverseSequence("\\surd", e * o.sizeMultiplier, stackLargeDelimiterSequence, o), _ = o.sizeMultiplier, g = Math.max(0, r.minRuleThickness - r.fontMetrics().sqrtRuleThickness), y, E = 0, x = 0, v = 0, h; + return m.type === "small" ? (v = 1e3 + 1e3 * g + vbPad, e < 1 ? _ = 1 : e < 1.4 && (_ = 0.7), E = (1 + g + emPad) / _, x = (1 + g) / _, y = sqrtSvg("sqrtMain", E, v, g, r), y.style.minWidth = "0.853em", h = 0.833 / _) : m.type === "large" ? (v = (1e3 + vbPad) * sizeToMaxHeight[m.size], x = (sizeToMaxHeight[m.size] + g) / _, E = (sizeToMaxHeight[m.size] + g + emPad) / _, y = sqrtSvg("sqrtSize" + m.size, E, v, g, r), y.style.minWidth = "1.02em", h = 1 / _) : (E = e + g + emPad, x = e + g, v = Math.floor(1e3 * e + g) + vbPad, y = sqrtSvg("sqrtTall", E, v, g, r), y.style.minWidth = "0.742em", h = 1.056), y.height = x, y.style.height = makeEm(E), { + span: y, + advanceWidth: h, + // Calculate the actual line width. + // This actually should depend on the chosen font -- e.g. \boldmath + // should use the thicker surd symbols from e.g. KaTeX_Main-Bold, and + // have thicker rules. + ruleWidth: (r.fontMetrics().sqrtRuleThickness + g) * _ + }; +}, stackLargeDelimiters = ["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "⌊", "⌋", "\\lceil", "\\rceil", "⌈", "⌉", "\\surd"], stackAlwaysDelimiters = ["\\uparrow", "\\downarrow", "\\updownarrow", "\\Uparrow", "\\Downarrow", "\\Updownarrow", "|", "\\|", "\\vert", "\\Vert", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "⟮", "⟯", "\\lmoustache", "\\rmoustache", "⎰", "⎱"], stackNeverDelimiters = ["<", ">", "\\langle", "\\rangle", "/", "\\backslash", "\\lt", "\\gt"], sizeToMaxHeight = [0, 1.2, 1.8, 2.4, 3], makeSizedDelim = function(e, r, o, m, _) { + if (e === "<" || e === "\\lt" || e === "⟨" ? e = "\\langle" : (e === ">" || e === "\\gt" || e === "⟩") && (e = "\\rangle"), utils.contains(stackLargeDelimiters, e) || utils.contains(stackNeverDelimiters, e)) + return makeLargeDelim(e, r, !1, o, m, _); + if (utils.contains(stackAlwaysDelimiters, e)) + return makeStackedDelim(e, sizeToMaxHeight[r], !1, o, m, _); + throw new ParseError("Illegal delimiter: '" + e + "'"); +}, stackNeverDelimiterSequence = [{ + type: "small", + style: Style$1.SCRIPTSCRIPT +}, { + type: "small", + style: Style$1.SCRIPT +}, { + type: "small", + style: Style$1.TEXT +}, { + type: "large", + size: 1 +}, { + type: "large", + size: 2 +}, { + type: "large", + size: 3 +}, { + type: "large", + size: 4 +}], stackAlwaysDelimiterSequence = [{ + type: "small", + style: Style$1.SCRIPTSCRIPT +}, { + type: "small", + style: Style$1.SCRIPT +}, { + type: "small", + style: Style$1.TEXT +}, { + type: "stack" +}], stackLargeDelimiterSequence = [{ + type: "small", + style: Style$1.SCRIPTSCRIPT +}, { + type: "small", + style: Style$1.SCRIPT +}, { + type: "small", + style: Style$1.TEXT +}, { + type: "large", + size: 1 +}, { + type: "large", + size: 2 +}, { + type: "large", + size: 3 +}, { + type: "large", + size: 4 +}, { + type: "stack" +}], delimTypeToFont = 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."); +}, traverseSequence = function(e, r, o, m) { + for (var _ = Math.min(2, 3 - m.style.size), g = _; g < o.length && o[g].type !== "stack"; g++) { + var y = getMetrics(e, delimTypeToFont(o[g]), "math"), E = y.height + y.depth; + if (o[g].type === "small") { + var x = m.havingBaseStyle(o[g].style); + E *= x.sizeMultiplier; + } + if (E > r) + return o[g]; + } + return o[o.length - 1]; +}, makeCustomSizedDelim = function(e, r, o, m, _, g) { + e === "<" || e === "\\lt" || e === "⟨" ? e = "\\langle" : (e === ">" || e === "\\gt" || e === "⟩") && (e = "\\rangle"); + var y; + utils.contains(stackNeverDelimiters, e) ? y = stackNeverDelimiterSequence : utils.contains(stackLargeDelimiters, e) ? y = stackLargeDelimiterSequence : y = stackAlwaysDelimiterSequence; + var E = traverseSequence(e, r, y, m); + return E.type === "small" ? makeSmallDelim(e, E.style, o, m, _, g) : E.type === "large" ? makeLargeDelim(e, E.size, o, m, _, g) : makeStackedDelim(e, r, o, m, _, g); +}, makeLeftRightDelim = function(e, r, o, m, _, g) { + var y = m.fontMetrics().axisHeight * m.sizeMultiplier, E = 901, x = 5 / m.fontMetrics().ptPerEm, v = Math.max(r - y, o + y), h = Math.max( + // In real TeX, calculations are done using integral values which are + // 65536 per pt, or 655360 per em. So, the division here truncates in + // TeX but doesn't here, producing different results. If we wanted to + // exactly match TeX's calculation, we could do + // Math.floor(655360 * maxDistFromAxis / 500) * + // delimiterFactor / 655360 + // (To see the difference, compare + // x^{x^{\left(\rule{0.1em}{0.68em}\right)}} + // in TeX and KaTeX) + v / 500 * E, + 2 * v - x + ); + return makeCustomSizedDelim(e, h, !0, m, _, g); +}, delimiter = { + sqrtImage: makeSqrtImage, + sizedDelim: makeSizedDelim, + sizeToMaxHeight, + customSizedDelim: makeCustomSizedDelim, + leftRightDelim: makeLeftRightDelim +}, delimiterSizes = { + "\\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 + } +}, delimiters = ["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "⌊", "⌋", "\\lceil", "\\rceil", "⌈", "⌉", "<", ">", "\\langle", "⟨", "\\rangle", "⟩", "\\lt", "\\gt", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "⟮", "⟯", "\\lmoustache", "\\rmoustache", "⎰", "⎱", "/", "\\backslash", "|", "\\vert", "\\|", "\\Vert", "\\uparrow", "\\Uparrow", "\\downarrow", "\\Downarrow", "\\updownarrow", "\\Updownarrow", "."]; +function checkDelimiter(s, e) { + var r = checkSymbolNodeType(s); + if (r && utils.contains(delimiters, r.text)) + return r; + throw r ? new ParseError("Invalid delimiter '" + r.text + "' after '" + e.funcName + "'", s) : new ParseError("Invalid delimiter type '" + s.type + "'", s); +} +defineFunction({ + 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: (s, e) => { + var r = checkDelimiter(e[0], s); + return { + type: "delimsizing", + mode: s.parser.mode, + size: delimiterSizes[s.funcName].size, + mclass: delimiterSizes[s.funcName].mclass, + delim: r.text + }; + }, + htmlBuilder: (s, e) => s.delim === "." ? buildCommon.makeSpan([s.mclass]) : delimiter.sizedDelim(s.delim, s.size, e, s.mode, [s.mclass]), + mathmlBuilder: (s) => { + var e = []; + s.delim !== "." && e.push(makeText(s.delim, s.mode)); + var r = new mathMLTree.MathNode("mo", e); + s.mclass === "mopen" || s.mclass === "mclose" ? r.setAttribute("fence", "true") : r.setAttribute("fence", "false"), r.setAttribute("stretchy", "true"); + var o = makeEm(delimiter.sizeToMaxHeight[s.size]); + return r.setAttribute("minsize", o), r.setAttribute("maxsize", o), r; + } +}); +function assertParsed(s) { + if (!s.body) + throw new Error("Bug: The leftright ParseNode wasn't fully parsed."); +} +defineFunction({ + type: "leftright-right", + names: ["\\right"], + props: { + numArgs: 1, + primitive: !0 + }, + handler: (s, e) => { + var r = s.parser.gullet.macros.get("\\current@color"); + if (r && typeof r != "string") + throw new ParseError("\\current@color set to non-string in \\right"); + return { + type: "leftright-right", + mode: s.parser.mode, + delim: checkDelimiter(e[0], s).text, + color: r + // undefined if not set via \color + }; + } +}); +defineFunction({ + type: "leftright", + names: ["\\left"], + props: { + numArgs: 1, + primitive: !0 + }, + handler: (s, e) => { + var r = checkDelimiter(e[0], s), o = s.parser; + ++o.leftrightDepth; + var m = o.parseExpression(!1); + --o.leftrightDepth, o.expect("\\right", !1); + var _ = assertNodeType(o.parseFunction(), "leftright-right"); + return { + type: "leftright", + mode: o.mode, + body: m, + left: r.text, + right: _.delim, + rightColor: _.color + }; + }, + htmlBuilder: (s, e) => { + assertParsed(s); + for (var r = buildExpression$1(s.body, e, !0, ["mopen", "mclose"]), o = 0, m = 0, _ = !1, g = 0; g < r.length; g++) + r[g].isMiddle ? _ = !0 : (o = Math.max(r[g].height, o), m = Math.max(r[g].depth, m)); + o *= e.sizeMultiplier, m *= e.sizeMultiplier; + var y; + if (s.left === "." ? y = makeNullDelimiter(e, ["mopen"]) : y = delimiter.leftRightDelim(s.left, o, m, e, s.mode, ["mopen"]), r.unshift(y), _) + for (var E = 1; E < r.length; E++) { + var x = r[E], v = x.isMiddle; + v && (r[E] = delimiter.leftRightDelim(v.delim, o, m, v.options, s.mode, [])); + } + var h; + if (s.right === ".") + h = makeNullDelimiter(e, ["mclose"]); + else { + var a = s.rightColor ? e.withColor(s.rightColor) : e; + h = delimiter.leftRightDelim(s.right, o, m, a, s.mode, ["mclose"]); + } + return r.push(h), buildCommon.makeSpan(["minner"], r, e); + }, + mathmlBuilder: (s, e) => { + assertParsed(s); + var r = buildExpression(s.body, e); + if (s.left !== ".") { + var o = new mathMLTree.MathNode("mo", [makeText(s.left, s.mode)]); + o.setAttribute("fence", "true"), r.unshift(o); + } + if (s.right !== ".") { + var m = new mathMLTree.MathNode("mo", [makeText(s.right, s.mode)]); + m.setAttribute("fence", "true"), s.rightColor && m.setAttribute("mathcolor", s.rightColor), r.push(m); + } + return makeRow(r); + } +}); +defineFunction({ + type: "middle", + names: ["\\middle"], + props: { + numArgs: 1, + primitive: !0 + }, + handler: (s, e) => { + var r = checkDelimiter(e[0], s); + if (!s.parser.leftrightDepth) + throw new ParseError("\\middle without preceding \\left", r); + return { + type: "middle", + mode: s.parser.mode, + delim: r.text + }; + }, + htmlBuilder: (s, e) => { + var r; + if (s.delim === ".") + r = makeNullDelimiter(e, []); + else { + r = delimiter.sizedDelim(s.delim, 1, e, s.mode, []); + var o = { + delim: s.delim, + options: e + }; + r.isMiddle = o; + } + return r; + }, + mathmlBuilder: (s, e) => { + var r = s.delim === "\\vert" || s.delim === "|" ? makeText("|", "text") : makeText(s.delim, s.mode), o = new mathMLTree.MathNode("mo", [r]); + return o.setAttribute("fence", "true"), o.setAttribute("lspace", "0.05em"), o.setAttribute("rspace", "0.05em"), o; + } +}); +var htmlBuilder$7 = (s, e) => { + var r = buildCommon.wrapFragment(buildGroup$1(s.body, e), e), o = s.label.slice(1), m = e.sizeMultiplier, _, g = 0, y = utils.isCharacterBox(s.body); + if (o === "sout") + _ = buildCommon.makeSpan(["stretchy", "sout"]), _.height = e.fontMetrics().defaultRuleThickness / m, g = -0.5 * e.fontMetrics().xHeight; + else if (o === "phase") { + var E = calculateSize$1({ + number: 0.6, + unit: "pt" + }, e), x = calculateSize$1({ + number: 0.35, + unit: "ex" + }, e), v = e.havingBaseSizing(); + m = m / v.sizeMultiplier; + var h = r.height + r.depth + E + x; + r.style.paddingLeft = makeEm(h / 2 + E); + var a = Math.floor(1e3 * h * m), b = phasePath(a), w = new SvgNode([new PathNode("phase", b)], { + width: "400em", + height: makeEm(a / 1e3), + viewBox: "0 0 400000 " + a, + preserveAspectRatio: "xMinYMin slice" + }); + _ = buildCommon.makeSvgSpan(["hide-tail"], [w], e), _.style.height = makeEm(h), g = r.depth + E + x; + } else { + /cancel/.test(o) ? y || r.classes.push("cancel-pad") : o === "angl" ? r.classes.push("anglpad") : r.classes.push("boxpad"); + var k = 0, A = 0, M = 0; + /box/.test(o) ? (M = Math.max( + e.fontMetrics().fboxrule, + // default + e.minRuleThickness + // User override. + ), k = e.fontMetrics().fboxsep + (o === "colorbox" ? 0 : M), A = k) : o === "angl" ? (M = Math.max(e.fontMetrics().defaultRuleThickness, e.minRuleThickness), k = 4 * M, A = Math.max(0, 0.25 - r.depth)) : (k = y ? 0.2 : 0, A = k), _ = stretchy.encloseSpan(r, o, k, A, e), /fbox|boxed|fcolorbox/.test(o) ? (_.style.borderStyle = "solid", _.style.borderWidth = makeEm(M)) : o === "angl" && M !== 0.049 && (_.style.borderTopWidth = makeEm(M), _.style.borderRightWidth = makeEm(M)), g = r.depth + A, s.backgroundColor && (_.style.backgroundColor = s.backgroundColor, s.borderColor && (_.style.borderColor = s.borderColor)); + } + var $; + if (s.backgroundColor) + $ = buildCommon.makeVList({ + positionType: "individualShift", + children: [ + // Put the color background behind inner; + { + type: "elem", + elem: _, + shift: g + }, + { + type: "elem", + elem: r, + shift: 0 + } + ] + }, e); + else { + var O = /cancel|phase/.test(o) ? ["svg-align"] : []; + $ = buildCommon.makeVList({ + positionType: "individualShift", + children: [ + // Write the \cancel stroke on top of inner. + { + type: "elem", + elem: r, + shift: 0 + }, + { + type: "elem", + elem: _, + shift: g, + wrapperClasses: O + } + ] + }, e); + } + return /cancel/.test(o) && ($.height = r.height, $.depth = r.depth), /cancel/.test(o) && !y ? buildCommon.makeSpan(["mord", "cancel-lap"], [$], e) : buildCommon.makeSpan(["mord"], [$], e); +}, mathmlBuilder$6 = (s, e) => { + var r = 0, o = new mathMLTree.MathNode(s.label.indexOf("colorbox") > -1 ? "mpadded" : "menclose", [buildGroup(s.body, e)]); + switch (s.label) { + case "\\cancel": + o.setAttribute("notation", "updiagonalstrike"); + break; + case "\\bcancel": + o.setAttribute("notation", "downdiagonalstrike"); + break; + case "\\phase": + o.setAttribute("notation", "phasorangle"); + break; + case "\\sout": + o.setAttribute("notation", "horizontalstrike"); + break; + case "\\fbox": + o.setAttribute("notation", "box"); + break; + case "\\angl": + o.setAttribute("notation", "actuarial"); + break; + case "\\fcolorbox": + case "\\colorbox": + if (r = e.fontMetrics().fboxsep * e.fontMetrics().ptPerEm, o.setAttribute("width", "+" + 2 * r + "pt"), o.setAttribute("height", "+" + 2 * r + "pt"), o.setAttribute("lspace", r + "pt"), o.setAttribute("voffset", r + "pt"), s.label === "\\fcolorbox") { + var m = Math.max( + e.fontMetrics().fboxrule, + // default + e.minRuleThickness + // user override + ); + o.setAttribute("style", "border: " + m + "em solid " + String(s.borderColor)); + } + break; + case "\\xcancel": + o.setAttribute("notation", "updiagonalstrike downdiagonalstrike"); + break; + } + return s.backgroundColor && o.setAttribute("mathbackground", s.backgroundColor), o; +}; +defineFunction({ + type: "enclose", + names: ["\\colorbox"], + props: { + numArgs: 2, + allowedInText: !0, + argTypes: ["color", "text"] + }, + handler(s, e, r) { + var { + parser: o, + funcName: m + } = s, _ = assertNodeType(e[0], "color-token").color, g = e[1]; + return { + type: "enclose", + mode: o.mode, + label: m, + backgroundColor: _, + body: g + }; + }, + htmlBuilder: htmlBuilder$7, + mathmlBuilder: mathmlBuilder$6 +}); +defineFunction({ + type: "enclose", + names: ["\\fcolorbox"], + props: { + numArgs: 3, + allowedInText: !0, + argTypes: ["color", "color", "text"] + }, + handler(s, e, r) { + var { + parser: o, + funcName: m + } = s, _ = assertNodeType(e[0], "color-token").color, g = assertNodeType(e[1], "color-token").color, y = e[2]; + return { + type: "enclose", + mode: o.mode, + label: m, + backgroundColor: g, + borderColor: _, + body: y + }; + }, + htmlBuilder: htmlBuilder$7, + mathmlBuilder: mathmlBuilder$6 +}); +defineFunction({ + type: "enclose", + names: ["\\fbox"], + props: { + numArgs: 1, + argTypes: ["hbox"], + allowedInText: !0 + }, + handler(s, e) { + var { + parser: r + } = s; + return { + type: "enclose", + mode: r.mode, + label: "\\fbox", + body: e[0] + }; + } +}); +defineFunction({ + type: "enclose", + names: ["\\cancel", "\\bcancel", "\\xcancel", "\\sout", "\\phase"], + props: { + numArgs: 1 + }, + handler(s, e) { + var { + parser: r, + funcName: o + } = s, m = e[0]; + return { + type: "enclose", + mode: r.mode, + label: o, + body: m + }; + }, + htmlBuilder: htmlBuilder$7, + mathmlBuilder: mathmlBuilder$6 +}); +defineFunction({ + type: "enclose", + names: ["\\angl"], + props: { + numArgs: 1, + argTypes: ["hbox"], + allowedInText: !1 + }, + handler(s, e) { + var { + parser: r + } = s; + return { + type: "enclose", + mode: r.mode, + label: "\\angl", + body: e[0] + }; + } +}); +var _environments = {}; +function defineEnvironment(s) { + for (var { + type: e, + names: r, + props: o, + handler: m, + htmlBuilder: _, + mathmlBuilder: g + } = s, y = { + type: e, + numArgs: o.numArgs || 0, + allowedInText: !1, + numOptionalArgs: 0, + handler: m + }, E = 0; E < r.length; ++E) + _environments[r[E]] = y; + _ && (_htmlGroupBuilders[e] = _), g && (_mathmlGroupBuilders[e] = g); +} +var _macros = {}; +function defineMacro(s, e) { + _macros[s] = e; +} +function getHLines(s) { + var e = []; + s.consumeSpaces(); + var r = s.fetch().text; + for (r === "\\relax" && (s.consume(), s.consumeSpaces(), r = s.fetch().text); r === "\\hline" || r === "\\hdashline"; ) + s.consume(), e.push(r === "\\hdashline"), s.consumeSpaces(), r = s.fetch().text; + return e; +} +var validateAmsEnvironmentContext = (s) => { + var e = s.parser.settings; + if (!e.displayMode) + throw new ParseError("{" + s.envName + "} can be used only in display mode."); +}; +function getAutoTag(s) { + if (s.indexOf("ed") === -1) + return s.indexOf("*") === -1; +} +function parseArray(s, e, r) { + var { + hskipBeforeAndAfter: o, + addJot: m, + cols: _, + arraystretch: g, + colSeparationType: y, + autoTag: E, + singleRow: x, + emptySingleRow: v, + maxNumCols: h, + leqno: a + } = e; + if (s.gullet.beginGroup(), x || s.gullet.macros.set("\\cr", "\\\\\\relax"), !g) { + var b = s.gullet.expandMacroAsText("\\arraystretch"); + if (b == null) + g = 1; + else if (g = parseFloat(b), !g || g < 0) + throw new ParseError("Invalid \\arraystretch: " + b); + } + s.gullet.beginGroup(); + var w = [], k = [w], A = [], M = [], $ = E != null ? [] : void 0; + function O() { + E && s.gullet.macros.set("\\@eqnsw", "1", !0); + } + function C() { + $ && (s.gullet.macros.get("\\df@tag") ? ($.push(s.subparse([new Token$1("\\df@tag")])), s.gullet.macros.set("\\df@tag", void 0, !0)) : $.push(!!E && s.gullet.macros.get("\\@eqnsw") === "1")); + } + for (O(), M.push(getHLines(s)); ; ) { + var P = s.parseExpression(!1, x ? "\\end" : "\\\\"); + s.gullet.endGroup(), s.gullet.beginGroup(), P = { + type: "ordgroup", + mode: s.mode, + body: P + }, r && (P = { + type: "styling", + mode: s.mode, + style: r, + body: [P] + }), w.push(P); + var I = s.fetch().text; + if (I === "&") { + if (h && w.length === h) { + if (x || y) + throw new ParseError("Too many tab characters: &", s.nextToken); + s.settings.reportNonstrict("textEnv", "Too few columns specified in the {array} column argument."); + } + s.consume(); + } else if (I === "\\end") { + C(), w.length === 1 && P.type === "styling" && P.body[0].body.length === 0 && (k.length > 1 || !v) && k.pop(), M.length < k.length + 1 && M.push([]); + break; + } else if (I === "\\\\") { + s.consume(); + var N = void 0; + s.gullet.future().text !== " " && (N = s.parseSizeGroup(!0)), A.push(N ? N.value : null), C(), M.push(getHLines(s)), w = [], k.push(w), O(); + } else + throw new ParseError("Expected & or \\\\ or \\cr or \\end", s.nextToken); + } + return s.gullet.endGroup(), s.gullet.endGroup(), { + type: "array", + mode: s.mode, + addJot: m, + arraystretch: g, + body: k, + cols: _, + rowGaps: A, + hskipBeforeAndAfter: o, + hLinesBeforeRow: M, + colSeparationType: y, + tags: $, + leqno: a + }; +} +function dCellStyle(s) { + return s.slice(0, 1) === "d" ? "display" : "text"; +} +var htmlBuilder$6 = function(e, r) { + var o, m, _ = e.body.length, g = e.hLinesBeforeRow, y = 0, E = new Array(_), x = [], v = Math.max( + // From LaTeX \showthe\arrayrulewidth. Equals 0.04 em. + r.fontMetrics().arrayRuleWidth, + r.minRuleThickness + // User override. + ), h = 1 / r.fontMetrics().ptPerEm, a = 5 * h; + if (e.colSeparationType && e.colSeparationType === "small") { + var b = r.havingStyle(Style$1.SCRIPT).sizeMultiplier; + a = 0.2778 * (b / r.sizeMultiplier); + } + var w = e.colSeparationType === "CD" ? calculateSize$1({ + number: 3, + unit: "ex" + }, r) : 12 * h, k = 3 * h, A = e.arraystretch * w, M = 0.7 * A, $ = 0.3 * A, O = 0; + function C(Ze) { + for (var at = 0; at < Ze.length; ++at) + at > 0 && (O += 0.25), x.push({ + pos: O, + isDashed: Ze[at] + }); + } + for (C(g[0]), o = 0; o < e.body.length; ++o) { + var P = e.body[o], I = M, N = $; + y < P.length && (y = P.length); + var R = new Array(P.length); + for (m = 0; m < P.length; ++m) { + var F = buildGroup$1(P[m], r); + N < F.depth && (N = F.depth), I < F.height && (I = F.height), R[m] = F; + } + var B = e.rowGaps[o], G = 0; + B && (G = calculateSize$1(B, r), G > 0 && (G += $, N < G && (N = G), G = 0)), e.addJot && (N += k), R.height = I, R.depth = N, O += I, R.pos = O, O += N + G, E[o] = R, C(g[o + 1]); + } + var Q = O / 2 + r.fontMetrics().axisHeight, ee = e.cols || [], Y = [], W, j, J = []; + if (e.tags && e.tags.some((Ze) => Ze)) + for (o = 0; o < _; ++o) { + var me = E[o], pe = me.pos - Q, ye = e.tags[o], oe = void 0; + ye === !0 ? oe = buildCommon.makeSpan(["eqn-num"], [], r) : ye === !1 ? oe = buildCommon.makeSpan([], [], r) : oe = buildCommon.makeSpan([], buildExpression$1(ye, r, !0), r), oe.depth = me.depth, oe.height = me.height, J.push({ + type: "elem", + elem: oe, + shift: pe + }); + } + for ( + m = 0, j = 0; + // Continue while either there are more columns or more column + // descriptions, so trailing separators don't get lost. + m < y || j < ee.length; + ++m, ++j + ) { + for (var we = ee[j] || {}, Se = !0; we.type === "separator"; ) { + if (Se || (W = buildCommon.makeSpan(["arraycolsep"], []), W.style.width = makeEm(r.fontMetrics().doubleRuleSep), Y.push(W)), we.separator === "|" || we.separator === ":") { + var Me = we.separator === "|" ? "solid" : "dashed", de = buildCommon.makeSpan(["vertical-separator"], [], r); + de.style.height = makeEm(O), de.style.borderRightWidth = makeEm(v), de.style.borderRightStyle = Me, de.style.margin = "0 " + makeEm(-v / 2); + var Oe = O - Q; + Oe && (de.style.verticalAlign = makeEm(-Oe)), Y.push(de); + } else + throw new ParseError("Invalid separator type: " + we.separator); + j++, we = ee[j] || {}, Se = !1; + } + if (!(m >= y)) { + var $e = void 0; + (m > 0 || e.hskipBeforeAndAfter) && ($e = utils.deflt(we.pregap, a), $e !== 0 && (W = buildCommon.makeSpan(["arraycolsep"], []), W.style.width = makeEm($e), Y.push(W))); + var ge = []; + for (o = 0; o < _; ++o) { + var Ye = E[o], Ie = Ye[m]; + if (Ie) { + var Ge = Ye.pos - Q; + Ie.depth = Ye.depth, Ie.height = Ye.height, ge.push({ + type: "elem", + elem: Ie, + shift: Ge + }); + } + } + ge = buildCommon.makeVList({ + positionType: "individualShift", + children: ge + }, r), ge = buildCommon.makeSpan(["col-align-" + (we.align || "c")], [ge]), Y.push(ge), (m < y - 1 || e.hskipBeforeAndAfter) && ($e = utils.deflt(we.postgap, a), $e !== 0 && (W = buildCommon.makeSpan(["arraycolsep"], []), W.style.width = makeEm($e), Y.push(W))); + } + } + if (E = buildCommon.makeSpan(["mtable"], Y), x.length > 0) { + for (var Ke = buildCommon.makeLineSpan("hline", r, v), Ne = buildCommon.makeLineSpan("hdashline", r, v), Ce = [{ + type: "elem", + elem: E, + shift: 0 + }]; x.length > 0; ) { + var lt = x.pop(), ut = lt.pos - Q; + lt.isDashed ? Ce.push({ + type: "elem", + elem: Ne, + shift: ut + }) : Ce.push({ + type: "elem", + elem: Ke, + shift: ut + }); + } + E = buildCommon.makeVList({ + positionType: "individualShift", + children: Ce + }, r); + } + if (J.length === 0) + return buildCommon.makeSpan(["mord"], [E], r); + var Je = buildCommon.makeVList({ + positionType: "individualShift", + children: J + }, r); + return Je = buildCommon.makeSpan(["tag"], [Je], r), buildCommon.makeFragment([E, Je]); +}, alignMap = { + c: "center ", + l: "left ", + r: "right " +}, mathmlBuilder$5 = function(e, r) { + for (var o = [], m = new mathMLTree.MathNode("mtd", [], ["mtr-glue"]), _ = new mathMLTree.MathNode("mtd", [], ["mml-eqn-num"]), g = 0; g < e.body.length; g++) { + for (var y = e.body[g], E = [], x = 0; x < y.length; x++) + E.push(new mathMLTree.MathNode("mtd", [buildGroup(y[x], r)])); + e.tags && e.tags[g] && (E.unshift(m), E.push(m), e.leqno ? E.unshift(_) : E.push(_)), o.push(new mathMLTree.MathNode("mtr", E)); + } + var v = new mathMLTree.MathNode("mtable", o), h = e.arraystretch === 0.5 ? 0.1 : 0.16 + e.arraystretch - 1 + (e.addJot ? 0.09 : 0); + v.setAttribute("rowspacing", makeEm(h)); + var a = "", b = ""; + if (e.cols && e.cols.length > 0) { + var w = e.cols, k = "", A = !1, M = 0, $ = w.length; + w[0].type === "separator" && (a += "top ", M = 1), w[w.length - 1].type === "separator" && (a += "bottom ", $ -= 1); + for (var O = M; O < $; O++) + w[O].type === "align" ? (b += alignMap[w[O].align], A && (k += "none "), A = !0) : w[O].type === "separator" && A && (k += w[O].separator === "|" ? "solid " : "dashed ", A = !1); + v.setAttribute("columnalign", b.trim()), /[sd]/.test(k) && v.setAttribute("columnlines", k.trim()); + } + if (e.colSeparationType === "align") { + for (var C = e.cols || [], P = "", I = 1; I < C.length; I++) + P += I % 2 ? "0em " : "1em "; + v.setAttribute("columnspacing", P.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 N = "", R = e.hLinesBeforeRow; + a += R[0].length > 0 ? "left " : "", a += R[R.length - 1].length > 0 ? "right " : ""; + for (var F = 1; F < R.length - 1; F++) + N += R[F].length === 0 ? "none " : R[F][0] ? "dashed " : "solid "; + return /[sd]/.test(N) && v.setAttribute("rowlines", N.trim()), a !== "" && (v = new mathMLTree.MathNode("menclose", [v]), v.setAttribute("notation", a.trim())), e.arraystretch && e.arraystretch < 1 && (v = new mathMLTree.MathNode("mstyle", [v]), v.setAttribute("scriptlevel", "1")), v; +}, alignedHandler = function(e, r) { + e.envName.indexOf("ed") === -1 && validateAmsEnvironmentContext(e); + var o = [], m = e.envName.indexOf("at") > -1 ? "alignat" : "align", _ = e.envName === "split", g = parseArray(e.parser, { + cols: o, + addJot: !0, + autoTag: _ ? void 0 : getAutoTag(e.envName), + emptySingleRow: !0, + colSeparationType: m, + maxNumCols: _ ? 2 : void 0, + leqno: e.parser.settings.leqno + }, "display"), y, E = 0, x = { + type: "ordgroup", + mode: e.mode, + body: [] + }; + if (r[0] && r[0].type === "ordgroup") { + for (var v = "", h = 0; h < r[0].body.length; h++) { + var a = assertNodeType(r[0].body[h], "textord"); + v += a.text; + } + y = Number(v), E = y * 2; + } + var b = !E; + g.body.forEach(function(M) { + for (var $ = 1; $ < M.length; $ += 2) { + var O = assertNodeType(M[$], "styling"), C = assertNodeType(O.body[0], "ordgroup"); + C.body.unshift(x); + } + if (b) + E < M.length && (E = M.length); + else { + var P = M.length / 2; + if (y < P) + throw new ParseError("Too many math in a row: " + ("expected " + y + ", but got " + P), M[0]); + } + }); + for (var w = 0; w < E; ++w) { + var k = "r", A = 0; + w % 2 === 1 ? k = "l" : w > 0 && b && (A = 1), o[w] = { + type: "align", + align: k, + pregap: A, + postgap: 0 + }; + } + return g.colSeparationType = b ? "align" : "alignat", g; +}; +defineEnvironment({ + type: "array", + names: ["array", "darray"], + props: { + numArgs: 1 + }, + handler(s, e) { + var r = checkSymbolNodeType(e[0]), o = r ? [e[0]] : assertNodeType(e[0], "ordgroup").body, m = o.map(function(g) { + var y = assertSymbolNodeType(g), E = y.text; + if ("lcr".indexOf(E) !== -1) + return { + type: "align", + align: E + }; + if (E === "|") + return { + type: "separator", + separator: "|" + }; + if (E === ":") + return { + type: "separator", + separator: ":" + }; + throw new ParseError("Unknown column alignment: " + E, g); + }), _ = { + cols: m, + hskipBeforeAndAfter: !0, + // \@preamble in lttab.dtx + maxNumCols: m.length + }; + return parseArray(s.parser, _, dCellStyle(s.envName)); + }, + htmlBuilder: htmlBuilder$6, + mathmlBuilder: mathmlBuilder$5 +}); +defineEnvironment({ + type: "array", + names: ["matrix", "pmatrix", "bmatrix", "Bmatrix", "vmatrix", "Vmatrix", "matrix*", "pmatrix*", "bmatrix*", "Bmatrix*", "vmatrix*", "Vmatrix*"], + props: { + numArgs: 0 + }, + handler(s) { + var e = { + matrix: null, + pmatrix: ["(", ")"], + bmatrix: ["[", "]"], + Bmatrix: ["\\{", "\\}"], + vmatrix: ["|", "|"], + Vmatrix: ["\\Vert", "\\Vert"] + }[s.envName.replace("*", "")], r = "c", o = { + hskipBeforeAndAfter: !1, + cols: [{ + type: "align", + align: r + }] + }; + if (s.envName.charAt(s.envName.length - 1) === "*") { + var m = s.parser; + if (m.consumeSpaces(), m.fetch().text === "[") { + if (m.consume(), m.consumeSpaces(), r = m.fetch().text, "lcr".indexOf(r) === -1) + throw new ParseError("Expected l or c or r", m.nextToken); + m.consume(), m.consumeSpaces(), m.expect("]"), m.consume(), o.cols = [{ + type: "align", + align: r + }]; + } + } + var _ = parseArray(s.parser, o, dCellStyle(s.envName)), g = Math.max(0, ..._.body.map((y) => y.length)); + return _.cols = new Array(g).fill({ + type: "align", + align: r + }), e ? { + type: "leftright", + mode: s.mode, + body: [_], + left: e[0], + right: e[1], + rightColor: void 0 + // \right uninfluenced by \color in array + } : _; + }, + htmlBuilder: htmlBuilder$6, + mathmlBuilder: mathmlBuilder$5 +}); +defineEnvironment({ + type: "array", + names: ["smallmatrix"], + props: { + numArgs: 0 + }, + handler(s) { + var e = { + arraystretch: 0.5 + }, r = parseArray(s.parser, e, "script"); + return r.colSeparationType = "small", r; + }, + htmlBuilder: htmlBuilder$6, + mathmlBuilder: mathmlBuilder$5 +}); +defineEnvironment({ + type: "array", + names: ["subarray"], + props: { + numArgs: 1 + }, + handler(s, e) { + var r = checkSymbolNodeType(e[0]), o = r ? [e[0]] : assertNodeType(e[0], "ordgroup").body, m = o.map(function(g) { + var y = assertSymbolNodeType(g), E = y.text; + if ("lc".indexOf(E) !== -1) + return { + type: "align", + align: E + }; + throw new ParseError("Unknown column alignment: " + E, g); + }); + if (m.length > 1) + throw new ParseError("{subarray} can contain only one column"); + var _ = { + cols: m, + hskipBeforeAndAfter: !1, + arraystretch: 0.5 + }; + if (_ = parseArray(s.parser, _, "script"), _.body.length > 0 && _.body[0].length > 1) + throw new ParseError("{subarray} can contain only one column"); + return _; + }, + htmlBuilder: htmlBuilder$6, + mathmlBuilder: mathmlBuilder$5 +}); +defineEnvironment({ + type: "array", + names: ["cases", "dcases", "rcases", "drcases"], + props: { + numArgs: 0 + }, + handler(s) { + var e = { + arraystretch: 1.2, + cols: [{ + type: "align", + align: "l", + pregap: 0, + // TODO(kevinb) get the current style. + // For now we use the metrics for TEXT style which is what we were + // doing before. Before attempting to get the current style we + // should look at TeX's behavior especially for \over and matrices. + postgap: 1 + /* 1em quad */ + }, { + type: "align", + align: "l", + pregap: 0, + postgap: 0 + }] + }, r = parseArray(s.parser, e, dCellStyle(s.envName)); + return { + type: "leftright", + mode: s.mode, + body: [r], + left: s.envName.indexOf("r") > -1 ? "." : "\\{", + right: s.envName.indexOf("r") > -1 ? "\\}" : ".", + rightColor: void 0 + }; + }, + htmlBuilder: htmlBuilder$6, + mathmlBuilder: mathmlBuilder$5 +}); +defineEnvironment({ + type: "array", + names: ["align", "align*", "aligned", "split"], + props: { + numArgs: 0 + }, + handler: alignedHandler, + htmlBuilder: htmlBuilder$6, + mathmlBuilder: mathmlBuilder$5 +}); +defineEnvironment({ + type: "array", + names: ["gathered", "gather", "gather*"], + props: { + numArgs: 0 + }, + handler(s) { + utils.contains(["gather", "gather*"], s.envName) && validateAmsEnvironmentContext(s); + var e = { + cols: [{ + type: "align", + align: "c" + }], + addJot: !0, + colSeparationType: "gather", + autoTag: getAutoTag(s.envName), + emptySingleRow: !0, + leqno: s.parser.settings.leqno + }; + return parseArray(s.parser, e, "display"); + }, + htmlBuilder: htmlBuilder$6, + mathmlBuilder: mathmlBuilder$5 +}); +defineEnvironment({ + type: "array", + names: ["alignat", "alignat*", "alignedat"], + props: { + numArgs: 1 + }, + handler: alignedHandler, + htmlBuilder: htmlBuilder$6, + mathmlBuilder: mathmlBuilder$5 +}); +defineEnvironment({ + type: "array", + names: ["equation", "equation*"], + props: { + numArgs: 0 + }, + handler(s) { + validateAmsEnvironmentContext(s); + var e = { + autoTag: getAutoTag(s.envName), + emptySingleRow: !0, + singleRow: !0, + maxNumCols: 1, + leqno: s.parser.settings.leqno + }; + return parseArray(s.parser, e, "display"); + }, + htmlBuilder: htmlBuilder$6, + mathmlBuilder: mathmlBuilder$5 +}); +defineEnvironment({ + type: "array", + names: ["CD"], + props: { + numArgs: 0 + }, + handler(s) { + return validateAmsEnvironmentContext(s), parseCD(s.parser); + }, + htmlBuilder: htmlBuilder$6, + mathmlBuilder: mathmlBuilder$5 +}); +defineMacro("\\nonumber", "\\gdef\\@eqnsw{0}"); +defineMacro("\\notag", "\\nonumber"); +defineFunction({ + type: "text", + // Doesn't matter what this is. + names: ["\\hline", "\\hdashline"], + props: { + numArgs: 0, + allowedInText: !0, + allowedInMath: !0 + }, + handler(s, e) { + throw new ParseError(s.funcName + " valid only within array environment"); + } +}); +var environments = _environments; +defineFunction({ + type: "environment", + names: ["\\begin", "\\end"], + props: { + numArgs: 1, + argTypes: ["text"] + }, + handler(s, e) { + var { + parser: r, + funcName: o + } = s, m = e[0]; + if (m.type !== "ordgroup") + throw new ParseError("Invalid environment name", m); + for (var _ = "", g = 0; g < m.body.length; ++g) + _ += assertNodeType(m.body[g], "textord").text; + if (o === "\\begin") { + if (!environments.hasOwnProperty(_)) + throw new ParseError("No such environment: " + _, m); + var y = environments[_], { + args: E, + optArgs: x + } = r.parseArguments("\\begin{" + _ + "}", y), v = { + mode: r.mode, + envName: _, + parser: r + }, h = y.handler(v, E, x); + r.expect("\\end", !1); + var a = r.nextToken, b = assertNodeType(r.parseFunction(), "environment"); + if (b.name !== _) + throw new ParseError("Mismatch: \\begin{" + _ + "} matched by \\end{" + b.name + "}", a); + return h; + } + return { + type: "environment", + mode: r.mode, + name: _, + nameGroup: m + }; + } +}); +var htmlBuilder$5 = (s, e) => { + var r = s.font, o = e.withFont(r); + return buildGroup$1(s.body, o); +}, mathmlBuilder$4 = (s, e) => { + var r = s.font, o = e.withFont(r); + return buildGroup(s.body, o); +}, fontAliases = { + "\\Bbb": "\\mathbb", + "\\bold": "\\mathbf", + "\\frak": "\\mathfrak", + "\\bm": "\\boldsymbol" +}; +defineFunction({ + type: "font", + names: [ + // styles, except \boldsymbol defined below + "\\mathrm", + "\\mathit", + "\\mathbf", + "\\mathnormal", + "\\mathsfit", + // families + "\\mathbb", + "\\mathcal", + "\\mathfrak", + "\\mathscr", + "\\mathsf", + "\\mathtt", + // aliases, except \bm defined below + "\\Bbb", + "\\bold", + "\\frak" + ], + props: { + numArgs: 1, + allowedInArgument: !0 + }, + handler: (s, e) => { + var { + parser: r, + funcName: o + } = s, m = normalizeArgument(e[0]), _ = o; + return _ in fontAliases && (_ = fontAliases[_]), { + type: "font", + mode: r.mode, + font: _.slice(1), + body: m + }; + }, + htmlBuilder: htmlBuilder$5, + mathmlBuilder: mathmlBuilder$4 +}); +defineFunction({ + type: "mclass", + names: ["\\boldsymbol", "\\bm"], + props: { + numArgs: 1 + }, + handler: (s, e) => { + var { + parser: r + } = s, o = e[0], m = utils.isCharacterBox(o); + return { + type: "mclass", + mode: r.mode, + mclass: binrelClass(o), + body: [{ + type: "font", + mode: r.mode, + font: "boldsymbol", + body: o + }], + isCharacterBox: m + }; + } +}); +defineFunction({ + type: "font", + names: ["\\rm", "\\sf", "\\tt", "\\bf", "\\it", "\\cal"], + props: { + numArgs: 0, + allowedInText: !0 + }, + handler: (s, e) => { + var { + parser: r, + funcName: o, + breakOnTokenText: m + } = s, { + mode: _ + } = r, g = r.parseExpression(!0, m), y = "math" + o.slice(1); + return { + type: "font", + mode: _, + font: y, + body: { + type: "ordgroup", + mode: r.mode, + body: g + } + }; + }, + htmlBuilder: htmlBuilder$5, + mathmlBuilder: mathmlBuilder$4 +}); +var adjustStyle = (s, e) => { + var r = e; + return s === "display" ? r = r.id >= Style$1.SCRIPT.id ? r.text() : Style$1.DISPLAY : s === "text" && r.size === Style$1.DISPLAY.size ? r = Style$1.TEXT : s === "script" ? r = Style$1.SCRIPT : s === "scriptscript" && (r = Style$1.SCRIPTSCRIPT), r; +}, htmlBuilder$4 = (s, e) => { + var r = adjustStyle(s.size, e.style), o = r.fracNum(), m = r.fracDen(), _; + _ = e.havingStyle(o); + var g = buildGroup$1(s.numer, _, e); + if (s.continued) { + var y = 8.5 / e.fontMetrics().ptPerEm, E = 3.5 / e.fontMetrics().ptPerEm; + g.height = g.height < y ? y : g.height, g.depth = g.depth < E ? E : g.depth; + } + _ = e.havingStyle(m); + var x = buildGroup$1(s.denom, _, e), v, h, a; + s.hasBarLine ? (s.barSize ? (h = calculateSize$1(s.barSize, e), v = buildCommon.makeLineSpan("frac-line", e, h)) : v = buildCommon.makeLineSpan("frac-line", e), h = v.height, a = v.height) : (v = null, h = 0, a = e.fontMetrics().defaultRuleThickness); + var b, w, k; + r.size === Style$1.DISPLAY.size || s.size === "display" ? (b = e.fontMetrics().num1, h > 0 ? w = 3 * a : w = 7 * a, k = e.fontMetrics().denom1) : (h > 0 ? (b = e.fontMetrics().num2, w = a) : (b = e.fontMetrics().num3, w = 3 * a), k = e.fontMetrics().denom2); + var A; + if (v) { + var $ = e.fontMetrics().axisHeight; + b - g.depth - ($ + 0.5 * h) < w && (b += w - (b - g.depth - ($ + 0.5 * h))), $ - 0.5 * h - (x.height - k) < w && (k += w - ($ - 0.5 * h - (x.height - k))); + var O = -($ - 0.5 * h); + A = buildCommon.makeVList({ + positionType: "individualShift", + children: [{ + type: "elem", + elem: x, + shift: k + }, { + type: "elem", + elem: v, + shift: O + }, { + type: "elem", + elem: g, + shift: -b + }] + }, e); + } else { + var M = b - g.depth - (x.height - k); + M < w && (b += 0.5 * (w - M), k += 0.5 * (w - M)), A = buildCommon.makeVList({ + positionType: "individualShift", + children: [{ + type: "elem", + elem: x, + shift: k + }, { + type: "elem", + elem: g, + shift: -b + }] + }, e); + } + _ = e.havingStyle(r), A.height *= _.sizeMultiplier / e.sizeMultiplier, A.depth *= _.sizeMultiplier / e.sizeMultiplier; + var C; + r.size === Style$1.DISPLAY.size ? C = e.fontMetrics().delim1 : r.size === Style$1.SCRIPTSCRIPT.size ? C = e.havingStyle(Style$1.SCRIPT).fontMetrics().delim2 : C = e.fontMetrics().delim2; + var P, I; + return s.leftDelim == null ? P = makeNullDelimiter(e, ["mopen"]) : P = delimiter.customSizedDelim(s.leftDelim, C, !0, e.havingStyle(r), s.mode, ["mopen"]), s.continued ? I = buildCommon.makeSpan([]) : s.rightDelim == null ? I = makeNullDelimiter(e, ["mclose"]) : I = delimiter.customSizedDelim(s.rightDelim, C, !0, e.havingStyle(r), s.mode, ["mclose"]), buildCommon.makeSpan(["mord"].concat(_.sizingClasses(e)), [P, buildCommon.makeSpan(["mfrac"], [A]), I], e); +}, mathmlBuilder$3 = (s, e) => { + var r = new mathMLTree.MathNode("mfrac", [buildGroup(s.numer, e), buildGroup(s.denom, e)]); + if (!s.hasBarLine) + r.setAttribute("linethickness", "0px"); + else if (s.barSize) { + var o = calculateSize$1(s.barSize, e); + r.setAttribute("linethickness", makeEm(o)); + } + var m = adjustStyle(s.size, e.style); + if (m.size !== e.style.size) { + r = new mathMLTree.MathNode("mstyle", [r]); + var _ = m.size === Style$1.DISPLAY.size ? "true" : "false"; + r.setAttribute("displaystyle", _), r.setAttribute("scriptlevel", "0"); + } + if (s.leftDelim != null || s.rightDelim != null) { + var g = []; + if (s.leftDelim != null) { + var y = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(s.leftDelim.replace("\\", ""))]); + y.setAttribute("fence", "true"), g.push(y); + } + if (g.push(r), s.rightDelim != null) { + var E = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(s.rightDelim.replace("\\", ""))]); + E.setAttribute("fence", "true"), g.push(E); + } + return makeRow(g); + } + return r; +}; +defineFunction({ + type: "genfrac", + names: [ + "\\dfrac", + "\\frac", + "\\tfrac", + "\\dbinom", + "\\binom", + "\\tbinom", + "\\\\atopfrac", + // can’t be entered directly + "\\\\bracefrac", + "\\\\brackfrac" + // ditto + ], + props: { + numArgs: 2, + allowedInArgument: !0 + }, + handler: (s, e) => { + var { + parser: r, + funcName: o + } = s, m = e[0], _ = e[1], g, y = null, E = null, x = "auto"; + switch (o) { + case "\\dfrac": + case "\\frac": + case "\\tfrac": + g = !0; + break; + case "\\\\atopfrac": + g = !1; + break; + case "\\dbinom": + case "\\binom": + case "\\tbinom": + g = !1, y = "(", E = ")"; + break; + case "\\\\bracefrac": + g = !1, y = "\\{", E = "\\}"; + break; + case "\\\\brackfrac": + g = !1, y = "[", E = "]"; + break; + default: + throw new Error("Unrecognized genfrac command"); + } + switch (o) { + case "\\dfrac": + case "\\dbinom": + x = "display"; + break; + case "\\tfrac": + case "\\tbinom": + x = "text"; + break; + } + return { + type: "genfrac", + mode: r.mode, + continued: !1, + numer: m, + denom: _, + hasBarLine: g, + leftDelim: y, + rightDelim: E, + size: x, + barSize: null + }; + }, + htmlBuilder: htmlBuilder$4, + mathmlBuilder: mathmlBuilder$3 +}); +defineFunction({ + type: "genfrac", + names: ["\\cfrac"], + props: { + numArgs: 2 + }, + handler: (s, e) => { + var { + parser: r, + funcName: o + } = s, m = e[0], _ = e[1]; + return { + type: "genfrac", + mode: r.mode, + continued: !0, + numer: m, + denom: _, + hasBarLine: !0, + leftDelim: null, + rightDelim: null, + size: "display", + barSize: null + }; + } +}); +defineFunction({ + type: "infix", + names: ["\\over", "\\choose", "\\atop", "\\brace", "\\brack"], + props: { + numArgs: 0, + infix: !0 + }, + handler(s) { + var { + parser: e, + funcName: r, + token: o + } = s, m; + switch (r) { + case "\\over": + m = "\\frac"; + break; + case "\\choose": + m = "\\binom"; + break; + case "\\atop": + m = "\\\\atopfrac"; + break; + case "\\brace": + m = "\\\\bracefrac"; + break; + case "\\brack": + m = "\\\\brackfrac"; + break; + default: + throw new Error("Unrecognized infix genfrac command"); + } + return { + type: "infix", + mode: e.mode, + replaceWith: m, + token: o + }; + } +}); +var stylArray = ["display", "text", "script", "scriptscript"], delimFromValue = function(e) { + var r = null; + return e.length > 0 && (r = e, r = r === "." ? null : r), r; +}; +defineFunction({ + type: "genfrac", + names: ["\\genfrac"], + props: { + numArgs: 6, + allowedInArgument: !0, + argTypes: ["math", "math", "size", "text", "math", "math"] + }, + handler(s, e) { + var { + parser: r + } = s, o = e[4], m = e[5], _ = normalizeArgument(e[0]), g = _.type === "atom" && _.family === "open" ? delimFromValue(_.text) : null, y = normalizeArgument(e[1]), E = y.type === "atom" && y.family === "close" ? delimFromValue(y.text) : null, x = assertNodeType(e[2], "size"), v, h = null; + x.isBlank ? v = !0 : (h = x.value, v = h.number > 0); + var a = "auto", b = e[3]; + if (b.type === "ordgroup") { + if (b.body.length > 0) { + var w = assertNodeType(b.body[0], "textord"); + a = stylArray[Number(w.text)]; + } + } else + b = assertNodeType(b, "textord"), a = stylArray[Number(b.text)]; + return { + type: "genfrac", + mode: r.mode, + numer: o, + denom: m, + continued: !1, + hasBarLine: v, + barSize: h, + leftDelim: g, + rightDelim: E, + size: a + }; + }, + htmlBuilder: htmlBuilder$4, + mathmlBuilder: mathmlBuilder$3 +}); +defineFunction({ + type: "infix", + names: ["\\above"], + props: { + numArgs: 1, + argTypes: ["size"], + infix: !0 + }, + handler(s, e) { + var { + parser: r, + funcName: o, + token: m + } = s; + return { + type: "infix", + mode: r.mode, + replaceWith: "\\\\abovefrac", + size: assertNodeType(e[0], "size").value, + token: m + }; + } +}); +defineFunction({ + type: "genfrac", + names: ["\\\\abovefrac"], + props: { + numArgs: 3, + argTypes: ["math", "size", "math"] + }, + handler: (s, e) => { + var { + parser: r, + funcName: o + } = s, m = e[0], _ = assert(assertNodeType(e[1], "infix").size), g = e[2], y = _.number > 0; + return { + type: "genfrac", + mode: r.mode, + numer: m, + denom: g, + continued: !1, + hasBarLine: y, + barSize: _, + leftDelim: null, + rightDelim: null, + size: "auto" + }; + }, + htmlBuilder: htmlBuilder$4, + mathmlBuilder: mathmlBuilder$3 +}); +var htmlBuilder$3 = (s, e) => { + var r = e.style, o, m; + s.type === "supsub" ? (o = s.sup ? buildGroup$1(s.sup, e.havingStyle(r.sup()), e) : buildGroup$1(s.sub, e.havingStyle(r.sub()), e), m = assertNodeType(s.base, "horizBrace")) : m = assertNodeType(s, "horizBrace"); + var _ = buildGroup$1(m.base, e.havingBaseStyle(Style$1.DISPLAY)), g = stretchy.svgSpan(m, e), y; + if (m.isOver ? (y = buildCommon.makeVList({ + positionType: "firstBaseline", + children: [{ + type: "elem", + elem: _ + }, { + type: "kern", + size: 0.1 + }, { + type: "elem", + elem: g + }] + }, e), y.children[0].children[0].children[1].classes.push("svg-align")) : (y = buildCommon.makeVList({ + positionType: "bottom", + positionData: _.depth + 0.1 + g.height, + children: [{ + type: "elem", + elem: g + }, { + type: "kern", + size: 0.1 + }, { + type: "elem", + elem: _ + }] + }, e), y.children[0].children[0].children[0].classes.push("svg-align")), o) { + var E = buildCommon.makeSpan(["mord", m.isOver ? "mover" : "munder"], [y], e); + m.isOver ? y = buildCommon.makeVList({ + positionType: "firstBaseline", + children: [{ + type: "elem", + elem: E + }, { + type: "kern", + size: 0.2 + }, { + type: "elem", + elem: o + }] + }, e) : y = buildCommon.makeVList({ + positionType: "bottom", + positionData: E.depth + 0.2 + o.height + o.depth, + children: [{ + type: "elem", + elem: o + }, { + type: "kern", + size: 0.2 + }, { + type: "elem", + elem: E + }] + }, e); + } + return buildCommon.makeSpan(["mord", m.isOver ? "mover" : "munder"], [y], e); +}, mathmlBuilder$2 = (s, e) => { + var r = stretchy.mathMLnode(s.label); + return new mathMLTree.MathNode(s.isOver ? "mover" : "munder", [buildGroup(s.base, e), r]); +}; +defineFunction({ + type: "horizBrace", + names: ["\\overbrace", "\\underbrace"], + props: { + numArgs: 1 + }, + handler(s, e) { + var { + parser: r, + funcName: o + } = s; + return { + type: "horizBrace", + mode: r.mode, + label: o, + isOver: /^\\over/.test(o), + base: e[0] + }; + }, + htmlBuilder: htmlBuilder$3, + mathmlBuilder: mathmlBuilder$2 +}); +defineFunction({ + type: "href", + names: ["\\href"], + props: { + numArgs: 2, + argTypes: ["url", "original"], + allowedInText: !0 + }, + handler: (s, e) => { + var { + parser: r + } = s, o = e[1], m = assertNodeType(e[0], "url").url; + return r.settings.isTrusted({ + command: "\\href", + url: m + }) ? { + type: "href", + mode: r.mode, + href: m, + body: ordargument(o) + } : r.formatUnsupportedCmd("\\href"); + }, + htmlBuilder: (s, e) => { + var r = buildExpression$1(s.body, e, !1); + return buildCommon.makeAnchor(s.href, [], r, e); + }, + mathmlBuilder: (s, e) => { + var r = buildExpressionRow(s.body, e); + return r instanceof MathNode || (r = new MathNode("mrow", [r])), r.setAttribute("href", s.href), r; + } +}); +defineFunction({ + type: "href", + names: ["\\url"], + props: { + numArgs: 1, + argTypes: ["url"], + allowedInText: !0 + }, + handler: (s, e) => { + var { + parser: r + } = s, o = assertNodeType(e[0], "url").url; + if (!r.settings.isTrusted({ + command: "\\url", + url: o + })) + return r.formatUnsupportedCmd("\\url"); + for (var m = [], _ = 0; _ < o.length; _++) { + var g = o[_]; + g === "~" && (g = "\\textasciitilde"), m.push({ + type: "textord", + mode: "text", + text: g + }); + } + var y = { + type: "text", + mode: r.mode, + font: "\\texttt", + body: m + }; + return { + type: "href", + mode: r.mode, + href: o, + body: ordargument(y) + }; + } +}); +defineFunction({ + type: "hbox", + names: ["\\hbox"], + props: { + numArgs: 1, + argTypes: ["text"], + allowedInText: !0, + primitive: !0 + }, + handler(s, e) { + var { + parser: r + } = s; + return { + type: "hbox", + mode: r.mode, + body: ordargument(e[0]) + }; + }, + htmlBuilder(s, e) { + var r = buildExpression$1(s.body, e, !1); + return buildCommon.makeFragment(r); + }, + mathmlBuilder(s, e) { + return new mathMLTree.MathNode("mrow", buildExpression(s.body, e)); + } +}); +defineFunction({ + type: "html", + names: ["\\htmlClass", "\\htmlId", "\\htmlStyle", "\\htmlData"], + props: { + numArgs: 2, + argTypes: ["raw", "original"], + allowedInText: !0 + }, + handler: (s, e) => { + var { + parser: r, + funcName: o, + token: m + } = s, _ = assertNodeType(e[0], "raw").string, g = e[1]; + r.settings.strict && r.settings.reportNonstrict("htmlExtension", "HTML extension is disabled on strict mode"); + var y, E = {}; + switch (o) { + case "\\htmlClass": + E.class = _, y = { + command: "\\htmlClass", + class: _ + }; + break; + case "\\htmlId": + E.id = _, y = { + command: "\\htmlId", + id: _ + }; + break; + case "\\htmlStyle": + E.style = _, y = { + command: "\\htmlStyle", + style: _ + }; + break; + case "\\htmlData": { + for (var x = _.split(","), v = 0; v < x.length; v++) { + var h = x[v].split("="); + if (h.length !== 2) + throw new ParseError("Error parsing key-value for \\htmlData"); + E["data-" + h[0].trim()] = h[1].trim(); + } + y = { + command: "\\htmlData", + attributes: E + }; + break; + } + default: + throw new Error("Unrecognized html command"); + } + return r.settings.isTrusted(y) ? { + type: "html", + mode: r.mode, + attributes: E, + body: ordargument(g) + } : r.formatUnsupportedCmd(o); + }, + htmlBuilder: (s, e) => { + var r = buildExpression$1(s.body, e, !1), o = ["enclosing"]; + s.attributes.class && o.push(...s.attributes.class.trim().split(/\s+/)); + var m = buildCommon.makeSpan(o, r, e); + for (var _ in s.attributes) + _ !== "class" && s.attributes.hasOwnProperty(_) && m.setAttribute(_, s.attributes[_]); + return m; + }, + mathmlBuilder: (s, e) => buildExpressionRow(s.body, e) +}); +defineFunction({ + type: "htmlmathml", + names: ["\\html@mathml"], + props: { + numArgs: 2, + allowedInText: !0 + }, + handler: (s, e) => { + var { + parser: r + } = s; + return { + type: "htmlmathml", + mode: r.mode, + html: ordargument(e[0]), + mathml: ordargument(e[1]) + }; + }, + htmlBuilder: (s, e) => { + var r = buildExpression$1(s.html, e, !1); + return buildCommon.makeFragment(r); + }, + mathmlBuilder: (s, e) => buildExpressionRow(s.mathml, e) +}); +var sizeData = function(e) { + if (/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e)) + return { + number: +e, + unit: "bp" + }; + var r = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e); + if (!r) + throw new ParseError("Invalid size: '" + e + "' in \\includegraphics"); + var o = { + number: +(r[1] + r[2]), + // sign + magnitude, cast to number + unit: r[3] + }; + if (!validUnit(o)) + throw new ParseError("Invalid unit: '" + o.unit + "' in \\includegraphics."); + return o; +}; +defineFunction({ + type: "includegraphics", + names: ["\\includegraphics"], + props: { + numArgs: 1, + numOptionalArgs: 1, + argTypes: ["raw", "url"], + allowedInText: !1 + }, + handler: (s, e, r) => { + var { + parser: o + } = s, m = { + number: 0, + unit: "em" + }, _ = { + number: 0.9, + unit: "em" + }, g = { + number: 0, + unit: "em" + }, y = ""; + if (r[0]) + for (var E = assertNodeType(r[0], "raw").string, x = E.split(","), v = 0; v < x.length; v++) { + var h = x[v].split("="); + if (h.length === 2) { + var a = h[1].trim(); + switch (h[0].trim()) { + case "alt": + y = a; + break; + case "width": + m = sizeData(a); + break; + case "height": + _ = sizeData(a); + break; + case "totalheight": + g = sizeData(a); + break; + default: + throw new ParseError("Invalid key: '" + h[0] + "' in \\includegraphics."); + } + } + } + var b = assertNodeType(e[0], "url").url; + return y === "" && (y = b, y = y.replace(/^.*[\\/]/, ""), y = y.substring(0, y.lastIndexOf("."))), o.settings.isTrusted({ + command: "\\includegraphics", + url: b + }) ? { + type: "includegraphics", + mode: o.mode, + alt: y, + width: m, + height: _, + totalheight: g, + src: b + } : o.formatUnsupportedCmd("\\includegraphics"); + }, + htmlBuilder: (s, e) => { + var r = calculateSize$1(s.height, e), o = 0; + s.totalheight.number > 0 && (o = calculateSize$1(s.totalheight, e) - r); + var m = 0; + s.width.number > 0 && (m = calculateSize$1(s.width, e)); + var _ = { + height: makeEm(r + o) + }; + m > 0 && (_.width = makeEm(m)), o > 0 && (_.verticalAlign = makeEm(-o)); + var g = new Img(s.src, s.alt, _); + return g.height = r, g.depth = o, g; + }, + mathmlBuilder: (s, e) => { + var r = new mathMLTree.MathNode("mglyph", []); + r.setAttribute("alt", s.alt); + var o = calculateSize$1(s.height, e), m = 0; + if (s.totalheight.number > 0 && (m = calculateSize$1(s.totalheight, e) - o, r.setAttribute("valign", makeEm(-m))), r.setAttribute("height", makeEm(o + m)), s.width.number > 0) { + var _ = calculateSize$1(s.width, e); + r.setAttribute("width", makeEm(_)); + } + return r.setAttribute("src", s.src), r; + } +}); +defineFunction({ + type: "kern", + names: ["\\kern", "\\mkern", "\\hskip", "\\mskip"], + props: { + numArgs: 1, + argTypes: ["size"], + primitive: !0, + allowedInText: !0 + }, + handler(s, e) { + var { + parser: r, + funcName: o + } = s, m = assertNodeType(e[0], "size"); + if (r.settings.strict) { + var _ = o[1] === "m", g = m.value.unit === "mu"; + _ ? (g || r.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + o + " supports only mu units, " + ("not " + m.value.unit + " units")), r.mode !== "math" && r.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + o + " works only in math mode")) : g && r.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + o + " doesn't support mu units"); + } + return { + type: "kern", + mode: r.mode, + dimension: m.value + }; + }, + htmlBuilder(s, e) { + return buildCommon.makeGlue(s.dimension, e); + }, + mathmlBuilder(s, e) { + var r = calculateSize$1(s.dimension, e); + return new mathMLTree.SpaceNode(r); + } +}); +defineFunction({ + type: "lap", + names: ["\\mathllap", "\\mathrlap", "\\mathclap"], + props: { + numArgs: 1, + allowedInText: !0 + }, + handler: (s, e) => { + var { + parser: r, + funcName: o + } = s, m = e[0]; + return { + type: "lap", + mode: r.mode, + alignment: o.slice(5), + body: m + }; + }, + htmlBuilder: (s, e) => { + var r; + s.alignment === "clap" ? (r = buildCommon.makeSpan([], [buildGroup$1(s.body, e)]), r = buildCommon.makeSpan(["inner"], [r], e)) : r = buildCommon.makeSpan(["inner"], [buildGroup$1(s.body, e)]); + var o = buildCommon.makeSpan(["fix"], []), m = buildCommon.makeSpan([s.alignment], [r, o], e), _ = buildCommon.makeSpan(["strut"]); + return _.style.height = makeEm(m.height + m.depth), m.depth && (_.style.verticalAlign = makeEm(-m.depth)), m.children.unshift(_), m = buildCommon.makeSpan(["thinbox"], [m], e), buildCommon.makeSpan(["mord", "vbox"], [m], e); + }, + mathmlBuilder: (s, e) => { + var r = new mathMLTree.MathNode("mpadded", [buildGroup(s.body, e)]); + if (s.alignment !== "rlap") { + var o = s.alignment === "llap" ? "-1" : "-0.5"; + r.setAttribute("lspace", o + "width"); + } + return r.setAttribute("width", "0px"), r; + } +}); +defineFunction({ + type: "styling", + names: ["\\(", "$"], + props: { + numArgs: 0, + allowedInText: !0, + allowedInMath: !1 + }, + handler(s, e) { + var { + funcName: r, + parser: o + } = s, m = o.mode; + o.switchMode("math"); + var _ = r === "\\(" ? "\\)" : "$", g = o.parseExpression(!1, _); + return o.expect(_), o.switchMode(m), { + type: "styling", + mode: o.mode, + style: "text", + body: g + }; + } +}); +defineFunction({ + type: "text", + // Doesn't matter what this is. + names: ["\\)", "\\]"], + props: { + numArgs: 0, + allowedInText: !0, + allowedInMath: !1 + }, + handler(s, e) { + throw new ParseError("Mismatched " + s.funcName); + } +}); +var chooseMathStyle = (s, e) => { + switch (e.style.size) { + case Style$1.DISPLAY.size: + return s.display; + case Style$1.TEXT.size: + return s.text; + case Style$1.SCRIPT.size: + return s.script; + case Style$1.SCRIPTSCRIPT.size: + return s.scriptscript; + default: + return s.text; + } +}; +defineFunction({ + type: "mathchoice", + names: ["\\mathchoice"], + props: { + numArgs: 4, + primitive: !0 + }, + handler: (s, e) => { + var { + parser: r + } = s; + return { + type: "mathchoice", + mode: r.mode, + display: ordargument(e[0]), + text: ordargument(e[1]), + script: ordargument(e[2]), + scriptscript: ordargument(e[3]) + }; + }, + htmlBuilder: (s, e) => { + var r = chooseMathStyle(s, e), o = buildExpression$1(r, e, !1); + return buildCommon.makeFragment(o); + }, + mathmlBuilder: (s, e) => { + var r = chooseMathStyle(s, e); + return buildExpressionRow(r, e); + } +}); +var assembleSupSub = (s, e, r, o, m, _, g) => { + s = buildCommon.makeSpan([], [s]); + var y = r && utils.isCharacterBox(r), E, x; + if (e) { + var v = buildGroup$1(e, o.havingStyle(m.sup()), o); + x = { + elem: v, + kern: Math.max(o.fontMetrics().bigOpSpacing1, o.fontMetrics().bigOpSpacing3 - v.depth) + }; + } + if (r) { + var h = buildGroup$1(r, o.havingStyle(m.sub()), o); + E = { + elem: h, + kern: Math.max(o.fontMetrics().bigOpSpacing2, o.fontMetrics().bigOpSpacing4 - h.height) + }; + } + var a; + if (x && E) { + var b = o.fontMetrics().bigOpSpacing5 + E.elem.height + E.elem.depth + E.kern + s.depth + g; + a = buildCommon.makeVList({ + positionType: "bottom", + positionData: b, + children: [{ + type: "kern", + size: o.fontMetrics().bigOpSpacing5 + }, { + type: "elem", + elem: E.elem, + marginLeft: makeEm(-_) + }, { + type: "kern", + size: E.kern + }, { + type: "elem", + elem: s + }, { + type: "kern", + size: x.kern + }, { + type: "elem", + elem: x.elem, + marginLeft: makeEm(_) + }, { + type: "kern", + size: o.fontMetrics().bigOpSpacing5 + }] + }, o); + } else if (E) { + var w = s.height - g; + a = buildCommon.makeVList({ + positionType: "top", + positionData: w, + children: [{ + type: "kern", + size: o.fontMetrics().bigOpSpacing5 + }, { + type: "elem", + elem: E.elem, + marginLeft: makeEm(-_) + }, { + type: "kern", + size: E.kern + }, { + type: "elem", + elem: s + }] + }, o); + } else if (x) { + var k = s.depth + g; + a = buildCommon.makeVList({ + positionType: "bottom", + positionData: k, + children: [{ + type: "elem", + elem: s + }, { + type: "kern", + size: x.kern + }, { + type: "elem", + elem: x.elem, + marginLeft: makeEm(_) + }, { + type: "kern", + size: o.fontMetrics().bigOpSpacing5 + }] + }, o); + } else + return s; + var A = [a]; + if (E && _ !== 0 && !y) { + var M = buildCommon.makeSpan(["mspace"], [], o); + M.style.marginRight = makeEm(_), A.unshift(M); + } + return buildCommon.makeSpan(["mop", "op-limits"], A, o); +}, noSuccessor = ["\\smallint"], htmlBuilder$2 = (s, e) => { + var r, o, m = !1, _; + s.type === "supsub" ? (r = s.sup, o = s.sub, _ = assertNodeType(s.base, "op"), m = !0) : _ = assertNodeType(s, "op"); + var g = e.style, y = !1; + g.size === Style$1.DISPLAY.size && _.symbol && !utils.contains(noSuccessor, _.name) && (y = !0); + var E; + if (_.symbol) { + var x = y ? "Size2-Regular" : "Size1-Regular", v = ""; + if ((_.name === "\\oiint" || _.name === "\\oiiint") && (v = _.name.slice(1), _.name = v === "oiint" ? "\\iint" : "\\iiint"), E = buildCommon.makeSymbol(_.name, x, "math", e, ["mop", "op-symbol", y ? "large-op" : "small-op"]), v.length > 0) { + var h = E.italic, a = buildCommon.staticSvg(v + "Size" + (y ? "2" : "1"), e); + E = buildCommon.makeVList({ + positionType: "individualShift", + children: [{ + type: "elem", + elem: E, + shift: 0 + }, { + type: "elem", + elem: a, + shift: y ? 0.08 : 0 + }] + }, e), _.name = "\\" + v, E.classes.unshift("mop"), E.italic = h; + } + } else if (_.body) { + var b = buildExpression$1(_.body, e, !0); + b.length === 1 && b[0] instanceof SymbolNode ? (E = b[0], E.classes[0] = "mop") : E = buildCommon.makeSpan(["mop"], b, e); + } else { + for (var w = [], k = 1; k < _.name.length; k++) + w.push(buildCommon.mathsym(_.name[k], _.mode, e)); + E = buildCommon.makeSpan(["mop"], w, e); + } + var A = 0, M = 0; + return (E instanceof SymbolNode || _.name === "\\oiint" || _.name === "\\oiiint") && !_.suppressBaseShift && (A = (E.height - E.depth) / 2 - e.fontMetrics().axisHeight, M = E.italic), m ? assembleSupSub(E, r, o, e, g, M, A) : (A && (E.style.position = "relative", E.style.top = makeEm(A)), E); +}, mathmlBuilder$1 = (s, e) => { + var r; + if (s.symbol) + r = new MathNode("mo", [makeText(s.name, s.mode)]), utils.contains(noSuccessor, s.name) && r.setAttribute("largeop", "false"); + else if (s.body) + r = new MathNode("mo", buildExpression(s.body, e)); + else { + r = new MathNode("mi", [new TextNode(s.name.slice(1))]); + var o = new MathNode("mo", [makeText("⁡", "text")]); + s.parentIsSupSub ? r = new MathNode("mrow", [r, o]) : r = newDocumentFragment([r, o]); + } + return r; +}, singleCharBigOps = { + "∏": "\\prod", + "∐": "\\coprod", + "∑": "\\sum", + "⋀": "\\bigwedge", + "⋁": "\\bigvee", + "⋂": "\\bigcap", + "⋃": "\\bigcup", + "⨀": "\\bigodot", + "⨁": "\\bigoplus", + "⨂": "\\bigotimes", + "⨄": "\\biguplus", + "⨆": "\\bigsqcup" +}; +defineFunction({ + type: "op", + names: ["\\coprod", "\\bigvee", "\\bigwedge", "\\biguplus", "\\bigcap", "\\bigcup", "\\intop", "\\prod", "\\sum", "\\bigotimes", "\\bigoplus", "\\bigodot", "\\bigsqcup", "\\smallint", "∏", "∐", "∑", "⋀", "⋁", "⋂", "⋃", "⨀", "⨁", "⨂", "⨄", "⨆"], + props: { + numArgs: 0 + }, + handler: (s, e) => { + var { + parser: r, + funcName: o + } = s, m = o; + return m.length === 1 && (m = singleCharBigOps[m]), { + type: "op", + mode: r.mode, + limits: !0, + parentIsSupSub: !1, + symbol: !0, + name: m + }; + }, + htmlBuilder: htmlBuilder$2, + mathmlBuilder: mathmlBuilder$1 +}); +defineFunction({ + type: "op", + names: ["\\mathop"], + props: { + numArgs: 1, + primitive: !0 + }, + handler: (s, e) => { + var { + parser: r + } = s, o = e[0]; + return { + type: "op", + mode: r.mode, + limits: !1, + parentIsSupSub: !1, + symbol: !1, + body: ordargument(o) + }; + }, + htmlBuilder: htmlBuilder$2, + mathmlBuilder: mathmlBuilder$1 +}); +var singleCharIntegrals = { + "∫": "\\int", + "∬": "\\iint", + "∭": "\\iiint", + "∮": "\\oint", + "∯": "\\oiint", + "∰": "\\oiiint" +}; +defineFunction({ + 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(s) { + var { + parser: e, + funcName: r + } = s; + return { + type: "op", + mode: e.mode, + limits: !1, + parentIsSupSub: !1, + symbol: !1, + name: r + }; + }, + htmlBuilder: htmlBuilder$2, + mathmlBuilder: mathmlBuilder$1 +}); +defineFunction({ + type: "op", + names: ["\\det", "\\gcd", "\\inf", "\\lim", "\\max", "\\min", "\\Pr", "\\sup"], + props: { + numArgs: 0 + }, + handler(s) { + var { + parser: e, + funcName: r + } = s; + return { + type: "op", + mode: e.mode, + limits: !0, + parentIsSupSub: !1, + symbol: !1, + name: r + }; + }, + htmlBuilder: htmlBuilder$2, + mathmlBuilder: mathmlBuilder$1 +}); +defineFunction({ + type: "op", + names: ["\\int", "\\iint", "\\iiint", "\\oint", "\\oiint", "\\oiiint", "∫", "∬", "∭", "∮", "∯", "∰"], + props: { + numArgs: 0 + }, + handler(s) { + var { + parser: e, + funcName: r + } = s, o = r; + return o.length === 1 && (o = singleCharIntegrals[o]), { + type: "op", + mode: e.mode, + limits: !1, + parentIsSupSub: !1, + symbol: !0, + name: o + }; + }, + htmlBuilder: htmlBuilder$2, + mathmlBuilder: mathmlBuilder$1 +}); +var htmlBuilder$1 = (s, e) => { + var r, o, m = !1, _; + s.type === "supsub" ? (r = s.sup, o = s.sub, _ = assertNodeType(s.base, "operatorname"), m = !0) : _ = assertNodeType(s, "operatorname"); + var g; + if (_.body.length > 0) { + for (var y = _.body.map((h) => { + var a = h.text; + return typeof a == "string" ? { + type: "textord", + mode: h.mode, + text: a + } : h; + }), E = buildExpression$1(y, e.withFont("mathrm"), !0), x = 0; x < E.length; x++) { + var v = E[x]; + v instanceof SymbolNode && (v.text = v.text.replace(/\u2212/, "-").replace(/\u2217/, "*")); + } + g = buildCommon.makeSpan(["mop"], E, e); + } else + g = buildCommon.makeSpan(["mop"], [], e); + return m ? assembleSupSub(g, r, o, e, e.style, 0, 0) : g; +}, mathmlBuilder = (s, e) => { + for (var r = buildExpression(s.body, e.withFont("mathrm")), o = !0, m = 0; m < r.length; m++) { + var _ = r[m]; + if (!(_ instanceof mathMLTree.SpaceNode)) if (_ instanceof mathMLTree.MathNode) + switch (_.type) { + case "mi": + case "mn": + case "ms": + case "mspace": + case "mtext": + break; + case "mo": { + var g = _.children[0]; + _.children.length === 1 && g instanceof mathMLTree.TextNode ? g.text = g.text.replace(/\u2212/, "-").replace(/\u2217/, "*") : o = !1; + break; + } + default: + o = !1; + } + else + o = !1; + } + if (o) { + var y = r.map((v) => v.toText()).join(""); + r = [new mathMLTree.TextNode(y)]; + } + var E = new mathMLTree.MathNode("mi", r); + E.setAttribute("mathvariant", "normal"); + var x = new mathMLTree.MathNode("mo", [makeText("⁡", "text")]); + return s.parentIsSupSub ? new mathMLTree.MathNode("mrow", [E, x]) : mathMLTree.newDocumentFragment([E, x]); +}; +defineFunction({ + type: "operatorname", + names: ["\\operatorname@", "\\operatornamewithlimits"], + props: { + numArgs: 1 + }, + handler: (s, e) => { + var { + parser: r, + funcName: o + } = s, m = e[0]; + return { + type: "operatorname", + mode: r.mode, + body: ordargument(m), + alwaysHandleSupSub: o === "\\operatornamewithlimits", + limits: !1, + parentIsSupSub: !1 + }; + }, + htmlBuilder: htmlBuilder$1, + mathmlBuilder +}); +defineMacro("\\operatorname", "\\@ifstar\\operatornamewithlimits\\operatorname@"); +defineFunctionBuilders({ + type: "ordgroup", + htmlBuilder(s, e) { + return s.semisimple ? buildCommon.makeFragment(buildExpression$1(s.body, e, !1)) : buildCommon.makeSpan(["mord"], buildExpression$1(s.body, e, !0), e); + }, + mathmlBuilder(s, e) { + return buildExpressionRow(s.body, e, !0); + } +}); +defineFunction({ + type: "overline", + names: ["\\overline"], + props: { + numArgs: 1 + }, + handler(s, e) { + var { + parser: r + } = s, o = e[0]; + return { + type: "overline", + mode: r.mode, + body: o + }; + }, + htmlBuilder(s, e) { + var r = buildGroup$1(s.body, e.havingCrampedStyle()), o = buildCommon.makeLineSpan("overline-line", e), m = e.fontMetrics().defaultRuleThickness, _ = buildCommon.makeVList({ + positionType: "firstBaseline", + children: [{ + type: "elem", + elem: r + }, { + type: "kern", + size: 3 * m + }, { + type: "elem", + elem: o + }, { + type: "kern", + size: m + }] + }, e); + return buildCommon.makeSpan(["mord", "overline"], [_], e); + }, + mathmlBuilder(s, e) { + var r = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode("‾")]); + r.setAttribute("stretchy", "true"); + var o = new mathMLTree.MathNode("mover", [buildGroup(s.body, e), r]); + return o.setAttribute("accent", "true"), o; + } +}); +defineFunction({ + type: "phantom", + names: ["\\phantom"], + props: { + numArgs: 1, + allowedInText: !0 + }, + handler: (s, e) => { + var { + parser: r + } = s, o = e[0]; + return { + type: "phantom", + mode: r.mode, + body: ordargument(o) + }; + }, + htmlBuilder: (s, e) => { + var r = buildExpression$1(s.body, e.withPhantom(), !1); + return buildCommon.makeFragment(r); + }, + mathmlBuilder: (s, e) => { + var r = buildExpression(s.body, e); + return new mathMLTree.MathNode("mphantom", r); + } +}); +defineFunction({ + type: "hphantom", + names: ["\\hphantom"], + props: { + numArgs: 1, + allowedInText: !0 + }, + handler: (s, e) => { + var { + parser: r + } = s, o = e[0]; + return { + type: "hphantom", + mode: r.mode, + body: o + }; + }, + htmlBuilder: (s, e) => { + var r = buildCommon.makeSpan([], [buildGroup$1(s.body, e.withPhantom())]); + if (r.height = 0, r.depth = 0, r.children) + for (var o = 0; o < r.children.length; o++) + r.children[o].height = 0, r.children[o].depth = 0; + return r = buildCommon.makeVList({ + positionType: "firstBaseline", + children: [{ + type: "elem", + elem: r + }] + }, e), buildCommon.makeSpan(["mord"], [r], e); + }, + mathmlBuilder: (s, e) => { + var r = buildExpression(ordargument(s.body), e), o = new mathMLTree.MathNode("mphantom", r), m = new mathMLTree.MathNode("mpadded", [o]); + return m.setAttribute("height", "0px"), m.setAttribute("depth", "0px"), m; + } +}); +defineFunction({ + type: "vphantom", + names: ["\\vphantom"], + props: { + numArgs: 1, + allowedInText: !0 + }, + handler: (s, e) => { + var { + parser: r + } = s, o = e[0]; + return { + type: "vphantom", + mode: r.mode, + body: o + }; + }, + htmlBuilder: (s, e) => { + var r = buildCommon.makeSpan(["inner"], [buildGroup$1(s.body, e.withPhantom())]), o = buildCommon.makeSpan(["fix"], []); + return buildCommon.makeSpan(["mord", "rlap"], [r, o], e); + }, + mathmlBuilder: (s, e) => { + var r = buildExpression(ordargument(s.body), e), o = new mathMLTree.MathNode("mphantom", r), m = new mathMLTree.MathNode("mpadded", [o]); + return m.setAttribute("width", "0px"), m; + } +}); +defineFunction({ + type: "raisebox", + names: ["\\raisebox"], + props: { + numArgs: 2, + argTypes: ["size", "hbox"], + allowedInText: !0 + }, + handler(s, e) { + var { + parser: r + } = s, o = assertNodeType(e[0], "size").value, m = e[1]; + return { + type: "raisebox", + mode: r.mode, + dy: o, + body: m + }; + }, + htmlBuilder(s, e) { + var r = buildGroup$1(s.body, e), o = calculateSize$1(s.dy, e); + return buildCommon.makeVList({ + positionType: "shift", + positionData: -o, + children: [{ + type: "elem", + elem: r + }] + }, e); + }, + mathmlBuilder(s, e) { + var r = new mathMLTree.MathNode("mpadded", [buildGroup(s.body, e)]), o = s.dy.number + s.dy.unit; + return r.setAttribute("voffset", o), r; + } +}); +defineFunction({ + type: "internal", + names: ["\\relax"], + props: { + numArgs: 0, + allowedInText: !0, + allowedInArgument: !0 + }, + handler(s) { + var { + parser: e + } = s; + return { + type: "internal", + mode: e.mode + }; + } +}); +defineFunction({ + type: "rule", + names: ["\\rule"], + props: { + numArgs: 2, + numOptionalArgs: 1, + allowedInText: !0, + allowedInMath: !0, + argTypes: ["size", "size", "size"] + }, + handler(s, e, r) { + var { + parser: o + } = s, m = r[0], _ = assertNodeType(e[0], "size"), g = assertNodeType(e[1], "size"); + return { + type: "rule", + mode: o.mode, + shift: m && assertNodeType(m, "size").value, + width: _.value, + height: g.value + }; + }, + htmlBuilder(s, e) { + var r = buildCommon.makeSpan(["mord", "rule"], [], e), o = calculateSize$1(s.width, e), m = calculateSize$1(s.height, e), _ = s.shift ? calculateSize$1(s.shift, e) : 0; + return r.style.borderRightWidth = makeEm(o), r.style.borderTopWidth = makeEm(m), r.style.bottom = makeEm(_), r.width = o, r.height = m + _, r.depth = -_, r.maxFontSize = m * 1.125 * e.sizeMultiplier, r; + }, + mathmlBuilder(s, e) { + var r = calculateSize$1(s.width, e), o = calculateSize$1(s.height, e), m = s.shift ? calculateSize$1(s.shift, e) : 0, _ = e.color && e.getColor() || "black", g = new mathMLTree.MathNode("mspace"); + g.setAttribute("mathbackground", _), g.setAttribute("width", makeEm(r)), g.setAttribute("height", makeEm(o)); + var y = new mathMLTree.MathNode("mpadded", [g]); + return m >= 0 ? y.setAttribute("height", makeEm(m)) : (y.setAttribute("height", makeEm(m)), y.setAttribute("depth", makeEm(-m))), y.setAttribute("voffset", makeEm(m)), y; + } +}); +function sizingGroup(s, e, r) { + for (var o = buildExpression$1(s, e, !1), m = e.sizeMultiplier / r.sizeMultiplier, _ = 0; _ < o.length; _++) { + var g = o[_].classes.indexOf("sizing"); + g < 0 ? Array.prototype.push.apply(o[_].classes, e.sizingClasses(r)) : o[_].classes[g + 1] === "reset-size" + e.size && (o[_].classes[g + 1] = "reset-size" + r.size), o[_].height *= m, o[_].depth *= m; + } + return buildCommon.makeFragment(o); +} +var sizeFuncs = ["\\tiny", "\\sixptsize", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize", "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge"], htmlBuilder = (s, e) => { + var r = e.havingSize(s.size); + return sizingGroup(s.body, r, e); +}; +defineFunction({ + type: "sizing", + names: sizeFuncs, + props: { + numArgs: 0, + allowedInText: !0 + }, + handler: (s, e) => { + var { + breakOnTokenText: r, + funcName: o, + parser: m + } = s, _ = m.parseExpression(!1, r); + return { + type: "sizing", + mode: m.mode, + // Figure out what size to use based on the list of functions above + size: sizeFuncs.indexOf(o) + 1, + body: _ + }; + }, + htmlBuilder, + mathmlBuilder: (s, e) => { + var r = e.havingSize(s.size), o = buildExpression(s.body, r), m = new mathMLTree.MathNode("mstyle", o); + return m.setAttribute("mathsize", makeEm(r.sizeMultiplier)), m; + } +}); +defineFunction({ + type: "smash", + names: ["\\smash"], + props: { + numArgs: 1, + numOptionalArgs: 1, + allowedInText: !0 + }, + handler: (s, e, r) => { + var { + parser: o + } = s, m = !1, _ = !1, g = r[0] && assertNodeType(r[0], "ordgroup"); + if (g) + for (var y = "", E = 0; E < g.body.length; ++E) { + var x = g.body[E]; + if (y = x.text, y === "t") + m = !0; + else if (y === "b") + _ = !0; + else { + m = !1, _ = !1; + break; + } + } + else + m = !0, _ = !0; + var v = e[0]; + return { + type: "smash", + mode: o.mode, + body: v, + smashHeight: m, + smashDepth: _ + }; + }, + htmlBuilder: (s, e) => { + var r = buildCommon.makeSpan([], [buildGroup$1(s.body, e)]); + if (!s.smashHeight && !s.smashDepth) + return r; + if (s.smashHeight && (r.height = 0, r.children)) + for (var o = 0; o < r.children.length; o++) + r.children[o].height = 0; + if (s.smashDepth && (r.depth = 0, r.children)) + for (var m = 0; m < r.children.length; m++) + r.children[m].depth = 0; + var _ = buildCommon.makeVList({ + positionType: "firstBaseline", + children: [{ + type: "elem", + elem: r + }] + }, e); + return buildCommon.makeSpan(["mord"], [_], e); + }, + mathmlBuilder: (s, e) => { + var r = new mathMLTree.MathNode("mpadded", [buildGroup(s.body, e)]); + return s.smashHeight && r.setAttribute("height", "0px"), s.smashDepth && r.setAttribute("depth", "0px"), r; + } +}); +defineFunction({ + type: "sqrt", + names: ["\\sqrt"], + props: { + numArgs: 1, + numOptionalArgs: 1 + }, + handler(s, e, r) { + var { + parser: o + } = s, m = r[0], _ = e[0]; + return { + type: "sqrt", + mode: o.mode, + body: _, + index: m + }; + }, + htmlBuilder(s, e) { + var r = buildGroup$1(s.body, e.havingCrampedStyle()); + r.height === 0 && (r.height = e.fontMetrics().xHeight), r = buildCommon.wrapFragment(r, e); + var o = e.fontMetrics(), m = o.defaultRuleThickness, _ = m; + e.style.id < Style$1.TEXT.id && (_ = e.fontMetrics().xHeight); + var g = m + _ / 4, y = r.height + r.depth + g + m, { + span: E, + ruleWidth: x, + advanceWidth: v + } = delimiter.sqrtImage(y, e), h = E.height - x; + h > r.height + r.depth + g && (g = (g + h - r.height - r.depth) / 2); + var a = E.height - r.height - g - x; + r.style.paddingLeft = makeEm(v); + var b = buildCommon.makeVList({ + positionType: "firstBaseline", + children: [{ + type: "elem", + elem: r, + wrapperClasses: ["svg-align"] + }, { + type: "kern", + size: -(r.height + a) + }, { + type: "elem", + elem: E + }, { + type: "kern", + size: x + }] + }, e); + if (s.index) { + var w = e.havingStyle(Style$1.SCRIPTSCRIPT), k = buildGroup$1(s.index, w, e), A = 0.6 * (b.height - b.depth), M = buildCommon.makeVList({ + positionType: "shift", + positionData: -A, + children: [{ + type: "elem", + elem: k + }] + }, e), $ = buildCommon.makeSpan(["root"], [M]); + return buildCommon.makeSpan(["mord", "sqrt"], [$, b], e); + } else + return buildCommon.makeSpan(["mord", "sqrt"], [b], e); + }, + mathmlBuilder(s, e) { + var { + body: r, + index: o + } = s; + return o ? new mathMLTree.MathNode("mroot", [buildGroup(r, e), buildGroup(o, e)]) : new mathMLTree.MathNode("msqrt", [buildGroup(r, e)]); + } +}); +var styleMap = { + display: Style$1.DISPLAY, + text: Style$1.TEXT, + script: Style$1.SCRIPT, + scriptscript: Style$1.SCRIPTSCRIPT +}; +defineFunction({ + type: "styling", + names: ["\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle"], + props: { + numArgs: 0, + allowedInText: !0, + primitive: !0 + }, + handler(s, e) { + var { + breakOnTokenText: r, + funcName: o, + parser: m + } = s, _ = m.parseExpression(!0, r), g = o.slice(1, o.length - 5); + return { + type: "styling", + mode: m.mode, + // Figure out what style to use by pulling out the style from + // the function name + style: g, + body: _ + }; + }, + htmlBuilder(s, e) { + var r = styleMap[s.style], o = e.havingStyle(r).withFont(""); + return sizingGroup(s.body, o, e); + }, + mathmlBuilder(s, e) { + var r = styleMap[s.style], o = e.havingStyle(r), m = buildExpression(s.body, o), _ = new mathMLTree.MathNode("mstyle", m), g = { + display: ["0", "true"], + text: ["0", "false"], + script: ["1", "false"], + scriptscript: ["2", "false"] + }, y = g[s.style]; + return _.setAttribute("scriptlevel", y[0]), _.setAttribute("displaystyle", y[1]), _; + } +}); +var htmlBuilderDelegate = function(e, r) { + var o = e.base; + if (o) + if (o.type === "op") { + var m = o.limits && (r.style.size === Style$1.DISPLAY.size || o.alwaysHandleSupSub); + return m ? htmlBuilder$2 : null; + } else if (o.type === "operatorname") { + var _ = o.alwaysHandleSupSub && (r.style.size === Style$1.DISPLAY.size || o.limits); + return _ ? htmlBuilder$1 : null; + } else { + if (o.type === "accent") + return utils.isCharacterBox(o.base) ? htmlBuilder$a : null; + if (o.type === "horizBrace") { + var g = !e.sub; + return g === o.isOver ? htmlBuilder$3 : null; + } else + return null; + } + else return null; +}; +defineFunctionBuilders({ + type: "supsub", + htmlBuilder(s, e) { + var r = htmlBuilderDelegate(s, e); + if (r) + return r(s, e); + var { + base: o, + sup: m, + sub: _ + } = s, g = buildGroup$1(o, e), y, E, x = e.fontMetrics(), v = 0, h = 0, a = o && utils.isCharacterBox(o); + if (m) { + var b = e.havingStyle(e.style.sup()); + y = buildGroup$1(m, b, e), a || (v = g.height - b.fontMetrics().supDrop * b.sizeMultiplier / e.sizeMultiplier); + } + if (_) { + var w = e.havingStyle(e.style.sub()); + E = buildGroup$1(_, w, e), a || (h = g.depth + w.fontMetrics().subDrop * w.sizeMultiplier / e.sizeMultiplier); + } + var k; + e.style === Style$1.DISPLAY ? k = x.sup1 : e.style.cramped ? k = x.sup3 : k = x.sup2; + var A = e.sizeMultiplier, M = makeEm(0.5 / x.ptPerEm / A), $ = null; + if (E) { + var O = s.base && s.base.type === "op" && s.base.name && (s.base.name === "\\oiint" || s.base.name === "\\oiiint"); + (g instanceof SymbolNode || O) && ($ = makeEm(-g.italic)); + } + var C; + if (y && E) { + v = Math.max(v, k, y.depth + 0.25 * x.xHeight), h = Math.max(h, x.sub2); + var P = x.defaultRuleThickness, I = 4 * P; + if (v - y.depth - (E.height - h) < I) { + h = I - (v - y.depth) + E.height; + var N = 0.8 * x.xHeight - (v - y.depth); + N > 0 && (v += N, h -= N); + } + var R = [{ + type: "elem", + elem: E, + shift: h, + marginRight: M, + marginLeft: $ + }, { + type: "elem", + elem: y, + shift: -v, + marginRight: M + }]; + C = buildCommon.makeVList({ + positionType: "individualShift", + children: R + }, e); + } else if (E) { + h = Math.max(h, x.sub1, E.height - 0.8 * x.xHeight); + var F = [{ + type: "elem", + elem: E, + marginLeft: $, + marginRight: M + }]; + C = buildCommon.makeVList({ + positionType: "shift", + positionData: h, + children: F + }, e); + } else if (y) + v = Math.max(v, k, y.depth + 0.25 * x.xHeight), C = buildCommon.makeVList({ + positionType: "shift", + positionData: -v, + children: [{ + type: "elem", + elem: y, + marginRight: M + }] + }, e); + else + throw new Error("supsub must have either sup or sub."); + var B = getTypeOfDomTree(g, "right") || "mord"; + return buildCommon.makeSpan([B], [g, buildCommon.makeSpan(["msupsub"], [C])], e); + }, + mathmlBuilder(s, e) { + var r = !1, o, m; + s.base && s.base.type === "horizBrace" && (m = !!s.sup, m === s.base.isOver && (r = !0, o = s.base.isOver)), s.base && (s.base.type === "op" || s.base.type === "operatorname") && (s.base.parentIsSupSub = !0); + var _ = [buildGroup(s.base, e)]; + s.sub && _.push(buildGroup(s.sub, e)), s.sup && _.push(buildGroup(s.sup, e)); + var g; + if (r) + g = o ? "mover" : "munder"; + else if (s.sub) + if (s.sup) { + var x = s.base; + x && x.type === "op" && x.limits && e.style === Style$1.DISPLAY || x && x.type === "operatorname" && x.alwaysHandleSupSub && (e.style === Style$1.DISPLAY || x.limits) ? g = "munderover" : g = "msubsup"; + } else { + var E = s.base; + E && E.type === "op" && E.limits && (e.style === Style$1.DISPLAY || E.alwaysHandleSupSub) || E && E.type === "operatorname" && E.alwaysHandleSupSub && (E.limits || e.style === Style$1.DISPLAY) ? g = "munder" : g = "msub"; + } + else { + var y = s.base; + y && y.type === "op" && y.limits && (e.style === Style$1.DISPLAY || y.alwaysHandleSupSub) || y && y.type === "operatorname" && y.alwaysHandleSupSub && (y.limits || e.style === Style$1.DISPLAY) ? g = "mover" : g = "msup"; + } + return new mathMLTree.MathNode(g, _); + } +}); +defineFunctionBuilders({ + type: "atom", + htmlBuilder(s, e) { + return buildCommon.mathsym(s.text, s.mode, e, ["m" + s.family]); + }, + mathmlBuilder(s, e) { + var r = new mathMLTree.MathNode("mo", [makeText(s.text, s.mode)]); + if (s.family === "bin") { + var o = getVariant(s, e); + o === "bold-italic" && r.setAttribute("mathvariant", o); + } else s.family === "punct" ? r.setAttribute("separator", "true") : (s.family === "open" || s.family === "close") && r.setAttribute("stretchy", "false"); + return r; + } +}); +var defaultVariant = { + mi: "italic", + mn: "normal", + mtext: "normal" +}; +defineFunctionBuilders({ + type: "mathord", + htmlBuilder(s, e) { + return buildCommon.makeOrd(s, e, "mathord"); + }, + mathmlBuilder(s, e) { + var r = new mathMLTree.MathNode("mi", [makeText(s.text, s.mode, e)]), o = getVariant(s, e) || "italic"; + return o !== defaultVariant[r.type] && r.setAttribute("mathvariant", o), r; + } +}); +defineFunctionBuilders({ + type: "textord", + htmlBuilder(s, e) { + return buildCommon.makeOrd(s, e, "textord"); + }, + mathmlBuilder(s, e) { + var r = makeText(s.text, s.mode, e), o = getVariant(s, e) || "normal", m; + return s.mode === "text" ? m = new mathMLTree.MathNode("mtext", [r]) : /[0-9]/.test(s.text) ? m = new mathMLTree.MathNode("mn", [r]) : s.text === "\\prime" ? m = new mathMLTree.MathNode("mo", [r]) : m = new mathMLTree.MathNode("mi", [r]), o !== defaultVariant[m.type] && m.setAttribute("mathvariant", o), m; + } +}); +var cssSpace = { + "\\nobreak": "nobreak", + "\\allowbreak": "allowbreak" +}, regularSpace = { + " ": {}, + "\\ ": {}, + "~": { + className: "nobreak" + }, + "\\space": {}, + "\\nobreakspace": { + className: "nobreak" + } +}; +defineFunctionBuilders({ + type: "spacing", + htmlBuilder(s, e) { + if (regularSpace.hasOwnProperty(s.text)) { + var r = regularSpace[s.text].className || ""; + if (s.mode === "text") { + var o = buildCommon.makeOrd(s, e, "textord"); + return o.classes.push(r), o; + } else + return buildCommon.makeSpan(["mspace", r], [buildCommon.mathsym(s.text, s.mode, e)], e); + } else { + if (cssSpace.hasOwnProperty(s.text)) + return buildCommon.makeSpan(["mspace", cssSpace[s.text]], [], e); + throw new ParseError('Unknown type of space "' + s.text + '"'); + } + }, + mathmlBuilder(s, e) { + var r; + if (regularSpace.hasOwnProperty(s.text)) + r = new mathMLTree.MathNode("mtext", [new mathMLTree.TextNode(" ")]); + else { + if (cssSpace.hasOwnProperty(s.text)) + return new mathMLTree.MathNode("mspace"); + throw new ParseError('Unknown type of space "' + s.text + '"'); + } + return r; + } +}); +var pad = () => { + var s = new mathMLTree.MathNode("mtd", []); + return s.setAttribute("width", "50%"), s; +}; +defineFunctionBuilders({ + type: "tag", + mathmlBuilder(s, e) { + var r = new mathMLTree.MathNode("mtable", [new mathMLTree.MathNode("mtr", [pad(), new mathMLTree.MathNode("mtd", [buildExpressionRow(s.body, e)]), pad(), new mathMLTree.MathNode("mtd", [buildExpressionRow(s.tag, e)])])]); + return r.setAttribute("width", "100%"), r; + } +}); +var textFontFamilies = { + "\\text": void 0, + "\\textrm": "textrm", + "\\textsf": "textsf", + "\\texttt": "texttt", + "\\textnormal": "textrm" +}, textFontWeights = { + "\\textbf": "textbf", + "\\textmd": "textmd" +}, textFontShapes = { + "\\textit": "textit", + "\\textup": "textup" +}, optionsWithFont = (s, e) => { + var r = s.font; + if (r) { + if (textFontFamilies[r]) + return e.withTextFontFamily(textFontFamilies[r]); + if (textFontWeights[r]) + return e.withTextFontWeight(textFontWeights[r]); + if (r === "\\emph") + return e.fontShape === "textit" ? e.withTextFontShape("textup") : e.withTextFontShape("textit"); + } else return e; + return e.withTextFontShape(textFontShapes[r]); +}; +defineFunction({ + type: "text", + names: [ + // Font families + "\\text", + "\\textrm", + "\\textsf", + "\\texttt", + "\\textnormal", + // Font weights + "\\textbf", + "\\textmd", + // Font Shapes + "\\textit", + "\\textup", + "\\emph" + ], + props: { + numArgs: 1, + argTypes: ["text"], + allowedInArgument: !0, + allowedInText: !0 + }, + handler(s, e) { + var { + parser: r, + funcName: o + } = s, m = e[0]; + return { + type: "text", + mode: r.mode, + body: ordargument(m), + font: o + }; + }, + htmlBuilder(s, e) { + var r = optionsWithFont(s, e), o = buildExpression$1(s.body, r, !0); + return buildCommon.makeSpan(["mord", "text"], o, r); + }, + mathmlBuilder(s, e) { + var r = optionsWithFont(s, e); + return buildExpressionRow(s.body, r); + } +}); +defineFunction({ + type: "underline", + names: ["\\underline"], + props: { + numArgs: 1, + allowedInText: !0 + }, + handler(s, e) { + var { + parser: r + } = s; + return { + type: "underline", + mode: r.mode, + body: e[0] + }; + }, + htmlBuilder(s, e) { + var r = buildGroup$1(s.body, e), o = buildCommon.makeLineSpan("underline-line", e), m = e.fontMetrics().defaultRuleThickness, _ = buildCommon.makeVList({ + positionType: "top", + positionData: r.height, + children: [{ + type: "kern", + size: m + }, { + type: "elem", + elem: o + }, { + type: "kern", + size: 3 * m + }, { + type: "elem", + elem: r + }] + }, e); + return buildCommon.makeSpan(["mord", "underline"], [_], e); + }, + mathmlBuilder(s, e) { + var r = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode("‾")]); + r.setAttribute("stretchy", "true"); + var o = new mathMLTree.MathNode("munder", [buildGroup(s.body, e), r]); + return o.setAttribute("accentunder", "true"), o; + } +}); +defineFunction({ + type: "vcenter", + names: ["\\vcenter"], + props: { + numArgs: 1, + argTypes: ["original"], + // In LaTeX, \vcenter can act only on a box. + allowedInText: !1 + }, + handler(s, e) { + var { + parser: r + } = s; + return { + type: "vcenter", + mode: r.mode, + body: e[0] + }; + }, + htmlBuilder(s, e) { + var r = buildGroup$1(s.body, e), o = e.fontMetrics().axisHeight, m = 0.5 * (r.height - o - (r.depth + o)); + return buildCommon.makeVList({ + positionType: "shift", + positionData: m, + children: [{ + type: "elem", + elem: r + }] + }, e); + }, + mathmlBuilder(s, e) { + return new mathMLTree.MathNode("mpadded", [buildGroup(s.body, e)], ["vcenter"]); + } +}); +defineFunction({ + type: "verb", + names: ["\\verb"], + props: { + numArgs: 0, + allowedInText: !0 + }, + handler(s, e, r) { + throw new ParseError("\\verb ended by end of line instead of matching delimiter"); + }, + htmlBuilder(s, e) { + for (var r = makeVerb(s), o = [], m = e.havingStyle(e.style.text()), _ = 0; _ < r.length; _++) { + var g = r[_]; + g === "~" && (g = "\\textasciitilde"), o.push(buildCommon.makeSymbol(g, "Typewriter-Regular", s.mode, m, ["mord", "texttt"])); + } + return buildCommon.makeSpan(["mord", "text"].concat(m.sizingClasses(e)), buildCommon.tryCombineChars(o), m); + }, + mathmlBuilder(s, e) { + var r = new mathMLTree.TextNode(makeVerb(s)), o = new mathMLTree.MathNode("mtext", [r]); + return o.setAttribute("mathvariant", "monospace"), o; + } +}); +var makeVerb = (s) => s.body.replace(/ /g, s.star ? "␣" : " "), functions = _functions, spaceRegexString = `[ \r + ]`, controlWordRegexString = "\\\\[a-zA-Z@]+", controlSymbolRegexString = "\\\\[^\uD800-\uDFFF]", controlWordWhitespaceRegexString = "(" + controlWordRegexString + ")" + spaceRegexString + "*", controlSpaceRegexString = `\\\\( +|[ \r ]+ +?)[ \r ]*`, combiningDiacriticalMarkString = "[̀-ͯ]", combiningDiacriticalMarksEndRegex = new RegExp(combiningDiacriticalMarkString + "+$"), tokenRegexString = "(" + spaceRegexString + "+)|" + // whitespace +(controlSpaceRegexString + "|") + // \whitespace +"([!-\\[\\]-‧‪-퟿豈-￿]" + // single codepoint +(combiningDiacriticalMarkString + "*") + // ...plus accents +"|[\uD800-\uDBFF][\uDC00-\uDFFF]" + // surrogate pair +(combiningDiacriticalMarkString + "*") + // ...plus accents +"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5" + // \verb unstarred +("|" + controlWordWhitespaceRegexString) + // \macroName + spaces +("|" + controlSymbolRegexString + ")"); +class Lexer { + // Category codes. The lexer only supports comment characters (14) for now. + // MacroExpander additionally distinguishes active (13). + constructor(e, r) { + this.input = void 0, this.settings = void 0, this.tokenRegex = void 0, this.catcodes = void 0, this.input = e, this.settings = r, this.tokenRegex = new RegExp(tokenRegexString, "g"), this.catcodes = { + "%": 14, + // comment character + "~": 13 + // active character + }; + } + setCatcode(e, r) { + this.catcodes[e] = r; + } + /** + * This function lexes a single token. + */ + lex() { + var e = this.input, r = this.tokenRegex.lastIndex; + if (r === e.length) + return new Token$1("EOF", new SourceLocation(this, r, r)); + var o = this.tokenRegex.exec(e); + if (o === null || o.index !== r) + throw new ParseError("Unexpected character: '" + e[r] + "'", new Token$1(e[r], new SourceLocation(this, r, r + 1))); + var m = o[6] || o[3] || (o[2] ? "\\ " : " "); + if (this.catcodes[m] === 14) { + var _ = e.indexOf(` +`, this.tokenRegex.lastIndex); + return _ === -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 = _ + 1, this.lex(); + } + return new Token$1(m, new SourceLocation(this, r, this.tokenRegex.lastIndex)); + } +} +class Namespace { + /** + * Both arguments are optional. The first argument is an object of + * built-in mappings which never change. The second argument is an object + * of initial (global-level) mappings, which will constantly change + * according to any global/top-level `set`s done. + */ + constructor(e, r) { + e === void 0 && (e = {}), r === void 0 && (r = {}), this.current = void 0, this.builtins = void 0, this.undefStack = void 0, this.current = r, this.builtins = e, this.undefStack = []; + } + /** + * Start a new nested group, affecting future local `set`s. + */ + beginGroup() { + this.undefStack.push({}); + } + /** + * End current nested group, restoring values before the group began. + */ + endGroup() { + if (this.undefStack.length === 0) + throw new ParseError("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug"); + var e = this.undefStack.pop(); + for (var r in e) + e.hasOwnProperty(r) && (e[r] == null ? delete this.current[r] : this.current[r] = e[r]); + } + /** + * Ends all currently nested groups (if any), restoring values before the + * groups began. Useful in case of an error in the middle of parsing. + */ + endGroups() { + for (; this.undefStack.length > 0; ) + this.endGroup(); + } + /** + * Detect whether `name` has a definition. Equivalent to + * `get(name) != null`. + */ + has(e) { + return this.current.hasOwnProperty(e) || this.builtins.hasOwnProperty(e); + } + /** + * Get the current value of a name, or `undefined` if there is no value. + * + * Note: Do not use `if (namespace.get(...))` to detect whether a macro + * is defined, as the definition may be the empty string which evaluates + * to `false` in JavaScript. Use `if (namespace.get(...) != null)` or + * `if (namespace.has(...))`. + */ + get(e) { + return this.current.hasOwnProperty(e) ? this.current[e] : this.builtins[e]; + } + /** + * Set the current value of a name, and optionally set it globally too. + * Local set() sets the current value and (when appropriate) adds an undo + * operation to the undo stack. Global set() may change the undo + * operation at every level, so takes time linear in their number. + * A value of undefined means to delete existing definitions. + */ + set(e, r, o) { + if (o === void 0 && (o = !1), o) { + for (var m = 0; m < this.undefStack.length; m++) + delete this.undefStack[m][e]; + this.undefStack.length > 0 && (this.undefStack[this.undefStack.length - 1][e] = r); + } else { + var _ = this.undefStack[this.undefStack.length - 1]; + _ && !_.hasOwnProperty(e) && (_[e] = this.current[e]); + } + r == null ? delete this.current[e] : this.current[e] = r; + } +} +var macros = _macros; +defineMacro("\\noexpand", function(s) { + var e = s.popToken(); + return s.isExpandable(e.text) && (e.noexpand = !0, e.treatAsRelax = !0), { + tokens: [e], + numArgs: 0 + }; +}); +defineMacro("\\expandafter", function(s) { + var e = s.popToken(); + return s.expandOnce(!0), { + tokens: [e], + numArgs: 0 + }; +}); +defineMacro("\\@firstoftwo", function(s) { + var e = s.consumeArgs(2); + return { + tokens: e[0], + numArgs: 0 + }; +}); +defineMacro("\\@secondoftwo", function(s) { + var e = s.consumeArgs(2); + return { + tokens: e[1], + numArgs: 0 + }; +}); +defineMacro("\\@ifnextchar", function(s) { + var e = s.consumeArgs(3); + s.consumeSpaces(); + var r = s.future(); + return e[0].length === 1 && e[0][0].text === r.text ? { + tokens: e[1], + numArgs: 0 + } : { + tokens: e[2], + numArgs: 0 + }; +}); +defineMacro("\\@ifstar", "\\@ifnextchar *{\\@firstoftwo{#1}}"); +defineMacro("\\TextOrMath", function(s) { + var e = s.consumeArgs(2); + return s.mode === "text" ? { + tokens: e[0], + numArgs: 0 + } : { + tokens: e[1], + numArgs: 0 + }; +}); +var digitToNumber = { + 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 +}; +defineMacro("\\char", function(s) { + var e = s.popToken(), r, o = ""; + if (e.text === "'") + r = 8, e = s.popToken(); + else if (e.text === '"') + r = 16, e = s.popToken(); + else if (e.text === "`") + if (e = s.popToken(), e.text[0] === "\\") + o = e.text.charCodeAt(1); + else { + if (e.text === "EOF") + throw new ParseError("\\char` missing argument"); + o = e.text.charCodeAt(0); + } + else + r = 10; + if (r) { + if (o = digitToNumber[e.text], o == null || o >= r) + throw new ParseError("Invalid base-" + r + " digit " + e.text); + for (var m; (m = digitToNumber[s.future().text]) != null && m < r; ) + o *= r, o += m, s.popToken(); + } + return "\\@char{" + o + "}"; +}); +var newcommand = (s, e, r, o) => { + var m = s.consumeArg().tokens; + if (m.length !== 1) + throw new ParseError("\\newcommand's first argument must be a macro name"); + var _ = m[0].text, g = s.isDefined(_); + if (g && !e) + throw new ParseError("\\newcommand{" + _ + "} attempting to redefine " + (_ + "; use \\renewcommand")); + if (!g && !r) + throw new ParseError("\\renewcommand{" + _ + "} when command " + _ + " does not yet exist; use \\newcommand"); + var y = 0; + if (m = s.consumeArg().tokens, m.length === 1 && m[0].text === "[") { + for (var E = "", x = s.expandNextToken(); x.text !== "]" && x.text !== "EOF"; ) + E += x.text, x = s.expandNextToken(); + if (!E.match(/^\s*[0-9]+\s*$/)) + throw new ParseError("Invalid number of arguments: " + E); + y = parseInt(E), m = s.consumeArg().tokens; + } + return g && o || s.macros.set(_, { + tokens: m, + numArgs: y + }), ""; +}; +defineMacro("\\newcommand", (s) => newcommand(s, !1, !0, !1)); +defineMacro("\\renewcommand", (s) => newcommand(s, !0, !1, !1)); +defineMacro("\\providecommand", (s) => newcommand(s, !0, !0, !0)); +defineMacro("\\message", (s) => { + var e = s.consumeArgs(1)[0]; + return console.log(e.reverse().map((r) => r.text).join("")), ""; +}); +defineMacro("\\errmessage", (s) => { + var e = s.consumeArgs(1)[0]; + return console.error(e.reverse().map((r) => r.text).join("")), ""; +}); +defineMacro("\\show", (s) => { + var e = s.popToken(), r = e.text; + return console.log(e, s.macros.get(r), functions[r], symbols.math[r], symbols.text[r]), ""; +}); +defineMacro("\\bgroup", "{"); +defineMacro("\\egroup", "}"); +defineMacro("~", "\\nobreakspace"); +defineMacro("\\lq", "`"); +defineMacro("\\rq", "'"); +defineMacro("\\aa", "\\r a"); +defineMacro("\\AA", "\\r A"); +defineMacro("\\textcopyright", "\\html@mathml{\\textcircled{c}}{\\char`©}"); +defineMacro("\\copyright", "\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"); +defineMacro("\\textregistered", "\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"); +defineMacro("ℬ", "\\mathscr{B}"); +defineMacro("ℰ", "\\mathscr{E}"); +defineMacro("ℱ", "\\mathscr{F}"); +defineMacro("ℋ", "\\mathscr{H}"); +defineMacro("ℐ", "\\mathscr{I}"); +defineMacro("ℒ", "\\mathscr{L}"); +defineMacro("ℳ", "\\mathscr{M}"); +defineMacro("ℛ", "\\mathscr{R}"); +defineMacro("ℭ", "\\mathfrak{C}"); +defineMacro("ℌ", "\\mathfrak{H}"); +defineMacro("ℨ", "\\mathfrak{Z}"); +defineMacro("\\Bbbk", "\\Bbb{k}"); +defineMacro("·", "\\cdotp"); +defineMacro("\\llap", "\\mathllap{\\textrm{#1}}"); +defineMacro("\\rlap", "\\mathrlap{\\textrm{#1}}"); +defineMacro("\\clap", "\\mathclap{\\textrm{#1}}"); +defineMacro("\\mathstrut", "\\vphantom{(}"); +defineMacro("\\underbar", "\\underline{\\text{#1}}"); +defineMacro("\\not", '\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'); +defineMacro("\\neq", "\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"); +defineMacro("\\ne", "\\neq"); +defineMacro("≠", "\\neq"); +defineMacro("\\notin", "\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"); +defineMacro("∉", "\\notin"); +defineMacro("≘", "\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"); +defineMacro("≙", "\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"); +defineMacro("≚", "\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"); +defineMacro("≛", "\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"); +defineMacro("≝", "\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"); +defineMacro("≞", "\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"); +defineMacro("≟", "\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"); +defineMacro("⟂", "\\perp"); +defineMacro("‼", "\\mathclose{!\\mkern-0.8mu!}"); +defineMacro("∌", "\\notni"); +defineMacro("⌜", "\\ulcorner"); +defineMacro("⌝", "\\urcorner"); +defineMacro("⌞", "\\llcorner"); +defineMacro("⌟", "\\lrcorner"); +defineMacro("©", "\\copyright"); +defineMacro("®", "\\textregistered"); +defineMacro("️", "\\textregistered"); +defineMacro("\\ulcorner", '\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'); +defineMacro("\\urcorner", '\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'); +defineMacro("\\llcorner", '\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'); +defineMacro("\\lrcorner", '\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'); +defineMacro("\\vdots", "{\\varvdots\\rule{0pt}{15pt}}"); +defineMacro("⋮", "\\vdots"); +defineMacro("\\varGamma", "\\mathit{\\Gamma}"); +defineMacro("\\varDelta", "\\mathit{\\Delta}"); +defineMacro("\\varTheta", "\\mathit{\\Theta}"); +defineMacro("\\varLambda", "\\mathit{\\Lambda}"); +defineMacro("\\varXi", "\\mathit{\\Xi}"); +defineMacro("\\varPi", "\\mathit{\\Pi}"); +defineMacro("\\varSigma", "\\mathit{\\Sigma}"); +defineMacro("\\varUpsilon", "\\mathit{\\Upsilon}"); +defineMacro("\\varPhi", "\\mathit{\\Phi}"); +defineMacro("\\varPsi", "\\mathit{\\Psi}"); +defineMacro("\\varOmega", "\\mathit{\\Omega}"); +defineMacro("\\substack", "\\begin{subarray}{c}#1\\end{subarray}"); +defineMacro("\\colon", "\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"); +defineMacro("\\boxed", "\\fbox{$\\displaystyle{#1}$}"); +defineMacro("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;"); +defineMacro("\\implies", "\\DOTSB\\;\\Longrightarrow\\;"); +defineMacro("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;"); +defineMacro("\\dddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"); +defineMacro("\\ddddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}"); +var dotsByToken = { + ",": "\\dotsc", + "\\not": "\\dotsb", + // \keybin@ checks for the following: + "+": "\\dotsb", + "=": "\\dotsb", + "<": "\\dotsb", + ">": "\\dotsb", + "-": "\\dotsb", + "*": "\\dotsb", + ":": "\\dotsb", + // Symbols whose definition starts with \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", + // Symbols whose definition starts with \mathbin: + "\\mathbin": "\\dotsb", + // Symbols whose definition starts with \mathrel: + "\\mathrel": "\\dotsb", + "\\relbar": "\\dotsb", + "\\Relbar": "\\dotsb", + "\\xrightarrow": "\\dotsb", + "\\xleftarrow": "\\dotsb", + // Symbols whose definition starts with \DOTSI: + "\\DOTSI": "\\dotsi", + "\\int": "\\dotsi", + "\\oint": "\\dotsi", + "\\iint": "\\dotsi", + "\\iiint": "\\dotsi", + "\\iiiint": "\\dotsi", + "\\idotsint": "\\dotsi", + // Symbols whose definition starts with \DOTSX: + "\\DOTSX": "\\dotsx" +}; +defineMacro("\\dots", function(s) { + var e = "\\dotso", r = s.expandAfterFuture().text; + return r in dotsByToken ? e = dotsByToken[r] : (r.slice(0, 4) === "\\not" || r in symbols.math && utils.contains(["bin", "rel"], symbols.math[r].group)) && (e = "\\dotsb"), e; +}); +var spaceAfterDots = { + // \rightdelim@ checks for the following: + ")": !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, + // \extra@ also tests for the following: + $: !0, + // \extrap@ checks for the following: + ";": !0, + ".": !0, + ",": !0 +}; +defineMacro("\\dotso", function(s) { + var e = s.future().text; + return e in spaceAfterDots ? "\\ldots\\," : "\\ldots"; +}); +defineMacro("\\dotsc", function(s) { + var e = s.future().text; + return e in spaceAfterDots && e !== "," ? "\\ldots\\," : "\\ldots"; +}); +defineMacro("\\cdots", function(s) { + var e = s.future().text; + return e in spaceAfterDots ? "\\@cdots\\," : "\\@cdots"; +}); +defineMacro("\\dotsb", "\\cdots"); +defineMacro("\\dotsm", "\\cdots"); +defineMacro("\\dotsi", "\\!\\cdots"); +defineMacro("\\dotsx", "\\ldots\\,"); +defineMacro("\\DOTSI", "\\relax"); +defineMacro("\\DOTSB", "\\relax"); +defineMacro("\\DOTSX", "\\relax"); +defineMacro("\\tmspace", "\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"); +defineMacro("\\,", "\\tmspace+{3mu}{.1667em}"); +defineMacro("\\thinspace", "\\,"); +defineMacro("\\>", "\\mskip{4mu}"); +defineMacro("\\:", "\\tmspace+{4mu}{.2222em}"); +defineMacro("\\medspace", "\\:"); +defineMacro("\\;", "\\tmspace+{5mu}{.2777em}"); +defineMacro("\\thickspace", "\\;"); +defineMacro("\\!", "\\tmspace-{3mu}{.1667em}"); +defineMacro("\\negthinspace", "\\!"); +defineMacro("\\negmedspace", "\\tmspace-{4mu}{.2222em}"); +defineMacro("\\negthickspace", "\\tmspace-{5mu}{.277em}"); +defineMacro("\\enspace", "\\kern.5em "); +defineMacro("\\enskip", "\\hskip.5em\\relax"); +defineMacro("\\quad", "\\hskip1em\\relax"); +defineMacro("\\qquad", "\\hskip2em\\relax"); +defineMacro("\\tag", "\\@ifstar\\tag@literal\\tag@paren"); +defineMacro("\\tag@paren", "\\tag@literal{({#1})}"); +defineMacro("\\tag@literal", (s) => { + if (s.macros.get("\\df@tag")) + throw new ParseError("Multiple \\tag"); + return "\\gdef\\df@tag{\\text{#1}}"; +}); +defineMacro("\\bmod", "\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"); +defineMacro("\\pod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"); +defineMacro("\\pmod", "\\pod{{\\rm mod}\\mkern6mu#1}"); +defineMacro("\\mod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"); +defineMacro("\\newline", "\\\\\\relax"); +defineMacro("\\TeX", "\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}"); +var latexRaiseA = makeEm(fontMetricsData["Main-Regular"][84][1] - 0.7 * fontMetricsData["Main-Regular"][65][1]); +defineMacro("\\LaTeX", "\\textrm{\\html@mathml{" + ("L\\kern-.36em\\raisebox{" + latexRaiseA + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{LaTeX}}"); +defineMacro("\\KaTeX", "\\textrm{\\html@mathml{" + ("K\\kern-.17em\\raisebox{" + latexRaiseA + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{KaTeX}}"); +defineMacro("\\hspace", "\\@ifstar\\@hspacer\\@hspace"); +defineMacro("\\@hspace", "\\hskip #1\\relax"); +defineMacro("\\@hspacer", "\\rule{0pt}{0pt}\\hskip #1\\relax"); +defineMacro("\\ordinarycolon", ":"); +defineMacro("\\vcentcolon", "\\mathrel{\\mathop\\ordinarycolon}"); +defineMacro("\\dblcolon", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'); +defineMacro("\\coloneqq", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'); +defineMacro("\\Coloneqq", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'); +defineMacro("\\coloneq", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'); +defineMacro("\\Coloneq", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'); +defineMacro("\\eqqcolon", '\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'); +defineMacro("\\Eqqcolon", '\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'); +defineMacro("\\eqcolon", '\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'); +defineMacro("\\Eqcolon", '\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'); +defineMacro("\\colonapprox", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'); +defineMacro("\\Colonapprox", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'); +defineMacro("\\colonsim", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'); +defineMacro("\\Colonsim", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'); +defineMacro("∷", "\\dblcolon"); +defineMacro("∹", "\\eqcolon"); +defineMacro("≔", "\\coloneqq"); +defineMacro("≕", "\\eqqcolon"); +defineMacro("⩴", "\\Coloneqq"); +defineMacro("\\ratio", "\\vcentcolon"); +defineMacro("\\coloncolon", "\\dblcolon"); +defineMacro("\\colonequals", "\\coloneqq"); +defineMacro("\\coloncolonequals", "\\Coloneqq"); +defineMacro("\\equalscolon", "\\eqqcolon"); +defineMacro("\\equalscoloncolon", "\\Eqqcolon"); +defineMacro("\\colonminus", "\\coloneq"); +defineMacro("\\coloncolonminus", "\\Coloneq"); +defineMacro("\\minuscolon", "\\eqcolon"); +defineMacro("\\minuscoloncolon", "\\Eqcolon"); +defineMacro("\\coloncolonapprox", "\\Colonapprox"); +defineMacro("\\coloncolonsim", "\\Colonsim"); +defineMacro("\\simcolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"); +defineMacro("\\simcoloncolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"); +defineMacro("\\approxcolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"); +defineMacro("\\approxcoloncolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"); +defineMacro("\\notni", "\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"); +defineMacro("\\limsup", "\\DOTSB\\operatorname*{lim\\,sup}"); +defineMacro("\\liminf", "\\DOTSB\\operatorname*{lim\\,inf}"); +defineMacro("\\injlim", "\\DOTSB\\operatorname*{inj\\,lim}"); +defineMacro("\\projlim", "\\DOTSB\\operatorname*{proj\\,lim}"); +defineMacro("\\varlimsup", "\\DOTSB\\operatorname*{\\overline{lim}}"); +defineMacro("\\varliminf", "\\DOTSB\\operatorname*{\\underline{lim}}"); +defineMacro("\\varinjlim", "\\DOTSB\\operatorname*{\\underrightarrow{lim}}"); +defineMacro("\\varprojlim", "\\DOTSB\\operatorname*{\\underleftarrow{lim}}"); +defineMacro("\\gvertneqq", "\\html@mathml{\\@gvertneqq}{≩}"); +defineMacro("\\lvertneqq", "\\html@mathml{\\@lvertneqq}{≨}"); +defineMacro("\\ngeqq", "\\html@mathml{\\@ngeqq}{≱}"); +defineMacro("\\ngeqslant", "\\html@mathml{\\@ngeqslant}{≱}"); +defineMacro("\\nleqq", "\\html@mathml{\\@nleqq}{≰}"); +defineMacro("\\nleqslant", "\\html@mathml{\\@nleqslant}{≰}"); +defineMacro("\\nshortmid", "\\html@mathml{\\@nshortmid}{∤}"); +defineMacro("\\nshortparallel", "\\html@mathml{\\@nshortparallel}{∦}"); +defineMacro("\\nsubseteqq", "\\html@mathml{\\@nsubseteqq}{⊈}"); +defineMacro("\\nsupseteqq", "\\html@mathml{\\@nsupseteqq}{⊉}"); +defineMacro("\\varsubsetneq", "\\html@mathml{\\@varsubsetneq}{⊊}"); +defineMacro("\\varsubsetneqq", "\\html@mathml{\\@varsubsetneqq}{⫋}"); +defineMacro("\\varsupsetneq", "\\html@mathml{\\@varsupsetneq}{⊋}"); +defineMacro("\\varsupsetneqq", "\\html@mathml{\\@varsupsetneqq}{⫌}"); +defineMacro("\\imath", "\\html@mathml{\\@imath}{ı}"); +defineMacro("\\jmath", "\\html@mathml{\\@jmath}{ȷ}"); +defineMacro("\\llbracket", "\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"); +defineMacro("\\rrbracket", "\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"); +defineMacro("⟦", "\\llbracket"); +defineMacro("⟧", "\\rrbracket"); +defineMacro("\\lBrace", "\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"); +defineMacro("\\rBrace", "\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"); +defineMacro("⦃", "\\lBrace"); +defineMacro("⦄", "\\rBrace"); +defineMacro("\\minuso", "\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"); +defineMacro("⦵", "\\minuso"); +defineMacro("\\darr", "\\downarrow"); +defineMacro("\\dArr", "\\Downarrow"); +defineMacro("\\Darr", "\\Downarrow"); +defineMacro("\\lang", "\\langle"); +defineMacro("\\rang", "\\rangle"); +defineMacro("\\uarr", "\\uparrow"); +defineMacro("\\uArr", "\\Uparrow"); +defineMacro("\\Uarr", "\\Uparrow"); +defineMacro("\\N", "\\mathbb{N}"); +defineMacro("\\R", "\\mathbb{R}"); +defineMacro("\\Z", "\\mathbb{Z}"); +defineMacro("\\alef", "\\aleph"); +defineMacro("\\alefsym", "\\aleph"); +defineMacro("\\Alpha", "\\mathrm{A}"); +defineMacro("\\Beta", "\\mathrm{B}"); +defineMacro("\\bull", "\\bullet"); +defineMacro("\\Chi", "\\mathrm{X}"); +defineMacro("\\clubs", "\\clubsuit"); +defineMacro("\\cnums", "\\mathbb{C}"); +defineMacro("\\Complex", "\\mathbb{C}"); +defineMacro("\\Dagger", "\\ddagger"); +defineMacro("\\diamonds", "\\diamondsuit"); +defineMacro("\\empty", "\\emptyset"); +defineMacro("\\Epsilon", "\\mathrm{E}"); +defineMacro("\\Eta", "\\mathrm{H}"); +defineMacro("\\exist", "\\exists"); +defineMacro("\\harr", "\\leftrightarrow"); +defineMacro("\\hArr", "\\Leftrightarrow"); +defineMacro("\\Harr", "\\Leftrightarrow"); +defineMacro("\\hearts", "\\heartsuit"); +defineMacro("\\image", "\\Im"); +defineMacro("\\infin", "\\infty"); +defineMacro("\\Iota", "\\mathrm{I}"); +defineMacro("\\isin", "\\in"); +defineMacro("\\Kappa", "\\mathrm{K}"); +defineMacro("\\larr", "\\leftarrow"); +defineMacro("\\lArr", "\\Leftarrow"); +defineMacro("\\Larr", "\\Leftarrow"); +defineMacro("\\lrarr", "\\leftrightarrow"); +defineMacro("\\lrArr", "\\Leftrightarrow"); +defineMacro("\\Lrarr", "\\Leftrightarrow"); +defineMacro("\\Mu", "\\mathrm{M}"); +defineMacro("\\natnums", "\\mathbb{N}"); +defineMacro("\\Nu", "\\mathrm{N}"); +defineMacro("\\Omicron", "\\mathrm{O}"); +defineMacro("\\plusmn", "\\pm"); +defineMacro("\\rarr", "\\rightarrow"); +defineMacro("\\rArr", "\\Rightarrow"); +defineMacro("\\Rarr", "\\Rightarrow"); +defineMacro("\\real", "\\Re"); +defineMacro("\\reals", "\\mathbb{R}"); +defineMacro("\\Reals", "\\mathbb{R}"); +defineMacro("\\Rho", "\\mathrm{P}"); +defineMacro("\\sdot", "\\cdot"); +defineMacro("\\sect", "\\S"); +defineMacro("\\spades", "\\spadesuit"); +defineMacro("\\sub", "\\subset"); +defineMacro("\\sube", "\\subseteq"); +defineMacro("\\supe", "\\supseteq"); +defineMacro("\\Tau", "\\mathrm{T}"); +defineMacro("\\thetasym", "\\vartheta"); +defineMacro("\\weierp", "\\wp"); +defineMacro("\\Zeta", "\\mathrm{Z}"); +defineMacro("\\argmin", "\\DOTSB\\operatorname*{arg\\,min}"); +defineMacro("\\argmax", "\\DOTSB\\operatorname*{arg\\,max}"); +defineMacro("\\plim", "\\DOTSB\\mathop{\\operatorname{plim}}\\limits"); +defineMacro("\\bra", "\\mathinner{\\langle{#1}|}"); +defineMacro("\\ket", "\\mathinner{|{#1}\\rangle}"); +defineMacro("\\braket", "\\mathinner{\\langle{#1}\\rangle}"); +defineMacro("\\Bra", "\\left\\langle#1\\right|"); +defineMacro("\\Ket", "\\left|#1\\right\\rangle"); +var braketHelper = (s) => (e) => { + var r = e.consumeArg().tokens, o = e.consumeArg().tokens, m = e.consumeArg().tokens, _ = e.consumeArg().tokens, g = e.macros.get("|"), y = e.macros.get("\\|"); + e.macros.beginGroup(); + var E = (h) => (a) => { + s && (a.macros.set("|", g), m.length && a.macros.set("\\|", y)); + var b = h; + if (!h && m.length) { + var w = a.future(); + w.text === "|" && (a.popToken(), b = !0); + } + return { + tokens: b ? m : o, + numArgs: 0 + }; + }; + e.macros.set("|", E(!1)), m.length && e.macros.set("\\|", E(!0)); + var x = e.consumeArg().tokens, v = e.expandTokens([ + ..._, + ...x, + ...r + // reversed + ]); + return e.macros.endGroup(), { + tokens: v.reverse(), + numArgs: 0 + }; +}; +defineMacro("\\bra@ket", braketHelper(!1)); +defineMacro("\\bra@set", braketHelper(!0)); +defineMacro("\\Braket", "\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"); +defineMacro("\\Set", "\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"); +defineMacro("\\set", "\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"); +defineMacro("\\angln", "{\\angl n}"); +defineMacro("\\blue", "\\textcolor{##6495ed}{#1}"); +defineMacro("\\orange", "\\textcolor{##ffa500}{#1}"); +defineMacro("\\pink", "\\textcolor{##ff00af}{#1}"); +defineMacro("\\red", "\\textcolor{##df0030}{#1}"); +defineMacro("\\green", "\\textcolor{##28ae7b}{#1}"); +defineMacro("\\gray", "\\textcolor{gray}{#1}"); +defineMacro("\\purple", "\\textcolor{##9d38bd}{#1}"); +defineMacro("\\blueA", "\\textcolor{##ccfaff}{#1}"); +defineMacro("\\blueB", "\\textcolor{##80f6ff}{#1}"); +defineMacro("\\blueC", "\\textcolor{##63d9ea}{#1}"); +defineMacro("\\blueD", "\\textcolor{##11accd}{#1}"); +defineMacro("\\blueE", "\\textcolor{##0c7f99}{#1}"); +defineMacro("\\tealA", "\\textcolor{##94fff5}{#1}"); +defineMacro("\\tealB", "\\textcolor{##26edd5}{#1}"); +defineMacro("\\tealC", "\\textcolor{##01d1c1}{#1}"); +defineMacro("\\tealD", "\\textcolor{##01a995}{#1}"); +defineMacro("\\tealE", "\\textcolor{##208170}{#1}"); +defineMacro("\\greenA", "\\textcolor{##b6ffb0}{#1}"); +defineMacro("\\greenB", "\\textcolor{##8af281}{#1}"); +defineMacro("\\greenC", "\\textcolor{##74cf70}{#1}"); +defineMacro("\\greenD", "\\textcolor{##1fab54}{#1}"); +defineMacro("\\greenE", "\\textcolor{##0d923f}{#1}"); +defineMacro("\\goldA", "\\textcolor{##ffd0a9}{#1}"); +defineMacro("\\goldB", "\\textcolor{##ffbb71}{#1}"); +defineMacro("\\goldC", "\\textcolor{##ff9c39}{#1}"); +defineMacro("\\goldD", "\\textcolor{##e07d10}{#1}"); +defineMacro("\\goldE", "\\textcolor{##a75a05}{#1}"); +defineMacro("\\redA", "\\textcolor{##fca9a9}{#1}"); +defineMacro("\\redB", "\\textcolor{##ff8482}{#1}"); +defineMacro("\\redC", "\\textcolor{##f9685d}{#1}"); +defineMacro("\\redD", "\\textcolor{##e84d39}{#1}"); +defineMacro("\\redE", "\\textcolor{##bc2612}{#1}"); +defineMacro("\\maroonA", "\\textcolor{##ffbde0}{#1}"); +defineMacro("\\maroonB", "\\textcolor{##ff92c6}{#1}"); +defineMacro("\\maroonC", "\\textcolor{##ed5fa6}{#1}"); +defineMacro("\\maroonD", "\\textcolor{##ca337c}{#1}"); +defineMacro("\\maroonE", "\\textcolor{##9e034e}{#1}"); +defineMacro("\\purpleA", "\\textcolor{##ddd7ff}{#1}"); +defineMacro("\\purpleB", "\\textcolor{##c6b9fc}{#1}"); +defineMacro("\\purpleC", "\\textcolor{##aa87ff}{#1}"); +defineMacro("\\purpleD", "\\textcolor{##7854ab}{#1}"); +defineMacro("\\purpleE", "\\textcolor{##543b78}{#1}"); +defineMacro("\\mintA", "\\textcolor{##f5f9e8}{#1}"); +defineMacro("\\mintB", "\\textcolor{##edf2df}{#1}"); +defineMacro("\\mintC", "\\textcolor{##e0e5cc}{#1}"); +defineMacro("\\grayA", "\\textcolor{##f6f7f7}{#1}"); +defineMacro("\\grayB", "\\textcolor{##f0f1f2}{#1}"); +defineMacro("\\grayC", "\\textcolor{##e3e5e6}{#1}"); +defineMacro("\\grayD", "\\textcolor{##d6d8da}{#1}"); +defineMacro("\\grayE", "\\textcolor{##babec2}{#1}"); +defineMacro("\\grayF", "\\textcolor{##888d93}{#1}"); +defineMacro("\\grayG", "\\textcolor{##626569}{#1}"); +defineMacro("\\grayH", "\\textcolor{##3b3e40}{#1}"); +defineMacro("\\grayI", "\\textcolor{##21242c}{#1}"); +defineMacro("\\kaBlue", "\\textcolor{##314453}{#1}"); +defineMacro("\\kaGreen", "\\textcolor{##71B307}{#1}"); +var implicitCommands = { + "^": !0, + // Parser.js + _: !0, + // Parser.js + "\\limits": !0, + // Parser.js + "\\nolimits": !0 + // Parser.js +}; +class MacroExpander { + constructor(e, r, o) { + 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 = r, this.expansionCount = 0, this.feed(e), this.macros = new Namespace(macros, r.macros), this.mode = o, this.stack = []; + } + /** + * Feed a new input string to the same MacroExpander + * (with existing macros etc.). + */ + feed(e) { + this.lexer = new Lexer(e, this.settings); + } + /** + * Switches between "text" and "math" modes. + */ + switchMode(e) { + this.mode = e; + } + /** + * Start a new group nesting within all namespaces. + */ + beginGroup() { + this.macros.beginGroup(); + } + /** + * End current group nesting within all namespaces. + */ + endGroup() { + this.macros.endGroup(); + } + /** + * Ends all currently nested groups (if any), restoring values before the + * groups began. Useful in case of an error in the middle of parsing. + */ + endGroups() { + this.macros.endGroups(); + } + /** + * Returns the topmost token on the stack, without expanding it. + * Similar in behavior to TeX's `\futurelet`. + */ + future() { + return this.stack.length === 0 && this.pushToken(this.lexer.lex()), this.stack[this.stack.length - 1]; + } + /** + * Remove and return the next unexpanded token. + */ + popToken() { + return this.future(), this.stack.pop(); + } + /** + * Add a given token to the token stack. In particular, this get be used + * to put back a token returned from one of the other methods. + */ + pushToken(e) { + this.stack.push(e); + } + /** + * Append an array of tokens to the token stack. + */ + pushTokens(e) { + this.stack.push(...e); + } + /** + * Find an macro argument without expanding tokens and append the array of + * tokens to the token stack. Uses Token as a container for the result. + */ + scanArgument(e) { + var r, o, m; + if (e) { + if (this.consumeSpaces(), this.future().text !== "[") + return null; + r = this.popToken(), { + tokens: m, + end: o + } = this.consumeArg(["]"]); + } else + ({ + tokens: m, + start: r, + end: o + } = this.consumeArg()); + return this.pushToken(new Token$1("EOF", o.loc)), this.pushTokens(m), r.range(o, ""); + } + /** + * Consume all following space tokens, without expansion. + */ + consumeSpaces() { + for (; ; ) { + var e = this.future(); + if (e.text === " ") + this.stack.pop(); + else + break; + } + } + /** + * Consume an argument from the token stream, and return the resulting array + * of tokens and start/end token. + */ + consumeArg(e) { + var r = [], o = e && e.length > 0; + o || this.consumeSpaces(); + var m = this.future(), _, g = 0, y = 0; + do { + if (_ = this.popToken(), r.push(_), _.text === "{") + ++g; + else if (_.text === "}") { + if (--g, g === -1) + throw new ParseError("Extra }", _); + } else if (_.text === "EOF") + throw new ParseError("Unexpected end of input in a macro argument, expected '" + (e && o ? e[y] : "}") + "'", _); + if (e && o) + if ((g === 0 || g === 1 && e[y] === "{") && _.text === e[y]) { + if (++y, y === e.length) { + r.splice(-y, y); + break; + } + } else + y = 0; + } while (g !== 0 || o); + return m.text === "{" && r[r.length - 1].text === "}" && (r.pop(), r.shift()), r.reverse(), { + tokens: r, + start: m, + end: _ + }; + } + /** + * Consume the specified number of (delimited) arguments from the token + * stream and return the resulting array of arguments. + */ + consumeArgs(e, r) { + if (r) { + if (r.length !== e + 1) + throw new ParseError("The length of delimiters doesn't match the number of args!"); + for (var o = r[0], m = 0; m < o.length; m++) { + var _ = this.popToken(); + if (o[m] !== _.text) + throw new ParseError("Use of the macro doesn't match its definition", _); + } + } + for (var g = [], y = 0; y < e; y++) + g.push(this.consumeArg(r && r[y + 1]).tokens); + return g; + } + /** + * Increment `expansionCount` by the specified amount. + * Throw an error if it exceeds `maxExpand`. + */ + countExpansion(e) { + if (this.expansionCount += e, this.expansionCount > this.settings.maxExpand) + throw new ParseError("Too many expansions: infinite loop or need to increase maxExpand setting"); + } + /** + * Expand the next token only once if possible. + * + * If the token is expanded, the resulting tokens will be pushed onto + * the stack in reverse order, and the number of such tokens will be + * returned. This number might be zero or positive. + * + * If not, the return value is `false`, and the next token remains at the + * top of the stack. + * + * In either case, the next token will be on the top of the stack, + * or the stack will be empty (in case of empty expansion + * and no other tokens). + * + * Used to implement `expandAfterFuture` and `expandNextToken`. + * + * If expandableOnly, only expandable tokens are expanded and + * an undefined control sequence results in an error. + */ + expandOnce(e) { + var r = this.popToken(), o = r.text, m = r.noexpand ? null : this._getExpansion(o); + if (m == null || e && m.unexpandable) { + if (e && m == null && o[0] === "\\" && !this.isDefined(o)) + throw new ParseError("Undefined control sequence: " + o); + return this.pushToken(r), !1; + } + this.countExpansion(1); + var _ = m.tokens, g = this.consumeArgs(m.numArgs, m.delimiters); + if (m.numArgs) { + _ = _.slice(); + for (var y = _.length - 1; y >= 0; --y) { + var E = _[y]; + if (E.text === "#") { + if (y === 0) + throw new ParseError("Incomplete placeholder at end of macro body", E); + if (E = _[--y], E.text === "#") + _.splice(y + 1, 1); + else if (/^[1-9]$/.test(E.text)) + _.splice(y, 2, ...g[+E.text - 1]); + else + throw new ParseError("Not a valid argument number", E); + } + } + } + return this.pushTokens(_), _.length; + } + /** + * Expand the next token only once (if possible), and return the resulting + * top token on the stack (without removing anything from the stack). + * Similar in behavior to TeX's `\expandafter\futurelet`. + * Equivalent to expandOnce() followed by future(). + */ + expandAfterFuture() { + return this.expandOnce(), this.future(); + } + /** + * Recursively expand first token, then return first non-expandable token. + */ + expandNextToken() { + for (; ; ) + if (this.expandOnce() === !1) { + var e = this.stack.pop(); + return e.treatAsRelax && (e.text = "\\relax"), e; + } + throw new Error(); + } + /** + * Fully expand the given macro name and return the resulting list of + * tokens, or return `undefined` if no such macro is defined. + */ + expandMacro(e) { + return this.macros.has(e) ? this.expandTokens([new Token$1(e)]) : void 0; + } + /** + * Fully expand the given token stream and return the resulting list of + * tokens. Note that the input tokens are in reverse order, but the + * output tokens are in forward order. + */ + expandTokens(e) { + var r = [], o = this.stack.length; + for (this.pushTokens(e); this.stack.length > o; ) + if (this.expandOnce(!0) === !1) { + var m = this.stack.pop(); + m.treatAsRelax && (m.noexpand = !1, m.treatAsRelax = !1), r.push(m); + } + return this.countExpansion(r.length), r; + } + /** + * Fully expand the given macro name and return the result as a string, + * or return `undefined` if no such macro is defined. + */ + expandMacroAsText(e) { + var r = this.expandMacro(e); + return r && r.map((o) => o.text).join(""); + } + /** + * Returns the expanded macro as a reversed array of tokens and a macro + * argument count. Or returns `null` if no such macro. + */ + _getExpansion(e) { + var r = this.macros.get(e); + if (r == null) + return r; + if (e.length === 1) { + var o = this.lexer.catcodes[e]; + if (o != null && o !== 13) + return; + } + var m = typeof r == "function" ? r(this) : r; + if (typeof m == "string") { + var _ = 0; + if (m.indexOf("#") !== -1) + for (var g = m.replace(/##/g, ""); g.indexOf("#" + (_ + 1)) !== -1; ) + ++_; + for (var y = new Lexer(m, this.settings), E = [], x = y.lex(); x.text !== "EOF"; ) + E.push(x), x = y.lex(); + E.reverse(); + var v = { + tokens: E, + numArgs: _ + }; + return v; + } + return m; + } + /** + * Determine whether a command is currently "defined" (has some + * functionality), meaning that it's a macro (in the current group), + * a function, a symbol, or one of the special commands listed in + * `implicitCommands`. + */ + isDefined(e) { + return this.macros.has(e) || functions.hasOwnProperty(e) || symbols.math.hasOwnProperty(e) || symbols.text.hasOwnProperty(e) || implicitCommands.hasOwnProperty(e); + } + /** + * Determine whether a command is expandable. + */ + isExpandable(e) { + var r = this.macros.get(e); + return r != null ? typeof r == "string" || typeof r == "function" || !r.unexpandable : functions.hasOwnProperty(e) && !functions[e].primitive; + } +} +var unicodeSubRegEx = /^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/, uSubsAndSups = Object.freeze({ + "₊": "+", + "₋": "-", + "₌": "=", + "₍": "(", + "₎": ")", + "₀": "0", + "₁": "1", + "₂": "2", + "₃": "3", + "₄": "4", + "₅": "5", + "₆": "6", + "₇": "7", + "₈": "8", + "₉": "9", + "ₐ": "a", + "ₑ": "e", + "ₕ": "h", + "ᵢ": "i", + "ⱼ": "j", + "ₖ": "k", + "ₗ": "l", + "ₘ": "m", + "ₙ": "n", + "ₒ": "o", + "ₚ": "p", + "ᵣ": "r", + "ₛ": "s", + "ₜ": "t", + "ᵤ": "u", + "ᵥ": "v", + "ₓ": "x", + "ᵦ": "β", + "ᵧ": "γ", + "ᵨ": "ρ", + "ᵩ": "ϕ", + "ᵪ": "χ", + "⁺": "+", + "⁻": "-", + "⁼": "=", + "⁽": "(", + "⁾": ")", + "⁰": "0", + "¹": "1", + "²": "2", + "³": "3", + "⁴": "4", + "⁵": "5", + "⁶": "6", + "⁷": "7", + "⁸": "8", + "⁹": "9", + "ᴬ": "A", + "ᴮ": "B", + "ᴰ": "D", + "ᴱ": "E", + "ᴳ": "G", + "ᴴ": "H", + "ᴵ": "I", + "ᴶ": "J", + "ᴷ": "K", + "ᴸ": "L", + "ᴹ": "M", + "ᴺ": "N", + "ᴼ": "O", + "ᴾ": "P", + "ᴿ": "R", + "ᵀ": "T", + "ᵁ": "U", + "ⱽ": "V", + "ᵂ": "W", + "ᵃ": "a", + "ᵇ": "b", + "ᶜ": "c", + "ᵈ": "d", + "ᵉ": "e", + "ᶠ": "f", + "ᵍ": "g", + ʰ: "h", + "ⁱ": "i", + ʲ: "j", + "ᵏ": "k", + ˡ: "l", + "ᵐ": "m", + ⁿ: "n", + "ᵒ": "o", + "ᵖ": "p", + ʳ: "r", + ˢ: "s", + "ᵗ": "t", + "ᵘ": "u", + "ᵛ": "v", + ʷ: "w", + ˣ: "x", + ʸ: "y", + "ᶻ": "z", + "ᵝ": "β", + "ᵞ": "γ", + "ᵟ": "δ", + "ᵠ": "ϕ", + "ᵡ": "χ", + "ᶿ": "θ" +}), unicodeAccents = { + "́": { + text: "\\'", + math: "\\acute" + }, + "̀": { + text: "\\`", + math: "\\grave" + }, + "̈": { + text: '\\"', + math: "\\ddot" + }, + "̃": { + text: "\\~", + math: "\\tilde" + }, + "̄": { + text: "\\=", + math: "\\bar" + }, + "̆": { + text: "\\u", + math: "\\breve" + }, + "̌": { + text: "\\v", + math: "\\check" + }, + "̂": { + text: "\\^", + math: "\\hat" + }, + "̇": { + text: "\\.", + math: "\\dot" + }, + "̊": { + text: "\\r", + math: "\\mathring" + }, + "̋": { + text: "\\H" + }, + "̧": { + text: "\\c" + } +}, unicodeSymbols = { + á: "á", + à: "à", + ä: "ä", + ǟ: "ǟ", + ã: "ã", + ā: "ā", + ă: "ă", + ắ: "ắ", + ằ: "ằ", + ẵ: "ẵ", + ǎ: "ǎ", + â: "â", + ấ: "ấ", + ầ: "ầ", + ẫ: "ẫ", + ȧ: "ȧ", + ǡ: "ǡ", + å: "å", + ǻ: "ǻ", + ḃ: "ḃ", + ć: "ć", + ḉ: "ḉ", + č: "č", + ĉ: "ĉ", + ċ: "ċ", + ç: "ç", + ď: "ď", + ḋ: "ḋ", + ḑ: "ḑ", + é: "é", + è: "è", + ë: "ë", + ẽ: "ẽ", + ē: "ē", + ḗ: "ḗ", + ḕ: "ḕ", + ĕ: "ĕ", + ḝ: "ḝ", + ě: "ě", + ê: "ê", + ế: "ế", + ề: "ề", + ễ: "ễ", + ė: "ė", + ȩ: "ȩ", + ḟ: "ḟ", + ǵ: "ǵ", + ḡ: "ḡ", + ğ: "ğ", + ǧ: "ǧ", + ĝ: "ĝ", + ġ: "ġ", + ģ: "ģ", + ḧ: "ḧ", + ȟ: "ȟ", + ĥ: "ĥ", + ḣ: "ḣ", + ḩ: "ḩ", + í: "í", + ì: "ì", + ï: "ï", + ḯ: "ḯ", + ĩ: "ĩ", + ī: "ī", + ĭ: "ĭ", + ǐ: "ǐ", + î: "î", + ǰ: "ǰ", + ĵ: "ĵ", + ḱ: "ḱ", + ǩ: "ǩ", + ķ: "ķ", + ĺ: "ĺ", + ľ: "ľ", + ļ: "ļ", + ḿ: "ḿ", + ṁ: "ṁ", + ń: "ń", + ǹ: "ǹ", + ñ: "ñ", + ň: "ň", + ṅ: "ṅ", + ņ: "ņ", + ó: "ó", + ò: "ò", + ö: "ö", + ȫ: "ȫ", + õ: "õ", + ṍ: "ṍ", + ṏ: "ṏ", + ȭ: "ȭ", + ō: "ō", + ṓ: "ṓ", + ṑ: "ṑ", + ŏ: "ŏ", + ǒ: "ǒ", + ô: "ô", + ố: "ố", + ồ: "ồ", + ỗ: "ỗ", + ȯ: "ȯ", + ȱ: "ȱ", + ő: "ő", + ṕ: "ṕ", + ṗ: "ṗ", + ŕ: "ŕ", + ř: "ř", + ṙ: "ṙ", + ŗ: "ŗ", + ś: "ś", + ṥ: "ṥ", + š: "š", + ṧ: "ṧ", + ŝ: "ŝ", + ṡ: "ṡ", + ş: "ş", + ẗ: "ẗ", + ť: "ť", + ṫ: "ṫ", + ţ: "ţ", + ú: "ú", + ù: "ù", + ü: "ü", + ǘ: "ǘ", + ǜ: "ǜ", + ǖ: "ǖ", + ǚ: "ǚ", + ũ: "ũ", + ṹ: "ṹ", + ū: "ū", + ṻ: "ṻ", + ŭ: "ŭ", + ǔ: "ǔ", + û: "û", + ů: "ů", + ű: "ű", + ṽ: "ṽ", + ẃ: "ẃ", + ẁ: "ẁ", + ẅ: "ẅ", + ŵ: "ŵ", + ẇ: "ẇ", + ẘ: "ẘ", + ẍ: "ẍ", + ẋ: "ẋ", + ý: "ý", + ỳ: "ỳ", + ÿ: "ÿ", + ỹ: "ỹ", + ȳ: "ȳ", + ŷ: "ŷ", + ẏ: "ẏ", + ẙ: "ẙ", + ź: "ź", + ž: "ž", + ẑ: "ẑ", + ż: "ż", + Á: "Á", + À: "À", + Ä: "Ä", + Ǟ: "Ǟ", + Ã: "Ã", + Ā: "Ā", + Ă: "Ă", + Ắ: "Ắ", + Ằ: "Ằ", + Ẵ: "Ẵ", + Ǎ: "Ǎ", + Â: "Â", + Ấ: "Ấ", + Ầ: "Ầ", + Ẫ: "Ẫ", + Ȧ: "Ȧ", + Ǡ: "Ǡ", + Å: "Å", + Ǻ: "Ǻ", + Ḃ: "Ḃ", + Ć: "Ć", + Ḉ: "Ḉ", + Č: "Č", + Ĉ: "Ĉ", + Ċ: "Ċ", + Ç: "Ç", + Ď: "Ď", + Ḋ: "Ḋ", + Ḑ: "Ḑ", + É: "É", + È: "È", + Ë: "Ë", + Ẽ: "Ẽ", + Ē: "Ē", + Ḗ: "Ḗ", + Ḕ: "Ḕ", + Ĕ: "Ĕ", + Ḝ: "Ḝ", + Ě: "Ě", + Ê: "Ê", + Ế: "Ế", + Ề: "Ề", + Ễ: "Ễ", + Ė: "Ė", + Ȩ: "Ȩ", + Ḟ: "Ḟ", + Ǵ: "Ǵ", + Ḡ: "Ḡ", + Ğ: "Ğ", + Ǧ: "Ǧ", + Ĝ: "Ĝ", + Ġ: "Ġ", + Ģ: "Ģ", + Ḧ: "Ḧ", + Ȟ: "Ȟ", + Ĥ: "Ĥ", + Ḣ: "Ḣ", + Ḩ: "Ḩ", + Í: "Í", + Ì: "Ì", + Ï: "Ï", + Ḯ: "Ḯ", + Ĩ: "Ĩ", + Ī: "Ī", + Ĭ: "Ĭ", + Ǐ: "Ǐ", + Î: "Î", + İ: "İ", + Ĵ: "Ĵ", + Ḱ: "Ḱ", + Ǩ: "Ǩ", + Ķ: "Ķ", + Ĺ: "Ĺ", + Ľ: "Ľ", + Ļ: "Ļ", + Ḿ: "Ḿ", + Ṁ: "Ṁ", + Ń: "Ń", + Ǹ: "Ǹ", + Ñ: "Ñ", + Ň: "Ň", + Ṅ: "Ṅ", + Ņ: "Ņ", + Ó: "Ó", + Ò: "Ò", + Ö: "Ö", + Ȫ: "Ȫ", + Õ: "Õ", + Ṍ: "Ṍ", + Ṏ: "Ṏ", + Ȭ: "Ȭ", + Ō: "Ō", + Ṓ: "Ṓ", + Ṑ: "Ṑ", + Ŏ: "Ŏ", + Ǒ: "Ǒ", + Ô: "Ô", + Ố: "Ố", + Ồ: "Ồ", + Ỗ: "Ỗ", + Ȯ: "Ȯ", + Ȱ: "Ȱ", + Ő: "Ő", + Ṕ: "Ṕ", + Ṗ: "Ṗ", + Ŕ: "Ŕ", + Ř: "Ř", + Ṙ: "Ṙ", + Ŗ: "Ŗ", + Ś: "Ś", + Ṥ: "Ṥ", + Š: "Š", + Ṧ: "Ṧ", + Ŝ: "Ŝ", + Ṡ: "Ṡ", + Ş: "Ş", + Ť: "Ť", + Ṫ: "Ṫ", + Ţ: "Ţ", + Ú: "Ú", + Ù: "Ù", + Ü: "Ü", + Ǘ: "Ǘ", + Ǜ: "Ǜ", + Ǖ: "Ǖ", + Ǚ: "Ǚ", + Ũ: "Ũ", + Ṹ: "Ṹ", + Ū: "Ū", + Ṻ: "Ṻ", + Ŭ: "Ŭ", + Ǔ: "Ǔ", + Û: "Û", + Ů: "Ů", + Ű: "Ű", + Ṽ: "Ṽ", + Ẃ: "Ẃ", + Ẁ: "Ẁ", + Ẅ: "Ẅ", + Ŵ: "Ŵ", + Ẇ: "Ẇ", + Ẍ: "Ẍ", + Ẋ: "Ẋ", + Ý: "Ý", + Ỳ: "Ỳ", + Ÿ: "Ÿ", + Ỹ: "Ỹ", + Ȳ: "Ȳ", + Ŷ: "Ŷ", + Ẏ: "Ẏ", + Ź: "Ź", + Ž: "Ž", + Ẑ: "Ẑ", + Ż: "Ż", + ά: "ά", + ὰ: "ὰ", + ᾱ: "ᾱ", + ᾰ: "ᾰ", + έ: "έ", + ὲ: "ὲ", + ή: "ή", + ὴ: "ὴ", + ί: "ί", + ὶ: "ὶ", + ϊ: "ϊ", + ΐ: "ΐ", + ῒ: "ῒ", + ῑ: "ῑ", + ῐ: "ῐ", + ό: "ό", + ὸ: "ὸ", + ύ: "ύ", + ὺ: "ὺ", + ϋ: "ϋ", + ΰ: "ΰ", + ῢ: "ῢ", + ῡ: "ῡ", + ῠ: "ῠ", + ώ: "ώ", + ὼ: "ὼ", + Ύ: "Ύ", + Ὺ: "Ὺ", + Ϋ: "Ϋ", + Ῡ: "Ῡ", + Ῠ: "Ῠ", + Ώ: "Ώ", + Ὼ: "Ὼ" +}; +class Parser { + constructor(e, r) { + 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 MacroExpander(e, r, this.mode), this.settings = r, this.leftrightDepth = 0; + } + /** + * Checks a result to make sure it has the right type, and throws an + * appropriate error otherwise. + */ + expect(e, r) { + if (r === void 0 && (r = !0), this.fetch().text !== e) + throw new ParseError("Expected '" + e + "', got '" + this.fetch().text + "'", this.fetch()); + r && this.consume(); + } + /** + * Discards the current lookahead token, considering it consumed. + */ + consume() { + this.nextToken = null; + } + /** + * Return the current lookahead token, or if there isn't one (at the + * beginning, or if the previous lookahead token was consume()d), + * fetch the next token as the new lookahead token and return it. + */ + fetch() { + return this.nextToken == null && (this.nextToken = this.gullet.expandNextToken()), this.nextToken; + } + /** + * Switches between "text" and "math" modes. + */ + switchMode(e) { + this.mode = e, this.gullet.switchMode(e); + } + /** + * Main parsing function, which parses an entire input. + */ + 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(); + } + } + /** + * Fully parse a separate sequence of tokens as a separate job. + * Tokens should be specified in reverse order, as in a MacroDefinition. + */ + subparse(e) { + var r = this.nextToken; + this.consume(), this.gullet.pushToken(new Token$1("}")), this.gullet.pushTokens(e); + var o = this.parseExpression(!1); + return this.expect("}"), this.nextToken = r, o; + } + /** + * Parses an "expression", which is a list of atoms. + * + * `breakOnInfix`: Should the parsing stop when we hit infix nodes? This + * happens when functions have higher precedence han infix + * nodes in implicit parses. + * + * `breakOnTokenText`: The text of the token that the expression should end + * with, or `null` if something else should end the + * expression. + */ + parseExpression(e, r) { + for (var o = []; ; ) { + this.mode === "math" && this.consumeSpaces(); + var m = this.fetch(); + if (Parser.endOfExpression.indexOf(m.text) !== -1 || r && m.text === r || e && functions[m.text] && functions[m.text].infix) + break; + var _ = this.parseAtom(r); + if (_) { + if (_.type === "internal") + continue; + } else break; + o.push(_); + } + return this.mode === "text" && this.formLigatures(o), this.handleInfixNodes(o); + } + /** + * Rewrites infix operators such as \over with corresponding commands such + * as \frac. + * + * There can only be one infix operator per group. If there's more than one + * then the expression is ambiguous. This can be resolved by adding {}. + */ + handleInfixNodes(e) { + for (var r = -1, o, m = 0; m < e.length; m++) + if (e[m].type === "infix") { + if (r !== -1) + throw new ParseError("only one infix operator per group", e[m].token); + r = m, o = e[m].replaceWith; + } + if (r !== -1 && o) { + var _, g, y = e.slice(0, r), E = e.slice(r + 1); + y.length === 1 && y[0].type === "ordgroup" ? _ = y[0] : _ = { + type: "ordgroup", + mode: this.mode, + body: y + }, E.length === 1 && E[0].type === "ordgroup" ? g = E[0] : g = { + type: "ordgroup", + mode: this.mode, + body: E + }; + var x; + return o === "\\\\abovefrac" ? x = this.callFunction(o, [_, e[r], g], []) : x = this.callFunction(o, [_, g], []), [x]; + } else + return e; + } + /** + * Handle a subscript or superscript with nice errors. + */ + handleSupSubscript(e) { + var r = this.fetch(), o = r.text; + this.consume(), this.consumeSpaces(); + var m; + do { + var _; + m = this.parseGroup(e); + } while (((_ = m) == null ? void 0 : _.type) === "internal"); + if (!m) + throw new ParseError("Expected group after '" + o + "'", r); + return m; + } + /** + * Converts the textual input of an unsupported command into a text node + * contained within a color node whose color is determined by errorColor + */ + formatUnsupportedCmd(e) { + for (var r = [], o = 0; o < e.length; o++) + r.push({ + type: "textord", + mode: "text", + text: e[o] + }); + var m = { + type: "text", + mode: this.mode, + body: r + }, _ = { + type: "color", + mode: this.mode, + color: this.settings.errorColor, + body: [m] + }; + return _; + } + /** + * Parses a group with optional super/subscripts. + */ + parseAtom(e) { + var r = this.parseGroup("atom", e); + if ((r == null ? void 0 : r.type) === "internal" || this.mode === "text") + return r; + for (var o, m; ; ) { + this.consumeSpaces(); + var _ = this.fetch(); + if (_.text === "\\limits" || _.text === "\\nolimits") { + if (r && r.type === "op") { + var g = _.text === "\\limits"; + r.limits = g, r.alwaysHandleSupSub = !0; + } else if (r && r.type === "operatorname") + r.alwaysHandleSupSub && (r.limits = _.text === "\\limits"); + else + throw new ParseError("Limit controls must follow a math operator", _); + this.consume(); + } else if (_.text === "^") { + if (o) + throw new ParseError("Double superscript", _); + o = this.handleSupSubscript("superscript"); + } else if (_.text === "_") { + if (m) + throw new ParseError("Double subscript", _); + m = this.handleSupSubscript("subscript"); + } else if (_.text === "'") { + if (o) + throw new ParseError("Double superscript", _); + var y = { + type: "textord", + mode: this.mode, + text: "\\prime" + }, E = [y]; + for (this.consume(); this.fetch().text === "'"; ) + E.push(y), this.consume(); + this.fetch().text === "^" && E.push(this.handleSupSubscript("superscript")), o = { + type: "ordgroup", + mode: this.mode, + body: E + }; + } else if (uSubsAndSups[_.text]) { + var x = unicodeSubRegEx.test(_.text), v = []; + for (v.push(new Token$1(uSubsAndSups[_.text])), this.consume(); ; ) { + var h = this.fetch().text; + if (!uSubsAndSups[h] || unicodeSubRegEx.test(h) !== x) + break; + v.unshift(new Token$1(uSubsAndSups[h])), this.consume(); + } + var a = this.subparse(v); + x ? m = { + type: "ordgroup", + mode: "math", + body: a + } : o = { + type: "ordgroup", + mode: "math", + body: a + }; + } else + break; + } + return o || m ? { + type: "supsub", + mode: this.mode, + base: r, + sup: o, + sub: m + } : r; + } + /** + * Parses an entire function, including its base and all of its arguments. + */ + parseFunction(e, r) { + var o = this.fetch(), m = o.text, _ = functions[m]; + if (!_) + return null; + if (this.consume(), r && r !== "atom" && !_.allowedInArgument) + throw new ParseError("Got function '" + m + "' with no arguments" + (r ? " as " + r : ""), o); + if (this.mode === "text" && !_.allowedInText) + throw new ParseError("Can't use function '" + m + "' in text mode", o); + if (this.mode === "math" && _.allowedInMath === !1) + throw new ParseError("Can't use function '" + m + "' in math mode", o); + var { + args: g, + optArgs: y + } = this.parseArguments(m, _); + return this.callFunction(m, g, y, o, e); + } + /** + * Call a function handler with a suitable context and arguments. + */ + callFunction(e, r, o, m, _) { + var g = { + funcName: e, + parser: this, + token: m, + breakOnTokenText: _ + }, y = functions[e]; + if (y && y.handler) + return y.handler(g, r, o); + throw new ParseError("No function handler for " + e); + } + /** + * Parses the arguments of a function or environment + */ + parseArguments(e, r) { + var o = r.numArgs + r.numOptionalArgs; + if (o === 0) + return { + args: [], + optArgs: [] + }; + for (var m = [], _ = [], g = 0; g < o; g++) { + var y = r.argTypes && r.argTypes[g], E = g < r.numOptionalArgs; + (r.primitive && y == null || // \sqrt expands into primitive if optional argument doesn't exist + r.type === "sqrt" && g === 1 && _[0] == null) && (y = "primitive"); + var x = this.parseGroupOfType("argument to '" + e + "'", y, E); + if (E) + _.push(x); + else if (x != null) + m.push(x); + else + throw new ParseError("Null argument, please report this as a bug"); + } + return { + args: m, + optArgs: _ + }; + } + /** + * Parses a group when the mode is changing. + */ + parseGroupOfType(e, r, o) { + switch (r) { + case "color": + return this.parseColorGroup(o); + case "size": + return this.parseSizeGroup(o); + case "url": + return this.parseUrlGroup(o); + case "math": + case "text": + return this.parseArgumentGroup(o, r); + case "hbox": { + var m = this.parseArgumentGroup(o, "text"); + return m != null ? { + type: "styling", + mode: m.mode, + body: [m], + style: "text" + // simulate \textstyle + } : null; + } + case "raw": { + var _ = this.parseStringGroup("raw", o); + return _ != null ? { + type: "raw", + mode: "text", + string: _.text + } : null; + } + case "primitive": { + if (o) + throw new ParseError("A primitive argument cannot be optional"); + var g = this.parseGroup(e); + if (g == null) + throw new ParseError("Expected group as " + e, this.fetch()); + return g; + } + case "original": + case null: + case void 0: + return this.parseArgumentGroup(o); + default: + throw new ParseError("Unknown group type as " + e, this.fetch()); + } + } + /** + * Discard any space tokens, fetching the next non-space token. + */ + consumeSpaces() { + for (; this.fetch().text === " "; ) + this.consume(); + } + /** + * Parses a group, essentially returning the string formed by the + * brace-enclosed tokens plus some position information. + */ + parseStringGroup(e, r) { + var o = this.gullet.scanArgument(r); + if (o == null) + return null; + for (var m = "", _; (_ = this.fetch()).text !== "EOF"; ) + m += _.text, this.consume(); + return this.consume(), o.text = m, o; + } + /** + * Parses a regex-delimited group: the largest sequence of tokens + * whose concatenated strings match `regex`. Returns the string + * formed by the tokens plus some position information. + */ + parseRegexGroup(e, r) { + for (var o = this.fetch(), m = o, _ = "", g; (g = this.fetch()).text !== "EOF" && e.test(_ + g.text); ) + m = g, _ += m.text, this.consume(); + if (_ === "") + throw new ParseError("Invalid " + r + ": '" + o.text + "'", o); + return o.range(m, _); + } + /** + * Parses a color description. + */ + parseColorGroup(e) { + var r = this.parseStringGroup("color", e); + if (r == null) + return null; + var o = /^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(r.text); + if (!o) + throw new ParseError("Invalid color: '" + r.text + "'", r); + var m = o[0]; + return /^[0-9a-f]{6}$/i.test(m) && (m = "#" + m), { + type: "color-token", + mode: this.mode, + color: m + }; + } + /** + * Parses a size specification, consisting of magnitude and unit. + */ + parseSizeGroup(e) { + var r, o = !1; + if (this.gullet.consumeSpaces(), !e && this.gullet.future().text !== "{" ? r = this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/, "size") : r = this.parseStringGroup("size", e), !r) + return null; + !e && r.text.length === 0 && (r.text = "0pt", o = !0); + var m = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(r.text); + if (!m) + throw new ParseError("Invalid size: '" + r.text + "'", r); + var _ = { + number: +(m[1] + m[2]), + // sign + magnitude, cast to number + unit: m[3] + }; + if (!validUnit(_)) + throw new ParseError("Invalid unit: '" + _.unit + "'", r); + return { + type: "size", + mode: this.mode, + value: _, + isBlank: o + }; + } + /** + * Parses an URL, checking escaped letters and allowed protocols, + * and setting the catcode of % as an active character (as in \hyperref). + */ + parseUrlGroup(e) { + this.gullet.lexer.setCatcode("%", 13), this.gullet.lexer.setCatcode("~", 12); + var r = this.parseStringGroup("url", e); + if (this.gullet.lexer.setCatcode("%", 14), this.gullet.lexer.setCatcode("~", 13), r == null) + return null; + var o = r.text.replace(/\\([#$%&~_^{}])/g, "$1"); + return { + type: "url", + mode: this.mode, + url: o + }; + } + /** + * Parses an argument with the mode specified. + */ + parseArgumentGroup(e, r) { + var o = this.gullet.scanArgument(e); + if (o == null) + return null; + var m = this.mode; + r && this.switchMode(r), this.gullet.beginGroup(); + var _ = this.parseExpression(!1, "EOF"); + this.expect("EOF"), this.gullet.endGroup(); + var g = { + type: "ordgroup", + mode: this.mode, + loc: o.loc, + body: _ + }; + return r && this.switchMode(m), g; + } + /** + * Parses an ordinary group, which is either a single nucleus (like "x") + * or an expression in braces (like "{x+y}") or an implicit group, a group + * that starts at the current position, and ends right before a higher explicit + * group ends, or at EOF. + */ + parseGroup(e, r) { + var o = this.fetch(), m = o.text, _; + if (m === "{" || m === "\\begingroup") { + this.consume(); + var g = m === "{" ? "}" : "\\endgroup"; + this.gullet.beginGroup(); + var y = this.parseExpression(!1, g), E = this.fetch(); + this.expect(g), this.gullet.endGroup(), _ = { + type: "ordgroup", + mode: this.mode, + loc: SourceLocation.range(o, E), + body: y, + // A group formed by \begingroup...\endgroup is a semi-simple group + // which doesn't affect spacing in math mode, i.e., is transparent. + // https://tex.stackexchange.com/questions/1930/when-should-one- + // use-begingroup-instead-of-bgroup + semisimple: m === "\\begingroup" || void 0 + }; + } else if (_ = this.parseFunction(r, e) || this.parseSymbol(), _ == null && m[0] === "\\" && !implicitCommands.hasOwnProperty(m)) { + if (this.settings.throwOnError) + throw new ParseError("Undefined control sequence: " + m, o); + _ = this.formatUnsupportedCmd(m), this.consume(); + } + return _; + } + /** + * Form ligature-like combinations of characters for text mode. + * This includes inputs like "--", "---", "``" and "''". + * The result will simply replace multiple textord nodes with a single + * character in each value by a single textord node having multiple + * characters in its value. The representation is still ASCII source. + * The group will be modified in place. + */ + formLigatures(e) { + for (var r = e.length - 1, o = 0; o < r; ++o) { + var m = e[o], _ = m.text; + _ === "-" && e[o + 1].text === "-" && (o + 1 < r && e[o + 2].text === "-" ? (e.splice(o, 3, { + type: "textord", + mode: "text", + loc: SourceLocation.range(m, e[o + 2]), + text: "---" + }), r -= 2) : (e.splice(o, 2, { + type: "textord", + mode: "text", + loc: SourceLocation.range(m, e[o + 1]), + text: "--" + }), r -= 1)), (_ === "'" || _ === "`") && e[o + 1].text === _ && (e.splice(o, 2, { + type: "textord", + mode: "text", + loc: SourceLocation.range(m, e[o + 1]), + text: _ + _ + }), r -= 1); + } + } + /** + * Parse a single symbol out of the string. Here, we handle single character + * symbols and special functions like \verb. + */ + parseSymbol() { + var e = this.fetch(), r = e.text; + if (/^\\verb[^a-zA-Z]/.test(r)) { + this.consume(); + var o = r.slice(5), m = o.charAt(0) === "*"; + if (m && (o = o.slice(1)), o.length < 2 || o.charAt(0) !== o.slice(-1)) + throw new ParseError(`\\verb assertion failed -- + please report what input caused this bug`); + return o = o.slice(1, -1), { + type: "verb", + mode: "text", + body: o, + star: m + }; + } + unicodeSymbols.hasOwnProperty(r[0]) && !symbols[this.mode][r[0]] && (this.settings.strict && this.mode === "math" && this.settings.reportNonstrict("unicodeTextInMathMode", 'Accented Unicode text character "' + r[0] + '" used in math mode', e), r = unicodeSymbols[r[0]] + r.slice(1)); + var _ = combiningDiacriticalMarksEndRegex.exec(r); + _ && (r = r.substring(0, _.index), r === "i" ? r = "ı" : r === "j" && (r = "ȷ")); + var g; + if (symbols[this.mode][r]) { + this.settings.strict && this.mode === "math" && extraLatin.indexOf(r) >= 0 && this.settings.reportNonstrict("unicodeTextInMathMode", 'Latin-1/Unicode text character "' + r[0] + '" used in math mode', e); + var y = symbols[this.mode][r].group, E = SourceLocation.range(e), x; + if (ATOMS.hasOwnProperty(y)) { + var v = y; + x = { + type: "atom", + mode: this.mode, + family: v, + loc: E, + text: r + }; + } else + x = { + type: y, + mode: this.mode, + loc: E, + text: r + }; + g = x; + } else if (r.charCodeAt(0) >= 128) + this.settings.strict && (supportedCodepoint(r.charCodeAt(0)) ? this.mode === "math" && this.settings.reportNonstrict("unicodeTextInMathMode", 'Unicode text character "' + r[0] + '" used in math mode', e) : this.settings.reportNonstrict("unknownSymbol", 'Unrecognized Unicode character "' + r[0] + '"' + (" (" + r.charCodeAt(0) + ")"), e)), g = { + type: "textord", + mode: "text", + loc: SourceLocation.range(e), + text: r + }; + else + return null; + if (this.consume(), _) + for (var h = 0; h < _[0].length; h++) { + var a = _[0][h]; + if (!unicodeAccents[a]) + throw new ParseError("Unknown accent ' " + a + "'", e); + var b = unicodeAccents[a][this.mode] || unicodeAccents[a].text; + if (!b) + throw new ParseError("Accent " + a + " unsupported in " + this.mode + " mode", e); + g = { + type: "accent", + mode: this.mode, + loc: SourceLocation.range(e), + label: b, + isStretchy: !1, + isShifty: !0, + // $FlowFixMe + base: g + }; + } + return g; + } +} +Parser.endOfExpression = ["}", "\\endgroup", "\\end", "\\right", "&"]; +var parseTree = function(e, r) { + if (!(typeof e == "string" || e instanceof String)) + throw new TypeError("KaTeX can only parse string typed expression"); + var o = new Parser(e, r); + delete o.gullet.macros.current["\\df@tag"]; + var m = o.parse(); + if (delete o.gullet.macros.current["\\current@color"], delete o.gullet.macros.current["\\color"], o.gullet.macros.get("\\df@tag")) { + if (!r.displayMode) + throw new ParseError("\\tag works only in display equations"); + m = [{ + type: "tag", + mode: "text", + body: m, + tag: o.subparse([new Token$1("\\df@tag")]) + }]; + } + return m; +}, render = function(e, r, o) { + r.textContent = ""; + var m = renderToDomTree(e, o).toNode(); + r.appendChild(m); +}; +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."), render = function() { + throw new ParseError("KaTeX doesn't work in quirks mode."); +}); +var renderToString = function(e, r) { + var o = renderToDomTree(e, r).toMarkup(); + return o; +}, generateParseTree = function(e, r) { + var o = new Settings(r); + return parseTree(e, o); +}, renderError = function(e, r, o) { + if (o.throwOnError || !(e instanceof ParseError)) + throw e; + var m = buildCommon.makeSpan(["katex-error"], [new SymbolNode(r)]); + return m.setAttribute("title", e.toString()), m.setAttribute("style", "color:" + o.errorColor), m; +}, renderToDomTree = function(e, r) { + var o = new Settings(r); + try { + var m = parseTree(e, o); + return buildTree(m, e, o); + } catch (_) { + return renderError(_, e, o); + } +}, renderToHTMLTree = function(e, r) { + var o = new Settings(r); + try { + var m = parseTree(e, o); + return buildHTMLTree(m, e, o); + } catch (_) { + return renderError(_, e, o); + } +}, version = "0.16.22", __domTree = { + Span, + Anchor, + SymbolNode, + SvgNode, + PathNode, + LineNode +}, katex = { + /** + * Current KaTeX version + */ + version, + /** + * Renders the given LaTeX into an HTML+MathML combination, and adds + * it as a child to the specified DOM node. + */ + render, + /** + * Renders the given LaTeX into an HTML+MathML combination string, + * for sending to the client. + */ + renderToString, + /** + * KaTeX error, usually during parsing. + */ + ParseError, + /** + * The schema of Settings + */ + SETTINGS_SCHEMA, + /** + * Parses the given LaTeX into KaTeX's internal parse tree structure, + * without rendering to HTML or MathML. + * + * NOTE: This method is not currently recommended for public use. + * The internal tree representation is unstable and is very likely + * to change. Use at your own risk. + */ + __parse: generateParseTree, + /** + * Renders the given LaTeX into an HTML+MathML internal DOM tree + * representation, without flattening that representation to a string. + * + * NOTE: This method is not currently recommended for public use. + * The internal tree representation is unstable and is very likely + * to change. Use at your own risk. + */ + __renderToDomTree: renderToDomTree, + /** + * Renders the given LaTeX into an HTML internal DOM tree representation, + * without MathML and without flattening that representation to a string. + * + * NOTE: This method is not currently recommended for public use. + * The internal tree representation is unstable and is very likely + * to change. Use at your own risk. + */ + __renderToHTMLTree: renderToHTMLTree, + /** + * extends internal font metrics object with a new object + * each key in the new object represents a font name + */ + __setFontMetrics: setFontMetrics, + /** + * adds a new symbol to builtin symbols table + */ + __defineSymbol: defineSymbol, + /** + * adds a new function to builtin function list, + * which directly produce parse tree elements + * and have their own html/mathml builders + */ + __defineFunction: defineFunction, + /** + * adds a new macro to builtin macro list + */ + __defineMacro: defineMacro, + /** + * Expose the dom tree node types, which can be useful for type checking nodes. + * + * NOTE: These methods are not currently recommended for public use. + * The internal tree representation is unstable and is very likely + * to change. Use at your own risk. + */ + __domTree +}; +const katex$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + ParseError, + SETTINGS_SCHEMA, + __defineFunction: defineFunction, + __defineMacro: defineMacro, + __defineSymbol: defineSymbol, + __domTree, + __parse: generateParseTree, + __renderToDomTree: renderToDomTree, + __renderToHTMLTree: renderToHTMLTree, + __setFontMetrics: setFontMetrics, + default: katex, + get render() { + return render; + }, + renderToString, + version +}, Symbol.toStringTag, { value: "Module" })); +var findEndOfMath = function(e, r, o) { + for (var m = o, _ = 0, g = e.length; m < r.length; ) { + var y = r[m]; + if (_ <= 0 && r.slice(m, m + g) === e) + return m; + y === "\\" ? m++ : y === "{" ? _++ : y === "}" && _--, m++; + } + return -1; +}, escapeRegex = function(e) { + return e.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"); +}, amsRegex = /^\\begin{/, splitAtDelimiters = function(e, r) { + for (var o, m = [], _ = new RegExp("(" + r.map((x) => escapeRegex(x.left)).join("|") + ")"); o = e.search(_), o !== -1; ) { + o > 0 && (m.push({ + type: "text", + data: e.slice(0, o) + }), e = e.slice(o)); + var g = r.findIndex((x) => e.startsWith(x.left)); + if (o = findEndOfMath(r[g].right, e, r[g].left.length), o === -1) + break; + var y = e.slice(0, o + r[g].right.length), E = amsRegex.test(y) ? y : e.slice(r[g].left.length, o); + m.push({ + type: "math", + data: E, + rawData: y, + display: r[g].display + }), e = e.slice(o + r[g].right.length); + } + return e !== "" && m.push({ + type: "text", + data: e + }), m; +}, renderMathInText = function(e, r) { + var o = splitAtDelimiters(e, r.delimiters); + if (o.length === 1 && o[0].type === "text") + return null; + for (var m = document.createDocumentFragment(), _ = 0; _ < o.length; _++) + if (o[_].type === "text") + m.appendChild(document.createTextNode(o[_].data)); + else { + var g = document.createElement("span"), y = o[_].data; + r.displayMode = o[_].display; + try { + r.preProcess && (y = r.preProcess(y)), katex.render(y, g, r); + } catch (E) { + if (!(E instanceof katex.ParseError)) + throw E; + r.errorCallback("KaTeX auto-render: Failed to parse `" + o[_].data + "` with ", E), m.appendChild(document.createTextNode(o[_].rawData)); + continue; + } + m.appendChild(g); + } + return m; +}, renderElem = function s(e, r) { + for (var o = 0; o < e.childNodes.length; o++) { + var m = e.childNodes[o]; + if (m.nodeType === 3) { + for (var _ = m.textContent, g = m.nextSibling, y = 0; g && g.nodeType === Node.TEXT_NODE; ) + _ += g.textContent, g = g.nextSibling, y++; + var E = renderMathInText(_, r); + if (E) { + for (var x = 0; x < y; x++) + m.nextSibling.remove(); + o += E.childNodes.length - 1, e.replaceChild(E, m); + } else + o += y; + } else m.nodeType === 1 && function() { + var v = " " + m.className + " ", h = r.ignoredTags.indexOf(m.nodeName.toLowerCase()) === -1 && r.ignoredClasses.every((a) => v.indexOf(" " + a + " ") === -1); + h && s(m, r); + }(); + } +}, renderMathInElement = function(e, r) { + if (!e) + throw new Error("No element provided to render"); + var o = {}; + for (var m in r) + r.hasOwnProperty(m) && (o[m] = r[m]); + o.delimiters = o.delimiters || [ + { + left: "$$", + right: "$$", + display: !0 + }, + { + left: "\\(", + right: "\\)", + display: !1 + }, + // LaTeX uses $…$, but it ruins the display of normal `$` in text: + // {left: "$", right: "$", display: false}, + // $ must come after $$ + // Render AMS environments even if outside $$…$$ delimiters. + { + 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 + } + ], o.ignoredTags = o.ignoredTags || ["script", "noscript", "style", "textarea", "pre", "code", "option"], o.ignoredClasses = o.ignoredClasses || [], o.errorCallback = o.errorCallback || console.error, o.macros = o.macros || {}, renderElem(e, o); +}; +function _getDefaults() { + return { + async: !1, + breaks: !1, + extensions: null, + gfm: !0, + hooks: null, + pedantic: !1, + renderer: null, + silent: !1, + tokenizer: null, + walkTokens: null + }; +} +let _defaults = _getDefaults(); +function changeDefaults(s) { + _defaults = s; +} +const escapeTest$1 = /[&<>"']/, escapeReplace$1 = new RegExp(escapeTest$1.source, "g"), escapeTestNoEncode$1 = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode$1 = new RegExp(escapeTestNoEncode$1.source, "g"), escapeReplacements$1 = { + "&": "&", + "<": "<", + ">": ">", + '"': """, + "'": "'" +}, getEscapeReplacement$1 = (s) => escapeReplacements$1[s]; +function escape$1$1(s, e) { + if (e) { + if (escapeTest$1.test(s)) + return s.replace(escapeReplace$1, getEscapeReplacement$1); + } else if (escapeTestNoEncode$1.test(s)) + return s.replace(escapeReplaceNoEncode$1, getEscapeReplacement$1); + return s; +} +const unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig; +function unescape(s) { + return s.replace(unescapeTest, (e, r) => (r = r.toLowerCase(), r === "colon" ? ":" : r.charAt(0) === "#" ? r.charAt(1) === "x" ? String.fromCharCode(parseInt(r.substring(2), 16)) : String.fromCharCode(+r.substring(1)) : "")); +} +const caret = /(^|[^\[])\^/g; +function edit(s, e) { + let r = typeof s == "string" ? s : s.source; + e = e || ""; + const o = { + replace: (m, _) => { + let g = typeof _ == "string" ? _ : _.source; + return g = g.replace(caret, "$1"), r = r.replace(m, g), o; + }, + getRegex: () => new RegExp(r, e) + }; + return o; +} +function cleanUrl(s) { + try { + s = encodeURI(s).replace(/%25/g, "%"); + } catch { + return null; + } + return s; +} +const noopTest = { exec: () => null }; +function splitCells(s, e) { + const r = s.replace(/\|/g, (_, g, y) => { + let E = !1, x = g; + for (; --x >= 0 && y[x] === "\\"; ) + E = !E; + return E ? "|" : " |"; + }), o = r.split(/ \|/); + let m = 0; + if (o[0].trim() || o.shift(), o.length > 0 && !o[o.length - 1].trim() && o.pop(), e) + if (o.length > e) + o.splice(e); + else + for (; o.length < e; ) + o.push(""); + for (; m < o.length; m++) + o[m] = o[m].trim().replace(/\\\|/g, "|"); + return o; +} +function rtrim(s, e, r) { + const o = s.length; + if (o === 0) + return ""; + let m = 0; + for (; m < o && s.charAt(o - m - 1) === e; ) + m++; + return s.slice(0, o - m); +} +function findClosingBracket(s, e) { + if (s.indexOf(e[1]) === -1) + return -1; + let r = 0; + for (let o = 0; o < s.length; o++) + if (s[o] === "\\") + o++; + else if (s[o] === e[0]) + r++; + else if (s[o] === e[1] && (r--, r < 0)) + return o; + return -1; +} +function outputLink(s, e, r, o) { + const m = e.href, _ = e.title ? escape$1$1(e.title) : null, g = s[1].replace(/\\([\[\]])/g, "$1"); + if (s[0].charAt(0) !== "!") { + o.state.inLink = !0; + const y = { + type: "link", + raw: r, + href: m, + title: _, + text: g, + tokens: o.inlineTokens(g) + }; + return o.state.inLink = !1, y; + } + return { + type: "image", + raw: r, + href: m, + title: _, + text: escape$1$1(g) + }; +} +function indentCodeCompensation(s, e) { + const r = s.match(/^(\s+)(?:```)/); + if (r === null) + return e; + const o = r[1]; + return e.split(` +`).map((m) => { + const _ = m.match(/^\s+/); + if (_ === null) + return m; + const [g] = _; + return g.length >= o.length ? m.slice(o.length) : m; + }).join(` +`); +} +class _Tokenizer { + // set by the lexer + constructor(e) { + be(this, "options"); + be(this, "rules"); + // set by the lexer + be(this, "lexer"); + this.options = e || _defaults; + } + space(e) { + const r = this.rules.block.newline.exec(e); + if (r && r[0].length > 0) + return { + type: "space", + raw: r[0] + }; + } + code(e) { + const r = this.rules.block.code.exec(e); + if (r) { + const o = r[0].replace(/^ {1,4}/gm, ""); + return { + type: "code", + raw: r[0], + codeBlockStyle: "indented", + text: this.options.pedantic ? o : rtrim(o, ` +`) + }; + } + } + fences(e) { + const r = this.rules.block.fences.exec(e); + if (r) { + const o = r[0], m = indentCodeCompensation(o, r[3] || ""); + return { + type: "code", + raw: o, + lang: r[2] ? r[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : r[2], + text: m + }; + } + } + heading(e) { + const r = this.rules.block.heading.exec(e); + if (r) { + let o = r[2].trim(); + if (/#$/.test(o)) { + const m = rtrim(o, "#"); + (this.options.pedantic || !m || / $/.test(m)) && (o = m.trim()); + } + return { + type: "heading", + raw: r[0], + depth: r[1].length, + text: o, + tokens: this.lexer.inline(o) + }; + } + } + hr(e) { + const r = this.rules.block.hr.exec(e); + if (r) + return { + type: "hr", + raw: r[0] + }; + } + blockquote(e) { + const r = this.rules.block.blockquote.exec(e); + if (r) { + let o = r[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g, ` + $1`); + o = rtrim(o.replace(/^ *>[ \t]?/gm, ""), ` +`); + const m = this.lexer.state.top; + this.lexer.state.top = !0; + const _ = this.lexer.blockTokens(o); + return this.lexer.state.top = m, { + type: "blockquote", + raw: r[0], + tokens: _, + text: o + }; + } + } + list(e) { + let r = this.rules.block.list.exec(e); + if (r) { + let o = r[1].trim(); + const m = o.length > 1, _ = { + type: "list", + raw: "", + ordered: m, + start: m ? +o.slice(0, -1) : "", + loose: !1, + items: [] + }; + o = m ? `\\d{1,9}\\${o.slice(-1)}` : `\\${o}`, this.options.pedantic && (o = m ? o : "[*+-]"); + const g = new RegExp(`^( {0,3}${o})((?:[ ][^\\n]*)?(?:\\n|$))`); + let y = "", E = "", x = !1; + for (; e; ) { + let v = !1; + if (!(r = g.exec(e)) || this.rules.block.hr.test(e)) + break; + y = r[0], e = e.substring(y.length); + let h = r[2].split(` +`, 1)[0].replace(/^\t+/, (M) => " ".repeat(3 * M.length)), a = e.split(` +`, 1)[0], b = 0; + this.options.pedantic ? (b = 2, E = h.trimStart()) : (b = r[2].search(/[^ ]/), b = b > 4 ? 1 : b, E = h.slice(b), b += r[1].length); + let w = !1; + if (!h && /^ *$/.test(a) && (y += a + ` +`, e = e.substring(a.length + 1), v = !0), !v) { + const M = new RegExp(`^ {0,${Math.min(3, b - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), $ = new RegExp(`^ {0,${Math.min(3, b - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), O = new RegExp(`^ {0,${Math.min(3, b - 1)}}(?:\`\`\`|~~~)`), C = new RegExp(`^ {0,${Math.min(3, b - 1)}}#`); + for (; e; ) { + const P = e.split(` +`, 1)[0]; + if (a = P, this.options.pedantic && (a = a.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), O.test(a) || C.test(a) || M.test(a) || $.test(e)) + break; + if (a.search(/[^ ]/) >= b || !a.trim()) + E += ` +` + a.slice(b); + else { + if (w || h.search(/[^ ]/) >= 4 || O.test(h) || C.test(h) || $.test(h)) + break; + E += ` +` + a; + } + !w && !a.trim() && (w = !0), y += P + ` +`, e = e.substring(P.length + 1), h = a.slice(b); + } + } + _.loose || (x ? _.loose = !0 : /\n *\n *$/.test(y) && (x = !0)); + let k = null, A; + this.options.gfm && (k = /^\[[ xX]\] /.exec(E), k && (A = k[0] !== "[ ] ", E = E.replace(/^\[[ xX]\] +/, ""))), _.items.push({ + type: "list_item", + raw: y, + task: !!k, + checked: A, + loose: !1, + text: E, + tokens: [] + }), _.raw += y; + } + _.items[_.items.length - 1].raw = y.trimEnd(), _.items[_.items.length - 1].text = E.trimEnd(), _.raw = _.raw.trimEnd(); + for (let v = 0; v < _.items.length; v++) + if (this.lexer.state.top = !1, _.items[v].tokens = this.lexer.blockTokens(_.items[v].text, []), !_.loose) { + const h = _.items[v].tokens.filter((b) => b.type === "space"), a = h.length > 0 && h.some((b) => /\n.*\n/.test(b.raw)); + _.loose = a; + } + if (_.loose) + for (let v = 0; v < _.items.length; v++) + _.items[v].loose = !0; + return _; + } + } + html(e) { + const r = this.rules.block.html.exec(e); + if (r) + return { + type: "html", + block: !0, + raw: r[0], + pre: r[1] === "pre" || r[1] === "script" || r[1] === "style", + text: r[0] + }; + } + def(e) { + const r = this.rules.block.def.exec(e); + if (r) { + const o = r[1].toLowerCase().replace(/\s+/g, " "), m = r[2] ? r[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", _ = r[3] ? r[3].substring(1, r[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : r[3]; + return { + type: "def", + tag: o, + raw: r[0], + href: m, + title: _ + }; + } + } + table(e) { + const r = this.rules.block.table.exec(e); + if (!r || !/[:|]/.test(r[2])) + return; + const o = splitCells(r[1]), m = r[2].replace(/^\||\| *$/g, "").split("|"), _ = r[3] && r[3].trim() ? r[3].replace(/\n[ \t]*$/, "").split(` +`) : [], g = { + type: "table", + raw: r[0], + header: [], + align: [], + rows: [] + }; + if (o.length === m.length) { + for (const y of m) + /^ *-+: *$/.test(y) ? g.align.push("right") : /^ *:-+: *$/.test(y) ? g.align.push("center") : /^ *:-+ *$/.test(y) ? g.align.push("left") : g.align.push(null); + for (const y of o) + g.header.push({ + text: y, + tokens: this.lexer.inline(y) + }); + for (const y of _) + g.rows.push(splitCells(y, g.header.length).map((E) => ({ + text: E, + tokens: this.lexer.inline(E) + }))); + return g; + } + } + lheading(e) { + const r = this.rules.block.lheading.exec(e); + if (r) + return { + type: "heading", + raw: r[0], + depth: r[2].charAt(0) === "=" ? 1 : 2, + text: r[1], + tokens: this.lexer.inline(r[1]) + }; + } + paragraph(e) { + const r = this.rules.block.paragraph.exec(e); + if (r) { + const o = r[1].charAt(r[1].length - 1) === ` +` ? r[1].slice(0, -1) : r[1]; + return { + type: "paragraph", + raw: r[0], + text: o, + tokens: this.lexer.inline(o) + }; + } + } + text(e) { + const r = this.rules.block.text.exec(e); + if (r) + return { + type: "text", + raw: r[0], + text: r[0], + tokens: this.lexer.inline(r[0]) + }; + } + escape(e) { + const r = this.rules.inline.escape.exec(e); + if (r) + return { + type: "escape", + raw: r[0], + text: escape$1$1(r[1]) + }; + } + tag(e) { + const r = this.rules.inline.tag.exec(e); + if (r) + return !this.lexer.state.inLink && /^/i.test(r[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(r[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0]) && (this.lexer.state.inRawBlock = !1), { + type: "html", + raw: r[0], + inLink: this.lexer.state.inLink, + inRawBlock: this.lexer.state.inRawBlock, + block: !1, + text: r[0] + }; + } + link(e) { + const r = this.rules.inline.link.exec(e); + if (r) { + const o = r[2].trim(); + if (!this.options.pedantic && /^$/.test(o)) + return; + const g = rtrim(o.slice(0, -1), "\\"); + if ((o.length - g.length) % 2 === 0) + return; + } else { + const g = findClosingBracket(r[2], "()"); + if (g > -1) { + const E = (r[0].indexOf("!") === 0 ? 5 : 4) + r[1].length + g; + r[2] = r[2].substring(0, g), r[0] = r[0].substring(0, E).trim(), r[3] = ""; + } + } + let m = r[2], _ = ""; + if (this.options.pedantic) { + const g = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(m); + g && (m = g[1], _ = g[3]); + } else + _ = r[3] ? r[3].slice(1, -1) : ""; + return m = m.trim(), /^$/.test(o) ? m = m.slice(1) : m = m.slice(1, -1)), outputLink(r, { + href: m && m.replace(this.rules.inline.anyPunctuation, "$1"), + title: _ && _.replace(this.rules.inline.anyPunctuation, "$1") + }, r[0], this.lexer); + } + } + reflink(e, r) { + let o; + if ((o = this.rules.inline.reflink.exec(e)) || (o = this.rules.inline.nolink.exec(e))) { + const m = (o[2] || o[1]).replace(/\s+/g, " "), _ = r[m.toLowerCase()]; + if (!_) { + const g = o[0].charAt(0); + return { + type: "text", + raw: g, + text: g + }; + } + return outputLink(o, _, o[0], this.lexer); + } + } + emStrong(e, r, o = "") { + let m = this.rules.inline.emStrongLDelim.exec(e); + if (!m || m[3] && o.match(/[\p{L}\p{N}]/u)) + return; + if (!(m[1] || m[2] || "") || !o || this.rules.inline.punctuation.exec(o)) { + const g = [...m[0]].length - 1; + let y, E, x = g, v = 0; + const h = m[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd; + for (h.lastIndex = 0, r = r.slice(-1 * e.length + g); (m = h.exec(r)) != null; ) { + if (y = m[1] || m[2] || m[3] || m[4] || m[5] || m[6], !y) + continue; + if (E = [...y].length, m[3] || m[4]) { + x += E; + continue; + } else if ((m[5] || m[6]) && g % 3 && !((g + E) % 3)) { + v += E; + continue; + } + if (x -= E, x > 0) + continue; + E = Math.min(E, E + x + v); + const a = [...m[0]][0].length, b = e.slice(0, g + m.index + a + E); + if (Math.min(g, E) % 2) { + const k = b.slice(1, -1); + return { + type: "em", + raw: b, + text: k, + tokens: this.lexer.inlineTokens(k) + }; + } + const w = b.slice(2, -2); + return { + type: "strong", + raw: b, + text: w, + tokens: this.lexer.inlineTokens(w) + }; + } + } + } + codespan(e) { + const r = this.rules.inline.code.exec(e); + if (r) { + let o = r[2].replace(/\n/g, " "); + const m = /[^ ]/.test(o), _ = /^ /.test(o) && / $/.test(o); + return m && _ && (o = o.substring(1, o.length - 1)), o = escape$1$1(o, !0), { + type: "codespan", + raw: r[0], + text: o + }; + } + } + br(e) { + const r = this.rules.inline.br.exec(e); + if (r) + return { + type: "br", + raw: r[0] + }; + } + del(e) { + const r = this.rules.inline.del.exec(e); + if (r) + return { + type: "del", + raw: r[0], + text: r[2], + tokens: this.lexer.inlineTokens(r[2]) + }; + } + autolink(e) { + const r = this.rules.inline.autolink.exec(e); + if (r) { + let o, m; + return r[2] === "@" ? (o = escape$1$1(r[1]), m = "mailto:" + o) : (o = escape$1$1(r[1]), m = o), { + type: "link", + raw: r[0], + text: o, + href: m, + tokens: [ + { + type: "text", + raw: o, + text: o + } + ] + }; + } + } + url(e) { + var o; + let r; + if (r = this.rules.inline.url.exec(e)) { + let m, _; + if (r[2] === "@") + m = escape$1$1(r[0]), _ = "mailto:" + m; + else { + let g; + do + g = r[0], r[0] = ((o = this.rules.inline._backpedal.exec(r[0])) == null ? void 0 : o[0]) ?? ""; + while (g !== r[0]); + m = escape$1$1(r[0]), r[1] === "www." ? _ = "http://" + r[0] : _ = r[0]; + } + return { + type: "link", + raw: r[0], + text: m, + href: _, + tokens: [ + { + type: "text", + raw: m, + text: m + } + ] + }; + } + } + inlineText(e) { + const r = this.rules.inline.text.exec(e); + if (r) { + let o; + return this.lexer.state.inRawBlock ? o = r[0] : o = escape$1$1(r[0]), { + type: "text", + raw: r[0], + text: o + }; + } + } +} +const newline = /^(?: *(?:\n|$))+/, blockCode = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, fences = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, hr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, heading = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, bullet = /(?:[*+-]|\d{1,9}[.)])/, lheading = edit(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, bullet).replace(/blockCode/g, / {4}/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).getRegex(), _paragraph = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, blockText = /^[^\n]+/, _blockLabel = /(?!\s*\])(?:\\.|[^\[\]\\])+/, def = edit(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label", _blockLabel).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), list = edit(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, bullet).getRegex(), _tag = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", _comment = /|$))/, html$2 = edit("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))", "i").replace("comment", _comment).replace("tag", _tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), paragraph = edit(_paragraph).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", ")|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex(), blockquote = edit(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", paragraph).getRegex(), blockNormal = { + blockquote, + code: blockCode, + def, + fences, + heading, + hr, + html: html$2, + lheading, + list, + newline, + paragraph, + table: noopTest, + text: blockText +}, gfmTable = edit("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", ")|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex(), blockGfm = { + ...blockNormal, + table: gfmTable, + paragraph: edit(_paragraph).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", gfmTable).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", ")|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex() +}, blockPedantic = { + ...blockNormal, + html: edit(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", _comment).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), + def: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, + heading: /^(#{1,6})(.*)(?:\n+|$)/, + fences: noopTest, + // fences not supported + lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, + paragraph: edit(_paragraph).replace("hr", hr).replace("heading", ` *#{1,6} *[^ +]`).replace("lheading", lheading).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() +}, escape$2 = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, inlineCode = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, br = /^( {2,}|\\)\n(?!\s*$)/, inlineText = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g, emStrongLDelim = edit(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, _punctuation).getRegex(), emStrongRDelimAst = edit("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, _punctuation).getRegex(), emStrongRDelimUnd = edit("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, _punctuation).getRegex(), anyPunctuation = edit(/\\([punct])/, "gu").replace(/punct/g, _punctuation).getRegex(), autolink = edit(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), _inlineComment = edit(_comment).replace("(?:-->|$)", "-->").getRegex(), tag = edit("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment", _inlineComment).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), _inlineLabel = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, link = edit(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", _inlineLabel).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), reflink = edit(/^!?\[(label)\]\[(ref)\]/).replace("label", _inlineLabel).replace("ref", _blockLabel).getRegex(), nolink = edit(/^!?\[(ref)\](?:\[\])?/).replace("ref", _blockLabel).getRegex(), reflinkSearch = edit("reflink|nolink(?!\\()", "g").replace("reflink", reflink).replace("nolink", nolink).getRegex(), inlineNormal = { + _backpedal: noopTest, + // only used for GFM url + anyPunctuation, + autolink, + blockSkip, + br, + code: inlineCode, + del: noopTest, + emStrongLDelim, + emStrongRDelimAst, + emStrongRDelimUnd, + escape: escape$2, + link, + nolink, + punctuation, + reflink, + reflinkSearch, + tag, + text: inlineText, + url: noopTest +}, inlinePedantic = { + ...inlineNormal, + link: edit(/^!?\[(label)\]\((.*?)\)/).replace("label", _inlineLabel).getRegex(), + reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", _inlineLabel).getRegex() +}, inlineGfm = { + ...inlineNormal, + escape: edit(escape$2).replace("])", "~|])").getRegex(), + url: edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), + _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, + del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/, + text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\ E + " ".repeat(x.length)); + let o, m, _, g; + for (; e; ) + if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((y) => (o = y.call({ lexer: this }, e, r)) ? (e = e.substring(o.raw.length), r.push(o), !0) : !1))) { + if (o = this.tokenizer.space(e)) { + e = e.substring(o.raw.length), o.raw.length === 1 && r.length > 0 ? r[r.length - 1].raw += ` +` : r.push(o); + continue; + } + if (o = this.tokenizer.code(e)) { + e = e.substring(o.raw.length), m = r[r.length - 1], m && (m.type === "paragraph" || m.type === "text") ? (m.raw += ` +` + o.raw, m.text += ` +` + o.text, this.inlineQueue[this.inlineQueue.length - 1].src = m.text) : r.push(o); + continue; + } + if (o = this.tokenizer.fences(e)) { + e = e.substring(o.raw.length), r.push(o); + continue; + } + if (o = this.tokenizer.heading(e)) { + e = e.substring(o.raw.length), r.push(o); + continue; + } + if (o = this.tokenizer.hr(e)) { + e = e.substring(o.raw.length), r.push(o); + continue; + } + if (o = this.tokenizer.blockquote(e)) { + e = e.substring(o.raw.length), r.push(o); + continue; + } + if (o = this.tokenizer.list(e)) { + e = e.substring(o.raw.length), r.push(o); + continue; + } + if (o = this.tokenizer.html(e)) { + e = e.substring(o.raw.length), r.push(o); + continue; + } + if (o = this.tokenizer.def(e)) { + e = e.substring(o.raw.length), m = r[r.length - 1], m && (m.type === "paragraph" || m.type === "text") ? (m.raw += ` +` + o.raw, m.text += ` +` + o.raw, this.inlineQueue[this.inlineQueue.length - 1].src = m.text) : this.tokens.links[o.tag] || (this.tokens.links[o.tag] = { + href: o.href, + title: o.title + }); + continue; + } + if (o = this.tokenizer.table(e)) { + e = e.substring(o.raw.length), r.push(o); + continue; + } + if (o = this.tokenizer.lheading(e)) { + e = e.substring(o.raw.length), r.push(o); + continue; + } + if (_ = e, this.options.extensions && this.options.extensions.startBlock) { + let y = 1 / 0; + const E = e.slice(1); + let x; + this.options.extensions.startBlock.forEach((v) => { + x = v.call({ lexer: this }, E), typeof x == "number" && x >= 0 && (y = Math.min(y, x)); + }), y < 1 / 0 && y >= 0 && (_ = e.substring(0, y + 1)); + } + if (this.state.top && (o = this.tokenizer.paragraph(_))) { + m = r[r.length - 1], g && m.type === "paragraph" ? (m.raw += ` +` + o.raw, m.text += ` +` + o.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = m.text) : r.push(o), g = _.length !== e.length, e = e.substring(o.raw.length); + continue; + } + if (o = this.tokenizer.text(e)) { + e = e.substring(o.raw.length), m = r[r.length - 1], m && m.type === "text" ? (m.raw += ` +` + o.raw, m.text += ` +` + o.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = m.text) : r.push(o); + continue; + } + if (e) { + const y = "Infinite loop on byte: " + e.charCodeAt(0); + if (this.options.silent) { + console.error(y); + break; + } else + throw new Error(y); + } + } + return this.state.top = !0, r; + } + inline(e, r = []) { + return this.inlineQueue.push({ src: e, tokens: r }), r; + } + /** + * Lexing/Compiling + */ + inlineTokens(e, r = []) { + let o, m, _, g = e, y, E, x; + if (this.tokens.links) { + const v = Object.keys(this.tokens.links); + if (v.length > 0) + for (; (y = this.tokenizer.rules.inline.reflinkSearch.exec(g)) != null; ) + v.includes(y[0].slice(y[0].lastIndexOf("[") + 1, -1)) && (g = g.slice(0, y.index) + "[" + "a".repeat(y[0].length - 2) + "]" + g.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex)); + } + for (; (y = this.tokenizer.rules.inline.blockSkip.exec(g)) != null; ) + g = g.slice(0, y.index) + "[" + "a".repeat(y[0].length - 2) + "]" + g.slice(this.tokenizer.rules.inline.blockSkip.lastIndex); + for (; (y = this.tokenizer.rules.inline.anyPunctuation.exec(g)) != null; ) + g = g.slice(0, y.index) + "++" + g.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex); + for (; e; ) + if (E || (x = ""), E = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((v) => (o = v.call({ lexer: this }, e, r)) ? (e = e.substring(o.raw.length), r.push(o), !0) : !1))) { + if (o = this.tokenizer.escape(e)) { + e = e.substring(o.raw.length), r.push(o); + continue; + } + if (o = this.tokenizer.tag(e)) { + e = e.substring(o.raw.length), m = r[r.length - 1], m && o.type === "text" && m.type === "text" ? (m.raw += o.raw, m.text += o.text) : r.push(o); + continue; + } + if (o = this.tokenizer.link(e)) { + e = e.substring(o.raw.length), r.push(o); + continue; + } + if (o = this.tokenizer.reflink(e, this.tokens.links)) { + e = e.substring(o.raw.length), m = r[r.length - 1], m && o.type === "text" && m.type === "text" ? (m.raw += o.raw, m.text += o.text) : r.push(o); + continue; + } + if (o = this.tokenizer.emStrong(e, g, x)) { + e = e.substring(o.raw.length), r.push(o); + continue; + } + if (o = this.tokenizer.codespan(e)) { + e = e.substring(o.raw.length), r.push(o); + continue; + } + if (o = this.tokenizer.br(e)) { + e = e.substring(o.raw.length), r.push(o); + continue; + } + if (o = this.tokenizer.del(e)) { + e = e.substring(o.raw.length), r.push(o); + continue; + } + if (o = this.tokenizer.autolink(e)) { + e = e.substring(o.raw.length), r.push(o); + continue; + } + if (!this.state.inLink && (o = this.tokenizer.url(e))) { + e = e.substring(o.raw.length), r.push(o); + continue; + } + if (_ = e, this.options.extensions && this.options.extensions.startInline) { + let v = 1 / 0; + const h = e.slice(1); + let a; + this.options.extensions.startInline.forEach((b) => { + a = b.call({ lexer: this }, h), typeof a == "number" && a >= 0 && (v = Math.min(v, a)); + }), v < 1 / 0 && v >= 0 && (_ = e.substring(0, v + 1)); + } + if (o = this.tokenizer.inlineText(_)) { + e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (x = o.raw.slice(-1)), E = !0, m = r[r.length - 1], m && m.type === "text" ? (m.raw += o.raw, m.text += o.text) : r.push(o); + continue; + } + if (e) { + const v = "Infinite loop on byte: " + e.charCodeAt(0); + if (this.options.silent) { + console.error(v); + break; + } else + throw new Error(v); + } + } + return r; + } +} +class _Renderer { + constructor(e) { + be(this, "options"); + this.options = e || _defaults; + } + code(e, r, o) { + var _; + const m = (_ = (r || "").match(/^\S*/)) == null ? void 0 : _[0]; + return e = e.replace(/\n$/, "") + ` +`, m ? '
' + (o ? e : escape$1$1(e, !0)) + `
+` : "
" + (o ? e : escape$1$1(e, !0)) + `
+`; + } + blockquote(e) { + return `
+${e}
+`; + } + html(e, r) { + return e; + } + heading(e, r, o) { + return `${e} +`; + } + hr() { + return `
+`; + } + list(e, r, o) { + const m = r ? "ol" : "ul", _ = r && o !== 1 ? ' start="' + o + '"' : ""; + return "<" + m + _ + `> +` + e + " +`; + } + listitem(e, r, o) { + return `
  • ${e}
  • +`; + } + checkbox(e) { + return "'; + } + paragraph(e) { + return `

    ${e}

    +`; + } + table(e, r) { + return r && (r = `${r}`), ` + +` + e + ` +` + r + `
    +`; + } + tablerow(e) { + return ` +${e} +`; + } + tablecell(e, r) { + const o = r.header ? "th" : "td"; + return (r.align ? `<${o} align="${r.align}">` : `<${o}>`) + e + ` +`; + } + /** + * span level renderer + */ + strong(e) { + return `${e}`; + } + em(e) { + return `${e}`; + } + codespan(e) { + return `${e}`; + } + br() { + return "
    "; + } + del(e) { + return `${e}`; + } + link(e, r, o) { + const m = cleanUrl(e); + if (m === null) + return o; + e = m; + let _ = '
    ", _; + } + image(e, r, o) { + const m = cleanUrl(e); + if (m === null) + return o; + e = m; + let _ = `${o} 0 && a.tokens[0].type === "paragraph" ? (a.tokens[0].text = A + " " + a.tokens[0].text, a.tokens[0].tokens && a.tokens[0].tokens.length > 0 && a.tokens[0].tokens[0].type === "text" && (a.tokens[0].tokens[0].text = A + " " + a.tokens[0].tokens[0].text)) : a.tokens.unshift({ + type: "text", + text: A + " " + }) : k += A + " "; + } + k += this.parse(a.tokens, x), v += this.renderer.listitem(k, w, !!b); + } + o += this.renderer.list(v, y, E); + continue; + } + case "html": { + const g = _; + o += this.renderer.html(g.text, g.block); + continue; + } + case "paragraph": { + const g = _; + o += this.renderer.paragraph(this.parseInline(g.tokens)); + continue; + } + case "text": { + let g = _, y = g.tokens ? this.parseInline(g.tokens) : g.text; + for (; m + 1 < e.length && e[m + 1].type === "text"; ) + g = e[++m], y += ` +` + (g.tokens ? this.parseInline(g.tokens) : g.text); + o += r ? this.renderer.paragraph(y) : y; + continue; + } + default: { + const g = 'Token with "' + _.type + '" type was not found.'; + if (this.options.silent) + return console.error(g), ""; + throw new Error(g); + } + } + } + return o; + } + /** + * Parse Inline Tokens + */ + parseInline(e, r) { + r = r || this.renderer; + let o = ""; + for (let m = 0; m < e.length; m++) { + const _ = e[m]; + if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[_.type]) { + const g = this.options.extensions.renderers[_.type].call({ parser: this }, _); + if (g !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(_.type)) { + o += g || ""; + continue; + } + } + switch (_.type) { + case "escape": { + const g = _; + o += r.text(g.text); + break; + } + case "html": { + const g = _; + o += r.html(g.text); + break; + } + case "link": { + const g = _; + o += r.link(g.href, g.title, this.parseInline(g.tokens, r)); + break; + } + case "image": { + const g = _; + o += r.image(g.href, g.title, g.text); + break; + } + case "strong": { + const g = _; + o += r.strong(this.parseInline(g.tokens, r)); + break; + } + case "em": { + const g = _; + o += r.em(this.parseInline(g.tokens, r)); + break; + } + case "codespan": { + const g = _; + o += r.codespan(g.text); + break; + } + case "br": { + o += r.br(); + break; + } + case "del": { + const g = _; + o += r.del(this.parseInline(g.tokens, r)); + break; + } + case "text": { + const g = _; + o += r.text(g.text); + break; + } + default: { + const g = 'Token with "' + _.type + '" type was not found.'; + if (this.options.silent) + return console.error(g), ""; + throw new Error(g); + } + } + } + return o; + } +} +class _Hooks { + constructor(e) { + be(this, "options"); + this.options = e || _defaults; + } + /** + * Process markdown before marked + */ + preprocess(e) { + return e; + } + /** + * Process HTML after marked is finished + */ + postprocess(e) { + return e; + } + /** + * Process all tokens before walk tokens + */ + processAllTokens(e) { + return e; + } +} +be(_Hooks, "passThroughHooks", /* @__PURE__ */ new Set([ + "preprocess", + "postprocess", + "processAllTokens" +])); +var Wt, on, In; +class Marked { + constructor(...e) { + Cn(this, Wt); + be(this, "defaults", _getDefaults()); + be(this, "options", this.setOptions); + be(this, "parse", en(this, Wt, on).call(this, _Lexer.lex, _Parser.parse)); + be(this, "parseInline", en(this, Wt, on).call(this, _Lexer.lexInline, _Parser.parseInline)); + be(this, "Parser", _Parser); + be(this, "Renderer", _Renderer); + be(this, "TextRenderer", _TextRenderer); + be(this, "Lexer", _Lexer); + be(this, "Tokenizer", _Tokenizer); + be(this, "Hooks", _Hooks); + this.use(...e); + } + /** + * Run callback for every token + */ + walkTokens(e, r) { + var m, _; + let o = []; + for (const g of e) + switch (o = o.concat(r.call(this, g)), g.type) { + case "table": { + const y = g; + for (const E of y.header) + o = o.concat(this.walkTokens(E.tokens, r)); + for (const E of y.rows) + for (const x of E) + o = o.concat(this.walkTokens(x.tokens, r)); + break; + } + case "list": { + const y = g; + o = o.concat(this.walkTokens(y.items, r)); + break; + } + default: { + const y = g; + (_ = (m = this.defaults.extensions) == null ? void 0 : m.childTokens) != null && _[y.type] ? this.defaults.extensions.childTokens[y.type].forEach((E) => { + const x = y[E].flat(1 / 0); + o = o.concat(this.walkTokens(x, r)); + }) : y.tokens && (o = o.concat(this.walkTokens(y.tokens, r))); + } + } + return o; + } + use(...e) { + const r = this.defaults.extensions || { renderers: {}, childTokens: {} }; + return e.forEach((o) => { + const m = { ...o }; + if (m.async = this.defaults.async || m.async || !1, o.extensions && (o.extensions.forEach((_) => { + if (!_.name) + throw new Error("extension name required"); + if ("renderer" in _) { + const g = r.renderers[_.name]; + g ? r.renderers[_.name] = function(...y) { + let E = _.renderer.apply(this, y); + return E === !1 && (E = g.apply(this, y)), E; + } : r.renderers[_.name] = _.renderer; + } + if ("tokenizer" in _) { + if (!_.level || _.level !== "block" && _.level !== "inline") + throw new Error("extension level must be 'block' or 'inline'"); + const g = r[_.level]; + g ? g.unshift(_.tokenizer) : r[_.level] = [_.tokenizer], _.start && (_.level === "block" ? r.startBlock ? r.startBlock.push(_.start) : r.startBlock = [_.start] : _.level === "inline" && (r.startInline ? r.startInline.push(_.start) : r.startInline = [_.start])); + } + "childTokens" in _ && _.childTokens && (r.childTokens[_.name] = _.childTokens); + }), m.extensions = r), o.renderer) { + const _ = this.defaults.renderer || new _Renderer(this.defaults); + for (const g in o.renderer) { + if (!(g in _)) + throw new Error(`renderer '${g}' does not exist`); + if (g === "options") + continue; + const y = g, E = o.renderer[y], x = _[y]; + _[y] = (...v) => { + let h = E.apply(_, v); + return h === !1 && (h = x.apply(_, v)), h || ""; + }; + } + m.renderer = _; + } + if (o.tokenizer) { + const _ = this.defaults.tokenizer || new _Tokenizer(this.defaults); + for (const g in o.tokenizer) { + if (!(g in _)) + throw new Error(`tokenizer '${g}' does not exist`); + if (["options", "rules", "lexer"].includes(g)) + continue; + const y = g, E = o.tokenizer[y], x = _[y]; + _[y] = (...v) => { + let h = E.apply(_, v); + return h === !1 && (h = x.apply(_, v)), h; + }; + } + m.tokenizer = _; + } + if (o.hooks) { + const _ = this.defaults.hooks || new _Hooks(); + for (const g in o.hooks) { + if (!(g in _)) + throw new Error(`hook '${g}' does not exist`); + if (g === "options") + continue; + const y = g, E = o.hooks[y], x = _[y]; + _Hooks.passThroughHooks.has(g) ? _[y] = (v) => { + if (this.defaults.async) + return Promise.resolve(E.call(_, v)).then((a) => x.call(_, a)); + const h = E.call(_, v); + return x.call(_, h); + } : _[y] = (...v) => { + let h = E.apply(_, v); + return h === !1 && (h = x.apply(_, v)), h; + }; + } + m.hooks = _; + } + if (o.walkTokens) { + const _ = this.defaults.walkTokens, g = o.walkTokens; + m.walkTokens = function(y) { + let E = []; + return E.push(g.call(this, y)), _ && (E = E.concat(_.call(this, y))), E; + }; + } + this.defaults = { ...this.defaults, ...m }; + }), this; + } + setOptions(e) { + return this.defaults = { ...this.defaults, ...e }, this; + } + lexer(e, r) { + return _Lexer.lex(e, r ?? this.defaults); + } + parser(e, r) { + return _Parser.parse(e, r ?? this.defaults); + } +} +Wt = new WeakSet(), on = function(e, r) { + return (o, m) => { + const _ = { ...m }, g = { ...this.defaults, ..._ }; + this.defaults.async === !0 && _.async === !1 && (g.silent || console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."), g.async = !0); + const y = en(this, Wt, In).call(this, !!g.silent, !!g.async); + if (typeof o > "u" || o === null) + return y(new Error("marked(): input parameter is undefined or null")); + if (typeof o != "string") + return y(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(o) + ", string expected")); + if (g.hooks && (g.hooks.options = g), g.async) + return Promise.resolve(g.hooks ? g.hooks.preprocess(o) : o).then((E) => e(E, g)).then((E) => g.hooks ? g.hooks.processAllTokens(E) : E).then((E) => g.walkTokens ? Promise.all(this.walkTokens(E, g.walkTokens)).then(() => E) : E).then((E) => r(E, g)).then((E) => g.hooks ? g.hooks.postprocess(E) : E).catch(y); + try { + g.hooks && (o = g.hooks.preprocess(o)); + let E = e(o, g); + g.hooks && (E = g.hooks.processAllTokens(E)), g.walkTokens && this.walkTokens(E, g.walkTokens); + let x = r(E, g); + return g.hooks && (x = g.hooks.postprocess(x)), x; + } catch (E) { + return y(E); + } + }; +}, In = function(e, r) { + return (o) => { + if (o.message += ` +Please report this to https://github.com/markedjs/marked.`, e) { + const m = "

    An error occurred:

    " + escape$1$1(o.message + "", !0) + "
    "; + return r ? Promise.resolve(m) : m; + } + if (r) + return Promise.reject(o); + throw o; + }; +}; +const markedInstance = new Marked(); +function marked(s, e) { + return markedInstance.parse(s, e); +} +marked.options = marked.setOptions = function(s) { + return markedInstance.setOptions(s), marked.defaults = markedInstance.defaults, changeDefaults(marked.defaults), marked; +}; +marked.getDefaults = _getDefaults; +marked.defaults = _defaults; +marked.use = function(...s) { + return markedInstance.use(...s), marked.defaults = markedInstance.defaults, changeDefaults(marked.defaults), marked; +}; +marked.walkTokens = function(s, e) { + return markedInstance.walkTokens(s, e); +}; +marked.parseInline = markedInstance.parseInline; +marked.Parser = _Parser; +marked.parser = _Parser.parse; +marked.Renderer = _Renderer; +marked.TextRenderer = _TextRenderer; +marked.Lexer = _Lexer; +marked.lexer = _Lexer.lex; +marked.Tokenizer = _Tokenizer; +marked.Hooks = _Hooks; +marked.parse = marked; +marked.options; +marked.setOptions; +marked.use; +marked.walkTokens; +marked.parseInline; +_Parser.parse; +_Lexer.lex; +function markedHighlight(s) { + if (typeof s == "function" && (s = { + highlight: s + }), !s || typeof s.highlight != "function") + throw new Error("Must provide highlight function"); + return typeof s.langPrefix != "string" && (s.langPrefix = "language-"), typeof s.emptyLangClass != "string" && (s.emptyLangClass = ""), { + async: !!s.async, + walkTokens(e) { + if (e.type !== "code") + return; + const r = getLang(e.lang); + if (s.async) + return Promise.resolve(s.highlight(e.text, r, e.lang || "")).then(updateToken(e)); + const o = s.highlight(e.text, r, e.lang || ""); + if (o instanceof Promise) + throw new Error("markedHighlight is not set to async but the highlight function is async. Set the async option to true on markedHighlight to await the async highlight function."); + updateToken(e)(o); + }, + useNewRenderer: !0, + renderer: { + code(e, r, o) { + typeof e == "object" && (o = e.escaped, r = e.lang, e = e.text); + const m = getLang(r), _ = m ? s.langPrefix + escape$1(m) : s.emptyLangClass, g = _ ? ` class="${_}"` : ""; + return e = e.replace(/\n$/, ""), `
    ${o ? e : escape$1(e, !0)}
    +
    `; + } + } + }; +} +function getLang(s) { + return (s || "").match(/\S*/)[0]; +} +function updateToken(s) { + return (e) => { + typeof e == "string" && e !== s.text && (s.escaped = !0, s.text = e); + }; +} +const escapeTest = /[&<>"']/, escapeReplace = new RegExp(escapeTest.source, "g"), escapeTestNoEncode = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, "g"), escapeReplacements = { + "&": "&", + "<": "<", + ">": ">", + '"': """, + "'": "'" +}, getEscapeReplacement = (s) => escapeReplacements[s]; +function escape$1(s, e) { + if (e) { + if (escapeTest.test(s)) + return s.replace(escapeReplace, getEscapeReplacement); + } else if (escapeTestNoEncode.test(s)) + return s.replace(escapeReplaceNoEncode, getEscapeReplacement); + return s; +} +const regex = /[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g, own = Object.hasOwnProperty; +class BananaSlug { + /** + * Create a new slug class. + */ + constructor() { + this.occurrences, this.reset(); + } + /** + * Generate a unique slug. + * + * Tracks previously generated slugs: repeated calls with the same value + * will result in different slugs. + * Use the `slug` function to get same slugs. + * + * @param {string} value + * String of text to slugify + * @param {boolean} [maintainCase=false] + * Keep the current case, otherwise make all lowercase + * @return {string} + * A unique slug string + */ + slug(e, r) { + const o = this; + let m = slug(e, r === !0); + const _ = m; + for (; own.call(o.occurrences, m); ) + o.occurrences[_]++, m = _ + "-" + o.occurrences[_]; + return o.occurrences[m] = 0, m; + } + /** + * Reset - Forget all previous slugs + * + * @return void + */ + reset() { + this.occurrences = /* @__PURE__ */ Object.create(null); + } +} +function slug(s, e) { + return typeof s != "string" ? "" : (e || (s = s.toLowerCase()), s.replace(regex, "").replace(/ /g, "-")); +} +let slugger$1 = new BananaSlug(), headings = []; +function gfmHeadingId({ prefix: s = "", globalSlugs: e = !1 } = {}) { + return { + headerIds: !1, + // prevent deprecation warning; remove this once headerIds option is removed + hooks: { + preprocess(r) { + return e || resetHeadings(), r; + } + }, + renderer: { + heading(r, o, m) { + m = m.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi, ""); + const _ = `${s}${slugger$1.slug(m)}`, g = { level: o, text: r, id: _ }; + return headings.push(g), `${r} +`; + } + } + }; +} +function resetHeadings() { + headings = [], slugger$1 = new BananaSlug(); +} +var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; +function getDefaultExportFromCjs(s) { + return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s; +} +function getAugmentedNamespace(s) { + if (s.__esModule) return s; + var e = s.default; + if (typeof e == "function") { + var r = function o() { + return this instanceof o ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments); + }; + r.prototype = e.prototype; + } else r = {}; + return Object.defineProperty(r, "__esModule", { value: !0 }), Object.keys(s).forEach(function(o) { + var m = Object.getOwnPropertyDescriptor(s, o); + Object.defineProperty(r, o, m.get ? m : { + enumerable: !0, + get: function() { + return s[o]; + } + }); + }), r; +} +var prism = { exports: {} }; +(function(s) { + var e = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {}; + /** + * Prism: Lightweight, robust, elegant syntax highlighting + * + * @license MIT + * @author Lea Verou + * @namespace + * @public + */ + var r = function(o) { + var m = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, _ = 0, g = {}, y = { + /** + * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the + * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load + * additional languages or plugins yourself. + * + * By setting this value to `true`, Prism will not automatically highlight all code elements on the page. + * + * You obviously have to change this value before the automatic highlighting started. To do this, you can add an + * empty Prism object into the global scope before loading the Prism script like this: + * + * ```js + * window.Prism = window.Prism || {}; + * Prism.manual = true; + * // add a new - - + {#if loading_status} + gradio.dispatch("clear_status", loading_status)} /> + {/if} +
    {#if display_mode !== 'hidden'}
    - +
    Tokens: {value?.tokens?.length || 0} @@ -118,15 +135,32 @@ {/if}
    - - - - + + {#if !hide_input} + gradio.dispatch("change")} + /> + {/if} + + {#if showVisualization && display_mode !== 'hidden'}
    {#if display_mode === 'text'} @@ -155,53 +189,94 @@ \ No newline at end of file + +Use code with caution. \ No newline at end of file diff --git a/src/pyproject.toml b/src/pyproject.toml index 4a6e55481ce225aeb2f3e5608afa5ce0265e6f09..7de9e1ebe57641b54fa45e74ae7cf8577ebff6ef 100644 --- a/src/pyproject.toml +++ b/src/pyproject.toml @@ -8,7 +8,7 @@ build-backend = "hatchling.build" [project] name = "gradio_tokenizertextbox" -version = "0.0.1" +version = "0.0.2" description = "Textbox tokenizer" readme = "README.md" license = "apache-2.0"