@rytass/bpm-core-react 0.3.1 → 0.3.3

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.
Files changed (182) hide show
  1. package/CHANGELOG.md +166 -0
  2. package/dist/chunks/app-navigation-BSkMsEhy.js +268 -0
  3. package/dist/chunks/app-navigation-BSkMsEhy.js.map +1 -0
  4. package/dist/chunks/app-navigation-KnlJCUp1.cjs +2 -0
  5. package/dist/chunks/app-navigation-KnlJCUp1.cjs.map +1 -0
  6. package/dist/chunks/approval-instance-list-page-CVXgE2K3.cjs +2 -0
  7. package/dist/chunks/approval-instance-list-page-CVXgE2K3.cjs.map +1 -0
  8. package/dist/chunks/{approval-instance-list-page-nmzMrj0b.js → approval-instance-list-page-CqNdoZqx.js} +73 -72
  9. package/dist/chunks/approval-instance-list-page-CqNdoZqx.js.map +1 -0
  10. package/dist/chunks/builder-CMlJfQHE.cjs +3 -0
  11. package/dist/chunks/builder-CMlJfQHE.cjs.map +1 -0
  12. package/dist/chunks/{builder-DqZskyXC.js → builder-D950gct_.js} +492 -491
  13. package/dist/chunks/builder-D950gct_.js.map +1 -0
  14. package/dist/chunks/categories-5yEM3p3N.cjs +2 -0
  15. package/dist/chunks/categories-5yEM3p3N.cjs.map +1 -0
  16. package/dist/chunks/{categories-DTEl182t.js → categories-BIpOG451.js} +115 -114
  17. package/dist/chunks/categories-BIpOG451.js.map +1 -0
  18. package/dist/chunks/dashboard-page-1K_jQXQk.cjs +2 -0
  19. package/dist/chunks/dashboard-page-1K_jQXQk.cjs.map +1 -0
  20. package/dist/chunks/dashboard-page-R_T2OEiE.js +122 -0
  21. package/dist/chunks/dashboard-page-R_T2OEiE.js.map +1 -0
  22. package/dist/chunks/{delegations-C5PzZ5Kn.js → delegations-B2j-wNEO.js} +193 -192
  23. package/dist/chunks/delegations-B2j-wNEO.js.map +1 -0
  24. package/dist/chunks/delegations-CsB9ozLu.cjs +2 -0
  25. package/dist/chunks/delegations-CsB9ozLu.cjs.map +1 -0
  26. package/dist/chunks/delegations-CvtwTXNP.cjs +2 -0
  27. package/dist/chunks/delegations-CvtwTXNP.cjs.map +1 -0
  28. package/dist/chunks/{delegations-C-ZrwzvU.js → delegations-dKodb0WW.js} +175 -174
  29. package/dist/chunks/delegations-dKodb0WW.js.map +1 -0
  30. package/dist/chunks/{detail-CfFyU5zC.js → detail-BcGAqJ_R.js} +465 -464
  31. package/dist/chunks/detail-BcGAqJ_R.js.map +1 -0
  32. package/dist/chunks/detail-CqjqLd65.cjs +2 -0
  33. package/dist/chunks/detail-CqjqLd65.cjs.map +1 -0
  34. package/dist/chunks/{format-date-time-isOa3e9q.cjs → format-date-time-26_pFvv4.cjs} +2 -2
  35. package/dist/chunks/{format-date-time-isOa3e9q.cjs.map → format-date-time-26_pFvv4.cjs.map} +1 -1
  36. package/dist/chunks/notifications-2swRqDPF.js +198 -0
  37. package/dist/chunks/notifications-2swRqDPF.js.map +1 -0
  38. package/dist/chunks/notifications-BaYDebFt.cjs +2 -0
  39. package/dist/chunks/notifications-BaYDebFt.cjs.map +1 -0
  40. package/dist/chunks/{orgs-xrdhb3hS.js → orgs-CuHxxd_n.js} +608 -607
  41. package/dist/chunks/orgs-CuHxxd_n.js.map +1 -0
  42. package/dist/chunks/orgs-YMiVLNvL.cjs +2 -0
  43. package/dist/chunks/orgs-YMiVLNvL.cjs.map +1 -0
  44. package/dist/chunks/routes-config-2aKbWq2H.cjs +2 -0
  45. package/dist/chunks/routes-config-2aKbWq2H.cjs.map +1 -0
  46. package/dist/chunks/routes-config-dxahImVe.js +43 -0
  47. package/dist/chunks/routes-config-dxahImVe.js.map +1 -0
  48. package/dist/chunks/templates-DTkbSgFY.cjs +2 -0
  49. package/dist/chunks/templates-DTkbSgFY.cjs.map +1 -0
  50. package/dist/chunks/templates-DoDWM68t.js +384 -0
  51. package/dist/chunks/templates-DoDWM68t.js.map +1 -0
  52. package/dist/chunks/users-3ySyUW4u.cjs +2 -0
  53. package/dist/chunks/users-3ySyUW4u.cjs.map +1 -0
  54. package/dist/chunks/{users-CY4-NK3j.js → users-sMfrSjRQ.js} +75 -74
  55. package/dist/chunks/users-sMfrSjRQ.js.map +1 -0
  56. package/dist/components/admin-pickers.d.ts +1 -1
  57. package/dist/components/approval-instance-list-page.d.ts +1 -1
  58. package/dist/components/org-unit-tree-draft-editor.d.ts +1 -1
  59. package/dist/index.cjs +1 -1
  60. package/dist/index.cjs.map +1 -1
  61. package/dist/index.d.ts +1 -0
  62. package/dist/index.js +101 -99
  63. package/dist/index.js.map +1 -1
  64. package/dist/lib/auth-provider.d.ts +1 -1
  65. package/dist/lib/org-tree-draft.d.ts +1 -1
  66. package/dist/lib/routes-config.d.ts +105 -0
  67. package/dist/next/BPMNextProviders.d.ts +48 -3
  68. package/dist/next/index.cjs +1 -1
  69. package/dist/next/index.cjs.map +1 -1
  70. package/dist/next/index.d.ts +1 -0
  71. package/dist/next/index.js +27 -21
  72. package/dist/next/index.js.map +1 -1
  73. package/dist/pages/admin/delegations/index.cjs +1 -1
  74. package/dist/pages/admin/delegations/index.js +1 -1
  75. package/dist/pages/admin/orgs/index.cjs +1 -1
  76. package/dist/pages/admin/orgs/index.js +1 -1
  77. package/dist/pages/admin/users/index.cjs +1 -1
  78. package/dist/pages/admin/users/index.js +1 -1
  79. package/dist/pages/delegations/index.cjs +1 -1
  80. package/dist/pages/delegations/index.js +1 -1
  81. package/dist/pages/forms/builder/index.cjs +1 -1
  82. package/dist/pages/forms/builder/index.js +1 -1
  83. package/dist/pages/instances/detail/index.cjs +1 -1
  84. package/dist/pages/instances/detail/index.js +1 -1
  85. package/dist/pages/settings/notifications/index.cjs +1 -1
  86. package/dist/pages/settings/notifications/index.js +1 -1
  87. package/dist/pages/templates/categories/index.cjs +1 -1
  88. package/dist/pages/templates/categories/index.js +1 -1
  89. package/dist/pages/templates/index.cjs +1 -1
  90. package/dist/pages/templates/index.js +1 -1
  91. package/dist/views/admin/delegations/index.cjs +1 -1
  92. package/dist/views/admin/delegations/index.js +1 -1
  93. package/dist/views/admin/index.cjs +1 -1
  94. package/dist/views/admin/index.js +3 -3
  95. package/dist/views/admin/orgs/index.cjs +1 -1
  96. package/dist/views/admin/orgs/index.js +1 -1
  97. package/dist/views/admin/users/index.cjs +1 -1
  98. package/dist/views/admin/users/index.js +1 -1
  99. package/dist/views/cc/index.cjs +1 -1
  100. package/dist/views/cc/index.js +1 -1
  101. package/dist/views/dashboard/index.cjs +1 -1
  102. package/dist/views/dashboard/index.js +1 -1
  103. package/dist/views/delegations/index.cjs +1 -1
  104. package/dist/views/delegations/index.js +1 -1
  105. package/dist/views/forms/builder/index.cjs +1 -1
  106. package/dist/views/forms/builder/index.js +1 -1
  107. package/dist/views/forms/index.cjs +1 -1
  108. package/dist/views/forms/index.cjs.map +1 -1
  109. package/dist/views/forms/index.js +78 -77
  110. package/dist/views/forms/index.js.map +1 -1
  111. package/dist/views/forms/renderer/FormRendererView.d.ts +2 -2
  112. package/dist/views/inbox/index.cjs +1 -1
  113. package/dist/views/inbox/index.cjs.map +1 -1
  114. package/dist/views/inbox/index.js +106 -105
  115. package/dist/views/inbox/index.js.map +1 -1
  116. package/dist/views/instances/detail/index.cjs +1 -1
  117. package/dist/views/instances/detail/index.js +1 -1
  118. package/dist/views/instances/new/index.cjs +1 -1
  119. package/dist/views/instances/new/index.cjs.map +1 -1
  120. package/dist/views/instances/new/index.js +90 -89
  121. package/dist/views/instances/new/index.js.map +1 -1
  122. package/dist/views/search/index.cjs +1 -1
  123. package/dist/views/search/index.js +1 -1
  124. package/dist/views/sent/index.cjs +1 -1
  125. package/dist/views/sent/index.js +1 -1
  126. package/dist/views/settings/index.cjs +1 -1
  127. package/dist/views/settings/index.js +1 -1
  128. package/dist/views/settings/notifications/index.cjs +1 -1
  129. package/dist/views/settings/notifications/index.js +1 -1
  130. package/dist/views/templates/categories/index.cjs +1 -1
  131. package/dist/views/templates/categories/index.js +1 -1
  132. package/dist/views/templates/designer/index.cjs +6 -6
  133. package/dist/views/templates/designer/index.cjs.map +1 -1
  134. package/dist/views/templates/designer/index.js +589 -588
  135. package/dist/views/templates/designer/index.js.map +1 -1
  136. package/dist/views/templates/index.cjs +1 -1
  137. package/dist/views/templates/index.js +2 -2
  138. package/dist/views/templates/versions/index.cjs +1 -1
  139. package/dist/views/templates/versions/index.cjs.map +1 -1
  140. package/dist/views/templates/versions/index.js +44 -43
  141. package/dist/views/templates/versions/index.js.map +1 -1
  142. package/package.json +3 -3
  143. package/dist/chunks/app-navigation-C_mbz7jx.cjs +0 -2
  144. package/dist/chunks/app-navigation-C_mbz7jx.cjs.map +0 -1
  145. package/dist/chunks/app-navigation-uwbNEw9P.js +0 -262
  146. package/dist/chunks/app-navigation-uwbNEw9P.js.map +0 -1
  147. package/dist/chunks/approval-instance-list-page-Mo6wpDPb.cjs +0 -2
  148. package/dist/chunks/approval-instance-list-page-Mo6wpDPb.cjs.map +0 -1
  149. package/dist/chunks/approval-instance-list-page-nmzMrj0b.js.map +0 -1
  150. package/dist/chunks/builder-DPhAH381.cjs +0 -3
  151. package/dist/chunks/builder-DPhAH381.cjs.map +0 -1
  152. package/dist/chunks/builder-DqZskyXC.js.map +0 -1
  153. package/dist/chunks/categories-DEijUOnw.cjs +0 -2
  154. package/dist/chunks/categories-DEijUOnw.cjs.map +0 -1
  155. package/dist/chunks/categories-DTEl182t.js.map +0 -1
  156. package/dist/chunks/dashboard-page-DCmuB0Rw.cjs +0 -2
  157. package/dist/chunks/dashboard-page-DCmuB0Rw.cjs.map +0 -1
  158. package/dist/chunks/dashboard-page-Dx5PeEeN.js +0 -117
  159. package/dist/chunks/dashboard-page-Dx5PeEeN.js.map +0 -1
  160. package/dist/chunks/delegations-C-ZrwzvU.js.map +0 -1
  161. package/dist/chunks/delegations-C5PzZ5Kn.js.map +0 -1
  162. package/dist/chunks/delegations-DOGDvybX.cjs +0 -2
  163. package/dist/chunks/delegations-DOGDvybX.cjs.map +0 -1
  164. package/dist/chunks/delegations-DkDBWOQ7.cjs +0 -2
  165. package/dist/chunks/delegations-DkDBWOQ7.cjs.map +0 -1
  166. package/dist/chunks/detail-B2gcOPkd.cjs +0 -2
  167. package/dist/chunks/detail-B2gcOPkd.cjs.map +0 -1
  168. package/dist/chunks/detail-CfFyU5zC.js.map +0 -1
  169. package/dist/chunks/notifications-CPQ-nVar.cjs +0 -2
  170. package/dist/chunks/notifications-CPQ-nVar.cjs.map +0 -1
  171. package/dist/chunks/notifications-DweexUVy.js +0 -197
  172. package/dist/chunks/notifications-DweexUVy.js.map +0 -1
  173. package/dist/chunks/orgs-DgZ0DQ3-.cjs +0 -2
  174. package/dist/chunks/orgs-DgZ0DQ3-.cjs.map +0 -1
  175. package/dist/chunks/orgs-xrdhb3hS.js.map +0 -1
  176. package/dist/chunks/templates-PK_VYvcy.js +0 -383
  177. package/dist/chunks/templates-PK_VYvcy.js.map +0 -1
  178. package/dist/chunks/templates-x1OJZmsG.cjs +0 -2
  179. package/dist/chunks/templates-x1OJZmsG.cjs.map +0 -1
  180. package/dist/chunks/users-CY4-NK3j.js.map +0 -1
  181. package/dist/chunks/users-DHnu_056.cjs +0 -2
  182. package/dist/chunks/users-DHnu_056.cjs.map +0 -1
@@ -1,16 +1,17 @@
1
1
  "use client";
2
2
  import { a as e } from "../../../chunks/auth-provider-Bnox5gsx.js";
3
- import { t } from "../../../chunks/app-navigation-uwbNEw9P.js";
4
- import { a as n, n as r, o as i, r as a } from "../../../chunks/admin-pickers-DLlG_1du.js";
5
- import { t as o } from "../../../chunks/bpm-form-field-Cao0rMol.js";
6
- import { useCallback as s, useEffect as c, useMemo as l, useRef as ee, useState as u } from "react";
7
- import { AutoComplete as te, Button as d, Icon as ne, Input as re, Modal as ie, PageHeader as ae, Section as oe, SectionGroup as se, Select as f, Textarea as ce, Toggle as le, Typography as p } from "@mezzanine-ui/react";
8
- import { Fragment as ue, jsx as m, jsxs as h } from "react/jsx-runtime";
3
+ import { t } from "../../../chunks/app-navigation-BSkMsEhy.js";
4
+ import { r as n } from "../../../chunks/routes-config-dxahImVe.js";
5
+ import { a as r, n as i, o as a, r as o } from "../../../chunks/admin-pickers-DLlG_1du.js";
6
+ import { t as s } from "../../../chunks/bpm-form-field-Cao0rMol.js";
7
+ import { useCallback as ee, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
8
+ import { AutoComplete as te, Button as f, Icon as ne, Input as re, Modal as ie, PageHeader as ae, Section as oe, SectionGroup as se, Select as p, Textarea as ce, Toggle as le, Typography as m } from "@mezzanine-ui/react";
9
+ import { Fragment as ue, jsx as h, jsxs as g } from "react/jsx-runtime";
9
10
  import { CheckedIcon as de, DotGridIcon as fe, EyeIcon as pe, FilterIcon as me, MailIcon as he, SaveIcon as ge, TrashIcon as _e, UserIcon as ve } from "@mezzanine-ui/icons";
10
11
  import ye from "@mezzanine-ui/react/ContentHeader";
11
12
  import { readOrganizationDashboard as be } from "@rytass/bpm-core-client/organization";
12
- import { Background as xe, ConnectionMode as Se, ControlButton as Ce, Controls as we, Handle as g, MiniMap as Te, Panel as _, Position as v, ReactFlow as Ee, applyNodeChanges as De, getViewportForBounds as Oe } from "@xyflow/react";
13
- import * as ke from "dagre";
13
+ import { Background as xe, ConnectionMode as Se, ControlButton as Ce, Controls as we, Handle as Te, MiniMap as Ee, Panel as De, Position as _, ReactFlow as Oe, applyNodeChanges as ke, getViewportForBounds as v } from "@xyflow/react";
14
+ import * as y from "dagre";
14
15
  import { dryRunApprovalWorkflow as Ae, forkApprovalTemplate as je, publishApprovalTemplateVersion as Me, readTemplateDesigner as Ne, resolveMemberOptions as Pe, searchMemberOptions as Fe, searchPublishedFormVersionOptions as Ie, updateApprovalTemplateDraft as Le } from "@rytass/bpm-core-client/template";
15
16
  //#region src/views/templates/designer/TemplateDesignerView.tsx
16
17
  var Re = {
@@ -43,18 +44,18 @@ var Re = {
43
44
  height: "100%",
44
45
  justifyContent: "center",
45
46
  width: "100%"
46
- }, Ue = "workflow-designer-side-panel", y = 96, We = `
47
+ }, Ue = "workflow-designer-side-panel", We = 96, Ge = `
47
48
  .${Ue} .mzn-form-field--stretch .mzn-form-field__label-area,
48
49
  .${Ue} .mzn-form-field--horizontal .mzn-form-field__label-area {
49
- flex: 0 0 ${y}px;
50
- width: ${y}px;
50
+ flex: 0 0 ${We}px;
51
+ width: ${We}px;
51
52
  }
52
53
 
53
54
  .${Ue} .mzn-form-field--stretch .mzn-form-field__data-entry,
54
55
  .${Ue} .mzn-form-field--horizontal .mzn-form-field__data-entry {
55
56
  min-width: 0;
56
57
  }
57
- `, Ge = "#2563eb", b = "#64748b", Ke = "var(--mzn-color-text-error, #dc2626)", qe = "drop-shadow(0 0 3px rgba(0, 87, 255, 0.85)) drop-shadow(0 0 9px rgba(0, 87, 255, 0.36))", Je = `
58
+ `, Ke = "#2563eb", b = "#64748b", qe = "var(--mzn-color-text-error, #dc2626)", Je = "drop-shadow(0 0 3px rgba(0, 87, 255, 0.85)) drop-shadow(0 0 9px rgba(0, 87, 255, 0.36))", Ye = `
58
59
  .workflow-selection-delete-control.react-flow__controls-button {
59
60
  align-items: center !important;
60
61
  display: flex !important;
@@ -79,7 +80,7 @@ var Re = {
79
80
 
80
81
  .workflow-edge--selected .react-flow__edge-path,
81
82
  .react-flow__edge-path.workflow-edge--selected {
82
- filter: ${qe};
83
+ filter: ${Je};
83
84
  opacity: 1 !important;
84
85
  stroke: ${b} !important;
85
86
  stroke-opacity: 1 !important;
@@ -92,13 +93,13 @@ var Re = {
92
93
  --xy-edge-stroke-width: 1.5px;
93
94
  }
94
95
 
95
- `, Ye = {
96
+ `, Xe = {
96
97
  display: "grid",
97
98
  gap: 12
98
99
  }, x = {
99
100
  display: "grid",
100
101
  gap: 12
101
- }, Xe = {
102
+ }, Ze = {
102
103
  border: "1px solid var(--mzn-color-border-neutral)",
103
104
  borderRadius: 6,
104
105
  display: "grid",
@@ -106,16 +107,16 @@ var Re = {
106
107
  maxHeight: 360,
107
108
  overflow: "auto",
108
109
  padding: 12
109
- }, Ze = {
110
+ }, Qe = {
110
111
  borderBottom: "1px solid var(--mzn-color-border-neutral)",
111
112
  display: "grid",
112
113
  gap: 4,
113
114
  padding: "0 0 8px"
114
- }, Qe = {
115
+ }, $e = {
115
116
  display: "flex",
116
117
  flexWrap: "wrap",
117
118
  gap: 8
118
- }, $e = {
119
+ }, et = {
119
120
  display: "grid",
120
121
  gap: 8
121
122
  }, S = {
@@ -133,46 +134,46 @@ var Re = {
133
134
  padding: "10px 12px",
134
135
  textAlign: "center",
135
136
  width: "100%"
136
- }, et = "0 8px 20px rgba(15, 23, 42, 0.08), 0 0 0 1px var(--mzn-color-primary, #0057ff), 0 0 10px rgba(0, 87, 255, 0.3)", tt = 64, C = 160, w = 20, T = 64, E = 180, D = {
137
+ }, tt = "0 8px 20px rgba(15, 23, 42, 0.08), 0 0 0 1px var(--mzn-color-primary, #0057ff), 0 0 10px rgba(0, 87, 255, 0.3)", nt = 64, C = 160, rt = 20, it = 64, w = 180, T = {
137
138
  ...S,
138
139
  display: "grid",
139
140
  gap: 8,
140
141
  padding: "10px 12px"
141
- }, nt = {
142
- ...D,
142
+ }, E = {
143
+ ...T,
143
144
  background: "#eff6ff",
144
145
  border: "1px solid #2563eb"
145
- }, O = {
146
- ...D,
146
+ }, D = {
147
+ ...T,
147
148
  background: "#f0fdfa",
148
149
  border: "1px solid #0f766e"
149
- }, rt = {
150
+ }, at = {
150
151
  ...S,
151
152
  background: "#ffffff"
152
- }, k = {
153
+ }, O = {
153
154
  ...S,
154
155
  background: "#ecfdf3",
155
156
  border: "1px solid #2f855a"
156
- }, it = {
157
+ }, ot = {
157
158
  ...S,
158
159
  background: "#fff4ed",
159
160
  border: "1px solid #c2410c"
160
- }, at = {
161
+ }, k = {
161
162
  display: "block",
162
163
  maxWidth: "100%",
163
164
  minWidth: 0
164
- }, ot = {
165
+ }, st = {
165
166
  display: "grid",
166
167
  gap: 2,
167
168
  minWidth: 0
168
- }, A = "input", j = "output", st = {
169
+ }, A = "input", j = "output", ct = {
169
170
  endEvent: "結束",
170
171
  exclusiveGateway: "條件分流",
171
172
  parallelGateway: "並行處理",
172
173
  serviceTask: "系統",
173
174
  startEvent: "開始",
174
175
  userTask: "簽核"
175
- }, ct = [{
176
+ }, lt = [{
176
177
  icon: ve,
177
178
  label: "簽核節點",
178
179
  type: "userTask"
@@ -180,23 +181,23 @@ var Re = {
180
181
  icon: he,
181
182
  label: "知會節點",
182
183
  type: "serviceTask"
183
- }], lt = [{
184
+ }], ut = [{
184
185
  icon: me,
185
186
  label: "條件分流",
186
187
  type: "exclusiveGateway"
187
- }], ut = [{
188
+ }], dt = [{
188
189
  id: "AND",
189
190
  name: "全部前置完成"
190
191
  }, {
191
192
  id: "OR",
192
193
  name: "任一前置完成"
193
- }], dt = [{
194
+ }], ft = [{
194
195
  id: "RESTART",
195
196
  name: "重新送出後從開始重跑"
196
197
  }, {
197
198
  id: "FROM_RETURN_POINT",
198
199
  name: "重新送出後回到退回節點"
199
- }], ft = [
200
+ }], pt = [
200
201
  {
201
202
  id: "DIRECT",
202
203
  name: "指定會員"
@@ -237,13 +238,13 @@ var Re = {
237
238
  name: "第三層主管",
238
239
  value: 3
239
240
  }
240
- ], pt = [{
241
+ ], mt = [{
241
242
  id: "NONE",
242
243
  name: "停止流程並提示"
243
244
  }, {
244
245
  id: "DIRECT",
245
246
  name: "固定改派"
246
- }], mt = [
247
+ }], N = [
247
248
  {
248
249
  id: "EQUALS",
249
250
  name: "等於"
@@ -304,179 +305,179 @@ var Re = {
304
305
  id: "CUSTOM",
305
306
  name: "既有自訂規則"
306
307
  }, vt = "member-001", yt = {
307
- endEvent: N,
308
- exclusiveGateway: N,
309
- parallelGateway: N,
310
- serviceTask: N,
311
- startEvent: N,
312
- userTask: N
308
+ endEvent: P,
309
+ exclusiveGateway: P,
310
+ parallelGateway: P,
311
+ serviceTask: P,
312
+ startEvent: P,
313
+ userTask: P
313
314
  };
314
- function bt({ templateId: n, activeHref: i = "/templates" }) {
315
- let fe = e(), [me, he] = u(null), [ve, g] = u(null), [_, v] = u(zt()), [Oe, ke] = u(""), [y, Ge] = u(null), [b, qe] = u(null), [S, et] = u(null), [tt, C] = u(null), [w, T] = u("start"), [E, D] = u([]), [nt, O] = u(null), [rt, k] = u(null), [it, at] = u(!0), [ot, A] = u(!1), [j, mt] = u(!1), [ht, bt] = u([]), N = l(() => JSON.stringify({
316
- formDefinitionVersionId: y,
317
- initiatorPolicyCel: b,
318
- workflowDefinition: _
315
+ function bt({ templateId: r, activeHref: a }) {
316
+ let fe = e(), me = n(), he = a ?? me.templates(), [ve, Te] = d(null), [De, _] = d(null), [v, y] = d(zt()), [We, Ke] = d(""), [b, Je] = d(null), [S, tt] = d(null), [nt, C] = d(null), [rt, it] = d(null), [w, T] = d("start"), [E, D] = d([]), [at, O] = d(null), [ot, k] = d(null), [st, A] = d(!0), [j, N] = d(!1), [ht, bt] = d(!1), [P, St] = d([]), Ct = l(() => JSON.stringify({
317
+ formDefinitionVersionId: b,
318
+ initiatorPolicyCel: S,
319
+ workflowDefinition: v
319
320
  }), [
320
- y,
321
321
  b,
322
- _
323
- ]), St = !!Oe && N !== Oe, [Ct, wt] = u(!1), [P, F] = u([]), [I, Et] = u([]), [L, jt] = u([]), [Mt, It] = u([]), [Lt, Rt] = u(!1), [Zt, en] = u(!1), [nn, B] = u("{}"), [V, cn] = u(null), [fn, mn] = u(null), [H, U] = u(void 0), Tn = ee(null);
322
+ S,
323
+ v
324
+ ]), wt = !!We && Ct !== We, [Tt, F] = d(!1), [I, Dt] = d([]), [L, Mt] = d([]), [R, It] = d([]), [Lt, Rt] = d([]), [Zt, en] = d(!1), [nn, V] = d(!1), [H, cn] = d("{}"), [U, pn] = d(null), [W, G] = d(null), [wn, Tn] = d(void 0), En = u(null);
324
325
  c(() => {
325
- Qn();
326
- }, [n]), c(() => {
326
+ er();
327
+ }, [r]), c(() => {
327
328
  function e(e) {
328
- St && (e.preventDefault(), e.returnValue = "");
329
+ wt && (e.preventDefault(), e.returnValue = "");
329
330
  }
330
331
  return window.addEventListener("beforeunload", e), () => {
331
332
  window.removeEventListener("beforeunload", e);
332
333
  };
333
- }, [St]), c(() => {
334
- nr(_);
335
- }, [_, P]), c(() => {
336
- v((e) => At(e));
337
- }, [_.edges, _.nodes]);
338
- function En() {
339
- St && !window.confirm("目前有尚未儲存的流程草稿,確定要離開嗎?") || fe.push("/templates");
334
+ }, [wt]), c(() => {
335
+ ar(v);
336
+ }, [v, I]), c(() => {
337
+ y((e) => jt(e));
338
+ }, [v.edges, v.nodes]);
339
+ function Dn() {
340
+ wt && !window.confirm("目前有尚未儲存的流程草稿,確定要離開嗎?") || fe.push(me.templates());
340
341
  }
341
- let W = l(() => _.nodes.find((e) => e.id === w) ?? null, [w, _.nodes]), Dn = W ? sn(W) : !1, kn = E.length > 0 || Dn, Mn = s(() => {
342
- let e = W && sn(W) ? W.id : null;
343
- v((t) => ({
342
+ let K = l(() => v.nodes.find((e) => e.id === w) ?? null, [w, v.nodes]), jn = K ? sn(K) : !1, Mn = E.length > 0 || jn, Nn = ee(() => {
343
+ let e = K && sn(K) ? K.id : null;
344
+ y((t) => ({
344
345
  ...t,
345
346
  edges: t.edges.filter((t) => !E.includes(t.id) && t.source !== e && t.target !== e),
346
347
  nodes: e ? t.nodes.filter((t) => t.id !== e) : t.nodes
347
348
  })), D([]), O(null), e && T("start");
348
- }, [E, W]);
349
+ }, [E, K]);
349
350
  c(() => {
350
- if (!kn) return;
351
+ if (!Mn) return;
351
352
  function e(e) {
352
- e.key !== "Delete" && e.key !== "Backspace" || ln(e.target) || (e.preventDefault(), Mn());
353
+ e.key !== "Delete" && e.key !== "Backspace" || ln(e.target) || (e.preventDefault(), Nn());
353
354
  }
354
355
  return window.addEventListener("keydown", e), () => {
355
356
  window.removeEventListener("keydown", e);
356
357
  };
357
- }, [kn, Mn]);
358
- let Nn = l(() => _.edges.find((e) => e.id === nt) ?? null, [nt, _.edges]), Pn = l(() => E.length === 1 ? _.edges.find((e) => e.id === E[0]) ?? null : null, [E, _.edges]), Fn = l(() => E.map((e) => _.edges.find((t) => t.id === e) ?? null).filter((e) => !!e), [E, _.edges]), G = l(() => tt ?? Qt(b, S), [
359
- b,
360
- tt,
361
- S
362
- ]), Rn = l(() => _.nodes.map((e) => Tt(e, P, I, L, e.id === w, G)), [
363
- G,
364
- P,
358
+ }, [Mn, Nn]);
359
+ let Pn = l(() => v.edges.find((e) => e.id === at) ?? null, [at, v.edges]), Fn = l(() => E.length === 1 ? v.edges.find((e) => e.id === E[0]) ?? null : null, [E, v.edges]), q = l(() => E.map((e) => v.edges.find((t) => t.id === e) ?? null).filter((e) => !!e), [E, v.edges]), J = l(() => rt ?? Qt(S, nt), [
360
+ S,
361
+ rt,
362
+ nt
363
+ ]), Jn = l(() => v.nodes.map((e) => Et(e, I, L, R, e.id === w, J)), [
364
+ J,
365
365
  I,
366
366
  L,
367
+ R,
367
368
  w,
368
- _.nodes
369
- ]), Wn = l(() => _.edges.map((e) => Dt(e, _.nodes, E.includes(e.id))), [
369
+ v.nodes
370
+ ]), Yn = l(() => v.edges.map((e) => Ot(e, v.nodes, E.includes(e.id))), [
370
371
  E,
371
- _.edges,
372
- _.nodes
373
- ]), K = l(() => z(ht, y) ?? z(un(me?.formVersions ?? []), y), [
374
- y,
375
- ht,
376
- me?.formVersions
377
- ]), Xn = l(() => _n(ht, K), [ht, K]), q = l(() => Ln(_), [_]), J = l(() => zn(_), [_]), Y = l(() => $t(G), [G]);
378
- async function Qn() {
379
- at(!0), k(null);
372
+ v.edges,
373
+ v.nodes
374
+ ]), Y = l(() => B(P, b) ?? B(un(ve?.formVersions ?? []), b), [
375
+ b,
376
+ P,
377
+ ve?.formVersions
378
+ ]), Zn = l(() => gn(P, Y), [P, Y]), X = l(() => Ln(v), [v]), Z = l(() => Rn(v), [v]), $n = l(() => $t(J), [J]);
379
+ async function er() {
380
+ A(!0), k(null);
380
381
  try {
381
- let [e, t] = await Promise.all([Ne(n), be()]), r = e.versions.find((e) => e.status === "DRAFT") ?? null, i = r ?? e.versions[0] ?? null;
382
- he(e), g(r), Et(t.orgUnits), jt(t.positions), It(t.memberships), bt(un(e.formVersions));
382
+ let [e, t] = await Promise.all([Ne(r), be()]), n = e.versions.find((e) => e.status === "DRAFT") ?? null, i = n ?? e.versions[0] ?? null;
383
+ Te(e), _(n), Mt(t.orgUnits), It(t.positions), Rt(t.memberships), St(un(e.formVersions));
383
384
  let a = i?.workflowDefinition ?? zt(), o = i?.formDefinitionVersionId ?? e.formVersions[0]?.id ?? null, s = i?.initiatorPolicyCel ?? null;
384
- v(a), Ge(o), qe(s), ke(JSON.stringify({
385
+ y(a), Je(o), tt(s), Ke(JSON.stringify({
385
386
  formDefinitionVersionId: o,
386
387
  initiatorPolicyCel: s,
387
388
  workflowDefinition: a
388
- })), et(i && !e.template.currentVersionId && !i.initiatorPolicyCel && Bt(i.workflowDefinition) ? "NONE" : null), C(null), T(i?.workflowDefinition.nodes[0]?.id ?? "start"), D([]), O(null);
389
+ })), C(i && !e.template.currentVersionId && !i.initiatorPolicyCel && Bt(i.workflowDefinition) ? "NONE" : null), it(null), T(i?.workflowDefinition.nodes[0]?.id ?? "start"), D([]), O(null);
389
390
  } catch (e) {
390
- k(Q(e));
391
+ k(nr(e));
391
392
  } finally {
392
- at(!1);
393
+ A(!1);
393
394
  }
394
395
  }
395
- async function er(e) {
396
- mt(!0), k(null);
396
+ async function rr(e) {
397
+ bt(!0), k(null);
397
398
  try {
398
- bt(_n(un(await Ie(e)), K));
399
+ St(gn(un(await Ie(e)), Y));
399
400
  } catch (e) {
400
- k(Q(e));
401
+ k(nr(e));
401
402
  } finally {
402
- mt(!1);
403
+ bt(!1);
403
404
  }
404
405
  }
405
- async function Z(e) {
406
- wt(!0), k(null);
406
+ async function ir(e) {
407
+ F(!0), k(null);
407
408
  try {
408
409
  let t = await Fe(e);
409
- F((e) => An(e, vn(t)));
410
+ Dt((e) => kn(e, _n(t)));
410
411
  } catch (e) {
411
- k(Q(e));
412
+ k(nr(e));
412
413
  } finally {
413
- wt(!1);
414
+ F(!1);
414
415
  }
415
416
  }
416
- async function nr(e) {
417
- let t = jn(e).filter((e) => !P.some((t) => t.memberId === e));
417
+ async function ar(e) {
418
+ let t = An(e).filter((e) => !I.some((t) => t.memberId === e));
418
419
  if (t.length !== 0) try {
419
420
  let e = await Pe(t);
420
- F((t) => An(t, vn(e)));
421
+ Dt((t) => kn(t, _n(e)));
421
422
  } catch {
422
- F((e) => An(e, t.map(yn)));
423
+ Dt((e) => kn(e, t.map(vn)));
423
424
  }
424
425
  }
425
- async function rr() {
426
- A(!0), k(null);
426
+ async function or() {
427
+ N(!0), k(null);
427
428
  try {
428
- let e = Ln(_), t = $t(G);
429
+ let e = Ln(v), t = $t(J);
429
430
  if (e || t) {
430
431
  let n = e ?? t ?? "流程設定未完成";
431
432
  throw k(n), Error(n);
432
433
  }
433
- let r = await Le({
434
- formDefinitionVersionId: y,
435
- initiatorPolicyCel: b,
436
- versionId: (ve ?? await je(n)).id,
437
- workflowDefinition: _
434
+ let n = await Le({
435
+ formDefinitionVersionId: b,
436
+ initiatorPolicyCel: S,
437
+ versionId: (De ?? await je(r)).id,
438
+ workflowDefinition: v
438
439
  });
439
- return g(r), await Qn(), r;
440
+ return _(n), await er(), n;
440
441
  } catch (e) {
441
- throw k(Q(e)), e;
442
+ throw k(nr(e)), e;
442
443
  } finally {
443
- A(!1);
444
+ N(!1);
444
445
  }
445
446
  }
446
- async function ir() {
447
- A(!0), k(null);
447
+ async function sr() {
448
+ N(!0), k(null);
448
449
  try {
449
- await Me((await rr()).id), await Qn();
450
+ await Me((await or()).id), await er();
450
451
  } catch (e) {
451
- k(Q(e));
452
+ k(nr(e));
452
453
  } finally {
453
- A(!1);
454
+ N(!1);
454
455
  }
455
456
  }
456
- function ar() {
457
- B(JSON.stringify(dn(K), null, 2)), cn(null), mn(null), Rt(!0);
457
+ function cr() {
458
+ cn(JSON.stringify(dn(Y), null, 2)), pn(null), G(null), en(!0);
458
459
  }
459
- function or() {
460
- Zt || Rt(!1);
460
+ function lr() {
461
+ nn || en(!1);
461
462
  }
462
- async function sr() {
463
- en(!0), mn(null), cn(null);
463
+ async function ur() {
464
+ V(!0), G(null), pn(null);
464
465
  try {
465
- cn(await Ae({
466
- formData: pn(nn),
466
+ pn(await Ae({
467
+ formData: fn(H),
467
468
  initiatorMemberId: vt,
468
- initiatorMetadataSnapshot: wn(vt, Mt),
469
- workflowDefinition: _
469
+ initiatorMetadataSnapshot: Cn(vt, Lt),
470
+ workflowDefinition: v
470
471
  }));
471
472
  } catch (e) {
472
- mn(Q(e));
473
+ G(nr(e));
473
474
  } finally {
474
- en(!1);
475
+ V(!1);
475
476
  }
476
477
  }
477
- function cr(e) {
478
- let t = De(e, Rn);
479
- v((e) => ({
478
+ function dr(e) {
479
+ let t = ke(e, Jn);
480
+ y((e) => ({
480
481
  ...e,
481
482
  nodes: e.nodes.map((e) => {
482
483
  let n = t.find((t) => t.id === e.id);
@@ -487,34 +488,34 @@ function bt({ templateId: n, activeHref: i = "/templates" }) {
487
488
  })
488
489
  }));
489
490
  }
490
- function lr(e) {
491
- if (!an(e, _.nodes)) return;
492
- let t = _.nodes.some((t) => t.id === e.source && t.type === "exclusiveGateway"), n = R(e.source, e.target, {});
493
- v((e) => ({
491
+ function fr(e) {
492
+ if (!an(e, v.nodes)) return;
493
+ let t = v.nodes.some((t) => t.id === e.source && t.type === "exclusiveGateway"), n = z(e.source, e.target, {});
494
+ y((e) => ({
494
495
  ...e,
495
496
  edges: [...e.edges, n]
496
497
  })), T(null), D([n.id]), O(t ? n.id : null);
497
498
  }
498
- function ur(e, t) {
499
+ function pr(e, t) {
499
500
  e.stopPropagation(), D((n) => e.shiftKey || e.metaKey || e.ctrlKey ? on(n, t.id) : [t.id]), T(null);
500
501
  }
501
- function dr() {
502
+ function mr() {
502
503
  O(null);
503
504
  }
504
- function fr(e) {
505
+ function hr(e) {
505
506
  let t = Ft({
506
- definition: _,
507
- node: Nt(e, Pt(_.nodes, e)),
507
+ definition: v,
508
+ node: Nt(e, Pt(v.nodes, e)),
508
509
  selectedEdgeId: E.length === 1 ? E[0] : null,
509
510
  selectedNodeId: w
510
- }), n = Vt(t.definition), r = In(n, Tn.current);
511
- v(n), T(t.selectedNodeId), D(t.selectedEdgeIds), O(t.editingEdgeId), r && U(r);
511
+ }), n = Vt(t.definition), r = In(n, En.current);
512
+ y(n), T(t.selectedNodeId), D(t.selectedEdgeIds), O(t.editingEdgeId), r && Tn(r);
512
513
  }
513
- function pr(e) {
514
- W && vr(W.id, (t) => Ot(t, e));
514
+ function gr(e) {
515
+ K && xr(K.id, (t) => kt(t, e));
515
516
  }
516
517
  function $(e) {
517
- !W || W.type !== "userTask" || vr(W.id, (t) => t.type === "userTask" ? {
518
+ !K || K.type !== "userTask" || xr(K.id, (t) => t.type === "userTask" ? {
518
519
  ...t,
519
520
  data: {
520
521
  ...t.data,
@@ -523,8 +524,8 @@ function bt({ templateId: n, activeHref: i = "/templates" }) {
523
524
  }
524
525
  } : t);
525
526
  }
526
- function mr(e) {
527
- !W || W.type !== "userTask" || vr(W.id, (t) => t.type === "userTask" ? {
527
+ function _r(e) {
528
+ !K || K.type !== "userTask" || xr(K.id, (t) => t.type === "userTask" ? {
528
529
  ...t,
529
530
  data: {
530
531
  ...t.data,
@@ -535,8 +536,8 @@ function bt({ templateId: n, activeHref: i = "/templates" }) {
535
536
  }
536
537
  } : t);
537
538
  }
538
- function hr(e) {
539
- !W || W.type !== "serviceTask" || vr(W.id, (t) => t.type === "serviceTask" ? {
539
+ function vr(e) {
540
+ !K || K.type !== "serviceTask" || xr(K.id, (t) => t.type === "serviceTask" ? {
540
541
  ...t,
541
542
  data: {
542
543
  ...t.data,
@@ -544,30 +545,30 @@ function bt({ templateId: n, activeHref: i = "/templates" }) {
544
545
  }
545
546
  } : t);
546
547
  }
547
- function gr(e) {
548
- C(e.mode === "ALL" || e.mode === "CUSTOM" ? null : e), et(e.mode === "ALL" || e.mode === "CUSTOM" ? null : e.mode), qe(tn(e, I));
548
+ function yr(e) {
549
+ it(e.mode === "ALL" || e.mode === "CUSTOM" ? null : e), C(e.mode === "ALL" || e.mode === "CUSTOM" ? null : e.mode), tt(tn(e, L));
549
550
  }
550
- function _r(e) {
551
- !W || W.type === "startEvent" || vr(W.id, (t) => kt(t, e));
551
+ function br(e) {
552
+ !K || K.type === "startEvent" || xr(K.id, (t) => At(t, e));
552
553
  }
553
- function vr(e, t) {
554
- v((n) => ({
554
+ function xr(e, t) {
555
+ y((n) => ({
555
556
  ...n,
556
557
  nodes: n.nodes.map((n) => n.id === e ? t(n) : n)
557
558
  }));
558
559
  }
559
- function yr(e, t) {
560
- v((n) => ({
560
+ function Sr(e, t) {
561
+ y((n) => ({
561
562
  ...n,
562
563
  edges: n.edges.map((n) => n.id === e ? t(n) : n)
563
564
  }));
564
565
  }
565
- function br(e, t) {
566
- v((n) => {
566
+ function Cr(e, t) {
567
+ y((n) => {
567
568
  let r = n.edges.find((t) => t.id === e);
568
569
  return r ? {
569
570
  ...n,
570
- edges: n.edges.map((e) => t && e.source === r.source && e.id !== r.id && X(e, n.nodes) ? {
571
+ edges: n.edges.map((e) => t && e.source === r.source && e.id !== r.id && Q(e, n.nodes) ? {
571
572
  ...e,
572
573
  data: {
573
574
  ...e.data,
@@ -583,296 +584,296 @@ function bt({ templateId: n, activeHref: i = "/templates" }) {
583
584
  } : n;
584
585
  });
585
586
  }
586
- function xr({ edgeId: e, fieldKey: t, operator: n, value: r }) {
587
- let i = K?.schema ?? null;
588
- yr(e, (e) => {
589
- let a = Vn(i, t ?? e.data.conditionFieldKey ?? null), o = Kn(a, n ?? e.data.conditionOperator ?? null), s = qn(a, o, r ?? e.data.conditionValue ?? null), c = Yn(a, o, s);
587
+ function wr({ edgeId: e, fieldKey: t, operator: n, value: r }) {
588
+ let i = Y?.schema ?? null;
589
+ Sr(e, (e) => {
590
+ let a = Bn(i, t ?? e.data.conditionFieldKey ?? null), o = Wn(a, n ?? e.data.conditionOperator ?? null), s = Gn(a, o, r ?? e.data.conditionValue ?? null), ee = qn(a, o, s);
590
591
  return {
591
592
  ...e,
592
593
  data: {
593
594
  ...e.data,
594
- condition: Zn(a, o, s),
595
+ condition: Xn(a, o, s),
595
596
  conditionFieldKey: a?.fieldKey,
596
597
  conditionOperator: o,
597
598
  conditionValue: s,
598
599
  isDefault: !1,
599
- label: c
600
+ label: ee
600
601
  }
601
602
  };
602
603
  });
603
604
  }
604
- function Sr() {
605
- let e = Vt(_), t = In(e, Tn.current);
606
- v(e), t && U(t);
605
+ function Tr() {
606
+ let e = Vt(v), t = In(e, En.current);
607
+ y(e), t && Tn(t);
607
608
  }
608
- return /* @__PURE__ */ h(t, {
609
- activeHref: i,
609
+ return /* @__PURE__ */ g(t, {
610
+ activeHref: he,
610
611
  children: [
611
- /* @__PURE__ */ m("style", { children: We }),
612
- /* @__PURE__ */ m(ae, { children: /* @__PURE__ */ h(ye, {
613
- description: `${ve ? `草稿 v${ve.version}` : "尚未建立草稿"} ·${me?.template.currentVersionId ? " 已發布版本" : " 尚未發布"}`,
614
- onBackClick: En,
615
- title: me?.template.name ?? "流程設計器",
612
+ /* @__PURE__ */ h("style", { children: Ge }),
613
+ /* @__PURE__ */ h(ae, { children: /* @__PURE__ */ g(ye, {
614
+ description: `${De ? `草稿 v${De.version}` : "尚未建立草稿"} ·${ve?.template.currentVersionId ? " 已發布版本" : " 尚未發布"}`,
615
+ onBackClick: Dn,
616
+ title: ve?.template.name ?? "流程設計器",
616
617
  children: [
617
- /* @__PURE__ */ m(d, {
618
+ /* @__PURE__ */ h(f, {
618
619
  "aria-label": "儲存草稿",
619
- disabled: ot || !!q || !!Y,
620
+ disabled: j || !!X || !!$n,
620
621
  icon: ge,
621
622
  iconType: "icon-only",
622
- onClick: () => void rr(),
623
+ onClick: () => void or(),
623
624
  variant: "base-secondary",
624
625
  children: "儲存草稿"
625
626
  }),
626
- /* @__PURE__ */ m(d, {
627
- disabled: it || !!q || !!Y,
627
+ /* @__PURE__ */ h(f, {
628
+ disabled: st || !!X || !!$n,
628
629
  icon: pe,
629
630
  iconType: "leading",
630
- onClick: ar,
631
+ onClick: cr,
631
632
  variant: "base-secondary",
632
633
  children: "試跑流程"
633
634
  }),
634
- /* @__PURE__ */ m(d, {
635
- disabled: ot || !ve || !!q || !!Y,
635
+ /* @__PURE__ */ h(f, {
636
+ disabled: j || !De || !!X || !!$n,
636
637
  icon: de,
637
638
  iconType: "leading",
638
- onClick: () => void ir(),
639
+ onClick: () => void sr(),
639
640
  variant: "base-primary",
640
641
  children: "發布版本"
641
642
  })
642
643
  ]
643
644
  }) }),
644
- /* @__PURE__ */ m(se, { children: /* @__PURE__ */ m(oe, { children: /* @__PURE__ */ h("div", {
645
+ /* @__PURE__ */ h(se, { children: /* @__PURE__ */ h(oe, { children: /* @__PURE__ */ g("div", {
645
646
  style: Re,
646
647
  children: [
647
- rt ? /* @__PURE__ */ m(p, {
648
+ ot ? /* @__PURE__ */ h(m, {
648
649
  color: "text-error",
649
650
  variant: "body",
650
- children: rt
651
+ children: ot
651
652
  }) : null,
652
- q ? /* @__PURE__ */ m(p, {
653
+ X ? /* @__PURE__ */ h(m, {
653
654
  color: "text-error",
654
655
  variant: "body",
655
- children: q
656
+ children: X
656
657
  }) : null,
657
- Y ? /* @__PURE__ */ m(p, {
658
+ $n ? /* @__PURE__ */ h(m, {
658
659
  color: "text-error",
659
660
  variant: "body",
660
- children: Y
661
+ children: $n
661
662
  }) : null,
662
- /* @__PURE__ */ m("div", {
663
+ /* @__PURE__ */ h("div", {
663
664
  style: x,
664
- children: /* @__PURE__ */ m(o, {
665
- hintText: J ? "已設定條件分流條件。請先移除所有條件,才能更換綁定表單版本。" : void 0,
665
+ children: /* @__PURE__ */ h(s, {
666
+ hintText: Z ? "已設定條件分流條件。請先移除所有條件,才能更換綁定表單版本。" : void 0,
666
667
  label: "綁定表單版本",
667
668
  name: "formDefinitionVersionId",
668
669
  required: !0,
669
- children: /* @__PURE__ */ m(te, {
670
+ children: /* @__PURE__ */ h(te, {
670
671
  asyncData: !0,
671
- disabled: it || J,
672
+ disabled: st || Z,
672
673
  disabledOptionsFilter: !0,
673
674
  emptyText: "沒有符合的已發布表單版本",
674
- isForceClearable: !!y && !J,
675
- loading: j,
675
+ isForceClearable: !!b && !Z,
676
+ loading: ht,
676
677
  loadingText: "搜尋表單版本中...",
677
678
  mode: "single",
678
679
  onChange: (e) => {
679
- J || Ge(e?.id ?? null);
680
+ Z || Je(e?.id ?? null);
680
681
  },
681
682
  onClear: () => {
682
- J || Ge(null);
683
+ Z || Je(null);
683
684
  },
684
- onSearch: er,
685
+ onSearch: rr,
685
686
  onVisibilityChange: (e) => {
686
- e && !J && er("");
687
+ e && !Z && rr("");
687
688
  },
688
- options: [...Xn],
689
+ options: [...Zn],
689
690
  placeholder: "選擇已發布表單版本",
690
691
  searchDebounceTime: 300,
691
- value: K
692
+ value: Y
692
693
  })
693
694
  })
694
695
  }),
695
- /* @__PURE__ */ h("div", {
696
+ /* @__PURE__ */ g("div", {
696
697
  style: ze,
697
- children: [/* @__PURE__ */ m("div", {
698
- ref: Tn,
698
+ children: [/* @__PURE__ */ h("div", {
699
+ ref: En,
699
700
  style: Be,
700
- children: /* @__PURE__ */ h(Ee, {
701
+ children: /* @__PURE__ */ g(Oe, {
701
702
  connectionMode: Se.Strict,
702
- edges: Wn,
703
+ edges: Yn,
703
704
  fitView: !0,
704
- isValidConnection: (e) => an(e, _.nodes),
705
+ isValidConnection: (e) => an(e, v.nodes),
705
706
  nodeTypes: yt,
706
- nodes: Rn,
707
+ nodes: Jn,
707
708
  deleteKeyCode: null,
708
709
  multiSelectionKeyCode: [
709
710
  "Shift",
710
711
  "Meta",
711
712
  "Control"
712
713
  ],
713
- onConnect: lr,
714
- onEdgeClick: ur,
714
+ onConnect: fr,
715
+ onEdgeClick: pr,
715
716
  onNodeClick: (e, t) => {
716
717
  T(t.id), D([]);
717
718
  },
718
- onNodesChange: cr,
719
+ onNodesChange: dr,
719
720
  onPaneClick: () => {
720
721
  T(null), D([]);
721
722
  },
722
- onViewportChange: U,
723
- viewport: H,
723
+ onViewportChange: Tn,
724
+ viewport: wn,
724
725
  children: [
725
- /* @__PURE__ */ m(xe, {}),
726
- /* @__PURE__ */ m("style", { children: Je }),
727
- /* @__PURE__ */ m(we, { children: kn ? /* @__PURE__ */ m(Ce, {
726
+ /* @__PURE__ */ h(xe, {}),
727
+ /* @__PURE__ */ h("style", { children: Ye }),
728
+ /* @__PURE__ */ h(we, { children: Mn ? /* @__PURE__ */ h(Ce, {
728
729
  "aria-label": "刪除選取項目",
729
730
  className: "workflow-selection-delete-control",
730
- onClick: Mn,
731
+ onClick: Nn,
731
732
  style: Ve,
732
733
  title: "刪除選取項目",
733
- children: /* @__PURE__ */ m("span", {
734
+ children: /* @__PURE__ */ h("span", {
734
735
  style: He,
735
- children: /* @__PURE__ */ m(ne, {
736
+ children: /* @__PURE__ */ h(ne, {
736
737
  color: "error",
737
738
  icon: _e,
738
739
  size: 16
739
740
  })
740
741
  })
741
742
  }) : null }),
742
- /* @__PURE__ */ m(xt, { onApplyAutoLayout: Sr }),
743
- /* @__PURE__ */ m(Te, {})
743
+ /* @__PURE__ */ h(xt, { onApplyAutoLayout: Tr }),
744
+ /* @__PURE__ */ h(Ee, {})
744
745
  ]
745
746
  })
746
- }), /* @__PURE__ */ h("div", {
747
+ }), /* @__PURE__ */ g("div", {
747
748
  className: Ue,
748
- style: Ye,
749
+ style: Xe,
749
750
  children: [
750
- /* @__PURE__ */ m(p, {
751
+ /* @__PURE__ */ h(m, {
751
752
  component: "h2",
752
753
  variant: "h3",
753
754
  children: "流程工具"
754
755
  }),
755
- /* @__PURE__ */ h("div", {
756
- style: $e,
757
- children: [/* @__PURE__ */ m(p, {
756
+ /* @__PURE__ */ g("div", {
757
+ style: et,
758
+ children: [/* @__PURE__ */ h(m, {
758
759
  color: "text-neutral",
759
760
  variant: "caption",
760
761
  children: "動作節點"
761
- }), /* @__PURE__ */ m("div", {
762
- style: Qe,
763
- children: ct.map((e) => /* @__PURE__ */ m(d, {
762
+ }), /* @__PURE__ */ h("div", {
763
+ style: $e,
764
+ children: lt.map((e) => /* @__PURE__ */ h(f, {
764
765
  icon: e.icon,
765
766
  iconType: "leading",
766
- onClick: () => fr(e.type),
767
+ onClick: () => hr(e.type),
767
768
  size: "sub",
768
769
  variant: "base-secondary",
769
770
  children: e.label
770
771
  }, e.type))
771
772
  })]
772
773
  }),
773
- /* @__PURE__ */ h("div", {
774
- style: $e,
775
- children: [/* @__PURE__ */ m(p, {
774
+ /* @__PURE__ */ g("div", {
775
+ style: et,
776
+ children: [/* @__PURE__ */ h(m, {
776
777
  color: "text-neutral",
777
778
  variant: "caption",
778
779
  children: "流程控制"
779
- }), /* @__PURE__ */ m("div", {
780
- style: Qe,
781
- children: lt.map((e) => /* @__PURE__ */ m(d, {
780
+ }), /* @__PURE__ */ h("div", {
781
+ style: $e,
782
+ children: ut.map((e) => /* @__PURE__ */ h(f, {
782
783
  icon: e.icon,
783
784
  iconType: "leading",
784
- onClick: () => fr(e.type),
785
+ onClick: () => hr(e.type),
785
786
  size: "sub",
786
787
  variant: "base-secondary",
787
788
  children: e.label
788
789
  }, e.type))
789
790
  })]
790
791
  }),
791
- Fn.length > 1 ? kr(Fn) : null,
792
- Fn.length === 1 && Pn ? Ar(Pn) : null,
793
- Fn.length === 0 && W ? wr(W) : null
792
+ q.length > 1 ? Mr(q) : null,
793
+ q.length === 1 && Fn ? Nr(Fn) : null,
794
+ q.length === 0 && K ? Dr(K) : null
794
795
  ]
795
796
  })]
796
797
  })
797
798
  ]
798
799
  }) }) }),
799
- jr(Nn),
800
- Cr()
800
+ Pr(Pn),
801
+ Er()
801
802
  ]
802
803
  });
803
- function Cr() {
804
- return /* @__PURE__ */ m(ie, {
804
+ function Er() {
805
+ return /* @__PURE__ */ h(ie, {
805
806
  cancelText: "關閉",
806
807
  confirmText: "執行試跑",
807
- loading: Zt,
808
+ loading: nn,
808
809
  modalType: "standard",
809
- onCancel: or,
810
- onClose: or,
811
- onConfirm: () => void sr(),
812
- open: Lt,
810
+ onCancel: lr,
811
+ onClose: lr,
812
+ onConfirm: () => void ur(),
813
+ open: Zt,
813
814
  showModalFooter: !0,
814
815
  showModalHeader: !0,
815
816
  size: "wide",
816
817
  supportingText: `使用 ${vt} 與範例表單資料模擬目前畫布流程,不會建立案件。`,
817
818
  title: "試跑流程",
818
- children: /* @__PURE__ */ h("div", {
819
+ children: /* @__PURE__ */ g("div", {
819
820
  style: x,
820
821
  children: [
821
- /* @__PURE__ */ m(o, {
822
+ /* @__PURE__ */ h(s, {
822
823
  label: "表單資料 JSON",
823
824
  name: "dryRunFormDataJson",
824
825
  required: !0,
825
- children: /* @__PURE__ */ m(ce, {
826
- onChange: (e) => B(e.target.value),
826
+ children: /* @__PURE__ */ h(ce, {
827
+ onChange: (e) => cn(e.target.value),
827
828
  resize: "vertical",
828
829
  rows: 8,
829
- value: nn
830
+ value: H
830
831
  })
831
832
  }),
832
- fn ? /* @__PURE__ */ m(p, {
833
+ W ? /* @__PURE__ */ h(m, {
833
834
  color: "text-error",
834
835
  variant: "body",
835
- children: fn
836
+ children: W
836
837
  }) : null,
837
- V ? /* @__PURE__ */ h("div", {
838
- style: Xe,
838
+ U ? /* @__PURE__ */ g("div", {
839
+ style: Ze,
839
840
  children: [
840
- /* @__PURE__ */ m(p, {
841
- color: V.valid ? "text-success" : "text-error",
841
+ /* @__PURE__ */ h(m, {
842
+ color: U.valid ? "text-success" : "text-error",
842
843
  variant: "label-primary-highlight",
843
- children: V.valid ? "試跑通過" : "試跑失敗"
844
+ children: U.valid ? "試跑通過" : "試跑失敗"
844
845
  }),
845
- V.errors.map((e) => /* @__PURE__ */ m(p, {
846
+ U.errors.map((e) => /* @__PURE__ */ h(m, {
846
847
  color: "text-error",
847
848
  variant: "body",
848
849
  children: e
849
850
  }, e)),
850
- V.steps.map((e) => /* @__PURE__ */ h("div", {
851
- style: Ze,
851
+ U.steps.map((e) => /* @__PURE__ */ g("div", {
852
+ style: Qe,
852
853
  children: [
853
- /* @__PURE__ */ h(p, {
854
+ /* @__PURE__ */ g(m, {
854
855
  variant: "label-primary-highlight",
855
856
  children: [
856
857
  e.nodeLabel,
857
858
  " · ",
858
- hn(e.status)
859
+ mn(e.status)
859
860
  ]
860
861
  }),
861
- /* @__PURE__ */ h(p, {
862
+ /* @__PURE__ */ g(m, {
862
863
  color: "text-neutral",
863
864
  variant: "caption",
864
865
  children: [
865
- gn(e.nodeType),
866
+ hn(e.nodeType),
866
867
  e.assigneeMemberId ? ` · 處理者:${e.assigneeMemberId}` : "",
867
868
  e.edgeLabel ? ` · 來源線段:${e.edgeLabel}` : ""
868
869
  ]
869
870
  }),
870
- e.edgeReason ? /* @__PURE__ */ m(p, {
871
+ e.edgeReason ? /* @__PURE__ */ h(m, {
871
872
  color: "text-neutral",
872
873
  variant: "caption",
873
874
  children: e.edgeReason
874
875
  }) : null,
875
- e.entryCondition ? /* @__PURE__ */ h(p, {
876
+ e.entryCondition ? /* @__PURE__ */ g(m, {
876
877
  color: "text-neutral",
877
878
  variant: "caption",
878
879
  children: [
@@ -883,7 +884,7 @@ function bt({ templateId: n, activeHref: i = "/templates" }) {
883
884
  e.entryCondition
884
885
  ]
885
886
  }) : null,
886
- /* @__PURE__ */ m(p, {
887
+ /* @__PURE__ */ h(m, {
887
888
  color: "text-neutral",
888
889
  variant: "body",
889
890
  children: e.message
@@ -896,158 +897,158 @@ function bt({ templateId: n, activeHref: i = "/templates" }) {
896
897
  })
897
898
  });
898
899
  }
899
- function wr(e) {
900
- return /* @__PURE__ */ h("div", {
900
+ function Dr(e) {
901
+ return /* @__PURE__ */ g("div", {
901
902
  style: x,
902
903
  children: [
903
- /* @__PURE__ */ m(p, {
904
+ /* @__PURE__ */ h(m, {
904
905
  component: "h2",
905
906
  variant: "h3",
906
907
  children: "節點屬性"
907
908
  }),
908
- /* @__PURE__ */ h(p, {
909
+ /* @__PURE__ */ g(m, {
909
910
  color: "text-neutral",
910
911
  variant: "body",
911
912
  children: [
912
- st[e.type],
913
+ ct[e.type],
913
914
  " · ",
914
915
  e.id
915
916
  ]
916
917
  }),
917
- /* @__PURE__ */ m(o, {
918
+ /* @__PURE__ */ h(s, {
918
919
  label: "顯示名稱",
919
920
  name: "nodeLabel",
920
921
  required: !0,
921
- children: /* @__PURE__ */ m(re, {
922
- onChange: (e) => pr(e.target.value),
922
+ children: /* @__PURE__ */ h(re, {
923
+ onChange: (e) => gr(e.target.value),
923
924
  value: e.data.label,
924
925
  variant: "base"
925
926
  })
926
927
  }),
927
- e.type === "startEvent" ? Tr() : null,
928
- e.type === "startEvent" ? null : Er(e),
929
- e.type === "userTask" ? Dr(e) : null,
930
- e.type === "serviceTask" ? Or(e) : null
928
+ e.type === "startEvent" ? Or() : null,
929
+ e.type === "startEvent" ? null : kr(e),
930
+ e.type === "userTask" ? Ar(e) : null,
931
+ e.type === "serviceTask" ? jr(e) : null
931
932
  ]
932
933
  });
933
934
  }
934
- function Tr() {
935
- let e = G.mode === "CUSTOM" ? [...gt, _t] : [...gt], t = G.mode === "ORG_UNIT" || G.mode === "ORG_UNIT_POSITION" ? Sn(I, G.orgUnitId ?? "") : null, n = G.mode === "ORG_UNIT_POSITION" ? Cn(L, G.positionId ?? "") : null, i = G.mode === "ORG_UNIT_POSITION" ? On({
936
- includeDescendants: !!G.includeDescendants,
937
- memberships: Mt,
938
- orgUnitId: G.orgUnitId ?? "",
939
- orgUnits: I,
940
- positions: L
935
+ function Or() {
936
+ let e = J.mode === "CUSTOM" ? [...gt, _t] : [...gt], t = J.mode === "ORG_UNIT" || J.mode === "ORG_UNIT_POSITION" ? xn(L, J.orgUnitId ?? "") : null, n = J.mode === "ORG_UNIT_POSITION" ? Sn(R, J.positionId ?? "") : null, r = J.mode === "ORG_UNIT_POSITION" ? On({
937
+ includeDescendants: !!J.includeDescendants,
938
+ memberships: Lt,
939
+ orgUnitId: J.orgUnitId ?? "",
940
+ orgUnits: L,
941
+ positions: R
941
942
  }) : [];
942
- return /* @__PURE__ */ h(ue, { children: [
943
- /* @__PURE__ */ m(o, {
944
- hintText: G.mode === "CUSTOM" ? "這是舊版表達式規則;切換成標準選項後會改由 UI 管理。" : void 0,
943
+ return /* @__PURE__ */ g(ue, { children: [
944
+ /* @__PURE__ */ h(s, {
945
+ hintText: J.mode === "CUSTOM" ? "這是舊版表達式規則;切換成標準選項後會改由 UI 管理。" : void 0,
945
946
  label: "發起權限",
946
947
  name: "initiatorPolicyMode",
947
948
  required: !0,
948
- children: /* @__PURE__ */ m(f, {
949
+ children: /* @__PURE__ */ h(p, {
949
950
  clearable: !1,
950
951
  onChange: (e) => {
951
952
  if (e?.id === "CUSTOM") {
952
- et(null), C(null);
953
+ C(null), it(null);
953
954
  return;
954
955
  }
955
956
  let t = Xt(e?.id ?? null), n = rn(t);
956
- et(t === "ALL" ? null : t), C(t === "ALL" ? null : n), qe(tn(n, I));
957
+ C(t === "ALL" ? null : t), it(t === "ALL" ? null : n), tt(tn(n, L));
957
958
  },
958
959
  options: e,
959
960
  placeholder: "選擇誰可以發起",
960
- value: z(e, G.mode)
961
+ value: B(e, J.mode)
961
962
  })
962
963
  }),
963
- G.mode === "ORG_UNIT" || G.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ m(o, {
964
+ J.mode === "ORG_UNIT" || J.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(s, {
964
965
  label: "組織",
965
966
  name: "initiatorOrgUnitId",
966
967
  required: !0,
967
- children: /* @__PURE__ */ m(r, {
968
+ children: /* @__PURE__ */ h(i, {
968
969
  name: "initiatorOrgUnitId",
969
- onChange: (e) => gr({
970
- ...G,
970
+ onChange: (e) => yr({
971
+ ...J,
971
972
  orgUnitId: e?.id ?? "",
972
973
  positionId: "",
973
974
  value: e?.id ?? ""
974
975
  }),
975
- orgUnits: I,
976
+ orgUnits: L,
976
977
  placeholder: "選擇組織",
977
978
  value: t
978
979
  })
979
980
  }) : null,
980
- G.mode === "ORG_UNIT" || G.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ m(o, {
981
+ J.mode === "ORG_UNIT" || J.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(s, {
981
982
  label: "包含下層",
982
983
  name: "initiatorIncludeDescendants",
983
- children: /* @__PURE__ */ m(le, {
984
- checked: !!G.includeDescendants,
985
- onChange: (e) => gr({
986
- ...G,
984
+ children: /* @__PURE__ */ h(le, {
985
+ checked: !!J.includeDescendants,
986
+ onChange: (e) => yr({
987
+ ...J,
987
988
  includeDescendants: e.target.checked,
988
- ...G.mode === "ORG_UNIT_POSITION" ? { positionId: "" } : {}
989
+ ...J.mode === "ORG_UNIT_POSITION" ? { positionId: "" } : {}
989
990
  })
990
991
  })
991
992
  }) : null,
992
- G.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ m(o, {
993
+ J.mode === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(s, {
993
994
  label: "職位",
994
995
  name: "initiatorPositionId",
995
996
  required: !0,
996
- children: /* @__PURE__ */ m(a, {
997
- disabled: !G.orgUnitId?.trim(),
997
+ children: /* @__PURE__ */ h(o, {
998
+ disabled: !J.orgUnitId?.trim(),
998
999
  name: "initiatorPositionId",
999
- onChange: (e) => gr({
1000
- ...G,
1000
+ onChange: (e) => yr({
1001
+ ...J,
1001
1002
  positionId: e?.id ?? ""
1002
1003
  }),
1003
- placeholder: G.orgUnitId?.trim() ? "選擇職位" : "請先選擇組織",
1004
- positions: i,
1004
+ placeholder: J.orgUnitId?.trim() ? "選擇職位" : "請先選擇組織",
1005
+ positions: r,
1005
1006
  value: n
1006
1007
  })
1007
1008
  }) : null
1008
1009
  ] });
1009
1010
  }
1010
- function Er(e) {
1011
- let t = _.edges.filter((t) => t.target === e.id).length, n = t < 2, r = n ? "AND" : e.data.triggerMode ?? "AND";
1012
- return /* @__PURE__ */ m(o, {
1011
+ function kr(e) {
1012
+ let t = v.edges.filter((t) => t.target === e.id).length, n = t < 2, r = n ? "AND" : e.data.triggerMode ?? "AND";
1013
+ return /* @__PURE__ */ h(s, {
1013
1014
  hintText: n ? "需要至少兩條前置連線,才可切換為任一前置完成。" : t > 1 ? `${t} 條前置連線會依此規則觸發。` : "只有一條前置連線時,兩種設定效果相同。",
1014
1015
  label: "前置條件",
1015
1016
  name: "triggerMode",
1016
1017
  required: !0,
1017
- children: /* @__PURE__ */ m(f, {
1018
+ children: /* @__PURE__ */ h(p, {
1018
1019
  clearable: !1,
1019
- onChange: (e) => n ? void 0 : _r(Ht(e?.id ?? null)),
1020
- options: [...ut],
1020
+ onChange: (e) => n ? void 0 : br(Ht(e?.id ?? null)),
1021
+ options: [...dt],
1021
1022
  readOnly: n,
1022
- value: z(ut, r)
1023
+ value: B(dt, r)
1023
1024
  })
1024
1025
  });
1025
1026
  }
1026
- function Dr(e) {
1027
- let t = e.data.approverResolver, n = Wt(t.type), i = t.type === "DIRECT" ? xn(t.memberIds, P) : null, s = t.type === "ORG_UNIT_MANAGER" || t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? Sn(I, t.orgUnitId) : null, c = t.type === "POSITION" || t.type === "ORG_UNIT_POSITION" ? Cn(L, t.positionId) : null, l = t.type === "ORG_UNIT_POSITION" ? On({
1027
+ function Ar(e) {
1028
+ let t = e.data.approverResolver, n = Wt(t.type), r = t.type === "DIRECT" ? bn(t.memberIds, I) : null, a = t.type === "ORG_UNIT_MANAGER" || t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? xn(L, t.orgUnitId) : null, ee = t.type === "POSITION" || t.type === "ORG_UNIT_POSITION" ? Sn(R, t.positionId) : null, c = t.type === "ORG_UNIT_POSITION" ? On({
1028
1029
  includeDescendants: !!t.includeDescendants,
1029
- memberships: Mt,
1030
+ memberships: Lt,
1030
1031
  orgUnitId: t.orgUnitId,
1031
- orgUnits: I,
1032
- positions: L
1033
- }) : [], ee = t.type === "ORG_MANAGER" ? Jt(t.levelsUp) : M[0], u = t.type === "ORG_MANAGER" || t.type === "ORG_UNIT_MANAGER" ? t.fallback ?? { type: "NONE" } : { type: "NONE" }, d = u.type === "DIRECT" ? bn(P, u.memberId) : null, ne = e.data.returnBehavior.resubmitStrategy ?? "RESTART";
1034
- return /* @__PURE__ */ h(ue, { children: [
1035
- /* @__PURE__ */ m(o, {
1032
+ orgUnits: L,
1033
+ positions: R
1034
+ }) : [], l = t.type === "ORG_MANAGER" ? Jt(t.levelsUp) : M[0], u = t.type === "ORG_MANAGER" || t.type === "ORG_UNIT_MANAGER" ? t.fallback ?? { type: "NONE" } : { type: "NONE" }, d = u.type === "DIRECT" ? yn(I, u.memberId) : null, f = e.data.returnBehavior.resubmitStrategy ?? "RESTART";
1035
+ return /* @__PURE__ */ g(ue, { children: [
1036
+ /* @__PURE__ */ h(s, {
1036
1037
  label: "簽核來源",
1037
1038
  name: "approverResolverType",
1038
1039
  required: !0,
1039
- children: /* @__PURE__ */ m(f, {
1040
+ children: /* @__PURE__ */ h(p, {
1040
1041
  clearable: !1,
1041
1042
  onChange: (e) => $(Gt(e?.id ?? null)),
1042
- options: [...ft],
1043
- value: z(ft, n)
1043
+ options: [...pt],
1044
+ value: B(pt, n)
1044
1045
  })
1045
1046
  }),
1046
- t.type === "DIRECT" ? /* @__PURE__ */ m(o, {
1047
+ t.type === "DIRECT" ? /* @__PURE__ */ h(s, {
1047
1048
  label: "簽核者",
1048
1049
  name: "memberId",
1049
1050
  required: !0,
1050
- children: /* @__PURE__ */ m(te, {
1051
+ children: /* @__PURE__ */ h(te, {
1051
1052
  asyncData: !0,
1052
1053
  disabledOptionsFilter: !0,
1053
1054
  emptyText: "沒有符合的成員",
@@ -1057,29 +1058,29 @@ function bt({ templateId: n, activeHref: i = "/templates" }) {
1057
1058
  name: "workflow-approver-search",
1058
1059
  spellCheck: !1
1059
1060
  },
1060
- loading: Ct,
1061
+ loading: Tt,
1061
1062
  loadingText: "搜尋成員中...",
1062
1063
  mode: "single",
1063
1064
  onChange: (e) => $({
1064
1065
  memberIds: e?.id ? [e.id] : [],
1065
1066
  type: "DIRECT"
1066
1067
  }),
1067
- onSearch: Z,
1068
+ onSearch: ir,
1068
1069
  onVisibilityChange: (e) => {
1069
- e && Z("");
1070
+ e && ir("");
1070
1071
  },
1071
- options: [...P],
1072
+ options: [...I],
1072
1073
  placeholder: "搜尋姓名或信箱",
1073
1074
  searchDebounceTime: 300,
1074
- value: i
1075
+ value: r
1075
1076
  })
1076
1077
  }) : null,
1077
- t.type === "ORG_MANAGER" ? /* @__PURE__ */ m(o, {
1078
+ t.type === "ORG_MANAGER" ? /* @__PURE__ */ h(s, {
1078
1079
  hintText: "依發起人的有效會員歸屬與主管解析規則決定簽核人。",
1079
1080
  label: "主管層級",
1080
1081
  name: "managerLevelsUp",
1081
1082
  required: !0,
1082
- children: /* @__PURE__ */ m(f, {
1083
+ children: /* @__PURE__ */ h(p, {
1083
1084
  clearable: !1,
1084
1085
  onChange: (e) => $({
1085
1086
  baseFromInitiator: !0,
@@ -1087,15 +1088,15 @@ function bt({ templateId: n, activeHref: i = "/templates" }) {
1087
1088
  type: "ORG_MANAGER"
1088
1089
  }),
1089
1090
  options: [...M],
1090
- value: ee
1091
+ value: l
1091
1092
  })
1092
1093
  }) : null,
1093
- t.type === "ORG_UNIT_MANAGER" || t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ m(o, {
1094
+ t.type === "ORG_UNIT_MANAGER" || t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(s, {
1094
1095
  hintText: t.type === "ORG_UNIT_MANAGER" ? "依指定組織或其上層的主管解析規則決定簽核人。" : "依指定組織目前有效會員歸屬建立候選簽核人。",
1095
1096
  label: "組織",
1096
1097
  name: "orgUnitId",
1097
1098
  required: !0,
1098
- children: /* @__PURE__ */ m(r, {
1099
+ children: /* @__PURE__ */ h(i, {
1099
1100
  name: "orgUnitId",
1100
1101
  onChange: (e) => $(t.type === "ORG_UNIT_MEMBER" ? {
1101
1102
  includeDescendants: t.includeDescendants,
@@ -1111,30 +1112,30 @@ function bt({ templateId: n, activeHref: i = "/templates" }) {
1111
1112
  orgUnitId: e?.id ?? "",
1112
1113
  type: "ORG_UNIT_MANAGER"
1113
1114
  }),
1114
- orgUnits: I,
1115
+ orgUnits: L,
1115
1116
  placeholder: "選擇組織",
1116
- value: s
1117
+ value: a
1117
1118
  })
1118
1119
  }) : null,
1119
- t.type === "ORG_MANAGER" || t.type === "ORG_UNIT_MANAGER" ? /* @__PURE__ */ h(ue, { children: [/* @__PURE__ */ m(o, {
1120
+ t.type === "ORG_MANAGER" || t.type === "ORG_UNIT_MANAGER" ? /* @__PURE__ */ g(ue, { children: [/* @__PURE__ */ h(s, {
1120
1121
  hintText: "預設會停止流程並提示;若設定固定人,找不到主管時會改派給該會員。",
1121
1122
  label: "無主管時",
1122
1123
  name: "approverFallbackMode",
1123
1124
  required: !0,
1124
- children: /* @__PURE__ */ m(f, {
1125
+ children: /* @__PURE__ */ h(p, {
1125
1126
  clearable: !1,
1126
1127
  onChange: (e) => $(qt(t, Kt(e?.id ?? null) === "DIRECT" ? {
1127
1128
  memberId: "",
1128
1129
  type: "DIRECT"
1129
1130
  } : { type: "NONE" })),
1130
- options: [...pt],
1131
- value: z(pt, u.type)
1131
+ options: [...mt],
1132
+ value: B(mt, u.type)
1132
1133
  })
1133
- }), u.type === "DIRECT" ? /* @__PURE__ */ h(ue, { children: [/* @__PURE__ */ m(o, {
1134
+ }), u.type === "DIRECT" ? /* @__PURE__ */ g(ue, { children: [/* @__PURE__ */ h(s, {
1134
1135
  label: "改派人員",
1135
1136
  name: "approverFallbackMemberId",
1136
1137
  required: !0,
1137
- children: /* @__PURE__ */ m(te, {
1138
+ children: /* @__PURE__ */ h(te, {
1138
1139
  asyncData: !0,
1139
1140
  disabledOptionsFilter: !0,
1140
1141
  emptyText: "沒有符合的成員",
@@ -1144,7 +1145,7 @@ function bt({ templateId: n, activeHref: i = "/templates" }) {
1144
1145
  name: "workflow-approver-fallback-search",
1145
1146
  spellCheck: !1
1146
1147
  },
1147
- loading: Ct,
1148
+ loading: Tt,
1148
1149
  loadingText: "搜尋成員中...",
1149
1150
  mode: "single",
1150
1151
  onChange: (e) => $(qt(t, {
@@ -1152,20 +1153,20 @@ function bt({ templateId: n, activeHref: i = "/templates" }) {
1152
1153
  memberId: e?.id ?? "",
1153
1154
  type: "DIRECT"
1154
1155
  })),
1155
- onSearch: Z,
1156
+ onSearch: ir,
1156
1157
  onVisibilityChange: (e) => {
1157
- e && Z("");
1158
+ e && ir("");
1158
1159
  },
1159
- options: [...P],
1160
+ options: [...I],
1160
1161
  placeholder: "搜尋姓名或信箱",
1161
1162
  searchDebounceTime: 300,
1162
1163
  value: d
1163
1164
  })
1164
- }), /* @__PURE__ */ m(o, {
1165
+ }), /* @__PURE__ */ h(s, {
1165
1166
  hintText: "預設禁止申請人簽自己的案件;只有此流程允許自簽時才開啟。",
1166
1167
  label: "允許自簽",
1167
1168
  name: "allowInitiatorSelfApproval",
1168
- children: /* @__PURE__ */ m(le, {
1169
+ children: /* @__PURE__ */ h(le, {
1169
1170
  checked: !!u.allowInitiatorSelfApproval,
1170
1171
  onChange: (e) => $(qt(t, {
1171
1172
  allowInitiatorSelfApproval: e.target.checked,
@@ -1174,10 +1175,10 @@ function bt({ templateId: n, activeHref: i = "/templates" }) {
1174
1175
  }))
1175
1176
  })
1176
1177
  })] }) : null] }) : null,
1177
- t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ m(o, {
1178
+ t.type === "ORG_UNIT_MEMBER" || t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(s, {
1178
1179
  label: "包含下層",
1179
1180
  name: "includeDescendants",
1180
- children: /* @__PURE__ */ m(le, {
1181
+ children: /* @__PURE__ */ h(le, {
1181
1182
  checked: !!t.includeDescendants,
1182
1183
  onChange: (e) => $({
1183
1184
  ...t,
@@ -1186,28 +1187,28 @@ function bt({ templateId: n, activeHref: i = "/templates" }) {
1186
1187
  })
1187
1188
  })
1188
1189
  }) : null,
1189
- t.type === "POSITION" ? /* @__PURE__ */ m(o, {
1190
+ t.type === "POSITION" ? /* @__PURE__ */ h(s, {
1190
1191
  hintText: "指派給目前有效歸屬中擁有此職位的會員;主要歸屬優先。",
1191
1192
  label: "職位",
1192
1193
  name: "positionId",
1193
1194
  required: !0,
1194
- children: /* @__PURE__ */ m(a, {
1195
+ children: /* @__PURE__ */ h(o, {
1195
1196
  name: "positionId",
1196
1197
  onChange: (e) => $({
1197
1198
  positionId: e?.id ?? "",
1198
1199
  type: "POSITION"
1199
1200
  }),
1200
1201
  placeholder: "選擇職位",
1201
- positions: L,
1202
- value: c
1202
+ positions: R,
1203
+ value: ee
1203
1204
  })
1204
1205
  }) : null,
1205
- t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ m(o, {
1206
+ t.type === "ORG_UNIT_POSITION" ? /* @__PURE__ */ h(s, {
1206
1207
  hintText: "只納入指定組織範圍內擁有此職位的有效會員。",
1207
1208
  label: "職位",
1208
1209
  name: "orgUnitPositionId",
1209
1210
  required: !0,
1210
- children: /* @__PURE__ */ m(a, {
1211
+ children: /* @__PURE__ */ h(o, {
1211
1212
  disabled: !t.orgUnitId.trim(),
1212
1213
  name: "orgUnitPositionId",
1213
1214
  onChange: (e) => $({
@@ -1217,38 +1218,38 @@ function bt({ templateId: n, activeHref: i = "/templates" }) {
1217
1218
  type: "ORG_UNIT_POSITION"
1218
1219
  }),
1219
1220
  placeholder: t.orgUnitId.trim() ? "選擇職位" : "請先選擇組織",
1220
- positions: l,
1221
- value: c
1221
+ positions: c,
1222
+ value: ee
1222
1223
  })
1223
1224
  }) : null,
1224
- e.data.returnBehavior.allowReturn ? /* @__PURE__ */ m(o, {
1225
+ e.data.returnBehavior.allowReturn ? /* @__PURE__ */ h(s, {
1225
1226
  hintText: "退回發起人後,重新送出時要從流程開始重跑,或直接回到退回的簽核節點。",
1226
1227
  label: "重送策略",
1227
1228
  name: "returnResubmitStrategy",
1228
1229
  required: !0,
1229
- children: /* @__PURE__ */ m(f, {
1230
+ children: /* @__PURE__ */ h(p, {
1230
1231
  clearable: !1,
1231
- onChange: (e) => mr(Ut(e?.id ?? null)),
1232
- options: [...dt],
1233
- value: z(dt, ne)
1232
+ onChange: (e) => _r(Ut(e?.id ?? null)),
1233
+ options: [...ft],
1234
+ value: B(ft, f)
1234
1235
  })
1235
1236
  }) : null
1236
1237
  ] });
1237
1238
  }
1238
- function Or(e) {
1239
- let t = tr(e.data.action).map((e) => bn(P, e));
1240
- return /* @__PURE__ */ m(o, {
1239
+ function jr(e) {
1240
+ let t = tr(e.data.action).map((e) => yn(I, e));
1241
+ return /* @__PURE__ */ h(s, {
1241
1242
  label: "知會對象",
1242
1243
  name: "notifyMemberIds",
1243
1244
  required: !0,
1244
- children: /* @__PURE__ */ m(te, {
1245
+ children: /* @__PURE__ */ h(te, {
1245
1246
  asyncData: !0,
1246
1247
  disabledOptionsFilter: !0,
1247
1248
  emptyText: "沒有符合的成員",
1248
- loading: Ct,
1249
+ loading: Tt,
1249
1250
  loadingText: "搜尋成員中...",
1250
1251
  mode: "multiple",
1251
- onChange: (e) => hr({
1252
+ onChange: (e) => vr({
1252
1253
  channels: ["IN_APP"],
1253
1254
  recipients: {
1254
1255
  memberIds: e.map((e) => e.id),
@@ -1256,11 +1257,11 @@ function bt({ templateId: n, activeHref: i = "/templates" }) {
1256
1257
  },
1257
1258
  type: "NOTIFY"
1258
1259
  }),
1259
- onSearch: Z,
1260
+ onSearch: ir,
1260
1261
  onVisibilityChange: (e) => {
1261
- e && Z("");
1262
+ e && ir("");
1262
1263
  },
1263
- options: [...P],
1264
+ options: [...I],
1264
1265
  overflowStrategy: "wrap",
1265
1266
  placeholder: "搜尋姓名或信箱",
1266
1267
  searchDebounceTime: 300,
@@ -1268,14 +1269,14 @@ function bt({ templateId: n, activeHref: i = "/templates" }) {
1268
1269
  })
1269
1270
  });
1270
1271
  }
1271
- function kr(e) {
1272
- return /* @__PURE__ */ h("div", {
1272
+ function Mr(e) {
1273
+ return /* @__PURE__ */ g("div", {
1273
1274
  style: x,
1274
- children: [/* @__PURE__ */ m(p, {
1275
+ children: [/* @__PURE__ */ h(m, {
1275
1276
  component: "h2",
1276
1277
  variant: "h3",
1277
1278
  children: "已選取線段"
1278
- }), /* @__PURE__ */ h(p, {
1279
+ }), /* @__PURE__ */ g(m, {
1279
1280
  color: "text-neutral",
1280
1281
  variant: "body",
1281
1282
  children: [
@@ -1286,17 +1287,17 @@ function bt({ templateId: n, activeHref: i = "/templates" }) {
1286
1287
  })]
1287
1288
  });
1288
1289
  }
1289
- function Ar(e) {
1290
- let t = X(e, _.nodes);
1291
- return /* @__PURE__ */ h("div", {
1290
+ function Nr(e) {
1291
+ let t = Q(e, v.nodes);
1292
+ return /* @__PURE__ */ g("div", {
1292
1293
  style: x,
1293
1294
  children: [
1294
- /* @__PURE__ */ m(p, {
1295
+ /* @__PURE__ */ h(m, {
1295
1296
  component: "h2",
1296
1297
  variant: "h3",
1297
1298
  children: t ? "條件設定" : "線段屬性"
1298
1299
  }),
1299
- /* @__PURE__ */ h(p, {
1300
+ /* @__PURE__ */ g(m, {
1300
1301
  color: "text-neutral",
1301
1302
  variant: "body",
1302
1303
  children: [
@@ -1305,7 +1306,7 @@ function bt({ templateId: n, activeHref: i = "/templates" }) {
1305
1306
  e.target
1306
1307
  ]
1307
1308
  }),
1308
- t ? Mr(e) : /* @__PURE__ */ m(p, {
1309
+ t ? Fr(e) : /* @__PURE__ */ h(m, {
1309
1310
  color: "text-neutral",
1310
1311
  variant: "body",
1311
1312
  children: "這條線會直接把流程送到下一個節點。"
@@ -1313,63 +1314,63 @@ function bt({ templateId: n, activeHref: i = "/templates" }) {
1313
1314
  ]
1314
1315
  });
1315
1316
  }
1316
- function jr(e) {
1317
- return !e || !X(e, _.nodes) ? null : /* @__PURE__ */ m(ie, {
1317
+ function Pr(e) {
1318
+ return !e || !Q(e, v.nodes) ? null : /* @__PURE__ */ h(ie, {
1318
1319
  cancelText: "取消",
1319
1320
  confirmButtonProps: { disabled: !e.data.isDefault && !e.data.condition },
1320
1321
  confirmText: "完成",
1321
1322
  modalType: "standard",
1322
- onCancel: dr,
1323
- onClose: dr,
1324
- onConfirm: dr,
1325
- open: !!nt,
1323
+ onCancel: mr,
1324
+ onClose: mr,
1325
+ onConfirm: mr,
1326
+ open: !!at,
1326
1327
  showModalFooter: !0,
1327
1328
  showModalHeader: !0,
1328
1329
  size: "regular",
1329
1330
  supportingText: "條件分流的輸出連線需要指定條件,條件會直接顯示在線上。",
1330
1331
  title: "條件設定",
1331
- children: Mr(e)
1332
+ children: Fr(e)
1332
1333
  });
1333
1334
  }
1334
- function Mr(e) {
1335
- let t = $n(e, _.nodes), n = Bn(K?.schema ?? null), r = Vn(K?.schema ?? null, e.data.conditionFieldKey ?? null), i = Hn(r), a = Gn(r), s = z(i, e.data.conditionOperator ?? null);
1336
- return /* @__PURE__ */ h("div", {
1335
+ function Fr(e) {
1336
+ let t = Qn(e, v.nodes), n = zn(Y?.schema ?? null), r = Bn(Y?.schema ?? null, e.data.conditionFieldKey ?? null), i = Vn(r), a = Un(r), o = B(i, e.data.conditionOperator ?? null);
1337
+ return /* @__PURE__ */ g("div", {
1337
1338
  style: x,
1338
1339
  children: [
1339
- /* @__PURE__ */ h(p, {
1340
+ /* @__PURE__ */ g(m, {
1340
1341
  color: "text-neutral",
1341
1342
  variant: "body",
1342
1343
  children: [
1343
1344
  "畫布上的這條線目前會顯示「",
1344
- /* @__PURE__ */ m("span", {
1345
- style: { color: !e.data.isDefault && !e.data.condition ? Ke : void 0 },
1345
+ /* @__PURE__ */ h("span", {
1346
+ style: { color: !e.data.isDefault && !e.data.condition ? qe : void 0 },
1346
1347
  children: t ?? "請設定條件"
1347
1348
  }),
1348
1349
  "」。"
1349
1350
  ]
1350
1351
  }),
1351
- /* @__PURE__ */ m(le, {
1352
+ /* @__PURE__ */ h(le, {
1352
1353
  checked: !!e.data.isDefault,
1353
1354
  label: "其他情況走這條",
1354
- onChange: (t) => br(e.id, t.target.checked)
1355
+ onChange: (t) => Cr(e.id, t.target.checked)
1355
1356
  }),
1356
- e.data.isDefault ? /* @__PURE__ */ m(p, {
1357
+ e.data.isDefault ? /* @__PURE__ */ h(m, {
1357
1358
  color: "text-neutral",
1358
1359
  variant: "body",
1359
1360
  children: "其他條件都不符合時,流程會走這條線。"
1360
- }) : /* @__PURE__ */ h(ue, { children: [
1361
- K ? null : /* @__PURE__ */ m(p, {
1361
+ }) : /* @__PURE__ */ g(ue, { children: [
1362
+ Y ? null : /* @__PURE__ */ h(m, {
1362
1363
  color: "text-neutral",
1363
1364
  variant: "body",
1364
1365
  children: "請先綁定表單版本,才能選擇條件欄位。"
1365
1366
  }),
1366
- /* @__PURE__ */ m(o, {
1367
+ /* @__PURE__ */ h(s, {
1367
1368
  label: "條件欄位",
1368
1369
  name: "edgeConditionField",
1369
1370
  required: !0,
1370
- children: /* @__PURE__ */ m(f, {
1371
+ children: /* @__PURE__ */ h(p, {
1371
1372
  clearable: !1,
1372
- onChange: (t) => xr({
1373
+ onChange: (t) => wr({
1373
1374
  edgeId: e.id,
1374
1375
  fieldKey: t?.id ?? null,
1375
1376
  operator: null,
@@ -1377,40 +1378,40 @@ function bt({ templateId: n, activeHref: i = "/templates" }) {
1377
1378
  }),
1378
1379
  options: [...n],
1379
1380
  placeholder: "選擇條件欄位",
1380
- value: z(n, e.data.conditionFieldKey ?? null)
1381
+ value: B(n, e.data.conditionFieldKey ?? null)
1381
1382
  })
1382
1383
  }),
1383
- /* @__PURE__ */ m(o, {
1384
+ /* @__PURE__ */ h(s, {
1384
1385
  label: "條件判斷",
1385
1386
  name: "edgeConditionOperator",
1386
1387
  required: !0,
1387
- children: /* @__PURE__ */ m(f, {
1388
+ children: /* @__PURE__ */ h(p, {
1388
1389
  clearable: !1,
1389
- onChange: (t) => xr({
1390
+ onChange: (t) => wr({
1390
1391
  edgeId: e.id,
1391
- operator: Un(t?.id ?? null),
1392
+ operator: Hn(t?.id ?? null),
1392
1393
  value: null
1393
1394
  }),
1394
1395
  options: [...i],
1395
1396
  placeholder: "選擇判斷方式",
1396
- value: s
1397
+ value: o
1397
1398
  })
1398
1399
  }),
1399
- s && Jn(s.id) ? /* @__PURE__ */ m(o, {
1400
+ o && Kn(o.id) ? /* @__PURE__ */ h(s, {
1400
1401
  label: "條件值",
1401
1402
  name: "edgeConditionValue",
1402
1403
  required: !0,
1403
- children: a.length > 0 ? /* @__PURE__ */ m(f, {
1404
+ children: a.length > 0 ? /* @__PURE__ */ h(p, {
1404
1405
  clearable: !1,
1405
- onChange: (t) => xr({
1406
+ onChange: (t) => wr({
1406
1407
  edgeId: e.id,
1407
1408
  value: t?.id ?? null
1408
1409
  }),
1409
1410
  options: [...a],
1410
1411
  placeholder: "選擇條件值",
1411
- value: z(a, e.data.conditionValue ?? null)
1412
- }) : /* @__PURE__ */ m(re, {
1413
- onChange: (t) => xr({
1412
+ value: B(a, e.data.conditionValue ?? null)
1413
+ }) : /* @__PURE__ */ h(re, {
1414
+ onChange: (t) => wr({
1414
1415
  edgeId: e.id,
1415
1416
  value: t.target.value
1416
1417
  }),
@@ -1428,9 +1429,9 @@ function xt({ onApplyAutoLayout: e }) {
1428
1429
  function t() {
1429
1430
  e();
1430
1431
  }
1431
- return /* @__PURE__ */ m(_, {
1432
+ return /* @__PURE__ */ h(De, {
1432
1433
  position: "top-right",
1433
- children: /* @__PURE__ */ m(d, {
1434
+ children: /* @__PURE__ */ h(f, {
1434
1435
  icon: fe,
1435
1436
  iconType: "leading",
1436
1437
  onClick: t,
@@ -1440,28 +1441,28 @@ function xt({ onApplyAutoLayout: e }) {
1440
1441
  })
1441
1442
  });
1442
1443
  }
1443
- function N({ data: e, selected: t, type: n }) {
1444
+ function P({ data: e, selected: t, type: n }) {
1444
1445
  let r = e.approverLines ?? [e.approverSummary ?? e.label], i = St(e);
1445
- return /* @__PURE__ */ h("div", {
1446
+ return /* @__PURE__ */ g("div", {
1446
1447
  style: Ct(n, t),
1447
1448
  children: [
1448
- P(e),
1449
- /* @__PURE__ */ m("div", {
1450
- style: ot,
1451
- children: r.map((e, t) => /* @__PURE__ */ m(p, {
1449
+ Tt(e),
1450
+ /* @__PURE__ */ h("div", {
1451
+ style: st,
1452
+ children: r.map((e, t) => /* @__PURE__ */ h(m, {
1452
1453
  component: "span",
1453
1454
  ellipsis: !0,
1454
- style: at,
1455
+ style: k,
1455
1456
  title: e,
1456
1457
  variant: "label-primary",
1457
1458
  children: e
1458
1459
  }, `${e}_${t}`))
1459
1460
  }),
1460
- /* @__PURE__ */ m(p, {
1461
+ /* @__PURE__ */ h(m, {
1461
1462
  color: "text-neutral",
1462
1463
  component: "span",
1463
1464
  ellipsis: !0,
1464
- style: at,
1465
+ style: k,
1465
1466
  title: i,
1466
1467
  variant: "caption",
1467
1468
  children: i
@@ -1470,46 +1471,46 @@ function N({ data: e, selected: t, type: n }) {
1470
1471
  });
1471
1472
  }
1472
1473
  function St(e) {
1473
- return e.nodeKind === "startEvent" ? e.initiatorPolicySummary ?? "所有人" : e.approverSummary || e.approverLines ? e.label : e.nodeKind === "exclusiveGateway" ? "條件在線上" : e.nodeKind === "parallelGateway" ? "多條路徑同時進行" : st[e.nodeKind];
1474
+ return e.nodeKind === "startEvent" ? e.initiatorPolicySummary ?? "所有人" : e.approverSummary || e.approverLines ? e.label : e.nodeKind === "exclusiveGateway" ? "條件在線上" : e.nodeKind === "parallelGateway" ? "多條路徑同時進行" : ct[e.nodeKind];
1474
1475
  }
1475
1476
  function Ct(e, t) {
1476
1477
  let n = wt(e);
1477
1478
  return t ? {
1478
1479
  ...n,
1479
1480
  border: "1px solid var(--mzn-color-primary, #0057ff)",
1480
- boxShadow: et
1481
+ boxShadow: tt
1481
1482
  } : n;
1482
1483
  }
1483
1484
  function wt(e) {
1484
- return e === "exclusiveGateway" ? nt : e === "parallelGateway" ? O : e === "startEvent" ? k : e === "endEvent" ? it : e === "userTask" ? rt : S;
1485
+ return e === "exclusiveGateway" ? E : e === "parallelGateway" ? D : e === "startEvent" ? O : e === "endEvent" ? ot : e === "userTask" ? at : S;
1485
1486
  }
1486
- function P(e) {
1487
- return !e.hasInput && e.hasOutput ? /* @__PURE__ */ m(g, {
1487
+ function Tt(e) {
1488
+ return !e.hasInput && e.hasOutput ? /* @__PURE__ */ h(Te, {
1488
1489
  id: j,
1489
- position: v.Right,
1490
+ position: _.Right,
1490
1491
  type: "source"
1491
- }) : e.hasInput && !e.hasOutput ? /* @__PURE__ */ m(g, {
1492
+ }) : e.hasInput && !e.hasOutput ? /* @__PURE__ */ h(Te, {
1492
1493
  id: A,
1493
- position: v.Left,
1494
+ position: _.Left,
1494
1495
  type: "target"
1495
- }) : !e.hasInput && !e.hasOutput ? null : [/* @__PURE__ */ m(g, {
1496
+ }) : !e.hasInput && !e.hasOutput ? null : [/* @__PURE__ */ h(Te, {
1496
1497
  id: A,
1497
- position: v.Left,
1498
+ position: _.Left,
1498
1499
  type: "target"
1499
- }, "target"), /* @__PURE__ */ m(g, {
1500
+ }, "target"), /* @__PURE__ */ h(Te, {
1500
1501
  id: j,
1501
- position: v.Right,
1502
+ position: _.Right,
1502
1503
  type: "source"
1503
1504
  }, "source")];
1504
1505
  }
1505
- function Tt(e, t, n, r, i, a) {
1506
+ function Et(e, t, n, r, i, a) {
1506
1507
  let o = F(e);
1507
1508
  return {
1508
1509
  data: {
1509
- approverLines: Pn(e, t),
1510
- approverSummary: Mn(e, t, n, r),
1511
- hasInput: B(e),
1512
- hasOutput: V(e),
1510
+ approverLines: Nn(e, t),
1511
+ approverSummary: jn(e, t, n, r),
1512
+ hasInput: V(e),
1513
+ hasOutput: H(e),
1513
1514
  initiatorPolicySummary: e.type === "startEvent" ? nn(a, n, r) : null,
1514
1515
  label: e.data.label,
1515
1516
  nodeKind: e.type
@@ -1521,34 +1522,34 @@ function Tt(e, t, n, r, i, a) {
1521
1522
  initialWidth: o.width,
1522
1523
  position: e.position,
1523
1524
  selected: i,
1524
- sourcePosition: v.Right,
1525
- targetPosition: v.Left,
1525
+ sourcePosition: _.Right,
1526
+ targetPosition: _.Left,
1526
1527
  type: e.type,
1527
1528
  width: o.width
1528
1529
  };
1529
1530
  }
1530
1531
  function F(e) {
1531
1532
  return e.type === "exclusiveGateway" || e.type === "parallelGateway" ? {
1532
- height: T,
1533
- width: E
1533
+ height: it,
1534
+ width: w
1534
1535
  } : e.type === "serviceTask" ? {
1535
- height: tt + (Math.max(1, tr(e.data.action).length) - 1) * w,
1536
+ height: nt + (Math.max(1, tr(e.data.action).length) - 1) * rt,
1536
1537
  width: C
1537
1538
  } : {
1538
- height: tt,
1539
+ height: nt,
1539
1540
  width: C
1540
1541
  };
1541
1542
  }
1542
1543
  function I(e) {
1543
1544
  let t = F(e);
1544
- return [...B(e) ? [Et(t)] : [], ...V(e) ? [L(t)] : []];
1545
+ return [...V(e) ? [Dt(t)] : [], ...H(e) ? [L(t)] : []];
1545
1546
  }
1546
- function Et({ height: e }) {
1547
+ function Dt({ height: e }) {
1547
1548
  let t = e / 2 - 9 / 2;
1548
1549
  return {
1549
1550
  height: 9,
1550
1551
  id: A,
1551
- position: v.Left,
1552
+ position: _.Left,
1552
1553
  type: "target",
1553
1554
  width: 9,
1554
1555
  x: -9 / 2,
@@ -1560,15 +1561,15 @@ function L({ height: e, width: t }) {
1560
1561
  return {
1561
1562
  height: 9,
1562
1563
  id: j,
1563
- position: v.Right,
1564
+ position: _.Right,
1564
1565
  type: "source",
1565
1566
  width: 9,
1566
1567
  x: t - 9 / 2,
1567
1568
  y: n
1568
1569
  };
1569
1570
  }
1570
- function Dt(e, t, n) {
1571
- let r = $n(e, t), i = X(e, t), a = i && !e.data.isDefault && !e.data.condition, o = a ? Ke : i ? Ge : "#475569", s = a ? "#fef2f2" : i ? "#eff6ff" : "#ffffff", c = a ? Ke : i ? Ge : b;
1571
+ function Ot(e, t, n) {
1572
+ let r = Qn(e, t), i = Q(e, t), a = i && !e.data.isDefault && !e.data.condition, o = a ? qe : i ? Ke : "#475569", s = a ? "#fef2f2" : i ? "#eff6ff" : "#ffffff", ee = a ? qe : i ? Ke : b;
1572
1573
  return {
1573
1574
  className: n ? "workflow-edge--selected" : void 0,
1574
1575
  data: e.data,
@@ -1578,7 +1579,7 @@ function Dt(e, t, n) {
1578
1579
  labelBgPadding: [8, 4],
1579
1580
  labelBgStyle: {
1580
1581
  fill: s,
1581
- stroke: c,
1582
+ stroke: ee,
1582
1583
  strokeWidth: 1
1583
1584
  },
1584
1585
  labelShowBg: !!r,
@@ -1591,7 +1592,7 @@ function Dt(e, t, n) {
1591
1592
  source: e.source,
1592
1593
  sourceHandle: e.sourceHandle,
1593
1594
  style: {
1594
- filter: n ? qe : void 0,
1595
+ filter: n ? Je : void 0,
1595
1596
  opacity: 1,
1596
1597
  stroke: b,
1597
1598
  strokeOpacity: 1,
@@ -1602,7 +1603,7 @@ function Dt(e, t, n) {
1602
1603
  type: e.type ?? "smoothstep"
1603
1604
  };
1604
1605
  }
1605
- function Ot(e, t) {
1606
+ function kt(e, t) {
1606
1607
  return e.type === "startEvent" || e.type === "endEvent" || e.type === "userTask" || e.type === "serviceTask" || e.type, {
1607
1608
  ...e,
1608
1609
  data: {
@@ -1611,7 +1612,7 @@ function Ot(e, t) {
1611
1612
  }
1612
1613
  };
1613
1614
  }
1614
- function kt(e, t) {
1615
+ function At(e, t) {
1615
1616
  return e.type === "startEvent" ? e : (e.type === "endEvent" || e.type === "userTask" || e.type === "serviceTask" || e.type, {
1616
1617
  ...e,
1617
1618
  data: {
@@ -1620,21 +1621,21 @@ function kt(e, t) {
1620
1621
  }
1621
1622
  });
1622
1623
  }
1623
- function At(e) {
1624
- return Mt(jt(e));
1625
- }
1626
1624
  function jt(e) {
1625
+ return R(Mt(e));
1626
+ }
1627
+ function Mt(e) {
1627
1628
  let t = new Set(e.nodes.filter((e) => cn(e)).map((e) => e.id)), n = e.edges.filter((e) => !t.has(e.source));
1628
1629
  return n.length === e.edges.length ? e : {
1629
1630
  ...e,
1630
1631
  edges: n
1631
1632
  };
1632
1633
  }
1633
- function Mt(e) {
1634
+ function R(e) {
1634
1635
  let t = e.edges.reduce((e, t) => ({
1635
1636
  ...e,
1636
1637
  [t.target]: (e[t.target] ?? 0) + 1
1637
- }), {}), n = e.nodes.map((e) => e.type === "startEvent" ? e : (t[e.id] ?? 0) < 2 && e.data.triggerMode !== "AND" ? kt(e, "AND") : e);
1638
+ }), {}), n = e.nodes.map((e) => e.type === "startEvent" ? e : (t[e.id] ?? 0) < 2 && e.data.triggerMode !== "AND" ? At(e, "AND") : e);
1638
1639
  return n.some((t, n) => t !== e.nodes[n]) ? {
1639
1640
  ...e,
1640
1641
  nodes: n
@@ -1710,14 +1711,14 @@ function Ft({ definition: e, node: t, selectedEdgeId: n, selectedNodeId: r }) {
1710
1711
  };
1711
1712
  }
1712
1713
  function It(e, t, n) {
1713
- if (!B(t)) return {
1714
+ if (!V(t)) return {
1714
1715
  definition: e,
1715
1716
  editingEdgeId: null,
1716
1717
  selectedEdgeIds: [n.id],
1717
1718
  selectedNodeId: null
1718
1719
  };
1719
- if (!V(t)) {
1720
- let r = R(n.source, t.id, {});
1720
+ if (!H(t)) {
1721
+ let r = z(n.source, t.id, {});
1721
1722
  return {
1722
1723
  definition: {
1723
1724
  ...e,
@@ -1729,7 +1730,7 @@ function It(e, t, n) {
1729
1730
  selectedNodeId: t.id
1730
1731
  };
1731
1732
  }
1732
- let r = R(n.source, t.id, n.data), i = R(t.id, n.target, Rt(t, n)), a = X(i, [...e.nodes, t]);
1733
+ let r = z(n.source, t.id, n.data), i = z(t.id, n.target, Rt(t, n)), a = Q(i, [...e.nodes, t]);
1733
1734
  return {
1734
1735
  definition: {
1735
1736
  ...e,
@@ -1742,7 +1743,7 @@ function It(e, t, n) {
1742
1743
  };
1743
1744
  }
1744
1745
  function Lt(e, t, n) {
1745
- if (!V(n)) return {
1746
+ if (!H(n)) return {
1746
1747
  definition: {
1747
1748
  ...e,
1748
1749
  nodes: [...e.nodes, t]
@@ -1752,10 +1753,10 @@ function Lt(e, t, n) {
1752
1753
  selectedNodeId: t.id
1753
1754
  };
1754
1755
  let r = e.edges.find((e) => e.source === n.id) ?? null;
1755
- if (r && V(t)) return It(e, t, r);
1756
+ if (r && H(t)) return It(e, t, r);
1756
1757
  let i = e.nodes.find((e) => e.type === "endEvent");
1757
- if (i && n.id !== i.id && V(t)) {
1758
- let r = R(n.id, t.id, {}), a = R(t.id, i.id, Rt(t, r)), o = X(a, [...e.nodes, t]);
1758
+ if (i && n.id !== i.id && H(t)) {
1759
+ let r = z(n.id, t.id, {}), a = z(t.id, i.id, Rt(t, r)), o = Q(a, [...e.nodes, t]);
1759
1760
  return {
1760
1761
  definition: {
1761
1762
  ...e,
@@ -1771,7 +1772,7 @@ function Lt(e, t, n) {
1771
1772
  selectedNodeId: o ? null : t.id
1772
1773
  };
1773
1774
  }
1774
- let a = R(n.id, t.id, {});
1775
+ let a = z(n.id, t.id, {});
1775
1776
  return {
1776
1777
  definition: {
1777
1778
  ...e,
@@ -1783,7 +1784,7 @@ function Lt(e, t, n) {
1783
1784
  selectedNodeId: t.id
1784
1785
  };
1785
1786
  }
1786
- function R(e, t, n) {
1787
+ function z(e, t, n) {
1787
1788
  return {
1788
1789
  data: n,
1789
1790
  id: `edge_${e}_${t}_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`,
@@ -1831,7 +1832,7 @@ function Bt(e) {
1831
1832
  return e.edges.length === 0 && e.nodes.length === 2 && e.nodes.some((e) => e.type === "startEvent") && e.nodes.some((e) => e.type === "endEvent");
1832
1833
  }
1833
1834
  function Vt(e) {
1834
- let t = new ke.graphlib.Graph();
1835
+ let t = new y.graphlib.Graph();
1835
1836
  return t.setDefaultEdgeLabel(() => ({})), t.setGraph({
1836
1837
  rankdir: "LR",
1837
1838
  ranksep: 120
@@ -1839,7 +1840,7 @@ function Vt(e) {
1839
1840
  t.setNode(e.id, F(e));
1840
1841
  }), e.edges.forEach((e) => {
1841
1842
  t.setEdge(e.source, e.target);
1842
- }), ke.layout(t), {
1843
+ }), y.layout(t), {
1843
1844
  ...e,
1844
1845
  nodes: e.nodes.map((e) => {
1845
1846
  let n = t.node(e.id);
@@ -1853,7 +1854,7 @@ function Vt(e) {
1853
1854
  })
1854
1855
  };
1855
1856
  }
1856
- function z(e, t) {
1857
+ function B(e, t) {
1857
1858
  return t ? e.find((e) => e.id === t) ?? null : null;
1858
1859
  }
1859
1860
  function Ht(e) {
@@ -1949,13 +1950,13 @@ function tn(e, t) {
1949
1950
  if (e.mode === "ALL" || e.mode === "NONE") return null;
1950
1951
  let n = e.orgUnitId?.trim() ?? "";
1951
1952
  if (!n) return null;
1952
- let r = kn(t, n, !!e.includeDescendants).map((e) => `${JSON.stringify(e)} in subject.orgUnitIds`).join(" || ");
1953
+ let r = K(t, n, !!e.includeDescendants).map((e) => `${JSON.stringify(e)} in subject.orgUnitIds`).join(" || ");
1953
1954
  if (e.mode === "ORG_UNIT") return r ? `(${r})` : null;
1954
1955
  let i = e.positionId?.trim() ?? "";
1955
1956
  return i && r ? `(${r}) && ${JSON.stringify(i)} in subject.positionIds` : null;
1956
1957
  }
1957
1958
  function nn(e, t, n) {
1958
- return e.mode === "NONE" ? "未設定" : e.mode === "ORG_UNIT" ? e.orgUnitId ? `組織:${H(t, e.orgUnitId)}` : "指定組織" : e.mode === "ORG_UNIT_POSITION" ? e.orgUnitId && e.positionId ? `組織職位:${H(t, e.orgUnitId)} / ${U(n, e.positionId)}` : "指定組織職位" : e.mode === "CUSTOM" ? "既有自訂規則" : "所有人";
1959
+ return e.mode === "NONE" ? "未設定" : e.mode === "ORG_UNIT" ? e.orgUnitId ? `組織:${W(t, e.orgUnitId)}` : "指定組織" : e.mode === "ORG_UNIT_POSITION" ? e.orgUnitId && e.positionId ? `組織職位:${W(t, e.orgUnitId)} / ${G(n, e.positionId)}` : "指定組織職位" : e.mode === "CUSTOM" ? "既有自訂規則" : "所有人";
1959
1960
  }
1960
1961
  function rn(e) {
1961
1962
  return {
@@ -1968,7 +1969,7 @@ function rn(e) {
1968
1969
  }
1969
1970
  function an(e, t) {
1970
1971
  let n = e.source ? t.find((t) => t.id === e.source) ?? null : null, r = e.target ? t.find((t) => t.id === e.target) ?? null : null;
1971
- return !!n && !!r && e.source !== e.target && e.sourceHandle === j && e.targetHandle === A && !!(n && V(n)) && !!(r && B(r));
1972
+ return !!n && !!r && e.source !== e.target && e.sourceHandle === j && e.targetHandle === A && !!(n && H(n)) && !!(r && V(r));
1972
1973
  }
1973
1974
  function on(e, t) {
1974
1975
  return e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
@@ -1976,10 +1977,10 @@ function on(e, t) {
1976
1977
  function sn(e) {
1977
1978
  return e.type !== "startEvent" && e.type !== "endEvent";
1978
1979
  }
1979
- function B(e) {
1980
+ function V(e) {
1980
1981
  return e.type !== "startEvent";
1981
1982
  }
1982
- function V(e) {
1983
+ function H(e) {
1983
1984
  return e.type !== "endEvent" && !cn(e);
1984
1985
  }
1985
1986
  function cn(e) {
@@ -1998,39 +1999,39 @@ function un(e) {
1998
1999
  function dn(e) {
1999
2000
  return (e?.schema.fields ?? []).reduce((e, t) => ({
2000
2001
  ...e,
2001
- [t.fieldKey]: fn(t)
2002
+ [t.fieldKey]: U(t)
2002
2003
  }), {});
2003
2004
  }
2004
- function fn(e) {
2005
+ function U(e) {
2005
2006
  return e.type === "number" ? 1e3 : e.type === "boolean" ? !0 : e.type === "select" ? e.options[0]?.value ?? "" : e.type === "checkbox" ? e.options[0] ? [e.options[0].value] : [] : e.type === "date" ? "2026-05-08" : e.type === "datetime" ? "2026-05-08T09:00:00+08:00" : e.placeholder ?? e.label;
2006
2007
  }
2007
- function pn(e) {
2008
+ function fn(e) {
2008
2009
  let t = JSON.parse(e);
2009
- if (!mn(t)) throw Error("表單資料 JSON 必須是物件。");
2010
+ if (!pn(t)) throw Error("表單資料 JSON 必須是物件。");
2010
2011
  return t;
2011
2012
  }
2012
- function mn(e) {
2013
+ function pn(e) {
2013
2014
  return typeof e == "object" && !!e && !Array.isArray(e);
2014
2015
  }
2015
- function hn(e) {
2016
+ function mn(e) {
2016
2017
  return e === "COMPLETED" ? "完成" : e === "PASSED" ? "通過" : e === "SKIPPED" ? "略過" : e === "STOPPED" ? "已停止" : e === "WAITING" ? "將等待簽核" : e;
2017
2018
  }
2018
- function gn(e) {
2019
- return e in st ? st[e] : e;
2019
+ function hn(e) {
2020
+ return e in ct ? ct[e] : e;
2020
2021
  }
2021
- function _n(e, t) {
2022
+ function gn(e, t) {
2022
2023
  return t && !e.some((e) => e.id === t.id) ? [t, ...e] : e;
2023
2024
  }
2024
- function vn(e) {
2025
+ function _n(e) {
2025
2026
  return e.map((e) => ({
2026
2027
  displayName: e.name,
2027
2028
  email: e.email,
2028
2029
  id: e.memberId,
2029
2030
  memberId: e.memberId,
2030
- name: G(e.name, e.email)
2031
+ name: Fn(e.name, e.email)
2031
2032
  }));
2032
2033
  }
2033
- function yn(e) {
2034
+ function vn(e) {
2034
2035
  return {
2035
2036
  displayName: "未知會員",
2036
2037
  email: "",
@@ -2039,29 +2040,29 @@ function yn(e) {
2039
2040
  name: "未知會員"
2040
2041
  };
2041
2042
  }
2043
+ function yn(e, t) {
2044
+ return e.find((e) => e.memberId === t) ?? vn(t);
2045
+ }
2042
2046
  function bn(e, t) {
2043
- return e.find((e) => e.memberId === t) ?? yn(t);
2047
+ let n = e[0];
2048
+ return n ? yn(t, n) : null;
2044
2049
  }
2045
2050
  function xn(e, t) {
2046
- let n = e[0];
2047
- return n ? bn(t, n) : null;
2051
+ let n = e.find((e) => e.id === t);
2052
+ return n ? r(n) : null;
2048
2053
  }
2049
2054
  function Sn(e, t) {
2050
- let r = e.find((e) => e.id === t);
2051
- return r ? n(r) : null;
2052
- }
2053
- function Cn(e, t) {
2054
2055
  let n = e.find((e) => e.id === t);
2055
- return n ? i(n) : null;
2056
+ return n ? a(n) : null;
2056
2057
  }
2057
- function H(e, t) {
2058
- return Sn(e, t)?.name ?? "未指定組織";
2058
+ function W(e, t) {
2059
+ return xn(e, t)?.name ?? "未指定組織";
2059
2060
  }
2060
- function U(e, t) {
2061
- return Cn(e, t)?.name ?? "未指定職位";
2061
+ function G(e, t) {
2062
+ return Sn(e, t)?.name ?? "未指定職位";
2062
2063
  }
2063
- function wn(e, t) {
2064
- let n = Tn(), r = t.filter((t) => t.memberId === e && En(t, n)), i = r.reduce((e, t) => e && W(e, t) <= 0 ? e : t, null);
2064
+ function Cn(e, t) {
2065
+ let n = wn(), r = t.filter((t) => t.memberId === e && Tn(t, n)), i = r.reduce((e, t) => e && En(e, t) <= 0 ? e : t, null);
2065
2066
  return {
2066
2067
  customFields: {},
2067
2068
  managerMemberId: "member-002",
@@ -2074,49 +2075,49 @@ function wn(e, t) {
2074
2075
  roles: ["manager"]
2075
2076
  };
2076
2077
  }
2077
- function Tn() {
2078
+ function wn() {
2078
2079
  return (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
2079
2080
  }
2080
- function En(e, t) {
2081
+ function Tn(e, t) {
2081
2082
  return e.effectiveFrom <= t && (!e.effectiveTo || e.effectiveTo >= t);
2082
2083
  }
2083
- function W(e, t) {
2084
+ function En(e, t) {
2084
2085
  return e.isPrimary === t.isPrimary ? t.effectiveFrom.localeCompare(e.effectiveFrom) : e.isPrimary ? -1 : 1;
2085
2086
  }
2086
2087
  function Dn(e) {
2087
2088
  return e.reduce((e, t) => t && !e.includes(t) ? [...e, t] : e, []);
2088
2089
  }
2089
2090
  function On({ includeDescendants: e, memberships: t, orgUnitId: n, orgUnits: r, positions: i }) {
2090
- let a = new Set(kn(r, n, e)), o = new Set(t.filter((e) => a.has(e.orgUnitId)).map((e) => e.positionId).filter((e) => !!e));
2091
+ let a = new Set(K(r, n, e)), o = new Set(t.filter((e) => a.has(e.orgUnitId)).map((e) => e.positionId).filter((e) => !!e));
2091
2092
  return i.filter((e) => o.has(e.id));
2092
2093
  }
2093
- function kn(e, t, n) {
2094
+ function K(e, t, n) {
2094
2095
  let r = e.find((e) => e.id === t);
2095
2096
  return r ? n ? e.filter((e) => e.id === r.id || e.path.startsWith(`${r.path}.`)).map((e) => e.id) : [r.id] : t.trim() ? [t] : [];
2096
2097
  }
2097
- function An(e, t) {
2098
+ function kn(e, t) {
2098
2099
  let n = new Set(e.map((e) => e.memberId)), r = t.filter((e) => !n.has(e.memberId));
2099
2100
  return [...e, ...r];
2100
2101
  }
2101
- function jn(e) {
2102
+ function An(e) {
2102
2103
  return [...new Set(e.nodes.flatMap((e) => e.type === "userTask" ? e.data.approverResolver.type === "DIRECT" ? e.data.approverResolver.memberIds : [] : e.type === "serviceTask" ? tr(e.data.action) : []))];
2103
2104
  }
2104
- function Mn(e, t, n, r) {
2105
- return e.type === "userTask" ? Nn(e.data.approverResolver, t, n, r) : null;
2105
+ function jn(e, t, n, r) {
2106
+ return e.type === "userTask" ? Mn(e.data.approverResolver, t, n, r) : null;
2106
2107
  }
2107
- function Nn(e, t, n, r) {
2108
- return e.type === "DIRECT" ? Fn(e.memberIds, t, "未指定簽核者") : e.type === "ORG_MANAGER" ? Jt(e.levelsUp).name : e.type === "ORG_UNIT_MANAGER" ? `組織主管:${H(n, e.orgUnitId)}` : e.type === "ORG_UNIT_MEMBER" ? `組織任一人:${H(n, e.orgUnitId)}` : e.type === "ORG_UNIT_POSITION" ? `組織職位:${H(n, e.orgUnitId)} / ${U(r, e.positionId)}` : e.type === "POSITION" ? `職位:${U(r, e.positionId)}` : e.type === "DYNAMIC_FORM" ? `表單欄位:${e.formPath || "未設定"}` : "自訂表達式";
2108
+ function Mn(e, t, n, r) {
2109
+ return e.type === "DIRECT" ? Pn(e.memberIds, t, "未指定簽核者") : e.type === "ORG_MANAGER" ? Jt(e.levelsUp).name : e.type === "ORG_UNIT_MANAGER" ? `組織主管:${W(n, e.orgUnitId)}` : e.type === "ORG_UNIT_MEMBER" ? `組織任一人:${W(n, e.orgUnitId)}` : e.type === "ORG_UNIT_POSITION" ? `組織職位:${W(n, e.orgUnitId)} / ${G(r, e.positionId)}` : e.type === "POSITION" ? `職位:${G(r, e.positionId)}` : e.type === "DYNAMIC_FORM" ? `表單欄位:${e.formPath || "未設定"}` : "自訂表達式";
2109
2110
  }
2110
- function Pn(e, t) {
2111
+ function Nn(e, t) {
2111
2112
  if (e.type !== "serviceTask") return null;
2112
2113
  let n = tr(e.data.action);
2113
- return n.length === 0 ? ["未指定知會對象"] : n.map((e) => bn(t, e).name);
2114
+ return n.length === 0 ? ["未指定知會對象"] : n.map((e) => yn(t, e).name);
2114
2115
  }
2115
- function Fn(e, t, n) {
2116
- let r = e.map((e) => bn(t, e).name);
2116
+ function Pn(e, t, n) {
2117
+ let r = e.map((e) => yn(t, e).name);
2117
2118
  return r.length === 0 ? n : r.length <= 2 ? r.join("、") : `${r.slice(0, 2).join("、")} 等 ${r.length} 人`;
2118
2119
  }
2119
- function G(e, t) {
2120
+ function Fn(e, t) {
2120
2121
  return `${e} (${t})`;
2121
2122
  }
2122
2123
  function In(e, t) {
@@ -2136,7 +2137,7 @@ function In(e, t) {
2136
2137
  minX: Infinity,
2137
2138
  minY: Infinity
2138
2139
  });
2139
- return Oe({
2140
+ return v({
2140
2141
  height: r.maxY - r.minY,
2141
2142
  width: r.maxX - r.minX,
2142
2143
  x: r.minX,
@@ -2144,34 +2145,34 @@ function In(e, t) {
2144
2145
  }, n.width, n.height, .1, 1, .2);
2145
2146
  }
2146
2147
  function Ln(e) {
2147
- let t = e.nodes.find((e) => e.type === "userTask" && !!Rn(e.data.approverResolver)), n = e.nodes.find((e) => e.type === "serviceTask" && e.data.action.type === "NOTIFY" && tr(e.data.action).length === 0), r = e.edges.find((t) => X(t, e.nodes) && !t.data.isDefault && !t.data.condition);
2148
- return t && t.type === "userTask" ? Rn(t.data.approverResolver) : n ? "知會節點需要至少一位知會對象。" : r ? "條件分流的每條輸出連線都需要先設定條件。" : null;
2148
+ let t = e.nodes.find((e) => e.type === "userTask" && !!q(e.data.approverResolver)), n = e.nodes.find((e) => e.type === "serviceTask" && e.data.action.type === "NOTIFY" && tr(e.data.action).length === 0), r = e.edges.find((t) => Q(t, e.nodes) && !t.data.isDefault && !t.data.condition);
2149
+ return t && t.type === "userTask" ? q(t.data.approverResolver) : n ? "知會節點需要至少一位知會對象。" : r ? "條件分流的每條輸出連線都需要先設定條件。" : null;
2149
2150
  }
2150
- function Rn(e) {
2151
+ function q(e) {
2151
2152
  return e.type === "DIRECT" && e.memberIds.length === 0 ? "簽核節點需要指定簽核會員。" : e.type === "ORG_MANAGER" && e.levelsUp < 1 ? "簽核節點需要指定有效的主管層級。" : e.type === "ORG_UNIT_MANAGER" && !e.orgUnitId.trim() || e.type === "ORG_UNIT_MEMBER" && !e.orgUnitId.trim() ? "簽核節點需要指定組織。" : e.type === "ORG_UNIT_POSITION" && (!e.orgUnitId.trim() || !e.positionId.trim()) ? "簽核節點需要指定組織與職位。" : (e.type === "ORG_MANAGER" || e.type === "ORG_UNIT_MANAGER") && e.fallback?.type === "DIRECT" && !e.fallback.memberId.trim() ? "簽核節點需要指定改派固定人。" : e.type === "POSITION" && !e.positionId.trim() ? "簽核節點需要指定職位。" : null;
2152
2153
  }
2153
- function zn(e) {
2154
- return e.edges.some((t) => X(t, e.nodes) && !!(t.data.condition || t.data.conditionFieldKey || t.data.conditionOperator || t.data.conditionValue));
2154
+ function Rn(e) {
2155
+ return e.edges.some((t) => Q(t, e.nodes) && !!(t.data.condition || t.data.conditionFieldKey || t.data.conditionOperator || t.data.conditionValue));
2155
2156
  }
2156
- function Bn(e) {
2157
+ function zn(e) {
2157
2158
  return e?.fields.map((e) => ({
2158
2159
  fieldType: e.type,
2159
2160
  id: e.fieldKey,
2160
2161
  name: `${e.label} (${e.fieldKey})`
2161
2162
  })) ?? [];
2162
2163
  }
2163
- function Vn(e, t) {
2164
+ function Bn(e, t) {
2164
2165
  return t ? e?.fields.find((e) => e.fieldKey === t) ?? null : null;
2165
2166
  }
2166
- function Hn(e) {
2167
+ function Vn(e) {
2167
2168
  if (!e) return [];
2168
- let t = Wn(e);
2169
- return mt.filter((e) => t.includes(e.id));
2169
+ let t = J(e);
2170
+ return N.filter((e) => t.includes(e.id));
2170
2171
  }
2171
- function Un(e) {
2172
- return mt.some((t) => t.id === e) ? e : null;
2172
+ function Hn(e) {
2173
+ return N.some((t) => t.id === e) ? e : null;
2173
2174
  }
2174
- function Wn(e) {
2175
+ function J(e) {
2175
2176
  return e.type === "file_upload" ? ["IS_FILLED", "IS_EMPTY"] : e.type === "boolean" ? [
2176
2177
  "EQUALS",
2177
2178
  "NOT_EQUALS",
@@ -2193,7 +2194,7 @@ function Wn(e) {
2193
2194
  "IS_EMPTY"
2194
2195
  ];
2195
2196
  }
2196
- function Gn(e) {
2197
+ function Un(e) {
2197
2198
  return e ? e.type === "boolean" ? [{
2198
2199
  id: "true",
2199
2200
  name: "是"
@@ -2205,68 +2206,68 @@ function Gn(e) {
2205
2206
  name: e.label
2206
2207
  })) : [] : [];
2207
2208
  }
2208
- function Kn(e, t) {
2209
+ function Wn(e, t) {
2209
2210
  if (!e) return;
2210
- let n = Wn(e);
2211
+ let n = J(e);
2211
2212
  return t && n.includes(t) ? t : n[0];
2212
2213
  }
2213
- function qn(e, t, n) {
2214
- if (!e || !t || !Jn(t)) return;
2215
- let r = Gn(e);
2214
+ function Gn(e, t, n) {
2215
+ if (!e || !t || !Kn(t)) return;
2216
+ let r = Un(e);
2216
2217
  return r.length === 0 || r.some((e) => e.id === n) ? n ?? void 0 : r[0]?.id;
2217
2218
  }
2218
- function Jn(e) {
2219
+ function Kn(e) {
2219
2220
  return ht.includes(e);
2220
2221
  }
2221
- function Yn(e, t, n) {
2222
+ function qn(e, t, n) {
2222
2223
  if (!e || !t) return;
2223
- let r = K(t);
2224
- if (!Jn(t)) return `${e.label} ${r}`;
2225
- if (n) return `${e.label} ${r} ${Xn(e, n)}`;
2224
+ let r = Jn(t);
2225
+ if (!Kn(t)) return `${e.label} ${r}`;
2226
+ if (n) return `${e.label} ${r} ${Yn(e, n)}`;
2226
2227
  }
2227
- function K(e) {
2228
- return mt.find((t) => t.id === e)?.name ?? e;
2228
+ function Jn(e) {
2229
+ return N.find((t) => t.id === e)?.name ?? e;
2229
2230
  }
2230
- function Xn(e, t) {
2231
- return e.type === "boolean" ? t === "true" ? "是" : "否" : e.type === "checkbox" || e.type === "radio" || e.type === "select" ? q(e.options, t)?.label ?? t : t;
2231
+ function Yn(e, t) {
2232
+ return e.type === "boolean" ? t === "true" ? "是" : "否" : e.type === "checkbox" || e.type === "radio" || e.type === "select" ? Y(e.options, t)?.label ?? t : t;
2232
2233
  }
2233
- function q(e, t) {
2234
+ function Y(e, t) {
2234
2235
  return e.find((e) => e.value === t) ?? null;
2235
2236
  }
2236
- function Zn(e, t, n) {
2237
+ function Xn(e, t, n) {
2237
2238
  if (!e || !t) return;
2238
- let r = J(e.fieldKey);
2239
+ let r = Zn(e.fieldKey);
2239
2240
  if (t === "IS_FILLED") return `${r} != null && ${r} != ""`;
2240
2241
  if (t === "IS_EMPTY") return `${r} == null || ${r} == ""`;
2241
- if (n) return `${r} ${Y(t)} ${Qn(e, n)}`;
2242
+ if (n) return `${r} ${X(t)} ${Z(e, n)}`;
2242
2243
  }
2243
- function J(e) {
2244
+ function Zn(e) {
2244
2245
  return /^[A-Za-z_][A-Za-z0-9_]*$/u.test(e) ? `form.${e}` : `form[${JSON.stringify(e)}]`;
2245
2246
  }
2246
- function Y(e) {
2247
+ function X(e) {
2247
2248
  return e === "EQUALS" ? "==" : e === "NOT_EQUALS" ? "!=" : e === "GREATER_THAN" ? ">" : e === "GREATER_THAN_OR_EQUALS" ? ">=" : e === "LESS_THAN" ? "<" : "<=";
2248
2249
  }
2249
- function Qn(e, t) {
2250
+ function Z(e, t) {
2250
2251
  return e.type === "boolean" ? t === "true" ? "true" : "false" : (e.type === "money" || e.type === "number") && Number.isFinite(Number(t)) ? t : JSON.stringify(t);
2251
2252
  }
2252
- function $n(e, t) {
2253
+ function Qn(e, t) {
2253
2254
  if (e.data.label) return e.data.label;
2254
- if (X(e, t)) return er(e);
2255
- if (Z(e, t)) return "同時進行";
2255
+ if (Q(e, t)) return $n(e);
2256
+ if (er(e, t)) return "同時進行";
2256
2257
  }
2257
- function er(e) {
2258
+ function $n(e) {
2258
2259
  return e.data.isDefault ? "其他情況" : "請設定條件";
2259
2260
  }
2260
- function X(e, t) {
2261
+ function Q(e, t) {
2261
2262
  return t.some((t) => t.id === e.source && t.type === "exclusiveGateway");
2262
2263
  }
2263
- function Z(e, t) {
2264
+ function er(e, t) {
2264
2265
  return t.some((t) => t.id === e.source && t.type === "parallelGateway");
2265
2266
  }
2266
2267
  function tr(e) {
2267
2268
  return e.type === "NOTIFY" && e.recipients.type === "DIRECT" ? e.recipients.memberIds : [];
2268
2269
  }
2269
- function Q(e) {
2270
+ function nr(e) {
2270
2271
  return e instanceof Error ? e.message : "發生未知錯誤";
2271
2272
  }
2272
2273
  //#endregion