@cagent/chat-embedding-core 0.0.13 → 0.0.14
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/.env +6 -0
- package/README.md +213 -213
- package/bun.lock +1548 -1548
- package/dist/abnfDiagram-VRR7QNED-3cfb3856.js +1 -0
- package/dist/abnfDiagram-VRR7QNED-686410b0.js +1 -0
- package/dist/abnfDiagram-VRR7QNED-fb22812d.js +1 -0
- package/dist/api/chatRoom.d.ts.map +1 -0
- package/dist/arc-24dd4755.js +1 -0
- package/dist/arc-5d6257cf.js +1 -0
- package/dist/arc-90e71e7e.js +1 -0
- package/dist/architecture-TIHT7OUA-a997f441.js +1 -0
- package/dist/architecture-TIHT7OUA-faa1f9b3.js +1 -0
- package/dist/architectureDiagram-ZJ3FMSHR-87443299.js +1 -0
- package/dist/architectureDiagram-ZJ3FMSHR-93988e41.js +1 -0
- package/dist/architectureDiagram-ZJ3FMSHR-bde2dd21.js +1 -0
- package/dist/blockDiagram-677ZJIJ3-25a94a47.js +1 -0
- package/dist/blockDiagram-677ZJIJ3-88bd543c.js +1 -0
- package/dist/blockDiagram-677ZJIJ3-c769a3c8.js +1 -0
- package/dist/c4Diagram-LMCZKHZV-763880d7.js +1 -0
- package/dist/c4Diagram-LMCZKHZV-d7fc839e.js +1 -0
- package/dist/c4Diagram-LMCZKHZV-da04a76e.js +1 -0
- package/dist/channel-11d3f4bc.js +1 -0
- package/dist/channel-534c2e17.js +1 -0
- package/dist/channel-c3cf6060.js +1 -0
- package/dist/chunk-2Q5K7J3B-2892df89.js +1 -0
- package/dist/chunk-2Q5K7J3B-7960ff8e.js +1 -0
- package/dist/chunk-2Q5K7J3B-9497bf31.js +1 -0
- package/dist/chunk-32BRIVSS-10123eba.js +1 -0
- package/dist/chunk-32BRIVSS-10ac68f7.js +1 -0
- package/dist/chunk-32BRIVSS-8a8507a2.js +1 -0
- package/dist/chunk-5VM5RSS4-36b32f6e.js +1 -0
- package/dist/chunk-5VM5RSS4-4b2efd20.js +1 -0
- package/dist/chunk-5VM5RSS4-5fc85a49.js +1 -0
- package/dist/chunk-EX3LRPZG-36494b87.js +1 -0
- package/dist/chunk-EX3LRPZG-6cd1f2fa.js +1 -0
- package/dist/chunk-EX3LRPZG-7ac6d0d7.js +1 -0
- package/dist/chunk-JWPE2WC7-15a55950.js +1 -0
- package/dist/chunk-JWPE2WC7-84faee3d.js +1 -0
- package/dist/chunk-JWPE2WC7-e2521b1e.js +1 -0
- package/dist/chunk-MOJQB5TN-47f0392f.js +1 -0
- package/dist/chunk-MOJQB5TN-5cc2e61b.js +1 -0
- package/dist/chunk-MOJQB5TN-ea88675c.js +1 -0
- package/dist/chunk-PUDLZKDR-057ec46a.js +1 -0
- package/dist/chunk-PUDLZKDR-53309be9.js +1 -0
- package/dist/chunk-PUDLZKDR-6de50ada.js +1 -0
- package/dist/chunk-RYQCIY6F-06b096c5.js +1 -0
- package/dist/chunk-RYQCIY6F-453400cd.js +1 -0
- package/dist/chunk-RYQCIY6F-8de649c8.js +1 -0
- package/dist/chunk-V7JOEXUC-4083766f.js +1 -0
- package/dist/chunk-V7JOEXUC-4e8d7729.js +1 -0
- package/dist/chunk-V7JOEXUC-bb2df9b0.js +1 -0
- package/dist/chunk-VR4S4FIN-5feb7571.js +1 -0
- package/dist/chunk-VR4S4FIN-9df47127.js +1 -0
- package/dist/chunk-VR4S4FIN-c4f2681d.js +1 -0
- package/dist/chunk-XXDRQBXY-3c9d8bf9.js +1 -0
- package/dist/chunk-XXDRQBXY-de00e988.js +1 -0
- package/dist/chunk-XXDRQBXY-f923ffed.js +1 -0
- package/dist/classDiagram-OUVF2IWQ-5cdf5fe6.js +1 -0
- package/dist/classDiagram-OUVF2IWQ-d51bd736.js +1 -0
- package/dist/classDiagram-OUVF2IWQ-fc2b54d6.js +1 -0
- package/dist/classDiagram-v2-EOCWNBFH-5cdf5fe6.js +1 -0
- package/dist/classDiagram-v2-EOCWNBFH-d51bd736.js +1 -0
- package/dist/classDiagram-v2-EOCWNBFH-fc2b54d6.js +1 -0
- package/dist/components/Badge.d.ts.map +1 -0
- package/dist/components/Bot.d.ts.map +1 -0
- package/dist/components/FeedbackContentDialog.d.ts.map +1 -0
- package/dist/components/RoomReconnectAlert.d.ts.map +1 -0
- package/dist/components/Toast.d.ts.map +1 -0
- package/dist/components/TypingBubble.d.ts.map +1 -0
- package/dist/components/avatars/Avatar.d.ts.map +1 -0
- package/dist/components/avatars/DefaultAvatar.d.ts.map +1 -0
- package/dist/components/bubbles/AgentReasoningBubble.d.ts.map +1 -0
- package/dist/components/bubbles/BotBubble.d.ts.map +1 -0
- package/dist/components/bubbles/ChartBubble.d.ts.map +1 -0
- package/dist/components/bubbles/ChartLoadingPlaceholder.d.ts.map +1 -0
- package/dist/components/bubbles/ChartPlaceholder.d.ts.map +1 -0
- package/dist/components/bubbles/ChartPopupModal.d.ts.map +1 -0
- package/dist/components/bubbles/FollowUpPromptBubble.d.ts.map +1 -0
- package/dist/components/bubbles/GuestBubble.d.ts.map +1 -0
- package/dist/components/bubbles/LeadCaptureBubble.d.ts.map +1 -0
- package/dist/components/bubbles/LoadingBubble.d.ts.map +1 -0
- package/dist/components/bubbles/SourceBubble.d.ts.map +1 -0
- package/dist/components/bubbles/StableChartWrapper.d.ts.map +1 -0
- package/dist/components/bubbles/StarterPromptBubble.d.ts.map +1 -0
- package/dist/components/buttons/AttachmentUploadButton.d.ts.map +1 -0
- package/dist/components/buttons/CancelButton.d.ts.map +1 -0
- package/dist/components/buttons/CopyMessageButton.d.ts.map +1 -0
- package/dist/components/buttons/EditMessageButton.d.ts.map +1 -0
- package/dist/components/buttons/FeedbackButtons.d.ts.map +1 -0
- package/dist/components/buttons/ImageUploadButton.d.ts.map +1 -0
- package/dist/components/buttons/LeadCaptureButtons.d.ts.map +1 -0
- package/dist/components/buttons/PopupToast.d.ts.map +1 -0
- package/dist/components/buttons/RecordAudioButton.d.ts.map +1 -0
- package/dist/components/buttons/SendButton.d.ts.map +1 -0
- package/dist/components/dialogs/EditMessageDialog.d.ts.map +1 -0
- package/dist/components/icons/AddImageIcon.d.ts.map +1 -0
- package/dist/components/icons/AttachmentIcon.d.ts.map +1 -0
- package/dist/components/icons/CheckIcon.d.ts.map +1 -0
- package/dist/components/icons/CircleDotIcon.d.ts.map +1 -0
- package/dist/components/icons/ClipboardIcon.d.ts.map +1 -0
- package/dist/components/icons/CopyIcon.d.ts.map +1 -0
- package/dist/components/icons/DeleteIcon.d.ts.map +1 -0
- package/dist/components/icons/EditIcon.d.ts.map +1 -0
- package/dist/components/icons/FullScreenIcon.d.ts.map +1 -0
- package/dist/components/icons/RecordIcon.d.ts.map +1 -0
- package/dist/components/icons/ResetZoomIcon.d.ts.map +1 -0
- package/dist/components/icons/SendIcon.d.ts.map +1 -0
- package/dist/components/icons/SparklesIcon.d.ts.map +1 -0
- package/dist/components/icons/StopIcon.d.ts.map +1 -0
- package/dist/components/icons/ThumbsDownIcon.d.ts.map +1 -0
- package/dist/components/icons/ThumbsUpIcon.d.ts.map +1 -0
- package/dist/components/icons/TickIcon.d.ts.map +1 -0
- package/dist/components/icons/TrashIcon.d.ts.map +1 -0
- package/dist/components/icons/XIcon.d.ts.map +1 -0
- package/dist/components/icons/ZoomInIcon.d.ts.map +1 -0
- package/dist/components/icons/ZoomOutIcon.d.ts.map +1 -0
- package/dist/components/icons/index.d.ts.map +1 -0
- package/dist/components/image/PreviewImage.d.ts.map +1 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/inputs/textInput/components/FilePreview.d.ts.map +1 -0
- package/dist/components/inputs/textInput/components/ShortTextInput.d.ts.map +1 -0
- package/dist/components/inputs/textInput/components/TextInput.d.ts.map +1 -0
- package/dist/components/inputs/textInput/index.d.ts.map +1 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/cose-bilkent-JH36ORCC-ac4d2e28.js +1 -0
- package/dist/cose-bilkent-JH36ORCC-c3560feb.js +1 -0
- package/dist/cose-bilkent-JH36ORCC-f0ddc3e7.js +1 -0
- package/dist/cynefin-VYW2F7L2-2458ad91.js +1 -0
- package/dist/cynefin-VYW2F7L2-a8648cf6.js +1 -0
- package/dist/cynefinDiagram-TSTJHNR4-62a29383.js +1 -0
- package/dist/cynefinDiagram-TSTJHNR4-910b3dfd.js +1 -0
- package/dist/cynefinDiagram-TSTJHNR4-deb0bb2c.js +1 -0
- package/dist/cytoscape.esm-56d2239f.js +1 -0
- package/dist/cytoscape.esm-c9352dc8.js +1 -0
- package/dist/dagre-VKFMJZFB-1467d0af.js +1 -0
- package/dist/dagre-VKFMJZFB-35daad97.js +1 -0
- package/dist/dagre-VKFMJZFB-c5b9a4a0.js +1 -0
- package/dist/defaultLocale-b4977250.js +1 -0
- package/dist/defaultLocale-e35a4def.js +1 -0
- package/dist/diagram-FQU43EPY-41eed431.js +1 -0
- package/dist/diagram-FQU43EPY-613e9e4e.js +1 -0
- package/dist/diagram-FQU43EPY-d256050e.js +1 -0
- package/dist/diagram-G47NLZAW-813bbb70.js +1 -0
- package/dist/diagram-G47NLZAW-8ef917d1.js +1 -0
- package/dist/diagram-G47NLZAW-aa02607c.js +1 -0
- package/dist/diagram-NH7WQ7WH-0af7a921.js +1 -0
- package/dist/diagram-NH7WQ7WH-0e4f7f17.js +1 -0
- package/dist/diagram-NH7WQ7WH-6f91f6aa.js +1 -0
- package/dist/diagram-OA4YK3LP-0fba2475.js +1 -0
- package/dist/diagram-OA4YK3LP-587273f4.js +1 -0
- package/dist/diagram-OA4YK3LP-6cbfc7a5.js +1 -0
- package/dist/diagram-WEI45ONY-0241463f.js +1 -0
- package/dist/diagram-WEI45ONY-dd634033.js +1 -0
- package/dist/diagram-WEI45ONY-e002e844.js +1 -0
- package/dist/ebnfDiagram-CCIWWBDH-20ac4ba3.js +1 -0
- package/dist/ebnfDiagram-CCIWWBDH-e9974165.js +1 -0
- package/dist/ebnfDiagram-CCIWWBDH-ead44055.js +1 -0
- package/dist/erDiagram-Q63AITRT-1febb8fc.js +1 -0
- package/dist/erDiagram-Q63AITRT-4ea4b93d.js +1 -0
- package/dist/erDiagram-Q63AITRT-bcb00855.js +1 -0
- package/dist/eventmodeling-45OFAUF4-a82f1f18.js +1 -0
- package/dist/eventmodeling-45OFAUF4-dcf667fc.js +1 -0
- package/dist/features/bubble/components/Bubble.d.ts.map +1 -0
- package/dist/features/bubble/components/BubbleButton.d.ts.map +1 -0
- package/dist/features/bubble/components/Tooltip.d.ts.map +1 -0
- package/dist/features/bubble/components/index.d.ts.map +1 -0
- package/dist/features/bubble/index.d.ts.map +1 -0
- package/dist/features/bubble/types.d.ts.map +1 -0
- package/dist/features/full/components/Full.d.ts.map +1 -0
- package/dist/features/full/components/index.d.ts.map +1 -0
- package/dist/features/full/index.d.ts.map +1 -0
- package/dist/features/popup/components/DisclaimerPopup.d.ts.map +1 -0
- package/dist/features/popup/components/Popup.d.ts.map +1 -0
- package/dist/features/popup/components/index.d.ts.map +1 -0
- package/dist/features/popup/index.d.ts.map +1 -0
- package/dist/features/popup/types.d.ts.map +1 -0
- package/dist/flowDiagram-23GEKE2U-14ee2b3c.js +1 -0
- package/dist/flowDiagram-23GEKE2U-7ab9c2e4.js +1 -0
- package/dist/flowDiagram-23GEKE2U-f7309569.js +1 -0
- package/dist/ganttDiagram-NO4QXBWP-249a167d.js +1 -0
- package/dist/ganttDiagram-NO4QXBWP-bd530d12.js +1 -0
- package/dist/ganttDiagram-NO4QXBWP-e5e495d6.js +1 -0
- package/dist/gitGraph-TEB2WS4Q-72ba3362.js +1 -0
- package/dist/gitGraph-TEB2WS4Q-d07b15b3.js +1 -0
- package/dist/gitGraphDiagram-IHSO6WYX-2964ff91.js +1 -0
- package/dist/gitGraphDiagram-IHSO6WYX-4d9324ad.js +1 -0
- package/dist/gitGraphDiagram-IHSO6WYX-97bf868b.js +1 -0
- package/dist/graph-0df36b9d.js +1 -0
- package/dist/graph-c6801890.js +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/info-DKCQHKI2-d8e8a901.js +1 -0
- package/dist/info-DKCQHKI2-dd69502c.js +1 -0
- package/dist/infoDiagram-FWYZ7A6U-1267309e.js +1 -0
- package/dist/infoDiagram-FWYZ7A6U-5b9d28af.js +1 -0
- package/dist/infoDiagram-FWYZ7A6U-cc33afe4.js +1 -0
- package/dist/init-b029a625.js +1 -0
- package/dist/init-cf76ae07.js +1 -0
- package/dist/ishikawaDiagram-FXEZZL3T-3f0977e8.js +1 -0
- package/dist/ishikawaDiagram-FXEZZL3T-89c1b2f4.js +1 -0
- package/dist/ishikawaDiagram-FXEZZL3T-9fef4653.js +1 -0
- package/dist/journeyDiagram-5HDEW3XC-563a68ff.js +1 -0
- package/dist/journeyDiagram-5HDEW3XC-c8c8d701.js +1 -0
- package/dist/journeyDiagram-5HDEW3XC-e6c5e84b.js +1 -0
- package/dist/kanban-definition-HUTT4EX6-3719e367.js +1 -0
- package/dist/kanban-definition-HUTT4EX6-7bc0cd1e.js +1 -0
- package/dist/kanban-definition-HUTT4EX6-d8b002e3.js +1 -0
- package/dist/katex-67456a45.js +1 -0
- package/dist/katex-b134d23c.js +1 -0
- package/dist/layout-e44354bf.js +1 -0
- package/dist/layout-ff5d33a1.js +1 -0
- package/dist/linear-7b1a23f3.js +1 -0
- package/dist/linear-d7ad6d25.js +1 -0
- package/dist/linear-e5c99c88.js +1 -0
- package/dist/map-05f0ff95.js +1 -0
- package/dist/map-d3292a5b.js +1 -0
- package/dist/mermaid-parser.core-6df0beec.js +1 -0
- package/dist/mermaid-parser.core-d8d1c2b9.js +1 -0
- package/dist/mermaid.core-2d237a1e.js +1 -0
- package/dist/mermaid.core-70d5aead.js +1 -0
- package/dist/mermaid.core-8797d6a9.js +1 -0
- package/dist/mindmap-definition-LN4V7U3C-04a12a88.js +1 -0
- package/dist/mindmap-definition-LN4V7U3C-86a890ce.js +1 -0
- package/dist/mindmap-definition-LN4V7U3C-f495948c.js +1 -0
- package/dist/ordinal-221e41d7.js +1 -0
- package/dist/ordinal-4a51e46c.js +1 -0
- package/dist/packet-7NZHBO7P-b4586e10.js +1 -0
- package/dist/packet-7NZHBO7P-f62750ff.js +1 -0
- package/dist/pegDiagram-2B236MQR-234fe6d1.js +1 -0
- package/dist/pegDiagram-2B236MQR-2826e278.js +1 -0
- package/dist/pegDiagram-2B236MQR-64eeb662.js +1 -0
- package/dist/pie-RZYD4A2V-106ba3d7.js +1 -0
- package/dist/pie-RZYD4A2V-752eda00.js +1 -0
- package/dist/pieDiagram-ENE6RG2P-0c3b09b8.js +1 -0
- package/dist/pieDiagram-ENE6RG2P-3fb5f734.js +1 -0
- package/dist/pieDiagram-ENE6RG2P-af928526.js +1 -0
- package/dist/quadrantDiagram-ABIIQ3AL-1a55c0f5.js +1 -0
- package/dist/quadrantDiagram-ABIIQ3AL-3d15c26d.js +1 -0
- package/dist/quadrantDiagram-ABIIQ3AL-9110fa9c.js +1 -0
- package/dist/queries/sendMessageQuery.d.ts.map +1 -0
- package/dist/radar-I7S5WNFK-53bde9ff.js +1 -0
- package/dist/radar-I7S5WNFK-87e8c5ba.js +1 -0
- package/dist/railroad-3IZDKUUU-99427b9f.js +1 -0
- package/dist/railroad-3IZDKUUU-9e29587d.js +1 -0
- package/dist/railroad-abnf-AHOZXSZD-1d11cb5b.js +1 -0
- package/dist/railroad-abnf-AHOZXSZD-c27db0bc.js +1 -0
- package/dist/railroad-ebnf-EBAXGLYW-38dff87c.js +1 -0
- package/dist/railroad-ebnf-EBAXGLYW-6bb5de0c.js +1 -0
- package/dist/railroad-peg-LSFZ7HO6-c9f0aa71.js +1 -0
- package/dist/railroad-peg-LSFZ7HO6-efcb0a43.js +1 -0
- package/dist/railroadDiagram-RFXS5EU6-14373a87.js +1 -0
- package/dist/railroadDiagram-RFXS5EU6-ec9e696e.js +1 -0
- package/dist/railroadDiagram-RFXS5EU6-effa5611.js +1 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/requirementDiagram-TGXJPOKE-3d199581.js +1 -0
- package/dist/requirementDiagram-TGXJPOKE-5a337f1a.js +1 -0
- package/dist/requirementDiagram-TGXJPOKE-a7960859.js +1 -0
- package/dist/sankeyDiagram-HTMAVEWB-209eac30.js +1 -0
- package/dist/sankeyDiagram-HTMAVEWB-3c852fda.js +1 -0
- package/dist/sankeyDiagram-HTMAVEWB-46aa1eb1.js +1 -0
- package/dist/sequenceDiagram-DBY2YBRQ-4121f7c2.js +1 -0
- package/dist/sequenceDiagram-DBY2YBRQ-7bad18e4.js +1 -0
- package/dist/sequenceDiagram-DBY2YBRQ-af96f48e.js +1 -0
- package/dist/sizeCapture-X5ZJPWSS-13826306.js +1 -0
- package/dist/sizeCapture-X5ZJPWSS-32e2eec7.js +1 -0
- package/dist/sizeCapture-X5ZJPWSS-a078176f.js +1 -0
- package/dist/stateDiagram-2N3HPSRC-527374a2.js +1 -0
- package/dist/stateDiagram-2N3HPSRC-8047e124.js +1 -0
- package/dist/stateDiagram-2N3HPSRC-ba344b5d.js +1 -0
- package/dist/stateDiagram-v2-6OUMAXLB-7580bf69.js +1 -0
- package/dist/stateDiagram-v2-6OUMAXLB-d4c58fd3.js +1 -0
- package/dist/stateDiagram-v2-6OUMAXLB-e5921044.js +1 -0
- package/dist/store/constant.d.ts.map +1 -0
- package/dist/swimlanes-5IMT3BWC-5834b232.js +1 -0
- package/dist/swimlanes-5IMT3BWC-791a3547.js +1 -0
- package/dist/swimlanes-5IMT3BWC-db2c593a.js +1 -0
- package/dist/swimlanesDiagram-G3AALYLV-36c30eec.js +1 -0
- package/dist/swimlanesDiagram-G3AALYLV-89220ddd.js +1 -0
- package/dist/swimlanesDiagram-G3AALYLV-b621330d.js +1 -0
- package/dist/timeline-definition-FHXFAJF6-0482a67a.js +1 -0
- package/dist/timeline-definition-FHXFAJF6-1d165a67.js +1 -0
- package/dist/timeline-definition-FHXFAJF6-f9600b97.js +1 -0
- package/dist/treeView-QDETBFTQ-0ecf20cd.js +1 -0
- package/dist/treeView-QDETBFTQ-96ed8e2f.js +1 -0
- package/dist/treemap-6X3UGDF4-0a7f19ca.js +1 -0
- package/dist/treemap-6X3UGDF4-9f498e0c.js +1 -0
- package/dist/types/chart.d.ts.map +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/audioRecording.d.ts.map +1 -0
- package/dist/utils/chartInstanceManager.d.ts.map +1 -0
- package/dist/utils/chartTagParser.d.ts.map +1 -0
- package/dist/utils/chatInputHistory.d.ts.map +1 -0
- package/dist/utils/chatStreamHelper.d.ts.map +1 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/isMobileSignal.d.ts.map +1 -0
- package/dist/utils/transcriptApi.d.ts.map +1 -0
- package/dist/utils/ultimateJsonParser.d.ts.map +1 -0
- package/dist/vennDiagram-L72KCM5P-05176193.js +1 -0
- package/dist/vennDiagram-L72KCM5P-25a48393.js +1 -0
- package/dist/vennDiagram-L72KCM5P-28cffef7.js +1 -0
- package/dist/wardley-OPB4EBWU-08c5f013.js +1 -0
- package/dist/wardley-OPB4EBWU-9803a1d9.js +1 -0
- package/dist/wardleyDiagram-EHGQE667-052e6de9.js +1 -0
- package/dist/wardleyDiagram-EHGQE667-6a614fd9.js +1 -0
- package/dist/wardleyDiagram-EHGQE667-d11fe904.js +1 -0
- package/dist/web-25bb78b9.js +1 -0
- package/dist/web-753300e1.js +1 -0
- package/dist/web-c3ed22c4.js +1 -0
- package/dist/web.d.ts.map +1 -0
- package/dist/web.js +1 -1
- package/dist/window.d.ts.map +1 -0
- package/dist/xychartDiagram-FW5EYKEG-43118b83.js +1 -0
- package/dist/xychartDiagram-FW5EYKEG-d77187fe.js +1 -0
- package/dist/xychartDiagram-FW5EYKEG-f2fac492.js +1 -0
- package/package.json +86 -86
- package/server.js +477 -477
- package/.idea/flowise-chatbox.iml +0 -10
- package/.idea/modules.xml +0 -8
- package/.idea/workspace.xml +0 -4
- package/docs/embedding-style-guide.md +0 -417
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t,e;(t=self.document)&&!t.getElementById("livereloadscript")&&((e=t.createElement("script")).async=1,e.src="//"+(self.location.host||"localhost").split(":")[0]+":35729/livereload.js?snipver=1",e.id="livereloadscript",t.getElementsByTagName("head")[0].appendChild(e));import{_ as a,j as r,V as s,m as l}from"./mermaid.core-2d237a1e.js";var i=a((t,e)=>{var a=t.append("rect");if(a.attr("x",e.x),a.attr("y",e.y),a.attr("fill",e.fill),a.attr("stroke",e.stroke),a.attr("width",e.width),a.attr("height",e.height),e.name&&a.attr("name",e.name),e.rx&&a.attr("rx",e.rx),e.ry&&a.attr("ry",e.ry),void 0!==e.attrs)for(var r in e.attrs)a.attr(r,e.attrs[r]);return e.class&&a.attr("class",e.class),a},"drawRect"),d=a((t,e)=>{e={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"},i(t,e).lower()},"drawBackgroundRect"),o=a((t,e)=>{var a=e.text.replace(s," "),r=((t=t.append("text")).attr("x",e.x),t.attr("y",e.y),t.attr("class","legend"),t.style("text-anchor",e.anchor),e.class&&t.attr("class",e.class),t.append("tspan"));return r.attr("x",e.x+2*e.textMargin),r.text(a),t},"drawText"),n=a((t,e,a,r)=>{(t=t.append("image")).attr("x",e),t.attr("y",a),e=l(r),t.attr("xlink:href",e)},"drawImage"),p=a((t,e,a,r)=>{(t=t.append("use")).attr("x",e),t.attr("y",a),e=l(r),t.attr("xlink:href","#"+e)},"drawEmbeddedImage"),x=a(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),y=a(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),c=a(()=>{let t=r(".mermaidTooltip");return t.empty()?r("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100"):t},"createTooltip");export{y as a,d as b,c,i as d,p as e,n as f,x as g,o as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e,n;(e=self.document)&&!e.getElementById("livereloadscript")&&((n=e.createElement("script")).async=1,n.src="//"+(self.location.host||"localhost").split(":")[0]+":35729/livereload.js?snipver=1",n.id="livereloadscript",e.getElementsByTagName("head")[0].appendChild(n));import{_ as l}from"./mermaid.core-2d237a1e.js";var t=l(()=>"\n /* Font Awesome icon styling - consolidated */\n .label-icon {\n display: inline-block;\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n }\n \n .node .label-icon path {\n fill: currentColor;\n stroke: revert;\n stroke-width: revert;\n }\n","getIconStyles");export{t as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as n}from"./mermaid.core-8797d6a9.js";var e=n((()=>"\n /* Font Awesome icon styling - consolidated */\n .label-icon {\n display: inline-block;\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n }\n \n .node .label-icon path {\n fill: currentColor;\n stroke: revert;\n stroke-width: revert;\n }\n"),"getIconStyles");export{e as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e,n;(e=self.document)&&!e.getElementById("livereloadscript")&&((n=e.createElement("script")).async=1,n.src="//"+(self.location.host||"localhost").split(":")[0]+":35729/livereload.js?snipver=1",n.id="livereloadscript",e.getElementsByTagName("head")[0].appendChild(n));import{_ as l}from"./mermaid.core-70d5aead.js";var t=l(()=>"\n /* Font Awesome icon styling - consolidated */\n .label-icon {\n display: inline-block;\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n }\n \n .node .label-icon path {\n fill: currentColor;\n stroke: revert;\n stroke-width: revert;\n }\n","getIconStyles");export{t as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as t}from"./chunk-XXDRQBXY-3c9d8bf9.js";import{s as e}from"./chunk-VR4S4FIN-c4f2681d.js";import{_ as s,g as i,s as n,b as r,c as o,n as a,o as l,d as c,l as h,U as d,e as u,v as p,j as y,t as g,B as m,u as f}from"./mermaid.core-8797d6a9.js";import{c as S}from"./chunk-32BRIVSS-10123eba.js";var k=function(){var t=s((function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s}),"o"),e=[1,2],i=[1,3],n=[1,4],r=[2,4],o=[1,9],a=[1,11],l=[1,16],c=[1,17],h=[1,18],d=[1,19],u=[1,33],p=[1,20],y=[1,21],g=[1,22],m=[1,23],f=[1,24],S=[1,26],k=[1,27],b=[1,28],T=[1,29],_=[1,30],E=[1,31],x=[1,32],C=[1,35],D=[1,36],v=[1,37],$=[1,38],I=[1,34],A=[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],L=[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],w=[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];e={trace:s((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"--\x3e":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"--\x3e",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:s((function(t,e,s,i,n,r,o){var a=r.length-1;switch(n){case 3:return i.setRootDoc(r[a]),r[a];case 4:this.$=[];break;case 5:"nl"!=r[a]&&(r[a-1].push(r[a]),this.$=r[a-1]);break;case 6:case 7:case 12:this.$=r[a];break;case 8:this.$="nl";break;case 13:(c=r[a-1]).description=i.trimColon(r[a]),this.$=c;break;case 14:this.$={stmt:"relation",state1:r[a-2],state2:r[a]};break;case 15:c=i.trimColon(r[a]),this.$={stmt:"relation",state1:r[a-3],state2:r[a-1],description:c};break;case 19:this.$={stmt:"state",id:r[a-3],type:"default",description:"",doc:r[a-1]};break;case 20:var l,c=r[a],h=r[a-2].trim();r[a].match(":")&&(c=(l=r[a].split(":"))[0],h=[h,l[1]]),this.$={stmt:"state",id:c,type:"default",description:h};break;case 21:this.$={stmt:"state",id:r[a-3],type:"default",description:r[a-5],doc:r[a-1]};break;case 22:this.$={stmt:"state",id:r[a],type:"fork"};break;case 23:this.$={stmt:"state",id:r[a],type:"join"};break;case 24:this.$={stmt:"state",id:r[a],type:"choice"};break;case 25:this.$={stmt:"state",id:i.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:r[a-1].trim(),note:{position:r[a-2].trim(),text:r[a].trim()}};break;case 29:this.$=r[a].trim(),i.setAccTitle(this.$);break;case 30:case 31:this.$=r[a].trim(),i.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:r[a-3],url:r[a-2],tooltip:r[a-1]};break;case 33:this.$={stmt:"click",id:r[a-3],url:r[a-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:r[a-1].trim(),classes:r[a].trim()};break;case 36:this.$={stmt:"style",id:r[a-1].trim(),styleClass:r[a].trim()};break;case 37:this.$={stmt:"applyClass",id:r[a-1].trim(),styleClass:r[a].trim()};break;case 38:i.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:i.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:i.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:i.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:r[a].trim(),type:"default",description:""};break;case 46:case 47:this.$={stmt:"state",id:r[a-2].trim(),classes:[r[a].trim()],type:"default",description:""}}}),"anonymous"),table:[{3:1,4:e,5:i,6:n},{1:[3]},{3:5,4:e,5:i,6:n},{3:6,4:e,5:i,6:n},t([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],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,22:d,24:u,25:p,26:y,27:g,28:m,29:f,32:25,33:S,35:k,37:b,38:T,41:_,45:E,48:x,51:C,52:D,53:v,54:$,57:I},t(A,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:l,17:c,19:h,22:d,24:u,25:p,26:y,27:g,28:m,29:f,32:25,33:S,35:k,37:b,38:T,41:_,45:E,48:x,51:C,52:D,53:v,54:$,57:I},t(A,[2,7]),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(A,[2,11]),t(A,[2,12],{14:[1,40],15:[1,41]}),t(A,[2,16]),{18:[1,42]},t(A,[2,18],{20:[1,43]}),{23:[1,44]},t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(A,[2,28]),{34:[1,49]},{36:[1,50]},t(A,[2,31]),{13:51,24:u,57:I},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(L,[2,44],{58:[1,56]}),t(L,[2,45],{58:[1,57]}),t(A,[2,38]),t(A,[2,39]),t(A,[2,40]),t(A,[2,41]),t(A,[2,6]),t(A,[2,13]),{13:58,24:u,57:I},t(A,[2,17]),t(w,r,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(A,[2,29]),t(A,[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]},t(A,[2,14],{14:[1,71]}),{4:o,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,21:[1,72],22:d,24:u,25:p,26:y,27:g,28:m,29:f,32:25,33:S,35:k,37:b,38:T,41:_,45:E,48:x,51:C,52:D,53:v,54:$,57:I},t(A,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(A,[2,34]),t(A,[2,35]),t(A,[2,36]),t(A,[2,37]),t(L,[2,46]),t(L,[2,47]),t(A,[2,15]),t(A,[2,19]),t(w,r,{7:78}),t(A,[2,26]),t(A,[2,27]),{5:[1,79]},{5:[1,80]},{4:o,5:a,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,21:[1,81],22:d,24:u,25:p,26:y,27:g,28:m,29:f,32:25,33:S,35:k,37:b,38:T,41:_,45:E,48:x,51:C,52:D,53:v,54:$,57:I},t(A,[2,32]),t(A,[2,33]),t(A,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:s((function(t,e){var s;if(!e.recoverable)throw(s=new Error(t)).hash=e,s;this.trace(t)}),"parseError"),parse:s((function(t){var e,i=this,n=[0],r=[],o=[null],a=[],l=this.table,c="",h=0,d=0,u=a.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,e)&&(y.yy[e]=this.yy[e]);p.setInput(t,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var g=p.yylloc,m=(a.push(g),p.options&&p.options.ranges);function f(){var t=r.pop()||p.lex()||1;return"number"!=typeof t&&(t instanceof Array&&(t=(r=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,s((function(t){n.length=n.length-2*t,o.length=o.length-t,a.length=a.length-t}),"popStack"),s(f,"lex");for(var S,k,b,T,_,E,x={};;){if(k=n[n.length-1],void 0===(b=this.defaultActions[k]||(null==S&&(S=f()),l[k]&&l[k][S]))||!b.length||!b[0]){var C,D=[];for(T in l[k])this.terminals_[T]&&2<T&&D.push("'"+this.terminals_[T]+"'");C=p.showPosition?"Parse error on line "+(h+1)+":\n"+p.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[S]||S)+"'":"Parse error on line "+(h+1)+": Unexpected "+(1==S?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(C,{text:p.match,token:this.terminals_[S]||S,line:p.yylineno,loc:g,expected:D})}if(b[0]instanceof Array&&1<b.length)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+S);switch(b[0]){case 1:n.push(S),o.push(p.yytext),a.push(p.yylloc),n.push(b[1]),S=null,d=p.yyleng,c=p.yytext,h=p.yylineno,g=p.yylloc;break;case 2:if(_=this.productions_[b[1]][1],x.$=o[o.length-_],x._$={first_line:a[a.length-(_||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(_||1)].first_column,last_column:a[a.length-1].last_column},m&&(x._$.range=[a[a.length-(_||1)].range[0],a[a.length-1].range[1]]),void 0!==(E=this.performAction.apply(x,[c,d,h,y.yy,b[1],o,a].concat(u))))return E;_&&(n=n.slice(0,-1*_*2),o=o.slice(0,-1*_),a=a.slice(0,-1*_)),n.push(this.productions_[b[1]][0]),o.push(x.$),a.push(x._$),E=l[n[n.length-2]][n[n.length-1]],n.push(E);break;case 3:return!0}}return!0}),"parse")},i={EOF:1,parseError:s((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:s((function(t,e){return this.yy=e||this.yy||{},this._input=t,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:s((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:s((function(t){var e=t.length,s=t.split(/(?:\r\n?|\n)/g),i=(this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e,t=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),s.length-1&&(this.yylineno-=s.length-1),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:s?(s.length===t.length?this.yylloc.first_column:0)+t[t.length-s.length].length-s[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:s((function(){return this._more=!0,this}),"more"),reject:s((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:s((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:s((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(20<t.length?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:s((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(20<t.length?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:s((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:s((function(t,e){var s,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges)&&(i.yylloc.range=this.yylloc.range.slice(0)),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack)for(var n in i)this[n]=i[n];return!1}),"test_match"),next:s((function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var t,e,s,i,n=this._currentRules(),r=0;r<n.length;r++)if((s=this._input.match(this.rules[n[r]]))&&(!e||s[0].length>e[0].length))if(e=s,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,n[r])))return t;if(!this._backtrack)return!1;e=!1}else if(!this.options.flex)break;return e?!1!==(t=this.test_match(e,n[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:s((function(){return this.next()||this.lex()}),"lex"),begin:s((function(t){this.conditionStack.push(t)}),"begin"),popState:s((function(){return 0<this.conditionStack.length-1?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:s((function(){return(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]]:this.conditions.INITIAL).rules}),"_currentRules"),topState:s((function(t){return 0<=(t=this.conditionStack.length-1-Math.abs(t||0))?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:s((function(t){this.begin(t)}),"pushState"),stateStackSize:s((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:s((function(t,e,i,n){function r(){var s,i=e.yytext.indexOf("%%");return 0!==i&&(0<i&&(s=e.yytext.slice(0,i),(i=e.yytext.slice(i))&&t.lexer.unput(i),e.yytext=s),!0)}switch(s(r,"processId"),i){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:case 43:return 51;case 5:case 44:return 52;case 6:case 45:return 53;case 7:case 46:return 54;case 8:case 78:return 5;case 9:case 10:case 11:case 12:case 57:case 63:break;case 13:case 33:return this.pushState("SCALE"),17;case 14:case 34:return 18;case 15:case 21:case 35:case 50:case 54:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 36:this.pushState("STATE");break;case 37:case 40:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),25;case 38:case 41:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),26;case 39:case 42:return this.popState(),e.yytext=e.yytext.slice(0,-10).trim(),27;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:case 65:return r()?(this.popState(),"ID"):void 0;case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+e.yytext.trim()+'"');case 53:return 19;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 64:return"NOTE_TEXT";case 66:return r()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 67:return this.popState(),e.yytext=e.yytext.substr(2).trim(),31;case 68:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),31;case 69:case 70:return 6;case 71:return 16;case 72:return 57;case 73:return r()?24:void 0;case 74:return e.yytext=e.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 79:return"INVALID"}}),"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\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,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/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]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}};function N(){this.yy={}}return e.lexer=i,s(N,"Parser"),new((N.prototype=e).Parser=N)}(),b=k.parser=k,T="state",_="root",E="relation",x="default",C="divider",D="fill:none",v="fill: #333",$="markdown",I="normal",A="rect",L="rectWithTitle",w="divider",N="roundedWithTitle",O="statediagram",R=O+"-state",B="transition",F=B+" note-edge",P=O+"-note",Y=O+"-cluster",G=O+"-cluster-alt",j="parent",z="note",W="----",M=""+W+z,U=""+W+j,X=s(((t,e="TB")=>{if(!t.doc)return e;let s=e;for(const e of t.doc)"dir"===e.stmt&&(s=e.value);return s}),"getDir"),H={getClasses:s((function(t,e){return e.db.getClasses()}),"getClasses"),draw:s((async function(s,i,n,r){h.info("REF0:"),h.info("Drawing state diagram (v2)",i);var{securityLevel:o,state:a,layout:l}=c();r.db.extract(r.db.getRootDocV2());const d=r.db.getData(),u=t(i,o);d.type=r.type,d.layoutAlgorithm=l,d.nodeSpacing=a?.nodeSpacing||50,d.rankSpacing=a?.rankSpacing||50,"neo"===c().look?d.markers=["barbNeo"]:d.markers=["barb"],d.diagramId=i,await m(d,u);try{("function"==typeof r.db.getLinks?r.db.getLinks():new Map).forEach(((t,e)=>{const s="string"==typeof e?e:"string"==typeof e?.id?e.id:"",i=d.nodes.find((t=>t.id===s));if(s){var n,r,o=u.node()?.querySelectorAll("g.node, g.rough-node");let e;o?.forEach((t=>{var n=t.textContent?.trim();t.id!==i?.domId&&n!==s||(e=t)})),e?(o=e.parentNode)?(n=document.createElementNS("http://www.w3.org/2000/svg","a"),r=t.url.replace(/^"+|"+$/g,""),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r),n.setAttribute("target","_blank"),t.tooltip&&(r=t.tooltip.replace(/^"+|"+$/g,""),n.setAttribute("title",r),e.setAttribute("title",r)),o.replaceChild(n,e),n.appendChild(e),h.info("🔗 Wrapped node in <a> tag for:",s,t.url)):h.warn("⚠️ Node has no parent, cannot wrap:",s):h.warn("⚠️ Could not find node matching text:",s)}else h.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(e))}))}catch(s){h.error("❌ Error injecting clickable links:",s)}f.insertTitle(u,"statediagramTitleText",a?.titleTopMargin??25,r.db.getDiagramTitle()),e(u,8,O,a?.useMaxWidth??!0)}),"draw"),getDir:X},V=new Map,J=0;function K(t="",e=0,s="",i=W){return`state-${t}${i=null!==s&&0<s.length?""+i+s:""}-`+e}s(K,"stateDomId");var q=s(((t,e,s,i,n,r,o,a)=>{h.trace("items",e),e.forEach((e=>{switch(e.stmt){case T:case x:st(t,e,s,i,n,r,o,a);break;case E:st(t,e.state1,s,i,n,r,o,a),st(t,e.state2,s,i,n,r,o,a);var l={id:"edge"+J,start:e.state1.id,end:e.state2.id,arrowhead:"normal",arrowTypeEnd:"neo"===o?"arrow_barb_neo":"arrow_barb",style:D,labelStyle:"",label:u.sanitizeText(e.description??"",c()),arrowheadStyle:v,labelpos:"c",labelType:$,thickness:I,classes:B,look:o};n.push(l),J++}}))}),"setupDoc"),Q=s(((t,e="TB")=>{let s=e;if(t.doc)for(const e of t.doc)"dir"===e.stmt&&(s=e.value);return s}),"getDir");function Z(t,e,s){var i;e.id&&"</join></fork>"!==e.id&&"</choice>"!==e.id&&(e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach((t=>{(t=s.get(t))&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...t.styles])}))),(i=t.find((t=>t.id===e.id)))?Object.assign(i,e):t.push(e))}function tt(t){return t?.classes?.join(" ")??""}function et(t){return t?.styles??[]}s(Z,"insertOrUpdateNode"),s(tt,"getClassesFromDbInfo"),s(et,"getStylesFromDbInfo");var st=s(((t,e,s,i,n,r,o,a)=>{var l=e.id,d=s.get(l),p=tt(d),y=et(d),g=c();if(h.info("dataFetcher parsedItem",e,d,y),"root"!==l){let s=A;if(!0===e.start?s="stateStart":!1===e.start&&(s="stateEnd"),e.type!==x&&(s=e.type),V.get(l)||V.set(l,{id:l,shape:s,description:u.sanitizeText(l,g),cssClasses:p+" "+R,cssStyles:y}),d=V.get(l),e.description&&(Array.isArray(d.description)?(d.shape=L,d.description.push(e.description)):d.description?.length&&0<d.description.length?(d.shape=L,d.description===l?d.description=[e.description]:d.description=[d.description,e.description]):(d.shape=A,d.description=e.description),d.description=u.sanitizeTextOrArray(d.description,g)),1===d.description?.length&&d.shape===L&&("group"===d.type?d.shape=N:d.shape=A),!d.type&&e.doc&&(h.info("Setting cluster for XCX",l,Q(e)),d.type="group",d.isGroup=!0,d.dir=Q(e),d.explicitDir=e.doc.some((t=>"dir"===t.stmt)),d.shape=e.type===C?w:N,d.cssClasses=d.cssClasses+` ${Y} `+(r?G:"")),(p={labelStyle:"",shape:d.shape,label:d.description,cssClasses:d.cssClasses,cssCompiledStyles:[],cssStyles:d.cssStyles,id:l,dir:d.dir,domId:K(l,J),type:d.type,isGroup:"group"===d.type,padding:8,rx:10,ry:10,look:o,labelType:"markdown"}).shape===w&&(p.label=""),t&&"root"!==t.id&&(h.trace("Setting node ",l," to be child of its parent ",t.id),p.parentId=t.id),p.centerLabel=!0,e.note){y={labelStyle:"",shape:"note",label:e.note.text,labelType:"markdown",cssClasses:P,cssStyles:[],cssCompiledStyles:[],id:l+M+"-"+J,domId:K(l,J,z),type:d.type,isGroup:"group"===d.type,padding:g.flowchart?.padding,look:o,position:e.note.position},t=l+U,g={labelStyle:"",shape:"noteGroup",label:e.note.text,cssClasses:d.cssClasses,cssStyles:[],id:l+U,domId:K(l,J,j),type:"group",isGroup:!0,padding:16,look:o,position:e.note.position},J++,y.parentId=g.id=t,Z(i,g,a),Z(i,y,a),Z(i,p,a);let s=l,r=y.id;"left of"===e.note.position&&(s=y.id,r=l),n.push({id:s+"-"+r,start:s,end:r,arrowhead:"none",arrowTypeEnd:"",style:D,labelStyle:"",classes:F,arrowheadStyle:v,labelpos:"c",labelType:$,thickness:I,look:o})}else Z(i,p,a)}e.doc&&(h.trace("Adding nodes children "),q(e,e.doc,s,i,n,!r,o,a))}),"dataFetcher"),it=s((()=>{V.clear(),J=0}),"reset"),nt="[*]",rt="start",ot="[*]",at="end",lt="color",ct="fill",ht="bgFill",dt=",",ut=s((()=>new Map),"newClassesList"),pt=s((()=>({relations:[],states:new Map,documents:{}})),"newDoc"),yt=s((t=>JSON.parse(JSON.stringify(t))),"clone"),gt=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=ut(),this.documents={root:pt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=i,this.setAccTitle=n,this.getAccDescription=r,this.setAccDescription=o,this.setDiagramTitle=a,this.getDiagramTitle=l,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),this.bindFunctions=this.bindFunctions.bind(this)}static{s(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(t){this.clear(!0);for(const e of Array.isArray(t)?t:t.doc)switch(e.stmt){case T:this.addState(e.id.trim(),e.type,e.doc,e.description,e.note);break;case E:this.addRelation(e.state1,e.state2,e.description);break;case"classDef":this.addStyleClass(e.id.trim(),e.classes);break;case"style":this.handleStyleDef(e);break;case"applyClass":this.setCssClass(e.id.trim(),e.styleClass);break;case"click":this.addLink(e.id,e.url,e.tooltip)}t=this.getStates();var e=c();it(),st(void 0,this.getRootDocV2(),t,this.nodes,this.edges,!0,e.look,this.classes);for(const t of this.nodes)if(Array.isArray(t.label)){if(t.description=t.label.slice(1),t.isGroup&&0<t.description.length)throw new Error(`Group nodes can only have label. Remove the additional description for node [${t.id}]`);t.label=t.label[0]}}handleStyleDef(t){var e,s=t.id.trim().split(","),i=t.styleClass.split(",");for(const t of s){let s=this.getState(t);s||(e=t.trim(),this.addState(e),s=this.getState(e)),s&&(s.styles=i.map((t=>t.replace(/;/g,"")?.trim())))}}setRootDoc(t){h.info("Setting root doc",t),this.rootDoc=t,1===this.version?this.extract(t):this.extract(this.getRootDocV2())}docTranslator(t,e,s){if(e.stmt===E)this.docTranslator(t,e.state1,!0),this.docTranslator(t,e.state2,!1);else if(e.stmt===T&&(e.id===nt?(e.id=t.id+(s?"_start":"_end"),e.start=s):e.id=e.id.trim()),(e.stmt===_||e.stmt===T)&&e.doc){var i,n=[];let s=[];for(const t of e.doc)t.type===C?((i=yt(t)).doc=yt(s),n.push(i),s=[]):s.push(t);0<n.length&&0<s.length&&(t={stmt:T,id:d(),type:"divider",doc:yt(s)},n.push(yt(t)),e.doc=n),e.doc.forEach((t=>this.docTranslator(e,t,!0)))}}getRootDocV2(){return this.docTranslator({id:_,stmt:_},{id:_,stmt:_,doc:this.rootDoc},!0),{id:_,doc:this.rootDoc}}addState(t,e=x,s=void 0,i=void 0,n=void 0,r=void 0,o=void 0,a=void 0){const l=t?.trim();if(this.currentDocument.states.has(l)){if(!(t=this.currentDocument.states.get(l)))throw new Error("State not found: "+l);t.doc||(t.doc=s),t.type||(t.type=e)}else h.info("Adding state ",l,i),this.currentDocument.states.set(l,{stmt:T,id:l,descriptions:[],type:e,doc:s,note:n,classes:[],styles:[],textStyles:[]});if(i&&(h.info("Setting state description",l,i),(Array.isArray(i)?i:[i]).forEach((t=>this.addDescription(l,t.trim())))),n){if(!(t=this.currentDocument.states.get(l)))throw new Error("State not found: "+l);t.note=n,t.note.text=u.sanitizeText(t.note.text,c())}r&&(h.info("Setting state classes",l,r),(Array.isArray(r)?r:[r]).forEach((t=>this.setCssClass(l,t.trim())))),o&&(h.info("Setting state styles",l,o),(Array.isArray(o)?o:[o]).forEach((t=>this.setStyle(l,t.trim())))),a&&(h.info("Setting state styles",l,o),(Array.isArray(a)?a:[a]).forEach((t=>this.setTextStyle(l,t.trim()))))}clear(t){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:pt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=ut(),t||(this.links=new Map,p())}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){h.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,e,s){this.links.set(t,{url:e,tooltip:s}),h.warn("Adding link",t,e,s)}getLinks(){return this.links}startIdIfNeeded(t=""){return t===nt?(this.startEndCount++,""+rt+this.startEndCount):t}startTypeIfNeeded(t="",e=x){return t===nt?rt:e}endIdIfNeeded(t=""){return t===ot?(this.startEndCount++,""+at+this.startEndCount):t}endTypeIfNeeded(t="",e=x){return t===ot?at:e}addRelationObjs(t,e,s=""){var i=this.startIdIfNeeded(t.id.trim()),n=this.startTypeIfNeeded(t.id.trim(),t.type),r=this.startIdIfNeeded(e.id.trim()),o=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(i,n,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(r,o,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:i,id2:r,relationTitle:u.sanitizeText(s,c())})}addRelation(t,e,s){var i,n;"object"==typeof t&&"object"==typeof e?this.addRelationObjs(t,e,s):"string"==typeof t&&"string"==typeof e&&(i=this.startIdIfNeeded(t.trim()),t=this.startTypeIfNeeded(t),n=this.endIdIfNeeded(e.trim()),e=this.endTypeIfNeeded(e),this.addState(i,t),this.addState(n,e),this.currentDocument.relations.push({id1:i,id2:n,relationTitle:s?u.sanitizeText(s,c()):void 0}))}addDescription(t,e){t=this.currentDocument.states.get(t),e=e.startsWith(":")?e.replace(":","").trim():e,t?.descriptions?.push(u.sanitizeText(e,c()))}cleanupLabel(t){return(t.startsWith(":")?t.slice(2):t).trim()}getDividerId(){return this.dividerCnt++,"divider-id-"+this.dividerCnt}addStyleClass(t,e=""){this.classes.has(t)||this.classes.set(t,{id:t,styles:[],textStyles:[]});const s=this.classes.get(t);e&&s&&e.split(dt).forEach((t=>{var e=t.replace(/([^;]*);/,"$1").trim();RegExp(lt).exec(t)&&(t=e.replace(ct,ht).replace(lt,ct),s.textStyles.push(t)),s.styles.push(e)}))}getClasses(){return this.classes}setupToolTips(t){const e=S();y(t).select("svg").selectAll("g.node, g.rough-node").on("mouseover",(t=>{var s=y(t.currentTarget),i=s.attr("title");null!==i&&(t=t.currentTarget?.getBoundingClientRect(),e.transition().duration(200).style("opacity",".9"),e.style("left",window.scrollX+t.left+(t.right-t.left)/2+"px").style("top",window.scrollY+t.bottom+"px"),e.html(g.sanitize(i)),s.classed("hover",!0))})).on("mouseout",(t=>{e.transition().duration(500).style("opacity",0),y(t.currentTarget).classed("hover",!1)}))}setCssClass(t,e){t.split(",").forEach((t=>{let s=this.getState(t);s||(t=t.trim(),this.addState(t),s=this.getState(t)),s?.classes?.push(e)}))}setStyle(t,e){this.getState(t)?.styles?.push(e)}setTextStyle(t,e){this.getState(t)?.textStyles?.push(e)}bindFunctions(t){this.funs.forEach((e=>{e(t)}))}getDirectionStatement(){return this.rootDoc.find((t=>"dir"===t.stmt))}getDirection(){return this.getDirectionStatement()?.value??"TB"}setDirection(t){var e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:"dir",value:t})}trimColon(t){return(t.startsWith(":")?t.slice(1):t).trim()}getData(){var t=c();return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:X(this.getRootDocV2())}}getConfig(){return c().state}},mt=s((t=>`\ndefs [id$="-barbEnd"] {\n fill: ${t.transitionColor};\n stroke: ${t.transitionColor};\n }\ng.stateGroup text {\n fill: ${t.nodeBorder};\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ${t.textColor};\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ${t.stateLabelColor};\n}\n\ng.stateGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.stateGroup line {\n stroke: ${t.lineColor};\n stroke-width: ${t.strokeWidth||1};\n}\n\n.transition {\n stroke: ${t.transitionColor};\n stroke-width: ${t.strokeWidth||1};\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ${t.background};\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n\n text {\n fill: ${t.noteTextColor};\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ${t.labelBackgroundColor};\n opacity: 0.5;\n}\n.edgeLabel {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n}\n.edgeLabel .label text {\n fill: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n.label div .edgeLabel {\n color: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n\n.stateLabel text {\n fill: ${t.stateLabelColor};\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node .fork-join {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node circle.state-end {\n fill: ${t.innerEndBackground};\n stroke: ${t.background};\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ${t.compositeBackground||t.background};\n // stroke: ${t.background};\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ${t.stateBkg||t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth||1}px;\n}\n.node polygon {\n fill: ${t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};;\n stroke-width: ${t.strokeWidth||1}px;\n}\n[id$="-barbEnd"] {\n fill: ${t.lineColor};\n}\n\n.statediagram-cluster rect {\n fill: ${t.compositeTitleBackground};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth||1}px;\n}\n\n.cluster-label, .nodeLabel {\n color: ${t.stateLabelColor};\n // line-height: 1;\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ${t.stateBorder||t.nodeBorder};\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ${t.compositeBackground||t.background};\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ${t.altBackground||"#efefef"};\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ${t.altBackground||"#efefef"};\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ${t.noteTextColor};\n}\n\n.statediagram-note .nodeLabel {\n color: ${t.noteTextColor};\n}\n.statediagram .edgeLabel {\n color: red; // ${t.noteTextColor};\n}\n\n[id$="-dependencyStart"], [id$="-dependencyEnd"] {\n fill: ${t.lineColor};\n stroke: ${t.lineColor};\n stroke-width: ${t.strokeWidth||1};\n}\n\n.statediagramTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n\n[data-look="neo"].statediagram-cluster rect {\n fill: ${t.mainBkg};\n stroke: ${t.useGradient?"url("+t.svgId+"-gradient)":t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth??1};\n}\n[data-look="neo"].statediagram-cluster rect.outer {\n rx: ${t.radius}px;\n ry: ${t.radius}px;\n filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"}\n}\n`),"getStyles");export{gt as S,mt as a,H as b,b as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t,e;(t=self.document)&&!t.getElementById("livereloadscript")&&((e=t.createElement("script")).async=1,e.src="//"+(self.location.host||"localhost").split(":")[0]+":35729/livereload.js?snipver=1",e.id="livereloadscript",t.getElementsByTagName("head")[0].appendChild(e));import{g as s}from"./chunk-XXDRQBXY-f923ffed.js";import{s as i}from"./chunk-VR4S4FIN-9df47127.js";import{_ as n,g as r,s as a,b as o,c as l,n as c,o as h,d,l as u,U as p,e as y,v as g,j as m,t as f,B as S,u as k}from"./mermaid.core-70d5aead.js";import{c as b}from"./chunk-32BRIVSS-10ac68f7.js";var T=(()=>{var t=n(function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s},"o"),e=[1,4],s=[2,4],i=[1,9],r=[1,11],a=[1,16],o=[1,17],l=[1,18],c=[1,19],h=[1,33],d=[1,20],u=[1,21],p=[1,22],y=[1,23],g=[1,24],m=[1,26],f=[1,27],S=[1,28],k=[1,29],b=[1,30],T=[1,31],_=[1,32],E=[1,35],x=[1,36],C=[1,37],v=[1,38],D=[1,34],I=[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],$=[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],A=[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],L={trace:n(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"--\x3e":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"--\x3e",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:n(function(t,e,s,i,n,r,a){var o=r.length-1;switch(n){case 3:return i.setRootDoc(r[o]),r[o];case 4:this.$=[];break;case 5:"nl"!=r[o]&&(r[o-1].push(r[o]),this.$=r[o-1]);break;case 6:case 7:case 12:this.$=r[o];break;case 8:this.$="nl";break;case 13:(c=r[o-1]).description=i.trimColon(r[o]),this.$=c;break;case 14:this.$={stmt:"relation",state1:r[o-2],state2:r[o]};break;case 15:c=i.trimColon(r[o]),this.$={stmt:"relation",state1:r[o-3],state2:r[o-1],description:c};break;case 19:this.$={stmt:"state",id:r[o-3],type:"default",description:"",doc:r[o-1]};break;case 20:var l,c=r[o],h=r[o-2].trim();r[o].match(":")&&(c=(l=r[o].split(":"))[0],h=[h,l[1]]),this.$={stmt:"state",id:c,type:"default",description:h};break;case 21:this.$={stmt:"state",id:r[o-3],type:"default",description:r[o-5],doc:r[o-1]};break;case 22:this.$={stmt:"state",id:r[o],type:"fork"};break;case 23:this.$={stmt:"state",id:r[o],type:"join"};break;case 24:this.$={stmt:"state",id:r[o],type:"choice"};break;case 25:this.$={stmt:"state",id:i.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:r[o-1].trim(),note:{position:r[o-2].trim(),text:r[o].trim()}};break;case 29:this.$=r[o].trim(),i.setAccTitle(this.$);break;case 30:case 31:this.$=r[o].trim(),i.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:r[o-3],url:r[o-2],tooltip:r[o-1]};break;case 33:this.$={stmt:"click",id:r[o-3],url:r[o-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:r[o-1].trim(),classes:r[o].trim()};break;case 36:this.$={stmt:"style",id:r[o-1].trim(),styleClass:r[o].trim()};break;case 37:this.$={stmt:"applyClass",id:r[o-1].trim(),styleClass:r[o].trim()};break;case 38:i.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:i.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:i.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:i.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:r[o].trim(),type:"default",description:""};break;case 46:case 47:this.$={stmt:"state",id:r[o-2].trim(),classes:[r[o].trim()],type:"default",description:""}}},"anonymous"),table:[{3:1,4:L=[1,2],5:w=[1,3],6:e},{1:[3]},{3:5,4:L,5:w,6:e},{3:6,4:L,5:w,6:e},t([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],s,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:i,5:r,8:8,9:10,10:12,11:13,12:14,13:15,16:a,17:o,19:l,22:c,24:h,25:d,26:u,27:p,28:y,29:g,32:25,33:m,35:f,37:S,38:k,41:b,45:T,48:_,51:E,52:x,53:C,54:v,57:D},t(I,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:a,17:o,19:l,22:c,24:h,25:d,26:u,27:p,28:y,29:g,32:25,33:m,35:f,37:S,38:k,41:b,45:T,48:_,51:E,52:x,53:C,54:v,57:D},t(I,[2,7]),t(I,[2,8]),t(I,[2,9]),t(I,[2,10]),t(I,[2,11]),t(I,[2,12],{14:[1,40],15:[1,41]}),t(I,[2,16]),{18:[1,42]},t(I,[2,18],{20:[1,43]}),{23:[1,44]},t(I,[2,22]),t(I,[2,23]),t(I,[2,24]),t(I,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(I,[2,28]),{34:[1,49]},{36:[1,50]},t(I,[2,31]),{13:51,24:h,57:D},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t($,[2,44],{58:[1,56]}),t($,[2,45],{58:[1,57]}),t(I,[2,38]),t(I,[2,39]),t(I,[2,40]),t(I,[2,41]),t(I,[2,6]),t(I,[2,13]),{13:58,24:h,57:D},t(I,[2,17]),t(A,s,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(I,[2,29]),t(I,[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]},t(I,[2,14],{14:[1,71]}),{4:i,5:r,8:8,9:10,10:12,11:13,12:14,13:15,16:a,17:o,19:l,21:[1,72],22:c,24:h,25:d,26:u,27:p,28:y,29:g,32:25,33:m,35:f,37:S,38:k,41:b,45:T,48:_,51:E,52:x,53:C,54:v,57:D},t(I,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(I,[2,34]),t(I,[2,35]),t(I,[2,36]),t(I,[2,37]),t($,[2,46]),t($,[2,47]),t(I,[2,15]),t(I,[2,19]),t(A,s,{7:78}),t(I,[2,26]),t(I,[2,27]),{5:[1,79]},{5:[1,80]},{4:i,5:r,8:8,9:10,10:12,11:13,12:14,13:15,16:a,17:o,19:l,21:[1,81],22:c,24:h,25:d,26:u,27:p,28:y,29:g,32:25,33:m,35:f,37:S,38:k,41:b,45:T,48:_,51:E,52:x,53:C,54:v,57:D},t(I,[2,32]),t(I,[2,33]),t(I,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:n(function(t,e){var s;if(!e.recoverable)throw(s=new Error(t)).hash=e,s;this.trace(t)},"parseError"),parse:n(function(t){var e,s=this,i=[0],r=[],a=[null],o=[],l=this.table,c="",h=0,d=0,u=o.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,e)&&(y.yy[e]=this.yy[e]);p.setInput(t,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var g=p.yylloc,m=(o.push(g),p.options&&p.options.ranges);function f(){var t=r.pop()||p.lex()||1;return"number"!=typeof t&&(t instanceof Array&&(t=(r=t).pop()),t=s.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,n(function(t){i.length=i.length-2*t,a.length=a.length-t,o.length=o.length-t},"popStack"),n(f,"lex");for(var S,k,b,T,_,E,x={};;){if(k=i[i.length-1],void 0===(b=this.defaultActions[k]||(null==S&&(S=f()),l[k]&&l[k][S]))||!b.length||!b[0]){var C,v=[];for(T in l[k])this.terminals_[T]&&2<T&&v.push("'"+this.terminals_[T]+"'");C=p.showPosition?"Parse error on line "+(h+1)+":\n"+p.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[S]||S)+"'":"Parse error on line "+(h+1)+": Unexpected "+(1==S?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(C,{text:p.match,token:this.terminals_[S]||S,line:p.yylineno,loc:g,expected:v})}if(b[0]instanceof Array&&1<b.length)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+S);switch(b[0]){case 1:i.push(S),a.push(p.yytext),o.push(p.yylloc),i.push(b[1]),S=null,d=p.yyleng,c=p.yytext,h=p.yylineno,g=p.yylloc;break;case 2:if(_=this.productions_[b[1]][1],x.$=a[a.length-_],x._$={first_line:o[o.length-(_||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(_||1)].first_column,last_column:o[o.length-1].last_column},m&&(x._$.range=[o[o.length-(_||1)].range[0],o[o.length-1].range[1]]),void 0!==(E=this.performAction.apply(x,[c,d,h,y.yy,b[1],a,o].concat(u))))return E;_&&(i=i.slice(0,-1*_*2),a=a.slice(0,-1*_),o=o.slice(0,-1*_)),i.push(this.productions_[b[1]][0]),a.push(x.$),o.push(x._$),E=l[i[i.length-2]][i[i.length-1]],i.push(E);break;case 3:return!0}}return!0},"parse")},w={EOF:1,parseError:n(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:n(function(t,e){return this.yy=e||this.yy||{},this._input=t,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:n(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:n(function(t){var e=t.length,s=t.split(/(?:\r\n?|\n)/g),i=(this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e,t=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),s.length-1&&(this.yylineno-=s.length-1),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:s?(s.length===t.length?this.yylloc.first_column:0)+t[t.length-s.length].length-s[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:n(function(){return this._more=!0,this},"more"),reject:n(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:n(function(t){this.unput(this.match.slice(t))},"less"),pastInput:n(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(20<t.length?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(20<t.length?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:n(function(t,e){var s,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges)&&(i.yylloc.range=this.yylloc.range.slice(0)),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack)for(var n in i)this[n]=i[n];return!1},"test_match"),next:n(function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var t,e,s,i,n=this._currentRules(),r=0;r<n.length;r++)if((s=this._input.match(this.rules[n[r]]))&&(!e||s[0].length>e[0].length))if(e=s,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,n[r])))return t;if(!this._backtrack)return!1;e=!1}else if(!this.options.flex)break;return e?!1!==(t=this.test_match(e,n[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:n(function(){return this.next()||this.lex()},"lex"),begin:n(function(t){this.conditionStack.push(t)},"begin"),popState:n(function(){return 0<this.conditionStack.length-1?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:n(function(){return(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]]:this.conditions.INITIAL).rules},"_currentRules"),topState:n(function(t){return 0<=(t=this.conditionStack.length-1-Math.abs(t||0))?this.conditionStack[t]:"INITIAL"},"topState"),pushState:n(function(t){this.begin(t)},"pushState"),stateStackSize:n(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:n(function(t,e,s,i){function r(){var s,i=e.yytext.indexOf("%%");return 0!==i&&(0<i&&(s=e.yytext.slice(0,i),(i=e.yytext.slice(i))&&t.lexer.unput(i),e.yytext=s),!0)}switch(n(r,"processId"),s){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:case 43:return 51;case 5:case 44:return 52;case 6:case 45:return 53;case 7:case 46:return 54;case 8:case 78:return 5;case 9:case 10:case 11:case 12:case 57:case 63:break;case 13:case 33:return this.pushState("SCALE"),17;case 14:case 34:return 18;case 15:case 21:case 35:case 50:case 54:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 36:this.pushState("STATE");break;case 37:case 40:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),25;case 38:case 41:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),26;case 39:case 42:return this.popState(),e.yytext=e.yytext.slice(0,-10).trim(),27;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:case 65:return r()?(this.popState(),"ID"):void 0;case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+e.yytext.trim()+'"');case 53:return 19;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 64:return"NOTE_TEXT";case 66:return r()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 67:return this.popState(),e.yytext=e.yytext.substr(2).trim(),31;case 68:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),31;case 69:case 70:return 6;case 71:return 16;case 72:return 57;case 73:return r()?24:void 0;case 74:return e.yytext=e.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\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,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/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]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}};function N(){this.yy={}}return L.lexer=w,n(N,"Parser"),new((N.prototype=L).Parser=N)})(),_=T.parser=T,E="state",x="root",C="relation",v="default",D="divider",I="fill:none",$="fill: #333",A="markdown",L="normal",w="rect",N="rectWithTitle",O="divider",R="roundedWithTitle",B="statediagram",F=B+"-state",P="transition",Y=P+" note-edge",G=B+"-note",j=B+"-cluster",z=B+"-cluster-alt",W="parent",M="note",U="----",X=""+U+M,H=""+U+W,V=n((t,e="TB")=>{if(!t.doc)return e;let s=e;for(var i of t.doc)"dir"===i.stmt&&(s=i.value);return s},"getDir"),J=n(function(t,e){return e.db.getClasses()},"getClasses"),K=n(async function(t,e,n,r){u.info("REF0:"),u.info("Drawing state diagram (v2)",e);var{securityLevel:a,state:o,layout:l}=d();r.db.extract(r.db.getRootDocV2());let c=r.db.getData(),h=s(e,a);c.type=r.type,c.layoutAlgorithm=l,c.nodeSpacing=o?.nodeSpacing||50,c.rankSpacing=o?.rankSpacing||50,"neo"===d().look?c.markers=["barbNeo"]:c.markers=["barb"],c.diagramId=e,await S(c,h);try{("function"==typeof r.db.getLinks?r.db.getLinks():new Map).forEach((t,e)=>{let s="string"==typeof e?e:"string"==typeof e?.id?e.id:"",i=c.nodes.find(t=>t.id===s);if(s){var n,r,a=h.node()?.querySelectorAll("g.node, g.rough-node");let e;a?.forEach(t=>{var n=t.textContent?.trim();t.id!==i?.domId&&n!==s||(e=t)}),e?(a=e.parentNode)?(n=document.createElementNS("http://www.w3.org/2000/svg","a"),r=t.url.replace(/^"+|"+$/g,""),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r),n.setAttribute("target","_blank"),t.tooltip&&(r=t.tooltip.replace(/^"+|"+$/g,""),n.setAttribute("title",r),e.setAttribute("title",r)),a.replaceChild(n,e),n.appendChild(e),u.info("🔗 Wrapped node in <a> tag for:",s,t.url)):u.warn("⚠️ Node has no parent, cannot wrap:",s):u.warn("⚠️ Could not find node matching text:",s)}else u.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(e))})}catch(t){u.error("❌ Error injecting clickable links:",t)}k.insertTitle(h,"statediagramTitleText",o?.titleTopMargin??25,r.db.getDiagramTitle()),i(h,8,B,o?.useMaxWidth??!0)},"draw"),q={getClasses:J,draw:K,getDir:V},Q=new Map,Z=0;function tt(t="",e=0,s="",i=U){return`state-${t}${i=null!==s&&0<s.length?""+i+s:""}-`+e}n(tt,"stateDomId");var et=n((t,e,s,i,n,r,a,o)=>{u.trace("items",e),e.forEach(e=>{switch(e.stmt){case E:case v:at(t,e,s,i,n,r,a,o);break;case C:at(t,e.state1,s,i,n,r,a,o),at(t,e.state2,s,i,n,r,a,o);var l={id:"edge"+Z,start:e.state1.id,end:e.state2.id,arrowhead:"normal",arrowTypeEnd:"neo"===a?"arrow_barb_neo":"arrow_barb",style:I,labelStyle:"",label:y.sanitizeText(e.description??"",d()),arrowheadStyle:$,labelpos:"c",labelType:A,thickness:L,classes:P,look:a};n.push(l),Z++}})},"setupDoc"),st=n((t,e="TB")=>{let s=e;if(t.doc)for(var i of t.doc)"dir"===i.stmt&&(s=i.value);return s},"getDir");function it(t,e,s){var i;e.id&&"</join></fork>"!==e.id&&"</choice>"!==e.id&&(e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(t=>{(t=s.get(t))&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...t.styles])})),(i=t.find(t=>t.id===e.id))?Object.assign(i,e):t.push(e))}function nt(t){return t?.classes?.join(" ")??""}function rt(t){return t?.styles??[]}n(it,"insertOrUpdateNode"),n(nt,"getClassesFromDbInfo"),n(rt,"getStylesFromDbInfo");var at=n((t,e,s,i,n,r,a,o)=>{var l=e.id,c=s.get(l),h=nt(c),p=rt(c),g=d();if(u.info("dataFetcher parsedItem",e,c,p),"root"!==l){let s=w;if(!0===e.start?s="stateStart":!1===e.start&&(s="stateEnd"),e.type!==v&&(s=e.type),Q.get(l)||Q.set(l,{id:l,shape:s,description:y.sanitizeText(l,g),cssClasses:h+" "+F,cssStyles:p}),c=Q.get(l),e.description&&(Array.isArray(c.description)?(c.shape=N,c.description.push(e.description)):c.description?.length&&0<c.description.length?(c.shape=N,c.description===l?c.description=[e.description]:c.description=[c.description,e.description]):(c.shape=w,c.description=e.description),c.description=y.sanitizeTextOrArray(c.description,g)),1===c.description?.length&&c.shape===N&&("group"===c.type?c.shape=R:c.shape=w),!c.type&&e.doc&&(u.info("Setting cluster for XCX",l,st(e)),c.type="group",c.isGroup=!0,c.dir=st(e),c.explicitDir=e.doc.some(t=>"dir"===t.stmt),c.shape=e.type===D?O:R,c.cssClasses=c.cssClasses+` ${j} `+(r?z:"")),(h={labelStyle:"",shape:c.shape,label:c.description,cssClasses:c.cssClasses,cssCompiledStyles:[],cssStyles:c.cssStyles,id:l,dir:c.dir,domId:tt(l,Z),type:c.type,isGroup:"group"===c.type,padding:8,rx:10,ry:10,look:a,labelType:"markdown"}).shape===O&&(h.label=""),t&&"root"!==t.id&&(u.trace("Setting node ",l," to be child of its parent ",t.id),h.parentId=t.id),h.centerLabel=!0,e.note){p={labelStyle:"",shape:"note",label:e.note.text,labelType:"markdown",cssClasses:G,cssStyles:[],cssCompiledStyles:[],id:l+X+"-"+Z,domId:tt(l,Z,M),type:c.type,isGroup:"group"===c.type,padding:g.flowchart?.padding,look:a,position:e.note.position},t=l+H,g={labelStyle:"",shape:"noteGroup",label:e.note.text,cssClasses:c.cssClasses,cssStyles:[],id:l+H,domId:tt(l,Z,W),type:"group",isGroup:!0,padding:16,look:a,position:e.note.position},Z++,p.parentId=g.id=t,it(i,g,o),it(i,p,o),it(i,h,o);let s=l,r=p.id;"left of"===e.note.position&&(s=p.id,r=l),n.push({id:s+"-"+r,start:s,end:r,arrowhead:"none",arrowTypeEnd:"",style:I,labelStyle:"",classes:Y,arrowheadStyle:$,labelpos:"c",labelType:A,thickness:L,look:a})}else it(i,h,o)}e.doc&&(u.trace("Adding nodes children "),et(e,e.doc,s,i,n,!r,a,o))},"dataFetcher"),ot=n(()=>{Q.clear(),Z=0},"reset"),lt="[*]",ct="start",ht="[*]",dt="end",ut="color",pt="fill",yt="bgFill",gt=",",mt=n(()=>new Map,"newClassesList"),ft=n(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),St=n(t=>JSON.parse(JSON.stringify(t)),"clone"),kt=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=mt(),this.documents={root:ft()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=r,this.setAccTitle=a,this.getAccDescription=o,this.setAccDescription=l,this.setDiagramTitle=c,this.getDiagramTitle=h,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),this.bindFunctions=this.bindFunctions.bind(this)}static{n(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(t){for(var e of(this.clear(!0),Array.isArray(t)?t:t.doc))switch(e.stmt){case E:this.addState(e.id.trim(),e.type,e.doc,e.description,e.note);break;case C:this.addRelation(e.state1,e.state2,e.description);break;case"classDef":this.addStyleClass(e.id.trim(),e.classes);break;case"style":this.handleStyleDef(e);break;case"applyClass":this.setCssClass(e.id.trim(),e.styleClass);break;case"click":this.addLink(e.id,e.url,e.tooltip)}t=this.getStates();var s,i=d();for(s of(ot(),at(void 0,this.getRootDocV2(),t,this.nodes,this.edges,!0,i.look,this.classes),this.nodes))if(Array.isArray(s.label)){if(s.description=s.label.slice(1),s.isGroup&&0<s.description.length)throw new Error(`Group nodes can only have label. Remove the additional description for node [${s.id}]`);s.label=s.label[0]}}handleStyleDef(t){var e,s,i=t.id.trim().split(","),n=t.styleClass.split(",");for(e of i){let t=this.getState(e);t||(s=e.trim(),this.addState(s),t=this.getState(s)),t&&(t.styles=n.map(t=>t.replace(/;/g,"")?.trim()))}}setRootDoc(t){u.info("Setting root doc",t),this.rootDoc=t,1===this.version?this.extract(t):this.extract(this.getRootDocV2())}docTranslator(t,e,s){if(e.stmt===C)this.docTranslator(t,e.state1,!0),this.docTranslator(t,e.state2,!1);else if(e.stmt===E&&(e.id===lt?(e.id=t.id+(s?"_start":"_end"),e.start=s):e.id=e.id.trim()),(e.stmt===x||e.stmt===E)&&e.doc){var i,n,r=[];let s=[];for(i of e.doc)i.type===D?((n=St(i)).doc=St(s),r.push(n),s=[]):s.push(i);0<r.length&&0<s.length&&(t={stmt:E,id:p(),type:"divider",doc:St(s)},r.push(St(t)),e.doc=r),e.doc.forEach(t=>this.docTranslator(e,t,!0))}}getRootDocV2(){return this.docTranslator({id:x,stmt:x},{id:x,stmt:x,doc:this.rootDoc},!0),{id:x,doc:this.rootDoc}}addState(t,e=v,s=void 0,i=void 0,n=void 0,r=void 0,a=void 0,o=void 0){let l=t?.trim();if(this.currentDocument.states.has(l)){if(!(t=this.currentDocument.states.get(l)))throw new Error("State not found: "+l);t.doc||(t.doc=s),t.type||(t.type=e)}else u.info("Adding state ",l,i),this.currentDocument.states.set(l,{stmt:E,id:l,descriptions:[],type:e,doc:s,note:n,classes:[],styles:[],textStyles:[]});if(i&&(u.info("Setting state description",l,i),(Array.isArray(i)?i:[i]).forEach(t=>this.addDescription(l,t.trim()))),n){if(!(t=this.currentDocument.states.get(l)))throw new Error("State not found: "+l);t.note=n,t.note.text=y.sanitizeText(t.note.text,d())}r&&(u.info("Setting state classes",l,r),(Array.isArray(r)?r:[r]).forEach(t=>this.setCssClass(l,t.trim()))),a&&(u.info("Setting state styles",l,a),(Array.isArray(a)?a:[a]).forEach(t=>this.setStyle(l,t.trim()))),o&&(u.info("Setting state styles",l,a),(Array.isArray(o)?o:[o]).forEach(t=>this.setTextStyle(l,t.trim())))}clear(t){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:ft()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=mt(),t||(this.links=new Map,g())}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){u.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,e,s){this.links.set(t,{url:e,tooltip:s}),u.warn("Adding link",t,e,s)}getLinks(){return this.links}startIdIfNeeded(t=""){return t===lt?(this.startEndCount++,""+ct+this.startEndCount):t}startTypeIfNeeded(t="",e=v){return t===lt?ct:e}endIdIfNeeded(t=""){return t===ht?(this.startEndCount++,""+dt+this.startEndCount):t}endTypeIfNeeded(t="",e=v){return t===ht?dt:e}addRelationObjs(t,e,s=""){var i=this.startIdIfNeeded(t.id.trim()),n=this.startTypeIfNeeded(t.id.trim(),t.type),r=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(i,n,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(r,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:i,id2:r,relationTitle:y.sanitizeText(s,d())})}addRelation(t,e,s){var i,n;"object"==typeof t&&"object"==typeof e?this.addRelationObjs(t,e,s):"string"==typeof t&&"string"==typeof e&&(i=this.startIdIfNeeded(t.trim()),t=this.startTypeIfNeeded(t),n=this.endIdIfNeeded(e.trim()),e=this.endTypeIfNeeded(e),this.addState(i,t),this.addState(n,e),this.currentDocument.relations.push({id1:i,id2:n,relationTitle:s?y.sanitizeText(s,d()):void 0}))}addDescription(t,e){t=this.currentDocument.states.get(t),e=e.startsWith(":")?e.replace(":","").trim():e,t?.descriptions?.push(y.sanitizeText(e,d()))}cleanupLabel(t){return(t.startsWith(":")?t.slice(2):t).trim()}getDividerId(){return this.dividerCnt++,"divider-id-"+this.dividerCnt}addStyleClass(t,e=""){this.classes.has(t)||this.classes.set(t,{id:t,styles:[],textStyles:[]});let s=this.classes.get(t);e&&s&&e.split(gt).forEach(t=>{var e=t.replace(/([^;]*);/,"$1").trim();RegExp(ut).exec(t)&&(t=e.replace(pt,yt).replace(ut,pt),s.textStyles.push(t)),s.styles.push(e)})}getClasses(){return this.classes}setupToolTips(t){let e=b();m(t).select("svg").selectAll("g.node, g.rough-node").on("mouseover",t=>{var s=m(t.currentTarget),i=s.attr("title");null!==i&&(t=t.currentTarget?.getBoundingClientRect(),e.transition().duration(200).style("opacity",".9"),e.style("left",window.scrollX+t.left+(t.right-t.left)/2+"px").style("top",window.scrollY+t.bottom+"px"),e.html(f.sanitize(i)),s.classed("hover",!0))}).on("mouseout",t=>{e.transition().duration(500).style("opacity",0),m(t.currentTarget).classed("hover",!1)})}setCssClass(t,e){t.split(",").forEach(t=>{let s=this.getState(t);s||(t=t.trim(),this.addState(t),s=this.getState(t)),s?.classes?.push(e)})}setStyle(t,e){this.getState(t)?.styles?.push(e)}setTextStyle(t,e){this.getState(t)?.textStyles?.push(e)}bindFunctions(t){this.funs.forEach(e=>{e(t)})}getDirectionStatement(){return this.rootDoc.find(t=>"dir"===t.stmt)}getDirection(){return this.getDirectionStatement()?.value??"TB"}setDirection(t){var e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:"dir",value:t})}trimColon(t){return(t.startsWith(":")?t.slice(1):t).trim()}getData(){var t=d();return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:V(this.getRootDocV2())}}getConfig(){return d().state}},bt=n(t=>`\ndefs [id$="-barbEnd"] {\n fill: ${t.transitionColor};\n stroke: ${t.transitionColor};\n }\ng.stateGroup text {\n fill: ${t.nodeBorder};\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ${t.textColor};\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ${t.stateLabelColor};\n}\n\ng.stateGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.stateGroup line {\n stroke: ${t.lineColor};\n stroke-width: ${t.strokeWidth||1};\n}\n\n.transition {\n stroke: ${t.transitionColor};\n stroke-width: ${t.strokeWidth||1};\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ${t.background};\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n\n text {\n fill: ${t.noteTextColor};\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ${t.labelBackgroundColor};\n opacity: 0.5;\n}\n.edgeLabel {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n}\n.edgeLabel .label text {\n fill: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n.label div .edgeLabel {\n color: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n\n.stateLabel text {\n fill: ${t.stateLabelColor};\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node .fork-join {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node circle.state-end {\n fill: ${t.innerEndBackground};\n stroke: ${t.background};\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ${t.compositeBackground||t.background};\n // stroke: ${t.background};\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ${t.stateBkg||t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth||1}px;\n}\n.node polygon {\n fill: ${t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};;\n stroke-width: ${t.strokeWidth||1}px;\n}\n[id$="-barbEnd"] {\n fill: ${t.lineColor};\n}\n\n.statediagram-cluster rect {\n fill: ${t.compositeTitleBackground};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth||1}px;\n}\n\n.cluster-label, .nodeLabel {\n color: ${t.stateLabelColor};\n // line-height: 1;\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ${t.stateBorder||t.nodeBorder};\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ${t.compositeBackground||t.background};\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ${t.altBackground||"#efefef"};\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ${t.altBackground||"#efefef"};\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ${t.noteTextColor};\n}\n\n.statediagram-note .nodeLabel {\n color: ${t.noteTextColor};\n}\n.statediagram .edgeLabel {\n color: red; // ${t.noteTextColor};\n}\n\n[id$="-dependencyStart"], [id$="-dependencyEnd"] {\n fill: ${t.lineColor};\n stroke: ${t.lineColor};\n stroke-width: ${t.strokeWidth||1};\n}\n\n.statediagramTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n\n[data-look="neo"].statediagram-cluster rect {\n fill: ${t.mainBkg};\n stroke: ${t.useGradient?"url("+t.svgId+"-gradient)":t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth??1};\n}\n[data-look="neo"].statediagram-cluster rect.outer {\n rx: ${t.radius}px;\n ry: ${t.radius}px;\n filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"}\n}\n`,"getStyles"),Tt=bt;export{kt as S,Tt as a,q as b,_ as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t,e;(t=self.document)&&!t.getElementById("livereloadscript")&&((e=t.createElement("script")).async=1,e.src="//"+(self.location.host||"localhost").split(":")[0]+":35729/livereload.js?snipver=1",e.id="livereloadscript",t.getElementsByTagName("head")[0].appendChild(e));import{g as s}from"./chunk-XXDRQBXY-de00e988.js";import{s as i}from"./chunk-VR4S4FIN-5feb7571.js";import{_ as n,g as r,s as a,b as o,c as l,n as c,o as h,d,l as u,U as p,e as y,v as g,j as m,t as f,B as S,u as k}from"./mermaid.core-2d237a1e.js";import{c as b}from"./chunk-32BRIVSS-8a8507a2.js";var T=(()=>{var t=n(function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s},"o"),e=[1,4],s=[2,4],i=[1,9],r=[1,11],a=[1,16],o=[1,17],l=[1,18],c=[1,19],h=[1,33],d=[1,20],u=[1,21],p=[1,22],y=[1,23],g=[1,24],m=[1,26],f=[1,27],S=[1,28],k=[1,29],b=[1,30],T=[1,31],_=[1,32],E=[1,35],x=[1,36],C=[1,37],v=[1,38],D=[1,34],I=[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],$=[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],A=[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],L={trace:n(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"--\x3e":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"--\x3e",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:n(function(t,e,s,i,n,r,a){var o=r.length-1;switch(n){case 3:return i.setRootDoc(r[o]),r[o];case 4:this.$=[];break;case 5:"nl"!=r[o]&&(r[o-1].push(r[o]),this.$=r[o-1]);break;case 6:case 7:case 12:this.$=r[o];break;case 8:this.$="nl";break;case 13:(c=r[o-1]).description=i.trimColon(r[o]),this.$=c;break;case 14:this.$={stmt:"relation",state1:r[o-2],state2:r[o]};break;case 15:c=i.trimColon(r[o]),this.$={stmt:"relation",state1:r[o-3],state2:r[o-1],description:c};break;case 19:this.$={stmt:"state",id:r[o-3],type:"default",description:"",doc:r[o-1]};break;case 20:var l,c=r[o],h=r[o-2].trim();r[o].match(":")&&(c=(l=r[o].split(":"))[0],h=[h,l[1]]),this.$={stmt:"state",id:c,type:"default",description:h};break;case 21:this.$={stmt:"state",id:r[o-3],type:"default",description:r[o-5],doc:r[o-1]};break;case 22:this.$={stmt:"state",id:r[o],type:"fork"};break;case 23:this.$={stmt:"state",id:r[o],type:"join"};break;case 24:this.$={stmt:"state",id:r[o],type:"choice"};break;case 25:this.$={stmt:"state",id:i.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:r[o-1].trim(),note:{position:r[o-2].trim(),text:r[o].trim()}};break;case 29:this.$=r[o].trim(),i.setAccTitle(this.$);break;case 30:case 31:this.$=r[o].trim(),i.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:r[o-3],url:r[o-2],tooltip:r[o-1]};break;case 33:this.$={stmt:"click",id:r[o-3],url:r[o-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:r[o-1].trim(),classes:r[o].trim()};break;case 36:this.$={stmt:"style",id:r[o-1].trim(),styleClass:r[o].trim()};break;case 37:this.$={stmt:"applyClass",id:r[o-1].trim(),styleClass:r[o].trim()};break;case 38:i.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:i.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:i.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:i.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:r[o].trim(),type:"default",description:""};break;case 46:case 47:this.$={stmt:"state",id:r[o-2].trim(),classes:[r[o].trim()],type:"default",description:""}}},"anonymous"),table:[{3:1,4:L=[1,2],5:w=[1,3],6:e},{1:[3]},{3:5,4:L,5:w,6:e},{3:6,4:L,5:w,6:e},t([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],s,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:i,5:r,8:8,9:10,10:12,11:13,12:14,13:15,16:a,17:o,19:l,22:c,24:h,25:d,26:u,27:p,28:y,29:g,32:25,33:m,35:f,37:S,38:k,41:b,45:T,48:_,51:E,52:x,53:C,54:v,57:D},t(I,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:a,17:o,19:l,22:c,24:h,25:d,26:u,27:p,28:y,29:g,32:25,33:m,35:f,37:S,38:k,41:b,45:T,48:_,51:E,52:x,53:C,54:v,57:D},t(I,[2,7]),t(I,[2,8]),t(I,[2,9]),t(I,[2,10]),t(I,[2,11]),t(I,[2,12],{14:[1,40],15:[1,41]}),t(I,[2,16]),{18:[1,42]},t(I,[2,18],{20:[1,43]}),{23:[1,44]},t(I,[2,22]),t(I,[2,23]),t(I,[2,24]),t(I,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(I,[2,28]),{34:[1,49]},{36:[1,50]},t(I,[2,31]),{13:51,24:h,57:D},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t($,[2,44],{58:[1,56]}),t($,[2,45],{58:[1,57]}),t(I,[2,38]),t(I,[2,39]),t(I,[2,40]),t(I,[2,41]),t(I,[2,6]),t(I,[2,13]),{13:58,24:h,57:D},t(I,[2,17]),t(A,s,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(I,[2,29]),t(I,[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]},t(I,[2,14],{14:[1,71]}),{4:i,5:r,8:8,9:10,10:12,11:13,12:14,13:15,16:a,17:o,19:l,21:[1,72],22:c,24:h,25:d,26:u,27:p,28:y,29:g,32:25,33:m,35:f,37:S,38:k,41:b,45:T,48:_,51:E,52:x,53:C,54:v,57:D},t(I,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(I,[2,34]),t(I,[2,35]),t(I,[2,36]),t(I,[2,37]),t($,[2,46]),t($,[2,47]),t(I,[2,15]),t(I,[2,19]),t(A,s,{7:78}),t(I,[2,26]),t(I,[2,27]),{5:[1,79]},{5:[1,80]},{4:i,5:r,8:8,9:10,10:12,11:13,12:14,13:15,16:a,17:o,19:l,21:[1,81],22:c,24:h,25:d,26:u,27:p,28:y,29:g,32:25,33:m,35:f,37:S,38:k,41:b,45:T,48:_,51:E,52:x,53:C,54:v,57:D},t(I,[2,32]),t(I,[2,33]),t(I,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:n(function(t,e){var s;if(!e.recoverable)throw(s=new Error(t)).hash=e,s;this.trace(t)},"parseError"),parse:n(function(t){var e,s=this,i=[0],r=[],a=[null],o=[],l=this.table,c="",h=0,d=0,u=o.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(e in this.yy)Object.prototype.hasOwnProperty.call(this.yy,e)&&(y.yy[e]=this.yy[e]);p.setInput(t,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var g=p.yylloc,m=(o.push(g),p.options&&p.options.ranges);function f(){var t=r.pop()||p.lex()||1;return"number"!=typeof t&&(t instanceof Array&&(t=(r=t).pop()),t=s.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,n(function(t){i.length=i.length-2*t,a.length=a.length-t,o.length=o.length-t},"popStack"),n(f,"lex");for(var S,k,b,T,_,E,x={};;){if(k=i[i.length-1],void 0===(b=this.defaultActions[k]||(null==S&&(S=f()),l[k]&&l[k][S]))||!b.length||!b[0]){var C,v=[];for(T in l[k])this.terminals_[T]&&2<T&&v.push("'"+this.terminals_[T]+"'");C=p.showPosition?"Parse error on line "+(h+1)+":\n"+p.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[S]||S)+"'":"Parse error on line "+(h+1)+": Unexpected "+(1==S?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(C,{text:p.match,token:this.terminals_[S]||S,line:p.yylineno,loc:g,expected:v})}if(b[0]instanceof Array&&1<b.length)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+S);switch(b[0]){case 1:i.push(S),a.push(p.yytext),o.push(p.yylloc),i.push(b[1]),S=null,d=p.yyleng,c=p.yytext,h=p.yylineno,g=p.yylloc;break;case 2:if(_=this.productions_[b[1]][1],x.$=a[a.length-_],x._$={first_line:o[o.length-(_||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(_||1)].first_column,last_column:o[o.length-1].last_column},m&&(x._$.range=[o[o.length-(_||1)].range[0],o[o.length-1].range[1]]),void 0!==(E=this.performAction.apply(x,[c,d,h,y.yy,b[1],a,o].concat(u))))return E;_&&(i=i.slice(0,-1*_*2),a=a.slice(0,-1*_),o=o.slice(0,-1*_)),i.push(this.productions_[b[1]][0]),a.push(x.$),o.push(x._$),E=l[i[i.length-2]][i[i.length-1]],i.push(E);break;case 3:return!0}}return!0},"parse")},w={EOF:1,parseError:n(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:n(function(t,e){return this.yy=e||this.yy||{},this._input=t,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:n(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:n(function(t){var e=t.length,s=t.split(/(?:\r\n?|\n)/g),i=(this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e,t=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),s.length-1&&(this.yylineno-=s.length-1),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:s?(s.length===t.length?this.yylloc.first_column:0)+t[t.length-s.length].length-s[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:n(function(){return this._more=!0,this},"more"),reject:n(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:n(function(t){this.unput(this.match.slice(t))},"less"),pastInput:n(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(20<t.length?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(20<t.length?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:n(function(t,e){var s,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges)&&(i.yylloc.range=this.yylloc.range.slice(0)),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack)for(var n in i)this[n]=i[n];return!1},"test_match"),next:n(function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var t,e,s,i,n=this._currentRules(),r=0;r<n.length;r++)if((s=this._input.match(this.rules[n[r]]))&&(!e||s[0].length>e[0].length))if(e=s,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,n[r])))return t;if(!this._backtrack)return!1;e=!1}else if(!this.options.flex)break;return e?!1!==(t=this.test_match(e,n[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:n(function(){return this.next()||this.lex()},"lex"),begin:n(function(t){this.conditionStack.push(t)},"begin"),popState:n(function(){return 0<this.conditionStack.length-1?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:n(function(){return(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]]:this.conditions.INITIAL).rules},"_currentRules"),topState:n(function(t){return 0<=(t=this.conditionStack.length-1-Math.abs(t||0))?this.conditionStack[t]:"INITIAL"},"topState"),pushState:n(function(t){this.begin(t)},"pushState"),stateStackSize:n(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:n(function(t,e,s,i){function r(){var s,i=e.yytext.indexOf("%%");return 0!==i&&(0<i&&(s=e.yytext.slice(0,i),(i=e.yytext.slice(i))&&t.lexer.unput(i),e.yytext=s),!0)}switch(n(r,"processId"),s){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:case 43:return 51;case 5:case 44:return 52;case 6:case 45:return 53;case 7:case 46:return 54;case 8:case 78:return 5;case 9:case 10:case 11:case 12:case 57:case 63:break;case 13:case 33:return this.pushState("SCALE"),17;case 14:case 34:return 18;case 15:case 21:case 35:case 50:case 54:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 36:this.pushState("STATE");break;case 37:case 40:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),25;case 38:case 41:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),26;case 39:case 42:return this.popState(),e.yytext=e.yytext.slice(0,-10).trim(),27;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:case 65:return r()?(this.popState(),"ID"):void 0;case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+e.yytext.trim()+'"');case 53:return 19;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 64:return"NOTE_TEXT";case 66:return r()?(this.popState(),this.pushState("NOTE_TEXT"),24):void 0;case 67:return this.popState(),e.yytext=e.yytext.substr(2).trim(),31;case 68:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),31;case 69:case 70:return 6;case 71:return 16;case 72:return 57;case 73:return r()?24:void 0;case 74:return e.yytext=e.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\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,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/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]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}};function N(){this.yy={}}return L.lexer=w,n(N,"Parser"),new((N.prototype=L).Parser=N)})(),_=T.parser=T,E="state",x="root",C="relation",v="default",D="divider",I="fill:none",$="fill: #333",A="markdown",L="normal",w="rect",N="rectWithTitle",O="divider",R="roundedWithTitle",B="statediagram",F=B+"-state",P="transition",Y=P+" note-edge",G=B+"-note",j=B+"-cluster",z=B+"-cluster-alt",W="parent",M="note",U="----",X=""+U+M,H=""+U+W,V=n((t,e="TB")=>{if(!t.doc)return e;let s=e;for(var i of t.doc)"dir"===i.stmt&&(s=i.value);return s},"getDir"),J=n(function(t,e){return e.db.getClasses()},"getClasses"),K=n(async function(t,e,n,r){u.info("REF0:"),u.info("Drawing state diagram (v2)",e);var{securityLevel:a,state:o,layout:l}=d();r.db.extract(r.db.getRootDocV2());let c=r.db.getData(),h=s(e,a);c.type=r.type,c.layoutAlgorithm=l,c.nodeSpacing=o?.nodeSpacing||50,c.rankSpacing=o?.rankSpacing||50,"neo"===d().look?c.markers=["barbNeo"]:c.markers=["barb"],c.diagramId=e,await S(c,h);try{("function"==typeof r.db.getLinks?r.db.getLinks():new Map).forEach((t,e)=>{let s="string"==typeof e?e:"string"==typeof e?.id?e.id:"",i=c.nodes.find(t=>t.id===s);if(s){var n,r,a=h.node()?.querySelectorAll("g.node, g.rough-node");let e;a?.forEach(t=>{var n=t.textContent?.trim();t.id!==i?.domId&&n!==s||(e=t)}),e?(a=e.parentNode)?(n=document.createElementNS("http://www.w3.org/2000/svg","a"),r=t.url.replace(/^"+|"+$/g,""),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r),n.setAttribute("target","_blank"),t.tooltip&&(r=t.tooltip.replace(/^"+|"+$/g,""),n.setAttribute("title",r),e.setAttribute("title",r)),a.replaceChild(n,e),n.appendChild(e),u.info("🔗 Wrapped node in <a> tag for:",s,t.url)):u.warn("⚠️ Node has no parent, cannot wrap:",s):u.warn("⚠️ Could not find node matching text:",s)}else u.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(e))})}catch(t){u.error("❌ Error injecting clickable links:",t)}k.insertTitle(h,"statediagramTitleText",o?.titleTopMargin??25,r.db.getDiagramTitle()),i(h,8,B,o?.useMaxWidth??!0)},"draw"),q={getClasses:J,draw:K,getDir:V},Q=new Map,Z=0;function tt(t="",e=0,s="",i=U){return`state-${t}${i=null!==s&&0<s.length?""+i+s:""}-`+e}n(tt,"stateDomId");var et=n((t,e,s,i,n,r,a,o)=>{u.trace("items",e),e.forEach(e=>{switch(e.stmt){case E:case v:at(t,e,s,i,n,r,a,o);break;case C:at(t,e.state1,s,i,n,r,a,o),at(t,e.state2,s,i,n,r,a,o);var l={id:"edge"+Z,start:e.state1.id,end:e.state2.id,arrowhead:"normal",arrowTypeEnd:"neo"===a?"arrow_barb_neo":"arrow_barb",style:I,labelStyle:"",label:y.sanitizeText(e.description??"",d()),arrowheadStyle:$,labelpos:"c",labelType:A,thickness:L,classes:P,look:a};n.push(l),Z++}})},"setupDoc"),st=n((t,e="TB")=>{let s=e;if(t.doc)for(var i of t.doc)"dir"===i.stmt&&(s=i.value);return s},"getDir");function it(t,e,s){var i;e.id&&"</join></fork>"!==e.id&&"</choice>"!==e.id&&(e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(t=>{(t=s.get(t))&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...t.styles])})),(i=t.find(t=>t.id===e.id))?Object.assign(i,e):t.push(e))}function nt(t){return t?.classes?.join(" ")??""}function rt(t){return t?.styles??[]}n(it,"insertOrUpdateNode"),n(nt,"getClassesFromDbInfo"),n(rt,"getStylesFromDbInfo");var at=n((t,e,s,i,n,r,a,o)=>{var l=e.id,c=s.get(l),h=nt(c),p=rt(c),g=d();if(u.info("dataFetcher parsedItem",e,c,p),"root"!==l){let s=w;if(!0===e.start?s="stateStart":!1===e.start&&(s="stateEnd"),e.type!==v&&(s=e.type),Q.get(l)||Q.set(l,{id:l,shape:s,description:y.sanitizeText(l,g),cssClasses:h+" "+F,cssStyles:p}),c=Q.get(l),e.description&&(Array.isArray(c.description)?(c.shape=N,c.description.push(e.description)):c.description?.length&&0<c.description.length?(c.shape=N,c.description===l?c.description=[e.description]:c.description=[c.description,e.description]):(c.shape=w,c.description=e.description),c.description=y.sanitizeTextOrArray(c.description,g)),1===c.description?.length&&c.shape===N&&("group"===c.type?c.shape=R:c.shape=w),!c.type&&e.doc&&(u.info("Setting cluster for XCX",l,st(e)),c.type="group",c.isGroup=!0,c.dir=st(e),c.explicitDir=e.doc.some(t=>"dir"===t.stmt),c.shape=e.type===D?O:R,c.cssClasses=c.cssClasses+` ${j} `+(r?z:"")),(h={labelStyle:"",shape:c.shape,label:c.description,cssClasses:c.cssClasses,cssCompiledStyles:[],cssStyles:c.cssStyles,id:l,dir:c.dir,domId:tt(l,Z),type:c.type,isGroup:"group"===c.type,padding:8,rx:10,ry:10,look:a,labelType:"markdown"}).shape===O&&(h.label=""),t&&"root"!==t.id&&(u.trace("Setting node ",l," to be child of its parent ",t.id),h.parentId=t.id),h.centerLabel=!0,e.note){p={labelStyle:"",shape:"note",label:e.note.text,labelType:"markdown",cssClasses:G,cssStyles:[],cssCompiledStyles:[],id:l+X+"-"+Z,domId:tt(l,Z,M),type:c.type,isGroup:"group"===c.type,padding:g.flowchart?.padding,look:a,position:e.note.position},t=l+H,g={labelStyle:"",shape:"noteGroup",label:e.note.text,cssClasses:c.cssClasses,cssStyles:[],id:l+H,domId:tt(l,Z,W),type:"group",isGroup:!0,padding:16,look:a,position:e.note.position},Z++,p.parentId=g.id=t,it(i,g,o),it(i,p,o),it(i,h,o);let s=l,r=p.id;"left of"===e.note.position&&(s=p.id,r=l),n.push({id:s+"-"+r,start:s,end:r,arrowhead:"none",arrowTypeEnd:"",style:I,labelStyle:"",classes:Y,arrowheadStyle:$,labelpos:"c",labelType:A,thickness:L,look:a})}else it(i,h,o)}e.doc&&(u.trace("Adding nodes children "),et(e,e.doc,s,i,n,!r,a,o))},"dataFetcher"),ot=n(()=>{Q.clear(),Z=0},"reset"),lt="[*]",ct="start",ht="[*]",dt="end",ut="color",pt="fill",yt="bgFill",gt=",",mt=n(()=>new Map,"newClassesList"),ft=n(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),St=n(t=>JSON.parse(JSON.stringify(t)),"clone"),kt=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=mt(),this.documents={root:ft()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=r,this.setAccTitle=a,this.getAccDescription=o,this.setAccDescription=l,this.setDiagramTitle=c,this.getDiagramTitle=h,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),this.bindFunctions=this.bindFunctions.bind(this)}static{n(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(t){for(var e of(this.clear(!0),Array.isArray(t)?t:t.doc))switch(e.stmt){case E:this.addState(e.id.trim(),e.type,e.doc,e.description,e.note);break;case C:this.addRelation(e.state1,e.state2,e.description);break;case"classDef":this.addStyleClass(e.id.trim(),e.classes);break;case"style":this.handleStyleDef(e);break;case"applyClass":this.setCssClass(e.id.trim(),e.styleClass);break;case"click":this.addLink(e.id,e.url,e.tooltip)}t=this.getStates();var s,i=d();for(s of(ot(),at(void 0,this.getRootDocV2(),t,this.nodes,this.edges,!0,i.look,this.classes),this.nodes))if(Array.isArray(s.label)){if(s.description=s.label.slice(1),s.isGroup&&0<s.description.length)throw new Error(`Group nodes can only have label. Remove the additional description for node [${s.id}]`);s.label=s.label[0]}}handleStyleDef(t){var e,s,i=t.id.trim().split(","),n=t.styleClass.split(",");for(e of i){let t=this.getState(e);t||(s=e.trim(),this.addState(s),t=this.getState(s)),t&&(t.styles=n.map(t=>t.replace(/;/g,"")?.trim()))}}setRootDoc(t){u.info("Setting root doc",t),this.rootDoc=t,1===this.version?this.extract(t):this.extract(this.getRootDocV2())}docTranslator(t,e,s){if(e.stmt===C)this.docTranslator(t,e.state1,!0),this.docTranslator(t,e.state2,!1);else if(e.stmt===E&&(e.id===lt?(e.id=t.id+(s?"_start":"_end"),e.start=s):e.id=e.id.trim()),(e.stmt===x||e.stmt===E)&&e.doc){var i,n,r=[];let s=[];for(i of e.doc)i.type===D?((n=St(i)).doc=St(s),r.push(n),s=[]):s.push(i);0<r.length&&0<s.length&&(t={stmt:E,id:p(),type:"divider",doc:St(s)},r.push(St(t)),e.doc=r),e.doc.forEach(t=>this.docTranslator(e,t,!0))}}getRootDocV2(){return this.docTranslator({id:x,stmt:x},{id:x,stmt:x,doc:this.rootDoc},!0),{id:x,doc:this.rootDoc}}addState(t,e=v,s=void 0,i=void 0,n=void 0,r=void 0,a=void 0,o=void 0){let l=t?.trim();if(this.currentDocument.states.has(l)){if(!(t=this.currentDocument.states.get(l)))throw new Error("State not found: "+l);t.doc||(t.doc=s),t.type||(t.type=e)}else u.info("Adding state ",l,i),this.currentDocument.states.set(l,{stmt:E,id:l,descriptions:[],type:e,doc:s,note:n,classes:[],styles:[],textStyles:[]});if(i&&(u.info("Setting state description",l,i),(Array.isArray(i)?i:[i]).forEach(t=>this.addDescription(l,t.trim()))),n){if(!(t=this.currentDocument.states.get(l)))throw new Error("State not found: "+l);t.note=n,t.note.text=y.sanitizeText(t.note.text,d())}r&&(u.info("Setting state classes",l,r),(Array.isArray(r)?r:[r]).forEach(t=>this.setCssClass(l,t.trim()))),a&&(u.info("Setting state styles",l,a),(Array.isArray(a)?a:[a]).forEach(t=>this.setStyle(l,t.trim()))),o&&(u.info("Setting state styles",l,a),(Array.isArray(o)?o:[o]).forEach(t=>this.setTextStyle(l,t.trim())))}clear(t){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:ft()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=mt(),t||(this.links=new Map,g())}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){u.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,e,s){this.links.set(t,{url:e,tooltip:s}),u.warn("Adding link",t,e,s)}getLinks(){return this.links}startIdIfNeeded(t=""){return t===lt?(this.startEndCount++,""+ct+this.startEndCount):t}startTypeIfNeeded(t="",e=v){return t===lt?ct:e}endIdIfNeeded(t=""){return t===ht?(this.startEndCount++,""+dt+this.startEndCount):t}endTypeIfNeeded(t="",e=v){return t===ht?dt:e}addRelationObjs(t,e,s=""){var i=this.startIdIfNeeded(t.id.trim()),n=this.startTypeIfNeeded(t.id.trim(),t.type),r=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(i,n,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(r,a,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:i,id2:r,relationTitle:y.sanitizeText(s,d())})}addRelation(t,e,s){var i,n;"object"==typeof t&&"object"==typeof e?this.addRelationObjs(t,e,s):"string"==typeof t&&"string"==typeof e&&(i=this.startIdIfNeeded(t.trim()),t=this.startTypeIfNeeded(t),n=this.endIdIfNeeded(e.trim()),e=this.endTypeIfNeeded(e),this.addState(i,t),this.addState(n,e),this.currentDocument.relations.push({id1:i,id2:n,relationTitle:s?y.sanitizeText(s,d()):void 0}))}addDescription(t,e){t=this.currentDocument.states.get(t),e=e.startsWith(":")?e.replace(":","").trim():e,t?.descriptions?.push(y.sanitizeText(e,d()))}cleanupLabel(t){return(t.startsWith(":")?t.slice(2):t).trim()}getDividerId(){return this.dividerCnt++,"divider-id-"+this.dividerCnt}addStyleClass(t,e=""){this.classes.has(t)||this.classes.set(t,{id:t,styles:[],textStyles:[]});let s=this.classes.get(t);e&&s&&e.split(gt).forEach(t=>{var e=t.replace(/([^;]*);/,"$1").trim();RegExp(ut).exec(t)&&(t=e.replace(pt,yt).replace(ut,pt),s.textStyles.push(t)),s.styles.push(e)})}getClasses(){return this.classes}setupToolTips(t){let e=b();m(t).select("svg").selectAll("g.node, g.rough-node").on("mouseover",t=>{var s=m(t.currentTarget),i=s.attr("title");null!==i&&(t=t.currentTarget?.getBoundingClientRect(),e.transition().duration(200).style("opacity",".9"),e.style("left",window.scrollX+t.left+(t.right-t.left)/2+"px").style("top",window.scrollY+t.bottom+"px"),e.html(f.sanitize(i)),s.classed("hover",!0))}).on("mouseout",t=>{e.transition().duration(500).style("opacity",0),m(t.currentTarget).classed("hover",!1)})}setCssClass(t,e){t.split(",").forEach(t=>{let s=this.getState(t);s||(t=t.trim(),this.addState(t),s=this.getState(t)),s?.classes?.push(e)})}setStyle(t,e){this.getState(t)?.styles?.push(e)}setTextStyle(t,e){this.getState(t)?.textStyles?.push(e)}bindFunctions(t){this.funs.forEach(e=>{e(t)})}getDirectionStatement(){return this.rootDoc.find(t=>"dir"===t.stmt)}getDirection(){return this.getDirectionStatement()?.value??"TB"}setDirection(t){var e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:"dir",value:t})}trimColon(t){return(t.startsWith(":")?t.slice(1):t).trim()}getData(){var t=d();return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:V(this.getRootDocV2())}}getConfig(){return d().state}},bt=n(t=>`\ndefs [id$="-barbEnd"] {\n fill: ${t.transitionColor};\n stroke: ${t.transitionColor};\n }\ng.stateGroup text {\n fill: ${t.nodeBorder};\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ${t.textColor};\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ${t.stateLabelColor};\n}\n\ng.stateGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.stateGroup line {\n stroke: ${t.lineColor};\n stroke-width: ${t.strokeWidth||1};\n}\n\n.transition {\n stroke: ${t.transitionColor};\n stroke-width: ${t.strokeWidth||1};\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ${t.background};\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n\n text {\n fill: ${t.noteTextColor};\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ${t.labelBackgroundColor};\n opacity: 0.5;\n}\n.edgeLabel {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n}\n.edgeLabel .label text {\n fill: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n.label div .edgeLabel {\n color: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n\n.stateLabel text {\n fill: ${t.stateLabelColor};\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node .fork-join {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node circle.state-end {\n fill: ${t.innerEndBackground};\n stroke: ${t.background};\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ${t.compositeBackground||t.background};\n // stroke: ${t.background};\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ${t.stateBkg||t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth||1}px;\n}\n.node polygon {\n fill: ${t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};;\n stroke-width: ${t.strokeWidth||1}px;\n}\n[id$="-barbEnd"] {\n fill: ${t.lineColor};\n}\n\n.statediagram-cluster rect {\n fill: ${t.compositeTitleBackground};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth||1}px;\n}\n\n.cluster-label, .nodeLabel {\n color: ${t.stateLabelColor};\n // line-height: 1;\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ${t.stateBorder||t.nodeBorder};\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ${t.compositeBackground||t.background};\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ${t.altBackground||"#efefef"};\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ${t.altBackground||"#efefef"};\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ${t.noteTextColor};\n}\n\n.statediagram-note .nodeLabel {\n color: ${t.noteTextColor};\n}\n.statediagram .edgeLabel {\n color: red; // ${t.noteTextColor};\n}\n\n[id$="-dependencyStart"], [id$="-dependencyEnd"] {\n fill: ${t.lineColor};\n stroke: ${t.lineColor};\n stroke-width: ${t.strokeWidth||1};\n}\n\n.statediagramTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n\n[data-look="neo"].statediagram-cluster rect {\n fill: ${t.mainBkg};\n stroke: ${t.useGradient?"url("+t.svgId+"-gradient)":t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth??1};\n}\n[data-look="neo"].statediagram-cluster rect.outer {\n rx: ${t.radius}px;\n ry: ${t.radius}px;\n filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"}\n}\n`,"getStyles"),Tt=bt;export{kt as S,Tt as a,q as b,_ as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e,t;(e=self.document)&&!e.getElementById("livereloadscript")&&((t=e.createElement("script")).async=1,t.src="//"+(self.location.host||"localhost").split(":")[0]+":35729/livereload.js?snipver=1",t.id="livereloadscript",e.getElementsByTagName("head")[0].appendChild(t));import{_ as c}from"./mermaid.core-70d5aead.js";function i(e,t){e.accDescr&&t.setAccDescription?.(e.accDescr),e.accTitle&&t.setAccTitle?.(e.accTitle),e.title&&t.setDiagramTitle?.(e.title)}c(i,"populateCommonDb");export{i as p};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e,t;(e=self.document)&&!e.getElementById("livereloadscript")&&((t=e.createElement("script")).async=1,t.src="//"+(self.location.host||"localhost").split(":")[0]+":35729/livereload.js?snipver=1",t.id="livereloadscript",e.getElementsByTagName("head")[0].appendChild(t));import{_ as c}from"./mermaid.core-2d237a1e.js";function i(e,t){e.accDescr&&t.setAccDescription?.(e.accDescr),e.accTitle&&t.setAccTitle?.(e.accTitle),e.title&&t.setDiagramTitle?.(e.title)}c(i,"populateCommonDb");export{i as p};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as c}from"./mermaid.core-8797d6a9.js";function e(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}c(e,"populateCommonDb");export{e as p};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e,t;(e=self.document)&&!e.getElementById("livereloadscript")&&((t=e.createElement("script")).async=1,t.src="//"+(self.location.host||"localhost").split(":")[0]+":35729/livereload.js?snipver=1",t.id="livereloadscript",e.getElementsByTagName("head")[0].appendChild(t));import{_ as r,G as i,L as n,v as a,l as o,K as l,i as s,d,k as m}from"./mermaid.core-70d5aead.js";var c="",h="",p="",u=[],g=new Map,T=r(e=>s(e,d()),"sanitizeText"),f=r(e=>{switch(e.type){case"terminal":return{...e,value:T(e.value)};case"nonterminal":return{...e,name:T(e.name)};case"sequence":return{...e,elements:e.elements.map(f)};case"choice":return{...e,alternatives:e.alternatives.map(f)};case"optional":return{...e,element:f(e.element)};case"repetition":return{...e,element:f(e.element),separator:e.separator?f(e.separator):void 0};case"special":return{...e,text:T(e.text)}}},"sanitizeAstNode"),x=r(()=>{p=h=c="",u.length=0,g.clear(),a(),o.debug("[Railroad] Database cleared")},"clear"),w=r(e=>{c=T(e),o.debug("[Railroad] Title set:",e)},"setTitle"),k=r(()=>c,"getTitle"),C=r(e=>{e={...e,name:T(e.name),definition:f(e.definition),comment:e.comment?T(e.comment):void 0},o.debug("[Railroad] Adding rule:",e.name),g.has(e.name)&&o.warn(`[Railroad] Rule '${e.name}' is already defined. Overwriting.`),u.push(e),g.set(e.name,e)},"addRule"),v=r(()=>u,"getRules"),F=r(e=>g.get(e),"getRule"),S=r(e=>{h=T(e).replace(/^\s+/g,""),o.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),y=r(()=>h,"getAccTitle"),$=r(e=>{p=T(e).replace(/\n\s+/g,"\n"),o.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),b={clear:x,setTitle:w,getTitle:k,addRule:C,getRules:v,getRule:F,setAccTitle:S,getAccTitle:y,setAccDescription:$,getAccDescription:r(()=>p,"getAccDescription"),setDiagramTitle:w,getDiagramTitle:k},R={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},z=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,N=/^[\w "',.-]+$/,M=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),A=r(e=>!!e&&Object.keys(e).every(e=>"railroad"===e||M.has(e)),"isRailroadStyleOptions"),B=r(e=>e?"railroad"in e&&e.railroad?e.railroad:A(e)?e:{}:{},"extractRailroadOverrides"),E=r(e=>{if(!e||A(e))return{};let{railroad:t,svgId:r,theme:i,look:n,...a}=e;return a},"extractThemeOverrides"),D=r((e,t)=>"string"==typeof e&&(e=e.trim(),z.test(e))?e:t,"sanitizeColorValue"),O=r((e,t)=>"string"==typeof e&&(e=e.trim(),N.test(e))?e:t,"sanitizeFontFamilyValue"),W=r((e,t)=>(e="number"==typeof e?e:"string"==typeof e?Number.parseFloat(e):Number.NaN,Number.isFinite(e)&&0<=e?e:t),"sanitizeNumberValue"),q=r(e=>(e="number"==typeof e?e:"string"==typeof e?Number.parseFloat(e):Number.NaN,Number.isFinite(e)&&0<e?e:void 0),"parseThemeFontSize"),V=r(e=>{var t=O(e.fontFamily,R.fontFamily),r=q(e.fontSize)??R.fontSize;return{...R,fontFamily:t,fontSize:r,terminalFill:D(e.secondBkg??e.secondaryColor,R.terminalFill),terminalStroke:D(e.secondaryBorderColor??e.lineColor,R.terminalStroke),terminalTextColor:D(e.secondaryTextColor??e.textColor,R.terminalTextColor),nonTerminalFill:D(e.mainBkg??e.background,R.nonTerminalFill),nonTerminalStroke:D(e.primaryBorderColor??e.lineColor,R.nonTerminalStroke),nonTerminalTextColor:D(e.primaryTextColor??e.textColor,R.nonTerminalTextColor),lineColor:D(e.lineColor,R.lineColor),markerFill:D(e.lineColor,R.markerFill),commentFill:D(e.labelBackground??e.tertiaryColor,R.commentFill),commentStroke:D(e.tertiaryBorderColor??e.lineColor,R.commentStroke),commentTextColor:D(e.tertiaryTextColor??e.textColor,R.commentTextColor),specialFill:D(e.tertiaryColor??e.secondaryColor,R.specialFill),specialStroke:D(e.tertiaryBorderColor??e.secondaryBorderColor,R.specialStroke),ruleNameColor:D(e.titleColor??e.textColor,R.ruleNameColor)}},"buildThemeDefaults"),j=r(e=>{var t=i(),r={...n(),...t.themeVariables??{},...E(e)};r=V(r);return{compactMode:(t={...t.railroad??{},...B(e)}).compactMode??r.compactMode,padding:W(t.padding,r.padding),verticalSeparation:W(t.verticalSeparation,r.verticalSeparation),horizontalSeparation:W(t.horizontalSeparation,r.horizontalSeparation),arcRadius:W(t.arcRadius,r.arcRadius),fontSize:W(t.fontSize,r.fontSize),fontFamily:O(t.fontFamily,r.fontFamily),terminalFill:D(t.terminalFill,r.terminalFill),terminalStroke:D(t.terminalStroke,r.terminalStroke),terminalTextColor:D(t.terminalTextColor,r.terminalTextColor),nonTerminalFill:D(t.nonTerminalFill,r.nonTerminalFill),nonTerminalStroke:D(t.nonTerminalStroke,r.nonTerminalStroke),nonTerminalTextColor:D(t.nonTerminalTextColor,r.nonTerminalTextColor),lineColor:D(t.lineColor,r.lineColor),strokeWidth:W(t.strokeWidth,r.strokeWidth),markerFill:D(t.markerFill,r.markerFill),commentFill:D(t.commentFill,r.commentFill),commentStroke:D(t.commentStroke,r.commentStroke),commentTextColor:D(t.commentTextColor,r.commentTextColor),specialFill:D(t.specialFill,r.specialFill),specialStroke:D(t.specialStroke,r.specialStroke),ruleNameColor:D(t.ruleNameColor,r.ruleNameColor),showMarkers:t.showMarkers??r.showMarkers,markerRadius:W(t.markerRadius,r.markerRadius)}},"buildRailroadStyleOptions"),G=r(e=>{var{fontFamily:e,fontSize:t,terminalFill:r,terminalStroke:i,terminalTextColor:n,nonTerminalFill:a,nonTerminalStroke:o,nonTerminalTextColor:l,lineColor:s,strokeWidth:d,markerFill:m,commentFill:c,commentStroke:h,commentTextColor:p,specialFill:u,specialStroke:g,ruleNameColor:T}=j(e);return`\n .railroad-diagram {\n font-family: ${e};\n font-size: ${t}px;\n }\n\n .railroad-terminal rect {\n fill: ${r};\n stroke: ${i};\n stroke-width: ${d}px;\n }\n\n .railroad-terminal text {\n fill: ${n};\n font-family: ${e};\n font-size: ${t}px;\n text-anchor: middle;\n dominant-baseline: middle;\n }\n\n .railroad-nonterminal rect {\n fill: ${a};\n stroke: ${o};\n stroke-width: ${d}px;\n }\n\n .railroad-nonterminal text {\n fill: ${l};\n font-family: ${e};\n font-size: ${t}px;\n text-anchor: middle;\n dominant-baseline: middle;\n }\n\n .railroad-line {\n stroke: ${s};\n stroke-width: ${d}px;\n fill: none;\n }\n\n .railroad-start circle,\n .railroad-end circle {\n fill: ${m};\n }\n\n .railroad-comment ellipse {\n fill: ${c};\n stroke: ${h};\n stroke-width: ${d}px;\n }\n\n .railroad-comment text {\n fill: ${p};\n font-style: italic;\n font-family: ${e};\n font-size: ${t}px;\n text-anchor: middle;\n dominant-baseline: middle;\n }\n\n .railroad-special rect {\n fill: ${u};\n stroke: ${g};\n stroke-width: ${d}px;\n stroke-dasharray: 5,3;\n }\n\n .railroad-special text {\n fill: ${l};\n font-family: ${e};\n font-size: ${t}px;\n text-anchor: middle;\n dominant-baseline: middle;\n }\n\n .railroad-rule-name {\n font-weight: bold;\n fill: ${T};\n font-family: ${e};\n font-size: ${t}px;\n }\n\n .railroad-group {\n /* Grouping container, no specific styles */\n }\n`},"getStyles"),I=class{constructor(){this.d=""}static{r(this,"PathBuilder")}moveTo(e,t){return this.d+=`M ${e} ${t} `,this}lineTo(e,t){return this.d+=`L ${e} ${t} `,this}horizontalTo(e){return this.d+=`H ${e} `,this}verticalTo(e){return this.d+=`V ${e} `,this}arcTo(e,t,r,i,n,a,o){return this.d+=`A ${e} ${t} ${r} ${i?1:0} ${n?1:0} ${a} ${o} `,this}build(){return this.d.trim()}},L=class{constructor(e,t=j()){this.textCache=new Map,this.svg=e,this.config=t}static{r(this,"RailroadRenderer")}measureText(e){var t,r;return this.textCache.has(e)?this.textCache.get(e):(r={width:(r=(t=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(e)).node().getBBox()).width,height:r.height},t.remove(),this.textCache.set(e,r),r)}renderTerminal(e,t){var r=(i=this.measureText(t)).width+2*this.config.padding,i=i.height+2*this.config.padding;return(e=e.append("g").attr("class","railroad-terminal")).append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",i).attr("rx",10).attr("ry",10),e.append("text").attr("x",r/2).attr("y",i/2).text(t),{element:e.node(),dimensions:{width:r,height:i,up:i/2,down:i/2}}}renderNonTerminal(e,t){var r=(i=this.measureText(t)).width+2*this.config.padding,i=i.height+2*this.config.padding;return(e=e.append("g").attr("class","railroad-nonterminal")).append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",i),e.append("text").attr("x",r/2).attr("y",i/2).text(t),{element:e.node(),dimensions:{width:r,height:i,up:i/2,down:i/2}}}renderSequence(e,t){var r,i=t.map(t=>this.renderExpression(e,t));let n=0,a=0,o=0;for(r of i)n+=r.dimensions.width,a=Math.max(a,r.dimensions.up),o=Math.max(o,r.dimensions.down);n+=(i.length-1)*this.config.horizontalSeparation;var l=e.append("g").attr("class","railroad-sequence");let s=0;for(let e=0;e<i.length;e++){var d,m,c=i[e],h=a-c.dimensions.up;l.node().appendChild(c.element).setAttribute("transform",`translate(${s}, ${h})`),e<i.length-1&&(d=(h=s+c.dimensions.width)+this.config.horizontalSeparation,m=a,l.append("path").attr("class","railroad-line").attr("d",(new I).moveTo(h,m).lineTo(d,m).build())),s+=c.dimensions.width+this.config.horizontalSeparation}return{element:l.node(),dimensions:{width:n,height:a+o,up:a,down:o}}}renderChoice(e,t){var r;t=t.map(t=>this.renderExpression(e,t));let i=0,n=0;for(r of t)i=Math.max(i,r.dimensions.width),n+=r.dimensions.height;n+=(t.length-1)*this.config.verticalSeparation;var a=this.config.arcRadius,o=i+4*a,l=e.append("g").attr("class","railroad-choice");let s=0;var d,m=n/2;for(d of t){var c=(p=s)+d.dimensions.up,h=2*a+(i-d.dimensions.width)/2,p=(l.node().appendChild(d.element).setAttribute("transform",`translate(${h}, ${p})`),new I),u=m<c,g=(p=((c===m?p.moveTo(0,m):p.moveTo(0,m).arcTo(a,a,0,!1,u,a,m+(u?a:-a)).lineTo(a,c-(u?a:-a)).arcTo(a,a,0,!1,!u,2*a,c)).lineTo(h,c),l.append("path").attr("class","railroad-line").attr("d",p.build()),new I),h=h+d.dimensions.width,o-2*a);c===m?p.moveTo(h,c).lineTo(o,m):p.moveTo(h,c).lineTo(g,c).arcTo(a,a,0,!1,!u,o-a,c+(u?-a:a)).lineTo(o-a,m+(u?a:-a)).arcTo(a,a,0,!1,u,o,m),l.append("path").attr("class","railroad-line").attr("d",p.build()),s+=d.dimensions.height+this.config.verticalSeparation}return{element:l.node(),dimensions:{width:o,height:n,up:m,down:n-m}}}renderOptional(e,t){t=this.renderExpression(e,t);var r=this.config.arcRadius,i=2*r,n=t.dimensions.width+4*r,a=t.dimensions.height+i,o=2*r,l=(i=((e=e.append("g").attr("class","railroad-optional")).node().appendChild(t.element).setAttribute("transform",`translate(${o}, ${i})`),i+t.dimensions.up),(new I).moveTo(0,i).lineTo(2*r,i));e.append("path").attr("class","railroad-line").attr("d",l.build()),l=(new I).moveTo(o+t.dimensions.width,i).lineTo(n,i),e.append("path").attr("class","railroad-line").attr("d",l.build()),o=(new I).moveTo(0,i).arcTo(r,r,0,!1,!1,r,i-r).lineTo(r,r).arcTo(r,r,0,!1,!0,2*r,0).lineTo(n-2*r,0).arcTo(r,r,0,!1,!0,n-r,r).lineTo(n-r,i-r).arcTo(r,r,0,!1,!1,n,i);return e.append("path").attr("class","railroad-line").attr("d",o.build()),{element:e.node(),dimensions:{width:n,height:a,up:i,down:a-i}}}renderRepetition(e,t,r){t=this.renderExpression(e,t);var i=this.config.arcRadius,n=2*i,a=t.dimensions.width+4*i,o=(r=0===r,t.dimensions.height+n+(r?n:0)),l=2*i,s=(n=r?n:0,(e=e.append("g").attr("class","railroad-repetition")).node().appendChild(t.element).setAttribute("transform",`translate(${l}, ${n})`),n+t.dimensions.up);e.append("path").attr("class","railroad-line").attr("d",(new I).moveTo(0,s).lineTo(2*i,s).build()),e.append("path").attr("class","railroad-line").attr("d",(new I).moveTo(l+t.dimensions.width,s).lineTo(a,s).build()),n=n+t.dimensions.height+i,l=(new I).moveTo(l+t.dimensions.width,s).arcTo(i,i,0,!1,!0,l+t.dimensions.width+i,s+i).lineTo(l+t.dimensions.width+i,n).arcTo(i,i,0,!1,!0,l+t.dimensions.width,n+i).lineTo(2*i,n+i).arcTo(i,i,0,!1,!0,i,n).lineTo(i,s+i).arcTo(i,i,0,!1,!0,2*i,s);return e.append("path").attr("class","railroad-line").attr("d",l.build()),r&&(t=(new I).moveTo(0,s).arcTo(i,i,0,!1,!1,i,s-i).lineTo(i,i).arcTo(i,i,0,!1,!0,2*i,0).lineTo(a-2*i,0).arcTo(i,i,0,!1,!0,a-i,i).lineTo(a-i,s-i).arcTo(i,i,0,!1,!1,a,s),e.append("path").attr("class","railroad-line").attr("d",t.build())),{element:e.node(),dimensions:{width:a,height:o,up:s,down:o-s}}}renderSpecial(e,t){var r=(i=this.measureText("? "+t+" ?")).width+2*this.config.padding,i=i.height+2*this.config.padding;return(e=e.append("g").attr("class","railroad-special")).append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",i),e.append("text").attr("x",r/2).attr("y",i/2).text("? "+t+" ?"),{element:e.node(),dimensions:{width:r,height:i,up:i/2,down:i/2}}}renderExpression(e,t){switch(t.type){case"terminal":return this.renderTerminal(e,t.value);case"nonterminal":return this.renderNonTerminal(e,t.name);case"sequence":return this.renderSequence(e,t.elements);case"choice":return this.renderChoice(e,t.alternatives);case"optional":return this.renderOptional(e,t.element);case"repetition":return this.renderRepetition(e,t.element,t.min);case"special":return this.renderSpecial(e,t.text);default:throw new Error("Unknown node type: "+t.type)}}renderRule(e,t){t=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${t})`);var r=e.name+" =",i=this.measureText(r).width+20,n=i+20,a=t.append("g"),o=(e=this.renderExpression(a,e.definition),Math.max(20,e.dimensions.up)),l=o-e.dimensions.up;return a.attr("transform",`translate(${n}, ${l})`),t.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",o).text(r),t.append("g").attr("class","railroad-start").append("circle").attr("cx",i).attr("cy",o).attr("r",this.config.markerRadius),t.append("g").attr("class","railroad-end").append("circle").attr("cx",n+e.dimensions.width+10).attr("cy",o).attr("r",this.config.markerRadius),t.append("path").attr("class","railroad-line").attr("d",(new I).moveTo(i+this.config.markerRadius,o).lineTo(n,o).build()),t.append("path").attr("class","railroad-line").attr("d",(new I).moveTo(n+e.dimensions.width,o).lineTo(n+e.dimensions.width+10-this.config.markerRadius,o).build()),{height:Math.max(40,l+e.dimensions.height+2*this.config.padding),width:n+e.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let t=this.config.padding,r=0;for(var i of e)t+=(i=this.renderRule(i,t)).height+this.config.verticalSeparation,r=Math.max(r,i.width);return{width:r+2*this.config.padding,height:t+this.config.padding}}},H=r((e,t,r)=>{m(e,t.height,t.width,r),e.attr("viewBox",`0 0 ${t.width} `+t.height)},"configureRailroadSvgSize"),K=r((e,t,r)=>{o.debug("[Railroad] Rendering diagram\n"+e);try{var n,a=l(t),s=(a.attr("class","railroad-diagram"),i().railroad),d=s?.useMaxWidth??!0,m=b.getRules();o.debug(`[Railroad] Rendering ${m.length} rules`),0===m.length?(o.warn("[Railroad] No rules to render"),H(a,{height:100,width:200},d)):(n=new L(a,j()).renderDiagram(m),H(a,n,d),o.debug("[Railroad] Render complete"))}catch(e){throw o.error("[Railroad] Render error:",e),e}},"draw"),P={draw:K};export{b as d,G as g,P as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e,t;(e=self.document)&&!e.getElementById("livereloadscript")&&((t=e.createElement("script")).async=1,t.src="//"+(self.location.host||"localhost").split(":")[0]+":35729/livereload.js?snipver=1",t.id="livereloadscript",e.getElementsByTagName("head")[0].appendChild(t));import{_ as r,G as i,L as n,v as a,l as o,K as l,i as s,d,k as m}from"./mermaid.core-2d237a1e.js";var c="",h="",p="",u=[],g=new Map,T=r(e=>s(e,d()),"sanitizeText"),f=r(e=>{switch(e.type){case"terminal":return{...e,value:T(e.value)};case"nonterminal":return{...e,name:T(e.name)};case"sequence":return{...e,elements:e.elements.map(f)};case"choice":return{...e,alternatives:e.alternatives.map(f)};case"optional":return{...e,element:f(e.element)};case"repetition":return{...e,element:f(e.element),separator:e.separator?f(e.separator):void 0};case"special":return{...e,text:T(e.text)}}},"sanitizeAstNode"),x=r(()=>{p=h=c="",u.length=0,g.clear(),a(),o.debug("[Railroad] Database cleared")},"clear"),w=r(e=>{c=T(e),o.debug("[Railroad] Title set:",e)},"setTitle"),k=r(()=>c,"getTitle"),C=r(e=>{e={...e,name:T(e.name),definition:f(e.definition),comment:e.comment?T(e.comment):void 0},o.debug("[Railroad] Adding rule:",e.name),g.has(e.name)&&o.warn(`[Railroad] Rule '${e.name}' is already defined. Overwriting.`),u.push(e),g.set(e.name,e)},"addRule"),v=r(()=>u,"getRules"),F=r(e=>g.get(e),"getRule"),S=r(e=>{h=T(e).replace(/^\s+/g,""),o.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),y=r(()=>h,"getAccTitle"),$=r(e=>{p=T(e).replace(/\n\s+/g,"\n"),o.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),b={clear:x,setTitle:w,getTitle:k,addRule:C,getRules:v,getRule:F,setAccTitle:S,getAccTitle:y,setAccDescription:$,getAccDescription:r(()=>p,"getAccDescription"),setDiagramTitle:w,getDiagramTitle:k},R={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},z=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,N=/^[\w "',.-]+$/,M=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),A=r(e=>!!e&&Object.keys(e).every(e=>"railroad"===e||M.has(e)),"isRailroadStyleOptions"),B=r(e=>e?"railroad"in e&&e.railroad?e.railroad:A(e)?e:{}:{},"extractRailroadOverrides"),E=r(e=>{if(!e||A(e))return{};let{railroad:t,svgId:r,theme:i,look:n,...a}=e;return a},"extractThemeOverrides"),D=r((e,t)=>"string"==typeof e&&(e=e.trim(),z.test(e))?e:t,"sanitizeColorValue"),O=r((e,t)=>"string"==typeof e&&(e=e.trim(),N.test(e))?e:t,"sanitizeFontFamilyValue"),W=r((e,t)=>(e="number"==typeof e?e:"string"==typeof e?Number.parseFloat(e):Number.NaN,Number.isFinite(e)&&0<=e?e:t),"sanitizeNumberValue"),q=r(e=>(e="number"==typeof e?e:"string"==typeof e?Number.parseFloat(e):Number.NaN,Number.isFinite(e)&&0<e?e:void 0),"parseThemeFontSize"),V=r(e=>{var t=O(e.fontFamily,R.fontFamily),r=q(e.fontSize)??R.fontSize;return{...R,fontFamily:t,fontSize:r,terminalFill:D(e.secondBkg??e.secondaryColor,R.terminalFill),terminalStroke:D(e.secondaryBorderColor??e.lineColor,R.terminalStroke),terminalTextColor:D(e.secondaryTextColor??e.textColor,R.terminalTextColor),nonTerminalFill:D(e.mainBkg??e.background,R.nonTerminalFill),nonTerminalStroke:D(e.primaryBorderColor??e.lineColor,R.nonTerminalStroke),nonTerminalTextColor:D(e.primaryTextColor??e.textColor,R.nonTerminalTextColor),lineColor:D(e.lineColor,R.lineColor),markerFill:D(e.lineColor,R.markerFill),commentFill:D(e.labelBackground??e.tertiaryColor,R.commentFill),commentStroke:D(e.tertiaryBorderColor??e.lineColor,R.commentStroke),commentTextColor:D(e.tertiaryTextColor??e.textColor,R.commentTextColor),specialFill:D(e.tertiaryColor??e.secondaryColor,R.specialFill),specialStroke:D(e.tertiaryBorderColor??e.secondaryBorderColor,R.specialStroke),ruleNameColor:D(e.titleColor??e.textColor,R.ruleNameColor)}},"buildThemeDefaults"),j=r(e=>{var t=i(),r={...n(),...t.themeVariables??{},...E(e)};r=V(r);return{compactMode:(t={...t.railroad??{},...B(e)}).compactMode??r.compactMode,padding:W(t.padding,r.padding),verticalSeparation:W(t.verticalSeparation,r.verticalSeparation),horizontalSeparation:W(t.horizontalSeparation,r.horizontalSeparation),arcRadius:W(t.arcRadius,r.arcRadius),fontSize:W(t.fontSize,r.fontSize),fontFamily:O(t.fontFamily,r.fontFamily),terminalFill:D(t.terminalFill,r.terminalFill),terminalStroke:D(t.terminalStroke,r.terminalStroke),terminalTextColor:D(t.terminalTextColor,r.terminalTextColor),nonTerminalFill:D(t.nonTerminalFill,r.nonTerminalFill),nonTerminalStroke:D(t.nonTerminalStroke,r.nonTerminalStroke),nonTerminalTextColor:D(t.nonTerminalTextColor,r.nonTerminalTextColor),lineColor:D(t.lineColor,r.lineColor),strokeWidth:W(t.strokeWidth,r.strokeWidth),markerFill:D(t.markerFill,r.markerFill),commentFill:D(t.commentFill,r.commentFill),commentStroke:D(t.commentStroke,r.commentStroke),commentTextColor:D(t.commentTextColor,r.commentTextColor),specialFill:D(t.specialFill,r.specialFill),specialStroke:D(t.specialStroke,r.specialStroke),ruleNameColor:D(t.ruleNameColor,r.ruleNameColor),showMarkers:t.showMarkers??r.showMarkers,markerRadius:W(t.markerRadius,r.markerRadius)}},"buildRailroadStyleOptions"),G=r(e=>{var{fontFamily:e,fontSize:t,terminalFill:r,terminalStroke:i,terminalTextColor:n,nonTerminalFill:a,nonTerminalStroke:o,nonTerminalTextColor:l,lineColor:s,strokeWidth:d,markerFill:m,commentFill:c,commentStroke:h,commentTextColor:p,specialFill:u,specialStroke:g,ruleNameColor:T}=j(e);return`\n .railroad-diagram {\n font-family: ${e};\n font-size: ${t}px;\n }\n\n .railroad-terminal rect {\n fill: ${r};\n stroke: ${i};\n stroke-width: ${d}px;\n }\n\n .railroad-terminal text {\n fill: ${n};\n font-family: ${e};\n font-size: ${t}px;\n text-anchor: middle;\n dominant-baseline: middle;\n }\n\n .railroad-nonterminal rect {\n fill: ${a};\n stroke: ${o};\n stroke-width: ${d}px;\n }\n\n .railroad-nonterminal text {\n fill: ${l};\n font-family: ${e};\n font-size: ${t}px;\n text-anchor: middle;\n dominant-baseline: middle;\n }\n\n .railroad-line {\n stroke: ${s};\n stroke-width: ${d}px;\n fill: none;\n }\n\n .railroad-start circle,\n .railroad-end circle {\n fill: ${m};\n }\n\n .railroad-comment ellipse {\n fill: ${c};\n stroke: ${h};\n stroke-width: ${d}px;\n }\n\n .railroad-comment text {\n fill: ${p};\n font-style: italic;\n font-family: ${e};\n font-size: ${t}px;\n text-anchor: middle;\n dominant-baseline: middle;\n }\n\n .railroad-special rect {\n fill: ${u};\n stroke: ${g};\n stroke-width: ${d}px;\n stroke-dasharray: 5,3;\n }\n\n .railroad-special text {\n fill: ${l};\n font-family: ${e};\n font-size: ${t}px;\n text-anchor: middle;\n dominant-baseline: middle;\n }\n\n .railroad-rule-name {\n font-weight: bold;\n fill: ${T};\n font-family: ${e};\n font-size: ${t}px;\n }\n\n .railroad-group {\n /* Grouping container, no specific styles */\n }\n`},"getStyles"),I=class{constructor(){this.d=""}static{r(this,"PathBuilder")}moveTo(e,t){return this.d+=`M ${e} ${t} `,this}lineTo(e,t){return this.d+=`L ${e} ${t} `,this}horizontalTo(e){return this.d+=`H ${e} `,this}verticalTo(e){return this.d+=`V ${e} `,this}arcTo(e,t,r,i,n,a,o){return this.d+=`A ${e} ${t} ${r} ${i?1:0} ${n?1:0} ${a} ${o} `,this}build(){return this.d.trim()}},L=class{constructor(e,t=j()){this.textCache=new Map,this.svg=e,this.config=t}static{r(this,"RailroadRenderer")}measureText(e){var t,r;return this.textCache.has(e)?this.textCache.get(e):(r={width:(r=(t=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(e)).node().getBBox()).width,height:r.height},t.remove(),this.textCache.set(e,r),r)}renderTerminal(e,t){var r=(i=this.measureText(t)).width+2*this.config.padding,i=i.height+2*this.config.padding;return(e=e.append("g").attr("class","railroad-terminal")).append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",i).attr("rx",10).attr("ry",10),e.append("text").attr("x",r/2).attr("y",i/2).text(t),{element:e.node(),dimensions:{width:r,height:i,up:i/2,down:i/2}}}renderNonTerminal(e,t){var r=(i=this.measureText(t)).width+2*this.config.padding,i=i.height+2*this.config.padding;return(e=e.append("g").attr("class","railroad-nonterminal")).append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",i),e.append("text").attr("x",r/2).attr("y",i/2).text(t),{element:e.node(),dimensions:{width:r,height:i,up:i/2,down:i/2}}}renderSequence(e,t){var r,i=t.map(t=>this.renderExpression(e,t));let n=0,a=0,o=0;for(r of i)n+=r.dimensions.width,a=Math.max(a,r.dimensions.up),o=Math.max(o,r.dimensions.down);n+=(i.length-1)*this.config.horizontalSeparation;var l=e.append("g").attr("class","railroad-sequence");let s=0;for(let e=0;e<i.length;e++){var d,m,c=i[e],h=a-c.dimensions.up;l.node().appendChild(c.element).setAttribute("transform",`translate(${s}, ${h})`),e<i.length-1&&(d=(h=s+c.dimensions.width)+this.config.horizontalSeparation,m=a,l.append("path").attr("class","railroad-line").attr("d",(new I).moveTo(h,m).lineTo(d,m).build())),s+=c.dimensions.width+this.config.horizontalSeparation}return{element:l.node(),dimensions:{width:n,height:a+o,up:a,down:o}}}renderChoice(e,t){var r;t=t.map(t=>this.renderExpression(e,t));let i=0,n=0;for(r of t)i=Math.max(i,r.dimensions.width),n+=r.dimensions.height;n+=(t.length-1)*this.config.verticalSeparation;var a=this.config.arcRadius,o=i+4*a,l=e.append("g").attr("class","railroad-choice");let s=0;var d,m=n/2;for(d of t){var c=(p=s)+d.dimensions.up,h=2*a+(i-d.dimensions.width)/2,p=(l.node().appendChild(d.element).setAttribute("transform",`translate(${h}, ${p})`),new I),u=m<c,g=(p=((c===m?p.moveTo(0,m):p.moveTo(0,m).arcTo(a,a,0,!1,u,a,m+(u?a:-a)).lineTo(a,c-(u?a:-a)).arcTo(a,a,0,!1,!u,2*a,c)).lineTo(h,c),l.append("path").attr("class","railroad-line").attr("d",p.build()),new I),h=h+d.dimensions.width,o-2*a);c===m?p.moveTo(h,c).lineTo(o,m):p.moveTo(h,c).lineTo(g,c).arcTo(a,a,0,!1,!u,o-a,c+(u?-a:a)).lineTo(o-a,m+(u?a:-a)).arcTo(a,a,0,!1,u,o,m),l.append("path").attr("class","railroad-line").attr("d",p.build()),s+=d.dimensions.height+this.config.verticalSeparation}return{element:l.node(),dimensions:{width:o,height:n,up:m,down:n-m}}}renderOptional(e,t){t=this.renderExpression(e,t);var r=this.config.arcRadius,i=2*r,n=t.dimensions.width+4*r,a=t.dimensions.height+i,o=2*r,l=(i=((e=e.append("g").attr("class","railroad-optional")).node().appendChild(t.element).setAttribute("transform",`translate(${o}, ${i})`),i+t.dimensions.up),(new I).moveTo(0,i).lineTo(2*r,i));e.append("path").attr("class","railroad-line").attr("d",l.build()),l=(new I).moveTo(o+t.dimensions.width,i).lineTo(n,i),e.append("path").attr("class","railroad-line").attr("d",l.build()),o=(new I).moveTo(0,i).arcTo(r,r,0,!1,!1,r,i-r).lineTo(r,r).arcTo(r,r,0,!1,!0,2*r,0).lineTo(n-2*r,0).arcTo(r,r,0,!1,!0,n-r,r).lineTo(n-r,i-r).arcTo(r,r,0,!1,!1,n,i);return e.append("path").attr("class","railroad-line").attr("d",o.build()),{element:e.node(),dimensions:{width:n,height:a,up:i,down:a-i}}}renderRepetition(e,t,r){t=this.renderExpression(e,t);var i=this.config.arcRadius,n=2*i,a=t.dimensions.width+4*i,o=(r=0===r,t.dimensions.height+n+(r?n:0)),l=2*i,s=(n=r?n:0,(e=e.append("g").attr("class","railroad-repetition")).node().appendChild(t.element).setAttribute("transform",`translate(${l}, ${n})`),n+t.dimensions.up);e.append("path").attr("class","railroad-line").attr("d",(new I).moveTo(0,s).lineTo(2*i,s).build()),e.append("path").attr("class","railroad-line").attr("d",(new I).moveTo(l+t.dimensions.width,s).lineTo(a,s).build()),n=n+t.dimensions.height+i,l=(new I).moveTo(l+t.dimensions.width,s).arcTo(i,i,0,!1,!0,l+t.dimensions.width+i,s+i).lineTo(l+t.dimensions.width+i,n).arcTo(i,i,0,!1,!0,l+t.dimensions.width,n+i).lineTo(2*i,n+i).arcTo(i,i,0,!1,!0,i,n).lineTo(i,s+i).arcTo(i,i,0,!1,!0,2*i,s);return e.append("path").attr("class","railroad-line").attr("d",l.build()),r&&(t=(new I).moveTo(0,s).arcTo(i,i,0,!1,!1,i,s-i).lineTo(i,i).arcTo(i,i,0,!1,!0,2*i,0).lineTo(a-2*i,0).arcTo(i,i,0,!1,!0,a-i,i).lineTo(a-i,s-i).arcTo(i,i,0,!1,!1,a,s),e.append("path").attr("class","railroad-line").attr("d",t.build())),{element:e.node(),dimensions:{width:a,height:o,up:s,down:o-s}}}renderSpecial(e,t){var r=(i=this.measureText("? "+t+" ?")).width+2*this.config.padding,i=i.height+2*this.config.padding;return(e=e.append("g").attr("class","railroad-special")).append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",i),e.append("text").attr("x",r/2).attr("y",i/2).text("? "+t+" ?"),{element:e.node(),dimensions:{width:r,height:i,up:i/2,down:i/2}}}renderExpression(e,t){switch(t.type){case"terminal":return this.renderTerminal(e,t.value);case"nonterminal":return this.renderNonTerminal(e,t.name);case"sequence":return this.renderSequence(e,t.elements);case"choice":return this.renderChoice(e,t.alternatives);case"optional":return this.renderOptional(e,t.element);case"repetition":return this.renderRepetition(e,t.element,t.min);case"special":return this.renderSpecial(e,t.text);default:throw new Error("Unknown node type: "+t.type)}}renderRule(e,t){t=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${t})`);var r=e.name+" =",i=this.measureText(r).width+20,n=i+20,a=t.append("g"),o=(e=this.renderExpression(a,e.definition),Math.max(20,e.dimensions.up)),l=o-e.dimensions.up;return a.attr("transform",`translate(${n}, ${l})`),t.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",o).text(r),t.append("g").attr("class","railroad-start").append("circle").attr("cx",i).attr("cy",o).attr("r",this.config.markerRadius),t.append("g").attr("class","railroad-end").append("circle").attr("cx",n+e.dimensions.width+10).attr("cy",o).attr("r",this.config.markerRadius),t.append("path").attr("class","railroad-line").attr("d",(new I).moveTo(i+this.config.markerRadius,o).lineTo(n,o).build()),t.append("path").attr("class","railroad-line").attr("d",(new I).moveTo(n+e.dimensions.width,o).lineTo(n+e.dimensions.width+10-this.config.markerRadius,o).build()),{height:Math.max(40,l+e.dimensions.height+2*this.config.padding),width:n+e.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let t=this.config.padding,r=0;for(var i of e)t+=(i=this.renderRule(i,t)).height+this.config.verticalSeparation,r=Math.max(r,i.width);return{width:r+2*this.config.padding,height:t+this.config.padding}}},H=r((e,t,r)=>{m(e,t.height,t.width,r),e.attr("viewBox",`0 0 ${t.width} `+t.height)},"configureRailroadSvgSize"),K=r((e,t,r)=>{o.debug("[Railroad] Rendering diagram\n"+e);try{var n,a=l(t),s=(a.attr("class","railroad-diagram"),i().railroad),d=s?.useMaxWidth??!0,m=b.getRules();o.debug(`[Railroad] Rendering ${m.length} rules`),0===m.length?(o.warn("[Railroad] No rules to render"),H(a,{height:100,width:200},d)):(n=new L(a,j()).renderDiagram(m),H(a,n,d),o.debug("[Railroad] Render complete"))}catch(e){throw o.error("[Railroad] Render error:",e),e}},"draw"),P={draw:K};export{b as d,G as g,P as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,G as t,L as r,v as i,l as n,K as a,i as o,d as l,k as s}from"./mermaid.core-8797d6a9.js";var d="",m="",c="",h=[],p=new Map,u=e((e=>o(e,l())),"sanitizeText"),g=e((e=>{switch(e.type){case"terminal":return{...e,value:u(e.value)};case"nonterminal":return{...e,name:u(e.name)};case"sequence":return{...e,elements:e.elements.map(g)};case"choice":return{...e,alternatives:e.alternatives.map(g)};case"optional":return{...e,element:g(e.element)};case"repetition":return{...e,element:g(e.element),separator:e.separator?g(e.separator):void 0};case"special":return{...e,text:u(e.text)}}}),"sanitizeAstNode"),T=e((()=>{c=m=d="",h.length=0,p.clear(),i(),n.debug("[Railroad] Database cleared")}),"clear"),f=e((e=>{d=u(e),n.debug("[Railroad] Title set:",e)}),"setTitle"),x=e((()=>d),"getTitle"),w={clear:T,setTitle:f,getTitle:x,addRule:e((e=>{e={...e,name:u(e.name),definition:g(e.definition),comment:e.comment?u(e.comment):void 0},n.debug("[Railroad] Adding rule:",e.name),p.has(e.name)&&n.warn(`[Railroad] Rule '${e.name}' is already defined. Overwriting.`),h.push(e),p.set(e.name,e)}),"addRule"),getRules:e((()=>h),"getRules"),getRule:e((e=>p.get(e)),"getRule"),setAccTitle:e((e=>{m=u(e).replace(/^\s+/g,""),n.debug("[Railroad] Accessibility title set:",e)}),"setAccTitle"),getAccTitle:e((()=>m),"getAccTitle"),setAccDescription:e((e=>{c=u(e).replace(/\n\s+/g,"\n"),n.debug("[Railroad] Accessibility description set:",e)}),"setAccDescription"),getAccDescription:e((()=>c),"getAccDescription"),setDiagramTitle:f,getDiagramTitle:x},k={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},C=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,F=/^[\w "',.-]+$/,S=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),v=e((e=>!!e&&Object.keys(e).every((e=>"railroad"===e||S.has(e)))),"isRailroadStyleOptions"),$=e((e=>e?"railroad"in e&&e.railroad?e.railroad:v(e)?e:{}:{}),"extractRailroadOverrides"),y=e((e=>{if(!e||v(e))return{};const{railroad:t,svgId:r,theme:i,look:n,...a}=e;return a}),"extractThemeOverrides"),b=e(((e,t)=>"string"==typeof e&&(e=e.trim(),C.test(e))?e:t),"sanitizeColorValue"),R=e(((e,t)=>"string"==typeof e&&(e=e.trim(),F.test(e))?e:t),"sanitizeFontFamilyValue"),z=e(((e,t)=>(e="number"==typeof e?e:"string"==typeof e?Number.parseFloat(e):Number.NaN,Number.isFinite(e)&&0<=e?e:t)),"sanitizeNumberValue"),N=e((e=>(e="number"==typeof e?e:"string"==typeof e?Number.parseFloat(e):Number.NaN,Number.isFinite(e)&&0<e?e:void 0)),"parseThemeFontSize"),M=e((e=>{var t=R(e.fontFamily,k.fontFamily),r=N(e.fontSize)??k.fontSize;return{...k,fontFamily:t,fontSize:r,terminalFill:b(e.secondBkg??e.secondaryColor,k.terminalFill),terminalStroke:b(e.secondaryBorderColor??e.lineColor,k.terminalStroke),terminalTextColor:b(e.secondaryTextColor??e.textColor,k.terminalTextColor),nonTerminalFill:b(e.mainBkg??e.background,k.nonTerminalFill),nonTerminalStroke:b(e.primaryBorderColor??e.lineColor,k.nonTerminalStroke),nonTerminalTextColor:b(e.primaryTextColor??e.textColor,k.nonTerminalTextColor),lineColor:b(e.lineColor,k.lineColor),markerFill:b(e.lineColor,k.markerFill),commentFill:b(e.labelBackground??e.tertiaryColor,k.commentFill),commentStroke:b(e.tertiaryBorderColor??e.lineColor,k.commentStroke),commentTextColor:b(e.tertiaryTextColor??e.textColor,k.commentTextColor),specialFill:b(e.tertiaryColor??e.secondaryColor,k.specialFill),specialStroke:b(e.tertiaryBorderColor??e.secondaryBorderColor,k.specialStroke),ruleNameColor:b(e.titleColor??e.textColor,k.ruleNameColor)}}),"buildThemeDefaults"),A=e((e=>{var i=t(),n={...r(),...i.themeVariables??{},...y(e)};n=M(n);return{compactMode:(i={...i.railroad??{},...$(e)}).compactMode??n.compactMode,padding:z(i.padding,n.padding),verticalSeparation:z(i.verticalSeparation,n.verticalSeparation),horizontalSeparation:z(i.horizontalSeparation,n.horizontalSeparation),arcRadius:z(i.arcRadius,n.arcRadius),fontSize:z(i.fontSize,n.fontSize),fontFamily:R(i.fontFamily,n.fontFamily),terminalFill:b(i.terminalFill,n.terminalFill),terminalStroke:b(i.terminalStroke,n.terminalStroke),terminalTextColor:b(i.terminalTextColor,n.terminalTextColor),nonTerminalFill:b(i.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:b(i.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:b(i.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:b(i.lineColor,n.lineColor),strokeWidth:z(i.strokeWidth,n.strokeWidth),markerFill:b(i.markerFill,n.markerFill),commentFill:b(i.commentFill,n.commentFill),commentStroke:b(i.commentStroke,n.commentStroke),commentTextColor:b(i.commentTextColor,n.commentTextColor),specialFill:b(i.specialFill,n.specialFill),specialStroke:b(i.specialStroke,n.specialStroke),ruleNameColor:b(i.ruleNameColor,n.ruleNameColor),showMarkers:i.showMarkers??n.showMarkers,markerRadius:z(i.markerRadius,n.markerRadius)}}),"buildRailroadStyleOptions"),B=e((e=>{var{fontFamily:e,fontSize:t,terminalFill:r,terminalStroke:i,terminalTextColor:n,nonTerminalFill:a,nonTerminalStroke:o,nonTerminalTextColor:l,lineColor:s,strokeWidth:d,markerFill:m,commentFill:c,commentStroke:h,commentTextColor:p,specialFill:u,specialStroke:g,ruleNameColor:T}=A(e);return`\n .railroad-diagram {\n font-family: ${e};\n font-size: ${t}px;\n }\n\n .railroad-terminal rect {\n fill: ${r};\n stroke: ${i};\n stroke-width: ${d}px;\n }\n\n .railroad-terminal text {\n fill: ${n};\n font-family: ${e};\n font-size: ${t}px;\n text-anchor: middle;\n dominant-baseline: middle;\n }\n\n .railroad-nonterminal rect {\n fill: ${a};\n stroke: ${o};\n stroke-width: ${d}px;\n }\n\n .railroad-nonterminal text {\n fill: ${l};\n font-family: ${e};\n font-size: ${t}px;\n text-anchor: middle;\n dominant-baseline: middle;\n }\n\n .railroad-line {\n stroke: ${s};\n stroke-width: ${d}px;\n fill: none;\n }\n\n .railroad-start circle,\n .railroad-end circle {\n fill: ${m};\n }\n\n .railroad-comment ellipse {\n fill: ${c};\n stroke: ${h};\n stroke-width: ${d}px;\n }\n\n .railroad-comment text {\n fill: ${p};\n font-style: italic;\n font-family: ${e};\n font-size: ${t}px;\n text-anchor: middle;\n dominant-baseline: middle;\n }\n\n .railroad-special rect {\n fill: ${u};\n stroke: ${g};\n stroke-width: ${d}px;\n stroke-dasharray: 5,3;\n }\n\n .railroad-special text {\n fill: ${l};\n font-family: ${e};\n font-size: ${t}px;\n text-anchor: middle;\n dominant-baseline: middle;\n }\n\n .railroad-rule-name {\n font-weight: bold;\n fill: ${T};\n font-family: ${e};\n font-size: ${t}px;\n }\n\n .railroad-group {\n /* Grouping container, no specific styles */\n }\n`}),"getStyles"),E=class{constructor(){this.d=""}static{e(this,"PathBuilder")}moveTo(e,t){return this.d+=`M ${e} ${t} `,this}lineTo(e,t){return this.d+=`L ${e} ${t} `,this}horizontalTo(e){return this.d+=`H ${e} `,this}verticalTo(e){return this.d+=`V ${e} `,this}arcTo(e,t,r,i,n,a,o){return this.d+=`A ${e} ${t} ${r} ${i?1:0} ${n?1:0} ${a} ${o} `,this}build(){return this.d.trim()}},D=class{constructor(e,t=A()){this.textCache=new Map,this.svg=e,this.config=t}static{e(this,"RailroadRenderer")}measureText(e){var t,r;return this.textCache.has(e)?this.textCache.get(e):(r={width:(r=(t=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(e)).node().getBBox()).width,height:r.height},t.remove(),this.textCache.set(e,r),r)}renderTerminal(e,t){var r=(i=this.measureText(t)).width+2*this.config.padding,i=i.height+2*this.config.padding;return(e=e.append("g").attr("class","railroad-terminal")).append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",i).attr("rx",10).attr("ry",10),e.append("text").attr("x",r/2).attr("y",i/2).text(t),{element:e.node(),dimensions:{width:r,height:i,up:i/2,down:i/2}}}renderNonTerminal(e,t){var r=(i=this.measureText(t)).width+2*this.config.padding,i=i.height+2*this.config.padding;return(e=e.append("g").attr("class","railroad-nonterminal")).append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",i),e.append("text").attr("x",r/2).attr("y",i/2).text(t),{element:e.node(),dimensions:{width:r,height:i,up:i/2,down:i/2}}}renderSequence(e,t){var r=t.map((t=>this.renderExpression(e,t)));let i=0,n=0,a=0;for(const e of r)i+=e.dimensions.width,n=Math.max(n,e.dimensions.up),a=Math.max(a,e.dimensions.down);i+=(r.length-1)*this.config.horizontalSeparation;var o=e.append("g").attr("class","railroad-sequence");let l=0;for(let e=0;e<r.length;e++){var s,d,m=r[e],c=n-m.dimensions.up;o.node().appendChild(m.element).setAttribute("transform",`translate(${l}, ${c})`),e<r.length-1&&(s=(c=l+m.dimensions.width)+this.config.horizontalSeparation,d=n,o.append("path").attr("class","railroad-line").attr("d",(new E).moveTo(c,d).lineTo(s,d).build())),l+=m.dimensions.width+this.config.horizontalSeparation}return{element:o.node(),dimensions:{width:i,height:n+a,up:n,down:a}}}renderChoice(e,t){t=t.map((t=>this.renderExpression(e,t)));let r=0,i=0;for(const e of t)r=Math.max(r,e.dimensions.width),i+=e.dimensions.height;i+=(t.length-1)*this.config.verticalSeparation;var n=this.config.arcRadius,a=r+4*n,o=e.append("g").attr("class","railroad-choice");let l=0;var s=i/2;for(const e of t){var d=(c=l)+e.dimensions.up,m=2*n+(r-e.dimensions.width)/2,c=(o.node().appendChild(e.element).setAttribute("transform",`translate(${m}, ${c})`),new E),h=s<d,p=(c=((d===s?c.moveTo(0,s):c.moveTo(0,s).arcTo(n,n,0,!1,h,n,s+(h?n:-n)).lineTo(n,d-(h?n:-n)).arcTo(n,n,0,!1,!h,2*n,d)).lineTo(m,d),o.append("path").attr("class","railroad-line").attr("d",c.build()),new E),m=m+e.dimensions.width,a-2*n);d===s?c.moveTo(m,d).lineTo(a,s):c.moveTo(m,d).lineTo(p,d).arcTo(n,n,0,!1,!h,a-n,d+(h?-n:n)).lineTo(a-n,s+(h?n:-n)).arcTo(n,n,0,!1,h,a,s),o.append("path").attr("class","railroad-line").attr("d",c.build()),l+=e.dimensions.height+this.config.verticalSeparation}return{element:o.node(),dimensions:{width:a,height:i,up:s,down:i-s}}}renderOptional(e,t){t=this.renderExpression(e,t);var r=this.config.arcRadius,i=2*r,n=t.dimensions.width+4*r,a=t.dimensions.height+i,o=2*r,l=(i=((e=e.append("g").attr("class","railroad-optional")).node().appendChild(t.element).setAttribute("transform",`translate(${o}, ${i})`),i+t.dimensions.up),(new E).moveTo(0,i).lineTo(2*r,i));e.append("path").attr("class","railroad-line").attr("d",l.build()),l=(new E).moveTo(o+t.dimensions.width,i).lineTo(n,i),e.append("path").attr("class","railroad-line").attr("d",l.build()),o=(new E).moveTo(0,i).arcTo(r,r,0,!1,!1,r,i-r).lineTo(r,r).arcTo(r,r,0,!1,!0,2*r,0).lineTo(n-2*r,0).arcTo(r,r,0,!1,!0,n-r,r).lineTo(n-r,i-r).arcTo(r,r,0,!1,!1,n,i);return e.append("path").attr("class","railroad-line").attr("d",o.build()),{element:e.node(),dimensions:{width:n,height:a,up:i,down:a-i}}}renderRepetition(e,t,r){t=this.renderExpression(e,t);var i=this.config.arcRadius,n=2*i,a=t.dimensions.width+4*i,o=(r=0===r,t.dimensions.height+n+(r?n:0)),l=2*i,s=(n=r?n:0,(e=e.append("g").attr("class","railroad-repetition")).node().appendChild(t.element).setAttribute("transform",`translate(${l}, ${n})`),n+t.dimensions.up);e.append("path").attr("class","railroad-line").attr("d",(new E).moveTo(0,s).lineTo(2*i,s).build()),e.append("path").attr("class","railroad-line").attr("d",(new E).moveTo(l+t.dimensions.width,s).lineTo(a,s).build()),n=n+t.dimensions.height+i,l=(new E).moveTo(l+t.dimensions.width,s).arcTo(i,i,0,!1,!0,l+t.dimensions.width+i,s+i).lineTo(l+t.dimensions.width+i,n).arcTo(i,i,0,!1,!0,l+t.dimensions.width,n+i).lineTo(2*i,n+i).arcTo(i,i,0,!1,!0,i,n).lineTo(i,s+i).arcTo(i,i,0,!1,!0,2*i,s);return e.append("path").attr("class","railroad-line").attr("d",l.build()),r&&(t=(new E).moveTo(0,s).arcTo(i,i,0,!1,!1,i,s-i).lineTo(i,i).arcTo(i,i,0,!1,!0,2*i,0).lineTo(a-2*i,0).arcTo(i,i,0,!1,!0,a-i,i).lineTo(a-i,s-i).arcTo(i,i,0,!1,!1,a,s),e.append("path").attr("class","railroad-line").attr("d",t.build())),{element:e.node(),dimensions:{width:a,height:o,up:s,down:o-s}}}renderSpecial(e,t){var r=(i=this.measureText("? "+t+" ?")).width+2*this.config.padding,i=i.height+2*this.config.padding;return(e=e.append("g").attr("class","railroad-special")).append("rect").attr("x",0).attr("y",0).attr("width",r).attr("height",i),e.append("text").attr("x",r/2).attr("y",i/2).text("? "+t+" ?"),{element:e.node(),dimensions:{width:r,height:i,up:i/2,down:i/2}}}renderExpression(e,t){switch(t.type){case"terminal":return this.renderTerminal(e,t.value);case"nonterminal":return this.renderNonTerminal(e,t.name);case"sequence":return this.renderSequence(e,t.elements);case"choice":return this.renderChoice(e,t.alternatives);case"optional":return this.renderOptional(e,t.element);case"repetition":return this.renderRepetition(e,t.element,t.min);case"special":return this.renderSpecial(e,t.text);default:throw new Error("Unknown node type: "+t.type)}}renderRule(e,t){t=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${t})`);var r=e.name+" =",i=this.measureText(r).width+20,n=i+20,a=t.append("g"),o=(e=this.renderExpression(a,e.definition),Math.max(20,e.dimensions.up)),l=o-e.dimensions.up;return a.attr("transform",`translate(${n}, ${l})`),t.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",o).text(r),t.append("g").attr("class","railroad-start").append("circle").attr("cx",i).attr("cy",o).attr("r",this.config.markerRadius),t.append("g").attr("class","railroad-end").append("circle").attr("cx",n+e.dimensions.width+10).attr("cy",o).attr("r",this.config.markerRadius),t.append("path").attr("class","railroad-line").attr("d",(new E).moveTo(i+this.config.markerRadius,o).lineTo(n,o).build()),t.append("path").attr("class","railroad-line").attr("d",(new E).moveTo(n+e.dimensions.width,o).lineTo(n+e.dimensions.width+10-this.config.markerRadius,o).build()),{height:Math.max(40,l+e.dimensions.height+2*this.config.padding),width:n+e.dimensions.width+10+this.config.markerRadius}}renderDiagram(e){let t=this.config.padding,r=0;for(const n of e){var i=this.renderRule(n,t);t+=i.height+this.config.verticalSeparation,r=Math.max(r,i.width)}return{width:r+2*this.config.padding,height:t+this.config.padding}}},O=e(((e,t,r)=>{s(e,t.height,t.width,r),e.attr("viewBox",`0 0 ${t.width} `+t.height)}),"configureRailroadSvgSize"),W={draw:e(((e,r,i)=>{n.debug("[Railroad] Rendering diagram\n"+e);try{var o,l=a(r),s=(l.attr("class","railroad-diagram"),t().railroad),d=s?.useMaxWidth??!0,m=w.getRules();n.debug(`[Railroad] Rendering ${m.length} rules`),0===m.length?(n.warn("[Railroad] No rules to render"),O(l,{height:100,width:200},d)):(o=new D(l,A()).renderDiagram(m),O(l,o,d),n.debug("[Railroad] Render complete"))}catch(e){throw n.error("[Railroad] Render error:",e),e}}),"draw")};export{w as d,B as g,W as r};
|