@rytass/bpm-core-react 0.22.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/README.md +1 -0
  3. package/dist/chunks/FormBuilderView-Bg9ftYz-.cjs +4 -0
  4. package/dist/chunks/FormBuilderView-Bg9ftYz-.cjs.map +1 -0
  5. package/dist/chunks/{FormBuilderView-DbfbLZCI.js → FormBuilderView-CBvdcg_t.js} +675 -614
  6. package/dist/chunks/FormBuilderView-CBvdcg_t.js.map +1 -0
  7. package/dist/chunks/FormRendererView-D-p6GDQB.cjs +6 -0
  8. package/dist/chunks/FormRendererView-D-p6GDQB.cjs.map +1 -0
  9. package/dist/chunks/FormRendererView-DHXmekC3.js +1319 -0
  10. package/dist/chunks/FormRendererView-DHXmekC3.js.map +1 -0
  11. package/dist/chunks/{approval-instance-list-page-Cv5I1YPX.cjs → approval-instance-list-page-BqkG9jiR.cjs} +2 -2
  12. package/dist/chunks/{approval-instance-list-page-Cv5I1YPX.cjs.map → approval-instance-list-page-BqkG9jiR.cjs.map} +1 -1
  13. package/dist/chunks/{approval-instance-list-page-BI5fIXc-.js → approval-instance-list-page-CsSpIN4C.js} +2 -2
  14. package/dist/chunks/{approval-instance-list-page-BI5fIXc-.js.map → approval-instance-list-page-CsSpIN4C.js.map} +1 -1
  15. package/dist/chunks/compose-B43jtdyL.cjs +2 -0
  16. package/dist/chunks/compose-B43jtdyL.cjs.map +1 -0
  17. package/dist/chunks/{compose-U1zs3Yof.js → compose-C7yS6bJm.js} +162 -148
  18. package/dist/chunks/compose-C7yS6bJm.js.map +1 -0
  19. package/dist/chunks/{dashboard-page-BoqNhjT_.js → dashboard-page-DBJCsPya.js} +2 -2
  20. package/dist/chunks/{dashboard-page-BoqNhjT_.js.map → dashboard-page-DBJCsPya.js.map} +1 -1
  21. package/dist/chunks/{dashboard-page-D7YJ3udk.cjs → dashboard-page-lqlLELKs.cjs} +2 -2
  22. package/dist/chunks/{dashboard-page-D7YJ3udk.cjs.map → dashboard-page-lqlLELKs.cjs.map} +1 -1
  23. package/dist/chunks/{designer-DPG7R_WP.js → designer-B9Ut4xze.js} +1786 -1463
  24. package/dist/chunks/designer-B9Ut4xze.js.map +1 -0
  25. package/dist/chunks/designer-eXw7R9ug.cjs +69 -0
  26. package/dist/chunks/designer-eXw7R9ug.cjs.map +1 -0
  27. package/dist/chunks/{detail-CHZDNNM6.js → detail-BB_uYaoM.js} +904 -896
  28. package/dist/chunks/detail-BB_uYaoM.js.map +1 -0
  29. package/dist/chunks/detail-DN8pEzUJ.cjs +5 -0
  30. package/dist/chunks/detail-DN8pEzUJ.cjs.map +1 -0
  31. package/dist/chunks/instance-error-message-BKt07-Bo.js +270 -0
  32. package/dist/chunks/instance-error-message-BKt07-Bo.js.map +1 -0
  33. package/dist/chunks/instance-error-message-BL_X7Af8.cjs +2 -0
  34. package/dist/chunks/instance-error-message-BL_X7Af8.cjs.map +1 -0
  35. package/dist/chunks/member-profile-resolution-CJlgVdTR.js +44 -0
  36. package/dist/chunks/member-profile-resolution-CJlgVdTR.js.map +1 -0
  37. package/dist/chunks/member-profile-resolution-DiH-P-Vh.cjs +2 -0
  38. package/dist/chunks/member-profile-resolution-DiH-P-Vh.cjs.map +1 -0
  39. package/dist/chunks/{providers-CQWekD7_.js → providers-D35lBOTd.js} +2 -2
  40. package/dist/chunks/{providers-CQWekD7_.js.map → providers-D35lBOTd.js.map} +1 -1
  41. package/dist/chunks/{providers-VUOh6i0i.cjs → providers-Dz4Wqxr6.cjs} +2 -2
  42. package/dist/chunks/{providers-VUOh6i0i.cjs.map → providers-Dz4Wqxr6.cjs.map} +1 -1
  43. package/dist/chunks/{routes-config-C1j_vFKo.cjs → routes-config-BWjZDAU3.cjs} +2 -2
  44. package/dist/chunks/{routes-config-C1j_vFKo.cjs.map → routes-config-BWjZDAU3.cjs.map} +1 -1
  45. package/dist/chunks/{routes-config-BcNaWJWJ.js → routes-config-DjEOE9eP.js} +3 -2
  46. package/dist/chunks/{routes-config-BcNaWJWJ.js.map → routes-config-DjEOE9eP.js.map} +1 -1
  47. package/dist/chunks/users-C_Dtw_sR.cjs +2 -0
  48. package/dist/chunks/users-C_Dtw_sR.cjs.map +1 -0
  49. package/dist/chunks/users-wgM3TqU3.js +513 -0
  50. package/dist/chunks/users-wgM3TqU3.js.map +1 -0
  51. package/dist/index.cjs +1 -1
  52. package/dist/index.js +4 -4
  53. package/dist/lib/routes-config.d.cts +2 -0
  54. package/dist/lib/routes-config.d.ts +2 -0
  55. package/dist/next/index.cjs +1 -1
  56. package/dist/next/index.js +2 -2
  57. package/dist/pages/admin/stuck-instances/index.cjs +2 -0
  58. package/dist/pages/admin/stuck-instances/index.cjs.map +1 -0
  59. package/dist/pages/admin/stuck-instances/index.d.cts +4 -0
  60. package/dist/pages/admin/stuck-instances/index.d.ts +4 -0
  61. package/dist/pages/admin/stuck-instances/index.js +13 -0
  62. package/dist/pages/admin/stuck-instances/index.js.map +1 -0
  63. package/dist/pages/admin/users/index.cjs +1 -1
  64. package/dist/pages/admin/users/index.js +1 -1
  65. package/dist/pages/instances/detail/index.cjs +1 -1
  66. package/dist/pages/instances/detail/index.js +1 -1
  67. package/dist/pages/templates/compose/index.cjs +1 -1
  68. package/dist/pages/templates/compose/index.js +1 -1
  69. package/dist/pages/templates/designer/index.cjs +1 -1
  70. package/dist/pages/templates/designer/index.js +1 -1
  71. package/dist/views/admin/index.cjs +1 -1
  72. package/dist/views/admin/index.d.cts +1 -0
  73. package/dist/views/admin/index.d.ts +1 -0
  74. package/dist/views/admin/index.js +3 -2
  75. package/dist/views/admin/stuck-instances/AdminStuckInstancesView.d.cts +10 -0
  76. package/dist/views/admin/stuck-instances/AdminStuckInstancesView.d.ts +10 -0
  77. package/dist/views/admin/stuck-instances/StuckInstanceCancelModal.d.cts +14 -0
  78. package/dist/views/admin/stuck-instances/StuckInstanceCancelModal.d.ts +14 -0
  79. package/dist/views/admin/stuck-instances/index.cjs +2 -0
  80. package/dist/views/admin/stuck-instances/index.cjs.map +1 -0
  81. package/dist/views/admin/stuck-instances/index.d.cts +2 -0
  82. package/dist/views/admin/stuck-instances/index.d.ts +2 -0
  83. package/dist/views/admin/stuck-instances/index.js +237 -0
  84. package/dist/views/admin/stuck-instances/index.js.map +1 -0
  85. package/dist/views/admin/users/index.cjs +1 -1
  86. package/dist/views/admin/users/index.js +1 -1
  87. package/dist/views/cc/index.cjs +1 -1
  88. package/dist/views/cc/index.js +1 -1
  89. package/dist/views/dashboard/index.cjs +1 -1
  90. package/dist/views/dashboard/index.js +1 -1
  91. package/dist/views/forms/builder/index.cjs +1 -1
  92. package/dist/views/forms/builder/index.js +1 -1
  93. package/dist/views/forms/renderer/FormRendererView.d.cts +26 -1
  94. package/dist/views/forms/renderer/FormRendererView.d.ts +26 -1
  95. package/dist/views/forms/renderer/index.cjs +1 -1
  96. package/dist/views/forms/renderer/index.js +1 -1
  97. package/dist/views/inbox/index.cjs +1 -1
  98. package/dist/views/inbox/index.js +1 -1
  99. package/dist/views/instances/approver-filled-form.d.cts +56 -20
  100. package/dist/views/instances/approver-filled-form.d.ts +56 -20
  101. package/dist/views/instances/detail/index.cjs +1 -1
  102. package/dist/views/instances/detail/index.js +1 -1
  103. package/dist/views/instances/detail/sections/InstanceFormSection.d.cts +7 -0
  104. package/dist/views/instances/detail/sections/InstanceFormSection.d.ts +7 -0
  105. package/dist/views/instances/detail/sections/InstanceTasksSection.d.cts +1 -1
  106. package/dist/views/instances/detail/sections/InstanceTasksSection.d.ts +1 -1
  107. package/dist/views/instances/new/index.cjs +1 -1
  108. package/dist/views/instances/new/index.js +5 -5
  109. package/dist/views/instances/new/index.js.map +1 -1
  110. package/dist/views/search/index.cjs +1 -1
  111. package/dist/views/search/index.js +1 -1
  112. package/dist/views/sent/index.cjs +1 -1
  113. package/dist/views/sent/index.js +1 -1
  114. package/dist/views/templates/compose/index.cjs +1 -1
  115. package/dist/views/templates/compose/index.js +1 -1
  116. package/dist/views/templates/compose/steps/ComposeReviewStep.d.cts +3 -1
  117. package/dist/views/templates/compose/steps/ComposeReviewStep.d.ts +3 -1
  118. package/dist/views/templates/compose/steps/ComposeWorkflowStep.d.cts +4 -1
  119. package/dist/views/templates/compose/steps/ComposeWorkflowStep.d.ts +4 -1
  120. package/dist/views/templates/compose/use-template-compose-wizard.d.cts +3 -1
  121. package/dist/views/templates/compose/use-template-compose-wizard.d.ts +3 -1
  122. package/dist/views/templates/designer/TemplateDesignerView.d.cts +10 -1
  123. package/dist/views/templates/designer/TemplateDesignerView.d.ts +10 -1
  124. package/dist/views/templates/designer/approver-resolver-model.d.cts +31 -0
  125. package/dist/views/templates/designer/approver-resolver-model.d.ts +31 -0
  126. package/dist/views/templates/designer/field-access-matrix/FieldAccessMatrixDrawer.d.cts +3 -1
  127. package/dist/views/templates/designer/field-access-matrix/FieldAccessMatrixDrawer.d.ts +3 -1
  128. package/dist/views/templates/designer/field-access-matrix/field-access-copy.d.cts +3 -2
  129. package/dist/views/templates/designer/field-access-matrix/field-access-copy.d.ts +3 -2
  130. package/dist/views/templates/designer/index.cjs +1 -1
  131. package/dist/views/templates/designer/index.js +1 -1
  132. package/dist/views/templates/designer/launch-mode.d.cts +19 -0
  133. package/dist/views/templates/designer/launch-mode.d.ts +19 -0
  134. package/dist/views/templates/designer/node-actor-resolver-options.d.cts +30 -3
  135. package/dist/views/templates/designer/node-actor-resolver-options.d.ts +30 -3
  136. package/dist/views/templates/designer/publish-default-value-check.d.cts +36 -0
  137. package/dist/views/templates/designer/publish-default-value-check.d.ts +36 -0
  138. package/dist/views/templates/index.cjs +1 -1
  139. package/dist/views/templates/index.js +1 -1
  140. package/dist/views/templates/versions/index.cjs +1 -1
  141. package/dist/views/templates/versions/index.js +1 -1
  142. package/package.json +23 -3
  143. package/dist/chunks/FormBuilderView-Bok4Y59D.cjs +0 -4
  144. package/dist/chunks/FormBuilderView-Bok4Y59D.cjs.map +0 -1
  145. package/dist/chunks/FormBuilderView-DbfbLZCI.js.map +0 -1
  146. package/dist/chunks/FormRendererView-CAyPXhPq.js +0 -1351
  147. package/dist/chunks/FormRendererView-CAyPXhPq.js.map +0 -1
  148. package/dist/chunks/FormRendererView-iLlHFIUR.cjs +0 -6
  149. package/dist/chunks/FormRendererView-iLlHFIUR.cjs.map +0 -1
  150. package/dist/chunks/compose-DP1N4twA.cjs +0 -2
  151. package/dist/chunks/compose-DP1N4twA.cjs.map +0 -1
  152. package/dist/chunks/compose-U1zs3Yof.js.map +0 -1
  153. package/dist/chunks/designer-CWL-dCQ_.cjs +0 -69
  154. package/dist/chunks/designer-CWL-dCQ_.cjs.map +0 -1
  155. package/dist/chunks/designer-DPG7R_WP.js.map +0 -1
  156. package/dist/chunks/detail-BUfsSal0.cjs +0 -5
  157. package/dist/chunks/detail-BUfsSal0.cjs.map +0 -1
  158. package/dist/chunks/detail-CHZDNNM6.js.map +0 -1
  159. package/dist/chunks/instance-error-message-BEM4O_Kj.js +0 -208
  160. package/dist/chunks/instance-error-message-BEM4O_Kj.js.map +0 -1
  161. package/dist/chunks/instance-error-message-BpCLCOjp.cjs +0 -2
  162. package/dist/chunks/instance-error-message-BpCLCOjp.cjs.map +0 -1
  163. package/dist/chunks/users-BBtiZ9QQ.js +0 -486
  164. package/dist/chunks/users-BBtiZ9QQ.js.map +0 -1
  165. package/dist/chunks/users-EqSzDhuj.cjs +0 -2
  166. package/dist/chunks/users-EqSzDhuj.cjs.map +0 -1
@@ -4,30 +4,30 @@ import { t as e } from "./bpm-form-field-9B-Det0u.js";
4
4
  import { t } from "./format-date-time-B0LdmWg4.js";
5
5
  import { n } from "./auth-provider-C2b-5mGt.js";
6
6
  import { t as r } from "./use-bpm-member-BPzcNU1g.js";
7
- import { l as i, n as a, o, t as s } from "./FormRendererView-CAyPXhPq.js";
7
+ import { i, n as a, s as o, t as s } from "./FormRendererView-DHXmekC3.js";
8
8
  import { a as c, n as l, o as u, r as d, t as f } from "./task-decision-3d17ZvZE.js";
9
9
  import { t as p } from "./format-member-label-C73FuP-d.js";
10
- import { a as m, c as h, d as g, f as ee, i as te, l as ne, n as re, o as ie, r as ae, s as oe, t as _, u as v } from "./instance-error-message-BEM4O_Kj.js";
11
- import { Fragment as se, forwardRef as y, useCallback as ce, useEffect as le, useImperativeHandle as ue, useMemo as b, useRef as de, useState as x } from "react";
12
- import { AutoComplete as fe, Badge as pe, Button as S, Description as C, DescriptionContent as me, InlineMessage as he, Input as ge, Message as _e, Modal as w, PageHeader as ve, Section as T, SectionGroup as ye, Select as be, Stepper as xe, Table as Se, Textarea as Ce, Tooltip as we, Typography as E } from "@mezzanine-ui/react";
13
- import { readFormDataIssues as Te } from "@rytass/bpm-core-client";
14
- import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
15
- import { cancelAdhocDirective as Ee, cancelApprovalInstance as De, configureAdhocCompletionNotification as Oe, configureAdhocStageNotification as ke, decideTask as A, listAdhocDirectives as Ae, listAttachments as je, listTaskDecisions as Me, listWorkflowWebhookDeliveries as Ne, readApprovalInstance as Pe, readAttachmentDownloadUrl as Fe, readAttachmentPreviewUrl as Ie, readInstanceSignatures as Le, requestAdhocCountersign as Re, requestAdhocPreApproval as ze, resolveMemberProfiles as Be, resubmitApprovalInstance as Ve, retryWorkflowWebhookDelivery as He, searchMembers as Ue, uploadAttachment as We } from "@rytass/bpm-core-client/workflow";
16
- import { readNodeFillableFieldKeys as Ge, readRevealedFieldKeys as Ke, readTopLevelFieldKey as j, resolveFieldAccess as qe } from "@rytass/bpm-core-shared";
17
- import M from "@mezzanine-ui/react/ContentHeader";
18
- import { buildFormRendererValues as Je, focusFormRendererField as Ye, validateFormRendererValuesInWorker as Xe } from "@rytass/bpm-core-client/form";
19
- import { CheckedIcon as Ze, ChevronLeftIcon as Qe, ChevronRightIcon as $e, DangerousOutlineIcon as et, DownloadIcon as N, FileSearchIcon as tt, NotificationUnreadIcon as nt, PlusIcon as rt, RefreshCcwIcon as it, ResetIcon as at, ShareIcon as P, UserIcon as F, ZoomInIcon as ot, ZoomOutIcon as st } from "@mezzanine-ui/icons";
20
- import { resolveOrgUnitOptions as ct } from "@rytass/bpm-core-client/organization";
21
- import { Background as lt, Controls as ut, Handle as I, Position as L, ReactFlow as dt } from "@xyflow/react";
22
- import * as ft from "dagre";
23
- import { Document as pt, Page as mt } from "react-pdf";
24
- import { readSelectableReturnTargetNodeIds as ht } from "@rytass/bpm-core-shared/workflow-graph";
25
- import { stepClasses as R } from "@mezzanine-ui/core/stepper";
26
- function gt(e) {
10
+ import { a as m, c as h, d as g, f as ee, h as te, i as ne, l as re, m as ie, o as ae, p as oe, r as _, s as se, t as v, u as ce } from "./instance-error-message-BKt07-Bo.js";
11
+ import { Fragment as le, forwardRef as y, useCallback as ue, useEffect as de, useImperativeHandle as fe, useMemo as b, useRef as pe, useState as x } from "react";
12
+ import { AutoComplete as me, Badge as he, Button as S, Description as C, DescriptionContent as ge, InlineMessage as _e, Input as ve, Message as w, Modal as T, PageHeader as ye, Section as E, SectionGroup as be, Select as xe, Stepper as Se, Table as D, Textarea as Ce, Tooltip as we, Typography as O } from "@mezzanine-ui/react";
13
+ import { readFormDataIssues as Te, readRequestErrorCode as Ee } from "@rytass/bpm-core-client";
14
+ import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
15
+ import { cancelAdhocDirective as De, cancelApprovalInstance as Oe, configureAdhocCompletionNotification as ke, configureAdhocStageNotification as M, decideTask as Ae, listAdhocDirectives as je, listAttachments as Me, listTaskDecisions as Ne, listWorkflowWebhookDeliveries as Pe, readApprovalInstance as Fe, readAttachmentDownloadUrl as Ie, readAttachmentPreviewUrl as Le, readInstanceSignatures as Re, requestAdhocCountersign as ze, requestAdhocPreApproval as Be, resolveMemberProfiles as Ve, resubmitApprovalInstance as He, retryWorkflowWebhookDelivery as Ue, searchMembers as We, uploadAttachment as Ge } from "@rytass/bpm-core-client/workflow";
16
+ import { readNodeFillGrantFieldKeys as Ke, readRevealedFieldKeys as N, readTopLevelFieldKey as P, resolveFieldAccess as qe } from "@rytass/bpm-core-shared";
17
+ import Je from "@mezzanine-ui/react/ContentHeader";
18
+ import { buildFormRendererValues as Ye, focusFormRendererField as Xe, validateFormRendererValuesInWorker as Ze } from "@rytass/bpm-core-client/form";
19
+ import { CheckedIcon as Qe, ChevronLeftIcon as $e, ChevronRightIcon as F, DangerousOutlineIcon as et, DownloadIcon as tt, FileSearchIcon as nt, NotificationUnreadIcon as rt, PlusIcon as it, RefreshCcwIcon as I, ResetIcon as L, ShareIcon as at, UserIcon as ot, ZoomInIcon as st, ZoomOutIcon as ct } from "@mezzanine-ui/icons";
20
+ import { resolveOrgUnitOptions as lt } from "@rytass/bpm-core-client/organization";
21
+ import { Background as ut, Controls as dt, Handle as ft, Position as R, ReactFlow as pt } from "@xyflow/react";
22
+ import * as mt from "dagre";
23
+ import { Document as ht, Page as gt } from "react-pdf";
24
+ import { readSelectableReturnTargetNodeIds as _t } from "@rytass/bpm-core-shared/workflow-graph";
25
+ import { stepClasses as z } from "@mezzanine-ui/core/stepper";
26
+ function vt(e) {
27
27
  let [t, n] = x(/* @__PURE__ */ new Map()), r = e.join("\n");
28
- return le(() => {
28
+ return de(() => {
29
29
  let e = r ? [...new Set(r.split("\n"))].filter((e) => !t.has(e)) : [], i = !1;
30
- return e.length === 0 ? () => void 0 : (ct(e).then((e) => e.map(a)).catch(() => []).then((t) => {
30
+ return e.length === 0 ? () => void 0 : (lt(e).then((e) => e.map(a)).catch(() => []).then((t) => {
31
31
  i || n((n) => new Map([...n, ...e.map((e) => [e, t.find((t) => t.id.toLowerCase() === e.toLowerCase())?.name ?? null])]));
32
32
  }), () => {
33
33
  i = !0;
@@ -37,7 +37,7 @@ function gt(e) {
37
37
  return n === null ? [] : [[e, n ?? "讀取中…"]];
38
38
  })), [r, t]);
39
39
  }
40
- var z = {
40
+ var B = {
41
41
  root: "bpm_root_ehm7w",
42
42
  toolbar: "bpm_toolbar_R-tis",
43
43
  pageControls: "bpm_pageControls_jM-rC",
@@ -46,10 +46,10 @@ var z = {
46
46
  viewport: "bpm_viewport_DQXms",
47
47
  page: "bpm_page_Cv5Rg",
48
48
  state: "bpm_state_bpgp3"
49
- }, _t = 760, vt = 920, yt = 320, bt = 32, xt = .75, St = 1.75, B = .25;
50
- function Ct({ filename: e, fileUrl: t, onDownload: n }) {
51
- let r = de(null), [i, a] = x(null), [o, s] = x(1), [c, l] = x(1), [u, d] = x(_t);
52
- le(() => {
49
+ }, yt = 760, bt = 920, xt = 320, St = 32, Ct = .75, wt = 1.75, Tt = .25;
50
+ function Et({ filename: e, fileUrl: t, onDownload: n }) {
51
+ let r = pe(null), [i, a] = x(null), [o, s] = x(1), [c, l] = x(1), [u, d] = x(yt);
52
+ de(() => {
53
53
  let e = r.current;
54
54
  if (!e || typeof ResizeObserver > "u") return;
55
55
  let t = new ResizeObserver((e) => {
@@ -57,45 +57,45 @@ function Ct({ filename: e, fileUrl: t, onDownload: n }) {
57
57
  t && d(t);
58
58
  });
59
59
  return t.observe(e), () => t.disconnect();
60
- }, []), le(() => {
60
+ }, []), de(() => {
61
61
  a(null), s(1), l(1);
62
62
  }, [t]);
63
63
  let f = b(() => {
64
- let e = Math.max(yt, u - bt);
65
- return Math.round(Math.min(vt, e) * c);
66
- }, [c, u]), p = ce((e) => {
64
+ let e = Math.max(xt, u - St);
65
+ return Math.round(Math.min(bt, e) * c);
66
+ }, [c, u]), p = ue((e) => {
67
67
  a(e.numPages), s(1);
68
- }, []), m = o > 1, h = i !== null && o < i, g = c > xt, ee = c < St, te = i === null ? `第 ${o} 頁` : `第 ${o} / ${i} 頁`, ne = `${Math.round(c * 100)}%`;
69
- return /* @__PURE__ */ k("section", {
68
+ }, []), m = o > 1, h = i !== null && o < i, g = c > Ct, ee = c < wt, te = i === null ? `第 ${o} 頁` : `第 ${o} / ${i} 頁`, ne = `${Math.round(c * 100)}%`;
69
+ return /* @__PURE__ */ j("section", {
70
70
  "aria-label": `${e} PDF 預覽`,
71
- className: z.root,
72
- children: [/* @__PURE__ */ k("div", {
73
- className: z.toolbar,
71
+ className: B.root,
72
+ children: [/* @__PURE__ */ j("div", {
73
+ className: B.toolbar,
74
74
  children: [
75
- /* @__PURE__ */ k("div", {
76
- className: z.pageControls,
75
+ /* @__PURE__ */ j("div", {
76
+ className: B.pageControls,
77
77
  "aria-label": "頁面切換",
78
78
  children: [
79
- /* @__PURE__ */ O(S, {
79
+ /* @__PURE__ */ A(S, {
80
80
  "aria-label": "上一頁",
81
81
  disabled: !m,
82
- icon: Qe,
82
+ icon: $e,
83
83
  onClick: () => {
84
84
  s((e) => Math.max(1, e - 1));
85
85
  },
86
86
  size: "minor",
87
87
  variant: "base-secondary"
88
88
  }),
89
- /* @__PURE__ */ O(E, {
90
- className: z.counter,
89
+ /* @__PURE__ */ A(O, {
90
+ className: B.counter,
91
91
  component: "span",
92
92
  variant: "body",
93
93
  children: te
94
94
  }),
95
- /* @__PURE__ */ O(S, {
95
+ /* @__PURE__ */ A(S, {
96
96
  "aria-label": "下一頁",
97
97
  disabled: !h,
98
- icon: $e,
98
+ icon: F,
99
99
  onClick: () => {
100
100
  s((e) => i === null ? e : Math.min(i, e + 1));
101
101
  },
@@ -104,40 +104,40 @@ function Ct({ filename: e, fileUrl: t, onDownload: n }) {
104
104
  })
105
105
  ]
106
106
  }),
107
- /* @__PURE__ */ k("div", {
108
- className: z.zoomControls,
107
+ /* @__PURE__ */ j("div", {
108
+ className: B.zoomControls,
109
109
  "aria-label": "縮放",
110
110
  children: [
111
- /* @__PURE__ */ O(S, {
111
+ /* @__PURE__ */ A(S, {
112
112
  "aria-label": "縮小",
113
113
  disabled: !g,
114
- icon: st,
114
+ icon: ct,
115
115
  onClick: () => {
116
- l((e) => Math.max(xt, e - B));
116
+ l((e) => Math.max(Ct, e - Tt));
117
117
  },
118
118
  size: "minor",
119
119
  variant: "base-secondary"
120
120
  }),
121
- /* @__PURE__ */ O(E, {
122
- className: z.counter,
121
+ /* @__PURE__ */ A(O, {
122
+ className: B.counter,
123
123
  component: "span",
124
124
  variant: "body",
125
125
  children: ne
126
126
  }),
127
- /* @__PURE__ */ O(S, {
127
+ /* @__PURE__ */ A(S, {
128
128
  "aria-label": "放大",
129
129
  disabled: !ee,
130
- icon: ot,
130
+ icon: st,
131
131
  onClick: () => {
132
- l((e) => Math.min(St, e + B));
132
+ l((e) => Math.min(wt, e + Tt));
133
133
  },
134
134
  size: "minor",
135
135
  variant: "base-secondary"
136
136
  })
137
137
  ]
138
138
  }),
139
- n ? /* @__PURE__ */ O(S, {
140
- icon: N,
139
+ n ? /* @__PURE__ */ A(S, {
140
+ icon: tt,
141
141
  iconType: "leading",
142
142
  onClick: n,
143
143
  size: "minor",
@@ -145,19 +145,19 @@ function Ct({ filename: e, fileUrl: t, onDownload: n }) {
145
145
  children: "下載"
146
146
  }) : null
147
147
  ]
148
- }), /* @__PURE__ */ O("div", {
149
- className: z.viewport,
148
+ }), /* @__PURE__ */ A("div", {
149
+ className: B.viewport,
150
150
  ref: r,
151
- children: /* @__PURE__ */ O(pt, {
152
- error: /* @__PURE__ */ O(V, { message: "PDF 無法載入。" }),
151
+ children: /* @__PURE__ */ A(ht, {
152
+ error: /* @__PURE__ */ A(Dt, { message: "PDF 無法載入。" }),
153
153
  file: t,
154
- loading: /* @__PURE__ */ O(V, { message: "正在載入 PDF..." }),
155
- noData: /* @__PURE__ */ O(V, { message: "沒有可預覽的 PDF。" }),
154
+ loading: /* @__PURE__ */ A(Dt, { message: "正在載入 PDF..." }),
155
+ noData: /* @__PURE__ */ A(Dt, { message: "沒有可預覽的 PDF。" }),
156
156
  onLoadSuccess: p,
157
157
  suspense: !1,
158
- children: /* @__PURE__ */ O(mt, {
159
- className: z.page,
160
- loading: /* @__PURE__ */ O(V, { message: "正在載入頁面..." }),
158
+ children: /* @__PURE__ */ A(gt, {
159
+ className: B.page,
160
+ loading: /* @__PURE__ */ A(Dt, { message: "正在載入頁面..." }),
161
161
  pageNumber: o,
162
162
  renderAnnotationLayer: !0,
163
163
  renderTextLayer: !0,
@@ -167,10 +167,10 @@ function Ct({ filename: e, fileUrl: t, onDownload: n }) {
167
167
  })]
168
168
  });
169
169
  }
170
- function V({ message: e }) {
171
- return /* @__PURE__ */ O("div", {
172
- className: z.state,
173
- children: /* @__PURE__ */ O(E, {
170
+ function Dt({ message: e }) {
171
+ return /* @__PURE__ */ A("div", {
172
+ className: B.state,
173
+ children: /* @__PURE__ */ A(O, {
174
174
  color: "text-neutral",
175
175
  variant: "body",
176
176
  children: e
@@ -178,121 +178,121 @@ function V({ message: e }) {
178
178
  });
179
179
  }
180
180
  // src/views/instances/detail/submitted-by.ts
181
- function wt({ initiatorMemberId: e, submittedByMemberId: t }) {
181
+ function Ot({ initiatorMemberId: e, submittedByMemberId: t }) {
182
182
  return t && t !== e ? t : null;
183
183
  }
184
- function Tt(e, t) {
185
- let n = wt(e);
184
+ function kt(e, t) {
185
+ let n = Ot(e);
186
186
  if (!n || !e.initiatorMemberId) return null;
187
187
  let r = (e) => t.get(e)?.name ?? e;
188
188
  return `由 ${r(n)} 代 ${r(e.initiatorMemberId)} 送出`;
189
189
  }
190
190
  // src/views/instances/detail/sections/shared.ts
191
- function Et(e) {
192
- let t = H(e, "from"), n = H(e, "to"), r = H(e, "reason");
191
+ function At(e) {
192
+ let t = V(e, "from"), n = V(e, "to"), r = V(e, "reason");
193
193
  return !t || !n || !r ? null : {
194
194
  from: t,
195
195
  reason: r,
196
- ruleId: H(e, "ruleId"),
196
+ ruleId: V(e, "ruleId"),
197
197
  to: n
198
198
  };
199
199
  }
200
- function Dt(e) {
200
+ function jt(e) {
201
201
  try {
202
202
  let t = JSON.parse(e);
203
- return Array.isArray(t) ? t.map((e) => kt(e) ? Et(e) : null).filter((e) => e !== null) : [];
203
+ return Array.isArray(t) ? t.map((e) => W(e) ? At(e) : null).filter((e) => e !== null) : [];
204
204
  } catch {
205
205
  return [];
206
206
  }
207
207
  }
208
- function H(e, t) {
208
+ function V(e, t) {
209
209
  let n = e[t];
210
210
  return typeof n == "string" ? n : null;
211
211
  }
212
- function Ot(e, t) {
212
+ function H(e, t) {
213
213
  let n = e[t];
214
214
  return Array.isArray(n) ? n.filter((e) => typeof e == "string") : [];
215
215
  }
216
- function U(e, t) {
216
+ function Mt(e, t) {
217
217
  let n = e[t];
218
218
  return typeof n == "number" ? n : null;
219
219
  }
220
- function W(e) {
220
+ function U(e) {
221
221
  return typeof e == "string" && e.trim().length > 0;
222
222
  }
223
- function kt(e) {
223
+ function W(e) {
224
224
  return typeof e == "object" && !!e;
225
225
  }
226
- function At(e) {
226
+ function Nt(e) {
227
227
  return e.status === "PENDING" || e.status === "IN_PROGRESS";
228
228
  }
229
- function jt(e) {
229
+ function G(e) {
230
230
  return !Number.isFinite(e) || e <= 0 ? "-" : e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1024 / 1024).toFixed(1)} MB`;
231
231
  }
232
- function G(e) {
232
+ function K(e) {
233
233
  return e.length > 16 ? `${e.slice(0, 12)}...` : e;
234
234
  }
235
- function Mt(e) {
235
+ function Pt(e) {
236
236
  return e === "APPROVED" ? "已同意" : e === "CANCELLED" ? "已取消" : e === "DRAFT" ? "草稿" : e === "EXPIRED" ? "已逾期" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "RUNNING" ? "進行中" : e;
237
237
  }
238
- function K(e) {
238
+ function Ft(e) {
239
239
  return e === "PENDING" ? "待處理" : e === "IN_PROGRESS" ? "處理中" : e === "COMPLETED" ? "已完成" : e === "CANCELLED" ? "已取消" : e === "TRANSFERRED" ? "已轉派" : e;
240
240
  }
241
- function Nt(e) {
241
+ function It(e) {
242
242
  return e === "APPROVED" ? "同意" : e === "REJECTED" ? "拒絕" : e === "RETURNED" ? "退回" : e === "TRANSFERRED" ? "轉派" : e;
243
243
  }
244
- function Pt(e) {
244
+ function Lt(e) {
245
245
  return e === "startEvent" ? "開始" : e === "endEvent" ? "完成" : e === "userTask" ? "簽核節點" : e === "serviceTask" ? "知會節點" : e === "exclusiveGateway" ? "條件分流" : "平行處理";
246
246
  }
247
- function Ft(e, t) {
247
+ function Rt(e, t) {
248
248
  return t?.nodes.find((t) => t.id === e)?.data.label ?? e;
249
249
  }
250
- function It(e, t) {
250
+ function zt(e, t) {
251
251
  return e.name.trim() ? e.name : t;
252
252
  }
253
253
  function q(e, t) {
254
254
  if (!e) return "-";
255
255
  let n = t.get(e);
256
- return n ? p(It(n, e), n.email, "fullwidth") : e;
256
+ return n ? p(zt(n, e), n.email, "fullwidth") : e;
257
257
  }
258
- function Lt(e) {
259
- return !!e.assigneeMemberId && !!e.originalAssigneeMemberId && e.originalAssigneeMemberId !== e.assigneeMemberId && Dt(e.delegationChainJson).length > 0;
258
+ function Bt(e) {
259
+ return !!e.assigneeMemberId && !!e.originalAssigneeMemberId && e.originalAssigneeMemberId !== e.assigneeMemberId && jt(e.delegationChainJson).length > 0;
260
260
  }
261
- function Rt(e, t = /* @__PURE__ */ new Map()) {
261
+ function Vt(e, t = /* @__PURE__ */ new Map()) {
262
262
  if (!e.assigneeMemberId) return e.candidateMemberIds.length ? `候選 ${e.candidateMemberIds.map((e) => q(e, t)).join("、")}` : "未指定";
263
263
  let n = q(e.assigneeMemberId, t);
264
- return Lt(e) ? `${n}(原:${q(e.originalAssigneeMemberId, t)})` : n;
264
+ return Bt(e) ? `${n}(原:${q(e.originalAssigneeMemberId, t)})` : n;
265
265
  }
266
- function zt(e, t) {
266
+ function J(e, t) {
267
267
  return t ? e.assigneeMemberId === t || (e.openCandidateMemberIds ?? e.candidateMemberIds).includes(t) : !1;
268
268
  }
269
- function Bt(e, t) {
270
- let n = e.filter((e) => zt(e, t) && (e.status === "PENDING" || e.status === "IN_PROGRESS"));
269
+ function Ht(e, t) {
270
+ let n = e.filter((e) => J(e, t) && (e.status === "PENDING" || e.status === "IN_PROGRESS"));
271
271
  return n.find((e) => !e.isAdhoc) ?? n[0] ?? null;
272
272
  }
273
- function J(e, t) {
273
+ function Ut(e, t) {
274
274
  if (t.type !== "userTask" || !t.data.returnBehavior.allowReturn) return [];
275
275
  if (t.data.returnBehavior.allowedTargets === "ANY") {
276
- let n = ht(e, t.id);
276
+ let n = _t(e, t.id);
277
277
  return e.nodes.filter((e) => n.includes(e.id)).map((e) => ({
278
278
  id: e.id,
279
- name: `${e.data.label}(${Pt(e.type)})`
279
+ name: `${e.data.label}(${Lt(e.type)})`
280
280
  }));
281
281
  }
282
282
  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);
283
283
  return r ? [{
284
284
  id: r.id,
285
- name: `${r.data.label}(${Pt(r.type)})`
285
+ name: `${r.data.label}(${Lt(r.type)})`
286
286
  }] : [];
287
287
  }
288
- function Vt(e) {
288
+ function Wt(e) {
289
289
  return {
290
290
  email: e.email,
291
291
  id: e.memberId,
292
292
  name: p(e.name, e.email, "dot")
293
293
  };
294
294
  }
295
- function Ht({ memberIds: e, useWebhookTarget: t, webhookUrl: n }) {
295
+ function Gt({ memberIds: e, useWebhookTarget: t, webhookUrl: n }) {
296
296
  if (t) {
297
297
  let e = n.trim();
298
298
  return e ? {
@@ -317,11 +317,11 @@ function Ht({ memberIds: e, useWebhookTarget: t, webhookUrl: n }) {
317
317
  valid: !1
318
318
  };
319
319
  }
320
- function Ut(e) {
320
+ function Kt(e) {
321
321
  return !!e;
322
322
  }
323
- function Wt(e) {
324
- if (!kt(e)) return null;
323
+ function qt(e) {
324
+ if (!W(e)) return null;
325
325
  let t = e.email, n = e.id, r = e.name;
326
326
  return typeof n == "string" && typeof r == "string" ? {
327
327
  email: typeof t == "string" ? t : null,
@@ -329,7 +329,7 @@ function Wt(e) {
329
329
  name: r
330
330
  } : null;
331
331
  }
332
- function Gt(e, t) {
332
+ function Jt(e, t) {
333
333
  let n = e.trim().toLocaleLowerCase();
334
334
  if (!n) return null;
335
335
  let r = t.filter((e) => [
@@ -340,80 +340,81 @@ function Gt(e, t) {
340
340
  return r.length === 1 ? r[0] ?? null : null;
341
341
  }
342
342
  function Y(e) {
343
- return W(e) ? {
343
+ return U(e) ? {
344
344
  text: e,
345
345
  type: "text"
346
346
  } : null;
347
347
  }
348
- function Kt(e, t, n = "neutral") {
349
- return W(t) ? {
348
+ function Yt(e, t, n = "neutral") {
349
+ return U(t) ? {
350
350
  label: e,
351
351
  text: t,
352
352
  tone: n,
353
353
  type: "comment"
354
354
  } : null;
355
355
  }
356
- function qt(e, t, n, r) {
356
+ function X(e, t, n, r) {
357
357
  let i = t ? n.get(t) : null;
358
358
  return {
359
359
  email: i?.email ?? null,
360
- label: i ? It(i, r) : r,
360
+ label: i ? zt(i, r) : r,
361
361
  memberId: t,
362
362
  prefix: e,
363
363
  type: "member"
364
364
  };
365
365
  }
366
- function X(e, t) {
366
+ function Z(e, t) {
367
367
  let n = e.originalAssigneeMemberId;
368
- return !n || !Lt(e) ? null : qt("原簽核人", n, t, n);
368
+ return !n || !Bt(e) ? null : X("原簽核人", n, t, n);
369
369
  }
370
- function Z(e) {
370
+ function Q(e) {
371
371
  return !!e;
372
372
  }
373
- function Q(e) {
373
+ function Xt(e) {
374
374
  let t = e.findIndex((e) => e.id.startsWith("pending-task-") || e.id.startsWith("future-node-"));
375
375
  return t === -1 ? e.length : t;
376
376
  }
377
- function Jt(e) {
378
- return e.eventType === "INSTANCE_STARTED" || e.eventType === "INSTANCE_CANCELLED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "INSTANCE_RESUBMITTED" || e.eventType === "TASK_DECIDED" || e.eventType === "SLA_TRIGGERED" || e.eventType === "TASK_CANDIDATE_ACTIVATED" || e.eventType === "TASK_REASSIGNED" || Yt(e) || Qt(e.eventType, nn(e));
377
+ function Zt(e) {
378
+ return e.eventType === "INSTANCE_STARTED" || e.eventType === "INSTANCE_CANCELLED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "INSTANCE_RESUBMITTED" || e.eventType === "TASK_DECIDED" || e.eventType === "SLA_TRIGGERED" || e.eventType === "TASK_CANDIDATE_ACTIVATED" || e.eventType === "TASK_REASSIGNED" || e.eventType === "ADVANCE_FAILED" || Qt(e) || tn(e.eventType, on(e));
379
379
  }
380
- function Yt(e) {
381
- return e.eventType === "TASK_CREATED" && Ot(nn(e), "sequentialCandidateMemberIds").length > 0;
380
+ function Qt(e) {
381
+ return e.eventType === "TASK_CREATED" && H(on(e), "sequentialCandidateMemberIds").length > 0;
382
382
  }
383
- function Xt(e) {
383
+ function $t(e) {
384
384
  if (e.eventType === "TASK_REASSIGNED") {
385
- let t = nn(e);
385
+ let t = on(e);
386
386
  return [
387
- H(t, "fromMemberId"),
388
- H(t, "toMemberId"),
389
- H(t, "actorMemberId")
390
- ].filter(W);
387
+ V(t, "fromMemberId"),
388
+ V(t, "toMemberId"),
389
+ V(t, "actorMemberId")
390
+ ].filter(U);
391
391
  }
392
392
  if (e.eventType !== "TASK_CANDIDATE_ACTIVATED" && e.eventType !== "TASK_CREATED") return [];
393
- let t = nn(e);
393
+ let t = on(e);
394
394
  return [
395
- ...Ot(t, "sequentialCandidateMemberIds"),
396
- H(t, "candidateMemberId"),
397
- H(t, "previousMemberId")
398
- ].filter(W);
395
+ ...H(t, "sequentialCandidateMemberIds"),
396
+ V(t, "candidateMemberId"),
397
+ V(t, "previousMemberId")
398
+ ].filter(U);
399
399
  }
400
- var Zt = /* @__PURE__ */ new Set([
400
+ var en = /* @__PURE__ */ new Set([
401
401
  "SERVICE_TASK_EXECUTED",
402
402
  "SERVICE_TASK_FAILED",
403
403
  "WEBHOOK_DELIVERY_RETRIED"
404
404
  ]);
405
- function Qt(e, t) {
406
- return Zt.has(e) && H(t, "action") === "NOTIFY_WEBHOOK";
405
+ function tn(e, t) {
406
+ return en.has(e) && V(t, "action") === "NOTIFY_WEBHOOK";
407
407
  }
408
- function $t(e) {
409
- return H(e, "endpointLabel") ?? H(e, "endpointKey") ?? "外部系統";
408
+ function nn(e) {
409
+ return V(e, "endpointLabel") ?? V(e, "endpointKey") ?? "外部系統";
410
410
  }
411
- function en(e) {
411
+ function rn(e) {
412
412
  return e === "APPROVED" ? "已同意" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "TRANSFERRED" ? "已轉派" : "簽核已決議";
413
413
  }
414
- function tn(e, t) {
414
+ function an(e, t) {
415
415
  if (e === "INSTANCE_STARTED") return "案件已發起";
416
- if (e === "INSTANCE_CANCELLED") return "案件已取消";
416
+ if (e === "INSTANCE_CANCELLED") return t.cancelledByAdministrator === !0 ? `管理員撤銷:${V(t, "comment") ?? "-"}` : "案件已取消";
417
+ if (e === "ADVANCE_FAILED") return `${V(t, "automatic") === "SLA_AUTO_APPROVE" ? "系統逾時自動同意失敗" : "往下一關失敗"}:${V(t, "message") ?? "-"}`;
417
418
  if (e === "INSTANCE_EXPIRED") return "案件逾期,已由系統終止";
418
419
  if (e === "INSTANCE_RESUBMITTED") return "申請人重新送出";
419
420
  if (e === "TOKEN_CREATED") return "流程路徑已建立";
@@ -421,107 +422,107 @@ function tn(e, t) {
421
422
  if (e === "TOKEN_ADVANCED") return "流程已前進";
422
423
  if (e === "TASK_CREATED") return "待簽任務已建立";
423
424
  if (e === "TASK_CANDIDATE_ACTIVATED") return "輪到下一位簽核";
424
- if (e === "TASK_DECIDED") return en(H(t, "action"));
425
+ if (e === "TASK_DECIDED") return rn(V(t, "action"));
425
426
  if (e === "SLA_TRIGGERED") return "時限提醒已觸發";
426
427
  if (e === "TASK_REASSIGNED") return "管理者改派待辦";
427
- if (Qt(e, t)) {
428
- let n = $t(t);
428
+ if (tn(e, t)) {
429
+ let n = nn(t);
429
430
  return e === "SERVICE_TASK_EXECUTED" ? `已通知外部系統:${n}` : e === "SERVICE_TASK_FAILED" ? `通知外部系統失敗:${n}` : `管理者重新傳送外部系統通知:${n}`;
430
431
  }
431
432
  return e;
432
433
  }
433
- function nn(e) {
434
+ function on(e) {
434
435
  try {
435
436
  let t = JSON.parse(e.payloadJson);
436
- return kt(t) ? t : {};
437
+ return W(t) ? t : {};
437
438
  } catch {
438
439
  return {};
439
440
  }
440
441
  }
441
- function rn(e, t) {
442
- return e.eventType === "SLA_TRIGGERED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "SERVICE_TASK_FAILED" && Qt(e.eventType, t) || H(t, "action") === "REJECTED" || H(t, "instanceState") === "REJECTED";
442
+ function sn(e, t) {
443
+ return e.eventType === "SLA_TRIGGERED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "SERVICE_TASK_FAILED" && tn(e.eventType, t) || V(t, "action") === "REJECTED" || V(t, "instanceState") === "REJECTED";
443
444
  }
444
- function an(e) {
445
+ function cn(e) {
445
446
  return t(e);
446
447
  }
447
- function on(e, t) {
448
- let n = H(e, "fromMemberId"), r = H(e, "toMemberId"), i = H(e, "reason"), a = e.assigneeChanged === !1 ? "原座位" : "原簽核人", o = i?.trim();
449
- return [[n ? `${a}:${q(n, t)}` : null, r ? `改派給:${q(r, t)}` : null].filter(W).join(" → "), o ? `原因:${o}` : null].filter(W).join(" · ") || null;
448
+ function ln(e, t) {
449
+ let n = V(e, "fromMemberId"), r = V(e, "toMemberId"), i = V(e, "reason"), a = e.assigneeChanged === !1 ? "原座位" : "原簽核人", o = i?.trim();
450
+ return [[n ? `${a}:${q(n, t)}` : null, r ? `改派給:${q(r, t)}` : null].filter(U).join(" → "), o ? `原因:${o}` : null].filter(U).join(" · ") || null;
450
451
  }
451
- function sn(e, t, n, r) {
452
- if (e.eventType === "INSTANCE_STARTED") return Tt({
452
+ function un(e, t, n, r) {
453
+ if (e.eventType === "INSTANCE_STARTED") return kt({
453
454
  initiatorMemberId: e.actorMemberId,
454
- submittedByMemberId: H(t, "submittedByMemberId")
455
+ submittedByMemberId: V(t, "submittedByMemberId")
455
456
  }, r);
456
- if (e.eventType === "TASK_REASSIGNED") return on(t, r);
457
+ if (e.eventType === "TASK_REASSIGNED") return ln(t, r);
457
458
  if (e.eventType === "TASK_CANDIDATE_ACTIVATED") {
458
- let e = H(t, "candidateMemberId"), n = H(t, "previousMemberId");
459
+ let e = V(t, "candidateMemberId"), n = V(t, "previousMemberId");
459
460
  if (!e) return null;
460
461
  let i = q(e, r);
461
462
  return n ? `輪到:${i}(前一位:${q(n, r)})` : `輪到:${i}`;
462
463
  }
463
464
  if (e.eventType === "TASK_CREATED") {
464
- let e = Ot(t, "sequentialCandidateMemberIds");
465
+ let e = H(t, "sequentialCandidateMemberIds");
465
466
  if (e.length) return `簽核順序:${e.map((e) => q(e, r)).join(" → ")}`;
466
- let n = H(t, "assigneeMemberId"), i = H(t, "originalAssigneeMemberId");
467
+ let n = V(t, "assigneeMemberId"), i = V(t, "originalAssigneeMemberId");
467
468
  if (!n) {
468
- let e = Ot(t, "candidateMemberIds");
469
+ let e = H(t, "candidateMemberIds");
469
470
  return e.length ? `候選簽核人:${e.map((e) => q(e, r)).join("、")}` : null;
470
471
  }
471
472
  let a = q(n, r), o = q(i, r);
472
473
  return i && i !== n ? `待簽人:${a}(原簽核人:${o})` : `待簽人:${a}`;
473
474
  }
474
475
  if (e.eventType === "TASK_DECIDED") {
475
- let e = H(t, "action"), n = H(t, "comment"), i = e ? `決議:${Nt(e)}` : null, a = H(t, "transferToMemberId");
476
- return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(W).join(" · ") : e === "APPROVED" && n ? [i, `同意說明:${n}`].filter(W).join(" · ") : e === "TRANSFERRED" ? [i, `轉派給:${q(a, r)}`].filter(W).join(" · ") : i;
476
+ let e = V(t, "action"), n = V(t, "comment"), i = e ? `決議:${It(e)}` : null, a = V(t, "transferToMemberId");
477
+ return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(U).join(" · ") : e === "APPROVED" && n ? [i, `同意說明:${n}`].filter(U).join(" · ") : e === "TRANSFERRED" ? [i, `轉派給:${q(a, r)}`].filter(U).join(" · ") : i;
477
478
  }
478
479
  if (e.eventType === "TOKEN_ADVANCED") {
479
- let e = H(t, "action");
480
- if (e) return `流程結果:${Nt(e)}`;
481
- let r = U(t, "arrivedCount"), i = U(t, "requiredCount");
480
+ let e = V(t, "action");
481
+ if (e) return `流程結果:${It(e)}`;
482
+ let r = Mt(t, "arrivedCount"), i = Mt(t, "requiredCount");
482
483
  if (r !== null && i !== null) return `等待匯合:${r}/${i}`;
483
- let a = H(t, "fromNodeId"), o = H(t, "toNodeId");
484
- if (a && o) return `由 ${Ft(a, n)} 前進至 ${Ft(o, n)}`;
484
+ let a = V(t, "fromNodeId"), o = V(t, "toNodeId");
485
+ if (a && o) return `由 ${Rt(a, n)} 前進至 ${Rt(o, n)}`;
485
486
  }
486
487
  if (e.eventType === "ENGINE_PROCESS_REQUESTED") {
487
- let e = H(t, "state");
488
- return e ? `案件狀態:${Mt(e)}` : null;
488
+ let e = V(t, "state");
489
+ return e ? `案件狀態:${Pt(e)}` : null;
489
490
  }
490
491
  return null;
491
492
  }
492
- function cn(e, t, n, r, i, a, o, s = null, c = null) {
493
- if (e.eventType === "INSTANCE_RESUBMITTED") return [Kt("簽核意見", H(t, "comment"))].filter(Z);
494
- if (e.eventType !== "TASK_DECIDED") return [Y(sn(e, t, n, o))].filter(Z);
495
- let l = ln(e, t, r, c), u = H(t, "action") ?? l?.action ?? null, d = H(t, "comment") ?? l?.comment ?? null, f = H(t, "transferToMemberId") ?? l?.transferToMemberId ?? null, p = H(t, "signatureId") ?? l?.signatureId ?? null, m = p ? i.get(p) : null;
493
+ function dn(e, t, n, r, i, a, o, s = null, c = null) {
494
+ if (e.eventType === "INSTANCE_RESUBMITTED") return [Yt("簽核意見", V(t, "comment"))].filter(Q);
495
+ if (e.eventType !== "TASK_DECIDED") return [Y(un(e, t, n, o))].filter(Q);
496
+ let l = fn(e, t, r, c), u = V(t, "action") ?? l?.action ?? null, d = V(t, "comment") ?? l?.comment ?? null, f = V(t, "transferToMemberId") ?? l?.transferToMemberId ?? null, p = V(t, "signatureId") ?? l?.signatureId ?? null, m = p ? i.get(p) : null;
496
497
  return [
497
- Y(u ? `決議:${Nt(u)}` : null),
498
- u === "REJECTED" ? Kt("拒絕原因", d ?? "-", "danger") : null,
499
- u === "APPROVED" ? Kt("同意說明", d) : null,
500
- u === "RETURNED" ? Kt("退回說明", d ?? "-") : null,
498
+ Y(u ? `決議:${It(u)}` : null),
499
+ u === "REJECTED" ? Yt("拒絕原因", d ?? "-", "danger") : null,
500
+ u === "APPROVED" ? Yt("同意說明", d) : null,
501
+ u === "RETURNED" ? Yt("退回說明", d ?? "-") : null,
501
502
  u === "TRANSFERRED" ? Y(`轉派給:${q(f, o)}`) : null,
502
- u === "TRANSFERRED" ? Kt("轉派說明", d ?? "-") : null,
503
- Y(dn(t, s)),
504
- m ? Y(a?.valid ? `簽章:已驗證(${G(m.signedPayloadHash)})` : `簽章:待檢查(${G(m.signedPayloadHash)})`) : null
505
- ].filter(Z);
503
+ u === "TRANSFERRED" ? Yt("轉派說明", d ?? "-") : null,
504
+ Y(mn(t, s)),
505
+ m ? Y(a?.valid ? `簽章:已驗證(${K(m.signedPayloadHash)})` : `簽章:待檢查(${K(m.signedPayloadHash)})`) : null
506
+ ].filter(Q);
506
507
  }
507
- function ln(e, t, n, r) {
508
+ function fn(e, t, n, r) {
508
509
  let i = e.taskId;
509
510
  if (!i) return null;
510
- let a = H(t, "decisionId"), o = (t) => a ? t.id === a : t.decidedByMemberId === e.actorMemberId;
511
+ let a = V(t, "decisionId"), o = (t) => a ? t.id === a : t.decidedByMemberId === e.actorMemberId;
511
512
  if (!r) {
512
513
  let e = n.get(i) ?? null;
513
514
  return e && o(e) ? e : null;
514
515
  }
515
- return un(r.filter((e) => e.taskId === i && o(e)), new Date(e.createdAt).getTime());
516
+ return pn(r.filter((e) => e.taskId === i && o(e)), new Date(e.createdAt).getTime());
516
517
  }
517
- function un(e, t) {
518
+ function pn(e, t) {
518
519
  let n = (e) => Math.abs(d(e) - t), r = (e, t) => {
519
520
  let r = n(e) - n(t);
520
521
  return r < 0 || !(r > 0) && f(e, t) < 0;
521
522
  };
522
523
  return e.reduce((e, t) => !e || r(t, e) ? t : e, null);
523
524
  }
524
- function dn(e, t) {
525
+ function mn(e, t) {
525
526
  let n = e.changedFieldKeys;
526
527
  if (!Array.isArray(n)) return null;
527
528
  let r = n.filter((e) => typeof e == "string" && e !== "");
@@ -529,87 +530,87 @@ function dn(e, t) {
529
530
  let i = r.map((e) => t?.fields.find((t) => t.fieldKey === e)?.label || e);
530
531
  return `補填 ${r.length} 個欄位:${i.join("、")}`;
531
532
  }
532
- function fn(e, t, n, r, i) {
533
+ function hn(e, t, n, r, i) {
533
534
  if (e.type === "startEvent" || i.has(e.id)) return !1;
534
535
  if (r === "REJECTED") return !0;
535
- let a = xn(e, t, n, r);
536
+ let a = wn(e, t, n, r);
536
537
  return a.tone === "neutral" || a.tone === "waiting";
537
538
  }
538
- function pn(e, t, n, r, i) {
539
+ function gn(e, t, n, r, i) {
539
540
  if (r !== "RUNNING" && r !== "REJECTED") return [];
540
- let a = e.nodes.filter((e) => fn(e, t, n, r, i)), o = mn(e, a, t, n, i), s = new Map(e.nodes.map((e, t) => [e.id, t]));
541
+ let a = e.nodes.filter((e) => hn(e, t, n, r, i)), o = _n(e, a, t, n, i), s = new Map(e.nodes.map((e, t) => [e.id, t]));
541
542
  return a.filter((e) => o.has(e.id)).sort((e, t) => {
542
543
  let n = o.get(e.id) ?? 0, r = o.get(t.id) ?? 0;
543
544
  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;
544
545
  });
545
546
  }
546
- function mn(e, t, n, r, i) {
547
+ function _n(e, t, n, r, i) {
547
548
  let a = new Set(t.map((e) => e.id)), o = e.edges.reduce((e, t) => {
548
549
  let n = [...e.get(t.source) ?? [], t.target];
549
550
  return new Map(e).set(t.source, n);
550
551
  }, /* @__PURE__ */ new Map());
551
- return hn(e, n, r, i).reduce((e, t) => vn(e, gn(t, o, a)), /* @__PURE__ */ new Map());
552
+ return vn(e, n, r, i).reduce((e, t) => xn(e, yn(t, o, a)), /* @__PURE__ */ new Map());
552
553
  }
553
- function hn(e, t, n, r) {
554
- let i = n.filter((e) => e.status === "ACTIVE" || e.status === "WAITING").map((e) => e.currentNodeId), a = t.filter(At).map((e) => e.nodeId), o = e.nodes.filter((e) => r.has(e.id)).map((e) => e.id), s = [.../* @__PURE__ */ new Set([
554
+ function vn(e, t, n, r) {
555
+ 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([
555
556
  ...i,
556
557
  ...a,
557
558
  ...o
558
559
  ])], c = e.nodes.filter((e) => e.type === "startEvent").map((e) => e.id);
559
560
  return s.length > 0 ? s : c;
560
561
  }
561
- function gn(e, t, n) {
562
- return _n([{
562
+ function yn(e, t, n) {
563
+ return bn([{
563
564
  distance: 0,
564
565
  nodeId: e
565
566
  }], t, n);
566
567
  }
567
- function _n(e, t, n, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map()) {
568
+ function bn(e, t, n, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map()) {
568
569
  let [a, ...o] = e;
569
570
  if (!a) return i;
570
- if (r.has(a.nodeId)) return _n(o, t, n, r, i);
571
+ if (r.has(a.nodeId)) return bn(o, t, n, r, i);
571
572
  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;
572
- return _n([...o, ...(t.get(a.nodeId) ?? []).map((e) => ({
573
+ return bn([...o, ...(t.get(a.nodeId) ?? []).map((e) => ({
573
574
  distance: a.distance + 1,
574
575
  nodeId: e
575
576
  }))], t, n, s, c);
576
577
  }
577
- function vn(e, t) {
578
+ function xn(e, t) {
578
579
  return [...t.entries()].reduce((e, [t, n]) => new Map(e).set(t, Math.min(e.get(t) ?? n, n)), e);
579
580
  }
580
- function yn(e) {
581
+ function Sn(e) {
581
582
  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}`;
582
583
  }
583
584
  function $(e, t, n, r, i, a, o, s, c, u = null, d = null) {
584
- let f = d ? l(d) : null, p = e.filter(Jt).map((e) => {
585
- let t = nn(e), n = e.nodeId ? Ft(e.nodeId, r) : null;
585
+ let f = d ? l(d) : null, p = e.filter(Zt).map((e) => {
586
+ let t = on(e), n = e.nodeId ? Rt(e.nodeId, r) : null;
586
587
  return {
587
588
  descriptionParts: [
588
589
  Y(n ? `節點:${n}` : "節點:全流程"),
589
- qt("操作者", e.actorMemberId, a, "系統"),
590
- Y(`時間:${an(e.createdAt)}`),
591
- ...cn(e, t, r, o, s, c, a, u, f ? f.get(e.taskId ?? "") ?? [] : null)
592
- ].filter(Z),
593
- error: rn(e, t),
590
+ X("操作者", e.actorMemberId, a, "系統"),
591
+ Y(`時間:${cn(e.createdAt)}`),
592
+ ...dn(e, t, r, o, s, c, a, u, f ? f.get(e.taskId ?? "") ?? [] : null)
593
+ ].filter(Q),
594
+ error: sn(e, t),
594
595
  id: e.id,
595
- title: tn(e.eventType, t)
596
+ title: an(e.eventType, t)
596
597
  };
597
- }), m = t.filter(At).map((e) => ({
598
+ }), m = t.filter(Nt).map((e) => ({
598
599
  descriptionParts: [
599
- Y(`節點:${Ft(e.nodeId, r)}`),
600
- qt("處理者", e.assigneeMemberId, a, "未指定"),
601
- X(e, a),
602
- Y(`建立時間:${an(e.createdAt)}`)
603
- ].filter(Z),
600
+ Y(`節點:${Rt(e.nodeId, r)}`),
601
+ X("處理者", e.assigneeMemberId, a, "未指定"),
602
+ Z(e, a),
603
+ Y(`建立時間:${cn(e.createdAt)}`)
604
+ ].filter(Q),
604
605
  error: !1,
605
606
  id: `pending-task-${e.id}`,
606
607
  title: e.status === "IN_PROGRESS" ? "簽核處理中" : "等待簽核處理"
607
- })), h = new Set([...e.filter(Jt).map((e) => e.nodeId), ...t.map((e) => e.nodeId)].filter(W)), g = r ? pn(r, t, n, i, h).map((e) => ({
608
- descriptionParts: [Y(`${Pt(e.type)} · 尚未抵達`)].filter(Z),
608
+ })), h = new Set([...e.filter(Zt).map((e) => e.nodeId), ...t.map((e) => e.nodeId)].filter(U)), g = r ? gn(r, t, n, i, h).map((e) => ({
609
+ descriptionParts: [Y(`${Lt(e.type)} · 尚未抵達`)].filter(Q),
609
610
  error: !1,
610
611
  forcePending: !0,
611
612
  id: `future-node-${e.id}`,
612
- title: yn(e)
613
+ title: Sn(e)
613
614
  })) : [];
614
615
  return [
615
616
  ...p,
@@ -617,7 +618,7 @@ function $(e, t, n, r, i, a, o, s, c, u = null, d = null) {
617
618
  ...g
618
619
  ];
619
620
  }
620
- var bn = {
621
+ var Cn = {
621
622
  APPROVED: {
622
623
  statusLabel: "已完成",
623
624
  tone: "completed"
@@ -635,20 +636,20 @@ var bn = {
635
636
  tone: "cancelled"
636
637
  }
637
638
  };
638
- function xn(e, t, n, r) {
639
+ function wn(e, t, n, r) {
639
640
  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");
640
641
  if (a) return {
641
- secondaryLabel: `處理者 ${Rt(a)}`,
642
+ secondaryLabel: `處理者 ${Vt(a)}`,
642
643
  statusLabel: "待處理",
643
644
  tone: "current"
644
645
  };
645
646
  if (o) return {
646
- secondaryLabel: `已取消 ${Rt(o)}`,
647
+ secondaryLabel: `已取消 ${Vt(o)}`,
647
648
  statusLabel: "已取消",
648
649
  tone: "cancelled"
649
650
  };
650
651
  if (s) return {
651
- secondaryLabel: `已完成 ${Rt(s)}`,
652
+ secondaryLabel: `已完成 ${Vt(s)}`,
652
653
  statusLabel: "已完成",
653
654
  tone: "completed"
654
655
  };
@@ -667,56 +668,56 @@ function xn(e, t, n, r) {
667
668
  statusLabel: "已發起",
668
669
  tone: "completed"
669
670
  };
670
- let d = e.type === "endEvent" ? bn[r] : void 0;
671
+ let d = e.type === "endEvent" ? Cn[r] : void 0;
671
672
  return d ? {
672
673
  ...d,
673
674
  secondaryLabel: r
674
675
  } : {
675
- secondaryLabel: Pt(e.type),
676
+ secondaryLabel: Lt(e.type),
676
677
  statusLabel: "未抵達",
677
678
  tone: "neutral"
678
679
  };
679
680
  }
680
681
  // src/views/instances/detail/sections/container-helpers.ts
681
- async function Sn({ activityLogs: e, adhocDirectives: t = [], instance: n, tasks: r }) {
682
+ async function Tn({ activityLogs: e, adhocDirectives: t = [], instance: n, tasks: r }) {
682
683
  let i = [...new Set([
683
684
  n?.initiatorMemberId ?? null,
684
685
  n?.submittedByMemberId ?? null,
685
686
  ...e.map((e) => e.actorMemberId),
686
- ...e.flatMap(Xt),
687
+ ...e.flatMap($t),
687
688
  ...r.map((e) => e.assigneeMemberId),
688
689
  ...r.map((e) => e.originalAssigneeMemberId),
689
690
  ...r.flatMap((e) => e.candidateMemberIds),
690
- ...r.flatMap((e) => Dt(e.delegationChainJson).flatMap((e) => [e.from, e.to])),
691
- ...t.flatMap((e) => [e.createdByMemberId, ...Cn(e.targetValueJson)])
692
- ].filter(W))];
691
+ ...r.flatMap((e) => jt(e.delegationChainJson).flatMap((e) => [e.from, e.to])),
692
+ ...t.flatMap((e) => [e.createdByMemberId, ...En(e.targetValueJson)])
693
+ ].filter(U))];
693
694
  try {
694
- return await Be(i);
695
+ return await Ve(i);
695
696
  } catch {
696
697
  return [];
697
698
  }
698
699
  }
699
- function Cn(e) {
700
+ function En(e) {
700
701
  try {
701
702
  return (JSON.parse(e).memberIds ?? []).filter((e) => typeof e == "string");
702
703
  } catch {
703
704
  return [];
704
705
  }
705
706
  }
706
- async function wn(e) {
707
- return (await Promise.all(e.map((e) => Me(e.id)))).flat();
707
+ async function Dn(e) {
708
+ return (await Promise.all(e.map((e) => Ne(e.id)))).flat();
708
709
  }
709
710
  // src/views/instances/detail/use-resubmit-comment-draft.ts
710
- function Tn(e) {
711
+ function On(e) {
711
712
  let [t, n] = x({
712
713
  instanceId: e,
713
714
  text: ""
714
- }), r = ce((t) => n({
715
+ }), r = ue((t) => n({
715
716
  instanceId: e,
716
717
  text: t
717
718
  }), [e]);
718
719
  return {
719
- clearAfterResubmit: ce((e) => n((t) => t.instanceId === e ? {
720
+ clearAfterResubmit: ue((e) => n((t) => t.instanceId === e ? {
720
721
  instanceId: e,
721
722
  text: ""
722
723
  } : t), []),
@@ -725,50 +726,50 @@ function Tn(e) {
725
726
  };
726
727
  }
727
728
  // src/views/instances/detail/sections/InstanceFormSection.tsx
728
- var En = {
729
+ var kn = {
729
730
  display: "grid",
730
731
  gap: 16
731
- }, Dn = {
732
+ }, An = {
732
733
  display: "flex",
733
734
  flexWrap: "wrap",
734
735
  gap: 8
735
- }, On = 2e3, kn = {
736
+ }, jn = 2e3, Mn = {
736
737
  minWidth: "100%",
737
738
  width: "100%"
738
739
  };
739
- function An(e) {
740
+ function Nn(e) {
740
741
  e && (e.style.width = "100%");
741
742
  }
742
- function jn({ attachments: t, canResubmitInstance: n, deciding: r, error: i, fieldAccess: a, fieldLabelMarkers: o, fill: c = null, instance: l, loading: u, onDataSourceStateChange: d, onDownloadAttachment: f, onFileUploadStateChange: p, onResubmitFormChange: m, onReloadAfterConflict: h = null, onResubmitCommentChange: g = null, onResubmitInstance: ee, onUploadAttachment: te, resubmitComment: ne = "", resubmitFormData: re, resubmitFormErrors: ie }) {
743
- let oe = l?.formDefinitionSnapshot.schema, _ = l?.workflowSnapshot, v = b(() => n && oe && _ ? ae(oe, _) : c?.schema ?? oe, [
743
+ function Pn({ attachments: t, canResubmitInstance: n, deciding: r, error: i, fieldAccess: a, fieldLabelMarkers: o, fill: c = null, instance: l, loading: u, onDataSourceStateChange: d, onDownloadAttachment: f, onFileUploadStateChange: p, onResubmitFormChange: m, onReloadAfterConflict: h = null, onResubmitCommentChange: g = null, onResubmitInstance: ee, onUploadAttachment: te, resubmitComment: re = "", resubmitFormData: ie, resubmitFormErrors: ae }) {
744
+ let oe = l?.formDefinitionSnapshot.schema, _ = l?.workflowSnapshot, se = b(() => n && oe && _ ? ne(oe, _) : c?.schema ?? oe, [
744
745
  n,
745
746
  c?.schema,
746
747
  oe,
747
748
  _
748
- ]), se = !n && c !== null;
749
- return /* @__PURE__ */ k("div", {
750
- style: En,
749
+ ]), v = !n && c !== null;
750
+ return /* @__PURE__ */ j("div", {
751
+ style: kn,
751
752
  children: [
752
- i ? /* @__PURE__ */ O(E, {
753
+ i ? /* @__PURE__ */ A(O, {
753
754
  color: "text-error",
754
755
  variant: "body",
755
756
  children: i
756
757
  }) : null,
757
- u ? /* @__PURE__ */ O(E, {
758
+ u ? /* @__PURE__ */ A(O, {
758
759
  color: "text-neutral",
759
760
  variant: "body",
760
761
  children: "載入中..."
761
762
  }) : null,
762
- h ? /* @__PURE__ */ k("div", {
763
- style: En,
764
- children: [/* @__PURE__ */ O(he, {
763
+ h ? /* @__PURE__ */ j("div", {
764
+ style: kn,
765
+ children: [/* @__PURE__ */ A(_e, {
765
766
  content: "表單在你填寫期間被更新了,你填的內容還在。請重新載入後確認再同意。",
766
767
  severity: "error"
767
- }), /* @__PURE__ */ O("div", {
768
- style: Dn,
769
- children: /* @__PURE__ */ O(S, {
768
+ }), /* @__PURE__ */ A("div", {
769
+ style: An,
770
+ children: /* @__PURE__ */ A(S, {
770
771
  disabled: u,
771
- icon: it,
772
+ icon: I,
772
773
  iconType: "leading",
773
774
  onClick: h,
774
775
  variant: "base-secondary",
@@ -776,61 +777,62 @@ function jn({ attachments: t, canResubmitInstance: n, deciding: r, error: i, fie
776
777
  })
777
778
  })]
778
779
  }) : null,
779
- se && c.fieldCount > 0 ? /* @__PURE__ */ O(he, {
780
+ v && c.fieldCount > 0 ? /* @__PURE__ */ A(_e, {
780
781
  content: `本關需要你補填 ${c.fieldCount} 個欄位,按「同意」時會一起送出並納入簽章。`,
781
782
  severity: "info"
782
783
  }) : null,
783
- v && l?.formDefinitionSnapshot.uiSchema ? /* @__PURE__ */ k(D, { children: [
784
- /* @__PURE__ */ O(s, {
784
+ se && l?.formDefinitionSnapshot.uiSchema ? /* @__PURE__ */ j(k, { children: [
785
+ /* @__PURE__ */ A(s, {
785
786
  attachments: t,
786
- dataSourceContext: n ? {
787
+ dataSourceContext: n || v ? {
787
788
  instanceId: l.id,
788
789
  kind: "runtime"
789
790
  } : void 0,
790
791
  dataSourceInitialValues: l.formData,
791
- errors: se ? c.errors : ie,
792
+ errors: v ? c.errors : ae,
792
793
  ...!n && a ? { fieldAccess: a } : {},
793
794
  ...!n && o ? { fieldLabelMarkers: o } : {},
795
+ ...v && c.tableAccess ? { tableAccess: c.tableAccess } : {},
794
796
  onChange: (e) => {
795
- se ? c.onChange(e) : m(e);
797
+ v ? c.onChange(e) : m(e);
796
798
  },
797
799
  onDataSourceStateChange: d,
798
800
  onDownloadAttachment: f,
799
801
  onFileUploadStateChange: p,
800
802
  onUploadAttachment: n ? te : void 0,
801
803
  optionSnapshots: l.formDataOptionSnapshot,
802
- readonly: !n,
803
- schema: v,
804
+ readonly: !n && !v,
805
+ schema: se,
804
806
  uiSchema: l.formDefinitionSnapshot.uiSchema,
805
- value: n ? re : se ? c.value : l.formData
807
+ value: n ? ie : v ? c.value : l.formData
806
808
  }),
807
- n && g ? /* @__PURE__ */ O(e, {
809
+ n && g ? /* @__PURE__ */ A(e, {
808
810
  label: "簽核意見",
809
811
  name: "resubmitComment",
810
- children: /* @__PURE__ */ O(Ce, {
812
+ children: /* @__PURE__ */ A(Ce, {
811
813
  disabled: r,
812
814
  onChange: (e) => g(e.target.value),
813
815
  placeholder: "選填,例如說明這次補正或修改了哪些內容",
814
- maxLength: On,
815
- ref: An,
816
+ maxLength: jn,
817
+ ref: Nn,
816
818
  resize: "vertical",
817
819
  rows: 4,
818
- style: kn,
819
- value: ne
820
+ style: Mn,
821
+ value: re
820
822
  })
821
823
  }) : null,
822
- n ? /* @__PURE__ */ O("div", {
823
- style: Dn,
824
- children: /* @__PURE__ */ O(S, {
824
+ n ? /* @__PURE__ */ A("div", {
825
+ style: An,
826
+ children: /* @__PURE__ */ A(S, {
825
827
  disabled: r,
826
- icon: it,
828
+ icon: I,
827
829
  iconType: "leading",
828
830
  onClick: ee,
829
831
  variant: "base-primary",
830
832
  children: "重新送出"
831
833
  })
832
834
  }) : null
833
- ] }) : /* @__PURE__ */ O(E, {
835
+ ] }) : /* @__PURE__ */ A(O, {
834
836
  color: "text-neutral",
835
837
  variant: "body",
836
838
  children: "此案件沒有可顯示的表單快照。"
@@ -839,11 +841,11 @@ function jn({ attachments: t, canResubmitInstance: n, deciding: r, error: i, fie
839
841
  });
840
842
  }
841
843
  // src/views/instances/detail/sections/InstanceAttachmentsSection.tsx
842
- var Mn = {
844
+ var Fn = {
843
845
  display: "grid",
844
846
  gap: 16
845
847
  };
846
- function Nn({ attachments: e, onDownload: n, onPreview: r }) {
848
+ function In({ attachments: e, onDownload: n, onPreview: r }) {
847
849
  let i = b(() => e.map((e) => ({
848
850
  attachment: e,
849
851
  createdAt: e.createdAt,
@@ -851,7 +853,7 @@ function Nn({ attachments: e, onDownload: n, onPreview: r }) {
851
853
  id: e.id,
852
854
  key: e.id,
853
855
  mimeType: e.mimeType,
854
- sizeLabel: jt(Number(e.sizeBytes))
856
+ sizeLabel: G(Number(e.sizeBytes))
855
857
  })), [e]), a = b(() => [
856
858
  {
857
859
  dataIndex: "filename",
@@ -873,7 +875,7 @@ function Nn({ attachments: e, onDownload: n, onPreview: r }) {
873
875
  },
874
876
  {
875
877
  key: "createdAt",
876
- render: (e) => /* @__PURE__ */ O(E, {
878
+ render: (e) => /* @__PURE__ */ A(O, {
877
879
  component: "span",
878
880
  variant: "body",
879
881
  children: t(e.createdAt)
@@ -883,14 +885,14 @@ function Nn({ attachments: e, onDownload: n, onPreview: r }) {
883
885
  }
884
886
  ], []), o = b(() => ({
885
887
  render: (e) => [...e.mimeType === "application/pdf" ? [{
886
- icon: tt,
888
+ icon: nt,
887
889
  iconType: "leading",
888
890
  name: "預覽",
889
891
  onClick: () => {
890
892
  r(e.attachment);
891
893
  }
892
894
  }] : [], {
893
- icon: N,
895
+ icon: tt,
894
896
  iconType: "leading",
895
897
  name: "下載",
896
898
  onClick: () => {
@@ -900,18 +902,18 @@ function Nn({ attachments: e, onDownload: n, onPreview: r }) {
900
902
  variant: "base-secondary",
901
903
  width: 160
902
904
  }), [n, r]);
903
- return /* @__PURE__ */ k("div", {
904
- style: Mn,
905
- children: [/* @__PURE__ */ O(E, {
905
+ return /* @__PURE__ */ j("div", {
906
+ style: Fn,
907
+ children: [/* @__PURE__ */ A(O, {
906
908
  component: "h2",
907
909
  variant: "h3",
908
910
  children: "附件"
909
- }), i.length > 0 ? /* @__PURE__ */ O(Se, {
911
+ }), i.length > 0 ? /* @__PURE__ */ A(D, {
910
912
  actions: o,
911
913
  columns: a,
912
914
  dataSource: i,
913
915
  fullWidth: !0
914
- }) : /* @__PURE__ */ O(E, {
916
+ }) : /* @__PURE__ */ A(O, {
915
917
  color: "text-neutral",
916
918
  variant: "body",
917
919
  children: "此案件沒有附件。"
@@ -919,58 +921,58 @@ function Nn({ attachments: e, onDownload: n, onPreview: r }) {
919
921
  });
920
922
  }
921
923
  // src/views/instances/detail/sections/InstanceTasksSection.tsx
922
- var Pn = {
924
+ var Ln = {
923
925
  display: "grid",
924
926
  gap: 12,
925
927
  width: "100%"
926
- }, Fn = {
928
+ }, Rn = {
927
929
  minWidth: "100%",
928
930
  width: "100%"
929
- }, In = {
931
+ }, zn = {
930
932
  display: "grid",
931
933
  gap: 12,
932
934
  width: "100%"
933
- }, Ln = { marginTop: 12 }, Rn = { marginTop: 24 };
934
- function zn(e) {
935
+ }, Bn = { marginTop: 12 }, Vn = { marginTop: 24 };
936
+ function Hn(e) {
935
937
  e && (e.style.width = "100%");
936
938
  }
937
- var Bn = {
939
+ var Un = {
938
940
  COMPLETION_NOTIFY: "結案通知",
939
941
  COUNTERSIGN: "臨時會簽",
940
942
  PRE_APPROVAL: "臨時加簽",
941
943
  STAGE_NOTIFY: "階段完成通知"
942
- }, Vn = {
944
+ }, Wn = {
943
945
  COMPLETION_NOTIFY: "本張單到達結案狀態(核准 / 拒絕 / 取消)後,通知指定對象。",
944
946
  COUNTERSIGN: "指定對象會併入下一層簽核,下一層需所有人都完成才會繼續。",
945
947
  PRE_APPROVAL: "指定對象需先完成加簽,本階段才會往下一層繼續。",
946
948
  STAGE_NOTIFY: "本階段完成後(不論通過與否)通知指定對象。"
947
- }, Hn = [{
949
+ }, Gn = [{
948
950
  id: "REJECT_INSTANCE",
949
951
  name: "加簽拒絕時整單駁回"
950
952
  }, {
951
953
  id: "RETURN_TO_ORIGIN",
952
954
  name: "加簽拒絕時退回給我重新處理"
953
- }], Un = [{
955
+ }], Kn = [{
954
956
  id: "MEMBER",
955
957
  name: "指定成員"
956
958
  }, {
957
959
  id: "WEBHOOK",
958
960
  name: "Webhook"
959
- }], Wn = y(function({ adhocDirectives: n, currentMemberId: r, fill: i = null, instance: a, memberProfilesById: o, onChanged: s, onDecidingChange: c, onFillApproveError: l, tasks: d }, f) {
961
+ }], qn = y(function({ adhocDirectives: n, currentMemberId: r, fill: i = null, instance: a, memberProfilesById: o, onChanged: s, onDecidingChange: c, onFillApproveError: l, tasks: d }, f) {
960
962
  let [p, m] = x(!1), [h, g] = x(null);
961
- le(() => {
963
+ de(() => {
962
964
  c?.(p);
963
965
  }, [p, c]);
964
- let [ee, te] = x(""), [ne, re] = x(!1), [ie, ae] = x(""), [oe, v] = x(null), [se, y] = x(!1), [ce, de] = x(""), [he, _e] = x(!1), [ve, T] = x(null), [ye, xe] = x(""), [we, De] = x(null), [Ae, je] = x(!1), [Me, Ne] = x([]), [Pe, Fe] = x(!1), [Ie, Le] = x(""), [Be, Ve] = x([]), [He, We] = x(!1), [Ge, Ke] = x([]), [j, qe] = x(!1), [M, Je] = x("COUNTERSIGN"), [Ye, Xe] = x("REJECT_INSTANCE"), [Ze, Qe] = x(!1), [$e, et] = x("MEMBER"), [N, tt] = x(""), nt = ie.trim(), rt = ee.trim(), it = ce.trim(), at = ye.trim(), P = b(() => Bt(d, r), [r, d]), F = b(() => P && a ? a.workflowSnapshot.nodes.find((e) => e.id === P.nodeId) ?? null : null, [P, a]), ot = b(() => F && a ? J(a.workflowSnapshot, F) : [], [F, a]), st = F?.type === "userTask" && F.data.returnBehavior.allowReturn, ct = F?.type === "userTask" && F.data.allowReject !== !1, lt = F?.type === "userTask" && F.data.allowTransfer !== !1, ut = F?.type === "userTask" && F.data.returnBehavior.requireComment === !0, I = F?.type === "userTask" && F.data.requireApprovalComment === !0, L = I && !rt, dt = F?.type === "userTask" && F.data.allowAddSigner, ft = b(() => n.filter((e) => e.status === "PENDING"), [n]), pt = ot.find((e) => e.id === ve) ?? ot[0] ?? null, mt = b(() => d.map((e) => ({
966
+ let [ee, te] = x(""), [ne, re] = x(!1), [ie, ae] = x(""), [oe, _] = x(null), [se, ce] = x(!1), [le, y] = x(""), [ue, pe] = x(!1), [_e, w] = x(null), [ye, E] = x(""), [be, Se] = x(null), [we, Oe] = x(!1), [je, Me] = x([]), [Ne, Pe] = x(!1), [Fe, Ie] = x(""), [Le, Re] = x([]), [Ve, He] = x(!1), [Ue, Ge] = x([]), [Ke, N] = x(!1), [P, qe] = x("COUNTERSIGN"), [Je, Ye] = x("REJECT_INSTANCE"), [Xe, Ze] = x(!1), [Qe, $e] = x("MEMBER"), [F, et] = x(""), tt = ie.trim(), nt = ee.trim(), rt = le.trim(), it = ye.trim(), I = b(() => Ht(d, r), [r, d]), L = b(() => I && a ? a.workflowSnapshot.nodes.find((e) => e.id === I.nodeId) ?? null : null, [I, a]), at = b(() => L && a ? Ut(a.workflowSnapshot, L) : [], [L, a]), ot = L?.type === "userTask" && L.data.returnBehavior.allowReturn, st = L?.type === "userTask" && L.data.allowReject !== !1, ct = L?.type === "userTask" && L.data.allowTransfer !== !1, lt = L?.type === "userTask" && L.data.returnBehavior.requireComment === !0, ut = L?.type === "userTask" && L.data.requireApprovalComment === !0, dt = ut && !nt, ft = L?.type === "userTask" && L.data.allowAddSigner, R = b(() => n.filter((e) => e.status === "PENDING"), [n]), pt = at.find((e) => e.id === _e) ?? at[0] ?? null, mt = b(() => d.map((e) => ({
965
967
  ...e,
966
- assigneeLabel: Rt(e, o),
967
- fillFieldCount: Kn(e, a?.workflowSnapshot ?? null),
968
+ assigneeLabel: Vt(e, o),
969
+ fillFieldCount: Yn(e, a?.workflowSnapshot ?? null),
968
970
  key: e.id,
969
971
  nodeLabel: u({
970
972
  ...e,
971
- nodeLabel: Ft(e.nodeId, a?.workflowSnapshot ?? null)
973
+ nodeLabel: Rt(e.nodeId, a?.workflowSnapshot ?? null)
972
974
  }),
973
- statusLabel: K(e.status)
975
+ statusLabel: Ft(e.status)
974
976
  })), [
975
977
  a,
976
978
  o,
@@ -985,7 +987,7 @@ var Bn = {
985
987
  {
986
988
  key: "assigneeMemberId",
987
989
  title: "處理者",
988
- render: (e) => /* @__PURE__ */ O(E, {
990
+ render: (e) => /* @__PURE__ */ A(O, {
989
991
  component: "span",
990
992
  variant: "body",
991
993
  children: e.assigneeLabel
@@ -1000,7 +1002,7 @@ var Bn = {
1000
1002
  },
1001
1003
  {
1002
1004
  key: "fill",
1003
- render: (e) => e.fillFieldCount > 0 ? /* @__PURE__ */ O(pe, {
1005
+ render: (e) => e.fillFieldCount > 0 ? /* @__PURE__ */ A(he, {
1004
1006
  size: "sub",
1005
1007
  text: `需補填 ${e.fillFieldCount} 欄`,
1006
1008
  variant: "dot-warning"
@@ -1010,7 +1012,7 @@ var Bn = {
1010
1012
  },
1011
1013
  {
1012
1014
  key: "createdAt",
1013
- render: (e) => /* @__PURE__ */ O(E, {
1015
+ render: (e) => /* @__PURE__ */ A(O, {
1014
1016
  component: "span",
1015
1017
  variant: "body",
1016
1018
  children: t(e.createdAt)
@@ -1018,13 +1020,13 @@ var Bn = {
1018
1020
  title: "建立時間",
1019
1021
  width: 220
1020
1022
  }
1021
- ], []), R = b(() => ft.map((e) => ({
1023
+ ], []), gt = b(() => R.map((e) => ({
1022
1024
  ...e,
1023
1025
  createdByLabel: q(e.createdByMemberId, o),
1024
1026
  key: e.id,
1025
- targetLabel: Gn(e, o),
1026
- typeLabel: Bn[e.type]
1027
- })), [o, ft]), gt = b(() => [
1027
+ targetLabel: Jn(e, o),
1028
+ typeLabel: Un[e.type]
1029
+ })), [o, R]), _t = b(() => [
1028
1030
  {
1029
1031
  dataIndex: "typeLabel",
1030
1032
  key: "typeLabel",
@@ -1033,7 +1035,7 @@ var Bn = {
1033
1035
  },
1034
1036
  {
1035
1037
  key: "targetLabel",
1036
- render: (e) => /* @__PURE__ */ O(E, {
1038
+ render: (e) => /* @__PURE__ */ A(O, {
1037
1039
  component: "span",
1038
1040
  variant: "body",
1039
1041
  children: e.targetLabel
@@ -1043,7 +1045,7 @@ var Bn = {
1043
1045
  },
1044
1046
  {
1045
1047
  key: "createdByLabel",
1046
- render: (e) => /* @__PURE__ */ O(E, {
1048
+ render: (e) => /* @__PURE__ */ A(O, {
1047
1049
  component: "span",
1048
1050
  variant: "body",
1049
1051
  children: e.createdByLabel
@@ -1053,7 +1055,7 @@ var Bn = {
1053
1055
  },
1054
1056
  {
1055
1057
  key: "createdAt",
1056
- render: (e) => /* @__PURE__ */ O(E, {
1058
+ render: (e) => /* @__PURE__ */ A(O, {
1057
1059
  component: "span",
1058
1060
  variant: "body",
1059
1061
  children: t(e.createdAt)
@@ -1063,282 +1065,282 @@ var Bn = {
1063
1065
  },
1064
1066
  {
1065
1067
  key: "actions",
1066
- render: (e) => e.createdByMemberId === r ? /* @__PURE__ */ O(S, {
1067
- disabled: Ze,
1068
- onClick: () => void At(e.id),
1068
+ render: (e) => e.createdByMemberId === r ? /* @__PURE__ */ A(S, {
1069
+ disabled: Xe,
1070
+ onClick: () => void U(e.id),
1069
1071
  size: "minor",
1070
1072
  variant: "destructive-secondary",
1071
1073
  children: "撤回"
1072
- }) : /* @__PURE__ */ O(D, {}),
1074
+ }) : /* @__PURE__ */ A(k, {}),
1073
1075
  title: "操作",
1074
1076
  width: 100
1075
1077
  }
1076
- ], [Ze, r]);
1078
+ ], [Xe, r]);
1077
1079
  async function z({ action: e, comment: t, returnToNodeId: n = null, transferToMemberId: a = null }) {
1078
- if (!r || !P || e === "REJECTED" && !ct || e === "TRANSFERRED" && !lt) return !1;
1080
+ if (!r || !I || e === "REJECTED" && !st || e === "TRANSFERRED" && !ct) return !1;
1079
1081
  m(!0), g(null);
1080
- let o = e === "APPROVED" && i !== null && !P.isAdhoc ? {
1082
+ let o = e === "APPROVED" && i !== null && !I.isAdhoc ? {
1081
1083
  expectedFormDataFingerprint: i.expectedFormDataFingerprint,
1082
1084
  formData: i.formData
1083
1085
  } : null;
1084
1086
  try {
1085
- await A({
1087
+ await Ae({
1086
1088
  action: e,
1087
1089
  comment: t,
1088
1090
  decidedByMemberId: r,
1089
1091
  fill: o,
1090
1092
  returnToNodeId: n,
1091
- taskId: P.id,
1093
+ taskId: I.id,
1092
1094
  transferToMemberId: a
1093
- }), y(!1), _e(!1), Fe(!1), ae(""), de(""), xe(""), De(null), T(null), v(null);
1095
+ }), ce(!1), pe(!1), Pe(!1), ae(""), y(""), E(""), Se(null), w(null), _(null);
1094
1096
  } catch (e) {
1095
- return m(!1), o !== null && e instanceof Error && l?.(e.message, Te(e)) === !0 ? (re(!1), !1) : (g(_(e)), !1);
1097
+ return m(!1), o !== null && e instanceof Error && l?.(e.message, Te(e), Ee(e)) === !0 ? (re(!1), !1) : (g(v(e)), !1);
1096
1098
  }
1097
1099
  try {
1098
1100
  await s();
1099
1101
  } catch (e) {
1100
- g(_(e));
1102
+ g(v(e));
1101
1103
  } finally {
1102
1104
  m(!1);
1103
1105
  }
1104
1106
  return !0;
1105
1107
  }
1106
- function _t() {
1107
- r && P && (g(null), re(!0));
1108
- }
1109
1108
  function vt() {
1109
+ r && I && (g(null), re(!0));
1110
+ }
1111
+ function B() {
1110
1112
  p || (re(!1), te(""));
1111
1113
  }
1112
1114
  async function yt() {
1113
- p || L || await z({
1115
+ p || dt || await z({
1114
1116
  action: "APPROVED",
1115
- comment: rt || null
1117
+ comment: nt || null
1116
1118
  }) && (re(!1), te(""));
1117
1119
  }
1118
1120
  function bt() {
1119
- ct && (ae(""), v(null), y(!0));
1121
+ st && (ae(""), _(null), ce(!0));
1120
1122
  }
1121
1123
  function xt() {
1122
- p || (y(!1), ae(""), v(null));
1124
+ p || (ce(!1), ae(""), _(null));
1123
1125
  }
1124
1126
  function St() {
1125
- de(""), T(ot[0]?.id ?? null), _e(!0);
1126
- }
1127
- function B() {
1128
- p || (_e(!1), de(""), T(null));
1127
+ y(""), w(at[0]?.id ?? null), pe(!0);
1129
1128
  }
1130
1129
  function Ct() {
1131
- lt && (xe(""), De(null), Fe(!0), wt(""));
1130
+ p || (pe(!1), y(""), w(null));
1132
1131
  }
1133
- function V() {
1134
- p || (Fe(!1), xe(""), De(null));
1132
+ function wt() {
1133
+ ct && (E(""), Se(null), Pe(!0), Et(""));
1134
+ }
1135
+ function Tt() {
1136
+ p || (Pe(!1), E(""), Se(null));
1135
1137
  }
1136
- async function wt(e) {
1137
- je(!0);
1138
+ async function Et(e) {
1139
+ Oe(!0);
1138
1140
  try {
1139
- Ne((await Ue(e)).filter((e) => e.memberId !== r).map(Vt));
1141
+ Me((await We(e)).filter((e) => e.memberId !== r).map(Wt));
1140
1142
  } catch (e) {
1141
- g(_(e));
1143
+ g(v(e));
1142
1144
  } finally {
1143
- je(!1);
1145
+ Oe(!1);
1144
1146
  }
1145
1147
  }
1146
- async function Tt() {
1147
- ct && (nt ? await z({
1148
+ async function Dt() {
1149
+ st && (tt ? await z({
1148
1150
  action: "REJECTED",
1149
- comment: nt
1150
- }) : v("請輸入拒絕原因"));
1151
+ comment: tt
1152
+ }) : _("請輸入拒絕原因"));
1151
1153
  }
1152
- async function Et() {
1153
- lt && (we ? await z({
1154
+ async function Ot() {
1155
+ ct && (be ? await z({
1154
1156
  action: "TRANSFERRED",
1155
- comment: at || null,
1156
- transferToMemberId: we.id
1157
+ comment: it || null,
1158
+ transferToMemberId: be.id
1157
1159
  }) : g("請選擇轉派對象"));
1158
1160
  }
1159
- async function Dt() {
1161
+ async function kt() {
1160
1162
  await z({
1161
1163
  action: "RETURNED",
1162
- comment: it || null,
1164
+ comment: rt || null,
1163
1165
  returnToNodeId: pt?.id ?? null
1164
1166
  });
1165
1167
  }
1166
- function H() {
1167
- Le(""), Ve([]), Xe("REJECT_INSTANCE"), et("MEMBER"), tt("");
1168
+ function At() {
1169
+ Ie(""), Re([]), Ye("REJECT_INSTANCE"), $e("MEMBER"), et("");
1168
1170
  }
1169
- function Ot(e) {
1170
- Je(e), H(), qe(!0), W("");
1171
+ function jt(e) {
1172
+ qe(e), At(), N(!0), H("");
1171
1173
  }
1172
- function U() {
1173
- Ze || (qe(!1), H());
1174
+ function V() {
1175
+ Xe || (N(!1), At());
1174
1176
  }
1175
- async function W(e) {
1176
- We(!0);
1177
+ async function H(e) {
1178
+ He(!0);
1177
1179
  try {
1178
- Ke((await Ue(e)).map(Vt));
1180
+ Ge((await We(e)).map(Wt));
1179
1181
  } catch (e) {
1180
- g(_(e));
1182
+ g(v(e));
1181
1183
  } finally {
1182
- We(!1);
1184
+ He(!1);
1183
1185
  }
1184
1186
  }
1185
- async function kt() {
1186
- if (!P) return;
1187
- let e = (M === "STAGE_NOTIFY" || M === "COMPLETION_NOTIFY") && $e === "WEBHOOK", t = Ht({
1188
- memberIds: Be.map((e) => e.id),
1187
+ async function Mt() {
1188
+ if (!I) return;
1189
+ let e = (P === "STAGE_NOTIFY" || P === "COMPLETION_NOTIFY") && Qe === "WEBHOOK", t = Gt({
1190
+ memberIds: Le.map((e) => e.id),
1189
1191
  useWebhookTarget: e,
1190
- webhookUrl: N
1192
+ webhookUrl: F
1191
1193
  });
1192
1194
  if (!t.valid) {
1193
1195
  g(t.error);
1194
1196
  return;
1195
1197
  }
1196
- let { target: n } = t, r = Ie.trim() || null;
1197
- Qe(!0), g(null);
1198
+ let { target: n } = t, r = Fe.trim() || null;
1199
+ Ze(!0), g(null);
1198
1200
  try {
1199
- M === "COUNTERSIGN" ? await Re({
1201
+ P === "COUNTERSIGN" ? await ze({
1200
1202
  comment: r,
1201
1203
  target: n,
1202
- taskId: P.id
1203
- }) : M === "PRE_APPROVAL" ? await ze({
1204
+ taskId: I.id
1205
+ }) : P === "PRE_APPROVAL" ? await Be({
1204
1206
  comment: r,
1205
- onReject: Ye,
1207
+ onReject: Je,
1206
1208
  target: n,
1207
- taskId: P.id
1208
- }) : M === "STAGE_NOTIFY" ? await ke({
1209
+ taskId: I.id
1210
+ }) : P === "STAGE_NOTIFY" ? await M({
1209
1211
  target: n,
1210
- taskId: P.id
1211
- }) : await Oe({
1212
+ taskId: I.id
1213
+ }) : await ke({
1212
1214
  target: n,
1213
- taskId: P.id
1214
- }), qe(!1), H(), await s();
1215
+ taskId: I.id
1216
+ }), N(!1), At(), await s();
1215
1217
  } catch (e) {
1216
- g(_(e));
1218
+ g(v(e));
1217
1219
  } finally {
1218
- Qe(!1);
1220
+ Ze(!1);
1219
1221
  }
1220
1222
  }
1221
- async function At(e) {
1222
- Qe(!0), g(null);
1223
+ async function U(e) {
1224
+ Ze(!0), g(null);
1223
1225
  try {
1224
- await Ee(e), await s();
1226
+ await De(e), await s();
1225
1227
  } catch (e) {
1226
- g(_(e));
1228
+ g(v(e));
1227
1229
  } finally {
1228
- Qe(!1);
1230
+ Ze(!1);
1229
1231
  }
1230
1232
  }
1231
- ue(f, () => ({
1232
- canAddSignerCurrentTask: dt,
1233
- canRejectCurrentTask: ct,
1234
- canReturnCurrentTask: st,
1235
- canTransferCurrentTask: lt,
1233
+ fe(f, () => ({
1234
+ canAddSignerCurrentTask: ft,
1235
+ canRejectCurrentTask: st,
1236
+ canReturnCurrentTask: ot,
1237
+ canTransferCurrentTask: ct,
1236
1238
  deciding: p,
1237
- handleApprove: _t,
1238
- hasCurrentTask: P !== null,
1239
- openAdhocModal: Ot,
1239
+ handleApprove: vt,
1240
+ hasCurrentTask: I !== null,
1241
+ openAdhocModal: jt,
1240
1242
  openRejectModal: bt,
1241
1243
  openReturnModal: St,
1242
- openTransferModal: Ct
1244
+ openTransferModal: wt
1243
1245
  }), [
1244
- dt,
1245
- ct,
1246
+ ft,
1246
1247
  st,
1247
- lt,
1248
+ ot,
1249
+ ct,
1248
1250
  r,
1249
- P,
1251
+ I,
1250
1252
  p
1251
1253
  ]);
1252
- let jt = M === "STAGE_NOTIFY" || M === "COMPLETION_NOTIFY", G = jt && $e === "WEBHOOK" ? !N.trim() : Be.length === 0, Mt = Hn.find((e) => e.id === Ye) ?? Hn[0], Nt = Un.find((e) => e.id === $e) ?? Un[0];
1253
- return /* @__PURE__ */ k(D, { children: [
1254
- /* @__PURE__ */ O(E, {
1254
+ let W = P === "STAGE_NOTIFY" || P === "COMPLETION_NOTIFY", Nt = W && Qe === "WEBHOOK" ? !F.trim() : Le.length === 0, G = Gn.find((e) => e.id === Je) ?? Gn[0], K = Kn.find((e) => e.id === Qe) ?? Kn[0];
1255
+ return /* @__PURE__ */ j(k, { children: [
1256
+ /* @__PURE__ */ A(O, {
1255
1257
  component: "h2",
1256
1258
  variant: "h3",
1257
1259
  children: "任務"
1258
1260
  }),
1259
- h ? /* @__PURE__ */ O(E, {
1261
+ h ? /* @__PURE__ */ A(O, {
1260
1262
  color: "text-error",
1261
1263
  variant: "body",
1262
1264
  children: h
1263
1265
  }) : null,
1264
- /* @__PURE__ */ O("div", {
1265
- style: Ln,
1266
- children: /* @__PURE__ */ O(Se, {
1266
+ /* @__PURE__ */ A("div", {
1267
+ style: Bn,
1268
+ children: /* @__PURE__ */ A(D, {
1267
1269
  columns: ht,
1268
1270
  dataSource: mt,
1269
1271
  fullWidth: !0
1270
1272
  })
1271
1273
  }),
1272
- ft.length > 0 ? /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(E, {
1274
+ R.length > 0 ? /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(O, {
1273
1275
  component: "h3",
1274
- style: Rn,
1276
+ style: Vn,
1275
1277
  variant: "h3",
1276
1278
  children: "待生效的臨時設定"
1277
- }), /* @__PURE__ */ O("div", {
1278
- style: Ln,
1279
- children: /* @__PURE__ */ O(Se, {
1280
- columns: gt,
1281
- dataSource: R,
1279
+ }), /* @__PURE__ */ A("div", {
1280
+ style: Bn,
1281
+ children: /* @__PURE__ */ A(D, {
1282
+ columns: _t,
1283
+ dataSource: gt,
1282
1284
  fullWidth: !0
1283
1285
  })
1284
1286
  })] }) : null,
1285
- /* @__PURE__ */ k(w, {
1287
+ /* @__PURE__ */ j(T, {
1286
1288
  cancelText: "取消",
1287
- confirmButtonProps: { disabled: L },
1289
+ confirmButtonProps: { disabled: dt },
1288
1290
  confirmText: "送出同意",
1289
1291
  loading: p,
1290
1292
  modalType: "standard",
1291
- onCancel: vt,
1292
- onClose: vt,
1293
+ onCancel: B,
1294
+ onClose: B,
1293
1295
  onConfirm: () => void yt(),
1294
1296
  open: ne,
1295
1297
  showModalFooter: !0,
1296
1298
  showModalHeader: !0,
1297
1299
  size: "regular",
1298
- supportingText: I ? "此關卡設定核准時必須填寫意見,內容會記錄在簽核歷程。" : "可以留下同意的說明,內容會記錄在簽核歷程;不填也可以直接送出。",
1300
+ supportingText: ut ? "此關卡設定核准時必須填寫意見,內容會記錄在簽核歷程。" : "可以留下同意的說明,內容會記錄在簽核歷程;不填也可以直接送出。",
1299
1301
  title: "簽核意見",
1300
1302
  children: [
1301
- h ? /* @__PURE__ */ O(E, {
1303
+ h ? /* @__PURE__ */ A(O, {
1302
1304
  color: "text-error",
1303
1305
  role: "alert",
1304
1306
  variant: "body",
1305
1307
  children: h
1306
1308
  }) : null,
1307
- i !== null && i.summary.length > 0 ? /* @__PURE__ */ k("div", {
1308
- style: Pn,
1309
- children: [/* @__PURE__ */ O(E, {
1309
+ i !== null && i.summary.length > 0 ? /* @__PURE__ */ j("div", {
1310
+ style: Ln,
1311
+ children: [/* @__PURE__ */ A(O, {
1310
1312
  variant: "body",
1311
1313
  children: "將一併送出的補填欄位:"
1312
- }), i.summary.map((e) => /* @__PURE__ */ O(C, {
1314
+ }), i.summary.map((e) => /* @__PURE__ */ A(C, {
1313
1315
  title: e.label,
1314
- children: /* @__PURE__ */ O(me, { children: e.text })
1316
+ children: /* @__PURE__ */ A(ge, { children: e.text })
1315
1317
  }, e.fieldKey))]
1316
1318
  }) : null,
1317
- /* @__PURE__ */ O("div", {
1318
- style: Pn,
1319
- children: /* @__PURE__ */ O(e, {
1320
- hintText: I ? "此關卡設定核准時必須填寫意見。" : void 0,
1319
+ /* @__PURE__ */ A("div", {
1320
+ style: Ln,
1321
+ children: /* @__PURE__ */ A(e, {
1322
+ hintText: ut ? "此關卡設定核准時必須填寫意見。" : void 0,
1321
1323
  label: "簽核意見",
1322
1324
  name: "approveComment",
1323
- required: I,
1324
- children: /* @__PURE__ */ O(Ce, {
1325
+ required: ut,
1326
+ children: /* @__PURE__ */ A(Ce, {
1325
1327
  autoFocus: !0,
1326
1328
  onChange: (e) => te(e.target.value),
1327
- placeholder: I ? "請說明同意的原因或條件" : "選填,例如補充核准的條件或提醒事項",
1328
- ref: zn,
1329
+ placeholder: ut ? "請說明同意的原因或條件" : "選填,例如補充核准的條件或提醒事項",
1330
+ ref: Hn,
1329
1331
  resize: "vertical",
1330
1332
  rows: 4,
1331
- style: Fn,
1333
+ style: Rn,
1332
1334
  value: ee
1333
1335
  })
1334
1336
  })
1335
1337
  })
1336
1338
  ]
1337
1339
  }),
1338
- /* @__PURE__ */ O(w, {
1340
+ /* @__PURE__ */ A(T, {
1339
1341
  cancelText: "取消",
1340
1342
  confirmButtonProps: {
1341
- disabled: !nt,
1343
+ disabled: !tt,
1342
1344
  variant: "destructive-primary"
1343
1345
  },
1344
1346
  confirmText: "送出拒絕",
@@ -1347,61 +1349,61 @@ var Bn = {
1347
1349
  modalType: "standard",
1348
1350
  onCancel: xt,
1349
1351
  onClose: xt,
1350
- onConfirm: () => void Tt(),
1352
+ onConfirm: () => void Dt(),
1351
1353
  open: se,
1352
1354
  showModalFooter: !0,
1353
1355
  showModalHeader: !0,
1354
1356
  size: "regular",
1355
1357
  supportingText: "拒絕案件時必須留下原因,供發起人與後續追蹤查看。",
1356
1358
  title: "拒絕原因",
1357
- children: /* @__PURE__ */ k("div", {
1358
- style: Pn,
1359
- children: [/* @__PURE__ */ O(e, {
1359
+ children: /* @__PURE__ */ j("div", {
1360
+ style: Ln,
1361
+ children: [/* @__PURE__ */ A(e, {
1360
1362
  label: "拒絕原因",
1361
1363
  name: "rejectReason",
1362
1364
  required: !0,
1363
- children: /* @__PURE__ */ O(Ce, {
1365
+ children: /* @__PURE__ */ A(Ce, {
1364
1366
  autoFocus: !0,
1365
1367
  onChange: (e) => {
1366
- ae(e.target.value), v(null);
1368
+ ae(e.target.value), _(null);
1367
1369
  },
1368
1370
  placeholder: "請說明拒絕原因",
1369
- ref: zn,
1371
+ ref: Hn,
1370
1372
  resize: "vertical",
1371
1373
  rows: 4,
1372
- style: Fn,
1374
+ style: Rn,
1373
1375
  type: oe ? "error" : "default",
1374
1376
  value: ie
1375
1377
  })
1376
- }), oe ? /* @__PURE__ */ O(E, {
1378
+ }), oe ? /* @__PURE__ */ A(O, {
1377
1379
  color: "text-error",
1378
1380
  variant: "body",
1379
1381
  children: oe
1380
1382
  }) : null]
1381
1383
  })
1382
1384
  }),
1383
- /* @__PURE__ */ O(w, {
1385
+ /* @__PURE__ */ A(T, {
1384
1386
  cancelText: "取消",
1385
- confirmButtonProps: { disabled: !we },
1387
+ confirmButtonProps: { disabled: !be },
1386
1388
  confirmText: "送出轉派",
1387
1389
  loading: p,
1388
1390
  modalType: "standard",
1389
- onCancel: V,
1390
- onClose: V,
1391
- onConfirm: () => void Et(),
1392
- open: Pe,
1391
+ onCancel: Tt,
1392
+ onClose: Tt,
1393
+ onConfirm: () => void Ot(),
1394
+ open: Ne,
1393
1395
  showModalFooter: !0,
1394
1396
  showModalHeader: !0,
1395
1397
  size: "regular",
1396
1398
  supportingText: "轉派後,原任務會保留轉派紀錄,新的待簽任務會指派給指定成員。",
1397
1399
  title: "轉派簽核",
1398
- children: /* @__PURE__ */ k("div", {
1399
- style: In,
1400
- children: [/* @__PURE__ */ O(e, {
1400
+ children: /* @__PURE__ */ j("div", {
1401
+ style: zn,
1402
+ children: [/* @__PURE__ */ A(e, {
1401
1403
  label: "轉派對象",
1402
1404
  name: "transferToMemberId",
1403
1405
  required: !0,
1404
- children: /* @__PURE__ */ O(fe, {
1406
+ children: /* @__PURE__ */ A(me, {
1405
1407
  asyncData: !0,
1406
1408
  disabledOptionsFilter: !0,
1407
1409
  emptyText: "沒有符合的成員",
@@ -1411,147 +1413,147 @@ var Bn = {
1411
1413
  name: "transfer-member-search",
1412
1414
  spellCheck: !1
1413
1415
  },
1414
- loading: Ae,
1416
+ loading: we,
1415
1417
  loadingText: "搜尋成員中...",
1416
1418
  mode: "single",
1417
- onChange: (e) => De(Wt(e)),
1418
- onSearch: wt,
1419
- onSearchTextChange: (e) => De(Gt(e, Me)),
1419
+ onChange: (e) => Se(qt(e)),
1420
+ onSearch: Et,
1421
+ onSearchTextChange: (e) => Se(Jt(e, je)),
1420
1422
  onVisibilityChange: (e) => {
1421
- e && wt("");
1423
+ e && Et("");
1422
1424
  },
1423
- options: [...Me],
1425
+ options: [...je],
1424
1426
  placeholder: "搜尋姓名或信箱",
1425
1427
  searchDebounceTime: 300,
1426
- value: we
1428
+ value: be
1427
1429
  })
1428
- }), /* @__PURE__ */ O(e, {
1430
+ }), /* @__PURE__ */ A(e, {
1429
1431
  label: "轉派說明",
1430
1432
  name: "transferComment",
1431
- children: /* @__PURE__ */ O(Ce, {
1432
- onChange: (e) => xe(e.target.value),
1433
+ children: /* @__PURE__ */ A(Ce, {
1434
+ onChange: (e) => E(e.target.value),
1433
1435
  placeholder: "可補充轉派原因",
1434
- ref: zn,
1436
+ ref: Hn,
1435
1437
  resize: "vertical",
1436
1438
  rows: 4,
1437
- style: Fn,
1439
+ style: Rn,
1438
1440
  value: ye
1439
1441
  })
1440
1442
  })]
1441
1443
  })
1442
1444
  }),
1443
- /* @__PURE__ */ O(w, {
1445
+ /* @__PURE__ */ A(T, {
1444
1446
  cancelText: "取消",
1445
- confirmButtonProps: { disabled: !pt || ut && !it },
1447
+ confirmButtonProps: { disabled: !pt || lt && !rt },
1446
1448
  confirmText: "送出退回",
1447
1449
  loading: p,
1448
1450
  modalType: "standard",
1449
- onCancel: B,
1450
- onClose: B,
1451
- onConfirm: () => void Dt(),
1452
- open: he,
1451
+ onCancel: Ct,
1452
+ onClose: Ct,
1453
+ onConfirm: () => void kt(),
1454
+ open: ue,
1453
1455
  showModalFooter: !0,
1454
1456
  showModalHeader: !0,
1455
1457
  size: "regular",
1456
1458
  supportingText: "退回後,流程會回到指定節點並等待重新處理。",
1457
1459
  title: "退回簽核",
1458
- children: /* @__PURE__ */ k("div", {
1459
- style: In,
1460
- children: [/* @__PURE__ */ O(e, {
1460
+ children: /* @__PURE__ */ j("div", {
1461
+ style: zn,
1462
+ children: [/* @__PURE__ */ A(e, {
1461
1463
  label: "退回節點",
1462
1464
  name: "returnTargetNodeId",
1463
1465
  required: !0,
1464
- children: /* @__PURE__ */ O(be, {
1466
+ children: /* @__PURE__ */ A(xe, {
1465
1467
  clearable: !1,
1466
1468
  fullWidth: !0,
1467
- onChange: (e) => T(e?.id ?? null),
1468
- options: [...ot],
1469
+ onChange: (e) => w(e?.id ?? null),
1470
+ options: [...at],
1469
1471
  placeholder: "選擇退回節點",
1470
1472
  value: pt
1471
1473
  })
1472
- }), /* @__PURE__ */ O(e, {
1473
- hintText: ut ? "此關卡設定退回時必須填寫意見。" : void 0,
1474
+ }), /* @__PURE__ */ A(e, {
1475
+ hintText: lt ? "此關卡設定退回時必須填寫意見。" : void 0,
1474
1476
  label: "退回說明",
1475
1477
  name: "returnComment",
1476
- required: ut,
1477
- children: /* @__PURE__ */ O(Ce, {
1478
- onChange: (e) => de(e.target.value),
1479
- placeholder: ut ? "請說明退回原因" : "可補充需要修改的內容",
1480
- ref: zn,
1478
+ required: lt,
1479
+ children: /* @__PURE__ */ A(Ce, {
1480
+ onChange: (e) => y(e.target.value),
1481
+ placeholder: lt ? "請說明退回原因" : "可補充需要修改的內容",
1482
+ ref: Hn,
1481
1483
  resize: "vertical",
1482
1484
  rows: 4,
1483
- style: Fn,
1484
- value: ce
1485
+ style: Rn,
1486
+ value: le
1485
1487
  })
1486
1488
  })]
1487
1489
  })
1488
1490
  }),
1489
- /* @__PURE__ */ O(w, {
1491
+ /* @__PURE__ */ A(T, {
1490
1492
  cancelText: "取消",
1491
- confirmButtonProps: { disabled: G },
1493
+ confirmButtonProps: { disabled: Nt },
1492
1494
  confirmText: "送出",
1493
- loading: Ze,
1495
+ loading: Xe,
1494
1496
  modalType: "standard",
1495
- onCancel: U,
1496
- onClose: U,
1497
- onConfirm: () => void kt(),
1498
- open: j,
1497
+ onCancel: V,
1498
+ onClose: V,
1499
+ onConfirm: () => void Mt(),
1500
+ open: Ke,
1499
1501
  showModalFooter: !0,
1500
1502
  showModalHeader: !0,
1501
1503
  size: "regular",
1502
- supportingText: Vn[M],
1503
- title: Bn[M],
1504
- children: /* @__PURE__ */ k("div", {
1505
- style: In,
1504
+ supportingText: Wn[P],
1505
+ title: Un[P],
1506
+ children: /* @__PURE__ */ j("div", {
1507
+ style: zn,
1506
1508
  children: [
1507
- jt ? /* @__PURE__ */ O(e, {
1509
+ W ? /* @__PURE__ */ A(e, {
1508
1510
  label: "通知時機",
1509
1511
  name: "adhocNotifyMode",
1510
1512
  required: !0,
1511
- children: /* @__PURE__ */ O(be, {
1513
+ children: /* @__PURE__ */ A(xe, {
1512
1514
  clearable: !1,
1513
1515
  fullWidth: !0,
1514
- onChange: (e) => Je(e?.id === "COMPLETION_NOTIFY" ? "COMPLETION_NOTIFY" : "STAGE_NOTIFY"),
1516
+ onChange: (e) => qe(e?.id === "COMPLETION_NOTIFY" ? "COMPLETION_NOTIFY" : "STAGE_NOTIFY"),
1515
1517
  options: [{
1516
1518
  id: "STAGE_NOTIFY",
1517
- name: Bn.STAGE_NOTIFY
1519
+ name: Un.STAGE_NOTIFY
1518
1520
  }, {
1519
1521
  id: "COMPLETION_NOTIFY",
1520
- name: Bn.COMPLETION_NOTIFY
1522
+ name: Un.COMPLETION_NOTIFY
1521
1523
  }],
1522
1524
  value: {
1523
- id: M,
1524
- name: Bn[M]
1525
+ id: P,
1526
+ name: Un[P]
1525
1527
  }
1526
1528
  })
1527
1529
  }) : null,
1528
- jt ? /* @__PURE__ */ O(e, {
1530
+ W ? /* @__PURE__ */ A(e, {
1529
1531
  label: "通知對象類型",
1530
1532
  name: "adhocTargetKind",
1531
1533
  required: !0,
1532
- children: /* @__PURE__ */ O(be, {
1534
+ children: /* @__PURE__ */ A(xe, {
1533
1535
  clearable: !1,
1534
1536
  fullWidth: !0,
1535
- onChange: (e) => et(e?.id === "WEBHOOK" ? "WEBHOOK" : "MEMBER"),
1536
- options: [...Un],
1537
- value: Nt
1537
+ onChange: (e) => $e(e?.id === "WEBHOOK" ? "WEBHOOK" : "MEMBER"),
1538
+ options: [...Kn],
1539
+ value: K
1538
1540
  })
1539
1541
  }) : null,
1540
- jt && $e === "WEBHOOK" ? /* @__PURE__ */ O(e, {
1542
+ W && Qe === "WEBHOOK" ? /* @__PURE__ */ A(e, {
1541
1543
  label: "Webhook URL",
1542
1544
  name: "adhocWebhookUrl",
1543
1545
  required: !0,
1544
- children: /* @__PURE__ */ O(ge, {
1546
+ children: /* @__PURE__ */ A(ve, {
1545
1547
  fullWidth: !0,
1546
- onChange: (e) => tt(e.target.value),
1548
+ onChange: (e) => et(e.target.value),
1547
1549
  placeholder: "https://example.com/webhook",
1548
- value: N
1550
+ value: F
1549
1551
  })
1550
- }) : /* @__PURE__ */ O(e, {
1551
- label: jt ? "通知對象" : "簽核對象",
1552
+ }) : /* @__PURE__ */ A(e, {
1553
+ label: W ? "通知對象" : "簽核對象",
1552
1554
  name: "adhocMemberId",
1553
1555
  required: !0,
1554
- children: /* @__PURE__ */ O(fe, {
1556
+ children: /* @__PURE__ */ A(me, {
1555
1557
  asyncData: !0,
1556
1558
  disabledOptionsFilter: !0,
1557
1559
  emptyText: "沒有符合的成員",
@@ -1561,45 +1563,45 @@ var Bn = {
1561
1563
  name: "adhoc-member-search",
1562
1564
  spellCheck: !1
1563
1565
  },
1564
- loading: He,
1566
+ loading: Ve,
1565
1567
  loadingText: "搜尋成員中...",
1566
1568
  menuMaxHeight: 320,
1567
1569
  mode: "multiple",
1568
- onChange: (e) => Ve(e.map(Wt).filter(Ut)),
1569
- onSearch: W,
1570
+ onChange: (e) => Re(e.map(qt).filter(Kt)),
1571
+ onSearch: H,
1570
1572
  onVisibilityChange: (e) => {
1571
- e && W("");
1573
+ e && H("");
1572
1574
  },
1573
- options: [...Ge],
1575
+ options: [...Ue],
1574
1576
  overflowStrategy: "wrap",
1575
1577
  placeholder: "搜尋姓名或信箱,可加入多位",
1576
1578
  searchDebounceTime: 300,
1577
- value: [...Be]
1579
+ value: [...Le]
1578
1580
  })
1579
1581
  }),
1580
- M === "PRE_APPROVAL" ? /* @__PURE__ */ O(e, {
1582
+ P === "PRE_APPROVAL" ? /* @__PURE__ */ A(e, {
1581
1583
  label: "拒簽處理方式",
1582
1584
  name: "adhocOnReject",
1583
1585
  required: !0,
1584
- children: /* @__PURE__ */ O(be, {
1586
+ children: /* @__PURE__ */ A(xe, {
1585
1587
  clearable: !1,
1586
1588
  fullWidth: !0,
1587
- onChange: (e) => Xe(e?.id === "RETURN_TO_ORIGIN" ? "RETURN_TO_ORIGIN" : "REJECT_INSTANCE"),
1588
- options: [...Hn],
1589
- value: Mt
1589
+ onChange: (e) => Ye(e?.id === "RETURN_TO_ORIGIN" ? "RETURN_TO_ORIGIN" : "REJECT_INSTANCE"),
1590
+ options: [...Gn],
1591
+ value: G
1590
1592
  })
1591
1593
  }) : null,
1592
- jt ? null : /* @__PURE__ */ O(e, {
1594
+ W ? null : /* @__PURE__ */ A(e, {
1593
1595
  label: "說明",
1594
1596
  name: "adhocComment",
1595
- children: /* @__PURE__ */ O(Ce, {
1596
- onChange: (e) => Le(e.target.value),
1597
+ children: /* @__PURE__ */ A(Ce, {
1598
+ onChange: (e) => Ie(e.target.value),
1597
1599
  placeholder: "可補充原因",
1598
- ref: zn,
1600
+ ref: Hn,
1599
1601
  resize: "vertical",
1600
1602
  rows: 3,
1601
- style: Fn,
1602
- value: Ie
1603
+ style: Rn,
1604
+ value: Fe
1603
1605
  })
1604
1606
  })
1605
1607
  ]
@@ -1607,7 +1609,7 @@ var Bn = {
1607
1609
  })
1608
1610
  ] });
1609
1611
  });
1610
- function Gn(e, t) {
1612
+ function Jn(e, t) {
1611
1613
  try {
1612
1614
  let n = JSON.parse(e.targetValueJson);
1613
1615
  if (n.memberIds?.length) return n.memberIds.map((e) => q(e, t)).join("、");
@@ -1617,20 +1619,20 @@ function Gn(e, t) {
1617
1619
  } catch {}
1618
1620
  return e.targetKind;
1619
1621
  }
1620
- function Kn(e, t) {
1622
+ function Yn(e, t) {
1621
1623
  if (e.isAdhoc || e.status !== "PENDING" && e.status !== "IN_PROGRESS") return 0;
1622
1624
  let n = t?.nodes.find((t) => t.id === e.nodeId);
1623
- return n?.type === "userTask" ? Ge(n).size : 0;
1625
+ return n?.type === "userTask" ? Ke(n).size : 0;
1624
1626
  }
1625
1627
  // src/views/instances/detail/sections/InstanceSignaturesSection.tsx
1626
- var qn = {
1628
+ var Xn = {
1627
1629
  display: "grid",
1628
1630
  gap: 16
1629
1631
  };
1630
- function Jn({ signatureVerification: e, signatures: n }) {
1632
+ function Zn({ signatureVerification: e, signatures: n }) {
1631
1633
  let r = b(() => n.map((e) => ({
1632
1634
  algorithm: e.algorithm,
1633
- hashLabel: G(e.signedPayloadHash),
1635
+ hashLabel: K(e.signedPayloadHash),
1634
1636
  key: e.id,
1635
1637
  keyVersion: e.keyVersion,
1636
1638
  signedAtLabel: t(e.signedAt),
@@ -1667,20 +1669,20 @@ function Jn({ signatureVerification: e, signatures: n }) {
1667
1669
  width: 220
1668
1670
  }
1669
1671
  ], []);
1670
- return /* @__PURE__ */ k("div", {
1671
- style: qn,
1672
+ return /* @__PURE__ */ j("div", {
1673
+ style: Xn,
1672
1674
  children: [
1673
- /* @__PURE__ */ O(E, {
1675
+ /* @__PURE__ */ A(O, {
1674
1676
  component: "h2",
1675
1677
  variant: "h3",
1676
1678
  children: "簽章"
1677
1679
  }),
1678
- /* @__PURE__ */ O(E, {
1680
+ /* @__PURE__ */ A(O, {
1679
1681
  color: e?.valid ? "text-success" : "text-error",
1680
1682
  variant: "body",
1681
1683
  children: e ? e.valid ? `簽章鏈已驗證,共 ${e.checkedCount} 筆。` : `簽章鏈驗證失敗:${e.errors.join("、")}` : "尚無簽章紀錄。"
1682
1684
  }),
1683
- r.length > 0 ? /* @__PURE__ */ O(Se, {
1685
+ r.length > 0 ? /* @__PURE__ */ A(D, {
1684
1686
  columns: i,
1685
1687
  dataSource: r,
1686
1688
  fullWidth: !0
@@ -1689,14 +1691,14 @@ function Jn({ signatureVerification: e, signatures: n }) {
1689
1691
  });
1690
1692
  }
1691
1693
  // src/views/instances/detail/sections/InstanceHistorySection.tsx
1692
- var Yn = {
1694
+ var Qn = {
1693
1695
  display: "grid",
1694
1696
  gap: 16
1695
- }, Xn = {
1697
+ }, $n = {
1696
1698
  cursor: "help",
1697
1699
  textDecoration: "underline dotted",
1698
1700
  textUnderlineOffset: 3
1699
- }, Zn = {
1701
+ }, er = {
1700
1702
  borderLeftColor: "var(--mzn-color-border)",
1701
1703
  borderLeftStyle: "solid",
1702
1704
  borderLeftWidth: 2,
@@ -1705,42 +1707,42 @@ var Yn = {
1705
1707
  marginTop: 4,
1706
1708
  paddingLeft: 8,
1707
1709
  whiteSpace: "pre-wrap"
1708
- }, Qn = { color: "var(--mzn-color-text-secondary)" }, $n = {
1709
- ...Zn,
1710
+ }, tr = { color: "var(--mzn-color-text-secondary)" }, nr = {
1711
+ ...er,
1710
1712
  borderLeftColor: "var(--mzn-color-text-error)",
1711
1713
  color: "var(--mzn-color-text-error)"
1712
1714
  };
1713
- function er(...e) {
1714
- return e.filter((e) => W(e ?? null)).join(" ");
1715
+ function rr(...e) {
1716
+ return e.filter((e) => U(e ?? null)).join(" ");
1715
1717
  }
1716
- var tr = y(function({ className: e, descriptionParts: t, error: n, forcePending: r = !1, index: i = 0, orientation: a, status: o = "pending", title: s, type: c = "number", ...l }, u) {
1718
+ var ir = y(function({ className: e, descriptionParts: t, error: n, forcePending: r = !1, index: i = 0, orientation: a, status: o = "pending", title: s, type: c = "number", ...l }, u) {
1717
1719
  let d = r ? "pending" : o, f = t.filter((e) => e.type !== "comment"), p = t.filter((e) => e.type === "comment");
1718
- return /* @__PURE__ */ k("div", {
1720
+ return /* @__PURE__ */ j("div", {
1719
1721
  ...l,
1720
- className: er(R.host, c === "dot" ? R.dot : null, n && d !== "processing" ? R.error : null, a === "horizontal" ? R.horizontal : null, c === "number" ? R.number : null, d === "pending" ? R.pending : null, d === "processing" ? R.processing : null, n && d === "processing" ? R.processingError : null, !n && d === "succeeded" ? R.succeeded : null, a === "vertical" ? R.vertical : null, e),
1722
+ className: rr(z.host, c === "dot" ? z.dot : null, n && d !== "processing" ? z.error : null, a === "horizontal" ? z.horizontal : null, c === "number" ? z.number : null, d === "pending" ? z.pending : null, d === "processing" ? z.processing : null, n && d === "processing" ? z.processingError : null, !n && d === "succeeded" ? z.succeeded : null, a === "vertical" ? z.vertical : null, e),
1721
1723
  ref: u,
1722
- children: [c === "dot" ? /* @__PURE__ */ O("span", { className: er(R.statusIndicator, R.statusIndicatorDot) }) : /* @__PURE__ */ O("span", {
1723
- className: R.statusIndicator,
1724
+ children: [c === "dot" ? /* @__PURE__ */ A("span", { className: rr(z.statusIndicator, z.statusIndicatorDot) }) : /* @__PURE__ */ A("span", {
1725
+ className: z.statusIndicator,
1724
1726
  children: i + 1
1725
- }), /* @__PURE__ */ k("div", {
1726
- className: R.textContainer,
1727
+ }), /* @__PURE__ */ j("div", {
1728
+ className: z.textContainer,
1727
1729
  children: [
1728
- /* @__PURE__ */ k(E, {
1729
- className: R.title,
1730
+ /* @__PURE__ */ j(O, {
1731
+ className: z.title,
1730
1732
  variant: "label-primary-highlight",
1731
- children: [s, /* @__PURE__ */ O("span", { className: R.titleConnectLine })]
1733
+ children: [s, /* @__PURE__ */ A("span", { className: z.titleConnectLine })]
1732
1734
  }),
1733
- f.length > 0 ? /* @__PURE__ */ O(E, {
1734
- className: R.description,
1735
+ f.length > 0 ? /* @__PURE__ */ A(O, {
1736
+ className: z.description,
1735
1737
  component: "div",
1736
1738
  variant: "body",
1737
- children: f.map((e, t) => /* @__PURE__ */ k(se, { children: [t > 0 ? " · " : null, nr(e)] }, `${e.type}-${t}`))
1739
+ children: f.map((e, t) => /* @__PURE__ */ j(le, { children: [t > 0 ? " · " : null, ar(e)] }, `${e.type}-${t}`))
1738
1740
  }) : null,
1739
- p.map((e, t) => /* @__PURE__ */ k(E, {
1740
- style: e.tone === "danger" ? $n : Zn,
1741
+ p.map((e, t) => /* @__PURE__ */ j(O, {
1742
+ style: e.tone === "danger" ? nr : er,
1741
1743
  variant: "body",
1742
- children: [/* @__PURE__ */ k("span", {
1743
- style: e.tone === "danger" ? void 0 : Qn,
1744
+ children: [/* @__PURE__ */ j("span", {
1745
+ style: e.tone === "danger" ? void 0 : tr,
1744
1746
  children: [e.label, ":"]
1745
1747
  }), e.text]
1746
1748
  }, `comment-${t}`))
@@ -1748,23 +1750,23 @@ var tr = y(function({ className: e, descriptionParts: t, error: n, forcePending:
1748
1750
  })]
1749
1751
  });
1750
1752
  });
1751
- function nr(e) {
1752
- return e.type === "text" ? e.text : e.email?.trim() ? /* @__PURE__ */ k(D, { children: [
1753
+ function ar(e) {
1754
+ return e.type === "text" ? e.text : e.email?.trim() ? /* @__PURE__ */ j(k, { children: [
1753
1755
  e.prefix,
1754
1756
  ":",
1755
- /* @__PURE__ */ O(we, {
1757
+ /* @__PURE__ */ A(we, {
1756
1758
  title: e.email,
1757
- children: ({ ref: t, ...n }) => /* @__PURE__ */ O("span", {
1759
+ children: ({ ref: t, ...n }) => /* @__PURE__ */ A("span", {
1758
1760
  ...n,
1759
1761
  "data-testid": e.memberId ? `member-tooltip-${e.memberId}` : void 0,
1760
1762
  ref: t,
1761
- style: Xn,
1763
+ style: $n,
1762
1764
  children: e.label
1763
1765
  })
1764
1766
  })
1765
1767
  ] }) : `${e.prefix}:${e.label}`;
1766
1768
  }
1767
- function rr({ activityLogs: e, formSchema: t = null, instanceState: n, memberProfilesById: r, signatureVerification: i, signaturesById: a, taskDecisions: o = null, taskDecisionsByTaskId: s, tasks: c, workflowSnapshot: l, workflowTokens: u }) {
1769
+ function or({ activityLogs: e, formSchema: t = null, instanceState: n, memberProfilesById: r, signatureVerification: i, signaturesById: a, taskDecisions: o = null, taskDecisionsByTaskId: s, tasks: c, workflowSnapshot: l, workflowTokens: u }) {
1768
1770
  let d = b(() => $(e, c, u, l, n, r, s, a, i, t, o), [
1769
1771
  e,
1770
1772
  t,
@@ -1777,27 +1779,27 @@ function rr({ activityLogs: e, formSchema: t = null, instanceState: n, memberPro
1777
1779
  c,
1778
1780
  l,
1779
1781
  u
1780
- ]), f = Q(d), p = d.map((e) => ({
1782
+ ]), f = Xt(d), p = d.map((e) => ({
1781
1783
  ...e,
1782
- descriptionParts: e.descriptionParts.filter(Z)
1784
+ descriptionParts: e.descriptionParts.filter(Q)
1783
1785
  }));
1784
- return /* @__PURE__ */ k("div", {
1785
- style: Yn,
1786
- children: [/* @__PURE__ */ O(E, {
1786
+ return /* @__PURE__ */ j("div", {
1787
+ style: Qn,
1788
+ children: [/* @__PURE__ */ A(O, {
1787
1789
  component: "h2",
1788
1790
  variant: "h3",
1789
1791
  children: "歷程"
1790
- }), p.length > 0 ? /* @__PURE__ */ O(xe, {
1792
+ }), p.length > 0 ? /* @__PURE__ */ A(Se, {
1791
1793
  currentStep: f,
1792
1794
  orientation: "vertical",
1793
1795
  type: "dot",
1794
- children: p.map((e) => /* @__PURE__ */ O(tr, {
1796
+ children: p.map((e) => /* @__PURE__ */ A(ir, {
1795
1797
  descriptionParts: e.descriptionParts,
1796
1798
  error: e.error,
1797
1799
  forcePending: e.forcePending,
1798
1800
  title: e.title
1799
1801
  }, e.id))
1800
- }) : /* @__PURE__ */ O(E, {
1802
+ }) : /* @__PURE__ */ A(O, {
1801
1803
  color: "text-neutral",
1802
1804
  variant: "body",
1803
1805
  children: "尚無歷程紀錄。"
@@ -1805,30 +1807,30 @@ function rr({ activityLogs: e, formSchema: t = null, instanceState: n, memberPro
1805
1807
  });
1806
1808
  }
1807
1809
  // src/views/instances/detail/sections/InstanceWebhookDeliveriesSection.tsx
1808
- var ir = {
1810
+ var sr = {
1809
1811
  display: "grid",
1810
1812
  gap: 16
1811
- }, ar = {
1813
+ }, cr = {
1812
1814
  display: "grid",
1813
1815
  gap: 2
1814
- }, or = {
1816
+ }, lr = {
1815
1817
  overflowWrap: "anywhere",
1816
1818
  whiteSpace: "pre-wrap"
1817
1819
  };
1818
- function sr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1820
+ function ur({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1819
1821
  let [r, i] = x(null), [a, o] = x(!1), [s, c] = x(null), l = b(() => e.map((e) => ({
1820
1822
  delivery: e,
1821
1823
  key: e.id
1822
1824
  })), [e]), u = b(() => [
1823
1825
  {
1824
1826
  key: "endpoint",
1825
- render: ({ delivery: e }) => /* @__PURE__ */ k("div", {
1826
- style: ar,
1827
- children: [/* @__PURE__ */ O(E, {
1827
+ render: ({ delivery: e }) => /* @__PURE__ */ j("div", {
1828
+ style: cr,
1829
+ children: [/* @__PURE__ */ A(O, {
1828
1830
  component: "span",
1829
1831
  variant: "body",
1830
1832
  children: e.endpointLabel ?? e.endpointKey
1831
- }), /* @__PURE__ */ k(E, {
1833
+ }), /* @__PURE__ */ j(O, {
1832
1834
  color: "text-neutral",
1833
1835
  component: "span",
1834
1836
  variant: "caption",
@@ -1847,13 +1849,13 @@ function sr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1847
1849
  },
1848
1850
  {
1849
1851
  key: "status",
1850
- render: ({ delivery: e }) => /* @__PURE__ */ O(cr, { status: e.status }),
1852
+ render: ({ delivery: e }) => /* @__PURE__ */ A(dr, { status: e.status }),
1851
1853
  title: "狀態",
1852
1854
  width: 120
1853
1855
  },
1854
1856
  {
1855
1857
  key: "attemptCount",
1856
- render: ({ delivery: e }) => /* @__PURE__ */ O(E, {
1858
+ render: ({ delivery: e }) => /* @__PURE__ */ A(O, {
1857
1859
  component: "span",
1858
1860
  variant: "body",
1859
1861
  children: e.attemptCount
@@ -1863,21 +1865,21 @@ function sr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1863
1865
  },
1864
1866
  {
1865
1867
  key: "lastError",
1866
- render: ({ delivery: e }) => e.lastErrorCode && e.status !== "SENT" ? /* @__PURE__ */ k("div", {
1867
- style: ar,
1868
- children: [/* @__PURE__ */ O(E, {
1868
+ render: ({ delivery: e }) => e.lastErrorCode && e.status !== "SENT" ? /* @__PURE__ */ j("div", {
1869
+ style: cr,
1870
+ children: [/* @__PURE__ */ A(O, {
1869
1871
  color: "text-error",
1870
1872
  component: "span",
1871
1873
  variant: "body",
1872
1874
  children: e.lastErrorCode
1873
- }), e.lastErrorDetail ? /* @__PURE__ */ O(E, {
1875
+ }), e.lastErrorDetail ? /* @__PURE__ */ A(O, {
1874
1876
  color: "text-neutral",
1875
1877
  component: "span",
1876
- style: or,
1878
+ style: lr,
1877
1879
  variant: "caption",
1878
1880
  children: e.lastErrorDetail
1879
1881
  }) : null]
1880
- }) : /* @__PURE__ */ O(E, {
1882
+ }) : /* @__PURE__ */ A(O, {
1881
1883
  color: "text-neutral",
1882
1884
  component: "span",
1883
1885
  variant: "body",
@@ -1888,10 +1890,10 @@ function sr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1888
1890
  },
1889
1891
  {
1890
1892
  key: "time",
1891
- render: ({ delivery: e }) => /* @__PURE__ */ O(E, {
1893
+ render: ({ delivery: e }) => /* @__PURE__ */ A(O, {
1892
1894
  component: "span",
1893
1895
  variant: "body",
1894
- children: lr(e)
1896
+ children: fr(e)
1895
1897
  }),
1896
1898
  title: "時間",
1897
1899
  width: 220
@@ -1899,7 +1901,7 @@ function sr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1899
1901
  ], [n]), d = b(() => ({
1900
1902
  render: ({ delivery: e }) => e.status === "FAILED" && e.attemptCount > 0 ? [{
1901
1903
  disabled: () => a,
1902
- icon: at,
1904
+ icon: L,
1903
1905
  iconType: "leading",
1904
1906
  name: "重新傳送",
1905
1907
  onClick: () => {
@@ -1921,30 +1923,30 @@ function sr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1921
1923
  }
1922
1924
  }
1923
1925
  }
1924
- return /* @__PURE__ */ k("div", {
1925
- style: ir,
1926
+ return /* @__PURE__ */ j("div", {
1927
+ style: sr,
1926
1928
  children: [
1927
- /* @__PURE__ */ O(E, {
1929
+ /* @__PURE__ */ A(O, {
1928
1930
  component: "h2",
1929
1931
  variant: "h3",
1930
1932
  children: "外部系統通知"
1931
1933
  }),
1932
- s ? /* @__PURE__ */ O(E, {
1934
+ s ? /* @__PURE__ */ A(O, {
1933
1935
  color: "text-error",
1934
1936
  variant: "body",
1935
1937
  children: s
1936
1938
  }) : null,
1937
- l.length > 0 ? /* @__PURE__ */ O(Se, {
1939
+ l.length > 0 ? /* @__PURE__ */ A(D, {
1938
1940
  actions: d,
1939
1941
  columns: u,
1940
1942
  dataSource: l,
1941
1943
  fullWidth: !0
1942
- }) : /* @__PURE__ */ O(E, {
1944
+ }) : /* @__PURE__ */ A(O, {
1943
1945
  color: "text-neutral",
1944
1946
  variant: "body",
1945
1947
  children: "此案件沒有外部系統通知。"
1946
1948
  }),
1947
- /* @__PURE__ */ O(w, {
1949
+ /* @__PURE__ */ A(T, {
1948
1950
  cancelText: "取消",
1949
1951
  confirmText: "重新傳送",
1950
1952
  loading: a,
@@ -1958,7 +1960,7 @@ function sr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1958
1960
  showModalHeader: !0,
1959
1961
  supportingText: "會以相同的投遞編號重新送出,接收端可據此避免重複處理。",
1960
1962
  title: "重新傳送通知",
1961
- children: /* @__PURE__ */ k(E, {
1963
+ children: /* @__PURE__ */ j(O, {
1962
1964
  variant: "body",
1963
1965
  children: [
1964
1966
  "確定要重新通知「",
@@ -1970,47 +1972,48 @@ function sr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1970
1972
  ]
1971
1973
  });
1972
1974
  }
1973
- function cr({ status: e }) {
1974
- return e === "SENT" ? /* @__PURE__ */ O(pe, {
1975
+ function dr({ status: e }) {
1976
+ return e === "SENT" ? /* @__PURE__ */ A(he, {
1975
1977
  size: "sub",
1976
1978
  text: "已送達",
1977
1979
  variant: "dot-success"
1978
- }) : e === "FAILED" ? /* @__PURE__ */ O(pe, {
1980
+ }) : e === "FAILED" ? /* @__PURE__ */ A(he, {
1979
1981
  size: "sub",
1980
1982
  text: "失敗",
1981
1983
  variant: "dot-error"
1982
- }) : /* @__PURE__ */ O(pe, {
1984
+ }) : /* @__PURE__ */ A(he, {
1983
1985
  size: "sub",
1984
1986
  text: e === "PENDING" ? "等待傳送" : "傳送中",
1985
1987
  variant: "dot-info"
1986
1988
  });
1987
1989
  }
1988
- function lr(e) {
1990
+ function fr(e) {
1989
1991
  return e.sentAt ? `送達:${t(e.sentAt)}` : e.status === "PENDING" && e.nextRetryAt ? `下次重試:${t(e.nextRetryAt)}` : e.lastAttemptAt ? `最後嘗試:${t(e.lastAttemptAt)}` : `建立:${t(e.createdAt)}`;
1990
1992
  }
1991
1993
  // src/views/instances/viewer-field-access.ts
1992
- function ur(e, t) {
1994
+ function pr(e, t) {
1993
1995
  let n = new Map(t.map((e) => [e.id, e]));
1994
1996
  return new Set(e.filter((e) => e.eventType === "TASK_CREATED").map((e) => e.taskId === null ? void 0 : n.get(e.taskId)).filter((e) => e !== void 0 && !e.isAdhoc).map((e) => e.nodeId));
1995
1997
  }
1996
- function dr({ activityLogs: e, actingTask: t, instance: n, tasks: r }) {
1998
+ function mr({ activityLogs: e, actingTask: t, instance: n, tasks: r }) {
1997
1999
  let i = n.workflowSnapshot;
1998
2000
  return qe({
1999
2001
  definition: i,
2000
2002
  fieldKeys: (n.formDefinitionSnapshot.schema?.fields ?? []).map((e) => e.fieldKey),
2001
2003
  isAdhocTask: t?.isAdhoc ?? !1,
2002
2004
  nodeId: t?.nodeId ?? null,
2003
- revealedFieldKeys: Ke(i, ur(e, r))
2005
+ revealedFieldKeys: N(i, pr(e, r))
2004
2006
  });
2005
2007
  }
2006
2008
  // src/views/instances/detail/InstanceDetailView.tsx
2007
- function fr(e) {
2008
- return `還有 ${new Set(Object.keys(e).map(j)).size} 個補填欄位需要完成`;
2009
+ var hr = "補填時不能新增、刪除或調整明細列的順序,請只修改開放的欄位。";
2010
+ function gr(e) {
2011
+ return `還有 ${new Set(Object.keys(e).map(P)).size} 個補填欄位需要完成`;
2009
2012
  }
2010
- var pr = 3e3, mr = 40, hr = 184, gr = 96, _r = {
2013
+ var _r = 3e3, vr = 40, yr = 184, br = 96, xr = {
2011
2014
  display: "grid",
2012
2015
  gap: 16
2013
- }, vr = {
2016
+ }, Sr = {
2014
2017
  background: "#f8fafc",
2015
2018
  border: "1px solid #e2e8f0",
2016
2019
  borderRadius: 8,
@@ -2018,7 +2021,7 @@ var pr = 3e3, mr = 40, hr = 184, gr = 96, _r = {
2018
2021
  minHeight: 440,
2019
2022
  overflow: "hidden",
2020
2023
  width: "min(80vw, 1040px)"
2021
- }, yr = {
2024
+ }, Cr = {
2022
2025
  background: "#ffffff",
2023
2026
  border: "1px solid #cbd5e1",
2024
2027
  borderRadius: 8,
@@ -2028,24 +2031,24 @@ var pr = 3e3, mr = 40, hr = 184, gr = 96, _r = {
2028
2031
  minHeight: 82,
2029
2032
  padding: 12,
2030
2033
  width: 184
2031
- }, br = {
2034
+ }, wr = {
2032
2035
  borderRadius: 999,
2033
2036
  fontSize: 12,
2034
2037
  fontWeight: 600,
2035
2038
  justifySelf: "start",
2036
2039
  lineHeight: "18px",
2037
2040
  padding: "0 8px"
2038
- }, xr = {
2041
+ }, Tr = {
2039
2042
  color: "#64748b",
2040
2043
  fontSize: 12,
2041
2044
  overflow: "hidden",
2042
2045
  textOverflow: "ellipsis",
2043
2046
  whiteSpace: "nowrap"
2044
- }, Sr = { opacity: 0 }, Cr = {
2047
+ }, Er = { opacity: 0 }, Dr = {
2045
2048
  display: "flex",
2046
2049
  flexWrap: "wrap",
2047
2050
  gap: 8
2048
- }, wr = {
2051
+ }, Or = {
2049
2052
  alignItems: "center",
2050
2053
  background: "#ffffff",
2051
2054
  border: "1px solid #cbd5e1",
@@ -2057,29 +2060,29 @@ var pr = 3e3, mr = 40, hr = 184, gr = 96, _r = {
2057
2060
  gap: 6,
2058
2061
  lineHeight: "20px",
2059
2062
  padding: "4px 8px"
2060
- }, Tr = {
2063
+ }, kr = {
2061
2064
  display: "grid",
2062
2065
  gap: 16
2063
- }, Er = { workflowRuntime: Ir };
2064
- function Dr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHistory: u = !0, showSignatures: d = !0, showTasks: f = !0, showWebhookDeliveries: p = !0 }) {
2065
- let { member: se } = n(), y = se?.memberId ?? null, ue = p && r(se), [fe, pe] = x([]), [C, me] = x(null), [he, ge] = x([]), [be, xe] = x([]), [Se, we] = x([]), [Te, Ee] = x([]), [Oe, ke] = x(null), [A, Me] = x([]), [Re, ze] = x([]), [Be, Ue] = x([]), [Ke, j] = x(null), [qe, Qe] = x(!0), [$e, N] = x(!1), [tt, at] = x(!1), [ot, st] = x(!1), [ct, I] = x(!1), [L, ft] = x(""), [pt, mt] = x(!1), [ht, R] = x({}), [z, _t] = x({}), { clearAfterResubmit: vt, comment: yt, setComment: bt } = Tn(a), [xt, St] = x({}), [B, V] = x(null), [wt, Et] = x(null), [Dt, H] = x([]), Ot = L.trim(), U = de(null), kt = de(0), At = Te.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS");
2066
- le(() => {
2067
- dn();
2068
- }, [y, a]), le(() => {
2069
- if (!ue || !At || kt.current >= mr) return;
2066
+ }, Ar = { workflowRuntime: Br };
2067
+ function jr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHistory: u = !0, showSignatures: d = !0, showTasks: f = !0, showWebhookDeliveries: p = !0 }) {
2068
+ let { member: le } = n(), y = le?.memberId ?? null, fe = p && r(le), [me, he] = x([]), [C, ge] = x(null), [_e, ve] = x([]), [xe, Se] = x([]), [D, we] = x([]), [Te, Ee] = x([]), [De, ke] = x(null), [M, Ae] = x([]), [Ne, ze] = x([]), [Be, Ve] = x([]), [We, N] = x(null), [P, qe] = x(!0), [$e, F] = x(!1), [tt, nt] = x(!1), [L, st] = x(!1), [ct, lt] = x(!1), [ft, R] = x(""), [mt, ht] = x(!1), [gt, _t] = x({}), [z, B] = x({}), { clearAfterResubmit: yt, comment: bt, setComment: xt } = On(a), [St, Ct] = x({}), [wt, Tt] = x(null), [Dt, Ot] = x(null), [At, jt] = x([]), V = ft.trim(), H = pe(null), Mt = pe(0), W = Te.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS");
2069
+ de(() => {
2070
+ mn();
2071
+ }, [y, a]), de(() => {
2072
+ if (!fe || !W || Mt.current >= vr) return;
2070
2073
  let e = setTimeout(() => {
2071
- kt.current += 1, mn();
2072
- }, pr);
2074
+ Mt.current += 1, _n();
2075
+ }, _r);
2073
2076
  return () => clearTimeout(e);
2074
2077
  }, [
2075
- ue,
2076
- At,
2078
+ fe,
2079
+ W,
2077
2080
  Te
2078
- ]), le(() => {
2079
- _t(C?.formData ?? {}), St({});
2081
+ ]), de(() => {
2082
+ B(C?.formData ?? {}), Ct({});
2080
2083
  }, [C]);
2081
- let jt = ce((e, t) => {
2082
- St((n) => {
2084
+ let Nt = ue((e, t) => {
2085
+ Ct((n) => {
2083
2086
  let r = n[e];
2084
2087
  return r?.hasValue === t.hasValue && r.selectionExpired === (t.selectionExpired === !0) && r.status === t.status ? n : {
2085
2088
  ...n,
@@ -2090,281 +2093,285 @@ function Dr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHist
2090
2093
  }
2091
2094
  };
2092
2095
  });
2093
- }, []), G = b(() => Bt(A, y), [y, A]), K = b(() => G && C ? C.workflowSnapshot.nodes.find((e) => e.id === G.nodeId) ?? null : null, [G, C]), Nt = K?.type === "userTask" && K.data.returnBehavior.allowReturn, Pt = K?.type === "userTask" && K.data.allowReject !== !1, It = K?.type === "userTask" && K.data.allowTransfer !== !1, Lt = K?.type === "userTask" && K.data.allowAddSigner, Rt = !(!C || C.initiatorMemberId !== y || C.state !== "RUNNING" && C.state !== "RETURNED"), zt = !!(C && C.initiatorMemberId === y && C.state === "RETURNED"), J = b(() => G && !G.isAdhoc && K?.type === "userTask" && Ge(K).size > 0 ? K : null, [G, K]), Vt = J ? G?.id ?? null : null, Ht = o(), [Ut, Wt] = x({}), [Gt, Y] = x({}), [Kt, qt] = x(!1);
2094
- le(() => {
2095
- Wt({}), Y({}), qt(!1);
2096
- }, [Vt]);
2097
- let X = C?.formDefinitionSnapshot.schema ?? null, Z = b(() => J && X ? ie(X, J) : null, [J, X]), Q = b(() => Z && C ? Je(Z.fields, {
2096
+ }, []), G = b(() => Ht(M, y), [y, M]), K = b(() => G && C ? C.workflowSnapshot.nodes.find((e) => e.id === G.nodeId) ?? null : null, [G, C]), Ft = K?.type === "userTask" && K.data.returnBehavior.allowReturn, It = K?.type === "userTask" && K.data.allowReject !== !1, Lt = K?.type === "userTask" && K.data.allowTransfer !== !1, zt = K?.type === "userTask" && K.data.allowAddSigner, Bt = !(!C || C.initiatorMemberId !== y || C.state !== "RUNNING" && C.state !== "RETURNED"), Vt = !!(C && C.initiatorMemberId === y && C.state === "RETURNED"), J = b(() => G && !G.isAdhoc && K?.type === "userTask" && Ke(K).size > 0 ? K : null, [G, K]), Ut = J ? G?.id ?? null : null, Wt = i(), [Gt, Kt] = x({}), [qt, Jt] = x({}), [Y, Yt] = x(!1);
2097
+ de(() => {
2098
+ Kt({}), Jt({}), Yt(!1);
2099
+ }, [Ut]);
2100
+ let X = C?.formDefinitionSnapshot.schema ?? null, Z = b(() => J && X ? h(X, J) : null, [J, X]), Q = b(() => Z && C ? Ye(Z.fields, {
2098
2101
  ...C.formData,
2099
- ...Ut
2102
+ ...Gt
2100
2103
  }) : null, [
2101
- Ut,
2104
+ Gt,
2102
2105
  Z,
2103
2106
  C
2104
- ]), Jt = b(() => J && Z && Q && C ? m({
2105
- draft: Ut,
2107
+ ]), Xt = b(() => J && Z && Q && C ? ae({
2108
+ draft: Gt,
2106
2109
  node: J,
2107
2110
  schema: Z,
2108
2111
  stored: C.formData,
2109
2112
  values: Q
2110
2113
  }) : {}, [
2111
- Ut,
2114
+ Gt,
2112
2115
  J,
2113
2116
  Z,
2114
2117
  Q,
2115
2118
  C
2116
- ]), Yt = b(() => C ? dr({
2117
- activityLogs: fe,
2119
+ ]), Zt = b(() => C ? mr({
2120
+ activityLogs: me,
2118
2121
  actingTask: G,
2119
2122
  instance: C,
2120
- tasks: A
2123
+ tasks: M
2121
2124
  }) : void 0, [
2122
- fe,
2125
+ me,
2123
2126
  G,
2124
2127
  C,
2125
- A
2126
- ]), Xt = b(() => C ? oe(C.workflowSnapshot, J) : void 0, [J, C]), Zt = b(() => new Map(Be.map((e) => [e.memberId, e])), [Be]), Qt = gt(b(() => X ? h(X, Jt) : [], [Jt, X])), $t = b(() => J && Q && X && C?.formDataFingerprint ? {
2128
+ M
2129
+ ]), Qt = b(() => J ? Object.fromEntries([...se(J)].map((e) => [e, {
2130
+ editableColumns: [...ce(J, e).keys()],
2131
+ lockRows: !0
2132
+ }])) : void 0, [J]), $t = b(() => C ? re(C.workflowSnapshot, J) : void 0, [J, C]), en = b(() => new Map(Be.map((e) => [e.memberId, e])), [Be]), tn = vt(b(() => X ? g(X, Xt) : [], [Xt, X])), nn = b(() => J && Q && X && C?.formDataFingerprint ? {
2127
2133
  expectedFormDataFingerprint: C.formDataFingerprint,
2128
- formData: ne(Jt, J),
2129
- summary: g(X, J, Jt, new Map([...Zt.keys()].map((e) => [e, q(e, Zt)])), Qt)
2134
+ formData: ee(Xt, J, C.formData),
2135
+ summary: ie(X, J, Xt, new Map([...en.keys()].map((e) => [e, q(e, en)])), tn)
2130
2136
  } : null, [
2131
- Jt,
2137
+ Xt,
2132
2138
  J,
2133
- Qt,
2139
+ tn,
2134
2140
  Q,
2135
2141
  C,
2136
- Zt,
2142
+ en,
2137
2143
  X
2138
2144
  ]);
2139
- function en(e) {
2145
+ function rn(e) {
2140
2146
  if (!J) return;
2141
- let t = Ge(J), n = Object.entries(e).filter(([e, n]) => t.has(e) && JSON.stringify(n) !== JSON.stringify(Q?.[e]));
2142
- Wt((e) => ({
2147
+ let t = Ke(J), n = Object.entries(e).filter(([e, n]) => t.has(e) && JSON.stringify(n) !== JSON.stringify(Q?.[e]));
2148
+ Kt((e) => ({
2143
2149
  ...e,
2144
2150
  ...Object.fromEntries(n)
2145
- })), Y({});
2151
+ })), Jt({});
2146
2152
  }
2147
- async function tn() {
2148
- if (J && !C?.formDataFingerprint) _e.error("無法確認表單版本,請重新整理頁面後再同意。");
2153
+ async function an() {
2154
+ if (J && !C?.formDataFingerprint) w.error("無法確認表單版本,請重新整理頁面後再同意。");
2149
2155
  else {
2150
2156
  if (J && Q && X && C?.formDefinitionSnapshot.uiSchema) {
2151
- at(!0);
2152
- let e = await Xe({
2153
- schema: ee(X, J),
2157
+ nt(!0);
2158
+ let e = await Ze({
2159
+ schema: te(X, J),
2154
2160
  uiSchema: C.formDefinitionSnapshot.uiSchema,
2155
2161
  values: Q
2156
- }).catch((e) => (_e.error(_(e)), null)).finally(() => at(!1));
2162
+ }).catch((e) => (w.error(v(e)), null)).finally(() => nt(!1));
2157
2163
  if (!e) return;
2158
2164
  if (!e.valid) {
2159
- Y(e.errors), e.firstInvalidFieldKey && Ye(e.firstInvalidFieldKey), _e.warning(fr(e.errors));
2165
+ Jt(e.errors), e.firstInvalidFieldKey && Xe(e.firstInvalidFieldKey), w.warning(gr(e.errors));
2160
2166
  return;
2161
2167
  }
2162
2168
  }
2163
- U.current?.handleApprove();
2169
+ H.current?.handleApprove();
2164
2170
  }
2165
2171
  }
2166
- function nn(e, t = []) {
2172
+ function on(e, t = [], n = null) {
2167
2173
  if (!J || !X) return !1;
2168
- if (re(e)) return qt(!0), !0;
2169
- let n = v(e, X, J, t);
2170
- return n ? (Y(n), Ye(Object.keys(n)[0] ?? ""), _e.warning(fr(n)), !0) : !1;
2174
+ if (n === "FORM_FIELD_ACCESS_TABLE_ROWS_LOCKED") return w.warning(hr), !0;
2175
+ if (_(e)) return Yt(!0), !0;
2176
+ let r = oe(e, X, J, t);
2177
+ return r ? (Jt(r), Xe(Object.keys(r)[0] ?? ""), w.warning(gr(r)), !0) : !1;
2171
2178
  }
2172
- async function rn() {
2173
- await dn(), qt(!1);
2179
+ async function sn() {
2180
+ await mn(), Yt(!1);
2174
2181
  }
2175
- let an = b(() => c(he), [he]), on = b(() => new Map(Se.map((e) => [e.id, e])), [Se]), sn = b(() => C ? Mr(C.workflowSnapshot) : null, [C]), cn = b(() => C && sn ? jr(sn, A, Re, C.state) : [], [
2182
+ let cn = b(() => c(_e), [_e]), ln = b(() => new Map(D.map((e) => [e.id, e])), [D]), un = b(() => C ? Ir(C.workflowSnapshot) : null, [C]), dn = b(() => C && un ? Fr(un, M, Ne, C.state) : [], [
2176
2183
  C,
2177
- sn,
2178
- A,
2179
- Re
2180
- ]), ln = b(() => sn ? Nr(sn) : [], [sn]), un = b(() => C ? kr(C.workflowSnapshot) : [], [C]);
2181
- async function dn() {
2182
- Qe(!0), j(null);
2184
+ un,
2185
+ M,
2186
+ Ne
2187
+ ]), fn = b(() => un ? Lr(un) : [], [un]), pn = b(() => C ? Nr(C.workflowSnapshot) : [], [C]);
2188
+ async function mn() {
2189
+ qe(!0), N(null);
2183
2190
  try {
2184
- let e = await Pe(a);
2185
- pe(e.activityLogs), me(e.instance), Me(e.tasks), ze(e.workflowTokens);
2186
- let t = await Ae(e.instance.id), [n, r, i, o, s] = await Promise.all([
2187
- wn(e.tasks),
2188
- Sn({
2191
+ let e = await Fe(a);
2192
+ he(e.activityLogs), ge(e.instance), Ae(e.tasks), ze(e.workflowTokens);
2193
+ let t = await je(e.instance.id), [n, r, i, o, s] = await Promise.all([
2194
+ Dn(e.tasks),
2195
+ Tn({
2189
2196
  ...e,
2190
2197
  adhocDirectives: t
2191
2198
  }),
2192
- je(e.instance.id),
2193
- Le(e.instance.id),
2194
- fn(e.instance.id)
2199
+ Me(e.instance.id),
2200
+ Re(e.instance.id),
2201
+ hn(e.instance.id)
2195
2202
  ]);
2196
- ge(n), Ue(r), xe(i), we(o.signatures), ke(o.verification), H(t), Ee(s);
2203
+ ve(n), Ve(r), Se(i), we(o.signatures), ke(o.verification), jt(t), Ee(s);
2197
2204
  } catch (e) {
2198
- j(_(e));
2205
+ N(v(e));
2199
2206
  } finally {
2200
- Qe(!1);
2207
+ qe(!1);
2201
2208
  }
2202
2209
  }
2203
- async function fn(e) {
2204
- return ue ? Ne(e).catch(() => []) : [];
2210
+ async function hn(e) {
2211
+ return fe ? Pe(e).catch(() => []) : [];
2205
2212
  }
2206
- async function pn(e) {
2207
- await He(e.id), kt.current = 0, await dn();
2213
+ async function gn(e) {
2214
+ await Ue(e.id), Mt.current = 0, await mn();
2208
2215
  }
2209
- async function mn() {
2210
- let e = await fn(a);
2211
- e.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS") ? Ee(e) : await dn();
2216
+ async function _n() {
2217
+ let e = await hn(a);
2218
+ e.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS") ? Ee(e) : await mn();
2212
2219
  }
2213
- async function hn(e, t) {
2220
+ async function vn(e, t) {
2214
2221
  if (!y) throw Error("尚未登入,無法上傳附件");
2215
- return { id: (await We({
2222
+ return { id: (await Ge({
2216
2223
  file: t,
2217
2224
  formFieldPath: `form.${e.fieldKey}`
2218
2225
  })).id };
2219
2226
  }
2220
- async function gn(e) {
2227
+ async function yn(e) {
2221
2228
  if (y) try {
2222
- let t = await Fe({ id: e });
2229
+ let t = await Ie({ id: e });
2223
2230
  window.open(t, "_blank", "noopener,noreferrer");
2224
2231
  } catch (e) {
2225
- _e.error(_(e));
2232
+ w.error(v(e));
2226
2233
  }
2227
2234
  }
2228
- async function _n(e) {
2235
+ async function bn(e) {
2229
2236
  if (!y) return;
2230
- let t = await Ie({ id: e.id });
2231
- V(e), Et(t);
2237
+ let t = await Le({ id: e.id });
2238
+ Tt(e), Ot(t);
2232
2239
  }
2233
- async function vn() {
2234
- if (y && C && Rt) {
2235
- N(!0), j(null), R({});
2240
+ async function xn() {
2241
+ if (y && C && Bt) {
2242
+ F(!0), N(null), _t({});
2236
2243
  try {
2237
- await De({
2244
+ await Oe({
2238
2245
  cancelledByMemberId: y,
2239
- comment: Ot || null,
2246
+ comment: V || null,
2240
2247
  instanceId: C.id
2241
- }), ft(""), mt(!1), await dn();
2248
+ }), R(""), ht(!1), await mn();
2242
2249
  } catch (e) {
2243
- j(_(e));
2250
+ N(v(e));
2244
2251
  } finally {
2245
- N(!1);
2252
+ F(!1);
2246
2253
  }
2247
2254
  }
2248
2255
  }
2249
- async function yn() {
2250
- if (!y || !C || !zt) return;
2251
- N(!0), j(null), R({});
2252
- let e = i(Object.values(xt));
2256
+ async function Sn() {
2257
+ if (!y || !C || !Vt) return;
2258
+ F(!0), N(null), _t({});
2259
+ let e = o(Object.values(St));
2253
2260
  if (e) {
2254
- j(e), N(!1);
2261
+ N(e), F(!1);
2255
2262
  return;
2256
2263
  }
2257
- if (Ht.blockMessage) {
2258
- j(Ht.blockMessage), N(!1);
2264
+ if (Wt.blockMessage) {
2265
+ N(Wt.blockMessage), F(!1);
2259
2266
  return;
2260
2267
  }
2261
- let t = C.formDefinitionSnapshot.schema ? ae(C.formDefinitionSnapshot.schema, C.workflowSnapshot) : null, n = te(t ? Je(t.fields, z) : z, C.workflowSnapshot);
2268
+ let t = C.formDefinitionSnapshot.schema ? ne(C.formDefinitionSnapshot.schema, C.workflowSnapshot) : null, n = m(t ? Ye(t.fields, z) : z, C.workflowSnapshot);
2262
2269
  try {
2263
2270
  if (t && C.formDefinitionSnapshot.uiSchema) {
2264
- let e = await Xe({
2271
+ let e = await Ze({
2265
2272
  schema: t,
2266
2273
  uiSchema: C.formDefinitionSnapshot.uiSchema,
2267
2274
  values: n
2268
2275
  });
2269
2276
  if (!e.valid) {
2270
- R(e.errors), j("請先修正表單中標示的欄位。"), e.firstInvalidFieldKey && Ye(e.firstInvalidFieldKey);
2277
+ _t(e.errors), N("請先修正表單中標示的欄位。"), e.firstInvalidFieldKey && Xe(e.firstInvalidFieldKey);
2271
2278
  return;
2272
2279
  }
2273
2280
  }
2274
- await Ve({
2275
- comment: yt,
2281
+ await He({
2282
+ comment: bt,
2276
2283
  formData: n,
2277
2284
  initiatorMemberId: y,
2278
2285
  instanceId: C.id,
2279
2286
  title: C.title
2280
- }), vt(C.id), await dn();
2287
+ }), yt(C.id), await mn();
2281
2288
  } catch (e) {
2282
- j(_(e));
2289
+ N(v(e));
2283
2290
  } finally {
2284
- N(!1);
2291
+ F(!1);
2285
2292
  }
2286
2293
  }
2287
- let $ = $e || ot || tt;
2288
- return /* @__PURE__ */ k(D, { children: [
2289
- /* @__PURE__ */ O(ve, { children: /* @__PURE__ */ k(M, {
2294
+ let $ = $e || L || tt;
2295
+ return /* @__PURE__ */ j(k, { children: [
2296
+ /* @__PURE__ */ A(ye, { children: /* @__PURE__ */ j(Je, {
2290
2297
  description: C ? [
2291
- Mt(C.state),
2298
+ Pt(C.state),
2292
2299
  t(C.startedAt),
2293
- Tt(C, Zt)
2294
- ].filter(W).join(" · ") : "載入案件內容。",
2300
+ kt(C, en)
2301
+ ].filter(U).join(" · ") : "載入案件內容。",
2295
2302
  title: C?.title ?? "簽核案件",
2296
2303
  children: [
2297
- C ? /* @__PURE__ */ O(S, {
2304
+ C ? /* @__PURE__ */ A(S, {
2298
2305
  "aria-label": "查看流程圖",
2299
- icon: P,
2306
+ icon: at,
2300
2307
  iconType: "icon-only",
2301
- onClick: () => I(!0),
2308
+ onClick: () => lt(!0),
2302
2309
  title: "查看流程圖",
2303
2310
  variant: "base-secondary",
2304
2311
  children: "流程圖"
2305
2312
  }) : null,
2306
- Rt ? /* @__PURE__ */ O(S, {
2313
+ Bt ? /* @__PURE__ */ A(S, {
2307
2314
  disabled: $,
2308
2315
  icon: et,
2309
2316
  iconType: "leading",
2310
- onClick: () => mt(!0),
2317
+ onClick: () => ht(!0),
2311
2318
  variant: "destructive-secondary",
2312
2319
  children: "取消案件"
2313
2320
  }) : null,
2314
- G ? /* @__PURE__ */ k(D, { children: [
2315
- Lt ? /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(S, {
2321
+ G ? /* @__PURE__ */ j(k, { children: [
2322
+ zt ? /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(S, {
2316
2323
  disabled: $,
2317
- icon: rt,
2324
+ icon: it,
2318
2325
  iconType: "leading",
2319
- onClick: () => U.current?.openAdhocModal("COUNTERSIGN"),
2326
+ onClick: () => H.current?.openAdhocModal("COUNTERSIGN"),
2320
2327
  variant: "base-secondary",
2321
2328
  children: "會簽"
2322
- }, "adhoc-countersign"), /* @__PURE__ */ O(S, {
2329
+ }, "adhoc-countersign"), /* @__PURE__ */ A(S, {
2323
2330
  disabled: $,
2324
- icon: rt,
2331
+ icon: it,
2325
2332
  iconType: "leading",
2326
- onClick: () => U.current?.openAdhocModal("PRE_APPROVAL"),
2333
+ onClick: () => H.current?.openAdhocModal("PRE_APPROVAL"),
2327
2334
  variant: "base-secondary",
2328
2335
  children: "加簽"
2329
2336
  }, "adhoc-pre-approval")] }) : null,
2330
- /* @__PURE__ */ O(S, {
2337
+ /* @__PURE__ */ A(S, {
2331
2338
  disabled: $,
2332
- icon: nt,
2339
+ icon: rt,
2333
2340
  iconType: "leading",
2334
- onClick: () => U.current?.openAdhocModal("STAGE_NOTIFY"),
2341
+ onClick: () => H.current?.openAdhocModal("STAGE_NOTIFY"),
2335
2342
  variant: "base-secondary",
2336
2343
  children: "通知設定"
2337
2344
  }, "adhoc-notify"),
2338
- Nt ? /* @__PURE__ */ O(S, {
2345
+ Ft ? /* @__PURE__ */ A(S, {
2339
2346
  disabled: $,
2340
- icon: it,
2347
+ icon: I,
2341
2348
  iconType: "leading",
2342
- onClick: () => U.current?.openReturnModal(),
2349
+ onClick: () => H.current?.openReturnModal(),
2343
2350
  variant: "base-secondary",
2344
2351
  children: "退回"
2345
2352
  }, "task-return") : null,
2346
- It ? /* @__PURE__ */ O(S, {
2353
+ Lt ? /* @__PURE__ */ A(S, {
2347
2354
  disabled: $,
2348
- icon: F,
2355
+ icon: ot,
2349
2356
  iconType: "leading",
2350
- onClick: () => U.current?.openTransferModal(),
2357
+ onClick: () => H.current?.openTransferModal(),
2351
2358
  variant: "base-secondary",
2352
2359
  children: "轉派"
2353
2360
  }, "task-transfer") : null,
2354
- Pt ? /* @__PURE__ */ O(S, {
2361
+ It ? /* @__PURE__ */ A(S, {
2355
2362
  disabled: $,
2356
2363
  icon: et,
2357
2364
  iconType: "leading",
2358
- onClick: () => U.current?.openRejectModal(),
2365
+ onClick: () => H.current?.openRejectModal(),
2359
2366
  variant: "destructive-secondary",
2360
2367
  children: "拒絕"
2361
2368
  }, "task-reject") : null,
2362
- /* @__PURE__ */ O(S, {
2369
+ /* @__PURE__ */ A(S, {
2363
2370
  disabled: $,
2364
- icon: Ze,
2371
+ icon: Qe,
2365
2372
  iconType: "leading",
2366
2373
  onClick: () => {
2367
- tn();
2374
+ an();
2368
2375
  },
2369
2376
  variant: "base-primary",
2370
2377
  children: "同意"
@@ -2372,188 +2379,189 @@ function Dr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHist
2372
2379
  ] }) : null
2373
2380
  ]
2374
2381
  }) }),
2375
- /* @__PURE__ */ k(ye, { children: [
2376
- l ? /* @__PURE__ */ O(T, { children: /* @__PURE__ */ O(jn, {
2377
- attachments: be,
2378
- canResubmitInstance: zt,
2382
+ /* @__PURE__ */ j(be, { children: [
2383
+ l ? /* @__PURE__ */ A(E, { children: /* @__PURE__ */ A(Pn, {
2384
+ attachments: xe,
2385
+ canResubmitInstance: Vt,
2379
2386
  deciding: $e,
2380
- error: Ke,
2381
- fieldAccess: Yt,
2382
- fieldLabelMarkers: Xt,
2387
+ error: We,
2388
+ fieldAccess: Zt,
2389
+ fieldLabelMarkers: $t,
2383
2390
  fill: Z && Q && J ? {
2384
- errors: Gt,
2385
- fieldCount: Ge(J).size,
2386
- onChange: en,
2391
+ errors: qt,
2392
+ fieldCount: Ke(J).size,
2393
+ onChange: rn,
2387
2394
  schema: Z,
2395
+ tableAccess: Qt,
2388
2396
  value: Q
2389
2397
  } : null,
2390
2398
  instance: C,
2391
- loading: qe,
2392
- onDataSourceStateChange: jt,
2399
+ loading: P,
2400
+ onDataSourceStateChange: Nt,
2393
2401
  onDownloadAttachment: (e) => {
2394
- gn(e);
2402
+ yn(e);
2395
2403
  },
2396
- onFileUploadStateChange: Ht.onFileUploadStateChange,
2397
- onReloadAfterConflict: Kt ? () => void rn() : null,
2404
+ onFileUploadStateChange: Wt.onFileUploadStateChange,
2405
+ onReloadAfterConflict: Y ? () => void sn() : null,
2398
2406
  onResubmitFormChange: (e) => {
2399
- _t(e), R({});
2407
+ B(e), _t({});
2400
2408
  },
2401
- onResubmitCommentChange: bt,
2402
- onResubmitInstance: () => void yn(),
2403
- onUploadAttachment: hn,
2404
- resubmitComment: yt,
2409
+ onResubmitCommentChange: xt,
2410
+ onResubmitInstance: () => void Sn(),
2411
+ onUploadAttachment: vn,
2412
+ resubmitComment: bt,
2405
2413
  resubmitFormData: z,
2406
- resubmitFormErrors: ht
2414
+ resubmitFormErrors: gt
2407
2415
  }) }) : null,
2408
- s ? /* @__PURE__ */ O(T, { children: /* @__PURE__ */ O(Nn, {
2409
- attachments: be,
2416
+ s ? /* @__PURE__ */ A(E, { children: /* @__PURE__ */ A(In, {
2417
+ attachments: xe,
2410
2418
  onDownload: (e) => {
2411
- gn(e.id);
2419
+ yn(e.id);
2412
2420
  },
2413
2421
  onPreview: (e) => {
2414
- _n(e);
2422
+ bn(e);
2415
2423
  }
2416
2424
  }) }) : null,
2417
- f ? /* @__PURE__ */ O(T, { children: /* @__PURE__ */ O(Wn, {
2418
- adhocDirectives: Dt,
2425
+ f ? /* @__PURE__ */ A(E, { children: /* @__PURE__ */ A(qn, {
2426
+ adhocDirectives: At,
2419
2427
  currentMemberId: y,
2420
- fill: $t,
2428
+ fill: nn,
2421
2429
  instance: C,
2422
- memberProfilesById: Zt,
2423
- onChanged: dn,
2430
+ memberProfilesById: en,
2431
+ onChanged: mn,
2424
2432
  onDecidingChange: st,
2425
- onFillApproveError: nn,
2426
- ref: U,
2427
- tasks: A
2433
+ onFillApproveError: on,
2434
+ ref: H,
2435
+ tasks: M
2428
2436
  }) }) : null,
2429
- d ? /* @__PURE__ */ O(T, { children: /* @__PURE__ */ O(Jn, {
2430
- signatureVerification: Oe,
2431
- signatures: Se
2437
+ d ? /* @__PURE__ */ A(E, { children: /* @__PURE__ */ A(Zn, {
2438
+ signatureVerification: De,
2439
+ signatures: D
2432
2440
  }) }) : null,
2433
- ue && Te.length > 0 ? /* @__PURE__ */ O(T, { children: /* @__PURE__ */ O(sr, {
2441
+ fe && Te.length > 0 ? /* @__PURE__ */ A(E, { children: /* @__PURE__ */ A(ur, {
2434
2442
  deliveries: Te,
2435
- onRetry: pn,
2436
- readNodeLabel: (e) => Ft(e, C?.workflowSnapshot ?? null)
2443
+ onRetry: gn,
2444
+ readNodeLabel: (e) => Rt(e, C?.workflowSnapshot ?? null)
2437
2445
  }) }) : null,
2438
- u ? /* @__PURE__ */ O(T, { children: /* @__PURE__ */ O(rr, {
2439
- activityLogs: fe,
2446
+ u ? /* @__PURE__ */ A(E, { children: /* @__PURE__ */ A(or, {
2447
+ activityLogs: me,
2440
2448
  formSchema: X,
2441
2449
  instanceState: C?.state ?? "RUNNING",
2442
- memberProfilesById: Zt,
2443
- signatureVerification: Oe,
2444
- signaturesById: on,
2445
- taskDecisions: he,
2446
- taskDecisionsByTaskId: an,
2447
- tasks: A,
2450
+ memberProfilesById: en,
2451
+ signatureVerification: De,
2452
+ signaturesById: ln,
2453
+ taskDecisions: _e,
2454
+ taskDecisionsByTaskId: cn,
2455
+ tasks: M,
2448
2456
  workflowSnapshot: C?.workflowSnapshot ?? null,
2449
- workflowTokens: Re
2457
+ workflowTokens: Ne
2450
2458
  }) }) : null
2451
2459
  ] }),
2452
- C ? /* @__PURE__ */ O(w, {
2460
+ C ? /* @__PURE__ */ A(T, {
2453
2461
  modalType: "standard",
2454
- onClose: () => I(!1),
2462
+ onClose: () => lt(!1),
2455
2463
  open: ct,
2456
2464
  showModalHeader: !0,
2457
2465
  size: "wide",
2458
- supportingText: `${Mt(C.state)} · ${t(C.startedAt)}`,
2466
+ supportingText: `${Pt(C.state)} · ${t(C.startedAt)}`,
2459
2467
  title: "流程圖",
2460
- children: /* @__PURE__ */ k("div", {
2461
- style: _r,
2462
- children: [/* @__PURE__ */ O("div", {
2463
- style: vr,
2464
- children: /* @__PURE__ */ k(dt, {
2465
- edges: ln,
2468
+ children: /* @__PURE__ */ j("div", {
2469
+ style: xr,
2470
+ children: [/* @__PURE__ */ A("div", {
2471
+ style: Sr,
2472
+ children: /* @__PURE__ */ j(pt, {
2473
+ edges: fn,
2466
2474
  fitView: !0,
2467
2475
  fitViewOptions: { padding: .18 },
2468
2476
  maxZoom: 1.2,
2469
2477
  minZoom: .2,
2470
- nodes: cn,
2478
+ nodes: dn,
2471
2479
  nodesDraggable: !1,
2472
2480
  nodesFocusable: !1,
2473
- nodeTypes: Er,
2481
+ nodeTypes: Ar,
2474
2482
  panOnDrag: !0,
2475
2483
  proOptions: { hideAttribution: !0 },
2476
- children: [/* @__PURE__ */ O(lt, {}), /* @__PURE__ */ O(ut, { showInteractive: !1 })]
2484
+ children: [/* @__PURE__ */ A(ut, {}), /* @__PURE__ */ A(dt, { showInteractive: !1 })]
2477
2485
  })
2478
- }), un.length > 0 ? /* @__PURE__ */ O("div", {
2479
- style: Cr,
2480
- children: un.map((e) => /* @__PURE__ */ O("span", {
2481
- style: wr,
2486
+ }), pn.length > 0 ? /* @__PURE__ */ A("div", {
2487
+ style: Dr,
2488
+ children: pn.map((e) => /* @__PURE__ */ A("span", {
2489
+ style: Or,
2482
2490
  children: e
2483
2491
  }, e))
2484
2492
  }) : null]
2485
2493
  })
2486
2494
  }) : null,
2487
- /* @__PURE__ */ O(w, {
2495
+ /* @__PURE__ */ A(T, {
2488
2496
  modalType: "standard",
2489
2497
  onClose: () => {
2490
- V(null), Et(null);
2498
+ Tt(null), Ot(null);
2491
2499
  },
2492
- open: !!(B && wt),
2500
+ open: !!(wt && Dt),
2493
2501
  showModalHeader: !0,
2494
2502
  size: "wide",
2495
- supportingText: B?.filename ?? void 0,
2503
+ supportingText: wt?.filename ?? void 0,
2496
2504
  title: "PDF 預覽",
2497
- children: wt ? /* @__PURE__ */ O(Ct, {
2498
- filename: B?.filename ?? "PDF 預覽",
2499
- fileUrl: wt,
2500
- onDownload: B ? () => void gn(B.id) : void 0
2505
+ children: Dt ? /* @__PURE__ */ A(Et, {
2506
+ filename: wt?.filename ?? "PDF 預覽",
2507
+ fileUrl: Dt,
2508
+ onDownload: wt ? () => void yn(wt.id) : void 0
2501
2509
  }) : null
2502
2510
  }),
2503
- /* @__PURE__ */ O(w, {
2511
+ /* @__PURE__ */ A(T, {
2504
2512
  cancelText: "保留案件",
2505
2513
  confirmButtonProps: { variant: "destructive-primary" },
2506
2514
  confirmText: "確認取消",
2507
2515
  loading: $e,
2508
2516
  modalStatusType: "error",
2509
2517
  modalType: "standard",
2510
- onCancel: () => mt(!1),
2511
- onClose: () => mt(!1),
2512
- onConfirm: () => void vn(),
2513
- open: pt,
2518
+ onCancel: () => ht(!1),
2519
+ onClose: () => ht(!1),
2520
+ onConfirm: () => void xn(),
2521
+ open: mt,
2514
2522
  showModalFooter: !0,
2515
2523
  showModalHeader: !0,
2516
2524
  supportingText: "取消後會關閉目前待簽任務與候選簽核人。",
2517
2525
  title: "取消案件",
2518
- children: /* @__PURE__ */ k("div", {
2519
- style: Tr,
2520
- children: [/* @__PURE__ */ k(E, {
2526
+ children: /* @__PURE__ */ j("div", {
2527
+ style: kr,
2528
+ children: [/* @__PURE__ */ j(O, {
2521
2529
  variant: "body",
2522
2530
  children: [
2523
2531
  "確定要取消「",
2524
2532
  C?.title ?? "",
2525
2533
  "」嗎?"
2526
2534
  ]
2527
- }), /* @__PURE__ */ O(e, {
2535
+ }), /* @__PURE__ */ A(e, {
2528
2536
  label: "取消原因",
2529
2537
  name: "cancelComment",
2530
- children: /* @__PURE__ */ O(Ce, {
2531
- onChange: (e) => ft(e.target.value),
2538
+ children: /* @__PURE__ */ A(Ce, {
2539
+ onChange: (e) => R(e.target.value),
2532
2540
  placeholder: "可填寫取消原因",
2533
2541
  resize: "vertical",
2534
2542
  rows: 3,
2535
- value: L
2543
+ value: ft
2536
2544
  })
2537
2545
  })]
2538
2546
  })
2539
2547
  })
2540
2548
  ] });
2541
2549
  }
2542
- function Or(e) {
2550
+ function Mr(e) {
2543
2551
  return e.data.label ? e.data.label : e.data.isDefault ? "其他情況" : e.data.condition ?? "";
2544
2552
  }
2545
- function kr(e) {
2546
- return e.edges.map(Or).filter((e) => e.trim().length > 0);
2553
+ function Nr(e) {
2554
+ return e.edges.map(Mr).filter((e) => e.trim().length > 0);
2547
2555
  }
2548
- function Ar(e) {
2556
+ function Pr(e) {
2549
2557
  return e === "startEvent" ? "開始" : e === "endEvent" ? "完成" : e === "userTask" ? "簽核節點" : e === "serviceTask" ? "知會節點" : e === "exclusiveGateway" ? "條件分流" : "平行處理";
2550
2558
  }
2551
- function jr(e, t, n, r) {
2559
+ function Fr(e, t, n, r) {
2552
2560
  return e.nodes.map((e) => {
2553
- let i = xn(e, t, n, r);
2561
+ let i = wn(e, t, n, r);
2554
2562
  return {
2555
2563
  data: {
2556
- kindLabel: Ar(e.type),
2564
+ kindLabel: Pr(e.type),
2557
2565
  label: e.data.label,
2558
2566
  secondaryLabel: i.secondaryLabel,
2559
2567
  statusLabel: i.statusLabel,
@@ -2561,42 +2569,42 @@ function jr(e, t, n, r) {
2561
2569
  },
2562
2570
  id: e.id,
2563
2571
  position: e.position,
2564
- sourcePosition: L.Right,
2565
- targetPosition: L.Left,
2572
+ sourcePosition: R.Right,
2573
+ targetPosition: R.Left,
2566
2574
  type: "workflowRuntime"
2567
2575
  };
2568
2576
  });
2569
2577
  }
2570
- function Mr(e) {
2571
- let t = new ft.graphlib.Graph();
2578
+ function Ir(e) {
2579
+ let t = new mt.graphlib.Graph();
2572
2580
  return t.setDefaultEdgeLabel(() => ({})), t.setGraph({
2573
2581
  nodesep: 56,
2574
2582
  rankdir: "LR",
2575
2583
  ranksep: 120
2576
2584
  }), e.nodes.forEach((e) => {
2577
2585
  t.setNode(e.id, {
2578
- height: gr,
2579
- width: hr
2586
+ height: br,
2587
+ width: yr
2580
2588
  });
2581
2589
  }), e.edges.forEach((e) => {
2582
2590
  t.setEdge(e.source, e.target);
2583
- }), ft.layout(t), {
2591
+ }), mt.layout(t), {
2584
2592
  ...e,
2585
2593
  nodes: e.nodes.map((e) => {
2586
2594
  let n = t.node(e.id);
2587
2595
  return n ? {
2588
2596
  ...e,
2589
2597
  position: {
2590
- x: n.x - hr / 2,
2591
- y: n.y - gr / 2
2598
+ x: n.x - yr / 2,
2599
+ y: n.y - br / 2
2592
2600
  }
2593
2601
  } : e;
2594
2602
  })
2595
2603
  };
2596
2604
  }
2597
- function Nr(e) {
2605
+ function Lr(e) {
2598
2606
  return e.edges.map((e) => {
2599
- let t = Or(e);
2607
+ let t = Mr(e);
2600
2608
  return {
2601
2609
  animated: !1,
2602
2610
  id: e.id,
@@ -2624,25 +2632,25 @@ function Nr(e) {
2624
2632
  };
2625
2633
  });
2626
2634
  }
2627
- function Pr(e) {
2635
+ function Rr(e) {
2628
2636
  return e === "current" ? {
2629
- ...yr,
2637
+ ...Cr,
2630
2638
  border: "1px solid var(--mzn-color-primary, #0057ff)",
2631
2639
  boxShadow: "0 0 0 3px rgba(0, 87, 255, 0.14)"
2632
2640
  } : e === "completed" ? {
2633
- ...yr,
2641
+ ...Cr,
2634
2642
  border: "1px solid #16a34a"
2635
2643
  } : e === "cancelled" ? {
2636
- ...yr,
2644
+ ...Cr,
2637
2645
  border: "1px solid #dc2626",
2638
2646
  opacity: .72
2639
2647
  } : e === "waiting" ? {
2640
- ...yr,
2648
+ ...Cr,
2641
2649
  border: "1px dashed #64748b"
2642
- } : yr;
2650
+ } : Cr;
2643
2651
  }
2644
- function Fr(e) {
2645
- let t = br;
2652
+ function zr(e) {
2653
+ let t = wr;
2646
2654
  return e === "current" ? {
2647
2655
  ...t,
2648
2656
  background: "#eff6ff",
@@ -2665,41 +2673,41 @@ function Fr(e) {
2665
2673
  color: "#64748b"
2666
2674
  };
2667
2675
  }
2668
- function Ir({ data: e }) {
2669
- return /* @__PURE__ */ k("div", {
2670
- style: Pr(e.tone),
2676
+ function Br({ data: e }) {
2677
+ return /* @__PURE__ */ j("div", {
2678
+ style: Rr(e.tone),
2671
2679
  children: [
2672
- /* @__PURE__ */ O(I, {
2680
+ /* @__PURE__ */ A(ft, {
2673
2681
  isConnectable: !1,
2674
- position: L.Left,
2675
- style: Sr,
2682
+ position: R.Left,
2683
+ style: Er,
2676
2684
  type: "target"
2677
2685
  }),
2678
- /* @__PURE__ */ O(E, {
2686
+ /* @__PURE__ */ A(O, {
2679
2687
  component: "span",
2680
2688
  ellipsis: !0,
2681
2689
  title: e.label,
2682
2690
  variant: "label-primary",
2683
2691
  children: e.label
2684
2692
  }),
2685
- /* @__PURE__ */ O("span", {
2686
- style: Fr(e.tone),
2693
+ /* @__PURE__ */ A("span", {
2694
+ style: zr(e.tone),
2687
2695
  children: e.statusLabel
2688
2696
  }),
2689
- /* @__PURE__ */ O("span", {
2697
+ /* @__PURE__ */ A("span", {
2690
2698
  title: e.secondaryLabel,
2691
- style: xr,
2699
+ style: Tr,
2692
2700
  children: e.secondaryLabel || e.kindLabel
2693
2701
  }),
2694
- /* @__PURE__ */ O(I, {
2702
+ /* @__PURE__ */ A(ft, {
2695
2703
  isConnectable: !1,
2696
- position: L.Right,
2697
- style: Sr,
2704
+ position: R.Right,
2705
+ style: Er,
2698
2706
  type: "source"
2699
2707
  })
2700
2708
  ]
2701
2709
  });
2702
2710
  }
2703
- export { Wn as a, Jn as i, sr as n, Nn as o, rr as r, jn as s, Dr as t };
2711
+ export { qn as a, Zn as i, ur as n, In as o, or as r, Pn as s, jr as t };
2704
2712
 
2705
- //# sourceMappingURL=detail-CHZDNNM6.js.map
2713
+ //# sourceMappingURL=detail-BB_uYaoM.js.map