@rytass/bpm-core-react 0.20.0 → 0.21.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 (127) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +1 -1
  3. package/dist/approval-instance-list-page.css +1 -1
  4. package/dist/chunks/FormBuilderView-DjPGrOJ2.cjs +4 -0
  5. package/dist/chunks/FormBuilderView-DjPGrOJ2.cjs.map +1 -0
  6. package/dist/chunks/{FormBuilderView-CFRiw04B.js → FormBuilderView-WtC2iW5f.js} +667 -584
  7. package/dist/chunks/FormBuilderView-WtC2iW5f.js.map +1 -0
  8. package/dist/chunks/{FormRendererView-lYSaR8CQ.cjs → FormRendererView-B-xycC9S.cjs} +3 -3
  9. package/dist/chunks/{FormRendererView-lYSaR8CQ.cjs.map → FormRendererView-B-xycC9S.cjs.map} +1 -1
  10. package/dist/chunks/{FormRendererView-GfbVWEGa.js → FormRendererView-BcQKUi1A.js} +238 -238
  11. package/dist/chunks/{FormRendererView-GfbVWEGa.js.map → FormRendererView-BcQKUi1A.js.map} +1 -1
  12. package/dist/chunks/approval-instance-list-page-Bth7Raya.js +724 -0
  13. package/dist/chunks/approval-instance-list-page-Bth7Raya.js.map +1 -0
  14. package/dist/chunks/approval-instance-list-page-Dcvo6TrT.cjs +2 -0
  15. package/dist/chunks/approval-instance-list-page-Dcvo6TrT.cjs.map +1 -0
  16. package/dist/chunks/{categories-DQUtVEiV.cjs → categories-CyyqG6wG.cjs} +2 -2
  17. package/dist/chunks/{categories-DQUtVEiV.cjs.map → categories-CyyqG6wG.cjs.map} +1 -1
  18. package/dist/chunks/{categories-BAdxjNSA.js → categories-f7E-RJEc.js} +9 -9
  19. package/dist/chunks/{categories-BAdxjNSA.js.map → categories-f7E-RJEc.js.map} +1 -1
  20. package/dist/chunks/{compose-Bb5bUVFd.cjs → compose-BKUTsB2W.cjs} +2 -2
  21. package/dist/chunks/{compose-Bb5bUVFd.cjs.map → compose-BKUTsB2W.cjs.map} +1 -1
  22. package/dist/chunks/{compose-egQlRjuZ.js → compose-DZvIspW3.js} +4 -4
  23. package/dist/chunks/{compose-egQlRjuZ.js.map → compose-DZvIspW3.js.map} +1 -1
  24. package/dist/chunks/{delegations-CVmtpkRn.cjs → delegations-ClRCwD1I.cjs} +2 -2
  25. package/dist/chunks/{delegations-CVmtpkRn.cjs.map → delegations-ClRCwD1I.cjs.map} +1 -1
  26. package/dist/chunks/{delegations-9-yvWWws.js → delegations-CqND-Qtz.js} +5 -5
  27. package/dist/chunks/{delegations-9-yvWWws.js.map → delegations-CqND-Qtz.js.map} +1 -1
  28. package/dist/chunks/{delegations-CrfjsH94.cjs → delegations-D43VDSz1.cjs} +2 -2
  29. package/dist/chunks/{delegations-CrfjsH94.cjs.map → delegations-D43VDSz1.cjs.map} +1 -1
  30. package/dist/chunks/{delegations-CxnNvTCc.js → delegations-zisffLwk.js} +5 -5
  31. package/dist/chunks/{delegations-CxnNvTCc.js.map → delegations-zisffLwk.js.map} +1 -1
  32. package/dist/chunks/{designer-CZDlQ9Nf.js → designer-CWubIE69.js} +1425 -1412
  33. package/dist/chunks/designer-CWubIE69.js.map +1 -0
  34. package/dist/chunks/designer-C_m8DmMl.cjs +69 -0
  35. package/dist/chunks/designer-C_m8DmMl.cjs.map +1 -0
  36. package/dist/chunks/{detail-ByZV1XaI.js → detail-Bv90gvy0.js} +578 -577
  37. package/dist/chunks/detail-Bv90gvy0.js.map +1 -0
  38. package/dist/chunks/detail-DNzqesdI.cjs +5 -0
  39. package/dist/chunks/detail-DNzqesdI.cjs.map +1 -0
  40. package/dist/chunks/instance-error-message-BW464LRQ.cjs +2 -0
  41. package/dist/chunks/instance-error-message-BW464LRQ.cjs.map +1 -0
  42. package/dist/chunks/instance-error-message-CAP1vJhX.js +204 -0
  43. package/dist/chunks/instance-error-message-CAP1vJhX.js.map +1 -0
  44. package/dist/components/approval-instance-field-filter-controls.d.cts +12 -0
  45. package/dist/components/approval-instance-field-filter-controls.d.ts +12 -0
  46. package/dist/components/approval-instance-field-filters.d.cts +86 -0
  47. package/dist/components/approval-instance-field-filters.d.ts +86 -0
  48. package/dist/components/approval-instance-list-page.d.cts +4 -0
  49. package/dist/components/approval-instance-list-page.d.ts +4 -0
  50. package/dist/index.cjs +1 -1
  51. package/dist/index.js +1 -1
  52. package/dist/next/workflow-chat-route.cjs +2 -2
  53. package/dist/next/workflow-chat-route.cjs.map +1 -1
  54. package/dist/next/workflow-chat-route.js +13 -13
  55. package/dist/pages/admin/delegations/index.cjs +1 -1
  56. package/dist/pages/admin/delegations/index.js +1 -1
  57. package/dist/pages/delegations/index.cjs +1 -1
  58. package/dist/pages/delegations/index.js +1 -1
  59. package/dist/pages/instances/detail/index.cjs +1 -1
  60. package/dist/pages/instances/detail/index.js +1 -1
  61. package/dist/pages/templates/categories/index.cjs +1 -1
  62. package/dist/pages/templates/categories/index.js +1 -1
  63. package/dist/pages/templates/compose/index.cjs +1 -1
  64. package/dist/pages/templates/compose/index.js +1 -1
  65. package/dist/pages/templates/designer/index.cjs +1 -1
  66. package/dist/pages/templates/designer/index.js +1 -1
  67. package/dist/views/admin/delegations/index.cjs +1 -1
  68. package/dist/views/admin/delegations/index.js +1 -1
  69. package/dist/views/admin/index.cjs +1 -1
  70. package/dist/views/admin/index.js +1 -1
  71. package/dist/views/admin/webhook-endpoints/index.cjs +1 -1
  72. package/dist/views/admin/webhook-endpoints/index.cjs.map +1 -1
  73. package/dist/views/admin/webhook-endpoints/index.js +60 -60
  74. package/dist/views/admin/webhook-endpoints/index.js.map +1 -1
  75. package/dist/views/cc/index.cjs +1 -1
  76. package/dist/views/cc/index.js +1 -1
  77. package/dist/views/delegations/index.cjs +1 -1
  78. package/dist/views/delegations/index.js +1 -1
  79. package/dist/views/forms/builder/FormBuilderView.d.cts +8 -1
  80. package/dist/views/forms/builder/FormBuilderView.d.ts +8 -1
  81. package/dist/views/forms/builder/index.cjs +1 -1
  82. package/dist/views/forms/builder/index.js +1 -1
  83. package/dist/views/forms/renderer/index.cjs +1 -1
  84. package/dist/views/forms/renderer/index.js +1 -1
  85. package/dist/views/instances/approver-filled-form.d.cts +8 -5
  86. package/dist/views/instances/approver-filled-form.d.ts +8 -5
  87. package/dist/views/instances/detail/index.cjs +1 -1
  88. package/dist/views/instances/detail/index.js +1 -1
  89. package/dist/views/instances/detail/sections/InstanceTasksSection.d.cts +2 -1
  90. package/dist/views/instances/detail/sections/InstanceTasksSection.d.ts +2 -1
  91. package/dist/views/instances/new/index.cjs +1 -1
  92. package/dist/views/instances/new/index.cjs.map +1 -1
  93. package/dist/views/instances/new/index.js +8 -8
  94. package/dist/views/instances/new/index.js.map +1 -1
  95. package/dist/views/search/index.cjs +1 -1
  96. package/dist/views/search/index.js +1 -1
  97. package/dist/views/sent/index.cjs +1 -1
  98. package/dist/views/sent/index.js +1 -1
  99. package/dist/views/templates/categories/index.cjs +1 -1
  100. package/dist/views/templates/categories/index.js +1 -1
  101. package/dist/views/templates/compose/index.cjs +1 -1
  102. package/dist/views/templates/compose/index.js +1 -1
  103. package/dist/views/templates/designer/NotifyWebhookTargetsEditor.d.cts +2 -0
  104. package/dist/views/templates/designer/NotifyWebhookTargetsEditor.d.ts +2 -0
  105. package/dist/views/templates/designer/index.cjs +1 -1
  106. package/dist/views/templates/designer/index.js +1 -1
  107. package/dist/views/templates/index.cjs +1 -1
  108. package/dist/views/templates/index.cjs.map +1 -1
  109. package/dist/views/templates/index.js +7 -7
  110. package/package.json +3 -3
  111. package/dist/chunks/FormBuilderView-CFRiw04B.js.map +0 -1
  112. package/dist/chunks/FormBuilderView-CpUgbSbt.cjs +0 -3
  113. package/dist/chunks/FormBuilderView-CpUgbSbt.cjs.map +0 -1
  114. package/dist/chunks/approval-instance-list-page-BnI4t5mD.js +0 -279
  115. package/dist/chunks/approval-instance-list-page-BnI4t5mD.js.map +0 -1
  116. package/dist/chunks/approval-instance-list-page-fqvmkBlg.cjs +0 -2
  117. package/dist/chunks/approval-instance-list-page-fqvmkBlg.cjs.map +0 -1
  118. package/dist/chunks/designer-CX9bhYJS.cjs +0 -69
  119. package/dist/chunks/designer-CX9bhYJS.cjs.map +0 -1
  120. package/dist/chunks/designer-CZDlQ9Nf.js.map +0 -1
  121. package/dist/chunks/detail-ByZV1XaI.js.map +0 -1
  122. package/dist/chunks/detail-ChseSF55.cjs +0 -5
  123. package/dist/chunks/detail-ChseSF55.cjs.map +0 -1
  124. package/dist/chunks/instance-error-message-DTARGbGo.cjs +0 -2
  125. package/dist/chunks/instance-error-message-DTARGbGo.cjs.map +0 -1
  126. package/dist/chunks/instance-error-message-q6gy5evy.js +0 -120
  127. package/dist/chunks/instance-error-message-q6gy5evy.js.map +0 -1
@@ -4,27 +4,28 @@ 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-GfbVWEGa.js";
7
+ import { l as i, n as a, o, t as s } from "./FormRendererView-BcQKUi1A.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-q6gy5evy.js";
11
- import { Fragment as y, forwardRef as b, useCallback as se, useEffect as ce, useImperativeHandle as le, useMemo as x, useRef as ue, useState as S } from "react";
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 se } from "./instance-error-message-CAP1vJhX.js";
11
+ import { Fragment as v, forwardRef as y, useCallback as ce, useEffect as b, useImperativeHandle as le, useMemo as x, useRef as ue, useState as S } from "react";
12
12
  import { AutoComplete as de, Badge as fe, Button as C, Description as w, DescriptionContent as pe, InlineMessage as me, Input as he, Message as ge, Modal as T, PageHeader as _e, Section as E, SectionGroup as ve, Select as ye, Stepper as be, Table as xe, Textarea as Se, Tooltip as Ce, Typography as D } from "@mezzanine-ui/react";
13
- import { Fragment as we, jsx as O, jsxs as k } from "react/jsx-runtime";
14
- import { cancelAdhocDirective as Te, cancelApprovalInstance as Ee, configureAdhocCompletionNotification as De, configureAdhocStageNotification as Oe, decideTask as ke, listAdhocDirectives as Ae, listAttachments as je, listTaskDecisions as A, listWorkflowWebhookDeliveries as Me, readApprovalInstance as Ne, readAttachmentDownloadUrl as Pe, readAttachmentPreviewUrl as Fe, readInstanceSignatures as Ie, requestAdhocCountersign as Le, requestAdhocPreApproval as Re, resolveMemberProfiles as ze, resubmitApprovalInstance as Be, retryWorkflowWebhookDelivery as Ve, searchMembers as He, uploadAttachment as Ue } from "@rytass/bpm-core-client/workflow";
15
- import We from "@mezzanine-ui/react/ContentHeader";
16
- import { CheckedIcon as Ge, ChevronLeftIcon as Ke, ChevronRightIcon as qe, DangerousOutlineIcon as j, DownloadIcon as M, FileSearchIcon as Je, NotificationUnreadIcon as Ye, PlusIcon as Xe, RefreshCcwIcon as Ze, ResetIcon as Qe, ShareIcon as $e, UserIcon as et, ZoomInIcon as tt, ZoomOutIcon as N } from "@mezzanine-ui/icons";
17
- import { readNodeFillableFieldKeys as nt, readRevealedFieldKeys as rt, readTopLevelFieldKey as P, resolveFieldAccess as F } from "@rytass/bpm-core-shared";
18
- import { buildFormRendererValues as it, focusFormRendererField as at, validateFormRendererValuesInWorker as ot } from "@rytass/bpm-core-client/form";
13
+ import { readFormDataIssues as we } from "@rytass/bpm-core-client";
14
+ import { Fragment as Te, 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 Ge from "@mezzanine-ui/react/ContentHeader";
17
+ import { readNodeFillableFieldKeys as Ke, readRevealedFieldKeys as qe, readTopLevelFieldKey as j, resolveFieldAccess as M } from "@rytass/bpm-core-shared";
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 N, DangerousOutlineIcon as $e, DownloadIcon as P, FileSearchIcon as et, NotificationUnreadIcon as tt, PlusIcon as nt, RefreshCcwIcon as rt, ResetIcon as F, ShareIcon as I, UserIcon as it, ZoomInIcon as at, ZoomOutIcon as ot } from "@mezzanine-ui/icons";
19
20
  import { resolveOrgUnitOptions as st } from "@rytass/bpm-core-client/organization";
20
- import { Background as ct, Controls as lt, Handle as ut, Position as I, ReactFlow as dt } from "@xyflow/react";
21
+ import { Background as ct, Controls as lt, Handle as ut, Position as L, ReactFlow as dt } from "@xyflow/react";
21
22
  import * as ft from "dagre";
22
23
  import { Document as pt, Page as mt } from "react-pdf";
23
- import { readSelectableReturnTargetNodeIds as L } from "@rytass/bpm-core-shared/workflow-graph";
24
+ import { readSelectableReturnTargetNodeIds as ht } from "@rytass/bpm-core-shared/workflow-graph";
24
25
  import { stepClasses as R } from "@mezzanine-ui/core/stepper";
25
- function ht(e) {
26
+ function gt(e) {
26
27
  let [t, n] = S(/* @__PURE__ */ new Map()), r = e.join("\n");
27
- return ce(() => {
28
+ return b(() => {
28
29
  let e = r ? [...new Set(r.split("\n"))].filter((e) => !t.has(e)) : [], i = !1;
29
30
  return e.length === 0 ? () => void 0 : (st(e).then((e) => e.map(a)).catch(() => []).then((t) => {
30
31
  i || n((n) => new Map([...n, ...e.map((e) => [e, t.find((t) => t.id.toLowerCase() === e.toLowerCase())?.name ?? null])]));
@@ -45,10 +46,10 @@ var z = {
45
46
  viewport: "bpm_viewport_DQXms",
46
47
  page: "bpm_page_Cv5Rg",
47
48
  state: "bpm_state_bpgp3"
48
- }, gt = 760, _t = 920, vt = 320, yt = 32, bt = .75, xt = 1.75, St = .25;
49
+ }, _t = 760, vt = 920, yt = 320, bt = 32, xt = .75, St = 1.75, B = .25;
49
50
  function Ct({ filename: e, fileUrl: t, onDownload: n }) {
50
- let r = ue(null), [i, a] = S(null), [o, s] = S(1), [c, l] = S(1), [u, d] = S(gt);
51
- ce(() => {
51
+ let r = ue(null), [i, a] = S(null), [o, s] = S(1), [c, l] = S(1), [u, d] = S(_t);
52
+ b(() => {
52
53
  let e = r.current;
53
54
  if (!e || typeof ResizeObserver > "u") return;
54
55
  let t = new ResizeObserver((e) => {
@@ -56,15 +57,15 @@ function Ct({ filename: e, fileUrl: t, onDownload: n }) {
56
57
  t && d(t);
57
58
  });
58
59
  return t.observe(e), () => t.disconnect();
59
- }, []), ce(() => {
60
+ }, []), b(() => {
60
61
  a(null), s(1), l(1);
61
62
  }, [t]);
62
63
  let f = x(() => {
63
- let e = Math.max(vt, u - yt);
64
- return Math.round(Math.min(_t, e) * c);
65
- }, [c, u]), p = se((e) => {
64
+ let e = Math.max(yt, u - bt);
65
+ return Math.round(Math.min(vt, e) * c);
66
+ }, [c, u]), p = ce((e) => {
66
67
  a(e.numPages), s(1);
67
- }, []), m = o > 1, h = i !== null && o < i, g = c > bt, ee = c < xt, te = i === null ? `第 ${o} 頁` : `第 ${o} / ${i} 頁`, ne = `${Math.round(c * 100)}%`;
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)}%`;
68
69
  return /* @__PURE__ */ k("section", {
69
70
  "aria-label": `${e} PDF 預覽`,
70
71
  className: z.root,
@@ -78,7 +79,7 @@ function Ct({ filename: e, fileUrl: t, onDownload: n }) {
78
79
  /* @__PURE__ */ O(C, {
79
80
  "aria-label": "上一頁",
80
81
  disabled: !m,
81
- icon: Ke,
82
+ icon: Qe,
82
83
  onClick: () => {
83
84
  s((e) => Math.max(1, e - 1));
84
85
  },
@@ -94,7 +95,7 @@ function Ct({ filename: e, fileUrl: t, onDownload: n }) {
94
95
  /* @__PURE__ */ O(C, {
95
96
  "aria-label": "下一頁",
96
97
  disabled: !h,
97
- icon: qe,
98
+ icon: N,
98
99
  onClick: () => {
99
100
  s((e) => i === null ? e : Math.min(i, e + 1));
100
101
  },
@@ -110,9 +111,9 @@ function Ct({ filename: e, fileUrl: t, onDownload: n }) {
110
111
  /* @__PURE__ */ O(C, {
111
112
  "aria-label": "縮小",
112
113
  disabled: !g,
113
- icon: N,
114
+ icon: ot,
114
115
  onClick: () => {
115
- l((e) => Math.max(bt, e - St));
116
+ l((e) => Math.max(xt, e - B));
116
117
  },
117
118
  size: "minor",
118
119
  variant: "base-secondary"
@@ -126,9 +127,9 @@ function Ct({ filename: e, fileUrl: t, onDownload: n }) {
126
127
  /* @__PURE__ */ O(C, {
127
128
  "aria-label": "放大",
128
129
  disabled: !ee,
129
- icon: tt,
130
+ icon: at,
130
131
  onClick: () => {
131
- l((e) => Math.min(xt, e + St));
132
+ l((e) => Math.min(St, e + B));
132
133
  },
133
134
  size: "minor",
134
135
  variant: "base-secondary"
@@ -136,7 +137,7 @@ function Ct({ filename: e, fileUrl: t, onDownload: n }) {
136
137
  ]
137
138
  }),
138
139
  n ? /* @__PURE__ */ O(C, {
139
- icon: M,
140
+ icon: P,
140
141
  iconType: "leading",
141
142
  onClick: n,
142
143
  size: "minor",
@@ -148,15 +149,15 @@ function Ct({ filename: e, fileUrl: t, onDownload: n }) {
148
149
  className: z.viewport,
149
150
  ref: r,
150
151
  children: /* @__PURE__ */ O(pt, {
151
- error: /* @__PURE__ */ O(B, { message: "PDF 無法載入。" }),
152
+ error: /* @__PURE__ */ O(wt, { message: "PDF 無法載入。" }),
152
153
  file: t,
153
- loading: /* @__PURE__ */ O(B, { message: "正在載入 PDF..." }),
154
- noData: /* @__PURE__ */ O(B, { message: "沒有可預覽的 PDF。" }),
154
+ loading: /* @__PURE__ */ O(wt, { message: "正在載入 PDF..." }),
155
+ noData: /* @__PURE__ */ O(wt, { message: "沒有可預覽的 PDF。" }),
155
156
  onLoadSuccess: p,
156
157
  suspense: !1,
157
158
  children: /* @__PURE__ */ O(mt, {
158
159
  className: z.page,
159
- loading: /* @__PURE__ */ O(B, { message: "正在載入頁面..." }),
160
+ loading: /* @__PURE__ */ O(wt, { message: "正在載入頁面..." }),
160
161
  pageNumber: o,
161
162
  renderAnnotationLayer: !0,
162
163
  renderTextLayer: !0,
@@ -166,7 +167,7 @@ function Ct({ filename: e, fileUrl: t, onDownload: n }) {
166
167
  })]
167
168
  });
168
169
  }
169
- function B({ message: e }) {
170
+ function wt({ message: e }) {
170
171
  return /* @__PURE__ */ O("div", {
171
172
  className: z.state,
172
173
  children: /* @__PURE__ */ O(D, {
@@ -177,17 +178,17 @@ function B({ message: e }) {
177
178
  });
178
179
  }
179
180
  // src/views/instances/detail/submitted-by.ts
180
- function wt({ initiatorMemberId: e, submittedByMemberId: t }) {
181
+ function Tt({ initiatorMemberId: e, submittedByMemberId: t }) {
181
182
  return t && t !== e ? t : null;
182
183
  }
183
- function Tt(e, t) {
184
- let n = wt(e);
184
+ function Et(e, t) {
185
+ let n = Tt(e);
185
186
  if (!n || !e.initiatorMemberId) return null;
186
187
  let r = (e) => t.get(e)?.name ?? e;
187
188
  return `由 ${r(n)} 代 ${r(e.initiatorMemberId)} 送出`;
188
189
  }
189
190
  // src/views/instances/detail/sections/shared.ts
190
- function Et(e) {
191
+ function Dt(e) {
191
192
  let t = V(e, "from"), n = V(e, "to"), r = V(e, "reason");
192
193
  return !t || !n || !r ? null : {
193
194
  from: t,
@@ -196,10 +197,10 @@ function Et(e) {
196
197
  to: n
197
198
  };
198
199
  }
199
- function Dt(e) {
200
+ function Ot(e) {
200
201
  try {
201
202
  let t = JSON.parse(e);
202
- return Array.isArray(t) ? t.map((e) => U(e) ? Et(e) : null).filter((e) => e !== null) : [];
203
+ return Array.isArray(t) ? t.map((e) => At(e) ? Dt(e) : null).filter((e) => e !== null) : [];
203
204
  } catch {
204
205
  return [];
205
206
  }
@@ -208,42 +209,42 @@ function V(e, t) {
208
209
  let n = e[t];
209
210
  return typeof n == "string" ? n : null;
210
211
  }
211
- function Ot(e, t) {
212
+ function kt(e, t) {
212
213
  let n = e[t];
213
214
  return Array.isArray(n) ? n.filter((e) => typeof e == "string") : [];
214
215
  }
215
- function kt(e, t) {
216
+ function H(e, t) {
216
217
  let n = e[t];
217
218
  return typeof n == "number" ? n : null;
218
219
  }
219
- function H(e) {
220
+ function U(e) {
220
221
  return typeof e == "string" && e.trim().length > 0;
221
222
  }
222
- function U(e) {
223
+ function At(e) {
223
224
  return typeof e == "object" && !!e;
224
225
  }
225
- function At(e) {
226
+ function jt(e) {
226
227
  return e.status === "PENDING" || e.status === "IN_PROGRESS";
227
228
  }
228
- function jt(e) {
229
+ function Mt(e) {
229
230
  return !Number.isFinite(e) || e <= 0 ? "-" : e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1024 / 1024).toFixed(1)} MB`;
230
231
  }
231
- function Mt(e) {
232
+ function W(e) {
232
233
  return e.length > 16 ? `${e.slice(0, 12)}...` : e;
233
234
  }
234
235
  function Nt(e) {
235
236
  return e === "APPROVED" ? "已同意" : e === "CANCELLED" ? "已取消" : e === "DRAFT" ? "草稿" : e === "EXPIRED" ? "已逾期" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "RUNNING" ? "進行中" : e;
236
237
  }
237
- function W(e) {
238
+ function G(e) {
238
239
  return e === "PENDING" ? "待處理" : e === "IN_PROGRESS" ? "處理中" : e === "COMPLETED" ? "已完成" : e === "CANCELLED" ? "已取消" : e === "TRANSFERRED" ? "已轉派" : e;
239
240
  }
240
- function G(e) {
241
+ function Pt(e) {
241
242
  return e === "APPROVED" ? "同意" : e === "REJECTED" ? "拒絕" : e === "RETURNED" ? "退回" : e === "TRANSFERRED" ? "轉派" : e;
242
243
  }
243
- function Pt(e) {
244
+ function Ft(e) {
244
245
  return e === "startEvent" ? "開始" : e === "endEvent" ? "完成" : e === "userTask" ? "簽核節點" : e === "serviceTask" ? "知會節點" : e === "exclusiveGateway" ? "條件分流" : "平行處理";
245
246
  }
246
- function Ft(e, t) {
247
+ function It(e, t) {
247
248
  return t?.nodes.find((t) => t.id === e)?.data.label ?? e;
248
249
  }
249
250
  function K(e, t) {
@@ -251,42 +252,42 @@ function K(e, t) {
251
252
  let n = t.get(e);
252
253
  return n ? p(n.name, n.email, "fullwidth") : e;
253
254
  }
254
- function It(e, t = /* @__PURE__ */ new Map()) {
255
- let n = Dt(e.delegationChainJson);
255
+ function Lt(e, t = /* @__PURE__ */ new Map()) {
256
+ let n = Ot(e.delegationChainJson);
256
257
  if (!e.assigneeMemberId) return e.candidateMemberIds.length ? `候選 ${e.candidateMemberIds.map((e) => K(e, t)).join("、")}` : "未指定";
257
258
  let r = K(e.assigneeMemberId, t), i = K(e.originalAssigneeMemberId, t);
258
259
  return n.length === 0 || e.originalAssigneeMemberId === e.assigneeMemberId ? r : `${r}(原:${i})`;
259
260
  }
260
- function Lt(e, t) {
261
+ function Rt(e, t) {
261
262
  return t ? e.assigneeMemberId === t || (e.openCandidateMemberIds ?? e.candidateMemberIds).includes(t) : !1;
262
263
  }
263
- function Rt(e, t) {
264
- let n = e.filter((e) => Lt(e, t) && (e.status === "PENDING" || e.status === "IN_PROGRESS"));
264
+ function zt(e, t) {
265
+ let n = e.filter((e) => Rt(e, t) && (e.status === "PENDING" || e.status === "IN_PROGRESS"));
265
266
  return n.find((e) => !e.isAdhoc) ?? n[0] ?? null;
266
267
  }
267
- function zt(e, t) {
268
+ function Bt(e, t) {
268
269
  if (t.type !== "userTask" || !t.data.returnBehavior.allowReturn) return [];
269
270
  if (t.data.returnBehavior.allowedTargets === "ANY") {
270
- let n = L(e, t.id);
271
+ let n = ht(e, t.id);
271
272
  return e.nodes.filter((e) => n.includes(e.id)).map((e) => ({
272
273
  id: e.id,
273
- name: `${e.data.label}(${Pt(e.type)})`
274
+ name: `${e.data.label}(${Ft(e.type)})`
274
275
  }));
275
276
  }
276
277
  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);
277
278
  return r ? [{
278
279
  id: r.id,
279
- name: `${r.data.label}(${Pt(r.type)})`
280
+ name: `${r.data.label}(${Ft(r.type)})`
280
281
  }] : [];
281
282
  }
282
- function Bt(e) {
283
+ function Vt(e) {
283
284
  return {
284
285
  email: e.email,
285
286
  id: e.memberId,
286
287
  name: p(e.name, e.email, "dot")
287
288
  };
288
289
  }
289
- function Vt({ memberIds: e, useWebhookTarget: t, webhookUrl: n }) {
290
+ function q({ memberIds: e, useWebhookTarget: t, webhookUrl: n }) {
290
291
  if (t) {
291
292
  let e = n.trim();
292
293
  return e ? {
@@ -311,11 +312,11 @@ function Vt({ memberIds: e, useWebhookTarget: t, webhookUrl: n }) {
311
312
  valid: !1
312
313
  };
313
314
  }
314
- function q(e) {
315
+ function Ht(e) {
315
316
  return !!e;
316
317
  }
317
- function Ht(e) {
318
- if (!U(e)) return null;
318
+ function Ut(e) {
319
+ if (!At(e)) return null;
319
320
  let t = e.email, n = e.id, r = e.name;
320
321
  return typeof n == "string" && typeof r == "string" ? {
321
322
  email: typeof t == "string" ? t : null,
@@ -323,7 +324,7 @@ function Ht(e) {
323
324
  name: r
324
325
  } : null;
325
326
  }
326
- function Ut(e, t) {
327
+ function Wt(e, t) {
327
328
  let n = e.trim().toLocaleLowerCase();
328
329
  if (!n) return null;
329
330
  let r = t.filter((e) => [
@@ -334,20 +335,20 @@ function Ut(e, t) {
334
335
  return r.length === 1 ? r[0] ?? null : null;
335
336
  }
336
337
  function J(e) {
337
- return H(e) ? {
338
+ return U(e) ? {
338
339
  text: e,
339
340
  type: "text"
340
341
  } : null;
341
342
  }
342
- function Wt(e, t, n = "neutral") {
343
- return H(t) ? {
343
+ function Gt(e, t, n = "neutral") {
344
+ return U(t) ? {
344
345
  label: e,
345
346
  text: t,
346
347
  tone: n,
347
348
  type: "comment"
348
349
  } : null;
349
350
  }
350
- function Gt(e, t, n, r) {
351
+ function Kt(e, t, n, r) {
351
352
  let i = t ? n.get(t) : null;
352
353
  return {
353
354
  email: i?.email ?? null,
@@ -360,40 +361,40 @@ function Gt(e, t, n, r) {
360
361
  function Y(e) {
361
362
  return !!e;
362
363
  }
363
- function Kt(e) {
364
+ function qt(e) {
364
365
  let t = e.findIndex((e) => e.id.startsWith("pending-task-") || e.id.startsWith("future-node-"));
365
366
  return t === -1 ? e.length : t;
366
367
  }
367
- function qt(e) {
368
- 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" || X(e) || Jt(e.eventType, Qt(e));
369
- }
370
368
  function X(e) {
371
- return e.eventType === "TASK_CREATED" && Ot(Qt(e), "sequentialCandidateMemberIds").length > 0;
369
+ 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" || Z(e) || Yt(e.eventType, $t(e));
372
370
  }
373
371
  function Z(e) {
372
+ return e.eventType === "TASK_CREATED" && kt($t(e), "sequentialCandidateMemberIds").length > 0;
373
+ }
374
+ function Q(e) {
374
375
  if (e.eventType !== "TASK_CANDIDATE_ACTIVATED" && e.eventType !== "TASK_CREATED") return [];
375
- let t = Qt(e);
376
+ let t = $t(e);
376
377
  return [
377
- ...Ot(t, "sequentialCandidateMemberIds"),
378
+ ...kt(t, "sequentialCandidateMemberIds"),
378
379
  V(t, "candidateMemberId"),
379
380
  V(t, "previousMemberId")
380
- ].filter(H);
381
+ ].filter(U);
381
382
  }
382
- var Q = /* @__PURE__ */ new Set([
383
+ var Jt = /* @__PURE__ */ new Set([
383
384
  "SERVICE_TASK_EXECUTED",
384
385
  "SERVICE_TASK_FAILED",
385
386
  "WEBHOOK_DELIVERY_RETRIED"
386
387
  ]);
387
- function Jt(e, t) {
388
- return Q.has(e) && V(t, "action") === "NOTIFY_WEBHOOK";
388
+ function Yt(e, t) {
389
+ return Jt.has(e) && V(t, "action") === "NOTIFY_WEBHOOK";
389
390
  }
390
- function Yt(e) {
391
+ function Xt(e) {
391
392
  return V(e, "endpointLabel") ?? V(e, "endpointKey") ?? "外部系統";
392
393
  }
393
- function Xt(e) {
394
+ function Zt(e) {
394
395
  return e === "APPROVED" ? "已同意" : e === "REJECTED" ? "已拒絕" : e === "RETURNED" ? "已退回" : e === "TRANSFERRED" ? "已轉派" : "簽核已決議";
395
396
  }
396
- function Zt(e, t) {
397
+ function Qt(e, t) {
397
398
  if (e === "INSTANCE_STARTED") return "案件已發起";
398
399
  if (e === "INSTANCE_CANCELLED") return "案件已取消";
399
400
  if (e === "INSTANCE_EXPIRED") return "案件逾期,已由系統終止";
@@ -403,31 +404,31 @@ function Zt(e, t) {
403
404
  if (e === "TOKEN_ADVANCED") return "流程已前進";
404
405
  if (e === "TASK_CREATED") return "待簽任務已建立";
405
406
  if (e === "TASK_CANDIDATE_ACTIVATED") return "輪到下一位簽核";
406
- if (e === "TASK_DECIDED") return Xt(V(t, "action"));
407
+ if (e === "TASK_DECIDED") return Zt(V(t, "action"));
407
408
  if (e === "SLA_TRIGGERED") return "時限提醒已觸發";
408
409
  if (e === "TASK_REASSIGNED") return "管理者改派待辦";
409
- if (Jt(e, t)) {
410
- let n = Yt(t);
410
+ if (Yt(e, t)) {
411
+ let n = Xt(t);
411
412
  return e === "SERVICE_TASK_EXECUTED" ? `已通知外部系統:${n}` : e === "SERVICE_TASK_FAILED" ? `通知外部系統失敗:${n}` : `管理者重新傳送外部系統通知:${n}`;
412
413
  }
413
414
  return e;
414
415
  }
415
- function Qt(e) {
416
+ function $t(e) {
416
417
  try {
417
418
  let t = JSON.parse(e.payloadJson);
418
- return U(t) ? t : {};
419
+ return At(t) ? t : {};
419
420
  } catch {
420
421
  return {};
421
422
  }
422
423
  }
423
- function $t(e, t) {
424
- return e.eventType === "SLA_TRIGGERED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "SERVICE_TASK_FAILED" && Jt(e.eventType, t) || V(t, "action") === "REJECTED" || V(t, "instanceState") === "REJECTED";
424
+ function en(e, t) {
425
+ return e.eventType === "SLA_TRIGGERED" || e.eventType === "INSTANCE_EXPIRED" || e.eventType === "SERVICE_TASK_FAILED" && Yt(e.eventType, t) || V(t, "action") === "REJECTED" || V(t, "instanceState") === "REJECTED";
425
426
  }
426
- function en(e) {
427
+ function tn(e) {
427
428
  return t(e);
428
429
  }
429
- function tn(e, t, n, r) {
430
- if (e.eventType === "INSTANCE_STARTED") return Tt({
430
+ function nn(e, t, n, r) {
431
+ if (e.eventType === "INSTANCE_STARTED") return Et({
431
432
  initiatorMemberId: e.actorMemberId,
432
433
  submittedByMemberId: V(t, "submittedByMemberId")
433
434
  }, r);
@@ -438,27 +439,27 @@ function tn(e, t, n, r) {
438
439
  return n ? `輪到:${i}(前一位:${K(n, r)})` : `輪到:${i}`;
439
440
  }
440
441
  if (e.eventType === "TASK_CREATED") {
441
- let e = Ot(t, "sequentialCandidateMemberIds");
442
+ let e = kt(t, "sequentialCandidateMemberIds");
442
443
  if (e.length) return `簽核順序:${e.map((e) => K(e, r)).join(" → ")}`;
443
444
  let n = V(t, "assigneeMemberId"), i = V(t, "originalAssigneeMemberId");
444
445
  if (!n) {
445
- let e = Ot(t, "candidateMemberIds");
446
+ let e = kt(t, "candidateMemberIds");
446
447
  return e.length ? `候選簽核人:${e.map((e) => K(e, r)).join("、")}` : null;
447
448
  }
448
449
  let a = K(n, r), o = K(i, r);
449
450
  return i && i !== n ? `待簽人:${a}(原簽核人:${o})` : `待簽人:${a}`;
450
451
  }
451
452
  if (e.eventType === "TASK_DECIDED") {
452
- let e = V(t, "action"), n = V(t, "comment"), i = e ? `決議:${G(e)}` : null, a = V(t, "transferToMemberId");
453
- return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(H).join(" · ") : e === "APPROVED" && n ? [i, `同意說明:${n}`].filter(H).join(" · ") : e === "TRANSFERRED" ? [i, `轉派給:${K(a, r)}`].filter(H).join(" · ") : i;
453
+ let e = V(t, "action"), n = V(t, "comment"), i = e ? `決議:${Pt(e)}` : null, a = V(t, "transferToMemberId");
454
+ return e === "REJECTED" && n ? [i, `拒絕原因:${n}`].filter(U).join(" · ") : e === "APPROVED" && n ? [i, `同意說明:${n}`].filter(U).join(" · ") : e === "TRANSFERRED" ? [i, `轉派給:${K(a, r)}`].filter(U).join(" · ") : i;
454
455
  }
455
456
  if (e.eventType === "TOKEN_ADVANCED") {
456
457
  let e = V(t, "action");
457
- if (e) return `流程結果:${G(e)}`;
458
- let r = kt(t, "arrivedCount"), i = kt(t, "requiredCount");
458
+ if (e) return `流程結果:${Pt(e)}`;
459
+ let r = H(t, "arrivedCount"), i = H(t, "requiredCount");
459
460
  if (r !== null && i !== null) return `等待匯合:${r}/${i}`;
460
461
  let a = V(t, "fromNodeId"), o = V(t, "toNodeId");
461
- if (a && o) return `由 ${Ft(a, n)} 前進至 ${Ft(o, n)}`;
462
+ if (a && o) return `由 ${It(a, n)} 前進至 ${It(o, n)}`;
462
463
  }
463
464
  if (e.eventType === "ENGINE_PROCESS_REQUESTED") {
464
465
  let e = V(t, "state");
@@ -466,22 +467,22 @@ function tn(e, t, n, r) {
466
467
  }
467
468
  return null;
468
469
  }
469
- function nn(e, t, n, r, i, a, o, s = null, c = null) {
470
- if (e.eventType === "INSTANCE_RESUBMITTED") return [Wt("簽核意見", V(t, "comment"))].filter(Y);
471
- if (e.eventType !== "TASK_DECIDED") return [J(tn(e, t, n, o))].filter(Y);
472
- let l = rn(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;
470
+ function rn(e, t, n, r, i, a, o, s = null, c = null) {
471
+ if (e.eventType === "INSTANCE_RESUBMITTED") return [Gt("簽核意見", V(t, "comment"))].filter(Y);
472
+ if (e.eventType !== "TASK_DECIDED") return [J(nn(e, t, n, o))].filter(Y);
473
+ let l = an(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;
473
474
  return [
474
- J(u ? `決議:${G(u)}` : null),
475
- u === "REJECTED" ? Wt("拒絕原因", d ?? "-", "danger") : null,
476
- u === "APPROVED" ? Wt("同意說明", d) : null,
477
- u === "RETURNED" ? Wt("退回說明", d ?? "-") : null,
475
+ J(u ? `決議:${Pt(u)}` : null),
476
+ u === "REJECTED" ? Gt("拒絕原因", d ?? "-", "danger") : null,
477
+ u === "APPROVED" ? Gt("同意說明", d) : null,
478
+ u === "RETURNED" ? Gt("退回說明", d ?? "-") : null,
478
479
  u === "TRANSFERRED" ? J(`轉派給:${K(f, o)}`) : null,
479
- u === "TRANSFERRED" ? Wt("轉派說明", d ?? "-") : null,
480
- J(on(t, s)),
481
- m ? J(a?.valid ? `簽章:已驗證(${Mt(m.signedPayloadHash)})` : `簽章:待檢查(${Mt(m.signedPayloadHash)})`) : null
480
+ u === "TRANSFERRED" ? Gt("轉派說明", d ?? "-") : null,
481
+ J(sn(t, s)),
482
+ m ? J(a?.valid ? `簽章:已驗證(${W(m.signedPayloadHash)})` : `簽章:待檢查(${W(m.signedPayloadHash)})`) : null
482
483
  ].filter(Y);
483
484
  }
484
- function rn(e, t, n, r) {
485
+ function an(e, t, n, r) {
485
486
  let i = e.taskId;
486
487
  if (!i) return null;
487
488
  let a = V(t, "decisionId"), o = (t) => a ? t.id === a : t.decidedByMemberId === e.actorMemberId;
@@ -489,16 +490,16 @@ function rn(e, t, n, r) {
489
490
  let e = n.get(i) ?? null;
490
491
  return e && o(e) ? e : null;
491
492
  }
492
- return an(r.filter((e) => e.taskId === i && o(e)), new Date(e.createdAt).getTime());
493
+ return on(r.filter((e) => e.taskId === i && o(e)), new Date(e.createdAt).getTime());
493
494
  }
494
- function an(e, t) {
495
+ function on(e, t) {
495
496
  let n = (e) => Math.abs(d(e) - t), r = (e, t) => {
496
497
  let r = n(e) - n(t);
497
498
  return r < 0 || !(r > 0) && f(e, t) < 0;
498
499
  };
499
500
  return e.reduce((e, t) => !e || r(t, e) ? t : e, null);
500
501
  }
501
- function on(e, t) {
502
+ function sn(e, t) {
502
503
  let n = e.changedFieldKeys;
503
504
  if (!Array.isArray(n)) return null;
504
505
  let r = n.filter((e) => typeof e == "string" && e !== "");
@@ -506,86 +507,86 @@ function on(e, t) {
506
507
  let i = r.map((e) => t?.fields.find((t) => t.fieldKey === e)?.label || e);
507
508
  return `補填 ${r.length} 個欄位:${i.join("、")}`;
508
509
  }
509
- function sn(e, t, n, r, i) {
510
+ function cn(e, t, n, r, i) {
510
511
  if (e.type === "startEvent" || i.has(e.id)) return !1;
511
512
  if (r === "REJECTED") return !0;
512
- let a = _n(e, t, n, r);
513
+ let a = vn(e, t, n, r);
513
514
  return a.tone === "neutral" || a.tone === "waiting";
514
515
  }
515
- function cn(e, t, n, r, i) {
516
+ function ln(e, t, n, r, i) {
516
517
  if (r !== "RUNNING" && r !== "REJECTED") return [];
517
- let a = e.nodes.filter((e) => sn(e, t, n, r, i)), o = ln(e, a, t, n, i), s = new Map(e.nodes.map((e, t) => [e.id, t]));
518
+ let a = e.nodes.filter((e) => cn(e, t, n, r, i)), o = un(e, a, t, n, i), s = new Map(e.nodes.map((e, t) => [e.id, t]));
518
519
  return a.filter((e) => o.has(e.id)).sort((e, t) => {
519
520
  let n = o.get(e.id) ?? 0, r = o.get(t.id) ?? 0;
520
521
  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;
521
522
  });
522
523
  }
523
- function ln(e, t, n, r, i) {
524
+ function un(e, t, n, r, i) {
524
525
  let a = new Set(t.map((e) => e.id)), o = e.edges.reduce((e, t) => {
525
526
  let n = [...e.get(t.source) ?? [], t.target];
526
527
  return new Map(e).set(t.source, n);
527
528
  }, /* @__PURE__ */ new Map());
528
- return un(e, n, r, i).reduce((e, t) => pn(e, dn(t, o, a)), /* @__PURE__ */ new Map());
529
+ return dn(e, n, r, i).reduce((e, t) => mn(e, fn(t, o, a)), /* @__PURE__ */ new Map());
529
530
  }
530
- function un(e, t, n, r) {
531
- 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([
531
+ function dn(e, t, n, r) {
532
+ let i = n.filter((e) => e.status === "ACTIVE" || e.status === "WAITING").map((e) => e.currentNodeId), a = t.filter(jt).map((e) => e.nodeId), o = e.nodes.filter((e) => r.has(e.id)).map((e) => e.id), s = [.../* @__PURE__ */ new Set([
532
533
  ...i,
533
534
  ...a,
534
535
  ...o
535
536
  ])], c = e.nodes.filter((e) => e.type === "startEvent").map((e) => e.id);
536
537
  return s.length > 0 ? s : c;
537
538
  }
538
- function dn(e, t, n) {
539
- return fn([{
539
+ function fn(e, t, n) {
540
+ return pn([{
540
541
  distance: 0,
541
542
  nodeId: e
542
543
  }], t, n);
543
544
  }
544
- function fn(e, t, n, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map()) {
545
+ function pn(e, t, n, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map()) {
545
546
  let [a, ...o] = e;
546
547
  if (!a) return i;
547
- if (r.has(a.nodeId)) return fn(o, t, n, r, i);
548
+ if (r.has(a.nodeId)) return pn(o, t, n, r, i);
548
549
  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;
549
- return fn([...o, ...(t.get(a.nodeId) ?? []).map((e) => ({
550
+ return pn([...o, ...(t.get(a.nodeId) ?? []).map((e) => ({
550
551
  distance: a.distance + 1,
551
552
  nodeId: e
552
553
  }))], t, n, s, c);
553
554
  }
554
- function pn(e, t) {
555
+ function mn(e, t) {
555
556
  return [...t.entries()].reduce((e, [t, n]) => new Map(e).set(t, Math.min(e.get(t) ?? n, n)), e);
556
557
  }
557
- function mn(e) {
558
+ function hn(e) {
558
559
  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}`;
559
560
  }
560
- function hn(e, t, n, r, i, a, o, s, c, u = null, d = null) {
561
- let f = d ? l(d) : null, p = e.filter(qt).map((e) => {
562
- let t = Qt(e), n = e.nodeId ? Ft(e.nodeId, r) : null;
561
+ function gn(e, t, n, r, i, a, o, s, c, u = null, d = null) {
562
+ let f = d ? l(d) : null, p = e.filter(X).map((e) => {
563
+ let t = $t(e), n = e.nodeId ? It(e.nodeId, r) : null;
563
564
  return {
564
565
  descriptionParts: [
565
566
  J(n ? `節點:${n}` : "節點:全流程"),
566
- Gt("操作者", e.actorMemberId, a, "系統"),
567
- J(`時間:${en(e.createdAt)}`),
568
- ...nn(e, t, r, o, s, c, a, u, f ? f.get(e.taskId ?? "") ?? [] : null)
567
+ Kt("操作者", e.actorMemberId, a, "系統"),
568
+ J(`時間:${tn(e.createdAt)}`),
569
+ ...rn(e, t, r, o, s, c, a, u, f ? f.get(e.taskId ?? "") ?? [] : null)
569
570
  ].filter(Y),
570
- error: $t(e, t),
571
+ error: en(e, t),
571
572
  id: e.id,
572
- title: Zt(e.eventType, t)
573
+ title: Qt(e.eventType, t)
573
574
  };
574
- }), m = t.filter(At).map((e) => ({
575
+ }), m = t.filter(jt).map((e) => ({
575
576
  descriptionParts: [
576
- J(`節點:${Ft(e.nodeId, r)}`),
577
- Gt("處理者", e.assigneeMemberId, a, "未指定"),
578
- J(`建立時間:${en(e.createdAt)}`)
577
+ J(`節點:${It(e.nodeId, r)}`),
578
+ Kt("處理者", e.assigneeMemberId, a, "未指定"),
579
+ J(`建立時間:${tn(e.createdAt)}`)
579
580
  ].filter(Y),
580
581
  error: !1,
581
582
  id: `pending-task-${e.id}`,
582
583
  title: e.status === "IN_PROGRESS" ? "簽核處理中" : "等待簽核處理"
583
- })), h = new Set([...e.filter(qt).map((e) => e.nodeId), ...t.map((e) => e.nodeId)].filter(H)), g = r ? cn(r, t, n, i, h).map((e) => ({
584
- descriptionParts: [J(`${Pt(e.type)} · 尚未抵達`)].filter(Y),
584
+ })), h = new Set([...e.filter(X).map((e) => e.nodeId), ...t.map((e) => e.nodeId)].filter(U)), g = r ? ln(r, t, n, i, h).map((e) => ({
585
+ descriptionParts: [J(`${Ft(e.type)} · 尚未抵達`)].filter(Y),
585
586
  error: !1,
586
587
  forcePending: !0,
587
588
  id: `future-node-${e.id}`,
588
- title: mn(e)
589
+ title: hn(e)
589
590
  })) : [];
590
591
  return [
591
592
  ...p,
@@ -593,7 +594,7 @@ function hn(e, t, n, r, i, a, o, s, c, u = null, d = null) {
593
594
  ...g
594
595
  ];
595
596
  }
596
- var gn = {
597
+ var _n = {
597
598
  APPROVED: {
598
599
  statusLabel: "已完成",
599
600
  tone: "completed"
@@ -611,20 +612,20 @@ var gn = {
611
612
  tone: "cancelled"
612
613
  }
613
614
  };
614
- function _n(e, t, n, r) {
615
+ function vn(e, t, n, r) {
615
616
  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");
616
617
  if (a) return {
617
- secondaryLabel: `處理者 ${It(a)}`,
618
+ secondaryLabel: `處理者 ${Lt(a)}`,
618
619
  statusLabel: "待處理",
619
620
  tone: "current"
620
621
  };
621
622
  if (o) return {
622
- secondaryLabel: `已取消 ${It(o)}`,
623
+ secondaryLabel: `已取消 ${Lt(o)}`,
623
624
  statusLabel: "已取消",
624
625
  tone: "cancelled"
625
626
  };
626
627
  if (s) return {
627
- secondaryLabel: `已完成 ${It(s)}`,
628
+ secondaryLabel: `已完成 ${Lt(s)}`,
628
629
  statusLabel: "已完成",
629
630
  tone: "completed"
630
631
  };
@@ -643,56 +644,56 @@ function _n(e, t, n, r) {
643
644
  statusLabel: "已發起",
644
645
  tone: "completed"
645
646
  };
646
- let d = e.type === "endEvent" ? gn[r] : void 0;
647
+ let d = e.type === "endEvent" ? _n[r] : void 0;
647
648
  return d ? {
648
649
  ...d,
649
650
  secondaryLabel: r
650
651
  } : {
651
- secondaryLabel: Pt(e.type),
652
+ secondaryLabel: Ft(e.type),
652
653
  statusLabel: "未抵達",
653
654
  tone: "neutral"
654
655
  };
655
656
  }
656
657
  // src/views/instances/detail/sections/container-helpers.ts
657
- async function vn({ activityLogs: e, adhocDirectives: t = [], instance: n, tasks: r }) {
658
+ async function yn({ activityLogs: e, adhocDirectives: t = [], instance: n, tasks: r }) {
658
659
  let i = [...new Set([
659
660
  n?.initiatorMemberId ?? null,
660
661
  n?.submittedByMemberId ?? null,
661
662
  ...e.map((e) => e.actorMemberId),
662
- ...e.flatMap(Z),
663
+ ...e.flatMap(Q),
663
664
  ...r.map((e) => e.assigneeMemberId),
664
665
  ...r.map((e) => e.originalAssigneeMemberId),
665
666
  ...r.flatMap((e) => e.candidateMemberIds),
666
- ...r.flatMap((e) => Dt(e.delegationChainJson).flatMap((e) => [e.from, e.to])),
667
- ...t.flatMap((e) => [e.createdByMemberId, ...yn(e.targetValueJson)])
668
- ].filter(H))];
667
+ ...r.flatMap((e) => Ot(e.delegationChainJson).flatMap((e) => [e.from, e.to])),
668
+ ...t.flatMap((e) => [e.createdByMemberId, ...bn(e.targetValueJson)])
669
+ ].filter(U))];
669
670
  try {
670
- return await ze(i);
671
+ return await Be(i);
671
672
  } catch {
672
673
  return [];
673
674
  }
674
675
  }
675
- function yn(e) {
676
+ function bn(e) {
676
677
  try {
677
678
  return (JSON.parse(e).memberIds ?? []).filter((e) => typeof e == "string");
678
679
  } catch {
679
680
  return [];
680
681
  }
681
682
  }
682
- async function bn(e) {
683
- return (await Promise.all(e.map((e) => A(e.id)))).flat();
683
+ async function xn(e) {
684
+ return (await Promise.all(e.map((e) => Me(e.id)))).flat();
684
685
  }
685
686
  // src/views/instances/detail/use-resubmit-comment-draft.ts
686
- function xn(e) {
687
+ function Sn(e) {
687
688
  let [t, n] = S({
688
689
  instanceId: e,
689
690
  text: ""
690
- }), r = se((t) => n({
691
+ }), r = ce((t) => n({
691
692
  instanceId: e,
692
693
  text: t
693
694
  }), [e]);
694
695
  return {
695
- clearAfterResubmit: se((e) => n((t) => t.instanceId === e ? {
696
+ clearAfterResubmit: ce((e) => n((t) => t.instanceId === e ? {
696
697
  instanceId: e,
697
698
  text: ""
698
699
  } : t), []),
@@ -701,29 +702,29 @@ function xn(e) {
701
702
  };
702
703
  }
703
704
  // src/views/instances/detail/sections/InstanceFormSection.tsx
704
- var Sn = {
705
+ var $ = {
705
706
  display: "grid",
706
707
  gap: 16
707
- }, $ = {
708
+ }, Cn = {
708
709
  display: "flex",
709
710
  flexWrap: "wrap",
710
711
  gap: 8
711
- }, Cn = 2e3, wn = {
712
+ }, wn = 2e3, Tn = {
712
713
  minWidth: "100%",
713
714
  width: "100%"
714
715
  };
715
- function Tn(e) {
716
+ function En(e) {
716
717
  e && (e.style.width = "100%");
717
718
  }
718
- function En({ 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 }) {
719
- let oe = l?.formDefinitionSnapshot.schema, _ = l?.workflowSnapshot, v = x(() => n && oe && _ ? ae(oe, _) : c?.schema ?? oe, [
719
+ function Dn({ 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 }) {
720
+ let oe = l?.formDefinitionSnapshot.schema, _ = l?.workflowSnapshot, se = x(() => n && oe && _ ? ae(oe, _) : c?.schema ?? oe, [
720
721
  n,
721
722
  c?.schema,
722
723
  oe,
723
724
  _
724
- ]), y = !n && c !== null;
725
+ ]), v = !n && c !== null;
725
726
  return /* @__PURE__ */ k("div", {
726
- style: Sn,
727
+ style: $,
727
728
  children: [
728
729
  i ? /* @__PURE__ */ O(D, {
729
730
  color: "text-error",
@@ -736,15 +737,15 @@ function En({ attachments: t, canResubmitInstance: n, deciding: r, error: i, fie
736
737
  children: "載入中..."
737
738
  }) : null,
738
739
  h ? /* @__PURE__ */ k("div", {
739
- style: Sn,
740
+ style: $,
740
741
  children: [/* @__PURE__ */ O(me, {
741
742
  content: "表單在你填寫期間被更新了,你填的內容還在。請重新載入後確認再同意。",
742
743
  severity: "error"
743
744
  }), /* @__PURE__ */ O("div", {
744
- style: $,
745
+ style: Cn,
745
746
  children: /* @__PURE__ */ O(C, {
746
747
  disabled: u,
747
- icon: Ze,
748
+ icon: rt,
748
749
  iconType: "leading",
749
750
  onClick: h,
750
751
  variant: "base-secondary",
@@ -752,11 +753,11 @@ function En({ attachments: t, canResubmitInstance: n, deciding: r, error: i, fie
752
753
  })
753
754
  })]
754
755
  }) : null,
755
- y && c.fieldCount > 0 ? /* @__PURE__ */ O(me, {
756
+ v && c.fieldCount > 0 ? /* @__PURE__ */ O(me, {
756
757
  content: `本關需要你補填 ${c.fieldCount} 個欄位,按「同意」時會一起送出並納入簽章。`,
757
758
  severity: "info"
758
759
  }) : null,
759
- v && l?.formDefinitionSnapshot.uiSchema ? /* @__PURE__ */ k(we, { children: [
760
+ se && l?.formDefinitionSnapshot.uiSchema ? /* @__PURE__ */ k(Te, { children: [
760
761
  /* @__PURE__ */ O(s, {
761
762
  attachments: t,
762
763
  dataSourceContext: n ? {
@@ -764,11 +765,11 @@ function En({ attachments: t, canResubmitInstance: n, deciding: r, error: i, fie
764
765
  kind: "runtime"
765
766
  } : void 0,
766
767
  dataSourceInitialValues: l.formData,
767
- errors: y ? c.errors : ie,
768
+ errors: v ? c.errors : ie,
768
769
  ...!n && a ? { fieldAccess: a } : {},
769
770
  ...!n && o ? { fieldLabelMarkers: o } : {},
770
771
  onChange: (e) => {
771
- y ? c.onChange(e) : m(e);
772
+ v ? c.onChange(e) : m(e);
772
773
  },
773
774
  onDataSourceStateChange: d,
774
775
  onDownloadAttachment: f,
@@ -776,9 +777,9 @@ function En({ attachments: t, canResubmitInstance: n, deciding: r, error: i, fie
776
777
  onUploadAttachment: n ? te : void 0,
777
778
  optionSnapshots: l.formDataOptionSnapshot,
778
779
  readonly: !n,
779
- schema: v,
780
+ schema: se,
780
781
  uiSchema: l.formDefinitionSnapshot.uiSchema,
781
- value: n ? re : y ? c.value : l.formData
782
+ value: n ? re : v ? c.value : l.formData
782
783
  }),
783
784
  n && g ? /* @__PURE__ */ O(e, {
784
785
  label: "簽核意見",
@@ -787,19 +788,19 @@ function En({ attachments: t, canResubmitInstance: n, deciding: r, error: i, fie
787
788
  disabled: r,
788
789
  onChange: (e) => g(e.target.value),
789
790
  placeholder: "選填,例如說明這次補正或修改了哪些內容",
790
- maxLength: Cn,
791
- ref: Tn,
791
+ maxLength: wn,
792
+ ref: En,
792
793
  resize: "vertical",
793
794
  rows: 4,
794
- style: wn,
795
+ style: Tn,
795
796
  value: ne
796
797
  })
797
798
  }) : null,
798
799
  n ? /* @__PURE__ */ O("div", {
799
- style: $,
800
+ style: Cn,
800
801
  children: /* @__PURE__ */ O(C, {
801
802
  disabled: r,
802
- icon: Ze,
803
+ icon: rt,
803
804
  iconType: "leading",
804
805
  onClick: ee,
805
806
  variant: "base-primary",
@@ -815,11 +816,11 @@ function En({ attachments: t, canResubmitInstance: n, deciding: r, error: i, fie
815
816
  });
816
817
  }
817
818
  // src/views/instances/detail/sections/InstanceAttachmentsSection.tsx
818
- var Dn = {
819
+ var On = {
819
820
  display: "grid",
820
821
  gap: 16
821
822
  };
822
- function On({ attachments: e, onDownload: n, onPreview: r }) {
823
+ function kn({ attachments: e, onDownload: n, onPreview: r }) {
823
824
  let i = x(() => e.map((e) => ({
824
825
  attachment: e,
825
826
  createdAt: e.createdAt,
@@ -827,7 +828,7 @@ function On({ attachments: e, onDownload: n, onPreview: r }) {
827
828
  id: e.id,
828
829
  key: e.id,
829
830
  mimeType: e.mimeType,
830
- sizeLabel: jt(Number(e.sizeBytes))
831
+ sizeLabel: Mt(Number(e.sizeBytes))
831
832
  })), [e]), a = x(() => [
832
833
  {
833
834
  dataIndex: "filename",
@@ -859,14 +860,14 @@ function On({ attachments: e, onDownload: n, onPreview: r }) {
859
860
  }
860
861
  ], []), o = x(() => ({
861
862
  render: (e) => [...e.mimeType === "application/pdf" ? [{
862
- icon: Je,
863
+ icon: et,
863
864
  iconType: "leading",
864
865
  name: "預覽",
865
866
  onClick: () => {
866
867
  r(e.attachment);
867
868
  }
868
869
  }] : [], {
869
- icon: M,
870
+ icon: P,
870
871
  iconType: "leading",
871
872
  name: "下載",
872
873
  onClick: () => {
@@ -877,7 +878,7 @@ function On({ attachments: e, onDownload: n, onPreview: r }) {
877
878
  width: 160
878
879
  }), [n, r]);
879
880
  return /* @__PURE__ */ k("div", {
880
- style: Dn,
881
+ style: On,
881
882
  children: [/* @__PURE__ */ O(D, {
882
883
  component: "h2",
883
884
  variant: "h3",
@@ -895,58 +896,58 @@ function On({ attachments: e, onDownload: n, onPreview: r }) {
895
896
  });
896
897
  }
897
898
  // src/views/instances/detail/sections/InstanceTasksSection.tsx
898
- var kn = {
899
+ var An = {
899
900
  display: "grid",
900
901
  gap: 12,
901
902
  width: "100%"
902
- }, An = {
903
+ }, jn = {
903
904
  minWidth: "100%",
904
905
  width: "100%"
905
- }, jn = {
906
+ }, Mn = {
906
907
  display: "grid",
907
908
  gap: 12,
908
909
  width: "100%"
909
- }, Mn = { marginTop: 12 }, Nn = { marginTop: 24 };
910
- function Pn(e) {
910
+ }, Nn = { marginTop: 12 }, Pn = { marginTop: 24 };
911
+ function Fn(e) {
911
912
  e && (e.style.width = "100%");
912
913
  }
913
- var Fn = {
914
+ var In = {
914
915
  COMPLETION_NOTIFY: "結案通知",
915
916
  COUNTERSIGN: "臨時會簽",
916
917
  PRE_APPROVAL: "臨時加簽",
917
918
  STAGE_NOTIFY: "階段完成通知"
918
- }, In = {
919
+ }, Ln = {
919
920
  COMPLETION_NOTIFY: "本張單到達結案狀態(核准 / 拒絕 / 取消)後,通知指定對象。",
920
921
  COUNTERSIGN: "指定對象會併入下一層簽核,下一層需所有人都完成才會繼續。",
921
922
  PRE_APPROVAL: "指定對象需先完成加簽,本階段才會往下一層繼續。",
922
923
  STAGE_NOTIFY: "本階段完成後(不論通過與否)通知指定對象。"
923
- }, Ln = [{
924
+ }, Rn = [{
924
925
  id: "REJECT_INSTANCE",
925
926
  name: "加簽拒絕時整單駁回"
926
927
  }, {
927
928
  id: "RETURN_TO_ORIGIN",
928
929
  name: "加簽拒絕時退回給我重新處理"
929
- }], Rn = [{
930
+ }], zn = [{
930
931
  id: "MEMBER",
931
932
  name: "指定成員"
932
933
  }, {
933
934
  id: "WEBHOOK",
934
935
  name: "Webhook"
935
- }], zn = b(function({ adhocDirectives: n, currentMemberId: r, fill: i = null, instance: a, memberProfilesById: o, onChanged: s, onDecidingChange: c, onFillApproveError: l, tasks: d }, f) {
936
+ }], Bn = y(function({ adhocDirectives: n, currentMemberId: r, fill: i = null, instance: a, memberProfilesById: o, onChanged: s, onDecidingChange: c, onFillApproveError: l, tasks: d }, f) {
936
937
  let [p, m] = S(!1), [h, g] = S(null);
937
- ce(() => {
938
+ b(() => {
938
939
  c?.(p);
939
940
  }, [p, c]);
940
- let [ee, te] = S(""), [ne, re] = S(!1), [ie, ae] = S(""), [oe, v] = S(null), [y, b] = S(!1), [se, ue] = S(""), [me, ge] = S(!1), [_e, E] = S(null), [ve, be] = S(""), [Ce, Ee] = S(null), [Ae, je] = S(!1), [A, Me] = S([]), [Ne, Pe] = S(!1), [Fe, Ie] = S(""), [ze, Be] = S([]), [Ve, Ue] = S(!1), [We, Ge] = S([]), [Ke, qe] = S(!1), [j, M] = S("COUNTERSIGN"), [Je, Ye] = S("REJECT_INSTANCE"), [Xe, Ze] = S(!1), [Qe, $e] = S("MEMBER"), [et, tt] = S(""), N = ie.trim(), nt = se.trim(), rt = ve.trim(), P = x(() => Rt(d, r), [r, d]), F = x(() => P && a ? a.workflowSnapshot.nodes.find((e) => e.id === P.nodeId) ?? null : null, [P, a]), it = x(() => F && a ? zt(a.workflowSnapshot, F) : [], [F, a]), at = F?.type === "userTask" && F.data.returnBehavior.allowReturn, ot = F?.type === "userTask" && F.data.allowReject !== !1, st = F?.type === "userTask" && F.data.allowTransfer !== !1, ct = F?.type === "userTask" && F.data.returnBehavior.requireComment === !0, lt = F?.type === "userTask" && F.data.allowAddSigner, ut = x(() => n.filter((e) => e.status === "PENDING"), [n]), I = it.find((e) => e.id === _e) ?? it[0] ?? null, dt = x(() => d.map((e) => ({
941
+ let [ee, te] = S(""), [ne, re] = S(!1), [ie, ae] = S(""), [oe, se] = S(null), [v, y] = S(!1), [ce, ue] = S(""), [me, ge] = S(!1), [_e, E] = S(null), [ve, be] = S(""), [Ce, De] = S(null), [Ae, je] = S(!1), [Me, Ne] = S([]), [Pe, Fe] = S(!1), [Ie, Le] = S(""), [Be, Ve] = S([]), [He, We] = S(!1), [Ge, Ke] = S([]), [qe, j] = S(!1), [M, Je] = S("COUNTERSIGN"), [Ye, Xe] = S("REJECT_INSTANCE"), [Ze, Qe] = S(!1), [N, $e] = S("MEMBER"), [P, et] = S(""), tt = ie.trim(), nt = ce.trim(), rt = ve.trim(), F = x(() => zt(d, r), [r, d]), I = x(() => F && a ? a.workflowSnapshot.nodes.find((e) => e.id === F.nodeId) ?? null : null, [F, a]), it = x(() => I && a ? Bt(a.workflowSnapshot, I) : [], [I, a]), at = I?.type === "userTask" && I.data.returnBehavior.allowReturn, ot = I?.type === "userTask" && I.data.allowReject !== !1, st = I?.type === "userTask" && I.data.allowTransfer !== !1, ct = I?.type === "userTask" && I.data.returnBehavior.requireComment === !0, lt = I?.type === "userTask" && I.data.allowAddSigner, ut = x(() => n.filter((e) => e.status === "PENDING"), [n]), L = it.find((e) => e.id === _e) ?? it[0] ?? null, dt = x(() => d.map((e) => ({
941
942
  ...e,
942
- assigneeLabel: It(e, o),
943
- fillFieldCount: Vn(e, a?.workflowSnapshot ?? null),
943
+ assigneeLabel: Lt(e, o),
944
+ fillFieldCount: Hn(e, a?.workflowSnapshot ?? null),
944
945
  key: e.id,
945
946
  nodeLabel: u({
946
947
  ...e,
947
- nodeLabel: Ft(e.nodeId, a?.workflowSnapshot ?? null)
948
+ nodeLabel: It(e.nodeId, a?.workflowSnapshot ?? null)
948
949
  }),
949
- statusLabel: W(e.status)
950
+ statusLabel: G(e.status)
950
951
  })), [
951
952
  a,
952
953
  o,
@@ -998,8 +999,8 @@ var Fn = {
998
999
  ...e,
999
1000
  createdByLabel: K(e.createdByMemberId, o),
1000
1001
  key: e.id,
1001
- targetLabel: Bn(e, o),
1002
- typeLabel: Fn[e.type]
1002
+ targetLabel: Vn(e, o),
1003
+ typeLabel: In[e.type]
1003
1004
  })), [o, ut]), mt = x(() => [
1004
1005
  {
1005
1006
  dataIndex: "typeLabel",
@@ -1040,35 +1041,35 @@ var Fn = {
1040
1041
  {
1041
1042
  key: "actions",
1042
1043
  render: (e) => e.createdByMemberId === r ? /* @__PURE__ */ O(C, {
1043
- disabled: Xe,
1044
- onClick: () => void kt(e.id),
1044
+ disabled: Ze,
1045
+ onClick: () => void H(e.id),
1045
1046
  size: "minor",
1046
1047
  variant: "destructive-secondary",
1047
1048
  children: "撤回"
1048
- }) : /* @__PURE__ */ O(we, {}),
1049
+ }) : /* @__PURE__ */ O(Te, {}),
1049
1050
  title: "操作",
1050
1051
  width: 100
1051
1052
  }
1052
- ], [Xe, r]);
1053
- async function L({ action: e, comment: t, returnToNodeId: n = null, transferToMemberId: a = null }) {
1054
- if (!r || !P || e === "REJECTED" && !ot || e === "TRANSFERRED" && !st) return !1;
1053
+ ], [Ze, r]);
1054
+ async function ht({ action: e, comment: t, returnToNodeId: n = null, transferToMemberId: a = null }) {
1055
+ if (!r || !F || e === "REJECTED" && !ot || e === "TRANSFERRED" && !st) return !1;
1055
1056
  m(!0), g(null);
1056
- let o = e === "APPROVED" && i !== null && !P.isAdhoc ? {
1057
+ let o = e === "APPROVED" && i !== null && !F.isAdhoc ? {
1057
1058
  expectedFormDataFingerprint: i.expectedFormDataFingerprint,
1058
1059
  formData: i.formData
1059
1060
  } : null;
1060
1061
  try {
1061
- await ke({
1062
+ await A({
1062
1063
  action: e,
1063
1064
  comment: t,
1064
1065
  decidedByMemberId: r,
1065
1066
  fill: o,
1066
1067
  returnToNodeId: n,
1067
- taskId: P.id,
1068
+ taskId: F.id,
1068
1069
  transferToMemberId: a
1069
- }), b(!1), ge(!1), Pe(!1), ae(""), ue(""), be(""), Ee(null), E(null), v(null);
1070
+ }), y(!1), ge(!1), Fe(!1), ae(""), ue(""), be(""), De(null), E(null), se(null);
1070
1071
  } catch (e) {
1071
- return m(!1), o !== null && e instanceof Error && l?.(e.message) === !0 ? (re(!1), !1) : (g(_(e)), !1);
1072
+ return m(!1), o !== null && e instanceof Error && l?.(e.message, we(e)) === !0 ? (re(!1), !1) : (g(_(e)), !1);
1072
1073
  }
1073
1074
  try {
1074
1075
  await s();
@@ -1080,39 +1081,39 @@ var Fn = {
1080
1081
  return !0;
1081
1082
  }
1082
1083
  function R() {
1083
- r && P && (g(null), re(!0));
1084
+ r && F && (g(null), re(!0));
1084
1085
  }
1085
- function ht() {
1086
+ function gt() {
1086
1087
  p || (re(!1), te(""));
1087
1088
  }
1088
1089
  async function z() {
1089
- p || await L({
1090
+ p || await ht({
1090
1091
  action: "APPROVED",
1091
1092
  comment: ee.trim() || null
1092
1093
  }) && (re(!1), te(""));
1093
1094
  }
1094
- function gt() {
1095
- ot && (ae(""), v(null), b(!0));
1096
- }
1097
1095
  function _t() {
1098
- p || (b(!1), ae(""), v(null));
1096
+ ot && (ae(""), se(null), y(!0));
1099
1097
  }
1100
1098
  function vt() {
1101
- ue(""), E(it[0]?.id ?? null), ge(!0);
1099
+ p || (y(!1), ae(""), se(null));
1102
1100
  }
1103
1101
  function yt() {
1104
- p || (ge(!1), ue(""), E(null));
1102
+ ue(""), E(it[0]?.id ?? null), ge(!0);
1105
1103
  }
1106
1104
  function bt() {
1107
- st && (be(""), Ee(null), Pe(!0), St(""));
1105
+ p || (ge(!1), ue(""), E(null));
1108
1106
  }
1109
1107
  function xt() {
1110
- p || (Pe(!1), be(""), Ee(null));
1108
+ st && (be(""), De(null), Fe(!0), B(""));
1109
+ }
1110
+ function St() {
1111
+ p || (Fe(!1), be(""), De(null));
1111
1112
  }
1112
- async function St(e) {
1113
+ async function B(e) {
1113
1114
  je(!0);
1114
1115
  try {
1115
- Me((await He(e)).filter((e) => e.memberId !== r).map(Bt));
1116
+ Ne((await Ue(e)).filter((e) => e.memberId !== r).map(Vt));
1116
1117
  } catch (e) {
1117
1118
  g(_(e));
1118
1119
  } finally {
@@ -1120,88 +1121,88 @@ var Fn = {
1120
1121
  }
1121
1122
  }
1122
1123
  async function Ct() {
1123
- ot && (N ? await L({
1124
+ ot && (tt ? await ht({
1124
1125
  action: "REJECTED",
1125
- comment: N
1126
- }) : v("請輸入拒絕原因"));
1126
+ comment: tt
1127
+ }) : se("請輸入拒絕原因"));
1127
1128
  }
1128
- async function B() {
1129
- st && (Ce ? await L({
1129
+ async function wt() {
1130
+ st && (Ce ? await ht({
1130
1131
  action: "TRANSFERRED",
1131
1132
  comment: rt || null,
1132
1133
  transferToMemberId: Ce.id
1133
1134
  }) : g("請選擇轉派對象"));
1134
1135
  }
1135
- async function wt() {
1136
- await L({
1136
+ async function Tt() {
1137
+ await ht({
1137
1138
  action: "RETURNED",
1138
1139
  comment: nt || null,
1139
- returnToNodeId: I?.id ?? null
1140
+ returnToNodeId: L?.id ?? null
1140
1141
  });
1141
1142
  }
1142
- function Tt() {
1143
- Ie(""), Be([]), Ye("REJECT_INSTANCE"), $e("MEMBER"), tt("");
1143
+ function Et() {
1144
+ Le(""), Ve([]), Xe("REJECT_INSTANCE"), $e("MEMBER"), et("");
1144
1145
  }
1145
- function Et(e) {
1146
- M(e), Tt(), qe(!0), V("");
1146
+ function Dt(e) {
1147
+ Je(e), Et(), j(!0), V("");
1147
1148
  }
1148
- function Dt() {
1149
- Xe || (qe(!1), Tt());
1149
+ function Ot() {
1150
+ Ze || (j(!1), Et());
1150
1151
  }
1151
1152
  async function V(e) {
1152
- Ue(!0);
1153
+ We(!0);
1153
1154
  try {
1154
- Ge((await He(e)).map(Bt));
1155
+ Ke((await Ue(e)).map(Vt));
1155
1156
  } catch (e) {
1156
1157
  g(_(e));
1157
1158
  } finally {
1158
- Ue(!1);
1159
+ We(!1);
1159
1160
  }
1160
1161
  }
1161
- async function Ot() {
1162
- if (!P) return;
1163
- let e = (j === "STAGE_NOTIFY" || j === "COMPLETION_NOTIFY") && Qe === "WEBHOOK", t = Vt({
1164
- memberIds: ze.map((e) => e.id),
1162
+ async function kt() {
1163
+ if (!F) return;
1164
+ let e = (M === "STAGE_NOTIFY" || M === "COMPLETION_NOTIFY") && N === "WEBHOOK", t = q({
1165
+ memberIds: Be.map((e) => e.id),
1165
1166
  useWebhookTarget: e,
1166
- webhookUrl: et
1167
+ webhookUrl: P
1167
1168
  });
1168
1169
  if (!t.valid) {
1169
1170
  g(t.error);
1170
1171
  return;
1171
1172
  }
1172
- let { target: n } = t, r = Fe.trim() || null;
1173
- Ze(!0), g(null);
1173
+ let { target: n } = t, r = Ie.trim() || null;
1174
+ Qe(!0), g(null);
1174
1175
  try {
1175
- j === "COUNTERSIGN" ? await Le({
1176
+ M === "COUNTERSIGN" ? await Re({
1176
1177
  comment: r,
1177
1178
  target: n,
1178
- taskId: P.id
1179
- }) : j === "PRE_APPROVAL" ? await Re({
1179
+ taskId: F.id
1180
+ }) : M === "PRE_APPROVAL" ? await ze({
1180
1181
  comment: r,
1181
- onReject: Je,
1182
+ onReject: Ye,
1182
1183
  target: n,
1183
- taskId: P.id
1184
- }) : j === "STAGE_NOTIFY" ? await Oe({
1184
+ taskId: F.id
1185
+ }) : M === "STAGE_NOTIFY" ? await ke({
1185
1186
  target: n,
1186
- taskId: P.id
1187
- }) : await De({
1187
+ taskId: F.id
1188
+ }) : await Oe({
1188
1189
  target: n,
1189
- taskId: P.id
1190
- }), qe(!1), Tt(), await s();
1190
+ taskId: F.id
1191
+ }), j(!1), Et(), await s();
1191
1192
  } catch (e) {
1192
1193
  g(_(e));
1193
1194
  } finally {
1194
- Ze(!1);
1195
+ Qe(!1);
1195
1196
  }
1196
1197
  }
1197
- async function kt(e) {
1198
- Ze(!0), g(null);
1198
+ async function H(e) {
1199
+ Qe(!0), g(null);
1199
1200
  try {
1200
- await Te(e), await s();
1201
+ await Ee(e), await s();
1201
1202
  } catch (e) {
1202
1203
  g(_(e));
1203
1204
  } finally {
1204
- Ze(!1);
1205
+ Qe(!1);
1205
1206
  }
1206
1207
  }
1207
1208
  le(f, () => ({
@@ -1211,22 +1212,22 @@ var Fn = {
1211
1212
  canTransferCurrentTask: st,
1212
1213
  deciding: p,
1213
1214
  handleApprove: R,
1214
- hasCurrentTask: P !== null,
1215
- openAdhocModal: Et,
1216
- openRejectModal: gt,
1217
- openReturnModal: vt,
1218
- openTransferModal: bt
1215
+ hasCurrentTask: F !== null,
1216
+ openAdhocModal: Dt,
1217
+ openRejectModal: _t,
1218
+ openReturnModal: yt,
1219
+ openTransferModal: xt
1219
1220
  }), [
1220
1221
  lt,
1221
1222
  ot,
1222
1223
  at,
1223
1224
  st,
1224
1225
  r,
1225
- P,
1226
+ F,
1226
1227
  p
1227
1228
  ]);
1228
- let H = j === "STAGE_NOTIFY" || j === "COMPLETION_NOTIFY", U = H && Qe === "WEBHOOK" ? !et.trim() : ze.length === 0, At = Ln.find((e) => e.id === Je) ?? Ln[0], jt = Rn.find((e) => e.id === Qe) ?? Rn[0];
1229
- return /* @__PURE__ */ k(we, { children: [
1229
+ let U = M === "STAGE_NOTIFY" || M === "COMPLETION_NOTIFY", At = U && N === "WEBHOOK" ? !P.trim() : Be.length === 0, jt = Rn.find((e) => e.id === Ye) ?? Rn[0], Mt = zn.find((e) => e.id === N) ?? zn[0];
1230
+ return /* @__PURE__ */ k(Te, { children: [
1230
1231
  /* @__PURE__ */ O(D, {
1231
1232
  component: "h2",
1232
1233
  variant: "h3",
@@ -1238,20 +1239,20 @@ var Fn = {
1238
1239
  children: h
1239
1240
  }) : null,
1240
1241
  /* @__PURE__ */ O("div", {
1241
- style: Mn,
1242
+ style: Nn,
1242
1243
  children: /* @__PURE__ */ O(xe, {
1243
1244
  columns: ft,
1244
1245
  dataSource: dt,
1245
1246
  fullWidth: !0
1246
1247
  })
1247
1248
  }),
1248
- ut.length > 0 ? /* @__PURE__ */ k(we, { children: [/* @__PURE__ */ O(D, {
1249
+ ut.length > 0 ? /* @__PURE__ */ k(Te, { children: [/* @__PURE__ */ O(D, {
1249
1250
  component: "h3",
1250
- style: Nn,
1251
+ style: Pn,
1251
1252
  variant: "h3",
1252
1253
  children: "待生效的臨時設定"
1253
1254
  }), /* @__PURE__ */ O("div", {
1254
- style: Mn,
1255
+ style: Nn,
1255
1256
  children: /* @__PURE__ */ O(xe, {
1256
1257
  columns: mt,
1257
1258
  dataSource: pt,
@@ -1263,8 +1264,8 @@ var Fn = {
1263
1264
  confirmText: "送出同意",
1264
1265
  loading: p,
1265
1266
  modalType: "standard",
1266
- onCancel: ht,
1267
- onClose: ht,
1267
+ onCancel: gt,
1268
+ onClose: gt,
1268
1269
  onConfirm: () => void z(),
1269
1270
  open: ne,
1270
1271
  showModalFooter: !0,
@@ -1280,7 +1281,7 @@ var Fn = {
1280
1281
  children: h
1281
1282
  }) : null,
1282
1283
  i !== null && i.summary.length > 0 ? /* @__PURE__ */ k("div", {
1283
- style: kn,
1284
+ style: An,
1284
1285
  children: [/* @__PURE__ */ O(D, {
1285
1286
  variant: "body",
1286
1287
  children: "將一併送出的補填欄位:"
@@ -1290,7 +1291,7 @@ var Fn = {
1290
1291
  }, e.fieldKey))]
1291
1292
  }) : null,
1292
1293
  /* @__PURE__ */ O("div", {
1293
- style: kn,
1294
+ style: An,
1294
1295
  children: /* @__PURE__ */ O(e, {
1295
1296
  label: "簽核意見",
1296
1297
  name: "approveComment",
@@ -1298,10 +1299,10 @@ var Fn = {
1298
1299
  autoFocus: !0,
1299
1300
  onChange: (e) => te(e.target.value),
1300
1301
  placeholder: "選填,例如補充核准的條件或提醒事項",
1301
- ref: Pn,
1302
+ ref: Fn,
1302
1303
  resize: "vertical",
1303
1304
  rows: 4,
1304
- style: An,
1305
+ style: jn,
1305
1306
  value: ee
1306
1307
  })
1307
1308
  })
@@ -1311,24 +1312,24 @@ var Fn = {
1311
1312
  /* @__PURE__ */ O(T, {
1312
1313
  cancelText: "取消",
1313
1314
  confirmButtonProps: {
1314
- disabled: !N,
1315
+ disabled: !tt,
1315
1316
  variant: "destructive-primary"
1316
1317
  },
1317
1318
  confirmText: "送出拒絕",
1318
1319
  loading: p,
1319
1320
  modalStatusType: "error",
1320
1321
  modalType: "standard",
1321
- onCancel: _t,
1322
- onClose: _t,
1322
+ onCancel: vt,
1323
+ onClose: vt,
1323
1324
  onConfirm: () => void Ct(),
1324
- open: y,
1325
+ open: v,
1325
1326
  showModalFooter: !0,
1326
1327
  showModalHeader: !0,
1327
1328
  size: "regular",
1328
1329
  supportingText: "拒絕案件時必須留下原因,供發起人與後續追蹤查看。",
1329
1330
  title: "拒絕原因",
1330
1331
  children: /* @__PURE__ */ k("div", {
1331
- style: kn,
1332
+ style: An,
1332
1333
  children: [/* @__PURE__ */ O(e, {
1333
1334
  label: "拒絕原因",
1334
1335
  name: "rejectReason",
@@ -1336,13 +1337,13 @@ var Fn = {
1336
1337
  children: /* @__PURE__ */ O(Se, {
1337
1338
  autoFocus: !0,
1338
1339
  onChange: (e) => {
1339
- ae(e.target.value), v(null);
1340
+ ae(e.target.value), se(null);
1340
1341
  },
1341
1342
  placeholder: "請說明拒絕原因",
1342
- ref: Pn,
1343
+ ref: Fn,
1343
1344
  resize: "vertical",
1344
1345
  rows: 4,
1345
- style: An,
1346
+ style: jn,
1346
1347
  type: oe ? "error" : "default",
1347
1348
  value: ie
1348
1349
  })
@@ -1359,17 +1360,17 @@ var Fn = {
1359
1360
  confirmText: "送出轉派",
1360
1361
  loading: p,
1361
1362
  modalType: "standard",
1362
- onCancel: xt,
1363
- onClose: xt,
1364
- onConfirm: () => void B(),
1365
- open: Ne,
1363
+ onCancel: St,
1364
+ onClose: St,
1365
+ onConfirm: () => void wt(),
1366
+ open: Pe,
1366
1367
  showModalFooter: !0,
1367
1368
  showModalHeader: !0,
1368
1369
  size: "regular",
1369
1370
  supportingText: "轉派後,原任務會保留轉派紀錄,新的待簽任務會指派給指定成員。",
1370
1371
  title: "轉派簽核",
1371
1372
  children: /* @__PURE__ */ k("div", {
1372
- style: jn,
1373
+ style: Mn,
1373
1374
  children: [/* @__PURE__ */ O(e, {
1374
1375
  label: "轉派對象",
1375
1376
  name: "transferToMemberId",
@@ -1387,13 +1388,13 @@ var Fn = {
1387
1388
  loading: Ae,
1388
1389
  loadingText: "搜尋成員中...",
1389
1390
  mode: "single",
1390
- onChange: (e) => Ee(Ht(e)),
1391
- onSearch: St,
1392
- onSearchTextChange: (e) => Ee(Ut(e, A)),
1391
+ onChange: (e) => De(Ut(e)),
1392
+ onSearch: B,
1393
+ onSearchTextChange: (e) => De(Wt(e, Me)),
1393
1394
  onVisibilityChange: (e) => {
1394
- e && St("");
1395
+ e && B("");
1395
1396
  },
1396
- options: [...A],
1397
+ options: [...Me],
1397
1398
  placeholder: "搜尋姓名或信箱",
1398
1399
  searchDebounceTime: 300,
1399
1400
  value: Ce
@@ -1404,10 +1405,10 @@ var Fn = {
1404
1405
  children: /* @__PURE__ */ O(Se, {
1405
1406
  onChange: (e) => be(e.target.value),
1406
1407
  placeholder: "可補充轉派原因",
1407
- ref: Pn,
1408
+ ref: Fn,
1408
1409
  resize: "vertical",
1409
1410
  rows: 4,
1410
- style: An,
1411
+ style: jn,
1411
1412
  value: ve
1412
1413
  })
1413
1414
  })]
@@ -1415,13 +1416,13 @@ var Fn = {
1415
1416
  }),
1416
1417
  /* @__PURE__ */ O(T, {
1417
1418
  cancelText: "取消",
1418
- confirmButtonProps: { disabled: !I || ct && !nt },
1419
+ confirmButtonProps: { disabled: !L || ct && !nt },
1419
1420
  confirmText: "送出退回",
1420
1421
  loading: p,
1421
1422
  modalType: "standard",
1422
- onCancel: yt,
1423
- onClose: yt,
1424
- onConfirm: () => void wt(),
1423
+ onCancel: bt,
1424
+ onClose: bt,
1425
+ onConfirm: () => void Tt(),
1425
1426
  open: me,
1426
1427
  showModalFooter: !0,
1427
1428
  showModalHeader: !0,
@@ -1429,7 +1430,7 @@ var Fn = {
1429
1430
  supportingText: "退回後,流程會回到指定節點並等待重新處理。",
1430
1431
  title: "退回簽核",
1431
1432
  children: /* @__PURE__ */ k("div", {
1432
- style: jn,
1433
+ style: Mn,
1433
1434
  children: [/* @__PURE__ */ O(e, {
1434
1435
  label: "退回節點",
1435
1436
  name: "returnTargetNodeId",
@@ -1440,7 +1441,7 @@ var Fn = {
1440
1441
  onChange: (e) => E(e?.id ?? null),
1441
1442
  options: [...it],
1442
1443
  placeholder: "選擇退回節點",
1443
- value: I
1444
+ value: L
1444
1445
  })
1445
1446
  }), /* @__PURE__ */ O(e, {
1446
1447
  hintText: ct ? "此關卡設定退回時必須填寫意見。" : void 0,
@@ -1450,55 +1451,55 @@ var Fn = {
1450
1451
  children: /* @__PURE__ */ O(Se, {
1451
1452
  onChange: (e) => ue(e.target.value),
1452
1453
  placeholder: ct ? "請說明退回原因" : "可補充需要修改的內容",
1453
- ref: Pn,
1454
+ ref: Fn,
1454
1455
  resize: "vertical",
1455
1456
  rows: 4,
1456
- style: An,
1457
- value: se
1457
+ style: jn,
1458
+ value: ce
1458
1459
  })
1459
1460
  })]
1460
1461
  })
1461
1462
  }),
1462
1463
  /* @__PURE__ */ O(T, {
1463
1464
  cancelText: "取消",
1464
- confirmButtonProps: { disabled: U },
1465
+ confirmButtonProps: { disabled: At },
1465
1466
  confirmText: "送出",
1466
- loading: Xe,
1467
+ loading: Ze,
1467
1468
  modalType: "standard",
1468
- onCancel: Dt,
1469
- onClose: Dt,
1470
- onConfirm: () => void Ot(),
1471
- open: Ke,
1469
+ onCancel: Ot,
1470
+ onClose: Ot,
1471
+ onConfirm: () => void kt(),
1472
+ open: qe,
1472
1473
  showModalFooter: !0,
1473
1474
  showModalHeader: !0,
1474
1475
  size: "regular",
1475
- supportingText: In[j],
1476
- title: Fn[j],
1476
+ supportingText: Ln[M],
1477
+ title: In[M],
1477
1478
  children: /* @__PURE__ */ k("div", {
1478
- style: jn,
1479
+ style: Mn,
1479
1480
  children: [
1480
- H ? /* @__PURE__ */ O(e, {
1481
+ U ? /* @__PURE__ */ O(e, {
1481
1482
  label: "通知時機",
1482
1483
  name: "adhocNotifyMode",
1483
1484
  required: !0,
1484
1485
  children: /* @__PURE__ */ O(ye, {
1485
1486
  clearable: !1,
1486
1487
  fullWidth: !0,
1487
- onChange: (e) => M(e?.id === "COMPLETION_NOTIFY" ? "COMPLETION_NOTIFY" : "STAGE_NOTIFY"),
1488
+ onChange: (e) => Je(e?.id === "COMPLETION_NOTIFY" ? "COMPLETION_NOTIFY" : "STAGE_NOTIFY"),
1488
1489
  options: [{
1489
1490
  id: "STAGE_NOTIFY",
1490
- name: Fn.STAGE_NOTIFY
1491
+ name: In.STAGE_NOTIFY
1491
1492
  }, {
1492
1493
  id: "COMPLETION_NOTIFY",
1493
- name: Fn.COMPLETION_NOTIFY
1494
+ name: In.COMPLETION_NOTIFY
1494
1495
  }],
1495
1496
  value: {
1496
- id: j,
1497
- name: Fn[j]
1497
+ id: M,
1498
+ name: In[M]
1498
1499
  }
1499
1500
  })
1500
1501
  }) : null,
1501
- H ? /* @__PURE__ */ O(e, {
1502
+ U ? /* @__PURE__ */ O(e, {
1502
1503
  label: "通知對象類型",
1503
1504
  name: "adhocTargetKind",
1504
1505
  required: !0,
@@ -1506,22 +1507,22 @@ var Fn = {
1506
1507
  clearable: !1,
1507
1508
  fullWidth: !0,
1508
1509
  onChange: (e) => $e(e?.id === "WEBHOOK" ? "WEBHOOK" : "MEMBER"),
1509
- options: [...Rn],
1510
- value: jt
1510
+ options: [...zn],
1511
+ value: Mt
1511
1512
  })
1512
1513
  }) : null,
1513
- H && Qe === "WEBHOOK" ? /* @__PURE__ */ O(e, {
1514
+ U && N === "WEBHOOK" ? /* @__PURE__ */ O(e, {
1514
1515
  label: "Webhook URL",
1515
1516
  name: "adhocWebhookUrl",
1516
1517
  required: !0,
1517
1518
  children: /* @__PURE__ */ O(he, {
1518
1519
  fullWidth: !0,
1519
- onChange: (e) => tt(e.target.value),
1520
+ onChange: (e) => et(e.target.value),
1520
1521
  placeholder: "https://example.com/webhook",
1521
- value: et
1522
+ value: P
1522
1523
  })
1523
1524
  }) : /* @__PURE__ */ O(e, {
1524
- label: H ? "通知對象" : "簽核對象",
1525
+ label: U ? "通知對象" : "簽核對象",
1525
1526
  name: "adhocMemberId",
1526
1527
  required: !0,
1527
1528
  children: /* @__PURE__ */ O(de, {
@@ -1534,45 +1535,45 @@ var Fn = {
1534
1535
  name: "adhoc-member-search",
1535
1536
  spellCheck: !1
1536
1537
  },
1537
- loading: Ve,
1538
+ loading: He,
1538
1539
  loadingText: "搜尋成員中...",
1539
1540
  menuMaxHeight: 320,
1540
1541
  mode: "multiple",
1541
- onChange: (e) => Be(e.map(Ht).filter(q)),
1542
+ onChange: (e) => Ve(e.map(Ut).filter(Ht)),
1542
1543
  onSearch: V,
1543
1544
  onVisibilityChange: (e) => {
1544
1545
  e && V("");
1545
1546
  },
1546
- options: [...We],
1547
+ options: [...Ge],
1547
1548
  overflowStrategy: "wrap",
1548
1549
  placeholder: "搜尋姓名或信箱,可加入多位",
1549
1550
  searchDebounceTime: 300,
1550
- value: [...ze]
1551
+ value: [...Be]
1551
1552
  })
1552
1553
  }),
1553
- j === "PRE_APPROVAL" ? /* @__PURE__ */ O(e, {
1554
+ M === "PRE_APPROVAL" ? /* @__PURE__ */ O(e, {
1554
1555
  label: "拒簽處理方式",
1555
1556
  name: "adhocOnReject",
1556
1557
  required: !0,
1557
1558
  children: /* @__PURE__ */ O(ye, {
1558
1559
  clearable: !1,
1559
1560
  fullWidth: !0,
1560
- onChange: (e) => Ye(e?.id === "RETURN_TO_ORIGIN" ? "RETURN_TO_ORIGIN" : "REJECT_INSTANCE"),
1561
- options: [...Ln],
1562
- value: At
1561
+ onChange: (e) => Xe(e?.id === "RETURN_TO_ORIGIN" ? "RETURN_TO_ORIGIN" : "REJECT_INSTANCE"),
1562
+ options: [...Rn],
1563
+ value: jt
1563
1564
  })
1564
1565
  }) : null,
1565
- H ? null : /* @__PURE__ */ O(e, {
1566
+ U ? null : /* @__PURE__ */ O(e, {
1566
1567
  label: "說明",
1567
1568
  name: "adhocComment",
1568
1569
  children: /* @__PURE__ */ O(Se, {
1569
- onChange: (e) => Ie(e.target.value),
1570
+ onChange: (e) => Le(e.target.value),
1570
1571
  placeholder: "可補充原因",
1571
- ref: Pn,
1572
+ ref: Fn,
1572
1573
  resize: "vertical",
1573
1574
  rows: 3,
1574
- style: An,
1575
- value: Fe
1575
+ style: jn,
1576
+ value: Ie
1576
1577
  })
1577
1578
  })
1578
1579
  ]
@@ -1580,7 +1581,7 @@ var Fn = {
1580
1581
  })
1581
1582
  ] });
1582
1583
  });
1583
- function Bn(e, t) {
1584
+ function Vn(e, t) {
1584
1585
  try {
1585
1586
  let n = JSON.parse(e.targetValueJson);
1586
1587
  if (n.memberIds?.length) return n.memberIds.map((e) => K(e, t)).join("、");
@@ -1590,20 +1591,20 @@ function Bn(e, t) {
1590
1591
  } catch {}
1591
1592
  return e.targetKind;
1592
1593
  }
1593
- function Vn(e, t) {
1594
+ function Hn(e, t) {
1594
1595
  if (e.isAdhoc || e.status !== "PENDING" && e.status !== "IN_PROGRESS") return 0;
1595
1596
  let n = t?.nodes.find((t) => t.id === e.nodeId);
1596
- return n?.type === "userTask" ? nt(n).size : 0;
1597
+ return n?.type === "userTask" ? Ke(n).size : 0;
1597
1598
  }
1598
1599
  // src/views/instances/detail/sections/InstanceSignaturesSection.tsx
1599
- var Hn = {
1600
+ var Un = {
1600
1601
  display: "grid",
1601
1602
  gap: 16
1602
1603
  };
1603
- function Un({ signatureVerification: e, signatures: n }) {
1604
+ function Wn({ signatureVerification: e, signatures: n }) {
1604
1605
  let r = x(() => n.map((e) => ({
1605
1606
  algorithm: e.algorithm,
1606
- hashLabel: Mt(e.signedPayloadHash),
1607
+ hashLabel: W(e.signedPayloadHash),
1607
1608
  key: e.id,
1608
1609
  keyVersion: e.keyVersion,
1609
1610
  signedAtLabel: t(e.signedAt),
@@ -1641,7 +1642,7 @@ function Un({ signatureVerification: e, signatures: n }) {
1641
1642
  }
1642
1643
  ], []);
1643
1644
  return /* @__PURE__ */ k("div", {
1644
- style: Hn,
1645
+ style: Un,
1645
1646
  children: [
1646
1647
  /* @__PURE__ */ O(D, {
1647
1648
  component: "h2",
@@ -1662,14 +1663,14 @@ function Un({ signatureVerification: e, signatures: n }) {
1662
1663
  });
1663
1664
  }
1664
1665
  // src/views/instances/detail/sections/InstanceHistorySection.tsx
1665
- var Wn = {
1666
+ var Gn = {
1666
1667
  display: "grid",
1667
1668
  gap: 16
1668
- }, Gn = {
1669
+ }, Kn = {
1669
1670
  cursor: "help",
1670
1671
  textDecoration: "underline dotted",
1671
1672
  textUnderlineOffset: 3
1672
- }, Kn = {
1673
+ }, qn = {
1673
1674
  borderLeftColor: "var(--mzn-color-border)",
1674
1675
  borderLeftStyle: "solid",
1675
1676
  borderLeftWidth: 2,
@@ -1678,21 +1679,21 @@ var Wn = {
1678
1679
  marginTop: 4,
1679
1680
  paddingLeft: 8,
1680
1681
  whiteSpace: "pre-wrap"
1681
- }, qn = { color: "var(--mzn-color-text-secondary)" }, Jn = {
1682
- ...Kn,
1682
+ }, Jn = { color: "var(--mzn-color-text-secondary)" }, Yn = {
1683
+ ...qn,
1683
1684
  borderLeftColor: "var(--mzn-color-text-error)",
1684
1685
  color: "var(--mzn-color-text-error)"
1685
1686
  };
1686
- function Yn(...e) {
1687
- return e.filter((e) => H(e ?? null)).join(" ");
1687
+ function Xn(...e) {
1688
+ return e.filter((e) => U(e ?? null)).join(" ");
1688
1689
  }
1689
- var Xn = b(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) {
1690
+ var Zn = 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) {
1690
1691
  let d = r ? "pending" : o, f = t.filter((e) => e.type !== "comment"), p = t.filter((e) => e.type === "comment");
1691
1692
  return /* @__PURE__ */ k("div", {
1692
1693
  ...l,
1693
- className: Yn(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),
1694
+ className: Xn(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),
1694
1695
  ref: u,
1695
- children: [c === "dot" ? /* @__PURE__ */ O("span", { className: Yn(R.statusIndicator, R.statusIndicatorDot) }) : /* @__PURE__ */ O("span", {
1696
+ children: [c === "dot" ? /* @__PURE__ */ O("span", { className: Xn(R.statusIndicator, R.statusIndicatorDot) }) : /* @__PURE__ */ O("span", {
1696
1697
  className: R.statusIndicator,
1697
1698
  children: i + 1
1698
1699
  }), /* @__PURE__ */ k("div", {
@@ -1707,13 +1708,13 @@ var Xn = b(function({ className: e, descriptionParts: t, error: n, forcePending:
1707
1708
  className: R.description,
1708
1709
  component: "div",
1709
1710
  variant: "body",
1710
- children: f.map((e, t) => /* @__PURE__ */ k(y, { children: [t > 0 ? " · " : null, Zn(e)] }, `${e.type}-${t}`))
1711
+ children: f.map((e, t) => /* @__PURE__ */ k(v, { children: [t > 0 ? " · " : null, Qn(e)] }, `${e.type}-${t}`))
1711
1712
  }) : null,
1712
1713
  p.map((e, t) => /* @__PURE__ */ k(D, {
1713
- style: e.tone === "danger" ? Jn : Kn,
1714
+ style: e.tone === "danger" ? Yn : qn,
1714
1715
  variant: "body",
1715
1716
  children: [/* @__PURE__ */ k("span", {
1716
- style: e.tone === "danger" ? void 0 : qn,
1717
+ style: e.tone === "danger" ? void 0 : Jn,
1717
1718
  children: [e.label, ":"]
1718
1719
  }), e.text]
1719
1720
  }, `comment-${t}`))
@@ -1721,8 +1722,8 @@ var Xn = b(function({ className: e, descriptionParts: t, error: n, forcePending:
1721
1722
  })]
1722
1723
  });
1723
1724
  });
1724
- function Zn(e) {
1725
- return e.type === "text" ? e.text : e.email?.trim() ? /* @__PURE__ */ k(we, { children: [
1725
+ function Qn(e) {
1726
+ return e.type === "text" ? e.text : e.email?.trim() ? /* @__PURE__ */ k(Te, { children: [
1726
1727
  e.prefix,
1727
1728
  ":",
1728
1729
  /* @__PURE__ */ O(Ce, {
@@ -1731,14 +1732,14 @@ function Zn(e) {
1731
1732
  ...n,
1732
1733
  "data-testid": e.memberId ? `member-tooltip-${e.memberId}` : void 0,
1733
1734
  ref: t,
1734
- style: Gn,
1735
+ style: Kn,
1735
1736
  children: e.label
1736
1737
  })
1737
1738
  })
1738
1739
  ] }) : `${e.prefix}:${e.label}`;
1739
1740
  }
1740
- function Qn({ activityLogs: e, formSchema: t = null, instanceState: n, memberProfilesById: r, signatureVerification: i, signaturesById: a, taskDecisions: o = null, taskDecisionsByTaskId: s, tasks: c, workflowSnapshot: l, workflowTokens: u }) {
1741
- let d = x(() => hn(e, c, u, l, n, r, s, a, i, t, o), [
1741
+ function $n({ activityLogs: e, formSchema: t = null, instanceState: n, memberProfilesById: r, signatureVerification: i, signaturesById: a, taskDecisions: o = null, taskDecisionsByTaskId: s, tasks: c, workflowSnapshot: l, workflowTokens: u }) {
1742
+ let d = x(() => gn(e, c, u, l, n, r, s, a, i, t, o), [
1742
1743
  e,
1743
1744
  t,
1744
1745
  n,
@@ -1750,12 +1751,12 @@ function Qn({ activityLogs: e, formSchema: t = null, instanceState: n, memberPro
1750
1751
  c,
1751
1752
  l,
1752
1753
  u
1753
- ]), f = Kt(d), p = d.map((e) => ({
1754
+ ]), f = qt(d), p = d.map((e) => ({
1754
1755
  ...e,
1755
1756
  descriptionParts: e.descriptionParts.filter(Y)
1756
1757
  }));
1757
1758
  return /* @__PURE__ */ k("div", {
1758
- style: Wn,
1759
+ style: Gn,
1759
1760
  children: [/* @__PURE__ */ O(D, {
1760
1761
  component: "h2",
1761
1762
  variant: "h3",
@@ -1764,7 +1765,7 @@ function Qn({ activityLogs: e, formSchema: t = null, instanceState: n, memberPro
1764
1765
  currentStep: f,
1765
1766
  orientation: "vertical",
1766
1767
  type: "dot",
1767
- children: p.map((e) => /* @__PURE__ */ O(Xn, {
1768
+ children: p.map((e) => /* @__PURE__ */ O(Zn, {
1768
1769
  descriptionParts: e.descriptionParts,
1769
1770
  error: e.error,
1770
1771
  forcePending: e.forcePending,
@@ -1778,17 +1779,17 @@ function Qn({ activityLogs: e, formSchema: t = null, instanceState: n, memberPro
1778
1779
  });
1779
1780
  }
1780
1781
  // src/views/instances/detail/sections/InstanceWebhookDeliveriesSection.tsx
1781
- var $n = {
1782
+ var er = {
1782
1783
  display: "grid",
1783
1784
  gap: 16
1784
- }, er = {
1785
+ }, tr = {
1785
1786
  display: "grid",
1786
1787
  gap: 2
1787
- }, tr = {
1788
+ }, nr = {
1788
1789
  overflowWrap: "anywhere",
1789
1790
  whiteSpace: "pre-wrap"
1790
1791
  };
1791
- function nr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1792
+ function rr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1792
1793
  let [r, i] = S(null), [a, o] = S(!1), [s, c] = S(null), l = x(() => e.map((e) => ({
1793
1794
  delivery: e,
1794
1795
  key: e.id
@@ -1796,7 +1797,7 @@ function nr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1796
1797
  {
1797
1798
  key: "endpoint",
1798
1799
  render: ({ delivery: e }) => /* @__PURE__ */ k("div", {
1799
- style: er,
1800
+ style: tr,
1800
1801
  children: [/* @__PURE__ */ O(D, {
1801
1802
  component: "span",
1802
1803
  variant: "body",
@@ -1820,7 +1821,7 @@ function nr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1820
1821
  },
1821
1822
  {
1822
1823
  key: "status",
1823
- render: ({ delivery: e }) => /* @__PURE__ */ O(rr, { status: e.status }),
1824
+ render: ({ delivery: e }) => /* @__PURE__ */ O(ir, { status: e.status }),
1824
1825
  title: "狀態",
1825
1826
  width: 120
1826
1827
  },
@@ -1837,7 +1838,7 @@ function nr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1837
1838
  {
1838
1839
  key: "lastError",
1839
1840
  render: ({ delivery: e }) => e.lastErrorCode && e.status !== "SENT" ? /* @__PURE__ */ k("div", {
1840
- style: er,
1841
+ style: tr,
1841
1842
  children: [/* @__PURE__ */ O(D, {
1842
1843
  color: "text-error",
1843
1844
  component: "span",
@@ -1846,7 +1847,7 @@ function nr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1846
1847
  }), e.lastErrorDetail ? /* @__PURE__ */ O(D, {
1847
1848
  color: "text-neutral",
1848
1849
  component: "span",
1849
- style: tr,
1850
+ style: nr,
1850
1851
  variant: "caption",
1851
1852
  children: e.lastErrorDetail
1852
1853
  }) : null]
@@ -1864,7 +1865,7 @@ function nr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1864
1865
  render: ({ delivery: e }) => /* @__PURE__ */ O(D, {
1865
1866
  component: "span",
1866
1867
  variant: "body",
1867
- children: ir(e)
1868
+ children: ar(e)
1868
1869
  }),
1869
1870
  title: "時間",
1870
1871
  width: 220
@@ -1872,7 +1873,7 @@ function nr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1872
1873
  ], [n]), d = x(() => ({
1873
1874
  render: ({ delivery: e }) => e.status === "FAILED" && e.attemptCount > 0 ? [{
1874
1875
  disabled: () => a,
1875
- icon: Qe,
1876
+ icon: F,
1876
1877
  iconType: "leading",
1877
1878
  name: "重新傳送",
1878
1879
  onClick: () => {
@@ -1895,7 +1896,7 @@ function nr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1895
1896
  }
1896
1897
  }
1897
1898
  return /* @__PURE__ */ k("div", {
1898
- style: $n,
1899
+ style: er,
1899
1900
  children: [
1900
1901
  /* @__PURE__ */ O(D, {
1901
1902
  component: "h2",
@@ -1943,7 +1944,7 @@ function nr({ deliveries: e, onRetry: t, readNodeLabel: n }) {
1943
1944
  ]
1944
1945
  });
1945
1946
  }
1946
- function rr({ status: e }) {
1947
+ function ir({ status: e }) {
1947
1948
  return e === "SENT" ? /* @__PURE__ */ O(fe, {
1948
1949
  size: "sub",
1949
1950
  text: "已送達",
@@ -1958,32 +1959,32 @@ function rr({ status: e }) {
1958
1959
  variant: "dot-info"
1959
1960
  });
1960
1961
  }
1961
- function ir(e) {
1962
+ function ar(e) {
1962
1963
  return e.sentAt ? `送達:${t(e.sentAt)}` : e.status === "PENDING" && e.nextRetryAt ? `下次重試:${t(e.nextRetryAt)}` : e.lastAttemptAt ? `最後嘗試:${t(e.lastAttemptAt)}` : `建立:${t(e.createdAt)}`;
1963
1964
  }
1964
1965
  // src/views/instances/viewer-field-access.ts
1965
- function ar(e, t) {
1966
+ function or(e, t) {
1966
1967
  let n = new Map(t.map((e) => [e.id, e]));
1967
1968
  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));
1968
1969
  }
1969
- function or({ activityLogs: e, actingTask: t, instance: n, tasks: r }) {
1970
+ function sr({ activityLogs: e, actingTask: t, instance: n, tasks: r }) {
1970
1971
  let i = n.workflowSnapshot;
1971
- return F({
1972
+ return M({
1972
1973
  definition: i,
1973
1974
  fieldKeys: (n.formDefinitionSnapshot.schema?.fields ?? []).map((e) => e.fieldKey),
1974
1975
  isAdhocTask: t?.isAdhoc ?? !1,
1975
1976
  nodeId: t?.nodeId ?? null,
1976
- revealedFieldKeys: rt(i, ar(e, r))
1977
+ revealedFieldKeys: qe(i, or(e, r))
1977
1978
  });
1978
1979
  }
1979
1980
  // src/views/instances/detail/InstanceDetailView.tsx
1980
- function sr(e) {
1981
- return `還有 ${new Set(Object.keys(e).map(P)).size} 個補填欄位需要完成`;
1981
+ function cr(e) {
1982
+ return `還有 ${new Set(Object.keys(e).map(j)).size} 個補填欄位需要完成`;
1982
1983
  }
1983
- var cr = 3e3, lr = 40, ur = 184, dr = 96, fr = {
1984
+ var lr = 3e3, ur = 40, dr = 184, fr = 96, pr = {
1984
1985
  display: "grid",
1985
1986
  gap: 16
1986
- }, pr = {
1987
+ }, mr = {
1987
1988
  background: "#f8fafc",
1988
1989
  border: "1px solid #e2e8f0",
1989
1990
  borderRadius: 8,
@@ -1991,7 +1992,7 @@ var cr = 3e3, lr = 40, ur = 184, dr = 96, fr = {
1991
1992
  minHeight: 440,
1992
1993
  overflow: "hidden",
1993
1994
  width: "min(80vw, 1040px)"
1994
- }, mr = {
1995
+ }, hr = {
1995
1996
  background: "#ffffff",
1996
1997
  border: "1px solid #cbd5e1",
1997
1998
  borderRadius: 8,
@@ -2001,24 +2002,24 @@ var cr = 3e3, lr = 40, ur = 184, dr = 96, fr = {
2001
2002
  minHeight: 82,
2002
2003
  padding: 12,
2003
2004
  width: 184
2004
- }, hr = {
2005
+ }, gr = {
2005
2006
  borderRadius: 999,
2006
2007
  fontSize: 12,
2007
2008
  fontWeight: 600,
2008
2009
  justifySelf: "start",
2009
2010
  lineHeight: "18px",
2010
2011
  padding: "0 8px"
2011
- }, gr = {
2012
+ }, _r = {
2012
2013
  color: "#64748b",
2013
2014
  fontSize: 12,
2014
2015
  overflow: "hidden",
2015
2016
  textOverflow: "ellipsis",
2016
2017
  whiteSpace: "nowrap"
2017
- }, _r = { opacity: 0 }, vr = {
2018
+ }, vr = { opacity: 0 }, yr = {
2018
2019
  display: "flex",
2019
2020
  flexWrap: "wrap",
2020
2021
  gap: 8
2021
- }, yr = {
2022
+ }, br = {
2022
2023
  alignItems: "center",
2023
2024
  background: "#ffffff",
2024
2025
  border: "1px solid #cbd5e1",
@@ -2030,28 +2031,28 @@ var cr = 3e3, lr = 40, ur = 184, dr = 96, fr = {
2030
2031
  gap: 6,
2031
2032
  lineHeight: "20px",
2032
2033
  padding: "4px 8px"
2033
- }, br = {
2034
+ }, xr = {
2034
2035
  display: "grid",
2035
2036
  gap: 16
2036
- }, xr = { workflowRuntime: jr };
2037
- function Sr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHistory: u = !0, showSignatures: d = !0, showTasks: f = !0, showWebhookDeliveries: p = !0 }) {
2038
- let { member: y } = n(), b = y?.memberId ?? null, le = p && r(y), [de, fe] = S([]), [w, pe] = S(null), [me, he] = S([]), [ye, be] = S([]), [xe, Ce] = S([]), [Te, De] = S([]), [Oe, ke] = S(null), [A, Le] = S([]), [Re, ze] = S([]), [He, Ke] = S([]), [qe, M] = S(null), [Je, Qe] = S(!0), [tt, N] = S(!1), [rt, P] = S(!1), [F, st] = S(!1), [ut, I] = S(!1), [ft, pt] = S(""), [mt, L] = S(!1), [R, z] = S({}), [gt, _t] = S({}), { clearAfterResubmit: vt, comment: yt, setComment: bt } = xn(a), [xt, St] = S({}), [B, wt] = S(null), [Et, Dt] = S(null), [V, Ot] = S([]), kt = ft.trim(), U = ue(null), At = ue(0), jt = Te.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS");
2039
- ce(() => {
2037
+ }, Sr = { workflowRuntime: Mr };
2038
+ function Cr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHistory: u = !0, showSignatures: d = !0, showTasks: f = !0, showWebhookDeliveries: p = !0 }) {
2039
+ let { member: v } = n(), y = v?.memberId ?? null, le = p && r(v), [de, fe] = S([]), [w, pe] = S(null), [me, he] = S([]), [ye, be] = S([]), [xe, Ce] = S([]), [we, Ee] = S([]), [Oe, ke] = S(null), [A, Me] = S([]), [Re, ze] = S([]), [Be, Ue] = S([]), [qe, j] = S(null), [M, Qe] = S(!0), [N, P] = S(!1), [et, F] = S(!1), [at, ot] = S(!1), [st, ut] = S(!1), [L, ft] = S(""), [pt, mt] = S(!1), [ht, R] = S({}), [z, _t] = S({}), { clearAfterResubmit: vt, comment: yt, setComment: bt } = Sn(a), [xt, St] = S({}), [B, wt] = S(null), [Tt, Dt] = S(null), [Ot, V] = S([]), kt = L.trim(), H = ue(null), At = ue(0), jt = we.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS");
2040
+ b(() => {
2040
2041
  dn();
2041
- }, [b, a]), ce(() => {
2042
- if (!le || !jt || At.current >= lr) return;
2042
+ }, [y, a]), b(() => {
2043
+ if (!le || !jt || At.current >= ur) return;
2043
2044
  let e = setTimeout(() => {
2044
2045
  At.current += 1, mn();
2045
- }, cr);
2046
+ }, lr);
2046
2047
  return () => clearTimeout(e);
2047
2048
  }, [
2048
2049
  le,
2049
2050
  jt,
2050
- Te
2051
- ]), ce(() => {
2051
+ we
2052
+ ]), b(() => {
2052
2053
  _t(w?.formData ?? {}), St({});
2053
2054
  }, [w]);
2054
- let Mt = se((e, t) => {
2055
+ let Mt = ce((e, t) => {
2055
2056
  St((n) => {
2056
2057
  let r = n[e];
2057
2058
  return r?.hasValue === t.hasValue && r.selectionExpired === (t.selectionExpired === !0) && r.status === t.status ? n : {
@@ -2063,30 +2064,30 @@ function Sr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHist
2063
2064
  }
2064
2065
  };
2065
2066
  });
2066
- }, []), W = x(() => Rt(A, b), [b, A]), G = x(() => W && w ? w.workflowSnapshot.nodes.find((e) => e.id === W.nodeId) ?? null : null, [W, w]), Pt = G?.type === "userTask" && G.data.returnBehavior.allowReturn, It = G?.type === "userTask" && G.data.allowReject !== !1, Lt = G?.type === "userTask" && G.data.allowTransfer !== !1, zt = G?.type === "userTask" && G.data.allowAddSigner, Bt = !(!w || w.initiatorMemberId !== b || w.state !== "RUNNING" && w.state !== "RETURNED"), Vt = !!(w && w.initiatorMemberId === b && w.state === "RETURNED"), q = x(() => W && !W.isAdhoc && G?.type === "userTask" && nt(G).size > 0 ? G : null, [W, G]), Ht = q ? W?.id ?? null : null, Ut = o(), [J, Wt] = S({}), [Gt, Y] = S({}), [Kt, qt] = S(!1);
2067
- ce(() => {
2068
- Wt({}), Y({}), qt(!1);
2067
+ }, []), W = x(() => zt(A, y), [y, A]), G = x(() => W && w ? w.workflowSnapshot.nodes.find((e) => e.id === W.nodeId) ?? null : null, [W, w]), Pt = G?.type === "userTask" && G.data.returnBehavior.allowReturn, Ft = G?.type === "userTask" && G.data.allowReject !== !1, Lt = G?.type === "userTask" && G.data.allowTransfer !== !1, Rt = G?.type === "userTask" && G.data.allowAddSigner, Bt = !(!w || w.initiatorMemberId !== y || w.state !== "RUNNING" && w.state !== "RETURNED"), Vt = !!(w && w.initiatorMemberId === y && w.state === "RETURNED"), q = x(() => W && !W.isAdhoc && G?.type === "userTask" && Ke(G).size > 0 ? G : null, [W, G]), Ht = q ? W?.id ?? null : null, Ut = o(), [Wt, J] = S({}), [Gt, Kt] = S({}), [Y, qt] = S(!1);
2068
+ b(() => {
2069
+ J({}), Kt({}), qt(!1);
2069
2070
  }, [Ht]);
2070
- let X = w?.formDefinitionSnapshot.schema ?? null, Z = x(() => q && X ? ie(X, q) : null, [q, X]), Q = x(() => Z && w ? it(Z.fields, {
2071
+ let X = w?.formDefinitionSnapshot.schema ?? null, Z = x(() => q && X ? ie(X, q) : null, [q, X]), Q = x(() => Z && w ? Je(Z.fields, {
2071
2072
  ...w.formData,
2072
- ...J
2073
+ ...Wt
2073
2074
  }) : null, [
2074
- J,
2075
+ Wt,
2075
2076
  Z,
2076
2077
  w
2077
2078
  ]), Jt = x(() => q && Z && Q && w ? m({
2078
- draft: J,
2079
+ draft: Wt,
2079
2080
  node: q,
2080
2081
  schema: Z,
2081
2082
  stored: w.formData,
2082
2083
  values: Q
2083
2084
  }) : {}, [
2084
- J,
2085
+ Wt,
2085
2086
  q,
2086
2087
  Z,
2087
2088
  Q,
2088
2089
  w
2089
- ]), Yt = x(() => w ? or({
2090
+ ]), Yt = x(() => w ? sr({
2090
2091
  activityLogs: de,
2091
2092
  actingTask: W,
2092
2093
  instance: w,
@@ -2096,7 +2097,7 @@ function Sr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHist
2096
2097
  W,
2097
2098
  w,
2098
2099
  A
2099
- ]), Xt = x(() => w ? oe(w.workflowSnapshot, q) : void 0, [q, w]), Zt = x(() => new Map(He.map((e) => [e.memberId, e])), [He]), Qt = ht(x(() => X ? h(X, Jt) : [], [Jt, X])), $t = x(() => q && Q && X && w?.formDataFingerprint ? {
2100
+ ]), Xt = x(() => w ? oe(w.workflowSnapshot, q) : void 0, [q, w]), Zt = x(() => new Map(Be.map((e) => [e.memberId, e])), [Be]), Qt = gt(x(() => X ? h(X, Jt) : [], [Jt, X])), $t = x(() => q && Q && X && w?.formDataFingerprint ? {
2100
2101
  expectedFormDataFingerprint: w.formDataFingerprint,
2101
2102
  formData: ne(Jt, q),
2102
2103
  summary: g(X, q, Jt, new Map([...Zt.keys()].map((e) => [e, K(e, Zt)])), Qt)
@@ -2111,230 +2112,230 @@ function Sr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHist
2111
2112
  ]);
2112
2113
  function en(e) {
2113
2114
  if (!q) return;
2114
- let t = nt(q), n = Object.entries(e).filter(([e, n]) => t.has(e) && JSON.stringify(n) !== JSON.stringify(Q?.[e]));
2115
- Wt((e) => ({
2115
+ let t = Ke(q), n = Object.entries(e).filter(([e, n]) => t.has(e) && JSON.stringify(n) !== JSON.stringify(Q?.[e]));
2116
+ J((e) => ({
2116
2117
  ...e,
2117
2118
  ...Object.fromEntries(n)
2118
- })), Y({});
2119
+ })), Kt({});
2119
2120
  }
2120
2121
  async function tn() {
2121
2122
  if (q && !w?.formDataFingerprint) ge.error("無法確認表單版本,請重新整理頁面後再同意。");
2122
2123
  else {
2123
2124
  if (q && Q && X && w?.formDefinitionSnapshot.uiSchema) {
2124
- P(!0);
2125
- let e = await ot({
2125
+ F(!0);
2126
+ let e = await Xe({
2126
2127
  schema: ee(X, q),
2127
2128
  uiSchema: w.formDefinitionSnapshot.uiSchema,
2128
2129
  values: Q
2129
- }).catch((e) => (ge.error(_(e)), null)).finally(() => P(!1));
2130
+ }).catch((e) => (ge.error(_(e)), null)).finally(() => F(!1));
2130
2131
  if (!e) return;
2131
2132
  if (!e.valid) {
2132
- Y(e.errors), e.firstInvalidFieldKey && at(e.firstInvalidFieldKey), ge.warning(sr(e.errors));
2133
+ Kt(e.errors), e.firstInvalidFieldKey && Ye(e.firstInvalidFieldKey), ge.warning(cr(e.errors));
2133
2134
  return;
2134
2135
  }
2135
2136
  }
2136
- U.current?.handleApprove();
2137
+ H.current?.handleApprove();
2137
2138
  }
2138
2139
  }
2139
- function nn(e) {
2140
+ function nn(e, t = []) {
2140
2141
  if (!q || !X) return !1;
2141
2142
  if (re(e)) return qt(!0), !0;
2142
- let t = v(e, X, q);
2143
- return t ? (Y(t), at(Object.keys(t)[0] ?? ""), ge.warning(sr(t)), !0) : !1;
2143
+ let n = se(e, X, q, t);
2144
+ return n ? (Kt(n), Ye(Object.keys(n)[0] ?? ""), ge.warning(cr(n)), !0) : !1;
2144
2145
  }
2145
2146
  async function rn() {
2146
2147
  await dn(), qt(!1);
2147
2148
  }
2148
- let an = x(() => c(me), [me]), on = x(() => new Map(xe.map((e) => [e.id, e])), [xe]), sn = x(() => w ? Dr(w.workflowSnapshot) : null, [w]), cn = x(() => w && sn ? Er(sn, A, Re, w.state) : [], [
2149
+ let an = x(() => c(me), [me]), on = x(() => new Map(xe.map((e) => [e.id, e])), [xe]), sn = x(() => w ? Or(w.workflowSnapshot) : null, [w]), cn = x(() => w && sn ? Dr(sn, A, Re, w.state) : [], [
2149
2150
  w,
2150
2151
  sn,
2151
2152
  A,
2152
2153
  Re
2153
- ]), ln = x(() => sn ? Or(sn) : [], [sn]), un = x(() => w ? wr(w.workflowSnapshot) : [], [w]);
2154
+ ]), ln = x(() => sn ? kr(sn) : [], [sn]), un = x(() => w ? Tr(w.workflowSnapshot) : [], [w]);
2154
2155
  async function dn() {
2155
- Qe(!0), M(null);
2156
+ Qe(!0), j(null);
2156
2157
  try {
2157
- let e = await Ne(a);
2158
- fe(e.activityLogs), pe(e.instance), Le(e.tasks), ze(e.workflowTokens);
2158
+ let e = await Pe(a);
2159
+ fe(e.activityLogs), pe(e.instance), Me(e.tasks), ze(e.workflowTokens);
2159
2160
  let t = await Ae(e.instance.id), [n, r, i, o, s] = await Promise.all([
2160
- bn(e.tasks),
2161
- vn({
2161
+ xn(e.tasks),
2162
+ yn({
2162
2163
  ...e,
2163
2164
  adhocDirectives: t
2164
2165
  }),
2165
2166
  je(e.instance.id),
2166
- Ie(e.instance.id),
2167
+ Le(e.instance.id),
2167
2168
  fn(e.instance.id)
2168
2169
  ]);
2169
- he(n), Ke(r), be(i), Ce(o.signatures), ke(o.verification), Ot(t), De(s);
2170
+ he(n), Ue(r), be(i), Ce(o.signatures), ke(o.verification), V(t), Ee(s);
2170
2171
  } catch (e) {
2171
- M(_(e));
2172
+ j(_(e));
2172
2173
  } finally {
2173
2174
  Qe(!1);
2174
2175
  }
2175
2176
  }
2176
2177
  async function fn(e) {
2177
- return le ? Me(e).catch(() => []) : [];
2178
+ return le ? Ne(e).catch(() => []) : [];
2178
2179
  }
2179
2180
  async function pn(e) {
2180
- await Ve(e.id), At.current = 0, await dn();
2181
+ await He(e.id), At.current = 0, await dn();
2181
2182
  }
2182
2183
  async function mn() {
2183
2184
  let e = await fn(a);
2184
- e.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS") ? De(e) : await dn();
2185
+ e.some((e) => e.status === "PENDING" || e.status === "DELIVERY_IN_PROGRESS") ? Ee(e) : await dn();
2185
2186
  }
2186
2187
  async function hn(e, t) {
2187
- if (!b) throw Error("尚未登入,無法上傳附件");
2188
- return { id: (await Ue({
2188
+ if (!y) throw Error("尚未登入,無法上傳附件");
2189
+ return { id: (await We({
2189
2190
  file: t,
2190
2191
  formFieldPath: `form.${e.fieldKey}`
2191
2192
  })).id };
2192
2193
  }
2193
2194
  async function gn(e) {
2194
- if (b) try {
2195
- let t = await Pe({ id: e });
2195
+ if (y) try {
2196
+ let t = await Fe({ id: e });
2196
2197
  window.open(t, "_blank", "noopener,noreferrer");
2197
2198
  } catch (e) {
2198
2199
  ge.error(_(e));
2199
2200
  }
2200
2201
  }
2201
2202
  async function _n(e) {
2202
- if (!b) return;
2203
- let t = await Fe({ id: e.id });
2203
+ if (!y) return;
2204
+ let t = await Ie({ id: e.id });
2204
2205
  wt(e), Dt(t);
2205
2206
  }
2206
- async function yn() {
2207
- if (b && w && Bt) {
2208
- N(!0), M(null), z({});
2207
+ async function vn() {
2208
+ if (y && w && Bt) {
2209
+ P(!0), j(null), R({});
2209
2210
  try {
2210
- await Ee({
2211
- cancelledByMemberId: b,
2211
+ await De({
2212
+ cancelledByMemberId: y,
2212
2213
  comment: kt || null,
2213
2214
  instanceId: w.id
2214
- }), pt(""), L(!1), await dn();
2215
+ }), ft(""), mt(!1), await dn();
2215
2216
  } catch (e) {
2216
- M(_(e));
2217
+ j(_(e));
2217
2218
  } finally {
2218
- N(!1);
2219
+ P(!1);
2219
2220
  }
2220
2221
  }
2221
2222
  }
2222
- async function Sn() {
2223
- if (!b || !w || !Vt) return;
2224
- N(!0), M(null), z({});
2223
+ async function bn() {
2224
+ if (!y || !w || !Vt) return;
2225
+ P(!0), j(null), R({});
2225
2226
  let e = i(Object.values(xt));
2226
2227
  if (e) {
2227
- M(e), N(!1);
2228
+ j(e), P(!1);
2228
2229
  return;
2229
2230
  }
2230
2231
  if (Ut.blockMessage) {
2231
- M(Ut.blockMessage), N(!1);
2232
+ j(Ut.blockMessage), P(!1);
2232
2233
  return;
2233
2234
  }
2234
- let t = w.formDefinitionSnapshot.schema ? ae(w.formDefinitionSnapshot.schema, w.workflowSnapshot) : null, n = te(t ? it(t.fields, gt) : gt, w.workflowSnapshot);
2235
+ let t = w.formDefinitionSnapshot.schema ? ae(w.formDefinitionSnapshot.schema, w.workflowSnapshot) : null, n = te(t ? Je(t.fields, z) : z, w.workflowSnapshot);
2235
2236
  try {
2236
2237
  if (t && w.formDefinitionSnapshot.uiSchema) {
2237
- let e = await ot({
2238
+ let e = await Xe({
2238
2239
  schema: t,
2239
2240
  uiSchema: w.formDefinitionSnapshot.uiSchema,
2240
2241
  values: n
2241
2242
  });
2242
2243
  if (!e.valid) {
2243
- z(e.errors), M("請先修正表單中標示的欄位。"), e.firstInvalidFieldKey && at(e.firstInvalidFieldKey);
2244
+ R(e.errors), j("請先修正表單中標示的欄位。"), e.firstInvalidFieldKey && Ye(e.firstInvalidFieldKey);
2244
2245
  return;
2245
2246
  }
2246
2247
  }
2247
- await Be({
2248
+ await Ve({
2248
2249
  comment: yt,
2249
2250
  formData: n,
2250
- initiatorMemberId: b,
2251
+ initiatorMemberId: y,
2251
2252
  instanceId: w.id,
2252
2253
  title: w.title
2253
2254
  }), vt(w.id), await dn();
2254
2255
  } catch (e) {
2255
- M(_(e));
2256
+ j(_(e));
2256
2257
  } finally {
2257
- N(!1);
2258
+ P(!1);
2258
2259
  }
2259
2260
  }
2260
- let $ = tt || F || rt;
2261
- return /* @__PURE__ */ k(we, { children: [
2262
- /* @__PURE__ */ O(_e, { children: /* @__PURE__ */ k(We, {
2261
+ let $ = N || at || et;
2262
+ return /* @__PURE__ */ k(Te, { children: [
2263
+ /* @__PURE__ */ O(_e, { children: /* @__PURE__ */ k(Ge, {
2263
2264
  description: w ? [
2264
2265
  Nt(w.state),
2265
2266
  t(w.startedAt),
2266
- Tt(w, Zt)
2267
- ].filter(H).join(" · ") : "載入案件內容。",
2267
+ Et(w, Zt)
2268
+ ].filter(U).join(" · ") : "載入案件內容。",
2268
2269
  title: w?.title ?? "簽核案件",
2269
2270
  children: [
2270
2271
  w ? /* @__PURE__ */ O(C, {
2271
2272
  "aria-label": "查看流程圖",
2272
- icon: $e,
2273
+ icon: I,
2273
2274
  iconType: "icon-only",
2274
- onClick: () => I(!0),
2275
+ onClick: () => ut(!0),
2275
2276
  title: "查看流程圖",
2276
2277
  variant: "base-secondary",
2277
2278
  children: "流程圖"
2278
2279
  }) : null,
2279
2280
  Bt ? /* @__PURE__ */ O(C, {
2280
2281
  disabled: $,
2281
- icon: j,
2282
+ icon: $e,
2282
2283
  iconType: "leading",
2283
- onClick: () => L(!0),
2284
+ onClick: () => mt(!0),
2284
2285
  variant: "destructive-secondary",
2285
2286
  children: "取消案件"
2286
2287
  }) : null,
2287
- W ? /* @__PURE__ */ k(we, { children: [
2288
- zt ? /* @__PURE__ */ k(we, { children: [/* @__PURE__ */ O(C, {
2288
+ W ? /* @__PURE__ */ k(Te, { children: [
2289
+ Rt ? /* @__PURE__ */ k(Te, { children: [/* @__PURE__ */ O(C, {
2289
2290
  disabled: $,
2290
- icon: Xe,
2291
+ icon: nt,
2291
2292
  iconType: "leading",
2292
- onClick: () => U.current?.openAdhocModal("COUNTERSIGN"),
2293
+ onClick: () => H.current?.openAdhocModal("COUNTERSIGN"),
2293
2294
  variant: "base-secondary",
2294
2295
  children: "會簽"
2295
2296
  }, "adhoc-countersign"), /* @__PURE__ */ O(C, {
2296
2297
  disabled: $,
2297
- icon: Xe,
2298
+ icon: nt,
2298
2299
  iconType: "leading",
2299
- onClick: () => U.current?.openAdhocModal("PRE_APPROVAL"),
2300
+ onClick: () => H.current?.openAdhocModal("PRE_APPROVAL"),
2300
2301
  variant: "base-secondary",
2301
2302
  children: "加簽"
2302
2303
  }, "adhoc-pre-approval")] }) : null,
2303
2304
  /* @__PURE__ */ O(C, {
2304
2305
  disabled: $,
2305
- icon: Ye,
2306
+ icon: tt,
2306
2307
  iconType: "leading",
2307
- onClick: () => U.current?.openAdhocModal("STAGE_NOTIFY"),
2308
+ onClick: () => H.current?.openAdhocModal("STAGE_NOTIFY"),
2308
2309
  variant: "base-secondary",
2309
2310
  children: "通知設定"
2310
2311
  }, "adhoc-notify"),
2311
2312
  Pt ? /* @__PURE__ */ O(C, {
2312
2313
  disabled: $,
2313
- icon: Ze,
2314
+ icon: rt,
2314
2315
  iconType: "leading",
2315
- onClick: () => U.current?.openReturnModal(),
2316
+ onClick: () => H.current?.openReturnModal(),
2316
2317
  variant: "base-secondary",
2317
2318
  children: "退回"
2318
2319
  }, "task-return") : null,
2319
2320
  Lt ? /* @__PURE__ */ O(C, {
2320
2321
  disabled: $,
2321
- icon: et,
2322
+ icon: it,
2322
2323
  iconType: "leading",
2323
- onClick: () => U.current?.openTransferModal(),
2324
+ onClick: () => H.current?.openTransferModal(),
2324
2325
  variant: "base-secondary",
2325
2326
  children: "轉派"
2326
2327
  }, "task-transfer") : null,
2327
- It ? /* @__PURE__ */ O(C, {
2328
+ Ft ? /* @__PURE__ */ O(C, {
2328
2329
  disabled: $,
2329
- icon: j,
2330
+ icon: $e,
2330
2331
  iconType: "leading",
2331
- onClick: () => U.current?.openRejectModal(),
2332
+ onClick: () => H.current?.openRejectModal(),
2332
2333
  variant: "destructive-secondary",
2333
2334
  children: "拒絕"
2334
2335
  }, "task-reject") : null,
2335
2336
  /* @__PURE__ */ O(C, {
2336
2337
  disabled: $,
2337
- icon: Ge,
2338
+ icon: Ze,
2338
2339
  iconType: "leading",
2339
2340
  onClick: () => {
2340
2341
  tn();
@@ -2346,39 +2347,39 @@ function Sr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHist
2346
2347
  ]
2347
2348
  }) }),
2348
2349
  /* @__PURE__ */ k(ve, { children: [
2349
- l ? /* @__PURE__ */ O(E, { children: /* @__PURE__ */ O(En, {
2350
+ l ? /* @__PURE__ */ O(E, { children: /* @__PURE__ */ O(Dn, {
2350
2351
  attachments: ye,
2351
2352
  canResubmitInstance: Vt,
2352
- deciding: tt,
2353
+ deciding: N,
2353
2354
  error: qe,
2354
2355
  fieldAccess: Yt,
2355
2356
  fieldLabelMarkers: Xt,
2356
2357
  fill: Z && Q && q ? {
2357
2358
  errors: Gt,
2358
- fieldCount: nt(q).size,
2359
+ fieldCount: Ke(q).size,
2359
2360
  onChange: en,
2360
2361
  schema: Z,
2361
2362
  value: Q
2362
2363
  } : null,
2363
2364
  instance: w,
2364
- loading: Je,
2365
+ loading: M,
2365
2366
  onDataSourceStateChange: Mt,
2366
2367
  onDownloadAttachment: (e) => {
2367
2368
  gn(e);
2368
2369
  },
2369
2370
  onFileUploadStateChange: Ut.onFileUploadStateChange,
2370
- onReloadAfterConflict: Kt ? () => void rn() : null,
2371
+ onReloadAfterConflict: Y ? () => void rn() : null,
2371
2372
  onResubmitFormChange: (e) => {
2372
- _t(e), z({});
2373
+ _t(e), R({});
2373
2374
  },
2374
2375
  onResubmitCommentChange: bt,
2375
- onResubmitInstance: () => void Sn(),
2376
+ onResubmitInstance: () => void bn(),
2376
2377
  onUploadAttachment: hn,
2377
2378
  resubmitComment: yt,
2378
- resubmitFormData: gt,
2379
- resubmitFormErrors: R
2379
+ resubmitFormData: z,
2380
+ resubmitFormErrors: ht
2380
2381
  }) }) : null,
2381
- s ? /* @__PURE__ */ O(E, { children: /* @__PURE__ */ O(On, {
2382
+ s ? /* @__PURE__ */ O(E, { children: /* @__PURE__ */ O(kn, {
2382
2383
  attachments: ye,
2383
2384
  onDownload: (e) => {
2384
2385
  gn(e.id);
@@ -2387,28 +2388,28 @@ function Sr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHist
2387
2388
  _n(e);
2388
2389
  }
2389
2390
  }) }) : null,
2390
- f ? /* @__PURE__ */ O(E, { children: /* @__PURE__ */ O(zn, {
2391
- adhocDirectives: V,
2392
- currentMemberId: b,
2391
+ f ? /* @__PURE__ */ O(E, { children: /* @__PURE__ */ O(Bn, {
2392
+ adhocDirectives: Ot,
2393
+ currentMemberId: y,
2393
2394
  fill: $t,
2394
2395
  instance: w,
2395
2396
  memberProfilesById: Zt,
2396
2397
  onChanged: dn,
2397
- onDecidingChange: st,
2398
+ onDecidingChange: ot,
2398
2399
  onFillApproveError: nn,
2399
- ref: U,
2400
+ ref: H,
2400
2401
  tasks: A
2401
2402
  }) }) : null,
2402
- d ? /* @__PURE__ */ O(E, { children: /* @__PURE__ */ O(Un, {
2403
+ d ? /* @__PURE__ */ O(E, { children: /* @__PURE__ */ O(Wn, {
2403
2404
  signatureVerification: Oe,
2404
2405
  signatures: xe
2405
2406
  }) }) : null,
2406
- le && Te.length > 0 ? /* @__PURE__ */ O(E, { children: /* @__PURE__ */ O(nr, {
2407
- deliveries: Te,
2407
+ le && we.length > 0 ? /* @__PURE__ */ O(E, { children: /* @__PURE__ */ O(rr, {
2408
+ deliveries: we,
2408
2409
  onRetry: pn,
2409
- readNodeLabel: (e) => Ft(e, w?.workflowSnapshot ?? null)
2410
+ readNodeLabel: (e) => It(e, w?.workflowSnapshot ?? null)
2410
2411
  }) }) : null,
2411
- u ? /* @__PURE__ */ O(E, { children: /* @__PURE__ */ O(Qn, {
2412
+ u ? /* @__PURE__ */ O(E, { children: /* @__PURE__ */ O($n, {
2412
2413
  activityLogs: de,
2413
2414
  formSchema: X,
2414
2415
  instanceState: w?.state ?? "RUNNING",
@@ -2424,16 +2425,16 @@ function Sr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHist
2424
2425
  ] }),
2425
2426
  w ? /* @__PURE__ */ O(T, {
2426
2427
  modalType: "standard",
2427
- onClose: () => I(!1),
2428
- open: ut,
2428
+ onClose: () => ut(!1),
2429
+ open: st,
2429
2430
  showModalHeader: !0,
2430
2431
  size: "wide",
2431
2432
  supportingText: `${Nt(w.state)} · ${t(w.startedAt)}`,
2432
2433
  title: "流程圖",
2433
2434
  children: /* @__PURE__ */ k("div", {
2434
- style: fr,
2435
+ style: pr,
2435
2436
  children: [/* @__PURE__ */ O("div", {
2436
- style: pr,
2437
+ style: mr,
2437
2438
  children: /* @__PURE__ */ k(dt, {
2438
2439
  edges: ln,
2439
2440
  fitView: !0,
@@ -2443,15 +2444,15 @@ function Sr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHist
2443
2444
  nodes: cn,
2444
2445
  nodesDraggable: !1,
2445
2446
  nodesFocusable: !1,
2446
- nodeTypes: xr,
2447
+ nodeTypes: Sr,
2447
2448
  panOnDrag: !0,
2448
2449
  proOptions: { hideAttribution: !0 },
2449
2450
  children: [/* @__PURE__ */ O(ct, {}), /* @__PURE__ */ O(lt, { showInteractive: !1 })]
2450
2451
  })
2451
2452
  }), un.length > 0 ? /* @__PURE__ */ O("div", {
2452
- style: vr,
2453
+ style: yr,
2453
2454
  children: un.map((e) => /* @__PURE__ */ O("span", {
2454
- style: yr,
2455
+ style: br,
2455
2456
  children: e
2456
2457
  }, e))
2457
2458
  }) : null]
@@ -2462,14 +2463,14 @@ function Sr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHist
2462
2463
  onClose: () => {
2463
2464
  wt(null), Dt(null);
2464
2465
  },
2465
- open: !!(B && Et),
2466
+ open: !!(B && Tt),
2466
2467
  showModalHeader: !0,
2467
2468
  size: "wide",
2468
2469
  supportingText: B?.filename ?? void 0,
2469
2470
  title: "PDF 預覽",
2470
- children: Et ? /* @__PURE__ */ O(Ct, {
2471
+ children: Tt ? /* @__PURE__ */ O(Ct, {
2471
2472
  filename: B?.filename ?? "PDF 預覽",
2472
- fileUrl: Et,
2473
+ fileUrl: Tt,
2473
2474
  onDownload: B ? () => void gn(B.id) : void 0
2474
2475
  }) : null
2475
2476
  }),
@@ -2477,19 +2478,19 @@ function Sr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHist
2477
2478
  cancelText: "保留案件",
2478
2479
  confirmButtonProps: { variant: "destructive-primary" },
2479
2480
  confirmText: "確認取消",
2480
- loading: tt,
2481
+ loading: N,
2481
2482
  modalStatusType: "error",
2482
2483
  modalType: "standard",
2483
- onCancel: () => L(!1),
2484
- onClose: () => L(!1),
2485
- onConfirm: () => void yn(),
2486
- open: mt,
2484
+ onCancel: () => mt(!1),
2485
+ onClose: () => mt(!1),
2486
+ onConfirm: () => void vn(),
2487
+ open: pt,
2487
2488
  showModalFooter: !0,
2488
2489
  showModalHeader: !0,
2489
2490
  supportingText: "取消後會關閉目前待簽任務與候選簽核人。",
2490
2491
  title: "取消案件",
2491
2492
  children: /* @__PURE__ */ k("div", {
2492
- style: br,
2493
+ style: xr,
2493
2494
  children: [/* @__PURE__ */ k(D, {
2494
2495
  variant: "body",
2495
2496
  children: [
@@ -2501,32 +2502,32 @@ function Sr({ instanceId: a, showAttachments: s = !0, showForm: l = !0, showHist
2501
2502
  label: "取消原因",
2502
2503
  name: "cancelComment",
2503
2504
  children: /* @__PURE__ */ O(Se, {
2504
- onChange: (e) => pt(e.target.value),
2505
+ onChange: (e) => ft(e.target.value),
2505
2506
  placeholder: "可填寫取消原因",
2506
2507
  resize: "vertical",
2507
2508
  rows: 3,
2508
- value: ft
2509
+ value: L
2509
2510
  })
2510
2511
  })]
2511
2512
  })
2512
2513
  })
2513
2514
  ] });
2514
2515
  }
2515
- function Cr(e) {
2516
- return e.data.label ? e.data.label : e.data.isDefault ? "其他情況" : e.data.condition ?? "";
2517
- }
2518
2516
  function wr(e) {
2519
- return e.edges.map(Cr).filter((e) => e.trim().length > 0);
2517
+ return e.data.label ? e.data.label : e.data.isDefault ? "其他情況" : e.data.condition ?? "";
2520
2518
  }
2521
2519
  function Tr(e) {
2520
+ return e.edges.map(wr).filter((e) => e.trim().length > 0);
2521
+ }
2522
+ function Er(e) {
2522
2523
  return e === "startEvent" ? "開始" : e === "endEvent" ? "完成" : e === "userTask" ? "簽核節點" : e === "serviceTask" ? "知會節點" : e === "exclusiveGateway" ? "條件分流" : "平行處理";
2523
2524
  }
2524
- function Er(e, t, n, r) {
2525
+ function Dr(e, t, n, r) {
2525
2526
  return e.nodes.map((e) => {
2526
- let i = _n(e, t, n, r);
2527
+ let i = vn(e, t, n, r);
2527
2528
  return {
2528
2529
  data: {
2529
- kindLabel: Tr(e.type),
2530
+ kindLabel: Er(e.type),
2530
2531
  label: e.data.label,
2531
2532
  secondaryLabel: i.secondaryLabel,
2532
2533
  statusLabel: i.statusLabel,
@@ -2534,13 +2535,13 @@ function Er(e, t, n, r) {
2534
2535
  },
2535
2536
  id: e.id,
2536
2537
  position: e.position,
2537
- sourcePosition: I.Right,
2538
- targetPosition: I.Left,
2538
+ sourcePosition: L.Right,
2539
+ targetPosition: L.Left,
2539
2540
  type: "workflowRuntime"
2540
2541
  };
2541
2542
  });
2542
2543
  }
2543
- function Dr(e) {
2544
+ function Or(e) {
2544
2545
  let t = new ft.graphlib.Graph();
2545
2546
  return t.setDefaultEdgeLabel(() => ({})), t.setGraph({
2546
2547
  nodesep: 56,
@@ -2548,8 +2549,8 @@ function Dr(e) {
2548
2549
  ranksep: 120
2549
2550
  }), e.nodes.forEach((e) => {
2550
2551
  t.setNode(e.id, {
2551
- height: dr,
2552
- width: ur
2552
+ height: fr,
2553
+ width: dr
2553
2554
  });
2554
2555
  }), e.edges.forEach((e) => {
2555
2556
  t.setEdge(e.source, e.target);
@@ -2560,16 +2561,16 @@ function Dr(e) {
2560
2561
  return n ? {
2561
2562
  ...e,
2562
2563
  position: {
2563
- x: n.x - ur / 2,
2564
- y: n.y - dr / 2
2564
+ x: n.x - dr / 2,
2565
+ y: n.y - fr / 2
2565
2566
  }
2566
2567
  } : e;
2567
2568
  })
2568
2569
  };
2569
2570
  }
2570
- function Or(e) {
2571
+ function kr(e) {
2571
2572
  return e.edges.map((e) => {
2572
- let t = Cr(e);
2573
+ let t = wr(e);
2573
2574
  return {
2574
2575
  animated: !1,
2575
2576
  id: e.id,
@@ -2597,25 +2598,25 @@ function Or(e) {
2597
2598
  };
2598
2599
  });
2599
2600
  }
2600
- function kr(e) {
2601
+ function Ar(e) {
2601
2602
  return e === "current" ? {
2602
- ...mr,
2603
+ ...hr,
2603
2604
  border: "1px solid var(--mzn-color-primary, #0057ff)",
2604
2605
  boxShadow: "0 0 0 3px rgba(0, 87, 255, 0.14)"
2605
2606
  } : e === "completed" ? {
2606
- ...mr,
2607
+ ...hr,
2607
2608
  border: "1px solid #16a34a"
2608
2609
  } : e === "cancelled" ? {
2609
- ...mr,
2610
+ ...hr,
2610
2611
  border: "1px solid #dc2626",
2611
2612
  opacity: .72
2612
2613
  } : e === "waiting" ? {
2613
- ...mr,
2614
+ ...hr,
2614
2615
  border: "1px dashed #64748b"
2615
- } : mr;
2616
+ } : hr;
2616
2617
  }
2617
- function Ar(e) {
2618
- let t = hr;
2618
+ function jr(e) {
2619
+ let t = gr;
2619
2620
  return e === "current" ? {
2620
2621
  ...t,
2621
2622
  background: "#eff6ff",
@@ -2638,14 +2639,14 @@ function Ar(e) {
2638
2639
  color: "#64748b"
2639
2640
  };
2640
2641
  }
2641
- function jr({ data: e }) {
2642
+ function Mr({ data: e }) {
2642
2643
  return /* @__PURE__ */ k("div", {
2643
- style: kr(e.tone),
2644
+ style: Ar(e.tone),
2644
2645
  children: [
2645
2646
  /* @__PURE__ */ O(ut, {
2646
2647
  isConnectable: !1,
2647
- position: I.Left,
2648
- style: _r,
2648
+ position: L.Left,
2649
+ style: vr,
2649
2650
  type: "target"
2650
2651
  }),
2651
2652
  /* @__PURE__ */ O(D, {
@@ -2656,23 +2657,23 @@ function jr({ data: e }) {
2656
2657
  children: e.label
2657
2658
  }),
2658
2659
  /* @__PURE__ */ O("span", {
2659
- style: Ar(e.tone),
2660
+ style: jr(e.tone),
2660
2661
  children: e.statusLabel
2661
2662
  }),
2662
2663
  /* @__PURE__ */ O("span", {
2663
2664
  title: e.secondaryLabel,
2664
- style: gr,
2665
+ style: _r,
2665
2666
  children: e.secondaryLabel || e.kindLabel
2666
2667
  }),
2667
2668
  /* @__PURE__ */ O(ut, {
2668
2669
  isConnectable: !1,
2669
- position: I.Right,
2670
- style: _r,
2670
+ position: L.Right,
2671
+ style: vr,
2671
2672
  type: "source"
2672
2673
  })
2673
2674
  ]
2674
2675
  });
2675
2676
  }
2676
- export { zn as a, Un as i, nr as n, On as o, Qn as r, En as s, Sr as t };
2677
+ export { Bn as a, Wn as i, rr as n, kn as o, $n as r, Dn as s, Cr as t };
2677
2678
 
2678
- //# sourceMappingURL=detail-ByZV1XaI.js.map
2679
+ //# sourceMappingURL=detail-Bv90gvy0.js.map