@prefecthq/prefab-ui 0.18.5 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/_baseUniq-ta6OwJqW.js +1 -0
- package/dist/app/{app-DHCIgFOe.js → app-DWWmwIek.js} +24 -24
- package/dist/app/architectureDiagram-2XIMDMQ5-BO1X9-2l.js +36 -0
- package/dist/app/{blockDiagram-WCTKOSBZ-B524maQO.js → blockDiagram-WCTKOSBZ-DTJHXSgX.js} +1 -1
- package/dist/app/{bundle-PV0B1Rg_.js → bundle-BF3CVMKo.js} +256 -9
- package/dist/app/{c4Diagram-IC4MRINW-LiBCLrwc.js → c4Diagram-IC4MRINW-CsB0rI2O.js} +1 -1
- package/dist/app/{carousel-VYrmGQGT.js → carousel-BeyGRq-O.js} +1 -1
- package/dist/app/channel-DqGM1rbw.js +1 -0
- package/dist/app/{charts-CAbb86jt.js → charts-vQRKX19o.js} +1 -1
- package/dist/app/{chunk-4BX2VUAB-Dx0YoTOp.js → chunk-4BX2VUAB-CuzpJkZk.js} +1 -1
- package/dist/app/{chunk-55IACEB6-BMKwRFGH.js → chunk-55IACEB6-CPJs1nxf.js} +1 -1
- package/dist/app/{chunk-FMBD7UC4-P9b1fgHH.js → chunk-FMBD7UC4-BsH-SQ6e.js} +1 -1
- package/dist/app/{chunk-JSJVCQXG-C9-xDx_f.js → chunk-JSJVCQXG-Dav_pqEt.js} +1 -1
- package/dist/app/{chunk-KX2RTZJC-y06NOTAw.js → chunk-KX2RTZJC-DreiEKRs.js} +1 -1
- package/dist/app/{chunk-NQ4KR5QH-u-MeLygg.js → chunk-NQ4KR5QH-h2D0g_PU.js} +1 -1
- package/dist/app/{chunk-QZHKN3VN-8B7bIcf4.js → chunk-QZHKN3VN-BLKI444a.js} +1 -1
- package/dist/app/{chunk-WL4C6EOR-cOPqvc_c.js → chunk-WL4C6EOR-chGwGATN.js} +1 -1
- package/dist/app/classDiagram-VBA2DB6C-DNgqPbFT.js +1 -0
- package/dist/app/classDiagram-v2-RAHNMMFH-DNgqPbFT.js +1 -0
- package/dist/app/clone-CHxe1GA6.js +1 -0
- package/dist/app/{compound-calendar-Ci50EeZ5.js → compound-calendar-B8qX5Zsi.js} +1 -1
- package/dist/app/{content-B9KneKdC.js → content-BhQ8q-Lu.js} +1 -1
- package/dist/app/{cose-bilkent-S5V4N54A-Dc9uKygA.js → cose-bilkent-S5V4N54A-BCdmuqoX.js} +1 -1
- package/dist/app/dagre-KLK3FWXG-DPK0mP3v.js +4 -0
- package/dist/app/diagram-E7M64L7V-CbyJJCWv.js +24 -0
- package/dist/app/diagram-IFDJBPK2-BPWtrQhI.js +43 -0
- package/dist/app/diagram-P4PSJMXO-DFNqedAw.js +24 -0
- package/dist/app/{erDiagram-INFDFZHY-DgnBfTmZ.js → erDiagram-INFDFZHY-DxkXc9lq.js} +1 -1
- package/dist/app/{flowDiagram-PKNHOUZH-BRLGgwUn.js → flowDiagram-PKNHOUZH-DCOpTmpL.js} +1 -1
- package/dist/app/{ganttDiagram-A5KZAMGK-iYM5gdvu.js → ganttDiagram-A5KZAMGK-D-OZdfLM.js} +1 -1
- package/dist/app/gitGraphDiagram-K3NZZRJ6-y1hS_Fs3.js +65 -0
- package/dist/app/graph-DuuFfizS.js +1 -0
- package/dist/app/{icons-barrel-C1Fhceou.js → icons-barrel-BsWue30w.js} +1 -1
- package/dist/app/infoDiagram-LFFYTUFH-CFSg4gxg.js +2 -0
- package/dist/app/{ishikawaDiagram-PHBUUO56-D8LCuUtc.js → ishikawaDiagram-PHBUUO56-BBnueC1U.js} +1 -1
- package/dist/app/{journeyDiagram-4ABVD52K-DPJtXOUh.js → journeyDiagram-4ABVD52K-BC2rNb-q.js} +1 -1
- package/dist/app/{kanban-definition-K7BYSVSG-DIpHQQGq.js → kanban-definition-K7BYSVSG-CY4EnSlW.js} +1 -1
- package/dist/app/layout-Bzcwrl3z.js +1 -0
- package/dist/app/{mermaid-CC_vTxSJ.js → mermaid-WcsgrQ20.js} +2 -2
- package/dist/app/{mermaid.core-D6aFEa0I.js → mermaid.core-C0_6bYX2.js} +5 -5
- package/dist/app/min-M3lbM33X.js +1 -0
- package/dist/app/{mindmap-definition-YRQLILUH-BheWB4Ui.js → mindmap-definition-YRQLILUH-BdvFQgM9.js} +1 -1
- package/dist/app/{pieDiagram-SKSYHLDU-DOrruAwd.js → pieDiagram-SKSYHLDU-DM-1JZKF.js} +2 -2
- package/dist/app/{quadrantDiagram-337W2JSQ-B8BTERHr.js → quadrantDiagram-337W2JSQ-BvwKB1au.js} +1 -1
- package/dist/app/renderer.css +1 -1
- package/dist/app/renderer.js +65 -65
- package/dist/app/{requirementDiagram-Z7DCOOCP-DnOpKcso.js → requirementDiagram-Z7DCOOCP-lW4OvRpm.js} +1 -1
- package/dist/app/{sankeyDiagram-WA2Y5GQK-CoXOdwrO.js → sankeyDiagram-WA2Y5GQK-Bij_tjGA.js} +1 -1
- package/dist/app/{sequenceDiagram-2WXFIKYE-CWNQviI4.js → sequenceDiagram-2WXFIKYE-DulfYz7n.js} +1 -1
- package/dist/app/stateDiagram-RAJIS63D-CVYHUS3C.js +1 -0
- package/dist/app/{stateDiagram-v2-FVOUBMTO-B8eU3khJ.js → stateDiagram-v2-FVOUBMTO-DdFVAz3y.js} +1 -1
- package/dist/app/{timeline-definition-YZTLITO2-CTMhdLW0.js → timeline-definition-YZTLITO2-CEvKcZCX.js} +1 -1
- package/dist/app/treemap-KZPCXAKY-yrs_ILyI.js +162 -0
- package/dist/app/{vennDiagram-LZ73GAT5-B_Dobi9s.js → vennDiagram-LZ73GAT5-CQ9AzVUS.js} +1 -1
- package/dist/app/{xychartDiagram-JWTSCODW-C5MtDZ7P.js → xychartDiagram-JWTSCODW-CPDhlJMj.js} +1 -1
- package/package.json +1 -1
- package/dist/app/_basePickBy-BVmN5HKo.js +0 -1
- package/dist/app/_baseUniq-DLSCZPvE.js +0 -1
- package/dist/app/architectureDiagram-2XIMDMQ5-2JqupSrT.js +0 -36
- package/dist/app/channel-DIEGSkkN.js +0 -1
- package/dist/app/classDiagram-VBA2DB6C-C_-qrCYz.js +0 -1
- package/dist/app/classDiagram-v2-RAHNMMFH-C_-qrCYz.js +0 -1
- package/dist/app/clone-BtAo9xZX.js +0 -1
- package/dist/app/dagre-KLK3FWXG-CuYQqi5J.js +0 -4
- package/dist/app/diagram-E7M64L7V-7lLEvUXT.js +0 -24
- package/dist/app/diagram-IFDJBPK2-DfivzPeV.js +0 -43
- package/dist/app/diagram-P4PSJMXO-9eL_NaeT.js +0 -24
- package/dist/app/gitGraphDiagram-K3NZZRJ6-BH7iD4e-.js +0 -65
- package/dist/app/graph-z0MF59mG.js +0 -1
- package/dist/app/infoDiagram-LFFYTUFH-wthc3uSb.js +0 -2
- package/dist/app/layout-Cn0Vvyqu.js +0 -1
- package/dist/app/stateDiagram-RAJIS63D-C--FinAX.js +0 -1
- package/dist/app/treemap-KZPCXAKY-H4wvUyKw.js +0 -162
|
@@ -188,6 +188,15 @@ class PrefabApp(BaseModel):
|
|
|
188
188
|
default=None,
|
|
189
189
|
description="Action(s) to execute when the app mounts",
|
|
190
190
|
)
|
|
191
|
+
key_bindings: dict[str, Any] | None = Field(
|
|
192
|
+
default=None,
|
|
193
|
+
description=(
|
|
194
|
+
"Keyboard shortcuts mapping key names to actions. "
|
|
195
|
+
"Keys are DOM KeyboardEvent.key values, optionally prefixed "
|
|
196
|
+
"with modifiers: Shift+, Ctrl+, Alt+, Meta+. "
|
|
197
|
+
"Values are actions or lists of actions."
|
|
198
|
+
),
|
|
199
|
+
)
|
|
191
200
|
|
|
192
201
|
_context_root: Any = PrivateAttr(default=None)
|
|
193
202
|
|
|
@@ -339,6 +348,26 @@ class PrefabApp(BaseModel):
|
|
|
339
348
|
else:
|
|
340
349
|
result["theme"] = self.theme.to_json()
|
|
341
350
|
|
|
351
|
+
if self.key_bindings:
|
|
352
|
+
from prefab_ui.actions import Action
|
|
353
|
+
|
|
354
|
+
serialized: dict[str, Any] = {}
|
|
355
|
+
for key, action in self.key_bindings.items():
|
|
356
|
+
if isinstance(action, list):
|
|
357
|
+
serialized[key] = [
|
|
358
|
+
a.model_dump(by_alias=True, exclude_none=True)
|
|
359
|
+
if isinstance(a, Action)
|
|
360
|
+
else a
|
|
361
|
+
for a in action
|
|
362
|
+
]
|
|
363
|
+
elif isinstance(action, Action):
|
|
364
|
+
serialized[key] = action.model_dump(
|
|
365
|
+
by_alias=True, exclude_none=True
|
|
366
|
+
)
|
|
367
|
+
else:
|
|
368
|
+
serialized[key] = action
|
|
369
|
+
result["keyBindings"] = serialized
|
|
370
|
+
|
|
342
371
|
return result
|
|
343
372
|
finally:
|
|
344
373
|
if token is not None:
|
|
@@ -1068,6 +1097,121 @@ async def execute(
|
|
|
1068
1097
|
raise ValueError(f"Code execution failed: {exc}") from exc
|
|
1069
1098
|
|
|
1070
1099
|
return PrefabApp.from_json(wire)
|
|
1100
|
+
`,"prefab_ui/shortcuts.py":`"""Keyboard shortcuts dialog helper.
|
|
1101
|
+
|
|
1102
|
+
Builds a Dialog component displaying registered keyboard shortcuts
|
|
1103
|
+
with Kbd key indicators. Pure Python composition — no renderer-side
|
|
1104
|
+
logic needed.
|
|
1105
|
+
|
|
1106
|
+
\`\`\`python
|
|
1107
|
+
from prefab_ui.shortcuts import KeyboardShortcutsDialog
|
|
1108
|
+
|
|
1109
|
+
KeyboardShortcutsDialog({
|
|
1110
|
+
"ArrowRight": "Next slide",
|
|
1111
|
+
"ArrowLeft": "Previous slide",
|
|
1112
|
+
"Shift+?": "Show shortcuts",
|
|
1113
|
+
})
|
|
1114
|
+
\`\`\`
|
|
1115
|
+
"""
|
|
1116
|
+
|
|
1117
|
+
from __future__ import annotations
|
|
1118
|
+
|
|
1119
|
+
from prefab_ui.actions import SetState
|
|
1120
|
+
from prefab_ui.components import (
|
|
1121
|
+
Column,
|
|
1122
|
+
Dialog,
|
|
1123
|
+
Kbd,
|
|
1124
|
+
Row,
|
|
1125
|
+
Text,
|
|
1126
|
+
)
|
|
1127
|
+
|
|
1128
|
+
# Map DOM key names to display symbols
|
|
1129
|
+
_KEY_SYMBOLS: dict[str, str] = {
|
|
1130
|
+
"ArrowRight": "→",
|
|
1131
|
+
"ArrowLeft": "←",
|
|
1132
|
+
"ArrowUp": "↑",
|
|
1133
|
+
"ArrowDown": "↓",
|
|
1134
|
+
"Enter": "↵",
|
|
1135
|
+
"Escape": "Esc",
|
|
1136
|
+
"Backspace": "⌫",
|
|
1137
|
+
"Delete": "Del",
|
|
1138
|
+
"Tab": "⇥",
|
|
1139
|
+
" ": "Space",
|
|
1140
|
+
"Meta": "⌘",
|
|
1141
|
+
"Control": "Ctrl",
|
|
1142
|
+
"Ctrl": "Ctrl",
|
|
1143
|
+
"Shift": "⇧",
|
|
1144
|
+
"Alt": "Alt",
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
|
|
1148
|
+
def _format_key(key: str) -> str:
|
|
1149
|
+
"""Format a key binding string for display."""
|
|
1150
|
+
parts = key.split("+")
|
|
1151
|
+
symbols = [_KEY_SYMBOLS.get(p, p) for p in parts]
|
|
1152
|
+
return " + ".join(symbols)
|
|
1153
|
+
|
|
1154
|
+
|
|
1155
|
+
def KeyboardShortcutsDialog(
|
|
1156
|
+
shortcuts: dict[str, str],
|
|
1157
|
+
*,
|
|
1158
|
+
name: str = "_show_shortcuts",
|
|
1159
|
+
title: str = "Keyboard Shortcuts",
|
|
1160
|
+
trigger_label: str = "?",
|
|
1161
|
+
trigger_variant: str = "ghost",
|
|
1162
|
+
trigger_size: str = "sm",
|
|
1163
|
+
) -> SetState:
|
|
1164
|
+
"""Build a Dialog listing keyboard shortcuts with Kbd indicators.
|
|
1165
|
+
|
|
1166
|
+
The dialog is bound to a state variable (default \`_show_shortcuts\`)
|
|
1167
|
+
so it can be opened programmatically. Returns a \`SetState\` action
|
|
1168
|
+
for use in \`key_bindings\`:
|
|
1169
|
+
|
|
1170
|
+
\`\`\`python
|
|
1171
|
+
help_action = KeyboardShortcutsDialog({
|
|
1172
|
+
"ArrowRight": "Next slide",
|
|
1173
|
+
"Shift+?": "Show shortcuts",
|
|
1174
|
+
})
|
|
1175
|
+
|
|
1176
|
+
PrefabApp(
|
|
1177
|
+
key_bindings={"Shift+?": help_action},
|
|
1178
|
+
)
|
|
1179
|
+
\`\`\`
|
|
1180
|
+
|
|
1181
|
+
No initial state setup needed — the dialog defaults to closed.
|
|
1182
|
+
|
|
1183
|
+
Args:
|
|
1184
|
+
shortcuts: Mapping of key binding strings to human-readable
|
|
1185
|
+
descriptions. Keys use the same format as \`key_bindings\`
|
|
1186
|
+
on \`PrefabApp\`.
|
|
1187
|
+
name: State key to bind the dialog open state to.
|
|
1188
|
+
title: Dialog title.
|
|
1189
|
+
trigger_label: Label for the trigger button.
|
|
1190
|
+
trigger_variant: Button variant for the trigger.
|
|
1191
|
+
trigger_size: Button size for the trigger.
|
|
1192
|
+
|
|
1193
|
+
Returns:
|
|
1194
|
+
A \`SetState\` action that opens the dialog, for use in
|
|
1195
|
+
\`key_bindings\`.
|
|
1196
|
+
"""
|
|
1197
|
+
from prefab_ui.components import Button
|
|
1198
|
+
|
|
1199
|
+
with Dialog(title=title, name=name):
|
|
1200
|
+
Button(
|
|
1201
|
+
trigger_label,
|
|
1202
|
+
variant=trigger_variant,
|
|
1203
|
+
size=trigger_size,
|
|
1204
|
+
)
|
|
1205
|
+
with Column(gap=3):
|
|
1206
|
+
for key, description in shortcuts.items():
|
|
1207
|
+
with Row(
|
|
1208
|
+
css_class="justify-between items-center",
|
|
1209
|
+
gap=4,
|
|
1210
|
+
):
|
|
1211
|
+
Text(description)
|
|
1212
|
+
Kbd(_format_key(key))
|
|
1213
|
+
|
|
1214
|
+
return SetState(name, True)
|
|
1071
1215
|
`,"prefab_ui/use.py":`"""Use — reference a defined component template.
|
|
1072
1216
|
|
|
1073
1217
|
A \`Use\` node references a \`Define\` template by
|
|
@@ -1217,6 +1361,7 @@ from prefab_ui.components.histogram import Histogram
|
|
|
1217
1361
|
from prefab_ui.components.hover_card import HoverCard
|
|
1218
1362
|
from prefab_ui.components.icon import Icon
|
|
1219
1363
|
from prefab_ui.components.image import Image
|
|
1364
|
+
from prefab_ui.components.kbd import Kbd
|
|
1220
1365
|
from prefab_ui.components.input import Input
|
|
1221
1366
|
from prefab_ui.components.label import Label
|
|
1222
1367
|
from prefab_ui.components.markdown import Markdown
|
|
@@ -1339,6 +1484,7 @@ __all__ = [
|
|
|
1339
1484
|
"If",
|
|
1340
1485
|
"Image",
|
|
1341
1486
|
"Input",
|
|
1487
|
+
"Kbd",
|
|
1342
1488
|
"Label",
|
|
1343
1489
|
"Large",
|
|
1344
1490
|
"Lead",
|
|
@@ -4444,6 +4590,21 @@ class Dialog(ContainerComponent):
|
|
|
4444
4590
|
description: RxStr | None = Field(
|
|
4445
4591
|
default=None, description="Dialog header description"
|
|
4446
4592
|
)
|
|
4593
|
+
name: str | None = Field(
|
|
4594
|
+
default=None,
|
|
4595
|
+
description=(
|
|
4596
|
+
"State key to bind open/close state. When set, the dialog "
|
|
4597
|
+
"can be opened programmatically via SetState(name, True)."
|
|
4598
|
+
),
|
|
4599
|
+
)
|
|
4600
|
+
dismissible: bool = Field(
|
|
4601
|
+
default=True,
|
|
4602
|
+
description=(
|
|
4603
|
+
"Whether the dialog can be closed by clicking outside "
|
|
4604
|
+
"or pressing Escape. When False, the user must use an "
|
|
4605
|
+
"explicit close action."
|
|
4606
|
+
),
|
|
4607
|
+
)
|
|
4447
4608
|
`,"prefab_ui/components/div.py":`"""Generic div and span containers with no default styling."""
|
|
4448
4609
|
|
|
4449
4610
|
from __future__ import annotations
|
|
@@ -5128,6 +5289,7 @@ class Form(ContainerComponent):
|
|
|
5128
5289
|
fields_only: Literal[True],
|
|
5129
5290
|
submit_label: str = "Submit",
|
|
5130
5291
|
on_submit: Action | list[Action] | None = None,
|
|
5292
|
+
defaults: dict[str, Any] | None = None,
|
|
5131
5293
|
css_class: str | None = None,
|
|
5132
5294
|
) -> list[Any]: ...
|
|
5133
5295
|
|
|
@@ -5140,6 +5302,7 @@ class Form(ContainerComponent):
|
|
|
5140
5302
|
fields_only: Literal[False] = ...,
|
|
5141
5303
|
submit_label: str = "Submit",
|
|
5142
5304
|
on_submit: Action | list[Action] | None = None,
|
|
5305
|
+
defaults: dict[str, Any] | None = None,
|
|
5143
5306
|
css_class: str | None = None,
|
|
5144
5307
|
) -> Form: ...
|
|
5145
5308
|
|
|
@@ -5151,6 +5314,7 @@ class Form(ContainerComponent):
|
|
|
5151
5314
|
fields_only: bool = False,
|
|
5152
5315
|
submit_label: str = "Submit",
|
|
5153
5316
|
on_submit: Action | list[Action] | None = None,
|
|
5317
|
+
defaults: dict[str, Any] | None = None,
|
|
5154
5318
|
css_class: str | None = None,
|
|
5155
5319
|
) -> Form | list[Any]:
|
|
5156
5320
|
"""Generate a form from a Pydantic model.
|
|
@@ -5209,11 +5373,23 @@ class Form(ContainerComponent):
|
|
|
5209
5373
|
submit_label: Text for the submit button.
|
|
5210
5374
|
on_submit: Action(s) fired on submit. A \`CallTool\` with no
|
|
5211
5375
|
arguments gets auto-filled from model fields.
|
|
5376
|
+
defaults: Runtime values keyed by field name. These override the
|
|
5377
|
+
model's class-level \`Field(default=...)\` for this render only,
|
|
5378
|
+
letting callers (e.g. LLM agents) pre-populate the form with
|
|
5379
|
+
context-specific values. Unknown keys raise \`ValueError\`.
|
|
5212
5380
|
css_class: Additional CSS classes on the form container.
|
|
5213
5381
|
"""
|
|
5214
5382
|
from prefab_ui.components.base import _component_stack
|
|
5215
5383
|
from prefab_ui.components.button import Button
|
|
5216
5384
|
|
|
5385
|
+
if defaults:
|
|
5386
|
+
unknown = set(defaults) - set(model.model_fields)
|
|
5387
|
+
if unknown:
|
|
5388
|
+
raise ValueError(
|
|
5389
|
+
f"defaults contains unknown field(s) for "
|
|
5390
|
+
f"{model.__name__}: {sorted(unknown)}"
|
|
5391
|
+
)
|
|
5392
|
+
|
|
5217
5393
|
if fields_only:
|
|
5218
5394
|
# Suppress auto-parenting during creation to avoid duplicates
|
|
5219
5395
|
# (Labels/Inputs would otherwise auto-parent to both the
|
|
@@ -5223,7 +5399,7 @@ class Form(ContainerComponent):
|
|
|
5223
5399
|
with defer():
|
|
5224
5400
|
children: list[Any] = []
|
|
5225
5401
|
for name, field_info in model.model_fields.items():
|
|
5226
|
-
component = _field_to_component(name, field_info)
|
|
5402
|
+
component = _field_to_component(name, field_info, defaults)
|
|
5227
5403
|
if component is not None:
|
|
5228
5404
|
children.append(component)
|
|
5229
5405
|
|
|
@@ -5245,7 +5421,7 @@ class Form(ContainerComponent):
|
|
|
5245
5421
|
children = []
|
|
5246
5422
|
|
|
5247
5423
|
for name, field_info in model.model_fields.items():
|
|
5248
|
-
component = _field_to_component(name, field_info)
|
|
5424
|
+
component = _field_to_component(name, field_info, defaults)
|
|
5249
5425
|
if component is not None:
|
|
5250
5426
|
children.append(component)
|
|
5251
5427
|
|
|
@@ -5291,6 +5467,25 @@ def _maybe_enrich_tool_call(
|
|
|
5291
5467
|
return CallTool(**kwargs)
|
|
5292
5468
|
|
|
5293
5469
|
|
|
5470
|
+
def _format_date_default(value: Any, kind: type) -> str | None:
|
|
5471
|
+
"""Serialize a date/time/datetime default to the HTML input format."""
|
|
5472
|
+
if value is None:
|
|
5473
|
+
return None
|
|
5474
|
+
if isinstance(value, str):
|
|
5475
|
+
return value
|
|
5476
|
+
if kind is datetime.datetime and isinstance(value, datetime.datetime):
|
|
5477
|
+
return value.strftime("%Y-%m-%dT%H:%M")
|
|
5478
|
+
if (
|
|
5479
|
+
kind is datetime.date
|
|
5480
|
+
and isinstance(value, datetime.date)
|
|
5481
|
+
and not isinstance(value, datetime.datetime)
|
|
5482
|
+
):
|
|
5483
|
+
return value.isoformat()
|
|
5484
|
+
if kind is datetime.time and isinstance(value, datetime.time):
|
|
5485
|
+
return value.isoformat(timespec="minutes")
|
|
5486
|
+
return None
|
|
5487
|
+
|
|
5488
|
+
|
|
5294
5489
|
def _humanize(name: str) -> str:
|
|
5295
5490
|
"""Convert snake_case field name to Title Case label."""
|
|
5296
5491
|
return name.replace("_", " ").title()
|
|
@@ -5343,7 +5538,11 @@ def _get_ui_hints(field_info: FieldInfo) -> dict[str, Any]:
|
|
|
5343
5538
|
return {}
|
|
5344
5539
|
|
|
5345
5540
|
|
|
5346
|
-
def _field_to_component(
|
|
5541
|
+
def _field_to_component(
|
|
5542
|
+
name: str,
|
|
5543
|
+
field_info: FieldInfo,
|
|
5544
|
+
defaults: dict[str, Any] | None = None,
|
|
5545
|
+
) -> Any:
|
|
5347
5546
|
"""Map a single Pydantic field to the appropriate form component(s)."""
|
|
5348
5547
|
from prefab_ui.components.checkbox import Checkbox
|
|
5349
5548
|
from prefab_ui.components.column import Column
|
|
@@ -5364,9 +5563,12 @@ def _field_to_component(name: str, field_info: FieldInfo) -> Any:
|
|
|
5364
5563
|
|
|
5365
5564
|
label_text = field_info.title or _humanize(name)
|
|
5366
5565
|
placeholder = field_info.description or label_text
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5566
|
+
if defaults is not None and name in defaults:
|
|
5567
|
+
default = defaults[name]
|
|
5568
|
+
elif field_info.default is not PydanticUndefined:
|
|
5569
|
+
default = field_info.default
|
|
5570
|
+
else:
|
|
5571
|
+
default = None
|
|
5370
5572
|
constraints = _extract_constraints(field_info)
|
|
5371
5573
|
ui_hints = _get_ui_hints(field_info)
|
|
5372
5574
|
|
|
@@ -5429,26 +5631,34 @@ def _field_to_component(name: str, field_info: FieldInfo) -> Any:
|
|
|
5429
5631
|
|
|
5430
5632
|
# date/time types → specialized input
|
|
5431
5633
|
if inner is datetime.date:
|
|
5634
|
+
value = _format_date_default(default, datetime.date)
|
|
5432
5635
|
col = Column(gap=2)
|
|
5433
5636
|
col.children = [
|
|
5434
5637
|
Label(label_text, optional=not required),
|
|
5435
|
-
Input(input_type="date", name=name, required=required),
|
|
5638
|
+
Input(input_type="date", name=name, value=value, required=required),
|
|
5436
5639
|
]
|
|
5437
5640
|
return col
|
|
5438
5641
|
|
|
5439
5642
|
if inner is datetime.time:
|
|
5643
|
+
value = _format_date_default(default, datetime.time)
|
|
5440
5644
|
col = Column(gap=2)
|
|
5441
5645
|
col.children = [
|
|
5442
5646
|
Label(label_text, optional=not required),
|
|
5443
|
-
Input(input_type="time", name=name, required=required),
|
|
5647
|
+
Input(input_type="time", name=name, value=value, required=required),
|
|
5444
5648
|
]
|
|
5445
5649
|
return col
|
|
5446
5650
|
|
|
5447
5651
|
if inner is datetime.datetime:
|
|
5652
|
+
value = _format_date_default(default, datetime.datetime)
|
|
5448
5653
|
col = Column(gap=2)
|
|
5449
5654
|
col.children = [
|
|
5450
5655
|
Label(label_text, optional=not required),
|
|
5451
|
-
Input(
|
|
5656
|
+
Input(
|
|
5657
|
+
input_type="datetime-local",
|
|
5658
|
+
name=name,
|
|
5659
|
+
value=value,
|
|
5660
|
+
required=required,
|
|
5661
|
+
),
|
|
5452
5662
|
]
|
|
5453
5663
|
return col
|
|
5454
5664
|
|
|
@@ -6156,6 +6366,43 @@ class Input(StatefulMixin, Component):
|
|
|
6156
6366
|
alias="onChange",
|
|
6157
6367
|
description="Action(s) to execute when value changes",
|
|
6158
6368
|
)
|
|
6369
|
+
`,"prefab_ui/components/kbd.py":`"""Kbd — keyboard key indicator."""
|
|
6370
|
+
|
|
6371
|
+
from __future__ import annotations
|
|
6372
|
+
|
|
6373
|
+
from typing import Any, Literal
|
|
6374
|
+
|
|
6375
|
+
from pydantic import Field
|
|
6376
|
+
|
|
6377
|
+
from prefab_ui.components.base import Component
|
|
6378
|
+
from prefab_ui.rx import RxStr
|
|
6379
|
+
|
|
6380
|
+
|
|
6381
|
+
class Kbd(Component):
|
|
6382
|
+
"""Keyboard key indicator for displaying shortcuts.
|
|
6383
|
+
|
|
6384
|
+
Renders as an inline \`<kbd>\` element with subtle styling.
|
|
6385
|
+
|
|
6386
|
+
Args:
|
|
6387
|
+
label: The key label to display (e.g. "⌘", "K", "→", "Ctrl + B").
|
|
6388
|
+
|
|
6389
|
+
**Example:**
|
|
6390
|
+
|
|
6391
|
+
\`\`\`python
|
|
6392
|
+
from prefab_ui.components import Kbd, Row
|
|
6393
|
+
|
|
6394
|
+
with Row(gap=1):
|
|
6395
|
+
Kbd("⌘")
|
|
6396
|
+
Kbd("K")
|
|
6397
|
+
\`\`\`
|
|
6398
|
+
"""
|
|
6399
|
+
|
|
6400
|
+
type: Literal["Kbd"] = "Kbd"
|
|
6401
|
+
label: str | RxStr = Field(description="Key label to display")
|
|
6402
|
+
|
|
6403
|
+
def __init__(self, label: str | RxStr = "", **kwargs: Any) -> None:
|
|
6404
|
+
kwargs["label"] = label
|
|
6405
|
+
super().__init__(**kwargs)
|
|
6159
6406
|
`,"prefab_ui/components/label.py":`"""Label component for form fields.
|
|
6160
6407
|
|
|
6161
6408
|
Labels identify form inputs and provide accessible descriptions.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Se,d as De}from"./chunk-JSJVCQXG-C9-xDx_f.js";import{s as Pe,g as Be,a as Ie,b as Me,_ as g,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-D6aFEa0I.js";import"./renderer.js";import"./purify.es-DIZLy5JB.js";import"./string-Bl2zznvy.js";var Ft=(function(){var e=g(function(_t,x,m,v){for(m=m||{},v=_t.length;v--;m[_t[v]]=x);return m},"o"),t=[1,24],s=[1,25],o=[1,26],l=[1,27],a=[1,28],r=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],f=[1,68],y=[1,69],E=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],rt=[1,47],st=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Qt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],St=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],k=[1,82],A=[1,83],C=[1,84],w=[1,85],T=[12,14,42],le=[12,14,33,42],Mt=[12,14,33,42,76,77,79,80],vt=[12,33],Ht=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],qt={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:g(function(x,m,v,b,R,h,Dt){var p=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[p-3]);break;case 19:b.setTitle(h[p].substring(6)),this.$=h[p].substring(6);break;case 20:b.setAccDescription(h[p].substring(15)),this.$=h[p].substring(15);break;case 21:this.$=h[p].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[p].trim(),b.setAccDescription(this.$);break;case 28:h[p].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 29:h[p].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 30:b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 31:h[p].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[p]),this.$=h[p];break;case 32:b.addDeploymentNode("node",...h[p]),this.$=h[p];break;case 33:b.addDeploymentNode("nodeL",...h[p]),this.$=h[p];break;case 34:b.addDeploymentNode("nodeR",...h[p]),this.$=h[p];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[p]),this.$=h[p];break;case 40:b.addPersonOrSystem("external_person",...h[p]),this.$=h[p];break;case 41:b.addPersonOrSystem("system",...h[p]),this.$=h[p];break;case 42:b.addPersonOrSystem("system_db",...h[p]),this.$=h[p];break;case 43:b.addPersonOrSystem("system_queue",...h[p]),this.$=h[p];break;case 44:b.addPersonOrSystem("external_system",...h[p]),this.$=h[p];break;case 45:b.addPersonOrSystem("external_system_db",...h[p]),this.$=h[p];break;case 46:b.addPersonOrSystem("external_system_queue",...h[p]),this.$=h[p];break;case 47:b.addContainer("container",...h[p]),this.$=h[p];break;case 48:b.addContainer("container_db",...h[p]),this.$=h[p];break;case 49:b.addContainer("container_queue",...h[p]),this.$=h[p];break;case 50:b.addContainer("external_container",...h[p]),this.$=h[p];break;case 51:b.addContainer("external_container_db",...h[p]),this.$=h[p];break;case 52:b.addContainer("external_container_queue",...h[p]),this.$=h[p];break;case 53:b.addComponent("component",...h[p]),this.$=h[p];break;case 54:b.addComponent("component_db",...h[p]),this.$=h[p];break;case 55:b.addComponent("component_queue",...h[p]),this.$=h[p];break;case 56:b.addComponent("external_component",...h[p]),this.$=h[p];break;case 57:b.addComponent("external_component_db",...h[p]),this.$=h[p];break;case 58:b.addComponent("external_component_queue",...h[p]),this.$=h[p];break;case 60:b.addRel("rel",...h[p]),this.$=h[p];break;case 61:b.addRel("birel",...h[p]),this.$=h[p];break;case 62:b.addRel("rel_u",...h[p]),this.$=h[p];break;case 63:b.addRel("rel_d",...h[p]),this.$=h[p];break;case 64:b.addRel("rel_l",...h[p]),this.$=h[p];break;case 65:b.addRel("rel_r",...h[p]),this.$=h[p];break;case 66:b.addRel("rel_b",...h[p]),this.$=h[p];break;case 67:h[p].splice(0,1),b.addRel("rel",...h[p]),this.$=h[p];break;case 68:b.updateElStyle("update_el_style",...h[p]),this.$=h[p];break;case 69:b.updateRelStyle("update_rel_style",...h[p]),this.$=h[p];break;case 70:b.updateLayoutConfig("update_layout_config",...h[p]),this.$=h[p];break;case 71:this.$=[h[p]];break;case 72:h[p].unshift(h[p-1]),this.$=h[p];break;case 73:case 75:this.$=h[p].trim();break;case 74:let Et={};Et[h[p-1].trim()]=h[p].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:f,41:y,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:f,41:y,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:f,41:y,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:f,41:y,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:f,41:y,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},e(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:r,36:n,37:i,38:u,39:d,40:f,41:y,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ct,[2,14]),e(Qt,[2,16],{12:[1,76]}),e(Ct,[2,36],{12:[1,77]}),e(St,[2,19]),e(St,[2,20]),{25:[1,78]},{27:[1,79]},e(St,[2,23]),{35:80,75:81,76:k,77:A,79:C,80:w},{35:86,75:81,76:k,77:A,79:C,80:w},{35:87,75:81,76:k,77:A,79:C,80:w},{35:88,75:81,76:k,77:A,79:C,80:w},{35:89,75:81,76:k,77:A,79:C,80:w},{35:90,75:81,76:k,77:A,79:C,80:w},{35:91,75:81,76:k,77:A,79:C,80:w},{35:92,75:81,76:k,77:A,79:C,80:w},{35:93,75:81,76:k,77:A,79:C,80:w},{35:94,75:81,76:k,77:A,79:C,80:w},{35:95,75:81,76:k,77:A,79:C,80:w},{35:96,75:81,76:k,77:A,79:C,80:w},{35:97,75:81,76:k,77:A,79:C,80:w},{35:98,75:81,76:k,77:A,79:C,80:w},{35:99,75:81,76:k,77:A,79:C,80:w},{35:100,75:81,76:k,77:A,79:C,80:w},{35:101,75:81,76:k,77:A,79:C,80:w},{35:102,75:81,76:k,77:A,79:C,80:w},{35:103,75:81,76:k,77:A,79:C,80:w},{35:104,75:81,76:k,77:A,79:C,80:w},e(T,[2,59]),{35:105,75:81,76:k,77:A,79:C,80:w},{35:106,75:81,76:k,77:A,79:C,80:w},{35:107,75:81,76:k,77:A,79:C,80:w},{35:108,75:81,76:k,77:A,79:C,80:w},{35:109,75:81,76:k,77:A,79:C,80:w},{35:110,75:81,76:k,77:A,79:C,80:w},{35:111,75:81,76:k,77:A,79:C,80:w},{35:112,75:81,76:k,77:A,79:C,80:w},{35:113,75:81,76:k,77:A,79:C,80:w},{35:114,75:81,76:k,77:A,79:C,80:w},{35:115,75:81,76:k,77:A,79:C,80:w},{20:116,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:f,41:y,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:k,77:A,79:C,80:w},{35:120,75:81,76:k,77:A,79:C,80:w},{35:121,75:81,76:k,77:A,79:C,80:w},{35:122,75:81,76:k,77:A,79:C,80:w},{35:123,75:81,76:k,77:A,79:C,80:w},{35:124,75:81,76:k,77:A,79:C,80:w},{35:125,75:81,76:k,77:A,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Ct,[2,15]),e(Qt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:l,28:a}),e(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:l,28:a,34:r,36:n,37:i,38:u,39:d,40:f,41:y,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(St,[2,21]),e(St,[2,22]),e(T,[2,39]),e(le,[2,71],{75:81,35:132,76:k,77:A,79:C,80:w}),e(Mt,[2,73]),{78:[1,133]},e(Mt,[2,75]),e(Mt,[2,76]),e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(T,[2,43]),e(T,[2,44]),e(T,[2,45]),e(T,[2,46]),e(T,[2,47]),e(T,[2,48]),e(T,[2,49]),e(T,[2,50]),e(T,[2,51]),e(T,[2,52]),e(T,[2,53]),e(T,[2,54]),e(T,[2,55]),e(T,[2,56]),e(T,[2,57]),e(T,[2,58]),e(T,[2,60]),e(T,[2,61]),e(T,[2,62]),e(T,[2,63]),e(T,[2,64]),e(T,[2,65]),e(T,[2,66]),e(T,[2,67]),e(T,[2,68]),e(T,[2,69]),e(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(vt,[2,28]),e(vt,[2,29]),e(vt,[2,30]),e(vt,[2,31]),e(vt,[2,32]),e(vt,[2,33]),e(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Qt,[2,18]),e(Ct,[2,38]),e(le,[2,72]),e(Mt,[2,74]),e(T,[2,24]),e(T,[2,35]),e(Ht,[2,25]),e(Ht,[2,26],{12:[1,138]}),e(Ht,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:g(function(x,m){if(m.recoverable)this.trace(x);else{var v=new Error(x);throw v.hash=m,v}},"parseError"),parse:g(function(x){var m=this,v=[0],b=[],R=[null],h=[],Dt=this.table,p="",Et=0,oe=0,we=2,ce=1,Te=h.slice.call(arguments,1),D=Object.create(this.lexer),kt={yy:{}};for(var Gt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Gt)&&(kt.yy[Gt]=this.yy[Gt]);D.setInput(x,kt.yy),kt.yy.lexer=D,kt.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Kt=D.yylloc;h.push(Kt);var Oe=D.options&&D.options.ranges;typeof kt.yy.parseError=="function"?this.parseError=kt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Re(L){v.length=v.length-2*L,R.length=R.length-L,h.length=h.length-L}g(Re,"popStack");function he(){var L;return L=b.pop()||D.lex()||ce,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=m.symbols_[L]||L),L}g(he,"lex");for(var I,At,N,Jt,wt={},Nt,W,ue,Yt;;){if(At=v[v.length-1],this.defaultActions[At]?N=this.defaultActions[At]:((I===null||typeof I>"u")&&(I=he()),N=Dt[At]&&Dt[At][I]),typeof N>"u"||!N.length||!N[0]){var Zt="";Yt=[];for(Nt in Dt[At])this.terminals_[Nt]&&Nt>we&&Yt.push("'"+this.terminals_[Nt]+"'");D.showPosition?Zt="Parse error on line "+(Et+1)+`:
|
|
1
|
+
import{g as Se,d as De}from"./chunk-JSJVCQXG-Dav_pqEt.js";import{s as Pe,g as Be,a as Ie,b as Me,_ as g,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-C0_6bYX2.js";import"./renderer.js";import"./purify.es-DIZLy5JB.js";import"./string-Bl2zznvy.js";var Ft=(function(){var e=g(function(_t,x,m,v){for(m=m||{},v=_t.length;v--;m[_t[v]]=x);return m},"o"),t=[1,24],s=[1,25],o=[1,26],l=[1,27],a=[1,28],r=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],f=[1,68],y=[1,69],E=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],rt=[1,47],st=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Qt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],St=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],k=[1,82],A=[1,83],C=[1,84],w=[1,85],T=[12,14,42],le=[12,14,33,42],Mt=[12,14,33,42,76,77,79,80],vt=[12,33],Ht=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],qt={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:g(function(x,m,v,b,R,h,Dt){var p=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[p-3]);break;case 19:b.setTitle(h[p].substring(6)),this.$=h[p].substring(6);break;case 20:b.setAccDescription(h[p].substring(15)),this.$=h[p].substring(15);break;case 21:this.$=h[p].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[p].trim(),b.setAccDescription(this.$);break;case 28:h[p].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 29:h[p].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 30:b.addPersonOrSystemBoundary(...h[p]),this.$=h[p];break;case 31:h[p].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[p]),this.$=h[p];break;case 32:b.addDeploymentNode("node",...h[p]),this.$=h[p];break;case 33:b.addDeploymentNode("nodeL",...h[p]),this.$=h[p];break;case 34:b.addDeploymentNode("nodeR",...h[p]),this.$=h[p];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[p]),this.$=h[p];break;case 40:b.addPersonOrSystem("external_person",...h[p]),this.$=h[p];break;case 41:b.addPersonOrSystem("system",...h[p]),this.$=h[p];break;case 42:b.addPersonOrSystem("system_db",...h[p]),this.$=h[p];break;case 43:b.addPersonOrSystem("system_queue",...h[p]),this.$=h[p];break;case 44:b.addPersonOrSystem("external_system",...h[p]),this.$=h[p];break;case 45:b.addPersonOrSystem("external_system_db",...h[p]),this.$=h[p];break;case 46:b.addPersonOrSystem("external_system_queue",...h[p]),this.$=h[p];break;case 47:b.addContainer("container",...h[p]),this.$=h[p];break;case 48:b.addContainer("container_db",...h[p]),this.$=h[p];break;case 49:b.addContainer("container_queue",...h[p]),this.$=h[p];break;case 50:b.addContainer("external_container",...h[p]),this.$=h[p];break;case 51:b.addContainer("external_container_db",...h[p]),this.$=h[p];break;case 52:b.addContainer("external_container_queue",...h[p]),this.$=h[p];break;case 53:b.addComponent("component",...h[p]),this.$=h[p];break;case 54:b.addComponent("component_db",...h[p]),this.$=h[p];break;case 55:b.addComponent("component_queue",...h[p]),this.$=h[p];break;case 56:b.addComponent("external_component",...h[p]),this.$=h[p];break;case 57:b.addComponent("external_component_db",...h[p]),this.$=h[p];break;case 58:b.addComponent("external_component_queue",...h[p]),this.$=h[p];break;case 60:b.addRel("rel",...h[p]),this.$=h[p];break;case 61:b.addRel("birel",...h[p]),this.$=h[p];break;case 62:b.addRel("rel_u",...h[p]),this.$=h[p];break;case 63:b.addRel("rel_d",...h[p]),this.$=h[p];break;case 64:b.addRel("rel_l",...h[p]),this.$=h[p];break;case 65:b.addRel("rel_r",...h[p]),this.$=h[p];break;case 66:b.addRel("rel_b",...h[p]),this.$=h[p];break;case 67:h[p].splice(0,1),b.addRel("rel",...h[p]),this.$=h[p];break;case 68:b.updateElStyle("update_el_style",...h[p]),this.$=h[p];break;case 69:b.updateRelStyle("update_rel_style",...h[p]),this.$=h[p];break;case 70:b.updateLayoutConfig("update_layout_config",...h[p]),this.$=h[p];break;case 71:this.$=[h[p]];break;case 72:h[p].unshift(h[p-1]),this.$=h[p];break;case 73:case 75:this.$=h[p].trim();break;case 74:let Et={};Et[h[p-1].trim()]=h[p].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:f,41:y,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:f,41:y,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:f,41:y,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:f,41:y,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:a,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:f,41:y,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},e(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:r,36:n,37:i,38:u,39:d,40:f,41:y,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ct,[2,14]),e(Qt,[2,16],{12:[1,76]}),e(Ct,[2,36],{12:[1,77]}),e(St,[2,19]),e(St,[2,20]),{25:[1,78]},{27:[1,79]},e(St,[2,23]),{35:80,75:81,76:k,77:A,79:C,80:w},{35:86,75:81,76:k,77:A,79:C,80:w},{35:87,75:81,76:k,77:A,79:C,80:w},{35:88,75:81,76:k,77:A,79:C,80:w},{35:89,75:81,76:k,77:A,79:C,80:w},{35:90,75:81,76:k,77:A,79:C,80:w},{35:91,75:81,76:k,77:A,79:C,80:w},{35:92,75:81,76:k,77:A,79:C,80:w},{35:93,75:81,76:k,77:A,79:C,80:w},{35:94,75:81,76:k,77:A,79:C,80:w},{35:95,75:81,76:k,77:A,79:C,80:w},{35:96,75:81,76:k,77:A,79:C,80:w},{35:97,75:81,76:k,77:A,79:C,80:w},{35:98,75:81,76:k,77:A,79:C,80:w},{35:99,75:81,76:k,77:A,79:C,80:w},{35:100,75:81,76:k,77:A,79:C,80:w},{35:101,75:81,76:k,77:A,79:C,80:w},{35:102,75:81,76:k,77:A,79:C,80:w},{35:103,75:81,76:k,77:A,79:C,80:w},{35:104,75:81,76:k,77:A,79:C,80:w},e(T,[2,59]),{35:105,75:81,76:k,77:A,79:C,80:w},{35:106,75:81,76:k,77:A,79:C,80:w},{35:107,75:81,76:k,77:A,79:C,80:w},{35:108,75:81,76:k,77:A,79:C,80:w},{35:109,75:81,76:k,77:A,79:C,80:w},{35:110,75:81,76:k,77:A,79:C,80:w},{35:111,75:81,76:k,77:A,79:C,80:w},{35:112,75:81,76:k,77:A,79:C,80:w},{35:113,75:81,76:k,77:A,79:C,80:w},{35:114,75:81,76:k,77:A,79:C,80:w},{35:115,75:81,76:k,77:A,79:C,80:w},{20:116,29:49,30:61,32:62,34:r,36:n,37:i,38:u,39:d,40:f,41:y,43:23,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:k,77:A,79:C,80:w},{35:120,75:81,76:k,77:A,79:C,80:w},{35:121,75:81,76:k,77:A,79:C,80:w},{35:122,75:81,76:k,77:A,79:C,80:w},{35:123,75:81,76:k,77:A,79:C,80:w},{35:124,75:81,76:k,77:A,79:C,80:w},{35:125,75:81,76:k,77:A,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Ct,[2,15]),e(Qt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:l,28:a}),e(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:l,28:a,34:r,36:n,37:i,38:u,39:d,40:f,41:y,44:E,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:rt,63:st,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(St,[2,21]),e(St,[2,22]),e(T,[2,39]),e(le,[2,71],{75:81,35:132,76:k,77:A,79:C,80:w}),e(Mt,[2,73]),{78:[1,133]},e(Mt,[2,75]),e(Mt,[2,76]),e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(T,[2,43]),e(T,[2,44]),e(T,[2,45]),e(T,[2,46]),e(T,[2,47]),e(T,[2,48]),e(T,[2,49]),e(T,[2,50]),e(T,[2,51]),e(T,[2,52]),e(T,[2,53]),e(T,[2,54]),e(T,[2,55]),e(T,[2,56]),e(T,[2,57]),e(T,[2,58]),e(T,[2,60]),e(T,[2,61]),e(T,[2,62]),e(T,[2,63]),e(T,[2,64]),e(T,[2,65]),e(T,[2,66]),e(T,[2,67]),e(T,[2,68]),e(T,[2,69]),e(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(vt,[2,28]),e(vt,[2,29]),e(vt,[2,30]),e(vt,[2,31]),e(vt,[2,32]),e(vt,[2,33]),e(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Qt,[2,18]),e(Ct,[2,38]),e(le,[2,72]),e(Mt,[2,74]),e(T,[2,24]),e(T,[2,35]),e(Ht,[2,25]),e(Ht,[2,26],{12:[1,138]}),e(Ht,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:g(function(x,m){if(m.recoverable)this.trace(x);else{var v=new Error(x);throw v.hash=m,v}},"parseError"),parse:g(function(x){var m=this,v=[0],b=[],R=[null],h=[],Dt=this.table,p="",Et=0,oe=0,we=2,ce=1,Te=h.slice.call(arguments,1),D=Object.create(this.lexer),kt={yy:{}};for(var Gt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Gt)&&(kt.yy[Gt]=this.yy[Gt]);D.setInput(x,kt.yy),kt.yy.lexer=D,kt.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Kt=D.yylloc;h.push(Kt);var Oe=D.options&&D.options.ranges;typeof kt.yy.parseError=="function"?this.parseError=kt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Re(L){v.length=v.length-2*L,R.length=R.length-L,h.length=h.length-L}g(Re,"popStack");function he(){var L;return L=b.pop()||D.lex()||ce,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=m.symbols_[L]||L),L}g(he,"lex");for(var I,At,N,Jt,wt={},Nt,W,ue,Yt;;){if(At=v[v.length-1],this.defaultActions[At]?N=this.defaultActions[At]:((I===null||typeof I>"u")&&(I=he()),N=Dt[At]&&Dt[At][I]),typeof N>"u"||!N.length||!N[0]){var Zt="";Yt=[];for(Nt in Dt[At])this.terminals_[Nt]&&Nt>we&&Yt.push("'"+this.terminals_[Nt]+"'");D.showPosition?Zt="Parse error on line "+(Et+1)+`:
|
|
2
2
|
`+D.showPosition()+`
|
|
3
3
|
Expecting `+Yt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Zt="Parse error on line "+(Et+1)+": Unexpected "+(I==ce?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Zt,{text:D.match,token:this.terminals_[I]||I,line:D.yylineno,loc:Kt,expected:Yt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+At+", token: "+I);switch(N[0]){case 1:v.push(I),R.push(D.yytext),h.push(D.yylloc),v.push(N[1]),I=null,oe=D.yyleng,p=D.yytext,Et=D.yylineno,Kt=D.yylloc;break;case 2:if(W=this.productions_[N[1]][1],wt.$=R[R.length-W],wt._$={first_line:h[h.length-(W||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(W||1)].first_column,last_column:h[h.length-1].last_column},Oe&&(wt._$.range=[h[h.length-(W||1)].range[0],h[h.length-1].range[1]]),Jt=this.performAction.apply(wt,[p,oe,Et,kt.yy,N[1],R,h].concat(Te)),typeof Jt<"u")return Jt;W&&(v=v.slice(0,-1*W*2),R=R.slice(0,-1*W),h=h.slice(0,-1*W)),v.push(this.productions_[N[1]][0]),R.push(wt.$),h.push(wt._$),ue=Dt[v[v.length-2]][v[v.length-1]],v.push(ue);break;case 3:return!0}}return!0},"parse")},Ce=(function(){var _t={EOF:1,parseError:g(function(m,v){if(this.yy.parser)this.yy.parser.parseError(m,v);else throw new Error(m)},"parseError"),setInput:g(function(x,m){return this.yy=m||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:g(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var m=x.match(/(?:\r\n?|\n).*/g);return m?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:g(function(x){var m=x.length,v=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-m),this.offset-=m;var b=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),v.length-1&&(this.yylineno-=v.length-1);var R=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:v?(v.length===b.length?this.yylloc.first_column:0)+b[b.length-v.length].length-v[0].length:this.yylloc.first_column-m},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-m]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:g(function(x){this.unput(this.match.slice(x))},"less"),pastInput:g(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var x=this.pastInput(),m=new Array(x.length+1).join("-");return x+this.upcomingInput()+`
|