@billtaofbj/diagram 1.0.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 @yourcompany
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,2 @@
1
+ .ai-chat-panel[data-v-01960100]{z-index:2000;background:#fff;border-left:1px solid #e4e7ed;flex-direction:column;height:100vh;display:flex;position:fixed;top:0;right:0;box-shadow:-2px 0 12px #0000001a}.chat-header[data-v-01960100]{background:linear-gradient(#fff,#fafafa);border-bottom:1px solid #e4e7ed;justify-content:space-between;align-items:center;min-height:44px;padding:10px 16px;display:flex}.chat-header-left[data-v-01960100]{align-items:center;gap:8px;display:flex}.chat-title[data-v-01960100]{color:#303133;font-size:14px;font-weight:600}.chat-header-right[data-v-01960100]{align-items:center;gap:2px;display:flex}.online-tag[data-v-01960100]{cursor:pointer}.mention-bell[data-v-01960100]{cursor:pointer;justify-content:center;align-items:center;padding:2px;animation:.8s ease-in-out infinite bellShake-01960100;display:flex}.mention-bell[data-v-01960100]:hover{opacity:.8}@keyframes bellShake-01960100{0%,to{transform:rotate(0)}15%{transform:rotate(15deg)}30%{transform:rotate(-15deg)}45%{transform:rotate(10deg)}60%{transform:rotate(-10deg)}75%{transform:rotate(5deg)}}.online-users-list[data-v-01960100]{flex-direction:column;gap:8px;max-height:280px;display:flex;overflow-y:auto}.online-user-item[data-v-01960100]{align-items:center;gap:10px;display:flex}.online-user-avatar[data-v-01960100]{color:#fff;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:28px;height:28px;font-size:13px;font-weight:600;display:flex}.online-user-name[data-v-01960100]{color:#303133;text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:13px;overflow:hidden}.role-tag[data-v-01960100]{flex-shrink:0}.self-tag[data-v-01960100]{color:#909399;flex-shrink:0;font-size:12px}.chat-messages[data-v-01960100]{flex-direction:column;flex:1;gap:12px;padding:16px;display:flex;overflow-y:auto}.chat-empty[data-v-01960100]{color:#909399;flex-direction:column;justify-content:center;align-items:center;height:100%;display:flex}.chat-empty p[data-v-01960100]{margin:8px 0 0;font-size:14px}.chat-empty-hint[data-v-01960100]{color:#c0c4cc!important;font-size:12px!important}.chat-message[data-v-01960100]{gap:10px;max-width:90%;display:flex}.chat-message-user[data-v-01960100]{flex-direction:row-reverse;align-self:flex-end}.chat-message-ai[data-v-01960100],.chat-message-other[data-v-01960100]{align-self:flex-start}.message-avatar[data-v-01960100]{color:#fff;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:32px;height:32px;font-size:13px;font-weight:600;display:flex}.message-avatar.ai[data-v-01960100]{background:linear-gradient(135deg,#409eff,#337ecc)}.message-content[data-v-01960100]{flex-direction:column;gap:4px;display:flex}.chat-message-user .message-content[data-v-01960100]{align-items:flex-end}.message-meta[data-v-01960100]{align-items:center;gap:6px;padding:0 4px;display:flex}.message-sender[data-v-01960100]{font-size:11px;font-weight:600}.message-mention[data-v-01960100]{color:#409eff;font-size:11px;font-weight:600}.message-text[data-v-01960100]{word-break:break-word;border-radius:12px;padding:10px 14px;font-size:13px;line-height:1.6}.chat-message-ai .message-text[data-v-01960100]{color:#303133;background:#f4f4f5;border-top-left-radius:4px}.chat-message-user .message-text[data-v-01960100]{color:#fff;background:linear-gradient(135deg,#409eff,#337ecc);border-top-right-radius:4px}.chat-message-other .message-text[data-v-01960100]{color:#303133;background:#f0f9ff;border:1px solid #d9ecff;border-top-left-radius:4px}.message-time[data-v-01960100]{color:#c0c4cc;padding:0 4px;font-size:11px}.chat-input-area[data-v-01960100]{background:#fafafa;border-top:1px solid #e4e7ed;padding:12px 16px}.chat-input-wrapper[data-v-01960100]{align-items:flex-end;gap:8px;display:flex;position:relative}.chat-input-wrapper[data-v-01960100] .el-textarea__inner{border:1px solid #dcdfe6;border-radius:10px;padding:8px 12px;font-size:13px;box-shadow:0 1px 4px #0000000f}.chat-input-wrapper[data-v-01960100] .el-textarea__inner:focus{border-color:#409eff;box-shadow:0 1px 6px #409eff26}.send-btn[data-v-01960100]{flex-shrink:0;width:34px;height:34px}.mention-popup[data-v-01960100]{z-index:10;background:#fff;border:1px solid #e4e7ed;border-radius:8px;min-width:160px;max-height:200px;margin-bottom:4px;position:absolute;bottom:100%;left:0;overflow-y:auto;box-shadow:0 4px 12px #0000001a}.mention-item[data-v-01960100]{cursor:pointer;align-items:center;gap:8px;padding:8px 12px;font-size:13px;display:flex}.mention-item[data-v-01960100]:hover,.mention-item.active[data-v-01960100]{background:#f5f7fa}.mention-avatar[data-v-01960100]{color:#fff;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:24px;height:24px;font-size:12px;font-weight:600;display:flex}.typing-indicator[data-v-01960100]{align-items:center;gap:4px;display:flex;padding:12px 16px!important}.typing-indicator span[data-v-01960100]{background:#c0c4cc;border-radius:50%;width:6px;height:6px;animation:1.2s infinite typingBounce-01960100}.typing-indicator span[data-v-01960100]:nth-child(2){animation-delay:.2s}.typing-indicator span[data-v-01960100]:nth-child(3){animation-delay:.4s}@keyframes typingBounce-01960100{0%,60%,to{opacity:.4;transform:translateY(0)}30%{opacity:1;transform:translateY(-4px)}}.version-history-panel[data-v-87924b7c]{flex-direction:column;height:100%;display:flex}.loading-state[data-v-87924b7c],.empty-state[data-v-87924b7c]{color:#909399;flex-direction:column;justify-content:center;align-items:center;height:200px;display:flex}.empty-state p[data-v-87924b7c]{margin-top:12px}.version-list[data-v-87924b7c]{flex:1;padding:0 4px;overflow-y:auto}.current-version[data-v-87924b7c]{background:#f0f9eb;border-radius:6px;flex-direction:column;gap:4px;margin-bottom:16px;padding:8px 12px;display:flex}.current-version-header[data-v-87924b7c]{align-items:center;gap:8px;display:flex}.version-meta[data-v-87924b7c]{color:#606266;font-size:13px}.version-item[data-v-87924b7c]{cursor:pointer;border-radius:6px;align-items:center;gap:20px;padding:8px 12px;transition:background .2s;display:flex}.version-item[data-v-87924b7c]:hover{background:#f5f7fa}.version-item.active[data-v-87924b7c]{background:#ecf5ff}.version-number[data-v-87924b7c]{color:#409eff;font-size:14px;font-weight:600}.version-user[data-v-87924b7c]{color:#303133;font-size:14px}.version-time[data-v-87924b7c]{color:#909399;margin-top:2px;font-size:12px}.panel-footer[data-v-87924b7c]{justify-content:flex-end;padding:12px 0;display:flex}.node-palette[data-v-a24fcbed]{background:#fff;border-right:1px solid #e4e7ed;width:180px;padding:12px;overflow-y:auto}.node-palette h4[data-v-a24fcbed]{color:#333;margin:0;font-size:13px;font-weight:600}.palette-header[data-v-a24fcbed]{justify-content:space-between;align-items:center;margin-bottom:8px;display:flex}.palette-search[data-v-a24fcbed]{margin-bottom:8px}.palette-list[data-v-a24fcbed]{flex-direction:column;gap:4px;display:flex}.palette-item[data-v-a24fcbed]{cursor:grab;border-radius:4px;align-items:center;gap:8px;padding:6px 8px;transition:background .15s;display:flex}.palette-item[data-v-a24fcbed]:hover{background:#f5f7fa}.palette-item[data-v-a24fcbed]:active{cursor:grabbing}.palette-icon[data-v-a24fcbed]{border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;width:28px;height:28px;display:flex}.palette-icon svg[data-v-a24fcbed]{display:block}.palette-label[data-v-a24fcbed]{color:#333;font-size:12px}.process-toolbar[data-v-34fc94b1]{background:#fff;border-bottom:1px solid #e4e7ed;flex-wrap:wrap;align-items:center;gap:8px;padding:8px 12px;display:flex}.toolbar-group[data-v-34fc94b1]{border-right:1px solid #e4e7ed;align-items:center;gap:4px;padding:0 8px;display:flex}.toolbar-group[data-v-34fc94b1]:last-child{border-right:none}.toolbar-spacer[data-v-34fc94b1]{flex:1}.node-icon[data-v-34fc94b1]{vertical-align:middle;border-radius:2px;width:12px;height:12px;margin-right:6px;display:inline-block}.ai-dialog[data-v-34fc94b1] .el-dialog{flex-direction:column;max-height:calc(100vh - 100px);display:flex}.ai-dialog[data-v-34fc94b1] .el-dialog__body{flex-direction:column;flex:1;display:flex;overflow:hidden}.ai-textarea[data-v-34fc94b1] .el-textarea__inner{resize:none;height:calc(100vh - 250px)!important}.diagram-node[data-v-e89a49e8]{transition:filter .2s}.diagram-node.selected[data-v-e89a49e8]{filter:drop-shadow(0 0 4px #409eff66)}.node-label[data-v-e89a49e8]{pointer-events:none;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.label-hidden[data-v-e89a49e8]{opacity:0}.label-hover[data-v-e89a49e8]{opacity:0;transition:opacity .2s}.diagram-node:hover .label-hover[data-v-e89a49e8]{opacity:1}.resize-handles rect[data-v-e89a49e8]{opacity:.8}.long-press-ring[data-v-e89a49e8]{pointer-events:none;animation:.2s linear forwards longPressProgress-e89a49e8}@keyframes longPressProgress-e89a49e8{0%{stroke-dashoffset:113px}to{stroke-dashoffset:0}}.connect-target[data-v-e89a49e8]{cursor:crosshair;transition:r .15s;animation:1s ease-in-out infinite connectPulse-e89a49e8}.connect-target[data-v-e89a49e8]:hover{r:10}.glow-rect[data-v-e89a49e8]{animation:2s ease-in-out infinite glowPulseAnimation}.breathing-ring[data-v-e89a49e8]{transform-origin:50%;animation:2s ease-in-out infinite breathingAnimation}.glow-pulse-ring[data-v-e89a49e8]{transform-origin:50%;pointer-events:none}@keyframes connectPulse-e89a49e8{0%,to{r:6;opacity:.4}50%{r:10;opacity:.7}}@keyframes breathingAnimation{0%,to{opacity:.3;stroke-width:2px}50%{opacity:.8;stroke-width:4px}}@keyframes glowPulseAnimation{0%,to{opacity:.2}50%{opacity:.6}}@keyframes glowPulseRingAnimation{0%,to{stroke-width:2px;opacity:.4}50%{stroke-width:4px;opacity:.8}}@keyframes nodePulse{0%,to{transform:scale(1)}50%{transform:scale(1.05)}}@keyframes nodeBounce{0%,to{transform:translateY(0)}50%{transform:translateY(-8px)}}@keyframes nodeSpin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes nodeFadeIn{0%,to{opacity:1}50%{opacity:.3}}@keyframes nodeFadeOut{0%,to{opacity:1}50%{opacity:.1}}@keyframes nodeColorShift{0%,to{filter:hue-rotate()}50%{filter:hue-rotate(60deg)}}@keyframes glowPulseRingOverlay{0%,to{stroke-width:1px;opacity:.1}50%{stroke-width:5px;opacity:1}}@keyframes nodeRippleOverlay{0%{stroke-width:2px;opacity:1}to{stroke-width:20px;opacity:0}}@keyframes nodeFloat{0%,to{transform:translateY(0)}50%{transform:translateY(-5px)}}@keyframes nodeShake{0%,to{transform:translate(0)}25%{transform:translate(-3px)}75%{transform:translate(3px)}}@keyframes nodeScaleIn{0%{transform:scale(.8)}50%{transform:scale(1.2)}to{transform:scale(.8)}}@keyframes nodeNeonFlow{0%{filter:hue-rotate()brightness()saturate()}25%{filter:hue-rotate(60deg)brightness(1.4)saturate(1.5)}50%{filter:hue-rotate(180deg)brightness(1.1)saturate(1.8)}75%{filter:hue-rotate(270deg)brightness(1.5)saturate(1.3)}to{filter:hue-rotate(360deg)brightness()saturate()}}.edge-hit-area[data-v-737212ef]{pointer-events:stroke}.edge-line[data-v-737212ef]{pointer-events:none}.edge-label[data-v-737212ef]{pointer-events:none;-webkit-user-select:none;user-select:none;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.flow-particle[data-v-737212ef]{filter:drop-shadow(0 0 2px)}.glow-particle[data-v-737212ef]{filter:drop-shadow(0 0 4px)drop-shadow(0 0 8px)}.pulse-particle[data-v-737212ef]{filter:drop-shadow(0 0 3px)}.neon-particle[data-v-737212ef]{filter:drop-shadow(0 0 3px)drop-shadow(0 0 6px)}@keyframes edgePulse-737212ef{0%,to{stroke-width:inherit;opacity:1}50%{stroke-width:inherit;opacity:.4}}@keyframes edgeNeon-737212ef{0%,to{filter:drop-shadow(0 0 4px)drop-shadow(0 0 8px)}50%{filter:drop-shadow(0 0 8px)drop-shadow(0 0 16px)}}.swimlane-title[data-v-8e00b7cb]{-webkit-user-select:none;user-select:none;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.lane-label[data-v-8e00b7cb]{-webkit-user-select:none;user-select:none;cursor:pointer;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.lane-divider[data-v-8e00b7cb]{pointer-events:none}.lane-divider-hit:hover+.lane-divider[data-v-8e00b7cb]{stroke:#409eff;stroke-width:2px}.lane-bg[data-v-8e00b7cb]{cursor:move}.resize-handle[data-v-8e00b7cb]{opacity:.8;cursor:ew-resize}.resize-handle[data-v-8e00b7cb]:hover{opacity:1}.swimlane-bg[data-v-8e00b7cb]{cursor:move}.edit-name-container[data-v-8e00b7cb]{justify-content:center;align-items:center;width:100%;height:100%;display:flex}.edit-name-container.vertical[data-v-8e00b7cb]{justify-content:center}.edit-name-input[data-v-8e00b7cb]{text-align:center;background:#ffffffe6;border:1px solid #409eff;border-radius:3px;outline:none;width:90%;height:24px;padding:0 4px;font-weight:600}.edit-lane-container[data-v-8e00b7cb]{align-items:center;width:100%;height:100%;display:flex}.edit-lane-input[data-v-8e00b7cb]{background:#ffffffe6;border:1px solid #409eff;border-radius:3px;outline:none;width:100%;height:20px;padding:0 4px;font-size:11px}.diagram-canvas[data-v-878b95c1]{cursor:grab;background:#fafafa;outline:none;width:100%;height:100%;position:relative;overflow:hidden}.diagram-canvas[data-v-878b95c1]:active{cursor:grabbing}.diagram-svg[data-v-878b95c1]{display:block}.grid-bg[data-v-878b95c1]{pointer-events:all}.zoom-controls[data-v-878b95c1]{z-index:10;background:#fff;border-radius:6px;flex-direction:column;gap:4px;padding:4px;display:flex;position:absolute;bottom:16px;right:16px;box-shadow:0 2px 8px #0000001f}.zoom-controls button[data-v-878b95c1]{cursor:pointer;background:#fff;border:1px solid #e4e7ed;border-radius:4px;justify-content:center;align-items:center;width:28px;height:28px;font-size:14px;display:flex}.zoom-controls button[data-v-878b95c1]:hover{background:#f5f7fa}.zoom-controls button.active[data-v-878b95c1]{color:#fff;background:#409eff;border-color:#409eff}.zoom-label[data-v-878b95c1]{text-align:center;color:#666;-webkit-user-select:none;user-select:none;font-size:11px}.remark-tooltip[data-v-878b95c1]{z-index:100;pointer-events:none;background:#fff;border-radius:8px;max-width:320px;padding:10px 14px;animation:.15s tooltipFadeIn-878b95c1;position:absolute;transform:translate(-50%);box-shadow:0 4px 16px #00000026}.remark-tooltip[data-v-878b95c1]:before{content:"";background:#fff;width:12px;height:12px;position:absolute;top:-6px;left:50%;transform:translate(-50%)rotate(45deg);box-shadow:-2px -2px 4px #00000014}.tooltip-content[data-v-878b95c1]{color:#303133;white-space:pre-wrap;word-break:break-word;font-size:13px;line-height:1.6}@keyframes tooltipFadeIn-878b95c1{0%{opacity:0;transform:translate(-4px)}to{opacity:1;transform:translate(0)}}.param-dialog[data-v-8ae88a5a]{max-height:500px;overflow-y:auto}.json-import[data-v-8ae88a5a]{margin-bottom:8px}.param-list[data-v-8ae88a5a]{border:1px solid #e4e7ed;border-radius:4px}.param-list-header[data-v-8ae88a5a]{color:#606266;background:#f5f7fa;border-bottom:1px solid #e4e7ed;align-items:center;padding:8px;font-size:12px;font-weight:600;display:flex}.param-list-row[data-v-8ae88a5a]{border-bottom:1px solid #ebeef5;align-items:center;padding:6px 8px;display:flex}.param-list-row[data-v-8ae88a5a]:last-child{border-bottom:none}.col-index[data-v-8ae88a5a]{text-align:center;color:#909399;flex-shrink:0;width:30px;font-size:12px}.col-name[data-v-8ae88a5a],.col-value[data-v-8ae88a5a],.col-desc[data-v-8ae88a5a]{flex:1.2;margin:0 4px}.col-type[data-v-8ae88a5a]{flex-shrink:0;width:100px;margin:0 4px}.col-action[data-v-8ae88a5a]{text-align:center;flex-shrink:0;width:40px}.param-empty[data-v-8ae88a5a]{text-align:center;color:#909399;padding:20px;font-size:13px}.properties-panel[data-v-8d0fe2b9]{background:#fff;border-left:1px solid #e4e7ed;width:240px;padding:12px;overflow-y:auto}.panel-section h4[data-v-8d0fe2b9]{color:#333;border-bottom:1px solid #e4e7ed;margin:0 0 12px;padding-bottom:8px;font-size:13px;font-weight:600}.theme-section[data-v-8d0fe2b9]{margin-bottom:16px}.theme-grid[data-v-8d0fe2b9]{grid-template-columns:repeat(3,1fr);gap:8px;display:grid}.theme-item[data-v-8d0fe2b9]{cursor:pointer;border:2px solid #e4e7ed;border-radius:6px;flex-direction:column;align-items:center;padding:6px;transition:all .2s;display:flex}.theme-item[data-v-8d0fe2b9]:hover{border-color:#409eff}.theme-item.active[data-v-8d0fe2b9]{background:#409eff1a;border-color:#409eff}.theme-preview[data-v-8d0fe2b9]{background:#f5f7fa;border-radius:4px;justify-content:center;align-items:center;gap:4px;width:100%;height:32px;margin-bottom:4px;display:flex}.preview-rect[data-v-8d0fe2b9]{background:#409eff;border-radius:2px;width:16px;height:12px}.preview-circle[data-v-8d0fe2b9]{background:#67c23a;border-radius:50%;width:10px;height:10px}.theme-preview-glass[data-v-8d0fe2b9]{-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background:#f0f0f0b3}.theme-preview-glass .preview-rect[data-v-8d0fe2b9]{background:#409effb3}.theme-preview-glass .preview-circle[data-v-8d0fe2b9]{background:#67c23ab3}.theme-preview-gradient[data-v-8d0fe2b9]{background:linear-gradient(135deg,#667eea 0%,#764ba2 100%)}.theme-preview-gradient .preview-rect[data-v-8d0fe2b9]{background:linear-gradient(135deg,#409eff 0%,#66b1ff 100%)}.theme-preview-gradient .preview-circle[data-v-8d0fe2b9]{background:linear-gradient(135deg,#67c23a 0%,#85ce61 100%)}.theme-preview-neon[data-v-8d0fe2b9]{background:#1a1a2e}.theme-preview-neon .preview-rect[data-v-8d0fe2b9]{background:0 0;border:1px solid #00d4ff;box-shadow:0 0 5px #00d4ff}.theme-preview-neon .preview-circle[data-v-8d0fe2b9]{background:0 0;border:1px solid #0f8;box-shadow:0 0 5px #0f8}.theme-preview-sketch[data-v-8d0fe2b9]{background:#fafafa}.theme-preview-sketch .preview-rect[data-v-8d0fe2b9]{background:0 0;border:1px dashed #5b9bd5}.theme-preview-sketch .preview-circle[data-v-8d0fe2b9]{background:0 0;border:1px dashed #70ad47}.theme-preview-colorful[data-v-8d0fe2b9]{background:linear-gradient(135deg,#ff6b6b,#ffa94d,#ffd43b,#69db7c,#4dabf7)}.theme-preview-colorful .preview-rect[data-v-8d0fe2b9]{background:linear-gradient(135deg,#51cf66,#94d82d,#fcc419,#ff922b,#ff6b6b)}.theme-preview-colorful .preview-circle[data-v-8d0fe2b9]{background:linear-gradient(135deg,#845ef7,#5c7cfa,#339af0,#22b8cf,#20c997)}.theme-name[data-v-8d0fe2b9]{color:#666;font-size:10px}.prop-row[data-v-8d0fe2b9]{justify-content:space-between;align-items:center;margin-bottom:10px;display:flex}.prop-row label[data-v-8d0fe2b9]{color:#666;flex-shrink:0;margin-right:8px;font-size:12px}.prop-row .el-input[data-v-8d0fe2b9],.prop-row .el-select[data-v-8d0fe2b9],.prop-row .el-input-number[data-v-8d0fe2b9]{flex:1;max-width:140px}.prop-row-col[data-v-8d0fe2b9]{flex-wrap:wrap}.prop-row-main[data-v-8d0fe2b9]{align-items:center;gap:8px;width:100%;display:flex}.prop-row-main label[data-v-8d0fe2b9]{min-width:60px}.prop-row-main .el-input-number[data-v-8d0fe2b9]{flex:1;max-width:140px}.prop-hint[data-v-8d0fe2b9]{color:#999;white-space:nowrap;margin-top:2px;margin-left:68px;font-size:11px}.prop-actions[data-v-8d0fe2b9]{border-top:1px solid #e4e7ed;gap:4px;margin-top:12px;padding-top:12px;display:flex}.empty[data-v-8d0fe2b9]{text-align:center;color:#999;padding-top:40px;font-size:13px}.process-diagram-editor[data-v-8ecfadf7]{background:#f5f5f5;flex-direction:column;height:100vh;display:flex}.editor-header[data-v-8ecfadf7]{background:#fff;border-bottom:1px solid #e4e7ed;justify-content:space-between;align-items:center;height:48px;padding:0 16px;display:flex}.header-left[data-v-8ecfadf7]{align-items:center;gap:8px;display:flex}.title-input[data-v-8ecfadf7]{width:400px}.user-name-input[data-v-8ecfadf7]{width:160px;margin-left:8px}.header-right[data-v-8ecfadf7]{align-items:center;gap:8px;display:flex}.collab-users[data-v-8ecfadf7]{align-items:center;gap:0;display:flex}.collab-avatar[data-v-8ecfadf7]{color:#fff;border:2px solid #fff;border-radius:50%;justify-content:center;align-items:center;width:24px;height:24px;margin-left:-6px;font-size:11px;font-weight:500;display:flex}.collab-avatar[data-v-8ecfadf7]:first-child{margin-left:0}.collab-more[data-v-8ecfadf7]{color:#999;margin-left:4px;font-size:11px}.editor-body[data-v-8ecfadf7]{flex:1;display:flex;overflow:hidden}.editor-main[data-v-8ecfadf7]{flex-direction:column;flex:1;display:flex;overflow:hidden}.editor-main .diagram-canvas[data-v-8ecfadf7]{flex:1}
2
+ /*$vite$:1*/
@@ -0,0 +1,48 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t(require("vue"),require("@billtaofbj/core"),require("vue-router"),require("element-plus"),require("axios"),require("yjs"),require("@hocuspocus/provider"),require("@element-plus/icons-vue")):typeof define==`function`&&define.amd?define([`vue`,`@billtaofbj/core`,`vue-router`,`element-plus`,`axios`,`yjs`,`@hocuspocus/provider`,`@element-plus/icons-vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,e.YourCompanyDiagram=t(e.Vue,e._billtaofbj_core,e.VueRouter,e.ElementPlus,e.axios,e.yjs,e._hocuspocus_provider,e.ElementPlusIconsVue))})(this,function(e,t,n,r,i,a,o,s){var c=Object.create,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,f=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty,m=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=d(t),a=0,o=i.length,s;a<o;a++)s=i[a],!p.call(e,s)&&s!==n&&l(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=u(t,s))||r.enumerable});return e},h=(e,t,n)=>(n=e==null?{}:c(f(e)),m(t||!e||!e.__esModule?l(n,`default`,{value:e,enumerable:!0}):n,e));i=h(i,1),a=h(a,1);var g=i.default.create({baseURL:`/api`,timeout:3e4}),_={list:e=>g.get(`/documents/`,{params:e}),get:e=>g.get(`/documents/${e}`),create:e=>g.post(`/documents/`,e),update:(e,t)=>g.put(`/documents/${e}`,t),delete:e=>g.delete(`/documents/${e}`),addAttachment:(e,t)=>g.post(`/documents/${e}/attachments`,t),listAttachments:e=>g.get(`/documents/${e}/attachments`)};function v(t,n={}){let r=new a.Doc,i=(0,e.ref)(!1),s=(0,e.ref)(!1),c=(0,e.ref)(null),l=(0,e.ref)([]),u=(0,e.ref)(!1),d=(0,e.reactive)({name:`用户${Math.floor(Math.random()*1e3)}`,color:`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,`0`)}`}),f=null,p=null,m=null,h=()=>{g(),p=setInterval(()=>{if(f&&f.connection&&f.connection.ws&&f.connection.ws.readyState===WebSocket.CLOSED)try{f.connect()}catch(e){console.warn(`Reconnect failed:`,e)}},3e4)},g=()=>{p&&=(clearInterval(p),null)},_=(e,n)=>{f&&v(),f=new o.HocuspocusProvider({url:n||`ws://${window.location.hostname}:1234`,name:e||(typeof t==`object`?t.value:t),document:r,connect:!0,reconnect:!0,onConnect:()=>{i.value=!0,h()},onClose:()=>{i.value=!1,s.value=!1},onSynced:({state:e})=>{s.value=e},onAwarenessUpdate:({states:e})=>{l.value=Array.from(e.entries()).filter(([e])=>e!==r.clientID).map(([e,t])=>({clientId:e,...t.user||{}}))}}),c.value=f.awareness,h();let a=r.getMap(`_meta`);return a.observe(e=>{e.keysChanged.has(`_closed`)&&(u.value=a.get(`_closed`)===!0)}),f},v=()=>{if(g(),f){try{f.disconnect(),f.destroy()}catch(e){console.warn(`Collaboration disconnect error:`,e)}f=null}i.value=!1,s.value=!1,c.value=null,l.value=[]};return(0,e.onUnmounted)(()=>{v()}),{doc:r,isConnected:i,isSynced:s,awareness:c,peers:l,localUser:d,collaborationClosed:u,connect:_,disconnect:v,closeCollaboration:()=>{u.value=!0;let e=r.getMap(`_meta`);r.transact(()=>{e.set(`_closed`,!0)}),v()},checkCollaborationClosed:()=>r.getMap(`_meta`).get(`_closed`)===!0?(u.value=!0,!0):!1,setLocalUser:e=>{Object.assign(d,e),f&&f.awareness.setLocalStateField(`user`,d)},getSharedData:e=>r.get(e),setSharedData:(e,t)=>{let n=r.getMap(e);r.transact(()=>{typeof t==`object`&&t&&Object.entries(t).forEach(([e,t])=>{n.set(e,t)})})},syncToYjs:(e,t)=>{let n=r.getMap(e),i=JSON.stringify(t);m=i,r.transact(()=>{n.set(`_json`,i)})},onRemoteChange:(e,t)=>{let n=r.getMap(e);n.observe(()=>{let e=n.get(`_json`);if(e!==m&&e)try{t(JSON.parse(e))}catch(e){console.error(`[Collab] JSON parse failed:`,e)}})},observeSharedData:(e,t)=>{let n=r.getMap(e);return n.observe(t),()=>n.unobserve(t)},getSharedArray:e=>r.getArray(e),addToArray:(e,t)=>{r.getArray(e).push([t])},removeFromArray:(e,t)=>{r.getArray(e).delete(t,1)},updateArrayItem:(e,t,n)=>{let i=r.getArray(e);i.delete(t,1),i.insert(t,[n])},getSharedMap:e=>r.getMap(e),setMapValue:(e,t,n)=>{r.getMap(e).set(t,n)},deleteMapValue:(e,t)=>{r.getMap(e).delete(t)},observeMap:(e,t)=>{let n=r.getMap(e);return n.observe(t),()=>n.unobserve(t)},encodeState:()=>a.encodeStateAsUpdate(r),decodeState:e=>{a.applyUpdate(r,e)},getDocId:()=>r.clientID}}var y={classic:{name:`经典`,description:`扁平化设计,简洁清晰`,colors:{primary:`#409eff`,success:`#67c23a`,warning:`#e6a23c`,danger:`#f56c6c`,info:`#909399`,purple:`#9b59b6`,cyan:`#1abc9c`,orange:`#ff9800`,pink:`#e91e63`,blue:`#3498db`,teal:`#00bcd4`,grayBlue:`#607d8b`,yellow:`#f1c40f`,gray:`#95a5a6`},nodeStyle:{fill:`solid`,stroke:`solid`,shadow:!0,shadowBlur:3,shadowColor:`rgba(0,0,0,0.15)`,shadowOffset:2,borderRadius:6,borderWidth:2},animation:{defaultDuration:2}},glass:{name:`玻璃拟态`,description:`半透明毛玻璃效果,现代感`,colors:{primary:`rgba(64, 158, 255, 0.7)`,success:`rgba(103, 194, 58, 0.7)`,warning:`rgba(230, 162, 60, 0.7)`,danger:`rgba(245, 108, 108, 0.7)`,info:`rgba(144, 147, 153, 0.7)`,purple:`rgba(155, 89, 182, 0.7)`,cyan:`rgba(26, 188, 156, 0.7)`,orange:`rgba(255, 152, 0, 0.7)`,pink:`rgba(233, 30, 99, 0.7)`,blue:`rgba(52, 152, 219, 0.7)`,teal:`rgba(0, 188, 212, 0.7)`,grayBlue:`rgba(96, 125, 139, 0.7)`,yellow:`rgba(241, 196, 15, 0.7)`,gray:`rgba(149, 165, 166, 0.7)`},nodeStyle:{fill:`solid`,stroke:`solid`,shadow:!0,shadowBlur:8,shadowColor:`rgba(0,0,0,0.1)`,shadowOffset:4,borderRadius:12,borderWidth:1,backdropFilter:!0,glassHighlight:!0},animation:{defaultDuration:2.5}},gradient:{name:`渐变`,description:`多彩渐变填充,视觉丰富`,colors:{primary:[`#0d3366`,`#409eff`,`#c0e4ff`],success:[`#1a4d08`,`#67c23a`,`#c0f0a0`],warning:[`#7a5000`,`#e6a23c`,`#ffeaa0`],danger:[`#801818`,`#f56c6c`,`#ffc0c0`],info:[`#404850`,`#909399`,`#d8e0e8`],purple:[`#3a1858`,`#9b59b6`,`#d8a8f0`],cyan:[`#064830`,`#1abc9c`,`#80f0d8`],orange:[`#884400`,`#ff9800`,`#ffcc90`],pink:[`#701030`,`#e91e63`,`#ffa0d0`],blue:[`#0c4480`,`#3498db`,`#a0d8ff`],teal:[`#004848`,`#00bcd4`,`#80e8e8`],grayBlue:[`#283848`,`#607d8b`,`#b0d0e0`],yellow:[`#806800`,`#f1c40f`,`#ffff98`],gray:[`#484e58`,`#95a5a6`,`#d0d8e0`]},nodeStyle:{fill:`gradient`,stroke:`solid`,shadow:!0,shadowBlur:6,shadowColor:`rgba(0,0,0,0.2)`,shadowOffset:3,borderRadius:8,borderWidth:0},animation:{defaultDuration:2}},neon:{name:`霓虹`,description:`深色背景+发光边框,科技感`,colors:{primary:`#00d4ff`,success:`#00ff88`,warning:`#ffaa00`,danger:`#ff4466`,info:`#8899aa`,purple:`#cc66ff`,cyan:`#00ffcc`,orange:`#ff8800`,pink:`#ff66aa`,blue:`#4488ff`,teal:`#00ccaa`,grayBlue:`#6688aa`,yellow:`#ffdd00`,gray:`#667788`},nodeStyle:{fill:`dark`,stroke:`glow`,shadow:!0,shadowBlur:12,shadowColor:`currentColor`,shadowOffset:0,borderRadius:8,borderWidth:2,glowEffect:!0},animation:{defaultDuration:1.5}},sketch:{name:`手绘`,description:`手绘风格描边,活泼有趣`,colors:{primary:`#5b9bd5`,success:`#70ad47`,warning:`#ffc000`,danger:`#ff6b6b`,info:`#a5a5a5`,purple:`#9966cc`,cyan:`#44bba4`,orange:`#ff8844`,pink:`#ff77aa`,blue:`#5599dd`,teal:`#44bba4`,grayBlue:`#7799aa`,yellow:`#ffdd44`,gray:`#bbbbbb`},nodeStyle:{fill:`solid`,stroke:`sketch`,shadow:!1,shadowBlur:0,shadowColor:`transparent`,shadowOffset:0,borderRadius:4,borderWidth:2,sketchStyle:!0},animation:{defaultDuration:2}},colorful:{name:`五彩`,description:`五彩斑斓,多色融合碰撞`,colors:{primary:[`#ff6b6b`,`#ffa94d`,`#ffd43b`,`#69db7c`,`#4dabf7`],success:[`#51cf66`,`#94d82d`,`#fcc419`,`#ff922b`,`#ff6b6b`],warning:[`#845ef7`,`#5c7cfa`,`#339af0`,`#22b8cf`,`#20c997`],danger:[`#f06595`,`#e599f7`,`#cc5de8`,`#845ef7`,`#5c7cfa`],info:[`#868e96`,`#adb5bd`,`#ced4da`,`#dee2e6`,`#f1f3f5`],purple:[`#ff6b6b`,`#e64980`,`#cc5de8`,`#845ef7`,`#5c7cfa`],cyan:[`#20c997`,`#3bc9db`,`#22b8cf`,`#339af0`,`#5c7cfa`],orange:[`#ffd43b`,`#fab005`,`#f08c00`,`#e8590c`,`#d9480f`],pink:[`#fcc2d7`,`#f783ac`,`#e64980`,`#c2255c`,`#862e9c`],blue:[`#4dabf7`,`#339af0`,`#228be6`,`#1c7ed6`,`#1971c2`],teal:[`#38d9a9`,`#20c997`,`#12b886`,`#0ca678`,`#099268`],grayBlue:[`#495057`,`#6c757d`,`#adb5bd`,`#dee2e6`,`#f8f9fa`],yellow:[`#ffd43b`,`#ffe066`,`#fff3bf`,`#fff9db`,`#ffec99`],gray:[`#343a40`,`#495057`,`#868e96`,`#ced4da`,`#f1f3f5`]},nodeStyle:{fill:`colorful`,stroke:`solid`,shadow:!0,shadowBlur:6,shadowColor:`rgba(0,0,0,0.2)`,shadowOffset:3,borderRadius:8,borderWidth:0},animation:{defaultDuration:2}}},b={none:{name:`无`,description:`默认无动画`,category:`none`},pulse:{name:`脉冲`,description:`周期性缩放`,category:`transform`},bounce:{name:`弹跳`,description:`上下弹跳`,category:`transform`},spin:{name:`旋转`,description:`360度持续旋转`,category:`transform`},fadeIn:{name:`淡入闪烁`,description:`透明度周期性变化`,category:`opacity`},fadeOut:{name:`淡出闪烁`,description:`透明度深闪`,category:`opacity`},colorShift:{name:`色相偏移`,description:`色相周期性旋转`,category:`color`},ripple:{name:`波纹扩散`,description:`从中心向外扩散`,category:`transform`},breathing:{name:`呼吸灯`,description:`边框/阴影周期性明暗变化`,category:`glow`},glowPulse:{name:`流光脉冲`,description:`发光边框脉冲效果`,category:`glow`},float:{name:`悬浮`,description:`轻微上下浮动`,category:`transform`},shake:{name:`抖动`,description:`轻微左右抖动(警告状态)`,category:`transform`},scaleIn:{name:`弹性缩放`,description:`弹性缩放进入`,category:`transform`},neonFlow:{name:`霓虹流动`,description:`霓虹灯边框流动效果`,category:`glow`}},x={none:{name:`无`,description:`默认无动画`},flow:{name:`粒子流动`,description:`粒子沿路径移动`},dashFlow:{name:`虚线流动`,description:`虚线循环流动`},particleGlow:{name:`粒子发光`,description:`粒子发光闪烁`},pulse:{name:`脉冲流动`,description:`脉冲效果沿路径移动`},neon:{name:`霓虹流动`,description:`霓虹灯效果流动`}};function S(e,t,n){let r=(y[e]||y.classic).nodeStyle;return t?{color:`#409eff`,width:3,dasharray:`none`}:r.stroke===`glow`?{color:n,width:r.borderWidth,dasharray:`none`,glow:!0}:r.stroke===`sketch`?{color:n,width:r.borderWidth,dasharray:`none`,sketch:!0}:{color:n,width:r.borderWidth,dasharray:`none`}}function C(e){let t=(y[e]||y.classic).nodeStyle;return t.sketchStyle?`sketch`:t.shadow?t.glowEffect?`neon-glow`:t.backdropFilter?`glass-shadow`:`shadow`:`none`}var w={start:{label:`开始`,desc:`流程的起点,每个流程图只能有一个开始节点`,width:60,height:60,shape:`ellipse`,color:`#67c23a`},end:{label:`结束`,desc:`流程的终点,表示流程执行完毕`,width:60,height:60,shape:`ellipse`,color:`#909399`},process:{label:`处理`,desc:`通用处理步骤,表示一个操作或任务`,width:140,height:60,shape:`rect`,color:`#409eff`},decision:{label:`判断`,desc:`条件判断节点,根据条件走不同分支(是/否)`,width:100,height:80,shape:`diamond`,color:`#e6a23c`},approval:{label:`审批`,desc:`需要人工审批的节点,审批人可同意或驳回`,width:140,height:60,shape:`rect`,color:`#e6a23c`,icon:`stamp`},condition:{label:`条件判断`,desc:`根据条件走不同分支,支持多条件表达式`,width:110,height:80,shape:`diamond`,color:`#f56c6c`},parallel:{label:`并行网关`,desc:`并行执行多个分支,所有分支完成后汇合继续`,width:80,height:80,shape:`diamond`,color:`#9b59b6`},code:{label:`代码执行`,desc:`执行一段代码逻辑,如数据处理、计算等`,width:140,height:60,shape:`rect`,color:`#409eff`,icon:`code`},database:{label:`数据库操作`,desc:`对数据库进行增删改查操作`,width:130,height:70,shape:`cylinder`,color:`#1abc9c`},api:{label:`API调用`,desc:`调用外部RESTful或内部微服务API接口`,width:130,height:60,shape:`hexagon`,color:`#3498db`},http:{label:`HTTP请求`,desc:`发送HTTP请求到外部系统,获取或推送数据`,width:130,height:60,shape:`hexagon`,color:`#00bcd4`},script:{label:`脚本执行`,desc:`运行Shell/Python等脚本,执行自动化任务`,width:140,height:60,shape:`rect`,color:`#607d8b`,icon:`terminal`},timer:{label:`定时器`,desc:`按设定时间间隔或定时触发后续流程`,width:90,height:90,shape:`timer`,color:`#ff9800`},event:{label:`事件触发`,desc:`监听外部事件,事件发生时触发流程执行`,width:100,height:60,shape:`rounded闪电`,color:`#e91e63`},subprocess:{label:`子流程`,desc:`可展开的子流程,表示一组封装的步骤`,width:140,height:60,shape:`subprocess`,color:`#409eff`},person:{label:`人员`,desc:`表示由具体人员执行的操作`,width:60,height:80,shape:`person`,color:`#3498db`},document:{label:`文档`,desc:`表示生成或输出一份文档/报告`,width:120,height:60,shape:`document`,color:`#9b59b6`},data:{label:`数据`,desc:`表示数据的输入或输出操作`,width:120,height:60,shape:`parallelogram`,color:`#1abc9c`},group:{label:`分组`,desc:`将多个节点归为一组,便于管理和组织`,width:140,height:80,shape:`folder`,color:`#95a5a6`},annotation:{label:`注释`,desc:`添加说明文字,不影响流程执行`,width:120,height:60,shape:`note`,color:`#f1c40f`},custom:{label:`自定义`,desc:`自定义组件,可设置图片`,width:120,height:120,shape:`rect`,color:`#dcdfe6`}},T=b,E={solid:{label:`实线`},dashed:{label:`虚线`},dotted:{label:`点线`},animated:{label:`动画线`}},D={flow:`业务流程图`,swimlane:`泳道图`,architecture:`架构图`},O={approval:`审批流程图`,execution:`执行流程图`,dataflow:`数据流程图`};function k(e,t,n,r={}){let i=w[e]||w.process;return{id:`node_`+Date.now()+`_`+Math.random().toString(36).substr(2,6),type:e,x:t,y:n,width:i.width,height:i.height,shape:i.shape||`rect`,label:i.label,color:i.color,textColor:`#ffffff`,fontSize:13,strokeWidth:2,strokeColor:`#333333`,animation:`none`,animationDuration:2,animationDelay:0,labelPosition:`center`,textRotation:-90,zIndex:0,locked:!1,visible:!0,remark:``,inputParams:[],outputParams:[],image:``,data:{},...r}}function A(e,t,n={}){return{id:`edge_`+Date.now()+`_`+Math.random().toString(36).substr(2,6),sourceId:e,targetId:t,label:``,lineStyle:`solid`,lineColor:`#333333`,lineWidth:2,arrowType:`end`,animation:`none`,animationDuration:2,animationSpeed:`normal`,particleColor:``,waypoints:[],curveType:`bezier`,strokeDashoffset:0,condition:``,remark:``,...n}}function j(e,t=`horizontal`,n={}){return{id:`swim_`+Date.now()+`_`+Math.random().toString(36).substr(2,6),name:e,direction:t,x:0,y:0,width:t===`horizontal`?800:200,height:t===`horizontal`?150:600,color:`#f5f7fa`,borderColor:`#dcdfe6`,headerColor:`#409eff`,headerTextColor:`#ffffff`,fontSize:14,fontFamily:`sans-serif`,fontWeight:`600`,fontStyle:`normal`,textAlign:`center`,headerOpacity:1,lanes:[],...n}}function M(e,t,n={}){return{id:`lane_`+Date.now()+`_`+Math.random().toString(36).substr(2,6),swimlaneId:e,name:t,color:`#fafafa`,headerColor:``,height:100,width:200,textColor:`#666666`,fontSize:11,fontFamily:`sans-serif`,fontWeight:`normal`,fontStyle:`normal`,textAlign:`left`,opacity:1,...n}}function N(t=`process`,n=null){let r=t===`process`,i=[`start`,`end`,`process`,`decision`,`subprocess`,`document`,`data`,`person`,`group`,`annotation`,`custom`],a=[`start`,`end`,`approval`,`condition`,`parallel`,`subprocess`,`person`,`document`,`data`,`group`,`annotation`,`custom`],o=[`start`,`end`,`code`,`database`,`condition`,`subprocess`,`document`,`data`,`group`,`annotation`,`custom`],s=[`start`,`end`,`code`,`api`,`http`,`script`,`timer`,`event`,`condition`,`parallel`,`database`,`subprocess`,`document`,`data`,`group`,`annotation`,`custom`],c=(0,e.reactive)([]),l=(0,e.reactive)([]),u=(0,e.reactive)([]),d=(0,e.ref)(null),f=(0,e.ref)(null),p=(0,e.ref)(null),m=(0,e.ref)(!1),h=(0,e.ref)(null),g=(0,e.ref)(n||(r?`flow`:`approval`)),_=(0,e.ref)(`未命名流程图`),v=(0,e.ref)(`classic`),S=(0,e.ref)([]),C=(0,e.ref)([]),N=(0,e.computed)(()=>{let e={flow:i,approval:a,dataflow:o,execution:s}[g.value]||i;return Object.fromEntries(e.map(e=>[e,w[e]]))}),P=(0,e.computed)(()=>c.find(e=>e.id===d.value)||null),F=(0,e.computed)(()=>l.find(e=>e.id===f.value)||null),I=()=>{S.value.push(JSON.parse(JSON.stringify({nodes:c,edges:l,swimlanes:u}))),S.value.length>50&&S.value.shift(),C.value=[]},L=()=>{if(S.value.length===0)return;C.value.push(JSON.parse(JSON.stringify({nodes:c,edges:l,swimlanes:u})));let e=S.value.pop();c.length=0,l.length=0,u.length=0,c.push(...e.nodes),l.push(...e.edges),u.push(...e.swimlanes)},R=()=>{if(C.value.length===0)return;S.value.push(JSON.parse(JSON.stringify({nodes:c,edges:l,swimlanes:u})));let e=C.value.pop();c.length=0,l.length=0,u.length=0,c.push(...e.nodes),l.push(...e.edges),u.push(...e.swimlanes)},z=(e,t,n,r)=>{I();let i=k(e,t,n,r);return c.push(i),i},B=(e,t,n)=>{let r=l.find(n=>n.sourceId===e&&n.targetId===t);if(r)return r;I();let i=A(e,t,n);return l.push(i),i},V=(e,t,n)=>{I();let r=j(e,t,n);return u.push(r),r},H=(e,t,n)=>{I();let r=u.find(t=>t.id===e);if(!r)return null;let i=r.lanes?.reduce((e,t)=>e+(t.width||200),0)||0,a=r.lanes?.length||0,o=M(e,t,{width:r.direction===`vertical`&&a>0?Math.floor(i/a):200,...n});return r.lanes||=[],r.lanes.push(o),r.direction===`vertical`&&(r.width=r.lanes.reduce((e,t)=>e+(t.width||200),0)),o},U=(e,t)=>{let n=c.find(t=>t.id===e);n&&Object.assign(n,t)},W=(e,t)=>{let n=l.find(t=>t.id===e);n&&Object.assign(n,t)},G=e=>{I();let t=c.findIndex(t=>t.id===e);t>=0&&c.splice(t,1),l.splice(0,l.length,...l.filter(t=>t.sourceId!==e&&t.targetId!==e)),d.value===e&&(d.value=null)},ee=e=>{I();let t=l.findIndex(t=>t.id===e);t>=0&&l.splice(t,1),f.value===e&&(f.value=null)},K=e=>{I();let t=u.findIndex(t=>t.id===e);t>=0&&u.splice(t,1)},q=()=>{I(),c.length=0,l.length=0,u.length=0,d.value=null,f.value=null},te=e=>{d.value=e,f.value=null,p.value=null},ne=e=>{f.value=e,d.value=null,p.value=null},J=e=>c.filter(t=>t.swimlaneId===e),re=e=>{let t=c.find(t=>t.id===e);t&&(t.zIndex=Math.max(...c.map(e=>e.zIndex||0))+1)},Y=e=>{let t=c.find(t=>t.id===e);t&&(t.zIndex=Math.min(...c.map(e=>e.zIndex||0))-1)},ie=()=>({version:`1.0`,mode:t,type:g.value,title:_.value,theme:v.value,nodes:JSON.parse(JSON.stringify(c)),edges:JSON.parse(JSON.stringify(l)),swimlanes:JSON.parse(JSON.stringify(u)),exportTime:new Date().toISOString()}),ae=e=>e?(c.length=0,l.length=0,u.length=0,e.nodes&&c.push(...e.nodes),e.edges&&l.push(...e.edges),e.swimlanes&&u.push(...e.swimlanes),e.title&&(_.value=e.title),e.type?g.value=e.type:e.subType&&(g.value=e.subType),e.theme&&(v.value=e.theme),S.value=[],C.value=[],!0):!1,oe=(e=`vertical`)=>{I();let t=r?40:50,n=r?50:80;c.forEach((r,i)=>{e===`vertical`?(r.x=300,r.y=n,n+=r.height+t):(r.x=50+i*(r.width+t),r.y=200)})},se=e=>{switch(q(),e){case`approval`:ce();break;case`execution`:le();break;case`dataflow`:ue();break;case`business`:de();break;case`h-swimlane`:fe();break;case`v-swimlane`:pe();break}},ce=()=>{_.value=`审批流程`;let e=z(`start`,300,30),t=z(`person`,290,130);t.label=`申请人`;let n=z(`approval`,250,250);n.label=`部门审批`;let r=z(`condition`,275,370);r.label=`审批通过?`;let i=z(`approval`,250,500);i.label=`总经理审批`;let a=z(`code`,250,620);a.label=`系统通知`;let o=z(`end`,300,730);B(e.id,t.id),B(t.id,n.id),B(n.id,r.id),B(r.id,i.id,{label:`否`}),B(r.id,a.id,{label:`是`}),B(i.id,a.id),B(a.id,o.id)},le=()=>{_.value=`程序执行流程`;let e=z(`start`,300,30),t=z(`api`,260,130);t.label=`接收请求`;let n=z(`code`,250,250);n.label=`参数校验`;let r=z(`condition`,275,370);r.label=`校验通过?`;let i=z(`database`,265,490);i.label=`查询数据库`;let a=z(`code`,250,610);a.label=`处理业务逻辑`;let o=z(`http`,260,730);o.label=`返回响应`;let s=z(`end`,300,850),c=z(`code`,480,370);c.label=`返回错误码`,B(e.id,t.id),B(t.id,n.id),B(n.id,r.id),B(r.id,i.id,{label:`是`}),B(r.id,c.id,{label:`否`}),B(i.id,a.id),B(a.id,o.id),B(o.id,s.id),B(c.id,s.id)},ue=()=>{_.value=`数据流程图`;let e=z(`start`,300,30),t=z(`data`,260,130);t.label=`数据源输入`;let n=z(`database`,265,260);n.label=`数据存储`;let r=z(`code`,250,390);r.label=`ETL转换`;let i=z(`condition`,275,510);i.label=`数据校验`;let a=z(`database`,265,640);a.label=`写入目标库`;let o=z(`document`,260,770);o.label=`生成报表`;let s=z(`end`,300,890);B(e.id,t.id),B(t.id,n.id),B(n.id,r.id),B(r.id,i.id),B(i.id,a.id,{label:`通过`}),B(a.id,o.id),B(o.id,s.id)},de=()=>{_.value=`业务流程图`;let e=z(`start`,300,30);e.label=`客户提交申请`;let t=z(`document`,260,130);t.label=`填写申请表`;let n=z(`process`,250,250);n.label=`前台受理`;let r=z(`condition`,275,370);r.label=`资料齐全?`;let i=z(`person`,290,490);i.label=`业务员审核`;let a=z(`condition`,275,610);a.label=`审核通过?`;let o=z(`process`,250,730);o.label=`业务办理`;let s=z(`document`,260,850);s.label=`生成回执`;let c=z(`end`,300,960);c.label=`流程结束`;let l=z(`process`,480,370);l.label=`退回补正`;let u=z(`annotation`,480,610);u.label=`驳回并说明原因`,B(e.id,t.id),B(t.id,n.id),B(n.id,r.id),B(r.id,i.id,{label:`是`}),B(r.id,l.id,{label:`否`}),B(l.id,t.id),B(i.id,a.id),B(a.id,o.id,{label:`通过`}),B(a.id,u.id,{label:`驳回`}),B(u.id,c.id),B(o.id,s.id),B(s.id,c.id)},fe=()=>{_.value=`水平泳道图 - 订单处理`;let e=V(`订单处理流程`,`horizontal`,{width:900,height:450});H(e.id,`客户`,{height:150}),H(e.id,`销售`,{height:150}),H(e.id,`仓库`,{height:150});let t=z(`start`,120,70);t.label=`下单`;let n=z(`process`,250,70);n.label=`选择商品`;let r=z(`process`,400,70);r.label=`确认支付`;let i=z(`process`,120,220);i.label=`接收订单`;let a=z(`condition`,280,210);a.label=`库存检查`;let o=z(`process`,430,220);o.label=`确认发货`;let s=z(`process`,120,370);s.label=`拣货打包`;let c=z(`process`,300,370);c.label=`安排物流`;let l=z(`end`,460,370);l.label=`送达客户`,B(t.id,n.id),B(n.id,r.id),B(r.id,i.id),B(i.id,a.id),B(a.id,o.id,{label:`有货`}),B(a.id,s.id,{label:`缺货`}),B(o.id,s.id),B(s.id,c.id),B(c.id,l.id)},pe=()=>{_.value=`垂直泳道图 - 审批流程`;let e=V(`审批流程`,`vertical`,{width:750,height:600});H(e.id,`申请人`,{width:150}),H(e.id,`部门主管`,{width:150}),H(e.id,`HR`,{width:150}),H(e.id,`财务`,{width:150});let t=z(`start`,50,80);t.label=`发起申请`;let n=z(`process`,220,80);n.label=`部门审批`;let r=z(`condition`,370,70);r.label=`金额>5000?`;let i=z(`process`,530,80);i.label=`HR复审`;let a=z(`process`,530,220);a.label=`财务审批`;let o=z(`process`,220,350);o.label=`执行付款`;let s=z(`document`,50,350);s.label=`收到通知`;let c=z(`end`,50,480);c.label=`完成`,B(t.id,n.id),B(n.id,r.id),B(r.id,i.id,{label:`是`}),B(r.id,o.id,{label:`否`}),B(i.id,a.id),B(a.id,o.id),B(o.id,s.id),B(s.id,c.id)};return{NODE_TYPES:N,ANIMATION_TYPES:T,LINE_STYLES:E,nodes:c,edges:l,swimlanes:u,selectedNodeId:d,selectedEdgeId:f,selectedSwimlaneId:p,selectedNode:P,selectedEdge:F,connectMode:m,connectSource:h,diagramType:g,diagramTitle:_,currentTheme:v,undoStack:S,redoStack:C,saveState:I,undo:L,redo:R,addNode:z,addEdge:B,addSwimlane:V,addLane:H,updateNode:U,updateEdge:W,removeNode:G,removeEdge:ee,removeSwimlane:K,clearAll:q,selectNode:te,selectEdge:ne,getNodesInSwimlane:J,bringToFront:re,sendToBack:Y,toJSON:ie,fromJSON:ae,autoLayout:oe,loadTemplate:se,createNode:k,createEdge:A,PROCESS_TYPE_LABELS:D,EXECUTION_TYPE_LABELS:O,THEMES:y,ANIMATIONS:b,EDGE_ANIMATIONS:x}}var P=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},F={class:`chat-header`},I={class:`chat-header-left`},L={class:`chat-title`},R={class:`online-users-list`},z={class:`online-user-item`},B={class:`online-user-name`},V={key:1},H={class:`online-user-name`},U={class:`chat-header-right`},W={key:0,class:`chat-empty`},G={class:`chat-empty-hint`},ee={key:1},K={class:`message-content`},q={key:0,class:`message-meta`},te={key:0,class:`message-mention`},ne=[`innerHTML`],J={class:`message-time`},re={key:1,class:`chat-message chat-message-ai`},Y={class:`message-avatar ai`},ie={class:`chat-input-area`},ae={key:0,class:`mention-popup`},oe=[`onClick`,`onMouseenter`],se={key:1},ce=P({__name:`AiChatPanel`,props:{visible:{type:Boolean,default:!1},messages:{type:Array,default:()=>[]},loading:{type:Boolean,default:!1},panelWidth:{type:Number,default:360},isCollab:{type:Boolean,default:!1},collabUsers:{type:Array,default:()=>[]},currentUser:{type:Object,default:()=>({id:``,name:``,color:``})},isOwner:{type:Boolean,default:!0},unreadMention:{type:Boolean,default:!1}},emits:[`send`,`close`,`clear`,`clear-unread`],setup(t,{emit:n}){let r=t,i=n,a=(0,e.ref)(``),o=(0,e.ref)(null),c=(0,e.ref)(null),l=(0,e.ref)(!1),u=(0,e.ref)([]),d=(0,e.ref)(0),f=``,p=-1,m={id:`ai-assistant`,name:`AI助手`,color:`#409EFF`,isAi:!0},h=(0,e.computed)(()=>{let e=r.currentUser.id,t=new Set;return[m,...r.collabUsers.filter(n=>{let r=n.clientId||n.id||``;if(r&&r===e)return!1;let i=String(r||n.name||``);return t.has(i)?!1:(t.add(i),!0)})]}),g=(0,e.computed)(()=>h.value.length+1),_=e=>e.role===`ai`?`chat-message-ai`:r.isCollab&&e.user_id&&e.user_id!==r.currentUser.id?`chat-message-other`:`chat-message-user`,v=e=>e.role===`ai`?{background:`linear-gradient(135deg, #409EFF, #337ECC)`}:{background:e.user_color||`#67C23A`},y=e=>(e.user_name||`U`).charAt(0),b=e=>{if(!r.isCollab)return;let t=typeof e==`string`?e:e.target?.value||a.value,n=t.length,i=t.lastIndexOf(`@`,n);if(i!==-1&&i<n){let e=t.slice(i+1,n);if(!e.includes(` `)&&!e.includes(`
2
+ `)){f=e,p=i,u.value=h.value.filter(t=>t.name&&t.name.toLowerCase().includes(e.toLowerCase())),l.value=u.value.length>0,d.value=0;return}}l.value=!1},x=()=>{l.value&&(d.value=Math.min(d.value+1,u.value.length-1))},S=()=>{l.value&&(d.value=Math.max(d.value-1,0))},C=e=>{let t=a.value.slice(0,p),n=a.value.slice(p+f.length+1);a.value=`${t}@${e.name} ${n}`,l.value=!1},w=e=>{if(e){if(e.shiftKey)return;if(l.value){let t=u.value[d.value];if(t){e.preventDefault(),C(t);return}}e.preventDefault()}let t=a.value.trim();if(!t||r.loading)return;let n=null;if(r.isCollab){let e=t.match(/@(\S+)/);e&&(n=e[1])}i(`send`,t,{mentionedUser:n}),a.value=``,l.value=!1},T=()=>{(0,e.nextTick)(()=>{o.value&&(o.value.scrollTop=o.value.scrollHeight)})};return(0,e.watch)(()=>r.messages.length,T),(0,e.watch)(()=>r.messages,T,{deep:!0}),(n,r)=>{let f=(0,e.resolveComponent)(`el-icon`),p=(0,e.resolveComponent)(`el-tag`),m=(0,e.resolveComponent)(`el-popover`),T=(0,e.resolveComponent)(`el-button`),E=(0,e.resolveComponent)(`el-input`);return t.visible?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,class:`ai-chat-panel`,style:(0,e.normalizeStyle)({width:t.panelWidth+`px`})},[(0,e.createElementVNode)(`div`,F,[(0,e.createElementVNode)(`div`,I,[(0,e.createVNode)(f,{size:18,color:`#409EFF`},{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(s.Monitor))]),_:1}),(0,e.createElementVNode)(`span`,L,(0,e.toDisplayString)(t.isCollab?`协作聊天`:`AI 助手`),1),t.isCollab?((0,e.openBlock)(),(0,e.createBlock)(m,{key:0,width:200,placement:`bottom-start`,trigger:`click`},{reference:(0,e.withCtx)(()=>[(0,e.createVNode)(p,{size:`small`,type:`success`,effect:`plain`,class:`online-tag`},{default:(0,e.withCtx)(()=>[(0,e.createTextVNode)((0,e.toDisplayString)(g.value)+`人在线 `,1)]),_:1})]),default:(0,e.withCtx)(()=>[(0,e.createElementVNode)(`div`,R,[(0,e.createElementVNode)(`div`,z,[(0,e.createElementVNode)(`div`,{class:`online-user-avatar`,style:(0,e.normalizeStyle)({background:t.currentUser.color||`#409EFF`})},(0,e.toDisplayString)((t.currentUser.name||`U`).charAt(0)),5),(0,e.createElementVNode)(`span`,B,(0,e.toDisplayString)(t.currentUser.name||`我`),1),(0,e.createVNode)(p,{size:`small`,type:t.isOwner?`warning`:`success`,effect:`plain`,class:`role-tag`},{default:(0,e.withCtx)(()=>[(0,e.createTextVNode)((0,e.toDisplayString)(t.isOwner?`发起人`:`协作人`),1)]),_:1},8,[`type`]),r[4]||=(0,e.createElementVNode)(`span`,{class:`self-tag`},`(我)`,-1)]),((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(h.value,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:t.id||t.clientId,class:`online-user-item`},[(0,e.createElementVNode)(`div`,{class:`online-user-avatar`,style:(0,e.normalizeStyle)({background:t.color||`#909399`})},[t.isAi?((0,e.openBlock)(),(0,e.createBlock)(f,{key:0,size:14},{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(s.Monitor))]),_:1})):((0,e.openBlock)(),(0,e.createElementBlock)(`span`,V,(0,e.toDisplayString)((t.name||`U`).charAt(0)),1))],4),(0,e.createElementVNode)(`span`,H,(0,e.toDisplayString)(t.name||`未知用户`),1),t.isAi?((0,e.openBlock)(),(0,e.createBlock)(p,{key:0,size:`small`,type:`primary`,effect:`plain`,class:`role-tag`},{default:(0,e.withCtx)(()=>[...r[5]||=[(0,e.createTextVNode)(`AI助手`,-1)]]),_:1})):((0,e.openBlock)(),(0,e.createBlock)(p,{key:1,size:`small`,type:`success`,effect:`plain`,class:`role-tag`},{default:(0,e.withCtx)(()=>[...r[6]||=[(0,e.createTextVNode)(`协作人`,-1)]]),_:1}))]))),128))])]),_:1})):(0,e.createCommentVNode)(``,!0)]),(0,e.createElementVNode)(`div`,U,[t.isCollab&&t.unreadMention?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,class:`mention-bell`,title:`有新消息`,onClick:r[0]||=e=>i(`clear-unread`)},[(0,e.createVNode)(f,{size:18,color:`#F56C6C`},{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(s.Bell))]),_:1})])):(0,e.createCommentVNode)(``,!0),(0,e.createVNode)(T,{text:``,circle:``,size:`small`,onClick:r[1]||=e=>n.$emit(`clear`),title:`清空对话`},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(f,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(s.Delete))]),_:1})]),_:1}),(0,e.createVNode)(T,{text:``,circle:``,size:`small`,onClick:r[2]||=e=>n.$emit(`close`),title:`关闭`},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(f,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(s.Close))]),_:1})]),_:1})])]),(0,e.createElementVNode)(`div`,{class:`chat-messages`,ref_key:`messagesRef`,ref:o},[t.messages.length===0?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,W,[(0,e.createVNode)(f,{size:40,color:`#c0c4cc`},{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(s.Monitor))]),_:1}),(0,e.createElementVNode)(`p`,null,(0,e.toDisplayString)(t.isCollab?`协作聊天室`:`你好!我是 AI 助手`),1),(0,e.createElementVNode)(`p`,G,(0,e.toDisplayString)(t.isCollab?`与团队成员和AI助手实时聊天`:`可以问我任何关于文档编辑的问题`),1)])):(0,e.createCommentVNode)(``,!0),((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.messages,n=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:n._msgId||n.time+n.content,class:(0,e.normalizeClass)([`chat-message`,_(n)])},[(0,e.createElementVNode)(`div`,{class:`message-avatar`,style:(0,e.normalizeStyle)(v(n))},[n.role===`ai`?((0,e.openBlock)(),(0,e.createBlock)(f,{key:0,size:16},{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(s.Monitor))]),_:1})):((0,e.openBlock)(),(0,e.createElementBlock)(`span`,ee,(0,e.toDisplayString)(y(n)),1))],4),(0,e.createElementVNode)(`div`,K,[t.isCollab&&n.role===`user`?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,q,[(0,e.createElementVNode)(`span`,{class:`message-sender`,style:(0,e.normalizeStyle)({color:n.user_color||`#67C23A`})},(0,e.toDisplayString)(n.user_name||`用户`),5),n.mentioned_user?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,te,`@`+(0,e.toDisplayString)(n.mentioned_user),1)):(0,e.createCommentVNode)(``,!0)])):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`div`,{class:`message-text`,innerHTML:n.content},null,8,ne),(0,e.createElementVNode)(`div`,J,(0,e.toDisplayString)(n.time),1)])],2))),128)),t.loading?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,re,[(0,e.createElementVNode)(`div`,Y,[(0,e.createVNode)(f,{size:16},{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(s.Monitor))]),_:1})]),r[7]||=(0,e.createElementVNode)(`div`,{class:`message-content`},[(0,e.createElementVNode)(`div`,{class:`message-text typing-indicator`},[(0,e.createElementVNode)(`span`),(0,e.createElementVNode)(`span`),(0,e.createElementVNode)(`span`)])],-1)])):(0,e.createCommentVNode)(``,!0)],512),(0,e.createElementVNode)(`div`,ie,[(0,e.createElementVNode)(`div`,{class:`chat-input-wrapper`,ref_key:`inputWrapperRef`,ref:c},[(0,e.createVNode)(E,{modelValue:a.value,"onUpdate:modelValue":r[3]||=e=>a.value=e,type:`textarea`,autosize:{minRows:1,maxRows:4},placeholder:t.isCollab?`输入消息... @提及成员`:`输入消息...`,onKeydown:[(0,e.withKeys)((0,e.withModifiers)(w,[`exact`]),[`enter`]),(0,e.withKeys)((0,e.withModifiers)(x,[`prevent`]),[`down`]),(0,e.withKeys)((0,e.withModifiers)(S,[`prevent`]),[`up`])],onInput:b,resize:`none`},null,8,[`modelValue`,`placeholder`,`onKeydown`]),l.value?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,ae,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(u.value,(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:t.id||t.clientId,class:(0,e.normalizeClass)([`mention-item`,{active:n===d.value}]),onClick:e=>C(t),onMouseenter:e=>d.value=n},[(0,e.createElementVNode)(`div`,{class:`mention-avatar`,style:(0,e.normalizeStyle)({background:t.color||`#909399`})},[t.isAi?((0,e.openBlock)(),(0,e.createBlock)(f,{key:0,size:12},{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(s.Monitor))]),_:1})):((0,e.openBlock)(),(0,e.createElementBlock)(`span`,se,(0,e.toDisplayString)((t.name||`U`).charAt(0)),1))],4),(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(t.name),1)],42,oe))),128))])):(0,e.createCommentVNode)(``,!0),(0,e.createVNode)(T,{class:`send-btn`,type:`primary`,circle:``,disabled:!a.value.trim()||t.loading,onClick:w},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(f,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(s.Promotion))]),_:1})]),_:1},8,[`disabled`])],512)])],4)):(0,e.createCommentVNode)(``,!0)}}},[[`__scopeId`,`data-v-01960100`]]);function le(){let t=(0,e.ref)([]),n=(0,e.ref)(!1),r=(0,e.ref)(!1),a=(0,e.ref)([]),o=(0,e.ref)({id:``,name:``,color:``}),s=(0,e.ref)(!1),c=null,l=null,u=null,d=new Set,f=`/api/chat`,p=null,m=({ydoc:n,provider:i,onlineUsers:l})=>{if(n){r.value=!0,u=l,p&&p(),p=(0,e.watch)(u,e=>{a.value=Array.isArray(e)?e:[]},{immediate:!0,deep:!0});try{c=n.getArray(`chat-messages`),c.observe(e=>{try{e.changes.added.forEach(e=>{e.content.getContent().forEach(e=>{e&&e._msgId&&!d.has(e._msgId)&&(d.add(e._msgId),t.value=[...t.value,e],e.mentioned_user&&e.user_id!==o.value.id&&(s.value=!0))})})}catch(e){console.warn(`[useChat] Y.Array observer error:`,e)}})}catch(e){console.warn(`[useChat] Failed to create Y.Array:`,e)}}},h=e=>{o.value={...o.value,...e}},g=e=>{a.value=e||[]},_=()=>{let e=new Date;return`${e.getHours().toString().padStart(2,`0`)}:${e.getMinutes().toString().padStart(2,`0`)}`},v=async(n,a={})=>{let s={_msgId:`msg-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,role:`user`,content:n,time:_(),user_id:o.value.id,user_name:o.value.name,user_color:o.value.color,mentioned_user:a.mentionedUser||null};if(d.add(s._msgId),t.value=[...t.value,s],c&&(0,e.unref)(r))try{c.push([s])}catch(e){console.warn(`[useChat] Failed to push to Y.Array:`,e)}if(a.roomId)try{await i.default.post(f,{room_id:a.roomId,role:`user`,content:n,user_id:o.value.id,user_name:o.value.name,mentioned_user:a.mentionedUser||null})}catch(e){console.warn(`[useChat] Failed to persist message:`,e)}},y=async(n,a)=>{let o={_msgId:`msg-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,role:`ai`,content:n,time:_(),user_id:`ai-assistant`,user_name:`AI助手`};if(d.add(o._msgId),t.value=[...t.value,o],c&&(0,e.unref)(r))try{c.push([o])}catch(e){console.warn(`[useChat] Failed to push AI message to Y.Array:`,e)}if(a)try{await i.default.post(f,{room_id:a,role:`ai`,content:n,user_id:`ai-assistant`,user_name:`AI助手`})}catch(e){console.warn(`[useChat] Failed to persist AI message:`,e)}},b=async e=>{if(e)try{let n=await i.default.get(f,{params:{room_id:e}});if(Array.isArray(n.data)){let e=n.data.map(e=>({_msgId:e._msgId||`hist-${e.id||Date.now()}`,role:e.role,content:e.content,time:e.time||_(),user_id:e.user_id||``,user_name:e.user_name||``,user_color:e.user_color||``,mentioned_user:e.mentioned_user||null}));e.forEach(e=>d.add(e._msgId)),t.value=[...e,...t.value]}}catch(e){console.warn(`[useChat] Failed to load history:`,e)}},x=async e=>{if(t.value=[],d.clear(),e)try{await i.default.delete(f,{params:{room_id:e}})}catch(e){console.warn(`[useChat] Failed to clear messages on server:`,e)}},S=()=>{s.value=!1},C=()=>{if(p&&=(p(),null),c&&l){try{c.unobserve(l)}catch{}l=null}c=null,u=null,d.clear()};return(0,e.onUnmounted)(()=>C()),{messages:t,loading:n,isCollabMode:r,collabUsers:a,currentUser:o,unreadMention:s,setCollabContext:m,setCurrentUser:h,updateCollabUsers:g,sendMessage:v,sendAiMessage:y,loadHistory:b,clearMessages:x,clearUnreadMention:S,destroy:C}}var ue=`/api/document-versions`,de=5e3,fe=()=>{let t=(0,e.ref)([]),n=(0,e.ref)(!1);return{versions:t,loading:n,saveVersion:async({documentId:e,docType:t,content:n,userId:r,userName:a})=>{if(!e||!t||!n)return null;try{let{data:o}=await i.default.post(ue,{document_id:e,doc_type:t,content:typeof n==`string`?n:JSON.stringify(n),user_id:r||null,user_name:a||null},{timeout:de});return o}catch(e){return console.warn(`[useVersionHistory] Failed to save version:`,e),null}},loadVersions:async e=>{if(!e)return[];n.value=!0;try{let{data:n}=await i.default.get(ue,{params:{document_id:e},timeout:de});return t.value=n,n}catch(e){return console.warn(`[useVersionHistory] Failed to load versions:`,e),t.value=[],[]}finally{n.value=!1}},getVersionContent:async e=>{try{let{data:t}=await i.default.get(`${ue}/${e}`,{timeout:de});return t}catch(e){return console.warn(`[useVersionHistory] Failed to get version content:`,e),null}}}},pe={class:`version-history-panel`},me={key:0,class:`loading-state`},he={key:1,class:`empty-state`},ge={key:2,class:`version-list`},_e={key:0,class:`current-version`},ve={class:`current-version-header`},ye={class:`version-number`},be=[`onClick`],xe={class:`version-number`},Se={class:`version-user`},Ce={class:`panel-footer`},we=P({__name:`VersionHistoryPanel`,props:{modelValue:{type:Boolean,default:!1},documentId:{type:[Number,String],default:null}},emits:[`update:modelValue`,`apply`],setup(t,{expose:n,emit:i}){let a=t,o=i,{versions:c,loading:l,loadVersions:u,getVersionContent:d}=fe(),f=(0,e.ref)(!1),p=(0,e.ref)(null),m=(0,e.ref)(!1),h=(0,e.ref)(null);(0,e.watch)(()=>a.modelValue,e=>{f.value=e,e&&a.documentId&&(p.value=null,u(a.documentId).then(e=>{e&&e.length>0&&(h.value=e[0])}))}),(0,e.watch)(f,e=>{o(`update:modelValue`,e)});let g=e=>{p.value=e},_=async()=>{if(p.value){m.value=!0;try{let e=await d(p.value.id);e&&e.content?(h.value=p.value,p.value=null,o(`apply`,e.content),r.ElMessage.success(`已切换到版本 v`+h.value.version_number)):r.ElMessage.error(`获取版本内容失败`)}finally{m.value=!1}}},v=()=>{f.value=!1},y=e=>{if(!e)return``;let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`};return n({currentVersion:h}),(t,n)=>{let r=(0,e.resolveComponent)(`el-icon`),i=(0,e.resolveComponent)(`el-tag`),a=(0,e.resolveComponent)(`el-timeline-item`),o=(0,e.resolveComponent)(`el-timeline`),u=(0,e.resolveComponent)(`el-button`),d=(0,e.resolveComponent)(`el-drawer`);return(0,e.openBlock)(),(0,e.createBlock)(d,{modelValue:f.value,"onUpdate:modelValue":n[0]||=e=>f.value=e,title:`更新履历`,direction:`rtl`,size:`420px`,"before-close":v},{footer:(0,e.withCtx)(()=>[(0,e.createElementVNode)(`div`,Ce,[(0,e.createVNode)(u,{type:`primary`,disabled:!p.value,loading:m.value,onClick:_},{default:(0,e.withCtx)(()=>[...n[4]||=[(0,e.createTextVNode)(` 切换到此版本 `,-1)]]),_:1},8,[`disabled`,`loading`])])]),default:(0,e.withCtx)(()=>[(0,e.createElementVNode)(`div`,pe,[(0,e.unref)(l)?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,me,[(0,e.createVNode)(r,{class:`is-loading`},{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(s.Loading))]),_:1}),n[1]||=(0,e.createElementVNode)(`span`,null,`加载中...`,-1)])):(0,e.unref)(c).length===0?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,he,[(0,e.createVNode)(r,{size:48,color:`#c0c4cc`},{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(s.Clock))]),_:1}),n[2]||=(0,e.createElementVNode)(`p`,null,`暂无历史版本`,-1)])):((0,e.openBlock)(),(0,e.createElementBlock)(`div`,ge,[h.value?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,_e,[(0,e.createElementVNode)(`div`,ve,[(0,e.createVNode)(i,{type:`success`,size:`small`},{default:(0,e.withCtx)(()=>[...n[3]||=[(0,e.createTextVNode)(`当前版本`,-1)]]),_:1}),(0,e.createElementVNode)(`span`,ye,`v`+(0,e.toDisplayString)(h.value.version_number),1)])])):(0,e.createCommentVNode)(``,!0),(0,e.createVNode)(o,null,{default:(0,e.withCtx)(()=>[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)((0,e.unref)(c),t=>((0,e.openBlock)(),(0,e.createBlock)(a,{key:t.id,timestamp:y(t.created_at),placement:`top`,type:p.value?.id===t.id?`primary`:``,hollow:p.value?.id!==t.id},{default:(0,e.withCtx)(()=>[(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`version-item`,{active:p.value?.id===t.id}]),onClick:e=>g(t)},[(0,e.createElementVNode)(`span`,xe,`版本号:v`+(0,e.toDisplayString)(t.version_number),1),(0,e.createElementVNode)(`span`,Se,`提交人:`+(0,e.toDisplayString)(t.user_name||`未知用户`),1)],10,be)]),_:2},1032,[`timestamp`,`type`,`hollow`]))),128))]),_:1})]))])]),_:1},8,[`modelValue`])}}},[[`__scopeId`,`data-v-87924b7c`]]),Te={class:`node-palette`},Ee={class:`palette-header`},X={class:`palette-search`},Z={class:`palette-list`},De=[`onDragstart`],Oe={key:0,width:`24`,height:`24`,viewBox:`0 0 24 24`},ke={key:1,width:`24`,height:`24`,viewBox:`0 0 24 24`},Ae=[`fill`],je={key:2,width:`24`,height:`24`,viewBox:`0 0 24 24`},Q=[`fill`],$={key:3,width:`24`,height:`24`,viewBox:`0 0 24 24`},Me=[`fill`],Ne=[`stroke`],Pe={key:4,width:`24`,height:`24`,viewBox:`0 0 24 24`},Fe=[`fill`],Ie=[`fill`],Le={key:5,width:`24`,height:`24`,viewBox:`0 0 24 24`},Re=[`fill`],ze={key:6,width:`24`,height:`24`,viewBox:`0 0 24 24`},Be=[`fill`],Ve={key:7,width:`24`,height:`24`,viewBox:`0 0 24 24`},He=[`fill`],Ue={key:8,width:`24`,height:`24`,viewBox:`0 0 24 24`},We=[`fill`],Ge={key:9,width:`24`,height:`24`,viewBox:`0 0 24 24`},Ke=[`fill`],qe={key:10,width:`24`,height:`24`,viewBox:`0 0 24 24`},Je=[`fill`],Ye=[`fill`],Xe={key:11,width:`24`,height:`24`,viewBox:`0 0 24 24`},Ze=[`fill`],Qe=[`fill`],$e={key:12,width:`24`,height:`24`,viewBox:`0 0 24 24`},et=[`fill`],tt={key:13,width:`24`,height:`24`,viewBox:`0 0 24 24`},nt=[`fill`],rt={class:`palette-label`},it=P({__name:`NodePalette`,props:{NODE_TYPES:{type:Object,required:!0},diagramTypeLabel:{type:String,default:`业务流程图`},typeDisabled:{type:Boolean,default:!1}},emits:[`set-type`],setup(t,{emit:n}){let r=t,i=(0,e.ref)(``),a=(0,e.computed)(()=>{if(!i.value)return r.NODE_TYPES;let e=i.value.toLowerCase(),t={};for(let[n,i]of Object.entries(r.NODE_TYPES))(i.label.toLowerCase().includes(e)||i.desc&&i.desc.toLowerCase().includes(e))&&(t[n]=i);return t}),o=(e,t)=>{e.dataTransfer.setData(`node-type`,t),e.dataTransfer.effectAllowed=`copy`};return(n,r)=>{let c=(0,e.resolveComponent)(`el-icon`),l=(0,e.resolveComponent)(`el-button`),u=(0,e.resolveComponent)(`el-dropdown-item`),d=(0,e.resolveComponent)(`el-dropdown-menu`),f=(0,e.resolveComponent)(`el-dropdown`),p=(0,e.resolveComponent)(`el-input`),m=(0,e.resolveComponent)(`el-tooltip`);return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,Te,[(0,e.createElementVNode)(`div`,Ee,[r[6]||=(0,e.createElementVNode)(`h4`,null,`组件库`,-1),(0,e.createVNode)(f,{trigger:`click`,onCommand:r[0]||=e=>n.$emit(`set-type`,e),size:`small`},{dropdown:(0,e.withCtx)(()=>[(0,e.createVNode)(d,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)(u,{command:`flow`},{default:(0,e.withCtx)(()=>[...r[2]||=[(0,e.createTextVNode)(`业务流程图`,-1)]]),_:1}),(0,e.createVNode)(u,{command:`approval`},{default:(0,e.withCtx)(()=>[...r[3]||=[(0,e.createTextVNode)(`审批流程图`,-1)]]),_:1}),(0,e.createVNode)(u,{command:`execution`},{default:(0,e.withCtx)(()=>[...r[4]||=[(0,e.createTextVNode)(`执行流程图`,-1)]]),_:1}),(0,e.createVNode)(u,{command:`dataflow`},{default:(0,e.withCtx)(()=>[...r[5]||=[(0,e.createTextVNode)(`数据流程图`,-1)]]),_:1})]),_:1})]),default:(0,e.withCtx)(()=>[(0,e.createVNode)(l,{size:`small`,disabled:t.typeDisabled},{default:(0,e.withCtx)(()=>[(0,e.createTextVNode)((0,e.toDisplayString)(t.diagramTypeLabel)+` `,1),(0,e.createVNode)(c,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(s.ArrowDown))]),_:1})]),_:1},8,[`disabled`])]),_:1})]),(0,e.createElementVNode)(`div`,X,[(0,e.createVNode)(p,{size:`small`,modelValue:i.value,"onUpdate:modelValue":r[1]||=e=>i.value=e,placeholder:`搜索...`,clearable:``,"prefix-icon":`Search`},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,Z,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(a.value,(t,n)=>((0,e.openBlock)(),(0,e.createBlock)(m,{key:n,content:t.desc||t.label,placement:`right`,"show-after":400,effect:`dark`},{default:(0,e.withCtx)(()=>[(0,e.createElementVNode)(`div`,{class:`palette-item`,draggable:`true`,onDragstart:e=>o(e,n)},[(0,e.createElementVNode)(`div`,{class:`palette-icon`,style:(0,e.normalizeStyle)({background:t.color})},[n===`custom`?((0,e.openBlock)(),(0,e.createElementBlock)(`svg`,Oe,[...r[7]||=[(0,e.createElementVNode)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,fill:`none`,stroke:`#909399`,"stroke-width":`1.5`,"stroke-dasharray":`4,2`},null,-1),(0,e.createElementVNode)(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`16`,stroke:`#909399`,"stroke-width":`1.5`},null,-1),(0,e.createElementVNode)(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`,stroke:`#909399`,"stroke-width":`1.5`},null,-1)]])):t.shape===`ellipse`?((0,e.openBlock)(),(0,e.createElementBlock)(`svg`,ke,[(0,e.createElementVNode)(`ellipse`,{cx:`12`,cy:`12`,rx:`10`,ry:`8`,fill:t.color,stroke:`#fff`,"stroke-width":`1`},null,8,Ae)])):t.shape===`diamond`?((0,e.openBlock)(),(0,e.createElementBlock)(`svg`,je,[(0,e.createElementVNode)(`polygon`,{points:`12,2 22,12 12,22 2,12`,fill:t.color,stroke:`#fff`,"stroke-width":`1`},null,8,Q)])):t.shape===`person`?((0,e.openBlock)(),(0,e.createElementBlock)(`svg`,$,[(0,e.createElementVNode)(`circle`,{cx:`12`,cy:`8`,r:`4`,fill:t.color},null,8,Me),(0,e.createElementVNode)(`path`,{d:`M4 22 Q12 14 20 22`,fill:`none`,stroke:t.color,"stroke-width":`2`},null,8,Ne)])):t.shape===`cylinder`?((0,e.openBlock)(),(0,e.createElementBlock)(`svg`,Pe,[(0,e.createElementVNode)(`ellipse`,{cx:`12`,cy:`7`,rx:`9`,ry:`4`,fill:t.color,stroke:`#fff`,"stroke-width":`0.5`},null,8,Fe),(0,e.createElementVNode)(`rect`,{x:`3`,y:`7`,width:`18`,height:`10`,fill:t.color},null,8,Ie),r[8]||=(0,e.createElementVNode)(`path`,{d:`M3 7 Q3 17 12 17 Q21 17 21 7`,fill:`none`,stroke:`#fff`,"stroke-width":`0.5`},null,-1),r[9]||=(0,e.createElementVNode)(`ellipse`,{cx:`12`,cy:`7`,rx:`9`,ry:`4`,fill:`none`,stroke:`#fff`,"stroke-width":`1`},null,-1)])):t.shape===`hexagon`?((0,e.openBlock)(),(0,e.createElementBlock)(`svg`,Le,[(0,e.createElementVNode)(`polygon`,{points:`7,2 17,2 22,12 17,22 7,22 2,12`,fill:t.color,stroke:`#fff`,"stroke-width":`1`},null,8,Re)])):t.shape===`timer`?((0,e.openBlock)(),(0,e.createElementBlock)(`svg`,ze,[(0,e.createElementVNode)(`circle`,{cx:`12`,cy:`12`,r:`10`,fill:t.color,stroke:`#fff`,"stroke-width":`1`},null,8,Be),r[10]||=(0,e.createElementVNode)(`line`,{x1:`12`,y1:`12`,x2:`12`,y2:`6`,stroke:`#fff`,"stroke-width":`1.5`,"stroke-linecap":`round`},null,-1),r[11]||=(0,e.createElementVNode)(`line`,{x1:`12`,y1:`12`,x2:`16`,y2:`12`,stroke:`#fff`,"stroke-width":`1`,"stroke-linecap":`round`},null,-1)])):t.shape===`subprocess`?((0,e.openBlock)(),(0,e.createElementBlock)(`svg`,Ve,[(0,e.createElementVNode)(`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`3`,fill:t.color,stroke:`#fff`,"stroke-width":`1`},null,8,He),r[12]||=(0,e.createElementVNode)(`rect`,{x:`4`,y:`16`,width:`16`,height:`2`,rx:`1`,fill:`rgba(255,255,255,0.4)`},null,-1)])):t.shape===`document`?((0,e.openBlock)(),(0,e.createElementBlock)(`svg`,Ue,[(0,e.createElementVNode)(`path`,{d:`M4 2 H20 V16 Q15 13 12 16 Q9 19 4 16 Z`,fill:t.color,stroke:`#fff`,"stroke-width":`1`},null,8,We)])):t.shape===`parallelogram`?((0,e.openBlock)(),(0,e.createElementBlock)(`svg`,Ge,[(0,e.createElementVNode)(`polygon`,{points:`5,4 22,4 19,20 2,20`,fill:t.color,stroke:`#fff`,"stroke-width":`1`},null,8,Ke)])):t.shape===`folder`?((0,e.openBlock)(),(0,e.createElementBlock)(`svg`,qe,[(0,e.createElementVNode)(`path`,{d:`M2 8 H22 V21 H2 Z`,fill:t.color,stroke:`#fff`,"stroke-width":`0.5`},null,8,Je),(0,e.createElementVNode)(`path`,{d:`M2 8 V5 H9 L11 8`,fill:t.color,stroke:`#fff`,"stroke-width":`1`},null,8,Ye)])):t.shape===`note`?((0,e.openBlock)(),(0,e.createElementBlock)(`svg`,Xe,[(0,e.createElementVNode)(`path`,{d:`M2 2 H22 V18 L18 22 H2 Z`,fill:t.color,stroke:`#fff`,"stroke-width":`0.5`},null,8,Ze),(0,e.createElementVNode)(`path`,{d:`M18 18 V22 L22 18`,fill:t.color,stroke:`#fff`,"stroke-width":`0.5`},null,8,Qe)])):t.shape===`rounded闪电`?((0,e.openBlock)(),(0,e.createElementBlock)(`svg`,$e,[(0,e.createElementVNode)(`rect`,{x:`2`,y:`6`,width:`20`,height:`12`,rx:`6`,fill:t.color,stroke:`#fff`,"stroke-width":`1`},null,8,et),r[13]||=(0,e.createElementVNode)(`path`,{d:`M14 8 L10 12 H13 L11 16 L15 12 H12 Z`,fill:`#fff`,opacity:`0.9`},null,-1)])):((0,e.openBlock)(),(0,e.createElementBlock)(`svg`,tt,[(0,e.createElementVNode)(`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`3`,fill:t.color,stroke:`#fff`,"stroke-width":`1`},null,8,nt)]))],4),(0,e.createElementVNode)(`span`,rt,(0,e.toDisplayString)(t.label),1)],40,De)]),_:2},1032,[`content`]))),128))])])}}},[[`__scopeId`,`data-v-a24fcbed`]]),at={class:`process-toolbar`},ot={class:`toolbar-group`},st={key:0,class:`toolbar-group`},ct={class:`toolbar-group`},lt={class:`toolbar-group`},ut={class:`toolbar-group`},dt={class:`toolbar-group`},ft={class:`toolbar-group`},pt={class:`toolbar-group`},mt=P({__name:`ProcessToolbar`,props:{animationPlaying:{type:Boolean,default:!1},canUndo:{type:Boolean,default:!1},canRedo:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},isCollaborating:{type:Boolean,default:!1},isJoinedCollab:{type:Boolean,default:!1},showHistory:{type:Boolean,default:!1}},emits:[`add-swimlane`,`undo`,`redo`,`auto-layout`,`toggle-animation`,`set-animation-speed`,`export`,`import-json`,`clear`,`set-template`,`start-collab`,`stop-collab`,`share-collab`,`save`,`ai-generate`,`history`],setup(t,{emit:n}){let r=n,i=(0,e.ref)(1),a=(0,e.ref)(!1),o=(0,e.ref)(``),c=()=>{o.value.trim()&&(r(`ai-generate`,o.value.trim()),a.value=!1,o.value=``)},l=e=>{r(`add-swimlane`,e)},u=e=>{r(`export`,e)};return(n,r)=>{let d=(0,e.resolveComponent)(`ArrowDown`),f=(0,e.resolveComponent)(`el-icon`),p=(0,e.resolveComponent)(`el-button`),m=(0,e.resolveComponent)(`el-dropdown-item`),h=(0,e.resolveComponent)(`el-dropdown-menu`),g=(0,e.resolveComponent)(`el-dropdown`),_=(0,e.resolveComponent)(`RefreshLeft`),v=(0,e.resolveComponent)(`RefreshRight`),y=(0,e.resolveComponent)(`Grid`),b=(0,e.resolveComponent)(`el-option`),x=(0,e.resolveComponent)(`el-select`),S=(0,e.resolveComponent)(`Delete`),C=(0,e.resolveComponent)(`Check`),w=(0,e.resolveComponent)(`Clock`),T=(0,e.resolveComponent)(`el-input`),E=(0,e.resolveComponent)(`el-dialog`);return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,at,[(0,e.createElementVNode)(`div`,ot,[(0,e.createVNode)(g,{trigger:`click`,onCommand:r[0]||=e=>n.$emit(`set-template`,e),size:`small`},{dropdown:(0,e.withCtx)(()=>[(0,e.createVNode)(h,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)(m,{command:`approval`},{default:(0,e.withCtx)(()=>[...r[18]||=[(0,e.createTextVNode)(`审批流程模板`,-1)]]),_:1}),(0,e.createVNode)(m,{command:`execution`},{default:(0,e.withCtx)(()=>[...r[19]||=[(0,e.createTextVNode)(`执行流程模板`,-1)]]),_:1}),(0,e.createVNode)(m,{command:`dataflow`},{default:(0,e.withCtx)(()=>[...r[20]||=[(0,e.createTextVNode)(`数据流程模板`,-1)]]),_:1}),(0,e.createVNode)(m,{command:`business`},{default:(0,e.withCtx)(()=>[...r[21]||=[(0,e.createTextVNode)(`业务流程模板`,-1)]]),_:1}),(0,e.createVNode)(m,{command:`h-swimlane`},{default:(0,e.withCtx)(()=>[...r[22]||=[(0,e.createTextVNode)(`水平泳道图模板`,-1)]]),_:1}),(0,e.createVNode)(m,{command:`v-swimlane`},{default:(0,e.withCtx)(()=>[...r[23]||=[(0,e.createTextVNode)(`垂直泳道图模板`,-1)]]),_:1})]),_:1})]),default:(0,e.withCtx)(()=>[(0,e.createVNode)(p,{size:`small`,disabled:t.disabled},{default:(0,e.withCtx)(()=>[r[17]||=(0,e.createTextVNode)(` 模板 `,-1),(0,e.createVNode)(f,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)(d)]),_:1})]),_:1},8,[`disabled`])]),_:1})]),t.isJoinedCollab?(0,e.createCommentVNode)(``,!0):((0,e.openBlock)(),(0,e.createElementBlock)(`div`,st,[(0,e.createVNode)(p,{size:`small`,type:t.isCollaborating?`success`:`default`,onClick:r[1]||=e=>t.isCollaborating?n.$emit(`stop-collab`):n.$emit(`start-collab`),title:`协作`},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(f,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(s.Share))]),_:1}),(0,e.createElementVNode)(`span`,null,(0,e.toDisplayString)(t.isCollaborating?`协作中`:`协作`),1)]),_:1},8,[`type`]),t.isCollaborating?((0,e.openBlock)(),(0,e.createBlock)(p,{key:0,size:`small`,circle:``,onClick:r[2]||=e=>n.$emit(`share-collab`),title:`分享链接`},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(f,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(s.Link))]),_:1})]),_:1})):(0,e.createCommentVNode)(``,!0)])),(0,e.createElementVNode)(`div`,ct,[(0,e.createVNode)(g,{trigger:`click`,onCommand:l},{dropdown:(0,e.withCtx)(()=>[(0,e.createVNode)(h,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)(m,{command:`horizontal`},{default:(0,e.withCtx)(()=>[...r[25]||=[(0,e.createTextVNode)(`水平泳道`,-1)]]),_:1}),(0,e.createVNode)(m,{command:`vertical`},{default:(0,e.withCtx)(()=>[...r[26]||=[(0,e.createTextVNode)(`垂直泳道`,-1)]]),_:1})]),_:1})]),default:(0,e.withCtx)(()=>[(0,e.createVNode)(p,{size:`small`},{default:(0,e.withCtx)(()=>[r[24]||=(0,e.createTextVNode)(` 泳道 `,-1),(0,e.createVNode)(f,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)(d)]),_:1})]),_:1})]),_:1})]),(0,e.createElementVNode)(`div`,lt,[(0,e.createVNode)(p,{size:`small`,circle:``,onClick:r[3]||=e=>n.$emit(`undo`),disabled:!t.canUndo,title:`撤销`},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(f,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)(_)]),_:1})]),_:1},8,[`disabled`]),(0,e.createVNode)(p,{size:`small`,circle:``,onClick:r[4]||=e=>n.$emit(`redo`),disabled:!t.canRedo,title:`重做`},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(f,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)(v)]),_:1})]),_:1},8,[`disabled`])]),(0,e.createElementVNode)(`div`,ut,[(0,e.createVNode)(p,{size:`small`,onClick:r[5]||=e=>n.$emit(`auto-layout`),title:`自动布局`},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(f,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)(y)]),_:1})]),_:1}),(0,e.createVNode)(p,{size:`small`,type:t.animationPlaying?`success`:``,onClick:r[6]||=e=>n.$emit(`toggle-animation`)},{default:(0,e.withCtx)(()=>[(0,e.createTextVNode)((0,e.toDisplayString)(t.animationPlaying?`暂停动画`:`播放动画`),1)]),_:1},8,[`type`]),(0,e.createVNode)(x,{modelValue:i.value,"onUpdate:modelValue":r[7]||=e=>i.value=e,size:`small`,style:{width:`70px`},onChange:r[8]||=e=>n.$emit(`set-animation-speed`,e)},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(b,{value:.5,label:`0.5x`}),(0,e.createVNode)(b,{value:1,label:`1x`}),(0,e.createVNode)(b,{value:2,label:`2x`})]),_:1},8,[`modelValue`])]),(0,e.createElementVNode)(`div`,dt,[(0,e.createVNode)(g,{trigger:`click`,onCommand:u},{dropdown:(0,e.withCtx)(()=>[(0,e.createVNode)(h,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)(m,{command:`json`},{default:(0,e.withCtx)(()=>[...r[28]||=[(0,e.createTextVNode)(`JSON文件`,-1)]]),_:1}),(0,e.createVNode)(m,{command:`png`},{default:(0,e.withCtx)(()=>[...r[29]||=[(0,e.createTextVNode)(`PNG图片`,-1)]]),_:1}),(0,e.createVNode)(m,{command:`svg`},{default:(0,e.withCtx)(()=>[...r[30]||=[(0,e.createTextVNode)(`SVG矢量图`,-1)]]),_:1}),(0,e.createVNode)(m,{command:`html`},{default:(0,e.withCtx)(()=>[...r[31]||=[(0,e.createTextVNode)(`HTML页面`,-1)]]),_:1}),(0,e.createVNode)(m,{command:`pdf`},{default:(0,e.withCtx)(()=>[...r[32]||=[(0,e.createTextVNode)(`PDF文档`,-1)]]),_:1})]),_:1})]),default:(0,e.withCtx)(()=>[(0,e.createVNode)(p,{size:`small`},{default:(0,e.withCtx)(()=>[r[27]||=(0,e.createTextVNode)(` 导出 `,-1),(0,e.createVNode)(f,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)(d)]),_:1})]),_:1})]),_:1}),(0,e.createVNode)(p,{size:`small`,onClick:r[9]||=e=>n.$emit(`import-json`),disabled:t.disabled},{default:(0,e.withCtx)(()=>[...r[33]||=[(0,e.createTextVNode)(` 导入 `,-1)]]),_:1},8,[`disabled`])]),(0,e.createElementVNode)(`div`,ft,[(0,e.createVNode)(p,{size:`small`,onClick:r[10]||=e=>n.$emit(`clear`),disabled:t.disabled,title:`清空画布`},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(f,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)(S)]),_:1})]),_:1},8,[`disabled`]),(0,e.createVNode)(p,{size:`small`,onClick:r[11]||=e=>a.value=!0,title:`AI生成`},{default:(0,e.withCtx)(()=>[...r[34]||=[(0,e.createElementVNode)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[(0,e.createElementVNode)(`path`,{d:`M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5`})],-1)]]),_:1})]),r[38]||=(0,e.createElementVNode)(`div`,{class:`toolbar-spacer`},null,-1),(0,e.createElementVNode)(`div`,pt,[(0,e.createVNode)(p,{size:`small`,type:`primary`,onClick:r[12]||=e=>n.$emit(`save`)},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(f,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)(C)]),_:1}),r[35]||=(0,e.createTextVNode)(` 保存 `,-1)]),_:1}),t.showHistory?((0,e.openBlock)(),(0,e.createBlock)(p,{key:0,size:`small`,circle:``,title:`更新履历`,onClick:r[13]||=e=>n.$emit(`history`)},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(f,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)(w)]),_:1})]),_:1})):(0,e.createCommentVNode)(``,!0)]),(0,e.createVNode)(E,{modelValue:a.value,"onUpdate:modelValue":r[16]||=e=>a.value=e,title:`AI生成流程图`,width:`70vw`,top:`50px`,center:``,class:`ai-dialog`},{footer:(0,e.withCtx)(()=>[(0,e.createVNode)(p,{onClick:r[15]||=e=>a.value=!1},{default:(0,e.withCtx)(()=>[...r[36]||=[(0,e.createTextVNode)(`取消`,-1)]]),_:1}),(0,e.createVNode)(p,{type:`primary`,onClick:c},{default:(0,e.withCtx)(()=>[...r[37]||=[(0,e.createTextVNode)(`生成`,-1)]]),_:1})]),default:(0,e.withCtx)(()=>[(0,e.createVNode)(T,{modelValue:o.value,"onUpdate:modelValue":r[14]||=e=>o.value=e,type:`textarea`,autosize:{minRows:27,maxRows:27},placeholder:`请输入提示词,描述你想要生成的流程图...`,class:`ai-textarea`},null,8,[`modelValue`])]),_:1},8,[`modelValue`])])}}},[[`__scopeId`,`data-v-34fc94b1`]]),ht=[`transform`],gt={key:0},_t=[`id`],vt=[`offset`,`stop-color`],yt=[`width`,`height`,`rx`],bt=[`width`,`height`,`rx`,`stroke`],xt=[`width`,`height`,`rx`,`stroke`,`stroke-width`,`stroke-dasharray`,`filter`],St=[`x1`,`y1`,`x2`,`y2`,`stroke`],Ct=[`x1`,`y1`,`x2`,`y2`,`stroke`],wt=[`width`,`height`,`rx`,`fill`,`stroke`,`stroke-width`,`filter`],Tt=[`href`,`width`,`height`],Et=[`cx`,`cy`,`rx`,`ry`,`fill`,`stroke`,`stroke-width`,`filter`],Dt=[`points`,`fill`,`stroke`,`stroke-width`,`filter`],Ot={key:10},kt=[`cx`,`fill`,`stroke`,`stroke-width`,`filter`],At=[`d`,`stroke`],jt=[`x1`,`x2`,`stroke`],Mt=[`x1`,`x2`,`stroke`],Nt=[`x1`,`x2`,`stroke`],Pt=[`x1`,`x2`,`y2`,`stroke`],Ft=[`x1`,`x2`,`y2`,`stroke`],It={key:11},Lt=[`width`,`height`,`rx`,`fill`,`stroke`,`stroke-width`,`filter`],Rt=[`y`,`width`],zt={key:12},Bt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Vt={key:13},Ht=[`points`,`fill`,`stroke`,`stroke-width`,`filter`],Ut={key:14},Wt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Gt=[`d`,`fill`,`stroke`,`stroke-width`],Kt={key:15},qt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Jt=[`d`,`fill`,`stroke`,`stroke-width`],Yt={key:16},Xt=[`d`,`fill`,`stroke`,`stroke-width`,`filter`],Zt=[`cx`,`cy`,`rx`,`ry`,`fill`,`stroke`,`stroke-width`],Qt=[`cx`,`cy`,`rx`,`ry`],$t={key:17},en=[`points`,`fill`,`stroke`,`stroke-width`,`filter`],tn={key:18},nn=[`cx`,`cy`,`r`,`fill`,`stroke`,`stroke-width`,`filter`],rn=[`cx`,`cy`,`r`],an=[`x1`,`y1`,`x2`,`y2`],on=[`x1`,`y1`,`x2`,`y2`],sn=[`cx`,`cy`],cn={key:19},ln=[`width`,`height`,`rx`,`fill`,`stroke`,`stroke-width`,`filter`],un=[`d`],dn=[`width`,`height`,`rx`,`fill`,`stroke`,`stroke-width`,`filter`],fn=[`width`,`height`,`rx`,`stroke`],pn=[`width`,`height`,`rx`,`stroke`],mn=[`width`,`height`,`rx`,`stroke`],hn=[`x`,`y`,`text-anchor`,`dominant-baseline`,`fill`,`font-size`,`transform`],gn={key:0,class:`resize-handles`},_n=[`x`,`y`,`onMousedown`],vn=[`cx`,`cy`],yn=[`cx`,`cy`],bn=P({__name:`DiagramNode`,props:{node:{type:Object,required:!0},selected:{type:Boolean,default:!1},connectMode:{type:Boolean,default:!1},autoConnectSource:{type:String,default:null},autoConnectMode:{type:Boolean,default:!1},animationPlaying:{type:Boolean,default:!1},theme:{type:String,default:`classic`}},emits:[`select`,`start-connect`,`end-connect`,`drag`,`resize`,`drag-end`,`resize-end`,`auto-connect-start`,`reset-state`,`hover-remark`],setup(t,{expose:n,emit:r}){let i=t,a=r,o=(0,e.ref)(null),s=(0,e.ref)(!1),c=null,l=!1,u=null,d=null,f=(0,e.computed)(()=>i.connectMode||i.autoConnectMode),p=(0,e.computed)(()=>y[i.theme]||y.classic),m=()=>({"#67c23a":`success`,"#909399":`info`,"#409eff":`primary`,"#e6a23c":`warning`,"#f56c6c":`danger`,"#9b59b6":`purple`,"#1abc9c":`cyan`,"#ff9800":`orange`,"#e91e63":`pink`,"#3498db":`blue`,"#00bcd4":`teal`,"#607d8b":`grayBlue`,"#f1c40f":`yellow`,"#95a5a6":`gray`})[i.node.color]||null,h=(0,e.computed)(()=>{if(i.node.type===`custom`)return{type:`solid`,color:`transparent`};let e=m(),t=p.value.colors;if(e&&t[e]){let n=t[e];return Array.isArray(n)?{type:`gradient`,colors:n}:i.theme===`neon`?{type:`dark`,color:`rgba(20, 25, 35, 0.95)`}:{type:`solid`,color:n}}if(i.theme===`gradient`){let e=i.node.color||`#409eff`;return{type:`gradient`,colors:[_(e,30),e,g(e,40)]}}if(i.theme===`colorful`){let e=i.node.color||`#409eff`;return{type:`gradient`,colors:[v(e,-60),e,v(e,60),v(e,120),v(e,180)]}}return i.theme===`neon`?{type:`dark`,color:`rgba(20, 25, 35, 0.95)`}:{type:`solid`,color:i.node.color}});function g(e,t){let n=parseInt(e.replace(`#`,``),16);return`rgb(${Math.min(255,(n>>16)+Math.round(255*t/100))}, ${Math.min(255,(n>>8&255)+Math.round(255*t/100))}, ${Math.min(255,(n&255)+Math.round(255*t/100))})`}function _(e,t){let n=parseInt(e.replace(`#`,``),16);return`rgb(${Math.max(0,(n>>16)-Math.round(255*t/100))}, ${Math.max(0,(n>>8&255)-Math.round(255*t/100))}, ${Math.max(0,(n&255)-Math.round(255*t/100))})`}function v(e,t){let n=parseInt(e.replace(`#`,``),16),r=n>>16&255,i=n>>8&255,a=n&255,o=Math.max(r,i,a),s=Math.min(r,i,a),c,l,u=(o+s)/2;if(o===s)c=l=0;else{let e=o-s;l=u>.5?e/(2-o-s):e/(o+s),c=o===r?((i-a)/e+(i<a?6:0))/6:o===i?((a-r)/e+2)/6:((r-i)/e+4)/6}c=((c+t/360+1)%1+1)%1;function d(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}let f=u<.5?u*(1+l):u+l-u*l,p=2*u-f;return r=Math.round(d(p,f,c+1/3)*255),i=Math.round(d(p,f,c)*255),a=Math.round(d(p,f,c-1/3)*255),`rgb(${r}, ${i}, ${a})`}let b=(0,e.computed)(()=>h.value.type===`gradient`?`url(#grad-${i.node.id})`:(h.value.type,h.value.color)),x=(0,e.computed)(()=>{let e=S(i.theme,i.selected,i.node.strokeColor),t=i.node.strokeWidth===void 0?e.width:i.node.strokeWidth,n=e.sketch?`4,2`:`none`;return{...e,width:t,dasharray:n}}),w=(0,e.computed)(()=>i.theme===`neon`?`#ffffff`:i.node.textColor),T=(0,e.computed)(()=>C(i.theme)),E=(0,e.computed)(()=>{let e=i.node.labelPosition||`center`,t=i.node.width,n=i.node.height;switch(e){case`top`:return{x:t/2,y:-10,textAnchor:`middle`,dominantBaseline:`auto`,visible:!0,rotate:0};case`bottom`:return{x:t/2,y:n+10+i.node.fontSize,textAnchor:`middle`,dominantBaseline:`auto`,visible:!0,rotate:0};case`left`:return{x:-10,y:n/2,textAnchor:`middle`,dominantBaseline:`central`,visible:!0,rotate:i.node.textRotation??-90};case`right`:return{x:t+10,y:n/2,textAnchor:`middle`,dominantBaseline:`central`,visible:!0,rotate:i.node.textRotation??-90};case`hover`:return{x:t/2,y:n/2,textAnchor:`middle`,dominantBaseline:`central`,visible:!1,rotate:0};default:return{x:t/2,y:n/2,textAnchor:`middle`,dominantBaseline:`central`,visible:!0,rotate:0}}}),D=(0,e.computed)(()=>{let e=i.node.width,t=i.node.height;return`${e/2} 0, ${e} ${t/2}, ${e/2} ${t}, 0 ${t/2}`}),O=(0,e.computed)(()=>{let e=i.node.width,t=i.node.height,n=e*.2;return`${n} 0, ${e-n} 0, ${e} ${t/2}, ${e-n} ${t}, ${n} ${t}, 0 ${t/2}`}),k=(0,e.computed)(()=>{let e=i.node.width,t=i.node.height;return[{x:0,y:0,cursor:`nw-resize`,dx:-1,dy:-1},{x:e,y:0,cursor:`ne-resize`,dx:1,dy:-1},{x:e,y:t,cursor:`se-resize`,dx:1,dy:1},{x:0,y:t,cursor:`sw-resize`,dx:-1,dy:1}]}),A=(0,e.computed)(()=>{if(!i.animationPlaying||i.node.animation===`none`)return{};let e=i.node.animationDuration||p.value.animation.defaultDuration||2,t=i.node.animationDelay||0,n={animation:``};switch(i.node.animation){case`pulse`:n.animation=`nodePulse ${e}s ease-in-out ${t}s infinite`;break;case`bounce`:n.animation=`nodeBounce ${e}s ease-in-out ${t}s infinite`;break;case`spin`:n.animation=`nodeSpin ${e}s linear ${t}s infinite`,n.transformOrigin=`${i.node.width/2}px ${i.node.height/2}px`;break;case`fadeIn`:n.animation=`nodeFadeIn ${e}s ease-in-out ${t}s infinite`;break;case`fadeOut`:n.animation=`nodeFadeOut ${e}s ease-in-out ${t}s infinite`;break;case`colorShift`:n.animation=`nodeColorShift ${e}s ease-in-out ${t}s infinite`;break;case`ripple`:break;case`breathing`:case`glowPulse`:break;case`float`:n.animation=`nodeFloat ${e}s ease-in-out ${t}s infinite`;break;case`shake`:n.animation=`nodeShake ${e*.5}s ease-in-out ${t}s infinite`;break;case`scaleIn`:n.animation=`nodeScaleIn ${e}s ease-out ${t}s infinite`,n.transformOrigin=`${i.node.width/2}px ${i.node.height/2}px`;break;case`neonFlow`:n.animation=`nodeNeonFlow ${e}s linear ${t}s infinite`;break}return n}),j=(0,e.computed)(()=>i.animationPlaying?{animation:`glowPulseRingOverlay ${i.node.animationDuration||p.value.animation.defaultDuration||2}s ease-in-out ${i.node.animationDelay||0}s infinite`}:{display:`none`}),M=(0,e.computed)(()=>i.animationPlaying?{animation:`breathingAnimation ${i.node.animationDuration||p.value.animation.defaultDuration||2}s ease-in-out ${i.node.animationDelay||0}s infinite`}:{display:`none`}),N=(0,e.computed)(()=>!i.animationPlaying||i.node.animation!==`ripple`?{display:`none`}:{animation:`nodeRippleOverlay ${i.node.animationDuration||p.value.animation.defaultDuration||2}s ease-out ${i.node.animationDelay||0}s infinite`}),P=()=>{d&&=(d(),null),I(),o.value=null},F=e=>{if(i.node.locked||e.button!==0)return;if(i.connectMode){a(`start-connect`,i.node.id);return}P(),l=!1,o.value={x:e.clientX,y:e.clientY},s.value=!0,c=setTimeout(()=>{c=null,s.value=!1,l||(o.value=null,a(`auto-connect-start`,i.node.id))},200);let t=e=>{if(!o.value)return;let t=e.clientX-o.value.x,n=e.clientY-o.value.y;(Math.abs(t)>3||Math.abs(n)>3)&&(l=!0,I()),a(`drag`,i.node.id,t,n),o.value={x:e.clientX,y:e.clientY}},n=()=>{I(),o.value=null,window.removeEventListener(`mousemove`,t),window.removeEventListener(`mouseup`,n),d=null,a(`drag-end`,i.node.id)};d=()=>{window.removeEventListener(`mousemove`,t),window.removeEventListener(`mouseup`,n),d=null},window.addEventListener(`mousemove`,t),window.addEventListener(`mouseup`,n)},I=()=>{s.value=!1,c&&=(clearTimeout(c),null)},L=()=>{s.value=!1,I()},R=()=>{(i.connectMode||i.autoConnectMode)&&a(`end-connect`,l?null:i.node.id)},z=()=>{a(`select`,i.node.id)},B=()=>{u&&=(u(),null)},V=(e,t)=>{B();let n=t.clientX,r=t.clientY,o=i.node.width,s=i.node.height,c=t=>{let c=t.clientX-n,l=t.clientY-r,u=Math.max(60,o+c*e.dx),d=Math.max(30,s+l*e.dy);a(`resize`,i.node.id,u,d)},l=()=>{window.removeEventListener(`mousemove`,c),window.removeEventListener(`mouseup`,l),u=null,a(`resize-end`,i.node.id)};u=()=>{window.removeEventListener(`mousemove`,c),window.removeEventListener(`mouseup`,l),u=null},window.addEventListener(`mousemove`,c),window.addEventListener(`mouseup`,l)};return(0,e.watch)(()=>i.selected,e=>{e||(B(),P())}),n({clearAutoConnect:L}),(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`g`,{class:(0,e.normalizeClass)([`diagram-node`,{selected:t.selected,locked:t.node.locked}]),transform:`translate(${t.node.x}, ${t.node.y})`,style:(0,e.normalizeStyle)({opacity:t.node.visible?1:.3,cursor:t.connectMode||t.autoConnectMode?`crosshair`:`move`}),onMousedown:(0,e.withModifiers)(F,[`stop`]),onMouseup:(0,e.withModifiers)(R,[`stop`]),onClick:(0,e.withModifiers)(z,[`stop`]),onDblclick:r[0]||=e=>n.$emit(`select`,t.node.id),onContextmenu:r[1]||=(0,e.withModifiers)(e=>n.$emit(`reset-state`),[`prevent`]),onMouseenter:r[2]||=e=>n.$emit(`hover-remark`,{label:t.node.label,remark:t.node.remark,x:t.node.x,y:t.node.y,w:t.node.width,h:t.node.height,event:e}),onMouseleave:r[3]||=e=>n.$emit(`hover-remark`,null)},[(0,e.createElementVNode)(`g`,{class:(0,e.normalizeClass)([`node-shape`,`anim-${t.node.animation}`]),style:(0,e.normalizeStyle)(A.value)},[h.value.type===`gradient`?((0,e.openBlock)(),(0,e.createElementBlock)(`defs`,gt,[(0,e.createElementVNode)(`linearGradient`,{id:`grad-${t.node.id}`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`100%`},[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(h.value.colors,(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)(`stop`,{key:n,offset:`${n/(h.value.colors.length-1)*100}%`,"stop-color":t},null,8,vt))),128))],8,_t)])):(0,e.createCommentVNode)(``,!0),p.value.nodeStyle.glassHighlight?((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:1},[t.node.shape===`rect`?((0,e.openBlock)(),(0,e.createElementBlock)(`rect`,{key:0,width:t.node.width,height:t.node.height*.6,rx:p.value.nodeStyle.borderRadius,fill:`rgba(255,255,255,0.15)`,style:{"pointer-events":`none`}},null,8,yt)):(0,e.createCommentVNode)(``,!0)],64)):(0,e.createCommentVNode)(``,!0),p.value.nodeStyle.glowEffect&&t.selected?((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:2},[t.node.shape===`rect`?((0,e.openBlock)(),(0,e.createElementBlock)(`rect`,{key:0,x:-4,y:-4,width:t.node.width+8,height:t.node.height+8,rx:p.value.nodeStyle.borderRadius+4,fill:`none`,stroke:x.value.color,"stroke-width":3,filter:`url(#neon-glow-strong)`,class:`glow-rect`},null,8,bt)):(0,e.createCommentVNode)(``,!0)],64)):(0,e.createCommentVNode)(``,!0),t.node.type===`custom`&&(t.selected||t.node.strokeWidth>0)?((0,e.openBlock)(),(0,e.createElementBlock)(`rect`,{key:3,width:t.node.width,height:t.node.height,rx:p.value.nodeStyle.borderRadius,fill:`transparent`,stroke:t.selected?`#409eff`:`#909399`,"stroke-width":t.selected?3:t.node.strokeWidth,"stroke-dasharray":t.node.strokeWidth>0?`8,4`:`none`,filter:`url(#${T.value})`},null,8,xt)):(0,e.createCommentVNode)(``,!0),t.node.type===`custom`&&(t.selected||t.node.strokeWidth>0)?((0,e.openBlock)(),(0,e.createElementBlock)(`line`,{key:4,x1:t.node.width/2,y1:t.node.height*.3,x2:t.node.width/2,y2:t.node.height*.7,stroke:t.selected?`#409eff`:`#909399`,"stroke-width":`2`},null,8,St)):(0,e.createCommentVNode)(``,!0),t.node.type===`custom`&&(t.selected||t.node.strokeWidth>0)?((0,e.openBlock)(),(0,e.createElementBlock)(`line`,{key:5,x1:t.node.width*.3,y1:t.node.height/2,x2:t.node.width*.7,y2:t.node.height/2,stroke:t.selected?`#409eff`:`#909399`,"stroke-width":`2`},null,8,Ct)):t.node.shape===`rect`?((0,e.openBlock)(),(0,e.createElementBlock)(`rect`,{key:6,width:t.node.width,height:t.node.height,rx:p.value.nodeStyle.borderRadius,fill:b.value,stroke:x.value.color,"stroke-width":t.selected?3:x.value.width,filter:`url(#${T.value})`},null,8,wt)):(0,e.createCommentVNode)(``,!0),t.node.type===`custom`&&t.node.image?((0,e.openBlock)(),(0,e.createElementBlock)(`image`,{key:7,href:t.node.image,width:t.node.width,height:t.node.height,preserveAspectRatio:`none`,style:{"pointer-events":`none`}},null,8,Tt)):t.node.shape===`ellipse`?((0,e.openBlock)(),(0,e.createElementBlock)(`ellipse`,{key:8,cx:t.node.width/2,cy:t.node.height/2,rx:t.node.width/2,ry:t.node.height/2,fill:b.value,stroke:x.value.color,"stroke-width":t.selected?3:x.value.width,filter:`url(#${T.value})`},null,8,Et)):t.node.shape===`diamond`?((0,e.openBlock)(),(0,e.createElementBlock)(`polygon`,{key:9,points:D.value,fill:b.value,stroke:x.value.color,"stroke-width":t.selected?3:x.value.width,filter:`url(#${T.value})`},null,8,Dt)):t.node.shape===`person`?((0,e.openBlock)(),(0,e.createElementBlock)(`g`,Ot,[(0,e.createElementVNode)(`ellipse`,{cx:t.node.width/2,cy:18,rx:14,ry:14,fill:b.value,stroke:x.value.color,"stroke-width":t.selected?3:x.value.width,filter:`url(#${T.value})`},null,8,kt),(0,e.createElementVNode)(`path`,{d:`M ${t.node.width/2-18} 70 Q ${t.node.width/2} 45 ${t.node.width/2+18} 70`,fill:`none`,stroke:x.value.color,"stroke-width":`5`,"stroke-linecap":`round`},null,8,At),(0,e.createElementVNode)(`line`,{x1:t.node.width/2,y1:32,x2:t.node.width/2,y2:55,stroke:x.value.color,"stroke-width":`5`,"stroke-linecap":`round`},null,8,jt),(0,e.createElementVNode)(`line`,{x1:t.node.width/2,y1:38,x2:t.node.width/2-15,y2:52,stroke:x.value.color,"stroke-width":`4`,"stroke-linecap":`round`},null,8,Mt),(0,e.createElementVNode)(`line`,{x1:t.node.width/2,y1:38,x2:t.node.width/2+15,y2:52,stroke:x.value.color,"stroke-width":`4`,"stroke-linecap":`round`},null,8,Nt),(0,e.createElementVNode)(`line`,{x1:t.node.width/2,y1:70,x2:t.node.width/2-12,y2:t.node.height,stroke:x.value.color,"stroke-width":`4`,"stroke-linecap":`round`},null,8,Pt),(0,e.createElementVNode)(`line`,{x1:t.node.width/2,y1:70,x2:t.node.width/2+12,y2:t.node.height,stroke:x.value.color,"stroke-width":`4`,"stroke-linecap":`round`},null,8,Ft)])):t.node.shape===`subprocess`?((0,e.openBlock)(),(0,e.createElementBlock)(`g`,It,[(0,e.createElementVNode)(`rect`,{width:t.node.width,height:t.node.height,rx:p.value.nodeStyle.borderRadius,fill:b.value,stroke:x.value.color,"stroke-width":t.selected?3:x.value.width,filter:`url(#${T.value})`},null,8,Lt),(0,e.createElementVNode)(`rect`,{x:4,y:t.node.height-14,width:t.node.width-8,height:`10`,rx:`2`,fill:`rgba(255,255,255,0.3)`},null,8,Rt)])):t.node.shape===`document`?((0,e.openBlock)(),(0,e.createElementBlock)(`g`,zt,[(0,e.createElementVNode)(`path`,{d:`M 0 0 H ${t.node.width} V ${t.node.height*.8} Q ${t.node.width*.75} ${t.node.height*.65} ${t.node.width*.5} ${t.node.height*.8} Q ${t.node.width*.25} ${t.node.height*.95} 0 ${t.node.height*.8} Z`,fill:b.value,stroke:x.value.color,"stroke-width":t.selected?3:x.value.width,filter:`url(#${T.value})`},null,8,Bt)])):t.node.shape===`parallelogram`?((0,e.openBlock)(),(0,e.createElementBlock)(`g`,Vt,[(0,e.createElementVNode)(`polygon`,{points:`${t.node.width*.15} 0, ${t.node.width} 0, ${t.node.width*.85} ${t.node.height}, 0 ${t.node.height}`,fill:b.value,stroke:x.value.color,"stroke-width":t.selected?3:x.value.width,filter:`url(#${T.value})`},null,8,Ht)])):t.node.shape===`folder`?((0,e.openBlock)(),(0,e.createElementBlock)(`g`,Ut,[(0,e.createElementVNode)(`path`,{d:`M 0 12 H ${t.node.width} V ${t.node.height} H 0 Z`,fill:b.value,stroke:x.value.color,"stroke-width":t.selected?3:x.value.width,filter:`url(#${T.value})`},null,8,Wt),(0,e.createElementVNode)(`path`,{d:`M 0 12 V 0 H ${t.node.width*.35} L ${t.node.width*.45} 12`,fill:b.value,stroke:x.value.color,"stroke-width":t.selected?3:x.value.width},null,8,Gt)])):t.node.shape===`note`?((0,e.openBlock)(),(0,e.createElementBlock)(`g`,Kt,[(0,e.createElementVNode)(`path`,{d:`M 0 0 H ${t.node.width} V ${t.node.height-15} L ${t.node.width-15} ${t.node.height} H 0 Z`,fill:b.value,stroke:x.value.color,"stroke-width":t.selected?3:x.value.width,filter:`url(#${T.value})`},null,8,qt),(0,e.createElementVNode)(`path`,{d:`M ${t.node.width-15} ${t.node.height-15} V ${t.node.height} L ${t.node.width} ${t.node.height-15}`,fill:b.value,stroke:x.value.color,"stroke-width":t.selected?3:x.value.width},null,8,Jt)])):t.node.shape===`cylinder`?((0,e.openBlock)(),(0,e.createElementBlock)(`g`,Yt,[(0,e.createElementVNode)(`path`,{d:`M 0 ${t.node.height*.15}
3
+ Q 0 ${t.node.height*.05} ${t.node.width*.1} ${t.node.height*.02}
4
+ H ${t.node.width*.9}
5
+ Q ${t.node.width} ${t.node.height*.05} ${t.node.width} ${t.node.height*.15}
6
+ V ${t.node.height*.85}
7
+ Q ${t.node.width} ${t.node.height*.95} ${t.node.width*.9} ${t.node.height*.98}
8
+ H ${t.node.width*.1}
9
+ Q 0 ${t.node.height*.95} 0 ${t.node.height*.85} Z`,fill:b.value,stroke:x.value.color,"stroke-width":t.selected?3:x.value.width,filter:`url(#${T.value})`},null,8,Xt),(0,e.createElementVNode)(`ellipse`,{cx:t.node.width/2,cy:t.node.height*.15,rx:t.node.width/2,ry:t.node.height*.12,fill:b.value,stroke:x.value.color,"stroke-width":t.selected?3:x.value.width},null,8,Zt),(0,e.createElementVNode)(`ellipse`,{cx:t.node.width/2,cy:t.node.height*.15,rx:t.node.width/2,ry:t.node.height*.08,fill:`rgba(255,255,255,0.2)`,stroke:`none`},null,8,Qt)])):t.node.shape===`hexagon`?((0,e.openBlock)(),(0,e.createElementBlock)(`g`,$t,[(0,e.createElementVNode)(`polygon`,{points:O.value,fill:b.value,stroke:x.value.color,"stroke-width":t.selected?3:x.value.width,filter:`url(#${T.value})`},null,8,en)])):t.node.shape===`timer`?((0,e.openBlock)(),(0,e.createElementBlock)(`g`,tn,[(0,e.createElementVNode)(`circle`,{cx:t.node.width/2,cy:t.node.height/2,r:Math.min(t.node.width,t.node.height)/2-2,fill:b.value,stroke:x.value.color,"stroke-width":t.selected?3:x.value.width,filter:`url(#${T.value})`},null,8,nn),(0,e.createElementVNode)(`circle`,{cx:t.node.width/2,cy:t.node.height/2,r:Math.min(t.node.width,t.node.height)/2-8,fill:`none`,stroke:`rgba(255,255,255,0.4)`,"stroke-width":`1`},null,8,rn),(0,e.createElementVNode)(`line`,{x1:t.node.width/2,y1:t.node.height/2,x2:t.node.width/2,y2:t.node.height/2-Math.min(t.node.width,t.node.height)/2+14,stroke:`#fff`,"stroke-width":`2`,"stroke-linecap":`round`},null,8,an),(0,e.createElementVNode)(`line`,{x1:t.node.width/2,y1:t.node.height/2,x2:t.node.width/2+Math.min(t.node.width,t.node.height)/4,y2:t.node.height/2,stroke:`#fff`,"stroke-width":`1.5`,"stroke-linecap":`round`},null,8,on),(0,e.createElementVNode)(`circle`,{cx:t.node.width/2,cy:t.node.height/2,r:`3`,fill:`#fff`},null,8,sn)])):t.node.shape===`rounded闪电`?((0,e.openBlock)(),(0,e.createElementBlock)(`g`,cn,[(0,e.createElementVNode)(`rect`,{width:t.node.width,height:t.node.height,rx:t.node.height/3,fill:b.value,stroke:x.value.color,"stroke-width":t.selected?3:x.value.width,filter:`url(#${T.value})`},null,8,ln),(0,e.createElementVNode)(`path`,{d:`M ${t.node.width*.55} ${t.node.height*.15}
10
+ L ${t.node.width*.35} ${t.node.height*.45}
11
+ H ${t.node.width*.52}
12
+ L ${t.node.width*.42} ${t.node.height*.85}
13
+ L ${t.node.width*.65} ${t.node.height*.48}
14
+ H ${t.node.width*.48} Z`,fill:`#fff`,opacity:`0.9`},null,8,un)])):((0,e.openBlock)(),(0,e.createElementBlock)(`rect`,{key:20,width:t.node.width,height:t.node.height,rx:p.value.nodeStyle.borderRadius,fill:b.value,stroke:x.value.color,"stroke-width":t.selected?3:x.value.width,filter:`url(#${T.value})`},null,8,dn)),t.node.animation===`breathing`?((0,e.openBlock)(),(0,e.createElementBlock)(`rect`,{key:21,width:t.node.width+6,height:t.node.height+6,x:-3,y:-3,rx:p.value.nodeStyle.borderRadius+3,fill:`none`,stroke:x.value.color,"stroke-width":`2`,class:`breathing-ring`,style:(0,e.normalizeStyle)(M.value)},null,12,fn)):(0,e.createCommentVNode)(``,!0),t.node.animation===`glowPulse`?((0,e.openBlock)(),(0,e.createElementBlock)(`rect`,{key:22,width:t.node.width,height:t.node.height,rx:p.value.nodeStyle.borderRadius,fill:`none`,stroke:x.value.color,"stroke-width":`2`,class:`glow-pulse-ring`,style:(0,e.normalizeStyle)(j.value)},null,12,pn)):(0,e.createCommentVNode)(``,!0),t.node.animation===`ripple`?((0,e.openBlock)(),(0,e.createElementBlock)(`rect`,{key:23,x:-10,y:-10,width:t.node.width+20,height:t.node.height+20,rx:p.value.nodeStyle.borderRadius+10,fill:`none`,stroke:x.value.color,"stroke-width":`2`,class:`ripple-ring`,style:(0,e.normalizeStyle)(N.value)},null,12,mn)):(0,e.createCommentVNode)(``,!0)],6),(0,e.createElementVNode)(`text`,{x:E.value.x,y:E.value.y,"text-anchor":E.value.textAnchor,"dominant-baseline":E.value.dominantBaseline,fill:w.value,"font-size":t.node.fontSize,transform:E.value.rotate?`rotate(${E.value.rotate}, ${E.value.x}, ${E.value.y})`:``,class:(0,e.normalizeClass)([`node-label`,{"label-hidden":!E.value.visible,"label-hover":t.node.labelPosition===`hover`}]),style:{"pointer-events":`none`,"user-select":`none`}},(0,e.toDisplayString)(t.node.label),11,hn),t.selected&&!t.node.locked?((0,e.openBlock)(),(0,e.createElementBlock)(`g`,gn,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(k.value,t=>((0,e.openBlock)(),(0,e.createElementBlock)(`rect`,{key:t.cursor,x:t.x-4,y:t.y-4,width:`8`,height:`8`,fill:`#409eff`,stroke:`#fff`,"stroke-width":`1`,style:(0,e.normalizeStyle)({cursor:t.cursor}),onMousedown:(0,e.withModifiers)(e=>V(t,e),[`stop`])},null,44,_n))),128))])):(0,e.createCommentVNode)(``,!0),f.value?((0,e.openBlock)(),(0,e.createElementBlock)(`circle`,{key:1,cx:t.node.width/2,cy:t.node.height/2,r:`8`,fill:`#409eff`,opacity:`0.6`,class:`connect-target`},null,8,vn)):(0,e.createCommentVNode)(``,!0),s.value?((0,e.openBlock)(),(0,e.createElementBlock)(`circle`,{key:2,cx:t.node.width/2,cy:t.node.height/2,r:`18`,fill:`none`,stroke:`#409eff`,"stroke-width":`3`,"stroke-dasharray":`113`,"stroke-dashoffset":`113`,class:`long-press-ring`},null,8,yn)):(0,e.createCommentVNode)(``,!0)],46,ht))}},[[`__scopeId`,`data-v-e89a49e8`]]),xn=[`d`,`stroke-width`],Sn=[`d`,`stroke`,`stroke-width`,`stroke-dasharray`],Cn=[`dur`],wn=[`fill`],Tn=[`dur`,`path`],En=[`fill`],Dn=[`dur`,`path`,`begin`],On=[`fill`],kn=[`dur`,`path`,`begin`],An=[`fill`],jn=[`dur`,`path`],Mn=[`dur`],Nn=[`dur`],Pn=[`fill`],Fn=[`dur`,`path`,`begin`],In=[`dur`],Ln=[`fill`],Rn=[`dur`,`path`,`begin`],zn=[`dur`],Bn=[`fill`],Vn=[`dur`,`path`],Hn=[`dur`],Un=[`dur`],Wn=[`fill`],Gn=[`dur`,`path`,`begin`],Kn=[`dur`],qn=[`dur`],Jn=[`fill`],Yn=[`dur`,`path`],Xn=[`dur`],Zn=[`fill`],Qn=[`dur`,`path`,`begin`],$n=[`dur`],er=[`transform`],tr=[`x`,`width`],nr={"text-anchor":`middle`,"dominant-baseline":`central`,fill:`#333`,"font-size":`12`,class:`edge-label`},rr=[`points`,`fill`,`transform`],ir=P({__name:`DiagramEdge`,props:{edge:{type:Object,required:!0},source:{type:Object,default:null},target:{type:Object,default:null},selected:{type:Boolean,default:!1},animationPlaying:{type:Boolean,default:!1}},emits:[`select`,`update-waypoint`,`reset-state`,`hover-remark`],setup(t){let n=t;(0,e.computed)(()=>({x:n.source.x+n.source.width/2,y:n.source.y+n.source.height/2})),(0,e.computed)(()=>({x:n.target.x+n.target.width/2,y:n.target.y+n.target.height/2}));let r=(0,e.computed)(()=>{let e=n.source,t=n.target,r=e.x+e.width/2,i=e.y+e.height/2,a=t.x+t.width/2,o=t.y+t.height/2,s=a-r,c=o-i;return Math.abs(s)>Math.abs(c)?s>0?{x:e.x+e.width,y:i}:{x:e.x,y:i}:c>0?{x:r,y:e.y+e.height}:{x:r,y:e.y}}),i=(0,e.computed)(()=>{let e=n.source,t=n.target,r=e.x+e.width/2,i=e.y+e.height/2,a=t.x+t.width/2,o=t.y+t.height/2,s=a-r,c=o-i;return Math.abs(s)>Math.abs(c)?s>0?{x:t.x,y:o}:{x:t.x+t.width,y:o}:c>0?{x:a,y:t.y}:{x:a,y:t.y+t.height}}),a=(0,e.computed)(()=>{let e=r.value,t=i.value;if(n.edge.waypoints&&n.edge.waypoints.length>0)return`M ${[e,...n.edge.waypoints,t].map(e=>`${e.x} ${e.y}`).join(` L `)}`;if(n.edge.curveType===`straight`)return`M ${e.x} ${e.y} L ${t.x} ${t.y}`;let a=t.x-e.x,o=t.y-e.y,s=Math.abs(a),c=Math.abs(o),l=Math.min(Math.max(s,c)*.4,80),u,d,f,p;return s>c?(u=e.x+l*Math.sign(a),d=e.y,f=t.x-l*Math.sign(a),p=t.y):(u=e.x,d=e.y+l*Math.sign(o),f=t.x,p=t.y-l*Math.sign(o)),`M ${e.x} ${e.y} C ${u} ${d}, ${f} ${p}, ${t.x} ${t.y}`}),o=(0,e.computed)(()=>{let e=r.value,t=i.value;return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}),s=(0,e.computed)(()=>n.edge.label?n.edge.label.length*8:0),c=(0,e.computed)(()=>{if(n.edge.animation===`dashFlow`)return`8,4`;switch(n.edge.lineStyle){case`dashed`:return`10,5`;case`dotted`:return`3,3`;case`animated`:return`8,4`;default:return`none`}}),l=(0,e.computed)(()=>n.edge.particleColor!=null&&n.edge.particleColor!==``?n.edge.particleColor:n.edge.lineColor),u=(0,e.computed)(()=>{let e=r.value,t=i.value;return Math.atan2(t.y-e.y,t.x-e.x)*180/Math.PI}),d=(0,e.computed)(()=>{let e=Math.max(n.edge.lineWidth+4,8);return`0 0, ${-e} ${-e/2}, ${-e} ${e/2}`}),f=(0,e.computed)(()=>{let e={},t=n.edge.animationDuration||2;return n.edge.animation===`pulse`?e.animation=`edgePulse ${t}s ease-in-out infinite`:n.edge.animation===`neon`&&(e.stroke=n.edge.lineColor,e.filter=`drop-shadow(0 0 4px currentColor) drop-shadow(0 0 8px currentColor)`,e.animation=`edgeNeon ${t}s ease-in-out infinite`),e});return(n,r)=>t.source&&t.target?((0,e.openBlock)(),(0,e.createElementBlock)(`g`,{key:0,class:(0,e.normalizeClass)([`diagram-edge`,{selected:t.selected}]),onClick:r[0]||=(0,e.withModifiers)(e=>n.$emit(`select`,t.edge.id),[`stop`]),onContextmenu:r[1]||=(0,e.withModifiers)(e=>n.$emit(`reset-state`),[`prevent`]),style:{cursor:`pointer`},onMouseenter:r[2]||=e=>n.$emit(`hover-remark`,{label:t.edge.label||`连线`,remark:t.edge.remark,event:e}),onMouseleave:r[3]||=e=>n.$emit(`hover-remark`,null)},[(0,e.createElementVNode)(`path`,{d:a.value,fill:`none`,stroke:`transparent`,"stroke-width":Math.max(t.edge.lineWidth+8,12),class:`edge-hit-area`},null,8,xn),(0,e.createElementVNode)(`path`,{d:a.value,fill:`none`,stroke:t.selected?`#409eff`:t.edge.lineColor,"stroke-width":t.edge.lineWidth,"stroke-dasharray":c.value,class:(0,e.normalizeClass)([`edge-line`,`anim-${t.edge.animation}`,`speed-${t.edge.animationSpeed}`]),style:(0,e.normalizeStyle)(f.value)},[t.animationPlaying&&t.edge.animation===`dashFlow`?((0,e.openBlock)(),(0,e.createElementBlock)(`animate`,{key:0,attributeName:`stroke-dashoffset`,from:`0`,to:`-24`,dur:(t.edge.animationDuration||2)+`s`,repeatCount:`indefinite`},null,8,Cn)):(0,e.createCommentVNode)(``,!0)],14,Sn),t.animationPlaying&&t.edge.animation===`flow`?((0,e.openBlock)(),(0,e.createElementBlock)(`circle`,{key:0,r:`4`,fill:l.value,class:`flow-particle`,style:(0,e.normalizeStyle)({animationDuration:(t.edge.animationDuration||2)+`s`})},[(0,e.createElementVNode)(`animateMotion`,{dur:(t.edge.animationDuration||2)+`s`,repeatCount:`indefinite`,path:a.value},null,8,Tn)],12,wn)):(0,e.createCommentVNode)(``,!0),t.animationPlaying&&t.edge.animation===`flow`?((0,e.openBlock)(),(0,e.createElementBlock)(`circle`,{key:1,r:`3`,fill:l.value,opacity:`0.6`,class:`flow-particle`,style:(0,e.normalizeStyle)({animationDuration:(t.edge.animationDuration||2)+`s`})},[(0,e.createElementVNode)(`animateMotion`,{dur:(t.edge.animationDuration||2)+`s`,repeatCount:`indefinite`,path:a.value,begin:(t.edge.animationDuration||2)/3+`s`},null,8,Dn)],12,En)):(0,e.createCommentVNode)(``,!0),t.animationPlaying&&t.edge.animation===`flow`?((0,e.openBlock)(),(0,e.createElementBlock)(`circle`,{key:2,r:`3`,fill:l.value,opacity:`0.4`,class:`flow-particle`,style:(0,e.normalizeStyle)({animationDuration:(t.edge.animationDuration||2)+`s`})},[(0,e.createElementVNode)(`animateMotion`,{dur:(t.edge.animationDuration||2)+`s`,repeatCount:`indefinite`,path:a.value,begin:(t.edge.animationDuration||2)*2/3+`s`},null,8,kn)],12,On)):(0,e.createCommentVNode)(``,!0),t.animationPlaying&&t.edge.animation===`particleGlow`?((0,e.openBlock)(),(0,e.createElementBlock)(`circle`,{key:3,r:`5`,fill:l.value,class:`glow-particle`},[(0,e.createElementVNode)(`animateMotion`,{dur:(t.edge.animationDuration||2)+`s`,repeatCount:`indefinite`,path:a.value},null,8,jn),(0,e.createElementVNode)(`animate`,{attributeName:`r`,values:`3;6;3`,dur:(t.edge.animationDuration||2)+`s`,repeatCount:`indefinite`},null,8,Mn),(0,e.createElementVNode)(`animate`,{attributeName:`opacity`,values:`0.5;1;0.5`,dur:(t.edge.animationDuration||2)+`s`,repeatCount:`indefinite`},null,8,Nn)],8,An)):(0,e.createCommentVNode)(``,!0),t.animationPlaying&&t.edge.animation===`particleGlow`?((0,e.openBlock)(),(0,e.createElementBlock)(`circle`,{key:4,r:`4`,fill:l.value,opacity:`0.5`,class:`glow-particle`},[(0,e.createElementVNode)(`animateMotion`,{dur:(t.edge.animationDuration||2)+`s`,repeatCount:`indefinite`,path:a.value,begin:(t.edge.animationDuration||2)/3+`s`},null,8,Fn),(0,e.createElementVNode)(`animate`,{attributeName:`r`,values:`2;5;2`,dur:(t.edge.animationDuration||2)+`s`,repeatCount:`indefinite`},null,8,In)],8,Pn)):(0,e.createCommentVNode)(``,!0),t.animationPlaying&&t.edge.animation===`particleGlow`?((0,e.openBlock)(),(0,e.createElementBlock)(`circle`,{key:5,r:`4`,fill:l.value,opacity:`0.3`,class:`glow-particle`},[(0,e.createElementVNode)(`animateMotion`,{dur:(t.edge.animationDuration||2)+`s`,repeatCount:`indefinite`,path:a.value,begin:(t.edge.animationDuration||2)*2/3+`s`},null,8,Rn),(0,e.createElementVNode)(`animate`,{attributeName:`r`,values:`2;5;2`,dur:(t.edge.animationDuration||2)+`s`,repeatCount:`indefinite`},null,8,zn)],8,Ln)):(0,e.createCommentVNode)(``,!0),t.animationPlaying&&t.edge.animation===`pulse`?((0,e.openBlock)(),(0,e.createElementBlock)(`circle`,{key:6,r:`6`,fill:l.value,opacity:`0`,class:`pulse-particle`},[(0,e.createElementVNode)(`animateMotion`,{dur:(t.edge.animationDuration||2)+`s`,repeatCount:`indefinite`,path:a.value},null,8,Vn),(0,e.createElementVNode)(`animate`,{attributeName:`r`,values:`2;8;2`,dur:(t.edge.animationDuration||2)+`s`,repeatCount:`indefinite`},null,8,Hn),(0,e.createElementVNode)(`animate`,{attributeName:`opacity`,values:`0;0.8;0`,dur:(t.edge.animationDuration||2)+`s`,repeatCount:`indefinite`},null,8,Un)],8,Bn)):(0,e.createCommentVNode)(``,!0),t.animationPlaying&&t.edge.animation===`pulse`?((0,e.openBlock)(),(0,e.createElementBlock)(`circle`,{key:7,r:`6`,fill:l.value,opacity:`0`,class:`pulse-particle`},[(0,e.createElementVNode)(`animateMotion`,{dur:(t.edge.animationDuration||2)+`s`,repeatCount:`indefinite`,path:a.value,begin:(t.edge.animationDuration||2)/2+`s`},null,8,Gn),(0,e.createElementVNode)(`animate`,{attributeName:`r`,values:`2;8;2`,dur:(t.edge.animationDuration||2)+`s`,repeatCount:`indefinite`},null,8,Kn),(0,e.createElementVNode)(`animate`,{attributeName:`opacity`,values:`0;0.8;0`,dur:(t.edge.animationDuration||2)+`s`,repeatCount:`indefinite`},null,8,qn)],8,Wn)):(0,e.createCommentVNode)(``,!0),t.animationPlaying&&t.edge.animation===`neon`?((0,e.openBlock)(),(0,e.createElementBlock)(`circle`,{key:8,r:`4`,fill:l.value,class:`neon-particle`},[(0,e.createElementVNode)(`animateMotion`,{dur:(t.edge.animationDuration||2)+`s`,repeatCount:`indefinite`,path:a.value},null,8,Yn),(0,e.createElementVNode)(`animate`,{attributeName:`r`,values:`2;5;2`,dur:(t.edge.animationDuration||2)+`s`,repeatCount:`indefinite`},null,8,Xn)],8,Jn)):(0,e.createCommentVNode)(``,!0),t.animationPlaying&&t.edge.animation===`neon`?((0,e.openBlock)(),(0,e.createElementBlock)(`circle`,{key:9,r:`4`,fill:l.value,opacity:`0.4`,class:`neon-particle`},[(0,e.createElementVNode)(`animateMotion`,{dur:(t.edge.animationDuration||2)+`s`,repeatCount:`indefinite`,path:a.value,begin:(t.edge.animationDuration||2)/2+`s`},null,8,Qn),(0,e.createElementVNode)(`animate`,{attributeName:`r`,values:`2;5;2`,dur:(t.edge.animationDuration||2)+`s`,repeatCount:`indefinite`},null,8,$n)],8,Zn)):(0,e.createCommentVNode)(``,!0),t.edge.label?((0,e.openBlock)(),(0,e.createElementBlock)(`g`,{key:10,transform:`translate(${o.value.x}, ${o.value.y})`},[(0,e.createElementVNode)(`rect`,{x:-s.value/2-6,y:-10,width:s.value+12,height:`20`,rx:`4`,fill:`#fff`,stroke:`#e4e7ed`,"stroke-width":`1`},null,8,tr),(0,e.createElementVNode)(`text`,nr,(0,e.toDisplayString)(t.edge.label),1)],8,er)):(0,e.createCommentVNode)(``,!0),t.edge.arrowType===`none`?(0,e.createCommentVNode)(``,!0):((0,e.openBlock)(),(0,e.createElementBlock)(`polygon`,{key:11,points:d.value,fill:t.selected?`#409eff`:t.edge.lineColor,transform:`translate(${i.value.x}, ${i.value.y}) rotate(${u.value})`},null,8,rr))],34)):(0,e.createCommentVNode)(``,!0)}},[[`__scopeId`,`data-v-737212ef`]]),ar=[`transform`],or=[`width`,`height`,`fill`,`stroke`,`stroke-width`],sr=[`width`,`height`,`fill`,`opacity`],cr=[`width`,`height`,`fill`,`opacity`],lr=[`x`,`y`,`fill`,`font-size`,`font-family`,`font-weight`,`font-style`,`transform`],ur=[`x`,`y`,`text-anchor`,`fill`,`font-size`,`font-family`,`font-weight`,`font-style`],dr=[`y`,`width`],fr={xmlns:`http://www.w3.org/1999/xhtml`,class:`edit-name-container`},pr=[`x`,`height`],mr={xmlns:`http://www.w3.org/1999/xhtml`,class:`edit-name-container vertical`},hr=[`x1`,`x2`,`onClick`],gr=[`x1`,`x2`,`stroke`],_r=[`y1`,`x2`,`y2`,`onClick`,`onMousedown`],vr=[`x1`,`x2`,`y2`,`onClick`,`onMousedown`],yr=[`y1`,`x2`,`y2`,`stroke`],br=[`x1`,`x2`,`y2`,`stroke`],xr=[`y1`,`x2`,`y2`,`onClick`],Sr=[`y1`,`x2`,`y2`,`stroke`],Cr=[`x1`,`x2`,`y2`,`onClick`],wr=[`x1`,`x2`,`y2`,`stroke`],Tr=[`x`,`y`,`width`,`height`,`fill`,`stroke`,`stroke-width`,`opacity`,`onClick`],Er=[`x`,`y`,`width`,`height`,`fill`,`stroke`,`stroke-width`,`opacity`,`onClick`],Dr=[`x`,`y`,`width`,`fill`],Or=[`x`,`y`,`width`,`fill`],kr=[`x`,`y`,`text-anchor`,`fill`,`font-size`,`font-family`,`font-weight`,`font-style`,`onClick`,`onDblclick`],Ar=[`x`,`y`,`text-anchor`,`fill`,`font-size`,`font-family`,`font-weight`,`font-style`,`onClick`,`onDblclick`],jr=[`x`,`y`,`width`],Mr={xmlns:`http://www.w3.org/1999/xhtml`,class:`edit-lane-container`},Nr=[`onBlur`,`onKeydown`],Pr=[`x`,`y`,`width`],Fr={xmlns:`http://www.w3.org/1999/xhtml`,class:`edit-lane-container`},Ir=[`onBlur`,`onKeydown`],Lr=[`x`,`y`],Rr=[`x`,`y`],zr=[`x`,`y`],Br=[`y1`,`x2`,`y2`],Vr=[`x1`,`x2`,`y2`],Hr=P({__name:`SwimlaneNode`,props:{swimlane:{type:Object,required:!0},selected:{type:Boolean,default:!1},selectedLaneId:{type:String,default:null}},emits:[`select`,`select-lane`,`update-swimlane`,`update-lane`,`resize-swimlane`,`resize-lane`,`move-swimlane`],setup(t,{emit:n}){let r=t,i=n,a=(0,e.computed)(()=>r.swimlane.direction===`horizontal`?80:r.swimlane.width),o=(0,e.computed)(()=>r.swimlane.direction===`horizontal`?r.swimlane.height:40),s=(0,e.computed)(()=>r.swimlane.direction!==`horizontal`||!r.swimlane.lanes||r.swimlane.lanes.length===0?r.swimlane.height:r.swimlane.lanes.reduce((e,t)=>e+t.height,0)),c=e=>r.swimlane.lanes.slice(0,e).reduce((e,t)=>e+t.height,0),l=e=>{if(r.swimlane.direction===`vertical`)return r.swimlane.lanes.slice(0,e).reduce((e,t)=>e+(t.width||200),0);let t=r.swimlane.lanes.length||1;return r.swimlane.width/t*e},u=e=>{if(r.swimlane.direction===`vertical`)return r.swimlane.lanes[e]?.width||200;let t=r.swimlane.lanes.length||1;return r.swimlane.width/t},d=(0,e.ref)(!1),f=(0,e.ref)(``),p=(0,e.ref)(null),m=()=>{f.value=r.swimlane.name,d.value=!0,(0,e.nextTick)(()=>{p.value?.focus(),p.value?.select()})},h=()=>{i(`select`)},g=()=>{d.value&&f.value.trim()&&i(`update-swimlane`,r.swimlane.id,{name:f.value.trim()}),d.value=!1},_=()=>{d.value=!1},v=e=>{i(`select-lane`,e)},y=(0,e.ref)(null),b=(0,e.ref)(``),x=(0,e.ref)(null),S=t=>{i(`select-lane`,t.id),y.value=t.id,b.value=t.name,(0,e.nextTick)(()=>{x.value?.focus(),x.value?.select()})},C=e=>{y.value===e.id&&b.value.trim()&&i(`update-lane`,r.swimlane.id,e.id,{name:b.value.trim()}),y.value=null},w=()=>{y.value=null},T=(0,e.ref)(null),E=(0,e.ref)({x:0,y:0}),D=(0,e.ref)({width:0,height:0}),O=(e,t)=>{e.preventDefault(),T.value=t,E.value={x:e.clientX,y:e.clientY},D.value={width:r.swimlane.width,height:s.value};let n=e=>{let n=e.clientX-E.value.x,a=e.clientY-E.value.y,o=D.value.width,s=D.value.height;(t===`right`||t===`corner`)&&(o=Math.max(200,D.value.width+n)),(t===`bottom`||t===`corner`)&&(s=Math.max(100,D.value.height+a)),i(`resize-swimlane`,r.swimlane.id,o,s)},a=()=>{T.value=null,window.removeEventListener(`mousemove`,n),window.removeEventListener(`mouseup`,a)};window.addEventListener(`mousemove`,n),window.addEventListener(`mouseup`,a)},k=e=>{if(e.button!==0||e.target.closest(`.resize-handle`)||e.target.closest(`.lane-divider-hit`))return;e.stopPropagation(),e.preventDefault();let t=e.clientX,n=e.clientY,a=r.swimlane.x,o=r.swimlane.y,s=e=>{let s=e.clientX-t,c=e.clientY-n;i(`move-swimlane`,r.swimlane.id,a+s,o+c)},c=()=>{window.removeEventListener(`mousemove`,s),window.removeEventListener(`mouseup`,c)};window.addEventListener(`mousemove`,s),window.addEventListener(`mouseup`,c)},A=(0,e.ref)(null),j=(0,e.ref)(0),M=(0,e.ref)(0),N=(0,e.ref)(0),P=(e,t)=>{e.preventDefault(),A.value=t,r.swimlane.direction===`horizontal`?(j.value=c(t),N.value=r.swimlane.lanes[t].height):(M.value=l(t),N.value=r.swimlane.lanes[t].width||u(t));let n={x:e.clientX,y:e.clientY},a=e=>{if(r.swimlane.direction===`horizontal`){let a=e.clientY-n.y,o=Math.max(40,N.value+a);i(`resize-lane`,r.swimlane.id,r.swimlane.lanes[t].id,o)}else{let a=e.clientX-n.x,o=Math.max(80,N.value+a);i(`resize-lane`,r.swimlane.id,r.swimlane.lanes[t].id,null,o)}},o=()=>{A.value=null,window.removeEventListener(`mousemove`,a),window.removeEventListener(`mouseup`,o)};window.addEventListener(`mousemove`,a),window.addEventListener(`mouseup`,o)};return(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`g`,{class:(0,e.normalizeClass)([`swimlane-node`,{selected:t.selected}]),transform:`translate(${t.swimlane.x}, ${t.swimlane.y})`,onMousedown:k},[(0,e.createElementVNode)(`rect`,{width:t.swimlane.width,height:s.value,fill:t.swimlane.color,stroke:t.selected?`#409eff`:t.swimlane.borderColor,"stroke-width":t.selected?2:1,rx:`4`,class:`swimlane-bg`,onClick:r[0]||=(0,e.withModifiers)(e=>n.$emit(`select`),[`stop`])},null,8,or),t.swimlane.direction===`horizontal`?((0,e.openBlock)(),(0,e.createElementBlock)(`rect`,{key:0,width:a.value,height:s.value,fill:t.swimlane.headerColor,opacity:t.swimlane.headerOpacity??1,rx:`4`,class:`swimlane-header`,onClick:(0,e.withModifiers)(h,[`stop`]),onDblclick:(0,e.withModifiers)(m,[`stop`])},null,40,sr)):((0,e.openBlock)(),(0,e.createElementBlock)(`rect`,{key:1,width:t.swimlane.width,height:o.value,fill:t.swimlane.headerColor,opacity:t.swimlane.headerOpacity??1,rx:`4`,class:`swimlane-header`,onClick:(0,e.withModifiers)(h,[`stop`]),onDblclick:(0,e.withModifiers)(m,[`stop`])},null,40,cr)),!d.value&&t.swimlane.direction===`horizontal`?((0,e.openBlock)(),(0,e.createElementBlock)(`text`,{key:2,x:a.value/2,y:s.value/2,"text-anchor":`middle`,fill:t.swimlane.headerTextColor,"font-size":t.swimlane.fontSize,"font-family":t.swimlane.fontFamily||`sans-serif`,"font-weight":t.swimlane.fontWeight||`600`,"font-style":t.swimlane.fontStyle||`normal`,class:`swimlane-title`,"pointer-events":`none`,transform:`rotate(-90, ${a.value/2}, ${s.value/2})`,dy:`0.35em`},(0,e.toDisplayString)(t.swimlane.name),9,lr)):!d.value&&t.swimlane.direction===`vertical`?((0,e.openBlock)(),(0,e.createElementBlock)(`text`,{key:3,x:t.swimlane.textAlign===`left`?8:t.swimlane.textAlign===`right`?t.swimlane.width-8:t.swimlane.width/2,y:o.value/2,"text-anchor":t.swimlane.textAlign===`left`?`start`:t.swimlane.textAlign===`right`?`end`:`middle`,fill:t.swimlane.headerTextColor,"font-size":t.swimlane.fontSize,"font-family":t.swimlane.fontFamily||`sans-serif`,"font-weight":t.swimlane.fontWeight||`600`,"font-style":t.swimlane.fontStyle||`normal`,class:`swimlane-title`,"pointer-events":`none`,"dominant-baseline":`central`},(0,e.toDisplayString)(t.swimlane.name),9,ur)):(0,e.createCommentVNode)(``,!0),d.value&&t.swimlane.direction===`horizontal`?((0,e.openBlock)(),(0,e.createElementBlock)(`foreignObject`,{key:4,x:0,y:s.value/2-14,width:a.value,height:28},[(0,e.createElementVNode)(`div`,fr,[(0,e.withDirectives)((0,e.createElementVNode)(`input`,{ref_key:`nameInputRef`,ref:p,"onUpdate:modelValue":r[1]||=e=>f.value=e,class:`edit-name-input`,style:(0,e.normalizeStyle)({color:t.swimlane.headerTextColor,fontSize:t.swimlane.fontSize+`px`,fontFamily:t.swimlane.fontFamily||`sans-serif`,fontWeight:t.swimlane.fontWeight||`600`,fontStyle:t.swimlane.fontStyle||`normal`}),onBlur:g,onKeydown:[(0,e.withKeys)(g,[`enter`]),(0,e.withKeys)(_,[`escape`])],onClick:r[2]||=(0,e.withModifiers)(()=>{},[`stop`])},null,36),[[e.vModelText,f.value]])])],8,dr)):(0,e.createCommentVNode)(``,!0),d.value&&t.swimlane.direction===`vertical`?((0,e.openBlock)(),(0,e.createElementBlock)(`foreignObject`,{key:5,x:t.swimlane.textAlign===`left`?0:t.swimlane.textAlign===`right`?t.swimlane.width-120:t.swimlane.width/2-60,y:0,width:120,height:o.value},[(0,e.createElementVNode)(`div`,mr,[(0,e.withDirectives)((0,e.createElementVNode)(`input`,{ref_key:`nameInputRef`,ref:p,"onUpdate:modelValue":r[3]||=e=>f.value=e,class:`edit-name-input`,style:(0,e.normalizeStyle)({color:t.swimlane.headerTextColor,fontSize:t.swimlane.fontSize+`px`,fontFamily:t.swimlane.fontFamily||`sans-serif`,fontWeight:t.swimlane.fontWeight||`600`,fontStyle:t.swimlane.fontStyle||`normal`,textAlign:t.swimlane.textAlign||`center`}),onBlur:g,onKeydown:[(0,e.withKeys)(g,[`enter`]),(0,e.withKeys)(_,[`escape`])],onClick:r[4]||=(0,e.withModifiers)(()=>{},[`stop`])},null,36),[[e.vModelText,f.value]])])],8,pr)):(0,e.createCommentVNode)(``,!0),t.swimlane.lanes&&t.swimlane.lanes.length?((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,{key:6},(0,e.renderList)(t.swimlane.lanes,(n,i)=>((0,e.openBlock)(),(0,e.createElementBlock)(`g`,{key:n.id},[i===0&&t.swimlane.direction===`horizontal`?((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:0},[(0,e.createElementVNode)(`line`,{x1:a.value,y1:0,x2:t.swimlane.width,y2:0,stroke:`transparent`,"stroke-width":`12`,class:`lane-divider-hit`,style:{cursor:`ns-resize`},onClick:(0,e.withModifiers)(e=>v(n.id),[`stop`]),onMousedown:r[5]||=(0,e.withModifiers)(e=>P(e,0),[`stop`])},null,40,hr),(0,e.createElementVNode)(`line`,{x1:a.value,y1:0,x2:t.swimlane.width,y2:0,stroke:t.swimlane.borderColor,"stroke-width":`1`,"stroke-dasharray":`4,2`,class:`lane-divider`,"pointer-events":`none`},null,8,gr)],64)):(0,e.createCommentVNode)(``,!0),i>0?((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:1},[t.swimlane.direction===`horizontal`?((0,e.openBlock)(),(0,e.createElementBlock)(`line`,{key:0,x1:0,y1:c(i),x2:t.swimlane.width,y2:c(i),stroke:`transparent`,"stroke-width":`12`,class:`lane-divider-hit`,style:{cursor:`ns-resize`},onClick:(0,e.withModifiers)(e=>v(t.swimlane.lanes[i-1].id),[`stop`]),onMousedown:(0,e.withModifiers)(e=>P(e,i-1),[`stop`])},null,40,_r)):((0,e.openBlock)(),(0,e.createElementBlock)(`line`,{key:1,x1:l(i),y1:0,x2:l(i),y2:s.value,stroke:`transparent`,"stroke-width":`12`,class:`lane-divider-hit`,style:{cursor:`ew-resize`},onClick:(0,e.withModifiers)(e=>v(t.swimlane.lanes[i-1].id),[`stop`]),onMousedown:(0,e.withModifiers)(e=>P(e,i-1),[`stop`])},null,40,vr)),t.swimlane.direction===`horizontal`?((0,e.openBlock)(),(0,e.createElementBlock)(`line`,{key:2,x1:0,y1:c(i),x2:t.swimlane.width,y2:c(i),stroke:t.swimlane.borderColor,"stroke-width":`1`,"stroke-dasharray":`4,2`,class:`lane-divider`,"pointer-events":`none`},null,8,yr)):((0,e.openBlock)(),(0,e.createElementBlock)(`line`,{key:3,x1:l(i),y1:0,x2:l(i),y2:s.value,stroke:t.swimlane.borderColor,"stroke-width":`1`,"stroke-dasharray":`4,2`,class:`lane-divider`,"pointer-events":`none`},null,8,br))],64)):(0,e.createCommentVNode)(``,!0),i===t.swimlane.lanes.length-1&&t.swimlane.direction===`horizontal`?((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:2},[(0,e.createElementVNode)(`line`,{x1:0,y1:s.value,x2:t.swimlane.width,y2:s.value,stroke:`transparent`,"stroke-width":`12`,class:`lane-divider-hit`,style:{cursor:`ns-resize`},onClick:(0,e.withModifiers)(e=>v(n.id),[`stop`]),onMousedown:r[6]||=(0,e.withModifiers)(e=>P(e,t.swimlane.lanes.length-1),[`stop`])},null,40,xr),(0,e.createElementVNode)(`line`,{x1:0,y1:s.value,x2:t.swimlane.width,y2:s.value,stroke:t.swimlane.borderColor,"stroke-width":`1`,"stroke-dasharray":`4,2`,class:`lane-divider`,"pointer-events":`none`},null,8,Sr)],64)):(0,e.createCommentVNode)(``,!0),i===t.swimlane.lanes.length-1&&t.swimlane.direction===`vertical`?((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:3},[(0,e.createElementVNode)(`line`,{x1:l(t.swimlane.lanes.length),y1:0,x2:l(t.swimlane.lanes.length),y2:s.value,stroke:`transparent`,"stroke-width":`12`,class:`lane-divider-hit`,style:{cursor:`ew-resize`},onClick:(0,e.withModifiers)(e=>v(n.id),[`stop`]),onMousedown:r[7]||=(0,e.withModifiers)(e=>P(e,t.swimlane.lanes.length-1),[`stop`])},null,40,Cr),(0,e.createElementVNode)(`line`,{x1:l(t.swimlane.lanes.length),y1:0,x2:l(t.swimlane.lanes.length),y2:s.value,stroke:t.swimlane.borderColor,"stroke-width":`1`,"stroke-dasharray":`4,2`,class:`lane-divider`,"pointer-events":`none`},null,8,wr)],64)):(0,e.createCommentVNode)(``,!0),t.swimlane.direction===`horizontal`?((0,e.openBlock)(),(0,e.createElementBlock)(`rect`,{key:4,x:a.value+4,y:c(i)+4,width:t.swimlane.width-a.value-8,height:n.height-8,fill:n.color,stroke:t.selectedLaneId===n.id?`#409eff`:`transparent`,"stroke-width":t.selectedLaneId===n.id?2:0,rx:`2`,opacity:n.opacity??.5,class:`lane-bg`,onClick:(0,e.withModifiers)(e=>v(n.id),[`stop`])},null,8,Tr)):((0,e.openBlock)(),(0,e.createElementBlock)(`rect`,{key:5,x:l(i)+4,y:o.value+4,width:u(i)-8,height:s.value-o.value-8,fill:n.color,stroke:t.selectedLaneId===n.id?`#409eff`:`transparent`,"stroke-width":t.selectedLaneId===n.id?2:0,rx:`2`,opacity:n.opacity??.5,class:`lane-bg`,onClick:(0,e.withModifiers)(e=>v(n.id),[`stop`])},null,8,Er)),n.headerColor?(0,e.withDirectives)(((0,e.openBlock)(),(0,e.createElementBlock)(`rect`,{key:6,x:a.value+4,y:c(i)+4,width:t.swimlane.width-a.value-8,height:26,fill:n.headerColor,rx:`2`,"pointer-events":`none`},null,8,Dr)),[[e.vShow,t.swimlane.direction===`horizontal`]]):(0,e.createCommentVNode)(``,!0),n.headerColor?(0,e.withDirectives)(((0,e.openBlock)(),(0,e.createElementBlock)(`rect`,{key:7,x:l(i)+4,y:o.value+4,width:u(i)-8,height:26,fill:n.headerColor,rx:`2`,"pointer-events":`none`},null,8,Or)),[[e.vShow,t.swimlane.direction===`vertical`]]):(0,e.createCommentVNode)(``,!0),t.swimlane.direction===`horizontal`&&y.value!==n.id?((0,e.openBlock)(),(0,e.createElementBlock)(`text`,{key:8,x:n.textAlign===`center`?(a.value+t.swimlane.width)/2:n.textAlign===`right`?t.swimlane.width-10:a.value+10,y:c(i)+17,"text-anchor":n.textAlign===`center`?`middle`:n.textAlign===`right`?`end`:`start`,"dominant-baseline":`central`,fill:n.textColor||`#666`,"font-size":n.fontSize||11,"font-family":n.fontFamily||`sans-serif`,"font-weight":n.fontWeight||`normal`,"font-style":n.fontStyle||`normal`,class:`lane-label`,onClick:(0,e.withModifiers)(e=>v(n.id),[`stop`]),onDblclick:(0,e.withModifiers)(e=>S(n),[`stop`])},(0,e.toDisplayString)(n.name),41,kr)):t.swimlane.direction===`vertical`&&y.value!==n.id?((0,e.openBlock)(),(0,e.createElementBlock)(`text`,{key:9,x:n.textAlign===`center`?l(i)+u(i)/2:n.textAlign===`right`?l(i)+u(i)-10:l(i)+10,y:o.value+17,"text-anchor":n.textAlign===`center`?`middle`:n.textAlign===`right`?`end`:`start`,"dominant-baseline":`central`,fill:n.textColor||`#666`,"font-size":n.fontSize||11,"font-family":n.fontFamily||`sans-serif`,"font-weight":n.fontWeight||`normal`,"font-style":n.fontStyle||`normal`,class:`lane-label`,onClick:(0,e.withModifiers)(e=>v(n.id),[`stop`]),onDblclick:(0,e.withModifiers)(e=>S(n),[`stop`])},(0,e.toDisplayString)(n.name),41,Ar)):(0,e.createCommentVNode)(``,!0),y.value===n.id&&t.swimlane.direction===`horizontal`?((0,e.openBlock)(),(0,e.createElementBlock)(`foreignObject`,{key:10,x:a.value+8,y:c(i)+4,width:t.swimlane.width-a.value-16,height:26},[(0,e.createElementVNode)(`div`,Mr,[(0,e.withDirectives)((0,e.createElementVNode)(`input`,{ref_for:!0,ref_key:`laneNameInputRef`,ref:x,"onUpdate:modelValue":r[8]||=e=>b.value=e,class:`edit-lane-input`,style:(0,e.normalizeStyle)({color:n.textColor||`#666`,fontSize:(n.fontSize||11)+`px`,fontFamily:n.fontFamily||`sans-serif`,fontWeight:n.fontWeight||`normal`,fontStyle:n.fontStyle||`normal`,textAlign:n.textAlign||`left`}),onBlur:e=>C(n),onKeydown:[(0,e.withKeys)(e=>C(n),[`enter`]),(0,e.withKeys)(w,[`escape`])],onClick:r[9]||=(0,e.withModifiers)(()=>{},[`stop`])},null,44,Nr),[[e.vModelText,b.value]])])],8,jr)):(0,e.createCommentVNode)(``,!0),y.value===n.id&&t.swimlane.direction===`vertical`?((0,e.openBlock)(),(0,e.createElementBlock)(`foreignObject`,{key:11,x:l(i)+8,y:o.value+4,width:u(i)-16,height:26},[(0,e.createElementVNode)(`div`,Fr,[(0,e.withDirectives)((0,e.createElementVNode)(`input`,{ref_for:!0,ref_key:`laneNameInputRef`,ref:x,"onUpdate:modelValue":r[10]||=e=>b.value=e,class:`edit-lane-input`,style:(0,e.normalizeStyle)({color:n.textColor||`#666`,fontSize:(n.fontSize||11)+`px`,fontFamily:n.fontFamily||`sans-serif`,fontWeight:n.fontWeight||`normal`,fontStyle:n.fontStyle||`normal`,textAlign:n.textAlign||`left`}),onBlur:e=>C(n),onKeydown:[(0,e.withKeys)(e=>C(n),[`enter`]),(0,e.withKeys)(w,[`escape`])],onClick:r[11]||=(0,e.withModifiers)(()=>{},[`stop`])},null,44,Ir),[[e.vModelText,b.value]])])],8,Pr)):(0,e.createCommentVNode)(``,!0)]))),128)):(0,e.createCommentVNode)(``,!0),t.selected?((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:7},[(0,e.createElementVNode)(`rect`,{x:l(t.swimlane.lanes?.length||0)-4,y:s.value/2-10,width:`8`,height:`20`,fill:`#409eff`,rx:`2`,class:`resize-handle`,style:{cursor:`ew-resize`},onMousedown:r[12]||=(0,e.withModifiers)(e=>O(e,`right`),[`stop`,`prevent`]),onClick:r[13]||=(0,e.withModifiers)(()=>{},[`stop`])},null,40,Lr),(0,e.createElementVNode)(`rect`,{x:t.swimlane.width/2-10,y:s.value-4,width:`20`,height:`8`,fill:`#409eff`,rx:`2`,class:`resize-handle`,style:{cursor:`ns-resize`},onMousedown:r[14]||=(0,e.withModifiers)(e=>O(e,`bottom`),[`stop`,`prevent`]),onClick:r[15]||=(0,e.withModifiers)(()=>{},[`stop`])},null,40,Rr),(0,e.createElementVNode)(`rect`,{x:l(t.swimlane.lanes?.length||0)-6,y:s.value-6,width:`12`,height:`12`,fill:`#409eff`,rx:`2`,class:`resize-handle`,style:{cursor:`nwse-resize`},onMousedown:r[16]||=(0,e.withModifiers)(e=>O(e,`corner`),[`stop`,`prevent`]),onClick:r[17]||=(0,e.withModifiers)(()=>{},[`stop`])},null,40,zr)],64)):(0,e.createCommentVNode)(``,!0),A.value===null?(0,e.createCommentVNode)(``,!0):((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:8},[t.swimlane.direction===`horizontal`?((0,e.openBlock)(),(0,e.createElementBlock)(`line`,{key:0,x1:0,y1:j.value,x2:t.swimlane.width,y2:j.value,stroke:`#409eff`,"stroke-width":`2`,"stroke-dasharray":`6,3`},null,8,Br)):((0,e.openBlock)(),(0,e.createElementBlock)(`line`,{key:1,x1:M.value,y1:0,x2:M.value,y2:s.value,stroke:`#409eff`,"stroke-width":`2`,"stroke-dasharray":`6,3`},null,8,Vr))],64))],42,ar))}},[[`__scopeId`,`data-v-8e00b7cb`]]),Ur=[`width`,`height`,`viewBox`],Wr=[`width`,`height`],Gr=[`d`],Kr=[`transform`],qr={key:0,x:`-5000`,y:`-5000`,width:`10000`,height:`10000`,fill:`url(#grid)`,class:`grid-bg`},Jr={key:1},Yr=[`x1`,`y1`,`x2`,`y2`],Xr={class:`tooltip-content`},Zr={class:`zoom-controls`},Qr={class:`zoom-label`},$r=P({__name:`DiagramCanvas`,props:{nodes:{type:Array,default:()=>[]},edges:{type:Array,default:()=>[]},swimlanes:{type:Array,default:()=>[]},selectedNodeId:{type:String,default:null},selectedEdgeId:{type:String,default:null},selectedSwimlaneId:{type:String,default:null},selectedLaneId:{type:String,default:null},connectMode:{type:Boolean,default:!1},connectSource:{type:String,default:null},autoConnectSource:{type:String,default:null},autoConnectMode:{type:Boolean,default:!1},animationPlaying:{type:Boolean,default:!1},theme:{type:String,default:`classic`}},emits:[`select-node`,`select-edge`,`select-swimlane`,`select-canvas`,`select-lane`,`update-swimlane`,`update-lane`,`resize-swimlane`,`resize-lane`,`move-swimlane`,`start-connect`,`end-connect`,`auto-connect-start`,`node-drag`,`node-resize`,`node-drag-end`,`node-resize-end`,`drop-node`,`update-waypoint`,`reset-state`,`hover-remark`,`fit-view`],setup(t,{expose:n,emit:r}){function i(e){e.key===`Escape`&&o(`reset-state`)}let a=t,o=r,s=(0,e.ref)(null),c=(0,e.ref)(null),l=(0,e.ref)(4e3),u=(0,e.ref)(3e3),d=(0,e.ref)(1),f=(0,e.ref)(0),p=(0,e.ref)(0),m=(0,e.ref)(!0),h=(0,e.ref)(20),g=(0,e.ref)(!1),_=(0,e.ref)(!1),v=(0,e.ref)({x:0,y:0}),y=(0,e.ref)(null),b=(0,e.computed)(()=>{let e=l.value/d.value,t=u.value/d.value;return`${-f.value/d.value} ${-p.value/d.value} ${e} ${t}`}),x=(0,e.computed)(()=>[...a.nodes].sort((e,t)=>(e.zIndex||0)-(t.zIndex||0))),S=(0,e.computed)(()=>a.connectSource?a.nodes.find(e=>e.id===a.connectSource):null),C=(0,e.ref)(null),w=(0,e.ref)(0),T=(0,e.ref)(0),E=e=>{if(e&&e.remark){C.value=e;let t=s.value.getBoundingClientRect();if(e.x!==void 0&&e.w!==void 0){let t=e.x*d.value+f.value,n=e.y*d.value+p.value,r=e.w*d.value,i=e.h*d.value;w.value=t+r/2,T.value=n+i+8}else w.value=e.event.clientX-t.left+12,T.value=e.event.clientY-t.top-10}else C.value=null},D=e=>a.nodes.find(t=>t.id===e),O=e=>{if(A)return;let t=e.target;(t===c.value||t.classList.contains(`grid-bg`)||t.classList.contains(`diagram-svg`))&&o(`select-canvas`)},k=()=>{o(`reset-state`)},A=!1,j=e=>{e.button===0&&(_.value=!0,A=!1,v.value={x:e.clientX,y:e.clientY},e.preventDefault())},M=e=>{if(_.value){let t=e.clientX-v.value.x,n=e.clientY-v.value.y;(Math.abs(t)>3||Math.abs(n)>3)&&(A=!0),f.value+=t,p.value+=n,v.value={x:e.clientX,y:e.clientY}}if(a.connectSource&&S.value){let t=c.value.getBoundingClientRect();y.value={x:(e.clientX-t.left-f.value)/d.value,y:(e.clientY-t.top-p.value)/d.value}}},N=()=>{_.value=!1,g.value=!1,a.autoConnectMode&&o(`end-connect`,null)},P=e=>{let t=e.deltaY>0?-.1:.1;d.value=Math.min(Math.max(d.value+t,.2),3)},F=()=>{d.value=Math.min(d.value+.1,3)},I=()=>{d.value=Math.max(d.value-.1,.2)},L=()=>{d.value=1,f.value=0,p.value=0},R=()=>{o(`fit-view`)},z=(e,t,n)=>{o(`node-drag`,e,t,n)},B=(e,t,n)=>{o(`node-resize`,e,t,n)},V=(e,t,n,r)=>{o(`update-waypoint`,e,t,n,r)},H=e=>{(e.key===`Delete`||e.key===`Backspace`)&&a.selectedNodeId&&o(`select-node`,null),e.key===`Escape`&&o(`reset-state`)},U=e=>{e.preventDefault();let t=e.dataTransfer.getData(`node-type`);if(!t)return;let n=c.value.getBoundingClientRect();o(`drop-node`,t,(e.clientX-n.left-f.value)/d.value,(e.clientY-n.top-p.value)/d.value)};return(0,e.onMounted)(()=>{s.value?.addEventListener(`drop`,U),s.value?.addEventListener(`dragover`,e=>e.preventDefault()),window.addEventListener(`keydown`,i)}),(0,e.onUnmounted)(()=>{s.value?.removeEventListener(`drop`,U),window.removeEventListener(`keydown`,i)}),n({fitView:R,resetView:L,zoomIn:F,zoomOut:I,svgRef:c}),(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:`diagram-canvas`,ref_key:`containerRef`,ref:s,onMousedown:j,onMousemove:M,onMouseup:N,onWheel:(0,e.withModifiers)(P,[`prevent`]),onClick:O,onContextmenu:(0,e.withModifiers)(k,[`prevent`]),onKeydown:H,tabindex:`0`},[((0,e.openBlock)(),(0,e.createElementBlock)(`svg`,{ref_key:`svgRef`,ref:c,width:l.value,height:u.value,viewBox:b.value,class:`diagram-svg`},[(0,e.createElementVNode)(`defs`,null,[(0,e.createElementVNode)(`pattern`,{id:`grid`,width:h.value,height:h.value,patternUnits:`userSpaceOnUse`},[(0,e.createElementVNode)(`path`,{d:`M ${h.value} 0 L 0 0 0 ${h.value}`,fill:`none`,stroke:`#e8e8e8`,"stroke-width":`1`},null,8,Gr)],8,Wr),r[11]||=(0,e.createStaticVNode)(`<filter id="shadow" x="-20%" y="-20%" width="140%" height="140%" data-v-878b95c1><feDropShadow dx="2" dy="2" stdDeviation="3" flood-opacity="0.15" data-v-878b95c1></feDropShadow></filter><filter id="glow" data-v-878b95c1><feGaussianBlur stdDeviation="3" result="coloredBlur" data-v-878b95c1></feGaussianBlur><feMerge data-v-878b95c1><feMergeNode in="coloredBlur" data-v-878b95c1></feMergeNode><feMergeNode in="SourceGraphic" data-v-878b95c1></feMergeNode></feMerge></filter><filter id="glass-shadow" x="-20%" y="-20%" width="140%" height="140%" data-v-878b95c1><feDropShadow dx="4" dy="4" stdDeviation="8" flood-opacity="0.1" data-v-878b95c1></feDropShadow><feGaussianBlur in="SourceAlpha" stdDeviation="1" result="blur" data-v-878b95c1></feGaussianBlur><feOffset in="blur" dx="0" dy="-2" result="offsetBlur" data-v-878b95c1></feOffset><feFlood flood-color="white" flood-opacity="0.2" result="color" data-v-878b95c1></feFlood><feComposite in="color" in2="offsetBlur" operator="in" result="shadow" data-v-878b95c1></feComposite><feMerge data-v-878b95c1><feMergeNode in="shadow" data-v-878b95c1></feMergeNode><feMergeNode in="SourceGraphic" data-v-878b95c1></feMergeNode></feMerge></filter><filter id="neon-glow" x="-50%" y="-50%" width="200%" height="200%" data-v-878b95c1><feGaussianBlur stdDeviation="4" result="blur" data-v-878b95c1></feGaussianBlur><feFlood flood-color="currentColor" flood-opacity="0.6" result="color" data-v-878b95c1></feFlood><feComposite in="color" in2="blur" operator="in" result="glow" data-v-878b95c1></feComposite><feMerge data-v-878b95c1><feMergeNode in="glow" data-v-878b95c1></feMergeNode><feMergeNode in="glow" data-v-878b95c1></feMergeNode><feMergeNode in="SourceGraphic" data-v-878b95c1></feMergeNode></feMerge></filter><filter id="neon-glow-strong" x="-50%" y="-50%" width="200%" height="200%" data-v-878b95c1><feGaussianBlur stdDeviation="6" result="blur" data-v-878b95c1></feGaussianBlur><feFlood flood-color="currentColor" flood-opacity="0.8" result="color" data-v-878b95c1></feFlood><feComposite in="color" in2="blur" operator="in" result="glow" data-v-878b95c1></feComposite><feMerge data-v-878b95c1><feMergeNode in="glow" data-v-878b95c1></feMergeNode><feMergeNode in="glow" data-v-878b95c1></feMergeNode><feMergeNode in="glow" data-v-878b95c1></feMergeNode><feMergeNode in="SourceGraphic" data-v-878b95c1></feMergeNode></feMerge></filter><filter id="sketch" x="-10%" y="-10%" width="120%" height="120%" data-v-878b95c1><feTurbulence type="turbulence" baseFrequency="0.03" numOctaves="3" seed="1" result="turbulence" data-v-878b95c1></feTurbulence><feDisplacementMap in="SourceGraphic" in2="turbulence" scale="4" xChannelSelector="R" yChannelSelector="G" data-v-878b95c1></feDisplacementMap></filter>`,6)]),(0,e.createElementVNode)(`g`,{transform:`translate(${f.value}, ${p.value}) scale(${d.value})`},[m.value?((0,e.openBlock)(),(0,e.createElementBlock)(`rect`,qr)):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`rect`,{x:`-5000`,y:`-5000`,width:`10000`,height:`10000`,fill:`transparent`,class:`canvas-bg`,onClick:r[0]||=e=>o(`select-canvas`)}),((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.swimlanes,i=>((0,e.openBlock)(),(0,e.createElementBlock)(`g`,{key:i.id},[(0,e.createVNode)(Hr,{swimlane:i,selected:t.selectedSwimlaneId===i.id,"selected-lane-id":t.selectedLaneId,onSelect:e=>n.$emit(`select-swimlane`,i.id),onSelectLane:e=>n.$emit(`select-lane`,i.id,e),onUpdateSwimlane:r[1]||=(...e)=>n.$emit(`update-swimlane`,...e),onUpdateLane:r[2]||=(...e)=>n.$emit(`update-lane`,...e),onResizeSwimlane:r[3]||=(...e)=>n.$emit(`resize-swimlane`,...e),onResizeLane:r[4]||=(...e)=>n.$emit(`resize-lane`,...e),onMoveSwimlane:r[5]||=(...e)=>n.$emit(`move-swimlane`,...e)},null,8,[`swimlane`,`selected`,`selected-lane-id`,`onSelect`,`onSelectLane`])]))),128)),((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.edges,i=>((0,e.openBlock)(),(0,e.createElementBlock)(`g`,{key:i.id},[(0,e.createVNode)(ir,{edge:i,source:D(i.sourceId),target:D(i.targetId),selected:t.selectedEdgeId===i.id,"animation-playing":t.animationPlaying,onSelect:e=>n.$emit(`select-edge`,i.id),onUpdateWaypoint:V,onResetState:r[6]||=e=>n.$emit(`reset-state`),onHoverRemark:E},null,8,[`edge`,`source`,`target`,`selected`,`animation-playing`,`onSelect`])]))),128)),((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(x.value,i=>((0,e.openBlock)(),(0,e.createElementBlock)(`g`,{key:i.id},[(0,e.createVNode)(bn,{node:i,selected:t.selectedNodeId===i.id,"connect-mode":t.connectMode,"auto-connect-source":t.autoConnectSource,"auto-connect-mode":t.autoConnectMode,"animation-playing":t.animationPlaying,theme:t.theme,onSelect:e=>n.$emit(`select-node`,i.id),onStartConnect:e=>n.$emit(`start-connect`,i.id),onEndConnect:e=>n.$emit(`end-connect`,i.id),onAutoConnectStart:e=>n.$emit(`auto-connect-start`,i.id),onDrag:z,onResize:B,onDragEnd:r[7]||=e=>n.$emit(`node-drag-end`,e),onResizeEnd:r[8]||=e=>n.$emit(`node-resize-end`,e),onResetState:r[9]||=e=>n.$emit(`reset-state`),onHoverRemark:E},null,8,[`node`,`selected`,`connect-mode`,`auto-connect-source`,`auto-connect-mode`,`animation-playing`,`theme`,`onSelect`,`onStartConnect`,`onEndConnect`,`onAutoConnectStart`])]))),128)),S.value&&y.value?((0,e.openBlock)(),(0,e.createElementBlock)(`g`,Jr,[(0,e.createElementVNode)(`line`,{x1:S.value.x+S.value.width/2,y1:S.value.y+S.value.height/2,x2:y.value.x,y2:y.value.y,stroke:`#409eff`,"stroke-width":`2`,"stroke-dasharray":`5,5`},null,8,Yr)])):(0,e.createCommentVNode)(``,!0)],8,Kr)],8,Ur)),C.value&&C.value.remark?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:0,class:`remark-tooltip`,style:(0,e.normalizeStyle)({left:w.value+`px`,top:T.value+`px`})},[(0,e.createElementVNode)(`div`,Xr,(0,e.toDisplayString)(C.value.remark),1)],4)):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`div`,Zr,[(0,e.createElementVNode)(`button`,{onClick:F,title:`放大`},`+`),(0,e.createElementVNode)(`span`,Qr,(0,e.toDisplayString)(Math.round(d.value*100))+`%`,1),(0,e.createElementVNode)(`button`,{onClick:I,title:`缩小`},`-`),(0,e.createElementVNode)(`button`,{onClick:L,title:`重置视图`},`⌂`),(0,e.createElementVNode)(`button`,{onClick:R,title:`适应画布`},`⊞`),(0,e.createElementVNode)(`button`,{onClick:r[10]||=e=>m.value=!m.value,class:(0,e.normalizeClass)({active:m.value}),title:`网格`},`▦`,2)])],544))}},[[`__scopeId`,`data-v-878b95c1`]]),ei={class:`param-dialog`},ti={class:`json-import`},ni={class:`param-list`},ri={class:`col-index`},ii={class:`col-action`},ai={key:0,class:`param-empty`},oi=P({__name:`NodeParamDialog`,props:{modelValue:{type:Boolean,default:!1},title:{type:String,default:`参数设置`},parameters:{type:Array,default:()=>[]}},emits:[`update:modelValue`,`confirm`],setup(t,{emit:n}){let i=t,a=n,o=(0,e.ref)(!1),c=(0,e.ref)([]),l=(0,e.ref)(``);(0,e.watch)(()=>i.modelValue,e=>{o.value=e,e&&(c.value=JSON.parse(JSON.stringify(i.parameters||[])),l.value=``)}),(0,e.watch)(o,e=>{a(`update:modelValue`,e)});let u=()=>{c.value.push({name:``,value:``,description:``,dataType:`string`})},d=e=>{c.value.splice(e,1)},f=()=>{if(!l.value.trim()){r.ElMessage.warning(`请输入JSON内容`);return}try{let e=JSON.parse(l.value),t=Array.isArray(e)?e:[e];for(let e of t)c.value.push({name:e.name||``,value:e.value===void 0?``:String(e.value),description:e.description||``,dataType:e.dataType||`string`});l.value=``,r.ElMessage.success(`已导入 ${t.length} 个参数`)}catch(e){r.ElMessage.error(`JSON格式错误: `+e.message)}},p=()=>{o.value=!1},m=()=>{a(`confirm`,JSON.parse(JSON.stringify(c.value))),o.value=!1};return(n,r)=>{let i=(0,e.resolveComponent)(`el-input`),a=(0,e.resolveComponent)(`el-button`),h=(0,e.resolveComponent)(`el-divider`),g=(0,e.resolveComponent)(`el-option`),_=(0,e.resolveComponent)(`el-select`),v=(0,e.resolveComponent)(`el-icon`),y=(0,e.resolveComponent)(`el-dialog`);return(0,e.openBlock)(),(0,e.createBlock)(y,{modelValue:o.value,"onUpdate:modelValue":r[1]||=e=>o.value=e,title:t.title,width:`700px`,onClose:p},{footer:(0,e.withCtx)(()=>[(0,e.createVNode)(a,{onClick:p},{default:(0,e.withCtx)(()=>[...r[5]||=[(0,e.createTextVNode)(`取消`,-1)]]),_:1}),(0,e.createVNode)(a,{type:`primary`,onClick:m},{default:(0,e.withCtx)(()=>[...r[6]||=[(0,e.createTextVNode)(`确定`,-1)]]),_:1})]),default:(0,e.withCtx)(()=>[(0,e.createElementVNode)(`div`,ei,[(0,e.createElementVNode)(`div`,ti,[(0,e.createVNode)(i,{modelValue:l.value,"onUpdate:modelValue":r[0]||=e=>l.value=e,type:`textarea`,rows:4,placeholder:`粘贴JSON批量导入,格式:[{"name":"param1","value":"123","description":"说明","dataType":"string"}]`},null,8,[`modelValue`]),(0,e.createVNode)(a,{size:`small`,type:`primary`,onClick:f,style:{"margin-top":`8px`}},{default:(0,e.withCtx)(()=>[...r[2]||=[(0,e.createTextVNode)(` 导入JSON `,-1)]]),_:1})]),(0,e.createVNode)(h),(0,e.createElementVNode)(`div`,ni,[r[3]||=(0,e.createElementVNode)(`div`,{class:`param-list-header`},[(0,e.createElementVNode)(`span`,{class:`col-index`},`#`),(0,e.createElementVNode)(`span`,{class:`col-name`},`参数名`),(0,e.createElementVNode)(`span`,{class:`col-value`},`参数值`),(0,e.createElementVNode)(`span`,{class:`col-desc`},`说明`),(0,e.createElementVNode)(`span`,{class:`col-type`},`数据类型`),(0,e.createElementVNode)(`span`,{class:`col-action`},`操作`)],-1),((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(c.value,(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:n,class:`param-list-row`},[(0,e.createElementVNode)(`span`,ri,(0,e.toDisplayString)(n+1),1),(0,e.createVNode)(i,{modelValue:t.name,"onUpdate:modelValue":e=>t.name=e,size:`small`,class:`col-name`,placeholder:`参数名`},null,8,[`modelValue`,`onUpdate:modelValue`]),(0,e.createVNode)(i,{modelValue:t.value,"onUpdate:modelValue":e=>t.value=e,size:`small`,class:`col-value`,placeholder:`参数值`},null,8,[`modelValue`,`onUpdate:modelValue`]),(0,e.createVNode)(i,{modelValue:t.description,"onUpdate:modelValue":e=>t.description=e,size:`small`,class:`col-desc`,placeholder:`说明`},null,8,[`modelValue`,`onUpdate:modelValue`]),(0,e.createVNode)(_,{modelValue:t.dataType,"onUpdate:modelValue":e=>t.dataType=e,size:`small`,class:`col-type`},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(g,{value:`string`,label:`字符型`}),(0,e.createVNode)(g,{value:`number`,label:`数值型`}),(0,e.createVNode)(g,{value:`date`,label:`日期型`}),(0,e.createVNode)(g,{value:`object`,label:`对象型`})]),_:1},8,[`modelValue`,`onUpdate:modelValue`]),(0,e.createElementVNode)(`span`,ii,[(0,e.createVNode)(a,{size:`small`,type:`danger`,circle:``,onClick:e=>d(n)},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(v,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(s.Delete))]),_:1})]),_:1},8,[`onClick`])])]))),128)),c.value.length===0?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,ai,` 暂无参数,点击下方按钮添加 `)):(0,e.createCommentVNode)(``,!0)]),(0,e.createVNode)(a,{size:`small`,onClick:u,style:{"margin-top":`8px`}},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(v,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(s.Plus))]),_:1}),r[4]||=(0,e.createTextVNode)(` 添加参数 `,-1)]),_:1})])]),_:1},8,[`modelValue`,`title`])}}},[[`__scopeId`,`data-v-8ae88a5a`]]),si={class:`properties-panel`},ci={class:`panel-section theme-section`},li={class:`theme-grid`},ui=[`onClick`],di={class:`theme-name`},fi={key:0,class:`panel-section`},pi={class:`prop-row`},mi={key:0,class:`prop-row prop-row-col`},hi={style:{display:`flex`,gap:`4px`,width:`100%`,"align-items":`center`}},gi={key:0,class:`image-preview`},_i=[`src`],vi={class:`prop-row`},yi={class:`prop-row`},bi={class:`prop-row`},xi={class:`prop-row`},Si={class:`prop-row`},Ci={class:`prop-row`},wi={class:`prop-row`},Ti={class:`prop-row`},Ei={class:`prop-row`},Di={key:1,class:`prop-row prop-row-col`},Oi={class:`prop-row-main`},ki={class:`prop-row`},Ai={key:2,class:`prop-row`},ji={key:3,class:`prop-row`},Mi={class:`prop-row`},Ni={class:`prop-row prop-row-col`},Pi={class:`prop-row`},Fi={class:`prop-row`},Ii={class:`prop-row`},Li={class:`prop-actions`},Ri={key:1,class:`panel-section`},zi={class:`prop-row`},Bi={class:`prop-row`},Vi={class:`prop-row`},Hi={class:`prop-row`},Ui={class:`prop-row`},Wi={class:`prop-row`},Gi={class:`prop-row`},Ki={key:0,class:`prop-row`},qi={key:1,class:`prop-row`},Ji={class:`prop-row prop-row-col`},Yi={class:`prop-actions`},Xi={key:2,class:`panel-section`},Zi={class:`prop-row`},Qi={class:`prop-row`},$i={class:`prop-row`},ea={class:`prop-row`},ta={class:`prop-row`},na={class:`prop-row`},ra={class:`prop-row`},ia={class:`prop-row`},aa={class:`prop-row`},oa={class:`prop-row`},sa={class:`prop-row`},ca={key:3,class:`panel-section`},la={class:`prop-row`},ua={class:`prop-row`},da={class:`prop-row`},fa={class:`prop-row`},pa={class:`prop-row`},ma={class:`prop-row`},ha={class:`prop-row`},ga={class:`prop-row`},_a={class:`prop-row`},va={class:`prop-row`},ya={class:`prop-row`},ba={class:`prop-row`},xa={class:`prop-row`},Sa={class:`prop-actions`},Ca={key:4,class:`panel-section empty`},wa=P({__name:`PropertiesPanel`,props:{selectedNode:{type:Object,default:null},selectedEdge:{type:Object,default:null},selectedSwimlane:{type:Object,default:null},selectedLane:{type:Object,default:null},NODE_TYPES:{type:Object,default:()=>({})},ANIMATION_TYPES:{type:Object,default:()=>({})},LINE_STYLES:{type:Object,default:()=>({})},currentTheme:{type:String,default:`classic`}},emits:[`update`,`update-lane`,`delete-node`,`delete-edge`,`delete-swimlane`,`bring-front`,`send-back`,`add-lane`,`change-theme`],setup(t,{emit:n}){let r=t,i=n,a=(0,e.ref)(!1),o=(0,e.ref)(!1),c=(0,e.ref)(!1),l=()=>{r.selectedNode&&(a.value=!0)},u=()=>{r.selectedNode&&(o.value=!0)},d=e=>{r.selectedNode&&(r.selectedNode.inputParams=e,b())},f=e=>{r.selectedNode&&(r.selectedNode.outputParams=e,b())},p={none:{name:`无动画`},flow:{name:`粒子流动`},dashFlow:{name:`虚线流动`},particleGlow:{name:`粒子发光`},pulse:{name:`脉冲流动`},neon:{name:`霓虹流动`}},m=e=>r.NODE_TYPES[e]?.label||e,h=(0,e.computed)({get:()=>Math.round((r.selectedSwimlane?.headerOpacity??1)*100),set:e=>{r.selectedSwimlane&&(r.selectedSwimlane.headerOpacity=e/100)}}),g=e=>{r.selectedSwimlane&&(r.selectedSwimlane.headerOpacity=e/100,b())},_=(0,e.computed)({get:()=>Math.round((r.selectedLane?.opacity??1)*100),set:e=>{r.selectedLane&&(r.selectedLane.opacity=e/100)}}),v=e=>{r.selectedLane&&(r.selectedLane.opacity=e/100,b())},b=()=>{i(`update`)},x=()=>{i(`update-lane`)},S=e=>{let t=new FileReader;return t.onload=e=>{r.selectedNode&&(r.selectedNode.image=e.target.result,b())},t.readAsDataURL(e),!1},C=()=>{r.selectedNode&&(r.selectedNode.image=``,b())};return(n,r)=>{let i=(0,e.resolveComponent)(`el-tag`),w=(0,e.resolveComponent)(`el-input`),T=(0,e.resolveComponent)(`el-icon`),E=(0,e.resolveComponent)(`el-button`),D=(0,e.resolveComponent)(`el-upload`),O=(0,e.resolveComponent)(`el-input-number`),k=(0,e.resolveComponent)(`el-color-picker`),A=(0,e.resolveComponent)(`el-option`),j=(0,e.resolveComponent)(`el-select`),M=(0,e.resolveComponent)(`el-checkbox`),N=(0,e.resolveComponent)(`el-slider`),P=(0,e.resolveComponent)(`el-dialog`);return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,si,[(0,e.createElementVNode)(`div`,ci,[r[61]||=(0,e.createElementVNode)(`h4`,null,`画布主题`,-1),(0,e.createElementVNode)(`div`,li,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)((0,e.unref)(y),(i,a)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:a,class:(0,e.normalizeClass)([`theme-item`,{active:t.currentTheme===a}]),onClick:e=>n.$emit(`change-theme`,a)},[(0,e.createElementVNode)(`div`,{class:(0,e.normalizeClass)([`theme-preview`,`theme-preview-${a}`])},[...r[60]||=[(0,e.createElementVNode)(`div`,{class:`preview-rect`},null,-1),(0,e.createElementVNode)(`div`,{class:`preview-circle`},null,-1)]],2),(0,e.createElementVNode)(`span`,di,(0,e.toDisplayString)(i.name),1)],10,ui))),128))])]),t.selectedNode?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,fi,[r[86]||=(0,e.createElementVNode)(`h4`,null,`节点属性`,-1),(0,e.createElementVNode)(`div`,pi,[r[62]||=(0,e.createElementVNode)(`label`,null,`类型`,-1),(0,e.createVNode)(i,{size:`small`,type:`info`},{default:(0,e.withCtx)(()=>[(0,e.createTextVNode)((0,e.toDisplayString)(m(t.selectedNode.type)),1)]),_:1})]),t.selectedNode.type===`custom`?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,mi,[r[63]||=(0,e.createElementVNode)(`label`,null,`组件图片`,-1),(0,e.createElementVNode)(`div`,hi,[(0,e.createVNode)(w,{modelValue:t.selectedNode.image,"onUpdate:modelValue":r[0]||=e=>t.selectedNode.image=e,size:`small`,placeholder:`图片URL或Base64`,onChange:b},null,8,[`modelValue`]),(0,e.createVNode)(D,{"show-file-list":!1,accept:`image/*`,"before-upload":S},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(E,{size:`small`,circle:``},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(T,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(s.Picture))]),_:1})]),_:1})]),_:1}),t.selectedNode.image?((0,e.openBlock)(),(0,e.createBlock)(E,{key:0,size:`small`,circle:``,type:`danger`,onClick:C},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(T,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(s.Delete))]),_:1})]),_:1})):(0,e.createCommentVNode)(``,!0)]),t.selectedNode.image?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,gi,[(0,e.createElementVNode)(`img`,{src:t.selectedNode.image,style:{"max-width":`100%`,"max-height":`80px`,border:`1px solid #e4e7ed`,"border-radius":`4px`}},null,8,_i)])):(0,e.createCommentVNode)(``,!0)])):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`div`,vi,[r[64]||=(0,e.createElementVNode)(`label`,null,`名称`,-1),(0,e.createVNode)(w,{size:`small`,modelValue:t.selectedNode.label,"onUpdate:modelValue":r[1]||=e=>t.selectedNode.label=e,onChange:b},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,yi,[r[65]||=(0,e.createElementVNode)(`label`,null,`宽度`,-1),(0,e.createVNode)(O,{size:`small`,modelValue:t.selectedNode.width,"onUpdate:modelValue":r[2]||=e=>t.selectedNode.width=e,min:40,max:500,onChange:b},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,bi,[r[66]||=(0,e.createElementVNode)(`label`,null,`高度`,-1),(0,e.createVNode)(O,{size:`small`,modelValue:t.selectedNode.height,"onUpdate:modelValue":r[3]||=e=>t.selectedNode.height=e,min:30,max:400,onChange:b},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,xi,[r[67]||=(0,e.createElementVNode)(`label`,null,`填充色`,-1),(0,e.createVNode)(k,{size:`small`,modelValue:t.selectedNode.color,"onUpdate:modelValue":r[4]||=e=>t.selectedNode.color=e,onChange:b},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,Si,[r[68]||=(0,e.createElementVNode)(`label`,null,`边框色`,-1),(0,e.createVNode)(k,{size:`small`,modelValue:t.selectedNode.strokeColor,"onUpdate:modelValue":r[5]||=e=>t.selectedNode.strokeColor=e,onChange:b},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,Ci,[r[69]||=(0,e.createElementVNode)(`label`,null,`边框宽度`,-1),(0,e.createVNode)(O,{size:`small`,modelValue:t.selectedNode.strokeWidth,"onUpdate:modelValue":r[6]||=e=>t.selectedNode.strokeWidth=e,min:0,max:10,onChange:b},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,wi,[r[70]||=(0,e.createElementVNode)(`label`,null,`文字色`,-1),(0,e.createVNode)(k,{size:`small`,modelValue:t.selectedNode.textColor,"onUpdate:modelValue":r[7]||=e=>t.selectedNode.textColor=e,onChange:b},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,Ti,[r[71]||=(0,e.createElementVNode)(`label`,null,`字号`,-1),(0,e.createVNode)(O,{size:`small`,modelValue:t.selectedNode.fontSize,"onUpdate:modelValue":r[8]||=e=>t.selectedNode.fontSize=e,min:8,max:36,onChange:b},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,Ei,[r[72]||=(0,e.createElementVNode)(`label`,null,`文字位置`,-1),(0,e.createVNode)(j,{size:`small`,modelValue:t.selectedNode.labelPosition,"onUpdate:modelValue":r[9]||=e=>t.selectedNode.labelPosition=e,onChange:b},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(A,{value:`center`,label:`组件内居中`}),(0,e.createVNode)(A,{value:`top`,label:`组件外上方`}),(0,e.createVNode)(A,{value:`bottom`,label:`组件外下方`}),(0,e.createVNode)(A,{value:`left`,label:`组件外左边`}),(0,e.createVNode)(A,{value:`right`,label:`组件外右边`}),(0,e.createVNode)(A,{value:`hover`,label:`鼠标悬浮显示`})]),_:1},8,[`modelValue`])]),t.selectedNode.labelPosition===`left`||t.selectedNode.labelPosition===`right`?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,Di,[(0,e.createElementVNode)(`div`,Oi,[r[73]||=(0,e.createElementVNode)(`label`,null,`文字方向`,-1),(0,e.createVNode)(O,{size:`small`,modelValue:t.selectedNode.textRotation,"onUpdate:modelValue":r[10]||=e=>t.selectedNode.textRotation=e,min:-180,max:180,step:15,onChange:b},null,8,[`modelValue`])]),r[74]||=(0,e.createElementVNode)(`span`,{class:`prop-hint`},`-90°=向上 \xA0 0°=向右 \xA0 90°=向下`,-1)])):(0,e.createCommentVNode)(``,!0),(0,e.createElementVNode)(`div`,ki,[r[75]||=(0,e.createElementVNode)(`label`,null,`动画`,-1),(0,e.createVNode)(j,{size:`small`,modelValue:t.selectedNode.animation,"onUpdate:modelValue":r[11]||=e=>t.selectedNode.animation=e,onChange:b},{default:(0,e.withCtx)(()=>[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.ANIMATION_TYPES,(t,n)=>((0,e.openBlock)(),(0,e.createBlock)(A,{key:n,value:n,label:t.name||t.label},null,8,[`value`,`label`]))),128))]),_:1},8,[`modelValue`])]),t.selectedNode.animation===`none`?(0,e.createCommentVNode)(``,!0):((0,e.openBlock)(),(0,e.createElementBlock)(`div`,Ai,[r[76]||=(0,e.createElementVNode)(`label`,null,`动画时长(秒)`,-1),(0,e.createVNode)(O,{size:`small`,modelValue:t.selectedNode.animationDuration,"onUpdate:modelValue":r[12]||=e=>t.selectedNode.animationDuration=e,min:.5,max:10,step:.5,onChange:b},null,8,[`modelValue`])])),t.selectedNode.animation===`none`?(0,e.createCommentVNode)(``,!0):((0,e.openBlock)(),(0,e.createElementBlock)(`div`,ji,[r[77]||=(0,e.createElementVNode)(`label`,null,`延迟(秒)`,-1),(0,e.createVNode)(O,{size:`small`,modelValue:t.selectedNode.animationDelay,"onUpdate:modelValue":r[13]||=e=>t.selectedNode.animationDelay=e,min:0,max:5,step:.5,onChange:b},null,8,[`modelValue`])])),(0,e.createElementVNode)(`div`,Mi,[(0,e.createVNode)(M,{modelValue:t.selectedNode.locked,"onUpdate:modelValue":r[14]||=e=>t.selectedNode.locked=e,onChange:b},{default:(0,e.withCtx)(()=>[...r[78]||=[(0,e.createTextVNode)(`锁定`,-1)]]),_:1},8,[`modelValue`])]),(0,e.createElementVNode)(`div`,Ni,[r[79]||=(0,e.createElementVNode)(`label`,null,`备注说明`,-1),(0,e.createVNode)(w,{modelValue:t.selectedNode.remark,"onUpdate:modelValue":r[15]||=e=>t.selectedNode.remark=e,type:`textarea`,rows:5,placeholder:`输入备注说明...`,onChange:b},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,Pi,[r[80]||=(0,e.createElementVNode)(`label`,null,`输入参数`,-1),(0,e.createVNode)(i,{size:`small`,type:`info`},{default:(0,e.withCtx)(()=>[(0,e.createTextVNode)((0,e.toDisplayString)((t.selectedNode.inputParams||[]).length)+` 个`,1)]),_:1}),(0,e.createVNode)(E,{size:`small`,circle:``,onClick:l},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(T,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(s.Setting))]),_:1})]),_:1})]),(0,e.createElementVNode)(`div`,Fi,[r[81]||=(0,e.createElementVNode)(`label`,null,`输出参数`,-1),(0,e.createVNode)(i,{size:`small`,type:`info`},{default:(0,e.withCtx)(()=>[(0,e.createTextVNode)((0,e.toDisplayString)((t.selectedNode.outputParams||[]).length)+` 个`,1)]),_:1}),(0,e.createVNode)(E,{size:`small`,circle:``,onClick:u},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(T,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(s.Setting))]),_:1})]),_:1})]),(0,e.createElementVNode)(`div`,Ii,[r[82]||=(0,e.createElementVNode)(`label`,null,`动作设置`,-1),(0,e.createVNode)(E,{size:`small`,circle:``,onClick:r[16]||=e=>c.value=!0},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(T,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(s.Setting))]),_:1})]),_:1})]),(0,e.createElementVNode)(`div`,Li,[(0,e.createVNode)(E,{size:`small`,onClick:r[17]||=e=>n.$emit(`bring-front`)},{default:(0,e.withCtx)(()=>[...r[83]||=[(0,e.createTextVNode)(`置顶`,-1)]]),_:1}),(0,e.createVNode)(E,{size:`small`,onClick:r[18]||=e=>n.$emit(`send-back`)},{default:(0,e.withCtx)(()=>[...r[84]||=[(0,e.createTextVNode)(`置底`,-1)]]),_:1}),(0,e.createVNode)(E,{size:`small`,type:`danger`,onClick:r[19]||=e=>n.$emit(`delete-node`)},{default:(0,e.withCtx)(()=>[...r[85]||=[(0,e.createTextVNode)(`删除`,-1)]]),_:1})])])):t.selectedEdge?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,Ri,[r[98]||=(0,e.createElementVNode)(`h4`,null,`连线属性`,-1),(0,e.createElementVNode)(`div`,zi,[r[87]||=(0,e.createElementVNode)(`label`,null,`标签`,-1),(0,e.createVNode)(w,{size:`small`,modelValue:t.selectedEdge.label,"onUpdate:modelValue":r[20]||=e=>t.selectedEdge.label=e,onChange:b},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,Bi,[r[88]||=(0,e.createElementVNode)(`label`,null,`线型`,-1),(0,e.createVNode)(j,{size:`small`,modelValue:t.selectedEdge.lineStyle,"onUpdate:modelValue":r[21]||=e=>t.selectedEdge.lineStyle=e,onChange:b},{default:(0,e.withCtx)(()=>[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(t.LINE_STYLES,(t,n)=>((0,e.openBlock)(),(0,e.createBlock)(A,{key:n,value:n,label:t.label},null,8,[`value`,`label`]))),128))]),_:1},8,[`modelValue`])]),(0,e.createElementVNode)(`div`,Vi,[r[89]||=(0,e.createElementVNode)(`label`,null,`线色`,-1),(0,e.createVNode)(k,{size:`small`,modelValue:t.selectedEdge.lineColor,"onUpdate:modelValue":r[22]||=e=>t.selectedEdge.lineColor=e,onChange:b},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,Hi,[r[90]||=(0,e.createElementVNode)(`label`,null,`线宽`,-1),(0,e.createVNode)(O,{size:`small`,modelValue:t.selectedEdge.lineWidth,"onUpdate:modelValue":r[23]||=e=>t.selectedEdge.lineWidth=e,min:1,max:8,onChange:b},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,Ui,[r[91]||=(0,e.createElementVNode)(`label`,null,`箭头`,-1),(0,e.createVNode)(j,{size:`small`,modelValue:t.selectedEdge.arrowType,"onUpdate:modelValue":r[24]||=e=>t.selectedEdge.arrowType=e,onChange:b},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(A,{value:`end`,label:`末端箭头`}),(0,e.createVNode)(A,{value:`none`,label:`无箭头`})]),_:1},8,[`modelValue`])]),(0,e.createElementVNode)(`div`,Wi,[r[92]||=(0,e.createElementVNode)(`label`,null,`曲线`,-1),(0,e.createVNode)(j,{size:`small`,modelValue:t.selectedEdge.curveType,"onUpdate:modelValue":r[25]||=e=>t.selectedEdge.curveType=e,onChange:b},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(A,{value:`bezier`,label:`贝塞尔曲线`}),(0,e.createVNode)(A,{value:`straight`,label:`直线`})]),_:1},8,[`modelValue`])]),(0,e.createElementVNode)(`div`,Gi,[r[93]||=(0,e.createElementVNode)(`label`,null,`动画`,-1),(0,e.createVNode)(j,{size:`small`,modelValue:t.selectedEdge.animation,"onUpdate:modelValue":r[26]||=e=>t.selectedEdge.animation=e,onChange:b},{default:(0,e.withCtx)(()=>[((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(p,(t,n)=>(0,e.createVNode)(A,{key:n,value:n,label:t.name},null,8,[`value`,`label`])),64))]),_:1},8,[`modelValue`])]),t.selectedEdge.animation===`none`?(0,e.createCommentVNode)(``,!0):((0,e.openBlock)(),(0,e.createElementBlock)(`div`,Ki,[r[94]||=(0,e.createElementVNode)(`label`,null,`动画时长(秒)`,-1),(0,e.createVNode)(O,{size:`small`,modelValue:t.selectedEdge.animationDuration,"onUpdate:modelValue":r[27]||=e=>t.selectedEdge.animationDuration=e,min:.5,max:10,step:.5,onChange:b},null,8,[`modelValue`])])),t.selectedEdge.animation===`none`?(0,e.createCommentVNode)(``,!0):((0,e.openBlock)(),(0,e.createElementBlock)(`div`,qi,[r[95]||=(0,e.createElementVNode)(`label`,null,`粒子颜色`,-1),(0,e.createVNode)(k,{size:`small`,modelValue:t.selectedEdge.particleColor,"onUpdate:modelValue":r[28]||=e=>t.selectedEdge.particleColor=e,onChange:b},null,8,[`modelValue`])])),(0,e.createElementVNode)(`div`,Ji,[r[96]||=(0,e.createElementVNode)(`label`,null,`备注说明`,-1),(0,e.createVNode)(w,{modelValue:t.selectedEdge.remark,"onUpdate:modelValue":r[29]||=e=>t.selectedEdge.remark=e,type:`textarea`,rows:5,placeholder:`输入备注说明...`,onChange:b},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,Yi,[(0,e.createVNode)(E,{size:`small`,type:`danger`,onClick:r[30]||=e=>n.$emit(`delete-edge`)},{default:(0,e.withCtx)(()=>[...r[97]||=[(0,e.createTextVNode)(`删除连线`,-1)]]),_:1})])])):t.selectedLane?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,Xi,[r[110]||=(0,e.createElementVNode)(`h4`,null,`泳道名称属性`,-1),(0,e.createElementVNode)(`div`,Zi,[r[99]||=(0,e.createElementVNode)(`label`,null,`名称`,-1),(0,e.createVNode)(w,{size:`small`,modelValue:t.selectedLane.name,"onUpdate:modelValue":r[31]||=e=>t.selectedLane.name=e,onChange:x},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,Qi,[r[100]||=(0,e.createElementVNode)(`label`,null,`高度`,-1),(0,e.createVNode)(O,{size:`small`,modelValue:t.selectedLane.height,"onUpdate:modelValue":r[32]||=e=>t.selectedLane.height=e,min:40,max:500,onChange:x},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,$i,[r[101]||=(0,e.createElementVNode)(`label`,null,`背景色`,-1),(0,e.createVNode)(k,{size:`small`,modelValue:t.selectedLane.color,"onUpdate:modelValue":r[33]||=e=>t.selectedLane.color=e,onChange:x},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,ea,[r[102]||=(0,e.createElementVNode)(`label`,null,`名称行背景`,-1),(0,e.createVNode)(k,{size:`small`,modelValue:t.selectedLane.headerColor,"onUpdate:modelValue":r[34]||=e=>t.selectedLane.headerColor=e,"show-alpha":``,onChange:x},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,ta,[r[103]||=(0,e.createElementVNode)(`label`,null,`背景透明度`,-1),(0,e.createVNode)(N,{size:`small`,modelValue:_.value,"onUpdate:modelValue":r[35]||=e=>_.value=e,min:0,max:100,step:5,style:{flex:`1`,"max-width":`140px`},onChange:v},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,na,[r[104]||=(0,e.createElementVNode)(`label`,null,`文字色`,-1),(0,e.createVNode)(k,{size:`small`,modelValue:t.selectedLane.textColor,"onUpdate:modelValue":r[36]||=e=>t.selectedLane.textColor=e,onChange:x},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,ra,[r[105]||=(0,e.createElementVNode)(`label`,null,`字号`,-1),(0,e.createVNode)(O,{size:`small`,modelValue:t.selectedLane.fontSize,"onUpdate:modelValue":r[37]||=e=>t.selectedLane.fontSize=e,min:8,max:36,onChange:x},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,ia,[r[106]||=(0,e.createElementVNode)(`label`,null,`字体`,-1),(0,e.createVNode)(j,{size:`small`,modelValue:t.selectedLane.fontFamily,"onUpdate:modelValue":r[38]||=e=>t.selectedLane.fontFamily=e,onChange:x},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(A,{value:`sans-serif`,label:`默认 (sans-serif)`}),(0,e.createVNode)(A,{value:`serif`,label:`Serif`}),(0,e.createVNode)(A,{value:`monospace`,label:`Monospace`}),(0,e.createVNode)(A,{value:`Arial`,label:`Arial`}),(0,e.createVNode)(A,{value:`Microsoft YaHei`,label:`微软雅黑`}),(0,e.createVNode)(A,{value:`SimSun`,label:`宋体`}),(0,e.createVNode)(A,{value:`SimHei`,label:`黑体`}),(0,e.createVNode)(A,{value:`KaiTi`,label:`楷体`})]),_:1},8,[`modelValue`])]),(0,e.createElementVNode)(`div`,aa,[r[107]||=(0,e.createElementVNode)(`label`,null,`字重`,-1),(0,e.createVNode)(j,{size:`small`,modelValue:t.selectedLane.fontWeight,"onUpdate:modelValue":r[39]||=e=>t.selectedLane.fontWeight=e,onChange:x},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(A,{value:`normal`,label:`常规`}),(0,e.createVNode)(A,{value:`500`,label:`中等`}),(0,e.createVNode)(A,{value:`600`,label:`半粗`}),(0,e.createVNode)(A,{value:`bold`,label:`粗体`})]),_:1},8,[`modelValue`])]),(0,e.createElementVNode)(`div`,oa,[r[108]||=(0,e.createElementVNode)(`label`,null,`字体样式`,-1),(0,e.createVNode)(j,{size:`small`,modelValue:t.selectedLane.fontStyle,"onUpdate:modelValue":r[40]||=e=>t.selectedLane.fontStyle=e,onChange:x},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(A,{value:`normal`,label:`正常`}),(0,e.createVNode)(A,{value:`italic`,label:`斜体`}),(0,e.createVNode)(A,{value:`oblique`,label:`倾斜`})]),_:1},8,[`modelValue`])]),(0,e.createElementVNode)(`div`,sa,[r[109]||=(0,e.createElementVNode)(`label`,null,`文本对齐`,-1),(0,e.createVNode)(j,{size:`small`,modelValue:t.selectedLane.textAlign,"onUpdate:modelValue":r[41]||=e=>t.selectedLane.textAlign=e,onChange:x},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(A,{value:`left`,label:`左对齐`}),(0,e.createVNode)(A,{value:`center`,label:`居中`}),(0,e.createVNode)(A,{value:`right`,label:`右对齐`})]),_:1},8,[`modelValue`])])])):t.selectedSwimlane?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,ca,[r[126]||=(0,e.createElementVNode)(`h4`,null,`泳道属性`,-1),(0,e.createElementVNode)(`div`,la,[r[111]||=(0,e.createElementVNode)(`label`,null,`名称`,-1),(0,e.createVNode)(w,{size:`small`,modelValue:t.selectedSwimlane.name,"onUpdate:modelValue":r[42]||=e=>t.selectedSwimlane.name=e,onChange:b},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,ua,[r[112]||=(0,e.createElementVNode)(`label`,null,`方向`,-1),(0,e.createVNode)(i,{size:`small`},{default:(0,e.withCtx)(()=>[(0,e.createTextVNode)((0,e.toDisplayString)(t.selectedSwimlane.direction===`horizontal`?`水平`:`垂直`),1)]),_:1})]),(0,e.createElementVNode)(`div`,da,[r[113]||=(0,e.createElementVNode)(`label`,null,`宽度`,-1),(0,e.createVNode)(O,{size:`small`,modelValue:t.selectedSwimlane.width,"onUpdate:modelValue":r[43]||=e=>t.selectedSwimlane.width=e,min:200,max:2e3,onChange:b},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,fa,[r[114]||=(0,e.createElementVNode)(`label`,null,`高度`,-1),(0,e.createVNode)(O,{size:`small`,modelValue:t.selectedSwimlane.height,"onUpdate:modelValue":r[44]||=e=>t.selectedSwimlane.height=e,min:100,max:1e3,onChange:b},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,pa,[r[115]||=(0,e.createElementVNode)(`label`,null,`背景色`,-1),(0,e.createVNode)(k,{size:`small`,modelValue:t.selectedSwimlane.color,"onUpdate:modelValue":r[45]||=e=>t.selectedSwimlane.color=e,onChange:b},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,ma,[r[116]||=(0,e.createElementVNode)(`label`,null,`标题背景色`,-1),(0,e.createVNode)(k,{size:`small`,modelValue:t.selectedSwimlane.headerColor,"onUpdate:modelValue":r[46]||=e=>t.selectedSwimlane.headerColor=e,onChange:b},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,ha,[r[117]||=(0,e.createElementVNode)(`label`,null,`标题透明度`,-1),(0,e.createVNode)(N,{size:`small`,modelValue:h.value,"onUpdate:modelValue":r[47]||=e=>h.value=e,min:0,max:100,step:5,style:{flex:`1`,"max-width":`140px`},onChange:g},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,ga,[r[118]||=(0,e.createElementVNode)(`label`,null,`标题文字色`,-1),(0,e.createVNode)(k,{size:`small`,modelValue:t.selectedSwimlane.headerTextColor,"onUpdate:modelValue":r[48]||=e=>t.selectedSwimlane.headerTextColor=e,onChange:b},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,_a,[r[119]||=(0,e.createElementVNode)(`label`,null,`字号`,-1),(0,e.createVNode)(O,{size:`small`,modelValue:t.selectedSwimlane.fontSize,"onUpdate:modelValue":r[49]||=e=>t.selectedSwimlane.fontSize=e,min:8,max:36,onChange:b},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,va,[r[120]||=(0,e.createElementVNode)(`label`,null,`字体`,-1),(0,e.createVNode)(j,{size:`small`,modelValue:t.selectedSwimlane.fontFamily,"onUpdate:modelValue":r[50]||=e=>t.selectedSwimlane.fontFamily=e,onChange:b},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(A,{value:`sans-serif`,label:`默认 (sans-serif)`}),(0,e.createVNode)(A,{value:`serif`,label:`Serif`}),(0,e.createVNode)(A,{value:`monospace`,label:`Monospace`}),(0,e.createVNode)(A,{value:`Arial`,label:`Arial`}),(0,e.createVNode)(A,{value:`Microsoft YaHei`,label:`微软雅黑`}),(0,e.createVNode)(A,{value:`SimSun`,label:`宋体`}),(0,e.createVNode)(A,{value:`SimHei`,label:`黑体`}),(0,e.createVNode)(A,{value:`KaiTi`,label:`楷体`})]),_:1},8,[`modelValue`])]),(0,e.createElementVNode)(`div`,ya,[r[121]||=(0,e.createElementVNode)(`label`,null,`字重`,-1),(0,e.createVNode)(j,{size:`small`,modelValue:t.selectedSwimlane.fontWeight,"onUpdate:modelValue":r[51]||=e=>t.selectedSwimlane.fontWeight=e,onChange:b},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(A,{value:`normal`,label:`常规`}),(0,e.createVNode)(A,{value:`500`,label:`中等`}),(0,e.createVNode)(A,{value:`600`,label:`半粗`}),(0,e.createVNode)(A,{value:`bold`,label:`粗体`})]),_:1},8,[`modelValue`])]),(0,e.createElementVNode)(`div`,ba,[r[122]||=(0,e.createElementVNode)(`label`,null,`字体样式`,-1),(0,e.createVNode)(j,{size:`small`,modelValue:t.selectedSwimlane.fontStyle,"onUpdate:modelValue":r[52]||=e=>t.selectedSwimlane.fontStyle=e,onChange:b},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(A,{value:`normal`,label:`正常`}),(0,e.createVNode)(A,{value:`italic`,label:`斜体`}),(0,e.createVNode)(A,{value:`oblique`,label:`倾斜`})]),_:1},8,[`modelValue`])]),(0,e.createElementVNode)(`div`,xa,[r[123]||=(0,e.createElementVNode)(`label`,null,`文本对齐`,-1),(0,e.createVNode)(j,{size:`small`,modelValue:t.selectedSwimlane.textAlign,"onUpdate:modelValue":r[53]||=e=>t.selectedSwimlane.textAlign=e,onChange:b},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(A,{value:`left`,label:`左对齐`}),(0,e.createVNode)(A,{value:`center`,label:`居中`}),(0,e.createVNode)(A,{value:`right`,label:`右对齐`})]),_:1},8,[`modelValue`])]),(0,e.createElementVNode)(`div`,Sa,[(0,e.createVNode)(E,{size:`small`,onClick:r[54]||=e=>n.$emit(`add-lane`)},{default:(0,e.withCtx)(()=>[...r[124]||=[(0,e.createTextVNode)(`添加泳道`,-1)]]),_:1}),(0,e.createVNode)(E,{size:`small`,type:`danger`,onClick:r[55]||=e=>n.$emit(`delete-swimlane`)},{default:(0,e.withCtx)(()=>[...r[125]||=[(0,e.createTextVNode)(`删除`,-1)]]),_:1})])])):((0,e.openBlock)(),(0,e.createElementBlock)(`div`,Ca,[...r[127]||=[(0,e.createElementVNode)(`p`,null,`选择节点或连线查看属性`,-1)]])),(0,e.createVNode)(oi,{modelValue:a.value,"onUpdate:modelValue":r[56]||=e=>a.value=e,title:`输入参数设置`,parameters:t.selectedNode?.inputParams||[],onConfirm:d},null,8,[`modelValue`,`parameters`]),(0,e.createVNode)(oi,{modelValue:o.value,"onUpdate:modelValue":r[57]||=e=>o.value=e,title:`输出参数设置`,parameters:t.selectedNode?.outputParams||[],onConfirm:f},null,8,[`modelValue`,`parameters`]),(0,e.createVNode)(P,{modelValue:c.value,"onUpdate:modelValue":r[59]||=e=>c.value=e,title:`动作设置`,width:`600px`},{footer:(0,e.withCtx)(()=>[(0,e.createVNode)(E,{onClick:r[58]||=e=>c.value=!1},{default:(0,e.withCtx)(()=>[...r[128]||=[(0,e.createTextVNode)(`关闭`,-1)]]),_:1})]),default:(0,e.withCtx)(()=>[r[129]||=(0,e.createElementVNode)(`div`,{style:{"min-height":`200px`,display:`flex`,"align-items":`center`,"justify-content":`center`,color:`#909399`}},` 暂无动作配置 `,-1)]),_:1},8,[`modelValue`])])}}},[[`__scopeId`,`data-v-8d0fe2b9`]]),Ta={class:`process-diagram-editor`},Ea={class:`editor-header`},Da={class:`header-left`},Oa={class:`header-right`},ka={key:0,class:`collab-users`},Aa=[`title`],ja={key:0,class:`collab-more`},Ma={class:`editor-body`},Na={class:`editor-main`},Pa=`diagram`,Fa=P({__name:`DiagramEditor`,setup(t){let i=(0,n.useRouter)(),a=(0,n.useRoute)(),o=a.name===`ProcessDiagram`||a.name===`NewProcessDiagram`,c=o?`process`:`execution`,l=o?`process-diagram-`:`exec-diagram-`,u=(0,e.ref)(!1),d=(0,e.ref)(!1),{saveVersion:f}=fe(),p=le(),m=a.query.type,h=v((0,e.computed)(()=>a.params.id||`new-doc`)),g=null,y=(0,e.ref)(null),b=(0,e.ref)(null),x=(0,e.ref)(!0),S=(0,e.ref)(1),C=(0,e.ref)(!1),w=(0,e.ref)(!1),T=(0,e.ref)([]),E=(0,e.ref)(!1),D=(0,e.ref)(null),O=(0,e.ref)(a.params.id||null),k=(0,e.ref)(localStorage.getItem(`diagram-user-name`)||``),A=null;(0,e.watch)(k,e=>{localStorage.setItem(`diagram-user-name`,e||``)});let j=(0,e.ref)(null),M=(0,e.ref)(!1),P=(0,e.ref)(!1),F=null,I=()=>{if(!Y.value?.trim()){r.ElMessage.warning(`请输入流程图名称`);return}if(!k.value?.trim()){r.ElMessage.warning(`请输入用户名称`);return}try{let t=a.params.id||`diagram-${Date.now()}`;D.value=t,h.connect(t),h.setLocalUser({name:k.value.trim()}),C.value=!0;let n=h.awareness.value;n.on(`change`,()=>{T.value=Array.from(n.getStates().entries()).filter(([e,t])=>t.user).map(([e,t])=>({clientId:e,...t.user}))}),p.setCollabContext({ydoc:h.doc,provider:n?.provider||null,onlineUsers:T}),p.setCurrentUser({id:n.clientID,name:k.value.trim(),color:`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,`0`)}`}),h.onRemoteChange(`diagram`,e=>{e&&(E.value=!0,Z(e),E.value=!1)}),h.syncToYjs(`diagram`,X()),g&&g();let i=null,s=()=>{i&&clearTimeout(i),C.value&&!E.value&&h.isConnected.value&&h.syncToYjs(`diagram`,X())};F=s,g=(0,e.watch)([H,U,W],()=>{P.value||(i&&clearTimeout(i),i=setTimeout(s,300))},{deep:!0}),A&&A(),A=(0,e.watch)(()=>h.isConnected.value,(e,t)=>{e&&!t&&C.value&&h.syncToYjs(`diagram`,X())});let c=o?`process-diagram`:`execution-diagram`,l=`${window.location.origin}/${c}/${t}?collab=1`;navigator.clipboard.writeText(l).then(()=>{r.ElMessage.success(`协作已开启,分享链接已复制`)}).catch(()=>{r.ElMessage.success(`协作已开启`)})}catch(e){console.error(`协作连接失败:`,e),r.ElMessage.error(`协作连接失败: `+(e.message||e))}},L=()=>{g&&=(g(),null),A&&=(A(),null),h.closeCollaboration(),C.value=!1,r.ElMessage.info(`协作已关闭`)},R=async()=>{if(!C.value){I();return}let e=D.value||a.params.id;if(!e){r.ElMessage.warning(`请先开启协作`);return}let t=o?`process-diagram`:`execution-diagram`,n=`${window.location.origin}/${t}/${e}?collab=1`;try{await navigator.clipboard.writeText(n),r.ElMessage.success(`分享链接已复制`)}catch{r.ElMessage.info(`分享链接: ${n}`)}},{NODE_TYPES:z,ANIMATION_TYPES:B,LINE_STYLES:V,nodes:H,edges:U,swimlanes:W,selectedNodeId:G,selectedEdgeId:ee,selectedSwimlaneId:K,selectedNode:q,selectedEdge:te,connectMode:ne,connectSource:J,diagramType:re,diagramTitle:Y,currentTheme:ie,undoStack:ae,redoStack:oe,undo:se,redo:ue,addNode:de,addEdge:pe,addSwimlane:me,addLane:he,updateNode:ge,updateEdge:_e,removeNode:ve,removeEdge:ye,removeSwimlane:be,clearAll:xe,selectNode:Se,selectEdge:Ce,bringToFront:Te,sendToBack:Ee,toJSON:X,fromJSON:Z,autoLayout:De,loadTemplate:Oe,PROCESS_TYPE_LABELS:ke,EXECUTION_TYPE_LABELS:Ae}=N(c,m),je=(0,e.computed)(()=>({...ke,...Ae})[re.value]||`流程图`),Q=(0,e.computed)(()=>W.find(e=>e.id===K.value)||null),$=(0,e.ref)(null),Me=(0,e.computed)(()=>!Q.value||!$.value?null:Q.value.lanes?.find(e=>e.id===$.value)||null),Ne=()=>{G.value=null,ee.value=null,K.value=null,$.value=null,ne.value=!1,J.value=null},Pe=()=>{Ne(),M.value=!1,j.value=null},Fe=(e,t)=>{K.value=e,$.value=t},Ie=(e,t)=>{let n=W.find(t=>t.id===e);n&&Object.assign(n,t)},Le=(e,t,n)=>{let r=W.find(t=>t.id===e);if(r){let e=r.lanes?.find(e=>e.id===t);e&&Object.assign(e,n)}},Re=(e,t,n)=>{let r=W.find(t=>t.id===e);if(r){if(r.direction===`horizontal`&&r.lanes?.length){let e=r.lanes.reduce((e,t)=>e+t.height,0);if(e>0){let t=n/e;r.lanes.forEach(e=>{e.height=Math.max(40,e.height*t)})}}if(r.direction===`vertical`&&r.lanes?.length){let e=r.lanes.reduce((e,t)=>e+(t.width||200),0);if(e>0){let n=t/e;r.lanes.forEach(e=>{e.width=Math.max(80,(e.width||200)*n)})}}r.width=t,r.height=n}},ze=(e,t,n,r)=>{let i=W.find(t=>t.id===e);if(i){let e=i.lanes?.find(e=>e.id===t);e&&(n!=null&&(e.height=n),r!=null&&(e.width=r,i.direction===`vertical`&&i.lanes?.length&&(i.width=i.lanes.reduce((e,t)=>e+(t.width||200),0))))}},Be=(e,t,n)=>{let r=W.find(t=>t.id===e);r&&(r.x=t,r.y=n)},Ve=e=>{re.value=e},He=e=>{Oe(e)},Ue=e=>{ie.value=e},We=(e,t,n)=>{G.value=de(e,t,n).id},Ge=e=>{M.value=!1,j.value=null,J.value=e},Ke=e=>{j.value=e,M.value=!0},qe=e=>{let t=j.value||J.value;t&&e&&t!==e&&pe(t,e),J.value=null,j.value=null,M.value=!1},Je=(e,t,n)=>{P.value=!0;let r=H.find(t=>t.id===e);r&&!r.locked&&(r.x+=t,r.y+=n)},Ye=()=>{P.value=!1,F&&F()},Xe=(e,t,n)=>{P.value=!0;let r=H.find(t=>t.id===e);r&&(r.width=t,r.height=n)},Ze=()=>{P.value=!1,F&&F()},Qe=e=>{let t=me(`泳道 `+(W.length+1),e);he(t.id,`角色A`),K.value=t.id},$e=()=>{Q.value&&he(Q.value.id,`新泳道`)},et=()=>{Q.value&&Me.value&&Le(Q.value.id,Me.value.id,{})},tt=()=>{if(H.length===0)return;let e=Math.min(...H.map(e=>e.x)),t=Math.min(...H.map(e=>e.y)),n=Math.max(...H.map(e=>e.x+e.width)),r=Math.max(...H.map(e=>e.y+e.height)),i=n-e||1,a=r-t||1,o=document.querySelector(`.diagram-canvas`);if(!o)return;let s=o.getBoundingClientRect(),c=(s.width-120)/i,l=(s.height-120)/a,u=Math.min(c,l,2);H.forEach(n=>{n.x=60+(n.x-e)*u,n.y=60+(n.y-t)*u,n.width*=u,n.height*=u}),y.value&&y.value.resetView()},nt=async e=>{let t=X();switch(e){case`json`:rt(t);break;case`svg`:at();break;case`png`:ot(`png`);break;case`html`:st(t);break;case`pdf`:lt();break}},rt=e=>{let t=new Blob([JSON.stringify(e,null,2)],{type:`application/json`}),n=URL.createObjectURL(t),i=document.createElement(`a`);i.href=n,i.download=`${Y.value||`流程图`}.json`,i.click(),URL.revokeObjectURL(n),r.ElMessage.success(`JSON已导出`)},at=()=>{let e=y.value?.svgRef;if(!e)return;let t=e.cloneNode(!0),n=new XMLSerializer().serializeToString(t),i=new Blob([n],{type:`image/svg+xml`}),a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=`${Y.value||`流程图`}.svg`,o.click(),URL.revokeObjectURL(a),r.ElMessage.success(`SVG已导出`)},ot=async e=>{let t=y.value?.svgRef;if(!t)return;let n=new XMLSerializer().serializeToString(t),i=document.createElement(`canvas`),a=i.getContext(`2d`),o=new Image,s=new Blob([n],{type:`image/svg+xml;charset=utf-8`}),c=URL.createObjectURL(s);o.onload=()=>{i.width=o.width*2,i.height=o.height*2,a.scale(2,2),a.fillStyle=`#ffffff`,a.fillRect(0,0,o.width,o.height),a.drawImage(o,0,0),URL.revokeObjectURL(c),i.toBlob(t=>{let n=document.createElement(`a`);n.href=URL.createObjectURL(t),n.download=`${Y.value||`流程图`}.${e}`,n.click(),r.ElMessage.success(`${e.toUpperCase()}已导出`)},`image/${e}`)},o.src=c},st=e=>{let t=`<!DOCTYPE html>
15
+ <html lang="zh-CN">
16
+ <head>
17
+ <meta charset="UTF-8">
18
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
19
+ <title>${e.title}</title>
20
+ <style>
21
+ * { margin: 0; padding: 0; box-sizing: border-box; }
22
+ body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f5f5f5; display: flex; justify-content: center; align-items: center; min-height: 100vh; }
23
+ .container { background: #fff; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,0.1); padding: 24px; }
24
+ h1 { font-size: 18px; margin-bottom: 16px; color: #333; }
25
+ svg { max-width: 100%; height: auto; }
26
+ .node-label { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
27
+ @keyframes flowParticle { 0% { offset-distance: 0%; } 100% { offset-distance: 100%; } }
28
+ @keyframes dashFlow { to { stroke-dashoffset: -24; } }
29
+ </style>
30
+ </head>
31
+ <body>
32
+ <div class="container">
33
+ <h1>${e.title}</h1>
34
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4000 3000">
35
+ ${ct(e)}
36
+ </svg>
37
+ </div>
38
+ </body>
39
+ </html>`,n=new Blob([t],{type:`text/html;charset=utf-8`}),i=URL.createObjectURL(n),a=document.createElement(`a`);a.href=i,a.download=`${e.title||`流程图`}.html`,a.click(),URL.revokeObjectURL(i),r.ElMessage.success(`HTML已导出`)},ct=e=>{let t=``;return(e.nodes||[]).forEach(e=>{let n=e.color||`#409eff`,r=e.strokeColor||`#333`;if(e.shape===`ellipse`)t+=`<ellipse cx="${e.x+e.width/2}" cy="${e.y+e.height/2}" rx="${e.width/2}" ry="${e.height/2}" fill="${n}" stroke="${r}" stroke-width="${e.strokeWidth}"/>`;else if(e.shape===`diamond`){let i=e.x+e.width/2,a=e.y+e.height/2;t+=`<polygon points="${i},${e.y} ${e.x+e.width},${a} ${i},${e.y+e.height} ${e.x},${a}" fill="${n}" stroke="${r}" stroke-width="${e.strokeWidth}"/>`}else t+=`<rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="6" fill="${n}" stroke="${r}" stroke-width="${e.strokeWidth}"/>`;t+=`<text x="${e.x+e.width/2}" y="${e.y+e.height/2}" text-anchor="middle" dominant-baseline="central" fill="${e.textColor}" font-size="${e.fontSize}" class="node-label">${e.label}</text>`}),(e.edges||[]).forEach(n=>{let r=(e.nodes||[]).find(e=>e.id===n.sourceId),i=(e.nodes||[]).find(e=>e.id===n.targetId);if(r&&i){let e=r.x+r.width/2,a=r.y+r.height/2,o=i.x+i.width/2,s=i.y+i.height/2;t+=`<line x1="${e}" y1="${a}" x2="${o}" y2="${s}" stroke="${n.lineColor}" stroke-width="${n.lineWidth}" marker-end="url(#arrowhead)"/>`}}),t},lt=()=>{let e=y.value?.svgRef;if(!e)return;let t=new XMLSerializer().serializeToString(e),n=window.open(``,`_blank`);n.document.write(`
40
+ <!DOCTYPE html>
41
+ <html>
42
+ <head><title>${Y.value}</title></head>
43
+ <body style="margin:0;display:flex;justify-content:center;">
44
+ ${t}
45
+ <script>window.onload=()=>{window.print();window.close()}<\/script>
46
+ </body>
47
+ </html>
48
+ `),n.document.close()},ut=()=>{b.value?.click()},dt=e=>{let t=e.target.files[0];if(!t)return;let n=new FileReader;n.onload=e=>{try{Z(JSON.parse(e.target.result))?r.ElMessage.success(`导入成功`):r.ElMessage.error(`无效的流程图文件`)}catch{r.ElMessage.error(`文件解析失败`)}},n.readAsText(t),e.target.value=``},ft=async()=>{if(w.value&&h.collaborationClosed.value){r.ElMessage.error(`协作已关闭,无法提交保存`);return}if(!Y.value?.trim()){r.ElMessage.warning(`请输入流程图名称`);return}if(!k.value?.trim()){r.ElMessage.warning(`请输入用户名称`);return}try{let e=X(),t={title:Y.value||`流程图`,content:JSON.stringify(e),doc_type:o?`process-diagram`:`exec-diagram`},n=a.params.id;if(n&&n!==`new`)await _.update(n,t),O.value=n;else{let e=await _.create(t);O.value=e.data.id,i.replace(`/${o?`process-diagram`:`execution-diagram`}/${e.data.id}`)}r.ElMessage.success(`已保存`),f({documentId:String(O.value||``),docType:o?`process-diagram`:`exec-diagram`,content:JSON.stringify(e),userId:String(p.currentUser.value?.id||``),userName:p.currentUser.value?.name||k.value||`未知`})}catch(e){r.ElMessage.error(`保存失败: `+(e.message||e))}},pt=async()=>{let e=a.params.id;if(e&&e!==`new`)try{let t=await _.get(e);t.data&&t.data.content&&(Z(JSON.parse(t.data.content)),Y.value=t.data.title||Y.value)}catch{let t=localStorage.getItem(l+e);if(t)try{Z(JSON.parse(t))}catch{}}},ht=()=>{i.push(`/`)},gt=[`我可以帮您优化流程图布局、检查节点逻辑,或者提供流程设计建议。请问有什么需要帮助的?`,`这个流程图的节点连接看起来很清晰。建议检查一下是否有遗漏的分支或异常处理路径。`,`根据当前的流程结构,我建议在关键决策节点后添加明确的条件标注,使流程更易理解。`,`流程图中的泳道划分很合理。如果需要,我可以帮您分析各角色的职责分配是否均衡。`,`我可以帮您检查流程中是否存在循环依赖或死锁风险。需要我逐条分析吗?`,`建议在流程开始和结束节点使用统一的样式,这样可以让读者更快识别流程的起止点。`,`这个执行图的逻辑链路比较长,建议在中间添加一些检查点节点,便于流程监控和调试。`,`我可以帮您生成流程图的文字说明文档,方便团队成员理解流程细节。`],_t=async(e,t={})=>{let n=a.params.id?`${Pa}-${a.params.id}`:null;await p.sendMessage(e,{...t,roomId:n});let r=t.mentionedUser,i=r&&r.toLowerCase().includes(`ai`),o=p.collabUsers.value.filter(e=>e.name!==p.currentUser.value.name);(!r||i||o.length===0)&&(p.loading.value=!0,setTimeout(()=>{p.sendAiMessage(gt[Math.floor(Math.random()*gt.length)],n),p.loading.value=!1},800+Math.random()*1200))},vt=()=>{let e=a.params.id?`${Pa}-${a.params.id}`:null;p.clearMessages(e)},yt=()=>{if(!a.params.id){r.ElMessage.warning(`请先保存文档`);return}d.value=!0},bt=e=>{try{let t=typeof e==`string`?JSON.parse(e):e;Z&&Z(t)}catch(e){console.error(`Version apply error:`,e)}};return(0,e.onMounted)(()=>{pt().then(()=>{if(a.query.collab===`1`){w.value=!0,I();let t=(0,e.watch)(()=>h.isSynced.value,e=>{e&&(t(),h.checkCollaborationClosed()&&(h.disconnect(),w.value=!1,C.value=!1,r.ElMessage.warning(`该协作已关闭,无法加入`)))});h.isSynced.value&&h.checkCollaborationClosed()&&(h.disconnect(),w.value=!1,C.value=!1,r.ElMessage.warning(`该协作已关闭,无法加入`))}})}),(t,n)=>{let r=(0,e.resolveComponent)(`el-icon`),i=(0,e.resolveComponent)(`el-button`),a=(0,e.resolveComponent)(`el-input`);return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,Ta,[(0,e.createElementVNode)(`div`,Ea,[(0,e.createElementVNode)(`div`,Da,[(0,e.createVNode)(i,{size:`small`,circle:``,onClick:ht},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(r,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(s.ArrowLeft))]),_:1})]),_:1}),(0,e.createVNode)(a,{modelValue:(0,e.unref)(Y),"onUpdate:modelValue":n[0]||=t=>(0,e.isRef)(Y)?Y.value=t:null,size:`small`,class:`title-input`,placeholder:`流程图标题 *`,disabled:w.value},null,8,[`modelValue`,`disabled`]),(0,e.createVNode)(a,{modelValue:k.value,"onUpdate:modelValue":n[1]||=e=>k.value=e,size:`small`,class:`user-name-input`,placeholder:`用户名称 *`},null,8,[`modelValue`])]),(0,e.createElementVNode)(`div`,Oa,[!w.value&&(0,e.unref)(h).peers.value.length>0?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,ka,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)((0,e.unref)(h).peers.value.slice(0,5),t=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{key:t.clientId,class:`collab-avatar`,style:(0,e.normalizeStyle)({background:t.color}),title:t.name},(0,e.toDisplayString)(t.name?.charAt(0)),13,Aa))),128)),(0,e.unref)(h).peers.value.length>5?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,ja,`+`+(0,e.toDisplayString)((0,e.unref)(h).peers.value.length-5),1)):(0,e.createCommentVNode)(``,!0)])):(0,e.createCommentVNode)(``,!0),(0,e.createVNode)(i,{size:`small`,circle:``,type:u.value?`primary`:`default`,onClick:n[2]||=e=>u.value=!u.value,title:`AI助手`},{default:(0,e.withCtx)(()=>[(0,e.createVNode)(r,null,{default:(0,e.withCtx)(()=>[(0,e.createVNode)((0,e.unref)(s.Monitor))]),_:1})]),_:1},8,[`type`])])]),(0,e.createElementVNode)(`div`,Ma,[(0,e.createVNode)(it,{NODE_TYPES:(0,e.unref)(z),"diagram-type-label":je.value,"type-disabled":w.value,onSetType:Ve},null,8,[`NODE_TYPES`,`diagram-type-label`,`type-disabled`]),(0,e.createElementVNode)(`div`,Na,[(0,e.createVNode)(mt,{"animation-playing":x.value,"can-undo":(0,e.unref)(ae).length>0,"can-redo":(0,e.unref)(oe).length>0,disabled:w.value,"is-collaborating":C.value,"is-joined-collab":w.value,onAddSwimlane:Qe,onUndo:(0,e.unref)(se),onRedo:(0,e.unref)(ue),onAutoLayout:(0,e.unref)(De),onToggleAnimation:n[3]||=e=>x.value=!x.value,onSetAnimationSpeed:n[4]||=e=>S.value=e,onExport:nt,onImportJson:ut,onClear:(0,e.unref)(xe),onSetTemplate:He,onStartCollab:I,onStopCollab:L,onShareCollab:R,onSave:ft,"show-history":!!O.value,onHistory:yt},null,8,[`animation-playing`,`can-undo`,`can-redo`,`disabled`,`is-collaborating`,`is-joined-collab`,`onUndo`,`onRedo`,`onAutoLayout`,`onClear`,`show-history`]),(0,e.createVNode)($r,{ref_key:`canvasRef`,ref:y,nodes:(0,e.unref)(H),edges:(0,e.unref)(U),swimlanes:(0,e.unref)(W),"selected-node-id":(0,e.unref)(G),"selected-edge-id":(0,e.unref)(ee),"selected-swimlane-id":(0,e.unref)(K),"selected-lane-id":$.value,"connect-mode":(0,e.unref)(ne),"connect-source":(0,e.unref)(J),"animation-playing":x.value,theme:(0,e.unref)(ie),onSelectNode:(0,e.unref)(Se),onSelectEdge:(0,e.unref)(Ce),onSelectSwimlane:n[5]||=e=>K.value=e,onSelectLane:Fe,onUpdateSwimlane:Ie,onUpdateLane:Le,onResizeSwimlane:Re,onResizeLane:ze,onMoveSwimlane:Be,onSelectCanvas:Ne,"auto-connect-source":j.value,"auto-connect-mode":M.value,onStartConnect:Ge,onEndConnect:qe,onAutoConnectStart:Ke,onNodeDrag:Je,onNodeResize:Xe,onNodeDragEnd:Ye,onNodeResizeEnd:Ze,onDropNode:We,onResetState:Pe,onFitView:tt},null,8,[`nodes`,`edges`,`swimlanes`,`selected-node-id`,`selected-edge-id`,`selected-swimlane-id`,`selected-lane-id`,`connect-mode`,`connect-source`,`animation-playing`,`theme`,`onSelectNode`,`onSelectEdge`,`auto-connect-source`,`auto-connect-mode`])]),(0,e.createVNode)(wa,{"selected-node":(0,e.unref)(q),"selected-edge":(0,e.unref)(te),"selected-swimlane":Q.value,"selected-lane":Me.value,NODE_TYPES:(0,e.unref)(z),ANIMATION_TYPES:(0,e.unref)(B),LINE_STYLES:(0,e.unref)(V),"current-theme":(0,e.unref)(ie),onDeleteNode:n[6]||=t=>(0,e.unref)(q)&&(0,e.unref)(ve)((0,e.unref)(q).id),onDeleteEdge:n[7]||=t=>(0,e.unref)(te)&&(0,e.unref)(ye)((0,e.unref)(te).id),onDeleteSwimlane:n[8]||=t=>Q.value&&(0,e.unref)(be)(Q.value.id),onBringFront:n[9]||=t=>(0,e.unref)(q)&&(0,e.unref)(Te)((0,e.unref)(q).id),onSendBack:n[10]||=t=>(0,e.unref)(q)&&(0,e.unref)(Ee)((0,e.unref)(q).id),onAddLane:$e,onUpdateLane:et,onChangeTheme:Ue},null,8,[`selected-node`,`selected-edge`,`selected-swimlane`,`selected-lane`,`NODE_TYPES`,`ANIMATION_TYPES`,`LINE_STYLES`,`current-theme`])]),(0,e.createElementVNode)(`input`,{ref_key:`fileInput`,ref:b,type:`file`,accept:`.json`,style:{display:`none`},onChange:dt},null,544),(0,e.createVNode)(ce,{visible:u.value,messages:(0,e.unref)(p).messages.value,loading:(0,e.unref)(p).loading.value,"is-collab":(0,e.unref)(p).isCollabMode.value,"collab-users":(0,e.unref)(p).collabUsers.value,"current-user":(0,e.unref)(p).currentUser.value,"is-owner":!w.value,onSend:_t,onClose:n[11]||=e=>u.value=!1,"unread-mention":(0,e.unref)(p).unreadMention.value,onClearUnread:n[12]||=t=>(0,e.unref)(p).clearUnreadMention(),onClear:vt},null,8,[`visible`,`messages`,`loading`,`is-collab`,`collab-users`,`current-user`,`is-owner`,`unread-mention`]),(0,e.createVNode)(we,{modelValue:d.value,"onUpdate:modelValue":n[13]||=e=>d.value=e,"document-id":O.value,onApply:bt},null,8,[`modelValue`,`document-id`])])}}},[[`__scopeId`,`data-v-8ecfadf7`]]);return(0,e.defineComponent)({name:`YourCompanyDiagram`,props:{docId:{type:[Number,String],default:null},apiBase:{type:String,default:`/api`},wsUrl:{type:String,default:``},user:{type:Object,default:()=>({id:``,name:``,color:``})},roomId:{type:String,default:``}},setup(n,{slots:r}){return()=>(0,e.h)(`div`,{class:`yourcompany-diagram-wrapper`,style:`position:relative`},[(0,e.h)(Fa,{...n}),(0,e.h)(t.BrandWatermark)])}})});