@tea-agent/loop-agent 0.39.0-next.6 → 0.39.0-next.7
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.
- package/dist/build-stamp.json +2 -2
- package/dist/worker/console/chat/turn-process.js +7 -20
- package/dist/worker/console/operator-user-error.js +19 -0
- package/dist/worker/console/security.js +20 -1
- package/dist/worker/console/static/assets/{abnfDiagram-N423BO3Z-CNPzEh3R.js → abnfDiagram-N423BO3Z-BLXFe4qI.js} +1 -1
- package/dist/worker/console/static/assets/{arc-BDY2Y-xG.js → arc-7iOJeqho.js} +1 -1
- package/dist/worker/console/static/assets/{architectureDiagram-T3A2C74G-NfkWQpnU.js → architectureDiagram-T3A2C74G-CYoyj5K7.js} +1 -1
- package/dist/worker/console/static/assets/{blockDiagram-VBNYF7ZC-KE8pmdGY.js → blockDiagram-VBNYF7ZC-fK01JNlR.js} +1 -1
- package/dist/worker/console/static/assets/{c4Diagram-5PPSVZJV-D-CheaMa.js → c4Diagram-5PPSVZJV-bzbw5D_Z.js} +1 -1
- package/dist/worker/console/static/assets/channel-BBOTJHvD.js +1 -0
- package/dist/worker/console/static/assets/{chunk-2GRJ4B5K-Db2uLs2I.js → chunk-2GRJ4B5K-Cf6hJFFG.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-2Q5K7J3B-Bv9VDtNX.js → chunk-2Q5K7J3B-DSFXR-et.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-5RXB4S5H-CE4aFV_O.js → chunk-5RXB4S5H-BagJechl.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-5VM5RSS4-BoUlzoKw.js → chunk-5VM5RSS4-E7QNMFaW.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-6Q2QTUOP-Bqn4bPPg.js → chunk-6Q2QTUOP-BG_eOBrC.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-GF5L2VYU-ClNxnCSZ.js → chunk-GF5L2VYU-Bo42dqol.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-JWPE2WC7-Dibdg_rY.js → chunk-JWPE2WC7-dibM-87v.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-KBJHAD2P-BwFyCP8o.js → chunk-KBJHAD2P-Bytrp3Oe.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-RYQCIY6F-31vjPu53.js → chunk-RYQCIY6F-DBABILrr.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-XXDRQBXY-CAPr_ybW.js → chunk-XXDRQBXY-DCUk5Pf9.js} +1 -1
- package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-Cm8Yf8tD.js +1 -0
- package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-Cm8Yf8tD.js +1 -0
- package/dist/worker/console/static/assets/{cose-bilkent-JH36ORCC-H53opjD2.js → cose-bilkent-JH36ORCC-BlGE9v6E.js} +1 -1
- package/dist/worker/console/static/assets/{cynefin-VYW2F7L2-DA3X4LYG.js → cynefin-VYW2F7L2-DGl5ewph.js} +1 -1
- package/dist/worker/console/static/assets/{cynefinDiagram-MW4NZA55-CDeEtk0O.js → cynefinDiagram-MW4NZA55-DsJ_SVH_.js} +1 -1
- package/dist/worker/console/static/assets/{dagre-VZM6K2ZE-C_iy9nAa.js → dagre-VZM6K2ZE-BIhjFdzv.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-7IWD3JNH-BSjR3Gvm.js → diagram-7IWD3JNH-Dmy1ctTb.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-B4RE2ZJO-CB_gyKnB.js → diagram-B4RE2ZJO-DYCtWUF3.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-LBJQPF4R-Dk9uv1qU.js → diagram-LBJQPF4R-BMZFHVd2.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-Q27KOJAE-in2ro3ZT.js → diagram-Q27KOJAE-b_U8gfaO.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-UB23O5K3-BEI07gDu.js → diagram-UB23O5K3-Dzy_bn-I.js} +1 -1
- package/dist/worker/console/static/assets/{ebnfDiagram-BXEA7PRR-BbF5_PGc.js → ebnfDiagram-BXEA7PRR-DJCiMNEI.js} +1 -1
- package/dist/worker/console/static/assets/{erDiagram-JOGREHBK-B4uWTa-w.js → erDiagram-JOGREHBK-28lD016B.js} +1 -1
- package/dist/worker/console/static/assets/{flowDiagram-UKHOOZJN-DPIyLgKv.js → flowDiagram-UKHOOZJN-DGyHJmIw.js} +1 -1
- package/dist/worker/console/static/assets/{ganttDiagram-PKOTCBZU-CuDKirqJ.js → ganttDiagram-PKOTCBZU-CzdwUjrO.js} +1 -1
- package/dist/worker/console/static/assets/{gitGraphDiagram-DS77QQ5N-BLlH01Hh.js → gitGraphDiagram-DS77QQ5N-D9bGwuo8.js} +1 -1
- package/dist/worker/console/static/assets/{index-F4oI1Kcc.js → index-B-qWGThd.js} +60 -60
- package/dist/worker/console/static/assets/index-C-xRgY_0.css +1 -0
- package/dist/worker/console/static/assets/{infoDiagram-6WML65LV-1QctUUzp.js → infoDiagram-6WML65LV-LJgJUQFC.js} +1 -1
- package/dist/worker/console/static/assets/{ishikawaDiagram-WSZJBQD7-BBNAeRyb.js → ishikawaDiagram-WSZJBQD7-98LaB8zb.js} +1 -1
- package/dist/worker/console/static/assets/{journeyDiagram-NVQOT4AX-DFAUj-9c.js → journeyDiagram-NVQOT4AX-D-ISzwlQ.js} +1 -1
- package/dist/worker/console/static/assets/{kanban-definition-27J2QSJJ-O0PrAPYU.js → kanban-definition-27J2QSJJ-gfYOI-EL.js} +1 -1
- package/dist/worker/console/static/assets/{linear-COV8Syym.js → linear-CyntZgKV.js} +1 -1
- package/dist/worker/console/static/assets/{mermaid.core-Dudn9krq.js → mermaid.core-BBOR7dg0.js} +5 -5
- package/dist/worker/console/static/assets/{mindmap-definition-FAOFIHXS-DVQQWMKd.js → mindmap-definition-FAOFIHXS-CQAgwPMk.js} +1 -1
- package/dist/worker/console/static/assets/{pegDiagram-VL7TDLO6-B5PU21Bj.js → pegDiagram-VL7TDLO6-DkMiZFuV.js} +1 -1
- package/dist/worker/console/static/assets/{pieDiagram-7S7Q4E2Y-D0SrZrKx.js → pieDiagram-7S7Q4E2Y-DLNXa_0J.js} +1 -1
- package/dist/worker/console/static/assets/{quadrantDiagram-CIZ2JOQS-DxZmA3-n.js → quadrantDiagram-CIZ2JOQS-Dc7bdzjm.js} +1 -1
- package/dist/worker/console/static/assets/{railroadDiagram-AXF67PYL-z2bVQOmD.js → railroadDiagram-AXF67PYL-BxMB0QqW.js} +1 -1
- package/dist/worker/console/static/assets/{requirementDiagram-LRYGKXZP-Cw3JACRQ.js → requirementDiagram-LRYGKXZP-FjumoKn4.js} +1 -1
- package/dist/worker/console/static/assets/{sankeyDiagram-W5VNT64P-BrRX95W-.js → sankeyDiagram-W5VNT64P-CkhKc_E3.js} +1 -1
- package/dist/worker/console/static/assets/{sequenceDiagram-SI44F4Z6-Dr4lAMIp.js → sequenceDiagram-SI44F4Z6-DoBWqTTH.js} +1 -1
- package/dist/worker/console/static/assets/{sizeCapture-X5ZJPWSS-D3nWOJBl.js → sizeCapture-X5ZJPWSS-CQeh_YeE.js} +1 -1
- package/dist/worker/console/static/assets/{stateDiagram-OKZ733FA-BRzY1ow8.js → stateDiagram-OKZ733FA-LuHmFW-I.js} +1 -1
- package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-DZihfdKc.js +1 -0
- package/dist/worker/console/static/assets/{swimlanes-SLNWSIFB-C8pcow-m.js → swimlanes-SLNWSIFB-CHwbDctY.js} +2 -2
- package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-CKnXCjHX.js +8 -0
- package/dist/worker/console/static/assets/{timeline-definition-Z64GVDOM-CMdjG3fZ.js → timeline-definition-Z64GVDOM-CoMngk0X.js} +1 -1
- package/dist/worker/console/static/assets/{vennDiagram-T6HMQDX7-o4YAsgix.js → vennDiagram-T6HMQDX7-CURYbtbO.js} +1 -1
- package/dist/worker/console/static/assets/{wardleyDiagram-T6FBY63Y-D1DRa0xZ.js → wardleyDiagram-T6FBY63Y-BdqSECjU.js} +1 -1
- package/dist/worker/console/static/assets/{xychartDiagram-ELKLHX3M-DWkYcwN2.js → xychartDiagram-ELKLHX3M-DbMUYuAg.js} +1 -1
- package/dist/worker/console/static/index.html +2 -2
- package/dist/worker/console/static-src/operator-chat/chat-sse-events.js +14 -2
- package/dist/worker/console/static-src/operator-chat/mutation-gate.js +45 -0
- package/dist/worker/console/static-src/operator-chat/useChatSessions.js +15 -0
- package/package.json +1 -1
- package/dist/worker/console/static/assets/channel-CgVmTdib.js +0 -1
- package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-CfJu47mG.js +0 -1
- package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-CfJu47mG.js +0 -1
- package/dist/worker/console/static/assets/index-B25KrZZ6.css +0 -1
- package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-IUSBfChT.js +0 -1
- package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-uiU-pbpp.js +0 -8
package/dist/build-stamp.json
CHANGED
|
@@ -92,36 +92,25 @@ function sortToolsStable(tools) {
|
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
|
-
* Flush buffered consecutive tools into process items
|
|
96
|
-
*
|
|
97
|
-
*
|
|
95
|
+
* Flush buffered consecutive tools into process items (pi-web aligned:
|
|
96
|
+
* strict sequential flow, no synthetic grouping). Semantic operator tools
|
|
97
|
+
* stay as individual activity events; plain tools each render as their own
|
|
98
|
+
* card in stable server order (eventSeq first, createdAt fallback).
|
|
98
99
|
* Thinking/text/activity boundaries break the buffer upstream.
|
|
99
100
|
*/
|
|
100
101
|
function flushToolBuffer(processItems, buffer) {
|
|
101
102
|
if (buffer.length === 0)
|
|
102
103
|
return;
|
|
103
104
|
const sorted = sortToolsStable(buffer);
|
|
104
|
-
let plainGroup = [];
|
|
105
|
-
const flushPlain = () => {
|
|
106
|
-
if (plainGroup.length === 1) {
|
|
107
|
-
processItems.push({ kind: "tool", tool: plainGroup[0] });
|
|
108
|
-
}
|
|
109
|
-
else if (plainGroup.length > 1) {
|
|
110
|
-
processItems.push({ kind: "tool-group", tools: plainGroup });
|
|
111
|
-
}
|
|
112
|
-
plainGroup = [];
|
|
113
|
-
};
|
|
114
105
|
for (const tool of sorted) {
|
|
115
106
|
const activity = semanticActivityForTool(tool);
|
|
116
107
|
if (activity) {
|
|
117
|
-
flushPlain();
|
|
118
108
|
processItems.push({ kind: "activity", activity });
|
|
119
109
|
}
|
|
120
110
|
else {
|
|
121
|
-
|
|
111
|
+
processItems.push({ kind: "tool", tool });
|
|
122
112
|
}
|
|
123
113
|
}
|
|
124
|
-
flushPlain();
|
|
125
114
|
}
|
|
126
115
|
function emitProcessBlocks(blocks, group, processItems, usedToolIds) {
|
|
127
116
|
let buffer = [];
|
|
@@ -324,7 +313,7 @@ export function processGroupSummary(tools, options) {
|
|
|
324
313
|
parts.push("运行中");
|
|
325
314
|
return { count, errorCount, runningCount, stepCount, label: parts.join(" · ") };
|
|
326
315
|
}
|
|
327
|
-
/** Summary over rendered process items
|
|
316
|
+
/** Summary over rendered process items. */
|
|
328
317
|
export function summarizeProcessItems(items) {
|
|
329
318
|
const tools = [];
|
|
330
319
|
let thinkingCount = 0;
|
|
@@ -344,10 +333,8 @@ export function summarizeProcessItems(items) {
|
|
|
344
333
|
else if (item.activity.kind === "progress")
|
|
345
334
|
activityRunningCount += 1;
|
|
346
335
|
}
|
|
347
|
-
else if (item.kind === "tool")
|
|
348
|
-
tools.push(item.tool);
|
|
349
336
|
else
|
|
350
|
-
tools.push(
|
|
337
|
+
tools.push(item.tool);
|
|
351
338
|
}
|
|
352
339
|
return processGroupSummary(tools, {
|
|
353
340
|
thinkingCount,
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
import { rewriteRecoveryOperatorError } from "./recovery-error-copy.js";
|
|
2
|
+
/** Mutation-gate raw English messages (worker/console/security.ts) → copy. */
|
|
3
|
+
const MUTATION_GATE_COPY = [
|
|
4
|
+
{
|
|
5
|
+
pattern: /invalid (boot capability|confirmation header) token/i,
|
|
6
|
+
copy: "页面已过期(控制台已重启),请刷新页面(F5)后重试。",
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
pattern: /mutation requires boot capability cookie|mutation requires confirmation header token/i,
|
|
10
|
+
copy: "页面状态异常,请刷新页面(F5)后重试。",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
pattern: /Host header is required for non-loopback/i,
|
|
14
|
+
copy: "请求主机校验失败:非回环绑定时要求 Host 头,请刷新页面或检查访问地址。",
|
|
15
|
+
},
|
|
16
|
+
];
|
|
2
17
|
/** Map internal spawn/controller errors to actionable Chinese copy. */
|
|
3
18
|
export function formatOperatorUserError(message) {
|
|
4
19
|
const raw = (message ?? "").trim();
|
|
@@ -22,5 +37,9 @@ export function formatOperatorUserError(message) {
|
|
|
22
37
|
if (/force-required|requires --force/i.test(raw)) {
|
|
23
38
|
return "该终态需要强制 Discard。请确认后勾选强制再试。";
|
|
24
39
|
}
|
|
40
|
+
for (const entry of MUTATION_GATE_COPY) {
|
|
41
|
+
if (entry.pattern.test(raw))
|
|
42
|
+
return entry.copy;
|
|
43
|
+
}
|
|
25
44
|
return raw;
|
|
26
45
|
}
|
|
@@ -54,6 +54,25 @@ function safeEqualToken(a, b) {
|
|
|
54
54
|
* cookie boot token AND custom confirmation header/token + Host/Origin checks +
|
|
55
55
|
* Sec-Fetch-Site not cross-site.
|
|
56
56
|
*/
|
|
57
|
+
/**
|
|
58
|
+
* Loopback origin equivalence: a Console bound to a loopback host accepts
|
|
59
|
+
* page Origins that resolve to the same loopback server — localhost,
|
|
60
|
+
* 127.0.0.1 and [::1] on the SAME port are interchangeable aliases (browsers
|
|
61
|
+
* treat them as distinct sites, so a third-party page can never spoof one).
|
|
62
|
+
* This keeps bookmarks / autocomplete on `localhost:port` working against a
|
|
63
|
+
* Console bound to `127.0.0.1:port` (and vice versa).
|
|
64
|
+
*/
|
|
65
|
+
function loopbackOriginMatches(origin, consoleOrigin) {
|
|
66
|
+
if (origin === consoleOrigin)
|
|
67
|
+
return true;
|
|
68
|
+
const parseLoopback = (value) => {
|
|
69
|
+
const match = /^http:\/\/(localhost|127\.0\.0\.1|\[::1\])(:\d+)?$/i.exec(value);
|
|
70
|
+
return match ? `${match[1].toLowerCase()}${match[2] ?? ""}` : null;
|
|
71
|
+
};
|
|
72
|
+
const originKey = parseLoopback(origin);
|
|
73
|
+
const consoleKey = parseLoopback(consoleOrigin);
|
|
74
|
+
return originKey !== null && consoleKey !== null && originKey === consoleKey;
|
|
75
|
+
}
|
|
57
76
|
export function evaluateMutationGate(req, ctx) {
|
|
58
77
|
const cookieToken = parseCookieHeader(req.headers.cookie, BOOT_CAPABILITY_COOKIE);
|
|
59
78
|
if (!cookieToken) {
|
|
@@ -127,7 +146,7 @@ export function evaluateMutationGate(req, ctx) {
|
|
|
127
146
|
}
|
|
128
147
|
else if (typeof origin !== "string" ||
|
|
129
148
|
origin.length === 0 ||
|
|
130
|
-
origin
|
|
149
|
+
!loopbackOriginMatches(origin, ctx.consoleOrigin)) {
|
|
131
150
|
return {
|
|
132
151
|
status: 403,
|
|
133
152
|
code: "origin-mismatch",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as p,r as u,d as a}from"./chunk-6Q2QTUOP-
|
|
1
|
+
import{g as p,r as u,d as a}from"./chunk-6Q2QTUOP-BG_eOBrC.js";import{p as f}from"./chunk-JWPE2WC7-dibM-87v.js";import{_ as n,l as o}from"./mermaid.core-BBOR7dg0.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-DGl5ewph.js";import"./index-B-qWGThd.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},B={parser:R,db:a,renderer:u,styles:p};export{B as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Y as ln,$ as an,a0 as F,a1 as q,a2 as j,a3 as un,a4 as y,a5 as tn,a6 as J,a7 as _,a8 as rn,a9 as o,aa as on,ab as sn,ac as fn}from"./mermaid.core-
|
|
1
|
+
import{Y as ln,$ as an,a0 as F,a1 as q,a2 as j,a3 as un,a4 as y,a5 as tn,a6 as J,a7 as _,a8 as rn,a9 as o,aa as on,ab as sn,ac as fn}from"./mermaid.core-BBOR7dg0.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,z,a){var O=I-l,i=D-h,n=z-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function U(l,h,I,D,v,A,z){var a=l-I,O=h-D,i=(z?A:-A)/J(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,B=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*J(on(0,T*T*R-P*P)),Y=(P*g-m*S)/R,$=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=Y-B,e=$-t,r=w-B,C=p-t;return x*x+e*e>r*r+C*C&&(Y=w,$=p),{cx:Y,cy:$,x01:-n,y01:-d,x11:Y*(v/T-1),y11:$*(v/T-1)}}function hn(){var l=cn,h=yn,I=j(0),D=null,v=gn,A=dn,z=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,B=rn(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(B>tn-y)a.moveTo(s*F(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*F(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=B,S=B,Y=z.apply(this,arguments)/2,$=Y>y&&(D?+D.apply(this,arguments):J(u*u+s*s)),w=_(rn(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if($>y){var C=sn($/u*q(Y)),K=sn($/s*q(Y));(P-=C*2)>y?(C*=t?1:-1,R+=C,T-=C):(P=0,R=T=(f+c)/2),(S-=K*2)>y?(K*=t?1:-1,m+=K,g-=K):(S=0,m=g=(f+c)/2)}var G=s*F(m),H=s*q(m),L=u*F(T),M=u*q(T);if(w>y){var N=s*F(g),Q=s*q(g),V=u*F(R),W=u*q(R),E;if(B<an)if(E=pn(G,H,V,W,N,Q,L,M)){var X=G-E[0],Z=H-E[1],b=N-E[0],k=Q-E[1],nn=1/q(fn((X*b+Z*k)/(J(X*X+Z*Z)*J(b*b+k*k)))/2),en=J(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=U(V,W,G,H,s,x,t),r=U(N,Q,L,M,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(G,H),a.arc(0,0,s,m,g,!t)):a.moveTo(G,H),!(u>y)||!(P>y)?a.lineTo(L,M):p>y?(e=U(L,M,N,Q,u,-p,t),r=U(G,H,V,W,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[F(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:j(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:j(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:j(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:j(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:j(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:j(+n),i):A},i.padAngle=function(n){return arguments.length?(z=typeof n=="function"?n:j(+n),i):z},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
|