@openbkn/workshop 0.2.2-rc.5 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/README.md +83 -13
  2. package/component.d.ts +10 -0
  3. package/dist/ActionConfirm-DJ91X3ml.js +236 -0
  4. package/dist/ActionFailure-ZgPt_3B-.js +37 -0
  5. package/dist/AgentChat-CRYai8ge.js +1062 -0
  6. package/dist/AppFormModal-D73ucaHK.js +4282 -0
  7. package/dist/AppListPage-D87piiOw.js +1364 -0
  8. package/dist/AskDrawer-BUMYsRnt.js +38 -0
  9. package/dist/ComputedView-CgYrDbx1.js +3221 -0
  10. package/dist/ConclusionApply-sjGfoEBY.js +153 -0
  11. package/dist/CypherEditor-lus6FA5L.js +485 -0
  12. package/dist/LandingList-6JI6864C.js +230 -0
  13. package/dist/MenuUnfoldOutlined-Cdg24l2h.js +27 -0
  14. package/dist/ModelTrial-ClHFGTpQ.js +359 -0
  15. package/dist/PageRenderer-DBd_g6mN.js +85480 -0
  16. package/dist/README-DjRyTQSR.js +76 -0
  17. package/dist/ScenarioApply-DtW_hh47.js +590 -0
  18. package/dist/SimulateForm-C-i08Jjd.js +153 -0
  19. package/dist/Subgraph-CnrkH9AN.js +32586 -0
  20. package/dist/WorkshopLabPage-DiVXQL9e.js +11364 -0
  21. package/dist/WorkshopRunPage-6hjRUf64.js +253 -0
  22. package/dist/abnfDiagram-WEYOIA3C-beRNhN3c.js +87 -0
  23. package/dist/action-type-tool.service-B2B74fKC.js +1060 -0
  24. package/dist/actionButton-DA5CNEzx.js +94 -0
  25. package/dist/actionButton.en-US-qjeqA7hs.js +94 -0
  26. package/dist/agentChat-EoDznd58.js +116 -0
  27. package/dist/agentChat.en-US-B6-pFd9Y.js +116 -0
  28. package/dist/alertList-DqditwM8.js +84 -0
  29. package/dist/alertList.en-US-BAXAgltP.js +84 -0
  30. package/dist/architectureDiagram-ZHVYKT53-DY2l1qxx.js +4779 -0
  31. package/dist/asOfSlider-QPvHWUMV.js +83 -0
  32. package/dist/asOfSlider.en-US-BI4jVfSn.js +83 -0
  33. package/dist/bkn-agent-execution.service-DVh-SHyl.js +205 -0
  34. package/dist/blockDiagram-RJAE7QA3-DR0mjN2h.js +1435 -0
  35. package/dist/c4Diagram-XDPPPE54-DH5zsGug.js +1518 -0
  36. package/dist/channel-B034hcOF.js +5 -0
  37. package/dist/china-C6m7zXIv.js +9 -0
  38. package/dist/chunk-2E7WHVMD-Ba3svxgx.js +664 -0
  39. package/dist/chunk-2Q5K7J3B-rT4eU6_y.js +15 -0
  40. package/dist/chunk-4EMNKR2T-C1kQZYHK.js +262 -0
  41. package/dist/chunk-55XCU76K-dcpLOktb.js +68 -0
  42. package/dist/chunk-5VM5RSS4-BdpQuzmO.js +19 -0
  43. package/dist/chunk-JWPE2WC7-CDBrSjU7.js +8 -0
  44. package/dist/chunk-VQ5W62QI-BiVKc40w.js +19 -0
  45. package/dist/chunk-XXDRQBXY-CPYrcdVW.js +8 -0
  46. package/dist/chunk-ZCHMQSOR-BG8OLpvb.js +451 -0
  47. package/dist/classDiagram-v2-4MYWR3UA-DqbpQpwI.js +1564 -0
  48. package/dist/component.d-DFoMKuUv.js +179 -0
  49. package/dist/cose-bilkent-JH36ORCC-CdXk4sPf.js +2609 -0
  50. package/dist/customComponents-DasaZ6pq.js +4 -0
  51. package/dist/customComponents.en-US-CkabuCXg.js +79 -0
  52. package/dist/customParseFormat-C0uLEpdq.js +182 -0
  53. package/dist/cynefin-EF2NZ3EQ-D7MVnMHu.js +21746 -0
  54. package/dist/cynefinDiagram-WF24UDRP-BYT_KpDL.js +299 -0
  55. package/dist/cytoscape.esm-BCV9V6aO.js +18760 -0
  56. package/dist/d3-scale-DA8IHmf0.js +1841 -0
  57. package/dist/dagre-NK4GIZVX-l-ghPdM8.js +2154 -0
  58. package/dist/dateRange-BbkLMg8L.js +79 -0
  59. package/dist/dateRange.en-US-CV12Q02G.js +79 -0
  60. package/dist/dayjs.min-DZ-YV8Mv.js +284 -0
  61. package/dist/diagram-CBK3MWTC-Bt3HiwvA.js +542 -0
  62. package/dist/diagram-I5XIIV2D-DcbqfBjx.js +150 -0
  63. package/dist/diagram-ODIL2UCW-9PC1n3n5.js +346 -0
  64. package/dist/diagram-PFBEJUXE-DGhr2kc7.js +478 -0
  65. package/dist/diagram-RJA3I4VV-DwzpOjZ_.js +219 -0
  66. package/dist/diagram-TYUNFSNR-B3Bd3TDU.js +2583 -0
  67. package/dist/dropdownFilter-DOi_8-ZT.js +76 -0
  68. package/dist/dropdownFilter.en-US-BiXpvXtF.js +76 -0
  69. package/dist/ebnfDiagram-V4P3TTPT-E5NN2oKc.js +109 -0
  70. package/dist/elk-QONTBCTQ-dFjcujl_.js +49170 -0
  71. package/dist/erDiagram-KYQIGQAA-BMrasBzB.js +1061 -0
  72. package/dist/eventList-CnsAwfDS.js +115 -0
  73. package/dist/eventList.en-US-Cof3rCLq.js +115 -0
  74. package/dist/eventReport-XS-HegnH.js +76 -0
  75. package/dist/eventReport.en-US-DTx4vzWT.js +76 -0
  76. package/dist/flowDiagram-IUGLLWBU-BGIBH0q0.js +1769 -0
  77. package/dist/ganttChart-DEeSvTJA.js +77 -0
  78. package/dist/ganttChart.en-US-SwRKrnoD.js +77 -0
  79. package/dist/ganttDiagram-R7GPNTJY-C0tb1Lpp.js +1741 -0
  80. package/dist/generateCypher-Ch9_lQa6.js +399 -0
  81. package/dist/gitGraphDiagram-PDYL7XHY-DBqcOa-c.js +815 -0
  82. package/dist/graph-CKJmgLki.js +1541 -0
  83. package/dist/index-BA-GzCXt.js +441 -0
  84. package/dist/infoDiagram-MVDRKAX5-Bwuki4JA.js +24 -0
  85. package/dist/ishikawaDiagram-HPEHV2GE-Dz4d6ygx.js +622 -0
  86. package/dist/journeyDiagram-BOSHW7O7-C99m34Bb.js +834 -0
  87. package/dist/kanban-definition-FNSA4HC5-mdqjODsT.js +724 -0
  88. package/dist/katex-BsrBVQKd.js +11314 -0
  89. package/dist/manifest-BjV1PJ6u.js +41 -0
  90. package/dist/mermaid.core-yQghUlIz.js +17642 -0
  91. package/dist/metricCards-CSb-_cT2.js +104 -0
  92. package/dist/metricCards.en-US-BLLhRsQU.js +104 -0
  93. package/dist/mindmap-definition-6OY57UG3-BZhO2wX4.js +834 -0
  94. package/dist/modelTrial-Bvb-RhGt.js +137 -0
  95. package/dist/modelTrial.en-US-DYcuor-G.js +137 -0
  96. package/dist/models-DekiCOuZ.js +6 -0
  97. package/dist/object-metric-numeric-vs3BeDkH.js +42 -0
  98. package/dist/object-metric.service-flZgBMRX.js +233 -0
  99. package/dist/objectDetail-SQUbp4Py.js +117 -0
  100. package/dist/objectDetail.en-US-DW3mlONM.js +117 -0
  101. package/dist/objectList-D99wPtJH.js +97 -0
  102. package/dist/objectList.en-US-PBBNyVLW.js +97 -0
  103. package/dist/objectTable-0jsFFMN3.js +127 -0
  104. package/dist/objectTable.en-US-yWEs8qc_.js +127 -0
  105. package/dist/pegDiagram-ECIUJNBX-BDa5RfZt.js +95 -0
  106. package/dist/pieDiagram-GNMPY74T-DNVtzXPv.js +165 -0
  107. package/dist/pivotTable-CHmQw18-.js +102 -0
  108. package/dist/pivotTable.en-US-B4uv4P08.js +102 -0
  109. package/dist/prompt-DYrjlEFr.js +373 -0
  110. package/dist/quadrantDiagram-D57K4MC3-vK0f2OvQ.js +1023 -0
  111. package/dist/railroadDiagram-Y72NRBL7-j6ZrTmRp.js +77 -0
  112. package/dist/regionMap-Cme-JyV_.js +128 -0
  113. package/dist/regionMap.en-US-Bwr2_p32.js +128 -0
  114. package/dist/requirementDiagram-EQYSW5RA-DgfEyljA.js +886 -0
  115. package/dist/sankeyDiagram-SY24JHO5-CImx-IX0.js +1160 -0
  116. package/dist/scenarioBar-BV43p7n-.js +122 -0
  117. package/dist/scenarioBar.en-US-5KqMQ2Bg.js +122 -0
  118. package/dist/scheduleGantt-CTYO-zYP.js +180 -0
  119. package/dist/scheduleGantt.en-US-hE7mvVUW.js +180 -0
  120. package/dist/searchBox-Ca7w0f_6.js +67 -0
  121. package/dist/searchBox.en-US-ArS_XBvB.js +67 -0
  122. package/dist/segmentedFilter-MhjVcWo0.js +80 -0
  123. package/dist/segmentedFilter.en-US-BxNrQO5T.js +80 -0
  124. package/dist/sequenceDiagram-BLEHNHQU-nWmjd1ci.js +2969 -0
  125. package/dist/sizeCapture-INFHLROL-D3jlbt7h.js +46 -0
  126. package/dist/stageChain-BxBafwjD.js +74 -0
  127. package/dist/stageChain.en-US-CP0G27n8.js +74 -0
  128. package/dist/stateDiagram-v2-A6IESKWZ-DG1ZetEu.js +1514 -0
  129. package/dist/subgraph-7n4SwliR.js +71 -0
  130. package/dist/subgraph.en-US-BNvY18IW.js +71 -0
  131. package/dist/swimlanes-B3ENRKFQ-cCmJE8AU.js +4991 -0
  132. package/dist/swimlanesDiagram-AYQRV4AK-CtuhyguU.js +14 -0
  133. package/dist/taskInbox-DGWYeI2b.js +118 -0
  134. package/dist/taskInbox.en-US-B-OzDmVl.js +118 -0
  135. package/dist/text-BqSVQKS6.js +78 -0
  136. package/dist/text.en-US-BhAxy_LE.js +78 -0
  137. package/dist/timeline-definition-JXYKGLGB-Cc-INsOv.js +1057 -0
  138. package/dist/trendChart-BjEeRS5_.js +135 -0
  139. package/dist/trendChart.en-US-BBGqWUKM.js +135 -0
  140. package/dist/useLabData-Df-jEHKs.js +20470 -0
  141. package/dist/usecaseDiagram-WPOLBNNX-r8wVjopm.js +7920 -0
  142. package/dist/vennDiagram-Q3Y3IDCW-BZiOcgrj.js +1579 -0
  143. package/dist/wardleyDiagram-IVAIDKWA-16jd07C_.js +675 -0
  144. package/dist/workshop-app-DnHNjBqy.js +86038 -0
  145. package/dist/workshop-app.css +1 -0
  146. package/dist/workshop-app.js +4 -0
  147. package/dist/world-Djau1JyJ.js +9 -0
  148. package/dist/xychartDiagram-4URNHDU4-C8DwWQNh.js +1460 -0
  149. package/dist-cli/workshop.js +341 -218
  150. package/example/host.js +109 -0
  151. package/example/index.html +93 -0
  152. package/example/server.mjs +237 -0
  153. package/index.d.ts +48 -0
  154. package/lib/validate.js +47 -1
  155. package/package.json +17 -5
  156. package/runtime/frame-runtime.js +13 -1
  157. package/workshop-component.js +32 -12
  158. package/workshop.js +2 -0
@@ -0,0 +1,76 @@
1
+ const n = `# 供应商风险矩阵(x-acme.riskMatrix)
2
+
3
+ 按延期概率与影响金额把供应商放进四象限,点一个供应商列出它的超期订单并就地发起加急。用来决定先盯哪些供应商、先催哪些订单。
4
+
5
+ ## 适用与不适用
6
+
7
+ - 适用:供应商(或任何对象)有两个可比较的风险度量,要按象限分出重点并下钻到明细。
8
+ - 不适用:
9
+ - 只看排名:用对象表排序。
10
+ - 看风险随时间的变化:用趋势图。
11
+
12
+ ## 本体契约
13
+
14
+ | 角色 | 对象类要求 | 必要的属性 | 关系 | 必填 |
15
+ | --- | --- | --- | --- | --- |
16
+ | 供应商 | 被评估的对象,作为数据源 | 名称;横轴度量(数字,0–1);纵轴度量(数字);气泡大小(数字) | — | 是 |
17
+ | 订单 | 下钻的明细 | 编号、交期、金额;逻辑属性 \`overdue\`(是否超期,布尔) | 订单 → 供应商(一跳),配置为“订单到供应商的关系” | 是 |
18
+
19
+ “是否超期”必须是订单上的逻辑属性:组件只查 \`overdue = true\` 的订单,不自己比较日期。
20
+
21
+ ## 组件内置的判断
22
+
23
+ 无业务判断。象限只是显示分档,分界值由构建者在配置中设定(\`xThreshold\`、\`yThreshold\`)。
24
+
25
+ ## 扩展点
26
+
27
+ ### 延期概率与影响金额
28
+
29
+ - 用途:决定供应商落在哪个象限。
30
+ - 在哪里配:数据源字段对应到 \`x\`、\`y\`、\`size\` 三个角色。
31
+ - 接什么:供应商对象类上的属性、逻辑属性或指标。延期概率建议写成逻辑属性或指标(例如近 90 天延期单占比),不要在组件里算。
32
+
33
+ ### 超期订单
34
+
35
+ - 用途:下钻列表的范围。
36
+ - 接什么:订单对象类上的逻辑属性 \`overdue\`。“超期”的口径(是否算宽限期、是否排除已取消)在逻辑属性里定。
37
+
38
+ ### 加急行动
39
+
40
+ - 用途:对超期订单发起加急。
41
+ - 在哪里配:\`urgentAction\`,选知识网络中的行动类;不配则不显示按钮。
42
+ - 失败与取消:执行确认由页面弹出,用户取消时组件不变;被拒时组件显示原因。
43
+
44
+ ## 交互与联动
45
+
46
+ - 写入:点击气泡写入选中对象(\`selection\`,对象类为供应商),再点取消。
47
+ - 读取:跟随页面筛选;按页面的选中对象高亮并下钻。
48
+ - 行动:\`act\` 发起加急,经页面的执行确认。
49
+ - 向页面 Agent 报告各象限的供应商与已选中供应商的超期订单(\`describe\`)。
50
+
51
+ ## 场景配方
52
+
53
+ ### 供应链:供应商交付风险
54
+
55
+ | 角色 | 对应 |
56
+ | --- | --- |
57
+ | 供应商 | 供应商对象类;横轴 = 延期概率(逻辑属性),纵轴 = 在途订单影响金额(指标),大小 = 在途金额 |
58
+ | 订单 | 采购订单;\`overdue\` 逻辑属性;采购订单 → 供应商 |
59
+ | 加急 | 行动“标记加急” |
60
+
61
+ 检查项:选中一个供应商,列出的订单与在知识网络中查询 \`overdue = true\` 的结果一致;改变逻辑属性的口径后,列表随之变化,组件代码不用改。
62
+
63
+ ## 给 AI 的指引
64
+
65
+ 1. 先确认两个度量和气泡大小在知识网络中都有出处;没有就列出要补的逻辑属性或指标,不要在配置或代码里算。
66
+ 2. 订单对象类缺少 \`overdue\` 逻辑属性时,提示用户先在知识网络中添加,并说明口径要由业务确定。
67
+ 3. 象限分界值问用户,不要猜。
68
+
69
+ ## 限制
70
+
71
+ - 数据源最多显示 5000 行;气泡多于 200 个时标签会重叠,建议先按筛选缩小范围。
72
+ - 下钻只支持一跳关系。
73
+ `;
74
+ export {
75
+ n as default
76
+ };
@@ -0,0 +1,590 @@
1
+ import { r as x, u as Te, o as $e, E as Ae, G as ve, H as De, K as Fe, j as r, l as ue, a as oe, f as Ce, c as ye, p as Ie, g as Be, M as Pe } from "./workshop-app-DnHNjBqy.js";
2
+ import { e as Ee } from "./generateCypher-Ch9_lQa6.js";
3
+ import { u as je, b as Ve, a as Ge, C as Le, n as pe, M as ze, A as ge, T as Se, X as Ke, r as be, e as qe, i as Ue, S as Ze, f as _e, E as Je, Y as He, Z as Xe, _ as Qe, $ as We } from "./useLabData-Df-jEHKs.js";
4
+ import { i as Ye, j as es, u as ss, m as ts, r as os, k as as, n as Me, s as g, c as ns, d as cs, o as rs, z as is, p as ds, q as ls, t as us, v as ps, w as hs, x as ms, y as ks, B as fs, G as gs, H as ws, I as ys, J as Ne, K as bs, L as js } from "./PageRenderer-DBd_g6mN.js";
5
+ import { u as xs, T as vs, L as Ls, a as Ss, r as Ms } from "./LandingList-6JI6864C.js";
6
+ import { A as Ns } from "./ActionFailure-ZgPt_3B-.js";
7
+ const Ts = (i, m) => ({
8
+ ...i.create?.values,
9
+ ...m
10
+ });
11
+ function Cs(i, m, n, a, S) {
12
+ const y = m.objectTypes[i.objectType]?.primaryKeys ?? [], h = new Set(i.inputs.filter((u) => u.property).map((u) => u.name)), d = { ...n };
13
+ for (const u of y)
14
+ h.has(u) && (d[u] === void 0 || d[u] === null || d[u] === "") && (d[u] = `${a}-${S.toString(36).toUpperCase()}`);
15
+ return d;
16
+ }
17
+ function Es(i, m, n, a) {
18
+ const S = x.useMemo(
19
+ () => i.flatMap((d) => {
20
+ const u = d.operation?.action?.unique ?? [];
21
+ return !d.action || !d.prepared || u.length === 0 ? [] : [{
22
+ id: d.edit.id,
23
+ objectType: d.action.objectType,
24
+ values: d.prepared.params,
25
+ unique: u,
26
+ ...d.operation?.action?.active ? { active: d.operation.action.active } : {}
27
+ }];
28
+ }),
29
+ [i]
30
+ ), y = S.length > 0 ? JSON.stringify([a, S]) : null, h = Ye(y, async () => {
31
+ const d = await es(m, n, S, a);
32
+ return new Set([...d.keys()].map((u) => S[u].id));
33
+ });
34
+ return {
35
+ checking: h.status === "loading",
36
+ // Not read is not known to be free: the plans wait as if found, and say so.
37
+ found: h.status === "ready" ? h.value : h.status === "error" ? new Set(S.map((d) => d.id)) : Rs
38
+ };
39
+ }
40
+ const Rs = /* @__PURE__ */ new Set(), Os = (i, m) => m ?? { $key: i.key }, we = 5, _ = (i) => ue(i.applied), J = (i) => `landing\0${i}`;
41
+ function zs({ scenario: i, onClose: m }) {
42
+ const { t: n } = Te(), a = je(), { change: S, now: y } = ss(), h = a.models, d = i.adoption?.asOf ?? Ve(a.spec, a.values), [u, E] = x.useState(!1), [N, I] = x.useState(!1), v = (e, o) => {
43
+ m(), o && a.openPage && a.openPage(o), setTimeout(() => js(e));
44
+ }, M = (e) => /* @__PURE__ */ r.jsx("ul", { className: g.applyList, children: e.map((o) => /* @__PURE__ */ r.jsxs("li", { children: [
45
+ /* @__PURE__ */ r.jsxs("span", { className: g.applyBody, children: [
46
+ /* @__PURE__ */ r.jsxs("span", { children: [
47
+ /* @__PURE__ */ r.jsx("b", { children: o.rule }),
48
+ " ",
49
+ o.task,
50
+ o.page && /* @__PURE__ */ r.jsxs("span", { className: g.actMuted, children: [
51
+ " ",
52
+ n("workshopLab.checkDetail.onPage", { page: o.page.title })
53
+ ] })
54
+ ] }),
55
+ /* @__PURE__ */ r.jsx("span", { className: g.actError, children: o.text })
56
+ ] }),
57
+ /* @__PURE__ */ r.jsx("span", { className: g.applyAction, children: /* @__PURE__ */ r.jsx(oe, { size: "small", type: "link", onClick: () => v(o.focus, o.page?.id), children: n("workshopLab.scheduleRules.review.goTo") }) })
58
+ ] }, o.id)) }), b = x.useRef(!0);
59
+ x.useEffect(() => (b.current = !0, () => {
60
+ b.current = !1;
61
+ }), []);
62
+ const L = i.edits.map((e) => {
63
+ const o = a.spec.sources.find((te) => te.id === e.source), c = o?.operations?.find((te) => te.id === e.operation), t = a.sources[e.source], s = t?.status === "ready" ? t.rows.find((te) => te.$key === e.key) : void 0, p = c && s ? $e(c, s, e.params, d) : {}, k = s ? { ...s, ...p } : void 0, f = c?.action ? Ge(a.kn, c.action.id) : void 0, Z = !!(e.create && f && Ae(f) === "create"), xe = {
64
+ scenario: i.name,
65
+ user: Ke(),
66
+ ...Z && f ? { keys: a.kn.objectTypes[f.objectType]?.primaryKeys ?? [] } : {}
67
+ }, fe = Z && c && f ? ve(c, e, Os(e, s), f.inputs, xe) : void 0, le = fe ? { ...fe, params: Ts(e, fe.params) } : c && f && k ? ve(c, e, k, f.inputs, xe) : void 0, Re = De(e, s), Oe = c ? !s && !Z ? n("workshopLab.scenario.apply.noObject") : c.action && !f ? n("workshopLab.act.unknown", { id: c.action.id }) : f && !f.canExecute ? n("workshopLab.act.forbidden") : le && le.missing.length > 0 ? n("workshopLab.scenario.apply.missing", { names: le.missing.join("、") }) : void 0 : n("workshopLab.scenario.apply.noOperation");
68
+ return { edit: e, source: o, operation: c, fact: s, changes: p, action: f, prepared: le, conflicts: Re, blocked: Oe, makes: Z };
69
+ }), O = Es(
70
+ L.filter((e) => e.makes && !e.blocked && !_(e.edit)),
71
+ a.run,
72
+ a.kn,
73
+ d
74
+ ), A = L.map((e) => {
75
+ if (!e.makes || e.blocked || _(e.edit)) return e;
76
+ const o = a.kn.objectTypes[e.action.objectType]?.name ?? e.action.objectType;
77
+ return O.checking ? { ...e, blocked: n("workshopLab.scenario.apply.checkingDuplicates", { type: o }) } : O.found.has(e.edit.id) ? { ...e, blocked: n("workshopLab.scenario.apply.duplicate", { type: o }) } : e;
78
+ }), D = x.useMemo(
79
+ () => a.spec.sources.filter((e) => e.model?.landing),
80
+ [a.spec.sources]
81
+ ), ae = i.adoption !== void 0 || [
82
+ ...Le(
83
+ a.spec.sources,
84
+ D.map((e) => e.id)
85
+ )
86
+ ].every((e) => h?.views[e]?.status === "fresh"), W = x.useMemo(() => {
87
+ const e = i.adoption;
88
+ if (!e || !h) return /* @__PURE__ */ new Set();
89
+ const o = ts(
90
+ h.context,
91
+ {
92
+ scenario: { ...i, adoption: void 0 },
93
+ rows: a.overlay?.rows,
94
+ pending: a.overlay?.status === "loading"
95
+ },
96
+ h.pool
97
+ ), c = (t) => {
98
+ const s = o[t];
99
+ if (s?.status === "limited") return !0;
100
+ const p = e.results[t]?.inputs;
101
+ return !!(p && s?.call && JSON.stringify(p) !== JSON.stringify(s.call.inputs));
102
+ };
103
+ return new Set(
104
+ D.filter((t) => [...Le(a.spec.sources, [t.id])].some(c)).map((t) => t.id)
105
+ );
106
+ }, [i, h, a.overlay, a.spec.sources, D]), {
107
+ items: ne,
108
+ plans: B,
109
+ asks: F,
110
+ asked: P,
111
+ setAsked: V,
112
+ finding: G
113
+ } = xs({
114
+ sources: D,
115
+ views: h?.views,
116
+ records: i.landings,
117
+ upToDate: ae,
118
+ moved: W,
119
+ asOf: d
120
+ }), T = x.useMemo(
121
+ () => os(a.spec, a.sources, a.kn),
122
+ [a.spec, a.sources, a.kn]
123
+ ), H = (e, o) => {
124
+ const c = a.kn.objectTypes[e];
125
+ return n("workshopLab.scenario.apply.creates", {
126
+ type: c?.name ?? e,
127
+ values: Object.entries(o).filter(([, t]) => t != null && t !== "").map(
128
+ ([t, s]) => `${c?.properties.find((p) => p.name === t)?.label ?? t} ${T.field(e, t) && T.name(s) || String(s)}`
129
+ ).join(";")
130
+ });
131
+ }, K = (e) => !ue(e.record?.applied) && !e.blocked && !e.moved, [j, $] = x.useState(
132
+ () => /* @__PURE__ */ new Set([
133
+ ...A.filter((e) => !_(e.edit) && !e.blocked && e.conflicts.length === 0).map((e) => e.edit.id),
134
+ ...B.filter(K).map((e) => J(e.item.id))
135
+ ])
136
+ ), [R, z] = x.useState(!G);
137
+ !R && !G && (z(!0), !u && !N && $(
138
+ (e) => /* @__PURE__ */ new Set([
139
+ ...e,
140
+ ...B.filter((o) => o.item.landing.action?.target === "object" && K(o)).map((o) => J(o.item.id))
141
+ ])
142
+ ));
143
+ const [ce, he] = x.useState(!O.checking);
144
+ !ce && !O.checking && (he(!0), !u && !N && $(
145
+ (e) => /* @__PURE__ */ new Set([
146
+ ...e,
147
+ ...A.filter((o) => o.makes && !_(o.edit) && !o.blocked).map((o) => o.edit.id)
148
+ ])
149
+ ));
150
+ const re = (e, o) => $((c) => {
151
+ const t = new Set(c);
152
+ return o ? t.add(e) : t.delete(e), t;
153
+ }), ie = x.useMemo(
154
+ () => i.edits.filter((e) => j.has(e.id) || _(e)),
155
+ [i.edits, j]
156
+ ), [Y] = as(
157
+ { spec: a.spec, kn: a.kn, sources: a.sources, run: a.run, asOf: d },
158
+ [ie]
159
+ ), X = Me(a.spec) ? Object.entries(Y.rows).flatMap(([e, o]) => {
160
+ const c = o.filter((s) => s[Fe]), t = a.spec.sources.find((s) => s.id === e);
161
+ return c.length > 0 && t ? [
162
+ {
163
+ source: t.label,
164
+ count: c.length,
165
+ names: c.slice(0, we).map((s) => pe(s, t, a.kn)).join("、")
166
+ }
167
+ ] : [];
168
+ }) : [], w = Ds(Y.rows, d, ie), ee = Me(a.spec) ? Y.status : "ready", Q = w.hard.length > 0 && w.notChecked.length > 0 ? n("workshopLab.scheduleRules.review.bothBlock", {
169
+ hard: w.hard.length,
170
+ unchecked: w.notChecked.length
171
+ }) : w.hard.length > 0 ? n("workshopLab.scheduleRules.review.hardBlock", { count: w.hard.length }) : w.notChecked.length > 0 && w.unchecked !== "toolsChecking" ? n("workshopLab.scheduleRules.review.uncheckedBlock", {
172
+ count: w.notChecked.length
173
+ }) : ee === "loading" ? n("workshopLab.scheduleRules.review.following") : ee === "error" ? n("workshopLab.scheduleRules.review.followFailed") : w.unchecked === "toolsChecking" ? n("workshopLab.scheduleRules.tools.reviewChecking") : w.unchecked === "waitData" ? n("workshopLab.checkDetail.waitData") : w.unchecked ? n(`workshopLab.scheduleRules.review.${w.unchecked}`) : void 0, me = ne.map((e) => e.id), se = (e, o, c) => S(i.id, (t) => {
174
+ const s = t.edits.map(
175
+ (k) => e.has(k.id) ? { ...k, applied: e.get(k.id) } : k
176
+ ), p = { ...t.landings };
177
+ for (const [k, f] of o) p[k] = { ...p[k], ...f };
178
+ return {
179
+ ...t,
180
+ edits: s,
181
+ ...Object.keys(p).length > 0 ? { landings: p } : {},
182
+ ...t.adoption || !c ? {} : { adoption: c },
183
+ status: Pe(s, { ids: me, records: p }),
184
+ updatedAt: y()
185
+ };
186
+ }), ke = async () => {
187
+ E(!0);
188
+ const e = i.adoption ? void 0 : {
189
+ at: y(),
190
+ asOf: d,
191
+ params: Ie(a.spec.scenarioParams, i),
192
+ results: Object.fromEntries(
193
+ Object.values(h?.views ?? {}).flatMap(
194
+ (s) => s.result?.status === "done" && !s.borrowed ? [[s.source.id, s.result]] : []
195
+ )
196
+ )
197
+ }, o = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
198
+ for (const s of A) {
199
+ if (!j.has(s.edit.id)) continue;
200
+ const p = y();
201
+ if (!s.action || !s.prepared || !s.fact && !s.makes || !s.source) {
202
+ o.set(s.edit.id, { status: "manual", at: p });
203
+ continue;
204
+ }
205
+ const k = a.kn.objectTypes[s.source.objectType]?.primaryKeys ?? [];
206
+ try {
207
+ const f = await qe(
208
+ a.kn.id,
209
+ s.action,
210
+ s.makes || !s.fact ? {} : Ue(s.fact, k),
211
+ s.makes ? Cs(s.action, a.kn, s.prepared.params, s.edit.key, Date.now()) : s.prepared.params
212
+ );
213
+ o.set(s.edit.id, { status: "accepted", executionId: f, at: p }), t.set(f, { edit: s.edit.id });
214
+ } catch (f) {
215
+ o.set(s.edit.id, { status: "failed", error: Ee(f), at: p });
216
+ }
217
+ }
218
+ for (const s of B) {
219
+ if (!j.has(J(s.item.id))) continue;
220
+ const p = await Ms(a.kn.id, s, y());
221
+ c.set(s.item.id, p), p.applied?.executionId && t.set(p.applied.executionId, { landing: s.item.id });
222
+ }
223
+ se(o, c, e), window.dispatchEvent(
224
+ new CustomEvent(Ze, {
225
+ detail: {
226
+ scenario: i.id,
227
+ results: [
228
+ ...o.values(),
229
+ ...[...c.values()].flatMap((s) => s.applied ? [s.applied] : [])
230
+ ]
231
+ }
232
+ })
233
+ ), await _e(
234
+ a.kn.id,
235
+ [...t.keys()],
236
+ (s, p) => {
237
+ const k = t.get(s);
238
+ if (k.edit) {
239
+ const f = { ...o.get(k.edit), ...p, at: y() };
240
+ o.set(k.edit, f), se(/* @__PURE__ */ new Map([[k.edit, f]]), /* @__PURE__ */ new Map());
241
+ } else if (k.landing) {
242
+ const f = c.get(k.landing), Z = {
243
+ ...f,
244
+ applied: { ...f.applied, ...p, at: y() }
245
+ };
246
+ c.set(k.landing, Z), se(/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map([[k.landing, Z]]));
247
+ }
248
+ window.dispatchEvent(new CustomEvent(Je, { detail: { executionId: s, ...p } }));
249
+ },
250
+ () => b.current
251
+ ), b.current && (E(!1), I(!0));
252
+ }, q = (e, o, c) => T.field(e?.objectType, o) && T.name(c) || Ce(e, e ? ye(e, a.kn) : [], o, c), de = (e, o) => e && ye(e, a.kn).find((c) => c.name === o)?.label || o, l = j.size, C = A.filter((e) => j.has(e.edit.id) && e.action).length + B.filter((e) => j.has(J(e.item.id)) && e.item.action).length, U = [
253
+ ...new Set(
254
+ B.filter((e) => j.has(J(e.item.id))).flatMap((e) => e.waiting)
255
+ )
256
+ ];
257
+ return /* @__PURE__ */ r.jsx(
258
+ ze,
259
+ {
260
+ open: !0,
261
+ width: 760,
262
+ title: n("workshopLab.scenario.apply.title", { name: i.name }),
263
+ onCancel: u ? void 0 : m,
264
+ closable: !u,
265
+ maskClosable: !1,
266
+ footer: N ? /* @__PURE__ */ r.jsx(oe, { type: "primary", onClick: m, children: n("workshopLab.act.close") }) : /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
267
+ /* @__PURE__ */ r.jsx(oe, { disabled: u, onClick: m, children: n("workshopLab.act.cancel") }),
268
+ Q && !u && /* @__PURE__ */ r.jsx("span", { className: g.actError, children: Q }),
269
+ /* @__PURE__ */ r.jsx(
270
+ oe,
271
+ {
272
+ type: "primary",
273
+ disabled: l === 0 || U.length > 0 || Q !== void 0 && !u,
274
+ title: U.length > 0 ? n("workshopLab.scenario.apply.fillAsked", {
275
+ names: U.join("、")
276
+ }) : Q,
277
+ loading: u,
278
+ onClick: () => {
279
+ ke();
280
+ },
281
+ children: C > 0 ? n("workshopLab.scenario.apply.run", { count: l }) : n("workshopLab.scenario.apply.record", { count: l })
282
+ }
283
+ )
284
+ ] }),
285
+ children: /* @__PURE__ */ r.jsxs("div", { className: g.actConfirm, style: cs(a.spec.theme, a.spec.layout), children: [
286
+ /* @__PURE__ */ r.jsx("p", { className: g.actMuted, children: n("workshopLab.scenario.apply.hint") }),
287
+ i.adoption && /* @__PURE__ */ r.jsx("span", { className: g.actMuted, children: n("workshopLab.scenario.apply.basis", {
288
+ at: new Date(i.adoption.at).toLocaleString(),
289
+ asOf: i.adoption.asOf
290
+ }) }),
291
+ A.some((e) => e.conflicts.length > 0 && !_(e.edit)) && /* @__PURE__ */ r.jsx(ge, { type: "warning", showIcon: !0, message: n("workshopLab.scenario.apply.conflicts") }),
292
+ !ae && /* @__PURE__ */ r.jsx(ge, { type: "warning", showIcon: !0, message: n("workshopLab.scenario.computeFirst") }),
293
+ A.length > 0 && /* @__PURE__ */ r.jsx("ul", { className: g.applyList, children: A.map((e) => {
294
+ const o = e.edit.applied, c = _(e.edit);
295
+ return /* @__PURE__ */ r.jsxs("li", { children: [
296
+ /* @__PURE__ */ r.jsx(
297
+ ns,
298
+ {
299
+ checked: j.has(e.edit.id),
300
+ disabled: c || u || N || !!e.blocked,
301
+ onChange: (t) => re(e.edit.id, t.target.checked)
302
+ }
303
+ ),
304
+ /* @__PURE__ */ r.jsxs("span", { className: g.applyBody, children: [
305
+ /* @__PURE__ */ r.jsxs("span", { children: [
306
+ /* @__PURE__ */ r.jsx("b", { children: pe(e.fact, e.source, a.kn, e.edit.key) }),
307
+ " ",
308
+ e.operation?.label ?? e.edit.operation
309
+ ] }),
310
+ /* @__PURE__ */ r.jsx("span", { className: g.actMuted, children: Object.entries(e.changes).filter(
311
+ ([t, s]) => q(e.source, t, e.fact?.[t]) !== q(e.source, t, s)
312
+ ).map(
313
+ ([t, s]) => `${de(e.source, t)} ${q(e.source, t, e.fact?.[t])} → ${q(e.source, t, s)}`
314
+ ).join(";") }),
315
+ e.makes && e.prepared && /* @__PURE__ */ r.jsx("span", { className: g.actMuted, children: H(e.action.objectType, e.prepared.params) }),
316
+ e.conflicts.length > 0 && !c && /* @__PURE__ */ r.jsx("span", { className: g.actError, children: n("workshopLab.scenario.apply.changedSince", {
317
+ fields: e.conflicts.map(
318
+ (t) => `${de(e.source, t)} ${q(e.source, t, e.edit.original[t])} → ${q(e.source, t, e.fact?.[t])}`
319
+ ).join(";")
320
+ }) }),
321
+ e.blocked && /* @__PURE__ */ r.jsx("span", { className: g.actError, children: e.blocked }),
322
+ o?.error && /* @__PURE__ */ r.jsx(
323
+ Ns,
324
+ {
325
+ error: o.error,
326
+ item: pe(e.fact, e.source, a.kn, e.edit.key),
327
+ ...e.action ? { action: e.action.name } : {}
328
+ }
329
+ )
330
+ ] }),
331
+ /* @__PURE__ */ r.jsxs("span", { className: g.applyAction, children: [
332
+ e.action ? e.action.name : /* @__PURE__ */ r.jsx(Se, { children: n("workshopLab.scenario.apply.manualTag") }),
333
+ o && /* @__PURE__ */ r.jsx(Se, { color: vs[o.status], children: n(`workshopLab.scenario.apply.status.${o.status}`) })
334
+ ] })
335
+ ] }, e.edit.id);
336
+ }) }),
337
+ D.map((e) => {
338
+ const o = B.filter((c) => c.item.source.id === e.id);
339
+ return /* @__PURE__ */ r.jsxs("div", { className: g.actConfirm, children: [
340
+ /* @__PURE__ */ r.jsx("b", { children: n("workshopLab.scenario.apply.landingTitle", {
341
+ source: e.label,
342
+ count: o.length
343
+ }) }),
344
+ W.has(e.id) && o.some((c) => !ue(c.record?.applied)) && /* @__PURE__ */ r.jsx(
345
+ ge,
346
+ {
347
+ type: "warning",
348
+ showIcon: !0,
349
+ message: n("workshopLab.scenario.apply.movedSince")
350
+ }
351
+ ),
352
+ /* @__PURE__ */ r.jsx(
353
+ Ls,
354
+ {
355
+ source: e,
356
+ asks: F,
357
+ asked: P,
358
+ onAsked: V,
359
+ disabled: u || N
360
+ }
361
+ ),
362
+ o.length === 0 ? /* @__PURE__ */ r.jsx("span", { className: g.actMuted, children: n("workshopLab.scenario.apply.noLanding") }) : /* @__PURE__ */ r.jsx("ul", { className: g.applyList, children: o.map((c) => /* @__PURE__ */ r.jsx(
363
+ Ss,
364
+ {
365
+ plan: c,
366
+ ticked: j.has(J(c.item.id)),
367
+ disabled: ue(c.record?.applied) || u || N || !!c.blocked,
368
+ onTick: (t) => re(J(c.item.id), t)
369
+ },
370
+ c.item.id
371
+ )) })
372
+ ] }, e.id);
373
+ }),
374
+ X.length > 0 && /* @__PURE__ */ r.jsxs("div", { className: g.actMuted, children: [
375
+ /* @__PURE__ */ r.jsx("b", { children: n("workshopLab.scenario.apply.alongside") }),
376
+ X.map((e) => /* @__PURE__ */ r.jsxs("div", { children: [
377
+ n("workshopLab.scenario.apply.alongsideItem", e),
378
+ e.count > we ? n("workshopLab.act.more", { count: e.count - we }) : ""
379
+ ] }, e.source))
380
+ ] }),
381
+ w.hard.length > 0 && /* @__PURE__ */ r.jsxs("div", { className: g.actConfirm, "data-hard-list": !0, children: [
382
+ /* @__PURE__ */ r.jsx("b", { children: n("workshopLab.scheduleRules.review.title") }),
383
+ M(w.hard)
384
+ ] }),
385
+ w.notChecked.length > 0 && /* @__PURE__ */ r.jsxs("div", { className: g.actConfirm, "data-unchecked-list": !0, children: [
386
+ /* @__PURE__ */ r.jsx("b", { children: n("workshopLab.scheduleRules.review.uncheckedTitle", {
387
+ count: w.notChecked.length
388
+ }) }),
389
+ /* @__PURE__ */ r.jsxs("span", { className: g.actMuted, children: [
390
+ n("workshopLab.scheduleRules.review.uncheckedHint"),
391
+ " ",
392
+ /* @__PURE__ */ r.jsx(
393
+ oe,
394
+ {
395
+ size: "small",
396
+ type: "link",
397
+ disabled: w.unchecked === "toolsChecking",
398
+ onClick: w.recheck,
399
+ children: n("workshopLab.checkDetail.recheck")
400
+ }
401
+ )
402
+ ] }),
403
+ M(w.notChecked)
404
+ ] }),
405
+ w.outside > 0 && /* @__PURE__ */ r.jsx("span", { className: g.actMuted, children: n("workshopLab.scheduleRules.review.outside", { count: w.outside }) }),
406
+ C > 0 && /* @__PURE__ */ r.jsx("span", { className: g.actMuted, children: n("workshopLab.act.noApproval") })
407
+ ] })
408
+ }
409
+ );
410
+ }
411
+ function $s(i, m, n) {
412
+ const a = Ne(i).map(({ config: y }) => ({ spec: i, config: y }));
413
+ if (!m) return a;
414
+ const S = n ?? m.pages[0]?.id;
415
+ return [
416
+ ...a,
417
+ ...m.pages.filter((y) => y.id !== S).flatMap((y) => {
418
+ const h = He(m, y.id);
419
+ return Ne(h).map(({ config: d }) => ({
420
+ spec: h,
421
+ config: d,
422
+ page: { id: y.id, title: y.title }
423
+ }));
424
+ })
425
+ ];
426
+ }
427
+ function As(i) {
428
+ const { spec: m, kn: n, run: a, sources: S, values: y } = je(), h = x.useMemo(() => {
429
+ const v = /* @__PURE__ */ new Set();
430
+ for (const M of i)
431
+ for (const b of [
432
+ M.config.source,
433
+ ...(M.config.layers ?? []).map((L) => L.source)
434
+ ]) {
435
+ const L = b ? be(M.spec, b) : void 0;
436
+ L && !L.model && v.add(Be(L));
437
+ }
438
+ return [...v];
439
+ }, [i]), [d, u] = x.useState({}), E = h.filter((v) => !S[v]).join(`
440
+ `);
441
+ x.useEffect(() => {
442
+ if (E === "") return;
443
+ const v = new AbortController();
444
+ for (const M of E.split(`
445
+ `)) {
446
+ const b = m.sources.find((L) => L.id === M);
447
+ !b || b.from || b.events || b.model || Xe(
448
+ a,
449
+ b,
450
+ n,
451
+ v.signal,
452
+ Qe(b) ? We(b, y) : void 0
453
+ ).then(
454
+ (L) => {
455
+ v.signal.aborted || u((O) => ({ ...O, [M]: { status: "ready", ...L } }));
456
+ },
457
+ (L) => {
458
+ v.signal.aborted || u((O) => ({
459
+ ...O,
460
+ [M]: { status: "error", message: Ee(L), unbound: !1 }
461
+ }));
462
+ }
463
+ );
464
+ }
465
+ return () => v.abort();
466
+ }, [E, m.sources, a, n]);
467
+ const N = x.useMemo(() => ({ ...d, ...S }), [d, S]), I = h.some((v) => {
468
+ const M = N[v], b = m.sources.find((L) => L.id === v);
469
+ return M ? M.status === "loading" : !!(b && !b.from && !b.events);
470
+ });
471
+ return { states: N, waiting: I };
472
+ }
473
+ function Ds(i, m, n) {
474
+ const { t: a } = Te(), S = je(), { spec: y, kn: h, values: d, models: u, app: E, pageId: N } = S, I = x.useMemo(() => $s(y, E, N), [y, E, N]), { states: v, waiting: M } = As(I), b = x.useMemo(
475
+ () => I.flatMap(
476
+ ({ spec: F, config: P }) => (P.layers ?? []).map((V) => ({
477
+ layer: V,
478
+ source: be(F, V.source)
479
+ }))
480
+ ),
481
+ [I]
482
+ ), { links: L, loading: O, failed: A } = rs(b), D = x.useMemo(() => {
483
+ const F = [], P = [];
484
+ return { read: I.map(({ spec: G, config: T, page: H }) => {
485
+ const K = is(
486
+ (T.timeZoneVariable ? d[T.timeZoneVariable] : void 0) ?? T.timeZone
487
+ ), j = ds({
488
+ spec: G,
489
+ config: T,
490
+ asOf: m,
491
+ values: d,
492
+ states: v,
493
+ scenarioRows: i,
494
+ modelRows: (R) => u?.views[R]?.rows
495
+ }), $ = F.length;
496
+ return F.push(...j.layers), P.push(
497
+ ...ls({
498
+ layers: j.layers,
499
+ rows: j.rows,
500
+ zone: K,
501
+ affected: !0,
502
+ // A demand list is checked as its plans, on the page that schedules them.
503
+ asRecords: us(j.layers, T, G, E, H?.id ?? N, h)
504
+ }).map((R) => ({ ...R, layer: R.layer + $ }))
505
+ ), { view: G, on: H, config: T, zone: K, offset: $, ...j };
506
+ }), layers: F, requests: P };
507
+ }, [I, d, v, u, i, m, E, N, h]), ae = x.useMemo(() => ps(n), [n]), {
508
+ findings: W,
509
+ pending: ne,
510
+ recheck: B
511
+ } = hs(D.requests, D.layers, ae, 0);
512
+ return x.useMemo(() => {
513
+ const F = /* @__PURE__ */ new Set(), P = [], V = /* @__PURE__ */ new Map();
514
+ let G = 0;
515
+ for (const { view: H, on: K, config: j, zone: $, offset: R, layers: z, rows: ce, bases: he, resources: re } of D.read) {
516
+ const ie = new Intl.DateTimeFormat(void 0, {
517
+ timeZone: $,
518
+ month: "2-digit",
519
+ day: "2-digit",
520
+ hour: "2-digit",
521
+ minute: "2-digit",
522
+ hourCycle: "h23"
523
+ }), Y = new Intl.DateTimeFormat(void 0, {
524
+ timeZone: $,
525
+ month: "2-digit",
526
+ day: "2-digit"
527
+ }), X = z.map((l) => be(H, l.source)), w = z.map((l, C) => ms(l, X[C], h)), ee = j.source ? v[j.source] : void 0, Q = ee?.status === "ready" ? ee.rows : [], me = z.map((l, C) => L[R + C]), se = ks({ layers: z, rows: ce, links: me, zone: $, asOf: m }), ke = (l) => l.task.layer >= R && l.task.layer < R + z.length, q = (l) => ({
528
+ ...l,
529
+ task: { ...l.task, layer: l.task.layer - R },
530
+ related: l.related.map((C) => ({ ...C, layer: C.layer - R }))
531
+ }), de = [
532
+ ...fs({ layers: z, rows: ce, bases: he, zone: $, graph: se, resources: re }),
533
+ ...W.filter(ke).map(q)
534
+ ];
535
+ for (const l of de) {
536
+ if (l.soft) continue;
537
+ const C = X[l.task.layer];
538
+ if (!C) continue;
539
+ const U = C.from?.source ?? C.id, e = `${l.rule}\0${l.tool ?? ""}\0${U}\0${l.task.key}\0${l.related.map((t) => t.key).join(",")}`;
540
+ if (F.has(e) || (F.add(e), !l.changed && l.rule === "unchecked")) continue;
541
+ if (!l.changed) {
542
+ G += 1;
543
+ continue;
544
+ }
545
+ const o = (t) => {
546
+ const s = X[t.layer], p = bs(
547
+ z[t.layer],
548
+ t.row,
549
+ (k) => Ce(s, s ? ye(s, h) : [], k, t.row[k])
550
+ );
551
+ return p ? p.meta.length > 0 ? a("workshopLab.scheduleRules.taskName", {
552
+ title: p.title,
553
+ meta: p.meta.join(a("workshopLab.scheduleGantt.separator"))
554
+ }) : p.title : pe(t.row, s, h, t.key);
555
+ }, c = {
556
+ id: e,
557
+ rule: ys(a, l),
558
+ task: o(l.task),
559
+ text: gs(a, l, {
560
+ task: o,
561
+ resource: (t) => {
562
+ const s = Q.find((k) => k.$key === t);
563
+ return (s && j.titleField ? ws(s[j.titleField]) : "") || t;
564
+ },
565
+ time: (t, s) => Number.isFinite(t) ? s && w[l.task.layer]?.[s] ? Y.format(s === "end" || s === "target" ? t - 1 : t) : ie.format(t) : ""
566
+ }),
567
+ focus: { source: U, key: l.task.key },
568
+ ...K ? { page: K } : {}
569
+ };
570
+ if (l.rule === "unchecked") {
571
+ const t = `${U}\0${l.task.key}`, s = V.get(t);
572
+ V.set(
573
+ t,
574
+ s ? {
575
+ ...s,
576
+ text: `${s.text}${a("workshopLab.scheduleRules.listSeparator")}${c.text}`
577
+ } : c
578
+ );
579
+ continue;
580
+ }
581
+ P.push(c);
582
+ }
583
+ }
584
+ const T = M ? "waitData" : O ? "checking" : A ? "linksFailed" : ne ? "toolsChecking" : void 0;
585
+ return { hard: P, notChecked: [...V.values()], outside: G, unchecked: T, recheck: B };
586
+ }, [D, W, ne, L, O, A, M, m, h, v, a, B]);
587
+ }
588
+ export {
589
+ zs as ScenarioApply
590
+ };