@rytass/bpm-core-react 0.3.1 → 0.3.2

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 (175) hide show
  1. package/CHANGELOG.md +131 -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/index.cjs +1 -1
  57. package/dist/index.cjs.map +1 -1
  58. package/dist/index.d.ts +1 -0
  59. package/dist/index.js +101 -99
  60. package/dist/index.js.map +1 -1
  61. package/dist/lib/routes-config.d.ts +96 -0
  62. package/dist/next/index.cjs +1 -1
  63. package/dist/next/index.cjs.map +1 -1
  64. package/dist/next/index.d.ts +1 -0
  65. package/dist/next/index.js +22 -21
  66. package/dist/next/index.js.map +1 -1
  67. package/dist/pages/admin/delegations/index.cjs +1 -1
  68. package/dist/pages/admin/delegations/index.js +1 -1
  69. package/dist/pages/admin/orgs/index.cjs +1 -1
  70. package/dist/pages/admin/orgs/index.js +1 -1
  71. package/dist/pages/admin/users/index.cjs +1 -1
  72. package/dist/pages/admin/users/index.js +1 -1
  73. package/dist/pages/delegations/index.cjs +1 -1
  74. package/dist/pages/delegations/index.js +1 -1
  75. package/dist/pages/forms/builder/index.cjs +1 -1
  76. package/dist/pages/forms/builder/index.js +1 -1
  77. package/dist/pages/instances/detail/index.cjs +1 -1
  78. package/dist/pages/instances/detail/index.js +1 -1
  79. package/dist/pages/settings/notifications/index.cjs +1 -1
  80. package/dist/pages/settings/notifications/index.js +1 -1
  81. package/dist/pages/templates/categories/index.cjs +1 -1
  82. package/dist/pages/templates/categories/index.js +1 -1
  83. package/dist/pages/templates/index.cjs +1 -1
  84. package/dist/pages/templates/index.js +1 -1
  85. package/dist/views/admin/delegations/index.cjs +1 -1
  86. package/dist/views/admin/delegations/index.js +1 -1
  87. package/dist/views/admin/index.cjs +1 -1
  88. package/dist/views/admin/index.js +3 -3
  89. package/dist/views/admin/orgs/index.cjs +1 -1
  90. package/dist/views/admin/orgs/index.js +1 -1
  91. package/dist/views/admin/users/index.cjs +1 -1
  92. package/dist/views/admin/users/index.js +1 -1
  93. package/dist/views/cc/index.cjs +1 -1
  94. package/dist/views/cc/index.js +1 -1
  95. package/dist/views/dashboard/index.cjs +1 -1
  96. package/dist/views/dashboard/index.js +1 -1
  97. package/dist/views/delegations/index.cjs +1 -1
  98. package/dist/views/delegations/index.js +1 -1
  99. package/dist/views/forms/builder/index.cjs +1 -1
  100. package/dist/views/forms/builder/index.js +1 -1
  101. package/dist/views/forms/index.cjs +1 -1
  102. package/dist/views/forms/index.cjs.map +1 -1
  103. package/dist/views/forms/index.js +78 -77
  104. package/dist/views/forms/index.js.map +1 -1
  105. package/dist/views/inbox/index.cjs +1 -1
  106. package/dist/views/inbox/index.cjs.map +1 -1
  107. package/dist/views/inbox/index.js +106 -105
  108. package/dist/views/inbox/index.js.map +1 -1
  109. package/dist/views/instances/detail/index.cjs +1 -1
  110. package/dist/views/instances/detail/index.js +1 -1
  111. package/dist/views/instances/new/index.cjs +1 -1
  112. package/dist/views/instances/new/index.cjs.map +1 -1
  113. package/dist/views/instances/new/index.js +90 -89
  114. package/dist/views/instances/new/index.js.map +1 -1
  115. package/dist/views/search/index.cjs +1 -1
  116. package/dist/views/search/index.js +1 -1
  117. package/dist/views/sent/index.cjs +1 -1
  118. package/dist/views/sent/index.js +1 -1
  119. package/dist/views/settings/index.cjs +1 -1
  120. package/dist/views/settings/index.js +1 -1
  121. package/dist/views/settings/notifications/index.cjs +1 -1
  122. package/dist/views/settings/notifications/index.js +1 -1
  123. package/dist/views/templates/categories/index.cjs +1 -1
  124. package/dist/views/templates/categories/index.js +1 -1
  125. package/dist/views/templates/designer/index.cjs +6 -6
  126. package/dist/views/templates/designer/index.cjs.map +1 -1
  127. package/dist/views/templates/designer/index.js +589 -588
  128. package/dist/views/templates/designer/index.js.map +1 -1
  129. package/dist/views/templates/index.cjs +1 -1
  130. package/dist/views/templates/index.js +2 -2
  131. package/dist/views/templates/versions/index.cjs +1 -1
  132. package/dist/views/templates/versions/index.cjs.map +1 -1
  133. package/dist/views/templates/versions/index.js +44 -43
  134. package/dist/views/templates/versions/index.js.map +1 -1
  135. package/package.json +3 -3
  136. package/dist/chunks/app-navigation-C_mbz7jx.cjs +0 -2
  137. package/dist/chunks/app-navigation-C_mbz7jx.cjs.map +0 -1
  138. package/dist/chunks/app-navigation-uwbNEw9P.js +0 -262
  139. package/dist/chunks/app-navigation-uwbNEw9P.js.map +0 -1
  140. package/dist/chunks/approval-instance-list-page-Mo6wpDPb.cjs +0 -2
  141. package/dist/chunks/approval-instance-list-page-Mo6wpDPb.cjs.map +0 -1
  142. package/dist/chunks/approval-instance-list-page-nmzMrj0b.js.map +0 -1
  143. package/dist/chunks/builder-DPhAH381.cjs +0 -3
  144. package/dist/chunks/builder-DPhAH381.cjs.map +0 -1
  145. package/dist/chunks/builder-DqZskyXC.js.map +0 -1
  146. package/dist/chunks/categories-DEijUOnw.cjs +0 -2
  147. package/dist/chunks/categories-DEijUOnw.cjs.map +0 -1
  148. package/dist/chunks/categories-DTEl182t.js.map +0 -1
  149. package/dist/chunks/dashboard-page-DCmuB0Rw.cjs +0 -2
  150. package/dist/chunks/dashboard-page-DCmuB0Rw.cjs.map +0 -1
  151. package/dist/chunks/dashboard-page-Dx5PeEeN.js +0 -117
  152. package/dist/chunks/dashboard-page-Dx5PeEeN.js.map +0 -1
  153. package/dist/chunks/delegations-C-ZrwzvU.js.map +0 -1
  154. package/dist/chunks/delegations-C5PzZ5Kn.js.map +0 -1
  155. package/dist/chunks/delegations-DOGDvybX.cjs +0 -2
  156. package/dist/chunks/delegations-DOGDvybX.cjs.map +0 -1
  157. package/dist/chunks/delegations-DkDBWOQ7.cjs +0 -2
  158. package/dist/chunks/delegations-DkDBWOQ7.cjs.map +0 -1
  159. package/dist/chunks/detail-B2gcOPkd.cjs +0 -2
  160. package/dist/chunks/detail-B2gcOPkd.cjs.map +0 -1
  161. package/dist/chunks/detail-CfFyU5zC.js.map +0 -1
  162. package/dist/chunks/notifications-CPQ-nVar.cjs +0 -2
  163. package/dist/chunks/notifications-CPQ-nVar.cjs.map +0 -1
  164. package/dist/chunks/notifications-DweexUVy.js +0 -197
  165. package/dist/chunks/notifications-DweexUVy.js.map +0 -1
  166. package/dist/chunks/orgs-DgZ0DQ3-.cjs +0 -2
  167. package/dist/chunks/orgs-DgZ0DQ3-.cjs.map +0 -1
  168. package/dist/chunks/orgs-xrdhb3hS.js.map +0 -1
  169. package/dist/chunks/templates-PK_VYvcy.js +0 -383
  170. package/dist/chunks/templates-PK_VYvcy.js.map +0 -1
  171. package/dist/chunks/templates-x1OJZmsG.cjs +0 -2
  172. package/dist/chunks/templates-x1OJZmsG.cjs.map +0 -1
  173. package/dist/chunks/users-CY4-NK3j.js.map +0 -1
  174. package/dist/chunks/users-DHnu_056.cjs +0 -2
  175. package/dist/chunks/users-DHnu_056.cjs.map +0 -1
@@ -1,21 +1,22 @@
1
1
  "use client";
2
2
  import { n as e } from "./auth-provider-Bnox5gsx.js";
3
3
  import { t } from "./format-date-time-CB-LxzqT.js";
4
- import { t as n } from "./app-navigation-uwbNEw9P.js";
5
- import { t as r } from "./bpm-form-field-Cao0rMol.js";
6
- import { t as i } from "./FormRendererView-DrHsuSVo.js";
7
- import { Fragment as a, forwardRef as o, useCallback as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
8
- import { AutoComplete as f, Button as p, Modal as m, PageHeader as ee, Section as h, SectionGroup as te, Select as ne, Stepper as re, Table as ie, Textarea as g, Tooltip as ae, Typography as _ } from "@mezzanine-ui/react";
9
- import { Fragment as oe, jsx as v, jsxs as y } from "react/jsx-runtime";
10
- import { cancelApprovalInstance as se, decideTask as ce, listAttachments as le, listTaskDecisions as b, readApprovalInstance as ue, readAttachmentDownloadUrl as de, readAttachmentPreviewUrl as fe, readInstanceSignatures as pe, resolveMemberProfiles as me, resubmitApprovalInstance as he, searchMembers as ge, uploadAttachment as _e } from "@rytass/bpm-core-client/workflow";
4
+ import { t as n } from "./app-navigation-BSkMsEhy.js";
5
+ import { r } from "./routes-config-dxahImVe.js";
6
+ import { t as i } from "./bpm-form-field-Cao0rMol.js";
7
+ import { t as a } from "./FormRendererView-DrHsuSVo.js";
8
+ import { Fragment as o, forwardRef as s, useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
9
+ import { AutoComplete as p, Button as m, Modal as h, PageHeader as ee, Section as g, SectionGroup as te, Select as ne, Stepper as re, Table as ie, Textarea as _, Tooltip as ae, Typography as v } from "@mezzanine-ui/react";
10
+ import { Fragment as oe, jsx as y, jsxs as b } from "react/jsx-runtime";
11
+ import { cancelApprovalInstance as se, decideTask as ce, listAttachments as le, listTaskDecisions as ue, readApprovalInstance as de, readAttachmentDownloadUrl as fe, readAttachmentPreviewUrl as pe, readInstanceSignatures as me, resolveMemberProfiles as x, resubmitApprovalInstance as he, searchMembers as ge, uploadAttachment as _e } from "@rytass/bpm-core-client/workflow";
11
12
  import { CheckedIcon as ve, ChevronLeftIcon as ye, ChevronRightIcon as be, DangerousOutlineIcon as xe, DownloadIcon as Se, FileSearchIcon as Ce, RefreshCcwIcon as we, ShareIcon as Te, UserIcon as Ee, ZoomInIcon as De, ZoomOutIcon as Oe } from "@mezzanine-ui/icons";
12
13
  import ke from "@mezzanine-ui/react/ContentHeader";
13
14
  import { focusFormRendererField as Ae, validateFormRendererValues as je } from "@rytass/bpm-core-client/form";
14
- import { Background as Me, Controls as Ne, Handle as x, Position as S, ReactFlow as Pe } from "@xyflow/react";
15
- import * as C from "dagre";
16
- import { stepClasses as w } from "@mezzanine-ui/core/stepper";
17
- import { Document as T, Page as Fe } from "react-pdf";
18
- import '../detail.css';var E = {
15
+ import { Background as Me, Controls as Ne, Handle as Pe, Position as S, ReactFlow as Fe } from "@xyflow/react";
16
+ import * as Ie from "dagre";
17
+ import { stepClasses as C } from "@mezzanine-ui/core/stepper";
18
+ import { Document as Le, Page as w } from "react-pdf";
19
+ import '../detail.css';var T = {
19
20
  root: "bpm_root_ehm7w",
20
21
  toolbar: "bpm_toolbar_R-tis",
21
22
  pageControls: "bpm_pageControls_jM-rC",
@@ -24,97 +25,97 @@ import '../detail.css';var E = {
24
25
  viewport: "bpm_viewport_DQXms",
25
26
  page: "bpm_page_Cv5Rg",
26
27
  state: "bpm_state_bpgp3"
27
- }, Ie = 760, Le = 920, Re = 320, ze = 32, D = .75, Be = 1.75, Ve = .25;
28
- function He({ filename: e, fileUrl: t, onDownload: n }) {
29
- let r = u(null), [i, a] = d(null), [o, f] = d(1), [m, ee] = d(1), [h, te] = d(Ie);
30
- c(() => {
28
+ }, E = 760, Re = 920, ze = 320, Be = 32, Ve = .75, D = 1.75, He = .25;
29
+ function Ue({ filename: e, fileUrl: t, onDownload: n }) {
30
+ let r = d(null), [i, a] = f(null), [o, s] = f(1), [p, h] = f(1), [ee, g] = f(E);
31
+ l(() => {
31
32
  let e = r.current;
32
33
  if (!e || typeof ResizeObserver > "u") return;
33
34
  let t = new ResizeObserver((e) => {
34
35
  let t = e[0]?.contentRect.width;
35
- t && te(t);
36
+ t && g(t);
36
37
  });
37
38
  return t.observe(e), () => t.disconnect();
38
- }, []), c(() => {
39
- a(null), f(1), ee(1);
39
+ }, []), l(() => {
40
+ a(null), s(1), h(1);
40
41
  }, [t]);
41
- let ne = l(() => {
42
- let e = Math.max(Re, h - ze);
43
- return Math.round(Math.min(Le, e) * m);
44
- }, [m, h]), re = s((e) => {
45
- a(e.numPages), f(1);
46
- }, []), ie = o > 1, g = i !== null && o < i, ae = m > D, oe = m < Be, se = i === null ? `第 ${o} 頁` : `第 ${o} / ${i} 頁`, ce = `${Math.round(m * 100)}%`;
47
- return /* @__PURE__ */ y("section", {
42
+ let te = u(() => {
43
+ let e = Math.max(ze, ee - Be);
44
+ return Math.round(Math.min(Re, e) * p);
45
+ }, [p, ee]), ne = c((e) => {
46
+ a(e.numPages), s(1);
47
+ }, []), re = o > 1, ie = i !== null && o < i, _ = p > Ve, ae = p < D, oe = i === null ? `第 ${o} 頁` : `第 ${o} / ${i} 頁`, se = `${Math.round(p * 100)}%`;
48
+ return /* @__PURE__ */ b("section", {
48
49
  "aria-label": `${e} PDF 預覽`,
49
- className: E.root,
50
- children: [/* @__PURE__ */ y("div", {
51
- className: E.toolbar,
50
+ className: T.root,
51
+ children: [/* @__PURE__ */ b("div", {
52
+ className: T.toolbar,
52
53
  children: [
53
- /* @__PURE__ */ y("div", {
54
- className: E.pageControls,
54
+ /* @__PURE__ */ b("div", {
55
+ className: T.pageControls,
55
56
  "aria-label": "頁面切換",
56
57
  children: [
57
- /* @__PURE__ */ v(p, {
58
+ /* @__PURE__ */ y(m, {
58
59
  "aria-label": "上一頁",
59
- disabled: !ie,
60
+ disabled: !re,
60
61
  icon: ye,
61
62
  onClick: () => {
62
- f((e) => Math.max(1, e - 1));
63
+ s((e) => Math.max(1, e - 1));
63
64
  },
64
65
  size: "minor",
65
66
  variant: "base-secondary"
66
67
  }),
67
- /* @__PURE__ */ v(_, {
68
- className: E.counter,
68
+ /* @__PURE__ */ y(v, {
69
+ className: T.counter,
69
70
  component: "span",
70
71
  variant: "body",
71
- children: se
72
+ children: oe
72
73
  }),
73
- /* @__PURE__ */ v(p, {
74
+ /* @__PURE__ */ y(m, {
74
75
  "aria-label": "下一頁",
75
- disabled: !g,
76
+ disabled: !ie,
76
77
  icon: be,
77
78
  onClick: () => {
78
- f((e) => i === null ? e : Math.min(i, e + 1));
79
+ s((e) => i === null ? e : Math.min(i, e + 1));
79
80
  },
80
81
  size: "minor",
81
82
  variant: "base-secondary"
82
83
  })
83
84
  ]
84
85
  }),
85
- /* @__PURE__ */ y("div", {
86
- className: E.zoomControls,
86
+ /* @__PURE__ */ b("div", {
87
+ className: T.zoomControls,
87
88
  "aria-label": "縮放",
88
89
  children: [
89
- /* @__PURE__ */ v(p, {
90
+ /* @__PURE__ */ y(m, {
90
91
  "aria-label": "縮小",
91
- disabled: !ae,
92
+ disabled: !_,
92
93
  icon: Oe,
93
94
  onClick: () => {
94
- ee((e) => Math.max(D, e - Ve));
95
+ h((e) => Math.max(Ve, e - He));
95
96
  },
96
97
  size: "minor",
97
98
  variant: "base-secondary"
98
99
  }),
99
- /* @__PURE__ */ v(_, {
100
- className: E.counter,
100
+ /* @__PURE__ */ y(v, {
101
+ className: T.counter,
101
102
  component: "span",
102
103
  variant: "body",
103
- children: ce
104
+ children: se
104
105
  }),
105
- /* @__PURE__ */ v(p, {
106
+ /* @__PURE__ */ y(m, {
106
107
  "aria-label": "放大",
107
- disabled: !oe,
108
+ disabled: !ae,
108
109
  icon: De,
109
110
  onClick: () => {
110
- ee((e) => Math.min(Be, e + Ve));
111
+ h((e) => Math.min(D, e + He));
111
112
  },
112
113
  size: "minor",
113
114
  variant: "base-secondary"
114
115
  })
115
116
  ]
116
117
  }),
117
- n ? /* @__PURE__ */ v(p, {
118
+ n ? /* @__PURE__ */ y(m, {
118
119
  icon: Se,
119
120
  iconType: "leading",
120
121
  onClick: n,
@@ -123,31 +124,31 @@ function He({ filename: e, fileUrl: t, onDownload: n }) {
123
124
  children: "下載"
124
125
  }) : null
125
126
  ]
126
- }), /* @__PURE__ */ v("div", {
127
- className: E.viewport,
127
+ }), /* @__PURE__ */ y("div", {
128
+ className: T.viewport,
128
129
  ref: r,
129
- children: /* @__PURE__ */ v(T, {
130
- error: /* @__PURE__ */ v(O, { message: "PDF 無法載入。" }),
130
+ children: /* @__PURE__ */ y(Le, {
131
+ error: /* @__PURE__ */ y(O, { message: "PDF 無法載入。" }),
131
132
  file: t,
132
- loading: /* @__PURE__ */ v(O, { message: "正在載入 PDF..." }),
133
- noData: /* @__PURE__ */ v(O, { message: "沒有可預覽的 PDF。" }),
134
- onLoadSuccess: re,
135
- children: /* @__PURE__ */ v(Fe, {
136
- className: E.page,
137
- loading: /* @__PURE__ */ v(O, { message: "正在載入頁面..." }),
133
+ loading: /* @__PURE__ */ y(O, { message: "正在載入 PDF..." }),
134
+ noData: /* @__PURE__ */ y(O, { message: "沒有可預覽的 PDF。" }),
135
+ onLoadSuccess: ne,
136
+ children: /* @__PURE__ */ y(w, {
137
+ className: T.page,
138
+ loading: /* @__PURE__ */ y(O, { message: "正在載入頁面..." }),
138
139
  pageNumber: o,
139
140
  renderAnnotationLayer: !0,
140
141
  renderTextLayer: !0,
141
- width: ne
142
+ width: te
142
143
  })
143
144
  })
144
145
  })]
145
146
  });
146
147
  }
147
148
  function O({ message: e }) {
148
- return /* @__PURE__ */ v("div", {
149
- className: E.state,
150
- children: /* @__PURE__ */ v(_, {
149
+ return /* @__PURE__ */ y("div", {
150
+ className: T.state,
151
+ children: /* @__PURE__ */ y(v, {
151
152
  color: "text-neutral",
152
153
  variant: "body",
153
154
  children: e
@@ -159,11 +160,11 @@ function O({ message: e }) {
159
160
  var k = {
160
161
  display: "grid",
161
162
  gap: 16
162
- }, Ue = {
163
+ }, We = {
163
164
  display: "flex",
164
165
  flexWrap: "wrap",
165
166
  gap: 8
166
- }, A = 184, We = 96, Ge = {
167
+ }, A = 184, j = 96, Ge = {
167
168
  display: "grid",
168
169
  gap: 16
169
170
  }, Ke = {
@@ -185,7 +186,7 @@ var k = {
185
186
  minHeight: 440,
186
187
  overflow: "hidden",
187
188
  width: "min(80vw, 1040px)"
188
- }, j = {
189
+ }, M = {
189
190
  background: "#ffffff",
190
191
  border: "1px solid #cbd5e1",
191
192
  borderRadius: 8,
@@ -224,47 +225,47 @@ var k = {
224
225
  gap: 6,
225
226
  lineHeight: "20px",
226
227
  padding: "4px 8px"
227
- }, M = {
228
+ }, tt = {
228
229
  cursor: "help",
229
230
  textDecoration: "underline dotted",
230
231
  textUnderlineOffset: 3
231
- }, tt = { color: "var(--mzn-color-text-error)" };
232
+ }, N = { color: "var(--mzn-color-text-error)" };
232
233
  function nt(e) {
233
234
  e && (e.style.width = "100%");
234
235
  }
235
- var rt = { workflowRuntime: Y };
236
- function N({ instanceId: a }) {
237
- let { member: o } = e(), s = o?.memberId ?? null, [u, ae] = d([]), [b, me] = d(null), [ye, be] = d([]), [De, Oe] = d([]), [x, S] = d([]), [C, w] = d(null), [T, Fe] = d([]), [E, Ie] = d([]), [Le, Re] = d([]), [ze, D] = d(null), [Be, Ve] = d(!0), [O, A] = d(!1), [We, j] = d(!1), [Xe, Ze] = d(""), [Qe, M] = d(!1), [tt, N] = d(""), [F, I] = d(null), [L, dt] = d(!1), [ft, R] = d(""), [z, B] = d(!1), [mt, V] = d(null), [ht, H] = d(""), [gt, U] = d(null), [_t, vt] = d(!1), [yt, bt] = d([]), [xt, St] = d(!1), [Ct, wt] = d({}), [W, jt] = d({}), [G, K] = d(null), [Mt, It] = d(null), Lt = tt.trim(), Rt = Xe.trim(), q = ft.trim(), zt = ht.trim();
238
- c(() => {
239
- cn();
240
- }, [s, a]), c(() => {
241
- jt(b?.formData ?? {});
242
- }, [b]);
243
- let J = l(() => T.find((e) => kt(e, s) && (e.status === "PENDING" || e.status === "IN_PROGRESS")) ?? null, [s, T]), Y = l(() => J && b ? b.workflowSnapshot.nodes.find((e) => e.id === J.nodeId) ?? null : null, [J, b]), X = l(() => Y && b ? Et(b.workflowSnapshot, Y) : [], [Y, b]), Z = Y?.type === "userTask" && Y.data.returnBehavior.allowReturn, Ut = X.find((e) => e.id === mt) ?? X[0] ?? null, Wt = !!(b && b.initiatorMemberId === s && (b.state === "RUNNING" || b.state === "RETURNED")), Q = !!(b && b.initiatorMemberId === s && b.state === "RETURNED"), Kt = l(() => new Map(Le.map((e) => [e.memberId, e])), [Le]), qt = l(() => T.map((e) => ({
236
+ var rt = { workflowRuntime: X };
237
+ function it({ instanceId: o }) {
238
+ let s = r(), { member: c } = e(), d = c?.memberId ?? null, [ae, ue] = f([]), [x, ye] = f(null), [be, De] = f([]), [Oe, Pe] = f([]), [S, Ie] = f([]), [C, Le] = f(null), [w, T] = f([]), [E, Re] = f([]), [ze, Be] = f([]), [Ve, D] = f(null), [He, O] = f(!0), [A, j] = f(!1), [M, Xe] = f(!1), [Ze, Qe] = f(""), [tt, N] = f(!1), [it, F] = f(""), [ct, I] = f(null), [pt, L] = f(!1), [R, z] = f(""), [ht, gt] = f(!1), [_t, B] = f(null), [vt, V] = f(""), [H, U] = f(null), [yt, bt] = f(!1), [xt, St] = f([]), [Ct, wt] = f(!1), [Tt, G] = f({}), [jt, Mt] = f({}), [K, Nt] = f(null), [q, Lt] = f(null), J = it.trim(), Y = Ze.trim(), Rt = R.trim(), zt = vt.trim();
239
+ l(() => {
240
+ un();
241
+ }, [d, o]), l(() => {
242
+ Mt(x?.formData ?? {});
243
+ }, [x]);
244
+ let X = u(() => w.find((e) => kt(e, d) && (e.status === "PENDING" || e.status === "IN_PROGRESS")) ?? null, [d, w]), Z = u(() => X && x ? x.workflowSnapshot.nodes.find((e) => e.id === X.nodeId) ?? null : null, [X, x]), Q = u(() => Z && x ? Et(x.workflowSnapshot, Z) : [], [Z, x]), Ut = Z?.type === "userTask" && Z.data.returnBehavior.allowReturn, Wt = Q.find((e) => e.id === _t) ?? Q[0] ?? null, Gt = !!(x && x.initiatorMemberId === d && (x.state === "RUNNING" || x.state === "RETURNED")), qt = !!(x && x.initiatorMemberId === d && x.state === "RETURNED"), Jt = u(() => new Map(ze.map((e) => [e.memberId, e])), [ze]), Yt = u(() => w.map((e) => ({
244
245
  ...e,
245
- assigneeLabel: Ot(e, Kt),
246
+ assigneeLabel: Ot(e, Jt),
246
247
  key: e.id,
247
- nodeLabel: Tt(e.nodeId, b?.workflowSnapshot ?? null),
248
+ nodeLabel: W(e.nodeId, x?.workflowSnapshot ?? null),
248
249
  statusLabel: Dt(e.status)
249
250
  })), [
250
- b,
251
- Kt,
252
- T
253
- ]), Jt = l(() => lt(ye), [ye]), Yt = l(() => new Map(x.map((e) => [e.id, e])), [x]), Xt = l(() => ut(u, T, E, b?.workflowSnapshot ?? null, b?.state ?? "RUNNING", Kt, Jt, Yt, C), [
254
- u,
255
- b,
256
- Kt,
257
- C,
258
- Yt,
251
+ x,
259
252
  Jt,
260
- T,
253
+ w
254
+ ]), Xt = u(() => dt(be), [be]), Zt = u(() => new Map(S.map((e) => [e.id, e])), [S]), Qt = u(() => ft(ae, w, E, x?.workflowSnapshot ?? null, x?.state ?? "RUNNING", Jt, Xt, Zt, C), [
255
+ ae,
256
+ x,
257
+ Jt,
258
+ C,
259
+ Zt,
260
+ Xt,
261
+ w,
261
262
  E
262
- ]), Zt = l(() => pt(Xt), [Xt]), $ = l(() => b ? Vt(b.workflowSnapshot) : null, [b]), Qt = l(() => b && $ ? Bt($, T, E, b.state) : [], [
263
- b,
263
+ ]), $t = u(() => mt(Qt), [Qt]), $ = u(() => x ? Vt(x.workflowSnapshot) : null, [x]), en = u(() => x && $ ? Bt($, w, E, x.state) : [], [
264
+ x,
264
265
  $,
265
- T,
266
+ w,
266
267
  E
267
- ]), $t = l(() => $ ? Ht($) : [], [$]), en = l(() => b ? Gt(b.workflowSnapshot) : [], [b]), tn = l(() => [
268
+ ]), tn = u(() => $ ? Ht($) : [], [$]), nn = u(() => x ? Kt(x.workflowSnapshot) : [], [x]), rn = u(() => [
268
269
  {
269
270
  dataIndex: "nodeLabel",
270
271
  key: "nodeLabel",
@@ -274,7 +275,7 @@ function N({ instanceId: a }) {
274
275
  {
275
276
  key: "assigneeMemberId",
276
277
  title: "處理者",
277
- render: (e) => /* @__PURE__ */ v(_, {
278
+ render: (e) => /* @__PURE__ */ y(v, {
278
279
  component: "span",
279
280
  variant: "body",
280
281
  children: e.assigneeLabel
@@ -289,7 +290,7 @@ function N({ instanceId: a }) {
289
290
  },
290
291
  {
291
292
  key: "createdAt",
292
- render: (e) => /* @__PURE__ */ v(_, {
293
+ render: (e) => /* @__PURE__ */ y(v, {
293
294
  component: "span",
294
295
  variant: "body",
295
296
  children: t(e.createdAt)
@@ -297,15 +298,15 @@ function N({ instanceId: a }) {
297
298
  title: "建立時間",
298
299
  width: 220
299
300
  }
300
- ], []), nn = l(() => De.map((e) => ({
301
+ ], []), an = u(() => Oe.map((e) => ({
301
302
  attachment: e,
302
303
  createdAt: e.createdAt,
303
304
  filename: e.filename,
304
305
  id: e.id,
305
306
  key: e.id,
306
307
  mimeType: e.mimeType,
307
- sizeLabel: it(Number(e.sizeBytes))
308
- })), [De]), rn = l(() => [
308
+ sizeLabel: at(Number(e.sizeBytes))
309
+ })), [Oe]), on = u(() => [
309
310
  {
310
311
  dataIndex: "filename",
311
312
  key: "filename",
@@ -326,7 +327,7 @@ function N({ instanceId: a }) {
326
327
  },
327
328
  {
328
329
  key: "createdAt",
329
- render: (e) => /* @__PURE__ */ v(_, {
330
+ render: (e) => /* @__PURE__ */ y(v, {
330
331
  component: "span",
331
332
  variant: "body",
332
333
  children: t(e.createdAt)
@@ -334,32 +335,32 @@ function N({ instanceId: a }) {
334
335
  title: "上傳時間",
335
336
  width: 220
336
337
  }
337
- ], []), an = l(() => ({
338
+ ], []), sn = u(() => ({
338
339
  render: (e) => [...e.mimeType === "application/pdf" ? [{
339
340
  icon: Ce,
340
341
  iconType: "leading",
341
342
  name: "預覽",
342
343
  onClick: () => {
343
- dn(e.attachment);
344
+ pn(e.attachment);
344
345
  }
345
346
  }] : [], {
346
347
  icon: Se,
347
348
  iconType: "leading",
348
349
  name: "下載",
349
350
  onClick: () => {
350
- un(e.attachment);
351
+ fn(e.attachment);
351
352
  }
352
353
  }],
353
354
  variant: "base-secondary",
354
355
  width: 160
355
- }), []), on = l(() => x.map((e) => ({
356
+ }), []), cn = u(() => S.map((e) => ({
356
357
  algorithm: e.algorithm,
357
- hashLabel: at(e.signedPayloadHash),
358
+ hashLabel: ot(e.signedPayloadHash),
358
359
  key: e.id,
359
360
  keyVersion: e.keyVersion,
360
361
  signedAtLabel: t(e.signedAt),
361
362
  signerMemberId: e.signerMemberId
362
- })), [x]), sn = l(() => [
363
+ })), [S]), ln = u(() => [
363
364
  {
364
365
  dataIndex: "signerMemberId",
365
366
  key: "signerMemberId",
@@ -391,213 +392,213 @@ function N({ instanceId: a }) {
391
392
  width: 220
392
393
  }
393
394
  ], []);
394
- async function cn() {
395
- Ve(!0), D(null);
395
+ async function un() {
396
+ O(!0), D(null);
396
397
  try {
397
- let e = await ue(a);
398
- ae(e.activityLogs), me(e.instance), Fe(e.tasks), Ie(e.workflowTokens);
398
+ let e = await de(o);
399
+ ue(e.activityLogs), ye(e.instance), T(e.tasks), Re(e.workflowTokens);
399
400
  let [t, n, r, i] = await Promise.all([
400
- ct(e.tasks),
401
- st(e),
401
+ ut(e.tasks),
402
+ lt(e),
402
403
  le(e.instance.id),
403
- pe(e.instance.id)
404
+ me(e.instance.id)
404
405
  ]);
405
- be(t), Re(n), Oe(r), S(i.signatures), w(i.verification);
406
+ De(t), Be(n), Pe(r), Ie(i.signatures), Le(i.verification);
406
407
  } catch (e) {
407
408
  D(P(e));
408
409
  } finally {
409
- Ve(!1);
410
+ O(!1);
410
411
  }
411
412
  }
412
- async function ln(e, t) {
413
- if (!s) throw Error("尚未登入,無法上傳附件");
413
+ async function dn(e, t) {
414
+ if (!d) throw Error("尚未登入,無法上傳附件");
414
415
  return { id: (await _e({
415
416
  file: t,
416
417
  formFieldPath: `form.${e.fieldKey}`
417
418
  })).id };
418
419
  }
419
- async function un(e) {
420
- if (!s) return;
421
- let t = await de({ id: e.id });
420
+ async function fn(e) {
421
+ if (!d) return;
422
+ let t = await fe({ id: e.id });
422
423
  window.open(t, "_blank", "noopener,noreferrer");
423
424
  }
424
- async function dn(e) {
425
- if (!s) return;
426
- let t = await fe({ id: e.id });
427
- K(e), It(t);
425
+ async function pn(e) {
426
+ if (!d) return;
427
+ let t = await pe({ id: e.id });
428
+ Nt(e), Lt(t);
428
429
  }
429
- async function fn({ action: e, comment: t, returnToNodeId: n = null, transferToMemberId: r = null }) {
430
- if (!(!s || !J)) {
431
- A(!0), D(null);
430
+ async function mn({ action: e, comment: t, returnToNodeId: n = null, transferToMemberId: r = null }) {
431
+ if (!(!d || !X)) {
432
+ j(!0), D(null);
432
433
  try {
433
434
  await ce({
434
435
  action: e,
435
436
  comment: t,
436
- decidedByMemberId: s,
437
+ decidedByMemberId: d,
437
438
  returnToNodeId: n,
438
- taskId: J.id,
439
+ taskId: X.id,
439
440
  transferToMemberId: r
440
- }), dt(!1), B(!1), St(!1), N(""), R(""), H(""), U(null), V(null), I(null), await cn();
441
+ }), L(!1), gt(!1), wt(!1), F(""), z(""), V(""), U(null), B(null), I(null), await un();
441
442
  } catch (e) {
442
443
  D(P(e));
443
444
  } finally {
444
- A(!1);
445
+ j(!1);
445
446
  }
446
447
  }
447
448
  }
448
- function pn() {
449
- N(""), I(null), dt(!0);
450
- }
451
- function mn() {
452
- O || (dt(!1), N(""), I(null));
453
- }
454
449
  function hn() {
455
- R(""), V(X[0]?.id ?? null), B(!0);
450
+ F(""), I(null), L(!0);
456
451
  }
457
452
  function gn() {
458
- O || (B(!1), R(""), V(null));
453
+ A || (L(!1), F(""), I(null));
459
454
  }
460
455
  function _n() {
461
- H(""), U(null), St(!0), yn("");
456
+ z(""), B(Q[0]?.id ?? null), gt(!0);
462
457
  }
463
458
  function vn() {
464
- O || (St(!1), H(""), U(null));
459
+ A || (gt(!1), z(""), B(null));
465
460
  }
466
- async function yn(e) {
467
- vt(!0);
461
+ function yn() {
462
+ V(""), U(null), wt(!0), xn("");
463
+ }
464
+ function bn() {
465
+ A || (wt(!1), V(""), U(null));
466
+ }
467
+ async function xn(e) {
468
+ bt(!0);
468
469
  try {
469
- bt((await ge(e)).filter((e) => e.memberId !== s).map(Nt));
470
+ St((await ge(e)).filter((e) => e.memberId !== d).map(Pt));
470
471
  } catch (e) {
471
472
  D(P(e));
472
473
  } finally {
473
- vt(!1);
474
+ bt(!1);
474
475
  }
475
476
  }
476
- async function bn() {
477
- if (!Lt) {
477
+ async function Sn() {
478
+ if (!J) {
478
479
  I("請輸入拒絕原因");
479
480
  return;
480
481
  }
481
- await fn({
482
+ await mn({
482
483
  action: "REJECTED",
483
- comment: Lt
484
+ comment: J
484
485
  });
485
486
  }
486
- async function xn() {
487
- if (!gt) {
487
+ async function Cn() {
488
+ if (!H) {
488
489
  D("請選擇轉派對象");
489
490
  return;
490
491
  }
491
- await fn({
492
+ await mn({
492
493
  action: "TRANSFERRED",
493
494
  comment: zt || null,
494
- transferToMemberId: gt.id
495
+ transferToMemberId: H.id
495
496
  });
496
497
  }
497
- async function Sn() {
498
- await fn({
498
+ async function wn() {
499
+ await mn({
499
500
  action: "RETURNED",
500
- comment: q || null,
501
- returnToNodeId: Ut?.id ?? null
501
+ comment: Rt || null,
502
+ returnToNodeId: Wt?.id ?? null
502
503
  });
503
504
  }
504
- async function Cn() {
505
- if (!(!s || !b || !Wt)) {
506
- if (A(!0), D(null), wt({}), b.formDefinitionSnapshot.schema && b.formDefinitionSnapshot.uiSchema) {
505
+ async function Tn() {
506
+ if (!(!d || !x || !Gt)) {
507
+ if (j(!0), D(null), G({}), x.formDefinitionSnapshot.schema && x.formDefinitionSnapshot.uiSchema) {
507
508
  let e = je({
508
- schema: b.formDefinitionSnapshot.schema,
509
- uiSchema: b.formDefinitionSnapshot.uiSchema,
510
- values: W
509
+ schema: x.formDefinitionSnapshot.schema,
510
+ uiSchema: x.formDefinitionSnapshot.uiSchema,
511
+ values: jt
511
512
  });
512
513
  if (!e.valid) {
513
- wt(e.errors), D("請先補齊必填欄位。"), e.firstInvalidFieldKey && Ae(e.firstInvalidFieldKey), A(!1);
514
+ G(e.errors), D("請先補齊必填欄位。"), e.firstInvalidFieldKey && Ae(e.firstInvalidFieldKey), j(!1);
514
515
  return;
515
516
  }
516
517
  }
517
518
  try {
518
519
  await se({
519
- cancelledByMemberId: s,
520
- comment: Rt || null,
521
- instanceId: b.id
522
- }), Ze(""), M(!1), await cn();
520
+ cancelledByMemberId: d,
521
+ comment: Y || null,
522
+ instanceId: x.id
523
+ }), Qe(""), N(!1), await un();
523
524
  } catch (e) {
524
525
  D(P(e));
525
526
  } finally {
526
- A(!1);
527
+ j(!1);
527
528
  }
528
529
  }
529
530
  }
530
- async function wn() {
531
- if (!(!s || !b || !Q)) {
532
- A(!0), D(null);
531
+ async function En() {
532
+ if (!(!d || !x || !qt)) {
533
+ j(!0), D(null);
533
534
  try {
534
535
  await he({
535
- formData: W,
536
- initiatorMemberId: s,
537
- instanceId: b.id,
538
- title: b.title
539
- }), await cn();
536
+ formData: jt,
537
+ initiatorMemberId: d,
538
+ instanceId: x.id,
539
+ title: x.title
540
+ }), await un();
540
541
  } catch (e) {
541
542
  D(P(e));
542
543
  } finally {
543
- A(!1);
544
+ j(!1);
544
545
  }
545
546
  }
546
547
  }
547
- return /* @__PURE__ */ y(n, {
548
- activeHref: "/inbox",
548
+ return /* @__PURE__ */ b(n, {
549
+ activeHref: s.inbox(),
549
550
  children: [
550
- /* @__PURE__ */ v(ee, { children: /* @__PURE__ */ y(ke, {
551
- description: b ? `${At(b.state)} · ${t(b.startedAt)}` : "載入案件內容。",
552
- title: b?.title ?? "簽核案件",
551
+ /* @__PURE__ */ y(ee, { children: /* @__PURE__ */ b(ke, {
552
+ description: x ? `${At(x.state)} · ${t(x.startedAt)}` : "載入案件內容。",
553
+ title: x?.title ?? "簽核案件",
553
554
  children: [
554
- b ? /* @__PURE__ */ v(p, {
555
+ x ? /* @__PURE__ */ y(m, {
555
556
  "aria-label": "查看流程圖",
556
557
  icon: Te,
557
558
  iconType: "icon-only",
558
- onClick: () => j(!0),
559
+ onClick: () => Xe(!0),
559
560
  title: "查看流程圖",
560
561
  variant: "base-secondary",
561
562
  children: "流程圖"
562
563
  }) : null,
563
- Wt ? /* @__PURE__ */ v(p, {
564
- disabled: O,
564
+ Gt ? /* @__PURE__ */ y(m, {
565
+ disabled: A,
565
566
  icon: xe,
566
567
  iconType: "leading",
567
- onClick: () => M(!0),
568
+ onClick: () => N(!0),
568
569
  variant: "destructive-secondary",
569
570
  children: "取消案件"
570
571
  }) : null,
571
- J ? /* @__PURE__ */ y(oe, { children: [
572
- Z ? /* @__PURE__ */ v(p, {
573
- disabled: O,
572
+ X ? /* @__PURE__ */ b(oe, { children: [
573
+ Ut ? /* @__PURE__ */ y(m, {
574
+ disabled: A,
574
575
  icon: we,
575
576
  iconType: "leading",
576
- onClick: hn,
577
+ onClick: _n,
577
578
  variant: "base-secondary",
578
579
  children: "退回"
579
580
  }) : null,
580
- /* @__PURE__ */ v(p, {
581
- disabled: O,
581
+ /* @__PURE__ */ y(m, {
582
+ disabled: A,
582
583
  icon: Ee,
583
584
  iconType: "leading",
584
- onClick: _n,
585
+ onClick: yn,
585
586
  variant: "base-secondary",
586
587
  children: "轉派"
587
588
  }),
588
- /* @__PURE__ */ v(p, {
589
- disabled: O,
589
+ /* @__PURE__ */ y(m, {
590
+ disabled: A,
590
591
  icon: xe,
591
592
  iconType: "leading",
592
- onClick: pn,
593
+ onClick: hn,
593
594
  variant: "destructive-secondary",
594
595
  children: "拒絕"
595
596
  }),
596
- /* @__PURE__ */ v(p, {
597
- disabled: O,
597
+ /* @__PURE__ */ y(m, {
598
+ disabled: A,
598
599
  icon: ve,
599
600
  iconType: "leading",
600
- onClick: () => void fn({
601
+ onClick: () => void mn({
601
602
  action: "APPROVED",
602
603
  comment: null
603
604
  }),
@@ -607,271 +608,271 @@ function N({ instanceId: a }) {
607
608
  ] }) : null
608
609
  ]
609
610
  }) }),
610
- /* @__PURE__ */ y(te, { children: [
611
- /* @__PURE__ */ v(h, { children: /* @__PURE__ */ y("div", {
611
+ /* @__PURE__ */ b(te, { children: [
612
+ /* @__PURE__ */ y(g, { children: /* @__PURE__ */ b("div", {
612
613
  style: k,
613
614
  children: [
614
- ze ? /* @__PURE__ */ v(_, {
615
+ Ve ? /* @__PURE__ */ y(v, {
615
616
  color: "text-error",
616
617
  variant: "body",
617
- children: ze
618
+ children: Ve
618
619
  }) : null,
619
- Be ? /* @__PURE__ */ v(_, {
620
+ He ? /* @__PURE__ */ y(v, {
620
621
  color: "text-neutral",
621
622
  variant: "body",
622
623
  children: "載入中..."
623
624
  }) : null,
624
- b?.formDefinitionSnapshot.schema && b.formDefinitionSnapshot.uiSchema ? /* @__PURE__ */ y(oe, { children: [/* @__PURE__ */ v(i, {
625
- errors: Ct,
625
+ x?.formDefinitionSnapshot.schema && x.formDefinitionSnapshot.uiSchema ? /* @__PURE__ */ b(oe, { children: [/* @__PURE__ */ y(a, {
626
+ errors: Tt,
626
627
  onChange: (e) => {
627
- jt(e), wt({});
628
+ Mt(e), G({});
628
629
  },
629
- onUploadAttachment: Q ? ln : void 0,
630
- readonly: !Q,
631
- schema: b.formDefinitionSnapshot.schema,
632
- uiSchema: b.formDefinitionSnapshot.uiSchema,
633
- value: Q ? W : b.formData
634
- }), Q ? /* @__PURE__ */ v("div", {
635
- style: Ue,
636
- children: /* @__PURE__ */ v(p, {
637
- disabled: O,
630
+ onUploadAttachment: qt ? dn : void 0,
631
+ readonly: !qt,
632
+ schema: x.formDefinitionSnapshot.schema,
633
+ uiSchema: x.formDefinitionSnapshot.uiSchema,
634
+ value: qt ? jt : x.formData
635
+ }), qt ? /* @__PURE__ */ y("div", {
636
+ style: We,
637
+ children: /* @__PURE__ */ y(m, {
638
+ disabled: A,
638
639
  icon: we,
639
640
  iconType: "leading",
640
- onClick: () => void wn(),
641
+ onClick: () => void En(),
641
642
  variant: "base-primary",
642
643
  children: "重新送出"
643
644
  })
644
- }) : null] }) : /* @__PURE__ */ v(_, {
645
+ }) : null] }) : /* @__PURE__ */ y(v, {
645
646
  color: "text-neutral",
646
647
  variant: "body",
647
648
  children: "此案件沒有可顯示的表單快照。"
648
649
  })
649
650
  ]
650
651
  }) }),
651
- /* @__PURE__ */ v(h, { children: /* @__PURE__ */ y("div", {
652
+ /* @__PURE__ */ y(g, { children: /* @__PURE__ */ b("div", {
652
653
  style: k,
653
- children: [/* @__PURE__ */ v(_, {
654
+ children: [/* @__PURE__ */ y(v, {
654
655
  component: "h2",
655
656
  variant: "h3",
656
657
  children: "附件"
657
- }), nn.length > 0 ? /* @__PURE__ */ v(ie, {
658
- actions: an,
659
- columns: rn,
660
- dataSource: nn,
658
+ }), an.length > 0 ? /* @__PURE__ */ y(ie, {
659
+ actions: sn,
660
+ columns: on,
661
+ dataSource: an,
661
662
  fullWidth: !0
662
- }) : /* @__PURE__ */ v(_, {
663
+ }) : /* @__PURE__ */ y(v, {
663
664
  color: "text-neutral",
664
665
  variant: "body",
665
666
  children: "此案件沒有附件。"
666
667
  })]
667
668
  }) }),
668
- /* @__PURE__ */ y(h, { children: [/* @__PURE__ */ v(_, {
669
+ /* @__PURE__ */ b(g, { children: [/* @__PURE__ */ y(v, {
669
670
  component: "h2",
670
671
  variant: "h3",
671
672
  children: "任務"
672
- }), /* @__PURE__ */ v(ie, {
673
- columns: tn,
674
- dataSource: qt,
673
+ }), /* @__PURE__ */ y(ie, {
674
+ columns: rn,
675
+ dataSource: Yt,
675
676
  fullWidth: !0
676
677
  })] }),
677
- /* @__PURE__ */ v(h, { children: /* @__PURE__ */ y("div", {
678
+ /* @__PURE__ */ y(g, { children: /* @__PURE__ */ b("div", {
678
679
  style: k,
679
680
  children: [
680
- /* @__PURE__ */ v(_, {
681
+ /* @__PURE__ */ y(v, {
681
682
  component: "h2",
682
683
  variant: "h3",
683
684
  children: "簽章"
684
685
  }),
685
- /* @__PURE__ */ v(_, {
686
+ /* @__PURE__ */ y(v, {
686
687
  color: C?.valid ? "text-success" : "text-error",
687
688
  variant: "body",
688
689
  children: C ? C.valid ? `簽章鏈已驗證,共 ${C.checkedCount} 筆。` : `簽章鏈驗證失敗:${C.errors.join("、")}` : "尚無簽章紀錄。"
689
690
  }),
690
- on.length > 0 ? /* @__PURE__ */ v(ie, {
691
- columns: sn,
692
- dataSource: on,
691
+ cn.length > 0 ? /* @__PURE__ */ y(ie, {
692
+ columns: ln,
693
+ dataSource: cn,
693
694
  fullWidth: !0
694
695
  }) : null
695
696
  ]
696
697
  }) }),
697
- /* @__PURE__ */ v(h, { children: /* @__PURE__ */ y("div", {
698
+ /* @__PURE__ */ y(g, { children: /* @__PURE__ */ b("div", {
698
699
  style: k,
699
- children: [/* @__PURE__ */ v(_, {
700
+ children: [/* @__PURE__ */ y(v, {
700
701
  component: "h2",
701
702
  variant: "h3",
702
703
  children: "歷程"
703
- }), Xt.length > 0 ? /* @__PURE__ */ v(re, {
704
- currentStep: Zt,
704
+ }), Qt.length > 0 ? /* @__PURE__ */ y(re, {
705
+ currentStep: $t,
705
706
  orientation: "vertical",
706
707
  type: "dot",
707
- children: Xt.map((e) => /* @__PURE__ */ v(ot, {
708
+ children: Qt.map((e) => /* @__PURE__ */ y(st, {
708
709
  descriptionParts: e.descriptionParts,
709
710
  error: e.error,
710
711
  forcePending: e.forcePending,
711
712
  title: e.title
712
713
  }, e.id))
713
- }) : /* @__PURE__ */ v(_, {
714
+ }) : /* @__PURE__ */ y(v, {
714
715
  color: "text-neutral",
715
716
  variant: "body",
716
717
  children: "尚無歷程紀錄。"
717
718
  })]
718
719
  }) })
719
720
  ] }),
720
- b ? /* @__PURE__ */ v(m, {
721
+ x ? /* @__PURE__ */ y(h, {
721
722
  modalType: "standard",
722
- onClose: () => j(!1),
723
- open: We,
723
+ onClose: () => Xe(!1),
724
+ open: M,
724
725
  showModalHeader: !0,
725
726
  size: "wide",
726
- supportingText: `${At(b.state)} · ${t(b.startedAt)}`,
727
+ supportingText: `${At(x.state)} · ${t(x.startedAt)}`,
727
728
  title: "流程圖",
728
- children: /* @__PURE__ */ y("div", {
729
+ children: /* @__PURE__ */ b("div", {
729
730
  style: Ge,
730
- children: [/* @__PURE__ */ v("div", {
731
+ children: [/* @__PURE__ */ y("div", {
731
732
  style: Ye,
732
- children: /* @__PURE__ */ y(Pe, {
733
- edges: $t,
733
+ children: /* @__PURE__ */ b(Fe, {
734
+ edges: tn,
734
735
  fitView: !0,
735
736
  fitViewOptions: { padding: .18 },
736
737
  maxZoom: 1.2,
737
738
  minZoom: .2,
738
- nodes: Qt,
739
+ nodes: en,
739
740
  nodesDraggable: !1,
740
741
  nodesFocusable: !1,
741
742
  nodeTypes: rt,
742
743
  panOnDrag: !0,
743
744
  proOptions: { hideAttribution: !0 },
744
- children: [/* @__PURE__ */ v(Me, {}), /* @__PURE__ */ v(Ne, { showInteractive: !1 })]
745
+ children: [/* @__PURE__ */ y(Me, {}), /* @__PURE__ */ y(Ne, { showInteractive: !1 })]
745
746
  })
746
- }), en.length > 0 ? /* @__PURE__ */ v("div", {
747
+ }), nn.length > 0 ? /* @__PURE__ */ y("div", {
747
748
  style: $e,
748
- children: en.map((e) => /* @__PURE__ */ v("span", {
749
+ children: nn.map((e) => /* @__PURE__ */ y("span", {
749
750
  style: et,
750
751
  children: e
751
752
  }, e))
752
753
  }) : null]
753
754
  })
754
755
  }) : null,
755
- /* @__PURE__ */ v(m, {
756
+ /* @__PURE__ */ y(h, {
756
757
  modalType: "standard",
757
758
  onClose: () => {
758
- K(null), It(null);
759
+ Nt(null), Lt(null);
759
760
  },
760
- open: !!(G && Mt),
761
+ open: !!(K && q),
761
762
  showModalHeader: !0,
762
763
  size: "wide",
763
- supportingText: G?.filename ?? void 0,
764
+ supportingText: K?.filename ?? void 0,
764
765
  title: "PDF 預覽",
765
- children: Mt ? /* @__PURE__ */ v(He, {
766
- filename: G?.filename ?? "PDF 預覽",
767
- fileUrl: Mt,
768
- onDownload: G ? () => void un(G) : void 0
766
+ children: q ? /* @__PURE__ */ y(Ue, {
767
+ filename: K?.filename ?? "PDF 預覽",
768
+ fileUrl: q,
769
+ onDownload: K ? () => void fn(K) : void 0
769
770
  }) : null
770
771
  }),
771
- /* @__PURE__ */ v(m, {
772
+ /* @__PURE__ */ y(h, {
772
773
  cancelText: "保留案件",
773
774
  confirmButtonProps: { variant: "destructive-primary" },
774
775
  confirmText: "確認取消",
775
- loading: O,
776
+ loading: A,
776
777
  modalStatusType: "error",
777
778
  modalType: "standard",
778
- onCancel: () => M(!1),
779
- onClose: () => M(!1),
780
- onConfirm: () => void Cn(),
781
- open: Qe,
779
+ onCancel: () => N(!1),
780
+ onClose: () => N(!1),
781
+ onConfirm: () => void Tn(),
782
+ open: tt,
782
783
  showModalFooter: !0,
783
784
  showModalHeader: !0,
784
785
  supportingText: "取消後會關閉目前待簽任務與候選簽核人。",
785
786
  title: "取消案件",
786
- children: /* @__PURE__ */ y("div", {
787
+ children: /* @__PURE__ */ b("div", {
787
788
  style: k,
788
- children: [/* @__PURE__ */ y(_, {
789
+ children: [/* @__PURE__ */ b(v, {
789
790
  variant: "body",
790
791
  children: [
791
792
  "確定要取消「",
792
- b?.title ?? "",
793
+ x?.title ?? "",
793
794
  "」嗎?"
794
795
  ]
795
- }), /* @__PURE__ */ v(r, {
796
+ }), /* @__PURE__ */ y(i, {
796
797
  label: "取消原因",
797
798
  name: "cancelComment",
798
- children: /* @__PURE__ */ v(g, {
799
- onChange: (e) => Ze(e.target.value),
799
+ children: /* @__PURE__ */ y(_, {
800
+ onChange: (e) => Qe(e.target.value),
800
801
  placeholder: "可填寫取消原因",
801
802
  resize: "vertical",
802
803
  rows: 3,
803
- value: Xe
804
+ value: Ze
804
805
  })
805
806
  })]
806
807
  })
807
808
  }),
808
- /* @__PURE__ */ v(m, {
809
+ /* @__PURE__ */ y(h, {
809
810
  cancelText: "取消",
810
811
  confirmButtonProps: {
811
- disabled: !Lt,
812
+ disabled: !J,
812
813
  variant: "destructive-primary"
813
814
  },
814
815
  confirmText: "送出拒絕",
815
- loading: O,
816
+ loading: A,
816
817
  modalStatusType: "error",
817
818
  modalType: "standard",
818
- onCancel: mn,
819
- onClose: mn,
820
- onConfirm: () => void bn(),
821
- open: L,
819
+ onCancel: gn,
820
+ onClose: gn,
821
+ onConfirm: () => void Sn(),
822
+ open: pt,
822
823
  showModalFooter: !0,
823
824
  showModalHeader: !0,
824
825
  size: "regular",
825
826
  supportingText: "拒絕案件時必須留下原因,供發起人與後續追蹤查看。",
826
827
  title: "拒絕原因",
827
- children: /* @__PURE__ */ y("div", {
828
+ children: /* @__PURE__ */ b("div", {
828
829
  style: Ke,
829
- children: [/* @__PURE__ */ v(r, {
830
+ children: [/* @__PURE__ */ y(i, {
830
831
  label: "拒絕原因",
831
832
  name: "rejectReason",
832
833
  required: !0,
833
- children: /* @__PURE__ */ v(g, {
834
+ children: /* @__PURE__ */ y(_, {
834
835
  autoFocus: !0,
835
836
  onChange: (e) => {
836
- N(e.target.value), I(null);
837
+ F(e.target.value), I(null);
837
838
  },
838
839
  placeholder: "請說明拒絕原因",
839
840
  ref: nt,
840
841
  resize: "vertical",
841
842
  rows: 4,
842
843
  style: qe,
843
- type: F ? "error" : "default",
844
- value: tt
844
+ type: ct ? "error" : "default",
845
+ value: it
845
846
  })
846
- }), F ? /* @__PURE__ */ v(_, {
847
+ }), ct ? /* @__PURE__ */ y(v, {
847
848
  color: "text-error",
848
849
  variant: "body",
849
- children: F
850
+ children: ct
850
851
  }) : null]
851
852
  })
852
853
  }),
853
- /* @__PURE__ */ v(m, {
854
+ /* @__PURE__ */ y(h, {
854
855
  cancelText: "取消",
855
- confirmButtonProps: { disabled: !gt },
856
+ confirmButtonProps: { disabled: !H },
856
857
  confirmText: "送出轉派",
857
- loading: O,
858
+ loading: A,
858
859
  modalType: "standard",
859
- onCancel: vn,
860
- onClose: vn,
861
- onConfirm: () => void xn(),
862
- open: xt,
860
+ onCancel: bn,
861
+ onClose: bn,
862
+ onConfirm: () => void Cn(),
863
+ open: Ct,
863
864
  showModalFooter: !0,
864
865
  showModalHeader: !0,
865
866
  size: "regular",
866
867
  supportingText: "轉派後,原任務會保留轉派紀錄,新的待簽任務會指派給指定成員。",
867
868
  title: "轉派簽核",
868
- children: /* @__PURE__ */ y("div", {
869
+ children: /* @__PURE__ */ b("div", {
869
870
  style: Je,
870
- children: [/* @__PURE__ */ v(r, {
871
+ children: [/* @__PURE__ */ y(i, {
871
872
  label: "轉派對象",
872
873
  name: "transferToMemberId",
873
874
  required: !0,
874
- children: /* @__PURE__ */ v(f, {
875
+ children: /* @__PURE__ */ y(p, {
875
876
  asyncData: !0,
876
877
  disabledOptionsFilter: !0,
877
878
  emptyText: "沒有符合的成員",
@@ -881,75 +882,75 @@ function N({ instanceId: a }) {
881
882
  name: "transfer-member-search",
882
883
  spellCheck: !1
883
884
  },
884
- loading: _t,
885
+ loading: yt,
885
886
  loadingText: "搜尋成員中...",
886
887
  mode: "single",
887
- onChange: (e) => U(Pt(e)),
888
- onSearch: yn,
889
- onSearchTextChange: (e) => U(Ft(e, yt)),
888
+ onChange: (e) => U(Ft(e)),
889
+ onSearch: xn,
890
+ onSearchTextChange: (e) => U(It(e, xt)),
890
891
  onVisibilityChange: (e) => {
891
- e && yn("");
892
+ e && xn("");
892
893
  },
893
- options: [...yt],
894
+ options: [...xt],
894
895
  placeholder: "搜尋姓名或信箱",
895
896
  searchDebounceTime: 300,
896
- value: gt
897
+ value: H
897
898
  })
898
- }), /* @__PURE__ */ v(r, {
899
+ }), /* @__PURE__ */ y(i, {
899
900
  label: "轉派說明",
900
901
  name: "transferComment",
901
- children: /* @__PURE__ */ v(g, {
902
- onChange: (e) => H(e.target.value),
902
+ children: /* @__PURE__ */ y(_, {
903
+ onChange: (e) => V(e.target.value),
903
904
  placeholder: "可補充轉派原因",
904
905
  ref: nt,
905
906
  resize: "vertical",
906
907
  rows: 4,
907
908
  style: qe,
908
- value: ht
909
+ value: vt
909
910
  })
910
911
  })]
911
912
  })
912
913
  }),
913
- /* @__PURE__ */ v(m, {
914
+ /* @__PURE__ */ y(h, {
914
915
  cancelText: "取消",
915
- confirmButtonProps: { disabled: !Ut },
916
+ confirmButtonProps: { disabled: !Wt },
916
917
  confirmText: "送出退回",
917
- loading: O,
918
+ loading: A,
918
919
  modalType: "standard",
919
- onCancel: gn,
920
- onClose: gn,
921
- onConfirm: () => void Sn(),
922
- open: z,
920
+ onCancel: vn,
921
+ onClose: vn,
922
+ onConfirm: () => void wn(),
923
+ open: ht,
923
924
  showModalFooter: !0,
924
925
  showModalHeader: !0,
925
926
  size: "regular",
926
927
  supportingText: "退回後,流程會回到指定節點並等待重新處理。",
927
928
  title: "退回簽核",
928
- children: /* @__PURE__ */ y("div", {
929
+ children: /* @__PURE__ */ b("div", {
929
930
  style: Je,
930
- children: [/* @__PURE__ */ v(r, {
931
+ children: [/* @__PURE__ */ y(i, {
931
932
  label: "退回節點",
932
933
  name: "returnTargetNodeId",
933
934
  required: !0,
934
- children: /* @__PURE__ */ v(ne, {
935
+ children: /* @__PURE__ */ y(ne, {
935
936
  clearable: !1,
936
937
  fullWidth: !0,
937
- onChange: (e) => V(e?.id ?? null),
938
- options: [...X],
938
+ onChange: (e) => B(e?.id ?? null),
939
+ options: [...Q],
939
940
  placeholder: "選擇退回節點",
940
- value: Ut
941
+ value: Wt
941
942
  })
942
- }), /* @__PURE__ */ v(r, {
943
+ }), /* @__PURE__ */ y(i, {
943
944
  label: "退回說明",
944
945
  name: "returnComment",
945
- children: /* @__PURE__ */ v(g, {
946
- onChange: (e) => R(e.target.value),
946
+ children: /* @__PURE__ */ y(_, {
947
+ onChange: (e) => z(e.target.value),
947
948
  placeholder: "可補充需要修改的內容",
948
949
  ref: nt,
949
950
  resize: "vertical",
950
951
  rows: 4,
951
952
  style: qe,
952
- value: ft
953
+ value: R
953
954
  })
954
955
  })]
955
956
  })
@@ -960,110 +961,110 @@ function N({ instanceId: a }) {
960
961
  function P(e) {
961
962
  return e instanceof Error ? e.message : "發生未知錯誤";
962
963
  }
963
- function it(e) {
964
+ function at(e) {
964
965
  return !Number.isFinite(e) || e <= 0 ? "-" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1024 / 1024).toFixed(1)} MB`;
965
966
  }
966
- function at(e) {
967
+ function ot(e) {
967
968
  return e.length > 16 ? `${e.slice(0, 12)}...` : e;
968
969
  }
969
970
  function F(...e) {
970
- return e.filter((e) => q(e ?? null)).join(" ");
971
+ return e.filter((e) => Y(e ?? null)).join(" ");
971
972
  }
972
- var ot = o(function({ className: e, descriptionParts: t, error: n, forcePending: r = !1, index: i = 0, orientation: o, status: s = "pending", title: c, type: l = "number", ...u }, d) {
973
+ var st = s(function({ className: e, descriptionParts: t, error: n, forcePending: r = !1, index: i = 0, orientation: a, status: s = "pending", title: c, type: l = "number", ...u }, d) {
973
974
  let f = r ? "pending" : s;
974
- return /* @__PURE__ */ y("div", {
975
+ return /* @__PURE__ */ b("div", {
975
976
  ...u,
976
- className: F(w.host, l === "dot" ? w.dot : null, n && f !== "processing" ? w.error : null, o === "horizontal" ? w.horizontal : null, l === "number" ? w.number : null, f === "pending" ? w.pending : null, f === "processing" ? w.processing : null, n && f === "processing" ? w.processingError : null, !n && f === "succeeded" ? w.succeeded : null, o === "vertical" ? w.vertical : null, e),
977
+ className: F(C.host, l === "dot" ? C.dot : null, n && f !== "processing" ? C.error : null, a === "horizontal" ? C.horizontal : null, l === "number" ? C.number : null, f === "pending" ? C.pending : null, f === "processing" ? C.processing : null, n && f === "processing" ? C.processingError : null, !n && f === "succeeded" ? C.succeeded : null, a === "vertical" ? C.vertical : null, e),
977
978
  ref: d,
978
- children: [l === "dot" ? /* @__PURE__ */ v("span", { className: F(w.statusIndicator, w.statusIndicatorDot) }) : /* @__PURE__ */ v("span", {
979
- className: w.statusIndicator,
979
+ children: [l === "dot" ? /* @__PURE__ */ y("span", { className: F(C.statusIndicator, C.statusIndicatorDot) }) : /* @__PURE__ */ y("span", {
980
+ className: C.statusIndicator,
980
981
  children: i + 1
981
- }), /* @__PURE__ */ y("div", {
982
- className: w.textContainer,
983
- children: [/* @__PURE__ */ y(_, {
984
- className: w.title,
982
+ }), /* @__PURE__ */ b("div", {
983
+ className: C.textContainer,
984
+ children: [/* @__PURE__ */ b(v, {
985
+ className: C.title,
985
986
  variant: "label-primary-highlight",
986
- children: [c, /* @__PURE__ */ v("span", { className: w.titleConnectLine })]
987
- }), t.length > 0 ? /* @__PURE__ */ v(_, {
988
- className: w.description,
987
+ children: [c, /* @__PURE__ */ y("span", { className: C.titleConnectLine })]
988
+ }), t.length > 0 ? /* @__PURE__ */ y(v, {
989
+ className: C.description,
989
990
  variant: "caption",
990
- children: t.map((e, t) => /* @__PURE__ */ y(a, { children: [t > 0 ? " · " : null, I(e)] }, `${e.type}-${t}`))
991
+ children: t.map((e, t) => /* @__PURE__ */ b(o, { children: [t > 0 ? " · " : null, ct(e)] }, `${e.type}-${t}`))
991
992
  }) : null]
992
993
  })]
993
994
  });
994
995
  });
995
- function I(e) {
996
- return e.type === "text" ? e.text : e.type === "dangerText" ? /* @__PURE__ */ v("span", {
997
- style: tt,
996
+ function ct(e) {
997
+ return e.type === "text" ? e.text : e.type === "dangerText" ? /* @__PURE__ */ y("span", {
998
+ style: N,
998
999
  children: e.text
999
- }) : e.email ? /* @__PURE__ */ y(oe, { children: [
1000
+ }) : e.email ? /* @__PURE__ */ b(oe, { children: [
1000
1001
  e.prefix,
1001
1002
  ":",
1002
- /* @__PURE__ */ v(ae, {
1003
+ /* @__PURE__ */ y(ae, {
1003
1004
  title: e.email,
1004
- children: ({ onMouseEnter: t, onMouseLeave: n, ref: r }) => /* @__PURE__ */ v("span", {
1005
+ children: ({ onMouseEnter: t, onMouseLeave: n, ref: r }) => /* @__PURE__ */ y("span", {
1005
1006
  "data-testid": e.memberId ? `member-tooltip-${e.memberId}` : void 0,
1006
1007
  onMouseEnter: t,
1007
1008
  onMouseLeave: n,
1008
1009
  ref: r,
1009
- style: M,
1010
+ style: tt,
1010
1011
  children: e.label
1011
1012
  })
1012
1013
  })
1013
1014
  ] }) : `${e.prefix}:${e.label}`;
1014
1015
  }
1015
- async function st({ activityLogs: e, tasks: t }) {
1016
+ async function lt({ activityLogs: e, tasks: t }) {
1016
1017
  let n = [...new Set([
1017
1018
  ...e.map((e) => e.actorMemberId),
1018
1019
  ...t.map((e) => e.assigneeMemberId),
1019
1020
  ...t.map((e) => e.originalAssigneeMemberId),
1020
1021
  ...t.flatMap((e) => e.candidateMemberIds),
1021
- ...t.flatMap((e) => It(e.delegationChainJson).flatMap((e) => [e.from, e.to]))
1022
- ].filter(q))];
1022
+ ...t.flatMap((e) => q(e.delegationChainJson).flatMap((e) => [e.from, e.to]))
1023
+ ].filter(Y))];
1023
1024
  try {
1024
- return await me(n);
1025
+ return await x(n);
1025
1026
  } catch {
1026
1027
  return [];
1027
1028
  }
1028
1029
  }
1029
- async function ct(e) {
1030
- return (await Promise.all(e.map((e) => b(e.id)))).flat();
1030
+ async function ut(e) {
1031
+ return (await Promise.all(e.map((e) => ue(e.id)))).flat();
1031
1032
  }
1032
- function lt(e) {
1033
+ function dt(e) {
1033
1034
  return e.reduce((e, t) => {
1034
1035
  let n = e.get(t.taskId), r = !n || new Date(t.decidedAt).getTime() > new Date(n.decidedAt).getTime() ? t : n;
1035
1036
  return new Map(e).set(t.taskId, r);
1036
1037
  }, /* @__PURE__ */ new Map());
1037
1038
  }
1038
- function ut(e, t, n, r, i, a, o, s, c) {
1039
- let l = e.filter(B).map((e) => {
1040
- let t = yt(e), n = wt(e.nodeId, r);
1039
+ function ft(e, t, n, r, i, a, o, s, c) {
1040
+ let l = e.filter(ht).map((e) => {
1041
+ let t = bt(e), n = Tt(e.nodeId, r);
1041
1042
  return {
1042
1043
  descriptionParts: [
1043
- L(n ? `節點:${n}` : "節點:全流程"),
1044
- ft("操作者", e.actorMemberId, a, "系統"),
1045
- L(`時間:${G(e.createdAt)}`),
1046
- ...Ct(e, t, r, o, s, c, a)
1044
+ I(n ? `節點:${n}` : "節點:全流程"),
1045
+ L("操作者", e.actorMemberId, a, "系統"),
1046
+ I(`時間:${Mt(e.createdAt)}`),
1047
+ ...wt(e, t, r, o, s, c, a)
1047
1048
  ].filter(z),
1048
1049
  error: jt(e, t),
1049
1050
  id: e.id,
1050
- title: bt(e.eventType, t)
1051
+ title: xt(e.eventType, t)
1051
1052
  };
1052
- }), u = t.filter(J).map((e) => ({
1053
+ }), u = t.filter(zt).map((e) => ({
1053
1054
  descriptionParts: [
1054
- L(`節點:${Tt(e.nodeId, r)}`),
1055
- ft("處理者", e.assigneeMemberId, a, "未指定"),
1056
- L(`建立時間:${G(e.createdAt)}`)
1055
+ I(`節點:${W(e.nodeId, r)}`),
1056
+ L("處理者", e.assigneeMemberId, a, "未指定"),
1057
+ I(`建立時間:${Mt(e.createdAt)}`)
1057
1058
  ].filter(z),
1058
1059
  error: !1,
1059
1060
  id: `pending-task-${e.id}`,
1060
1061
  title: e.status === "IN_PROGRESS" ? "簽核處理中" : "等待簽核處理"
1061
- })), d = new Set([...e.filter(B).map((e) => e.nodeId), ...t.map((e) => e.nodeId)].filter(q)), f = r ? V(r, t, n, i, d).map((e) => ({
1062
- descriptionParts: [L(`${Z(e.type)} · 尚未抵達`)].filter(z),
1062
+ })), d = new Set([...e.filter(ht).map((e) => e.nodeId), ...t.map((e) => e.nodeId)].filter(Y)), f = r ? _t(r, t, n, i, d).map((e) => ({
1063
+ descriptionParts: [I(`${Q(e.type)} · 尚未抵達`)].filter(z),
1063
1064
  error: !1,
1064
1065
  forcePending: !0,
1065
1066
  id: `future-node-${e.id}`,
1066
- title: vt(e)
1067
+ title: yt(e)
1067
1068
  })) : [];
1068
1069
  return [
1069
1070
  ...l,
@@ -1071,19 +1072,19 @@ function ut(e, t, n, r, i, a, o, s, c) {
1071
1072
  ...f
1072
1073
  ];
1073
1074
  }
1074
- function L(e) {
1075
- return q(e) ? {
1075
+ function I(e) {
1076
+ return Y(e) ? {
1076
1077
  text: e,
1077
1078
  type: "text"
1078
1079
  } : null;
1079
1080
  }
1080
- function dt(e) {
1081
- return q(e) ? {
1081
+ function pt(e) {
1082
+ return Y(e) ? {
1082
1083
  text: e,
1083
1084
  type: "dangerText"
1084
1085
  } : null;
1085
1086
  }
1086
- function ft(e, t, n, r) {
1087
+ function L(e, t, n, r) {
1087
1088
  let i = t ? n.get(t) : null;
1088
1089
  return {
1089
1090
  email: i?.email ?? null,
@@ -1101,99 +1102,99 @@ function R(e, t) {
1101
1102
  function z(e) {
1102
1103
  return !!e;
1103
1104
  }
1104
- function pt(e) {
1105
+ function mt(e) {
1105
1106
  let t = e.findIndex((e) => e.id.startsWith("pending-task-") || e.id.startsWith("future-node-"));
1106
1107
  return t === -1 ? e.length : t;
1107
1108
  }
1108
- function B(e) {
1109
+ function ht(e) {
1109
1110
  return e.eventType === "INSTANCE_STARTED" || e.eventType === "TASK_DECIDED" || e.eventType === "SLA_TRIGGERED";
1110
1111
  }
1111
- function mt(e, t, n, r, i) {
1112
+ function gt(e, t, n, r, i) {
1112
1113
  if (e.type === "startEvent" || i.has(e.id)) return !1;
1113
1114
  if (r === "REJECTED") return !0;
1114
- let a = X(e, t, n, r);
1115
+ let a = Z(e, t, n, r);
1115
1116
  return a.tone === "neutral" || a.tone === "waiting";
1116
1117
  }
1117
- function V(e, t, n, r, i) {
1118
+ function _t(e, t, n, r, i) {
1118
1119
  if (r !== "RUNNING" && r !== "REJECTED") return [];
1119
- let a = e.nodes.filter((e) => mt(e, t, n, r, i)), o = ht(e, a, t, n, i), s = new Map(e.nodes.map((e, t) => [e.id, t]));
1120
+ let a = e.nodes.filter((e) => gt(e, t, n, r, i)), o = B(e, a, t, n, i), s = new Map(e.nodes.map((e, t) => [e.id, t]));
1120
1121
  return a.filter((e) => o.has(e.id)).sort((e, t) => {
1121
1122
  let n = o.get(e.id) ?? 0, r = o.get(t.id) ?? 0;
1122
1123
  return n === r ? e.position.x === t.position.x ? e.position.y === t.position.y ? (s.get(e.id) ?? 0) - (s.get(t.id) ?? 0) : e.position.y - t.position.y : e.position.x - t.position.x : n - r;
1123
1124
  });
1124
1125
  }
1125
- function ht(e, t, n, r, i) {
1126
+ function B(e, t, n, r, i) {
1126
1127
  let a = new Set(t.map((e) => e.id)), o = e.edges.reduce((e, t) => {
1127
1128
  let n = [...e.get(t.source) ?? [], t.target];
1128
1129
  return new Map(e).set(t.source, n);
1129
1130
  }, /* @__PURE__ */ new Map());
1130
- return H(e, n, r, i).reduce((e, t) => _t(e, gt(t, o, a)), /* @__PURE__ */ new Map());
1131
+ return vt(e, n, r, i).reduce((e, t) => U(e, V(t, o, a)), /* @__PURE__ */ new Map());
1131
1132
  }
1132
- function H(e, t, n, r) {
1133
- let i = n.filter((e) => e.status === "ACTIVE" || e.status === "WAITING").map((e) => e.currentNodeId), a = t.filter(J).map((e) => e.nodeId), o = e.nodes.filter((e) => r.has(e.id)).map((e) => e.id), s = [...new Set([
1133
+ function vt(e, t, n, r) {
1134
+ let i = n.filter((e) => e.status === "ACTIVE" || e.status === "WAITING").map((e) => e.currentNodeId), a = t.filter(zt).map((e) => e.nodeId), o = e.nodes.filter((e) => r.has(e.id)).map((e) => e.id), s = [...new Set([
1134
1135
  ...i,
1135
1136
  ...a,
1136
1137
  ...o
1137
1138
  ])], c = e.nodes.filter((e) => e.type === "startEvent").map((e) => e.id);
1138
1139
  return s.length > 0 ? s : c;
1139
1140
  }
1140
- function gt(e, t, n) {
1141
- return U([{
1141
+ function V(e, t, n) {
1142
+ return H([{
1142
1143
  distance: 0,
1143
1144
  nodeId: e
1144
1145
  }], t, n);
1145
1146
  }
1146
- function U(e, t, n, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map()) {
1147
+ function H(e, t, n, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map()) {
1147
1148
  let [a, ...o] = e;
1148
1149
  if (!a) return i;
1149
- if (r.has(a.nodeId)) return U(o, t, n, r, i);
1150
+ if (r.has(a.nodeId)) return H(o, t, n, r, i);
1150
1151
  let s = new Set(r).add(a.nodeId), c = n.has(a.nodeId) ? new Map(i).set(a.nodeId, Math.min(i.get(a.nodeId) ?? a.distance, a.distance)) : i;
1151
- return U([...o, ...(t.get(a.nodeId) ?? []).map((e) => ({
1152
+ return H([...o, ...(t.get(a.nodeId) ?? []).map((e) => ({
1152
1153
  distance: a.distance + 1,
1153
1154
  nodeId: e
1154
1155
  }))], t, n, s, c);
1155
1156
  }
1156
- function _t(e, t) {
1157
+ function U(e, t) {
1157
1158
  return [...t.entries()].reduce((e, [t, n]) => new Map(e).set(t, Math.min(e.get(t) ?? n, n)), e);
1158
1159
  }
1159
- function vt(e) {
1160
+ function yt(e) {
1160
1161
  return e.type === "userTask" ? `未來簽核:${e.data.label}` : e.type === "serviceTask" ? `未來知會:${e.data.label}` : e.type === "exclusiveGateway" ? `未來分流:${e.data.label}` : e.type === "parallelGateway" ? `未來匯合:${e.data.label}` : e.type === "endEvent" ? `流程完成:${e.data.label}` : `未來節點:${e.data.label}`;
1161
1162
  }
1162
- function yt(e) {
1163
+ function bt(e) {
1163
1164
  try {
1164
1165
  let t = JSON.parse(e.payloadJson);
1165
- return zt(t) ? t : {};
1166
+ return Rt(t) ? t : {};
1166
1167
  } catch {
1167
1168
  return {};
1168
1169
  }
1169
1170
  }
1170
- function bt(e, t) {
1171
- return e === "INSTANCE_STARTED" ? "案件已發起" : e === "TOKEN_CREATED" ? "流程路徑已建立" : e === "ENGINE_PROCESS_REQUESTED" ? "流程引擎已處理" : e === "TOKEN_ADVANCED" ? "流程已前進" : e === "TASK_CREATED" ? "待簽任務已建立" : e === "TASK_DECIDED" ? xt(K(t, "action")) : e === "SLA_TRIGGERED" ? "時限提醒已觸發" : e;
1171
+ function xt(e, t) {
1172
+ return e === "INSTANCE_STARTED" ? "案件已發起" : e === "TOKEN_CREATED" ? "流程路徑已建立" : e === "ENGINE_PROCESS_REQUESTED" ? "流程引擎已處理" : e === "TOKEN_ADVANCED" ? "流程已前進" : e === "TASK_CREATED" ? "待簽任務已建立" : e === "TASK_DECIDED" ? St(K(t, "action")) : e === "SLA_TRIGGERED" ? "時限提醒已觸發" : e;
1172
1173
  }
1173
- function xt(e) {
1174
+ function St(e) {
1174
1175
  return e === "APPROVED" ? "已同意" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "TRANSFERRED" ? "已轉派" : "簽核已決議";
1175
1176
  }
1176
- function St(e, t, n, r) {
1177
+ function Ct(e, t, n, r) {
1177
1178
  if (e.eventType === "TASK_CREATED") {
1178
1179
  let e = K(t, "assigneeMemberId"), n = K(t, "originalAssigneeMemberId");
1179
1180
  if (!e) {
1180
- let e = Mt(t, "candidateMemberIds");
1181
+ let e = Nt(t, "candidateMemberIds");
1181
1182
  return e.length ? `候選簽核人:${e.map((e) => R(e, r)).join("、")}` : null;
1182
1183
  }
1183
1184
  let i = R(e, r), a = R(n, r);
1184
1185
  return n && n !== e ? `待簽人:${i}(原簽核人:${a})` : `待簽人:${i}`;
1185
1186
  }
1186
1187
  if (e.eventType === "TASK_DECIDED") {
1187
- let e = K(t, "action"), n = K(t, "comment"), i = e ? `決議:${W(e)}` : null, a = K(t, "transferToMemberId");
1188
- return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(q).join(" · ") : e === "TRANSFERRED" ? [i, `轉派給:${R(a, r)}`].filter(q).join(" · ") : i;
1188
+ let e = K(t, "action"), n = K(t, "comment"), i = e ? `決議:${G(e)}` : null, a = K(t, "transferToMemberId");
1189
+ return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(Y).join(" · ") : e === "TRANSFERRED" ? [i, `轉派給:${R(a, r)}`].filter(Y).join(" · ") : i;
1189
1190
  }
1190
1191
  if (e.eventType === "TOKEN_ADVANCED") {
1191
1192
  let e = K(t, "action");
1192
- if (e) return `流程結果:${W(e)}`;
1193
- let r = Rt(t, "arrivedCount"), i = Rt(t, "requiredCount");
1193
+ if (e) return `流程結果:${G(e)}`;
1194
+ let r = J(t, "arrivedCount"), i = J(t, "requiredCount");
1194
1195
  if (r !== null && i !== null) return `等待匯合:${r}/${i}`;
1195
1196
  let a = K(t, "fromNodeId"), o = K(t, "toNodeId");
1196
- if (a && o) return `由 ${Tt(a, n)} 前進至 ${Tt(o, n)}`;
1197
+ if (a && o) return `由 ${W(a, n)} 前進至 ${W(o, n)}`;
1197
1198
  }
1198
1199
  if (e.eventType === "ENGINE_PROCESS_REQUESTED") {
1199
1200
  let e = K(t, "state");
@@ -1201,44 +1202,44 @@ function St(e, t, n, r) {
1201
1202
  }
1202
1203
  return null;
1203
1204
  }
1204
- function Ct(e, t, n, r, i, a, o) {
1205
- if (e.eventType !== "TASK_DECIDED") return [L(St(e, t, n, o))].filter(z);
1205
+ function wt(e, t, n, r, i, a, o) {
1206
+ if (e.eventType !== "TASK_DECIDED") return [I(Ct(e, t, n, o))].filter(z);
1206
1207
  let s = e.taskId ? r.get(e.taskId) : null, c = K(t, "action") ?? s?.action ?? null, l = K(t, "comment") ?? s?.comment ?? null, u = K(t, "transferToMemberId") ?? s?.transferToMemberId ?? null, d = K(t, "signatureId") ?? s?.signatureId ?? null, f = d ? i.get(d) : null;
1207
1208
  return [
1208
- L(c ? `決議:${W(c)}` : null),
1209
- c === "REJECTED" ? dt(`拒絕原因:${l ?? "-"}`) : null,
1210
- c === "RETURNED" ? L(`退回說明:${l ?? "-"}`) : null,
1211
- c === "TRANSFERRED" ? L(`轉派給:${R(u, o)}`) : null,
1212
- c === "TRANSFERRED" ? L(`轉派說明:${l ?? "-"}`) : null,
1213
- f ? L(a?.valid ? `簽章:已驗證(${at(f.signedPayloadHash)})` : `簽章:待檢查(${at(f.signedPayloadHash)})`) : null
1209
+ I(c ? `決議:${G(c)}` : null),
1210
+ c === "REJECTED" ? pt(`拒絕原因:${l ?? "-"}`) : null,
1211
+ c === "RETURNED" ? I(`退回說明:${l ?? "-"}`) : null,
1212
+ c === "TRANSFERRED" ? I(`轉派給:${R(u, o)}`) : null,
1213
+ c === "TRANSFERRED" ? I(`轉派說明:${l ?? "-"}`) : null,
1214
+ f ? I(a?.valid ? `簽章:已驗證(${ot(f.signedPayloadHash)})` : `簽章:待檢查(${ot(f.signedPayloadHash)})`) : null
1214
1215
  ].filter(z);
1215
1216
  }
1216
- function wt(e, t) {
1217
- return e ? Tt(e, t) : null;
1218
- }
1219
1217
  function Tt(e, t) {
1218
+ return e ? W(e, t) : null;
1219
+ }
1220
+ function W(e, t) {
1220
1221
  return t?.nodes.find((t) => t.id === e)?.data.label ?? e;
1221
1222
  }
1222
1223
  function Et(e, t) {
1223
1224
  if (t.type !== "userTask" || !t.data.returnBehavior.allowReturn) return [];
1224
1225
  if (t.data.returnBehavior.allowedTargets === "ANY") return e.nodes.filter((e) => e.id !== t.id).map((e) => ({
1225
1226
  id: e.id,
1226
- name: `${e.data.label}(${Z(e.type)})`
1227
+ name: `${e.data.label}(${Q(e.type)})`
1227
1228
  }));
1228
1229
  let n = t.data.returnBehavior.allowedTargets === "INITIATOR" ? e.nodes.find((e) => e.type === "startEvent")?.id : e.edges.find((e) => e.target === t.id)?.source, r = e.nodes.find((e) => e.id === n);
1229
1230
  return r ? [{
1230
1231
  id: r.id,
1231
- name: `${r.data.label}(${Z(r.type)})`
1232
+ name: `${r.data.label}(${Q(r.type)})`
1232
1233
  }] : [];
1233
1234
  }
1234
- function W(e) {
1235
+ function G(e) {
1235
1236
  return e === "APPROVED" ? "同意" : e === "REJECTED" ? "拒絕" : e === "RETURNED" ? "退回" : e === "TRANSFERRED" ? "轉派" : e;
1236
1237
  }
1237
1238
  function Dt(e) {
1238
1239
  return e === "PENDING" ? "待處理" : e === "IN_PROGRESS" ? "處理中" : e === "COMPLETED" ? "已完成" : e === "CANCELLED" ? "已取消" : e === "TRANSFERRED" ? "已轉派" : e;
1239
1240
  }
1240
1241
  function Ot(e, t = /* @__PURE__ */ new Map()) {
1241
- let n = It(e.delegationChainJson);
1242
+ let n = q(e.delegationChainJson);
1242
1243
  if (!e.assigneeMemberId) return e.candidateMemberIds.length ? `候選 ${e.candidateMemberIds.map((e) => R(e, t)).join("、")}` : "未指定";
1243
1244
  let r = R(e.assigneeMemberId, t), i = R(e.originalAssigneeMemberId, t);
1244
1245
  return n.length === 0 || e.originalAssigneeMemberId === e.assigneeMemberId ? r : `${r}(原:${i})`;
@@ -1252,26 +1253,26 @@ function At(e) {
1252
1253
  function jt(e, t) {
1253
1254
  return e.eventType === "SLA_TRIGGERED" || K(t, "action") === "REJECTED" || K(t, "instanceState") === "REJECTED";
1254
1255
  }
1255
- function G(e) {
1256
+ function Mt(e) {
1256
1257
  return t(e);
1257
1258
  }
1258
1259
  function K(e, t) {
1259
1260
  let n = e[t];
1260
1261
  return typeof n == "string" ? n : null;
1261
1262
  }
1262
- function Mt(e, t) {
1263
+ function Nt(e, t) {
1263
1264
  let n = e[t];
1264
1265
  return Array.isArray(n) ? n.filter((e) => typeof e == "string") : [];
1265
1266
  }
1266
- function Nt(e) {
1267
+ function Pt(e) {
1267
1268
  return {
1268
1269
  email: e.email,
1269
1270
  id: e.memberId,
1270
1271
  name: `${e.name} · ${e.email}`
1271
1272
  };
1272
1273
  }
1273
- function Pt(e) {
1274
- if (!zt(e)) return null;
1274
+ function Ft(e) {
1275
+ if (!Rt(e)) return null;
1275
1276
  let t = e.email, n = e.id, r = e.name;
1276
1277
  return typeof n == "string" && typeof r == "string" ? {
1277
1278
  email: typeof t == "string" ? t : null,
@@ -1279,7 +1280,7 @@ function Pt(e) {
1279
1280
  name: r
1280
1281
  } : null;
1281
1282
  }
1282
- function Ft(e, t) {
1283
+ function It(e, t) {
1283
1284
  let n = e.trim().toLocaleLowerCase();
1284
1285
  if (!n) return null;
1285
1286
  let r = t.filter((e) => [
@@ -1289,10 +1290,10 @@ function Ft(e, t) {
1289
1290
  ].some((e) => e.toLocaleLowerCase().includes(n)));
1290
1291
  return r.length === 1 ? r[0] ?? null : null;
1291
1292
  }
1292
- function It(e) {
1293
+ function q(e) {
1293
1294
  try {
1294
1295
  let t = JSON.parse(e);
1295
- return Array.isArray(t) ? t.map((e) => zt(e) ? Lt(e) : null).filter((e) => e !== null) : [];
1296
+ return Array.isArray(t) ? t.map((e) => Rt(e) ? Lt(e) : null).filter((e) => e !== null) : [];
1296
1297
  } catch {
1297
1298
  return [];
1298
1299
  }
@@ -1306,46 +1307,46 @@ function Lt(e) {
1306
1307
  to: n
1307
1308
  };
1308
1309
  }
1309
- function Rt(e, t) {
1310
+ function J(e, t) {
1310
1311
  let n = e[t];
1311
1312
  return typeof n == "number" ? n : null;
1312
1313
  }
1313
- function q(e) {
1314
+ function Y(e) {
1314
1315
  return typeof e == "string" && e.trim().length > 0;
1315
1316
  }
1316
- function zt(e) {
1317
+ function Rt(e) {
1317
1318
  return typeof e == "object" && !!e;
1318
1319
  }
1319
- function J(e) {
1320
+ function zt(e) {
1320
1321
  return e.status === "PENDING" || e.status === "IN_PROGRESS";
1321
1322
  }
1322
- function Y({ data: e }) {
1323
- return /* @__PURE__ */ y("div", {
1323
+ function X({ data: e }) {
1324
+ return /* @__PURE__ */ b("div", {
1324
1325
  style: Ut(e.tone),
1325
1326
  children: [
1326
- /* @__PURE__ */ v(x, {
1327
+ /* @__PURE__ */ y(Pe, {
1327
1328
  isConnectable: !1,
1328
1329
  position: S.Left,
1329
1330
  style: Qe,
1330
1331
  type: "target"
1331
1332
  }),
1332
- /* @__PURE__ */ v(_, {
1333
+ /* @__PURE__ */ y(v, {
1333
1334
  component: "span",
1334
1335
  ellipsis: !0,
1335
1336
  title: e.label,
1336
1337
  variant: "label-primary",
1337
1338
  children: e.label
1338
1339
  }),
1339
- /* @__PURE__ */ v("span", {
1340
+ /* @__PURE__ */ y("span", {
1340
1341
  style: Wt(e.tone),
1341
1342
  children: e.statusLabel
1342
1343
  }),
1343
- /* @__PURE__ */ v("span", {
1344
+ /* @__PURE__ */ y("span", {
1344
1345
  title: e.secondaryLabel,
1345
1346
  style: Ze,
1346
1347
  children: e.secondaryLabel || e.kindLabel
1347
1348
  }),
1348
- /* @__PURE__ */ v(x, {
1349
+ /* @__PURE__ */ y(Pe, {
1349
1350
  isConnectable: !1,
1350
1351
  position: S.Right,
1351
1352
  style: Qe,
@@ -1356,10 +1357,10 @@ function Y({ data: e }) {
1356
1357
  }
1357
1358
  function Bt(e, t, n, r) {
1358
1359
  return e.nodes.map((e) => {
1359
- let i = X(e, t, n, r);
1360
+ let i = Z(e, t, n, r);
1360
1361
  return {
1361
1362
  data: {
1362
- kindLabel: Z(e.type),
1363
+ kindLabel: Q(e.type),
1363
1364
  label: e.data.label,
1364
1365
  secondaryLabel: i.secondaryLabel,
1365
1366
  statusLabel: i.statusLabel,
@@ -1374,19 +1375,19 @@ function Bt(e, t, n, r) {
1374
1375
  });
1375
1376
  }
1376
1377
  function Vt(e) {
1377
- let t = new C.graphlib.Graph();
1378
+ let t = new Ie.graphlib.Graph();
1378
1379
  return t.setDefaultEdgeLabel(() => ({})), t.setGraph({
1379
1380
  nodesep: 56,
1380
1381
  rankdir: "LR",
1381
1382
  ranksep: 120
1382
1383
  }), e.nodes.forEach((e) => {
1383
1384
  t.setNode(e.id, {
1384
- height: We,
1385
+ height: j,
1385
1386
  width: A
1386
1387
  });
1387
1388
  }), e.edges.forEach((e) => {
1388
1389
  t.setEdge(e.source, e.target);
1389
- }), C.layout(t), {
1390
+ }), Ie.layout(t), {
1390
1391
  ...e,
1391
1392
  nodes: e.nodes.map((e) => {
1392
1393
  let n = t.node(e.id);
@@ -1394,7 +1395,7 @@ function Vt(e) {
1394
1395
  ...e,
1395
1396
  position: {
1396
1397
  x: n.x - A / 2,
1397
- y: n.y - We / 2
1398
+ y: n.y - j / 2
1398
1399
  }
1399
1400
  } : e;
1400
1401
  })
@@ -1402,7 +1403,7 @@ function Vt(e) {
1402
1403
  }
1403
1404
  function Ht(e) {
1404
1405
  return e.edges.map((e) => {
1405
- let t = Q(e);
1406
+ let t = Gt(e);
1406
1407
  return {
1407
1408
  animated: !1,
1408
1409
  id: e.id,
@@ -1430,7 +1431,7 @@ function Ht(e) {
1430
1431
  };
1431
1432
  });
1432
1433
  }
1433
- function X(e, t, n, r) {
1434
+ function Z(e, t, n, r) {
1434
1435
  let i = t.filter((t) => t.nodeId === e.id), a = i.find((e) => e.status === "PENDING" || e.status === "IN_PROGRESS"), o = i.find((e) => e.status === "CANCELLED"), s = i.find((e) => e.status === "COMPLETED"), c = n.filter((t) => t.currentNodeId === e.id), l = c.find((e) => e.status === "ACTIVE"), u = c.find((e) => e.status === "WAITING");
1435
1436
  return a ? {
1436
1437
  secondaryLabel: `處理者 ${Ot(a)}`,
@@ -1461,30 +1462,30 @@ function X(e, t, n, r) {
1461
1462
  statusLabel: r === "REJECTED" ? "已拒絕" : "已完成",
1462
1463
  tone: r === "REJECTED" ? "cancelled" : "completed"
1463
1464
  } : {
1464
- secondaryLabel: Z(e.type),
1465
+ secondaryLabel: Q(e.type),
1465
1466
  statusLabel: "未抵達",
1466
1467
  tone: "neutral"
1467
1468
  };
1468
1469
  }
1469
- function Z(e) {
1470
+ function Q(e) {
1470
1471
  return e === "startEvent" ? "開始" : e === "endEvent" ? "完成" : e === "userTask" ? "簽核節點" : e === "serviceTask" ? "知會節點" : e === "exclusiveGateway" ? "條件分流" : "平行處理";
1471
1472
  }
1472
1473
  function Ut(e) {
1473
1474
  return e === "current" ? {
1474
- ...j,
1475
+ ...M,
1475
1476
  border: "1px solid var(--mzn-color-primary, #0057ff)",
1476
1477
  boxShadow: "0 0 0 3px rgba(0, 87, 255, 0.14)"
1477
1478
  } : e === "completed" ? {
1478
- ...j,
1479
+ ...M,
1479
1480
  border: "1px solid #16a34a"
1480
1481
  } : e === "cancelled" ? {
1481
- ...j,
1482
+ ...M,
1482
1483
  border: "1px solid #dc2626",
1483
1484
  opacity: .72
1484
1485
  } : e === "waiting" ? {
1485
- ...j,
1486
+ ...M,
1486
1487
  border: "1px dashed #64748b"
1487
- } : j;
1488
+ } : M;
1488
1489
  }
1489
1490
  function Wt(e) {
1490
1491
  let t = Xe;
@@ -1510,13 +1511,13 @@ function Wt(e) {
1510
1511
  color: "#64748b"
1511
1512
  };
1512
1513
  }
1513
- function Q(e) {
1514
+ function Gt(e) {
1514
1515
  return e.data.label ? e.data.label : e.data.isDefault ? "其他情況" : e.data.condition ?? "";
1515
1516
  }
1516
- function Gt(e) {
1517
- return e.edges.map(Q).filter((e) => e.trim().length > 0);
1517
+ function Kt(e) {
1518
+ return e.edges.map(Gt).filter((e) => e.trim().length > 0);
1518
1519
  }
1519
1520
  //#endregion
1520
- export { N as t };
1521
+ export { it as t };
1521
1522
 
1522
- //# sourceMappingURL=detail-CfFyU5zC.js.map
1523
+ //# sourceMappingURL=detail-BcGAqJ_R.js.map