elismasilva commited on
Commit
cfd8dea
·
verified ·
1 Parent(s): de57a9e

Upload folder using huggingface_hub

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitignore +14 -0
  2. README.md +488 -12
  3. __init__.py +0 -0
  4. app.py +100 -0
  5. css.css +157 -0
  6. requirements.txt +1 -0
  7. space.py +226 -0
  8. src/.gitignore +14 -0
  9. src/.vscode/launch.json +29 -0
  10. src/README.md +488 -0
  11. src/backend/gradio_dropdownplus/__init__.py +4 -0
  12. src/backend/gradio_dropdownplus/dropdownplus.py +253 -0
  13. src/backend/gradio_dropdownplus/templates/component/Index-v4MoKD9K.js +0 -0
  14. src/backend/gradio_dropdownplus/templates/component/_basePickBy-BbJ7hQvb.js +151 -0
  15. src/backend/gradio_dropdownplus/templates/component/_baseUniq-CMmoTQ8t.js +614 -0
  16. src/backend/gradio_dropdownplus/templates/component/arc-C-Ik2gwm.js +83 -0
  17. src/backend/gradio_dropdownplus/templates/component/architectureDiagram-KFL7JDKH-C-2X1Z0P.js +0 -0
  18. src/backend/gradio_dropdownplus/templates/component/auto-render-BwaQGe8P.js +127 -0
  19. src/backend/gradio_dropdownplus/templates/component/blockDiagram-ZYB65J3Q-z8G70kQc.js +0 -0
  20. src/backend/gradio_dropdownplus/templates/component/c4Diagram-AAMF2YG6-D6LTjEDm.js +1581 -0
  21. src/backend/gradio_dropdownplus/templates/component/channel-B27Nc4fx.js +5 -0
  22. src/backend/gradio_dropdownplus/templates/component/chunk-ANTBXLJU-CuGo78t3.js +9 -0
  23. src/backend/gradio_dropdownplus/templates/component/chunk-FHKO5MBM-BsqpKj2V.js +15 -0
  24. src/backend/gradio_dropdownplus/templates/component/chunk-GLLZNHP4-BcJ3UCJy.js +19 -0
  25. src/backend/gradio_dropdownplus/templates/component/chunk-JBRWN2VN-D4EODkTC.js +1376 -0
  26. src/backend/gradio_dropdownplus/templates/component/chunk-LXBSTHXV-CND5eoRw.js +1382 -0
  27. src/backend/gradio_dropdownplus/templates/component/chunk-NRVI72HA-EajhWFFL.js +20 -0
  28. src/backend/gradio_dropdownplus/templates/component/chunk-OMD6QJNC-dXofsL9p.js +64 -0
  29. src/backend/gradio_dropdownplus/templates/component/chunk-WVR4S24B-Db-rMs1b.js +8 -0
  30. src/backend/gradio_dropdownplus/templates/component/classDiagram-3BZAVTQC-DNKoB6lB.js +16 -0
  31. src/backend/gradio_dropdownplus/templates/component/classDiagram-v2-QTMF73CY-DNKoB6lB.js +16 -0
  32. src/backend/gradio_dropdownplus/templates/component/clone-BcMVq2b9.js +8 -0
  33. src/backend/gradio_dropdownplus/templates/component/cytoscape.esm-ZmItrg9y.js +0 -0
  34. src/backend/gradio_dropdownplus/templates/component/dagre-2BBEFEWP-BSf-_s4F.js +447 -0
  35. src/backend/gradio_dropdownplus/templates/component/defaultLocale-D7EN2tov.js +171 -0
  36. src/backend/gradio_dropdownplus/templates/component/diagram-4IRLE6MV-BXgGx7EY.js +534 -0
  37. src/backend/gradio_dropdownplus/templates/component/diagram-GUPCWM2R-SQr88ceg.js +143 -0
  38. src/backend/gradio_dropdownplus/templates/component/diagram-RP2FKANI-Bz21GoIH.js +221 -0
  39. src/backend/gradio_dropdownplus/templates/component/erDiagram-HZWUO2LU-BoS6ZeGH.js +842 -0
  40. src/backend/gradio_dropdownplus/templates/component/flowDiagram-THRYKUMA-B-Hn5QRu.js +1627 -0
  41. src/backend/gradio_dropdownplus/templates/component/ganttDiagram-WV7ZQ7D5-DU8JrHbh.js +2499 -0
  42. src/backend/gradio_dropdownplus/templates/component/gitGraphDiagram-OJR772UL-BKCAUcNv.js +712 -0
  43. src/backend/gradio_dropdownplus/templates/component/graph-cJOmixT5.js +247 -0
  44. src/backend/gradio_dropdownplus/templates/component/index.js +8 -0
  45. src/backend/gradio_dropdownplus/templates/component/infoDiagram-DDUCL6P7-HvkRXesP.js +24 -0
  46. src/backend/gradio_dropdownplus/templates/component/init-DjUOC4st.js +16 -0
  47. src/backend/gradio_dropdownplus/templates/component/journeyDiagram-FFXJYRFH-r0hQ5t3-.js +836 -0
  48. src/backend/gradio_dropdownplus/templates/component/kanban-definition-KOZQBZVT-DLBL3Rou.js +720 -0
  49. src/backend/gradio_dropdownplus/templates/component/katex-DfcU2jCX.js +0 -0
  50. src/backend/gradio_dropdownplus/templates/component/layout-DJFnmc1Q.js +1324 -0
.gitignore ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .eggs/
2
+ dist/
3
+ .vscode/
4
+ *.pyc
5
+ __pycache__/
6
+ *.py[cod]
7
+ *$py.class
8
+ __tmp/*
9
+ *.pyi
10
+ .mypycache
11
+ .ruff_cache
12
+ node_modules
13
+ backend/**/templates/
14
+ README_TEMPLATE.md
README.md CHANGED
@@ -1,12 +1,488 @@
1
- ---
2
- title: Gradio Dropdownplus
3
- emoji: 👀
4
- colorFrom: purple
5
- colorTo: pink
6
- sdk: gradio
7
- sdk_version: 5.44.1
8
- app_file: app.py
9
- pinned: false
10
- ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags: [gradio-custom-component, Dropdown]
3
+ title: gradio_dropdownplus
4
+ short_description: Advanced Dropdown Component for Gradio UI
5
+ colorFrom: blue
6
+ colorTo: yellow
7
+ sdk: gradio
8
+ pinned: false
9
+ app_file: space.py
10
+ ---
11
+
12
+ # `gradio_dropdownplus`
13
+ <img alt="Static Badge" src="https://img.shields.io/badge/version%20-%200.0.1%20-%20orange">
14
+
15
+ Advanced Dropdown Component for Gradio UI
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ pip install gradio_dropdownplus
21
+ ```
22
+
23
+ ## Usage
24
+
25
+ ```python
26
+ import gradio as gr
27
+ from gradio_dropdownplus import DropdownPlus
28
+
29
+ # --- 1. Define Choices and Helper Function ---
30
+
31
+ # Choices for demonstration
32
+ MODEL_CHOICES = [
33
+ ("GPT-4 Turbo", "gpt-4-1106-preview"),
34
+ ("Claude 3 Opus", "claude-3-opus-20240229"),
35
+ ("Llama 3 70B", "llama3-70b-8192"),
36
+ ]
37
+
38
+ FEATURE_CHOICES = ["Feature A", "Feature B", "Feature C", "Feature D"]
39
+
40
+ def update_output(model_selection, feature_selection_with_info, multi_selection):
41
+ """Formats the selected values for display."""
42
+ return (
43
+ f"--- SELECTIONS ---\n\n"
44
+ f"Model Selection (Help only): {model_selection}\n\n"
45
+ f"Feature Selection (Help & Info): {feature_selection_with_info}\n\n"
46
+ f"Multi-Select Features: {multi_selection}"
47
+ )
48
+
49
+ # --- 2. Build the Gradio App ---
50
+
51
+ with gr.Blocks(theme=gr.themes.Ocean(), title="DropdownPlus Demo") as demo:
52
+ gr.Markdown(
53
+ """
54
+ # DropdownPlus Component Demo
55
+ A demonstration of the `tooltip` functionality in the DropdownPlus component.
56
+ """
57
+ )
58
+
59
+ with gr.Row():
60
+ with gr.Column(scale=2):
61
+ gr.Markdown("### Interactive Examples")
62
+
63
+ # --- Example 1: Dropdown with `label` and `help` only ---
64
+ dropdown_help_only = DropdownPlus(
65
+ choices=MODEL_CHOICES,
66
+ label="Select a Model",
67
+ help="This is a tooltip. It appears next to the label and provides brief guidance.",
68
+ interactive=True
69
+ )
70
+
71
+ # --- Example 2: Dropdown with `label`, `help`, AND `info` ---
72
+ dropdown_with_info = DropdownPlus(
73
+ choices=FEATURE_CHOICES,
74
+ label="Choose a Feature",
75
+ info="This text appears below the label to provide more context.",
76
+ help="The tooltip still appears next to the label, even when 'info' text is present.",
77
+ interactive=True
78
+ )
79
+
80
+ # --- Example 3: Multi-select to show it works there too ---
81
+ dropdown_multi = DropdownPlus(
82
+ choices=FEATURE_CHOICES,
83
+ label="Select Multiple Features",
84
+ info="Help and info also work with multiselect.",
85
+ help="Select one or more options.",
86
+ multiselect=True,
87
+ value=["Feature A", "Feature C"], # Default value
88
+ interactive=True
89
+ )
90
+
91
+ with gr.Column(scale=1):
92
+ gr.Markdown("### Output")
93
+
94
+ output_textbox = gr.Textbox(
95
+ label="Current Values",
96
+ lines=8,
97
+ interactive=False
98
+ )
99
+
100
+ # --- Event Listeners ---
101
+
102
+ # List of all interactive components
103
+ inputs = [
104
+ dropdown_help_only,
105
+ dropdown_with_info,
106
+ dropdown_multi
107
+ ]
108
+
109
+ # Any change to any dropdown will update the output textbox
110
+ for component in inputs:
111
+ component.change(
112
+ fn=update_output,
113
+ inputs=inputs,
114
+ outputs=output_textbox
115
+ )
116
+
117
+ # Trigger the initial display on load
118
+ demo.load(
119
+ fn=update_output,
120
+ inputs=inputs,
121
+ outputs=output_textbox
122
+ )
123
+
124
+ if __name__ == "__main__":
125
+ demo.launch()
126
+ ```
127
+
128
+ ## `DropdownPlus`
129
+
130
+ ### Initialization
131
+
132
+ <table>
133
+ <thead>
134
+ <tr>
135
+ <th align="left">name</th>
136
+ <th align="left" style="width: 25%;">type</th>
137
+ <th align="left">default</th>
138
+ <th align="left">description</th>
139
+ </tr>
140
+ </thead>
141
+ <tbody>
142
+ <tr>
143
+ <td align="left"><code>choices</code></td>
144
+ <td align="left" style="width: 25%;">
145
+
146
+ ```python
147
+ Sequence[
148
+ str | int | float | tuple[str, str | int | float]
149
+ ]
150
+ | None
151
+ ```
152
+
153
+ </td>
154
+ <td align="left"><code>None</code></td>
155
+ <td align="left">a list of string or numeric options to choose from. An option can also be a tuple of the form (name, value), where name is the displayed name of the dropdown choice and value is the value to be passed to the function, or returned by the function.</td>
156
+ </tr>
157
+
158
+ <tr>
159
+ <td align="left"><code>value</code></td>
160
+ <td align="left" style="width: 25%;">
161
+
162
+ ```python
163
+ str
164
+ | int
165
+ | float
166
+ | Sequence[str | int | float]
167
+ | Callable
168
+ | DefaultValue
169
+ | None
170
+ ```
171
+
172
+ </td>
173
+ <td align="left"><code>value = <gradio_dropdownplus.dropdownplus.DefaultValue object at 0x0000027C72C27490></code></td>
174
+ <td align="left">the value selected in dropdown. If `multiselect` is true, this should be list, otherwise a single string or number from among `choices`. By default, the first choice in `choices` is initally selected. If set explicitly to None, no value is initally selected. If a function is provided, the function will be called each time the app loads to set the initial value of this component.</td>
175
+ </tr>
176
+
177
+ <tr>
178
+ <td align="left"><code>type</code></td>
179
+ <td align="left" style="width: 25%;">
180
+
181
+ ```python
182
+ Literal["value", "index"]
183
+ ```
184
+
185
+ </td>
186
+ <td align="left"><code>"value"</code></td>
187
+ <td align="left">type of value to be returned by component. "value" returns the string of the choice selected, "index" returns the index of the choice selected.</td>
188
+ </tr>
189
+
190
+ <tr>
191
+ <td align="left"><code>multiselect</code></td>
192
+ <td align="left" style="width: 25%;">
193
+
194
+ ```python
195
+ bool | None
196
+ ```
197
+
198
+ </td>
199
+ <td align="left"><code>None</code></td>
200
+ <td align="left">if True, multiple choices can be selected.</td>
201
+ </tr>
202
+
203
+ <tr>
204
+ <td align="left"><code>allow_custom_value</code></td>
205
+ <td align="left" style="width: 25%;">
206
+
207
+ ```python
208
+ bool
209
+ ```
210
+
211
+ </td>
212
+ <td align="left"><code>False</code></td>
213
+ <td align="left">if True, allows user to enter a custom value that is not in the list of choices.</td>
214
+ </tr>
215
+
216
+ <tr>
217
+ <td align="left"><code>max_choices</code></td>
218
+ <td align="left" style="width: 25%;">
219
+
220
+ ```python
221
+ int | None
222
+ ```
223
+
224
+ </td>
225
+ <td align="left"><code>None</code></td>
226
+ <td align="left">maximum number of choices that can be selected. If None, no limit is enforced.</td>
227
+ </tr>
228
+
229
+ <tr>
230
+ <td align="left"><code>filterable</code></td>
231
+ <td align="left" style="width: 25%;">
232
+
233
+ ```python
234
+ bool
235
+ ```
236
+
237
+ </td>
238
+ <td align="left"><code>True</code></td>
239
+ <td align="left">if True, user will be able to type into the dropdown and filter the choices by typing. Can only be set to False if `allow_custom_value` is False.</td>
240
+ </tr>
241
+
242
+ <tr>
243
+ <td align="left"><code>label</code></td>
244
+ <td align="left" style="width: 25%;">
245
+
246
+ ```python
247
+ str | I18nData | None
248
+ ```
249
+
250
+ </td>
251
+ <td align="left"><code>None</code></td>
252
+ <td align="left">the label for this component, displayed above the component if `show_label` is `True` and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component corresponds to.</td>
253
+ </tr>
254
+
255
+ <tr>
256
+ <td align="left"><code>info</code></td>
257
+ <td align="left" style="width: 25%;">
258
+
259
+ ```python
260
+ str | I18nData | None
261
+ ```
262
+
263
+ </td>
264
+ <td align="left"><code>None</code></td>
265
+ <td align="left">additional component description, appears below the label in smaller font. Supports markdown / HTML syntax.</td>
266
+ </tr>
267
+
268
+ <tr>
269
+ <td align="left"><code>help</code></td>
270
+ <td align="left" style="width: 25%;">
271
+
272
+ ```python
273
+ str | I18nData | None
274
+ ```
275
+
276
+ </td>
277
+ <td align="left"><code>None</code></td>
278
+ <td align="left">A string of help text to display in a tooltip next to the label.</td>
279
+ </tr>
280
+
281
+ <tr>
282
+ <td align="left"><code>every</code></td>
283
+ <td align="left" style="width: 25%;">
284
+
285
+ ```python
286
+ Timer | float | None
287
+ ```
288
+
289
+ </td>
290
+ <td align="left"><code>None</code></td>
291
+ <td align="left">continously calls `value` to recalculate it if `value` is a function (has no effect otherwise). Can provide a Timer whose tick resets `value`, or a float that provides the regular interval for the reset Timer.</td>
292
+ </tr>
293
+
294
+ <tr>
295
+ <td align="left"><code>inputs</code></td>
296
+ <td align="left" style="width: 25%;">
297
+
298
+ ```python
299
+ Component | Sequence[Component] | set[Component] | None
300
+ ```
301
+
302
+ </td>
303
+ <td align="left"><code>None</code></td>
304
+ <td align="left">components that are used as inputs to calculate `value` if `value` is a function (has no effect otherwise). `value` is recalculated any time the inputs change.</td>
305
+ </tr>
306
+
307
+ <tr>
308
+ <td align="left"><code>show_label</code></td>
309
+ <td align="left" style="width: 25%;">
310
+
311
+ ```python
312
+ bool | None
313
+ ```
314
+
315
+ </td>
316
+ <td align="left"><code>None</code></td>
317
+ <td align="left">if True, will display label.</td>
318
+ </tr>
319
+
320
+ <tr>
321
+ <td align="left"><code>container</code></td>
322
+ <td align="left" style="width: 25%;">
323
+
324
+ ```python
325
+ bool
326
+ ```
327
+
328
+ </td>
329
+ <td align="left"><code>True</code></td>
330
+ <td align="left">if True, will place the component in a container - providing some extra padding around the border.</td>
331
+ </tr>
332
+
333
+ <tr>
334
+ <td align="left"><code>scale</code></td>
335
+ <td align="left" style="width: 25%;">
336
+
337
+ ```python
338
+ int | None
339
+ ```
340
+
341
+ </td>
342
+ <td align="left"><code>None</code></td>
343
+ <td align="left">relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.</td>
344
+ </tr>
345
+
346
+ <tr>
347
+ <td align="left"><code>min_width</code></td>
348
+ <td align="left" style="width: 25%;">
349
+
350
+ ```python
351
+ int
352
+ ```
353
+
354
+ </td>
355
+ <td align="left"><code>160</code></td>
356
+ <td align="left">minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.</td>
357
+ </tr>
358
+
359
+ <tr>
360
+ <td align="left"><code>interactive</code></td>
361
+ <td align="left" style="width: 25%;">
362
+
363
+ ```python
364
+ bool | None
365
+ ```
366
+
367
+ </td>
368
+ <td align="left"><code>None</code></td>
369
+ <td align="left">if True, choices in this dropdown will be selectable; if False, selection will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.</td>
370
+ </tr>
371
+
372
+ <tr>
373
+ <td align="left"><code>visible</code></td>
374
+ <td align="left" style="width: 25%;">
375
+
376
+ ```python
377
+ bool
378
+ ```
379
+
380
+ </td>
381
+ <td align="left"><code>True</code></td>
382
+ <td align="left">if False, component will be hidden.</td>
383
+ </tr>
384
+
385
+ <tr>
386
+ <td align="left"><code>elem_id</code></td>
387
+ <td align="left" style="width: 25%;">
388
+
389
+ ```python
390
+ str | None
391
+ ```
392
+
393
+ </td>
394
+ <td align="left"><code>None</code></td>
395
+ <td align="left">an optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.</td>
396
+ </tr>
397
+
398
+ <tr>
399
+ <td align="left"><code>elem_classes</code></td>
400
+ <td align="left" style="width: 25%;">
401
+
402
+ ```python
403
+ list[str] | str | None
404
+ ```
405
+
406
+ </td>
407
+ <td align="left"><code>None</code></td>
408
+ <td align="left">an optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.</td>
409
+ </tr>
410
+
411
+ <tr>
412
+ <td align="left"><code>render</code></td>
413
+ <td align="left" style="width: 25%;">
414
+
415
+ ```python
416
+ bool
417
+ ```
418
+
419
+ </td>
420
+ <td align="left"><code>True</code></td>
421
+ <td align="left">if False, component will not be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.</td>
422
+ </tr>
423
+
424
+ <tr>
425
+ <td align="left"><code>key</code></td>
426
+ <td align="left" style="width: 25%;">
427
+
428
+ ```python
429
+ int | str | tuple[int | str, ...] | None
430
+ ```
431
+
432
+ </td>
433
+ <td align="left"><code>None</code></td>
434
+ <td align="left">None</td>
435
+ </tr>
436
+
437
+ <tr>
438
+ <td align="left"><code>preserved_by_key</code></td>
439
+ <td align="left" style="width: 25%;">
440
+
441
+ ```python
442
+ list[str] | str | None
443
+ ```
444
+
445
+ </td>
446
+ <td align="left"><code>"value"</code></td>
447
+ <td align="left">None</td>
448
+ </tr>
449
+ </tbody></table>
450
+
451
+
452
+ ### Events
453
+
454
+ | name | description |
455
+ |:-----|:------------|
456
+ | `change` | Triggered when the value of the DropdownPlus 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. |
457
+ | `input` | This listener is triggered when the user changes the value of the DropdownPlus. |
458
+ | `select` | Event listener for when the user selects or deselects the DropdownPlus. Uses event data gradio.SelectData to carry `value` referring to the label of the DropdownPlus, and `selected` to refer to state of the DropdownPlus. See EventData documentation on how to use this event data |
459
+ | `focus` | This listener is triggered when the DropdownPlus is focused. |
460
+ | `blur` | This listener is triggered when the DropdownPlus is unfocused/blurred. |
461
+ | `key_up` | This listener is triggered when the user presses a key while the DropdownPlus is focused. |
462
+
463
+
464
+
465
+ ### User function
466
+
467
+ The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).
468
+
469
+ - When used as an Input, the component only impacts the input signature of the user function.
470
+ - When used as an output, the component only impacts the return signature of the user function.
471
+
472
+ The code snippet below is accurate in cases where the component is used as both an input and an output.
473
+
474
+ - **As output:** Is passed, passes the value of the selected dropdown choice as a `str | int | float` or its index as an `int` into the function, depending on `type`. Or, if `multiselect` is True, passes the values of the selected dropdown choices as a list of corresponding values/indices instead.
475
+ - **As input:** Should return, expects a `str | int | float` corresponding to the value of the dropdown entry to be selected. Or, if `multiselect` is True, expects a `list` of values corresponding to the selected dropdown entries.
476
+
477
+ ```python
478
+ def predict(
479
+ value: str
480
+ | int
481
+ | float
482
+ | list[str | int | float]
483
+ | list[int | None]
484
+ | None
485
+ ) -> str | int | float | list[str | int | float] | None:
486
+ return value
487
+ ```
488
+
__init__.py ADDED
File without changes
app.py ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from gradio_dropdownplus import DropdownPlus
3
+
4
+ # --- 1. Define Choices and Helper Function ---
5
+
6
+ # Choices for demonstration
7
+ MODEL_CHOICES = [
8
+ ("GPT-4 Turbo", "gpt-4-1106-preview"),
9
+ ("Claude 3 Opus", "claude-3-opus-20240229"),
10
+ ("Llama 3 70B", "llama3-70b-8192"),
11
+ ]
12
+
13
+ FEATURE_CHOICES = ["Feature A", "Feature B", "Feature C", "Feature D"]
14
+
15
+ def update_output(model_selection, feature_selection_with_info, multi_selection):
16
+ """Formats the selected values for display."""
17
+ return (
18
+ f"--- SELECTIONS ---\n\n"
19
+ f"Model Selection (Help only): {model_selection}\n\n"
20
+ f"Feature Selection (Help & Info): {feature_selection_with_info}\n\n"
21
+ f"Multi-Select Features: {multi_selection}"
22
+ )
23
+
24
+ # --- 2. Build the Gradio App ---
25
+
26
+ with gr.Blocks(theme=gr.themes.Ocean(), title="DropdownPlus Demo") as demo:
27
+ gr.Markdown(
28
+ """
29
+ # DropdownPlus Component Demo
30
+ A demonstration of the `tooltip` functionality in the DropdownPlus component.
31
+ """
32
+ )
33
+
34
+ with gr.Row():
35
+ with gr.Column(scale=2):
36
+ gr.Markdown("### Interactive Examples")
37
+
38
+ # --- Example 1: Dropdown with `label` and `help` only ---
39
+ dropdown_help_only = DropdownPlus(
40
+ choices=MODEL_CHOICES,
41
+ label="Select a Model",
42
+ help="This is a tooltip. It appears next to the label and provides brief guidance.",
43
+ interactive=True
44
+ )
45
+
46
+ # --- Example 2: Dropdown with `label`, `help`, AND `info` ---
47
+ dropdown_with_info = DropdownPlus(
48
+ choices=FEATURE_CHOICES,
49
+ label="Choose a Feature",
50
+ info="This text appears below the label to provide more context.",
51
+ help="The tooltip still appears next to the label, even when 'info' text is present.",
52
+ interactive=True
53
+ )
54
+
55
+ # --- Example 3: Multi-select to show it works there too ---
56
+ dropdown_multi = DropdownPlus(
57
+ choices=FEATURE_CHOICES,
58
+ label="Select Multiple Features",
59
+ info="Help and info also work with multiselect.",
60
+ help="Select one or more options.",
61
+ multiselect=True,
62
+ value=["Feature A", "Feature C"], # Default value
63
+ interactive=True
64
+ )
65
+
66
+ with gr.Column(scale=1):
67
+ gr.Markdown("### Output")
68
+
69
+ output_textbox = gr.Textbox(
70
+ label="Current Values",
71
+ lines=8,
72
+ interactive=False
73
+ )
74
+
75
+ # --- Event Listeners ---
76
+
77
+ # List of all interactive components
78
+ inputs = [
79
+ dropdown_help_only,
80
+ dropdown_with_info,
81
+ dropdown_multi
82
+ ]
83
+
84
+ # Any change to any dropdown will update the output textbox
85
+ for component in inputs:
86
+ component.change(
87
+ fn=update_output,
88
+ inputs=inputs,
89
+ outputs=output_textbox
90
+ )
91
+
92
+ # Trigger the initial display on load
93
+ demo.load(
94
+ fn=update_output,
95
+ inputs=inputs,
96
+ outputs=output_textbox
97
+ )
98
+
99
+ if __name__ == "__main__":
100
+ demo.launch()
css.css ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ html {
2
+ font-family: Inter;
3
+ font-size: 16px;
4
+ font-weight: 400;
5
+ line-height: 1.5;
6
+ -webkit-text-size-adjust: 100%;
7
+ background: #fff;
8
+ color: #323232;
9
+ -webkit-font-smoothing: antialiased;
10
+ -moz-osx-font-smoothing: grayscale;
11
+ text-rendering: optimizeLegibility;
12
+ }
13
+
14
+ :root {
15
+ --space: 1;
16
+ --vspace: calc(var(--space) * 1rem);
17
+ --vspace-0: calc(3 * var(--space) * 1rem);
18
+ --vspace-1: calc(2 * var(--space) * 1rem);
19
+ --vspace-2: calc(1.5 * var(--space) * 1rem);
20
+ --vspace-3: calc(0.5 * var(--space) * 1rem);
21
+ }
22
+
23
+ .app {
24
+ max-width: 748px !important;
25
+ }
26
+
27
+ .prose p {
28
+ margin: var(--vspace) 0;
29
+ line-height: var(--vspace * 2);
30
+ font-size: 1rem;
31
+ }
32
+
33
+ code {
34
+ font-family: "Inconsolata", sans-serif;
35
+ font-size: 16px;
36
+ }
37
+
38
+ h1,
39
+ h1 code {
40
+ font-weight: 400;
41
+ line-height: calc(2.5 / var(--space) * var(--vspace));
42
+ }
43
+
44
+ h1 code {
45
+ background: none;
46
+ border: none;
47
+ letter-spacing: 0.05em;
48
+ padding-bottom: 5px;
49
+ position: relative;
50
+ padding: 0;
51
+ }
52
+
53
+ h2 {
54
+ margin: var(--vspace-1) 0 var(--vspace-2) 0;
55
+ line-height: 1em;
56
+ }
57
+
58
+ h3,
59
+ h3 code {
60
+ margin: var(--vspace-1) 0 var(--vspace-2) 0;
61
+ line-height: 1em;
62
+ }
63
+
64
+ h4,
65
+ h5,
66
+ h6 {
67
+ margin: var(--vspace-3) 0 var(--vspace-3) 0;
68
+ line-height: var(--vspace);
69
+ }
70
+
71
+ .bigtitle,
72
+ h1,
73
+ h1 code {
74
+ font-size: calc(8px * 4.5);
75
+ word-break: break-word;
76
+ }
77
+
78
+ .title,
79
+ h2,
80
+ h2 code {
81
+ font-size: calc(8px * 3.375);
82
+ font-weight: lighter;
83
+ word-break: break-word;
84
+ border: none;
85
+ background: none;
86
+ }
87
+
88
+ .subheading1,
89
+ h3,
90
+ h3 code {
91
+ font-size: calc(8px * 1.8);
92
+ font-weight: 600;
93
+ border: none;
94
+ background: none;
95
+ letter-spacing: 0.1em;
96
+ text-transform: uppercase;
97
+ }
98
+
99
+ h2 code {
100
+ padding: 0;
101
+ position: relative;
102
+ letter-spacing: 0.05em;
103
+ }
104
+
105
+ blockquote {
106
+ font-size: calc(8px * 1.1667);
107
+ font-style: italic;
108
+ line-height: calc(1.1667 * var(--vspace));
109
+ margin: var(--vspace-2) var(--vspace-2);
110
+ }
111
+
112
+ .subheading2,
113
+ h4 {
114
+ font-size: calc(8px * 1.4292);
115
+ text-transform: uppercase;
116
+ font-weight: 600;
117
+ }
118
+
119
+ .subheading3,
120
+ h5 {
121
+ font-size: calc(8px * 1.2917);
122
+ line-height: calc(1.2917 * var(--vspace));
123
+
124
+ font-weight: lighter;
125
+ text-transform: uppercase;
126
+ letter-spacing: 0.15em;
127
+ }
128
+
129
+ h6 {
130
+ font-size: calc(8px * 1.1667);
131
+ font-size: 1.1667em;
132
+ font-weight: normal;
133
+ font-style: italic;
134
+ font-family: "le-monde-livre-classic-byol", serif !important;
135
+ letter-spacing: 0px !important;
136
+ }
137
+
138
+ #start .md > *:first-child {
139
+ margin-top: 0;
140
+ }
141
+
142
+ h2 + h3 {
143
+ margin-top: 0;
144
+ }
145
+
146
+ .md hr {
147
+ border: none;
148
+ border-top: 1px solid var(--block-border-color);
149
+ margin: var(--vspace-2) 0 var(--vspace-2) 0;
150
+ }
151
+ .prose ul {
152
+ margin: var(--vspace-2) 0 var(--vspace-1) 0;
153
+ }
154
+
155
+ .gap {
156
+ gap: 0;
157
+ }
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ gradio_dropdownplus
space.py ADDED
@@ -0,0 +1,226 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import gradio as gr
3
+ from app import demo as app
4
+ import os
5
+
6
+ _docs = {'DropdownPlus': {'description': 'Creates a dropdown of choices from which a single entry or multiple entries can be selected (as an input component) or displayed (as an output component).\n', 'members': {'__init__': {'choices': {'type': 'Sequence[\n str | int | float | tuple[str, str | int | float]\n ]\n | None', 'default': 'None', 'description': 'a list of string or numeric options to choose from. An option can also be a tuple of the form (name, value), where name is the displayed name of the dropdown choice and value is the value to be passed to the function, or returned by the function.'}, 'value': {'type': 'str\n | int\n | float\n | Sequence[str | int | float]\n | Callable\n | DefaultValue\n | None', 'default': 'value = <gradio_dropdownplus.dropdownplus.DefaultValue object at 0x0000027C72C27490>', 'description': 'the value selected in dropdown. If `multiselect` is true, this should be list, otherwise a single string or number from among `choices`. By default, the first choice in `choices` is initally selected. If set explicitly to None, no value is initally selected. If a function is provided, the function will be called each time the app loads to set the initial value of this component.'}, 'type': {'type': 'Literal["value", "index"]', 'default': '"value"', 'description': 'type of value to be returned by component. "value" returns the string of the choice selected, "index" returns the index of the choice selected.'}, 'multiselect': {'type': 'bool | None', 'default': 'None', 'description': 'if True, multiple choices can be selected.'}, 'allow_custom_value': {'type': 'bool', 'default': 'False', 'description': 'if True, allows user to enter a custom value that is not in the list of choices.'}, 'max_choices': {'type': 'int | None', 'default': 'None', 'description': 'maximum number of choices that can be selected. If None, no limit is enforced.'}, 'filterable': {'type': 'bool', 'default': 'True', 'description': 'if True, user will be able to type into the dropdown and filter the choices by typing. Can only be set to False if `allow_custom_value` is False.'}, 'label': {'type': 'str | I18nData | None', 'default': 'None', 'description': 'the label for this component, displayed above the component if `show_label` is `True` and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component corresponds to.'}, 'info': {'type': 'str | I18nData | None', 'default': 'None', 'description': 'additional component description, appears below the label in smaller font. Supports markdown / HTML syntax.'}, 'help': {'type': 'str | I18nData | None', 'default': 'None', 'description': 'A string of help text to display in a tooltip next to the label.'}, 'every': {'type': 'Timer | float | None', 'default': 'None', 'description': 'continously calls `value` to recalculate it if `value` is a function (has no effect otherwise). Can provide a Timer whose tick resets `value`, or a float that provides the regular interval for the reset Timer.'}, 'inputs': {'type': 'Component | Sequence[Component] | set[Component] | None', 'default': 'None', 'description': 'components that are used as inputs to calculate `value` if `value` is a function (has no effect otherwise). `value` is recalculated any time the inputs change.'}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will display label.'}, 'container': {'type': 'bool', 'default': 'True', 'description': 'if True, will place the component in a container - providing some extra padding around the border.'}, 'scale': {'type': 'int | None', 'default': 'None', 'description': 'relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.'}, 'min_width': {'type': 'int', 'default': '160', 'description': 'minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.'}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': 'if True, choices in this dropdown will be selectable; if False, selection will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.'}, 'visible': {'type': 'bool', 'default': 'True', 'description': 'if False, 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. Can be used for targeting CSS styles.'}, '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. Can be used for targeting CSS styles.'}, 'render': {'type': 'bool', 'default': 'True', 'description': 'if False, component will not be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.'}, 'key': {'type': 'int | str | tuple[int | str, ...] | None', 'default': 'None', 'description': None}, 'preserved_by_key': {'type': 'list[str] | str | None', 'default': '"value"', 'description': None}}, 'postprocess': {'value': {'type': 'str | int | float | list[str | int | float] | None', 'description': 'Expects a `str | int | float` corresponding to the value of the dropdown entry to be selected. Or, if `multiselect` is True, expects a `list` of values corresponding to the selected dropdown entries.'}}, 'preprocess': {'return': {'type': 'str\n | int\n | float\n | list[str | int | float]\n | list[int | None]\n | None', 'description': 'Passes the value of the selected dropdown choice as a `str | int | float` or its index as an `int` into the function, depending on `type`. Or, if `multiselect` is True, passes the values of the selected dropdown choices as a list of corresponding values/indices instead.'}, 'value': None}}, 'events': {'change': {'type': None, 'default': None, 'description': 'Triggered when the value of the DropdownPlus 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 DropdownPlus.'}, 'select': {'type': None, 'default': None, 'description': 'Event listener for when the user selects or deselects the DropdownPlus. Uses event data gradio.SelectData to carry `value` referring to the label of the DropdownPlus, and `selected` to refer to state of the DropdownPlus. See EventData documentation on how to use this event data'}, 'focus': {'type': None, 'default': None, 'description': 'This listener is triggered when the DropdownPlus is focused.'}, 'blur': {'type': None, 'default': None, 'description': 'This listener is triggered when the DropdownPlus is unfocused/blurred.'}, 'key_up': {'type': None, 'default': None, 'description': 'This listener is triggered when the user presses a key while the DropdownPlus is focused.'}}}, '__meta__': {'additional_interfaces': {}, 'user_fn_refs': {'DropdownPlus': []}}}
7
+
8
+ abs_path = os.path.join(os.path.dirname(__file__), "css.css")
9
+
10
+ with gr.Blocks(
11
+ css=abs_path,
12
+ theme=gr.themes.Default(
13
+ font_mono=[
14
+ gr.themes.GoogleFont("Inconsolata"),
15
+ "monospace",
16
+ ],
17
+ ),
18
+ ) as demo:
19
+ gr.Markdown(
20
+ """
21
+ # `gradio_dropdownplus`
22
+
23
+ <div style="display: flex; gap: 7px;">
24
+ <img alt="Static Badge" src="https://img.shields.io/badge/version%20-%200.0.1%20-%20orange">
25
+ </div>
26
+
27
+ Advanced Dropdown Component for Gradio UI
28
+ """, elem_classes=["md-custom"], header_links=True)
29
+ app.render()
30
+ gr.Markdown(
31
+ """
32
+ ## Installation
33
+
34
+ ```bash
35
+ pip install gradio_dropdownplus
36
+ ```
37
+
38
+ ## Usage
39
+
40
+ ```python
41
+ import gradio as gr
42
+ from gradio_dropdownplus import DropdownPlus
43
+
44
+ # --- 1. Define Choices and Helper Function ---
45
+
46
+ # Choices for demonstration
47
+ MODEL_CHOICES = [
48
+ ("GPT-4 Turbo", "gpt-4-1106-preview"),
49
+ ("Claude 3 Opus", "claude-3-opus-20240229"),
50
+ ("Llama 3 70B", "llama3-70b-8192"),
51
+ ]
52
+
53
+ FEATURE_CHOICES = ["Feature A", "Feature B", "Feature C", "Feature D"]
54
+
55
+ def update_output(model_selection, feature_selection_with_info, multi_selection):
56
+ \"\"\"Formats the selected values for display.\"\"\"
57
+ return (
58
+ f"--- SELECTIONS ---\n\n"
59
+ f"Model Selection (Help only): {model_selection}\n\n"
60
+ f"Feature Selection (Help & Info): {feature_selection_with_info}\n\n"
61
+ f"Multi-Select Features: {multi_selection}"
62
+ )
63
+
64
+ # --- 2. Build the Gradio App ---
65
+
66
+ with gr.Blocks(theme=gr.themes.Ocean(), title="DropdownPlus Demo") as demo:
67
+ gr.Markdown(
68
+ \"\"\"
69
+ # DropdownPlus Component Demo
70
+ A demonstration of the `tooltip` functionality in the DropdownPlus component.
71
+ \"\"\"
72
+ )
73
+
74
+ with gr.Row():
75
+ with gr.Column(scale=2):
76
+ gr.Markdown("### Interactive Examples")
77
+
78
+ # --- Example 1: Dropdown with `label` and `help` only ---
79
+ dropdown_help_only = DropdownPlus(
80
+ choices=MODEL_CHOICES,
81
+ label="Select a Model",
82
+ help="This is a tooltip. It appears next to the label and provides brief guidance.",
83
+ interactive=True
84
+ )
85
+
86
+ # --- Example 2: Dropdown with `label`, `help`, AND `info` ---
87
+ dropdown_with_info = DropdownPlus(
88
+ choices=FEATURE_CHOICES,
89
+ label="Choose a Feature",
90
+ info="This text appears below the label to provide more context.",
91
+ help="The tooltip still appears next to the label, even when 'info' text is present.",
92
+ interactive=True
93
+ )
94
+
95
+ # --- Example 3: Multi-select to show it works there too ---
96
+ dropdown_multi = DropdownPlus(
97
+ choices=FEATURE_CHOICES,
98
+ label="Select Multiple Features",
99
+ info="Help and info also work with multiselect.",
100
+ help="Select one or more options.",
101
+ multiselect=True,
102
+ value=["Feature A", "Feature C"], # Default value
103
+ interactive=True
104
+ )
105
+
106
+ with gr.Column(scale=1):
107
+ gr.Markdown("### Output")
108
+
109
+ output_textbox = gr.Textbox(
110
+ label="Current Values",
111
+ lines=8,
112
+ interactive=False
113
+ )
114
+
115
+ # --- Event Listeners ---
116
+
117
+ # List of all interactive components
118
+ inputs = [
119
+ dropdown_help_only,
120
+ dropdown_with_info,
121
+ dropdown_multi
122
+ ]
123
+
124
+ # Any change to any dropdown will update the output textbox
125
+ for component in inputs:
126
+ component.change(
127
+ fn=update_output,
128
+ inputs=inputs,
129
+ outputs=output_textbox
130
+ )
131
+
132
+ # Trigger the initial display on load
133
+ demo.load(
134
+ fn=update_output,
135
+ inputs=inputs,
136
+ outputs=output_textbox
137
+ )
138
+
139
+ if __name__ == "__main__":
140
+ demo.launch()
141
+ ```
142
+ """, elem_classes=["md-custom"], header_links=True)
143
+
144
+
145
+ gr.Markdown("""
146
+ ## `DropdownPlus`
147
+
148
+ ### Initialization
149
+ """, elem_classes=["md-custom"], header_links=True)
150
+
151
+ gr.ParamViewer(value=_docs["DropdownPlus"]["members"]["__init__"], linkify=[])
152
+
153
+
154
+ gr.Markdown("### Events")
155
+ gr.ParamViewer(value=_docs["DropdownPlus"]["events"], linkify=['Event'])
156
+
157
+
158
+
159
+
160
+ gr.Markdown("""
161
+
162
+ ### User function
163
+
164
+ The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).
165
+
166
+ - When used as an Input, the component only impacts the input signature of the user function.
167
+ - When used as an output, the component only impacts the return signature of the user function.
168
+
169
+ The code snippet below is accurate in cases where the component is used as both an input and an output.
170
+
171
+ - **As input:** Is passed, passes the value of the selected dropdown choice as a `str | int | float` or its index as an `int` into the function, depending on `type`. Or, if `multiselect` is True, passes the values of the selected dropdown choices as a list of corresponding values/indices instead.
172
+ - **As output:** Should return, expects a `str | int | float` corresponding to the value of the dropdown entry to be selected. Or, if `multiselect` is True, expects a `list` of values corresponding to the selected dropdown entries.
173
+
174
+ ```python
175
+ def predict(
176
+ value: str
177
+ | int
178
+ | float
179
+ | list[str | int | float]
180
+ | list[int | None]
181
+ | None
182
+ ) -> str | int | float | list[str | int | float] | None:
183
+ return value
184
+ ```
185
+ """, elem_classes=["md-custom", "DropdownPlus-user-fn"], header_links=True)
186
+
187
+
188
+
189
+
190
+ demo.load(None, js=r"""function() {
191
+ const refs = {};
192
+ const user_fn_refs = {
193
+ DropdownPlus: [], };
194
+ requestAnimationFrame(() => {
195
+
196
+ Object.entries(user_fn_refs).forEach(([key, refs]) => {
197
+ if (refs.length > 0) {
198
+ const el = document.querySelector(`.${key}-user-fn`);
199
+ if (!el) return;
200
+ refs.forEach(ref => {
201
+ el.innerHTML = el.innerHTML.replace(
202
+ new RegExp("\\b"+ref+"\\b", "g"),
203
+ `<a href="#h-${ref.toLowerCase()}">${ref}</a>`
204
+ );
205
+ })
206
+ }
207
+ })
208
+
209
+ Object.entries(refs).forEach(([key, refs]) => {
210
+ if (refs.length > 0) {
211
+ const el = document.querySelector(`.${key}`);
212
+ if (!el) return;
213
+ refs.forEach(ref => {
214
+ el.innerHTML = el.innerHTML.replace(
215
+ new RegExp("\\b"+ref+"\\b", "g"),
216
+ `<a href="#h-${ref.toLowerCase()}">${ref}</a>`
217
+ );
218
+ })
219
+ }
220
+ })
221
+ })
222
+ }
223
+
224
+ """)
225
+
226
+ demo.launch()
src/.gitignore ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .eggs/
2
+ dist/
3
+ .vscode/
4
+ *.pyc
5
+ __pycache__/
6
+ *.py[cod]
7
+ *$py.class
8
+ __tmp/*
9
+ *.pyi
10
+ .mypycache
11
+ .ruff_cache
12
+ node_modules
13
+ backend/**/templates/
14
+ README_TEMPLATE.md
src/.vscode/launch.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ {
8
+ "name": "Python Debugger: Current File",
9
+ "type": "debugpy",
10
+ "request": "launch",
11
+ "program": "${file}",
12
+ "console": "integratedTerminal",
13
+ "justMyCode": false
14
+ },
15
+ {
16
+ "name": "Gradio dev (Python attach)",
17
+ "type": "debugpy",
18
+ "request": "attach",
19
+ "processId": "${command:pickProcess}",
20
+ "justMyCode": false
21
+ },
22
+ {
23
+ "name": "Gradio dev (Svelte attach)",
24
+ "type": "chrome",
25
+ "request": "attach",
26
+ "port": 9222,
27
+ }
28
+ ]
29
+ }
src/README.md ADDED
@@ -0,0 +1,488 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags: [gradio-custom-component, Dropdown]
3
+ title: gradio_dropdownplus
4
+ short_description: Advanced Dropdown Component for Gradio UI
5
+ colorFrom: blue
6
+ colorTo: yellow
7
+ sdk: gradio
8
+ pinned: false
9
+ app_file: space.py
10
+ ---
11
+
12
+ # `gradio_dropdownplus`
13
+ <img alt="Static Badge" src="https://img.shields.io/badge/version%20-%200.0.1%20-%20orange">
14
+
15
+ Advanced Dropdown Component for Gradio UI
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ pip install gradio_dropdownplus
21
+ ```
22
+
23
+ ## Usage
24
+
25
+ ```python
26
+ import gradio as gr
27
+ from gradio_dropdownplus import DropdownPlus
28
+
29
+ # --- 1. Define Choices and Helper Function ---
30
+
31
+ # Choices for demonstration
32
+ MODEL_CHOICES = [
33
+ ("GPT-4 Turbo", "gpt-4-1106-preview"),
34
+ ("Claude 3 Opus", "claude-3-opus-20240229"),
35
+ ("Llama 3 70B", "llama3-70b-8192"),
36
+ ]
37
+
38
+ FEATURE_CHOICES = ["Feature A", "Feature B", "Feature C", "Feature D"]
39
+
40
+ def update_output(model_selection, feature_selection_with_info, multi_selection):
41
+ """Formats the selected values for display."""
42
+ return (
43
+ f"--- SELECTIONS ---\n\n"
44
+ f"Model Selection (Help only): {model_selection}\n\n"
45
+ f"Feature Selection (Help & Info): {feature_selection_with_info}\n\n"
46
+ f"Multi-Select Features: {multi_selection}"
47
+ )
48
+
49
+ # --- 2. Build the Gradio App ---
50
+
51
+ with gr.Blocks(theme=gr.themes.Ocean(), title="DropdownPlus Demo") as demo:
52
+ gr.Markdown(
53
+ """
54
+ # DropdownPlus Component Demo
55
+ A demonstration of the `tooltip` functionality in the DropdownPlus component.
56
+ """
57
+ )
58
+
59
+ with gr.Row():
60
+ with gr.Column(scale=2):
61
+ gr.Markdown("### Interactive Examples")
62
+
63
+ # --- Example 1: Dropdown with `label` and `help` only ---
64
+ dropdown_help_only = DropdownPlus(
65
+ choices=MODEL_CHOICES,
66
+ label="Select a Model",
67
+ help="This is a tooltip. It appears next to the label and provides brief guidance.",
68
+ interactive=True
69
+ )
70
+
71
+ # --- Example 2: Dropdown with `label`, `help`, AND `info` ---
72
+ dropdown_with_info = DropdownPlus(
73
+ choices=FEATURE_CHOICES,
74
+ label="Choose a Feature",
75
+ info="This text appears below the label to provide more context.",
76
+ help="The tooltip still appears next to the label, even when 'info' text is present.",
77
+ interactive=True
78
+ )
79
+
80
+ # --- Example 3: Multi-select to show it works there too ---
81
+ dropdown_multi = DropdownPlus(
82
+ choices=FEATURE_CHOICES,
83
+ label="Select Multiple Features",
84
+ info="Help and info also work with multiselect.",
85
+ help="Select one or more options.",
86
+ multiselect=True,
87
+ value=["Feature A", "Feature C"], # Default value
88
+ interactive=True
89
+ )
90
+
91
+ with gr.Column(scale=1):
92
+ gr.Markdown("### Output")
93
+
94
+ output_textbox = gr.Textbox(
95
+ label="Current Values",
96
+ lines=8,
97
+ interactive=False
98
+ )
99
+
100
+ # --- Event Listeners ---
101
+
102
+ # List of all interactive components
103
+ inputs = [
104
+ dropdown_help_only,
105
+ dropdown_with_info,
106
+ dropdown_multi
107
+ ]
108
+
109
+ # Any change to any dropdown will update the output textbox
110
+ for component in inputs:
111
+ component.change(
112
+ fn=update_output,
113
+ inputs=inputs,
114
+ outputs=output_textbox
115
+ )
116
+
117
+ # Trigger the initial display on load
118
+ demo.load(
119
+ fn=update_output,
120
+ inputs=inputs,
121
+ outputs=output_textbox
122
+ )
123
+
124
+ if __name__ == "__main__":
125
+ demo.launch()
126
+ ```
127
+
128
+ ## `DropdownPlus`
129
+
130
+ ### Initialization
131
+
132
+ <table>
133
+ <thead>
134
+ <tr>
135
+ <th align="left">name</th>
136
+ <th align="left" style="width: 25%;">type</th>
137
+ <th align="left">default</th>
138
+ <th align="left">description</th>
139
+ </tr>
140
+ </thead>
141
+ <tbody>
142
+ <tr>
143
+ <td align="left"><code>choices</code></td>
144
+ <td align="left" style="width: 25%;">
145
+
146
+ ```python
147
+ Sequence[
148
+ str | int | float | tuple[str, str | int | float]
149
+ ]
150
+ | None
151
+ ```
152
+
153
+ </td>
154
+ <td align="left"><code>None</code></td>
155
+ <td align="left">a list of string or numeric options to choose from. An option can also be a tuple of the form (name, value), where name is the displayed name of the dropdown choice and value is the value to be passed to the function, or returned by the function.</td>
156
+ </tr>
157
+
158
+ <tr>
159
+ <td align="left"><code>value</code></td>
160
+ <td align="left" style="width: 25%;">
161
+
162
+ ```python
163
+ str
164
+ | int
165
+ | float
166
+ | Sequence[str | int | float]
167
+ | Callable
168
+ | DefaultValue
169
+ | None
170
+ ```
171
+
172
+ </td>
173
+ <td align="left"><code>value = <gradio_dropdownplus.dropdownplus.DefaultValue object at 0x0000027C72C27490></code></td>
174
+ <td align="left">the value selected in dropdown. If `multiselect` is true, this should be list, otherwise a single string or number from among `choices`. By default, the first choice in `choices` is initally selected. If set explicitly to None, no value is initally selected. If a function is provided, the function will be called each time the app loads to set the initial value of this component.</td>
175
+ </tr>
176
+
177
+ <tr>
178
+ <td align="left"><code>type</code></td>
179
+ <td align="left" style="width: 25%;">
180
+
181
+ ```python
182
+ Literal["value", "index"]
183
+ ```
184
+
185
+ </td>
186
+ <td align="left"><code>"value"</code></td>
187
+ <td align="left">type of value to be returned by component. "value" returns the string of the choice selected, "index" returns the index of the choice selected.</td>
188
+ </tr>
189
+
190
+ <tr>
191
+ <td align="left"><code>multiselect</code></td>
192
+ <td align="left" style="width: 25%;">
193
+
194
+ ```python
195
+ bool | None
196
+ ```
197
+
198
+ </td>
199
+ <td align="left"><code>None</code></td>
200
+ <td align="left">if True, multiple choices can be selected.</td>
201
+ </tr>
202
+
203
+ <tr>
204
+ <td align="left"><code>allow_custom_value</code></td>
205
+ <td align="left" style="width: 25%;">
206
+
207
+ ```python
208
+ bool
209
+ ```
210
+
211
+ </td>
212
+ <td align="left"><code>False</code></td>
213
+ <td align="left">if True, allows user to enter a custom value that is not in the list of choices.</td>
214
+ </tr>
215
+
216
+ <tr>
217
+ <td align="left"><code>max_choices</code></td>
218
+ <td align="left" style="width: 25%;">
219
+
220
+ ```python
221
+ int | None
222
+ ```
223
+
224
+ </td>
225
+ <td align="left"><code>None</code></td>
226
+ <td align="left">maximum number of choices that can be selected. If None, no limit is enforced.</td>
227
+ </tr>
228
+
229
+ <tr>
230
+ <td align="left"><code>filterable</code></td>
231
+ <td align="left" style="width: 25%;">
232
+
233
+ ```python
234
+ bool
235
+ ```
236
+
237
+ </td>
238
+ <td align="left"><code>True</code></td>
239
+ <td align="left">if True, user will be able to type into the dropdown and filter the choices by typing. Can only be set to False if `allow_custom_value` is False.</td>
240
+ </tr>
241
+
242
+ <tr>
243
+ <td align="left"><code>label</code></td>
244
+ <td align="left" style="width: 25%;">
245
+
246
+ ```python
247
+ str | I18nData | None
248
+ ```
249
+
250
+ </td>
251
+ <td align="left"><code>None</code></td>
252
+ <td align="left">the label for this component, displayed above the component if `show_label` is `True` and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component corresponds to.</td>
253
+ </tr>
254
+
255
+ <tr>
256
+ <td align="left"><code>info</code></td>
257
+ <td align="left" style="width: 25%;">
258
+
259
+ ```python
260
+ str | I18nData | None
261
+ ```
262
+
263
+ </td>
264
+ <td align="left"><code>None</code></td>
265
+ <td align="left">additional component description, appears below the label in smaller font. Supports markdown / HTML syntax.</td>
266
+ </tr>
267
+
268
+ <tr>
269
+ <td align="left"><code>help</code></td>
270
+ <td align="left" style="width: 25%;">
271
+
272
+ ```python
273
+ str | I18nData | None
274
+ ```
275
+
276
+ </td>
277
+ <td align="left"><code>None</code></td>
278
+ <td align="left">A string of help text to display in a tooltip next to the label.</td>
279
+ </tr>
280
+
281
+ <tr>
282
+ <td align="left"><code>every</code></td>
283
+ <td align="left" style="width: 25%;">
284
+
285
+ ```python
286
+ Timer | float | None
287
+ ```
288
+
289
+ </td>
290
+ <td align="left"><code>None</code></td>
291
+ <td align="left">continously calls `value` to recalculate it if `value` is a function (has no effect otherwise). Can provide a Timer whose tick resets `value`, or a float that provides the regular interval for the reset Timer.</td>
292
+ </tr>
293
+
294
+ <tr>
295
+ <td align="left"><code>inputs</code></td>
296
+ <td align="left" style="width: 25%;">
297
+
298
+ ```python
299
+ Component | Sequence[Component] | set[Component] | None
300
+ ```
301
+
302
+ </td>
303
+ <td align="left"><code>None</code></td>
304
+ <td align="left">components that are used as inputs to calculate `value` if `value` is a function (has no effect otherwise). `value` is recalculated any time the inputs change.</td>
305
+ </tr>
306
+
307
+ <tr>
308
+ <td align="left"><code>show_label</code></td>
309
+ <td align="left" style="width: 25%;">
310
+
311
+ ```python
312
+ bool | None
313
+ ```
314
+
315
+ </td>
316
+ <td align="left"><code>None</code></td>
317
+ <td align="left">if True, will display label.</td>
318
+ </tr>
319
+
320
+ <tr>
321
+ <td align="left"><code>container</code></td>
322
+ <td align="left" style="width: 25%;">
323
+
324
+ ```python
325
+ bool
326
+ ```
327
+
328
+ </td>
329
+ <td align="left"><code>True</code></td>
330
+ <td align="left">if True, will place the component in a container - providing some extra padding around the border.</td>
331
+ </tr>
332
+
333
+ <tr>
334
+ <td align="left"><code>scale</code></td>
335
+ <td align="left" style="width: 25%;">
336
+
337
+ ```python
338
+ int | None
339
+ ```
340
+
341
+ </td>
342
+ <td align="left"><code>None</code></td>
343
+ <td align="left">relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.</td>
344
+ </tr>
345
+
346
+ <tr>
347
+ <td align="left"><code>min_width</code></td>
348
+ <td align="left" style="width: 25%;">
349
+
350
+ ```python
351
+ int
352
+ ```
353
+
354
+ </td>
355
+ <td align="left"><code>160</code></td>
356
+ <td align="left">minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.</td>
357
+ </tr>
358
+
359
+ <tr>
360
+ <td align="left"><code>interactive</code></td>
361
+ <td align="left" style="width: 25%;">
362
+
363
+ ```python
364
+ bool | None
365
+ ```
366
+
367
+ </td>
368
+ <td align="left"><code>None</code></td>
369
+ <td align="left">if True, choices in this dropdown will be selectable; if False, selection will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.</td>
370
+ </tr>
371
+
372
+ <tr>
373
+ <td align="left"><code>visible</code></td>
374
+ <td align="left" style="width: 25%;">
375
+
376
+ ```python
377
+ bool
378
+ ```
379
+
380
+ </td>
381
+ <td align="left"><code>True</code></td>
382
+ <td align="left">if False, component will be hidden.</td>
383
+ </tr>
384
+
385
+ <tr>
386
+ <td align="left"><code>elem_id</code></td>
387
+ <td align="left" style="width: 25%;">
388
+
389
+ ```python
390
+ str | None
391
+ ```
392
+
393
+ </td>
394
+ <td align="left"><code>None</code></td>
395
+ <td align="left">an optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.</td>
396
+ </tr>
397
+
398
+ <tr>
399
+ <td align="left"><code>elem_classes</code></td>
400
+ <td align="left" style="width: 25%;">
401
+
402
+ ```python
403
+ list[str] | str | None
404
+ ```
405
+
406
+ </td>
407
+ <td align="left"><code>None</code></td>
408
+ <td align="left">an optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.</td>
409
+ </tr>
410
+
411
+ <tr>
412
+ <td align="left"><code>render</code></td>
413
+ <td align="left" style="width: 25%;">
414
+
415
+ ```python
416
+ bool
417
+ ```
418
+
419
+ </td>
420
+ <td align="left"><code>True</code></td>
421
+ <td align="left">if False, component will not be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.</td>
422
+ </tr>
423
+
424
+ <tr>
425
+ <td align="left"><code>key</code></td>
426
+ <td align="left" style="width: 25%;">
427
+
428
+ ```python
429
+ int | str | tuple[int | str, ...] | None
430
+ ```
431
+
432
+ </td>
433
+ <td align="left"><code>None</code></td>
434
+ <td align="left">None</td>
435
+ </tr>
436
+
437
+ <tr>
438
+ <td align="left"><code>preserved_by_key</code></td>
439
+ <td align="left" style="width: 25%;">
440
+
441
+ ```python
442
+ list[str] | str | None
443
+ ```
444
+
445
+ </td>
446
+ <td align="left"><code>"value"</code></td>
447
+ <td align="left">None</td>
448
+ </tr>
449
+ </tbody></table>
450
+
451
+
452
+ ### Events
453
+
454
+ | name | description |
455
+ |:-----|:------------|
456
+ | `change` | Triggered when the value of the DropdownPlus 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. |
457
+ | `input` | This listener is triggered when the user changes the value of the DropdownPlus. |
458
+ | `select` | Event listener for when the user selects or deselects the DropdownPlus. Uses event data gradio.SelectData to carry `value` referring to the label of the DropdownPlus, and `selected` to refer to state of the DropdownPlus. See EventData documentation on how to use this event data |
459
+ | `focus` | This listener is triggered when the DropdownPlus is focused. |
460
+ | `blur` | This listener is triggered when the DropdownPlus is unfocused/blurred. |
461
+ | `key_up` | This listener is triggered when the user presses a key while the DropdownPlus is focused. |
462
+
463
+
464
+
465
+ ### User function
466
+
467
+ The impact on the users predict function varies depending on whether the component is used as an input or output for an event (or both).
468
+
469
+ - When used as an Input, the component only impacts the input signature of the user function.
470
+ - When used as an output, the component only impacts the return signature of the user function.
471
+
472
+ The code snippet below is accurate in cases where the component is used as both an input and an output.
473
+
474
+ - **As output:** Is passed, passes the value of the selected dropdown choice as a `str | int | float` or its index as an `int` into the function, depending on `type`. Or, if `multiselect` is True, passes the values of the selected dropdown choices as a list of corresponding values/indices instead.
475
+ - **As input:** Should return, expects a `str | int | float` corresponding to the value of the dropdown entry to be selected. Or, if `multiselect` is True, expects a `list` of values corresponding to the selected dropdown entries.
476
+
477
+ ```python
478
+ def predict(
479
+ value: str
480
+ | int
481
+ | float
482
+ | list[str | int | float]
483
+ | list[int | None]
484
+ | None
485
+ ) -> str | int | float | list[str | int | float] | None:
486
+ return value
487
+ ```
488
+
src/backend/gradio_dropdownplus/__init__.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+
2
+ from .dropdownplus import DropdownPlus
3
+
4
+ __all__ = ['DropdownPlus']
src/backend/gradio_dropdownplus/dropdownplus.py ADDED
@@ -0,0 +1,253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """gr.Dropdown() component."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import warnings
6
+ from collections.abc import Callable, Sequence
7
+ from typing import TYPE_CHECKING, Any, Literal
8
+
9
+ from gradio_client.documentation import document
10
+
11
+ from gradio.components.base import Component, FormComponent
12
+ from gradio.events import Events
13
+ from gradio.exceptions import Error
14
+ from gradio.i18n import I18nData
15
+
16
+ if TYPE_CHECKING:
17
+ from gradio.components import Timer
18
+
19
+
20
+ class DefaultValue:
21
+ # This sentinel is used to indicate that if the value is not explicitly set,
22
+ # the first choice should be selected in the dropdown if multiselect is False,
23
+ # and an empty list should be selected if multiselect is True.
24
+ pass
25
+
26
+
27
+ DEFAULT_VALUE = DefaultValue()
28
+
29
+
30
+ class DropdownPlus(FormComponent):
31
+ """
32
+ Creates a dropdown of choices from which a single entry or multiple entries can be selected (as an input component) or displayed (as an output component).
33
+
34
+ Demos: sentence_builder
35
+ """
36
+
37
+ EVENTS = [
38
+ Events.change,
39
+ Events.input,
40
+ Events.select,
41
+ Events.focus,
42
+ Events.blur,
43
+ Events.key_up,
44
+ ]
45
+
46
+ def __init__(
47
+ self,
48
+ choices: Sequence[str | int | float | tuple[str, str | int | float]]
49
+ | None = None,
50
+ *,
51
+ value: str
52
+ | int
53
+ | float
54
+ | Sequence[str | int | float]
55
+ | Callable
56
+ | DefaultValue
57
+ | None = DEFAULT_VALUE,
58
+ type: Literal["value", "index"] = "value",
59
+ multiselect: bool | None = None,
60
+ allow_custom_value: bool = False,
61
+ max_choices: int | None = None,
62
+ filterable: bool = True,
63
+ label: str | I18nData | None = None,
64
+ info: str | I18nData | None = None,
65
+ help: str | I18nData | None = None,
66
+ every: Timer | float | None = None,
67
+ inputs: Component | Sequence[Component] | set[Component] | None = None,
68
+ show_label: bool | None = None,
69
+ container: bool = True,
70
+ scale: int | None = None,
71
+ min_width: int = 160,
72
+ interactive: bool | None = None,
73
+ visible: bool = True,
74
+ elem_id: str | None = None,
75
+ elem_classes: list[str] | str | None = None,
76
+ render: bool = True,
77
+ key: int | str | tuple[int | str, ...] | None = None,
78
+ preserved_by_key: list[str] | str | None = "value",
79
+ ):
80
+ """
81
+ Parameters:
82
+ choices: a list of string or numeric options to choose from. An option can also be a tuple of the form (name, value), where name is the displayed name of the dropdown choice and value is the value to be passed to the function, or returned by the function.
83
+ value: the value selected in dropdown. If `multiselect` is true, this should be list, otherwise a single string or number from among `choices`. By default, the first choice in `choices` is initally selected. If set explicitly to None, no value is initally selected. If a function is provided, the function will be called each time the app loads to set the initial value of this component.
84
+ type: type of value to be returned by component. "value" returns the string of the choice selected, "index" returns the index of the choice selected.
85
+ multiselect: if True, multiple choices can be selected.
86
+ allow_custom_value: if True, allows user to enter a custom value that is not in the list of choices.
87
+ max_choices: maximum number of choices that can be selected. If None, no limit is enforced.
88
+ filterable: if True, user will be able to type into the dropdown and filter the choices by typing. Can only be set to False if `allow_custom_value` is False.
89
+ label: the label for this component, displayed above the component if `show_label` is `True` and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component corresponds to.
90
+ info: additional component description, appears below the label in smaller font. Supports markdown / HTML syntax.
91
+ help: A string of help text to display in a tooltip next to the label.
92
+ every: continously calls `value` to recalculate it if `value` is a function (has no effect otherwise). Can provide a Timer whose tick resets `value`, or a float that provides the regular interval for the reset Timer.
93
+ inputs: components that are used as inputs to calculate `value` if `value` is a function (has no effect otherwise). `value` is recalculated any time the inputs change.
94
+ show_label: if True, will display label.
95
+ container: if True, will place the component in a container - providing some extra padding around the border.
96
+ scale: relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.
97
+ min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.
98
+ interactive: if True, choices in this dropdown will be selectable; if False, selection will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.
99
+ visible: if False, component will be hidden.
100
+ elem_id: an optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.
101
+ elem_classes: an optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.
102
+ render: if False, component will not be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
103
+ """
104
+ self.choices = (
105
+ # Although we expect choices to be a list of tuples, it can be a list of lists if the Gradio app
106
+ # is loaded with gr.load() since Python tuples are converted to lists in JSON.
107
+ [tuple(c) if isinstance(c, (tuple, list)) else (str(c), c) for c in choices]
108
+ if choices
109
+ else []
110
+ )
111
+ valid_types = ["value", "index"]
112
+ if type not in valid_types:
113
+ raise ValueError(
114
+ f"Invalid value for parameter `type`: {type}. Please choose from one of: {valid_types}"
115
+ )
116
+ self.type = type
117
+ self.multiselect = multiselect
118
+
119
+ if value == DEFAULT_VALUE:
120
+ if multiselect:
121
+ value = []
122
+ elif self.choices:
123
+ value = self.choices[0][1]
124
+ else:
125
+ value = None
126
+ if multiselect and isinstance(value, str):
127
+ value = [value]
128
+
129
+ if not multiselect and max_choices is not None:
130
+ warnings.warn(
131
+ "The `max_choices` parameter is ignored when `multiselect` is False."
132
+ )
133
+ if not filterable and allow_custom_value:
134
+ filterable = True
135
+ warnings.warn(
136
+ "The `filterable` parameter cannot be set to False when `allow_custom_value` is True. Setting `filterable` to True."
137
+ )
138
+ self.max_choices = max_choices
139
+ self.allow_custom_value = allow_custom_value
140
+ self.filterable = filterable
141
+ self.help = help
142
+ super().__init__(
143
+ label=label,
144
+ info=info,
145
+ every=every,
146
+ inputs=inputs,
147
+ show_label=show_label,
148
+ container=container,
149
+ scale=scale,
150
+ min_width=min_width,
151
+ interactive=interactive,
152
+ visible=visible,
153
+ elem_id=elem_id,
154
+ elem_classes=elem_classes,
155
+ render=render,
156
+ key=key,
157
+ preserved_by_key=preserved_by_key,
158
+ value=value,
159
+ )
160
+ self._value_description = f"one{' or more' if multiselect else ''} of {[c[1] if isinstance(c, tuple) else c for c in self.choices]}"
161
+
162
+ def api_info(self) -> dict[str, Any]:
163
+ if self.multiselect:
164
+ json_type = {
165
+ "type": "array",
166
+ "items": {"type": "string", "enum": [c[1] for c in self.choices]},
167
+ }
168
+ else:
169
+ json_type = {
170
+ "type": "string",
171
+ "enum": [c[1] for c in self.choices],
172
+ }
173
+ return json_type
174
+
175
+ def example_payload(self) -> Any:
176
+ if self.multiselect:
177
+ return [self.choices[0][1]] if self.choices else []
178
+ else:
179
+ return self.choices[0][1] if self.choices else None
180
+
181
+ def example_value(self) -> Any:
182
+ if self.multiselect:
183
+ return [self.choices[0][1]] if self.choices else []
184
+ else:
185
+ return self.choices[0][1] if self.choices else None
186
+
187
+ def preprocess(
188
+ self, payload: str | int | float | list[str | int | float] | None
189
+ ) -> str | int | float | list[str | int | float] | list[int | None] | None:
190
+ """
191
+ Parameters:
192
+ payload: the value of the selected dropdown choice(s)
193
+ Returns:
194
+ Passes the value of the selected dropdown choice as a `str | int | float` or its index as an `int` into the function, depending on `type`. Or, if `multiselect` is True, passes the values of the selected dropdown choices as a list of corresponding values/indices instead.
195
+ """
196
+ if payload is None:
197
+ return None
198
+
199
+ choice_values = [value for _, value in self.choices]
200
+ if not self.allow_custom_value:
201
+ if isinstance(payload, list):
202
+ for value in payload:
203
+ if value not in choice_values:
204
+ raise Error(
205
+ f"Value: {value!r} (type: {type(value)}) is not in the list of choices: {choice_values}"
206
+ )
207
+ elif payload not in choice_values:
208
+ raise Error(
209
+ f"Value: {payload} is not in the list of choices: {choice_values}"
210
+ )
211
+
212
+ if self.type == "value":
213
+ return payload
214
+ elif self.type == "index":
215
+ if isinstance(payload, list):
216
+ return [
217
+ choice_values.index(choice) if choice in choice_values else None
218
+ for choice in payload
219
+ ]
220
+ else:
221
+ return (
222
+ choice_values.index(payload) if payload in choice_values else None
223
+ )
224
+ else:
225
+ raise ValueError(
226
+ f"Unknown type: {self.type}. Please choose from: 'value', 'index'."
227
+ )
228
+
229
+ def _warn_if_invalid_choice(self, value):
230
+ if self.allow_custom_value or value in [value for _, value in self.choices]:
231
+ return
232
+ warnings.warn(
233
+ f"The value passed into gr.Dropdown() is not in the list of choices. Please update the list of choices to include: {value} or set allow_custom_value=True."
234
+ )
235
+
236
+ def postprocess(
237
+ self, value: str | int | float | list[str | int | float] | None
238
+ ) -> str | int | float | list[str | int | float] | None:
239
+ """
240
+ Parameters:
241
+ value: Expects a `str | int | float` corresponding to the value of the dropdown entry to be selected. Or, if `multiselect` is True, expects a `list` of values corresponding to the selected dropdown entries.
242
+ Returns:
243
+ Returns the values of the selected dropdown entry or entries.
244
+ """
245
+ if value is None:
246
+ return None
247
+ if self.multiselect:
248
+ if not isinstance(value, list):
249
+ value = [value]
250
+ [self._warn_if_invalid_choice(_y) for _y in value]
251
+ else:
252
+ self._warn_if_invalid_choice(value)
253
+ return value
src/backend/gradio_dropdownplus/templates/component/Index-v4MoKD9K.js ADDED
The diff for this file is too large to render. See raw diff
 
src/backend/gradio_dropdownplus/templates/component/_basePickBy-BbJ7hQvb.js ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { e as x, c as O, g as m, k as P, h as p, j as w, l as A, m as c, n as I, t as N, o as E } from "./_baseUniq-CMmoTQ8t.js";
2
+ import { aP as g, aA as F, aQ as M, aR as T, aS as _, aT as l, aU as $, aV as B, aW as S, aX as y } from "./mermaid.core-D58rAnek.js";
3
+ var R = /\s/;
4
+ function G(n) {
5
+ for (var r = n.length; r-- && R.test(n.charAt(r)); )
6
+ ;
7
+ return r;
8
+ }
9
+ var H = /^\s+/;
10
+ function L(n) {
11
+ return n && n.slice(0, G(n) + 1).replace(H, "");
12
+ }
13
+ var o = NaN, W = /^[-+]0x[0-9a-f]+$/i, X = /^0b[01]+$/i, q = /^0o[0-7]+$/i, z = parseInt;
14
+ function C(n) {
15
+ if (typeof n == "number")
16
+ return n;
17
+ if (x(n))
18
+ return o;
19
+ if (g(n)) {
20
+ var r = typeof n.valueOf == "function" ? n.valueOf() : n;
21
+ n = g(r) ? r + "" : r;
22
+ }
23
+ if (typeof n != "string")
24
+ return n === 0 ? n : +n;
25
+ n = L(n);
26
+ var t = X.test(n);
27
+ return t || q.test(n) ? z(n.slice(2), t ? 2 : 8) : W.test(n) ? o : +n;
28
+ }
29
+ var v = 1 / 0, K = 17976931348623157e292;
30
+ function Q(n) {
31
+ if (!n)
32
+ return n === 0 ? n : 0;
33
+ if (n = C(n), n === v || n === -v) {
34
+ var r = n < 0 ? -1 : 1;
35
+ return r * K;
36
+ }
37
+ return n === n ? n : 0;
38
+ }
39
+ function U(n) {
40
+ var r = Q(n), t = r % 1;
41
+ return r === r ? t ? r - t : r : 0;
42
+ }
43
+ function fn(n) {
44
+ var r = n == null ? 0 : n.length;
45
+ return r ? O(n) : [];
46
+ }
47
+ var b = Object.prototype, Y = b.hasOwnProperty, dn = F(function(n, r) {
48
+ n = Object(n);
49
+ var t = -1, i = r.length, a = i > 2 ? r[2] : void 0;
50
+ for (a && M(r[0], r[1], a) && (i = 1); ++t < i; )
51
+ for (var f = r[t], e = T(f), s = -1, d = e.length; ++s < d; ) {
52
+ var u = e[s], h = n[u];
53
+ (h === void 0 || _(h, b[u]) && !Y.call(n, u)) && (n[u] = f[u]);
54
+ }
55
+ return n;
56
+ });
57
+ function un(n) {
58
+ var r = n == null ? 0 : n.length;
59
+ return r ? n[r - 1] : void 0;
60
+ }
61
+ function D(n) {
62
+ return function(r, t, i) {
63
+ var a = Object(r);
64
+ if (!l(r)) {
65
+ var f = m(t);
66
+ r = P(r), t = function(s) {
67
+ return f(a[s], s, a);
68
+ };
69
+ }
70
+ var e = n(r, t, i);
71
+ return e > -1 ? a[f ? r[e] : e] : void 0;
72
+ };
73
+ }
74
+ var J = Math.max;
75
+ function Z(n, r, t) {
76
+ var i = n == null ? 0 : n.length;
77
+ if (!i)
78
+ return -1;
79
+ var a = t == null ? 0 : U(t);
80
+ return a < 0 && (a = J(i + a, 0)), p(n, m(r), a);
81
+ }
82
+ var hn = D(Z);
83
+ function V(n, r) {
84
+ var t = -1, i = l(n) ? Array(n.length) : [];
85
+ return w(n, function(a, f, e) {
86
+ i[++t] = r(a, f, e);
87
+ }), i;
88
+ }
89
+ function gn(n, r) {
90
+ var t = $(n) ? A : V;
91
+ return t(n, m(r));
92
+ }
93
+ var j = Object.prototype, k = j.hasOwnProperty;
94
+ function nn(n, r) {
95
+ return n != null && k.call(n, r);
96
+ }
97
+ function mn(n, r) {
98
+ return n != null && c(n, r, nn);
99
+ }
100
+ function rn(n, r) {
101
+ return n < r;
102
+ }
103
+ function tn(n, r, t) {
104
+ for (var i = -1, a = n.length; ++i < a; ) {
105
+ var f = n[i], e = r(f);
106
+ if (e != null && (s === void 0 ? e === e && !x(e) : t(e, s)))
107
+ var s = e, d = f;
108
+ }
109
+ return d;
110
+ }
111
+ function on(n) {
112
+ return n && n.length ? tn(n, B, rn) : void 0;
113
+ }
114
+ function an(n, r, t, i) {
115
+ if (!g(n))
116
+ return n;
117
+ r = I(r, n);
118
+ for (var a = -1, f = r.length, e = f - 1, s = n; s != null && ++a < f; ) {
119
+ var d = N(r[a]), u = t;
120
+ if (d === "__proto__" || d === "constructor" || d === "prototype")
121
+ return n;
122
+ if (a != e) {
123
+ var h = s[d];
124
+ u = void 0, u === void 0 && (u = g(h) ? h : S(r[a + 1]) ? [] : {});
125
+ }
126
+ y(s, d, u), s = s[d];
127
+ }
128
+ return n;
129
+ }
130
+ function vn(n, r, t) {
131
+ for (var i = -1, a = r.length, f = {}; ++i < a; ) {
132
+ var e = r[i], s = E(n, e);
133
+ t(s, e) && an(f, I(e, n), s);
134
+ }
135
+ return f;
136
+ }
137
+ export {
138
+ rn as a,
139
+ tn as b,
140
+ V as c,
141
+ vn as d,
142
+ on as e,
143
+ fn as f,
144
+ hn as g,
145
+ mn as h,
146
+ dn as i,
147
+ U as j,
148
+ un as l,
149
+ gn as m,
150
+ Q as t
151
+ };
src/backend/gradio_dropdownplus/templates/component/_baseUniq-CMmoTQ8t.js ADDED
@@ -0,0 +1,614 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { bc as S, bd as Rn, aU as T, be as w, bf as xn, bg as mn, aT as sn, bh as Mn, bi as un, bj as x, aR as U, bk as Cn, bl as on, bm as Fn, bn as E, ba as gn, bo as R, aP as ln, bp as Dn, bq as D, br as Gn, bs as Un, bt as _, aX as Bn, bu as Nn, aS as Kn, bv as X, bw as jn, bx as Hn, aW as qn, aV as cn, b8 as Yn, by as M } from "./mermaid.core-D58rAnek.js";
2
+ var Zn = "[object Symbol]";
3
+ function B(n) {
4
+ return typeof n == "symbol" || S(n) && Rn(n) == Zn;
5
+ }
6
+ function bn(n, r) {
7
+ for (var e = -1, t = n == null ? 0 : n.length, f = Array(t); ++e < t; )
8
+ f[e] = r(n[e], e, n);
9
+ return f;
10
+ }
11
+ var J = w ? w.prototype : void 0, Q = J ? J.toString : void 0;
12
+ function dn(n) {
13
+ if (typeof n == "string")
14
+ return n;
15
+ if (T(n))
16
+ return bn(n, dn) + "";
17
+ if (B(n))
18
+ return Q ? Q.call(n) : "";
19
+ var r = n + "";
20
+ return r == "0" && 1 / n == -1 / 0 ? "-0" : r;
21
+ }
22
+ function Xn() {
23
+ }
24
+ function pn(n, r) {
25
+ for (var e = -1, t = n == null ? 0 : n.length; ++e < t && r(n[e], e, n) !== !1; )
26
+ ;
27
+ return n;
28
+ }
29
+ function Jn(n, r, e, t) {
30
+ for (var f = n.length, i = e + -1; ++i < f; )
31
+ if (r(n[i], i, n))
32
+ return i;
33
+ return -1;
34
+ }
35
+ function Qn(n) {
36
+ return n !== n;
37
+ }
38
+ function Wn(n, r, e) {
39
+ for (var t = e - 1, f = n.length; ++t < f; )
40
+ if (n[t] === r)
41
+ return t;
42
+ return -1;
43
+ }
44
+ function zn(n, r, e) {
45
+ return r === r ? Wn(n, r, e) : Jn(n, Qn, e);
46
+ }
47
+ function Vn(n, r) {
48
+ var e = n == null ? 0 : n.length;
49
+ return !!e && zn(n, r, 0) > -1;
50
+ }
51
+ function $(n) {
52
+ return sn(n) ? xn(n) : mn(n);
53
+ }
54
+ var kn = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, nr = /^\w*$/;
55
+ function N(n, r) {
56
+ if (T(n))
57
+ return !1;
58
+ var e = typeof n;
59
+ return e == "number" || e == "symbol" || e == "boolean" || n == null || B(n) ? !0 : nr.test(n) || !kn.test(n) || r != null && n in Object(r);
60
+ }
61
+ var rr = 500;
62
+ function er(n) {
63
+ var r = Mn(n, function(t) {
64
+ return e.size === rr && e.clear(), t;
65
+ }), e = r.cache;
66
+ return r;
67
+ }
68
+ var tr = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, ir = /\\(\\)?/g, fr = er(function(n) {
69
+ var r = [];
70
+ return n.charCodeAt(0) === 46 && r.push(""), n.replace(tr, function(e, t, f, i) {
71
+ r.push(f ? i.replace(ir, "$1") : t || e);
72
+ }), r;
73
+ });
74
+ function ar(n) {
75
+ return n == null ? "" : dn(n);
76
+ }
77
+ function An(n, r) {
78
+ return T(n) ? n : N(n, r) ? [n] : fr(ar(n));
79
+ }
80
+ function m(n) {
81
+ if (typeof n == "string" || B(n))
82
+ return n;
83
+ var r = n + "";
84
+ return r == "0" && 1 / n == -1 / 0 ? "-0" : r;
85
+ }
86
+ function yn(n, r) {
87
+ r = An(r, n);
88
+ for (var e = 0, t = r.length; n != null && e < t; )
89
+ n = n[m(r[e++])];
90
+ return e && e == t ? n : void 0;
91
+ }
92
+ function sr(n, r, e) {
93
+ var t = n == null ? void 0 : yn(n, r);
94
+ return t === void 0 ? e : t;
95
+ }
96
+ function K(n, r) {
97
+ for (var e = -1, t = r.length, f = n.length; ++e < t; )
98
+ n[f + e] = r[e];
99
+ return n;
100
+ }
101
+ var W = w ? w.isConcatSpreadable : void 0;
102
+ function ur(n) {
103
+ return T(n) || un(n) || !!(W && n && n[W]);
104
+ }
105
+ function Ot(n, r, e, t, f) {
106
+ var i = -1, a = n.length;
107
+ for (e || (e = ur), f || (f = []); ++i < a; ) {
108
+ var s = n[i];
109
+ e(s) ? K(f, s) : t || (f[f.length] = s);
110
+ }
111
+ return f;
112
+ }
113
+ function or(n, r, e, t) {
114
+ var f = -1, i = n == null ? 0 : n.length;
115
+ for (t && i && (e = n[++f]); ++f < i; )
116
+ e = r(e, n[f], f, n);
117
+ return e;
118
+ }
119
+ function gr(n, r) {
120
+ return n && x(r, $(r), n);
121
+ }
122
+ function lr(n, r) {
123
+ return n && x(r, U(r), n);
124
+ }
125
+ function Tn(n, r) {
126
+ for (var e = -1, t = n == null ? 0 : n.length, f = 0, i = []; ++e < t; ) {
127
+ var a = n[e];
128
+ r(a, e, n) && (i[f++] = a);
129
+ }
130
+ return i;
131
+ }
132
+ function hn() {
133
+ return [];
134
+ }
135
+ var cr = Object.prototype, br = cr.propertyIsEnumerable, z = Object.getOwnPropertySymbols, j = z ? function(n) {
136
+ return n == null ? [] : (n = Object(n), Tn(z(n), function(r) {
137
+ return br.call(n, r);
138
+ }));
139
+ } : hn;
140
+ function dr(n, r) {
141
+ return x(n, j(n), r);
142
+ }
143
+ var pr = Object.getOwnPropertySymbols, wn = pr ? function(n) {
144
+ for (var r = []; n; )
145
+ K(r, j(n)), n = Cn(n);
146
+ return r;
147
+ } : hn;
148
+ function Ar(n, r) {
149
+ return x(n, wn(n), r);
150
+ }
151
+ function On(n, r, e) {
152
+ var t = r(n);
153
+ return T(n) ? t : K(t, e(n));
154
+ }
155
+ function G(n) {
156
+ return On(n, $, j);
157
+ }
158
+ function yr(n) {
159
+ return On(n, U, wn);
160
+ }
161
+ var Tr = Object.prototype, hr = Tr.hasOwnProperty;
162
+ function wr(n) {
163
+ var r = n.length, e = new n.constructor(r);
164
+ return r && typeof n[0] == "string" && hr.call(n, "index") && (e.index = n.index, e.input = n.input), e;
165
+ }
166
+ function Or(n, r) {
167
+ var e = r ? on(n.buffer) : n.buffer;
168
+ return new n.constructor(e, n.byteOffset, n.byteLength);
169
+ }
170
+ var $r = /\w*$/;
171
+ function _r(n) {
172
+ var r = new n.constructor(n.source, $r.exec(n));
173
+ return r.lastIndex = n.lastIndex, r;
174
+ }
175
+ var V = w ? w.prototype : void 0, k = V ? V.valueOf : void 0;
176
+ function Sr(n) {
177
+ return k ? Object(k.call(n)) : {};
178
+ }
179
+ 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]", Ur = "[object Int16Array]", Br = "[object Int32Array]", Nr = "[object Uint8Array]", Kr = "[object Uint8ClampedArray]", jr = "[object Uint16Array]", Hr = "[object Uint32Array]";
180
+ function qr(n, r, e) {
181
+ var t = n.constructor;
182
+ switch (r) {
183
+ case Mr:
184
+ return on(n);
185
+ case Er:
186
+ case Pr:
187
+ return new t(+n);
188
+ case Cr:
189
+ return Or(n, e);
190
+ case Fr:
191
+ case Dr:
192
+ case Gr:
193
+ case Ur:
194
+ case Br:
195
+ case Nr:
196
+ case Kr:
197
+ case jr:
198
+ case Hr:
199
+ return Fn(n, e);
200
+ case Ir:
201
+ return new t();
202
+ case vr:
203
+ case xr:
204
+ return new t(n);
205
+ case Lr:
206
+ return _r(n);
207
+ case Rr:
208
+ return new t();
209
+ case mr:
210
+ return Sr(n);
211
+ }
212
+ }
213
+ var Yr = "[object Map]";
214
+ function Zr(n) {
215
+ return S(n) && E(n) == Yr;
216
+ }
217
+ var nn = R && R.isMap, Xr = nn ? gn(nn) : Zr, Jr = "[object Set]";
218
+ function Qr(n) {
219
+ return S(n) && E(n) == Jr;
220
+ }
221
+ var rn = R && R.isSet, Wr = rn ? gn(rn) : Qr, 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 = {};
222
+ 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;
223
+ g[te] = g[_n] = g[le] = !1;
224
+ function C(n, r, e, t, f, i) {
225
+ var a, s = r & zr, u = r & Vr, b = r & kr;
226
+ if (a !== void 0)
227
+ return a;
228
+ if (!ln(n))
229
+ return n;
230
+ var l = T(n);
231
+ if (l) {
232
+ if (a = wr(n), !s)
233
+ return Dn(n, a);
234
+ } else {
235
+ var o = E(n), c = o == _n || o == ie;
236
+ if (D(n))
237
+ return Gn(n, s);
238
+ if (o == Sn || o == $n || c && !f) {
239
+ if (a = u || c ? {} : Un(n), !s)
240
+ return u ? Ar(n, lr(a, n)) : dr(n, gr(a, n));
241
+ } else {
242
+ if (!g[o])
243
+ return f ? n : {};
244
+ a = qr(n, o, s);
245
+ }
246
+ }
247
+ i || (i = new _());
248
+ var h = i.get(n);
249
+ if (h)
250
+ return h;
251
+ i.set(n, a), Wr(n) ? n.forEach(function(d) {
252
+ a.add(C(d, r, e, d, n, i));
253
+ }) : Xr(n) && n.forEach(function(d, p) {
254
+ a.set(p, C(d, r, e, p, n, i));
255
+ });
256
+ var A = b ? u ? yr : G : u ? U : $, y = l ? void 0 : A(n);
257
+ return pn(y || n, function(d, p) {
258
+ y && (p = d, d = n[p]), Bn(a, p, C(d, r, e, p, n, i));
259
+ }), a;
260
+ }
261
+ var _e = "__lodash_hash_undefined__";
262
+ function Se(n) {
263
+ return this.__data__.set(n, _e), this;
264
+ }
265
+ function Ee(n) {
266
+ return this.__data__.has(n);
267
+ }
268
+ function P(n) {
269
+ var r = -1, e = n == null ? 0 : n.length;
270
+ for (this.__data__ = new Nn(); ++r < e; )
271
+ this.add(n[r]);
272
+ }
273
+ P.prototype.add = P.prototype.push = Se;
274
+ P.prototype.has = Ee;
275
+ function Pe(n, r) {
276
+ for (var e = -1, t = n == null ? 0 : n.length; ++e < t; )
277
+ if (r(n[e], e, n))
278
+ return !0;
279
+ return !1;
280
+ }
281
+ function En(n, r) {
282
+ return n.has(r);
283
+ }
284
+ var Ie = 1, ve = 2;
285
+ function Pn(n, r, e, t, f, i) {
286
+ var a = e & Ie, s = n.length, u = r.length;
287
+ if (s != u && !(a && u > s))
288
+ return !1;
289
+ var b = i.get(n), l = i.get(r);
290
+ if (b && l)
291
+ return b == r && l == n;
292
+ var o = -1, c = !0, h = e & ve ? new P() : void 0;
293
+ for (i.set(n, r), i.set(r, n); ++o < s; ) {
294
+ var A = n[o], y = r[o];
295
+ if (t)
296
+ var d = a ? t(y, A, o, r, n, i) : t(A, y, o, n, r, i);
297
+ if (d !== void 0) {
298
+ if (d)
299
+ continue;
300
+ c = !1;
301
+ break;
302
+ }
303
+ if (h) {
304
+ if (!Pe(r, function(p, O) {
305
+ if (!En(h, O) && (A === p || f(A, p, e, t, i)))
306
+ return h.push(O);
307
+ })) {
308
+ c = !1;
309
+ break;
310
+ }
311
+ } else if (!(A === y || f(A, y, e, t, i))) {
312
+ c = !1;
313
+ break;
314
+ }
315
+ }
316
+ return i.delete(n), i.delete(r), c;
317
+ }
318
+ function Le(n) {
319
+ var r = -1, e = Array(n.size);
320
+ return n.forEach(function(t, f) {
321
+ e[++r] = [f, t];
322
+ }), e;
323
+ }
324
+ function H(n) {
325
+ var r = -1, e = Array(n.size);
326
+ return n.forEach(function(t) {
327
+ e[++r] = t;
328
+ }), e;
329
+ }
330
+ var Re = 1, xe = 2, me = "[object Boolean]", Me = "[object Date]", Ce = "[object Error]", Fe = "[object Map]", De = "[object Number]", Ge = "[object RegExp]", Ue = "[object Set]", Be = "[object String]", Ne = "[object Symbol]", Ke = "[object ArrayBuffer]", je = "[object DataView]", en = w ? w.prototype : void 0, F = en ? en.valueOf : void 0;
331
+ function He(n, r, e, t, f, i, a) {
332
+ switch (e) {
333
+ case je:
334
+ if (n.byteLength != r.byteLength || n.byteOffset != r.byteOffset)
335
+ return !1;
336
+ n = n.buffer, r = r.buffer;
337
+ case Ke:
338
+ return !(n.byteLength != r.byteLength || !i(new X(n), new X(r)));
339
+ case me:
340
+ case Me:
341
+ case De:
342
+ return Kn(+n, +r);
343
+ case Ce:
344
+ return n.name == r.name && n.message == r.message;
345
+ case Ge:
346
+ case Be:
347
+ return n == r + "";
348
+ case Fe:
349
+ var s = Le;
350
+ case Ue:
351
+ var u = t & Re;
352
+ if (s || (s = H), n.size != r.size && !u)
353
+ return !1;
354
+ var b = a.get(n);
355
+ if (b)
356
+ return b == r;
357
+ t |= xe, a.set(n, r);
358
+ var l = Pn(s(n), s(r), t, f, i, a);
359
+ return a.delete(n), l;
360
+ case Ne:
361
+ if (F)
362
+ return F.call(n) == F.call(r);
363
+ }
364
+ return !1;
365
+ }
366
+ var qe = 1, Ye = Object.prototype, Ze = Ye.hasOwnProperty;
367
+ function Xe(n, r, e, t, f, i) {
368
+ var a = e & qe, s = G(n), u = s.length, b = G(r), l = b.length;
369
+ if (u != l && !a)
370
+ return !1;
371
+ for (var o = u; o--; ) {
372
+ var c = s[o];
373
+ if (!(a ? c in r : Ze.call(r, c)))
374
+ return !1;
375
+ }
376
+ var h = i.get(n), A = i.get(r);
377
+ if (h && A)
378
+ return h == r && A == n;
379
+ var y = !0;
380
+ i.set(n, r), i.set(r, n);
381
+ for (var d = a; ++o < u; ) {
382
+ c = s[o];
383
+ var p = n[c], O = r[c];
384
+ if (t)
385
+ var Z = a ? t(O, p, c, r, n, i) : t(p, O, c, n, r, i);
386
+ if (!(Z === void 0 ? p === O || f(p, O, e, t, i) : Z)) {
387
+ y = !1;
388
+ break;
389
+ }
390
+ d || (d = c == "constructor");
391
+ }
392
+ if (y && !d) {
393
+ var I = n.constructor, v = r.constructor;
394
+ I != v && "constructor" in n && "constructor" in r && !(typeof I == "function" && I instanceof I && typeof v == "function" && v instanceof v) && (y = !1);
395
+ }
396
+ return i.delete(n), i.delete(r), y;
397
+ }
398
+ var Je = 1, tn = "[object Arguments]", fn = "[object Array]", L = "[object Object]", Qe = Object.prototype, an = Qe.hasOwnProperty;
399
+ function We(n, r, e, t, f, i) {
400
+ var a = T(n), s = T(r), u = a ? fn : E(n), b = s ? fn : E(r);
401
+ u = u == tn ? L : u, b = b == tn ? L : b;
402
+ var l = u == L, o = b == L, c = u == b;
403
+ if (c && D(n)) {
404
+ if (!D(r))
405
+ return !1;
406
+ a = !0, l = !1;
407
+ }
408
+ if (c && !l)
409
+ return i || (i = new _()), a || jn(n) ? Pn(n, r, e, t, f, i) : He(n, r, u, e, t, f, i);
410
+ if (!(e & Je)) {
411
+ var h = l && an.call(n, "__wrapped__"), A = o && an.call(r, "__wrapped__");
412
+ if (h || A) {
413
+ var y = h ? n.value() : n, d = A ? r.value() : r;
414
+ return i || (i = new _()), f(y, d, e, t, i);
415
+ }
416
+ }
417
+ return c ? (i || (i = new _()), Xe(n, r, e, t, f, i)) : !1;
418
+ }
419
+ function q(n, r, e, t, f) {
420
+ return n === r ? !0 : n == null || r == null || !S(n) && !S(r) ? n !== n && r !== r : We(n, r, e, t, q, f);
421
+ }
422
+ var ze = 1, Ve = 2;
423
+ function ke(n, r, e, t) {
424
+ var f = e.length, i = f;
425
+ if (n == null)
426
+ return !i;
427
+ for (n = Object(n); f--; ) {
428
+ var a = e[f];
429
+ if (a[2] ? a[1] !== n[a[0]] : !(a[0] in n))
430
+ return !1;
431
+ }
432
+ for (; ++f < i; ) {
433
+ a = e[f];
434
+ var s = a[0], u = n[s], b = a[1];
435
+ if (a[2]) {
436
+ if (u === void 0 && !(s in n))
437
+ return !1;
438
+ } else {
439
+ var l = new _(), o;
440
+ if (!(o === void 0 ? q(b, u, ze | Ve, t, l) : o))
441
+ return !1;
442
+ }
443
+ }
444
+ return !0;
445
+ }
446
+ function In(n) {
447
+ return n === n && !ln(n);
448
+ }
449
+ function nt(n) {
450
+ for (var r = $(n), e = r.length; e--; ) {
451
+ var t = r[e], f = n[t];
452
+ r[e] = [t, f, In(f)];
453
+ }
454
+ return r;
455
+ }
456
+ function vn(n, r) {
457
+ return function(e) {
458
+ return e == null ? !1 : e[n] === r && (r !== void 0 || n in Object(e));
459
+ };
460
+ }
461
+ function rt(n) {
462
+ var r = nt(n);
463
+ return r.length == 1 && r[0][2] ? vn(r[0][0], r[0][1]) : function(e) {
464
+ return e === n || ke(e, n, r);
465
+ };
466
+ }
467
+ function et(n, r) {
468
+ return n != null && r in Object(n);
469
+ }
470
+ function tt(n, r, e) {
471
+ r = An(r, n);
472
+ for (var t = -1, f = r.length, i = !1; ++t < f; ) {
473
+ var a = m(r[t]);
474
+ if (!(i = n != null && e(n, a)))
475
+ break;
476
+ n = n[a];
477
+ }
478
+ return i || ++t != f ? i : (f = n == null ? 0 : n.length, !!f && Hn(f) && qn(a, f) && (T(n) || un(n)));
479
+ }
480
+ function it(n, r) {
481
+ return n != null && tt(n, r, et);
482
+ }
483
+ var ft = 1, at = 2;
484
+ function st(n, r) {
485
+ return N(n) && In(r) ? vn(m(n), r) : function(e) {
486
+ var t = sr(e, n);
487
+ return t === void 0 && t === r ? it(e, n) : q(r, t, ft | at);
488
+ };
489
+ }
490
+ function ut(n) {
491
+ return function(r) {
492
+ return r == null ? void 0 : r[n];
493
+ };
494
+ }
495
+ function ot(n) {
496
+ return function(r) {
497
+ return yn(r, n);
498
+ };
499
+ }
500
+ function gt(n) {
501
+ return N(n) ? ut(m(n)) : ot(n);
502
+ }
503
+ function Ln(n) {
504
+ return typeof n == "function" ? n : n == null ? cn : typeof n == "object" ? T(n) ? st(n[0], n[1]) : rt(n) : gt(n);
505
+ }
506
+ function lt(n, r) {
507
+ return n && Yn(n, r, $);
508
+ }
509
+ function ct(n, r) {
510
+ return function(e, t) {
511
+ if (e == null)
512
+ return e;
513
+ if (!sn(e))
514
+ return n(e, t);
515
+ for (var f = e.length, i = -1, a = Object(e); ++i < f && t(a[i], i, a) !== !1; )
516
+ ;
517
+ return e;
518
+ };
519
+ }
520
+ var Y = ct(lt);
521
+ function bt(n) {
522
+ return typeof n == "function" ? n : cn;
523
+ }
524
+ function $t(n, r) {
525
+ var e = T(n) ? pn : Y;
526
+ return e(n, bt(r));
527
+ }
528
+ function dt(n, r) {
529
+ var e = [];
530
+ return Y(n, function(t, f, i) {
531
+ r(t, f, i) && e.push(t);
532
+ }), e;
533
+ }
534
+ function _t(n, r) {
535
+ var e = T(n) ? Tn : dt;
536
+ return e(n, Ln(r));
537
+ }
538
+ function pt(n, r) {
539
+ return bn(r, function(e) {
540
+ return n[e];
541
+ });
542
+ }
543
+ function St(n) {
544
+ return n == null ? [] : pt(n, $(n));
545
+ }
546
+ function Et(n) {
547
+ return n === void 0;
548
+ }
549
+ function At(n, r, e, t, f) {
550
+ return f(n, function(i, a, s) {
551
+ e = t ? (t = !1, i) : r(e, i, a, s);
552
+ }), e;
553
+ }
554
+ function Pt(n, r, e) {
555
+ var t = T(n) ? or : At, f = arguments.length < 3;
556
+ return t(n, Ln(r), e, f, Y);
557
+ }
558
+ var yt = 1 / 0, Tt = M && 1 / H(new M([, -0]))[1] == yt ? function(n) {
559
+ return new M(n);
560
+ } : Xn, ht = 200;
561
+ function It(n, r, e) {
562
+ var t = -1, f = Vn, i = n.length, a = !0, s = [], u = s;
563
+ if (i >= ht) {
564
+ var b = r ? null : Tt(n);
565
+ if (b)
566
+ return H(b);
567
+ a = !1, f = En, u = new P();
568
+ } else
569
+ u = r ? [] : s;
570
+ n:
571
+ for (; ++t < i; ) {
572
+ var l = n[t], o = r ? r(l) : l;
573
+ if (l = l !== 0 ? l : 0, a && o === o) {
574
+ for (var c = u.length; c--; )
575
+ if (u[c] === o)
576
+ continue n;
577
+ r && u.push(o), s.push(l);
578
+ } else f(u, o, e) || (u !== s && u.push(o), s.push(l));
579
+ }
580
+ return s;
581
+ }
582
+ export {
583
+ Tn as A,
584
+ dt as B,
585
+ Pe as C,
586
+ Xn as D,
587
+ P as S,
588
+ It as a,
589
+ C as b,
590
+ Ot as c,
591
+ $t as d,
592
+ B as e,
593
+ _t as f,
594
+ Ln as g,
595
+ Jn as h,
596
+ Et as i,
597
+ Y as j,
598
+ $ as k,
599
+ bn as l,
600
+ tt as m,
601
+ An as n,
602
+ yn as o,
603
+ bt as p,
604
+ lt as q,
605
+ Pt as r,
606
+ it as s,
607
+ m as t,
608
+ ar as u,
609
+ St as v,
610
+ Vn as w,
611
+ En as x,
612
+ zn as y,
613
+ yr as z
614
+ };
src/backend/gradio_dropdownplus/templates/component/arc-C-Ik2gwm.js ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { 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-D58rAnek.js";
2
+ function cn(l) {
3
+ return l.innerRadius;
4
+ }
5
+ function yn(l) {
6
+ return l.outerRadius;
7
+ }
8
+ function gn(l) {
9
+ return l.startAngle;
10
+ }
11
+ function dn(l) {
12
+ return l.endAngle;
13
+ }
14
+ function mn(l) {
15
+ return l && l.padAngle;
16
+ }
17
+ function pn(l, h, I, D, v, A, C, a) {
18
+ var O = I - l, i = D - h, n = C - v, d = a - A, u = d * O - n * i;
19
+ if (!(u * u < y))
20
+ return u = (n * (h - A) - d * (l - v)) / u, [l + u * O, h + u * i];
21
+ }
22
+ function W(l, h, I, D, v, A, C) {
23
+ 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;
24
+ return x * x + e * e > r * r + G * G && (j = w, z = p), {
25
+ cx: j,
26
+ cy: z,
27
+ x01: -n,
28
+ y01: -d,
29
+ x11: j * (v / T - 1),
30
+ y11: z * (v / T - 1)
31
+ };
32
+ }
33
+ function hn() {
34
+ var l = cn, h = yn, I = B(0), D = null, v = gn, A = dn, C = mn, a = null, O = ln(i);
35
+ function i() {
36
+ 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;
37
+ if (a || (a = n = O()), s < u && (d = s, s = u, u = d), !(s > y)) a.moveTo(0, 0);
38
+ else if (F > tn - y)
39
+ 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));
40
+ else {
41
+ 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;
42
+ if (z > y) {
43
+ var G = sn(z / u * q(j)), M = sn(z / s * q(j));
44
+ (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);
45
+ }
46
+ var J = s * H(m), K = s * q(m), N = u * H(T), Q = u * q(T);
47
+ if (w > y) {
48
+ var U = s * H(g), V = s * q(g), X = u * H(R), Y = u * q(R), E;
49
+ if (F < an)
50
+ if (E = pn(J, K, X, Y, U, V, N, Q)) {
51
+ 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]);
52
+ p = _(w, (u - en) / (nn - 1)), x = _(w, (s - en) / (nn + 1));
53
+ } else
54
+ p = x = 0;
55
+ }
56
+ 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);
57
+ }
58
+ if (a.closePath(), n) return a = null, n + "" || null;
59
+ }
60
+ return i.centroid = function() {
61
+ var n = (+l.apply(this, arguments) + +h.apply(this, arguments)) / 2, d = (+v.apply(this, arguments) + +A.apply(this, arguments)) / 2 - an / 2;
62
+ return [H(d) * n, q(d) * n];
63
+ }, i.innerRadius = function(n) {
64
+ return arguments.length ? (l = typeof n == "function" ? n : B(+n), i) : l;
65
+ }, i.outerRadius = function(n) {
66
+ return arguments.length ? (h = typeof n == "function" ? n : B(+n), i) : h;
67
+ }, i.cornerRadius = function(n) {
68
+ return arguments.length ? (I = typeof n == "function" ? n : B(+n), i) : I;
69
+ }, i.padRadius = function(n) {
70
+ return arguments.length ? (D = n == null ? null : typeof n == "function" ? n : B(+n), i) : D;
71
+ }, i.startAngle = function(n) {
72
+ return arguments.length ? (v = typeof n == "function" ? n : B(+n), i) : v;
73
+ }, i.endAngle = function(n) {
74
+ return arguments.length ? (A = typeof n == "function" ? n : B(+n), i) : A;
75
+ }, i.padAngle = function(n) {
76
+ return arguments.length ? (C = typeof n == "function" ? n : B(+n), i) : C;
77
+ }, i.context = function(n) {
78
+ return arguments.length ? (a = n ?? null, i) : a;
79
+ }, i;
80
+ }
81
+ export {
82
+ hn as d
83
+ };
src/backend/gradio_dropdownplus/templates/component/architectureDiagram-KFL7JDKH-C-2X1Z0P.js ADDED
The diff for this file is too large to render. See raw diff
 
src/backend/gradio_dropdownplus/templates/component/auto-render-BwaQGe8P.js ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import g from "./katex-DfcU2jCX.js";
2
+ var c = function(t, a, e) {
3
+ for (var r = e, n = 0, l = t.length; r < a.length; ) {
4
+ var d = a[r];
5
+ if (n <= 0 && a.slice(r, r + l) === t)
6
+ return r;
7
+ d === "\\" ? r++ : d === "{" ? n++ : d === "}" && n--, r++;
8
+ }
9
+ return -1;
10
+ }, o = function(t) {
11
+ return t.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
12
+ }, p = /^\\begin{/, m = function(t, a) {
13
+ for (var e, r = [], n = new RegExp("(" + a.map((f) => o(f.left)).join("|") + ")"); e = t.search(n), e !== -1; ) {
14
+ e > 0 && (r.push({
15
+ type: "text",
16
+ data: t.slice(0, e)
17
+ }), t = t.slice(e));
18
+ var l = a.findIndex((f) => t.startsWith(f.left));
19
+ if (e = c(a[l].right, t, a[l].left.length), e === -1)
20
+ break;
21
+ var d = t.slice(0, e + a[l].right.length), i = p.test(d) ? d : t.slice(a[l].left.length, e);
22
+ r.push({
23
+ type: "math",
24
+ data: i,
25
+ rawData: d,
26
+ display: a[l].display
27
+ }), t = t.slice(e + a[l].right.length);
28
+ }
29
+ return t !== "" && r.push({
30
+ type: "text",
31
+ data: t
32
+ }), r;
33
+ }, y = function(t, a) {
34
+ var e = m(t, a.delimiters);
35
+ if (e.length === 1 && e[0].type === "text")
36
+ return null;
37
+ for (var r = document.createDocumentFragment(), n = 0; n < e.length; n++)
38
+ if (e[n].type === "text")
39
+ r.appendChild(document.createTextNode(e[n].data));
40
+ else {
41
+ var l = document.createElement("span"), d = e[n].data;
42
+ a.displayMode = e[n].display;
43
+ try {
44
+ a.preProcess && (d = a.preProcess(d)), g.render(d, l, a);
45
+ } catch (i) {
46
+ if (!(i instanceof g.ParseError))
47
+ throw i;
48
+ a.errorCallback("KaTeX auto-render: Failed to parse `" + e[n].data + "` with ", i), r.appendChild(document.createTextNode(e[n].rawData));
49
+ continue;
50
+ }
51
+ r.appendChild(l);
52
+ }
53
+ return r;
54
+ }, T = function s(t, a) {
55
+ for (var e = 0; e < t.childNodes.length; e++) {
56
+ var r = t.childNodes[e];
57
+ if (r.nodeType === 3) {
58
+ for (var n = r.textContent, l = r.nextSibling, d = 0; l && l.nodeType === Node.TEXT_NODE; )
59
+ n += l.textContent, l = l.nextSibling, d++;
60
+ var i = y(n, a);
61
+ if (i) {
62
+ for (var f = 0; f < d; f++)
63
+ r.nextSibling.remove();
64
+ e += i.childNodes.length - 1, t.replaceChild(i, r);
65
+ } else
66
+ e += d;
67
+ } else r.nodeType === 1 && function() {
68
+ var h = " " + r.className + " ", v = a.ignoredTags.indexOf(r.nodeName.toLowerCase()) === -1 && a.ignoredClasses.every((u) => h.indexOf(" " + u + " ") === -1);
69
+ v && s(r, a);
70
+ }();
71
+ }
72
+ }, E = function(t, a) {
73
+ if (!t)
74
+ throw new Error("No element provided to render");
75
+ var e = {};
76
+ for (var r in a)
77
+ a.hasOwnProperty(r) && (e[r] = a[r]);
78
+ e.delimiters = e.delimiters || [
79
+ {
80
+ left: "$$",
81
+ right: "$$",
82
+ display: !0
83
+ },
84
+ {
85
+ left: "\\(",
86
+ right: "\\)",
87
+ display: !1
88
+ },
89
+ // LaTeX uses $…$, but it ruins the display of normal `$` in text:
90
+ // {left: "$", right: "$", display: false},
91
+ // $ must come after $$
92
+ // Render AMS environments even if outside $$…$$ delimiters.
93
+ {
94
+ left: "\\begin{equation}",
95
+ right: "\\end{equation}",
96
+ display: !0
97
+ },
98
+ {
99
+ left: "\\begin{align}",
100
+ right: "\\end{align}",
101
+ display: !0
102
+ },
103
+ {
104
+ left: "\\begin{alignat}",
105
+ right: "\\end{alignat}",
106
+ display: !0
107
+ },
108
+ {
109
+ left: "\\begin{gather}",
110
+ right: "\\end{gather}",
111
+ display: !0
112
+ },
113
+ {
114
+ left: "\\begin{CD}",
115
+ right: "\\end{CD}",
116
+ display: !0
117
+ },
118
+ {
119
+ left: "\\[",
120
+ right: "\\]",
121
+ display: !0
122
+ }
123
+ ], e.ignoredTags = e.ignoredTags || ["script", "noscript", "style", "textarea", "pre", "code", "option"], e.ignoredClasses = e.ignoredClasses || [], e.errorCallback = e.errorCallback || console.error, e.macros = e.macros || {}, T(t, e);
124
+ };
125
+ export {
126
+ E as default
127
+ };
src/backend/gradio_dropdownplus/templates/component/blockDiagram-ZYB65J3Q-z8G70kQc.js ADDED
The diff for this file is too large to render. See raw diff
 
src/backend/gradio_dropdownplus/templates/component/c4Diagram-AAMF2YG6-D6LTjEDm.js ADDED
@@ -0,0 +1,1581 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { g as Se, d as De } from "./chunk-OMD6QJNC-dXofsL9p.js";
2
+ 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-D58rAnek.js";
3
+ var Ft = function() {
4
+ var e = /* @__PURE__ */ g(function(_t, x, m, v) {
5
+ for (m = m || {}, v = _t.length; v--; m[_t[v]] = x) ;
6
+ return m;
7
+ }, "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 = {
8
+ trace: /* @__PURE__ */ g(function() {
9
+ }, "trace"),
10
+ yy: {},
11
+ 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 },
12
+ 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" },
13
+ 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]],
14
+ performAction: /* @__PURE__ */ g(function(x, m, v, b, R, h, Dt) {
15
+ var p = h.length - 1;
16
+ switch (R) {
17
+ case 3:
18
+ b.setDirection("TB");
19
+ break;
20
+ case 4:
21
+ b.setDirection("BT");
22
+ break;
23
+ case 5:
24
+ b.setDirection("RL");
25
+ break;
26
+ case 6:
27
+ b.setDirection("LR");
28
+ break;
29
+ case 8:
30
+ case 9:
31
+ case 10:
32
+ case 11:
33
+ case 12:
34
+ b.setC4Type(h[p - 3]);
35
+ break;
36
+ case 19:
37
+ b.setTitle(h[p].substring(6)), this.$ = h[p].substring(6);
38
+ break;
39
+ case 20:
40
+ b.setAccDescription(h[p].substring(15)), this.$ = h[p].substring(15);
41
+ break;
42
+ case 21:
43
+ this.$ = h[p].trim(), b.setTitle(this.$);
44
+ break;
45
+ case 22:
46
+ case 23:
47
+ this.$ = h[p].trim(), b.setAccDescription(this.$);
48
+ break;
49
+ case 28:
50
+ h[p].splice(2, 0, "ENTERPRISE"), b.addPersonOrSystemBoundary(...h[p]), this.$ = h[p];
51
+ break;
52
+ case 29:
53
+ h[p].splice(2, 0, "SYSTEM"), b.addPersonOrSystemBoundary(...h[p]), this.$ = h[p];
54
+ break;
55
+ case 30:
56
+ b.addPersonOrSystemBoundary(...h[p]), this.$ = h[p];
57
+ break;
58
+ case 31:
59
+ h[p].splice(2, 0, "CONTAINER"), b.addContainerBoundary(...h[p]), this.$ = h[p];
60
+ break;
61
+ case 32:
62
+ b.addDeploymentNode("node", ...h[p]), this.$ = h[p];
63
+ break;
64
+ case 33:
65
+ b.addDeploymentNode("nodeL", ...h[p]), this.$ = h[p];
66
+ break;
67
+ case 34:
68
+ b.addDeploymentNode("nodeR", ...h[p]), this.$ = h[p];
69
+ break;
70
+ case 35:
71
+ b.popBoundaryParseStack();
72
+ break;
73
+ case 39:
74
+ b.addPersonOrSystem("person", ...h[p]), this.$ = h[p];
75
+ break;
76
+ case 40:
77
+ b.addPersonOrSystem("external_person", ...h[p]), this.$ = h[p];
78
+ break;
79
+ case 41:
80
+ b.addPersonOrSystem("system", ...h[p]), this.$ = h[p];
81
+ break;
82
+ case 42:
83
+ b.addPersonOrSystem("system_db", ...h[p]), this.$ = h[p];
84
+ break;
85
+ case 43:
86
+ b.addPersonOrSystem("system_queue", ...h[p]), this.$ = h[p];
87
+ break;
88
+ case 44:
89
+ b.addPersonOrSystem("external_system", ...h[p]), this.$ = h[p];
90
+ break;
91
+ case 45:
92
+ b.addPersonOrSystem("external_system_db", ...h[p]), this.$ = h[p];
93
+ break;
94
+ case 46:
95
+ b.addPersonOrSystem("external_system_queue", ...h[p]), this.$ = h[p];
96
+ break;
97
+ case 47:
98
+ b.addContainer("container", ...h[p]), this.$ = h[p];
99
+ break;
100
+ case 48:
101
+ b.addContainer("container_db", ...h[p]), this.$ = h[p];
102
+ break;
103
+ case 49:
104
+ b.addContainer("container_queue", ...h[p]), this.$ = h[p];
105
+ break;
106
+ case 50:
107
+ b.addContainer("external_container", ...h[p]), this.$ = h[p];
108
+ break;
109
+ case 51:
110
+ b.addContainer("external_container_db", ...h[p]), this.$ = h[p];
111
+ break;
112
+ case 52:
113
+ b.addContainer("external_container_queue", ...h[p]), this.$ = h[p];
114
+ break;
115
+ case 53:
116
+ b.addComponent("component", ...h[p]), this.$ = h[p];
117
+ break;
118
+ case 54:
119
+ b.addComponent("component_db", ...h[p]), this.$ = h[p];
120
+ break;
121
+ case 55:
122
+ b.addComponent("component_queue", ...h[p]), this.$ = h[p];
123
+ break;
124
+ case 56:
125
+ b.addComponent("external_component", ...h[p]), this.$ = h[p];
126
+ break;
127
+ case 57:
128
+ b.addComponent("external_component_db", ...h[p]), this.$ = h[p];
129
+ break;
130
+ case 58:
131
+ b.addComponent("external_component_queue", ...h[p]), this.$ = h[p];
132
+ break;
133
+ case 60:
134
+ b.addRel("rel", ...h[p]), this.$ = h[p];
135
+ break;
136
+ case 61:
137
+ b.addRel("birel", ...h[p]), this.$ = h[p];
138
+ break;
139
+ case 62:
140
+ b.addRel("rel_u", ...h[p]), this.$ = h[p];
141
+ break;
142
+ case 63:
143
+ b.addRel("rel_d", ...h[p]), this.$ = h[p];
144
+ break;
145
+ case 64:
146
+ b.addRel("rel_l", ...h[p]), this.$ = h[p];
147
+ break;
148
+ case 65:
149
+ b.addRel("rel_r", ...h[p]), this.$ = h[p];
150
+ break;
151
+ case 66:
152
+ b.addRel("rel_b", ...h[p]), this.$ = h[p];
153
+ break;
154
+ case 67:
155
+ h[p].splice(0, 1), b.addRel("rel", ...h[p]), this.$ = h[p];
156
+ break;
157
+ case 68:
158
+ b.updateElStyle("update_el_style", ...h[p]), this.$ = h[p];
159
+ break;
160
+ case 69:
161
+ b.updateRelStyle("update_rel_style", ...h[p]), this.$ = h[p];
162
+ break;
163
+ case 70:
164
+ b.updateLayoutConfig("update_layout_config", ...h[p]), this.$ = h[p];
165
+ break;
166
+ case 71:
167
+ this.$ = [h[p]];
168
+ break;
169
+ case 72:
170
+ h[p].unshift(h[p - 1]), this.$ = h[p];
171
+ break;
172
+ case 73:
173
+ case 75:
174
+ this.$ = h[p].trim();
175
+ break;
176
+ case 74:
177
+ let Et = {};
178
+ Et[h[p - 1].trim()] = h[p].trim(), this.$ = Et;
179
+ break;
180
+ case 76:
181
+ this.$ = "";
182
+ break;
183
+ }
184
+ }, "anonymous"),
185
+ 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])],
186
+ 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] },
187
+ parseError: /* @__PURE__ */ g(function(x, m) {
188
+ if (m.recoverable)
189
+ this.trace(x);
190
+ else {
191
+ var v = new Error(x);
192
+ throw v.hash = m, v;
193
+ }
194
+ }, "parseError"),
195
+ parse: /* @__PURE__ */ g(function(x) {
196
+ 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: {} };
197
+ for (var Gt in this.yy)
198
+ Object.prototype.hasOwnProperty.call(this.yy, Gt) && (kt.yy[Gt] = this.yy[Gt]);
199
+ D.setInput(x, kt.yy), kt.yy.lexer = D, kt.yy.parser = this, typeof D.yylloc > "u" && (D.yylloc = {});
200
+ var Kt = D.yylloc;
201
+ h.push(Kt);
202
+ var Oe = D.options && D.options.ranges;
203
+ typeof kt.yy.parseError == "function" ? this.parseError = kt.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
204
+ function Re(L) {
205
+ v.length = v.length - 2 * L, R.length = R.length - L, h.length = h.length - L;
206
+ }
207
+ g(Re, "popStack");
208
+ function he() {
209
+ var L;
210
+ return L = b.pop() || D.lex() || ce, typeof L != "number" && (L instanceof Array && (b = L, L = b.pop()), L = m.symbols_[L] || L), L;
211
+ }
212
+ g(he, "lex");
213
+ for (var I, At, N, Jt, wt = {}, Nt, W, ue, Yt; ; ) {
214
+ 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]) {
215
+ var Zt = "";
216
+ Yt = [];
217
+ for (Nt in Dt[At])
218
+ this.terminals_[Nt] && Nt > we && Yt.push("'" + this.terminals_[Nt] + "'");
219
+ D.showPosition ? Zt = "Parse error on line " + (Et + 1) + `:
220
+ ` + D.showPosition() + `
221
+ 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, {
222
+ text: D.match,
223
+ token: this.terminals_[I] || I,
224
+ line: D.yylineno,
225
+ loc: Kt,
226
+ expected: Yt
227
+ });
228
+ }
229
+ if (N[0] instanceof Array && N.length > 1)
230
+ throw new Error("Parse Error: multiple actions possible at state: " + At + ", token: " + I);
231
+ switch (N[0]) {
232
+ case 1:
233
+ 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;
234
+ break;
235
+ case 2:
236
+ if (W = this.productions_[N[1]][1], wt.$ = R[R.length - W], wt._$ = {
237
+ first_line: h[h.length - (W || 1)].first_line,
238
+ last_line: h[h.length - 1].last_line,
239
+ first_column: h[h.length - (W || 1)].first_column,
240
+ last_column: h[h.length - 1].last_column
241
+ }, Oe && (wt._$.range = [
242
+ h[h.length - (W || 1)].range[0],
243
+ h[h.length - 1].range[1]
244
+ ]), Jt = this.performAction.apply(wt, [
245
+ p,
246
+ oe,
247
+ Et,
248
+ kt.yy,
249
+ N[1],
250
+ R,
251
+ h
252
+ ].concat(Te)), typeof Jt < "u")
253
+ return Jt;
254
+ 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);
255
+ break;
256
+ case 3:
257
+ return !0;
258
+ }
259
+ }
260
+ return !0;
261
+ }, "parse")
262
+ }, Ce = /* @__PURE__ */ function() {
263
+ var _t = {
264
+ EOF: 1,
265
+ parseError: /* @__PURE__ */ g(function(m, v) {
266
+ if (this.yy.parser)
267
+ this.yy.parser.parseError(m, v);
268
+ else
269
+ throw new Error(m);
270
+ }, "parseError"),
271
+ // resets the lexer, sets new input
272
+ setInput: /* @__PURE__ */ g(function(x, m) {
273
+ 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 = {
274
+ first_line: 1,
275
+ first_column: 0,
276
+ last_line: 1,
277
+ last_column: 0
278
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
279
+ }, "setInput"),
280
+ // consumes and returns one char from the input
281
+ input: /* @__PURE__ */ g(function() {
282
+ var x = this._input[0];
283
+ this.yytext += x, this.yyleng++, this.offset++, this.match += x, this.matched += x;
284
+ var m = x.match(/(?:\r\n?|\n).*/g);
285
+ 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;
286
+ }, "input"),
287
+ // unshifts one char (or a string) into the input
288
+ unput: /* @__PURE__ */ g(function(x) {
289
+ var m = x.length, v = x.split(/(?:\r\n?|\n)/g);
290
+ this._input = x + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - m), this.offset -= m;
291
+ var b = this.match.split(/(?:\r\n?|\n)/g);
292
+ 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);
293
+ var R = this.yylloc.range;
294
+ return this.yylloc = {
295
+ first_line: this.yylloc.first_line,
296
+ last_line: this.yylineno + 1,
297
+ first_column: this.yylloc.first_column,
298
+ 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
299
+ }, this.options.ranges && (this.yylloc.range = [R[0], R[0] + this.yyleng - m]), this.yyleng = this.yytext.length, this;
300
+ }, "unput"),
301
+ // When called from action, caches matched text and appends it on next action
302
+ more: /* @__PURE__ */ g(function() {
303
+ return this._more = !0, this;
304
+ }, "more"),
305
+ // 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.
306
+ reject: /* @__PURE__ */ g(function() {
307
+ if (this.options.backtrack_lexer)
308
+ this._backtrack = !0;
309
+ else
310
+ 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).
311
+ ` + this.showPosition(), {
312
+ text: "",
313
+ token: null,
314
+ line: this.yylineno
315
+ });
316
+ return this;
317
+ }, "reject"),
318
+ // retain first n characters of the match
319
+ less: /* @__PURE__ */ g(function(x) {
320
+ this.unput(this.match.slice(x));
321
+ }, "less"),
322
+ // displays already matched input, i.e. for error messages
323
+ pastInput: /* @__PURE__ */ g(function() {
324
+ var x = this.matched.substr(0, this.matched.length - this.match.length);
325
+ return (x.length > 20 ? "..." : "") + x.substr(-20).replace(/\n/g, "");
326
+ }, "pastInput"),
327
+ // displays upcoming input, i.e. for error messages
328
+ upcomingInput: /* @__PURE__ */ g(function() {
329
+ var x = this.match;
330
+ return x.length < 20 && (x += this._input.substr(0, 20 - x.length)), (x.substr(0, 20) + (x.length > 20 ? "..." : "")).replace(/\n/g, "");
331
+ }, "upcomingInput"),
332
+ // displays the character position where the lexing error occurred, i.e. for error messages
333
+ showPosition: /* @__PURE__ */ g(function() {
334
+ var x = this.pastInput(), m = new Array(x.length + 1).join("-");
335
+ return x + this.upcomingInput() + `
336
+ ` + m + "^";
337
+ }, "showPosition"),
338
+ // test the lexed token: return FALSE when not a match, otherwise return token
339
+ test_match: /* @__PURE__ */ g(function(x, m) {
340
+ var v, b, R;
341
+ if (this.options.backtrack_lexer && (R = {
342
+ yylineno: this.yylineno,
343
+ yylloc: {
344
+ first_line: this.yylloc.first_line,
345
+ last_line: this.last_line,
346
+ first_column: this.yylloc.first_column,
347
+ last_column: this.yylloc.last_column
348
+ },
349
+ yytext: this.yytext,
350
+ match: this.match,
351
+ matches: this.matches,
352
+ matched: this.matched,
353
+ yyleng: this.yyleng,
354
+ offset: this.offset,
355
+ _more: this._more,
356
+ _input: this._input,
357
+ yy: this.yy,
358
+ conditionStack: this.conditionStack.slice(0),
359
+ done: this.done
360
+ }, 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 = {
361
+ first_line: this.yylloc.last_line,
362
+ last_line: this.yylineno + 1,
363
+ first_column: this.yylloc.last_column,
364
+ last_column: b ? b[b.length - 1].length - b[b.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + x[0].length
365
+ }, 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)
366
+ return v;
367
+ if (this._backtrack) {
368
+ for (var h in R)
369
+ this[h] = R[h];
370
+ return !1;
371
+ }
372
+ return !1;
373
+ }, "test_match"),
374
+ // return next match in input
375
+ next: /* @__PURE__ */ g(function() {
376
+ if (this.done)
377
+ return this.EOF;
378
+ this._input || (this.done = !0);
379
+ var x, m, v, b;
380
+ this._more || (this.yytext = "", this.match = "");
381
+ for (var R = this._currentRules(), h = 0; h < R.length; h++)
382
+ if (v = this._input.match(this.rules[R[h]]), v && (!m || v[0].length > m[0].length)) {
383
+ if (m = v, b = h, this.options.backtrack_lexer) {
384
+ if (x = this.test_match(v, R[h]), x !== !1)
385
+ return x;
386
+ if (this._backtrack) {
387
+ m = !1;
388
+ continue;
389
+ } else
390
+ return !1;
391
+ } else if (!this.options.flex)
392
+ break;
393
+ }
394
+ 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.
395
+ ` + this.showPosition(), {
396
+ text: "",
397
+ token: null,
398
+ line: this.yylineno
399
+ });
400
+ }, "next"),
401
+ // return next match that has a token
402
+ lex: /* @__PURE__ */ g(function() {
403
+ var m = this.next();
404
+ return m || this.lex();
405
+ }, "lex"),
406
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
407
+ begin: /* @__PURE__ */ g(function(m) {
408
+ this.conditionStack.push(m);
409
+ }, "begin"),
410
+ // pop the previously active lexer condition state off the condition stack
411
+ popState: /* @__PURE__ */ g(function() {
412
+ var m = this.conditionStack.length - 1;
413
+ return m > 0 ? this.conditionStack.pop() : this.conditionStack[0];
414
+ }, "popState"),
415
+ // produce the lexer rule set which is active for the currently active lexer condition state
416
+ _currentRules: /* @__PURE__ */ g(function() {
417
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
418
+ }, "_currentRules"),
419
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
420
+ topState: /* @__PURE__ */ g(function(m) {
421
+ return m = this.conditionStack.length - 1 - Math.abs(m || 0), m >= 0 ? this.conditionStack[m] : "INITIAL";
422
+ }, "topState"),
423
+ // alias for begin(condition)
424
+ pushState: /* @__PURE__ */ g(function(m) {
425
+ this.begin(m);
426
+ }, "pushState"),
427
+ // return the number of states currently on the stack
428
+ stateStackSize: /* @__PURE__ */ g(function() {
429
+ return this.conditionStack.length;
430
+ }, "stateStackSize"),
431
+ options: {},
432
+ performAction: /* @__PURE__ */ g(function(m, v, b, R) {
433
+ switch (b) {
434
+ case 0:
435
+ return 6;
436
+ case 1:
437
+ return 7;
438
+ case 2:
439
+ return 8;
440
+ case 3:
441
+ return 9;
442
+ case 4:
443
+ return 22;
444
+ case 5:
445
+ return 23;
446
+ case 6:
447
+ return this.begin("acc_title"), 24;
448
+ case 7:
449
+ return this.popState(), "acc_title_value";
450
+ case 8:
451
+ return this.begin("acc_descr"), 26;
452
+ case 9:
453
+ return this.popState(), "acc_descr_value";
454
+ case 10:
455
+ this.begin("acc_descr_multiline");
456
+ break;
457
+ case 11:
458
+ this.popState();
459
+ break;
460
+ case 12:
461
+ return "acc_descr_multiline_value";
462
+ case 13:
463
+ break;
464
+ case 14:
465
+ c;
466
+ break;
467
+ case 15:
468
+ return 12;
469
+ case 16:
470
+ break;
471
+ case 17:
472
+ return 11;
473
+ case 18:
474
+ return 15;
475
+ case 19:
476
+ return 16;
477
+ case 20:
478
+ return 17;
479
+ case 21:
480
+ return 18;
481
+ case 22:
482
+ return this.begin("person_ext"), 45;
483
+ case 23:
484
+ return this.begin("person"), 44;
485
+ case 24:
486
+ return this.begin("system_ext_queue"), 51;
487
+ case 25:
488
+ return this.begin("system_ext_db"), 50;
489
+ case 26:
490
+ return this.begin("system_ext"), 49;
491
+ case 27:
492
+ return this.begin("system_queue"), 48;
493
+ case 28:
494
+ return this.begin("system_db"), 47;
495
+ case 29:
496
+ return this.begin("system"), 46;
497
+ case 30:
498
+ return this.begin("boundary"), 37;
499
+ case 31:
500
+ return this.begin("enterprise_boundary"), 34;
501
+ case 32:
502
+ return this.begin("system_boundary"), 36;
503
+ case 33:
504
+ return this.begin("container_ext_queue"), 57;
505
+ case 34:
506
+ return this.begin("container_ext_db"), 56;
507
+ case 35:
508
+ return this.begin("container_ext"), 55;
509
+ case 36:
510
+ return this.begin("container_queue"), 54;
511
+ case 37:
512
+ return this.begin("container_db"), 53;
513
+ case 38:
514
+ return this.begin("container"), 52;
515
+ case 39:
516
+ return this.begin("container_boundary"), 38;
517
+ case 40:
518
+ return this.begin("component_ext_queue"), 63;
519
+ case 41:
520
+ return this.begin("component_ext_db"), 62;
521
+ case 42:
522
+ return this.begin("component_ext"), 61;
523
+ case 43:
524
+ return this.begin("component_queue"), 60;
525
+ case 44:
526
+ return this.begin("component_db"), 59;
527
+ case 45:
528
+ return this.begin("component"), 58;
529
+ case 46:
530
+ return this.begin("node"), 39;
531
+ case 47:
532
+ return this.begin("node"), 39;
533
+ case 48:
534
+ return this.begin("node_l"), 40;
535
+ case 49:
536
+ return this.begin("node_r"), 41;
537
+ case 50:
538
+ return this.begin("rel"), 64;
539
+ case 51:
540
+ return this.begin("birel"), 65;
541
+ case 52:
542
+ return this.begin("rel_u"), 66;
543
+ case 53:
544
+ return this.begin("rel_u"), 66;
545
+ case 54:
546
+ return this.begin("rel_d"), 67;
547
+ case 55:
548
+ return this.begin("rel_d"), 67;
549
+ case 56:
550
+ return this.begin("rel_l"), 68;
551
+ case 57:
552
+ return this.begin("rel_l"), 68;
553
+ case 58:
554
+ return this.begin("rel_r"), 69;
555
+ case 59:
556
+ return this.begin("rel_r"), 69;
557
+ case 60:
558
+ return this.begin("rel_b"), 70;
559
+ case 61:
560
+ return this.begin("rel_index"), 71;
561
+ case 62:
562
+ return this.begin("update_el_style"), 72;
563
+ case 63:
564
+ return this.begin("update_rel_style"), 73;
565
+ case 64:
566
+ return this.begin("update_layout_config"), 74;
567
+ case 65:
568
+ return "EOF_IN_STRUCT";
569
+ case 66:
570
+ return this.begin("attribute"), "ATTRIBUTE_EMPTY";
571
+ case 67:
572
+ this.begin("attribute");
573
+ break;
574
+ case 68:
575
+ this.popState(), this.popState();
576
+ break;
577
+ case 69:
578
+ return 80;
579
+ case 70:
580
+ break;
581
+ case 71:
582
+ return 80;
583
+ case 72:
584
+ this.begin("string");
585
+ break;
586
+ case 73:
587
+ this.popState();
588
+ break;
589
+ case 74:
590
+ return "STR";
591
+ case 75:
592
+ this.begin("string_kv");
593
+ break;
594
+ case 76:
595
+ return this.begin("string_kv_key"), "STR_KEY";
596
+ case 77:
597
+ this.popState(), this.begin("string_kv_value");
598
+ break;
599
+ case 78:
600
+ return "STR_VALUE";
601
+ case 79:
602
+ this.popState(), this.popState();
603
+ break;
604
+ case 80:
605
+ return "STR";
606
+ case 81:
607
+ return "LBRACE";
608
+ case 82:
609
+ return "RBRACE";
610
+ case 83:
611
+ return "SPACE";
612
+ case 84:
613
+ return "EOL";
614
+ case 85:
615
+ return 14;
616
+ }
617
+ }, "anonymous"),
618
+ 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]+)/, /^(?:$)/],
619
+ 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 } }
620
+ };
621
+ return _t;
622
+ }();
623
+ qt.lexer = Ce;
624
+ function Lt() {
625
+ this.yy = {};
626
+ }
627
+ return g(Lt, "Parser"), Lt.prototype = qt, qt.Parser = Lt, new Lt();
628
+ }();
629
+ Ft.parser = Ft;
630
+ var Ue = Ft, V = [], xt = [""], B = "global", F = "", X = [
631
+ {
632
+ alias: "global",
633
+ label: { text: "global" },
634
+ type: { text: "global" },
635
+ tags: null,
636
+ link: null,
637
+ parentBoundary: ""
638
+ }
639
+ ], It = [], ie = "", ne = !1, Vt = 4, zt = 2, be, Fe = /* @__PURE__ */ g(function() {
640
+ return be;
641
+ }, "getC4Type"), Ve = /* @__PURE__ */ g(function(e) {
642
+ be = ge(e, Bt());
643
+ }, "setC4Type"), ze = /* @__PURE__ */ g(function(e, t, s, o, l, a, r, n, i) {
644
+ if (e == null || t === void 0 || t === null || s === void 0 || s === null || o === void 0 || o === null)
645
+ return;
646
+ let u = {};
647
+ const d = It.find((f) => f.from === t && f.to === s);
648
+ if (d ? u = d : It.push(u), u.type = e, u.from = t, u.to = s, u.label = { text: o }, l == null)
649
+ u.techn = { text: "" };
650
+ else if (typeof l == "object") {
651
+ let [f, y] = Object.entries(l)[0];
652
+ u[f] = { text: y };
653
+ } else
654
+ u.techn = { text: l };
655
+ if (a == null)
656
+ u.descr = { text: "" };
657
+ else if (typeof a == "object") {
658
+ let [f, y] = Object.entries(a)[0];
659
+ u[f] = { text: y };
660
+ } else
661
+ u.descr = { text: a };
662
+ if (typeof r == "object") {
663
+ let [f, y] = Object.entries(r)[0];
664
+ u[f] = y;
665
+ } else
666
+ u.sprite = r;
667
+ if (typeof n == "object") {
668
+ let [f, y] = Object.entries(n)[0];
669
+ u[f] = y;
670
+ } else
671
+ u.tags = n;
672
+ if (typeof i == "object") {
673
+ let [f, y] = Object.entries(i)[0];
674
+ u[f] = y;
675
+ } else
676
+ u.link = i;
677
+ u.wrap = mt();
678
+ }, "addRel"), Xe = /* @__PURE__ */ g(function(e, t, s, o, l, a, r) {
679
+ if (t === null || s === null)
680
+ return;
681
+ let n = {};
682
+ const i = V.find((u) => u.alias === t);
683
+ if (i && t === i.alias ? n = i : (n.alias = t, V.push(n)), s == null ? n.label = { text: "" } : n.label = { text: s }, o == null)
684
+ n.descr = { text: "" };
685
+ else if (typeof o == "object") {
686
+ let [u, d] = Object.entries(o)[0];
687
+ n[u] = { text: d };
688
+ } else
689
+ n.descr = { text: o };
690
+ if (typeof l == "object") {
691
+ let [u, d] = Object.entries(l)[0];
692
+ n[u] = d;
693
+ } else
694
+ n.sprite = l;
695
+ if (typeof a == "object") {
696
+ let [u, d] = Object.entries(a)[0];
697
+ n[u] = d;
698
+ } else
699
+ n.tags = a;
700
+ if (typeof r == "object") {
701
+ let [u, d] = Object.entries(r)[0];
702
+ n[u] = d;
703
+ } else
704
+ n.link = r;
705
+ n.typeC4Shape = { text: e }, n.parentBoundary = B, n.wrap = mt();
706
+ }, "addPersonOrSystem"), We = /* @__PURE__ */ g(function(e, t, s, o, l, a, r, n) {
707
+ if (t === null || s === null)
708
+ return;
709
+ let i = {};
710
+ const u = V.find((d) => d.alias === t);
711
+ if (u && t === u.alias ? i = u : (i.alias = t, V.push(i)), s == null ? i.label = { text: "" } : i.label = { text: s }, o == null)
712
+ i.techn = { text: "" };
713
+ else if (typeof o == "object") {
714
+ let [d, f] = Object.entries(o)[0];
715
+ i[d] = { text: f };
716
+ } else
717
+ i.techn = { text: o };
718
+ if (l == null)
719
+ i.descr = { text: "" };
720
+ else if (typeof l == "object") {
721
+ let [d, f] = Object.entries(l)[0];
722
+ i[d] = { text: f };
723
+ } else
724
+ i.descr = { text: l };
725
+ if (typeof a == "object") {
726
+ let [d, f] = Object.entries(a)[0];
727
+ i[d] = f;
728
+ } else
729
+ i.sprite = a;
730
+ if (typeof r == "object") {
731
+ let [d, f] = Object.entries(r)[0];
732
+ i[d] = f;
733
+ } else
734
+ i.tags = r;
735
+ if (typeof n == "object") {
736
+ let [d, f] = Object.entries(n)[0];
737
+ i[d] = f;
738
+ } else
739
+ i.link = n;
740
+ i.wrap = mt(), i.typeC4Shape = { text: e }, i.parentBoundary = B;
741
+ }, "addContainer"), Qe = /* @__PURE__ */ g(function(e, t, s, o, l, a, r, n) {
742
+ if (t === null || s === null)
743
+ return;
744
+ let i = {};
745
+ const u = V.find((d) => d.alias === t);
746
+ if (u && t === u.alias ? i = u : (i.alias = t, V.push(i)), s == null ? i.label = { text: "" } : i.label = { text: s }, o == null)
747
+ i.techn = { text: "" };
748
+ else if (typeof o == "object") {
749
+ let [d, f] = Object.entries(o)[0];
750
+ i[d] = { text: f };
751
+ } else
752
+ i.techn = { text: o };
753
+ if (l == null)
754
+ i.descr = { text: "" };
755
+ else if (typeof l == "object") {
756
+ let [d, f] = Object.entries(l)[0];
757
+ i[d] = { text: f };
758
+ } else
759
+ i.descr = { text: l };
760
+ if (typeof a == "object") {
761
+ let [d, f] = Object.entries(a)[0];
762
+ i[d] = f;
763
+ } else
764
+ i.sprite = a;
765
+ if (typeof r == "object") {
766
+ let [d, f] = Object.entries(r)[0];
767
+ i[d] = f;
768
+ } else
769
+ i.tags = r;
770
+ if (typeof n == "object") {
771
+ let [d, f] = Object.entries(n)[0];
772
+ i[d] = f;
773
+ } else
774
+ i.link = n;
775
+ i.wrap = mt(), i.typeC4Shape = { text: e }, i.parentBoundary = B;
776
+ }, "addComponent"), He = /* @__PURE__ */ g(function(e, t, s, o, l) {
777
+ if (e === null || t === null)
778
+ return;
779
+ let a = {};
780
+ const r = X.find((n) => n.alias === e);
781
+ if (r && e === r.alias ? a = r : (a.alias = e, X.push(a)), t == null ? a.label = { text: "" } : a.label = { text: t }, s == null)
782
+ a.type = { text: "system" };
783
+ else if (typeof s == "object") {
784
+ let [n, i] = Object.entries(s)[0];
785
+ a[n] = { text: i };
786
+ } else
787
+ a.type = { text: s };
788
+ if (typeof o == "object") {
789
+ let [n, i] = Object.entries(o)[0];
790
+ a[n] = i;
791
+ } else
792
+ a.tags = o;
793
+ if (typeof l == "object") {
794
+ let [n, i] = Object.entries(l)[0];
795
+ a[n] = i;
796
+ } else
797
+ a.link = l;
798
+ a.parentBoundary = B, a.wrap = mt(), F = B, B = e, xt.push(F);
799
+ }, "addPersonOrSystemBoundary"), qe = /* @__PURE__ */ g(function(e, t, s, o, l) {
800
+ if (e === null || t === null)
801
+ return;
802
+ let a = {};
803
+ const r = X.find((n) => n.alias === e);
804
+ if (r && e === r.alias ? a = r : (a.alias = e, X.push(a)), t == null ? a.label = { text: "" } : a.label = { text: t }, s == null)
805
+ a.type = { text: "container" };
806
+ else if (typeof s == "object") {
807
+ let [n, i] = Object.entries(s)[0];
808
+ a[n] = { text: i };
809
+ } else
810
+ a.type = { text: s };
811
+ if (typeof o == "object") {
812
+ let [n, i] = Object.entries(o)[0];
813
+ a[n] = i;
814
+ } else
815
+ a.tags = o;
816
+ if (typeof l == "object") {
817
+ let [n, i] = Object.entries(l)[0];
818
+ a[n] = i;
819
+ } else
820
+ a.link = l;
821
+ a.parentBoundary = B, a.wrap = mt(), F = B, B = e, xt.push(F);
822
+ }, "addContainerBoundary"), Ge = /* @__PURE__ */ g(function(e, t, s, o, l, a, r, n) {
823
+ if (t === null || s === null)
824
+ return;
825
+ let i = {};
826
+ const u = X.find((d) => d.alias === t);
827
+ if (u && t === u.alias ? i = u : (i.alias = t, X.push(i)), s == null ? i.label = { text: "" } : i.label = { text: s }, o == null)
828
+ i.type = { text: "node" };
829
+ else if (typeof o == "object") {
830
+ let [d, f] = Object.entries(o)[0];
831
+ i[d] = { text: f };
832
+ } else
833
+ i.type = { text: o };
834
+ if (l == null)
835
+ i.descr = { text: "" };
836
+ else if (typeof l == "object") {
837
+ let [d, f] = Object.entries(l)[0];
838
+ i[d] = { text: f };
839
+ } else
840
+ i.descr = { text: l };
841
+ if (typeof r == "object") {
842
+ let [d, f] = Object.entries(r)[0];
843
+ i[d] = f;
844
+ } else
845
+ i.tags = r;
846
+ if (typeof n == "object") {
847
+ let [d, f] = Object.entries(n)[0];
848
+ i[d] = f;
849
+ } else
850
+ i.link = n;
851
+ i.nodeType = e, i.parentBoundary = B, i.wrap = mt(), F = B, B = t, xt.push(F);
852
+ }, "addDeploymentNode"), Ke = /* @__PURE__ */ g(function() {
853
+ B = F, xt.pop(), F = xt.pop(), xt.push(F);
854
+ }, "popBoundaryParseStack"), Je = /* @__PURE__ */ g(function(e, t, s, o, l, a, r, n, i, u, d) {
855
+ let f = V.find((y) => y.alias === t);
856
+ if (!(f === void 0 && (f = X.find((y) => y.alias === t), f === void 0))) {
857
+ if (s != null)
858
+ if (typeof s == "object") {
859
+ let [y, E] = Object.entries(s)[0];
860
+ f[y] = E;
861
+ } else
862
+ f.bgColor = s;
863
+ if (o != null)
864
+ if (typeof o == "object") {
865
+ let [y, E] = Object.entries(o)[0];
866
+ f[y] = E;
867
+ } else
868
+ f.fontColor = o;
869
+ if (l != null)
870
+ if (typeof l == "object") {
871
+ let [y, E] = Object.entries(l)[0];
872
+ f[y] = E;
873
+ } else
874
+ f.borderColor = l;
875
+ if (a != null)
876
+ if (typeof a == "object") {
877
+ let [y, E] = Object.entries(a)[0];
878
+ f[y] = E;
879
+ } else
880
+ f.shadowing = a;
881
+ if (r != null)
882
+ if (typeof r == "object") {
883
+ let [y, E] = Object.entries(r)[0];
884
+ f[y] = E;
885
+ } else
886
+ f.shape = r;
887
+ if (n != null)
888
+ if (typeof n == "object") {
889
+ let [y, E] = Object.entries(n)[0];
890
+ f[y] = E;
891
+ } else
892
+ f.sprite = n;
893
+ if (i != null)
894
+ if (typeof i == "object") {
895
+ let [y, E] = Object.entries(i)[0];
896
+ f[y] = E;
897
+ } else
898
+ f.techn = i;
899
+ if (u != null)
900
+ if (typeof u == "object") {
901
+ let [y, E] = Object.entries(u)[0];
902
+ f[y] = E;
903
+ } else
904
+ f.legendText = u;
905
+ if (d != null)
906
+ if (typeof d == "object") {
907
+ let [y, E] = Object.entries(d)[0];
908
+ f[y] = E;
909
+ } else
910
+ f.legendSprite = d;
911
+ }
912
+ }, "updateElStyle"), Ze = /* @__PURE__ */ g(function(e, t, s, o, l, a, r) {
913
+ const n = It.find((i) => i.from === t && i.to === s);
914
+ if (n !== void 0) {
915
+ if (o != null)
916
+ if (typeof o == "object") {
917
+ let [i, u] = Object.entries(o)[0];
918
+ n[i] = u;
919
+ } else
920
+ n.textColor = o;
921
+ if (l != null)
922
+ if (typeof l == "object") {
923
+ let [i, u] = Object.entries(l)[0];
924
+ n[i] = u;
925
+ } else
926
+ n.lineColor = l;
927
+ if (a != null)
928
+ if (typeof a == "object") {
929
+ let [i, u] = Object.entries(a)[0];
930
+ n[i] = parseInt(u);
931
+ } else
932
+ n.offsetX = parseInt(a);
933
+ if (r != null)
934
+ if (typeof r == "object") {
935
+ let [i, u] = Object.entries(r)[0];
936
+ n[i] = parseInt(u);
937
+ } else
938
+ n.offsetY = parseInt(r);
939
+ }
940
+ }, "updateRelStyle"), $e = /* @__PURE__ */ g(function(e, t, s) {
941
+ let o = Vt, l = zt;
942
+ if (typeof t == "object") {
943
+ const a = Object.values(t)[0];
944
+ o = parseInt(a);
945
+ } else
946
+ o = parseInt(t);
947
+ if (typeof s == "object") {
948
+ const a = Object.values(s)[0];
949
+ l = parseInt(a);
950
+ } else
951
+ l = parseInt(s);
952
+ o >= 1 && (Vt = o), l >= 1 && (zt = l);
953
+ }, "updateLayoutConfig"), t0 = /* @__PURE__ */ g(function() {
954
+ return Vt;
955
+ }, "getC4ShapeInRow"), e0 = /* @__PURE__ */ g(function() {
956
+ return zt;
957
+ }, "getC4BoundaryInRow"), a0 = /* @__PURE__ */ g(function() {
958
+ return B;
959
+ }, "getCurrentBoundaryParse"), i0 = /* @__PURE__ */ g(function() {
960
+ return F;
961
+ }, "getParentBoundaryParse"), _e = /* @__PURE__ */ g(function(e) {
962
+ return e == null ? V : V.filter((t) => t.parentBoundary === e);
963
+ }, "getC4ShapeArray"), n0 = /* @__PURE__ */ g(function(e) {
964
+ return V.find((t) => t.alias === e);
965
+ }, "getC4Shape"), r0 = /* @__PURE__ */ g(function(e) {
966
+ return Object.keys(_e(e));
967
+ }, "getC4ShapeKeys"), xe = /* @__PURE__ */ g(function(e) {
968
+ return e == null ? X : X.filter((t) => t.parentBoundary === e);
969
+ }, "getBoundaries"), s0 = xe, l0 = /* @__PURE__ */ g(function() {
970
+ return It;
971
+ }, "getRels"), o0 = /* @__PURE__ */ g(function() {
972
+ return ie;
973
+ }, "getTitle"), c0 = /* @__PURE__ */ g(function(e) {
974
+ ne = e;
975
+ }, "setWrap"), mt = /* @__PURE__ */ g(function() {
976
+ return ne;
977
+ }, "autoWrap"), h0 = /* @__PURE__ */ g(function() {
978
+ V = [], X = [
979
+ {
980
+ alias: "global",
981
+ label: { text: "global" },
982
+ type: { text: "global" },
983
+ tags: null,
984
+ link: null,
985
+ parentBoundary: ""
986
+ }
987
+ ], F = "", B = "global", xt = [""], It = [], xt = [""], ie = "", ne = !1, Vt = 4, zt = 2;
988
+ }, "clear"), u0 = {
989
+ SOLID: 0,
990
+ DOTTED: 1,
991
+ NOTE: 2,
992
+ SOLID_CROSS: 3,
993
+ DOTTED_CROSS: 4,
994
+ SOLID_OPEN: 5,
995
+ DOTTED_OPEN: 6,
996
+ LOOP_START: 10,
997
+ LOOP_END: 11,
998
+ ALT_START: 12,
999
+ ALT_ELSE: 13,
1000
+ ALT_END: 14,
1001
+ OPT_START: 15,
1002
+ OPT_END: 16,
1003
+ ACTIVE_START: 17,
1004
+ ACTIVE_END: 18,
1005
+ PAR_START: 19,
1006
+ PAR_AND: 20,
1007
+ PAR_END: 21,
1008
+ RECT_START: 22,
1009
+ RECT_END: 23,
1010
+ SOLID_POINT: 24,
1011
+ DOTTED_POINT: 25
1012
+ }, d0 = {
1013
+ FILLED: 0,
1014
+ OPEN: 1
1015
+ }, f0 = {
1016
+ LEFTOF: 0,
1017
+ RIGHTOF: 1,
1018
+ OVER: 2
1019
+ }, p0 = /* @__PURE__ */ g(function(e) {
1020
+ ie = ge(e, Bt());
1021
+ }, "setTitle"), te = {
1022
+ addPersonOrSystem: Xe,
1023
+ addPersonOrSystemBoundary: He,
1024
+ addContainer: We,
1025
+ addContainerBoundary: qe,
1026
+ addComponent: Qe,
1027
+ addDeploymentNode: Ge,
1028
+ popBoundaryParseStack: Ke,
1029
+ addRel: ze,
1030
+ updateElStyle: Je,
1031
+ updateRelStyle: Ze,
1032
+ updateLayoutConfig: $e,
1033
+ autoWrap: mt,
1034
+ setWrap: c0,
1035
+ getC4ShapeArray: _e,
1036
+ getC4Shape: n0,
1037
+ getC4ShapeKeys: r0,
1038
+ getBoundaries: xe,
1039
+ getBoundarys: s0,
1040
+ getCurrentBoundaryParse: a0,
1041
+ getParentBoundaryParse: i0,
1042
+ getRels: l0,
1043
+ getTitle: o0,
1044
+ getC4Type: Fe,
1045
+ getC4ShapeInRow: t0,
1046
+ getC4BoundaryInRow: e0,
1047
+ setAccTitle: Me,
1048
+ getAccTitle: Ie,
1049
+ getAccDescription: Be,
1050
+ setAccDescription: Pe,
1051
+ getConfig: /* @__PURE__ */ g(() => Bt().c4, "getConfig"),
1052
+ clear: h0,
1053
+ LINETYPE: u0,
1054
+ ARROWTYPE: d0,
1055
+ PLACEMENT: f0,
1056
+ setTitle: p0,
1057
+ setC4Type: Ve
1058
+ // apply,
1059
+ }, re = /* @__PURE__ */ g(function(e, t) {
1060
+ return De(e, t);
1061
+ }, "drawRect"), me = /* @__PURE__ */ g(function(e, t, s, o, l, a) {
1062
+ const r = e.append("image");
1063
+ r.attr("width", t), r.attr("height", s), r.attr("x", o), r.attr("y", l);
1064
+ let n = a.startsWith("data:image/png;base64") ? a : Ye(a);
1065
+ r.attr("xlink:href", n);
1066
+ }, "drawImage"), y0 = /* @__PURE__ */ g((e, t, s) => {
1067
+ const o = e.append("g");
1068
+ let l = 0;
1069
+ for (let a of t) {
1070
+ 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 = "";
1071
+ if (l === 0) {
1072
+ let y = o.append("line");
1073
+ 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;
1074
+ } else {
1075
+ let y = o.append("path");
1076
+ y.attr("fill", "none").attr("stroke-width", "1").attr("stroke", n).attr(
1077
+ "d",
1078
+ "Mstartx,starty Qcontrolx,controly stopx,stopy ".replaceAll("startx", a.startPoint.x).replaceAll("starty", a.startPoint.y).replaceAll(
1079
+ "controlx",
1080
+ a.startPoint.x + (a.endPoint.x - a.startPoint.x) / 2 - (a.endPoint.x - a.startPoint.x) / 4
1081
+ ).replaceAll("controly", a.startPoint.y + (a.endPoint.y - a.startPoint.y) / 2).replaceAll("stopx", a.endPoint.x).replaceAll("stopy", a.endPoint.y)
1082
+ ), 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)");
1083
+ }
1084
+ let f = s.messageFont();
1085
+ Q(s)(
1086
+ a.label.text,
1087
+ o,
1088
+ Math.min(a.startPoint.x, a.endPoint.x) + Math.abs(a.endPoint.x - a.startPoint.x) / 2 + i,
1089
+ Math.min(a.startPoint.y, a.endPoint.y) + Math.abs(a.endPoint.y - a.startPoint.y) / 2 + u,
1090
+ a.label.width,
1091
+ a.label.height,
1092
+ { fill: r },
1093
+ f
1094
+ ), a.techn && a.techn.text !== "" && (f = s.messageFont(), Q(s)(
1095
+ "[" + a.techn.text + "]",
1096
+ o,
1097
+ Math.min(a.startPoint.x, a.endPoint.x) + Math.abs(a.endPoint.x - a.startPoint.x) / 2 + i,
1098
+ Math.min(a.startPoint.y, a.endPoint.y) + Math.abs(a.endPoint.y - a.startPoint.y) / 2 + s.messageFontSize + 5 + u,
1099
+ Math.max(a.label.width, a.techn.width),
1100
+ a.techn.height,
1101
+ { fill: r, "font-style": "italic" },
1102
+ f
1103
+ ));
1104
+ }
1105
+ }, "drawRels"), g0 = /* @__PURE__ */ g(function(e, t, s) {
1106
+ const o = e.append("g");
1107
+ 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" };
1108
+ t.nodeType && (n = { "stroke-width": 1 });
1109
+ let i = {
1110
+ x: t.x,
1111
+ y: t.y,
1112
+ fill: l,
1113
+ stroke: a,
1114
+ width: t.width,
1115
+ height: t.height,
1116
+ rx: 2.5,
1117
+ ry: 2.5,
1118
+ attrs: n
1119
+ };
1120
+ re(o, i);
1121
+ let u = s.boundaryFont();
1122
+ u.fontWeight = "bold", u.fontSize = u.fontSize + 2, u.fontColor = r, Q(s)(
1123
+ t.label.text,
1124
+ o,
1125
+ t.x,
1126
+ t.y + t.label.Y,
1127
+ t.width,
1128
+ t.height,
1129
+ { fill: "#444444" },
1130
+ u
1131
+ ), t.type && t.type.text !== "" && (u = s.boundaryFont(), u.fontColor = r, Q(s)(
1132
+ t.type.text,
1133
+ o,
1134
+ t.x,
1135
+ t.y + t.type.Y,
1136
+ t.width,
1137
+ t.height,
1138
+ { fill: "#444444" },
1139
+ u
1140
+ )), t.descr && t.descr.text !== "" && (u = s.boundaryFont(), u.fontSize = u.fontSize - 2, u.fontColor = r, Q(s)(
1141
+ t.descr.text,
1142
+ o,
1143
+ t.x,
1144
+ t.y + t.descr.Y,
1145
+ t.width,
1146
+ t.height,
1147
+ { fill: "#444444" },
1148
+ u
1149
+ ));
1150
+ }, "drawBoundary"), b0 = /* @__PURE__ */ g(function(e, t, s) {
1151
+ var f;
1152
+ 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=";
1153
+ switch (t.typeC4Shape.text) {
1154
+ case "person":
1155
+ r = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAACD0lEQVR4Xu2YoU4EMRCGT+4j8Ai8AhaH4QHgAUjQuFMECUgMIUgwJAgMhgQsAYUiJCiQIBBY+EITsjfTdme6V24v4c8vyGbb+ZjOtN0bNcvjQXmkH83WvYBWto6PLm6v7p7uH1/w2fXD+PBycX1Pv2l3IdDm/vn7x+dXQiAubRzoURa7gRZWd0iGRIiJbOnhnfYBQZNJjNbuyY2eJG8fkDE3bbG4ep6MHUAsgYxmE3nVs6VsBWJSGccsOlFPmLIViMzLOB7pCVO2AtHJMohH7Fh6zqitQK7m0rJvAVYgGcEpe//PLdDz65sM4pF9N7ICcXDKIB5Nv6j7tD0NoSdM2QrU9Gg0ewE1LqBhHR3BBdvj2vapnidjHxD/q6vd7Pvhr31AwcY8eXMTXAKECZZJFXuEq27aLgQK5uLMohCenGGuGewOxSjBvYBqeG6B+Nqiblggdjnc+ZXDy+FNFpFzw76O3UBAROuXh6FoiAcf5g9eTvUgzy0nWg6I8cXHRUpg5bOVBCo+KDpFajOf23GgPme7RSQ+lacIENUgJ6gg1k6HjgOlqnLqip4tEuhv0hNEMXUD0clyXE3p6pZA0S2nnvTlXwLJEZWlb7cTQH1+USgTN4VhAenm/wea1OCAOmqo6fE1WCb9WSKBah+rbUWPWAmE2Rvk0ApiB45eOyNAzU8xcTvj8KvkKEoOaIYeHNA3ZuygAvFMUO0AAAAASUVORK5CYII=";
1156
+ break;
1157
+ case "external_person":
1158
+ r = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAIAAADYYG7QAAAB6ElEQVR4Xu2YLY+EMBCG9+dWr0aj0Wg0Go1Go0+j8Xdv2uTCvv1gpt0ebHKPuhDaeW4605Z9mJvx4AdXUyTUdd08z+u6flmWZRnHsWkafk9DptAwDPu+f0eAYtu2PEaGWuj5fCIZrBAC2eLBAnRCsEkkxmeaJp7iDJ2QMDdHsLg8SxKFEJaAo8lAXnmuOFIhTMpxxKATebo4UiFknuNo4OniSIXQyRxEA3YsnjGCVEjVXD7yLUAqxBGUyPv/Y4W2beMgGuS7kVQIBycH0fD+oi5pezQETxdHKmQKGk1eQEYldK+jw5GxPfZ9z7Mk0Qnhf1W1m3w//EUn5BDmSZsbR44QQLBEqrBHqOrmSKaQAxdnLArCrxZcM7A7ZKs4ioRq8LFC+NpC3WCBJsvpVw5edm9iEXFuyNfxXAgSwfrFQ1c0iNda8AdejvUgnktOtJQQxmcfFzGglc5WVCj7oDgFqU18boeFSs52CUh8LE8BIVQDT1ABrB0HtgSEYlX5doJnCwv9TXocKCaKbnwhdDKPq4lf3SwU3HLq4V/+WYhHVMa/3b4IlfyikAduCkcBc7mQ3/z/Qq/cTuikhkzB12Ae/mcJC9U+Vo8Ej1gWAtgbeGgFsAMHr50BIWOLCbezvhpBFUdY6EJuJ/QDW0XoMX60zZ0AAAAASUVORK5CYII=";
1159
+ break;
1160
+ }
1161
+ const n = e.append("g");
1162
+ n.attr("class", "person-man");
1163
+ const i = Se();
1164
+ switch (t.typeC4Shape.text) {
1165
+ case "person":
1166
+ case "external_person":
1167
+ case "system":
1168
+ case "external_system":
1169
+ case "container":
1170
+ case "external_container":
1171
+ case "component":
1172
+ case "external_component":
1173
+ 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);
1174
+ break;
1175
+ case "system_db":
1176
+ case "external_system_db":
1177
+ case "container_db":
1178
+ case "external_container_db":
1179
+ case "component_db":
1180
+ case "external_component_db":
1181
+ n.append("path").attr("fill", o).attr("stroke-width", "0.5").attr("stroke", l).attr(
1182
+ "d",
1183
+ "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)
1184
+ ), n.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", l).attr(
1185
+ "d",
1186
+ "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)
1187
+ );
1188
+ break;
1189
+ case "system_queue":
1190
+ case "external_system_queue":
1191
+ case "container_queue":
1192
+ case "external_container_queue":
1193
+ case "component_queue":
1194
+ case "external_component_queue":
1195
+ n.append("path").attr("fill", o).attr("stroke-width", "0.5").attr("stroke", l).attr(
1196
+ "d",
1197
+ "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)
1198
+ ), n.append("path").attr("fill", "none").attr("stroke-width", "0.5").attr("stroke", l).attr(
1199
+ "d",
1200
+ "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)
1201
+ );
1202
+ break;
1203
+ }
1204
+ let u = w0(s, t.typeC4Shape.text);
1205
+ 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) {
1206
+ case "person":
1207
+ case "external_person":
1208
+ me(
1209
+ n,
1210
+ 48,
1211
+ 48,
1212
+ t.x + t.width / 2 - 24,
1213
+ t.y + t.image.Y,
1214
+ r
1215
+ );
1216
+ break;
1217
+ }
1218
+ let d = s[t.typeC4Shape.text + "Font"]();
1219
+ return d.fontWeight = "bold", d.fontSize = d.fontSize + 2, d.fontColor = a, Q(s)(
1220
+ t.label.text,
1221
+ n,
1222
+ t.x,
1223
+ t.y + t.label.Y,
1224
+ t.width,
1225
+ t.height,
1226
+ { fill: a },
1227
+ d
1228
+ ), d = s[t.typeC4Shape.text + "Font"](), d.fontColor = a, t.techn && ((f = t.techn) == null ? void 0 : f.text) !== "" ? Q(s)(
1229
+ t.techn.text,
1230
+ n,
1231
+ t.x,
1232
+ t.y + t.techn.Y,
1233
+ t.width,
1234
+ t.height,
1235
+ { fill: a, "font-style": "italic" },
1236
+ d
1237
+ ) : t.type && t.type.text !== "" && Q(s)(
1238
+ t.type.text,
1239
+ n,
1240
+ t.x,
1241
+ t.y + t.type.Y,
1242
+ t.width,
1243
+ t.height,
1244
+ { fill: a, "font-style": "italic" },
1245
+ d
1246
+ ), t.descr && t.descr.text !== "" && (d = s.personFont(), d.fontColor = a, Q(s)(
1247
+ t.descr.text,
1248
+ n,
1249
+ t.x,
1250
+ t.y + t.descr.Y,
1251
+ t.width,
1252
+ t.height,
1253
+ { fill: a },
1254
+ d
1255
+ )), t.height;
1256
+ }, "drawC4Shape"), _0 = /* @__PURE__ */ g(function(e) {
1257
+ e.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
1258
+ "d",
1259
+ "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"
1260
+ );
1261
+ }, "insertDatabaseIcon"), x0 = /* @__PURE__ */ g(function(e) {
1262
+ e.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1263
+ "d",
1264
+ "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"
1265
+ );
1266
+ }, "insertComputerIcon"), m0 = /* @__PURE__ */ g(function(e) {
1267
+ e.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1268
+ "d",
1269
+ "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"
1270
+ );
1271
+ }, "insertClockIcon"), v0 = /* @__PURE__ */ g(function(e) {
1272
+ 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");
1273
+ }, "insertArrowHead"), E0 = /* @__PURE__ */ g(function(e) {
1274
+ 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");
1275
+ }, "insertArrowEnd"), k0 = /* @__PURE__ */ g(function(e) {
1276
+ 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");
1277
+ }, "insertArrowFilledHead"), A0 = /* @__PURE__ */ g(function(e) {
1278
+ 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);
1279
+ }, "insertDynamicNumber"), C0 = /* @__PURE__ */ g(function(e) {
1280
+ 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);
1281
+ 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");
1282
+ }, "insertArrowCrossHead"), w0 = /* @__PURE__ */ g((e, t) => ({
1283
+ fontFamily: e[t + "FontFamily"],
1284
+ fontSize: e[t + "FontSize"],
1285
+ fontWeight: e[t + "FontWeight"]
1286
+ }), "getC4ShapeFont"), Q = /* @__PURE__ */ function() {
1287
+ function e(l, a, r, n, i, u, d) {
1288
+ const f = a.append("text").attr("x", r + i / 2).attr("y", n + u / 2 + 5).style("text-anchor", "middle").text(l);
1289
+ o(f, d);
1290
+ }
1291
+ g(e, "byText");
1292
+ function t(l, a, r, n, i, u, d, f) {
1293
+ const { fontSize: y, fontFamily: E, fontWeight: O } = f, S = l.split($t.lineBreakRegex);
1294
+ for (let P = 0; P < S.length; P++) {
1295
+ 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);
1296
+ U.append("tspan").attr("dy", M).text(S[P]).attr("alignment-baseline", "mathematical"), o(U, d);
1297
+ }
1298
+ }
1299
+ g(t, "byTspan");
1300
+ function s(l, a, r, n, i, u, d, f) {
1301
+ 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%");
1302
+ 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);
1303
+ }
1304
+ g(s, "byFo");
1305
+ function o(l, a) {
1306
+ for (const r in a)
1307
+ a.hasOwnProperty(r) && l.attr(r, a[r]);
1308
+ }
1309
+ return g(o, "_setTextAttrs"), function(l) {
1310
+ return l.textPlacement === "fo" ? s : l.textPlacement === "old" ? e : t;
1311
+ };
1312
+ }(), z = {
1313
+ drawRect: re,
1314
+ drawBoundary: g0,
1315
+ drawC4Shape: b0,
1316
+ drawRels: y0,
1317
+ drawImage: me,
1318
+ insertArrowHead: v0,
1319
+ insertArrowEnd: E0,
1320
+ insertArrowFilledHead: k0,
1321
+ insertDynamicNumber: A0,
1322
+ insertArrowCrossHead: C0,
1323
+ insertDatabaseIcon: _0,
1324
+ insertComputerIcon: x0,
1325
+ insertClockIcon: m0
1326
+ }, Xt = 0, Wt = 0, ve = 4, ee = 2;
1327
+ Ft.yy = te;
1328
+ var _ = {}, Ot, Ee = (Ot = class {
1329
+ constructor(t) {
1330
+ 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());
1331
+ }
1332
+ setData(t, s, o, l) {
1333
+ 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;
1334
+ }
1335
+ updateVal(t, s, o, l) {
1336
+ t[s] === void 0 ? t[s] = o : t[s] = l(o, t[s]);
1337
+ }
1338
+ insert(t) {
1339
+ this.nextData.cnt = this.nextData.cnt + 1;
1340
+ 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;
1341
+ (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);
1342
+ }
1343
+ init(t) {
1344
+ this.name = "", this.data = {
1345
+ startx: void 0,
1346
+ stopx: void 0,
1347
+ starty: void 0,
1348
+ stopy: void 0,
1349
+ widthLimit: void 0
1350
+ }, this.nextData = {
1351
+ startx: void 0,
1352
+ stopx: void 0,
1353
+ starty: void 0,
1354
+ stopy: void 0,
1355
+ cnt: 0
1356
+ }, ae(t.db.getConfig());
1357
+ }
1358
+ bumpLastMargin(t) {
1359
+ this.data.stopx += t, this.data.stopy += t;
1360
+ }
1361
+ }, g(Ot, "Bounds"), Ot), ae = /* @__PURE__ */ g(function(e) {
1362
+ Ne(_, e), e.fontFamily && (_.personFontFamily = _.systemFontFamily = _.messageFontFamily = e.fontFamily), e.fontSize && (_.personFontSize = _.systemFontSize = _.messageFontSize = e.fontSize), e.fontWeight && (_.personFontWeight = _.systemFontWeight = _.messageFontWeight = e.fontWeight);
1363
+ }, "setConf"), Pt = /* @__PURE__ */ g((e, t) => ({
1364
+ fontFamily: e[t + "FontFamily"],
1365
+ fontSize: e[t + "FontSize"],
1366
+ fontWeight: e[t + "FontWeight"]
1367
+ }), "c4ShapeFont"), Ut = /* @__PURE__ */ g((e) => ({
1368
+ fontFamily: e.boundaryFontFamily,
1369
+ fontSize: e.boundaryFontSize,
1370
+ fontWeight: e.boundaryFontWeight
1371
+ }), "boundaryFont"), T0 = /* @__PURE__ */ g((e) => ({
1372
+ fontFamily: e.messageFontFamily,
1373
+ fontSize: e.messageFontSize,
1374
+ fontWeight: e.messageFontWeight
1375
+ }), "messageFont");
1376
+ function j(e, t, s, o, l) {
1377
+ if (!t[e].width)
1378
+ if (s)
1379
+ 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);
1380
+ else {
1381
+ let a = t[e].text.split($t.lineBreakRegex);
1382
+ t[e].textLines = a.length;
1383
+ let r = 0;
1384
+ t[e].height = 0, t[e].width = 0;
1385
+ for (const n of a)
1386
+ t[e].width = Math.max(
1387
+ Tt(n, o),
1388
+ t[e].width
1389
+ ), r = fe(n, o), t[e].height = t[e].height + r;
1390
+ }
1391
+ }
1392
+ g(j, "calcC4ShapeTextWH");
1393
+ var ke = /* @__PURE__ */ g(function(e, t, s) {
1394
+ 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;
1395
+ let o = t.wrap && _.wrap, l = Ut(_);
1396
+ l.fontSize = l.fontSize + 2, l.fontWeight = "bold";
1397
+ let a = Tt(t.label.text, l);
1398
+ j("label", t, o, l, a), z.drawBoundary(e, t, _);
1399
+ }, "drawBoundary"), Ae = /* @__PURE__ */ g(function(e, t, s, o) {
1400
+ let l = 0;
1401
+ for (const a of o) {
1402
+ l = 0;
1403
+ const r = s[a];
1404
+ let n = Pt(_, r.typeC4Shape.text);
1405
+ switch (n.fontSize = n.fontSize - 2, r.typeC4Shape.width = Tt(
1406
+ "«" + r.typeC4Shape.text + "»",
1407
+ n
1408
+ ), 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) {
1409
+ case "person":
1410
+ case "external_person":
1411
+ r.image.width = 48, r.image.height = 48, r.image.Y = l, l = r.image.Y + r.image.height;
1412
+ break;
1413
+ }
1414
+ r.sprite && (r.image.width = 48, r.image.height = 48, r.image.Y = l, l = r.image.Y + r.image.height);
1415
+ let i = r.wrap && _.wrap, u = _.width - _.c4ShapePadding * 2, d = Pt(_, r.typeC4Shape.text);
1416
+ 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 !== "") {
1417
+ r.type.text = "[" + r.type.text + "]";
1418
+ let E = Pt(_, r.typeC4Shape.text);
1419
+ j("type", r, i, E, u), r.type.Y = l + 5, l = r.type.Y + r.type.height;
1420
+ } else if (r.techn && r.techn.text !== "") {
1421
+ r.techn.text = "[" + r.techn.text + "]";
1422
+ let E = Pt(_, r.techn.text);
1423
+ j("techn", r, i, E, u), r.techn.Y = l + 5, l = r.techn.Y + r.techn.height;
1424
+ }
1425
+ let f = l, y = r.label.width;
1426
+ if (r.descr && r.descr.text !== "") {
1427
+ let E = Pt(_, r.typeC4Shape.text);
1428
+ 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;
1429
+ }
1430
+ 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, _);
1431
+ }
1432
+ e.bumpLastMargin(_.c4ShapeMargin);
1433
+ }, "drawC4ShapeArray"), Rt, Y = (Rt = class {
1434
+ constructor(t, s) {
1435
+ this.x = t, this.y = s;
1436
+ }
1437
+ }, g(Rt, "Point"), Rt), pe = /* @__PURE__ */ g(function(e, t) {
1438
+ 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;
1439
+ 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(
1440
+ r - i / u * e.height / 2,
1441
+ o + e.height
1442
+ ) : s < l && o < a ? f >= d ? y = new Y(s + e.width, n + d * e.width / 2) : y = new Y(
1443
+ r + i / u * e.height / 2,
1444
+ o + e.height
1445
+ ) : 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;
1446
+ }, "getIntersectPoint"), O0 = /* @__PURE__ */ g(function(e, t) {
1447
+ let s = { x: 0, y: 0 };
1448
+ s.x = t.x + t.width / 2, s.y = t.y + t.height / 2;
1449
+ let o = pe(e, s);
1450
+ s.x = e.x + e.width / 2, s.y = e.y + e.height / 2;
1451
+ let l = pe(t, s);
1452
+ return { startPoint: o, endPoint: l };
1453
+ }, "getIntersectPoints"), R0 = /* @__PURE__ */ g(function(e, t, s, o) {
1454
+ let l = 0;
1455
+ for (let a of t) {
1456
+ l = l + 1;
1457
+ let r = a.wrap && _.wrap, n = T0(_);
1458
+ o.db.getC4Type() === "C4Dynamic" && (a.label.text = l + ": " + a.label.text);
1459
+ let u = Tt(a.label.text, n);
1460
+ 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));
1461
+ let d = s(a.from), f = s(a.to), y = O0(d, f);
1462
+ a.startPoint = y.startPoint, a.endPoint = y.endPoint;
1463
+ }
1464
+ z.drawRels(e, t, _);
1465
+ }, "drawRels");
1466
+ function se(e, t, s, o, l) {
1467
+ let a = new Ee(l);
1468
+ a.data.widthLimit = s.data.widthLimit / Math.min(ee, o.length);
1469
+ for (let [r, n] of o.entries()) {
1470
+ let i = 0;
1471
+ 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);
1472
+ let u = n.wrap && _.wrap, d = Ut(_);
1473
+ if (d.fontSize = d.fontSize + 2, d.fontWeight = "bold", j(
1474
+ "label",
1475
+ n,
1476
+ u,
1477
+ d,
1478
+ a.data.widthLimit
1479
+ ), n.label.Y = i + 8, i = n.label.Y + n.label.height, n.type && n.type.text !== "") {
1480
+ n.type.text = "[" + n.type.text + "]";
1481
+ let O = Ut(_);
1482
+ j(
1483
+ "type",
1484
+ n,
1485
+ u,
1486
+ O,
1487
+ a.data.widthLimit
1488
+ ), n.type.Y = i + 5, i = n.type.Y + n.type.height;
1489
+ }
1490
+ if (n.descr && n.descr.text !== "") {
1491
+ let O = Ut(_);
1492
+ O.fontSize = O.fontSize - 2, j(
1493
+ "descr",
1494
+ n,
1495
+ u,
1496
+ O,
1497
+ a.data.widthLimit
1498
+ ), n.descr.Y = i + 20, i = n.descr.Y + n.descr.height;
1499
+ }
1500
+ if (r == 0 || r % ee === 0) {
1501
+ let O = s.data.startx + _.diagramMarginX, S = s.data.stopy + _.diagramMarginY + i;
1502
+ a.setData(O, O, S, S);
1503
+ } else {
1504
+ let O = a.data.stopx !== a.data.startx ? a.data.stopx + _.diagramMarginX : a.data.startx, S = a.data.starty;
1505
+ a.setData(O, O, S, S);
1506
+ }
1507
+ a.name = n.alias;
1508
+ let f = l.db.getC4ShapeArray(n.alias), y = l.db.getC4ShapeKeys(n.alias);
1509
+ y.length > 0 && Ae(
1510
+ a,
1511
+ e,
1512
+ f,
1513
+ y
1514
+ ), t = n.alias;
1515
+ let E = l.db.getBoundaries(t);
1516
+ E.length > 0 && se(
1517
+ e,
1518
+ t,
1519
+ a,
1520
+ E,
1521
+ l
1522
+ ), n.alias !== "global" && ke(e, n, a), s.data.stopy = Math.max(
1523
+ a.data.stopy + _.c4ShapeMargin,
1524
+ s.data.stopy
1525
+ ), s.data.stopx = Math.max(
1526
+ a.data.stopx + _.c4ShapeMargin,
1527
+ s.data.stopx
1528
+ ), Xt = Math.max(Xt, s.data.stopx), Wt = Math.max(Wt, s.data.stopy);
1529
+ }
1530
+ }
1531
+ g(se, "drawInsideBoundary");
1532
+ var S0 = /* @__PURE__ */ g(function(e, t, s, o) {
1533
+ _ = Bt().c4;
1534
+ const l = Bt().securityLevel;
1535
+ let a;
1536
+ l === "sandbox" && (a = jt("#i" + t));
1537
+ const r = l === "sandbox" ? jt(a.nodes()[0].contentDocument.body) : jt("body");
1538
+ let n = o.db;
1539
+ o.db.setWrap(_.wrap), ve = n.getC4ShapeInRow(), ee = n.getC4BoundaryInRow(), de.debug(`C:${JSON.stringify(_, null, 2)}`);
1540
+ const i = l === "sandbox" ? r.select(`[id="${t}"]`) : jt(`[id="${t}"]`);
1541
+ z.insertComputerIcon(i), z.insertDatabaseIcon(i), z.insertClockIcon(i);
1542
+ let u = new Ee(o);
1543
+ u.setData(
1544
+ _.diagramMarginX,
1545
+ _.diagramMarginX,
1546
+ _.diagramMarginY,
1547
+ _.diagramMarginY
1548
+ ), u.data.widthLimit = screen.availWidth, Xt = _.diagramMarginX, Wt = _.diagramMarginY;
1549
+ const d = o.db.getTitle();
1550
+ let f = o.db.getBoundaries("");
1551
+ 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;
1552
+ const y = u.data;
1553
+ let O = y.stopy - y.starty + 2 * _.diagramMarginY;
1554
+ const P = y.stopx - y.startx + 2 * _.diagramMarginX;
1555
+ 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);
1556
+ const M = d ? 60 : 0;
1557
+ i.attr(
1558
+ "viewBox",
1559
+ y.startx - _.diagramMarginX + " -" + (_.diagramMarginY + M) + " " + P + " " + (O + M)
1560
+ ), de.debug("models:", y);
1561
+ }, "draw"), ye = {
1562
+ drawPersonOrSystemArray: Ae,
1563
+ drawBoundary: ke,
1564
+ setConf: ae,
1565
+ draw: S0
1566
+ }, D0 = /* @__PURE__ */ g((e) => `.person {
1567
+ stroke: ${e.personBorder};
1568
+ fill: ${e.personBkg};
1569
+ }
1570
+ `, "getStyles"), P0 = D0, M0 = {
1571
+ parser: Ue,
1572
+ db: te,
1573
+ renderer: ye,
1574
+ styles: P0,
1575
+ init: /* @__PURE__ */ g(({ c4: e, wrap: t }) => {
1576
+ ye.setConf(e), te.setWrap(t);
1577
+ }, "init")
1578
+ };
1579
+ export {
1580
+ M0 as diagram
1581
+ };
src/backend/gradio_dropdownplus/templates/component/channel-B27Nc4fx.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ import { ap as o, aq as n } from "./mermaid.core-D58rAnek.js";
2
+ const t = (a, r) => o.lang.round(n.parse(a)[r]);
3
+ export {
4
+ t as c
5
+ };
src/backend/gradio_dropdownplus/templates/component/chunk-ANTBXLJU-CuGo78t3.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import { _ as l } from "./mermaid.core-D58rAnek.js";
2
+ function m(e, c) {
3
+ var i, t, o;
4
+ 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));
5
+ }
6
+ l(m, "populateCommonDb");
7
+ export {
8
+ m as p
9
+ };
src/backend/gradio_dropdownplus/templates/component/chunk-FHKO5MBM-BsqpKj2V.js ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { _ as s } from "./mermaid.core-D58rAnek.js";
2
+ var t, e = (t = class {
3
+ /**
4
+ * @param init - Function that creates the default state.
5
+ */
6
+ constructor(i) {
7
+ this.init = i, this.records = this.init();
8
+ }
9
+ reset() {
10
+ this.records = this.init();
11
+ }
12
+ }, s(t, "ImperativeState"), t);
13
+ export {
14
+ e as I
15
+ };
src/backend/gradio_dropdownplus/templates/component/chunk-GLLZNHP4-BcJ3UCJy.js ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { _ as e } from "./mermaid.core-D58rAnek.js";
2
+ var l = /* @__PURE__ */ e(() => `
3
+ /* Font Awesome icon styling - consolidated */
4
+ .label-icon {
5
+ display: inline-block;
6
+ height: 1em;
7
+ overflow: visible;
8
+ vertical-align: -0.125em;
9
+ }
10
+
11
+ .node .label-icon path {
12
+ fill: currentColor;
13
+ stroke: revert;
14
+ stroke-width: revert;
15
+ }
16
+ `, "getIconStyles");
17
+ export {
18
+ l as g
19
+ };
src/backend/gradio_dropdownplus/templates/component/chunk-JBRWN2VN-D4EODkTC.js ADDED
@@ -0,0 +1,1376 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { g as et } from "./chunk-GLLZNHP4-BcJ3UCJy.js";
2
+ import { g as tt } from "./chunk-WVR4S24B-Db-rMs1b.js";
3
+ import { s as st } from "./chunk-NRVI72HA-EajhWFFL.js";
4
+ 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-D58rAnek.js";
5
+ var Ve = function() {
6
+ var s = /* @__PURE__ */ f(function(I, c, h, p) {
7
+ for (h = h || {}, p = I.length; p--; h[I[p]] = c) ;
8
+ return h;
9
+ }, "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], D = [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], T = [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, 18, 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, 99], K = [1, 116], Y = [1, 108], Q = [1, 114], W = [1, 109], j = [1, 110], X = [1, 111], q = [1, 112], H = [1, 113], J = [1, 115], 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, 144], Ue = [1, 8, 9, 59], N = [1, 8, 9, 22, 58, 59, 80, 84, 85, 86, 87, 88, 89], Ne = {
10
+ trace: /* @__PURE__ */ f(function() {
11
+ }, "trace"),
12
+ yy: {},
13
+ 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, classLiteralName: 17, DOT: 18, className: 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 },
14
+ terminals_: { 2: "error", 7: "CLASS_DIAGRAM", 8: "NEWLINE", 9: "EOF", 12: "SQS", 13: "STR", 14: "SQE", 18: "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" },
15
+ productions_: [0, [3, 1], [3, 1], [4, 1], [6, 4], [5, 1], [5, 2], [5, 3], [11, 3], [15, 1], [15, 1], [15, 3], [15, 2], [19, 1], [19, 3], [19, 1], [19, 2], [19, 2], [19, 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], [17, 1], [53, 1]],
16
+ performAction: /* @__PURE__ */ f(function(c, h, p, n, C, e, Z) {
17
+ var t = e.length - 1;
18
+ switch (C) {
19
+ case 8:
20
+ this.$ = e[t - 1];
21
+ break;
22
+ case 9:
23
+ case 10:
24
+ case 13:
25
+ case 15:
26
+ this.$ = e[t];
27
+ break;
28
+ case 11:
29
+ case 14:
30
+ this.$ = e[t - 2] + "." + e[t];
31
+ break;
32
+ case 12:
33
+ case 16:
34
+ this.$ = e[t - 1] + e[t];
35
+ break;
36
+ case 17:
37
+ case 18:
38
+ this.$ = e[t - 1] + "~" + e[t] + "~";
39
+ break;
40
+ case 19:
41
+ n.addRelation(e[t]);
42
+ break;
43
+ case 20:
44
+ e[t - 1].title = n.cleanupLabel(e[t]), n.addRelation(e[t - 1]);
45
+ break;
46
+ case 31:
47
+ this.$ = e[t].trim(), n.setAccTitle(this.$);
48
+ break;
49
+ case 32:
50
+ case 33:
51
+ this.$ = e[t].trim(), n.setAccDescription(this.$);
52
+ break;
53
+ case 34:
54
+ n.addClassesToNamespace(e[t - 3], e[t - 1]);
55
+ break;
56
+ case 35:
57
+ n.addClassesToNamespace(e[t - 4], e[t - 1]);
58
+ break;
59
+ case 36:
60
+ this.$ = e[t], n.addNamespace(e[t]);
61
+ break;
62
+ case 37:
63
+ this.$ = [e[t]];
64
+ break;
65
+ case 38:
66
+ this.$ = [e[t - 1]];
67
+ break;
68
+ case 39:
69
+ e[t].unshift(e[t - 2]), this.$ = e[t];
70
+ break;
71
+ case 41:
72
+ n.setCssClass(e[t - 2], e[t]);
73
+ break;
74
+ case 42:
75
+ n.addMembers(e[t - 3], e[t - 1]);
76
+ break;
77
+ case 43:
78
+ n.setCssClass(e[t - 5], e[t - 3]), n.addMembers(e[t - 5], e[t - 1]);
79
+ break;
80
+ case 44:
81
+ this.$ = e[t], n.addClass(e[t]);
82
+ break;
83
+ case 45:
84
+ this.$ = e[t - 1], n.addClass(e[t - 1]), n.setClassLabel(e[t - 1], e[t]);
85
+ break;
86
+ case 46:
87
+ n.addAnnotation(e[t], e[t - 2]);
88
+ break;
89
+ case 47:
90
+ case 60:
91
+ this.$ = [e[t]];
92
+ break;
93
+ case 48:
94
+ e[t].push(e[t - 1]), this.$ = e[t];
95
+ break;
96
+ case 49:
97
+ break;
98
+ case 50:
99
+ n.addMember(e[t - 1], n.cleanupLabel(e[t]));
100
+ break;
101
+ case 51:
102
+ break;
103
+ case 52:
104
+ break;
105
+ case 53:
106
+ this.$ = { id1: e[t - 2], id2: e[t], relation: e[t - 1], relationTitle1: "none", relationTitle2: "none" };
107
+ break;
108
+ case 54:
109
+ this.$ = { id1: e[t - 3], id2: e[t], relation: e[t - 1], relationTitle1: e[t - 2], relationTitle2: "none" };
110
+ break;
111
+ case 55:
112
+ this.$ = { id1: e[t - 3], id2: e[t], relation: e[t - 2], relationTitle1: "none", relationTitle2: e[t - 1] };
113
+ break;
114
+ case 56:
115
+ this.$ = { id1: e[t - 4], id2: e[t], relation: e[t - 2], relationTitle1: e[t - 3], relationTitle2: e[t - 1] };
116
+ break;
117
+ case 57:
118
+ n.addNote(e[t], e[t - 1]);
119
+ break;
120
+ case 58:
121
+ n.addNote(e[t]);
122
+ break;
123
+ case 59:
124
+ this.$ = e[t - 2], n.defineClass(e[t - 1], e[t]);
125
+ break;
126
+ case 61:
127
+ this.$ = e[t - 2].concat([e[t]]);
128
+ break;
129
+ case 62:
130
+ n.setDirection("TB");
131
+ break;
132
+ case 63:
133
+ n.setDirection("BT");
134
+ break;
135
+ case 64:
136
+ n.setDirection("RL");
137
+ break;
138
+ case 65:
139
+ n.setDirection("LR");
140
+ break;
141
+ case 66:
142
+ this.$ = { type1: e[t - 2], type2: e[t], lineType: e[t - 1] };
143
+ break;
144
+ case 67:
145
+ this.$ = { type1: "none", type2: e[t], lineType: e[t - 1] };
146
+ break;
147
+ case 68:
148
+ this.$ = { type1: e[t - 1], type2: "none", lineType: e[t] };
149
+ break;
150
+ case 69:
151
+ this.$ = { type1: "none", type2: "none", lineType: e[t] };
152
+ break;
153
+ case 70:
154
+ this.$ = n.relationType.AGGREGATION;
155
+ break;
156
+ case 71:
157
+ this.$ = n.relationType.EXTENSION;
158
+ break;
159
+ case 72:
160
+ this.$ = n.relationType.COMPOSITION;
161
+ break;
162
+ case 73:
163
+ this.$ = n.relationType.DEPENDENCY;
164
+ break;
165
+ case 74:
166
+ this.$ = n.relationType.LOLLIPOP;
167
+ break;
168
+ case 75:
169
+ this.$ = n.lineType.LINE;
170
+ break;
171
+ case 76:
172
+ this.$ = n.lineType.DOTTED_LINE;
173
+ break;
174
+ case 77:
175
+ case 83:
176
+ this.$ = e[t - 2], n.setClickEvent(e[t - 1], e[t]);
177
+ break;
178
+ case 78:
179
+ case 84:
180
+ this.$ = e[t - 3], n.setClickEvent(e[t - 2], e[t - 1]), n.setTooltip(e[t - 2], e[t]);
181
+ break;
182
+ case 79:
183
+ this.$ = e[t - 2], n.setLink(e[t - 1], e[t]);
184
+ break;
185
+ case 80:
186
+ this.$ = e[t - 3], n.setLink(e[t - 2], e[t - 1], e[t]);
187
+ break;
188
+ case 81:
189
+ this.$ = e[t - 3], n.setLink(e[t - 2], e[t - 1]), n.setTooltip(e[t - 2], e[t]);
190
+ break;
191
+ case 82:
192
+ this.$ = e[t - 4], n.setLink(e[t - 3], e[t - 2], e[t]), n.setTooltip(e[t - 3], e[t - 1]);
193
+ break;
194
+ case 85:
195
+ this.$ = e[t - 3], n.setClickEvent(e[t - 2], e[t - 1], e[t]);
196
+ break;
197
+ case 86:
198
+ this.$ = e[t - 4], n.setClickEvent(e[t - 3], e[t - 2], e[t - 1]), n.setTooltip(e[t - 3], e[t]);
199
+ break;
200
+ case 87:
201
+ this.$ = e[t - 3], n.setLink(e[t - 2], e[t]);
202
+ break;
203
+ case 88:
204
+ this.$ = e[t - 4], n.setLink(e[t - 3], e[t - 1], e[t]);
205
+ break;
206
+ case 89:
207
+ this.$ = e[t - 4], n.setLink(e[t - 3], e[t - 1]), n.setTooltip(e[t - 3], e[t]);
208
+ break;
209
+ case 90:
210
+ this.$ = e[t - 5], n.setLink(e[t - 4], e[t - 2], e[t]), n.setTooltip(e[t - 4], e[t - 1]);
211
+ break;
212
+ case 91:
213
+ this.$ = e[t - 2], n.setCssStyle(e[t - 1], e[t]);
214
+ break;
215
+ case 92:
216
+ n.setCssClass(e[t - 1], e[t]);
217
+ break;
218
+ case 93:
219
+ this.$ = [e[t]];
220
+ break;
221
+ case 94:
222
+ e[t - 2].push(e[t]), this.$ = e[t - 2];
223
+ break;
224
+ case 96:
225
+ this.$ = e[t - 1] + e[t];
226
+ break;
227
+ }
228
+ }, "anonymous"),
229
+ table: [{ 3: 1, 4: 2, 5: 3, 6: 4, 7: [1, 6], 10: 5, 16: 39, 17: 40, 19: 21, 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: D, 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: T }, { 1: [3] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3] }, s(De, [2, 5], { 8: [1, 48] }), { 8: [1, 49] }, s(d, [2, 19], { 22: [1, 50] }), 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]), s(d, [2, 30]), { 34: [1, 51] }, { 36: [1, 52] }, s(d, [2, 33]), s(d, [2, 49], { 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, 40], { 39: [1, 67], 44: [1, 66] }), s(d, [2, 51]), s(d, [2, 52]), { 16: 68, 58: m, 84: b, 99: E, 101: y }, { 16: 39, 17: 40, 19: 69, 58: m, 84: b, 99: E, 101: y, 102: T }, { 16: 39, 17: 40, 19: 70, 58: m, 84: b, 99: E, 101: y, 102: T }, { 16: 39, 17: 40, 19: 71, 58: m, 84: b, 99: E, 101: y, 102: T }, { 58: [1, 72] }, { 13: [1, 73] }, { 16: 39, 17: 40, 19: 74, 58: m, 84: b, 99: E, 101: y, 102: T }, { 13: Pe, 53: 75 }, { 56: 77, 58: [1, 78] }, s(d, [2, 62]), s(d, [2, 63]), s(d, [2, 64]), s(d, [2, 65]), s(P, [2, 13], { 16: 39, 17: 40, 19: 80, 18: [1, 79], 20: [1, 81], 58: m, 84: b, 99: E, 101: y, 102: T }), s(P, [2, 15], { 20: [1, 82] }), { 15: 83, 16: 84, 17: 85, 58: m, 84: b, 99: E, 101: y, 102: T }, { 16: 39, 17: 40, 19: 86, 58: m, 84: b, 99: E, 101: y, 102: T }, s(re, [2, 119]), s(re, [2, 120]), s(re, [2, 121]), s(re, [2, 122]), s([1, 8, 9, 12, 13, 20, 22, 39, 41, 44, 66, 67, 68, 69, 70, 71, 72, 77, 79], [2, 123]), 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, 19: 21, 38: 22, 43: 23, 16: 39, 17: 40, 5: 87, 33: i, 35: a, 37: u, 42: l, 46: r, 47: o, 49: A, 50: g, 52: D, 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: T }), { 5: 88, 10: 5, 16: 39, 17: 40, 19: 21, 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: D, 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: T }, s(d, [2, 20]), s(d, [2, 31]), s(d, [2, 32]), { 13: [1, 90], 16: 39, 17: 40, 19: 89, 58: m, 84: b, 99: E, 101: y, 102: T }, { 51: 91, 64: 56, 65: 57, 66: ee, 67: te, 68: se, 69: ie, 70: ae, 71: Fe, 72: Be }, s(d, [2, 50]), { 65: 92, 71: Fe, 72: Be }, s(ue, [2, 69], { 64: 93, 66: ee, 67: te, 68: se, 69: ie, 70: ae }), s(z, [2, 70]), s(z, [2, 71]), s(z, [2, 72]), s(z, [2, 73]), s(z, [2, 74]), s(Me, [2, 75]), s(Me, [2, 76]), { 8: [1, 95], 24: 96, 40: 94, 43: 23, 46: r }, { 16: 97, 58: m, 84: b, 99: E, 101: y }, { 45: 98, 49: _e }, { 48: [1, 100] }, { 13: [1, 101] }, { 13: [1, 102] }, { 77: [1, 103], 79: [1, 104] }, { 22: K, 57: 105, 58: Y, 80: Q, 82: 106, 83: 107, 84: W, 85: j, 86: X, 87: q, 88: H, 89: J }, { 58: [1, 117] }, { 13: Pe, 53: 118 }, s(d, [2, 58]), s(d, [2, 124]), { 22: K, 57: 119, 58: Y, 59: [1, 120], 80: Q, 82: 106, 83: 107, 84: W, 85: j, 86: X, 87: q, 88: H, 89: J }, s(Re, [2, 60]), { 16: 39, 17: 40, 19: 121, 58: m, 84: b, 99: E, 101: y, 102: T }, s(P, [2, 16]), s(P, [2, 17]), s(P, [2, 18]), { 39: [2, 36] }, { 15: 123, 16: 84, 17: 85, 18: [1, 122], 39: [2, 9], 58: m, 84: b, 99: E, 101: y, 102: T }, { 39: [2, 10] }, s(Se, [2, 44], { 11: 124, 12: [1, 125] }), s(De, [2, 7]), { 9: [1, 126] }, s(le, [2, 53]), { 16: 39, 17: 40, 19: 127, 58: m, 84: b, 99: E, 101: y, 102: T }, { 13: [1, 129], 16: 39, 17: 40, 19: 128, 58: m, 84: b, 99: E, 101: y, 102: T }, s(ue, [2, 68], { 64: 130, 66: ee, 67: te, 68: se, 69: ie, 70: ae }), s(ue, [2, 67]), { 41: [1, 131] }, { 24: 96, 40: 132, 43: 23, 46: r }, { 8: [1, 133], 41: [2, 37] }, s(ne, [2, 41], { 39: [1, 134] }), { 41: [1, 135] }, { 41: [2, 47], 45: 136, 49: _e }, { 16: 39, 17: 40, 19: 137, 58: m, 84: b, 99: E, 101: y, 102: T }, s(d, [2, 77], { 13: [1, 138] }), s(d, [2, 79], { 13: [1, 140], 75: [1, 139] }), s(d, [2, 83], { 13: [1, 141], 78: [1, 142] }), { 13: [1, 143] }, s(d, [2, 91], { 59: Ge }), s(Ue, [2, 93], { 83: 145, 22: K, 58: Y, 80: Q, 84: W, 85: j, 86: X, 87: q, 88: H, 89: J }), s(N, [2, 95]), 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(N, [2, 105]), s(d, [2, 92]), s(d, [2, 57]), s(d, [2, 59], { 59: Ge }), { 58: [1, 146] }, s(P, [2, 14]), { 15: 147, 16: 84, 17: 85, 58: m, 84: b, 99: E, 101: y, 102: T }, { 39: [2, 12] }, s(Se, [2, 45]), { 13: [1, 148] }, { 1: [2, 4] }, s(le, [2, 55]), s(le, [2, 54]), { 16: 39, 17: 40, 19: 149, 58: m, 84: b, 99: E, 101: y, 102: T }, s(ue, [2, 66]), s(d, [2, 34]), { 41: [1, 150] }, { 24: 96, 40: 151, 41: [2, 38], 43: 23, 46: r }, { 45: 152, 49: _e }, s(ne, [2, 42]), { 41: [2, 48] }, s(d, [2, 46]), s(d, [2, 78]), s(d, [2, 80]), s(d, [2, 81], { 75: [1, 153] }), s(d, [2, 84]), s(d, [2, 85], { 13: [1, 154] }), s(d, [2, 87], { 13: [1, 156], 75: [1, 155] }), { 22: K, 58: Y, 80: Q, 82: 157, 83: 107, 84: W, 85: j, 86: X, 87: q, 88: H, 89: J }, s(N, [2, 96]), s(Re, [2, 61]), { 39: [2, 11] }, { 14: [1, 158] }, s(le, [2, 56]), s(d, [2, 35]), { 41: [2, 39] }, { 41: [1, 159] }, s(d, [2, 82]), s(d, [2, 86]), s(d, [2, 88]), s(d, [2, 89], { 75: [1, 160] }), s(Ue, [2, 94], { 83: 145, 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, 43]), s(d, [2, 90])],
230
+ defaultActions: { 2: [2, 1], 3: [2, 2], 4: [2, 3], 83: [2, 36], 85: [2, 10], 123: [2, 12], 126: [2, 4], 136: [2, 48], 147: [2, 11], 151: [2, 39] },
231
+ parseError: /* @__PURE__ */ f(function(c, h) {
232
+ if (h.recoverable)
233
+ this.trace(c);
234
+ else {
235
+ var p = new Error(c);
236
+ throw p.hash = h, p;
237
+ }
238
+ }, "parseError"),
239
+ parse: /* @__PURE__ */ f(function(c) {
240
+ 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), k = Object.create(this.lexer), O = { yy: {} };
241
+ for (var Le in this.yy)
242
+ Object.prototype.hasOwnProperty.call(this.yy, Le) && (O.yy[Le] = this.yy[Le]);
243
+ k.setInput(c, O.yy), O.yy.lexer = k, O.yy.parser = this, typeof k.yylloc > "u" && (k.yylloc = {});
244
+ var xe = k.yylloc;
245
+ e.push(xe);
246
+ var Ze = k.options && k.options.ranges;
247
+ typeof O.yy.parseError == "function" ? this.parseError = O.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
248
+ function $e(_) {
249
+ p.length = p.length - 2 * _, C.length = C.length - _, e.length = e.length - _;
250
+ }
251
+ f($e, "popStack");
252
+ function Ye() {
253
+ var _;
254
+ return _ = n.pop() || k.lex() || Ke, typeof _ != "number" && (_ instanceof Array && (n = _, _ = n.pop()), _ = h.symbols_[_] || _), _;
255
+ }
256
+ f(Ye, "lex");
257
+ for (var B, w, S, ve, M = {}, he, x, Qe, de; ; ) {
258
+ 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]) {
259
+ var Ie = "";
260
+ de = [];
261
+ for (he in Z[w])
262
+ this.terminals_[he] && he > He && de.push("'" + this.terminals_[he] + "'");
263
+ k.showPosition ? Ie = "Parse error on line " + (oe + 1) + `:
264
+ ` + k.showPosition() + `
265
+ 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, {
266
+ text: k.match,
267
+ token: this.terminals_[B] || B,
268
+ line: k.yylineno,
269
+ loc: xe,
270
+ expected: de
271
+ });
272
+ }
273
+ if (S[0] instanceof Array && S.length > 1)
274
+ throw new Error("Parse Error: multiple actions possible at state: " + w + ", token: " + B);
275
+ switch (S[0]) {
276
+ case 1:
277
+ p.push(B), C.push(k.yytext), e.push(k.yylloc), p.push(S[1]), B = null, ze = k.yyleng, t = k.yytext, oe = k.yylineno, xe = k.yylloc;
278
+ break;
279
+ case 2:
280
+ if (x = this.productions_[S[1]][1], M.$ = C[C.length - x], M._$ = {
281
+ first_line: e[e.length - (x || 1)].first_line,
282
+ last_line: e[e.length - 1].last_line,
283
+ first_column: e[e.length - (x || 1)].first_column,
284
+ last_column: e[e.length - 1].last_column
285
+ }, Ze && (M._$.range = [
286
+ e[e.length - (x || 1)].range[0],
287
+ e[e.length - 1].range[1]
288
+ ]), ve = this.performAction.apply(M, [
289
+ t,
290
+ ze,
291
+ oe,
292
+ O.yy,
293
+ S[1],
294
+ C,
295
+ e
296
+ ].concat(Je)), typeof ve < "u")
297
+ return ve;
298
+ 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);
299
+ break;
300
+ case 3:
301
+ return !0;
302
+ }
303
+ }
304
+ return !0;
305
+ }, "parse")
306
+ }, qe = /* @__PURE__ */ function() {
307
+ var I = {
308
+ EOF: 1,
309
+ parseError: /* @__PURE__ */ f(function(h, p) {
310
+ if (this.yy.parser)
311
+ this.yy.parser.parseError(h, p);
312
+ else
313
+ throw new Error(h);
314
+ }, "parseError"),
315
+ // resets the lexer, sets new input
316
+ setInput: /* @__PURE__ */ f(function(c, h) {
317
+ 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 = {
318
+ first_line: 1,
319
+ first_column: 0,
320
+ last_line: 1,
321
+ last_column: 0
322
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
323
+ }, "setInput"),
324
+ // consumes and returns one char from the input
325
+ input: /* @__PURE__ */ f(function() {
326
+ var c = this._input[0];
327
+ this.yytext += c, this.yyleng++, this.offset++, this.match += c, this.matched += c;
328
+ var h = c.match(/(?:\r\n?|\n).*/g);
329
+ 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;
330
+ }, "input"),
331
+ // unshifts one char (or a string) into the input
332
+ unput: /* @__PURE__ */ f(function(c) {
333
+ var h = c.length, p = c.split(/(?:\r\n?|\n)/g);
334
+ this._input = c + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - h), this.offset -= h;
335
+ var n = this.match.split(/(?:\r\n?|\n)/g);
336
+ 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);
337
+ var C = this.yylloc.range;
338
+ return this.yylloc = {
339
+ first_line: this.yylloc.first_line,
340
+ last_line: this.yylineno + 1,
341
+ first_column: this.yylloc.first_column,
342
+ 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
343
+ }, this.options.ranges && (this.yylloc.range = [C[0], C[0] + this.yyleng - h]), this.yyleng = this.yytext.length, this;
344
+ }, "unput"),
345
+ // When called from action, caches matched text and appends it on next action
346
+ more: /* @__PURE__ */ f(function() {
347
+ return this._more = !0, this;
348
+ }, "more"),
349
+ // 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.
350
+ reject: /* @__PURE__ */ f(function() {
351
+ if (this.options.backtrack_lexer)
352
+ this._backtrack = !0;
353
+ else
354
+ 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).
355
+ ` + this.showPosition(), {
356
+ text: "",
357
+ token: null,
358
+ line: this.yylineno
359
+ });
360
+ return this;
361
+ }, "reject"),
362
+ // retain first n characters of the match
363
+ less: /* @__PURE__ */ f(function(c) {
364
+ this.unput(this.match.slice(c));
365
+ }, "less"),
366
+ // displays already matched input, i.e. for error messages
367
+ pastInput: /* @__PURE__ */ f(function() {
368
+ var c = this.matched.substr(0, this.matched.length - this.match.length);
369
+ return (c.length > 20 ? "..." : "") + c.substr(-20).replace(/\n/g, "");
370
+ }, "pastInput"),
371
+ // displays upcoming input, i.e. for error messages
372
+ upcomingInput: /* @__PURE__ */ f(function() {
373
+ var c = this.match;
374
+ return c.length < 20 && (c += this._input.substr(0, 20 - c.length)), (c.substr(0, 20) + (c.length > 20 ? "..." : "")).replace(/\n/g, "");
375
+ }, "upcomingInput"),
376
+ // displays the character position where the lexing error occurred, i.e. for error messages
377
+ showPosition: /* @__PURE__ */ f(function() {
378
+ var c = this.pastInput(), h = new Array(c.length + 1).join("-");
379
+ return c + this.upcomingInput() + `
380
+ ` + h + "^";
381
+ }, "showPosition"),
382
+ // test the lexed token: return FALSE when not a match, otherwise return token
383
+ test_match: /* @__PURE__ */ f(function(c, h) {
384
+ var p, n, C;
385
+ if (this.options.backtrack_lexer && (C = {
386
+ yylineno: this.yylineno,
387
+ yylloc: {
388
+ first_line: this.yylloc.first_line,
389
+ last_line: this.last_line,
390
+ first_column: this.yylloc.first_column,
391
+ last_column: this.yylloc.last_column
392
+ },
393
+ yytext: this.yytext,
394
+ match: this.match,
395
+ matches: this.matches,
396
+ matched: this.matched,
397
+ yyleng: this.yyleng,
398
+ offset: this.offset,
399
+ _more: this._more,
400
+ _input: this._input,
401
+ yy: this.yy,
402
+ conditionStack: this.conditionStack.slice(0),
403
+ done: this.done
404
+ }, 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 = {
405
+ first_line: this.yylloc.last_line,
406
+ last_line: this.yylineno + 1,
407
+ first_column: this.yylloc.last_column,
408
+ last_column: n ? n[n.length - 1].length - n[n.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + c[0].length
409
+ }, 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)
410
+ return p;
411
+ if (this._backtrack) {
412
+ for (var e in C)
413
+ this[e] = C[e];
414
+ return !1;
415
+ }
416
+ return !1;
417
+ }, "test_match"),
418
+ // return next match in input
419
+ next: /* @__PURE__ */ f(function() {
420
+ if (this.done)
421
+ return this.EOF;
422
+ this._input || (this.done = !0);
423
+ var c, h, p, n;
424
+ this._more || (this.yytext = "", this.match = "");
425
+ for (var C = this._currentRules(), e = 0; e < C.length; e++)
426
+ if (p = this._input.match(this.rules[C[e]]), p && (!h || p[0].length > h[0].length)) {
427
+ if (h = p, n = e, this.options.backtrack_lexer) {
428
+ if (c = this.test_match(p, C[e]), c !== !1)
429
+ return c;
430
+ if (this._backtrack) {
431
+ h = !1;
432
+ continue;
433
+ } else
434
+ return !1;
435
+ } else if (!this.options.flex)
436
+ break;
437
+ }
438
+ 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.
439
+ ` + this.showPosition(), {
440
+ text: "",
441
+ token: null,
442
+ line: this.yylineno
443
+ });
444
+ }, "next"),
445
+ // return next match that has a token
446
+ lex: /* @__PURE__ */ f(function() {
447
+ var h = this.next();
448
+ return h || this.lex();
449
+ }, "lex"),
450
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
451
+ begin: /* @__PURE__ */ f(function(h) {
452
+ this.conditionStack.push(h);
453
+ }, "begin"),
454
+ // pop the previously active lexer condition state off the condition stack
455
+ popState: /* @__PURE__ */ f(function() {
456
+ var h = this.conditionStack.length - 1;
457
+ return h > 0 ? this.conditionStack.pop() : this.conditionStack[0];
458
+ }, "popState"),
459
+ // produce the lexer rule set which is active for the currently active lexer condition state
460
+ _currentRules: /* @__PURE__ */ f(function() {
461
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
462
+ }, "_currentRules"),
463
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
464
+ topState: /* @__PURE__ */ f(function(h) {
465
+ return h = this.conditionStack.length - 1 - Math.abs(h || 0), h >= 0 ? this.conditionStack[h] : "INITIAL";
466
+ }, "topState"),
467
+ // alias for begin(condition)
468
+ pushState: /* @__PURE__ */ f(function(h) {
469
+ this.begin(h);
470
+ }, "pushState"),
471
+ // return the number of states currently on the stack
472
+ stateStackSize: /* @__PURE__ */ f(function() {
473
+ return this.conditionStack.length;
474
+ }, "stateStackSize"),
475
+ options: {},
476
+ performAction: /* @__PURE__ */ f(function(h, p, n, C) {
477
+ switch (n) {
478
+ case 0:
479
+ return 60;
480
+ case 1:
481
+ return 61;
482
+ case 2:
483
+ return 62;
484
+ case 3:
485
+ return 63;
486
+ case 4:
487
+ break;
488
+ case 5:
489
+ break;
490
+ case 6:
491
+ return this.begin("acc_title"), 33;
492
+ case 7:
493
+ return this.popState(), "acc_title_value";
494
+ case 8:
495
+ return this.begin("acc_descr"), 35;
496
+ case 9:
497
+ return this.popState(), "acc_descr_value";
498
+ case 10:
499
+ this.begin("acc_descr_multiline");
500
+ break;
501
+ case 11:
502
+ this.popState();
503
+ break;
504
+ case 12:
505
+ return "acc_descr_multiline_value";
506
+ case 13:
507
+ return 8;
508
+ case 14:
509
+ break;
510
+ case 15:
511
+ return 7;
512
+ case 16:
513
+ return 7;
514
+ case 17:
515
+ return "EDGE_STATE";
516
+ case 18:
517
+ this.begin("callback_name");
518
+ break;
519
+ case 19:
520
+ this.popState();
521
+ break;
522
+ case 20:
523
+ this.popState(), this.begin("callback_args");
524
+ break;
525
+ case 21:
526
+ return 77;
527
+ case 22:
528
+ this.popState();
529
+ break;
530
+ case 23:
531
+ return 78;
532
+ case 24:
533
+ this.popState();
534
+ break;
535
+ case 25:
536
+ return "STR";
537
+ case 26:
538
+ this.begin("string");
539
+ break;
540
+ case 27:
541
+ return 80;
542
+ case 28:
543
+ return 55;
544
+ case 29:
545
+ return this.begin("namespace"), 42;
546
+ case 30:
547
+ return this.popState(), 8;
548
+ case 31:
549
+ break;
550
+ case 32:
551
+ return this.begin("namespace-body"), 39;
552
+ case 33:
553
+ return this.popState(), 41;
554
+ case 34:
555
+ return "EOF_IN_STRUCT";
556
+ case 35:
557
+ return 8;
558
+ case 36:
559
+ break;
560
+ case 37:
561
+ return "EDGE_STATE";
562
+ case 38:
563
+ return this.begin("class"), 46;
564
+ case 39:
565
+ return this.popState(), 8;
566
+ case 40:
567
+ break;
568
+ case 41:
569
+ return this.popState(), this.popState(), 41;
570
+ case 42:
571
+ return this.begin("class-body"), 39;
572
+ case 43:
573
+ return this.popState(), 41;
574
+ case 44:
575
+ return "EOF_IN_STRUCT";
576
+ case 45:
577
+ return "EDGE_STATE";
578
+ case 46:
579
+ return "OPEN_IN_STRUCT";
580
+ case 47:
581
+ break;
582
+ case 48:
583
+ return "MEMBER";
584
+ case 49:
585
+ return 81;
586
+ case 50:
587
+ return 73;
588
+ case 51:
589
+ return 74;
590
+ case 52:
591
+ return 76;
592
+ case 53:
593
+ return 52;
594
+ case 54:
595
+ return 54;
596
+ case 55:
597
+ return 47;
598
+ case 56:
599
+ return 48;
600
+ case 57:
601
+ return 79;
602
+ case 58:
603
+ this.popState();
604
+ break;
605
+ case 59:
606
+ return "GENERICTYPE";
607
+ case 60:
608
+ this.begin("generic");
609
+ break;
610
+ case 61:
611
+ this.popState();
612
+ break;
613
+ case 62:
614
+ return "BQUOTE_STR";
615
+ case 63:
616
+ this.begin("bqstring");
617
+ break;
618
+ case 64:
619
+ return 75;
620
+ case 65:
621
+ return 75;
622
+ case 66:
623
+ return 75;
624
+ case 67:
625
+ return 75;
626
+ case 68:
627
+ return 67;
628
+ case 69:
629
+ return 67;
630
+ case 70:
631
+ return 69;
632
+ case 71:
633
+ return 69;
634
+ case 72:
635
+ return 68;
636
+ case 73:
637
+ return 66;
638
+ case 74:
639
+ return 70;
640
+ case 75:
641
+ return 71;
642
+ case 76:
643
+ return 72;
644
+ case 77:
645
+ return 22;
646
+ case 78:
647
+ return 44;
648
+ case 79:
649
+ return 99;
650
+ case 80:
651
+ return 18;
652
+ case 81:
653
+ return "PLUS";
654
+ case 82:
655
+ return 85;
656
+ case 83:
657
+ return 59;
658
+ case 84:
659
+ return 88;
660
+ case 85:
661
+ return 88;
662
+ case 86:
663
+ return 89;
664
+ case 87:
665
+ return "EQUALS";
666
+ case 88:
667
+ return "EQUALS";
668
+ case 89:
669
+ return 58;
670
+ case 90:
671
+ return 12;
672
+ case 91:
673
+ return 14;
674
+ case 92:
675
+ return "PUNCTUATION";
676
+ case 93:
677
+ return 84;
678
+ case 94:
679
+ return 101;
680
+ case 95:
681
+ return 87;
682
+ case 96:
683
+ return 87;
684
+ case 97:
685
+ return 9;
686
+ }
687
+ }, "anonymous"),
688
+ 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)/, /^(?:$)/],
689
+ 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 } }
690
+ };
691
+ return I;
692
+ }();
693
+ Ne.lexer = qe;
694
+ function ce() {
695
+ this.yy = {};
696
+ }
697
+ return f(ce, "Parser"), ce.prototype = Ne, Ne.Parser = ce, new ce();
698
+ }();
699
+ Ve.parser = Ve;
700
+ var Tt = Ve, We = ["#", "+", "~", "-", ""], G, je = (G = class {
701
+ constructor(i, a) {
702
+ this.memberType = a, this.visibility = "", this.classifier = "", this.text = "";
703
+ const u = pt(i, F());
704
+ this.parseMember(u);
705
+ }
706
+ getDisplayDetails() {
707
+ let i = this.visibility + R(this.id);
708
+ this.memberType === "method" && (i += `(${R(this.parameters.trim())})`, this.returnType && (i += " : " + R(this.returnType))), i = i.trim();
709
+ const a = this.parseClassifier();
710
+ return {
711
+ displayText: i,
712
+ cssStyle: a
713
+ };
714
+ }
715
+ parseMember(i) {
716
+ let a = "";
717
+ if (this.memberType === "method") {
718
+ const r = /([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(i);
719
+ if (r) {
720
+ const o = r[1] ? r[1].trim() : "";
721
+ 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 === "") {
722
+ const A = this.returnType.substring(this.returnType.length - 1);
723
+ /[$*]/.exec(A) && (a = A, this.returnType = this.returnType.substring(0, this.returnType.length - 1));
724
+ }
725
+ }
726
+ } else {
727
+ const l = i.length, r = i.substring(0, 1), o = i.substring(l - 1);
728
+ We.includes(r) && (this.visibility = r), /[$*]/.exec(o) && (a = o), this.id = i.substring(
729
+ this.visibility === "" ? 0 : 1,
730
+ a === "" ? l : l - 1
731
+ );
732
+ }
733
+ this.classifier = a, this.id = this.id.startsWith(" ") ? " " + this.id.trim() : this.id.trim();
734
+ const u = `${this.visibility ? "\\" + this.visibility : ""}${R(this.id)}${this.memberType === "method" ? `(${R(this.parameters)})${this.returnType ? " : " + R(this.returnType) : ""}` : ""}`;
735
+ this.text = u.replaceAll("<", "&lt;").replaceAll(">", "&gt;"), this.text.startsWith("\\&lt;") && (this.text = this.text.replace("\\&lt;", "~"));
736
+ }
737
+ parseClassifier() {
738
+ switch (this.classifier) {
739
+ case "*":
740
+ return "font-style:italic;";
741
+ case "$":
742
+ return "text-decoration:underline;";
743
+ default:
744
+ return "";
745
+ }
746
+ }
747
+ }, f(G, "ClassMember"), G), pe = "classId-", Xe = 0, V = /* @__PURE__ */ f((s) => v.sanitizeText(s, F()), "sanitizeText"), U, kt = (U = class {
748
+ constructor() {
749
+ 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 = {
750
+ LINE: 0,
751
+ DOTTED_LINE: 1
752
+ }, this.relationType = {
753
+ AGGREGATION: 0,
754
+ EXTENSION: 1,
755
+ COMPOSITION: 2,
756
+ DEPENDENCY: 3,
757
+ LOLLIPOP: 4
758
+ }, this.setupToolTips = /* @__PURE__ */ f((i) => {
759
+ let a = $(".mermaidTooltip");
760
+ (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) => {
761
+ const o = $(r.currentTarget);
762
+ if (o.attr("title") === null)
763
+ return;
764
+ const g = this.getBoundingClientRect();
765
+ 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(/&lt;br\/&gt;/g, "<br/>")), o.classed("hover", !0);
766
+ }).on("mouseout", (r) => {
767
+ a.transition().duration(500).style("opacity", 0), $(r.currentTarget).classed("hover", !1);
768
+ });
769
+ }, "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);
770
+ }
771
+ splitClassNameAndType(i) {
772
+ const a = v.sanitizeText(i, F());
773
+ let u = "", l = a;
774
+ if (a.indexOf("~") > 0) {
775
+ const r = a.split("~");
776
+ l = V(r[0]), u = V(r[1]);
777
+ }
778
+ return { className: l, type: u };
779
+ }
780
+ setClassLabel(i, a) {
781
+ const u = v.sanitizeText(i, F());
782
+ a && (a = V(a));
783
+ const { className: l } = this.splitClassNameAndType(u);
784
+ this.classes.get(l).label = a, this.classes.get(l).text = `${a}${this.classes.get(l).type ? `<${this.classes.get(l).type}>` : ""}`;
785
+ }
786
+ /**
787
+ * Function called by parser when a node definition has been found.
788
+ *
789
+ * @param id - ID of the class to add
790
+ * @public
791
+ */
792
+ addClass(i) {
793
+ const a = v.sanitizeText(i, F()), { className: u, type: l } = this.splitClassNameAndType(a);
794
+ if (this.classes.has(u))
795
+ return;
796
+ const r = v.sanitizeText(u, F());
797
+ this.classes.set(r, {
798
+ id: r,
799
+ type: l,
800
+ label: r,
801
+ text: `${r}${l ? `&lt;${l}&gt;` : ""}`,
802
+ shape: "classBox",
803
+ cssClasses: "default",
804
+ methods: [],
805
+ members: [],
806
+ annotations: [],
807
+ styles: [],
808
+ domId: pe + r + "-" + Xe
809
+ }), Xe++;
810
+ }
811
+ addInterface(i, a) {
812
+ const u = {
813
+ id: `interface${this.interfaces.length}`,
814
+ label: i,
815
+ classId: a
816
+ };
817
+ this.interfaces.push(u);
818
+ }
819
+ /**
820
+ * Function to lookup domId from id in the graph definition.
821
+ *
822
+ * @param id - class ID to lookup
823
+ * @public
824
+ */
825
+ lookUpDomId(i) {
826
+ const a = v.sanitizeText(i, F());
827
+ if (this.classes.has(a))
828
+ return this.classes.get(a).domId;
829
+ throw new Error("Class not found: " + a);
830
+ }
831
+ clear() {
832
+ 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();
833
+ }
834
+ getClass(i) {
835
+ return this.classes.get(i);
836
+ }
837
+ getClasses() {
838
+ return this.classes;
839
+ }
840
+ getRelations() {
841
+ return this.relations;
842
+ }
843
+ getNotes() {
844
+ return this.notes;
845
+ }
846
+ addRelation(i) {
847
+ Oe.debug("Adding relation: " + JSON.stringify(i));
848
+ const a = [
849
+ this.relationType.LOLLIPOP,
850
+ this.relationType.AGGREGATION,
851
+ this.relationType.COMPOSITION,
852
+ this.relationType.DEPENDENCY,
853
+ this.relationType.EXTENSION
854
+ ];
855
+ 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(
856
+ i.relationTitle1.trim(),
857
+ F()
858
+ ), i.relationTitle2 = v.sanitizeText(
859
+ i.relationTitle2.trim(),
860
+ F()
861
+ ), this.relations.push(i);
862
+ }
863
+ /**
864
+ * Adds an annotation to the specified class Annotations mark special properties of the given type
865
+ * (like 'interface' or 'service')
866
+ *
867
+ * @param className - The class name
868
+ * @param annotation - The name of the annotation without any brackets
869
+ * @public
870
+ */
871
+ addAnnotation(i, a) {
872
+ const u = this.splitClassNameAndType(i).className;
873
+ this.classes.get(u).annotations.push(a);
874
+ }
875
+ /**
876
+ * Adds a member to the specified class
877
+ *
878
+ * @param className - The class name
879
+ * @param member - The full name of the member. If the member is enclosed in `<<brackets>>` it is
880
+ * treated as an annotation If the member is ending with a closing bracket ) it is treated as a
881
+ * method Otherwise the member will be treated as a normal property
882
+ * @public
883
+ */
884
+ addMember(i, a) {
885
+ this.addClass(i);
886
+ const u = this.splitClassNameAndType(i).className, l = this.classes.get(u);
887
+ if (typeof a == "string") {
888
+ const r = a.trim();
889
+ 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"));
890
+ }
891
+ }
892
+ addMembers(i, a) {
893
+ Array.isArray(a) && (a.reverse(), a.forEach((u) => this.addMember(i, u)));
894
+ }
895
+ addNote(i, a) {
896
+ const u = {
897
+ id: `note${this.notes.length}`,
898
+ class: a,
899
+ text: i
900
+ };
901
+ this.notes.push(u);
902
+ }
903
+ cleanupLabel(i) {
904
+ return i.startsWith(":") && (i = i.substring(1)), V(i.trim());
905
+ }
906
+ /**
907
+ * Called by parser when assigning cssClass to a class
908
+ *
909
+ * @param ids - Comma separated list of ids
910
+ * @param className - Class to add
911
+ */
912
+ setCssClass(i, a) {
913
+ i.split(",").forEach((u) => {
914
+ let l = u;
915
+ /\d/.exec(u[0]) && (l = pe + l);
916
+ const r = this.classes.get(l);
917
+ r && (r.cssClasses += " " + a);
918
+ });
919
+ }
920
+ defineClass(i, a) {
921
+ for (const u of i) {
922
+ let l = this.styleClasses.get(u);
923
+ l === void 0 && (l = { id: u, styles: [], textStyles: [] }, this.styleClasses.set(u, l)), a && a.forEach((r) => {
924
+ if (/color/.exec(r)) {
925
+ const o = r.replace("fill", "bgFill");
926
+ l.textStyles.push(o);
927
+ }
928
+ l.styles.push(r);
929
+ }), this.classes.forEach((r) => {
930
+ r.cssClasses.includes(u) && r.styles.push(...a.flatMap((o) => o.split(",")));
931
+ });
932
+ }
933
+ }
934
+ /**
935
+ * Called by parser when a tooltip is found, e.g. a clickable element.
936
+ *
937
+ * @param ids - Comma separated list of ids
938
+ * @param tooltip - Tooltip to add
939
+ */
940
+ setTooltip(i, a) {
941
+ i.split(",").forEach((u) => {
942
+ a !== void 0 && (this.classes.get(u).tooltip = V(a));
943
+ });
944
+ }
945
+ getTooltip(i, a) {
946
+ return a && this.namespaces.has(a) ? this.namespaces.get(a).classes.get(i).tooltip : this.classes.get(i).tooltip;
947
+ }
948
+ /**
949
+ * Called by parser when a link is found. Adds the URL to the vertex data.
950
+ *
951
+ * @param ids - Comma separated list of ids
952
+ * @param linkStr - URL to create a link for
953
+ * @param target - Target of the link, _blank by default as originally defined in the svgDraw.js file
954
+ */
955
+ setLink(i, a, u) {
956
+ const l = F();
957
+ i.split(",").forEach((r) => {
958
+ let o = r;
959
+ /\d/.exec(r[0]) && (o = pe + o);
960
+ const A = this.classes.get(o);
961
+ A && (A.link = we.formatUrl(a, l), l.securityLevel === "sandbox" ? A.linkTarget = "_top" : typeof u == "string" ? A.linkTarget = V(u) : A.linkTarget = "_blank");
962
+ }), this.setCssClass(i, "clickable");
963
+ }
964
+ /**
965
+ * Called by parser when a click definition is found. Registers an event handler.
966
+ *
967
+ * @param ids - Comma separated list of ids
968
+ * @param functionName - Function to be called on click
969
+ * @param functionArgs - Function args the function should be called with
970
+ */
971
+ setClickEvent(i, a, u) {
972
+ i.split(",").forEach((l) => {
973
+ this.setClickFunc(l, a, u), this.classes.get(l).haveCallback = !0;
974
+ }), this.setCssClass(i, "clickable");
975
+ }
976
+ setClickFunc(i, a, u) {
977
+ const l = v.sanitizeText(i, F());
978
+ if (F().securityLevel !== "loose" || a === void 0)
979
+ return;
980
+ const o = l;
981
+ if (this.classes.has(o)) {
982
+ const A = this.lookUpDomId(o);
983
+ let g = [];
984
+ if (typeof u == "string") {
985
+ g = u.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
986
+ for (let D = 0; D < g.length; D++) {
987
+ let L = g[D].trim();
988
+ L.startsWith('"') && L.endsWith('"') && (L = L.substr(1, L.length - 2)), g[D] = L;
989
+ }
990
+ }
991
+ g.length === 0 && g.push(A), this.functions.push(() => {
992
+ const D = document.querySelector(`[id="${A}"]`);
993
+ D !== null && D.addEventListener(
994
+ "click",
995
+ () => {
996
+ we.runFunc(a, ...g);
997
+ },
998
+ !1
999
+ );
1000
+ });
1001
+ }
1002
+ }
1003
+ bindFunctions(i) {
1004
+ this.functions.forEach((a) => {
1005
+ a(i);
1006
+ });
1007
+ }
1008
+ getDirection() {
1009
+ return this.direction;
1010
+ }
1011
+ setDirection(i) {
1012
+ this.direction = i;
1013
+ }
1014
+ /**
1015
+ * Function called by parser when a namespace definition has been found.
1016
+ *
1017
+ * @param id - ID of the namespace to add
1018
+ * @public
1019
+ */
1020
+ addNamespace(i) {
1021
+ this.namespaces.has(i) || (this.namespaces.set(i, {
1022
+ id: i,
1023
+ classes: /* @__PURE__ */ new Map(),
1024
+ children: {},
1025
+ domId: pe + i + "-" + this.namespaceCounter
1026
+ }), this.namespaceCounter++);
1027
+ }
1028
+ getNamespace(i) {
1029
+ return this.namespaces.get(i);
1030
+ }
1031
+ getNamespaces() {
1032
+ return this.namespaces;
1033
+ }
1034
+ /**
1035
+ * Function called by parser when a namespace definition has been found.
1036
+ *
1037
+ * @param id - ID of the namespace to add
1038
+ * @param classNames - IDs of the class to add
1039
+ * @public
1040
+ */
1041
+ addClassesToNamespace(i, a) {
1042
+ if (this.namespaces.has(i))
1043
+ for (const u of a) {
1044
+ const { className: l } = this.splitClassNameAndType(u);
1045
+ this.classes.get(l).parent = i, this.namespaces.get(i).classes.set(l, this.classes.get(l));
1046
+ }
1047
+ }
1048
+ setCssStyle(i, a) {
1049
+ const u = this.classes.get(i);
1050
+ if (!(!a || !u))
1051
+ for (const l of a)
1052
+ l.includes(",") ? u.styles.push(...l.split(",")) : u.styles.push(l);
1053
+ }
1054
+ /**
1055
+ * Gets the arrow marker for a type index
1056
+ *
1057
+ * @param type - The type to look for
1058
+ * @returns The arrow marker
1059
+ */
1060
+ getArrowMarker(i) {
1061
+ let a;
1062
+ switch (i) {
1063
+ case 0:
1064
+ a = "aggregation";
1065
+ break;
1066
+ case 1:
1067
+ a = "extension";
1068
+ break;
1069
+ case 2:
1070
+ a = "composition";
1071
+ break;
1072
+ case 3:
1073
+ a = "dependency";
1074
+ break;
1075
+ case 4:
1076
+ a = "lollipop";
1077
+ break;
1078
+ default:
1079
+ a = "none";
1080
+ }
1081
+ return a;
1082
+ }
1083
+ getData() {
1084
+ var r;
1085
+ const i = [], a = [], u = F();
1086
+ for (const o of this.namespaces.keys()) {
1087
+ const A = this.namespaces.get(o);
1088
+ if (A) {
1089
+ const g = {
1090
+ id: A.id,
1091
+ label: A.id,
1092
+ isGroup: !0,
1093
+ padding: u.class.padding ?? 16,
1094
+ // parent node must be one of [rect, roundedWithTitle, noteGroup, divider]
1095
+ shape: "rect",
1096
+ cssStyles: ["fill: none", "stroke: black"],
1097
+ look: u.look
1098
+ };
1099
+ i.push(g);
1100
+ }
1101
+ }
1102
+ for (const o of this.classes.keys()) {
1103
+ const A = this.classes.get(o);
1104
+ if (A) {
1105
+ const g = A;
1106
+ g.parentId = A.parent, g.look = u.look, i.push(g);
1107
+ }
1108
+ }
1109
+ let l = 0;
1110
+ for (const o of this.notes) {
1111
+ l++;
1112
+ const A = {
1113
+ id: o.id,
1114
+ label: o.text,
1115
+ isGroup: !1,
1116
+ shape: "note",
1117
+ padding: u.class.padding ?? 6,
1118
+ cssStyles: [
1119
+ "text-align: left",
1120
+ "white-space: nowrap",
1121
+ `fill: ${u.themeVariables.noteBkgColor}`,
1122
+ `stroke: ${u.themeVariables.noteBorderColor}`
1123
+ ],
1124
+ look: u.look
1125
+ };
1126
+ i.push(A);
1127
+ const g = ((r = this.classes.get(o.class)) == null ? void 0 : r.id) ?? "";
1128
+ if (g) {
1129
+ const D = {
1130
+ id: `edgeNote${l}`,
1131
+ start: o.id,
1132
+ end: g,
1133
+ type: "normal",
1134
+ thickness: "normal",
1135
+ classes: "relation",
1136
+ arrowTypeStart: "none",
1137
+ arrowTypeEnd: "none",
1138
+ arrowheadStyle: "",
1139
+ labelStyle: [""],
1140
+ style: ["fill: none"],
1141
+ pattern: "dotted",
1142
+ look: u.look
1143
+ };
1144
+ a.push(D);
1145
+ }
1146
+ }
1147
+ for (const o of this.interfaces) {
1148
+ const A = {
1149
+ id: o.id,
1150
+ label: o.label,
1151
+ isGroup: !1,
1152
+ shape: "rect",
1153
+ cssStyles: ["opacity: 0;"],
1154
+ look: u.look
1155
+ };
1156
+ i.push(A);
1157
+ }
1158
+ l = 0;
1159
+ for (const o of this.relations) {
1160
+ l++;
1161
+ const A = {
1162
+ id: dt(o.id1, o.id2, {
1163
+ prefix: "id",
1164
+ counter: l
1165
+ }),
1166
+ start: o.id1,
1167
+ end: o.id2,
1168
+ type: "normal",
1169
+ label: o.title,
1170
+ labelpos: "c",
1171
+ thickness: "normal",
1172
+ classes: "relation",
1173
+ arrowTypeStart: this.getArrowMarker(o.relation.type1),
1174
+ arrowTypeEnd: this.getArrowMarker(o.relation.type2),
1175
+ startLabelRight: o.relationTitle1 === "none" ? "" : o.relationTitle1,
1176
+ endLabelLeft: o.relationTitle2 === "none" ? "" : o.relationTitle2,
1177
+ arrowheadStyle: "",
1178
+ labelStyle: ["display: inline-block"],
1179
+ style: o.style || "",
1180
+ pattern: o.relation.lineType == 1 ? "dashed" : "solid",
1181
+ look: u.look
1182
+ };
1183
+ a.push(A);
1184
+ }
1185
+ return { nodes: i, edges: a, other: {}, config: u, direction: this.getDirection() };
1186
+ }
1187
+ }, f(U, "ClassDB"), U), At = /* @__PURE__ */ f((s) => `g.classGroup text {
1188
+ fill: ${s.nodeBorder || s.classText};
1189
+ stroke: none;
1190
+ font-family: ${s.fontFamily};
1191
+ font-size: 10px;
1192
+
1193
+ .title {
1194
+ font-weight: bolder;
1195
+ }
1196
+
1197
+ }
1198
+
1199
+ .nodeLabel, .edgeLabel {
1200
+ color: ${s.classText};
1201
+ }
1202
+ .edgeLabel .label rect {
1203
+ fill: ${s.mainBkg};
1204
+ }
1205
+ .label text {
1206
+ fill: ${s.classText};
1207
+ }
1208
+
1209
+ .labelBkg {
1210
+ background: ${s.mainBkg};
1211
+ }
1212
+ .edgeLabel .label span {
1213
+ background: ${s.mainBkg};
1214
+ }
1215
+
1216
+ .classTitle {
1217
+ font-weight: bolder;
1218
+ }
1219
+ .node rect,
1220
+ .node circle,
1221
+ .node ellipse,
1222
+ .node polygon,
1223
+ .node path {
1224
+ fill: ${s.mainBkg};
1225
+ stroke: ${s.nodeBorder};
1226
+ stroke-width: 1px;
1227
+ }
1228
+
1229
+
1230
+ .divider {
1231
+ stroke: ${s.nodeBorder};
1232
+ stroke-width: 1;
1233
+ }
1234
+
1235
+ g.clickable {
1236
+ cursor: pointer;
1237
+ }
1238
+
1239
+ g.classGroup rect {
1240
+ fill: ${s.mainBkg};
1241
+ stroke: ${s.nodeBorder};
1242
+ }
1243
+
1244
+ g.classGroup line {
1245
+ stroke: ${s.nodeBorder};
1246
+ stroke-width: 1;
1247
+ }
1248
+
1249
+ .classLabel .box {
1250
+ stroke: none;
1251
+ stroke-width: 0;
1252
+ fill: ${s.mainBkg};
1253
+ opacity: 0.5;
1254
+ }
1255
+
1256
+ .classLabel .label {
1257
+ fill: ${s.nodeBorder};
1258
+ font-size: 10px;
1259
+ }
1260
+
1261
+ .relation {
1262
+ stroke: ${s.lineColor};
1263
+ stroke-width: 1;
1264
+ fill: none;
1265
+ }
1266
+
1267
+ .dashed-line{
1268
+ stroke-dasharray: 3;
1269
+ }
1270
+
1271
+ .dotted-line{
1272
+ stroke-dasharray: 1 2;
1273
+ }
1274
+
1275
+ #compositionStart, .composition {
1276
+ fill: ${s.lineColor} !important;
1277
+ stroke: ${s.lineColor} !important;
1278
+ stroke-width: 1;
1279
+ }
1280
+
1281
+ #compositionEnd, .composition {
1282
+ fill: ${s.lineColor} !important;
1283
+ stroke: ${s.lineColor} !important;
1284
+ stroke-width: 1;
1285
+ }
1286
+
1287
+ #dependencyStart, .dependency {
1288
+ fill: ${s.lineColor} !important;
1289
+ stroke: ${s.lineColor} !important;
1290
+ stroke-width: 1;
1291
+ }
1292
+
1293
+ #dependencyStart, .dependency {
1294
+ fill: ${s.lineColor} !important;
1295
+ stroke: ${s.lineColor} !important;
1296
+ stroke-width: 1;
1297
+ }
1298
+
1299
+ #extensionStart, .extension {
1300
+ fill: transparent !important;
1301
+ stroke: ${s.lineColor} !important;
1302
+ stroke-width: 1;
1303
+ }
1304
+
1305
+ #extensionEnd, .extension {
1306
+ fill: transparent !important;
1307
+ stroke: ${s.lineColor} !important;
1308
+ stroke-width: 1;
1309
+ }
1310
+
1311
+ #aggregationStart, .aggregation {
1312
+ fill: transparent !important;
1313
+ stroke: ${s.lineColor} !important;
1314
+ stroke-width: 1;
1315
+ }
1316
+
1317
+ #aggregationEnd, .aggregation {
1318
+ fill: transparent !important;
1319
+ stroke: ${s.lineColor} !important;
1320
+ stroke-width: 1;
1321
+ }
1322
+
1323
+ #lollipopStart, .lollipop {
1324
+ fill: ${s.mainBkg} !important;
1325
+ stroke: ${s.lineColor} !important;
1326
+ stroke-width: 1;
1327
+ }
1328
+
1329
+ #lollipopEnd, .lollipop {
1330
+ fill: ${s.mainBkg} !important;
1331
+ stroke: ${s.lineColor} !important;
1332
+ stroke-width: 1;
1333
+ }
1334
+
1335
+ .edgeTerminals {
1336
+ font-size: 11px;
1337
+ line-height: initial;
1338
+ }
1339
+
1340
+ .classTitleText {
1341
+ text-anchor: middle;
1342
+ font-size: 18px;
1343
+ fill: ${s.textColor};
1344
+ }
1345
+ ${et()}
1346
+ `, "getStyles"), Dt = At, ft = /* @__PURE__ */ f((s, i = "TB") => {
1347
+ if (!s.doc)
1348
+ return i;
1349
+ let a = i;
1350
+ for (const u of s.doc)
1351
+ u.stmt === "dir" && (a = u.value);
1352
+ return a;
1353
+ }, "getDir"), gt = /* @__PURE__ */ f(function(s, i) {
1354
+ return i.db.getClasses();
1355
+ }, "getClasses"), Ct = /* @__PURE__ */ f(async function(s, i, a, u) {
1356
+ Oe.info("REF0:"), Oe.info("Drawing class diagram (v3)", i);
1357
+ const { securityLevel: l, state: r, layout: o } = F(), A = u.db.getData(), g = tt(i, l);
1358
+ 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);
1359
+ const D = 8;
1360
+ we.insertTitle(
1361
+ g,
1362
+ "classDiagramTitleText",
1363
+ (r == null ? void 0 : r.titleTopMargin) ?? 25,
1364
+ u.db.getDiagramTitle()
1365
+ ), st(g, D, "classDiagram", (r == null ? void 0 : r.useMaxWidth) ?? !0);
1366
+ }, "draw"), Ft = {
1367
+ getClasses: gt,
1368
+ draw: Ct,
1369
+ getDir: ft
1370
+ };
1371
+ export {
1372
+ kt as C,
1373
+ Tt as a,
1374
+ Ft as c,
1375
+ Dt as s
1376
+ };
src/backend/gradio_dropdownplus/templates/component/chunk-LXBSTHXV-CND5eoRw.js ADDED
@@ -0,0 +1,1382 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { g as te } from "./chunk-WVR4S24B-Db-rMs1b.js";
2
+ import { s as ee } from "./chunk-NRVI72HA-EajhWFFL.js";
3
+ 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-D58rAnek.js";
4
+ var vt = function() {
5
+ var e = /* @__PURE__ */ f(function(V, o, h, n) {
6
+ for (h = h || {}, n = V.length; n--; h[V[n]] = o) ;
7
+ return h;
8
+ }, "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 = {
9
+ trace: /* @__PURE__ */ f(function() {
10
+ }, "trace"),
11
+ yy: {},
12
+ 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 },
13
+ 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" },
14
+ 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]],
15
+ performAction: /* @__PURE__ */ f(function(o, h, n, g, E, r, Z) {
16
+ var c = r.length - 1;
17
+ switch (E) {
18
+ case 3:
19
+ return g.setRootDoc(r[c]), r[c];
20
+ case 4:
21
+ this.$ = [];
22
+ break;
23
+ case 5:
24
+ r[c] != "nl" && (r[c - 1].push(r[c]), this.$ = r[c - 1]);
25
+ break;
26
+ case 6:
27
+ case 7:
28
+ this.$ = r[c];
29
+ break;
30
+ case 8:
31
+ this.$ = "nl";
32
+ break;
33
+ case 12:
34
+ this.$ = r[c];
35
+ break;
36
+ case 13:
37
+ const tt = r[c - 1];
38
+ tt.description = g.trimColon(r[c]), this.$ = tt;
39
+ break;
40
+ case 14:
41
+ this.$ = { stmt: "relation", state1: r[c - 2], state2: r[c] };
42
+ break;
43
+ case 15:
44
+ const Tt = g.trimColon(r[c]);
45
+ this.$ = { stmt: "relation", state1: r[c - 3], state2: r[c - 1], description: Tt };
46
+ break;
47
+ case 19:
48
+ this.$ = { stmt: "state", id: r[c - 3], type: "default", description: "", doc: r[c - 1] };
49
+ break;
50
+ case 20:
51
+ var U = r[c], X = r[c - 2].trim();
52
+ if (r[c].match(":")) {
53
+ var ut = r[c].split(":");
54
+ U = ut[0], X = [X, ut[1]];
55
+ }
56
+ this.$ = { stmt: "state", id: U, type: "default", description: X };
57
+ break;
58
+ case 21:
59
+ this.$ = { stmt: "state", id: r[c - 3], type: "default", description: r[c - 5], doc: r[c - 1] };
60
+ break;
61
+ case 22:
62
+ this.$ = { stmt: "state", id: r[c], type: "fork" };
63
+ break;
64
+ case 23:
65
+ this.$ = { stmt: "state", id: r[c], type: "join" };
66
+ break;
67
+ case 24:
68
+ this.$ = { stmt: "state", id: r[c], type: "choice" };
69
+ break;
70
+ case 25:
71
+ this.$ = { stmt: "state", id: g.getDividerId(), type: "divider" };
72
+ break;
73
+ case 26:
74
+ this.$ = { stmt: "state", id: r[c - 1].trim(), note: { position: r[c - 2].trim(), text: r[c].trim() } };
75
+ break;
76
+ case 29:
77
+ this.$ = r[c].trim(), g.setAccTitle(this.$);
78
+ break;
79
+ case 30:
80
+ case 31:
81
+ this.$ = r[c].trim(), g.setAccDescription(this.$);
82
+ break;
83
+ case 32:
84
+ this.$ = {
85
+ stmt: "click",
86
+ id: r[c - 3],
87
+ url: r[c - 2],
88
+ tooltip: r[c - 1]
89
+ };
90
+ break;
91
+ case 33:
92
+ this.$ = {
93
+ stmt: "click",
94
+ id: r[c - 3],
95
+ url: r[c - 1],
96
+ tooltip: ""
97
+ };
98
+ break;
99
+ case 34:
100
+ case 35:
101
+ this.$ = { stmt: "classDef", id: r[c - 1].trim(), classes: r[c].trim() };
102
+ break;
103
+ case 36:
104
+ this.$ = { stmt: "style", id: r[c - 1].trim(), styleClass: r[c].trim() };
105
+ break;
106
+ case 37:
107
+ this.$ = { stmt: "applyClass", id: r[c - 1].trim(), styleClass: r[c].trim() };
108
+ break;
109
+ case 38:
110
+ g.setDirection("TB"), this.$ = { stmt: "dir", value: "TB" };
111
+ break;
112
+ case 39:
113
+ g.setDirection("BT"), this.$ = { stmt: "dir", value: "BT" };
114
+ break;
115
+ case 40:
116
+ g.setDirection("RL"), this.$ = { stmt: "dir", value: "RL" };
117
+ break;
118
+ case 41:
119
+ g.setDirection("LR"), this.$ = { stmt: "dir", value: "LR" };
120
+ break;
121
+ case 44:
122
+ case 45:
123
+ this.$ = { stmt: "state", id: r[c].trim(), type: "default", description: "" };
124
+ break;
125
+ case 46:
126
+ this.$ = { stmt: "state", id: r[c - 2].trim(), classes: [r[c].trim()], type: "default", description: "" };
127
+ break;
128
+ case 47:
129
+ this.$ = { stmt: "state", id: r[c - 2].trim(), classes: [r[c].trim()], type: "default", description: "" };
130
+ break;
131
+ }
132
+ }, "anonymous"),
133
+ 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])],
134
+ defaultActions: { 5: [2, 1], 6: [2, 2], 47: [2, 48], 48: [2, 49] },
135
+ parseError: /* @__PURE__ */ f(function(o, h) {
136
+ if (h.recoverable)
137
+ this.trace(o);
138
+ else {
139
+ var n = new Error(o);
140
+ throw n.hash = h, n;
141
+ }
142
+ }, "parseError"),
143
+ parse: /* @__PURE__ */ f(function(o) {
144
+ 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: {} };
145
+ for (var Et in this.yy)
146
+ Object.prototype.hasOwnProperty.call(this.yy, Et) && (j.yy[Et] = this.yy[Et]);
147
+ b.setInput(o, j.yy), j.yy.lexer = b, j.yy.parser = this, typeof b.yylloc > "u" && (b.yylloc = {});
148
+ var _t = b.yylloc;
149
+ r.push(_t);
150
+ var Qt = b.options && b.options.ranges;
151
+ typeof j.yy.parseError == "function" ? this.parseError = j.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
152
+ function Zt(O) {
153
+ n.length = n.length - 2 * O, E.length = E.length - O, r.length = r.length - O;
154
+ }
155
+ f(Zt, "popStack");
156
+ function Lt() {
157
+ var O;
158
+ return O = g.pop() || b.lex() || tt, typeof O != "number" && (O instanceof Array && (g = O, O = g.pop()), O = h.symbols_[O] || O), O;
159
+ }
160
+ f(Lt, "lex");
161
+ for (var C, H, w, mt, J = {}, dt, Y, Ot, ft; ; ) {
162
+ 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]) {
163
+ var Dt = "";
164
+ ft = [];
165
+ for (dt in Z[H])
166
+ this.terminals_[dt] && dt > ut && ft.push("'" + this.terminals_[dt] + "'");
167
+ b.showPosition ? Dt = "Parse error on line " + (U + 1) + `:
168
+ ` + b.showPosition() + `
169
+ 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, {
170
+ text: b.match,
171
+ token: this.terminals_[C] || C,
172
+ line: b.yylineno,
173
+ loc: _t,
174
+ expected: ft
175
+ });
176
+ }
177
+ if (w[0] instanceof Array && w.length > 1)
178
+ throw new Error("Parse Error: multiple actions possible at state: " + H + ", token: " + C);
179
+ switch (w[0]) {
180
+ case 1:
181
+ 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;
182
+ break;
183
+ case 2:
184
+ if (Y = this.productions_[w[1]][1], J.$ = E[E.length - Y], J._$ = {
185
+ first_line: r[r.length - (Y || 1)].first_line,
186
+ last_line: r[r.length - 1].last_line,
187
+ first_column: r[r.length - (Y || 1)].first_column,
188
+ last_column: r[r.length - 1].last_column
189
+ }, Qt && (J._$.range = [
190
+ r[r.length - (Y || 1)].range[0],
191
+ r[r.length - 1].range[1]
192
+ ]), mt = this.performAction.apply(J, [
193
+ c,
194
+ X,
195
+ U,
196
+ j.yy,
197
+ w[1],
198
+ E,
199
+ r
200
+ ].concat(Tt)), typeof mt < "u")
201
+ return mt;
202
+ 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);
203
+ break;
204
+ case 3:
205
+ return !0;
206
+ }
207
+ }
208
+ return !0;
209
+ }, "parse")
210
+ }, qt = /* @__PURE__ */ function() {
211
+ var V = {
212
+ EOF: 1,
213
+ parseError: /* @__PURE__ */ f(function(h, n) {
214
+ if (this.yy.parser)
215
+ this.yy.parser.parseError(h, n);
216
+ else
217
+ throw new Error(h);
218
+ }, "parseError"),
219
+ // resets the lexer, sets new input
220
+ setInput: /* @__PURE__ */ f(function(o, h) {
221
+ 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 = {
222
+ first_line: 1,
223
+ first_column: 0,
224
+ last_line: 1,
225
+ last_column: 0
226
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
227
+ }, "setInput"),
228
+ // consumes and returns one char from the input
229
+ input: /* @__PURE__ */ f(function() {
230
+ var o = this._input[0];
231
+ this.yytext += o, this.yyleng++, this.offset++, this.match += o, this.matched += o;
232
+ var h = o.match(/(?:\r\n?|\n).*/g);
233
+ 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;
234
+ }, "input"),
235
+ // unshifts one char (or a string) into the input
236
+ unput: /* @__PURE__ */ f(function(o) {
237
+ var h = o.length, n = o.split(/(?:\r\n?|\n)/g);
238
+ this._input = o + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - h), this.offset -= h;
239
+ var g = this.match.split(/(?:\r\n?|\n)/g);
240
+ 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);
241
+ var E = this.yylloc.range;
242
+ return this.yylloc = {
243
+ first_line: this.yylloc.first_line,
244
+ last_line: this.yylineno + 1,
245
+ first_column: this.yylloc.first_column,
246
+ 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
247
+ }, this.options.ranges && (this.yylloc.range = [E[0], E[0] + this.yyleng - h]), this.yyleng = this.yytext.length, this;
248
+ }, "unput"),
249
+ // When called from action, caches matched text and appends it on next action
250
+ more: /* @__PURE__ */ f(function() {
251
+ return this._more = !0, this;
252
+ }, "more"),
253
+ // 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.
254
+ reject: /* @__PURE__ */ f(function() {
255
+ if (this.options.backtrack_lexer)
256
+ this._backtrack = !0;
257
+ else
258
+ 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).
259
+ ` + this.showPosition(), {
260
+ text: "",
261
+ token: null,
262
+ line: this.yylineno
263
+ });
264
+ return this;
265
+ }, "reject"),
266
+ // retain first n characters of the match
267
+ less: /* @__PURE__ */ f(function(o) {
268
+ this.unput(this.match.slice(o));
269
+ }, "less"),
270
+ // displays already matched input, i.e. for error messages
271
+ pastInput: /* @__PURE__ */ f(function() {
272
+ var o = this.matched.substr(0, this.matched.length - this.match.length);
273
+ return (o.length > 20 ? "..." : "") + o.substr(-20).replace(/\n/g, "");
274
+ }, "pastInput"),
275
+ // displays upcoming input, i.e. for error messages
276
+ upcomingInput: /* @__PURE__ */ f(function() {
277
+ var o = this.match;
278
+ return o.length < 20 && (o += this._input.substr(0, 20 - o.length)), (o.substr(0, 20) + (o.length > 20 ? "..." : "")).replace(/\n/g, "");
279
+ }, "upcomingInput"),
280
+ // displays the character position where the lexing error occurred, i.e. for error messages
281
+ showPosition: /* @__PURE__ */ f(function() {
282
+ var o = this.pastInput(), h = new Array(o.length + 1).join("-");
283
+ return o + this.upcomingInput() + `
284
+ ` + h + "^";
285
+ }, "showPosition"),
286
+ // test the lexed token: return FALSE when not a match, otherwise return token
287
+ test_match: /* @__PURE__ */ f(function(o, h) {
288
+ var n, g, E;
289
+ if (this.options.backtrack_lexer && (E = {
290
+ yylineno: this.yylineno,
291
+ yylloc: {
292
+ first_line: this.yylloc.first_line,
293
+ last_line: this.last_line,
294
+ first_column: this.yylloc.first_column,
295
+ last_column: this.yylloc.last_column
296
+ },
297
+ yytext: this.yytext,
298
+ match: this.match,
299
+ matches: this.matches,
300
+ matched: this.matched,
301
+ yyleng: this.yyleng,
302
+ offset: this.offset,
303
+ _more: this._more,
304
+ _input: this._input,
305
+ yy: this.yy,
306
+ conditionStack: this.conditionStack.slice(0),
307
+ done: this.done
308
+ }, 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 = {
309
+ first_line: this.yylloc.last_line,
310
+ last_line: this.yylineno + 1,
311
+ first_column: this.yylloc.last_column,
312
+ last_column: g ? g[g.length - 1].length - g[g.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + o[0].length
313
+ }, 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)
314
+ return n;
315
+ if (this._backtrack) {
316
+ for (var r in E)
317
+ this[r] = E[r];
318
+ return !1;
319
+ }
320
+ return !1;
321
+ }, "test_match"),
322
+ // return next match in input
323
+ next: /* @__PURE__ */ f(function() {
324
+ if (this.done)
325
+ return this.EOF;
326
+ this._input || (this.done = !0);
327
+ var o, h, n, g;
328
+ this._more || (this.yytext = "", this.match = "");
329
+ for (var E = this._currentRules(), r = 0; r < E.length; r++)
330
+ if (n = this._input.match(this.rules[E[r]]), n && (!h || n[0].length > h[0].length)) {
331
+ if (h = n, g = r, this.options.backtrack_lexer) {
332
+ if (o = this.test_match(n, E[r]), o !== !1)
333
+ return o;
334
+ if (this._backtrack) {
335
+ h = !1;
336
+ continue;
337
+ } else
338
+ return !1;
339
+ } else if (!this.options.flex)
340
+ break;
341
+ }
342
+ 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.
343
+ ` + this.showPosition(), {
344
+ text: "",
345
+ token: null,
346
+ line: this.yylineno
347
+ });
348
+ }, "next"),
349
+ // return next match that has a token
350
+ lex: /* @__PURE__ */ f(function() {
351
+ var h = this.next();
352
+ return h || this.lex();
353
+ }, "lex"),
354
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
355
+ begin: /* @__PURE__ */ f(function(h) {
356
+ this.conditionStack.push(h);
357
+ }, "begin"),
358
+ // pop the previously active lexer condition state off the condition stack
359
+ popState: /* @__PURE__ */ f(function() {
360
+ var h = this.conditionStack.length - 1;
361
+ return h > 0 ? this.conditionStack.pop() : this.conditionStack[0];
362
+ }, "popState"),
363
+ // produce the lexer rule set which is active for the currently active lexer condition state
364
+ _currentRules: /* @__PURE__ */ f(function() {
365
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
366
+ }, "_currentRules"),
367
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
368
+ topState: /* @__PURE__ */ f(function(h) {
369
+ return h = this.conditionStack.length - 1 - Math.abs(h || 0), h >= 0 ? this.conditionStack[h] : "INITIAL";
370
+ }, "topState"),
371
+ // alias for begin(condition)
372
+ pushState: /* @__PURE__ */ f(function(h) {
373
+ this.begin(h);
374
+ }, "pushState"),
375
+ // return the number of states currently on the stack
376
+ stateStackSize: /* @__PURE__ */ f(function() {
377
+ return this.conditionStack.length;
378
+ }, "stateStackSize"),
379
+ options: { "case-insensitive": !0 },
380
+ performAction: /* @__PURE__ */ f(function(h, n, g, E) {
381
+ switch (g) {
382
+ case 0:
383
+ return 38;
384
+ case 1:
385
+ return 40;
386
+ case 2:
387
+ return 39;
388
+ case 3:
389
+ return 44;
390
+ case 4:
391
+ return 51;
392
+ case 5:
393
+ return 52;
394
+ case 6:
395
+ return 53;
396
+ case 7:
397
+ return 54;
398
+ case 8:
399
+ break;
400
+ case 9:
401
+ break;
402
+ case 10:
403
+ return 5;
404
+ case 11:
405
+ break;
406
+ case 12:
407
+ break;
408
+ case 13:
409
+ break;
410
+ case 14:
411
+ break;
412
+ case 15:
413
+ return this.pushState("SCALE"), 17;
414
+ case 16:
415
+ return 18;
416
+ case 17:
417
+ this.popState();
418
+ break;
419
+ case 18:
420
+ return this.begin("acc_title"), 33;
421
+ case 19:
422
+ return this.popState(), "acc_title_value";
423
+ case 20:
424
+ return this.begin("acc_descr"), 35;
425
+ case 21:
426
+ return this.popState(), "acc_descr_value";
427
+ case 22:
428
+ this.begin("acc_descr_multiline");
429
+ break;
430
+ case 23:
431
+ this.popState();
432
+ break;
433
+ case 24:
434
+ return "acc_descr_multiline_value";
435
+ case 25:
436
+ return this.pushState("CLASSDEF"), 41;
437
+ case 26:
438
+ return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID";
439
+ case 27:
440
+ return this.popState(), this.pushState("CLASSDEFID"), 42;
441
+ case 28:
442
+ return this.popState(), 43;
443
+ case 29:
444
+ return this.pushState("CLASS"), 48;
445
+ case 30:
446
+ return this.popState(), this.pushState("CLASS_STYLE"), 49;
447
+ case 31:
448
+ return this.popState(), 50;
449
+ case 32:
450
+ return this.pushState("STYLE"), 45;
451
+ case 33:
452
+ return this.popState(), this.pushState("STYLEDEF_STYLES"), 46;
453
+ case 34:
454
+ return this.popState(), 47;
455
+ case 35:
456
+ return this.pushState("SCALE"), 17;
457
+ case 36:
458
+ return 18;
459
+ case 37:
460
+ this.popState();
461
+ break;
462
+ case 38:
463
+ this.pushState("STATE");
464
+ break;
465
+ case 39:
466
+ return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 25;
467
+ case 40:
468
+ return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 26;
469
+ case 41:
470
+ return this.popState(), n.yytext = n.yytext.slice(0, -10).trim(), 27;
471
+ case 42:
472
+ return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 25;
473
+ case 43:
474
+ return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 26;
475
+ case 44:
476
+ return this.popState(), n.yytext = n.yytext.slice(0, -10).trim(), 27;
477
+ case 45:
478
+ return 51;
479
+ case 46:
480
+ return 52;
481
+ case 47:
482
+ return 53;
483
+ case 48:
484
+ return 54;
485
+ case 49:
486
+ this.pushState("STATE_STRING");
487
+ break;
488
+ case 50:
489
+ return this.pushState("STATE_ID"), "AS";
490
+ case 51:
491
+ return this.popState(), "ID";
492
+ case 52:
493
+ this.popState();
494
+ break;
495
+ case 53:
496
+ return "STATE_DESCR";
497
+ case 54:
498
+ return 19;
499
+ case 55:
500
+ this.popState();
501
+ break;
502
+ case 56:
503
+ return this.popState(), this.pushState("struct"), 20;
504
+ case 57:
505
+ break;
506
+ case 58:
507
+ return this.popState(), 21;
508
+ case 59:
509
+ break;
510
+ case 60:
511
+ return this.begin("NOTE"), 29;
512
+ case 61:
513
+ return this.popState(), this.pushState("NOTE_ID"), 59;
514
+ case 62:
515
+ return this.popState(), this.pushState("NOTE_ID"), 60;
516
+ case 63:
517
+ this.popState(), this.pushState("FLOATING_NOTE");
518
+ break;
519
+ case 64:
520
+ return this.popState(), this.pushState("FLOATING_NOTE_ID"), "AS";
521
+ case 65:
522
+ break;
523
+ case 66:
524
+ return "NOTE_TEXT";
525
+ case 67:
526
+ return this.popState(), "ID";
527
+ case 68:
528
+ return this.popState(), this.pushState("NOTE_TEXT"), 24;
529
+ case 69:
530
+ return this.popState(), n.yytext = n.yytext.substr(2).trim(), 31;
531
+ case 70:
532
+ return this.popState(), n.yytext = n.yytext.slice(0, -8).trim(), 31;
533
+ case 71:
534
+ return 6;
535
+ case 72:
536
+ return 6;
537
+ case 73:
538
+ return 16;
539
+ case 74:
540
+ return 57;
541
+ case 75:
542
+ return 24;
543
+ case 76:
544
+ return n.yytext = n.yytext.trim(), 14;
545
+ case 77:
546
+ return 15;
547
+ case 78:
548
+ return 28;
549
+ case 79:
550
+ return 58;
551
+ case 80:
552
+ return 5;
553
+ case 81:
554
+ return "INVALID";
555
+ }
556
+ }, "anonymous"),
557
+ 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],
558
+ 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 } }
559
+ };
560
+ return V;
561
+ }();
562
+ gt.lexer = qt;
563
+ function ht() {
564
+ this.yy = {};
565
+ }
566
+ return f(ht, "Parser"), ht.prototype = gt, gt.Parser = ht, new ht();
567
+ }();
568
+ vt.parser = vt;
569
+ var Be = 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) => {
570
+ if (!e.doc)
571
+ return t;
572
+ let s = t;
573
+ for (const a of e.doc)
574
+ a.stmt === "dir" && (s = a.value);
575
+ return s;
576
+ }, "getDir"), Ie = /* @__PURE__ */ f(function(e, t) {
577
+ return t.db.getClasses();
578
+ }, "getClasses"), Ne = /* @__PURE__ */ f(async function(e, t, s, a) {
579
+ D.info("REF0:"), D.info("Drawing state diagram (v2)", t);
580
+ const { securityLevel: i, state: l, layout: d } = F();
581
+ a.db.extract(a.db.getRootDocV2());
582
+ const S = a.db.getData(), p = te(t, i);
583
+ 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);
584
+ const T = 8;
585
+ try {
586
+ (typeof a.db.getLinks == "function" ? a.db.getLinks() : /* @__PURE__ */ new Map()).forEach((m, k) => {
587
+ var I;
588
+ const A = typeof k == "string" ? k : typeof (k == null ? void 0 : k.id) == "string" ? k.id : "";
589
+ if (!A) {
590
+ D.warn("⚠️ Invalid or missing stateId from key:", JSON.stringify(k));
591
+ return;
592
+ }
593
+ const $ = (I = p.node()) == null ? void 0 : I.querySelectorAll("g");
594
+ let x;
595
+ if ($ == null || $.forEach((N) => {
596
+ var P;
597
+ ((P = N.textContent) == null ? void 0 : P.trim()) === A && (x = N);
598
+ }), !x) {
599
+ D.warn("⚠️ Could not find node matching text:", A);
600
+ return;
601
+ }
602
+ const R = x.parentNode;
603
+ if (!R) {
604
+ D.warn("⚠️ Node has no parent, cannot wrap:", A);
605
+ return;
606
+ }
607
+ const u = document.createElementNS("http://www.w3.org/2000/svg", "a"), L = m.url.replace(/^"+|"+$/g, "");
608
+ if (u.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", L), u.setAttribute("target", "_blank"), m.tooltip) {
609
+ const N = m.tooltip.replace(/^"+|"+$/g, "");
610
+ u.setAttribute("title", N);
611
+ }
612
+ R.replaceChild(u, x), u.appendChild(x), D.info("🔗 Wrapped node in <a> tag for:", A, m.url);
613
+ });
614
+ } catch (_) {
615
+ D.error("❌ Error injecting clickable links:", _);
616
+ }
617
+ ie.insertTitle(
618
+ p,
619
+ "statediagramTitleText",
620
+ (l == null ? void 0 : l.titleTopMargin) ?? 25,
621
+ a.db.getDiagramTitle()
622
+ ), ee(p, T, rt, (l == null ? void 0 : l.useMaxWidth) ?? !0);
623
+ }, "draw"), Ve = {
624
+ getClasses: Ie,
625
+ draw: Ne,
626
+ getDir: Kt
627
+ }, St = /* @__PURE__ */ new Map(), M = 0;
628
+ function yt(e = "", t = 0, s = "", a = At) {
629
+ const i = s !== null && s.length > 0 ? `${a}${s}` : "";
630
+ return `${Oe}-${e}${i}-${t}`;
631
+ }
632
+ f(yt, "stateDomId");
633
+ var we = /* @__PURE__ */ f((e, t, s, a, i, l, d, S) => {
634
+ D.trace("items", t), t.forEach((p) => {
635
+ switch (p.stmt) {
636
+ case Q:
637
+ st(e, p, s, a, i, l, d, S);
638
+ break;
639
+ case it:
640
+ st(e, p, s, a, i, l, d, S);
641
+ break;
642
+ case Ct:
643
+ {
644
+ st(
645
+ e,
646
+ p.state1,
647
+ s,
648
+ a,
649
+ i,
650
+ l,
651
+ d,
652
+ S
653
+ ), st(
654
+ e,
655
+ p.state2,
656
+ s,
657
+ a,
658
+ i,
659
+ l,
660
+ d,
661
+ S
662
+ );
663
+ const T = {
664
+ id: "edge" + M,
665
+ start: p.state1.id,
666
+ end: p.state2.id,
667
+ arrowhead: "normal",
668
+ arrowTypeEnd: "arrow_barb",
669
+ style: Bt,
670
+ labelStyle: "",
671
+ label: W.sanitizeText(p.description ?? "", F()),
672
+ arrowheadStyle: Vt,
673
+ labelpos: Mt,
674
+ labelType: Ut,
675
+ thickness: jt,
676
+ classes: Ht,
677
+ look: d
678
+ };
679
+ i.push(T), M++;
680
+ }
681
+ break;
682
+ }
683
+ });
684
+ }, "setupDoc"), $t = /* @__PURE__ */ f((e, t = Yt) => {
685
+ let s = t;
686
+ if (e.doc)
687
+ for (const a of e.doc)
688
+ a.stmt === "dir" && (s = a.value);
689
+ return s;
690
+ }, "getDir");
691
+ function et(e, t, s) {
692
+ if (!t.id || t.id === "</join></fork>" || t.id === "</choice>")
693
+ return;
694
+ t.cssClasses && (Array.isArray(t.cssCompiledStyles) || (t.cssCompiledStyles = []), t.cssClasses.split(" ").forEach((i) => {
695
+ const l = s.get(i);
696
+ l && (t.cssCompiledStyles = [...t.cssCompiledStyles ?? [], ...l.styles]);
697
+ }));
698
+ const a = e.find((i) => i.id === t.id);
699
+ a ? Object.assign(a, t) : e.push(t);
700
+ }
701
+ f(et, "insertOrUpdateNode");
702
+ function Xt(e) {
703
+ var t;
704
+ return ((t = e == null ? void 0 : e.classes) == null ? void 0 : t.join(" ")) ?? "";
705
+ }
706
+ f(Xt, "getClassesFromDbInfo");
707
+ function Jt(e) {
708
+ return (e == null ? void 0 : e.styles) ?? [];
709
+ }
710
+ f(Jt, "getStylesFromDbInfo");
711
+ var st = /* @__PURE__ */ f((e, t, s, a, i, l, d, S) => {
712
+ var A, $, x;
713
+ const p = t.id, T = s.get(p), _ = Xt(T), m = Jt(T), k = F();
714
+ if (D.info("dataFetcher parsedItem", t, T, m), p !== "root") {
715
+ let R = bt;
716
+ t.start === !0 ? R = ye : t.start === !1 && (R = ge), t.type !== it && (R = t.type), St.get(p) || St.set(p, {
717
+ id: p,
718
+ shape: R,
719
+ description: W.sanitizeText(p, k),
720
+ cssClasses: `${_} ${me}`,
721
+ cssStyles: m
722
+ });
723
+ const u = St.get(p);
724
+ 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 : ""}`);
725
+ const L = {
726
+ labelStyle: "",
727
+ shape: u.shape,
728
+ label: u.description,
729
+ cssClasses: u.cssClasses,
730
+ cssCompiledStyles: [],
731
+ cssStyles: u.cssStyles,
732
+ id: p,
733
+ dir: u.dir,
734
+ domId: yt(p, M),
735
+ type: u.type,
736
+ isGroup: u.type === "group",
737
+ padding: 8,
738
+ rx: 10,
739
+ ry: 10,
740
+ look: d
741
+ };
742
+ 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) {
743
+ const I = {
744
+ labelStyle: "",
745
+ shape: Te,
746
+ label: t.note.text,
747
+ cssClasses: ve,
748
+ // useHtmlLabels: false,
749
+ cssStyles: [],
750
+ cssCompiledStyles: [],
751
+ id: p + Re + "-" + M,
752
+ domId: yt(p, M, zt),
753
+ type: u.type,
754
+ isGroup: u.type === "group",
755
+ padding: (x = k.flowchart) == null ? void 0 : x.padding,
756
+ look: d,
757
+ position: t.note.position
758
+ }, N = p + wt, G = {
759
+ labelStyle: "",
760
+ shape: Ee,
761
+ label: t.note.text,
762
+ cssClasses: u.cssClasses,
763
+ cssStyles: [],
764
+ id: p + wt,
765
+ domId: yt(p, M, Wt),
766
+ type: "group",
767
+ isGroup: !0,
768
+ padding: 16,
769
+ //getConfig().flowchart.padding
770
+ look: d,
771
+ position: t.note.position
772
+ };
773
+ M++, G.id = N, I.parentId = N, et(a, G, S), et(a, I, S), et(a, L, S);
774
+ let P = p, B = I.id;
775
+ t.note.position === "left of" && (P = I.id, B = p), i.push({
776
+ id: P + "-" + B,
777
+ start: P,
778
+ end: B,
779
+ arrowhead: "none",
780
+ arrowTypeEnd: "",
781
+ style: Bt,
782
+ labelStyle: "",
783
+ classes: ke,
784
+ arrowheadStyle: Vt,
785
+ labelpos: Mt,
786
+ labelType: Ut,
787
+ thickness: jt,
788
+ look: d
789
+ });
790
+ } else
791
+ et(a, L, S);
792
+ }
793
+ t.doc && (D.trace("Adding nodes children "), we(t, t.doc, s, a, i, !l, d, S));
794
+ }, "dataFetcher"), $e = /* @__PURE__ */ f(() => {
795
+ St.clear(), M = 0;
796
+ }, "reset"), v = {
797
+ START_NODE: "[*]",
798
+ START_TYPE: "start",
799
+ END_NODE: "[*]",
800
+ END_TYPE: "end",
801
+ COLOR_KEYWORD: "color",
802
+ FILL_KEYWORD: "fill",
803
+ BG_FILL: "bgFill",
804
+ STYLECLASS_SEP: ","
805
+ }, Pt = /* @__PURE__ */ f(() => /* @__PURE__ */ new Map(), "newClassesList"), Ft = /* @__PURE__ */ f(() => ({
806
+ relations: [],
807
+ states: /* @__PURE__ */ new Map(),
808
+ documents: {}
809
+ }), "newDoc"), pt = /* @__PURE__ */ f((e) => JSON.parse(JSON.stringify(e)), "clone"), z, Me = (z = class {
810
+ constructor(t) {
811
+ 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);
812
+ }
813
+ /**
814
+ * Convert all of the statements (stmts) that were parsed into states and relationships.
815
+ * This is done because a state diagram may have nested sections,
816
+ * where each section is a 'document' and has its own set of statements.
817
+ * Ex: the section within a fork has its own statements, and incoming and outgoing statements
818
+ * refer to the fork as a whole (document).
819
+ * See the parser grammar: the definition of a document is a document then a 'line', where a line can be a statement.
820
+ * This will push the statement into the list of statements for the current document.
821
+ */
822
+ extract(t) {
823
+ this.clear(!0);
824
+ for (const i of Array.isArray(t) ? t : t.doc)
825
+ switch (i.stmt) {
826
+ case Q:
827
+ this.addState(i.id.trim(), i.type, i.doc, i.description, i.note);
828
+ break;
829
+ case Ct:
830
+ this.addRelation(i.state1, i.state2, i.description);
831
+ break;
832
+ case fe:
833
+ this.addStyleClass(i.id.trim(), i.classes);
834
+ break;
835
+ case pe:
836
+ this.handleStyleDef(i);
837
+ break;
838
+ case Se:
839
+ this.setCssClass(i.id.trim(), i.styleClass);
840
+ break;
841
+ case "click":
842
+ this.addLink(i.id, i.url, i.tooltip);
843
+ break;
844
+ }
845
+ const s = this.getStates(), a = F();
846
+ $e(), st(
847
+ void 0,
848
+ this.getRootDocV2(),
849
+ s,
850
+ this.nodes,
851
+ this.edges,
852
+ !0,
853
+ a.look,
854
+ this.classes
855
+ );
856
+ for (const i of this.nodes)
857
+ if (Array.isArray(i.label)) {
858
+ if (i.description = i.label.slice(1), i.isGroup && i.description.length > 0)
859
+ throw new Error(
860
+ `Group nodes can only have label. Remove the additional description for node [${i.id}]`
861
+ );
862
+ i.label = i.label[0];
863
+ }
864
+ }
865
+ handleStyleDef(t) {
866
+ const s = t.id.trim().split(","), a = t.styleClass.split(",");
867
+ for (const i of s) {
868
+ let l = this.getState(i);
869
+ if (!l) {
870
+ const d = i.trim();
871
+ this.addState(d), l = this.getState(d);
872
+ }
873
+ l && (l.styles = a.map((d) => {
874
+ var S;
875
+ return (S = d.replace(/;/g, "")) == null ? void 0 : S.trim();
876
+ }));
877
+ }
878
+ }
879
+ setRootDoc(t) {
880
+ D.info("Setting root doc", t), this.rootDoc = t, this.version === 1 ? this.extract(t) : this.extract(this.getRootDocV2());
881
+ }
882
+ docTranslator(t, s, a) {
883
+ if (s.stmt === Ct) {
884
+ this.docTranslator(t, s.state1, !0), this.docTranslator(t, s.state2, !1);
885
+ return;
886
+ }
887
+ 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)
888
+ return;
889
+ const i = [];
890
+ let l = [];
891
+ for (const d of s.doc)
892
+ if (d.type === Gt) {
893
+ const S = pt(d);
894
+ S.doc = pt(l), i.push(S), l = [];
895
+ } else
896
+ l.push(d);
897
+ if (i.length > 0 && l.length > 0) {
898
+ const d = {
899
+ stmt: Q,
900
+ id: he(),
901
+ type: "divider",
902
+ doc: pt(l)
903
+ };
904
+ i.push(pt(d)), s.doc = i;
905
+ }
906
+ s.doc.forEach((d) => this.docTranslator(s, d, !0));
907
+ }
908
+ getRootDocV2() {
909
+ return this.docTranslator(
910
+ { id: q, stmt: q },
911
+ { id: q, stmt: q, doc: this.rootDoc },
912
+ !0
913
+ ), { id: q, doc: this.rootDoc };
914
+ }
915
+ /**
916
+ * Function called by parser when a node definition has been found.
917
+ *
918
+ * @param descr - description for the state. Can be a string or a list or strings
919
+ * @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.
920
+ * @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.
921
+ * @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.
922
+ */
923
+ addState(t, s = it, a = void 0, i = void 0, l = void 0, d = void 0, S = void 0, p = void 0) {
924
+ const T = t == null ? void 0 : t.trim();
925
+ if (!this.currentDocument.states.has(T))
926
+ D.info("Adding state ", T, i), this.currentDocument.states.set(T, {
927
+ stmt: Q,
928
+ id: T,
929
+ descriptions: [],
930
+ type: s,
931
+ doc: a,
932
+ note: l,
933
+ classes: [],
934
+ styles: [],
935
+ textStyles: []
936
+ });
937
+ else {
938
+ const _ = this.currentDocument.states.get(T);
939
+ if (!_)
940
+ throw new Error(`State not found: ${T}`);
941
+ _.doc || (_.doc = a), _.type || (_.type = s);
942
+ }
943
+ if (i && (D.info("Setting state description", T, i), (Array.isArray(i) ? i : [i]).forEach((m) => this.addDescription(T, m.trim()))), l) {
944
+ const _ = this.currentDocument.states.get(T);
945
+ if (!_)
946
+ throw new Error(`State not found: ${T}`);
947
+ _.note = l, _.note.text = W.sanitizeText(_.note.text, F());
948
+ }
949
+ 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())));
950
+ }
951
+ clear(t) {
952
+ 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());
953
+ }
954
+ getState(t) {
955
+ return this.currentDocument.states.get(t);
956
+ }
957
+ getStates() {
958
+ return this.currentDocument.states;
959
+ }
960
+ logDocuments() {
961
+ D.info("Documents = ", this.documents);
962
+ }
963
+ getRelations() {
964
+ return this.currentDocument.relations;
965
+ }
966
+ /**
967
+ * Adds a clickable link to a state.
968
+ */
969
+ addLink(t, s, a) {
970
+ this.links.set(t, { url: s, tooltip: a }), D.warn("Adding link", t, s, a);
971
+ }
972
+ /**
973
+ * Get all registered links.
974
+ */
975
+ getLinks() {
976
+ return this.links;
977
+ }
978
+ /**
979
+ * If the id is a start node ( [*] ), then return a new id constructed from
980
+ * the start node name and the current start node count.
981
+ * else return the given id
982
+ */
983
+ startIdIfNeeded(t = "") {
984
+ return t === v.START_NODE ? (this.startEndCount++, `${v.START_TYPE}${this.startEndCount}`) : t;
985
+ }
986
+ /**
987
+ * If the id is a start node ( [*] ), then return the start type ('start')
988
+ * else return the given type
989
+ */
990
+ startTypeIfNeeded(t = "", s = it) {
991
+ return t === v.START_NODE ? v.START_TYPE : s;
992
+ }
993
+ /**
994
+ * If the id is an end node ( [*] ), then return a new id constructed from
995
+ * the end node name and the current start_end node count.
996
+ * else return the given id
997
+ */
998
+ endIdIfNeeded(t = "") {
999
+ return t === v.END_NODE ? (this.startEndCount++, `${v.END_TYPE}${this.startEndCount}`) : t;
1000
+ }
1001
+ /**
1002
+ * If the id is an end node ( [*] ), then return the end type
1003
+ * else return the given type
1004
+ *
1005
+ */
1006
+ endTypeIfNeeded(t = "", s = it) {
1007
+ return t === v.END_NODE ? v.END_TYPE : s;
1008
+ }
1009
+ addRelationObjs(t, s, a = "") {
1010
+ 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);
1011
+ this.addState(
1012
+ i,
1013
+ l,
1014
+ t.doc,
1015
+ t.description,
1016
+ t.note,
1017
+ t.classes,
1018
+ t.styles,
1019
+ t.textStyles
1020
+ ), this.addState(
1021
+ d,
1022
+ S,
1023
+ s.doc,
1024
+ s.description,
1025
+ s.note,
1026
+ s.classes,
1027
+ s.styles,
1028
+ s.textStyles
1029
+ ), this.currentDocument.relations.push({
1030
+ id1: i,
1031
+ id2: d,
1032
+ relationTitle: W.sanitizeText(a, F())
1033
+ });
1034
+ }
1035
+ /**
1036
+ * Add a relation between two items. The items may be full objects or just the string id of a state.
1037
+ */
1038
+ addRelation(t, s, a) {
1039
+ if (typeof t == "object" && typeof s == "object")
1040
+ this.addRelationObjs(t, s, a);
1041
+ else if (typeof t == "string" && typeof s == "string") {
1042
+ const i = this.startIdIfNeeded(t.trim()), l = this.startTypeIfNeeded(t), d = this.endIdIfNeeded(s.trim()), S = this.endTypeIfNeeded(s);
1043
+ this.addState(i, l), this.addState(d, S), this.currentDocument.relations.push({
1044
+ id1: i,
1045
+ id2: d,
1046
+ relationTitle: a ? W.sanitizeText(a, F()) : void 0
1047
+ });
1048
+ }
1049
+ }
1050
+ addDescription(t, s) {
1051
+ var l;
1052
+ const a = this.currentDocument.states.get(t), i = s.startsWith(":") ? s.replace(":", "").trim() : s;
1053
+ (l = a == null ? void 0 : a.descriptions) == null || l.push(W.sanitizeText(i, F()));
1054
+ }
1055
+ cleanupLabel(t) {
1056
+ return t.startsWith(":") ? t.slice(2).trim() : t.trim();
1057
+ }
1058
+ getDividerId() {
1059
+ return this.dividerCnt++, `divider-id-${this.dividerCnt}`;
1060
+ }
1061
+ /**
1062
+ * Called when the parser comes across a (style) class definition
1063
+ * @example classDef my-style fill:#f96;
1064
+ *
1065
+ * @param id - the id of this (style) class
1066
+ * @param styleAttributes - the string with 1 or more style attributes (each separated by a comma)
1067
+ */
1068
+ addStyleClass(t, s = "") {
1069
+ this.classes.has(t) || this.classes.set(t, { id: t, styles: [], textStyles: [] });
1070
+ const a = this.classes.get(t);
1071
+ s && a && s.split(v.STYLECLASS_SEP).forEach((i) => {
1072
+ const l = i.replace(/([^;]*);/, "$1").trim();
1073
+ if (RegExp(v.COLOR_KEYWORD).exec(i)) {
1074
+ const S = l.replace(v.FILL_KEYWORD, v.BG_FILL).replace(v.COLOR_KEYWORD, v.FILL_KEYWORD);
1075
+ a.textStyles.push(S);
1076
+ }
1077
+ a.styles.push(l);
1078
+ });
1079
+ }
1080
+ getClasses() {
1081
+ return this.classes;
1082
+ }
1083
+ /**
1084
+ * Add a (style) class or css class to a state with the given id.
1085
+ * If the state isn't already in the list of known states, add it.
1086
+ * Might be called by parser when a style class or CSS class should be applied to a state
1087
+ *
1088
+ * @param itemIds - The id or a list of ids of the item(s) to apply the css class to
1089
+ * @param cssClassName - CSS class name
1090
+ */
1091
+ setCssClass(t, s) {
1092
+ t.split(",").forEach((a) => {
1093
+ var l;
1094
+ let i = this.getState(a);
1095
+ if (!i) {
1096
+ const d = a.trim();
1097
+ this.addState(d), i = this.getState(d);
1098
+ }
1099
+ (l = i == null ? void 0 : i.classes) == null || l.push(s);
1100
+ });
1101
+ }
1102
+ /**
1103
+ * Add a style to a state with the given id.
1104
+ * @example style stateId fill:#f9f,stroke:#333,stroke-width:4px
1105
+ * where 'style' is the keyword
1106
+ * stateId is the id of a state
1107
+ * the rest of the string is the styleText (all of the attributes to be applied to the state)
1108
+ *
1109
+ * @param itemId - The id of item to apply the style to
1110
+ * @param styleText - the text of the attributes for the style
1111
+ */
1112
+ setStyle(t, s) {
1113
+ var a, i;
1114
+ (i = (a = this.getState(t)) == null ? void 0 : a.styles) == null || i.push(s);
1115
+ }
1116
+ /**
1117
+ * Add a text style to a state with the given id
1118
+ *
1119
+ * @param itemId - The id of item to apply the css class to
1120
+ * @param cssClassName - CSS class name
1121
+ */
1122
+ setTextStyle(t, s) {
1123
+ var a, i;
1124
+ (i = (a = this.getState(t)) == null ? void 0 : a.textStyles) == null || i.push(s);
1125
+ }
1126
+ /**
1127
+ * Finds the direction statement in the root document.
1128
+ * @returns the direction statement if present
1129
+ */
1130
+ getDirectionStatement() {
1131
+ return this.rootDoc.find((t) => t.stmt === Rt);
1132
+ }
1133
+ getDirection() {
1134
+ var t;
1135
+ return ((t = this.getDirectionStatement()) == null ? void 0 : t.value) ?? de;
1136
+ }
1137
+ setDirection(t) {
1138
+ const s = this.getDirectionStatement();
1139
+ s ? s.value = t : this.rootDoc.unshift({ stmt: Rt, value: t });
1140
+ }
1141
+ trimColon(t) {
1142
+ return t.startsWith(":") ? t.slice(1).trim() : t.trim();
1143
+ }
1144
+ getData() {
1145
+ const t = F();
1146
+ return {
1147
+ nodes: this.nodes,
1148
+ edges: this.edges,
1149
+ other: {},
1150
+ config: t,
1151
+ direction: Kt(this.getRootDocV2())
1152
+ };
1153
+ }
1154
+ getConfig() {
1155
+ return F().state;
1156
+ }
1157
+ }, f(z, "StateDB"), z.relationType = {
1158
+ AGGREGATION: 0,
1159
+ EXTENSION: 1,
1160
+ COMPOSITION: 2,
1161
+ DEPENDENCY: 3
1162
+ }, z), Pe = /* @__PURE__ */ f((e) => `
1163
+ defs #statediagram-barbEnd {
1164
+ fill: ${e.transitionColor};
1165
+ stroke: ${e.transitionColor};
1166
+ }
1167
+ g.stateGroup text {
1168
+ fill: ${e.nodeBorder};
1169
+ stroke: none;
1170
+ font-size: 10px;
1171
+ }
1172
+ g.stateGroup text {
1173
+ fill: ${e.textColor};
1174
+ stroke: none;
1175
+ font-size: 10px;
1176
+
1177
+ }
1178
+ g.stateGroup .state-title {
1179
+ font-weight: bolder;
1180
+ fill: ${e.stateLabelColor};
1181
+ }
1182
+
1183
+ g.stateGroup rect {
1184
+ fill: ${e.mainBkg};
1185
+ stroke: ${e.nodeBorder};
1186
+ }
1187
+
1188
+ g.stateGroup line {
1189
+ stroke: ${e.lineColor};
1190
+ stroke-width: 1;
1191
+ }
1192
+
1193
+ .transition {
1194
+ stroke: ${e.transitionColor};
1195
+ stroke-width: 1;
1196
+ fill: none;
1197
+ }
1198
+
1199
+ .stateGroup .composit {
1200
+ fill: ${e.background};
1201
+ border-bottom: 1px
1202
+ }
1203
+
1204
+ .stateGroup .alt-composit {
1205
+ fill: #e0e0e0;
1206
+ border-bottom: 1px
1207
+ }
1208
+
1209
+ .state-note {
1210
+ stroke: ${e.noteBorderColor};
1211
+ fill: ${e.noteBkgColor};
1212
+
1213
+ text {
1214
+ fill: ${e.noteTextColor};
1215
+ stroke: none;
1216
+ font-size: 10px;
1217
+ }
1218
+ }
1219
+
1220
+ .stateLabel .box {
1221
+ stroke: none;
1222
+ stroke-width: 0;
1223
+ fill: ${e.mainBkg};
1224
+ opacity: 0.5;
1225
+ }
1226
+
1227
+ .edgeLabel .label rect {
1228
+ fill: ${e.labelBackgroundColor};
1229
+ opacity: 0.5;
1230
+ }
1231
+ .edgeLabel {
1232
+ background-color: ${e.edgeLabelBackground};
1233
+ p {
1234
+ background-color: ${e.edgeLabelBackground};
1235
+ }
1236
+ rect {
1237
+ opacity: 0.5;
1238
+ background-color: ${e.edgeLabelBackground};
1239
+ fill: ${e.edgeLabelBackground};
1240
+ }
1241
+ text-align: center;
1242
+ }
1243
+ .edgeLabel .label text {
1244
+ fill: ${e.transitionLabelColor || e.tertiaryTextColor};
1245
+ }
1246
+ .label div .edgeLabel {
1247
+ color: ${e.transitionLabelColor || e.tertiaryTextColor};
1248
+ }
1249
+
1250
+ .stateLabel text {
1251
+ fill: ${e.stateLabelColor};
1252
+ font-size: 10px;
1253
+ font-weight: bold;
1254
+ }
1255
+
1256
+ .node circle.state-start {
1257
+ fill: ${e.specialStateColor};
1258
+ stroke: ${e.specialStateColor};
1259
+ }
1260
+
1261
+ .node .fork-join {
1262
+ fill: ${e.specialStateColor};
1263
+ stroke: ${e.specialStateColor};
1264
+ }
1265
+
1266
+ .node circle.state-end {
1267
+ fill: ${e.innerEndBackground};
1268
+ stroke: ${e.background};
1269
+ stroke-width: 1.5
1270
+ }
1271
+ .end-state-inner {
1272
+ fill: ${e.compositeBackground || e.background};
1273
+ // stroke: ${e.background};
1274
+ stroke-width: 1.5
1275
+ }
1276
+
1277
+ .node rect {
1278
+ fill: ${e.stateBkg || e.mainBkg};
1279
+ stroke: ${e.stateBorder || e.nodeBorder};
1280
+ stroke-width: 1px;
1281
+ }
1282
+ .node polygon {
1283
+ fill: ${e.mainBkg};
1284
+ stroke: ${e.stateBorder || e.nodeBorder};;
1285
+ stroke-width: 1px;
1286
+ }
1287
+ #statediagram-barbEnd {
1288
+ fill: ${e.lineColor};
1289
+ }
1290
+
1291
+ .statediagram-cluster rect {
1292
+ fill: ${e.compositeTitleBackground};
1293
+ stroke: ${e.stateBorder || e.nodeBorder};
1294
+ stroke-width: 1px;
1295
+ }
1296
+
1297
+ .cluster-label, .nodeLabel {
1298
+ color: ${e.stateLabelColor};
1299
+ // line-height: 1;
1300
+ }
1301
+
1302
+ .statediagram-cluster rect.outer {
1303
+ rx: 5px;
1304
+ ry: 5px;
1305
+ }
1306
+ .statediagram-state .divider {
1307
+ stroke: ${e.stateBorder || e.nodeBorder};
1308
+ }
1309
+
1310
+ .statediagram-state .title-state {
1311
+ rx: 5px;
1312
+ ry: 5px;
1313
+ }
1314
+ .statediagram-cluster.statediagram-cluster .inner {
1315
+ fill: ${e.compositeBackground || e.background};
1316
+ }
1317
+ .statediagram-cluster.statediagram-cluster-alt .inner {
1318
+ fill: ${e.altBackground ? e.altBackground : "#efefef"};
1319
+ }
1320
+
1321
+ .statediagram-cluster .inner {
1322
+ rx:0;
1323
+ ry:0;
1324
+ }
1325
+
1326
+ .statediagram-state rect.basic {
1327
+ rx: 5px;
1328
+ ry: 5px;
1329
+ }
1330
+ .statediagram-state rect.divider {
1331
+ stroke-dasharray: 10,10;
1332
+ fill: ${e.altBackground ? e.altBackground : "#efefef"};
1333
+ }
1334
+
1335
+ .note-edge {
1336
+ stroke-dasharray: 5;
1337
+ }
1338
+
1339
+ .statediagram-note rect {
1340
+ fill: ${e.noteBkgColor};
1341
+ stroke: ${e.noteBorderColor};
1342
+ stroke-width: 1px;
1343
+ rx: 0;
1344
+ ry: 0;
1345
+ }
1346
+ .statediagram-note rect {
1347
+ fill: ${e.noteBkgColor};
1348
+ stroke: ${e.noteBorderColor};
1349
+ stroke-width: 1px;
1350
+ rx: 0;
1351
+ ry: 0;
1352
+ }
1353
+
1354
+ .statediagram-note text {
1355
+ fill: ${e.noteTextColor};
1356
+ }
1357
+
1358
+ .statediagram-note .nodeLabel {
1359
+ color: ${e.noteTextColor};
1360
+ }
1361
+ .statediagram .edgeLabel {
1362
+ color: red; // ${e.noteTextColor};
1363
+ }
1364
+
1365
+ #dependencyStart, #dependencyEnd {
1366
+ fill: ${e.lineColor};
1367
+ stroke: ${e.lineColor};
1368
+ stroke-width: 1;
1369
+ }
1370
+
1371
+ .statediagramTitleText {
1372
+ text-anchor: middle;
1373
+ font-size: 18px;
1374
+ fill: ${e.textColor};
1375
+ }
1376
+ `, "getStyles"), Ue = Pe;
1377
+ export {
1378
+ Me as S,
1379
+ Be as a,
1380
+ Ve as b,
1381
+ Ue as s
1382
+ };
src/backend/gradio_dropdownplus/templates/component/chunk-NRVI72HA-EajhWFFL.js ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { _ as a, e as w, l as x } from "./mermaid.core-D58rAnek.js";
2
+ var d = /* @__PURE__ */ a((e, t, i, o) => {
3
+ e.attr("class", i);
4
+ const { width: r, height: h, x: n, y: c } = u(e, t);
5
+ w(e, h, r, o);
6
+ const s = l(n, c, r, h, t);
7
+ e.attr("viewBox", s), x.debug(`viewBox configured: ${s} with padding: ${t}`);
8
+ }, "setupViewPortForSVG"), u = /* @__PURE__ */ a((e, t) => {
9
+ var o;
10
+ const i = ((o = e.node()) == null ? void 0 : o.getBBox()) || { width: 0, height: 0, x: 0, y: 0 };
11
+ return {
12
+ width: i.width + t * 2,
13
+ height: i.height + t * 2,
14
+ x: i.x,
15
+ y: i.y
16
+ };
17
+ }, "calculateDimensionsWithPadding"), l = /* @__PURE__ */ a((e, t, i, o, r) => `${e - r} ${t - r} ${i} ${o}`, "createViewBox");
18
+ export {
19
+ d as s
20
+ };
src/backend/gradio_dropdownplus/templates/component/chunk-OMD6QJNC-dXofsL9p.js ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { _ as n, U as c, j as l } from "./mermaid.core-D58rAnek.js";
2
+ var o = /* @__PURE__ */ n((a, t) => {
3
+ const e = a.append("rect");
4
+ 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)
5
+ for (const r in t.attrs)
6
+ e.attr(r, t.attrs[r]);
7
+ return t.class && e.attr("class", t.class), e;
8
+ }, "drawRect"), d = /* @__PURE__ */ n((a, t) => {
9
+ const e = {
10
+ x: t.startx,
11
+ y: t.starty,
12
+ width: t.stopx - t.startx,
13
+ height: t.stopy - t.starty,
14
+ fill: t.fill,
15
+ stroke: t.stroke,
16
+ class: "rect"
17
+ };
18
+ o(a, e).lower();
19
+ }, "drawBackgroundRect"), g = /* @__PURE__ */ n((a, t) => {
20
+ const e = t.text.replace(c, " "), r = a.append("text");
21
+ 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);
22
+ const s = r.append("tspan");
23
+ return s.attr("x", t.x + t.textMargin * 2), s.text(e), r;
24
+ }, "drawText"), h = /* @__PURE__ */ n((a, t, e, r) => {
25
+ const s = a.append("image");
26
+ s.attr("x", t), s.attr("y", e);
27
+ const i = l(r);
28
+ s.attr("xlink:href", i);
29
+ }, "drawImage"), m = /* @__PURE__ */ n((a, t, e, r) => {
30
+ const s = a.append("use");
31
+ s.attr("x", t), s.attr("y", e);
32
+ const i = l(r);
33
+ s.attr("xlink:href", `#${i}`);
34
+ }, "drawEmbeddedImage"), y = /* @__PURE__ */ n(() => ({
35
+ x: 0,
36
+ y: 0,
37
+ width: 100,
38
+ height: 100,
39
+ fill: "#EDF2AE",
40
+ stroke: "#666",
41
+ anchor: "start",
42
+ rx: 0,
43
+ ry: 0
44
+ }), "getNoteRect"), p = /* @__PURE__ */ n(() => ({
45
+ x: 0,
46
+ y: 0,
47
+ width: 100,
48
+ height: 100,
49
+ "text-anchor": "start",
50
+ style: "#666",
51
+ textMargin: 0,
52
+ rx: 0,
53
+ ry: 0,
54
+ tspan: !0
55
+ }), "getTextObj");
56
+ export {
57
+ d as a,
58
+ p as b,
59
+ m as c,
60
+ o as d,
61
+ h as e,
62
+ g as f,
63
+ y as g
64
+ };
src/backend/gradio_dropdownplus/templates/component/chunk-WVR4S24B-Db-rMs1b.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ import { _ as a, d as o } from "./mermaid.core-D58rAnek.js";
2
+ var d = /* @__PURE__ */ a((t, e) => {
3
+ let n;
4
+ return e === "sandbox" && (n = o("#i" + t)), (e === "sandbox" ? o(n.nodes()[0].contentDocument.body) : o("body")).select(`[id="${t}"]`);
5
+ }, "getDiagramElement");
6
+ export {
7
+ d as g
8
+ };
src/backend/gradio_dropdownplus/templates/component/classDiagram-3BZAVTQC-DNKoB6lB.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { s as r, c as s, a as e, C as t } from "./chunk-JBRWN2VN-D4EODkTC.js";
2
+ import { _ as l } from "./mermaid.core-D58rAnek.js";
3
+ var d = {
4
+ parser: e,
5
+ get db() {
6
+ return new t();
7
+ },
8
+ renderer: s,
9
+ styles: r,
10
+ init: /* @__PURE__ */ l((a) => {
11
+ a.class || (a.class = {}), a.class.arrowMarkerAbsolute = a.arrowMarkerAbsolute;
12
+ }, "init")
13
+ };
14
+ export {
15
+ d as diagram
16
+ };
src/backend/gradio_dropdownplus/templates/component/classDiagram-v2-QTMF73CY-DNKoB6lB.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { s as r, c as s, a as e, C as t } from "./chunk-JBRWN2VN-D4EODkTC.js";
2
+ import { _ as l } from "./mermaid.core-D58rAnek.js";
3
+ var d = {
4
+ parser: e,
5
+ get db() {
6
+ return new t();
7
+ },
8
+ renderer: s,
9
+ styles: r,
10
+ init: /* @__PURE__ */ l((a) => {
11
+ a.class || (a.class = {}), a.class.arrowMarkerAbsolute = a.arrowMarkerAbsolute;
12
+ }, "init")
13
+ };
14
+ export {
15
+ d as diagram
16
+ };
src/backend/gradio_dropdownplus/templates/component/clone-BcMVq2b9.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ import { b as r } from "./_baseUniq-CMmoTQ8t.js";
2
+ var e = 4;
3
+ function a(o) {
4
+ return r(o, e);
5
+ }
6
+ export {
7
+ a as c
8
+ };
src/backend/gradio_dropdownplus/templates/component/cytoscape.esm-ZmItrg9y.js ADDED
The diff for this file is too large to render. See raw diff
 
src/backend/gradio_dropdownplus/templates/component/dagre-2BBEFEWP-BSf-_s4F.js ADDED
@@ -0,0 +1,447 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { _ 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-D58rAnek.js";
2
+ import { G as B } from "./graph-cJOmixT5.js";
3
+ import { l as I } from "./layout-DJFnmc1Q.js";
4
+ import { i as x } from "./_baseUniq-CMmoTQ8t.js";
5
+ import { c as L } from "./clone-BcMVq2b9.js";
6
+ import { m as A } from "./_basePickBy-BbJ7hQvb.js";
7
+ function p(e) {
8
+ var t = {
9
+ options: {
10
+ directed: e.isDirected(),
11
+ multigraph: e.isMultigraph(),
12
+ compound: e.isCompound()
13
+ },
14
+ nodes: ee(e),
15
+ edges: ne(e)
16
+ };
17
+ return x(e.graph()) || (t.value = L(e.graph())), t;
18
+ }
19
+ function ee(e) {
20
+ return A(e.nodes(), function(t) {
21
+ var n = e.node(t), o = e.parent(t), c = { v: t };
22
+ return x(n) || (c.value = n), x(o) || (c.parent = o), c;
23
+ });
24
+ }
25
+ function ne(e) {
26
+ return A(e.edges(), function(t) {
27
+ var n = e.edge(t), o = { v: t.v, w: t.w };
28
+ return x(t.name) || (o.name = t.name), x(n) || (o.value = n), o;
29
+ });
30
+ }
31
+ var f = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), J = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ X(() => {
32
+ b.clear(), J.clear(), f.clear();
33
+ }, "clear"), O = /* @__PURE__ */ X((e, t) => {
34
+ const n = b.get(t) || [];
35
+ return i.trace("In isDescendant", t, " ", e, " = ", n.includes(e)), n.includes(e);
36
+ }, "isDescendant"), se = /* @__PURE__ */ X((e, t) => {
37
+ const n = b.get(t) || [];
38
+ 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);
39
+ }, "edgeInCluster"), G = /* @__PURE__ */ X((e, t, n, o) => {
40
+ i.warn(
41
+ "Copying children of ",
42
+ e,
43
+ "root",
44
+ o,
45
+ "data",
46
+ t.node(e),
47
+ o
48
+ );
49
+ const c = t.children(e) || [];
50
+ e !== o && c.push(e), i.warn("Copying (nodes) clusterId", e, "nodes", c), c.forEach((a) => {
51
+ if (t.children(a).length > 0)
52
+ G(a, t, n, o);
53
+ else {
54
+ const r = t.node(a);
55
+ 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(
56
+ "Not Setting parent for node=",
57
+ a,
58
+ "cluster!==rootId",
59
+ e !== o,
60
+ "node!==clusterId",
61
+ a !== e
62
+ ));
63
+ const u = t.edges(a);
64
+ i.debug("Copying Edges", u), u.forEach((l) => {
65
+ i.info("Edge", l);
66
+ const v = t.edge(l.v, l.w, l.name);
67
+ i.info("Edge data", v, o);
68
+ try {
69
+ 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(
70
+ "Skipping copy of edge ",
71
+ l.v,
72
+ "-->",
73
+ l.w,
74
+ " rootId: ",
75
+ o,
76
+ " clusterId:",
77
+ e
78
+ );
79
+ } catch (C) {
80
+ i.error(C);
81
+ }
82
+ });
83
+ }
84
+ i.debug("Removing node", a), t.removeNode(a);
85
+ });
86
+ }, "copy"), R = /* @__PURE__ */ X((e, t) => {
87
+ const n = t.children(e);
88
+ let o = [...n];
89
+ for (const c of n)
90
+ J.set(c, e), o = [...o, ...R(c, t)];
91
+ return o;
92
+ }, "extractDescendants"), ie = /* @__PURE__ */ X((e, t, n) => {
93
+ 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 }));
94
+ return a.filter((l) => r.some((v) => l.v === v.v && l.w === v.w));
95
+ }, "findCommonEdges"), D = /* @__PURE__ */ X((e, t, n) => {
96
+ const o = t.children(e);
97
+ if (i.trace("Searching children of id ", e, o), o.length < 1)
98
+ return e;
99
+ let c;
100
+ for (const a of o) {
101
+ const r = D(a, t, n), u = ie(t, n, r);
102
+ if (r)
103
+ if (u.length > 0)
104
+ c = r;
105
+ else
106
+ return r;
107
+ }
108
+ return c;
109
+ }, "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) => {
110
+ if (!e || t > 10) {
111
+ i.debug("Opting out, no graph ");
112
+ return;
113
+ } else
114
+ i.debug("Opting in, graph ");
115
+ e.nodes().forEach(function(n) {
116
+ e.children(n).length > 0 && (i.warn(
117
+ "Cluster identified",
118
+ n,
119
+ " Replacement id in edges: ",
120
+ D(n, e, n)
121
+ ), b.set(n, R(n, e)), f.set(n, { id: D(n, e, n), clusterData: e.node(n) }));
122
+ }), e.nodes().forEach(function(n) {
123
+ const o = e.children(n), c = e.edges();
124
+ o.length > 0 ? (i.debug("Cluster identified", n, b), c.forEach((a) => {
125
+ const r = O(a.v, n), u = O(a.w, n);
126
+ r ^ u && (i.warn("Edge: ", a, " leaves cluster ", n), i.warn("Descendants of XXX ", n, ": ", b.get(n)), f.get(n).externalConnections = !0);
127
+ })) : i.debug("Not a cluster ", n, b);
128
+ });
129
+ for (let n of f.keys()) {
130
+ const o = f.get(n).id, c = e.parent(o);
131
+ c !== n && f.has(c) && !f.get(c).externalConnections && (f.get(n).id = c);
132
+ }
133
+ e.edges().forEach(function(n) {
134
+ const o = e.edge(n);
135
+ i.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(n)), i.warn("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(e.edge(n)));
136
+ let c = n.v, a = n.w;
137
+ if (i.warn(
138
+ "Fix XXX",
139
+ f,
140
+ "ids:",
141
+ n.v,
142
+ n.w,
143
+ "Translating: ",
144
+ f.get(n.v),
145
+ " --- ",
146
+ f.get(n.w)
147
+ ), f.get(n.v) || f.get(n.w)) {
148
+ 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) {
149
+ const r = e.parent(c);
150
+ f.get(r).externalConnections = !0, o.fromCluster = n.v;
151
+ }
152
+ if (a !== n.w) {
153
+ const r = e.parent(a);
154
+ f.get(r).externalConnections = !0, o.toCluster = n.w;
155
+ }
156
+ i.warn("Fix Replacing with XXX", c, a, n.name), e.setEdge(c, a, o, n.name);
157
+ }
158
+ }), i.warn("Adjusted Graph", p(e)), T(e, 0), i.trace(f);
159
+ }, "adjustClustersAndEdges"), T = /* @__PURE__ */ X((e, t) => {
160
+ var c, a;
161
+ if (i.warn("extractor - ", t, p(e), e.children("D")), t > 10) {
162
+ i.error("Bailing out");
163
+ return;
164
+ }
165
+ let n = e.nodes(), o = !1;
166
+ for (const r of n) {
167
+ const u = e.children(r);
168
+ o = o || u.length > 0;
169
+ }
170
+ if (!o) {
171
+ i.debug("Done, no node has children", e.nodes());
172
+ return;
173
+ }
174
+ i.debug("Nodes = ", n, t);
175
+ for (const r of n)
176
+ if (i.debug(
177
+ "Extracting node",
178
+ r,
179
+ f,
180
+ f.has(r) && !f.get(r).externalConnections,
181
+ !e.parent(r),
182
+ e.node(r),
183
+ e.children("D"),
184
+ " Depth ",
185
+ t
186
+ ), !f.has(r))
187
+ i.debug("Not a cluster", r, t);
188
+ else if (!f.get(r).externalConnections && e.children(r) && e.children(r).length > 0) {
189
+ i.warn(
190
+ "Cluster without external connections, without a parent and with children",
191
+ r,
192
+ t
193
+ );
194
+ let l = e.graph().rankdir === "TB" ? "LR" : "TB";
195
+ (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));
196
+ const v = new B({
197
+ multigraph: !0,
198
+ compound: !0
199
+ }).setGraph({
200
+ rankdir: l,
201
+ nodesep: 50,
202
+ ranksep: 50,
203
+ marginx: 8,
204
+ marginy: 8
205
+ }).setDefaultEdgeLabel(function() {
206
+ return {};
207
+ });
208
+ i.warn("Old graph before copy", p(e)), G(r, e, v, r), e.setNode(r, {
209
+ clusterNode: !0,
210
+ id: r,
211
+ clusterData: f.get(r).clusterData,
212
+ label: f.get(r).label,
213
+ graph: v
214
+ }), i.warn("New graph after copy node: (", r, ")", p(v)), i.debug("Old graph after copy", p(e));
215
+ } else
216
+ i.warn(
217
+ "Cluster ** ",
218
+ r,
219
+ " **not meeting the criteria !externalConnections:",
220
+ !f.get(r).externalConnections,
221
+ " no parent: ",
222
+ !e.parent(r),
223
+ " children ",
224
+ e.children(r) && e.children(r).length > 0,
225
+ e.children("D"),
226
+ t
227
+ ), i.debug(f);
228
+ n = e.nodes(), i.warn("New list of nodes", n);
229
+ for (const r of n) {
230
+ const u = e.node(r);
231
+ i.warn(" Now next level", r, u), u != null && u.clusterNode && T(u.graph, t + 1);
232
+ }
233
+ }, "extractor"), M = /* @__PURE__ */ X((e, t) => {
234
+ if (t.length === 0)
235
+ return [];
236
+ let n = Object.assign([], t);
237
+ return t.forEach((o) => {
238
+ const c = e.children(o), a = M(e, c);
239
+ n = [...n, ...a];
240
+ }), n;
241
+ }, "sorter"), oe = /* @__PURE__ */ X((e) => M(e, e.children()), "sortNodesByHierarchy"), j = /* @__PURE__ */ X(async (e, t, n, o, c, a) => {
242
+ i.warn("Graph in recursive render:XAX", p(t), c);
243
+ const r = t.graph().rankdir;
244
+ i.trace("Dir in recursive render - dir:", r);
245
+ const u = e.insert("g").attr("class", "root");
246
+ 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]));
247
+ 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");
248
+ await Promise.all(
249
+ t.nodes().map(async function(d) {
250
+ const s = t.node(d);
251
+ if (c !== void 0) {
252
+ const w = JSON.parse(JSON.stringify(c.clusterData));
253
+ i.trace(
254
+ `Setting data for parent cluster XXX
255
+ Node.id = `,
256
+ d,
257
+ `
258
+ data=`,
259
+ w.height,
260
+ `
261
+ Parent cluster`,
262
+ c.height
263
+ ), t.setNode(c.id, w), t.parent(d) || (i.trace("Setting parent", d, c.id), t.setParent(d, c.id, w));
264
+ }
265
+ if (i.info("(Insert) Node XXX" + d + ": " + JSON.stringify(t.node(d))), s != null && s.clusterNode) {
266
+ i.info("Cluster identified XBX", d, s.width, t.node(d));
267
+ const { ranksep: w, nodesep: m } = t.graph();
268
+ s.graph.setGraph({
269
+ ...s.graph.graph(),
270
+ ranksep: w + 25,
271
+ nodesep: m
272
+ });
273
+ const N = await j(
274
+ g,
275
+ s.graph,
276
+ n,
277
+ o,
278
+ t.node(d),
279
+ a
280
+ ), S = N.elem;
281
+ z(s, S), s.diff = N.diff || 0, i.info(
282
+ "New compound node after recursive render XAX",
283
+ d,
284
+ "width",
285
+ // node,
286
+ s.width,
287
+ "height",
288
+ s.height
289
+ // node.x,
290
+ // node.y
291
+ ), U(S, s);
292
+ } else
293
+ t.children(d).length > 0 ? (i.trace(
294
+ "Cluster - the non recursive path XBX",
295
+ d,
296
+ s.id,
297
+ s,
298
+ s.width,
299
+ "Graph:",
300
+ t
301
+ ), 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 }));
302
+ })
303
+ ), await (/* @__PURE__ */ X(async () => {
304
+ const d = t.edges().map(async function(s) {
305
+ const w = t.edge(s.v, s.w, s.name);
306
+ 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(
307
+ "Fix",
308
+ f,
309
+ "ids:",
310
+ s.v,
311
+ s.w,
312
+ "Translating: ",
313
+ f.get(s.v),
314
+ f.get(s.w)
315
+ ), await Z(C, w);
316
+ });
317
+ await Promise.all(d);
318
+ }, "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)));
319
+ let E = 0, { subGraphTitleTotalMargin: y } = q(a);
320
+ return await Promise.all(
321
+ oe(t).map(async function(d) {
322
+ var w;
323
+ const s = t.node(d);
324
+ if (i.info(
325
+ "Position XBX => " + d + ": (" + s.x,
326
+ "," + s.y,
327
+ ") width: ",
328
+ s.width,
329
+ " height: ",
330
+ s.height
331
+ ), s != null && s.clusterNode)
332
+ s.y += y, i.info(
333
+ "A tainted cluster node XBX1",
334
+ d,
335
+ s.id,
336
+ s.width,
337
+ s.height,
338
+ s.x,
339
+ s.y,
340
+ t.parent(d)
341
+ ), f.get(s.id).node = s, P(s);
342
+ else if (t.children(d).length > 0) {
343
+ i.info(
344
+ "A pure cluster node XBX1",
345
+ d,
346
+ s.id,
347
+ s.x,
348
+ s.y,
349
+ s.width,
350
+ s.height,
351
+ t.parent(d)
352
+ ), s.height += y, t.node(s.parentId);
353
+ 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;
354
+ i.debug("OffsetY", S, "labelHeight", N, "halfPadding", m), await K(l, s), f.get(s.id).node = s;
355
+ } else {
356
+ const m = t.node(s.parentId);
357
+ s.y += y / 2, i.info(
358
+ "A regular node XBX1 - using the padding",
359
+ s.id,
360
+ "parent",
361
+ s.parentId,
362
+ s.width,
363
+ s.height,
364
+ s.x,
365
+ s.y,
366
+ "offsetY",
367
+ s.offsetY,
368
+ "parent",
369
+ m,
370
+ m == null ? void 0 : m.offsetY,
371
+ s
372
+ ), P(s);
373
+ }
374
+ })
375
+ ), t.edges().forEach(function(d) {
376
+ const s = t.edge(d);
377
+ i.info("Edge " + d.v + " -> " + d.w + ": " + JSON.stringify(s), s), s.points.forEach((S) => S.y += y / 2);
378
+ const w = t.node(d.v);
379
+ var m = t.node(d.w);
380
+ const N = Q(v, s, f, n, w, m, o);
381
+ W(s, N);
382
+ }), t.nodes().forEach(function(d) {
383
+ const s = t.node(d);
384
+ i.info(d, s.type, s.diff), s.isGroup && (E = s.diff);
385
+ }), i.warn("Returning from recursive render XAX", u, E), { elem: u, diff: E };
386
+ }, "recursiveRender"), ge = /* @__PURE__ */ X(async (e, t) => {
387
+ var a, r, u, l, v, C;
388
+ const n = new B({
389
+ multigraph: !0,
390
+ compound: !0
391
+ }).setGraph({
392
+ rankdir: e.direction,
393
+ 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,
394
+ 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,
395
+ marginx: 8,
396
+ marginy: 8
397
+ }).setDefaultEdgeLabel(function() {
398
+ return {};
399
+ }), o = t.select("g");
400
+ F(o, e.markers, e.type, e.diagramId), Y(), _(), H(), te(), e.nodes.forEach((g) => {
401
+ n.setNode(g.id, { ...g }), g.parentId && n.setParent(g.id, g.parentId);
402
+ }), i.debug("Edges:", e.edges), e.edges.forEach((g) => {
403
+ if (g.start === g.end) {
404
+ const h = g.start, E = h + "---" + h + "---1", y = h + "---" + h + "---2", d = n.node(h);
405
+ n.setNode(E, {
406
+ domId: E,
407
+ id: E,
408
+ parentId: d.parentId,
409
+ labelStyle: "",
410
+ label: "",
411
+ padding: 0,
412
+ shape: "labelRect",
413
+ // shape: 'rect',
414
+ style: "",
415
+ width: 10,
416
+ height: 10
417
+ }), n.setParent(E, d.parentId), n.setNode(y, {
418
+ domId: y,
419
+ id: y,
420
+ parentId: d.parentId,
421
+ labelStyle: "",
422
+ padding: 0,
423
+ // shape: 'rect',
424
+ shape: "labelRect",
425
+ label: "",
426
+ style: "",
427
+ width: 10,
428
+ height: 10
429
+ }), n.setParent(y, d.parentId);
430
+ const s = structuredClone(g), w = structuredClone(g), m = structuredClone(g);
431
+ 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");
432
+ } else
433
+ n.setEdge(g.start, g.end, { ...g }, g.id);
434
+ }), i.warn("Graph at first:", JSON.stringify(p(n))), re(n), i.warn("Graph after XAX:", JSON.stringify(p(n)));
435
+ const c = V();
436
+ await j(
437
+ o,
438
+ n,
439
+ e.type,
440
+ e.diagramId,
441
+ void 0,
442
+ c
443
+ );
444
+ }, "render");
445
+ export {
446
+ ge as render
447
+ };
src/backend/gradio_dropdownplus/templates/component/defaultLocale-D7EN2tov.js ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function H(n) {
2
+ return Math.abs(n = Math.round(n)) >= 1e21 ? n.toLocaleString("en").replace(/,/g, "") : n.toString(10);
3
+ }
4
+ function j(n, t) {
5
+ if ((e = (n = t ? n.toExponential(t - 1) : n.toExponential()).indexOf("e")) < 0) return null;
6
+ var e, i = n.slice(0, e);
7
+ return [
8
+ i.length > 1 ? i[0] + i.slice(2) : i,
9
+ +n.slice(e + 1)
10
+ ];
11
+ }
12
+ function J(n) {
13
+ return n = j(Math.abs(n)), n ? n[1] : NaN;
14
+ }
15
+ function K(n, t) {
16
+ return function(e, i) {
17
+ for (var o = e.length, f = [], c = 0, u = n[0], p = 0; o > 0 && u > 0 && (p + u + 1 > i && (u = Math.max(1, i - p)), f.push(e.substring(o -= u, o + u)), !((p += u + 1) > i)); )
18
+ u = n[c = (c + 1) % n.length];
19
+ return f.reverse().join(t);
20
+ };
21
+ }
22
+ function Q(n) {
23
+ return function(t) {
24
+ return t.replace(/[0-9]/g, function(e) {
25
+ return n[+e];
26
+ });
27
+ };
28
+ }
29
+ var V = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
30
+ function N(n) {
31
+ if (!(t = V.exec(n))) throw new Error("invalid format: " + n);
32
+ var t;
33
+ return new $({
34
+ fill: t[1],
35
+ align: t[2],
36
+ sign: t[3],
37
+ symbol: t[4],
38
+ zero: t[5],
39
+ width: t[6],
40
+ comma: t[7],
41
+ precision: t[8] && t[8].slice(1),
42
+ trim: t[9],
43
+ type: t[10]
44
+ });
45
+ }
46
+ N.prototype = $.prototype;
47
+ function $(n) {
48
+ 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 + "";
49
+ }
50
+ $.prototype.toString = function() {
51
+ 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;
52
+ };
53
+ function W(n) {
54
+ n: for (var t = n.length, e = 1, i = -1, o; e < t; ++e)
55
+ switch (n[e]) {
56
+ case ".":
57
+ i = o = e;
58
+ break;
59
+ case "0":
60
+ i === 0 && (i = e), o = e;
61
+ break;
62
+ default:
63
+ if (!+n[e]) break n;
64
+ i > 0 && (i = 0);
65
+ break;
66
+ }
67
+ return i > 0 ? n.slice(0, i) + n.slice(o + 1) : n;
68
+ }
69
+ var U;
70
+ function _(n, t) {
71
+ var e = j(n, t);
72
+ if (!e) return n + "";
73
+ var i = e[0], o = e[1], f = o - (U = Math.max(-8, Math.min(8, Math.floor(o / 3))) * 3) + 1, c = i.length;
74
+ return f === c ? i : f > c ? i + new Array(f - c + 1).join("0") : f > 0 ? i.slice(0, f) + "." + i.slice(f) : "0." + new Array(1 - f).join("0") + j(n, Math.max(0, t + f - 1))[0];
75
+ }
76
+ function G(n, t) {
77
+ var e = j(n, t);
78
+ if (!e) return n + "";
79
+ var i = e[0], o = e[1];
80
+ return o < 0 ? "0." + new Array(-o).join("0") + i : i.length > o + 1 ? i.slice(0, o + 1) + "." + i.slice(o + 1) : i + new Array(o - i.length + 2).join("0");
81
+ }
82
+ const I = {
83
+ "%": (n, t) => (n * 100).toFixed(t),
84
+ b: (n) => Math.round(n).toString(2),
85
+ c: (n) => n + "",
86
+ d: H,
87
+ e: (n, t) => n.toExponential(t),
88
+ f: (n, t) => n.toFixed(t),
89
+ g: (n, t) => n.toPrecision(t),
90
+ o: (n) => Math.round(n).toString(8),
91
+ p: (n, t) => G(n * 100, t),
92
+ r: G,
93
+ s: _,
94
+ X: (n) => Math.round(n).toString(16).toUpperCase(),
95
+ x: (n) => Math.round(n).toString(16)
96
+ };
97
+ function X(n) {
98
+ return n;
99
+ }
100
+ var O = Array.prototype.map, R = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
101
+ function v(n) {
102
+ var t = n.grouping === void 0 || n.thousands === void 0 ? X : K(O.call(n.grouping, Number), n.thousands + ""), e = n.currency === void 0 ? "" : n.currency[0] + "", i = n.currency === void 0 ? "" : n.currency[1] + "", o = n.decimal === void 0 ? "." : n.decimal + "", f = n.numerals === void 0 ? X : Q(O.call(n.numerals, String)), c = n.percent === void 0 ? "%" : n.percent + "", u = n.minus === void 0 ? "−" : n.minus + "", p = n.nan === void 0 ? "NaN" : n.nan + "";
103
+ function F(a) {
104
+ a = N(a);
105
+ var x = a.fill, M = a.align, m = a.sign, w = a.symbol, l = a.zero, S = a.width, E = a.comma, g = a.precision, L = a.trim, d = a.type;
106
+ d === "n" ? (E = !0, d = "g") : I[d] || (g === void 0 && (g = 12), L = !0, d = "g"), (l || x === "0" && M === "=") && (l = !0, x = "0", M = "=");
107
+ var Z = w === "$" ? e : w === "#" && /[boxX]/.test(d) ? "0" + d.toLowerCase() : "", q = w === "$" ? i : /[%p]/.test(d) ? c : "", T = I[d], B = /[defgprs%]/.test(d);
108
+ g = g === void 0 ? 6 : /[gprs]/.test(d) ? Math.max(1, Math.min(21, g)) : Math.max(0, Math.min(20, g));
109
+ function C(r) {
110
+ var y = Z, h = q, b, D, k;
111
+ if (d === "c")
112
+ h = T(r) + h, r = "";
113
+ else {
114
+ r = +r;
115
+ var P = r < 0 || 1 / r < 0;
116
+ if (r = isNaN(r) ? p : T(Math.abs(r), g), L && (r = W(r)), P && +r == 0 && m !== "+" && (P = !1), y = (P ? m === "(" ? m : u : m === "-" || m === "(" ? "" : m) + y, h = (d === "s" ? R[8 + U / 3] : "") + h + (P && m === "(" ? ")" : ""), B) {
117
+ for (b = -1, D = r.length; ++b < D; )
118
+ if (k = r.charCodeAt(b), 48 > k || k > 57) {
119
+ h = (k === 46 ? o + r.slice(b + 1) : r.slice(b)) + h, r = r.slice(0, b);
120
+ break;
121
+ }
122
+ }
123
+ }
124
+ E && !l && (r = t(r, 1 / 0));
125
+ var z = y.length + r.length + h.length, s = z < S ? new Array(S - z + 1).join(x) : "";
126
+ switch (E && l && (r = t(s + r, s.length ? S - h.length : 1 / 0), s = ""), M) {
127
+ case "<":
128
+ r = y + r + h + s;
129
+ break;
130
+ case "=":
131
+ r = y + s + r + h;
132
+ break;
133
+ case "^":
134
+ r = s.slice(0, z = s.length >> 1) + y + r + h + s.slice(z);
135
+ break;
136
+ default:
137
+ r = s + y + r + h;
138
+ break;
139
+ }
140
+ return f(r);
141
+ }
142
+ return C.toString = function() {
143
+ return a + "";
144
+ }, C;
145
+ }
146
+ function Y(a, x) {
147
+ var M = F((a = N(a), a.type = "f", a)), m = Math.max(-8, Math.min(8, Math.floor(J(x) / 3))) * 3, w = Math.pow(10, -m), l = R[8 + m / 3];
148
+ return function(S) {
149
+ return M(w * S) + l;
150
+ };
151
+ }
152
+ return {
153
+ format: F,
154
+ formatPrefix: Y
155
+ };
156
+ }
157
+ var A, nn, tn;
158
+ rn({
159
+ thousands: ",",
160
+ grouping: [3],
161
+ currency: ["$", ""]
162
+ });
163
+ function rn(n) {
164
+ return A = v(n), nn = A.format, tn = A.formatPrefix, A;
165
+ }
166
+ export {
167
+ tn as a,
168
+ nn as b,
169
+ J as e,
170
+ N as f
171
+ };
src/backend/gradio_dropdownplus/templates/component/diagram-4IRLE6MV-BXgGx7EY.js ADDED
@@ -0,0 +1,534 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { s as he } from "./chunk-NRVI72HA-EajhWFFL.js";
2
+ import { _ as w, D as te, E as ae, H as ue, e as pe, l as K, aY as P, d as j, b as fe, a as ge, p as me, q as ye, g as Se, s as ve, F as xe, aZ as be, y as we } from "./mermaid.core-D58rAnek.js";
3
+ import { p as Ce } from "./chunk-ANTBXLJU-CuGo78t3.js";
4
+ import { p as Te } from "./treemap-75Q7IDZK-CIjK5oQY.js";
5
+ import { b as O } from "./defaultLocale-D7EN2tov.js";
6
+ import { o as J } from "./ordinal-DfAQgscy.js";
7
+ function Le(t) {
8
+ var a = 0, l = t.children, n = l && l.length;
9
+ if (!n) a = 1;
10
+ else for (; --n >= 0; ) a += l[n].value;
11
+ t.value = a;
12
+ }
13
+ function $e() {
14
+ return this.eachAfter(Le);
15
+ }
16
+ function Ae(t, a) {
17
+ let l = -1;
18
+ for (const n of this)
19
+ t.call(a, n, ++l, this);
20
+ return this;
21
+ }
22
+ function Fe(t, a) {
23
+ for (var l = this, n = [l], o, s, d = -1; l = n.pop(); )
24
+ if (t.call(a, l, ++d, this), o = l.children)
25
+ for (s = o.length - 1; s >= 0; --s)
26
+ n.push(o[s]);
27
+ return this;
28
+ }
29
+ function ke(t, a) {
30
+ for (var l = this, n = [l], o = [], s, d, h, g = -1; l = n.pop(); )
31
+ if (o.push(l), s = l.children)
32
+ for (d = 0, h = s.length; d < h; ++d)
33
+ n.push(s[d]);
34
+ for (; l = o.pop(); )
35
+ t.call(a, l, ++g, this);
36
+ return this;
37
+ }
38
+ function Ne(t, a) {
39
+ let l = -1;
40
+ for (const n of this)
41
+ if (t.call(a, n, ++l, this))
42
+ return n;
43
+ }
44
+ function Me(t) {
45
+ return this.eachAfter(function(a) {
46
+ for (var l = +t(a.data) || 0, n = a.children, o = n && n.length; --o >= 0; ) l += n[o].value;
47
+ a.value = l;
48
+ });
49
+ }
50
+ function _e(t) {
51
+ return this.eachBefore(function(a) {
52
+ a.children && a.children.sort(t);
53
+ });
54
+ }
55
+ function ze(t) {
56
+ for (var a = this, l = Ve(a, t), n = [a]; a !== l; )
57
+ a = a.parent, n.push(a);
58
+ for (var o = n.length; t !== l; )
59
+ n.splice(o, 0, t), t = t.parent;
60
+ return n;
61
+ }
62
+ function Ve(t, a) {
63
+ if (t === a) return t;
64
+ var l = t.ancestors(), n = a.ancestors(), o = null;
65
+ for (t = l.pop(), a = n.pop(); t === a; )
66
+ o = t, t = l.pop(), a = n.pop();
67
+ return o;
68
+ }
69
+ function De() {
70
+ for (var t = this, a = [t]; t = t.parent; )
71
+ a.push(t);
72
+ return a;
73
+ }
74
+ function Pe() {
75
+ return Array.from(this);
76
+ }
77
+ function Be() {
78
+ var t = [];
79
+ return this.eachBefore(function(a) {
80
+ a.children || t.push(a);
81
+ }), t;
82
+ }
83
+ function Ee() {
84
+ var t = this, a = [];
85
+ return t.each(function(l) {
86
+ l !== t && a.push({ source: l.parent, target: l });
87
+ }), a;
88
+ }
89
+ function* Re() {
90
+ var t = this, a, l = [t], n, o, s;
91
+ do
92
+ for (a = l.reverse(), l = []; t = a.pop(); )
93
+ if (yield t, n = t.children)
94
+ for (o = 0, s = n.length; o < s; ++o)
95
+ l.push(n[o]);
96
+ while (l.length);
97
+ }
98
+ function Q(t, a) {
99
+ t instanceof Map ? (t = [void 0, t], a === void 0 && (a = Ie)) : a === void 0 && (a = He);
100
+ for (var l = new Z(t), n, o = [l], s, d, h, g; n = o.pop(); )
101
+ if ((d = a(n.data)) && (g = (d = Array.from(d)).length))
102
+ for (n.children = d, h = g - 1; h >= 0; --h)
103
+ o.push(s = d[h] = new Z(d[h])), s.parent = n, s.depth = n.depth + 1;
104
+ return l.eachBefore(qe);
105
+ }
106
+ function We() {
107
+ return Q(this).eachBefore(Oe);
108
+ }
109
+ function He(t) {
110
+ return t.children;
111
+ }
112
+ function Ie(t) {
113
+ return Array.isArray(t) ? t[1] : null;
114
+ }
115
+ function Oe(t) {
116
+ t.data.value !== void 0 && (t.value = t.data.value), t.data = t.data.data;
117
+ }
118
+ function qe(t) {
119
+ var a = 0;
120
+ do
121
+ t.height = a;
122
+ while ((t = t.parent) && t.height < ++a);
123
+ }
124
+ function Z(t) {
125
+ this.data = t, this.depth = this.height = 0, this.parent = null;
126
+ }
127
+ Z.prototype = Q.prototype = {
128
+ constructor: Z,
129
+ count: $e,
130
+ each: Ae,
131
+ eachAfter: ke,
132
+ eachBefore: Fe,
133
+ find: Ne,
134
+ sum: Me,
135
+ sort: _e,
136
+ path: ze,
137
+ ancestors: De,
138
+ descendants: Pe,
139
+ leaves: Be,
140
+ links: Ee,
141
+ copy: We,
142
+ [Symbol.iterator]: Re
143
+ };
144
+ function Ge(t) {
145
+ if (typeof t != "function") throw new Error();
146
+ return t;
147
+ }
148
+ function q() {
149
+ return 0;
150
+ }
151
+ function G(t) {
152
+ return function() {
153
+ return t;
154
+ };
155
+ }
156
+ function Xe(t) {
157
+ t.x0 = Math.round(t.x0), t.y0 = Math.round(t.y0), t.x1 = Math.round(t.x1), t.y1 = Math.round(t.y1);
158
+ }
159
+ function Ye(t, a, l, n, o) {
160
+ for (var s = t.children, d, h = -1, g = s.length, c = t.value && (n - a) / t.value; ++h < g; )
161
+ d = s[h], d.y0 = l, d.y1 = o, d.x0 = a, d.x1 = a += d.value * c;
162
+ }
163
+ function je(t, a, l, n, o) {
164
+ for (var s = t.children, d, h = -1, g = s.length, c = t.value && (o - l) / t.value; ++h < g; )
165
+ d = s[h], d.x0 = a, d.x1 = n, d.y0 = l, d.y1 = l += d.value * c;
166
+ }
167
+ var Ze = (1 + Math.sqrt(5)) / 2;
168
+ function Ue(t, a, l, n, o, s) {
169
+ for (var d = [], h = a.children, g, c, u = 0, b = 0, r = h.length, x, S, v = a.value, p, m, N, k, V, R, M; u < r; ) {
170
+ x = o - l, S = s - n;
171
+ do
172
+ p = h[b++].value;
173
+ while (!p && b < r);
174
+ for (m = N = p, R = Math.max(S / x, x / S) / (v * t), M = p * p * R, V = Math.max(N / M, M / m); b < r; ++b) {
175
+ if (p += c = h[b].value, c < m && (m = c), c > N && (N = c), M = p * p * R, k = Math.max(N / M, M / m), k > V) {
176
+ p -= c;
177
+ break;
178
+ }
179
+ V = k;
180
+ }
181
+ d.push(g = { value: p, dice: x < S, children: h.slice(u, b) }), g.dice ? Ye(g, l, n, o, v ? n += S * p / v : s) : je(g, l, n, v ? l += x * p / v : o, s), v -= p, u = b;
182
+ }
183
+ return d;
184
+ }
185
+ const Je = function t(a) {
186
+ function l(n, o, s, d, h) {
187
+ Ue(a, n, o, s, d, h);
188
+ }
189
+ return l.ratio = function(n) {
190
+ return t((n = +n) > 1 ? n : 1);
191
+ }, l;
192
+ }(Ze);
193
+ function Ke() {
194
+ var t = Je, a = !1, l = 1, n = 1, o = [0], s = q, d = q, h = q, g = q, c = q;
195
+ function u(r) {
196
+ return r.x0 = r.y0 = 0, r.x1 = l, r.y1 = n, r.eachBefore(b), o = [0], a && r.eachBefore(Xe), r;
197
+ }
198
+ function b(r) {
199
+ var x = o[r.depth], S = r.x0 + x, v = r.y0 + x, p = r.x1 - x, m = r.y1 - x;
200
+ p < S && (S = p = (S + p) / 2), m < v && (v = m = (v + m) / 2), r.x0 = S, r.y0 = v, r.x1 = p, r.y1 = m, r.children && (x = o[r.depth + 1] = s(r) / 2, S += c(r) - x, v += d(r) - x, p -= h(r) - x, m -= g(r) - x, p < S && (S = p = (S + p) / 2), m < v && (v = m = (v + m) / 2), t(r, S, v, p, m));
201
+ }
202
+ return u.round = function(r) {
203
+ return arguments.length ? (a = !!r, u) : a;
204
+ }, u.size = function(r) {
205
+ return arguments.length ? (l = +r[0], n = +r[1], u) : [l, n];
206
+ }, u.tile = function(r) {
207
+ return arguments.length ? (t = Ge(r), u) : t;
208
+ }, u.padding = function(r) {
209
+ return arguments.length ? u.paddingInner(r).paddingOuter(r) : u.paddingInner();
210
+ }, u.paddingInner = function(r) {
211
+ return arguments.length ? (s = typeof r == "function" ? r : G(+r), u) : s;
212
+ }, u.paddingOuter = function(r) {
213
+ return arguments.length ? u.paddingTop(r).paddingRight(r).paddingBottom(r).paddingLeft(r) : u.paddingTop();
214
+ }, u.paddingTop = function(r) {
215
+ return arguments.length ? (d = typeof r == "function" ? r : G(+r), u) : d;
216
+ }, u.paddingRight = function(r) {
217
+ return arguments.length ? (h = typeof r == "function" ? r : G(+r), u) : h;
218
+ }, u.paddingBottom = function(r) {
219
+ return arguments.length ? (g = typeof r == "function" ? r : G(+r), u) : g;
220
+ }, u.paddingLeft = function(r) {
221
+ return arguments.length ? (c = typeof r == "function" ? r : G(+r), u) : c;
222
+ }, u;
223
+ }
224
+ var E, ne = (E = class {
225
+ constructor() {
226
+ this.nodes = [], this.levels = /* @__PURE__ */ new Map(), this.outerNodes = [], this.classes = /* @__PURE__ */ new Map(), this.setAccTitle = fe, this.getAccTitle = ge, this.setDiagramTitle = me, this.getDiagramTitle = ye, this.getAccDescription = Se, this.setAccDescription = ve;
227
+ }
228
+ getNodes() {
229
+ return this.nodes;
230
+ }
231
+ getConfig() {
232
+ const a = xe, l = ae();
233
+ return te({
234
+ ...a.treemap,
235
+ ...l.treemap ?? {}
236
+ });
237
+ }
238
+ addNode(a, l) {
239
+ this.nodes.push(a), this.levels.set(a, l), l === 0 && (this.outerNodes.push(a), this.root ?? (this.root = a));
240
+ }
241
+ getRoot() {
242
+ return { name: "", children: this.outerNodes };
243
+ }
244
+ addClass(a, l) {
245
+ const n = this.classes.get(a) ?? { id: a, styles: [], textStyles: [] }, o = l.replace(/\\,/g, "§§§").replace(/,/g, ";").replace(/§§§/g, ",").split(";");
246
+ o && o.forEach((s) => {
247
+ be(s) && (n != null && n.textStyles ? n.textStyles.push(s) : n.textStyles = [s]), n != null && n.styles ? n.styles.push(s) : n.styles = [s];
248
+ }), this.classes.set(a, n);
249
+ }
250
+ getClasses() {
251
+ return this.classes;
252
+ }
253
+ getStylesForClass(a) {
254
+ var l;
255
+ return ((l = this.classes.get(a)) == null ? void 0 : l.styles) ?? [];
256
+ }
257
+ clear() {
258
+ we(), this.nodes = [], this.levels = /* @__PURE__ */ new Map(), this.outerNodes = [], this.classes = /* @__PURE__ */ new Map(), this.root = void 0;
259
+ }
260
+ }, w(E, "TreeMapDB"), E);
261
+ function le(t) {
262
+ if (!t.length)
263
+ return [];
264
+ const a = [], l = [];
265
+ return t.forEach((n) => {
266
+ const o = {
267
+ name: n.name,
268
+ children: n.type === "Leaf" ? void 0 : []
269
+ };
270
+ for (o.classSelector = n == null ? void 0 : n.classSelector, n != null && n.cssCompiledStyles && (o.cssCompiledStyles = [n.cssCompiledStyles]), n.type === "Leaf" && n.value !== void 0 && (o.value = n.value); l.length > 0 && l[l.length - 1].level >= n.level; )
271
+ l.pop();
272
+ if (l.length === 0)
273
+ a.push(o);
274
+ else {
275
+ const s = l[l.length - 1].node;
276
+ s.children ? s.children.push(o) : s.children = [o];
277
+ }
278
+ n.type !== "Leaf" && l.push({ node: o, level: n.level });
279
+ }), a;
280
+ }
281
+ w(le, "buildHierarchy");
282
+ var Qe = /* @__PURE__ */ w((t, a) => {
283
+ Ce(t, a);
284
+ const l = [];
285
+ for (const s of t.TreemapRows ?? [])
286
+ s.$type === "ClassDefStatement" && a.addClass(s.className ?? "", s.styleText ?? "");
287
+ for (const s of t.TreemapRows ?? []) {
288
+ const d = s.item;
289
+ if (!d)
290
+ continue;
291
+ const h = s.indent ? parseInt(s.indent) : 0, g = et(d), c = d.classSelector ? a.getStylesForClass(d.classSelector) : [], u = c.length > 0 ? c.join(";") : void 0, b = {
292
+ level: h,
293
+ name: g,
294
+ type: d.$type,
295
+ value: d.value,
296
+ classSelector: d.classSelector,
297
+ cssCompiledStyles: u
298
+ };
299
+ l.push(b);
300
+ }
301
+ const n = le(l), o = /* @__PURE__ */ w((s, d) => {
302
+ for (const h of s)
303
+ a.addNode(h, d), h.children && h.children.length > 0 && o(h.children, d + 1);
304
+ }, "addNodesRecursively");
305
+ o(n, 0);
306
+ }, "populate"), et = /* @__PURE__ */ w((t) => t.name ? String(t.name) : "", "getItemName"), re = {
307
+ // @ts-expect-error - TreeMapDB is not assignable to DiagramDB
308
+ parser: { yy: void 0 },
309
+ parse: /* @__PURE__ */ w(async (t) => {
310
+ var a;
311
+ try {
312
+ const n = await Te("treemap", t);
313
+ K.debug("Treemap AST:", n);
314
+ const o = (a = re.parser) == null ? void 0 : a.yy;
315
+ if (!(o instanceof ne))
316
+ throw new Error(
317
+ "parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues."
318
+ );
319
+ Qe(n, o);
320
+ } catch (l) {
321
+ throw K.error("Error parsing treemap:", l), l;
322
+ }
323
+ }, "parse")
324
+ }, tt = 10, B = 10, X = 25, at = /* @__PURE__ */ w((t, a, l, n) => {
325
+ const o = n.db, s = o.getConfig(), d = s.padding ?? tt, h = o.getDiagramTitle(), g = o.getRoot(), { themeVariables: c } = ae();
326
+ if (!g)
327
+ return;
328
+ const u = h ? 30 : 0, b = ue(a), r = s.nodeWidth ? s.nodeWidth * B : 960, x = s.nodeHeight ? s.nodeHeight * B : 500, S = r, v = x + u;
329
+ b.attr("viewBox", `0 0 ${S} ${v}`), pe(b, v, S, s.useMaxWidth);
330
+ let p;
331
+ try {
332
+ const e = s.valueFormat || ",";
333
+ if (e === "$0,0")
334
+ p = /* @__PURE__ */ w((i) => "$" + O(",")(i), "valueFormat");
335
+ else if (e.startsWith("$") && e.includes(",")) {
336
+ const i = /\.\d+/.exec(e), f = i ? i[0] : "";
337
+ p = /* @__PURE__ */ w((C) => "$" + O("," + f)(C), "valueFormat");
338
+ } else if (e.startsWith("$")) {
339
+ const i = e.substring(1);
340
+ p = /* @__PURE__ */ w((f) => "$" + O(i || "")(f), "valueFormat");
341
+ } else
342
+ p = O(e);
343
+ } catch (e) {
344
+ K.error("Error creating format function:", e), p = O(",");
345
+ }
346
+ const m = J().range([
347
+ "transparent",
348
+ c.cScale0,
349
+ c.cScale1,
350
+ c.cScale2,
351
+ c.cScale3,
352
+ c.cScale4,
353
+ c.cScale5,
354
+ c.cScale6,
355
+ c.cScale7,
356
+ c.cScale8,
357
+ c.cScale9,
358
+ c.cScale10,
359
+ c.cScale11
360
+ ]), N = J().range([
361
+ "transparent",
362
+ c.cScalePeer0,
363
+ c.cScalePeer1,
364
+ c.cScalePeer2,
365
+ c.cScalePeer3,
366
+ c.cScalePeer4,
367
+ c.cScalePeer5,
368
+ c.cScalePeer6,
369
+ c.cScalePeer7,
370
+ c.cScalePeer8,
371
+ c.cScalePeer9,
372
+ c.cScalePeer10,
373
+ c.cScalePeer11
374
+ ]), k = J().range([
375
+ c.cScaleLabel0,
376
+ c.cScaleLabel1,
377
+ c.cScaleLabel2,
378
+ c.cScaleLabel3,
379
+ c.cScaleLabel4,
380
+ c.cScaleLabel5,
381
+ c.cScaleLabel6,
382
+ c.cScaleLabel7,
383
+ c.cScaleLabel8,
384
+ c.cScaleLabel9,
385
+ c.cScaleLabel10,
386
+ c.cScaleLabel11
387
+ ]);
388
+ h && b.append("text").attr("x", S / 2).attr("y", u / 2).attr("class", "treemapTitle").attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(h);
389
+ const V = b.append("g").attr("transform", `translate(0, ${u})`).attr("class", "treemapContainer"), R = Q(g).sum((e) => e.value ?? 0).sort((e, i) => (i.value ?? 0) - (e.value ?? 0)), ee = Ke().size([r, x]).paddingTop(
390
+ (e) => e.children && e.children.length > 0 ? X + B : 0
391
+ ).paddingInner(d).paddingLeft((e) => e.children && e.children.length > 0 ? B : 0).paddingRight((e) => e.children && e.children.length > 0 ? B : 0).paddingBottom((e) => e.children && e.children.length > 0 ? B : 0).round(!0)(R), se = ee.descendants().filter((e) => e.children && e.children.length > 0), W = V.selectAll(".treemapSection").data(se).enter().append("g").attr("class", "treemapSection").attr("transform", (e) => `translate(${e.x0},${e.y0})`);
392
+ W.append("rect").attr("width", (e) => e.x1 - e.x0).attr("height", X).attr("class", "treemapSectionHeader").attr("fill", "none").attr("fill-opacity", 0.6).attr("stroke-width", 0.6).attr("style", (e) => e.depth === 0 ? "display: none;" : ""), W.append("clipPath").attr("id", (e, i) => `clip-section-${a}-${i}`).append("rect").attr("width", (e) => Math.max(0, e.x1 - e.x0 - 12)).attr("height", X), W.append("rect").attr("width", (e) => e.x1 - e.x0).attr("height", (e) => e.y1 - e.y0).attr("class", (e, i) => `treemapSection section${i}`).attr("fill", (e) => m(e.data.name)).attr("fill-opacity", 0.6).attr("stroke", (e) => N(e.data.name)).attr("stroke-width", 2).attr("stroke-opacity", 0.4).attr("style", (e) => {
393
+ if (e.depth === 0)
394
+ return "display: none;";
395
+ const i = P({ cssCompiledStyles: e.data.cssCompiledStyles });
396
+ return i.nodeStyles + ";" + i.borderStyles.join(";");
397
+ }), W.append("text").attr("class", "treemapSectionLabel").attr("x", 6).attr("y", X / 2).attr("dominant-baseline", "middle").text((e) => e.depth === 0 ? "" : e.data.name).attr("font-weight", "bold").attr("style", (e) => {
398
+ if (e.depth === 0)
399
+ return "display: none;";
400
+ const i = "dominant-baseline: middle; font-size: 12px; fill:" + k(e.data.name) + "; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;", f = P({ cssCompiledStyles: e.data.cssCompiledStyles });
401
+ return i + f.labelStyles.replace("color:", "fill:");
402
+ }).each(function(e) {
403
+ if (e.depth === 0)
404
+ return;
405
+ const i = j(this), f = e.data.name;
406
+ i.text(f);
407
+ const C = e.x1 - e.x0, $ = 6;
408
+ let A;
409
+ s.showValues !== !1 && e.value ? A = C - 10 - 30 - 10 - $ : A = C - $ - 6;
410
+ const F = Math.max(15, A), y = i.node();
411
+ if (y.getComputedTextLength() > F) {
412
+ const T = "...";
413
+ let L = f;
414
+ for (; L.length > 0; ) {
415
+ if (L = f.substring(0, L.length - 1), L.length === 0) {
416
+ i.text(T), y.getComputedTextLength() > F && i.text("");
417
+ break;
418
+ }
419
+ if (i.text(L + T), y.getComputedTextLength() <= F)
420
+ break;
421
+ }
422
+ }
423
+ }), s.showValues !== !1 && W.append("text").attr("class", "treemapSectionValue").attr("x", (e) => e.x1 - e.x0 - 10).attr("y", X / 2).attr("text-anchor", "end").attr("dominant-baseline", "middle").text((e) => e.value ? p(e.value) : "").attr("font-style", "italic").attr("style", (e) => {
424
+ if (e.depth === 0)
425
+ return "display: none;";
426
+ const i = "text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:" + k(e.data.name) + "; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;", f = P({ cssCompiledStyles: e.data.cssCompiledStyles });
427
+ return i + f.labelStyles.replace("color:", "fill:");
428
+ });
429
+ const ie = ee.leaves(), Y = V.selectAll(".treemapLeafGroup").data(ie).enter().append("g").attr("class", (e, i) => `treemapNode treemapLeafGroup leaf${i}${e.data.classSelector ? ` ${e.data.classSelector}` : ""}x`).attr("transform", (e) => `translate(${e.x0},${e.y0})`);
430
+ Y.append("rect").attr("width", (e) => e.x1 - e.x0).attr("height", (e) => e.y1 - e.y0).attr("class", "treemapLeaf").attr("fill", (e) => e.parent ? m(e.parent.data.name) : m(e.data.name)).attr("style", (e) => P({ cssCompiledStyles: e.data.cssCompiledStyles }).nodeStyles).attr("fill-opacity", 0.3).attr("stroke", (e) => e.parent ? m(e.parent.data.name) : m(e.data.name)).attr("stroke-width", 3), Y.append("clipPath").attr("id", (e, i) => `clip-${a}-${i}`).append("rect").attr("width", (e) => Math.max(0, e.x1 - e.x0 - 4)).attr("height", (e) => Math.max(0, e.y1 - e.y0 - 4)), Y.append("text").attr("class", "treemapLabel").attr("x", (e) => (e.x1 - e.x0) / 2).attr("y", (e) => (e.y1 - e.y0) / 2).attr("style", (e) => {
431
+ const i = "text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:" + k(e.data.name) + ";", f = P({ cssCompiledStyles: e.data.cssCompiledStyles });
432
+ return i + f.labelStyles.replace("color:", "fill:");
433
+ }).attr("clip-path", (e, i) => `url(#clip-${a}-${i})`).text((e) => e.data.name).each(function(e) {
434
+ const i = j(this), f = e.x1 - e.x0, C = e.y1 - e.y0, $ = i.node(), A = 4, D = f - 2 * A, F = C - 2 * A;
435
+ if (D < 10 || F < 10) {
436
+ i.style("display", "none");
437
+ return;
438
+ }
439
+ let y = parseInt(i.style("font-size"), 10);
440
+ const _ = 8, T = 28, L = 0.6, z = 6, H = 2;
441
+ for (; $.getComputedTextLength() > D && y > _; )
442
+ y--, i.style("font-size", `${y}px`);
443
+ let I = Math.max(
444
+ z,
445
+ Math.min(T, Math.round(y * L))
446
+ ), U = y + H + I;
447
+ for (; U > F && y > _ && (y--, I = Math.max(
448
+ z,
449
+ Math.min(T, Math.round(y * L))
450
+ ), !(I < z && y === _)); )
451
+ i.style("font-size", `${y}px`), U = y + H + I;
452
+ i.style("font-size", `${y}px`), ($.getComputedTextLength() > D || y < _ || F < y) && i.style("display", "none");
453
+ }), s.showValues !== !1 && Y.append("text").attr("class", "treemapValue").attr("x", (i) => (i.x1 - i.x0) / 2).attr("y", function(i) {
454
+ return (i.y1 - i.y0) / 2;
455
+ }).attr("style", (i) => {
456
+ const f = "text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:" + k(i.data.name) + ";", C = P({ cssCompiledStyles: i.data.cssCompiledStyles });
457
+ return f + C.labelStyles.replace("color:", "fill:");
458
+ }).attr("clip-path", (i, f) => `url(#clip-${a}-${f})`).text((i) => i.value ? p(i.value) : "").each(function(i) {
459
+ const f = j(this), C = this.parentNode;
460
+ if (!C) {
461
+ f.style("display", "none");
462
+ return;
463
+ }
464
+ const $ = j(C).select(".treemapLabel");
465
+ if ($.empty() || $.style("display") === "none") {
466
+ f.style("display", "none");
467
+ return;
468
+ }
469
+ const A = parseFloat($.style("font-size")), D = 28, F = 0.6, y = 6, _ = 2, T = Math.max(
470
+ y,
471
+ Math.min(D, Math.round(A * F))
472
+ );
473
+ f.style("font-size", `${T}px`);
474
+ const z = (i.y1 - i.y0) / 2 + A / 2 + _;
475
+ f.attr("y", z);
476
+ const H = i.x1 - i.x0, ce = i.y1 - i.y0 - 4, de = H - 2 * 4;
477
+ f.node().getComputedTextLength() > de || z + T > ce || T < y ? f.style("display", "none") : f.style("display", null);
478
+ });
479
+ const oe = s.diagramPadding ?? 8;
480
+ he(b, oe, "flowchart", (s == null ? void 0 : s.useMaxWidth) || !1);
481
+ }, "draw"), nt = /* @__PURE__ */ w(function(t, a) {
482
+ return a.db.getClasses();
483
+ }, "getClasses"), lt = { draw: at, getClasses: nt }, rt = {
484
+ sectionStrokeColor: "black",
485
+ sectionStrokeWidth: "1",
486
+ sectionFillColor: "#efefef",
487
+ leafStrokeColor: "black",
488
+ leafStrokeWidth: "1",
489
+ leafFillColor: "#efefef",
490
+ labelColor: "black",
491
+ labelFontSize: "12px",
492
+ valueFontSize: "10px",
493
+ valueColor: "black",
494
+ titleColor: "black",
495
+ titleFontSize: "14px"
496
+ }, st = /* @__PURE__ */ w(({
497
+ treemap: t
498
+ } = {}) => {
499
+ const a = te(rt, t);
500
+ return `
501
+ .treemapNode.section {
502
+ stroke: ${a.sectionStrokeColor};
503
+ stroke-width: ${a.sectionStrokeWidth};
504
+ fill: ${a.sectionFillColor};
505
+ }
506
+ .treemapNode.leaf {
507
+ stroke: ${a.leafStrokeColor};
508
+ stroke-width: ${a.leafStrokeWidth};
509
+ fill: ${a.leafFillColor};
510
+ }
511
+ .treemapLabel {
512
+ fill: ${a.labelColor};
513
+ font-size: ${a.labelFontSize};
514
+ }
515
+ .treemapValue {
516
+ fill: ${a.valueColor};
517
+ font-size: ${a.valueFontSize};
518
+ }
519
+ .treemapTitle {
520
+ fill: ${a.titleColor};
521
+ font-size: ${a.titleFontSize};
522
+ }
523
+ `;
524
+ }, "getStyles"), it = st, gt = {
525
+ parser: re,
526
+ get db() {
527
+ return new ne();
528
+ },
529
+ renderer: lt,
530
+ styles: it
531
+ };
532
+ export {
533
+ gt as diagram
534
+ };
src/backend/gradio_dropdownplus/templates/component/diagram-GUPCWM2R-SQr88ceg.js ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { p as B } from "./chunk-ANTBXLJU-CuGo78t3.js";
2
+ import { _ as b, D as m, H as C, e as S, l as w, b as D, a as T, p as E, q as F, g as P, s as z, E as A, F as W, y as _ } from "./mermaid.core-D58rAnek.js";
3
+ import { p as N } from "./treemap-75Q7IDZK-CIjK5oQY.js";
4
+ var L = W.packet, u, v = (u = class {
5
+ constructor() {
6
+ this.packet = [], this.setAccTitle = D, this.getAccTitle = T, this.setDiagramTitle = E, this.getDiagramTitle = F, this.getAccDescription = P, this.setAccDescription = z;
7
+ }
8
+ getConfig() {
9
+ const t = m({
10
+ ...L,
11
+ ...A().packet
12
+ });
13
+ return t.showBits && (t.paddingY += 10), t;
14
+ }
15
+ getPacket() {
16
+ return this.packet;
17
+ }
18
+ pushWord(t) {
19
+ t.length > 0 && this.packet.push(t);
20
+ }
21
+ clear() {
22
+ _(), this.packet = [];
23
+ }
24
+ }, b(u, "PacketDB"), u), M = 1e4, Y = /* @__PURE__ */ b((e, t) => {
25
+ B(e, t);
26
+ let s = -1, r = [], n = 1;
27
+ const { bitsPerRow: l } = t.getConfig();
28
+ for (let { start: a, end: i, bits: d, label: c } of e.blocks) {
29
+ if (a !== void 0 && i !== void 0 && i < a)
30
+ throw new Error(`Packet block ${a} - ${i} is invalid. End must be greater than start.`);
31
+ if (a ?? (a = s + 1), a !== s + 1)
32
+ throw new Error(
33
+ `Packet block ${a} - ${i ?? a} is not contiguous. It should start from ${s + 1}.`
34
+ );
35
+ if (d === 0)
36
+ throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);
37
+ for (i ?? (i = a + (d ?? 1) - 1), d ?? (d = i - a + 1), s = i, w.debug(`Packet block ${a} - ${s} with label ${c}`); r.length <= l + 1 && t.getPacket().length < M; ) {
38
+ const [p, o] = H({ start: a, end: i, bits: d, label: c }, n, l);
39
+ if (r.push(p), p.end + 1 === n * l && (t.pushWord(r), r = [], n++), !o)
40
+ break;
41
+ ({ start: a, end: i, bits: d, label: c } = o);
42
+ }
43
+ }
44
+ t.pushWord(r);
45
+ }, "populate"), H = /* @__PURE__ */ b((e, t, s) => {
46
+ if (e.start === void 0)
47
+ throw new Error("start should have been set during first phase");
48
+ if (e.end === void 0)
49
+ throw new Error("end should have been set during first phase");
50
+ if (e.start > e.end)
51
+ throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);
52
+ if (e.end + 1 <= t * s)
53
+ return [e, void 0];
54
+ const r = t * s - 1, n = t * s;
55
+ return [
56
+ {
57
+ start: e.start,
58
+ end: r,
59
+ label: e.label,
60
+ bits: r - e.start
61
+ },
62
+ {
63
+ start: n,
64
+ end: e.end,
65
+ label: e.label,
66
+ bits: e.end - n
67
+ }
68
+ ];
69
+ }, "getNextFittingBlock"), x = {
70
+ // @ts-expect-error - PacketDB is not assignable to DiagramDB
71
+ parser: { yy: void 0 },
72
+ parse: /* @__PURE__ */ b(async (e) => {
73
+ var r;
74
+ const t = await N("packet", e), s = (r = x.parser) == null ? void 0 : r.yy;
75
+ if (!(s instanceof v))
76
+ throw new Error(
77
+ "parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues."
78
+ );
79
+ w.debug(t), Y(t, s);
80
+ }, "parse")
81
+ }, I = /* @__PURE__ */ b((e, t, s, r) => {
82
+ const n = r.db, l = n.getConfig(), { rowHeight: a, paddingY: i, bitWidth: d, bitsPerRow: c } = l, p = n.getPacket(), o = n.getDiagramTitle(), h = a + i, g = h * (p.length + 1) - (o ? 0 : a), k = d * c + 2, f = C(t);
83
+ f.attr("viewbox", `0 0 ${k} ${g}`), S(f, g, k, l.useMaxWidth);
84
+ for (const [y, $] of p.entries())
85
+ O(f, $, y, l);
86
+ f.append("text").text(o).attr("x", k / 2).attr("y", g - h / 2).attr("dominant-baseline", "middle").attr("text-anchor", "middle").attr("class", "packetTitle");
87
+ }, "draw"), O = /* @__PURE__ */ b((e, t, s, { rowHeight: r, paddingX: n, paddingY: l, bitWidth: a, bitsPerRow: i, showBits: d }) => {
88
+ const c = e.append("g"), p = s * (r + l) + l;
89
+ for (const o of t) {
90
+ const h = o.start % i * a + 1, g = (o.end - o.start + 1) * a - n;
91
+ if (c.append("rect").attr("x", h).attr("y", p).attr("width", g).attr("height", r).attr("class", "packetBlock"), c.append("text").attr("x", h + g / 2).attr("y", p + r / 2).attr("class", "packetLabel").attr("dominant-baseline", "middle").attr("text-anchor", "middle").text(o.label), !d)
92
+ continue;
93
+ const k = o.end === o.start, f = p - 2;
94
+ c.append("text").attr("x", h + (k ? g / 2 : 0)).attr("y", f).attr("class", "packetByte start").attr("dominant-baseline", "auto").attr("text-anchor", k ? "middle" : "start").text(o.start), k || c.append("text").attr("x", h + g).attr("y", f).attr("class", "packetByte end").attr("dominant-baseline", "auto").attr("text-anchor", "end").text(o.end);
95
+ }
96
+ }, "drawWord"), j = { draw: I }, q = {
97
+ byteFontSize: "10px",
98
+ startByteColor: "black",
99
+ endByteColor: "black",
100
+ labelColor: "black",
101
+ labelFontSize: "12px",
102
+ titleColor: "black",
103
+ titleFontSize: "14px",
104
+ blockStrokeColor: "black",
105
+ blockStrokeWidth: "1",
106
+ blockFillColor: "#efefef"
107
+ }, G = /* @__PURE__ */ b(({ packet: e } = {}) => {
108
+ const t = m(q, e);
109
+ return `
110
+ .packetByte {
111
+ font-size: ${t.byteFontSize};
112
+ }
113
+ .packetByte.start {
114
+ fill: ${t.startByteColor};
115
+ }
116
+ .packetByte.end {
117
+ fill: ${t.endByteColor};
118
+ }
119
+ .packetLabel {
120
+ fill: ${t.labelColor};
121
+ font-size: ${t.labelFontSize};
122
+ }
123
+ .packetTitle {
124
+ fill: ${t.titleColor};
125
+ font-size: ${t.titleFontSize};
126
+ }
127
+ .packetBlock {
128
+ stroke: ${t.blockStrokeColor};
129
+ stroke-width: ${t.blockStrokeWidth};
130
+ fill: ${t.blockFillColor};
131
+ }
132
+ `;
133
+ }, "styles"), X = {
134
+ parser: x,
135
+ get db() {
136
+ return new v();
137
+ },
138
+ renderer: j,
139
+ styles: G
140
+ };
141
+ export {
142
+ X as diagram
143
+ };
src/backend/gradio_dropdownplus/templates/component/diagram-RP2FKANI-Bz21GoIH.js ADDED
@@ -0,0 +1,221 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { p as k } from "./chunk-ANTBXLJU-CuGo78t3.js";
2
+ 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-D58rAnek.js";
3
+ import { p as W } from "./treemap-75Q7IDZK-CIjK5oQY.js";
4
+ var x = {
5
+ showLegend: !0,
6
+ ticks: 5,
7
+ max: null,
8
+ min: 0,
9
+ graticule: "circle"
10
+ }, w = {
11
+ axes: [],
12
+ curves: [],
13
+ options: x
14
+ }, h = structuredClone(w), B = z.radar, j = /* @__PURE__ */ l(() => f({
15
+ ...B,
16
+ ...C().radar
17
+ }), "getConfig"), b = /* @__PURE__ */ l(() => h.axes, "getAxes"), q = /* @__PURE__ */ l(() => h.curves, "getCurves"), K = /* @__PURE__ */ l(() => h.options, "getOptions"), N = /* @__PURE__ */ l((a) => {
18
+ h.axes = a.map((t) => ({
19
+ name: t.name,
20
+ label: t.label ?? t.name
21
+ }));
22
+ }, "setAxes"), U = /* @__PURE__ */ l((a) => {
23
+ h.curves = a.map((t) => ({
24
+ name: t.name,
25
+ label: t.label ?? t.name,
26
+ entries: X(t.entries)
27
+ }));
28
+ }, "setCurves"), X = /* @__PURE__ */ l((a) => {
29
+ if (a[0].axis == null)
30
+ return a.map((e) => e.value);
31
+ const t = b();
32
+ if (t.length === 0)
33
+ throw new Error("Axes must be populated before curves for reference entries");
34
+ return t.map((e) => {
35
+ const r = a.find((s) => {
36
+ var o;
37
+ return ((o = s.axis) == null ? void 0 : o.$refText) === e.name;
38
+ });
39
+ if (r === void 0)
40
+ throw new Error("Missing entry for axis " + e.label);
41
+ return r.value;
42
+ });
43
+ }, "computeCurveEntries"), Y = /* @__PURE__ */ l((a) => {
44
+ var e, r, s, o, i;
45
+ const t = a.reduce(
46
+ (n, c) => (n[c.name] = c, n),
47
+ {}
48
+ );
49
+ h.options = {
50
+ showLegend: ((e = t.showLegend) == null ? void 0 : e.value) ?? x.showLegend,
51
+ ticks: ((r = t.ticks) == null ? void 0 : r.value) ?? x.ticks,
52
+ max: ((s = t.max) == null ? void 0 : s.value) ?? x.max,
53
+ min: ((o = t.min) == null ? void 0 : o.value) ?? x.min,
54
+ graticule: ((i = t.graticule) == null ? void 0 : i.value) ?? x.graticule
55
+ };
56
+ }, "setOptions"), Z = /* @__PURE__ */ l(() => {
57
+ P(), h = structuredClone(w);
58
+ }, "clear"), $ = {
59
+ getAxes: b,
60
+ getCurves: q,
61
+ getOptions: K,
62
+ setAxes: N,
63
+ setCurves: U,
64
+ setOptions: Y,
65
+ getConfig: j,
66
+ clear: Z,
67
+ setAccTitle: D,
68
+ getAccTitle: _,
69
+ setDiagramTitle: I,
70
+ getDiagramTitle: F,
71
+ getAccDescription: E,
72
+ setAccDescription: R
73
+ }, J = /* @__PURE__ */ l((a) => {
74
+ k(a, $);
75
+ const { axes: t, curves: e, options: r } = a;
76
+ $.setAxes(t), $.setCurves(e), $.setOptions(r);
77
+ }, "populate"), Q = {
78
+ parse: /* @__PURE__ */ l(async (a) => {
79
+ const t = await W("radar", a);
80
+ H.debug(t), J(t);
81
+ }, "parse")
82
+ }, tt = /* @__PURE__ */ l((a, t, e, r) => {
83
+ 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;
84
+ 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);
85
+ }, "draw"), et = /* @__PURE__ */ l((a, t) => {
86
+ const e = t.width + t.marginLeft + t.marginRight, r = t.height + t.marginTop + t.marginBottom, s = {
87
+ x: t.marginLeft + t.width / 2,
88
+ y: t.marginTop + t.height / 2
89
+ };
90
+ return a.attr("viewbox", `0 0 ${e} ${r}`).attr("width", e).attr("height", r), a.append("g").attr("transform", `translate(${s.x}, ${s.y})`);
91
+ }, "drawFrame"), at = /* @__PURE__ */ l((a, t, e, r, s) => {
92
+ if (s === "circle")
93
+ for (let o = 0; o < r; o++) {
94
+ const i = e * (o + 1) / r;
95
+ a.append("circle").attr("r", i).attr("class", "radarGraticule");
96
+ }
97
+ else if (s === "polygon") {
98
+ const o = t.length;
99
+ for (let i = 0; i < r; i++) {
100
+ const n = e * (i + 1) / r, c = t.map((d, p) => {
101
+ const u = 2 * p * Math.PI / o - Math.PI / 2, g = n * Math.cos(u), m = n * Math.sin(u);
102
+ return `${g},${m}`;
103
+ }).join(" ");
104
+ a.append("polygon").attr("points", c).attr("class", "radarGraticule");
105
+ }
106
+ }
107
+ }, "drawGraticule"), rt = /* @__PURE__ */ l((a, t, e, r) => {
108
+ const s = t.length;
109
+ for (let o = 0; o < s; o++) {
110
+ const i = t[o].label, n = 2 * o * Math.PI / s - Math.PI / 2;
111
+ 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");
112
+ }
113
+ }, "drawAxes");
114
+ function M(a, t, e, r, s, o, i) {
115
+ const n = t.length, c = Math.min(i.width, i.height) / 2;
116
+ e.forEach((d, p) => {
117
+ if (d.entries.length !== n)
118
+ return;
119
+ const u = d.entries.map((g, m) => {
120
+ 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);
121
+ return { x: O, y: S };
122
+ });
123
+ 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}`);
124
+ });
125
+ }
126
+ l(M, "drawCurves");
127
+ function A(a, t, e, r) {
128
+ const s = Math.min(Math.max(a, t), e);
129
+ return r * (s - t) / (e - t);
130
+ }
131
+ l(A, "relativeRadius");
132
+ function L(a, t) {
133
+ const e = a.length;
134
+ let r = `M${a[0].x},${a[0].y}`;
135
+ for (let s = 0; s < e; s++) {
136
+ const o = a[(s - 1 + e) % e], i = a[s], n = a[(s + 1) % e], c = a[(s + 2) % e], d = {
137
+ x: i.x + (n.x - o.x) * t,
138
+ y: i.y + (n.y - o.y) * t
139
+ }, p = {
140
+ x: n.x - (c.x - i.x) * t,
141
+ y: n.y - (c.y - i.y) * t
142
+ };
143
+ r += ` C${d.x},${d.y} ${p.x},${p.y} ${n.x},${n.y}`;
144
+ }
145
+ return `${r} Z`;
146
+ }
147
+ l(L, "closedRoundCurve");
148
+ function T(a, t, e, r) {
149
+ if (!e)
150
+ return;
151
+ const s = (r.width / 2 + r.marginRight) * 3 / 4, o = -(r.height / 2 + r.marginTop) * 3 / 4, i = 20;
152
+ t.forEach((n, c) => {
153
+ const d = a.append("g").attr("transform", `translate(${s}, ${o + c * i})`);
154
+ 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);
155
+ });
156
+ }
157
+ l(T, "drawLegend");
158
+ var st = { draw: tt }, nt = /* @__PURE__ */ l((a, t) => {
159
+ let e = "";
160
+ for (let r = 0; r < a.THEME_COLOR_LIMIT; r++) {
161
+ const s = a[`cScale${r}`];
162
+ e += `
163
+ .radarCurve-${r} {
164
+ color: ${s};
165
+ fill: ${s};
166
+ fill-opacity: ${t.curveOpacity};
167
+ stroke: ${s};
168
+ stroke-width: ${t.curveStrokeWidth};
169
+ }
170
+ .radarLegendBox-${r} {
171
+ fill: ${s};
172
+ fill-opacity: ${t.curveOpacity};
173
+ stroke: ${s};
174
+ }
175
+ `;
176
+ }
177
+ return e;
178
+ }, "genIndexStyles"), ot = /* @__PURE__ */ l((a) => {
179
+ const t = V(), e = C(), r = f(t, e.themeVariables), s = f(r.radar, a);
180
+ return { themeVariables: r, radarOptions: s };
181
+ }, "buildRadarStyleOptions"), it = /* @__PURE__ */ l(({ radar: a } = {}) => {
182
+ const { themeVariables: t, radarOptions: e } = ot(a);
183
+ return `
184
+ .radarTitle {
185
+ font-size: ${t.fontSize};
186
+ color: ${t.titleColor};
187
+ dominant-baseline: hanging;
188
+ text-anchor: middle;
189
+ }
190
+ .radarAxisLine {
191
+ stroke: ${e.axisColor};
192
+ stroke-width: ${e.axisStrokeWidth};
193
+ }
194
+ .radarAxisLabel {
195
+ dominant-baseline: middle;
196
+ text-anchor: middle;
197
+ font-size: ${e.axisLabelFontSize}px;
198
+ color: ${e.axisColor};
199
+ }
200
+ .radarGraticule {
201
+ fill: ${e.graticuleColor};
202
+ fill-opacity: ${e.graticuleOpacity};
203
+ stroke: ${e.graticuleColor};
204
+ stroke-width: ${e.graticuleStrokeWidth};
205
+ }
206
+ .radarLegendText {
207
+ text-anchor: start;
208
+ font-size: ${e.legendFontSize}px;
209
+ dominant-baseline: hanging;
210
+ }
211
+ ${nt(t, e)}
212
+ `;
213
+ }, "styles"), ut = {
214
+ parser: Q,
215
+ db: $,
216
+ renderer: st,
217
+ styles: it
218
+ };
219
+ export {
220
+ ut as diagram
221
+ };
src/backend/gradio_dropdownplus/templates/component/erDiagram-HZWUO2LU-BoS6ZeGH.js ADDED
@@ -0,0 +1,842 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { g as Dt } from "./chunk-WVR4S24B-Db-rMs1b.js";
2
+ import { s as wt } from "./chunk-NRVI72HA-EajhWFFL.js";
3
+ 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-D58rAnek.js";
4
+ import { c as Qt } from "./channel-B27Nc4fx.js";
5
+ var dt = function() {
6
+ var s = /* @__PURE__ */ u(function(R, n, a, c) {
7
+ for (a = a || {}, c = R.length; c--; a[R[c]] = n) ;
8
+ return a;
9
+ }, "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 = {
10
+ trace: /* @__PURE__ */ u(function() {
11
+ }, "trace"),
12
+ yy: {},
13
+ 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 },
14
+ 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" },
15
+ 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]],
16
+ performAction: /* @__PURE__ */ u(function(n, a, c, r, p, t, K) {
17
+ var e = t.length - 1;
18
+ switch (p) {
19
+ case 1:
20
+ break;
21
+ case 2:
22
+ this.$ = [];
23
+ break;
24
+ case 3:
25
+ t[e - 1].push(t[e]), this.$ = t[e - 1];
26
+ break;
27
+ case 4:
28
+ case 5:
29
+ this.$ = t[e];
30
+ break;
31
+ case 6:
32
+ case 7:
33
+ this.$ = [];
34
+ break;
35
+ case 8:
36
+ r.addEntity(t[e - 4]), r.addEntity(t[e - 2]), r.addRelationship(t[e - 4], t[e], t[e - 2], t[e - 3]);
37
+ break;
38
+ case 9:
39
+ 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]);
40
+ break;
41
+ case 10:
42
+ 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]);
43
+ break;
44
+ case 11:
45
+ 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]);
46
+ break;
47
+ case 12:
48
+ r.addEntity(t[e - 3]), r.addAttributes(t[e - 3], t[e - 1]);
49
+ break;
50
+ case 13:
51
+ r.addEntity(t[e - 5]), r.addAttributes(t[e - 5], t[e - 1]), r.setClass([t[e - 5]], t[e - 3]);
52
+ break;
53
+ case 14:
54
+ r.addEntity(t[e - 2]);
55
+ break;
56
+ case 15:
57
+ r.addEntity(t[e - 4]), r.setClass([t[e - 4]], t[e - 2]);
58
+ break;
59
+ case 16:
60
+ r.addEntity(t[e]);
61
+ break;
62
+ case 17:
63
+ r.addEntity(t[e - 2]), r.setClass([t[e - 2]], t[e]);
64
+ break;
65
+ case 18:
66
+ r.addEntity(t[e - 6], t[e - 4]), r.addAttributes(t[e - 6], t[e - 1]);
67
+ break;
68
+ case 19:
69
+ r.addEntity(t[e - 8], t[e - 6]), r.addAttributes(t[e - 8], t[e - 1]), r.setClass([t[e - 8]], t[e - 3]);
70
+ break;
71
+ case 20:
72
+ r.addEntity(t[e - 5], t[e - 3]);
73
+ break;
74
+ case 21:
75
+ r.addEntity(t[e - 7], t[e - 5]), r.setClass([t[e - 7]], t[e - 2]);
76
+ break;
77
+ case 22:
78
+ r.addEntity(t[e - 3], t[e - 1]);
79
+ break;
80
+ case 23:
81
+ r.addEntity(t[e - 5], t[e - 3]), r.setClass([t[e - 5]], t[e]);
82
+ break;
83
+ case 24:
84
+ case 25:
85
+ this.$ = t[e].trim(), r.setAccTitle(this.$);
86
+ break;
87
+ case 26:
88
+ case 27:
89
+ this.$ = t[e].trim(), r.setAccDescription(this.$);
90
+ break;
91
+ case 32:
92
+ r.setDirection("TB");
93
+ break;
94
+ case 33:
95
+ r.setDirection("BT");
96
+ break;
97
+ case 34:
98
+ r.setDirection("RL");
99
+ break;
100
+ case 35:
101
+ r.setDirection("LR");
102
+ break;
103
+ case 36:
104
+ this.$ = t[e - 3], r.addClass(t[e - 2], t[e - 1]);
105
+ break;
106
+ case 37:
107
+ case 38:
108
+ case 56:
109
+ case 64:
110
+ this.$ = [t[e]];
111
+ break;
112
+ case 39:
113
+ case 40:
114
+ this.$ = t[e - 2].concat([t[e]]);
115
+ break;
116
+ case 41:
117
+ this.$ = t[e - 2], r.setClass(t[e - 1], t[e]);
118
+ break;
119
+ case 42:
120
+ this.$ = t[e - 3], r.addCssStyles(t[e - 2], t[e - 1]);
121
+ break;
122
+ case 43:
123
+ this.$ = [t[e]];
124
+ break;
125
+ case 44:
126
+ t[e - 2].push(t[e]), this.$ = t[e - 2];
127
+ break;
128
+ case 46:
129
+ this.$ = t[e - 1] + t[e];
130
+ break;
131
+ case 54:
132
+ case 76:
133
+ case 77:
134
+ this.$ = t[e].replace(/"/g, "");
135
+ break;
136
+ case 55:
137
+ case 78:
138
+ this.$ = t[e];
139
+ break;
140
+ case 57:
141
+ t[e].push(t[e - 1]), this.$ = t[e];
142
+ break;
143
+ case 58:
144
+ this.$ = { type: t[e - 1], name: t[e] };
145
+ break;
146
+ case 59:
147
+ this.$ = { type: t[e - 2], name: t[e - 1], keys: t[e] };
148
+ break;
149
+ case 60:
150
+ this.$ = { type: t[e - 2], name: t[e - 1], comment: t[e] };
151
+ break;
152
+ case 61:
153
+ this.$ = { type: t[e - 3], name: t[e - 2], keys: t[e - 1], comment: t[e] };
154
+ break;
155
+ case 62:
156
+ case 63:
157
+ case 66:
158
+ this.$ = t[e];
159
+ break;
160
+ case 65:
161
+ t[e - 2].push(t[e]), this.$ = t[e - 2];
162
+ break;
163
+ case 67:
164
+ this.$ = t[e].replace(/"/g, "");
165
+ break;
166
+ case 68:
167
+ this.$ = { cardA: t[e], relType: t[e - 1], cardB: t[e - 2] };
168
+ break;
169
+ case 69:
170
+ this.$ = r.Cardinality.ZERO_OR_ONE;
171
+ break;
172
+ case 70:
173
+ this.$ = r.Cardinality.ZERO_OR_MORE;
174
+ break;
175
+ case 71:
176
+ this.$ = r.Cardinality.ONE_OR_MORE;
177
+ break;
178
+ case 72:
179
+ this.$ = r.Cardinality.ONLY_ONE;
180
+ break;
181
+ case 73:
182
+ this.$ = r.Cardinality.MD_PARENT;
183
+ break;
184
+ case 74:
185
+ this.$ = r.Identification.NON_IDENTIFYING;
186
+ break;
187
+ case 75:
188
+ this.$ = r.Identification.IDENTIFYING;
189
+ break;
190
+ }
191
+ }, "anonymous"),
192
+ 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])],
193
+ defaultActions: { 52: [2, 62], 72: [2, 57] },
194
+ parseError: /* @__PURE__ */ u(function(n, a) {
195
+ if (a.recoverable)
196
+ this.trace(n);
197
+ else {
198
+ var c = new Error(n);
199
+ throw c.hash = a, c;
200
+ }
201
+ }, "parseError"),
202
+ parse: /* @__PURE__ */ u(function(n) {
203
+ 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: {} };
204
+ for (var lt in this.yy)
205
+ Object.prototype.hasOwnProperty.call(this.yy, lt) && (x.yy[lt] = this.yy[lt]);
206
+ y.setInput(n, x.yy), x.yy.lexer = y, x.yy.parser = this, typeof y.yylloc > "u" && (y.yylloc = {});
207
+ var ot = y.yylloc;
208
+ t.push(ot);
209
+ var vt = y.options && y.options.ranges;
210
+ typeof x.yy.parseError == "function" ? this.parseError = x.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
211
+ function Ct(b) {
212
+ c.length = c.length - 2 * b, p.length = p.length - b, t.length = t.length - b;
213
+ }
214
+ u(Ct, "popStack");
215
+ function Ot() {
216
+ var b;
217
+ return b = r.pop() || y.lex() || Tt, typeof b != "number" && (b instanceof Array && (r = b, b = r.pop()), b = a.symbols_[b] || b), b;
218
+ }
219
+ u(Ot, "lex");
220
+ for (var g, I, m, ht, C = {}, J, k, At, $; ; ) {
221
+ 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]) {
222
+ var ut = "";
223
+ $ = [];
224
+ for (J in K[I])
225
+ this.terminals_[J] && J > xt && $.push("'" + this.terminals_[J] + "'");
226
+ y.showPosition ? ut = "Parse error on line " + (H + 1) + `:
227
+ ` + y.showPosition() + `
228
+ 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, {
229
+ text: y.match,
230
+ token: this.terminals_[g] || g,
231
+ line: y.yylineno,
232
+ loc: ot,
233
+ expected: $
234
+ });
235
+ }
236
+ if (m[0] instanceof Array && m.length > 1)
237
+ throw new Error("Parse Error: multiple actions possible at state: " + I + ", token: " + g);
238
+ switch (m[0]) {
239
+ case 1:
240
+ 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;
241
+ break;
242
+ case 2:
243
+ if (k = this.productions_[m[1]][1], C.$ = p[p.length - k], C._$ = {
244
+ first_line: t[t.length - (k || 1)].first_line,
245
+ last_line: t[t.length - 1].last_line,
246
+ first_column: t[t.length - (k || 1)].first_column,
247
+ last_column: t[t.length - 1].last_column
248
+ }, vt && (C._$.range = [
249
+ t[t.length - (k || 1)].range[0],
250
+ t[t.length - 1].range[1]
251
+ ]), ht = this.performAction.apply(C, [
252
+ e,
253
+ St,
254
+ H,
255
+ x.yy,
256
+ m[1],
257
+ p,
258
+ t
259
+ ].concat(It)), typeof ht < "u")
260
+ return ht;
261
+ 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);
262
+ break;
263
+ case 3:
264
+ return !0;
265
+ }
266
+ }
267
+ return !0;
268
+ }, "parse")
269
+ }, Rt = /* @__PURE__ */ function() {
270
+ var R = {
271
+ EOF: 1,
272
+ parseError: /* @__PURE__ */ u(function(a, c) {
273
+ if (this.yy.parser)
274
+ this.yy.parser.parseError(a, c);
275
+ else
276
+ throw new Error(a);
277
+ }, "parseError"),
278
+ // resets the lexer, sets new input
279
+ setInput: /* @__PURE__ */ u(function(n, a) {
280
+ 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 = {
281
+ first_line: 1,
282
+ first_column: 0,
283
+ last_line: 1,
284
+ last_column: 0
285
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
286
+ }, "setInput"),
287
+ // consumes and returns one char from the input
288
+ input: /* @__PURE__ */ u(function() {
289
+ var n = this._input[0];
290
+ this.yytext += n, this.yyleng++, this.offset++, this.match += n, this.matched += n;
291
+ var a = n.match(/(?:\r\n?|\n).*/g);
292
+ 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;
293
+ }, "input"),
294
+ // unshifts one char (or a string) into the input
295
+ unput: /* @__PURE__ */ u(function(n) {
296
+ var a = n.length, c = n.split(/(?:\r\n?|\n)/g);
297
+ this._input = n + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - a), this.offset -= a;
298
+ var r = this.match.split(/(?:\r\n?|\n)/g);
299
+ 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);
300
+ var p = this.yylloc.range;
301
+ return this.yylloc = {
302
+ first_line: this.yylloc.first_line,
303
+ last_line: this.yylineno + 1,
304
+ first_column: this.yylloc.first_column,
305
+ 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
306
+ }, this.options.ranges && (this.yylloc.range = [p[0], p[0] + this.yyleng - a]), this.yyleng = this.yytext.length, this;
307
+ }, "unput"),
308
+ // When called from action, caches matched text and appends it on next action
309
+ more: /* @__PURE__ */ u(function() {
310
+ return this._more = !0, this;
311
+ }, "more"),
312
+ // 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.
313
+ reject: /* @__PURE__ */ u(function() {
314
+ if (this.options.backtrack_lexer)
315
+ this._backtrack = !0;
316
+ else
317
+ 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).
318
+ ` + this.showPosition(), {
319
+ text: "",
320
+ token: null,
321
+ line: this.yylineno
322
+ });
323
+ return this;
324
+ }, "reject"),
325
+ // retain first n characters of the match
326
+ less: /* @__PURE__ */ u(function(n) {
327
+ this.unput(this.match.slice(n));
328
+ }, "less"),
329
+ // displays already matched input, i.e. for error messages
330
+ pastInput: /* @__PURE__ */ u(function() {
331
+ var n = this.matched.substr(0, this.matched.length - this.match.length);
332
+ return (n.length > 20 ? "..." : "") + n.substr(-20).replace(/\n/g, "");
333
+ }, "pastInput"),
334
+ // displays upcoming input, i.e. for error messages
335
+ upcomingInput: /* @__PURE__ */ u(function() {
336
+ var n = this.match;
337
+ return n.length < 20 && (n += this._input.substr(0, 20 - n.length)), (n.substr(0, 20) + (n.length > 20 ? "..." : "")).replace(/\n/g, "");
338
+ }, "upcomingInput"),
339
+ // displays the character position where the lexing error occurred, i.e. for error messages
340
+ showPosition: /* @__PURE__ */ u(function() {
341
+ var n = this.pastInput(), a = new Array(n.length + 1).join("-");
342
+ return n + this.upcomingInput() + `
343
+ ` + a + "^";
344
+ }, "showPosition"),
345
+ // test the lexed token: return FALSE when not a match, otherwise return token
346
+ test_match: /* @__PURE__ */ u(function(n, a) {
347
+ var c, r, p;
348
+ if (this.options.backtrack_lexer && (p = {
349
+ yylineno: this.yylineno,
350
+ yylloc: {
351
+ first_line: this.yylloc.first_line,
352
+ last_line: this.last_line,
353
+ first_column: this.yylloc.first_column,
354
+ last_column: this.yylloc.last_column
355
+ },
356
+ yytext: this.yytext,
357
+ match: this.match,
358
+ matches: this.matches,
359
+ matched: this.matched,
360
+ yyleng: this.yyleng,
361
+ offset: this.offset,
362
+ _more: this._more,
363
+ _input: this._input,
364
+ yy: this.yy,
365
+ conditionStack: this.conditionStack.slice(0),
366
+ done: this.done
367
+ }, 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 = {
368
+ first_line: this.yylloc.last_line,
369
+ last_line: this.yylineno + 1,
370
+ first_column: this.yylloc.last_column,
371
+ last_column: r ? r[r.length - 1].length - r[r.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + n[0].length
372
+ }, 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)
373
+ return c;
374
+ if (this._backtrack) {
375
+ for (var t in p)
376
+ this[t] = p[t];
377
+ return !1;
378
+ }
379
+ return !1;
380
+ }, "test_match"),
381
+ // return next match in input
382
+ next: /* @__PURE__ */ u(function() {
383
+ if (this.done)
384
+ return this.EOF;
385
+ this._input || (this.done = !0);
386
+ var n, a, c, r;
387
+ this._more || (this.yytext = "", this.match = "");
388
+ for (var p = this._currentRules(), t = 0; t < p.length; t++)
389
+ if (c = this._input.match(this.rules[p[t]]), c && (!a || c[0].length > a[0].length)) {
390
+ if (a = c, r = t, this.options.backtrack_lexer) {
391
+ if (n = this.test_match(c, p[t]), n !== !1)
392
+ return n;
393
+ if (this._backtrack) {
394
+ a = !1;
395
+ continue;
396
+ } else
397
+ return !1;
398
+ } else if (!this.options.flex)
399
+ break;
400
+ }
401
+ 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.
402
+ ` + this.showPosition(), {
403
+ text: "",
404
+ token: null,
405
+ line: this.yylineno
406
+ });
407
+ }, "next"),
408
+ // return next match that has a token
409
+ lex: /* @__PURE__ */ u(function() {
410
+ var a = this.next();
411
+ return a || this.lex();
412
+ }, "lex"),
413
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
414
+ begin: /* @__PURE__ */ u(function(a) {
415
+ this.conditionStack.push(a);
416
+ }, "begin"),
417
+ // pop the previously active lexer condition state off the condition stack
418
+ popState: /* @__PURE__ */ u(function() {
419
+ var a = this.conditionStack.length - 1;
420
+ return a > 0 ? this.conditionStack.pop() : this.conditionStack[0];
421
+ }, "popState"),
422
+ // produce the lexer rule set which is active for the currently active lexer condition state
423
+ _currentRules: /* @__PURE__ */ u(function() {
424
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
425
+ }, "_currentRules"),
426
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
427
+ topState: /* @__PURE__ */ u(function(a) {
428
+ return a = this.conditionStack.length - 1 - Math.abs(a || 0), a >= 0 ? this.conditionStack[a] : "INITIAL";
429
+ }, "topState"),
430
+ // alias for begin(condition)
431
+ pushState: /* @__PURE__ */ u(function(a) {
432
+ this.begin(a);
433
+ }, "pushState"),
434
+ // return the number of states currently on the stack
435
+ stateStackSize: /* @__PURE__ */ u(function() {
436
+ return this.conditionStack.length;
437
+ }, "stateStackSize"),
438
+ options: { "case-insensitive": !0 },
439
+ performAction: /* @__PURE__ */ u(function(a, c, r, p) {
440
+ switch (r) {
441
+ case 0:
442
+ return this.begin("acc_title"), 24;
443
+ case 1:
444
+ return this.popState(), "acc_title_value";
445
+ case 2:
446
+ return this.begin("acc_descr"), 26;
447
+ case 3:
448
+ return this.popState(), "acc_descr_value";
449
+ case 4:
450
+ this.begin("acc_descr_multiline");
451
+ break;
452
+ case 5:
453
+ this.popState();
454
+ break;
455
+ case 6:
456
+ return "acc_descr_multiline_value";
457
+ case 7:
458
+ return 33;
459
+ case 8:
460
+ return 34;
461
+ case 9:
462
+ return 35;
463
+ case 10:
464
+ return 36;
465
+ case 11:
466
+ return 10;
467
+ case 12:
468
+ break;
469
+ case 13:
470
+ return 8;
471
+ case 14:
472
+ return 50;
473
+ case 15:
474
+ return 70;
475
+ case 16:
476
+ return 4;
477
+ case 17:
478
+ return this.begin("block"), 17;
479
+ case 18:
480
+ return 49;
481
+ case 19:
482
+ return 49;
483
+ case 20:
484
+ return 42;
485
+ case 21:
486
+ return 15;
487
+ case 22:
488
+ return 13;
489
+ case 23:
490
+ break;
491
+ case 24:
492
+ return 59;
493
+ case 25:
494
+ return 56;
495
+ case 26:
496
+ return 56;
497
+ case 27:
498
+ return 60;
499
+ case 28:
500
+ break;
501
+ case 29:
502
+ return this.popState(), 19;
503
+ case 30:
504
+ return c.yytext[0];
505
+ case 31:
506
+ return 20;
507
+ case 32:
508
+ return 21;
509
+ case 33:
510
+ return this.begin("style"), 44;
511
+ case 34:
512
+ return this.popState(), 10;
513
+ case 35:
514
+ break;
515
+ case 36:
516
+ return 13;
517
+ case 37:
518
+ return 42;
519
+ case 38:
520
+ return 49;
521
+ case 39:
522
+ return this.begin("style"), 37;
523
+ case 40:
524
+ return 43;
525
+ case 41:
526
+ return 63;
527
+ case 42:
528
+ return 65;
529
+ case 43:
530
+ return 65;
531
+ case 44:
532
+ return 65;
533
+ case 45:
534
+ return 63;
535
+ case 46:
536
+ return 63;
537
+ case 47:
538
+ return 64;
539
+ case 48:
540
+ return 64;
541
+ case 49:
542
+ return 64;
543
+ case 50:
544
+ return 64;
545
+ case 51:
546
+ return 64;
547
+ case 52:
548
+ return 65;
549
+ case 53:
550
+ return 64;
551
+ case 54:
552
+ return 65;
553
+ case 55:
554
+ return 66;
555
+ case 56:
556
+ return 66;
557
+ case 57:
558
+ return 66;
559
+ case 58:
560
+ return 66;
561
+ case 59:
562
+ return 63;
563
+ case 60:
564
+ return 64;
565
+ case 61:
566
+ return 65;
567
+ case 62:
568
+ return 67;
569
+ case 63:
570
+ return 68;
571
+ case 64:
572
+ return 69;
573
+ case 65:
574
+ return 69;
575
+ case 66:
576
+ return 68;
577
+ case 67:
578
+ return 68;
579
+ case 68:
580
+ return 68;
581
+ case 69:
582
+ return 41;
583
+ case 70:
584
+ return 47;
585
+ case 71:
586
+ return 40;
587
+ case 72:
588
+ return 48;
589
+ case 73:
590
+ return c.yytext[0];
591
+ case 74:
592
+ return 6;
593
+ }
594
+ }, "anonymous"),
595
+ 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],
596
+ 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 } }
597
+ };
598
+ return R;
599
+ }();
600
+ ct.lexer = Rt;
601
+ function q() {
602
+ this.yy = {};
603
+ }
604
+ return u(q, "Parser"), q.prototype = ct, ct.Parser = q, new q();
605
+ }();
606
+ dt.parser = dt;
607
+ var Xt = dt, w, qt = (w = class {
608
+ constructor() {
609
+ this.entities = /* @__PURE__ */ new Map(), this.relationships = [], this.classes = /* @__PURE__ */ new Map(), this.direction = "TB", this.Cardinality = {
610
+ ZERO_OR_ONE: "ZERO_OR_ONE",
611
+ ZERO_OR_MORE: "ZERO_OR_MORE",
612
+ ONE_OR_MORE: "ONE_OR_MORE",
613
+ ONLY_ONE: "ONLY_ONE",
614
+ MD_PARENT: "MD_PARENT"
615
+ }, this.Identification = {
616
+ NON_IDENTIFYING: "NON_IDENTIFYING",
617
+ IDENTIFYING: "IDENTIFYING"
618
+ }, 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);
619
+ }
620
+ /**
621
+ * Add entity
622
+ * @param name - The name of the entity
623
+ * @param alias - The alias of the entity
624
+ */
625
+ addEntity(i, h = "") {
626
+ var d;
627
+ 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, {
628
+ id: `entity-${i}-${this.entities.size}`,
629
+ label: i,
630
+ attributes: [],
631
+ alias: h,
632
+ shape: "erBox",
633
+ look: tt().look ?? "default",
634
+ cssClasses: "default",
635
+ cssStyles: []
636
+ }), D.info("Added new entity :", i)), this.entities.get(i);
637
+ }
638
+ getEntity(i) {
639
+ return this.entities.get(i);
640
+ }
641
+ getEntities() {
642
+ return this.entities;
643
+ }
644
+ getClasses() {
645
+ return this.classes;
646
+ }
647
+ addAttributes(i, h) {
648
+ const d = this.addEntity(i);
649
+ let o;
650
+ for (o = h.length - 1; o >= 0; o--)
651
+ h[o].keys || (h[o].keys = []), h[o].comment || (h[o].comment = ""), d.attributes.push(h[o]), D.debug("Added attribute ", h[o].name);
652
+ }
653
+ /**
654
+ * Add a relationship
655
+ *
656
+ * @param entA - The first entity in the relationship
657
+ * @param rolA - The role played by the first entity in relation to the second
658
+ * @param entB - The second entity in the relationship
659
+ * @param rSpec - The details of the relationship between the two entities
660
+ */
661
+ addRelationship(i, h, d, o) {
662
+ const l = this.entities.get(i), f = this.entities.get(d);
663
+ if (!l || !f)
664
+ return;
665
+ const _ = {
666
+ entityA: l.id,
667
+ roleA: h,
668
+ entityB: f.id,
669
+ relSpec: o
670
+ };
671
+ this.relationships.push(_), D.debug("Added new relationship :", _);
672
+ }
673
+ getRelationships() {
674
+ return this.relationships;
675
+ }
676
+ getDirection() {
677
+ return this.direction;
678
+ }
679
+ setDirection(i) {
680
+ this.direction = i;
681
+ }
682
+ getCompiledStyles(i) {
683
+ let h = [];
684
+ for (const d of i) {
685
+ const o = this.classes.get(d);
686
+ o != null && o.styles && (h = [...h, ...o.styles ?? []].map((l) => l.trim())), o != null && o.textStyles && (h = [...h, ...o.textStyles ?? []].map((l) => l.trim()));
687
+ }
688
+ return h;
689
+ }
690
+ addCssStyles(i, h) {
691
+ for (const d of i) {
692
+ const o = this.entities.get(d);
693
+ if (!h || !o)
694
+ return;
695
+ for (const l of h)
696
+ o.cssStyles.push(l);
697
+ }
698
+ }
699
+ addClass(i, h) {
700
+ i.forEach((d) => {
701
+ let o = this.classes.get(d);
702
+ o === void 0 && (o = { id: d, styles: [], textStyles: [] }, this.classes.set(d, o)), h && h.forEach(function(l) {
703
+ if (/color/.exec(l)) {
704
+ const f = l.replace("fill", "bgFill");
705
+ o.textStyles.push(f);
706
+ }
707
+ o.styles.push(l);
708
+ });
709
+ });
710
+ }
711
+ setClass(i, h) {
712
+ for (const d of i) {
713
+ const o = this.entities.get(d);
714
+ if (o)
715
+ for (const l of h)
716
+ o.cssClasses += " " + l;
717
+ }
718
+ }
719
+ clear() {
720
+ this.entities = /* @__PURE__ */ new Map(), this.classes = /* @__PURE__ */ new Map(), this.relationships = [], Pt();
721
+ }
722
+ getData() {
723
+ const i = [], h = [], d = tt();
724
+ for (const l of this.entities.keys()) {
725
+ const f = this.entities.get(l);
726
+ f && (f.cssCompiledStyles = this.getCompiledStyles(f.cssClasses.split(" ")), i.push(f));
727
+ }
728
+ let o = 0;
729
+ for (const l of this.relationships) {
730
+ const f = {
731
+ id: zt(l.entityA, l.entityB, {
732
+ prefix: "id",
733
+ counter: o++
734
+ }),
735
+ type: "normal",
736
+ curve: "basis",
737
+ start: l.entityA,
738
+ end: l.entityB,
739
+ label: l.roleA,
740
+ labelpos: "c",
741
+ thickness: "normal",
742
+ classes: "relationshipLine",
743
+ arrowTypeStart: l.relSpec.cardB.toLowerCase(),
744
+ arrowTypeEnd: l.relSpec.cardA.toLowerCase(),
745
+ pattern: l.relSpec.relType == "IDENTIFYING" ? "solid" : "dashed",
746
+ look: d.look
747
+ };
748
+ h.push(f);
749
+ }
750
+ return { nodes: i, edges: h, other: {}, config: d, direction: "TB" };
751
+ }
752
+ }, u(w, "ErDB"), w), Nt = {};
753
+ Kt(Nt, {
754
+ draw: () => Ht
755
+ });
756
+ var Ht = /* @__PURE__ */ u(async function(s, i, h, d) {
757
+ D.info("REF0:"), D.info("Drawing er diagram (unified)", i);
758
+ const { securityLevel: o, er: l, layout: f } = tt(), _ = d.db.getData(), E = Dt(i, o);
759
+ _.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();
760
+ const V = E.selectAll('[id*="-background"]');
761
+ Array.from(V).length > 0 && V.each(function() {
762
+ const S = jt(this), U = S.attr("id").replace("-background", ""), T = E.select(`#${CSS.escape(U)}`);
763
+ if (!T.empty()) {
764
+ const L = T.attr("transform");
765
+ S.attr("transform", L);
766
+ }
767
+ });
768
+ const Z = 8;
769
+ Wt.insertTitle(
770
+ E,
771
+ "erDiagramTitleText",
772
+ (l == null ? void 0 : l.titleTopMargin) ?? 25,
773
+ d.db.getDiagramTitle()
774
+ ), wt(E, Z, "erDiagram", (l == null ? void 0 : l.useMaxWidth) ?? !0);
775
+ }, "draw"), Jt = /* @__PURE__ */ u((s, i) => {
776
+ const h = Qt, d = h(s, "r"), o = h(s, "g"), l = h(s, "b");
777
+ return Gt(d, o, l, i);
778
+ }, "fade"), $t = /* @__PURE__ */ u((s) => `
779
+ .entityBox {
780
+ fill: ${s.mainBkg};
781
+ stroke: ${s.nodeBorder};
782
+ }
783
+
784
+ .relationshipLabelBox {
785
+ fill: ${s.tertiaryColor};
786
+ opacity: 0.7;
787
+ background-color: ${s.tertiaryColor};
788
+ rect {
789
+ opacity: 0.5;
790
+ }
791
+ }
792
+
793
+ .labelBkg {
794
+ background-color: ${Jt(s.tertiaryColor, 0.5)};
795
+ }
796
+
797
+ .edgeLabel .label {
798
+ fill: ${s.nodeBorder};
799
+ font-size: 14px;
800
+ }
801
+
802
+ .label {
803
+ font-family: ${s.fontFamily};
804
+ color: ${s.nodeTextColor || s.textColor};
805
+ }
806
+
807
+ .edge-pattern-dashed {
808
+ stroke-dasharray: 8,8;
809
+ }
810
+
811
+ .node rect,
812
+ .node circle,
813
+ .node ellipse,
814
+ .node polygon
815
+ {
816
+ fill: ${s.mainBkg};
817
+ stroke: ${s.nodeBorder};
818
+ stroke-width: 1px;
819
+ }
820
+
821
+ .relationshipLine {
822
+ stroke: ${s.lineColor};
823
+ stroke-width: 1;
824
+ fill: none;
825
+ }
826
+
827
+ .marker {
828
+ fill: none !important;
829
+ stroke: ${s.lineColor} !important;
830
+ stroke-width: 1;
831
+ }
832
+ `, "getStyles"), te = $t, ne = {
833
+ parser: Xt,
834
+ get db() {
835
+ return new qt();
836
+ },
837
+ renderer: Nt,
838
+ styles: te
839
+ };
840
+ export {
841
+ ne as diagram
842
+ };
src/backend/gradio_dropdownplus/templates/component/flowDiagram-THRYKUMA-B-Hn5QRu.js ADDED
@@ -0,0 +1,1627 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { g as qt } from "./chunk-GLLZNHP4-BcJ3UCJy.js";
2
+ 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-D58rAnek.js";
3
+ import { g as le } from "./chunk-WVR4S24B-Db-rMs1b.js";
4
+ import { s as ce } from "./chunk-NRVI72HA-EajhWFFL.js";
5
+ import { c as he } from "./channel-B27Nc4fx.js";
6
+ var de = "flowchart-", P1, pe = (P1 = class {
7
+ // cspell:ignore funs
8
+ constructor() {
9
+ 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 = {
10
+ firstGraph: this.firstGraph.bind(this)
11
+ }, this.clear(), this.setGen("gen-2");
12
+ }
13
+ sanitizeText(i) {
14
+ return se.sanitizeText(i, this.config);
15
+ }
16
+ /**
17
+ * Function to lookup domId from id in the graph definition.
18
+ *
19
+ * @param id - id of the node
20
+ */
21
+ lookUpDomId(i) {
22
+ for (const a of this.vertices.values())
23
+ if (a.id === i)
24
+ return a.domId;
25
+ return i;
26
+ }
27
+ /**
28
+ * Function called by parser when a node definition has been found
29
+ */
30
+ addVertex(i, a, n, u, o, f, c = {}, A) {
31
+ var L, C;
32
+ if (!i || i.trim().length === 0)
33
+ return;
34
+ let r;
35
+ if (A !== void 0) {
36
+ let d;
37
+ A.includes(`
38
+ `) ? d = A + `
39
+ ` : d = `{
40
+ ` + A + `
41
+ }`, r = ie(d, { schema: re });
42
+ }
43
+ const k = this.edges.find((d) => d.id === i);
44
+ if (k) {
45
+ const d = r;
46
+ (d == null ? void 0 : d.animate) !== void 0 && (k.animate = d.animate), (d == null ? void 0 : d.animation) !== void 0 && (k.animation = d.animation), (d == null ? void 0 : d.curve) !== void 0 && (k.interpolate = d.curve);
47
+ return;
48
+ }
49
+ let E, b = this.vertices.get(i);
50
+ if (b === void 0 && (b = {
51
+ id: i,
52
+ labelType: "text",
53
+ domId: de + i + "-" + this.vertexCounter,
54
+ styles: [],
55
+ classes: []
56
+ }, 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((d) => {
57
+ b.styles.push(d);
58
+ }), o != null && o.forEach((d) => {
59
+ b.classes.push(d);
60
+ }), f !== void 0 && (b.dir = f), b.props === void 0 ? b.props = c : c !== void 0 && Object.assign(b.props, c), r !== void 0) {
61
+ if (r.shape) {
62
+ if (r.shape !== r.shape.toLowerCase() || r.shape.includes("_"))
63
+ throw new Error(`No such shape: ${r.shape}. Shape names should be lowercase.`);
64
+ if (!ae(r.shape))
65
+ throw new Error(`No such shape: ${r.shape}.`);
66
+ b.type = r == null ? void 0 : r.shape;
67
+ }
68
+ 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));
69
+ }
70
+ }
71
+ /**
72
+ * Function called by parser when a link/edge definition has been found
73
+ *
74
+ */
75
+ addSingleLink(i, a, n, u) {
76
+ const c = {
77
+ start: i,
78
+ end: a,
79
+ type: void 0,
80
+ text: "",
81
+ labelType: "text",
82
+ classes: [],
83
+ isUserDefinedId: !1,
84
+ interpolate: this.edges.defaultInterpolate
85
+ };
86
+ t1.info("abc78 Got edge...", c);
87
+ const A = n.text;
88
+ 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))
89
+ c.id = u, c.isUserDefinedId = !0;
90
+ else {
91
+ const r = this.edges.filter((k) => k.start === c.start && k.end === c.end);
92
+ r.length === 0 ? c.id = st(c.start, c.end, { counter: 0, prefix: "L" }) : c.id = st(c.start, c.end, {
93
+ counter: r.length + 1,
94
+ prefix: "L"
95
+ });
96
+ }
97
+ if (this.edges.length < (this.config.maxEdges ?? 500))
98
+ t1.info("Pushing edge..."), this.edges.push(c);
99
+ else
100
+ throw new Error(
101
+ `Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.
102
+
103
+ Initialize mermaid with maxEdges set to a higher number to allow more edges.
104
+ You cannot set this config via configuration inside the diagram as it is a secure config.
105
+ You have to call mermaid.initialize.`
106
+ );
107
+ }
108
+ isLinkData(i) {
109
+ return i !== null && typeof i == "object" && "id" in i && typeof i.id == "string";
110
+ }
111
+ addLink(i, a, n) {
112
+ const u = this.isLinkData(n) ? n.id.replace("@", "") : void 0;
113
+ t1.info("addLink", i, a, u);
114
+ for (const o of i)
115
+ for (const f of a) {
116
+ const c = o === i[i.length - 1], A = f === a[0];
117
+ c && A ? this.addSingleLink(o, f, n, u) : this.addSingleLink(o, f, n, void 0);
118
+ }
119
+ }
120
+ /**
121
+ * Updates a link's line interpolation algorithm
122
+ */
123
+ updateLinkInterpolate(i, a) {
124
+ i.forEach((n) => {
125
+ n === "default" ? this.edges.defaultInterpolate = a : this.edges[n].interpolate = a;
126
+ });
127
+ }
128
+ /**
129
+ * Updates a link with a style
130
+ *
131
+ */
132
+ updateLink(i, a) {
133
+ i.forEach((n) => {
134
+ var u, o, f, c, A, r;
135
+ if (typeof n == "number" && n >= this.edges.length)
136
+ throw new Error(
137
+ `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.)`
138
+ );
139
+ 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")));
140
+ });
141
+ }
142
+ addClass(i, a) {
143
+ const n = a.join().replace(/\\,/g, "§§§").replace(/,/g, ";").replace(/§§§/g, ",").split(";");
144
+ i.split(",").forEach((u) => {
145
+ let o = this.classes.get(u);
146
+ o === void 0 && (o = { id: u, styles: [], textStyles: [] }, this.classes.set(u, o)), n != null && n.forEach((f) => {
147
+ if (/color/.exec(f)) {
148
+ const c = f.replace("fill", "bgFill");
149
+ o.textStyles.push(c);
150
+ }
151
+ o.styles.push(f);
152
+ });
153
+ });
154
+ }
155
+ /**
156
+ * Called by parser when a graph definition is found, stores the direction of the chart.
157
+ *
158
+ */
159
+ setDirection(i) {
160
+ this.direction = i.trim(), /.*</.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");
161
+ }
162
+ /**
163
+ * Called by parser when a special node is found, e.g. a clickable element.
164
+ *
165
+ * @param ids - Comma separated list of ids
166
+ * @param className - Class to add
167
+ */
168
+ setClass(i, a) {
169
+ for (const n of i.split(",")) {
170
+ const u = this.vertices.get(n);
171
+ u && u.classes.push(a);
172
+ const o = this.edges.find((c) => c.id === n);
173
+ o && o.classes.push(a);
174
+ const f = this.subGraphLookup.get(n);
175
+ f && f.classes.push(a);
176
+ }
177
+ }
178
+ setTooltip(i, a) {
179
+ if (a !== void 0) {
180
+ a = this.sanitizeText(a);
181
+ for (const n of i.split(","))
182
+ this.tooltips.set(this.version === "gen-1" ? this.lookUpDomId(n) : n, a);
183
+ }
184
+ }
185
+ setClickFun(i, a, n) {
186
+ const u = this.lookUpDomId(i);
187
+ if (b1().securityLevel !== "loose" || a === void 0)
188
+ return;
189
+ let o = [];
190
+ if (typeof n == "string") {
191
+ o = n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
192
+ for (let c = 0; c < o.length; c++) {
193
+ let A = o[c].trim();
194
+ A.startsWith('"') && A.endsWith('"') && (A = A.substr(1, A.length - 2)), o[c] = A;
195
+ }
196
+ }
197
+ o.length === 0 && o.push(i);
198
+ const f = this.vertices.get(i);
199
+ f && (f.haveCallback = !0, this.funs.push(() => {
200
+ const c = document.querySelector(`[id="${u}"]`);
201
+ c !== null && c.addEventListener(
202
+ "click",
203
+ () => {
204
+ it.runFunc(a, ...o);
205
+ },
206
+ !1
207
+ );
208
+ }));
209
+ }
210
+ /**
211
+ * Called by parser when a link is found. Adds the URL to the vertex data.
212
+ *
213
+ * @param ids - Comma separated list of ids
214
+ * @param linkStr - URL to create a link for
215
+ * @param target - Target attribute for the link
216
+ */
217
+ setLink(i, a, n) {
218
+ i.split(",").forEach((u) => {
219
+ const o = this.vertices.get(u);
220
+ o !== void 0 && (o.link = it.formatUrl(a, this.config), o.linkTarget = n);
221
+ }), this.setClass(i, "clickable");
222
+ }
223
+ getTooltip(i) {
224
+ return this.tooltips.get(i);
225
+ }
226
+ /**
227
+ * Called by parser when a click definition is found. Registers an event handler.
228
+ *
229
+ * @param ids - Comma separated list of ids
230
+ * @param functionName - Function to be called on click
231
+ * @param functionArgs - Arguments to be passed to the function
232
+ */
233
+ setClickEvent(i, a, n) {
234
+ i.split(",").forEach((u) => {
235
+ this.setClickFun(u, a, n);
236
+ }), this.setClass(i, "clickable");
237
+ }
238
+ bindFunctions(i) {
239
+ this.funs.forEach((a) => {
240
+ a(i);
241
+ });
242
+ }
243
+ getDirection() {
244
+ var i;
245
+ return (i = this.direction) == null ? void 0 : i.trim();
246
+ }
247
+ /**
248
+ * Retrieval function for fetching the found nodes after parsing has completed.
249
+ *
250
+ */
251
+ getVertices() {
252
+ return this.vertices;
253
+ }
254
+ /**
255
+ * Retrieval function for fetching the found links after parsing has completed.
256
+ *
257
+ */
258
+ getEdges() {
259
+ return this.edges;
260
+ }
261
+ /**
262
+ * Retrieval function for fetching the found class definitions after parsing has completed.
263
+ *
264
+ */
265
+ getClasses() {
266
+ return this.classes;
267
+ }
268
+ setupToolTips(i) {
269
+ let a = S1(".mermaidTooltip");
270
+ (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) => {
271
+ var r;
272
+ const f = S1(o.currentTarget);
273
+ if (f.attr("title") === null)
274
+ return;
275
+ const A = (r = o.currentTarget) == null ? void 0 : r.getBoundingClientRect();
276
+ 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(/&lt;br\/&gt;/g, "<br/>")), f.classed("hover", !0);
277
+ }).on("mouseout", (o) => {
278
+ a.transition().duration(500).style("opacity", 0), S1(o.currentTarget).classed("hover", !1);
279
+ });
280
+ }
281
+ /**
282
+ * Clears the internal graph db so that a new graph can be parsed.
283
+ *
284
+ */
285
+ clear(i = "gen-2") {
286
+ 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();
287
+ }
288
+ setGen(i) {
289
+ this.version = i || "gen-2";
290
+ }
291
+ defaultStyle() {
292
+ return "fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;";
293
+ }
294
+ addSubGraph(i, a, n) {
295
+ let u = i.text.trim(), o = n.text;
296
+ i === n && /\s/.exec(n.text) && (u = void 0);
297
+ const c = (/* @__PURE__ */ m((b) => {
298
+ const L = { boolean: {}, number: {}, string: {} }, C = [];
299
+ let d;
300
+ return { nodeList: b.filter(function(W) {
301
+ const Z = typeof W;
302
+ return W.stmt && W.stmt === "dir" ? (d = 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);
303
+ }), dir: d };
304
+ }, "uniq"))(a.flat()), A = c.nodeList;
305
+ let r = c.dir;
306
+ const k = b1().flowchart ?? {};
307
+ if (r = r ?? (k.inheritDir ? this.getDirection() ?? b1().direction ?? void 0 : void 0), this.version === "gen-1")
308
+ for (let b = 0; b < A.length; b++)
309
+ A[b] = this.lookUpDomId(A[b]);
310
+ u = u ?? "subGraph" + this.subCount, o = o || "", o = this.sanitizeText(o), this.subCount = this.subCount + 1;
311
+ const E = {
312
+ id: u,
313
+ nodes: A,
314
+ title: o.trim(),
315
+ classes: [],
316
+ dir: r,
317
+ labelType: n.type
318
+ };
319
+ 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;
320
+ }
321
+ getPosForId(i) {
322
+ for (const [a, n] of this.subGraphs.entries())
323
+ if (n.id === i)
324
+ return a;
325
+ return -1;
326
+ }
327
+ indexNodes2(i, a) {
328
+ const n = this.subGraphs[a].nodes;
329
+ if (this.secCount = this.secCount + 1, this.secCount > 2e3)
330
+ return {
331
+ result: !1,
332
+ count: 0
333
+ };
334
+ if (this.posCrossRef[this.secCount] = a, this.subGraphs[a].id === i)
335
+ return {
336
+ result: !0,
337
+ count: 0
338
+ };
339
+ let u = 0, o = 1;
340
+ for (; u < n.length; ) {
341
+ const f = this.getPosForId(n[u]);
342
+ if (f >= 0) {
343
+ const c = this.indexNodes2(i, f);
344
+ if (c.result)
345
+ return {
346
+ result: !0,
347
+ count: o + c.count
348
+ };
349
+ o = o + c.count;
350
+ }
351
+ u = u + 1;
352
+ }
353
+ return {
354
+ result: !1,
355
+ count: o
356
+ };
357
+ }
358
+ getDepthFirstPos(i) {
359
+ return this.posCrossRef[i];
360
+ }
361
+ indexNodes() {
362
+ this.secCount = -1, this.subGraphs.length > 0 && this.indexNodes2("none", this.subGraphs.length - 1);
363
+ }
364
+ getSubGraphs() {
365
+ return this.subGraphs;
366
+ }
367
+ firstGraph() {
368
+ return this.firstGraphFlag ? (this.firstGraphFlag = !1, !0) : !1;
369
+ }
370
+ destructStartLink(i) {
371
+ let a = i.trim(), n = "arrow_open";
372
+ switch (a[0]) {
373
+ case "<":
374
+ n = "arrow_point", a = a.slice(1);
375
+ break;
376
+ case "x":
377
+ n = "arrow_cross", a = a.slice(1);
378
+ break;
379
+ case "o":
380
+ n = "arrow_circle", a = a.slice(1);
381
+ break;
382
+ }
383
+ let u = "normal";
384
+ return a.includes("=") && (u = "thick"), a.includes(".") && (u = "dotted"), { type: n, stroke: u };
385
+ }
386
+ countChar(i, a) {
387
+ const n = a.length;
388
+ let u = 0;
389
+ for (let o = 0; o < n; ++o)
390
+ a[o] === i && ++u;
391
+ return u;
392
+ }
393
+ destructEndLink(i) {
394
+ const a = i.trim();
395
+ let n = a.slice(0, -1), u = "arrow_open";
396
+ switch (a.slice(-1)) {
397
+ case "x":
398
+ u = "arrow_cross", a.startsWith("x") && (u = "double_" + u, n = n.slice(1));
399
+ break;
400
+ case ">":
401
+ u = "arrow_point", a.startsWith("<") && (u = "double_" + u, n = n.slice(1));
402
+ break;
403
+ case "o":
404
+ u = "arrow_circle", a.startsWith("o") && (u = "double_" + u, n = n.slice(1));
405
+ break;
406
+ }
407
+ let o = "normal", f = n.length - 1;
408
+ n.startsWith("=") && (o = "thick"), n.startsWith("~") && (o = "invisible");
409
+ const c = this.countChar(".", n);
410
+ return c && (o = "dotted", f = c), { type: u, stroke: o, length: f };
411
+ }
412
+ destructLink(i, a) {
413
+ const n = this.destructEndLink(i);
414
+ let u;
415
+ if (a) {
416
+ if (u = this.destructStartLink(a), u.stroke !== n.stroke)
417
+ return { type: "INVALID", stroke: "INVALID" };
418
+ if (u.type === "arrow_open")
419
+ u.type = n.type;
420
+ else {
421
+ if (u.type !== n.type)
422
+ return { type: "INVALID", stroke: "INVALID" };
423
+ u.type = "double_" + u.type;
424
+ }
425
+ return u.type === "double_arrow" && (u.type = "double_arrow_point"), u.length = n.length, u;
426
+ }
427
+ return n;
428
+ }
429
+ // Todo optimizer this by caching existing nodes
430
+ exists(i, a) {
431
+ for (const n of i)
432
+ if (n.nodes.includes(a))
433
+ return !0;
434
+ return !1;
435
+ }
436
+ /**
437
+ * Deletes an id from all subgraphs
438
+ *
439
+ */
440
+ makeUniq(i, a) {
441
+ const n = [];
442
+ return i.nodes.forEach((u, o) => {
443
+ this.exists(a, u) || n.push(i.nodes[o]);
444
+ }), { nodes: n };
445
+ }
446
+ getTypeFromVertex(i) {
447
+ if (i.img)
448
+ return "imageSquare";
449
+ if (i.icon)
450
+ return i.form === "circle" ? "iconCircle" : i.form === "square" ? "iconSquare" : i.form === "rounded" ? "iconRounded" : "icon";
451
+ switch (i.type) {
452
+ case "square":
453
+ case void 0:
454
+ return "squareRect";
455
+ case "round":
456
+ return "roundedRect";
457
+ case "ellipse":
458
+ return "ellipse";
459
+ default:
460
+ return i.type;
461
+ }
462
+ }
463
+ findNode(i, a) {
464
+ return i.find((n) => n.id === a);
465
+ }
466
+ destructEdgeType(i) {
467
+ let a = "none", n = "arrow_point";
468
+ switch (i) {
469
+ case "arrow_point":
470
+ case "arrow_circle":
471
+ case "arrow_cross":
472
+ n = i;
473
+ break;
474
+ case "double_arrow_point":
475
+ case "double_arrow_circle":
476
+ case "double_arrow_cross":
477
+ a = i.replace("double_", ""), n = a;
478
+ break;
479
+ }
480
+ return { arrowTypeStart: a, arrowTypeEnd: n };
481
+ }
482
+ addNodeFromVertex(i, a, n, u, o, f) {
483
+ var k;
484
+ const c = n.get(i.id), A = u.get(i.id) ?? !1, r = this.findNode(a, i.id);
485
+ if (r)
486
+ r.cssStyles = i.styles, r.cssCompiledStyles = this.getCompiledStyles(i.classes), r.cssClasses = i.classes.join(" ");
487
+ else {
488
+ const E = {
489
+ id: i.id,
490
+ label: i.text,
491
+ labelStyle: "",
492
+ parentId: c,
493
+ padding: ((k = o.flowchart) == null ? void 0 : k.padding) || 8,
494
+ cssStyles: i.styles,
495
+ cssCompiledStyles: this.getCompiledStyles(["default", "node", ...i.classes]),
496
+ cssClasses: "default " + i.classes.join(" "),
497
+ dir: i.dir,
498
+ domId: i.domId,
499
+ look: f,
500
+ link: i.link,
501
+ linkTarget: i.linkTarget,
502
+ tooltip: this.getTooltip(i.id),
503
+ icon: i.icon,
504
+ pos: i.pos,
505
+ img: i.img,
506
+ assetWidth: i.assetWidth,
507
+ assetHeight: i.assetHeight,
508
+ constraint: i.constraint
509
+ };
510
+ A ? a.push({
511
+ ...E,
512
+ isGroup: !0,
513
+ shape: "rect"
514
+ }) : a.push({
515
+ ...E,
516
+ isGroup: !1,
517
+ shape: this.getTypeFromVertex(i)
518
+ });
519
+ }
520
+ }
521
+ getCompiledStyles(i) {
522
+ let a = [];
523
+ for (const n of i) {
524
+ const u = this.classes.get(n);
525
+ u != null && u.styles && (a = [...a, ...u.styles ?? []].map((o) => o.trim())), u != null && u.textStyles && (a = [...a, ...u.textStyles ?? []].map((o) => o.trim()));
526
+ }
527
+ return a;
528
+ }
529
+ getData() {
530
+ const i = b1(), a = [], n = [], u = this.getSubGraphs(), o = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
531
+ for (let r = u.length - 1; r >= 0; r--) {
532
+ const k = u[r];
533
+ k.nodes.length > 0 && f.set(k.id, !0);
534
+ for (const E of k.nodes)
535
+ o.set(E, k.id);
536
+ }
537
+ for (let r = u.length - 1; r >= 0; r--) {
538
+ const k = u[r];
539
+ a.push({
540
+ id: k.id,
541
+ label: k.title,
542
+ labelStyle: "",
543
+ parentId: o.get(k.id),
544
+ padding: 8,
545
+ cssCompiledStyles: this.getCompiledStyles(k.classes),
546
+ cssClasses: k.classes.join(" "),
547
+ shape: "rect",
548
+ dir: k.dir,
549
+ isGroup: !0,
550
+ look: i.look
551
+ });
552
+ }
553
+ this.getVertices().forEach((r) => {
554
+ this.addNodeFromVertex(r, a, o, f, i, i.look || "classic");
555
+ });
556
+ const A = this.getEdges();
557
+ return A.forEach((r, k) => {
558
+ var d;
559
+ const { arrowTypeStart: E, arrowTypeEnd: b } = this.destructEdgeType(r.type), L = [...A.defaultStyle ?? []];
560
+ r.style && L.push(...r.style);
561
+ const C = {
562
+ id: st(r.start, r.end, { counter: k, prefix: "L" }, r.id),
563
+ isUserDefinedId: r.isUserDefinedId,
564
+ start: r.start,
565
+ end: r.end,
566
+ type: r.type ?? "normal",
567
+ label: r.text,
568
+ labelpos: "c",
569
+ thickness: r.stroke,
570
+ minlen: r.length,
571
+ classes: (r == null ? void 0 : r.stroke) === "invisible" ? "" : "edge-thickness-normal edge-pattern-solid flowchart-link",
572
+ arrowTypeStart: (r == null ? void 0 : r.stroke) === "invisible" || (r == null ? void 0 : r.type) === "arrow_open" ? "none" : E,
573
+ arrowTypeEnd: (r == null ? void 0 : r.stroke) === "invisible" || (r == null ? void 0 : r.type) === "arrow_open" ? "none" : b,
574
+ arrowheadStyle: "fill: #333",
575
+ cssCompiledStyles: this.getCompiledStyles(r.classes),
576
+ labelStyle: L,
577
+ style: L,
578
+ pattern: r.stroke,
579
+ look: i.look,
580
+ animate: r.animate,
581
+ animation: r.animation,
582
+ curve: r.interpolate || this.edges.defaultInterpolate || ((d = i.flowchart) == null ? void 0 : d.curve)
583
+ };
584
+ n.push(C);
585
+ }), { nodes: a, edges: n, other: {}, config: i };
586
+ }
587
+ defaultConfig() {
588
+ return ue.flowchart;
589
+ }
590
+ }, m(P1, "FlowDB"), P1), fe = /* @__PURE__ */ m(function(s, i) {
591
+ return i.db.getClasses();
592
+ }, "getClasses"), ge = /* @__PURE__ */ m(async function(s, i, a, n) {
593
+ var L;
594
+ t1.info("REF0:"), t1.info("Drawing state diagram (v2)", i);
595
+ const { securityLevel: u, flowchart: o, layout: f } = b1();
596
+ let c;
597
+ u === "sandbox" && (c = S1("#i" + i));
598
+ const A = u === "sandbox" ? c.nodes()[0].contentDocument : document;
599
+ t1.debug("Before getData: ");
600
+ const r = n.db.getData();
601
+ t1.debug("Data: ", r);
602
+ const k = le(i, u), E = n.db.getDirection();
603
+ r.type = n.type, r.layoutAlgorithm = Ht(f), r.layoutAlgorithm === "dagre" && f === "elk" && t1.warn(
604
+ "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."
605
+ ), 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);
606
+ const b = ((L = r.config.flowchart) == null ? void 0 : L.diagramPadding) ?? 8;
607
+ it.insertTitle(
608
+ k,
609
+ "flowchartTitleText",
610
+ (o == null ? void 0 : o.titleTopMargin) || 0,
611
+ n.db.getDiagramTitle()
612
+ ), ce(k, b, "flowchart", (o == null ? void 0 : o.useMaxWidth) || !1);
613
+ for (const C of r.nodes) {
614
+ const d = S1(`#${i} [id="${C.id}"]`);
615
+ if (!d || !C.link)
616
+ continue;
617
+ const J = A.createElementNS("http://www.w3.org/2000/svg", "a");
618
+ 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);
619
+ const W = d.insert(function() {
620
+ return J;
621
+ }, ":first-child"), Z = d.select(".label-container");
622
+ Z && W.append(function() {
623
+ return Z.node();
624
+ });
625
+ const A1 = d.select(".label");
626
+ A1 && W.append(function() {
627
+ return A1.node();
628
+ });
629
+ }
630
+ }, "draw"), be = {
631
+ getClasses: fe,
632
+ draw: ge
633
+ }, rt = function() {
634
+ var s = /* @__PURE__ */ m(function(g1, h, p, g) {
635
+ for (p = p || {}, g = g1.length; g--; p[g1[g]] = h) ;
636
+ return p;
637
+ }, "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], d = [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 = {
638
+ trace: /* @__PURE__ */ m(function() {
639
+ }, "trace"),
640
+ yy: {},
641
+ 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 },
642
+ 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" },
643
+ 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]],
644
+ performAction: /* @__PURE__ */ m(function(h, p, g, l, _, t, O1) {
645
+ var e = t.length - 1;
646
+ switch (_) {
647
+ case 2:
648
+ this.$ = [];
649
+ break;
650
+ case 3:
651
+ (!Array.isArray(t[e]) || t[e].length > 0) && t[e - 1].push(t[e]), this.$ = t[e - 1];
652
+ break;
653
+ case 4:
654
+ case 183:
655
+ this.$ = t[e];
656
+ break;
657
+ case 11:
658
+ l.setDirection("TB"), this.$ = "TB";
659
+ break;
660
+ case 12:
661
+ l.setDirection(t[e - 1]), this.$ = t[e - 1];
662
+ break;
663
+ case 27:
664
+ this.$ = t[e - 1].nodes;
665
+ break;
666
+ case 28:
667
+ case 29:
668
+ case 30:
669
+ case 31:
670
+ case 32:
671
+ this.$ = [];
672
+ break;
673
+ case 33:
674
+ this.$ = l.addSubGraph(t[e - 6], t[e - 1], t[e - 4]);
675
+ break;
676
+ case 34:
677
+ this.$ = l.addSubGraph(t[e - 3], t[e - 1], t[e - 3]);
678
+ break;
679
+ case 35:
680
+ this.$ = l.addSubGraph(void 0, t[e - 1], void 0);
681
+ break;
682
+ case 37:
683
+ this.$ = t[e].trim(), l.setAccTitle(this.$);
684
+ break;
685
+ case 38:
686
+ case 39:
687
+ this.$ = t[e].trim(), l.setAccDescription(this.$);
688
+ break;
689
+ case 43:
690
+ this.$ = t[e - 1] + t[e];
691
+ break;
692
+ case 44:
693
+ this.$ = t[e];
694
+ break;
695
+ case 45:
696
+ 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) };
697
+ break;
698
+ case 46:
699
+ l.addLink(t[e - 2].stmt, t[e], t[e - 1]), this.$ = { stmt: t[e], nodes: t[e].concat(t[e - 2].nodes) };
700
+ break;
701
+ case 47:
702
+ 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) };
703
+ break;
704
+ case 48:
705
+ this.$ = { stmt: t[e - 1], nodes: t[e - 1] };
706
+ break;
707
+ case 49:
708
+ 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] };
709
+ break;
710
+ case 50:
711
+ this.$ = { stmt: t[e], nodes: t[e] };
712
+ break;
713
+ case 51:
714
+ this.$ = [t[e]];
715
+ break;
716
+ case 52:
717
+ 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]);
718
+ break;
719
+ case 53:
720
+ this.$ = t[e - 4].concat(t[e]);
721
+ break;
722
+ case 54:
723
+ this.$ = t[e];
724
+ break;
725
+ case 55:
726
+ this.$ = t[e - 2], l.setClass(t[e - 2], t[e]);
727
+ break;
728
+ case 56:
729
+ this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "square");
730
+ break;
731
+ case 57:
732
+ this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "doublecircle");
733
+ break;
734
+ case 58:
735
+ this.$ = t[e - 5], l.addVertex(t[e - 5], t[e - 2], "circle");
736
+ break;
737
+ case 59:
738
+ this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "ellipse");
739
+ break;
740
+ case 60:
741
+ this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "stadium");
742
+ break;
743
+ case 61:
744
+ this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "subroutine");
745
+ break;
746
+ case 62:
747
+ 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]]]));
748
+ break;
749
+ case 63:
750
+ this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "cylinder");
751
+ break;
752
+ case 64:
753
+ this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "round");
754
+ break;
755
+ case 65:
756
+ this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "diamond");
757
+ break;
758
+ case 66:
759
+ this.$ = t[e - 5], l.addVertex(t[e - 5], t[e - 2], "hexagon");
760
+ break;
761
+ case 67:
762
+ this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "odd");
763
+ break;
764
+ case 68:
765
+ this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "trapezoid");
766
+ break;
767
+ case 69:
768
+ this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "inv_trapezoid");
769
+ break;
770
+ case 70:
771
+ this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "lean_right");
772
+ break;
773
+ case 71:
774
+ this.$ = t[e - 3], l.addVertex(t[e - 3], t[e - 1], "lean_left");
775
+ break;
776
+ case 72:
777
+ this.$ = t[e], l.addVertex(t[e]);
778
+ break;
779
+ case 73:
780
+ t[e - 1].text = t[e], this.$ = t[e - 1];
781
+ break;
782
+ case 74:
783
+ case 75:
784
+ t[e - 2].text = t[e - 1], this.$ = t[e - 2];
785
+ break;
786
+ case 76:
787
+ this.$ = t[e];
788
+ break;
789
+ case 77:
790
+ var v = l.destructLink(t[e], t[e - 2]);
791
+ this.$ = { type: v.type, stroke: v.stroke, length: v.length, text: t[e - 1] };
792
+ break;
793
+ case 78:
794
+ var v = l.destructLink(t[e], t[e - 2]);
795
+ this.$ = { type: v.type, stroke: v.stroke, length: v.length, text: t[e - 1], id: t[e - 3] };
796
+ break;
797
+ case 79:
798
+ this.$ = { text: t[e], type: "text" };
799
+ break;
800
+ case 80:
801
+ this.$ = { text: t[e - 1].text + "" + t[e], type: t[e - 1].type };
802
+ break;
803
+ case 81:
804
+ this.$ = { text: t[e], type: "string" };
805
+ break;
806
+ case 82:
807
+ this.$ = { text: t[e], type: "markdown" };
808
+ break;
809
+ case 83:
810
+ var v = l.destructLink(t[e]);
811
+ this.$ = { type: v.type, stroke: v.stroke, length: v.length };
812
+ break;
813
+ case 84:
814
+ var v = l.destructLink(t[e]);
815
+ this.$ = { type: v.type, stroke: v.stroke, length: v.length, id: t[e - 1] };
816
+ break;
817
+ case 85:
818
+ this.$ = t[e - 1];
819
+ break;
820
+ case 86:
821
+ this.$ = { text: t[e], type: "text" };
822
+ break;
823
+ case 87:
824
+ this.$ = { text: t[e - 1].text + "" + t[e], type: t[e - 1].type };
825
+ break;
826
+ case 88:
827
+ this.$ = { text: t[e], type: "string" };
828
+ break;
829
+ case 89:
830
+ case 104:
831
+ this.$ = { text: t[e], type: "markdown" };
832
+ break;
833
+ case 101:
834
+ this.$ = { text: t[e], type: "text" };
835
+ break;
836
+ case 102:
837
+ this.$ = { text: t[e - 1].text + "" + t[e], type: t[e - 1].type };
838
+ break;
839
+ case 103:
840
+ this.$ = { text: t[e], type: "text" };
841
+ break;
842
+ case 105:
843
+ this.$ = t[e - 4], l.addClass(t[e - 2], t[e]);
844
+ break;
845
+ case 106:
846
+ this.$ = t[e - 4], l.setClass(t[e - 2], t[e]);
847
+ break;
848
+ case 107:
849
+ case 115:
850
+ this.$ = t[e - 1], l.setClickEvent(t[e - 1], t[e]);
851
+ break;
852
+ case 108:
853
+ case 116:
854
+ this.$ = t[e - 3], l.setClickEvent(t[e - 3], t[e - 2]), l.setTooltip(t[e - 3], t[e]);
855
+ break;
856
+ case 109:
857
+ this.$ = t[e - 2], l.setClickEvent(t[e - 2], t[e - 1], t[e]);
858
+ break;
859
+ case 110:
860
+ this.$ = t[e - 4], l.setClickEvent(t[e - 4], t[e - 3], t[e - 2]), l.setTooltip(t[e - 4], t[e]);
861
+ break;
862
+ case 111:
863
+ this.$ = t[e - 2], l.setLink(t[e - 2], t[e]);
864
+ break;
865
+ case 112:
866
+ this.$ = t[e - 4], l.setLink(t[e - 4], t[e - 2]), l.setTooltip(t[e - 4], t[e]);
867
+ break;
868
+ case 113:
869
+ this.$ = t[e - 4], l.setLink(t[e - 4], t[e - 2], t[e]);
870
+ break;
871
+ case 114:
872
+ this.$ = t[e - 6], l.setLink(t[e - 6], t[e - 4], t[e]), l.setTooltip(t[e - 6], t[e - 2]);
873
+ break;
874
+ case 117:
875
+ this.$ = t[e - 1], l.setLink(t[e - 1], t[e]);
876
+ break;
877
+ case 118:
878
+ this.$ = t[e - 3], l.setLink(t[e - 3], t[e - 2]), l.setTooltip(t[e - 3], t[e]);
879
+ break;
880
+ case 119:
881
+ this.$ = t[e - 3], l.setLink(t[e - 3], t[e - 2], t[e]);
882
+ break;
883
+ case 120:
884
+ this.$ = t[e - 5], l.setLink(t[e - 5], t[e - 4], t[e]), l.setTooltip(t[e - 5], t[e - 2]);
885
+ break;
886
+ case 121:
887
+ this.$ = t[e - 4], l.addVertex(t[e - 2], void 0, void 0, t[e]);
888
+ break;
889
+ case 122:
890
+ this.$ = t[e - 4], l.updateLink([t[e - 2]], t[e]);
891
+ break;
892
+ case 123:
893
+ this.$ = t[e - 4], l.updateLink(t[e - 2], t[e]);
894
+ break;
895
+ case 124:
896
+ this.$ = t[e - 8], l.updateLinkInterpolate([t[e - 6]], t[e - 2]), l.updateLink([t[e - 6]], t[e]);
897
+ break;
898
+ case 125:
899
+ this.$ = t[e - 8], l.updateLinkInterpolate(t[e - 6], t[e - 2]), l.updateLink(t[e - 6], t[e]);
900
+ break;
901
+ case 126:
902
+ this.$ = t[e - 6], l.updateLinkInterpolate([t[e - 4]], t[e]);
903
+ break;
904
+ case 127:
905
+ this.$ = t[e - 6], l.updateLinkInterpolate(t[e - 4], t[e]);
906
+ break;
907
+ case 128:
908
+ case 130:
909
+ this.$ = [t[e]];
910
+ break;
911
+ case 129:
912
+ case 131:
913
+ t[e - 2].push(t[e]), this.$ = t[e - 2];
914
+ break;
915
+ case 133:
916
+ this.$ = t[e - 1] + t[e];
917
+ break;
918
+ case 181:
919
+ this.$ = t[e];
920
+ break;
921
+ case 182:
922
+ this.$ = t[e - 1] + "" + t[e];
923
+ break;
924
+ case 184:
925
+ this.$ = t[e - 1] + "" + t[e];
926
+ break;
927
+ case 185:
928
+ this.$ = { stmt: "dir", value: "TB" };
929
+ break;
930
+ case 186:
931
+ this.$ = { stmt: "dir", value: "BT" };
932
+ break;
933
+ case 187:
934
+ this.$ = { stmt: "dir", value: "RL" };
935
+ break;
936
+ case 188:
937
+ this.$ = { stmt: "dir", value: "LR" };
938
+ break;
939
+ }
940
+ }, "anonymous"),
941
+ 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: d, 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: d, 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: d, 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: d, 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: d, 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: d, 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: d, 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: d, 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: d, 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: d, 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: d, 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: d, 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: d, 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: d, 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: d, 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: d, 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: d, 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: d, 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 })],
942
+ defaultActions: {},
943
+ parseError: /* @__PURE__ */ m(function(h, p) {
944
+ if (p.recoverable)
945
+ this.trace(h);
946
+ else {
947
+ var g = new Error(h);
948
+ throw g.hash = p, g;
949
+ }
950
+ }, "parseError"),
951
+ parse: /* @__PURE__ */ m(function(h) {
952
+ var p = 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: {} };
953
+ for (var Z1 in this.yy)
954
+ Object.prototype.hasOwnProperty.call(this.yy, Z1) && (m1.yy[Z1] = this.yy[Z1]);
955
+ U.setInput(h, m1.yy), m1.yy.lexer = U, m1.yy.parser = this, typeof U.yylloc > "u" && (U.yylloc = {});
956
+ var $1 = U.yylloc;
957
+ t.push($1);
958
+ var Kt = U.options && U.options.ranges;
959
+ typeof m1.yy.parseError == "function" ? this.parseError = m1.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
960
+ function Yt(X) {
961
+ g.length = g.length - 2 * X, _.length = _.length - X, t.length = t.length - X;
962
+ }
963
+ m(Yt, "popStack");
964
+ function Gt() {
965
+ var X;
966
+ return X = l.pop() || U.lex() || Nt, typeof X != "number" && (X instanceof Array && (l = X, X = l.pop()), X = p.symbols_[X] || X), X;
967
+ }
968
+ m(Gt, "lex");
969
+ for (var Y, C1, Q, tt, G1 = {}, H1, d1, Pt, X1; ; ) {
970
+ 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]) {
971
+ var et = "";
972
+ X1 = [];
973
+ for (H1 in O1[C1])
974
+ this.terminals_[H1] && H1 > zt && X1.push("'" + this.terminals_[H1] + "'");
975
+ U.showPosition ? et = "Parse error on line " + (v + 1) + `:
976
+ ` + U.showPosition() + `
977
+ 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, {
978
+ text: U.match,
979
+ token: this.terminals_[Y] || Y,
980
+ line: U.yylineno,
981
+ loc: $1,
982
+ expected: X1
983
+ });
984
+ }
985
+ if (Q[0] instanceof Array && Q.length > 1)
986
+ throw new Error("Parse Error: multiple actions possible at state: " + C1 + ", token: " + Y);
987
+ switch (Q[0]) {
988
+ case 1:
989
+ 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;
990
+ break;
991
+ case 2:
992
+ if (d1 = this.productions_[Q[1]][1], G1.$ = _[_.length - d1], G1._$ = {
993
+ first_line: t[t.length - (d1 || 1)].first_line,
994
+ last_line: t[t.length - 1].last_line,
995
+ first_column: t[t.length - (d1 || 1)].first_column,
996
+ last_column: t[t.length - 1].last_column
997
+ }, Kt && (G1._$.range = [
998
+ t[t.length - (d1 || 1)].range[0],
999
+ t[t.length - 1].range[1]
1000
+ ]), tt = this.performAction.apply(G1, [
1001
+ e,
1002
+ Rt,
1003
+ v,
1004
+ m1.yy,
1005
+ Q[1],
1006
+ _,
1007
+ t
1008
+ ].concat(jt)), typeof tt < "u")
1009
+ return tt;
1010
+ 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);
1011
+ break;
1012
+ case 3:
1013
+ return !0;
1014
+ }
1015
+ }
1016
+ return !0;
1017
+ }, "parse")
1018
+ }, Wt = /* @__PURE__ */ function() {
1019
+ var g1 = {
1020
+ EOF: 1,
1021
+ parseError: /* @__PURE__ */ m(function(p, g) {
1022
+ if (this.yy.parser)
1023
+ this.yy.parser.parseError(p, g);
1024
+ else
1025
+ throw new Error(p);
1026
+ }, "parseError"),
1027
+ // resets the lexer, sets new input
1028
+ setInput: /* @__PURE__ */ m(function(h, p) {
1029
+ return this.yy = p || 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 = {
1030
+ first_line: 1,
1031
+ first_column: 0,
1032
+ last_line: 1,
1033
+ last_column: 0
1034
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
1035
+ }, "setInput"),
1036
+ // consumes and returns one char from the input
1037
+ input: /* @__PURE__ */ m(function() {
1038
+ var h = this._input[0];
1039
+ this.yytext += h, this.yyleng++, this.offset++, this.match += h, this.matched += h;
1040
+ var p = h.match(/(?:\r\n?|\n).*/g);
1041
+ return p ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), h;
1042
+ }, "input"),
1043
+ // unshifts one char (or a string) into the input
1044
+ unput: /* @__PURE__ */ m(function(h) {
1045
+ var p = h.length, g = h.split(/(?:\r\n?|\n)/g);
1046
+ this._input = h + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - p), this.offset -= p;
1047
+ var l = this.match.split(/(?:\r\n?|\n)/g);
1048
+ 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);
1049
+ var _ = this.yylloc.range;
1050
+ return this.yylloc = {
1051
+ first_line: this.yylloc.first_line,
1052
+ last_line: this.yylineno + 1,
1053
+ first_column: this.yylloc.first_column,
1054
+ 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 - p
1055
+ }, this.options.ranges && (this.yylloc.range = [_[0], _[0] + this.yyleng - p]), this.yyleng = this.yytext.length, this;
1056
+ }, "unput"),
1057
+ // When called from action, caches matched text and appends it on next action
1058
+ more: /* @__PURE__ */ m(function() {
1059
+ return this._more = !0, this;
1060
+ }, "more"),
1061
+ // 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.
1062
+ reject: /* @__PURE__ */ m(function() {
1063
+ if (this.options.backtrack_lexer)
1064
+ this._backtrack = !0;
1065
+ else
1066
+ 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).
1067
+ ` + this.showPosition(), {
1068
+ text: "",
1069
+ token: null,
1070
+ line: this.yylineno
1071
+ });
1072
+ return this;
1073
+ }, "reject"),
1074
+ // retain first n characters of the match
1075
+ less: /* @__PURE__ */ m(function(h) {
1076
+ this.unput(this.match.slice(h));
1077
+ }, "less"),
1078
+ // displays already matched input, i.e. for error messages
1079
+ pastInput: /* @__PURE__ */ m(function() {
1080
+ var h = this.matched.substr(0, this.matched.length - this.match.length);
1081
+ return (h.length > 20 ? "..." : "") + h.substr(-20).replace(/\n/g, "");
1082
+ }, "pastInput"),
1083
+ // displays upcoming input, i.e. for error messages
1084
+ upcomingInput: /* @__PURE__ */ m(function() {
1085
+ var h = this.match;
1086
+ return h.length < 20 && (h += this._input.substr(0, 20 - h.length)), (h.substr(0, 20) + (h.length > 20 ? "..." : "")).replace(/\n/g, "");
1087
+ }, "upcomingInput"),
1088
+ // displays the character position where the lexing error occurred, i.e. for error messages
1089
+ showPosition: /* @__PURE__ */ m(function() {
1090
+ var h = this.pastInput(), p = new Array(h.length + 1).join("-");
1091
+ return h + this.upcomingInput() + `
1092
+ ` + p + "^";
1093
+ }, "showPosition"),
1094
+ // test the lexed token: return FALSE when not a match, otherwise return token
1095
+ test_match: /* @__PURE__ */ m(function(h, p) {
1096
+ var g, l, _;
1097
+ if (this.options.backtrack_lexer && (_ = {
1098
+ yylineno: this.yylineno,
1099
+ yylloc: {
1100
+ first_line: this.yylloc.first_line,
1101
+ last_line: this.last_line,
1102
+ first_column: this.yylloc.first_column,
1103
+ last_column: this.yylloc.last_column
1104
+ },
1105
+ yytext: this.yytext,
1106
+ match: this.match,
1107
+ matches: this.matches,
1108
+ matched: this.matched,
1109
+ yyleng: this.yyleng,
1110
+ offset: this.offset,
1111
+ _more: this._more,
1112
+ _input: this._input,
1113
+ yy: this.yy,
1114
+ conditionStack: this.conditionStack.slice(0),
1115
+ done: this.done
1116
+ }, 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 = {
1117
+ first_line: this.yylloc.last_line,
1118
+ last_line: this.yylineno + 1,
1119
+ first_column: this.yylloc.last_column,
1120
+ last_column: l ? l[l.length - 1].length - l[l.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + h[0].length
1121
+ }, 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, p, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), g)
1122
+ return g;
1123
+ if (this._backtrack) {
1124
+ for (var t in _)
1125
+ this[t] = _[t];
1126
+ return !1;
1127
+ }
1128
+ return !1;
1129
+ }, "test_match"),
1130
+ // return next match in input
1131
+ next: /* @__PURE__ */ m(function() {
1132
+ if (this.done)
1133
+ return this.EOF;
1134
+ this._input || (this.done = !0);
1135
+ var h, p, g, l;
1136
+ this._more || (this.yytext = "", this.match = "");
1137
+ for (var _ = this._currentRules(), t = 0; t < _.length; t++)
1138
+ if (g = this._input.match(this.rules[_[t]]), g && (!p || g[0].length > p[0].length)) {
1139
+ if (p = g, l = t, this.options.backtrack_lexer) {
1140
+ if (h = this.test_match(g, _[t]), h !== !1)
1141
+ return h;
1142
+ if (this._backtrack) {
1143
+ p = !1;
1144
+ continue;
1145
+ } else
1146
+ return !1;
1147
+ } else if (!this.options.flex)
1148
+ break;
1149
+ }
1150
+ return p ? (h = this.test_match(p, _[l]), h !== !1 ? h : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
1151
+ ` + this.showPosition(), {
1152
+ text: "",
1153
+ token: null,
1154
+ line: this.yylineno
1155
+ });
1156
+ }, "next"),
1157
+ // return next match that has a token
1158
+ lex: /* @__PURE__ */ m(function() {
1159
+ var p = this.next();
1160
+ return p || this.lex();
1161
+ }, "lex"),
1162
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
1163
+ begin: /* @__PURE__ */ m(function(p) {
1164
+ this.conditionStack.push(p);
1165
+ }, "begin"),
1166
+ // pop the previously active lexer condition state off the condition stack
1167
+ popState: /* @__PURE__ */ m(function() {
1168
+ var p = this.conditionStack.length - 1;
1169
+ return p > 0 ? this.conditionStack.pop() : this.conditionStack[0];
1170
+ }, "popState"),
1171
+ // produce the lexer rule set which is active for the currently active lexer condition state
1172
+ _currentRules: /* @__PURE__ */ m(function() {
1173
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
1174
+ }, "_currentRules"),
1175
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
1176
+ topState: /* @__PURE__ */ m(function(p) {
1177
+ return p = this.conditionStack.length - 1 - Math.abs(p || 0), p >= 0 ? this.conditionStack[p] : "INITIAL";
1178
+ }, "topState"),
1179
+ // alias for begin(condition)
1180
+ pushState: /* @__PURE__ */ m(function(p) {
1181
+ this.begin(p);
1182
+ }, "pushState"),
1183
+ // return the number of states currently on the stack
1184
+ stateStackSize: /* @__PURE__ */ m(function() {
1185
+ return this.conditionStack.length;
1186
+ }, "stateStackSize"),
1187
+ options: {},
1188
+ performAction: /* @__PURE__ */ m(function(p, g, l, _) {
1189
+ switch (l) {
1190
+ case 0:
1191
+ return this.begin("acc_title"), 34;
1192
+ case 1:
1193
+ return this.popState(), "acc_title_value";
1194
+ case 2:
1195
+ return this.begin("acc_descr"), 36;
1196
+ case 3:
1197
+ return this.popState(), "acc_descr_value";
1198
+ case 4:
1199
+ this.begin("acc_descr_multiline");
1200
+ break;
1201
+ case 5:
1202
+ this.popState();
1203
+ break;
1204
+ case 6:
1205
+ return "acc_descr_multiline_value";
1206
+ case 7:
1207
+ return this.pushState("shapeData"), g.yytext = "", 40;
1208
+ case 8:
1209
+ return this.pushState("shapeDataStr"), 40;
1210
+ case 9:
1211
+ return this.popState(), 40;
1212
+ case 10:
1213
+ const t = /\n\s*/g;
1214
+ return g.yytext = g.yytext.replace(t, "<br/>"), 40;
1215
+ case 11:
1216
+ return 40;
1217
+ case 12:
1218
+ this.popState();
1219
+ break;
1220
+ case 13:
1221
+ this.begin("callbackname");
1222
+ break;
1223
+ case 14:
1224
+ this.popState();
1225
+ break;
1226
+ case 15:
1227
+ this.popState(), this.begin("callbackargs");
1228
+ break;
1229
+ case 16:
1230
+ return 95;
1231
+ case 17:
1232
+ this.popState();
1233
+ break;
1234
+ case 18:
1235
+ return 96;
1236
+ case 19:
1237
+ return "MD_STR";
1238
+ case 20:
1239
+ this.popState();
1240
+ break;
1241
+ case 21:
1242
+ this.begin("md_string");
1243
+ break;
1244
+ case 22:
1245
+ return "STR";
1246
+ case 23:
1247
+ this.popState();
1248
+ break;
1249
+ case 24:
1250
+ this.pushState("string");
1251
+ break;
1252
+ case 25:
1253
+ return 84;
1254
+ case 26:
1255
+ return 102;
1256
+ case 27:
1257
+ return 85;
1258
+ case 28:
1259
+ return 104;
1260
+ case 29:
1261
+ return 86;
1262
+ case 30:
1263
+ return 87;
1264
+ case 31:
1265
+ return 97;
1266
+ case 32:
1267
+ this.begin("click");
1268
+ break;
1269
+ case 33:
1270
+ this.popState();
1271
+ break;
1272
+ case 34:
1273
+ return 88;
1274
+ case 35:
1275
+ return p.lex.firstGraph() && this.begin("dir"), 12;
1276
+ case 36:
1277
+ return p.lex.firstGraph() && this.begin("dir"), 12;
1278
+ case 37:
1279
+ return p.lex.firstGraph() && this.begin("dir"), 12;
1280
+ case 38:
1281
+ return 27;
1282
+ case 39:
1283
+ return 32;
1284
+ case 40:
1285
+ return 98;
1286
+ case 41:
1287
+ return 98;
1288
+ case 42:
1289
+ return 98;
1290
+ case 43:
1291
+ return 98;
1292
+ case 44:
1293
+ return this.popState(), 13;
1294
+ case 45:
1295
+ return this.popState(), 14;
1296
+ case 46:
1297
+ return this.popState(), 14;
1298
+ case 47:
1299
+ return this.popState(), 14;
1300
+ case 48:
1301
+ return this.popState(), 14;
1302
+ case 49:
1303
+ return this.popState(), 14;
1304
+ case 50:
1305
+ return this.popState(), 14;
1306
+ case 51:
1307
+ return this.popState(), 14;
1308
+ case 52:
1309
+ return this.popState(), 14;
1310
+ case 53:
1311
+ return this.popState(), 14;
1312
+ case 54:
1313
+ return this.popState(), 14;
1314
+ case 55:
1315
+ return 121;
1316
+ case 56:
1317
+ return 122;
1318
+ case 57:
1319
+ return 123;
1320
+ case 58:
1321
+ return 124;
1322
+ case 59:
1323
+ return 78;
1324
+ case 60:
1325
+ return 105;
1326
+ case 61:
1327
+ return 111;
1328
+ case 62:
1329
+ return 46;
1330
+ case 63:
1331
+ return 60;
1332
+ case 64:
1333
+ return 44;
1334
+ case 65:
1335
+ return 8;
1336
+ case 66:
1337
+ return 106;
1338
+ case 67:
1339
+ return 115;
1340
+ case 68:
1341
+ return this.popState(), 77;
1342
+ case 69:
1343
+ return this.pushState("edgeText"), 75;
1344
+ case 70:
1345
+ return 119;
1346
+ case 71:
1347
+ return this.popState(), 77;
1348
+ case 72:
1349
+ return this.pushState("thickEdgeText"), 75;
1350
+ case 73:
1351
+ return 119;
1352
+ case 74:
1353
+ return this.popState(), 77;
1354
+ case 75:
1355
+ return this.pushState("dottedEdgeText"), 75;
1356
+ case 76:
1357
+ return 119;
1358
+ case 77:
1359
+ return 77;
1360
+ case 78:
1361
+ return this.popState(), 53;
1362
+ case 79:
1363
+ return "TEXT";
1364
+ case 80:
1365
+ return this.pushState("ellipseText"), 52;
1366
+ case 81:
1367
+ return this.popState(), 55;
1368
+ case 82:
1369
+ return this.pushState("text"), 54;
1370
+ case 83:
1371
+ return this.popState(), 57;
1372
+ case 84:
1373
+ return this.pushState("text"), 56;
1374
+ case 85:
1375
+ return 58;
1376
+ case 86:
1377
+ return this.pushState("text"), 67;
1378
+ case 87:
1379
+ return this.popState(), 64;
1380
+ case 88:
1381
+ return this.pushState("text"), 63;
1382
+ case 89:
1383
+ return this.popState(), 49;
1384
+ case 90:
1385
+ return this.pushState("text"), 48;
1386
+ case 91:
1387
+ return this.popState(), 69;
1388
+ case 92:
1389
+ return this.popState(), 71;
1390
+ case 93:
1391
+ return 117;
1392
+ case 94:
1393
+ return this.pushState("trapText"), 68;
1394
+ case 95:
1395
+ return this.pushState("trapText"), 70;
1396
+ case 96:
1397
+ return 118;
1398
+ case 97:
1399
+ return 67;
1400
+ case 98:
1401
+ return 90;
1402
+ case 99:
1403
+ return "SEP";
1404
+ case 100:
1405
+ return 89;
1406
+ case 101:
1407
+ return 115;
1408
+ case 102:
1409
+ return 111;
1410
+ case 103:
1411
+ return 44;
1412
+ case 104:
1413
+ return 109;
1414
+ case 105:
1415
+ return 114;
1416
+ case 106:
1417
+ return 116;
1418
+ case 107:
1419
+ return this.popState(), 62;
1420
+ case 108:
1421
+ return this.pushState("text"), 62;
1422
+ case 109:
1423
+ return this.popState(), 51;
1424
+ case 110:
1425
+ return this.pushState("text"), 50;
1426
+ case 111:
1427
+ return this.popState(), 31;
1428
+ case 112:
1429
+ return this.pushState("text"), 29;
1430
+ case 113:
1431
+ return this.popState(), 66;
1432
+ case 114:
1433
+ return this.pushState("text"), 65;
1434
+ case 115:
1435
+ return "TEXT";
1436
+ case 116:
1437
+ return "QUOTE";
1438
+ case 117:
1439
+ return 9;
1440
+ case 118:
1441
+ return 10;
1442
+ case 119:
1443
+ return 11;
1444
+ }
1445
+ }, "anonymous"),
1446
+ 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)/, /^(?:$)/],
1447
+ 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 } }
1448
+ };
1449
+ return g1;
1450
+ }();
1451
+ J1.lexer = Wt;
1452
+ function q1() {
1453
+ this.yy = {};
1454
+ }
1455
+ return m(q1, "Parser"), q1.prototype = J1, J1.Parser = q1, new q1();
1456
+ }();
1457
+ rt.parser = rt;
1458
+ var Mt = rt, Ut = Object.assign({}, Mt);
1459
+ Ut.parse = (s) => {
1460
+ const i = s.replace(/}\s*\n/g, `}
1461
+ `);
1462
+ return Mt.parse(i);
1463
+ };
1464
+ var Ae = Ut, ke = /* @__PURE__ */ m((s, i) => {
1465
+ const a = he, n = a(s, "r"), u = a(s, "g"), o = a(s, "b");
1466
+ return oe(n, u, o, i);
1467
+ }, "fade"), me = /* @__PURE__ */ m((s) => `.label {
1468
+ font-family: ${s.fontFamily};
1469
+ color: ${s.nodeTextColor || s.textColor};
1470
+ }
1471
+ .cluster-label text {
1472
+ fill: ${s.titleColor};
1473
+ }
1474
+ .cluster-label span {
1475
+ color: ${s.titleColor};
1476
+ }
1477
+ .cluster-label span p {
1478
+ background-color: transparent;
1479
+ }
1480
+
1481
+ .label text,span {
1482
+ fill: ${s.nodeTextColor || s.textColor};
1483
+ color: ${s.nodeTextColor || s.textColor};
1484
+ }
1485
+
1486
+ .node rect,
1487
+ .node circle,
1488
+ .node ellipse,
1489
+ .node polygon,
1490
+ .node path {
1491
+ fill: ${s.mainBkg};
1492
+ stroke: ${s.nodeBorder};
1493
+ stroke-width: 1px;
1494
+ }
1495
+ .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {
1496
+ text-anchor: middle;
1497
+ }
1498
+ // .flowchart-label .text-outer-tspan {
1499
+ // text-anchor: middle;
1500
+ // }
1501
+ // .flowchart-label .text-inner-tspan {
1502
+ // text-anchor: start;
1503
+ // }
1504
+
1505
+ .node .katex path {
1506
+ fill: #000;
1507
+ stroke: #000;
1508
+ stroke-width: 1px;
1509
+ }
1510
+
1511
+ .rough-node .label,.node .label, .image-shape .label, .icon-shape .label {
1512
+ text-align: center;
1513
+ }
1514
+ .node.clickable {
1515
+ cursor: pointer;
1516
+ }
1517
+
1518
+
1519
+ .root .anchor path {
1520
+ fill: ${s.lineColor} !important;
1521
+ stroke-width: 0;
1522
+ stroke: ${s.lineColor};
1523
+ }
1524
+
1525
+ .arrowheadPath {
1526
+ fill: ${s.arrowheadColor};
1527
+ }
1528
+
1529
+ .edgePath .path {
1530
+ stroke: ${s.lineColor};
1531
+ stroke-width: 2.0px;
1532
+ }
1533
+
1534
+ .flowchart-link {
1535
+ stroke: ${s.lineColor};
1536
+ fill: none;
1537
+ }
1538
+
1539
+ .edgeLabel {
1540
+ background-color: ${s.edgeLabelBackground};
1541
+ p {
1542
+ background-color: ${s.edgeLabelBackground};
1543
+ }
1544
+ rect {
1545
+ opacity: 0.5;
1546
+ background-color: ${s.edgeLabelBackground};
1547
+ fill: ${s.edgeLabelBackground};
1548
+ }
1549
+ text-align: center;
1550
+ }
1551
+
1552
+ /* For html labels only */
1553
+ .labelBkg {
1554
+ background-color: ${ke(s.edgeLabelBackground, 0.5)};
1555
+ // background-color:
1556
+ }
1557
+
1558
+ .cluster rect {
1559
+ fill: ${s.clusterBkg};
1560
+ stroke: ${s.clusterBorder};
1561
+ stroke-width: 1px;
1562
+ }
1563
+
1564
+ .cluster text {
1565
+ fill: ${s.titleColor};
1566
+ }
1567
+
1568
+ .cluster span {
1569
+ color: ${s.titleColor};
1570
+ }
1571
+ /* .cluster div {
1572
+ color: ${s.titleColor};
1573
+ } */
1574
+
1575
+ div.mermaidTooltip {
1576
+ position: absolute;
1577
+ text-align: center;
1578
+ max-width: 200px;
1579
+ padding: 2px;
1580
+ font-family: ${s.fontFamily};
1581
+ font-size: 12px;
1582
+ background: ${s.tertiaryColor};
1583
+ border: 1px solid ${s.border2};
1584
+ border-radius: 2px;
1585
+ pointer-events: none;
1586
+ z-index: 100;
1587
+ }
1588
+
1589
+ .flowchartTitleText {
1590
+ text-anchor: middle;
1591
+ font-size: 18px;
1592
+ fill: ${s.textColor};
1593
+ }
1594
+
1595
+ rect.text {
1596
+ fill: none;
1597
+ stroke-width: 0;
1598
+ }
1599
+
1600
+ .icon-shape, .image-shape {
1601
+ background-color: ${s.edgeLabelBackground};
1602
+ p {
1603
+ background-color: ${s.edgeLabelBackground};
1604
+ padding: 2px;
1605
+ }
1606
+ rect {
1607
+ opacity: 0.5;
1608
+ background-color: ${s.edgeLabelBackground};
1609
+ fill: ${s.edgeLabelBackground};
1610
+ }
1611
+ text-align: center;
1612
+ }
1613
+ ${qt()}
1614
+ `, "getStyles"), Ce = me, ye = {
1615
+ parser: Ae,
1616
+ get db() {
1617
+ return new pe();
1618
+ },
1619
+ renderer: be,
1620
+ styles: Ce,
1621
+ init: /* @__PURE__ */ m((s) => {
1622
+ s.flowchart || (s.flowchart = {}), s.layout && Ot({ layout: s.layout }), s.flowchart.arrowMarkerAbsolute = s.arrowMarkerAbsolute, Ot({ flowchart: { arrowMarkerAbsolute: s.arrowMarkerAbsolute } });
1623
+ }, "init")
1624
+ };
1625
+ export {
1626
+ ye as diagram
1627
+ };
src/backend/gradio_dropdownplus/templates/component/ganttDiagram-WV7ZQ7D5-DU8JrHbh.js ADDED
@@ -0,0 +1,2499 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { a_ as $e, a$ as Un, b0 as Je, b1 as Ke, b2 as tn, b3 as re, b4 as En, _ as h, g as Ln, s as An, q as In, p as Wn, a as On, b as Hn, c as _t, d as Zt, e as Nn, b5 as at, l as Qt, k as Vn, j as zn, y as Pn, u as Rn } from "./mermaid.core-D58rAnek.js";
2
+ import { c as Te, g as be } from "./Index-v4MoKD9K.js";
3
+ import { b as Bn, t as Ie, c as Zn, a as qn, l as Gn } from "./linear-D3Iz2LBj.js";
4
+ import { i as Xn } from "./init-DjUOC4st.js";
5
+ function jn(t, e) {
6
+ let n;
7
+ if (e === void 0)
8
+ for (const r of t)
9
+ r != null && (n < r || n === void 0 && r >= r) && (n = r);
10
+ else {
11
+ let r = -1;
12
+ for (let a of t)
13
+ (a = e(a, ++r, t)) != null && (n < a || n === void 0 && a >= a) && (n = a);
14
+ }
15
+ return n;
16
+ }
17
+ function Qn(t, e) {
18
+ let n;
19
+ if (e === void 0)
20
+ for (const r of t)
21
+ r != null && (n > r || n === void 0 && r >= r) && (n = r);
22
+ else {
23
+ let r = -1;
24
+ for (let a of t)
25
+ (a = e(a, ++r, t)) != null && (n > a || n === void 0 && a >= a) && (n = a);
26
+ }
27
+ return n;
28
+ }
29
+ function $n(t) {
30
+ return t;
31
+ }
32
+ var Gt = 1, ae = 2, me = 3, qt = 4, We = 1e-6;
33
+ function Jn(t) {
34
+ return "translate(" + t + ",0)";
35
+ }
36
+ function Kn(t) {
37
+ return "translate(0," + t + ")";
38
+ }
39
+ function tr(t) {
40
+ return (e) => +t(e);
41
+ }
42
+ function er(t, e) {
43
+ return e = Math.max(0, t.bandwidth() - e * 2) / 2, t.round() && (e = Math.round(e)), (n) => +t(n) + e;
44
+ }
45
+ function nr() {
46
+ return !this.__axis;
47
+ }
48
+ function en(t, e) {
49
+ var n = [], r = null, a = null, i = 6, s = 6, y = 3, _ = typeof window < "u" && window.devicePixelRatio > 1 ? 0 : 0.5, p = t === Gt || t === qt ? -1 : 1, g = t === qt || t === ae ? "x" : "y", E = t === Gt || t === me ? Jn : Kn;
50
+ function C(b) {
51
+ var G = r ?? (e.ticks ? e.ticks.apply(e, n) : e.domain()), O = a ?? (e.tickFormat ? e.tickFormat.apply(e, n) : $n), M = Math.max(i, 0) + y, I = e.range(), V = +I[0] + _, W = +I[I.length - 1] + _, Z = (e.bandwidth ? er : tr)(e.copy(), _), Q = b.selection ? b.selection() : b, D = Q.selectAll(".domain").data([null]), H = Q.selectAll(".tick").data(G, e).order(), x = H.exit(), Y = H.enter().append("g").attr("class", "tick"), F = H.select("line"), S = H.select("text");
52
+ D = D.merge(D.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor")), H = H.merge(Y), F = F.merge(Y.append("line").attr("stroke", "currentColor").attr(g + "2", p * i)), S = S.merge(Y.append("text").attr("fill", "currentColor").attr(g, p * M).attr("dy", t === Gt ? "0em" : t === me ? "0.71em" : "0.32em")), b !== Q && (D = D.transition(b), H = H.transition(b), F = F.transition(b), S = S.transition(b), x = x.transition(b).attr("opacity", We).attr("transform", function(v) {
53
+ return isFinite(v = Z(v)) ? E(v + _) : this.getAttribute("transform");
54
+ }), Y.attr("opacity", We).attr("transform", function(v) {
55
+ var U = this.parentNode.__axis;
56
+ return E((U && isFinite(U = U(v)) ? U : Z(v)) + _);
57
+ })), x.remove(), D.attr("d", t === qt || t === ae ? s ? "M" + p * s + "," + V + "H" + _ + "V" + W + "H" + p * s : "M" + _ + "," + V + "V" + W : s ? "M" + V + "," + p * s + "V" + _ + "H" + W + "V" + p * s : "M" + V + "," + _ + "H" + W), H.attr("opacity", 1).attr("transform", function(v) {
58
+ return E(Z(v) + _);
59
+ }), F.attr(g + "2", p * i), S.attr(g, p * M).text(O), Q.filter(nr).attr("fill", "none").attr("font-size", 10).attr("font-family", "sans-serif").attr("text-anchor", t === ae ? "start" : t === qt ? "end" : "middle"), Q.each(function() {
60
+ this.__axis = Z;
61
+ });
62
+ }
63
+ return C.scale = function(b) {
64
+ return arguments.length ? (e = b, C) : e;
65
+ }, C.ticks = function() {
66
+ return n = Array.from(arguments), C;
67
+ }, C.tickArguments = function(b) {
68
+ return arguments.length ? (n = b == null ? [] : Array.from(b), C) : n.slice();
69
+ }, C.tickValues = function(b) {
70
+ return arguments.length ? (r = b == null ? null : Array.from(b), C) : r && r.slice();
71
+ }, C.tickFormat = function(b) {
72
+ return arguments.length ? (a = b, C) : a;
73
+ }, C.tickSize = function(b) {
74
+ return arguments.length ? (i = s = +b, C) : i;
75
+ }, C.tickSizeInner = function(b) {
76
+ return arguments.length ? (i = +b, C) : i;
77
+ }, C.tickSizeOuter = function(b) {
78
+ return arguments.length ? (s = +b, C) : s;
79
+ }, C.tickPadding = function(b) {
80
+ return arguments.length ? (y = +b, C) : y;
81
+ }, C.offset = function(b) {
82
+ return arguments.length ? (_ = +b, C) : _;
83
+ }, C;
84
+ }
85
+ function rr(t) {
86
+ return en(Gt, t);
87
+ }
88
+ function ar(t) {
89
+ return en(me, t);
90
+ }
91
+ const ir = 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;
92
+ function cn(t) {
93
+ if (t instanceof ft) return new ft(t.l, t.a, t.b, t.opacity);
94
+ if (t instanceof dt) return ln(t);
95
+ t instanceof $e || (t = Un(t));
96
+ var e = ce(t.r), n = ce(t.g), r = ce(t.b), a = ie((0.2225045 * e + 0.7168786 * n + 0.0606169 * r) / rn), i, s;
97
+ return e === n && n === r ? i = s = a : (i = ie((0.4360747 * e + 0.3850649 * n + 0.1430804 * r) / nn), s = ie((0.0139322 * e + 0.0971045 * n + 0.7141733 * r) / an)), new ft(116 * a - 16, 500 * (i - a), 200 * (a - s), t.opacity);
98
+ }
99
+ function cr(t, e, n, r) {
100
+ return arguments.length === 1 ? cn(t) : new ft(t, e, n, r ?? 1);
101
+ }
102
+ function ft(t, e, n, r) {
103
+ this.l = +t, this.a = +e, this.b = +n, this.opacity = +r;
104
+ }
105
+ Je(ft, cr, Ke(tn, {
106
+ brighter(t) {
107
+ return new ft(this.l + $t * (t ?? 1), this.a, this.b, this.opacity);
108
+ },
109
+ darker(t) {
110
+ return new ft(this.l - $t * (t ?? 1), this.a, this.b, this.opacity);
111
+ },
112
+ rgb() {
113
+ var t = (this.l + 16) / 116, e = isNaN(this.a) ? t : t + this.a / 500, n = isNaN(this.b) ? t : t - this.b / 200;
114
+ return e = nn * se(e), t = rn * se(t), n = an * se(n), new $e(
115
+ oe(3.1338561 * e - 1.6168667 * t - 0.4906146 * n),
116
+ oe(-0.9787684 * e + 1.9161415 * t + 0.033454 * n),
117
+ oe(0.0719453 * e - 0.2289914 * t + 1.4052427 * n),
118
+ this.opacity
119
+ );
120
+ }
121
+ }));
122
+ function ie(t) {
123
+ return t > or ? Math.pow(t, 1 / 3) : t / on + sn;
124
+ }
125
+ function se(t) {
126
+ return t > St ? t * t * t : on * (t - sn);
127
+ }
128
+ function oe(t) {
129
+ return 255 * (t <= 31308e-7 ? 12.92 * t : 1.055 * Math.pow(t, 1 / 2.4) - 0.055);
130
+ }
131
+ function ce(t) {
132
+ return (t /= 255) <= 0.04045 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4);
133
+ }
134
+ function lr(t) {
135
+ if (t instanceof dt) return new dt(t.h, t.c, t.l, t.opacity);
136
+ 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);
137
+ var e = Math.atan2(t.b, t.a) * sr;
138
+ return new dt(e < 0 ? e + 360 : e, Math.sqrt(t.a * t.a + t.b * t.b), t.l, t.opacity);
139
+ }
140
+ function ge(t, e, n, r) {
141
+ return arguments.length === 1 ? lr(t) : new dt(t, e, n, r ?? 1);
142
+ }
143
+ function dt(t, e, n, r) {
144
+ this.h = +t, this.c = +e, this.l = +n, this.opacity = +r;
145
+ }
146
+ function ln(t) {
147
+ if (isNaN(t.h)) return new ft(t.l, 0, 0, t.opacity);
148
+ var e = t.h * ir;
149
+ return new ft(t.l, Math.cos(e) * t.c, Math.sin(e) * t.c, t.opacity);
150
+ }
151
+ Je(dt, ge, Ke(tn, {
152
+ brighter(t) {
153
+ return new dt(this.h, this.c, this.l + $t * (t ?? 1), this.opacity);
154
+ },
155
+ darker(t) {
156
+ return new dt(this.h, this.c, this.l - $t * (t ?? 1), this.opacity);
157
+ },
158
+ rgb() {
159
+ return ln(this).rgb();
160
+ }
161
+ }));
162
+ function ur(t) {
163
+ return function(e, n) {
164
+ var r = t((e = ge(e)).h, (n = ge(n)).h), a = re(e.c, n.c), i = re(e.l, n.l), s = re(e.opacity, n.opacity);
165
+ return function(y) {
166
+ return e.h = r(y), e.c = a(y), e.l = i(y), e.opacity = s(y), e + "";
167
+ };
168
+ };
169
+ }
170
+ const fr = ur(En);
171
+ function hr(t, e) {
172
+ t = t.slice();
173
+ var n = 0, r = t.length - 1, a = t[n], i = t[r], s;
174
+ return i < a && (s = n, n = r, r = s, s = a, a = i, i = s), t[n] = e.floor(a), t[r] = e.ceil(i), t;
175
+ }
176
+ const le = /* @__PURE__ */ new Date(), ue = /* @__PURE__ */ new Date();
177
+ function et(t, e, n, r) {
178
+ function a(i) {
179
+ return t(i = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+i)), i;
180
+ }
181
+ return a.floor = (i) => (t(i = /* @__PURE__ */ new Date(+i)), i), a.ceil = (i) => (t(i = new Date(i - 1)), e(i, 1), t(i), i), a.round = (i) => {
182
+ const s = a(i), y = a.ceil(i);
183
+ return i - s < y - i ? s : y;
184
+ }, a.offset = (i, s) => (e(i = /* @__PURE__ */ new Date(+i), s == null ? 1 : Math.floor(s)), i), a.range = (i, s, y) => {
185
+ const _ = [];
186
+ if (i = a.ceil(i), y = y == null ? 1 : Math.floor(y), !(i < s) || !(y > 0)) return _;
187
+ let p;
188
+ do
189
+ _.push(p = /* @__PURE__ */ new Date(+i)), e(i, y), t(i);
190
+ while (p < i && i < s);
191
+ return _;
192
+ }, a.filter = (i) => et((s) => {
193
+ if (s >= s) for (; t(s), !i(s); ) s.setTime(s - 1);
194
+ }, (s, y) => {
195
+ if (s >= s)
196
+ if (y < 0) for (; ++y <= 0; )
197
+ for (; e(s, -1), !i(s); )
198
+ ;
199
+ else for (; --y >= 0; )
200
+ for (; e(s, 1), !i(s); )
201
+ ;
202
+ }), n && (a.count = (i, s) => (le.setTime(+i), ue.setTime(+s), t(le), t(ue), Math.floor(n(le, ue))), a.every = (i) => (i = Math.floor(i), !isFinite(i) || !(i > 0) ? null : i > 1 ? a.filter(r ? (s) => r(s) % i === 0 : (s) => a.count(0, s) % i === 0) : a)), a;
203
+ }
204
+ const Yt = et(() => {
205
+ }, (t, e) => {
206
+ t.setTime(+t + e);
207
+ }, (t, e) => e - t);
208
+ Yt.every = (t) => (t = Math.floor(t), !isFinite(t) || !(t > 0) ? null : t > 1 ? et((e) => {
209
+ e.setTime(Math.floor(e / t) * t);
210
+ }, (e, n) => {
211
+ e.setTime(+e + n * t);
212
+ }, (e, n) => (n - e) / t) : Yt);
213
+ Yt.range;
214
+ const mt = 1e3, ct = mt * 60, gt = ct * 60, yt = gt * 24, xe = yt * 7, Oe = yt * 30, fe = yt * 365, vt = et((t) => {
215
+ t.setTime(t - t.getMilliseconds());
216
+ }, (t, e) => {
217
+ t.setTime(+t + e * mt);
218
+ }, (t, e) => (e - t) / mt, (t) => t.getUTCSeconds());
219
+ vt.range;
220
+ const Wt = et((t) => {
221
+ t.setTime(t - t.getMilliseconds() - t.getSeconds() * mt);
222
+ }, (t, e) => {
223
+ t.setTime(+t + e * ct);
224
+ }, (t, e) => (e - t) / ct, (t) => t.getMinutes());
225
+ Wt.range;
226
+ const dr = et((t) => {
227
+ t.setUTCSeconds(0, 0);
228
+ }, (t, e) => {
229
+ t.setTime(+t + e * ct);
230
+ }, (t, e) => (e - t) / ct, (t) => t.getUTCMinutes());
231
+ dr.range;
232
+ const Ot = et((t) => {
233
+ t.setTime(t - t.getMilliseconds() - t.getSeconds() * mt - t.getMinutes() * ct);
234
+ }, (t, e) => {
235
+ t.setTime(+t + e * gt);
236
+ }, (t, e) => (e - t) / gt, (t) => t.getHours());
237
+ Ot.range;
238
+ const mr = et((t) => {
239
+ t.setUTCMinutes(0, 0, 0);
240
+ }, (t, e) => {
241
+ t.setTime(+t + e * gt);
242
+ }, (t, e) => (e - t) / gt, (t) => t.getUTCHours());
243
+ mr.range;
244
+ const Tt = et(
245
+ (t) => t.setHours(0, 0, 0, 0),
246
+ (t, e) => t.setDate(t.getDate() + e),
247
+ (t, e) => (e - t - (e.getTimezoneOffset() - t.getTimezoneOffset()) * ct) / yt,
248
+ (t) => t.getDate() - 1
249
+ );
250
+ Tt.range;
251
+ const we = et((t) => {
252
+ t.setUTCHours(0, 0, 0, 0);
253
+ }, (t, e) => {
254
+ t.setUTCDate(t.getUTCDate() + e);
255
+ }, (t, e) => (e - t) / yt, (t) => t.getUTCDate() - 1);
256
+ we.range;
257
+ const gr = et((t) => {
258
+ t.setUTCHours(0, 0, 0, 0);
259
+ }, (t, e) => {
260
+ t.setUTCDate(t.getUTCDate() + e);
261
+ }, (t, e) => (e - t) / yt, (t) => Math.floor(t / yt));
262
+ gr.range;
263
+ function wt(t) {
264
+ return et((e) => {
265
+ e.setDate(e.getDate() - (e.getDay() + 7 - t) % 7), e.setHours(0, 0, 0, 0);
266
+ }, (e, n) => {
267
+ e.setDate(e.getDate() + n * 7);
268
+ }, (e, n) => (n - e - (n.getTimezoneOffset() - e.getTimezoneOffset()) * ct) / xe);
269
+ }
270
+ const Vt = wt(0), Ht = wt(1), un = wt(2), fn = wt(3), bt = wt(4), hn = wt(5), dn = wt(6);
271
+ Vt.range;
272
+ Ht.range;
273
+ un.range;
274
+ fn.range;
275
+ bt.range;
276
+ hn.range;
277
+ dn.range;
278
+ function Dt(t) {
279
+ return et((e) => {
280
+ e.setUTCDate(e.getUTCDate() - (e.getUTCDay() + 7 - t) % 7), e.setUTCHours(0, 0, 0, 0);
281
+ }, (e, n) => {
282
+ e.setUTCDate(e.getUTCDate() + n * 7);
283
+ }, (e, n) => (n - e) / xe);
284
+ }
285
+ const mn = Dt(0), Jt = Dt(1), yr = Dt(2), kr = Dt(3), Ut = Dt(4), pr = Dt(5), vr = Dt(6);
286
+ mn.range;
287
+ Jt.range;
288
+ yr.range;
289
+ kr.range;
290
+ Ut.range;
291
+ pr.range;
292
+ vr.range;
293
+ const Nt = et((t) => {
294
+ t.setDate(1), t.setHours(0, 0, 0, 0);
295
+ }, (t, e) => {
296
+ t.setMonth(t.getMonth() + e);
297
+ }, (t, e) => e.getMonth() - t.getMonth() + (e.getFullYear() - t.getFullYear()) * 12, (t) => t.getMonth());
298
+ Nt.range;
299
+ const Tr = et((t) => {
300
+ t.setUTCDate(1), t.setUTCHours(0, 0, 0, 0);
301
+ }, (t, e) => {
302
+ t.setUTCMonth(t.getUTCMonth() + e);
303
+ }, (t, e) => e.getUTCMonth() - t.getUTCMonth() + (e.getUTCFullYear() - t.getUTCFullYear()) * 12, (t) => t.getUTCMonth());
304
+ Tr.range;
305
+ const kt = et((t) => {
306
+ t.setMonth(0, 1), t.setHours(0, 0, 0, 0);
307
+ }, (t, e) => {
308
+ t.setFullYear(t.getFullYear() + e);
309
+ }, (t, e) => e.getFullYear() - t.getFullYear(), (t) => t.getFullYear());
310
+ kt.every = (t) => !isFinite(t = Math.floor(t)) || !(t > 0) ? null : et((e) => {
311
+ e.setFullYear(Math.floor(e.getFullYear() / t) * t), e.setMonth(0, 1), e.setHours(0, 0, 0, 0);
312
+ }, (e, n) => {
313
+ e.setFullYear(e.getFullYear() + n * t);
314
+ });
315
+ kt.range;
316
+ const xt = et((t) => {
317
+ t.setUTCMonth(0, 1), t.setUTCHours(0, 0, 0, 0);
318
+ }, (t, e) => {
319
+ t.setUTCFullYear(t.getUTCFullYear() + e);
320
+ }, (t, e) => e.getUTCFullYear() - t.getUTCFullYear(), (t) => t.getUTCFullYear());
321
+ xt.every = (t) => !isFinite(t = Math.floor(t)) || !(t > 0) ? null : et((e) => {
322
+ e.setUTCFullYear(Math.floor(e.getUTCFullYear() / t) * t), e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0);
323
+ }, (e, n) => {
324
+ e.setUTCFullYear(e.getUTCFullYear() + n * t);
325
+ });
326
+ xt.range;
327
+ function br(t, e, n, r, a, i) {
328
+ const s = [
329
+ [vt, 1, mt],
330
+ [vt, 5, 5 * mt],
331
+ [vt, 15, 15 * mt],
332
+ [vt, 30, 30 * mt],
333
+ [i, 1, ct],
334
+ [i, 5, 5 * ct],
335
+ [i, 15, 15 * ct],
336
+ [i, 30, 30 * ct],
337
+ [a, 1, gt],
338
+ [a, 3, 3 * gt],
339
+ [a, 6, 6 * gt],
340
+ [a, 12, 12 * gt],
341
+ [r, 1, yt],
342
+ [r, 2, 2 * yt],
343
+ [n, 1, xe],
344
+ [e, 1, Oe],
345
+ [e, 3, 3 * Oe],
346
+ [t, 1, fe]
347
+ ];
348
+ function y(p, g, E) {
349
+ const C = g < p;
350
+ C && ([p, g] = [g, p]);
351
+ const b = E && typeof E.range == "function" ? E : _(p, g, E), G = b ? b.range(p, +g + 1) : [];
352
+ return C ? G.reverse() : G;
353
+ }
354
+ function _(p, g, E) {
355
+ const C = Math.abs(g - p) / E, b = Bn(([, , M]) => M).right(s, C);
356
+ if (b === s.length) return t.every(Ie(p / fe, g / fe, E));
357
+ if (b === 0) return Yt.every(Math.max(Ie(p, g, E), 1));
358
+ const [G, O] = s[C / s[b - 1][2] < s[b][2] / C ? b - 1 : b];
359
+ return G.every(O);
360
+ }
361
+ return [y, _];
362
+ }
363
+ const [xr, wr] = br(kt, Nt, Vt, Tt, Ot, Wt);
364
+ function he(t) {
365
+ if (0 <= t.y && t.y < 100) {
366
+ var e = new Date(-1, t.m, t.d, t.H, t.M, t.S, t.L);
367
+ return e.setFullYear(t.y), e;
368
+ }
369
+ return new Date(t.y, t.m, t.d, t.H, t.M, t.S, t.L);
370
+ }
371
+ function de(t) {
372
+ if (0 <= t.y && t.y < 100) {
373
+ var e = new Date(Date.UTC(-1, t.m, t.d, t.H, t.M, t.S, t.L));
374
+ return e.setUTCFullYear(t.y), e;
375
+ }
376
+ return new Date(Date.UTC(t.y, t.m, t.d, t.H, t.M, t.S, t.L));
377
+ }
378
+ function Lt(t, e, n) {
379
+ return { y: t, m: e, d: n, H: 0, M: 0, S: 0, L: 0 };
380
+ }
381
+ function Dr(t) {
382
+ var e = t.dateTime, n = t.date, r = t.time, a = t.periods, i = t.days, s = t.shortDays, y = t.months, _ = t.shortMonths, p = At(a), g = It(a), E = At(i), C = It(i), b = At(s), G = It(s), O = At(y), M = It(y), I = At(_), V = It(_), W = {
383
+ a: d,
384
+ A: w,
385
+ b: c,
386
+ B: l,
387
+ c: null,
388
+ d: Re,
389
+ e: Re,
390
+ f: Gr,
391
+ g: ra,
392
+ G: ia,
393
+ H: Br,
394
+ I: Zr,
395
+ j: qr,
396
+ L: gn,
397
+ m: Xr,
398
+ M: jr,
399
+ p: o,
400
+ q: P,
401
+ Q: qe,
402
+ s: Ge,
403
+ S: Qr,
404
+ u: $r,
405
+ U: Jr,
406
+ V: Kr,
407
+ w: ta,
408
+ W: ea,
409
+ x: null,
410
+ X: null,
411
+ y: na,
412
+ Y: aa,
413
+ Z: sa,
414
+ "%": Ze
415
+ }, Z = {
416
+ a: z,
417
+ A: R,
418
+ b: K,
419
+ B: X,
420
+ c: null,
421
+ d: Be,
422
+ e: Be,
423
+ f: ua,
424
+ g: Ta,
425
+ G: xa,
426
+ H: oa,
427
+ I: ca,
428
+ j: la,
429
+ L: kn,
430
+ m: fa,
431
+ M: ha,
432
+ p: $,
433
+ q: it,
434
+ Q: qe,
435
+ s: Ge,
436
+ S: da,
437
+ u: ma,
438
+ U: ga,
439
+ V: ya,
440
+ w: ka,
441
+ W: pa,
442
+ x: null,
443
+ X: null,
444
+ y: va,
445
+ Y: ba,
446
+ Z: wa,
447
+ "%": Ze
448
+ }, Q = {
449
+ a: F,
450
+ A: S,
451
+ b: v,
452
+ B: U,
453
+ c: u,
454
+ d: ze,
455
+ e: ze,
456
+ f: Vr,
457
+ g: Ve,
458
+ G: Ne,
459
+ H: Pe,
460
+ I: Pe,
461
+ j: Wr,
462
+ L: Nr,
463
+ m: Ir,
464
+ M: Or,
465
+ p: Y,
466
+ q: Ar,
467
+ Q: Pr,
468
+ s: Rr,
469
+ S: Hr,
470
+ u: Fr,
471
+ U: Yr,
472
+ V: Ur,
473
+ w: Sr,
474
+ W: Er,
475
+ x: m,
476
+ X: T,
477
+ y: Ve,
478
+ Y: Ne,
479
+ Z: Lr,
480
+ "%": zr
481
+ };
482
+ W.x = D(n, W), W.X = D(r, W), W.c = D(e, W), Z.x = D(n, Z), Z.X = D(r, Z), Z.c = D(e, Z);
483
+ function D(k, A) {
484
+ return function(N) {
485
+ var f = [], J = -1, L = 0, j = k.length, q, rt, st;
486
+ for (N instanceof Date || (N = /* @__PURE__ */ new Date(+N)); ++J < j; )
487
+ k.charCodeAt(J) === 37 && (f.push(k.slice(L, J)), (rt = He[q = k.charAt(++J)]) != null ? q = k.charAt(++J) : rt = q === "e" ? " " : "0", (st = A[q]) && (q = st(N, rt)), f.push(q), L = J + 1);
488
+ return f.push(k.slice(L, J)), f.join("");
489
+ };
490
+ }
491
+ function H(k, A) {
492
+ return function(N) {
493
+ var f = Lt(1900, void 0, 1), J = x(f, k, N += "", 0), L, j;
494
+ if (J != N.length) return null;
495
+ if ("Q" in f) return new Date(f.Q);
496
+ if ("s" in f) return new Date(f.s * 1e3 + ("L" in f ? f.L : 0));
497
+ 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) {
498
+ if (f.V < 1 || f.V > 53) return null;
499
+ "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 ? Ht.ceil(L) : Ht(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);
500
+ } 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);
501
+ return "Z" in f ? (f.H += f.Z / 100 | 0, f.M += f.Z % 100, de(f)) : he(f);
502
+ };
503
+ }
504
+ function x(k, A, N, f) {
505
+ for (var J = 0, L = A.length, j = N.length, q, rt; J < L; ) {
506
+ if (f >= j) return -1;
507
+ if (q = A.charCodeAt(J++), q === 37) {
508
+ if (q = A.charAt(J++), rt = Q[q in He ? A.charAt(J++) : q], !rt || (f = rt(k, N, f)) < 0) return -1;
509
+ } else if (q != N.charCodeAt(f++))
510
+ return -1;
511
+ }
512
+ return f;
513
+ }
514
+ function Y(k, A, N) {
515
+ var f = p.exec(A.slice(N));
516
+ return f ? (k.p = g.get(f[0].toLowerCase()), N + f[0].length) : -1;
517
+ }
518
+ function F(k, A, N) {
519
+ var f = b.exec(A.slice(N));
520
+ return f ? (k.w = G.get(f[0].toLowerCase()), N + f[0].length) : -1;
521
+ }
522
+ function S(k, A, N) {
523
+ var f = E.exec(A.slice(N));
524
+ return f ? (k.w = C.get(f[0].toLowerCase()), N + f[0].length) : -1;
525
+ }
526
+ function v(k, A, N) {
527
+ var f = I.exec(A.slice(N));
528
+ return f ? (k.m = V.get(f[0].toLowerCase()), N + f[0].length) : -1;
529
+ }
530
+ function U(k, A, N) {
531
+ var f = O.exec(A.slice(N));
532
+ return f ? (k.m = M.get(f[0].toLowerCase()), N + f[0].length) : -1;
533
+ }
534
+ function u(k, A, N) {
535
+ return x(k, e, A, N);
536
+ }
537
+ function m(k, A, N) {
538
+ return x(k, n, A, N);
539
+ }
540
+ function T(k, A, N) {
541
+ return x(k, r, A, N);
542
+ }
543
+ function d(k) {
544
+ return s[k.getDay()];
545
+ }
546
+ function w(k) {
547
+ return i[k.getDay()];
548
+ }
549
+ function c(k) {
550
+ return _[k.getMonth()];
551
+ }
552
+ function l(k) {
553
+ return y[k.getMonth()];
554
+ }
555
+ function o(k) {
556
+ return a[+(k.getHours() >= 12)];
557
+ }
558
+ function P(k) {
559
+ return 1 + ~~(k.getMonth() / 3);
560
+ }
561
+ function z(k) {
562
+ return s[k.getUTCDay()];
563
+ }
564
+ function R(k) {
565
+ return i[k.getUTCDay()];
566
+ }
567
+ function K(k) {
568
+ return _[k.getUTCMonth()];
569
+ }
570
+ function X(k) {
571
+ return y[k.getUTCMonth()];
572
+ }
573
+ function $(k) {
574
+ return a[+(k.getUTCHours() >= 12)];
575
+ }
576
+ function it(k) {
577
+ return 1 + ~~(k.getUTCMonth() / 3);
578
+ }
579
+ return {
580
+ format: function(k) {
581
+ var A = D(k += "", W);
582
+ return A.toString = function() {
583
+ return k;
584
+ }, A;
585
+ },
586
+ parse: function(k) {
587
+ var A = H(k += "", !1);
588
+ return A.toString = function() {
589
+ return k;
590
+ }, A;
591
+ },
592
+ utcFormat: function(k) {
593
+ var A = D(k += "", Z);
594
+ return A.toString = function() {
595
+ return k;
596
+ }, A;
597
+ },
598
+ utcParse: function(k) {
599
+ var A = H(k += "", !0);
600
+ return A.toString = function() {
601
+ return k;
602
+ }, A;
603
+ }
604
+ };
605
+ }
606
+ var He = { "-": "", _: " ", 0: "0" }, nt = /^\s*\d+/, Cr = /^%/, Mr = /[\\^$*+?|[\]().{}]/g;
607
+ function B(t, e, n) {
608
+ var r = t < 0 ? "-" : "", a = (r ? -t : t) + "", i = a.length;
609
+ return r + (i < n ? new Array(n - i + 1).join(e) + a : a);
610
+ }
611
+ function _r(t) {
612
+ return t.replace(Mr, "\\$&");
613
+ }
614
+ function At(t) {
615
+ return new RegExp("^(?:" + t.map(_r).join("|") + ")", "i");
616
+ }
617
+ function It(t) {
618
+ return new Map(t.map((e, n) => [e.toLowerCase(), n]));
619
+ }
620
+ function Sr(t, e, n) {
621
+ var r = nt.exec(e.slice(n, n + 1));
622
+ return r ? (t.w = +r[0], n + r[0].length) : -1;
623
+ }
624
+ function Fr(t, e, n) {
625
+ var r = nt.exec(e.slice(n, n + 1));
626
+ return r ? (t.u = +r[0], n + r[0].length) : -1;
627
+ }
628
+ function Yr(t, e, n) {
629
+ var r = nt.exec(e.slice(n, n + 2));
630
+ return r ? (t.U = +r[0], n + r[0].length) : -1;
631
+ }
632
+ function Ur(t, e, n) {
633
+ var r = nt.exec(e.slice(n, n + 2));
634
+ return r ? (t.V = +r[0], n + r[0].length) : -1;
635
+ }
636
+ function Er(t, e, n) {
637
+ var r = nt.exec(e.slice(n, n + 2));
638
+ return r ? (t.W = +r[0], n + r[0].length) : -1;
639
+ }
640
+ function Ne(t, e, n) {
641
+ var r = nt.exec(e.slice(n, n + 4));
642
+ return r ? (t.y = +r[0], n + r[0].length) : -1;
643
+ }
644
+ function Ve(t, e, n) {
645
+ var r = nt.exec(e.slice(n, n + 2));
646
+ return r ? (t.y = +r[0] + (+r[0] > 68 ? 1900 : 2e3), n + r[0].length) : -1;
647
+ }
648
+ function Lr(t, e, n) {
649
+ var r = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n, n + 6));
650
+ return r ? (t.Z = r[1] ? 0 : -(r[2] + (r[3] || "00")), n + r[0].length) : -1;
651
+ }
652
+ function Ar(t, e, n) {
653
+ var r = nt.exec(e.slice(n, n + 1));
654
+ return r ? (t.q = r[0] * 3 - 3, n + r[0].length) : -1;
655
+ }
656
+ function Ir(t, e, n) {
657
+ var r = nt.exec(e.slice(n, n + 2));
658
+ return r ? (t.m = r[0] - 1, n + r[0].length) : -1;
659
+ }
660
+ function ze(t, e, n) {
661
+ var r = nt.exec(e.slice(n, n + 2));
662
+ return r ? (t.d = +r[0], n + r[0].length) : -1;
663
+ }
664
+ function Wr(t, e, n) {
665
+ var r = nt.exec(e.slice(n, n + 3));
666
+ return r ? (t.m = 0, t.d = +r[0], n + r[0].length) : -1;
667
+ }
668
+ function Pe(t, e, n) {
669
+ var r = nt.exec(e.slice(n, n + 2));
670
+ return r ? (t.H = +r[0], n + r[0].length) : -1;
671
+ }
672
+ function Or(t, e, n) {
673
+ var r = nt.exec(e.slice(n, n + 2));
674
+ return r ? (t.M = +r[0], n + r[0].length) : -1;
675
+ }
676
+ function Hr(t, e, n) {
677
+ var r = nt.exec(e.slice(n, n + 2));
678
+ return r ? (t.S = +r[0], n + r[0].length) : -1;
679
+ }
680
+ function Nr(t, e, n) {
681
+ var r = nt.exec(e.slice(n, n + 3));
682
+ return r ? (t.L = +r[0], n + r[0].length) : -1;
683
+ }
684
+ function Vr(t, e, n) {
685
+ var r = nt.exec(e.slice(n, n + 6));
686
+ return r ? (t.L = Math.floor(r[0] / 1e3), n + r[0].length) : -1;
687
+ }
688
+ function zr(t, e, n) {
689
+ var r = Cr.exec(e.slice(n, n + 1));
690
+ return r ? n + r[0].length : -1;
691
+ }
692
+ function Pr(t, e, n) {
693
+ var r = nt.exec(e.slice(n));
694
+ return r ? (t.Q = +r[0], n + r[0].length) : -1;
695
+ }
696
+ function Rr(t, e, n) {
697
+ var r = nt.exec(e.slice(n));
698
+ return r ? (t.s = +r[0], n + r[0].length) : -1;
699
+ }
700
+ function Re(t, e) {
701
+ return B(t.getDate(), e, 2);
702
+ }
703
+ function Br(t, e) {
704
+ return B(t.getHours(), e, 2);
705
+ }
706
+ function Zr(t, e) {
707
+ return B(t.getHours() % 12 || 12, e, 2);
708
+ }
709
+ function qr(t, e) {
710
+ return B(1 + Tt.count(kt(t), t), e, 3);
711
+ }
712
+ function gn(t, e) {
713
+ return B(t.getMilliseconds(), e, 3);
714
+ }
715
+ function Gr(t, e) {
716
+ return gn(t, e) + "000";
717
+ }
718
+ function Xr(t, e) {
719
+ return B(t.getMonth() + 1, e, 2);
720
+ }
721
+ function jr(t, e) {
722
+ return B(t.getMinutes(), e, 2);
723
+ }
724
+ function Qr(t, e) {
725
+ return B(t.getSeconds(), e, 2);
726
+ }
727
+ function $r(t) {
728
+ var e = t.getDay();
729
+ return e === 0 ? 7 : e;
730
+ }
731
+ function Jr(t, e) {
732
+ return B(Vt.count(kt(t) - 1, t), e, 2);
733
+ }
734
+ function yn(t) {
735
+ var e = t.getDay();
736
+ return e >= 4 || e === 0 ? bt(t) : bt.ceil(t);
737
+ }
738
+ function Kr(t, e) {
739
+ return t = yn(t), B(bt.count(kt(t), t) + (kt(t).getDay() === 4), e, 2);
740
+ }
741
+ function ta(t) {
742
+ return t.getDay();
743
+ }
744
+ function ea(t, e) {
745
+ return B(Ht.count(kt(t) - 1, t), e, 2);
746
+ }
747
+ function na(t, e) {
748
+ return B(t.getFullYear() % 100, e, 2);
749
+ }
750
+ function ra(t, e) {
751
+ return t = yn(t), B(t.getFullYear() % 100, e, 2);
752
+ }
753
+ function aa(t, e) {
754
+ return B(t.getFullYear() % 1e4, e, 4);
755
+ }
756
+ function ia(t, e) {
757
+ var n = t.getDay();
758
+ return t = n >= 4 || n === 0 ? bt(t) : bt.ceil(t), B(t.getFullYear() % 1e4, e, 4);
759
+ }
760
+ function sa(t) {
761
+ var e = t.getTimezoneOffset();
762
+ return (e > 0 ? "-" : (e *= -1, "+")) + B(e / 60 | 0, "0", 2) + B(e % 60, "0", 2);
763
+ }
764
+ function Be(t, e) {
765
+ return B(t.getUTCDate(), e, 2);
766
+ }
767
+ function oa(t, e) {
768
+ return B(t.getUTCHours(), e, 2);
769
+ }
770
+ function ca(t, e) {
771
+ return B(t.getUTCHours() % 12 || 12, e, 2);
772
+ }
773
+ function la(t, e) {
774
+ return B(1 + we.count(xt(t), t), e, 3);
775
+ }
776
+ function kn(t, e) {
777
+ return B(t.getUTCMilliseconds(), e, 3);
778
+ }
779
+ function ua(t, e) {
780
+ return kn(t, e) + "000";
781
+ }
782
+ function fa(t, e) {
783
+ return B(t.getUTCMonth() + 1, e, 2);
784
+ }
785
+ function ha(t, e) {
786
+ return B(t.getUTCMinutes(), e, 2);
787
+ }
788
+ function da(t, e) {
789
+ return B(t.getUTCSeconds(), e, 2);
790
+ }
791
+ function ma(t) {
792
+ var e = t.getUTCDay();
793
+ return e === 0 ? 7 : e;
794
+ }
795
+ function ga(t, e) {
796
+ return B(mn.count(xt(t) - 1, t), e, 2);
797
+ }
798
+ function pn(t) {
799
+ var e = t.getUTCDay();
800
+ return e >= 4 || e === 0 ? Ut(t) : Ut.ceil(t);
801
+ }
802
+ function ya(t, e) {
803
+ return t = pn(t), B(Ut.count(xt(t), t) + (xt(t).getUTCDay() === 4), e, 2);
804
+ }
805
+ function ka(t) {
806
+ return t.getUTCDay();
807
+ }
808
+ function pa(t, e) {
809
+ return B(Jt.count(xt(t) - 1, t), e, 2);
810
+ }
811
+ function va(t, e) {
812
+ return B(t.getUTCFullYear() % 100, e, 2);
813
+ }
814
+ function Ta(t, e) {
815
+ return t = pn(t), B(t.getUTCFullYear() % 100, e, 2);
816
+ }
817
+ function ba(t, e) {
818
+ return B(t.getUTCFullYear() % 1e4, e, 4);
819
+ }
820
+ function xa(t, e) {
821
+ var n = t.getUTCDay();
822
+ return t = n >= 4 || n === 0 ? Ut(t) : Ut.ceil(t), B(t.getUTCFullYear() % 1e4, e, 4);
823
+ }
824
+ function wa() {
825
+ return "+0000";
826
+ }
827
+ function Ze() {
828
+ return "%";
829
+ }
830
+ function qe(t) {
831
+ return +t;
832
+ }
833
+ function Ge(t) {
834
+ return Math.floor(+t / 1e3);
835
+ }
836
+ var Mt, Kt;
837
+ Da({
838
+ dateTime: "%x, %X",
839
+ date: "%-m/%-d/%Y",
840
+ time: "%-I:%M:%S %p",
841
+ periods: ["AM", "PM"],
842
+ days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
843
+ shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
844
+ months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
845
+ shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
846
+ });
847
+ function Da(t) {
848
+ return Mt = Dr(t), Kt = Mt.format, Mt.parse, Mt.utcFormat, Mt.utcParse, Mt;
849
+ }
850
+ function Ca(t) {
851
+ return new Date(t);
852
+ }
853
+ function Ma(t) {
854
+ return t instanceof Date ? +t : +/* @__PURE__ */ new Date(+t);
855
+ }
856
+ function vn(t, e, n, r, a, i, s, y, _, p) {
857
+ var g = Zn(), E = g.invert, C = g.domain, b = p(".%L"), G = p(":%S"), O = p("%I:%M"), M = p("%I %p"), I = p("%a %d"), V = p("%b %d"), W = p("%B"), Z = p("%Y");
858
+ function Q(D) {
859
+ return (_(D) < D ? b : y(D) < D ? G : s(D) < D ? O : i(D) < D ? M : r(D) < D ? a(D) < D ? I : V : n(D) < D ? W : Z)(D);
860
+ }
861
+ return g.invert = function(D) {
862
+ return new Date(E(D));
863
+ }, g.domain = function(D) {
864
+ return arguments.length ? C(Array.from(D, Ma)) : C().map(Ca);
865
+ }, g.ticks = function(D) {
866
+ var H = C();
867
+ return t(H[0], H[H.length - 1], D ?? 10);
868
+ }, g.tickFormat = function(D, H) {
869
+ return H == null ? Q : p(H);
870
+ }, g.nice = function(D) {
871
+ var H = C();
872
+ return (!D || typeof D.range != "function") && (D = e(H[0], H[H.length - 1], D ?? 10)), D ? C(hr(H, D)) : g;
873
+ }, g.copy = function() {
874
+ return qn(g, vn(t, e, n, r, a, i, s, y, _, p));
875
+ }, g;
876
+ }
877
+ function _a() {
878
+ return Xn.apply(vn(xr, wr, kt, Nt, Vt, Tt, Ot, Wt, vt, Kt).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]), arguments);
879
+ }
880
+ var Tn = { exports: {} };
881
+ (function(t, e) {
882
+ (function(n, r) {
883
+ t.exports = r();
884
+ })(Te, function() {
885
+ var n = "day";
886
+ return function(r, a, i) {
887
+ var s = function(p) {
888
+ return p.add(4 - p.isoWeekday(), n);
889
+ }, y = a.prototype;
890
+ y.isoWeekYear = function() {
891
+ return s(this).year();
892
+ }, y.isoWeek = function(p) {
893
+ if (!this.$utils().u(p)) return this.add(7 * (p - this.isoWeek()), n);
894
+ var g, E, C, b, G = s(this), O = (g = this.isoWeekYear(), E = this.$u, C = (E ? i.utc : i)().year(g).startOf("year"), b = 4 - C.isoWeekday(), C.isoWeekday() > 4 && (b += 7), C.add(b, n));
895
+ return G.diff(O, "week") + 1;
896
+ }, y.isoWeekday = function(p) {
897
+ return this.$utils().u(p) ? this.day() || 7 : this.day(this.day() % 7 ? p : p - 7);
898
+ };
899
+ var _ = y.startOf;
900
+ y.startOf = function(p, g) {
901
+ var E = this.$utils(), C = !!E.u(g) || g;
902
+ return E.p(p) === "isoweek" ? C ? this.date(this.date() - (this.isoWeekday() - 1)).startOf("day") : this.date(this.date() - 1 - (this.isoWeekday() - 1) + 7).endOf("day") : _.bind(this)(p, g);
903
+ };
904
+ };
905
+ });
906
+ })(Tn);
907
+ var Sa = Tn.exports;
908
+ const Fa = /* @__PURE__ */ be(Sa);
909
+ var bn = { exports: {} };
910
+ (function(t, e) {
911
+ (function(n, r) {
912
+ t.exports = r();
913
+ })(Te, function() {
914
+ 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, a = /\d/, i = /\d\d/, s = /\d\d?/, y = /\d*[^-_:/,()\s\d]+/, _ = {}, p = function(M) {
915
+ return (M = +M) + (M > 68 ? 1900 : 2e3);
916
+ }, g = function(M) {
917
+ return function(I) {
918
+ this[M] = +I;
919
+ };
920
+ }, E = [/[+-]\d\d:?(\d\d)?|Z/, function(M) {
921
+ (this.zone || (this.zone = {})).offset = function(I) {
922
+ if (!I || I === "Z") return 0;
923
+ var V = I.match(/([+-]|\d\d)/g), W = 60 * V[1] + (+V[2] || 0);
924
+ return W === 0 ? 0 : V[0] === "+" ? -W : W;
925
+ }(M);
926
+ }], C = function(M) {
927
+ var I = _[M];
928
+ return I && (I.indexOf ? I : I.s.concat(I.f));
929
+ }, b = function(M, I) {
930
+ var V, W = _.meridiem;
931
+ if (W) {
932
+ for (var Z = 1; Z <= 24; Z += 1) if (M.indexOf(W(Z, 0, I)) > -1) {
933
+ V = Z > 12;
934
+ break;
935
+ }
936
+ } else V = M === (I ? "pm" : "PM");
937
+ return V;
938
+ }, G = { A: [y, function(M) {
939
+ this.afternoon = b(M, !1);
940
+ }], a: [y, function(M) {
941
+ this.afternoon = b(M, !0);
942
+ }], Q: [a, function(M) {
943
+ this.month = 3 * (M - 1) + 1;
944
+ }], S: [a, function(M) {
945
+ this.milliseconds = 100 * +M;
946
+ }], SS: [i, function(M) {
947
+ this.milliseconds = 10 * +M;
948
+ }], SSS: [/\d{3}/, function(M) {
949
+ this.milliseconds = +M;
950
+ }], 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: [i, g("day")], Do: [y, function(M) {
951
+ var I = _.ordinal, V = M.match(/\d+/);
952
+ if (this.day = V[0], I) for (var W = 1; W <= 31; W += 1) I(W).replace(/\[|\]/g, "") === M && (this.day = W);
953
+ }], w: [s, g("week")], ww: [i, g("week")], M: [s, g("month")], MM: [i, g("month")], MMM: [y, function(M) {
954
+ var I = C("months"), V = (C("monthsShort") || I.map(function(W) {
955
+ return W.slice(0, 3);
956
+ })).indexOf(M) + 1;
957
+ if (V < 1) throw new Error();
958
+ this.month = V % 12 || V;
959
+ }], MMMM: [y, function(M) {
960
+ var I = C("months").indexOf(M) + 1;
961
+ if (I < 1) throw new Error();
962
+ this.month = I % 12 || I;
963
+ }], Y: [/[+-]?\d+/, g("year")], YY: [i, function(M) {
964
+ this.year = p(M);
965
+ }], YYYY: [/\d{4}/, g("year")], Z: E, ZZ: E };
966
+ function O(M) {
967
+ var I, V;
968
+ I = M, V = _ && _.formats;
969
+ for (var W = (M = I.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(F, S, v) {
970
+ var U = v && v.toUpperCase();
971
+ return S || V[v] || n[v] || V[U].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(u, m, T) {
972
+ return m || T.slice(1);
973
+ });
974
+ })).match(r), Z = W.length, Q = 0; Q < Z; Q += 1) {
975
+ var D = W[Q], H = G[D], x = H && H[0], Y = H && H[1];
976
+ W[Q] = Y ? { regex: x, parser: Y } : D.replace(/^\[|\]$/g, "");
977
+ }
978
+ return function(F) {
979
+ for (var S = {}, v = 0, U = 0; v < Z; v += 1) {
980
+ var u = W[v];
981
+ if (typeof u == "string") U += u.length;
982
+ else {
983
+ var m = u.regex, T = u.parser, d = F.slice(U), w = m.exec(d)[0];
984
+ T.call(S, w), F = F.replace(w, "");
985
+ }
986
+ }
987
+ return function(c) {
988
+ var l = c.afternoon;
989
+ if (l !== void 0) {
990
+ var o = c.hours;
991
+ l ? o < 12 && (c.hours += 12) : o === 12 && (c.hours = 0), delete c.afternoon;
992
+ }
993
+ }(S), S;
994
+ };
995
+ }
996
+ return function(M, I, V) {
997
+ V.p.customParseFormat = !0, M && M.parseTwoDigitYear && (p = M.parseTwoDigitYear);
998
+ var W = I.prototype, Z = W.parse;
999
+ W.parse = function(Q) {
1000
+ var D = Q.date, H = Q.utc, x = Q.args;
1001
+ this.$u = H;
1002
+ var Y = x[1];
1003
+ if (typeof Y == "string") {
1004
+ var F = x[2] === !0, S = x[3] === !0, v = F || S, U = x[2];
1005
+ S && (U = x[2]), _ = this.$locale(), !F && U && (_ = V.Ls[U]), this.$d = function(d, w, c, l) {
1006
+ try {
1007
+ if (["x", "X"].indexOf(w) > -1) return new Date((w === "X" ? 1e3 : 1) * d);
1008
+ var o = O(w)(d), P = o.year, z = o.month, R = o.day, K = o.hours, X = o.minutes, $ = o.seconds, it = o.milliseconds, k = o.zone, A = o.week, N = /* @__PURE__ */ new Date(), f = R || (P || z ? 1 : N.getDate()), J = P || N.getFullYear(), L = 0;
1009
+ P && !z || (L = z > 0 ? z - 1 : N.getMonth());
1010
+ var j, q = K || 0, rt = X || 0, st = $ || 0, pt = it || 0;
1011
+ return k ? new Date(Date.UTC(J, L, f, q, rt, st, pt + 60 * k.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);
1012
+ } catch {
1013
+ return /* @__PURE__ */ new Date("");
1014
+ }
1015
+ }(D, Y, H, V), this.init(), U && U !== !0 && (this.$L = this.locale(U).$L), v && D != this.format(Y) && (this.$d = /* @__PURE__ */ new Date("")), _ = {};
1016
+ } else if (Y instanceof Array) for (var u = Y.length, m = 1; m <= u; m += 1) {
1017
+ x[1] = Y[m - 1];
1018
+ var T = V.apply(this, x);
1019
+ if (T.isValid()) {
1020
+ this.$d = T.$d, this.$L = T.$L, this.init();
1021
+ break;
1022
+ }
1023
+ m === u && (this.$d = /* @__PURE__ */ new Date(""));
1024
+ }
1025
+ else Z.call(this, Q);
1026
+ };
1027
+ };
1028
+ });
1029
+ })(bn);
1030
+ var Ya = bn.exports;
1031
+ const Ua = /* @__PURE__ */ be(Ya);
1032
+ var xn = { exports: {} };
1033
+ (function(t, e) {
1034
+ (function(n, r) {
1035
+ t.exports = r();
1036
+ })(Te, function() {
1037
+ return function(n, r) {
1038
+ var a = r.prototype, i = a.format;
1039
+ a.format = function(s) {
1040
+ var y = this, _ = this.$locale();
1041
+ if (!this.isValid()) return i.bind(this)(s);
1042
+ var p = 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(E) {
1043
+ switch (E) {
1044
+ case "Q":
1045
+ return Math.ceil((y.$M + 1) / 3);
1046
+ case "Do":
1047
+ return _.ordinal(y.$D);
1048
+ case "gggg":
1049
+ return y.weekYear();
1050
+ case "GGGG":
1051
+ return y.isoWeekYear();
1052
+ case "wo":
1053
+ return _.ordinal(y.week(), "W");
1054
+ case "w":
1055
+ case "ww":
1056
+ return p.s(y.week(), E === "w" ? 1 : 2, "0");
1057
+ case "W":
1058
+ case "WW":
1059
+ return p.s(y.isoWeek(), E === "W" ? 1 : 2, "0");
1060
+ case "k":
1061
+ case "kk":
1062
+ return p.s(String(y.$H === 0 ? 24 : y.$H), E === "k" ? 1 : 2, "0");
1063
+ case "X":
1064
+ return Math.floor(y.$d.getTime() / 1e3);
1065
+ case "x":
1066
+ return y.$d.getTime();
1067
+ case "z":
1068
+ return "[" + y.offsetName() + "]";
1069
+ case "zzz":
1070
+ return "[" + y.offsetName("long") + "]";
1071
+ default:
1072
+ return E;
1073
+ }
1074
+ });
1075
+ return i.bind(this)(g);
1076
+ };
1077
+ };
1078
+ });
1079
+ })(xn);
1080
+ var Ea = xn.exports;
1081
+ const La = /* @__PURE__ */ be(Ea);
1082
+ var ye = function() {
1083
+ var t = /* @__PURE__ */ h(function(U, u, m, T) {
1084
+ for (m = m || {}, T = U.length; T--; m[U[T]] = u) ;
1085
+ return m;
1086
+ }, "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], a = [1, 28], i = [1, 29], s = [1, 30], y = [1, 31], _ = [1, 32], p = [1, 33], g = [1, 34], E = [1, 9], C = [1, 10], b = [1, 11], G = [1, 12], O = [1, 13], M = [1, 14], I = [1, 15], V = [1, 16], W = [1, 19], Z = [1, 20], Q = [1, 21], D = [1, 22], H = [1, 23], x = [1, 25], Y = [1, 35], F = {
1087
+ trace: /* @__PURE__ */ h(function() {
1088
+ }, "trace"),
1089
+ yy: {},
1090
+ 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 },
1091
+ 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" },
1092
+ 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]],
1093
+ performAction: /* @__PURE__ */ h(function(u, m, T, d, w, c, l) {
1094
+ var o = c.length - 1;
1095
+ switch (w) {
1096
+ case 1:
1097
+ return c[o - 1];
1098
+ case 2:
1099
+ this.$ = [];
1100
+ break;
1101
+ case 3:
1102
+ c[o - 1].push(c[o]), this.$ = c[o - 1];
1103
+ break;
1104
+ case 4:
1105
+ case 5:
1106
+ this.$ = c[o];
1107
+ break;
1108
+ case 6:
1109
+ case 7:
1110
+ this.$ = [];
1111
+ break;
1112
+ case 8:
1113
+ d.setWeekday("monday");
1114
+ break;
1115
+ case 9:
1116
+ d.setWeekday("tuesday");
1117
+ break;
1118
+ case 10:
1119
+ d.setWeekday("wednesday");
1120
+ break;
1121
+ case 11:
1122
+ d.setWeekday("thursday");
1123
+ break;
1124
+ case 12:
1125
+ d.setWeekday("friday");
1126
+ break;
1127
+ case 13:
1128
+ d.setWeekday("saturday");
1129
+ break;
1130
+ case 14:
1131
+ d.setWeekday("sunday");
1132
+ break;
1133
+ case 15:
1134
+ d.setWeekend("friday");
1135
+ break;
1136
+ case 16:
1137
+ d.setWeekend("saturday");
1138
+ break;
1139
+ case 17:
1140
+ d.setDateFormat(c[o].substr(11)), this.$ = c[o].substr(11);
1141
+ break;
1142
+ case 18:
1143
+ d.enableInclusiveEndDates(), this.$ = c[o].substr(18);
1144
+ break;
1145
+ case 19:
1146
+ d.TopAxis(), this.$ = c[o].substr(8);
1147
+ break;
1148
+ case 20:
1149
+ d.setAxisFormat(c[o].substr(11)), this.$ = c[o].substr(11);
1150
+ break;
1151
+ case 21:
1152
+ d.setTickInterval(c[o].substr(13)), this.$ = c[o].substr(13);
1153
+ break;
1154
+ case 22:
1155
+ d.setExcludes(c[o].substr(9)), this.$ = c[o].substr(9);
1156
+ break;
1157
+ case 23:
1158
+ d.setIncludes(c[o].substr(9)), this.$ = c[o].substr(9);
1159
+ break;
1160
+ case 24:
1161
+ d.setTodayMarker(c[o].substr(12)), this.$ = c[o].substr(12);
1162
+ break;
1163
+ case 27:
1164
+ d.setDiagramTitle(c[o].substr(6)), this.$ = c[o].substr(6);
1165
+ break;
1166
+ case 28:
1167
+ this.$ = c[o].trim(), d.setAccTitle(this.$);
1168
+ break;
1169
+ case 29:
1170
+ case 30:
1171
+ this.$ = c[o].trim(), d.setAccDescription(this.$);
1172
+ break;
1173
+ case 31:
1174
+ d.addSection(c[o].substr(8)), this.$ = c[o].substr(8);
1175
+ break;
1176
+ case 33:
1177
+ d.addTask(c[o - 1], c[o]), this.$ = "task";
1178
+ break;
1179
+ case 34:
1180
+ this.$ = c[o - 1], d.setClickEvent(c[o - 1], c[o], null);
1181
+ break;
1182
+ case 35:
1183
+ this.$ = c[o - 2], d.setClickEvent(c[o - 2], c[o - 1], c[o]);
1184
+ break;
1185
+ case 36:
1186
+ this.$ = c[o - 2], d.setClickEvent(c[o - 2], c[o - 1], null), d.setLink(c[o - 2], c[o]);
1187
+ break;
1188
+ case 37:
1189
+ this.$ = c[o - 3], d.setClickEvent(c[o - 3], c[o - 2], c[o - 1]), d.setLink(c[o - 3], c[o]);
1190
+ break;
1191
+ case 38:
1192
+ this.$ = c[o - 2], d.setClickEvent(c[o - 2], c[o], null), d.setLink(c[o - 2], c[o - 1]);
1193
+ break;
1194
+ case 39:
1195
+ this.$ = c[o - 3], d.setClickEvent(c[o - 3], c[o - 1], c[o]), d.setLink(c[o - 3], c[o - 2]);
1196
+ break;
1197
+ case 40:
1198
+ this.$ = c[o - 1], d.setLink(c[o - 1], c[o]);
1199
+ break;
1200
+ case 41:
1201
+ case 47:
1202
+ this.$ = c[o - 1] + " " + c[o];
1203
+ break;
1204
+ case 42:
1205
+ case 43:
1206
+ case 45:
1207
+ this.$ = c[o - 2] + " " + c[o - 1] + " " + c[o];
1208
+ break;
1209
+ case 44:
1210
+ case 46:
1211
+ this.$ = c[o - 3] + " " + c[o - 2] + " " + c[o - 1] + " " + c[o];
1212
+ break;
1213
+ }
1214
+ }, "anonymous"),
1215
+ 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: a, 15: i, 16: s, 17: y, 18: _, 19: 18, 20: p, 21: g, 22: E, 23: C, 24: b, 25: G, 26: O, 27: M, 28: I, 29: V, 30: W, 31: Z, 33: Q, 35: D, 36: H, 37: 24, 38: x, 40: Y }, t(e, [2, 7], { 1: [2, 1] }), t(e, [2, 3]), { 9: 36, 11: 17, 12: n, 13: r, 14: a, 15: i, 16: s, 17: y, 18: _, 19: 18, 20: p, 21: g, 22: E, 23: C, 24: b, 25: G, 26: O, 27: M, 28: I, 29: V, 30: W, 31: Z, 33: Q, 35: D, 36: H, 37: 24, 38: x, 40: Y }, 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])],
1216
+ defaultActions: {},
1217
+ parseError: /* @__PURE__ */ h(function(u, m) {
1218
+ if (m.recoverable)
1219
+ this.trace(u);
1220
+ else {
1221
+ var T = new Error(u);
1222
+ throw T.hash = m, T;
1223
+ }
1224
+ }, "parseError"),
1225
+ parse: /* @__PURE__ */ h(function(u) {
1226
+ var m = this, T = [0], d = [], w = [null], c = [], l = this.table, o = "", P = 0, z = 0, R = 2, K = 1, X = c.slice.call(arguments, 1), $ = Object.create(this.lexer), it = { yy: {} };
1227
+ for (var k in this.yy)
1228
+ Object.prototype.hasOwnProperty.call(this.yy, k) && (it.yy[k] = this.yy[k]);
1229
+ $.setInput(u, it.yy), it.yy.lexer = $, it.yy.parser = this, typeof $.yylloc > "u" && ($.yylloc = {});
1230
+ var A = $.yylloc;
1231
+ c.push(A);
1232
+ var N = $.options && $.options.ranges;
1233
+ typeof it.yy.parseError == "function" ? this.parseError = it.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
1234
+ function f(ot) {
1235
+ T.length = T.length - 2 * ot, w.length = w.length - ot, c.length = c.length - ot;
1236
+ }
1237
+ h(f, "popStack");
1238
+ function J() {
1239
+ var ot;
1240
+ return ot = d.pop() || $.lex() || K, typeof ot != "number" && (ot instanceof Array && (d = ot, ot = d.pop()), ot = m.symbols_[ot] || ot), ot;
1241
+ }
1242
+ h(J, "lex");
1243
+ for (var L, j, q, rt, st = {}, pt, lt, Ae, Bt; ; ) {
1244
+ if (j = T[T.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]) {
1245
+ var ne = "";
1246
+ Bt = [];
1247
+ for (pt in l[j])
1248
+ this.terminals_[pt] && pt > R && Bt.push("'" + this.terminals_[pt] + "'");
1249
+ $.showPosition ? ne = "Parse error on line " + (P + 1) + `:
1250
+ ` + $.showPosition() + `
1251
+ Expecting ` + Bt.join(", ") + ", got '" + (this.terminals_[L] || L) + "'" : ne = "Parse error on line " + (P + 1) + ": Unexpected " + (L == K ? "end of input" : "'" + (this.terminals_[L] || L) + "'"), this.parseError(ne, {
1252
+ text: $.match,
1253
+ token: this.terminals_[L] || L,
1254
+ line: $.yylineno,
1255
+ loc: A,
1256
+ expected: Bt
1257
+ });
1258
+ }
1259
+ if (q[0] instanceof Array && q.length > 1)
1260
+ throw new Error("Parse Error: multiple actions possible at state: " + j + ", token: " + L);
1261
+ switch (q[0]) {
1262
+ case 1:
1263
+ T.push(L), w.push($.yytext), c.push($.yylloc), T.push(q[1]), L = null, z = $.yyleng, o = $.yytext, P = $.yylineno, A = $.yylloc;
1264
+ break;
1265
+ case 2:
1266
+ if (lt = this.productions_[q[1]][1], st.$ = w[w.length - lt], st._$ = {
1267
+ first_line: c[c.length - (lt || 1)].first_line,
1268
+ last_line: c[c.length - 1].last_line,
1269
+ first_column: c[c.length - (lt || 1)].first_column,
1270
+ last_column: c[c.length - 1].last_column
1271
+ }, N && (st._$.range = [
1272
+ c[c.length - (lt || 1)].range[0],
1273
+ c[c.length - 1].range[1]
1274
+ ]), rt = this.performAction.apply(st, [
1275
+ o,
1276
+ z,
1277
+ P,
1278
+ it.yy,
1279
+ q[1],
1280
+ w,
1281
+ c
1282
+ ].concat(X)), typeof rt < "u")
1283
+ return rt;
1284
+ lt && (T = T.slice(0, -1 * lt * 2), w = w.slice(0, -1 * lt), c = c.slice(0, -1 * lt)), T.push(this.productions_[q[1]][0]), w.push(st.$), c.push(st._$), Ae = l[T[T.length - 2]][T[T.length - 1]], T.push(Ae);
1285
+ break;
1286
+ case 3:
1287
+ return !0;
1288
+ }
1289
+ }
1290
+ return !0;
1291
+ }, "parse")
1292
+ }, S = /* @__PURE__ */ function() {
1293
+ var U = {
1294
+ EOF: 1,
1295
+ parseError: /* @__PURE__ */ h(function(m, T) {
1296
+ if (this.yy.parser)
1297
+ this.yy.parser.parseError(m, T);
1298
+ else
1299
+ throw new Error(m);
1300
+ }, "parseError"),
1301
+ // resets the lexer, sets new input
1302
+ setInput: /* @__PURE__ */ h(function(u, m) {
1303
+ return this.yy = m || 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 = {
1304
+ first_line: 1,
1305
+ first_column: 0,
1306
+ last_line: 1,
1307
+ last_column: 0
1308
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
1309
+ }, "setInput"),
1310
+ // consumes and returns one char from the input
1311
+ input: /* @__PURE__ */ h(function() {
1312
+ var u = this._input[0];
1313
+ this.yytext += u, this.yyleng++, this.offset++, this.match += u, this.matched += u;
1314
+ var m = u.match(/(?:\r\n?|\n).*/g);
1315
+ 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), u;
1316
+ }, "input"),
1317
+ // unshifts one char (or a string) into the input
1318
+ unput: /* @__PURE__ */ h(function(u) {
1319
+ var m = u.length, T = u.split(/(?:\r\n?|\n)/g);
1320
+ this._input = u + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - m), this.offset -= m;
1321
+ var d = this.match.split(/(?:\r\n?|\n)/g);
1322
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), T.length - 1 && (this.yylineno -= T.length - 1);
1323
+ var w = this.yylloc.range;
1324
+ return this.yylloc = {
1325
+ first_line: this.yylloc.first_line,
1326
+ last_line: this.yylineno + 1,
1327
+ first_column: this.yylloc.first_column,
1328
+ last_column: T ? (T.length === d.length ? this.yylloc.first_column : 0) + d[d.length - T.length].length - T[0].length : this.yylloc.first_column - m
1329
+ }, this.options.ranges && (this.yylloc.range = [w[0], w[0] + this.yyleng - m]), this.yyleng = this.yytext.length, this;
1330
+ }, "unput"),
1331
+ // When called from action, caches matched text and appends it on next action
1332
+ more: /* @__PURE__ */ h(function() {
1333
+ return this._more = !0, this;
1334
+ }, "more"),
1335
+ // 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.
1336
+ reject: /* @__PURE__ */ h(function() {
1337
+ if (this.options.backtrack_lexer)
1338
+ this._backtrack = !0;
1339
+ else
1340
+ 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).
1341
+ ` + this.showPosition(), {
1342
+ text: "",
1343
+ token: null,
1344
+ line: this.yylineno
1345
+ });
1346
+ return this;
1347
+ }, "reject"),
1348
+ // retain first n characters of the match
1349
+ less: /* @__PURE__ */ h(function(u) {
1350
+ this.unput(this.match.slice(u));
1351
+ }, "less"),
1352
+ // displays already matched input, i.e. for error messages
1353
+ pastInput: /* @__PURE__ */ h(function() {
1354
+ var u = this.matched.substr(0, this.matched.length - this.match.length);
1355
+ return (u.length > 20 ? "..." : "") + u.substr(-20).replace(/\n/g, "");
1356
+ }, "pastInput"),
1357
+ // displays upcoming input, i.e. for error messages
1358
+ upcomingInput: /* @__PURE__ */ h(function() {
1359
+ var u = this.match;
1360
+ return u.length < 20 && (u += this._input.substr(0, 20 - u.length)), (u.substr(0, 20) + (u.length > 20 ? "..." : "")).replace(/\n/g, "");
1361
+ }, "upcomingInput"),
1362
+ // displays the character position where the lexing error occurred, i.e. for error messages
1363
+ showPosition: /* @__PURE__ */ h(function() {
1364
+ var u = this.pastInput(), m = new Array(u.length + 1).join("-");
1365
+ return u + this.upcomingInput() + `
1366
+ ` + m + "^";
1367
+ }, "showPosition"),
1368
+ // test the lexed token: return FALSE when not a match, otherwise return token
1369
+ test_match: /* @__PURE__ */ h(function(u, m) {
1370
+ var T, d, w;
1371
+ if (this.options.backtrack_lexer && (w = {
1372
+ yylineno: this.yylineno,
1373
+ yylloc: {
1374
+ first_line: this.yylloc.first_line,
1375
+ last_line: this.last_line,
1376
+ first_column: this.yylloc.first_column,
1377
+ last_column: this.yylloc.last_column
1378
+ },
1379
+ yytext: this.yytext,
1380
+ match: this.match,
1381
+ matches: this.matches,
1382
+ matched: this.matched,
1383
+ yyleng: this.yyleng,
1384
+ offset: this.offset,
1385
+ _more: this._more,
1386
+ _input: this._input,
1387
+ yy: this.yy,
1388
+ conditionStack: this.conditionStack.slice(0),
1389
+ done: this.done
1390
+ }, this.options.ranges && (w.yylloc.range = this.yylloc.range.slice(0))), d = u[0].match(/(?:\r\n?|\n).*/g), d && (this.yylineno += d.length), this.yylloc = {
1391
+ first_line: this.yylloc.last_line,
1392
+ last_line: this.yylineno + 1,
1393
+ first_column: this.yylloc.last_column,
1394
+ last_column: d ? d[d.length - 1].length - d[d.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + u[0].length
1395
+ }, 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], T = this.performAction.call(this, this.yy, this, m, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), T)
1396
+ return T;
1397
+ if (this._backtrack) {
1398
+ for (var c in w)
1399
+ this[c] = w[c];
1400
+ return !1;
1401
+ }
1402
+ return !1;
1403
+ }, "test_match"),
1404
+ // return next match in input
1405
+ next: /* @__PURE__ */ h(function() {
1406
+ if (this.done)
1407
+ return this.EOF;
1408
+ this._input || (this.done = !0);
1409
+ var u, m, T, d;
1410
+ this._more || (this.yytext = "", this.match = "");
1411
+ for (var w = this._currentRules(), c = 0; c < w.length; c++)
1412
+ if (T = this._input.match(this.rules[w[c]]), T && (!m || T[0].length > m[0].length)) {
1413
+ if (m = T, d = c, this.options.backtrack_lexer) {
1414
+ if (u = this.test_match(T, w[c]), u !== !1)
1415
+ return u;
1416
+ if (this._backtrack) {
1417
+ m = !1;
1418
+ continue;
1419
+ } else
1420
+ return !1;
1421
+ } else if (!this.options.flex)
1422
+ break;
1423
+ }
1424
+ return m ? (u = this.test_match(m, w[d]), u !== !1 ? u : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
1425
+ ` + this.showPosition(), {
1426
+ text: "",
1427
+ token: null,
1428
+ line: this.yylineno
1429
+ });
1430
+ }, "next"),
1431
+ // return next match that has a token
1432
+ lex: /* @__PURE__ */ h(function() {
1433
+ var m = this.next();
1434
+ return m || this.lex();
1435
+ }, "lex"),
1436
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
1437
+ begin: /* @__PURE__ */ h(function(m) {
1438
+ this.conditionStack.push(m);
1439
+ }, "begin"),
1440
+ // pop the previously active lexer condition state off the condition stack
1441
+ popState: /* @__PURE__ */ h(function() {
1442
+ var m = this.conditionStack.length - 1;
1443
+ return m > 0 ? this.conditionStack.pop() : this.conditionStack[0];
1444
+ }, "popState"),
1445
+ // produce the lexer rule set which is active for the currently active lexer condition state
1446
+ _currentRules: /* @__PURE__ */ h(function() {
1447
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
1448
+ }, "_currentRules"),
1449
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
1450
+ topState: /* @__PURE__ */ h(function(m) {
1451
+ return m = this.conditionStack.length - 1 - Math.abs(m || 0), m >= 0 ? this.conditionStack[m] : "INITIAL";
1452
+ }, "topState"),
1453
+ // alias for begin(condition)
1454
+ pushState: /* @__PURE__ */ h(function(m) {
1455
+ this.begin(m);
1456
+ }, "pushState"),
1457
+ // return the number of states currently on the stack
1458
+ stateStackSize: /* @__PURE__ */ h(function() {
1459
+ return this.conditionStack.length;
1460
+ }, "stateStackSize"),
1461
+ options: { "case-insensitive": !0 },
1462
+ performAction: /* @__PURE__ */ h(function(m, T, d, w) {
1463
+ switch (d) {
1464
+ case 0:
1465
+ return this.begin("open_directive"), "open_directive";
1466
+ case 1:
1467
+ return this.begin("acc_title"), 31;
1468
+ case 2:
1469
+ return this.popState(), "acc_title_value";
1470
+ case 3:
1471
+ return this.begin("acc_descr"), 33;
1472
+ case 4:
1473
+ return this.popState(), "acc_descr_value";
1474
+ case 5:
1475
+ this.begin("acc_descr_multiline");
1476
+ break;
1477
+ case 6:
1478
+ this.popState();
1479
+ break;
1480
+ case 7:
1481
+ return "acc_descr_multiline_value";
1482
+ case 8:
1483
+ break;
1484
+ case 9:
1485
+ break;
1486
+ case 10:
1487
+ break;
1488
+ case 11:
1489
+ return 10;
1490
+ case 12:
1491
+ break;
1492
+ case 13:
1493
+ break;
1494
+ case 14:
1495
+ this.begin("href");
1496
+ break;
1497
+ case 15:
1498
+ this.popState();
1499
+ break;
1500
+ case 16:
1501
+ return 43;
1502
+ case 17:
1503
+ this.begin("callbackname");
1504
+ break;
1505
+ case 18:
1506
+ this.popState();
1507
+ break;
1508
+ case 19:
1509
+ this.popState(), this.begin("callbackargs");
1510
+ break;
1511
+ case 20:
1512
+ return 41;
1513
+ case 21:
1514
+ this.popState();
1515
+ break;
1516
+ case 22:
1517
+ return 42;
1518
+ case 23:
1519
+ this.begin("click");
1520
+ break;
1521
+ case 24:
1522
+ this.popState();
1523
+ break;
1524
+ case 25:
1525
+ return 40;
1526
+ case 26:
1527
+ return 4;
1528
+ case 27:
1529
+ return 22;
1530
+ case 28:
1531
+ return 23;
1532
+ case 29:
1533
+ return 24;
1534
+ case 30:
1535
+ return 25;
1536
+ case 31:
1537
+ return 26;
1538
+ case 32:
1539
+ return 28;
1540
+ case 33:
1541
+ return 27;
1542
+ case 34:
1543
+ return 29;
1544
+ case 35:
1545
+ return 12;
1546
+ case 36:
1547
+ return 13;
1548
+ case 37:
1549
+ return 14;
1550
+ case 38:
1551
+ return 15;
1552
+ case 39:
1553
+ return 16;
1554
+ case 40:
1555
+ return 17;
1556
+ case 41:
1557
+ return 18;
1558
+ case 42:
1559
+ return 20;
1560
+ case 43:
1561
+ return 21;
1562
+ case 44:
1563
+ return "date";
1564
+ case 45:
1565
+ return 30;
1566
+ case 46:
1567
+ return "accDescription";
1568
+ case 47:
1569
+ return 36;
1570
+ case 48:
1571
+ return 38;
1572
+ case 49:
1573
+ return 39;
1574
+ case 50:
1575
+ return ":";
1576
+ case 51:
1577
+ return 6;
1578
+ case 52:
1579
+ return "INVALID";
1580
+ }
1581
+ }, "anonymous"),
1582
+ 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],
1583
+ 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 } }
1584
+ };
1585
+ return U;
1586
+ }();
1587
+ F.lexer = S;
1588
+ function v() {
1589
+ this.yy = {};
1590
+ }
1591
+ return h(v, "Parser"), v.prototype = F, F.Parser = v, new v();
1592
+ }();
1593
+ ye.parser = ye;
1594
+ var Aa = ye;
1595
+ at.extend(Fa);
1596
+ at.extend(Ua);
1597
+ at.extend(La);
1598
+ var Xe = { friday: 5, saturday: 6 }, ut = "", De = "", Ce = 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, Ia = /* @__PURE__ */ h(function() {
1599
+ Se = [], te = [], Et = "", Ye = [], Xt = 0, ve = void 0, jt = void 0, tt = [], ut = "", De = "", Fe = "", Ce = void 0, Me = "", zt = [], Pt = [], Rt = !1, Ue = !1, ke = 0, _e = /* @__PURE__ */ new Map(), Pn(), Ee = "sunday", ee = "saturday";
1600
+ }, "clear"), Wa = /* @__PURE__ */ h(function(t) {
1601
+ De = t;
1602
+ }, "setAxisFormat"), Oa = /* @__PURE__ */ h(function() {
1603
+ return De;
1604
+ }, "getAxisFormat"), Ha = /* @__PURE__ */ h(function(t) {
1605
+ Ce = t;
1606
+ }, "setTickInterval"), Na = /* @__PURE__ */ h(function() {
1607
+ return Ce;
1608
+ }, "getTickInterval"), Va = /* @__PURE__ */ h(function(t) {
1609
+ Me = t;
1610
+ }, "setTodayMarker"), za = /* @__PURE__ */ h(function() {
1611
+ return Me;
1612
+ }, "getTodayMarker"), Pa = /* @__PURE__ */ h(function(t) {
1613
+ ut = t;
1614
+ }, "setDateFormat"), Ra = /* @__PURE__ */ h(function() {
1615
+ Rt = !0;
1616
+ }, "enableInclusiveEndDates"), Ba = /* @__PURE__ */ h(function() {
1617
+ return Rt;
1618
+ }, "endDatesAreInclusive"), Za = /* @__PURE__ */ h(function() {
1619
+ Ue = !0;
1620
+ }, "enableTopAxis"), qa = /* @__PURE__ */ h(function() {
1621
+ return Ue;
1622
+ }, "topAxisEnabled"), Ga = /* @__PURE__ */ h(function(t) {
1623
+ Fe = t;
1624
+ }, "setDisplayMode"), Xa = /* @__PURE__ */ h(function() {
1625
+ return Fe;
1626
+ }, "getDisplayMode"), ja = /* @__PURE__ */ h(function() {
1627
+ return ut;
1628
+ }, "getDateFormat"), Qa = /* @__PURE__ */ h(function(t) {
1629
+ zt = t.toLowerCase().split(/[\s,]+/);
1630
+ }, "setIncludes"), $a = /* @__PURE__ */ h(function() {
1631
+ return zt;
1632
+ }, "getIncludes"), Ja = /* @__PURE__ */ h(function(t) {
1633
+ Pt = t.toLowerCase().split(/[\s,]+/);
1634
+ }, "setExcludes"), Ka = /* @__PURE__ */ h(function() {
1635
+ return Pt;
1636
+ }, "getExcludes"), ti = /* @__PURE__ */ h(function() {
1637
+ return _e;
1638
+ }, "getLinks"), ei = /* @__PURE__ */ h(function(t) {
1639
+ Et = t, Se.push(t);
1640
+ }, "addSection"), ni = /* @__PURE__ */ h(function() {
1641
+ return Se;
1642
+ }, "getSections"), ri = /* @__PURE__ */ h(function() {
1643
+ let t = je();
1644
+ const e = 10;
1645
+ let n = 0;
1646
+ for (; !t && n < e; )
1647
+ t = je(), n++;
1648
+ return te = tt, te;
1649
+ }, "getTasks"), Dn = /* @__PURE__ */ h(function(t, e, n, r) {
1650
+ const a = t.format(e.trim()), i = t.format("YYYY-MM-DD");
1651
+ return r.includes(a) || r.includes(i) ? !1 : n.includes("weekends") && (t.isoWeekday() === Xe[ee] || t.isoWeekday() === Xe[ee] + 1) || n.includes(t.format("dddd").toLowerCase()) ? !0 : n.includes(a) || n.includes(i);
1652
+ }, "isInvalidDate"), ai = /* @__PURE__ */ h(function(t) {
1653
+ Ee = t;
1654
+ }, "setWeekday"), ii = /* @__PURE__ */ h(function() {
1655
+ return Ee;
1656
+ }, "getWeekday"), si = /* @__PURE__ */ h(function(t) {
1657
+ ee = t;
1658
+ }, "setWeekend"), Cn = /* @__PURE__ */ h(function(t, e, n, r) {
1659
+ if (!n.length || t.manualEndTime)
1660
+ return;
1661
+ let a;
1662
+ t.startTime instanceof Date ? a = at(t.startTime) : a = at(t.startTime, e, !0), a = a.add(1, "d");
1663
+ let i;
1664
+ t.endTime instanceof Date ? i = at(t.endTime) : i = at(t.endTime, e, !0);
1665
+ const [s, y] = oi(
1666
+ a,
1667
+ i,
1668
+ e,
1669
+ n,
1670
+ r
1671
+ );
1672
+ t.endTime = s.toDate(), t.renderEndTime = y;
1673
+ }, "checkTaskDates"), oi = /* @__PURE__ */ h(function(t, e, n, r, a) {
1674
+ let i = !1, s = null;
1675
+ for (; t <= e; )
1676
+ i || (s = e.toDate()), i = Dn(t, n, r, a), i && (e = e.add(1, "d")), t = t.add(1, "d");
1677
+ return [e, s];
1678
+ }, "fixTaskDates"), pe = /* @__PURE__ */ h(function(t, e, n) {
1679
+ n = n.trim();
1680
+ const a = /^after\s+(?<ids>[\d\w- ]+)/.exec(n);
1681
+ if (a !== null) {
1682
+ let s = null;
1683
+ for (const _ of a.groups.ids.split(" ")) {
1684
+ let p = Ct(_);
1685
+ p !== void 0 && (!s || p.endTime > s.endTime) && (s = p);
1686
+ }
1687
+ if (s)
1688
+ return s.endTime;
1689
+ const y = /* @__PURE__ */ new Date();
1690
+ return y.setHours(0, 0, 0, 0), y;
1691
+ }
1692
+ let i = at(n, e.trim(), !0);
1693
+ if (i.isValid())
1694
+ return i.toDate();
1695
+ {
1696
+ Qt.debug("Invalid date:" + n), Qt.debug("With date format:" + e.trim());
1697
+ const s = new Date(n);
1698
+ if (s === void 0 || isNaN(s.getTime()) || // WebKit browsers can mis-parse invalid dates to be ridiculously
1699
+ // huge numbers, e.g. new Date('202304') gets parsed as January 1, 202304.
1700
+ // This can cause virtually infinite loops while rendering, so for the
1701
+ // purposes of Gantt charts we'll just treat any date beyond 10,000 AD/BC as
1702
+ // invalid.
1703
+ s.getFullYear() < -1e4 || s.getFullYear() > 1e4)
1704
+ throw new Error("Invalid date:" + n);
1705
+ return s;
1706
+ }
1707
+ }, "getStartDate"), Mn = /* @__PURE__ */ h(function(t) {
1708
+ const e = /^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());
1709
+ return e !== null ? [Number.parseFloat(e[1]), e[2]] : [NaN, "ms"];
1710
+ }, "parseDuration"), _n = /* @__PURE__ */ h(function(t, e, n, r = !1) {
1711
+ n = n.trim();
1712
+ const i = /^until\s+(?<ids>[\d\w- ]+)/.exec(n);
1713
+ if (i !== null) {
1714
+ let g = null;
1715
+ for (const C of i.groups.ids.split(" ")) {
1716
+ let b = Ct(C);
1717
+ b !== void 0 && (!g || b.startTime < g.startTime) && (g = b);
1718
+ }
1719
+ if (g)
1720
+ return g.startTime;
1721
+ const E = /* @__PURE__ */ new Date();
1722
+ return E.setHours(0, 0, 0, 0), E;
1723
+ }
1724
+ let s = at(n, e.trim(), !0);
1725
+ if (s.isValid())
1726
+ return r && (s = s.add(1, "d")), s.toDate();
1727
+ let y = at(t);
1728
+ const [_, p] = Mn(n);
1729
+ if (!Number.isNaN(_)) {
1730
+ const g = y.add(_, p);
1731
+ g.isValid() && (y = g);
1732
+ }
1733
+ return y.toDate();
1734
+ }, "getEndDate"), Xt = 0, Ft = /* @__PURE__ */ h(function(t) {
1735
+ return t === void 0 ? (Xt = Xt + 1, "task" + Xt) : t;
1736
+ }, "parseId"), ci = /* @__PURE__ */ h(function(t, e) {
1737
+ let n;
1738
+ e.substr(0, 1) === ":" ? n = e.substr(1, e.length) : n = e;
1739
+ const r = n.split(","), a = {};
1740
+ Le(r, a, wn);
1741
+ for (let s = 0; s < r.length; s++)
1742
+ r[s] = r[s].trim();
1743
+ let i = "";
1744
+ switch (r.length) {
1745
+ case 1:
1746
+ a.id = Ft(), a.startTime = t.endTime, i = r[0];
1747
+ break;
1748
+ case 2:
1749
+ a.id = Ft(), a.startTime = pe(void 0, ut, r[0]), i = r[1];
1750
+ break;
1751
+ case 3:
1752
+ a.id = Ft(r[0]), a.startTime = pe(void 0, ut, r[1]), i = r[2];
1753
+ break;
1754
+ }
1755
+ return i && (a.endTime = _n(a.startTime, ut, i, Rt), a.manualEndTime = at(i, "YYYY-MM-DD", !0).isValid(), Cn(a, ut, Pt, zt)), a;
1756
+ }, "compileData"), li = /* @__PURE__ */ h(function(t, e) {
1757
+ let n;
1758
+ e.substr(0, 1) === ":" ? n = e.substr(1, e.length) : n = e;
1759
+ const r = n.split(","), a = {};
1760
+ Le(r, a, wn);
1761
+ for (let i = 0; i < r.length; i++)
1762
+ r[i] = r[i].trim();
1763
+ switch (r.length) {
1764
+ case 1:
1765
+ a.id = Ft(), a.startTime = {
1766
+ type: "prevTaskEnd",
1767
+ id: t
1768
+ }, a.endTime = {
1769
+ data: r[0]
1770
+ };
1771
+ break;
1772
+ case 2:
1773
+ a.id = Ft(), a.startTime = {
1774
+ type: "getStartDate",
1775
+ startData: r[0]
1776
+ }, a.endTime = {
1777
+ data: r[1]
1778
+ };
1779
+ break;
1780
+ case 3:
1781
+ a.id = Ft(r[0]), a.startTime = {
1782
+ type: "getStartDate",
1783
+ startData: r[1]
1784
+ }, a.endTime = {
1785
+ data: r[2]
1786
+ };
1787
+ break;
1788
+ }
1789
+ return a;
1790
+ }, "parseData"), ve, jt, tt = [], Sn = {}, ui = /* @__PURE__ */ h(function(t, e) {
1791
+ const n = {
1792
+ section: Et,
1793
+ type: Et,
1794
+ processed: !1,
1795
+ manualEndTime: !1,
1796
+ renderEndTime: null,
1797
+ raw: { data: e },
1798
+ task: t,
1799
+ classes: []
1800
+ }, r = li(jt, e);
1801
+ 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++;
1802
+ const a = tt.push(n);
1803
+ jt = n.id, Sn[n.id] = a - 1;
1804
+ }, "addTask"), Ct = /* @__PURE__ */ h(function(t) {
1805
+ const e = Sn[t];
1806
+ return tt[e];
1807
+ }, "findTaskById"), fi = /* @__PURE__ */ h(function(t, e) {
1808
+ const n = {
1809
+ section: Et,
1810
+ type: Et,
1811
+ description: t,
1812
+ task: t,
1813
+ classes: []
1814
+ }, r = ci(ve, e);
1815
+ 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);
1816
+ }, "addTaskOrg"), je = /* @__PURE__ */ h(function() {
1817
+ const t = /* @__PURE__ */ h(function(n) {
1818
+ const r = tt[n];
1819
+ let a = "";
1820
+ switch (tt[n].raw.startTime.type) {
1821
+ case "prevTaskEnd": {
1822
+ const i = Ct(r.prevTaskId);
1823
+ r.startTime = i.endTime;
1824
+ break;
1825
+ }
1826
+ case "getStartDate":
1827
+ a = pe(void 0, ut, tt[n].raw.startTime.startData), a && (tt[n].startTime = a);
1828
+ break;
1829
+ }
1830
+ return tt[n].startTime && (tt[n].endTime = _n(
1831
+ tt[n].startTime,
1832
+ ut,
1833
+ tt[n].raw.endTime.data,
1834
+ Rt
1835
+ ), tt[n].endTime && (tt[n].processed = !0, tt[n].manualEndTime = at(
1836
+ tt[n].raw.endTime.data,
1837
+ "YYYY-MM-DD",
1838
+ !0
1839
+ ).isValid(), Cn(tt[n], ut, Pt, zt))), tt[n].processed;
1840
+ }, "compileTask");
1841
+ let e = !0;
1842
+ for (const [n, r] of tt.entries())
1843
+ t(n), e = e && r.processed;
1844
+ return e;
1845
+ }, "compileTasks"), hi = /* @__PURE__ */ h(function(t, e) {
1846
+ let n = e;
1847
+ _t().securityLevel !== "loose" && (n = zn(e)), t.split(",").forEach(function(r) {
1848
+ Ct(r) !== void 0 && (Yn(r, () => {
1849
+ window.open(n, "_self");
1850
+ }), _e.set(r, n));
1851
+ }), Fn(t, "clickable");
1852
+ }, "setLink"), Fn = /* @__PURE__ */ h(function(t, e) {
1853
+ t.split(",").forEach(function(n) {
1854
+ let r = Ct(n);
1855
+ r !== void 0 && r.classes.push(e);
1856
+ });
1857
+ }, "setClass"), di = /* @__PURE__ */ h(function(t, e, n) {
1858
+ if (_t().securityLevel !== "loose" || e === void 0)
1859
+ return;
1860
+ let r = [];
1861
+ if (typeof n == "string") {
1862
+ r = n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
1863
+ for (let i = 0; i < r.length; i++) {
1864
+ let s = r[i].trim();
1865
+ s.startsWith('"') && s.endsWith('"') && (s = s.substr(1, s.length - 2)), r[i] = s;
1866
+ }
1867
+ }
1868
+ r.length === 0 && r.push(t), Ct(t) !== void 0 && Yn(t, () => {
1869
+ Rn.runFunc(e, ...r);
1870
+ });
1871
+ }, "setClickFun"), Yn = /* @__PURE__ */ h(function(t, e) {
1872
+ Ye.push(
1873
+ function() {
1874
+ const n = document.querySelector(`[id="${t}"]`);
1875
+ n !== null && n.addEventListener("click", function() {
1876
+ e();
1877
+ });
1878
+ },
1879
+ function() {
1880
+ const n = document.querySelector(`[id="${t}-text"]`);
1881
+ n !== null && n.addEventListener("click", function() {
1882
+ e();
1883
+ });
1884
+ }
1885
+ );
1886
+ }, "pushFun"), mi = /* @__PURE__ */ h(function(t, e, n) {
1887
+ t.split(",").forEach(function(r) {
1888
+ di(r, e, n);
1889
+ }), Fn(t, "clickable");
1890
+ }, "setClickEvent"), gi = /* @__PURE__ */ h(function(t) {
1891
+ Ye.forEach(function(e) {
1892
+ e(t);
1893
+ });
1894
+ }, "bindFunctions"), yi = {
1895
+ getConfig: /* @__PURE__ */ h(() => _t().gantt, "getConfig"),
1896
+ clear: Ia,
1897
+ setDateFormat: Pa,
1898
+ getDateFormat: ja,
1899
+ enableInclusiveEndDates: Ra,
1900
+ endDatesAreInclusive: Ba,
1901
+ enableTopAxis: Za,
1902
+ topAxisEnabled: qa,
1903
+ setAxisFormat: Wa,
1904
+ getAxisFormat: Oa,
1905
+ setTickInterval: Ha,
1906
+ getTickInterval: Na,
1907
+ setTodayMarker: Va,
1908
+ getTodayMarker: za,
1909
+ setAccTitle: Hn,
1910
+ getAccTitle: On,
1911
+ setDiagramTitle: Wn,
1912
+ getDiagramTitle: In,
1913
+ setDisplayMode: Ga,
1914
+ getDisplayMode: Xa,
1915
+ setAccDescription: An,
1916
+ getAccDescription: Ln,
1917
+ addSection: ei,
1918
+ getSections: ni,
1919
+ getTasks: ri,
1920
+ addTask: ui,
1921
+ findTaskById: Ct,
1922
+ addTaskOrg: fi,
1923
+ setIncludes: Qa,
1924
+ getIncludes: $a,
1925
+ setExcludes: Ja,
1926
+ getExcludes: Ka,
1927
+ setClickEvent: mi,
1928
+ setLink: hi,
1929
+ getLinks: ti,
1930
+ bindFunctions: gi,
1931
+ parseDuration: Mn,
1932
+ isInvalidDate: Dn,
1933
+ setWeekday: ai,
1934
+ getWeekday: ii,
1935
+ setWeekend: si
1936
+ };
1937
+ function Le(t, e, n) {
1938
+ let r = !0;
1939
+ for (; r; )
1940
+ r = !1, n.forEach(function(a) {
1941
+ const i = "^\\s*" + a + "\\s*$", s = new RegExp(i);
1942
+ t[0].match(s) && (e[a] = !0, t.shift(1), r = !0);
1943
+ });
1944
+ }
1945
+ h(Le, "getTaskTags");
1946
+ var ki = /* @__PURE__ */ h(function() {
1947
+ Qt.debug("Something is calling, setConf, remove the call");
1948
+ }, "setConf"), Qe = {
1949
+ monday: Ht,
1950
+ tuesday: un,
1951
+ wednesday: fn,
1952
+ thursday: bt,
1953
+ friday: hn,
1954
+ saturday: dn,
1955
+ sunday: Vt
1956
+ }, pi = /* @__PURE__ */ h((t, e) => {
1957
+ let n = [...t].map(() => -1 / 0), r = [...t].sort((i, s) => i.startTime - s.startTime || i.order - s.order), a = 0;
1958
+ for (const i of r)
1959
+ for (let s = 0; s < n.length; s++)
1960
+ if (i.startTime >= n[s]) {
1961
+ n[s] = i.endTime, i.order = s + e, s > a && (a = s);
1962
+ break;
1963
+ }
1964
+ return a;
1965
+ }, "getMaxIntersections"), ht, vi = /* @__PURE__ */ h(function(t, e, n, r) {
1966
+ const a = _t().gantt, i = _t().securityLevel;
1967
+ let s;
1968
+ i === "sandbox" && (s = Zt("#i" + e));
1969
+ const y = i === "sandbox" ? Zt(s.nodes()[0].contentDocument.body) : Zt("body"), _ = i === "sandbox" ? s.nodes()[0].contentDocument : document, p = _.getElementById(e);
1970
+ ht = p.parentElement.offsetWidth, ht === void 0 && (ht = 1200), a.useWidth !== void 0 && (ht = a.useWidth);
1971
+ const g = r.db.getTasks();
1972
+ let E = [];
1973
+ for (const x of g)
1974
+ E.push(x.type);
1975
+ E = H(E);
1976
+ const C = {};
1977
+ let b = 2 * a.topPadding;
1978
+ if (r.db.getDisplayMode() === "compact" || a.displayMode === "compact") {
1979
+ const x = {};
1980
+ for (const F of g)
1981
+ x[F.section] === void 0 ? x[F.section] = [F] : x[F.section].push(F);
1982
+ let Y = 0;
1983
+ for (const F of Object.keys(x)) {
1984
+ const S = pi(x[F], Y) + 1;
1985
+ Y += S, b += S * (a.barHeight + a.barGap), C[F] = S;
1986
+ }
1987
+ } else {
1988
+ b += g.length * (a.barHeight + a.barGap);
1989
+ for (const x of E)
1990
+ C[x] = g.filter((Y) => Y.type === x).length;
1991
+ }
1992
+ p.setAttribute("viewBox", "0 0 " + ht + " " + b);
1993
+ const G = y.select(`[id="${e}"]`), O = _a().domain([
1994
+ Qn(g, function(x) {
1995
+ return x.startTime;
1996
+ }),
1997
+ jn(g, function(x) {
1998
+ return x.endTime;
1999
+ })
2000
+ ]).rangeRound([0, ht - a.leftPadding - a.rightPadding]);
2001
+ function M(x, Y) {
2002
+ const F = x.startTime, S = Y.startTime;
2003
+ let v = 0;
2004
+ return F > S ? v = 1 : F < S && (v = -1), v;
2005
+ }
2006
+ h(M, "taskCompare"), g.sort(M), I(g, ht, b), Nn(G, b, ht, a.useMaxWidth), G.append("text").text(r.db.getDiagramTitle()).attr("x", ht / 2).attr("y", a.titleTopMargin).attr("class", "titleText");
2007
+ function I(x, Y, F) {
2008
+ const S = a.barHeight, v = S + a.barGap, U = a.topPadding, u = a.leftPadding, m = Gn().domain([0, E.length]).range(["#00B9FA", "#F95002"]).interpolate(fr);
2009
+ W(
2010
+ v,
2011
+ U,
2012
+ u,
2013
+ Y,
2014
+ F,
2015
+ x,
2016
+ r.db.getExcludes(),
2017
+ r.db.getIncludes()
2018
+ ), Z(u, U, Y, F), V(x, v, U, u, S, m, Y), Q(v, U), D(u, U, Y, F);
2019
+ }
2020
+ h(I, "makeGantt");
2021
+ function V(x, Y, F, S, v, U, u) {
2022
+ x.sort((l, o) => l.vert === o.vert ? 0 : l.vert ? 1 : -1);
2023
+ const T = [...new Set(x.map((l) => l.order))].map((l) => x.find((o) => o.order === l));
2024
+ G.append("g").selectAll("rect").data(T).enter().append("rect").attr("x", 0).attr("y", function(l, o) {
2025
+ return o = l.order, o * Y + F - 2;
2026
+ }).attr("width", function() {
2027
+ return u - a.rightPadding / 2;
2028
+ }).attr("height", Y).attr("class", function(l) {
2029
+ for (const [o, P] of E.entries())
2030
+ if (l.type === P)
2031
+ return "section section" + o % a.numberSectionStyles;
2032
+ return "section section0";
2033
+ }).enter();
2034
+ const d = G.append("g").selectAll("rect").data(x).enter(), w = r.db.getLinks();
2035
+ if (d.append("rect").attr("id", function(l) {
2036
+ return l.id;
2037
+ }).attr("rx", 3).attr("ry", 3).attr("x", function(l) {
2038
+ return l.milestone ? O(l.startTime) + S + 0.5 * (O(l.endTime) - O(l.startTime)) - 0.5 * v : O(l.startTime) + S;
2039
+ }).attr("y", function(l, o) {
2040
+ return o = l.order, l.vert ? a.gridLineStartPadding : o * Y + F;
2041
+ }).attr("width", function(l) {
2042
+ return l.milestone ? v : l.vert ? 0.08 * v : O(l.renderEndTime || l.endTime) - O(l.startTime);
2043
+ }).attr("height", function(l) {
2044
+ return l.vert ? g.length * (a.barHeight + a.barGap) + a.barHeight * 2 : v;
2045
+ }).attr("transform-origin", function(l, o) {
2046
+ return o = l.order, (O(l.startTime) + S + 0.5 * (O(l.endTime) - O(l.startTime))).toString() + "px " + (o * Y + F + 0.5 * v).toString() + "px";
2047
+ }).attr("class", function(l) {
2048
+ const o = "task";
2049
+ let P = "";
2050
+ l.classes.length > 0 && (P = l.classes.join(" "));
2051
+ let z = 0;
2052
+ for (const [K, X] of E.entries())
2053
+ l.type === X && (z = K % a.numberSectionStyles);
2054
+ let R = "";
2055
+ return l.active ? l.crit ? R += " activeCrit" : R = " active" : l.done ? l.crit ? R = " doneCrit" : R = " done" : l.crit && (R += " crit"), R.length === 0 && (R = " task"), l.milestone && (R = " milestone " + R), l.vert && (R = " vert " + R), R += z, R += " " + P, o + R;
2056
+ }), d.append("text").attr("id", function(l) {
2057
+ return l.id + "-text";
2058
+ }).text(function(l) {
2059
+ return l.task;
2060
+ }).attr("font-size", a.fontSize).attr("x", function(l) {
2061
+ let o = O(l.startTime), P = O(l.renderEndTime || l.endTime);
2062
+ if (l.milestone && (o += 0.5 * (O(l.endTime) - O(l.startTime)) - 0.5 * v, P = o + v), l.vert)
2063
+ return O(l.startTime) + S;
2064
+ const z = this.getBBox().width;
2065
+ return z > P - o ? P + z + 1.5 * a.leftPadding > u ? o + S - 5 : P + S + 5 : (P - o) / 2 + o + S;
2066
+ }).attr("y", function(l, o) {
2067
+ return l.vert ? a.gridLineStartPadding + g.length * (a.barHeight + a.barGap) + 60 : (o = l.order, o * Y + a.barHeight / 2 + (a.fontSize / 2 - 2) + F);
2068
+ }).attr("text-height", v).attr("class", function(l) {
2069
+ const o = O(l.startTime);
2070
+ let P = O(l.endTime);
2071
+ l.milestone && (P = o + v);
2072
+ const z = this.getBBox().width;
2073
+ let R = "";
2074
+ l.classes.length > 0 && (R = l.classes.join(" "));
2075
+ let K = 0;
2076
+ for (const [$, it] of E.entries())
2077
+ l.type === it && (K = $ % a.numberSectionStyles);
2078
+ let X = "";
2079
+ return l.active && (l.crit ? X = "activeCritText" + K : X = "activeText" + K), l.done ? l.crit ? X = X + " doneCritText" + K : X = X + " doneText" + K : l.crit && (X = X + " critText" + K), l.milestone && (X += " milestoneText"), l.vert && (X += " vertText"), z > P - o ? P + z + 1.5 * a.leftPadding > u ? R + " taskTextOutsideLeft taskTextOutside" + K + " " + X : R + " taskTextOutsideRight taskTextOutside" + K + " " + X + " width-" + z : R + " taskText taskText" + K + " " + X + " width-" + z;
2080
+ }), _t().securityLevel === "sandbox") {
2081
+ let l;
2082
+ l = Zt("#i" + e);
2083
+ const o = l.nodes()[0].contentDocument;
2084
+ d.filter(function(P) {
2085
+ return w.has(P.id);
2086
+ }).each(function(P) {
2087
+ var z = o.querySelector("#" + P.id), R = o.querySelector("#" + P.id + "-text");
2088
+ const K = z.parentNode;
2089
+ var X = o.createElement("a");
2090
+ X.setAttribute("xlink:href", w.get(P.id)), X.setAttribute("target", "_top"), K.appendChild(X), X.appendChild(z), X.appendChild(R);
2091
+ });
2092
+ }
2093
+ }
2094
+ h(V, "drawRects");
2095
+ function W(x, Y, F, S, v, U, u, m) {
2096
+ if (u.length === 0 && m.length === 0)
2097
+ return;
2098
+ let T, d;
2099
+ for (const { startTime: z, endTime: R } of U)
2100
+ (T === void 0 || z < T) && (T = z), (d === void 0 || R > d) && (d = R);
2101
+ if (!T || !d)
2102
+ return;
2103
+ if (at(d).diff(at(T), "year") > 5) {
2104
+ Qt.warn(
2105
+ "The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days."
2106
+ );
2107
+ return;
2108
+ }
2109
+ const w = r.db.getDateFormat(), c = [];
2110
+ let l = null, o = at(T);
2111
+ for (; o.valueOf() <= d; )
2112
+ r.db.isInvalidDate(o, w, u, m) ? l ? l.end = o : l = {
2113
+ start: o,
2114
+ end: o
2115
+ } : l && (c.push(l), l = null), o = o.add(1, "d");
2116
+ G.append("g").selectAll("rect").data(c).enter().append("rect").attr("id", (z) => "exclude-" + z.start.format("YYYY-MM-DD")).attr("x", (z) => O(z.start.startOf("day")) + F).attr("y", a.gridLineStartPadding).attr("width", (z) => O(z.end.endOf("day")) - O(z.start.startOf("day"))).attr("height", v - Y - a.gridLineStartPadding).attr("transform-origin", function(z, R) {
2117
+ return (O(z.start) + F + 0.5 * (O(z.end) - O(z.start))).toString() + "px " + (R * x + 0.5 * v).toString() + "px";
2118
+ }).attr("class", "exclude-range");
2119
+ }
2120
+ h(W, "drawExcludeDays");
2121
+ function Z(x, Y, F, S) {
2122
+ const v = r.db.getDateFormat(), U = r.db.getAxisFormat();
2123
+ let u;
2124
+ U ? u = U : v === "D" ? u = "%d" : u = a.axisFormat ?? "%Y-%m-%d";
2125
+ let m = ar(O).tickSize(-S + Y + a.gridLineStartPadding).tickFormat(Kt(u));
2126
+ const d = /^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/.exec(
2127
+ r.db.getTickInterval() || a.tickInterval
2128
+ );
2129
+ if (d !== null) {
2130
+ const w = d[1], c = d[2], l = r.db.getWeekday() || a.weekday;
2131
+ switch (c) {
2132
+ case "millisecond":
2133
+ m.ticks(Yt.every(w));
2134
+ break;
2135
+ case "second":
2136
+ m.ticks(vt.every(w));
2137
+ break;
2138
+ case "minute":
2139
+ m.ticks(Wt.every(w));
2140
+ break;
2141
+ case "hour":
2142
+ m.ticks(Ot.every(w));
2143
+ break;
2144
+ case "day":
2145
+ m.ticks(Tt.every(w));
2146
+ break;
2147
+ case "week":
2148
+ m.ticks(Qe[l].every(w));
2149
+ break;
2150
+ case "month":
2151
+ m.ticks(Nt.every(w));
2152
+ break;
2153
+ }
2154
+ }
2155
+ if (G.append("g").attr("class", "grid").attr("transform", "translate(" + x + ", " + (S - 50) + ")").call(m).selectAll("text").style("text-anchor", "middle").attr("fill", "#000").attr("stroke", "none").attr("font-size", 10).attr("dy", "1em"), r.db.topAxisEnabled() || a.topAxis) {
2156
+ let w = rr(O).tickSize(-S + Y + a.gridLineStartPadding).tickFormat(Kt(u));
2157
+ if (d !== null) {
2158
+ const c = d[1], l = d[2], o = r.db.getWeekday() || a.weekday;
2159
+ switch (l) {
2160
+ case "millisecond":
2161
+ w.ticks(Yt.every(c));
2162
+ break;
2163
+ case "second":
2164
+ w.ticks(vt.every(c));
2165
+ break;
2166
+ case "minute":
2167
+ w.ticks(Wt.every(c));
2168
+ break;
2169
+ case "hour":
2170
+ w.ticks(Ot.every(c));
2171
+ break;
2172
+ case "day":
2173
+ w.ticks(Tt.every(c));
2174
+ break;
2175
+ case "week":
2176
+ w.ticks(Qe[o].every(c));
2177
+ break;
2178
+ case "month":
2179
+ w.ticks(Nt.every(c));
2180
+ break;
2181
+ }
2182
+ }
2183
+ G.append("g").attr("class", "grid").attr("transform", "translate(" + x + ", " + Y + ")").call(w).selectAll("text").style("text-anchor", "middle").attr("fill", "#000").attr("stroke", "none").attr("font-size", 10);
2184
+ }
2185
+ }
2186
+ h(Z, "makeGrid");
2187
+ function Q(x, Y) {
2188
+ let F = 0;
2189
+ const S = Object.keys(C).map((v) => [v, C[v]]);
2190
+ G.append("g").selectAll("text").data(S).enter().append(function(v) {
2191
+ const U = v[0].split(Vn.lineBreakRegex), u = -(U.length - 1) / 2, m = _.createElementNS("http://www.w3.org/2000/svg", "text");
2192
+ m.setAttribute("dy", u + "em");
2193
+ for (const [T, d] of U.entries()) {
2194
+ const w = _.createElementNS("http://www.w3.org/2000/svg", "tspan");
2195
+ w.setAttribute("alignment-baseline", "central"), w.setAttribute("x", "10"), T > 0 && w.setAttribute("dy", "1em"), w.textContent = d, m.appendChild(w);
2196
+ }
2197
+ return m;
2198
+ }).attr("x", 10).attr("y", function(v, U) {
2199
+ if (U > 0)
2200
+ for (let u = 0; u < U; u++)
2201
+ return F += S[U - 1][1], v[1] * x / 2 + F * x + Y;
2202
+ else
2203
+ return v[1] * x / 2 + Y;
2204
+ }).attr("font-size", a.sectionFontSize).attr("class", function(v) {
2205
+ for (const [U, u] of E.entries())
2206
+ if (v[0] === u)
2207
+ return "sectionTitle sectionTitle" + U % a.numberSectionStyles;
2208
+ return "sectionTitle";
2209
+ });
2210
+ }
2211
+ h(Q, "vertLabels");
2212
+ function D(x, Y, F, S) {
2213
+ const v = r.db.getTodayMarker();
2214
+ if (v === "off")
2215
+ return;
2216
+ const U = G.append("g").attr("class", "today"), u = /* @__PURE__ */ new Date(), m = U.append("line");
2217
+ m.attr("x1", O(u) + x).attr("x2", O(u) + x).attr("y1", a.titleTopMargin).attr("y2", S - a.titleTopMargin).attr("class", "today"), v !== "" && m.attr("style", v.replace(/,/g, ";"));
2218
+ }
2219
+ h(D, "drawToday");
2220
+ function H(x) {
2221
+ const Y = {}, F = [];
2222
+ for (let S = 0, v = x.length; S < v; ++S)
2223
+ Object.prototype.hasOwnProperty.call(Y, x[S]) || (Y[x[S]] = !0, F.push(x[S]));
2224
+ return F;
2225
+ }
2226
+ h(H, "checkUnique");
2227
+ }, "draw"), Ti = {
2228
+ setConf: ki,
2229
+ draw: vi
2230
+ }, bi = /* @__PURE__ */ h((t) => `
2231
+ .mermaid-main-font {
2232
+ font-family: ${t.fontFamily};
2233
+ }
2234
+
2235
+ .exclude-range {
2236
+ fill: ${t.excludeBkgColor};
2237
+ }
2238
+
2239
+ .section {
2240
+ stroke: none;
2241
+ opacity: 0.2;
2242
+ }
2243
+
2244
+ .section0 {
2245
+ fill: ${t.sectionBkgColor};
2246
+ }
2247
+
2248
+ .section2 {
2249
+ fill: ${t.sectionBkgColor2};
2250
+ }
2251
+
2252
+ .section1,
2253
+ .section3 {
2254
+ fill: ${t.altSectionBkgColor};
2255
+ opacity: 0.2;
2256
+ }
2257
+
2258
+ .sectionTitle0 {
2259
+ fill: ${t.titleColor};
2260
+ }
2261
+
2262
+ .sectionTitle1 {
2263
+ fill: ${t.titleColor};
2264
+ }
2265
+
2266
+ .sectionTitle2 {
2267
+ fill: ${t.titleColor};
2268
+ }
2269
+
2270
+ .sectionTitle3 {
2271
+ fill: ${t.titleColor};
2272
+ }
2273
+
2274
+ .sectionTitle {
2275
+ text-anchor: start;
2276
+ font-family: ${t.fontFamily};
2277
+ }
2278
+
2279
+
2280
+ /* Grid and axis */
2281
+
2282
+ .grid .tick {
2283
+ stroke: ${t.gridColor};
2284
+ opacity: 0.8;
2285
+ shape-rendering: crispEdges;
2286
+ }
2287
+
2288
+ .grid .tick text {
2289
+ font-family: ${t.fontFamily};
2290
+ fill: ${t.textColor};
2291
+ }
2292
+
2293
+ .grid path {
2294
+ stroke-width: 0;
2295
+ }
2296
+
2297
+
2298
+ /* Today line */
2299
+
2300
+ .today {
2301
+ fill: none;
2302
+ stroke: ${t.todayLineColor};
2303
+ stroke-width: 2px;
2304
+ }
2305
+
2306
+
2307
+ /* Task styling */
2308
+
2309
+ /* Default task */
2310
+
2311
+ .task {
2312
+ stroke-width: 2;
2313
+ }
2314
+
2315
+ .taskText {
2316
+ text-anchor: middle;
2317
+ font-family: ${t.fontFamily};
2318
+ }
2319
+
2320
+ .taskTextOutsideRight {
2321
+ fill: ${t.taskTextDarkColor};
2322
+ text-anchor: start;
2323
+ font-family: ${t.fontFamily};
2324
+ }
2325
+
2326
+ .taskTextOutsideLeft {
2327
+ fill: ${t.taskTextDarkColor};
2328
+ text-anchor: end;
2329
+ }
2330
+
2331
+
2332
+ /* Special case clickable */
2333
+
2334
+ .task.clickable {
2335
+ cursor: pointer;
2336
+ }
2337
+
2338
+ .taskText.clickable {
2339
+ cursor: pointer;
2340
+ fill: ${t.taskTextClickableColor} !important;
2341
+ font-weight: bold;
2342
+ }
2343
+
2344
+ .taskTextOutsideLeft.clickable {
2345
+ cursor: pointer;
2346
+ fill: ${t.taskTextClickableColor} !important;
2347
+ font-weight: bold;
2348
+ }
2349
+
2350
+ .taskTextOutsideRight.clickable {
2351
+ cursor: pointer;
2352
+ fill: ${t.taskTextClickableColor} !important;
2353
+ font-weight: bold;
2354
+ }
2355
+
2356
+
2357
+ /* Specific task settings for the sections*/
2358
+
2359
+ .taskText0,
2360
+ .taskText1,
2361
+ .taskText2,
2362
+ .taskText3 {
2363
+ fill: ${t.taskTextColor};
2364
+ }
2365
+
2366
+ .task0,
2367
+ .task1,
2368
+ .task2,
2369
+ .task3 {
2370
+ fill: ${t.taskBkgColor};
2371
+ stroke: ${t.taskBorderColor};
2372
+ }
2373
+
2374
+ .taskTextOutside0,
2375
+ .taskTextOutside2
2376
+ {
2377
+ fill: ${t.taskTextOutsideColor};
2378
+ }
2379
+
2380
+ .taskTextOutside1,
2381
+ .taskTextOutside3 {
2382
+ fill: ${t.taskTextOutsideColor};
2383
+ }
2384
+
2385
+
2386
+ /* Active task */
2387
+
2388
+ .active0,
2389
+ .active1,
2390
+ .active2,
2391
+ .active3 {
2392
+ fill: ${t.activeTaskBkgColor};
2393
+ stroke: ${t.activeTaskBorderColor};
2394
+ }
2395
+
2396
+ .activeText0,
2397
+ .activeText1,
2398
+ .activeText2,
2399
+ .activeText3 {
2400
+ fill: ${t.taskTextDarkColor} !important;
2401
+ }
2402
+
2403
+
2404
+ /* Completed task */
2405
+
2406
+ .done0,
2407
+ .done1,
2408
+ .done2,
2409
+ .done3 {
2410
+ stroke: ${t.doneTaskBorderColor};
2411
+ fill: ${t.doneTaskBkgColor};
2412
+ stroke-width: 2;
2413
+ }
2414
+
2415
+ .doneText0,
2416
+ .doneText1,
2417
+ .doneText2,
2418
+ .doneText3 {
2419
+ fill: ${t.taskTextDarkColor} !important;
2420
+ }
2421
+
2422
+
2423
+ /* Tasks on the critical line */
2424
+
2425
+ .crit0,
2426
+ .crit1,
2427
+ .crit2,
2428
+ .crit3 {
2429
+ stroke: ${t.critBorderColor};
2430
+ fill: ${t.critBkgColor};
2431
+ stroke-width: 2;
2432
+ }
2433
+
2434
+ .activeCrit0,
2435
+ .activeCrit1,
2436
+ .activeCrit2,
2437
+ .activeCrit3 {
2438
+ stroke: ${t.critBorderColor};
2439
+ fill: ${t.activeTaskBkgColor};
2440
+ stroke-width: 2;
2441
+ }
2442
+
2443
+ .doneCrit0,
2444
+ .doneCrit1,
2445
+ .doneCrit2,
2446
+ .doneCrit3 {
2447
+ stroke: ${t.critBorderColor};
2448
+ fill: ${t.doneTaskBkgColor};
2449
+ stroke-width: 2;
2450
+ cursor: pointer;
2451
+ shape-rendering: crispEdges;
2452
+ }
2453
+
2454
+ .milestone {
2455
+ transform: rotate(45deg) scale(0.8,0.8);
2456
+ }
2457
+
2458
+ .milestoneText {
2459
+ font-style: italic;
2460
+ }
2461
+ .doneCritText0,
2462
+ .doneCritText1,
2463
+ .doneCritText2,
2464
+ .doneCritText3 {
2465
+ fill: ${t.taskTextDarkColor} !important;
2466
+ }
2467
+
2468
+ .vert {
2469
+ stroke: ${t.vertLineColor};
2470
+ }
2471
+
2472
+ .vertText {
2473
+ font-size: 15px;
2474
+ text-anchor: middle;
2475
+ fill: ${t.vertLineColor} !important;
2476
+ }
2477
+
2478
+ .activeCritText0,
2479
+ .activeCritText1,
2480
+ .activeCritText2,
2481
+ .activeCritText3 {
2482
+ fill: ${t.taskTextDarkColor} !important;
2483
+ }
2484
+
2485
+ .titleText {
2486
+ text-anchor: middle;
2487
+ font-size: 18px;
2488
+ fill: ${t.titleColor || t.textColor};
2489
+ font-family: ${t.fontFamily};
2490
+ }
2491
+ `, "getStyles"), xi = bi, _i = {
2492
+ parser: Aa,
2493
+ db: yi,
2494
+ renderer: Ti,
2495
+ styles: xi
2496
+ };
2497
+ export {
2498
+ _i as diagram
2499
+ };
src/backend/gradio_dropdownplus/templates/component/gitGraphDiagram-OJR772UL-BKCAUcNv.js ADDED
@@ -0,0 +1,712 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { p as Z } from "./chunk-ANTBXLJU-CuGo78t3.js";
2
+ import { I as F } from "./chunk-FHKO5MBM-BsqpKj2V.js";
3
+ import { _ as h, q as U, p as rr, s as er, g as tr, a as ar, b as nr, l as m, 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-D58rAnek.js";
4
+ import { p as gr } from "./treemap-75Q7IDZK-CIjK5oQY.js";
5
+ var u = {
6
+ NORMAL: 0,
7
+ REVERSE: 1,
8
+ HIGHLIGHT: 2,
9
+ MERGE: 3,
10
+ CHERRY_PICK: 4
11
+ }, yr = $r.gitGraph, z = /* @__PURE__ */ h(() => hr({
12
+ ...yr,
13
+ ...lr().gitGraph
14
+ }), "getConfig"), i = new F(() => {
15
+ const t = z(), r = t.mainBranchName, a = t.mainBranchOrder;
16
+ return {
17
+ mainBranchName: r,
18
+ commits: /* @__PURE__ */ new Map(),
19
+ head: null,
20
+ branchConfig: /* @__PURE__ */ new Map([[r, { name: r, order: a }]]),
21
+ branches: /* @__PURE__ */ new Map([[r, null]]),
22
+ currBranch: r,
23
+ direction: "LR",
24
+ seq: 0,
25
+ options: {}
26
+ };
27
+ });
28
+ function S() {
29
+ return fr({ length: 7 });
30
+ }
31
+ h(S, "getID");
32
+ function N(t, r) {
33
+ const a = /* @__PURE__ */ Object.create(null);
34
+ return t.reduce((s, e) => {
35
+ const n = r(e);
36
+ return a[n] || (a[n] = !0, s.push(e)), s;
37
+ }, []);
38
+ }
39
+ h(N, "uniqBy");
40
+ var xr = /* @__PURE__ */ h(function(t) {
41
+ i.records.direction = t;
42
+ }, "setDirection"), ur = /* @__PURE__ */ h(function(t) {
43
+ m.debug("options str", t), t = t == null ? void 0 : t.trim(), t = t || "{}";
44
+ try {
45
+ i.records.options = JSON.parse(t);
46
+ } catch (r) {
47
+ m.error("error while parsing gitGraph options", r.message);
48
+ }
49
+ }, "setOptions"), pr = /* @__PURE__ */ h(function() {
50
+ return i.records.options;
51
+ }, "getOptions"), br = /* @__PURE__ */ h(function(t) {
52
+ let r = t.msg, a = t.id;
53
+ const s = t.type;
54
+ let e = t.tags;
55
+ m.info("commit", r, a, s, e), m.debug("Entering commit:", r, a, s, e);
56
+ const n = z();
57
+ a = B.sanitizeText(a, n), r = B.sanitizeText(r, n), e = e == null ? void 0 : e.map((o) => B.sanitizeText(o, n));
58
+ const c = {
59
+ id: a || i.records.seq + "-" + S(),
60
+ message: r,
61
+ seq: i.records.seq++,
62
+ type: s ?? u.NORMAL,
63
+ tags: e ?? [],
64
+ parents: i.records.head == null ? [] : [i.records.head.id],
65
+ branch: i.records.currBranch
66
+ };
67
+ i.records.head = c, m.info("main branch", n.mainBranchName), i.records.commits.has(c.id) && m.warn(`Commit ID ${c.id} already exists`), i.records.commits.set(c.id, c), i.records.branches.set(i.records.currBranch, c.id), m.debug("in pushCommit " + c.id);
68
+ }, "commit"), mr = /* @__PURE__ */ h(function(t) {
69
+ let r = t.name;
70
+ const a = t.order;
71
+ if (r = B.sanitizeText(r, z()), i.records.branches.has(r))
72
+ throw new Error(
73
+ `Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`
74
+ );
75
+ i.records.branches.set(r, i.records.head != null ? i.records.head.id : null), i.records.branchConfig.set(r, { name: r, order: a }), _(r), m.debug("in createBranch");
76
+ }, "branch"), wr = /* @__PURE__ */ h((t) => {
77
+ let r = t.branch, a = t.id;
78
+ const s = t.type, e = t.tags, n = z();
79
+ r = B.sanitizeText(r, n), a && (a = B.sanitizeText(a, n));
80
+ 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;
81
+ if ($ && l && $.branch === r)
82
+ throw new Error(`Cannot merge branch '${r}' into itself.`);
83
+ if (i.records.currBranch === r) {
84
+ const d = new Error('Incorrect usage of "merge". Cannot merge a branch to itself');
85
+ throw d.hash = {
86
+ text: `merge ${r}`,
87
+ token: `merge ${r}`,
88
+ expected: ["branch abc"]
89
+ }, d;
90
+ }
91
+ if ($ === void 0 || !$) {
92
+ const d = new Error(
93
+ `Incorrect usage of "merge". Current branch (${i.records.currBranch})has no commits`
94
+ );
95
+ throw d.hash = {
96
+ text: `merge ${r}`,
97
+ token: `merge ${r}`,
98
+ expected: ["commit"]
99
+ }, d;
100
+ }
101
+ if (!i.records.branches.has(r)) {
102
+ const d = new Error(
103
+ 'Incorrect usage of "merge". Branch to be merged (' + r + ") does not exist"
104
+ );
105
+ throw d.hash = {
106
+ text: `merge ${r}`,
107
+ token: `merge ${r}`,
108
+ expected: [`branch ${r}`]
109
+ }, d;
110
+ }
111
+ if (l === void 0 || !l) {
112
+ const d = new Error(
113
+ 'Incorrect usage of "merge". Branch to be merged (' + r + ") has no commits"
114
+ );
115
+ throw d.hash = {
116
+ text: `merge ${r}`,
117
+ token: `merge ${r}`,
118
+ expected: ['"commit"']
119
+ }, d;
120
+ }
121
+ if ($ === l) {
122
+ const d = new Error('Incorrect usage of "merge". Both branches have same head');
123
+ throw d.hash = {
124
+ text: `merge ${r}`,
125
+ token: `merge ${r}`,
126
+ expected: ["branch abc"]
127
+ }, d;
128
+ }
129
+ if (a && i.records.commits.has(a)) {
130
+ const d = new Error(
131
+ 'Incorrect usage of "merge". Commit with id:' + a + " already exists, use different custom id"
132
+ );
133
+ throw d.hash = {
134
+ text: `merge ${r} ${a} ${s} ${e == null ? void 0 : e.join(" ")}`,
135
+ token: `merge ${r} ${a} ${s} ${e == null ? void 0 : e.join(" ")}`,
136
+ expected: [
137
+ `merge ${r} ${a}_UNIQUE ${s} ${e == null ? void 0 : e.join(" ")}`
138
+ ]
139
+ }, d;
140
+ }
141
+ const f = o || "", g = {
142
+ id: a || `${i.records.seq}-${S()}`,
143
+ message: `merged branch ${r} into ${i.records.currBranch}`,
144
+ seq: i.records.seq++,
145
+ parents: i.records.head == null ? [] : [i.records.head.id, f],
146
+ branch: i.records.currBranch,
147
+ type: u.MERGE,
148
+ customType: s,
149
+ customId: !!a,
150
+ tags: e ?? []
151
+ };
152
+ i.records.head = g, i.records.commits.set(g.id, g), i.records.branches.set(i.records.currBranch, g.id), m.debug(i.records.branches), m.debug("in mergeBranch");
153
+ }, "merge"), vr = /* @__PURE__ */ h(function(t) {
154
+ let r = t.id, a = t.targetId, s = t.tags, e = t.parent;
155
+ m.debug("Entering cherryPick:", r, a, s);
156
+ const n = z();
157
+ 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)) {
158
+ const $ = new Error(
159
+ 'Incorrect usage of "cherryPick". Source commit id should exist and provided'
160
+ );
161
+ throw $.hash = {
162
+ text: `cherryPick ${r} ${a}`,
163
+ token: `cherryPick ${r} ${a}`,
164
+ expected: ["cherry-pick abc"]
165
+ }, $;
166
+ }
167
+ const c = i.records.commits.get(r);
168
+ if (c === void 0 || !c)
169
+ throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');
170
+ if (e && !(Array.isArray(c.parents) && c.parents.includes(e)))
171
+ throw new Error(
172
+ "Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit."
173
+ );
174
+ const o = c.branch;
175
+ if (c.type === u.MERGE && !e)
176
+ throw new Error(
177
+ "Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified."
178
+ );
179
+ if (!a || !i.records.commits.has(a)) {
180
+ if (o === i.records.currBranch) {
181
+ const g = new Error(
182
+ 'Incorrect usage of "cherryPick". Source commit is already on current branch'
183
+ );
184
+ throw g.hash = {
185
+ text: `cherryPick ${r} ${a}`,
186
+ token: `cherryPick ${r} ${a}`,
187
+ expected: ["cherry-pick abc"]
188
+ }, g;
189
+ }
190
+ const $ = i.records.branches.get(i.records.currBranch);
191
+ if ($ === void 0 || !$) {
192
+ const g = new Error(
193
+ `Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`
194
+ );
195
+ throw g.hash = {
196
+ text: `cherryPick ${r} ${a}`,
197
+ token: `cherryPick ${r} ${a}`,
198
+ expected: ["cherry-pick abc"]
199
+ }, g;
200
+ }
201
+ const l = i.records.commits.get($);
202
+ if (l === void 0 || !l) {
203
+ const g = new Error(
204
+ `Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`
205
+ );
206
+ throw g.hash = {
207
+ text: `cherryPick ${r} ${a}`,
208
+ token: `cherryPick ${r} ${a}`,
209
+ expected: ["cherry-pick abc"]
210
+ }, g;
211
+ }
212
+ const f = {
213
+ id: i.records.seq + "-" + S(),
214
+ message: `cherry-picked ${c == null ? void 0 : c.message} into ${i.records.currBranch}`,
215
+ seq: i.records.seq++,
216
+ parents: i.records.head == null ? [] : [i.records.head.id, c.id],
217
+ branch: i.records.currBranch,
218
+ type: u.CHERRY_PICK,
219
+ tags: s ? s.filter(Boolean) : [
220
+ `cherry-pick:${c.id}${c.type === u.MERGE ? `|parent:${e}` : ""}`
221
+ ]
222
+ };
223
+ i.records.head = f, i.records.commits.set(f.id, f), i.records.branches.set(i.records.currBranch, f.id), m.debug(i.records.branches), m.debug("in cherryPick");
224
+ }
225
+ }, "cherryPick"), _ = /* @__PURE__ */ h(function(t) {
226
+ if (t = B.sanitizeText(t, z()), i.records.branches.has(t)) {
227
+ i.records.currBranch = t;
228
+ const r = i.records.branches.get(i.records.currBranch);
229
+ r === void 0 || !r ? i.records.head = null : i.records.head = i.records.commits.get(r) ?? null;
230
+ } else {
231
+ const r = new Error(
232
+ `Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`
233
+ );
234
+ throw r.hash = {
235
+ text: `checkout ${t}`,
236
+ token: `checkout ${t}`,
237
+ expected: [`branch ${t}`]
238
+ }, r;
239
+ }
240
+ }, "checkout");
241
+ function D(t, r, a) {
242
+ const s = t.indexOf(r);
243
+ s === -1 ? t.push(a) : t.splice(s, 1, a);
244
+ }
245
+ h(D, "upsert");
246
+ function A(t) {
247
+ const r = t.reduce((e, n) => e.seq > n.seq ? e : n, t[0]);
248
+ let a = "";
249
+ t.forEach(function(e) {
250
+ e === r ? a += " *" : a += " |";
251
+ });
252
+ const s = [a, r.id, r.seq];
253
+ for (const e in i.records.branches)
254
+ i.records.branches.get(e) === r.id && s.push(e);
255
+ if (m.debug(s.join(" ")), r.parents && r.parents.length == 2 && r.parents[0] && r.parents[1]) {
256
+ const e = i.records.commits.get(r.parents[0]);
257
+ D(t, r, e), r.parents[1] && t.push(i.records.commits.get(r.parents[1]));
258
+ } else {
259
+ if (r.parents.length == 0)
260
+ return;
261
+ if (r.parents[0]) {
262
+ const e = i.records.commits.get(r.parents[0]);
263
+ D(t, r, e);
264
+ }
265
+ }
266
+ t = N(t, (e) => e.id), A(t);
267
+ }
268
+ h(A, "prettyPrintCommitHistory");
269
+ var Cr = /* @__PURE__ */ h(function() {
270
+ m.debug(i.records.commits);
271
+ const t = V()[0];
272
+ A([t]);
273
+ }, "prettyPrint"), Er = /* @__PURE__ */ h(function() {
274
+ i.reset(), dr();
275
+ }, "clear"), Br = /* @__PURE__ */ h(function() {
276
+ return [...i.records.branchConfig.values()].map((r, a) => r.order !== null && r.order !== void 0 ? r : {
277
+ ...r,
278
+ order: parseFloat(`0.${a}`)
279
+ }).sort((r, a) => (r.order ?? 0) - (a.order ?? 0)).map(({ name: r }) => ({ name: r }));
280
+ }, "getBranchesAsObjArray"), kr = /* @__PURE__ */ h(function() {
281
+ return i.records.branches;
282
+ }, "getBranches"), Lr = /* @__PURE__ */ h(function() {
283
+ return i.records.commits;
284
+ }, "getCommits"), V = /* @__PURE__ */ h(function() {
285
+ const t = [...i.records.commits.values()];
286
+ return t.forEach(function(r) {
287
+ m.debug(r.id);
288
+ }), t.sort((r, a) => r.seq - a.seq), t;
289
+ }, "getCommitsArray"), Tr = /* @__PURE__ */ h(function() {
290
+ return i.records.currBranch;
291
+ }, "getCurrentBranch"), Mr = /* @__PURE__ */ h(function() {
292
+ return i.records.direction;
293
+ }, "getDirection"), Rr = /* @__PURE__ */ h(function() {
294
+ return i.records.head;
295
+ }, "getHead"), X = {
296
+ commitType: u,
297
+ getConfig: z,
298
+ setDirection: xr,
299
+ setOptions: ur,
300
+ getOptions: pr,
301
+ commit: br,
302
+ branch: mr,
303
+ merge: wr,
304
+ cherryPick: vr,
305
+ checkout: _,
306
+ //reset,
307
+ prettyPrint: Cr,
308
+ clear: Er,
309
+ getBranchesAsObjArray: Br,
310
+ getBranches: kr,
311
+ getCommits: Lr,
312
+ getCommitsArray: V,
313
+ getCurrentBranch: Tr,
314
+ getDirection: Mr,
315
+ getHead: Rr,
316
+ setAccTitle: nr,
317
+ getAccTitle: ar,
318
+ getAccDescription: tr,
319
+ setAccDescription: er,
320
+ setDiagramTitle: rr,
321
+ getDiagramTitle: U
322
+ }, Ir = /* @__PURE__ */ h((t, r) => {
323
+ Z(t, r), t.dir && r.setDirection(t.dir);
324
+ for (const a of t.statements)
325
+ qr(a, r);
326
+ }, "populate"), qr = /* @__PURE__ */ h((t, r) => {
327
+ const s = {
328
+ Commit: /* @__PURE__ */ h((e) => r.commit(Or(e)), "Commit"),
329
+ Branch: /* @__PURE__ */ h((e) => r.branch(zr(e)), "Branch"),
330
+ Merge: /* @__PURE__ */ h((e) => r.merge(Gr(e)), "Merge"),
331
+ Checkout: /* @__PURE__ */ h((e) => r.checkout(Hr(e)), "Checkout"),
332
+ CherryPicking: /* @__PURE__ */ h((e) => r.cherryPick(Pr(e)), "CherryPicking")
333
+ }[t.$type];
334
+ s ? s(t) : m.error(`Unknown statement type: ${t.$type}`);
335
+ }, "parseStatement"), Or = /* @__PURE__ */ h((t) => ({
336
+ id: t.id,
337
+ msg: t.message ?? "",
338
+ type: t.type !== void 0 ? u[t.type] : u.NORMAL,
339
+ tags: t.tags ?? void 0
340
+ }), "parseCommit"), zr = /* @__PURE__ */ h((t) => ({
341
+ name: t.name,
342
+ order: t.order ?? 0
343
+ }), "parseBranch"), Gr = /* @__PURE__ */ h((t) => ({
344
+ branch: t.branch,
345
+ id: t.id ?? "",
346
+ type: t.type !== void 0 ? u[t.type] : void 0,
347
+ tags: t.tags ?? void 0
348
+ }), "parseMerge"), Hr = /* @__PURE__ */ h((t) => t.branch, "parseCheckout"), Pr = /* @__PURE__ */ h((t) => {
349
+ var a;
350
+ return {
351
+ id: t.id,
352
+ targetId: "",
353
+ tags: ((a = t.tags) == null ? void 0 : a.length) === 0 ? void 0 : t.tags,
354
+ parent: t.parent
355
+ };
356
+ }, "parseCherryPicking"), Wr = {
357
+ parse: /* @__PURE__ */ h(async (t) => {
358
+ const r = await gr("gitGraph", t);
359
+ m.debug(r), Ir(r, X);
360
+ }, "parse")
361
+ }, 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, x = "LR", Sr = /* @__PURE__ */ h(() => {
362
+ C.clear(), E.clear(), G.clear(), M = 0, W = [], x = "LR";
363
+ }, "clear"), J = /* @__PURE__ */ h((t) => {
364
+ const r = document.createElementNS("http://www.w3.org/2000/svg", "text");
365
+ return (typeof t == "string" ? t.split(/\\n|\n|<br\s*\/?>/gi) : t).forEach((s) => {
366
+ const e = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
367
+ 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);
368
+ }), r;
369
+ }, "drawText"), Q = /* @__PURE__ */ h((t) => {
370
+ let r, a, s;
371
+ return x === "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) => {
372
+ var c, o;
373
+ const n = x === "TB" || x == "BT" ? (c = E.get(e)) == null ? void 0 : c.y : (o = E.get(e)) == null ? void 0 : o.x;
374
+ n !== void 0 && a(n, s) && (r = e, s = n);
375
+ }), r;
376
+ }, "findClosestParent"), jr = /* @__PURE__ */ h((t) => {
377
+ let r = "", a = 1 / 0;
378
+ return t.forEach((s) => {
379
+ const e = E.get(s).y;
380
+ e <= a && (r = s, a = e);
381
+ }), r || void 0;
382
+ }, "findClosestParentBT"), Dr = /* @__PURE__ */ h((t, r, a) => {
383
+ let s = a, e = a;
384
+ const n = [];
385
+ t.forEach((c) => {
386
+ const o = r.get(c);
387
+ if (!o)
388
+ throw new Error(`Commit not found for key ${c}`);
389
+ o.parents.length ? (s = Yr(o), e = Math.max(s, e)) : n.push(o), Kr(o, s);
390
+ }), s = e, n.forEach((c) => {
391
+ Nr(c, s, a);
392
+ }), t.forEach((c) => {
393
+ const o = r.get(c);
394
+ if (o != null && o.parents.length) {
395
+ const $ = jr(o.parents);
396
+ s = E.get($).y - I, s <= e && (e = s);
397
+ const l = C.get(o.branch).pos, f = s - R;
398
+ E.set(o.id, { x: l, y: f });
399
+ }
400
+ });
401
+ }, "setParallelBTPos"), Ar = /* @__PURE__ */ h((t) => {
402
+ var s;
403
+ const r = Q(t.parents.filter((e) => e !== null));
404
+ if (!r)
405
+ throw new Error(`Closest parent not found for commit ${t.id}`);
406
+ const a = (s = E.get(r)) == null ? void 0 : s.y;
407
+ if (a === void 0)
408
+ throw new Error(`Closest parent position not found for commit ${t.id}`);
409
+ return a;
410
+ }, "findClosestParentPos"), Yr = /* @__PURE__ */ h((t) => Ar(t) + I, "calculateCommitPosition"), Kr = /* @__PURE__ */ h((t, r) => {
411
+ const a = C.get(t.branch);
412
+ if (!a)
413
+ throw new Error(`Branch not found for commit ${t.id}`);
414
+ const s = a.pos, e = r + R;
415
+ return E.set(t.id, { x: s, y: e }), { x: s, y: e };
416
+ }, "setCommitPosition"), Nr = /* @__PURE__ */ h((t, r, a) => {
417
+ const s = C.get(t.branch);
418
+ if (!s)
419
+ throw new Error(`Branch not found for commit ${t.id}`);
420
+ const e = r + a, n = s.pos;
421
+ E.set(t.id, { x: n, y: e });
422
+ }, "setRootPosition"), _r = /* @__PURE__ */ h((t, r, a, s, e, n) => {
423
+ if (n === u.HIGHLIGHT)
424
+ t.append("rect").attr("x", a.x - 10).attr("y", a.y - 10).attr("width", 20).attr("height", 20).attr(
425
+ "class",
426
+ `commit ${r.id} commit-highlight${e % O} ${s}-outer`
427
+ ), t.append("rect").attr("x", a.x - 6).attr("y", a.y - 6).attr("width", 12).attr("height", 12).attr(
428
+ "class",
429
+ `commit ${r.id} commit${e % O} ${s}-inner`
430
+ );
431
+ else if (n === u.CHERRY_PICK)
432
+ 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}`);
433
+ else {
434
+ const c = t.append("circle");
435
+ if (c.attr("cx", a.x), c.attr("cy", a.y), c.attr("r", r.type === u.MERGE ? 9 : 10), c.attr("class", `commit ${r.id} commit${e % O}`), n === u.MERGE) {
436
+ const o = t.append("circle");
437
+ o.attr("cx", a.x), o.attr("cy", a.y), o.attr("r", 6), o.attr(
438
+ "class",
439
+ `commit ${s} ${r.id} commit${e % O}`
440
+ );
441
+ }
442
+ n === u.REVERSE && t.append("path").attr(
443
+ "d",
444
+ `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}`
445
+ ).attr("class", `commit ${s} ${r.id} commit${e % O}`);
446
+ }
447
+ }, "drawCommitBullet"), Vr = /* @__PURE__ */ h((t, r, a, s) => {
448
+ var e;
449
+ if (r.type !== u.CHERRY_PICK && (r.customId && r.type === u.MERGE || r.type !== u.MERGE) && (b != null && b.showCommitLabel)) {
450
+ 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();
451
+ 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), x === "TB" || x === "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))
452
+ if (x === "TB" || x === "BT")
453
+ o.attr(
454
+ "transform",
455
+ "rotate(-45, " + a.x + ", " + a.y + ")"
456
+ ), c.attr(
457
+ "transform",
458
+ "rotate(-45, " + a.x + ", " + a.y + ")"
459
+ );
460
+ else {
461
+ const l = -7.5 - ($.width + 10) / 25 * 9.5, f = 10 + $.width / 25 * 8.5;
462
+ n.attr(
463
+ "transform",
464
+ "translate(" + l + ", " + f + ") rotate(-45, " + s + ", " + a.y + ")"
465
+ );
466
+ }
467
+ }
468
+ }, "drawCommitLabel"), Xr = /* @__PURE__ */ h((t, r, a, s) => {
469
+ var e;
470
+ if (r.tags.length > 0) {
471
+ let n = 0, c = 0, o = 0;
472
+ const $ = [];
473
+ for (const l of r.tags.reverse()) {
474
+ 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();
475
+ if (!y)
476
+ throw new Error("Tag bbox not found");
477
+ c = Math.max(c, y.width), o = Math.max(o, y.height), d.attr("x", a.posWithOffset - y.width / 2), $.push({
478
+ tag: d,
479
+ hole: g,
480
+ rect: f,
481
+ yOffset: n
482
+ }), n += 20;
483
+ }
484
+ for (const { tag: l, hole: f, rect: g, yOffset: d } of $) {
485
+ const y = o / 2, p = a.y - 19.2 - d;
486
+ if (g.attr("class", "tag-label-bkg").attr(
487
+ "points",
488
+ `
489
+ ${s - c / 2 - k / 2},${p + L}
490
+ ${s - c / 2 - k / 2},${p - L}
491
+ ${a.posWithOffset - c / 2 - k},${p - y - L}
492
+ ${a.posWithOffset + c / 2 + k},${p - y - L}
493
+ ${a.posWithOffset + c / 2 + k},${p + y + L}
494
+ ${a.posWithOffset - c / 2 - k},${p + y + L}`
495
+ ), f.attr("cy", p).attr("cx", s - c / 2 + k / 2).attr("r", 1.5).attr("class", "tag-hole"), x === "TB" || x === "BT") {
496
+ const w = s + d;
497
+ g.attr("class", "tag-label-bkg").attr(
498
+ "points",
499
+ `
500
+ ${a.x},${w + 2}
501
+ ${a.x},${w - 2}
502
+ ${a.x + R},${w - y - 2}
503
+ ${a.x + R + c + 4},${w - y - 2}
504
+ ${a.x + R + c + 4},${w + y + 2}
505
+ ${a.x + R},${w + y + 2}`
506
+ ).attr("transform", "translate(12,12) rotate(45, " + a.x + "," + s + ")"), f.attr("cx", a.x + k / 2).attr("cy", w).attr("transform", "translate(12,12) rotate(45, " + a.x + "," + s + ")"), l.attr("x", a.x + 5).attr("y", w + 3).attr("transform", "translate(14,14) rotate(45, " + a.x + "," + s + ")");
507
+ }
508
+ }
509
+ }
510
+ }, "drawCommitTags"), Jr = /* @__PURE__ */ h((t) => {
511
+ switch (t.customType ?? t.type) {
512
+ case u.NORMAL:
513
+ return "commit-normal";
514
+ case u.REVERSE:
515
+ return "commit-reverse";
516
+ case u.HIGHLIGHT:
517
+ return "commit-highlight";
518
+ case u.MERGE:
519
+ return "commit-merge";
520
+ case u.CHERRY_PICK:
521
+ return "commit-cherry-pick";
522
+ default:
523
+ return "commit-normal";
524
+ }
525
+ }, "getCommitClassType"), Qr = /* @__PURE__ */ h((t, r, a, s) => {
526
+ const e = { x: 0, y: 0 };
527
+ if (t.parents.length > 0) {
528
+ const n = Q(t.parents);
529
+ if (n) {
530
+ const c = s.get(n) ?? e;
531
+ return r === "TB" ? c.y + I : r === "BT" ? (s.get(t.id) ?? e).y - I : c.x + I;
532
+ }
533
+ } else
534
+ return r === "TB" ? P : r === "BT" ? (s.get(t.id) ?? e).y - I : 0;
535
+ return 0;
536
+ }, "calculatePosition"), Zr = /* @__PURE__ */ h((t, r, a) => {
537
+ var c, o;
538
+ const s = x === "BT" && a ? r : r + R, e = x === "TB" || x === "BT" ? s : (c = C.get(t.branch)) == null ? void 0 : c.pos, n = x === "TB" || x === "BT" ? (o = C.get(t.branch)) == null ? void 0 : o.pos : s;
539
+ if (n === void 0 || e === void 0)
540
+ throw new Error(`Position were undefined for commit ${t.id}`);
541
+ return { x: n, y: e, posWithOffset: s };
542
+ }, "getCommitPosition"), K = /* @__PURE__ */ h((t, r, a) => {
543
+ if (!b)
544
+ throw new Error("GitGraph config not found");
545
+ const s = t.append("g").attr("class", "commit-bullets"), e = t.append("g").attr("class", "commit-labels");
546
+ let n = x === "TB" || x === "BT" ? P : 0;
547
+ const c = [...r.keys()], o = (b == null ? void 0 : b.parallelCommits) ?? !1, $ = /* @__PURE__ */ h((f, g) => {
548
+ var p, w;
549
+ const d = (p = r.get(f)) == null ? void 0 : p.seq, y = (w = r.get(g)) == null ? void 0 : w.seq;
550
+ return d !== void 0 && y !== void 0 ? d - y : 0;
551
+ }, "sortKeys");
552
+ let l = c.sort($);
553
+ x === "BT" && (o && Dr(l, r, n), l = l.reverse()), l.forEach((f) => {
554
+ var y;
555
+ const g = r.get(f);
556
+ if (!g)
557
+ throw new Error(`Commit not found for key ${f}`);
558
+ o && (n = Qr(g, x, n, E));
559
+ const d = Zr(g, n, o);
560
+ if (a) {
561
+ const p = Jr(g), w = g.customType ?? g.type, q = ((y = C.get(g.branch)) == null ? void 0 : y.index) ?? 0;
562
+ _r(s, g, d, p, q, w), Vr(e, g, d, n), Xr(e, g, d, n);
563
+ }
564
+ x === "TB" || x === "BT" ? E.set(g.id, { x: d.x, y: d.posWithOffset }) : E.set(g.id, { x: d.posWithOffset, y: d.y }), n = x === "BT" && o ? n + I : n + I + R, n > M && (M = n);
565
+ });
566
+ }, "drawCommits"), Fr = /* @__PURE__ */ h((t, r, a, s, e) => {
567
+ const c = (x === "TB" || x === "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");
568
+ return [...e.values()].some((l) => $(l) && o(l));
569
+ }, "shouldRerouteArrow"), H = /* @__PURE__ */ h((t, r, a = 0) => {
570
+ const s = t + Math.abs(t - r) / 2;
571
+ if (a > 5)
572
+ return s;
573
+ if (W.every((c) => Math.abs(c - s) >= 10))
574
+ return W.push(s), s;
575
+ const n = Math.abs(t - r);
576
+ return H(t, r - n / 5, a + 1);
577
+ }, "findLane"), Ur = /* @__PURE__ */ h((t, r, a, s) => {
578
+ var y, p, w, q, Y;
579
+ const e = E.get(r.id), n = E.get(a.id);
580
+ if (e === void 0 || n === void 0)
581
+ throw new Error(`Commit positions not found for commits ${r.id} and ${a.id}`);
582
+ const c = Fr(r, a, e, n, s);
583
+ let o = "", $ = "", l = 0, f = 0, g = (y = C.get(a.branch)) == null ? void 0 : y.index;
584
+ a.type === u.MERGE && r.id !== a.parents[0] && (g = (p = C.get(r.branch)) == null ? void 0 : p.index);
585
+ let d;
586
+ if (c) {
587
+ o = "A 10 10, 0, 0, 0,", $ = "A 10 10, 0, 0, 1,", l = 10, f = 10;
588
+ 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);
589
+ x === "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 = (w = C.get(r.branch)) == null ? void 0 : w.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}`) : x === "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}`);
590
+ } else
591
+ o = "A 20 20, 0, 0, 0,", $ = "A 20 20, 0, 0, 1,", l = 20, f = 20, x === "TB" ? (e.x < n.x && (a.type === u.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 === u.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}`)) : x === "BT" ? (e.x < n.x && (a.type === u.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 === u.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 === u.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 === u.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}`));
592
+ if (d === void 0)
593
+ throw new Error("Line definition not found");
594
+ t.append("path").attr("d", d).attr("class", "arrow arrow" + g % O);
595
+ }, "drawArrow"), re = /* @__PURE__ */ h((t, r) => {
596
+ const a = t.append("g").attr("class", "commit-arrows");
597
+ [...r.keys()].forEach((s) => {
598
+ const e = r.get(s);
599
+ e.parents && e.parents.length > 0 && e.parents.forEach((n) => {
600
+ Ur(a, r.get(n), e, r);
601
+ });
602
+ });
603
+ }, "drawArrows"), ee = /* @__PURE__ */ h((t, r) => {
604
+ const a = t.append("g");
605
+ r.forEach((s, e) => {
606
+ var p;
607
+ const n = e % O, c = (p = C.get(s.name)) == null ? void 0 : p.pos;
608
+ if (c === void 0)
609
+ throw new Error(`Position not found for branch ${s.name}`);
610
+ const o = a.append("line");
611
+ o.attr("x1", 0), o.attr("y1", c), o.attr("x2", M), o.attr("y2", c), o.attr("class", "branch branch" + n), x === "TB" ? (o.attr("y1", P), o.attr("x1", c), o.attr("y2", M), o.attr("x2", c)) : x === "BT" && (o.attr("y1", M), o.attr("x1", c), o.attr("y2", P), o.attr("x2", c)), W.push(c);
612
+ const $ = s.name, l = J($), f = a.insert("rect"), d = a.insert("g").attr("class", "branchLabel").insert("g").attr("class", "label branch-label" + n);
613
+ d.node().appendChild(l);
614
+ const y = l.getBBox();
615
+ 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(
616
+ "transform",
617
+ "translate(" + (-y.width - 14 - ((b == null ? void 0 : b.rotateCommitLabel) === !0 ? 30 : 0)) + ", " + (c - y.height / 2 - 1) + ")"
618
+ ), x === "TB" ? (f.attr("x", c - y.width / 2 - 10).attr("y", 0), d.attr("transform", "translate(" + (c - y.width / 2 - 5) + ", 0)")) : x === "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) + ")");
619
+ });
620
+ }, "drawBranches"), te = /* @__PURE__ */ h(function(t, r, a, s, e) {
621
+ return C.set(t, { pos: r, index: a }), r += 50 + (e ? 40 : 0) + (x === "TB" || x === "BT" ? s.width / 2 : 0), r;
622
+ }, "setBranchPosition"), ae = /* @__PURE__ */ h(function(t, r, a, s) {
623
+ if (Sr(), m.debug("in gitgraph renderer", t + `
624
+ `, "id:", r, a), !b)
625
+ throw new Error("GitGraph config not found");
626
+ const e = b.rotateCommitLabel ?? !1, n = s.db;
627
+ G = n.getCommits();
628
+ const c = n.getBranchesAsObjArray();
629
+ x = n.getDirection();
630
+ const o = or(`[id="${r}"]`);
631
+ let $ = 0;
632
+ c.forEach((l, f) => {
633
+ var q;
634
+ 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");
635
+ (q = p.node()) == null || q.appendChild(g);
636
+ const w = g.getBBox();
637
+ $ = te(l.name, $, f, w, e), p.remove(), y.remove(), d.remove();
638
+ }), K(o, G, !1), b.showBranches && ee(o, c), re(o, G), K(o, G, !0), cr.insertTitle(
639
+ o,
640
+ "gitTitleText",
641
+ b.titleTopMargin ?? 0,
642
+ n.getDiagramTitle()
643
+ ), ir(
644
+ void 0,
645
+ o,
646
+ b.diagramPadding,
647
+ b.useMaxWidth
648
+ );
649
+ }, "draw"), ne = {
650
+ draw: ae
651
+ }, se = /* @__PURE__ */ h((t) => `
652
+ .commit-id,
653
+ .commit-msg,
654
+ .branch-label {
655
+ fill: lightgrey;
656
+ color: lightgrey;
657
+ font-family: 'trebuchet ms', verdana, arial, sans-serif;
658
+ font-family: var(--mermaid-font-family);
659
+ }
660
+ ${[0, 1, 2, 3, 4, 5, 6, 7].map(
661
+ (r) => `
662
+ .branch-label${r} { fill: ${t["gitBranchLabel" + r]}; }
663
+ .commit${r} { stroke: ${t["git" + r]}; fill: ${t["git" + r]}; }
664
+ .commit-highlight${r} { stroke: ${t["gitInv" + r]}; fill: ${t["gitInv" + r]}; }
665
+ .label${r} { fill: ${t["git" + r]}; }
666
+ .arrow${r} { stroke: ${t["git" + r]}; }
667
+ `
668
+ ).join(`
669
+ `)}
670
+
671
+ .branch {
672
+ stroke-width: 1;
673
+ stroke: ${t.lineColor};
674
+ stroke-dasharray: 2;
675
+ }
676
+ .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};}
677
+ .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; }
678
+ .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}
679
+ .tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; }
680
+ .tag-hole { fill: ${t.textColor}; }
681
+
682
+ .commit-merge {
683
+ stroke: ${t.primaryColor};
684
+ fill: ${t.primaryColor};
685
+ }
686
+ .commit-reverse {
687
+ stroke: ${t.primaryColor};
688
+ fill: ${t.primaryColor};
689
+ stroke-width: 3;
690
+ }
691
+ .commit-highlight-outer {
692
+ }
693
+ .commit-highlight-inner {
694
+ stroke: ${t.primaryColor};
695
+ fill: ${t.primaryColor};
696
+ }
697
+
698
+ .arrow { stroke-width: 8; stroke-linecap: round; fill: none}
699
+ .gitTitleText {
700
+ text-anchor: middle;
701
+ font-size: 18px;
702
+ fill: ${t.textColor};
703
+ }
704
+ `, "getStyles"), oe = se, le = {
705
+ parser: Wr,
706
+ db: X,
707
+ renderer: ne,
708
+ styles: oe
709
+ };
710
+ export {
711
+ le as diagram
712
+ };
src/backend/gradio_dropdownplus/templates/component/graph-cJOmixT5.js ADDED
@@ -0,0 +1,247 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { aA as N, aB as j, aC as f, aD as b, aE as E } from "./mermaid.core-D58rAnek.js";
2
+ import { a as v, c as P, k as _, f as g, d, i as l, v as p, r as D } from "./_baseUniq-CMmoTQ8t.js";
3
+ var w = N(function(o) {
4
+ return v(P(o, 1, j, !0));
5
+ }), F = "\0", a = "\0", O = "";
6
+ class L {
7
+ constructor(e = {}) {
8
+ 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 = {};
9
+ }
10
+ /* === Graph functions ========= */
11
+ isDirected() {
12
+ return this._isDirected;
13
+ }
14
+ isMultigraph() {
15
+ return this._isMultigraph;
16
+ }
17
+ isCompound() {
18
+ return this._isCompound;
19
+ }
20
+ setGraph(e) {
21
+ return this._label = e, this;
22
+ }
23
+ graph() {
24
+ return this._label;
25
+ }
26
+ /* === Node functions ========== */
27
+ setDefaultNodeLabel(e) {
28
+ return b(e) || (e = f(e)), this._defaultNodeLabelFn = e, this;
29
+ }
30
+ nodeCount() {
31
+ return this._nodeCount;
32
+ }
33
+ nodes() {
34
+ return _(this._nodes);
35
+ }
36
+ sources() {
37
+ var e = this;
38
+ return g(this.nodes(), function(t) {
39
+ return E(e._in[t]);
40
+ });
41
+ }
42
+ sinks() {
43
+ var e = this;
44
+ return g(this.nodes(), function(t) {
45
+ return E(e._out[t]);
46
+ });
47
+ }
48
+ setNodes(e, t) {
49
+ var s = arguments, i = this;
50
+ return d(e, function(r) {
51
+ s.length > 1 ? i.setNode(r, t) : i.setNode(r);
52
+ }), this;
53
+ }
54
+ setNode(e, t) {
55
+ 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);
56
+ }
57
+ node(e) {
58
+ return this._nodes[e];
59
+ }
60
+ hasNode(e) {
61
+ return Object.prototype.hasOwnProperty.call(this._nodes, e);
62
+ }
63
+ removeNode(e) {
64
+ if (Object.prototype.hasOwnProperty.call(this._nodes, e)) {
65
+ var t = (s) => this.removeEdge(this._edgeObjs[s]);
66
+ delete this._nodes[e], this._isCompound && (this._removeFromParentsChildList(e), delete this._parent[e], d(this.children(e), (s) => {
67
+ this.setParent(s);
68
+ }), 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;
69
+ }
70
+ return this;
71
+ }
72
+ setParent(e, t) {
73
+ if (!this._isCompound)
74
+ throw new Error("Cannot set parent in a non-compound graph");
75
+ if (l(t))
76
+ t = a;
77
+ else {
78
+ t += "";
79
+ for (var s = t; !l(s); s = this.parent(s))
80
+ if (s === e)
81
+ throw new Error("Setting " + t + " as parent of " + e + " would create a cycle");
82
+ this.setNode(t);
83
+ }
84
+ return this.setNode(e), this._removeFromParentsChildList(e), this._parent[e] = t, this._children[t][e] = !0, this;
85
+ }
86
+ _removeFromParentsChildList(e) {
87
+ delete this._children[this._parent[e]][e];
88
+ }
89
+ parent(e) {
90
+ if (this._isCompound) {
91
+ var t = this._parent[e];
92
+ if (t !== a)
93
+ return t;
94
+ }
95
+ }
96
+ children(e) {
97
+ if (l(e) && (e = a), this._isCompound) {
98
+ var t = this._children[e];
99
+ if (t)
100
+ return _(t);
101
+ } else {
102
+ if (e === a)
103
+ return this.nodes();
104
+ if (this.hasNode(e))
105
+ return [];
106
+ }
107
+ }
108
+ predecessors(e) {
109
+ var t = this._preds[e];
110
+ if (t)
111
+ return _(t);
112
+ }
113
+ successors(e) {
114
+ var t = this._sucs[e];
115
+ if (t)
116
+ return _(t);
117
+ }
118
+ neighbors(e) {
119
+ var t = this.predecessors(e);
120
+ if (t)
121
+ return w(t, this.successors(e));
122
+ }
123
+ isLeaf(e) {
124
+ var t;
125
+ return this.isDirected() ? t = this.successors(e) : t = this.neighbors(e), t.length === 0;
126
+ }
127
+ filterNodes(e) {
128
+ var t = new this.constructor({
129
+ directed: this._isDirected,
130
+ multigraph: this._isMultigraph,
131
+ compound: this._isCompound
132
+ });
133
+ t.setGraph(this.graph());
134
+ var s = this;
135
+ d(this._nodes, function(n, h) {
136
+ e(h) && t.setNode(h, n);
137
+ }), d(this._edgeObjs, function(n) {
138
+ t.hasNode(n.v) && t.hasNode(n.w) && t.setEdge(n, s.edge(n));
139
+ });
140
+ var i = {};
141
+ function r(n) {
142
+ var h = s.parent(n);
143
+ return h === void 0 || t.hasNode(h) ? (i[n] = h, h) : h in i ? i[h] : r(h);
144
+ }
145
+ return this._isCompound && d(t.nodes(), function(n) {
146
+ t.setParent(n, r(n));
147
+ }), t;
148
+ }
149
+ /* === Edge functions ========== */
150
+ setDefaultEdgeLabel(e) {
151
+ return b(e) || (e = f(e)), this._defaultEdgeLabelFn = e, this;
152
+ }
153
+ edgeCount() {
154
+ return this._edgeCount;
155
+ }
156
+ edges() {
157
+ return p(this._edgeObjs);
158
+ }
159
+ setPath(e, t) {
160
+ var s = this, i = arguments;
161
+ return D(e, function(r, n) {
162
+ return i.length > 1 ? s.setEdge(r, n, t) : s.setEdge(r, n), n;
163
+ }), this;
164
+ }
165
+ /*
166
+ * setEdge(v, w, [value, [name]])
167
+ * setEdge({ v, w, [name] }, [value])
168
+ */
169
+ setEdge() {
170
+ var e, t, s, i, r = !1, n = arguments[0];
171
+ 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);
172
+ var h = c(this._isDirected, e, t, s);
173
+ if (Object.prototype.hasOwnProperty.call(this._edgeLabels, h))
174
+ return r && (this._edgeLabels[h] = i), this;
175
+ if (!l(s) && !this._isMultigraph)
176
+ throw new Error("Cannot set a named edge when isMultigraph = false");
177
+ this.setNode(e), this.setNode(t), this._edgeLabels[h] = r ? i : this._defaultEdgeLabelFn(e, t, s);
178
+ var u = M(this._isDirected, e, t, s);
179
+ 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;
180
+ }
181
+ edge(e, t, s) {
182
+ var i = arguments.length === 1 ? m(this._isDirected, arguments[0]) : c(this._isDirected, e, t, s);
183
+ return this._edgeLabels[i];
184
+ }
185
+ hasEdge(e, t, s) {
186
+ var i = arguments.length === 1 ? m(this._isDirected, arguments[0]) : c(this._isDirected, e, t, s);
187
+ return Object.prototype.hasOwnProperty.call(this._edgeLabels, i);
188
+ }
189
+ removeEdge(e, t, s) {
190
+ var i = arguments.length === 1 ? m(this._isDirected, arguments[0]) : c(this._isDirected, e, t, s), r = this._edgeObjs[i];
191
+ 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;
192
+ }
193
+ inEdges(e, t) {
194
+ var s = this._in[e];
195
+ if (s) {
196
+ var i = p(s);
197
+ return t ? g(i, function(r) {
198
+ return r.v === t;
199
+ }) : i;
200
+ }
201
+ }
202
+ outEdges(e, t) {
203
+ var s = this._out[e];
204
+ if (s) {
205
+ var i = p(s);
206
+ return t ? g(i, function(r) {
207
+ return r.w === t;
208
+ }) : i;
209
+ }
210
+ }
211
+ nodeEdges(e, t) {
212
+ var s = this.inEdges(e, t);
213
+ if (s)
214
+ return s.concat(this.outEdges(e, t));
215
+ }
216
+ }
217
+ L.prototype._nodeCount = 0;
218
+ L.prototype._edgeCount = 0;
219
+ function C(o, e) {
220
+ o[e] ? o[e]++ : o[e] = 1;
221
+ }
222
+ function y(o, e) {
223
+ --o[e] || delete o[e];
224
+ }
225
+ function c(o, e, t, s) {
226
+ var i = "" + e, r = "" + t;
227
+ if (!o && i > r) {
228
+ var n = i;
229
+ i = r, r = n;
230
+ }
231
+ return i + O + r + O + (l(s) ? F : s);
232
+ }
233
+ function M(o, e, t, s) {
234
+ var i = "" + e, r = "" + t;
235
+ if (!o && i > r) {
236
+ var n = i;
237
+ i = r, r = n;
238
+ }
239
+ var h = { v: i, w: r };
240
+ return s && (h.name = s), h;
241
+ }
242
+ function m(o, e) {
243
+ return c(o, e.v, e.w, e.name);
244
+ }
245
+ export {
246
+ L as G
247
+ };
src/backend/gradio_dropdownplus/templates/component/index.js ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ import { a as e, D as o, E as p, M as t, I as l } from "./Index-v4MoKD9K.js";
2
+ export {
3
+ e as BaseDropdown,
4
+ o as BaseDropdownOptions,
5
+ p as BaseExample,
6
+ t as BaseMultiselect,
7
+ l as default
8
+ };
src/backend/gradio_dropdownplus/templates/component/infoDiagram-DDUCL6P7-HvkRXesP.js ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { _ as e, l as s, H as o, e as i, I as g } from "./mermaid.core-D58rAnek.js";
2
+ import { p } from "./treemap-75Q7IDZK-CIjK5oQY.js";
3
+ var v = {
4
+ parse: /* @__PURE__ */ e(async (r) => {
5
+ const a = await p("info", r);
6
+ s.debug(a);
7
+ }, "parse")
8
+ }, d = {
9
+ version: g.version + ""
10
+ }, c = /* @__PURE__ */ e(() => d.version, "getVersion"), m = {
11
+ getVersion: c
12
+ }, l = /* @__PURE__ */ e((r, a, n) => {
13
+ s.debug(`rendering info diagram
14
+ ` + r);
15
+ const t = o(a);
16
+ 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}`);
17
+ }, "draw"), f = { draw: l }, b = {
18
+ parser: v,
19
+ db: m,
20
+ renderer: f
21
+ };
22
+ export {
23
+ b as diagram
24
+ };
src/backend/gradio_dropdownplus/templates/component/init-DjUOC4st.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function t(e, a) {
2
+ switch (arguments.length) {
3
+ case 0:
4
+ break;
5
+ case 1:
6
+ this.range(e);
7
+ break;
8
+ default:
9
+ this.range(a).domain(e);
10
+ break;
11
+ }
12
+ return this;
13
+ }
14
+ export {
15
+ t as i
16
+ };
src/backend/gradio_dropdownplus/templates/component/journeyDiagram-FFXJYRFH-r0hQ5t3-.js ADDED
@@ -0,0 +1,836 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { a as gt, g as lt, f as mt, d as xt } from "./chunk-OMD6QJNC-dXofsL9p.js";
2
+ import { g as kt } from "./chunk-GLLZNHP4-BcJ3UCJy.js";
3
+ 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-D58rAnek.js";
4
+ import { d as et } from "./arc-C-Ik2gwm.js";
5
+ var U = function() {
6
+ var t = /* @__PURE__ */ n(function(h, i, a, l) {
7
+ for (a = a || {}, l = h.length; l--; a[h[l]] = i) ;
8
+ return a;
9
+ }, "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 = {
10
+ trace: /* @__PURE__ */ n(function() {
11
+ }, "trace"),
12
+ yy: {},
13
+ 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 },
14
+ 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" },
15
+ 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]],
16
+ performAction: /* @__PURE__ */ n(function(i, a, l, d, p, o, b) {
17
+ var k = o.length - 1;
18
+ switch (p) {
19
+ case 1:
20
+ return o[k - 1];
21
+ case 2:
22
+ this.$ = [];
23
+ break;
24
+ case 3:
25
+ o[k - 1].push(o[k]), this.$ = o[k - 1];
26
+ break;
27
+ case 4:
28
+ case 5:
29
+ this.$ = o[k];
30
+ break;
31
+ case 6:
32
+ case 7:
33
+ this.$ = [];
34
+ break;
35
+ case 8:
36
+ d.setDiagramTitle(o[k].substr(6)), this.$ = o[k].substr(6);
37
+ break;
38
+ case 9:
39
+ this.$ = o[k].trim(), d.setAccTitle(this.$);
40
+ break;
41
+ case 10:
42
+ case 11:
43
+ this.$ = o[k].trim(), d.setAccDescription(this.$);
44
+ break;
45
+ case 12:
46
+ d.addSection(o[k].substr(8)), this.$ = o[k].substr(8);
47
+ break;
48
+ case 13:
49
+ d.addTask(o[k - 1], o[k]), this.$ = "task";
50
+ break;
51
+ }
52
+ }, "anonymous"),
53
+ 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])],
54
+ defaultActions: {},
55
+ parseError: /* @__PURE__ */ n(function(i, a) {
56
+ if (a.recoverable)
57
+ this.trace(i);
58
+ else {
59
+ var l = new Error(i);
60
+ throw l.hash = a, l;
61
+ }
62
+ }, "parseError"),
63
+ parse: /* @__PURE__ */ n(function(i) {
64
+ 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: {} };
65
+ for (var O in this.yy)
66
+ Object.prototype.hasOwnProperty.call(this.yy, O) && (I.yy[O] = this.yy[O]);
67
+ _.setInput(i, I.yy), I.yy.lexer = _, I.yy.parser = this, typeof _.yylloc > "u" && (_.yylloc = {});
68
+ var Y = _.yylloc;
69
+ o.push(Y);
70
+ var ft = _.options && _.options.ranges;
71
+ typeof I.yy.parseError == "function" ? this.parseError = I.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
72
+ function pt(w) {
73
+ l.length = l.length - 2 * w, p.length = p.length - w, o.length = o.length - w;
74
+ }
75
+ n(pt, "popStack");
76
+ function D() {
77
+ var w;
78
+ return w = d.pop() || _.lex() || Q, typeof w != "number" && (w instanceof Array && (d = w, w = d.pop()), w = a.symbols_[w] || w), w;
79
+ }
80
+ n(D, "lex");
81
+ for (var v, A, T, q, F = {}, N, M, tt, z; ; ) {
82
+ 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]) {
83
+ var X = "";
84
+ z = [];
85
+ for (N in b[A])
86
+ this.terminals_[N] && N > dt && z.push("'" + this.terminals_[N] + "'");
87
+ _.showPosition ? X = "Parse error on line " + (C + 1) + `:
88
+ ` + _.showPosition() + `
89
+ 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, {
90
+ text: _.match,
91
+ token: this.terminals_[v] || v,
92
+ line: _.yylineno,
93
+ loc: Y,
94
+ expected: z
95
+ });
96
+ }
97
+ if (T[0] instanceof Array && T.length > 1)
98
+ throw new Error("Parse Error: multiple actions possible at state: " + A + ", token: " + v);
99
+ switch (T[0]) {
100
+ case 1:
101
+ l.push(v), p.push(_.yytext), o.push(_.yylloc), l.push(T[1]), v = null, K = _.yyleng, k = _.yytext, C = _.yylineno, Y = _.yylloc;
102
+ break;
103
+ case 2:
104
+ if (M = this.productions_[T[1]][1], F.$ = p[p.length - M], F._$ = {
105
+ first_line: o[o.length - (M || 1)].first_line,
106
+ last_line: o[o.length - 1].last_line,
107
+ first_column: o[o.length - (M || 1)].first_column,
108
+ last_column: o[o.length - 1].last_column
109
+ }, ft && (F._$.range = [
110
+ o[o.length - (M || 1)].range[0],
111
+ o[o.length - 1].range[1]
112
+ ]), q = this.performAction.apply(F, [
113
+ k,
114
+ K,
115
+ C,
116
+ I.yy,
117
+ T[1],
118
+ p,
119
+ o
120
+ ].concat(yt)), typeof q < "u")
121
+ return q;
122
+ 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);
123
+ break;
124
+ case 3:
125
+ return !0;
126
+ }
127
+ }
128
+ return !0;
129
+ }, "parse")
130
+ }, m = /* @__PURE__ */ function() {
131
+ var h = {
132
+ EOF: 1,
133
+ parseError: /* @__PURE__ */ n(function(a, l) {
134
+ if (this.yy.parser)
135
+ this.yy.parser.parseError(a, l);
136
+ else
137
+ throw new Error(a);
138
+ }, "parseError"),
139
+ // resets the lexer, sets new input
140
+ setInput: /* @__PURE__ */ n(function(i, a) {
141
+ 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 = {
142
+ first_line: 1,
143
+ first_column: 0,
144
+ last_line: 1,
145
+ last_column: 0
146
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
147
+ }, "setInput"),
148
+ // consumes and returns one char from the input
149
+ input: /* @__PURE__ */ n(function() {
150
+ var i = this._input[0];
151
+ this.yytext += i, this.yyleng++, this.offset++, this.match += i, this.matched += i;
152
+ var a = i.match(/(?:\r\n?|\n).*/g);
153
+ 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;
154
+ }, "input"),
155
+ // unshifts one char (or a string) into the input
156
+ unput: /* @__PURE__ */ n(function(i) {
157
+ var a = i.length, l = i.split(/(?:\r\n?|\n)/g);
158
+ this._input = i + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - a), this.offset -= a;
159
+ var d = this.match.split(/(?:\r\n?|\n)/g);
160
+ 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);
161
+ var p = this.yylloc.range;
162
+ return this.yylloc = {
163
+ first_line: this.yylloc.first_line,
164
+ last_line: this.yylineno + 1,
165
+ first_column: this.yylloc.first_column,
166
+ 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
167
+ }, this.options.ranges && (this.yylloc.range = [p[0], p[0] + this.yyleng - a]), this.yyleng = this.yytext.length, this;
168
+ }, "unput"),
169
+ // When called from action, caches matched text and appends it on next action
170
+ more: /* @__PURE__ */ n(function() {
171
+ return this._more = !0, this;
172
+ }, "more"),
173
+ // 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.
174
+ reject: /* @__PURE__ */ n(function() {
175
+ if (this.options.backtrack_lexer)
176
+ this._backtrack = !0;
177
+ else
178
+ 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).
179
+ ` + this.showPosition(), {
180
+ text: "",
181
+ token: null,
182
+ line: this.yylineno
183
+ });
184
+ return this;
185
+ }, "reject"),
186
+ // retain first n characters of the match
187
+ less: /* @__PURE__ */ n(function(i) {
188
+ this.unput(this.match.slice(i));
189
+ }, "less"),
190
+ // displays already matched input, i.e. for error messages
191
+ pastInput: /* @__PURE__ */ n(function() {
192
+ var i = this.matched.substr(0, this.matched.length - this.match.length);
193
+ return (i.length > 20 ? "..." : "") + i.substr(-20).replace(/\n/g, "");
194
+ }, "pastInput"),
195
+ // displays upcoming input, i.e. for error messages
196
+ upcomingInput: /* @__PURE__ */ n(function() {
197
+ var i = this.match;
198
+ return i.length < 20 && (i += this._input.substr(0, 20 - i.length)), (i.substr(0, 20) + (i.length > 20 ? "..." : "")).replace(/\n/g, "");
199
+ }, "upcomingInput"),
200
+ // displays the character position where the lexing error occurred, i.e. for error messages
201
+ showPosition: /* @__PURE__ */ n(function() {
202
+ var i = this.pastInput(), a = new Array(i.length + 1).join("-");
203
+ return i + this.upcomingInput() + `
204
+ ` + a + "^";
205
+ }, "showPosition"),
206
+ // test the lexed token: return FALSE when not a match, otherwise return token
207
+ test_match: /* @__PURE__ */ n(function(i, a) {
208
+ var l, d, p;
209
+ if (this.options.backtrack_lexer && (p = {
210
+ yylineno: this.yylineno,
211
+ yylloc: {
212
+ first_line: this.yylloc.first_line,
213
+ last_line: this.last_line,
214
+ first_column: this.yylloc.first_column,
215
+ last_column: this.yylloc.last_column
216
+ },
217
+ yytext: this.yytext,
218
+ match: this.match,
219
+ matches: this.matches,
220
+ matched: this.matched,
221
+ yyleng: this.yyleng,
222
+ offset: this.offset,
223
+ _more: this._more,
224
+ _input: this._input,
225
+ yy: this.yy,
226
+ conditionStack: this.conditionStack.slice(0),
227
+ done: this.done
228
+ }, 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 = {
229
+ first_line: this.yylloc.last_line,
230
+ last_line: this.yylineno + 1,
231
+ first_column: this.yylloc.last_column,
232
+ last_column: d ? d[d.length - 1].length - d[d.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + i[0].length
233
+ }, 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)
234
+ return l;
235
+ if (this._backtrack) {
236
+ for (var o in p)
237
+ this[o] = p[o];
238
+ return !1;
239
+ }
240
+ return !1;
241
+ }, "test_match"),
242
+ // return next match in input
243
+ next: /* @__PURE__ */ n(function() {
244
+ if (this.done)
245
+ return this.EOF;
246
+ this._input || (this.done = !0);
247
+ var i, a, l, d;
248
+ this._more || (this.yytext = "", this.match = "");
249
+ for (var p = this._currentRules(), o = 0; o < p.length; o++)
250
+ if (l = this._input.match(this.rules[p[o]]), l && (!a || l[0].length > a[0].length)) {
251
+ if (a = l, d = o, this.options.backtrack_lexer) {
252
+ if (i = this.test_match(l, p[o]), i !== !1)
253
+ return i;
254
+ if (this._backtrack) {
255
+ a = !1;
256
+ continue;
257
+ } else
258
+ return !1;
259
+ } else if (!this.options.flex)
260
+ break;
261
+ }
262
+ 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.
263
+ ` + this.showPosition(), {
264
+ text: "",
265
+ token: null,
266
+ line: this.yylineno
267
+ });
268
+ }, "next"),
269
+ // return next match that has a token
270
+ lex: /* @__PURE__ */ n(function() {
271
+ var a = this.next();
272
+ return a || this.lex();
273
+ }, "lex"),
274
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
275
+ begin: /* @__PURE__ */ n(function(a) {
276
+ this.conditionStack.push(a);
277
+ }, "begin"),
278
+ // pop the previously active lexer condition state off the condition stack
279
+ popState: /* @__PURE__ */ n(function() {
280
+ var a = this.conditionStack.length - 1;
281
+ return a > 0 ? this.conditionStack.pop() : this.conditionStack[0];
282
+ }, "popState"),
283
+ // produce the lexer rule set which is active for the currently active lexer condition state
284
+ _currentRules: /* @__PURE__ */ n(function() {
285
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
286
+ }, "_currentRules"),
287
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
288
+ topState: /* @__PURE__ */ n(function(a) {
289
+ return a = this.conditionStack.length - 1 - Math.abs(a || 0), a >= 0 ? this.conditionStack[a] : "INITIAL";
290
+ }, "topState"),
291
+ // alias for begin(condition)
292
+ pushState: /* @__PURE__ */ n(function(a) {
293
+ this.begin(a);
294
+ }, "pushState"),
295
+ // return the number of states currently on the stack
296
+ stateStackSize: /* @__PURE__ */ n(function() {
297
+ return this.conditionStack.length;
298
+ }, "stateStackSize"),
299
+ options: { "case-insensitive": !0 },
300
+ performAction: /* @__PURE__ */ n(function(a, l, d, p) {
301
+ switch (d) {
302
+ case 0:
303
+ break;
304
+ case 1:
305
+ break;
306
+ case 2:
307
+ return 10;
308
+ case 3:
309
+ break;
310
+ case 4:
311
+ break;
312
+ case 5:
313
+ return 4;
314
+ case 6:
315
+ return 11;
316
+ case 7:
317
+ return this.begin("acc_title"), 12;
318
+ case 8:
319
+ return this.popState(), "acc_title_value";
320
+ case 9:
321
+ return this.begin("acc_descr"), 14;
322
+ case 10:
323
+ return this.popState(), "acc_descr_value";
324
+ case 11:
325
+ this.begin("acc_descr_multiline");
326
+ break;
327
+ case 12:
328
+ this.popState();
329
+ break;
330
+ case 13:
331
+ return "acc_descr_multiline_value";
332
+ case 14:
333
+ return 17;
334
+ case 15:
335
+ return 18;
336
+ case 16:
337
+ return 19;
338
+ case 17:
339
+ return ":";
340
+ case 18:
341
+ return 6;
342
+ case 19:
343
+ return "INVALID";
344
+ }
345
+ }, "anonymous"),
346
+ 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],
347
+ 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 } }
348
+ };
349
+ return h;
350
+ }();
351
+ g.lexer = m;
352
+ function x() {
353
+ this.yy = {};
354
+ }
355
+ return n(x, "Parser"), x.prototype = g, g.Parser = x, new x();
356
+ }();
357
+ U.parser = U;
358
+ var Et = U, V = "", Z = [], L = [], B = [], Ct = /* @__PURE__ */ n(function() {
359
+ Z.length = 0, L.length = 0, V = "", B.length = 0, Mt();
360
+ }, "clear"), Pt = /* @__PURE__ */ n(function(t) {
361
+ V = t, Z.push(t);
362
+ }, "addSection"), It = /* @__PURE__ */ n(function() {
363
+ return Z;
364
+ }, "getSections"), At = /* @__PURE__ */ n(function() {
365
+ let t = it();
366
+ const e = 100;
367
+ let s = 0;
368
+ for (; !t && s < e; )
369
+ t = it(), s++;
370
+ return L.push(...B), L;
371
+ }, "getTasks"), Ft = /* @__PURE__ */ n(function() {
372
+ const t = [];
373
+ return L.forEach((s) => {
374
+ s.people && t.push(...s.people);
375
+ }), [...new Set(t)].sort();
376
+ }, "updateActors"), Vt = /* @__PURE__ */ n(function(t, e) {
377
+ const s = e.substr(1).split(":");
378
+ let c = 0, r = [];
379
+ s.length === 1 ? (c = Number(s[0]), r = []) : (c = Number(s[0]), r = s[1].split(","));
380
+ const f = r.map((y) => y.trim()), u = {
381
+ section: V,
382
+ type: V,
383
+ people: f,
384
+ task: t,
385
+ score: c
386
+ };
387
+ B.push(u);
388
+ }, "addTask"), Rt = /* @__PURE__ */ n(function(t) {
389
+ const e = {
390
+ section: V,
391
+ type: V,
392
+ description: t,
393
+ task: t,
394
+ classes: []
395
+ };
396
+ L.push(e);
397
+ }, "addTaskOrg"), it = /* @__PURE__ */ n(function() {
398
+ const t = /* @__PURE__ */ n(function(s) {
399
+ return B[s].processed;
400
+ }, "compileTask");
401
+ let e = !0;
402
+ for (const [s, c] of B.entries())
403
+ t(s), e = e && c.processed;
404
+ return e;
405
+ }, "compileTasks"), Lt = /* @__PURE__ */ n(function() {
406
+ return Ft();
407
+ }, "getActors"), rt = {
408
+ getConfig: /* @__PURE__ */ n(() => R().journey, "getConfig"),
409
+ clear: Ct,
410
+ setDiagramTitle: St,
411
+ getDiagramTitle: Tt,
412
+ setAccTitle: wt,
413
+ getAccTitle: bt,
414
+ setAccDescription: vt,
415
+ getAccDescription: _t,
416
+ addSection: Pt,
417
+ getSections: It,
418
+ getTasks: At,
419
+ addTask: Vt,
420
+ addTaskOrg: Rt,
421
+ getActors: Lt
422
+ }, Bt = /* @__PURE__ */ n((t) => `.label {
423
+ font-family: ${t.fontFamily};
424
+ color: ${t.textColor};
425
+ }
426
+ .mouth {
427
+ stroke: #666;
428
+ }
429
+
430
+ line {
431
+ stroke: ${t.textColor}
432
+ }
433
+
434
+ .legend {
435
+ fill: ${t.textColor};
436
+ font-family: ${t.fontFamily};
437
+ }
438
+
439
+ .label text {
440
+ fill: #333;
441
+ }
442
+ .label {
443
+ color: ${t.textColor}
444
+ }
445
+
446
+ .face {
447
+ ${t.faceColor ? `fill: ${t.faceColor}` : "fill: #FFF8DC"};
448
+ stroke: #999;
449
+ }
450
+
451
+ .node rect,
452
+ .node circle,
453
+ .node ellipse,
454
+ .node polygon,
455
+ .node path {
456
+ fill: ${t.mainBkg};
457
+ stroke: ${t.nodeBorder};
458
+ stroke-width: 1px;
459
+ }
460
+
461
+ .node .label {
462
+ text-align: center;
463
+ }
464
+ .node.clickable {
465
+ cursor: pointer;
466
+ }
467
+
468
+ .arrowheadPath {
469
+ fill: ${t.arrowheadColor};
470
+ }
471
+
472
+ .edgePath .path {
473
+ stroke: ${t.lineColor};
474
+ stroke-width: 1.5px;
475
+ }
476
+
477
+ .flowchart-link {
478
+ stroke: ${t.lineColor};
479
+ fill: none;
480
+ }
481
+
482
+ .edgeLabel {
483
+ background-color: ${t.edgeLabelBackground};
484
+ rect {
485
+ opacity: 0.5;
486
+ }
487
+ text-align: center;
488
+ }
489
+
490
+ .cluster rect {
491
+ }
492
+
493
+ .cluster text {
494
+ fill: ${t.titleColor};
495
+ }
496
+
497
+ div.mermaidTooltip {
498
+ position: absolute;
499
+ text-align: center;
500
+ max-width: 200px;
501
+ padding: 2px;
502
+ font-family: ${t.fontFamily};
503
+ font-size: 12px;
504
+ background: ${t.tertiaryColor};
505
+ border: 1px solid ${t.border2};
506
+ border-radius: 2px;
507
+ pointer-events: none;
508
+ z-index: 100;
509
+ }
510
+
511
+ .task-type-0, .section-type-0 {
512
+ ${t.fillType0 ? `fill: ${t.fillType0}` : ""};
513
+ }
514
+ .task-type-1, .section-type-1 {
515
+ ${t.fillType0 ? `fill: ${t.fillType1}` : ""};
516
+ }
517
+ .task-type-2, .section-type-2 {
518
+ ${t.fillType0 ? `fill: ${t.fillType2}` : ""};
519
+ }
520
+ .task-type-3, .section-type-3 {
521
+ ${t.fillType0 ? `fill: ${t.fillType3}` : ""};
522
+ }
523
+ .task-type-4, .section-type-4 {
524
+ ${t.fillType0 ? `fill: ${t.fillType4}` : ""};
525
+ }
526
+ .task-type-5, .section-type-5 {
527
+ ${t.fillType0 ? `fill: ${t.fillType5}` : ""};
528
+ }
529
+ .task-type-6, .section-type-6 {
530
+ ${t.fillType0 ? `fill: ${t.fillType6}` : ""};
531
+ }
532
+ .task-type-7, .section-type-7 {
533
+ ${t.fillType0 ? `fill: ${t.fillType7}` : ""};
534
+ }
535
+
536
+ .actor-0 {
537
+ ${t.actor0 ? `fill: ${t.actor0}` : ""};
538
+ }
539
+ .actor-1 {
540
+ ${t.actor1 ? `fill: ${t.actor1}` : ""};
541
+ }
542
+ .actor-2 {
543
+ ${t.actor2 ? `fill: ${t.actor2}` : ""};
544
+ }
545
+ .actor-3 {
546
+ ${t.actor3 ? `fill: ${t.actor3}` : ""};
547
+ }
548
+ .actor-4 {
549
+ ${t.actor4 ? `fill: ${t.actor4}` : ""};
550
+ }
551
+ .actor-5 {
552
+ ${t.actor5 ? `fill: ${t.actor5}` : ""};
553
+ }
554
+ ${kt()}
555
+ `, "getStyles"), jt = Bt, J = /* @__PURE__ */ n(function(t, e) {
556
+ return xt(t, e);
557
+ }, "drawRect"), Nt = /* @__PURE__ */ n(function(t, e) {
558
+ 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");
559
+ 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");
560
+ function f(g) {
561
+ const m = et().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175);
562
+ g.append("path").attr("class", "mouth").attr("d", m).attr("transform", "translate(" + e.cx + "," + (e.cy + 2) + ")");
563
+ }
564
+ n(f, "smile");
565
+ function u(g) {
566
+ const m = et().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175);
567
+ g.append("path").attr("class", "mouth").attr("d", m).attr("transform", "translate(" + e.cx + "," + (e.cy + 7) + ")");
568
+ }
569
+ n(u, "sad");
570
+ function y(g) {
571
+ 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");
572
+ }
573
+ return n(y, "ambivalent"), e.score > 3 ? f(r) : e.score < 3 ? u(r) : y(r), c;
574
+ }, "drawFace"), ot = /* @__PURE__ */ n(function(t, e) {
575
+ const s = t.append("circle");
576
+ 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;
577
+ }, "drawCircle"), ct = /* @__PURE__ */ n(function(t, e) {
578
+ return mt(t, e);
579
+ }, "drawText"), zt = /* @__PURE__ */ n(function(t, e) {
580
+ function s(r, f, u, y, g) {
581
+ return r + "," + f + " " + (r + u) + "," + f + " " + (r + u) + "," + (f + y - g) + " " + (r + u - g * 1.2) + "," + (f + y) + " " + r + "," + (f + y);
582
+ }
583
+ n(s, "genPoints");
584
+ const c = t.append("polygon");
585
+ 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);
586
+ }, "drawLabel"), Wt = /* @__PURE__ */ n(function(t, e, s) {
587
+ const c = t.append("g"), r = lt();
588
+ r.x = e.x, r.y = e.y, r.fill = e.fill, r.width = s.width * e.taskCount + // width of the tasks
589
+ 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)(
590
+ e.text,
591
+ c,
592
+ r.x,
593
+ r.y,
594
+ r.width,
595
+ r.height,
596
+ { class: "journey-section section-type-" + e.num },
597
+ s,
598
+ e.colour
599
+ );
600
+ }, "drawSection"), nt = -1, Ot = /* @__PURE__ */ n(function(t, e, s) {
601
+ const c = e.x + s.width / 2, r = t.append("g");
602
+ nt++;
603
+ const f = 300 + 5 * 30;
604
+ 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, {
605
+ cx: c,
606
+ cy: 300 + (5 - e.score) * 30,
607
+ score: e.score
608
+ });
609
+ const u = lt();
610
+ 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);
611
+ let y = e.x + 14;
612
+ e.people.forEach((g) => {
613
+ const m = e.actors[g].color, x = {
614
+ cx: y,
615
+ cy: e.y,
616
+ r: 7,
617
+ fill: m,
618
+ stroke: "#000",
619
+ title: g,
620
+ pos: e.actors[g].position
621
+ };
622
+ ot(r, x), y += 10;
623
+ }), ht(s)(
624
+ e.task,
625
+ r,
626
+ u.x,
627
+ u.y,
628
+ u.width,
629
+ u.height,
630
+ { class: "task" },
631
+ s,
632
+ e.colour
633
+ );
634
+ }, "drawTask"), Yt = /* @__PURE__ */ n(function(t, e) {
635
+ gt(t, e);
636
+ }, "drawBackgroundRect"), ht = /* @__PURE__ */ function() {
637
+ function t(r, f, u, y, g, m, x, h) {
638
+ 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);
639
+ c(i, x);
640
+ }
641
+ n(t, "byText");
642
+ function e(r, f, u, y, g, m, x, h, i) {
643
+ const { taskFontSize: a, taskFontFamily: l } = h, d = r.split(/<br\s*\/?>/gi);
644
+ for (let p = 0; p < d.length; p++) {
645
+ 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);
646
+ 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);
647
+ }
648
+ }
649
+ n(e, "byTspan");
650
+ function s(r, f, u, y, g, m, x, h) {
651
+ 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%");
652
+ 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);
653
+ }
654
+ n(s, "byFo");
655
+ function c(r, f) {
656
+ for (const u in f)
657
+ u in f && r.attr(u, f[u]);
658
+ }
659
+ return n(c, "_setTextAttrs"), function(r) {
660
+ return r.textPlacement === "fo" ? s : r.textPlacement === "old" ? t : e;
661
+ };
662
+ }(), qt = /* @__PURE__ */ n(function(t) {
663
+ 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");
664
+ }, "initGraphics"), j = {
665
+ drawRect: J,
666
+ drawCircle: ot,
667
+ drawSection: Wt,
668
+ drawText: ct,
669
+ drawLabel: zt,
670
+ drawTask: Ot,
671
+ drawBackgroundRect: Yt,
672
+ initGraphics: qt
673
+ }, Xt = /* @__PURE__ */ n(function(t) {
674
+ Object.keys(t).forEach(function(s) {
675
+ $[s] = t[s];
676
+ });
677
+ }, "setConf"), E = {}, W = 0;
678
+ function ut(t) {
679
+ const e = R().journey, s = e.maxLabelWidth;
680
+ W = 0;
681
+ let c = 60;
682
+ Object.keys(E).forEach((r) => {
683
+ const f = E[r].color, u = {
684
+ cx: 20,
685
+ cy: c,
686
+ r: 7,
687
+ fill: f,
688
+ stroke: "#000",
689
+ pos: E[r].position
690
+ };
691
+ j.drawCircle(t, u);
692
+ let y = t.append("text").attr("visibility", "hidden").text(r);
693
+ const g = y.node().getBoundingClientRect().width;
694
+ y.remove();
695
+ let m = [];
696
+ if (g <= s)
697
+ m = [r];
698
+ else {
699
+ const x = r.split(" ");
700
+ let h = "";
701
+ y = t.append("text").attr("visibility", "hidden"), x.forEach((i) => {
702
+ const a = h ? `${h} ${i}` : i;
703
+ if (y.text(a), y.node().getBoundingClientRect().width > s) {
704
+ if (h && m.push(h), h = i, y.text(i), y.node().getBoundingClientRect().width > s) {
705
+ let d = "";
706
+ for (const p of i)
707
+ d += p, y.text(d + "-"), y.node().getBoundingClientRect().width > s && (m.push(d.slice(0, -1) + "-"), d = p);
708
+ h = d;
709
+ }
710
+ } else
711
+ h = a;
712
+ }), h && m.push(h), y.remove();
713
+ }
714
+ m.forEach((x, h) => {
715
+ const i = {
716
+ x: 40,
717
+ y: c + 7 + h * 20,
718
+ fill: "#666",
719
+ text: x,
720
+ textMargin: e.boxTextMargin ?? 5
721
+ }, l = j.drawText(t, i).node().getBoundingClientRect().width;
722
+ l > W && l > e.leftMargin - l && (W = l);
723
+ }), c += Math.max(20, m.length * 20);
724
+ });
725
+ }
726
+ n(ut, "drawActorLegend");
727
+ var $ = R().journey, P = 0, Gt = /* @__PURE__ */ n(function(t, e, s, c) {
728
+ const r = R(), f = r.journey.titleColor, u = r.journey.titleFontSize, y = r.journey.titleFontFamily, g = r.securityLevel;
729
+ let m;
730
+ g === "sandbox" && (m = G("#i" + e));
731
+ const x = g === "sandbox" ? G(m.nodes()[0].contentDocument.body) : G("body");
732
+ S.init();
733
+ const h = x.select("#" + e);
734
+ j.initGraphics(h);
735
+ const i = c.db.getTasks(), a = c.db.getDiagramTitle(), l = c.db.getActors();
736
+ for (const C in E)
737
+ delete E[C];
738
+ let d = 0;
739
+ l.forEach((C) => {
740
+ E[C] = {
741
+ color: $.actorColours[d % $.actorColours.length],
742
+ position: d
743
+ }, d++;
744
+ }), ut(h), P = $.leftMargin + W, S.insert(0, 0, P, Object.keys(E).length * 50), Ht(h, i, 0);
745
+ const p = S.getBounds();
746
+ 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);
747
+ const o = p.stopy - p.starty + 2 * $.diagramMarginY, b = P + p.stopx + 2 * $.diagramMarginX;
748
+ $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)");
749
+ const k = a ? 70 : 0;
750
+ h.attr("viewBox", `${p.startx} -25 ${b} ${o + k}`), h.attr("preserveAspectRatio", "xMinYMin meet"), h.attr("height", o + k + 25);
751
+ }, "draw"), S = {
752
+ data: {
753
+ startx: void 0,
754
+ stopx: void 0,
755
+ starty: void 0,
756
+ stopy: void 0
757
+ },
758
+ verticalPos: 0,
759
+ sequenceItems: [],
760
+ init: /* @__PURE__ */ n(function() {
761
+ this.sequenceItems = [], this.data = {
762
+ startx: void 0,
763
+ stopx: void 0,
764
+ starty: void 0,
765
+ stopy: void 0
766
+ }, this.verticalPos = 0;
767
+ }, "init"),
768
+ updateVal: /* @__PURE__ */ n(function(t, e, s, c) {
769
+ t[e] === void 0 ? t[e] = s : t[e] = c(s, t[e]);
770
+ }, "updateVal"),
771
+ updateBounds: /* @__PURE__ */ n(function(t, e, s, c) {
772
+ const r = R().journey, f = this;
773
+ let u = 0;
774
+ function y(g) {
775
+ return /* @__PURE__ */ n(function(x) {
776
+ u++;
777
+ const h = f.sequenceItems.length - u + 1;
778
+ 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));
779
+ }, "updateItemBounds");
780
+ }
781
+ n(y, "updateFn"), this.sequenceItems.forEach(y());
782
+ }, "updateBounds"),
783
+ insert: /* @__PURE__ */ n(function(t, e, s, c) {
784
+ const r = Math.min(t, s), f = Math.max(t, s), u = Math.min(e, c), y = Math.max(e, c);
785
+ 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);
786
+ }, "insert"),
787
+ bumpVerticalPos: /* @__PURE__ */ n(function(t) {
788
+ this.verticalPos = this.verticalPos + t, this.data.stopy = this.verticalPos;
789
+ }, "bumpVerticalPos"),
790
+ getVerticalPos: /* @__PURE__ */ n(function() {
791
+ return this.verticalPos;
792
+ }, "getVerticalPos"),
793
+ getBounds: /* @__PURE__ */ n(function() {
794
+ return this.data;
795
+ }, "getBounds")
796
+ }, H = $.sectionFills, st = $.sectionColours, Ht = /* @__PURE__ */ n(function(t, e, s) {
797
+ const c = R().journey;
798
+ let r = "";
799
+ const f = c.height * 2 + c.diagramMarginY, u = s + f;
800
+ let y = 0, g = "#CCC", m = "black", x = 0;
801
+ for (const [h, i] of e.entries()) {
802
+ if (r !== i.section) {
803
+ g = H[y % H.length], x = y % H.length, m = st[y % st.length];
804
+ let l = 0;
805
+ const d = i.section;
806
+ for (let o = h; o < e.length && e[o].section == d; o++)
807
+ l = l + 1;
808
+ const p = {
809
+ x: h * c.taskMargin + h * c.width + P,
810
+ y: 50,
811
+ text: i.section,
812
+ fill: g,
813
+ num: x,
814
+ colour: m,
815
+ taskCount: l
816
+ };
817
+ j.drawSection(t, p, c), r = i.section, y++;
818
+ }
819
+ const a = i.people.reduce((l, d) => (E[d] && (l[d] = E[d]), l), {});
820
+ 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);
821
+ }
822
+ }, "drawTasks"), at = {
823
+ setConf: Xt,
824
+ draw: Gt
825
+ }, Qt = {
826
+ parser: Et,
827
+ db: rt,
828
+ renderer: at,
829
+ styles: jt,
830
+ init: /* @__PURE__ */ n((t) => {
831
+ at.setConf(t.journey), rt.clear();
832
+ }, "init")
833
+ };
834
+ export {
835
+ Qt as diagram
836
+ };
src/backend/gradio_dropdownplus/templates/component/kanban-definition-KOZQBZVT-DLBL3Rou.js ADDED
@@ -0,0 +1,720 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { g as fe } from "./chunk-GLLZNHP4-BcJ3UCJy.js";
2
+ 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-D58rAnek.js";
3
+ var $ = function() {
4
+ var t = /* @__PURE__ */ c(function(_, s, n, a) {
5
+ for (n = n || {}, a = _.length; a--; n[_[a]] = s) ;
6
+ return n;
7
+ }, "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 = {
8
+ trace: /* @__PURE__ */ c(function() {
9
+ }, "trace"),
10
+ yy: {},
11
+ 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 },
12
+ 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" },
13
+ 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]],
14
+ performAction: /* @__PURE__ */ c(function(s, n, a, o, u, e, B) {
15
+ var l = e.length - 1;
16
+ switch (u) {
17
+ case 6:
18
+ case 7:
19
+ return o;
20
+ case 8:
21
+ o.getLogger().trace("Stop NL ");
22
+ break;
23
+ case 9:
24
+ o.getLogger().trace("Stop EOF ");
25
+ break;
26
+ case 11:
27
+ o.getLogger().trace("Stop NL2 ");
28
+ break;
29
+ case 12:
30
+ o.getLogger().trace("Stop EOF2 ");
31
+ break;
32
+ case 15:
33
+ 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]);
34
+ break;
35
+ case 16:
36
+ o.getLogger().info("Node: ", e[l].id), o.addNode(e[l - 1].length, e[l].id, e[l].descr, e[l].type);
37
+ break;
38
+ case 17:
39
+ o.getLogger().trace("Icon: ", e[l]), o.decorateNode({ icon: e[l] });
40
+ break;
41
+ case 18:
42
+ case 23:
43
+ o.decorateNode({ class: e[l] });
44
+ break;
45
+ case 19:
46
+ o.getLogger().trace("SPACELIST");
47
+ break;
48
+ case 20:
49
+ 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]);
50
+ break;
51
+ case 21:
52
+ o.getLogger().trace("Node: ", e[l].id), o.addNode(0, e[l].id, e[l].descr, e[l].type);
53
+ break;
54
+ case 22:
55
+ o.decorateNode({ icon: e[l] });
56
+ break;
57
+ case 27:
58
+ 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]) };
59
+ break;
60
+ case 28:
61
+ this.$ = { id: e[l], descr: e[l], type: 0 };
62
+ break;
63
+ case 29:
64
+ 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]) };
65
+ break;
66
+ case 30:
67
+ this.$ = e[l - 1] + e[l];
68
+ break;
69
+ case 31:
70
+ this.$ = e[l];
71
+ break;
72
+ }
73
+ }, "anonymous"),
74
+ 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])],
75
+ defaultActions: { 2: [2, 1], 6: [2, 2] },
76
+ parseError: /* @__PURE__ */ c(function(s, n) {
77
+ if (n.recoverable)
78
+ this.trace(s);
79
+ else {
80
+ var a = new Error(s);
81
+ throw a.hash = n, a;
82
+ }
83
+ }, "parseError"),
84
+ parse: /* @__PURE__ */ c(function(s) {
85
+ 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: {} };
86
+ for (var J in this.yy)
87
+ Object.prototype.hasOwnProperty.call(this.yy, J) && (T.yy[J] = this.yy[J]);
88
+ b.setInput(s, T.yy), T.yy.lexer = b, T.yy.parser = this, typeof b.yylloc > "u" && (b.yylloc = {});
89
+ var q = b.yylloc;
90
+ e.push(q);
91
+ var de = b.options && b.options.ranges;
92
+ typeof T.yy.parseError == "function" ? this.parseError = T.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
93
+ function pe(S) {
94
+ a.length = a.length - 2 * S, u.length = u.length - S, e.length = e.length - S;
95
+ }
96
+ c(pe, "popStack");
97
+ function ae() {
98
+ var S;
99
+ return S = o.pop() || b.lex() || re, typeof S != "number" && (S instanceof Array && (o = S, S = o.pop()), S = n.symbols_[S] || S), S;
100
+ }
101
+ c(ae, "lex");
102
+ for (var k, R, v, Q, F = {}, X, I, oe, Y; ; ) {
103
+ 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]) {
104
+ var Z = "";
105
+ Y = [];
106
+ for (X in B[R])
107
+ this.terminals_[X] && X > ue && Y.push("'" + this.terminals_[X] + "'");
108
+ b.showPosition ? Z = "Parse error on line " + (z + 1) + `:
109
+ ` + b.showPosition() + `
110
+ 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, {
111
+ text: b.match,
112
+ token: this.terminals_[k] || k,
113
+ line: b.yylineno,
114
+ loc: q,
115
+ expected: Y
116
+ });
117
+ }
118
+ if (v[0] instanceof Array && v.length > 1)
119
+ throw new Error("Parse Error: multiple actions possible at state: " + R + ", token: " + k);
120
+ switch (v[0]) {
121
+ case 1:
122
+ 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;
123
+ break;
124
+ case 2:
125
+ if (I = this.productions_[v[1]][1], F.$ = u[u.length - I], F._$ = {
126
+ first_line: e[e.length - (I || 1)].first_line,
127
+ last_line: e[e.length - 1].last_line,
128
+ first_column: e[e.length - (I || 1)].first_column,
129
+ last_column: e[e.length - 1].last_column
130
+ }, de && (F._$.range = [
131
+ e[e.length - (I || 1)].range[0],
132
+ e[e.length - 1].range[1]
133
+ ]), Q = this.performAction.apply(F, [
134
+ l,
135
+ ie,
136
+ z,
137
+ T.yy,
138
+ v[1],
139
+ u,
140
+ e
141
+ ].concat(ge)), typeof Q < "u")
142
+ return Q;
143
+ 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);
144
+ break;
145
+ case 3:
146
+ return !0;
147
+ }
148
+ }
149
+ return !0;
150
+ }, "parse")
151
+ }, m = /* @__PURE__ */ function() {
152
+ var _ = {
153
+ EOF: 1,
154
+ parseError: /* @__PURE__ */ c(function(n, a) {
155
+ if (this.yy.parser)
156
+ this.yy.parser.parseError(n, a);
157
+ else
158
+ throw new Error(n);
159
+ }, "parseError"),
160
+ // resets the lexer, sets new input
161
+ setInput: /* @__PURE__ */ c(function(s, n) {
162
+ 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 = {
163
+ first_line: 1,
164
+ first_column: 0,
165
+ last_line: 1,
166
+ last_column: 0
167
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
168
+ }, "setInput"),
169
+ // consumes and returns one char from the input
170
+ input: /* @__PURE__ */ c(function() {
171
+ var s = this._input[0];
172
+ this.yytext += s, this.yyleng++, this.offset++, this.match += s, this.matched += s;
173
+ var n = s.match(/(?:\r\n?|\n).*/g);
174
+ 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;
175
+ }, "input"),
176
+ // unshifts one char (or a string) into the input
177
+ unput: /* @__PURE__ */ c(function(s) {
178
+ var n = s.length, a = s.split(/(?:\r\n?|\n)/g);
179
+ this._input = s + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - n), this.offset -= n;
180
+ var o = this.match.split(/(?:\r\n?|\n)/g);
181
+ 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);
182
+ var u = this.yylloc.range;
183
+ return this.yylloc = {
184
+ first_line: this.yylloc.first_line,
185
+ last_line: this.yylineno + 1,
186
+ first_column: this.yylloc.first_column,
187
+ 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
188
+ }, this.options.ranges && (this.yylloc.range = [u[0], u[0] + this.yyleng - n]), this.yyleng = this.yytext.length, this;
189
+ }, "unput"),
190
+ // When called from action, caches matched text and appends it on next action
191
+ more: /* @__PURE__ */ c(function() {
192
+ return this._more = !0, this;
193
+ }, "more"),
194
+ // 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.
195
+ reject: /* @__PURE__ */ c(function() {
196
+ if (this.options.backtrack_lexer)
197
+ this._backtrack = !0;
198
+ else
199
+ 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).
200
+ ` + this.showPosition(), {
201
+ text: "",
202
+ token: null,
203
+ line: this.yylineno
204
+ });
205
+ return this;
206
+ }, "reject"),
207
+ // retain first n characters of the match
208
+ less: /* @__PURE__ */ c(function(s) {
209
+ this.unput(this.match.slice(s));
210
+ }, "less"),
211
+ // displays already matched input, i.e. for error messages
212
+ pastInput: /* @__PURE__ */ c(function() {
213
+ var s = this.matched.substr(0, this.matched.length - this.match.length);
214
+ return (s.length > 20 ? "..." : "") + s.substr(-20).replace(/\n/g, "");
215
+ }, "pastInput"),
216
+ // displays upcoming input, i.e. for error messages
217
+ upcomingInput: /* @__PURE__ */ c(function() {
218
+ var s = this.match;
219
+ return s.length < 20 && (s += this._input.substr(0, 20 - s.length)), (s.substr(0, 20) + (s.length > 20 ? "..." : "")).replace(/\n/g, "");
220
+ }, "upcomingInput"),
221
+ // displays the character position where the lexing error occurred, i.e. for error messages
222
+ showPosition: /* @__PURE__ */ c(function() {
223
+ var s = this.pastInput(), n = new Array(s.length + 1).join("-");
224
+ return s + this.upcomingInput() + `
225
+ ` + n + "^";
226
+ }, "showPosition"),
227
+ // test the lexed token: return FALSE when not a match, otherwise return token
228
+ test_match: /* @__PURE__ */ c(function(s, n) {
229
+ var a, o, u;
230
+ if (this.options.backtrack_lexer && (u = {
231
+ yylineno: this.yylineno,
232
+ yylloc: {
233
+ first_line: this.yylloc.first_line,
234
+ last_line: this.last_line,
235
+ first_column: this.yylloc.first_column,
236
+ last_column: this.yylloc.last_column
237
+ },
238
+ yytext: this.yytext,
239
+ match: this.match,
240
+ matches: this.matches,
241
+ matched: this.matched,
242
+ yyleng: this.yyleng,
243
+ offset: this.offset,
244
+ _more: this._more,
245
+ _input: this._input,
246
+ yy: this.yy,
247
+ conditionStack: this.conditionStack.slice(0),
248
+ done: this.done
249
+ }, 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 = {
250
+ first_line: this.yylloc.last_line,
251
+ last_line: this.yylineno + 1,
252
+ first_column: this.yylloc.last_column,
253
+ last_column: o ? o[o.length - 1].length - o[o.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + s[0].length
254
+ }, 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)
255
+ return a;
256
+ if (this._backtrack) {
257
+ for (var e in u)
258
+ this[e] = u[e];
259
+ return !1;
260
+ }
261
+ return !1;
262
+ }, "test_match"),
263
+ // return next match in input
264
+ next: /* @__PURE__ */ c(function() {
265
+ if (this.done)
266
+ return this.EOF;
267
+ this._input || (this.done = !0);
268
+ var s, n, a, o;
269
+ this._more || (this.yytext = "", this.match = "");
270
+ for (var u = this._currentRules(), e = 0; e < u.length; e++)
271
+ if (a = this._input.match(this.rules[u[e]]), a && (!n || a[0].length > n[0].length)) {
272
+ if (n = a, o = e, this.options.backtrack_lexer) {
273
+ if (s = this.test_match(a, u[e]), s !== !1)
274
+ return s;
275
+ if (this._backtrack) {
276
+ n = !1;
277
+ continue;
278
+ } else
279
+ return !1;
280
+ } else if (!this.options.flex)
281
+ break;
282
+ }
283
+ 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.
284
+ ` + this.showPosition(), {
285
+ text: "",
286
+ token: null,
287
+ line: this.yylineno
288
+ });
289
+ }, "next"),
290
+ // return next match that has a token
291
+ lex: /* @__PURE__ */ c(function() {
292
+ var n = this.next();
293
+ return n || this.lex();
294
+ }, "lex"),
295
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
296
+ begin: /* @__PURE__ */ c(function(n) {
297
+ this.conditionStack.push(n);
298
+ }, "begin"),
299
+ // pop the previously active lexer condition state off the condition stack
300
+ popState: /* @__PURE__ */ c(function() {
301
+ var n = this.conditionStack.length - 1;
302
+ return n > 0 ? this.conditionStack.pop() : this.conditionStack[0];
303
+ }, "popState"),
304
+ // produce the lexer rule set which is active for the currently active lexer condition state
305
+ _currentRules: /* @__PURE__ */ c(function() {
306
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
307
+ }, "_currentRules"),
308
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
309
+ topState: /* @__PURE__ */ c(function(n) {
310
+ return n = this.conditionStack.length - 1 - Math.abs(n || 0), n >= 0 ? this.conditionStack[n] : "INITIAL";
311
+ }, "topState"),
312
+ // alias for begin(condition)
313
+ pushState: /* @__PURE__ */ c(function(n) {
314
+ this.begin(n);
315
+ }, "pushState"),
316
+ // return the number of states currently on the stack
317
+ stateStackSize: /* @__PURE__ */ c(function() {
318
+ return this.conditionStack.length;
319
+ }, "stateStackSize"),
320
+ options: { "case-insensitive": !0 },
321
+ performAction: /* @__PURE__ */ c(function(n, a, o, u) {
322
+ switch (o) {
323
+ case 0:
324
+ return this.pushState("shapeData"), a.yytext = "", 24;
325
+ case 1:
326
+ return this.pushState("shapeDataStr"), 24;
327
+ case 2:
328
+ return this.popState(), 24;
329
+ case 3:
330
+ const e = /\n\s*/g;
331
+ return a.yytext = a.yytext.replace(e, "<br/>"), 24;
332
+ case 4:
333
+ return 24;
334
+ case 5:
335
+ this.popState();
336
+ break;
337
+ case 6:
338
+ return n.getLogger().trace("Found comment", a.yytext), 6;
339
+ case 7:
340
+ return 8;
341
+ case 8:
342
+ this.begin("CLASS");
343
+ break;
344
+ case 9:
345
+ return this.popState(), 17;
346
+ case 10:
347
+ this.popState();
348
+ break;
349
+ case 11:
350
+ n.getLogger().trace("Begin icon"), this.begin("ICON");
351
+ break;
352
+ case 12:
353
+ return n.getLogger().trace("SPACELINE"), 6;
354
+ case 13:
355
+ return 7;
356
+ case 14:
357
+ return 16;
358
+ case 15:
359
+ n.getLogger().trace("end icon"), this.popState();
360
+ break;
361
+ case 16:
362
+ return n.getLogger().trace("Exploding node"), this.begin("NODE"), 20;
363
+ case 17:
364
+ return n.getLogger().trace("Cloud"), this.begin("NODE"), 20;
365
+ case 18:
366
+ return n.getLogger().trace("Explosion Bang"), this.begin("NODE"), 20;
367
+ case 19:
368
+ return n.getLogger().trace("Cloud Bang"), this.begin("NODE"), 20;
369
+ case 20:
370
+ return this.begin("NODE"), 20;
371
+ case 21:
372
+ return this.begin("NODE"), 20;
373
+ case 22:
374
+ return this.begin("NODE"), 20;
375
+ case 23:
376
+ return this.begin("NODE"), 20;
377
+ case 24:
378
+ return 13;
379
+ case 25:
380
+ return 23;
381
+ case 26:
382
+ return 11;
383
+ case 27:
384
+ this.begin("NSTR2");
385
+ break;
386
+ case 28:
387
+ return "NODE_DESCR";
388
+ case 29:
389
+ this.popState();
390
+ break;
391
+ case 30:
392
+ n.getLogger().trace("Starting NSTR"), this.begin("NSTR");
393
+ break;
394
+ case 31:
395
+ return n.getLogger().trace("description:", a.yytext), "NODE_DESCR";
396
+ case 32:
397
+ this.popState();
398
+ break;
399
+ case 33:
400
+ return this.popState(), n.getLogger().trace("node end ))"), "NODE_DEND";
401
+ case 34:
402
+ return this.popState(), n.getLogger().trace("node end )"), "NODE_DEND";
403
+ case 35:
404
+ return this.popState(), n.getLogger().trace("node end ...", a.yytext), "NODE_DEND";
405
+ case 36:
406
+ return this.popState(), n.getLogger().trace("node end (("), "NODE_DEND";
407
+ case 37:
408
+ return this.popState(), n.getLogger().trace("node end (-"), "NODE_DEND";
409
+ case 38:
410
+ return this.popState(), n.getLogger().trace("node end (-"), "NODE_DEND";
411
+ case 39:
412
+ return this.popState(), n.getLogger().trace("node end (("), "NODE_DEND";
413
+ case 40:
414
+ return this.popState(), n.getLogger().trace("node end (("), "NODE_DEND";
415
+ case 41:
416
+ return n.getLogger().trace("Long description:", a.yytext), 21;
417
+ case 42:
418
+ return n.getLogger().trace("Long description:", a.yytext), 21;
419
+ }
420
+ }, "anonymous"),
421
+ 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],
422
+ 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 } }
423
+ };
424
+ return _;
425
+ }();
426
+ V.lexer = m;
427
+ function O() {
428
+ this.yy = {};
429
+ }
430
+ return c(O, "Parser"), O.prototype = V, V.Parser = O, new O();
431
+ }();
432
+ $.parser = $;
433
+ var xe = $, D = [], ne = [], ee = 0, se = {}, ve = /* @__PURE__ */ c(() => {
434
+ D = [], ne = [], ee = 0, se = {};
435
+ }, "clear"), De = /* @__PURE__ */ c((t) => {
436
+ if (D.length === 0)
437
+ return null;
438
+ const g = D[0].level;
439
+ let d = null;
440
+ for (let r = D.length - 1; r >= 0; r--)
441
+ if (D[r].level === g && !d && (d = D[r]), D[r].level < g)
442
+ throw new Error('Items without section detected, found section ("' + D[r].label + '")');
443
+ return t === (d == null ? void 0 : d.level) ? null : d;
444
+ }, "getSection"), he = /* @__PURE__ */ c(function() {
445
+ return ne;
446
+ }, "getSections"), Le = /* @__PURE__ */ c(function() {
447
+ const t = [], g = [], d = he(), r = W();
448
+ for (const p of d) {
449
+ const E = {
450
+ id: p.id,
451
+ label: G(p.label ?? "", r),
452
+ isGroup: !0,
453
+ ticket: p.ticket,
454
+ shape: "kanbanSection",
455
+ level: p.level,
456
+ look: r.look
457
+ };
458
+ g.push(E);
459
+ const f = D.filter((h) => h.parentId === p.id);
460
+ for (const h of f) {
461
+ const L = {
462
+ id: h.id,
463
+ parentId: p.id,
464
+ label: G(h.label ?? "", r),
465
+ isGroup: !1,
466
+ ticket: h == null ? void 0 : h.ticket,
467
+ priority: h == null ? void 0 : h.priority,
468
+ assigned: h == null ? void 0 : h.assigned,
469
+ icon: h == null ? void 0 : h.icon,
470
+ shape: "kanbanItem",
471
+ level: h.level,
472
+ rx: 5,
473
+ ry: 5,
474
+ cssStyles: ["text-align: left"]
475
+ };
476
+ g.push(L);
477
+ }
478
+ }
479
+ return { nodes: g, edges: t, other: {}, config: W() };
480
+ }, "getData"), Oe = /* @__PURE__ */ c((t, g, d, r, p) => {
481
+ var C, w;
482
+ const E = W();
483
+ let f = ((C = E.mindmap) == null ? void 0 : C.padding) ?? K.mindmap.padding;
484
+ switch (r) {
485
+ case y.ROUNDED_RECT:
486
+ case y.RECT:
487
+ case y.HEXAGON:
488
+ f *= 2;
489
+ }
490
+ const h = {
491
+ id: G(g, E) || "kbn" + ee++,
492
+ level: t,
493
+ label: G(d, E),
494
+ width: ((w = E.mindmap) == null ? void 0 : w.maxNodeWidth) ?? K.mindmap.maxNodeWidth,
495
+ padding: f,
496
+ isGroup: !1
497
+ };
498
+ if (p !== void 0) {
499
+ let N;
500
+ p.includes(`
501
+ `) ? N = p + `
502
+ ` : N = `{
503
+ ` + p + `
504
+ }`;
505
+ const i = ke(N, { schema: Se });
506
+ if (i.shape && (i.shape !== i.shape.toLowerCase() || i.shape.includes("_")))
507
+ throw new Error(`No such shape: ${i.shape}. Shape names should be lowercase.`);
508
+ 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);
509
+ }
510
+ const L = De(t);
511
+ L ? h.parentId = L.id || "kbn" + ee++ : ne.push(h), D.push(h);
512
+ }, "addNode"), y = {
513
+ DEFAULT: 0,
514
+ NO_BORDER: 0,
515
+ ROUNDED_RECT: 1,
516
+ RECT: 2,
517
+ CIRCLE: 3,
518
+ CLOUD: 4,
519
+ BANG: 5,
520
+ HEXAGON: 6
521
+ }, Ie = /* @__PURE__ */ c((t, g) => {
522
+ switch (te.debug("In get type", t, g), t) {
523
+ case "[":
524
+ return y.RECT;
525
+ case "(":
526
+ return g === ")" ? y.ROUNDED_RECT : y.CLOUD;
527
+ case "((":
528
+ return y.CIRCLE;
529
+ case ")":
530
+ return y.CLOUD;
531
+ case "))":
532
+ return y.BANG;
533
+ case "{{":
534
+ return y.HEXAGON;
535
+ default:
536
+ return y.DEFAULT;
537
+ }
538
+ }, "getType"), Ce = /* @__PURE__ */ c((t, g) => {
539
+ se[t] = g;
540
+ }, "setElementForId"), we = /* @__PURE__ */ c((t) => {
541
+ if (!t)
542
+ return;
543
+ const g = W(), d = D[D.length - 1];
544
+ t.icon && (d.icon = G(t.icon, g)), t.class && (d.cssClasses = G(t.class, g));
545
+ }, "decorateNode"), Ae = /* @__PURE__ */ c((t) => {
546
+ switch (t) {
547
+ case y.DEFAULT:
548
+ return "no-border";
549
+ case y.RECT:
550
+ return "rect";
551
+ case y.ROUNDED_RECT:
552
+ return "rounded-rect";
553
+ case y.CIRCLE:
554
+ return "circle";
555
+ case y.CLOUD:
556
+ return "cloud";
557
+ case y.BANG:
558
+ return "bang";
559
+ case y.HEXAGON:
560
+ return "hexgon";
561
+ default:
562
+ return "no-border";
563
+ }
564
+ }, "type2Str"), Te = /* @__PURE__ */ c(() => te, "getLogger"), Re = /* @__PURE__ */ c((t) => se[t], "getElementById"), Pe = {
565
+ clear: ve,
566
+ addNode: Oe,
567
+ getSections: he,
568
+ getData: Le,
569
+ nodeType: y,
570
+ getType: Ie,
571
+ setElementForId: Ce,
572
+ decorateNode: we,
573
+ type2Str: Ae,
574
+ getLogger: Te,
575
+ getElementById: Re
576
+ }, Ve = Pe, Be = /* @__PURE__ */ c(async (t, g, d, r) => {
577
+ var M, U, A, j, V;
578
+ te.debug(`Rendering kanban diagram
579
+ ` + t);
580
+ const E = r.db.getData(), f = W();
581
+ f.htmlLabels = !1;
582
+ const h = ye(g), L = h.append("g");
583
+ L.attr("class", "sections");
584
+ const C = h.append("g");
585
+ C.attr("class", "items");
586
+ const w = E.nodes.filter(
587
+ // TODO: TypeScript 5.5 will infer this predicate automatically
588
+ (m) => m.isGroup
589
+ );
590
+ let N = 0;
591
+ const i = 10, H = [];
592
+ let x = 25;
593
+ for (const m of w) {
594
+ const O = ((M = f == null ? void 0 : f.kanban) == null ? void 0 : M.sectionWidth) || 200;
595
+ 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;
596
+ const _ = await be(L, m);
597
+ x = Math.max(x, (U = _ == null ? void 0 : _.labelBBox) == null ? void 0 : U.height), H.push(_);
598
+ }
599
+ let P = 0;
600
+ for (const m of w) {
601
+ const O = H[P];
602
+ P = P + 1;
603
+ const _ = ((A = f == null ? void 0 : f.kanban) == null ? void 0 : A.sectionWidth) || 200, s = -_ * 3 / 2 + x;
604
+ let n = s;
605
+ const a = E.nodes.filter((e) => e.parentId === m.id);
606
+ for (const e of a) {
607
+ if (e.isGroup)
608
+ throw new Error("Groups within groups are not allowed in Kanban diagrams");
609
+ e.x = m.x, e.width = _ - 1.5 * i;
610
+ const l = (await me(C, e, { config: f })).node().getBBox();
611
+ e.y = n + l.height / 2, await _e(e), n = e.y + l.height / 2 + i / 2;
612
+ }
613
+ const o = O.cluster.select("rect"), u = Math.max(n - s + 3 * i, 50) + (x - 25);
614
+ o.attr("height", u);
615
+ }
616
+ Ee(
617
+ void 0,
618
+ h,
619
+ ((j = f.mindmap) == null ? void 0 : j.padding) ?? K.kanban.padding,
620
+ ((V = f.mindmap) == null ? void 0 : V.useMaxWidth) ?? K.kanban.useMaxWidth
621
+ );
622
+ }, "draw"), Fe = {
623
+ draw: Be
624
+ }, Ge = /* @__PURE__ */ c((t) => {
625
+ let g = "";
626
+ for (let r = 0; r < t.THEME_COLOR_LIMIT; r++)
627
+ 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);
628
+ const d = /* @__PURE__ */ c((r, p) => t.darkMode ? ce(r, p) : le(r, p), "adjuster");
629
+ for (let r = 0; r < t.THEME_COLOR_LIMIT; r++) {
630
+ const p = "" + (17 - 3 * r);
631
+ g += `
632
+ .section-${r - 1} rect, .section-${r - 1} path, .section-${r - 1} circle, .section-${r - 1} polygon, .section-${r - 1} path {
633
+ fill: ${d(t["cScale" + r], 10)};
634
+ stroke: ${d(t["cScale" + r], 10)};
635
+
636
+ }
637
+ .section-${r - 1} text {
638
+ fill: ${t["cScaleLabel" + r]};
639
+ }
640
+ .node-icon-${r - 1} {
641
+ font-size: 40px;
642
+ color: ${t["cScaleLabel" + r]};
643
+ }
644
+ .section-edge-${r - 1}{
645
+ stroke: ${t["cScale" + r]};
646
+ }
647
+ .edge-depth-${r - 1}{
648
+ stroke-width: ${p};
649
+ }
650
+ .section-${r - 1} line {
651
+ stroke: ${t["cScaleInv" + r]} ;
652
+ stroke-width: 3;
653
+ }
654
+
655
+ .disabled, .disabled circle, .disabled text {
656
+ fill: lightgray;
657
+ }
658
+ .disabled text {
659
+ fill: #efefef;
660
+ }
661
+
662
+ .node rect,
663
+ .node circle,
664
+ .node ellipse,
665
+ .node polygon,
666
+ .node path {
667
+ fill: ${t.background};
668
+ stroke: ${t.nodeBorder};
669
+ stroke-width: 1px;
670
+ }
671
+
672
+ .kanban-ticket-link {
673
+ fill: ${t.background};
674
+ stroke: ${t.nodeBorder};
675
+ text-decoration: underline;
676
+ }
677
+ `;
678
+ }
679
+ return g;
680
+ }, "genSections"), He = /* @__PURE__ */ c((t) => `
681
+ .edge {
682
+ stroke-width: 3;
683
+ }
684
+ ${Ge(t)}
685
+ .section-root rect, .section-root path, .section-root circle, .section-root polygon {
686
+ fill: ${t.git0};
687
+ }
688
+ .section-root text {
689
+ fill: ${t.gitBranchLabel0};
690
+ }
691
+ .icon-container {
692
+ height:100%;
693
+ display: flex;
694
+ justify-content: center;
695
+ align-items: center;
696
+ }
697
+ .edge {
698
+ fill: none;
699
+ }
700
+ .cluster-label, .label {
701
+ color: ${t.textColor};
702
+ fill: ${t.textColor};
703
+ }
704
+ .kanban-label {
705
+ dy: 1em;
706
+ alignment-baseline: middle;
707
+ text-anchor: middle;
708
+ dominant-baseline: middle;
709
+ text-align: center;
710
+ }
711
+ ${fe()}
712
+ `, "getStyles"), Me = He, We = {
713
+ db: Ve,
714
+ renderer: Fe,
715
+ parser: xe,
716
+ styles: Me
717
+ };
718
+ export {
719
+ We as diagram
720
+ };
src/backend/gradio_dropdownplus/templates/component/katex-DfcU2jCX.js ADDED
The diff for this file is too large to render. See raw diff
 
src/backend/gradio_dropdownplus/templates/component/layout-DJFnmc1Q.js ADDED
@@ -0,0 +1,1324 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { G as g } from "./graph-cJOmixT5.js";
2
+ import { b as Te, p as ce, q as le, g as X, e as ee, l as j, o as Ie, s as Me, c as Se, u as Fe, d as f, i as m, f as _, v as x, r as M } from "./_baseUniq-CMmoTQ8t.js";
3
+ 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 z, l as T, i as Be } from "./_basePickBy-BbJ7hQvb.js";
4
+ import { b6 as Ge, b7 as Ye, b8 as De, aR as qe, b9 as $e, aV as pe, aU as we, ba as We, aQ as q, aA as Xe, aX as ze, aC as Ue, bb as $ } from "./mermaid.core-D58rAnek.js";
5
+ function He(e) {
6
+ return Ge(Ye(e, void 0, O), e + "");
7
+ }
8
+ var Je = 1, Qe = 4;
9
+ function Ze(e) {
10
+ return Te(e, Je | Qe);
11
+ }
12
+ function Ke(e, n) {
13
+ return e == null ? e : De(e, ce(n), qe);
14
+ }
15
+ function en(e, n) {
16
+ return e && le(e, ce(n));
17
+ }
18
+ function nn(e, n) {
19
+ return e > n;
20
+ }
21
+ function S(e, n) {
22
+ var r = {};
23
+ return n = X(n), le(e, function(t, a, i) {
24
+ $e(r, a, n(t, a, i));
25
+ }), r;
26
+ }
27
+ function y(e) {
28
+ return e && e.length ? he(e, pe, nn) : void 0;
29
+ }
30
+ function U(e, n) {
31
+ return e && e.length ? he(e, X(n), je) : void 0;
32
+ }
33
+ function rn(e, n) {
34
+ var r = e.length;
35
+ for (e.sort(n); r--; )
36
+ e[r] = e[r].value;
37
+ return e;
38
+ }
39
+ function tn(e, n) {
40
+ if (e !== n) {
41
+ 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);
42
+ if (!u && !s && !i && e > n || i && o && d && !u && !s || t && o && d || !r && d || !a)
43
+ return 1;
44
+ if (!t && !i && !s && e < n || s && r && a && !t && !i || u && r && a || !o && a || !d)
45
+ return -1;
46
+ }
47
+ return 0;
48
+ }
49
+ function an(e, n, r) {
50
+ for (var t = -1, a = e.criteria, i = n.criteria, o = a.length, u = r.length; ++t < o; ) {
51
+ var d = tn(a[t], i[t]);
52
+ if (d) {
53
+ if (t >= u)
54
+ return d;
55
+ var s = r[t];
56
+ return d * (s == "desc" ? -1 : 1);
57
+ }
58
+ }
59
+ return e.index - n.index;
60
+ }
61
+ function on(e, n, r) {
62
+ n.length ? n = j(n, function(i) {
63
+ return we(i) ? function(o) {
64
+ return Ie(o, i.length === 1 ? i[0] : i);
65
+ } : i;
66
+ }) : n = [pe];
67
+ var t = -1;
68
+ n = j(n, We(X));
69
+ var a = Ve(e, function(i, o, u) {
70
+ var d = j(n, function(s) {
71
+ return s(i);
72
+ });
73
+ return { criteria: d, index: ++t, value: i };
74
+ });
75
+ return rn(a, function(i, o) {
76
+ return an(i, o, r);
77
+ });
78
+ }
79
+ function un(e, n) {
80
+ return Ae(e, n, function(r, t) {
81
+ return Me(e, t);
82
+ });
83
+ }
84
+ var I = He(function(e, n) {
85
+ return e == null ? {} : un(e, n);
86
+ }), dn = Math.ceil, sn = Math.max;
87
+ function fn(e, n, r, t) {
88
+ for (var a = -1, i = sn(dn((n - e) / (r || 1)), 0), o = Array(i); i--; )
89
+ o[++a] = e, e += r;
90
+ return o;
91
+ }
92
+ function cn(e) {
93
+ return function(n, r, t) {
94
+ 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);
95
+ };
96
+ }
97
+ var E = cn(), R = Xe(function(e, n) {
98
+ if (e == null)
99
+ return [];
100
+ var r = n.length;
101
+ 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), []);
102
+ }), ln = 0;
103
+ function H(e) {
104
+ var n = ++ln;
105
+ return Fe(e) + n;
106
+ }
107
+ function hn(e, n, r) {
108
+ for (var t = -1, a = e.length, i = n.length, o = {}; ++t < a; ) {
109
+ var u = t < i ? n[t] : void 0;
110
+ r(o, e[t], u);
111
+ }
112
+ return o;
113
+ }
114
+ function vn(e, n) {
115
+ return hn(e || [], n || [], ze);
116
+ }
117
+ class pn {
118
+ constructor() {
119
+ var n = {};
120
+ n._next = n._prev = n, this._sentinel = n;
121
+ }
122
+ dequeue() {
123
+ var n = this._sentinel, r = n._prev;
124
+ if (r !== n)
125
+ return ne(r), r;
126
+ }
127
+ enqueue(n) {
128
+ var r = this._sentinel;
129
+ n._prev && n._next && ne(n), n._next = r._next, r._next._prev = n, r._next = n, n._prev = r;
130
+ }
131
+ toString() {
132
+ for (var n = [], r = this._sentinel, t = r._prev; t !== r; )
133
+ n.push(JSON.stringify(t, wn)), t = t._prev;
134
+ return "[" + n.join(", ") + "]";
135
+ }
136
+ }
137
+ function ne(e) {
138
+ e._prev._next = e._next, e._next._prev = e._prev, delete e._next, delete e._prev;
139
+ }
140
+ function wn(e, n) {
141
+ if (e !== "_next" && e !== "_prev")
142
+ return n;
143
+ }
144
+ var bn = Ue(1);
145
+ function mn(e, n) {
146
+ if (e.nodeCount() <= 1)
147
+ return [];
148
+ var r = yn(e, n || bn), t = gn(r.graph, r.buckets, r.zeroIdx);
149
+ return O(
150
+ w(t, function(a) {
151
+ return e.outEdges(a.v, a.w);
152
+ })
153
+ );
154
+ }
155
+ function gn(e, n, r) {
156
+ for (var t = [], a = n[n.length - 1], i = n[0], o; e.nodeCount(); ) {
157
+ for (; o = i.dequeue(); )
158
+ A(e, n, r, o);
159
+ for (; o = a.dequeue(); )
160
+ A(e, n, r, o);
161
+ if (e.nodeCount()) {
162
+ for (var u = n.length - 2; u > 0; --u)
163
+ if (o = n[u].dequeue(), o) {
164
+ t = t.concat(A(e, n, r, o, !0));
165
+ break;
166
+ }
167
+ }
168
+ }
169
+ return t;
170
+ }
171
+ function A(e, n, r, t, a) {
172
+ var i = a ? [] : void 0;
173
+ return f(e.inEdges(t.v), function(o) {
174
+ var u = e.edge(o), d = e.node(o.v);
175
+ a && i.push({ v: o.v, w: o.w }), d.out -= u, W(n, r, d);
176
+ }), f(e.outEdges(t.v), function(o) {
177
+ var u = e.edge(o), d = o.w, s = e.node(d);
178
+ s.in -= u, W(n, r, s);
179
+ }), e.removeNode(t.v), i;
180
+ }
181
+ function yn(e, n) {
182
+ var r = new g(), t = 0, a = 0;
183
+ f(e.nodes(), function(u) {
184
+ r.setNode(u, { v: u, in: 0, out: 0 });
185
+ }), f(e.edges(), function(u) {
186
+ var d = r.edge(u.v, u.w) || 0, s = n(u), c = d + s;
187
+ 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);
188
+ });
189
+ var i = E(a + t + 3).map(function() {
190
+ return new pn();
191
+ }), o = t + 1;
192
+ return f(r.nodes(), function(u) {
193
+ W(i, o, r.node(u));
194
+ }), { graph: r, buckets: i, zeroIdx: o };
195
+ }
196
+ function W(e, n, r) {
197
+ r.out ? r.in ? e[r.out - r.in + n].enqueue(r) : e[e.length - 1].enqueue(r) : e[0].enqueue(r);
198
+ }
199
+ function kn(e) {
200
+ var n = e.graph().acyclicer === "greedy" ? mn(e, r(e)) : xn(e);
201
+ f(n, function(t) {
202
+ var a = e.edge(t);
203
+ e.removeEdge(t), a.forwardName = t.name, a.reversed = !0, e.setEdge(t.w, t.v, a, H("rev"));
204
+ });
205
+ function r(t) {
206
+ return function(a) {
207
+ return t.edge(a).weight;
208
+ };
209
+ }
210
+ }
211
+ function xn(e) {
212
+ var n = [], r = {}, t = {};
213
+ function a(i) {
214
+ Object.prototype.hasOwnProperty.call(t, i) || (t[i] = !0, r[i] = !0, f(e.outEdges(i), function(o) {
215
+ Object.prototype.hasOwnProperty.call(r, o.w) ? n.push(o) : a(o.w);
216
+ }), delete r[i]);
217
+ }
218
+ return f(e.nodes(), a), n;
219
+ }
220
+ function En(e) {
221
+ f(e.edges(), function(n) {
222
+ var r = e.edge(n);
223
+ if (r.reversed) {
224
+ e.removeEdge(n);
225
+ var t = r.forwardName;
226
+ delete r.reversed, delete r.forwardName, e.setEdge(n.w, n.v, r, t);
227
+ }
228
+ });
229
+ }
230
+ function L(e, n, r, t) {
231
+ var a;
232
+ do
233
+ a = H(t);
234
+ while (e.hasNode(a));
235
+ return r.dummy = n, e.setNode(a, r), a;
236
+ }
237
+ function On(e) {
238
+ var n = new g().setGraph(e.graph());
239
+ return f(e.nodes(), function(r) {
240
+ n.setNode(r, e.node(r));
241
+ }), f(e.edges(), function(r) {
242
+ var t = n.edge(r.v, r.w) || { weight: 0, minlen: 1 }, a = e.edge(r);
243
+ n.setEdge(r.v, r.w, {
244
+ weight: t.weight + a.weight,
245
+ minlen: Math.max(t.minlen, a.minlen)
246
+ });
247
+ }), n;
248
+ }
249
+ function be(e) {
250
+ var n = new g({ multigraph: e.isMultigraph() }).setGraph(e.graph());
251
+ return f(e.nodes(), function(r) {
252
+ e.children(r).length || n.setNode(r, e.node(r));
253
+ }), f(e.edges(), function(r) {
254
+ n.setEdge(r, e.edge(r));
255
+ }), n;
256
+ }
257
+ function re(e, n) {
258
+ var r = e.x, t = e.y, a = n.x - r, i = n.y - t, o = e.width / 2, u = e.height / 2;
259
+ if (!a && !i)
260
+ throw new Error("Not possible to find intersection inside of the rectangle");
261
+ var d, s;
262
+ 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 };
263
+ }
264
+ function F(e) {
265
+ var n = w(E(me(e) + 1), function() {
266
+ return [];
267
+ });
268
+ return f(e.nodes(), function(r) {
269
+ var t = e.node(r), a = t.rank;
270
+ m(a) || (n[a][t.order] = r);
271
+ }), n;
272
+ }
273
+ function Ln(e) {
274
+ var n = P(
275
+ w(e.nodes(), function(r) {
276
+ return e.node(r).rank;
277
+ })
278
+ );
279
+ f(e.nodes(), function(r) {
280
+ var t = e.node(r);
281
+ ve(t, "rank") && (t.rank -= n);
282
+ });
283
+ }
284
+ function Nn(e) {
285
+ var n = P(
286
+ w(e.nodes(), function(i) {
287
+ return e.node(i).rank;
288
+ })
289
+ ), r = [];
290
+ f(e.nodes(), function(i) {
291
+ var o = e.node(i).rank - n;
292
+ r[o] || (r[o] = []), r[o].push(i);
293
+ });
294
+ var t = 0, a = e.graph().nodeRankFactor;
295
+ f(r, function(i, o) {
296
+ m(i) && o % a !== 0 ? --t : t && f(i, function(u) {
297
+ e.node(u).rank += t;
298
+ });
299
+ });
300
+ }
301
+ function te(e, n, r, t) {
302
+ var a = {
303
+ width: 0,
304
+ height: 0
305
+ };
306
+ return arguments.length >= 4 && (a.rank = r, a.order = t), L(e, "border", a, n);
307
+ }
308
+ function me(e) {
309
+ return y(
310
+ w(e.nodes(), function(n) {
311
+ var r = e.node(n).rank;
312
+ if (!m(r))
313
+ return r;
314
+ })
315
+ );
316
+ }
317
+ function Pn(e, n) {
318
+ var r = { lhs: [], rhs: [] };
319
+ return f(e, function(t) {
320
+ n(t) ? r.lhs.push(t) : r.rhs.push(t);
321
+ }), r;
322
+ }
323
+ function Cn(e, n) {
324
+ return n();
325
+ }
326
+ function _n(e) {
327
+ function n(r) {
328
+ var t = e.children(r), a = e.node(r);
329
+ if (t.length && f(t, n), Object.prototype.hasOwnProperty.call(a, "minRank")) {
330
+ a.borderLeft = [], a.borderRight = [];
331
+ for (var i = a.minRank, o = a.maxRank + 1; i < o; ++i)
332
+ ae(e, "borderLeft", "_bl", r, a, i), ae(e, "borderRight", "_br", r, a, i);
333
+ }
334
+ }
335
+ f(e.children(), n);
336
+ }
337
+ function ae(e, n, r, t, a, i) {
338
+ var o = { width: 0, height: 0, rank: i, borderType: n }, u = a[n][i - 1], d = L(e, "border", o, r);
339
+ a[n][i] = d, e.setParent(d, t), u && e.setEdge(u, d, { weight: 1 });
340
+ }
341
+ function Rn(e) {
342
+ var n = e.graph().rankdir.toLowerCase();
343
+ (n === "lr" || n === "rl") && ge(e);
344
+ }
345
+ function Tn(e) {
346
+ var n = e.graph().rankdir.toLowerCase();
347
+ (n === "bt" || n === "rl") && In(e), (n === "lr" || n === "rl") && (Mn(e), ge(e));
348
+ }
349
+ function ge(e) {
350
+ f(e.nodes(), function(n) {
351
+ ie(e.node(n));
352
+ }), f(e.edges(), function(n) {
353
+ ie(e.edge(n));
354
+ });
355
+ }
356
+ function ie(e) {
357
+ var n = e.width;
358
+ e.width = e.height, e.height = n;
359
+ }
360
+ function In(e) {
361
+ f(e.nodes(), function(n) {
362
+ B(e.node(n));
363
+ }), f(e.edges(), function(n) {
364
+ var r = e.edge(n);
365
+ f(r.points, B), Object.prototype.hasOwnProperty.call(r, "y") && B(r);
366
+ });
367
+ }
368
+ function B(e) {
369
+ e.y = -e.y;
370
+ }
371
+ function Mn(e) {
372
+ f(e.nodes(), function(n) {
373
+ G(e.node(n));
374
+ }), f(e.edges(), function(n) {
375
+ var r = e.edge(n);
376
+ f(r.points, G), Object.prototype.hasOwnProperty.call(r, "x") && G(r);
377
+ });
378
+ }
379
+ function G(e) {
380
+ var n = e.x;
381
+ e.x = e.y, e.y = n;
382
+ }
383
+ function Sn(e) {
384
+ e.graph().dummyChains = [], f(e.edges(), function(n) {
385
+ Fn(e, n);
386
+ });
387
+ }
388
+ function Fn(e, n) {
389
+ 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;
390
+ if (i !== t + 1) {
391
+ e.removeEdge(n);
392
+ var s = void 0, c, l;
393
+ for (l = 0, ++t; t < i; ++l, ++t)
394
+ u.points = [], s = {
395
+ width: 0,
396
+ height: 0,
397
+ edgeLabel: u,
398
+ edgeObj: n,
399
+ rank: t
400
+ }, 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;
401
+ e.setEdge(r, a, { weight: u.weight }, o);
402
+ }
403
+ }
404
+ function jn(e) {
405
+ f(e.graph().dummyChains, function(n) {
406
+ var r = e.node(n), t = r.edgeLabel, a;
407
+ for (e.setEdge(r.edgeObj, t); r.dummy; )
408
+ 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);
409
+ });
410
+ }
411
+ function J(e) {
412
+ var n = {};
413
+ function r(t) {
414
+ var a = e.node(t);
415
+ if (Object.prototype.hasOwnProperty.call(n, t))
416
+ return a.rank;
417
+ n[t] = !0;
418
+ var i = P(
419
+ w(e.outEdges(t), function(o) {
420
+ return r(o.w) - e.edge(o).minlen;
421
+ })
422
+ );
423
+ return (i === Number.POSITIVE_INFINITY || // return value of _.map([]) for Lodash 3
424
+ i === void 0 || // return value of _.map([]) for Lodash 4
425
+ i === null) && (i = 0), a.rank = i;
426
+ }
427
+ f(e.sources(), r);
428
+ }
429
+ function C(e, n) {
430
+ return e.node(n.w).rank - e.node(n.v).rank - e.edge(n).minlen;
431
+ }
432
+ function ye(e) {
433
+ var n = new g({ directed: !1 }), r = e.nodes()[0], t = e.nodeCount();
434
+ n.setNode(r, {});
435
+ for (var a, i; Vn(n, e) < t; )
436
+ a = An(n, e), i = n.hasNode(a.v) ? C(e, a) : -C(e, a), Bn(n, e, i);
437
+ return n;
438
+ }
439
+ function Vn(e, n) {
440
+ function r(t) {
441
+ f(n.nodeEdges(t), function(a) {
442
+ var i = a.v, o = t === i ? a.w : i;
443
+ !e.hasNode(o) && !C(n, a) && (e.setNode(o, {}), e.setEdge(t, o, {}), r(o));
444
+ });
445
+ }
446
+ return f(e.nodes(), r), e.nodeCount();
447
+ }
448
+ function An(e, n) {
449
+ return U(n.edges(), function(r) {
450
+ if (e.hasNode(r.v) !== e.hasNode(r.w))
451
+ return C(n, r);
452
+ });
453
+ }
454
+ function Bn(e, n, r) {
455
+ f(e.nodes(), function(t) {
456
+ n.node(t).rank += r;
457
+ });
458
+ }
459
+ function Gn() {
460
+ }
461
+ Gn.prototype = new Error();
462
+ function ke(e, n, r) {
463
+ we(n) || (n = [n]);
464
+ var t = (e.isDirected() ? e.successors : e.neighbors).bind(e), a = [], i = {};
465
+ return f(n, function(o) {
466
+ if (!e.hasNode(o))
467
+ throw new Error("Graph does not have node: " + o);
468
+ xe(e, o, r === "post", i, t, a);
469
+ }), a;
470
+ }
471
+ function xe(e, n, r, t, a, i) {
472
+ Object.prototype.hasOwnProperty.call(t, n) || (t[n] = !0, r || i.push(n), f(a(n), function(o) {
473
+ xe(e, o, r, t, a, i);
474
+ }), r && i.push(n));
475
+ }
476
+ function Yn(e, n) {
477
+ return ke(e, n, "post");
478
+ }
479
+ function Dn(e, n) {
480
+ return ke(e, n, "pre");
481
+ }
482
+ k.initLowLimValues = Z;
483
+ k.initCutValues = Q;
484
+ k.calcCutValue = Ee;
485
+ k.leaveEdge = Le;
486
+ k.enterEdge = Ne;
487
+ k.exchangeEdges = Pe;
488
+ function k(e) {
489
+ e = On(e), J(e);
490
+ var n = ye(e);
491
+ Z(n), Q(n, e);
492
+ for (var r, t; r = Le(n); )
493
+ t = Ne(n, e, r), Pe(n, e, r, t);
494
+ }
495
+ function Q(e, n) {
496
+ var r = Yn(e, e.nodes());
497
+ r = r.slice(0, r.length - 1), f(r, function(t) {
498
+ qn(e, n, t);
499
+ });
500
+ }
501
+ function qn(e, n, r) {
502
+ var t = e.node(r), a = t.parent;
503
+ e.edge(r, a).cutvalue = Ee(e, n, r);
504
+ }
505
+ function Ee(e, n, r) {
506
+ var t = e.node(r), a = t.parent, i = !0, o = n.edge(r, a), u = 0;
507
+ return o || (i = !1, o = n.edge(a, r)), u = o.weight, f(n.nodeEdges(r), function(d) {
508
+ var s = d.v === r, c = s ? d.w : d.v;
509
+ if (c !== a) {
510
+ var l = s === i, h = n.edge(d).weight;
511
+ if (u += l ? h : -h, Wn(e, r, c)) {
512
+ var v = e.edge(r, c).cutvalue;
513
+ u += l ? -v : v;
514
+ }
515
+ }
516
+ }), u;
517
+ }
518
+ function Z(e, n) {
519
+ arguments.length < 2 && (n = e.nodes()[0]), Oe(e, {}, 1, n);
520
+ }
521
+ function Oe(e, n, r, t, a) {
522
+ var i = r, o = e.node(t);
523
+ return n[t] = !0, f(e.neighbors(t), function(u) {
524
+ Object.prototype.hasOwnProperty.call(n, u) || (r = Oe(e, n, r, u, t));
525
+ }), o.low = i, o.lim = r++, a ? o.parent = a : delete o.parent, r;
526
+ }
527
+ function Le(e) {
528
+ return z(e.edges(), function(n) {
529
+ return e.edge(n).cutvalue < 0;
530
+ });
531
+ }
532
+ function Ne(e, n, r) {
533
+ var t = r.v, a = r.w;
534
+ n.hasEdge(t, a) || (t = r.w, a = r.v);
535
+ var i = e.node(t), o = e.node(a), u = i, d = !1;
536
+ i.lim > o.lim && (u = o, d = !0);
537
+ var s = _(n.edges(), function(c) {
538
+ return d === oe(e, e.node(c.v), u) && d !== oe(e, e.node(c.w), u);
539
+ });
540
+ return U(s, function(c) {
541
+ return C(n, c);
542
+ });
543
+ }
544
+ function Pe(e, n, r, t) {
545
+ var a = r.v, i = r.w;
546
+ e.removeEdge(a, i), e.setEdge(t.v, t.w, {}), Z(e), Q(e, n), $n(e, n);
547
+ }
548
+ function $n(e, n) {
549
+ var r = z(e.nodes(), function(a) {
550
+ return !n.node(a).parent;
551
+ }), t = Dn(e, r);
552
+ t = t.slice(1), f(t, function(a) {
553
+ var i = e.node(a).parent, o = n.edge(a, i), u = !1;
554
+ o || (o = n.edge(i, a), u = !0), n.node(a).rank = n.node(i).rank + (u ? o.minlen : -o.minlen);
555
+ });
556
+ }
557
+ function Wn(e, n, r) {
558
+ return e.hasEdge(n, r);
559
+ }
560
+ function oe(e, n, r) {
561
+ return r.low <= n.lim && n.lim <= r.lim;
562
+ }
563
+ function Xn(e) {
564
+ switch (e.graph().ranker) {
565
+ case "network-simplex":
566
+ ue(e);
567
+ break;
568
+ case "tight-tree":
569
+ Un(e);
570
+ break;
571
+ case "longest-path":
572
+ zn(e);
573
+ break;
574
+ default:
575
+ ue(e);
576
+ }
577
+ }
578
+ var zn = J;
579
+ function Un(e) {
580
+ J(e), ye(e);
581
+ }
582
+ function ue(e) {
583
+ k(e);
584
+ }
585
+ function Hn(e) {
586
+ var n = L(e, "root", {}, "_root"), r = Jn(e), t = y(x(r)) - 1, a = 2 * t + 1;
587
+ e.graph().nestingRoot = n, f(e.edges(), function(o) {
588
+ e.edge(o).minlen *= a;
589
+ });
590
+ var i = Qn(e) + 1;
591
+ f(e.children(), function(o) {
592
+ Ce(e, n, a, i, t, r, o);
593
+ }), e.graph().nodeRankFactor = a;
594
+ }
595
+ function Ce(e, n, r, t, a, i, o) {
596
+ var u = e.children(o);
597
+ if (!u.length) {
598
+ o !== n && e.setEdge(n, o, { weight: 0, minlen: r });
599
+ return;
600
+ }
601
+ var d = te(e, "_bt"), s = te(e, "_bb"), c = e.node(o);
602
+ e.setParent(d, o), c.borderTop = d, e.setParent(s, o), c.borderBottom = s, f(u, function(l) {
603
+ Ce(e, n, r, t, a, i, l);
604
+ 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;
605
+ e.setEdge(d, v, {
606
+ weight: b,
607
+ minlen: N,
608
+ nestingEdge: !0
609
+ }), e.setEdge(p, s, {
610
+ weight: b,
611
+ minlen: N,
612
+ nestingEdge: !0
613
+ });
614
+ }), e.parent(o) || e.setEdge(n, d, { weight: 0, minlen: a + i[o] });
615
+ }
616
+ function Jn(e) {
617
+ var n = {};
618
+ function r(t, a) {
619
+ var i = e.children(t);
620
+ i && i.length && f(i, function(o) {
621
+ r(o, a + 1);
622
+ }), n[t] = a;
623
+ }
624
+ return f(e.children(), function(t) {
625
+ r(t, 1);
626
+ }), n;
627
+ }
628
+ function Qn(e) {
629
+ return M(
630
+ e.edges(),
631
+ function(n, r) {
632
+ return n + e.edge(r).weight;
633
+ },
634
+ 0
635
+ );
636
+ }
637
+ function Zn(e) {
638
+ var n = e.graph();
639
+ e.removeNode(n.nestingRoot), delete n.nestingRoot, f(e.edges(), function(r) {
640
+ var t = e.edge(r);
641
+ t.nestingEdge && e.removeEdge(r);
642
+ });
643
+ }
644
+ function Kn(e, n, r) {
645
+ var t = {}, a;
646
+ f(r, function(i) {
647
+ for (var o = e.parent(i), u, d; o; ) {
648
+ if (u = e.parent(o), u ? (d = t[u], t[u] = o) : (d = a, a = o), d && d !== o) {
649
+ n.setEdge(d, o);
650
+ return;
651
+ }
652
+ o = u;
653
+ }
654
+ });
655
+ }
656
+ function er(e, n, r) {
657
+ var t = nr(e), a = new g({ compound: !0 }).setGraph({ root: t }).setDefaultNodeLabel(function(i) {
658
+ return e.node(i);
659
+ });
660
+ return f(e.nodes(), function(i) {
661
+ var o = e.node(i), u = e.parent(i);
662
+ (o.rank === n || o.minRank <= n && n <= o.maxRank) && (a.setNode(i), a.setParent(i, u || t), f(e[r](i), function(d) {
663
+ var s = d.v === i ? d.w : d.v, c = a.edge(s, i), l = m(c) ? 0 : c.weight;
664
+ a.setEdge(s, i, { weight: e.edge(d).weight + l });
665
+ }), Object.prototype.hasOwnProperty.call(o, "minRank") && a.setNode(i, {
666
+ borderLeft: o.borderLeft[n],
667
+ borderRight: o.borderRight[n]
668
+ }));
669
+ }), a;
670
+ }
671
+ function nr(e) {
672
+ for (var n; e.hasNode(n = H("_root")); ) ;
673
+ return n;
674
+ }
675
+ function rr(e, n) {
676
+ for (var r = 0, t = 1; t < n.length; ++t)
677
+ r += tr(e, n[t - 1], n[t]);
678
+ return r;
679
+ }
680
+ function tr(e, n, r) {
681
+ for (var t = vn(
682
+ r,
683
+ w(r, function(s, c) {
684
+ return c;
685
+ })
686
+ ), a = O(
687
+ w(n, function(s) {
688
+ return R(
689
+ w(e.outEdges(s), function(c) {
690
+ return { pos: t[c.w], weight: e.edge(c).weight };
691
+ }),
692
+ "pos"
693
+ );
694
+ })
695
+ ), i = 1; i < r.length; ) i <<= 1;
696
+ var o = 2 * i - 1;
697
+ i -= 1;
698
+ var u = w(new Array(o), function() {
699
+ return 0;
700
+ }), d = 0;
701
+ return f(
702
+ // @ts-expect-error
703
+ a.forEach(function(s) {
704
+ var c = s.pos + i;
705
+ u[c] += s.weight;
706
+ for (var l = 0; c > 0; )
707
+ c % 2 && (l += u[c + 1]), c = c - 1 >> 1, u[c] += s.weight;
708
+ d += s.weight * l;
709
+ })
710
+ ), d;
711
+ }
712
+ function ar(e) {
713
+ var n = {}, r = _(e.nodes(), function(u) {
714
+ return !e.children(u).length;
715
+ }), t = y(
716
+ w(r, function(u) {
717
+ return e.node(u).rank;
718
+ })
719
+ ), a = w(E(t + 1), function() {
720
+ return [];
721
+ });
722
+ function i(u) {
723
+ if (!ve(n, u)) {
724
+ n[u] = !0;
725
+ var d = e.node(u);
726
+ a[d.rank].push(u), f(e.successors(u), i);
727
+ }
728
+ }
729
+ var o = R(r, function(u) {
730
+ return e.node(u).rank;
731
+ });
732
+ return f(o, i), a;
733
+ }
734
+ function ir(e, n) {
735
+ return w(n, function(r) {
736
+ var t = e.inEdges(r);
737
+ if (t.length) {
738
+ var a = M(
739
+ t,
740
+ function(i, o) {
741
+ var u = e.edge(o), d = e.node(o.v);
742
+ return {
743
+ sum: i.sum + u.weight * d.order,
744
+ weight: i.weight + u.weight
745
+ };
746
+ },
747
+ { sum: 0, weight: 0 }
748
+ );
749
+ return {
750
+ v: r,
751
+ barycenter: a.sum / a.weight,
752
+ weight: a.weight
753
+ };
754
+ } else
755
+ return { v: r };
756
+ });
757
+ }
758
+ function or(e, n) {
759
+ var r = {};
760
+ f(e, function(a, i) {
761
+ var o = r[a.v] = {
762
+ indegree: 0,
763
+ in: [],
764
+ out: [],
765
+ vs: [a.v],
766
+ i
767
+ };
768
+ m(a.barycenter) || (o.barycenter = a.barycenter, o.weight = a.weight);
769
+ }), f(n.edges(), function(a) {
770
+ var i = r[a.v], o = r[a.w];
771
+ !m(i) && !m(o) && (o.indegree++, i.out.push(r[a.w]));
772
+ });
773
+ var t = _(r, function(a) {
774
+ return !a.indegree;
775
+ });
776
+ return ur(t);
777
+ }
778
+ function ur(e) {
779
+ var n = [];
780
+ function r(i) {
781
+ return function(o) {
782
+ o.merged || (m(o.barycenter) || m(i.barycenter) || o.barycenter >= i.barycenter) && dr(i, o);
783
+ };
784
+ }
785
+ function t(i) {
786
+ return function(o) {
787
+ o.in.push(i), --o.indegree === 0 && e.push(o);
788
+ };
789
+ }
790
+ for (; e.length; ) {
791
+ var a = e.pop();
792
+ n.push(a), f(a.in.reverse(), r(a)), f(a.out, t(a));
793
+ }
794
+ return w(
795
+ _(n, function(i) {
796
+ return !i.merged;
797
+ }),
798
+ function(i) {
799
+ return I(i, ["vs", "i", "barycenter", "weight"]);
800
+ }
801
+ );
802
+ }
803
+ function dr(e, n) {
804
+ var r = 0, t = 0;
805
+ 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;
806
+ }
807
+ function sr(e, n) {
808
+ var r = Pn(e, function(c) {
809
+ return Object.prototype.hasOwnProperty.call(c, "barycenter");
810
+ }), t = r.lhs, a = R(r.rhs, function(c) {
811
+ return -c.i;
812
+ }), i = [], o = 0, u = 0, d = 0;
813
+ t.sort(fr(!!n)), d = de(i, a, d), f(t, function(c) {
814
+ d += c.vs.length, i.push(c.vs), o += c.barycenter * c.weight, u += c.weight, d = de(i, a, d);
815
+ });
816
+ var s = { vs: O(i) };
817
+ return u && (s.barycenter = o / u, s.weight = u), s;
818
+ }
819
+ function de(e, n, r) {
820
+ for (var t; n.length && (t = T(n)).i <= r; )
821
+ n.pop(), e.push(t.vs), r++;
822
+ return r;
823
+ }
824
+ function fr(e) {
825
+ return function(n, r) {
826
+ return n.barycenter < r.barycenter ? -1 : n.barycenter > r.barycenter ? 1 : e ? r.i - n.i : n.i - r.i;
827
+ };
828
+ }
829
+ function _e(e, n, r, t) {
830
+ var a = e.children(n), i = e.node(n), o = i ? i.borderLeft : void 0, u = i ? i.borderRight : void 0, d = {};
831
+ o && (a = _(a, function(p) {
832
+ return p !== o && p !== u;
833
+ }));
834
+ var s = ir(e, a);
835
+ f(s, function(p) {
836
+ if (e.children(p.v).length) {
837
+ var b = _e(e, p.v, r, t);
838
+ d[p.v] = b, Object.prototype.hasOwnProperty.call(b, "barycenter") && lr(p, b);
839
+ }
840
+ });
841
+ var c = or(s, r);
842
+ cr(c, d);
843
+ var l = sr(c, t);
844
+ if (o && (l.vs = O([o, l.vs, u]), e.predecessors(o).length)) {
845
+ var h = e.node(e.predecessors(o)[0]), v = e.node(e.predecessors(u)[0]);
846
+ 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;
847
+ }
848
+ return l;
849
+ }
850
+ function cr(e, n) {
851
+ f(e, function(r) {
852
+ r.vs = O(
853
+ r.vs.map(function(t) {
854
+ return n[t] ? n[t].vs : t;
855
+ })
856
+ );
857
+ });
858
+ }
859
+ function lr(e, n) {
860
+ 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);
861
+ }
862
+ function hr(e) {
863
+ var n = me(e), r = se(e, E(1, n + 1), "inEdges"), t = se(e, E(n - 1, -1, -1), "outEdges"), a = ar(e);
864
+ fe(e, a);
865
+ for (var i = Number.POSITIVE_INFINITY, o, u = 0, d = 0; d < 4; ++u, ++d) {
866
+ vr(u % 2 ? r : t, u % 4 >= 2), a = F(e);
867
+ var s = rr(e, a);
868
+ s < i && (d = 0, o = Ze(a), i = s);
869
+ }
870
+ fe(e, o);
871
+ }
872
+ function se(e, n, r) {
873
+ return w(n, function(t) {
874
+ return er(e, t, r);
875
+ });
876
+ }
877
+ function vr(e, n) {
878
+ var r = new g();
879
+ f(e, function(t) {
880
+ var a = t.graph().root, i = _e(t, a, r, n);
881
+ f(i.vs, function(o, u) {
882
+ t.node(o).order = u;
883
+ }), Kn(t, r, i.vs);
884
+ });
885
+ }
886
+ function fe(e, n) {
887
+ f(n, function(r) {
888
+ f(r, function(t, a) {
889
+ e.node(t).order = a;
890
+ });
891
+ });
892
+ }
893
+ function pr(e) {
894
+ var n = br(e);
895
+ f(e.graph().dummyChains, function(r) {
896
+ 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; ) {
897
+ if (t = e.node(r), c) {
898
+ for (; (s = o[d]) !== u && e.node(s).maxRank < t.rank; )
899
+ d++;
900
+ s === u && (c = !1);
901
+ }
902
+ if (!c) {
903
+ for (; d < o.length - 1 && e.node(s = o[d + 1]).minRank <= t.rank; )
904
+ d++;
905
+ s = o[d];
906
+ }
907
+ e.setParent(r, s), r = e.successors(r)[0];
908
+ }
909
+ });
910
+ }
911
+ function wr(e, n, r, t) {
912
+ var a = [], i = [], o = Math.min(n[r].low, n[t].low), u = Math.max(n[r].lim, n[t].lim), d, s;
913
+ d = r;
914
+ do
915
+ d = e.parent(d), a.push(d);
916
+ while (d && (n[d].low > o || u > n[d].lim));
917
+ for (s = d, d = t; (d = e.parent(d)) !== s; )
918
+ i.push(d);
919
+ return { path: a.concat(i.reverse()), lca: s };
920
+ }
921
+ function br(e) {
922
+ var n = {}, r = 0;
923
+ function t(a) {
924
+ var i = r;
925
+ f(e.children(a), t), n[a] = { low: i, lim: r++ };
926
+ }
927
+ return f(e.children(), t), n;
928
+ }
929
+ function mr(e, n) {
930
+ var r = {};
931
+ function t(a, i) {
932
+ var o = 0, u = 0, d = a.length, s = T(i);
933
+ return f(i, function(c, l) {
934
+ var h = yr(e, c), v = h ? e.node(h).order : d;
935
+ (h || c === s) && (f(i.slice(u, l + 1), function(p) {
936
+ f(e.predecessors(p), function(b) {
937
+ var N = e.node(b), K = N.order;
938
+ (K < o || v < K) && !(N.dummy && e.node(p).dummy) && Re(r, b, p);
939
+ });
940
+ }), u = l + 1, o = v);
941
+ }), i;
942
+ }
943
+ return M(n, t), r;
944
+ }
945
+ function gr(e, n) {
946
+ var r = {};
947
+ function t(i, o, u, d, s) {
948
+ var c;
949
+ f(E(o, u), function(l) {
950
+ c = i[l], e.node(c).dummy && f(e.predecessors(c), function(h) {
951
+ var v = e.node(h);
952
+ v.dummy && (v.order < d || v.order > s) && Re(r, h, c);
953
+ });
954
+ });
955
+ }
956
+ function a(i, o) {
957
+ var u = -1, d, s = 0;
958
+ return f(o, function(c, l) {
959
+ if (e.node(c).dummy === "border") {
960
+ var h = e.predecessors(c);
961
+ h.length && (d = e.node(h[0]).order, t(o, s, l, u, d), s = l, u = d);
962
+ }
963
+ t(o, s, o.length, d, i.length);
964
+ }), o;
965
+ }
966
+ return M(n, a), r;
967
+ }
968
+ function yr(e, n) {
969
+ if (e.node(n).dummy)
970
+ return z(e.predecessors(n), function(r) {
971
+ return e.node(r).dummy;
972
+ });
973
+ }
974
+ function Re(e, n, r) {
975
+ if (n > r) {
976
+ var t = n;
977
+ n = r, r = t;
978
+ }
979
+ var a = e[n];
980
+ a || (e[n] = a = {}), a[r] = !0;
981
+ }
982
+ function kr(e, n, r) {
983
+ if (n > r) {
984
+ var t = n;
985
+ n = r, r = t;
986
+ }
987
+ return !!e[n] && Object.prototype.hasOwnProperty.call(e[n], r);
988
+ }
989
+ function xr(e, n, r, t) {
990
+ var a = {}, i = {}, o = {};
991
+ return f(n, function(u) {
992
+ f(u, function(d, s) {
993
+ a[d] = d, i[d] = d, o[d] = s;
994
+ });
995
+ }), f(n, function(u) {
996
+ var d = -1;
997
+ f(u, function(s) {
998
+ var c = t(s);
999
+ if (c.length) {
1000
+ c = R(c, function(b) {
1001
+ return o[b];
1002
+ });
1003
+ for (var l = (c.length - 1) / 2, h = Math.floor(l), v = Math.ceil(l); h <= v; ++h) {
1004
+ var p = c[h];
1005
+ i[s] === s && d < o[p] && !kr(r, s, p) && (i[p] = s, i[s] = a[s] = a[p], d = o[p]);
1006
+ }
1007
+ }
1008
+ });
1009
+ }), { root: a, align: i };
1010
+ }
1011
+ function Er(e, n, r, t, a) {
1012
+ var i = {}, o = Or(e, n, r, a), u = a ? "borderLeft" : "borderRight";
1013
+ function d(l, h) {
1014
+ for (var v = o.nodes(), p = v.pop(), b = {}; p; )
1015
+ b[p] ? l(p) : (b[p] = !0, v.push(p), v = v.concat(h(p))), p = v.pop();
1016
+ }
1017
+ function s(l) {
1018
+ i[l] = o.inEdges(l).reduce(function(h, v) {
1019
+ return Math.max(h, i[v.v] + o.edge(v));
1020
+ }, 0);
1021
+ }
1022
+ function c(l) {
1023
+ var h = o.outEdges(l).reduce(function(p, b) {
1024
+ return Math.min(p, i[b.w] - o.edge(b));
1025
+ }, Number.POSITIVE_INFINITY), v = e.node(l);
1026
+ h !== Number.POSITIVE_INFINITY && v.borderType !== u && (i[l] = Math.max(i[l], h));
1027
+ }
1028
+ return d(s, o.predecessors.bind(o)), d(c, o.successors.bind(o)), f(t, function(l) {
1029
+ i[l] = i[r[l]];
1030
+ }), i;
1031
+ }
1032
+ function Or(e, n, r, t) {
1033
+ var a = new g(), i = e.graph(), o = _r(i.nodesep, i.edgesep, t);
1034
+ return f(n, function(u) {
1035
+ var d;
1036
+ f(u, function(s) {
1037
+ var c = r[s];
1038
+ if (a.setNode(c), d) {
1039
+ var l = r[d], h = a.edge(l, c);
1040
+ a.setEdge(l, c, Math.max(o(e, s, d), h || 0));
1041
+ }
1042
+ d = s;
1043
+ });
1044
+ }), a;
1045
+ }
1046
+ function Lr(e, n) {
1047
+ return U(x(n), function(r) {
1048
+ var t = Number.NEGATIVE_INFINITY, a = Number.POSITIVE_INFINITY;
1049
+ return Ke(r, function(i, o) {
1050
+ var u = Rr(e, o) / 2;
1051
+ t = Math.max(i + u, t), a = Math.min(i - u, a);
1052
+ }), t - a;
1053
+ });
1054
+ }
1055
+ function Nr(e, n) {
1056
+ var r = x(n), t = P(r), a = y(r);
1057
+ f(["u", "d"], function(i) {
1058
+ f(["l", "r"], function(o) {
1059
+ var u = i + o, d = e[u], s;
1060
+ if (d !== n) {
1061
+ var c = x(d);
1062
+ s = o === "l" ? t - P(c) : a - y(c), s && (e[u] = S(d, function(l) {
1063
+ return l + s;
1064
+ }));
1065
+ }
1066
+ });
1067
+ });
1068
+ }
1069
+ function Pr(e, n) {
1070
+ return S(e.ul, function(r, t) {
1071
+ if (n)
1072
+ return e[n.toLowerCase()][t];
1073
+ var a = R(w(e, t));
1074
+ return (a[1] + a[2]) / 2;
1075
+ });
1076
+ }
1077
+ function Cr(e) {
1078
+ var n = F(e), r = $(mr(e, n), gr(e, n)), t = {}, a;
1079
+ f(["u", "d"], function(o) {
1080
+ a = o === "u" ? n : x(n).reverse(), f(["l", "r"], function(u) {
1081
+ u === "r" && (a = w(a, function(l) {
1082
+ return x(l).reverse();
1083
+ }));
1084
+ 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");
1085
+ u === "r" && (c = S(c, function(l) {
1086
+ return -l;
1087
+ })), t[o + u] = c;
1088
+ });
1089
+ });
1090
+ var i = Lr(e, t);
1091
+ return Nr(t, i), Pr(t, e.graph().align);
1092
+ }
1093
+ function _r(e, n, r) {
1094
+ return function(t, a, i) {
1095
+ var o = t.node(a), u = t.node(i), d = 0, s;
1096
+ if (d += o.width / 2, Object.prototype.hasOwnProperty.call(o, "labelpos"))
1097
+ switch (o.labelpos.toLowerCase()) {
1098
+ case "l":
1099
+ s = -o.width / 2;
1100
+ break;
1101
+ case "r":
1102
+ s = o.width / 2;
1103
+ break;
1104
+ }
1105
+ 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"))
1106
+ switch (u.labelpos.toLowerCase()) {
1107
+ case "l":
1108
+ s = u.width / 2;
1109
+ break;
1110
+ case "r":
1111
+ s = -u.width / 2;
1112
+ break;
1113
+ }
1114
+ return s && (d += r ? s : -s), s = 0, d;
1115
+ };
1116
+ }
1117
+ function Rr(e, n) {
1118
+ return e.node(n).width;
1119
+ }
1120
+ function Tr(e) {
1121
+ e = be(e), Ir(e), en(Cr(e), function(n, r) {
1122
+ e.node(r).x = n;
1123
+ });
1124
+ }
1125
+ function Ir(e) {
1126
+ var n = F(e), r = e.graph().ranksep, t = 0;
1127
+ f(n, function(a) {
1128
+ var i = y(
1129
+ w(a, function(o) {
1130
+ return e.node(o).height;
1131
+ })
1132
+ );
1133
+ f(a, function(o) {
1134
+ e.node(o).y = t + i / 2;
1135
+ }), t += i + r;
1136
+ });
1137
+ }
1138
+ function ot(e, n) {
1139
+ var r = Cn;
1140
+ r("layout", () => {
1141
+ var t = r(" buildLayoutGraph", () => qr(e));
1142
+ r(" runLayout", () => Mr(t, r)), r(" updateInputGraph", () => Sr(e, t));
1143
+ });
1144
+ }
1145
+ function Mr(e, n) {
1146
+ n(" makeSpaceForEdgeLabels", () => $r(e)), n(" removeSelfEdges", () => Kr(e)), n(" acyclic", () => kn(e)), n(" nestingGraph.run", () => Hn(e)), n(" rank", () => Xn(be(e))), n(" injectEdgeLabelProxies", () => Wr(e)), n(" removeEmptyRanks", () => Nn(e)), n(" nestingGraph.cleanup", () => Zn(e)), n(" normalizeRanks", () => Ln(e)), n(" assignRankMinMax", () => Xr(e)), n(" removeEdgeLabelProxies", () => zr(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));
1147
+ }
1148
+ function Sr(e, n) {
1149
+ f(e.nodes(), function(r) {
1150
+ var t = e.node(r), a = n.node(r);
1151
+ t && (t.x = a.x, t.y = a.y, n.children(r).length && (t.width = a.width, t.height = a.height));
1152
+ }), f(e.edges(), function(r) {
1153
+ var t = e.edge(r), a = n.edge(r);
1154
+ t.points = a.points, Object.prototype.hasOwnProperty.call(a, "x") && (t.x = a.x, t.y = a.y);
1155
+ }), e.graph().width = n.graph().width, e.graph().height = n.graph().height;
1156
+ }
1157
+ 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 = {
1158
+ minlen: 1,
1159
+ weight: 1,
1160
+ width: 0,
1161
+ height: 0,
1162
+ labeloffset: 10,
1163
+ labelpos: "r"
1164
+ }, Dr = ["labelpos"];
1165
+ function qr(e) {
1166
+ var n = new g({ multigraph: !0, compound: !0 }), r = D(e.graph());
1167
+ return n.setGraph(
1168
+ $({}, jr, Y(r, Fr), I(r, Vr))
1169
+ ), f(e.nodes(), function(t) {
1170
+ var a = D(e.node(t));
1171
+ n.setNode(t, Be(Y(a, Ar), Br)), n.setParent(t, e.parent(t));
1172
+ }), f(e.edges(), function(t) {
1173
+ var a = D(e.edge(t));
1174
+ n.setEdge(
1175
+ t,
1176
+ $({}, Yr, Y(a, Gr), I(a, Dr))
1177
+ );
1178
+ }), n;
1179
+ }
1180
+ function $r(e) {
1181
+ var n = e.graph();
1182
+ n.ranksep /= 2, f(e.edges(), function(r) {
1183
+ var t = e.edge(r);
1184
+ t.minlen *= 2, t.labelpos.toLowerCase() !== "c" && (n.rankdir === "TB" || n.rankdir === "BT" ? t.width += t.labeloffset : t.height += t.labeloffset);
1185
+ });
1186
+ }
1187
+ function Wr(e) {
1188
+ f(e.edges(), function(n) {
1189
+ var r = e.edge(n);
1190
+ if (r.width && r.height) {
1191
+ var t = e.node(n.v), a = e.node(n.w), i = { rank: (a.rank - t.rank) / 2 + t.rank, e: n };
1192
+ L(e, "edge-proxy", i, "_ep");
1193
+ }
1194
+ });
1195
+ }
1196
+ function Xr(e) {
1197
+ var n = 0;
1198
+ f(e.nodes(), function(r) {
1199
+ var t = e.node(r);
1200
+ t.borderTop && (t.minRank = e.node(t.borderTop).rank, t.maxRank = e.node(t.borderBottom).rank, n = y(n, t.maxRank));
1201
+ }), e.graph().maxRank = n;
1202
+ }
1203
+ function zr(e) {
1204
+ f(e.nodes(), function(n) {
1205
+ var r = e.node(n);
1206
+ r.dummy === "edge-proxy" && (e.edge(r.e).labelRank = r.rank, e.removeNode(n));
1207
+ });
1208
+ }
1209
+ function Ur(e) {
1210
+ var n = Number.POSITIVE_INFINITY, r = 0, t = Number.POSITIVE_INFINITY, a = 0, i = e.graph(), o = i.marginx || 0, u = i.marginy || 0;
1211
+ function d(s) {
1212
+ var c = s.x, l = s.y, h = s.width, v = s.height;
1213
+ 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);
1214
+ }
1215
+ f(e.nodes(), function(s) {
1216
+ d(e.node(s));
1217
+ }), f(e.edges(), function(s) {
1218
+ var c = e.edge(s);
1219
+ Object.prototype.hasOwnProperty.call(c, "x") && d(c);
1220
+ }), n -= o, t -= u, f(e.nodes(), function(s) {
1221
+ var c = e.node(s);
1222
+ c.x -= n, c.y -= t;
1223
+ }), f(e.edges(), function(s) {
1224
+ var c = e.edge(s);
1225
+ f(c.points, function(l) {
1226
+ l.x -= n, l.y -= t;
1227
+ }), Object.prototype.hasOwnProperty.call(c, "x") && (c.x -= n), Object.prototype.hasOwnProperty.call(c, "y") && (c.y -= t);
1228
+ }), i.width = r - n + o, i.height = a - t + u;
1229
+ }
1230
+ function Hr(e) {
1231
+ f(e.edges(), function(n) {
1232
+ var r = e.edge(n), t = e.node(n.v), a = e.node(n.w), i, o;
1233
+ 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));
1234
+ });
1235
+ }
1236
+ function Jr(e) {
1237
+ f(e.edges(), function(n) {
1238
+ var r = e.edge(n);
1239
+ if (Object.prototype.hasOwnProperty.call(r, "x"))
1240
+ switch ((r.labelpos === "l" || r.labelpos === "r") && (r.width -= r.labeloffset), r.labelpos) {
1241
+ case "l":
1242
+ r.x -= r.width / 2 + r.labeloffset;
1243
+ break;
1244
+ case "r":
1245
+ r.x += r.width / 2 + r.labeloffset;
1246
+ break;
1247
+ }
1248
+ });
1249
+ }
1250
+ function Qr(e) {
1251
+ f(e.edges(), function(n) {
1252
+ var r = e.edge(n);
1253
+ r.reversed && r.points.reverse();
1254
+ });
1255
+ }
1256
+ function Zr(e) {
1257
+ f(e.nodes(), function(n) {
1258
+ if (e.children(n).length) {
1259
+ 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));
1260
+ 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;
1261
+ }
1262
+ }), f(e.nodes(), function(n) {
1263
+ e.node(n).dummy === "border" && e.removeNode(n);
1264
+ });
1265
+ }
1266
+ function Kr(e) {
1267
+ f(e.edges(), function(n) {
1268
+ if (n.v === n.w) {
1269
+ var r = e.node(n.v);
1270
+ r.selfEdges || (r.selfEdges = []), r.selfEdges.push({ e: n, label: e.edge(n) }), e.removeEdge(n);
1271
+ }
1272
+ });
1273
+ }
1274
+ function et(e) {
1275
+ var n = F(e);
1276
+ f(n, function(r) {
1277
+ var t = 0;
1278
+ f(r, function(a, i) {
1279
+ var o = e.node(a);
1280
+ o.order = i + t, f(o.selfEdges, function(u) {
1281
+ L(
1282
+ e,
1283
+ "selfedge",
1284
+ {
1285
+ width: u.label.width,
1286
+ height: u.label.height,
1287
+ rank: o.rank,
1288
+ order: i + ++t,
1289
+ e: u.e,
1290
+ label: u.label
1291
+ },
1292
+ "_se"
1293
+ );
1294
+ }), delete o.selfEdges;
1295
+ });
1296
+ });
1297
+ }
1298
+ function nt(e) {
1299
+ f(e.nodes(), function(n) {
1300
+ var r = e.node(n);
1301
+ if (r.dummy === "selfedge") {
1302
+ var t = e.node(r.e.v), a = t.x + t.width / 2, i = t.y, o = r.x - a, u = t.height / 2;
1303
+ e.setEdge(r.e, r.label), e.removeNode(n), r.label.points = [
1304
+ { x: a + 2 * o / 3, y: i - u },
1305
+ { x: a + 5 * o / 6, y: i - u },
1306
+ { x: a + o, y: i },
1307
+ { x: a + 5 * o / 6, y: i + u },
1308
+ { x: a + 2 * o / 3, y: i + u }
1309
+ ], r.label.x = r.x, r.label.y = r.y;
1310
+ }
1311
+ });
1312
+ }
1313
+ function Y(e, n) {
1314
+ return S(I(e, n), Number);
1315
+ }
1316
+ function D(e) {
1317
+ var n = {};
1318
+ return f(e, function(r, t) {
1319
+ n[t.toLowerCase()] = r;
1320
+ }), n;
1321
+ }
1322
+ export {
1323
+ ot as l
1324
+ };