Spaces:
Build error
Build error
Upload folder using huggingface_hub
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- README.md+77-43
- app.py+62-40
- space.py+65-44
- src/README.md+77-43
- src/backend/gradio_tokenizertextbox/templates/component/Index-DlSje_b9.jsAdded
- src/backend/gradio_tokenizertextbox/templates/component/_basePickBy-DxXFlUZa.jsAdded+151
- src/backend/gradio_tokenizertextbox/templates/component/_baseUniq-BzpV2HJ8.jsAdded+614
- src/backend/gradio_tokenizertextbox/templates/component/arc-BVd80oSb.jsAdded+83
- src/backend/gradio_tokenizertextbox/templates/component/architectureDiagram-KYWUMXXP-y3e3xZON.jsAdded
- src/backend/gradio_tokenizertextbox/templates/component/blockDiagram-ZUX3OVTL-CZ3LKPly.jsAdded
- src/backend/gradio_tokenizertextbox/templates/component/c4Diagram-E5VUS4TQ-CaEITEwB.jsAdded+1581
- src/backend/gradio_tokenizertextbox/templates/component/channel-DjI12Op-.jsAdded+5
- src/backend/gradio_tokenizertextbox/templates/component/chunk-44GW5IO5-Ohm2b7Vh.jsAdded+9
- src/backend/gradio_tokenizertextbox/templates/component/chunk-BQPDZTM5-D5dg_mRt.jsAdded+15
- src/backend/gradio_tokenizertextbox/templates/component/chunk-GOYUR5SG-D3cGQmyD.jsAdded+1381
- src/backend/gradio_tokenizertextbox/templates/component/chunk-HPOVUXKZ-C_XOradn.jsAdded+24
- src/backend/gradio_tokenizertextbox/templates/component/chunk-UIWBPB2F-muaaSQOG.jsAdded+19
- src/backend/gradio_tokenizertextbox/templates/component/chunk-WZLT4MVT-CfJwH0hJ.jsAdded+64
- src/backend/gradio_tokenizertextbox/templates/component/chunk-YQZZRAKN-BQvCB-Ut.jsAdded+1374
- src/backend/gradio_tokenizertextbox/templates/component/classDiagram-EGQPL23Y-CDUQ2UUi.jsAdded+16
- src/backend/gradio_tokenizertextbox/templates/component/classDiagram-v2-4EBKGCBT-CDUQ2UUi.jsAdded+16
- src/backend/gradio_tokenizertextbox/templates/component/clone-CnKi__lm.jsAdded+8
- src/backend/gradio_tokenizertextbox/templates/component/dagre-IE2X5DAH-CV8zgPsh.jsAdded+447
- src/backend/gradio_tokenizertextbox/templates/component/diagram-3XXCIKAB-BVOFKcL7.jsAdded+137
- src/backend/gradio_tokenizertextbox/templates/component/diagram-DTTGSU4T-CnP9lnn0.jsAdded+221
- src/backend/gradio_tokenizertextbox/templates/component/erDiagram-FWMTN743-DTpuosUL.jsAdded+841
- src/backend/gradio_tokenizertextbox/templates/component/flowDiagram-OUUYVNGO-Cez2328G.jsAdded+1626
- src/backend/gradio_tokenizertextbox/templates/component/ganttDiagram-Y4ZJHTSR-Ck1BJGQb.jsAdded+2502
- src/backend/gradio_tokenizertextbox/templates/component/gitGraphDiagram-SOPYED2O-PDatxHXu.jsAdded+712
- src/backend/gradio_tokenizertextbox/templates/component/graph-BH65arkC.jsAdded+247
- src/backend/gradio_tokenizertextbox/templates/component/index.js+2-4
- src/backend/gradio_tokenizertextbox/templates/component/infoDiagram-LZPS564M-2uptqD23.jsAdded+24
- src/backend/gradio_tokenizertextbox/templates/component/journeyDiagram-KRBQ73NG-CZZ_CkVX.jsAdded+836
- src/backend/gradio_tokenizertextbox/templates/component/kanban-definition-TWHLSRP4-DQIVe-hm.jsAdded+720
- src/backend/gradio_tokenizertextbox/templates/component/layout-GrosxRhM.jsAdded+1324
- src/backend/gradio_tokenizertextbox/templates/component/linear-Cg721pVl.jsAdded+423
- src/backend/gradio_tokenizertextbox/templates/component/mermaid.core-BiIw1_mh.jsAdded
- src/backend/gradio_tokenizertextbox/templates/component/mindmap-definition-RDSO3R44-BUcceq1V.jsAdded
- src/backend/gradio_tokenizertextbox/templates/component/pieDiagram-JVH3GP2A-DdZH_LOx.jsAdded+161
- src/backend/gradio_tokenizertextbox/templates/component/quadrantDiagram-2GFVJBMM-Caah2B__.jsAdded+1024
- src/backend/gradio_tokenizertextbox/templates/component/radar-VG2SY3DT-DUR9h7DO.jsAdded
- src/backend/gradio_tokenizertextbox/templates/component/requirementDiagram-PBTKI7ZP-BUGizFns.jsAdded+851
- src/backend/gradio_tokenizertextbox/templates/component/sankeyDiagram-XYA53EP7-Ur5hCpvv.jsAdded+808
- src/backend/gradio_tokenizertextbox/templates/component/sequenceDiagram-BLN7LXEI-BVLAQ6AC.jsAdded
- src/backend/gradio_tokenizertextbox/templates/component/stateDiagram-WEXRT5W7-jKdDOUmm.jsAdded+263
- src/backend/gradio_tokenizertextbox/templates/component/stateDiagram-v2-SNKRMT2F-8WDcIQDb.jsAdded+16
- src/backend/gradio_tokenizertextbox/templates/component/style.css
- src/backend/gradio_tokenizertextbox/templates/component/timeline-definition-GH3MJCYT-GQFW3CL1.jsAdded+801
- src/backend/gradio_tokenizertextbox/templates/component/xychartDiagram-4SJQ7YKO-TYaDtL9j.jsAdded+1338
- src/backend/gradio_tokenizertextbox/tokenizertextbox.py+12-11
9 unmodified lines1011121314151613 unmodified lines3031323334353610 unmodified lines47484950515253545556578 unmodified lines6667686970717273747576777879808182831 unmodified line85868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213351 unmodified lines1851861871881891909 unmodified lines---# `gradio_tokenizertextbox`<img alt="Static Badge" src="https://img.shields.io/badge/version%20-%200.0.1%20-%20orange">Textbox tokenizer13 unmodified linesfrom gradio_tokenizertextbox import TokenizerTextBoximport jsonTOKENIZER_OPTIONS = {"Xenova/clip-vit-large-patch14": "CLIP ViT-L/14",10 unmodified lines"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()8 unmodified linesreturn tokenization_data# --- Gradio Application ---with gr.Blocks() as demo: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.")with gr.Row():# 3. Create the Dropdown for model selectionmodel_selector = gr.Dropdown(label="Select a Tokenizer",choices=dropdown_choices,value="Xenova/clip-vit-large-patch14", # Set a default value)display_mode_radio = gr.Radio(1 unmodified linelabel="Display Mode",value="text")# 4. Initialize the component with a default modeltokenizer_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 valuedisplay_mode="text",)output_info = gr.JSON(label="Component Output (from preprocess)")# --- Event Listeners ---# A. When the tokenizer component changes, update the JSON outputtokenizer_input.change(fn=process_output,inputs=tokenizer_input,outputs=output_info)# B. When the dropdown value changes, update the 'model' prop of our componentdef update_tokenizer_model(selected_model):return gr.update(model=selected_model)model_selector.change(fn=update_tokenizer_model,inputs=model_selector,outputs=tokenizer_input)# C. When the radio button value changes, update the 'display_mode' propdef update_display_mode(mode):return gr.update(display_mode=mode)display_mode_radio.change(fn=update_display_mode,inputs=display_mode_radio,outputs=tokenizer_input)if __name__ == '__main__':demo.launch()```## `TokenizerTextBox`51 unmodified lines<td align="left">Controls the content of the token visualization panel. Can be 'text' (default), 'token_ids', or 'hidden'.</td></tr><tr><td align="left"><code>lines</code></td><td align="left" style="width: 25%;">9 unmodified lines1011121314151613 unmodified lines3031323334353610 unmodified lines47484950515253548 unmodified lines63646566676869707172737475767778791 unmodified line8182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315451 unmodified lines2062072082092102112122132142152162172182192202212222232249 unmodified lines---# `gradio_tokenizertextbox`<a href="https://pypi.org/project/gradio_tokenizertextbox/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_tokenizertextbox"></a>Textbox tokenizer13 unmodified linesfrom gradio_tokenizertextbox import TokenizerTextBoximport json# --- Data and Helper Functions ---TOKENIZER_OPTIONS = {"Xenova/clip-vit-large-patch14": "CLIP ViT-L/14",10 unmodified lines"Xenova/c4ai-command-r-v01-tokenizer": "Cohere Command-R","Xenova/t5-small": "T5","Xenova/bert-base-cased": "bert-base-cased",}dropdown_choices = [(display_name, model_name)for model_name, display_name in TOKENIZER_OPTIONS.items()8 unmodified linesreturn tokenization_data# --- Gradio Application ---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)")# --- Global Controls (affect both tabs) ---with gr.Row():model_selector = gr.Dropdown(label="Select a Tokenizer",choices=dropdown_choices,value="Xenova/clip-vit-large-patch14",)display_mode_radio = gr.Radio(1 unmodified linelabel="Display Mode",value="text")# --- 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 textboxmodel="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 textboxesprompt_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 outputvisualizer.change(process_output, visualizer, visualizer_output)# Run once on load to show the initial statedemo.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 updatedall_tokenizers = [standalone_tokenizer, visualizer]model_selector.change(fn=lambda model: [gr.update(model=model) for _ in all_tokenizers],inputs=model_selector,outputs=all_tokenizers)display_mode_radio.change(fn=lambda mode: [gr.update(display_mode=mode) for _ in all_tokenizers],inputs=display_mode_radio,outputs=all_tokenizers)if __name__ == '__main__':demo.launch()```## `TokenizerTextBox`51 unmodified lines<td align="left">Controls the content of the token visualization panel. Can be 'text' (default), 'token_ids', or 'hidden'.</td></tr><tr><td align="left"><code>hide_input</code></td><td align="left" style="width: 25%;">```pythonbool```</td><td align="left"><code>False</code></td><td align="left">If True, the component's own textbox is hidden, turning it into a read-only visualizer. Defaults to False.</td></tr><tr><td align="left"><code>lines</code></td><td align="left" style="width: 25%;">
4 unmodified lines56789101110 unmodified lines22232425262728293031328 unmodified lines4142434445464748495051525354555657581 unmodified line606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031044 unmodified linesfrom gradio_tokenizertextbox import TokenizerTextBoximport jsonTOKENIZER_OPTIONS = {"Xenova/clip-vit-large-patch14": "CLIP ViT-L/14",10 unmodified lines"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()8 unmodified linesreturn tokenization_data# --- Gradio Application ---with gr.Blocks() as demo: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.")with gr.Row():# 3. Create the Dropdown for model selectionmodel_selector = gr.Dropdown(label="Select a Tokenizer",choices=dropdown_choices,value="Xenova/clip-vit-large-patch14", # Set a default value)display_mode_radio = gr.Radio(1 unmodified linelabel="Display Mode",value="text")# 4. Initialize the component with a default modeltokenizer_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 valuedisplay_mode="text",)output_info = gr.JSON(label="Component Output (from preprocess)")# --- Event Listeners ---# A. When the tokenizer component changes, update the JSON outputtokenizer_input.change(fn=process_output,inputs=tokenizer_input,outputs=output_info)# B. When the dropdown value changes, update the 'model' prop of our componentdef update_tokenizer_model(selected_model):return gr.update(model=selected_model)model_selector.change(fn=update_tokenizer_model,inputs=model_selector,outputs=tokenizer_input)# C. When the radio button value changes, update the 'display_mode' propdef update_display_mode(mode):return gr.update(display_mode=mode)display_mode_radio.change(fn=update_display_mode,inputs=display_mode_radio,outputs=tokenizer_input)if __name__ == '__main__':demo.launch()4 unmodified lines56789101110 unmodified lines22232425262728298 unmodified lines38394041424344454647484950515253541 unmodified line56575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251264 unmodified linesfrom gradio_tokenizertextbox import TokenizerTextBoximport json# --- Data and Helper Functions ---TOKENIZER_OPTIONS = {"Xenova/clip-vit-large-patch14": "CLIP ViT-L/14",10 unmodified lines"Xenova/c4ai-command-r-v01-tokenizer": "Cohere Command-R","Xenova/t5-small": "T5","Xenova/bert-base-cased": "bert-base-cased",}dropdown_choices = [(display_name, model_name)for model_name, display_name in TOKENIZER_OPTIONS.items()8 unmodified linesreturn tokenization_data# --- Gradio Application ---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)")# --- Global Controls (affect both tabs) ---with gr.Row():model_selector = gr.Dropdown(label="Select a Tokenizer",choices=dropdown_choices,value="Xenova/clip-vit-large-patch14",)display_mode_radio = gr.Radio(1 unmodified linelabel="Display Mode",value="text")# --- 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 textboxmodel="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 textboxesprompt_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 outputvisualizer.change(process_output, visualizer, visualizer_output)# Run once on load to show the initial statedemo.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 updatedall_tokenizers = [standalone_tokenizer, visualizer]model_selector.change(fn=lambda model: [gr.update(model=model) for _ in all_tokenizers],inputs=model_selector,outputs=all_tokenizers)display_mode_radio.change(fn=lambda mode: [gr.update(display_mode=mode) for _ in all_tokenizers],inputs=display_mode_radio,outputs=all_tokenizers)if __name__ == '__main__':demo.launch()
2 unmodified lines345678911 unmodified lines2122232425262717 unmodified lines4546474849505110 unmodified lines62636465666768697071728 unmodified lines8182838485868788899091929394959697981 unmodified line1001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471482 unmodified linesfrom app import demo as appimport 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': []}}}abs_path = os.path.join(os.path.dirname(__file__), "css.css")11 unmodified lines# `gradio_tokenizertextbox`<div style="display: flex; gap: 7px;"><img alt="Static Badge" src="https://img.shields.io/badge/version%20-%200.0.1%20-%20orange"></div>Textbox tokenizer17 unmodified linesfrom gradio_tokenizertextbox import TokenizerTextBoximport jsonTOKENIZER_OPTIONS = {"Xenova/clip-vit-large-patch14": "CLIP ViT-L/14",10 unmodified lines"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()8 unmodified linesreturn tokenization_data# --- Gradio Application ---with gr.Blocks() as demo: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.")with gr.Row():# 3. Create the Dropdown for model selectionmodel_selector = gr.Dropdown(label="Select a Tokenizer",choices=dropdown_choices,value="Xenova/clip-vit-large-patch14", # Set a default value)display_mode_radio = gr.Radio(1 unmodified linelabel="Display Mode",value="text")# 4. Initialize the component with a default modeltokenizer_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 valuedisplay_mode="text",)output_info = gr.JSON(label="Component Output (from preprocess)")# --- Event Listeners ---# A. When the tokenizer component changes, update the JSON outputtokenizer_input.change(fn=process_output,inputs=tokenizer_input,outputs=output_info)# B. When the dropdown value changes, update the 'model' prop of our componentdef update_tokenizer_model(selected_model):return gr.update(model=selected_model)model_selector.change(fn=update_tokenizer_model,inputs=model_selector,outputs=tokenizer_input)# C. When the radio button value changes, update the 'display_mode' propdef update_display_mode(mode):return gr.update(display_mode=mode)display_mode_radio.change(fn=update_display_mode,inputs=display_mode_radio,outputs=tokenizer_input)if __name__ == '__main__':demo.launch()```""", elem_classes=["md-custom"], header_links=True)2 unmodified lines345678911 unmodified lines2122232425262717 unmodified lines4546474849505110 unmodified lines62636465666768698 unmodified lines78798081828384858687888990919293941 unmodified line969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681692 unmodified linesfrom app import demo as appimport 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'."}, '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")11 unmodified lines# `gradio_tokenizertextbox`<div style="display: flex; gap: 7px;"><a href="https://pypi.org/project/gradio_tokenizertextbox/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_tokenizertextbox"></a></div>Textbox tokenizer17 unmodified linesfrom gradio_tokenizertextbox import TokenizerTextBoximport json# --- Data and Helper Functions ---TOKENIZER_OPTIONS = {"Xenova/clip-vit-large-patch14": "CLIP ViT-L/14",10 unmodified lines"Xenova/c4ai-command-r-v01-tokenizer": "Cohere Command-R","Xenova/t5-small": "T5","Xenova/bert-base-cased": "bert-base-cased",}dropdown_choices = [(display_name, model_name)for model_name, display_name in TOKENIZER_OPTIONS.items()8 unmodified linesreturn tokenization_data# --- Gradio Application ---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)")# --- Global Controls (affect both tabs) ---with gr.Row():model_selector = gr.Dropdown(label="Select a Tokenizer",choices=dropdown_choices,value="Xenova/clip-vit-large-patch14",)display_mode_radio = gr.Radio(1 unmodified linelabel="Display Mode",value="text")# --- 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 textboxmodel="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 textboxesprompt_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 outputvisualizer.change(process_output, visualizer, visualizer_output)# Run once on load to show the initial statedemo.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 updatedall_tokenizers = [standalone_tokenizer, visualizer]model_selector.change(fn=lambda model: [gr.update(model=model) for _ in all_tokenizers],inputs=model_selector,outputs=all_tokenizers)display_mode_radio.change(fn=lambda mode: [gr.update(display_mode=mode) for _ in all_tokenizers],inputs=display_mode_radio,outputs=all_tokenizers)if __name__ == '__main__':demo.launch()```""", elem_classes=["md-custom"], header_links=True)
9 unmodified lines1011121314151613 unmodified lines3031323334353610 unmodified lines47484950515253545556578 unmodified lines6667686970717273747576777879808182831 unmodified line85868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213351 unmodified lines1851861871881891909 unmodified lines---# `gradio_tokenizertextbox`<img alt="Static Badge" src="https://img.shields.io/badge/version%20-%200.0.1%20-%20orange">Textbox tokenizer13 unmodified linesfrom gradio_tokenizertextbox import TokenizerTextBoximport jsonTOKENIZER_OPTIONS = {"Xenova/clip-vit-large-patch14": "CLIP ViT-L/14",10 unmodified lines"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()8 unmodified linesreturn tokenization_data# --- Gradio Application ---with gr.Blocks() as demo: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.")with gr.Row():# 3. Create the Dropdown for model selectionmodel_selector = gr.Dropdown(label="Select a Tokenizer",choices=dropdown_choices,value="Xenova/clip-vit-large-patch14", # Set a default value)display_mode_radio = gr.Radio(1 unmodified linelabel="Display Mode",value="text")# 4. Initialize the component with a default modeltokenizer_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 valuedisplay_mode="text",)output_info = gr.JSON(label="Component Output (from preprocess)")# --- Event Listeners ---# A. When the tokenizer component changes, update the JSON outputtokenizer_input.change(fn=process_output,inputs=tokenizer_input,outputs=output_info)# B. When the dropdown value changes, update the 'model' prop of our componentdef update_tokenizer_model(selected_model):return gr.update(model=selected_model)model_selector.change(fn=update_tokenizer_model,inputs=model_selector,outputs=tokenizer_input)# C. When the radio button value changes, update the 'display_mode' propdef update_display_mode(mode):return gr.update(display_mode=mode)display_mode_radio.change(fn=update_display_mode,inputs=display_mode_radio,outputs=tokenizer_input)if __name__ == '__main__':demo.launch()```## `TokenizerTextBox`51 unmodified lines<td align="left">Controls the content of the token visualization panel. Can be 'text' (default), 'token_ids', or 'hidden'.</td></tr><tr><td align="left"><code>lines</code></td><td align="left" style="width: 25%;">9 unmodified lines1011121314151613 unmodified lines3031323334353610 unmodified lines47484950515253548 unmodified lines63646566676869707172737475767778791 unmodified line8182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315451 unmodified lines2062072082092102112122132142152162172182192202212222232249 unmodified lines---# `gradio_tokenizertextbox`<a href="https://pypi.org/project/gradio_tokenizertextbox/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_tokenizertextbox"></a>Textbox tokenizer13 unmodified linesfrom gradio_tokenizertextbox import TokenizerTextBoximport json# --- Data and Helper Functions ---TOKENIZER_OPTIONS = {"Xenova/clip-vit-large-patch14": "CLIP ViT-L/14",10 unmodified lines"Xenova/c4ai-command-r-v01-tokenizer": "Cohere Command-R","Xenova/t5-small": "T5","Xenova/bert-base-cased": "bert-base-cased",}dropdown_choices = [(display_name, model_name)for model_name, display_name in TOKENIZER_OPTIONS.items()8 unmodified linesreturn tokenization_data# --- Gradio Application ---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)")# --- Global Controls (affect both tabs) ---with gr.Row():model_selector = gr.Dropdown(label="Select a Tokenizer",choices=dropdown_choices,value="Xenova/clip-vit-large-patch14",)display_mode_radio = gr.Radio(1 unmodified linelabel="Display Mode",value="text")# --- 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 textboxmodel="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 textboxesprompt_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 outputvisualizer.change(process_output, visualizer, visualizer_output)# Run once on load to show the initial statedemo.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 updatedall_tokenizers = [standalone_tokenizer, visualizer]model_selector.change(fn=lambda model: [gr.update(model=model) for _ in all_tokenizers],inputs=model_selector,outputs=all_tokenizers)display_mode_radio.change(fn=lambda mode: [gr.update(display_mode=mode) for _ in all_tokenizers],inputs=display_mode_radio,outputs=all_tokenizers)if __name__ == '__main__':demo.launch()```## `TokenizerTextBox`51 unmodified lines<td align="left">Controls the content of the token visualization panel. Can be 'text' (default), 'token_ids', or 'hidden'.</td></tr><tr><td align="left"><code>hide_input</code></td><td align="left" style="width: 25%;">```pythonbool```</td><td align="left"><code>False</code></td><td align="left">If True, the component's own textbox is hidden, turning it into a read-only visualizer. Defaults to False.</td></tr><tr><td align="left"><code>lines</code></td><td align="left" style="width: 25%;">
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151import { e as x, c as b, g as m, k as P, h as p, j as w, l as A, m as N, n as I, t as c, o as M } from "./_baseUniq-BzpV2HJ8.js";import { aK as g, aA as E, aL as F, aM as _, aN as $, aO as l, aP as B, aQ as S, aR as T, aS as y } from "./mermaid.core-BiIw1_mh.js";var L = /\s/;function R(n) { for (var r = n.length; r-- && L.test(n.charAt(r)); ) ; return r;}var G = /^\s+/;function H(n) { return n && n.slice(0, R(n) + 1).replace(G, "");}var o = NaN, K = /^[-+]0x[0-9a-f]+$/i, q = /^0b[01]+$/i, z = /^0o[0-7]+$/i, C = parseInt;function Q(n) { if (typeof n == "number") return n; if (x(n)) return o; if (g(n)) { var r = typeof n.valueOf == "function" ? n.valueOf() : n; n = g(r) ? r + "" : r; } if (typeof n != "string") return n === 0 ? n : +n; n = H(n); var t = q.test(n); return t || z.test(n) ? C(n.slice(2), t ? 2 : 8) : K.test(n) ? o : +n;}var v = 1 / 0, W = 17976931348623157e292;function X(n) { if (!n) return n === 0 ? n : 0; if (n = Q(n), n === v || n === -v) { var r = n < 0 ? -1 : 1; return r * W; } return n === n ? n : 0;}function Y(n) { var r = X(n), t = r % 1; return r === r ? t ? r - t : r : 0;}function fn(n) { var r = n == null ? 0 : n.length; return r ? b(n) : [];}var O = Object.prototype, D = O.hasOwnProperty, dn = E(function(n, r) { n = Object(n); var t = -1, i = r.length, a = i > 2 ? r[2] : void 0; for (a && F(r[0], r[1], a) && (i = 1); ++t < i; ) for (var f = r[t], e = _(f), s = -1, d = e.length; ++s < d; ) { var u = e[s], h = n[u]; (h === void 0 || $(h, O[u]) && !D.call(n, u)) && (n[u] = f[u]); } return n;});function un(n) { var r = n == null ? 0 : n.length; return r ? n[r - 1] : void 0;}function J(n) { return function(r, t, i) { var a = Object(r); if (!l(r)) { var f = m(t); r = P(r), t = function(s) { return f(a[s], s, a); }; } var e = n(r, t, i); return e > -1 ? a[f ? r[e] : e] : void 0; };}var U = Math.max;function Z(n, r, t) { var i = n == null ? 0 : n.length; if (!i) return -1; var a = t == null ? 0 : Y(t); return a < 0 && (a = U(i + a, 0)), p(n, m(r), a);}var hn = J(Z);function V(n, r) { var t = -1, i = l(n) ? Array(n.length) : []; return w(n, function(a, f, e) { i[++t] = r(a, f, e); }), i;}function gn(n, r) { var t = B(n) ? A : V; return t(n, m(r));}var j = Object.prototype, k = j.hasOwnProperty;function nn(n, r) { return n != null && k.call(n, r);}function mn(n, r) { return n != null && N(n, r, nn);}function rn(n, r) { return n < r;}function tn(n, r, t) { for (var i = -1, a = n.length; ++i < a; ) { var f = n[i], e = r(f); if (e != null && (s === void 0 ? e === e && !x(e) : t(e, s))) var s = e, d = f; } return d;}function on(n) { return n && n.length ? tn(n, S, rn) : void 0;}function an(n, r, t, i) { if (!g(n)) return n; r = I(r, n); for (var a = -1, f = r.length, e = f - 1, s = n; s != null && ++a < f; ) { var d = c(r[a]), u = t; if (d === "__proto__" || d === "constructor" || d === "prototype") return n; if (a != e) { var h = s[d]; u = void 0, u === void 0 && (u = g(h) ? h : T(r[a + 1]) ? [] : {}); } y(s, d, u), s = s[d]; } return n;}function vn(n, r, t) { for (var i = -1, a = r.length, f = {}; ++i < a; ) { var e = r[i], s = M(n, e); t(s, e) && an(f, I(e, n), s); } return f;}export { rn as a, tn as b, V as c, vn as d, on as e, fn as f, hn as g, mn as h, dn as i, Y as j, un as l, gn as m, X as t};123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614import { ba as S, bb as Rn, aP as T, bc as w, bd as xn, be as Mn, aO as sn, bf as mn, bg as un, bh as x, aM as N, bi as Cn, bj as on, bk as Fn, bl as E, b8 as gn, bm as R, aK as ln, bn as Dn, bo as D, bp as Gn, bq as Nn, br as _, aS as Un, bs as Bn, aN as Kn, bt as Q, bu as jn, bv as Hn, aR as qn, aQ as cn, b6 as Yn, bw as m } from "./mermaid.core-BiIw1_mh.js";var Zn = "[object Symbol]";function U(n) { return typeof n == "symbol" || S(n) && Rn(n) == Zn;}function bn(n, r) { for (var e = -1, t = n == null ? 0 : n.length, f = Array(t); ++e < t; ) f[e] = r(n[e], e, n); return f;}var X = w ? w.prototype : void 0, J = X ? X.toString : void 0;function dn(n) { if (typeof n == "string") return n; if (T(n)) return bn(n, dn) + ""; if (U(n)) return J ? J.call(n) : ""; var r = n + ""; return r == "0" && 1 / n == -1 / 0 ? "-0" : r;}function Qn() {}function pn(n, r) { for (var e = -1, t = n == null ? 0 : n.length; ++e < t && r(n[e], e, n) !== !1; ) ; return n;}function Xn(n, r, e, t) { for (var f = n.length, i = e + -1; ++i < f; ) if (r(n[i], i, n)) return i; return -1;}function Jn(n) { return n !== n;}function Wn(n, r, e) { for (var t = e - 1, f = n.length; ++t < f; ) if (n[t] === r) return t; return -1;}function zn(n, r, e) { return r === r ? Wn(n, r, e) : Xn(n, Jn, e);}function Vn(n, r) { var e = n == null ? 0 : n.length; return !!e && zn(n, r, 0) > -1;}function $(n) { return sn(n) ? xn(n) : Mn(n);}var kn = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, nr = /^\w*$/;function B(n, r) { if (T(n)) return !1; var e = typeof n; return e == "number" || e == "symbol" || e == "boolean" || n == null || U(n) ? !0 : nr.test(n) || !kn.test(n) || r != null && n in Object(r);}var rr = 500;function er(n) { var r = mn(n, function(t) { return e.size === rr && e.clear(), t; }), e = r.cache; return r;}var tr = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, ir = /\\(\\)?/g, fr = er(function(n) { var r = []; return n.charCodeAt(0) === 46 && r.push(""), n.replace(tr, function(e, t, f, i) { r.push(f ? i.replace(ir, "$1") : t || e); }), r;});function ar(n) { return n == null ? "" : dn(n);}function An(n, r) { return T(n) ? n : B(n, r) ? [n] : fr(ar(n));}function M(n) { if (typeof n == "string" || U(n)) return n; var r = n + ""; return r == "0" && 1 / n == -1 / 0 ? "-0" : r;}function yn(n, r) { r = An(r, n); for (var e = 0, t = r.length; n != null && e < t; ) n = n[M(r[e++])]; return e && e == t ? n : void 0;}function sr(n, r, e) { var t = n == null ? void 0 : yn(n, r); return t === void 0 ? e : t;}function K(n, r) { for (var e = -1, t = r.length, f = n.length; ++e < t; ) n[f + e] = r[e]; return n;}var W = w ? w.isConcatSpreadable : void 0;function ur(n) { return T(n) || un(n) || !!(W && n && n[W]);}function Ot(n, r, e, t, f) { var i = -1, a = n.length; for (e || (e = ur), f || (f = []); ++i < a; ) { var s = n[i]; e(s) ? K(f, s) : t || (f[f.length] = s); } return f;}function or(n, r, e, t) { var f = -1, i = n == null ? 0 : n.length; for (t && i && (e = n[++f]); ++f < i; ) e = r(e, n[f], f, n); return e;}function gr(n, r) { return n && x(r, $(r), n);}function lr(n, r) { return n && x(r, N(r), n);}function Tn(n, r) { for (var e = -1, t = n == null ? 0 : n.length, f = 0, i = []; ++e < t; ) { var a = n[e]; r(a, e, n) && (i[f++] = a); } return i;}function hn() { return [];}var cr = Object.prototype, br = cr.propertyIsEnumerable, z = Object.getOwnPropertySymbols, j = z ? function(n) { return n == null ? [] : (n = Object(n), Tn(z(n), function(r) { return br.call(n, r); }));} : hn;function dr(n, r) { return x(n, j(n), r);}var pr = Object.getOwnPropertySymbols, wn = pr ? function(n) { for (var r = []; n; ) K(r, j(n)), n = Cn(n); return r;} : hn;function Ar(n, r) { return x(n, wn(n), r);}function On(n, r, e) { var t = r(n); return T(n) ? t : K(t, e(n));}function G(n) { return On(n, $, j);}function yr(n) { return On(n, N, wn);}var Tr = Object.prototype, hr = Tr.hasOwnProperty;function wr(n) { var r = n.length, e = new n.constructor(r); return r && typeof n[0] == "string" && hr.call(n, "index") && (e.index = n.index, e.input = n.input), e;}function Or(n, r) { var e = r ? on(n.buffer) : n.buffer; return new n.constructor(e, n.byteOffset, n.byteLength);}var $r = /\w*$/;function _r(n) { var r = new n.constructor(n.source, $r.exec(n)); return r.lastIndex = n.lastIndex, r;}var V = w ? w.prototype : void 0, k = V ? V.valueOf : void 0;function Sr(n) { return k ? Object(k.call(n)) : {};}var Er = "[object Boolean]", Pr = "[object Date]", Ir = "[object Map]", vr = "[object Number]", Lr = "[object RegExp]", Rr = "[object Set]", xr = "[object String]", Mr = "[object Symbol]", mr = "[object ArrayBuffer]", Cr = "[object DataView]", Fr = "[object Float32Array]", Dr = "[object Float64Array]", Gr = "[object Int8Array]", Nr = "[object Int16Array]", Ur = "[object Int32Array]", Br = "[object Uint8Array]", Kr = "[object Uint8ClampedArray]", jr = "[object Uint16Array]", Hr = "[object Uint32Array]";function qr(n, r, e) { var t = n.constructor; switch (r) { case mr: return on(n); case Er: case Pr: return new t(+n); case Cr: return Or(n, e); case Fr: case Dr: case Gr: case Nr: case Ur: case Br: case Kr: case jr: case Hr: return Fn(n, e); case Ir: return new t(); case vr: case xr: return new t(n); case Lr: return _r(n); case Rr: return new t(); case Mr: return Sr(n); }}var Yr = "[object Map]";function Zr(n) { return S(n) && E(n) == Yr;}var nn = R && R.isMap, Qr = nn ? gn(nn) : Zr, Xr = "[object Set]";function Jr(n) { return S(n) && E(n) == Xr;}var rn = R && R.isSet, Wr = rn ? gn(rn) : Jr, zr = 1, Vr = 2, kr = 4, $n = "[object Arguments]", ne = "[object Array]", re = "[object Boolean]", ee = "[object Date]", te = "[object Error]", _n = "[object Function]", ie = "[object GeneratorFunction]", fe = "[object Map]", ae = "[object Number]", Sn = "[object Object]", se = "[object RegExp]", ue = "[object Set]", oe = "[object String]", ge = "[object Symbol]", le = "[object WeakMap]", ce = "[object ArrayBuffer]", be = "[object DataView]", de = "[object Float32Array]", pe = "[object Float64Array]", Ae = "[object Int8Array]", ye = "[object Int16Array]", Te = "[object Int32Array]", he = "[object Uint8Array]", we = "[object Uint8ClampedArray]", Oe = "[object Uint16Array]", $e = "[object Uint32Array]", g = {};g[$n] = g[ne] = g[ce] = g[be] = g[re] = g[ee] = g[de] = g[pe] = g[Ae] = g[ye] = g[Te] = g[fe] = g[ae] = g[Sn] = g[se] = g[ue] = g[oe] = g[ge] = g[he] = g[we] = g[Oe] = g[$e] = !0;g[te] = g[_n] = g[le] = !1;function C(n, r, e, t, f, i) { var a, s = r & zr, u = r & Vr, b = r & kr; if (a !== void 0) return a; if (!ln(n)) return n; var l = T(n); if (l) { if (a = wr(n), !s) return Dn(n, a); } else { var o = E(n), c = o == _n || o == ie; if (D(n)) return Gn(n, s); if (o == Sn || o == $n || c && !f) { if (a = u || c ? {} : Nn(n), !s) return u ? Ar(n, lr(a, n)) : dr(n, gr(a, n)); } else { if (!g[o]) return f ? n : {}; a = qr(n, o, s); } } i || (i = new _()); var h = i.get(n); if (h) return h; i.set(n, a), Wr(n) ? n.forEach(function(d) { a.add(C(d, r, e, d, n, i)); }) : Qr(n) && n.forEach(function(d, p) { a.set(p, C(d, r, e, p, n, i)); }); var A = b ? u ? yr : G : u ? N : $, y = l ? void 0 : A(n); return pn(y || n, function(d, p) { y && (p = d, d = n[p]), Un(a, p, C(d, r, e, p, n, i)); }), a;}var _e = "__lodash_hash_undefined__";function Se(n) { return this.__data__.set(n, _e), this;}function Ee(n) { return this.__data__.has(n);}function P(n) { var r = -1, e = n == null ? 0 : n.length; for (this.__data__ = new Bn(); ++r < e; ) this.add(n[r]);}P.prototype.add = P.prototype.push = Se;P.prototype.has = Ee;function Pe(n, r) { for (var e = -1, t = n == null ? 0 : n.length; ++e < t; ) if (r(n[e], e, n)) return !0; return !1;}function En(n, r) { return n.has(r);}var Ie = 1, ve = 2;function Pn(n, r, e, t, f, i) { var a = e & Ie, s = n.length, u = r.length; if (s != u && !(a && u > s)) return !1; var b = i.get(n), l = i.get(r); if (b && l) return b == r && l == n; var o = -1, c = !0, h = e & ve ? new P() : void 0; for (i.set(n, r), i.set(r, n); ++o < s; ) { var A = n[o], y = r[o]; if (t) var d = a ? t(y, A, o, r, n, i) : t(A, y, o, n, r, i); if (d !== void 0) { if (d) continue; c = !1; break; } if (h) { if (!Pe(r, function(p, O) { if (!En(h, O) && (A === p || f(A, p, e, t, i))) return h.push(O); })) { c = !1; break; } } else if (!(A === y || f(A, y, e, t, i))) { c = !1; break; } } return i.delete(n), i.delete(r), c;}function Le(n) { var r = -1, e = Array(n.size); return n.forEach(function(t, f) { e[++r] = [f, t]; }), e;}function H(n) { var r = -1, e = Array(n.size); return n.forEach(function(t) { e[++r] = t; }), e;}var Re = 1, xe = 2, Me = "[object Boolean]", me = "[object Date]", Ce = "[object Error]", Fe = "[object Map]", De = "[object Number]", Ge = "[object RegExp]", Ne = "[object Set]", Ue = "[object String]", Be = "[object Symbol]", Ke = "[object ArrayBuffer]", je = "[object DataView]", en = w ? w.prototype : void 0, F = en ? en.valueOf : void 0;function He(n, r, e, t, f, i, a) { switch (e) { case je: if (n.byteLength != r.byteLength || n.byteOffset != r.byteOffset) return !1; n = n.buffer, r = r.buffer; case Ke: return !(n.byteLength != r.byteLength || !i(new Q(n), new Q(r))); case Me: case me: case De: return Kn(+n, +r); case Ce: return n.name == r.name && n.message == r.message; case Ge: case Ue: return n == r + ""; case Fe: var s = Le; case Ne: var u = t & Re; if (s || (s = H), n.size != r.size && !u) return !1; var b = a.get(n); if (b) return b == r; t |= xe, a.set(n, r); var l = Pn(s(n), s(r), t, f, i, a); return a.delete(n), l; case Be: if (F) return F.call(n) == F.call(r); } return !1;}var qe = 1, Ye = Object.prototype, Ze = Ye.hasOwnProperty;function Qe(n, r, e, t, f, i) { var a = e & qe, s = G(n), u = s.length, b = G(r), l = b.length; if (u != l && !a) return !1; for (var o = u; o--; ) { var c = s[o]; if (!(a ? c in r : Ze.call(r, c))) return !1; } var h = i.get(n), A = i.get(r); if (h && A) return h == r && A == n; var y = !0; i.set(n, r), i.set(r, n); for (var d = a; ++o < u; ) { c = s[o]; var p = n[c], O = r[c]; if (t) var Z = a ? t(O, p, c, r, n, i) : t(p, O, c, n, r, i); if (!(Z === void 0 ? p === O || f(p, O, e, t, i) : Z)) { y = !1; break; } d || (d = c == "constructor"); } if (y && !d) { var I = n.constructor, v = r.constructor; I != v && "constructor" in n && "constructor" in r && !(typeof I == "function" && I instanceof I && typeof v == "function" && v instanceof v) && (y = !1); } return i.delete(n), i.delete(r), y;}var Xe = 1, tn = "[object Arguments]", fn = "[object Array]", L = "[object Object]", Je = Object.prototype, an = Je.hasOwnProperty;function We(n, r, e, t, f, i) { var a = T(n), s = T(r), u = a ? fn : E(n), b = s ? fn : E(r); u = u == tn ? L : u, b = b == tn ? L : b; var l = u == L, o = b == L, c = u == b; if (c && D(n)) { if (!D(r)) return !1; a = !0, l = !1; } if (c && !l) return i || (i = new _()), a || jn(n) ? Pn(n, r, e, t, f, i) : He(n, r, u, e, t, f, i); if (!(e & Xe)) { var h = l && an.call(n, "__wrapped__"), A = o && an.call(r, "__wrapped__"); if (h || A) { var y = h ? n.value() : n, d = A ? r.value() : r; return i || (i = new _()), f(y, d, e, t, i); } } return c ? (i || (i = new _()), Qe(n, r, e, t, f, i)) : !1;}function q(n, r, e, t, f) { return n === r ? !0 : n == null || r == null || !S(n) && !S(r) ? n !== n && r !== r : We(n, r, e, t, q, f);}var ze = 1, Ve = 2;function ke(n, r, e, t) { var f = e.length, i = f; if (n == null) return !i; for (n = Object(n); f--; ) { var a = e[f]; if (a[2] ? a[1] !== n[a[0]] : !(a[0] in n)) return !1; } for (; ++f < i; ) { a = e[f]; var s = a[0], u = n[s], b = a[1]; if (a[2]) { if (u === void 0 && !(s in n)) return !1; } else { var l = new _(), o; if (!(o === void 0 ? q(b, u, ze | Ve, t, l) : o)) return !1; } } return !0;}function In(n) { return n === n && !ln(n);}function nt(n) { for (var r = $(n), e = r.length; e--; ) { var t = r[e], f = n[t]; r[e] = [t, f, In(f)]; } return r;}function vn(n, r) { return function(e) { return e == null ? !1 : e[n] === r && (r !== void 0 || n in Object(e)); };}function rt(n) { var r = nt(n); return r.length == 1 && r[0][2] ? vn(r[0][0], r[0][1]) : function(e) { return e === n || ke(e, n, r); };}function et(n, r) { return n != null && r in Object(n);}function tt(n, r, e) { r = An(r, n); for (var t = -1, f = r.length, i = !1; ++t < f; ) { var a = M(r[t]); if (!(i = n != null && e(n, a))) break; n = n[a]; } return i || ++t != f ? i : (f = n == null ? 0 : n.length, !!f && Hn(f) && qn(a, f) && (T(n) || un(n)));}function it(n, r) { return n != null && tt(n, r, et);}var ft = 1, at = 2;function st(n, r) { return B(n) && In(r) ? vn(M(n), r) : function(e) { var t = sr(e, n); return t === void 0 && t === r ? it(e, n) : q(r, t, ft | at); };}function ut(n) { return function(r) { return r == null ? void 0 : r[n]; };}function ot(n) { return function(r) { return yn(r, n); };}function gt(n) { return B(n) ? ut(M(n)) : ot(n);}function Ln(n) { return typeof n == "function" ? n : n == null ? cn : typeof n == "object" ? T(n) ? st(n[0], n[1]) : rt(n) : gt(n);}function lt(n, r) { return n && Yn(n, r, $);}function ct(n, r) { return function(e, t) { if (e == null) return e; if (!sn(e)) return n(e, t); for (var f = e.length, i = -1, a = Object(e); ++i < f && t(a[i], i, a) !== !1; ) ; return e; };}var Y = ct(lt);function bt(n) { return typeof n == "function" ? n : cn;}function $t(n, r) { var e = T(n) ? pn : Y; return e(n, bt(r));}function dt(n, r) { var e = []; return Y(n, function(t, f, i) { r(t, f, i) && e.push(t); }), e;}function _t(n, r) { var e = T(n) ? Tn : dt; return e(n, Ln(r));}function pt(n, r) { return bn(r, function(e) { return n[e]; });}function St(n) { return n == null ? [] : pt(n, $(n));}function Et(n) { return n === void 0;}function At(n, r, e, t, f) { return f(n, function(i, a, s) { e = t ? (t = !1, i) : r(e, i, a, s); }), e;}function Pt(n, r, e) { var t = T(n) ? or : At, f = arguments.length < 3; return t(n, Ln(r), e, f, Y);}var yt = 1 / 0, Tt = m && 1 / H(new m([, -0]))[1] == yt ? function(n) { return new m(n);} : Qn, ht = 200;function It(n, r, e) { var t = -1, f = Vn, i = n.length, a = !0, s = [], u = s; if (i >= ht) { var b = r ? null : Tt(n); if (b) return H(b); a = !1, f = En, u = new P(); } else u = r ? [] : s; n: for (; ++t < i; ) { var l = n[t], o = r ? r(l) : l; if (l = l !== 0 ? l : 0, a && o === o) { for (var c = u.length; c--; ) if (u[c] === o) continue n; r && u.push(o), s.push(l); } else f(u, o, e) || (u !== s && u.push(o), s.push(l)); } return s;}export { Tn as A, dt as B, Pe as C, Qn as D, P as S, It as a, C as b, Ot as c, $t as d, U as e, _t as f, Ln as g, Xn as h, Et as i, Y as j, $ as k, bn as l, tt as m, An as n, yn as o, bt as p, lt as q, Pt as r, it as s, M as t, ar as u, St as v, Vn as w, En as x, zn as y, yr as z};1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283import { a0 as ln, a1 as an, a2 as H, a3 as q, a4 as B, a5 as un, a6 as y, a7 as tn, a8 as L, a9 as _, aa as rn, ab as o, ac as sn, ad as on, ae as fn } from "./mermaid.core-BiIw1_mh.js";function cn(l) { return l.innerRadius;}function yn(l) { return l.outerRadius;}function gn(l) { return l.startAngle;}function dn(l) { return l.endAngle;}function mn(l) { return l && l.padAngle;}function pn(l, h, I, D, v, A, C, a) { var O = I - l, i = D - h, n = C - v, d = a - A, u = d * O - n * i; if (!(u * u < y)) return u = (n * (h - A) - d * (l - v)) / u, [l + u * O, h + u * i];}function W(l, h, I, D, v, A, C) { var a = l - I, O = h - D, i = (C ? A : -A) / L(a * a + O * O), n = i * O, d = -i * a, u = l + n, s = h + d, f = I + n, c = D + d, F = (u + f) / 2, t = (s + c) / 2, m = f - u, g = c - s, R = m * m + g * g, T = v - A, P = u * c - f * s, S = (g < 0 ? -1 : 1) * L(on(0, T * T * R - P * P)), j = (P * g - m * S) / R, z = (-P * m - g * S) / R, w = (P * g + m * S) / R, p = (-P * m + g * S) / R, x = j - F, e = z - t, r = w - F, G = p - t; return x * x + e * e > r * r + G * G && (j = w, z = p), { cx: j, cy: z, x01: -n, y01: -d, x11: j * (v / T - 1), y11: z * (v / T - 1) };}function hn() { var l = cn, h = yn, I = B(0), D = null, v = gn, A = dn, C = mn, a = null, O = ln(i); function i() { var n, d, u = +l.apply(this, arguments), s = +h.apply(this, arguments), f = v.apply(this, arguments) - un, c = A.apply(this, arguments) - un, F = rn(c - f), t = c > f; if (a || (a = n = O()), s < u && (d = s, s = u, u = d), !(s > y)) a.moveTo(0, 0); else if (F > tn - y) a.moveTo(s * H(f), s * q(f)), a.arc(0, 0, s, f, c, !t), u > y && (a.moveTo(u * H(c), u * q(c)), a.arc(0, 0, u, c, f, t)); else { var m = f, g = c, R = f, T = c, P = F, S = F, j = C.apply(this, arguments) / 2, z = j > y && (D ? +D.apply(this, arguments) : L(u * u + s * s)), w = _(rn(s - u) / 2, +I.apply(this, arguments)), p = w, x = w, e, r; if (z > y) { var G = sn(z / u * q(j)), M = sn(z / s * q(j)); (P -= G * 2) > y ? (G *= t ? 1 : -1, R += G, T -= G) : (P = 0, R = T = (f + c) / 2), (S -= M * 2) > y ? (M *= t ? 1 : -1, m += M, g -= M) : (S = 0, m = g = (f + c) / 2); } var J = s * H(m), K = s * q(m), N = u * H(T), Q = u * q(T); if (w > y) { var U = s * H(g), V = s * q(g), X = u * H(R), Y = u * q(R), E; if (F < an) if (E = pn(J, K, X, Y, U, V, N, Q)) { var Z = J - E[0], $ = K - E[1], b = U - E[0], k = V - E[1], nn = 1 / q(fn((Z * b + $ * k) / (L(Z * Z + $ * $) * L(b * b + k * k))) / 2), en = L(E[0] * E[0] + E[1] * E[1]); p = _(w, (u - en) / (nn - 1)), x = _(w, (s - en) / (nn + 1)); } else p = x = 0; } S > y ? x > y ? (e = W(X, Y, J, K, s, x, t), r = W(U, V, N, Q, s, x, t), a.moveTo(e.cx + e.x01, e.cy + e.y01), x < w ? a.arc(e.cx, e.cy, x, o(e.y01, e.x01), o(r.y01, r.x01), !t) : (a.arc(e.cx, e.cy, x, o(e.y01, e.x01), o(e.y11, e.x11), !t), a.arc(0, 0, s, o(e.cy + e.y11, e.cx + e.x11), o(r.cy + r.y11, r.cx + r.x11), !t), a.arc(r.cx, r.cy, x, o(r.y11, r.x11), o(r.y01, r.x01), !t))) : (a.moveTo(J, K), a.arc(0, 0, s, m, g, !t)) : a.moveTo(J, K), !(u > y) || !(P > y) ? a.lineTo(N, Q) : p > y ? (e = W(N, Q, U, V, u, -p, t), r = W(J, K, X, Y, u, -p, t), a.lineTo(e.cx + e.x01, e.cy + e.y01), p < w ? a.arc(e.cx, e.cy, p, o(e.y01, e.x01), o(r.y01, r.x01), !t) : (a.arc(e.cx, e.cy, p, o(e.y01, e.x01), o(e.y11, e.x11), !t), a.arc(0, 0, u, o(e.cy + e.y11, e.cx + e.x11), o(r.cy + r.y11, r.cx + r.x11), t), a.arc(r.cx, r.cy, p, o(r.y11, r.x11), o(r.y01, r.x01), !t))) : a.arc(0, 0, u, T, R, t); } if (a.closePath(), n) return a = null, n + "" || null; } return i.centroid = function() { var n = (+l.apply(this, arguments) + +h.apply(this, arguments)) / 2, d = (+v.apply(this, arguments) + +A.apply(this, arguments)) / 2 - an / 2; return [H(d) * n, q(d) * n]; }, i.innerRadius = function(n) { return arguments.length ? (l = typeof n == "function" ? n : B(+n), i) : l; }, i.outerRadius = function(n) { return arguments.length ? (h = typeof n == "function" ? n : B(+n), i) : h; }, i.cornerRadius = function(n) { return arguments.length ? (I = typeof n == "function" ? n : B(+n), i) : I; }, i.padRadius = function(n) { return arguments.length ? (D = n == null ? null : typeof n == "function" ? n : B(+n), i) : D; }, i.startAngle = function(n) { return arguments.length ? (v = typeof n == "function" ? n : B(+n), i) : v; }, i.endAngle = function(n) { return arguments.length ? (A = typeof n == "function" ? n : B(+n), i) : A; }, i.padAngle = function(n) { return arguments.length ? (C = typeof n == "function" ? n : B(+n), i) : C; }, i.context = function(n) { return arguments.length ? (a = n ?? null, i) : a; }, i;}export { hn as d};123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581import { g as Se, d as De } from "./chunk-WZLT4MVT-CfJwH0hJ.js";import { _ as g, s as Pe, g as Be, a as Ie, b as Me, c as Bt, d as jt, l as de, e as Le, f as Ne, h as Tt, i as ge, j as Ye, w as je, k as $t, m as fe } from "./mermaid.core-BiIw1_mh.js";var Ft = function() { var e = /* @__PURE__ */ g(function(_t, x, m, v) { for (m = m || {}, v = _t.length; v--; m[_t[v]] = x) ; return m; }, "o"), t = [1, 24], s = [1, 25], o = [1, 26], l = [1, 27], a = [1, 28], r = [1, 63], n = [1, 64], i = [1, 65], u = [1, 66], d = [1, 67], f = [1, 68], y = [1, 69], E = [1, 29], O = [1, 30], S = [1, 31], P = [1, 32], M = [1, 33], U = [1, 34], H = [1, 35], q = [1, 36], G = [1, 37], K = [1, 38], J = [1, 39], Z = [1, 40], $ = [1, 41], tt = [1, 42], et = [1, 43], at = [1, 44], it = [1, 45], nt = [1, 46], rt = [1, 47], st = [1, 48], lt = [1, 50], ot = [1, 51], ct = [1, 52], ht = [1, 53], ut = [1, 54], dt = [1, 55], ft = [1, 56], pt = [1, 57], yt = [1, 58], gt = [1, 59], bt = [1, 60], Ct = [14, 42], Qt = [14, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], St = [12, 14, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], k = [1, 82], A = [1, 83], C = [1, 84], w = [1, 85], T = [12, 14, 42], le = [12, 14, 33, 42], Mt = [12, 14, 33, 42, 76, 77, 79, 80], vt = [12, 33], Ht = [34, 36, 37, 38, 39, 40, 41, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], qt = { trace: /* @__PURE__ */ g(function() { }, "trace"), yy: {}, symbols_: { error: 2, start: 3, mermaidDoc: 4, direction: 5, direction_tb: 6, direction_bt: 7, direction_rl: 8, direction_lr: 9, graphConfig: 10, C4_CONTEXT: 11, NEWLINE: 12, statements: 13, EOF: 14, C4_CONTAINER: 15, C4_COMPONENT: 16, C4_DYNAMIC: 17, C4_DEPLOYMENT: 18, otherStatements: 19, diagramStatements: 20, otherStatement: 21, title: 22, accDescription: 23, acc_title: 24, acc_title_value: 25, acc_descr: 26, acc_descr_value: 27, acc_descr_multiline_value: 28, boundaryStatement: 29, boundaryStartStatement: 30, boundaryStopStatement: 31, boundaryStart: 32, LBRACE: 33, ENTERPRISE_BOUNDARY: 34, attributes: 35, SYSTEM_BOUNDARY: 36, BOUNDARY: 37, CONTAINER_BOUNDARY: 38, NODE: 39, NODE_L: 40, NODE_R: 41, RBRACE: 42, diagramStatement: 43, PERSON: 44, PERSON_EXT: 45, SYSTEM: 46, SYSTEM_DB: 47, SYSTEM_QUEUE: 48, SYSTEM_EXT: 49, SYSTEM_EXT_DB: 50, SYSTEM_EXT_QUEUE: 51, CONTAINER: 52, CONTAINER_DB: 53, CONTAINER_QUEUE: 54, CONTAINER_EXT: 55, CONTAINER_EXT_DB: 56, CONTAINER_EXT_QUEUE: 57, COMPONENT: 58, COMPONENT_DB: 59, COMPONENT_QUEUE: 60, COMPONENT_EXT: 61, COMPONENT_EXT_DB: 62, COMPONENT_EXT_QUEUE: 63, REL: 64, BIREL: 65, REL_U: 66, REL_D: 67, REL_L: 68, REL_R: 69, REL_B: 70, REL_INDEX: 71, UPDATE_EL_STYLE: 72, UPDATE_REL_STYLE: 73, UPDATE_LAYOUT_CONFIG: 74, attribute: 75, STR: 76, STR_KEY: 77, STR_VALUE: 78, ATTRIBUTE: 79, ATTRIBUTE_EMPTY: 80, $accept: 0, $end: 1 }, terminals_: { 2: "error", 6: "direction_tb", 7: "direction_bt", 8: "direction_rl", 9: "direction_lr", 11: "C4_CONTEXT", 12: "NEWLINE", 14: "EOF", 15: "C4_CONTAINER", 16: "C4_COMPONENT", 17: "C4_DYNAMIC", 18: "C4_DEPLOYMENT", 22: "title", 23: "accDescription", 24: "acc_title", 25: "acc_title_value", 26: "acc_descr", 27: "acc_descr_value", 28: "acc_descr_multiline_value", 33: "LBRACE", 34: "ENTERPRISE_BOUNDARY", 36: "SYSTEM_BOUNDARY", 37: "BOUNDARY", 38: "CONTAINER_BOUNDARY", 39: "NODE", 40: "NODE_L", 41: "NODE_R", 42: "RBRACE", 44: "PERSON", 45: "PERSON_EXT", 46: "SYSTEM", 47: "SYSTEM_DB", 48: "SYSTEM_QUEUE", 49: "SYSTEM_EXT", 50: "SYSTEM_EXT_DB", 51: "SYSTEM_EXT_QUEUE", 52: "CONTAINER", 53: "CONTAINER_DB", 54: "CONTAINER_QUEUE", 55: "CONTAINER_EXT", 56: "CONTAINER_EXT_DB", 57: "CONTAINER_EXT_QUEUE", 58: "COMPONENT", 59: "COMPONENT_DB", 60: "COMPONENT_QUEUE", 61: "COMPONENT_EXT", 62: "COMPONENT_EXT_DB", 63: "COMPONENT_EXT_QUEUE", 64: "REL", 65: "BIREL", 66: "REL_U", 67: "REL_D", 68: "REL_L", 69: "REL_R", 70: "REL_B", 71: "REL_INDEX", 72: "UPDATE_EL_STYLE", 73: "UPDATE_REL_STYLE", 74: "UPDATE_LAYOUT_CONFIG", 76: "STR", 77: "STR_KEY", 78: "STR_VALUE", 79: "ATTRIBUTE", 80: "ATTRIBUTE_EMPTY" }, productions_: [0, [3, 1], [3, 1], [5, 1], [5, 1], [5, 1], [5, 1], [4, 1], [10, 4], [10, 4], [10, 4], [10, 4], [10, 4], [13, 1], [13, 1], [13, 2], [19, 1], [19, 2], [19, 3], [21, 1], [21, 1], [21, 2], [21, 2], [21, 1], [29, 3], [30, 3], [30, 3], [30, 4], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [32, 2], [31, 1], [20, 1], [20, 2], [20, 3], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 1], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [43, 2], [35, 1], [35, 2], [75, 1], [75, 2], [75, 1], [75, 1]], performAction: /* @__PURE__ */ g(function(x, m, v, b, R, h, Dt) { var p = h.length - 1; switch (R) { case 3: b.setDirection("TB"); break; case 4: b.setDirection("BT"); break; case 5: b.setDirection("RL"); break; case 6: b.setDirection("LR"); break; case 8: case 9: case 10: case 11: case 12: b.setC4Type(h[p - 3]); break; case 19: b.setTitle(h[p].substring(6)), this.$ = h[p].substring(6); break; case 20: b.setAccDescription(h[p].substring(15)), this.$ = h[p].substring(15); break; case 21: this.$ = h[p].trim(), b.setTitle(this.$); break; case 22: case 23: this.$ = h[p].trim(), b.setAccDescription(this.$); break; case 28: h[p].splice(2, 0, "ENTERPRISE"), b.addPersonOrSystemBoundary(...h[p]), this.$ = h[p]; break; case 29: h[p].splice(2, 0, "SYSTEM"), b.addPersonOrSystemBoundary(...h[p]), this.$ = h[p]; break; case 30: b.addPersonOrSystemBoundary(...h[p]), this.$ = h[p]; break; case 31: h[p].splice(2, 0, "CONTAINER"), b.addContainerBoundary(...h[p]), this.$ = h[p]; break; case 32: b.addDeploymentNode("node", ...h[p]), this.$ = h[p]; break; case 33: b.addDeploymentNode("nodeL", ...h[p]), this.$ = h[p]; break; case 34: b.addDeploymentNode("nodeR", ...h[p]), this.$ = h[p]; break; case 35: b.popBoundaryParseStack(); break; case 39: b.addPersonOrSystem("person", ...h[p]), this.$ = h[p]; break; case 40: b.addPersonOrSystem("external_person", ...h[p]), this.$ = h[p]; break; case 41: b.addPersonOrSystem("system", ...h[p]), this.$ = h[p]; break; case 42: b.addPersonOrSystem("system_db", ...h[p]), this.$ = h[p]; break; case 43: b.addPersonOrSystem("system_queue", ...h[p]), this.$ = h[p]; break; case 44: b.addPersonOrSystem("external_system", ...h[p]), this.$ = h[p]; break; case 45: b.addPersonOrSystem("external_system_db", ...h[p]), this.$ = h[p]; break; case 46: b.addPersonOrSystem("external_system_queue", ...h[p]), this.$ = h[p]; break; case 47: b.addContainer("container", ...h[p]), this.$ = h[p]; break; case 48: b.addContainer("container_db", ...h[p]), this.$ = h[p]; break; case 49: b.addContainer("container_queue", ...h[p]), this.$ = h[p]; break; case 50: b.addContainer("external_container", ...h[p]), this.$ = h[p]; break; case 51: b.addContainer("external_container_db", ...h[p]), this.$ = h[p]; break; case 52: b.addContainer("external_container_queue", ...h[p]), this.$ = h[p]; break; case 53: b.addComponent("component", ...h[p]), this.$ = h[p]; break; case 54: b.addComponent("component_db", ...h[p]), this.$ = h[p]; break; case 55: b.addComponent("component_queue", ...h[p]), this.$ = h[p]; break; case 56: b.addComponent("external_component", ...h[p]), this.$ = h[p]; break; case 57: b.addComponent("external_component_db", ...h[p]), this.$ = h[p]; break; case 58: b.addComponent("external_component_queue", ...h[p]), this.$ = h[p]; break; case 60: b.addRel("rel", ...h[p]), this.$ = h[p]; break; case 61: b.addRel("birel", ...h[p]), this.$ = h[p]; break; case 62: b.addRel("rel_u", ...h[p]), this.$ = h[p]; break; case 63: b.addRel("rel_d", ...h[p]), this.$ = h[p]; break; case 64: b.addRel("rel_l", ...h[p]), this.$ = h[p]; break; case 65: b.addRel("rel_r", ...h[p]), this.$ = h[p]; break; case 66: b.addRel("rel_b", ...h[p]), this.$ = h[p]; break; case 67: h[p].splice(0, 1), b.addRel("rel", ...h[p]), this.$ = h[p]; break; case 68: b.updateElStyle("update_el_style", ...h[p]), this.$ = h[p]; break; case 69: b.updateRelStyle("update_rel_style", ...h[p]), this.$ = h[p]; break; case 70: b.updateLayoutConfig("update_layout_config", ...h[p]), this.$ = h[p]; break; case 71: this.$ = [h[p]]; break; case 72: h[p].unshift(h[p - 1]), this.$ = h[p]; break; case 73: case 75: this.$ = h[p].trim(); break; case 74: let Et = {}; Et[h[p - 1].trim()] = h[p].trim(), this.$ = Et; break; case 76: this.$ = ""; break; } }, "anonymous"), table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 7: [1, 6], 8: [1, 7], 9: [1, 8], 10: 4, 11: [1, 9], 15: [1, 10], 16: [1, 11], 17: [1, 12], 18: [1, 13] }, { 1: [3] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 7] }, { 1: [2, 3] }, { 1: [2, 4] }, { 1: [2, 5] }, { 1: [2, 6] }, { 12: [1, 14] }, { 12: [1, 15] }, { 12: [1, 16] }, { 12: [1, 17] }, { 12: [1, 18] }, { 13: 19, 19: 20, 20: 21, 21: 22, 22: t, 23: s, 24: o, 26: l, 28: a, 29: 49, 30: 61, 32: 62, 34: r, 36: n, 37: i, 38: u, 39: d, 40: f, 41: y, 43: 23, 44: E, 45: O, 46: S, 47: P, 48: M, 49: U, 50: H, 51: q, 52: G, 53: K, 54: J, 55: Z, 56: $, 57: tt, 58: et, 59: at, 60: it, 61: nt, 62: rt, 63: st, 64: lt, 65: ot, 66: ct, 67: ht, 68: ut, 69: dt, 70: ft, 71: pt, 72: yt, 73: gt, 74: bt }, { 13: 70, 19: 20, 20: 21, 21: 22, 22: t, 23: s, 24: o, 26: l, 28: a, 29: 49, 30: 61, 32: 62, 34: r, 36: n, 37: i, 38: u, 39: d, 40: f, 41: y, 43: 23, 44: E, 45: O, 46: S, 47: P, 48: M, 49: U, 50: H, 51: q, 52: G, 53: K, 54: J, 55: Z, 56: $, 57: tt, 58: et, 59: at, 60: it, 61: nt, 62: rt, 63: st, 64: lt, 65: ot, 66: ct, 67: ht, 68: ut, 69: dt, 70: ft, 71: pt, 72: yt, 73: gt, 74: bt }, { 13: 71, 19: 20, 20: 21, 21: 22, 22: t, 23: s, 24: o, 26: l, 28: a, 29: 49, 30: 61, 32: 62, 34: r, 36: n, 37: i, 38: u, 39: d, 40: f, 41: y, 43: 23, 44: E, 45: O, 46: S, 47: P, 48: M, 49: U, 50: H, 51: q, 52: G, 53: K, 54: J, 55: Z, 56: $, 57: tt, 58: et, 59: at, 60: it, 61: nt, 62: rt, 63: st, 64: lt, 65: ot, 66: ct, 67: ht, 68: ut, 69: dt, 70: ft, 71: pt, 72: yt, 73: gt, 74: bt }, { 13: 72, 19: 20, 20: 21, 21: 22, 22: t, 23: s, 24: o, 26: l, 28: a, 29: 49, 30: 61, 32: 62, 34: r, 36: n, 37: i, 38: u, 39: d, 40: f, 41: y, 43: 23, 44: E, 45: O, 46: S, 47: P, 48: M, 49: U, 50: H, 51: q, 52: G, 53: K, 54: J, 55: Z, 56: $, 57: tt, 58: et, 59: at, 60: it, 61: nt, 62: rt, 63: st, 64: lt, 65: ot, 66: ct, 67: ht, 68: ut, 69: dt, 70: ft, 71: pt, 72: yt, 73: gt, 74: bt }, { 13: 73, 19: 20, 20: 21, 21: 22, 22: t, 23: s, 24: o, 26: l, 28: a, 29: 49, 30: 61, 32: 62, 34: r, 36: n, 37: i, 38: u, 39: d, 40: f, 41: y, 43: 23, 44: E, 45: O, 46: S, 47: P, 48: M, 49: U, 50: H, 51: q, 52: G, 53: K, 54: J, 55: Z, 56: $, 57: tt, 58: et, 59: at, 60: it, 61: nt, 62: rt, 63: st, 64: lt, 65: ot, 66: ct, 67: ht, 68: ut, 69: dt, 70: ft, 71: pt, 72: yt, 73: gt, 74: bt }, { 14: [1, 74] }, e(Ct, [2, 13], { 43: 23, 29: 49, 30: 61, 32: 62, 20: 75, 34: r, 36: n, 37: i, 38: u, 39: d, 40: f, 41: y, 44: E, 45: O, 46: S, 47: P, 48: M, 49: U, 50: H, 51: q, 52: G, 53: K, 54: J, 55: Z, 56: $, 57: tt, 58: et, 59: at, 60: it, 61: nt, 62: rt, 63: st, 64: lt, 65: ot, 66: ct, 67: ht, 68: ut, 69: dt, 70: ft, 71: pt, 72: yt, 73: gt, 74: bt }), e(Ct, [2, 14]), e(Qt, [2, 16], { 12: [1, 76] }), e(Ct, [2, 36], { 12: [1, 77] }), e(St, [2, 19]), e(St, [2, 20]), { 25: [1, 78] }, { 27: [1, 79] }, e(St, [2, 23]), { 35: 80, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 86, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 87, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 88, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 89, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 90, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 91, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 92, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 93, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 94, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 95, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 96, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 97, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 98, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 99, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 100, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 101, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 102, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 103, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 104, 75: 81, 76: k, 77: A, 79: C, 80: w }, e(T, [2, 59]), { 35: 105, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 106, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 107, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 108, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 109, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 110, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 111, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 112, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 113, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 114, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 115, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 20: 116, 29: 49, 30: 61, 32: 62, 34: r, 36: n, 37: i, 38: u, 39: d, 40: f, 41: y, 43: 23, 44: E, 45: O, 46: S, 47: P, 48: M, 49: U, 50: H, 51: q, 52: G, 53: K, 54: J, 55: Z, 56: $, 57: tt, 58: et, 59: at, 60: it, 61: nt, 62: rt, 63: st, 64: lt, 65: ot, 66: ct, 67: ht, 68: ut, 69: dt, 70: ft, 71: pt, 72: yt, 73: gt, 74: bt }, { 12: [1, 118], 33: [1, 117] }, { 35: 119, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 120, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 121, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 122, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 123, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 124, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 35: 125, 75: 81, 76: k, 77: A, 79: C, 80: w }, { 14: [1, 126] }, { 14: [1, 127] }, { 14: [1, 128] }, { 14: [1, 129] }, { 1: [2, 8] }, e(Ct, [2, 15]), e(Qt, [2, 17], { 21: 22, 19: 130, 22: t, 23: s, 24: o, 26: l, 28: a }), e(Ct, [2, 37], { 19: 20, 20: 21, 21: 22, 43: 23, 29: 49, 30: 61, 32: 62, 13: 131, 22: t, 23: s, 24: o, 26: l, 28: a, 34: r, 36: n, 37: i, 38: u, 39: d, 40: f, 41: y, 44: E, 45: O, 46: S, 47: P, 48: M, 49: U, 50: H, 51: q, 52: G, 53: K, 54: J, 55: Z, 56: $, 57: tt, 58: et, 59: at, 60: it, 61: nt, 62: rt, 63: st, 64: lt, 65: ot, 66: ct, 67: ht, 68: ut, 69: dt, 70: ft, 71: pt, 72: yt, 73: gt, 74: bt }), e(St, [2, 21]), e(St, [2, 22]), e(T, [2, 39]), e(le, [2, 71], { 75: 81, 35: 132, 76: k, 77: A, 79: C, 80: w }), e(Mt, [2, 73]), { 78: [1, 133] }, e(Mt, [2, 75]), e(Mt, [2, 76]), e(T, [2, 40]), e(T, [2, 41]), e(T, [2, 42]), e(T, [2, 43]), e(T, [2, 44]), e(T, [2, 45]), e(T, [2, 46]), e(T, [2, 47]), e(T, [2, 48]), e(T, [2, 49]), e(T, [2, 50]), e(T, [2, 51]), e(T, [2, 52]), e(T, [2, 53]), e(T, [2, 54]), e(T, [2, 55]), e(T, [2, 56]), e(T, [2, 57]), e(T, [2, 58]), e(T, [2, 60]), e(T, [2, 61]), e(T, [2, 62]), e(T, [2, 63]), e(T, [2, 64]), e(T, [2, 65]), e(T, [2, 66]), e(T, [2, 67]), e(T, [2, 68]), e(T, [2, 69]), e(T, [2, 70]), { 31: 134, 42: [1, 135] }, { 12: [1, 136] }, { 33: [1, 137] }, e(vt, [2, 28]), e(vt, [2, 29]), e(vt, [2, 30]), e(vt, [2, 31]), e(vt, [2, 32]), e(vt, [2, 33]), e(vt, [2, 34]), { 1: [2, 9] }, { 1: [2, 10] }, { 1: [2, 11] }, { 1: [2, 12] }, e(Qt, [2, 18]), e(Ct, [2, 38]), e(le, [2, 72]), e(Mt, [2, 74]), e(T, [2, 24]), e(T, [2, 35]), e(Ht, [2, 25]), e(Ht, [2, 26], { 12: [1, 138] }), e(Ht, [2, 27])], defaultActions: { 2: [2, 1], 3: [2, 2], 4: [2, 7], 5: [2, 3], 6: [2, 4], 7: [2, 5], 8: [2, 6], 74: [2, 8], 126: [2, 9], 127: [2, 10], 128: [2, 11], 129: [2, 12] }, parseError: /* @__PURE__ */ g(function(x, m) { if (m.recoverable) this.trace(x); else { var v = new Error(x); throw v.hash = m, v; } }, "parseError"), parse: /* @__PURE__ */ g(function(x) { var m = this, v = [0], b = [], R = [null], h = [], Dt = this.table, p = "", Et = 0, oe = 0, we = 2, ce = 1, Te = h.slice.call(arguments, 1), D = Object.create(this.lexer), kt = { yy: {} }; for (var Gt in this.yy) Object.prototype.hasOwnProperty.call(this.yy, Gt) && (kt.yy[Gt] = this.yy[Gt]); D.setInput(x, kt.yy), kt.yy.lexer = D, kt.yy.parser = this, typeof D.yylloc > "u" && (D.yylloc = {}); var Kt = D.yylloc; h.push(Kt); var Oe = D.options && D.options.ranges; typeof kt.yy.parseError == "function" ? this.parseError = kt.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError; function Re(L) { v.length = v.length - 2 * L, R.length = R.length - L, h.length = h.length - L; } g(Re, "popStack"); function he() { var L; return L = b.pop() || D.lex() || ce, typeof L != "number" && (L instanceof Array && (b = L, L = b.pop()), L = m.symbols_[L] || L), L; } g(he, "lex"); for (var I, At, N, Jt, wt = {}, Nt, W, ue, Yt; ; ) { if (At = v[v.length - 1], this.defaultActions[At] ? N = this.defaultActions[At] : ((I === null || typeof I > "u") && (I = he()), N = Dt[At] && Dt[At][I]), typeof N > "u" || !N.length || !N[0]) { var Zt = ""; Yt = []; for (Nt in Dt[At]) this.terminals_[Nt] && Nt > we && Yt.push("'" + this.terminals_[Nt] + "'"); D.showPosition ? Zt = "Parse error on line " + (Et + 1) + `:` + D.showPosition() + `Expecting ` + Yt.join(", ") + ", got '" + (this.terminals_[I] || I) + "'" : Zt = "Parse error on line " + (Et + 1) + ": Unexpected " + (I == ce ? "end of input" : "'" + (this.terminals_[I] || I) + "'"), this.parseError(Zt, { text: D.match, token: this.terminals_[I] || I, line: D.yylineno, loc: Kt, expected: Yt }); } if (N[0] instanceof Array && N.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + At + ", token: " + I); switch (N[0]) { case 1: v.push(I), R.push(D.yytext), h.push(D.yylloc), v.push(N[1]), I = null, oe = D.yyleng, p = D.yytext, Et = D.yylineno, Kt = D.yylloc; break; case 2: if (W = this.productions_[N[1]][1], wt.$ = R[R.length - W], wt._$ = { first_line: h[h.length - (W || 1)].first_line, last_line: h[h.length - 1].last_line, first_column: h[h.length - (W || 1)].first_column, last_column: h[h.length - 1].last_column }, Oe && (wt._$.range = [ h[h.length - (W || 1)].range[0], h[h.length - 1].range[1] ]), Jt = this.performAction.apply(wt, [ p, oe, Et, kt.yy, N[1], R, h ].concat(Te)), typeof Jt < "u") return Jt; W && (v = v.slice(0, -1 * W * 2), R = R.slice(0, -1 * W), h = h.slice(0, -1 * W)), v.push(this.productions_[N[1]][0]), R.push(wt.$), h.push(wt._$), ue = Dt[v[v.length - 2]][v[v.length - 1]], v.push(ue); break; case 3: return !0; } } return !0; }, "parse") }, Ce = /* @__PURE__ */ function() { var _t = { EOF: 1, parseError: /* @__PURE__ */ g(function(m, v) { if (this.yy.parser) this.yy.parser.parseError(m, v); else throw new Error(m); }, "parseError"), // resets the lexer, sets new input setInput: /* @__PURE__ */ g(function(x, m) { return this.yy = m || this.yy || {}, this._input = x, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this; }, "setInput"), // consumes and returns one char from the input input: /* @__PURE__ */ g(function() { var x = this._input[0]; this.yytext += x, this.yyleng++, this.offset++, this.match += x, this.matched += x; var m = x.match(/(?:\r\n?|\n).*/g); return m ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), x; }, "input"), // unshifts one char (or a string) into the input unput: /* @__PURE__ */ g(function(x) { var m = x.length, v = x.split(/(?:\r\n?|\n)/g); this._input = x + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - m), this.offset -= m; var b = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), v.length - 1 && (this.yylineno -= v.length - 1); var R = this.yylloc.range; return this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: v ? (v.length === b.length ? this.yylloc.first_column : 0) + b[b.length - v.length].length - v[0].length : this.yylloc.first_column - m }, this.options.ranges && (this.yylloc.range = [R[0], R[0] + this.yyleng - m]), this.yyleng = this.yytext.length, this; }, "unput"), // When called from action, caches matched text and appends it on next action more: /* @__PURE__ */ g(function() { return this._more = !0, this; }, "more"), // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject: /* @__PURE__ */ g(function() { if (this.options.backtrack_lexer) this._backtrack = !0; else return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).` + this.showPosition(), { text: "", token: null, line: this.yylineno }); return this; }, "reject"), // retain first n characters of the match less: /* @__PURE__ */ g(function(x) { this.unput(this.match.slice(x)); }, "less"), // displays already matched input, i.e. for error messages pastInput: /* @__PURE__ */ g(function() { var x = this.matched.substr(0, this.matched.length - this.match.length); return (x.length > 20 ? "..." : "") + x.substr(-20).replace(/\n/g, ""); }, "pastInput"), // displays upcoming input, i.e. for error messages upcomingInput: /* @__PURE__ */ g(function() { var x = this.match; return x.length < 20 && (x += this._input.substr(0, 20 - x.length)), (x.substr(0, 20) + (x.length > 20 ? "..." : "")).replace(/\n/g, ""); }, "upcomingInput"), // displays the character position where the lexing error occurred, i.e. for error messages showPosition: /* @__PURE__ */ g(function() { var x = this.pastInput(), m = new Array(x.length + 1).join("-"); return x + this.upcomingInput() + `` + m + "^"; }, "showPosition"), // test the lexed token: return FALSE when not a match, otherwise return token test_match: /* @__PURE__ */ g(function(x, m) { var v, b, R; if (this.options.backtrack_lexer && (R = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }, this.options.ranges && (R.yylloc.range = this.yylloc.range.slice(0))), b = x[0].match(/(?:\r\n?|\n).*/g), b && (this.yylineno += b.length), this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: b ? b[b.length - 1].length - b[b.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + x[0].length }, this.yytext += x[0], this.match += x[0], this.matches = x, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(x[0].length), this.matched += x[0], v = this.performAction.call(this, this.yy, this, m, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), v) return v; if (this._backtrack) { for (var h in R) this[h] = R[h]; return !1; } return !1; }, "test_match"), // return next match in input next: /* @__PURE__ */ g(function() { if (this.done) return this.EOF; this._input || (this.done = !0); var x, m, v, b; this._more || (this.yytext = "", this.match = ""); for (var R = this._currentRules(), h = 0; h < R.length; h++) if (v = this._input.match(this.rules[R[h]]), v && (!m || v[0].length > m[0].length)) { if (m = v, b = h, this.options.backtrack_lexer) { if (x = this.test_match(v, R[h]), x !== !1) return x; if (this._backtrack) { m = !1; continue; } else return !1; } else if (!this.options.flex) break; } return m ? (x = this.test_match(m, R[b]), x !== !1 ? x : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.` + this.showPosition(), { text: "", token: null, line: this.yylineno }); }, "next"), // return next match that has a token lex: /* @__PURE__ */ g(function() { var m = this.next(); return m || this.lex(); }, "lex"), // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin: /* @__PURE__ */ g(function(m) { this.conditionStack.push(m); }, "begin"), // pop the previously active lexer condition state off the condition stack popState: /* @__PURE__ */ g(function() { var m = this.conditionStack.length - 1; return m > 0 ? this.conditionStack.pop() : this.conditionStack[0]; }, "popState"), // produce the lexer rule set which is active for the currently active lexer condition state _currentRules: /* @__PURE__ */ g(function() { return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules; }, "_currentRules"), // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState: /* @__PURE__ */ g(function(m) { return m = this.conditionStack.length - 1 - Math.abs(m || 0), m >= 0 ? this.conditionStack[m] : "INITIAL"; }, "topState"), // alias for begin(condition) pushState: /* @__PURE__ */ g(function(m) { this.begin(m); }, "pushState"), // return the number of states currently on the stack stateStackSize: /* @__PURE__ */ g(function() { return this.conditionStack.length; }, "stateStackSize"), options: {}, performAction: /* @__PURE__ */ g(function(m, v, b, R) { switch (b) { case 0: return 6; case 1: return 7; case 2: return 8; case 3: return 9; case 4: return 22; case 5: return 23; case 6: return this.begin("acc_title"), 24; case 7: return this.popState(), "acc_title_value"; case 8: return this.begin("acc_descr"), 26; case 9: return this.popState(), "acc_descr_value"; case 10: this.begin("acc_descr_multiline"); break; case 11: this.popState(); break; case 12: return "acc_descr_multiline_value"; case 13: break; case 14: c; break; case 15: return 12; case 16: break; case 17: return 11; case 18: return 15; case 19: return 16; case 20: return 17; case 21: return 18; case 22: return this.begin("person_ext"), 45; case 23: return this.begin("person"), 44; case 24: return this.begin("system_ext_queue"), 51; case 25: return this.begin("system_ext_db"), 50; case 26: return this.begin("system_ext"), 49; case 27: return this.begin("system_queue"), 48; case 28: return this.begin("system_db"), 47; case 29: return this.begin("system"), 46; case 30: return this.begin("boundary"), 37; case 31: return this.begin("enterprise_boundary"), 34; case 32: return this.begin("system_boundary"), 36; case 33: return this.begin("container_ext_queue"), 57; case 34: return this.begin("container_ext_db"), 56; case 35: return this.begin("container_ext"), 55; case 36: return this.begin("container_queue"), 54; case 37: return this.begin("container_db"), 53; case 38: return this.begin("container"), 52; case 39: return this.begin("container_boundary"), 38; case 40: return this.begin("component_ext_queue"), 63; case 41: return this.begin("component_ext_db"), 62; case 42: return this.begin("component_ext"), 61; case 43: return this.begin("component_queue"), 60; case 44: return this.begin("component_db"), 59; case 45: return this.begin("component"), 58; case 46: return this.begin("node"), 39; case 47: return this.begin("node"), 39; case 48: return this.begin("node_l"), 40; case 49: return this.begin("node_r"), 41; case 50: return this.begin("rel"), 64; case 51: return this.begin("birel"), 65; case 52: return this.begin("rel_u"), 66; case 53: return this.begin("rel_u"), 66; case 54: return this.begin("rel_d"), 67; case 55: return this.begin("rel_d"), 67; case 56: return this.begin("rel_l"), 68; case 57: return this.begin("rel_l"), 68; case 58: return this.begin("rel_r"), 69; case 59: return this.begin("rel_r"), 69; case 60: return this.begin("rel_b"), 70; case 61: return this.begin("rel_index"), 71; case 62: return this.begin("update_el_style"), 72; case 63: return this.begin("update_rel_style"), 73; case 64: return this.begin("update_layout_config"), 74; case 65: return "EOF_IN_STRUCT"; case 66: return this.begin("attribute"), "ATTRIBUTE_EMPTY"; case 67: this.begin("attribute"); break; case 68: this.popState(), this.popState(); break; case 69: return 80; case 70: break; case 71: return 80; case 72: this.begin("string"); break; case 73: this.popState(); break; case 74: return "STR"; case 75: this.begin("string_kv"); break; case 76: return this.begin("string_kv_key"), "STR_KEY"; case 77: this.popState(), this.begin("string_kv_value"); break; case 78: return "STR_VALUE"; case 79: this.popState(), this.popState(); break; case 80: return "STR"; case 81: return "LBRACE"; case 82: return "RBRACE"; case 83: return "SPACE"; case 84: return "EOL"; case 85: return 14; } }, "anonymous"), rules: [/^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:title\s[^#\n;]+)/, /^(?:accDescription\s[^#\n;]+)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/, /^(?:%%[^\n]*(\r?\n)*)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:C4Context\b)/, /^(?:C4Container\b)/, /^(?:C4Component\b)/, /^(?:C4Dynamic\b)/, /^(?:C4Deployment\b)/, /^(?:Person_Ext\b)/, /^(?:Person\b)/, /^(?:SystemQueue_Ext\b)/, /^(?:SystemDb_Ext\b)/, /^(?:System_Ext\b)/, /^(?:SystemQueue\b)/, /^(?:SystemDb\b)/, /^(?:System\b)/, /^(?:Boundary\b)/, /^(?:Enterprise_Boundary\b)/, /^(?:System_Boundary\b)/, /^(?:ContainerQueue_Ext\b)/, /^(?:ContainerDb_Ext\b)/, /^(?:Container_Ext\b)/, /^(?:ContainerQueue\b)/, /^(?:ContainerDb\b)/, /^(?:Container\b)/, /^(?:Container_Boundary\b)/, /^(?:ComponentQueue_Ext\b)/, /^(?:ComponentDb_Ext\b)/, /^(?:Component_Ext\b)/, /^(?:ComponentQueue\b)/, /^(?:ComponentDb\b)/, /^(?:Component\b)/, /^(?:Deployment_Node\b)/, /^(?:Node\b)/, /^(?:Node_L\b)/, /^(?:Node_R\b)/, /^(?:Rel\b)/, /^(?:BiRel\b)/, /^(?:Rel_Up\b)/, /^(?:Rel_U\b)/, /^(?:Rel_Down\b)/, /^(?:Rel_D\b)/, /^(?:Rel_Left\b)/, /^(?:Rel_L\b)/, /^(?:Rel_Right\b)/, /^(?:Rel_R\b)/, /^(?:Rel_Back\b)/, /^(?:RelIndex\b)/, /^(?:UpdateElementStyle\b)/, /^(?:UpdateRelStyle\b)/, /^(?:UpdateLayoutConfig\b)/, /^(?:$)/, /^(?:[(][ ]*[,])/, /^(?:[(])/, /^(?:[)])/, /^(?:,,)/, /^(?:,)/, /^(?:[ ]*["]["])/, /^(?:[ ]*["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:[ ]*[\$])/, /^(?:[^=]*)/, /^(?:[=][ ]*["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:[^,]+)/, /^(?:\{)/, /^(?:\})/, /^(?:[\s]+)/, /^(?:[\n\r]+)/, /^(?:$)/], conditions: { acc_descr_multiline: { rules: [11, 12], inclusive: !1 }, acc_descr: { rules: [9], inclusive: !1 }, acc_title: { rules: [7], inclusive: !1 }, string_kv_value: { rules: [78, 79], inclusive: !1 }, string_kv_key: { rules: [77], inclusive: !1 }, string_kv: { rules: [76], inclusive: !1 }, string: { rules: [73, 74], inclusive: !1 }, attribute: { rules: [68, 69, 70, 71, 72, 75, 80], inclusive: !1 }, update_layout_config: { rules: [65, 66, 67, 68], inclusive: !1 }, update_rel_style: { rules: [65, 66, 67, 68], inclusive: !1 }, update_el_style: { rules: [65, 66, 67, 68], inclusive: !1 }, rel_b: { rules: [65, 66, 67, 68], inclusive: !1 }, rel_r: { rules: [65, 66, 67, 68], inclusive: !1 }, rel_l: { rules: [65, 66, 67, 68], inclusive: !1 }, rel_d: { rules: [65, 66, 67, 68], inclusive: !1 }, rel_u: { rules: [65, 66, 67, 68], inclusive: !1 }, rel_bi: { rules: [], inclusive: !1 }, rel: { rules: [65, 66, 67, 68], inclusive: !1 }, node_r: { rules: [65, 66, 67, 68], inclusive: !1 }, node_l: { rules: [65, 66, 67, 68], inclusive: !1 }, node: { rules: [65, 66, 67, 68], inclusive: !1 }, index: { rules: [], inclusive: !1 }, rel_index: { rules: [65, 66, 67, 68], inclusive: !1 }, component_ext_queue: { rules: [], inclusive: !1 }, component_ext_db: { rules: [65, 66, 67, 68], inclusive: !1 }, component_ext: { rules: [65, 66, 67, 68], inclusive: !1 }, component_queue: { rules: [65, 66, 67, 68], inclusive: !1 }, component_db: { rules: [65, 66, 67, 68], inclusive: !1 }, component: { rules: [65, 66, 67, 68], inclusive: !1 }, container_boundary: { rules: [65, 66, 67, 68], inclusive: !1 }, container_ext_queue: { rules: [65, 66, 67, 68], inclusive: !1 }, container_ext_db: { rules: [65, 66, 67, 68], inclusive: !1 }, container_ext: { rules: [65, 66, 67, 68], inclusive: !1 }, container_queue: { rules: [65, 66, 67, 68], inclusive: !1 }, container_db: { rules: [65, 66, 67, 68], inclusive: !1 }, container: { rules: [65, 66, 67, 68], inclusive: !1 }, birel: { rules: [65, 66, 67, 68], inclusive: !1 }, system_boundary: { rules: [65, 66, 67, 68], inclusive: !1 }, enterprise_boundary: { rules: [65, 66, 67, 68], inclusive: !1 }, boundary: { rules: [65, 66, 67, 68], inclusive: !1 }, system_ext_queue: { rules: [65, 66, 67, 68], inclusive: !1 }, system_ext_db: { rules: [65, 66, 67, 68], inclusive: !1 }, system_ext: { rules: [65, 66, 67, 68], inclusive: !1 }, system_queue: { rules: [65, 66, 67, 68], inclusive: !1 }, system_db: { rules: [65, 66, 67, 68], inclusive: !1 }, system: { rules: [65, 66, 67, 68], inclusive: !1 }, person_ext: { rules: [65, 66, 67, 68], inclusive: !1 }, person: { rules: [65, 66, 67, 68], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 81, 82, 83, 84, 85], inclusive: !0 } } }; return _t; }(); qt.lexer = Ce; function Lt() { this.yy = {}; } return g(Lt, "Parser"), Lt.prototype = qt, qt.Parser = Lt, new Lt();}();Ft.parser = Ft;var Ue = Ft, V = [], xt = [""], B = "global", F = "", X = [ { alias: "global", label: { text: "global" }, type: { text: "global" }, tags: null, link: null, parentBoundary: "" }], It = [], ie = "", ne = !1, Vt = 4, zt = 2, be, Fe = /* @__PURE__ */ g(function() { return be;}, "getC4Type"), Ve = /* @__PURE__ */ g(function(e) { be = ge(e, Bt());}, "setC4Type"), ze = /* @__PURE__ */ g(function(e, t, s, o, l, a, r, n, i) { if (e == null || t === void 0 || t === null || s === void 0 || s === null || o === void 0 || o === null) return; let u = {}; const d = It.find((f) => f.from === t && f.to === s); if (d ? u = d : It.push(u), u.type = e, u.from = t, u.to = s, u.label = { text: o }, l == null) u.techn = { text: "" }; else if (typeof l == "object") { let [f, y] = Object.entries(l)[0]; u[f] = { text: y }; } else u.techn = { text: l }; if (a == null) u.descr = { text: "" }; else if (typeof a == "object") { let [f, y] = Object.entries(a)[0]; u[f] = { text: y }; } else u.descr = { text: a }; if (typeof r == "object") { let [f, y] = Object.entries(r)[0]; u[f] = y; } else u.sprite = r; if (typeof n == "object") { let [f, y] = Object.entries(n)[0]; u[f] = y; } else u.tags = n; if (typeof i == "object") { let [f, y] = Object.entries(i)[0]; u[f] = y; } else u.link = i; u.wrap = mt();}, "addRel"), Xe = /* @__PURE__ */ g(function(e, t, s, o, l, a, r) { if (t === null || s === null) return; let n = {}; const i = V.find((u) => u.alias === t); if (i && t === i.alias ? n = i : (n.alias = t, V.push(n)), s == null ? n.label = { text: "" } : n.label = { text: s }, o == null) n.descr = { text: "" }; else if (typeof o == "object") { let [u, d] = Object.entries(o)[0]; n[u] = { text: d }; } else n.descr = { text: o }; if (typeof l == "object") { let [u, d] = Object.entries(l)[0]; n[u] = d; } else n.sprite = l; if (typeof a == "object") { let [u, d] = Object.entries(a)[0]; n[u] = d; } else n.tags = a; if (typeof r == "object") { let [u, d] = Object.entries(r)[0]; n[u] = d; } else n.link = r; n.typeC4Shape = { text: e }, n.parentBoundary = B, n.wrap = mt();}, "addPersonOrSystem"), We = /* @__PURE__ */ g(function(e, t, s, o, l, a, r, n) { if (t === null || s === null) return; let i = {}; const u = V.find((d) => d.alias === t); if (u && t === u.alias ? i = u : (i.alias = t, V.push(i)), s == null ? i.label = { text: "" } : i.label = { text: s }, o == null) i.techn = { text: "" }; else if (typeof o == "object") { let [d, f] = Object.entries(o)[0]; i[d] = { text: f }; } else i.techn = { text: o }; if (l == null) i.descr = { text: "" }; else if (typeof l == "object") { let [d, f] = Object.entries(l)[0]; i[d] = { text: f }; } else i.descr = { text: l }; if (typeof a == "object") { let [d, f] = Object.entries(a)[0]; i[d] = f; } else i.sprite = a; if (typeof r == "object") { let [d, f] = Object.entries(r)[0]; i[d] = f; } else i.tags = r; if (typeof n == "object") { let [d, f] = Object.entries(n)[0]; i[d] = f; } else i.link = n; i.wrap = mt(), i.typeC4Shape = { text: e }, i.parentBoundary = B;}, "addContainer"), Qe = /* @__PURE__ */ g(function(e, t, s, o, l, a, r, n) { if (t === null || s === null) return; let i = {}; const u = V.find((d) => d.alias === t); if (u && t === u.alias ? i = u : (i.alias = t, V.push(i)), s == null ? i.label = { text: "" } : i.label = { text: s }, o == null) i.techn = { text: "" }; else if (typeof o == "object") { let [d, f] = Object.entries(o)[0]; i[d] = { text: f }; } else i.techn = { text: o }; if (l == null) i.descr = { text: "" }; else if (typeof l == "object") { let [d, f] = Object.entries(l)[0]; i[d] = { text: f }; } else i.descr = { text: l }; if (typeof a == "object") { let [d, f] = Object.entries(a)[0]; i[d] = f; } else i.sprite = a; if (typeof r == "object") { let [d, f] = Object.entries(r)[0]; i[d] = f; } else i.tags = r; if (typeof n == "object") { let [d, f] = Object.entries(n)[0]; i[d] = f; } else i.link = n; i.wrap = mt(), i.typeC4Shape = { text: e }, i.parentBoundary = B;}, "addComponent"), He = /* @__PURE__ */ g(function(e, t, s, o, l) { if (e === null || t === null) return; let a = {}; const r = X.find((n) => n.alias === e); if (r && e === r.alias ? a = r : (a.alias = e, X.push(a)), t == null ? a.label = { text: "" } : a.label = { text: t }, s == null) a.type = { text: "system" }; else if (typeof s == "object") { let [n, i] = Object.entries(s)[0]; a[n] = { text: i }; } else a.type = { text: s }; if (typeof o == "object") { let [n, i] = Object.entries(o)[0]; a[n] = i; } else a.tags = o; if (typeof l == "object") { let [n, i] = Object.entries(l)[0]; a[n] = i; } else a.link = l; a.parentBoundary = B, a.wrap = mt(), F = B, B = e, xt.push(F);}, "addPersonOrSystemBoundary"), qe = /* @__PURE__ */ g(function(e, t, s, o, l) { if (e === null || t === null) return; let a = {}; const r = X.find((n) => n.alias === e); if (r && e === r.alias ? a = r : (a.alias = e, X.push(a)), t == null ? a.label = { text: "" } : a.label = { text: t }, s == null) a.type = { text: "container" }; else if (typeof s == "object") { let [n, i] = Object.entries(s)[0]; a[n] = { text: i }; } else a.type = { text: s }; if (typeof o == "object") { let [n, i] = Object.entries(o)[0]; a[n] = i; } else a.tags = o; if (typeof l == "object") { let [n, i] = Object.entries(l)[0]; a[n] = i; } else a.link = l; a.parentBoundary = B, a.wrap = mt(), F = B, B = e, xt.push(F);}, "addContainerBoundary"), Ge = /* @__PURE__ */ g(function(e, t, s, o, l, a, r, n) { if (t === null || s === null) return; let i = {}; const u = X.find((d) => d.alias === t); if (u && t === u.alias ? i = u : (i.alias = t, X.push(i)), s == null ? i.label = { text: "" } : i.label = { text: s }, o == null) i.type = { text: "node" }; else if (typeof o == "object") { let [d, f] = Object.entries(o)[0]; i[d] = { text: f }; } else i.type = { text: o }; if (l == null) i.descr = { text: "" }; else if (typeof l == "object") { let [d, f] = Object.entries(l)[0]; i[d] = { text: f }; } else i.descr = { text: l }; if (typeof r == "object") { let [d, f] = Object.entries(r)[0]; i[d] = f; } else i.tags = r; if (typeof n == "object") { let [d, f] = Object.entries(n)[0]; i[d] = f; } else i.link = n; i.nodeType = e, i.parentBoundary = B, i.wrap = mt(), F = B, B = t, xt.push(F);}, "addDeploymentNode"), Ke = /* @__PURE__ */ g(function() { B = F, xt.pop(), F = xt.pop(), xt.push(F);}, "popBoundaryParseStack"), Je = /* @__PURE__ */ g(function(e, t, s, o, l, a, r, n, i, u, d) { let f = V.find((y) => y.alias === t); if (!(f === void 0 && (f = X.find((y) => y.alias === t), f === void 0))) { if (s != null) if (typeof s == "object") { let [y, E] = Object.entries(s)[0]; f[y] = E; } else f.bgColor = s; if (o != null) if (typeof o == "object") { let [y, E] = Object.entries(o)[0]; f[y] = E; } else f.fontColor = o; if (l != null) if (typeof l == "object") { let [y, E] = Object.entries(l)[0]; f[y] = E; } else f.borderColor = l; if (a != null) if (typeof a == "object") { let [y, E] = Object.entries(a)[0]; f[y] = E; } else f.shadowing = a; if (r != null) if (typeof r == "object") { let [y, E] = Object.entries(r)[0]; f[y] = E; } else f.shape = r; if (n != null) if (typeof n == "object") { let [y, E] = Object.entries(n)[0]; f[y] = E; } else f.sprite = n; if (i != null) if (typeof i == "object") { let [y, E] = Object.entries(i)[0]; f[y] = E; } else f.techn = i; if (u != null) if (typeof u == "object") { let [y, E] = Object.entries(u)[0]; f[y] = E; } else f.legendText = u; if (d != null) if (typeof d == "object") { let [y, E] = Object.entries(d)[0]; f[y] = E; } else f.legendSprite = d; }}, "updateElStyle"), Ze = /* @__PURE__ */ g(function(e, t, s, o, l, a, r) { const n = It.find((i) => i.from === t && i.to === s); if (n !== void 0) { if (o != null) if (typeof o == "object") { let [i, u] = Object.entries(o)[0]; n[i] = u; } else n.textColor = o; if (l != null) if (typeof l == "object") { let [i, u] = Object.entries(l)[0]; n[i] = u; } else n.lineColor = l; if (a != null) if (typeof a == "object") { let [i, u] = Object.entries(a)[0]; n[i] = parseInt(u); } else n.offsetX = parseInt(a); if (r != null) if (typeof r == "object") { let [i, u] = Object.entries(r)[0]; n[i] = parseInt(u); } else n.offsetY = parseInt(r); }}, "updateRelStyle"), $e = /* @__PURE__ */ g(function(e, t, s) { let o = Vt, l = zt; if (typeof t == "object") { const a = Object.values(t)[0]; o = parseInt(a); } else o = parseInt(t); if (typeof s == "object") { const a = Object.values(s)[0]; l = parseInt(a); } else l = parseInt(s); o >= 1 && (Vt = o), l >= 1 && (zt = l);}, "updateLayoutConfig"), t0 = /* @__PURE__ */ g(function() { return Vt;}, "getC4ShapeInRow"), e0 = /* @__PURE__ */ g(function() { return zt;}, "getC4BoundaryInRow"), a0 = /* @__PURE__ */ g(function() { return B;}, "getCurrentBoundaryParse"), i0 = /* @__PURE__ */ g(function() { return F;}, "getParentBoundaryParse"), _e = /* @__PURE__ */ g(function(e) { return e == null ? V : V.filter((t) => t.parentBoundary === e);}, "getC4ShapeArray"), n0 = /* @__PURE__ */ g(function(e) { return V.find((t) => t.alias === e);}, "getC4Shape"), r0 = /* @__PURE__ */ g(function(e) { return Object.keys(_e(e));}, "getC4ShapeKeys"), xe = /* @__PURE__ */ g(function(e) { return e == null ? X : X.filter((t) => t.parentBoundary === e);}, "getBoundaries"), s0 = xe, l0 = /* @__PURE__ */ g(function() { return It;}, "getRels"), o0 = /* @__PURE__ */ g(function() { return ie;}, "getTitle"), c0 = /* @__PURE__ */ g(function(e) { ne = e;}, "setWrap"), mt = /* @__PURE__ */ g(function() { return ne;}, "autoWrap"), h0 = /* @__PURE__ */ g(function() { V = [], X = [ { alias: "global", label: { text: "global" }, type: { text: "global" }, tags: null, link: null, parentBoundary: "" } ], F = "", B = "global", xt = [""], It = [], xt = [""], ie = "", ne = !1, Vt = 4, zt = 2;}, "clear"), u0 = { SOLID: 0, DOTTED: 1, NOTE: 2, SOLID_CROSS: 3, DOTTED_CROSS: 4, SOLID_OPEN: 5, DOTTED_OPEN: 6, LOOP_START: 10, LOOP_END: 11, ALT_START: 12, ALT_ELSE: 13, ALT_END: 14, OPT_START: 15, OPT_END: 16, ACTIVE_START: 17, ACTIVE_END: 18, PAR_START: 19, PAR_AND: 20, PAR_END: 21, RECT_START: 22, RECT_END: 23, SOLID_POINT: 24, DOTTED_POINT: 25}, d0 = { FILLED: 0, OPEN: 1}, f0 = { LEFTOF: 0, RIGHTOF: 1, OVER: 2}, p0 = /* @__PURE__ */ g(function(e) { ie = ge(e, Bt());}, "setTitle"), te = { addPersonOrSystem: Xe, addPersonOrSystemBoundary: He, addContainer: We, addContainerBoundary: qe, addComponent: Qe, addDeploymentNode: Ge, popBoundaryParseStack: Ke, addRel: ze, updateElStyle: Je, updateRelStyle: Ze, updateLayoutConfig: $e, autoWrap: mt, setWrap: c0, getC4ShapeArray: _e, getC4Shape: n0, getC4ShapeKeys: r0, getBoundaries: xe, getBoundarys: s0, getCurrentBoundaryParse: a0, getParentBoundaryParse: i0, getRels: l0, getTitle: o0, getC4Type: Fe, getC4ShapeInRow: t0, getC4BoundaryInRow: e0, setAccTitle: Me, getAccTitle: Ie, getAccDescription: Be, setAccDescription: Pe, getConfig: /* @__PURE__ */ g(() => Bt().c4, "getConfig"), clear: h0, LINETYPE: u0, ARROWTYPE: d0, PLACEMENT: f0, setTitle: p0, setC4Type: Ve // apply,}, re = /* @__PURE__ */ g(function(e, t) { return De(e, t);}, "drawRect"), me = /* @__PURE__ */ g(function(e, t, s, o, l, a) { const r = e.append("image"); r.attr("width", t), r.attr("height", s), r.attr("x", o), r.attr("y", l); let n = a.startsWith("data:image/png;base64") ? a : Ye(a); r.attr("xlink:href", n);}, "drawImage"), y0 = /* @__PURE__ */ g((e, t, s) => { const o = e.append("g"); let l = 0; for (let a of t) { let r = a.textColor ? a.textColor : "#444444", n = a.lineColor ? a.lineColor : "#444444", i = a.offsetX ? parseInt(a.offsetX) : 0, u = a.offsetY ? parseInt(a.offsetY) : 0, d = ""; if (l === 0) { let y = o.append("line"); y.attr("x1", a.startPoint.x), y.attr("y1", a.startPoint.y), y.attr("x2", a.endPoint.x), y.attr("y2", a.endPoint.y), y.attr("stroke-width", "1"), y.attr("stroke", n), y.style("fill", "none"), a.type !== "rel_b" && y.attr("marker-end", "url(" + d + "#arrowhead)"), (a.type === "birel" || a.type === "rel_b") && y.attr("marker-start", "url(" + d + "#arrowend)"), l = -1; } else { let y = o.append("path"); y.attr("fill", "none").attr("stroke-width", "1").attr("stroke", n).attr( "d", "Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx", a.startPoint.x).replaceAll("starty", a.startPoint.y).replaceAll( "controlx", a.startPoint.x + (a.endPoint.x - a.startPoint.x) / 2 - (a.endPoint.x - a.startPoint.x) / 4 ).replaceAll("controly", a.startPoint.y + (a.endPoint.y - a.startPoint.y) / 2).replaceAll("stopx", a.endPoint.x).replaceAll("stopy", a.endPoint.y) ), a.type !== "rel_b" && y.attr("marker-end", "url(" + d + "#arrowhead)"), (a.type === "birel" || a.type === "rel_b") && y.attr("marker-start", "url(" + d + "#arrowend)"); } let f = s.messageFont(); Q(s)( a.label.text, o, Math.min(a.startPoint.x, a.endPoint.x) + Math.abs(a.endPoint.x - a.startPoint.x) / 2 + i, Math.min(a.startPoint.y, a.endPoint.y) + Math.abs(a.endPoint.y - a.startPoint.y) / 2 + u, a.label.width, a.label.height, { fill: r }, f ), a.techn && a.techn.text !== "" && (f = s.messageFont(), Q(s)( "[" + a.techn.text + "]", o, Math.min(a.startPoint.x, a.endPoint.x) + Math.abs(a.endPoint.x - a.startPoint.x) / 2 + i, Math.min(a.startPoint.y, a.endPoint.y) + Math.abs(a.endPoint.y - a.startPoint.y) / 2 + s.messageFontSize + 5 + u, Math.max(a.label.width, a.techn.width), a.techn.height, { fill: r, "font-style": "italic" }, f )); }}, "drawRels"), g0 = /* @__PURE__ */ g(function(e, t, s) { const o = e.append("g"); let l = t.bgColor ? t.bgColor : "none", a = t.borderColor ? t.borderColor : "#444444", r = t.fontColor ? t.fontColor : "black", n = { "stroke-width": 1, "stroke-dasharray": "7.0,7.0" }; t.nodeType && (n = { "stroke-width": 1 }); let i = { x: t.x, y: t.y, fill: l, stroke: a, width: t.width, height: t.height, rx: 2.5, ry: 2.5, attrs: n }; re(o, i); let u = s.boundaryFont(); u.fontWeight = "bold", u.fontSize = u.fontSize + 2, u.fontColor = r, Q(s)( t.label.text, o, t.x, t.y + t.label.Y, t.width, t.height, { fill: "#444444" }, u ), t.type && t.type.text !== "" && (u = s.boundaryFont(), u.fontColor = r, Q(s)( t.type.text, o, t.x, t.y + t.type.Y, t.width, t.height, { fill: "#444444" }, u )), t.descr && t.descr.text !== "" && (u = s.boundaryFont(), u.fontSize = u.fontSize - 2, u.fontColor = r, Q(s)( t.descr.text, o, t.x, t.y + t.descr.Y, t.width, t.height, { fill: "#444444" }, u ));}, "drawBoundary"), b0 = /* @__PURE__ */ g(function(e, t, s) { var f; let o = t.bgColor ? t.bgColor : s[t.typeC4Shape.text + "_bg_color"], l = t.borderColor ? t.borderColor : s[t.typeC4Shape.text + "_border_color"], a = t.fontColor ? t.fontColor : "#FFFFFF", r = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII="; switch (t.typeC4Shape.text) { case "person": r = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII="; break; case "external_person": r = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII="; break; } const n = e.append("g"); n.attr("class", "person-man"); const i = Se(); switch (t.typeC4Shape.text) { case "person": case "external_person": case "system": case "external_system": case "container": case "external_container": case "component": case "external_component": i.x = t.x, i.y = t.y, i.fill = o, i.width = t.width, i.height = t.height, i.stroke = l, i.rx = 2.5, i.ry = 2.5, i.attrs = { "stroke-width": 0.5 }, re(n, i); break; case "system_db": case "external_system_db": case "container_db": case "external_container_db": case "component_db": case "external_component_db": n.append("path").attr("fill", o).attr("stroke-width", "0.5").attr("stroke", l).attr( "d", "Mstartx,startyc0,-10 half,-10 half,-10c0,0 half,0 half,10l0,heightc0,10 -half,10 -half,10c0,0 -half,0 -half,-10l0,-height".replaceAll("startx", t.x).replaceAll("starty", t.y).replaceAll("half", t.width / 2).replaceAll("height", t.height) ), n.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", l).attr( "d", "Mstartx,startyc0,10 half,10 half,10c0,0 half,0 half,-10".replaceAll("startx", t.x).replaceAll("starty", t.y).replaceAll("half", t.width / 2) ); break; case "system_queue": case "external_system_queue": case "container_queue": case "external_container_queue": case "component_queue": case "external_component_queue": n.append("path").attr("fill", o).attr("stroke-width", "0.5").attr("stroke", l).attr( "d", "Mstartx,startylwidth,0c5,0 5,half 5,halfc0,0 0,half -5,halfl-width,0c-5,0 -5,-half -5,-halfc0,0 0,-half 5,-half".replaceAll("startx", t.x).replaceAll("starty", t.y).replaceAll("width", t.width).replaceAll("half", t.height / 2) ), n.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", l).attr( "d", "Mstartx,startyc-5,0 -5,half -5,halfc0,half 5,half 5,half".replaceAll("startx", t.x + t.width).replaceAll("starty", t.y).replaceAll("half", t.height / 2) ); break; } let u = w0(s, t.typeC4Shape.text); switch (n.append("text").attr("fill", a).attr("font-family", u.fontFamily).attr("font-size", u.fontSize - 2).attr("font-style", "italic").attr("lengthAdjust", "spacing").attr("textLength", t.typeC4Shape.width).attr("x", t.x + t.width / 2 - t.typeC4Shape.width / 2).attr("y", t.y + t.typeC4Shape.Y).text("<<" + t.typeC4Shape.text + ">>"), t.typeC4Shape.text) { case "person": case "external_person": me( n, 48, 48, t.x + t.width / 2 - 24, t.y + t.image.Y, r ); break; } let d = s[t.typeC4Shape.text + "Font"](); return d.fontWeight = "bold", d.fontSize = d.fontSize + 2, d.fontColor = a, Q(s)( t.label.text, n, t.x, t.y + t.label.Y, t.width, t.height, { fill: a }, d ), d = s[t.typeC4Shape.text + "Font"](), d.fontColor = a, t.techn && ((f = t.techn) == null ? void 0 : f.text) !== "" ? Q(s)( t.techn.text, n, t.x, t.y + t.techn.Y, t.width, t.height, { fill: a, "font-style": "italic" }, d ) : t.type && t.type.text !== "" && Q(s)( t.type.text, n, t.x, t.y + t.type.Y, t.width, t.height, { fill: a, "font-style": "italic" }, d ), t.descr && t.descr.text !== "" && (d = s.personFont(), d.fontColor = a, Q(s)( t.descr.text, n, t.x, t.y + t.descr.Y, t.width, t.height, { fill: a }, d )), t.height;}, "drawC4Shape"), _0 = /* @__PURE__ */ g(function(e) { e.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr( "d", "M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z" );}, "insertDatabaseIcon"), x0 = /* @__PURE__ */ g(function(e) { e.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr( "d", "M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z" );}, "insertComputerIcon"), m0 = /* @__PURE__ */ g(function(e) { e.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr( "d", "M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z" );}, "insertClockIcon"), v0 = /* @__PURE__ */ g(function(e) { e.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z");}, "insertArrowHead"), E0 = /* @__PURE__ */ g(function(e) { e.append("defs").append("marker").attr("id", "arrowend").attr("refX", 1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 10 0 L 0 5 L 10 10 z");}, "insertArrowEnd"), k0 = /* @__PURE__ */ g(function(e) { e.append("defs").append("marker").attr("id", "filled-head").attr("refX", 18).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");}, "insertArrowFilledHead"), A0 = /* @__PURE__ */ g(function(e) { e.append("defs").append("marker").attr("id", "sequencenumber").attr("refX", 15).attr("refY", 15).attr("markerWidth", 60).attr("markerHeight", 40).attr("orient", "auto").append("circle").attr("cx", 15).attr("cy", 15).attr("r", 6);}, "insertDynamicNumber"), C0 = /* @__PURE__ */ g(function(e) { const s = e.append("defs").append("marker").attr("id", "crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 16).attr("refY", 4); s.append("path").attr("fill", "black").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 9,2 V 6 L16,4 Z"), s.append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1px").attr("d", "M 0,1 L 6,7 M 6,1 L 0,7");}, "insertArrowCrossHead"), w0 = /* @__PURE__ */ g((e, t) => ({ fontFamily: e[t + "FontFamily"], fontSize: e[t + "FontSize"], fontWeight: e[t + "FontWeight"]}), "getC4ShapeFont"), Q = /* @__PURE__ */ function() { function e(l, a, r, n, i, u, d) { const f = a.append("text").attr("x", r + i / 2).attr("y", n + u / 2 + 5).style("text-anchor", "middle").text(l); o(f, d); } g(e, "byText"); function t(l, a, r, n, i, u, d, f) { const { fontSize: y, fontFamily: E, fontWeight: O } = f, S = l.split($t.lineBreakRegex); for (let P = 0; P < S.length; P++) { const M = P * y - y * (S.length - 1) / 2, U = a.append("text").attr("x", r + i / 2).attr("y", n).style("text-anchor", "middle").attr("dominant-baseline", "middle").style("font-size", y).style("font-weight", O).style("font-family", E); U.append("tspan").attr("dy", M).text(S[P]).attr("alignment-baseline", "mathematical"), o(U, d); } } g(t, "byTspan"); function s(l, a, r, n, i, u, d, f) { const y = a.append("switch"), O = y.append("foreignObject").attr("x", r).attr("y", n).attr("width", i).attr("height", u).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%"); O.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(l), t(l, y, r, n, i, u, d, f), o(O, d); } g(s, "byFo"); function o(l, a) { for (const r in a) a.hasOwnProperty(r) && l.attr(r, a[r]); } return g(o, "_setTextAttrs"), function(l) { return l.textPlacement === "fo" ? s : l.textPlacement === "old" ? e : t; };}(), z = { drawRect: re, drawBoundary: g0, drawC4Shape: b0, drawRels: y0, drawImage: me, insertArrowHead: v0, insertArrowEnd: E0, insertArrowFilledHead: k0, insertDynamicNumber: A0, insertArrowCrossHead: C0, insertDatabaseIcon: _0, insertComputerIcon: x0, insertClockIcon: m0}, Xt = 0, Wt = 0, ve = 4, ee = 2;Ft.yy = te;var _ = {}, Ot, Ee = (Ot = class { constructor(t) { this.name = "", this.data = {}, this.data.startx = void 0, this.data.stopx = void 0, this.data.starty = void 0, this.data.stopy = void 0, this.data.widthLimit = void 0, this.nextData = {}, this.nextData.startx = void 0, this.nextData.stopx = void 0, this.nextData.starty = void 0, this.nextData.stopy = void 0, this.nextData.cnt = 0, ae(t.db.getConfig()); } setData(t, s, o, l) { this.nextData.startx = this.data.startx = t, this.nextData.stopx = this.data.stopx = s, this.nextData.starty = this.data.starty = o, this.nextData.stopy = this.data.stopy = l; } updateVal(t, s, o, l) { t[s] === void 0 ? t[s] = o : t[s] = l(o, t[s]); } insert(t) { this.nextData.cnt = this.nextData.cnt + 1; let s = this.nextData.startx === this.nextData.stopx ? this.nextData.stopx + t.margin : this.nextData.stopx + t.margin * 2, o = s + t.width, l = this.nextData.starty + t.margin * 2, a = l + t.height; (s >= this.data.widthLimit || o >= this.data.widthLimit || this.nextData.cnt > ve) && (s = this.nextData.startx + t.margin + _.nextLinePaddingX, l = this.nextData.stopy + t.margin * 2, this.nextData.stopx = o = s + t.width, this.nextData.starty = this.nextData.stopy, this.nextData.stopy = a = l + t.height, this.nextData.cnt = 1), t.x = s, t.y = l, this.updateVal(this.data, "startx", s, Math.min), this.updateVal(this.data, "starty", l, Math.min), this.updateVal(this.data, "stopx", o, Math.max), this.updateVal(this.data, "stopy", a, Math.max), this.updateVal(this.nextData, "startx", s, Math.min), this.updateVal(this.nextData, "starty", l, Math.min), this.updateVal(this.nextData, "stopx", o, Math.max), this.updateVal(this.nextData, "stopy", a, Math.max); } init(t) { this.name = "", this.data = { startx: void 0, stopx: void 0, starty: void 0, stopy: void 0, widthLimit: void 0 }, this.nextData = { startx: void 0, stopx: void 0, starty: void 0, stopy: void 0, cnt: 0 }, ae(t.db.getConfig()); } bumpLastMargin(t) { this.data.stopx += t, this.data.stopy += t; }}, g(Ot, "Bounds"), Ot), ae = /* @__PURE__ */ g(function(e) { Ne(_, e), e.fontFamily && (_.personFontFamily = _.systemFontFamily = _.messageFontFamily = e.fontFamily), e.fontSize && (_.personFontSize = _.systemFontSize = _.messageFontSize = e.fontSize), e.fontWeight && (_.personFontWeight = _.systemFontWeight = _.messageFontWeight = e.fontWeight);}, "setConf"), Pt = /* @__PURE__ */ g((e, t) => ({ fontFamily: e[t + "FontFamily"], fontSize: e[t + "FontSize"], fontWeight: e[t + "FontWeight"]}), "c4ShapeFont"), Ut = /* @__PURE__ */ g((e) => ({ fontFamily: e.boundaryFontFamily, fontSize: e.boundaryFontSize, fontWeight: e.boundaryFontWeight}), "boundaryFont"), T0 = /* @__PURE__ */ g((e) => ({ fontFamily: e.messageFontFamily, fontSize: e.messageFontSize, fontWeight: e.messageFontWeight}), "messageFont");function j(e, t, s, o, l) { if (!t[e].width) if (s) t[e].text = je(t[e].text, l, o), t[e].textLines = t[e].text.split($t.lineBreakRegex).length, t[e].width = l, t[e].height = fe(t[e].text, o); else { let a = t[e].text.split($t.lineBreakRegex); t[e].textLines = a.length; let r = 0; t[e].height = 0, t[e].width = 0; for (const n of a) t[e].width = Math.max( Tt(n, o), t[e].width ), r = fe(n, o), t[e].height = t[e].height + r; }}g(j, "calcC4ShapeTextWH");var ke = /* @__PURE__ */ g(function(e, t, s) { t.x = s.data.startx, t.y = s.data.starty, t.width = s.data.stopx - s.data.startx, t.height = s.data.stopy - s.data.starty, t.label.y = _.c4ShapeMargin - 35; let o = t.wrap && _.wrap, l = Ut(_); l.fontSize = l.fontSize + 2, l.fontWeight = "bold"; let a = Tt(t.label.text, l); j("label", t, o, l, a), z.drawBoundary(e, t, _);}, "drawBoundary"), Ae = /* @__PURE__ */ g(function(e, t, s, o) { let l = 0; for (const a of o) { l = 0; const r = s[a]; let n = Pt(_, r.typeC4Shape.text); switch (n.fontSize = n.fontSize - 2, r.typeC4Shape.width = Tt( "«" + r.typeC4Shape.text + "»", n ), r.typeC4Shape.height = n.fontSize + 2, r.typeC4Shape.Y = _.c4ShapePadding, l = r.typeC4Shape.Y + r.typeC4Shape.height - 4, r.image = { width: 0, height: 0, Y: 0 }, r.typeC4Shape.text) { case "person": case "external_person": r.image.width = 48, r.image.height = 48, r.image.Y = l, l = r.image.Y + r.image.height; break; } r.sprite && (r.image.width = 48, r.image.height = 48, r.image.Y = l, l = r.image.Y + r.image.height); let i = r.wrap && _.wrap, u = _.width - _.c4ShapePadding * 2, d = Pt(_, r.typeC4Shape.text); if (d.fontSize = d.fontSize + 2, d.fontWeight = "bold", j("label", r, i, d, u), r.label.Y = l + 8, l = r.label.Y + r.label.height, r.type && r.type.text !== "") { r.type.text = "[" + r.type.text + "]"; let E = Pt(_, r.typeC4Shape.text); j("type", r, i, E, u), r.type.Y = l + 5, l = r.type.Y + r.type.height; } else if (r.techn && r.techn.text !== "") { r.techn.text = "[" + r.techn.text + "]"; let E = Pt(_, r.techn.text); j("techn", r, i, E, u), r.techn.Y = l + 5, l = r.techn.Y + r.techn.height; } let f = l, y = r.label.width; if (r.descr && r.descr.text !== "") { let E = Pt(_, r.typeC4Shape.text); j("descr", r, i, E, u), r.descr.Y = l + 20, l = r.descr.Y + r.descr.height, y = Math.max(r.label.width, r.descr.width), f = l - r.descr.textLines * 5; } y = y + _.c4ShapePadding, r.width = Math.max(r.width || _.width, y, _.width), r.height = Math.max(r.height || _.height, f, _.height), r.margin = r.margin || _.c4ShapeMargin, e.insert(r), z.drawC4Shape(t, r, _); } e.bumpLastMargin(_.c4ShapeMargin);}, "drawC4ShapeArray"), Rt, Y = (Rt = class { constructor(t, s) { this.x = t, this.y = s; }}, g(Rt, "Point"), Rt), pe = /* @__PURE__ */ g(function(e, t) { let s = e.x, o = e.y, l = t.x, a = t.y, r = s + e.width / 2, n = o + e.height / 2, i = Math.abs(s - l), u = Math.abs(o - a), d = u / i, f = e.height / e.width, y = null; return o == a && s < l ? y = new Y(s + e.width, n) : o == a && s > l ? y = new Y(s, n) : s == l && o < a ? y = new Y(r, o + e.height) : s == l && o > a && (y = new Y(r, o)), s > l && o < a ? f >= d ? y = new Y(s, n + d * e.width / 2) : y = new Y( r - i / u * e.height / 2, o + e.height ) : s < l && o < a ? f >= d ? y = new Y(s + e.width, n + d * e.width / 2) : y = new Y( r + i / u * e.height / 2, o + e.height ) : s < l && o > a ? f >= d ? y = new Y(s + e.width, n - d * e.width / 2) : y = new Y(r + e.height / 2 * i / u, o) : s > l && o > a && (f >= d ? y = new Y(s, n - e.width / 2 * d) : y = new Y(r - e.height / 2 * i / u, o)), y;}, "getIntersectPoint"), O0 = /* @__PURE__ */ g(function(e, t) { let s = { x: 0, y: 0 }; s.x = t.x + t.width / 2, s.y = t.y + t.height / 2; let o = pe(e, s); s.x = e.x + e.width / 2, s.y = e.y + e.height / 2; let l = pe(t, s); return { startPoint: o, endPoint: l };}, "getIntersectPoints"), R0 = /* @__PURE__ */ g(function(e, t, s, o) { let l = 0; for (let a of t) { l = l + 1; let r = a.wrap && _.wrap, n = T0(_); o.db.getC4Type() === "C4Dynamic" && (a.label.text = l + ": " + a.label.text); let u = Tt(a.label.text, n); j("label", a, r, n, u), a.techn && a.techn.text !== "" && (u = Tt(a.techn.text, n), j("techn", a, r, n, u)), a.descr && a.descr.text !== "" && (u = Tt(a.descr.text, n), j("descr", a, r, n, u)); let d = s(a.from), f = s(a.to), y = O0(d, f); a.startPoint = y.startPoint, a.endPoint = y.endPoint; } z.drawRels(e, t, _);}, "drawRels");function se(e, t, s, o, l) { let a = new Ee(l); a.data.widthLimit = s.data.widthLimit / Math.min(ee, o.length); for (let [r, n] of o.entries()) { let i = 0; n.image = { width: 0, height: 0, Y: 0 }, n.sprite && (n.image.width = 48, n.image.height = 48, n.image.Y = i, i = n.image.Y + n.image.height); let u = n.wrap && _.wrap, d = Ut(_); if (d.fontSize = d.fontSize + 2, d.fontWeight = "bold", j( "label", n, u, d, a.data.widthLimit ), n.label.Y = i + 8, i = n.label.Y + n.label.height, n.type && n.type.text !== "") { n.type.text = "[" + n.type.text + "]"; let O = Ut(_); j( "type", n, u, O, a.data.widthLimit ), n.type.Y = i + 5, i = n.type.Y + n.type.height; } if (n.descr && n.descr.text !== "") { let O = Ut(_); O.fontSize = O.fontSize - 2, j( "descr", n, u, O, a.data.widthLimit ), n.descr.Y = i + 20, i = n.descr.Y + n.descr.height; } if (r == 0 || r % ee === 0) { let O = s.data.startx + _.diagramMarginX, S = s.data.stopy + _.diagramMarginY + i; a.setData(O, O, S, S); } else { let O = a.data.stopx !== a.data.startx ? a.data.stopx + _.diagramMarginX : a.data.startx, S = a.data.starty; a.setData(O, O, S, S); } a.name = n.alias; let f = l.db.getC4ShapeArray(n.alias), y = l.db.getC4ShapeKeys(n.alias); y.length > 0 && Ae( a, e, f, y ), t = n.alias; let E = l.db.getBoundaries(t); E.length > 0 && se( e, t, a, E, l ), n.alias !== "global" && ke(e, n, a), s.data.stopy = Math.max( a.data.stopy + _.c4ShapeMargin, s.data.stopy ), s.data.stopx = Math.max( a.data.stopx + _.c4ShapeMargin, s.data.stopx ), Xt = Math.max(Xt, s.data.stopx), Wt = Math.max(Wt, s.data.stopy); }}g(se, "drawInsideBoundary");var S0 = /* @__PURE__ */ g(function(e, t, s, o) { _ = Bt().c4; const l = Bt().securityLevel; let a; l === "sandbox" && (a = jt("#i" + t)); const r = l === "sandbox" ? jt(a.nodes()[0].contentDocument.body) : jt("body"); let n = o.db; o.db.setWrap(_.wrap), ve = n.getC4ShapeInRow(), ee = n.getC4BoundaryInRow(), de.debug(`C:${JSON.stringify(_, null, 2)}`); const i = l === "sandbox" ? r.select(`[id="${t}"]`) : jt(`[id="${t}"]`); z.insertComputerIcon(i), z.insertDatabaseIcon(i), z.insertClockIcon(i); let u = new Ee(o); u.setData( _.diagramMarginX, _.diagramMarginX, _.diagramMarginY, _.diagramMarginY ), u.data.widthLimit = screen.availWidth, Xt = _.diagramMarginX, Wt = _.diagramMarginY; const d = o.db.getTitle(); let f = o.db.getBoundaries(""); se(i, "", u, f, o), z.insertArrowHead(i), z.insertArrowEnd(i), z.insertArrowCrossHead(i), z.insertArrowFilledHead(i), R0(i, o.db.getRels(), o.db.getC4Shape, o), u.data.stopx = Xt, u.data.stopy = Wt; const y = u.data; let O = y.stopy - y.starty + 2 * _.diagramMarginY; const P = y.stopx - y.startx + 2 * _.diagramMarginX; d && i.append("text").text(d).attr("x", (y.stopx - y.startx) / 2 - 4 * _.diagramMarginX).attr("y", y.starty + _.diagramMarginY), Le(i, O, P, _.useMaxWidth); const M = d ? 60 : 0; i.attr( "viewBox", y.startx - _.diagramMarginX + " -" + (_.diagramMarginY + M) + " " + P + " " + (O + M) ), de.debug("models:", y);}, "draw"), ye = { drawPersonOrSystemArray: Ae, drawBoundary: ke, setConf: ae, draw: S0}, D0 = /* @__PURE__ */ g((e) => `.person { stroke: ${e.personBorder}; fill: ${e.personBkg}; }`, "getStyles"), P0 = D0, M0 = { parser: Ue, db: te, renderer: ye, styles: P0, init: /* @__PURE__ */ g(({ c4: e, wrap: t }) => { ye.setConf(e), te.setWrap(t); }, "init")};export { M0 as diagram};12345import { ap as o, aq as n } from "./mermaid.core-BiIw1_mh.js";const t = (a, r) => o.lang.round(n.parse(a)[r]);export { t as c};123456789import { _ as l } from "./mermaid.core-BiIw1_mh.js";function m(e, c) { var i, t, o; e.accDescr && ((i = c.setAccDescription) == null || i.call(c, e.accDescr)), e.accTitle && ((t = c.setAccTitle) == null || t.call(c, e.accTitle)), e.title && ((o = c.setDiagramTitle) == null || o.call(c, e.title));}l(m, "populateCommonDb");export { m as p};123456789101112131415import { _ as s } from "./mermaid.core-BiIw1_mh.js";var t, e = (t = class { /** * @param init - Function that creates the default state. */ constructor(i) { this.init = i, this.records = this.init(); } reset() { this.records = this.init(); }}, s(t, "ImperativeState"), t);export { e as I};1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381import { g as te, s as ee } from "./chunk-HPOVUXKZ-C_XOradn.js";import { _ as f, l as D, c as F, r as se, u as ie, a as re, b as ae, g as ne, s as oe, p as le, q as ce, T as he, k as W, y as ue } from "./mermaid.core-BiIw1_mh.js";var vt = function() { var e = /* @__PURE__ */ f(function(V, o, h, n) { for (h = h || {}, n = V.length; n--; h[V[n]] = o) ; return h; }, "o"), t = [1, 2], s = [1, 3], a = [1, 4], i = [2, 4], l = [1, 9], d = [1, 11], S = [1, 16], p = [1, 17], T = [1, 18], _ = [1, 19], m = [1, 33], k = [1, 20], A = [1, 21], $ = [1, 22], x = [1, 23], R = [1, 24], u = [1, 26], L = [1, 27], I = [1, 28], N = [1, 29], G = [1, 30], P = [1, 31], B = [1, 32], at = [1, 35], nt = [1, 36], ot = [1, 37], lt = [1, 38], K = [1, 34], y = [1, 4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 41, 45, 48, 51, 52, 53, 54, 57], ct = [1, 4, 5, 14, 15, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 39, 40, 41, 45, 48, 51, 52, 53, 54, 57], xt = [4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 41, 45, 48, 51, 52, 53, 54, 57], gt = { trace: /* @__PURE__ */ f(function() { }, "trace"), yy: {}, symbols_: { error: 2, start: 3, SPACE: 4, NL: 5, SD: 6, document: 7, line: 8, statement: 9, classDefStatement: 10, styleStatement: 11, cssClassStatement: 12, idStatement: 13, DESCR: 14, "-->": 15, HIDE_EMPTY: 16, scale: 17, WIDTH: 18, COMPOSIT_STATE: 19, STRUCT_START: 20, STRUCT_STOP: 21, STATE_DESCR: 22, AS: 23, ID: 24, FORK: 25, JOIN: 26, CHOICE: 27, CONCURRENT: 28, note: 29, notePosition: 30, NOTE_TEXT: 31, direction: 32, acc_title: 33, acc_title_value: 34, acc_descr: 35, acc_descr_value: 36, acc_descr_multiline_value: 37, CLICK: 38, STRING: 39, HREF: 40, classDef: 41, CLASSDEF_ID: 42, CLASSDEF_STYLEOPTS: 43, DEFAULT: 44, style: 45, STYLE_IDS: 46, STYLEDEF_STYLEOPTS: 47, class: 48, CLASSENTITY_IDS: 49, STYLECLASS: 50, direction_tb: 51, direction_bt: 52, direction_rl: 53, direction_lr: 54, eol: 55, ";": 56, EDGE_STATE: 57, STYLE_SEPARATOR: 58, left_of: 59, right_of: 60, $accept: 0, $end: 1 }, terminals_: { 2: "error", 4: "SPACE", 5: "NL", 6: "SD", 14: "DESCR", 15: "-->", 16: "HIDE_EMPTY", 17: "scale", 18: "WIDTH", 19: "COMPOSIT_STATE", 20: "STRUCT_START", 21: "STRUCT_STOP", 22: "STATE_DESCR", 23: "AS", 24: "ID", 25: "FORK", 26: "JOIN", 27: "CHOICE", 28: "CONCURRENT", 29: "note", 31: "NOTE_TEXT", 33: "acc_title", 34: "acc_title_value", 35: "acc_descr", 36: "acc_descr_value", 37: "acc_descr_multiline_value", 38: "CLICK", 39: "STRING", 40: "HREF", 41: "classDef", 42: "CLASSDEF_ID", 43: "CLASSDEF_STYLEOPTS", 44: "DEFAULT", 45: "style", 46: "STYLE_IDS", 47: "STYLEDEF_STYLEOPTS", 48: "class", 49: "CLASSENTITY_IDS", 50: "STYLECLASS", 51: "direction_tb", 52: "direction_bt", 53: "direction_rl", 54: "direction_lr", 56: ";", 57: "EDGE_STATE", 58: "STYLE_SEPARATOR", 59: "left_of", 60: "right_of" }, productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 2], [9, 3], [9, 4], [9, 1], [9, 2], [9, 1], [9, 4], [9, 3], [9, 6], [9, 1], [9, 1], [9, 1], [9, 1], [9, 4], [9, 4], [9, 1], [9, 2], [9, 2], [9, 1], [9, 5], [9, 5], [10, 3], [10, 3], [11, 3], [12, 3], [32, 1], [32, 1], [32, 1], [32, 1], [55, 1], [55, 1], [13, 1], [13, 1], [13, 3], [13, 3], [30, 1], [30, 1]], performAction: /* @__PURE__ */ f(function(o, h, n, g, E, r, Z) { var c = r.length - 1; switch (E) { case 3: return g.setRootDoc(r[c]), r[c]; case 4: this.$ = []; break; case 5: r[c] != "nl" && (r[c - 1].push(r[c]), this.$ = r[c - 1]); break; case 6: case 7: this.$ = r[c]; break; case 8: this.$ = "nl"; break; case 12: this.$ = r[c]; break; case 13: const tt = r[c - 1]; tt.description = g.trimColon(r[c]), this.$ = tt; break; case 14: this.$ = { stmt: "relation", state1: r[c - 2], state2: r[c] }; break; case 15: const Tt = g.trimColon(r[c]); this.$ = { stmt: "relation", state1: r[c - 3], state2: r[c - 1], description: Tt }; break; case 19: this.$ = { stmt: "state", id: r[c - 3], type: "default", description: "", doc: r[c - 1] }; break; case 20: var U = r[c], X = r[c - 2].trim(); if (r[c].match(":")) { var ut = r[c].split(":"); U = ut[0], X = [X, ut[1]]; } this.$ = { stmt: "state", id: U, type: "default", description: X }; break; case 21: this.$ = { stmt: "state", id: r[c - 3], type: "default", description: r[c - 5], doc: r[c - 1] }; break; case 22: this.$ = { stmt: "state", id: r[c], type: "fork" }; break; case 23: this.$ = { stmt: "state", id: r[c], type: "join" }; break; case 24: this.$ = { stmt: "state", id: r[c], type: "choice" }; break; case 25: this.$ = { stmt: "state", id: g.getDividerId(), type: "divider" }; break; case 26: this.$ = { stmt: "state", id: r[c - 1].trim(), note: { position: r[c - 2].trim(), text: r[c].trim() } }; break; case 29: this.$ = r[c].trim(), g.setAccTitle(this.$); break; case 30: case 31: this.$ = r[c].trim(), g.setAccDescription(this.$); break; case 32: this.$ = { stmt: "click", id: r[c - 3], url: r[c - 2], tooltip: r[c - 1] }; break; case 33: this.$ = { stmt: "click", id: r[c - 3], url: r[c - 1], tooltip: "" }; break; case 34: case 35: this.$ = { stmt: "classDef", id: r[c - 1].trim(), classes: r[c].trim() }; break; case 36: this.$ = { stmt: "style", id: r[c - 1].trim(), styleClass: r[c].trim() }; break; case 37: this.$ = { stmt: "applyClass", id: r[c - 1].trim(), styleClass: r[c].trim() }; break; case 38: g.setDirection("TB"), this.$ = { stmt: "dir", value: "TB" }; break; case 39: g.setDirection("BT"), this.$ = { stmt: "dir", value: "BT" }; break; case 40: g.setDirection("RL"), this.$ = { stmt: "dir", value: "RL" }; break; case 41: g.setDirection("LR"), this.$ = { stmt: "dir", value: "LR" }; break; case 44: case 45: this.$ = { stmt: "state", id: r[c].trim(), type: "default", description: "" }; break; case 46: this.$ = { stmt: "state", id: r[c - 2].trim(), classes: [r[c].trim()], type: "default", description: "" }; break; case 47: this.$ = { stmt: "state", id: r[c - 2].trim(), classes: [r[c].trim()], type: "default", description: "" }; break; } }, "anonymous"), table: [{ 3: 1, 4: t, 5: s, 6: a }, { 1: [3] }, { 3: 5, 4: t, 5: s, 6: a }, { 3: 6, 4: t, 5: s, 6: a }, e([1, 4, 5, 16, 17, 19, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 41, 45, 48, 51, 52, 53, 54, 57], i, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: l, 5: d, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: S, 17: p, 19: T, 22: _, 24: m, 25: k, 26: A, 27: $, 28: x, 29: R, 32: 25, 33: u, 35: L, 37: I, 38: N, 41: G, 45: P, 48: B, 51: at, 52: nt, 53: ot, 54: lt, 57: K }, e(y, [2, 5]), { 9: 39, 10: 12, 11: 13, 12: 14, 13: 15, 16: S, 17: p, 19: T, 22: _, 24: m, 25: k, 26: A, 27: $, 28: x, 29: R, 32: 25, 33: u, 35: L, 37: I, 38: N, 41: G, 45: P, 48: B, 51: at, 52: nt, 53: ot, 54: lt, 57: K }, e(y, [2, 7]), e(y, [2, 8]), e(y, [2, 9]), e(y, [2, 10]), e(y, [2, 11]), e(y, [2, 12], { 14: [1, 40], 15: [1, 41] }), e(y, [2, 16]), { 18: [1, 42] }, e(y, [2, 18], { 20: [1, 43] }), { 23: [1, 44] }, e(y, [2, 22]), e(y, [2, 23]), e(y, [2, 24]), e(y, [2, 25]), { 30: 45, 31: [1, 46], 59: [1, 47], 60: [1, 48] }, e(y, [2, 28]), { 34: [1, 49] }, { 36: [1, 50] }, e(y, [2, 31]), { 13: 51, 24: m, 57: K }, { 42: [1, 52], 44: [1, 53] }, { 46: [1, 54] }, { 49: [1, 55] }, e(ct, [2, 44], { 58: [1, 56] }), e(ct, [2, 45], { 58: [1, 57] }), e(y, [2, 38]), e(y, [2, 39]), e(y, [2, 40]), e(y, [2, 41]), e(y, [2, 6]), e(y, [2, 13]), { 13: 58, 24: m, 57: K }, e(y, [2, 17]), e(xt, i, { 7: 59 }), { 24: [1, 60] }, { 24: [1, 61] }, { 23: [1, 62] }, { 24: [2, 48] }, { 24: [2, 49] }, e(y, [2, 29]), e(y, [2, 30]), { 39: [1, 63], 40: [1, 64] }, { 43: [1, 65] }, { 43: [1, 66] }, { 47: [1, 67] }, { 50: [1, 68] }, { 24: [1, 69] }, { 24: [1, 70] }, e(y, [2, 14], { 14: [1, 71] }), { 4: l, 5: d, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: S, 17: p, 19: T, 21: [1, 72], 22: _, 24: m, 25: k, 26: A, 27: $, 28: x, 29: R, 32: 25, 33: u, 35: L, 37: I, 38: N, 41: G, 45: P, 48: B, 51: at, 52: nt, 53: ot, 54: lt, 57: K }, e(y, [2, 20], { 20: [1, 73] }), { 31: [1, 74] }, { 24: [1, 75] }, { 39: [1, 76] }, { 39: [1, 77] }, e(y, [2, 34]), e(y, [2, 35]), e(y, [2, 36]), e(y, [2, 37]), e(ct, [2, 46]), e(ct, [2, 47]), e(y, [2, 15]), e(y, [2, 19]), e(xt, i, { 7: 78 }), e(y, [2, 26]), e(y, [2, 27]), { 5: [1, 79] }, { 5: [1, 80] }, { 4: l, 5: d, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: S, 17: p, 19: T, 21: [1, 81], 22: _, 24: m, 25: k, 26: A, 27: $, 28: x, 29: R, 32: 25, 33: u, 35: L, 37: I, 38: N, 41: G, 45: P, 48: B, 51: at, 52: nt, 53: ot, 54: lt, 57: K }, e(y, [2, 32]), e(y, [2, 33]), e(y, [2, 21])], defaultActions: { 5: [2, 1], 6: [2, 2], 47: [2, 48], 48: [2, 49] }, parseError: /* @__PURE__ */ f(function(o, h) { if (h.recoverable) this.trace(o); else { var n = new Error(o); throw n.hash = h, n; } }, "parseError"), parse: /* @__PURE__ */ f(function(o) { var h = this, n = [0], g = [], E = [null], r = [], Z = this.table, c = "", U = 0, X = 0, ut = 2, tt = 1, Tt = r.slice.call(arguments, 1), b = Object.create(this.lexer), j = { yy: {} }; for (var Et in this.yy) Object.prototype.hasOwnProperty.call(this.yy, Et) && (j.yy[Et] = this.yy[Et]); b.setInput(o, j.yy), j.yy.lexer = b, j.yy.parser = this, typeof b.yylloc > "u" && (b.yylloc = {}); var _t = b.yylloc; r.push(_t); var Qt = b.options && b.options.ranges; typeof j.yy.parseError == "function" ? this.parseError = j.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError; function Zt(O) { n.length = n.length - 2 * O, E.length = E.length - O, r.length = r.length - O; } f(Zt, "popStack"); function Lt() { var O; return O = g.pop() || b.lex() || tt, typeof O != "number" && (O instanceof Array && (g = O, O = g.pop()), O = h.symbols_[O] || O), O; } f(Lt, "lex"); for (var C, H, w, mt, J = {}, dt, Y, Ot, ft; ; ) { if (H = n[n.length - 1], this.defaultActions[H] ? w = this.defaultActions[H] : ((C === null || typeof C > "u") && (C = Lt()), w = Z[H] && Z[H][C]), typeof w > "u" || !w.length || !w[0]) { var Dt = ""; ft = []; for (dt in Z[H]) this.terminals_[dt] && dt > ut && ft.push("'" + this.terminals_[dt] + "'"); b.showPosition ? Dt = "Parse error on line " + (U + 1) + `:` + b.showPosition() + `Expecting ` + ft.join(", ") + ", got '" + (this.terminals_[C] || C) + "'" : Dt = "Parse error on line " + (U + 1) + ": Unexpected " + (C == tt ? "end of input" : "'" + (this.terminals_[C] || C) + "'"), this.parseError(Dt, { text: b.match, token: this.terminals_[C] || C, line: b.yylineno, loc: _t, expected: ft }); } if (w[0] instanceof Array && w.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + H + ", token: " + C); switch (w[0]) { case 1: n.push(C), E.push(b.yytext), r.push(b.yylloc), n.push(w[1]), C = null, X = b.yyleng, c = b.yytext, U = b.yylineno, _t = b.yylloc; break; case 2: if (Y = this.productions_[w[1]][1], J.$ = E[E.length - Y], J._$ = { first_line: r[r.length - (Y || 1)].first_line, last_line: r[r.length - 1].last_line, first_column: r[r.length - (Y || 1)].first_column, last_column: r[r.length - 1].last_column }, Qt && (J._$.range = [ r[r.length - (Y || 1)].range[0], r[r.length - 1].range[1] ]), mt = this.performAction.apply(J, [ c, X, U, j.yy, w[1], E, r ].concat(Tt)), typeof mt < "u") return mt; Y && (n = n.slice(0, -1 * Y * 2), E = E.slice(0, -1 * Y), r = r.slice(0, -1 * Y)), n.push(this.productions_[w[1]][0]), E.push(J.$), r.push(J._$), Ot = Z[n[n.length - 2]][n[n.length - 1]], n.push(Ot); break; case 3: return !0; } } return !0; }, "parse") }, qt = /* @__PURE__ */ function() { var V = { EOF: 1, parseError: /* @__PURE__ */ f(function(h, n) { if (this.yy.parser) this.yy.parser.parseError(h, n); else throw new Error(h); }, "parseError"), // resets the lexer, sets new input setInput: /* @__PURE__ */ f(function(o, h) { return this.yy = h || this.yy || {}, this._input = o, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this; }, "setInput"), // consumes and returns one char from the input input: /* @__PURE__ */ f(function() { var o = this._input[0]; this.yytext += o, this.yyleng++, this.offset++, this.match += o, this.matched += o; var h = o.match(/(?:\r\n?|\n).*/g); return h ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), o; }, "input"), // unshifts one char (or a string) into the input unput: /* @__PURE__ */ f(function(o) { var h = o.length, n = o.split(/(?:\r\n?|\n)/g); this._input = o + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - h), this.offset -= h; var g = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), n.length - 1 && (this.yylineno -= n.length - 1); var E = this.yylloc.range; return this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: n ? (n.length === g.length ? this.yylloc.first_column : 0) + g[g.length - n.length].length - n[0].length : this.yylloc.first_column - h }, this.options.ranges && (this.yylloc.range = [E[0], E[0] + this.yyleng - h]), this.yyleng = this.yytext.length, this; }, "unput"), // When called from action, caches matched text and appends it on next action more: /* @__PURE__ */ f(function() { return this._more = !0, this; }, "more"), // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject: /* @__PURE__ */ f(function() { if (this.options.backtrack_lexer) this._backtrack = !0; else return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).` + this.showPosition(), { text: "", token: null, line: this.yylineno }); return this; }, "reject"), // retain first n characters of the match less: /* @__PURE__ */ f(function(o) { this.unput(this.match.slice(o)); }, "less"), // displays already matched input, i.e. for error messages pastInput: /* @__PURE__ */ f(function() { var o = this.matched.substr(0, this.matched.length - this.match.length); return (o.length > 20 ? "..." : "") + o.substr(-20).replace(/\n/g, ""); }, "pastInput"), // displays upcoming input, i.e. for error messages upcomingInput: /* @__PURE__ */ f(function() { var o = this.match; return o.length < 20 && (o += this._input.substr(0, 20 - o.length)), (o.substr(0, 20) + (o.length > 20 ? "..." : "")).replace(/\n/g, ""); }, "upcomingInput"), // displays the character position where the lexing error occurred, i.e. for error messages showPosition: /* @__PURE__ */ f(function() { var o = this.pastInput(), h = new Array(o.length + 1).join("-"); return o + this.upcomingInput() + `` + h + "^"; }, "showPosition"), // test the lexed token: return FALSE when not a match, otherwise return token test_match: /* @__PURE__ */ f(function(o, h) { var n, g, E; if (this.options.backtrack_lexer && (E = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }, this.options.ranges && (E.yylloc.range = this.yylloc.range.slice(0))), g = o[0].match(/(?:\r\n?|\n).*/g), g && (this.yylineno += g.length), this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: g ? g[g.length - 1].length - g[g.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + o[0].length }, this.yytext += o[0], this.match += o[0], this.matches = o, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(o[0].length), this.matched += o[0], n = this.performAction.call(this, this.yy, this, h, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), n) return n; if (this._backtrack) { for (var r in E) this[r] = E[r]; return !1; } return !1; }, "test_match"), // return next match in input next: /* @__PURE__ */ f(function() { if (this.done) return this.EOF; this._input || (this.done = !0); var o, h, n, g; this._more || (this.yytext = "", this.match = ""); for (var E = this._currentRules(), r = 0; r < E.length; r++) if (n = this._input.match(this.rules[E[r]]), n && (!h || n[0].length > h[0].length)) { if (h = n, g = r, this.options.backtrack_lexer) { if (o = this.test_match(n, E[r]), o !== !1) return o; if (this._backtrack) { h = !1; continue; } else return !1; } else if (!this.options.flex) break; } return h ? (o = this.test_match(h, E[g]), o !== !1 ? o : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.` + this.showPosition(), { text: "", token: null, line: this.yylineno }); }, "next"), // return next match that has a token lex: /* @__PURE__ */ f(function() { var h = this.next(); return h || this.lex(); }, "lex"), // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin: /* @__PURE__ */ f(function(h) { this.conditionStack.push(h); }, "begin"), // pop the previously active lexer condition state off the condition stack popState: /* @__PURE__ */ f(function() { var h = this.conditionStack.length - 1; return h > 0 ? this.conditionStack.pop() : this.conditionStack[0]; }, "popState"), // produce the lexer rule set which is active for the currently active lexer condition state _currentRules: /* @__PURE__ */ f(function() { return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules; }, "_currentRules"), // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState: /* @__PURE__ */ f(function(h) { return h = this.conditionStack.length - 1 - Math.abs(h || 0), h >= 0 ? this.conditionStack[h] : "INITIAL"; }, "topState"), // alias for begin(condition) pushState: /* @__PURE__ */ f(function(h) { this.begin(h); }, "pushState"), // return the number of states currently on the stack stateStackSize: /* @__PURE__ */ f(function() { return this.conditionStack.length; }, "stateStackSize"), options: { "case-insensitive": !0 }, performAction: /* @__PURE__ */ f(function(h, n, g, E) { switch (g) { case 0: return 38; case 1: return 40; case 2: return 39; case 3: return 44; case 4: return 51; case 5: return 52; case 6: return 53; case 7: return 54; case 8: break; case 9: break; case 10: return 5; case 11: break; case 12: break; case 13: break; case 14: break; case 15: return this.pushState("SCALE"), 17; case 16: return 18; case 17: this.popState(); break; case 18: return this.begin("acc_title"), 33; case 19: return this.popState(), "acc_title_value"; case 20: return this.begin("acc_descr"), 35; case 21: return this.popState(), "acc_descr_value"; case 22: this.begin("acc_descr_multiline"); break; case 23: this.popState(); break; case 24: return "acc_descr_multiline_value"; case 25: return this.pushState("CLASSDEF"), 41; case 26: return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID"; case 27: return this.popState(), this.pushState("CLASSDEFID"), 42; case 28: return this.popState(), 43; case 29: return this.pushState("CLASS"), 48; case 30: return this.popState(), this.pushState("CLASS_STYLE"), 49; case 31: return this.popState(), 50; case 32: return this.pushState("STYLE"), 45; case 33: return this.popState(), this.pushState("STYLEDEF_STYLES"), 46; case 34: return this.popState(), 47; case 35: return this.pushState("SCALE"), 17; case 36: return 18; case 37: this.popState(); break; case 38: this.pushState("STATE"); break; case 39: return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 25; case 40: return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 26; case 41: return this.popState(), n.yytext = n.yytext.slice(0, -10).trim(), 27; case 42: return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 25; case 43: return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 26; case 44: return this.popState(), n.yytext = n.yytext.slice(0, -10).trim(), 27; case 45: return 51; case 46: return 52; case 47: return 53; case 48: return 54; case 49: this.pushState("STATE_STRING"); break; case 50: return this.pushState("STATE_ID"), "AS"; case 51: return this.popState(), "ID"; case 52: this.popState(); break; case 53: return "STATE_DESCR"; case 54: return 19; case 55: this.popState(); break; case 56: return this.popState(), this.pushState("struct"), 20; case 57: break; case 58: return this.popState(), 21; case 59: break; case 60: return this.begin("NOTE"), 29; case 61: return this.popState(), this.pushState("NOTE_ID"), 59; case 62: return this.popState(), this.pushState("NOTE_ID"), 60; case 63: this.popState(), this.pushState("FLOATING_NOTE"); break; case 64: return this.popState(), this.pushState("FLOATING_NOTE_ID"), "AS"; case 65: break; case 66: return "NOTE_TEXT"; case 67: return this.popState(), "ID"; case 68: return this.popState(), this.pushState("NOTE_TEXT"), 24; case 69: return this.popState(), n.yytext = n.yytext.substr(2).trim(), 31; case 70: return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 31; case 71: return 6; case 72: return 6; case 73: return 16; case 74: return 57; case 75: return 24; case 76: return n.yytext = n.yytext.trim(), 14; case 77: return 15; case 78: return 28; case 79: return 58; case 80: return 5; case 81: return "INVALID"; } }, "anonymous"), rules: [/^(?:click\b)/i, /^(?:href\b)/i, /^(?:"[^"]*")/i, /^(?:default\b)/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:[\s]+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:scale\s+)/i, /^(?:\d+)/i, /^(?:\s+width\b)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:classDef\s+)/i, /^(?:DEFAULT\s+)/i, /^(?:\w+\s+)/i, /^(?:[^\n]*)/i, /^(?:class\s+)/i, /^(?:(\w+)+((,\s*\w+)*))/i, /^(?:[^\n]*)/i, /^(?:style\s+)/i, /^(?:[\w,]+\s+)/i, /^(?:[^\n]*)/i, /^(?:scale\s+)/i, /^(?:\d+)/i, /^(?:\s+width\b)/i, /^(?:state\s+)/i, /^(?:.*<<fork>>)/i, /^(?:.*<<join>>)/i, /^(?:.*<<choice>>)/i, /^(?:.*\[\[fork\]\])/i, /^(?:.*\[\[join\]\])/i, /^(?:.*\[\[choice\]\])/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:["])/i, /^(?:\s*as\s+)/i, /^(?:[^\n\{]*)/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[^\n\s\{]+)/i, /^(?:\n)/i, /^(?:\{)/i, /^(?:%%(?!\{)[^\n]*)/i, /^(?:\})/i, /^(?:[\n])/i, /^(?:note\s+)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:")/i, /^(?:\s*as\s*)/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[^\n]*)/i, /^(?:\s*[^:\n\s\-]+)/i, /^(?:\s*:[^:\n;]+)/i, /^(?:[\s\S]*?end note\b)/i, /^(?:stateDiagram\s+)/i, /^(?:stateDiagram-v2\s+)/i, /^(?:hide empty description\b)/i, /^(?:\[\*\])/i, /^(?:[^:\n\s\-\{]+)/i, /^(?:\s*:[^:\n;]+)/i, /^(?:-->)/i, /^(?:--)/i, /^(?::::)/i, /^(?:$)/i, /^(?:.)/i], conditions: { LINE: { rules: [12, 13], inclusive: !1 }, struct: { rules: [12, 13, 25, 29, 32, 38, 45, 46, 47, 48, 57, 58, 59, 60, 74, 75, 76, 77, 78], inclusive: !1 }, FLOATING_NOTE_ID: { rules: [67], inclusive: !1 }, FLOATING_NOTE: { rules: [64, 65, 66], inclusive: !1 }, NOTE_TEXT: { rules: [69, 70], inclusive: !1 }, NOTE_ID: { rules: [68], inclusive: !1 }, NOTE: { rules: [61, 62, 63], inclusive: !1 }, STYLEDEF_STYLEOPTS: { rules: [], inclusive: !1 }, STYLEDEF_STYLES: { rules: [34], inclusive: !1 }, STYLE_IDS: { rules: [], inclusive: !1 }, STYLE: { rules: [33], inclusive: !1 }, CLASS_STYLE: { rules: [31], inclusive: !1 }, CLASS: { rules: [30], inclusive: !1 }, CLASSDEFID: { rules: [28], inclusive: !1 }, CLASSDEF: { rules: [26, 27], inclusive: !1 }, acc_descr_multiline: { rules: [23, 24], inclusive: !1 }, acc_descr: { rules: [21], inclusive: !1 }, acc_title: { rules: [19], inclusive: !1 }, SCALE: { rules: [16, 17, 36, 37], inclusive: !1 }, ALIAS: { rules: [], inclusive: !1 }, STATE_ID: { rules: [51], inclusive: !1 }, STATE_STRING: { rules: [52, 53], inclusive: !1 }, FORK_STATE: { rules: [], inclusive: !1 }, STATE: { rules: [12, 13, 39, 40, 41, 42, 43, 44, 49, 50, 54, 55, 56], inclusive: !1 }, ID: { rules: [12, 13], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 18, 20, 22, 25, 29, 32, 35, 38, 56, 60, 71, 72, 73, 74, 75, 76, 77, 79, 80, 81], inclusive: !0 } } }; return V; }(); gt.lexer = qt; function ht() { this.yy = {}; } return f(ht, "Parser"), ht.prototype = gt, gt.Parser = ht, new ht();}();vt.parser = vt;var Ge = vt, de = "TB", Yt = "TB", Rt = "dir", Q = "state", q = "root", Ct = "relation", fe = "classDef", pe = "style", Se = "applyClass", it = "default", Gt = "divider", Bt = "fill:none", Vt = "fill: #333", Mt = "c", Ut = "text", jt = "normal", bt = "rect", kt = "rectWithTitle", ye = "stateStart", ge = "stateEnd", It = "divider", Nt = "roundedWithTitle", Te = "note", Ee = "noteGroup", rt = "statediagram", _e = "state", me = `${rt}-${_e}`, Ht = "transition", De = "note", be = "note-edge", ke = `${Ht} ${be}`, ve = `${rt}-${De}`, Ce = "cluster", Ae = `${rt}-${Ce}`, xe = "cluster-alt", Le = `${rt}-${xe}`, Wt = "parent", zt = "note", Oe = "state", At = "----", Re = `${At}${zt}`, wt = `${At}${Wt}`, Kt = /* @__PURE__ */ f((e, t = Yt) => { if (!e.doc) return t; let s = t; for (const a of e.doc) a.stmt === "dir" && (s = a.value); return s;}, "getDir"), Ie = /* @__PURE__ */ f(function(e, t) { return t.db.getClasses();}, "getClasses"), Ne = /* @__PURE__ */ f(async function(e, t, s, a) { D.info("REF0:"), D.info("Drawing state diagram (v2)", t); const { securityLevel: i, state: l, layout: d } = F(); a.db.extract(a.db.getRootDocV2()); const S = a.db.getData(), p = te(t, i); S.type = a.type, S.layoutAlgorithm = d, S.nodeSpacing = (l == null ? void 0 : l.nodeSpacing) || 50, S.rankSpacing = (l == null ? void 0 : l.rankSpacing) || 50, S.markers = ["barb"], S.diagramId = t, await se(S, p); const T = 8; try { (typeof a.db.getLinks == "function" ? a.db.getLinks() : /* @__PURE__ */ new Map()).forEach((m, k) => { var I; const A = typeof k == "string" ? k : typeof (k == null ? void 0 : k.id) == "string" ? k.id : ""; if (!A) { D.warn("⚠️ Invalid or missing stateId from key:", JSON.stringify(k)); return; } const $ = (I = p.node()) == null ? void 0 : I.querySelectorAll("g"); let x; if ($ == null || $.forEach((N) => { var P; ((P = N.textContent) == null ? void 0 : P.trim()) === A && (x = N); }), !x) { D.warn("⚠️ Could not find node matching text:", A); return; } const R = x.parentNode; if (!R) { D.warn("⚠️ Node has no parent, cannot wrap:", A); return; } const u = document.createElementNS("http://www.w3.org/2000/svg", "a"), L = m.url.replace(/^"+|"+$/g, ""); if (u.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", L), u.setAttribute("target", "_blank"), m.tooltip) { const N = m.tooltip.replace(/^"+|"+$/g, ""); u.setAttribute("title", N); } R.replaceChild(u, x), u.appendChild(x), D.info("🔗 Wrapped node in <a> tag for:", A, m.url); }); } catch (_) { D.error("❌ Error injecting clickable links:", _); } ie.insertTitle( p, "statediagramTitleText", (l == null ? void 0 : l.titleTopMargin) ?? 25, a.db.getDiagramTitle() ), ee(p, T, rt, (l == null ? void 0 : l.useMaxWidth) ?? !0);}, "draw"), Be = { getClasses: Ie, draw: Ne, getDir: Kt}, St = /* @__PURE__ */ new Map(), M = 0;function yt(e = "", t = 0, s = "", a = At) { const i = s !== null && s.length > 0 ? `${a}${s}` : ""; return `${Oe}-${e}${i}-${t}`;}f(yt, "stateDomId");var we = /* @__PURE__ */ f((e, t, s, a, i, l, d, S) => { D.trace("items", t), t.forEach((p) => { switch (p.stmt) { case Q: st(e, p, s, a, i, l, d, S); break; case it: st(e, p, s, a, i, l, d, S); break; case Ct: { st( e, p.state1, s, a, i, l, d, S ), st( e, p.state2, s, a, i, l, d, S ); const T = { id: "edge" + M, start: p.state1.id, end: p.state2.id, arrowhead: "normal", arrowTypeEnd: "arrow_barb", style: Bt, labelStyle: "", label: W.sanitizeText(p.description ?? "", F()), arrowheadStyle: Vt, labelpos: Mt, labelType: Ut, thickness: jt, classes: Ht, look: d }; i.push(T), M++; } break; } });}, "setupDoc"), $t = /* @__PURE__ */ f((e, t = Yt) => { let s = t; if (e.doc) for (const a of e.doc) a.stmt === "dir" && (s = a.value); return s;}, "getDir");function et(e, t, s) { if (!t.id || t.id === "</join></fork>" || t.id === "</choice>") return; t.cssClasses && (Array.isArray(t.cssCompiledStyles) || (t.cssCompiledStyles = []), t.cssClasses.split(" ").forEach((i) => { const l = s.get(i); l && (t.cssCompiledStyles = [...t.cssCompiledStyles ?? [], ...l.styles]); })); const a = e.find((i) => i.id === t.id); a ? Object.assign(a, t) : e.push(t);}f(et, "insertOrUpdateNode");function Xt(e) { var t; return ((t = e == null ? void 0 : e.classes) == null ? void 0 : t.join(" ")) ?? "";}f(Xt, "getClassesFromDbInfo");function Jt(e) { return (e == null ? void 0 : e.styles) ?? [];}f(Jt, "getStylesFromDbInfo");var st = /* @__PURE__ */ f((e, t, s, a, i, l, d, S) => { var A, $, x; const p = t.id, T = s.get(p), _ = Xt(T), m = Jt(T), k = F(); if (D.info("dataFetcher parsedItem", t, T, m), p !== "root") { let R = bt; t.start === !0 ? R = ye : t.start === !1 && (R = ge), t.type !== it && (R = t.type), St.get(p) || St.set(p, { id: p, shape: R, description: W.sanitizeText(p, k), cssClasses: `${_} ${me}`, cssStyles: m }); const u = St.get(p); t.description && (Array.isArray(u.description) ? (u.shape = kt, u.description.push(t.description)) : (A = u.description) != null && A.length && u.description.length > 0 ? (u.shape = kt, u.description === p ? u.description = [t.description] : u.description = [u.description, t.description]) : (u.shape = bt, u.description = t.description), u.description = W.sanitizeTextOrArray(u.description, k)), (($ = u.description) == null ? void 0 : $.length) === 1 && u.shape === kt && (u.type === "group" ? u.shape = Nt : u.shape = bt), !u.type && t.doc && (D.info("Setting cluster for XCX", p, $t(t)), u.type = "group", u.isGroup = !0, u.dir = $t(t), u.shape = t.type === Gt ? It : Nt, u.cssClasses = `${u.cssClasses} ${Ae} ${l ? Le : ""}`); const L = { labelStyle: "", shape: u.shape, label: u.description, cssClasses: u.cssClasses, cssCompiledStyles: [], cssStyles: u.cssStyles, id: p, dir: u.dir, domId: yt(p, M), type: u.type, isGroup: u.type === "group", padding: 8, rx: 10, ry: 10, look: d }; if (L.shape === It && (L.label = ""), e && e.id !== "root" && (D.trace("Setting node ", p, " to be child of its parent ", e.id), L.parentId = e.id), L.centerLabel = !0, t.note) { const I = { labelStyle: "", shape: Te, label: t.note.text, cssClasses: ve, // useHtmlLabels: false, cssStyles: [], cssCompiledStyles: [], id: p + Re + "-" + M, domId: yt(p, M, zt), type: u.type, isGroup: u.type === "group", padding: (x = k.flowchart) == null ? void 0 : x.padding, look: d, position: t.note.position }, N = p + wt, G = { labelStyle: "", shape: Ee, label: t.note.text, cssClasses: u.cssClasses, cssStyles: [], id: p + wt, domId: yt(p, M, Wt), type: "group", isGroup: !0, padding: 16, //getConfig().flowchart.padding look: d, position: t.note.position }; M++, G.id = N, I.parentId = N, et(a, G, S), et(a, I, S), et(a, L, S); let P = p, B = I.id; t.note.position === "left of" && (P = I.id, B = p), i.push({ id: P + "-" + B, start: P, end: B, arrowhead: "none", arrowTypeEnd: "", style: Bt, labelStyle: "", classes: ke, arrowheadStyle: Vt, labelpos: Mt, labelType: Ut, thickness: jt, look: d }); } else et(a, L, S); } t.doc && (D.trace("Adding nodes children "), we(t, t.doc, s, a, i, !l, d, S));}, "dataFetcher"), $e = /* @__PURE__ */ f(() => { St.clear(), M = 0;}, "reset"), v = { START_NODE: "[*]", START_TYPE: "start", END_NODE: "[*]", END_TYPE: "end", COLOR_KEYWORD: "color", FILL_KEYWORD: "fill", BG_FILL: "bgFill", STYLECLASS_SEP: ","}, Pt = /* @__PURE__ */ f(() => /* @__PURE__ */ new Map(), "newClassesList"), Ft = /* @__PURE__ */ f(() => ({ relations: [], states: /* @__PURE__ */ new Map(), documents: {}}), "newDoc"), pt = /* @__PURE__ */ f((e) => JSON.parse(JSON.stringify(e)), "clone"), z, Ve = (z = class { constructor(t) { this.version = t, this.nodes = [], this.edges = [], this.rootDoc = [], this.classes = Pt(), this.documents = { root: Ft() }, this.currentDocument = this.documents.root, this.startEndCount = 0, this.dividerCnt = 0, this.links = /* @__PURE__ */ new Map(), this.getAccTitle = re, this.setAccTitle = ae, this.getAccDescription = ne, this.setAccDescription = oe, this.setDiagramTitle = le, this.getDiagramTitle = ce, this.clear(), this.setRootDoc = this.setRootDoc.bind(this), this.getDividerId = this.getDividerId.bind(this), this.setDirection = this.setDirection.bind(this), this.trimColon = this.trimColon.bind(this); } /** * Convert all of the statements (stmts) that were parsed into states and relationships. * This is done because a state diagram may have nested sections, * where each section is a 'document' and has its own set of statements. * Ex: the section within a fork has its own statements, and incoming and outgoing statements * refer to the fork as a whole (document). * See the parser grammar: the definition of a document is a document then a 'line', where a line can be a statement. * This will push the statement into the list of statements for the current document. */ extract(t) { this.clear(!0); for (const i of Array.isArray(t) ? t : t.doc) switch (i.stmt) { case Q: this.addState(i.id.trim(), i.type, i.doc, i.description, i.note); break; case Ct: this.addRelation(i.state1, i.state2, i.description); break; case fe: this.addStyleClass(i.id.trim(), i.classes); break; case pe: this.handleStyleDef(i); break; case Se: this.setCssClass(i.id.trim(), i.styleClass); break; case "click": this.addLink(i.id, i.url, i.tooltip); break; } const s = this.getStates(), a = F(); $e(), st( void 0, this.getRootDocV2(), s, this.nodes, this.edges, !0, a.look, this.classes ); for (const i of this.nodes) if (Array.isArray(i.label)) { if (i.description = i.label.slice(1), i.isGroup && i.description.length > 0) throw new Error( `Group nodes can only have label. Remove the additional description for node [${i.id}]` ); i.label = i.label[0]; } } handleStyleDef(t) { const s = t.id.trim().split(","), a = t.styleClass.split(","); for (const i of s) { let l = this.getState(i); if (!l) { const d = i.trim(); this.addState(d), l = this.getState(d); } l && (l.styles = a.map((d) => { var S; return (S = d.replace(/;/g, "")) == null ? void 0 : S.trim(); })); } } setRootDoc(t) { D.info("Setting root doc", t), this.rootDoc = t, this.version === 1 ? this.extract(t) : this.extract(this.getRootDocV2()); } docTranslator(t, s, a) { if (s.stmt === Ct) { this.docTranslator(t, s.state1, !0), this.docTranslator(t, s.state2, !1); return; } if (s.stmt === Q && (s.id === v.START_NODE ? (s.id = t.id + (a ? "_start" : "_end"), s.start = a) : s.id = s.id.trim()), s.stmt !== q && s.stmt !== Q || !s.doc) return; const i = []; let l = []; for (const d of s.doc) if (d.type === Gt) { const S = pt(d); S.doc = pt(l), i.push(S), l = []; } else l.push(d); if (i.length > 0 && l.length > 0) { const d = { stmt: Q, id: he(), type: "divider", doc: pt(l) }; i.push(pt(d)), s.doc = i; } s.doc.forEach((d) => this.docTranslator(s, d, !0)); } getRootDocV2() { return this.docTranslator( { id: q, stmt: q }, { id: q, stmt: q, doc: this.rootDoc }, !0 ), { id: q, doc: this.rootDoc }; } /** * Function called by parser when a node definition has been found. * * @param descr - description for the state. Can be a string or a list or strings * @param classes - class styles to apply to this state. Can be a string (1 style) or an array of styles. If it's just 1 class, convert it to an array of that 1 class. * @param styles - styles to apply to this state. Can be a string (1 style) or an array of styles. If it's just 1 style, convert it to an array of that 1 style. * @param textStyles - text styles to apply to this state. Can be a string (1 text test) or an array of text styles. If it's just 1 text style, convert it to an array of that 1 text style. */ addState(t, s = it, a = void 0, i = void 0, l = void 0, d = void 0, S = void 0, p = void 0) { const T = t == null ? void 0 : t.trim(); if (!this.currentDocument.states.has(T)) D.info("Adding state ", T, i), this.currentDocument.states.set(T, { stmt: Q, id: T, descriptions: [], type: s, doc: a, note: l, classes: [], styles: [], textStyles: [] }); else { const _ = this.currentDocument.states.get(T); if (!_) throw new Error(`State not found: ${T}`); _.doc || (_.doc = a), _.type || (_.type = s); } if (i && (D.info("Setting state description", T, i), (Array.isArray(i) ? i : [i]).forEach((m) => this.addDescription(T, m.trim()))), l) { const _ = this.currentDocument.states.get(T); if (!_) throw new Error(`State not found: ${T}`); _.note = l, _.note.text = W.sanitizeText(_.note.text, F()); } d && (D.info("Setting state classes", T, d), (Array.isArray(d) ? d : [d]).forEach((m) => this.setCssClass(T, m.trim()))), S && (D.info("Setting state styles", T, S), (Array.isArray(S) ? S : [S]).forEach((m) => this.setStyle(T, m.trim()))), p && (D.info("Setting state styles", T, S), (Array.isArray(p) ? p : [p]).forEach((m) => this.setTextStyle(T, m.trim()))); } clear(t) { this.nodes = [], this.edges = [], this.documents = { root: Ft() }, this.currentDocument = this.documents.root, this.startEndCount = 0, this.classes = Pt(), t || (this.links = /* @__PURE__ */ new Map(), ue()); } getState(t) { return this.currentDocument.states.get(t); } getStates() { return this.currentDocument.states; } logDocuments() { D.info("Documents = ", this.documents); } getRelations() { return this.currentDocument.relations; } /** * Adds a clickable link to a state. */ addLink(t, s, a) { this.links.set(t, { url: s, tooltip: a }), D.warn("Adding link", t, s, a); } /** * Get all registered links. */ getLinks() { return this.links; } /** * If the id is a start node ( [*] ), then return a new id constructed from * the start node name and the current start node count. * else return the given id */ startIdIfNeeded(t = "") { return t === v.START_NODE ? (this.startEndCount++, `${v.START_TYPE}${this.startEndCount}`) : t; } /** * If the id is a start node ( [*] ), then return the start type ('start') * else return the given type */ startTypeIfNeeded(t = "", s = it) { return t === v.START_NODE ? v.START_TYPE : s; } /** * If the id is an end node ( [*] ), then return a new id constructed from * the end node name and the current start_end node count. * else return the given id */ endIdIfNeeded(t = "") { return t === v.END_NODE ? (this.startEndCount++, `${v.END_TYPE}${this.startEndCount}`) : t; } /** * If the id is an end node ( [*] ), then return the end type * else return the given type * */ endTypeIfNeeded(t = "", s = it) { return t === v.END_NODE ? v.END_TYPE : s; } addRelationObjs(t, s, a = "") { const i = this.startIdIfNeeded(t.id.trim()), l = this.startTypeIfNeeded(t.id.trim(), t.type), d = this.startIdIfNeeded(s.id.trim()), S = this.startTypeIfNeeded(s.id.trim(), s.type); this.addState( i, l, t.doc, t.description, t.note, t.classes, t.styles, t.textStyles ), this.addState( d, S, s.doc, s.description, s.note, s.classes, s.styles, s.textStyles ), this.currentDocument.relations.push({ id1: i, id2: d, relationTitle: W.sanitizeText(a, F()) }); } /** * Add a relation between two items. The items may be full objects or just the string id of a state. */ addRelation(t, s, a) { if (typeof t == "object" && typeof s == "object") this.addRelationObjs(t, s, a); else if (typeof t == "string" && typeof s == "string") { const i = this.startIdIfNeeded(t.trim()), l = this.startTypeIfNeeded(t), d = this.endIdIfNeeded(s.trim()), S = this.endTypeIfNeeded(s); this.addState(i, l), this.addState(d, S), this.currentDocument.relations.push({ id1: i, id2: d, relationTitle: a ? W.sanitizeText(a, F()) : void 0 }); } } addDescription(t, s) { var l; const a = this.currentDocument.states.get(t), i = s.startsWith(":") ? s.replace(":", "").trim() : s; (l = a == null ? void 0 : a.descriptions) == null || l.push(W.sanitizeText(i, F())); } cleanupLabel(t) { return t.startsWith(":") ? t.slice(2).trim() : t.trim(); } getDividerId() { return this.dividerCnt++, `divider-id-${this.dividerCnt}`; } /** * Called when the parser comes across a (style) class definition * @example classDef my-style fill:#f96; * * @param id - the id of this (style) class * @param styleAttributes - the string with 1 or more style attributes (each separated by a comma) */ addStyleClass(t, s = "") { this.classes.has(t) || this.classes.set(t, { id: t, styles: [], textStyles: [] }); const a = this.classes.get(t); s && a && s.split(v.STYLECLASS_SEP).forEach((i) => { const l = i.replace(/([^;]*);/, "$1").trim(); if (RegExp(v.COLOR_KEYWORD).exec(i)) { const S = l.replace(v.FILL_KEYWORD, v.BG_FILL).replace(v.COLOR_KEYWORD, v.FILL_KEYWORD); a.textStyles.push(S); } a.styles.push(l); }); } getClasses() { return this.classes; } /** * Add a (style) class or css class to a state with the given id. * If the state isn't already in the list of known states, add it. * Might be called by parser when a style class or CSS class should be applied to a state * * @param itemIds - The id or a list of ids of the item(s) to apply the css class to * @param cssClassName - CSS class name */ setCssClass(t, s) { t.split(",").forEach((a) => { var l; let i = this.getState(a); if (!i) { const d = a.trim(); this.addState(d), i = this.getState(d); } (l = i == null ? void 0 : i.classes) == null || l.push(s); }); } /** * Add a style to a state with the given id. * @example style stateId fill:#f9f,stroke:#333,stroke-width:4px * where 'style' is the keyword * stateId is the id of a state * the rest of the string is the styleText (all of the attributes to be applied to the state) * * @param itemId - The id of item to apply the style to * @param styleText - the text of the attributes for the style */ setStyle(t, s) { var a, i; (i = (a = this.getState(t)) == null ? void 0 : a.styles) == null || i.push(s); } /** * Add a text style to a state with the given id * * @param itemId - The id of item to apply the css class to * @param cssClassName - CSS class name */ setTextStyle(t, s) { var a, i; (i = (a = this.getState(t)) == null ? void 0 : a.textStyles) == null || i.push(s); } /** * Finds the direction statement in the root document. * @returns the direction statement if present */ getDirectionStatement() { return this.rootDoc.find((t) => t.stmt === Rt); } getDirection() { var t; return ((t = this.getDirectionStatement()) == null ? void 0 : t.value) ?? de; } setDirection(t) { const s = this.getDirectionStatement(); s ? s.value = t : this.rootDoc.unshift({ stmt: Rt, value: t }); } trimColon(t) { return t.startsWith(":") ? t.slice(1).trim() : t.trim(); } getData() { const t = F(); return { nodes: this.nodes, edges: this.edges, other: {}, config: t, direction: Kt(this.getRootDocV2()) }; } getConfig() { return F().state; }}, f(z, "StateDB"), z.relationType = { AGGREGATION: 0, EXTENSION: 1, COMPOSITION: 2, DEPENDENCY: 3}, z), Pe = /* @__PURE__ */ f((e) => `defs #statediagram-barbEnd { fill: ${e.transitionColor}; stroke: ${e.transitionColor}; }g.stateGroup text { fill: ${e.nodeBorder}; stroke: none; font-size: 10px;}g.stateGroup text { fill: ${e.textColor}; stroke: none; font-size: 10px;
}g.stateGroup .state-title { font-weight: bolder; fill: ${e.stateLabelColor};}
g.stateGroup rect { fill: ${e.mainBkg}; stroke: ${e.nodeBorder};}
g.stateGroup line { stroke: ${e.lineColor}; stroke-width: 1;}
.transition { stroke: ${e.transitionColor}; stroke-width: 1; fill: none;}
.stateGroup .composit { fill: ${e.background}; border-bottom: 1px}
.stateGroup .alt-composit { fill: #e0e0e0; border-bottom: 1px}
.state-note { stroke: ${e.noteBorderColor}; fill: ${e.noteBkgColor};
text { fill: ${e.noteTextColor}; stroke: none; font-size: 10px; }}
.stateLabel .box { stroke: none; stroke-width: 0; fill: ${e.mainBkg}; opacity: 0.5;}
.edgeLabel .label rect { fill: ${e.labelBackgroundColor}; opacity: 0.5;}.edgeLabel { background-color: ${e.edgeLabelBackground}; p { background-color: ${e.edgeLabelBackground}; } rect { opacity: 0.5; background-color: ${e.edgeLabelBackground}; fill: ${e.edgeLabelBackground}; } text-align: center;}.edgeLabel .label text { fill: ${e.transitionLabelColor || e.tertiaryTextColor};}.label div .edgeLabel { color: ${e.transitionLabelColor || e.tertiaryTextColor};}
.stateLabel text { fill: ${e.stateLabelColor}; font-size: 10px; font-weight: bold;}
.node circle.state-start { fill: ${e.specialStateColor}; stroke: ${e.specialStateColor};}
.node .fork-join { fill: ${e.specialStateColor}; stroke: ${e.specialStateColor};}
.node circle.state-end { fill: ${e.innerEndBackground}; stroke: ${e.background}; stroke-width: 1.5}.end-state-inner { fill: ${e.compositeBackground || e.background}; // stroke: ${e.background}; stroke-width: 1.5}
.node rect { fill: ${e.stateBkg || e.mainBkg}; stroke: ${e.stateBorder || e.nodeBorder}; stroke-width: 1px;}.node polygon { fill: ${e.mainBkg}; stroke: ${e.stateBorder || e.nodeBorder};; stroke-width: 1px;}#statediagram-barbEnd { fill: ${e.lineColor};}
.statediagram-cluster rect { fill: ${e.compositeTitleBackground}; stroke: ${e.stateBorder || e.nodeBorder}; stroke-width: 1px;}
.cluster-label, .nodeLabel { color: ${e.stateLabelColor}; // line-height: 1;}
.statediagram-cluster rect.outer { rx: 5px; ry: 5px;}.statediagram-state .divider { stroke: ${e.stateBorder || e.nodeBorder};}
.statediagram-state .title-state { rx: 5px; ry: 5px;}.statediagram-cluster.statediagram-cluster .inner { fill: ${e.compositeBackground || e.background};}.statediagram-cluster.statediagram-cluster-alt .inner { fill: ${e.altBackground ? e.altBackground : "#efefef"};}
.statediagram-cluster .inner { rx:0; ry:0;}
.statediagram-state rect.basic { rx: 5px; ry: 5px;}.statediagram-state rect.divider { stroke-dasharray: 10,10; fill: ${e.altBackground ? e.altBackground : "#efefef"};}
.note-edge { stroke-dasharray: 5;}
.statediagram-note rect { fill: ${e.noteBkgColor}; stroke: ${e.noteBorderColor}; stroke-width: 1px; rx: 0; ry: 0;}.statediagram-note rect { fill: ${e.noteBkgColor}; stroke: ${e.noteBorderColor}; stroke-width: 1px; rx: 0; ry: 0;}
.statediagram-note text { fill: ${e.noteTextColor};}
.statediagram-note .nodeLabel { color: ${e.noteTextColor};}.statediagram .edgeLabel { color: red; // ${e.noteTextColor};}
#dependencyStart, #dependencyEnd { fill: ${e.lineColor}; stroke: ${e.lineColor}; stroke-width: 1;}
.statediagramTitleText { text-anchor: middle; font-size: 18px; fill: ${e.textColor};}`, "getStyles"), Me = Pe;export { Ve as S, Ge as a, Be as b, Me as s};123456789101112131415161718192021222324import { _ as n, d as r, e as d, l as g } from "./mermaid.core-BiIw1_mh.js";var u = /* @__PURE__ */ n((e, t) => { let o; return t === "sandbox" && (o = r("#i" + e)), (t === "sandbox" ? r(o.nodes()[0].contentDocument.body) : r("body")).select(`[id="${e}"]`);}, "getDiagramElement"), b = /* @__PURE__ */ n((e, t, o, i) => { e.attr("class", o); const { width: a, height: s, x: h, y: x } = l(e, t); d(e, s, a, i); const c = w(h, x, a, s, t); e.attr("viewBox", c), g.debug(`viewBox configured: ${c} with padding: ${t}`);}, "setupViewPortForSVG"), l = /* @__PURE__ */ n((e, t) => { var i; const o = ((i = e.node()) == null ? void 0 : i.getBBox()) || { width: 0, height: 0, x: 0, y: 0 }; return { width: o.width + t * 2, height: o.height + t * 2, x: o.x, y: o.y };}, "calculateDimensionsWithPadding"), w = /* @__PURE__ */ n((e, t, o, i, a) => `${e - a} ${t - a} ${o} ${i}`, "createViewBox");export { u as g, b as s};12345678910111213141516171819import { _ as e } from "./mermaid.core-BiIw1_mh.js";var l = /* @__PURE__ */ e(() => ` /* Font Awesome icon styling - consolidated */ .label-icon { display: inline-block; height: 1em; overflow: visible; vertical-align: -0.125em; } .node .label-icon path { fill: currentColor; stroke: revert; stroke-width: revert; }`, "getIconStyles");export { l as g};12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364import { _ as n, U as c, j as l } from "./mermaid.core-BiIw1_mh.js";var o = /* @__PURE__ */ n((a, t) => { const e = a.append("rect"); if (e.attr("x", t.x), e.attr("y", t.y), e.attr("fill", t.fill), e.attr("stroke", t.stroke), e.attr("width", t.width), e.attr("height", t.height), t.name && e.attr("name", t.name), t.rx && e.attr("rx", t.rx), t.ry && e.attr("ry", t.ry), t.attrs !== void 0) for (const r in t.attrs) e.attr(r, t.attrs[r]); return t.class && e.attr("class", t.class), e;}, "drawRect"), d = /* @__PURE__ */ n((a, t) => { const e = { x: t.startx, y: t.starty, width: t.stopx - t.startx, height: t.stopy - t.starty, fill: t.fill, stroke: t.stroke, class: "rect" }; o(a, e).lower();}, "drawBackgroundRect"), g = /* @__PURE__ */ n((a, t) => { const e = t.text.replace(c, " "), r = a.append("text"); r.attr("x", t.x), r.attr("y", t.y), r.attr("class", "legend"), r.style("text-anchor", t.anchor), t.class && r.attr("class", t.class); const s = r.append("tspan"); return s.attr("x", t.x + t.textMargin * 2), s.text(e), r;}, "drawText"), h = /* @__PURE__ */ n((a, t, e, r) => { const s = a.append("image"); s.attr("x", t), s.attr("y", e); const i = l(r); s.attr("xlink:href", i);}, "drawImage"), m = /* @__PURE__ */ n((a, t, e, r) => { const s = a.append("use"); s.attr("x", t), s.attr("y", e); const i = l(r); s.attr("xlink:href", `#${i}`);}, "drawEmbeddedImage"), y = /* @__PURE__ */ n(() => ({ x: 0, y: 0, width: 100, height: 100, fill: "#EDF2AE", stroke: "#666", anchor: "start", rx: 0, ry: 0}), "getNoteRect"), p = /* @__PURE__ */ n(() => ({ x: 0, y: 0, width: 100, height: 100, "text-anchor": "start", style: "#666", textMargin: 0, rx: 0, ry: 0, tspan: !0}), "getTextObj");export { d as a, p as b, m as c, o as d, h as e, g as f, y as g};123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374import { g as et } from "./chunk-UIWBPB2F-muaaSQOG.js";import { g as tt, s as st } from "./chunk-HPOVUXKZ-C_XOradn.js";import { _ as f, l as Oe, c as F, o as it, r as at, u as we, d as $, b as nt, a as rt, s as ut, g as lt, p as ct, q as ot, k as v, y as ht, x as dt, i as pt, Q as R } from "./mermaid.core-BiIw1_mh.js";var Ve = function() { var s = /* @__PURE__ */ f(function(I, c, h, p) { for (h = h || {}, p = I.length; p--; h[I[p]] = c) ; return h; }, "o"), i = [1, 18], a = [1, 19], u = [1, 20], l = [1, 41], r = [1, 42], o = [1, 26], A = [1, 24], g = [1, 25], k = [1, 32], L = [1, 33], Ae = [1, 34], m = [1, 45], fe = [1, 35], ge = [1, 36], Ce = [1, 37], me = [1, 38], be = [1, 27], Ee = [1, 28], ye = [1, 29], Te = [1, 30], ke = [1, 31], b = [1, 44], E = [1, 46], y = [1, 43], D = [1, 47], De = [1, 9], d = [1, 8, 9], ee = [1, 58], te = [1, 59], se = [1, 60], ie = [1, 61], ae = [1, 62], Fe = [1, 63], Be = [1, 64], ne = [1, 8, 9, 41], Pe = [1, 76], P = [1, 8, 9, 12, 13, 22, 39, 41, 44, 66, 67, 68, 69, 70, 71, 72, 77, 79], re = [1, 8, 9, 12, 13, 17, 20, 22, 39, 41, 44, 48, 58, 66, 67, 68, 69, 70, 71, 72, 77, 79, 84, 99, 101, 102], ue = [13, 58, 84, 99, 101, 102], z = [13, 58, 71, 72, 84, 99, 101, 102], Me = [13, 58, 66, 67, 68, 69, 70, 84, 99, 101, 102], _e = [1, 98], K = [1, 115], Y = [1, 107], Q = [1, 113], W = [1, 108], j = [1, 109], X = [1, 110], q = [1, 111], H = [1, 112], J = [1, 114], Re = [22, 58, 59, 80, 84, 85, 86, 87, 88, 89], Se = [1, 8, 9, 39, 41, 44], le = [1, 8, 9, 22], Ge = [1, 143], Ue = [1, 8, 9, 59], N = [1, 8, 9, 22, 58, 59, 80, 84, 85, 86, 87, 88, 89], Ne = { trace: /* @__PURE__ */ f(function() { }, "trace"), yy: {}, symbols_: { error: 2, start: 3, mermaidDoc: 4, statements: 5, graphConfig: 6, CLASS_DIAGRAM: 7, NEWLINE: 8, EOF: 9, statement: 10, classLabel: 11, SQS: 12, STR: 13, SQE: 14, namespaceName: 15, alphaNumToken: 16, DOT: 17, className: 18, classLiteralName: 19, GENERICTYPE: 20, relationStatement: 21, LABEL: 22, namespaceStatement: 23, classStatement: 24, memberStatement: 25, annotationStatement: 26, clickStatement: 27, styleStatement: 28, cssClassStatement: 29, noteStatement: 30, classDefStatement: 31, direction: 32, acc_title: 33, acc_title_value: 34, acc_descr: 35, acc_descr_value: 36, acc_descr_multiline_value: 37, namespaceIdentifier: 38, STRUCT_START: 39, classStatements: 40, STRUCT_STOP: 41, NAMESPACE: 42, classIdentifier: 43, STYLE_SEPARATOR: 44, members: 45, CLASS: 46, ANNOTATION_START: 47, ANNOTATION_END: 48, MEMBER: 49, SEPARATOR: 50, relation: 51, NOTE_FOR: 52, noteText: 53, NOTE: 54, CLASSDEF: 55, classList: 56, stylesOpt: 57, ALPHA: 58, COMMA: 59, direction_tb: 60, direction_bt: 61, direction_rl: 62, direction_lr: 63, relationType: 64, lineType: 65, AGGREGATION: 66, EXTENSION: 67, COMPOSITION: 68, DEPENDENCY: 69, LOLLIPOP: 70, LINE: 71, DOTTED_LINE: 72, CALLBACK: 73, LINK: 74, LINK_TARGET: 75, CLICK: 76, CALLBACK_NAME: 77, CALLBACK_ARGS: 78, HREF: 79, STYLE: 80, CSSCLASS: 81, style: 82, styleComponent: 83, NUM: 84, COLON: 85, UNIT: 86, SPACE: 87, BRKT: 88, PCT: 89, commentToken: 90, textToken: 91, graphCodeTokens: 92, textNoTagsToken: 93, TAGSTART: 94, TAGEND: 95, "==": 96, "--": 97, DEFAULT: 98, MINUS: 99, keywords: 100, UNICODE_TEXT: 101, BQUOTE_STR: 102, $accept: 0, $end: 1 }, terminals_: { 2: "error", 7: "CLASS_DIAGRAM", 8: "NEWLINE", 9: "EOF", 12: "SQS", 13: "STR", 14: "SQE", 17: "DOT", 20: "GENERICTYPE", 22: "LABEL", 33: "acc_title", 34: "acc_title_value", 35: "acc_descr", 36: "acc_descr_value", 37: "acc_descr_multiline_value", 39: "STRUCT_START", 41: "STRUCT_STOP", 42: "NAMESPACE", 44: "STYLE_SEPARATOR", 46: "CLASS", 47: "ANNOTATION_START", 48: "ANNOTATION_END", 49: "MEMBER", 50: "SEPARATOR", 52: "NOTE_FOR", 54: "NOTE", 55: "CLASSDEF", 58: "ALPHA", 59: "COMMA", 60: "direction_tb", 61: "direction_bt", 62: "direction_rl", 63: "direction_lr", 66: "AGGREGATION", 67: "EXTENSION", 68: "COMPOSITION", 69: "DEPENDENCY", 70: "LOLLIPOP", 71: "LINE", 72: "DOTTED_LINE", 73: "CALLBACK", 74: "LINK", 75: "LINK_TARGET", 76: "CLICK", 77: "CALLBACK_NAME", 78: "CALLBACK_ARGS", 79: "HREF", 80: "STYLE", 81: "CSSCLASS", 84: "NUM", 85: "COLON", 86: "UNIT", 87: "SPACE", 88: "BRKT", 89: "PCT", 92: "graphCodeTokens", 94: "TAGSTART", 95: "TAGEND", 96: "==", 97: "--", 98: "DEFAULT", 99: "MINUS", 100: "keywords", 101: "UNICODE_TEXT", 102: "BQUOTE_STR" }, productions_: [0, [3, 1], [3, 1], [4, 1], [6, 4], [5, 1], [5, 2], [5, 3], [11, 3], [15, 1], [15, 3], [15, 2], [18, 1], [18, 3], [18, 1], [18, 2], [18, 2], [18, 2], [10, 1], [10, 2], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 1], [10, 2], [10, 2], [10, 1], [23, 4], [23, 5], [38, 2], [40, 1], [40, 2], [40, 3], [24, 1], [24, 3], [24, 4], [24, 6], [43, 2], [43, 3], [26, 4], [45, 1], [45, 2], [25, 1], [25, 2], [25, 1], [25, 1], [21, 3], [21, 4], [21, 4], [21, 5], [30, 3], [30, 2], [31, 3], [56, 1], [56, 3], [32, 1], [32, 1], [32, 1], [32, 1], [51, 3], [51, 2], [51, 2], [51, 1], [64, 1], [64, 1], [64, 1], [64, 1], [64, 1], [65, 1], [65, 1], [27, 3], [27, 4], [27, 3], [27, 4], [27, 4], [27, 5], [27, 3], [27, 4], [27, 4], [27, 5], [27, 4], [27, 5], [27, 5], [27, 6], [28, 3], [29, 3], [57, 1], [57, 3], [82, 1], [82, 2], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [90, 1], [90, 1], [91, 1], [91, 1], [91, 1], [91, 1], [91, 1], [91, 1], [91, 1], [93, 1], [93, 1], [93, 1], [93, 1], [16, 1], [16, 1], [16, 1], [16, 1], [19, 1], [53, 1]], performAction: /* @__PURE__ */ f(function(c, h, p, n, C, e, Z) { var t = e.length - 1; switch (C) { case 8: this.$ = e[t - 1]; break; case 9: case 12: case 14: this.$ = e[t]; break; case 10: case 13: this.$ = e[t - 2] + "." + e[t]; break; case 11: case 15: this.$ = e[t - 1] + e[t]; break; case 16: case 17: this.$ = e[t - 1] + "~" + e[t] + "~"; break; case 18: n.addRelation(e[t]); break; case 19: e[t - 1].title = n.cleanupLabel(e[t]), n.addRelation(e[t - 1]); break; case 30: this.$ = e[t].trim(), n.setAccTitle(this.$); break; case 31: case 32: this.$ = e[t].trim(), n.setAccDescription(this.$); break; case 33: n.addClassesToNamespace(e[t - 3], e[t - 1]); break; case 34: n.addClassesToNamespace(e[t - 4], e[t - 1]); break; case 35: this.$ = e[t], n.addNamespace(e[t]); break; case 36: this.$ = [e[t]]; break; case 37: this.$ = [e[t - 1]]; break; case 38: e[t].unshift(e[t - 2]), this.$ = e[t]; break; case 40: n.setCssClass(e[t - 2], e[t]); break; case 41: n.addMembers(e[t - 3], e[t - 1]); break; case 42: n.setCssClass(e[t - 5], e[t - 3]), n.addMembers(e[t - 5], e[t - 1]); break; case 43: this.$ = e[t], n.addClass(e[t]); break; case 44: this.$ = e[t - 1], n.addClass(e[t - 1]), n.setClassLabel(e[t - 1], e[t]); break; case 45: n.addAnnotation(e[t], e[t - 2]); break; case 46: case 59: this.$ = [e[t]]; break; case 47: e[t].push(e[t - 1]), this.$ = e[t]; break; case 48: break; case 49: n.addMember(e[t - 1], n.cleanupLabel(e[t])); break; case 50: break; case 51: break; case 52: this.$ = { id1: e[t - 2], id2: e[t], relation: e[t - 1], relationTitle1: "none", relationTitle2: "none" }; break; case 53: this.$ = { id1: e[t - 3], id2: e[t], relation: e[t - 1], relationTitle1: e[t - 2], relationTitle2: "none" }; break; case 54: this.$ = { id1: e[t - 3], id2: e[t], relation: e[t - 2], relationTitle1: "none", relationTitle2: e[t - 1] }; break; case 55: this.$ = { id1: e[t - 4], id2: e[t], relation: e[t - 2], relationTitle1: e[t - 3], relationTitle2: e[t - 1] }; break; case 56: n.addNote(e[t], e[t - 1]); break; case 57: n.addNote(e[t]); break; case 58: this.$ = e[t - 2], n.defineClass(e[t - 1], e[t]); break; case 60: this.$ = e[t - 2].concat([e[t]]); break; case 61: n.setDirection("TB"); break; case 62: n.setDirection("BT"); break; case 63: n.setDirection("RL"); break; case 64: n.setDirection("LR"); break; case 65: this.$ = { type1: e[t - 2], type2: e[t], lineType: e[t - 1] }; break; case 66: this.$ = { type1: "none", type2: e[t], lineType: e[t - 1] }; break; case 67: this.$ = { type1: e[t - 1], type2: "none", lineType: e[t] }; break; case 68: this.$ = { type1: "none", type2: "none", lineType: e[t] }; break; case 69: this.$ = n.relationType.AGGREGATION; break; case 70: this.$ = n.relationType.EXTENSION; break; case 71: this.$ = n.relationType.COMPOSITION; break; case 72: this.$ = n.relationType.DEPENDENCY; break; case 73: this.$ = n.relationType.LOLLIPOP; break; case 74: this.$ = n.lineType.LINE; break; case 75: this.$ = n.lineType.DOTTED_LINE; break; case 76: case 82: this.$ = e[t - 2], n.setClickEvent(e[t - 1], e[t]); break; case 77: case 83: this.$ = e[t - 3], n.setClickEvent(e[t - 2], e[t - 1]), n.setTooltip(e[t - 2], e[t]); break; case 78: this.$ = e[t - 2], n.setLink(e[t - 1], e[t]); break; case 79: this.$ = e[t - 3], n.setLink(e[t - 2], e[t - 1], e[t]); break; case 80: this.$ = e[t - 3], n.setLink(e[t - 2], e[t - 1]), n.setTooltip(e[t - 2], e[t]); break; case 81: this.$ = e[t - 4], n.setLink(e[t - 3], e[t - 2], e[t]), n.setTooltip(e[t - 3], e[t - 1]); break; case 84: this.$ = e[t - 3], n.setClickEvent(e[t - 2], e[t - 1], e[t]); break; case 85: this.$ = e[t - 4], n.setClickEvent(e[t - 3], e[t - 2], e[t - 1]), n.setTooltip(e[t - 3], e[t]); break; case 86: this.$ = e[t - 3], n.setLink(e[t - 2], e[t]); break; case 87: this.$ = e[t - 4], n.setLink(e[t - 3], e[t - 1], e[t]); break; case 88: this.$ = e[t - 4], n.setLink(e[t - 3], e[t - 1]), n.setTooltip(e[t - 3], e[t]); break; case 89: this.$ = e[t - 5], n.setLink(e[t - 4], e[t - 2], e[t]), n.setTooltip(e[t - 4], e[t - 1]); break; case 90: this.$ = e[t - 2], n.setCssStyle(e[t - 1], e[t]); break; case 91: n.setCssClass(e[t - 1], e[t]); break; case 92: this.$ = [e[t]]; break; case 93: e[t - 2].push(e[t]), this.$ = e[t - 2]; break; case 95: this.$ = e[t - 1] + e[t]; break; } }, "anonymous"), table: [{ 3: 1, 4: 2, 5: 3, 6: 4, 7: [1, 6], 10: 5, 16: 39, 18: 21, 19: 40, 21: 7, 23: 8, 24: 9, 25: 10, 26: 11, 27: 12, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 33: i, 35: a, 37: u, 38: 22, 42: l, 43: 23, 46: r, 47: o, 49: A, 50: g, 52: k, 54: L, 55: Ae, 58: m, 60: fe, 61: ge, 62: Ce, 63: me, 73: be, 74: Ee, 76: ye, 80: Te, 81: ke, 84: b, 99: E, 101: y, 102: D }, { 1: [3] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3] }, s(De, [2, 5], { 8: [1, 48] }), { 8: [1, 49] }, s(d, [2, 18], { 22: [1, 50] }), s(d, [2, 20]), s(d, [2, 21]), s(d, [2, 22]), s(d, [2, 23]), s(d, [2, 24]), s(d, [2, 25]), s(d, [2, 26]), s(d, [2, 27]), s(d, [2, 28]), s(d, [2, 29]), { 34: [1, 51] }, { 36: [1, 52] }, s(d, [2, 32]), s(d, [2, 48], { 51: 53, 64: 56, 65: 57, 13: [1, 54], 22: [1, 55], 66: ee, 67: te, 68: se, 69: ie, 70: ae, 71: Fe, 72: Be }), { 39: [1, 65] }, s(ne, [2, 39], { 39: [1, 67], 44: [1, 66] }), s(d, [2, 50]), s(d, [2, 51]), { 16: 68, 58: m, 84: b, 99: E, 101: y }, { 16: 39, 18: 69, 19: 40, 58: m, 84: b, 99: E, 101: y, 102: D }, { 16: 39, 18: 70, 19: 40, 58: m, 84: b, 99: E, 101: y, 102: D }, { 16: 39, 18: 71, 19: 40, 58: m, 84: b, 99: E, 101: y, 102: D }, { 58: [1, 72] }, { 13: [1, 73] }, { 16: 39, 18: 74, 19: 40, 58: m, 84: b, 99: E, 101: y, 102: D }, { 13: Pe, 53: 75 }, { 56: 77, 58: [1, 78] }, s(d, [2, 61]), s(d, [2, 62]), s(d, [2, 63]), s(d, [2, 64]), s(P, [2, 12], { 16: 39, 19: 40, 18: 80, 17: [1, 79], 20: [1, 81], 58: m, 84: b, 99: E, 101: y, 102: D }), s(P, [2, 14], { 20: [1, 82] }), { 15: 83, 16: 84, 58: m, 84: b, 99: E, 101: y }, { 16: 39, 18: 85, 19: 40, 58: m, 84: b, 99: E, 101: y, 102: D }, s(re, [2, 118]), s(re, [2, 119]), s(re, [2, 120]), s(re, [2, 121]), s([1, 8, 9, 12, 13, 20, 22, 39, 41, 44, 66, 67, 68, 69, 70, 71, 72, 77, 79], [2, 122]), s(De, [2, 6], { 10: 5, 21: 7, 23: 8, 24: 9, 25: 10, 26: 11, 27: 12, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 18: 21, 38: 22, 43: 23, 16: 39, 19: 40, 5: 86, 33: i, 35: a, 37: u, 42: l, 46: r, 47: o, 49: A, 50: g, 52: k, 54: L, 55: Ae, 58: m, 60: fe, 61: ge, 62: Ce, 63: me, 73: be, 74: Ee, 76: ye, 80: Te, 81: ke, 84: b, 99: E, 101: y, 102: D }), { 5: 87, 10: 5, 16: 39, 18: 21, 19: 40, 21: 7, 23: 8, 24: 9, 25: 10, 26: 11, 27: 12, 28: 13, 29: 14, 30: 15, 31: 16, 32: 17, 33: i, 35: a, 37: u, 38: 22, 42: l, 43: 23, 46: r, 47: o, 49: A, 50: g, 52: k, 54: L, 55: Ae, 58: m, 60: fe, 61: ge, 62: Ce, 63: me, 73: be, 74: Ee, 76: ye, 80: Te, 81: ke, 84: b, 99: E, 101: y, 102: D }, s(d, [2, 19]), s(d, [2, 30]), s(d, [2, 31]), { 13: [1, 89], 16: 39, 18: 88, 19: 40, 58: m, 84: b, 99: E, 101: y, 102: D }, { 51: 90, 64: 56, 65: 57, 66: ee, 67: te, 68: se, 69: ie, 70: ae, 71: Fe, 72: Be }, s(d, [2, 49]), { 65: 91, 71: Fe, 72: Be }, s(ue, [2, 68], { 64: 92, 66: ee, 67: te, 68: se, 69: ie, 70: ae }), s(z, [2, 69]), s(z, [2, 70]), s(z, [2, 71]), s(z, [2, 72]), s(z, [2, 73]), s(Me, [2, 74]), s(Me, [2, 75]), { 8: [1, 94], 24: 95, 40: 93, 43: 23, 46: r }, { 16: 96, 58: m, 84: b, 99: E, 101: y }, { 45: 97, 49: _e }, { 48: [1, 99] }, { 13: [1, 100] }, { 13: [1, 101] }, { 77: [1, 102], 79: [1, 103] }, { 22: K, 57: 104, 58: Y, 80: Q, 82: 105, 83: 106, 84: W, 85: j, 86: X, 87: q, 88: H, 89: J }, { 58: [1, 116] }, { 13: Pe, 53: 117 }, s(d, [2, 57]), s(d, [2, 123]), { 22: K, 57: 118, 58: Y, 59: [1, 119], 80: Q, 82: 105, 83: 106, 84: W, 85: j, 86: X, 87: q, 88: H, 89: J }, s(Re, [2, 59]), { 16: 39, 18: 120, 19: 40, 58: m, 84: b, 99: E, 101: y, 102: D }, s(P, [2, 15]), s(P, [2, 16]), s(P, [2, 17]), { 39: [2, 35] }, { 15: 122, 16: 84, 17: [1, 121], 39: [2, 9], 58: m, 84: b, 99: E, 101: y }, s(Se, [2, 43], { 11: 123, 12: [1, 124] }), s(De, [2, 7]), { 9: [1, 125] }, s(le, [2, 52]), { 16: 39, 18: 126, 19: 40, 58: m, 84: b, 99: E, 101: y, 102: D }, { 13: [1, 128], 16: 39, 18: 127, 19: 40, 58: m, 84: b, 99: E, 101: y, 102: D }, s(ue, [2, 67], { 64: 129, 66: ee, 67: te, 68: se, 69: ie, 70: ae }), s(ue, [2, 66]), { 41: [1, 130] }, { 24: 95, 40: 131, 43: 23, 46: r }, { 8: [1, 132], 41: [2, 36] }, s(ne, [2, 40], { 39: [1, 133] }), { 41: [1, 134] }, { 41: [2, 46], 45: 135, 49: _e }, { 16: 39, 18: 136, 19: 40, 58: m, 84: b, 99: E, 101: y, 102: D }, s(d, [2, 76], { 13: [1, 137] }), s(d, [2, 78], { 13: [1, 139], 75: [1, 138] }), s(d, [2, 82], { 13: [1, 140], 78: [1, 141] }), { 13: [1, 142] }, s(d, [2, 90], { 59: Ge }), s(Ue, [2, 92], { 83: 144, 22: K, 58: Y, 80: Q, 84: W, 85: j, 86: X, 87: q, 88: H, 89: J }), s(N, [2, 94]), s(N, [2, 96]), s(N, [2, 97]), s(N, [2, 98]), s(N, [2, 99]), s(N, [2, 100]), s(N, [2, 101]), s(N, [2, 102]), s(N, [2, 103]), s(N, [2, 104]), s(d, [2, 91]), s(d, [2, 56]), s(d, [2, 58], { 59: Ge }), { 58: [1, 145] }, s(P, [2, 13]), { 15: 146, 16: 84, 58: m, 84: b, 99: E, 101: y }, { 39: [2, 11] }, s(Se, [2, 44]), { 13: [1, 147] }, { 1: [2, 4] }, s(le, [2, 54]), s(le, [2, 53]), { 16: 39, 18: 148, 19: 40, 58: m, 84: b, 99: E, 101: y, 102: D }, s(ue, [2, 65]), s(d, [2, 33]), { 41: [1, 149] }, { 24: 95, 40: 150, 41: [2, 37], 43: 23, 46: r }, { 45: 151, 49: _e }, s(ne, [2, 41]), { 41: [2, 47] }, s(d, [2, 45]), s(d, [2, 77]), s(d, [2, 79]), s(d, [2, 80], { 75: [1, 152] }), s(d, [2, 83]), s(d, [2, 84], { 13: [1, 153] }), s(d, [2, 86], { 13: [1, 155], 75: [1, 154] }), { 22: K, 58: Y, 80: Q, 82: 156, 83: 106, 84: W, 85: j, 86: X, 87: q, 88: H, 89: J }, s(N, [2, 95]), s(Re, [2, 60]), { 39: [2, 10] }, { 14: [1, 157] }, s(le, [2, 55]), s(d, [2, 34]), { 41: [2, 38] }, { 41: [1, 158] }, s(d, [2, 81]), s(d, [2, 85]), s(d, [2, 87]), s(d, [2, 88], { 75: [1, 159] }), s(Ue, [2, 93], { 83: 144, 22: K, 58: Y, 80: Q, 84: W, 85: j, 86: X, 87: q, 88: H, 89: J }), s(Se, [2, 8]), s(ne, [2, 42]), s(d, [2, 89])], defaultActions: { 2: [2, 1], 3: [2, 2], 4: [2, 3], 83: [2, 35], 122: [2, 11], 125: [2, 4], 135: [2, 47], 146: [2, 10], 150: [2, 38] }, parseError: /* @__PURE__ */ f(function(c, h) { if (h.recoverable) this.trace(c); else { var p = new Error(c); throw p.hash = h, p; } }, "parseError"), parse: /* @__PURE__ */ f(function(c) { var h = this, p = [0], n = [], C = [null], e = [], Z = this.table, t = "", oe = 0, ze = 0, He = 2, Ke = 1, Je = e.slice.call(arguments, 1), T = Object.create(this.lexer), O = { yy: {} }; for (var Le in this.yy) Object.prototype.hasOwnProperty.call(this.yy, Le) && (O.yy[Le] = this.yy[Le]); T.setInput(c, O.yy), O.yy.lexer = T, O.yy.parser = this, typeof T.yylloc > "u" && (T.yylloc = {}); var xe = T.yylloc; e.push(xe); var Ze = T.options && T.options.ranges; typeof O.yy.parseError == "function" ? this.parseError = O.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError; function $e(_) { p.length = p.length - 2 * _, C.length = C.length - _, e.length = e.length - _; } f($e, "popStack"); function Ye() { var _; return _ = n.pop() || T.lex() || Ke, typeof _ != "number" && (_ instanceof Array && (n = _, _ = n.pop()), _ = h.symbols_[_] || _), _; } f(Ye, "lex"); for (var B, w, S, ve, M = {}, he, x, Qe, de; ; ) { if (w = p[p.length - 1], this.defaultActions[w] ? S = this.defaultActions[w] : ((B === null || typeof B > "u") && (B = Ye()), S = Z[w] && Z[w][B]), typeof S > "u" || !S.length || !S[0]) { var Ie = ""; de = []; for (he in Z[w]) this.terminals_[he] && he > He && de.push("'" + this.terminals_[he] + "'"); T.showPosition ? Ie = "Parse error on line " + (oe + 1) + `:` + T.showPosition() + `Expecting ` + de.join(", ") + ", got '" + (this.terminals_[B] || B) + "'" : Ie = "Parse error on line " + (oe + 1) + ": Unexpected " + (B == Ke ? "end of input" : "'" + (this.terminals_[B] || B) + "'"), this.parseError(Ie, { text: T.match, token: this.terminals_[B] || B, line: T.yylineno, loc: xe, expected: de }); } if (S[0] instanceof Array && S.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + w + ", token: " + B); switch (S[0]) { case 1: p.push(B), C.push(T.yytext), e.push(T.yylloc), p.push(S[1]), B = null, ze = T.yyleng, t = T.yytext, oe = T.yylineno, xe = T.yylloc; break; case 2: if (x = this.productions_[S[1]][1], M.$ = C[C.length - x], M._$ = { first_line: e[e.length - (x || 1)].first_line, last_line: e[e.length - 1].last_line, first_column: e[e.length - (x || 1)].first_column, last_column: e[e.length - 1].last_column }, Ze && (M._$.range = [ e[e.length - (x || 1)].range[0], e[e.length - 1].range[1] ]), ve = this.performAction.apply(M, [ t, ze, oe, O.yy, S[1], C, e ].concat(Je)), typeof ve < "u") return ve; x && (p = p.slice(0, -1 * x * 2), C = C.slice(0, -1 * x), e = e.slice(0, -1 * x)), p.push(this.productions_[S[1]][0]), C.push(M.$), e.push(M._$), Qe = Z[p[p.length - 2]][p[p.length - 1]], p.push(Qe); break; case 3: return !0; } } return !0; }, "parse") }, qe = /* @__PURE__ */ function() { var I = { EOF: 1, parseError: /* @__PURE__ */ f(function(h, p) { if (this.yy.parser) this.yy.parser.parseError(h, p); else throw new Error(h); }, "parseError"), // resets the lexer, sets new input setInput: /* @__PURE__ */ f(function(c, h) { return this.yy = h || this.yy || {}, this._input = c, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this; }, "setInput"), // consumes and returns one char from the input input: /* @__PURE__ */ f(function() { var c = this._input[0]; this.yytext += c, this.yyleng++, this.offset++, this.match += c, this.matched += c; var h = c.match(/(?:\r\n?|\n).*/g); return h ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), c; }, "input"), // unshifts one char (or a string) into the input unput: /* @__PURE__ */ f(function(c) { var h = c.length, p = c.split(/(?:\r\n?|\n)/g); this._input = c + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - h), this.offset -= h; var n = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), p.length - 1 && (this.yylineno -= p.length - 1); var C = this.yylloc.range; return this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: p ? (p.length === n.length ? this.yylloc.first_column : 0) + n[n.length - p.length].length - p[0].length : this.yylloc.first_column - h }, this.options.ranges && (this.yylloc.range = [C[0], C[0] + this.yyleng - h]), this.yyleng = this.yytext.length, this; }, "unput"), // When called from action, caches matched text and appends it on next action more: /* @__PURE__ */ f(function() { return this._more = !0, this; }, "more"), // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject: /* @__PURE__ */ f(function() { if (this.options.backtrack_lexer) this._backtrack = !0; else return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).` + this.showPosition(), { text: "", token: null, line: this.yylineno }); return this; }, "reject"), // retain first n characters of the match less: /* @__PURE__ */ f(function(c) { this.unput(this.match.slice(c)); }, "less"), // displays already matched input, i.e. for error messages pastInput: /* @__PURE__ */ f(function() { var c = this.matched.substr(0, this.matched.length - this.match.length); return (c.length > 20 ? "..." : "") + c.substr(-20).replace(/\n/g, ""); }, "pastInput"), // displays upcoming input, i.e. for error messages upcomingInput: /* @__PURE__ */ f(function() { var c = this.match; return c.length < 20 && (c += this._input.substr(0, 20 - c.length)), (c.substr(0, 20) + (c.length > 20 ? "..." : "")).replace(/\n/g, ""); }, "upcomingInput"), // displays the character position where the lexing error occurred, i.e. for error messages showPosition: /* @__PURE__ */ f(function() { var c = this.pastInput(), h = new Array(c.length + 1).join("-"); return c + this.upcomingInput() + `` + h + "^"; }, "showPosition"), // test the lexed token: return FALSE when not a match, otherwise return token test_match: /* @__PURE__ */ f(function(c, h) { var p, n, C; if (this.options.backtrack_lexer && (C = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }, this.options.ranges && (C.yylloc.range = this.yylloc.range.slice(0))), n = c[0].match(/(?:\r\n?|\n).*/g), n && (this.yylineno += n.length), this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: n ? n[n.length - 1].length - n[n.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + c[0].length }, this.yytext += c[0], this.match += c[0], this.matches = c, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(c[0].length), this.matched += c[0], p = this.performAction.call(this, this.yy, this, h, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), p) return p; if (this._backtrack) { for (var e in C) this[e] = C[e]; return !1; } return !1; }, "test_match"), // return next match in input next: /* @__PURE__ */ f(function() { if (this.done) return this.EOF; this._input || (this.done = !0); var c, h, p, n; this._more || (this.yytext = "", this.match = ""); for (var C = this._currentRules(), e = 0; e < C.length; e++) if (p = this._input.match(this.rules[C[e]]), p && (!h || p[0].length > h[0].length)) { if (h = p, n = e, this.options.backtrack_lexer) { if (c = this.test_match(p, C[e]), c !== !1) return c; if (this._backtrack) { h = !1; continue; } else return !1; } else if (!this.options.flex) break; } return h ? (c = this.test_match(h, C[n]), c !== !1 ? c : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.` + this.showPosition(), { text: "", token: null, line: this.yylineno }); }, "next"), // return next match that has a token lex: /* @__PURE__ */ f(function() { var h = this.next(); return h || this.lex(); }, "lex"), // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin: /* @__PURE__ */ f(function(h) { this.conditionStack.push(h); }, "begin"), // pop the previously active lexer condition state off the condition stack popState: /* @__PURE__ */ f(function() { var h = this.conditionStack.length - 1; return h > 0 ? this.conditionStack.pop() : this.conditionStack[0]; }, "popState"), // produce the lexer rule set which is active for the currently active lexer condition state _currentRules: /* @__PURE__ */ f(function() { return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules; }, "_currentRules"), // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState: /* @__PURE__ */ f(function(h) { return h = this.conditionStack.length - 1 - Math.abs(h || 0), h >= 0 ? this.conditionStack[h] : "INITIAL"; }, "topState"), // alias for begin(condition) pushState: /* @__PURE__ */ f(function(h) { this.begin(h); }, "pushState"), // return the number of states currently on the stack stateStackSize: /* @__PURE__ */ f(function() { return this.conditionStack.length; }, "stateStackSize"), options: {}, performAction: /* @__PURE__ */ f(function(h, p, n, C) { switch (n) { case 0: return 60; case 1: return 61; case 2: return 62; case 3: return 63; case 4: break; case 5: break; case 6: return this.begin("acc_title"), 33; case 7: return this.popState(), "acc_title_value"; case 8: return this.begin("acc_descr"), 35; case 9: return this.popState(), "acc_descr_value"; case 10: this.begin("acc_descr_multiline"); break; case 11: this.popState(); break; case 12: return "acc_descr_multiline_value"; case 13: return 8; case 14: break; case 15: return 7; case 16: return 7; case 17: return "EDGE_STATE"; case 18: this.begin("callback_name"); break; case 19: this.popState(); break; case 20: this.popState(), this.begin("callback_args"); break; case 21: return 77; case 22: this.popState(); break; case 23: return 78; case 24: this.popState(); break; case 25: return "STR"; case 26: this.begin("string"); break; case 27: return 80; case 28: return 55; case 29: return this.begin("namespace"), 42; case 30: return this.popState(), 8; case 31: break; case 32: return this.begin("namespace-body"), 39; case 33: return this.popState(), 41; case 34: return "EOF_IN_STRUCT"; case 35: return 8; case 36: break; case 37: return "EDGE_STATE"; case 38: return this.begin("class"), 46; case 39: return this.popState(), 8; case 40: break; case 41: return this.popState(), this.popState(), 41; case 42: return this.begin("class-body"), 39; case 43: return this.popState(), 41; case 44: return "EOF_IN_STRUCT"; case 45: return "EDGE_STATE"; case 46: return "OPEN_IN_STRUCT"; case 47: break; case 48: return "MEMBER"; case 49: return 81; case 50: return 73; case 51: return 74; case 52: return 76; case 53: return 52; case 54: return 54; case 55: return 47; case 56: return 48; case 57: return 79; case 58: this.popState(); break; case 59: return "GENERICTYPE"; case 60: this.begin("generic"); break; case 61: this.popState(); break; case 62: return "BQUOTE_STR"; case 63: this.begin("bqstring"); break; case 64: return 75; case 65: return 75; case 66: return 75; case 67: return 75; case 68: return 67; case 69: return 67; case 70: return 69; case 71: return 69; case 72: return 68; case 73: return 66; case 74: return 70; case 75: return 71; case 76: return 72; case 77: return 22; case 78: return 44; case 79: return 99; case 80: return 17; case 81: return "PLUS"; case 82: return 85; case 83: return 59; case 84: return 88; case 85: return 88; case 86: return 89; case 87: return "EQUALS"; case 88: return "EQUALS"; case 89: return 58; case 90: return 12; case 91: return 14; case 92: return "PUNCTUATION"; case 93: return 84; case 94: return 101; case 95: return 87; case 96: return 87; case 97: return 9; } }, "anonymous"), rules: [/^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/, /^(?:%%[^\n]*(\r?\n)*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:classDiagram-v2\b)/, /^(?:classDiagram\b)/, /^(?:\[\*\])/, /^(?:call[\s]+)/, /^(?:\([\s]*\))/, /^(?:\()/, /^(?:[^(]*)/, /^(?:\))/, /^(?:[^)]*)/, /^(?:["])/, /^(?:[^"]*)/, /^(?:["])/, /^(?:style\b)/, /^(?:classDef\b)/, /^(?:namespace\b)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:[{])/, /^(?:[}])/, /^(?:$)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:\[\*\])/, /^(?:class\b)/, /^(?:\s*(\r?\n)+)/, /^(?:\s+)/, /^(?:[}])/, /^(?:[{])/, /^(?:[}])/, /^(?:$)/, /^(?:\[\*\])/, /^(?:[{])/, /^(?:[\n])/, /^(?:[^{}\n]*)/, /^(?:cssClass\b)/, /^(?:callback\b)/, /^(?:link\b)/, /^(?:click\b)/, /^(?:note for\b)/, /^(?:note\b)/, /^(?:<<)/, /^(?:>>)/, /^(?:href\b)/, /^(?:[~])/, /^(?:[^~]*)/, /^(?:~)/, /^(?:[`])/, /^(?:[^`]+)/, /^(?:[`])/, /^(?:_self\b)/, /^(?:_blank\b)/, /^(?:_parent\b)/, /^(?:_top\b)/, /^(?:\s*<\|)/, /^(?:\s*\|>)/, /^(?:\s*>)/, /^(?:\s*<)/, /^(?:\s*\*)/, /^(?:\s*o\b)/, /^(?:\s*\(\))/, /^(?:--)/, /^(?:\.\.)/, /^(?::{1}[^:\n;]+)/, /^(?::{3})/, /^(?:-)/, /^(?:\.)/, /^(?:\+)/, /^(?::)/, /^(?:,)/, /^(?:#)/, /^(?:#)/, /^(?:%)/, /^(?:=)/, /^(?:=)/, /^(?:\w+)/, /^(?:\[)/, /^(?:\])/, /^(?:[!"#$%&'*+,-.`?\\/])/, /^(?:[0-9]+)/, /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, /^(?:\s)/, /^(?:\s)/, /^(?:$)/], conditions: { "namespace-body": { rules: [26, 33, 34, 35, 36, 37, 38, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], inclusive: !1 }, namespace: { rules: [26, 29, 30, 31, 32, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], inclusive: !1 }, "class-body": { rules: [26, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], inclusive: !1 }, class: { rules: [26, 39, 40, 41, 42, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], inclusive: !1 }, acc_descr_multiline: { rules: [11, 12, 26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], inclusive: !1 }, acc_descr: { rules: [9, 26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], inclusive: !1 }, acc_title: { rules: [7, 26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], inclusive: !1 }, callback_args: { rules: [22, 23, 26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], inclusive: !1 }, callback_name: { rules: [19, 20, 21, 26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], inclusive: !1 }, href: { rules: [26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], inclusive: !1 }, struct: { rules: [26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], inclusive: !1 }, generic: { rules: [26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], inclusive: !1 }, bqstring: { rules: [26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], inclusive: !1 }, string: { rules: [24, 25, 26, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 26, 27, 28, 29, 38, 49, 50, 51, 52, 53, 54, 55, 56, 57, 60, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97], inclusive: !0 } } }; return I; }(); Ne.lexer = qe; function ce() { this.yy = {}; } return f(ce, "Parser"), ce.prototype = Ne, Ne.Parser = ce, new ce();}();Ve.parser = Ve;var yt = Ve, We = ["#", "+", "~", "-", ""], G, je = (G = class { constructor(i, a) { this.memberType = a, this.visibility = "", this.classifier = "", this.text = ""; const u = pt(i, F()); this.parseMember(u); } getDisplayDetails() { let i = this.visibility + R(this.id); this.memberType === "method" && (i += `(${R(this.parameters.trim())})`, this.returnType && (i += " : " + R(this.returnType))), i = i.trim(); const a = this.parseClassifier(); return { displayText: i, cssStyle: a }; } parseMember(i) { let a = ""; if (this.memberType === "method") { const r = /([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(i); if (r) { const o = r[1] ? r[1].trim() : ""; if (We.includes(o) && (this.visibility = o), this.id = r[2], this.parameters = r[3] ? r[3].trim() : "", a = r[4] ? r[4].trim() : "", this.returnType = r[5] ? r[5].trim() : "", a === "") { const A = this.returnType.substring(this.returnType.length - 1); /[$*]/.exec(A) && (a = A, this.returnType = this.returnType.substring(0, this.returnType.length - 1)); } } } else { const l = i.length, r = i.substring(0, 1), o = i.substring(l - 1); We.includes(r) && (this.visibility = r), /[$*]/.exec(o) && (a = o), this.id = i.substring( this.visibility === "" ? 0 : 1, a === "" ? l : l - 1 ); } this.classifier = a, this.id = this.id.startsWith(" ") ? " " + this.id.trim() : this.id.trim(); const u = `${this.visibility ? "\\" + this.visibility : ""}${R(this.id)}${this.memberType === "method" ? `(${R(this.parameters)})${this.returnType ? " : " + R(this.returnType) : ""}` : ""}`; this.text = u.replaceAll("<", "<").replaceAll(">", ">"), this.text.startsWith("\\<") && (this.text = this.text.replace("\\<", "~")); } parseClassifier() { switch (this.classifier) { case "*": return "font-style:italic;"; case "$": return "text-decoration:underline;"; default: return ""; } }}, f(G, "ClassMember"), G), pe = "classId-", Xe = 0, V = /* @__PURE__ */ f((s) => v.sanitizeText(s, F()), "sanitizeText"), U, Tt = (U = class { constructor() { this.relations = [], this.classes = /* @__PURE__ */ new Map(), this.styleClasses = /* @__PURE__ */ new Map(), this.notes = [], this.interfaces = [], this.namespaces = /* @__PURE__ */ new Map(), this.namespaceCounter = 0, this.functions = [], this.lineType = { LINE: 0, DOTTED_LINE: 1 }, this.relationType = { AGGREGATION: 0, EXTENSION: 1, COMPOSITION: 2, DEPENDENCY: 3, LOLLIPOP: 4 }, this.setupToolTips = /* @__PURE__ */ f((i) => { let a = $(".mermaidTooltip"); (a._groups || a)[0][0] === null && (a = $("body").append("div").attr("class", "mermaidTooltip").style("opacity", 0)), $(i).select("svg").selectAll("g.node").on("mouseover", (r) => { const o = $(r.currentTarget); if (o.attr("title") === null) return; const g = this.getBoundingClientRect(); a.transition().duration(200).style("opacity", ".9"), a.text(o.attr("title")).style("left", window.scrollX + g.left + (g.right - g.left) / 2 + "px").style("top", window.scrollY + g.top - 14 + document.body.scrollTop + "px"), a.html(a.html().replace(/<br\/>/g, "<br/>")), o.classed("hover", !0); }).on("mouseout", (r) => { a.transition().duration(500).style("opacity", 0), $(r.currentTarget).classed("hover", !1); }); }, "setupToolTips"), this.direction = "TB", this.setAccTitle = nt, this.getAccTitle = rt, this.setAccDescription = ut, this.getAccDescription = lt, this.setDiagramTitle = ct, this.getDiagramTitle = ot, this.getConfig = /* @__PURE__ */ f(() => F().class, "getConfig"), this.functions.push(this.setupToolTips.bind(this)), this.clear(), this.addRelation = this.addRelation.bind(this), this.addClassesToNamespace = this.addClassesToNamespace.bind(this), this.addNamespace = this.addNamespace.bind(this), this.setCssClass = this.setCssClass.bind(this), this.addMembers = this.addMembers.bind(this), this.addClass = this.addClass.bind(this), this.setClassLabel = this.setClassLabel.bind(this), this.addAnnotation = this.addAnnotation.bind(this), this.addMember = this.addMember.bind(this), this.cleanupLabel = this.cleanupLabel.bind(this), this.addNote = this.addNote.bind(this), this.defineClass = this.defineClass.bind(this), this.setDirection = this.setDirection.bind(this), this.setLink = this.setLink.bind(this), this.bindFunctions = this.bindFunctions.bind(this), this.clear = this.clear.bind(this), this.setTooltip = this.setTooltip.bind(this), this.setClickEvent = this.setClickEvent.bind(this), this.setCssStyle = this.setCssStyle.bind(this); } splitClassNameAndType(i) { const a = v.sanitizeText(i, F()); let u = "", l = a; if (a.indexOf("~") > 0) { const r = a.split("~"); l = V(r[0]), u = V(r[1]); } return { className: l, type: u }; } setClassLabel(i, a) { const u = v.sanitizeText(i, F()); a && (a = V(a)); const { className: l } = this.splitClassNameAndType(u); this.classes.get(l).label = a, this.classes.get(l).text = `${a}${this.classes.get(l).type ? `<${this.classes.get(l).type}>` : ""}`; } /** * Function called by parser when a node definition has been found. * * @param id - ID of the class to add * @public */ addClass(i) { const a = v.sanitizeText(i, F()), { className: u, type: l } = this.splitClassNameAndType(a); if (this.classes.has(u)) return; const r = v.sanitizeText(u, F()); this.classes.set(r, { id: r, type: l, label: r, text: `${r}${l ? `<${l}>` : ""}`, shape: "classBox", cssClasses: "default", methods: [], members: [], annotations: [], styles: [], domId: pe + r + "-" + Xe }), Xe++; } addInterface(i, a) { const u = { id: `interface${this.interfaces.length}`, label: i, classId: a }; this.interfaces.push(u); } /** * Function to lookup domId from id in the graph definition. * * @param id - class ID to lookup * @public */ lookUpDomId(i) { const a = v.sanitizeText(i, F()); if (this.classes.has(a)) return this.classes.get(a).domId; throw new Error("Class not found: " + a); } clear() { this.relations = [], this.classes = /* @__PURE__ */ new Map(), this.notes = [], this.interfaces = [], this.functions = [], this.functions.push(this.setupToolTips.bind(this)), this.namespaces = /* @__PURE__ */ new Map(), this.namespaceCounter = 0, this.direction = "TB", ht(); } getClass(i) { return this.classes.get(i); } getClasses() { return this.classes; } getRelations() { return this.relations; } getNotes() { return this.notes; } addRelation(i) { Oe.debug("Adding relation: " + JSON.stringify(i)); const a = [ this.relationType.LOLLIPOP, this.relationType.AGGREGATION, this.relationType.COMPOSITION, this.relationType.DEPENDENCY, this.relationType.EXTENSION ]; i.relation.type1 === this.relationType.LOLLIPOP && !a.includes(i.relation.type2) ? (this.addClass(i.id2), this.addInterface(i.id1, i.id2), i.id1 = `interface${this.interfaces.length - 1}`) : i.relation.type2 === this.relationType.LOLLIPOP && !a.includes(i.relation.type1) ? (this.addClass(i.id1), this.addInterface(i.id2, i.id1), i.id2 = `interface${this.interfaces.length - 1}`) : (this.addClass(i.id1), this.addClass(i.id2)), i.id1 = this.splitClassNameAndType(i.id1).className, i.id2 = this.splitClassNameAndType(i.id2).className, i.relationTitle1 = v.sanitizeText( i.relationTitle1.trim(), F() ), i.relationTitle2 = v.sanitizeText( i.relationTitle2.trim(), F() ), this.relations.push(i); } /** * Adds an annotation to the specified class Annotations mark special properties of the given type * (like 'interface' or 'service') * * @param className - The class name * @param annotation - The name of the annotation without any brackets * @public */ addAnnotation(i, a) { const u = this.splitClassNameAndType(i).className; this.classes.get(u).annotations.push(a); } /** * Adds a member to the specified class * * @param className - The class name * @param member - The full name of the member. If the member is enclosed in `<<brackets>>` it is * treated as an annotation If the member is ending with a closing bracket ) it is treated as a * method Otherwise the member will be treated as a normal property * @public */ addMember(i, a) { this.addClass(i); const u = this.splitClassNameAndType(i).className, l = this.classes.get(u); if (typeof a == "string") { const r = a.trim(); r.startsWith("<<") && r.endsWith(">>") ? l.annotations.push(V(r.substring(2, r.length - 2))) : r.indexOf(")") > 0 ? l.methods.push(new je(r, "method")) : r && l.members.push(new je(r, "attribute")); } } addMembers(i, a) { Array.isArray(a) && (a.reverse(), a.forEach((u) => this.addMember(i, u))); } addNote(i, a) { const u = { id: `note${this.notes.length}`, class: a, text: i }; this.notes.push(u); } cleanupLabel(i) { return i.startsWith(":") && (i = i.substring(1)), V(i.trim()); } /** * Called by parser when assigning cssClass to a class * * @param ids - Comma separated list of ids * @param className - Class to add */ setCssClass(i, a) { i.split(",").forEach((u) => { let l = u; /\d/.exec(u[0]) && (l = pe + l); const r = this.classes.get(l); r && (r.cssClasses += " " + a); }); } defineClass(i, a) { for (const u of i) { let l = this.styleClasses.get(u); l === void 0 && (l = { id: u, styles: [], textStyles: [] }, this.styleClasses.set(u, l)), a && a.forEach((r) => { if (/color/.exec(r)) { const o = r.replace("fill", "bgFill"); l.textStyles.push(o); } l.styles.push(r); }), this.classes.forEach((r) => { r.cssClasses.includes(u) && r.styles.push(...a.flatMap((o) => o.split(","))); }); } } /** * Called by parser when a tooltip is found, e.g. a clickable element. * * @param ids - Comma separated list of ids * @param tooltip - Tooltip to add */ setTooltip(i, a) { i.split(",").forEach((u) => { a !== void 0 && (this.classes.get(u).tooltip = V(a)); }); } getTooltip(i, a) { return a && this.namespaces.has(a) ? this.namespaces.get(a).classes.get(i).tooltip : this.classes.get(i).tooltip; } /** * Called by parser when a link is found. Adds the URL to the vertex data. * * @param ids - Comma separated list of ids * @param linkStr - URL to create a link for * @param target - Target of the link, _blank by default as originally defined in the svgDraw.js file */ setLink(i, a, u) { const l = F(); i.split(",").forEach((r) => { let o = r; /\d/.exec(r[0]) && (o = pe + o); const A = this.classes.get(o); A && (A.link = we.formatUrl(a, l), l.securityLevel === "sandbox" ? A.linkTarget = "_top" : typeof u == "string" ? A.linkTarget = V(u) : A.linkTarget = "_blank"); }), this.setCssClass(i, "clickable"); } /** * Called by parser when a click definition is found. Registers an event handler. * * @param ids - Comma separated list of ids * @param functionName - Function to be called on click * @param functionArgs - Function args the function should be called with */ setClickEvent(i, a, u) { i.split(",").forEach((l) => { this.setClickFunc(l, a, u), this.classes.get(l).haveCallback = !0; }), this.setCssClass(i, "clickable"); } setClickFunc(i, a, u) { const l = v.sanitizeText(i, F()); if (F().securityLevel !== "loose" || a === void 0) return; const o = l; if (this.classes.has(o)) { const A = this.lookUpDomId(o); let g = []; if (typeof u == "string") { g = u.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/); for (let k = 0; k < g.length; k++) { let L = g[k].trim(); L.startsWith('"') && L.endsWith('"') && (L = L.substr(1, L.length - 2)), g[k] = L; } } g.length === 0 && g.push(A), this.functions.push(() => { const k = document.querySelector(`[id="${A}"]`); k !== null && k.addEventListener( "click", () => { we.runFunc(a, ...g); }, !1 ); }); } } bindFunctions(i) { this.functions.forEach((a) => { a(i); }); } getDirection() { return this.direction; } setDirection(i) { this.direction = i; } /** * Function called by parser when a namespace definition has been found. * * @param id - ID of the namespace to add * @public */ addNamespace(i) { this.namespaces.has(i) || (this.namespaces.set(i, { id: i, classes: /* @__PURE__ */ new Map(), children: {}, domId: pe + i + "-" + this.namespaceCounter }), this.namespaceCounter++); } getNamespace(i) { return this.namespaces.get(i); } getNamespaces() { return this.namespaces; } /** * Function called by parser when a namespace definition has been found. * * @param id - ID of the namespace to add * @param classNames - IDs of the class to add * @public */ addClassesToNamespace(i, a) { if (this.namespaces.has(i)) for (const u of a) { const { className: l } = this.splitClassNameAndType(u); this.classes.get(l).parent = i, this.namespaces.get(i).classes.set(l, this.classes.get(l)); } } setCssStyle(i, a) { const u = this.classes.get(i); if (!(!a || !u)) for (const l of a) l.includes(",") ? u.styles.push(...l.split(",")) : u.styles.push(l); } /** * Gets the arrow marker for a type index * * @param type - The type to look for * @returns The arrow marker */ getArrowMarker(i) { let a; switch (i) { case 0: a = "aggregation"; break; case 1: a = "extension"; break; case 2: a = "composition"; break; case 3: a = "dependency"; break; case 4: a = "lollipop"; break; default: a = "none"; } return a; } getData() { var r; const i = [], a = [], u = F(); for (const o of this.namespaces.keys()) { const A = this.namespaces.get(o); if (A) { const g = { id: A.id, label: A.id, isGroup: !0, padding: u.class.padding ?? 16, // parent node must be one of [rect, roundedWithTitle, noteGroup, divider] shape: "rect", cssStyles: ["fill: none", "stroke: black"], look: u.look }; i.push(g); } } for (const o of this.classes.keys()) { const A = this.classes.get(o); if (A) { const g = A; g.parentId = A.parent, g.look = u.look, i.push(g); } } let l = 0; for (const o of this.notes) { l++; const A = { id: o.id, label: o.text, isGroup: !1, shape: "note", padding: u.class.padding ?? 6, cssStyles: [ "text-align: left", "white-space: nowrap", `fill: ${u.themeVariables.noteBkgColor}`, `stroke: ${u.themeVariables.noteBorderColor}` ], look: u.look }; i.push(A); const g = ((r = this.classes.get(o.class)) == null ? void 0 : r.id) ?? ""; if (g) { const k = { id: `edgeNote${l}`, start: o.id, end: g, type: "normal", thickness: "normal", classes: "relation", arrowTypeStart: "none", arrowTypeEnd: "none", arrowheadStyle: "", labelStyle: [""], style: ["fill: none"], pattern: "dotted", look: u.look }; a.push(k); } } for (const o of this.interfaces) { const A = { id: o.id, label: o.label, isGroup: !1, shape: "rect", cssStyles: ["opacity: 0;"], look: u.look }; i.push(A); } l = 0; for (const o of this.relations) { l++; const A = { id: dt(o.id1, o.id2, { prefix: "id", counter: l }), start: o.id1, end: o.id2, type: "normal", label: o.title, labelpos: "c", thickness: "normal", classes: "relation", arrowTypeStart: this.getArrowMarker(o.relation.type1), arrowTypeEnd: this.getArrowMarker(o.relation.type2), startLabelRight: o.relationTitle1 === "none" ? "" : o.relationTitle1, endLabelLeft: o.relationTitle2 === "none" ? "" : o.relationTitle2, arrowheadStyle: "", labelStyle: ["display: inline-block"], style: o.style || "", pattern: o.relation.lineType == 1 ? "dashed" : "solid", look: u.look }; a.push(A); } return { nodes: i, edges: a, other: {}, config: u, direction: this.getDirection() }; }}, f(U, "ClassDB"), U), At = /* @__PURE__ */ f((s) => `g.classGroup text { fill: ${s.nodeBorder || s.classText}; stroke: none; font-family: ${s.fontFamily}; font-size: 10px;
.title { font-weight: bolder; }
}
.nodeLabel, .edgeLabel { color: ${s.classText};}.edgeLabel .label rect { fill: ${s.mainBkg};}.label text { fill: ${s.classText};}
.labelBkg { background: ${s.mainBkg};}.edgeLabel .label span { background: ${s.mainBkg};}
.classTitle { font-weight: bolder;}.node rect, .node circle, .node ellipse, .node polygon, .node path { fill: ${s.mainBkg}; stroke: ${s.nodeBorder}; stroke-width: 1px; }
.divider { stroke: ${s.nodeBorder}; stroke-width: 1;}
g.clickable { cursor: pointer;}
g.classGroup rect { fill: ${s.mainBkg}; stroke: ${s.nodeBorder};}
g.classGroup line { stroke: ${s.nodeBorder}; stroke-width: 1;}
.classLabel .box { stroke: none; stroke-width: 0; fill: ${s.mainBkg}; opacity: 0.5;}
.classLabel .label { fill: ${s.nodeBorder}; font-size: 10px;}
.relation { stroke: ${s.lineColor}; stroke-width: 1; fill: none;}
.dashed-line{ stroke-dasharray: 3;}
.dotted-line{ stroke-dasharray: 1 2;}
#compositionStart, .composition { fill: ${s.lineColor} !important; stroke: ${s.lineColor} !important; stroke-width: 1;}
#compositionEnd, .composition { fill: ${s.lineColor} !important; stroke: ${s.lineColor} !important; stroke-width: 1;}
#dependencyStart, .dependency { fill: ${s.lineColor} !important; stroke: ${s.lineColor} !important; stroke-width: 1;}
#dependencyStart, .dependency { fill: ${s.lineColor} !important; stroke: ${s.lineColor} !important; stroke-width: 1;}
#extensionStart, .extension { fill: transparent !important; stroke: ${s.lineColor} !important; stroke-width: 1;}
#extensionEnd, .extension { fill: transparent !important; stroke: ${s.lineColor} !important; stroke-width: 1;}
#aggregationStart, .aggregation { fill: transparent !important; stroke: ${s.lineColor} !important; stroke-width: 1;}
#aggregationEnd, .aggregation { fill: transparent !important; stroke: ${s.lineColor} !important; stroke-width: 1;}
#lollipopStart, .lollipop { fill: ${s.mainBkg} !important; stroke: ${s.lineColor} !important; stroke-width: 1;}
#lollipopEnd, .lollipop { fill: ${s.mainBkg} !important; stroke: ${s.lineColor} !important; stroke-width: 1;}
.edgeTerminals { font-size: 11px; line-height: initial;}
.classTitleText { text-anchor: middle; font-size: 18px; fill: ${s.textColor};} ${et()}`, "getStyles"), kt = At, ft = /* @__PURE__ */ f((s, i = "TB") => { if (!s.doc) return i; let a = i; for (const u of s.doc) u.stmt === "dir" && (a = u.value); return a;}, "getDir"), gt = /* @__PURE__ */ f(function(s, i) { return i.db.getClasses();}, "getClasses"), Ct = /* @__PURE__ */ f(async function(s, i, a, u) { Oe.info("REF0:"), Oe.info("Drawing class diagram (v3)", i); const { securityLevel: l, state: r, layout: o } = F(), A = u.db.getData(), g = tt(i, l); A.type = u.type, A.layoutAlgorithm = it(o), A.nodeSpacing = (r == null ? void 0 : r.nodeSpacing) || 50, A.rankSpacing = (r == null ? void 0 : r.rankSpacing) || 50, A.markers = ["aggregation", "extension", "composition", "dependency", "lollipop"], A.diagramId = i, await at(A, g); const k = 8; we.insertTitle( g, "classDiagramTitleText", (r == null ? void 0 : r.titleTopMargin) ?? 25, u.db.getDiagramTitle() ), st(g, k, "classDiagram", (r == null ? void 0 : r.useMaxWidth) ?? !0);}, "draw"), Dt = { getClasses: gt, draw: Ct, getDir: ft};export { Tt as C, yt as a, Dt as c, kt as s};12345678910111213141516import { s as r, c as s, a as e, C as t } from "./chunk-YQZZRAKN-BQvCB-Ut.js";import { _ as l } from "./mermaid.core-BiIw1_mh.js";var d = { parser: e, get db() { return new t(); }, renderer: s, styles: r, init: /* @__PURE__ */ l((a) => { a.class || (a.class = {}), a.class.arrowMarkerAbsolute = a.arrowMarkerAbsolute; }, "init")};export { d as diagram};12345678910111213141516import { s as r, c as s, a as e, C as t } from "./chunk-YQZZRAKN-BQvCB-Ut.js";import { _ as l } from "./mermaid.core-BiIw1_mh.js";var d = { parser: e, get db() { return new t(); }, renderer: s, styles: r, init: /* @__PURE__ */ l((a) => { a.class || (a.class = {}), a.class.arrowMarkerAbsolute = a.arrowMarkerAbsolute; }, "init")};export { d as diagram};12345678import { b as r } from "./_baseUniq-BzpV2HJ8.js";var e = 4;function a(o) { return r(o, e);}export { a as c};123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447import { _ as X, ar as F, as as Y, at as _, au as H, l as i, c as V, av as z, aw as U, ag as $, al as q, ah as P, af as K, ax as Q, ay as W, az as Z } from "./mermaid.core-BiIw1_mh.js";import { G as B } from "./graph-BH65arkC.js";import { l as I } from "./layout-GrosxRhM.js";import { i as x } from "./_baseUniq-BzpV2HJ8.js";import { c as L } from "./clone-CnKi__lm.js";import { m as A } from "./_basePickBy-DxXFlUZa.js";function p(e) { var t = { options: { directed: e.isDirected(), multigraph: e.isMultigraph(), compound: e.isCompound() }, nodes: ee(e), edges: ne(e) }; return x(e.graph()) || (t.value = L(e.graph())), t;}function ee(e) { return A(e.nodes(), function(t) { var n = e.node(t), o = e.parent(t), c = { v: t }; return x(n) || (c.value = n), x(o) || (c.parent = o), c; });}function ne(e) { return A(e.edges(), function(t) { var n = e.edge(t), o = { v: t.v, w: t.w }; return x(t.name) || (o.name = t.name), x(n) || (o.value = n), o; });}var f = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), J = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ X(() => { b.clear(), J.clear(), f.clear();}, "clear"), O = /* @__PURE__ */ X((e, t) => { const n = b.get(t) || []; return i.trace("In isDescendant", t, " ", e, " = ", n.includes(e)), n.includes(e);}, "isDescendant"), se = /* @__PURE__ */ X((e, t) => { const n = b.get(t) || []; return i.info("Descendants of ", t, " is ", n), i.info("Edge is ", e), e.v === t || e.w === t ? !1 : n ? n.includes(e.v) || O(e.v, t) || O(e.w, t) || n.includes(e.w) : (i.debug("Tilt, ", t, ",not in descendants"), !1);}, "edgeInCluster"), G = /* @__PURE__ */ X((e, t, n, o) => { i.warn( "Copying children of ", e, "root", o, "data", t.node(e), o ); const c = t.children(e) || []; e !== o && c.push(e), i.warn("Copying (nodes) clusterId", e, "nodes", c), c.forEach((a) => { if (t.children(a).length > 0) G(a, t, n, o); else { const r = t.node(a); i.info("cp ", a, " to ", o, " with parent ", e), n.setNode(a, r), o !== t.parent(a) && (i.warn("Setting parent", a, t.parent(a)), n.setParent(a, t.parent(a))), e !== o && a !== e ? (i.debug("Setting parent", a, e), n.setParent(a, e)) : (i.info("In copy ", e, "root", o, "data", t.node(e), o), i.debug( "Not Setting parent for node=", a, "cluster!==rootId", e !== o, "node!==clusterId", a !== e )); const u = t.edges(a); i.debug("Copying Edges", u), u.forEach((l) => { i.info("Edge", l); const v = t.edge(l.v, l.w, l.name); i.info("Edge data", v, o); try { se(l, o) ? (i.info("Copying as ", l.v, l.w, v, l.name), n.setEdge(l.v, l.w, v, l.name), i.info("newGraph edges ", n.edges(), n.edge(n.edges()[0]))) : i.info( "Skipping copy of edge ", l.v, "-->", l.w, " rootId: ", o, " clusterId:", e ); } catch (C) { i.error(C); } }); } i.debug("Removing node", a), t.removeNode(a); });}, "copy"), R = /* @__PURE__ */ X((e, t) => { const n = t.children(e); let o = [...n]; for (const c of n) J.set(c, e), o = [...o, ...R(c, t)]; return o;}, "extractDescendants"), ie = /* @__PURE__ */ X((e, t, n) => { const o = e.edges().filter((l) => l.v === t || l.w === t), c = e.edges().filter((l) => l.v === n || l.w === n), a = o.map((l) => ({ v: l.v === t ? n : l.v, w: l.w === t ? t : l.w })), r = c.map((l) => ({ v: l.v, w: l.w })); return a.filter((l) => r.some((v) => l.v === v.v && l.w === v.w));}, "findCommonEdges"), D = /* @__PURE__ */ X((e, t, n) => { const o = t.children(e); if (i.trace("Searching children of id ", e, o), o.length < 1) return e; let c; for (const a of o) { const r = D(a, t, n), u = ie(t, n, r); if (r) if (u.length > 0) c = r; else return r; } return c;}, "findNonClusterChild"), k = /* @__PURE__ */ X((e) => !f.has(e) || !f.get(e).externalConnections ? e : f.has(e) ? f.get(e).id : e, "getAnchorId"), re = /* @__PURE__ */ X((e, t) => { if (!e || t > 10) { i.debug("Opting out, no graph "); return; } else i.debug("Opting in, graph "); e.nodes().forEach(function(n) { e.children(n).length > 0 && (i.warn( "Cluster identified", n, " Replacement id in edges: ", D(n, e, n) ), b.set(n, R(n, e)), f.set(n, { id: D(n, e, n), clusterData: e.node(n) })); }), e.nodes().forEach(function(n) { const o = e.children(n), c = e.edges(); o.length > 0 ? (i.debug("Cluster identified", n, b), c.forEach((a) => { const r = O(a.v, n), u = O(a.w, n); r ^ u && (i.warn("Edge: ", a, " leaves cluster ", n), i.warn("Descendants of XXX ", n, ": ", b.get(n)), f.get(n).externalConnections = !0); })) : i.debug("Not a cluster ", n, b); }); for (let n of f.keys()) { const o = f.get(n).id, c = e.parent(o); c !== n && f.has(c) && !f.get(c).externalConnections && (f.get(n).id = c); } e.edges().forEach(function(n) { const o = e.edge(n); i.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(n)), i.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(e.edge(n))); let c = n.v, a = n.w; if (i.warn( "Fix XXX", f, "ids:", n.v, n.w, "Translating: ", f.get(n.v), " --- ", f.get(n.w) ), f.get(n.v) || f.get(n.w)) { if (i.warn("Fixing and trying - removing XXX", n.v, n.w, n.name), c = k(n.v), a = k(n.w), e.removeEdge(n.v, n.w, n.name), c !== n.v) { const r = e.parent(c); f.get(r).externalConnections = !0, o.fromCluster = n.v; } if (a !== n.w) { const r = e.parent(a); f.get(r).externalConnections = !0, o.toCluster = n.w; } i.warn("Fix Replacing with XXX", c, a, n.name), e.setEdge(c, a, o, n.name); } }), i.warn("Adjusted Graph", p(e)), T(e, 0), i.trace(f);}, "adjustClustersAndEdges"), T = /* @__PURE__ */ X((e, t) => { var c, a; if (i.warn("extractor - ", t, p(e), e.children("D")), t > 10) { i.error("Bailing out"); return; } let n = e.nodes(), o = !1; for (const r of n) { const u = e.children(r); o = o || u.length > 0; } if (!o) { i.debug("Done, no node has children", e.nodes()); return; } i.debug("Nodes = ", n, t); for (const r of n) if (i.debug( "Extracting node", r, f, f.has(r) && !f.get(r).externalConnections, !e.parent(r), e.node(r), e.children("D"), " Depth ", t ), !f.has(r)) i.debug("Not a cluster", r, t); else if (!f.get(r).externalConnections && e.children(r) && e.children(r).length > 0) { i.warn( "Cluster without external connections, without a parent and with children", r, t ); let l = e.graph().rankdir === "TB" ? "LR" : "TB"; (a = (c = f.get(r)) == null ? void 0 : c.clusterData) != null && a.dir && (l = f.get(r).clusterData.dir, i.warn("Fixing dir", f.get(r).clusterData.dir, l)); const v = new B({ multigraph: !0, compound: !0 }).setGraph({ rankdir: l, nodesep: 50, ranksep: 50, marginx: 8, marginy: 8 }).setDefaultEdgeLabel(function() { return {}; }); i.warn("Old graph before copy", p(e)), G(r, e, v, r), e.setNode(r, { clusterNode: !0, id: r, clusterData: f.get(r).clusterData, label: f.get(r).label, graph: v }), i.warn("New graph after copy node: (", r, ")", p(v)), i.debug("Old graph after copy", p(e)); } else i.warn( "Cluster ** ", r, " **not meeting the criteria !externalConnections:", !f.get(r).externalConnections, " no parent: ", !e.parent(r), " children ", e.children(r) && e.children(r).length > 0, e.children("D"), t ), i.debug(f); n = e.nodes(), i.warn("New list of nodes", n); for (const r of n) { const u = e.node(r); i.warn(" Now next level", r, u), u != null && u.clusterNode && T(u.graph, t + 1); }}, "extractor"), M = /* @__PURE__ */ X((e, t) => { if (t.length === 0) return []; let n = Object.assign([], t); return t.forEach((o) => { const c = e.children(o), a = M(e, c); n = [...n, ...a]; }), n;}, "sorter"), oe = /* @__PURE__ */ X((e) => M(e, e.children()), "sortNodesByHierarchy"), j = /* @__PURE__ */ X(async (e, t, n, o, c, a) => { i.warn("Graph in recursive render:XAX", p(t), c); const r = t.graph().rankdir; i.trace("Dir in recursive render - dir:", r); const u = e.insert("g").attr("class", "root"); t.nodes() ? i.info("Recursive render XXX", t.nodes()) : i.info("No nodes found for", t), t.edges().length > 0 && i.info("Recursive edges", t.edge(t.edges()[0])); const l = u.insert("g").attr("class", "clusters"), v = u.insert("g").attr("class", "edgePaths"), C = u.insert("g").attr("class", "edgeLabels"), g = u.insert("g").attr("class", "nodes"); await Promise.all( t.nodes().map(async function(d) { const s = t.node(d); if (c !== void 0) { const w = JSON.parse(JSON.stringify(c.clusterData)); i.trace( `Setting data for parent cluster XXX Node.id = `, d, ` data=`, w.height, `Parent cluster`, c.height ), t.setNode(c.id, w), t.parent(d) || (i.trace("Setting parent", d, c.id), t.setParent(d, c.id, w)); } if (i.info("(Insert) Node XXX" + d + ": " + JSON.stringify(t.node(d))), s != null && s.clusterNode) { i.info("Cluster identified XBX", d, s.width, t.node(d)); const { ranksep: w, nodesep: m } = t.graph(); s.graph.setGraph({ ...s.graph.graph(), ranksep: w + 25, nodesep: m }); const N = await j( g, s.graph, n, o, t.node(d), a ), S = N.elem; z(s, S), s.diff = N.diff || 0, i.info( "New compound node after recursive render XAX", d, "width", // node, s.width, "height", s.height // node.x, // node.y ), U(S, s); } else t.children(d).length > 0 ? (i.trace( "Cluster - the non recursive path XBX", d, s.id, s, s.width, "Graph:", t ), i.trace(D(s.id, t)), f.set(s.id, { id: D(s.id, t), node: s })) : (i.trace("Node - the non recursive path XAX", d, g, t.node(d), r), await $(g, t.node(d), { config: a, dir: r })); }) ), await (/* @__PURE__ */ X(async () => { const d = t.edges().map(async function(s) { const w = t.edge(s.v, s.w, s.name); i.info("Edge " + s.v + " -> " + s.w + ": " + JSON.stringify(s)), i.info("Edge " + s.v + " -> " + s.w + ": ", s, " ", JSON.stringify(t.edge(s))), i.info( "Fix", f, "ids:", s.v, s.w, "Translating: ", f.get(s.v), f.get(s.w) ), await Z(C, w); }); await Promise.all(d); }, "processEdges"))(), i.info("Graph before layout:", JSON.stringify(p(t))), i.info("############################################# XXX"), i.info("### Layout ### XXX"), i.info("############################################# XXX"), I(t), i.info("Graph after layout:", JSON.stringify(p(t))); let E = 0, { subGraphTitleTotalMargin: y } = q(a); return await Promise.all( oe(t).map(async function(d) { var w; const s = t.node(d); if (i.info( "Position XBX => " + d + ": (" + s.x, "," + s.y, ") width: ", s.width, " height: ", s.height ), s != null && s.clusterNode) s.y += y, i.info( "A tainted cluster node XBX1", d, s.id, s.width, s.height, s.x, s.y, t.parent(d) ), f.get(s.id).node = s, P(s); else if (t.children(d).length > 0) { i.info( "A pure cluster node XBX1", d, s.id, s.x, s.y, s.width, s.height, t.parent(d) ), s.height += y, t.node(s.parentId); const m = (s == null ? void 0 : s.padding) / 2 || 0, N = ((w = s == null ? void 0 : s.labelBBox) == null ? void 0 : w.height) || 0, S = N - m || 0; i.debug("OffsetY", S, "labelHeight", N, "halfPadding", m), await K(l, s), f.get(s.id).node = s; } else { const m = t.node(s.parentId); s.y += y / 2, i.info( "A regular node XBX1 - using the padding", s.id, "parent", s.parentId, s.width, s.height, s.x, s.y, "offsetY", s.offsetY, "parent", m, m == null ? void 0 : m.offsetY, s ), P(s); } }) ), t.edges().forEach(function(d) { const s = t.edge(d); i.info("Edge " + d.v + " -> " + d.w + ": " + JSON.stringify(s), s), s.points.forEach((S) => S.y += y / 2); const w = t.node(d.v); var m = t.node(d.w); const N = Q(v, s, f, n, w, m, o); W(s, N); }), t.nodes().forEach(function(d) { const s = t.node(d); i.info(d, s.type, s.diff), s.isGroup && (E = s.diff); }), i.warn("Returning from recursive render XAX", u, E), { elem: u, diff: E };}, "recursiveRender"), ge = /* @__PURE__ */ X(async (e, t) => { var a, r, u, l, v, C; const n = new B({ multigraph: !0, compound: !0 }).setGraph({ rankdir: e.direction, nodesep: ((a = e.config) == null ? void 0 : a.nodeSpacing) || ((u = (r = e.config) == null ? void 0 : r.flowchart) == null ? void 0 : u.nodeSpacing) || e.nodeSpacing, ranksep: ((l = e.config) == null ? void 0 : l.rankSpacing) || ((C = (v = e.config) == null ? void 0 : v.flowchart) == null ? void 0 : C.rankSpacing) || e.rankSpacing, marginx: 8, marginy: 8 }).setDefaultEdgeLabel(function() { return {}; }), o = t.select("g"); F(o, e.markers, e.type, e.diagramId), Y(), _(), H(), te(), e.nodes.forEach((g) => { n.setNode(g.id, { ...g }), g.parentId && n.setParent(g.id, g.parentId); }), i.debug("Edges:", e.edges), e.edges.forEach((g) => { if (g.start === g.end) { const h = g.start, E = h + "---" + h + "---1", y = h + "---" + h + "---2", d = n.node(h); n.setNode(E, { domId: E, id: E, parentId: d.parentId, labelStyle: "", label: "", padding: 0, shape: "labelRect", // shape: 'rect', style: "", width: 10, height: 10 }), n.setParent(E, d.parentId), n.setNode(y, { domId: y, id: y, parentId: d.parentId, labelStyle: "", padding: 0, // shape: 'rect', shape: "labelRect", label: "", style: "", width: 10, height: 10 }), n.setParent(y, d.parentId); const s = structuredClone(g), w = structuredClone(g), m = structuredClone(g); s.label = "", s.arrowTypeEnd = "none", s.id = h + "-cyclic-special-1", w.arrowTypeStart = "none", w.arrowTypeEnd = "none", w.id = h + "-cyclic-special-mid", m.label = "", d.isGroup && (s.fromCluster = h, m.toCluster = h), m.id = h + "-cyclic-special-2", m.arrowTypeStart = "none", n.setEdge(h, E, s, h + "-cyclic-special-0"), n.setEdge(E, y, w, h + "-cyclic-special-1"), n.setEdge(y, h, m, h + "-cyc<lic-special-2"); } else n.setEdge(g.start, g.end, { ...g }, g.id); }), i.warn("Graph at first:", JSON.stringify(p(n))), re(n), i.warn("Graph after XAX:", JSON.stringify(p(n))); const c = V(); await j( o, n, e.type, e.diagramId, void 0, c );}, "render");export { ge as render};123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137import { p as y } from "./chunk-44GW5IO5-Ohm2b7Vh.js";import { _ as i, s as B, g as S, q as F, p as z, a as E, b as P, D as w, H as W, e as D, y as T, E as _, F as A, l as x } from "./mermaid.core-BiIw1_mh.js";import { p as N } from "./radar-VG2SY3DT-DUR9h7DO.js";var m = { packet: []}, v = structuredClone(m), L = A.packet, Y = /* @__PURE__ */ i(() => { const t = w({ ...L, ..._().packet }); return t.showBits && (t.paddingY += 10), t;}, "getConfig"), H = /* @__PURE__ */ i(() => v.packet, "getPacket"), I = /* @__PURE__ */ i((t) => { t.length > 0 && v.packet.push(t);}, "pushWord"), M = /* @__PURE__ */ i(() => { T(), v = structuredClone(m);}, "clear"), u = { pushWord: I, getPacket: H, getConfig: Y, clear: M, setAccTitle: P, getAccTitle: E, setDiagramTitle: z, getDiagramTitle: F, getAccDescription: S, setAccDescription: B}, O = 1e4, q = /* @__PURE__ */ i((t) => { y(t, u); let e = -1, o = [], s = 1; const { bitsPerRow: n } = u.getConfig(); for (let { start: a, end: r, bits: c, label: f } of t.blocks) { if (a !== void 0 && r !== void 0 && r < a) throw new Error(`Packet block ${a} - ${r} is invalid. End must be greater than start.`); if (a ?? (a = e + 1), a !== e + 1) throw new Error( `Packet block ${a} - ${r ?? a} is not contiguous. It should start from ${e + 1}.` ); if (c === 0) throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`); for (r ?? (r = a + (c ?? 1) - 1), c ?? (c = r - a + 1), e = r, x.debug(`Packet block ${a} - ${e} with label ${f}`); o.length <= n + 1 && u.getPacket().length < O; ) { const [d, p] = G({ start: a, end: r, bits: c, label: f }, s, n); if (o.push(d), d.end + 1 === s * n && (u.pushWord(o), o = [], s++), !p) break; ({ start: a, end: r, bits: c, label: f } = p); } } u.pushWord(o);}, "populate"), G = /* @__PURE__ */ i((t, e, o) => { if (t.start === void 0) throw new Error("start should have been set during first phase"); if (t.end === void 0) throw new Error("end should have been set during first phase"); if (t.start > t.end) throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`); if (t.end + 1 <= e * o) return [t, void 0]; const s = e * o - 1, n = e * o; return [ { start: t.start, end: s, label: t.label, bits: s - t.start }, { start: n, end: t.end, label: t.label, bits: t.end - n } ];}, "getNextFittingBlock"), K = { parse: /* @__PURE__ */ i(async (t) => { const e = await N("packet", t); x.debug(e), q(e); }, "parse")}, R = /* @__PURE__ */ i((t, e, o, s) => { const n = s.db, a = n.getConfig(), { rowHeight: r, paddingY: c, bitWidth: f, bitsPerRow: d } = a, p = n.getPacket(), l = n.getDiagramTitle(), k = r + c, g = k * (p.length + 1) - (l ? 0 : r), b = f * d + 2, h = W(e); h.attr("viewbox", `0 0 ${b} ${g}`), D(h, g, b, a.useMaxWidth); for (const [C, $] of p.entries()) U(h, $, C, a); h.append("text").text(l).attr("x", b / 2).attr("y", g - k / 2).attr("dominant-baseline", "middle").attr("text-anchor", "middle").attr("class", "packetTitle");}, "draw"), U = /* @__PURE__ */ i((t, e, o, { rowHeight: s, paddingX: n, paddingY: a, bitWidth: r, bitsPerRow: c, showBits: f }) => { const d = t.append("g"), p = o * (s + a) + a; for (const l of e) { const k = l.start % c * r + 1, g = (l.end - l.start + 1) * r - n; if (d.append("rect").attr("x", k).attr("y", p).attr("width", g).attr("height", s).attr("class", "packetBlock"), d.append("text").attr("x", k + g / 2).attr("y", p + s / 2).attr("class", "packetLabel").attr("dominant-baseline", "middle").attr("text-anchor", "middle").text(l.label), !f) continue; const b = l.end === l.start, h = p - 2; d.append("text").attr("x", k + (b ? g / 2 : 0)).attr("y", h).attr("class", "packetByte start").attr("dominant-baseline", "auto").attr("text-anchor", b ? "middle" : "start").text(l.start), b || d.append("text").attr("x", k + g).attr("y", h).attr("class", "packetByte end").attr("dominant-baseline", "auto").attr("text-anchor", "end").text(l.end); }}, "drawWord"), X = { draw: R }, j = { byteFontSize: "10px", startByteColor: "black", endByteColor: "black", labelColor: "black", labelFontSize: "12px", titleColor: "black", titleFontSize: "14px", blockStrokeColor: "black", blockStrokeWidth: "1", blockFillColor: "#efefef"}, J = /* @__PURE__ */ i(({ packet: t } = {}) => { const e = w(j, t); return ` .packetByte { font-size: ${e.byteFontSize}; } .packetByte.start { fill: ${e.startByteColor}; } .packetByte.end { fill: ${e.endByteColor}; } .packetLabel { fill: ${e.labelColor}; font-size: ${e.labelFontSize}; } .packetTitle { fill: ${e.titleColor}; font-size: ${e.titleFontSize}; } .packetBlock { stroke: ${e.blockStrokeColor}; stroke-width: ${e.blockStrokeWidth}; fill: ${e.blockFillColor}; } `;}, "styles"), tt = { parser: K, db: u, renderer: X, styles: J};export { tt as diagram};123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221import { p as k } from "./chunk-44GW5IO5-Ohm2b7Vh.js";import { _ as l, s as R, g as E, q as F, p as I, a as _, b as D, H as G, y as P, D as f, E as C, F as z, l as H, K as V } from "./mermaid.core-BiIw1_mh.js";import { p as W } from "./radar-VG2SY3DT-DUR9h7DO.js";var x = { showLegend: !0, ticks: 5, max: null, min: 0, graticule: "circle"}, w = { axes: [], curves: [], options: x}, h = structuredClone(w), B = z.radar, j = /* @__PURE__ */ l(() => f({ ...B, ...C().radar}), "getConfig"), b = /* @__PURE__ */ l(() => h.axes, "getAxes"), q = /* @__PURE__ */ l(() => h.curves, "getCurves"), K = /* @__PURE__ */ l(() => h.options, "getOptions"), N = /* @__PURE__ */ l((a) => { h.axes = a.map((t) => ({ name: t.name, label: t.label ?? t.name }));}, "setAxes"), U = /* @__PURE__ */ l((a) => { h.curves = a.map((t) => ({ name: t.name, label: t.label ?? t.name, entries: X(t.entries) }));}, "setCurves"), X = /* @__PURE__ */ l((a) => { if (a[0].axis == null) return a.map((e) => e.value); const t = b(); if (t.length === 0) throw new Error("Axes must be populated before curves for reference entries"); return t.map((e) => { const r = a.find((s) => { var o; return ((o = s.axis) == null ? void 0 : o.$refText) === e.name; }); if (r === void 0) throw new Error("Missing entry for axis " + e.label); return r.value; });}, "computeCurveEntries"), Y = /* @__PURE__ */ l((a) => { var e, r, s, o, i; const t = a.reduce( (n, c) => (n[c.name] = c, n), {} ); h.options = { showLegend: ((e = t.showLegend) == null ? void 0 : e.value) ?? x.showLegend, ticks: ((r = t.ticks) == null ? void 0 : r.value) ?? x.ticks, max: ((s = t.max) == null ? void 0 : s.value) ?? x.max, min: ((o = t.min) == null ? void 0 : o.value) ?? x.min, graticule: ((i = t.graticule) == null ? void 0 : i.value) ?? x.graticule };}, "setOptions"), Z = /* @__PURE__ */ l(() => { P(), h = structuredClone(w);}, "clear"), $ = { getAxes: b, getCurves: q, getOptions: K, setAxes: N, setCurves: U, setOptions: Y, getConfig: j, clear: Z, setAccTitle: D, getAccTitle: _, setDiagramTitle: I, getDiagramTitle: F, getAccDescription: E, setAccDescription: R}, J = /* @__PURE__ */ l((a) => { k(a, $); const { axes: t, curves: e, options: r } = a; $.setAxes(t), $.setCurves(e), $.setOptions(r);}, "populate"), Q = { parse: /* @__PURE__ */ l(async (a) => { const t = await W("radar", a); H.debug(t), J(t); }, "parse")}, tt = /* @__PURE__ */ l((a, t, e, r) => { const s = r.db, o = s.getAxes(), i = s.getCurves(), n = s.getOptions(), c = s.getConfig(), d = s.getDiagramTitle(), p = G(t), u = et(p, c), g = n.max ?? Math.max(...i.map((y) => Math.max(...y.entries))), m = n.min, v = Math.min(c.width, c.height) / 2; at(u, o, v, n.ticks, n.graticule), rt(u, o, v, c), M(u, o, i, m, g, n.graticule, c), T(u, i, n.showLegend, c), u.append("text").attr("class", "radarTitle").text(d).attr("x", 0).attr("y", -c.height / 2 - c.marginTop);}, "draw"), et = /* @__PURE__ */ l((a, t) => { const e = t.width + t.marginLeft + t.marginRight, r = t.height + t.marginTop + t.marginBottom, s = { x: t.marginLeft + t.width / 2, y: t.marginTop + t.height / 2 }; return a.attr("viewbox", `0 0 ${e} ${r}`).attr("width", e).attr("height", r), a.append("g").attr("transform", `translate(${s.x}, ${s.y})`);}, "drawFrame"), at = /* @__PURE__ */ l((a, t, e, r, s) => { if (s === "circle") for (let o = 0; o < r; o++) { const i = e * (o + 1) / r; a.append("circle").attr("r", i).attr("class", "radarGraticule"); } else if (s === "polygon") { const o = t.length; for (let i = 0; i < r; i++) { const n = e * (i + 1) / r, c = t.map((d, p) => { const u = 2 * p * Math.PI / o - Math.PI / 2, g = n * Math.cos(u), m = n * Math.sin(u); return `${g},${m}`; }).join(" "); a.append("polygon").attr("points", c).attr("class", "radarGraticule"); } }}, "drawGraticule"), rt = /* @__PURE__ */ l((a, t, e, r) => { const s = t.length; for (let o = 0; o < s; o++) { const i = t[o].label, n = 2 * o * Math.PI / s - Math.PI / 2; a.append("line").attr("x1", 0).attr("y1", 0).attr("x2", e * r.axisScaleFactor * Math.cos(n)).attr("y2", e * r.axisScaleFactor * Math.sin(n)).attr("class", "radarAxisLine"), a.append("text").text(i).attr("x", e * r.axisLabelFactor * Math.cos(n)).attr("y", e * r.axisLabelFactor * Math.sin(n)).attr("class", "radarAxisLabel"); }}, "drawAxes");function M(a, t, e, r, s, o, i) { const n = t.length, c = Math.min(i.width, i.height) / 2; e.forEach((d, p) => { if (d.entries.length !== n) return; const u = d.entries.map((g, m) => { const v = 2 * Math.PI * m / n - Math.PI / 2, y = A(g, r, s, c), O = y * Math.cos(v), S = y * Math.sin(v); return { x: O, y: S }; }); o === "circle" ? a.append("path").attr("d", L(u, i.curveTension)).attr("class", `radarCurve-${p}`) : o === "polygon" && a.append("polygon").attr("points", u.map((g) => `${g.x},${g.y}`).join(" ")).attr("class", `radarCurve-${p}`); });}l(M, "drawCurves");function A(a, t, e, r) { const s = Math.min(Math.max(a, t), e); return r * (s - t) / (e - t);}l(A, "relativeRadius");function L(a, t) { const e = a.length; let r = `M${a[0].x},${a[0].y}`; for (let s = 0; s < e; s++) { const o = a[(s - 1 + e) % e], i = a[s], n = a[(s + 1) % e], c = a[(s + 2) % e], d = { x: i.x + (n.x - o.x) * t, y: i.y + (n.y - o.y) * t }, p = { x: n.x - (c.x - i.x) * t, y: n.y - (c.y - i.y) * t }; r += ` C${d.x},${d.y} ${p.x},${p.y} ${n.x},${n.y}`; } return `${r} Z`;}l(L, "closedRoundCurve");function T(a, t, e, r) { if (!e) return; const s = (r.width / 2 + r.marginRight) * 3 / 4, o = -(r.height / 2 + r.marginTop) * 3 / 4, i = 20; t.forEach((n, c) => { const d = a.append("g").attr("transform", `translate(${s}, ${o + c * i})`); d.append("rect").attr("width", 12).attr("height", 12).attr("class", `radarLegendBox-${c}`), d.append("text").attr("x", 16).attr("y", 0).attr("class", "radarLegendText").text(n.label); });}l(T, "drawLegend");var st = { draw: tt }, nt = /* @__PURE__ */ l((a, t) => { let e = ""; for (let r = 0; r < a.THEME_COLOR_LIMIT; r++) { const s = a[`cScale${r}`]; e += ` .radarCurve-${r} { color: ${s}; fill: ${s}; fill-opacity: ${t.curveOpacity}; stroke: ${s}; stroke-width: ${t.curveStrokeWidth}; } .radarLegendBox-${r} { fill: ${s}; fill-opacity: ${t.curveOpacity}; stroke: ${s}; } `; } return e;}, "genIndexStyles"), ot = /* @__PURE__ */ l((a) => { const t = V(), e = C(), r = f(t, e.themeVariables), s = f(r.radar, a); return { themeVariables: r, radarOptions: s };}, "buildRadarStyleOptions"), it = /* @__PURE__ */ l(({ radar: a } = {}) => { const { themeVariables: t, radarOptions: e } = ot(a); return ` .radarTitle { font-size: ${t.fontSize}; color: ${t.titleColor}; dominant-baseline: hanging; text-anchor: middle; } .radarAxisLine { stroke: ${e.axisColor}; stroke-width: ${e.axisStrokeWidth}; } .radarAxisLabel { dominant-baseline: middle; text-anchor: middle; font-size: ${e.axisLabelFontSize}px; color: ${e.axisColor}; } .radarGraticule { fill: ${e.graticuleColor}; fill-opacity: ${e.graticuleOpacity}; stroke: ${e.graticuleColor}; stroke-width: ${e.graticuleStrokeWidth}; } .radarLegendText { text-anchor: start; font-size: ${e.legendFontSize}px; dominant-baseline: hanging; } ${nt(t, e)} `;}, "styles"), ut = { parser: Q, db: $, renderer: st, styles: it};export { ut as diagram};123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841import { g as Dt, s as wt } from "./chunk-HPOVUXKZ-C_XOradn.js";import { _ as u, b as Vt, a as Lt, s as Mt, g as Bt, p as Ft, q as Yt, c as tt, l as D, y as Pt, x as zt, A as Gt, B as Kt, o as Zt, r as Ut, d as jt, u as Wt } from "./mermaid.core-BiIw1_mh.js";import { c as Qt } from "./channel-DjI12Op-.js";var dt = function() { var s = /* @__PURE__ */ u(function(R, n, a, c) { for (a = a || {}, c = R.length; c--; a[R[c]] = n) ; return a; }, "o"), i = [6, 8, 10, 22, 24, 26, 28, 33, 34, 35, 36, 37, 40, 43, 44, 50], h = [1, 10], d = [1, 11], o = [1, 12], l = [1, 13], f = [1, 20], _ = [1, 21], E = [1, 22], V = [1, 23], Z = [1, 24], S = [1, 19], et = [1, 25], U = [1, 26], T = [1, 18], L = [1, 33], st = [1, 34], it = [1, 35], rt = [1, 36], nt = [1, 37], pt = [6, 8, 10, 13, 15, 17, 20, 21, 22, 24, 26, 28, 33, 34, 35, 36, 37, 40, 43, 44, 50, 63, 64, 65, 66, 67], O = [1, 42], A = [1, 43], M = [1, 52], B = [40, 50, 68, 69], F = [1, 63], Y = [1, 61], N = [1, 58], P = [1, 62], z = [1, 64], j = [6, 8, 10, 13, 17, 22, 24, 26, 28, 33, 34, 35, 36, 37, 40, 41, 42, 43, 44, 48, 49, 50, 63, 64, 65, 66, 67], yt = [63, 64, 65, 66, 67], ft = [1, 81], _t = [1, 80], gt = [1, 78], bt = [1, 79], mt = [6, 10, 42, 47], v = [6, 10, 13, 41, 42, 47, 48, 49], W = [1, 89], Q = [1, 88], X = [1, 87], G = [19, 56], Et = [1, 98], kt = [1, 97], at = [19, 56, 58, 60], ct = { trace: /* @__PURE__ */ u(function() { }, "trace"), yy: {}, symbols_: { error: 2, start: 3, ER_DIAGRAM: 4, document: 5, EOF: 6, line: 7, SPACE: 8, statement: 9, NEWLINE: 10, entityName: 11, relSpec: 12, COLON: 13, role: 14, STYLE_SEPARATOR: 15, idList: 16, BLOCK_START: 17, attributes: 18, BLOCK_STOP: 19, SQS: 20, SQE: 21, title: 22, title_value: 23, acc_title: 24, acc_title_value: 25, acc_descr: 26, acc_descr_value: 27, acc_descr_multiline_value: 28, direction: 29, classDefStatement: 30, classStatement: 31, styleStatement: 32, direction_tb: 33, direction_bt: 34, direction_rl: 35, direction_lr: 36, CLASSDEF: 37, stylesOpt: 38, separator: 39, UNICODE_TEXT: 40, STYLE_TEXT: 41, COMMA: 42, CLASS: 43, STYLE: 44, style: 45, styleComponent: 46, SEMI: 47, NUM: 48, BRKT: 49, ENTITY_NAME: 50, attribute: 51, attributeType: 52, attributeName: 53, attributeKeyTypeList: 54, attributeComment: 55, ATTRIBUTE_WORD: 56, attributeKeyType: 57, ",": 58, ATTRIBUTE_KEY: 59, COMMENT: 60, cardinality: 61, relType: 62, ZERO_OR_ONE: 63, ZERO_OR_MORE: 64, ONE_OR_MORE: 65, ONLY_ONE: 66, MD_PARENT: 67, NON_IDENTIFYING: 68, IDENTIFYING: 69, WORD: 70, $accept: 0, $end: 1 }, terminals_: { 2: "error", 4: "ER_DIAGRAM", 6: "EOF", 8: "SPACE", 10: "NEWLINE", 13: "COLON", 15: "STYLE_SEPARATOR", 17: "BLOCK_START", 19: "BLOCK_STOP", 20: "SQS", 21: "SQE", 22: "title", 23: "title_value", 24: "acc_title", 25: "acc_title_value", 26: "acc_descr", 27: "acc_descr_value", 28: "acc_descr_multiline_value", 33: "direction_tb", 34: "direction_bt", 35: "direction_rl", 36: "direction_lr", 37: "CLASSDEF", 40: "UNICODE_TEXT", 41: "STYLE_TEXT", 42: "COMMA", 43: "CLASS", 44: "STYLE", 47: "SEMI", 48: "NUM", 49: "BRKT", 50: "ENTITY_NAME", 56: "ATTRIBUTE_WORD", 58: ",", 59: "ATTRIBUTE_KEY", 60: "COMMENT", 63: "ZERO_OR_ONE", 64: "ZERO_OR_MORE", 65: "ONE_OR_MORE", 66: "ONLY_ONE", 67: "MD_PARENT", 68: "NON_IDENTIFYING", 69: "IDENTIFYING", 70: "WORD" }, productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 5], [9, 9], [9, 7], [9, 7], [9, 4], [9, 6], [9, 3], [9, 5], [9, 1], [9, 3], [9, 7], [9, 9], [9, 6], [9, 8], [9, 4], [9, 6], [9, 2], [9, 2], [9, 2], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [29, 1], [29, 1], [29, 1], [29, 1], [30, 4], [16, 1], [16, 1], [16, 3], [16, 3], [31, 3], [32, 4], [38, 1], [38, 3], [45, 1], [45, 2], [39, 1], [39, 1], [39, 1], [46, 1], [46, 1], [46, 1], [46, 1], [11, 1], [11, 1], [18, 1], [18, 2], [51, 2], [51, 3], [51, 3], [51, 4], [52, 1], [53, 1], [54, 1], [54, 3], [57, 1], [55, 1], [12, 3], [61, 1], [61, 1], [61, 1], [61, 1], [61, 1], [62, 1], [62, 1], [14, 1], [14, 1], [14, 1]], performAction: /* @__PURE__ */ u(function(n, a, c, r, p, t, K) { var e = t.length - 1; switch (p) { case 1: break; case 2: this.$ = []; break; case 3: t[e - 1].push(t[e]), this.$ = t[e - 1]; break; case 4: case 5: this.$ = t[e]; break; case 6: case 7: this.$ = []; break; case 8: r.addEntity(t[e - 4]), r.addEntity(t[e - 2]), r.addRelationship(t[e - 4], t[e], t[e - 2], t[e - 3]); break; case 9: r.addEntity(t[e - 8]), r.addEntity(t[e - 4]), r.addRelationship(t[e - 8], t[e], t[e - 4], t[e - 5]), r.setClass([t[e - 8]], t[e - 6]), r.setClass([t[e - 4]], t[e - 2]); break; case 10: r.addEntity(t[e - 6]), r.addEntity(t[e - 2]), r.addRelationship(t[e - 6], t[e], t[e - 2], t[e - 3]), r.setClass([t[e - 6]], t[e - 4]); break; case 11: r.addEntity(t[e - 6]), r.addEntity(t[e - 4]), r.addRelationship(t[e - 6], t[e], t[e - 4], t[e - 5]), r.setClass([t[e - 4]], t[e - 2]); break; case 12: r.addEntity(t[e - 3]), r.addAttributes(t[e - 3], t[e - 1]); break; case 13: r.addEntity(t[e - 5]), r.addAttributes(t[e - 5], t[e - 1]), r.setClass([t[e - 5]], t[e - 3]); break; case 14: r.addEntity(t[e - 2]); break; case 15: r.addEntity(t[e - 4]), r.setClass([t[e - 4]], t[e - 2]); break; case 16: r.addEntity(t[e]); break; case 17: r.addEntity(t[e - 2]), r.setClass([t[e - 2]], t[e]); break; case 18: r.addEntity(t[e - 6], t[e - 4]), r.addAttributes(t[e - 6], t[e - 1]); break; case 19: r.addEntity(t[e - 8], t[e - 6]), r.addAttributes(t[e - 8], t[e - 1]), r.setClass([t[e - 8]], t[e - 3]); break; case 20: r.addEntity(t[e - 5], t[e - 3]); break; case 21: r.addEntity(t[e - 7], t[e - 5]), r.setClass([t[e - 7]], t[e - 2]); break; case 22: r.addEntity(t[e - 3], t[e - 1]); break; case 23: r.addEntity(t[e - 5], t[e - 3]), r.setClass([t[e - 5]], t[e]); break; case 24: case 25: this.$ = t[e].trim(), r.setAccTitle(this.$); break; case 26: case 27: this.$ = t[e].trim(), r.setAccDescription(this.$); break; case 32: r.setDirection("TB"); break; case 33: r.setDirection("BT"); break; case 34: r.setDirection("RL"); break; case 35: r.setDirection("LR"); break; case 36: this.$ = t[e - 3], r.addClass(t[e - 2], t[e - 1]); break; case 37: case 38: case 56: case 64: this.$ = [t[e]]; break; case 39: case 40: this.$ = t[e - 2].concat([t[e]]); break; case 41: this.$ = t[e - 2], r.setClass(t[e - 1], t[e]); break; case 42: this.$ = t[e - 3], r.addCssStyles(t[e - 2], t[e - 1]); break; case 43: this.$ = [t[e]]; break; case 44: t[e - 2].push(t[e]), this.$ = t[e - 2]; break; case 46: this.$ = t[e - 1] + t[e]; break; case 54: case 76: case 77: this.$ = t[e].replace(/"/g, ""); break; case 55: case 78: this.$ = t[e]; break; case 57: t[e].push(t[e - 1]), this.$ = t[e]; break; case 58: this.$ = { type: t[e - 1], name: t[e] }; break; case 59: this.$ = { type: t[e - 2], name: t[e - 1], keys: t[e] }; break; case 60: this.$ = { type: t[e - 2], name: t[e - 1], comment: t[e] }; break; case 61: this.$ = { type: t[e - 3], name: t[e - 2], keys: t[e - 1], comment: t[e] }; break; case 62: case 63: case 66: this.$ = t[e]; break; case 65: t[e - 2].push(t[e]), this.$ = t[e - 2]; break; case 67: this.$ = t[e].replace(/"/g, ""); break; case 68: this.$ = { cardA: t[e], relType: t[e - 1], cardB: t[e - 2] }; break; case 69: this.$ = r.Cardinality.ZERO_OR_ONE; break; case 70: this.$ = r.Cardinality.ZERO_OR_MORE; break; case 71: this.$ = r.Cardinality.ONE_OR_MORE; break; case 72: this.$ = r.Cardinality.ONLY_ONE; break; case 73: this.$ = r.Cardinality.MD_PARENT; break; case 74: this.$ = r.Identification.NON_IDENTIFYING; break; case 75: this.$ = r.Identification.IDENTIFYING; break; } }, "anonymous"), table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, s(i, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: 9, 22: h, 24: d, 26: o, 28: l, 29: 14, 30: 15, 31: 16, 32: 17, 33: f, 34: _, 35: E, 36: V, 37: Z, 40: S, 43: et, 44: U, 50: T }, s(i, [2, 7], { 1: [2, 1] }), s(i, [2, 3]), { 9: 27, 11: 9, 22: h, 24: d, 26: o, 28: l, 29: 14, 30: 15, 31: 16, 32: 17, 33: f, 34: _, 35: E, 36: V, 37: Z, 40: S, 43: et, 44: U, 50: T }, s(i, [2, 5]), s(i, [2, 6]), s(i, [2, 16], { 12: 28, 61: 32, 15: [1, 29], 17: [1, 30], 20: [1, 31], 63: L, 64: st, 65: it, 66: rt, 67: nt }), { 23: [1, 38] }, { 25: [1, 39] }, { 27: [1, 40] }, s(i, [2, 27]), s(i, [2, 28]), s(i, [2, 29]), s(i, [2, 30]), s(i, [2, 31]), s(pt, [2, 54]), s(pt, [2, 55]), s(i, [2, 32]), s(i, [2, 33]), s(i, [2, 34]), s(i, [2, 35]), { 16: 41, 40: O, 41: A }, { 16: 44, 40: O, 41: A }, { 16: 45, 40: O, 41: A }, s(i, [2, 4]), { 11: 46, 40: S, 50: T }, { 16: 47, 40: O, 41: A }, { 18: 48, 19: [1, 49], 51: 50, 52: 51, 56: M }, { 11: 53, 40: S, 50: T }, { 62: 54, 68: [1, 55], 69: [1, 56] }, s(B, [2, 69]), s(B, [2, 70]), s(B, [2, 71]), s(B, [2, 72]), s(B, [2, 73]), s(i, [2, 24]), s(i, [2, 25]), s(i, [2, 26]), { 13: F, 38: 57, 41: Y, 42: N, 45: 59, 46: 60, 48: P, 49: z }, s(j, [2, 37]), s(j, [2, 38]), { 16: 65, 40: O, 41: A, 42: N }, { 13: F, 38: 66, 41: Y, 42: N, 45: 59, 46: 60, 48: P, 49: z }, { 13: [1, 67], 15: [1, 68] }, s(i, [2, 17], { 61: 32, 12: 69, 17: [1, 70], 42: N, 63: L, 64: st, 65: it, 66: rt, 67: nt }), { 19: [1, 71] }, s(i, [2, 14]), { 18: 72, 19: [2, 56], 51: 50, 52: 51, 56: M }, { 53: 73, 56: [1, 74] }, { 56: [2, 62] }, { 21: [1, 75] }, { 61: 76, 63: L, 64: st, 65: it, 66: rt, 67: nt }, s(yt, [2, 74]), s(yt, [2, 75]), { 6: ft, 10: _t, 39: 77, 42: gt, 47: bt }, { 40: [1, 82], 41: [1, 83] }, s(mt, [2, 43], { 46: 84, 13: F, 41: Y, 48: P, 49: z }), s(v, [2, 45]), s(v, [2, 50]), s(v, [2, 51]), s(v, [2, 52]), s(v, [2, 53]), s(i, [2, 41], { 42: N }), { 6: ft, 10: _t, 39: 85, 42: gt, 47: bt }, { 14: 86, 40: W, 50: Q, 70: X }, { 16: 90, 40: O, 41: A }, { 11: 91, 40: S, 50: T }, { 18: 92, 19: [1, 93], 51: 50, 52: 51, 56: M }, s(i, [2, 12]), { 19: [2, 57] }, s(G, [2, 58], { 54: 94, 55: 95, 57: 96, 59: Et, 60: kt }), s([19, 56, 59, 60], [2, 63]), s(i, [2, 22], { 15: [1, 100], 17: [1, 99] }), s([40, 50], [2, 68]), s(i, [2, 36]), { 13: F, 41: Y, 45: 101, 46: 60, 48: P, 49: z }, s(i, [2, 47]), s(i, [2, 48]), s(i, [2, 49]), s(j, [2, 39]), s(j, [2, 40]), s(v, [2, 46]), s(i, [2, 42]), s(i, [2, 8]), s(i, [2, 76]), s(i, [2, 77]), s(i, [2, 78]), { 13: [1, 102], 42: N }, { 13: [1, 104], 15: [1, 103] }, { 19: [1, 105] }, s(i, [2, 15]), s(G, [2, 59], { 55: 106, 58: [1, 107], 60: kt }), s(G, [2, 60]), s(at, [2, 64]), s(G, [2, 67]), s(at, [2, 66]), { 18: 108, 19: [1, 109], 51: 50, 52: 51, 56: M }, { 16: 110, 40: O, 41: A }, s(mt, [2, 44], { 46: 84, 13: F, 41: Y, 48: P, 49: z }), { 14: 111, 40: W, 50: Q, 70: X }, { 16: 112, 40: O, 41: A }, { 14: 113, 40: W, 50: Q, 70: X }, s(i, [2, 13]), s(G, [2, 61]), { 57: 114, 59: Et }, { 19: [1, 115] }, s(i, [2, 20]), s(i, [2, 23], { 17: [1, 116], 42: N }), s(i, [2, 11]), { 13: [1, 117], 42: N }, s(i, [2, 10]), s(at, [2, 65]), s(i, [2, 18]), { 18: 118, 19: [1, 119], 51: 50, 52: 51, 56: M }, { 14: 120, 40: W, 50: Q, 70: X }, { 19: [1, 121] }, s(i, [2, 21]), s(i, [2, 9]), s(i, [2, 19])], defaultActions: { 52: [2, 62], 72: [2, 57] }, parseError: /* @__PURE__ */ u(function(n, a) { if (a.recoverable) this.trace(n); else { var c = new Error(n); throw c.hash = a, c; } }, "parseError"), parse: /* @__PURE__ */ u(function(n) { var a = this, c = [0], r = [], p = [null], t = [], K = this.table, e = "", H = 0, St = 0, xt = 2, Tt = 1, It = t.slice.call(arguments, 1), y = Object.create(this.lexer), x = { yy: {} }; for (var lt in this.yy) Object.prototype.hasOwnProperty.call(this.yy, lt) && (x.yy[lt] = this.yy[lt]); y.setInput(n, x.yy), x.yy.lexer = y, x.yy.parser = this, typeof y.yylloc > "u" && (y.yylloc = {}); var ot = y.yylloc; t.push(ot); var vt = y.options && y.options.ranges; typeof x.yy.parseError == "function" ? this.parseError = x.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError; function Ct(b) { c.length = c.length - 2 * b, p.length = p.length - b, t.length = t.length - b; } u(Ct, "popStack"); function Ot() { var b; return b = r.pop() || y.lex() || Tt, typeof b != "number" && (b instanceof Array && (r = b, b = r.pop()), b = a.symbols_[b] || b), b; } u(Ot, "lex"); for (var g, I, m, ht, C = {}, J, k, At, $; ; ) { if (I = c[c.length - 1], this.defaultActions[I] ? m = this.defaultActions[I] : ((g === null || typeof g > "u") && (g = Ot()), m = K[I] && K[I][g]), typeof m > "u" || !m.length || !m[0]) { var ut = ""; $ = []; for (J in K[I]) this.terminals_[J] && J > xt && $.push("'" + this.terminals_[J] + "'"); y.showPosition ? ut = "Parse error on line " + (H + 1) + `:` + y.showPosition() + `Expecting ` + $.join(", ") + ", got '" + (this.terminals_[g] || g) + "'" : ut = "Parse error on line " + (H + 1) + ": Unexpected " + (g == Tt ? "end of input" : "'" + (this.terminals_[g] || g) + "'"), this.parseError(ut, { text: y.match, token: this.terminals_[g] || g, line: y.yylineno, loc: ot, expected: $ }); } if (m[0] instanceof Array && m.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + I + ", token: " + g); switch (m[0]) { case 1: c.push(g), p.push(y.yytext), t.push(y.yylloc), c.push(m[1]), g = null, St = y.yyleng, e = y.yytext, H = y.yylineno, ot = y.yylloc; break; case 2: if (k = this.productions_[m[1]][1], C.$ = p[p.length - k], C._$ = { first_line: t[t.length - (k || 1)].first_line, last_line: t[t.length - 1].last_line, first_column: t[t.length - (k || 1)].first_column, last_column: t[t.length - 1].last_column }, vt && (C._$.range = [ t[t.length - (k || 1)].range[0], t[t.length - 1].range[1] ]), ht = this.performAction.apply(C, [ e, St, H, x.yy, m[1], p, t ].concat(It)), typeof ht < "u") return ht; k && (c = c.slice(0, -1 * k * 2), p = p.slice(0, -1 * k), t = t.slice(0, -1 * k)), c.push(this.productions_[m[1]][0]), p.push(C.$), t.push(C._$), At = K[c[c.length - 2]][c[c.length - 1]], c.push(At); break; case 3: return !0; } } return !0; }, "parse") }, Rt = /* @__PURE__ */ function() { var R = { EOF: 1, parseError: /* @__PURE__ */ u(function(a, c) { if (this.yy.parser) this.yy.parser.parseError(a, c); else throw new Error(a); }, "parseError"), // resets the lexer, sets new input setInput: /* @__PURE__ */ u(function(n, a) { return this.yy = a || this.yy || {}, this._input = n, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this; }, "setInput"), // consumes and returns one char from the input input: /* @__PURE__ */ u(function() { var n = this._input[0]; this.yytext += n, this.yyleng++, this.offset++, this.match += n, this.matched += n; var a = n.match(/(?:\r\n?|\n).*/g); return a ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), n; }, "input"), // unshifts one char (or a string) into the input unput: /* @__PURE__ */ u(function(n) { var a = n.length, c = n.split(/(?:\r\n?|\n)/g); this._input = n + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - a), this.offset -= a; var r = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), c.length - 1 && (this.yylineno -= c.length - 1); var p = this.yylloc.range; return this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: c ? (c.length === r.length ? this.yylloc.first_column : 0) + r[r.length - c.length].length - c[0].length : this.yylloc.first_column - a }, this.options.ranges && (this.yylloc.range = [p[0], p[0] + this.yyleng - a]), this.yyleng = this.yytext.length, this; }, "unput"), // When called from action, caches matched text and appends it on next action more: /* @__PURE__ */ u(function() { return this._more = !0, this; }, "more"), // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject: /* @__PURE__ */ u(function() { if (this.options.backtrack_lexer) this._backtrack = !0; else return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).` + this.showPosition(), { text: "", token: null, line: this.yylineno }); return this; }, "reject"), // retain first n characters of the match less: /* @__PURE__ */ u(function(n) { this.unput(this.match.slice(n)); }, "less"), // displays already matched input, i.e. for error messages pastInput: /* @__PURE__ */ u(function() { var n = this.matched.substr(0, this.matched.length - this.match.length); return (n.length > 20 ? "..." : "") + n.substr(-20).replace(/\n/g, ""); }, "pastInput"), // displays upcoming input, i.e. for error messages upcomingInput: /* @__PURE__ */ u(function() { var n = this.match; return n.length < 20 && (n += this._input.substr(0, 20 - n.length)), (n.substr(0, 20) + (n.length > 20 ? "..." : "")).replace(/\n/g, ""); }, "upcomingInput"), // displays the character position where the lexing error occurred, i.e. for error messages showPosition: /* @__PURE__ */ u(function() { var n = this.pastInput(), a = new Array(n.length + 1).join("-"); return n + this.upcomingInput() + `` + a + "^"; }, "showPosition"), // test the lexed token: return FALSE when not a match, otherwise return token test_match: /* @__PURE__ */ u(function(n, a) { var c, r, p; if (this.options.backtrack_lexer && (p = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }, this.options.ranges && (p.yylloc.range = this.yylloc.range.slice(0))), r = n[0].match(/(?:\r\n?|\n).*/g), r && (this.yylineno += r.length), this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: r ? r[r.length - 1].length - r[r.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + n[0].length }, this.yytext += n[0], this.match += n[0], this.matches = n, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(n[0].length), this.matched += n[0], c = this.performAction.call(this, this.yy, this, a, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), c) return c; if (this._backtrack) { for (var t in p) this[t] = p[t]; return !1; } return !1; }, "test_match"), // return next match in input next: /* @__PURE__ */ u(function() { if (this.done) return this.EOF; this._input || (this.done = !0); var n, a, c, r; this._more || (this.yytext = "", this.match = ""); for (var p = this._currentRules(), t = 0; t < p.length; t++) if (c = this._input.match(this.rules[p[t]]), c && (!a || c[0].length > a[0].length)) { if (a = c, r = t, this.options.backtrack_lexer) { if (n = this.test_match(c, p[t]), n !== !1) return n; if (this._backtrack) { a = !1; continue; } else return !1; } else if (!this.options.flex) break; } return a ? (n = this.test_match(a, p[r]), n !== !1 ? n : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.` + this.showPosition(), { text: "", token: null, line: this.yylineno }); }, "next"), // return next match that has a token lex: /* @__PURE__ */ u(function() { var a = this.next(); return a || this.lex(); }, "lex"), // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin: /* @__PURE__ */ u(function(a) { this.conditionStack.push(a); }, "begin"), // pop the previously active lexer condition state off the condition stack popState: /* @__PURE__ */ u(function() { var a = this.conditionStack.length - 1; return a > 0 ? this.conditionStack.pop() : this.conditionStack[0]; }, "popState"), // produce the lexer rule set which is active for the currently active lexer condition state _currentRules: /* @__PURE__ */ u(function() { return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules; }, "_currentRules"), // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState: /* @__PURE__ */ u(function(a) { return a = this.conditionStack.length - 1 - Math.abs(a || 0), a >= 0 ? this.conditionStack[a] : "INITIAL"; }, "topState"), // alias for begin(condition) pushState: /* @__PURE__ */ u(function(a) { this.begin(a); }, "pushState"), // return the number of states currently on the stack stateStackSize: /* @__PURE__ */ u(function() { return this.conditionStack.length; }, "stateStackSize"), options: { "case-insensitive": !0 }, performAction: /* @__PURE__ */ u(function(a, c, r, p) { switch (r) { case 0: return this.begin("acc_title"), 24; case 1: return this.popState(), "acc_title_value"; case 2: return this.begin("acc_descr"), 26; case 3: return this.popState(), "acc_descr_value"; case 4: this.begin("acc_descr_multiline"); break; case 5: this.popState(); break; case 6: return "acc_descr_multiline_value"; case 7: return 33; case 8: return 34; case 9: return 35; case 10: return 36; case 11: return 10; case 12: break; case 13: return 8; case 14: return 50; case 15: return 70; case 16: return 4; case 17: return this.begin("block"), 17; case 18: return 49; case 19: return 49; case 20: return 42; case 21: return 15; case 22: return 13; case 23: break; case 24: return 59; case 25: return 56; case 26: return 56; case 27: return 60; case 28: break; case 29: return this.popState(), 19; case 30: return c.yytext[0]; case 31: return 20; case 32: return 21; case 33: return this.begin("style"), 44; case 34: return this.popState(), 10; case 35: break; case 36: return 13; case 37: return 42; case 38: return 49; case 39: return this.begin("style"), 37; case 40: return 43; case 41: return 63; case 42: return 65; case 43: return 65; case 44: return 65; case 45: return 63; case 46: return 63; case 47: return 64; case 48: return 64; case 49: return 64; case 50: return 64; case 51: return 64; case 52: return 65; case 53: return 64; case 54: return 65; case 55: return 66; case 56: return 66; case 57: return 66; case 58: return 66; case 59: return 63; case 60: return 64; case 61: return 65; case 62: return 67; case 63: return 68; case 64: return 69; case 65: return 69; case 66: return 68; case 67: return 68; case 68: return 68; case 69: return 41; case 70: return 47; case 71: return 40; case 72: return 48; case 73: return c.yytext[0]; case 74: return 6; } }, "anonymous"), rules: [/^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:[\s]+)/i, /^(?:"[^"%\r\n\v\b\\]+")/i, /^(?:"[^"]*")/i, /^(?:erDiagram\b)/i, /^(?:\{)/i, /^(?:#)/i, /^(?:#)/i, /^(?:,)/i, /^(?::::)/i, /^(?::)/i, /^(?:\s+)/i, /^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i, /^(?:([^\s]*)[~].*[~]([^\s]*))/i, /^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\u00C0-\uFFFF\*]*))/i, /^(?:"[^"]*")/i, /^(?:[\n]+)/i, /^(?:\})/i, /^(?:.)/i, /^(?:\[)/i, /^(?:\])/i, /^(?:style\b)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?::)/i, /^(?:,)/i, /^(?:#)/i, /^(?:classDef\b)/i, /^(?:class\b)/i, /^(?:one or zero\b)/i, /^(?:one or more\b)/i, /^(?:one or many\b)/i, /^(?:1\+)/i, /^(?:\|o\b)/i, /^(?:zero or one\b)/i, /^(?:zero or more\b)/i, /^(?:zero or many\b)/i, /^(?:0\+)/i, /^(?:\}o\b)/i, /^(?:many\(0\))/i, /^(?:many\(1\))/i, /^(?:many\b)/i, /^(?:\}\|)/i, /^(?:one\b)/i, /^(?:only one\b)/i, /^(?:1\b)/i, /^(?:\|\|)/i, /^(?:o\|)/i, /^(?:o\{)/i, /^(?:\|\{)/i, /^(?:\s*u\b)/i, /^(?:\.\.)/i, /^(?:--)/i, /^(?:to\b)/i, /^(?:optionally to\b)/i, /^(?:\.-)/i, /^(?:-\.)/i, /^(?:([^\x00-\x7F]|\w|-|\*)+)/i, /^(?:;)/i, /^(?:([^\x00-\x7F]|\w|-|\*)+)/i, /^(?:[0-9])/i, /^(?:.)/i, /^(?:$)/i], conditions: { style: { rules: [34, 35, 36, 37, 38, 69, 70], inclusive: !1 }, acc_descr_multiline: { rules: [5, 6], inclusive: !1 }, acc_descr: { rules: [3], inclusive: !1 }, acc_title: { rules: [1], inclusive: !1 }, block: { rules: [23, 24, 25, 26, 27, 28, 29, 30], inclusive: !1 }, INITIAL: { rules: [0, 2, 4, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 31, 32, 33, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 71, 72, 73, 74], inclusive: !0 } } }; return R; }(); ct.lexer = Rt; function q() { this.yy = {}; } return u(q, "Parser"), q.prototype = ct, ct.Parser = q, new q();}();dt.parser = dt;var Xt = dt, w, qt = (w = class { constructor() { this.entities = /* @__PURE__ */ new Map(), this.relationships = [], this.classes = /* @__PURE__ */ new Map(), this.direction = "TB", this.Cardinality = { ZERO_OR_ONE: "ZERO_OR_ONE", ZERO_OR_MORE: "ZERO_OR_MORE", ONE_OR_MORE: "ONE_OR_MORE", ONLY_ONE: "ONLY_ONE", MD_PARENT: "MD_PARENT" }, this.Identification = { NON_IDENTIFYING: "NON_IDENTIFYING", IDENTIFYING: "IDENTIFYING" }, this.setAccTitle = Vt, this.getAccTitle = Lt, this.setAccDescription = Mt, this.getAccDescription = Bt, this.setDiagramTitle = Ft, this.getDiagramTitle = Yt, this.getConfig = /* @__PURE__ */ u(() => tt().er, "getConfig"), this.clear(), this.addEntity = this.addEntity.bind(this), this.addAttributes = this.addAttributes.bind(this), this.addRelationship = this.addRelationship.bind(this), this.setDirection = this.setDirection.bind(this), this.addCssStyles = this.addCssStyles.bind(this), this.addClass = this.addClass.bind(this), this.setClass = this.setClass.bind(this), this.setAccTitle = this.setAccTitle.bind(this), this.setAccDescription = this.setAccDescription.bind(this); } /** * Add entity * @param name - The name of the entity * @param alias - The alias of the entity */ addEntity(i, h = "") { var d; return this.entities.has(i) ? !((d = this.entities.get(i)) != null && d.alias) && h && (this.entities.get(i).alias = h, D.info(`Add alias '${h}' to entity '${i}'`)) : (this.entities.set(i, { id: `entity-${i}-${this.entities.size}`, label: i, attributes: [], alias: h, shape: "erBox", look: tt().look ?? "default", cssClasses: "default", cssStyles: [] }), D.info("Added new entity :", i)), this.entities.get(i); } getEntity(i) { return this.entities.get(i); } getEntities() { return this.entities; } getClasses() { return this.classes; } addAttributes(i, h) { const d = this.addEntity(i); let o; for (o = h.length - 1; o >= 0; o--) h[o].keys || (h[o].keys = []), h[o].comment || (h[o].comment = ""), d.attributes.push(h[o]), D.debug("Added attribute ", h[o].name); } /** * Add a relationship * * @param entA - The first entity in the relationship * @param rolA - The role played by the first entity in relation to the second * @param entB - The second entity in the relationship * @param rSpec - The details of the relationship between the two entities */ addRelationship(i, h, d, o) { const l = this.entities.get(i), f = this.entities.get(d); if (!l || !f) return; const _ = { entityA: l.id, roleA: h, entityB: f.id, relSpec: o }; this.relationships.push(_), D.debug("Added new relationship :", _); } getRelationships() { return this.relationships; } getDirection() { return this.direction; } setDirection(i) { this.direction = i; } getCompiledStyles(i) { let h = []; for (const d of i) { const o = this.classes.get(d); o != null && o.styles && (h = [...h, ...o.styles ?? []].map((l) => l.trim())), o != null && o.textStyles && (h = [...h, ...o.textStyles ?? []].map((l) => l.trim())); } return h; } addCssStyles(i, h) { for (const d of i) { const o = this.entities.get(d); if (!h || !o) return; for (const l of h) o.cssStyles.push(l); } } addClass(i, h) { i.forEach((d) => { let o = this.classes.get(d); o === void 0 && (o = { id: d, styles: [], textStyles: [] }, this.classes.set(d, o)), h && h.forEach(function(l) { if (/color/.exec(l)) { const f = l.replace("fill", "bgFill"); o.textStyles.push(f); } o.styles.push(l); }); }); } setClass(i, h) { for (const d of i) { const o = this.entities.get(d); if (o) for (const l of h) o.cssClasses += " " + l; } } clear() { this.entities = /* @__PURE__ */ new Map(), this.classes = /* @__PURE__ */ new Map(), this.relationships = [], Pt(); } getData() { const i = [], h = [], d = tt(); for (const l of this.entities.keys()) { const f = this.entities.get(l); f && (f.cssCompiledStyles = this.getCompiledStyles(f.cssClasses.split(" ")), i.push(f)); } let o = 0; for (const l of this.relationships) { const f = { id: zt(l.entityA, l.entityB, { prefix: "id", counter: o++ }), type: "normal", curve: "basis", start: l.entityA, end: l.entityB, label: l.roleA, labelpos: "c", thickness: "normal", classes: "relationshipLine", arrowTypeStart: l.relSpec.cardB.toLowerCase(), arrowTypeEnd: l.relSpec.cardA.toLowerCase(), pattern: l.relSpec.relType == "IDENTIFYING" ? "solid" : "dashed", look: d.look }; h.push(f); } return { nodes: i, edges: h, other: {}, config: d, direction: "TB" }; }}, u(w, "ErDB"), w), Nt = {};Kt(Nt, { draw: () => Ht});var Ht = /* @__PURE__ */ u(async function(s, i, h, d) { D.info("REF0:"), D.info("Drawing er diagram (unified)", i); const { securityLevel: o, er: l, layout: f } = tt(), _ = d.db.getData(), E = Dt(i, o); _.type = d.type, _.layoutAlgorithm = Zt(f), _.config.flowchart.nodeSpacing = (l == null ? void 0 : l.nodeSpacing) || 140, _.config.flowchart.rankSpacing = (l == null ? void 0 : l.rankSpacing) || 80, _.direction = d.db.getDirection(), _.markers = ["only_one", "zero_or_one", "one_or_more", "zero_or_more"], _.diagramId = i, await Ut(_, E), _.layoutAlgorithm === "elk" && E.select(".edges").lower(); const V = E.selectAll('[id*="-background"]'); Array.from(V).length > 0 && V.each(function() { const S = jt(this), U = S.attr("id").replace("-background", ""), T = E.select(`#${CSS.escape(U)}`); if (!T.empty()) { const L = T.attr("transform"); S.attr("transform", L); } }); const Z = 8; Wt.insertTitle( E, "erDiagramTitleText", (l == null ? void 0 : l.titleTopMargin) ?? 25, d.db.getDiagramTitle() ), wt(E, Z, "erDiagram", (l == null ? void 0 : l.useMaxWidth) ?? !0);}, "draw"), Jt = /* @__PURE__ */ u((s, i) => { const h = Qt, d = h(s, "r"), o = h(s, "g"), l = h(s, "b"); return Gt(d, o, l, i);}, "fade"), $t = /* @__PURE__ */ u((s) => ` .entityBox { fill: ${s.mainBkg}; stroke: ${s.nodeBorder}; }
.relationshipLabelBox { fill: ${s.tertiaryColor}; opacity: 0.7; background-color: ${s.tertiaryColor}; rect { opacity: 0.5; } }
.labelBkg { background-color: ${Jt(s.tertiaryColor, 0.5)}; }
.edgeLabel .label { fill: ${s.nodeBorder}; font-size: 14px; }
.label { font-family: ${s.fontFamily}; color: ${s.nodeTextColor || s.textColor}; }
.edge-pattern-dashed { stroke-dasharray: 8,8; }
.node rect, .node circle, .node ellipse, .node polygon { fill: ${s.mainBkg}; stroke: ${s.nodeBorder}; stroke-width: 1px; }
.relationshipLine { stroke: ${s.lineColor}; stroke-width: 1; fill: none; }
.marker { fill: none !important; stroke: ${s.lineColor} !important; stroke-width: 1; }`, "getStyles"), te = $t, re = { parser: Xt, get db() { return new qt(); }, renderer: Nt, styles: te};export { re as diagram};123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626import { g as qt } from "./chunk-UIWBPB2F-muaaSQOG.js";import { _ as m, n as Ot, l as t1, c as b1, d as S1, o as Ht, r as Xt, u as it, b as Qt, s as Jt, p as Zt, a as $t, g as te, q as ee, k as se, t as ie, J as re, v as ae, x as st, y as ne, z as ue, A as oe } from "./mermaid.core-BiIw1_mh.js";import { g as le, s as ce } from "./chunk-HPOVUXKZ-C_XOradn.js";import { c as he } from "./channel-DjI12Op-.js";var de = "flowchart-", P1, pe = (P1 = class { // cspell:ignore funs constructor() { this.vertexCounter = 0, this.config = b1(), this.vertices = /* @__PURE__ */ new Map(), this.edges = [], this.classes = /* @__PURE__ */ new Map(), this.subGraphs = [], this.subGraphLookup = /* @__PURE__ */ new Map(), this.tooltips = /* @__PURE__ */ new Map(), this.subCount = 0, this.firstGraphFlag = !0, this.secCount = -1, this.posCrossRef = [], this.funs = [], this.setAccTitle = Qt, this.setAccDescription = Jt, this.setDiagramTitle = Zt, this.getAccTitle = $t, this.getAccDescription = te, this.getDiagramTitle = ee, this.funs.push(this.setupToolTips.bind(this)), this.addVertex = this.addVertex.bind(this), this.firstGraph = this.firstGraph.bind(this), this.setDirection = this.setDirection.bind(this), this.addSubGraph = this.addSubGraph.bind(this), this.addLink = this.addLink.bind(this), this.setLink = this.setLink.bind(this), this.updateLink = this.updateLink.bind(this), this.addClass = this.addClass.bind(this), this.setClass = this.setClass.bind(this), this.destructLink = this.destructLink.bind(this), this.setClickEvent = this.setClickEvent.bind(this), this.setTooltip = this.setTooltip.bind(this), this.updateLinkInterpolate = this.updateLinkInterpolate.bind(this), this.setClickFun = this.setClickFun.bind(this), this.bindFunctions = this.bindFunctions.bind(this), this.lex = { firstGraph: this.firstGraph.bind(this) }, this.clear(), this.setGen("gen-2"); } sanitizeText(i) { return se.sanitizeText(i, this.config); } /** * Function to lookup domId from id in the graph definition. * * @param id - id of the node */ lookUpDomId(i) { for (const a of this.vertices.values()) if (a.id === i) return a.domId; return i; } /** * Function called by parser when a node definition has been found */ addVertex(i, a, n, u, o, f, c = {}, A) { var L, C; if (!i || i.trim().length === 0) return; let r; if (A !== void 0) { let p; A.includes(``) ? p = A + `` : p = `{` + A + `}`, r = ie(p, { schema: re }); } const k = this.edges.find((p) => p.id === i); if (k) { const p = r; (p == null ? void 0 : p.animate) !== void 0 && (k.animate = p.animate), (p == null ? void 0 : p.animation) !== void 0 && (k.animation = p.animation); return; } let E, b = this.vertices.get(i); if (b === void 0 && (b = { id: i, labelType: "text", domId: de + i + "-" + this.vertexCounter, styles: [], classes: [] }, this.vertices.set(i, b)), this.vertexCounter++, a !== void 0 ? (this.config = b1(), E = this.sanitizeText(a.text.trim()), b.labelType = a.type, E.startsWith('"') && E.endsWith('"') && (E = E.substring(1, E.length - 1)), b.text = E) : b.text === void 0 && (b.text = i), n !== void 0 && (b.type = n), u != null && u.forEach((p) => { b.styles.push(p); }), o != null && o.forEach((p) => { b.classes.push(p); }), f !== void 0 && (b.dir = f), b.props === void 0 ? b.props = c : c !== void 0 && Object.assign(b.props, c), r !== void 0) { if (r.shape) { if (r.shape !== r.shape.toLowerCase() || r.shape.includes("_")) throw new Error(`No such shape: ${r.shape}. Shape names should be lowercase.`); if (!ae(r.shape)) throw new Error(`No such shape: ${r.shape}.`); b.type = r == null ? void 0 : r.shape; } r != null && r.label && (b.text = r == null ? void 0 : r.label), r != null && r.icon && (b.icon = r == null ? void 0 : r.icon, !((L = r.label) != null && L.trim()) && b.text === i && (b.text = "")), r != null && r.form && (b.form = r == null ? void 0 : r.form), r != null && r.pos && (b.pos = r == null ? void 0 : r.pos), r != null && r.img && (b.img = r == null ? void 0 : r.img, !((C = r.label) != null && C.trim()) && b.text === i && (b.text = "")), r != null && r.constraint && (b.constraint = r.constraint), r.w && (b.assetWidth = Number(r.w)), r.h && (b.assetHeight = Number(r.h)); } } /** * Function called by parser when a link/edge definition has been found * */ addSingleLink(i, a, n, u) { const c = { start: i, end: a, type: void 0, text: "", labelType: "text", classes: [], isUserDefinedId: !1, interpolate: this.edges.defaultInterpolate }; t1.info("abc78 Got edge...", c); const A = n.text; if (A !== void 0 && (c.text = this.sanitizeText(A.text.trim()), c.text.startsWith('"') && c.text.endsWith('"') && (c.text = c.text.substring(1, c.text.length - 1)), c.labelType = A.type), n !== void 0 && (c.type = n.type, c.stroke = n.stroke, c.length = n.length > 10 ? 10 : n.length), u && !this.edges.some((r) => r.id === u)) c.id = u, c.isUserDefinedId = !0; else { const r = this.edges.filter((k) => k.start === c.start && k.end === c.end); r.length === 0 ? c.id = st(c.start, c.end, { counter: 0, prefix: "L" }) : c.id = st(c.start, c.end, { counter: r.length + 1, prefix: "L" }); } if (this.edges.length < (this.config.maxEdges ?? 500)) t1.info("Pushing edge..."), this.edges.push(c); else throw new Error( `Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.
Initialize mermaid with maxEdges set to a higher number to allow more edges.You cannot set this config via configuration inside the diagram as it is a secure config.You have to call mermaid.initialize.` ); } isLinkData(i) { return i !== null && typeof i == "object" && "id" in i && typeof i.id == "string"; } addLink(i, a, n) { const u = this.isLinkData(n) ? n.id.replace("@", "") : void 0; t1.info("addLink", i, a, u); for (const o of i) for (const f of a) { const c = o === i[i.length - 1], A = f === a[0]; c && A ? this.addSingleLink(o, f, n, u) : this.addSingleLink(o, f, n, void 0); } } /** * Updates a link's line interpolation algorithm */ updateLinkInterpolate(i, a) { i.forEach((n) => { n === "default" ? this.edges.defaultInterpolate = a : this.edges[n].interpolate = a; }); } /** * Updates a link with a style * */ updateLink(i, a) { i.forEach((n) => { var u, o, f, c, A, r; if (typeof n == "number" && n >= this.edges.length) throw new Error( `The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length - 1}. (Help: Ensure that the index is within the range of existing edges.)` ); n === "default" ? this.edges.defaultStyle = a : (this.edges[n].style = a, (((o = (u = this.edges[n]) == null ? void 0 : u.style) == null ? void 0 : o.length) ?? 0) > 0 && !((c = (f = this.edges[n]) == null ? void 0 : f.style) != null && c.some((k) => k == null ? void 0 : k.startsWith("fill"))) && ((r = (A = this.edges[n]) == null ? void 0 : A.style) == null || r.push("fill:none"))); }); } addClass(i, a) { const n = a.join().replace(/\\,/g, "§§§").replace(/,/g, ";").replace(/§§§/g, ",").split(";"); i.split(",").forEach((u) => { let o = this.classes.get(u); o === void 0 && (o = { id: u, styles: [], textStyles: [] }, this.classes.set(u, o)), n != null && n.forEach((f) => { if (/color/.exec(f)) { const c = f.replace("fill", "bgFill"); o.textStyles.push(c); } o.styles.push(f); }); }); } /** * Called by parser when a graph definition is found, stores the direction of the chart. * */ setDirection(i) { this.direction = i, /.*</.exec(this.direction) && (this.direction = "RL"), /.*\^/.exec(this.direction) && (this.direction = "BT"), /.*>/.exec(this.direction) && (this.direction = "LR"), /.*v/.exec(this.direction) && (this.direction = "TB"), this.direction === "TD" && (this.direction = "TB"); } /** * Called by parser when a special node is found, e.g. a clickable element. * * @param ids - Comma separated list of ids * @param className - Class to add */ setClass(i, a) { for (const n of i.split(",")) { const u = this.vertices.get(n); u && u.classes.push(a); const o = this.edges.find((c) => c.id === n); o && o.classes.push(a); const f = this.subGraphLookup.get(n); f && f.classes.push(a); } } setTooltip(i, a) { if (a !== void 0) { a = this.sanitizeText(a); for (const n of i.split(",")) this.tooltips.set(this.version === "gen-1" ? this.lookUpDomId(n) : n, a); } } setClickFun(i, a, n) { const u = this.lookUpDomId(i); if (b1().securityLevel !== "loose" || a === void 0) return; let o = []; if (typeof n == "string") { o = n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/); for (let c = 0; c < o.length; c++) { let A = o[c].trim(); A.startsWith('"') && A.endsWith('"') && (A = A.substr(1, A.length - 2)), o[c] = A; } } o.length === 0 && o.push(i); const f = this.vertices.get(i); f && (f.haveCallback = !0, this.funs.push(() => { const c = document.querySelector(`[id="${u}"]`); c !== null && c.addEventListener( "click", () => { it.runFunc(a, ...o); }, !1 ); })); } /** * Called by parser when a link is found. Adds the URL to the vertex data. * * @param ids - Comma separated list of ids * @param linkStr - URL to create a link for * @param target - Target attribute for the link */ setLink(i, a, n) { i.split(",").forEach((u) => { const o = this.vertices.get(u); o !== void 0 && (o.link = it.formatUrl(a, this.config), o.linkTarget = n); }), this.setClass(i, "clickable"); } getTooltip(i) { return this.tooltips.get(i); } /** * Called by parser when a click definition is found. Registers an event handler. * * @param ids - Comma separated list of ids * @param functionName - Function to be called on click * @param functionArgs - Arguments to be passed to the function */ setClickEvent(i, a, n) { i.split(",").forEach((u) => { this.setClickFun(u, a, n); }), this.setClass(i, "clickable"); } bindFunctions(i) { this.funs.forEach((a) => { a(i); }); } getDirection() { var i; return (i = this.direction) == null ? void 0 : i.trim(); } /** * Retrieval function for fetching the found nodes after parsing has completed. * */ getVertices() { return this.vertices; } /** * Retrieval function for fetching the found links after parsing has completed. * */ getEdges() { return this.edges; } /** * Retrieval function for fetching the found class definitions after parsing has completed. * */ getClasses() { return this.classes; } setupToolTips(i) { let a = S1(".mermaidTooltip"); (a._groups || a)[0][0] === null && (a = S1("body").append("div").attr("class", "mermaidTooltip").style("opacity", 0)), S1(i).select("svg").selectAll("g.node").on("mouseover", (o) => { var r; const f = S1(o.currentTarget); if (f.attr("title") === null) return; const A = (r = o.currentTarget) == null ? void 0 : r.getBoundingClientRect(); a.transition().duration(200).style("opacity", ".9"), a.text(f.attr("title")).style("left", window.scrollX + A.left + (A.right - A.left) / 2 + "px").style("top", window.scrollY + A.bottom + "px"), a.html(a.html().replace(/<br\/>/g, "<br/>")), f.classed("hover", !0); }).on("mouseout", (o) => { a.transition().duration(500).style("opacity", 0), S1(o.currentTarget).classed("hover", !1); }); } /** * Clears the internal graph db so that a new graph can be parsed. * */ clear(i = "gen-2") { this.vertices = /* @__PURE__ */ new Map(), this.classes = /* @__PURE__ */ new Map(), this.edges = [], this.funs = [this.setupToolTips.bind(this)], this.subGraphs = [], this.subGraphLookup = /* @__PURE__ */ new Map(), this.subCount = 0, this.tooltips = /* @__PURE__ */ new Map(), this.firstGraphFlag = !0, this.version = i, this.config = b1(), ne(); } setGen(i) { this.version = i || "gen-2"; } defaultStyle() { return "fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"; } addSubGraph(i, a, n) { let u = i.text.trim(), o = n.text; i === n && /\s/.exec(n.text) && (u = void 0); const c = (/* @__PURE__ */ m((b) => { const L = { boolean: {}, number: {}, string: {} }, C = []; let p; return { nodeList: b.filter(function(W) { const Z = typeof W; return W.stmt && W.stmt === "dir" ? (p = W.value, !1) : W.trim() === "" ? !1 : Z in L ? L[Z].hasOwnProperty(W) ? !1 : L[Z][W] = !0 : C.includes(W) ? !1 : C.push(W); }), dir: p }; }, "uniq"))(a.flat()), A = c.nodeList; let r = c.dir; const k = b1().flowchart ?? {}; if (r = r ?? (k.inheritDir ? this.getDirection() ?? b1().direction ?? void 0 : void 0), this.version === "gen-1") for (let b = 0; b < A.length; b++) A[b] = this.lookUpDomId(A[b]); u = u ?? "subGraph" + this.subCount, o = o || "", o = this.sanitizeText(o), this.subCount = this.subCount + 1; const E = { id: u, nodes: A, title: o.trim(), classes: [], dir: r, labelType: n.type }; return t1.info("Adding", E.id, E.nodes, E.dir), E.nodes = this.makeUniq(E, this.subGraphs).nodes, this.subGraphs.push(E), this.subGraphLookup.set(u, E), u; } getPosForId(i) { for (const [a, n] of this.subGraphs.entries()) if (n.id === i) return a; return -1; } indexNodes2(i, a) { const n = this.subGraphs[a].nodes; if (this.secCount = this.secCount + 1, this.secCount > 2e3) return { result: !1, count: 0 }; if (this.posCrossRef[this.secCount] = a, this.subGraphs[a].id === i) return { result: !0, count: 0 }; let u = 0, o = 1; for (; u < n.length; ) { const f = this.getPosForId(n[u]); if (f >= 0) { const c = this.indexNodes2(i, f); if (c.result) return { result: !0, count: o + c.count }; o = o + c.count; } u = u + 1; } return { result: !1, count: o }; } getDepthFirstPos(i) { return this.posCrossRef[i]; } indexNodes() { this.secCount = -1, this.subGraphs.length > 0 && this.indexNodes2("none", this.subGraphs.length - 1); } getSubGraphs() { return this.subGraphs; } firstGraph() { return this.firstGraphFlag ? (this.firstGraphFlag = !1, !0) : !1; } destructStartLink(i) { let a = i.trim(), n = "arrow_open"; switch (a[0]) { case "<": n = "arrow_point", a = a.slice(1); break; case "x": n = "arrow_cross", a = a.slice(1); break; case "o": n = "arrow_circle", a = a.slice(1); break; } let u = "normal"; return a.includes("=") && (u = "thick"), a.includes(".") && (u = "dotted"), { type: n, stroke: u }; } countChar(i, a) { const n = a.length; let u = 0; for (let o = 0; o < n; ++o) a[o] === i && ++u; return u; } destructEndLink(i) { const a = i.trim(); let n = a.slice(0, -1), u = "arrow_open"; switch (a.slice(-1)) { case "x": u = "arrow_cross", a.startsWith("x") && (u = "double_" + u, n = n.slice(1)); break; case ">": u = "arrow_point", a.startsWith("<") && (u = "double_" + u, n = n.slice(1)); break; case "o": u = "arrow_circle", a.startsWith("o") && (u = "double_" + u, n = n.slice(1)); break; } let o = "normal", f = n.length - 1; n.startsWith("=") && (o = "thick"), n.startsWith("~") && (o = "invisible"); const c = this.countChar(".", n); return c && (o = "dotted", f = c), { type: u, stroke: o, length: f }; } destructLink(i, a) { const n = this.destructEndLink(i); let u; if (a) { if (u = this.destructStartLink(a), u.stroke !== n.stroke) return { type: "INVALID", stroke: "INVALID" }; if (u.type === "arrow_open") u.type = n.type; else { if (u.type !== n.type) return { type: "INVALID", stroke: "INVALID" }; u.type = "double_" + u.type; } return u.type === "double_arrow" && (u.type = "double_arrow_point"), u.length = n.length, u; } return n; } // Todo optimizer this by caching existing nodes exists(i, a) { for (const n of i) if (n.nodes.includes(a)) return !0; return !1; } /** * Deletes an id from all subgraphs * */ makeUniq(i, a) { const n = []; return i.nodes.forEach((u, o) => { this.exists(a, u) || n.push(i.nodes[o]); }), { nodes: n }; } getTypeFromVertex(i) { if (i.img) return "imageSquare"; if (i.icon) return i.form === "circle" ? "iconCircle" : i.form === "square" ? "iconSquare" : i.form === "rounded" ? "iconRounded" : "icon"; switch (i.type) { case "square": case void 0: return "squareRect"; case "round": return "roundedRect"; case "ellipse": return "ellipse"; default: return i.type; } } findNode(i, a) { return i.find((n) => n.id === a); } destructEdgeType(i) { let a = "none", n = "arrow_point"; switch (i) { case "arrow_point": case "arrow_circle": case "arrow_cross": n = i; break; case "double_arrow_point": case "double_arrow_circle": case "double_arrow_cross": a = i.replace("double_", ""), n = a; break; } return { arrowTypeStart: a, arrowTypeEnd: n }; } addNodeFromVertex(i, a, n, u, o, f) { var k; const c = n.get(i.id), A = u.get(i.id) ?? !1, r = this.findNode(a, i.id); if (r) r.cssStyles = i.styles, r.cssCompiledStyles = this.getCompiledStyles(i.classes), r.cssClasses = i.classes.join(" "); else { const E = { id: i.id, label: i.text, labelStyle: "", parentId: c, padding: ((k = o.flowchart) == null ? void 0 : k.padding) || 8, cssStyles: i.styles, cssCompiledStyles: this.getCompiledStyles(["default", "node", ...i.classes]), cssClasses: "default " + i.classes.join(" "), dir: i.dir, domId: i.domId, look: f, link: i.link, linkTarget: i.linkTarget, tooltip: this.getTooltip(i.id), icon: i.icon, pos: i.pos, img: i.img, assetWidth: i.assetWidth, assetHeight: i.assetHeight, constraint: i.constraint }; A ? a.push({ ...E, isGroup: !0, shape: "rect" }) : a.push({ ...E, isGroup: !1, shape: this.getTypeFromVertex(i) }); } } getCompiledStyles(i) { let a = []; for (const n of i) { const u = this.classes.get(n); u != null && u.styles && (a = [...a, ...u.styles ?? []].map((o) => o.trim())), u != null && u.textStyles && (a = [...a, ...u.textStyles ?? []].map((o) => o.trim())); } return a; } getData() { const i = b1(), a = [], n = [], u = this.getSubGraphs(), o = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(); for (let r = u.length - 1; r >= 0; r--) { const k = u[r]; k.nodes.length > 0 && f.set(k.id, !0); for (const E of k.nodes) o.set(E, k.id); } for (let r = u.length - 1; r >= 0; r--) { const k = u[r]; a.push({ id: k.id, label: k.title, labelStyle: "", parentId: o.get(k.id), padding: 8, cssCompiledStyles: this.getCompiledStyles(k.classes), cssClasses: k.classes.join(" "), shape: "rect", dir: k.dir, isGroup: !0, look: i.look }); } this.getVertices().forEach((r) => { this.addNodeFromVertex(r, a, o, f, i, i.look || "classic"); }); const A = this.getEdges(); return A.forEach((r, k) => { var p; const { arrowTypeStart: E, arrowTypeEnd: b } = this.destructEdgeType(r.type), L = [...A.defaultStyle ?? []]; r.style && L.push(...r.style); const C = { id: st(r.start, r.end, { counter: k, prefix: "L" }, r.id), isUserDefinedId: r.isUserDefinedId, start: r.start, end: r.end, type: r.type ?? "normal", label: r.text, labelpos: "c", thickness: r.stroke, minlen: r.length, classes: (r == null ? void 0 : r.stroke) === "invisible" ? "" : "edge-thickness-normal edge-pattern-solid flowchart-link", arrowTypeStart: (r == null ? void 0 : r.stroke) === "invisible" || (r == null ? void 0 : r.type) === "arrow_open" ? "none" : E, arrowTypeEnd: (r == null ? void 0 : r.stroke) === "invisible" || (r == null ? void 0 : r.type) === "arrow_open" ? "none" : b, arrowheadStyle: "fill: #333", cssCompiledStyles: this.getCompiledStyles(r.classes), labelStyle: L, style: L, pattern: r.stroke, look: i.look, animate: r.animate, animation: r.animation, curve: r.interpolate || this.edges.defaultInterpolate || ((p = i.flowchart) == null ? void 0 : p.curve) }; n.push(C); }), { nodes: a, edges: n, other: {}, config: i }; } defaultConfig() { return ue.flowchart; }}, m(P1, "FlowDB"), P1), fe = /* @__PURE__ */ m(function(s, i) { return i.db.getClasses();}, "getClasses"), ge = /* @__PURE__ */ m(async function(s, i, a, n) { var L; t1.info("REF0:"), t1.info("Drawing state diagram (v2)", i); const { securityLevel: u, flowchart: o, layout: f } = b1(); let c; u === "sandbox" && (c = S1("#i" + i)); const A = u === "sandbox" ? c.nodes()[0].contentDocument : document; t1.debug("Before getData: "); const r = n.db.getData(); t1.debug("Data: ", r); const k = le(i, u), E = n.db.getDirection(); r.type = n.type, r.layoutAlgorithm = Ht(f), r.layoutAlgorithm === "dagre" && f === "elk" && t1.warn( "flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback." ), r.direction = E, r.nodeSpacing = (o == null ? void 0 : o.nodeSpacing) || 50, r.rankSpacing = (o == null ? void 0 : o.rankSpacing) || 50, r.markers = ["point", "circle", "cross"], r.diagramId = i, t1.debug("REF1:", r), await Xt(r, k); const b = ((L = r.config.flowchart) == null ? void 0 : L.diagramPadding) ?? 8; it.insertTitle( k, "flowchartTitleText", (o == null ? void 0 : o.titleTopMargin) || 0, n.db.getDiagramTitle() ), ce(k, b, "flowchart", (o == null ? void 0 : o.useMaxWidth) || !1); for (const C of r.nodes) { const p = S1(`#${i} [id="${C.id}"]`); if (!p || !C.link) continue; const J = A.createElementNS("http://www.w3.org/2000/svg", "a"); J.setAttributeNS("http://www.w3.org/2000/svg", "class", C.cssClasses), J.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"), u === "sandbox" ? J.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top") : C.linkTarget && J.setAttributeNS("http://www.w3.org/2000/svg", "target", C.linkTarget); const W = p.insert(function() { return J; }, ":first-child"), Z = p.select(".label-container"); Z && W.append(function() { return Z.node(); }); const A1 = p.select(".label"); A1 && W.append(function() { return A1.node(); }); }}, "draw"), be = { getClasses: fe, draw: ge}, rt = function() { var s = /* @__PURE__ */ m(function(g1, h, d, g) { for (d = d || {}, g = g1.length; g--; d[g1[g]] = h) ; return d; }, "o"), i = [1, 4], a = [1, 3], n = [1, 5], u = [1, 8, 9, 10, 11, 27, 34, 36, 38, 44, 60, 84, 85, 86, 87, 88, 89, 102, 105, 106, 109, 111, 114, 115, 116, 121, 122, 123, 124], o = [2, 2], f = [1, 13], c = [1, 14], A = [1, 15], r = [1, 16], k = [1, 23], E = [1, 25], b = [1, 26], L = [1, 27], C = [1, 49], p = [1, 48], J = [1, 29], W = [1, 30], Z = [1, 31], A1 = [1, 32], M1 = [1, 33], V = [1, 44], I = [1, 46], w = [1, 42], R = [1, 47], N = [1, 43], G = [1, 50], P = [1, 45], O = [1, 51], M = [1, 52], U1 = [1, 34], W1 = [1, 35], z1 = [1, 36], j1 = [1, 37], p1 = [1, 57], y = [1, 8, 9, 10, 11, 27, 32, 34, 36, 38, 44, 60, 84, 85, 86, 87, 88, 89, 102, 105, 106, 109, 111, 114, 115, 116, 121, 122, 123, 124], e1 = [1, 61], s1 = [1, 60], i1 = [1, 62], D1 = [8, 9, 11, 75, 77, 78], at = [1, 78], x1 = [1, 91], T1 = [1, 96], E1 = [1, 95], y1 = [1, 92], F1 = [1, 88], _1 = [1, 94], B1 = [1, 90], v1 = [1, 97], L1 = [1, 93], V1 = [1, 98], I1 = [1, 89], k1 = [8, 9, 10, 11, 40, 75, 77, 78], z = [8, 9, 10, 11, 40, 46, 75, 77, 78], q = [8, 9, 10, 11, 29, 40, 44, 46, 48, 50, 52, 54, 56, 58, 60, 63, 65, 67, 68, 70, 75, 77, 78, 89, 102, 105, 106, 109, 111, 114, 115, 116], nt = [8, 9, 11, 44, 60, 75, 77, 78, 89, 102, 105, 106, 109, 111, 114, 115, 116], w1 = [44, 60, 89, 102, 105, 106, 109, 111, 114, 115, 116], ut = [1, 121], ot = [1, 122], K1 = [1, 124], Y1 = [1, 123], lt = [44, 60, 62, 74, 89, 102, 105, 106, 109, 111, 114, 115, 116], ct = [1, 133], ht = [1, 147], dt = [1, 148], pt = [1, 149], ft = [1, 150], gt = [1, 135], bt = [1, 137], At = [1, 141], kt = [1, 142], mt = [1, 143], Ct = [1, 144], St = [1, 145], Dt = [1, 146], xt = [1, 151], Tt = [1, 152], Et = [1, 131], yt = [1, 132], Ft = [1, 139], _t = [1, 134], Bt = [1, 138], vt = [1, 136], Q1 = [8, 9, 10, 11, 27, 32, 34, 36, 38, 44, 60, 84, 85, 86, 87, 88, 89, 102, 105, 106, 109, 111, 114, 115, 116, 121, 122, 123, 124], Lt = [1, 154], Vt = [1, 156], B = [8, 9, 11], H = [8, 9, 10, 11, 14, 44, 60, 89, 105, 106, 109, 111, 114, 115, 116], S = [1, 176], j = [1, 172], K = [1, 173], D = [1, 177], x = [1, 174], T = [1, 175], R1 = [77, 116, 119], F = [8, 9, 10, 11, 12, 14, 27, 29, 32, 44, 60, 75, 84, 85, 86, 87, 88, 89, 90, 105, 109, 111, 114, 115, 116], It = [10, 106], f1 = [31, 49, 51, 53, 55, 57, 62, 64, 66, 67, 69, 71, 116, 117, 118], r1 = [1, 247], a1 = [1, 245], n1 = [1, 249], u1 = [1, 243], o1 = [1, 244], l1 = [1, 246], c1 = [1, 248], h1 = [1, 250], N1 = [1, 268], wt = [8, 9, 11, 106], $ = [8, 9, 10, 11, 60, 84, 105, 106, 109, 110, 111, 112], J1 = { trace: /* @__PURE__ */ m(function() { }, "trace"), yy: {}, symbols_: { error: 2, start: 3, graphConfig: 4, document: 5, line: 6, statement: 7, SEMI: 8, NEWLINE: 9, SPACE: 10, EOF: 11, GRAPH: 12, NODIR: 13, DIR: 14, FirstStmtSeparator: 15, ending: 16, endToken: 17, spaceList: 18, spaceListNewline: 19, vertexStatement: 20, separator: 21, styleStatement: 22, linkStyleStatement: 23, classDefStatement: 24, classStatement: 25, clickStatement: 26, subgraph: 27, textNoTags: 28, SQS: 29, text: 30, SQE: 31, end: 32, direction: 33, acc_title: 34, acc_title_value: 35, acc_descr: 36, acc_descr_value: 37, acc_descr_multiline_value: 38, shapeData: 39, SHAPE_DATA: 40, link: 41, node: 42, styledVertex: 43, AMP: 44, vertex: 45, STYLE_SEPARATOR: 46, idString: 47, DOUBLECIRCLESTART: 48, DOUBLECIRCLEEND: 49, PS: 50, PE: 51, "(-": 52, "-)": 53, STADIUMSTART: 54, STADIUMEND: 55, SUBROUTINESTART: 56, SUBROUTINEEND: 57, VERTEX_WITH_PROPS_START: 58, "NODE_STRING[field]": 59, COLON: 60, "NODE_STRING[value]": 61, PIPE: 62, CYLINDERSTART: 63, CYLINDEREND: 64, DIAMOND_START: 65, DIAMOND_STOP: 66, TAGEND: 67, TRAPSTART: 68, TRAPEND: 69, INVTRAPSTART: 70, INVTRAPEND: 71, linkStatement: 72, arrowText: 73, TESTSTR: 74, START_LINK: 75, edgeText: 76, LINK: 77, LINK_ID: 78, edgeTextToken: 79, STR: 80, MD_STR: 81, textToken: 82, keywords: 83, STYLE: 84, LINKSTYLE: 85, CLASSDEF: 86, CLASS: 87, CLICK: 88, DOWN: 89, UP: 90, textNoTagsToken: 91, stylesOpt: 92, "idString[vertex]": 93, "idString[class]": 94, CALLBACKNAME: 95, CALLBACKARGS: 96, HREF: 97, LINK_TARGET: 98, "STR[link]": 99, "STR[tooltip]": 100, alphaNum: 101, DEFAULT: 102, numList: 103, INTERPOLATE: 104, NUM: 105, COMMA: 106, style: 107, styleComponent: 108, NODE_STRING: 109, UNIT: 110, BRKT: 111, PCT: 112, idStringToken: 113, MINUS: 114, MULT: 115, UNICODE_TEXT: 116, TEXT: 117, TAGSTART: 118, EDGE_TEXT: 119, alphaNumToken: 120, direction_tb: 121, direction_bt: 122, direction_rl: 123, direction_lr: 124, $accept: 0, $end: 1 }, terminals_: { 2: "error", 8: "SEMI", 9: "NEWLINE", 10: "SPACE", 11: "EOF", 12: "GRAPH", 13: "NODIR", 14: "DIR", 27: "subgraph", 29: "SQS", 31: "SQE", 32: "end", 34: "acc_title", 35: "acc_title_value", 36: "acc_descr", 37: "acc_descr_value", 38: "acc_descr_multiline_value", 40: "SHAPE_DATA", 44: "AMP", 46: "STYLE_SEPARATOR", 48: "DOUBLECIRCLESTART", 49: "DOUBLECIRCLEEND", 50: "PS", 51: "PE", 52: "(-", 53: "-)", 54: "STADIUMSTART", 55: "STADIUMEND", 56: "SUBROUTINESTART", 57: "SUBROUTINEEND", 58: "VERTEX_WITH_PROPS_START", 59: "NODE_STRING[field]", 60: "COLON", 61: "NODE_STRING[value]", 62: "PIPE", 63: "CYLINDERSTART", 64: "CYLINDEREND", 65: "DIAMOND_START", 66: "DIAMOND_STOP", 67: "TAGEND", 68: "TRAPSTART", 69: "TRAPEND", 70: "INVTRAPSTART", 71: "INVTRAPEND", 74: "TESTSTR", 75: "START_LINK", 77: "LINK", 78: "LINK_ID", 80: "STR", 81: "MD_STR", 84: "STYLE", 85: "LINKSTYLE", 86: "CLASSDEF", 87: "CLASS", 88: "CLICK", 89: "DOWN", 90: "UP", 93: "idString[vertex]", 94: "idString[class]", 95: "CALLBACKNAME", 96: "CALLBACKARGS", 97: "HREF", 98: "LINK_TARGET", 99: "STR[link]", 100: "STR[tooltip]", 102: "DEFAULT", 104: "INTERPOLATE", 105: "NUM", 106: "COMMA", 109: "NODE_STRING", 110: "UNIT", 111: "BRKT", 112: "PCT", 114: "MINUS", 115: "MULT", 116: "UNICODE_TEXT", 117: "TEXT", 118: "TAGSTART", 119: "EDGE_TEXT", 121: "direction_tb", 122: "direction_bt", 123: "direction_rl", 124: "direction_lr" }, productions_: [0, [3, 2], [5, 0], [5, 2], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [4, 2], [4, 2], [4, 2], [4, 3], [16, 2], [16, 1], [17, 1], [17, 1], [17, 1], [15, 1], [15, 1], [15, 2], [19, 2], [19, 2], [19, 1], [19, 1], [18, 2], [18, 1], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 9], [7, 6], [7, 4], [7, 1], [7, 2], [7, 2], [7, 1], [21, 1], [21, 1], [21, 1], [39, 2], [39, 1], [20, 4], [20, 3], [20, 4], [20, 2], [20, 2], [20, 1], [42, 1], [42, 6], [42, 5], [43, 1], [43, 3], [45, 4], [45, 4], [45, 6], [45, 4], [45, 4], [45, 4], [45, 8], [45, 4], [45, 4], [45, 4], [45, 6], [45, 4], [45, 4], [45, 4], [45, 4], [45, 4], [45, 1], [41, 2], [41, 3], [41, 3], [41, 1], [41, 3], [41, 4], [76, 1], [76, 2], [76, 1], [76, 1], [72, 1], [72, 2], [73, 3], [30, 1], [30, 2], [30, 1], [30, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [83, 1], [28, 1], [28, 2], [28, 1], [28, 1], [24, 5], [25, 5], [26, 2], [26, 4], [26, 3], [26, 5], [26, 3], [26, 5], [26, 5], [26, 7], [26, 2], [26, 4], [26, 2], [26, 4], [26, 4], [26, 6], [22, 5], [23, 5], [23, 5], [23, 9], [23, 9], [23, 7], [23, 7], [103, 1], [103, 3], [92, 1], [92, 3], [107, 1], [107, 2], [108, 1], [108, 1], [108, 1], [108, 1], [108, 1], [108, 1], [108, 1], [108, 1], [113, 1], [113, 1], [113, 1], [113, 1], [113, 1], [113, 1], [113, 1], [113, 1], [113, 1], [113, 1], [113, 1], [82, 1], [82, 1], [82, 1], [82, 1], [91, 1], [91, 1], [91, 1], [91, 1], [91, 1], [91, 1], [91, 1], [91, 1], [91, 1], [91, 1], [91, 1], [79, 1], [79, 1], [120, 1], [120, 1], [120, 1], [120, 1], [120, 1], [120, 1], [120, 1], [120, 1], [120, 1], [120, 1], [120, 1], [47, 1], [47, 2], [101, 1], [101, 2], [33, 1], [33, 1], [33, 1], [33, 1]], performAction: /* @__PURE__ */ m(function(h, d, g, l, _, t, O1) { var e = t.length - 1; switch (_) { case 2: this.$ = []; break; case 3: (!Array.isArray(t[e]) || t[e].length > 0) && t[e - 1].push(t[e]), this.$ = t[e - 1]; break; case 4: case 183: this.$ = t[e]; break; case 11: l.setDirection("TB"), this.$ = "TB"; break; case 12: l.setDirection(t[e - 1]), this.$ = t[e - 1]; break; case 27: this.$ = t[e - 1].nodes; break; case 28: case 29: case 30: case 31: case 32: this.$ = []; break; case 33: this.$ = l.addSubGraph(t[e - 6], t[e - 1], t[e - 4]); break; case 34: this.$ = l.addSubGraph(t[e - 3], t[e - 1], t[e - 3]); break; case 35: this.$ = l.addSubGraph(void 0, t[e - 1], void 0); break; case 37: this.$ = t[e].trim(), l.setAccTitle(this.$); break; case 38: case 39: this.$ = t[e].trim(), l.setAccDescription(this.$); break; case 43: this.$ = t[e - 1] + t[e]; break; case 44: this.$ = t[e]; break; case 45: l.addVertex(t[e - 1][t[e - 1].length - 1], void 0, void 0, void 0, void 0, void 0, void 0, t[e]), l.addLink(t[e - 3].stmt, t[e - 1], t[e - 2]), this.$ = { stmt: t[e - 1], nodes: t[e - 1].concat(t[e - 3].nodes) }; break; case 46: l.addLink(t[e - 2].stmt, t[e], t[e - 1]), this.$ = { stmt: t[e], nodes: t[e].concat(t[e - 2].nodes) }; break; case 47: l.addLink(t[e - 3].stmt, t[e - 1], t[e - 2]), this.$ = { stmt: t[e - 1], nodes: t[e - 1].concat(t[e - 3].nodes) }; break; case 48: this.$ = { stmt: t[e - 1], nodes: t[e - 1] }; break; case 49: l.addVertex(t[e - 1][t[e - 1].length - 1], void 0, void 0, void 0, void 0, void 0, void 0, t[e]), this.$ = { stmt: t[e - 1], nodes: t[e - 1], shapeData: t[e] }; break; case 50: this.$ = { stmt: t[e], nodes: t[e] }; break; case 51: this.$ = [t[e]]; break; case 52: l.addVertex(t[e - 5][t[e - 5].length - 1], void 0, void 0, void 0, void 0, void 0, void 0, t[e - 4]), this.$ = t[e - 5].concat(t[e]); break; case 53: this.$ = t[e - 4].concat(t[e]); break; case 54: this.$ = t[e]; break; case 55: this.$ = t[e - 2], l.setClass(t[e - 2], t[e]); break; case 56: this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "square"); break; case 57: this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "doublecircle"); break; case 58: this.$ = t[e - 5], l.addVertex(t[e - 5], t[e - 2], "circle"); break; case 59: this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "ellipse"); break; case 60: this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "stadium"); break; case 61: this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "subroutine"); break; case 62: this.$ = t[e - 7], l.addVertex(t[e - 7], t[e - 1], "rect", void 0, void 0, void 0, Object.fromEntries([[t[e - 5], t[e - 3]]])); break; case 63: this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "cylinder"); break; case 64: this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "round"); break; case 65: this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "diamond"); break; case 66: this.$ = t[e - 5], l.addVertex(t[e - 5], t[e - 2], "hexagon"); break; case 67: this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "odd"); break; case 68: this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "trapezoid"); break; case 69: this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "inv_trapezoid"); break; case 70: this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "lean_right"); break; case 71: this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "lean_left"); break; case 72: this.$ = t[e], l.addVertex(t[e]); break; case 73: t[e - 1].text = t[e], this.$ = t[e - 1]; break; case 74: case 75: t[e - 2].text = t[e - 1], this.$ = t[e - 2]; break; case 76: this.$ = t[e]; break; case 77: var v = l.destructLink(t[e], t[e - 2]); this.$ = { type: v.type, stroke: v.stroke, length: v.length, text: t[e - 1] }; break; case 78: var v = l.destructLink(t[e], t[e - 2]); this.$ = { type: v.type, stroke: v.stroke, length: v.length, text: t[e - 1], id: t[e - 3] }; break; case 79: this.$ = { text: t[e], type: "text" }; break; case 80: this.$ = { text: t[e - 1].text + "" + t[e], type: t[e - 1].type }; break; case 81: this.$ = { text: t[e], type: "string" }; break; case 82: this.$ = { text: t[e], type: "markdown" }; break; case 83: var v = l.destructLink(t[e]); this.$ = { type: v.type, stroke: v.stroke, length: v.length }; break; case 84: var v = l.destructLink(t[e]); this.$ = { type: v.type, stroke: v.stroke, length: v.length, id: t[e - 1] }; break; case 85: this.$ = t[e - 1]; break; case 86: this.$ = { text: t[e], type: "text" }; break; case 87: this.$ = { text: t[e - 1].text + "" + t[e], type: t[e - 1].type }; break; case 88: this.$ = { text: t[e], type: "string" }; break; case 89: case 104: this.$ = { text: t[e], type: "markdown" }; break; case 101: this.$ = { text: t[e], type: "text" }; break; case 102: this.$ = { text: t[e - 1].text + "" + t[e], type: t[e - 1].type }; break; case 103: this.$ = { text: t[e], type: "text" }; break; case 105: this.$ = t[e - 4], l.addClass(t[e - 2], t[e]); break; case 106: this.$ = t[e - 4], l.setClass(t[e - 2], t[e]); break; case 107: case 115: this.$ = t[e - 1], l.setClickEvent(t[e - 1], t[e]); break; case 108: case 116: this.$ = t[e - 3], l.setClickEvent(t[e - 3], t[e - 2]), l.setTooltip(t[e - 3], t[e]); break; case 109: this.$ = t[e - 2], l.setClickEvent(t[e - 2], t[e - 1], t[e]); break; case 110: this.$ = t[e - 4], l.setClickEvent(t[e - 4], t[e - 3], t[e - 2]), l.setTooltip(t[e - 4], t[e]); break; case 111: this.$ = t[e - 2], l.setLink(t[e - 2], t[e]); break; case 112: this.$ = t[e - 4], l.setLink(t[e - 4], t[e - 2]), l.setTooltip(t[e - 4], t[e]); break; case 113: this.$ = t[e - 4], l.setLink(t[e - 4], t[e - 2], t[e]); break; case 114: this.$ = t[e - 6], l.setLink(t[e - 6], t[e - 4], t[e]), l.setTooltip(t[e - 6], t[e - 2]); break; case 117: this.$ = t[e - 1], l.setLink(t[e - 1], t[e]); break; case 118: this.$ = t[e - 3], l.setLink(t[e - 3], t[e - 2]), l.setTooltip(t[e - 3], t[e]); break; case 119: this.$ = t[e - 3], l.setLink(t[e - 3], t[e - 2], t[e]); break; case 120: this.$ = t[e - 5], l.setLink(t[e - 5], t[e - 4], t[e]), l.setTooltip(t[e - 5], t[e - 2]); break; case 121: this.$ = t[e - 4], l.addVertex(t[e - 2], void 0, void 0, t[e]); break; case 122: this.$ = t[e - 4], l.updateLink([t[e - 2]], t[e]); break; case 123: this.$ = t[e - 4], l.updateLink(t[e - 2], t[e]); break; case 124: this.$ = t[e - 8], l.updateLinkInterpolate([t[e - 6]], t[e - 2]), l.updateLink([t[e - 6]], t[e]); break; case 125: this.$ = t[e - 8], l.updateLinkInterpolate(t[e - 6], t[e - 2]), l.updateLink(t[e - 6], t[e]); break; case 126: this.$ = t[e - 6], l.updateLinkInterpolate([t[e - 4]], t[e]); break; case 127: this.$ = t[e - 6], l.updateLinkInterpolate(t[e - 4], t[e]); break; case 128: case 130: this.$ = [t[e]]; break; case 129: case 131: t[e - 2].push(t[e]), this.$ = t[e - 2]; break; case 133: this.$ = t[e - 1] + t[e]; break; case 181: this.$ = t[e]; break; case 182: this.$ = t[e - 1] + "" + t[e]; break; case 184: this.$ = t[e - 1] + "" + t[e]; break; case 185: this.$ = { stmt: "dir", value: "TB" }; break; case 186: this.$ = { stmt: "dir", value: "BT" }; break; case 187: this.$ = { stmt: "dir", value: "RL" }; break; case 188: this.$ = { stmt: "dir", value: "LR" }; break; } }, "anonymous"), table: [{ 3: 1, 4: 2, 9: i, 10: a, 12: n }, { 1: [3] }, s(u, o, { 5: 6 }), { 4: 7, 9: i, 10: a, 12: n }, { 4: 8, 9: i, 10: a, 12: n }, { 13: [1, 9], 14: [1, 10] }, { 1: [2, 1], 6: 11, 7: 12, 8: f, 9: c, 10: A, 11: r, 20: 17, 22: 18, 23: 19, 24: 20, 25: 21, 26: 22, 27: k, 33: 24, 34: E, 36: b, 38: L, 42: 28, 43: 38, 44: C, 45: 39, 47: 40, 60: p, 84: J, 85: W, 86: Z, 87: A1, 88: M1, 89: V, 102: I, 105: w, 106: R, 109: N, 111: G, 113: 41, 114: P, 115: O, 116: M, 121: U1, 122: W1, 123: z1, 124: j1 }, s(u, [2, 9]), s(u, [2, 10]), s(u, [2, 11]), { 8: [1, 54], 9: [1, 55], 10: p1, 15: 53, 18: 56 }, s(y, [2, 3]), s(y, [2, 4]), s(y, [2, 5]), s(y, [2, 6]), s(y, [2, 7]), s(y, [2, 8]), { 8: e1, 9: s1, 11: i1, 21: 58, 41: 59, 72: 63, 75: [1, 64], 77: [1, 66], 78: [1, 65] }, { 8: e1, 9: s1, 11: i1, 21: 67 }, { 8: e1, 9: s1, 11: i1, 21: 68 }, { 8: e1, 9: s1, 11: i1, 21: 69 }, { 8: e1, 9: s1, 11: i1, 21: 70 }, { 8: e1, 9: s1, 11: i1, 21: 71 }, { 8: e1, 9: s1, 10: [1, 72], 11: i1, 21: 73 }, s(y, [2, 36]), { 35: [1, 74] }, { 37: [1, 75] }, s(y, [2, 39]), s(D1, [2, 50], { 18: 76, 39: 77, 10: p1, 40: at }), { 10: [1, 79] }, { 10: [1, 80] }, { 10: [1, 81] }, { 10: [1, 82] }, { 14: x1, 44: T1, 60: E1, 80: [1, 86], 89: y1, 95: [1, 83], 97: [1, 84], 101: 85, 105: F1, 106: _1, 109: B1, 111: v1, 114: L1, 115: V1, 116: I1, 120: 87 }, s(y, [2, 185]), s(y, [2, 186]), s(y, [2, 187]), s(y, [2, 188]), s(k1, [2, 51]), s(k1, [2, 54], { 46: [1, 99] }), s(z, [2, 72], { 113: 112, 29: [1, 100], 44: C, 48: [1, 101], 50: [1, 102], 52: [1, 103], 54: [1, 104], 56: [1, 105], 58: [1, 106], 60: p, 63: [1, 107], 65: [1, 108], 67: [1, 109], 68: [1, 110], 70: [1, 111], 89: V, 102: I, 105: w, 106: R, 109: N, 111: G, 114: P, 115: O, 116: M }), s(q, [2, 181]), s(q, [2, 142]), s(q, [2, 143]), s(q, [2, 144]), s(q, [2, 145]), s(q, [2, 146]), s(q, [2, 147]), s(q, [2, 148]), s(q, [2, 149]), s(q, [2, 150]), s(q, [2, 151]), s(q, [2, 152]), s(u, [2, 12]), s(u, [2, 18]), s(u, [2, 19]), { 9: [1, 113] }, s(nt, [2, 26], { 18: 114, 10: p1 }), s(y, [2, 27]), { 42: 115, 43: 38, 44: C, 45: 39, 47: 40, 60: p, 89: V, 102: I, 105: w, 106: R, 109: N, 111: G, 113: 41, 114: P, 115: O, 116: M }, s(y, [2, 40]), s(y, [2, 41]), s(y, [2, 42]), s(w1, [2, 76], { 73: 116, 62: [1, 118], 74: [1, 117] }), { 76: 119, 79: 120, 80: ut, 81: ot, 116: K1, 119: Y1 }, { 75: [1, 125], 77: [1, 126] }, s(lt, [2, 83]), s(y, [2, 28]), s(y, [2, 29]), s(y, [2, 30]), s(y, [2, 31]), s(y, [2, 32]), { 10: ct, 12: ht, 14: dt, 27: pt, 28: 127, 32: ft, 44: gt, 60: bt, 75: At, 80: [1, 129], 81: [1, 130], 83: 140, 84: kt, 85: mt, 86: Ct, 87: St, 88: Dt, 89: xt, 90: Tt, 91: 128, 105: Et, 109: yt, 111: Ft, 114: _t, 115: Bt, 116: vt }, s(Q1, o, { 5: 153 }), s(y, [2, 37]), s(y, [2, 38]), s(D1, [2, 48], { 44: Lt }), s(D1, [2, 49], { 18: 155, 10: p1, 40: Vt }), s(k1, [2, 44]), { 44: C, 47: 157, 60: p, 89: V, 102: I, 105: w, 106: R, 109: N, 111: G, 113: 41, 114: P, 115: O, 116: M }, { 102: [1, 158], 103: 159, 105: [1, 160] }, { 44: C, 47: 161, 60: p, 89: V, 102: I, 105: w, 106: R, 109: N, 111: G, 113: 41, 114: P, 115: O, 116: M }, { 44: C, 47: 162, 60: p, 89: V, 102: I, 105: w, 106: R, 109: N, 111: G, 113: 41, 114: P, 115: O, 116: M }, s(B, [2, 107], { 10: [1, 163], 96: [1, 164] }), { 80: [1, 165] }, s(B, [2, 115], { 120: 167, 10: [1, 166], 14: x1, 44: T1, 60: E1, 89: y1, 105: F1, 106: _1, 109: B1, 111: v1, 114: L1, 115: V1, 116: I1 }), s(B, [2, 117], { 10: [1, 168] }), s(H, [2, 183]), s(H, [2, 170]), s(H, [2, 171]), s(H, [2, 172]), s(H, [2, 173]), s(H, [2, 174]), s(H, [2, 175]), s(H, [2, 176]), s(H, [2, 177]), s(H, [2, 178]), s(H, [2, 179]), s(H, [2, 180]), { 44: C, 47: 169, 60: p, 89: V, 102: I, 105: w, 106: R, 109: N, 111: G, 113: 41, 114: P, 115: O, 116: M }, { 30: 170, 67: S, 80: j, 81: K, 82: 171, 116: D, 117: x, 118: T }, { 30: 178, 67: S, 80: j, 81: K, 82: 171, 116: D, 117: x, 118: T }, { 30: 180, 50: [1, 179], 67: S, 80: j, 81: K, 82: 171, 116: D, 117: x, 118: T }, { 30: 181, 67: S, 80: j, 81: K, 82: 171, 116: D, 117: x, 118: T }, { 30: 182, 67: S, 80: j, 81: K, 82: 171, 116: D, 117: x, 118: T }, { 30: 183, 67: S, 80: j, 81: K, 82: 171, 116: D, 117: x, 118: T }, { 109: [1, 184] }, { 30: 185, 67: S, 80: j, 81: K, 82: 171, 116: D, 117: x, 118: T }, { 30: 186, 65: [1, 187], 67: S, 80: j, 81: K, 82: 171, 116: D, 117: x, 118: T }, { 30: 188, 67: S, 80: j, 81: K, 82: 171, 116: D, 117: x, 118: T }, { 30: 189, 67: S, 80: j, 81: K, 82: 171, 116: D, 117: x, 118: T }, { 30: 190, 67: S, 80: j, 81: K, 82: 171, 116: D, 117: x, 118: T }, s(q, [2, 182]), s(u, [2, 20]), s(nt, [2, 25]), s(D1, [2, 46], { 39: 191, 18: 192, 10: p1, 40: at }), s(w1, [2, 73], { 10: [1, 193] }), { 10: [1, 194] }, { 30: 195, 67: S, 80: j, 81: K, 82: 171, 116: D, 117: x, 118: T }, { 77: [1, 196], 79: 197, 116: K1, 119: Y1 }, s(R1, [2, 79]), s(R1, [2, 81]), s(R1, [2, 82]), s(R1, [2, 168]), s(R1, [2, 169]), { 76: 198, 79: 120, 80: ut, 81: ot, 116: K1, 119: Y1 }, s(lt, [2, 84]), { 8: e1, 9: s1, 10: ct, 11: i1, 12: ht, 14: dt, 21: 200, 27: pt, 29: [1, 199], 32: ft, 44: gt, 60: bt, 75: At, 83: 140, 84: kt, 85: mt, 86: Ct, 87: St, 88: Dt, 89: xt, 90: Tt, 91: 201, 105: Et, 109: yt, 111: Ft, 114: _t, 115: Bt, 116: vt }, s(F, [2, 101]), s(F, [2, 103]), s(F, [2, 104]), s(F, [2, 157]), s(F, [2, 158]), s(F, [2, 159]), s(F, [2, 160]), s(F, [2, 161]), s(F, [2, 162]), s(F, [2, 163]), s(F, [2, 164]), s(F, [2, 165]), s(F, [2, 166]), s(F, [2, 167]), s(F, [2, 90]), s(F, [2, 91]), s(F, [2, 92]), s(F, [2, 93]), s(F, [2, 94]), s(F, [2, 95]), s(F, [2, 96]), s(F, [2, 97]), s(F, [2, 98]), s(F, [2, 99]), s(F, [2, 100]), { 6: 11, 7: 12, 8: f, 9: c, 10: A, 11: r, 20: 17, 22: 18, 23: 19, 24: 20, 25: 21, 26: 22, 27: k, 32: [1, 202], 33: 24, 34: E, 36: b, 38: L, 42: 28, 43: 38, 44: C, 45: 39, 47: 40, 60: p, 84: J, 85: W, 86: Z, 87: A1, 88: M1, 89: V, 102: I, 105: w, 106: R, 109: N, 111: G, 113: 41, 114: P, 115: O, 116: M, 121: U1, 122: W1, 123: z1, 124: j1 }, { 10: p1, 18: 203 }, { 44: [1, 204] }, s(k1, [2, 43]), { 10: [1, 205], 44: C, 60: p, 89: V, 102: I, 105: w, 106: R, 109: N, 111: G, 113: 112, 114: P, 115: O, 116: M }, { 10: [1, 206] }, { 10: [1, 207], 106: [1, 208] }, s(It, [2, 128]), { 10: [1, 209], 44: C, 60: p, 89: V, 102: I, 105: w, 106: R, 109: N, 111: G, 113: 112, 114: P, 115: O, 116: M }, { 10: [1, 210], 44: C, 60: p, 89: V, 102: I, 105: w, 106: R, 109: N, 111: G, 113: 112, 114: P, 115: O, 116: M }, { 80: [1, 211] }, s(B, [2, 109], { 10: [1, 212] }), s(B, [2, 111], { 10: [1, 213] }), { 80: [1, 214] }, s(H, [2, 184]), { 80: [1, 215], 98: [1, 216] }, s(k1, [2, 55], { 113: 112, 44: C, 60: p, 89: V, 102: I, 105: w, 106: R, 109: N, 111: G, 114: P, 115: O, 116: M }), { 31: [1, 217], 67: S, 82: 218, 116: D, 117: x, 118: T }, s(f1, [2, 86]), s(f1, [2, 88]), s(f1, [2, 89]), s(f1, [2, 153]), s(f1, [2, 154]), s(f1, [2, 155]), s(f1, [2, 156]), { 49: [1, 219], 67: S, 82: 218, 116: D, 117: x, 118: T }, { 30: 220, 67: S, 80: j, 81: K, 82: 171, 116: D, 117: x, 118: T }, { 51: [1, 221], 67: S, 82: 218, 116: D, 117: x, 118: T }, { 53: [1, 222], 67: S, 82: 218, 116: D, 117: x, 118: T }, { 55: [1, 223], 67: S, 82: 218, 116: D, 117: x, 118: T }, { 57: [1, 224], 67: S, 82: 218, 116: D, 117: x, 118: T }, { 60: [1, 225] }, { 64: [1, 226], 67: S, 82: 218, 116: D, 117: x, 118: T }, { 66: [1, 227], 67: S, 82: 218, 116: D, 117: x, 118: T }, { 30: 228, 67: S, 80: j, 81: K, 82: 171, 116: D, 117: x, 118: T }, { 31: [1, 229], 67: S, 82: 218, 116: D, 117: x, 118: T }, { 67: S, 69: [1, 230], 71: [1, 231], 82: 218, 116: D, 117: x, 118: T }, { 67: S, 69: [1, 233], 71: [1, 232], 82: 218, 116: D, 117: x, 118: T }, s(D1, [2, 45], { 18: 155, 10: p1, 40: Vt }), s(D1, [2, 47], { 44: Lt }), s(w1, [2, 75]), s(w1, [2, 74]), { 62: [1, 234], 67: S, 82: 218, 116: D, 117: x, 118: T }, s(w1, [2, 77]), s(R1, [2, 80]), { 77: [1, 235], 79: 197, 116: K1, 119: Y1 }, { 30: 236, 67: S, 80: j, 81: K, 82: 171, 116: D, 117: x, 118: T }, s(Q1, o, { 5: 237 }), s(F, [2, 102]), s(y, [2, 35]), { 43: 238, 44: C, 45: 39, 47: 40, 60: p, 89: V, 102: I, 105: w, 106: R, 109: N, 111: G, 113: 41, 114: P, 115: O, 116: M }, { 10: p1, 18: 239 }, { 10: r1, 60: a1, 84: n1, 92: 240, 105: u1, 107: 241, 108: 242, 109: o1, 110: l1, 111: c1, 112: h1 }, { 10: r1, 60: a1, 84: n1, 92: 251, 104: [1, 252], 105: u1, 107: 241, 108: 242, 109: o1, 110: l1, 111: c1, 112: h1 }, { 10: r1, 60: a1, 84: n1, 92: 253, 104: [1, 254], 105: u1, 107: 241, 108: 242, 109: o1, 110: l1, 111: c1, 112: h1 }, { 105: [1, 255] }, { 10: r1, 60: a1, 84: n1, 92: 256, 105: u1, 107: 241, 108: 242, 109: o1, 110: l1, 111: c1, 112: h1 }, { 44: C, 47: 257, 60: p, 89: V, 102: I, 105: w, 106: R, 109: N, 111: G, 113: 41, 114: P, 115: O, 116: M }, s(B, [2, 108]), { 80: [1, 258] }, { 80: [1, 259], 98: [1, 260] }, s(B, [2, 116]), s(B, [2, 118], { 10: [1, 261] }), s(B, [2, 119]), s(z, [2, 56]), s(f1, [2, 87]), s(z, [2, 57]), { 51: [1, 262], 67: S, 82: 218, 116: D, 117: x, 118: T }, s(z, [2, 64]), s(z, [2, 59]), s(z, [2, 60]), s(z, [2, 61]), { 109: [1, 263] }, s(z, [2, 63]), s(z, [2, 65]), { 66: [1, 264], 67: S, 82: 218, 116: D, 117: x, 118: T }, s(z, [2, 67]), s(z, [2, 68]), s(z, [2, 70]), s(z, [2, 69]), s(z, [2, 71]), s([10, 44, 60, 89, 102, 105, 106, 109, 111, 114, 115, 116], [2, 85]), s(w1, [2, 78]), { 31: [1, 265], 67: S, 82: 218, 116: D, 117: x, 118: T }, { 6: 11, 7: 12, 8: f, 9: c, 10: A, 11: r, 20: 17, 22: 18, 23: 19, 24: 20, 25: 21, 26: 22, 27: k, 32: [1, 266], 33: 24, 34: E, 36: b, 38: L, 42: 28, 43: 38, 44: C, 45: 39, 47: 40, 60: p, 84: J, 85: W, 86: Z, 87: A1, 88: M1, 89: V, 102: I, 105: w, 106: R, 109: N, 111: G, 113: 41, 114: P, 115: O, 116: M, 121: U1, 122: W1, 123: z1, 124: j1 }, s(k1, [2, 53]), { 43: 267, 44: C, 45: 39, 47: 40, 60: p, 89: V, 102: I, 105: w, 106: R, 109: N, 111: G, 113: 41, 114: P, 115: O, 116: M }, s(B, [2, 121], { 106: N1 }), s(wt, [2, 130], { 108: 269, 10: r1, 60: a1, 84: n1, 105: u1, 109: o1, 110: l1, 111: c1, 112: h1 }), s($, [2, 132]), s($, [2, 134]), s($, [2, 135]), s($, [2, 136]), s($, [2, 137]), s($, [2, 138]), s($, [2, 139]), s($, [2, 140]), s($, [2, 141]), s(B, [2, 122], { 106: N1 }), { 10: [1, 270] }, s(B, [2, 123], { 106: N1 }), { 10: [1, 271] }, s(It, [2, 129]), s(B, [2, 105], { 106: N1 }), s(B, [2, 106], { 113: 112, 44: C, 60: p, 89: V, 102: I, 105: w, 106: R, 109: N, 111: G, 114: P, 115: O, 116: M }), s(B, [2, 110]), s(B, [2, 112], { 10: [1, 272] }), s(B, [2, 113]), { 98: [1, 273] }, { 51: [1, 274] }, { 62: [1, 275] }, { 66: [1, 276] }, { 8: e1, 9: s1, 11: i1, 21: 277 }, s(y, [2, 34]), s(k1, [2, 52]), { 10: r1, 60: a1, 84: n1, 105: u1, 107: 278, 108: 242, 109: o1, 110: l1, 111: c1, 112: h1 }, s($, [2, 133]), { 14: x1, 44: T1, 60: E1, 89: y1, 101: 279, 105: F1, 106: _1, 109: B1, 111: v1, 114: L1, 115: V1, 116: I1, 120: 87 }, { 14: x1, 44: T1, 60: E1, 89: y1, 101: 280, 105: F1, 106: _1, 109: B1, 111: v1, 114: L1, 115: V1, 116: I1, 120: 87 }, { 98: [1, 281] }, s(B, [2, 120]), s(z, [2, 58]), { 30: 282, 67: S, 80: j, 81: K, 82: 171, 116: D, 117: x, 118: T }, s(z, [2, 66]), s(Q1, o, { 5: 283 }), s(wt, [2, 131], { 108: 269, 10: r1, 60: a1, 84: n1, 105: u1, 109: o1, 110: l1, 111: c1, 112: h1 }), s(B, [2, 126], { 120: 167, 10: [1, 284], 14: x1, 44: T1, 60: E1, 89: y1, 105: F1, 106: _1, 109: B1, 111: v1, 114: L1, 115: V1, 116: I1 }), s(B, [2, 127], { 120: 167, 10: [1, 285], 14: x1, 44: T1, 60: E1, 89: y1, 105: F1, 106: _1, 109: B1, 111: v1, 114: L1, 115: V1, 116: I1 }), s(B, [2, 114]), { 31: [1, 286], 67: S, 82: 218, 116: D, 117: x, 118: T }, { 6: 11, 7: 12, 8: f, 9: c, 10: A, 11: r, 20: 17, 22: 18, 23: 19, 24: 20, 25: 21, 26: 22, 27: k, 32: [1, 287], 33: 24, 34: E, 36: b, 38: L, 42: 28, 43: 38, 44: C, 45: 39, 47: 40, 60: p, 84: J, 85: W, 86: Z, 87: A1, 88: M1, 89: V, 102: I, 105: w, 106: R, 109: N, 111: G, 113: 41, 114: P, 115: O, 116: M, 121: U1, 122: W1, 123: z1, 124: j1 }, { 10: r1, 60: a1, 84: n1, 92: 288, 105: u1, 107: 241, 108: 242, 109: o1, 110: l1, 111: c1, 112: h1 }, { 10: r1, 60: a1, 84: n1, 92: 289, 105: u1, 107: 241, 108: 242, 109: o1, 110: l1, 111: c1, 112: h1 }, s(z, [2, 62]), s(y, [2, 33]), s(B, [2, 124], { 106: N1 }), s(B, [2, 125], { 106: N1 })], defaultActions: {}, parseError: /* @__PURE__ */ m(function(h, d) { if (d.recoverable) this.trace(h); else { var g = new Error(h); throw g.hash = d, g; } }, "parseError"), parse: /* @__PURE__ */ m(function(h) { var d = this, g = [0], l = [], _ = [null], t = [], O1 = this.table, e = "", v = 0, Rt = 0, zt = 2, Nt = 1, jt = t.slice.call(arguments, 1), U = Object.create(this.lexer), m1 = { yy: {} }; for (var Z1 in this.yy) Object.prototype.hasOwnProperty.call(this.yy, Z1) && (m1.yy[Z1] = this.yy[Z1]); U.setInput(h, m1.yy), m1.yy.lexer = U, m1.yy.parser = this, typeof U.yylloc > "u" && (U.yylloc = {}); var $1 = U.yylloc; t.push($1); var Kt = U.options && U.options.ranges; typeof m1.yy.parseError == "function" ? this.parseError = m1.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError; function Yt(X) { g.length = g.length - 2 * X, _.length = _.length - X, t.length = t.length - X; } m(Yt, "popStack"); function Gt() { var X; return X = l.pop() || U.lex() || Nt, typeof X != "number" && (X instanceof Array && (l = X, X = l.pop()), X = d.symbols_[X] || X), X; } m(Gt, "lex"); for (var Y, C1, Q, tt, G1 = {}, H1, d1, Pt, X1; ; ) { if (C1 = g[g.length - 1], this.defaultActions[C1] ? Q = this.defaultActions[C1] : ((Y === null || typeof Y > "u") && (Y = Gt()), Q = O1[C1] && O1[C1][Y]), typeof Q > "u" || !Q.length || !Q[0]) { var et = ""; X1 = []; for (H1 in O1[C1]) this.terminals_[H1] && H1 > zt && X1.push("'" + this.terminals_[H1] + "'"); U.showPosition ? et = "Parse error on line " + (v + 1) + `:` + U.showPosition() + `Expecting ` + X1.join(", ") + ", got '" + (this.terminals_[Y] || Y) + "'" : et = "Parse error on line " + (v + 1) + ": Unexpected " + (Y == Nt ? "end of input" : "'" + (this.terminals_[Y] || Y) + "'"), this.parseError(et, { text: U.match, token: this.terminals_[Y] || Y, line: U.yylineno, loc: $1, expected: X1 }); } if (Q[0] instanceof Array && Q.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + C1 + ", token: " + Y); switch (Q[0]) { case 1: g.push(Y), _.push(U.yytext), t.push(U.yylloc), g.push(Q[1]), Y = null, Rt = U.yyleng, e = U.yytext, v = U.yylineno, $1 = U.yylloc; break; case 2: if (d1 = this.productions_[Q[1]][1], G1.$ = _[_.length - d1], G1._$ = { first_line: t[t.length - (d1 || 1)].first_line, last_line: t[t.length - 1].last_line, first_column: t[t.length - (d1 || 1)].first_column, last_column: t[t.length - 1].last_column }, Kt && (G1._$.range = [ t[t.length - (d1 || 1)].range[0], t[t.length - 1].range[1] ]), tt = this.performAction.apply(G1, [ e, Rt, v, m1.yy, Q[1], _, t ].concat(jt)), typeof tt < "u") return tt; d1 && (g = g.slice(0, -1 * d1 * 2), _ = _.slice(0, -1 * d1), t = t.slice(0, -1 * d1)), g.push(this.productions_[Q[1]][0]), _.push(G1.$), t.push(G1._$), Pt = O1[g[g.length - 2]][g[g.length - 1]], g.push(Pt); break; case 3: return !0; } } return !0; }, "parse") }, Wt = /* @__PURE__ */ function() { var g1 = { EOF: 1, parseError: /* @__PURE__ */ m(function(d, g) { if (this.yy.parser) this.yy.parser.parseError(d, g); else throw new Error(d); }, "parseError"), // resets the lexer, sets new input setInput: /* @__PURE__ */ m(function(h, d) { return this.yy = d || this.yy || {}, this._input = h, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this; }, "setInput"), // consumes and returns one char from the input input: /* @__PURE__ */ m(function() { var h = this._input[0]; this.yytext += h, this.yyleng++, this.offset++, this.match += h, this.matched += h; var d = h.match(/(?:\r\n?|\n).*/g); return d ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), h; }, "input"), // unshifts one char (or a string) into the input unput: /* @__PURE__ */ m(function(h) { var d = h.length, g = h.split(/(?:\r\n?|\n)/g); this._input = h + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - d), this.offset -= d; var l = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), g.length - 1 && (this.yylineno -= g.length - 1); var _ = this.yylloc.range; return this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: g ? (g.length === l.length ? this.yylloc.first_column : 0) + l[l.length - g.length].length - g[0].length : this.yylloc.first_column - d }, this.options.ranges && (this.yylloc.range = [_[0], _[0] + this.yyleng - d]), this.yyleng = this.yytext.length, this; }, "unput"), // When called from action, caches matched text and appends it on next action more: /* @__PURE__ */ m(function() { return this._more = !0, this; }, "more"), // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject: /* @__PURE__ */ m(function() { if (this.options.backtrack_lexer) this._backtrack = !0; else return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).` + this.showPosition(), { text: "", token: null, line: this.yylineno }); return this; }, "reject"), // retain first n characters of the match less: /* @__PURE__ */ m(function(h) { this.unput(this.match.slice(h)); }, "less"), // displays already matched input, i.e. for error messages pastInput: /* @__PURE__ */ m(function() { var h = this.matched.substr(0, this.matched.length - this.match.length); return (h.length > 20 ? "..." : "") + h.substr(-20).replace(/\n/g, ""); }, "pastInput"), // displays upcoming input, i.e. for error messages upcomingInput: /* @__PURE__ */ m(function() { var h = this.match; return h.length < 20 && (h += this._input.substr(0, 20 - h.length)), (h.substr(0, 20) + (h.length > 20 ? "..." : "")).replace(/\n/g, ""); }, "upcomingInput"), // displays the character position where the lexing error occurred, i.e. for error messages showPosition: /* @__PURE__ */ m(function() { var h = this.pastInput(), d = new Array(h.length + 1).join("-"); return h + this.upcomingInput() + `` + d + "^"; }, "showPosition"), // test the lexed token: return FALSE when not a match, otherwise return token test_match: /* @__PURE__ */ m(function(h, d) { var g, l, _; if (this.options.backtrack_lexer && (_ = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }, this.options.ranges && (_.yylloc.range = this.yylloc.range.slice(0))), l = h[0].match(/(?:\r\n?|\n).*/g), l && (this.yylineno += l.length), this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: l ? l[l.length - 1].length - l[l.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + h[0].length }, this.yytext += h[0], this.match += h[0], this.matches = h, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(h[0].length), this.matched += h[0], g = this.performAction.call(this, this.yy, this, d, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), g) return g; if (this._backtrack) { for (var t in _) this[t] = _[t]; return !1; } return !1; }, "test_match"), // return next match in input next: /* @__PURE__ */ m(function() { if (this.done) return this.EOF; this._input || (this.done = !0); var h, d, g, l; this._more || (this.yytext = "", this.match = ""); for (var _ = this._currentRules(), t = 0; t < _.length; t++) if (g = this._input.match(this.rules[_[t]]), g && (!d || g[0].length > d[0].length)) { if (d = g, l = t, this.options.backtrack_lexer) { if (h = this.test_match(g, _[t]), h !== !1) return h; if (this._backtrack) { d = !1; continue; } else return !1; } else if (!this.options.flex) break; } return d ? (h = this.test_match(d, _[l]), h !== !1 ? h : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.` + this.showPosition(), { text: "", token: null, line: this.yylineno }); }, "next"), // return next match that has a token lex: /* @__PURE__ */ m(function() { var d = this.next(); return d || this.lex(); }, "lex"), // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin: /* @__PURE__ */ m(function(d) { this.conditionStack.push(d); }, "begin"), // pop the previously active lexer condition state off the condition stack popState: /* @__PURE__ */ m(function() { var d = this.conditionStack.length - 1; return d > 0 ? this.conditionStack.pop() : this.conditionStack[0]; }, "popState"), // produce the lexer rule set which is active for the currently active lexer condition state _currentRules: /* @__PURE__ */ m(function() { return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules; }, "_currentRules"), // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState: /* @__PURE__ */ m(function(d) { return d = this.conditionStack.length - 1 - Math.abs(d || 0), d >= 0 ? this.conditionStack[d] : "INITIAL"; }, "topState"), // alias for begin(condition) pushState: /* @__PURE__ */ m(function(d) { this.begin(d); }, "pushState"), // return the number of states currently on the stack stateStackSize: /* @__PURE__ */ m(function() { return this.conditionStack.length; }, "stateStackSize"), options: {}, performAction: /* @__PURE__ */ m(function(d, g, l, _) { switch (l) { case 0: return this.begin("acc_title"), 34; case 1: return this.popState(), "acc_title_value"; case 2: return this.begin("acc_descr"), 36; case 3: return this.popState(), "acc_descr_value"; case 4: this.begin("acc_descr_multiline"); break; case 5: this.popState(); break; case 6: return "acc_descr_multiline_value"; case 7: return this.pushState("shapeData"), g.yytext = "", 40; case 8: return this.pushState("shapeDataStr"), 40; case 9: return this.popState(), 40; case 10: const t = /\n\s*/g; return g.yytext = g.yytext.replace(t, "<br/>"), 40; case 11: return 40; case 12: this.popState(); break; case 13: this.begin("callbackname"); break; case 14: this.popState(); break; case 15: this.popState(), this.begin("callbackargs"); break; case 16: return 95; case 17: this.popState(); break; case 18: return 96; case 19: return "MD_STR"; case 20: this.popState(); break; case 21: this.begin("md_string"); break; case 22: return "STR"; case 23: this.popState(); break; case 24: this.pushState("string"); break; case 25: return 84; case 26: return 102; case 27: return 85; case 28: return 104; case 29: return 86; case 30: return 87; case 31: return 97; case 32: this.begin("click"); break; case 33: this.popState(); break; case 34: return 88; case 35: return d.lex.firstGraph() && this.begin("dir"), 12; case 36: return d.lex.firstGraph() && this.begin("dir"), 12; case 37: return d.lex.firstGraph() && this.begin("dir"), 12; case 38: return 27; case 39: return 32; case 40: return 98; case 41: return 98; case 42: return 98; case 43: return 98; case 44: return this.popState(), 13; case 45: return this.popState(), 14; case 46: return this.popState(), 14; case 47: return this.popState(), 14; case 48: return this.popState(), 14; case 49: return this.popState(), 14; case 50: return this.popState(), 14; case 51: return this.popState(), 14; case 52: return this.popState(), 14; case 53: return this.popState(), 14; case 54: return this.popState(), 14; case 55: return 121; case 56: return 122; case 57: return 123; case 58: return 124; case 59: return 78; case 60: return 105; case 61: return 111; case 62: return 46; case 63: return 60; case 64: return 44; case 65: return 8; case 66: return 106; case 67: return 115; case 68: return this.popState(), 77; case 69: return this.pushState("edgeText"), 75; case 70: return 119; case 71: return this.popState(), 77; case 72: return this.pushState("thickEdgeText"), 75; case 73: return 119; case 74: return this.popState(), 77; case 75: return this.pushState("dottedEdgeText"), 75; case 76: return 119; case 77: return 77; case 78: return this.popState(), 53; case 79: return "TEXT"; case 80: return this.pushState("ellipseText"), 52; case 81: return this.popState(), 55; case 82: return this.pushState("text"), 54; case 83: return this.popState(), 57; case 84: return this.pushState("text"), 56; case 85: return 58; case 86: return this.pushState("text"), 67; case 87: return this.popState(), 64; case 88: return this.pushState("text"), 63; case 89: return this.popState(), 49; case 90: return this.pushState("text"), 48; case 91: return this.popState(), 69; case 92: return this.popState(), 71; case 93: return 117; case 94: return this.pushState("trapText"), 68; case 95: return this.pushState("trapText"), 70; case 96: return 118; case 97: return 67; case 98: return 90; case 99: return "SEP"; case 100: return 89; case 101: return 115; case 102: return 111; case 103: return 44; case 104: return 109; case 105: return 114; case 106: return 116; case 107: return this.popState(), 62; case 108: return this.pushState("text"), 62; case 109: return this.popState(), 51; case 110: return this.pushState("text"), 50; case 111: return this.popState(), 31; case 112: return this.pushState("text"), 29; case 113: return this.popState(), 66; case 114: return this.pushState("text"), 65; case 115: return "TEXT"; case 116: return "QUOTE"; case 117: return 9; case 118: return 10; case 119: return 11; } }, "anonymous"), rules: [/^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:@\{)/, /^(?:["])/, /^(?:["])/, /^(?:[^\"]+)/, /^(?:[^}^"]+)/, /^(?:\})/, /^(?:call[\s]+)/, /^(?:\([\s]*\))/, /^(?:\()/, /^(?:[^(]*)/, /^(?:\))/, /^(?:[^)]*)/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["][`])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:["])/, /^(?:style\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\b)/, /^(?:class\b)/, /^(?:href[\s])/, /^(?:click[\s]+)/, /^(?:[\s\n])/, /^(?:[^\s\n]*)/, /^(?:flowchart-elk\b)/, /^(?:graph\b)/, /^(?:flowchart\b)/, /^(?:subgraph\b)/, /^(?:end\b\s*)/, /^(?:_self\b)/, /^(?:_blank\b)/, /^(?:_parent\b)/, /^(?:_top\b)/, /^(?:(\r?\n)*\s*\n)/, /^(?:\s*LR\b)/, /^(?:\s*RL\b)/, /^(?:\s*TB\b)/, /^(?:\s*BT\b)/, /^(?:\s*TD\b)/, /^(?:\s*BR\b)/, /^(?:\s*<)/, /^(?:\s*>)/, /^(?:\s*\^)/, /^(?:\s*v\b)/, /^(?:.*direction\s+TB[^\n]*)/, /^(?:.*direction\s+BT[^\n]*)/, /^(?:.*direction\s+RL[^\n]*)/, /^(?:.*direction\s+LR[^\n]*)/, /^(?:[^\s\"]+@(?=[^\{\"]))/, /^(?:[0-9]+)/, /^(?:#)/, /^(?::::)/, /^(?::)/, /^(?:&)/, /^(?:;)/, /^(?:,)/, /^(?:\*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:[^-]|-(?!-)+)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:[^=]|=(?!))/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:[^\.]|\.(?!))/, /^(?:\s*~~[\~]+\s*)/, /^(?:[-/\)][\)])/, /^(?:[^\(\)\[\]\{\}]|!\)+)/, /^(?:\(-)/, /^(?:\]\))/, /^(?:\(\[)/, /^(?:\]\])/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:>)/, /^(?:\)\])/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\(\(\()/, /^(?:[\\(?=\])][\]])/, /^(?:\/(?=\])\])/, /^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:<)/, /^(?:>)/, /^(?:\^)/, /^(?:\\\|)/, /^(?:v\b)/, /^(?:\*)/, /^(?:#)/, /^(?:&)/, /^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/, /^(?:-)/, /^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/, /^(?:\|)/, /^(?:\|)/, /^(?:\))/, /^(?:\()/, /^(?:\])/, /^(?:\[)/, /^(?:(\}))/, /^(?:\{)/, /^(?:[^\[\]\(\)\{\}\|\"]+)/, /^(?:")/, /^(?:(\r?\n)+)/, /^(?:\s)/, /^(?:$)/], conditions: { shapeDataEndBracket: { rules: [21, 24, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], inclusive: !1 }, shapeDataStr: { rules: [9, 10, 21, 24, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], inclusive: !1 }, shapeData: { rules: [8, 11, 12, 21, 24, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], inclusive: !1 }, callbackargs: { rules: [17, 18, 21, 24, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], inclusive: !1 }, callbackname: { rules: [14, 15, 16, 21, 24, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], inclusive: !1 }, href: { rules: [21, 24, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], inclusive: !1 }, click: { rules: [21, 24, 33, 34, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], inclusive: !1 }, dottedEdgeText: { rules: [21, 24, 74, 76, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], inclusive: !1 }, thickEdgeText: { rules: [21, 24, 71, 73, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], inclusive: !1 }, edgeText: { rules: [21, 24, 68, 70, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], inclusive: !1 }, trapText: { rules: [21, 24, 77, 80, 82, 84, 88, 90, 91, 92, 93, 94, 95, 108, 110, 112, 114], inclusive: !1 }, ellipseText: { rules: [21, 24, 77, 78, 79, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], inclusive: !1 }, text: { rules: [21, 24, 77, 80, 81, 82, 83, 84, 87, 88, 89, 90, 94, 95, 107, 108, 109, 110, 111, 112, 113, 114, 115], inclusive: !1 }, vertex: { rules: [21, 24, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], inclusive: !1 }, dir: { rules: [21, 24, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], inclusive: !1 }, acc_descr_multiline: { rules: [5, 6, 21, 24, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], inclusive: !1 }, acc_descr: { rules: [3, 21, 24, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], inclusive: !1 }, acc_title: { rules: [1, 21, 24, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], inclusive: !1 }, md_string: { rules: [19, 20, 21, 24, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], inclusive: !1 }, string: { rules: [21, 22, 23, 24, 77, 80, 82, 84, 88, 90, 94, 95, 108, 110, 112, 114], inclusive: !1 }, INITIAL: { rules: [0, 2, 4, 7, 13, 21, 24, 25, 26, 27, 28, 29, 30, 31, 32, 35, 36, 37, 38, 39, 40, 41, 42, 43, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 71, 72, 74, 75, 77, 80, 82, 84, 85, 86, 88, 90, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 108, 110, 112, 114, 116, 117, 118, 119], inclusive: !0 } } }; return g1; }(); J1.lexer = Wt; function q1() { this.yy = {}; } return m(q1, "Parser"), q1.prototype = J1, J1.Parser = q1, new q1();}();rt.parser = rt;var Mt = rt, Ut = Object.assign({}, Mt);Ut.parse = (s) => { const i = s.replace(/}\s*\n/g, `}`); return Mt.parse(i);};var Ae = Ut, ke = /* @__PURE__ */ m((s, i) => { const a = he, n = a(s, "r"), u = a(s, "g"), o = a(s, "b"); return oe(n, u, o, i);}, "fade"), me = /* @__PURE__ */ m((s) => `.label { font-family: ${s.fontFamily}; color: ${s.nodeTextColor || s.textColor}; } .cluster-label text { fill: ${s.titleColor}; } .cluster-label span { color: ${s.titleColor}; } .cluster-label span p { background-color: transparent; }
.label text,span { fill: ${s.nodeTextColor || s.textColor}; color: ${s.nodeTextColor || s.textColor}; }
.node rect, .node circle, .node ellipse, .node polygon, .node path { fill: ${s.mainBkg}; stroke: ${s.nodeBorder}; stroke-width: 1px; } .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label { text-anchor: middle; } // .flowchart-label .text-outer-tspan { // text-anchor: middle; // } // .flowchart-label .text-inner-tspan { // text-anchor: start; // }
.node .katex path { fill: #000; stroke: #000; stroke-width: 1px; }
.rough-node .label,.node .label, .image-shape .label, .icon-shape .label { text-align: center; } .node.clickable { cursor: pointer; }
.root .anchor path { fill: ${s.lineColor} !important; stroke-width: 0; stroke: ${s.lineColor}; }
.arrowheadPath { fill: ${s.arrowheadColor}; }
.edgePath .path { stroke: ${s.lineColor}; stroke-width: 2.0px; }
.flowchart-link { stroke: ${s.lineColor}; fill: none; }
.edgeLabel { background-color: ${s.edgeLabelBackground}; p { background-color: ${s.edgeLabelBackground}; } rect { opacity: 0.5; background-color: ${s.edgeLabelBackground}; fill: ${s.edgeLabelBackground}; } text-align: center; }
/* For html labels only */ .labelBkg { background-color: ${ke(s.edgeLabelBackground, 0.5)}; // background-color: }
.cluster rect { fill: ${s.clusterBkg}; stroke: ${s.clusterBorder}; stroke-width: 1px; }
.cluster text { fill: ${s.titleColor}; }
.cluster span { color: ${s.titleColor}; } /* .cluster div { color: ${s.titleColor}; } */
div.mermaidTooltip { position: absolute; text-align: center; max-width: 200px; padding: 2px; font-family: ${s.fontFamily}; font-size: 12px; background: ${s.tertiaryColor}; border: 1px solid ${s.border2}; border-radius: 2px; pointer-events: none; z-index: 100; }
.flowchartTitleText { text-anchor: middle; font-size: 18px; fill: ${s.textColor}; }
rect.text { fill: none; stroke-width: 0; }
.icon-shape, .image-shape { background-color: ${s.edgeLabelBackground}; p { background-color: ${s.edgeLabelBackground}; padding: 2px; } rect { opacity: 0.5; background-color: ${s.edgeLabelBackground}; fill: ${s.edgeLabelBackground}; } text-align: center; } ${qt()}`, "getStyles"), Ce = me, Ee = { parser: Ae, get db() { return new pe(); }, renderer: be, styles: Ce, init: /* @__PURE__ */ m((s) => { s.flowchart || (s.flowchart = {}), s.layout && Ot({ layout: s.layout }), s.flowchart.arrowMarkerAbsolute = s.arrowMarkerAbsolute, Ot({ flowchart: { arrowMarkerAbsolute: s.arrowMarkerAbsolute } }); }, "init")};export { Ee as diagram};123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502import { aT as $e, aU as Un, aV as Je, aW as Ke, aX as tn, aY as re, aZ as En, _ as d, g as Ln, s as An, q as In, p as Wn, a as Hn, b as On, c as _t, d as Bt, e as Nn, a_ as it, l as Qt, k as Vn, j as zn, y as Pn, u as Rn } from "./mermaid.core-BiIw1_mh.js";import { c as Te, g as be } from "./Index-DlSje_b9.js";import { b as Zn, t as Ie, c as Bn, a as qn, l as Xn } from "./linear-Cg721pVl.js";import { i as Gn } from "./init-DjUOC4st.js";function jn(t, e) { let n; if (e === void 0) for (const r of t) r != null && (n < r || n === void 0 && r >= r) && (n = r); else { let r = -1; for (let i of t) (i = e(i, ++r, t)) != null && (n < i || n === void 0 && i >= i) && (n = i); } return n;}function Qn(t, e) { let n; if (e === void 0) for (const r of t) r != null && (n > r || n === void 0 && r >= r) && (n = r); else { let r = -1; for (let i of t) (i = e(i, ++r, t)) != null && (n > i || n === void 0 && i >= i) && (n = i); } return n;}function $n(t) { return t;}var Xt = 1, ie = 2, me = 3, qt = 4, We = 1e-6;function Jn(t) { return "translate(" + t + ",0)";}function Kn(t) { return "translate(0," + t + ")";}function tr(t) { return (e) => +t(e);}function er(t, e) { return e = Math.max(0, t.bandwidth() - e * 2) / 2, t.round() && (e = Math.round(e)), (n) => +t(n) + e;}function nr() { return !this.__axis;}function en(t, e) { var n = [], r = null, i = null, a = 6, s = 6, p = 3, M = typeof window < "u" && window.devicePixelRatio > 1 ? 0 : 0.5, T = t === Xt || t === qt ? -1 : 1, g = t === qt || t === ie ? "x" : "y", U = t === Xt || t === me ? Jn : Kn; function C(b) { var X = r ?? (e.ticks ? e.ticks.apply(e, n) : e.domain()), H = i ?? (e.tickFormat ? e.tickFormat.apply(e, n) : $n), D = Math.max(a, 0) + p, I = e.range(), V = +I[0] + M, W = +I[I.length - 1] + M, B = (e.bandwidth ? er : tr)(e.copy(), M), Q = b.selection ? b.selection() : b, w = Q.selectAll(".domain").data([null]), O = Q.selectAll(".tick").data(X, e).order(), x = O.exit(), F = O.enter().append("g").attr("class", "tick"), S = O.select("line"), _ = O.select("text"); w = w.merge(w.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor")), O = O.merge(F), S = S.merge(F.append("line").attr("stroke", "currentColor").attr(g + "2", T * a)), _ = _.merge(F.append("text").attr("fill", "currentColor").attr(g, T * D).attr("dy", t === Xt ? "0em" : t === me ? "0.71em" : "0.32em")), b !== Q && (w = w.transition(b), O = O.transition(b), S = S.transition(b), _ = _.transition(b), x = x.transition(b).attr("opacity", We).attr("transform", function(k) { return isFinite(k = B(k)) ? U(k + M) : this.getAttribute("transform"); }), F.attr("opacity", We).attr("transform", function(k) { var Y = this.parentNode.__axis; return U((Y && isFinite(Y = Y(k)) ? Y : B(k)) + M); })), x.remove(), w.attr("d", t === qt || t === ie ? s ? "M" + T * s + "," + V + "H" + M + "V" + W + "H" + T * s : "M" + M + "," + V + "V" + W : s ? "M" + V + "," + T * s + "V" + M + "H" + W + "V" + T * s : "M" + V + "," + M + "H" + W), O.attr("opacity", 1).attr("transform", function(k) { return U(B(k) + M); }), S.attr(g + "2", T * a), _.attr(g, T * D).text(H), Q.filter(nr).attr("fill", "none").attr("font-size", 10).attr("font-family", "sans-serif").attr("text-anchor", t === ie ? "start" : t === qt ? "end" : "middle"), Q.each(function() { this.__axis = B; }); } return C.scale = function(b) { return arguments.length ? (e = b, C) : e; }, C.ticks = function() { return n = Array.from(arguments), C; }, C.tickArguments = function(b) { return arguments.length ? (n = b == null ? [] : Array.from(b), C) : n.slice(); }, C.tickValues = function(b) { return arguments.length ? (r = b == null ? null : Array.from(b), C) : r && r.slice(); }, C.tickFormat = function(b) { return arguments.length ? (i = b, C) : i; }, C.tickSize = function(b) { return arguments.length ? (a = s = +b, C) : a; }, C.tickSizeInner = function(b) { return arguments.length ? (a = +b, C) : a; }, C.tickSizeOuter = function(b) { return arguments.length ? (s = +b, C) : s; }, C.tickPadding = function(b) { return arguments.length ? (p = +b, C) : p; }, C.offset = function(b) { return arguments.length ? (M = +b, C) : M; }, C;}function rr(t) { return en(Xt, t);}function ir(t) { return en(me, t);}const ar = Math.PI / 180, sr = 180 / Math.PI, $t = 18, nn = 0.96422, rn = 1, an = 0.82521, sn = 4 / 29, St = 6 / 29, on = 3 * St * St, or = St * St * St;function cn(t) { if (t instanceof ft) return new ft(t.l, t.a, t.b, t.opacity); if (t instanceof dt) return ln(t); t instanceof $e || (t = Un(t)); var e = ce(t.r), n = ce(t.g), r = ce(t.b), i = ae((0.2225045 * e + 0.7168786 * n + 0.0606169 * r) / rn), a, s; return e === n && n === r ? a = s = i : (a = ae((0.4360747 * e + 0.3850649 * n + 0.1430804 * r) / nn), s = ae((0.0139322 * e + 0.0971045 * n + 0.7141733 * r) / an)), new ft(116 * i - 16, 500 * (a - i), 200 * (i - s), t.opacity);}function cr(t, e, n, r) { return arguments.length === 1 ? cn(t) : new ft(t, e, n, r ?? 1);}function ft(t, e, n, r) { this.l = +t, this.a = +e, this.b = +n, this.opacity = +r;}Je(ft, cr, Ke(tn, { brighter(t) { return new ft(this.l + $t * (t ?? 1), this.a, this.b, this.opacity); }, darker(t) { return new ft(this.l - $t * (t ?? 1), this.a, this.b, this.opacity); }, rgb() { var t = (this.l + 16) / 116, e = isNaN(this.a) ? t : t + this.a / 500, n = isNaN(this.b) ? t : t - this.b / 200; return e = nn * se(e), t = rn * se(t), n = an * se(n), new $e( oe(3.1338561 * e - 1.6168667 * t - 0.4906146 * n), oe(-0.9787684 * e + 1.9161415 * t + 0.033454 * n), oe(0.0719453 * e - 0.2289914 * t + 1.4052427 * n), this.opacity ); }}));function ae(t) { return t > or ? Math.pow(t, 1 / 3) : t / on + sn;}function se(t) { return t > St ? t * t * t : on * (t - sn);}function oe(t) { return 255 * (t <= 31308e-7 ? 12.92 * t : 1.055 * Math.pow(t, 1 / 2.4) - 0.055);}function ce(t) { return (t /= 255) <= 0.04045 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4);}function lr(t) { if (t instanceof dt) return new dt(t.h, t.c, t.l, t.opacity); if (t instanceof ft || (t = cn(t)), t.a === 0 && t.b === 0) return new dt(NaN, 0 < t.l && t.l < 100 ? 0 : NaN, t.l, t.opacity); var e = Math.atan2(t.b, t.a) * sr; return new dt(e < 0 ? e + 360 : e, Math.sqrt(t.a * t.a + t.b * t.b), t.l, t.opacity);}function ge(t, e, n, r) { return arguments.length === 1 ? lr(t) : new dt(t, e, n, r ?? 1);}function dt(t, e, n, r) { this.h = +t, this.c = +e, this.l = +n, this.opacity = +r;}function ln(t) { if (isNaN(t.h)) return new ft(t.l, 0, 0, t.opacity); var e = t.h * ar; return new ft(t.l, Math.cos(e) * t.c, Math.sin(e) * t.c, t.opacity);}Je(dt, ge, Ke(tn, { brighter(t) { return new dt(this.h, this.c, this.l + $t * (t ?? 1), this.opacity); }, darker(t) { return new dt(this.h, this.c, this.l - $t * (t ?? 1), this.opacity); }, rgb() { return ln(this).rgb(); }}));function ur(t) { return function(e, n) { var r = t((e = ge(e)).h, (n = ge(n)).h), i = re(e.c, n.c), a = re(e.l, n.l), s = re(e.opacity, n.opacity); return function(p) { return e.h = r(p), e.c = i(p), e.l = a(p), e.opacity = s(p), e + ""; }; };}const fr = ur(En);function hr(t, e) { t = t.slice(); var n = 0, r = t.length - 1, i = t[n], a = t[r], s; return a < i && (s = n, n = r, r = s, s = i, i = a, a = s), t[n] = e.floor(i), t[r] = e.ceil(a), t;}const le = /* @__PURE__ */ new Date(), ue = /* @__PURE__ */ new Date();function et(t, e, n, r) { function i(a) { return t(a = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+a)), a; } return i.floor = (a) => (t(a = /* @__PURE__ */ new Date(+a)), a), i.ceil = (a) => (t(a = new Date(a - 1)), e(a, 1), t(a), a), i.round = (a) => { const s = i(a), p = i.ceil(a); return a - s < p - a ? s : p; }, i.offset = (a, s) => (e(a = /* @__PURE__ */ new Date(+a), s == null ? 1 : Math.floor(s)), a), i.range = (a, s, p) => { const M = []; if (a = i.ceil(a), p = p == null ? 1 : Math.floor(p), !(a < s) || !(p > 0)) return M; let T; do M.push(T = /* @__PURE__ */ new Date(+a)), e(a, p), t(a); while (T < a && a < s); return M; }, i.filter = (a) => et((s) => { if (s >= s) for (; t(s), !a(s); ) s.setTime(s - 1); }, (s, p) => { if (s >= s) if (p < 0) for (; ++p <= 0; ) for (; e(s, -1), !a(s); ) ; else for (; --p >= 0; ) for (; e(s, 1), !a(s); ) ; }), n && (i.count = (a, s) => (le.setTime(+a), ue.setTime(+s), t(le), t(ue), Math.floor(n(le, ue))), i.every = (a) => (a = Math.floor(a), !isFinite(a) || !(a > 0) ? null : a > 1 ? i.filter(r ? (s) => r(s) % a === 0 : (s) => i.count(0, s) % a === 0) : i)), i;}const Yt = et(() => {}, (t, e) => { t.setTime(+t + e);}, (t, e) => e - t);Yt.every = (t) => (t = Math.floor(t), !isFinite(t) || !(t > 0) ? null : t > 1 ? et((e) => { e.setTime(Math.floor(e / t) * t);}, (e, n) => { e.setTime(+e + n * t);}, (e, n) => (n - e) / t) : Yt);Yt.range;const mt = 1e3, ct = mt * 60, gt = ct * 60, yt = gt * 24, xe = yt * 7, He = yt * 30, fe = yt * 365, vt = et((t) => { t.setTime(t - t.getMilliseconds());}, (t, e) => { t.setTime(+t + e * mt);}, (t, e) => (e - t) / mt, (t) => t.getUTCSeconds());vt.range;const Wt = et((t) => { t.setTime(t - t.getMilliseconds() - t.getSeconds() * mt);}, (t, e) => { t.setTime(+t + e * ct);}, (t, e) => (e - t) / ct, (t) => t.getMinutes());Wt.range;const dr = et((t) => { t.setUTCSeconds(0, 0);}, (t, e) => { t.setTime(+t + e * ct);}, (t, e) => (e - t) / ct, (t) => t.getUTCMinutes());dr.range;const Ht = et((t) => { t.setTime(t - t.getMilliseconds() - t.getSeconds() * mt - t.getMinutes() * ct);}, (t, e) => { t.setTime(+t + e * gt);}, (t, e) => (e - t) / gt, (t) => t.getHours());Ht.range;const mr = et((t) => { t.setUTCMinutes(0, 0, 0);}, (t, e) => { t.setTime(+t + e * gt);}, (t, e) => (e - t) / gt, (t) => t.getUTCHours());mr.range;const Tt = et( (t) => t.setHours(0, 0, 0, 0), (t, e) => t.setDate(t.getDate() + e), (t, e) => (e - t - (e.getTimezoneOffset() - t.getTimezoneOffset()) * ct) / yt, (t) => t.getDate() - 1);Tt.range;const we = et((t) => { t.setUTCHours(0, 0, 0, 0);}, (t, e) => { t.setUTCDate(t.getUTCDate() + e);}, (t, e) => (e - t) / yt, (t) => t.getUTCDate() - 1);we.range;const gr = et((t) => { t.setUTCHours(0, 0, 0, 0);}, (t, e) => { t.setUTCDate(t.getUTCDate() + e);}, (t, e) => (e - t) / yt, (t) => Math.floor(t / yt));gr.range;function wt(t) { return et((e) => { e.setDate(e.getDate() - (e.getDay() + 7 - t) % 7), e.setHours(0, 0, 0, 0); }, (e, n) => { e.setDate(e.getDate() + n * 7); }, (e, n) => (n - e - (n.getTimezoneOffset() - e.getTimezoneOffset()) * ct) / xe);}const Vt = wt(0), Ot = wt(1), un = wt(2), fn = wt(3), bt = wt(4), hn = wt(5), dn = wt(6);Vt.range;Ot.range;un.range;fn.range;bt.range;hn.range;dn.range;function Ct(t) { return et((e) => { e.setUTCDate(e.getUTCDate() - (e.getUTCDay() + 7 - t) % 7), e.setUTCHours(0, 0, 0, 0); }, (e, n) => { e.setUTCDate(e.getUTCDate() + n * 7); }, (e, n) => (n - e) / xe);}const mn = Ct(0), Jt = Ct(1), yr = Ct(2), kr = Ct(3), Ut = Ct(4), pr = Ct(5), vr = Ct(6);mn.range;Jt.range;yr.range;kr.range;Ut.range;pr.range;vr.range;const Nt = et((t) => { t.setDate(1), t.setHours(0, 0, 0, 0);}, (t, e) => { t.setMonth(t.getMonth() + e);}, (t, e) => e.getMonth() - t.getMonth() + (e.getFullYear() - t.getFullYear()) * 12, (t) => t.getMonth());Nt.range;const Tr = et((t) => { t.setUTCDate(1), t.setUTCHours(0, 0, 0, 0);}, (t, e) => { t.setUTCMonth(t.getUTCMonth() + e);}, (t, e) => e.getUTCMonth() - t.getUTCMonth() + (e.getUTCFullYear() - t.getUTCFullYear()) * 12, (t) => t.getUTCMonth());Tr.range;const kt = et((t) => { t.setMonth(0, 1), t.setHours(0, 0, 0, 0);}, (t, e) => { t.setFullYear(t.getFullYear() + e);}, (t, e) => e.getFullYear() - t.getFullYear(), (t) => t.getFullYear());kt.every = (t) => !isFinite(t = Math.floor(t)) || !(t > 0) ? null : et((e) => { e.setFullYear(Math.floor(e.getFullYear() / t) * t), e.setMonth(0, 1), e.setHours(0, 0, 0, 0);}, (e, n) => { e.setFullYear(e.getFullYear() + n * t);});kt.range;const xt = et((t) => { t.setUTCMonth(0, 1), t.setUTCHours(0, 0, 0, 0);}, (t, e) => { t.setUTCFullYear(t.getUTCFullYear() + e);}, (t, e) => e.getUTCFullYear() - t.getUTCFullYear(), (t) => t.getUTCFullYear());xt.every = (t) => !isFinite(t = Math.floor(t)) || !(t > 0) ? null : et((e) => { e.setUTCFullYear(Math.floor(e.getUTCFullYear() / t) * t), e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0);}, (e, n) => { e.setUTCFullYear(e.getUTCFullYear() + n * t);});xt.range;function br(t, e, n, r, i, a) { const s = [ [vt, 1, mt], [vt, 5, 5 * mt], [vt, 15, 15 * mt], [vt, 30, 30 * mt], [a, 1, ct], [a, 5, 5 * ct], [a, 15, 15 * ct], [a, 30, 30 * ct], [i, 1, gt], [i, 3, 3 * gt], [i, 6, 6 * gt], [i, 12, 12 * gt], [r, 1, yt], [r, 2, 2 * yt], [n, 1, xe], [e, 1, He], [e, 3, 3 * He], [t, 1, fe] ]; function p(T, g, U) { const C = g < T; C && ([T, g] = [g, T]); const b = U && typeof U.range == "function" ? U : M(T, g, U), X = b ? b.range(T, +g + 1) : []; return C ? X.reverse() : X; } function M(T, g, U) { const C = Math.abs(g - T) / U, b = Zn(([, , D]) => D).right(s, C); if (b === s.length) return t.every(Ie(T / fe, g / fe, U)); if (b === 0) return Yt.every(Math.max(Ie(T, g, U), 1)); const [X, H] = s[C / s[b - 1][2] < s[b][2] / C ? b - 1 : b]; return X.every(H); } return [p, M];}const [xr, wr] = br(kt, Nt, Vt, Tt, Ht, Wt);function he(t) { if (0 <= t.y && t.y < 100) { var e = new Date(-1, t.m, t.d, t.H, t.M, t.S, t.L); return e.setFullYear(t.y), e; } return new Date(t.y, t.m, t.d, t.H, t.M, t.S, t.L);}function de(t) { if (0 <= t.y && t.y < 100) { var e = new Date(Date.UTC(-1, t.m, t.d, t.H, t.M, t.S, t.L)); return e.setUTCFullYear(t.y), e; } return new Date(Date.UTC(t.y, t.m, t.d, t.H, t.M, t.S, t.L));}function Lt(t, e, n) { return { y: t, m: e, d: n, H: 0, M: 0, S: 0, L: 0 };}function Cr(t) { var e = t.dateTime, n = t.date, r = t.time, i = t.periods, a = t.days, s = t.shortDays, p = t.months, M = t.shortMonths, T = At(i), g = It(i), U = At(a), C = It(a), b = At(s), X = It(s), H = At(p), D = It(p), I = At(M), V = It(M), W = { a: m, A: E, b: c, B: l, c: null, d: Re, e: Re, f: Xr, g: ri, G: ai, H: Zr, I: Br, j: qr, L: gn, m: Gr, M: jr, p: o, q: R, Q: qe, s: Xe, S: Qr, u: $r, U: Jr, V: Kr, w: ti, W: ei, x: null, X: null, y: ni, Y: ii, Z: si, "%": Be }, B = { a: z, A: P, b: K, B: G, c: null, d: Ze, e: Ze, f: ui, g: Ti, G: xi, H: oi, I: ci, j: li, L: kn, m: fi, M: hi, p: $, q: at, Q: qe, s: Xe, S: di, u: mi, U: gi, V: yi, w: ki, W: pi, x: null, X: null, y: vi, Y: bi, Z: wi, "%": Be }, Q = { a: S, A: _, b: k, B: Y, c: u, d: ze, e: ze, f: Vr, g: Ve, G: Ne, H: Pe, I: Pe, j: Wr, L: Nr, m: Ir, M: Hr, p: F, q: Ar, Q: Pr, s: Rr, S: Or, u: Fr, U: Yr, V: Ur, w: Sr, W: Er, x: h, X: y, y: Ve, Y: Ne, Z: Lr, "%": zr }; W.x = w(n, W), W.X = w(r, W), W.c = w(e, W), B.x = w(n, B), B.X = w(r, B), B.c = w(e, B); function w(v, A) { return function(N) { var f = [], J = -1, L = 0, j = v.length, q, rt, st; for (N instanceof Date || (N = /* @__PURE__ */ new Date(+N)); ++J < j; ) v.charCodeAt(J) === 37 && (f.push(v.slice(L, J)), (rt = Oe[q = v.charAt(++J)]) != null ? q = v.charAt(++J) : rt = q === "e" ? " " : "0", (st = A[q]) && (q = st(N, rt)), f.push(q), L = J + 1); return f.push(v.slice(L, J)), f.join(""); }; } function O(v, A) { return function(N) { var f = Lt(1900, void 0, 1), J = x(f, v, N += "", 0), L, j; if (J != N.length) return null; if ("Q" in f) return new Date(f.Q); if ("s" in f) return new Date(f.s * 1e3 + ("L" in f ? f.L : 0)); if (A && !("Z" in f) && (f.Z = 0), "p" in f && (f.H = f.H % 12 + f.p * 12), f.m === void 0 && (f.m = "q" in f ? f.q : 0), "V" in f) { if (f.V < 1 || f.V > 53) return null; "w" in f || (f.w = 1), "Z" in f ? (L = de(Lt(f.y, 0, 1)), j = L.getUTCDay(), L = j > 4 || j === 0 ? Jt.ceil(L) : Jt(L), L = we.offset(L, (f.V - 1) * 7), f.y = L.getUTCFullYear(), f.m = L.getUTCMonth(), f.d = L.getUTCDate() + (f.w + 6) % 7) : (L = he(Lt(f.y, 0, 1)), j = L.getDay(), L = j > 4 || j === 0 ? Ot.ceil(L) : Ot(L), L = Tt.offset(L, (f.V - 1) * 7), f.y = L.getFullYear(), f.m = L.getMonth(), f.d = L.getDate() + (f.w + 6) % 7); } else ("W" in f || "U" in f) && ("w" in f || (f.w = "u" in f ? f.u % 7 : "W" in f ? 1 : 0), j = "Z" in f ? de(Lt(f.y, 0, 1)).getUTCDay() : he(Lt(f.y, 0, 1)).getDay(), f.m = 0, f.d = "W" in f ? (f.w + 6) % 7 + f.W * 7 - (j + 5) % 7 : f.w + f.U * 7 - (j + 6) % 7); return "Z" in f ? (f.H += f.Z / 100 | 0, f.M += f.Z % 100, de(f)) : he(f); }; } function x(v, A, N, f) { for (var J = 0, L = A.length, j = N.length, q, rt; J < L; ) { if (f >= j) return -1; if (q = A.charCodeAt(J++), q === 37) { if (q = A.charAt(J++), rt = Q[q in Oe ? A.charAt(J++) : q], !rt || (f = rt(v, N, f)) < 0) return -1; } else if (q != N.charCodeAt(f++)) return -1; } return f; } function F(v, A, N) { var f = T.exec(A.slice(N)); return f ? (v.p = g.get(f[0].toLowerCase()), N + f[0].length) : -1; } function S(v, A, N) { var f = b.exec(A.slice(N)); return f ? (v.w = X.get(f[0].toLowerCase()), N + f[0].length) : -1; } function _(v, A, N) { var f = U.exec(A.slice(N)); return f ? (v.w = C.get(f[0].toLowerCase()), N + f[0].length) : -1; } function k(v, A, N) { var f = I.exec(A.slice(N)); return f ? (v.m = V.get(f[0].toLowerCase()), N + f[0].length) : -1; } function Y(v, A, N) { var f = H.exec(A.slice(N)); return f ? (v.m = D.get(f[0].toLowerCase()), N + f[0].length) : -1; } function u(v, A, N) { return x(v, e, A, N); } function h(v, A, N) { return x(v, n, A, N); } function y(v, A, N) { return x(v, r, A, N); } function m(v) { return s[v.getDay()]; } function E(v) { return a[v.getDay()]; } function c(v) { return M[v.getMonth()]; } function l(v) { return p[v.getMonth()]; } function o(v) { return i[+(v.getHours() >= 12)]; } function R(v) { return 1 + ~~(v.getMonth() / 3); } function z(v) { return s[v.getUTCDay()]; } function P(v) { return a[v.getUTCDay()]; } function K(v) { return M[v.getUTCMonth()]; } function G(v) { return p[v.getUTCMonth()]; } function $(v) { return i[+(v.getUTCHours() >= 12)]; } function at(v) { return 1 + ~~(v.getUTCMonth() / 3); } return { format: function(v) { var A = w(v += "", W); return A.toString = function() { return v; }, A; }, parse: function(v) { var A = O(v += "", !1); return A.toString = function() { return v; }, A; }, utcFormat: function(v) { var A = w(v += "", B); return A.toString = function() { return v; }, A; }, utcParse: function(v) { var A = O(v += "", !0); return A.toString = function() { return v; }, A; } };}var Oe = { "-": "", _: " ", 0: "0" }, nt = /^\s*\d+/, Dr = /^%/, Mr = /[\\^$*+?|[\]().{}]/g;function Z(t, e, n) { var r = t < 0 ? "-" : "", i = (r ? -t : t) + "", a = i.length; return r + (a < n ? new Array(n - a + 1).join(e) + i : i);}function _r(t) { return t.replace(Mr, "\\$&");}function At(t) { return new RegExp("^(?:" + t.map(_r).join("|") + ")", "i");}function It(t) { return new Map(t.map((e, n) => [e.toLowerCase(), n]));}function Sr(t, e, n) { var r = nt.exec(e.slice(n, n + 1)); return r ? (t.w = +r[0], n + r[0].length) : -1;}function Fr(t, e, n) { var r = nt.exec(e.slice(n, n + 1)); return r ? (t.u = +r[0], n + r[0].length) : -1;}function Yr(t, e, n) { var r = nt.exec(e.slice(n, n + 2)); return r ? (t.U = +r[0], n + r[0].length) : -1;}function Ur(t, e, n) { var r = nt.exec(e.slice(n, n + 2)); return r ? (t.V = +r[0], n + r[0].length) : -1;}function Er(t, e, n) { var r = nt.exec(e.slice(n, n + 2)); return r ? (t.W = +r[0], n + r[0].length) : -1;}function Ne(t, e, n) { var r = nt.exec(e.slice(n, n + 4)); return r ? (t.y = +r[0], n + r[0].length) : -1;}function Ve(t, e, n) { var r = nt.exec(e.slice(n, n + 2)); return r ? (t.y = +r[0] + (+r[0] > 68 ? 1900 : 2e3), n + r[0].length) : -1;}function Lr(t, e, n) { var r = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n, n + 6)); return r ? (t.Z = r[1] ? 0 : -(r[2] + (r[3] || "00")), n + r[0].length) : -1;}function Ar(t, e, n) { var r = nt.exec(e.slice(n, n + 1)); return r ? (t.q = r[0] * 3 - 3, n + r[0].length) : -1;}function Ir(t, e, n) { var r = nt.exec(e.slice(n, n + 2)); return r ? (t.m = r[0] - 1, n + r[0].length) : -1;}function ze(t, e, n) { var r = nt.exec(e.slice(n, n + 2)); return r ? (t.d = +r[0], n + r[0].length) : -1;}function Wr(t, e, n) { var r = nt.exec(e.slice(n, n + 3)); return r ? (t.m = 0, t.d = +r[0], n + r[0].length) : -1;}function Pe(t, e, n) { var r = nt.exec(e.slice(n, n + 2)); return r ? (t.H = +r[0], n + r[0].length) : -1;}function Hr(t, e, n) { var r = nt.exec(e.slice(n, n + 2)); return r ? (t.M = +r[0], n + r[0].length) : -1;}function Or(t, e, n) { var r = nt.exec(e.slice(n, n + 2)); return r ? (t.S = +r[0], n + r[0].length) : -1;}function Nr(t, e, n) { var r = nt.exec(e.slice(n, n + 3)); return r ? (t.L = +r[0], n + r[0].length) : -1;}function Vr(t, e, n) { var r = nt.exec(e.slice(n, n + 6)); return r ? (t.L = Math.floor(r[0] / 1e3), n + r[0].length) : -1;}function zr(t, e, n) { var r = Dr.exec(e.slice(n, n + 1)); return r ? n + r[0].length : -1;}function Pr(t, e, n) { var r = nt.exec(e.slice(n)); return r ? (t.Q = +r[0], n + r[0].length) : -1;}function Rr(t, e, n) { var r = nt.exec(e.slice(n)); return r ? (t.s = +r[0], n + r[0].length) : -1;}function Re(t, e) { return Z(t.getDate(), e, 2);}function Zr(t, e) { return Z(t.getHours(), e, 2);}function Br(t, e) { return Z(t.getHours() % 12 || 12, e, 2);}function qr(t, e) { return Z(1 + Tt.count(kt(t), t), e, 3);}function gn(t, e) { return Z(t.getMilliseconds(), e, 3);}function Xr(t, e) { return gn(t, e) + "000";}function Gr(t, e) { return Z(t.getMonth() + 1, e, 2);}function jr(t, e) { return Z(t.getMinutes(), e, 2);}function Qr(t, e) { return Z(t.getSeconds(), e, 2);}function $r(t) { var e = t.getDay(); return e === 0 ? 7 : e;}function Jr(t, e) { return Z(Vt.count(kt(t) - 1, t), e, 2);}function yn(t) { var e = t.getDay(); return e >= 4 || e === 0 ? bt(t) : bt.ceil(t);}function Kr(t, e) { return t = yn(t), Z(bt.count(kt(t), t) + (kt(t).getDay() === 4), e, 2);}function ti(t) { return t.getDay();}function ei(t, e) { return Z(Ot.count(kt(t) - 1, t), e, 2);}function ni(t, e) { return Z(t.getFullYear() % 100, e, 2);}function ri(t, e) { return t = yn(t), Z(t.getFullYear() % 100, e, 2);}function ii(t, e) { return Z(t.getFullYear() % 1e4, e, 4);}function ai(t, e) { var n = t.getDay(); return t = n >= 4 || n === 0 ? bt(t) : bt.ceil(t), Z(t.getFullYear() % 1e4, e, 4);}function si(t) { var e = t.getTimezoneOffset(); return (e > 0 ? "-" : (e *= -1, "+")) + Z(e / 60 | 0, "0", 2) + Z(e % 60, "0", 2);}function Ze(t, e) { return Z(t.getUTCDate(), e, 2);}function oi(t, e) { return Z(t.getUTCHours(), e, 2);}function ci(t, e) { return Z(t.getUTCHours() % 12 || 12, e, 2);}function li(t, e) { return Z(1 + we.count(xt(t), t), e, 3);}function kn(t, e) { return Z(t.getUTCMilliseconds(), e, 3);}function ui(t, e) { return kn(t, e) + "000";}function fi(t, e) { return Z(t.getUTCMonth() + 1, e, 2);}function hi(t, e) { return Z(t.getUTCMinutes(), e, 2);}function di(t, e) { return Z(t.getUTCSeconds(), e, 2);}function mi(t) { var e = t.getUTCDay(); return e === 0 ? 7 : e;}function gi(t, e) { return Z(mn.count(xt(t) - 1, t), e, 2);}function pn(t) { var e = t.getUTCDay(); return e >= 4 || e === 0 ? Ut(t) : Ut.ceil(t);}function yi(t, e) { return t = pn(t), Z(Ut.count(xt(t), t) + (xt(t).getUTCDay() === 4), e, 2);}function ki(t) { return t.getUTCDay();}function pi(t, e) { return Z(Jt.count(xt(t) - 1, t), e, 2);}function vi(t, e) { return Z(t.getUTCFullYear() % 100, e, 2);}function Ti(t, e) { return t = pn(t), Z(t.getUTCFullYear() % 100, e, 2);}function bi(t, e) { return Z(t.getUTCFullYear() % 1e4, e, 4);}function xi(t, e) { var n = t.getUTCDay(); return t = n >= 4 || n === 0 ? Ut(t) : Ut.ceil(t), Z(t.getUTCFullYear() % 1e4, e, 4);}function wi() { return "+0000";}function Be() { return "%";}function qe(t) { return +t;}function Xe(t) { return Math.floor(+t / 1e3);}var Mt, Kt;Ci({ dateTime: "%x, %X", date: "%-m/%-d/%Y", time: "%-I:%M:%S %p", periods: ["AM", "PM"], days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]});function Ci(t) { return Mt = Cr(t), Kt = Mt.format, Mt.parse, Mt.utcFormat, Mt.utcParse, Mt;}function Di(t) { return new Date(t);}function Mi(t) { return t instanceof Date ? +t : +/* @__PURE__ */ new Date(+t);}function vn(t, e, n, r, i, a, s, p, M, T) { var g = Bn(), U = g.invert, C = g.domain, b = T(".%L"), X = T(":%S"), H = T("%I:%M"), D = T("%I %p"), I = T("%a %d"), V = T("%b %d"), W = T("%B"), B = T("%Y"); function Q(w) { return (M(w) < w ? b : p(w) < w ? X : s(w) < w ? H : a(w) < w ? D : r(w) < w ? i(w) < w ? I : V : n(w) < w ? W : B)(w); } return g.invert = function(w) { return new Date(U(w)); }, g.domain = function(w) { return arguments.length ? C(Array.from(w, Mi)) : C().map(Di); }, g.ticks = function(w) { var O = C(); return t(O[0], O[O.length - 1], w ?? 10); }, g.tickFormat = function(w, O) { return O == null ? Q : T(O); }, g.nice = function(w) { var O = C(); return (!w || typeof w.range != "function") && (w = e(O[0], O[O.length - 1], w ?? 10)), w ? C(hr(O, w)) : g; }, g.copy = function() { return qn(g, vn(t, e, n, r, i, a, s, p, M, T)); }, g;}function _i() { return Gn.apply(vn(xr, wr, kt, Nt, Vt, Tt, Ht, Wt, vt, Kt).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]), arguments);}var Tn = { exports: {} };(function(t, e) { (function(n, r) { t.exports = r(); })(Te, function() { var n = "day"; return function(r, i, a) { var s = function(T) { return T.add(4 - T.isoWeekday(), n); }, p = i.prototype; p.isoWeekYear = function() { return s(this).year(); }, p.isoWeek = function(T) { if (!this.$utils().u(T)) return this.add(7 * (T - this.isoWeek()), n); var g, U, C, b, X = s(this), H = (g = this.isoWeekYear(), U = this.$u, C = (U ? a.utc : a)().year(g).startOf("year"), b = 4 - C.isoWeekday(), C.isoWeekday() > 4 && (b += 7), C.add(b, n)); return X.diff(H, "week") + 1; }, p.isoWeekday = function(T) { return this.$utils().u(T) ? this.day() || 7 : this.day(this.day() % 7 ? T : T - 7); }; var M = p.startOf; p.startOf = function(T, g) { var U = this.$utils(), C = !!U.u(g) || g; return U.p(T) === "isoweek" ? C ? this.date(this.date() - (this.isoWeekday() - 1)).startOf("day") : this.date(this.date() - 1 - (this.isoWeekday() - 1) + 7).endOf("day") : M.bind(this)(T, g); }; }; });})(Tn);var Si = Tn.exports;const Fi = /* @__PURE__ */ be(Si);var bn = { exports: {} };(function(t, e) { (function(n, r) { t.exports = r(); })(Te, function() { var n = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, r = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, i = /\d/, a = /\d\d/, s = /\d\d?/, p = /\d*[^-_:/,()\s\d]+/, M = {}, T = function(D) { return (D = +D) + (D > 68 ? 1900 : 2e3); }, g = function(D) { return function(I) { this[D] = +I; }; }, U = [/[+-]\d\d:?(\d\d)?|Z/, function(D) { (this.zone || (this.zone = {})).offset = function(I) { if (!I || I === "Z") return 0; var V = I.match(/([+-]|\d\d)/g), W = 60 * V[1] + (+V[2] || 0); return W === 0 ? 0 : V[0] === "+" ? -W : W; }(D); }], C = function(D) { var I = M[D]; return I && (I.indexOf ? I : I.s.concat(I.f)); }, b = function(D, I) { var V, W = M.meridiem; if (W) { for (var B = 1; B <= 24; B += 1) if (D.indexOf(W(B, 0, I)) > -1) { V = B > 12; break; } } else V = D === (I ? "pm" : "PM"); return V; }, X = { A: [p, function(D) { this.afternoon = b(D, !1); }], a: [p, function(D) { this.afternoon = b(D, !0); }], Q: [i, function(D) { this.month = 3 * (D - 1) + 1; }], S: [i, function(D) { this.milliseconds = 100 * +D; }], SS: [a, function(D) { this.milliseconds = 10 * +D; }], SSS: [/\d{3}/, function(D) { this.milliseconds = +D; }], s: [s, g("seconds")], ss: [s, g("seconds")], m: [s, g("minutes")], mm: [s, g("minutes")], H: [s, g("hours")], h: [s, g("hours")], HH: [s, g("hours")], hh: [s, g("hours")], D: [s, g("day")], DD: [a, g("day")], Do: [p, function(D) { var I = M.ordinal, V = D.match(/\d+/); if (this.day = V[0], I) for (var W = 1; W <= 31; W += 1) I(W).replace(/\[|\]/g, "") === D && (this.day = W); }], w: [s, g("week")], ww: [a, g("week")], M: [s, g("month")], MM: [a, g("month")], MMM: [p, function(D) { var I = C("months"), V = (C("monthsShort") || I.map(function(W) { return W.slice(0, 3); })).indexOf(D) + 1; if (V < 1) throw new Error(); this.month = V % 12 || V; }], MMMM: [p, function(D) { var I = C("months").indexOf(D) + 1; if (I < 1) throw new Error(); this.month = I % 12 || I; }], Y: [/[+-]?\d+/, g("year")], YY: [a, function(D) { this.year = T(D); }], YYYY: [/\d{4}/, g("year")], Z: U, ZZ: U }; function H(D) { var I, V; I = D, V = M && M.formats; for (var W = (D = I.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(S, _, k) { var Y = k && k.toUpperCase(); return _ || V[k] || n[k] || V[Y].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(u, h, y) { return h || y.slice(1); }); })).match(r), B = W.length, Q = 0; Q < B; Q += 1) { var w = W[Q], O = X[w], x = O && O[0], F = O && O[1]; W[Q] = F ? { regex: x, parser: F } : w.replace(/^\[|\]$/g, ""); } return function(S) { for (var _ = {}, k = 0, Y = 0; k < B; k += 1) { var u = W[k]; if (typeof u == "string") Y += u.length; else { var h = u.regex, y = u.parser, m = S.slice(Y), E = h.exec(m)[0]; y.call(_, E), S = S.replace(E, ""); } } return function(c) { var l = c.afternoon; if (l !== void 0) { var o = c.hours; l ? o < 12 && (c.hours += 12) : o === 12 && (c.hours = 0), delete c.afternoon; } }(_), _; }; } return function(D, I, V) { V.p.customParseFormat = !0, D && D.parseTwoDigitYear && (T = D.parseTwoDigitYear); var W = I.prototype, B = W.parse; W.parse = function(Q) { var w = Q.date, O = Q.utc, x = Q.args; this.$u = O; var F = x[1]; if (typeof F == "string") { var S = x[2] === !0, _ = x[3] === !0, k = S || _, Y = x[2]; _ && (Y = x[2]), M = this.$locale(), !S && Y && (M = V.Ls[Y]), this.$d = function(m, E, c, l) { try { if (["x", "X"].indexOf(E) > -1) return new Date((E === "X" ? 1e3 : 1) * m); var o = H(E)(m), R = o.year, z = o.month, P = o.day, K = o.hours, G = o.minutes, $ = o.seconds, at = o.milliseconds, v = o.zone, A = o.week, N = /* @__PURE__ */ new Date(), f = P || (R || z ? 1 : N.getDate()), J = R || N.getFullYear(), L = 0; R && !z || (L = z > 0 ? z - 1 : N.getMonth()); var j, q = K || 0, rt = G || 0, st = $ || 0, pt = at || 0; return v ? new Date(Date.UTC(J, L, f, q, rt, st, pt + 60 * v.offset * 1e3)) : c ? new Date(Date.UTC(J, L, f, q, rt, st, pt)) : (j = new Date(J, L, f, q, rt, st, pt), A && (j = l(j).week(A).toDate()), j); } catch { return /* @__PURE__ */ new Date(""); } }(w, F, O, V), this.init(), Y && Y !== !0 && (this.$L = this.locale(Y).$L), k && w != this.format(F) && (this.$d = /* @__PURE__ */ new Date("")), M = {}; } else if (F instanceof Array) for (var u = F.length, h = 1; h <= u; h += 1) { x[1] = F[h - 1]; var y = V.apply(this, x); if (y.isValid()) { this.$d = y.$d, this.$L = y.$L, this.init(); break; } h === u && (this.$d = /* @__PURE__ */ new Date("")); } else B.call(this, Q); }; }; });})(bn);var Yi = bn.exports;const Ui = /* @__PURE__ */ be(Yi);var xn = { exports: {} };(function(t, e) { (function(n, r) { t.exports = r(); })(Te, function() { return function(n, r) { var i = r.prototype, a = i.format; i.format = function(s) { var p = this, M = this.$locale(); if (!this.isValid()) return a.bind(this)(s); var T = this.$utils(), g = (s || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, function(U) { switch (U) { case "Q": return Math.ceil((p.$M + 1) / 3); case "Do": return M.ordinal(p.$D); case "gggg": return p.weekYear(); case "GGGG": return p.isoWeekYear(); case "wo": return M.ordinal(p.week(), "W"); case "w": case "ww": return T.s(p.week(), U === "w" ? 1 : 2, "0"); case "W": case "WW": return T.s(p.isoWeek(), U === "W" ? 1 : 2, "0"); case "k": case "kk": return T.s(String(p.$H === 0 ? 24 : p.$H), U === "k" ? 1 : 2, "0"); case "X": return Math.floor(p.$d.getTime() / 1e3); case "x": return p.$d.getTime(); case "z": return "[" + p.offsetName() + "]"; case "zzz": return "[" + p.offsetName("long") + "]"; default: return U; } }); return a.bind(this)(g); }; }; });})(xn);var Ei = xn.exports;const Li = /* @__PURE__ */ be(Ei);var ye = function() { var t = /* @__PURE__ */ d(function(Y, u, h, y) { for (h = h || {}, y = Y.length; y--; h[Y[y]] = u) ; return h; }, "o"), e = [6, 8, 10, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 35, 36, 38, 40], n = [1, 26], r = [1, 27], i = [1, 28], a = [1, 29], s = [1, 30], p = [1, 31], M = [1, 32], T = [1, 33], g = [1, 34], U = [1, 9], C = [1, 10], b = [1, 11], X = [1, 12], H = [1, 13], D = [1, 14], I = [1, 15], V = [1, 16], W = [1, 19], B = [1, 20], Q = [1, 21], w = [1, 22], O = [1, 23], x = [1, 25], F = [1, 35], S = { trace: /* @__PURE__ */ d(function() { }, "trace"), yy: {}, symbols_: { error: 2, start: 3, gantt: 4, document: 5, EOF: 6, line: 7, SPACE: 8, statement: 9, NL: 10, weekday: 11, weekday_monday: 12, weekday_tuesday: 13, weekday_wednesday: 14, weekday_thursday: 15, weekday_friday: 16, weekday_saturday: 17, weekday_sunday: 18, weekend: 19, weekend_friday: 20, weekend_saturday: 21, dateFormat: 22, inclusiveEndDates: 23, topAxis: 24, axisFormat: 25, tickInterval: 26, excludes: 27, includes: 28, todayMarker: 29, title: 30, acc_title: 31, acc_title_value: 32, acc_descr: 33, acc_descr_value: 34, acc_descr_multiline_value: 35, section: 36, clickStatement: 37, taskTxt: 38, taskData: 39, click: 40, callbackname: 41, callbackargs: 42, href: 43, clickStatementDebug: 44, $accept: 0, $end: 1 }, terminals_: { 2: "error", 4: "gantt", 6: "EOF", 8: "SPACE", 10: "NL", 12: "weekday_monday", 13: "weekday_tuesday", 14: "weekday_wednesday", 15: "weekday_thursday", 16: "weekday_friday", 17: "weekday_saturday", 18: "weekday_sunday", 20: "weekend_friday", 21: "weekend_saturday", 22: "dateFormat", 23: "inclusiveEndDates", 24: "topAxis", 25: "axisFormat", 26: "tickInterval", 27: "excludes", 28: "includes", 29: "todayMarker", 30: "title", 31: "acc_title", 32: "acc_title_value", 33: "acc_descr", 34: "acc_descr_value", 35: "acc_descr_multiline_value", 36: "section", 38: "taskTxt", 39: "taskData", 40: "click", 41: "callbackname", 42: "callbackargs", 43: "href" }, productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [11, 1], [11, 1], [11, 1], [11, 1], [11, 1], [11, 1], [11, 1], [19, 1], [19, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 1], [9, 1], [9, 2], [37, 2], [37, 3], [37, 3], [37, 4], [37, 3], [37, 4], [37, 2], [44, 2], [44, 3], [44, 3], [44, 4], [44, 3], [44, 4], [44, 2]], performAction: /* @__PURE__ */ d(function(u, h, y, m, E, c, l) { var o = c.length - 1; switch (E) { case 1: return c[o - 1]; case 2: this.$ = []; break; case 3: c[o - 1].push(c[o]), this.$ = c[o - 1]; break; case 4: case 5: this.$ = c[o]; break; case 6: case 7: this.$ = []; break; case 8: m.setWeekday("monday"); break; case 9: m.setWeekday("tuesday"); break; case 10: m.setWeekday("wednesday"); break; case 11: m.setWeekday("thursday"); break; case 12: m.setWeekday("friday"); break; case 13: m.setWeekday("saturday"); break; case 14: m.setWeekday("sunday"); break; case 15: m.setWeekend("friday"); break; case 16: m.setWeekend("saturday"); break; case 17: m.setDateFormat(c[o].substr(11)), this.$ = c[o].substr(11); break; case 18: m.enableInclusiveEndDates(), this.$ = c[o].substr(18); break; case 19: m.TopAxis(), this.$ = c[o].substr(8); break; case 20: m.setAxisFormat(c[o].substr(11)), this.$ = c[o].substr(11); break; case 21: m.setTickInterval(c[o].substr(13)), this.$ = c[o].substr(13); break; case 22: m.setExcludes(c[o].substr(9)), this.$ = c[o].substr(9); break; case 23: m.setIncludes(c[o].substr(9)), this.$ = c[o].substr(9); break; case 24: m.setTodayMarker(c[o].substr(12)), this.$ = c[o].substr(12); break; case 27: m.setDiagramTitle(c[o].substr(6)), this.$ = c[o].substr(6); break; case 28: this.$ = c[o].trim(), m.setAccTitle(this.$); break; case 29: case 30: this.$ = c[o].trim(), m.setAccDescription(this.$); break; case 31: m.addSection(c[o].substr(8)), this.$ = c[o].substr(8); break; case 33: m.addTask(c[o - 1], c[o]), this.$ = "task"; break; case 34: this.$ = c[o - 1], m.setClickEvent(c[o - 1], c[o], null); break; case 35: this.$ = c[o - 2], m.setClickEvent(c[o - 2], c[o - 1], c[o]); break; case 36: this.$ = c[o - 2], m.setClickEvent(c[o - 2], c[o - 1], null), m.setLink(c[o - 2], c[o]); break; case 37: this.$ = c[o - 3], m.setClickEvent(c[o - 3], c[o - 2], c[o - 1]), m.setLink(c[o - 3], c[o]); break; case 38: this.$ = c[o - 2], m.setClickEvent(c[o - 2], c[o], null), m.setLink(c[o - 2], c[o - 1]); break; case 39: this.$ = c[o - 3], m.setClickEvent(c[o - 3], c[o - 1], c[o]), m.setLink(c[o - 3], c[o - 2]); break; case 40: this.$ = c[o - 1], m.setLink(c[o - 1], c[o]); break; case 41: case 47: this.$ = c[o - 1] + " " + c[o]; break; case 42: case 43: case 45: this.$ = c[o - 2] + " " + c[o - 1] + " " + c[o]; break; case 44: case 46: this.$ = c[o - 3] + " " + c[o - 2] + " " + c[o - 1] + " " + c[o]; break; } }, "anonymous"), table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, t(e, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: 17, 12: n, 13: r, 14: i, 15: a, 16: s, 17: p, 18: M, 19: 18, 20: T, 21: g, 22: U, 23: C, 24: b, 25: X, 26: H, 27: D, 28: I, 29: V, 30: W, 31: B, 33: Q, 35: w, 36: O, 37: 24, 38: x, 40: F }, t(e, [2, 7], { 1: [2, 1] }), t(e, [2, 3]), { 9: 36, 11: 17, 12: n, 13: r, 14: i, 15: a, 16: s, 17: p, 18: M, 19: 18, 20: T, 21: g, 22: U, 23: C, 24: b, 25: X, 26: H, 27: D, 28: I, 29: V, 30: W, 31: B, 33: Q, 35: w, 36: O, 37: 24, 38: x, 40: F }, t(e, [2, 5]), t(e, [2, 6]), t(e, [2, 17]), t(e, [2, 18]), t(e, [2, 19]), t(e, [2, 20]), t(e, [2, 21]), t(e, [2, 22]), t(e, [2, 23]), t(e, [2, 24]), t(e, [2, 25]), t(e, [2, 26]), t(e, [2, 27]), { 32: [1, 37] }, { 34: [1, 38] }, t(e, [2, 30]), t(e, [2, 31]), t(e, [2, 32]), { 39: [1, 39] }, t(e, [2, 8]), t(e, [2, 9]), t(e, [2, 10]), t(e, [2, 11]), t(e, [2, 12]), t(e, [2, 13]), t(e, [2, 14]), t(e, [2, 15]), t(e, [2, 16]), { 41: [1, 40], 43: [1, 41] }, t(e, [2, 4]), t(e, [2, 28]), t(e, [2, 29]), t(e, [2, 33]), t(e, [2, 34], { 42: [1, 42], 43: [1, 43] }), t(e, [2, 40], { 41: [1, 44] }), t(e, [2, 35], { 43: [1, 45] }), t(e, [2, 36]), t(e, [2, 38], { 42: [1, 46] }), t(e, [2, 37]), t(e, [2, 39])], defaultActions: {}, parseError: /* @__PURE__ */ d(function(u, h) { if (h.recoverable) this.trace(u); else { var y = new Error(u); throw y.hash = h, y; } }, "parseError"), parse: /* @__PURE__ */ d(function(u) { var h = this, y = [0], m = [], E = [null], c = [], l = this.table, o = "", R = 0, z = 0, P = 2, K = 1, G = c.slice.call(arguments, 1), $ = Object.create(this.lexer), at = { yy: {} }; for (var v in this.yy) Object.prototype.hasOwnProperty.call(this.yy, v) && (at.yy[v] = this.yy[v]); $.setInput(u, at.yy), at.yy.lexer = $, at.yy.parser = this, typeof $.yylloc > "u" && ($.yylloc = {}); var A = $.yylloc; c.push(A); var N = $.options && $.options.ranges; typeof at.yy.parseError == "function" ? this.parseError = at.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError; function f(ot) { y.length = y.length - 2 * ot, E.length = E.length - ot, c.length = c.length - ot; } d(f, "popStack"); function J() { var ot; return ot = m.pop() || $.lex() || K, typeof ot != "number" && (ot instanceof Array && (m = ot, ot = m.pop()), ot = h.symbols_[ot] || ot), ot; } d(J, "lex"); for (var L, j, q, rt, st = {}, pt, lt, Ae, Zt; ; ) { if (j = y[y.length - 1], this.defaultActions[j] ? q = this.defaultActions[j] : ((L === null || typeof L > "u") && (L = J()), q = l[j] && l[j][L]), typeof q > "u" || !q.length || !q[0]) { var ne = ""; Zt = []; for (pt in l[j]) this.terminals_[pt] && pt > P && Zt.push("'" + this.terminals_[pt] + "'"); $.showPosition ? ne = "Parse error on line " + (R + 1) + `:` + $.showPosition() + `Expecting ` + Zt.join(", ") + ", got '" + (this.terminals_[L] || L) + "'" : ne = "Parse error on line " + (R + 1) + ": Unexpected " + (L == K ? "end of input" : "'" + (this.terminals_[L] || L) + "'"), this.parseError(ne, { text: $.match, token: this.terminals_[L] || L, line: $.yylineno, loc: A, expected: Zt }); } if (q[0] instanceof Array && q.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + j + ", token: " + L); switch (q[0]) { case 1: y.push(L), E.push($.yytext), c.push($.yylloc), y.push(q[1]), L = null, z = $.yyleng, o = $.yytext, R = $.yylineno, A = $.yylloc; break; case 2: if (lt = this.productions_[q[1]][1], st.$ = E[E.length - lt], st._$ = { first_line: c[c.length - (lt || 1)].first_line, last_line: c[c.length - 1].last_line, first_column: c[c.length - (lt || 1)].first_column, last_column: c[c.length - 1].last_column }, N && (st._$.range = [ c[c.length - (lt || 1)].range[0], c[c.length - 1].range[1] ]), rt = this.performAction.apply(st, [ o, z, R, at.yy, q[1], E, c ].concat(G)), typeof rt < "u") return rt; lt && (y = y.slice(0, -1 * lt * 2), E = E.slice(0, -1 * lt), c = c.slice(0, -1 * lt)), y.push(this.productions_[q[1]][0]), E.push(st.$), c.push(st._$), Ae = l[y[y.length - 2]][y[y.length - 1]], y.push(Ae); break; case 3: return !0; } } return !0; }, "parse") }, _ = /* @__PURE__ */ function() { var Y = { EOF: 1, parseError: /* @__PURE__ */ d(function(h, y) { if (this.yy.parser) this.yy.parser.parseError(h, y); else throw new Error(h); }, "parseError"), // resets the lexer, sets new input setInput: /* @__PURE__ */ d(function(u, h) { return this.yy = h || this.yy || {}, this._input = u, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this; }, "setInput"), // consumes and returns one char from the input input: /* @__PURE__ */ d(function() { var u = this._input[0]; this.yytext += u, this.yyleng++, this.offset++, this.match += u, this.matched += u; var h = u.match(/(?:\r\n?|\n).*/g); return h ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), u; }, "input"), // unshifts one char (or a string) into the input unput: /* @__PURE__ */ d(function(u) { var h = u.length, y = u.split(/(?:\r\n?|\n)/g); this._input = u + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - h), this.offset -= h; var m = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), y.length - 1 && (this.yylineno -= y.length - 1); var E = this.yylloc.range; return this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: y ? (y.length === m.length ? this.yylloc.first_column : 0) + m[m.length - y.length].length - y[0].length : this.yylloc.first_column - h }, this.options.ranges && (this.yylloc.range = [E[0], E[0] + this.yyleng - h]), this.yyleng = this.yytext.length, this; }, "unput"), // When called from action, caches matched text and appends it on next action more: /* @__PURE__ */ d(function() { return this._more = !0, this; }, "more"), // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject: /* @__PURE__ */ d(function() { if (this.options.backtrack_lexer) this._backtrack = !0; else return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).` + this.showPosition(), { text: "", token: null, line: this.yylineno }); return this; }, "reject"), // retain first n characters of the match less: /* @__PURE__ */ d(function(u) { this.unput(this.match.slice(u)); }, "less"), // displays already matched input, i.e. for error messages pastInput: /* @__PURE__ */ d(function() { var u = this.matched.substr(0, this.matched.length - this.match.length); return (u.length > 20 ? "..." : "") + u.substr(-20).replace(/\n/g, ""); }, "pastInput"), // displays upcoming input, i.e. for error messages upcomingInput: /* @__PURE__ */ d(function() { var u = this.match; return u.length < 20 && (u += this._input.substr(0, 20 - u.length)), (u.substr(0, 20) + (u.length > 20 ? "..." : "")).replace(/\n/g, ""); }, "upcomingInput"), // displays the character position where the lexing error occurred, i.e. for error messages showPosition: /* @__PURE__ */ d(function() { var u = this.pastInput(), h = new Array(u.length + 1).join("-"); return u + this.upcomingInput() + `` + h + "^"; }, "showPosition"), // test the lexed token: return FALSE when not a match, otherwise return token test_match: /* @__PURE__ */ d(function(u, h) { var y, m, E; if (this.options.backtrack_lexer && (E = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }, this.options.ranges && (E.yylloc.range = this.yylloc.range.slice(0))), m = u[0].match(/(?:\r\n?|\n).*/g), m && (this.yylineno += m.length), this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: m ? m[m.length - 1].length - m[m.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + u[0].length }, this.yytext += u[0], this.match += u[0], this.matches = u, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(u[0].length), this.matched += u[0], y = this.performAction.call(this, this.yy, this, h, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), y) return y; if (this._backtrack) { for (var c in E) this[c] = E[c]; return !1; } return !1; }, "test_match"), // return next match in input next: /* @__PURE__ */ d(function() { if (this.done) return this.EOF; this._input || (this.done = !0); var u, h, y, m; this._more || (this.yytext = "", this.match = ""); for (var E = this._currentRules(), c = 0; c < E.length; c++) if (y = this._input.match(this.rules[E[c]]), y && (!h || y[0].length > h[0].length)) { if (h = y, m = c, this.options.backtrack_lexer) { if (u = this.test_match(y, E[c]), u !== !1) return u; if (this._backtrack) { h = !1; continue; } else return !1; } else if (!this.options.flex) break; } return h ? (u = this.test_match(h, E[m]), u !== !1 ? u : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.` + this.showPosition(), { text: "", token: null, line: this.yylineno }); }, "next"), // return next match that has a token lex: /* @__PURE__ */ d(function() { var h = this.next(); return h || this.lex(); }, "lex"), // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin: /* @__PURE__ */ d(function(h) { this.conditionStack.push(h); }, "begin"), // pop the previously active lexer condition state off the condition stack popState: /* @__PURE__ */ d(function() { var h = this.conditionStack.length - 1; return h > 0 ? this.conditionStack.pop() : this.conditionStack[0]; }, "popState"), // produce the lexer rule set which is active for the currently active lexer condition state _currentRules: /* @__PURE__ */ d(function() { return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules; }, "_currentRules"), // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState: /* @__PURE__ */ d(function(h) { return h = this.conditionStack.length - 1 - Math.abs(h || 0), h >= 0 ? this.conditionStack[h] : "INITIAL"; }, "topState"), // alias for begin(condition) pushState: /* @__PURE__ */ d(function(h) { this.begin(h); }, "pushState"), // return the number of states currently on the stack stateStackSize: /* @__PURE__ */ d(function() { return this.conditionStack.length; }, "stateStackSize"), options: { "case-insensitive": !0 }, performAction: /* @__PURE__ */ d(function(h, y, m, E) { switch (m) { case 0: return this.begin("open_directive"), "open_directive"; case 1: return this.begin("acc_title"), 31; case 2: return this.popState(), "acc_title_value"; case 3: return this.begin("acc_descr"), 33; case 4: return this.popState(), "acc_descr_value"; case 5: this.begin("acc_descr_multiline"); break; case 6: this.popState(); break; case 7: return "acc_descr_multiline_value"; case 8: break; case 9: break; case 10: break; case 11: return 10; case 12: break; case 13: break; case 14: this.begin("href"); break; case 15: this.popState(); break; case 16: return 43; case 17: this.begin("callbackname"); break; case 18: this.popState(); break; case 19: this.popState(), this.begin("callbackargs"); break; case 20: return 41; case 21: this.popState(); break; case 22: return 42; case 23: this.begin("click"); break; case 24: this.popState(); break; case 25: return 40; case 26: return 4; case 27: return 22; case 28: return 23; case 29: return 24; case 30: return 25; case 31: return 26; case 32: return 28; case 33: return 27; case 34: return 29; case 35: return 12; case 36: return 13; case 37: return 14; case 38: return 15; case 39: return 16; case 40: return 17; case 41: return 18; case 42: return 20; case 43: return 21; case 44: return "date"; case 45: return 30; case 46: return "accDescription"; case 47: return 36; case 48: return 38; case 49: return 39; case 50: return ":"; case 51: return 6; case 52: return "INVALID"; } }, "anonymous"), rules: [/^(?:%%\{)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:%%(?!\{)*[^\n]*)/i, /^(?:[^\}]%%*[^\n]*)/i, /^(?:%%*[^\n]*[\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:%[^\n]*)/i, /^(?:href[\s]+["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:call[\s]+)/i, /^(?:\([\s]*\))/i, /^(?:\()/i, /^(?:[^(]*)/i, /^(?:\))/i, /^(?:[^)]*)/i, /^(?:click[\s]+)/i, /^(?:[\s\n])/i, /^(?:[^\s\n]*)/i, /^(?:gantt\b)/i, /^(?:dateFormat\s[^#\n;]+)/i, /^(?:inclusiveEndDates\b)/i, /^(?:topAxis\b)/i, /^(?:axisFormat\s[^#\n;]+)/i, /^(?:tickInterval\s[^#\n;]+)/i, /^(?:includes\s[^#\n;]+)/i, /^(?:excludes\s[^#\n;]+)/i, /^(?:todayMarker\s[^\n;]+)/i, /^(?:weekday\s+monday\b)/i, /^(?:weekday\s+tuesday\b)/i, /^(?:weekday\s+wednesday\b)/i, /^(?:weekday\s+thursday\b)/i, /^(?:weekday\s+friday\b)/i, /^(?:weekday\s+saturday\b)/i, /^(?:weekday\s+sunday\b)/i, /^(?:weekend\s+friday\b)/i, /^(?:weekend\s+saturday\b)/i, /^(?:\d\d\d\d-\d\d-\d\d\b)/i, /^(?:title\s[^\n]+)/i, /^(?:accDescription\s[^#\n;]+)/i, /^(?:section\s[^\n]+)/i, /^(?:[^:\n]+)/i, /^(?::[^#\n;]+)/i, /^(?::)/i, /^(?:$)/i, /^(?:.)/i], conditions: { acc_descr_multiline: { rules: [6, 7], inclusive: !1 }, acc_descr: { rules: [4], inclusive: !1 }, acc_title: { rules: [2], inclusive: !1 }, callbackargs: { rules: [21, 22], inclusive: !1 }, callbackname: { rules: [18, 19, 20], inclusive: !1 }, href: { rules: [15, 16], inclusive: !1 }, click: { rules: [24, 25], inclusive: !1 }, INITIAL: { rules: [0, 1, 3, 5, 8, 9, 10, 11, 12, 13, 14, 17, 23, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52], inclusive: !0 } } }; return Y; }(); S.lexer = _; function k() { this.yy = {}; } return d(k, "Parser"), k.prototype = S, S.Parser = k, new k();}();ye.parser = ye;var Ai = ye;it.extend(Fi);it.extend(Ui);it.extend(Li);var Ge = { friday: 5, saturday: 6 }, ut = "", Ce = "", De = void 0, Me = "", zt = [], Pt = [], _e = /* @__PURE__ */ new Map(), Se = [], te = [], Et = "", Fe = "", wn = ["active", "done", "crit", "milestone", "vert"], Ye = [], Rt = !1, Ue = !1, Ee = "sunday", ee = "saturday", ke = 0, Ii = /* @__PURE__ */ d(function() { Se = [], te = [], Et = "", Ye = [], Gt = 0, ve = void 0, jt = void 0, tt = [], ut = "", Ce = "", Fe = "", De = void 0, Me = "", zt = [], Pt = [], Rt = !1, Ue = !1, ke = 0, _e = /* @__PURE__ */ new Map(), Pn(), Ee = "sunday", ee = "saturday";}, "clear"), Wi = /* @__PURE__ */ d(function(t) { Ce = t;}, "setAxisFormat"), Hi = /* @__PURE__ */ d(function() { return Ce;}, "getAxisFormat"), Oi = /* @__PURE__ */ d(function(t) { De = t;}, "setTickInterval"), Ni = /* @__PURE__ */ d(function() { return De;}, "getTickInterval"), Vi = /* @__PURE__ */ d(function(t) { Me = t;}, "setTodayMarker"), zi = /* @__PURE__ */ d(function() { return Me;}, "getTodayMarker"), Pi = /* @__PURE__ */ d(function(t) { ut = t;}, "setDateFormat"), Ri = /* @__PURE__ */ d(function() { Rt = !0;}, "enableInclusiveEndDates"), Zi = /* @__PURE__ */ d(function() { return Rt;}, "endDatesAreInclusive"), Bi = /* @__PURE__ */ d(function() { Ue = !0;}, "enableTopAxis"), qi = /* @__PURE__ */ d(function() { return Ue;}, "topAxisEnabled"), Xi = /* @__PURE__ */ d(function(t) { Fe = t;}, "setDisplayMode"), Gi = /* @__PURE__ */ d(function() { return Fe;}, "getDisplayMode"), ji = /* @__PURE__ */ d(function() { return ut;}, "getDateFormat"), Qi = /* @__PURE__ */ d(function(t) { zt = t.toLowerCase().split(/[\s,]+/);}, "setIncludes"), $i = /* @__PURE__ */ d(function() { return zt;}, "getIncludes"), Ji = /* @__PURE__ */ d(function(t) { Pt = t.toLowerCase().split(/[\s,]+/);}, "setExcludes"), Ki = /* @__PURE__ */ d(function() { return Pt;}, "getExcludes"), ta = /* @__PURE__ */ d(function() { return _e;}, "getLinks"), ea = /* @__PURE__ */ d(function(t) { Et = t, Se.push(t);}, "addSection"), na = /* @__PURE__ */ d(function() { return Se;}, "getSections"), ra = /* @__PURE__ */ d(function() { let t = je(); const e = 10; let n = 0; for (; !t && n < e; ) t = je(), n++; return te = tt, te;}, "getTasks"), Cn = /* @__PURE__ */ d(function(t, e, n, r) { return r.includes(t.format(e.trim())) ? !1 : n.includes("weekends") && (t.isoWeekday() === Ge[ee] || t.isoWeekday() === Ge[ee] + 1) || n.includes(t.format("dddd").toLowerCase()) ? !0 : n.includes(t.format(e.trim()));}, "isInvalidDate"), ia = /* @__PURE__ */ d(function(t) { Ee = t;}, "setWeekday"), aa = /* @__PURE__ */ d(function() { return Ee;}, "getWeekday"), sa = /* @__PURE__ */ d(function(t) { ee = t;}, "setWeekend"), Dn = /* @__PURE__ */ d(function(t, e, n, r) { if (!n.length || t.manualEndTime) return; let i; t.startTime instanceof Date ? i = it(t.startTime) : i = it(t.startTime, e, !0), i = i.add(1, "d"); let a; t.endTime instanceof Date ? a = it(t.endTime) : a = it(t.endTime, e, !0); const [s, p] = oa( i, a, e, n, r ); t.endTime = s.toDate(), t.renderEndTime = p;}, "checkTaskDates"), oa = /* @__PURE__ */ d(function(t, e, n, r, i) { let a = !1, s = null; for (; t <= e; ) a || (s = e.toDate()), a = Cn(t, n, r, i), a && (e = e.add(1, "d")), t = t.add(1, "d"); return [e, s];}, "fixTaskDates"), pe = /* @__PURE__ */ d(function(t, e, n) { n = n.trim(); const i = /^after\s+(?<ids>[\d\w- ]+)/.exec(n); if (i !== null) { let s = null; for (const M of i.groups.ids.split(" ")) { let T = Dt(M); T !== void 0 && (!s || T.endTime > s.endTime) && (s = T); } if (s) return s.endTime; const p = /* @__PURE__ */ new Date(); return p.setHours(0, 0, 0, 0), p; } let a = it(n, e.trim(), !0); if (a.isValid()) return a.toDate(); { Qt.debug("Invalid date:" + n), Qt.debug("With date format:" + e.trim()); const s = new Date(n); if (s === void 0 || isNaN(s.getTime()) || // WebKit browsers can mis-parse invalid dates to be ridiculously // huge numbers, e.g. new Date('202304') gets parsed as January 1, 202304. // This can cause virtually infinite loops while rendering, so for the // purposes of Gantt charts we'll just treat any date beyond 10,000 AD/BC as // invalid. s.getFullYear() < -1e4 || s.getFullYear() > 1e4) throw new Error("Invalid date:" + n); return s; }}, "getStartDate"), Mn = /* @__PURE__ */ d(function(t) { const e = /^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim()); return e !== null ? [Number.parseFloat(e[1]), e[2]] : [NaN, "ms"];}, "parseDuration"), _n = /* @__PURE__ */ d(function(t, e, n, r = !1) { n = n.trim(); const a = /^until\s+(?<ids>[\d\w- ]+)/.exec(n); if (a !== null) { let g = null; for (const C of a.groups.ids.split(" ")) { let b = Dt(C); b !== void 0 && (!g || b.startTime < g.startTime) && (g = b); } if (g) return g.startTime; const U = /* @__PURE__ */ new Date(); return U.setHours(0, 0, 0, 0), U; } let s = it(n, e.trim(), !0); if (s.isValid()) return r && (s = s.add(1, "d")), s.toDate(); let p = it(t); const [M, T] = Mn(n); if (!Number.isNaN(M)) { const g = p.add(M, T); g.isValid() && (p = g); } return p.toDate();}, "getEndDate"), Gt = 0, Ft = /* @__PURE__ */ d(function(t) { return t === void 0 ? (Gt = Gt + 1, "task" + Gt) : t;}, "parseId"), ca = /* @__PURE__ */ d(function(t, e) { let n; e.substr(0, 1) === ":" ? n = e.substr(1, e.length) : n = e; const r = n.split(","), i = {}; Le(r, i, wn); for (let s = 0; s < r.length; s++) r[s] = r[s].trim(); let a = ""; switch (r.length) { case 1: i.id = Ft(), i.startTime = t.endTime, a = r[0]; break; case 2: i.id = Ft(), i.startTime = pe(void 0, ut, r[0]), a = r[1]; break; case 3: i.id = Ft(r[0]), i.startTime = pe(void 0, ut, r[1]), a = r[2]; break; } return a && (i.endTime = _n(i.startTime, ut, a, Rt), i.manualEndTime = it(a, "YYYY-MM-DD", !0).isValid(), Dn(i, ut, Pt, zt)), i;}, "compileData"), la = /* @__PURE__ */ d(function(t, e) { let n; e.substr(0, 1) === ":" ? n = e.substr(1, e.length) : n = e; const r = n.split(","), i = {}; Le(r, i, wn); for (let a = 0; a < r.length; a++) r[a] = r[a].trim(); switch (r.length) { case 1: i.id = Ft(), i.startTime = { type: "prevTaskEnd", id: t }, i.endTime = { data: r[0] }; break; case 2: i.id = Ft(), i.startTime = { type: "getStartDate", startData: r[0] }, i.endTime = { data: r[1] }; break; case 3: i.id = Ft(r[0]), i.startTime = { type: "getStartDate", startData: r[1] }, i.endTime = { data: r[2] }; break; } return i;}, "parseData"), ve, jt, tt = [], Sn = {}, ua = /* @__PURE__ */ d(function(t, e) { const n = { section: Et, type: Et, processed: !1, manualEndTime: !1, renderEndTime: null, raw: { data: e }, task: t, classes: [] }, r = la(jt, e); n.raw.startTime = r.startTime, n.raw.endTime = r.endTime, n.id = r.id, n.prevTaskId = jt, n.active = r.active, n.done = r.done, n.crit = r.crit, n.milestone = r.milestone, n.vert = r.vert, n.order = ke, ke++; const i = tt.push(n); jt = n.id, Sn[n.id] = i - 1;}, "addTask"), Dt = /* @__PURE__ */ d(function(t) { const e = Sn[t]; return tt[e];}, "findTaskById"), fa = /* @__PURE__ */ d(function(t, e) { const n = { section: Et, type: Et, description: t, task: t, classes: [] }, r = ca(ve, e); n.startTime = r.startTime, n.endTime = r.endTime, n.id = r.id, n.active = r.active, n.done = r.done, n.crit = r.crit, n.milestone = r.milestone, n.vert = r.vert, ve = n, te.push(n);}, "addTaskOrg"), je = /* @__PURE__ */ d(function() { const t = /* @__PURE__ */ d(function(n) { const r = tt[n]; let i = ""; switch (tt[n].raw.startTime.type) { case "prevTaskEnd": { const a = Dt(r.prevTaskId); r.startTime = a.endTime; break; } case "getStartDate": i = pe(void 0, ut, tt[n].raw.startTime.startData), i && (tt[n].startTime = i); break; } return tt[n].startTime && (tt[n].endTime = _n( tt[n].startTime, ut, tt[n].raw.endTime.data, Rt ), tt[n].endTime && (tt[n].processed = !0, tt[n].manualEndTime = it( tt[n].raw.endTime.data, "YYYY-MM-DD", !0 ).isValid(), Dn(tt[n], ut, Pt, zt))), tt[n].processed; }, "compileTask"); let e = !0; for (const [n, r] of tt.entries()) t(n), e = e && r.processed; return e;}, "compileTasks"), ha = /* @__PURE__ */ d(function(t, e) { let n = e; _t().securityLevel !== "loose" && (n = zn(e)), t.split(",").forEach(function(r) { Dt(r) !== void 0 && (Yn(r, () => { window.open(n, "_self"); }), _e.set(r, n)); }), Fn(t, "clickable");}, "setLink"), Fn = /* @__PURE__ */ d(function(t, e) { t.split(",").forEach(function(n) { let r = Dt(n); r !== void 0 && r.classes.push(e); });}, "setClass"), da = /* @__PURE__ */ d(function(t, e, n) { if (_t().securityLevel !== "loose" || e === void 0) return; let r = []; if (typeof n == "string") { r = n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/); for (let a = 0; a < r.length; a++) { let s = r[a].trim(); s.startsWith('"') && s.endsWith('"') && (s = s.substr(1, s.length - 2)), r[a] = s; } } r.length === 0 && r.push(t), Dt(t) !== void 0 && Yn(t, () => { Rn.runFunc(e, ...r); });}, "setClickFun"), Yn = /* @__PURE__ */ d(function(t, e) { Ye.push( function() { const n = document.querySelector(`[id="${t}"]`); n !== null && n.addEventListener("click", function() { e(); }); }, function() { const n = document.querySelector(`[id="${t}-text"]`); n !== null && n.addEventListener("click", function() { e(); }); } );}, "pushFun"), ma = /* @__PURE__ */ d(function(t, e, n) { t.split(",").forEach(function(r) { da(r, e, n); }), Fn(t, "clickable");}, "setClickEvent"), ga = /* @__PURE__ */ d(function(t) { Ye.forEach(function(e) { e(t); });}, "bindFunctions"), ya = { getConfig: /* @__PURE__ */ d(() => _t().gantt, "getConfig"), clear: Ii, setDateFormat: Pi, getDateFormat: ji, enableInclusiveEndDates: Ri, endDatesAreInclusive: Zi, enableTopAxis: Bi, topAxisEnabled: qi, setAxisFormat: Wi, getAxisFormat: Hi, setTickInterval: Oi, getTickInterval: Ni, setTodayMarker: Vi, getTodayMarker: zi, setAccTitle: On, getAccTitle: Hn, setDiagramTitle: Wn, getDiagramTitle: In, setDisplayMode: Xi, getDisplayMode: Gi, setAccDescription: An, getAccDescription: Ln, addSection: ea, getSections: na, getTasks: ra, addTask: ua, findTaskById: Dt, addTaskOrg: fa, setIncludes: Qi, getIncludes: $i, setExcludes: Ji, getExcludes: Ki, setClickEvent: ma, setLink: ha, getLinks: ta, bindFunctions: ga, parseDuration: Mn, isInvalidDate: Cn, setWeekday: ia, getWeekday: aa, setWeekend: sa};function Le(t, e, n) { let r = !0; for (; r; ) r = !1, n.forEach(function(i) { const a = "^\\s*" + i + "\\s*$", s = new RegExp(a); t[0].match(s) && (e[i] = !0, t.shift(1), r = !0); });}d(Le, "getTaskTags");var ka = /* @__PURE__ */ d(function() { Qt.debug("Something is calling, setConf, remove the call");}, "setConf"), Qe = { monday: Ot, tuesday: un, wednesday: fn, thursday: bt, friday: hn, saturday: dn, sunday: Vt}, pa = /* @__PURE__ */ d((t, e) => { let n = [...t].map(() => -1 / 0), r = [...t].sort((a, s) => a.startTime - s.startTime || a.order - s.order), i = 0; for (const a of r) for (let s = 0; s < n.length; s++) if (a.startTime >= n[s]) { n[s] = a.endTime, a.order = s + e, s > i && (i = s); break; } return i;}, "getMaxIntersections"), ht, va = /* @__PURE__ */ d(function(t, e, n, r) { const i = _t().gantt, a = _t().securityLevel; let s; a === "sandbox" && (s = Bt("#i" + e)); const p = a === "sandbox" ? Bt(s.nodes()[0].contentDocument.body) : Bt("body"), M = a === "sandbox" ? s.nodes()[0].contentDocument : document, T = M.getElementById(e); ht = T.parentElement.offsetWidth, ht === void 0 && (ht = 1200), i.useWidth !== void 0 && (ht = i.useWidth); const g = r.db.getTasks(); let U = []; for (const x of g) U.push(x.type); U = O(U); const C = {}; let b = 2 * i.topPadding; if (r.db.getDisplayMode() === "compact" || i.displayMode === "compact") { const x = {}; for (const S of g) x[S.section] === void 0 ? x[S.section] = [S] : x[S.section].push(S); let F = 0; for (const S of Object.keys(x)) { const _ = pa(x[S], F) + 1; F += _, b += _ * (i.barHeight + i.barGap), C[S] = _; } } else { b += g.length * (i.barHeight + i.barGap); for (const x of U) C[x] = g.filter((F) => F.type === x).length; } T.setAttribute("viewBox", "0 0 " + ht + " " + b); const X = p.select(`[id="${e}"]`), H = _i().domain([ Qn(g, function(x) { return x.startTime; }), jn(g, function(x) { return x.endTime; }) ]).rangeRound([0, ht - i.leftPadding - i.rightPadding]); function D(x, F) { const S = x.startTime, _ = F.startTime; let k = 0; return S > _ ? k = 1 : S < _ && (k = -1), k; } d(D, "taskCompare"), g.sort(D), I(g, ht, b), Nn(X, b, ht, i.useMaxWidth), X.append("text").text(r.db.getDiagramTitle()).attr("x", ht / 2).attr("y", i.titleTopMargin).attr("class", "titleText"); function I(x, F, S) { const _ = i.barHeight, k = _ + i.barGap, Y = i.topPadding, u = i.leftPadding, h = Xn().domain([0, U.length]).range(["#00B9FA", "#F95002"]).interpolate(fr); W( k, Y, u, F, S, x, r.db.getExcludes(), r.db.getIncludes() ), B(u, Y, F, S), V(x, k, Y, u, _, h, F), Q(k, Y), w(u, Y, F, S); } d(I, "makeGantt"); function V(x, F, S, _, k, Y, u) { x.sort((l, o) => l.vert === o.vert ? 0 : l.vert ? 1 : -1); const y = [...new Set(x.map((l) => l.order))].map((l) => x.find((o) => o.order === l)); X.append("g").selectAll("rect").data(y).enter().append("rect").attr("x", 0).attr("y", function(l, o) { return o = l.order, o * F + S - 2; }).attr("width", function() { return u - i.rightPadding / 2; }).attr("height", F).attr("class", function(l) { for (const [o, R] of U.entries()) if (l.type === R) return "section section" + o % i.numberSectionStyles; return "section section0"; }).enter(); const m = X.append("g").selectAll("rect").data(x).enter(), E = r.db.getLinks(); if (m.append("rect").attr("id", function(l) { return l.id; }).attr("rx", 3).attr("ry", 3).attr("x", function(l) { return l.milestone ? H(l.startTime) + _ + 0.5 * (H(l.endTime) - H(l.startTime)) - 0.5 * k : H(l.startTime) + _; }).attr("y", function(l, o) { return o = l.order, l.vert ? i.gridLineStartPadding : o * F + S; }).attr("width", function(l) { return l.milestone ? k : l.vert ? 0.08 * k : H(l.renderEndTime || l.endTime) - H(l.startTime); }).attr("height", function(l) { return l.vert ? g.length * (i.barHeight + i.barGap) + i.barHeight * 2 : k; }).attr("transform-origin", function(l, o) { return o = l.order, (H(l.startTime) + _ + 0.5 * (H(l.endTime) - H(l.startTime))).toString() + "px " + (o * F + S + 0.5 * k).toString() + "px"; }).attr("class", function(l) { const o = "task"; let R = ""; l.classes.length > 0 && (R = l.classes.join(" ")); let z = 0; for (const [K, G] of U.entries()) l.type === G && (z = K % i.numberSectionStyles); let P = ""; return l.active ? l.crit ? P += " activeCrit" : P = " active" : l.done ? l.crit ? P = " doneCrit" : P = " done" : l.crit && (P += " crit"), P.length === 0 && (P = " task"), l.milestone && (P = " milestone " + P), l.vert && (P = " vert " + P), P += z, P += " " + R, o + P; }), m.append("text").attr("id", function(l) { return l.id + "-text"; }).text(function(l) { return l.task; }).attr("font-size", i.fontSize).attr("x", function(l) { let o = H(l.startTime), R = H(l.renderEndTime || l.endTime); if (l.milestone && (o += 0.5 * (H(l.endTime) - H(l.startTime)) - 0.5 * k, R = o + k), l.vert) return H(l.startTime) + _; const z = this.getBBox().width; return z > R - o ? R + z + 1.5 * i.leftPadding > u ? o + _ - 5 : R + _ + 5 : (R - o) / 2 + o + _; }).attr("y", function(l, o) { return l.vert ? i.gridLineStartPadding + g.length * (i.barHeight + i.barGap) + 60 : (o = l.order, o * F + i.barHeight / 2 + (i.fontSize / 2 - 2) + S); }).attr("text-height", k).attr("class", function(l) { const o = H(l.startTime); let R = H(l.endTime); l.milestone && (R = o + k); const z = this.getBBox().width; let P = ""; l.classes.length > 0 && (P = l.classes.join(" ")); let K = 0; for (const [$, at] of U.entries()) l.type === at && (K = $ % i.numberSectionStyles); let G = ""; return l.active && (l.crit ? G = "activeCritText" + K : G = "activeText" + K), l.done ? l.crit ? G = G + " doneCritText" + K : G = G + " doneText" + K : l.crit && (G = G + " critText" + K), l.milestone && (G += " milestoneText"), l.vert && (G += " vertText"), z > R - o ? R + z + 1.5 * i.leftPadding > u ? P + " taskTextOutsideLeft taskTextOutside" + K + " " + G : P + " taskTextOutsideRight taskTextOutside" + K + " " + G + " width-" + z : P + " taskText taskText" + K + " " + G + " width-" + z; }), _t().securityLevel === "sandbox") { let l; l = Bt("#i" + e); const o = l.nodes()[0].contentDocument; m.filter(function(R) { return E.has(R.id); }).each(function(R) { var z = o.querySelector("#" + R.id), P = o.querySelector("#" + R.id + "-text"); const K = z.parentNode; var G = o.createElement("a"); G.setAttribute("xlink:href", E.get(R.id)), G.setAttribute("target", "_top"), K.appendChild(G), G.appendChild(z), G.appendChild(P); }); } } d(V, "drawRects"); function W(x, F, S, _, k, Y, u, h) { if (u.length === 0 && h.length === 0) return; let y, m; for (const { startTime: z, endTime: P } of Y) (y === void 0 || z < y) && (y = z), (m === void 0 || P > m) && (m = P); if (!y || !m) return; if (it(m).diff(it(y), "year") > 5) { Qt.warn( "The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days." ); return; } const E = r.db.getDateFormat(), c = []; let l = null, o = it(y); for (; o.valueOf() <= m; ) r.db.isInvalidDate(o, E, u, h) ? l ? l.end = o : l = { start: o, end: o } : l && (c.push(l), l = null), o = o.add(1, "d"); X.append("g").selectAll("rect").data(c).enter().append("rect").attr("id", function(z) { return "exclude-" + z.start.format("YYYY-MM-DD"); }).attr("x", function(z) { return H(z.start) + S; }).attr("y", i.gridLineStartPadding).attr("width", function(z) { const P = z.end.add(1, "day"); return H(P) - H(z.start); }).attr("height", k - F - i.gridLineStartPadding).attr("transform-origin", function(z, P) { return (H(z.start) + S + 0.5 * (H(z.end) - H(z.start))).toString() + "px " + (P * x + 0.5 * k).toString() + "px"; }).attr("class", "exclude-range"); } d(W, "drawExcludeDays"); function B(x, F, S, _) { let k = ir(H).tickSize(-_ + F + i.gridLineStartPadding).tickFormat(Kt(r.db.getAxisFormat() || i.axisFormat || "%Y-%m-%d")); const u = /^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec( r.db.getTickInterval() || i.tickInterval ); if (u !== null) { const h = u[1], y = u[2], m = r.db.getWeekday() || i.weekday; switch (y) { case "millisecond": k.ticks(Yt.every(h)); break; case "second": k.ticks(vt.every(h)); break; case "minute": k.ticks(Wt.every(h)); break; case "hour": k.ticks(Ht.every(h)); break; case "day": k.ticks(Tt.every(h)); break; case "week": k.ticks(Qe[m].every(h)); break; case "month": k.ticks(Nt.every(h)); break; } } if (X.append("g").attr("class", "grid").attr("transform", "translate(" + x + ", " + (_ - 50) + ")").call(k).selectAll("text").style("text-anchor", "middle").attr("fill", "#000").attr("stroke", "none").attr("font-size", 10).attr("dy", "1em"), r.db.topAxisEnabled() || i.topAxis) { let h = rr(H).tickSize(-_ + F + i.gridLineStartPadding).tickFormat(Kt(r.db.getAxisFormat() || i.axisFormat || "%Y-%m-%d")); if (u !== null) { const y = u[1], m = u[2], E = r.db.getWeekday() || i.weekday; switch (m) { case "millisecond": h.ticks(Yt.every(y)); break; case "second": h.ticks(vt.every(y)); break; case "minute": h.ticks(Wt.every(y)); break; case "hour": h.ticks(Ht.every(y)); break; case "day": h.ticks(Tt.every(y)); break; case "week": h.ticks(Qe[E].every(y)); break; case "month": h.ticks(Nt.every(y)); break; } } X.append("g").attr("class", "grid").attr("transform", "translate(" + x + ", " + F + ")").call(h).selectAll("text").style("text-anchor", "middle").attr("fill", "#000").attr("stroke", "none").attr("font-size", 10); } } d(B, "makeGrid"); function Q(x, F) { let S = 0; const _ = Object.keys(C).map((k) => [k, C[k]]); X.append("g").selectAll("text").data(_).enter().append(function(k) { const Y = k[0].split(Vn.lineBreakRegex), u = -(Y.length - 1) / 2, h = M.createElementNS("http://www.w3.org/2000/svg", "text"); h.setAttribute("dy", u + "em"); for (const [y, m] of Y.entries()) { const E = M.createElementNS("http://www.w3.org/2000/svg", "tspan"); E.setAttribute("alignment-baseline", "central"), E.setAttribute("x", "10"), y > 0 && E.setAttribute("dy", "1em"), E.textContent = m, h.appendChild(E); } return h; }).attr("x", 10).attr("y", function(k, Y) { if (Y > 0) for (let u = 0; u < Y; u++) return S += _[Y - 1][1], k[1] * x / 2 + S * x + F; else return k[1] * x / 2 + F; }).attr("font-size", i.sectionFontSize).attr("class", function(k) { for (const [Y, u] of U.entries()) if (k[0] === u) return "sectionTitle sectionTitle" + Y % i.numberSectionStyles; return "sectionTitle"; }); } d(Q, "vertLabels"); function w(x, F, S, _) { const k = r.db.getTodayMarker(); if (k === "off") return; const Y = X.append("g").attr("class", "today"), u = /* @__PURE__ */ new Date(), h = Y.append("line"); h.attr("x1", H(u) + x).attr("x2", H(u) + x).attr("y1", i.titleTopMargin).attr("y2", _ - i.titleTopMargin).attr("class", "today"), k !== "" && h.attr("style", k.replace(/,/g, ";")); } d(w, "drawToday"); function O(x) { const F = {}, S = []; for (let _ = 0, k = x.length; _ < k; ++_) Object.prototype.hasOwnProperty.call(F, x[_]) || (F[x[_]] = !0, S.push(x[_])); return S; } d(O, "checkUnique");}, "draw"), Ta = { setConf: ka, draw: va}, ba = /* @__PURE__ */ d((t) => ` .mermaid-main-font { font-family: ${t.fontFamily}; }
.exclude-range { fill: ${t.excludeBkgColor}; }
.section { stroke: none; opacity: 0.2; }
.section0 { fill: ${t.sectionBkgColor}; }
.section2 { fill: ${t.sectionBkgColor2}; }
.section1, .section3 { fill: ${t.altSectionBkgColor}; opacity: 0.2; }
.sectionTitle0 { fill: ${t.titleColor}; }
.sectionTitle1 { fill: ${t.titleColor}; }
.sectionTitle2 { fill: ${t.titleColor}; }
.sectionTitle3 { fill: ${t.titleColor}; }
.sectionTitle { text-anchor: start; font-family: ${t.fontFamily}; }
/* Grid and axis */
.grid .tick { stroke: ${t.gridColor}; opacity: 0.8; shape-rendering: crispEdges; }
.grid .tick text { font-family: ${t.fontFamily}; fill: ${t.textColor}; }
.grid path { stroke-width: 0; }
/* Today line */
.today { fill: none; stroke: ${t.todayLineColor}; stroke-width: 2px; }
/* Task styling */
/* Default task */
.task { stroke-width: 2; }
.taskText { text-anchor: middle; font-family: ${t.fontFamily}; }
.taskTextOutsideRight { fill: ${t.taskTextDarkColor}; text-anchor: start; font-family: ${t.fontFamily}; }
.taskTextOutsideLeft { fill: ${t.taskTextDarkColor}; text-anchor: end; }
/* Special case clickable */
.task.clickable { cursor: pointer; }
.taskText.clickable { cursor: pointer; fill: ${t.taskTextClickableColor} !important; font-weight: bold; }
.taskTextOutsideLeft.clickable { cursor: pointer; fill: ${t.taskTextClickableColor} !important; font-weight: bold; }
.taskTextOutsideRight.clickable { cursor: pointer; fill: ${t.taskTextClickableColor} !important; font-weight: bold; }
/* Specific task settings for the sections*/
.taskText0, .taskText1, .taskText2, .taskText3 { fill: ${t.taskTextColor}; }
.task0, .task1, .task2, .task3 { fill: ${t.taskBkgColor}; stroke: ${t.taskBorderColor}; }
.taskTextOutside0, .taskTextOutside2 { fill: ${t.taskTextOutsideColor}; }
.taskTextOutside1, .taskTextOutside3 { fill: ${t.taskTextOutsideColor}; }
/* Active task */
.active0, .active1, .active2, .active3 { fill: ${t.activeTaskBkgColor}; stroke: ${t.activeTaskBorderColor}; }
.activeText0, .activeText1, .activeText2, .activeText3 { fill: ${t.taskTextDarkColor} !important; }
/* Completed task */
.done0, .done1, .done2, .done3 { stroke: ${t.doneTaskBorderColor}; fill: ${t.doneTaskBkgColor}; stroke-width: 2; }
.doneText0, .doneText1, .doneText2, .doneText3 { fill: ${t.taskTextDarkColor} !important; }
/* Tasks on the critical line */
.crit0, .crit1, .crit2, .crit3 { stroke: ${t.critBorderColor}; fill: ${t.critBkgColor}; stroke-width: 2; }
.activeCrit0, .activeCrit1, .activeCrit2, .activeCrit3 { stroke: ${t.critBorderColor}; fill: ${t.activeTaskBkgColor}; stroke-width: 2; }
.doneCrit0, .doneCrit1, .doneCrit2, .doneCrit3 { stroke: ${t.critBorderColor}; fill: ${t.doneTaskBkgColor}; stroke-width: 2; cursor: pointer; shape-rendering: crispEdges; }
.milestone { transform: rotate(45deg) scale(0.8,0.8); }
.milestoneText { font-style: italic; } .doneCritText0, .doneCritText1, .doneCritText2, .doneCritText3 { fill: ${t.taskTextDarkColor} !important; }
.vert { stroke: ${t.vertLineColor}; }
.vertText { font-size: 15px; text-anchor: middle; fill: ${t.vertLineColor} !important; }
.activeCritText0, .activeCritText1, .activeCritText2, .activeCritText3 { fill: ${t.taskTextDarkColor} !important; }
.titleText { text-anchor: middle; font-size: 18px; fill: ${t.titleColor || t.textColor}; font-family: ${t.fontFamily}; }`, "getStyles"), xa = ba, _a = { parser: Ai, db: ya, renderer: Ta, styles: xa};export { _a as diagram};123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712import { p as Z } from "./chunk-44GW5IO5-Ohm2b7Vh.js";import { I as F } from "./chunk-BQPDZTM5-D5dg_mRt.js";import { _ as h, q as U, p as rr, s as er, g as tr, a as ar, b as nr, l as w, c as sr, d as or, u as cr, C as ir, y as dr, k as B, D as hr, E as lr, F as $r, G as fr } from "./mermaid.core-BiIw1_mh.js";import { p as gr } from "./radar-VG2SY3DT-DUR9h7DO.js";var x = { NORMAL: 0, REVERSE: 1, HIGHLIGHT: 2, MERGE: 3, CHERRY_PICK: 4}, yr = $r.gitGraph, z = /* @__PURE__ */ h(() => hr({ ...yr, ...lr().gitGraph}), "getConfig"), i = new F(() => { const t = z(), r = t.mainBranchName, a = t.mainBranchOrder; return { mainBranchName: r, commits: /* @__PURE__ */ new Map(), head: null, branchConfig: /* @__PURE__ */ new Map([[r, { name: r, order: a }]]), branches: /* @__PURE__ */ new Map([[r, null]]), currBranch: r, direction: "LR", seq: 0, options: {} };});function S() { return fr({ length: 7 });}h(S, "getID");function N(t, r) { const a = /* @__PURE__ */ Object.create(null); return t.reduce((s, e) => { const n = r(e); return a[n] || (a[n] = !0, s.push(e)), s; }, []);}h(N, "uniqBy");var ur = /* @__PURE__ */ h(function(t) { i.records.direction = t;}, "setDirection"), xr = /* @__PURE__ */ h(function(t) { w.debug("options str", t), t = t == null ? void 0 : t.trim(), t = t || "{}"; try { i.records.options = JSON.parse(t); } catch (r) { w.error("error while parsing gitGraph options", r.message); }}, "setOptions"), pr = /* @__PURE__ */ h(function() { return i.records.options;}, "getOptions"), br = /* @__PURE__ */ h(function(t) { let r = t.msg, a = t.id; const s = t.type; let e = t.tags; w.info("commit", r, a, s, e), w.debug("Entering commit:", r, a, s, e); const n = z(); a = B.sanitizeText(a, n), r = B.sanitizeText(r, n), e = e == null ? void 0 : e.map((o) => B.sanitizeText(o, n)); const c = { id: a || i.records.seq + "-" + S(), message: r, seq: i.records.seq++, type: s ?? x.NORMAL, tags: e ?? [], parents: i.records.head == null ? [] : [i.records.head.id], branch: i.records.currBranch }; i.records.head = c, w.info("main branch", n.mainBranchName), i.records.commits.set(c.id, c), i.records.branches.set(i.records.currBranch, c.id), w.debug("in pushCommit " + c.id);}, "commit"), mr = /* @__PURE__ */ h(function(t) { let r = t.name; const a = t.order; if (r = B.sanitizeText(r, z()), i.records.branches.has(r)) throw new Error( `Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")` ); i.records.branches.set(r, i.records.head != null ? i.records.head.id : null), i.records.branchConfig.set(r, { name: r, order: a }), _(r), w.debug("in createBranch");}, "branch"), wr = /* @__PURE__ */ h((t) => { let r = t.branch, a = t.id; const s = t.type, e = t.tags, n = z(); r = B.sanitizeText(r, n), a && (a = B.sanitizeText(a, n)); const c = i.records.branches.get(i.records.currBranch), o = i.records.branches.get(r), $ = c ? i.records.commits.get(c) : void 0, l = o ? i.records.commits.get(o) : void 0; if ($ && l && $.branch === r) throw new Error(`Cannot merge branch '${r}' into itself.`); if (i.records.currBranch === r) { const d = new Error('Incorrect usage of "merge". Cannot merge a branch to itself'); throw d.hash = { text: `merge ${r}`, token: `merge ${r}`, expected: ["branch abc"] }, d; } if ($ === void 0 || !$) { const d = new Error( `Incorrect usage of "merge". Current branch (${i.records.currBranch})has no commits` ); throw d.hash = { text: `merge ${r}`, token: `merge ${r}`, expected: ["commit"] }, d; } if (!i.records.branches.has(r)) { const d = new Error( 'Incorrect usage of "merge". Branch to be merged (' + r + ") does not exist" ); throw d.hash = { text: `merge ${r}`, token: `merge ${r}`, expected: [`branch ${r}`] }, d; } if (l === void 0 || !l) { const d = new Error( 'Incorrect usage of "merge". Branch to be merged (' + r + ") has no commits" ); throw d.hash = { text: `merge ${r}`, token: `merge ${r}`, expected: ['"commit"'] }, d; } if ($ === l) { const d = new Error('Incorrect usage of "merge". Both branches have same head'); throw d.hash = { text: `merge ${r}`, token: `merge ${r}`, expected: ["branch abc"] }, d; } if (a && i.records.commits.has(a)) { const d = new Error( 'Incorrect usage of "merge". Commit with id:' + a + " already exists, use different custom id" ); throw d.hash = { text: `merge ${r} ${a} ${s} ${e == null ? void 0 : e.join(" ")}`, token: `merge ${r} ${a} ${s} ${e == null ? void 0 : e.join(" ")}`, expected: [ `merge ${r} ${a}_UNIQUE ${s} ${e == null ? void 0 : e.join(" ")}` ] }, d; } const f = o || "", g = { id: a || `${i.records.seq}-${S()}`, message: `merged branch ${r} into ${i.records.currBranch}`, seq: i.records.seq++, parents: i.records.head == null ? [] : [i.records.head.id, f], branch: i.records.currBranch, type: x.MERGE, customType: s, customId: !!a, tags: e ?? [] }; i.records.head = g, i.records.commits.set(g.id, g), i.records.branches.set(i.records.currBranch, g.id), w.debug(i.records.branches), w.debug("in mergeBranch");}, "merge"), vr = /* @__PURE__ */ h(function(t) { let r = t.id, a = t.targetId, s = t.tags, e = t.parent; w.debug("Entering cherryPick:", r, a, s); const n = z(); if (r = B.sanitizeText(r, n), a = B.sanitizeText(a, n), s = s == null ? void 0 : s.map(($) => B.sanitizeText($, n)), e = B.sanitizeText(e, n), !r || !i.records.commits.has(r)) { const $ = new Error( 'Incorrect usage of "cherryPick". Source commit id should exist and provided' ); throw $.hash = { text: `cherryPick ${r} ${a}`, token: `cherryPick ${r} ${a}`, expected: ["cherry-pick abc"] }, $; } const c = i.records.commits.get(r); if (c === void 0 || !c) throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided'); if (e && !(Array.isArray(c.parents) && c.parents.includes(e))) throw new Error( "Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit." ); const o = c.branch; if (c.type === x.MERGE && !e) throw new Error( "Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified." ); if (!a || !i.records.commits.has(a)) { if (o === i.records.currBranch) { const g = new Error( 'Incorrect usage of "cherryPick". Source commit is already on current branch' ); throw g.hash = { text: `cherryPick ${r} ${a}`, token: `cherryPick ${r} ${a}`, expected: ["cherry-pick abc"] }, g; } const $ = i.records.branches.get(i.records.currBranch); if ($ === void 0 || !$) { const g = new Error( `Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits` ); throw g.hash = { text: `cherryPick ${r} ${a}`, token: `cherryPick ${r} ${a}`, expected: ["cherry-pick abc"] }, g; } const l = i.records.commits.get($); if (l === void 0 || !l) { const g = new Error( `Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits` ); throw g.hash = { text: `cherryPick ${r} ${a}`, token: `cherryPick ${r} ${a}`, expected: ["cherry-pick abc"] }, g; } const f = { id: i.records.seq + "-" + S(), message: `cherry-picked ${c == null ? void 0 : c.message} into ${i.records.currBranch}`, seq: i.records.seq++, parents: i.records.head == null ? [] : [i.records.head.id, c.id], branch: i.records.currBranch, type: x.CHERRY_PICK, tags: s ? s.filter(Boolean) : [ `cherry-pick:${c.id}${c.type === x.MERGE ? `|parent:${e}` : ""}` ] }; i.records.head = f, i.records.commits.set(f.id, f), i.records.branches.set(i.records.currBranch, f.id), w.debug(i.records.branches), w.debug("in cherryPick"); }}, "cherryPick"), _ = /* @__PURE__ */ h(function(t) { if (t = B.sanitizeText(t, z()), i.records.branches.has(t)) { i.records.currBranch = t; const r = i.records.branches.get(i.records.currBranch); r === void 0 || !r ? i.records.head = null : i.records.head = i.records.commits.get(r) ?? null; } else { const r = new Error( `Trying to checkout branch which is not yet created. (Help try using "branch ${t}")` ); throw r.hash = { text: `checkout ${t}`, token: `checkout ${t}`, expected: [`branch ${t}`] }, r; }}, "checkout");function A(t, r, a) { const s = t.indexOf(r); s === -1 ? t.push(a) : t.splice(s, 1, a);}h(A, "upsert");function D(t) { const r = t.reduce((e, n) => e.seq > n.seq ? e : n, t[0]); let a = ""; t.forEach(function(e) { e === r ? a += " *" : a += " |"; }); const s = [a, r.id, r.seq]; for (const e in i.records.branches) i.records.branches.get(e) === r.id && s.push(e); if (w.debug(s.join(" ")), r.parents && r.parents.length == 2 && r.parents[0] && r.parents[1]) { const e = i.records.commits.get(r.parents[0]); A(t, r, e), r.parents[1] && t.push(i.records.commits.get(r.parents[1])); } else { if (r.parents.length == 0) return; if (r.parents[0]) { const e = i.records.commits.get(r.parents[0]); A(t, r, e); } } t = N(t, (e) => e.id), D(t);}h(D, "prettyPrintCommitHistory");var Cr = /* @__PURE__ */ h(function() { w.debug(i.records.commits); const t = V()[0]; D([t]);}, "prettyPrint"), Er = /* @__PURE__ */ h(function() { i.reset(), dr();}, "clear"), Br = /* @__PURE__ */ h(function() { return [...i.records.branchConfig.values()].map((r, a) => r.order !== null && r.order !== void 0 ? r : { ...r, order: parseFloat(`0.${a}`) }).sort((r, a) => (r.order ?? 0) - (a.order ?? 0)).map(({ name: r }) => ({ name: r }));}, "getBranchesAsObjArray"), kr = /* @__PURE__ */ h(function() { return i.records.branches;}, "getBranches"), Lr = /* @__PURE__ */ h(function() { return i.records.commits;}, "getCommits"), V = /* @__PURE__ */ h(function() { const t = [...i.records.commits.values()]; return t.forEach(function(r) { w.debug(r.id); }), t.sort((r, a) => r.seq - a.seq), t;}, "getCommitsArray"), Tr = /* @__PURE__ */ h(function() { return i.records.currBranch;}, "getCurrentBranch"), Mr = /* @__PURE__ */ h(function() { return i.records.direction;}, "getDirection"), Rr = /* @__PURE__ */ h(function() { return i.records.head;}, "getHead"), X = { commitType: x, getConfig: z, setDirection: ur, setOptions: xr, getOptions: pr, commit: br, branch: mr, merge: wr, cherryPick: vr, checkout: _, //reset, prettyPrint: Cr, clear: Er, getBranchesAsObjArray: Br, getBranches: kr, getCommits: Lr, getCommitsArray: V, getCurrentBranch: Tr, getDirection: Mr, getHead: Rr, setAccTitle: nr, getAccTitle: ar, getAccDescription: tr, setAccDescription: er, setDiagramTitle: rr, getDiagramTitle: U}, Ir = /* @__PURE__ */ h((t, r) => { Z(t, r), t.dir && r.setDirection(t.dir); for (const a of t.statements) qr(a, r);}, "populate"), qr = /* @__PURE__ */ h((t, r) => { const s = { Commit: /* @__PURE__ */ h((e) => r.commit(Or(e)), "Commit"), Branch: /* @__PURE__ */ h((e) => r.branch(zr(e)), "Branch"), Merge: /* @__PURE__ */ h((e) => r.merge(Gr(e)), "Merge"), Checkout: /* @__PURE__ */ h((e) => r.checkout(Hr(e)), "Checkout"), CherryPicking: /* @__PURE__ */ h((e) => r.cherryPick(Pr(e)), "CherryPicking") }[t.$type]; s ? s(t) : w.error(`Unknown statement type: ${t.$type}`);}, "parseStatement"), Or = /* @__PURE__ */ h((t) => ({ id: t.id, msg: t.message ?? "", type: t.type !== void 0 ? x[t.type] : x.NORMAL, tags: t.tags ?? void 0}), "parseCommit"), zr = /* @__PURE__ */ h((t) => ({ name: t.name, order: t.order ?? 0}), "parseBranch"), Gr = /* @__PURE__ */ h((t) => ({ branch: t.branch, id: t.id ?? "", type: t.type !== void 0 ? x[t.type] : void 0, tags: t.tags ?? void 0}), "parseMerge"), Hr = /* @__PURE__ */ h((t) => t.branch, "parseCheckout"), Pr = /* @__PURE__ */ h((t) => { var a; return { id: t.id, targetId: "", tags: ((a = t.tags) == null ? void 0 : a.length) === 0 ? void 0 : t.tags, parent: t.parent };}, "parseCherryPicking"), Wr = { parse: /* @__PURE__ */ h(async (t) => { const r = await gr("gitGraph", t); w.debug(r), Ir(r, X); }, "parse")}, j = sr(), b = j == null ? void 0 : j.gitGraph, R = 10, I = 40, k = 4, L = 2, O = 8, C = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map(), P = 30, G = /* @__PURE__ */ new Map(), W = [], M = 0, u = "LR", Sr = /* @__PURE__ */ h(() => { C.clear(), E.clear(), G.clear(), M = 0, W = [], u = "LR";}, "clear"), J = /* @__PURE__ */ h((t) => { const r = document.createElementNS("http://www.w3.org/2000/svg", "text"); return (typeof t == "string" ? t.split(/\\n|\n|<br\s*\/?>/gi) : t).forEach((s) => { const e = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); e.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), e.setAttribute("dy", "1em"), e.setAttribute("x", "0"), e.setAttribute("class", "row"), e.textContent = s.trim(), r.appendChild(e); }), r;}, "drawText"), Q = /* @__PURE__ */ h((t) => { let r, a, s; return u === "BT" ? (a = /* @__PURE__ */ h((e, n) => e <= n, "comparisonFunc"), s = 1 / 0) : (a = /* @__PURE__ */ h((e, n) => e >= n, "comparisonFunc"), s = 0), t.forEach((e) => { var c, o; const n = u === "TB" || u == "BT" ? (c = E.get(e)) == null ? void 0 : c.y : (o = E.get(e)) == null ? void 0 : o.x; n !== void 0 && a(n, s) && (r = e, s = n); }), r;}, "findClosestParent"), jr = /* @__PURE__ */ h((t) => { let r = "", a = 1 / 0; return t.forEach((s) => { const e = E.get(s).y; e <= a && (r = s, a = e); }), r || void 0;}, "findClosestParentBT"), Ar = /* @__PURE__ */ h((t, r, a) => { let s = a, e = a; const n = []; t.forEach((c) => { const o = r.get(c); if (!o) throw new Error(`Commit not found for key ${c}`); o.parents.length ? (s = Yr(o), e = Math.max(s, e)) : n.push(o), Kr(o, s); }), s = e, n.forEach((c) => { Nr(c, s, a); }), t.forEach((c) => { const o = r.get(c); if (o != null && o.parents.length) { const $ = jr(o.parents); s = E.get($).y - I, s <= e && (e = s); const l = C.get(o.branch).pos, f = s - R; E.set(o.id, { x: l, y: f }); } });}, "setParallelBTPos"), Dr = /* @__PURE__ */ h((t) => { var s; const r = Q(t.parents.filter((e) => e !== null)); if (!r) throw new Error(`Closest parent not found for commit ${t.id}`); const a = (s = E.get(r)) == null ? void 0 : s.y; if (a === void 0) throw new Error(`Closest parent position not found for commit ${t.id}`); return a;}, "findClosestParentPos"), Yr = /* @__PURE__ */ h((t) => Dr(t) + I, "calculateCommitPosition"), Kr = /* @__PURE__ */ h((t, r) => { const a = C.get(t.branch); if (!a) throw new Error(`Branch not found for commit ${t.id}`); const s = a.pos, e = r + R; return E.set(t.id, { x: s, y: e }), { x: s, y: e };}, "setCommitPosition"), Nr = /* @__PURE__ */ h((t, r, a) => { const s = C.get(t.branch); if (!s) throw new Error(`Branch not found for commit ${t.id}`); const e = r + a, n = s.pos; E.set(t.id, { x: n, y: e });}, "setRootPosition"), _r = /* @__PURE__ */ h((t, r, a, s, e, n) => { if (n === x.HIGHLIGHT) t.append("rect").attr("x", a.x - 10).attr("y", a.y - 10).attr("width", 20).attr("height", 20).attr( "class", `commit ${r.id} commit-highlight${e % O} ${s}-outer` ), t.append("rect").attr("x", a.x - 6).attr("y", a.y - 6).attr("width", 12).attr("height", 12).attr( "class", `commit ${r.id} commit${e % O} ${s}-inner` ); else if (n === x.CHERRY_PICK) t.append("circle").attr("cx", a.x).attr("cy", a.y).attr("r", 10).attr("class", `commit ${r.id} ${s}`), t.append("circle").attr("cx", a.x - 3).attr("cy", a.y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${r.id} ${s}`), t.append("circle").attr("cx", a.x + 3).attr("cy", a.y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${r.id} ${s}`), t.append("line").attr("x1", a.x + 3).attr("y1", a.y + 1).attr("x2", a.x).attr("y2", a.y - 5).attr("stroke", "#fff").attr("class", `commit ${r.id} ${s}`), t.append("line").attr("x1", a.x - 3).attr("y1", a.y + 1).attr("x2", a.x).attr("y2", a.y - 5).attr("stroke", "#fff").attr("class", `commit ${r.id} ${s}`); else { const c = t.append("circle"); if (c.attr("cx", a.x), c.attr("cy", a.y), c.attr("r", r.type === x.MERGE ? 9 : 10), c.attr("class", `commit ${r.id} commit${e % O}`), n === x.MERGE) { const o = t.append("circle"); o.attr("cx", a.x), o.attr("cy", a.y), o.attr("r", 6), o.attr( "class", `commit ${s} ${r.id} commit${e % O}` ); } n === x.REVERSE && t.append("path").attr( "d", `M ${a.x - 5},${a.y - 5}L${a.x + 5},${a.y + 5}M${a.x - 5},${a.y + 5}L${a.x + 5},${a.y - 5}` ).attr("class", `commit ${s} ${r.id} commit${e % O}`); }}, "drawCommitBullet"), Vr = /* @__PURE__ */ h((t, r, a, s) => { var e; if (r.type !== x.CHERRY_PICK && (r.customId && r.type === x.MERGE || r.type !== x.MERGE) && (b != null && b.showCommitLabel)) { const n = t.append("g"), c = n.insert("rect").attr("class", "commit-label-bkg"), o = n.append("text").attr("x", s).attr("y", a.y + 25).attr("class", "commit-label").text(r.id), $ = (e = o.node()) == null ? void 0 : e.getBBox(); if ($ && (c.attr("x", a.posWithOffset - $.width / 2 - L).attr("y", a.y + 13.5).attr("width", $.width + 2 * L).attr("height", $.height + 2 * L), u === "TB" || u === "BT" ? (c.attr("x", a.x - ($.width + 4 * k + 5)).attr("y", a.y - 12), o.attr("x", a.x - ($.width + 4 * k)).attr("y", a.y + $.height - 12)) : o.attr("x", a.posWithOffset - $.width / 2), b.rotateCommitLabel)) if (u === "TB" || u === "BT") o.attr( "transform", "rotate(-45, " + a.x + ", " + a.y + ")" ), c.attr( "transform", "rotate(-45, " + a.x + ", " + a.y + ")" ); else { const l = -7.5 - ($.width + 10) / 25 * 9.5, f = 10 + $.width / 25 * 8.5; n.attr( "transform", "translate(" + l + ", " + f + ") rotate(-45, " + s + ", " + a.y + ")" ); } }}, "drawCommitLabel"), Xr = /* @__PURE__ */ h((t, r, a, s) => { var e; if (r.tags.length > 0) { let n = 0, c = 0, o = 0; const $ = []; for (const l of r.tags.reverse()) { const f = t.insert("polygon"), g = t.append("circle"), d = t.append("text").attr("y", a.y - 16 - n).attr("class", "tag-label").text(l), y = (e = d.node()) == null ? void 0 : e.getBBox(); if (!y) throw new Error("Tag bbox not found"); c = Math.max(c, y.width), o = Math.max(o, y.height), d.attr("x", a.posWithOffset - y.width / 2), $.push({ tag: d, hole: g, rect: f, yOffset: n }), n += 20; } for (const { tag: l, hole: f, rect: g, yOffset: d } of $) { const y = o / 2, p = a.y - 19.2 - d; if (g.attr("class", "tag-label-bkg").attr( "points", ` ${s - c / 2 - k / 2},${p + L} ${s - c / 2 - k / 2},${p - L} ${a.posWithOffset - c / 2 - k},${p - y - L} ${a.posWithOffset + c / 2 + k},${p - y - L} ${a.posWithOffset + c / 2 + k},${p + y + L} ${a.posWithOffset - c / 2 - k},${p + y + L}` ), f.attr("cy", p).attr("cx", s - c / 2 + k / 2).attr("r", 1.5).attr("class", "tag-hole"), u === "TB" || u === "BT") { const m = s + d; g.attr("class", "tag-label-bkg").attr( "points", ` ${a.x},${m + 2} ${a.x},${m - 2} ${a.x + R},${m - y - 2} ${a.x + R + c + 4},${m - y - 2} ${a.x + R + c + 4},${m + y + 2} ${a.x + R},${m + y + 2}` ).attr("transform", "translate(12,12) rotate(45, " + a.x + "," + s + ")"), f.attr("cx", a.x + k / 2).attr("cy", m).attr("transform", "translate(12,12) rotate(45, " + a.x + "," + s + ")"), l.attr("x", a.x + 5).attr("y", m + 3).attr("transform", "translate(14,14) rotate(45, " + a.x + "," + s + ")"); } } }}, "drawCommitTags"), Jr = /* @__PURE__ */ h((t) => { switch (t.customType ?? t.type) { case x.NORMAL: return "commit-normal"; case x.REVERSE: return "commit-reverse"; case x.HIGHLIGHT: return "commit-highlight"; case x.MERGE: return "commit-merge"; case x.CHERRY_PICK: return "commit-cherry-pick"; default: return "commit-normal"; }}, "getCommitClassType"), Qr = /* @__PURE__ */ h((t, r, a, s) => { const e = { x: 0, y: 0 }; if (t.parents.length > 0) { const n = Q(t.parents); if (n) { const c = s.get(n) ?? e; return r === "TB" ? c.y + I : r === "BT" ? (s.get(t.id) ?? e).y - I : c.x + I; } } else return r === "TB" ? P : r === "BT" ? (s.get(t.id) ?? e).y - I : 0; return 0;}, "calculatePosition"), Zr = /* @__PURE__ */ h((t, r, a) => { var c, o; const s = u === "BT" && a ? r : r + R, e = u === "TB" || u === "BT" ? s : (c = C.get(t.branch)) == null ? void 0 : c.pos, n = u === "TB" || u === "BT" ? (o = C.get(t.branch)) == null ? void 0 : o.pos : s; if (n === void 0 || e === void 0) throw new Error(`Position were undefined for commit ${t.id}`); return { x: n, y: e, posWithOffset: s };}, "getCommitPosition"), K = /* @__PURE__ */ h((t, r, a) => { if (!b) throw new Error("GitGraph config not found"); const s = t.append("g").attr("class", "commit-bullets"), e = t.append("g").attr("class", "commit-labels"); let n = u === "TB" || u === "BT" ? P : 0; const c = [...r.keys()], o = (b == null ? void 0 : b.parallelCommits) ?? !1, $ = /* @__PURE__ */ h((f, g) => { var p, m; const d = (p = r.get(f)) == null ? void 0 : p.seq, y = (m = r.get(g)) == null ? void 0 : m.seq; return d !== void 0 && y !== void 0 ? d - y : 0; }, "sortKeys"); let l = c.sort($); u === "BT" && (o && Ar(l, r, n), l = l.reverse()), l.forEach((f) => { var y; const g = r.get(f); if (!g) throw new Error(`Commit not found for key ${f}`); o && (n = Qr(g, u, n, E)); const d = Zr(g, n, o); if (a) { const p = Jr(g), m = g.customType ?? g.type, q = ((y = C.get(g.branch)) == null ? void 0 : y.index) ?? 0; _r(s, g, d, p, q, m), Vr(e, g, d, n), Xr(e, g, d, n); } u === "TB" || u === "BT" ? E.set(g.id, { x: d.x, y: d.posWithOffset }) : E.set(g.id, { x: d.posWithOffset, y: d.y }), n = u === "BT" && o ? n + I : n + I + R, n > M && (M = n); });}, "drawCommits"), Fr = /* @__PURE__ */ h((t, r, a, s, e) => { const c = (u === "TB" || u === "BT" ? a.x < s.x : a.y < s.y) ? r.branch : t.branch, o = /* @__PURE__ */ h((l) => l.branch === c, "isOnBranchToGetCurve"), $ = /* @__PURE__ */ h((l) => l.seq > t.seq && l.seq < r.seq, "isBetweenCommits"); return [...e.values()].some((l) => $(l) && o(l));}, "shouldRerouteArrow"), H = /* @__PURE__ */ h((t, r, a = 0) => { const s = t + Math.abs(t - r) / 2; if (a > 5) return s; if (W.every((c) => Math.abs(c - s) >= 10)) return W.push(s), s; const n = Math.abs(t - r); return H(t, r - n / 5, a + 1);}, "findLane"), Ur = /* @__PURE__ */ h((t, r, a, s) => { var y, p, m, q, Y; const e = E.get(r.id), n = E.get(a.id); if (e === void 0 || n === void 0) throw new Error(`Commit positions not found for commits ${r.id} and ${a.id}`); const c = Fr(r, a, e, n, s); let o = "", $ = "", l = 0, f = 0, g = (y = C.get(a.branch)) == null ? void 0 : y.index; a.type === x.MERGE && r.id !== a.parents[0] && (g = (p = C.get(r.branch)) == null ? void 0 : p.index); let d; if (c) { o = "A 10 10, 0, 0, 0,", $ = "A 10 10, 0, 0, 1,", l = 10, f = 10; const T = e.y < n.y ? H(e.y, n.y) : H(n.y, e.y), v = e.x < n.x ? H(e.x, n.x) : H(n.x, e.x); u === "TB" ? e.x < n.x ? d = `M ${e.x} ${e.y} L ${v - l} ${e.y} ${$} ${v} ${e.y + f} L ${v} ${n.y - l} ${o} ${v + f} ${n.y} L ${n.x} ${n.y}` : (g = (m = C.get(r.branch)) == null ? void 0 : m.index, d = `M ${e.x} ${e.y} L ${v + l} ${e.y} ${o} ${v} ${e.y + f} L ${v} ${n.y - l} ${$} ${v - f} ${n.y} L ${n.x} ${n.y}`) : u === "BT" ? e.x < n.x ? d = `M ${e.x} ${e.y} L ${v - l} ${e.y} ${o} ${v} ${e.y - f} L ${v} ${n.y + l} ${$} ${v + f} ${n.y} L ${n.x} ${n.y}` : (g = (q = C.get(r.branch)) == null ? void 0 : q.index, d = `M ${e.x} ${e.y} L ${v + l} ${e.y} ${$} ${v} ${e.y - f} L ${v} ${n.y + l} ${o} ${v - f} ${n.y} L ${n.x} ${n.y}`) : e.y < n.y ? d = `M ${e.x} ${e.y} L ${e.x} ${T - l} ${o} ${e.x + f} ${T} L ${n.x - l} ${T} ${$} ${n.x} ${T + f} L ${n.x} ${n.y}` : (g = (Y = C.get(r.branch)) == null ? void 0 : Y.index, d = `M ${e.x} ${e.y} L ${e.x} ${T + l} ${$} ${e.x + f} ${T} L ${n.x - l} ${T} ${o} ${n.x} ${T - f} L ${n.x} ${n.y}`); } else o = "A 20 20, 0, 0, 0,", $ = "A 20 20, 0, 0, 1,", l = 20, f = 20, u === "TB" ? (e.x < n.x && (a.type === x.MERGE && r.id !== a.parents[0] ? d = `M ${e.x} ${e.y} L ${e.x} ${n.y - l} ${o} ${e.x + f} ${n.y} L ${n.x} ${n.y}` : d = `M ${e.x} ${e.y} L ${n.x - l} ${e.y} ${$} ${n.x} ${e.y + f} L ${n.x} ${n.y}`), e.x > n.x && (o = "A 20 20, 0, 0, 0,", $ = "A 20 20, 0, 0, 1,", l = 20, f = 20, a.type === x.MERGE && r.id !== a.parents[0] ? d = `M ${e.x} ${e.y} L ${e.x} ${n.y - l} ${$} ${e.x - f} ${n.y} L ${n.x} ${n.y}` : d = `M ${e.x} ${e.y} L ${n.x + l} ${e.y} ${o} ${n.x} ${e.y + f} L ${n.x} ${n.y}`), e.x === n.x && (d = `M ${e.x} ${e.y} L ${n.x} ${n.y}`)) : u === "BT" ? (e.x < n.x && (a.type === x.MERGE && r.id !== a.parents[0] ? d = `M ${e.x} ${e.y} L ${e.x} ${n.y + l} ${$} ${e.x + f} ${n.y} L ${n.x} ${n.y}` : d = `M ${e.x} ${e.y} L ${n.x - l} ${e.y} ${o} ${n.x} ${e.y - f} L ${n.x} ${n.y}`), e.x > n.x && (o = "A 20 20, 0, 0, 0,", $ = "A 20 20, 0, 0, 1,", l = 20, f = 20, a.type === x.MERGE && r.id !== a.parents[0] ? d = `M ${e.x} ${e.y} L ${e.x} ${n.y + l} ${o} ${e.x - f} ${n.y} L ${n.x} ${n.y}` : d = `M ${e.x} ${e.y} L ${n.x - l} ${e.y} ${o} ${n.x} ${e.y - f} L ${n.x} ${n.y}`), e.x === n.x && (d = `M ${e.x} ${e.y} L ${n.x} ${n.y}`)) : (e.y < n.y && (a.type === x.MERGE && r.id !== a.parents[0] ? d = `M ${e.x} ${e.y} L ${n.x - l} ${e.y} ${$} ${n.x} ${e.y + f} L ${n.x} ${n.y}` : d = `M ${e.x} ${e.y} L ${e.x} ${n.y - l} ${o} ${e.x + f} ${n.y} L ${n.x} ${n.y}`), e.y > n.y && (a.type === x.MERGE && r.id !== a.parents[0] ? d = `M ${e.x} ${e.y} L ${n.x - l} ${e.y} ${o} ${n.x} ${e.y - f} L ${n.x} ${n.y}` : d = `M ${e.x} ${e.y} L ${e.x} ${n.y + l} ${$} ${e.x + f} ${n.y} L ${n.x} ${n.y}`), e.y === n.y && (d = `M ${e.x} ${e.y} L ${n.x} ${n.y}`)); if (d === void 0) throw new Error("Line definition not found"); t.append("path").attr("d", d).attr("class", "arrow arrow" + g % O);}, "drawArrow"), re = /* @__PURE__ */ h((t, r) => { const a = t.append("g").attr("class", "commit-arrows"); [...r.keys()].forEach((s) => { const e = r.get(s); e.parents && e.parents.length > 0 && e.parents.forEach((n) => { Ur(a, r.get(n), e, r); }); });}, "drawArrows"), ee = /* @__PURE__ */ h((t, r) => { const a = t.append("g"); r.forEach((s, e) => { var p; const n = e % O, c = (p = C.get(s.name)) == null ? void 0 : p.pos; if (c === void 0) throw new Error(`Position not found for branch ${s.name}`); const o = a.append("line"); o.attr("x1", 0), o.attr("y1", c), o.attr("x2", M), o.attr("y2", c), o.attr("class", "branch branch" + n), u === "TB" ? (o.attr("y1", P), o.attr("x1", c), o.attr("y2", M), o.attr("x2", c)) : u === "BT" && (o.attr("y1", M), o.attr("x1", c), o.attr("y2", P), o.attr("x2", c)), W.push(c); const $ = s.name, l = J($), f = a.insert("rect"), d = a.insert("g").attr("class", "branchLabel").insert("g").attr("class", "label branch-label" + n); d.node().appendChild(l); const y = l.getBBox(); f.attr("class", "branchLabelBkg label" + n).attr("rx", 4).attr("ry", 4).attr("x", -y.width - 4 - ((b == null ? void 0 : b.rotateCommitLabel) === !0 ? 30 : 0)).attr("y", -y.height / 2 + 8).attr("width", y.width + 18).attr("height", y.height + 4), d.attr( "transform", "translate(" + (-y.width - 14 - ((b == null ? void 0 : b.rotateCommitLabel) === !0 ? 30 : 0)) + ", " + (c - y.height / 2 - 1) + ")" ), u === "TB" ? (f.attr("x", c - y.width / 2 - 10).attr("y", 0), d.attr("transform", "translate(" + (c - y.width / 2 - 5) + ", 0)")) : u === "BT" ? (f.attr("x", c - y.width / 2 - 10).attr("y", M), d.attr("transform", "translate(" + (c - y.width / 2 - 5) + ", " + M + ")")) : f.attr("transform", "translate(-19, " + (c - y.height / 2) + ")"); });}, "drawBranches"), te = /* @__PURE__ */ h(function(t, r, a, s, e) { return C.set(t, { pos: r, index: a }), r += 50 + (e ? 40 : 0) + (u === "TB" || u === "BT" ? s.width / 2 : 0), r;}, "setBranchPosition"), ae = /* @__PURE__ */ h(function(t, r, a, s) { if (Sr(), w.debug("in gitgraph renderer", t + ``, "id:", r, a), !b) throw new Error("GitGraph config not found"); const e = b.rotateCommitLabel ?? !1, n = s.db; G = n.getCommits(); const c = n.getBranchesAsObjArray(); u = n.getDirection(); const o = or(`[id="${r}"]`); let $ = 0; c.forEach((l, f) => { var q; const g = J(l.name), d = o.append("g"), y = d.insert("g").attr("class", "branchLabel"), p = y.insert("g").attr("class", "label branch-label"); (q = p.node()) == null || q.appendChild(g); const m = g.getBBox(); $ = te(l.name, $, f, m, e), p.remove(), y.remove(), d.remove(); }), K(o, G, !1), b.showBranches && ee(o, c), re(o, G), K(o, G, !0), cr.insertTitle( o, "gitTitleText", b.titleTopMargin ?? 0, n.getDiagramTitle() ), ir( void 0, o, b.diagramPadding, b.useMaxWidth );}, "draw"), ne = { draw: ae}, se = /* @__PURE__ */ h((t) => ` .commit-id, .commit-msg, .branch-label { fill: lightgrey; color: lightgrey; font-family: 'trebuchet ms', verdana, arial, sans-serif; font-family: var(--mermaid-font-family); } ${[0, 1, 2, 3, 4, 5, 6, 7].map( (r) => ` .branch-label${r} { fill: ${t["gitBranchLabel" + r]}; } .commit${r} { stroke: ${t["git" + r]}; fill: ${t["git" + r]}; } .commit-highlight${r} { stroke: ${t["gitInv" + r]}; fill: ${t["gitInv" + r]}; } .label${r} { fill: ${t["git" + r]}; } .arrow${r} { stroke: ${t["git" + r]}; } `).join(``)}
.branch { stroke-width: 1; stroke: ${t.lineColor}; stroke-dasharray: 2; } .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};} .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; } .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};} .tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; } .tag-hole { fill: ${t.textColor}; }
.commit-merge { stroke: ${t.primaryColor}; fill: ${t.primaryColor}; } .commit-reverse { stroke: ${t.primaryColor}; fill: ${t.primaryColor}; stroke-width: 3; } .commit-highlight-outer { } .commit-highlight-inner { stroke: ${t.primaryColor}; fill: ${t.primaryColor}; }
.arrow { stroke-width: 8; stroke-linecap: round; fill: none} .gitTitleText { text-anchor: middle; font-size: 18px; fill: ${t.textColor}; }`, "getStyles"), oe = se, le = { parser: Wr, db: X, renderer: ne, styles: oe};export { le as diagram};123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247import { aA as N, aB as j, aC as f, aD as b, aE as E } from "./mermaid.core-BiIw1_mh.js";import { a as v, c as P, k as _, f as g, d, i as l, v as p, r as D } from "./_baseUniq-BzpV2HJ8.js";var w = N(function(o) { return v(P(o, 1, j, !0));}), F = "\0", a = "\0", O = "";class L { constructor(e = {}) { this._isDirected = Object.prototype.hasOwnProperty.call(e, "directed") ? e.directed : !0, this._isMultigraph = Object.prototype.hasOwnProperty.call(e, "multigraph") ? e.multigraph : !1, this._isCompound = Object.prototype.hasOwnProperty.call(e, "compound") ? e.compound : !1, this._label = void 0, this._defaultNodeLabelFn = f(void 0), this._defaultEdgeLabelFn = f(void 0), this._nodes = {}, this._isCompound && (this._parent = {}, this._children = {}, this._children[a] = {}), this._in = {}, this._preds = {}, this._out = {}, this._sucs = {}, this._edgeObjs = {}, this._edgeLabels = {}; } /* === Graph functions ========= */ isDirected() { return this._isDirected; } isMultigraph() { return this._isMultigraph; } isCompound() { return this._isCompound; } setGraph(e) { return this._label = e, this; } graph() { return this._label; } /* === Node functions ========== */ setDefaultNodeLabel(e) { return b(e) || (e = f(e)), this._defaultNodeLabelFn = e, this; } nodeCount() { return this._nodeCount; } nodes() { return _(this._nodes); } sources() { var e = this; return g(this.nodes(), function(t) { return E(e._in[t]); }); } sinks() { var e = this; return g(this.nodes(), function(t) { return E(e._out[t]); }); } setNodes(e, t) { var s = arguments, i = this; return d(e, function(r) { s.length > 1 ? i.setNode(r, t) : i.setNode(r); }), this; } setNode(e, t) { return Object.prototype.hasOwnProperty.call(this._nodes, e) ? (arguments.length > 1 && (this._nodes[e] = t), this) : (this._nodes[e] = arguments.length > 1 ? t : this._defaultNodeLabelFn(e), this._isCompound && (this._parent[e] = a, this._children[e] = {}, this._children[a][e] = !0), this._in[e] = {}, this._preds[e] = {}, this._out[e] = {}, this._sucs[e] = {}, ++this._nodeCount, this); } node(e) { return this._nodes[e]; } hasNode(e) { return Object.prototype.hasOwnProperty.call(this._nodes, e); } removeNode(e) { if (Object.prototype.hasOwnProperty.call(this._nodes, e)) { var t = (s) => this.removeEdge(this._edgeObjs[s]); delete this._nodes[e], this._isCompound && (this._removeFromParentsChildList(e), delete this._parent[e], d(this.children(e), (s) => { this.setParent(s); }), delete this._children[e]), d(_(this._in[e]), t), delete this._in[e], delete this._preds[e], d(_(this._out[e]), t), delete this._out[e], delete this._sucs[e], --this._nodeCount; } return this; } setParent(e, t) { if (!this._isCompound) throw new Error("Cannot set parent in a non-compound graph"); if (l(t)) t = a; else { t += ""; for (var s = t; !l(s); s = this.parent(s)) if (s === e) throw new Error("Setting " + t + " as parent of " + e + " would create a cycle"); this.setNode(t); } return this.setNode(e), this._removeFromParentsChildList(e), this._parent[e] = t, this._children[t][e] = !0, this; } _removeFromParentsChildList(e) { delete this._children[this._parent[e]][e]; } parent(e) { if (this._isCompound) { var t = this._parent[e]; if (t !== a) return t; } } children(e) { if (l(e) && (e = a), this._isCompound) { var t = this._children[e]; if (t) return _(t); } else { if (e === a) return this.nodes(); if (this.hasNode(e)) return []; } } predecessors(e) { var t = this._preds[e]; if (t) return _(t); } successors(e) { var t = this._sucs[e]; if (t) return _(t); } neighbors(e) { var t = this.predecessors(e); if (t) return w(t, this.successors(e)); } isLeaf(e) { var t; return this.isDirected() ? t = this.successors(e) : t = this.neighbors(e), t.length === 0; } filterNodes(e) { var t = new this.constructor({ directed: this._isDirected, multigraph: this._isMultigraph, compound: this._isCompound }); t.setGraph(this.graph()); var s = this; d(this._nodes, function(n, h) { e(h) && t.setNode(h, n); }), d(this._edgeObjs, function(n) { t.hasNode(n.v) && t.hasNode(n.w) && t.setEdge(n, s.edge(n)); }); var i = {}; function r(n) { var h = s.parent(n); return h === void 0 || t.hasNode(h) ? (i[n] = h, h) : h in i ? i[h] : r(h); } return this._isCompound && d(t.nodes(), function(n) { t.setParent(n, r(n)); }), t; } /* === Edge functions ========== */ setDefaultEdgeLabel(e) { return b(e) || (e = f(e)), this._defaultEdgeLabelFn = e, this; } edgeCount() { return this._edgeCount; } edges() { return p(this._edgeObjs); } setPath(e, t) { var s = this, i = arguments; return D(e, function(r, n) { return i.length > 1 ? s.setEdge(r, n, t) : s.setEdge(r, n), n; }), this; } /* * setEdge(v, w, [value, [name]]) * setEdge({ v, w, [name] }, [value]) */ setEdge() { var e, t, s, i, r = !1, n = arguments[0]; typeof n == "object" && n !== null && "v" in n ? (e = n.v, t = n.w, s = n.name, arguments.length === 2 && (i = arguments[1], r = !0)) : (e = n, t = arguments[1], s = arguments[3], arguments.length > 2 && (i = arguments[2], r = !0)), e = "" + e, t = "" + t, l(s) || (s = "" + s); var h = c(this._isDirected, e, t, s); if (Object.prototype.hasOwnProperty.call(this._edgeLabels, h)) return r && (this._edgeLabels[h] = i), this; if (!l(s) && !this._isMultigraph) throw new Error("Cannot set a named edge when isMultigraph = false"); this.setNode(e), this.setNode(t), this._edgeLabels[h] = r ? i : this._defaultEdgeLabelFn(e, t, s); var u = M(this._isDirected, e, t, s); return e = u.v, t = u.w, Object.freeze(u), this._edgeObjs[h] = u, C(this._preds[t], e), C(this._sucs[e], t), this._in[t][h] = u, this._out[e][h] = u, this._edgeCount++, this; } edge(e, t, s) { var i = arguments.length === 1 ? m(this._isDirected, arguments[0]) : c(this._isDirected, e, t, s); return this._edgeLabels[i]; } hasEdge(e, t, s) { var i = arguments.length === 1 ? m(this._isDirected, arguments[0]) : c(this._isDirected, e, t, s); return Object.prototype.hasOwnProperty.call(this._edgeLabels, i); } removeEdge(e, t, s) { var i = arguments.length === 1 ? m(this._isDirected, arguments[0]) : c(this._isDirected, e, t, s), r = this._edgeObjs[i]; return r && (e = r.v, t = r.w, delete this._edgeLabels[i], delete this._edgeObjs[i], y(this._preds[t], e), y(this._sucs[e], t), delete this._in[t][i], delete this._out[e][i], this._edgeCount--), this; } inEdges(e, t) { var s = this._in[e]; if (s) { var i = p(s); return t ? g(i, function(r) { return r.v === t; }) : i; } } outEdges(e, t) { var s = this._out[e]; if (s) { var i = p(s); return t ? g(i, function(r) { return r.w === t; }) : i; } } nodeEdges(e, t) { var s = this.inEdges(e, t); if (s) return s.concat(this.outEdges(e, t)); }}L.prototype._nodeCount = 0;L.prototype._edgeCount = 0;function C(o, e) { o[e] ? o[e]++ : o[e] = 1;}function y(o, e) { --o[e] || delete o[e];}function c(o, e, t, s) { var i = "" + e, r = "" + t; if (!o && i > r) { var n = i; i = r, r = n; } return i + O + r + O + (l(s) ? F : s);}function M(o, e, t, s) { var i = "" + e, r = "" + t; if (!o && i > r) { var n = i; i = r, r = n; } var h = { v: i, w: r }; return s && (h.name = s), h;}function m(o, e) { return c(o, e.v, e.w, e.name);}export { L as G};123456import { E as s, T as x, I as o } from "./Index-DiS7y4tI.js";export {s as BaseExample,x as BaseTextbox,o as default};1234import { I as f } from "./Index-DlSje_b9.js";export {f as default};
123456789101112131415161718192021222324import { _ as e, l as s, H as o, e as i, I as g } from "./mermaid.core-BiIw1_mh.js";import { p } from "./radar-VG2SY3DT-DUR9h7DO.js";var v = { parse: /* @__PURE__ */ e(async (r) => { const a = await p("info", r); s.debug(a); }, "parse")}, d = { version: g.version + ""}, c = /* @__PURE__ */ e(() => d.version, "getVersion"), m = { getVersion: c}, l = /* @__PURE__ */ e((r, a, n) => { s.debug(`rendering info diagram` + r); const t = o(a); i(t, 100, 400, !0), t.append("g").append("text").attr("x", 100).attr("y", 40).attr("class", "version").attr("font-size", 32).style("text-anchor", "middle").text(`v${n}`);}, "draw"), f = { draw: l }, b = { parser: v, db: m, renderer: f};export { b as diagram};123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836import { a as gt, g as lt, f as mt, d as xt } from "./chunk-WZLT4MVT-CfJwH0hJ.js";import { g as kt } from "./chunk-UIWBPB2F-muaaSQOG.js";import { _ as n, g as _t, s as vt, a as bt, b as wt, q as Tt, p as St, c as R, d as G, e as $t, y as Mt } from "./mermaid.core-BiIw1_mh.js";import { d as et } from "./arc-BVd80oSb.js";var U = function() { var t = /* @__PURE__ */ n(function(h, i, a, l) { for (a = a || {}, l = h.length; l--; a[h[l]] = i) ; return a; }, "o"), e = [6, 8, 10, 11, 12, 14, 16, 17, 18], s = [1, 9], c = [1, 10], r = [1, 11], f = [1, 12], u = [1, 13], y = [1, 14], g = { trace: /* @__PURE__ */ n(function() { }, "trace"), yy: {}, symbols_: { error: 2, start: 3, journey: 4, document: 5, EOF: 6, line: 7, SPACE: 8, statement: 9, NEWLINE: 10, title: 11, acc_title: 12, acc_title_value: 13, acc_descr: 14, acc_descr_value: 15, acc_descr_multiline_value: 16, section: 17, taskName: 18, taskData: 19, $accept: 0, $end: 1 }, terminals_: { 2: "error", 4: "journey", 6: "EOF", 8: "SPACE", 10: "NEWLINE", 11: "title", 12: "acc_title", 13: "acc_title_value", 14: "acc_descr", 15: "acc_descr_value", 16: "acc_descr_multiline_value", 17: "section", 18: "taskName", 19: "taskData" }, productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 1], [9, 2]], performAction: /* @__PURE__ */ n(function(i, a, l, d, p, o, b) { var k = o.length - 1; switch (p) { case 1: return o[k - 1]; case 2: this.$ = []; break; case 3: o[k - 1].push(o[k]), this.$ = o[k - 1]; break; case 4: case 5: this.$ = o[k]; break; case 6: case 7: this.$ = []; break; case 8: d.setDiagramTitle(o[k].substr(6)), this.$ = o[k].substr(6); break; case 9: this.$ = o[k].trim(), d.setAccTitle(this.$); break; case 10: case 11: this.$ = o[k].trim(), d.setAccDescription(this.$); break; case 12: d.addSection(o[k].substr(8)), this.$ = o[k].substr(8); break; case 13: d.addTask(o[k - 1], o[k]), this.$ = "task"; break; } }, "anonymous"), table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, t(e, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: s, 12: c, 14: r, 16: f, 17: u, 18: y }, t(e, [2, 7], { 1: [2, 1] }), t(e, [2, 3]), { 9: 15, 11: s, 12: c, 14: r, 16: f, 17: u, 18: y }, t(e, [2, 5]), t(e, [2, 6]), t(e, [2, 8]), { 13: [1, 16] }, { 15: [1, 17] }, t(e, [2, 11]), t(e, [2, 12]), { 19: [1, 18] }, t(e, [2, 4]), t(e, [2, 9]), t(e, [2, 10]), t(e, [2, 13])], defaultActions: {}, parseError: /* @__PURE__ */ n(function(i, a) { if (a.recoverable) this.trace(i); else { var l = new Error(i); throw l.hash = a, l; } }, "parseError"), parse: /* @__PURE__ */ n(function(i) { var a = this, l = [0], d = [], p = [null], o = [], b = this.table, k = "", C = 0, K = 0, dt = 2, Q = 1, yt = o.slice.call(arguments, 1), _ = Object.create(this.lexer), I = { yy: {} }; for (var O in this.yy) Object.prototype.hasOwnProperty.call(this.yy, O) && (I.yy[O] = this.yy[O]); _.setInput(i, I.yy), I.yy.lexer = _, I.yy.parser = this, typeof _.yylloc > "u" && (_.yylloc = {}); var Y = _.yylloc; o.push(Y); var ft = _.options && _.options.ranges; typeof I.yy.parseError == "function" ? this.parseError = I.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError; function pt(w) { l.length = l.length - 2 * w, p.length = p.length - w, o.length = o.length - w; } n(pt, "popStack"); function D() { var w; return w = d.pop() || _.lex() || Q, typeof w != "number" && (w instanceof Array && (d = w, w = d.pop()), w = a.symbols_[w] || w), w; } n(D, "lex"); for (var v, A, T, q, F = {}, N, M, tt, z; ; ) { if (A = l[l.length - 1], this.defaultActions[A] ? T = this.defaultActions[A] : ((v === null || typeof v > "u") && (v = D()), T = b[A] && b[A][v]), typeof T > "u" || !T.length || !T[0]) { var X = ""; z = []; for (N in b[A]) this.terminals_[N] && N > dt && z.push("'" + this.terminals_[N] + "'"); _.showPosition ? X = "Parse error on line " + (C + 1) + `:` + _.showPosition() + `Expecting ` + z.join(", ") + ", got '" + (this.terminals_[v] || v) + "'" : X = "Parse error on line " + (C + 1) + ": Unexpected " + (v == Q ? "end of input" : "'" + (this.terminals_[v] || v) + "'"), this.parseError(X, { text: _.match, token: this.terminals_[v] || v, line: _.yylineno, loc: Y, expected: z }); } if (T[0] instanceof Array && T.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + A + ", token: " + v); switch (T[0]) { case 1: l.push(v), p.push(_.yytext), o.push(_.yylloc), l.push(T[1]), v = null, K = _.yyleng, k = _.yytext, C = _.yylineno, Y = _.yylloc; break; case 2: if (M = this.productions_[T[1]][1], F.$ = p[p.length - M], F._$ = { first_line: o[o.length - (M || 1)].first_line, last_line: o[o.length - 1].last_line, first_column: o[o.length - (M || 1)].first_column, last_column: o[o.length - 1].last_column }, ft && (F._$.range = [ o[o.length - (M || 1)].range[0], o[o.length - 1].range[1] ]), q = this.performAction.apply(F, [ k, K, C, I.yy, T[1], p, o ].concat(yt)), typeof q < "u") return q; M && (l = l.slice(0, -1 * M * 2), p = p.slice(0, -1 * M), o = o.slice(0, -1 * M)), l.push(this.productions_[T[1]][0]), p.push(F.$), o.push(F._$), tt = b[l[l.length - 2]][l[l.length - 1]], l.push(tt); break; case 3: return !0; } } return !0; }, "parse") }, m = /* @__PURE__ */ function() { var h = { EOF: 1, parseError: /* @__PURE__ */ n(function(a, l) { if (this.yy.parser) this.yy.parser.parseError(a, l); else throw new Error(a); }, "parseError"), // resets the lexer, sets new input setInput: /* @__PURE__ */ n(function(i, a) { return this.yy = a || this.yy || {}, this._input = i, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this; }, "setInput"), // consumes and returns one char from the input input: /* @__PURE__ */ n(function() { var i = this._input[0]; this.yytext += i, this.yyleng++, this.offset++, this.match += i, this.matched += i; var a = i.match(/(?:\r\n?|\n).*/g); return a ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), i; }, "input"), // unshifts one char (or a string) into the input unput: /* @__PURE__ */ n(function(i) { var a = i.length, l = i.split(/(?:\r\n?|\n)/g); this._input = i + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - a), this.offset -= a; var d = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), l.length - 1 && (this.yylineno -= l.length - 1); var p = this.yylloc.range; return this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: l ? (l.length === d.length ? this.yylloc.first_column : 0) + d[d.length - l.length].length - l[0].length : this.yylloc.first_column - a }, this.options.ranges && (this.yylloc.range = [p[0], p[0] + this.yyleng - a]), this.yyleng = this.yytext.length, this; }, "unput"), // When called from action, caches matched text and appends it on next action more: /* @__PURE__ */ n(function() { return this._more = !0, this; }, "more"), // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject: /* @__PURE__ */ n(function() { if (this.options.backtrack_lexer) this._backtrack = !0; else return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).` + this.showPosition(), { text: "", token: null, line: this.yylineno }); return this; }, "reject"), // retain first n characters of the match less: /* @__PURE__ */ n(function(i) { this.unput(this.match.slice(i)); }, "less"), // displays already matched input, i.e. for error messages pastInput: /* @__PURE__ */ n(function() { var i = this.matched.substr(0, this.matched.length - this.match.length); return (i.length > 20 ? "..." : "") + i.substr(-20).replace(/\n/g, ""); }, "pastInput"), // displays upcoming input, i.e. for error messages upcomingInput: /* @__PURE__ */ n(function() { var i = this.match; return i.length < 20 && (i += this._input.substr(0, 20 - i.length)), (i.substr(0, 20) + (i.length > 20 ? "..." : "")).replace(/\n/g, ""); }, "upcomingInput"), // displays the character position where the lexing error occurred, i.e. for error messages showPosition: /* @__PURE__ */ n(function() { var i = this.pastInput(), a = new Array(i.length + 1).join("-"); return i + this.upcomingInput() + `` + a + "^"; }, "showPosition"), // test the lexed token: return FALSE when not a match, otherwise return token test_match: /* @__PURE__ */ n(function(i, a) { var l, d, p; if (this.options.backtrack_lexer && (p = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }, this.options.ranges && (p.yylloc.range = this.yylloc.range.slice(0))), d = i[0].match(/(?:\r\n?|\n).*/g), d && (this.yylineno += d.length), this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: d ? d[d.length - 1].length - d[d.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + i[0].length }, this.yytext += i[0], this.match += i[0], this.matches = i, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(i[0].length), this.matched += i[0], l = this.performAction.call(this, this.yy, this, a, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), l) return l; if (this._backtrack) { for (var o in p) this[o] = p[o]; return !1; } return !1; }, "test_match"), // return next match in input next: /* @__PURE__ */ n(function() { if (this.done) return this.EOF; this._input || (this.done = !0); var i, a, l, d; this._more || (this.yytext = "", this.match = ""); for (var p = this._currentRules(), o = 0; o < p.length; o++) if (l = this._input.match(this.rules[p[o]]), l && (!a || l[0].length > a[0].length)) { if (a = l, d = o, this.options.backtrack_lexer) { if (i = this.test_match(l, p[o]), i !== !1) return i; if (this._backtrack) { a = !1; continue; } else return !1; } else if (!this.options.flex) break; } return a ? (i = this.test_match(a, p[d]), i !== !1 ? i : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.` + this.showPosition(), { text: "", token: null, line: this.yylineno }); }, "next"), // return next match that has a token lex: /* @__PURE__ */ n(function() { var a = this.next(); return a || this.lex(); }, "lex"), // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin: /* @__PURE__ */ n(function(a) { this.conditionStack.push(a); }, "begin"), // pop the previously active lexer condition state off the condition stack popState: /* @__PURE__ */ n(function() { var a = this.conditionStack.length - 1; return a > 0 ? this.conditionStack.pop() : this.conditionStack[0]; }, "popState"), // produce the lexer rule set which is active for the currently active lexer condition state _currentRules: /* @__PURE__ */ n(function() { return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules; }, "_currentRules"), // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState: /* @__PURE__ */ n(function(a) { return a = this.conditionStack.length - 1 - Math.abs(a || 0), a >= 0 ? this.conditionStack[a] : "INITIAL"; }, "topState"), // alias for begin(condition) pushState: /* @__PURE__ */ n(function(a) { this.begin(a); }, "pushState"), // return the number of states currently on the stack stateStackSize: /* @__PURE__ */ n(function() { return this.conditionStack.length; }, "stateStackSize"), options: { "case-insensitive": !0 }, performAction: /* @__PURE__ */ n(function(a, l, d, p) { switch (d) { case 0: break; case 1: break; case 2: return 10; case 3: break; case 4: break; case 5: return 4; case 6: return 11; case 7: return this.begin("acc_title"), 12; case 8: return this.popState(), "acc_title_value"; case 9: return this.begin("acc_descr"), 14; case 10: return this.popState(), "acc_descr_value"; case 11: this.begin("acc_descr_multiline"); break; case 12: this.popState(); break; case 13: return "acc_descr_multiline_value"; case 14: return 17; case 15: return 18; case 16: return 19; case 17: return ":"; case 18: return 6; case 19: return "INVALID"; } }, "anonymous"), rules: [/^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:journey\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:section\s[^#:\n;]+)/i, /^(?:[^#:\n;]+)/i, /^(?::[^#\n;]+)/i, /^(?::)/i, /^(?:$)/i, /^(?:.)/i], conditions: { acc_descr_multiline: { rules: [12, 13], inclusive: !1 }, acc_descr: { rules: [10], inclusive: !1 }, acc_title: { rules: [8], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 19], inclusive: !0 } } }; return h; }(); g.lexer = m; function x() { this.yy = {}; } return n(x, "Parser"), x.prototype = g, g.Parser = x, new x();}();U.parser = U;var Et = U, V = "", Z = [], L = [], B = [], Ct = /* @__PURE__ */ n(function() { Z.length = 0, L.length = 0, V = "", B.length = 0, Mt();}, "clear"), Pt = /* @__PURE__ */ n(function(t) { V = t, Z.push(t);}, "addSection"), It = /* @__PURE__ */ n(function() { return Z;}, "getSections"), At = /* @__PURE__ */ n(function() { let t = it(); const e = 100; let s = 0; for (; !t && s < e; ) t = it(), s++; return L.push(...B), L;}, "getTasks"), Ft = /* @__PURE__ */ n(function() { const t = []; return L.forEach((s) => { s.people && t.push(...s.people); }), [...new Set(t)].sort();}, "updateActors"), Vt = /* @__PURE__ */ n(function(t, e) { const s = e.substr(1).split(":"); let c = 0, r = []; s.length === 1 ? (c = Number(s[0]), r = []) : (c = Number(s[0]), r = s[1].split(",")); const f = r.map((y) => y.trim()), u = { section: V, type: V, people: f, task: t, score: c }; B.push(u);}, "addTask"), Rt = /* @__PURE__ */ n(function(t) { const e = { section: V, type: V, description: t, task: t, classes: [] }; L.push(e);}, "addTaskOrg"), it = /* @__PURE__ */ n(function() { const t = /* @__PURE__ */ n(function(s) { return B[s].processed; }, "compileTask"); let e = !0; for (const [s, c] of B.entries()) t(s), e = e && c.processed; return e;}, "compileTasks"), Lt = /* @__PURE__ */ n(function() { return Ft();}, "getActors"), rt = { getConfig: /* @__PURE__ */ n(() => R().journey, "getConfig"), clear: Ct, setDiagramTitle: St, getDiagramTitle: Tt, setAccTitle: wt, getAccTitle: bt, setAccDescription: vt, getAccDescription: _t, addSection: Pt, getSections: It, getTasks: At, addTask: Vt, addTaskOrg: Rt, getActors: Lt}, Bt = /* @__PURE__ */ n((t) => `.label { font-family: ${t.fontFamily}; color: ${t.textColor}; } .mouth { stroke: #666; }
line { stroke: ${t.textColor} }
.legend { fill: ${t.textColor}; font-family: ${t.fontFamily}; }
.label text { fill: #333; } .label { color: ${t.textColor} }
.face { ${t.faceColor ? `fill: ${t.faceColor}` : "fill: #FFF8DC"}; stroke: #999; }
.node rect, .node circle, .node ellipse, .node polygon, .node path { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: 1px; }
.node .label { text-align: center; } .node.clickable { cursor: pointer; }
.arrowheadPath { fill: ${t.arrowheadColor}; }
.edgePath .path { stroke: ${t.lineColor}; stroke-width: 1.5px; }
.flowchart-link { stroke: ${t.lineColor}; fill: none; }
.edgeLabel { background-color: ${t.edgeLabelBackground}; rect { opacity: 0.5; } text-align: center; }
.cluster rect { }
.cluster text { fill: ${t.titleColor}; }
div.mermaidTooltip { position: absolute; text-align: center; max-width: 200px; padding: 2px; font-family: ${t.fontFamily}; font-size: 12px; background: ${t.tertiaryColor}; border: 1px solid ${t.border2}; border-radius: 2px; pointer-events: none; z-index: 100; }
.task-type-0, .section-type-0 { ${t.fillType0 ? `fill: ${t.fillType0}` : ""}; } .task-type-1, .section-type-1 { ${t.fillType0 ? `fill: ${t.fillType1}` : ""}; } .task-type-2, .section-type-2 { ${t.fillType0 ? `fill: ${t.fillType2}` : ""}; } .task-type-3, .section-type-3 { ${t.fillType0 ? `fill: ${t.fillType3}` : ""}; } .task-type-4, .section-type-4 { ${t.fillType0 ? `fill: ${t.fillType4}` : ""}; } .task-type-5, .section-type-5 { ${t.fillType0 ? `fill: ${t.fillType5}` : ""}; } .task-type-6, .section-type-6 { ${t.fillType0 ? `fill: ${t.fillType6}` : ""}; } .task-type-7, .section-type-7 { ${t.fillType0 ? `fill: ${t.fillType7}` : ""}; }
.actor-0 { ${t.actor0 ? `fill: ${t.actor0}` : ""}; } .actor-1 { ${t.actor1 ? `fill: ${t.actor1}` : ""}; } .actor-2 { ${t.actor2 ? `fill: ${t.actor2}` : ""}; } .actor-3 { ${t.actor3 ? `fill: ${t.actor3}` : ""}; } .actor-4 { ${t.actor4 ? `fill: ${t.actor4}` : ""}; } .actor-5 { ${t.actor5 ? `fill: ${t.actor5}` : ""}; } ${kt()}`, "getStyles"), jt = Bt, J = /* @__PURE__ */ n(function(t, e) { return xt(t, e);}, "drawRect"), Nt = /* @__PURE__ */ n(function(t, e) { const c = t.append("circle").attr("cx", e.cx).attr("cy", e.cy).attr("class", "face").attr("r", 15).attr("stroke-width", 2).attr("overflow", "visible"), r = t.append("g"); r.append("circle").attr("cx", e.cx - 15 / 3).attr("cy", e.cy - 15 / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666"), r.append("circle").attr("cx", e.cx + 15 / 3).attr("cy", e.cy - 15 / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666"); function f(g) { const m = et().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175); g.append("path").attr("class", "mouth").attr("d", m).attr("transform", "translate(" + e.cx + "," + (e.cy + 2) + ")"); } n(f, "smile"); function u(g) { const m = et().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175); g.append("path").attr("class", "mouth").attr("d", m).attr("transform", "translate(" + e.cx + "," + (e.cy + 7) + ")"); } n(u, "sad"); function y(g) { g.append("line").attr("class", "mouth").attr("stroke", 2).attr("x1", e.cx - 5).attr("y1", e.cy + 7).attr("x2", e.cx + 5).attr("y2", e.cy + 7).attr("class", "mouth").attr("stroke-width", "1px").attr("stroke", "#666"); } return n(y, "ambivalent"), e.score > 3 ? f(r) : e.score < 3 ? u(r) : y(r), c;}, "drawFace"), ot = /* @__PURE__ */ n(function(t, e) { const s = t.append("circle"); return s.attr("cx", e.cx), s.attr("cy", e.cy), s.attr("class", "actor-" + e.pos), s.attr("fill", e.fill), s.attr("stroke", e.stroke), s.attr("r", e.r), s.class !== void 0 && s.attr("class", s.class), e.title !== void 0 && s.append("title").text(e.title), s;}, "drawCircle"), ct = /* @__PURE__ */ n(function(t, e) { return mt(t, e);}, "drawText"), zt = /* @__PURE__ */ n(function(t, e) { function s(r, f, u, y, g) { return r + "," + f + " " + (r + u) + "," + f + " " + (r + u) + "," + (f + y - g) + " " + (r + u - g * 1.2) + "," + (f + y) + " " + r + "," + (f + y); } n(s, "genPoints"); const c = t.append("polygon"); c.attr("points", s(e.x, e.y, 50, 20, 7)), c.attr("class", "labelBox"), e.y = e.y + e.labelMargin, e.x = e.x + 0.5 * e.labelMargin, ct(t, e);}, "drawLabel"), Wt = /* @__PURE__ */ n(function(t, e, s) { const c = t.append("g"), r = lt(); r.x = e.x, r.y = e.y, r.fill = e.fill, r.width = s.width * e.taskCount + // width of the tasks s.diagramMarginX * (e.taskCount - 1), r.height = s.height, r.class = "journey-section section-type-" + e.num, r.rx = 3, r.ry = 3, J(c, r), ht(s)( e.text, c, r.x, r.y, r.width, r.height, { class: "journey-section section-type-" + e.num }, s, e.colour );}, "drawSection"), nt = -1, Ot = /* @__PURE__ */ n(function(t, e, s) { const c = e.x + s.width / 2, r = t.append("g"); nt++; const f = 300 + 5 * 30; r.append("line").attr("id", "task" + nt).attr("x1", c).attr("y1", e.y).attr("x2", c).attr("y2", f).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666"), Nt(r, { cx: c, cy: 300 + (5 - e.score) * 30, score: e.score }); const u = lt(); u.x = e.x, u.y = e.y, u.fill = e.fill, u.width = s.width, u.height = s.height, u.class = "task task-type-" + e.num, u.rx = 3, u.ry = 3, J(r, u); let y = e.x + 14; e.people.forEach((g) => { const m = e.actors[g].color, x = { cx: y, cy: e.y, r: 7, fill: m, stroke: "#000", title: g, pos: e.actors[g].position }; ot(r, x), y += 10; }), ht(s)( e.task, r, u.x, u.y, u.width, u.height, { class: "task" }, s, e.colour );}, "drawTask"), Yt = /* @__PURE__ */ n(function(t, e) { gt(t, e);}, "drawBackgroundRect"), ht = /* @__PURE__ */ function() { function t(r, f, u, y, g, m, x, h) { const i = f.append("text").attr("x", u + g / 2).attr("y", y + m / 2 + 5).style("font-color", h).style("text-anchor", "middle").text(r); c(i, x); } n(t, "byText"); function e(r, f, u, y, g, m, x, h, i) { const { taskFontSize: a, taskFontFamily: l } = h, d = r.split(/<br\s*\/?>/gi); for (let p = 0; p < d.length; p++) { const o = p * a - a * (d.length - 1) / 2, b = f.append("text").attr("x", u + g / 2).attr("y", y).attr("fill", i).style("text-anchor", "middle").style("font-size", a).style("font-family", l); b.append("tspan").attr("x", u + g / 2).attr("dy", o).text(d[p]), b.attr("y", y + m / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), c(b, x); } } n(e, "byTspan"); function s(r, f, u, y, g, m, x, h) { const i = f.append("switch"), l = i.append("foreignObject").attr("x", u).attr("y", y).attr("width", g).attr("height", m).attr("position", "fixed").append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%"); l.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(r), e(r, i, u, y, g, m, x, h), c(l, x); } n(s, "byFo"); function c(r, f) { for (const u in f) u in f && r.attr(u, f[u]); } return n(c, "_setTextAttrs"), function(r) { return r.textPlacement === "fo" ? s : r.textPlacement === "old" ? t : e; };}(), qt = /* @__PURE__ */ n(function(t) { t.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 5).attr("refY", 2).attr("markerWidth", 6).attr("markerHeight", 4).attr("orient", "auto").append("path").attr("d", "M 0,0 V 4 L6,2 Z");}, "initGraphics"), j = { drawRect: J, drawCircle: ot, drawSection: Wt, drawText: ct, drawLabel: zt, drawTask: Ot, drawBackgroundRect: Yt, initGraphics: qt}, Xt = /* @__PURE__ */ n(function(t) { Object.keys(t).forEach(function(s) { $[s] = t[s]; });}, "setConf"), E = {}, W = 0;function ut(t) { const e = R().journey, s = e.maxLabelWidth; W = 0; let c = 60; Object.keys(E).forEach((r) => { const f = E[r].color, u = { cx: 20, cy: c, r: 7, fill: f, stroke: "#000", pos: E[r].position }; j.drawCircle(t, u); let y = t.append("text").attr("visibility", "hidden").text(r); const g = y.node().getBoundingClientRect().width; y.remove(); let m = []; if (g <= s) m = [r]; else { const x = r.split(" "); let h = ""; y = t.append("text").attr("visibility", "hidden"), x.forEach((i) => { const a = h ? `${h} ${i}` : i; if (y.text(a), y.node().getBoundingClientRect().width > s) { if (h && m.push(h), h = i, y.text(i), y.node().getBoundingClientRect().width > s) { let d = ""; for (const p of i) d += p, y.text(d + "-"), y.node().getBoundingClientRect().width > s && (m.push(d.slice(0, -1) + "-"), d = p); h = d; } } else h = a; }), h && m.push(h), y.remove(); } m.forEach((x, h) => { const i = { x: 40, y: c + 7 + h * 20, fill: "#666", text: x, textMargin: e.boxTextMargin ?? 5 }, l = j.drawText(t, i).node().getBoundingClientRect().width; l > W && l > e.leftMargin - l && (W = l); }), c += Math.max(20, m.length * 20); });}n(ut, "drawActorLegend");var $ = R().journey, P = 0, Gt = /* @__PURE__ */ n(function(t, e, s, c) { const r = R(), f = r.journey.titleColor, u = r.journey.titleFontSize, y = r.journey.titleFontFamily, g = r.securityLevel; let m; g === "sandbox" && (m = G("#i" + e)); const x = g === "sandbox" ? G(m.nodes()[0].contentDocument.body) : G("body"); S.init(); const h = x.select("#" + e); j.initGraphics(h); const i = c.db.getTasks(), a = c.db.getDiagramTitle(), l = c.db.getActors(); for (const C in E) delete E[C]; let d = 0; l.forEach((C) => { E[C] = { color: $.actorColours[d % $.actorColours.length], position: d }, d++; }), ut(h), P = $.leftMargin + W, S.insert(0, 0, P, Object.keys(E).length * 50), Ht(h, i, 0); const p = S.getBounds(); a && h.append("text").text(a).attr("x", P).attr("font-size", u).attr("font-weight", "bold").attr("y", 25).attr("fill", f).attr("font-family", y); const o = p.stopy - p.starty + 2 * $.diagramMarginY, b = P + p.stopx + 2 * $.diagramMarginX; $t(h, o, b, $.useMaxWidth), h.append("line").attr("x1", P).attr("y1", $.height * 4).attr("x2", b - P - 4).attr("y2", $.height * 4).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)"); const k = a ? 70 : 0; h.attr("viewBox", `${p.startx} -25 ${b} ${o + k}`), h.attr("preserveAspectRatio", "xMinYMin meet"), h.attr("height", o + k + 25);}, "draw"), S = { data: { startx: void 0, stopx: void 0, starty: void 0, stopy: void 0 }, verticalPos: 0, sequenceItems: [], init: /* @__PURE__ */ n(function() { this.sequenceItems = [], this.data = { startx: void 0, stopx: void 0, starty: void 0, stopy: void 0 }, this.verticalPos = 0; }, "init"), updateVal: /* @__PURE__ */ n(function(t, e, s, c) { t[e] === void 0 ? t[e] = s : t[e] = c(s, t[e]); }, "updateVal"), updateBounds: /* @__PURE__ */ n(function(t, e, s, c) { const r = R().journey, f = this; let u = 0; function y(g) { return /* @__PURE__ */ n(function(x) { u++; const h = f.sequenceItems.length - u + 1; f.updateVal(x, "starty", e - h * r.boxMargin, Math.min), f.updateVal(x, "stopy", c + h * r.boxMargin, Math.max), f.updateVal(S.data, "startx", t - h * r.boxMargin, Math.min), f.updateVal(S.data, "stopx", s + h * r.boxMargin, Math.max), g !== "activation" && (f.updateVal(x, "startx", t - h * r.boxMargin, Math.min), f.updateVal(x, "stopx", s + h * r.boxMargin, Math.max), f.updateVal(S.data, "starty", e - h * r.boxMargin, Math.min), f.updateVal(S.data, "stopy", c + h * r.boxMargin, Math.max)); }, "updateItemBounds"); } n(y, "updateFn"), this.sequenceItems.forEach(y()); }, "updateBounds"), insert: /* @__PURE__ */ n(function(t, e, s, c) { const r = Math.min(t, s), f = Math.max(t, s), u = Math.min(e, c), y = Math.max(e, c); this.updateVal(S.data, "startx", r, Math.min), this.updateVal(S.data, "starty", u, Math.min), this.updateVal(S.data, "stopx", f, Math.max), this.updateVal(S.data, "stopy", y, Math.max), this.updateBounds(r, u, f, y); }, "insert"), bumpVerticalPos: /* @__PURE__ */ n(function(t) { this.verticalPos = this.verticalPos + t, this.data.stopy = this.verticalPos; }, "bumpVerticalPos"), getVerticalPos: /* @__PURE__ */ n(function() { return this.verticalPos; }, "getVerticalPos"), getBounds: /* @__PURE__ */ n(function() { return this.data; }, "getBounds")}, H = $.sectionFills, st = $.sectionColours, Ht = /* @__PURE__ */ n(function(t, e, s) { const c = R().journey; let r = ""; const f = c.height * 2 + c.diagramMarginY, u = s + f; let y = 0, g = "#CCC", m = "black", x = 0; for (const [h, i] of e.entries()) { if (r !== i.section) { g = H[y % H.length], x = y % H.length, m = st[y % st.length]; let l = 0; const d = i.section; for (let o = h; o < e.length && e[o].section == d; o++) l = l + 1; const p = { x: h * c.taskMargin + h * c.width + P, y: 50, text: i.section, fill: g, num: x, colour: m, taskCount: l }; j.drawSection(t, p, c), r = i.section, y++; } const a = i.people.reduce((l, d) => (E[d] && (l[d] = E[d]), l), {}); i.x = h * c.taskMargin + h * c.width + P, i.y = u, i.width = c.diagramMarginX, i.height = c.diagramMarginY, i.colour = m, i.fill = g, i.num = x, i.actors = a, j.drawTask(t, i, c), S.insert(i.x, i.y, i.x + i.width + c.taskMargin, 300 + 5 * 30); }}, "drawTasks"), at = { setConf: Xt, draw: Gt}, Qt = { parser: Et, db: rt, renderer: at, styles: jt, init: /* @__PURE__ */ n((t) => { at.setConf(t.journey), rt.clear(); }, "init")};export { Qt as diagram};123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720import { g as fe } from "./chunk-UIWBPB2F-muaaSQOG.js";import { _ as c, l as te, c as W, H as ye, af as be, ag as me, ah as _e, V as Ee, F as K, i as G, t as ke, J as Se, W as Ne, X as le, Y as ce } from "./mermaid.core-BiIw1_mh.js";var $ = function() { var t = /* @__PURE__ */ c(function(_, s, n, a) { for (n = n || {}, a = _.length; a--; n[_[a]] = s) ; return n; }, "o"), g = [1, 4], d = [1, 13], r = [1, 12], p = [1, 15], E = [1, 16], f = [1, 20], h = [1, 19], L = [6, 7, 8], C = [1, 26], w = [1, 24], N = [1, 25], i = [6, 7, 11], H = [1, 31], x = [6, 7, 11, 24], P = [1, 6, 13, 16, 17, 20, 23], M = [1, 35], U = [1, 36], A = [1, 6, 7, 11, 13, 16, 17, 20, 23], j = [1, 38], V = { trace: /* @__PURE__ */ c(function() { }, "trace"), yy: {}, symbols_: { error: 2, start: 3, mindMap: 4, spaceLines: 5, SPACELINE: 6, NL: 7, KANBAN: 8, document: 9, stop: 10, EOF: 11, statement: 12, SPACELIST: 13, node: 14, shapeData: 15, ICON: 16, CLASS: 17, nodeWithId: 18, nodeWithoutId: 19, NODE_DSTART: 20, NODE_DESCR: 21, NODE_DEND: 22, NODE_ID: 23, SHAPE_DATA: 24, $accept: 0, $end: 1 }, terminals_: { 2: "error", 6: "SPACELINE", 7: "NL", 8: "KANBAN", 11: "EOF", 13: "SPACELIST", 16: "ICON", 17: "CLASS", 20: "NODE_DSTART", 21: "NODE_DESCR", 22: "NODE_DEND", 23: "NODE_ID", 24: "SHAPE_DATA" }, productions_: [0, [3, 1], [3, 2], [5, 1], [5, 2], [5, 2], [4, 2], [4, 3], [10, 1], [10, 1], [10, 1], [10, 2], [10, 2], [9, 3], [9, 2], [12, 3], [12, 2], [12, 2], [12, 2], [12, 1], [12, 2], [12, 1], [12, 1], [12, 1], [12, 1], [14, 1], [14, 1], [19, 3], [18, 1], [18, 4], [15, 2], [15, 1]], performAction: /* @__PURE__ */ c(function(s, n, a, o, u, e, B) { var l = e.length - 1; switch (u) { case 6: case 7: return o; case 8: o.getLogger().trace("Stop NL "); break; case 9: o.getLogger().trace("Stop EOF "); break; case 11: o.getLogger().trace("Stop NL2 "); break; case 12: o.getLogger().trace("Stop EOF2 "); break; case 15: o.getLogger().info("Node: ", e[l - 1].id), o.addNode(e[l - 2].length, e[l - 1].id, e[l - 1].descr, e[l - 1].type, e[l]); break; case 16: o.getLogger().info("Node: ", e[l].id), o.addNode(e[l - 1].length, e[l].id, e[l].descr, e[l].type); break; case 17: o.getLogger().trace("Icon: ", e[l]), o.decorateNode({ icon: e[l] }); break; case 18: case 23: o.decorateNode({ class: e[l] }); break; case 19: o.getLogger().trace("SPACELIST"); break; case 20: o.getLogger().trace("Node: ", e[l - 1].id), o.addNode(0, e[l - 1].id, e[l - 1].descr, e[l - 1].type, e[l]); break; case 21: o.getLogger().trace("Node: ", e[l].id), o.addNode(0, e[l].id, e[l].descr, e[l].type); break; case 22: o.decorateNode({ icon: e[l] }); break; case 27: o.getLogger().trace("node found ..", e[l - 2]), this.$ = { id: e[l - 1], descr: e[l - 1], type: o.getType(e[l - 2], e[l]) }; break; case 28: this.$ = { id: e[l], descr: e[l], type: 0 }; break; case 29: o.getLogger().trace("node found ..", e[l - 3]), this.$ = { id: e[l - 3], descr: e[l - 1], type: o.getType(e[l - 2], e[l]) }; break; case 30: this.$ = e[l - 1] + e[l]; break; case 31: this.$ = e[l]; break; } }, "anonymous"), table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 8: g }, { 1: [3] }, { 1: [2, 1] }, { 4: 6, 6: [1, 7], 7: [1, 8], 8: g }, { 6: d, 7: [1, 10], 9: 9, 12: 11, 13: r, 14: 14, 16: p, 17: E, 18: 17, 19: 18, 20: f, 23: h }, t(L, [2, 3]), { 1: [2, 2] }, t(L, [2, 4]), t(L, [2, 5]), { 1: [2, 6], 6: d, 12: 21, 13: r, 14: 14, 16: p, 17: E, 18: 17, 19: 18, 20: f, 23: h }, { 6: d, 9: 22, 12: 11, 13: r, 14: 14, 16: p, 17: E, 18: 17, 19: 18, 20: f, 23: h }, { 6: C, 7: w, 10: 23, 11: N }, t(i, [2, 24], { 18: 17, 19: 18, 14: 27, 16: [1, 28], 17: [1, 29], 20: f, 23: h }), t(i, [2, 19]), t(i, [2, 21], { 15: 30, 24: H }), t(i, [2, 22]), t(i, [2, 23]), t(x, [2, 25]), t(x, [2, 26]), t(x, [2, 28], { 20: [1, 32] }), { 21: [1, 33] }, { 6: C, 7: w, 10: 34, 11: N }, { 1: [2, 7], 6: d, 12: 21, 13: r, 14: 14, 16: p, 17: E, 18: 17, 19: 18, 20: f, 23: h }, t(P, [2, 14], { 7: M, 11: U }), t(A, [2, 8]), t(A, [2, 9]), t(A, [2, 10]), t(i, [2, 16], { 15: 37, 24: H }), t(i, [2, 17]), t(i, [2, 18]), t(i, [2, 20], { 24: j }), t(x, [2, 31]), { 21: [1, 39] }, { 22: [1, 40] }, t(P, [2, 13], { 7: M, 11: U }), t(A, [2, 11]), t(A, [2, 12]), t(i, [2, 15], { 24: j }), t(x, [2, 30]), { 22: [1, 41] }, t(x, [2, 27]), t(x, [2, 29])], defaultActions: { 2: [2, 1], 6: [2, 2] }, parseError: /* @__PURE__ */ c(function(s, n) { if (n.recoverable) this.trace(s); else { var a = new Error(s); throw a.hash = n, a; } }, "parseError"), parse: /* @__PURE__ */ c(function(s) { var n = this, a = [0], o = [], u = [null], e = [], B = this.table, l = "", z = 0, ie = 0, ue = 2, re = 1, ge = e.slice.call(arguments, 1), b = Object.create(this.lexer), T = { yy: {} }; for (var J in this.yy) Object.prototype.hasOwnProperty.call(this.yy, J) && (T.yy[J] = this.yy[J]); b.setInput(s, T.yy), T.yy.lexer = b, T.yy.parser = this, typeof b.yylloc > "u" && (b.yylloc = {}); var q = b.yylloc; e.push(q); var de = b.options && b.options.ranges; typeof T.yy.parseError == "function" ? this.parseError = T.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError; function pe(S) { a.length = a.length - 2 * S, u.length = u.length - S, e.length = e.length - S; } c(pe, "popStack"); function ae() { var S; return S = o.pop() || b.lex() || re, typeof S != "number" && (S instanceof Array && (o = S, S = o.pop()), S = n.symbols_[S] || S), S; } c(ae, "lex"); for (var k, R, v, Q, F = {}, X, I, oe, Y; ; ) { if (R = a[a.length - 1], this.defaultActions[R] ? v = this.defaultActions[R] : ((k === null || typeof k > "u") && (k = ae()), v = B[R] && B[R][k]), typeof v > "u" || !v.length || !v[0]) { var Z = ""; Y = []; for (X in B[R]) this.terminals_[X] && X > ue && Y.push("'" + this.terminals_[X] + "'"); b.showPosition ? Z = "Parse error on line " + (z + 1) + `:` + b.showPosition() + `Expecting ` + Y.join(", ") + ", got '" + (this.terminals_[k] || k) + "'" : Z = "Parse error on line " + (z + 1) + ": Unexpected " + (k == re ? "end of input" : "'" + (this.terminals_[k] || k) + "'"), this.parseError(Z, { text: b.match, token: this.terminals_[k] || k, line: b.yylineno, loc: q, expected: Y }); } if (v[0] instanceof Array && v.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + R + ", token: " + k); switch (v[0]) { case 1: a.push(k), u.push(b.yytext), e.push(b.yylloc), a.push(v[1]), k = null, ie = b.yyleng, l = b.yytext, z = b.yylineno, q = b.yylloc; break; case 2: if (I = this.productions_[v[1]][1], F.$ = u[u.length - I], F._$ = { first_line: e[e.length - (I || 1)].first_line, last_line: e[e.length - 1].last_line, first_column: e[e.length - (I || 1)].first_column, last_column: e[e.length - 1].last_column }, de && (F._$.range = [ e[e.length - (I || 1)].range[0], e[e.length - 1].range[1] ]), Q = this.performAction.apply(F, [ l, ie, z, T.yy, v[1], u, e ].concat(ge)), typeof Q < "u") return Q; I && (a = a.slice(0, -1 * I * 2), u = u.slice(0, -1 * I), e = e.slice(0, -1 * I)), a.push(this.productions_[v[1]][0]), u.push(F.$), e.push(F._$), oe = B[a[a.length - 2]][a[a.length - 1]], a.push(oe); break; case 3: return !0; } } return !0; }, "parse") }, m = /* @__PURE__ */ function() { var _ = { EOF: 1, parseError: /* @__PURE__ */ c(function(n, a) { if (this.yy.parser) this.yy.parser.parseError(n, a); else throw new Error(n); }, "parseError"), // resets the lexer, sets new input setInput: /* @__PURE__ */ c(function(s, n) { return this.yy = n || this.yy || {}, this._input = s, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this; }, "setInput"), // consumes and returns one char from the input input: /* @__PURE__ */ c(function() { var s = this._input[0]; this.yytext += s, this.yyleng++, this.offset++, this.match += s, this.matched += s; var n = s.match(/(?:\r\n?|\n).*/g); return n ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), s; }, "input"), // unshifts one char (or a string) into the input unput: /* @__PURE__ */ c(function(s) { var n = s.length, a = s.split(/(?:\r\n?|\n)/g); this._input = s + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - n), this.offset -= n; var o = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), a.length - 1 && (this.yylineno -= a.length - 1); var u = this.yylloc.range; return this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: a ? (a.length === o.length ? this.yylloc.first_column : 0) + o[o.length - a.length].length - a[0].length : this.yylloc.first_column - n }, this.options.ranges && (this.yylloc.range = [u[0], u[0] + this.yyleng - n]), this.yyleng = this.yytext.length, this; }, "unput"), // When called from action, caches matched text and appends it on next action more: /* @__PURE__ */ c(function() { return this._more = !0, this; }, "more"), // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject: /* @__PURE__ */ c(function() { if (this.options.backtrack_lexer) this._backtrack = !0; else return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).` + this.showPosition(), { text: "", token: null, line: this.yylineno }); return this; }, "reject"), // retain first n characters of the match less: /* @__PURE__ */ c(function(s) { this.unput(this.match.slice(s)); }, "less"), // displays already matched input, i.e. for error messages pastInput: /* @__PURE__ */ c(function() { var s = this.matched.substr(0, this.matched.length - this.match.length); return (s.length > 20 ? "..." : "") + s.substr(-20).replace(/\n/g, ""); }, "pastInput"), // displays upcoming input, i.e. for error messages upcomingInput: /* @__PURE__ */ c(function() { var s = this.match; return s.length < 20 && (s += this._input.substr(0, 20 - s.length)), (s.substr(0, 20) + (s.length > 20 ? "..." : "")).replace(/\n/g, ""); }, "upcomingInput"), // displays the character position where the lexing error occurred, i.e. for error messages showPosition: /* @__PURE__ */ c(function() { var s = this.pastInput(), n = new Array(s.length + 1).join("-"); return s + this.upcomingInput() + `` + n + "^"; }, "showPosition"), // test the lexed token: return FALSE when not a match, otherwise return token test_match: /* @__PURE__ */ c(function(s, n) { var a, o, u; if (this.options.backtrack_lexer && (u = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }, this.options.ranges && (u.yylloc.range = this.yylloc.range.slice(0))), o = s[0].match(/(?:\r\n?|\n).*/g), o && (this.yylineno += o.length), this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: o ? o[o.length - 1].length - o[o.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + s[0].length }, this.yytext += s[0], this.match += s[0], this.matches = s, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(s[0].length), this.matched += s[0], a = this.performAction.call(this, this.yy, this, n, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), a) return a; if (this._backtrack) { for (var e in u) this[e] = u[e]; return !1; } return !1; }, "test_match"), // return next match in input next: /* @__PURE__ */ c(function() { if (this.done) return this.EOF; this._input || (this.done = !0); var s, n, a, o; this._more || (this.yytext = "", this.match = ""); for (var u = this._currentRules(), e = 0; e < u.length; e++) if (a = this._input.match(this.rules[u[e]]), a && (!n || a[0].length > n[0].length)) { if (n = a, o = e, this.options.backtrack_lexer) { if (s = this.test_match(a, u[e]), s !== !1) return s; if (this._backtrack) { n = !1; continue; } else return !1; } else if (!this.options.flex) break; } return n ? (s = this.test_match(n, u[o]), s !== !1 ? s : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.` + this.showPosition(), { text: "", token: null, line: this.yylineno }); }, "next"), // return next match that has a token lex: /* @__PURE__ */ c(function() { var n = this.next(); return n || this.lex(); }, "lex"), // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin: /* @__PURE__ */ c(function(n) { this.conditionStack.push(n); }, "begin"), // pop the previously active lexer condition state off the condition stack popState: /* @__PURE__ */ c(function() { var n = this.conditionStack.length - 1; return n > 0 ? this.conditionStack.pop() : this.conditionStack[0]; }, "popState"), // produce the lexer rule set which is active for the currently active lexer condition state _currentRules: /* @__PURE__ */ c(function() { return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules; }, "_currentRules"), // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState: /* @__PURE__ */ c(function(n) { return n = this.conditionStack.length - 1 - Math.abs(n || 0), n >= 0 ? this.conditionStack[n] : "INITIAL"; }, "topState"), // alias for begin(condition) pushState: /* @__PURE__ */ c(function(n) { this.begin(n); }, "pushState"), // return the number of states currently on the stack stateStackSize: /* @__PURE__ */ c(function() { return this.conditionStack.length; }, "stateStackSize"), options: { "case-insensitive": !0 }, performAction: /* @__PURE__ */ c(function(n, a, o, u) { switch (o) { case 0: return this.pushState("shapeData"), a.yytext = "", 24; case 1: return this.pushState("shapeDataStr"), 24; case 2: return this.popState(), 24; case 3: const e = /\n\s*/g; return a.yytext = a.yytext.replace(e, "<br/>"), 24; case 4: return 24; case 5: this.popState(); break; case 6: return n.getLogger().trace("Found comment", a.yytext), 6; case 7: return 8; case 8: this.begin("CLASS"); break; case 9: return this.popState(), 17; case 10: this.popState(); break; case 11: n.getLogger().trace("Begin icon"), this.begin("ICON"); break; case 12: return n.getLogger().trace("SPACELINE"), 6; case 13: return 7; case 14: return 16; case 15: n.getLogger().trace("end icon"), this.popState(); break; case 16: return n.getLogger().trace("Exploding node"), this.begin("NODE"), 20; case 17: return n.getLogger().trace("Cloud"), this.begin("NODE"), 20; case 18: return n.getLogger().trace("Explosion Bang"), this.begin("NODE"), 20; case 19: return n.getLogger().trace("Cloud Bang"), this.begin("NODE"), 20; case 20: return this.begin("NODE"), 20; case 21: return this.begin("NODE"), 20; case 22: return this.begin("NODE"), 20; case 23: return this.begin("NODE"), 20; case 24: return 13; case 25: return 23; case 26: return 11; case 27: this.begin("NSTR2"); break; case 28: return "NODE_DESCR"; case 29: this.popState(); break; case 30: n.getLogger().trace("Starting NSTR"), this.begin("NSTR"); break; case 31: return n.getLogger().trace("description:", a.yytext), "NODE_DESCR"; case 32: this.popState(); break; case 33: return this.popState(), n.getLogger().trace("node end ))"), "NODE_DEND"; case 34: return this.popState(), n.getLogger().trace("node end )"), "NODE_DEND"; case 35: return this.popState(), n.getLogger().trace("node end ...", a.yytext), "NODE_DEND"; case 36: return this.popState(), n.getLogger().trace("node end (("), "NODE_DEND"; case 37: return this.popState(), n.getLogger().trace("node end (-"), "NODE_DEND"; case 38: return this.popState(), n.getLogger().trace("node end (-"), "NODE_DEND"; case 39: return this.popState(), n.getLogger().trace("node end (("), "NODE_DEND"; case 40: return this.popState(), n.getLogger().trace("node end (("), "NODE_DEND"; case 41: return n.getLogger().trace("Long description:", a.yytext), 21; case 42: return n.getLogger().trace("Long description:", a.yytext), 21; } }, "anonymous"), rules: [/^(?:@\{)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^\"]+)/i, /^(?:[^}^"]+)/i, /^(?:\})/i, /^(?:\s*%%.*)/i, /^(?:kanban\b)/i, /^(?::::)/i, /^(?:.+)/i, /^(?:\n)/i, /^(?:::icon\()/i, /^(?:[\s]+[\n])/i, /^(?:[\n]+)/i, /^(?:[^\)]+)/i, /^(?:\))/i, /^(?:-\))/i, /^(?:\(-)/i, /^(?:\)\))/i, /^(?:\))/i, /^(?:\(\()/i, /^(?:\{\{)/i, /^(?:\()/i, /^(?:\[)/i, /^(?:[\s]+)/i, /^(?:[^\(\[\n\)\{\}@]+)/i, /^(?:$)/i, /^(?:["][`])/i, /^(?:[^`"]+)/i, /^(?:[`]["])/i, /^(?:["])/i, /^(?:[^"]+)/i, /^(?:["])/i, /^(?:[\)]\))/i, /^(?:[\)])/i, /^(?:[\]])/i, /^(?:\}\})/i, /^(?:\(-)/i, /^(?:-\))/i, /^(?:\(\()/i, /^(?:\()/i, /^(?:[^\)\]\(\}]+)/i, /^(?:.+(?!\(\())/i], conditions: { shapeDataEndBracket: { rules: [], inclusive: !1 }, shapeDataStr: { rules: [2, 3], inclusive: !1 }, shapeData: { rules: [1, 4, 5], inclusive: !1 }, CLASS: { rules: [9, 10], inclusive: !1 }, ICON: { rules: [14, 15], inclusive: !1 }, NSTR2: { rules: [28, 29], inclusive: !1 }, NSTR: { rules: [31, 32], inclusive: !1 }, NODE: { rules: [27, 30, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42], inclusive: !1 }, INITIAL: { rules: [0, 6, 7, 8, 11, 12, 13, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26], inclusive: !0 } } }; return _; }(); V.lexer = m; function O() { this.yy = {}; } return c(O, "Parser"), O.prototype = V, V.Parser = O, new O();}();$.parser = $;var xe = $, D = [], ne = [], ee = 0, se = {}, ve = /* @__PURE__ */ c(() => { D = [], ne = [], ee = 0, se = {};}, "clear"), De = /* @__PURE__ */ c((t) => { if (D.length === 0) return null; const g = D[0].level; let d = null; for (let r = D.length - 1; r >= 0; r--) if (D[r].level === g && !d && (d = D[r]), D[r].level < g) throw new Error('Items without section detected, found section ("' + D[r].label + '")'); return t === (d == null ? void 0 : d.level) ? null : d;}, "getSection"), he = /* @__PURE__ */ c(function() { return ne;}, "getSections"), Le = /* @__PURE__ */ c(function() { const t = [], g = [], d = he(), r = W(); for (const p of d) { const E = { id: p.id, label: G(p.label ?? "", r), isGroup: !0, ticket: p.ticket, shape: "kanbanSection", level: p.level, look: r.look }; g.push(E); const f = D.filter((h) => h.parentId === p.id); for (const h of f) { const L = { id: h.id, parentId: p.id, label: G(h.label ?? "", r), isGroup: !1, ticket: h == null ? void 0 : h.ticket, priority: h == null ? void 0 : h.priority, assigned: h == null ? void 0 : h.assigned, icon: h == null ? void 0 : h.icon, shape: "kanbanItem", level: h.level, rx: 5, ry: 5, cssStyles: ["text-align: left"] }; g.push(L); } } return { nodes: g, edges: t, other: {}, config: W() };}, "getData"), Oe = /* @__PURE__ */ c((t, g, d, r, p) => { var C, w; const E = W(); let f = ((C = E.mindmap) == null ? void 0 : C.padding) ?? K.mindmap.padding; switch (r) { case y.ROUNDED_RECT: case y.RECT: case y.HEXAGON: f *= 2; } const h = { id: G(g, E) || "kbn" + ee++, level: t, label: G(d, E), width: ((w = E.mindmap) == null ? void 0 : w.maxNodeWidth) ?? K.mindmap.maxNodeWidth, padding: f, isGroup: !1 }; if (p !== void 0) { let N; p.includes(``) ? N = p + `` : N = `{` + p + `}`; const i = ke(N, { schema: Se }); if (i.shape && (i.shape !== i.shape.toLowerCase() || i.shape.includes("_"))) throw new Error(`No such shape: ${i.shape}. Shape names should be lowercase.`); i != null && i.shape && i.shape === "kanbanItem" && (h.shape = i == null ? void 0 : i.shape), i != null && i.label && (h.label = i == null ? void 0 : i.label), i != null && i.icon && (h.icon = i == null ? void 0 : i.icon.toString()), i != null && i.assigned && (h.assigned = i == null ? void 0 : i.assigned.toString()), i != null && i.ticket && (h.ticket = i == null ? void 0 : i.ticket.toString()), i != null && i.priority && (h.priority = i == null ? void 0 : i.priority); } const L = De(t); L ? h.parentId = L.id || "kbn" + ee++ : ne.push(h), D.push(h);}, "addNode"), y = { DEFAULT: 0, NO_BORDER: 0, ROUNDED_RECT: 1, RECT: 2, CIRCLE: 3, CLOUD: 4, BANG: 5, HEXAGON: 6}, Ie = /* @__PURE__ */ c((t, g) => { switch (te.debug("In get type", t, g), t) { case "[": return y.RECT; case "(": return g === ")" ? y.ROUNDED_RECT : y.CLOUD; case "((": return y.CIRCLE; case ")": return y.CLOUD; case "))": return y.BANG; case "{{": return y.HEXAGON; default: return y.DEFAULT; }}, "getType"), Ce = /* @__PURE__ */ c((t, g) => { se[t] = g;}, "setElementForId"), we = /* @__PURE__ */ c((t) => { if (!t) return; const g = W(), d = D[D.length - 1]; t.icon && (d.icon = G(t.icon, g)), t.class && (d.cssClasses = G(t.class, g));}, "decorateNode"), Ae = /* @__PURE__ */ c((t) => { switch (t) { case y.DEFAULT: return "no-border"; case y.RECT: return "rect"; case y.ROUNDED_RECT: return "rounded-rect"; case y.CIRCLE: return "circle"; case y.CLOUD: return "cloud"; case y.BANG: return "bang"; case y.HEXAGON: return "hexgon"; default: return "no-border"; }}, "type2Str"), Te = /* @__PURE__ */ c(() => te, "getLogger"), Re = /* @__PURE__ */ c((t) => se[t], "getElementById"), Pe = { clear: ve, addNode: Oe, getSections: he, getData: Le, nodeType: y, getType: Ie, setElementForId: Ce, decorateNode: we, type2Str: Ae, getLogger: Te, getElementById: Re}, Ve = Pe, Be = /* @__PURE__ */ c(async (t, g, d, r) => { var M, U, A, j, V; te.debug(`Rendering kanban diagram` + t); const E = r.db.getData(), f = W(); f.htmlLabels = !1; const h = ye(g), L = h.append("g"); L.attr("class", "sections"); const C = h.append("g"); C.attr("class", "items"); const w = E.nodes.filter( // TODO: TypeScript 5.5 will infer this predicate automatically (m) => m.isGroup ); let N = 0; const i = 10, H = []; let x = 25; for (const m of w) { const O = ((M = f == null ? void 0 : f.kanban) == null ? void 0 : M.sectionWidth) || 200; N = N + 1, m.x = O * N + (N - 1) * i / 2, m.width = O, m.y = 0, m.height = O * 3, m.rx = 5, m.ry = 5, m.cssClasses = m.cssClasses + " section-" + N; const _ = await be(L, m); x = Math.max(x, (U = _ == null ? void 0 : _.labelBBox) == null ? void 0 : U.height), H.push(_); } let P = 0; for (const m of w) { const O = H[P]; P = P + 1; const _ = ((A = f == null ? void 0 : f.kanban) == null ? void 0 : A.sectionWidth) || 200, s = -_ * 3 / 2 + x; let n = s; const a = E.nodes.filter((e) => e.parentId === m.id); for (const e of a) { if (e.isGroup) throw new Error("Groups within groups are not allowed in Kanban diagrams"); e.x = m.x, e.width = _ - 1.5 * i; const l = (await me(C, e, { config: f })).node().getBBox(); e.y = n + l.height / 2, await _e(e), n = e.y + l.height / 2 + i / 2; } const o = O.cluster.select("rect"), u = Math.max(n - s + 3 * i, 50) + (x - 25); o.attr("height", u); } Ee( void 0, h, ((j = f.mindmap) == null ? void 0 : j.padding) ?? K.kanban.padding, ((V = f.mindmap) == null ? void 0 : V.useMaxWidth) ?? K.kanban.useMaxWidth );}, "draw"), Fe = { draw: Be}, Ge = /* @__PURE__ */ c((t) => { let g = ""; for (let r = 0; r < t.THEME_COLOR_LIMIT; r++) t["lineColor" + r] = t["lineColor" + r] || t["cScaleInv" + r], Ne(t["lineColor" + r]) ? t["lineColor" + r] = le(t["lineColor" + r], 20) : t["lineColor" + r] = ce(t["lineColor" + r], 20); const d = /* @__PURE__ */ c((r, p) => t.darkMode ? ce(r, p) : le(r, p), "adjuster"); for (let r = 0; r < t.THEME_COLOR_LIMIT; r++) { const p = "" + (17 - 3 * r); g += ` .section-${r - 1} rect, .section-${r - 1} path, .section-${r - 1} circle, .section-${r - 1} polygon, .section-${r - 1} path { fill: ${d(t["cScale" + r], 10)}; stroke: ${d(t["cScale" + r], 10)};
} .section-${r - 1} text { fill: ${t["cScaleLabel" + r]}; } .node-icon-${r - 1} { font-size: 40px; color: ${t["cScaleLabel" + r]}; } .section-edge-${r - 1}{ stroke: ${t["cScale" + r]}; } .edge-depth-${r - 1}{ stroke-width: ${p}; } .section-${r - 1} line { stroke: ${t["cScaleInv" + r]} ; stroke-width: 3; }
.disabled, .disabled circle, .disabled text { fill: lightgray; } .disabled text { fill: #efefef; }
.node rect, .node circle, .node ellipse, .node polygon, .node path { fill: ${t.background}; stroke: ${t.nodeBorder}; stroke-width: 1px; }
.kanban-ticket-link { fill: ${t.background}; stroke: ${t.nodeBorder}; text-decoration: underline; } `; } return g;}, "genSections"), He = /* @__PURE__ */ c((t) => ` .edge { stroke-width: 3; } ${Ge(t)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${t.git0}; } .section-root text { fill: ${t.gitBranchLabel0}; } .icon-container { height:100%; display: flex; justify-content: center; align-items: center; } .edge { fill: none; } .cluster-label, .label { color: ${t.textColor}; fill: ${t.textColor}; } .kanban-label { dy: 1em; alignment-baseline: middle; text-anchor: middle; dominant-baseline: middle; text-align: center; } ${fe()}`, "getStyles"), Me = He, We = { db: Ve, renderer: Fe, parser: xe, styles: Me};export { We as diagram};1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324import { G as g } from "./graph-BH65arkC.js";import { b as Te, p as ce, q as le, g as z, e as ee, l as j, o as Me, s as Ie, c as Se, u as Fe, d as f, i as m, f as _, v as x, r as I } from "./_baseUniq-BzpV2HJ8.js";import { f as O, b as he, a as je, c as Ve, d as Ae, t as V, m as w, e as P, h as ve, g as X, l as T, i as Be } from "./_basePickBy-DxXFlUZa.js";import { b4 as Ge, b5 as Ye, b6 as De, aM as qe, b7 as $e, aQ as pe, aP as we, b8 as We, aL as q, aA as ze, aS as Xe, aC as Ue, b9 as $ } from "./mermaid.core-BiIw1_mh.js";function He(e) { return Ge(Ye(e, void 0, O), e + "");}var Je = 1, Qe = 4;function Ze(e) { return Te(e, Je | Qe);}function Ke(e, n) { return e == null ? e : De(e, ce(n), qe);}function en(e, n) { return e && le(e, ce(n));}function nn(e, n) { return e > n;}function S(e, n) { var r = {}; return n = z(n), le(e, function(t, a, i) { $e(r, a, n(t, a, i)); }), r;}function y(e) { return e && e.length ? he(e, pe, nn) : void 0;}function U(e, n) { return e && e.length ? he(e, z(n), je) : void 0;}function rn(e, n) { var r = e.length; for (e.sort(n); r--; ) e[r] = e[r].value; return e;}function tn(e, n) { if (e !== n) { var r = e !== void 0, t = e === null, a = e === e, i = ee(e), o = n !== void 0, u = n === null, d = n === n, s = ee(n); if (!u && !s && !i && e > n || i && o && d && !u && !s || t && o && d || !r && d || !a) return 1; if (!t && !i && !s && e < n || s && r && a && !t && !i || u && r && a || !o && a || !d) return -1; } return 0;}function an(e, n, r) { for (var t = -1, a = e.criteria, i = n.criteria, o = a.length, u = r.length; ++t < o; ) { var d = tn(a[t], i[t]); if (d) { if (t >= u) return d; var s = r[t]; return d * (s == "desc" ? -1 : 1); } } return e.index - n.index;}function on(e, n, r) { n.length ? n = j(n, function(i) { return we(i) ? function(o) { return Me(o, i.length === 1 ? i[0] : i); } : i; }) : n = [pe]; var t = -1; n = j(n, We(z)); var a = Ve(e, function(i, o, u) { var d = j(n, function(s) { return s(i); }); return { criteria: d, index: ++t, value: i }; }); return rn(a, function(i, o) { return an(i, o, r); });}function un(e, n) { return Ae(e, n, function(r, t) { return Ie(e, t); });}var M = He(function(e, n) { return e == null ? {} : un(e, n);}), dn = Math.ceil, sn = Math.max;function fn(e, n, r, t) { for (var a = -1, i = sn(dn((n - e) / (r || 1)), 0), o = Array(i); i--; ) o[++a] = e, e += r; return o;}function cn(e) { return function(n, r, t) { return t && typeof t != "number" && q(n, r, t) && (r = t = void 0), n = V(n), r === void 0 ? (r = n, n = 0) : r = V(r), t = t === void 0 ? n < r ? 1 : -1 : V(t), fn(n, r, t); };}var E = cn(), R = ze(function(e, n) { if (e == null) return []; var r = n.length; return r > 1 && q(e, n[0], n[1]) ? n = [] : r > 2 && q(n[0], n[1], n[2]) && (n = [n[0]]), on(e, Se(n), []);}), ln = 0;function H(e) { var n = ++ln; return Fe(e) + n;}function hn(e, n, r) { for (var t = -1, a = e.length, i = n.length, o = {}; ++t < a; ) { var u = t < i ? n[t] : void 0; r(o, e[t], u); } return o;}function vn(e, n) { return hn(e || [], n || [], Xe);}class pn { constructor() { var n = {}; n._next = n._prev = n, this._sentinel = n; } dequeue() { var n = this._sentinel, r = n._prev; if (r !== n) return ne(r), r; } enqueue(n) { var r = this._sentinel; n._prev && n._next && ne(n), n._next = r._next, r._next._prev = n, r._next = n, n._prev = r; } toString() { for (var n = [], r = this._sentinel, t = r._prev; t !== r; ) n.push(JSON.stringify(t, wn)), t = t._prev; return "[" + n.join(", ") + "]"; }}function ne(e) { e._prev._next = e._next, e._next._prev = e._prev, delete e._next, delete e._prev;}function wn(e, n) { if (e !== "_next" && e !== "_prev") return n;}var bn = Ue(1);function mn(e, n) { if (e.nodeCount() <= 1) return []; var r = yn(e, n || bn), t = gn(r.graph, r.buckets, r.zeroIdx); return O( w(t, function(a) { return e.outEdges(a.v, a.w); }) );}function gn(e, n, r) { for (var t = [], a = n[n.length - 1], i = n[0], o; e.nodeCount(); ) { for (; o = i.dequeue(); ) A(e, n, r, o); for (; o = a.dequeue(); ) A(e, n, r, o); if (e.nodeCount()) { for (var u = n.length - 2; u > 0; --u) if (o = n[u].dequeue(), o) { t = t.concat(A(e, n, r, o, !0)); break; } } } return t;}function A(e, n, r, t, a) { var i = a ? [] : void 0; return f(e.inEdges(t.v), function(o) { var u = e.edge(o), d = e.node(o.v); a && i.push({ v: o.v, w: o.w }), d.out -= u, W(n, r, d); }), f(e.outEdges(t.v), function(o) { var u = e.edge(o), d = o.w, s = e.node(d); s.in -= u, W(n, r, s); }), e.removeNode(t.v), i;}function yn(e, n) { var r = new g(), t = 0, a = 0; f(e.nodes(), function(u) { r.setNode(u, { v: u, in: 0, out: 0 }); }), f(e.edges(), function(u) { var d = r.edge(u.v, u.w) || 0, s = n(u), c = d + s; r.setEdge(u.v, u.w, c), a = Math.max(a, r.node(u.v).out += s), t = Math.max(t, r.node(u.w).in += s); }); var i = E(a + t + 3).map(function() { return new pn(); }), o = t + 1; return f(r.nodes(), function(u) { W(i, o, r.node(u)); }), { graph: r, buckets: i, zeroIdx: o };}function W(e, n, r) { r.out ? r.in ? e[r.out - r.in + n].enqueue(r) : e[e.length - 1].enqueue(r) : e[0].enqueue(r);}function kn(e) { var n = e.graph().acyclicer === "greedy" ? mn(e, r(e)) : xn(e); f(n, function(t) { var a = e.edge(t); e.removeEdge(t), a.forwardName = t.name, a.reversed = !0, e.setEdge(t.w, t.v, a, H("rev")); }); function r(t) { return function(a) { return t.edge(a).weight; }; }}function xn(e) { var n = [], r = {}, t = {}; function a(i) { Object.prototype.hasOwnProperty.call(t, i) || (t[i] = !0, r[i] = !0, f(e.outEdges(i), function(o) { Object.prototype.hasOwnProperty.call(r, o.w) ? n.push(o) : a(o.w); }), delete r[i]); } return f(e.nodes(), a), n;}function En(e) { f(e.edges(), function(n) { var r = e.edge(n); if (r.reversed) { e.removeEdge(n); var t = r.forwardName; delete r.reversed, delete r.forwardName, e.setEdge(n.w, n.v, r, t); } });}function L(e, n, r, t) { var a; do a = H(t); while (e.hasNode(a)); return r.dummy = n, e.setNode(a, r), a;}function On(e) { var n = new g().setGraph(e.graph()); return f(e.nodes(), function(r) { n.setNode(r, e.node(r)); }), f(e.edges(), function(r) { var t = n.edge(r.v, r.w) || { weight: 0, minlen: 1 }, a = e.edge(r); n.setEdge(r.v, r.w, { weight: t.weight + a.weight, minlen: Math.max(t.minlen, a.minlen) }); }), n;}function be(e) { var n = new g({ multigraph: e.isMultigraph() }).setGraph(e.graph()); return f(e.nodes(), function(r) { e.children(r).length || n.setNode(r, e.node(r)); }), f(e.edges(), function(r) { n.setEdge(r, e.edge(r)); }), n;}function re(e, n) { var r = e.x, t = e.y, a = n.x - r, i = n.y - t, o = e.width / 2, u = e.height / 2; if (!a && !i) throw new Error("Not possible to find intersection inside of the rectangle"); var d, s; return Math.abs(i) * o > Math.abs(a) * u ? (i < 0 && (u = -u), d = u * a / i, s = u) : (a < 0 && (o = -o), d = o, s = o * i / a), { x: r + d, y: t + s };}function F(e) { var n = w(E(me(e) + 1), function() { return []; }); return f(e.nodes(), function(r) { var t = e.node(r), a = t.rank; m(a) || (n[a][t.order] = r); }), n;}function Ln(e) { var n = P( w(e.nodes(), function(r) { return e.node(r).rank; }) ); f(e.nodes(), function(r) { var t = e.node(r); ve(t, "rank") && (t.rank -= n); });}function Nn(e) { var n = P( w(e.nodes(), function(i) { return e.node(i).rank; }) ), r = []; f(e.nodes(), function(i) { var o = e.node(i).rank - n; r[o] || (r[o] = []), r[o].push(i); }); var t = 0, a = e.graph().nodeRankFactor; f(r, function(i, o) { m(i) && o % a !== 0 ? --t : t && f(i, function(u) { e.node(u).rank += t; }); });}function te(e, n, r, t) { var a = { width: 0, height: 0 }; return arguments.length >= 4 && (a.rank = r, a.order = t), L(e, "border", a, n);}function me(e) { return y( w(e.nodes(), function(n) { var r = e.node(n).rank; if (!m(r)) return r; }) );}function Pn(e, n) { var r = { lhs: [], rhs: [] }; return f(e, function(t) { n(t) ? r.lhs.push(t) : r.rhs.push(t); }), r;}function Cn(e, n) { return n();}function _n(e) { function n(r) { var t = e.children(r), a = e.node(r); if (t.length && f(t, n), Object.prototype.hasOwnProperty.call(a, "minRank")) { a.borderLeft = [], a.borderRight = []; for (var i = a.minRank, o = a.maxRank + 1; i < o; ++i) ae(e, "borderLeft", "_bl", r, a, i), ae(e, "borderRight", "_br", r, a, i); } } f(e.children(), n);}function ae(e, n, r, t, a, i) { var o = { width: 0, height: 0, rank: i, borderType: n }, u = a[n][i - 1], d = L(e, "border", o, r); a[n][i] = d, e.setParent(d, t), u && e.setEdge(u, d, { weight: 1 });}function Rn(e) { var n = e.graph().rankdir.toLowerCase(); (n === "lr" || n === "rl") && ge(e);}function Tn(e) { var n = e.graph().rankdir.toLowerCase(); (n === "bt" || n === "rl") && Mn(e), (n === "lr" || n === "rl") && (In(e), ge(e));}function ge(e) { f(e.nodes(), function(n) { ie(e.node(n)); }), f(e.edges(), function(n) { ie(e.edge(n)); });}function ie(e) { var n = e.width; e.width = e.height, e.height = n;}function Mn(e) { f(e.nodes(), function(n) { B(e.node(n)); }), f(e.edges(), function(n) { var r = e.edge(n); f(r.points, B), Object.prototype.hasOwnProperty.call(r, "y") && B(r); });}function B(e) { e.y = -e.y;}function In(e) { f(e.nodes(), function(n) { G(e.node(n)); }), f(e.edges(), function(n) { var r = e.edge(n); f(r.points, G), Object.prototype.hasOwnProperty.call(r, "x") && G(r); });}function G(e) { var n = e.x; e.x = e.y, e.y = n;}function Sn(e) { e.graph().dummyChains = [], f(e.edges(), function(n) { Fn(e, n); });}function Fn(e, n) { var r = n.v, t = e.node(r).rank, a = n.w, i = e.node(a).rank, o = n.name, u = e.edge(n), d = u.labelRank; if (i !== t + 1) { e.removeEdge(n); var s = void 0, c, l; for (l = 0, ++t; t < i; ++l, ++t) u.points = [], s = { width: 0, height: 0, edgeLabel: u, edgeObj: n, rank: t }, c = L(e, "edge", s, "_d"), t === d && (s.width = u.width, s.height = u.height, s.dummy = "edge-label", s.labelpos = u.labelpos), e.setEdge(r, c, { weight: u.weight }, o), l === 0 && e.graph().dummyChains.push(c), r = c; e.setEdge(r, a, { weight: u.weight }, o); }}function jn(e) { f(e.graph().dummyChains, function(n) { var r = e.node(n), t = r.edgeLabel, a; for (e.setEdge(r.edgeObj, t); r.dummy; ) a = e.successors(n)[0], e.removeNode(n), t.points.push({ x: r.x, y: r.y }), r.dummy === "edge-label" && (t.x = r.x, t.y = r.y, t.width = r.width, t.height = r.height), n = a, r = e.node(n); });}function J(e) { var n = {}; function r(t) { var a = e.node(t); if (Object.prototype.hasOwnProperty.call(n, t)) return a.rank; n[t] = !0; var i = P( w(e.outEdges(t), function(o) { return r(o.w) - e.edge(o).minlen; }) ); return (i === Number.POSITIVE_INFINITY || // return value of _.map([]) for Lodash 3 i === void 0 || // return value of _.map([]) for Lodash 4 i === null) && (i = 0), a.rank = i; } f(e.sources(), r);}function C(e, n) { return e.node(n.w).rank - e.node(n.v).rank - e.edge(n).minlen;}function ye(e) { var n = new g({ directed: !1 }), r = e.nodes()[0], t = e.nodeCount(); n.setNode(r, {}); for (var a, i; Vn(n, e) < t; ) a = An(n, e), i = n.hasNode(a.v) ? C(e, a) : -C(e, a), Bn(n, e, i); return n;}function Vn(e, n) { function r(t) { f(n.nodeEdges(t), function(a) { var i = a.v, o = t === i ? a.w : i; !e.hasNode(o) && !C(n, a) && (e.setNode(o, {}), e.setEdge(t, o, {}), r(o)); }); } return f(e.nodes(), r), e.nodeCount();}function An(e, n) { return U(n.edges(), function(r) { if (e.hasNode(r.v) !== e.hasNode(r.w)) return C(n, r); });}function Bn(e, n, r) { f(e.nodes(), function(t) { n.node(t).rank += r; });}function Gn() {}Gn.prototype = new Error();function ke(e, n, r) { we(n) || (n = [n]); var t = (e.isDirected() ? e.successors : e.neighbors).bind(e), a = [], i = {}; return f(n, function(o) { if (!e.hasNode(o)) throw new Error("Graph does not have node: " + o); xe(e, o, r === "post", i, t, a); }), a;}function xe(e, n, r, t, a, i) { Object.prototype.hasOwnProperty.call(t, n) || (t[n] = !0, r || i.push(n), f(a(n), function(o) { xe(e, o, r, t, a, i); }), r && i.push(n));}function Yn(e, n) { return ke(e, n, "post");}function Dn(e, n) { return ke(e, n, "pre");}k.initLowLimValues = Z;k.initCutValues = Q;k.calcCutValue = Ee;k.leaveEdge = Le;k.enterEdge = Ne;k.exchangeEdges = Pe;function k(e) { e = On(e), J(e); var n = ye(e); Z(n), Q(n, e); for (var r, t; r = Le(n); ) t = Ne(n, e, r), Pe(n, e, r, t);}function Q(e, n) { var r = Yn(e, e.nodes()); r = r.slice(0, r.length - 1), f(r, function(t) { qn(e, n, t); });}function qn(e, n, r) { var t = e.node(r), a = t.parent; e.edge(r, a).cutvalue = Ee(e, n, r);}function Ee(e, n, r) { var t = e.node(r), a = t.parent, i = !0, o = n.edge(r, a), u = 0; return o || (i = !1, o = n.edge(a, r)), u = o.weight, f(n.nodeEdges(r), function(d) { var s = d.v === r, c = s ? d.w : d.v; if (c !== a) { var l = s === i, h = n.edge(d).weight; if (u += l ? h : -h, Wn(e, r, c)) { var v = e.edge(r, c).cutvalue; u += l ? -v : v; } } }), u;}function Z(e, n) { arguments.length < 2 && (n = e.nodes()[0]), Oe(e, {}, 1, n);}function Oe(e, n, r, t, a) { var i = r, o = e.node(t); return n[t] = !0, f(e.neighbors(t), function(u) { Object.prototype.hasOwnProperty.call(n, u) || (r = Oe(e, n, r, u, t)); }), o.low = i, o.lim = r++, a ? o.parent = a : delete o.parent, r;}function Le(e) { return X(e.edges(), function(n) { return e.edge(n).cutvalue < 0; });}function Ne(e, n, r) { var t = r.v, a = r.w; n.hasEdge(t, a) || (t = r.w, a = r.v); var i = e.node(t), o = e.node(a), u = i, d = !1; i.lim > o.lim && (u = o, d = !0); var s = _(n.edges(), function(c) { return d === oe(e, e.node(c.v), u) && d !== oe(e, e.node(c.w), u); }); return U(s, function(c) { return C(n, c); });}function Pe(e, n, r, t) { var a = r.v, i = r.w; e.removeEdge(a, i), e.setEdge(t.v, t.w, {}), Z(e), Q(e, n), $n(e, n);}function $n(e, n) { var r = X(e.nodes(), function(a) { return !n.node(a).parent; }), t = Dn(e, r); t = t.slice(1), f(t, function(a) { var i = e.node(a).parent, o = n.edge(a, i), u = !1; o || (o = n.edge(i, a), u = !0), n.node(a).rank = n.node(i).rank + (u ? o.minlen : -o.minlen); });}function Wn(e, n, r) { return e.hasEdge(n, r);}function oe(e, n, r) { return r.low <= n.lim && n.lim <= r.lim;}function zn(e) { switch (e.graph().ranker) { case "network-simplex": ue(e); break; case "tight-tree": Un(e); break; case "longest-path": Xn(e); break; default: ue(e); }}var Xn = J;function Un(e) { J(e), ye(e);}function ue(e) { k(e);}function Hn(e) { var n = L(e, "root", {}, "_root"), r = Jn(e), t = y(x(r)) - 1, a = 2 * t + 1; e.graph().nestingRoot = n, f(e.edges(), function(o) { e.edge(o).minlen *= a; }); var i = Qn(e) + 1; f(e.children(), function(o) { Ce(e, n, a, i, t, r, o); }), e.graph().nodeRankFactor = a;}function Ce(e, n, r, t, a, i, o) { var u = e.children(o); if (!u.length) { o !== n && e.setEdge(n, o, { weight: 0, minlen: r }); return; } var d = te(e, "_bt"), s = te(e, "_bb"), c = e.node(o); e.setParent(d, o), c.borderTop = d, e.setParent(s, o), c.borderBottom = s, f(u, function(l) { Ce(e, n, r, t, a, i, l); var h = e.node(l), v = h.borderTop ? h.borderTop : l, p = h.borderBottom ? h.borderBottom : l, b = h.borderTop ? t : 2 * t, N = v !== p ? 1 : a - i[o] + 1; e.setEdge(d, v, { weight: b, minlen: N, nestingEdge: !0 }), e.setEdge(p, s, { weight: b, minlen: N, nestingEdge: !0 }); }), e.parent(o) || e.setEdge(n, d, { weight: 0, minlen: a + i[o] });}function Jn(e) { var n = {}; function r(t, a) { var i = e.children(t); i && i.length && f(i, function(o) { r(o, a + 1); }), n[t] = a; } return f(e.children(), function(t) { r(t, 1); }), n;}function Qn(e) { return I( e.edges(), function(n, r) { return n + e.edge(r).weight; }, 0 );}function Zn(e) { var n = e.graph(); e.removeNode(n.nestingRoot), delete n.nestingRoot, f(e.edges(), function(r) { var t = e.edge(r); t.nestingEdge && e.removeEdge(r); });}function Kn(e, n, r) { var t = {}, a; f(r, function(i) { for (var o = e.parent(i), u, d; o; ) { if (u = e.parent(o), u ? (d = t[u], t[u] = o) : (d = a, a = o), d && d !== o) { n.setEdge(d, o); return; } o = u; } });}function er(e, n, r) { var t = nr(e), a = new g({ compound: !0 }).setGraph({ root: t }).setDefaultNodeLabel(function(i) { return e.node(i); }); return f(e.nodes(), function(i) { var o = e.node(i), u = e.parent(i); (o.rank === n || o.minRank <= n && n <= o.maxRank) && (a.setNode(i), a.setParent(i, u || t), f(e[r](i), function(d) { var s = d.v === i ? d.w : d.v, c = a.edge(s, i), l = m(c) ? 0 : c.weight; a.setEdge(s, i, { weight: e.edge(d).weight + l }); }), Object.prototype.hasOwnProperty.call(o, "minRank") && a.setNode(i, { borderLeft: o.borderLeft[n], borderRight: o.borderRight[n] })); }), a;}function nr(e) { for (var n; e.hasNode(n = H("_root")); ) ; return n;}function rr(e, n) { for (var r = 0, t = 1; t < n.length; ++t) r += tr(e, n[t - 1], n[t]); return r;}function tr(e, n, r) { for (var t = vn( r, w(r, function(s, c) { return c; }) ), a = O( w(n, function(s) { return R( w(e.outEdges(s), function(c) { return { pos: t[c.w], weight: e.edge(c).weight }; }), "pos" ); }) ), i = 1; i < r.length; ) i <<= 1; var o = 2 * i - 1; i -= 1; var u = w(new Array(o), function() { return 0; }), d = 0; return f( // @ts-expect-error a.forEach(function(s) { var c = s.pos + i; u[c] += s.weight; for (var l = 0; c > 0; ) c % 2 && (l += u[c + 1]), c = c - 1 >> 1, u[c] += s.weight; d += s.weight * l; }) ), d;}function ar(e) { var n = {}, r = _(e.nodes(), function(u) { return !e.children(u).length; }), t = y( w(r, function(u) { return e.node(u).rank; }) ), a = w(E(t + 1), function() { return []; }); function i(u) { if (!ve(n, u)) { n[u] = !0; var d = e.node(u); a[d.rank].push(u), f(e.successors(u), i); } } var o = R(r, function(u) { return e.node(u).rank; }); return f(o, i), a;}function ir(e, n) { return w(n, function(r) { var t = e.inEdges(r); if (t.length) { var a = I( t, function(i, o) { var u = e.edge(o), d = e.node(o.v); return { sum: i.sum + u.weight * d.order, weight: i.weight + u.weight }; }, { sum: 0, weight: 0 } ); return { v: r, barycenter: a.sum / a.weight, weight: a.weight }; } else return { v: r }; });}function or(e, n) { var r = {}; f(e, function(a, i) { var o = r[a.v] = { indegree: 0, in: [], out: [], vs: [a.v], i }; m(a.barycenter) || (o.barycenter = a.barycenter, o.weight = a.weight); }), f(n.edges(), function(a) { var i = r[a.v], o = r[a.w]; !m(i) && !m(o) && (o.indegree++, i.out.push(r[a.w])); }); var t = _(r, function(a) { return !a.indegree; }); return ur(t);}function ur(e) { var n = []; function r(i) { return function(o) { o.merged || (m(o.barycenter) || m(i.barycenter) || o.barycenter >= i.barycenter) && dr(i, o); }; } function t(i) { return function(o) { o.in.push(i), --o.indegree === 0 && e.push(o); }; } for (; e.length; ) { var a = e.pop(); n.push(a), f(a.in.reverse(), r(a)), f(a.out, t(a)); } return w( _(n, function(i) { return !i.merged; }), function(i) { return M(i, ["vs", "i", "barycenter", "weight"]); } );}function dr(e, n) { var r = 0, t = 0; e.weight && (r += e.barycenter * e.weight, t += e.weight), n.weight && (r += n.barycenter * n.weight, t += n.weight), e.vs = n.vs.concat(e.vs), e.barycenter = r / t, e.weight = t, e.i = Math.min(n.i, e.i), n.merged = !0;}function sr(e, n) { var r = Pn(e, function(c) { return Object.prototype.hasOwnProperty.call(c, "barycenter"); }), t = r.lhs, a = R(r.rhs, function(c) { return -c.i; }), i = [], o = 0, u = 0, d = 0; t.sort(fr(!!n)), d = de(i, a, d), f(t, function(c) { d += c.vs.length, i.push(c.vs), o += c.barycenter * c.weight, u += c.weight, d = de(i, a, d); }); var s = { vs: O(i) }; return u && (s.barycenter = o / u, s.weight = u), s;}function de(e, n, r) { for (var t; n.length && (t = T(n)).i <= r; ) n.pop(), e.push(t.vs), r++; return r;}function fr(e) { return function(n, r) { return n.barycenter < r.barycenter ? -1 : n.barycenter > r.barycenter ? 1 : e ? r.i - n.i : n.i - r.i; };}function _e(e, n, r, t) { var a = e.children(n), i = e.node(n), o = i ? i.borderLeft : void 0, u = i ? i.borderRight : void 0, d = {}; o && (a = _(a, function(p) { return p !== o && p !== u; })); var s = ir(e, a); f(s, function(p) { if (e.children(p.v).length) { var b = _e(e, p.v, r, t); d[p.v] = b, Object.prototype.hasOwnProperty.call(b, "barycenter") && lr(p, b); } }); var c = or(s, r); cr(c, d); var l = sr(c, t); if (o && (l.vs = O([o, l.vs, u]), e.predecessors(o).length)) { var h = e.node(e.predecessors(o)[0]), v = e.node(e.predecessors(u)[0]); Object.prototype.hasOwnProperty.call(l, "barycenter") || (l.barycenter = 0, l.weight = 0), l.barycenter = (l.barycenter * l.weight + h.order + v.order) / (l.weight + 2), l.weight += 2; } return l;}function cr(e, n) { f(e, function(r) { r.vs = O( r.vs.map(function(t) { return n[t] ? n[t].vs : t; }) ); });}function lr(e, n) { m(e.barycenter) ? (e.barycenter = n.barycenter, e.weight = n.weight) : (e.barycenter = (e.barycenter * e.weight + n.barycenter * n.weight) / (e.weight + n.weight), e.weight += n.weight);}function hr(e) { var n = me(e), r = se(e, E(1, n + 1), "inEdges"), t = se(e, E(n - 1, -1, -1), "outEdges"), a = ar(e); fe(e, a); for (var i = Number.POSITIVE_INFINITY, o, u = 0, d = 0; d < 4; ++u, ++d) { vr(u % 2 ? r : t, u % 4 >= 2), a = F(e); var s = rr(e, a); s < i && (d = 0, o = Ze(a), i = s); } fe(e, o);}function se(e, n, r) { return w(n, function(t) { return er(e, t, r); });}function vr(e, n) { var r = new g(); f(e, function(t) { var a = t.graph().root, i = _e(t, a, r, n); f(i.vs, function(o, u) { t.node(o).order = u; }), Kn(t, r, i.vs); });}function fe(e, n) { f(n, function(r) { f(r, function(t, a) { e.node(t).order = a; }); });}function pr(e) { var n = br(e); f(e.graph().dummyChains, function(r) { for (var t = e.node(r), a = t.edgeObj, i = wr(e, n, a.v, a.w), o = i.path, u = i.lca, d = 0, s = o[d], c = !0; r !== a.w; ) { if (t = e.node(r), c) { for (; (s = o[d]) !== u && e.node(s).maxRank < t.rank; ) d++; s === u && (c = !1); } if (!c) { for (; d < o.length - 1 && e.node(s = o[d + 1]).minRank <= t.rank; ) d++; s = o[d]; } e.setParent(r, s), r = e.successors(r)[0]; } });}function wr(e, n, r, t) { var a = [], i = [], o = Math.min(n[r].low, n[t].low), u = Math.max(n[r].lim, n[t].lim), d, s; d = r; do d = e.parent(d), a.push(d); while (d && (n[d].low > o || u > n[d].lim)); for (s = d, d = t; (d = e.parent(d)) !== s; ) i.push(d); return { path: a.concat(i.reverse()), lca: s };}function br(e) { var n = {}, r = 0; function t(a) { var i = r; f(e.children(a), t), n[a] = { low: i, lim: r++ }; } return f(e.children(), t), n;}function mr(e, n) { var r = {}; function t(a, i) { var o = 0, u = 0, d = a.length, s = T(i); return f(i, function(c, l) { var h = yr(e, c), v = h ? e.node(h).order : d; (h || c === s) && (f(i.slice(u, l + 1), function(p) { f(e.predecessors(p), function(b) { var N = e.node(b), K = N.order; (K < o || v < K) && !(N.dummy && e.node(p).dummy) && Re(r, b, p); }); }), u = l + 1, o = v); }), i; } return I(n, t), r;}function gr(e, n) { var r = {}; function t(i, o, u, d, s) { var c; f(E(o, u), function(l) { c = i[l], e.node(c).dummy && f(e.predecessors(c), function(h) { var v = e.node(h); v.dummy && (v.order < d || v.order > s) && Re(r, h, c); }); }); } function a(i, o) { var u = -1, d, s = 0; return f(o, function(c, l) { if (e.node(c).dummy === "border") { var h = e.predecessors(c); h.length && (d = e.node(h[0]).order, t(o, s, l, u, d), s = l, u = d); } t(o, s, o.length, d, i.length); }), o; } return I(n, a), r;}function yr(e, n) { if (e.node(n).dummy) return X(e.predecessors(n), function(r) { return e.node(r).dummy; });}function Re(e, n, r) { if (n > r) { var t = n; n = r, r = t; } var a = e[n]; a || (e[n] = a = {}), a[r] = !0;}function kr(e, n, r) { if (n > r) { var t = n; n = r, r = t; } return !!e[n] && Object.prototype.hasOwnProperty.call(e[n], r);}function xr(e, n, r, t) { var a = {}, i = {}, o = {}; return f(n, function(u) { f(u, function(d, s) { a[d] = d, i[d] = d, o[d] = s; }); }), f(n, function(u) { var d = -1; f(u, function(s) { var c = t(s); if (c.length) { c = R(c, function(b) { return o[b]; }); for (var l = (c.length - 1) / 2, h = Math.floor(l), v = Math.ceil(l); h <= v; ++h) { var p = c[h]; i[s] === s && d < o[p] && !kr(r, s, p) && (i[p] = s, i[s] = a[s] = a[p], d = o[p]); } } }); }), { root: a, align: i };}function Er(e, n, r, t, a) { var i = {}, o = Or(e, n, r, a), u = a ? "borderLeft" : "borderRight"; function d(l, h) { for (var v = o.nodes(), p = v.pop(), b = {}; p; ) b[p] ? l(p) : (b[p] = !0, v.push(p), v = v.concat(h(p))), p = v.pop(); } function s(l) { i[l] = o.inEdges(l).reduce(function(h, v) { return Math.max(h, i[v.v] + o.edge(v)); }, 0); } function c(l) { var h = o.outEdges(l).reduce(function(p, b) { return Math.min(p, i[b.w] - o.edge(b)); }, Number.POSITIVE_INFINITY), v = e.node(l); h !== Number.POSITIVE_INFINITY && v.borderType !== u && (i[l] = Math.max(i[l], h)); } return d(s, o.predecessors.bind(o)), d(c, o.successors.bind(o)), f(t, function(l) { i[l] = i[r[l]]; }), i;}function Or(e, n, r, t) { var a = new g(), i = e.graph(), o = _r(i.nodesep, i.edgesep, t); return f(n, function(u) { var d; f(u, function(s) { var c = r[s]; if (a.setNode(c), d) { var l = r[d], h = a.edge(l, c); a.setEdge(l, c, Math.max(o(e, s, d), h || 0)); } d = s; }); }), a;}function Lr(e, n) { return U(x(n), function(r) { var t = Number.NEGATIVE_INFINITY, a = Number.POSITIVE_INFINITY; return Ke(r, function(i, o) { var u = Rr(e, o) / 2; t = Math.max(i + u, t), a = Math.min(i - u, a); }), t - a; });}function Nr(e, n) { var r = x(n), t = P(r), a = y(r); f(["u", "d"], function(i) { f(["l", "r"], function(o) { var u = i + o, d = e[u], s; if (d !== n) { var c = x(d); s = o === "l" ? t - P(c) : a - y(c), s && (e[u] = S(d, function(l) { return l + s; })); } }); });}function Pr(e, n) { return S(e.ul, function(r, t) { if (n) return e[n.toLowerCase()][t]; var a = R(w(e, t)); return (a[1] + a[2]) / 2; });}function Cr(e) { var n = F(e), r = $(mr(e, n), gr(e, n)), t = {}, a; f(["u", "d"], function(o) { a = o === "u" ? n : x(n).reverse(), f(["l", "r"], function(u) { u === "r" && (a = w(a, function(l) { return x(l).reverse(); })); var d = (o === "u" ? e.predecessors : e.successors).bind(e), s = xr(e, a, r, d), c = Er(e, a, s.root, s.align, u === "r"); u === "r" && (c = S(c, function(l) { return -l; })), t[o + u] = c; }); }); var i = Lr(e, t); return Nr(t, i), Pr(t, e.graph().align);}function _r(e, n, r) { return function(t, a, i) { var o = t.node(a), u = t.node(i), d = 0, s; if (d += o.width / 2, Object.prototype.hasOwnProperty.call(o, "labelpos")) switch (o.labelpos.toLowerCase()) { case "l": s = -o.width / 2; break; case "r": s = o.width / 2; break; } if (s && (d += r ? s : -s), s = 0, d += (o.dummy ? n : e) / 2, d += (u.dummy ? n : e) / 2, d += u.width / 2, Object.prototype.hasOwnProperty.call(u, "labelpos")) switch (u.labelpos.toLowerCase()) { case "l": s = u.width / 2; break; case "r": s = -u.width / 2; break; } return s && (d += r ? s : -s), s = 0, d; };}function Rr(e, n) { return e.node(n).width;}function Tr(e) { e = be(e), Mr(e), en(Cr(e), function(n, r) { e.node(r).x = n; });}function Mr(e) { var n = F(e), r = e.graph().ranksep, t = 0; f(n, function(a) { var i = y( w(a, function(o) { return e.node(o).height; }) ); f(a, function(o) { e.node(o).y = t + i / 2; }), t += i + r; });}function ot(e, n) { var r = Cn; r("layout", () => { var t = r(" buildLayoutGraph", () => qr(e)); r(" runLayout", () => Ir(t, r)), r(" updateInputGraph", () => Sr(e, t)); });}function Ir(e, n) { n(" makeSpaceForEdgeLabels", () => $r(e)), n(" removeSelfEdges", () => Kr(e)), n(" acyclic", () => kn(e)), n(" nestingGraph.run", () => Hn(e)), n(" rank", () => zn(be(e))), n(" injectEdgeLabelProxies", () => Wr(e)), n(" removeEmptyRanks", () => Nn(e)), n(" nestingGraph.cleanup", () => Zn(e)), n(" normalizeRanks", () => Ln(e)), n(" assignRankMinMax", () => zr(e)), n(" removeEdgeLabelProxies", () => Xr(e)), n(" normalize.run", () => Sn(e)), n(" parentDummyChains", () => pr(e)), n(" addBorderSegments", () => _n(e)), n(" order", () => hr(e)), n(" insertSelfEdges", () => et(e)), n(" adjustCoordinateSystem", () => Rn(e)), n(" position", () => Tr(e)), n(" positionSelfEdges", () => nt(e)), n(" removeBorderNodes", () => Zr(e)), n(" normalize.undo", () => jn(e)), n(" fixupEdgeLabelCoords", () => Jr(e)), n(" undoCoordinateSystem", () => Tn(e)), n(" translateGraph", () => Ur(e)), n(" assignNodeIntersects", () => Hr(e)), n(" reversePoints", () => Qr(e)), n(" acyclic.undo", () => En(e));}function Sr(e, n) { f(e.nodes(), function(r) { var t = e.node(r), a = n.node(r); t && (t.x = a.x, t.y = a.y, n.children(r).length && (t.width = a.width, t.height = a.height)); }), f(e.edges(), function(r) { var t = e.edge(r), a = n.edge(r); t.points = a.points, Object.prototype.hasOwnProperty.call(a, "x") && (t.x = a.x, t.y = a.y); }), e.graph().width = n.graph().width, e.graph().height = n.graph().height;}var Fr = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], jr = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" }, Vr = ["acyclicer", "ranker", "rankdir", "align"], Ar = ["width", "height"], Br = { width: 0, height: 0 }, Gr = ["minlen", "weight", "width", "height", "labeloffset"], Yr = { minlen: 1, weight: 1, width: 0, height: 0, labeloffset: 10, labelpos: "r"}, Dr = ["labelpos"];function qr(e) { var n = new g({ multigraph: !0, compound: !0 }), r = D(e.graph()); return n.setGraph( $({}, jr, Y(r, Fr), M(r, Vr)) ), f(e.nodes(), function(t) { var a = D(e.node(t)); n.setNode(t, Be(Y(a, Ar), Br)), n.setParent(t, e.parent(t)); }), f(e.edges(), function(t) { var a = D(e.edge(t)); n.setEdge( t, $({}, Yr, Y(a, Gr), M(a, Dr)) ); }), n;}function $r(e) { var n = e.graph(); n.ranksep /= 2, f(e.edges(), function(r) { var t = e.edge(r); t.minlen *= 2, t.labelpos.toLowerCase() !== "c" && (n.rankdir === "TB" || n.rankdir === "BT" ? t.width += t.labeloffset : t.height += t.labeloffset); });}function Wr(e) { f(e.edges(), function(n) { var r = e.edge(n); if (r.width && r.height) { var t = e.node(n.v), a = e.node(n.w), i = { rank: (a.rank - t.rank) / 2 + t.rank, e: n }; L(e, "edge-proxy", i, "_ep"); } });}function zr(e) { var n = 0; f(e.nodes(), function(r) { var t = e.node(r); t.borderTop && (t.minRank = e.node(t.borderTop).rank, t.maxRank = e.node(t.borderBottom).rank, n = y(n, t.maxRank)); }), e.graph().maxRank = n;}function Xr(e) { f(e.nodes(), function(n) { var r = e.node(n); r.dummy === "edge-proxy" && (e.edge(r.e).labelRank = r.rank, e.removeNode(n)); });}function Ur(e) { var n = Number.POSITIVE_INFINITY, r = 0, t = Number.POSITIVE_INFINITY, a = 0, i = e.graph(), o = i.marginx || 0, u = i.marginy || 0; function d(s) { var c = s.x, l = s.y, h = s.width, v = s.height; n = Math.min(n, c - h / 2), r = Math.max(r, c + h / 2), t = Math.min(t, l - v / 2), a = Math.max(a, l + v / 2); } f(e.nodes(), function(s) { d(e.node(s)); }), f(e.edges(), function(s) { var c = e.edge(s); Object.prototype.hasOwnProperty.call(c, "x") && d(c); }), n -= o, t -= u, f(e.nodes(), function(s) { var c = e.node(s); c.x -= n, c.y -= t; }), f(e.edges(), function(s) { var c = e.edge(s); f(c.points, function(l) { l.x -= n, l.y -= t; }), Object.prototype.hasOwnProperty.call(c, "x") && (c.x -= n), Object.prototype.hasOwnProperty.call(c, "y") && (c.y -= t); }), i.width = r - n + o, i.height = a - t + u;}function Hr(e) { f(e.edges(), function(n) { var r = e.edge(n), t = e.node(n.v), a = e.node(n.w), i, o; r.points ? (i = r.points[0], o = r.points[r.points.length - 1]) : (r.points = [], i = a, o = t), r.points.unshift(re(t, i)), r.points.push(re(a, o)); });}function Jr(e) { f(e.edges(), function(n) { var r = e.edge(n); if (Object.prototype.hasOwnProperty.call(r, "x")) switch ((r.labelpos === "l" || r.labelpos === "r") && (r.width -= r.labeloffset), r.labelpos) { case "l": r.x -= r.width / 2 + r.labeloffset; break; case "r": r.x += r.width / 2 + r.labeloffset; break; } });}function Qr(e) { f(e.edges(), function(n) { var r = e.edge(n); r.reversed && r.points.reverse(); });}function Zr(e) { f(e.nodes(), function(n) { if (e.children(n).length) { var r = e.node(n), t = e.node(r.borderTop), a = e.node(r.borderBottom), i = e.node(T(r.borderLeft)), o = e.node(T(r.borderRight)); r.width = Math.abs(o.x - i.x), r.height = Math.abs(a.y - t.y), r.x = i.x + r.width / 2, r.y = t.y + r.height / 2; } }), f(e.nodes(), function(n) { e.node(n).dummy === "border" && e.removeNode(n); });}function Kr(e) { f(e.edges(), function(n) { if (n.v === n.w) { var r = e.node(n.v); r.selfEdges || (r.selfEdges = []), r.selfEdges.push({ e: n, label: e.edge(n) }), e.removeEdge(n); } });}function et(e) { var n = F(e); f(n, function(r) { var t = 0; f(r, function(a, i) { var o = e.node(a); o.order = i + t, f(o.selfEdges, function(u) { L( e, "selfedge", { width: u.label.width, height: u.label.height, rank: o.rank, order: i + ++t, e: u.e, label: u.label }, "_se" ); }), delete o.selfEdges; }); });}function nt(e) { f(e.nodes(), function(n) { var r = e.node(n); if (r.dummy === "selfedge") { var t = e.node(r.e.v), a = t.x + t.width / 2, i = t.y, o = r.x - a, u = t.height / 2; e.setEdge(r.e, r.label), e.removeNode(n), r.label.points = [ { x: a + 2 * o / 3, y: i - u }, { x: a + 5 * o / 6, y: i - u }, { x: a + o, y: i }, { x: a + 5 * o / 6, y: i + u }, { x: a + 2 * o / 3, y: i + u } ], r.label.x = r.x, r.label.y = r.y; } });}function Y(e, n) { return S(M(e, n), Number);}function D(e) { var n = {}; return f(e, function(r, t) { n[t.toLowerCase()] = r; }), n;}export { ot as l};123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423import { a$ as un, b0 as I, b1 as U, b2 as fn, b3 as Y } from "./mermaid.core-BiIw1_mh.js";import { i as cn } from "./init-DjUOC4st.js";function F(n, t) { return n == null || t == null ? NaN : n < t ? -1 : n > t ? 1 : n >= t ? 0 : NaN;}function hn(n, t) { return n == null || t == null ? NaN : t < n ? -1 : t > n ? 1 : t >= n ? 0 : NaN;}function _(n) { let t, e, r; n.length !== 2 ? (t = F, e = (u, c) => F(n(u), c), r = (u, c) => n(u) - c) : (t = n === F || n === hn ? n : mn, e = n, r = n); function i(u, c, o = 0, s = u.length) { if (o < s) { if (t(c, c) !== 0) return s; do { const h = o + s >>> 1; e(u[h], c) < 0 ? o = h + 1 : s = h; } while (o < s); } return o; } function f(u, c, o = 0, s = u.length) { if (o < s) { if (t(c, c) !== 0) return s; do { const h = o + s >>> 1; e(u[h], c) <= 0 ? o = h + 1 : s = h; } while (o < s); } return o; } function a(u, c, o = 0, s = u.length) { const h = i(u, c, o, s - 1); return h > o && r(u[h - 1], c) > -r(u[h], c) ? h - 1 : h; } return { left: i, center: a, right: f };}function mn() { return 0;}function ln(n) { return n === null ? NaN : +n;}const sn = _(F), dn = sn.right;_(ln).center;const gn = Math.sqrt(50), yn = Math.sqrt(10), Mn = Math.sqrt(2);function R(n, t, e) { const r = (t - n) / Math.max(0, e), i = Math.floor(Math.log10(r)), f = r / Math.pow(10, i), a = f >= gn ? 10 : f >= yn ? 5 : f >= Mn ? 2 : 1; let u, c, o; return i < 0 ? (o = Math.pow(10, -i) / a, u = Math.round(n * o), c = Math.round(t * o), u / o < n && ++u, c / o > t && --c, o = -o) : (o = Math.pow(10, i) * a, u = Math.round(n / o), c = Math.round(t / o), u * o < n && ++u, c * o > t && --c), c < u && 0.5 <= e && e < 2 ? R(n, t, e * 2) : [u, c, o];}function pn(n, t, e) { if (t = +t, n = +n, e = +e, !(e > 0)) return []; if (n === t) return [n]; const r = t < n, [i, f, a] = r ? R(t, n, e) : R(n, t, e); if (!(f >= i)) return []; const u = f - i + 1, c = new Array(u); if (r) if (a < 0) for (let o = 0; o < u; ++o) c[o] = (f - o) / -a; else for (let o = 0; o < u; ++o) c[o] = (f - o) * a; else if (a < 0) for (let o = 0; o < u; ++o) c[o] = (i + o) / -a; else for (let o = 0; o < u; ++o) c[o] = (i + o) * a; return c;}function L(n, t, e) { return t = +t, n = +n, e = +e, R(n, t, e)[2];}function wn(n, t, e) { t = +t, n = +n, e = +e; const r = t < n, i = r ? L(t, n, e) : L(n, t, e); return (r ? -1 : 1) * (i < 0 ? 1 / -i : i);}function Nn(n, t) { t || (t = []); var e = n ? Math.min(t.length, n.length) : 0, r = t.slice(), i; return function(f) { for (i = 0; i < e; ++i) r[i] = n[i] * (1 - f) + t[i] * f; return r; };}function kn(n) { return ArrayBuffer.isView(n) && !(n instanceof DataView);}function xn(n, t) { var e = t ? t.length : 0, r = n ? Math.min(e, n.length) : 0, i = new Array(r), f = new Array(e), a; for (a = 0; a < r; ++a) i[a] = C(n[a], t[a]); for (; a < e; ++a) f[a] = t[a]; return function(u) { for (a = 0; a < r; ++a) f[a] = i[a](u); return f; };}function An(n, t) { var e = /* @__PURE__ */ new Date(); return n = +n, t = +t, function(r) { return e.setTime(n * (1 - r) + t * r), e; };}function vn(n, t) { var e = {}, r = {}, i; (n === null || typeof n != "object") && (n = {}), (t === null || typeof t != "object") && (t = {}); for (i in t) i in n ? e[i] = C(n[i], t[i]) : r[i] = t[i]; return function(f) { for (i in e) r[i] = e[i](f); return r; };}function C(n, t) { var e = typeof t, r; return t == null || e === "boolean" ? un(t) : (e === "number" ? I : e === "string" ? (r = Y(t)) ? (t = r, U) : fn : t instanceof Y ? U : t instanceof Date ? An : kn(t) ? Nn : Array.isArray(t) ? xn : typeof t.valueOf != "function" && typeof t.toString != "function" || isNaN(t) ? vn : I)(n, t);}function Sn(n, t) { return n = +n, t = +t, function(e) { return Math.round(n * (1 - e) + t * e); };}function bn(n) { return Math.abs(n = Math.round(n)) >= 1e21 ? n.toLocaleString("en").replace(/,/g, "") : n.toString(10);}function E(n, t) { if ((e = (n = t ? n.toExponential(t - 1) : n.toExponential()).indexOf("e")) < 0) return null; var e, r = n.slice(0, e); return [ r.length > 1 ? r[0] + r.slice(2) : r, +n.slice(e + 1) ];}function v(n) { return n = E(Math.abs(n)), n ? n[1] : NaN;}function jn(n, t) { return function(e, r) { for (var i = e.length, f = [], a = 0, u = n[0], c = 0; i > 0 && u > 0 && (c + u + 1 > r && (u = Math.max(1, r - c)), f.push(e.substring(i -= u, i + u)), !((c += u + 1) > r)); ) u = n[a = (a + 1) % n.length]; return f.reverse().join(t); };}function Pn(n) { return function(t) { return t.replace(/[0-9]/g, function(e) { return n[+e]; }); };}var zn = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function D(n) { if (!(t = zn.exec(n))) throw new Error("invalid format: " + n); var t; return new B({ fill: t[1], align: t[2], sign: t[3], symbol: t[4], zero: t[5], width: t[6], comma: t[7], precision: t[8] && t[8].slice(1), trim: t[9], type: t[10] });}D.prototype = B.prototype;function B(n) { this.fill = n.fill === void 0 ? " " : n.fill + "", this.align = n.align === void 0 ? ">" : n.align + "", this.sign = n.sign === void 0 ? "-" : n.sign + "", this.symbol = n.symbol === void 0 ? "" : n.symbol + "", this.zero = !!n.zero, this.width = n.width === void 0 ? void 0 : +n.width, this.comma = !!n.comma, this.precision = n.precision === void 0 ? void 0 : +n.precision, this.trim = !!n.trim, this.type = n.type === void 0 ? "" : n.type + "";}B.prototype.toString = function() { return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;};function $n(n) { n: for (var t = n.length, e = 1, r = -1, i; e < t; ++e) switch (n[e]) { case ".": r = i = e; break; case "0": r === 0 && (r = e), i = e; break; default: if (!+n[e]) break n; r > 0 && (r = 0); break; } return r > 0 ? n.slice(0, r) + n.slice(i + 1) : n;}var nn;function Fn(n, t) { var e = E(n, t); if (!e) return n + ""; var r = e[0], i = e[1], f = i - (nn = Math.max(-8, Math.min(8, Math.floor(i / 3))) * 3) + 1, a = r.length; return f === a ? r : f > a ? r + new Array(f - a + 1).join("0") : f > 0 ? r.slice(0, f) + "." + r.slice(f) : "0." + new Array(1 - f).join("0") + E(n, Math.max(0, t + f - 1))[0];}function Z(n, t) { var e = E(n, t); if (!e) return n + ""; var r = e[0], i = e[1]; return i < 0 ? "0." + new Array(-i).join("0") + r : r.length > i + 1 ? r.slice(0, i + 1) + "." + r.slice(i + 1) : r + new Array(i - r.length + 2).join("0");}const H = { "%": (n, t) => (n * 100).toFixed(t), b: (n) => Math.round(n).toString(2), c: (n) => n + "", d: bn, e: (n, t) => n.toExponential(t), f: (n, t) => n.toFixed(t), g: (n, t) => n.toPrecision(t), o: (n) => Math.round(n).toString(8), p: (n, t) => Z(n * 100, t), r: Z, s: Fn, X: (n) => Math.round(n).toString(16).toUpperCase(), x: (n) => Math.round(n).toString(16)};function J(n) { return n;}var K = Array.prototype.map, Q = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];function Rn(n) { var t = n.grouping === void 0 || n.thousands === void 0 ? J : jn(K.call(n.grouping, Number), n.thousands + ""), e = n.currency === void 0 ? "" : n.currency[0] + "", r = n.currency === void 0 ? "" : n.currency[1] + "", i = n.decimal === void 0 ? "." : n.decimal + "", f = n.numerals === void 0 ? J : Pn(K.call(n.numerals, String)), a = n.percent === void 0 ? "%" : n.percent + "", u = n.minus === void 0 ? "−" : n.minus + "", c = n.nan === void 0 ? "NaN" : n.nan + ""; function o(h) { h = D(h); var l = h.fill, p = h.align, y = h.sign, S = h.symbol, k = h.zero, b = h.width, T = h.comma, w = h.precision, G = h.trim, d = h.type; d === "n" ? (T = !0, d = "g") : H[d] || (w === void 0 && (w = 12), G = !0, d = "g"), (k || l === "0" && p === "=") && (k = !0, l = "0", p = "="); var en = S === "$" ? e : S === "#" && /[boxX]/.test(d) ? "0" + d.toLowerCase() : "", on = S === "$" ? r : /[%p]/.test(d) ? a : "", O = H[d], an = /[defgprs%]/.test(d); w = w === void 0 ? 6 : /[gprs]/.test(d) ? Math.max(1, Math.min(21, w)) : Math.max(0, Math.min(20, w)); function V(m) { var N = en, g = on, x, X, j; if (d === "c") g = O(m) + g, m = ""; else { m = +m; var P = m < 0 || 1 / m < 0; if (m = isNaN(m) ? c : O(Math.abs(m), w), G && (m = $n(m)), P && +m == 0 && y !== "+" && (P = !1), N = (P ? y === "(" ? y : u : y === "-" || y === "(" ? "" : y) + N, g = (d === "s" ? Q[8 + nn / 3] : "") + g + (P && y === "(" ? ")" : ""), an) { for (x = -1, X = m.length; ++x < X; ) if (j = m.charCodeAt(x), 48 > j || j > 57) { g = (j === 46 ? i + m.slice(x + 1) : m.slice(x)) + g, m = m.slice(0, x); break; } } } T && !k && (m = t(m, 1 / 0)); var z = N.length + m.length + g.length, M = z < b ? new Array(b - z + 1).join(l) : ""; switch (T && k && (m = t(M + m, M.length ? b - g.length : 1 / 0), M = ""), p) { case "<": m = N + m + g + M; break; case "=": m = N + M + m + g; break; case "^": m = M.slice(0, z = M.length >> 1) + N + m + g + M.slice(z); break; default: m = M + N + m + g; break; } return f(m); } return V.toString = function() { return h + ""; }, V; } function s(h, l) { var p = o((h = D(h), h.type = "f", h)), y = Math.max(-8, Math.min(8, Math.floor(v(l) / 3))) * 3, S = Math.pow(10, -y), k = Q[8 + y / 3]; return function(b) { return p(S * b) + k; }; } return { format: o, formatPrefix: s };}var $, tn, rn;En({ thousands: ",", grouping: [3], currency: ["$", ""]});function En(n) { return $ = Rn(n), tn = $.format, rn = $.formatPrefix, $;}function Dn(n) { return Math.max(0, -v(Math.abs(n)));}function Tn(n, t) { return Math.max(0, Math.max(-8, Math.min(8, Math.floor(v(t) / 3))) * 3 - v(Math.abs(n)));}function In(n, t) { return n = Math.abs(n), t = Math.abs(t) - n, Math.max(0, v(t) - v(n)) + 1;}function Ln(n) { return function() { return n; };}function qn(n) { return +n;}var W = [0, 1];function A(n) { return n;}function q(n, t) { return (t -= n = +n) ? function(e) { return (e - n) / t; } : Ln(isNaN(t) ? NaN : 0.5);}function Cn(n, t) { var e; return n > t && (e = n, n = t, t = e), function(r) { return Math.max(n, Math.min(t, r)); };}function Bn(n, t, e) { var r = n[0], i = n[1], f = t[0], a = t[1]; return i < r ? (r = q(i, r), f = e(a, f)) : (r = q(r, i), f = e(f, a)), function(u) { return f(r(u)); };}function Gn(n, t, e) { var r = Math.min(n.length, t.length) - 1, i = new Array(r), f = new Array(r), a = -1; for (n[r] < n[0] && (n = n.slice().reverse(), t = t.slice().reverse()); ++a < r; ) i[a] = q(n[a], n[a + 1]), f[a] = e(t[a], t[a + 1]); return function(u) { var c = dn(n, u, 1, r) - 1; return f[c](i[c](u)); };}function On(n, t) { return t.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown());}function Vn() { var n = W, t = W, e = C, r, i, f, a = A, u, c, o; function s() { var l = Math.min(n.length, t.length); return a !== A && (a = Cn(n[0], n[l - 1])), u = l > 2 ? Gn : Bn, c = o = null, h; } function h(l) { return l == null || isNaN(l = +l) ? f : (c || (c = u(n.map(r), t, e)))(r(a(l))); } return h.invert = function(l) { return a(i((o || (o = u(t, n.map(r), I)))(l))); }, h.domain = function(l) { return arguments.length ? (n = Array.from(l, qn), s()) : n.slice(); }, h.range = function(l) { return arguments.length ? (t = Array.from(l), s()) : t.slice(); }, h.rangeRound = function(l) { return t = Array.from(l), e = Sn, s(); }, h.clamp = function(l) { return arguments.length ? (a = l ? !0 : A, s()) : a !== A; }, h.interpolate = function(l) { return arguments.length ? (e = l, s()) : e; }, h.unknown = function(l) { return arguments.length ? (f = l, h) : f; }, function(l, p) { return r = l, i = p, s(); };}function Xn() { return Vn()(A, A);}function Un(n, t, e, r) { var i = wn(n, t, e), f; switch (r = D(r ?? ",f"), r.type) { case "s": { var a = Math.max(Math.abs(n), Math.abs(t)); return r.precision == null && !isNaN(f = Tn(i, a)) && (r.precision = f), rn(r, a); } case "": case "e": case "g": case "p": case "r": { r.precision == null && !isNaN(f = In(i, Math.max(Math.abs(n), Math.abs(t)))) && (r.precision = f - (r.type === "e")); break; } case "f": case "%": { r.precision == null && !isNaN(f = Dn(i)) && (r.precision = f - (r.type === "%") * 2); break; } } return tn(r);}function Yn(n) { var t = n.domain; return n.ticks = function(e) { var r = t(); return pn(r[0], r[r.length - 1], e ?? 10); }, n.tickFormat = function(e, r) { var i = t(); return Un(i[0], i[i.length - 1], e ?? 10, r); }, n.nice = function(e) { e == null && (e = 10); var r = t(), i = 0, f = r.length - 1, a = r[i], u = r[f], c, o, s = 10; for (u < a && (o = a, a = u, u = o, o = i, i = f, f = o); s-- > 0; ) { if (o = L(a, u, e), o === c) return r[i] = a, r[f] = u, t(r); if (o > 0) a = Math.floor(a / o) * o, u = Math.ceil(u / o) * o; else if (o < 0) a = Math.ceil(a * o) / o, u = Math.floor(u * o) / o; else break; c = o; } return n; }, n;}function Zn() { var n = Xn(); return n.copy = function() { return On(n, Zn()); }, cn.apply(n, arguments), Yn(n);}export { On as a, _ as b, Xn as c, Zn as l, wn as t};123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161import { p as V } from "./chunk-44GW5IO5-Ohm2b7Vh.js";import { a4 as S, a7 as z, aG as U, _ as u, g as j, s as q, a as H, b as Z, q as J, p as K, l as F, c as Q, D as X, H as Y, N as tt, e as et, y as at, F as rt } from "./mermaid.core-BiIw1_mh.js";import { p as nt } from "./radar-VG2SY3DT-DUR9h7DO.js";import { d as P } from "./arc-BVd80oSb.js";import { o as it } from "./ordinal-DfAQgscy.js";function st(t, a) { return a < t ? -1 : a > t ? 1 : a >= t ? 0 : NaN;}function ot(t) { return t;}function lt() { var t = ot, a = st, h = null, o = S(0), p = S(z), x = S(0); function i(e) { var r, l = (e = U(e)).length, g, A, m = 0, c = new Array(l), n = new Array(l), v = +o.apply(this, arguments), w = Math.min(z, Math.max(-z, p.apply(this, arguments) - v)), f, T = Math.min(Math.abs(w) / l, x.apply(this, arguments)), $ = T * (w < 0 ? -1 : 1), d; for (r = 0; r < l; ++r) (d = n[c[r] = r] = +t(e[r], r, e)) > 0 && (m += d); for (a != null ? c.sort(function(y, D) { return a(n[y], n[D]); }) : h != null && c.sort(function(y, D) { return h(e[y], e[D]); }), r = 0, A = m ? (w - l * $) / m : 0; r < l; ++r, v = f) g = c[r], d = n[g], f = v + (d > 0 ? d * A : 0) + $, n[g] = { data: e[g], index: r, value: d, startAngle: v, endAngle: f, padAngle: T }; return n; } return i.value = function(e) { return arguments.length ? (t = typeof e == "function" ? e : S(+e), i) : t; }, i.sortValues = function(e) { return arguments.length ? (a = e, h = null, i) : a; }, i.sort = function(e) { return arguments.length ? (h = e, a = null, i) : h; }, i.startAngle = function(e) { return arguments.length ? (o = typeof e == "function" ? e : S(+e), i) : o; }, i.endAngle = function(e) { return arguments.length ? (p = typeof e == "function" ? e : S(+e), i) : p; }, i.padAngle = function(e) { return arguments.length ? (x = typeof e == "function" ? e : S(+e), i) : x; }, i;}var ct = rt.pie, G = { sections: /* @__PURE__ */ new Map(), showData: !1}, b = G.sections, N = G.showData, ut = structuredClone(ct), pt = /* @__PURE__ */ u(() => structuredClone(ut), "getConfig"), gt = /* @__PURE__ */ u(() => { b = /* @__PURE__ */ new Map(), N = G.showData, at();}, "clear"), dt = /* @__PURE__ */ u(({ label: t, value: a }) => { b.has(t) || (b.set(t, a), F.debug(`added new section: ${t}, with value: ${a}`));}, "addSection"), ft = /* @__PURE__ */ u(() => b, "getSections"), ht = /* @__PURE__ */ u((t) => { N = t;}, "setShowData"), mt = /* @__PURE__ */ u(() => N, "getShowData"), R = { getConfig: pt, clear: gt, setDiagramTitle: K, getDiagramTitle: J, setAccTitle: Z, getAccTitle: H, setAccDescription: q, getAccDescription: j, addSection: dt, getSections: ft, setShowData: ht, getShowData: mt}, vt = /* @__PURE__ */ u((t, a) => { V(t, a), a.setShowData(t.showData), t.sections.map(a.addSection);}, "populateDb"), yt = { parse: /* @__PURE__ */ u(async (t) => { const a = await nt("pie", t); F.debug(a), vt(a, R); }, "parse")}, St = /* @__PURE__ */ u((t) => ` .pieCircle{ stroke: ${t.pieStrokeColor}; stroke-width : ${t.pieStrokeWidth}; opacity : ${t.pieOpacity}; } .pieOuterCircle{ stroke: ${t.pieOuterStrokeColor}; stroke-width: ${t.pieOuterStrokeWidth}; fill: none; } .pieTitleText { text-anchor: middle; font-size: ${t.pieTitleTextSize}; fill: ${t.pieTitleTextColor}; font-family: ${t.fontFamily}; } .slice { font-family: ${t.fontFamily}; fill: ${t.pieSectionTextColor}; font-size:${t.pieSectionTextSize}; // fill: white; } .legend text { fill: ${t.pieLegendTextColor}; font-family: ${t.fontFamily}; font-size: ${t.pieLegendTextSize}; }`, "getStyles"), xt = St, At = /* @__PURE__ */ u((t) => { const a = [...t.entries()].map((o) => ({ label: o[0], value: o[1] })).sort((o, p) => p.value - o.value); return lt().value( (o) => o.value )(a);}, "createPieArcs"), wt = /* @__PURE__ */ u((t, a, h, o) => { F.debug(`rendering pie chart` + t); const p = o.db, x = Q(), i = X(p.getConfig(), x.pie), e = 40, r = 18, l = 4, g = 450, A = g, m = Y(a), c = m.append("g"); c.attr("transform", "translate(" + A / 2 + "," + g / 2 + ")"); const { themeVariables: n } = x; let [v] = tt(n.pieOuterStrokeWidth); v ?? (v = 2); const w = i.textPosition, f = Math.min(A, g) / 2 - e, T = P().innerRadius(0).outerRadius(f), $ = P().innerRadius(f * w).outerRadius(f * w); c.append("circle").attr("cx", 0).attr("cy", 0).attr("r", f + v / 2).attr("class", "pieOuterCircle"); const d = p.getSections(), y = At(d), D = [ n.pie1, n.pie2, n.pie3, n.pie4, n.pie5, n.pie6, n.pie7, n.pie8, n.pie9, n.pie10, n.pie11, n.pie12 ], C = it(D); c.selectAll("mySlices").data(y).enter().append("path").attr("d", T).attr("fill", (s) => C(s.data.label)).attr("class", "pieCircle"); let W = 0; d.forEach((s) => { W += s; }), c.selectAll("mySlices").data(y).enter().append("text").text((s) => (s.data.value / W * 100).toFixed(0) + "%").attr("transform", (s) => "translate(" + $.centroid(s) + ")").style("text-anchor", "middle").attr("class", "slice"), c.append("text").text(p.getDiagramTitle()).attr("x", 0).attr("y", -400 / 2).attr("class", "pieTitleText"); const M = c.selectAll(".legend").data(C.domain()).enter().append("g").attr("class", "legend").attr("transform", (s, k) => { const E = r + l, L = E * C.domain().length / 2, _ = 12 * r, B = k * E - L; return "translate(" + _ + "," + B + ")"; }); M.append("rect").attr("width", r).attr("height", r).style("fill", C).style("stroke", C), M.data(y).append("text").attr("x", r + l).attr("y", r - l).text((s) => { const { label: k, value: E } = s.data; return p.getShowData() ? `${k} [${E}]` : k; }); const I = Math.max( ...M.selectAll("text").nodes().map((s) => (s == null ? void 0 : s.getBoundingClientRect().width) ?? 0) ), O = A + e + r + l + I; m.attr("viewBox", `0 0 ${O} ${g}`), et(m, g, O, i.useMaxWidth);}, "draw"), Dt = { draw: wt }, bt = { parser: yt, db: R, renderer: Dt, styles: xt};export { bt as diagram};1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024import { _ as o, s as _e, g as Ae, q as ie, p as ke, a as Fe, b as Pe, c as wt, l as At, d as zt, e as ve, y as Ce, F as D, K as Le, i as Ee } from "./mermaid.core-BiIw1_mh.js";import { l as ee } from "./linear-Cg721pVl.js";var Vt = function() { var t = /* @__PURE__ */ o(function(j, r, l, g) { for (l = l || {}, g = j.length; g--; l[j[g]] = r) ; return l; }, "o"), n = [1, 3], u = [1, 4], c = [1, 5], h = [1, 6], p = [1, 7], y = [1, 4, 5, 10, 12, 13, 14, 18, 25, 35, 37, 39, 41, 42, 48, 50, 51, 52, 53, 54, 55, 56, 57, 60, 61, 63, 64, 65, 66, 67], S = [1, 4, 5, 10, 12, 13, 14, 18, 25, 28, 35, 37, 39, 41, 42, 48, 50, 51, 52, 53, 54, 55, 56, 57, 60, 61, 63, 64, 65, 66, 67], a = [55, 56, 57], A = [2, 36], d = [1, 37], T = [1, 36], q = [1, 38], m = [1, 35], b = [1, 43], x = [1, 41], O = [1, 14], Y = [1, 23], G = [1, 18], yt = [1, 19], Tt = [1, 20], dt = [1, 21], Ft = [1, 22], ut = [1, 24], xt = [1, 25], ft = [1, 26], gt = [1, 27], i = [1, 28], Bt = [1, 29], W = [1, 32], U = [1, 33], k = [1, 34], F = [1, 39], P = [1, 40], v = [1, 42], C = [1, 44], H = [1, 62], X = [1, 61], L = [4, 5, 8, 10, 12, 13, 14, 18, 44, 47, 49, 55, 56, 57, 63, 64, 65, 66, 67], Rt = [1, 65], Nt = [1, 66], Wt = [1, 67], Ut = [1, 68], Qt = [1, 69], Ot = [1, 70], Ht = [1, 71], Xt = [1, 72], Mt = [1, 73], Yt = [1, 74], jt = [1, 75], Gt = [1, 76], I = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18], J = [1, 90], $ = [1, 91], tt = [1, 92], et = [1, 99], it = [1, 93], at = [1, 96], nt = [1, 94], st = [1, 95], rt = [1, 97], ot = [1, 98], Pt = [1, 102], Kt = [10, 55, 56, 57], R = [4, 5, 6, 8, 10, 11, 13, 17, 18, 19, 20, 55, 56, 57], vt = { trace: /* @__PURE__ */ o(function() { }, "trace"), yy: {}, symbols_: { error: 2, idStringToken: 3, ALPHA: 4, NUM: 5, NODE_STRING: 6, DOWN: 7, MINUS: 8, DEFAULT: 9, COMMA: 10, COLON: 11, AMP: 12, BRKT: 13, MULT: 14, UNICODE_TEXT: 15, styleComponent: 16, UNIT: 17, SPACE: 18, STYLE: 19, PCT: 20, idString: 21, style: 22, stylesOpt: 23, classDefStatement: 24, CLASSDEF: 25, start: 26, eol: 27, QUADRANT: 28, document: 29, line: 30, statement: 31, axisDetails: 32, quadrantDetails: 33, points: 34, title: 35, title_value: 36, acc_title: 37, acc_title_value: 38, acc_descr: 39, acc_descr_value: 40, acc_descr_multiline_value: 41, section: 42, text: 43, point_start: 44, point_x: 45, point_y: 46, class_name: 47, "X-AXIS": 48, "AXIS-TEXT-DELIMITER": 49, "Y-AXIS": 50, QUADRANT_1: 51, QUADRANT_2: 52, QUADRANT_3: 53, QUADRANT_4: 54, NEWLINE: 55, SEMI: 56, EOF: 57, alphaNumToken: 58, textNoTagsToken: 59, STR: 60, MD_STR: 61, alphaNum: 62, PUNCTUATION: 63, PLUS: 64, EQUALS: 65, DOT: 66, UNDERSCORE: 67, $accept: 0, $end: 1 }, terminals_: { 2: "error", 4: "ALPHA", 5: "NUM", 6: "NODE_STRING", 7: "DOWN", 8: "MINUS", 9: "DEFAULT", 10: "COMMA", 11: "COLON", 12: "AMP", 13: "BRKT", 14: "MULT", 15: "UNICODE_TEXT", 17: "UNIT", 18: "SPACE", 19: "STYLE", 20: "PCT", 25: "CLASSDEF", 28: "QUADRANT", 35: "title", 36: "title_value", 37: "acc_title", 38: "acc_title_value", 39: "acc_descr", 40: "acc_descr_value", 41: "acc_descr_multiline_value", 42: "section", 44: "point_start", 45: "point_x", 46: "point_y", 47: "class_name", 48: "X-AXIS", 49: "AXIS-TEXT-DELIMITER", 50: "Y-AXIS", 51: "QUADRANT_1", 52: "QUADRANT_2", 53: "QUADRANT_3", 54: "QUADRANT_4", 55: "NEWLINE", 56: "SEMI", 57: "EOF", 60: "STR", 61: "MD_STR", 63: "PUNCTUATION", 64: "PLUS", 65: "EQUALS", 66: "DOT", 67: "UNDERSCORE" }, productions_: [0, [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [21, 1], [21, 2], [22, 1], [22, 2], [23, 1], [23, 3], [24, 5], [26, 2], [26, 2], [26, 2], [29, 0], [29, 2], [30, 2], [31, 0], [31, 1], [31, 2], [31, 1], [31, 1], [31, 1], [31, 2], [31, 2], [31, 2], [31, 1], [31, 1], [34, 4], [34, 5], [34, 5], [34, 6], [32, 4], [32, 3], [32, 2], [32, 4], [32, 3], [32, 2], [33, 2], [33, 2], [33, 2], [33, 2], [27, 1], [27, 1], [27, 1], [43, 1], [43, 2], [43, 1], [43, 1], [62, 1], [62, 2], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [59, 1], [59, 1], [59, 1]], performAction: /* @__PURE__ */ o(function(r, l, g, f, _, e, pt) { var s = e.length - 1; switch (_) { case 23: this.$ = e[s]; break; case 24: this.$ = e[s - 1] + "" + e[s]; break; case 26: this.$ = e[s - 1] + e[s]; break; case 27: this.$ = [e[s].trim()]; break; case 28: e[s - 2].push(e[s].trim()), this.$ = e[s - 2]; break; case 29: this.$ = e[s - 4], f.addClass(e[s - 2], e[s]); break; case 37: this.$ = []; break; case 42: this.$ = e[s].trim(), f.setDiagramTitle(this.$); break; case 43: this.$ = e[s].trim(), f.setAccTitle(this.$); break; case 44: case 45: this.$ = e[s].trim(), f.setAccDescription(this.$); break; case 46: f.addSection(e[s].substr(8)), this.$ = e[s].substr(8); break; case 47: f.addPoint(e[s - 3], "", e[s - 1], e[s], []); break; case 48: f.addPoint(e[s - 4], e[s - 3], e[s - 1], e[s], []); break; case 49: f.addPoint(e[s - 4], "", e[s - 2], e[s - 1], e[s]); break; case 50: f.addPoint(e[s - 5], e[s - 4], e[s - 2], e[s - 1], e[s]); break; case 51: f.setXAxisLeftText(e[s - 2]), f.setXAxisRightText(e[s]); break; case 52: e[s - 1].text += " ⟶ ", f.setXAxisLeftText(e[s - 1]); break; case 53: f.setXAxisLeftText(e[s]); break; case 54: f.setYAxisBottomText(e[s - 2]), f.setYAxisTopText(e[s]); break; case 55: e[s - 1].text += " ⟶ ", f.setYAxisBottomText(e[s - 1]); break; case 56: f.setYAxisBottomText(e[s]); break; case 57: f.setQuadrant1Text(e[s]); break; case 58: f.setQuadrant2Text(e[s]); break; case 59: f.setQuadrant3Text(e[s]); break; case 60: f.setQuadrant4Text(e[s]); break; case 64: this.$ = { text: e[s], type: "text" }; break; case 65: this.$ = { text: e[s - 1].text + "" + e[s], type: e[s - 1].type }; break; case 66: this.$ = { text: e[s], type: "text" }; break; case 67: this.$ = { text: e[s], type: "markdown" }; break; case 68: this.$ = e[s]; break; case 69: this.$ = e[s - 1] + "" + e[s]; break; } }, "anonymous"), table: [{ 18: n, 26: 1, 27: 2, 28: u, 55: c, 56: h, 57: p }, { 1: [3] }, { 18: n, 26: 8, 27: 2, 28: u, 55: c, 56: h, 57: p }, { 18: n, 26: 9, 27: 2, 28: u, 55: c, 56: h, 57: p }, t(y, [2, 33], { 29: 10 }), t(S, [2, 61]), t(S, [2, 62]), t(S, [2, 63]), { 1: [2, 30] }, { 1: [2, 31] }, t(a, A, { 30: 11, 31: 12, 24: 13, 32: 15, 33: 16, 34: 17, 43: 30, 58: 31, 1: [2, 32], 4: d, 5: T, 10: q, 12: m, 13: b, 14: x, 18: O, 25: Y, 35: G, 37: yt, 39: Tt, 41: dt, 42: Ft, 48: ut, 50: xt, 51: ft, 52: gt, 53: i, 54: Bt, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }), t(y, [2, 34]), { 27: 45, 55: c, 56: h, 57: p }, t(a, [2, 37]), t(a, A, { 24: 13, 32: 15, 33: 16, 34: 17, 43: 30, 58: 31, 31: 46, 4: d, 5: T, 10: q, 12: m, 13: b, 14: x, 18: O, 25: Y, 35: G, 37: yt, 39: Tt, 41: dt, 42: Ft, 48: ut, 50: xt, 51: ft, 52: gt, 53: i, 54: Bt, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 39]), t(a, [2, 40]), t(a, [2, 41]), { 36: [1, 47] }, { 38: [1, 48] }, { 40: [1, 49] }, t(a, [2, 45]), t(a, [2, 46]), { 18: [1, 50] }, { 4: d, 5: T, 10: q, 12: m, 13: b, 14: x, 43: 51, 58: 31, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }, { 4: d, 5: T, 10: q, 12: m, 13: b, 14: x, 43: 52, 58: 31, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }, { 4: d, 5: T, 10: q, 12: m, 13: b, 14: x, 43: 53, 58: 31, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }, { 4: d, 5: T, 10: q, 12: m, 13: b, 14: x, 43: 54, 58: 31, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }, { 4: d, 5: T, 10: q, 12: m, 13: b, 14: x, 43: 55, 58: 31, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }, { 4: d, 5: T, 10: q, 12: m, 13: b, 14: x, 43: 56, 58: 31, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }, { 4: d, 5: T, 8: H, 10: q, 12: m, 13: b, 14: x, 18: X, 44: [1, 57], 47: [1, 58], 58: 60, 59: 59, 63: k, 64: F, 65: P, 66: v, 67: C }, t(L, [2, 64]), t(L, [2, 66]), t(L, [2, 67]), t(L, [2, 70]), t(L, [2, 71]), t(L, [2, 72]), t(L, [2, 73]), t(L, [2, 74]), t(L, [2, 75]), t(L, [2, 76]), t(L, [2, 77]), t(L, [2, 78]), t(L, [2, 79]), t(L, [2, 80]), t(y, [2, 35]), t(a, [2, 38]), t(a, [2, 42]), t(a, [2, 43]), t(a, [2, 44]), { 3: 64, 4: Rt, 5: Nt, 6: Wt, 7: Ut, 8: Qt, 9: Ot, 10: Ht, 11: Xt, 12: Mt, 13: Yt, 14: jt, 15: Gt, 21: 63 }, t(a, [2, 53], { 59: 59, 58: 60, 4: d, 5: T, 8: H, 10: q, 12: m, 13: b, 14: x, 18: X, 49: [1, 77], 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 56], { 59: 59, 58: 60, 4: d, 5: T, 8: H, 10: q, 12: m, 13: b, 14: x, 18: X, 49: [1, 78], 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 57], { 59: 59, 58: 60, 4: d, 5: T, 8: H, 10: q, 12: m, 13: b, 14: x, 18: X, 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 58], { 59: 59, 58: 60, 4: d, 5: T, 8: H, 10: q, 12: m, 13: b, 14: x, 18: X, 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 59], { 59: 59, 58: 60, 4: d, 5: T, 8: H, 10: q, 12: m, 13: b, 14: x, 18: X, 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 60], { 59: 59, 58: 60, 4: d, 5: T, 8: H, 10: q, 12: m, 13: b, 14: x, 18: X, 63: k, 64: F, 65: P, 66: v, 67: C }), { 45: [1, 79] }, { 44: [1, 80] }, t(L, [2, 65]), t(L, [2, 81]), t(L, [2, 82]), t(L, [2, 83]), { 3: 82, 4: Rt, 5: Nt, 6: Wt, 7: Ut, 8: Qt, 9: Ot, 10: Ht, 11: Xt, 12: Mt, 13: Yt, 14: jt, 15: Gt, 18: [1, 81] }, t(I, [2, 23]), t(I, [2, 1]), t(I, [2, 2]), t(I, [2, 3]), t(I, [2, 4]), t(I, [2, 5]), t(I, [2, 6]), t(I, [2, 7]), t(I, [2, 8]), t(I, [2, 9]), t(I, [2, 10]), t(I, [2, 11]), t(I, [2, 12]), t(a, [2, 52], { 58: 31, 43: 83, 4: d, 5: T, 10: q, 12: m, 13: b, 14: x, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 55], { 58: 31, 43: 84, 4: d, 5: T, 10: q, 12: m, 13: b, 14: x, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }), { 46: [1, 85] }, { 45: [1, 86] }, { 4: J, 5: $, 6: tt, 8: et, 11: it, 13: at, 16: 89, 17: nt, 18: st, 19: rt, 20: ot, 22: 88, 23: 87 }, t(I, [2, 24]), t(a, [2, 51], { 59: 59, 58: 60, 4: d, 5: T, 8: H, 10: q, 12: m, 13: b, 14: x, 18: X, 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 54], { 59: 59, 58: 60, 4: d, 5: T, 8: H, 10: q, 12: m, 13: b, 14: x, 18: X, 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 47], { 22: 88, 16: 89, 23: 100, 4: J, 5: $, 6: tt, 8: et, 11: it, 13: at, 17: nt, 18: st, 19: rt, 20: ot }), { 46: [1, 101] }, t(a, [2, 29], { 10: Pt }), t(Kt, [2, 27], { 16: 103, 4: J, 5: $, 6: tt, 8: et, 11: it, 13: at, 17: nt, 18: st, 19: rt, 20: ot }), t(R, [2, 25]), t(R, [2, 13]), t(R, [2, 14]), t(R, [2, 15]), t(R, [2, 16]), t(R, [2, 17]), t(R, [2, 18]), t(R, [2, 19]), t(R, [2, 20]), t(R, [2, 21]), t(R, [2, 22]), t(a, [2, 49], { 10: Pt }), t(a, [2, 48], { 22: 88, 16: 89, 23: 104, 4: J, 5: $, 6: tt, 8: et, 11: it, 13: at, 17: nt, 18: st, 19: rt, 20: ot }), { 4: J, 5: $, 6: tt, 8: et, 11: it, 13: at, 16: 89, 17: nt, 18: st, 19: rt, 20: ot, 22: 105 }, t(R, [2, 26]), t(a, [2, 50], { 10: Pt }), t(Kt, [2, 28], { 16: 103, 4: J, 5: $, 6: tt, 8: et, 11: it, 13: at, 17: nt, 18: st, 19: rt, 20: ot })], defaultActions: { 8: [2, 30], 9: [2, 31] }, parseError: /* @__PURE__ */ o(function(r, l) { if (l.recoverable) this.trace(r); else { var g = new Error(r); throw g.hash = l, g; } }, "parseError"), parse: /* @__PURE__ */ o(function(r) { var l = this, g = [0], f = [], _ = [null], e = [], pt = this.table, s = "", mt = 0, Zt = 0, qe = 2, Jt = 1, me = e.slice.call(arguments, 1), E = Object.create(this.lexer), K = { yy: {} }; for (var Ct in this.yy) Object.prototype.hasOwnProperty.call(this.yy, Ct) && (K.yy[Ct] = this.yy[Ct]); E.setInput(r, K.yy), K.yy.lexer = E, K.yy.parser = this, typeof E.yylloc > "u" && (E.yylloc = {}); var Lt = E.yylloc; e.push(Lt); var be = E.options && E.options.ranges; typeof K.yy.parseError == "function" ? this.parseError = K.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError; function Se(B) { g.length = g.length - 2 * B, _.length = _.length - B, e.length = e.length - B; } o(Se, "popStack"); function $t() { var B; return B = f.pop() || E.lex() || Jt, typeof B != "number" && (B instanceof Array && (f = B, B = f.pop()), B = l.symbols_[B] || B), B; } o($t, "lex"); for (var w, Z, N, Et, lt = {}, bt, M, te, St; ; ) { if (Z = g[g.length - 1], this.defaultActions[Z] ? N = this.defaultActions[Z] : ((w === null || typeof w > "u") && (w = $t()), N = pt[Z] && pt[Z][w]), typeof N > "u" || !N.length || !N[0]) { var Dt = ""; St = []; for (bt in pt[Z]) this.terminals_[bt] && bt > qe && St.push("'" + this.terminals_[bt] + "'"); E.showPosition ? Dt = "Parse error on line " + (mt + 1) + `:` + E.showPosition() + `Expecting ` + St.join(", ") + ", got '" + (this.terminals_[w] || w) + "'" : Dt = "Parse error on line " + (mt + 1) + ": Unexpected " + (w == Jt ? "end of input" : "'" + (this.terminals_[w] || w) + "'"), this.parseError(Dt, { text: E.match, token: this.terminals_[w] || w, line: E.yylineno, loc: Lt, expected: St }); } if (N[0] instanceof Array && N.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + Z + ", token: " + w); switch (N[0]) { case 1: g.push(w), _.push(E.yytext), e.push(E.yylloc), g.push(N[1]), w = null, Zt = E.yyleng, s = E.yytext, mt = E.yylineno, Lt = E.yylloc; break; case 2: if (M = this.productions_[N[1]][1], lt.$ = _[_.length - M], lt._$ = { first_line: e[e.length - (M || 1)].first_line, last_line: e[e.length - 1].last_line, first_column: e[e.length - (M || 1)].first_column, last_column: e[e.length - 1].last_column }, be && (lt._$.range = [ e[e.length - (M || 1)].range[0], e[e.length - 1].range[1] ]), Et = this.performAction.apply(lt, [ s, Zt, mt, K.yy, N[1], _, e ].concat(me)), typeof Et < "u") return Et; M && (g = g.slice(0, -1 * M * 2), _ = _.slice(0, -1 * M), e = e.slice(0, -1 * M)), g.push(this.productions_[N[1]][0]), _.push(lt.$), e.push(lt._$), te = pt[g[g.length - 2]][g[g.length - 1]], g.push(te); break; case 3: return !0; } } return !0; }, "parse") }, Te = /* @__PURE__ */ function() { var j = { EOF: 1, parseError: /* @__PURE__ */ o(function(l, g) { if (this.yy.parser) this.yy.parser.parseError(l, g); else throw new Error(l); }, "parseError"), // resets the lexer, sets new input setInput: /* @__PURE__ */ o(function(r, l) { return this.yy = l || this.yy || {}, this._input = r, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this; }, "setInput"), // consumes and returns one char from the input input: /* @__PURE__ */ o(function() { var r = this._input[0]; this.yytext += r, this.yyleng++, this.offset++, this.match += r, this.matched += r; var l = r.match(/(?:\r\n?|\n).*/g); return l ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), r; }, "input"), // unshifts one char (or a string) into the input unput: /* @__PURE__ */ o(function(r) { var l = r.length, g = r.split(/(?:\r\n?|\n)/g); this._input = r + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - l), this.offset -= l; var f = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), g.length - 1 && (this.yylineno -= g.length - 1); var _ = this.yylloc.range; return this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: g ? (g.length === f.length ? this.yylloc.first_column : 0) + f[f.length - g.length].length - g[0].length : this.yylloc.first_column - l }, this.options.ranges && (this.yylloc.range = [_[0], _[0] + this.yyleng - l]), this.yyleng = this.yytext.length, this; }, "unput"), // When called from action, caches matched text and appends it on next action more: /* @__PURE__ */ o(function() { return this._more = !0, this; }, "more"), // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject: /* @__PURE__ */ o(function() { if (this.options.backtrack_lexer) this._backtrack = !0; else return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).` + this.showPosition(), { text: "", token: null, line: this.yylineno }); return this; }, "reject"), // retain first n characters of the match less: /* @__PURE__ */ o(function(r) { this.unput(this.match.slice(r)); }, "less"), // displays already matched input, i.e. for error messages pastInput: /* @__PURE__ */ o(function() { var r = this.matched.substr(0, this.matched.length - this.match.length); return (r.length > 20 ? "..." : "") + r.substr(-20).replace(/\n/g, ""); }, "pastInput"), // displays upcoming input, i.e. for error messages upcomingInput: /* @__PURE__ */ o(function() { var r = this.match; return r.length < 20 && (r += this._input.substr(0, 20 - r.length)), (r.substr(0, 20) + (r.length > 20 ? "..." : "")).replace(/\n/g, ""); }, "upcomingInput"), // displays the character position where the lexing error occurred, i.e. for error messages showPosition: /* @__PURE__ */ o(function() { var r = this.pastInput(), l = new Array(r.length + 1).join("-"); return r + this.upcomingInput() + `` + l + "^"; }, "showPosition"), // test the lexed token: return FALSE when not a match, otherwise return token test_match: /* @__PURE__ */ o(function(r, l) { var g, f, _; if (this.options.backtrack_lexer && (_ = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }, this.options.ranges && (_.yylloc.range = this.yylloc.range.slice(0))), f = r[0].match(/(?:\r\n?|\n).*/g), f && (this.yylineno += f.length), this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: f ? f[f.length - 1].length - f[f.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + r[0].length }, this.yytext += r[0], this.match += r[0], this.matches = r, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(r[0].length), this.matched += r[0], g = this.performAction.call(this, this.yy, this, l, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), g) return g; if (this._backtrack) { for (var e in _) this[e] = _[e]; return !1; } return !1; }, "test_match"), // return next match in input next: /* @__PURE__ */ o(function() { if (this.done) return this.EOF; this._input || (this.done = !0); var r, l, g, f; this._more || (this.yytext = "", this.match = ""); for (var _ = this._currentRules(), e = 0; e < _.length; e++) if (g = this._input.match(this.rules[_[e]]), g && (!l || g[0].length > l[0].length)) { if (l = g, f = e, this.options.backtrack_lexer) { if (r = this.test_match(g, _[e]), r !== !1) return r; if (this._backtrack) { l = !1; continue; } else return !1; } else if (!this.options.flex) break; } return l ? (r = this.test_match(l, _[f]), r !== !1 ? r : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.` + this.showPosition(), { text: "", token: null, line: this.yylineno }); }, "next"), // return next match that has a token lex: /* @__PURE__ */ o(function() { var l = this.next(); return l || this.lex(); }, "lex"), // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin: /* @__PURE__ */ o(function(l) { this.conditionStack.push(l); }, "begin"), // pop the previously active lexer condition state off the condition stack popState: /* @__PURE__ */ o(function() { var l = this.conditionStack.length - 1; return l > 0 ? this.conditionStack.pop() : this.conditionStack[0]; }, "popState"), // produce the lexer rule set which is active for the currently active lexer condition state _currentRules: /* @__PURE__ */ o(function() { return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules; }, "_currentRules"), // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState: /* @__PURE__ */ o(function(l) { return l = this.conditionStack.length - 1 - Math.abs(l || 0), l >= 0 ? this.conditionStack[l] : "INITIAL"; }, "topState"), // alias for begin(condition) pushState: /* @__PURE__ */ o(function(l) { this.begin(l); }, "pushState"), // return the number of states currently on the stack stateStackSize: /* @__PURE__ */ o(function() { return this.conditionStack.length; }, "stateStackSize"), options: { "case-insensitive": !0 }, performAction: /* @__PURE__ */ o(function(l, g, f, _) { switch (f) { case 0: break; case 1: break; case 2: return 55; case 3: break; case 4: return this.begin("title"), 35; case 5: return this.popState(), "title_value"; case 6: return this.begin("acc_title"), 37; case 7: return this.popState(), "acc_title_value"; case 8: return this.begin("acc_descr"), 39; case 9: return this.popState(), "acc_descr_value"; case 10: this.begin("acc_descr_multiline"); break; case 11: this.popState(); break; case 12: return "acc_descr_multiline_value"; case 13: return 48; case 14: return 50; case 15: return 49; case 16: return 51; case 17: return 52; case 18: return 53; case 19: return 54; case 20: return 25; case 21: this.begin("md_string"); break; case 22: return "MD_STR"; case 23: this.popState(); break; case 24: this.begin("string"); break; case 25: this.popState(); break; case 26: return "STR"; case 27: this.begin("class_name"); break; case 28: return this.popState(), 47; case 29: return this.begin("point_start"), 44; case 30: return this.begin("point_x"), 45; case 31: this.popState(); break; case 32: this.popState(), this.begin("point_y"); break; case 33: return this.popState(), 46; case 34: return 28; case 35: return 4; case 36: return 11; case 37: return 64; case 38: return 10; case 39: return 65; case 40: return 65; case 41: return 14; case 42: return 13; case 43: return 67; case 44: return 66; case 45: return 12; case 46: return 8; case 47: return 5; case 48: return 18; case 49: return 56; case 50: return 63; case 51: return 57; } }, "anonymous"), rules: [/^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:title\b)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?: *x-axis *)/i, /^(?: *y-axis *)/i, /^(?: *--+> *)/i, /^(?: *quadrant-1 *)/i, /^(?: *quadrant-2 *)/i, /^(?: *quadrant-3 *)/i, /^(?: *quadrant-4 *)/i, /^(?:classDef\b)/i, /^(?:["][`])/i, /^(?:[^`"]+)/i, /^(?:[`]["])/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?::::)/i, /^(?:^\w+)/i, /^(?:\s*:\s*\[\s*)/i, /^(?:(1)|(0(.\d+)?))/i, /^(?:\s*\] *)/i, /^(?:\s*,\s*)/i, /^(?:(1)|(0(.\d+)?))/i, /^(?: *quadrantChart *)/i, /^(?:[A-Za-z]+)/i, /^(?::)/i, /^(?:\+)/i, /^(?:,)/i, /^(?:=)/i, /^(?:=)/i, /^(?:\*)/i, /^(?:#)/i, /^(?:[\_])/i, /^(?:\.)/i, /^(?:&)/i, /^(?:-)/i, /^(?:[0-9]+)/i, /^(?:\s)/i, /^(?:;)/i, /^(?:[!"#$%&'*+,-.`?\\_/])/i, /^(?:$)/i], conditions: { class_name: { rules: [28], inclusive: !1 }, point_y: { rules: [33], inclusive: !1 }, point_x: { rules: [32], inclusive: !1 }, point_start: { rules: [30, 31], inclusive: !1 }, acc_descr_multiline: { rules: [11, 12], inclusive: !1 }, acc_descr: { rules: [9], inclusive: !1 }, acc_title: { rules: [7], inclusive: !1 }, title: { rules: [5], inclusive: !1 }, md_string: { rules: [22, 23], inclusive: !1 }, string: { rules: [25, 26], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 24, 27, 29, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51], inclusive: !0 } } }; return j; }(); vt.lexer = Te; function qt() { this.yy = {}; } return o(qt, "Parser"), qt.prototype = vt, vt.Parser = qt, new qt();}();Vt.parser = Vt;var De = Vt, V = Le(), ht, ze = (ht = class { constructor() { this.classes = /* @__PURE__ */ new Map(), this.config = this.getDefaultConfig(), this.themeConfig = this.getDefaultThemeConfig(), this.data = this.getDefaultData(); } getDefaultData() { return { titleText: "", quadrant1Text: "", quadrant2Text: "", quadrant3Text: "", quadrant4Text: "", xAxisLeftText: "", xAxisRightText: "", yAxisBottomText: "", yAxisTopText: "", points: [] }; } getDefaultConfig() { var n, u, c, h, p, y, S, a, A, d, T, q, m, b, x, O, Y, G; return { showXAxis: !0, showYAxis: !0, showTitle: !0, chartHeight: ((n = D.quadrantChart) == null ? void 0 : n.chartWidth) || 500, chartWidth: ((u = D.quadrantChart) == null ? void 0 : u.chartHeight) || 500, titlePadding: ((c = D.quadrantChart) == null ? void 0 : c.titlePadding) || 10, titleFontSize: ((h = D.quadrantChart) == null ? void 0 : h.titleFontSize) || 20, quadrantPadding: ((p = D.quadrantChart) == null ? void 0 : p.quadrantPadding) || 5, xAxisLabelPadding: ((y = D.quadrantChart) == null ? void 0 : y.xAxisLabelPadding) || 5, yAxisLabelPadding: ((S = D.quadrantChart) == null ? void 0 : S.yAxisLabelPadding) || 5, xAxisLabelFontSize: ((a = D.quadrantChart) == null ? void 0 : a.xAxisLabelFontSize) || 16, yAxisLabelFontSize: ((A = D.quadrantChart) == null ? void 0 : A.yAxisLabelFontSize) || 16, quadrantLabelFontSize: ((d = D.quadrantChart) == null ? void 0 : d.quadrantLabelFontSize) || 16, quadrantTextTopPadding: ((T = D.quadrantChart) == null ? void 0 : T.quadrantTextTopPadding) || 5, pointTextPadding: ((q = D.quadrantChart) == null ? void 0 : q.pointTextPadding) || 5, pointLabelFontSize: ((m = D.quadrantChart) == null ? void 0 : m.pointLabelFontSize) || 12, pointRadius: ((b = D.quadrantChart) == null ? void 0 : b.pointRadius) || 5, xAxisPosition: ((x = D.quadrantChart) == null ? void 0 : x.xAxisPosition) || "top", yAxisPosition: ((O = D.quadrantChart) == null ? void 0 : O.yAxisPosition) || "left", quadrantInternalBorderStrokeWidth: ((Y = D.quadrantChart) == null ? void 0 : Y.quadrantInternalBorderStrokeWidth) || 1, quadrantExternalBorderStrokeWidth: ((G = D.quadrantChart) == null ? void 0 : G.quadrantExternalBorderStrokeWidth) || 2 }; } getDefaultThemeConfig() { return { quadrant1Fill: V.quadrant1Fill, quadrant2Fill: V.quadrant2Fill, quadrant3Fill: V.quadrant3Fill, quadrant4Fill: V.quadrant4Fill, quadrant1TextFill: V.quadrant1TextFill, quadrant2TextFill: V.quadrant2TextFill, quadrant3TextFill: V.quadrant3TextFill, quadrant4TextFill: V.quadrant4TextFill, quadrantPointFill: V.quadrantPointFill, quadrantPointTextFill: V.quadrantPointTextFill, quadrantXAxisTextFill: V.quadrantXAxisTextFill, quadrantYAxisTextFill: V.quadrantYAxisTextFill, quadrantTitleFill: V.quadrantTitleFill, quadrantInternalBorderStrokeFill: V.quadrantInternalBorderStrokeFill, quadrantExternalBorderStrokeFill: V.quadrantExternalBorderStrokeFill }; } clear() { this.config = this.getDefaultConfig(), this.themeConfig = this.getDefaultThemeConfig(), this.data = this.getDefaultData(), this.classes = /* @__PURE__ */ new Map(), At.info("clear called"); } setData(n) { this.data = { ...this.data, ...n }; } addPoints(n) { this.data.points = [...n, ...this.data.points]; } addClass(n, u) { this.classes.set(n, u); } setConfig(n) { At.trace("setConfig called with: ", n), this.config = { ...this.config, ...n }; } setThemeConfig(n) { At.trace("setThemeConfig called with: ", n), this.themeConfig = { ...this.themeConfig, ...n }; } calculateSpace(n, u, c, h) { const p = this.config.xAxisLabelPadding * 2 + this.config.xAxisLabelFontSize, y = { top: n === "top" && u ? p : 0, bottom: n === "bottom" && u ? p : 0 }, S = this.config.yAxisLabelPadding * 2 + this.config.yAxisLabelFontSize, a = { left: this.config.yAxisPosition === "left" && c ? S : 0, right: this.config.yAxisPosition === "right" && c ? S : 0 }, A = this.config.titleFontSize + this.config.titlePadding * 2, d = { top: h ? A : 0 }, T = this.config.quadrantPadding + a.left, q = this.config.quadrantPadding + y.top + d.top, m = this.config.chartWidth - this.config.quadrantPadding * 2 - a.left - a.right, b = this.config.chartHeight - this.config.quadrantPadding * 2 - y.top - y.bottom - d.top, x = m / 2, O = b / 2; return { xAxisSpace: y, yAxisSpace: a, titleSpace: d, quadrantSpace: { quadrantLeft: T, quadrantTop: q, quadrantWidth: m, quadrantHalfWidth: x, quadrantHeight: b, quadrantHalfHeight: O } }; } getAxisLabels(n, u, c, h) { const { quadrantSpace: p, titleSpace: y } = h, { quadrantHalfHeight: S, quadrantHeight: a, quadrantLeft: A, quadrantHalfWidth: d, quadrantTop: T, quadrantWidth: q } = p, m = !!this.data.xAxisRightText, b = !!this.data.yAxisTopText, x = []; return this.data.xAxisLeftText && u && x.push({ text: this.data.xAxisLeftText, fill: this.themeConfig.quadrantXAxisTextFill, x: A + (m ? d / 2 : 0), y: n === "top" ? this.config.xAxisLabelPadding + y.top : this.config.xAxisLabelPadding + T + a + this.config.quadrantPadding, fontSize: this.config.xAxisLabelFontSize, verticalPos: m ? "center" : "left", horizontalPos: "top", rotation: 0 }), this.data.xAxisRightText && u && x.push({ text: this.data.xAxisRightText, fill: this.themeConfig.quadrantXAxisTextFill, x: A + d + (m ? d / 2 : 0), y: n === "top" ? this.config.xAxisLabelPadding + y.top : this.config.xAxisLabelPadding + T + a + this.config.quadrantPadding, fontSize: this.config.xAxisLabelFontSize, verticalPos: m ? "center" : "left", horizontalPos: "top", rotation: 0 }), this.data.yAxisBottomText && c && x.push({ text: this.data.yAxisBottomText, fill: this.themeConfig.quadrantYAxisTextFill, x: this.config.yAxisPosition === "left" ? this.config.yAxisLabelPadding : this.config.yAxisLabelPadding + A + q + this.config.quadrantPadding, y: T + a - (b ? S / 2 : 0), fontSize: this.config.yAxisLabelFontSize, verticalPos: b ? "center" : "left", horizontalPos: "top", rotation: -90 }), this.data.yAxisTopText && c && x.push({ text: this.data.yAxisTopText, fill: this.themeConfig.quadrantYAxisTextFill, x: this.config.yAxisPosition === "left" ? this.config.yAxisLabelPadding : this.config.yAxisLabelPadding + A + q + this.config.quadrantPadding, y: T + S - (b ? S / 2 : 0), fontSize: this.config.yAxisLabelFontSize, verticalPos: b ? "center" : "left", horizontalPos: "top", rotation: -90 }), x; } getQuadrants(n) { const { quadrantSpace: u } = n, { quadrantHalfHeight: c, quadrantLeft: h, quadrantHalfWidth: p, quadrantTop: y } = u, S = [ { text: { text: this.data.quadrant1Text, fill: this.themeConfig.quadrant1TextFill, x: 0, y: 0, fontSize: this.config.quadrantLabelFontSize, verticalPos: "center", horizontalPos: "middle", rotation: 0 }, x: h + p, y, width: p, height: c, fill: this.themeConfig.quadrant1Fill }, { text: { text: this.data.quadrant2Text, fill: this.themeConfig.quadrant2TextFill, x: 0, y: 0, fontSize: this.config.quadrantLabelFontSize, verticalPos: "center", horizontalPos: "middle", rotation: 0 }, x: h, y, width: p, height: c, fill: this.themeConfig.quadrant2Fill }, { text: { text: this.data.quadrant3Text, fill: this.themeConfig.quadrant3TextFill, x: 0, y: 0, fontSize: this.config.quadrantLabelFontSize, verticalPos: "center", horizontalPos: "middle", rotation: 0 }, x: h, y: y + c, width: p, height: c, fill: this.themeConfig.quadrant3Fill }, { text: { text: this.data.quadrant4Text, fill: this.themeConfig.quadrant4TextFill, x: 0, y: 0, fontSize: this.config.quadrantLabelFontSize, verticalPos: "center", horizontalPos: "middle", rotation: 0 }, x: h + p, y: y + c, width: p, height: c, fill: this.themeConfig.quadrant4Fill } ]; for (const a of S) a.text.x = a.x + a.width / 2, this.data.points.length === 0 ? (a.text.y = a.y + a.height / 2, a.text.horizontalPos = "middle") : (a.text.y = a.y + this.config.quadrantTextTopPadding, a.text.horizontalPos = "top"); return S; } getQuadrantPoints(n) { const { quadrantSpace: u } = n, { quadrantHeight: c, quadrantLeft: h, quadrantTop: p, quadrantWidth: y } = u, S = ee().domain([0, 1]).range([h, y + h]), a = ee().domain([0, 1]).range([c + p, p]); return this.data.points.map((d) => { const T = this.classes.get(d.className); return T && (d = { ...T, ...d }), { x: S(d.x), y: a(d.y), fill: d.color ?? this.themeConfig.quadrantPointFill, radius: d.radius ?? this.config.pointRadius, text: { text: d.text, fill: this.themeConfig.quadrantPointTextFill, x: S(d.x), y: a(d.y) + this.config.pointTextPadding, verticalPos: "center", horizontalPos: "top", fontSize: this.config.pointLabelFontSize, rotation: 0 }, strokeColor: d.strokeColor ?? this.themeConfig.quadrantPointFill, strokeWidth: d.strokeWidth ?? "0px" }; }); } getBorders(n) { const u = this.config.quadrantExternalBorderStrokeWidth / 2, { quadrantSpace: c } = n, { quadrantHalfHeight: h, quadrantHeight: p, quadrantLeft: y, quadrantHalfWidth: S, quadrantTop: a, quadrantWidth: A } = c; return [ // top border { strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill, strokeWidth: this.config.quadrantExternalBorderStrokeWidth, x1: y - u, y1: a, x2: y + A + u, y2: a }, // right border { strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill, strokeWidth: this.config.quadrantExternalBorderStrokeWidth, x1: y + A, y1: a + u, x2: y + A, y2: a + p - u }, // bottom border { strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill, strokeWidth: this.config.quadrantExternalBorderStrokeWidth, x1: y - u, y1: a + p, x2: y + A + u, y2: a + p }, // left border { strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill, strokeWidth: this.config.quadrantExternalBorderStrokeWidth, x1: y, y1: a + u, x2: y, y2: a + p - u }, // vertical inner border { strokeFill: this.themeConfig.quadrantInternalBorderStrokeFill, strokeWidth: this.config.quadrantInternalBorderStrokeWidth, x1: y + S, y1: a + u, x2: y + S, y2: a + p - u }, // horizontal inner border { strokeFill: this.themeConfig.quadrantInternalBorderStrokeFill, strokeWidth: this.config.quadrantInternalBorderStrokeWidth, x1: y + u, y1: a + h, x2: y + A - u, y2: a + h } ]; } getTitle(n) { if (n) return { text: this.data.titleText, fill: this.themeConfig.quadrantTitleFill, fontSize: this.config.titleFontSize, horizontalPos: "top", verticalPos: "center", rotation: 0, y: this.config.titlePadding, x: this.config.chartWidth / 2 }; } build() { const n = this.config.showXAxis && !!(this.data.xAxisLeftText || this.data.xAxisRightText), u = this.config.showYAxis && !!(this.data.yAxisTopText || this.data.yAxisBottomText), c = this.config.showTitle && !!this.data.titleText, h = this.data.points.length > 0 ? "bottom" : this.config.xAxisPosition, p = this.calculateSpace(h, n, u, c); return { points: this.getQuadrantPoints(p), quadrants: this.getQuadrants(p), axisLabels: this.getAxisLabels(h, n, u, p), borderLines: this.getBorders(p), title: this.getTitle(c) }; }}, o(ht, "QuadrantBuilder"), ht), ct, _t = (ct = class extends Error { constructor(n, u, c) { super(`value for ${n} ${u} is invalid, please use a valid ${c}`), this.name = "InvalidStyleError"; }}, o(ct, "InvalidStyleError"), ct);function It(t) { return !/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t);}o(It, "validateHexCode");function ae(t) { return !/^\d+$/.test(t);}o(ae, "validateNumber");function ne(t) { return !/^\d+px$/.test(t);}o(ne, "validateSizeInPixels");var Ve = wt();function Q(t) { return Ee(t.trim(), Ve);}o(Q, "textSanitizer");var z = new ze();function se(t) { z.setData({ quadrant1Text: Q(t.text) });}o(se, "setQuadrant1Text");function re(t) { z.setData({ quadrant2Text: Q(t.text) });}o(re, "setQuadrant2Text");function oe(t) { z.setData({ quadrant3Text: Q(t.text) });}o(oe, "setQuadrant3Text");function le(t) { z.setData({ quadrant4Text: Q(t.text) });}o(le, "setQuadrant4Text");function he(t) { z.setData({ xAxisLeftText: Q(t.text) });}o(he, "setXAxisLeftText");function ce(t) { z.setData({ xAxisRightText: Q(t.text) });}o(ce, "setXAxisRightText");function de(t) { z.setData({ yAxisTopText: Q(t.text) });}o(de, "setYAxisTopText");function ue(t) { z.setData({ yAxisBottomText: Q(t.text) });}o(ue, "setYAxisBottomText");function kt(t) { const n = {}; for (const u of t) { const [c, h] = u.trim().split(/\s*:\s*/); if (c === "radius") { if (ae(h)) throw new _t(c, h, "number"); n.radius = parseInt(h); } else if (c === "color") { if (It(h)) throw new _t(c, h, "hex code"); n.color = h; } else if (c === "stroke-color") { if (It(h)) throw new _t(c, h, "hex code"); n.strokeColor = h; } else if (c === "stroke-width") { if (ne(h)) throw new _t(c, h, "number of pixels (eg. 10px)"); n.strokeWidth = h; } else throw new Error(`style named ${c} is not supported.`); } return n;}o(kt, "parseStyles");function xe(t, n, u, c, h) { const p = kt(h); z.addPoints([ { x: u, y: c, text: Q(t.text), className: n, ...p } ]);}o(xe, "addPoint");function fe(t, n) { z.addClass(t, kt(n));}o(fe, "addClass");function ge(t) { z.setConfig({ chartWidth: t });}o(ge, "setWidth");function pe(t) { z.setConfig({ chartHeight: t });}o(pe, "setHeight");function ye() { const t = wt(), { themeVariables: n, quadrantChart: u } = t; return u && z.setConfig(u), z.setThemeConfig({ quadrant1Fill: n.quadrant1Fill, quadrant2Fill: n.quadrant2Fill, quadrant3Fill: n.quadrant3Fill, quadrant4Fill: n.quadrant4Fill, quadrant1TextFill: n.quadrant1TextFill, quadrant2TextFill: n.quadrant2TextFill, quadrant3TextFill: n.quadrant3TextFill, quadrant4TextFill: n.quadrant4TextFill, quadrantPointFill: n.quadrantPointFill, quadrantPointTextFill: n.quadrantPointTextFill, quadrantXAxisTextFill: n.quadrantXAxisTextFill, quadrantYAxisTextFill: n.quadrantYAxisTextFill, quadrantExternalBorderStrokeFill: n.quadrantExternalBorderStrokeFill, quadrantInternalBorderStrokeFill: n.quadrantInternalBorderStrokeFill, quadrantTitleFill: n.quadrantTitleFill }), z.setData({ titleText: ie() }), z.build();}o(ye, "getQuadrantData");var Ie = /* @__PURE__ */ o(function() { z.clear(), Ce();}, "clear"), we = { setWidth: ge, setHeight: pe, setQuadrant1Text: se, setQuadrant2Text: re, setQuadrant3Text: oe, setQuadrant4Text: le, setXAxisLeftText: he, setXAxisRightText: ce, setYAxisTopText: de, setYAxisBottomText: ue, parseStyles: kt, addPoint: xe, addClass: fe, getQuadrantData: ye, clear: Ie, setAccTitle: Pe, getAccTitle: Fe, setDiagramTitle: ke, getDiagramTitle: ie, getAccDescription: Ae, setAccDescription: _e}, Be = /* @__PURE__ */ o((t, n, u, c) => { var xt, ft, gt; function h(i) { return i === "top" ? "hanging" : "middle"; } o(h, "getDominantBaseLine"); function p(i) { return i === "left" ? "start" : "middle"; } o(p, "getTextAnchor"); function y(i) { return `translate(${i.x}, ${i.y}) rotate(${i.rotation || 0})`; } o(y, "getTransformation"); const S = wt(); At.debug(`Rendering quadrant chart` + t); const a = S.securityLevel; let A; a === "sandbox" && (A = zt("#i" + n)); const T = (a === "sandbox" ? zt(A.nodes()[0].contentDocument.body) : zt("body")).select(`[id="${n}"]`), q = T.append("g").attr("class", "main"), m = ((xt = S.quadrantChart) == null ? void 0 : xt.chartWidth) ?? 500, b = ((ft = S.quadrantChart) == null ? void 0 : ft.chartHeight) ?? 500; ve(T, b, m, ((gt = S.quadrantChart) == null ? void 0 : gt.useMaxWidth) ?? !0), T.attr("viewBox", "0 0 " + m + " " + b), c.db.setHeight(b), c.db.setWidth(m); const x = c.db.getQuadrantData(), O = q.append("g").attr("class", "quadrants"), Y = q.append("g").attr("class", "border"), G = q.append("g").attr("class", "data-points"), yt = q.append("g").attr("class", "labels"), Tt = q.append("g").attr("class", "title"); x.title && Tt.append("text").attr("x", 0).attr("y", 0).attr("fill", x.title.fill).attr("font-size", x.title.fontSize).attr("dominant-baseline", h(x.title.horizontalPos)).attr("text-anchor", p(x.title.verticalPos)).attr("transform", y(x.title)).text(x.title.text), x.borderLines && Y.selectAll("line").data(x.borderLines).enter().append("line").attr("x1", (i) => i.x1).attr("y1", (i) => i.y1).attr("x2", (i) => i.x2).attr("y2", (i) => i.y2).style("stroke", (i) => i.strokeFill).style("stroke-width", (i) => i.strokeWidth); const dt = O.selectAll("g.quadrant").data(x.quadrants).enter().append("g").attr("class", "quadrant"); dt.append("rect").attr("x", (i) => i.x).attr("y", (i) => i.y).attr("width", (i) => i.width).attr("height", (i) => i.height).attr("fill", (i) => i.fill), dt.append("text").attr("x", 0).attr("y", 0).attr("fill", (i) => i.text.fill).attr("font-size", (i) => i.text.fontSize).attr( "dominant-baseline", (i) => h(i.text.horizontalPos) ).attr("text-anchor", (i) => p(i.text.verticalPos)).attr("transform", (i) => y(i.text)).text((i) => i.text.text), yt.selectAll("g.label").data(x.axisLabels).enter().append("g").attr("class", "label").append("text").attr("x", 0).attr("y", 0).text((i) => i.text).attr("fill", (i) => i.fill).attr("font-size", (i) => i.fontSize).attr("dominant-baseline", (i) => h(i.horizontalPos)).attr("text-anchor", (i) => p(i.verticalPos)).attr("transform", (i) => y(i)); const ut = G.selectAll("g.data-point").data(x.points).enter().append("g").attr("class", "data-point"); ut.append("circle").attr("cx", (i) => i.x).attr("cy", (i) => i.y).attr("r", (i) => i.radius).attr("fill", (i) => i.fill).attr("stroke", (i) => i.strokeColor).attr("stroke-width", (i) => i.strokeWidth), ut.append("text").attr("x", 0).attr("y", 0).text((i) => i.text.text).attr("fill", (i) => i.text.fill).attr("font-size", (i) => i.text.fontSize).attr( "dominant-baseline", (i) => h(i.text.horizontalPos) ).attr("text-anchor", (i) => p(i.text.verticalPos)).attr("transform", (i) => y(i.text));}, "draw"), Re = { draw: Be}, Ue = { parser: De, db: we, renderer: Re, styles: /* @__PURE__ */ o(() => "", "styles")};export { Ue as diagram};123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851import { g as Ge, s as ze } from "./chunk-HPOVUXKZ-C_XOradn.js";import { _ as f, b as Xe, a as Je, s as Ze, g as et, p as tt, q as st, c as Ne, l as qe, y as it, B as rt, o as nt, r as at, u as lt } from "./mermaid.core-BiIw1_mh.js";var Ae = function() { var e = /* @__PURE__ */ f(function(P, i, r, l) { for (r = r || {}, l = P.length; l--; r[P[l]] = i) ; return r; }, "o"), a = [1, 3], u = [1, 4], o = [1, 5], m = [1, 6], c = [5, 6, 8, 9, 11, 13, 21, 22, 23, 24, 41, 42, 43, 44, 45, 46, 54, 72, 74, 77, 89, 90], p = [1, 22], R = [2, 7], h = [1, 26], E = [1, 27], I = [1, 28], k = [1, 29], A = [1, 33], C = [1, 34], V = [1, 35], v = [1, 36], x = [1, 37], L = [1, 38], D = [1, 24], O = [1, 31], w = [1, 32], M = [1, 30], g = [1, 39], _ = [1, 40], y = [5, 8, 9, 11, 13, 21, 22, 23, 24, 41, 42, 43, 44, 45, 46, 54, 72, 74, 77, 89, 90], $ = [1, 61], X = [89, 90], Ce = [5, 8, 9, 11, 13, 21, 22, 23, 24, 27, 29, 41, 42, 43, 44, 45, 46, 54, 61, 63, 72, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90], de = [27, 29], Ve = [1, 70], ve = [1, 71], xe = [1, 72], Le = [1, 73], De = [1, 74], Oe = [1, 75], we = [1, 76], ee = [1, 83], U = [1, 80], te = [1, 84], se = [1, 85], ie = [1, 86], re = [1, 87], ne = [1, 88], ae = [1, 89], le = [1, 90], ce = [1, 91], oe = [1, 92], pe = [5, 8, 9, 11, 13, 21, 22, 23, 24, 27, 41, 42, 43, 44, 45, 46, 54, 72, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90], Y = [63, 64], Me = [1, 101], Fe = [5, 8, 9, 11, 13, 21, 22, 23, 24, 41, 42, 43, 44, 45, 46, 54, 72, 74, 76, 77, 89, 90], N = [5, 8, 9, 11, 13, 21, 22, 23, 24, 41, 42, 43, 44, 45, 46, 54, 72, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90], B = [1, 110], Q = [1, 106], H = [1, 107], K = [1, 108], W = [1, 109], j = [1, 111], he = [1, 116], ue = [1, 117], fe = [1, 114], me = [1, 115], Se = { trace: /* @__PURE__ */ f(function() { }, "trace"), yy: {}, symbols_: { error: 2, start: 3, directive: 4, NEWLINE: 5, RD: 6, diagram: 7, EOF: 8, acc_title: 9, acc_title_value: 10, acc_descr: 11, acc_descr_value: 12, acc_descr_multiline_value: 13, requirementDef: 14, elementDef: 15, relationshipDef: 16, direction: 17, styleStatement: 18, classDefStatement: 19, classStatement: 20, direction_tb: 21, direction_bt: 22, direction_rl: 23, direction_lr: 24, requirementType: 25, requirementName: 26, STRUCT_START: 27, requirementBody: 28, STYLE_SEPARATOR: 29, idList: 30, ID: 31, COLONSEP: 32, id: 33, TEXT: 34, text: 35, RISK: 36, riskLevel: 37, VERIFYMTHD: 38, verifyType: 39, STRUCT_STOP: 40, REQUIREMENT: 41, FUNCTIONAL_REQUIREMENT: 42, INTERFACE_REQUIREMENT: 43, PERFORMANCE_REQUIREMENT: 44, PHYSICAL_REQUIREMENT: 45, DESIGN_CONSTRAINT: 46, LOW_RISK: 47, MED_RISK: 48, HIGH_RISK: 49, VERIFY_ANALYSIS: 50, VERIFY_DEMONSTRATION: 51, VERIFY_INSPECTION: 52, VERIFY_TEST: 53, ELEMENT: 54, elementName: 55, elementBody: 56, TYPE: 57, type: 58, DOCREF: 59, ref: 60, END_ARROW_L: 61, relationship: 62, LINE: 63, END_ARROW_R: 64, CONTAINS: 65, COPIES: 66, DERIVES: 67, SATISFIES: 68, VERIFIES: 69, REFINES: 70, TRACES: 71, CLASSDEF: 72, stylesOpt: 73, CLASS: 74, ALPHA: 75, COMMA: 76, STYLE: 77, style: 78, styleComponent: 79, NUM: 80, COLON: 81, UNIT: 82, SPACE: 83, BRKT: 84, PCT: 85, MINUS: 86, LABEL: 87, SEMICOLON: 88, unqString: 89, qString: 90, $accept: 0, $end: 1 }, terminals_: { 2: "error", 5: "NEWLINE", 6: "RD", 8: "EOF", 9: "acc_title", 10: "acc_title_value", 11: "acc_descr", 12: "acc_descr_value", 13: "acc_descr_multiline_value", 21: "direction_tb", 22: "direction_bt", 23: "direction_rl", 24: "direction_lr", 27: "STRUCT_START", 29: "STYLE_SEPARATOR", 31: "ID", 32: "COLONSEP", 34: "TEXT", 36: "RISK", 38: "VERIFYMTHD", 40: "STRUCT_STOP", 41: "REQUIREMENT", 42: "FUNCTIONAL_REQUIREMENT", 43: "INTERFACE_REQUIREMENT", 44: "PERFORMANCE_REQUIREMENT", 45: "PHYSICAL_REQUIREMENT", 46: "DESIGN_CONSTRAINT", 47: "LOW_RISK", 48: "MED_RISK", 49: "HIGH_RISK", 50: "VERIFY_ANALYSIS", 51: "VERIFY_DEMONSTRATION", 52: "VERIFY_INSPECTION", 53: "VERIFY_TEST", 54: "ELEMENT", 57: "TYPE", 59: "DOCREF", 61: "END_ARROW_L", 63: "LINE", 64: "END_ARROW_R", 65: "CONTAINS", 66: "COPIES", 67: "DERIVES", 68: "SATISFIES", 69: "VERIFIES", 70: "REFINES", 71: "TRACES", 72: "CLASSDEF", 74: "CLASS", 75: "ALPHA", 76: "COMMA", 77: "STYLE", 80: "NUM", 81: "COLON", 82: "UNIT", 83: "SPACE", 84: "BRKT", 85: "PCT", 86: "MINUS", 87: "LABEL", 88: "SEMICOLON", 89: "unqString", 90: "qString" }, productions_: [0, [3, 3], [3, 2], [3, 4], [4, 2], [4, 2], [4, 1], [7, 0], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [17, 1], [17, 1], [17, 1], [17, 1], [14, 5], [14, 7], [28, 5], [28, 5], [28, 5], [28, 5], [28, 2], [28, 1], [25, 1], [25, 1], [25, 1], [25, 1], [25, 1], [25, 1], [37, 1], [37, 1], [37, 1], [39, 1], [39, 1], [39, 1], [39, 1], [15, 5], [15, 7], [56, 5], [56, 5], [56, 2], [56, 1], [16, 5], [16, 5], [62, 1], [62, 1], [62, 1], [62, 1], [62, 1], [62, 1], [62, 1], [19, 3], [20, 3], [20, 3], [30, 1], [30, 3], [30, 1], [30, 3], [18, 3], [73, 1], [73, 3], [78, 1], [78, 2], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [79, 1], [26, 1], [26, 1], [33, 1], [33, 1], [35, 1], [35, 1], [55, 1], [55, 1], [58, 1], [58, 1], [60, 1], [60, 1]], performAction: /* @__PURE__ */ f(function(i, r, l, s, d, t, Ee) { var n = t.length - 1; switch (d) { case 4: this.$ = t[n].trim(), s.setAccTitle(this.$); break; case 5: case 6: this.$ = t[n].trim(), s.setAccDescription(this.$); break; case 7: this.$ = []; break; case 17: s.setDirection("TB"); break; case 18: s.setDirection("BT"); break; case 19: s.setDirection("RL"); break; case 20: s.setDirection("LR"); break; case 21: s.addRequirement(t[n - 3], t[n - 4]); break; case 22: s.addRequirement(t[n - 5], t[n - 6]), s.setClass([t[n - 5]], t[n - 3]); break; case 23: s.setNewReqId(t[n - 2]); break; case 24: s.setNewReqText(t[n - 2]); break; case 25: s.setNewReqRisk(t[n - 2]); break; case 26: s.setNewReqVerifyMethod(t[n - 2]); break; case 29: this.$ = s.RequirementType.REQUIREMENT; break; case 30: this.$ = s.RequirementType.FUNCTIONAL_REQUIREMENT; break; case 31: this.$ = s.RequirementType.INTERFACE_REQUIREMENT; break; case 32: this.$ = s.RequirementType.PERFORMANCE_REQUIREMENT; break; case 33: this.$ = s.RequirementType.PHYSICAL_REQUIREMENT; break; case 34: this.$ = s.RequirementType.DESIGN_CONSTRAINT; break; case 35: this.$ = s.RiskLevel.LOW_RISK; break; case 36: this.$ = s.RiskLevel.MED_RISK; break; case 37: this.$ = s.RiskLevel.HIGH_RISK; break; case 38: this.$ = s.VerifyType.VERIFY_ANALYSIS; break; case 39: this.$ = s.VerifyType.VERIFY_DEMONSTRATION; break; case 40: this.$ = s.VerifyType.VERIFY_INSPECTION; break; case 41: this.$ = s.VerifyType.VERIFY_TEST; break; case 42: s.addElement(t[n - 3]); break; case 43: s.addElement(t[n - 5]), s.setClass([t[n - 5]], t[n - 3]); break; case 44: s.setNewElementType(t[n - 2]); break; case 45: s.setNewElementDocRef(t[n - 2]); break; case 48: s.addRelationship(t[n - 2], t[n], t[n - 4]); break; case 49: s.addRelationship(t[n - 2], t[n - 4], t[n]); break; case 50: this.$ = s.Relationships.CONTAINS; break; case 51: this.$ = s.Relationships.COPIES; break; case 52: this.$ = s.Relationships.DERIVES; break; case 53: this.$ = s.Relationships.SATISFIES; break; case 54: this.$ = s.Relationships.VERIFIES; break; case 55: this.$ = s.Relationships.REFINES; break; case 56: this.$ = s.Relationships.TRACES; break; case 57: this.$ = t[n - 2], s.defineClass(t[n - 1], t[n]); break; case 58: s.setClass(t[n - 1], t[n]); break; case 59: s.setClass([t[n - 2]], t[n]); break; case 60: case 62: this.$ = [t[n]]; break; case 61: case 63: this.$ = t[n - 2].concat([t[n]]); break; case 64: this.$ = t[n - 2], s.setCssStyle(t[n - 1], t[n]); break; case 65: this.$ = [t[n]]; break; case 66: t[n - 2].push(t[n]), this.$ = t[n - 2]; break; case 68: this.$ = t[n - 1] + t[n]; break; } }, "anonymous"), table: [{ 3: 1, 4: 2, 6: a, 9: u, 11: o, 13: m }, { 1: [3] }, { 3: 8, 4: 2, 5: [1, 7], 6: a, 9: u, 11: o, 13: m }, { 5: [1, 9] }, { 10: [1, 10] }, { 12: [1, 11] }, e(c, [2, 6]), { 3: 12, 4: 2, 6: a, 9: u, 11: o, 13: m }, { 1: [2, 2] }, { 4: 17, 5: p, 7: 13, 8: R, 9: u, 11: o, 13: m, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: h, 22: E, 23: I, 24: k, 25: 23, 33: 25, 41: A, 42: C, 43: V, 44: v, 45: x, 46: L, 54: D, 72: O, 74: w, 77: M, 89: g, 90: _ }, e(c, [2, 4]), e(c, [2, 5]), { 1: [2, 1] }, { 8: [1, 41] }, { 4: 17, 5: p, 7: 42, 8: R, 9: u, 11: o, 13: m, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: h, 22: E, 23: I, 24: k, 25: 23, 33: 25, 41: A, 42: C, 43: V, 44: v, 45: x, 46: L, 54: D, 72: O, 74: w, 77: M, 89: g, 90: _ }, { 4: 17, 5: p, 7: 43, 8: R, 9: u, 11: o, 13: m, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: h, 22: E, 23: I, 24: k, 25: 23, 33: 25, 41: A, 42: C, 43: V, 44: v, 45: x, 46: L, 54: D, 72: O, 74: w, 77: M, 89: g, 90: _ }, { 4: 17, 5: p, 7: 44, 8: R, 9: u, 11: o, 13: m, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: h, 22: E, 23: I, 24: k, 25: 23, 33: 25, 41: A, 42: C, 43: V, 44: v, 45: x, 46: L, 54: D, 72: O, 74: w, 77: M, 89: g, 90: _ }, { 4: 17, 5: p, 7: 45, 8: R, 9: u, 11: o, 13: m, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: h, 22: E, 23: I, 24: k, 25: 23, 33: 25, 41: A, 42: C, 43: V, 44: v, 45: x, 46: L, 54: D, 72: O, 74: w, 77: M, 89: g, 90: _ }, { 4: 17, 5: p, 7: 46, 8: R, 9: u, 11: o, 13: m, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: h, 22: E, 23: I, 24: k, 25: 23, 33: 25, 41: A, 42: C, 43: V, 44: v, 45: x, 46: L, 54: D, 72: O, 74: w, 77: M, 89: g, 90: _ }, { 4: 17, 5: p, 7: 47, 8: R, 9: u, 11: o, 13: m, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: h, 22: E, 23: I, 24: k, 25: 23, 33: 25, 41: A, 42: C, 43: V, 44: v, 45: x, 46: L, 54: D, 72: O, 74: w, 77: M, 89: g, 90: _ }, { 4: 17, 5: p, 7: 48, 8: R, 9: u, 11: o, 13: m, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: h, 22: E, 23: I, 24: k, 25: 23, 33: 25, 41: A, 42: C, 43: V, 44: v, 45: x, 46: L, 54: D, 72: O, 74: w, 77: M, 89: g, 90: _ }, { 4: 17, 5: p, 7: 49, 8: R, 9: u, 11: o, 13: m, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: h, 22: E, 23: I, 24: k, 25: 23, 33: 25, 41: A, 42: C, 43: V, 44: v, 45: x, 46: L, 54: D, 72: O, 74: w, 77: M, 89: g, 90: _ }, { 4: 17, 5: p, 7: 50, 8: R, 9: u, 11: o, 13: m, 14: 14, 15: 15, 16: 16, 17: 18, 18: 19, 19: 20, 20: 21, 21: h, 22: E, 23: I, 24: k, 25: 23, 33: 25, 41: A, 42: C, 43: V, 44: v, 45: x, 46: L, 54: D, 72: O, 74: w, 77: M, 89: g, 90: _ }, { 26: 51, 89: [1, 52], 90: [1, 53] }, { 55: 54, 89: [1, 55], 90: [1, 56] }, { 29: [1, 59], 61: [1, 57], 63: [1, 58] }, e(y, [2, 17]), e(y, [2, 18]), e(y, [2, 19]), e(y, [2, 20]), { 30: 60, 33: 62, 75: $, 89: g, 90: _ }, { 30: 63, 33: 62, 75: $, 89: g, 90: _ }, { 30: 64, 33: 62, 75: $, 89: g, 90: _ }, e(X, [2, 29]), e(X, [2, 30]), e(X, [2, 31]), e(X, [2, 32]), e(X, [2, 33]), e(X, [2, 34]), e(Ce, [2, 81]), e(Ce, [2, 82]), { 1: [2, 3] }, { 8: [2, 8] }, { 8: [2, 9] }, { 8: [2, 10] }, { 8: [2, 11] }, { 8: [2, 12] }, { 8: [2, 13] }, { 8: [2, 14] }, { 8: [2, 15] }, { 8: [2, 16] }, { 27: [1, 65], 29: [1, 66] }, e(de, [2, 79]), e(de, [2, 80]), { 27: [1, 67], 29: [1, 68] }, e(de, [2, 85]), e(de, [2, 86]), { 62: 69, 65: Ve, 66: ve, 67: xe, 68: Le, 69: De, 70: Oe, 71: we }, { 62: 77, 65: Ve, 66: ve, 67: xe, 68: Le, 69: De, 70: Oe, 71: we }, { 30: 78, 33: 62, 75: $, 89: g, 90: _ }, { 73: 79, 75: ee, 76: U, 78: 81, 79: 82, 80: te, 81: se, 82: ie, 83: re, 84: ne, 85: ae, 86: le, 87: ce, 88: oe }, e(pe, [2, 60]), e(pe, [2, 62]), { 73: 93, 75: ee, 76: U, 78: 81, 79: 82, 80: te, 81: se, 82: ie, 83: re, 84: ne, 85: ae, 86: le, 87: ce, 88: oe }, { 30: 94, 33: 62, 75: $, 76: U, 89: g, 90: _ }, { 5: [1, 95] }, { 30: 96, 33: 62, 75: $, 89: g, 90: _ }, { 5: [1, 97] }, { 30: 98, 33: 62, 75: $, 89: g, 90: _ }, { 63: [1, 99] }, e(Y, [2, 50]), e(Y, [2, 51]), e(Y, [2, 52]), e(Y, [2, 53]), e(Y, [2, 54]), e(Y, [2, 55]), e(Y, [2, 56]), { 64: [1, 100] }, e(y, [2, 59], { 76: U }), e(y, [2, 64], { 76: Me }), { 33: 103, 75: [1, 102], 89: g, 90: _ }, e(Fe, [2, 65], { 79: 104, 75: ee, 80: te, 81: se, 82: ie, 83: re, 84: ne, 85: ae, 86: le, 87: ce, 88: oe }), e(N, [2, 67]), e(N, [2, 69]), e(N, [2, 70]), e(N, [2, 71]), e(N, [2, 72]), e(N, [2, 73]), e(N, [2, 74]), e(N, [2, 75]), e(N, [2, 76]), e(N, [2, 77]), e(N, [2, 78]), e(y, [2, 57], { 76: Me }), e(y, [2, 58], { 76: U }), { 5: B, 28: 105, 31: Q, 34: H, 36: K, 38: W, 40: j }, { 27: [1, 112], 76: U }, { 5: he, 40: ue, 56: 113, 57: fe, 59: me }, { 27: [1, 118], 76: U }, { 33: 119, 89: g, 90: _ }, { 33: 120, 89: g, 90: _ }, { 75: ee, 78: 121, 79: 82, 80: te, 81: se, 82: ie, 83: re, 84: ne, 85: ae, 86: le, 87: ce, 88: oe }, e(pe, [2, 61]), e(pe, [2, 63]), e(N, [2, 68]), e(y, [2, 21]), { 32: [1, 122] }, { 32: [1, 123] }, { 32: [1, 124] }, { 32: [1, 125] }, { 5: B, 28: 126, 31: Q, 34: H, 36: K, 38: W, 40: j }, e(y, [2, 28]), { 5: [1, 127] }, e(y, [2, 42]), { 32: [1, 128] }, { 32: [1, 129] }, { 5: he, 40: ue, 56: 130, 57: fe, 59: me }, e(y, [2, 47]), { 5: [1, 131] }, e(y, [2, 48]), e(y, [2, 49]), e(Fe, [2, 66], { 79: 104, 75: ee, 80: te, 81: se, 82: ie, 83: re, 84: ne, 85: ae, 86: le, 87: ce, 88: oe }), { 33: 132, 89: g, 90: _ }, { 35: 133, 89: [1, 134], 90: [1, 135] }, { 37: 136, 47: [1, 137], 48: [1, 138], 49: [1, 139] }, { 39: 140, 50: [1, 141], 51: [1, 142], 52: [1, 143], 53: [1, 144] }, e(y, [2, 27]), { 5: B, 28: 145, 31: Q, 34: H, 36: K, 38: W, 40: j }, { 58: 146, 89: [1, 147], 90: [1, 148] }, { 60: 149, 89: [1, 150], 90: [1, 151] }, e(y, [2, 46]), { 5: he, 40: ue, 56: 152, 57: fe, 59: me }, { 5: [1, 153] }, { 5: [1, 154] }, { 5: [2, 83] }, { 5: [2, 84] }, { 5: [1, 155] }, { 5: [2, 35] }, { 5: [2, 36] }, { 5: [2, 37] }, { 5: [1, 156] }, { 5: [2, 38] }, { 5: [2, 39] }, { 5: [2, 40] }, { 5: [2, 41] }, e(y, [2, 22]), { 5: [1, 157] }, { 5: [2, 87] }, { 5: [2, 88] }, { 5: [1, 158] }, { 5: [2, 89] }, { 5: [2, 90] }, e(y, [2, 43]), { 5: B, 28: 159, 31: Q, 34: H, 36: K, 38: W, 40: j }, { 5: B, 28: 160, 31: Q, 34: H, 36: K, 38: W, 40: j }, { 5: B, 28: 161, 31: Q, 34: H, 36: K, 38: W, 40: j }, { 5: B, 28: 162, 31: Q, 34: H, 36: K, 38: W, 40: j }, { 5: he, 40: ue, 56: 163, 57: fe, 59: me }, { 5: he, 40: ue, 56: 164, 57: fe, 59: me }, e(y, [2, 23]), e(y, [2, 24]), e(y, [2, 25]), e(y, [2, 26]), e(y, [2, 44]), e(y, [2, 45])], defaultActions: { 8: [2, 2], 12: [2, 1], 41: [2, 3], 42: [2, 8], 43: [2, 9], 44: [2, 10], 45: [2, 11], 46: [2, 12], 47: [2, 13], 48: [2, 14], 49: [2, 15], 50: [2, 16], 134: [2, 83], 135: [2, 84], 137: [2, 35], 138: [2, 36], 139: [2, 37], 141: [2, 38], 142: [2, 39], 143: [2, 40], 144: [2, 41], 147: [2, 87], 148: [2, 88], 150: [2, 89], 151: [2, 90] }, parseError: /* @__PURE__ */ f(function(i, r) { if (r.recoverable) this.trace(i); else { var l = new Error(i); throw l.hash = r, l; } }, "parseError"), parse: /* @__PURE__ */ f(function(i) { var r = this, l = [0], s = [], d = [null], t = [], Ee = this.table, n = "", ye = 0, Pe = 0, He = 2, $e = 1, Ke = t.slice.call(arguments, 1), S = Object.create(this.lexer), G = { yy: {} }; for (var Ie in this.yy) Object.prototype.hasOwnProperty.call(this.yy, Ie) && (G.yy[Ie] = this.yy[Ie]); S.setInput(i, G.yy), G.yy.lexer = S, G.yy.parser = this, typeof S.yylloc > "u" && (S.yylloc = {}); var be = S.yylloc; t.push(be); var We = S.options && S.options.ranges; typeof G.yy.parseError == "function" ? this.parseError = G.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError; function je(T) { l.length = l.length - 2 * T, d.length = d.length - T, t.length = t.length - T; } f(je, "popStack"); function Ue() { var T; return T = s.pop() || S.lex() || $e, typeof T != "number" && (T instanceof Array && (s = T, T = s.pop()), T = r.symbols_[T] || T), T; } f(Ue, "lex"); for (var b, z, q, Te, J = {}, ge, F, Ye, _e; ; ) { if (z = l[l.length - 1], this.defaultActions[z] ? q = this.defaultActions[z] : ((b === null || typeof b > "u") && (b = Ue()), q = Ee[z] && Ee[z][b]), typeof q > "u" || !q.length || !q[0]) { var ke = ""; _e = []; for (ge in Ee[z]) this.terminals_[ge] && ge > He && _e.push("'" + this.terminals_[ge] + "'"); S.showPosition ? ke = "Parse error on line " + (ye + 1) + `:` + S.showPosition() + `Expecting ` + _e.join(", ") + ", got '" + (this.terminals_[b] || b) + "'" : ke = "Parse error on line " + (ye + 1) + ": Unexpected " + (b == $e ? "end of input" : "'" + (this.terminals_[b] || b) + "'"), this.parseError(ke, { text: S.match, token: this.terminals_[b] || b, line: S.yylineno, loc: be, expected: _e }); } if (q[0] instanceof Array && q.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + z + ", token: " + b); switch (q[0]) { case 1: l.push(b), d.push(S.yytext), t.push(S.yylloc), l.push(q[1]), b = null, Pe = S.yyleng, n = S.yytext, ye = S.yylineno, be = S.yylloc; break; case 2: if (F = this.productions_[q[1]][1], J.$ = d[d.length - F], J._$ = { first_line: t[t.length - (F || 1)].first_line, last_line: t[t.length - 1].last_line, first_column: t[t.length - (F || 1)].first_column, last_column: t[t.length - 1].last_column }, We && (J._$.range = [ t[t.length - (F || 1)].range[0], t[t.length - 1].range[1] ]), Te = this.performAction.apply(J, [ n, Pe, ye, G.yy, q[1], d, t ].concat(Ke)), typeof Te < "u") return Te; F && (l = l.slice(0, -1 * F * 2), d = d.slice(0, -1 * F), t = t.slice(0, -1 * F)), l.push(this.productions_[q[1]][0]), d.push(J.$), t.push(J._$), Ye = Ee[l[l.length - 2]][l[l.length - 1]], l.push(Ye); break; case 3: return !0; } } return !0; }, "parse") }, Qe = /* @__PURE__ */ function() { var P = { EOF: 1, parseError: /* @__PURE__ */ f(function(r, l) { if (this.yy.parser) this.yy.parser.parseError(r, l); else throw new Error(r); }, "parseError"), // resets the lexer, sets new input setInput: /* @__PURE__ */ f(function(i, r) { return this.yy = r || this.yy || {}, this._input = i, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this; }, "setInput"), // consumes and returns one char from the input input: /* @__PURE__ */ f(function() { var i = this._input[0]; this.yytext += i, this.yyleng++, this.offset++, this.match += i, this.matched += i; var r = i.match(/(?:\r\n?|\n).*/g); return r ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), i; }, "input"), // unshifts one char (or a string) into the input unput: /* @__PURE__ */ f(function(i) { var r = i.length, l = i.split(/(?:\r\n?|\n)/g); this._input = i + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - r), this.offset -= r; var s = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), l.length - 1 && (this.yylineno -= l.length - 1); var d = this.yylloc.range; return this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: l ? (l.length === s.length ? this.yylloc.first_column : 0) + s[s.length - l.length].length - l[0].length : this.yylloc.first_column - r }, this.options.ranges && (this.yylloc.range = [d[0], d[0] + this.yyleng - r]), this.yyleng = this.yytext.length, this; }, "unput"), // When called from action, caches matched text and appends it on next action more: /* @__PURE__ */ f(function() { return this._more = !0, this; }, "more"), // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject: /* @__PURE__ */ f(function() { if (this.options.backtrack_lexer) this._backtrack = !0; else return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).` + this.showPosition(), { text: "", token: null, line: this.yylineno }); return this; }, "reject"), // retain first n characters of the match less: /* @__PURE__ */ f(function(i) { this.unput(this.match.slice(i)); }, "less"), // displays already matched input, i.e. for error messages pastInput: /* @__PURE__ */ f(function() { var i = this.matched.substr(0, this.matched.length - this.match.length); return (i.length > 20 ? "..." : "") + i.substr(-20).replace(/\n/g, ""); }, "pastInput"), // displays upcoming input, i.e. for error messages upcomingInput: /* @__PURE__ */ f(function() { var i = this.match; return i.length < 20 && (i += this._input.substr(0, 20 - i.length)), (i.substr(0, 20) + (i.length > 20 ? "..." : "")).replace(/\n/g, ""); }, "upcomingInput"), // displays the character position where the lexing error occurred, i.e. for error messages showPosition: /* @__PURE__ */ f(function() { var i = this.pastInput(), r = new Array(i.length + 1).join("-"); return i + this.upcomingInput() + `` + r + "^"; }, "showPosition"), // test the lexed token: return FALSE when not a match, otherwise return token test_match: /* @__PURE__ */ f(function(i, r) { var l, s, d; if (this.options.backtrack_lexer && (d = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }, this.options.ranges && (d.yylloc.range = this.yylloc.range.slice(0))), s = i[0].match(/(?:\r\n?|\n).*/g), s && (this.yylineno += s.length), this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: s ? s[s.length - 1].length - s[s.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + i[0].length }, this.yytext += i[0], this.match += i[0], this.matches = i, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(i[0].length), this.matched += i[0], l = this.performAction.call(this, this.yy, this, r, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), l) return l; if (this._backtrack) { for (var t in d) this[t] = d[t]; return !1; } return !1; }, "test_match"), // return next match in input next: /* @__PURE__ */ f(function() { if (this.done) return this.EOF; this._input || (this.done = !0); var i, r, l, s; this._more || (this.yytext = "", this.match = ""); for (var d = this._currentRules(), t = 0; t < d.length; t++) if (l = this._input.match(this.rules[d[t]]), l && (!r || l[0].length > r[0].length)) { if (r = l, s = t, this.options.backtrack_lexer) { if (i = this.test_match(l, d[t]), i !== !1) return i; if (this._backtrack) { r = !1; continue; } else return !1; } else if (!this.options.flex) break; } return r ? (i = this.test_match(r, d[s]), i !== !1 ? i : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.` + this.showPosition(), { text: "", token: null, line: this.yylineno }); }, "next"), // return next match that has a token lex: /* @__PURE__ */ f(function() { var r = this.next(); return r || this.lex(); }, "lex"), // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin: /* @__PURE__ */ f(function(r) { this.conditionStack.push(r); }, "begin"), // pop the previously active lexer condition state off the condition stack popState: /* @__PURE__ */ f(function() { var r = this.conditionStack.length - 1; return r > 0 ? this.conditionStack.pop() : this.conditionStack[0]; }, "popState"), // produce the lexer rule set which is active for the currently active lexer condition state _currentRules: /* @__PURE__ */ f(function() { return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules; }, "_currentRules"), // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState: /* @__PURE__ */ f(function(r) { return r = this.conditionStack.length - 1 - Math.abs(r || 0), r >= 0 ? this.conditionStack[r] : "INITIAL"; }, "topState"), // alias for begin(condition) pushState: /* @__PURE__ */ f(function(r) { this.begin(r); }, "pushState"), // return the number of states currently on the stack stateStackSize: /* @__PURE__ */ f(function() { return this.conditionStack.length; }, "stateStackSize"), options: { "case-insensitive": !0 }, performAction: /* @__PURE__ */ f(function(r, l, s, d) { switch (s) { case 0: return "title"; case 1: return this.begin("acc_title"), 9; case 2: return this.popState(), "acc_title_value"; case 3: return this.begin("acc_descr"), 11; case 4: return this.popState(), "acc_descr_value"; case 5: this.begin("acc_descr_multiline"); break; case 6: this.popState(); break; case 7: return "acc_descr_multiline_value"; case 8: return 21; case 9: return 22; case 10: return 23; case 11: return 24; case 12: return 5; case 13: break; case 14: break; case 15: break; case 16: return 8; case 17: return 6; case 18: return 27; case 19: return 40; case 20: return 29; case 21: return 32; case 22: return 31; case 23: return 34; case 24: return 36; case 25: return 38; case 26: return 41; case 27: return 42; case 28: return 43; case 29: return 44; case 30: return 45; case 31: return 46; case 32: return 47; case 33: return 48; case 34: return 49; case 35: return 50; case 36: return 51; case 37: return 52; case 38: return 53; case 39: return 54; case 40: return 65; case 41: return 66; case 42: return 67; case 43: return 68; case 44: return 69; case 45: return 70; case 46: return 71; case 47: return 57; case 48: return 59; case 49: return this.begin("style"), 77; case 50: return 75; case 51: return 81; case 52: return 88; case 53: return "PERCENT"; case 54: return 86; case 55: return 84; case 56: break; case 57: this.begin("string"); break; case 58: this.popState(); break; case 59: return this.begin("style"), 72; case 60: return this.begin("style"), 74; case 61: return 61; case 62: return 64; case 63: return 63; case 64: this.begin("string"); break; case 65: this.popState(); break; case 66: return "qString"; case 67: return l.yytext = l.yytext.trim(), 89; case 68: return 75; case 69: return 80; case 70: return 76; } }, "anonymous"), rules: [/^(?:title\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:(\r?\n)+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:$)/i, /^(?:requirementDiagram\b)/i, /^(?:\{)/i, /^(?:\})/i, /^(?::{3})/i, /^(?::)/i, /^(?:id\b)/i, /^(?:text\b)/i, /^(?:risk\b)/i, /^(?:verifyMethod\b)/i, /^(?:requirement\b)/i, /^(?:functionalRequirement\b)/i, /^(?:interfaceRequirement\b)/i, /^(?:performanceRequirement\b)/i, /^(?:physicalRequirement\b)/i, /^(?:designConstraint\b)/i, /^(?:low\b)/i, /^(?:medium\b)/i, /^(?:high\b)/i, /^(?:analysis\b)/i, /^(?:demonstration\b)/i, /^(?:inspection\b)/i, /^(?:test\b)/i, /^(?:element\b)/i, /^(?:contains\b)/i, /^(?:copies\b)/i, /^(?:derives\b)/i, /^(?:satisfies\b)/i, /^(?:verifies\b)/i, /^(?:refines\b)/i, /^(?:traces\b)/i, /^(?:type\b)/i, /^(?:docref\b)/i, /^(?:style\b)/i, /^(?:\w+)/i, /^(?::)/i, /^(?:;)/i, /^(?:%)/i, /^(?:-)/i, /^(?:#)/i, /^(?: )/i, /^(?:["])/i, /^(?:\n)/i, /^(?:classDef\b)/i, /^(?:class\b)/i, /^(?:<-)/i, /^(?:->)/i, /^(?:-)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i, /^(?:\w+)/i, /^(?:[0-9]+)/i, /^(?:,)/i], conditions: { acc_descr_multiline: { rules: [6, 7, 68, 69, 70], inclusive: !1 }, acc_descr: { rules: [4, 68, 69, 70], inclusive: !1 }, acc_title: { rules: [2, 68, 69, 70], inclusive: !1 }, style: { rules: [50, 51, 52, 53, 54, 55, 56, 57, 58, 68, 69, 70], inclusive: !1 }, unqString: { rules: [68, 69, 70], inclusive: !1 }, token: { rules: [68, 69, 70], inclusive: !1 }, string: { rules: [65, 66, 68, 69, 70], inclusive: !1 }, INITIAL: { rules: [0, 1, 3, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 59, 60, 61, 62, 63, 64, 67, 68, 69, 70], inclusive: !0 } } }; return P; }(); Se.lexer = Qe; function Re() { this.yy = {}; } return f(Re, "Parser"), Re.prototype = Se, Se.Parser = Re, new Re();}();Ae.parser = Ae;var ct = Ae, Z, ot = (Z = class { constructor() { this.relations = [], this.latestRequirement = this.getInitialRequirement(), this.requirements = /* @__PURE__ */ new Map(), this.latestElement = this.getInitialElement(), this.elements = /* @__PURE__ */ new Map(), this.classes = /* @__PURE__ */ new Map(), this.direction = "TB", this.RequirementType = { REQUIREMENT: "Requirement", FUNCTIONAL_REQUIREMENT: "Functional Requirement", INTERFACE_REQUIREMENT: "Interface Requirement", PERFORMANCE_REQUIREMENT: "Performance Requirement", PHYSICAL_REQUIREMENT: "Physical Requirement", DESIGN_CONSTRAINT: "Design Constraint" }, this.RiskLevel = { LOW_RISK: "Low", MED_RISK: "Medium", HIGH_RISK: "High" }, this.VerifyType = { VERIFY_ANALYSIS: "Analysis", VERIFY_DEMONSTRATION: "Demonstration", VERIFY_INSPECTION: "Inspection", VERIFY_TEST: "Test" }, this.Relationships = { CONTAINS: "contains", COPIES: "copies", DERIVES: "derives", SATISFIES: "satisfies", VERIFIES: "verifies", REFINES: "refines", TRACES: "traces" }, this.setAccTitle = Xe, this.getAccTitle = Je, this.setAccDescription = Ze, this.getAccDescription = et, this.setDiagramTitle = tt, this.getDiagramTitle = st, this.getConfig = /* @__PURE__ */ f(() => Ne().requirement, "getConfig"), this.clear(), this.setDirection = this.setDirection.bind(this), this.addRequirement = this.addRequirement.bind(this), this.setNewReqId = this.setNewReqId.bind(this), this.setNewReqRisk = this.setNewReqRisk.bind(this), this.setNewReqText = this.setNewReqText.bind(this), this.setNewReqVerifyMethod = this.setNewReqVerifyMethod.bind(this), this.addElement = this.addElement.bind(this), this.setNewElementType = this.setNewElementType.bind(this), this.setNewElementDocRef = this.setNewElementDocRef.bind(this), this.addRelationship = this.addRelationship.bind(this), this.setCssStyle = this.setCssStyle.bind(this), this.setClass = this.setClass.bind(this), this.defineClass = this.defineClass.bind(this), this.setAccTitle = this.setAccTitle.bind(this), this.setAccDescription = this.setAccDescription.bind(this); } getDirection() { return this.direction; } setDirection(a) { this.direction = a; } resetLatestRequirement() { this.latestRequirement = this.getInitialRequirement(); } resetLatestElement() { this.latestElement = this.getInitialElement(); } getInitialRequirement() { return { requirementId: "", text: "", risk: "", verifyMethod: "", name: "", type: "", cssStyles: [], classes: ["default"] }; } getInitialElement() { return { name: "", type: "", docRef: "", cssStyles: [], classes: ["default"] }; } addRequirement(a, u) { return this.requirements.has(a) || this.requirements.set(a, { name: a, type: u, requirementId: this.latestRequirement.requirementId, text: this.latestRequirement.text, risk: this.latestRequirement.risk, verifyMethod: this.latestRequirement.verifyMethod, cssStyles: [], classes: ["default"] }), this.resetLatestRequirement(), this.requirements.get(a); } getRequirements() { return this.requirements; } setNewReqId(a) { this.latestRequirement !== void 0 && (this.latestRequirement.requirementId = a); } setNewReqText(a) { this.latestRequirement !== void 0 && (this.latestRequirement.text = a); } setNewReqRisk(a) { this.latestRequirement !== void 0 && (this.latestRequirement.risk = a); } setNewReqVerifyMethod(a) { this.latestRequirement !== void 0 && (this.latestRequirement.verifyMethod = a); } addElement(a) { return this.elements.has(a) || (this.elements.set(a, { name: a, type: this.latestElement.type, docRef: this.latestElement.docRef, cssStyles: [], classes: ["default"] }), qe.info("Added new element: ", a)), this.resetLatestElement(), this.elements.get(a); } getElements() { return this.elements; } setNewElementType(a) { this.latestElement !== void 0 && (this.latestElement.type = a); } setNewElementDocRef(a) { this.latestElement !== void 0 && (this.latestElement.docRef = a); } addRelationship(a, u, o) { this.relations.push({ type: a, src: u, dst: o }); } getRelationships() { return this.relations; } clear() { this.relations = [], this.resetLatestRequirement(), this.requirements = /* @__PURE__ */ new Map(), this.resetLatestElement(), this.elements = /* @__PURE__ */ new Map(), this.classes = /* @__PURE__ */ new Map(), it(); } setCssStyle(a, u) { for (const o of a) { const m = this.requirements.get(o) ?? this.elements.get(o); if (!u || !m) return; for (const c of u) c.includes(",") ? m.cssStyles.push(...c.split(",")) : m.cssStyles.push(c); } } setClass(a, u) { var o; for (const m of a) { const c = this.requirements.get(m) ?? this.elements.get(m); if (c) for (const p of u) { c.classes.push(p); const R = (o = this.classes.get(p)) == null ? void 0 : o.styles; R && c.cssStyles.push(...R); } } } defineClass(a, u) { for (const o of a) { let m = this.classes.get(o); m === void 0 && (m = { id: o, styles: [], textStyles: [] }, this.classes.set(o, m)), u && u.forEach(function(c) { if (/color/.exec(c)) { const p = c.replace("fill", "bgFill"); m.textStyles.push(p); } m.styles.push(c); }), this.requirements.forEach((c) => { c.classes.includes(o) && c.cssStyles.push(...u.flatMap((p) => p.split(","))); }), this.elements.forEach((c) => { c.classes.includes(o) && c.cssStyles.push(...u.flatMap((p) => p.split(","))); }); } } getClasses() { return this.classes; } getData() { var m, c, p, R; const a = Ne(), u = [], o = []; for (const h of this.requirements.values()) { const E = h; E.id = h.name, E.cssStyles = h.cssStyles, E.cssClasses = h.classes.join(" "), E.shape = "requirementBox", E.look = a.look, u.push(E); } for (const h of this.elements.values()) { const E = h; E.shape = "requirementBox", E.look = a.look, E.id = h.name, E.cssStyles = h.cssStyles, E.cssClasses = h.classes.join(" "), u.push(E); } for (const h of this.relations) { let E = 0; const I = h.type === this.Relationships.CONTAINS, k = { id: `${h.src}-${h.dst}-${E}`, start: ((m = this.requirements.get(h.src)) == null ? void 0 : m.name) ?? ((c = this.elements.get(h.src)) == null ? void 0 : c.name), end: ((p = this.requirements.get(h.dst)) == null ? void 0 : p.name) ?? ((R = this.elements.get(h.dst)) == null ? void 0 : R.name), label: `<<${h.type}>>`, classes: "relationshipLine", style: ["fill:none", I ? "" : "stroke-dasharray: 10,7"], labelpos: "c", thickness: "normal", type: "normal", pattern: I ? "normal" : "dashed", arrowTypeStart: I ? "requirement_contains" : "", arrowTypeEnd: I ? "" : "requirement_arrow", look: a.look }; o.push(k), E++; } return { nodes: u, edges: o, other: {}, config: a, direction: this.getDirection() }; }}, f(Z, "RequirementDB"), Z), ht = /* @__PURE__ */ f((e) => `
marker { fill: ${e.relationColor}; stroke: ${e.relationColor}; }
marker.cross { stroke: ${e.lineColor}; }
svg { font-family: ${e.fontFamily}; font-size: ${e.fontSize}; }
.reqBox { fill: ${e.requirementBackground}; fill-opacity: 1.0; stroke: ${e.requirementBorderColor}; stroke-width: ${e.requirementBorderSize}; } .reqTitle, .reqLabel{ fill: ${e.requirementTextColor}; } .reqLabelBox { fill: ${e.relationLabelBackground}; fill-opacity: 1.0; }
.req-title-line { stroke: ${e.requirementBorderColor}; stroke-width: ${e.requirementBorderSize}; } .relationshipLine { stroke: ${e.relationColor}; stroke-width: 1; } .relationshipLabel { fill: ${e.relationLabelColor}; } .divider { stroke: ${e.nodeBorder}; stroke-width: 1; } .label { font-family: ${e.fontFamily}; color: ${e.nodeTextColor || e.textColor}; } .label text,span { fill: ${e.nodeTextColor || e.textColor}; color: ${e.nodeTextColor || e.textColor}; } .labelBkg { background-color: ${e.edgeLabelBackground}; }
`, "getStyles"), ut = ht, Be = {};rt(Be, { draw: () => ft});var ft = /* @__PURE__ */ f(async function(e, a, u, o) { qe.info("REF0:"), qe.info("Drawing requirement diagram (unified)", a); const { securityLevel: m, state: c, layout: p } = Ne(), R = o.db.getData(), h = Ge(a, m); R.type = o.type, R.layoutAlgorithm = nt(p), R.nodeSpacing = (c == null ? void 0 : c.nodeSpacing) ?? 50, R.rankSpacing = (c == null ? void 0 : c.rankSpacing) ?? 50, R.markers = ["requirement_contains", "requirement_arrow"], R.diagramId = a, await at(R, h); const E = 8; lt.insertTitle( h, "requirementDiagramTitleText", (c == null ? void 0 : c.titleTopMargin) ?? 25, o.db.getDiagramTitle() ), ze(h, E, "requirementDiagram", (c == null ? void 0 : c.useMaxWidth) ?? !0);}, "draw"), dt = { parser: ct, get db() { return new ot(); }, renderer: Be, styles: ut};export { dt as diagram};123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808import { _ as p, p as _t, q as xt, s as vt, g as bt, b as wt, a as St, c as lt, z as Lt, d as H, V as Et, y as At, k as Tt } from "./mermaid.core-BiIw1_mh.js";import { o as Mt } from "./ordinal-DfAQgscy.js";function Nt(t) { for (var e = t.length / 6 | 0, i = new Array(e), a = 0; a < e; ) i[a] = "#" + t.slice(a * 6, ++a * 6); return i;}const It = Nt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function ct(t, e) { let i; if (e === void 0) for (const a of t) a != null && (i < a || i === void 0 && a >= a) && (i = a); else { let a = -1; for (let h of t) (h = e(h, ++a, t)) != null && (i < h || i === void 0 && h >= h) && (i = h); } return i;}function pt(t, e) { let i; if (e === void 0) for (const a of t) a != null && (i > a || i === void 0 && a >= a) && (i = a); else { let a = -1; for (let h of t) (h = e(h, ++a, t)) != null && (i > h || i === void 0 && h >= h) && (i = h); } return i;}function nt(t, e) { let i = 0; if (e === void 0) for (let a of t) (a = +a) && (i += a); else { let a = -1; for (let h of t) (h = +e(h, ++a, t)) && (i += h); } return i;}function Pt(t) { return t.target.depth;}function Ct(t) { return t.depth;}function Ot(t, e) { return e - 1 - t.height;}function mt(t, e) { return t.sourceLinks.length ? t.depth : e - 1;}function zt(t) { return t.targetLinks.length ? t.depth : t.sourceLinks.length ? pt(t.sourceLinks, Pt) - 1 : 0;}function X(t) { return function() { return t; };}function ut(t, e) { return Q(t.source, e.source) || t.index - e.index;}function ht(t, e) { return Q(t.target, e.target) || t.index - e.index;}function Q(t, e) { return t.y0 - e.y0;}function it(t) { return t.value;}function Dt(t) { return t.index;}function $t(t) { return t.nodes;}function jt(t) { return t.links;}function ft(t, e) { const i = t.get(e); if (!i) throw new Error("missing: " + e); return i;}function yt({ nodes: t }) { for (const e of t) { let i = e.y0, a = i; for (const h of e.sourceLinks) h.y0 = i + h.width / 2, i += h.width; for (const h of e.targetLinks) h.y1 = a + h.width / 2, a += h.width; }}function Bt() { let t = 0, e = 0, i = 1, a = 1, h = 24, d = 8, m, _ = Dt, s = mt, o, l, x = $t, v = jt, y = 6; function b() { const n = { nodes: x.apply(null, arguments), links: v.apply(null, arguments) }; return M(n), T(n), N(n), C(n), S(n), yt(n), n; } b.update = function(n) { return yt(n), n; }, b.nodeId = function(n) { return arguments.length ? (_ = typeof n == "function" ? n : X(n), b) : _; }, b.nodeAlign = function(n) { return arguments.length ? (s = typeof n == "function" ? n : X(n), b) : s; }, b.nodeSort = function(n) { return arguments.length ? (o = n, b) : o; }, b.nodeWidth = function(n) { return arguments.length ? (h = +n, b) : h; }, b.nodePadding = function(n) { return arguments.length ? (d = m = +n, b) : d; }, b.nodes = function(n) { return arguments.length ? (x = typeof n == "function" ? n : X(n), b) : x; }, b.links = function(n) { return arguments.length ? (v = typeof n == "function" ? n : X(n), b) : v; }, b.linkSort = function(n) { return arguments.length ? (l = n, b) : l; }, b.size = function(n) { return arguments.length ? (t = e = 0, i = +n[0], a = +n[1], b) : [i - t, a - e]; }, b.extent = function(n) { return arguments.length ? (t = +n[0][0], i = +n[1][0], e = +n[0][1], a = +n[1][1], b) : [[t, e], [i, a]]; }, b.iterations = function(n) { return arguments.length ? (y = +n, b) : y; }; function M({ nodes: n, links: f }) { for (const [c, r] of n.entries()) r.index = c, r.sourceLinks = [], r.targetLinks = []; const u = new Map(n.map((c, r) => [_(c, r, n), c])); for (const [c, r] of f.entries()) { r.index = c; let { source: k, target: w } = r; typeof k != "object" && (k = r.source = ft(u, k)), typeof w != "object" && (w = r.target = ft(u, w)), k.sourceLinks.push(r), w.targetLinks.push(r); } if (l != null) for (const { sourceLinks: c, targetLinks: r } of n) c.sort(l), r.sort(l); } function T({ nodes: n }) { for (const f of n) f.value = f.fixedValue === void 0 ? Math.max(nt(f.sourceLinks, it), nt(f.targetLinks, it)) : f.fixedValue; } function N({ nodes: n }) { const f = n.length; let u = new Set(n), c = /* @__PURE__ */ new Set(), r = 0; for (; u.size; ) { for (const k of u) { k.depth = r; for (const { target: w } of k.sourceLinks) c.add(w); } if (++r > f) throw new Error("circular link"); u = c, c = /* @__PURE__ */ new Set(); } } function C({ nodes: n }) { const f = n.length; let u = new Set(n), c = /* @__PURE__ */ new Set(), r = 0; for (; u.size; ) { for (const k of u) { k.height = r; for (const { source: w } of k.targetLinks) c.add(w); } if (++r > f) throw new Error("circular link"); u = c, c = /* @__PURE__ */ new Set(); } } function D({ nodes: n }) { const f = ct(n, (r) => r.depth) + 1, u = (i - t - h) / (f - 1), c = new Array(f); for (const r of n) { const k = Math.max(0, Math.min(f - 1, Math.floor(s.call(null, r, f)))); r.layer = k, r.x0 = t + k * u, r.x1 = r.x0 + h, c[k] ? c[k].push(r) : c[k] = [r]; } if (o) for (const r of c) r.sort(o); return c; } function R(n) { const f = pt(n, (u) => (a - e - (u.length - 1) * m) / nt(u, it)); for (const u of n) { let c = e; for (const r of u) { r.y0 = c, r.y1 = c + r.value * f, c = r.y1 + m; for (const k of r.sourceLinks) k.width = k.value * f; } c = (a - c + m) / (u.length + 1); for (let r = 0; r < u.length; ++r) { const k = u[r]; k.y0 += c * (r + 1), k.y1 += c * (r + 1); } A(u); } } function S(n) { const f = D(n); m = Math.min(d, (a - e) / (ct(f, (u) => u.length) - 1)), R(f); for (let u = 0; u < y; ++u) { const c = Math.pow(0.99, u), r = Math.max(1 - c, (u + 1) / y); B(f, c, r), P(f, c, r); } } function P(n, f, u) { for (let c = 1, r = n.length; c < r; ++c) { const k = n[c]; for (const w of k) { let L = 0, V = 0; for (const { source: Y, value: et } of w.targetLinks) { let q = et * (w.layer - Y.layer); L += $(Y, w) * q, V += q; } if (!(V > 0)) continue; let G = (L / V - w.y0) * f; w.y0 += G, w.y1 += G, E(w); } o === void 0 && k.sort(Q), O(k, u); } } function B(n, f, u) { for (let c = n.length, r = c - 2; r >= 0; --r) { const k = n[r]; for (const w of k) { let L = 0, V = 0; for (const { target: Y, value: et } of w.sourceLinks) { let q = et * (Y.layer - w.layer); L += I(w, Y) * q, V += q; } if (!(V > 0)) continue; let G = (L / V - w.y0) * f; w.y0 += G, w.y1 += G, E(w); } o === void 0 && k.sort(Q), O(k, u); } } function O(n, f) { const u = n.length >> 1, c = n[u]; g(n, c.y0 - m, u - 1, f), z(n, c.y1 + m, u + 1, f), g(n, a, n.length - 1, f), z(n, e, 0, f); } function z(n, f, u, c) { for (; u < n.length; ++u) { const r = n[u], k = (f - r.y0) * c; k > 1e-6 && (r.y0 += k, r.y1 += k), f = r.y1 + m; } } function g(n, f, u, c) { for (; u >= 0; --u) { const r = n[u], k = (r.y1 - f) * c; k > 1e-6 && (r.y0 -= k, r.y1 -= k), f = r.y0 - m; } } function E({ sourceLinks: n, targetLinks: f }) { if (l === void 0) { for (const { source: { sourceLinks: u } } of f) u.sort(ht); for (const { target: { targetLinks: u } } of n) u.sort(ut); } } function A(n) { if (l === void 0) for (const { sourceLinks: f, targetLinks: u } of n) f.sort(ht), u.sort(ut); } function $(n, f) { let u = n.y0 - (n.sourceLinks.length - 1) * m / 2; for (const { target: c, width: r } of n.sourceLinks) { if (c === f) break; u += r + m; } for (const { source: c, width: r } of f.targetLinks) { if (c === n) break; u -= r; } return u; } function I(n, f) { let u = f.y0 - (f.targetLinks.length - 1) * m / 2; for (const { source: c, width: r } of f.targetLinks) { if (c === n) break; u += r + m; } for (const { target: c, width: r } of n.sourceLinks) { if (c === f) break; u -= r; } return u; } return b;}var st = Math.PI, rt = 2 * st, F = 1e-6, Rt = rt - F;function ot() { this._x0 = this._y0 = // start of current subpath this._x1 = this._y1 = null, this._ = "";}function kt() { return new ot();}ot.prototype = kt.prototype = { constructor: ot, moveTo: function(t, e) { this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +e); }, closePath: function() { this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._ += "Z"); }, lineTo: function(t, e) { this._ += "L" + (this._x1 = +t) + "," + (this._y1 = +e); }, quadraticCurveTo: function(t, e, i, a) { this._ += "Q" + +t + "," + +e + "," + (this._x1 = +i) + "," + (this._y1 = +a); }, bezierCurveTo: function(t, e, i, a, h, d) { this._ += "C" + +t + "," + +e + "," + +i + "," + +a + "," + (this._x1 = +h) + "," + (this._y1 = +d); }, arcTo: function(t, e, i, a, h) { t = +t, e = +e, i = +i, a = +a, h = +h; var d = this._x1, m = this._y1, _ = i - t, s = a - e, o = d - t, l = m - e, x = o * o + l * l; if (h < 0) throw new Error("negative radius: " + h); if (this._x1 === null) this._ += "M" + (this._x1 = t) + "," + (this._y1 = e); else if (x > F) if (!(Math.abs(l * _ - s * o) > F) || !h) this._ += "L" + (this._x1 = t) + "," + (this._y1 = e); else { var v = i - d, y = a - m, b = _ * _ + s * s, M = v * v + y * y, T = Math.sqrt(b), N = Math.sqrt(x), C = h * Math.tan((st - Math.acos((b + x - M) / (2 * T * N))) / 2), D = C / N, R = C / T; Math.abs(D - 1) > F && (this._ += "L" + (t + D * o) + "," + (e + D * l)), this._ += "A" + h + "," + h + ",0,0," + +(l * v > o * y) + "," + (this._x1 = t + R * _) + "," + (this._y1 = e + R * s); } }, arc: function(t, e, i, a, h, d) { t = +t, e = +e, i = +i, d = !!d; var m = i * Math.cos(a), _ = i * Math.sin(a), s = t + m, o = e + _, l = 1 ^ d, x = d ? a - h : h - a; if (i < 0) throw new Error("negative radius: " + i); this._x1 === null ? this._ += "M" + s + "," + o : (Math.abs(this._x1 - s) > F || Math.abs(this._y1 - o) > F) && (this._ += "L" + s + "," + o), i && (x < 0 && (x = x % rt + rt), x > Rt ? this._ += "A" + i + "," + i + ",0,1," + l + "," + (t - m) + "," + (e - _) + "A" + i + "," + i + ",0,1," + l + "," + (this._x1 = s) + "," + (this._y1 = o) : x > F && (this._ += "A" + i + "," + i + ",0," + +(x >= st) + "," + l + "," + (this._x1 = t + i * Math.cos(h)) + "," + (this._y1 = e + i * Math.sin(h)))); }, rect: function(t, e, i, a) { this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +e) + "h" + +i + "v" + +a + "h" + -i + "Z"; }, toString: function() { return this._; }};function dt(t) { return function() { return t; };}function Vt(t) { return t[0];}function Ft(t) { return t[1];}var Wt = Array.prototype.slice;function Ut(t) { return t.source;}function Gt(t) { return t.target;}function Yt(t) { var e = Ut, i = Gt, a = Vt, h = Ft, d = null; function m() { var _, s = Wt.call(arguments), o = e.apply(this, s), l = i.apply(this, s); if (d || (d = _ = kt()), t(d, +a.apply(this, (s[0] = o, s)), +h.apply(this, s), +a.apply(this, (s[0] = l, s)), +h.apply(this, s)), _) return d = null, _ + "" || null; } return m.source = function(_) { return arguments.length ? (e = _, m) : e; }, m.target = function(_) { return arguments.length ? (i = _, m) : i; }, m.x = function(_) { return arguments.length ? (a = typeof _ == "function" ? _ : dt(+_), m) : a; }, m.y = function(_) { return arguments.length ? (h = typeof _ == "function" ? _ : dt(+_), m) : h; }, m.context = function(_) { return arguments.length ? (d = _ ?? null, m) : d; }, m;}function qt(t, e, i, a, h) { t.moveTo(e, i), t.bezierCurveTo(e = (e + a) / 2, i, e, h, a, h);}function Ht() { return Yt(qt);}function Xt(t) { return [t.source.x1, t.y0];}function Qt(t) { return [t.target.x0, t.y1];}function Kt() { return Ht().source(Xt).target(Qt);}var at = function() { var t = /* @__PURE__ */ p(function(_, s, o, l) { for (o = o || {}, l = _.length; l--; o[_[l]] = s) ; return o; }, "o"), e = [1, 9], i = [1, 10], a = [1, 5, 10, 12], h = { trace: /* @__PURE__ */ p(function() { }, "trace"), yy: {}, symbols_: { error: 2, start: 3, SANKEY: 4, NEWLINE: 5, csv: 6, opt_eof: 7, record: 8, csv_tail: 9, EOF: 10, "field[source]": 11, COMMA: 12, "field[target]": 13, "field[value]": 14, field: 15, escaped: 16, non_escaped: 17, DQUOTE: 18, ESCAPED_TEXT: 19, NON_ESCAPED_TEXT: 20, $accept: 0, $end: 1 }, terminals_: { 2: "error", 4: "SANKEY", 5: "NEWLINE", 10: "EOF", 11: "field[source]", 12: "COMMA", 13: "field[target]", 14: "field[value]", 18: "DQUOTE", 19: "ESCAPED_TEXT", 20: "NON_ESCAPED_TEXT" }, productions_: [0, [3, 4], [6, 2], [9, 2], [9, 0], [7, 1], [7, 0], [8, 5], [15, 1], [15, 1], [16, 3], [17, 1]], performAction: /* @__PURE__ */ p(function(s, o, l, x, v, y, b) { var M = y.length - 1; switch (v) { case 7: const T = x.findOrCreateNode(y[M - 4].trim().replaceAll('""', '"')), N = x.findOrCreateNode(y[M - 2].trim().replaceAll('""', '"')), C = parseFloat(y[M].trim()); x.addLink(T, N, C); break; case 8: case 9: case 11: this.$ = y[M]; break; case 10: this.$ = y[M - 1]; break; } }, "anonymous"), table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, { 5: [1, 3] }, { 6: 4, 8: 5, 15: 6, 16: 7, 17: 8, 18: e, 20: i }, { 1: [2, 6], 7: 11, 10: [1, 12] }, t(i, [2, 4], { 9: 13, 5: [1, 14] }), { 12: [1, 15] }, t(a, [2, 8]), t(a, [2, 9]), { 19: [1, 16] }, t(a, [2, 11]), { 1: [2, 1] }, { 1: [2, 5] }, t(i, [2, 2]), { 6: 17, 8: 5, 15: 6, 16: 7, 17: 8, 18: e, 20: i }, { 15: 18, 16: 7, 17: 8, 18: e, 20: i }, { 18: [1, 19] }, t(i, [2, 3]), { 12: [1, 20] }, t(a, [2, 10]), { 15: 21, 16: 7, 17: 8, 18: e, 20: i }, t([1, 5, 10], [2, 7])], defaultActions: { 11: [2, 1], 12: [2, 5] }, parseError: /* @__PURE__ */ p(function(s, o) { if (o.recoverable) this.trace(s); else { var l = new Error(s); throw l.hash = o, l; } }, "parseError"), parse: /* @__PURE__ */ p(function(s) { var o = this, l = [0], x = [], v = [null], y = [], b = this.table, M = "", T = 0, N = 0, C = 2, D = 1, R = y.slice.call(arguments, 1), S = Object.create(this.lexer), P = { yy: {} }; for (var B in this.yy) Object.prototype.hasOwnProperty.call(this.yy, B) && (P.yy[B] = this.yy[B]); S.setInput(s, P.yy), P.yy.lexer = S, P.yy.parser = this, typeof S.yylloc > "u" && (S.yylloc = {}); var O = S.yylloc; y.push(O); var z = S.options && S.options.ranges; typeof P.yy.parseError == "function" ? this.parseError = P.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError; function g(L) { l.length = l.length - 2 * L, v.length = v.length - L, y.length = y.length - L; } p(g, "popStack"); function E() { var L; return L = x.pop() || S.lex() || D, typeof L != "number" && (L instanceof Array && (x = L, L = x.pop()), L = o.symbols_[L] || L), L; } p(E, "lex"); for (var A, $, I, n, f = {}, u, c, r, k; ; ) { if ($ = l[l.length - 1], this.defaultActions[$] ? I = this.defaultActions[$] : ((A === null || typeof A > "u") && (A = E()), I = b[$] && b[$][A]), typeof I > "u" || !I.length || !I[0]) { var w = ""; k = []; for (u in b[$]) this.terminals_[u] && u > C && k.push("'" + this.terminals_[u] + "'"); S.showPosition ? w = "Parse error on line " + (T + 1) + `:` + S.showPosition() + `Expecting ` + k.join(", ") + ", got '" + (this.terminals_[A] || A) + "'" : w = "Parse error on line " + (T + 1) + ": Unexpected " + (A == D ? "end of input" : "'" + (this.terminals_[A] || A) + "'"), this.parseError(w, { text: S.match, token: this.terminals_[A] || A, line: S.yylineno, loc: O, expected: k }); } if (I[0] instanceof Array && I.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + $ + ", token: " + A); switch (I[0]) { case 1: l.push(A), v.push(S.yytext), y.push(S.yylloc), l.push(I[1]), A = null, N = S.yyleng, M = S.yytext, T = S.yylineno, O = S.yylloc; break; case 2: if (c = this.productions_[I[1]][1], f.$ = v[v.length - c], f._$ = { first_line: y[y.length - (c || 1)].first_line, last_line: y[y.length - 1].last_line, first_column: y[y.length - (c || 1)].first_column, last_column: y[y.length - 1].last_column }, z && (f._$.range = [ y[y.length - (c || 1)].range[0], y[y.length - 1].range[1] ]), n = this.performAction.apply(f, [ M, N, T, P.yy, I[1], v, y ].concat(R)), typeof n < "u") return n; c && (l = l.slice(0, -1 * c * 2), v = v.slice(0, -1 * c), y = y.slice(0, -1 * c)), l.push(this.productions_[I[1]][0]), v.push(f.$), y.push(f._$), r = b[l[l.length - 2]][l[l.length - 1]], l.push(r); break; case 3: return !0; } } return !0; }, "parse") }, d = /* @__PURE__ */ function() { var _ = { EOF: 1, parseError: /* @__PURE__ */ p(function(o, l) { if (this.yy.parser) this.yy.parser.parseError(o, l); else throw new Error(o); }, "parseError"), // resets the lexer, sets new input setInput: /* @__PURE__ */ p(function(s, o) { return this.yy = o || this.yy || {}, this._input = s, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this; }, "setInput"), // consumes and returns one char from the input input: /* @__PURE__ */ p(function() { var s = this._input[0]; this.yytext += s, this.yyleng++, this.offset++, this.match += s, this.matched += s; var o = s.match(/(?:\r\n?|\n).*/g); return o ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), s; }, "input"), // unshifts one char (or a string) into the input unput: /* @__PURE__ */ p(function(s) { var o = s.length, l = s.split(/(?:\r\n?|\n)/g); this._input = s + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - o), this.offset -= o; var x = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), l.length - 1 && (this.yylineno -= l.length - 1); var v = this.yylloc.range; return this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: l ? (l.length === x.length ? this.yylloc.first_column : 0) + x[x.length - l.length].length - l[0].length : this.yylloc.first_column - o }, this.options.ranges && (this.yylloc.range = [v[0], v[0] + this.yyleng - o]), this.yyleng = this.yytext.length, this; }, "unput"), // When called from action, caches matched text and appends it on next action more: /* @__PURE__ */ p(function() { return this._more = !0, this; }, "more"), // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject: /* @__PURE__ */ p(function() { if (this.options.backtrack_lexer) this._backtrack = !0; else return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).` + this.showPosition(), { text: "", token: null, line: this.yylineno }); return this; }, "reject"), // retain first n characters of the match less: /* @__PURE__ */ p(function(s) { this.unput(this.match.slice(s)); }, "less"), // displays already matched input, i.e. for error messages pastInput: /* @__PURE__ */ p(function() { var s = this.matched.substr(0, this.matched.length - this.match.length); return (s.length > 20 ? "..." : "") + s.substr(-20).replace(/\n/g, ""); }, "pastInput"), // displays upcoming input, i.e. for error messages upcomingInput: /* @__PURE__ */ p(function() { var s = this.match; return s.length < 20 && (s += this._input.substr(0, 20 - s.length)), (s.substr(0, 20) + (s.length > 20 ? "..." : "")).replace(/\n/g, ""); }, "upcomingInput"), // displays the character position where the lexing error occurred, i.e. for error messages showPosition: /* @__PURE__ */ p(function() { var s = this.pastInput(), o = new Array(s.length + 1).join("-"); return s + this.upcomingInput() + `` + o + "^"; }, "showPosition"), // test the lexed token: return FALSE when not a match, otherwise return token test_match: /* @__PURE__ */ p(function(s, o) { var l, x, v; if (this.options.backtrack_lexer && (v = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }, this.options.ranges && (v.yylloc.range = this.yylloc.range.slice(0))), x = s[0].match(/(?:\r\n?|\n).*/g), x && (this.yylineno += x.length), this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: x ? x[x.length - 1].length - x[x.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + s[0].length }, this.yytext += s[0], this.match += s[0], this.matches = s, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(s[0].length), this.matched += s[0], l = this.performAction.call(this, this.yy, this, o, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), l) return l; if (this._backtrack) { for (var y in v) this[y] = v[y]; return !1; } return !1; }, "test_match"), // return next match in input next: /* @__PURE__ */ p(function() { if (this.done) return this.EOF; this._input || (this.done = !0); var s, o, l, x; this._more || (this.yytext = "", this.match = ""); for (var v = this._currentRules(), y = 0; y < v.length; y++) if (l = this._input.match(this.rules[v[y]]), l && (!o || l[0].length > o[0].length)) { if (o = l, x = y, this.options.backtrack_lexer) { if (s = this.test_match(l, v[y]), s !== !1) return s; if (this._backtrack) { o = !1; continue; } else return !1; } else if (!this.options.flex) break; } return o ? (s = this.test_match(o, v[x]), s !== !1 ? s : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.` + this.showPosition(), { text: "", token: null, line: this.yylineno }); }, "next"), // return next match that has a token lex: /* @__PURE__ */ p(function() { var o = this.next(); return o || this.lex(); }, "lex"), // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin: /* @__PURE__ */ p(function(o) { this.conditionStack.push(o); }, "begin"), // pop the previously active lexer condition state off the condition stack popState: /* @__PURE__ */ p(function() { var o = this.conditionStack.length - 1; return o > 0 ? this.conditionStack.pop() : this.conditionStack[0]; }, "popState"), // produce the lexer rule set which is active for the currently active lexer condition state _currentRules: /* @__PURE__ */ p(function() { return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules; }, "_currentRules"), // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState: /* @__PURE__ */ p(function(o) { return o = this.conditionStack.length - 1 - Math.abs(o || 0), o >= 0 ? this.conditionStack[o] : "INITIAL"; }, "topState"), // alias for begin(condition) pushState: /* @__PURE__ */ p(function(o) { this.begin(o); }, "pushState"), // return the number of states currently on the stack stateStackSize: /* @__PURE__ */ p(function() { return this.conditionStack.length; }, "stateStackSize"), options: { "case-insensitive": !0 }, performAction: /* @__PURE__ */ p(function(o, l, x, v) { switch (x) { case 0: return this.pushState("csv"), 4; case 1: return 10; case 2: return 5; case 3: return 12; case 4: return this.pushState("escaped_text"), 18; case 5: return 20; case 6: return this.popState("escaped_text"), 18; case 7: return 19; } }, "anonymous"), rules: [/^(?:sankey-beta\b)/i, /^(?:$)/i, /^(?:((\u000D\u000A)|(\u000A)))/i, /^(?:(\u002C))/i, /^(?:(\u0022))/i, /^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i, /^(?:(\u0022)(?!(\u0022)))/i, /^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i], conditions: { csv: { rules: [1, 2, 3, 4, 5, 6, 7], inclusive: !1 }, escaped_text: { rules: [6, 7], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7], inclusive: !0 } } }; return _; }(); h.lexer = d; function m() { this.yy = {}; } return p(m, "Parser"), m.prototype = h, h.Parser = m, new m();}();at.parser = at;var K = at, J = [], tt = [], Z = /* @__PURE__ */ new Map(), Zt = /* @__PURE__ */ p(() => { J = [], tt = [], Z = /* @__PURE__ */ new Map(), At();}, "clear"), W, Jt = (W = class { constructor(e, i, a = 0) { this.source = e, this.target = i, this.value = a; }}, p(W, "SankeyLink"), W), te = /* @__PURE__ */ p((t, e, i) => { J.push(new Jt(t, e, i));}, "addLink"), U, ee = (U = class { constructor(e) { this.ID = e; }}, p(U, "SankeyNode"), U), ne = /* @__PURE__ */ p((t) => { t = Tt.sanitizeText(t, lt()); let e = Z.get(t); return e === void 0 && (e = new ee(t), Z.set(t, e), tt.push(e)), e;}, "findOrCreateNode"), ie = /* @__PURE__ */ p(() => tt, "getNodes"), se = /* @__PURE__ */ p(() => J, "getLinks"), re = /* @__PURE__ */ p(() => ({ nodes: tt.map((t) => ({ id: t.ID })), links: J.map((t) => ({ source: t.source.ID, target: t.target.ID, value: t.value }))}), "getGraph"), oe = { nodesMap: Z, getConfig: /* @__PURE__ */ p(() => lt().sankey, "getConfig"), getNodes: ie, getLinks: se, getGraph: re, addLink: te, findOrCreateNode: ne, getAccTitle: St, setAccTitle: wt, getAccDescription: bt, setAccDescription: vt, getDiagramTitle: xt, setDiagramTitle: _t, clear: Zt}, j, gt = (j = class { static next(e) { return new j(e + ++j.count); } constructor(e) { this.id = e, this.href = `#${e}`; } toString() { return "url(" + this.href + ")"; }}, p(j, "Uid"), j.count = 0, j), ae = { left: Ct, right: Ot, center: zt, justify: mt}, le = /* @__PURE__ */ p(function(t, e, i, a) { const { securityLevel: h, sankey: d } = lt(), m = Lt.sankey; let _; h === "sandbox" && (_ = H("#i" + e)); const s = h === "sandbox" ? H(_.nodes()[0].contentDocument.body) : H("body"), o = h === "sandbox" ? s.select(`[id="${e}"]`) : H(`[id="${e}"]`), l = (d == null ? void 0 : d.width) ?? m.width, x = (d == null ? void 0 : d.height) ?? m.width, v = (d == null ? void 0 : d.useMaxWidth) ?? m.useMaxWidth, y = (d == null ? void 0 : d.nodeAlignment) ?? m.nodeAlignment, b = (d == null ? void 0 : d.prefix) ?? m.prefix, M = (d == null ? void 0 : d.suffix) ?? m.suffix, T = (d == null ? void 0 : d.showValues) ?? m.showValues, N = a.db.getGraph(), C = ae[y]; Bt().nodeId((g) => g.id).nodeWidth(10).nodePadding(10 + (T ? 15 : 0)).nodeAlign(C).extent([ [0, 0], [l, x] ])(N); const S = Mt(It); o.append("g").attr("class", "nodes").selectAll(".node").data(N.nodes).join("g").attr("class", "node").attr("id", (g) => (g.uid = gt.next("node-")).id).attr("transform", function(g) { return "translate(" + g.x0 + "," + g.y0 + ")"; }).attr("x", (g) => g.x0).attr("y", (g) => g.y0).append("rect").attr("height", (g) => g.y1 - g.y0).attr("width", (g) => g.x1 - g.x0).attr("fill", (g) => S(g.id)); const P = /* @__PURE__ */ p(({ id: g, value: E }) => T ? `${g}${b}${Math.round(E * 100) / 100}${M}` : g, "getText"); o.append("g").attr("class", "node-labels").attr("font-size", 14).selectAll("text").data(N.nodes).join("text").attr("x", (g) => g.x0 < l / 2 ? g.x1 + 6 : g.x0 - 6).attr("y", (g) => (g.y1 + g.y0) / 2).attr("dy", `${T ? "0" : "0.35"}em`).attr("text-anchor", (g) => g.x0 < l / 2 ? "start" : "end").text(P); const B = o.append("g").attr("class", "links").attr("fill", "none").attr("stroke-opacity", 0.5).selectAll(".link").data(N.links).join("g").attr("class", "link").style("mix-blend-mode", "multiply"), O = (d == null ? void 0 : d.linkColor) ?? "gradient"; if (O === "gradient") { const g = B.append("linearGradient").attr("id", (E) => (E.uid = gt.next("linearGradient-")).id).attr("gradientUnits", "userSpaceOnUse").attr("x1", (E) => E.source.x1).attr("x2", (E) => E.target.x0); g.append("stop").attr("offset", "0%").attr("stop-color", (E) => S(E.source.id)), g.append("stop").attr("offset", "100%").attr("stop-color", (E) => S(E.target.id)); } let z; switch (O) { case "gradient": z = /* @__PURE__ */ p((g) => g.uid, "coloring"); break; case "source": z = /* @__PURE__ */ p((g) => S(g.source.id), "coloring"); break; case "target": z = /* @__PURE__ */ p((g) => S(g.target.id), "coloring"); break; default: z = O; } B.append("path").attr("d", Kt()).attr("stroke", z).attr("stroke-width", (g) => Math.max(1, g.width)), Et(void 0, o, 0, v);}, "draw"), ce = { draw: le}, ue = /* @__PURE__ */ p((t) => t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g, "").replaceAll(/([\n\r])+/g, ``).trim(), "prepareTextForParsing"), he = /* @__PURE__ */ p((t) => `.label { font-family: ${t.fontFamily}; }`, "getStyles"), fe = he, ye = K.parse.bind(K);K.parse = (t) => ye(ue(t));var pe = { styles: fe, parser: K, db: oe, renderer: ce};export { pe as diagram};123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263import { s as G, a as W, S as N } from "./chunk-GOYUR5SG-D3cGQmyD.js";import { _ as f, c as t, d as H, l as S, e as P, k as z, R as _, S as U, O as C, u as F } from "./mermaid.core-BiIw1_mh.js";import { G as O } from "./graph-BH65arkC.js";import { l as J } from "./layout-GrosxRhM.js";var X = /* @__PURE__ */ f((e) => e.append("circle").attr("class", "start-state").attr("r", t().state.sizeUnit).attr("cx", t().state.padding + t().state.sizeUnit).attr("cy", t().state.padding + t().state.sizeUnit), "drawStartState"), D = /* @__PURE__ */ f((e) => e.append("line").style("stroke", "grey").style("stroke-dasharray", "3").attr("x1", t().state.textHeight).attr("class", "divider").attr("x2", t().state.textHeight * 2).attr("y1", 0).attr("y2", 0), "drawDivider"), Y = /* @__PURE__ */ f((e, i) => { const d = e.append("text").attr("x", 2 * t().state.padding).attr("y", t().state.textHeight + 2 * t().state.padding).attr("font-size", t().state.fontSize).attr("class", "state-title").text(i.id), c = d.node().getBBox(); return e.insert("rect", ":first-child").attr("x", t().state.padding).attr("y", t().state.padding).attr("width", c.width + 2 * t().state.padding).attr("height", c.height + 2 * t().state.padding).attr("rx", t().state.radius), d;}, "drawSimpleState"), I = /* @__PURE__ */ f((e, i) => { const d = /* @__PURE__ */ f(function(g, m, B) { const E = g.append("tspan").attr("x", 2 * t().state.padding).text(m); B || E.attr("dy", t().state.textHeight); }, "addTspan"), n = e.append("text").attr("x", 2 * t().state.padding).attr("y", t().state.textHeight + 1.3 * t().state.padding).attr("font-size", t().state.fontSize).attr("class", "state-title").text(i.descriptions[0]).node().getBBox(), l = n.height, x = e.append("text").attr("x", t().state.padding).attr( "y", l + t().state.padding * 0.4 + t().state.dividerMargin + t().state.textHeight ).attr("class", "state-description"); let a = !0, s = !0; i.descriptions.forEach(function(g) { a || (d(x, g, s), s = !1), a = !1; }); const w = e.append("line").attr("x1", t().state.padding).attr("y1", t().state.padding + l + t().state.dividerMargin / 2).attr("y2", t().state.padding + l + t().state.dividerMargin / 2).attr("class", "descr-divider"), p = x.node().getBBox(), o = Math.max(p.width, n.width); return w.attr("x2", o + 3 * t().state.padding), e.insert("rect", ":first-child").attr("x", t().state.padding).attr("y", t().state.padding).attr("width", o + 2 * t().state.padding).attr("height", p.height + l + 2 * t().state.padding).attr("rx", t().state.radius), e;}, "drawDescrState"), $ = /* @__PURE__ */ f((e, i, d) => { const c = t().state.padding, n = 2 * t().state.padding, l = e.node().getBBox(), x = l.width, a = l.x, s = e.append("text").attr("x", 0).attr("y", t().state.titleShift).attr("font-size", t().state.fontSize).attr("class", "state-title").text(i.id), p = s.node().getBBox().width + n; let o = Math.max(p, x); o === x && (o = o + n); let g; const m = e.node().getBBox(); i.doc, g = a - c, p > x && (g = (x - o) / 2 + c), Math.abs(a - m.x) < c && p > x && (g = a - (p - x) / 2); const B = 1 - t().state.textHeight; return e.insert("rect", ":first-child").attr("x", g).attr("y", B).attr("class", d ? "alt-composit" : "composit").attr("width", o).attr( "height", m.height + t().state.textHeight + t().state.titleShift + 1 ).attr("rx", "0"), s.attr("x", g + c), p <= x && s.attr("x", a + (o - n) / 2 - p / 2 + c), e.insert("rect", ":first-child").attr("x", g).attr( "y", t().state.titleShift - t().state.textHeight - t().state.padding ).attr("width", o).attr("height", t().state.textHeight * 3).attr("rx", t().state.radius), e.insert("rect", ":first-child").attr("x", g).attr( "y", t().state.titleShift - t().state.textHeight - t().state.padding ).attr("width", o).attr("height", m.height + 3 + 2 * t().state.textHeight).attr("rx", t().state.radius), e;}, "addTitleAndBox"), q = /* @__PURE__ */ f((e) => (e.append("circle").attr("class", "end-state-outer").attr("r", t().state.sizeUnit + t().state.miniPadding).attr( "cx", t().state.padding + t().state.sizeUnit + t().state.miniPadding).attr( "cy", t().state.padding + t().state.sizeUnit + t().state.miniPadding), e.append("circle").attr("class", "end-state-inner").attr("r", t().state.sizeUnit).attr("cx", t().state.padding + t().state.sizeUnit + 2).attr("cy", t().state.padding + t().state.sizeUnit + 2)), "drawEndState"), Z = /* @__PURE__ */ f((e, i) => { let d = t().state.forkWidth, c = t().state.forkHeight; if (i.parentId) { let n = d; d = c, c = n; } return e.append("rect").style("stroke", "black").style("fill", "black").attr("width", d).attr("height", c).attr("x", t().state.padding).attr("y", t().state.padding);}, "drawForkJoinState"), j = /* @__PURE__ */ f((e, i, d, c) => { let n = 0; const l = c.append("text"); l.style("text-anchor", "start"), l.attr("class", "noteText"); let x = e.replace(/\r\n/g, "<br/>"); x = x.replace(/\n/g, "<br/>"); const a = x.split(z.lineBreakRegex); let s = 1.25 * t().state.noteMargin; for (const w of a) { const p = w.trim(); if (p.length > 0) { const o = l.append("tspan"); if (o.text(p), s === 0) { const g = o.node().getBBox(); s += g.height; } n += s, o.attr("x", i + t().state.noteMargin), o.attr("y", d + n + 1.25 * t().state.noteMargin); } } return { textWidth: l.node().getBBox().width, textHeight: n };}, "_drawLongText"), K = /* @__PURE__ */ f((e, i) => { i.attr("class", "state-note"); const d = i.append("rect").attr("x", 0).attr("y", t().state.padding), c = i.append("g"), { textWidth: n, textHeight: l } = j(e, 0, 0, c); return d.attr("height", l + 2 * t().state.noteMargin), d.attr("width", n + t().state.noteMargin * 2), d;}, "drawNote"), L = /* @__PURE__ */ f(function(e, i) { const d = i.id, c = { id: d, label: i.id, width: 0, height: 0 }, n = e.append("g").attr("id", d).attr("class", "stateGroup"); i.type === "start" && X(n), i.type === "end" && q(n), (i.type === "fork" || i.type === "join") && Z(n, i), i.type === "note" && K(i.note.text, n), i.type === "divider" && D(n), i.type === "default" && i.descriptions.length === 0 && Y(n, i), i.type === "default" && i.descriptions.length > 0 && I(n, i); const l = n.node().getBBox(); return c.width = l.width + 2 * t().state.padding, c.height = l.height + 2 * t().state.padding, c;}, "drawState"), R = 0, Q = /* @__PURE__ */ f(function(e, i, d) { const c = /* @__PURE__ */ f(function(s) { switch (s) { case N.relationType.AGGREGATION: return "aggregation"; case N.relationType.EXTENSION: return "extension"; case N.relationType.COMPOSITION: return "composition"; case N.relationType.DEPENDENCY: return "dependency"; } }, "getRelationType"); i.points = i.points.filter((s) => !Number.isNaN(s.y)); const n = i.points, l = _().x(function(s) { return s.x; }).y(function(s) { return s.y; }).curve(U), x = e.append("path").attr("d", l(n)).attr("id", "edge" + R).attr("class", "transition"); let a = ""; if (t().state.arrowMarkerAbsolute && (a = C(!0)), x.attr( "marker-end", "url(" + a + "#" + c(N.relationType.DEPENDENCY) + "End)" ), d.title !== void 0) { const s = e.append("g").attr("class", "stateLabel"), { x: w, y: p } = F.calcLabelPosition(i.points), o = z.getRows(d.title); let g = 0; const m = []; let B = 0, E = 0; for (let u = 0; u <= o.length; u++) { const h = s.append("text").attr("text-anchor", "middle").text(o[u]).attr("x", w).attr("y", p + g), y = h.node().getBBox(); B = Math.max(B, y.width), E = Math.min(E, y.x), S.info(y.x, w, p + g), g === 0 && (g = h.node().getBBox().height, S.info("Title height", g, p)), m.push(h); } let k = g * o.length; if (o.length > 1) { const u = (o.length - 1) * g * 0.5; m.forEach((h, y) => h.attr("y", p + y * g - u)), k = g * o.length; } const r = s.node().getBBox(); s.insert("rect", ":first-child").attr("class", "box").attr("x", w - B / 2 - t().state.padding / 2).attr("y", p - k / 2 - t().state.padding / 2 - 3.5).attr("width", B + t().state.padding).attr("height", k + t().state.padding), S.info(r); } R++;}, "drawEdge"), b, T = {}, V = /* @__PURE__ */ f(function() {}, "setConf"), tt = /* @__PURE__ */ f(function(e) { e.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");}, "insertMarkers"), et = /* @__PURE__ */ f(function(e, i, d, c) { b = t().state; const n = t().securityLevel; let l; n === "sandbox" && (l = H("#i" + i)); const x = n === "sandbox" ? H(l.nodes()[0].contentDocument.body) : H("body"), a = n === "sandbox" ? l.nodes()[0].contentDocument : document; S.debug("Rendering diagram " + e); const s = x.select(`[id='${i}']`); tt(s); const w = c.db.getRootDoc(); A(w, s, void 0, !1, x, a, c); const p = b.padding, o = s.node().getBBox(), g = o.width + p * 2, m = o.height + p * 2, B = g * 1.75; P(s, m, B, b.useMaxWidth), s.attr( "viewBox", `${o.x - b.padding} ${o.y - b.padding} ` + g + " " + m );}, "draw"), at = /* @__PURE__ */ f((e) => e ? e.length * b.fontSizeFactor : 1, "getLabelWidth"), A = /* @__PURE__ */ f((e, i, d, c, n, l, x) => { const a = new O({ compound: !0, multigraph: !0 }); let s, w = !0; for (s = 0; s < e.length; s++) if (e[s].stmt === "relation") { w = !1; break; } d ? a.setGraph({ rankdir: "LR", multigraph: !0, compound: !0, // acyclicer: 'greedy', ranker: "tight-tree", ranksep: w ? 1 : b.edgeLengthFactor, nodeSep: w ? 1 : 50, isMultiGraph: !0 // ranksep: 5, // nodesep: 1 }) : a.setGraph({ rankdir: "TB", multigraph: !0, compound: !0, // isCompound: true, // acyclicer: 'greedy', // ranker: 'longest-path' ranksep: w ? 1 : b.edgeLengthFactor, nodeSep: w ? 1 : 50, ranker: "tight-tree", // ranker: 'network-simplex' isMultiGraph: !0 }), a.setDefaultEdgeLabel(function() { return {}; }); const p = x.db.getStates(), o = x.db.getRelations(), g = Object.keys(p); for (const r of g) { const u = p[r]; d && (u.parentId = d); let h; if (u.doc) { let y = i.append("g").attr("id", u.id).attr("class", "stateGroup"); h = A(u.doc, y, u.id, !c, n, l, x); { y = $(y, u, c); let v = y.node().getBBox(); h.width = v.width, h.height = v.height + b.padding / 2, T[u.id] = { y: b.compositTitleSize }; } } else h = L(i, u, a); if (u.note) { const y = { descriptions: [], id: u.id + "-note", note: u.note, type: "note" }, v = L(i, y, a); u.note.position === "left of" ? (a.setNode(h.id + "-note", v), a.setNode(h.id, h)) : (a.setNode(h.id, h), a.setNode(h.id + "-note", v)), a.setParent(h.id, h.id + "-group"), a.setParent(h.id + "-note", h.id + "-group"); } else a.setNode(h.id, h); } S.debug("Count=", a.nodeCount(), a); let m = 0; o.forEach(function(r) { m++, S.debug("Setting edge", r), a.setEdge( r.id1, r.id2, { relation: r, width: at(r.title), height: b.labelHeight * z.getRows(r.title).length, labelpos: "c" }, "id" + m ); }), J(a), S.debug("Graph after layout", a.nodes()); const B = i.node(); a.nodes().forEach(function(r) { r !== void 0 && a.node(r) !== void 0 ? (S.warn("Node " + r + ": " + JSON.stringify(a.node(r))), n.select("#" + B.id + " #" + r).attr( "transform", "translate(" + (a.node(r).x - a.node(r).width / 2) + "," + (a.node(r).y + (T[r] ? T[r].y : 0) - a.node(r).height / 2) + " )" ), n.select("#" + B.id + " #" + r).attr("data-x-shift", a.node(r).x - a.node(r).width / 2), l.querySelectorAll("#" + B.id + " #" + r + " .divider").forEach((h) => { const y = h.parentElement; let v = 0, M = 0; y && (y.parentElement && (v = y.parentElement.getBBox().width), M = parseInt(y.getAttribute("data-x-shift"), 10), Number.isNaN(M) && (M = 0)), h.setAttribute("x1", 0 - M + 8), h.setAttribute("x2", v - M - 8); })) : S.debug("No Node " + r + ": " + JSON.stringify(a.node(r))); }); let E = B.getBBox(); a.edges().forEach(function(r) { r !== void 0 && a.edge(r) !== void 0 && (S.debug("Edge " + r.v + " -> " + r.w + ": " + JSON.stringify(a.edge(r))), Q(i, a.edge(r), a.edge(r).relation)); }), E = B.getBBox(); const k = { id: d || "root", label: d || "root", width: 0, height: 0 }; return k.width = E.width + 2 * b.padding, k.height = E.height + 2 * b.padding, S.debug("Doc rendered", k, a), k;}, "renderDoc"), it = { setConf: V, draw: et}, ot = { parser: W, get db() { return new N(1); }, renderer: it, styles: G, init: /* @__PURE__ */ f((e) => { e.state || (e.state = {}), e.state.arrowMarkerAbsolute = e.arrowMarkerAbsolute; }, "init")};export { ot as diagram};12345678910111213141516import { s as a, b as t, a as r, S as s } from "./chunk-GOYUR5SG-D3cGQmyD.js";import { _ as i } from "./mermaid.core-BiIw1_mh.js";var _ = { parser: r, get db() { return new s(2); }, renderer: t, styles: a, init: /* @__PURE__ */ i((e) => { e.state || (e.state = {}), e.state.arrowMarkerAbsolute = e.arrowMarkerAbsolute; }, "init")};export { _ as diagram};123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801import { _ as s, c as xt, l as T, d as q, V as kt, W as vt, X as _t, Y as bt, B as wt, $ as St, y as Et } from "./mermaid.core-BiIw1_mh.js";import { d as nt } from "./arc-BVd80oSb.js";var X = function() { var n = /* @__PURE__ */ s(function(f, i, a, h) { for (a = a || {}, h = f.length; h--; a[f[h]] = i) ; return a; }, "o"), t = [6, 8, 10, 11, 12, 14, 16, 17, 20, 21], e = [1, 9], l = [1, 10], r = [1, 11], d = [1, 12], c = [1, 13], g = [1, 16], m = [1, 17], p = { trace: /* @__PURE__ */ s(function() { }, "trace"), yy: {}, symbols_: { error: 2, start: 3, timeline: 4, document: 5, EOF: 6, line: 7, SPACE: 8, statement: 9, NEWLINE: 10, title: 11, acc_title: 12, acc_title_value: 13, acc_descr: 14, acc_descr_value: 15, acc_descr_multiline_value: 16, section: 17, period_statement: 18, event_statement: 19, period: 20, event: 21, $accept: 0, $end: 1 }, terminals_: { 2: "error", 4: "timeline", 6: "EOF", 8: "SPACE", 10: "NEWLINE", 11: "title", 12: "acc_title", 13: "acc_title_value", 14: "acc_descr", 15: "acc_descr_value", 16: "acc_descr_multiline_value", 17: "section", 20: "period", 21: "event" }, productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 1], [9, 1], [9, 1], [18, 1], [19, 1]], performAction: /* @__PURE__ */ s(function(i, a, h, u, y, o, S) { var k = o.length - 1; switch (y) { case 1: return o[k - 1]; case 2: this.$ = []; break; case 3: o[k - 1].push(o[k]), this.$ = o[k - 1]; break; case 4: case 5: this.$ = o[k]; break; case 6: case 7: this.$ = []; break; case 8: u.getCommonDb().setDiagramTitle(o[k].substr(6)), this.$ = o[k].substr(6); break; case 9: this.$ = o[k].trim(), u.getCommonDb().setAccTitle(this.$); break; case 10: case 11: this.$ = o[k].trim(), u.getCommonDb().setAccDescription(this.$); break; case 12: u.addSection(o[k].substr(8)), this.$ = o[k].substr(8); break; case 15: u.addTask(o[k], 0, ""), this.$ = o[k]; break; case 16: u.addEvent(o[k].substr(2)), this.$ = o[k]; break; } }, "anonymous"), table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, n(t, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: e, 12: l, 14: r, 16: d, 17: c, 18: 14, 19: 15, 20: g, 21: m }, n(t, [2, 7], { 1: [2, 1] }), n(t, [2, 3]), { 9: 18, 11: e, 12: l, 14: r, 16: d, 17: c, 18: 14, 19: 15, 20: g, 21: m }, n(t, [2, 5]), n(t, [2, 6]), n(t, [2, 8]), { 13: [1, 19] }, { 15: [1, 20] }, n(t, [2, 11]), n(t, [2, 12]), n(t, [2, 13]), n(t, [2, 14]), n(t, [2, 15]), n(t, [2, 16]), n(t, [2, 4]), n(t, [2, 9]), n(t, [2, 10])], defaultActions: {}, parseError: /* @__PURE__ */ s(function(i, a) { if (a.recoverable) this.trace(i); else { var h = new Error(i); throw h.hash = a, h; } }, "parseError"), parse: /* @__PURE__ */ s(function(i) { var a = this, h = [0], u = [], y = [null], o = [], S = this.table, k = "", $ = 0, H = 0, B = 2, J = 1, O = o.slice.call(arguments, 1), v = Object.create(this.lexer), E = { yy: {} }; for (var b in this.yy) Object.prototype.hasOwnProperty.call(this.yy, b) && (E.yy[b] = this.yy[b]); v.setInput(i, E.yy), E.yy.lexer = v, E.yy.parser = this, typeof v.yylloc > "u" && (v.yylloc = {}); var L = v.yylloc; o.push(L); var P = v.options && v.options.ranges; typeof E.yy.parseError == "function" ? this.parseError = E.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError; function A(I) { h.length = h.length - 2 * I, y.length = y.length - I, o.length = o.length - I; } s(A, "popStack"); function F() { var I; return I = u.pop() || v.lex() || J, typeof I != "number" && (I instanceof Array && (u = I, I = u.pop()), I = a.symbols_[I] || I), I; } s(F, "lex"); for (var w, C, N, K, V = {}, j, M, et, G; ; ) { if (C = h[h.length - 1], this.defaultActions[C] ? N = this.defaultActions[C] : ((w === null || typeof w > "u") && (w = F()), N = S[C] && S[C][w]), typeof N > "u" || !N.length || !N[0]) { var Q = ""; G = []; for (j in S[C]) this.terminals_[j] && j > B && G.push("'" + this.terminals_[j] + "'"); v.showPosition ? Q = "Parse error on line " + ($ + 1) + `:` + v.showPosition() + `Expecting ` + G.join(", ") + ", got '" + (this.terminals_[w] || w) + "'" : Q = "Parse error on line " + ($ + 1) + ": Unexpected " + (w == J ? "end of input" : "'" + (this.terminals_[w] || w) + "'"), this.parseError(Q, { text: v.match, token: this.terminals_[w] || w, line: v.yylineno, loc: L, expected: G }); } if (N[0] instanceof Array && N.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + C + ", token: " + w); switch (N[0]) { case 1: h.push(w), y.push(v.yytext), o.push(v.yylloc), h.push(N[1]), w = null, H = v.yyleng, k = v.yytext, $ = v.yylineno, L = v.yylloc; break; case 2: if (M = this.productions_[N[1]][1], V.$ = y[y.length - M], V._$ = { first_line: o[o.length - (M || 1)].first_line, last_line: o[o.length - 1].last_line, first_column: o[o.length - (M || 1)].first_column, last_column: o[o.length - 1].last_column }, P && (V._$.range = [ o[o.length - (M || 1)].range[0], o[o.length - 1].range[1] ]), K = this.performAction.apply(V, [ k, H, $, E.yy, N[1], y, o ].concat(O)), typeof K < "u") return K; M && (h = h.slice(0, -1 * M * 2), y = y.slice(0, -1 * M), o = o.slice(0, -1 * M)), h.push(this.productions_[N[1]][0]), y.push(V.$), o.push(V._$), et = S[h[h.length - 2]][h[h.length - 1]], h.push(et); break; case 3: return !0; } } return !0; }, "parse") }, x = /* @__PURE__ */ function() { var f = { EOF: 1, parseError: /* @__PURE__ */ s(function(a, h) { if (this.yy.parser) this.yy.parser.parseError(a, h); else throw new Error(a); }, "parseError"), // resets the lexer, sets new input setInput: /* @__PURE__ */ s(function(i, a) { return this.yy = a || this.yy || {}, this._input = i, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this; }, "setInput"), // consumes and returns one char from the input input: /* @__PURE__ */ s(function() { var i = this._input[0]; this.yytext += i, this.yyleng++, this.offset++, this.match += i, this.matched += i; var a = i.match(/(?:\r\n?|\n).*/g); return a ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), i; }, "input"), // unshifts one char (or a string) into the input unput: /* @__PURE__ */ s(function(i) { var a = i.length, h = i.split(/(?:\r\n?|\n)/g); this._input = i + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - a), this.offset -= a; var u = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), h.length - 1 && (this.yylineno -= h.length - 1); var y = this.yylloc.range; return this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: h ? (h.length === u.length ? this.yylloc.first_column : 0) + u[u.length - h.length].length - h[0].length : this.yylloc.first_column - a }, this.options.ranges && (this.yylloc.range = [y[0], y[0] + this.yyleng - a]), this.yyleng = this.yytext.length, this; }, "unput"), // When called from action, caches matched text and appends it on next action more: /* @__PURE__ */ s(function() { return this._more = !0, this; }, "more"), // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject: /* @__PURE__ */ s(function() { if (this.options.backtrack_lexer) this._backtrack = !0; else return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).` + this.showPosition(), { text: "", token: null, line: this.yylineno }); return this; }, "reject"), // retain first n characters of the match less: /* @__PURE__ */ s(function(i) { this.unput(this.match.slice(i)); }, "less"), // displays already matched input, i.e. for error messages pastInput: /* @__PURE__ */ s(function() { var i = this.matched.substr(0, this.matched.length - this.match.length); return (i.length > 20 ? "..." : "") + i.substr(-20).replace(/\n/g, ""); }, "pastInput"), // displays upcoming input, i.e. for error messages upcomingInput: /* @__PURE__ */ s(function() { var i = this.match; return i.length < 20 && (i += this._input.substr(0, 20 - i.length)), (i.substr(0, 20) + (i.length > 20 ? "..." : "")).replace(/\n/g, ""); }, "upcomingInput"), // displays the character position where the lexing error occurred, i.e. for error messages showPosition: /* @__PURE__ */ s(function() { var i = this.pastInput(), a = new Array(i.length + 1).join("-"); return i + this.upcomingInput() + `` + a + "^"; }, "showPosition"), // test the lexed token: return FALSE when not a match, otherwise return token test_match: /* @__PURE__ */ s(function(i, a) { var h, u, y; if (this.options.backtrack_lexer && (y = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }, this.options.ranges && (y.yylloc.range = this.yylloc.range.slice(0))), u = i[0].match(/(?:\r\n?|\n).*/g), u && (this.yylineno += u.length), this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: u ? u[u.length - 1].length - u[u.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + i[0].length }, this.yytext += i[0], this.match += i[0], this.matches = i, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(i[0].length), this.matched += i[0], h = this.performAction.call(this, this.yy, this, a, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), h) return h; if (this._backtrack) { for (var o in y) this[o] = y[o]; return !1; } return !1; }, "test_match"), // return next match in input next: /* @__PURE__ */ s(function() { if (this.done) return this.EOF; this._input || (this.done = !0); var i, a, h, u; this._more || (this.yytext = "", this.match = ""); for (var y = this._currentRules(), o = 0; o < y.length; o++) if (h = this._input.match(this.rules[y[o]]), h && (!a || h[0].length > a[0].length)) { if (a = h, u = o, this.options.backtrack_lexer) { if (i = this.test_match(h, y[o]), i !== !1) return i; if (this._backtrack) { a = !1; continue; } else return !1; } else if (!this.options.flex) break; } return a ? (i = this.test_match(a, y[u]), i !== !1 ? i : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.` + this.showPosition(), { text: "", token: null, line: this.yylineno }); }, "next"), // return next match that has a token lex: /* @__PURE__ */ s(function() { var a = this.next(); return a || this.lex(); }, "lex"), // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin: /* @__PURE__ */ s(function(a) { this.conditionStack.push(a); }, "begin"), // pop the previously active lexer condition state off the condition stack popState: /* @__PURE__ */ s(function() { var a = this.conditionStack.length - 1; return a > 0 ? this.conditionStack.pop() : this.conditionStack[0]; }, "popState"), // produce the lexer rule set which is active for the currently active lexer condition state _currentRules: /* @__PURE__ */ s(function() { return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules; }, "_currentRules"), // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState: /* @__PURE__ */ s(function(a) { return a = this.conditionStack.length - 1 - Math.abs(a || 0), a >= 0 ? this.conditionStack[a] : "INITIAL"; }, "topState"), // alias for begin(condition) pushState: /* @__PURE__ */ s(function(a) { this.begin(a); }, "pushState"), // return the number of states currently on the stack stateStackSize: /* @__PURE__ */ s(function() { return this.conditionStack.length; }, "stateStackSize"), options: { "case-insensitive": !0 }, performAction: /* @__PURE__ */ s(function(a, h, u, y) { switch (u) { case 0: break; case 1: break; case 2: return 10; case 3: break; case 4: break; case 5: return 4; case 6: return 11; case 7: return this.begin("acc_title"), 12; case 8: return this.popState(), "acc_title_value"; case 9: return this.begin("acc_descr"), 14; case 10: return this.popState(), "acc_descr_value"; case 11: this.begin("acc_descr_multiline"); break; case 12: this.popState(); break; case 13: return "acc_descr_multiline_value"; case 14: return 17; case 15: return 21; case 16: return 20; case 17: return 6; case 18: return "INVALID"; } }, "anonymous"), rules: [/^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:timeline\b)/i, /^(?:title\s[^\n]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:section\s[^:\n]+)/i, /^(?::\s(?:[^:\n]|:(?!\s))+)/i, /^(?:[^#:\n]+)/i, /^(?:$)/i, /^(?:.)/i], conditions: { acc_descr_multiline: { rules: [12, 13], inclusive: !1 }, acc_descr: { rules: [10], inclusive: !1 }, acc_title: { rules: [8], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18], inclusive: !0 } } }; return f; }(); p.lexer = x; function _() { this.yy = {}; } return s(_, "Parser"), _.prototype = p, p.Parser = _, new _();}();X.parser = X;var Tt = X, at = {};wt(at, { addEvent: () => yt, addSection: () => ht, addTask: () => pt, addTaskOrg: () => gt, clear: () => ct, default: () => It, getCommonDb: () => ot, getSections: () => dt, getTasks: () => ut});var W = "", lt = 0, Y = [], U = [], z = [], ot = /* @__PURE__ */ s(() => St, "getCommonDb"), ct = /* @__PURE__ */ s(function() { Y.length = 0, U.length = 0, W = "", z.length = 0, Et();}, "clear"), ht = /* @__PURE__ */ s(function(n) { W = n, Y.push(n);}, "addSection"), dt = /* @__PURE__ */ s(function() { return Y;}, "getSections"), ut = /* @__PURE__ */ s(function() { let n = rt(); const t = 100; let e = 0; for (; !n && e < t; ) n = rt(), e++; return U.push(...z), U;}, "getTasks"), pt = /* @__PURE__ */ s(function(n, t, e) { const l = { id: lt++, section: W, type: W, task: n, score: t || 0, //if event is defined, then add it the events array events: e ? [e] : [] }; z.push(l);}, "addTask"), yt = /* @__PURE__ */ s(function(n) { z.find((e) => e.id === lt - 1).events.push(n);}, "addEvent"), gt = /* @__PURE__ */ s(function(n) { const t = { section: W, type: W, description: n, task: n, classes: [] }; U.push(t);}, "addTaskOrg"), rt = /* @__PURE__ */ s(function() { const n = /* @__PURE__ */ s(function(e) { return z[e].processed; }, "compileTask"); let t = !0; for (const [e, l] of z.entries()) n(e), t = t && l.processed; return t;}, "compileTasks"), It = { clear: ct, getCommonDb: ot, addSection: ht, getSections: dt, getTasks: ut, addTask: pt, addTaskOrg: gt, addEvent: yt}, Nt = 12, Z = /* @__PURE__ */ s(function(n, t) { const e = n.append("rect"); return e.attr("x", t.x), e.attr("y", t.y), e.attr("fill", t.fill), e.attr("stroke", t.stroke), e.attr("width", t.width), e.attr("height", t.height), e.attr("rx", t.rx), e.attr("ry", t.ry), t.class !== void 0 && e.attr("class", t.class), e;}, "drawRect"), Lt = /* @__PURE__ */ s(function(n, t) { const l = n.append("circle").attr("cx", t.cx).attr("cy", t.cy).attr("class", "face").attr("r", 15).attr("stroke-width", 2).attr("overflow", "visible"), r = n.append("g"); r.append("circle").attr("cx", t.cx - 15 / 3).attr("cy", t.cy - 15 / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666"), r.append("circle").attr("cx", t.cx + 15 / 3).attr("cy", t.cy - 15 / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666"); function d(m) { const p = nt().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175); m.append("path").attr("class", "mouth").attr("d", p).attr("transform", "translate(" + t.cx + "," + (t.cy + 2) + ")"); } s(d, "smile"); function c(m) { const p = nt().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175); m.append("path").attr("class", "mouth").attr("d", p).attr("transform", "translate(" + t.cx + "," + (t.cy + 7) + ")"); } s(c, "sad"); function g(m) { m.append("line").attr("class", "mouth").attr("stroke", 2).attr("x1", t.cx - 5).attr("y1", t.cy + 7).attr("x2", t.cx + 5).attr("y2", t.cy + 7).attr("class", "mouth").attr("stroke-width", "1px").attr("stroke", "#666"); } return s(g, "ambivalent"), t.score > 3 ? d(r) : t.score < 3 ? c(r) : g(r), l;}, "drawFace"), $t = /* @__PURE__ */ s(function(n, t) { const e = n.append("circle"); return e.attr("cx", t.cx), e.attr("cy", t.cy), e.attr("class", "actor-" + t.pos), e.attr("fill", t.fill), e.attr("stroke", t.stroke), e.attr("r", t.r), e.class !== void 0 && e.attr("class", e.class), t.title !== void 0 && e.append("title").text(t.title), e;}, "drawCircle"), ft = /* @__PURE__ */ s(function(n, t) { const e = t.text.replace(/<br\s*\/?>/gi, " "), l = n.append("text"); l.attr("x", t.x), l.attr("y", t.y), l.attr("class", "legend"), l.style("text-anchor", t.anchor), t.class !== void 0 && l.attr("class", t.class); const r = l.append("tspan"); return r.attr("x", t.x + t.textMargin * 2), r.text(e), l;}, "drawText"), Mt = /* @__PURE__ */ s(function(n, t) { function e(r, d, c, g, m) { return r + "," + d + " " + (r + c) + "," + d + " " + (r + c) + "," + (d + g - m) + " " + (r + c - m * 1.2) + "," + (d + g) + " " + r + "," + (d + g); } s(e, "genPoints"); const l = n.append("polygon"); l.attr("points", e(t.x, t.y, 50, 20, 7)), l.attr("class", "labelBox"), t.y = t.y + t.labelMargin, t.x = t.x + 0.5 * t.labelMargin, ft(n, t);}, "drawLabel"), Ht = /* @__PURE__ */ s(function(n, t, e) { const l = n.append("g"), r = D(); r.x = t.x, r.y = t.y, r.fill = t.fill, r.width = e.width, r.height = e.height, r.class = "journey-section section-type-" + t.num, r.rx = 3, r.ry = 3, Z(l, r), mt(e)( t.text, l, r.x, r.y, r.width, r.height, { class: "journey-section section-type-" + t.num }, e, t.colour );}, "drawSection"), it = -1, Pt = /* @__PURE__ */ s(function(n, t, e) { const l = t.x + e.width / 2, r = n.append("g"); it++; const d = 300 + 5 * 30; r.append("line").attr("id", "task" + it).attr("x1", l).attr("y1", t.y).attr("x2", l).attr("y2", d).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666"), Lt(r, { cx: l, cy: 300 + (5 - t.score) * 30, score: t.score }); const c = D(); c.x = t.x, c.y = t.y, c.fill = t.fill, c.width = e.width, c.height = e.height, c.class = "task task-type-" + t.num, c.rx = 3, c.ry = 3, Z(r, c), mt(e)( t.task, r, c.x, c.y, c.width, c.height, { class: "task" }, e, t.colour );}, "drawTask"), At = /* @__PURE__ */ s(function(n, t) { Z(n, { x: t.startx, y: t.starty, width: t.stopx - t.startx, height: t.stopy - t.starty, fill: t.fill, class: "rect" }).lower();}, "drawBackgroundRect"), Ct = /* @__PURE__ */ s(function() { return { x: 0, y: 0, fill: void 0, "text-anchor": "start", width: 100, height: 100, textMargin: 0, rx: 0, ry: 0 };}, "getTextObj"), D = /* @__PURE__ */ s(function() { return { x: 0, y: 0, width: 100, anchor: "start", height: 100, rx: 0, ry: 0 };}, "getNoteRect"), mt = /* @__PURE__ */ function() { function n(r, d, c, g, m, p, x, _) { const f = d.append("text").attr("x", c + m / 2).attr("y", g + p / 2 + 5).style("font-color", _).style("text-anchor", "middle").text(r); l(f, x); } s(n, "byText"); function t(r, d, c, g, m, p, x, _, f) { const { taskFontSize: i, taskFontFamily: a } = _, h = r.split(/<br\s*\/?>/gi); for (let u = 0; u < h.length; u++) { const y = u * i - i * (h.length - 1) / 2, o = d.append("text").attr("x", c + m / 2).attr("y", g).attr("fill", f).style("text-anchor", "middle").style("font-size", i).style("font-family", a); o.append("tspan").attr("x", c + m / 2).attr("dy", y).text(h[u]), o.attr("y", g + p / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), l(o, x); } } s(t, "byTspan"); function e(r, d, c, g, m, p, x, _) { const f = d.append("switch"), a = f.append("foreignObject").attr("x", c).attr("y", g).attr("width", m).attr("height", p).attr("position", "fixed").append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%"); a.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(r), t(r, f, c, g, m, p, x, _), l(a, x); } s(e, "byFo"); function l(r, d) { for (const c in d) c in d && r.attr(c, d[c]); } return s(l, "_setTextAttrs"), function(r) { return r.textPlacement === "fo" ? e : r.textPlacement === "old" ? n : t; };}(), Rt = /* @__PURE__ */ s(function(n) { n.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 5).attr("refY", 2).attr("markerWidth", 6).attr("markerHeight", 4).attr("orient", "auto").append("path").attr("d", "M 0,0 V 4 L6,2 Z");}, "initGraphics");function tt(n, t) { n.each(function() { var e = q(this), l = e.text().split(/(\s+|<br>)/).reverse(), r, d = [], c = 1.1, g = e.attr("y"), m = parseFloat(e.attr("dy")), p = e.text(null).append("tspan").attr("x", 0).attr("y", g).attr("dy", m + "em"); for (let x = 0; x < l.length; x++) r = l[l.length - 1 - x], d.push(r), p.text(d.join(" ").trim()), (p.node().getComputedTextLength() > t || r === "<br>") && (d.pop(), p.text(d.join(" ").trim()), r === "<br>" ? d = [""] : d = [r], p = e.append("tspan").attr("x", 0).attr("y", g).attr("dy", c + "em").text(r)); });}s(tt, "wrap");var Ft = /* @__PURE__ */ s(function(n, t, e, l) { var _; const r = e % Nt - 1, d = n.append("g"); t.section = r, d.attr( "class", (t.class ? t.class + " " : "") + "timeline-node " + ("section-" + r) ); const c = d.append("g"), g = d.append("g"), p = g.append("text").text(t.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(tt, t.width).node().getBBox(), x = (_ = l.fontSize) != null && _.replace ? l.fontSize.replace("px", "") : l.fontSize; return t.height = p.height + x * 1.1 * 0.5 + t.padding, t.height = Math.max(t.height, t.maxHeight), t.width = t.width + 2 * t.padding, g.attr("transform", "translate(" + t.width / 2 + ", " + t.padding / 2 + ")"), Wt(c, t, r, l), t;}, "drawNode"), Vt = /* @__PURE__ */ s(function(n, t, e) { var g; const l = n.append("g"), d = l.append("text").text(t.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(tt, t.width).node().getBBox(), c = (g = e.fontSize) != null && g.replace ? e.fontSize.replace("px", "") : e.fontSize; return l.remove(), d.height + c * 1.1 * 0.5 + t.padding;}, "getVirtualNodeHeight"), Wt = /* @__PURE__ */ s(function(n, t, e) { n.append("path").attr("id", "node-" + t.id).attr("class", "node-bkg node-" + t.type).attr( "d", `M0 ${t.height - 5} v${-t.height + 2 * 5} q0,-5 5,-5 h${t.width - 2 * 5} q5,0 5,5 v${t.height - 5} H0 Z` ), n.append("line").attr("class", "node-line-" + e).attr("x1", 0).attr("y1", t.height).attr("x2", t.width).attr("y2", t.height);}, "defaultBkg"), R = { drawRect: Z, drawCircle: $t, drawSection: Ht, drawText: ft, drawLabel: Mt, drawTask: Pt, drawBackgroundRect: At, getTextObj: Ct, getNoteRect: D, initGraphics: Rt, drawNode: Ft, getVirtualNodeHeight: Vt}, zt = /* @__PURE__ */ s(function(n, t, e, l) { var O, v; const r = xt(), d = r.leftMargin ?? 50; T.debug("timeline", l.db); const c = r.securityLevel; let g; c === "sandbox" && (g = q("#i" + t)); const p = (c === "sandbox" ? q(g.nodes()[0].contentDocument.body) : q("body")).select("#" + t); p.append("g"); const x = l.db.getTasks(), _ = l.db.getCommonDb().getDiagramTitle(); T.debug("task", x), R.initGraphics(p); const f = l.db.getSections(); T.debug("sections", f); let i = 0, a = 0, h = 0, u = 0, y = 50 + d, o = 50; u = 50; let S = 0, k = !0; f.forEach(function(E) { const b = { number: S, descr: E, section: S, width: 150, padding: 20, maxHeight: i }, L = R.getVirtualNodeHeight(p, b, r); T.debug("sectionHeight before draw", L), i = Math.max(i, L + 20); }); let $ = 0, H = 0; T.debug("tasks.length", x.length); for (const [E, b] of x.entries()) { const L = { number: E, descr: b, section: b.section, width: 150, padding: 20, maxHeight: a }, P = R.getVirtualNodeHeight(p, L, r); T.debug("taskHeight before draw", P), a = Math.max(a, P + 20), $ = Math.max($, b.events.length); let A = 0; for (const F of b.events) { const w = { descr: F, section: b.section, number: b.section, width: 150, padding: 20, maxHeight: 50 }; A += R.getVirtualNodeHeight(p, w, r); } b.events.length > 0 && (A += (b.events.length - 1) * 10), H = Math.max(H, A); } T.debug("maxSectionHeight before draw", i), T.debug("maxTaskHeight before draw", a), f && f.length > 0 ? f.forEach((E) => { const b = x.filter((F) => F.section === E), L = { number: S, descr: E, section: S, width: 200 * Math.max(b.length, 1) - 50, padding: 20, maxHeight: i }; T.debug("sectionNode", L); const P = p.append("g"), A = R.drawNode(P, L, S, r); T.debug("sectionNode output", A), P.attr("transform", `translate(${y}, ${u})`), o += i + 50, b.length > 0 && st( p, b, S, y, o, a, r, $, H, i, !1 ), y += 200 * Math.max(b.length, 1), o = u, S++; }) : (k = !1, st( p, x, S, y, o, a, r, $, H, i, !0 )); const B = p.node().getBBox(); T.debug("bounds", B), _ && p.append("text").text(_).attr("x", B.width / 2 - d).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20), h = k ? i + a + 150 : a + 100, p.append("g").attr("class", "lineWrapper").append("line").attr("x1", d).attr("y1", h).attr("x2", B.width + 3 * d).attr("y2", h).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)"), kt( void 0, p, ((O = r.timeline) == null ? void 0 : O.padding) ?? 50, ((v = r.timeline) == null ? void 0 : v.useMaxWidth) ?? !1 );}, "draw"), st = /* @__PURE__ */ s(function(n, t, e, l, r, d, c, g, m, p, x) { var _; for (const f of t) { const i = { descr: f.task, section: e, number: e, width: 150, padding: 20, maxHeight: d }; T.debug("taskNode", i); const a = n.append("g").attr("class", "taskWrapper"), u = R.drawNode(a, i, e, c).height; if (T.debug("taskHeight after draw", u), a.attr("transform", `translate(${l}, ${r})`), d = Math.max(d, u), f.events) { const y = n.append("g").attr("class", "lineWrapper"); let o = d; r += 100, o = o + Bt(n, f.events, e, l, r, c), r -= 100, y.append("line").attr("x1", l + 190 / 2).attr("y1", r + d).attr("x2", l + 190 / 2).attr("y2", r + d + 100 + m + 100).attr("stroke-width", 2).attr("stroke", "black").attr("marker-end", "url(#arrowhead)").attr("stroke-dasharray", "5,5"); } l = l + 200, x && !((_ = c.timeline) != null && _.disableMulticolor) && e++; } r = r - 10;}, "drawTasks"), Bt = /* @__PURE__ */ s(function(n, t, e, l, r, d) { let c = 0; const g = r; r = r + 100; for (const m of t) { const p = { descr: m, section: e, number: e, width: 150, padding: 20, maxHeight: 50 }; T.debug("eventNode", p); const x = n.append("g").attr("class", "eventWrapper"), f = R.drawNode(x, p, e, d).height; c = c + f, x.attr("transform", `translate(${l}, ${r})`), r = r + 10 + f; } return r = g, c;}, "drawEvents"), Ot = { setConf: /* @__PURE__ */ s(() => { }, "setConf"), draw: zt}, jt = /* @__PURE__ */ s((n) => { let t = ""; for (let e = 0; e < n.THEME_COLOR_LIMIT; e++) n["lineColor" + e] = n["lineColor" + e] || n["cScaleInv" + e], vt(n["lineColor" + e]) ? n["lineColor" + e] = _t(n["lineColor" + e], 20) : n["lineColor" + e] = bt(n["lineColor" + e], 20); for (let e = 0; e < n.THEME_COLOR_LIMIT; e++) { const l = "" + (17 - 3 * e); t += ` .section-${e - 1} rect, .section-${e - 1} path, .section-${e - 1} circle, .section-${e - 1} path { fill: ${n["cScale" + e]}; } .section-${e - 1} text { fill: ${n["cScaleLabel" + e]}; } .node-icon-${e - 1} { font-size: 40px; color: ${n["cScaleLabel" + e]}; } .section-edge-${e - 1}{ stroke: ${n["cScale" + e]}; } .edge-depth-${e - 1}{ stroke-width: ${l}; } .section-${e - 1} line { stroke: ${n["cScaleInv" + e]} ; stroke-width: 3; }
.lineWrapper line{ stroke: ${n["cScaleLabel" + e]} ; }
.disabled, .disabled circle, .disabled text { fill: lightgray; } .disabled text { fill: #efefef; } `; } return t;}, "genSections"), Gt = /* @__PURE__ */ s((n) => ` .edge { stroke-width: 3; } ${jt(n)} .section-root rect, .section-root path, .section-root circle { fill: ${n.git0}; } .section-root text { fill: ${n.gitBranchLabel0}; } .icon-container { height:100%; display: flex; justify-content: center; align-items: center; } .edge { fill: none; } .eventWrapper { filter: brightness(120%); }`, "getStyles"), qt = Gt, Jt = { db: at, renderer: Ot, parser: Tt, styles: qt};export { Jt as diagram};123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338import { _ as a, s as gi, g as xi, q as Xt, p as di, a as fi, b as pi, l as Nt, H as mi, e as yi, y as bi, E as St, D as Yt, F as Ai, K as wi, i as Ci, aF as Si, R as Wt } from "./mermaid.core-BiIw1_mh.js";import { i as _i } from "./init-DjUOC4st.js";import { o as ki } from "./ordinal-DfAQgscy.js";import { l as zt } from "./linear-Cg721pVl.js";function Ri(e, t, i) { e = +e, t = +t, i = (n = arguments.length) < 2 ? (t = e, e = 0, 1) : n < 3 ? 1 : +i; for (var s = -1, n = Math.max(0, Math.ceil((t - e) / i)) | 0, r = new Array(n); ++s < n; ) r[s] = e + s * i; return r;}function yt() { var e = ki().unknown(void 0), t = e.domain, i = e.range, s = 0, n = 1, r, g, m = !1, p = 0, k = 0, v = 0.5; delete e.unknown; function C() { var b = t().length, E = n < s, D = E ? n : s, P = E ? s : n; r = (P - D) / Math.max(1, b - p + k * 2), m && (r = Math.floor(r)), D += (P - D - r * (b - p)) * v, g = r * (1 - p), m && (D = Math.round(D), g = Math.round(g)); var I = Ri(b).map(function(y) { return D + r * y; }); return i(E ? I.reverse() : I); } return e.domain = function(b) { return arguments.length ? (t(b), C()) : t(); }, e.range = function(b) { return arguments.length ? ([s, n] = b, s = +s, n = +n, C()) : [s, n]; }, e.rangeRound = function(b) { return [s, n] = b, s = +s, n = +n, m = !0, C(); }, e.bandwidth = function() { return g; }, e.step = function() { return r; }, e.round = function(b) { return arguments.length ? (m = !!b, C()) : m; }, e.padding = function(b) { return arguments.length ? (p = Math.min(1, k = +b), C()) : p; }, e.paddingInner = function(b) { return arguments.length ? (p = Math.min(1, b), C()) : p; }, e.paddingOuter = function(b) { return arguments.length ? (k = +b, C()) : k; }, e.align = function(b) { return arguments.length ? (v = Math.max(0, Math.min(1, b)), C()) : v; }, e.copy = function() { return yt(t(), [s, n]).round(m).paddingInner(p).paddingOuter(k).align(v); }, _i.apply(C(), arguments);}var bt = function() { var e = /* @__PURE__ */ a(function(F, h, u, x) { for (u = u || {}, x = F.length; x--; u[F[x]] = h) ; return u; }, "o"), t = [1, 10, 12, 14, 16, 18, 19, 21, 23], i = [2, 6], s = [1, 3], n = [1, 5], r = [1, 6], g = [1, 7], m = [1, 5, 10, 12, 14, 16, 18, 19, 21, 23, 34, 35, 36], p = [1, 25], k = [1, 26], v = [1, 28], C = [1, 29], b = [1, 30], E = [1, 31], D = [1, 32], P = [1, 33], I = [1, 34], y = [1, 35], _ = [1, 36], c = [1, 37], W = [1, 43], z = [1, 42], U = [1, 47], X = [1, 50], l = [1, 10, 12, 14, 16, 18, 19, 21, 23, 34, 35, 36], L = [1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 27, 28, 34, 35, 36], S = [1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 27, 28, 34, 35, 36, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50], R = [1, 64], $ = { trace: /* @__PURE__ */ a(function() { }, "trace"), yy: {}, symbols_: { error: 2, start: 3, eol: 4, XYCHART: 5, chartConfig: 6, document: 7, CHART_ORIENTATION: 8, statement: 9, title: 10, text: 11, X_AXIS: 12, parseXAxis: 13, Y_AXIS: 14, parseYAxis: 15, LINE: 16, plotData: 17, BAR: 18, acc_title: 19, acc_title_value: 20, acc_descr: 21, acc_descr_value: 22, acc_descr_multiline_value: 23, SQUARE_BRACES_START: 24, commaSeparatedNumbers: 25, SQUARE_BRACES_END: 26, NUMBER_WITH_DECIMAL: 27, COMMA: 28, xAxisData: 29, bandData: 30, ARROW_DELIMITER: 31, commaSeparatedTexts: 32, yAxisData: 33, NEWLINE: 34, SEMI: 35, EOF: 36, alphaNum: 37, STR: 38, MD_STR: 39, alphaNumToken: 40, AMP: 41, NUM: 42, ALPHA: 43, PLUS: 44, EQUALS: 45, MULT: 46, DOT: 47, BRKT: 48, MINUS: 49, UNDERSCORE: 50, $accept: 0, $end: 1 }, terminals_: { 2: "error", 5: "XYCHART", 8: "CHART_ORIENTATION", 10: "title", 12: "X_AXIS", 14: "Y_AXIS", 16: "LINE", 18: "BAR", 19: "acc_title", 20: "acc_title_value", 21: "acc_descr", 22: "acc_descr_value", 23: "acc_descr_multiline_value", 24: "SQUARE_BRACES_START", 26: "SQUARE_BRACES_END", 27: "NUMBER_WITH_DECIMAL", 28: "COMMA", 31: "ARROW_DELIMITER", 34: "NEWLINE", 35: "SEMI", 36: "EOF", 38: "STR", 39: "MD_STR", 41: "AMP", 42: "NUM", 43: "ALPHA", 44: "PLUS", 45: "EQUALS", 46: "MULT", 47: "DOT", 48: "BRKT", 49: "MINUS", 50: "UNDERSCORE" }, productions_: [0, [3, 2], [3, 3], [3, 2], [3, 1], [6, 1], [7, 0], [7, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 3], [9, 2], [9, 3], [9, 2], [9, 2], [9, 1], [17, 3], [25, 3], [25, 1], [13, 1], [13, 2], [13, 1], [29, 1], [29, 3], [30, 3], [32, 3], [32, 1], [15, 1], [15, 2], [15, 1], [33, 3], [4, 1], [4, 1], [4, 1], [11, 1], [11, 1], [11, 1], [37, 1], [37, 2], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1], [40, 1]], performAction: /* @__PURE__ */ a(function(h, u, x, d, w, o, at) { var f = o.length - 1; switch (w) { case 5: d.setOrientation(o[f]); break; case 9: d.setDiagramTitle(o[f].text.trim()); break; case 12: d.setLineData({ text: "", type: "text" }, o[f]); break; case 13: d.setLineData(o[f - 1], o[f]); break; case 14: d.setBarData({ text: "", type: "text" }, o[f]); break; case 15: d.setBarData(o[f - 1], o[f]); break; case 16: this.$ = o[f].trim(), d.setAccTitle(this.$); break; case 17: case 18: this.$ = o[f].trim(), d.setAccDescription(this.$); break; case 19: this.$ = o[f - 1]; break; case 20: this.$ = [Number(o[f - 2]), ...o[f]]; break; case 21: this.$ = [Number(o[f])]; break; case 22: d.setXAxisTitle(o[f]); break; case 23: d.setXAxisTitle(o[f - 1]); break; case 24: d.setXAxisTitle({ type: "text", text: "" }); break; case 25: d.setXAxisBand(o[f]); break; case 26: d.setXAxisRangeData(Number(o[f - 2]), Number(o[f])); break; case 27: this.$ = o[f - 1]; break; case 28: this.$ = [o[f - 2], ...o[f]]; break; case 29: this.$ = [o[f]]; break; case 30: d.setYAxisTitle(o[f]); break; case 31: d.setYAxisTitle(o[f - 1]); break; case 32: d.setYAxisTitle({ type: "text", text: "" }); break; case 33: d.setYAxisRangeData(Number(o[f - 2]), Number(o[f])); break; case 37: this.$ = { text: o[f], type: "text" }; break; case 38: this.$ = { text: o[f], type: "text" }; break; case 39: this.$ = { text: o[f], type: "markdown" }; break; case 40: this.$ = o[f]; break; case 41: this.$ = o[f - 1] + "" + o[f]; break; } }, "anonymous"), table: [e(t, i, { 3: 1, 4: 2, 7: 4, 5: s, 34: n, 35: r, 36: g }), { 1: [3] }, e(t, i, { 4: 2, 7: 4, 3: 8, 5: s, 34: n, 35: r, 36: g }), e(t, i, { 4: 2, 7: 4, 6: 9, 3: 10, 5: s, 8: [1, 11], 34: n, 35: r, 36: g }), { 1: [2, 4], 9: 12, 10: [1, 13], 12: [1, 14], 14: [1, 15], 16: [1, 16], 18: [1, 17], 19: [1, 18], 21: [1, 19], 23: [1, 20] }, e(m, [2, 34]), e(m, [2, 35]), e(m, [2, 36]), { 1: [2, 1] }, e(t, i, { 4: 2, 7: 4, 3: 21, 5: s, 34: n, 35: r, 36: g }), { 1: [2, 3] }, e(m, [2, 5]), e(t, [2, 7], { 4: 22, 34: n, 35: r, 36: g }), { 11: 23, 37: 24, 38: p, 39: k, 40: 27, 41: v, 42: C, 43: b, 44: E, 45: D, 46: P, 47: I, 48: y, 49: _, 50: c }, { 11: 39, 13: 38, 24: W, 27: z, 29: 40, 30: 41, 37: 24, 38: p, 39: k, 40: 27, 41: v, 42: C, 43: b, 44: E, 45: D, 46: P, 47: I, 48: y, 49: _, 50: c }, { 11: 45, 15: 44, 27: U, 33: 46, 37: 24, 38: p, 39: k, 40: 27, 41: v, 42: C, 43: b, 44: E, 45: D, 46: P, 47: I, 48: y, 49: _, 50: c }, { 11: 49, 17: 48, 24: X, 37: 24, 38: p, 39: k, 40: 27, 41: v, 42: C, 43: b, 44: E, 45: D, 46: P, 47: I, 48: y, 49: _, 50: c }, { 11: 52, 17: 51, 24: X, 37: 24, 38: p, 39: k, 40: 27, 41: v, 42: C, 43: b, 44: E, 45: D, 46: P, 47: I, 48: y, 49: _, 50: c }, { 20: [1, 53] }, { 22: [1, 54] }, e(l, [2, 18]), { 1: [2, 2] }, e(l, [2, 8]), e(l, [2, 9]), e(L, [2, 37], { 40: 55, 41: v, 42: C, 43: b, 44: E, 45: D, 46: P, 47: I, 48: y, 49: _, 50: c }), e(L, [2, 38]), e(L, [2, 39]), e(S, [2, 40]), e(S, [2, 42]), e(S, [2, 43]), e(S, [2, 44]), e(S, [2, 45]), e(S, [2, 46]), e(S, [2, 47]), e(S, [2, 48]), e(S, [2, 49]), e(S, [2, 50]), e(S, [2, 51]), e(l, [2, 10]), e(l, [2, 22], { 30: 41, 29: 56, 24: W, 27: z }), e(l, [2, 24]), e(l, [2, 25]), { 31: [1, 57] }, { 11: 59, 32: 58, 37: 24, 38: p, 39: k, 40: 27, 41: v, 42: C, 43: b, 44: E, 45: D, 46: P, 47: I, 48: y, 49: _, 50: c }, e(l, [2, 11]), e(l, [2, 30], { 33: 60, 27: U }), e(l, [2, 32]), { 31: [1, 61] }, e(l, [2, 12]), { 17: 62, 24: X }, { 25: 63, 27: R }, e(l, [2, 14]), { 17: 65, 24: X }, e(l, [2, 16]), e(l, [2, 17]), e(S, [2, 41]), e(l, [2, 23]), { 27: [1, 66] }, { 26: [1, 67] }, { 26: [2, 29], 28: [1, 68] }, e(l, [2, 31]), { 27: [1, 69] }, e(l, [2, 13]), { 26: [1, 70] }, { 26: [2, 21], 28: [1, 71] }, e(l, [2, 15]), e(l, [2, 26]), e(l, [2, 27]), { 11: 59, 32: 72, 37: 24, 38: p, 39: k, 40: 27, 41: v, 42: C, 43: b, 44: E, 45: D, 46: P, 47: I, 48: y, 49: _, 50: c }, e(l, [2, 33]), e(l, [2, 19]), { 25: 73, 27: R }, { 26: [2, 28] }, { 26: [2, 20] }], defaultActions: { 8: [2, 1], 10: [2, 3], 21: [2, 2], 72: [2, 28], 73: [2, 20] }, parseError: /* @__PURE__ */ a(function(h, u) { if (u.recoverable) this.trace(h); else { var x = new Error(h); throw x.hash = u, x; } }, "parseError"), parse: /* @__PURE__ */ a(function(h) { var u = this, x = [0], d = [], w = [null], o = [], at = this.table, f = "", lt = 0, It = 0, hi = 2, Mt = 1, li = o.slice.call(arguments, 1), T = Object.create(this.lexer), Y = { yy: {} }; for (var dt in this.yy) Object.prototype.hasOwnProperty.call(this.yy, dt) && (Y.yy[dt] = this.yy[dt]); T.setInput(h, Y.yy), Y.yy.lexer = T, Y.yy.parser = this, typeof T.yylloc > "u" && (T.yylloc = {}); var ft = T.yylloc; o.push(ft); var ci = T.options && T.options.ranges; typeof Y.yy.parseError == "function" ? this.parseError = Y.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError; function ui(V) { x.length = x.length - 2 * V, w.length = w.length - V, o.length = o.length - V; } a(ui, "popStack"); function Vt() { var V; return V = d.pop() || T.lex() || Mt, typeof V != "number" && (V instanceof Array && (d = V, V = d.pop()), V = u.symbols_[V] || V), V; } a(Vt, "lex"); for (var M, H, B, pt, q = {}, ct, O, Bt, ut; ; ) { if (H = x[x.length - 1], this.defaultActions[H] ? B = this.defaultActions[H] : ((M === null || typeof M > "u") && (M = Vt()), B = at[H] && at[H][M]), typeof B > "u" || !B.length || !B[0]) { var mt = ""; ut = []; for (ct in at[H]) this.terminals_[ct] && ct > hi && ut.push("'" + this.terminals_[ct] + "'"); T.showPosition ? mt = "Parse error on line " + (lt + 1) + `:` + T.showPosition() + `Expecting ` + ut.join(", ") + ", got '" + (this.terminals_[M] || M) + "'" : mt = "Parse error on line " + (lt + 1) + ": Unexpected " + (M == Mt ? "end of input" : "'" + (this.terminals_[M] || M) + "'"), this.parseError(mt, { text: T.match, token: this.terminals_[M] || M, line: T.yylineno, loc: ft, expected: ut }); } if (B[0] instanceof Array && B.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + H + ", token: " + M); switch (B[0]) { case 1: x.push(M), w.push(T.yytext), o.push(T.yylloc), x.push(B[1]), M = null, It = T.yyleng, f = T.yytext, lt = T.yylineno, ft = T.yylloc; break; case 2: if (O = this.productions_[B[1]][1], q.$ = w[w.length - O], q._$ = { first_line: o[o.length - (O || 1)].first_line, last_line: o[o.length - 1].last_line, first_column: o[o.length - (O || 1)].first_column, last_column: o[o.length - 1].last_column }, ci && (q._$.range = [ o[o.length - (O || 1)].range[0], o[o.length - 1].range[1] ]), pt = this.performAction.apply(q, [ f, It, lt, Y.yy, B[1], w, o ].concat(li)), typeof pt < "u") return pt; O && (x = x.slice(0, -1 * O * 2), w = w.slice(0, -1 * O), o = o.slice(0, -1 * O)), x.push(this.productions_[B[1]][0]), w.push(q.$), o.push(q._$), Bt = at[x[x.length - 2]][x[x.length - 1]], x.push(Bt); break; case 3: return !0; } } return !0; }, "parse") }, Et = /* @__PURE__ */ function() { var F = { EOF: 1, parseError: /* @__PURE__ */ a(function(u, x) { if (this.yy.parser) this.yy.parser.parseError(u, x); else throw new Error(u); }, "parseError"), // resets the lexer, sets new input setInput: /* @__PURE__ */ a(function(h, u) { return this.yy = u || this.yy || {}, this._input = h, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this; }, "setInput"), // consumes and returns one char from the input input: /* @__PURE__ */ a(function() { var h = this._input[0]; this.yytext += h, this.yyleng++, this.offset++, this.match += h, this.matched += h; var u = h.match(/(?:\r\n?|\n).*/g); return u ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), h; }, "input"), // unshifts one char (or a string) into the input unput: /* @__PURE__ */ a(function(h) { var u = h.length, x = h.split(/(?:\r\n?|\n)/g); this._input = h + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - u), this.offset -= u; var d = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), x.length - 1 && (this.yylineno -= x.length - 1); var w = this.yylloc.range; return this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: x ? (x.length === d.length ? this.yylloc.first_column : 0) + d[d.length - x.length].length - x[0].length : this.yylloc.first_column - u }, this.options.ranges && (this.yylloc.range = [w[0], w[0] + this.yyleng - u]), this.yyleng = this.yytext.length, this; }, "unput"), // When called from action, caches matched text and appends it on next action more: /* @__PURE__ */ a(function() { return this._more = !0, this; }, "more"), // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject: /* @__PURE__ */ a(function() { if (this.options.backtrack_lexer) this._backtrack = !0; else return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).` + this.showPosition(), { text: "", token: null, line: this.yylineno }); return this; }, "reject"), // retain first n characters of the match less: /* @__PURE__ */ a(function(h) { this.unput(this.match.slice(h)); }, "less"), // displays already matched input, i.e. for error messages pastInput: /* @__PURE__ */ a(function() { var h = this.matched.substr(0, this.matched.length - this.match.length); return (h.length > 20 ? "..." : "") + h.substr(-20).replace(/\n/g, ""); }, "pastInput"), // displays upcoming input, i.e. for error messages upcomingInput: /* @__PURE__ */ a(function() { var h = this.match; return h.length < 20 && (h += this._input.substr(0, 20 - h.length)), (h.substr(0, 20) + (h.length > 20 ? "..." : "")).replace(/\n/g, ""); }, "upcomingInput"), // displays the character position where the lexing error occurred, i.e. for error messages showPosition: /* @__PURE__ */ a(function() { var h = this.pastInput(), u = new Array(h.length + 1).join("-"); return h + this.upcomingInput() + `` + u + "^"; }, "showPosition"), // test the lexed token: return FALSE when not a match, otherwise return token test_match: /* @__PURE__ */ a(function(h, u) { var x, d, w; if (this.options.backtrack_lexer && (w = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }, this.options.ranges && (w.yylloc.range = this.yylloc.range.slice(0))), d = h[0].match(/(?:\r\n?|\n).*/g), d && (this.yylineno += d.length), this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: d ? d[d.length - 1].length - d[d.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + h[0].length }, this.yytext += h[0], this.match += h[0], this.matches = h, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(h[0].length), this.matched += h[0], x = this.performAction.call(this, this.yy, this, u, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), x) return x; if (this._backtrack) { for (var o in w) this[o] = w[o]; return !1; } return !1; }, "test_match"), // return next match in input next: /* @__PURE__ */ a(function() { if (this.done) return this.EOF; this._input || (this.done = !0); var h, u, x, d; this._more || (this.yytext = "", this.match = ""); for (var w = this._currentRules(), o = 0; o < w.length; o++) if (x = this._input.match(this.rules[w[o]]), x && (!u || x[0].length > u[0].length)) { if (u = x, d = o, this.options.backtrack_lexer) { if (h = this.test_match(x, w[o]), h !== !1) return h; if (this._backtrack) { u = !1; continue; } else return !1; } else if (!this.options.flex) break; } return u ? (h = this.test_match(u, w[d]), h !== !1 ? h : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.` + this.showPosition(), { text: "", token: null, line: this.yylineno }); }, "next"), // return next match that has a token lex: /* @__PURE__ */ a(function() { var u = this.next(); return u || this.lex(); }, "lex"), // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin: /* @__PURE__ */ a(function(u) { this.conditionStack.push(u); }, "begin"), // pop the previously active lexer condition state off the condition stack popState: /* @__PURE__ */ a(function() { var u = this.conditionStack.length - 1; return u > 0 ? this.conditionStack.pop() : this.conditionStack[0]; }, "popState"), // produce the lexer rule set which is active for the currently active lexer condition state _currentRules: /* @__PURE__ */ a(function() { return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules; }, "_currentRules"), // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState: /* @__PURE__ */ a(function(u) { return u = this.conditionStack.length - 1 - Math.abs(u || 0), u >= 0 ? this.conditionStack[u] : "INITIAL"; }, "topState"), // alias for begin(condition) pushState: /* @__PURE__ */ a(function(u) { this.begin(u); }, "pushState"), // return the number of states currently on the stack stateStackSize: /* @__PURE__ */ a(function() { return this.conditionStack.length; }, "stateStackSize"), options: { "case-insensitive": !0 }, performAction: /* @__PURE__ */ a(function(u, x, d, w) { switch (d) { case 0: break; case 1: break; case 2: return this.popState(), 34; case 3: return this.popState(), 34; case 4: return 34; case 5: break; case 6: return 10; case 7: return this.pushState("acc_title"), 19; case 8: return this.popState(), "acc_title_value"; case 9: return this.pushState("acc_descr"), 21; case 10: return this.popState(), "acc_descr_value"; case 11: this.pushState("acc_descr_multiline"); break; case 12: this.popState(); break; case 13: return "acc_descr_multiline_value"; case 14: return 5; case 15: return 8; case 16: return this.pushState("axis_data"), "X_AXIS"; case 17: return this.pushState("axis_data"), "Y_AXIS"; case 18: return this.pushState("axis_band_data"), 24; case 19: return 31; case 20: return this.pushState("data"), 16; case 21: return this.pushState("data"), 18; case 22: return this.pushState("data_inner"), 24; case 23: return 27; case 24: return this.popState(), 26; case 25: this.popState(); break; case 26: this.pushState("string"); break; case 27: this.popState(); break; case 28: return "STR"; case 29: return 24; case 30: return 26; case 31: return 43; case 32: return "COLON"; case 33: return 44; case 34: return 28; case 35: return 45; case 36: return 46; case 37: return 48; case 38: return 50; case 39: return 47; case 40: return 41; case 41: return 49; case 42: return 42; case 43: break; case 44: return 35; case 45: return 36; } }, "anonymous"), rules: [/^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:(\r?\n))/i, /^(?:(\r?\n))/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:title\b)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:\{)/i, /^(?:[^\}]*)/i, /^(?:xychart-beta\b)/i, /^(?:(?:vertical|horizontal))/i, /^(?:x-axis\b)/i, /^(?:y-axis\b)/i, /^(?:\[)/i, /^(?:-->)/i, /^(?:line\b)/i, /^(?:bar\b)/i, /^(?:\[)/i, /^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i, /^(?:\])/i, /^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:\[)/i, /^(?:\])/i, /^(?:[A-Za-z]+)/i, /^(?::)/i, /^(?:\+)/i, /^(?:,)/i, /^(?:=)/i, /^(?:\*)/i, /^(?:#)/i, /^(?:[\_])/i, /^(?:\.)/i, /^(?:&)/i, /^(?:-)/i, /^(?:[0-9]+)/i, /^(?:\s+)/i, /^(?:;)/i, /^(?:$)/i], conditions: { data_inner: { rules: [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 }, data: { rules: [0, 1, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 22, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 }, axis_band_data: { rules: [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 24, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 }, axis_data: { rules: [0, 1, 2, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 19, 20, 21, 23, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 }, acc_descr_multiline: { rules: [12, 13], inclusive: !1 }, acc_descr: { rules: [10], inclusive: !1 }, acc_title: { rules: [8], inclusive: !1 }, title: { rules: [], inclusive: !1 }, md_string: { rules: [], inclusive: !1 }, string: { rules: [27, 28], inclusive: !1 }, INITIAL: { rules: [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 20, 21, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], inclusive: !0 } } }; return F; }(); $.lexer = Et; function N() { this.yy = {}; } return a(N, "Parser"), N.prototype = $, $.Parser = N, new N();}();bt.parser = bt;var Ti = bt;function At(e) { return e.type === "bar";}a(At, "isBarPlot");function _t(e) { return e.type === "band";}a(_t, "isBandAxisData");function G(e) { return e.type === "linear";}a(G, "isLinearAxisData");var j, Ht = (j = class { constructor(t) { this.parentGroup = t; } getMaxDimension(t, i) { if (!this.parentGroup) return { width: t.reduce((r, g) => Math.max(g.length, r), 0) * i, height: i }; const s = { width: 0, height: 0 }, n = this.parentGroup.append("g").attr("visibility", "hidden").attr("font-size", i); for (const r of t) { const g = Si(n, 1, r), m = g ? g.width : r.length * i, p = g ? g.height : i; s.width = Math.max(s.width, m), s.height = Math.max(s.height, p); } return n.remove(), s; }}, a(j, "TextDimensionCalculatorWithFont"), j), Ft = 0.7, Ot = 0.2, Q, Ut = (Q = class { constructor(t, i, s, n) { this.axisConfig = t, this.title = i, this.textDimensionCalculator = s, this.axisThemeConfig = n, this.boundingRect = { x: 0, y: 0, width: 0, height: 0 }, this.axisPosition = "left", this.showTitle = !1, this.showLabel = !1, this.showTick = !1, this.showAxisLine = !1, this.outerPadding = 0, this.titleTextHeight = 0, this.labelTextHeight = 0, this.range = [0, 10], this.boundingRect = { x: 0, y: 0, width: 0, height: 0 }, this.axisPosition = "left"; } setRange(t) { this.range = t, this.axisPosition === "left" || this.axisPosition === "right" ? this.boundingRect.height = t[1] - t[0] : this.boundingRect.width = t[1] - t[0], this.recalculateScale(); } getRange() { return [this.range[0] + this.outerPadding, this.range[1] - this.outerPadding]; } setAxisPosition(t) { this.axisPosition = t, this.setRange(this.range); } getTickDistance() { const t = this.getRange(); return Math.abs(t[0] - t[1]) / this.getTickValues().length; } getAxisOuterPadding() { return this.outerPadding; } getLabelDimension() { return this.textDimensionCalculator.getMaxDimension( this.getTickValues().map((t) => t.toString()), this.axisConfig.labelFontSize ); } recalculateOuterPaddingToDrawBar() { Ft * this.getTickDistance() > this.outerPadding * 2 && (this.outerPadding = Math.floor(Ft * this.getTickDistance() / 2)), this.recalculateScale(); } calculateSpaceIfDrawnHorizontally(t) { let i = t.height; if (this.axisConfig.showAxisLine && i > this.axisConfig.axisLineWidth && (i -= this.axisConfig.axisLineWidth, this.showAxisLine = !0), this.axisConfig.showLabel) { const s = this.getLabelDimension(), n = Ot * t.width; this.outerPadding = Math.min(s.width / 2, n); const r = s.height + this.axisConfig.labelPadding * 2; this.labelTextHeight = s.height, r <= i && (i -= r, this.showLabel = !0); } if (this.axisConfig.showTick && i >= this.axisConfig.tickLength && (this.showTick = !0, i -= this.axisConfig.tickLength), this.axisConfig.showTitle && this.title) { const s = this.textDimensionCalculator.getMaxDimension( [this.title], this.axisConfig.titleFontSize ), n = s.height + this.axisConfig.titlePadding * 2; this.titleTextHeight = s.height, n <= i && (i -= n, this.showTitle = !0); } this.boundingRect.width = t.width, this.boundingRect.height = t.height - i; } calculateSpaceIfDrawnVertical(t) { let i = t.width; if (this.axisConfig.showAxisLine && i > this.axisConfig.axisLineWidth && (i -= this.axisConfig.axisLineWidth, this.showAxisLine = !0), this.axisConfig.showLabel) { const s = this.getLabelDimension(), n = Ot * t.height; this.outerPadding = Math.min(s.height / 2, n); const r = s.width + this.axisConfig.labelPadding * 2; r <= i && (i -= r, this.showLabel = !0); } if (this.axisConfig.showTick && i >= this.axisConfig.tickLength && (this.showTick = !0, i -= this.axisConfig.tickLength), this.axisConfig.showTitle && this.title) { const s = this.textDimensionCalculator.getMaxDimension( [this.title], this.axisConfig.titleFontSize ), n = s.height + this.axisConfig.titlePadding * 2; this.titleTextHeight = s.height, n <= i && (i -= n, this.showTitle = !0); } this.boundingRect.width = t.width - i, this.boundingRect.height = t.height; } calculateSpace(t) { return this.axisPosition === "left" || this.axisPosition === "right" ? this.calculateSpaceIfDrawnVertical(t) : this.calculateSpaceIfDrawnHorizontally(t), this.recalculateScale(), { width: this.boundingRect.width, height: this.boundingRect.height }; } setBoundingBoxXY(t) { this.boundingRect.x = t.x, this.boundingRect.y = t.y; } getDrawableElementsForLeftAxis() { const t = []; if (this.showAxisLine) { const i = this.boundingRect.x + this.boundingRect.width - this.axisConfig.axisLineWidth / 2; t.push({ type: "path", groupTexts: ["left-axis", "axisl-line"], data: [ { path: `M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y + this.boundingRect.height} `, strokeFill: this.axisThemeConfig.axisLineColor, strokeWidth: this.axisConfig.axisLineWidth } ] }); } if (this.showLabel && t.push({ type: "text", groupTexts: ["left-axis", "label"], data: this.getTickValues().map((i) => ({ text: i.toString(), x: this.boundingRect.x + this.boundingRect.width - (this.showLabel ? this.axisConfig.labelPadding : 0) - (this.showTick ? this.axisConfig.tickLength : 0) - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0), y: this.getScaleValue(i), fill: this.axisThemeConfig.labelColor, fontSize: this.axisConfig.labelFontSize, rotation: 0, verticalPos: "middle", horizontalPos: "right" })) }), this.showTick) { const i = this.boundingRect.x + this.boundingRect.width - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0); t.push({ type: "path", groupTexts: ["left-axis", "ticks"], data: this.getTickValues().map((s) => ({ path: `M ${i},${this.getScaleValue(s)} L ${i - this.axisConfig.tickLength},${this.getScaleValue(s)}`, strokeFill: this.axisThemeConfig.tickColor, strokeWidth: this.axisConfig.tickWidth })) }); } return this.showTitle && t.push({ type: "text", groupTexts: ["left-axis", "title"], data: [ { text: this.title, x: this.boundingRect.x + this.axisConfig.titlePadding, y: this.boundingRect.y + this.boundingRect.height / 2, fill: this.axisThemeConfig.titleColor, fontSize: this.axisConfig.titleFontSize, rotation: 270, verticalPos: "top", horizontalPos: "center" } ] }), t; } getDrawableElementsForBottomAxis() { const t = []; if (this.showAxisLine) { const i = this.boundingRect.y + this.axisConfig.axisLineWidth / 2; t.push({ type: "path", groupTexts: ["bottom-axis", "axis-line"], data: [ { path: `M ${this.boundingRect.x},${i} L ${this.boundingRect.x + this.boundingRect.width},${i}`, strokeFill: this.axisThemeConfig.axisLineColor, strokeWidth: this.axisConfig.axisLineWidth } ] }); } if (this.showLabel && t.push({ type: "text", groupTexts: ["bottom-axis", "label"], data: this.getTickValues().map((i) => ({ text: i.toString(), x: this.getScaleValue(i), y: this.boundingRect.y + this.axisConfig.labelPadding + (this.showTick ? this.axisConfig.tickLength : 0) + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0), fill: this.axisThemeConfig.labelColor, fontSize: this.axisConfig.labelFontSize, rotation: 0, verticalPos: "top", horizontalPos: "center" })) }), this.showTick) { const i = this.boundingRect.y + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0); t.push({ type: "path", groupTexts: ["bottom-axis", "ticks"], data: this.getTickValues().map((s) => ({ path: `M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i + this.axisConfig.tickLength}`, strokeFill: this.axisThemeConfig.tickColor, strokeWidth: this.axisConfig.tickWidth })) }); } return this.showTitle && t.push({ type: "text", groupTexts: ["bottom-axis", "title"], data: [ { text: this.title, x: this.range[0] + (this.range[1] - this.range[0]) / 2, y: this.boundingRect.y + this.boundingRect.height - this.axisConfig.titlePadding - this.titleTextHeight, fill: this.axisThemeConfig.titleColor, fontSize: this.axisConfig.titleFontSize, rotation: 0, verticalPos: "top", horizontalPos: "center" } ] }), t; } getDrawableElementsForTopAxis() { const t = []; if (this.showAxisLine) { const i = this.boundingRect.y + this.boundingRect.height - this.axisConfig.axisLineWidth / 2; t.push({ type: "path", groupTexts: ["top-axis", "axis-line"], data: [ { path: `M ${this.boundingRect.x},${i} L ${this.boundingRect.x + this.boundingRect.width},${i}`, strokeFill: this.axisThemeConfig.axisLineColor, strokeWidth: this.axisConfig.axisLineWidth } ] }); } if (this.showLabel && t.push({ type: "text", groupTexts: ["top-axis", "label"], data: this.getTickValues().map((i) => ({ text: i.toString(), x: this.getScaleValue(i), y: this.boundingRect.y + (this.showTitle ? this.titleTextHeight + this.axisConfig.titlePadding * 2 : 0) + this.axisConfig.labelPadding, fill: this.axisThemeConfig.labelColor, fontSize: this.axisConfig.labelFontSize, rotation: 0, verticalPos: "top", horizontalPos: "center" })) }), this.showTick) { const i = this.boundingRect.y; t.push({ type: "path", groupTexts: ["top-axis", "ticks"], data: this.getTickValues().map((s) => ({ path: `M ${this.getScaleValue(s)},${i + this.boundingRect.height - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0)} L ${this.getScaleValue(s)},${i + this.boundingRect.height - this.axisConfig.tickLength - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0)}`, strokeFill: this.axisThemeConfig.tickColor, strokeWidth: this.axisConfig.tickWidth })) }); } return this.showTitle && t.push({ type: "text", groupTexts: ["top-axis", "title"], data: [ { text: this.title, x: this.boundingRect.x + this.boundingRect.width / 2, y: this.boundingRect.y + this.axisConfig.titlePadding, fill: this.axisThemeConfig.titleColor, fontSize: this.axisConfig.titleFontSize, rotation: 0, verticalPos: "top", horizontalPos: "center" } ] }), t; } getDrawableElements() { if (this.axisPosition === "left") return this.getDrawableElementsForLeftAxis(); if (this.axisPosition === "right") throw Error("Drawing of right axis is not implemented"); return this.axisPosition === "bottom" ? this.getDrawableElementsForBottomAxis() : this.axisPosition === "top" ? this.getDrawableElementsForTopAxis() : []; }}, a(Q, "BaseAxis"), Q), K, Di = (K = class extends Ut { constructor(t, i, s, n, r) { super(t, n, r, i), this.categories = s, this.scale = yt().domain(this.categories).range(this.getRange()); } setRange(t) { super.setRange(t); } recalculateScale() { this.scale = yt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5), Nt.trace("BandAxis axis final categories, range: ", this.categories, this.getRange()); } getTickValues() { return this.categories; } getScaleValue(t) { return this.scale(t) ?? this.getRange()[0]; }}, a(K, "BandAxis"), K), Z, vi = (Z = class extends Ut { constructor(t, i, s, n, r) { super(t, n, r, i), this.domain = s, this.scale = zt().domain(this.domain).range(this.getRange()); } getTickValues() { return this.scale.ticks(); } recalculateScale() { const t = [...this.domain]; this.axisPosition === "left" && t.reverse(), this.scale = zt().domain(t).range(this.getRange()); } getScaleValue(t) { return this.scale(t); }}, a(Z, "LinearAxis"), Z);function wt(e, t, i, s) { const n = new Ht(s); return _t(e) ? new Di( t, i, e.categories, e.title, n ) : new vi( t, i, [e.min, e.max], e.title, n );}a(wt, "getAxis");var J, Pi = (J = class { constructor(t, i, s, n) { this.textDimensionCalculator = t, this.chartConfig = i, this.chartData = s, this.chartThemeConfig = n, this.boundingRect = { x: 0, y: 0, width: 0, height: 0 }, this.showChartTitle = !1; } setBoundingBoxXY(t) { this.boundingRect.x = t.x, this.boundingRect.y = t.y; } calculateSpace(t) { const i = this.textDimensionCalculator.getMaxDimension( [this.chartData.title], this.chartConfig.titleFontSize ), s = Math.max(i.width, t.width), n = i.height + 2 * this.chartConfig.titlePadding; return i.width <= s && i.height <= n && this.chartConfig.showTitle && this.chartData.title && (this.boundingRect.width = s, this.boundingRect.height = n, this.showChartTitle = !0), { width: this.boundingRect.width, height: this.boundingRect.height }; } getDrawableElements() { const t = []; return this.showChartTitle && t.push({ groupTexts: ["chart-title"], type: "text", data: [ { fontSize: this.chartConfig.titleFontSize, text: this.chartData.title, verticalPos: "middle", horizontalPos: "center", x: this.boundingRect.x + this.boundingRect.width / 2, y: this.boundingRect.y + this.boundingRect.height / 2, fill: this.chartThemeConfig.titleColor, rotation: 0 } ] }), t; }}, a(J, "ChartTitle"), J);function $t(e, t, i, s) { const n = new Ht(s); return new Pi(n, e, t, i);}a($t, "getChartTitleComponent");var tt, Li = (tt = class { constructor(t, i, s, n, r) { this.plotData = t, this.xAxis = i, this.yAxis = s, this.orientation = n, this.plotIndex = r; } getDrawableElement() { const t = this.plotData.data.map((s) => [ this.xAxis.getScaleValue(s[0]), this.yAxis.getScaleValue(s[1]) ]); let i; return this.orientation === "horizontal" ? i = Wt().y((s) => s[0]).x((s) => s[1])(t) : i = Wt().x((s) => s[0]).y((s) => s[1])(t), i ? [ { groupTexts: ["plot", `line-plot-${this.plotIndex}`], type: "path", data: [ { path: i, strokeFill: this.plotData.strokeFill, strokeWidth: this.plotData.strokeWidth } ] } ] : []; }}, a(tt, "LinePlot"), tt), it, Ei = (it = class { constructor(t, i, s, n, r, g) { this.barData = t, this.boundingRect = i, this.xAxis = s, this.yAxis = n, this.orientation = r, this.plotIndex = g; } getDrawableElement() { const t = this.barData.data.map((r) => [ this.xAxis.getScaleValue(r[0]), this.yAxis.getScaleValue(r[1]) ]), s = Math.min(this.xAxis.getAxisOuterPadding() * 2, this.xAxis.getTickDistance()) * (1 - 0.05), n = s / 2; return this.orientation === "horizontal" ? [ { groupTexts: ["plot", `bar-plot-${this.plotIndex}`], type: "rect", data: t.map((r) => ({ x: this.boundingRect.x, y: r[0] - n, height: s, width: r[1] - this.boundingRect.x, fill: this.barData.fill, strokeWidth: 0, strokeFill: this.barData.fill })) } ] : [ { groupTexts: ["plot", `bar-plot-${this.plotIndex}`], type: "rect", data: t.map((r) => ({ x: r[0] - n, y: r[1], width: s, height: this.boundingRect.y + this.boundingRect.height - r[1], fill: this.barData.fill, strokeWidth: 0, strokeFill: this.barData.fill })) } ]; }}, a(it, "BarPlot"), it), et, Ii = (et = class { constructor(t, i, s) { this.chartConfig = t, this.chartData = i, this.chartThemeConfig = s, this.boundingRect = { x: 0, y: 0, width: 0, height: 0 }; } setAxes(t, i) { this.xAxis = t, this.yAxis = i; } setBoundingBoxXY(t) { this.boundingRect.x = t.x, this.boundingRect.y = t.y; } calculateSpace(t) { return this.boundingRect.width = t.width, this.boundingRect.height = t.height, { width: this.boundingRect.width, height: this.boundingRect.height }; } getDrawableElements() { if (!(this.xAxis && this.yAxis)) throw Error("Axes must be passed to render Plots"); const t = []; for (const [i, s] of this.chartData.plots.entries()) switch (s.type) { case "line": { const n = new Li( s, this.xAxis, this.yAxis, this.chartConfig.chartOrientation, i ); t.push(...n.getDrawableElement()); } break; case "bar": { const n = new Ei( s, this.boundingRect, this.xAxis, this.yAxis, this.chartConfig.chartOrientation, i ); t.push(...n.getDrawableElement()); } break; } return t; }}, a(et, "BasePlot"), et);function qt(e, t, i) { return new Ii(e, t, i);}a(qt, "getPlotComponent");var st, Mi = (st = class { constructor(t, i, s, n) { this.chartConfig = t, this.chartData = i, this.componentStore = { title: $t(t, i, s, n), plot: qt(t, i, s), xAxis: wt( i.xAxis, t.xAxis, { titleColor: s.xAxisTitleColor, labelColor: s.xAxisLabelColor, tickColor: s.xAxisTickColor, axisLineColor: s.xAxisLineColor }, n ), yAxis: wt( i.yAxis, t.yAxis, { titleColor: s.yAxisTitleColor, labelColor: s.yAxisLabelColor, tickColor: s.yAxisTickColor, axisLineColor: s.yAxisLineColor }, n ) }; } calculateVerticalSpace() { let t = this.chartConfig.width, i = this.chartConfig.height, s = 0, n = 0, r = Math.floor(t * this.chartConfig.plotReservedSpacePercent / 100), g = Math.floor( i * this.chartConfig.plotReservedSpacePercent / 100 ), m = this.componentStore.plot.calculateSpace({ width: r, height: g }); t -= m.width, i -= m.height, m = this.componentStore.title.calculateSpace({ width: this.chartConfig.width, height: i }), n = m.height, i -= m.height, this.componentStore.xAxis.setAxisPosition("bottom"), m = this.componentStore.xAxis.calculateSpace({ width: t, height: i }), i -= m.height, this.componentStore.yAxis.setAxisPosition("left"), m = this.componentStore.yAxis.calculateSpace({ width: t, height: i }), s = m.width, t -= m.width, t > 0 && (r += t, t = 0), i > 0 && (g += i, i = 0), this.componentStore.plot.calculateSpace({ width: r, height: g }), this.componentStore.plot.setBoundingBoxXY({ x: s, y: n }), this.componentStore.xAxis.setRange([s, s + r]), this.componentStore.xAxis.setBoundingBoxXY({ x: s, y: n + g }), this.componentStore.yAxis.setRange([n, n + g]), this.componentStore.yAxis.setBoundingBoxXY({ x: 0, y: n }), this.chartData.plots.some((p) => At(p)) && this.componentStore.xAxis.recalculateOuterPaddingToDrawBar(); } calculateHorizontalSpace() { let t = this.chartConfig.width, i = this.chartConfig.height, s = 0, n = 0, r = 0, g = Math.floor(t * this.chartConfig.plotReservedSpacePercent / 100), m = Math.floor( i * this.chartConfig.plotReservedSpacePercent / 100 ), p = this.componentStore.plot.calculateSpace({ width: g, height: m }); t -= p.width, i -= p.height, p = this.componentStore.title.calculateSpace({ width: this.chartConfig.width, height: i }), s = p.height, i -= p.height, this.componentStore.xAxis.setAxisPosition("left"), p = this.componentStore.xAxis.calculateSpace({ width: t, height: i }), t -= p.width, n = p.width, this.componentStore.yAxis.setAxisPosition("top"), p = this.componentStore.yAxis.calculateSpace({ width: t, height: i }), i -= p.height, r = s + p.height, t > 0 && (g += t, t = 0), i > 0 && (m += i, i = 0), this.componentStore.plot.calculateSpace({ width: g, height: m }), this.componentStore.plot.setBoundingBoxXY({ x: n, y: r }), this.componentStore.yAxis.setRange([n, n + g]), this.componentStore.yAxis.setBoundingBoxXY({ x: n, y: s }), this.componentStore.xAxis.setRange([r, r + m]), this.componentStore.xAxis.setBoundingBoxXY({ x: 0, y: r }), this.chartData.plots.some((k) => At(k)) && this.componentStore.xAxis.recalculateOuterPaddingToDrawBar(); } calculateSpace() { this.chartConfig.chartOrientation === "horizontal" ? this.calculateHorizontalSpace() : this.calculateVerticalSpace(); } getDrawableElement() { this.calculateSpace(); const t = []; this.componentStore.plot.setAxes(this.componentStore.xAxis, this.componentStore.yAxis); for (const i of Object.values(this.componentStore)) t.push(...i.getDrawableElements()); return t; }}, a(st, "Orchestrator"), st), nt, Vi = (nt = class { static build(t, i, s, n) { return new Mi(t, i, s, n).getDrawableElement(); }}, a(nt, "XYChartBuilder"), nt), ot = 0, Gt, rt = Tt(), ht = Rt(), A = Dt(), Ct = ht.plotColorPalette.split(",").map((e) => e.trim()), gt = !1, kt = !1;function Rt() { const e = wi(), t = St(); return Yt(e.xyChart, t.themeVariables.xyChart);}a(Rt, "getChartDefaultThemeConfig");function Tt() { const e = St(); return Yt( Ai.xyChart, e.xyChart );}a(Tt, "getChartDefaultConfig");function Dt() { return { yAxis: { type: "linear", title: "", min: 1 / 0, max: -1 / 0 }, xAxis: { type: "band", title: "", categories: [] }, title: "", plots: [] };}a(Dt, "getChartDefaultData");function xt(e) { const t = St(); return Ci(e.trim(), t);}a(xt, "textSanitizer");function jt(e) { Gt = e;}a(jt, "setTmpSVGG");function Qt(e) { e === "horizontal" ? rt.chartOrientation = "horizontal" : rt.chartOrientation = "vertical";}a(Qt, "setOrientation");function Kt(e) { A.xAxis.title = xt(e.text);}a(Kt, "setXAxisTitle");function vt(e, t) { A.xAxis = { type: "linear", title: A.xAxis.title, min: e, max: t }, gt = !0;}a(vt, "setXAxisRangeData");function Zt(e) { A.xAxis = { type: "band", title: A.xAxis.title, categories: e.map((t) => xt(t.text)) }, gt = !0;}a(Zt, "setXAxisBand");function Jt(e) { A.yAxis.title = xt(e.text);}a(Jt, "setYAxisTitle");function ti(e, t) { A.yAxis = { type: "linear", title: A.yAxis.title, min: e, max: t }, kt = !0;}a(ti, "setYAxisRangeData");function ii(e) { const t = Math.min(...e), i = Math.max(...e), s = G(A.yAxis) ? A.yAxis.min : 1 / 0, n = G(A.yAxis) ? A.yAxis.max : -1 / 0; A.yAxis = { type: "linear", title: A.yAxis.title, min: Math.min(s, t), max: Math.max(n, i) };}a(ii, "setYAxisRangeFromPlotData");function Pt(e) { let t = []; if (e.length === 0) return t; if (!gt) { const i = G(A.xAxis) ? A.xAxis.min : 1 / 0, s = G(A.xAxis) ? A.xAxis.max : -1 / 0; vt(Math.min(i, 1), Math.max(s, e.length)); } if (kt || ii(e), _t(A.xAxis) && (t = A.xAxis.categories.map((i, s) => [i, e[s]])), G(A.xAxis)) { const i = A.xAxis.min, s = A.xAxis.max, n = (s - i) / (e.length - 1), r = []; for (let g = i; g <= s; g += n) r.push(`${g}`); t = r.map((g, m) => [g, e[m]]); } return t;}a(Pt, "transformDataWithoutCategory");function Lt(e) { return Ct[e === 0 ? 0 : e % Ct.length];}a(Lt, "getPlotColorFromPalette");function ei(e, t) { const i = Pt(t); A.plots.push({ type: "line", strokeFill: Lt(ot), strokeWidth: 2, data: i }), ot++;}a(ei, "setLineData");function si(e, t) { const i = Pt(t); A.plots.push({ type: "bar", fill: Lt(ot), data: i }), ot++;}a(si, "setBarData");function ni() { if (A.plots.length === 0) throw Error("No Plot to render, please provide a plot with some data"); return A.title = Xt(), Vi.build(rt, A, ht, Gt);}a(ni, "getDrawableElem");function ai() { return ht;}a(ai, "getChartThemeConfig");function oi() { return rt;}a(oi, "getChartConfig");function ri() { return A;}a(ri, "getXYChartData");var Bi = /* @__PURE__ */ a(function() { bi(), ot = 0, rt = Tt(), A = Dt(), ht = Rt(), Ct = ht.plotColorPalette.split(",").map((e) => e.trim()), gt = !1, kt = !1;}, "clear"), Wi = { getDrawableElem: ni, clear: Bi, setAccTitle: pi, getAccTitle: fi, setDiagramTitle: di, getDiagramTitle: Xt, getAccDescription: xi, setAccDescription: gi, setOrientation: Qt, setXAxisTitle: Kt, setXAxisRangeData: vt, setXAxisBand: Zt, setYAxisTitle: Jt, setYAxisRangeData: ti, setLineData: ei, setBarData: si, setTmpSVGG: jt, getChartThemeConfig: ai, getChartConfig: oi, getXYChartData: ri}, zi = /* @__PURE__ */ a((e, t, i, s) => { const n = s.db, r = n.getChartThemeConfig(), g = n.getChartConfig(), m = n.getXYChartData().plots[0].data.map((y) => y[1]); function p(y) { return y === "top" ? "text-before-edge" : "middle"; } a(p, "getDominantBaseLine"); function k(y) { return y === "left" ? "start" : y === "right" ? "end" : "middle"; } a(k, "getTextAnchor"); function v(y) { return `translate(${y.x}, ${y.y}) rotate(${y.rotation || 0})`; } a(v, "getTextTransformation"), Nt.debug(`Rendering xychart chart` + e); const C = mi(t), b = C.append("g").attr("class", "main"), E = b.append("rect").attr("width", g.width).attr("height", g.height).attr("class", "background"); yi(C, g.height, g.width, !0), C.attr("viewBox", `0 0 ${g.width} ${g.height}`), E.attr("fill", r.backgroundColor), n.setTmpSVGG(C.append("g").attr("class", "mermaid-tmp-group")); const D = n.getDrawableElem(), P = {}; function I(y) { let _ = b, c = ""; for (const [W] of y.entries()) { let z = b; W > 0 && P[c] && (z = P[c]), c += y[W], _ = P[c], _ || (_ = P[c] = z.append("g").attr("class", y[W])); } return _; } a(I, "getGroup"); for (const y of D) { if (y.data.length === 0) continue; const _ = I(y.groupTexts); switch (y.type) { case "rect": if (_.selectAll("rect").data(y.data).enter().append("rect").attr("x", (c) => c.x).attr("y", (c) => c.y).attr("width", (c) => c.width).attr("height", (c) => c.height).attr("fill", (c) => c.fill).attr("stroke", (c) => c.strokeFill).attr("stroke-width", (c) => c.strokeWidth), g.showDataLabel) if (g.chartOrientation === "horizontal") { let c = function(l, L) { const { data: S, label: R } = l; return L * R.length * W <= S.width - 10; }; a(c, "fitsHorizontally"); const W = 0.7, z = y.data.map((l, L) => ({ data: l, label: m[L].toString() })).filter((l) => l.data.width > 0 && l.data.height > 0), U = z.map((l) => { const { data: L } = l; let S = L.height * 0.7; for (; !c(l, S) && S > 0; ) S -= 1; return S; }), X = Math.floor(Math.min(...U)); _.selectAll("text").data(z).enter().append("text").attr("x", (l) => l.data.x + l.data.width - 10).attr("y", (l) => l.data.y + l.data.height / 2).attr("text-anchor", "end").attr("dominant-baseline", "middle").attr("fill", "black").attr("font-size", `${X}px`).text((l) => l.label); } else { let c = function(l, L, S) { const { data: R, label: $ } = l, N = L * $.length * 0.7, F = R.x + R.width / 2, h = F - N / 2, u = F + N / 2, x = h >= R.x && u <= R.x + R.width, d = R.y + S + L <= R.y + R.height; return x && d; }; a(c, "fitsInBar"); const W = 10, z = y.data.map((l, L) => ({ data: l, label: m[L].toString() })).filter((l) => l.data.width > 0 && l.data.height > 0), U = z.map((l) => { const { data: L, label: S } = l; let R = L.width / (S.length * 0.7); for (; !c(l, R, W) && R > 0; ) R -= 1; return R; }), X = Math.floor(Math.min(...U)); _.selectAll("text").data(z).enter().append("text").attr("x", (l) => l.data.x + l.data.width / 2).attr("y", (l) => l.data.y + W).attr("text-anchor", "middle").attr("dominant-baseline", "hanging").attr("fill", "black").attr("font-size", `${X}px`).text((l) => l.label); } break; case "text": _.selectAll("text").data(y.data).enter().append("text").attr("x", 0).attr("y", 0).attr("fill", (c) => c.fill).attr("font-size", (c) => c.fontSize).attr("dominant-baseline", (c) => p(c.verticalPos)).attr("text-anchor", (c) => k(c.horizontalPos)).attr("transform", (c) => v(c)).text((c) => c.text); break; case "path": _.selectAll("path").data(y.data).enter().append("path").attr("d", (c) => c.path).attr("fill", (c) => c.fill ? c.fill : "none").attr("stroke", (c) => c.strokeFill).attr("stroke-width", (c) => c.strokeWidth); break; } }}, "draw"), Fi = { draw: zi}, Hi = { parser: Ti, db: Wi, renderer: Fi};export { Hi as diagram};1 unmodified line23456789101110 unmodified lines222324252627282915 unmodified lines45464748495051525354553 unmodified lines59606162636417 unmodified lines82838485868788893 unmodified lines939495969798998 unmodified lines1081091101111121131141 unmodified line# backend/tokenizer_playground/__init__.py#from __future__ import annotationsfrom typing import Any, Callable, Literal, Sequencefrom gradio.components.base import Component, FormComponentfrom gradio.events import Eventsclass TokenizerTextBox(FormComponent):"""10 unmodified lines# Custom parameters for this componentmodel: str = "Xenova/gpt-3",display_mode: Literal['text', 'token_ids', 'hidden'] = 'text',# Textbox-like props that are passed to the frontendlines: int = 2,max_lines: int | None = None,placeholder: str | None = None,15 unmodified linesinteractive: bool | None = None,visible: bool = True,elem_id: str | None = None,elem_classes: list[str] | str | None = None,# ** THE DEFINITIVE FIX IS HERE **# This accepts any other keyword arguments (like 'render') that Gradio# might pass internally, preventing a TypeError.**kwargs,):"""3 unmodified linesvalue: 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: The name of a Hugging Face tokenizer to use (must be compatible with Transformers.js). Defaults to "Xenova/gpt-2".display_mode: Controls the content of the token visualization panel. Can be 'text' (default), 'token_ids', or 'hidden'.lines: The minimum number of line rows for the textarea.max_lines: The maximum number of line rows for the textarea.placeholder: A placeholder hint to display in the textarea when it is empty.17 unmodified lines"""# Store all the custom/frontend-specific props on the instance.# Gradio will automatically pass these to the Svelte component.self.model = modelself.display_mode = display_modeself.lines = linesself.max_lines = max_linesself.placeholder = placeholder3 unmodified linesself.rtl = rtlself.show_copy_button = show_copy_buttonself.max_length = max_length# Call the parent constructor with ONLY the arguments it expects,# plus the catch-all kwargs.super().__init__(8 unmodified linesvisible=visible,elem_id=elem_id,elem_classes=elem_classes,value=value,**kwargs, # Pass any extra arguments up the chain.)1 unmodified line2345678910111210 unmodified lines2324252627282915 unmodified lines45464748495051523 unmodified lines5657585960616217 unmodified lines80818283848586878889903 unmodified lines9495969798991008 unmodified lines1091101111121131141151 unmodified line# backend/tokenizer_playground/__init__.py#from __future__ import annotationsfrom typing import Any, Callable, List, Literal, Sequencefrom gradio.components.base import Component, FormComponentfrom gradio.events import Eventsimport gradio as grclass TokenizerTextBox(FormComponent):"""10 unmodified lines# Custom parameters for this componentmodel: str = "Xenova/gpt-3",display_mode: Literal['text', 'token_ids', 'hidden'] = 'text',hide_input: bool = False,lines: int = 2,max_lines: int | None = None,placeholder: str | None = None,15 unmodified linesinteractive: bool | None = None,visible: bool = True,elem_id: str | None = None,elem_classes: list[str] | str | None = None,**kwargs,):"""3 unmodified linesvalue: 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: The name of a Hugging Face tokenizer to use (must be compatible with Transformers.js). Defaults to "Xenova/gpt-2".display_mode: Controls the content of the token visualization panel. Can be 'text' (default), 'token_ids', or 'hidden'.hide_input: If True, the component's own textbox is hidden, turning it into a read-only visualizer. Defaults to False.lines: The minimum number of line rows for the textarea.max_lines: The maximum number of line rows for the textarea.placeholder: A placeholder hint to display in the textarea when it is empty.17 unmodified lines"""# Store all the custom/frontend-specific props on the instance.# Gradio will automatically pass these to the Svelte component.self.model = modelself.display_mode = display_modeself.hide_input = hide_inputself.lines = linesself.max_lines = max_linesself.placeholder = placeholder3 unmodified linesself.rtl = rtlself.show_copy_button = show_copy_buttonself.max_length = max_length# Call the parent constructor with ONLY the arguments it expects,# plus the catch-all kwargs.super().__init__(8 unmodified linesvisible=visible,elem_id=elem_id,elem_classes=elem_classes,value=value,**kwargs, # Pass any extra arguments up the chain.)
README.md+77-43
app.py+62-40
space.py+65-44
src/README.md+77-43
src/backend/gradio_tokenizertextbox/templates/component/Index-DlSje_b9.jsAdded
src/backend/gradio_tokenizertextbox/templates/component/_basePickBy-DxXFlUZa.jsAdded+151
src/backend/gradio_tokenizertextbox/templates/component/_baseUniq-BzpV2HJ8.jsAdded+614
src/backend/gradio_tokenizertextbox/templates/component/arc-BVd80oSb.jsAdded+83
src/backend/gradio_tokenizertextbox/templates/component/architectureDiagram-KYWUMXXP-y3e3xZON.jsAdded
src/backend/gradio_tokenizertextbox/templates/component/blockDiagram-ZUX3OVTL-CZ3LKPly.jsAdded
src/backend/gradio_tokenizertextbox/templates/component/c4Diagram-E5VUS4TQ-CaEITEwB.jsAdded+1581
src/backend/gradio_tokenizertextbox/templates/component/channel-DjI12Op-.jsAdded+5
src/backend/gradio_tokenizertextbox/templates/component/chunk-44GW5IO5-Ohm2b7Vh.jsAdded+9
src/backend/gradio_tokenizertextbox/templates/component/chunk-BQPDZTM5-D5dg_mRt.jsAdded+15
src/backend/gradio_tokenizertextbox/templates/component/chunk-GOYUR5SG-D3cGQmyD.jsAdded+1381
src/backend/gradio_tokenizertextbox/templates/component/chunk-HPOVUXKZ-C_XOradn.jsAdded+24
src/backend/gradio_tokenizertextbox/templates/component/chunk-UIWBPB2F-muaaSQOG.jsAdded+19
src/backend/gradio_tokenizertextbox/templates/component/chunk-WZLT4MVT-CfJwH0hJ.jsAdded+64
src/backend/gradio_tokenizertextbox/templates/component/chunk-YQZZRAKN-BQvCB-Ut.jsAdded+1374
src/backend/gradio_tokenizertextbox/templates/component/classDiagram-EGQPL23Y-CDUQ2UUi.jsAdded+16
src/backend/gradio_tokenizertextbox/templates/component/classDiagram-v2-4EBKGCBT-CDUQ2UUi.jsAdded+16
src/backend/gradio_tokenizertextbox/templates/component/clone-CnKi__lm.jsAdded+8
src/backend/gradio_tokenizertextbox/templates/component/dagre-IE2X5DAH-CV8zgPsh.jsAdded+447
src/backend/gradio_tokenizertextbox/templates/component/diagram-3XXCIKAB-BVOFKcL7.jsAdded+137
src/backend/gradio_tokenizertextbox/templates/component/diagram-DTTGSU4T-CnP9lnn0.jsAdded+221
src/backend/gradio_tokenizertextbox/templates/component/erDiagram-FWMTN743-DTpuosUL.jsAdded+841
src/backend/gradio_tokenizertextbox/templates/component/flowDiagram-OUUYVNGO-Cez2328G.jsAdded+1626
src/backend/gradio_tokenizertextbox/templates/component/ganttDiagram-Y4ZJHTSR-Ck1BJGQb.jsAdded+2502
src/backend/gradio_tokenizertextbox/templates/component/gitGraphDiagram-SOPYED2O-PDatxHXu.jsAdded+712
src/backend/gradio_tokenizertextbox/templates/component/graph-BH65arkC.jsAdded+247
src/backend/gradio_tokenizertextbox/templates/component/index.js+2-4
src/backend/gradio_tokenizertextbox/templates/component/infoDiagram-LZPS564M-2uptqD23.jsAdded+24
src/backend/gradio_tokenizertextbox/templates/component/journeyDiagram-KRBQ73NG-CZZ_CkVX.jsAdded+836
src/backend/gradio_tokenizertextbox/templates/component/kanban-definition-TWHLSRP4-DQIVe-hm.jsAdded+720
src/backend/gradio_tokenizertextbox/templates/component/layout-GrosxRhM.jsAdded+1324
src/backend/gradio_tokenizertextbox/templates/component/linear-Cg721pVl.jsAdded+423
src/backend/gradio_tokenizertextbox/templates/component/mermaid.core-BiIw1_mh.jsAdded
src/backend/gradio_tokenizertextbox/templates/component/mindmap-definition-RDSO3R44-BUcceq1V.jsAdded
src/backend/gradio_tokenizertextbox/templates/component/pieDiagram-JVH3GP2A-DdZH_LOx.jsAdded+161
src/backend/gradio_tokenizertextbox/templates/component/quadrantDiagram-2GFVJBMM-Caah2B__.jsAdded+1024
src/backend/gradio_tokenizertextbox/templates/component/radar-VG2SY3DT-DUR9h7DO.jsAdded
src/backend/gradio_tokenizertextbox/templates/component/requirementDiagram-PBTKI7ZP-BUGizFns.jsAdded+851
src/backend/gradio_tokenizertextbox/templates/component/sankeyDiagram-XYA53EP7-Ur5hCpvv.jsAdded+808
src/backend/gradio_tokenizertextbox/templates/component/sequenceDiagram-BLN7LXEI-BVLAQ6AC.jsAdded
src/backend/gradio_tokenizertextbox/templates/component/stateDiagram-WEXRT5W7-jKdDOUmm.jsAdded+263
src/backend/gradio_tokenizertextbox/templates/component/stateDiagram-v2-SNKRMT2F-8WDcIQDb.jsAdded+16
src/backend/gradio_tokenizertextbox/templates/component/style.css
src/backend/gradio_tokenizertextbox/templates/component/timeline-definition-GH3MJCYT-GQFW3CL1.jsAdded+801
src/backend/gradio_tokenizertextbox/templates/component/xychartDiagram-4SJQ7YKO-TYaDtL9j.jsAdded+1338
src/backend/gradio_tokenizertextbox/tokenizertextbox.py+12-11