@rytass/bpm-core-react 0.15.0 → 0.16.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 (228) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/chunks/{FormBuilderView-CLg-JYmu.js → FormBuilderView-BYL42M0d.js} +13 -33
  3. package/dist/chunks/FormBuilderView-BYL42M0d.js.map +1 -0
  4. package/dist/chunks/FormBuilderView-aBcA-_tt.cjs +3 -0
  5. package/dist/chunks/FormBuilderView-aBcA-_tt.cjs.map +1 -0
  6. package/dist/chunks/FormRendererView-DRFi_IH7.cjs +4 -0
  7. package/dist/chunks/FormRendererView-DRFi_IH7.cjs.map +1 -0
  8. package/dist/chunks/{FormRendererView-DU9LLrOF.js → FormRendererView-cZGOOjU5.js} +319 -332
  9. package/dist/chunks/FormRendererView-cZGOOjU5.js.map +1 -0
  10. package/dist/chunks/{admin-pickers-DLlG_1du.js → admin-pickers-DxhzECkD.js} +52 -51
  11. package/dist/chunks/admin-pickers-DxhzECkD.js.map +1 -0
  12. package/dist/chunks/admin-pickers-qe3j--gX.cjs +2 -0
  13. package/dist/chunks/admin-pickers-qe3j--gX.cjs.map +1 -0
  14. package/dist/chunks/approval-instance-list-page-CPXMP3PL.js.map +1 -1
  15. package/dist/chunks/approval-instance-list-page-ax0pm8bt.cjs.map +1 -1
  16. package/dist/chunks/auth-provider-4BeCw7cI.cjs.map +1 -1
  17. package/dist/chunks/auth-provider-B5oPmvk2.js.map +1 -1
  18. package/dist/chunks/bpm-form-field-Bc6k4ZEO.cjs.map +1 -1
  19. package/dist/chunks/bpm-form-field-Cao0rMol.js.map +1 -1
  20. package/dist/chunks/{categories-DGlxuC6X.js → categories-1gKxeEqw.js} +4 -10
  21. package/dist/chunks/categories-1gKxeEqw.js.map +1 -0
  22. package/dist/chunks/{categories-Yid05WAX.cjs → categories-DjENouRm.cjs} +2 -2
  23. package/dist/chunks/categories-DjENouRm.cjs.map +1 -0
  24. package/dist/chunks/{compose-BtQPBd1Q.js → compose-DO6n0NJi.js} +4 -4
  25. package/dist/chunks/compose-DO6n0NJi.js.map +1 -0
  26. package/dist/chunks/{compose-DZhTQOt4.cjs → compose-DUH9cQ-L.cjs} +2 -2
  27. package/dist/chunks/compose-DUH9cQ-L.cjs.map +1 -0
  28. package/dist/chunks/dashboard-page-BWQBSGDq.cjs +2 -0
  29. package/dist/chunks/dashboard-page-BWQBSGDq.cjs.map +1 -0
  30. package/dist/chunks/{dashboard-page-CeCLV1tp.js → dashboard-page-DdBvV6YI.js} +15 -16
  31. package/dist/chunks/dashboard-page-DdBvV6YI.js.map +1 -0
  32. package/dist/chunks/delegations-BLzYnOae.cjs +2 -0
  33. package/dist/chunks/delegations-BLzYnOae.cjs.map +1 -0
  34. package/dist/chunks/delegations-Ckf03icM.cjs +2 -0
  35. package/dist/chunks/delegations-Ckf03icM.cjs.map +1 -0
  36. package/dist/chunks/{delegations-DRupxJ4_.js → delegations-MxF3uJGW.js} +205 -215
  37. package/dist/chunks/delegations-MxF3uJGW.js.map +1 -0
  38. package/dist/chunks/{delegations-B8gLSt0i.js → delegations-_b4_xBit.js} +167 -173
  39. package/dist/chunks/delegations-_b4_xBit.js.map +1 -0
  40. package/dist/chunks/designer-2YvjP_GU.cjs +65 -0
  41. package/dist/chunks/designer-2YvjP_GU.cjs.map +1 -0
  42. package/dist/chunks/{designer-CrbBRPUU.js → designer-B-cfiob9.js} +970 -978
  43. package/dist/chunks/designer-B-cfiob9.js.map +1 -0
  44. package/dist/chunks/{detail-_c21WQla.js → detail-C6NdVijG.js} +812 -826
  45. package/dist/chunks/detail-C6NdVijG.js.map +1 -0
  46. package/dist/chunks/detail-DKobK4Cg.cjs +2 -0
  47. package/dist/chunks/detail-DKobK4Cg.cjs.map +1 -0
  48. package/dist/chunks/format-date-time-CB-LxzqT.js.map +1 -1
  49. package/dist/chunks/format-date-time-D-cx5M8z.cjs.map +1 -1
  50. package/dist/chunks/format-member-label-DudVI55w.js +13 -0
  51. package/dist/chunks/format-member-label-DudVI55w.js.map +1 -0
  52. package/dist/chunks/format-member-label-t7ANTF62.cjs +2 -0
  53. package/dist/chunks/format-member-label-t7ANTF62.cjs.map +1 -0
  54. package/dist/chunks/login-AtVxZBsC.cjs.map +1 -1
  55. package/dist/chunks/login-C6qlTC6F.js.map +1 -1
  56. package/dist/chunks/notifications-Bc4mgSds.cjs.map +1 -1
  57. package/dist/chunks/notifications-DJ5wzCye.js.map +1 -1
  58. package/dist/chunks/{orgs-BpqVu5ka.js → orgs-Bpp1U60k.js} +538 -557
  59. package/dist/chunks/orgs-Bpp1U60k.js.map +1 -0
  60. package/dist/chunks/orgs-ywaE1_02.cjs +2 -0
  61. package/dist/chunks/orgs-ywaE1_02.cjs.map +1 -0
  62. package/dist/chunks/providers-DHtDZFNA.cjs.map +1 -1
  63. package/dist/chunks/providers-J5eyByQj.js.map +1 -1
  64. package/dist/chunks/router-adapter--gYs13E8.cjs.map +1 -1
  65. package/dist/chunks/router-adapter-DftlFTOd.js.map +1 -1
  66. package/dist/chunks/routes-config-C1j_vFKo.cjs.map +1 -1
  67. package/dist/chunks/routes-config-yZbESPlw.js.map +1 -1
  68. package/dist/chunks/task-node-label-BF6UllxP.cjs.map +1 -1
  69. package/dist/chunks/task-node-label-CWZgOBj0.js.map +1 -1
  70. package/dist/chunks/use-bpm-member-D57LKe_u.js.map +1 -1
  71. package/dist/chunks/use-bpm-member-DpNAQtNC.cjs.map +1 -1
  72. package/dist/chunks/users-BSVo_eNe.js +215 -0
  73. package/dist/chunks/users-BSVo_eNe.js.map +1 -0
  74. package/dist/chunks/users-DFSBTDMy.cjs +2 -0
  75. package/dist/chunks/users-DFSBTDMy.cjs.map +1 -0
  76. package/dist/index.cjs +1 -1
  77. package/dist/index.cjs.map +1 -1
  78. package/dist/index.js +2 -2
  79. package/dist/index.js.map +1 -1
  80. package/dist/lib/format-member-label.d.ts +12 -0
  81. package/dist/next/index.cjs.map +1 -1
  82. package/dist/next/index.js.map +1 -1
  83. package/dist/next/workflow-chat-route.cjs.map +1 -1
  84. package/dist/next/workflow-chat-route.js.map +1 -1
  85. package/dist/pages/admin/delegations/index.cjs +1 -1
  86. package/dist/pages/admin/delegations/index.cjs.map +1 -1
  87. package/dist/pages/admin/delegations/index.js +1 -1
  88. package/dist/pages/admin/delegations/index.js.map +1 -1
  89. package/dist/pages/admin/orgs/index.cjs +1 -1
  90. package/dist/pages/admin/orgs/index.cjs.map +1 -1
  91. package/dist/pages/admin/orgs/index.js +1 -1
  92. package/dist/pages/admin/orgs/index.js.map +1 -1
  93. package/dist/pages/admin/users/index.cjs +1 -1
  94. package/dist/pages/admin/users/index.cjs.map +1 -1
  95. package/dist/pages/admin/users/index.js +1 -1
  96. package/dist/pages/admin/users/index.js.map +1 -1
  97. package/dist/pages/admin/webhook-endpoints/index.cjs.map +1 -1
  98. package/dist/pages/admin/webhook-endpoints/index.js.map +1 -1
  99. package/dist/pages/cc/index.cjs.map +1 -1
  100. package/dist/pages/cc/index.js.map +1 -1
  101. package/dist/pages/dashboard/index.cjs.map +1 -1
  102. package/dist/pages/dashboard/index.js.map +1 -1
  103. package/dist/pages/delegations/index.cjs +1 -1
  104. package/dist/pages/delegations/index.cjs.map +1 -1
  105. package/dist/pages/delegations/index.js +1 -1
  106. package/dist/pages/delegations/index.js.map +1 -1
  107. package/dist/pages/inbox/index.cjs.map +1 -1
  108. package/dist/pages/inbox/index.js.map +1 -1
  109. package/dist/pages/instances/detail/index.cjs +1 -1
  110. package/dist/pages/instances/detail/index.cjs.map +1 -1
  111. package/dist/pages/instances/detail/index.js +1 -1
  112. package/dist/pages/instances/detail/index.js.map +1 -1
  113. package/dist/pages/instances/new/index.cjs.map +1 -1
  114. package/dist/pages/instances/new/index.js.map +1 -1
  115. package/dist/pages/login/index.cjs.map +1 -1
  116. package/dist/pages/login/index.js.map +1 -1
  117. package/dist/pages/root/index.cjs.map +1 -1
  118. package/dist/pages/root/index.js.map +1 -1
  119. package/dist/pages/search/index.cjs.map +1 -1
  120. package/dist/pages/search/index.js.map +1 -1
  121. package/dist/pages/sent/index.cjs.map +1 -1
  122. package/dist/pages/sent/index.js.map +1 -1
  123. package/dist/pages/settings/notifications/index.cjs.map +1 -1
  124. package/dist/pages/settings/notifications/index.js.map +1 -1
  125. package/dist/pages/templates/categories/index.cjs +1 -1
  126. package/dist/pages/templates/categories/index.cjs.map +1 -1
  127. package/dist/pages/templates/categories/index.js +1 -1
  128. package/dist/pages/templates/categories/index.js.map +1 -1
  129. package/dist/pages/templates/compose/index.cjs +1 -1
  130. package/dist/pages/templates/compose/index.cjs.map +1 -1
  131. package/dist/pages/templates/compose/index.js +1 -1
  132. package/dist/pages/templates/compose/index.js.map +1 -1
  133. package/dist/pages/templates/designer/index.cjs +1 -1
  134. package/dist/pages/templates/designer/index.cjs.map +1 -1
  135. package/dist/pages/templates/designer/index.js +1 -1
  136. package/dist/pages/templates/designer/index.js.map +1 -1
  137. package/dist/pages/templates/index.cjs.map +1 -1
  138. package/dist/pages/templates/index.js.map +1 -1
  139. package/dist/pages/templates/versions/index.cjs.map +1 -1
  140. package/dist/pages/templates/versions/index.js.map +1 -1
  141. package/dist/views/admin/delegations/index.cjs +1 -1
  142. package/dist/views/admin/delegations/index.js +1 -2
  143. package/dist/views/admin/index.cjs +1 -1
  144. package/dist/views/admin/index.js +3 -3
  145. package/dist/views/admin/orgs/index.cjs +1 -1
  146. package/dist/views/admin/orgs/index.js +1 -2
  147. package/dist/views/admin/users/index.cjs +1 -1
  148. package/dist/views/admin/users/index.js +1 -2
  149. package/dist/views/admin/webhook-endpoints/index.cjs.map +1 -1
  150. package/dist/views/admin/webhook-endpoints/index.js.map +1 -1
  151. package/dist/views/cc/index.cjs.map +1 -1
  152. package/dist/views/cc/index.js.map +1 -1
  153. package/dist/views/dashboard/index.cjs +1 -1
  154. package/dist/views/dashboard/index.cjs.map +1 -1
  155. package/dist/views/dashboard/index.js +1 -1
  156. package/dist/views/dashboard/index.js.map +1 -1
  157. package/dist/views/delegations/index.cjs +1 -1
  158. package/dist/views/delegations/index.js +1 -2
  159. package/dist/views/forms/builder/index.cjs +1 -1
  160. package/dist/views/forms/builder/index.js +1 -2
  161. package/dist/views/forms/renderer/index.cjs +1 -1
  162. package/dist/views/forms/renderer/index.js +1 -2
  163. package/dist/views/inbox/index.cjs +1 -1
  164. package/dist/views/inbox/index.cjs.map +1 -1
  165. package/dist/views/inbox/index.js +1 -5
  166. package/dist/views/inbox/index.js.map +1 -1
  167. package/dist/views/instances/detail/index.cjs +1 -1
  168. package/dist/views/instances/detail/index.js +1 -2
  169. package/dist/views/instances/index.js +1 -2
  170. package/dist/views/instances/new/index.cjs +1 -1
  171. package/dist/views/instances/new/index.cjs.map +1 -1
  172. package/dist/views/instances/new/index.js +4 -11
  173. package/dist/views/instances/new/index.js.map +1 -1
  174. package/dist/views/login/index.js +1 -2
  175. package/dist/views/search/index.cjs.map +1 -1
  176. package/dist/views/search/index.js.map +1 -1
  177. package/dist/views/sent/index.cjs.map +1 -1
  178. package/dist/views/sent/index.js.map +1 -1
  179. package/dist/views/settings/index.js +1 -2
  180. package/dist/views/settings/notifications/index.js +1 -2
  181. package/dist/views/templates/categories/index.cjs +1 -1
  182. package/dist/views/templates/categories/index.js +1 -2
  183. package/dist/views/templates/compose/index.cjs +1 -1
  184. package/dist/views/templates/compose/index.js +1 -2
  185. package/dist/views/templates/designer/index.cjs +1 -1
  186. package/dist/views/templates/designer/index.js +1 -2
  187. package/dist/views/templates/index.cjs +1 -1
  188. package/dist/views/templates/index.cjs.map +1 -1
  189. package/dist/views/templates/index.js +1 -1
  190. package/dist/views/templates/index.js.map +1 -1
  191. package/dist/views/templates/versions/index.cjs.map +1 -1
  192. package/dist/views/templates/versions/index.js.map +1 -1
  193. package/package.json +5 -5
  194. package/dist/chunks/FormBuilderView-6bCbIkz6.cjs +0 -3
  195. package/dist/chunks/FormBuilderView-6bCbIkz6.cjs.map +0 -1
  196. package/dist/chunks/FormBuilderView-CLg-JYmu.js.map +0 -1
  197. package/dist/chunks/FormRendererView-DU9LLrOF.js.map +0 -1
  198. package/dist/chunks/FormRendererView-gctFIqwC.cjs +0 -4
  199. package/dist/chunks/FormRendererView-gctFIqwC.cjs.map +0 -1
  200. package/dist/chunks/admin-pickers-Btvij1at.cjs +0 -2
  201. package/dist/chunks/admin-pickers-Btvij1at.cjs.map +0 -1
  202. package/dist/chunks/admin-pickers-DLlG_1du.js.map +0 -1
  203. package/dist/chunks/categories-DGlxuC6X.js.map +0 -1
  204. package/dist/chunks/categories-Yid05WAX.cjs.map +0 -1
  205. package/dist/chunks/compose-BtQPBd1Q.js.map +0 -1
  206. package/dist/chunks/compose-DZhTQOt4.cjs.map +0 -1
  207. package/dist/chunks/dashboard-page-CeCLV1tp.js.map +0 -1
  208. package/dist/chunks/dashboard-page-DooFJsxM.cjs +0 -2
  209. package/dist/chunks/dashboard-page-DooFJsxM.cjs.map +0 -1
  210. package/dist/chunks/delegations-8LsxcQM4.cjs +0 -2
  211. package/dist/chunks/delegations-8LsxcQM4.cjs.map +0 -1
  212. package/dist/chunks/delegations-B8gLSt0i.js.map +0 -1
  213. package/dist/chunks/delegations-DRupxJ4_.js.map +0 -1
  214. package/dist/chunks/delegations-DlYwMiAW.cjs +0 -2
  215. package/dist/chunks/delegations-DlYwMiAW.cjs.map +0 -1
  216. package/dist/chunks/designer-CrbBRPUU.js.map +0 -1
  217. package/dist/chunks/designer-D3_lWmfa.cjs +0 -65
  218. package/dist/chunks/designer-D3_lWmfa.cjs.map +0 -1
  219. package/dist/chunks/detail-CVXb5Vy8.cjs +0 -2
  220. package/dist/chunks/detail-CVXb5Vy8.cjs.map +0 -1
  221. package/dist/chunks/detail-_c21WQla.js.map +0 -1
  222. package/dist/chunks/orgs-BpqVu5ka.js.map +0 -1
  223. package/dist/chunks/orgs-D0-5BaHT.cjs +0 -2
  224. package/dist/chunks/orgs-D0-5BaHT.cjs.map +0 -1
  225. package/dist/chunks/users-C9LA-Rd7.cjs +0 -2
  226. package/dist/chunks/users-C9LA-Rd7.cjs.map +0 -1
  227. package/dist/chunks/users-FWrb3ehW.js +0 -214
  228. package/dist/chunks/users-FWrb3ehW.js.map +0 -1
@@ -3,21 +3,22 @@ import { n as e } from "./auth-provider-B5oPmvk2.js";
3
3
  import { t } from "./format-date-time-CB-LxzqT.js";
4
4
  import { t as n } from "./bpm-form-field-Cao0rMol.js";
5
5
  import { t as r } from "./use-bpm-member-D57LKe_u.js";
6
- import { t as i } from "./task-node-label-CWZgOBj0.js";
7
- import { o as a, t as o } from "./FormRendererView-DU9LLrOF.js";
6
+ import { t as i } from "./format-member-label-DudVI55w.js";
7
+ import { t as a } from "./task-node-label-CWZgOBj0.js";
8
+ import { o, t as s } from "./FormRendererView-cZGOOjU5.js";
8
9
  import '../style.css';import '../detail.css';/* empty css */
9
- import { Fragment as s, forwardRef as c, useCallback as l, useEffect as u, useImperativeHandle as d, useMemo as f, useRef as p, useState as m } from "react";
10
- import { AutoComplete as ee, Badge as h, Button as g, Input as te, Modal as _, PageHeader as v, Section as y, SectionGroup as ne, Select as b, Stepper as x, Table as re, Textarea as ie, Tooltip as ae, Typography as S } from "@mezzanine-ui/react";
11
- import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
12
- import { cancelAdhocDirective as E, cancelApprovalInstance as oe, configureAdhocCompletionNotification as se, configureAdhocStageNotification as ce, decideTask as le, listAdhocDirectives as ue, listAttachments as de, listTaskDecisions as fe, listWorkflowWebhookDeliveries as pe, readApprovalInstance as me, readAttachmentDownloadUrl as he, readAttachmentPreviewUrl as ge, readInstanceSignatures as _e, requestAdhocCountersign as ve, requestAdhocPreApproval as ye, resolveMemberProfiles as be, resubmitApprovalInstance as xe, retryWorkflowWebhookDelivery as Se, searchMembers as Ce, uploadAttachment as we } from "@rytass/bpm-core-client/workflow";
13
- import Te from "@mezzanine-ui/react/ContentHeader";
14
- import { CheckedIcon as Ee, ChevronLeftIcon as D, ChevronRightIcon as De, DangerousOutlineIcon as Oe, DownloadIcon as ke, FileSearchIcon as O, NotificationUnreadIcon as Ae, PlusIcon as je, RefreshCcwIcon as Me, ResetIcon as Ne, ShareIcon as Pe, UserIcon as Fe, ZoomInIcon as Ie, ZoomOutIcon as Le } from "@mezzanine-ui/icons";
15
- import { buildFormRendererValues as Re, focusFormRendererField as ze, readFormDataSourceErrorMessage as Be, validateFormRendererValues as Ve } from "@rytass/bpm-core-client/form";
16
- import { Background as k, Controls as He, Handle as Ue, Position as A, ReactFlow as We } from "@xyflow/react";
17
- import * as j from "dagre";
18
- import { Document as Ge, Page as Ke } from "react-pdf";
19
- import { stepClasses as M } from "@mezzanine-ui/core/stepper";
20
- var N = {
10
+ import { Fragment as c, forwardRef as l, useCallback as u, useEffect as d, useImperativeHandle as f, useMemo as p, useRef as m, useState as h } from "react";
11
+ import { AutoComplete as ee, Badge as g, Button as _, Input as v, Modal as y, PageHeader as te, Section as b, SectionGroup as ne, Select as x, Stepper as re, Table as ie, Textarea as ae, Tooltip as S, Typography as C } from "@mezzanine-ui/react";
12
+ import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
13
+ import { cancelAdhocDirective as oe, cancelApprovalInstance as se, configureAdhocCompletionNotification as ce, configureAdhocStageNotification as le, decideTask as ue, listAdhocDirectives as de, listAttachments as fe, listTaskDecisions as pe, listWorkflowWebhookDeliveries as me, readApprovalInstance as he, readAttachmentDownloadUrl as ge, readAttachmentPreviewUrl as _e, readInstanceSignatures as ve, requestAdhocCountersign as ye, requestAdhocPreApproval as be, resolveMemberProfiles as xe, resubmitApprovalInstance as Se, retryWorkflowWebhookDelivery as Ce, searchMembers as we, uploadAttachment as Te } from "@rytass/bpm-core-client/workflow";
14
+ import Ee from "@mezzanine-ui/react/ContentHeader";
15
+ import { CheckedIcon as De, ChevronLeftIcon as Oe, ChevronRightIcon as ke, DangerousOutlineIcon as Ae, DownloadIcon as D, FileSearchIcon as je, NotificationUnreadIcon as Me, PlusIcon as Ne, RefreshCcwIcon as Pe, ResetIcon as O, ShareIcon as Fe, UserIcon as Ie, ZoomInIcon as Le, ZoomOutIcon as Re } from "@mezzanine-ui/icons";
16
+ import { buildFormRendererValues as ze, focusFormRendererField as Be, readFormDataSourceErrorMessage as Ve, validateFormRendererValues as k } from "@rytass/bpm-core-client/form";
17
+ import { Background as He, Controls as Ue, Handle as We, Position as A, ReactFlow as Ge } from "@xyflow/react";
18
+ import * as Ke from "dagre";
19
+ import { Document as qe, Page as Je } from "react-pdf";
20
+ import { stepClasses as j } from "@mezzanine-ui/core/stepper";
21
+ var M = {
21
22
  root: "bpm_root_ehm7w",
22
23
  toolbar: "bpm_toolbar_R-tis",
23
24
  pageControls: "bpm_pageControls_jM-rC",
@@ -26,56 +27,56 @@ var N = {
26
27
  viewport: "bpm_viewport_DQXms",
27
28
  page: "bpm_page_Cv5Rg",
28
29
  state: "bpm_state_bpgp3"
29
- }, qe = 760, Je = 920, Ye = 320, P = 32, F = .75, I = 1.75, Xe = .25;
30
- function Ze({ filename: e, fileUrl: t, onDownload: n }) {
31
- let r = p(null), [i, a] = m(null), [o, s] = m(1), [c, d] = m(1), [ee, h] = m(qe);
32
- u(() => {
30
+ }, Ye = 760, Xe = 920, N = 320, P = 32, F = .75, Ze = 1.75, I = .25;
31
+ function Qe({ filename: e, fileUrl: t, onDownload: n }) {
32
+ let r = m(null), [i, a] = h(null), [o, s] = h(1), [c, l] = h(1), [f, ee] = h(Ye);
33
+ d(() => {
33
34
  let e = r.current;
34
35
  if (!e || typeof ResizeObserver > "u") return;
35
36
  let t = new ResizeObserver((e) => {
36
37
  let t = e[0]?.contentRect.width;
37
- t && h(t);
38
+ t && ee(t);
38
39
  });
39
40
  return t.observe(e), () => t.disconnect();
40
- }, []), u(() => {
41
- a(null), s(1), d(1);
41
+ }, []), d(() => {
42
+ a(null), s(1), l(1);
42
43
  }, [t]);
43
- let te = f(() => {
44
- let e = Math.max(Ye, ee - P);
45
- return Math.round(Math.min(Je, e) * c);
46
- }, [c, ee]), _ = l((e) => {
44
+ let g = p(() => {
45
+ let e = Math.max(N, f - P);
46
+ return Math.round(Math.min(Xe, e) * c);
47
+ }, [c, f]), v = u((e) => {
47
48
  a(e.numPages), s(1);
48
- }, []), v = o > 1, y = i !== null && o < i, ne = c > F, b = c < I, x = i === null ? `第 ${o} 頁` : `第 ${o} / ${i} 頁`, re = `${Math.round(c * 100)}%`;
49
- return /* @__PURE__ */ T("section", {
49
+ }, []), y = o > 1, te = i !== null && o < i, b = c > F, ne = c < Ze, x = i === null ? `第 ${o} 頁` : `第 ${o} / ${i} 頁`, re = `${Math.round(c * 100)}%`;
50
+ return /* @__PURE__ */ E("section", {
50
51
  "aria-label": `${e} PDF 預覽`,
51
- className: N.root,
52
- children: [/* @__PURE__ */ T("div", {
53
- className: N.toolbar,
52
+ className: M.root,
53
+ children: [/* @__PURE__ */ E("div", {
54
+ className: M.toolbar,
54
55
  children: [
55
- /* @__PURE__ */ T("div", {
56
- className: N.pageControls,
56
+ /* @__PURE__ */ E("div", {
57
+ className: M.pageControls,
57
58
  "aria-label": "頁面切換",
58
59
  children: [
59
- /* @__PURE__ */ w(g, {
60
+ /* @__PURE__ */ T(_, {
60
61
  "aria-label": "上一頁",
61
- disabled: !v,
62
- icon: D,
62
+ disabled: !y,
63
+ icon: Oe,
63
64
  onClick: () => {
64
65
  s((e) => Math.max(1, e - 1));
65
66
  },
66
67
  size: "minor",
67
68
  variant: "base-secondary"
68
69
  }),
69
- /* @__PURE__ */ w(S, {
70
- className: N.counter,
70
+ /* @__PURE__ */ T(C, {
71
+ className: M.counter,
71
72
  component: "span",
72
73
  variant: "body",
73
74
  children: x
74
75
  }),
75
- /* @__PURE__ */ w(g, {
76
+ /* @__PURE__ */ T(_, {
76
77
  "aria-label": "下一頁",
77
- disabled: !y,
78
- icon: De,
78
+ disabled: !te,
79
+ icon: ke,
79
80
  onClick: () => {
80
81
  s((e) => i === null ? e : Math.min(i, e + 1));
81
82
  },
@@ -84,40 +85,40 @@ function Ze({ filename: e, fileUrl: t, onDownload: n }) {
84
85
  })
85
86
  ]
86
87
  }),
87
- /* @__PURE__ */ T("div", {
88
- className: N.zoomControls,
88
+ /* @__PURE__ */ E("div", {
89
+ className: M.zoomControls,
89
90
  "aria-label": "縮放",
90
91
  children: [
91
- /* @__PURE__ */ w(g, {
92
+ /* @__PURE__ */ T(_, {
92
93
  "aria-label": "縮小",
93
- disabled: !ne,
94
- icon: Le,
94
+ disabled: !b,
95
+ icon: Re,
95
96
  onClick: () => {
96
- d((e) => Math.max(F, e - Xe));
97
+ l((e) => Math.max(F, e - I));
97
98
  },
98
99
  size: "minor",
99
100
  variant: "base-secondary"
100
101
  }),
101
- /* @__PURE__ */ w(S, {
102
- className: N.counter,
102
+ /* @__PURE__ */ T(C, {
103
+ className: M.counter,
103
104
  component: "span",
104
105
  variant: "body",
105
106
  children: re
106
107
  }),
107
- /* @__PURE__ */ w(g, {
108
+ /* @__PURE__ */ T(_, {
108
109
  "aria-label": "放大",
109
- disabled: !b,
110
- icon: Ie,
110
+ disabled: !ne,
111
+ icon: Le,
111
112
  onClick: () => {
112
- d((e) => Math.min(I, e + Xe));
113
+ l((e) => Math.min(Ze, e + I));
113
114
  },
114
115
  size: "minor",
115
116
  variant: "base-secondary"
116
117
  })
117
118
  ]
118
119
  }),
119
- n ? /* @__PURE__ */ w(g, {
120
- icon: ke,
120
+ n ? /* @__PURE__ */ T(_, {
121
+ icon: D,
121
122
  iconType: "leading",
122
123
  onClick: n,
123
124
  size: "minor",
@@ -125,31 +126,32 @@ function Ze({ filename: e, fileUrl: t, onDownload: n }) {
125
126
  children: "下載"
126
127
  }) : null
127
128
  ]
128
- }), /* @__PURE__ */ w("div", {
129
- className: N.viewport,
129
+ }), /* @__PURE__ */ T("div", {
130
+ className: M.viewport,
130
131
  ref: r,
131
- children: /* @__PURE__ */ w(Ge, {
132
- error: /* @__PURE__ */ w(L, { message: "PDF 無法載入。" }),
132
+ children: /* @__PURE__ */ T(qe, {
133
+ error: /* @__PURE__ */ T(L, { message: "PDF 無法載入。" }),
133
134
  file: t,
134
- loading: /* @__PURE__ */ w(L, { message: "正在載入 PDF..." }),
135
- noData: /* @__PURE__ */ w(L, { message: "沒有可預覽的 PDF。" }),
136
- onLoadSuccess: _,
137
- children: /* @__PURE__ */ w(Ke, {
138
- className: N.page,
139
- loading: /* @__PURE__ */ w(L, { message: "正在載入頁面..." }),
135
+ loading: /* @__PURE__ */ T(L, { message: "正在載入 PDF..." }),
136
+ noData: /* @__PURE__ */ T(L, { message: "沒有可預覽的 PDF。" }),
137
+ onLoadSuccess: v,
138
+ suspense: !1,
139
+ children: /* @__PURE__ */ T(Je, {
140
+ className: M.page,
141
+ loading: /* @__PURE__ */ T(L, { message: "正在載入頁面..." }),
140
142
  pageNumber: o,
141
143
  renderAnnotationLayer: !0,
142
144
  renderTextLayer: !0,
143
- width: te
145
+ width: g
144
146
  })
145
147
  })
146
148
  })]
147
149
  });
148
150
  }
149
151
  function L({ message: e }) {
150
- return /* @__PURE__ */ w("div", {
151
- className: N.state,
152
- children: /* @__PURE__ */ w(S, {
152
+ return /* @__PURE__ */ T("div", {
153
+ className: M.state,
154
+ children: /* @__PURE__ */ T(C, {
153
155
  color: "text-neutral",
154
156
  variant: "body",
155
157
  children: e
@@ -158,113 +160,113 @@ function L({ message: e }) {
158
160
  }
159
161
  //#endregion
160
162
  //#region src/views/instances/detail/submitted-by.ts
161
- function R({ initiatorMemberId: e, submittedByMemberId: t }) {
163
+ function $e({ initiatorMemberId: e, submittedByMemberId: t }) {
162
164
  return t && t !== e ? t : null;
163
165
  }
164
- function Qe(e, t) {
165
- let n = R(e);
166
+ function et(e, t) {
167
+ let n = $e(e);
166
168
  if (!n || !e.initiatorMemberId) return null;
167
169
  let r = (e) => t.get(e)?.name ?? e;
168
170
  return `由 ${r(n)} 代 ${r(e.initiatorMemberId)} 送出`;
169
171
  }
170
172
  //#endregion
171
173
  //#region src/views/instances/detail/sections/shared.ts
172
- function $e(e) {
173
- let t = z(e, "from"), n = z(e, "to"), r = z(e, "reason");
174
+ function tt(e) {
175
+ let t = R(e, "from"), n = R(e, "to"), r = R(e, "reason");
174
176
  return !t || !n || !r ? null : {
175
177
  from: t,
176
178
  reason: r,
177
- ruleId: z(e, "ruleId"),
179
+ ruleId: R(e, "ruleId"),
178
180
  to: n
179
181
  };
180
182
  }
181
- function et(e) {
183
+ function nt(e) {
182
184
  try {
183
185
  let t = JSON.parse(e);
184
- return Array.isArray(t) ? t.map((e) => H(e) ? $e(e) : null).filter((e) => e !== null) : [];
186
+ return Array.isArray(t) ? t.map((e) => at(e) ? tt(e) : null).filter((e) => e !== null) : [];
185
187
  } catch {
186
188
  return [];
187
189
  }
188
190
  }
189
- function z(e, t) {
191
+ function R(e, t) {
190
192
  let n = e[t];
191
193
  return typeof n == "string" ? n : null;
192
194
  }
193
- function B(e, t) {
195
+ function rt(e, t) {
194
196
  let n = e[t];
195
197
  return Array.isArray(n) ? n.filter((e) => typeof e == "string") : [];
196
198
  }
197
- function tt(e, t) {
199
+ function it(e, t) {
198
200
  let n = e[t];
199
201
  return typeof n == "number" ? n : null;
200
202
  }
201
- function V(e) {
203
+ function z(e) {
202
204
  return typeof e == "string" && e.trim().length > 0;
203
205
  }
204
- function H(e) {
206
+ function at(e) {
205
207
  return typeof e == "object" && !!e;
206
208
  }
207
- function nt(e) {
209
+ function ot(e) {
208
210
  return e.status === "PENDING" || e.status === "IN_PROGRESS";
209
211
  }
210
- function U(e) {
211
- return Be(e) || (e instanceof Error ? e.message : "發生未知錯誤");
212
+ function B(e) {
213
+ return Ve(e) || (e instanceof Error ? e.message : "發生未知錯誤");
212
214
  }
213
- function rt(e) {
215
+ function st(e) {
214
216
  return !Number.isFinite(e) || e <= 0 ? "-" : e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1024 / 1024).toFixed(1)} MB`;
215
217
  }
216
- function it(e) {
218
+ function ct(e) {
217
219
  return e.length > 16 ? `${e.slice(0, 12)}...` : e;
218
220
  }
219
- function at(e) {
221
+ function lt(e) {
220
222
  return e === "APPROVED" ? "已同意" : e === "CANCELLED" ? "已取消" : e === "DRAFT" ? "草稿" : e === "EXPIRED" ? "已逾期" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "RUNNING" ? "進行中" : e;
221
223
  }
222
- function ot(e) {
224
+ function V(e) {
223
225
  return e === "PENDING" ? "待處理" : e === "IN_PROGRESS" ? "處理中" : e === "COMPLETED" ? "已完成" : e === "CANCELLED" ? "已取消" : e === "TRANSFERRED" ? "已轉派" : e;
224
226
  }
225
- function W(e) {
227
+ function ut(e) {
226
228
  return e === "APPROVED" ? "同意" : e === "REJECTED" ? "拒絕" : e === "RETURNED" ? "退回" : e === "TRANSFERRED" ? "轉派" : e;
227
229
  }
228
- function G(e) {
230
+ function H(e) {
229
231
  return e === "startEvent" ? "開始" : e === "endEvent" ? "完成" : e === "userTask" ? "簽核節點" : e === "serviceTask" ? "知會節點" : e === "exclusiveGateway" ? "條件分流" : "平行處理";
230
232
  }
231
- function st(e, t) {
233
+ function dt(e, t) {
232
234
  return t?.nodes.find((t) => t.id === e)?.data.label ?? e;
233
235
  }
234
- function K(e, t) {
236
+ function U(e, t) {
235
237
  if (!e) return "-";
236
238
  let n = t.get(e);
237
- return n ? `${n.name}(${n.email})` : e;
239
+ return n ? i(n.name, n.email, "fullwidth") : e;
238
240
  }
239
- function ct(e, t = /* @__PURE__ */ new Map()) {
240
- let n = et(e.delegationChainJson);
241
- if (!e.assigneeMemberId) return e.candidateMemberIds.length ? `候選 ${e.candidateMemberIds.map((e) => K(e, t)).join("、")}` : "未指定";
242
- let r = K(e.assigneeMemberId, t), i = K(e.originalAssigneeMemberId, t);
241
+ function W(e, t = /* @__PURE__ */ new Map()) {
242
+ let n = nt(e.delegationChainJson);
243
+ if (!e.assigneeMemberId) return e.candidateMemberIds.length ? `候選 ${e.candidateMemberIds.map((e) => U(e, t)).join("、")}` : "未指定";
244
+ let r = U(e.assigneeMemberId, t), i = U(e.originalAssigneeMemberId, t);
243
245
  return n.length === 0 || e.originalAssigneeMemberId === e.assigneeMemberId ? r : `${r}(原:${i})`;
244
246
  }
245
- function lt(e, t) {
247
+ function ft(e, t) {
246
248
  return t ? e.assigneeMemberId === t || (e.openCandidateMemberIds ?? e.candidateMemberIds).includes(t) : !1;
247
249
  }
248
- function ut(e, t) {
250
+ function G(e, t) {
249
251
  if (t.type !== "userTask" || !t.data.returnBehavior.allowReturn) return [];
250
252
  if (t.data.returnBehavior.allowedTargets === "ANY") return e.nodes.filter((e) => e.id !== t.id).map((e) => ({
251
253
  id: e.id,
252
- name: `${e.data.label}(${G(e.type)})`
254
+ name: `${e.data.label}(${H(e.type)})`
253
255
  }));
254
256
  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);
255
257
  return r ? [{
256
258
  id: r.id,
257
- name: `${r.data.label}(${G(r.type)})`
259
+ name: `${r.data.label}(${H(r.type)})`
258
260
  }] : [];
259
261
  }
260
- function q(e) {
262
+ function pt(e) {
261
263
  return {
262
264
  email: e.email,
263
265
  id: e.memberId,
264
- name: `${e.name} · ${e.email}`
266
+ name: i(e.name, e.email, "dot")
265
267
  };
266
268
  }
267
- function dt({ memberIds: e, useWebhookTarget: t, webhookUrl: n }) {
269
+ function mt({ memberIds: e, useWebhookTarget: t, webhookUrl: n }) {
268
270
  if (t) {
269
271
  let e = n.trim();
270
272
  return e ? {
@@ -289,11 +291,11 @@ function dt({ memberIds: e, useWebhookTarget: t, webhookUrl: n }) {
289
291
  valid: !1
290
292
  };
291
293
  }
292
- function ft(e) {
294
+ function ht(e) {
293
295
  return !!e;
294
296
  }
295
- function pt(e) {
296
- if (!H(e)) return null;
297
+ function gt(e) {
298
+ if (!at(e)) return null;
297
299
  let t = e.email, n = e.id, r = e.name;
298
300
  return typeof n == "string" && typeof r == "string" ? {
299
301
  email: typeof t == "string" ? t : null,
@@ -301,7 +303,7 @@ function pt(e) {
301
303
  name: r
302
304
  } : null;
303
305
  }
304
- function mt(e, t) {
306
+ function _t(e, t) {
305
307
  let n = e.trim().toLocaleLowerCase();
306
308
  if (!n) return null;
307
309
  let r = t.filter((e) => [
@@ -311,21 +313,21 @@ function mt(e, t) {
311
313
  ].some((e) => e.toLocaleLowerCase().includes(n)));
312
314
  return r.length === 1 ? r[0] ?? null : null;
313
315
  }
314
- function J(e) {
315
- return V(e) ? {
316
+ function K(e) {
317
+ return z(e) ? {
316
318
  text: e,
317
319
  type: "text"
318
320
  } : null;
319
321
  }
320
- function ht(e, t, n = "neutral") {
321
- return V(t) ? {
322
+ function q(e, t, n = "neutral") {
323
+ return z(t) ? {
322
324
  label: e,
323
325
  text: t,
324
326
  tone: n,
325
327
  type: "comment"
326
328
  } : null;
327
329
  }
328
- function gt(e, t, n, r) {
330
+ function vt(e, t, n, r) {
329
331
  let i = t ? n.get(t) : null;
330
332
  return {
331
333
  email: i?.email ?? null,
@@ -335,204 +337,204 @@ function gt(e, t, n, r) {
335
337
  type: "member"
336
338
  };
337
339
  }
338
- function Y(e) {
340
+ function J(e) {
339
341
  return !!e;
340
342
  }
341
- function _t(e) {
343
+ function Y(e) {
342
344
  let t = e.findIndex((e) => e.id.startsWith("pending-task-") || e.id.startsWith("future-node-"));
343
345
  return t === -1 ? e.length : t;
344
346
  }
345
- function X(e) {
346
- return e.eventType === "INSTANCE_STARTED" || e.eventType === "TASK_DECIDED" || e.eventType === "SLA_TRIGGERED" || e.eventType === "TASK_CANDIDATE_ACTIVATED" || vt(e) || Z(e.eventType, Q(e));
347
+ function yt(e) {
348
+ return e.eventType === "INSTANCE_STARTED" || e.eventType === "TASK_DECIDED" || e.eventType === "SLA_TRIGGERED" || e.eventType === "TASK_CANDIDATE_ACTIVATED" || bt(e) || Z(e.eventType, wt(e));
347
349
  }
348
- function vt(e) {
349
- return e.eventType === "TASK_CREATED" && B(Q(e), "sequentialCandidateMemberIds").length > 0;
350
+ function bt(e) {
351
+ return e.eventType === "TASK_CREATED" && rt(wt(e), "sequentialCandidateMemberIds").length > 0;
350
352
  }
351
- function yt(e) {
353
+ function xt(e) {
352
354
  if (e.eventType !== "TASK_CANDIDATE_ACTIVATED" && e.eventType !== "TASK_CREATED") return [];
353
- let t = Q(e);
355
+ let t = wt(e);
354
356
  return [
355
- ...B(t, "sequentialCandidateMemberIds"),
356
- z(t, "candidateMemberId"),
357
- z(t, "previousMemberId")
358
- ].filter(V);
357
+ ...rt(t, "sequentialCandidateMemberIds"),
358
+ R(t, "candidateMemberId"),
359
+ R(t, "previousMemberId")
360
+ ].filter(z);
359
361
  }
360
- var bt = /* @__PURE__ */ new Set([
362
+ var X = /* @__PURE__ */ new Set([
361
363
  "SERVICE_TASK_EXECUTED",
362
364
  "SERVICE_TASK_FAILED",
363
365
  "WEBHOOK_DELIVERY_RETRIED"
364
366
  ]);
365
367
  function Z(e, t) {
366
- return bt.has(e) && z(t, "action") === "NOTIFY_WEBHOOK";
367
- }
368
- function xt(e) {
369
- return z(e, "endpointLabel") ?? z(e, "endpointKey") ?? "外部系統";
368
+ return X.has(e) && R(t, "action") === "NOTIFY_WEBHOOK";
370
369
  }
371
370
  function St(e) {
371
+ return R(e, "endpointLabel") ?? R(e, "endpointKey") ?? "外部系統";
372
+ }
373
+ function Ct(e) {
372
374
  return e === "APPROVED" ? "已同意" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "TRANSFERRED" ? "已轉派" : "簽核已決議";
373
375
  }
374
- function Ct(e, t) {
376
+ function Q(e, t) {
375
377
  if (e === "INSTANCE_STARTED") return "案件已發起";
376
378
  if (e === "TOKEN_CREATED") return "流程路徑已建立";
377
379
  if (e === "ENGINE_PROCESS_REQUESTED") return "流程引擎已處理";
378
380
  if (e === "TOKEN_ADVANCED") return "流程已前進";
379
381
  if (e === "TASK_CREATED") return "待簽任務已建立";
380
382
  if (e === "TASK_CANDIDATE_ACTIVATED") return "輪到下一位簽核";
381
- if (e === "TASK_DECIDED") return St(z(t, "action"));
383
+ if (e === "TASK_DECIDED") return Ct(R(t, "action"));
382
384
  if (e === "SLA_TRIGGERED") return "時限提醒已觸發";
383
385
  if (Z(e, t)) {
384
- let n = xt(t);
386
+ let n = St(t);
385
387
  return e === "SERVICE_TASK_EXECUTED" ? `已通知外部系統:${n}` : e === "SERVICE_TASK_FAILED" ? `通知外部系統失敗:${n}` : `管理者重新傳送外部系統通知:${n}`;
386
388
  }
387
389
  return e;
388
390
  }
389
- function Q(e) {
391
+ function wt(e) {
390
392
  try {
391
393
  let t = JSON.parse(e.payloadJson);
392
- return H(t) ? t : {};
394
+ return at(t) ? t : {};
393
395
  } catch {
394
396
  return {};
395
397
  }
396
398
  }
397
- function wt(e, t) {
398
- return e.eventType === "SLA_TRIGGERED" || e.eventType === "SERVICE_TASK_FAILED" && Z(e.eventType, t) || z(t, "action") === "REJECTED" || z(t, "instanceState") === "REJECTED";
399
+ function Tt(e, t) {
400
+ return e.eventType === "SLA_TRIGGERED" || e.eventType === "SERVICE_TASK_FAILED" && Z(e.eventType, t) || R(t, "action") === "REJECTED" || R(t, "instanceState") === "REJECTED";
399
401
  }
400
- function Tt(e) {
402
+ function Et(e) {
401
403
  return t(e);
402
404
  }
403
- function Et(e, t, n, r) {
404
- if (e.eventType === "INSTANCE_STARTED") return Qe({
405
+ function Dt(e, t, n, r) {
406
+ if (e.eventType === "INSTANCE_STARTED") return et({
405
407
  initiatorMemberId: e.actorMemberId,
406
- submittedByMemberId: z(t, "submittedByMemberId")
408
+ submittedByMemberId: R(t, "submittedByMemberId")
407
409
  }, r);
408
410
  if (e.eventType === "TASK_CANDIDATE_ACTIVATED") {
409
- let e = z(t, "candidateMemberId"), n = z(t, "previousMemberId");
411
+ let e = R(t, "candidateMemberId"), n = R(t, "previousMemberId");
410
412
  if (!e) return null;
411
- let i = K(e, r);
412
- return n ? `輪到:${i}(前一位:${K(n, r)})` : `輪到:${i}`;
413
+ let i = U(e, r);
414
+ return n ? `輪到:${i}(前一位:${U(n, r)})` : `輪到:${i}`;
413
415
  }
414
416
  if (e.eventType === "TASK_CREATED") {
415
- let e = B(t, "sequentialCandidateMemberIds");
416
- if (e.length) return `簽核順序:${e.map((e) => K(e, r)).join(" → ")}`;
417
- let n = z(t, "assigneeMemberId"), i = z(t, "originalAssigneeMemberId");
417
+ let e = rt(t, "sequentialCandidateMemberIds");
418
+ if (e.length) return `簽核順序:${e.map((e) => U(e, r)).join(" → ")}`;
419
+ let n = R(t, "assigneeMemberId"), i = R(t, "originalAssigneeMemberId");
418
420
  if (!n) {
419
- let e = B(t, "candidateMemberIds");
420
- return e.length ? `候選簽核人:${e.map((e) => K(e, r)).join("、")}` : null;
421
+ let e = rt(t, "candidateMemberIds");
422
+ return e.length ? `候選簽核人:${e.map((e) => U(e, r)).join("、")}` : null;
421
423
  }
422
- let a = K(n, r), o = K(i, r);
424
+ let a = U(n, r), o = U(i, r);
423
425
  return i && i !== n ? `待簽人:${a}(原簽核人:${o})` : `待簽人:${a}`;
424
426
  }
425
427
  if (e.eventType === "TASK_DECIDED") {
426
- let e = z(t, "action"), n = z(t, "comment"), i = e ? `決議:${W(e)}` : null, a = z(t, "transferToMemberId");
427
- return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(V).join(" · ") : e === "APPROVED" && n ? [i, `同意說明:${n}`].filter(V).join(" · ") : e === "TRANSFERRED" ? [i, `轉派給:${K(a, r)}`].filter(V).join(" · ") : i;
428
+ let e = R(t, "action"), n = R(t, "comment"), i = e ? `決議:${ut(e)}` : null, a = R(t, "transferToMemberId");
429
+ return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(z).join(" · ") : e === "APPROVED" && n ? [i, `同意說明:${n}`].filter(z).join(" · ") : e === "TRANSFERRED" ? [i, `轉派給:${U(a, r)}`].filter(z).join(" · ") : i;
428
430
  }
429
431
  if (e.eventType === "TOKEN_ADVANCED") {
430
- let e = z(t, "action");
431
- if (e) return `流程結果:${W(e)}`;
432
- let r = tt(t, "arrivedCount"), i = tt(t, "requiredCount");
432
+ let e = R(t, "action");
433
+ if (e) return `流程結果:${ut(e)}`;
434
+ let r = it(t, "arrivedCount"), i = it(t, "requiredCount");
433
435
  if (r !== null && i !== null) return `等待匯合:${r}/${i}`;
434
- let a = z(t, "fromNodeId"), o = z(t, "toNodeId");
435
- if (a && o) return `由 ${st(a, n)} 前進至 ${st(o, n)}`;
436
+ let a = R(t, "fromNodeId"), o = R(t, "toNodeId");
437
+ if (a && o) return `由 ${dt(a, n)} 前進至 ${dt(o, n)}`;
436
438
  }
437
439
  if (e.eventType === "ENGINE_PROCESS_REQUESTED") {
438
- let e = z(t, "state");
439
- return e ? `案件狀態:${at(e)}` : null;
440
+ let e = R(t, "state");
441
+ return e ? `案件狀態:${lt(e)}` : null;
440
442
  }
441
443
  return null;
442
444
  }
443
- function Dt(e, t, n, r, i, a, o) {
444
- if (e.eventType !== "TASK_DECIDED") return [J(Et(e, t, n, o))].filter(Y);
445
- let s = e.taskId ? r.get(e.taskId) : null, c = z(t, "action") ?? s?.action ?? null, l = z(t, "comment") ?? s?.comment ?? null, u = z(t, "transferToMemberId") ?? s?.transferToMemberId ?? null, d = z(t, "signatureId") ?? s?.signatureId ?? null, f = d ? i.get(d) : null;
445
+ function Ot(e, t, n, r, i, a, o) {
446
+ if (e.eventType !== "TASK_DECIDED") return [K(Dt(e, t, n, o))].filter(J);
447
+ let s = e.taskId ? r.get(e.taskId) : null, c = R(t, "action") ?? s?.action ?? null, l = R(t, "comment") ?? s?.comment ?? null, u = R(t, "transferToMemberId") ?? s?.transferToMemberId ?? null, d = R(t, "signatureId") ?? s?.signatureId ?? null, f = d ? i.get(d) : null;
446
448
  return [
447
- J(c ? `決議:${W(c)}` : null),
448
- c === "REJECTED" ? ht("拒絕原因", l ?? "-", "danger") : null,
449
- c === "APPROVED" ? ht("同意說明", l) : null,
450
- c === "RETURNED" ? ht("退回說明", l ?? "-") : null,
451
- c === "TRANSFERRED" ? J(`轉派給:${K(u, o)}`) : null,
452
- c === "TRANSFERRED" ? ht("轉派說明", l ?? "-") : null,
453
- f ? J(a?.valid ? `簽章:已驗證(${it(f.signedPayloadHash)})` : `簽章:待檢查(${it(f.signedPayloadHash)})`) : null
454
- ].filter(Y);
455
- }
456
- function Ot(e, t, n, r, i) {
449
+ K(c ? `決議:${ut(c)}` : null),
450
+ c === "REJECTED" ? q("拒絕原因", l ?? "-", "danger") : null,
451
+ c === "APPROVED" ? q("同意說明", l) : null,
452
+ c === "RETURNED" ? q("退回說明", l ?? "-") : null,
453
+ c === "TRANSFERRED" ? K(`轉派給:${U(u, o)}`) : null,
454
+ c === "TRANSFERRED" ? q("轉派說明", l ?? "-") : null,
455
+ f ? K(a?.valid ? `簽章:已驗證(${ct(f.signedPayloadHash)})` : `簽章:待檢查(${ct(f.signedPayloadHash)})`) : null
456
+ ].filter(J);
457
+ }
458
+ function $(e, t, n, r, i) {
457
459
  if (e.type === "startEvent" || i.has(e.id)) return !1;
458
460
  if (r === "REJECTED") return !0;
459
- let a = It(e, t, n, r);
461
+ let a = Lt(e, t, n, r);
460
462
  return a.tone === "neutral" || a.tone === "waiting";
461
463
  }
462
- function $(e, t, n, r, i) {
464
+ function kt(e, t, n, r, i) {
463
465
  if (r !== "RUNNING" && r !== "REJECTED") return [];
464
- let a = e.nodes.filter((e) => Ot(e, t, n, r, i)), o = kt(e, a, t, n, i), s = new Map(e.nodes.map((e, t) => [e.id, t]));
466
+ let a = e.nodes.filter((e) => $(e, t, n, r, i)), o = At(e, a, t, n, i), s = new Map(e.nodes.map((e, t) => [e.id, t]));
465
467
  return a.filter((e) => o.has(e.id)).sort((e, t) => {
466
468
  let n = o.get(e.id) ?? 0, r = o.get(t.id) ?? 0;
467
469
  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;
468
470
  });
469
471
  }
470
- function kt(e, t, n, r, i) {
472
+ function At(e, t, n, r, i) {
471
473
  let a = new Set(t.map((e) => e.id)), o = e.edges.reduce((e, t) => {
472
474
  let n = [...e.get(t.source) ?? [], t.target];
473
475
  return new Map(e).set(t.source, n);
474
476
  }, /* @__PURE__ */ new Map());
475
- return At(e, n, r, i).reduce((e, t) => Nt(e, jt(t, o, a)), /* @__PURE__ */ new Map());
477
+ return jt(e, n, r, i).reduce((e, t) => Pt(e, Mt(t, o, a)), /* @__PURE__ */ new Map());
476
478
  }
477
- function At(e, t, n, r) {
478
- let i = n.filter((e) => e.status === "ACTIVE" || e.status === "WAITING").map((e) => e.currentNodeId), a = t.filter(nt).map((e) => e.nodeId), o = e.nodes.filter((e) => r.has(e.id)).map((e) => e.id), s = [.../* @__PURE__ */ new Set([
479
+ function jt(e, t, n, r) {
480
+ let i = n.filter((e) => e.status === "ACTIVE" || e.status === "WAITING").map((e) => e.currentNodeId), a = t.filter(ot).map((e) => e.nodeId), o = e.nodes.filter((e) => r.has(e.id)).map((e) => e.id), s = [.../* @__PURE__ */ new Set([
479
481
  ...i,
480
482
  ...a,
481
483
  ...o
482
484
  ])], c = e.nodes.filter((e) => e.type === "startEvent").map((e) => e.id);
483
485
  return s.length > 0 ? s : c;
484
486
  }
485
- function jt(e, t, n) {
486
- return Mt([{
487
+ function Mt(e, t, n) {
488
+ return Nt([{
487
489
  distance: 0,
488
490
  nodeId: e
489
491
  }], t, n);
490
492
  }
491
- function Mt(e, t, n, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map()) {
493
+ function Nt(e, t, n, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map()) {
492
494
  let [a, ...o] = e;
493
495
  if (!a) return i;
494
- if (r.has(a.nodeId)) return Mt(o, t, n, r, i);
496
+ if (r.has(a.nodeId)) return Nt(o, t, n, r, i);
495
497
  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;
496
- return Mt([...o, ...(t.get(a.nodeId) ?? []).map((e) => ({
498
+ return Nt([...o, ...(t.get(a.nodeId) ?? []).map((e) => ({
497
499
  distance: a.distance + 1,
498
500
  nodeId: e
499
501
  }))], t, n, s, c);
500
502
  }
501
- function Nt(e, t) {
503
+ function Pt(e, t) {
502
504
  return [...t.entries()].reduce((e, [t, n]) => new Map(e).set(t, Math.min(e.get(t) ?? n, n)), e);
503
505
  }
504
- function Pt(e) {
506
+ function Ft(e) {
505
507
  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}`;
506
508
  }
507
- function Ft(e, t, n, r, i, a, o, s, c) {
508
- let l = e.filter(X).map((e) => {
509
- let t = Q(e), n = e.nodeId ? st(e.nodeId, r) : null;
509
+ function It(e, t, n, r, i, a, o, s, c) {
510
+ let l = e.filter(yt).map((e) => {
511
+ let t = wt(e), n = e.nodeId ? dt(e.nodeId, r) : null;
510
512
  return {
511
513
  descriptionParts: [
512
- J(n ? `節點:${n}` : "節點:全流程"),
513
- gt("操作者", e.actorMemberId, a, "系統"),
514
- J(`時間:${Tt(e.createdAt)}`),
515
- ...Dt(e, t, r, o, s, c, a)
516
- ].filter(Y),
517
- error: wt(e, t),
514
+ K(n ? `節點:${n}` : "節點:全流程"),
515
+ vt("操作者", e.actorMemberId, a, "系統"),
516
+ K(`時間:${Et(e.createdAt)}`),
517
+ ...Ot(e, t, r, o, s, c, a)
518
+ ].filter(J),
519
+ error: Tt(e, t),
518
520
  id: e.id,
519
- title: Ct(e.eventType, t)
521
+ title: Q(e.eventType, t)
520
522
  };
521
- }), u = t.filter(nt).map((e) => ({
523
+ }), u = t.filter(ot).map((e) => ({
522
524
  descriptionParts: [
523
- J(`節點:${st(e.nodeId, r)}`),
524
- gt("處理者", e.assigneeMemberId, a, "未指定"),
525
- J(`建立時間:${Tt(e.createdAt)}`)
526
- ].filter(Y),
525
+ K(`節點:${dt(e.nodeId, r)}`),
526
+ vt("處理者", e.assigneeMemberId, a, "未指定"),
527
+ K(`建立時間:${Et(e.createdAt)}`)
528
+ ].filter(J),
527
529
  error: !1,
528
530
  id: `pending-task-${e.id}`,
529
531
  title: e.status === "IN_PROGRESS" ? "簽核處理中" : "等待簽核處理"
530
- })), d = new Set([...e.filter(X).map((e) => e.nodeId), ...t.map((e) => e.nodeId)].filter(V)), f = r ? $(r, t, n, i, d).map((e) => ({
531
- descriptionParts: [J(`${G(e.type)} · 尚未抵達`)].filter(Y),
532
+ })), d = new Set([...e.filter(yt).map((e) => e.nodeId), ...t.map((e) => e.nodeId)].filter(z)), f = r ? kt(r, t, n, i, d).map((e) => ({
533
+ descriptionParts: [K(`${H(e.type)} · 尚未抵達`)].filter(J),
532
534
  error: !1,
533
535
  forcePending: !0,
534
536
  id: `future-node-${e.id}`,
535
- title: Pt(e)
537
+ title: Ft(e)
536
538
  })) : [];
537
539
  return [
538
540
  ...l,
@@ -540,18 +542,18 @@ function Ft(e, t, n, r, i, a, o, s, c) {
540
542
  ...f
541
543
  ];
542
544
  }
543
- function It(e, t, n, r) {
545
+ function Lt(e, t, n, r) {
544
546
  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");
545
547
  return a ? {
546
- secondaryLabel: `處理者 ${ct(a)}`,
548
+ secondaryLabel: `處理者 ${W(a)}`,
547
549
  statusLabel: "待處理",
548
550
  tone: "current"
549
551
  } : o ? {
550
- secondaryLabel: `已取消 ${ct(o)}`,
552
+ secondaryLabel: `已取消 ${W(o)}`,
551
553
  statusLabel: "已取消",
552
554
  tone: "cancelled"
553
555
  } : s ? {
554
- secondaryLabel: `已完成 ${ct(s)}`,
556
+ secondaryLabel: `已完成 ${W(s)}`,
555
557
  statusLabel: "已完成",
556
558
  tone: "completed"
557
559
  } : l ? {
@@ -571,42 +573,42 @@ function It(e, t, n, r) {
571
573
  statusLabel: r === "REJECTED" ? "已拒絕" : "已完成",
572
574
  tone: r === "REJECTED" ? "cancelled" : "completed"
573
575
  } : {
574
- secondaryLabel: G(e.type),
576
+ secondaryLabel: H(e.type),
575
577
  statusLabel: "未抵達",
576
578
  tone: "neutral"
577
579
  };
578
580
  }
579
581
  //#endregion
580
582
  //#region src/views/instances/detail/sections/container-helpers.ts
581
- async function Lt({ activityLogs: e, adhocDirectives: t = [], instance: n, tasks: r }) {
583
+ async function Rt({ activityLogs: e, adhocDirectives: t = [], instance: n, tasks: r }) {
582
584
  let i = [...new Set([
583
585
  n?.initiatorMemberId ?? null,
584
586
  n?.submittedByMemberId ?? null,
585
587
  ...e.map((e) => e.actorMemberId),
586
- ...e.flatMap(yt),
588
+ ...e.flatMap(xt),
587
589
  ...r.map((e) => e.assigneeMemberId),
588
590
  ...r.map((e) => e.originalAssigneeMemberId),
589
591
  ...r.flatMap((e) => e.candidateMemberIds),
590
- ...r.flatMap((e) => et(e.delegationChainJson).flatMap((e) => [e.from, e.to])),
591
- ...t.flatMap((e) => [e.createdByMemberId, ...Rt(e.targetValueJson)])
592
- ].filter(V))];
592
+ ...r.flatMap((e) => nt(e.delegationChainJson).flatMap((e) => [e.from, e.to])),
593
+ ...t.flatMap((e) => [e.createdByMemberId, ...zt(e.targetValueJson)])
594
+ ].filter(z))];
593
595
  try {
594
- return await be(i);
596
+ return await xe(i);
595
597
  } catch {
596
598
  return [];
597
599
  }
598
600
  }
599
- function Rt(e) {
601
+ function zt(e) {
600
602
  try {
601
603
  return (JSON.parse(e).memberIds ?? []).filter((e) => typeof e == "string");
602
604
  } catch {
603
605
  return [];
604
606
  }
605
607
  }
606
- async function zt(e) {
607
- return (await Promise.all(e.map((e) => fe(e.id)))).flat();
608
+ async function Bt(e) {
609
+ return (await Promise.all(e.map((e) => pe(e.id)))).flat();
608
610
  }
609
- function Bt(e) {
611
+ function Vt(e) {
610
612
  return e.reduce((e, t) => {
611
613
  let n = e.get(t.taskId), r = !n || new Date(t.decidedAt).getTime() > new Date(n.decidedAt).getTime() ? t : n;
612
614
  return new Map(e).set(t.taskId, r);
@@ -614,29 +616,29 @@ function Bt(e) {
614
616
  }
615
617
  //#endregion
616
618
  //#region src/views/instances/detail/sections/InstanceFormSection.tsx
617
- var Vt = {
619
+ var Ht = {
618
620
  display: "grid",
619
621
  gap: 16
620
- }, Ht = {
622
+ }, Ut = {
621
623
  display: "flex",
622
624
  flexWrap: "wrap",
623
625
  gap: 8
624
626
  };
625
- function Ut({ canResubmitInstance: e, deciding: t, error: n, instance: r, loading: i, onDataSourceStateChange: a, onResubmitFormChange: s, onResubmitInstance: c, onUploadAttachment: l, resubmitFormData: u, resubmitFormErrors: d }) {
626
- return /* @__PURE__ */ T("div", {
627
- style: Vt,
627
+ function Wt({ canResubmitInstance: e, deciding: t, error: n, instance: r, loading: i, onDataSourceStateChange: a, onResubmitFormChange: o, onResubmitInstance: c, onUploadAttachment: l, resubmitFormData: u, resubmitFormErrors: d }) {
628
+ return /* @__PURE__ */ E("div", {
629
+ style: Ht,
628
630
  children: [
629
- n ? /* @__PURE__ */ w(S, {
631
+ n ? /* @__PURE__ */ T(C, {
630
632
  color: "text-error",
631
633
  variant: "body",
632
634
  children: n
633
635
  }) : null,
634
- i ? /* @__PURE__ */ w(S, {
636
+ i ? /* @__PURE__ */ T(C, {
635
637
  color: "text-neutral",
636
638
  variant: "body",
637
639
  children: "載入中..."
638
640
  }) : null,
639
- r?.formDefinitionSnapshot.schema && r.formDefinitionSnapshot.uiSchema ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(o, {
641
+ r?.formDefinitionSnapshot.schema && r.formDefinitionSnapshot.uiSchema ? /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(s, {
640
642
  dataSourceContext: e ? {
641
643
  instanceId: r.id,
642
644
  kind: "runtime"
@@ -644,7 +646,7 @@ function Ut({ canResubmitInstance: e, deciding: t, error: n, instance: r, loadin
644
646
  dataSourceInitialValues: r.formData,
645
647
  errors: d,
646
648
  onChange: (e) => {
647
- s(e);
649
+ o(e);
648
650
  },
649
651
  onDataSourceStateChange: a,
650
652
  onUploadAttachment: e ? l : void 0,
@@ -653,17 +655,17 @@ function Ut({ canResubmitInstance: e, deciding: t, error: n, instance: r, loadin
653
655
  schema: r.formDefinitionSnapshot.schema,
654
656
  uiSchema: r.formDefinitionSnapshot.uiSchema,
655
657
  value: e ? u : r.formData
656
- }), e ? /* @__PURE__ */ w("div", {
657
- style: Ht,
658
- children: /* @__PURE__ */ w(g, {
658
+ }), e ? /* @__PURE__ */ T("div", {
659
+ style: Ut,
660
+ children: /* @__PURE__ */ T(_, {
659
661
  disabled: t,
660
- icon: Me,
662
+ icon: Pe,
661
663
  iconType: "leading",
662
664
  onClick: c,
663
665
  variant: "base-primary",
664
666
  children: "重新送出"
665
667
  })
666
- }) : null] }) : /* @__PURE__ */ w(S, {
668
+ }) : null] }) : /* @__PURE__ */ T(C, {
667
669
  color: "text-neutral",
668
670
  variant: "body",
669
671
  children: "此案件沒有可顯示的表單快照。"
@@ -673,20 +675,20 @@ function Ut({ canResubmitInstance: e, deciding: t, error: n, instance: r, loadin
673
675
  }
674
676
  //#endregion
675
677
  //#region src/views/instances/detail/sections/InstanceAttachmentsSection.tsx
676
- var Wt = {
678
+ var Gt = {
677
679
  display: "grid",
678
680
  gap: 16
679
681
  };
680
- function Gt({ attachments: e, onDownload: n, onPreview: r }) {
681
- let i = f(() => e.map((e) => ({
682
+ function Kt({ attachments: e, onDownload: n, onPreview: r }) {
683
+ let i = p(() => e.map((e) => ({
682
684
  attachment: e,
683
685
  createdAt: e.createdAt,
684
686
  filename: e.filename,
685
687
  id: e.id,
686
688
  key: e.id,
687
689
  mimeType: e.mimeType,
688
- sizeLabel: rt(Number(e.sizeBytes))
689
- })), [e]), a = f(() => [
690
+ sizeLabel: st(Number(e.sizeBytes))
691
+ })), [e]), a = p(() => [
690
692
  {
691
693
  dataIndex: "filename",
692
694
  key: "filename",
@@ -707,7 +709,7 @@ function Gt({ attachments: e, onDownload: n, onPreview: r }) {
707
709
  },
708
710
  {
709
711
  key: "createdAt",
710
- render: (e) => /* @__PURE__ */ w(S, {
712
+ render: (e) => /* @__PURE__ */ T(C, {
711
713
  component: "span",
712
714
  variant: "body",
713
715
  children: t(e.createdAt)
@@ -715,16 +717,16 @@ function Gt({ attachments: e, onDownload: n, onPreview: r }) {
715
717
  title: "上傳時間",
716
718
  width: 220
717
719
  }
718
- ], []), o = f(() => ({
720
+ ], []), o = p(() => ({
719
721
  render: (e) => [...e.mimeType === "application/pdf" ? [{
720
- icon: O,
722
+ icon: je,
721
723
  iconType: "leading",
722
724
  name: "預覽",
723
725
  onClick: () => {
724
726
  r(e.attachment);
725
727
  }
726
728
  }] : [], {
727
- icon: ke,
729
+ icon: D,
728
730
  iconType: "leading",
729
731
  name: "下載",
730
732
  onClick: () => {
@@ -734,18 +736,18 @@ function Gt({ attachments: e, onDownload: n, onPreview: r }) {
734
736
  variant: "base-secondary",
735
737
  width: 160
736
738
  }), [n, r]);
737
- return /* @__PURE__ */ T("div", {
738
- style: Wt,
739
- children: [/* @__PURE__ */ w(S, {
739
+ return /* @__PURE__ */ E("div", {
740
+ style: Gt,
741
+ children: [/* @__PURE__ */ T(C, {
740
742
  component: "h2",
741
743
  variant: "h3",
742
744
  children: "附件"
743
- }), i.length > 0 ? /* @__PURE__ */ w(re, {
745
+ }), i.length > 0 ? /* @__PURE__ */ T(ie, {
744
746
  actions: o,
745
747
  columns: a,
746
748
  dataSource: i,
747
749
  fullWidth: !0
748
- }) : /* @__PURE__ */ w(S, {
750
+ }) : /* @__PURE__ */ T(C, {
749
751
  color: "text-neutral",
750
752
  variant: "body",
751
753
  children: "此案件沒有附件。"
@@ -754,58 +756,58 @@ function Gt({ attachments: e, onDownload: n, onPreview: r }) {
754
756
  }
755
757
  //#endregion
756
758
  //#region src/views/instances/detail/sections/InstanceTasksSection.tsx
757
- var Kt = {
759
+ var qt = {
758
760
  display: "grid",
759
761
  gap: 12,
760
762
  width: "100%"
761
- }, qt = {
763
+ }, Jt = {
762
764
  minWidth: "100%",
763
765
  width: "100%"
764
- }, Jt = {
766
+ }, Yt = {
765
767
  display: "grid",
766
768
  gap: 12,
767
769
  width: "100%"
768
- }, Yt = { marginTop: 12 }, Xt = { marginTop: 24 };
769
- function Zt(e) {
770
+ }, Xt = { marginTop: 12 }, Zt = { marginTop: 24 };
771
+ function Qt(e) {
770
772
  e && (e.style.width = "100%");
771
773
  }
772
- var Qt = {
774
+ var $t = {
773
775
  COMPLETION_NOTIFY: "結案通知",
774
776
  COUNTERSIGN: "臨時會簽",
775
777
  PRE_APPROVAL: "臨時加簽",
776
778
  STAGE_NOTIFY: "階段完成通知"
777
- }, $t = {
779
+ }, en = {
778
780
  COMPLETION_NOTIFY: "本張單到達結案狀態(核准 / 拒絕 / 取消)後,通知指定對象。",
779
781
  COUNTERSIGN: "指定對象會併入下一層簽核,下一層需所有人都完成才會繼續。",
780
782
  PRE_APPROVAL: "指定對象需先完成加簽,本階段才會往下一層繼續。",
781
783
  STAGE_NOTIFY: "本階段完成後(不論通過與否)通知指定對象。"
782
- }, en = [{
784
+ }, tn = [{
783
785
  id: "REJECT_INSTANCE",
784
786
  name: "加簽拒絕時整單駁回"
785
787
  }, {
786
788
  id: "RETURN_TO_ORIGIN",
787
789
  name: "加簽拒絕時退回給我重新處理"
788
- }], tn = [{
790
+ }], nn = [{
789
791
  id: "MEMBER",
790
792
  name: "指定成員"
791
793
  }, {
792
794
  id: "WEBHOOK",
793
795
  name: "Webhook"
794
- }], nn = c(function({ adhocDirectives: e, currentMemberId: r, instance: a, memberProfilesById: o, onChanged: s, tasks: c }, l) {
795
- let [u, p] = m(!1), [h, v] = m(null), [y, ne] = m(""), [x, ae] = m(!1), [oe, ue] = m(""), [de, fe] = m(null), [pe, me] = m(!1), [he, ge] = m(""), [_e, be] = m(!1), [xe, Se] = m(null), [we, Te] = m(""), [Ee, D] = m(null), [De, Oe] = m(!1), [ke, O] = m([]), [Ae, je] = m(!1), [Me, Ne] = m(""), [Pe, Fe] = m([]), [Ie, Le] = m(!1), [Re, ze] = m([]), [Be, Ve] = m(!1), [k, He] = m("COUNTERSIGN"), [Ue, A] = m("REJECT_INSTANCE"), [We, j] = m(!1), [Ge, Ke] = m("MEMBER"), [M, N] = m(""), qe = oe.trim(), Je = he.trim(), Ye = we.trim(), P = f(() => c.find((e) => lt(e, r) && (e.status === "PENDING" || e.status === "IN_PROGRESS")) ?? null, [r, c]), F = f(() => P && a ? a.workflowSnapshot.nodes.find((e) => e.id === P.nodeId) ?? null : null, [P, a]), I = f(() => F && a ? ut(a.workflowSnapshot, F) : [], [F, a]), Xe = F?.type === "userTask" && F.data.returnBehavior.allowReturn, Ze = F?.type === "userTask" && F.data.allowReject !== !1, L = F?.type === "userTask" && F.data.allowTransfer !== !1, R = F?.type === "userTask" && F.data.returnBehavior.requireComment === !0, Qe = F?.type === "userTask" && F.data.allowAddSigner, $e = f(() => e.filter((e) => e.status === "PENDING"), [e]), et = I.find((e) => e.id === xe) ?? I[0] ?? null, z = f(() => c.map((e) => ({
796
+ }], rn = l(function({ adhocDirectives: e, currentMemberId: r, instance: i, memberProfilesById: o, onChanged: s, tasks: c }, l) {
797
+ let [u, d] = h(!1), [m, g] = h(null), [te, b] = h(""), [ne, re] = h(!1), [S, se] = h(""), [de, fe] = h(null), [pe, me] = h(!1), [he, ge] = h(""), [_e, ve] = h(!1), [xe, Se] = h(null), [Ce, Te] = h(""), [Ee, De] = h(null), [Oe, ke] = h(!1), [Ae, D] = h([]), [je, Me] = h(!1), [Ne, Pe] = h(""), [O, Fe] = h([]), [Ie, Le] = h(!1), [Re, ze] = h([]), [Be, Ve] = h(!1), [k, He] = h("COUNTERSIGN"), [Ue, We] = h("REJECT_INSTANCE"), [A, Ge] = h(!1), [Ke, qe] = h("MEMBER"), [Je, j] = h(""), M = S.trim(), Ye = he.trim(), Xe = Ce.trim(), N = p(() => c.find((e) => ft(e, r) && (e.status === "PENDING" || e.status === "IN_PROGRESS")) ?? null, [r, c]), P = p(() => N && i ? i.workflowSnapshot.nodes.find((e) => e.id === N.nodeId) ?? null : null, [N, i]), F = p(() => P && i ? G(i.workflowSnapshot, P) : [], [P, i]), Ze = P?.type === "userTask" && P.data.returnBehavior.allowReturn, I = P?.type === "userTask" && P.data.allowReject !== !1, Qe = P?.type === "userTask" && P.data.allowTransfer !== !1, L = P?.type === "userTask" && P.data.returnBehavior.requireComment === !0, $e = P?.type === "userTask" && P.data.allowAddSigner, et = p(() => e.filter((e) => e.status === "PENDING"), [e]), tt = F.find((e) => e.id === xe) ?? F[0] ?? null, nt = p(() => c.map((e) => ({
796
798
  ...e,
797
- assigneeLabel: ct(e, o),
799
+ assigneeLabel: W(e, o),
798
800
  key: e.id,
799
- nodeLabel: i({
801
+ nodeLabel: a({
800
802
  ...e,
801
- nodeLabel: st(e.nodeId, a?.workflowSnapshot ?? null)
803
+ nodeLabel: dt(e.nodeId, i?.workflowSnapshot ?? null)
802
804
  }),
803
- statusLabel: ot(e.status)
805
+ statusLabel: V(e.status)
804
806
  })), [
805
- a,
807
+ i,
806
808
  o,
807
809
  c
808
- ]), B = f(() => [
810
+ ]), R = p(() => [
809
811
  {
810
812
  dataIndex: "nodeLabel",
811
813
  key: "nodeLabel",
@@ -815,7 +817,7 @@ var Qt = {
815
817
  {
816
818
  key: "assigneeMemberId",
817
819
  title: "處理者",
818
- render: (e) => /* @__PURE__ */ w(S, {
820
+ render: (e) => /* @__PURE__ */ T(C, {
819
821
  component: "span",
820
822
  variant: "body",
821
823
  children: e.assigneeLabel
@@ -830,7 +832,7 @@ var Qt = {
830
832
  },
831
833
  {
832
834
  key: "createdAt",
833
- render: (e) => /* @__PURE__ */ w(S, {
835
+ render: (e) => /* @__PURE__ */ T(C, {
834
836
  component: "span",
835
837
  variant: "body",
836
838
  children: t(e.createdAt)
@@ -838,13 +840,13 @@ var Qt = {
838
840
  title: "建立時間",
839
841
  width: 220
840
842
  }
841
- ], []), tt = f(() => $e.map((e) => ({
843
+ ], []), rt = p(() => et.map((e) => ({
842
844
  ...e,
843
- createdByLabel: K(e.createdByMemberId, o),
845
+ createdByLabel: U(e.createdByMemberId, o),
844
846
  key: e.id,
845
- targetLabel: rn(e, o),
846
- typeLabel: Qt[e.type]
847
- })), [o, $e]), V = f(() => [
847
+ targetLabel: an(e, o),
848
+ typeLabel: $t[e.type]
849
+ })), [o, et]), it = p(() => [
848
850
  {
849
851
  dataIndex: "typeLabel",
850
852
  key: "typeLabel",
@@ -853,7 +855,7 @@ var Qt = {
853
855
  },
854
856
  {
855
857
  key: "targetLabel",
856
- render: (e) => /* @__PURE__ */ w(S, {
858
+ render: (e) => /* @__PURE__ */ T(C, {
857
859
  component: "span",
858
860
  variant: "body",
859
861
  children: e.targetLabel
@@ -863,7 +865,7 @@ var Qt = {
863
865
  },
864
866
  {
865
867
  key: "createdByLabel",
866
- render: (e) => /* @__PURE__ */ w(S, {
868
+ render: (e) => /* @__PURE__ */ T(C, {
867
869
  component: "span",
868
870
  variant: "body",
869
871
  children: e.createdByLabel
@@ -873,7 +875,7 @@ var Qt = {
873
875
  },
874
876
  {
875
877
  key: "createdAt",
876
- render: (e) => /* @__PURE__ */ w(S, {
878
+ render: (e) => /* @__PURE__ */ T(C, {
877
879
  component: "span",
878
880
  variant: "body",
879
881
  children: t(e.createdAt)
@@ -883,336 +885,324 @@ var Qt = {
883
885
  },
884
886
  {
885
887
  key: "actions",
886
- render: (e) => e.createdByMemberId === r ? /* @__PURE__ */ w(g, {
887
- disabled: We,
888
+ render: (e) => e.createdByMemberId === r ? /* @__PURE__ */ T(_, {
889
+ disabled: A,
888
890
  onClick: () => void Ct(e.id),
889
891
  size: "minor",
890
892
  variant: "destructive-secondary",
891
893
  children: "撤回"
892
- }) : /* @__PURE__ */ w(C, {}),
894
+ }) : /* @__PURE__ */ T(w, {}),
893
895
  title: "操作",
894
896
  width: 100
895
897
  }
896
- ], [We, r]);
897
- async function H({ action: e, comment: t, returnToNodeId: n = null, transferToMemberId: i = null }) {
898
- if (!r || !P || e === "REJECTED" && !Ze || e === "TRANSFERRED" && !L) return !1;
899
- p(!0), v(null);
898
+ ], [A, r]);
899
+ async function z({ action: e, comment: t, returnToNodeId: n = null, transferToMemberId: i = null }) {
900
+ if (!r || !N || e === "REJECTED" && !I || e === "TRANSFERRED" && !Qe) return !1;
901
+ d(!0), g(null);
900
902
  try {
901
- await le({
903
+ await ue({
902
904
  action: e,
903
905
  comment: t,
904
906
  decidedByMemberId: r,
905
907
  returnToNodeId: n,
906
- taskId: P.id,
908
+ taskId: N.id,
907
909
  transferToMemberId: i
908
- }), me(!1), be(!1), je(!1), ue(""), ge(""), Te(""), D(null), Se(null), fe(null);
910
+ }), me(!1), ve(!1), Me(!1), se(""), ge(""), Te(""), De(null), Se(null), fe(null);
909
911
  } catch (e) {
910
- return v(U(e)), p(!1), !1;
912
+ return g(B(e)), d(!1), !1;
911
913
  }
912
914
  try {
913
915
  await s();
914
916
  } catch (e) {
915
- v(U(e));
917
+ g(B(e));
916
918
  } finally {
917
- p(!1);
919
+ d(!1);
918
920
  }
919
921
  return !0;
920
922
  }
921
- function nt() {
922
- r && P && (v(null), ne(""), ae(!0));
923
+ function at() {
924
+ r && N && (g(null), b(""), re(!0));
923
925
  }
924
- function rt() {
925
- u || (ae(!1), ne(""));
926
+ function ot() {
927
+ u || (re(!1), b(""));
926
928
  }
927
- async function it() {
928
- u || await H({
929
+ async function st() {
930
+ u || await z({
929
931
  action: "APPROVED",
930
- comment: y.trim() || null
931
- }) && (ae(!1), ne(""));
932
+ comment: te.trim() || null
933
+ }) && (re(!1), b(""));
932
934
  }
933
- function at() {
934
- Ze && (ue(""), fe(null), me(!0));
935
+ function ct() {
936
+ I && (se(""), fe(null), me(!0));
935
937
  }
936
- function W() {
937
- u || (me(!1), ue(""), fe(null));
938
+ function lt() {
939
+ u || (me(!1), se(""), fe(null));
938
940
  }
939
- function G() {
940
- ge(""), Se(I[0]?.id ?? null), be(!0);
941
+ function ut() {
942
+ ge(""), Se(F[0]?.id ?? null), ve(!0);
941
943
  }
942
- function J() {
943
- u || (be(!1), ge(""), Se(null));
944
+ function H() {
945
+ u || (ve(!1), ge(""), Se(null));
944
946
  }
945
- function ht() {
946
- L && (Te(""), D(null), je(!0), Y(""));
947
+ function K() {
948
+ Qe && (Te(""), De(null), Me(!0), vt(""));
947
949
  }
948
- function gt() {
949
- u || (je(!1), Te(""), D(null));
950
+ function q() {
951
+ u || (Me(!1), Te(""), De(null));
950
952
  }
951
- async function Y(e) {
952
- Oe(!0);
953
+ async function vt(e) {
954
+ ke(!0);
953
955
  try {
954
- O((await Ce(e)).filter((e) => e.memberId !== r).map(q));
956
+ D((await we(e)).filter((e) => e.memberId !== r).map(pt));
955
957
  } catch (e) {
956
- v(U(e));
958
+ g(B(e));
957
959
  } finally {
958
- Oe(!1);
960
+ ke(!1);
959
961
  }
960
962
  }
961
- async function _t() {
962
- if (Ze) {
963
- if (!qe) {
964
- fe("請輸入拒絕原因");
965
- return;
966
- }
967
- await H({
968
- action: "REJECTED",
969
- comment: qe
970
- });
971
- }
963
+ async function J() {
964
+ I && (M ? await z({
965
+ action: "REJECTED",
966
+ comment: M
967
+ }) : fe("請輸入拒絕原因"));
972
968
  }
973
- async function X() {
974
- if (L) {
975
- if (!Ee) {
976
- v("請選擇轉派對象");
977
- return;
978
- }
979
- await H({
980
- action: "TRANSFERRED",
981
- comment: Ye || null,
982
- transferToMemberId: Ee.id
983
- });
984
- }
969
+ async function Y() {
970
+ Qe && (Ee ? await z({
971
+ action: "TRANSFERRED",
972
+ comment: Xe || null,
973
+ transferToMemberId: Ee.id
974
+ }) : g("請選擇轉派對象"));
985
975
  }
986
- async function vt() {
987
- await H({
976
+ async function yt() {
977
+ await z({
988
978
  action: "RETURNED",
989
- comment: Je || null,
990
- returnToNodeId: et?.id ?? null
979
+ comment: Ye || null,
980
+ returnToNodeId: tt?.id ?? null
991
981
  });
992
982
  }
993
- function yt() {
994
- Ne(""), Fe([]), A("REJECT_INSTANCE"), Ke("MEMBER"), N("");
983
+ function bt() {
984
+ Pe(""), Fe([]), We("REJECT_INSTANCE"), qe("MEMBER"), j("");
995
985
  }
996
- function bt(e) {
997
- He(e), yt(), Ve(!0), xt("");
986
+ function xt(e) {
987
+ He(e), bt(), Ve(!0), Z("");
998
988
  }
999
- function Z() {
1000
- We || (Ve(!1), yt());
989
+ function X() {
990
+ A || (Ve(!1), bt());
1001
991
  }
1002
- async function xt(e) {
992
+ async function Z(e) {
1003
993
  Le(!0);
1004
994
  try {
1005
- ze((await Ce(e)).map(q));
995
+ ze((await we(e)).map(pt));
1006
996
  } catch (e) {
1007
- v(U(e));
997
+ g(B(e));
1008
998
  } finally {
1009
999
  Le(!1);
1010
1000
  }
1011
1001
  }
1012
1002
  async function St() {
1013
- if (!P) return;
1014
- let e = (k === "STAGE_NOTIFY" || k === "COMPLETION_NOTIFY") && Ge === "WEBHOOK", t = dt({
1015
- memberIds: Pe.map((e) => e.id),
1003
+ if (!N) return;
1004
+ let e = (k === "STAGE_NOTIFY" || k === "COMPLETION_NOTIFY") && Ke === "WEBHOOK", t = mt({
1005
+ memberIds: O.map((e) => e.id),
1016
1006
  useWebhookTarget: e,
1017
- webhookUrl: M
1007
+ webhookUrl: Je
1018
1008
  });
1019
1009
  if (!t.valid) {
1020
- v(t.error);
1010
+ g(t.error);
1021
1011
  return;
1022
1012
  }
1023
- let { target: n } = t, r = Me.trim() || null;
1024
- j(!0), v(null);
1013
+ let { target: n } = t, r = Ne.trim() || null;
1014
+ Ge(!0), g(null);
1025
1015
  try {
1026
- k === "COUNTERSIGN" ? await ve({
1016
+ k === "COUNTERSIGN" ? await ye({
1027
1017
  comment: r,
1028
1018
  target: n,
1029
- taskId: P.id
1030
- }) : k === "PRE_APPROVAL" ? await ye({
1019
+ taskId: N.id
1020
+ }) : k === "PRE_APPROVAL" ? await be({
1031
1021
  comment: r,
1032
1022
  onReject: Ue,
1033
1023
  target: n,
1034
- taskId: P.id
1035
- }) : k === "STAGE_NOTIFY" ? await ce({
1024
+ taskId: N.id
1025
+ }) : k === "STAGE_NOTIFY" ? await le({
1036
1026
  target: n,
1037
- taskId: P.id
1038
- }) : await se({
1027
+ taskId: N.id
1028
+ }) : await ce({
1039
1029
  target: n,
1040
- taskId: P.id
1041
- }), Ve(!1), yt(), await s();
1030
+ taskId: N.id
1031
+ }), Ve(!1), bt(), await s();
1042
1032
  } catch (e) {
1043
- v(U(e));
1033
+ g(B(e));
1044
1034
  } finally {
1045
- j(!1);
1035
+ Ge(!1);
1046
1036
  }
1047
1037
  }
1048
1038
  async function Ct(e) {
1049
- j(!0), v(null);
1039
+ Ge(!0), g(null);
1050
1040
  try {
1051
- await E(e), await s();
1041
+ await oe(e), await s();
1052
1042
  } catch (e) {
1053
- v(U(e));
1043
+ g(B(e));
1054
1044
  } finally {
1055
- j(!1);
1045
+ Ge(!1);
1056
1046
  }
1057
1047
  }
1058
- d(l, () => ({
1059
- canAddSignerCurrentTask: Qe,
1060
- canRejectCurrentTask: Ze,
1061
- canReturnCurrentTask: Xe,
1062
- canTransferCurrentTask: L,
1048
+ f(l, () => ({
1049
+ canAddSignerCurrentTask: $e,
1050
+ canRejectCurrentTask: I,
1051
+ canReturnCurrentTask: Ze,
1052
+ canTransferCurrentTask: Qe,
1063
1053
  deciding: u,
1064
- handleApprove: nt,
1065
- hasCurrentTask: P !== null,
1066
- openAdhocModal: bt,
1067
- openRejectModal: at,
1068
- openReturnModal: G,
1069
- openTransferModal: ht
1054
+ handleApprove: at,
1055
+ hasCurrentTask: N !== null,
1056
+ openAdhocModal: xt,
1057
+ openRejectModal: ct,
1058
+ openReturnModal: ut,
1059
+ openTransferModal: K
1070
1060
  }), [
1071
- Qe,
1061
+ $e,
1062
+ I,
1072
1063
  Ze,
1073
- Xe,
1074
- L,
1064
+ Qe,
1075
1065
  r,
1076
- P,
1066
+ N,
1077
1067
  u
1078
1068
  ]);
1079
- let Q = k === "STAGE_NOTIFY" || k === "COMPLETION_NOTIFY", wt = Q && Ge === "WEBHOOK" ? !M.trim() : Pe.length === 0, Tt = en.find((e) => e.id === Ue) ?? en[0], Et = tn.find((e) => e.id === Ge) ?? tn[0];
1080
- return /* @__PURE__ */ T(C, { children: [
1081
- /* @__PURE__ */ w(S, {
1069
+ let Q = k === "STAGE_NOTIFY" || k === "COMPLETION_NOTIFY", wt = Q && Ke === "WEBHOOK" ? !Je.trim() : O.length === 0, Tt = tn.find((e) => e.id === Ue) ?? tn[0], Et = nn.find((e) => e.id === Ke) ?? nn[0];
1070
+ return /* @__PURE__ */ E(w, { children: [
1071
+ /* @__PURE__ */ T(C, {
1082
1072
  component: "h2",
1083
1073
  variant: "h3",
1084
1074
  children: "任務"
1085
1075
  }),
1086
- h ? /* @__PURE__ */ w(S, {
1076
+ m ? /* @__PURE__ */ T(C, {
1087
1077
  color: "text-error",
1088
1078
  variant: "body",
1089
- children: h
1079
+ children: m
1090
1080
  }) : null,
1091
- /* @__PURE__ */ w("div", {
1092
- style: Yt,
1093
- children: /* @__PURE__ */ w(re, {
1094
- columns: B,
1095
- dataSource: z,
1081
+ /* @__PURE__ */ T("div", {
1082
+ style: Xt,
1083
+ children: /* @__PURE__ */ T(ie, {
1084
+ columns: R,
1085
+ dataSource: nt,
1096
1086
  fullWidth: !0
1097
1087
  })
1098
1088
  }),
1099
- $e.length > 0 ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(S, {
1089
+ et.length > 0 ? /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(C, {
1100
1090
  component: "h3",
1101
- style: Xt,
1091
+ style: Zt,
1102
1092
  variant: "h3",
1103
1093
  children: "待生效的臨時設定"
1104
- }), /* @__PURE__ */ w("div", {
1105
- style: Yt,
1106
- children: /* @__PURE__ */ w(re, {
1107
- columns: V,
1108
- dataSource: tt,
1094
+ }), /* @__PURE__ */ T("div", {
1095
+ style: Xt,
1096
+ children: /* @__PURE__ */ T(ie, {
1097
+ columns: it,
1098
+ dataSource: rt,
1109
1099
  fullWidth: !0
1110
1100
  })
1111
1101
  })] }) : null,
1112
- /* @__PURE__ */ T(_, {
1102
+ /* @__PURE__ */ E(y, {
1113
1103
  cancelText: "取消",
1114
1104
  confirmText: "送出同意",
1115
1105
  loading: u,
1116
1106
  modalType: "standard",
1117
- onCancel: rt,
1118
- onClose: rt,
1119
- onConfirm: () => void it(),
1120
- open: x,
1107
+ onCancel: ot,
1108
+ onClose: ot,
1109
+ onConfirm: () => void st(),
1110
+ open: ne,
1121
1111
  showModalFooter: !0,
1122
1112
  showModalHeader: !0,
1123
1113
  size: "regular",
1124
1114
  supportingText: "可以留下同意的說明,內容會記錄在簽核歷程;不填也可以直接送出。",
1125
1115
  title: "簽核意見",
1126
- children: [h ? /* @__PURE__ */ w(S, {
1116
+ children: [m ? /* @__PURE__ */ T(C, {
1127
1117
  color: "text-error",
1128
1118
  role: "alert",
1129
1119
  variant: "body",
1130
- children: h
1131
- }) : null, /* @__PURE__ */ w("div", {
1132
- style: Kt,
1133
- children: /* @__PURE__ */ w(n, {
1120
+ children: m
1121
+ }) : null, /* @__PURE__ */ T("div", {
1122
+ style: qt,
1123
+ children: /* @__PURE__ */ T(n, {
1134
1124
  label: "簽核意見",
1135
1125
  name: "approveComment",
1136
- children: /* @__PURE__ */ w(ie, {
1126
+ children: /* @__PURE__ */ T(ae, {
1137
1127
  autoFocus: !0,
1138
- onChange: (e) => ne(e.target.value),
1128
+ onChange: (e) => b(e.target.value),
1139
1129
  placeholder: "選填,例如補充核准的條件或提醒事項",
1140
- ref: Zt,
1130
+ ref: Qt,
1141
1131
  resize: "vertical",
1142
1132
  rows: 4,
1143
- style: qt,
1144
- value: y
1133
+ style: Jt,
1134
+ value: te
1145
1135
  })
1146
1136
  })
1147
1137
  })]
1148
1138
  }),
1149
- /* @__PURE__ */ w(_, {
1139
+ /* @__PURE__ */ T(y, {
1150
1140
  cancelText: "取消",
1151
1141
  confirmButtonProps: {
1152
- disabled: !qe,
1142
+ disabled: !M,
1153
1143
  variant: "destructive-primary"
1154
1144
  },
1155
1145
  confirmText: "送出拒絕",
1156
1146
  loading: u,
1157
1147
  modalStatusType: "error",
1158
1148
  modalType: "standard",
1159
- onCancel: W,
1160
- onClose: W,
1161
- onConfirm: () => void _t(),
1149
+ onCancel: lt,
1150
+ onClose: lt,
1151
+ onConfirm: () => void J(),
1162
1152
  open: pe,
1163
1153
  showModalFooter: !0,
1164
1154
  showModalHeader: !0,
1165
1155
  size: "regular",
1166
1156
  supportingText: "拒絕案件時必須留下原因,供發起人與後續追蹤查看。",
1167
1157
  title: "拒絕原因",
1168
- children: /* @__PURE__ */ T("div", {
1169
- style: Kt,
1170
- children: [/* @__PURE__ */ w(n, {
1158
+ children: /* @__PURE__ */ E("div", {
1159
+ style: qt,
1160
+ children: [/* @__PURE__ */ T(n, {
1171
1161
  label: "拒絕原因",
1172
1162
  name: "rejectReason",
1173
1163
  required: !0,
1174
- children: /* @__PURE__ */ w(ie, {
1164
+ children: /* @__PURE__ */ T(ae, {
1175
1165
  autoFocus: !0,
1176
1166
  onChange: (e) => {
1177
- ue(e.target.value), fe(null);
1167
+ se(e.target.value), fe(null);
1178
1168
  },
1179
1169
  placeholder: "請說明拒絕原因",
1180
- ref: Zt,
1170
+ ref: Qt,
1181
1171
  resize: "vertical",
1182
1172
  rows: 4,
1183
- style: qt,
1173
+ style: Jt,
1184
1174
  type: de ? "error" : "default",
1185
- value: oe
1175
+ value: S
1186
1176
  })
1187
- }), de ? /* @__PURE__ */ w(S, {
1177
+ }), de ? /* @__PURE__ */ T(C, {
1188
1178
  color: "text-error",
1189
1179
  variant: "body",
1190
1180
  children: de
1191
1181
  }) : null]
1192
1182
  })
1193
1183
  }),
1194
- /* @__PURE__ */ w(_, {
1184
+ /* @__PURE__ */ T(y, {
1195
1185
  cancelText: "取消",
1196
1186
  confirmButtonProps: { disabled: !Ee },
1197
1187
  confirmText: "送出轉派",
1198
1188
  loading: u,
1199
1189
  modalType: "standard",
1200
- onCancel: gt,
1201
- onClose: gt,
1202
- onConfirm: () => void X(),
1203
- open: Ae,
1190
+ onCancel: q,
1191
+ onClose: q,
1192
+ onConfirm: () => void Y(),
1193
+ open: je,
1204
1194
  showModalFooter: !0,
1205
1195
  showModalHeader: !0,
1206
1196
  size: "regular",
1207
1197
  supportingText: "轉派後,原任務會保留轉派紀錄,新的待簽任務會指派給指定成員。",
1208
1198
  title: "轉派簽核",
1209
- children: /* @__PURE__ */ T("div", {
1210
- style: Jt,
1211
- children: [/* @__PURE__ */ w(n, {
1199
+ children: /* @__PURE__ */ E("div", {
1200
+ style: Yt,
1201
+ children: [/* @__PURE__ */ T(n, {
1212
1202
  label: "轉派對象",
1213
1203
  name: "transferToMemberId",
1214
1204
  required: !0,
1215
- children: /* @__PURE__ */ w(ee, {
1205
+ children: /* @__PURE__ */ T(ee, {
1216
1206
  asyncData: !0,
1217
1207
  disabledOptionsFilter: !0,
1218
1208
  emptyText: "沒有符合的成員",
@@ -1222,147 +1212,147 @@ var Qt = {
1222
1212
  name: "transfer-member-search",
1223
1213
  spellCheck: !1
1224
1214
  },
1225
- loading: De,
1215
+ loading: Oe,
1226
1216
  loadingText: "搜尋成員中...",
1227
1217
  mode: "single",
1228
- onChange: (e) => D(pt(e)),
1229
- onSearch: Y,
1230
- onSearchTextChange: (e) => D(mt(e, ke)),
1218
+ onChange: (e) => De(gt(e)),
1219
+ onSearch: vt,
1220
+ onSearchTextChange: (e) => De(_t(e, Ae)),
1231
1221
  onVisibilityChange: (e) => {
1232
- e && Y("");
1222
+ e && vt("");
1233
1223
  },
1234
- options: [...ke],
1224
+ options: [...Ae],
1235
1225
  placeholder: "搜尋姓名或信箱",
1236
1226
  searchDebounceTime: 300,
1237
1227
  value: Ee
1238
1228
  })
1239
- }), /* @__PURE__ */ w(n, {
1229
+ }), /* @__PURE__ */ T(n, {
1240
1230
  label: "轉派說明",
1241
1231
  name: "transferComment",
1242
- children: /* @__PURE__ */ w(ie, {
1232
+ children: /* @__PURE__ */ T(ae, {
1243
1233
  onChange: (e) => Te(e.target.value),
1244
1234
  placeholder: "可補充轉派原因",
1245
- ref: Zt,
1235
+ ref: Qt,
1246
1236
  resize: "vertical",
1247
1237
  rows: 4,
1248
- style: qt,
1249
- value: we
1238
+ style: Jt,
1239
+ value: Ce
1250
1240
  })
1251
1241
  })]
1252
1242
  })
1253
1243
  }),
1254
- /* @__PURE__ */ w(_, {
1244
+ /* @__PURE__ */ T(y, {
1255
1245
  cancelText: "取消",
1256
- confirmButtonProps: { disabled: !et || R && !Je },
1246
+ confirmButtonProps: { disabled: !tt || L && !Ye },
1257
1247
  confirmText: "送出退回",
1258
1248
  loading: u,
1259
1249
  modalType: "standard",
1260
- onCancel: J,
1261
- onClose: J,
1262
- onConfirm: () => void vt(),
1250
+ onCancel: H,
1251
+ onClose: H,
1252
+ onConfirm: () => void yt(),
1263
1253
  open: _e,
1264
1254
  showModalFooter: !0,
1265
1255
  showModalHeader: !0,
1266
1256
  size: "regular",
1267
1257
  supportingText: "退回後,流程會回到指定節點並等待重新處理。",
1268
1258
  title: "退回簽核",
1269
- children: /* @__PURE__ */ T("div", {
1270
- style: Jt,
1271
- children: [/* @__PURE__ */ w(n, {
1259
+ children: /* @__PURE__ */ E("div", {
1260
+ style: Yt,
1261
+ children: [/* @__PURE__ */ T(n, {
1272
1262
  label: "退回節點",
1273
1263
  name: "returnTargetNodeId",
1274
1264
  required: !0,
1275
- children: /* @__PURE__ */ w(b, {
1265
+ children: /* @__PURE__ */ T(x, {
1276
1266
  clearable: !1,
1277
1267
  fullWidth: !0,
1278
1268
  onChange: (e) => Se(e?.id ?? null),
1279
- options: [...I],
1269
+ options: [...F],
1280
1270
  placeholder: "選擇退回節點",
1281
- value: et
1271
+ value: tt
1282
1272
  })
1283
- }), /* @__PURE__ */ w(n, {
1284
- hintText: R ? "此關卡設定退回時必須填寫意見。" : void 0,
1273
+ }), /* @__PURE__ */ T(n, {
1274
+ hintText: L ? "此關卡設定退回時必須填寫意見。" : void 0,
1285
1275
  label: "退回說明",
1286
1276
  name: "returnComment",
1287
- required: R,
1288
- children: /* @__PURE__ */ w(ie, {
1277
+ required: L,
1278
+ children: /* @__PURE__ */ T(ae, {
1289
1279
  onChange: (e) => ge(e.target.value),
1290
- placeholder: R ? "請說明退回原因" : "可補充需要修改的內容",
1291
- ref: Zt,
1280
+ placeholder: L ? "請說明退回原因" : "可補充需要修改的內容",
1281
+ ref: Qt,
1292
1282
  resize: "vertical",
1293
1283
  rows: 4,
1294
- style: qt,
1284
+ style: Jt,
1295
1285
  value: he
1296
1286
  })
1297
1287
  })]
1298
1288
  })
1299
1289
  }),
1300
- /* @__PURE__ */ w(_, {
1290
+ /* @__PURE__ */ T(y, {
1301
1291
  cancelText: "取消",
1302
1292
  confirmButtonProps: { disabled: wt },
1303
1293
  confirmText: "送出",
1304
- loading: We,
1294
+ loading: A,
1305
1295
  modalType: "standard",
1306
- onCancel: Z,
1307
- onClose: Z,
1296
+ onCancel: X,
1297
+ onClose: X,
1308
1298
  onConfirm: () => void St(),
1309
1299
  open: Be,
1310
1300
  showModalFooter: !0,
1311
1301
  showModalHeader: !0,
1312
1302
  size: "regular",
1313
- supportingText: $t[k],
1314
- title: Qt[k],
1315
- children: /* @__PURE__ */ T("div", {
1316
- style: Jt,
1303
+ supportingText: en[k],
1304
+ title: $t[k],
1305
+ children: /* @__PURE__ */ E("div", {
1306
+ style: Yt,
1317
1307
  children: [
1318
- Q ? /* @__PURE__ */ w(n, {
1308
+ Q ? /* @__PURE__ */ T(n, {
1319
1309
  label: "通知時機",
1320
1310
  name: "adhocNotifyMode",
1321
1311
  required: !0,
1322
- children: /* @__PURE__ */ w(b, {
1312
+ children: /* @__PURE__ */ T(x, {
1323
1313
  clearable: !1,
1324
1314
  fullWidth: !0,
1325
1315
  onChange: (e) => He(e?.id === "COMPLETION_NOTIFY" ? "COMPLETION_NOTIFY" : "STAGE_NOTIFY"),
1326
1316
  options: [{
1327
1317
  id: "STAGE_NOTIFY",
1328
- name: Qt.STAGE_NOTIFY
1318
+ name: $t.STAGE_NOTIFY
1329
1319
  }, {
1330
1320
  id: "COMPLETION_NOTIFY",
1331
- name: Qt.COMPLETION_NOTIFY
1321
+ name: $t.COMPLETION_NOTIFY
1332
1322
  }],
1333
1323
  value: {
1334
1324
  id: k,
1335
- name: Qt[k]
1325
+ name: $t[k]
1336
1326
  }
1337
1327
  })
1338
1328
  }) : null,
1339
- Q ? /* @__PURE__ */ w(n, {
1329
+ Q ? /* @__PURE__ */ T(n, {
1340
1330
  label: "通知對象類型",
1341
1331
  name: "adhocTargetKind",
1342
1332
  required: !0,
1343
- children: /* @__PURE__ */ w(b, {
1333
+ children: /* @__PURE__ */ T(x, {
1344
1334
  clearable: !1,
1345
1335
  fullWidth: !0,
1346
- onChange: (e) => Ke(e?.id === "WEBHOOK" ? "WEBHOOK" : "MEMBER"),
1347
- options: [...tn],
1336
+ onChange: (e) => qe(e?.id === "WEBHOOK" ? "WEBHOOK" : "MEMBER"),
1337
+ options: [...nn],
1348
1338
  value: Et
1349
1339
  })
1350
1340
  }) : null,
1351
- Q && Ge === "WEBHOOK" ? /* @__PURE__ */ w(n, {
1341
+ Q && Ke === "WEBHOOK" ? /* @__PURE__ */ T(n, {
1352
1342
  label: "Webhook URL",
1353
1343
  name: "adhocWebhookUrl",
1354
1344
  required: !0,
1355
- children: /* @__PURE__ */ w(te, {
1345
+ children: /* @__PURE__ */ T(v, {
1356
1346
  fullWidth: !0,
1357
- onChange: (e) => N(e.target.value),
1347
+ onChange: (e) => j(e.target.value),
1358
1348
  placeholder: "https://example.com/webhook",
1359
- value: M
1349
+ value: Je
1360
1350
  })
1361
- }) : /* @__PURE__ */ w(n, {
1351
+ }) : /* @__PURE__ */ T(n, {
1362
1352
  label: Q ? "通知對象" : "簽核對象",
1363
1353
  name: "adhocMemberId",
1364
1354
  required: !0,
1365
- children: /* @__PURE__ */ w(ee, {
1355
+ children: /* @__PURE__ */ T(ee, {
1366
1356
  asyncData: !0,
1367
1357
  disabledOptionsFilter: !0,
1368
1358
  emptyText: "沒有符合的成員",
@@ -1376,41 +1366,41 @@ var Qt = {
1376
1366
  loadingText: "搜尋成員中...",
1377
1367
  menuMaxHeight: 320,
1378
1368
  mode: "multiple",
1379
- onChange: (e) => Fe(e.map(pt).filter(ft)),
1380
- onSearch: xt,
1369
+ onChange: (e) => Fe(e.map(gt).filter(ht)),
1370
+ onSearch: Z,
1381
1371
  onVisibilityChange: (e) => {
1382
- e && xt("");
1372
+ e && Z("");
1383
1373
  },
1384
1374
  options: [...Re],
1385
1375
  overflowStrategy: "wrap",
1386
1376
  placeholder: "搜尋姓名或信箱,可加入多位",
1387
1377
  searchDebounceTime: 300,
1388
- value: [...Pe]
1378
+ value: [...O]
1389
1379
  })
1390
1380
  }),
1391
- k === "PRE_APPROVAL" ? /* @__PURE__ */ w(n, {
1381
+ k === "PRE_APPROVAL" ? /* @__PURE__ */ T(n, {
1392
1382
  label: "拒簽處理方式",
1393
1383
  name: "adhocOnReject",
1394
1384
  required: !0,
1395
- children: /* @__PURE__ */ w(b, {
1385
+ children: /* @__PURE__ */ T(x, {
1396
1386
  clearable: !1,
1397
1387
  fullWidth: !0,
1398
- onChange: (e) => A(e?.id === "RETURN_TO_ORIGIN" ? "RETURN_TO_ORIGIN" : "REJECT_INSTANCE"),
1399
- options: [...en],
1388
+ onChange: (e) => We(e?.id === "RETURN_TO_ORIGIN" ? "RETURN_TO_ORIGIN" : "REJECT_INSTANCE"),
1389
+ options: [...tn],
1400
1390
  value: Tt
1401
1391
  })
1402
1392
  }) : null,
1403
- Q ? null : /* @__PURE__ */ w(n, {
1393
+ Q ? null : /* @__PURE__ */ T(n, {
1404
1394
  label: "說明",
1405
1395
  name: "adhocComment",
1406
- children: /* @__PURE__ */ w(ie, {
1407
- onChange: (e) => Ne(e.target.value),
1396
+ children: /* @__PURE__ */ T(ae, {
1397
+ onChange: (e) => Pe(e.target.value),
1408
1398
  placeholder: "可補充原因",
1409
- ref: Zt,
1399
+ ref: Qt,
1410
1400
  resize: "vertical",
1411
1401
  rows: 3,
1412
- style: qt,
1413
- value: Me
1402
+ style: Jt,
1403
+ value: Ne
1414
1404
  })
1415
1405
  })
1416
1406
  ]
@@ -1418,10 +1408,10 @@ var Qt = {
1418
1408
  })
1419
1409
  ] });
1420
1410
  });
1421
- function rn(e, t) {
1411
+ function an(e, t) {
1422
1412
  try {
1423
1413
  let n = JSON.parse(e.targetValueJson);
1424
- if (n.memberIds?.length) return n.memberIds.map((e) => K(e, t)).join("、");
1414
+ if (n.memberIds?.length) return n.memberIds.map((e) => U(e, t)).join("、");
1425
1415
  if (n.webhookUrl) return n.webhookUrl;
1426
1416
  if (n.positionId) return `職位 ${n.positionId}`;
1427
1417
  if (n.orgUnitId) return `部門 ${n.orgUnitId}`;
@@ -1430,19 +1420,19 @@ function rn(e, t) {
1430
1420
  }
1431
1421
  //#endregion
1432
1422
  //#region src/views/instances/detail/sections/InstanceSignaturesSection.tsx
1433
- var an = {
1423
+ var on = {
1434
1424
  display: "grid",
1435
1425
  gap: 16
1436
1426
  };
1437
- function on({ signatureVerification: e, signatures: n }) {
1438
- let r = f(() => n.map((e) => ({
1427
+ function sn({ signatureVerification: e, signatures: n }) {
1428
+ let r = p(() => n.map((e) => ({
1439
1429
  algorithm: e.algorithm,
1440
- hashLabel: it(e.signedPayloadHash),
1430
+ hashLabel: ct(e.signedPayloadHash),
1441
1431
  key: e.id,
1442
1432
  keyVersion: e.keyVersion,
1443
1433
  signedAtLabel: t(e.signedAt),
1444
1434
  signerMemberId: e.signerMemberId
1445
- })), [n]), i = f(() => [
1435
+ })), [n]), i = p(() => [
1446
1436
  {
1447
1437
  dataIndex: "signerMemberId",
1448
1438
  key: "signerMemberId",
@@ -1474,20 +1464,20 @@ function on({ signatureVerification: e, signatures: n }) {
1474
1464
  width: 220
1475
1465
  }
1476
1466
  ], []);
1477
- return /* @__PURE__ */ T("div", {
1478
- style: an,
1467
+ return /* @__PURE__ */ E("div", {
1468
+ style: on,
1479
1469
  children: [
1480
- /* @__PURE__ */ w(S, {
1470
+ /* @__PURE__ */ T(C, {
1481
1471
  component: "h2",
1482
1472
  variant: "h3",
1483
1473
  children: "簽章"
1484
1474
  }),
1485
- /* @__PURE__ */ w(S, {
1475
+ /* @__PURE__ */ T(C, {
1486
1476
  color: e?.valid ? "text-success" : "text-error",
1487
1477
  variant: "body",
1488
1478
  children: e ? e.valid ? `簽章鏈已驗證,共 ${e.checkedCount} 筆。` : `簽章鏈驗證失敗:${e.errors.join("、")}` : "尚無簽章紀錄。"
1489
1479
  }),
1490
- r.length > 0 ? /* @__PURE__ */ w(re, {
1480
+ r.length > 0 ? /* @__PURE__ */ T(ie, {
1491
1481
  columns: i,
1492
1482
  dataSource: r,
1493
1483
  fullWidth: !0
@@ -1497,55 +1487,55 @@ function on({ signatureVerification: e, signatures: n }) {
1497
1487
  }
1498
1488
  //#endregion
1499
1489
  //#region src/views/instances/detail/sections/InstanceHistorySection.tsx
1500
- var sn = {
1490
+ var cn = {
1501
1491
  display: "grid",
1502
1492
  gap: 16
1503
- }, cn = {
1493
+ }, ln = {
1504
1494
  cursor: "help",
1505
1495
  textDecoration: "underline dotted",
1506
1496
  textUnderlineOffset: 3
1507
- }, ln = {
1497
+ }, un = {
1508
1498
  borderLeftColor: "var(--mzn-color-border)",
1509
1499
  borderLeftStyle: "solid",
1510
1500
  borderLeftWidth: 2,
1511
1501
  marginTop: 4,
1512
1502
  paddingLeft: 8,
1513
1503
  whiteSpace: "pre-wrap"
1514
- }, un = { color: "var(--mzn-color-text-secondary)" }, dn = {
1515
- ...ln,
1504
+ }, dn = { color: "var(--mzn-color-text-secondary)" }, fn = {
1505
+ ...un,
1516
1506
  borderLeftColor: "var(--mzn-color-text-error)",
1517
1507
  color: "var(--mzn-color-text-error)"
1518
1508
  };
1519
- function fn(...e) {
1520
- return e.filter((e) => V(e ?? null)).join(" ");
1509
+ function pn(...e) {
1510
+ return e.filter((e) => z(e ?? null)).join(" ");
1521
1511
  }
1522
- var pn = c(function({ className: e, descriptionParts: t, error: n, forcePending: r = !1, index: i = 0, orientation: a, status: o = "pending", title: c, type: l = "number", ...u }, d) {
1512
+ var mn = l(function({ className: e, descriptionParts: t, error: n, forcePending: r = !1, index: i = 0, orientation: a, status: o = "pending", title: s, type: l = "number", ...u }, d) {
1523
1513
  let f = r ? "pending" : o, p = t.filter((e) => e.type !== "comment"), m = t.filter((e) => e.type === "comment");
1524
- return /* @__PURE__ */ T("div", {
1514
+ return /* @__PURE__ */ E("div", {
1525
1515
  ...u,
1526
- className: fn(M.host, l === "dot" ? M.dot : null, n && f !== "processing" ? M.error : null, a === "horizontal" ? M.horizontal : null, l === "number" ? M.number : null, f === "pending" ? M.pending : null, f === "processing" ? M.processing : null, n && f === "processing" ? M.processingError : null, !n && f === "succeeded" ? M.succeeded : null, a === "vertical" ? M.vertical : null, e),
1516
+ className: pn(j.host, l === "dot" ? j.dot : null, n && f !== "processing" ? j.error : null, a === "horizontal" ? j.horizontal : null, l === "number" ? j.number : null, f === "pending" ? j.pending : null, f === "processing" ? j.processing : null, n && f === "processing" ? j.processingError : null, !n && f === "succeeded" ? j.succeeded : null, a === "vertical" ? j.vertical : null, e),
1527
1517
  ref: d,
1528
- children: [l === "dot" ? /* @__PURE__ */ w("span", { className: fn(M.statusIndicator, M.statusIndicatorDot) }) : /* @__PURE__ */ w("span", {
1529
- className: M.statusIndicator,
1518
+ children: [l === "dot" ? /* @__PURE__ */ T("span", { className: pn(j.statusIndicator, j.statusIndicatorDot) }) : /* @__PURE__ */ T("span", {
1519
+ className: j.statusIndicator,
1530
1520
  children: i + 1
1531
- }), /* @__PURE__ */ T("div", {
1532
- className: M.textContainer,
1521
+ }), /* @__PURE__ */ E("div", {
1522
+ className: j.textContainer,
1533
1523
  children: [
1534
- /* @__PURE__ */ T(S, {
1535
- className: M.title,
1524
+ /* @__PURE__ */ E(C, {
1525
+ className: j.title,
1536
1526
  variant: "label-primary-highlight",
1537
- children: [c, /* @__PURE__ */ w("span", { className: M.titleConnectLine })]
1527
+ children: [s, /* @__PURE__ */ T("span", { className: j.titleConnectLine })]
1538
1528
  }),
1539
- p.length > 0 ? /* @__PURE__ */ w(S, {
1540
- className: M.description,
1529
+ p.length > 0 ? /* @__PURE__ */ T(C, {
1530
+ className: j.description,
1541
1531
  variant: "caption",
1542
- children: p.map((e, t) => /* @__PURE__ */ T(s, { children: [t > 0 ? " · " : null, mn(e)] }, `${e.type}-${t}`))
1532
+ children: p.map((e, t) => /* @__PURE__ */ E(c, { children: [t > 0 ? " · " : null, hn(e)] }, `${e.type}-${t}`))
1543
1533
  }) : null,
1544
- m.map((e, t) => /* @__PURE__ */ T(S, {
1545
- style: e.tone === "danger" ? dn : ln,
1534
+ m.map((e, t) => /* @__PURE__ */ E(C, {
1535
+ style: e.tone === "danger" ? fn : un,
1546
1536
  variant: "body",
1547
- children: [/* @__PURE__ */ T("span", {
1548
- style: e.tone === "danger" ? void 0 : un,
1537
+ children: [/* @__PURE__ */ E("span", {
1538
+ style: e.tone === "danger" ? void 0 : dn,
1549
1539
  children: [e.label, ":"]
1550
1540
  }), e.text]
1551
1541
  }, `comment-${t}`))
@@ -1553,44 +1543,44 @@ var pn = c(function({ className: e, descriptionParts: t, error: n, forcePending:
1553
1543
  })]
1554
1544
  });
1555
1545
  });
1556
- function mn(e) {
1557
- return e.type === "text" ? e.text : e.email ? /* @__PURE__ */ T(C, { children: [
1546
+ function hn(e) {
1547
+ return e.type === "text" ? e.text : e.email?.trim() ? /* @__PURE__ */ E(w, { children: [
1558
1548
  e.prefix,
1559
1549
  ":",
1560
- /* @__PURE__ */ w(ae, {
1550
+ /* @__PURE__ */ T(S, {
1561
1551
  title: e.email,
1562
- children: ({ ref: t, ...n }) => /* @__PURE__ */ w("span", {
1552
+ children: ({ ref: t, ...n }) => /* @__PURE__ */ T("span", {
1563
1553
  ...n,
1564
1554
  "data-testid": e.memberId ? `member-tooltip-${e.memberId}` : void 0,
1565
1555
  ref: t,
1566
- style: cn,
1556
+ style: ln,
1567
1557
  children: e.label
1568
1558
  })
1569
1559
  })
1570
1560
  ] }) : `${e.prefix}:${e.label}`;
1571
1561
  }
1572
- function hn({ activityLogs: e, instanceState: t, memberProfilesById: n, signatureVerification: r, signaturesById: i, taskDecisionsByTaskId: a, tasks: o, workflowSnapshot: s, workflowTokens: c }) {
1573
- let l = Ft(e, o, c, s, t, n, a, i, r), u = _t(l), d = l.map((e) => ({
1562
+ function gn({ activityLogs: e, instanceState: t, memberProfilesById: n, signatureVerification: r, signaturesById: i, taskDecisionsByTaskId: a, tasks: o, workflowSnapshot: s, workflowTokens: c }) {
1563
+ let l = It(e, o, c, s, t, n, a, i, r), u = Y(l), d = l.map((e) => ({
1574
1564
  ...e,
1575
- descriptionParts: e.descriptionParts.filter(Y)
1565
+ descriptionParts: e.descriptionParts.filter(J)
1576
1566
  }));
1577
- return /* @__PURE__ */ T("div", {
1578
- style: sn,
1579
- children: [/* @__PURE__ */ w(S, {
1567
+ return /* @__PURE__ */ E("div", {
1568
+ style: cn,
1569
+ children: [/* @__PURE__ */ T(C, {
1580
1570
  component: "h2",
1581
1571
  variant: "h3",
1582
1572
  children: "歷程"
1583
- }), d.length > 0 ? /* @__PURE__ */ w(x, {
1573
+ }), d.length > 0 ? /* @__PURE__ */ T(re, {
1584
1574
  currentStep: u,
1585
1575
  orientation: "vertical",
1586
1576
  type: "dot",
1587
- children: d.map((e) => /* @__PURE__ */ w(pn, {
1577
+ children: d.map((e) => /* @__PURE__ */ T(mn, {
1588
1578
  descriptionParts: e.descriptionParts,
1589
1579
  error: e.error,
1590
1580
  forcePending: e.forcePending,
1591
1581
  title: e.title
1592
1582
  }, e.id))
1593
- }) : /* @__PURE__ */ w(S, {
1583
+ }) : /* @__PURE__ */ T(C, {
1594
1584
  color: "text-neutral",
1595
1585
  variant: "body",
1596
1586
  children: "尚無歷程紀錄。"
@@ -1599,30 +1589,30 @@ function hn({ activityLogs: e, instanceState: t, memberProfilesById: n, signatur
1599
1589
  }
1600
1590
  //#endregion
1601
1591
  //#region src/views/instances/detail/sections/InstanceWebhookDeliveriesSection.tsx
1602
- var gn = {
1592
+ var _n = {
1603
1593
  display: "grid",
1604
1594
  gap: 16
1605
- }, _n = {
1595
+ }, vn = {
1606
1596
  display: "grid",
1607
1597
  gap: 2
1608
- }, vn = {
1598
+ }, yn = {
1609
1599
  overflowWrap: "anywhere",
1610
1600
  whiteSpace: "pre-wrap"
1611
1601
  };
1612
- function yn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1613
- let [r, i] = m(null), [a, o] = m(!1), [s, c] = m(null), l = f(() => e.map((e) => ({
1602
+ function bn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1603
+ let [r, i] = h(null), [a, o] = h(!1), [s, c] = h(null), l = p(() => e.map((e) => ({
1614
1604
  delivery: e,
1615
1605
  key: e.id
1616
- })), [e]), u = f(() => [
1606
+ })), [e]), u = p(() => [
1617
1607
  {
1618
1608
  key: "endpoint",
1619
- render: ({ delivery: e }) => /* @__PURE__ */ T("div", {
1620
- style: _n,
1621
- children: [/* @__PURE__ */ w(S, {
1609
+ render: ({ delivery: e }) => /* @__PURE__ */ E("div", {
1610
+ style: vn,
1611
+ children: [/* @__PURE__ */ T(C, {
1622
1612
  component: "span",
1623
1613
  variant: "body",
1624
1614
  children: e.endpointLabel ?? e.endpointKey
1625
- }), /* @__PURE__ */ T(S, {
1615
+ }), /* @__PURE__ */ E(C, {
1626
1616
  color: "text-neutral",
1627
1617
  component: "span",
1628
1618
  variant: "caption",
@@ -1641,13 +1631,13 @@ function yn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1641
1631
  },
1642
1632
  {
1643
1633
  key: "status",
1644
- render: ({ delivery: e }) => /* @__PURE__ */ w(bn, { status: e.status }),
1634
+ render: ({ delivery: e }) => /* @__PURE__ */ T(xn, { status: e.status }),
1645
1635
  title: "狀態",
1646
1636
  width: 120
1647
1637
  },
1648
1638
  {
1649
1639
  key: "attemptCount",
1650
- render: ({ delivery: e }) => /* @__PURE__ */ w(S, {
1640
+ render: ({ delivery: e }) => /* @__PURE__ */ T(C, {
1651
1641
  component: "span",
1652
1642
  variant: "body",
1653
1643
  children: e.attemptCount
@@ -1657,21 +1647,21 @@ function yn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1657
1647
  },
1658
1648
  {
1659
1649
  key: "lastError",
1660
- render: ({ delivery: e }) => e.lastErrorCode && e.status !== "SENT" ? /* @__PURE__ */ T("div", {
1661
- style: _n,
1662
- children: [/* @__PURE__ */ w(S, {
1650
+ render: ({ delivery: e }) => e.lastErrorCode && e.status !== "SENT" ? /* @__PURE__ */ E("div", {
1651
+ style: vn,
1652
+ children: [/* @__PURE__ */ T(C, {
1663
1653
  color: "text-error",
1664
1654
  component: "span",
1665
1655
  variant: "body",
1666
1656
  children: e.lastErrorCode
1667
- }), e.lastErrorDetail ? /* @__PURE__ */ w(S, {
1657
+ }), e.lastErrorDetail ? /* @__PURE__ */ T(C, {
1668
1658
  color: "text-neutral",
1669
1659
  component: "span",
1670
- style: vn,
1660
+ style: yn,
1671
1661
  variant: "caption",
1672
1662
  children: e.lastErrorDetail
1673
1663
  }) : null]
1674
- }) : /* @__PURE__ */ w(S, {
1664
+ }) : /* @__PURE__ */ T(C, {
1675
1665
  color: "text-neutral",
1676
1666
  component: "span",
1677
1667
  variant: "body",
@@ -1682,18 +1672,18 @@ function yn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1682
1672
  },
1683
1673
  {
1684
1674
  key: "time",
1685
- render: ({ delivery: e }) => /* @__PURE__ */ w(S, {
1675
+ render: ({ delivery: e }) => /* @__PURE__ */ T(C, {
1686
1676
  component: "span",
1687
1677
  variant: "body",
1688
- children: xn(e)
1678
+ children: Sn(e)
1689
1679
  }),
1690
1680
  title: "時間",
1691
1681
  width: 220
1692
1682
  }
1693
- ], [n]), d = f(() => ({
1683
+ ], [n]), d = p(() => ({
1694
1684
  render: ({ delivery: e }) => e.status === "FAILED" && e.attemptCount > 0 ? [{
1695
1685
  disabled: () => a,
1696
- icon: Ne,
1686
+ icon: O,
1697
1687
  iconType: "leading",
1698
1688
  name: "重新傳送",
1699
1689
  onClick: () => {
@@ -1703,7 +1693,7 @@ function yn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1703
1693
  variant: "base-secondary",
1704
1694
  width: 140
1705
1695
  }), [a]);
1706
- async function p() {
1696
+ async function f() {
1707
1697
  if (r) {
1708
1698
  o(!0), c(null);
1709
1699
  try {
@@ -1715,30 +1705,30 @@ function yn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1715
1705
  }
1716
1706
  }
1717
1707
  }
1718
- return /* @__PURE__ */ T("div", {
1719
- style: gn,
1708
+ return /* @__PURE__ */ E("div", {
1709
+ style: _n,
1720
1710
  children: [
1721
- /* @__PURE__ */ w(S, {
1711
+ /* @__PURE__ */ T(C, {
1722
1712
  component: "h2",
1723
1713
  variant: "h3",
1724
1714
  children: "外部系統通知"
1725
1715
  }),
1726
- s ? /* @__PURE__ */ w(S, {
1716
+ s ? /* @__PURE__ */ T(C, {
1727
1717
  color: "text-error",
1728
1718
  variant: "body",
1729
1719
  children: s
1730
1720
  }) : null,
1731
- l.length > 0 ? /* @__PURE__ */ w(re, {
1721
+ l.length > 0 ? /* @__PURE__ */ T(ie, {
1732
1722
  actions: d,
1733
1723
  columns: u,
1734
1724
  dataSource: l,
1735
1725
  fullWidth: !0
1736
- }) : /* @__PURE__ */ w(S, {
1726
+ }) : /* @__PURE__ */ T(C, {
1737
1727
  color: "text-neutral",
1738
1728
  variant: "body",
1739
1729
  children: "此案件沒有外部系統通知。"
1740
1730
  }),
1741
- /* @__PURE__ */ w(_, {
1731
+ /* @__PURE__ */ T(y, {
1742
1732
  cancelText: "取消",
1743
1733
  confirmText: "重新傳送",
1744
1734
  loading: a,
@@ -1746,13 +1736,13 @@ function yn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1746
1736
  modalType: "standard",
1747
1737
  onCancel: () => i(null),
1748
1738
  onClose: () => i(null),
1749
- onConfirm: () => void p(),
1739
+ onConfirm: () => void f(),
1750
1740
  open: !!r,
1751
1741
  showModalFooter: !0,
1752
1742
  showModalHeader: !0,
1753
1743
  supportingText: "會以相同的投遞編號重新送出,接收端可據此避免重複處理。",
1754
1744
  title: "重新傳送通知",
1755
- children: /* @__PURE__ */ T(S, {
1745
+ children: /* @__PURE__ */ E(C, {
1756
1746
  variant: "body",
1757
1747
  children: [
1758
1748
  "確定要重新通知「",
@@ -1764,30 +1754,30 @@ function yn({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1764
1754
  ]
1765
1755
  });
1766
1756
  }
1767
- function bn({ status: e }) {
1768
- return e === "SENT" ? /* @__PURE__ */ w(h, {
1757
+ function xn({ status: e }) {
1758
+ return e === "SENT" ? /* @__PURE__ */ T(g, {
1769
1759
  size: "sub",
1770
1760
  text: "已送達",
1771
1761
  variant: "dot-success"
1772
- }) : e === "FAILED" ? /* @__PURE__ */ w(h, {
1762
+ }) : e === "FAILED" ? /* @__PURE__ */ T(g, {
1773
1763
  size: "sub",
1774
1764
  text: "失敗",
1775
1765
  variant: "dot-error"
1776
- }) : /* @__PURE__ */ w(h, {
1766
+ }) : /* @__PURE__ */ T(g, {
1777
1767
  size: "sub",
1778
1768
  text: e === "PENDING" ? "等待傳送" : "傳送中",
1779
1769
  variant: "dot-info"
1780
1770
  });
1781
1771
  }
1782
- function xn(e) {
1772
+ function Sn(e) {
1783
1773
  return e.sentAt ? `送達:${t(e.sentAt)}` : e.status === "PENDING" && e.nextRetryAt ? `下次重試:${t(e.nextRetryAt)}` : e.lastAttemptAt ? `最後嘗試:${t(e.lastAttemptAt)}` : `建立:${t(e.createdAt)}`;
1784
1774
  }
1785
1775
  //#endregion
1786
1776
  //#region src/views/instances/detail/InstanceDetailView.tsx
1787
- var Sn = 3e3, Cn = 40, wn = 184, Tn = 96, En = {
1777
+ var Cn = 3e3, wn = 40, Tn = 184, En = 96, Dn = {
1788
1778
  display: "grid",
1789
1779
  gap: 16
1790
- }, Dn = {
1780
+ }, On = {
1791
1781
  background: "#f8fafc",
1792
1782
  border: "1px solid #e2e8f0",
1793
1783
  borderRadius: 8,
@@ -1795,7 +1785,7 @@ var Sn = 3e3, Cn = 40, wn = 184, Tn = 96, En = {
1795
1785
  minHeight: 440,
1796
1786
  overflow: "hidden",
1797
1787
  width: "min(80vw, 1040px)"
1798
- }, On = {
1788
+ }, kn = {
1799
1789
  background: "#ffffff",
1800
1790
  border: "1px solid #cbd5e1",
1801
1791
  borderRadius: 8,
@@ -1805,24 +1795,24 @@ var Sn = 3e3, Cn = 40, wn = 184, Tn = 96, En = {
1805
1795
  minHeight: 82,
1806
1796
  padding: 12,
1807
1797
  width: 184
1808
- }, kn = {
1798
+ }, An = {
1809
1799
  borderRadius: 999,
1810
1800
  fontSize: 12,
1811
1801
  fontWeight: 600,
1812
1802
  justifySelf: "start",
1813
1803
  lineHeight: "18px",
1814
1804
  padding: "0 8px"
1815
- }, An = {
1805
+ }, jn = {
1816
1806
  color: "#64748b",
1817
1807
  fontSize: 12,
1818
1808
  overflow: "hidden",
1819
1809
  textOverflow: "ellipsis",
1820
1810
  whiteSpace: "nowrap"
1821
- }, jn = { opacity: 0 }, Mn = {
1811
+ }, Mn = { opacity: 0 }, Nn = {
1822
1812
  display: "flex",
1823
1813
  flexWrap: "wrap",
1824
1814
  gap: 8
1825
- }, Nn = {
1815
+ }, Pn = {
1826
1816
  alignItems: "center",
1827
1817
  background: "#ffffff",
1828
1818
  border: "1px solid #cbd5e1",
@@ -1834,29 +1824,29 @@ var Sn = 3e3, Cn = 40, wn = 184, Tn = 96, En = {
1834
1824
  gap: 6,
1835
1825
  lineHeight: "20px",
1836
1826
  padding: "4px 8px"
1837
- }, Pn = {
1827
+ }, Fn = {
1838
1828
  display: "grid",
1839
1829
  gap: 16
1840
- }, Fn = { workflowRuntime: Gn };
1841
- function In({ instanceId: i, showAttachments: o = !0, showForm: s = !0, showHistory: c = !0, showSignatures: d = !0, showTasks: ee = !0, showWebhookDeliveries: h = !0 }) {
1842
- let { member: te } = e(), b = te?.memberId ?? null, x = h && r(te), [re, ae] = m([]), [E, se] = m(null), [ce, le] = m([]), [fe, ve] = m([]), [ye, be] = m([]), [Ce, D] = m([]), [De, ke] = m(null), [O, Ne] = m([]), [Ie, Le] = m([]), [Be, Ue] = m([]), [A, j] = m(null), [Ge, Ke] = m(!0), [M, N] = m(!1), [qe, Je] = m(!1), [Ye, P] = m(""), [F, I] = m(!1), [Xe, L] = m({}), [R, $e] = m({}), [et, z] = m({}), [B, tt] = m(null), [H, nt] = m(null), [rt, it] = m([]), ot = Ye.trim(), W = p(null), G = p(0), K = Ce.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS");
1843
- u(() => {
1844
- Z();
1845
- }, [b, i]), u(() => {
1846
- if (!x || !K || G.current >= Cn) return;
1830
+ }, In = { workflowRuntime: Kn };
1831
+ function Ln({ instanceId: i, showAttachments: a = !0, showForm: s = !0, showHistory: c = !0, showSignatures: l = !0, showTasks: f = !0, showWebhookDeliveries: ee = !0 }) {
1832
+ let { member: g } = e(), v = g?.memberId ?? null, x = ee && r(g), [re, ie] = h([]), [S, oe] = h(null), [ce, le] = h([]), [ue, pe] = h([]), [ye, be] = h([]), [xe, we] = h([]), [Oe, ke] = h(null), [D, je] = h([]), [O, Le] = h([]), [Re, Ve] = h([]), [We, A] = h(null), [Ke, qe] = h(!0), [Je, j] = h(!1), [M, Ye] = h(!1), [Xe, N] = h(""), [P, F] = h(!1), [Ze, I] = h({}), [L, $e] = h({}), [tt, nt] = h({}), [R, rt] = h(null), [it, at] = h(null), [ot, st] = h([]), ct = Xe.trim(), V = m(null), ut = m(0), H = xe.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS");
1833
+ d(() => {
1834
+ X();
1835
+ }, [v, i]), d(() => {
1836
+ if (!x || !H || ut.current >= wn) return;
1847
1837
  let e = setTimeout(() => {
1848
- G.current += 1, Ct();
1849
- }, Sn);
1838
+ ut.current += 1, Ct();
1839
+ }, Cn);
1850
1840
  return () => clearTimeout(e);
1851
1841
  }, [
1852
1842
  x,
1853
- K,
1854
- Ce
1855
- ]), u(() => {
1856
- $e(E?.formData ?? {}), z({});
1857
- }, [E]);
1858
- let ct = l((e, t) => {
1859
- z((n) => {
1843
+ H,
1844
+ xe
1845
+ ]), d(() => {
1846
+ $e(S?.formData ?? {}), nt({});
1847
+ }, [S]);
1848
+ let U = u((e, t) => {
1849
+ nt((n) => {
1860
1850
  let r = n[e];
1861
1851
  return r?.hasValue === t.hasValue && r.status === t.status ? n : {
1862
1852
  ...n,
@@ -1866,218 +1856,214 @@ function In({ instanceId: i, showAttachments: o = !0, showForm: s = !0, showHist
1866
1856
  }
1867
1857
  };
1868
1858
  });
1869
- }, []), ut = f(() => O.find((e) => lt(e, b) && (e.status === "PENDING" || e.status === "IN_PROGRESS")) ?? null, [b, O]), q = f(() => ut && E ? E.workflowSnapshot.nodes.find((e) => e.id === ut.nodeId) ?? null : null, [ut, E]), dt = q?.type === "userTask" && q.data.returnBehavior.allowReturn, ft = q?.type === "userTask" && q.data.allowReject !== !1, pt = q?.type === "userTask" && q.data.allowTransfer !== !1, mt = q?.type === "userTask" && q.data.allowAddSigner, J = !(!E || E.initiatorMemberId !== b || E.state !== "RUNNING" && E.state !== "RETURNED"), ht = !!(E && E.initiatorMemberId === b && E.state === "RETURNED"), gt = f(() => new Map(Be.map((e) => [e.memberId, e])), [Be]), Y = f(() => Bt(ce), [ce]), _t = f(() => new Map(ye.map((e) => [e.id, e])), [ye]), X = f(() => E ? Vn(E.workflowSnapshot) : null, [E]), vt = f(() => E && X ? Bn(X, O, Ie, E.state) : [], [
1870
- E,
1871
- X,
1872
- O,
1873
- Ie
1874
- ]), yt = f(() => X ? Hn(X) : [], [X]), bt = f(() => E ? Rn(E.workflowSnapshot) : [], [E]);
1875
- async function Z() {
1876
- Ke(!0), j(null);
1859
+ }, []), W = p(() => D.find((e) => ft(e, v) && (e.status === "PENDING" || e.status === "IN_PROGRESS")) ?? null, [v, D]), G = p(() => W && S ? S.workflowSnapshot.nodes.find((e) => e.id === W.nodeId) ?? null : null, [W, S]), pt = G?.type === "userTask" && G.data.returnBehavior.allowReturn, mt = G?.type === "userTask" && G.data.allowReject !== !1, ht = G?.type === "userTask" && G.data.allowTransfer !== !1, gt = G?.type === "userTask" && G.data.allowAddSigner, _t = !(!S || S.initiatorMemberId !== v || S.state !== "RUNNING" && S.state !== "RETURNED"), K = !!(S && S.initiatorMemberId === v && S.state === "RETURNED"), q = p(() => new Map(Re.map((e) => [e.memberId, e])), [Re]), vt = p(() => Vt(ce), [ce]), J = p(() => new Map(ye.map((e) => [e.id, e])), [ye]), Y = p(() => S ? Hn(S.workflowSnapshot) : null, [S]), yt = p(() => S && Y ? Vn(Y, D, O, S.state) : [], [
1860
+ S,
1861
+ Y,
1862
+ D,
1863
+ O
1864
+ ]), bt = p(() => Y ? Un(Y) : [], [Y]), xt = p(() => S ? zn(S.workflowSnapshot) : [], [S]);
1865
+ async function X() {
1866
+ qe(!0), A(null);
1877
1867
  try {
1878
- let e = await me(i);
1879
- ae(e.activityLogs), se(e.instance), Ne(e.tasks), Le(e.workflowTokens);
1880
- let t = await ue(e.instance.id), [n, r, a, o, s] = await Promise.all([
1881
- zt(e.tasks),
1882
- Lt({
1868
+ let e = await he(i);
1869
+ ie(e.activityLogs), oe(e.instance), je(e.tasks), Le(e.workflowTokens);
1870
+ let t = await de(e.instance.id), [n, r, a, o, s] = await Promise.all([
1871
+ Bt(e.tasks),
1872
+ Rt({
1883
1873
  ...e,
1884
1874
  adhocDirectives: t
1885
1875
  }),
1886
- de(e.instance.id),
1887
- _e(e.instance.id),
1888
- xt(e.instance.id)
1876
+ fe(e.instance.id),
1877
+ ve(e.instance.id),
1878
+ Z(e.instance.id)
1889
1879
  ]);
1890
- le(n), Ue(r), ve(a), be(o.signatures), ke(o.verification), it(t), D(s);
1880
+ le(n), Ve(r), pe(a), be(o.signatures), ke(o.verification), st(t), we(s);
1891
1881
  } catch (e) {
1892
- j(U(e));
1882
+ A(B(e));
1893
1883
  } finally {
1894
- Ke(!1);
1884
+ qe(!1);
1895
1885
  }
1896
1886
  }
1897
- async function xt(e) {
1898
- return x ? pe(e).catch(() => []) : [];
1887
+ async function Z(e) {
1888
+ return x ? me(e).catch(() => []) : [];
1899
1889
  }
1900
1890
  async function St(e) {
1901
- await Se(e.id), G.current = 0, await Z();
1891
+ await Ce(e.id), ut.current = 0, await X();
1902
1892
  }
1903
1893
  async function Ct() {
1904
- let e = await xt(i);
1905
- if (!e.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS")) {
1906
- await Z();
1907
- return;
1908
- }
1909
- D(e);
1894
+ let e = await Z(i);
1895
+ e.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS") ? we(e) : await X();
1910
1896
  }
1911
1897
  async function Q(e, t) {
1912
- if (!b) throw Error("尚未登入,無法上傳附件");
1913
- return { id: (await we({
1898
+ if (!v) throw Error("尚未登入,無法上傳附件");
1899
+ return { id: (await Te({
1914
1900
  file: t,
1915
1901
  formFieldPath: `form.${e.fieldKey}`
1916
1902
  })).id };
1917
1903
  }
1918
1904
  async function wt(e) {
1919
- if (!b) return;
1920
- let t = await he({ id: e.id });
1905
+ if (!v) return;
1906
+ let t = await ge({ id: e.id });
1921
1907
  window.open(t, "_blank", "noopener,noreferrer");
1922
1908
  }
1923
1909
  async function Tt(e) {
1924
- if (!b) return;
1925
- let t = await ge({ id: e.id });
1926
- tt(e), nt(t);
1910
+ if (!v) return;
1911
+ let t = await _e({ id: e.id });
1912
+ rt(e), at(t);
1927
1913
  }
1928
1914
  async function Et() {
1929
- if (b && E && J) {
1930
- N(!0), j(null), L({});
1915
+ if (v && S && _t) {
1916
+ j(!0), A(null), I({});
1931
1917
  try {
1932
- await oe({
1933
- cancelledByMemberId: b,
1934
- comment: ot || null,
1935
- instanceId: E.id
1936
- }), P(""), I(!1), await Z();
1918
+ await se({
1919
+ cancelledByMemberId: v,
1920
+ comment: ct || null,
1921
+ instanceId: S.id
1922
+ }), N(""), F(!1), await X();
1937
1923
  } catch (e) {
1938
- j(U(e));
1924
+ A(B(e));
1939
1925
  } finally {
1940
- N(!1);
1926
+ j(!1);
1941
1927
  }
1942
1928
  }
1943
1929
  }
1944
1930
  async function Dt() {
1945
- if (!b || !E || !ht) return;
1946
- N(!0), j(null), L({});
1947
- let e = a(Object.values(et));
1931
+ if (!v || !S || !K) return;
1932
+ j(!0), A(null), I({});
1933
+ let e = o(Object.values(tt));
1948
1934
  if (e) {
1949
- j(e), N(!1);
1935
+ A(e), j(!1);
1950
1936
  return;
1951
1937
  }
1952
- let t = E.formDefinitionSnapshot.schema ? Re(E.formDefinitionSnapshot.schema.fields, R) : R;
1953
- if (E.formDefinitionSnapshot.schema && E.formDefinitionSnapshot.uiSchema) {
1954
- let e = Ve({
1955
- schema: E.formDefinitionSnapshot.schema,
1956
- uiSchema: E.formDefinitionSnapshot.uiSchema,
1938
+ let t = S.formDefinitionSnapshot.schema ? ze(S.formDefinitionSnapshot.schema.fields, L) : L;
1939
+ if (S.formDefinitionSnapshot.schema && S.formDefinitionSnapshot.uiSchema) {
1940
+ let e = k({
1941
+ schema: S.formDefinitionSnapshot.schema,
1942
+ uiSchema: S.formDefinitionSnapshot.uiSchema,
1957
1943
  values: t
1958
1944
  });
1959
1945
  if (!e.valid) {
1960
- L(e.errors), j("請先補齊必填欄位。"), e.firstInvalidFieldKey && ze(e.firstInvalidFieldKey), N(!1);
1946
+ I(e.errors), A("請先補齊必填欄位。"), e.firstInvalidFieldKey && Be(e.firstInvalidFieldKey), j(!1);
1961
1947
  return;
1962
1948
  }
1963
1949
  }
1964
1950
  try {
1965
- await xe({
1951
+ await Se({
1966
1952
  formData: t,
1967
- initiatorMemberId: b,
1968
- instanceId: E.id,
1969
- title: E.title
1970
- }), await Z();
1953
+ initiatorMemberId: v,
1954
+ instanceId: S.id,
1955
+ title: S.title
1956
+ }), await X();
1971
1957
  } catch (e) {
1972
- j(U(e));
1958
+ A(B(e));
1973
1959
  } finally {
1974
- N(!1);
1960
+ j(!1);
1975
1961
  }
1976
1962
  }
1977
- let Ot = W.current?.deciding ?? !1, $ = M || Ot;
1978
- return /* @__PURE__ */ T(C, { children: [
1979
- /* @__PURE__ */ w(v, { children: /* @__PURE__ */ T(Te, {
1980
- description: E ? [
1981
- at(E.state),
1982
- t(E.startedAt),
1983
- Qe(E, gt)
1984
- ].filter(V).join(" · ") : "載入案件內容。",
1985
- title: E?.title ?? "簽核案件",
1963
+ let Ot = V.current?.deciding ?? !1, $ = Je || Ot;
1964
+ return /* @__PURE__ */ E(w, { children: [
1965
+ /* @__PURE__ */ T(te, { children: /* @__PURE__ */ E(Ee, {
1966
+ description: S ? [
1967
+ lt(S.state),
1968
+ t(S.startedAt),
1969
+ et(S, q)
1970
+ ].filter(z).join(" · ") : "載入案件內容。",
1971
+ title: S?.title ?? "簽核案件",
1986
1972
  children: [
1987
- E ? /* @__PURE__ */ w(g, {
1973
+ S ? /* @__PURE__ */ T(_, {
1988
1974
  "aria-label": "查看流程圖",
1989
- icon: Pe,
1975
+ icon: Fe,
1990
1976
  iconType: "icon-only",
1991
- onClick: () => Je(!0),
1977
+ onClick: () => Ye(!0),
1992
1978
  title: "查看流程圖",
1993
1979
  variant: "base-secondary",
1994
1980
  children: "流程圖"
1995
1981
  }) : null,
1996
- J ? /* @__PURE__ */ w(g, {
1982
+ _t ? /* @__PURE__ */ T(_, {
1997
1983
  disabled: $,
1998
- icon: Oe,
1984
+ icon: Ae,
1999
1985
  iconType: "leading",
2000
- onClick: () => I(!0),
1986
+ onClick: () => F(!0),
2001
1987
  variant: "destructive-secondary",
2002
1988
  children: "取消案件"
2003
1989
  }) : null,
2004
- ut ? /* @__PURE__ */ T(C, { children: [
2005
- mt ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(g, {
1990
+ W ? /* @__PURE__ */ E(w, { children: [
1991
+ gt ? /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(_, {
2006
1992
  disabled: $,
2007
- icon: je,
1993
+ icon: Ne,
2008
1994
  iconType: "leading",
2009
- onClick: () => W.current?.openAdhocModal("COUNTERSIGN"),
1995
+ onClick: () => V.current?.openAdhocModal("COUNTERSIGN"),
2010
1996
  variant: "base-secondary",
2011
1997
  children: "會簽"
2012
- }, "adhoc-countersign"), /* @__PURE__ */ w(g, {
1998
+ }, "adhoc-countersign"), /* @__PURE__ */ T(_, {
2013
1999
  disabled: $,
2014
- icon: je,
2000
+ icon: Ne,
2015
2001
  iconType: "leading",
2016
- onClick: () => W.current?.openAdhocModal("PRE_APPROVAL"),
2002
+ onClick: () => V.current?.openAdhocModal("PRE_APPROVAL"),
2017
2003
  variant: "base-secondary",
2018
2004
  children: "加簽"
2019
2005
  }, "adhoc-pre-approval")] }) : null,
2020
- /* @__PURE__ */ w(g, {
2006
+ /* @__PURE__ */ T(_, {
2021
2007
  disabled: $,
2022
- icon: Ae,
2008
+ icon: Me,
2023
2009
  iconType: "leading",
2024
- onClick: () => W.current?.openAdhocModal("STAGE_NOTIFY"),
2010
+ onClick: () => V.current?.openAdhocModal("STAGE_NOTIFY"),
2025
2011
  variant: "base-secondary",
2026
2012
  children: "通知設定"
2027
2013
  }, "adhoc-notify"),
2028
- dt ? /* @__PURE__ */ w(g, {
2014
+ pt ? /* @__PURE__ */ T(_, {
2029
2015
  disabled: $,
2030
- icon: Me,
2016
+ icon: Pe,
2031
2017
  iconType: "leading",
2032
- onClick: () => W.current?.openReturnModal(),
2018
+ onClick: () => V.current?.openReturnModal(),
2033
2019
  variant: "base-secondary",
2034
2020
  children: "退回"
2035
2021
  }, "task-return") : null,
2036
- pt ? /* @__PURE__ */ w(g, {
2022
+ ht ? /* @__PURE__ */ T(_, {
2037
2023
  disabled: $,
2038
- icon: Fe,
2024
+ icon: Ie,
2039
2025
  iconType: "leading",
2040
- onClick: () => W.current?.openTransferModal(),
2026
+ onClick: () => V.current?.openTransferModal(),
2041
2027
  variant: "base-secondary",
2042
2028
  children: "轉派"
2043
2029
  }, "task-transfer") : null,
2044
- ft ? /* @__PURE__ */ w(g, {
2030
+ mt ? /* @__PURE__ */ T(_, {
2045
2031
  disabled: $,
2046
- icon: Oe,
2032
+ icon: Ae,
2047
2033
  iconType: "leading",
2048
- onClick: () => W.current?.openRejectModal(),
2034
+ onClick: () => V.current?.openRejectModal(),
2049
2035
  variant: "destructive-secondary",
2050
2036
  children: "拒絕"
2051
2037
  }, "task-reject") : null,
2052
- /* @__PURE__ */ w(g, {
2038
+ /* @__PURE__ */ T(_, {
2053
2039
  disabled: $,
2054
- icon: Ee,
2040
+ icon: De,
2055
2041
  iconType: "leading",
2056
- onClick: () => W.current?.handleApprove(),
2042
+ onClick: () => V.current?.handleApprove(),
2057
2043
  variant: "base-primary",
2058
2044
  children: "同意"
2059
2045
  }, "task-approve")
2060
2046
  ] }) : null
2061
2047
  ]
2062
2048
  }) }),
2063
- /* @__PURE__ */ T(ne, { children: [
2064
- s ? /* @__PURE__ */ w(y, { children: /* @__PURE__ */ w(Ut, {
2065
- canResubmitInstance: ht,
2066
- deciding: M,
2067
- error: A,
2068
- instance: E,
2069
- loading: Ge,
2070
- onDataSourceStateChange: ct,
2049
+ /* @__PURE__ */ E(ne, { children: [
2050
+ s ? /* @__PURE__ */ T(b, { children: /* @__PURE__ */ T(Wt, {
2051
+ canResubmitInstance: K,
2052
+ deciding: Je,
2053
+ error: We,
2054
+ instance: S,
2055
+ loading: Ke,
2056
+ onDataSourceStateChange: U,
2071
2057
  onResubmitFormChange: (e) => {
2072
- $e(e), L({});
2058
+ $e(e), I({});
2073
2059
  },
2074
2060
  onResubmitInstance: () => void Dt(),
2075
2061
  onUploadAttachment: Q,
2076
- resubmitFormData: R,
2077
- resubmitFormErrors: Xe
2062
+ resubmitFormData: L,
2063
+ resubmitFormErrors: Ze
2078
2064
  }) }) : null,
2079
- o ? /* @__PURE__ */ w(y, { children: /* @__PURE__ */ w(Gt, {
2080
- attachments: fe,
2065
+ a ? /* @__PURE__ */ T(b, { children: /* @__PURE__ */ T(Kt, {
2066
+ attachments: ue,
2081
2067
  onDownload: (e) => {
2082
2068
  wt(e);
2083
2069
  },
@@ -2085,141 +2071,141 @@ function In({ instanceId: i, showAttachments: o = !0, showForm: s = !0, showHist
2085
2071
  Tt(e);
2086
2072
  }
2087
2073
  }) }) : null,
2088
- ee ? /* @__PURE__ */ w(y, { children: /* @__PURE__ */ w(nn, {
2089
- adhocDirectives: rt,
2090
- currentMemberId: b,
2091
- instance: E,
2092
- memberProfilesById: gt,
2093
- onChanged: Z,
2094
- ref: W,
2095
- tasks: O
2074
+ f ? /* @__PURE__ */ T(b, { children: /* @__PURE__ */ T(rn, {
2075
+ adhocDirectives: ot,
2076
+ currentMemberId: v,
2077
+ instance: S,
2078
+ memberProfilesById: q,
2079
+ onChanged: X,
2080
+ ref: V,
2081
+ tasks: D
2096
2082
  }) }) : null,
2097
- d ? /* @__PURE__ */ w(y, { children: /* @__PURE__ */ w(on, {
2098
- signatureVerification: De,
2083
+ l ? /* @__PURE__ */ T(b, { children: /* @__PURE__ */ T(sn, {
2084
+ signatureVerification: Oe,
2099
2085
  signatures: ye
2100
2086
  }) }) : null,
2101
- x && Ce.length > 0 ? /* @__PURE__ */ w(y, { children: /* @__PURE__ */ w(yn, {
2102
- deliveries: Ce,
2087
+ x && xe.length > 0 ? /* @__PURE__ */ T(b, { children: /* @__PURE__ */ T(bn, {
2088
+ deliveries: xe,
2103
2089
  onRetry: St,
2104
- readNodeLabel: (e) => st(e, E?.workflowSnapshot ?? null)
2090
+ readNodeLabel: (e) => dt(e, S?.workflowSnapshot ?? null)
2105
2091
  }) }) : null,
2106
- c ? /* @__PURE__ */ w(y, { children: /* @__PURE__ */ w(hn, {
2092
+ c ? /* @__PURE__ */ T(b, { children: /* @__PURE__ */ T(gn, {
2107
2093
  activityLogs: re,
2108
- instanceState: E?.state ?? "RUNNING",
2109
- memberProfilesById: gt,
2110
- signatureVerification: De,
2111
- signaturesById: _t,
2112
- taskDecisionsByTaskId: Y,
2113
- tasks: O,
2114
- workflowSnapshot: E?.workflowSnapshot ?? null,
2115
- workflowTokens: Ie
2094
+ instanceState: S?.state ?? "RUNNING",
2095
+ memberProfilesById: q,
2096
+ signatureVerification: Oe,
2097
+ signaturesById: J,
2098
+ taskDecisionsByTaskId: vt,
2099
+ tasks: D,
2100
+ workflowSnapshot: S?.workflowSnapshot ?? null,
2101
+ workflowTokens: O
2116
2102
  }) }) : null
2117
2103
  ] }),
2118
- E ? /* @__PURE__ */ w(_, {
2104
+ S ? /* @__PURE__ */ T(y, {
2119
2105
  modalType: "standard",
2120
- onClose: () => Je(!1),
2121
- open: qe,
2106
+ onClose: () => Ye(!1),
2107
+ open: M,
2122
2108
  showModalHeader: !0,
2123
2109
  size: "wide",
2124
- supportingText: `${at(E.state)} · ${t(E.startedAt)}`,
2110
+ supportingText: `${lt(S.state)} · ${t(S.startedAt)}`,
2125
2111
  title: "流程圖",
2126
- children: /* @__PURE__ */ T("div", {
2127
- style: En,
2128
- children: [/* @__PURE__ */ w("div", {
2129
- style: Dn,
2130
- children: /* @__PURE__ */ T(We, {
2131
- edges: yt,
2112
+ children: /* @__PURE__ */ E("div", {
2113
+ style: Dn,
2114
+ children: [/* @__PURE__ */ T("div", {
2115
+ style: On,
2116
+ children: /* @__PURE__ */ E(Ge, {
2117
+ edges: bt,
2132
2118
  fitView: !0,
2133
2119
  fitViewOptions: { padding: .18 },
2134
2120
  maxZoom: 1.2,
2135
2121
  minZoom: .2,
2136
- nodes: vt,
2122
+ nodes: yt,
2137
2123
  nodesDraggable: !1,
2138
2124
  nodesFocusable: !1,
2139
- nodeTypes: Fn,
2125
+ nodeTypes: In,
2140
2126
  panOnDrag: !0,
2141
2127
  proOptions: { hideAttribution: !0 },
2142
- children: [/* @__PURE__ */ w(k, {}), /* @__PURE__ */ w(He, { showInteractive: !1 })]
2128
+ children: [/* @__PURE__ */ T(He, {}), /* @__PURE__ */ T(Ue, { showInteractive: !1 })]
2143
2129
  })
2144
- }), bt.length > 0 ? /* @__PURE__ */ w("div", {
2145
- style: Mn,
2146
- children: bt.map((e) => /* @__PURE__ */ w("span", {
2147
- style: Nn,
2130
+ }), xt.length > 0 ? /* @__PURE__ */ T("div", {
2131
+ style: Nn,
2132
+ children: xt.map((e) => /* @__PURE__ */ T("span", {
2133
+ style: Pn,
2148
2134
  children: e
2149
2135
  }, e))
2150
2136
  }) : null]
2151
2137
  })
2152
2138
  }) : null,
2153
- /* @__PURE__ */ w(_, {
2139
+ /* @__PURE__ */ T(y, {
2154
2140
  modalType: "standard",
2155
2141
  onClose: () => {
2156
- tt(null), nt(null);
2142
+ rt(null), at(null);
2157
2143
  },
2158
- open: !!(B && H),
2144
+ open: !!(R && it),
2159
2145
  showModalHeader: !0,
2160
2146
  size: "wide",
2161
- supportingText: B?.filename ?? void 0,
2147
+ supportingText: R?.filename ?? void 0,
2162
2148
  title: "PDF 預覽",
2163
- children: H ? /* @__PURE__ */ w(Ze, {
2164
- filename: B?.filename ?? "PDF 預覽",
2165
- fileUrl: H,
2166
- onDownload: B ? () => void wt(B) : void 0
2149
+ children: it ? /* @__PURE__ */ T(Qe, {
2150
+ filename: R?.filename ?? "PDF 預覽",
2151
+ fileUrl: it,
2152
+ onDownload: R ? () => void wt(R) : void 0
2167
2153
  }) : null
2168
2154
  }),
2169
- /* @__PURE__ */ w(_, {
2155
+ /* @__PURE__ */ T(y, {
2170
2156
  cancelText: "保留案件",
2171
2157
  confirmButtonProps: { variant: "destructive-primary" },
2172
2158
  confirmText: "確認取消",
2173
- loading: M,
2159
+ loading: Je,
2174
2160
  modalStatusType: "error",
2175
2161
  modalType: "standard",
2176
- onCancel: () => I(!1),
2177
- onClose: () => I(!1),
2162
+ onCancel: () => F(!1),
2163
+ onClose: () => F(!1),
2178
2164
  onConfirm: () => void Et(),
2179
- open: F,
2165
+ open: P,
2180
2166
  showModalFooter: !0,
2181
2167
  showModalHeader: !0,
2182
2168
  supportingText: "取消後會關閉目前待簽任務與候選簽核人。",
2183
2169
  title: "取消案件",
2184
- children: /* @__PURE__ */ T("div", {
2185
- style: Pn,
2186
- children: [/* @__PURE__ */ T(S, {
2170
+ children: /* @__PURE__ */ E("div", {
2171
+ style: Fn,
2172
+ children: [/* @__PURE__ */ E(C, {
2187
2173
  variant: "body",
2188
2174
  children: [
2189
2175
  "確定要取消「",
2190
- E?.title ?? "",
2176
+ S?.title ?? "",
2191
2177
  "」嗎?"
2192
2178
  ]
2193
- }), /* @__PURE__ */ w(n, {
2179
+ }), /* @__PURE__ */ T(n, {
2194
2180
  label: "取消原因",
2195
2181
  name: "cancelComment",
2196
- children: /* @__PURE__ */ w(ie, {
2197
- onChange: (e) => P(e.target.value),
2182
+ children: /* @__PURE__ */ T(ae, {
2183
+ onChange: (e) => N(e.target.value),
2198
2184
  placeholder: "可填寫取消原因",
2199
2185
  resize: "vertical",
2200
2186
  rows: 3,
2201
- value: Ye
2187
+ value: Xe
2202
2188
  })
2203
2189
  })]
2204
2190
  })
2205
2191
  })
2206
2192
  ] });
2207
2193
  }
2208
- function Ln(e) {
2209
- return e.data.label ? e.data.label : e.data.isDefault ? "其他情況" : e.data.condition ?? "";
2210
- }
2211
2194
  function Rn(e) {
2212
- return e.edges.map(Ln).filter((e) => e.trim().length > 0);
2195
+ return e.data.label ? e.data.label : e.data.isDefault ? "其他情況" : e.data.condition ?? "";
2213
2196
  }
2214
2197
  function zn(e) {
2198
+ return e.edges.map(Rn).filter((e) => e.trim().length > 0);
2199
+ }
2200
+ function Bn(e) {
2215
2201
  return e === "startEvent" ? "開始" : e === "endEvent" ? "完成" : e === "userTask" ? "簽核節點" : e === "serviceTask" ? "知會節點" : e === "exclusiveGateway" ? "條件分流" : "平行處理";
2216
2202
  }
2217
- function Bn(e, t, n, r) {
2203
+ function Vn(e, t, n, r) {
2218
2204
  return e.nodes.map((e) => {
2219
- let i = It(e, t, n, r);
2205
+ let i = Lt(e, t, n, r);
2220
2206
  return {
2221
2207
  data: {
2222
- kindLabel: zn(e.type),
2208
+ kindLabel: Bn(e.type),
2223
2209
  label: e.data.label,
2224
2210
  secondaryLabel: i.secondaryLabel,
2225
2211
  statusLabel: i.statusLabel,
@@ -2233,36 +2219,36 @@ function Bn(e, t, n, r) {
2233
2219
  };
2234
2220
  });
2235
2221
  }
2236
- function Vn(e) {
2237
- let t = new j.graphlib.Graph();
2222
+ function Hn(e) {
2223
+ let t = new Ke.graphlib.Graph();
2238
2224
  return t.setDefaultEdgeLabel(() => ({})), t.setGraph({
2239
2225
  nodesep: 56,
2240
2226
  rankdir: "LR",
2241
2227
  ranksep: 120
2242
2228
  }), e.nodes.forEach((e) => {
2243
2229
  t.setNode(e.id, {
2244
- height: Tn,
2245
- width: wn
2230
+ height: En,
2231
+ width: Tn
2246
2232
  });
2247
2233
  }), e.edges.forEach((e) => {
2248
2234
  t.setEdge(e.source, e.target);
2249
- }), j.layout(t), {
2235
+ }), Ke.layout(t), {
2250
2236
  ...e,
2251
2237
  nodes: e.nodes.map((e) => {
2252
2238
  let n = t.node(e.id);
2253
2239
  return n ? {
2254
2240
  ...e,
2255
2241
  position: {
2256
- x: n.x - wn / 2,
2257
- y: n.y - Tn / 2
2242
+ x: n.x - Tn / 2,
2243
+ y: n.y - En / 2
2258
2244
  }
2259
2245
  } : e;
2260
2246
  })
2261
2247
  };
2262
2248
  }
2263
- function Hn(e) {
2249
+ function Un(e) {
2264
2250
  return e.edges.map((e) => {
2265
- let t = Ln(e);
2251
+ let t = Rn(e);
2266
2252
  return {
2267
2253
  animated: !1,
2268
2254
  id: e.id,
@@ -2290,25 +2276,25 @@ function Hn(e) {
2290
2276
  };
2291
2277
  });
2292
2278
  }
2293
- function Un(e) {
2279
+ function Wn(e) {
2294
2280
  return e === "current" ? {
2295
- ...On,
2281
+ ...kn,
2296
2282
  border: "1px solid var(--mzn-color-primary, #0057ff)",
2297
2283
  boxShadow: "0 0 0 3px rgba(0, 87, 255, 0.14)"
2298
2284
  } : e === "completed" ? {
2299
- ...On,
2285
+ ...kn,
2300
2286
  border: "1px solid #16a34a"
2301
2287
  } : e === "cancelled" ? {
2302
- ...On,
2288
+ ...kn,
2303
2289
  border: "1px solid #dc2626",
2304
2290
  opacity: .72
2305
2291
  } : e === "waiting" ? {
2306
- ...On,
2292
+ ...kn,
2307
2293
  border: "1px dashed #64748b"
2308
- } : On;
2294
+ } : kn;
2309
2295
  }
2310
- function Wn(e) {
2311
- let t = kn;
2296
+ function Gn(e) {
2297
+ let t = An;
2312
2298
  return e === "current" ? {
2313
2299
  ...t,
2314
2300
  background: "#eff6ff",
@@ -2331,42 +2317,42 @@ function Wn(e) {
2331
2317
  color: "#64748b"
2332
2318
  };
2333
2319
  }
2334
- function Gn({ data: e }) {
2335
- return /* @__PURE__ */ T("div", {
2336
- style: Un(e.tone),
2320
+ function Kn({ data: e }) {
2321
+ return /* @__PURE__ */ E("div", {
2322
+ style: Wn(e.tone),
2337
2323
  children: [
2338
- /* @__PURE__ */ w(Ue, {
2324
+ /* @__PURE__ */ T(We, {
2339
2325
  isConnectable: !1,
2340
2326
  position: A.Left,
2341
- style: jn,
2327
+ style: Mn,
2342
2328
  type: "target"
2343
2329
  }),
2344
- /* @__PURE__ */ w(S, {
2330
+ /* @__PURE__ */ T(C, {
2345
2331
  component: "span",
2346
2332
  ellipsis: !0,
2347
2333
  title: e.label,
2348
2334
  variant: "label-primary",
2349
2335
  children: e.label
2350
2336
  }),
2351
- /* @__PURE__ */ w("span", {
2352
- style: Wn(e.tone),
2337
+ /* @__PURE__ */ T("span", {
2338
+ style: Gn(e.tone),
2353
2339
  children: e.statusLabel
2354
2340
  }),
2355
- /* @__PURE__ */ w("span", {
2341
+ /* @__PURE__ */ T("span", {
2356
2342
  title: e.secondaryLabel,
2357
- style: An,
2343
+ style: jn,
2358
2344
  children: e.secondaryLabel || e.kindLabel
2359
2345
  }),
2360
- /* @__PURE__ */ w(Ue, {
2346
+ /* @__PURE__ */ T(We, {
2361
2347
  isConnectable: !1,
2362
2348
  position: A.Right,
2363
- style: jn,
2349
+ style: Mn,
2364
2350
  type: "source"
2365
2351
  })
2366
2352
  ]
2367
2353
  });
2368
2354
  }
2369
2355
  //#endregion
2370
- export { nn as a, on as i, yn as n, Gt as o, hn as r, Ut as s, In as t };
2356
+ export { rn as a, sn as i, bn as n, Kt as o, gn as r, Wt as s, Ln as t };
2371
2357
 
2372
- //# sourceMappingURL=detail-_c21WQla.js.map
2358
+ //# sourceMappingURL=detail-C6NdVijG.js.map