@task-handoff/control-plane 0.0.45 → 0.0.46
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/cli.js +1 -468
- package/dist/install-node-agent.sh +472 -0
- package/package.json +2 -1
- package/ui/assets/{CodeBlockNode-BbKdYYeI.js → CodeBlockNode-CrGnth4a.js} +1 -1
- package/ui/assets/{Tooltip-C9AVM1l7.js → Tooltip-DVSrN-vh.js} +1 -1
- package/ui/assets/{abnfDiagram-VRR7QNED-C8AmTkt-.js → abnfDiagram-VRR7QNED-CbFj8bMt.js} +1 -1
- package/ui/assets/{arc-C7fG4Dm_.js → arc-Dg-HgkL2.js} +1 -1
- package/ui/assets/{architectureDiagram-ZJ3FMSHR-BxLc9Zoz.js → architectureDiagram-ZJ3FMSHR-ic-qubsS.js} +1 -1
- package/ui/assets/{blockDiagram-677ZJIJ3-D2cQJAZu.js → blockDiagram-677ZJIJ3-8AadHFLN.js} +1 -1
- package/ui/assets/{c4Diagram-LMCZKHZV-DbFrk42i.js → c4Diagram-LMCZKHZV-BsmkM9hO.js} +1 -1
- package/ui/assets/channel-BW9Gea3m.js +1 -0
- package/ui/assets/{chunk-2Q5K7J3B-DBr9buBu.js → chunk-2Q5K7J3B-DsmP0xHl.js} +1 -1
- package/ui/assets/{chunk-32BRIVSS-b9F8olCY.js → chunk-32BRIVSS-U63DMalQ.js} +1 -1
- package/ui/assets/{chunk-5VM5RSS4-CoD06cJ5.js → chunk-5VM5RSS4-DDhav1EL.js} +1 -1
- package/ui/assets/{chunk-EX3LRPZG-D0h2dU9b.js → chunk-EX3LRPZG-BjlFUCSO.js} +1 -1
- package/ui/assets/{chunk-JWPE2WC7-BECrIs4R.js → chunk-JWPE2WC7-CoOCmswE.js} +1 -1
- package/ui/assets/{chunk-MOJQB5TN-CQfIefmY.js → chunk-MOJQB5TN-BOJ4jnHz.js} +1 -1
- package/ui/assets/{chunk-RYQCIY6F-BPppjPaU.js → chunk-RYQCIY6F-D5Xi7Trm.js} +1 -1
- package/ui/assets/{chunk-V7JOEXUC-DSuiLeNv.js → chunk-V7JOEXUC-BiaiYUhA.js} +1 -1
- package/ui/assets/{chunk-VR4S4FIN-8bh6ok5O.js → chunk-VR4S4FIN-BsCvW53N.js} +1 -1
- package/ui/assets/{chunk-XXDRQBXY-DjK9ivrI.js → chunk-XXDRQBXY-DV7gNHZh.js} +1 -1
- package/ui/assets/classDiagram-OUVF2IWQ-CL7Wsoej.js +1 -0
- package/ui/assets/classDiagram-v2-EOCWNBFH-CL7Wsoej.js +1 -0
- package/ui/assets/{cose-bilkent-JH36ORCC-DHtCQA8a.js → cose-bilkent-JH36ORCC-DOJETB8P.js} +1 -1
- package/ui/assets/{cynefin-VYW2F7L2-B7i0ZXd6.js → cynefin-VYW2F7L2-whXriRIf.js} +1 -1
- package/ui/assets/{cynefinDiagram-TSTJHNR4-Bk_Uwnrv.js → cynefinDiagram-TSTJHNR4-Dhewk_nP.js} +1 -1
- package/ui/assets/{dagre-VKFMJZFB-BkRe2-zt.js → dagre-VKFMJZFB-DO9VBUSu.js} +1 -1
- package/ui/assets/{diagram-FQU43EPY-CE7URlPn.js → diagram-FQU43EPY-D6vzfMNS.js} +1 -1
- package/ui/assets/{diagram-G47NLZAW-DNEtBK7W.js → diagram-G47NLZAW-DPK_jTwT.js} +1 -1
- package/ui/assets/{diagram-NH7WQ7WH-CEKtjbhX.js → diagram-NH7WQ7WH-CZ7KKYLS.js} +1 -1
- package/ui/assets/{diagram-OA4YK3LP-CTMdgfj1.js → diagram-OA4YK3LP-CX3TlT5F.js} +1 -1
- package/ui/assets/{diagram-WEI45ONY-DdlcZGzj.js → diagram-WEI45ONY-vTz9yEcF.js} +1 -1
- package/ui/assets/{ebnfDiagram-CCIWWBDH-Dzwj5tDN.js → ebnfDiagram-CCIWWBDH-DZB2VCLS.js} +1 -1
- package/ui/assets/{erDiagram-Q63AITRT-348Ad0vy.js → erDiagram-Q63AITRT-B34LFUAl.js} +1 -1
- package/ui/assets/{flowDiagram-23GEKE2U-l7aiHw_J.js → flowDiagram-23GEKE2U-BBz7G_Z5.js} +1 -1
- package/ui/assets/{ganttDiagram-NO4QXBWP-BJ-88jVp.js → ganttDiagram-NO4QXBWP-uY7UO4Fi.js} +1 -1
- package/ui/assets/{gitGraphDiagram-IHSO6WYX-mlADGEWq.js → gitGraphDiagram-IHSO6WYX-Cq7U8tL2.js} +1 -1
- package/ui/assets/{index-XAfHYY4x.css → index-CLJXrr02.css} +1 -1
- package/ui/assets/index-CQ3ChO2D.js +681 -0
- package/ui/assets/{index10-BdmhYcg3.js → index10-DsBR5fJU.js} +1 -1
- package/ui/assets/{index11-CW32n6sf.js → index11-LiSb6J-f.js} +1 -1
- package/ui/assets/{index5-CZCxQWMM.js → index5-BBwjjJ3_.js} +1 -1
- package/ui/assets/{index6-BZRZedRE.js → index6-BZoI4lx5.js} +1 -1
- package/ui/assets/{index7-CPK93TIB.js → index7--e9Zjftx.js} +1 -1
- package/ui/assets/{index8-DTup0NXR.js → index8-B1G9c_9g.js} +1 -1
- package/ui/assets/{infoDiagram-FWYZ7A6U-6El-ObHh.js → infoDiagram-FWYZ7A6U-DFPPYnrz.js} +1 -1
- package/ui/assets/{ishikawaDiagram-FXEZZL3T-DzK6mwbU.js → ishikawaDiagram-FXEZZL3T-z9ywjBG7.js} +1 -1
- package/ui/assets/{journeyDiagram-5HDEW3XC-DbOH7vPY.js → journeyDiagram-5HDEW3XC-DMuX2V47.js} +1 -1
- package/ui/assets/{kanban-definition-HUTT4EX6-DfOajNol.js → kanban-definition-HUTT4EX6-DESdUSlb.js} +1 -1
- package/ui/assets/{linear-Dlr-KIIv.js → linear-CEqcvrWs.js} +1 -1
- package/ui/assets/{mermaid.core-F9Gdink5.js → mermaid.core-BEKa2CjT.js} +4 -4
- package/ui/assets/{mhchem-Dq1gQ2CO.js → mhchem-Dl-_UjAx.js} +1 -1
- package/ui/assets/{mindmap-definition-LN4V7U3C-ClRUKJDc.js → mindmap-definition-LN4V7U3C-D7K8AiPr.js} +1 -1
- package/ui/assets/{pegDiagram-2B236MQR-BL8siEtJ.js → pegDiagram-2B236MQR-KEgjht2a.js} +1 -1
- package/ui/assets/{pieDiagram-ENE6RG2P-SW1UZ_Rk.js → pieDiagram-ENE6RG2P-CMUsoq2K.js} +1 -1
- package/ui/assets/{quadrantDiagram-ABIIQ3AL-DBAef6u9.js → quadrantDiagram-ABIIQ3AL-DIgA57vg.js} +1 -1
- package/ui/assets/{railroadDiagram-RFXS5EU6-CcieCdOE.js → railroadDiagram-RFXS5EU6-DjCrfAqp.js} +1 -1
- package/ui/assets/{requirementDiagram-TGXJPOKE-BhzoJlL2.js → requirementDiagram-TGXJPOKE-B1P4nmI0.js} +1 -1
- package/ui/assets/{sankeyDiagram-HTMAVEWB-BS4pBIGk.js → sankeyDiagram-HTMAVEWB-MEI-WrIN.js} +1 -1
- package/ui/assets/{sequenceDiagram-DBY2YBRQ-BK2HcTF1.js → sequenceDiagram-DBY2YBRQ-ClLrq7Jc.js} +1 -1
- package/ui/assets/{sizeCapture-X5ZJPWSS-BgQMwt0I.js → sizeCapture-X5ZJPWSS-DBp9rBF5.js} +1 -1
- package/ui/assets/{stateDiagram-2N3HPSRC-CpQKxsWu.js → stateDiagram-2N3HPSRC-CRpxRUTQ.js} +1 -1
- package/ui/assets/stateDiagram-v2-6OUMAXLB-DUvs2hH1.js +1 -0
- package/ui/assets/{swimlanes-5IMT3BWC-DzegU8KV.js → swimlanes-5IMT3BWC-C98xmL7Z.js} +2 -2
- package/ui/assets/swimlanesDiagram-G3AALYLV-jp24ujqR.js +8 -0
- package/ui/assets/{timeline-definition-FHXFAJF6-UAy3PL-d.js → timeline-definition-FHXFAJF6-Z0AyfXZH.js} +1 -1
- package/ui/assets/{vennDiagram-L72KCM5P-BX7bRxpH.js → vennDiagram-L72KCM5P-D4Cn8vwG.js} +1 -1
- package/ui/assets/{wardleyDiagram-EHGQE667-DQzaqOHa.js → wardleyDiagram-EHGQE667-DRihSLHc.js} +1 -1
- package/ui/assets/{xychartDiagram-FW5EYKEG-fkeONlvZ.js → xychartDiagram-FW5EYKEG-0l7PE0WN.js} +1 -1
- package/ui/index.html +2 -2
- package/ui/assets/channel-DPu2U1vO.js +0 -1
- package/ui/assets/classDiagram-OUVF2IWQ-IfK0NYGE.js +0 -1
- package/ui/assets/classDiagram-v2-EOCWNBFH-IfK0NYGE.js +0 -1
- package/ui/assets/index-BeLkdnQ9.js +0 -680
- package/ui/assets/stateDiagram-v2-6OUMAXLB-Dax31bDq.js +0 -1
- package/ui/assets/swimlanesDiagram-G3AALYLV-Czi_leD-.js +0 -8
|
@@ -0,0 +1,472 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
set -eu
|
|
3
|
+
|
|
4
|
+
MIN_NODE_VERSION="24.15.0"
|
|
5
|
+
CONTROL_PLANE_URL=""
|
|
6
|
+
JOIN_TOKEN=""
|
|
7
|
+
CLOUD_RELAY_ORIGIN=""
|
|
8
|
+
CLOUD_RELAY_BIND_TOKEN=""
|
|
9
|
+
SERVICE_USER="root"
|
|
10
|
+
DATA_DIR="/var/lib/task-handoff/node-agent"
|
|
11
|
+
ENV_DIR="/etc/task-handoff"
|
|
12
|
+
HOST="127.0.0.1"
|
|
13
|
+
PORT="8091"
|
|
14
|
+
IPC_PATH="/run/task-handoff/node-agent.sock"
|
|
15
|
+
TASK_HANDOFF_BIN="${TASK_HANDOFF_BIN:-}"
|
|
16
|
+
PACKAGE_URL="${TASK_HANDOFF_PACKAGE_URL:-}"
|
|
17
|
+
NPM_PACKAGE="${TASK_HANDOFF_NPM_PACKAGE:-}"
|
|
18
|
+
CONTROLLED_INSTANCE_PACKAGE="${TASK_HANDOFF_CONTROLLED_INSTANCE_PACKAGE:-}"
|
|
19
|
+
CONTROLLED_INSTANCE_PACKAGE_URL="${TASK_HANDOFF_CONTROLLED_INSTANCE_PACKAGE_URL:-}"
|
|
20
|
+
VERSION="${TASK_HANDOFF_VERSION:-}"
|
|
21
|
+
INSTALL_SOURCE="${TASK_HANDOFF_INSTALL_SOURCE:-auto}"
|
|
22
|
+
NODE_DIST_URL="${TASK_HANDOFF_NODE_DIST_URL:-}"
|
|
23
|
+
NPM_REGISTRY="${TASK_HANDOFF_NPM_REGISTRY:-}"
|
|
24
|
+
EFFECTIVE_INSTALL_SOURCE=""
|
|
25
|
+
APT_SOURCE_FILE=""
|
|
26
|
+
|
|
27
|
+
usage() {
|
|
28
|
+
cat <<'USAGE'
|
|
29
|
+
Usage: install-node-agent.sh --control-plane <url> --join-token <token> [options]
|
|
30
|
+
|
|
31
|
+
Options:
|
|
32
|
+
--control-plane <url> Control-plane base URL, for example https://cp.example.com
|
|
33
|
+
--join-token <token> One-time node join token from the control plane
|
|
34
|
+
--cloud-relay-origin <url> Override the discovered cloud origin for ad-hoc deployments
|
|
35
|
+
--cloud-relay-bind-token <token> One-time cloud binding token from the control plane
|
|
36
|
+
--task-handoff-bin <path> Existing node-agent or legacy task-handoff binary
|
|
37
|
+
--package-url <url> npm tarball containing task-handoff-node-agent
|
|
38
|
+
--npm-package <name> node-agent npm package to install globally
|
|
39
|
+
--controlled-instance-package <name> controlled-instance npm package for local runtimes
|
|
40
|
+
--controlled-instance-package-url <url> controlled-instance npm tarball for local runtimes
|
|
41
|
+
--version <version> Version suffix for --npm-package or release directory name
|
|
42
|
+
--install-source <source> Source profile: auto, official, or china; default auto
|
|
43
|
+
--node-dist-url <url> Override the Node.js distribution base URL
|
|
44
|
+
--npm-registry <url> npm registry used for installation and managed updates
|
|
45
|
+
--data-dir <path> Node-agent data directory
|
|
46
|
+
--service-user <user> systemd service user
|
|
47
|
+
--host <host> Node-agent HTTP bind host, default 127.0.0.1
|
|
48
|
+
--port <port> Node-agent HTTP port, default 8091
|
|
49
|
+
|
|
50
|
+
On Debian, Ubuntu, RHEL 8/9, and compatible dnf-based hosts, the installer
|
|
51
|
+
can also install a compatible Node.js 24 and npm. Existing compatible Node.js
|
|
52
|
+
and npm installations are used without invoking a system package manager.
|
|
53
|
+
USAGE
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
die() {
|
|
57
|
+
echo "Error: $*" >&2
|
|
58
|
+
exit 1
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
need_root() {
|
|
62
|
+
if [ "$(id -u)" != "0" ]; then
|
|
63
|
+
echo "This installer must run as root. Re-run with sudo." >&2
|
|
64
|
+
exit 1
|
|
65
|
+
fi
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
require_command() {
|
|
69
|
+
if ! command -v "$1" >/dev/null 2>&1; then
|
|
70
|
+
echo "Missing required command: $1" >&2
|
|
71
|
+
exit 1
|
|
72
|
+
fi
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
china_environment_hint() {
|
|
76
|
+
if [ -n "${TZ:-}" ]; then
|
|
77
|
+
case "$TZ" in Asia/Shanghai|Asia/Chongqing) return 0 ;; esac
|
|
78
|
+
elif [ -r /etc/timezone ] && grep -Eq '^Asia/(Shanghai|Chongqing)$' /etc/timezone; then
|
|
79
|
+
return 0
|
|
80
|
+
fi
|
|
81
|
+
case "${LANG:-}${LC_ALL:-}" in *zh_CN*) return 0 ;; esac
|
|
82
|
+
return 1
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
select_install_source() {
|
|
86
|
+
EFFECTIVE_INSTALL_SOURCE="$INSTALL_SOURCE"
|
|
87
|
+
if [ "$EFFECTIVE_INSTALL_SOURCE" = "auto" ]; then
|
|
88
|
+
if china_environment_hint; then
|
|
89
|
+
EFFECTIVE_INSTALL_SOURCE="china"
|
|
90
|
+
elif command -v curl >/dev/null 2>&1 && ! curl -4 -fsSL \
|
|
91
|
+
--connect-timeout 3 --max-time 8 \
|
|
92
|
+
https://nodejs.org/dist/latest-v24.x/SHASUMS256.txt -o /dev/null; then
|
|
93
|
+
EFFECTIVE_INSTALL_SOURCE="china"
|
|
94
|
+
else
|
|
95
|
+
EFFECTIVE_INSTALL_SOURCE="official"
|
|
96
|
+
fi
|
|
97
|
+
fi
|
|
98
|
+
NODE_DIST_URL="$NODE_DIST_URL_OVERRIDE"
|
|
99
|
+
NPM_REGISTRY="$NPM_REGISTRY_OVERRIDE"
|
|
100
|
+
if [ -z "$NODE_DIST_URL" ]; then
|
|
101
|
+
if [ "$EFFECTIVE_INSTALL_SOURCE" = "china" ]; then
|
|
102
|
+
NODE_DIST_URL="https://npmmirror.com/mirrors/node"
|
|
103
|
+
else
|
|
104
|
+
NODE_DIST_URL="https://nodejs.org/dist"
|
|
105
|
+
fi
|
|
106
|
+
fi
|
|
107
|
+
if [ -z "$NPM_REGISTRY" ] && [ "$EFFECTIVE_INSTALL_SOURCE" = "china" ]; then
|
|
108
|
+
NPM_REGISTRY="https://registry.npmmirror.com"
|
|
109
|
+
fi
|
|
110
|
+
echo "Using $EFFECTIVE_INSTALL_SOURCE install sources (Node.js: $NODE_DIST_URL${NPM_REGISTRY:+, npm: $NPM_REGISTRY})."
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
prepare_apt_source() {
|
|
114
|
+
[ -r /etc/os-release ] || return 1
|
|
115
|
+
os_id="$(. /etc/os-release && printf '%s' "$ID")"
|
|
116
|
+
os_codename="$(. /etc/os-release && printf '%s' "${VERSION_CODENAME:-}")"
|
|
117
|
+
[ -n "$os_codename" ] || return 1
|
|
118
|
+
APT_SOURCE_FILE="$(mktemp)"
|
|
119
|
+
# APT authenticates signed repository metadata, so HTTP can bootstrap ca-certificates safely.
|
|
120
|
+
case "$os_id:$EFFECTIVE_INSTALL_SOURCE" in
|
|
121
|
+
debian:china)
|
|
122
|
+
printf '%s\n' \
|
|
123
|
+
"deb http://mirrors.tuna.tsinghua.edu.cn/debian/ $os_codename main" \
|
|
124
|
+
"deb http://mirrors.tuna.tsinghua.edu.cn/debian/ $os_codename-updates main" \
|
|
125
|
+
"deb http://mirrors.tuna.tsinghua.edu.cn/debian-security $os_codename-security main" > "$APT_SOURCE_FILE"
|
|
126
|
+
;;
|
|
127
|
+
debian:*)
|
|
128
|
+
printf '%s\n' \
|
|
129
|
+
"deb http://deb.debian.org/debian $os_codename main" \
|
|
130
|
+
"deb http://deb.debian.org/debian $os_codename-updates main" \
|
|
131
|
+
"deb http://security.debian.org/debian-security $os_codename-security main" > "$APT_SOURCE_FILE"
|
|
132
|
+
;;
|
|
133
|
+
ubuntu:china)
|
|
134
|
+
case "$(uname -m)" in x86_64|amd64) apt_base="ubuntu" ;; *) apt_base="ubuntu-ports" ;; esac
|
|
135
|
+
printf '%s\n' \
|
|
136
|
+
"deb http://mirrors.tuna.tsinghua.edu.cn/$apt_base/ $os_codename main universe" \
|
|
137
|
+
"deb http://mirrors.tuna.tsinghua.edu.cn/$apt_base/ $os_codename-updates main universe" \
|
|
138
|
+
"deb http://mirrors.tuna.tsinghua.edu.cn/$apt_base/ $os_codename-security main universe" > "$APT_SOURCE_FILE"
|
|
139
|
+
;;
|
|
140
|
+
ubuntu:*)
|
|
141
|
+
case "$(uname -m)" in
|
|
142
|
+
x86_64|amd64) apt_host="archive.ubuntu.com/ubuntu"; apt_security_host="security.ubuntu.com/ubuntu" ;;
|
|
143
|
+
*) apt_host="ports.ubuntu.com/ubuntu-ports"; apt_security_host="$apt_host" ;;
|
|
144
|
+
esac
|
|
145
|
+
printf '%s\n' \
|
|
146
|
+
"deb http://$apt_host/ $os_codename main universe" \
|
|
147
|
+
"deb http://$apt_host/ $os_codename-updates main universe" \
|
|
148
|
+
"deb http://$apt_security_host/ $os_codename-security main universe" > "$APT_SOURCE_FILE"
|
|
149
|
+
;;
|
|
150
|
+
*) rm -f "$APT_SOURCE_FILE"; APT_SOURCE_FILE=""; return 1 ;;
|
|
151
|
+
esac
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
apt_get() {
|
|
155
|
+
if [ -n "$APT_SOURCE_FILE" ]; then
|
|
156
|
+
apt-get -o "Dir::Etc::sourcelist=$APT_SOURCE_FILE" -o "Dir::Etc::sourceparts=-" "$@"
|
|
157
|
+
else
|
|
158
|
+
apt-get "$@"
|
|
159
|
+
fi
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
node_is_compatible() {
|
|
163
|
+
command -v node >/dev/null 2>&1 || return 1
|
|
164
|
+
current_node_version="$(node -p 'process.versions.node' 2>/dev/null || true)"
|
|
165
|
+
case "$current_node_version" in
|
|
166
|
+
24.*) version_is_at_least "$current_node_version" "$MIN_NODE_VERSION" ;;
|
|
167
|
+
*) return 1 ;;
|
|
168
|
+
esac
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
version_is_at_least() {
|
|
172
|
+
awk -v current="$1" -v minimum="$2" 'BEGIN {
|
|
173
|
+
split(current, left, "."); split(minimum, right, ".");
|
|
174
|
+
for (i = 1; i <= 3; i++) {
|
|
175
|
+
if ((left[i] + 0) > (right[i] + 0)) exit 0;
|
|
176
|
+
if ((left[i] + 0) < (right[i] + 0)) exit 1;
|
|
177
|
+
}
|
|
178
|
+
exit 0;
|
|
179
|
+
}'
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
install_node_prerequisites() {
|
|
183
|
+
if command -v apt-get >/dev/null 2>&1; then
|
|
184
|
+
export DEBIAN_FRONTEND=noninteractive
|
|
185
|
+
echo "Refreshing apt package metadata"
|
|
186
|
+
apt_get update
|
|
187
|
+
apt_get install -y ca-certificates curl xz-utils
|
|
188
|
+
elif command -v dnf >/dev/null 2>&1; then
|
|
189
|
+
echo "Installing Node.js archive prerequisites with dnf"
|
|
190
|
+
dnf install -y ca-certificates curl tar xz
|
|
191
|
+
else
|
|
192
|
+
die "automatic Node.js installation requires apt-get or dnf; install Node.js $MIN_NODE_VERSION with npm manually"
|
|
193
|
+
fi
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
ensure_supported_linux_runtime() {
|
|
197
|
+
for command in awk getconf uname; do require_command "$command"; done
|
|
198
|
+
[ "$(uname -s)" = "Linux" ] || die "runtime packages support Linux hosts only"
|
|
199
|
+
case "$(uname -m)" in
|
|
200
|
+
x86_64|amd64) node_arch="x64" ;;
|
|
201
|
+
aarch64|arm64) node_arch="arm64" ;;
|
|
202
|
+
*) die "runtime packages support x86_64 and arm64 Linux hosts only" ;;
|
|
203
|
+
esac
|
|
204
|
+
glibc_version="$(getconf GNU_LIBC_VERSION 2>/dev/null | awk '{ print $2 }')"
|
|
205
|
+
[ -n "$glibc_version" ] && version_is_at_least "$glibc_version" "2.28" \
|
|
206
|
+
|| die "runtime packages require glibc 2.28 or newer; found ${glibc_version:-unknown}"
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
ensure_node_environment() {
|
|
210
|
+
if node_is_compatible && command -v npm >/dev/null 2>&1; then
|
|
211
|
+
ensure_supported_linux_runtime
|
|
212
|
+
echo "Using existing Node.js $(node --version) and npm $(npm --version)"
|
|
213
|
+
return
|
|
214
|
+
fi
|
|
215
|
+
|
|
216
|
+
echo "Installing the current Node.js 24 build with its bundled npm."
|
|
217
|
+
install_node_prerequisites
|
|
218
|
+
if [ "$HAD_CURL" = "0" ] && [ "$INSTALL_SOURCE" = "auto" ]; then select_install_source; fi
|
|
219
|
+
for command in awk curl getconf mktemp sha256sum tar uname; do require_command "$command"; done
|
|
220
|
+
ensure_supported_linux_runtime
|
|
221
|
+
node_tmp="$(mktemp -d)"
|
|
222
|
+
trap 'rm -rf "$node_tmp"' EXIT HUP INT TERM
|
|
223
|
+
curl -fsSL --connect-timeout 10 --max-time 60 --retry 2 \
|
|
224
|
+
"$NODE_DIST_URL/latest-v24.x/SHASUMS256.txt" -o "$node_tmp/SHASUMS256.txt"
|
|
225
|
+
node_archive="$(awk -v suffix="linux-$node_arch.tar.xz" '$2 ~ suffix "$" { print $2; exit }' "$node_tmp/SHASUMS256.txt")"
|
|
226
|
+
[ -n "$node_archive" ] || die "could not find the Node.js 24 archive for $node_arch at $NODE_DIST_URL"
|
|
227
|
+
curl --fail --location --show-error --connect-timeout 10 --max-time 600 --retry 2 \
|
|
228
|
+
"$NODE_DIST_URL/latest-v24.x/$node_archive" -o "$node_tmp/$node_archive"
|
|
229
|
+
expected_checksum="$(awk -v archive="$node_archive" '$2 == archive { print $1; exit }' "$node_tmp/SHASUMS256.txt")"
|
|
230
|
+
actual_checksum="$(sha256sum "$node_tmp/$node_archive" | awk '{ print $1 }')"
|
|
231
|
+
[ "$actual_checksum" = "$expected_checksum" ] || die "Node.js archive checksum verification failed"
|
|
232
|
+
tar -xJf "$node_tmp/$node_archive" --strip-components=1 -C /usr/local
|
|
233
|
+
rm -rf "$node_tmp"
|
|
234
|
+
trap - EXIT HUP INT TERM
|
|
235
|
+
|
|
236
|
+
node_is_compatible || die "Node.js $MIN_NODE_VERSION or newer within the Node.js 24 release line is required; found $(node --version 2>/dev/null || echo none)"
|
|
237
|
+
command -v npm >/dev/null 2>&1 || die "npm was not installed with Node.js"
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
while [ "$#" -gt 0 ]; do
|
|
241
|
+
case "$1" in
|
|
242
|
+
--control-plane) CONTROL_PLANE_URL="${2:-}"; shift 2 ;;
|
|
243
|
+
--join-token) JOIN_TOKEN="${2:-}"; shift 2 ;;
|
|
244
|
+
--cloud-relay-origin) CLOUD_RELAY_ORIGIN="${2:-}"; shift 2 ;;
|
|
245
|
+
--cloud-relay-bind-token) CLOUD_RELAY_BIND_TOKEN="${2:-}"; shift 2 ;;
|
|
246
|
+
--task-handoff-bin) TASK_HANDOFF_BIN="${2:-}"; shift 2 ;;
|
|
247
|
+
--package-url) PACKAGE_URL="${2:-}"; shift 2 ;;
|
|
248
|
+
--npm-package) NPM_PACKAGE="${2:-}"; shift 2 ;;
|
|
249
|
+
--controlled-instance-package) CONTROLLED_INSTANCE_PACKAGE="${2:-}"; shift 2 ;;
|
|
250
|
+
--controlled-instance-package-url) CONTROLLED_INSTANCE_PACKAGE_URL="${2:-}"; shift 2 ;;
|
|
251
|
+
--version) VERSION="${2:-}"; shift 2 ;;
|
|
252
|
+
--install-source) INSTALL_SOURCE="${2:-}"; shift 2 ;;
|
|
253
|
+
--node-dist-url) NODE_DIST_URL="${2:-}"; shift 2 ;;
|
|
254
|
+
--npm-registry) NPM_REGISTRY="${2:-}"; shift 2 ;;
|
|
255
|
+
--data-dir) DATA_DIR="${2:-}"; shift 2 ;;
|
|
256
|
+
--service-user) SERVICE_USER="${2:-}"; shift 2 ;;
|
|
257
|
+
--host) HOST="${2:-}"; shift 2 ;;
|
|
258
|
+
--port) PORT="${2:-}"; shift 2 ;;
|
|
259
|
+
-h|--help) usage; exit 0 ;;
|
|
260
|
+
*) echo "Unknown option: $1" >&2; usage >&2; exit 1 ;;
|
|
261
|
+
esac
|
|
262
|
+
done
|
|
263
|
+
|
|
264
|
+
[ "$INSTALL_SOURCE" = "auto" ] || [ "$INSTALL_SOURCE" = "official" ] || [ "$INSTALL_SOURCE" = "china" ] \
|
|
265
|
+
|| die "--install-source must be auto, official, or china"
|
|
266
|
+
NODE_DIST_URL_OVERRIDE="$NODE_DIST_URL"
|
|
267
|
+
NPM_REGISTRY_OVERRIDE="$NPM_REGISTRY"
|
|
268
|
+
|
|
269
|
+
need_root
|
|
270
|
+
|
|
271
|
+
if [ -z "$CONTROL_PLANE_URL" ] && [ -z "$CLOUD_RELAY_BIND_TOKEN" ]; then
|
|
272
|
+
echo "Either --control-plane or --cloud-relay-bind-token is required." >&2
|
|
273
|
+
exit 1
|
|
274
|
+
fi
|
|
275
|
+
if [ -n "$CLOUD_RELAY_ORIGIN" ] && [ -z "$CLOUD_RELAY_BIND_TOKEN" ]; then
|
|
276
|
+
echo "--cloud-relay-bind-token is required with --cloud-relay-origin." >&2
|
|
277
|
+
exit 1
|
|
278
|
+
fi
|
|
279
|
+
|
|
280
|
+
CONTROL_PLANE_URL="${CONTROL_PLANE_URL%/}"
|
|
281
|
+
|
|
282
|
+
if ! command -v systemctl >/dev/null 2>&1; then
|
|
283
|
+
echo "systemd is required for this installer." >&2
|
|
284
|
+
exit 1
|
|
285
|
+
fi
|
|
286
|
+
|
|
287
|
+
HAD_CURL="0"
|
|
288
|
+
if command -v curl >/dev/null 2>&1; then HAD_CURL="1"; fi
|
|
289
|
+
select_install_source
|
|
290
|
+
if command -v apt-get >/dev/null 2>&1; then prepare_apt_source || true; fi
|
|
291
|
+
ensure_node_environment
|
|
292
|
+
rm -f "$APT_SOURCE_FILE"
|
|
293
|
+
require_command curl
|
|
294
|
+
|
|
295
|
+
if [ "$SERVICE_USER" != "root" ] && ! id "$SERVICE_USER" >/dev/null 2>&1; then
|
|
296
|
+
useradd --system --create-home --home-dir /var/lib/task-handoff --shell /usr/sbin/nologin "$SERVICE_USER"
|
|
297
|
+
fi
|
|
298
|
+
if [ "$SERVICE_USER" != "root" ] && getent group docker >/dev/null 2>&1; then
|
|
299
|
+
usermod -aG docker "$SERVICE_USER" || true
|
|
300
|
+
fi
|
|
301
|
+
|
|
302
|
+
mkdir -p "$DATA_DIR" "$ENV_DIR"
|
|
303
|
+
chown -R "$SERVICE_USER":"$SERVICE_USER" "$DATA_DIR" 2>/dev/null || true
|
|
304
|
+
|
|
305
|
+
npm_install_global() {
|
|
306
|
+
if [ -n "$NPM_REGISTRY" ]; then
|
|
307
|
+
npm install -g --omit=dev --no-audit --no-fund --registry "$NPM_REGISTRY" "$@"
|
|
308
|
+
else
|
|
309
|
+
npm install -g --omit=dev --no-audit --no-fund "$@"
|
|
310
|
+
fi
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
install_from_package_url() {
|
|
314
|
+
require_command npm
|
|
315
|
+
npm_install_global "$PACKAGE_URL"
|
|
316
|
+
TASK_HANDOFF_BIN="$(command -v task-handoff-node-agent)"
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
install_from_npm() {
|
|
320
|
+
require_command npm
|
|
321
|
+
package_spec="$NPM_PACKAGE"
|
|
322
|
+
if [ -n "$VERSION" ]; then
|
|
323
|
+
package_spec="$package_spec@$VERSION"
|
|
324
|
+
fi
|
|
325
|
+
npm_install_global "$package_spec"
|
|
326
|
+
TASK_HANDOFF_BIN="$(command -v task-handoff-node-agent)"
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
if [ -n "$PACKAGE_URL" ]; then
|
|
330
|
+
install_from_package_url
|
|
331
|
+
elif [ -n "$TASK_HANDOFF_BIN" ]; then
|
|
332
|
+
if [ ! -x "$TASK_HANDOFF_BIN" ]; then
|
|
333
|
+
echo "--task-handoff-bin must point to an executable file." >&2
|
|
334
|
+
exit 1
|
|
335
|
+
fi
|
|
336
|
+
elif [ -n "$NPM_PACKAGE" ]; then
|
|
337
|
+
install_from_npm
|
|
338
|
+
elif command -v task-handoff-node-agent >/dev/null 2>&1; then
|
|
339
|
+
TASK_HANDOFF_BIN="$(command -v task-handoff-node-agent)"
|
|
340
|
+
elif command -v task-handoff >/dev/null 2>&1; then
|
|
341
|
+
TASK_HANDOFF_BIN="$(command -v task-handoff)"
|
|
342
|
+
else
|
|
343
|
+
echo "No node-agent binary found. Pass --package-url, --npm-package, or --task-handoff-bin." >&2
|
|
344
|
+
exit 1
|
|
345
|
+
fi
|
|
346
|
+
|
|
347
|
+
NODE_AGENT_COMMAND="$TASK_HANDOFF_BIN"
|
|
348
|
+
case "$(basename "$TASK_HANDOFF_BIN")" in
|
|
349
|
+
task-handoff|task-handoff.js) NODE_AGENT_COMMAND="$TASK_HANDOFF_BIN node-agent" ;;
|
|
350
|
+
esac
|
|
351
|
+
|
|
352
|
+
if [ -n "$CONTROLLED_INSTANCE_PACKAGE_URL" ]; then
|
|
353
|
+
require_command npm
|
|
354
|
+
npm_install_global "$CONTROLLED_INSTANCE_PACKAGE_URL"
|
|
355
|
+
elif [ -n "$CONTROLLED_INSTANCE_PACKAGE" ]; then
|
|
356
|
+
require_command npm
|
|
357
|
+
controlled_spec="$CONTROLLED_INSTANCE_PACKAGE"
|
|
358
|
+
if [ -n "$VERSION" ]; then
|
|
359
|
+
controlled_spec="$controlled_spec@$VERSION"
|
|
360
|
+
fi
|
|
361
|
+
npm_install_global "$controlled_spec"
|
|
362
|
+
fi
|
|
363
|
+
|
|
364
|
+
CONTROLLED_INSTANCE_COMMAND=""
|
|
365
|
+
if command -v task-handoff-controlled-instance >/dev/null 2>&1; then
|
|
366
|
+
CONTROLLED_INSTANCE_COMMAND="$(command -v task-handoff-controlled-instance) web"
|
|
367
|
+
fi
|
|
368
|
+
require_command npm
|
|
369
|
+
NPM_COMMAND="$(command -v npm)"
|
|
370
|
+
|
|
371
|
+
cat > "$ENV_DIR/node-agent.env" <<EOF
|
|
372
|
+
TASK_HANDOFF_CONTROL_PLANE_URL=$CONTROL_PLANE_URL
|
|
373
|
+
TASK_HANDOFF_NODE_AGENT_HOST=$HOST
|
|
374
|
+
TASK_HANDOFF_NODE_AGENT_PORT=$PORT
|
|
375
|
+
TASK_HANDOFF_NODE_AGENT_DATA_DIR=$DATA_DIR
|
|
376
|
+
TASK_HANDOFF_NODE_AGENT_CONNECTION_MODE=local-ipc
|
|
377
|
+
TASK_HANDOFF_NODE_AGENT_IPC_PATH=$IPC_PATH
|
|
378
|
+
TASK_HANDOFF_LOCAL_CONTROLLED_COMMAND=$CONTROLLED_INSTANCE_COMMAND
|
|
379
|
+
TASK_HANDOFF_NPM_COMMAND=$NPM_COMMAND
|
|
380
|
+
${NPM_REGISTRY:+NPM_CONFIG_REGISTRY=$NPM_REGISTRY}
|
|
381
|
+
EOF
|
|
382
|
+
chmod 0640 "$ENV_DIR/node-agent.env"
|
|
383
|
+
|
|
384
|
+
cat > /etc/systemd/system/task-handoff-node-agent.service <<EOF
|
|
385
|
+
[Unit]
|
|
386
|
+
Description=TaskHandoff Node Agent
|
|
387
|
+
After=network-online.target docker.service
|
|
388
|
+
Wants=network-online.target
|
|
389
|
+
|
|
390
|
+
[Service]
|
|
391
|
+
Type=simple
|
|
392
|
+
User=$SERVICE_USER
|
|
393
|
+
RuntimeDirectory=task-handoff
|
|
394
|
+
RuntimeDirectoryMode=0750
|
|
395
|
+
EnvironmentFile=-$ENV_DIR/node-agent.env
|
|
396
|
+
ExecStart=$NODE_AGENT_COMMAND --host $HOST --port $PORT --data-dir $DATA_DIR --connection-mode local-ipc --ipc-path $IPC_PATH
|
|
397
|
+
Restart=always
|
|
398
|
+
RestartSec=3
|
|
399
|
+
KillSignal=SIGTERM
|
|
400
|
+
|
|
401
|
+
[Install]
|
|
402
|
+
WantedBy=multi-user.target
|
|
403
|
+
EOF
|
|
404
|
+
|
|
405
|
+
systemctl daemon-reload
|
|
406
|
+
# Compatibility for v0.0.24: enable --now left an already-running process on
|
|
407
|
+
# the old package, environment, and unit after a repeated installation.
|
|
408
|
+
systemctl enable task-handoff-node-agent.service
|
|
409
|
+
systemctl restart task-handoff-node-agent.service
|
|
410
|
+
|
|
411
|
+
for i in $(seq 1 30); do
|
|
412
|
+
if [ -S "$IPC_PATH" ] && curl --unix-socket "$IPC_PATH" -fsS "http://localhost/api/node-agent/health" >/dev/null 2>&1; then
|
|
413
|
+
break
|
|
414
|
+
fi
|
|
415
|
+
if [ "$i" = "30" ]; then
|
|
416
|
+
systemctl status --no-pager task-handoff-node-agent.service || true
|
|
417
|
+
curl --unix-socket "$IPC_PATH" -sS "http://localhost/api/node-agent/health" >&2 || true
|
|
418
|
+
echo "Node agent did not become healthy." >&2
|
|
419
|
+
exit 1
|
|
420
|
+
fi
|
|
421
|
+
sleep 1
|
|
422
|
+
done
|
|
423
|
+
|
|
424
|
+
if [ -n "$JOIN_TOKEN" ]; then
|
|
425
|
+
payload="$(mktemp)"
|
|
426
|
+
status="$(curl -sS -o "$payload" -w '%{http_code}' \
|
|
427
|
+
--unix-socket "$IPC_PATH" \
|
|
428
|
+
-H 'content-type: application/json' \
|
|
429
|
+
-d "{\"controlPlaneUrl\":\"$CONTROL_PLANE_URL\",\"joinToken\":\"$JOIN_TOKEN\",\"controlPlaneName\":\"TaskHandoff Control Plane\",\"activate\":true}" \
|
|
430
|
+
"http://localhost/api/node-agent/control-plane-connections")"
|
|
431
|
+
if [ "$status" != "201" ]; then
|
|
432
|
+
cat "$payload" >&2 || true
|
|
433
|
+
rm -f "$payload"
|
|
434
|
+
echo "Node agent pairing failed with HTTP $status." >&2
|
|
435
|
+
exit 1
|
|
436
|
+
fi
|
|
437
|
+
rm -f "$payload"
|
|
438
|
+
else
|
|
439
|
+
echo "No --join-token provided; installed node-agent without remote pairing."
|
|
440
|
+
fi
|
|
441
|
+
|
|
442
|
+
if [ -n "$CLOUD_RELAY_BIND_TOKEN" ]; then
|
|
443
|
+
payload="$(mktemp)"
|
|
444
|
+
if [ -n "$CLOUD_RELAY_ORIGIN" ]; then
|
|
445
|
+
bind_request="{\"cloudOrigin\":\"$CLOUD_RELAY_ORIGIN\",\"bindingToken\":\"$CLOUD_RELAY_BIND_TOKEN\"}"
|
|
446
|
+
else
|
|
447
|
+
bind_request="{\"bindingToken\":\"$CLOUD_RELAY_BIND_TOKEN\"}"
|
|
448
|
+
fi
|
|
449
|
+
status="$(curl -sS -o "$payload" -w '%{http_code}' \
|
|
450
|
+
--unix-socket "$IPC_PATH" \
|
|
451
|
+
-H 'content-type: application/json' \
|
|
452
|
+
-d "$bind_request" \
|
|
453
|
+
"http://localhost/api/node-agent/cloud-relay/bind")"
|
|
454
|
+
if [ "$status" != "201" ]; then
|
|
455
|
+
cat "$payload" >&2 || true
|
|
456
|
+
rm -f "$payload"
|
|
457
|
+
echo "Cloud platform account binding failed with HTTP $status." >&2
|
|
458
|
+
if [ -n "$CLOUD_RELAY_ORIGIN" ]; then
|
|
459
|
+
echo "The node agent is installed and running; retry with: sudo task-handoff-node-agent cloud-bind --cloud-origin $CLOUD_RELAY_ORIGIN --binding-token <token>" >&2
|
|
460
|
+
else
|
|
461
|
+
echo "The node agent is installed and running; retry with: sudo task-handoff-node-agent cloud-bind --binding-token <token>" >&2
|
|
462
|
+
fi
|
|
463
|
+
exit 1
|
|
464
|
+
fi
|
|
465
|
+
rm -f "$payload"
|
|
466
|
+
echo "Node agent bound to the cloud platform account; waiting for the first claim."
|
|
467
|
+
fi
|
|
468
|
+
|
|
469
|
+
echo "TaskHandoff node-agent is installed and running."
|
|
470
|
+
echo "Service: task-handoff-node-agent.service"
|
|
471
|
+
echo "Pairing token: sudo task-handoff-node-agent invite --ipc-path $IPC_PATH"
|
|
472
|
+
echo "Uninstall: sudo task-handoff-node-agent uninstall"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@task-handoff/control-plane",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.46",
|
|
4
4
|
"description": "Prebuilt TaskHandoff control plane runtime.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"bin",
|
|
28
28
|
"dist",
|
|
29
29
|
"ui",
|
|
30
|
+
"dist",
|
|
30
31
|
"README.md",
|
|
31
32
|
"LICENSE",
|
|
32
33
|
"NOTICE"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aR as cl,bA as wi,aZ as ul,bk as $,aU as ko,bb as Lo,bV as ae,b9 as bi,bd as $o,bf as J,aG as bn,b7 as Ut,b5 as mt,bz as V,aJ as oe,aO as Oo,aL as ki,bX as It,bm as pt,bY as sl,aF as b,aH as ye,bT as dl,bs as Me,aD as k,br as xi,b4 as j,b_ as zo,as as Si,aM as Ci,U as xo,aB as Mi}from"./ui-vendor-DlCfJccy.js";import{_ as Bi,q as Ei,o as Ho,n as Fi,y as Pi,J as fl,j as Li,s as $i,p as Oi,a as hn,D as vt,c as So,O as zi,m as gn,A as Hi,u as Ni,f as Ti,h as Ri,V as Co,N as Di,M as Ai,P as jt,C as Mo,k as ji,e as qi}from"./index-BeLkdnQ9.js";import{i as fe,t as yn}from"./safeRaf-DGuzXxDK.js";import"./xterm-C91wPeZQ.js";var wn=(x,M,w)=>new Promise((te,ne)=>{var we=E=>{try{r(w.next(E))}catch(z){ne(z)}},be=E=>{try{r(w.throw(E))}catch(z){ne(z)}},r=E=>E.done?te(E.value):Promise.resolve(E.value).then(we,be);r((w=w.apply(x,M)).next())});let Bo=!1,qt=null,Wt=null,_t=null;function Wi(){return wn(this,null,function*(){if(_t)return _t;_t=wn(null,null,function*(){if(!Wt)try{if(Wt=(function(x){const M=x;if(typeof M?.useMonaco=="function")return M;const w=x?.default;return typeof w?.useMonaco=="function"?w:null})(yield Bi(()=>import("./__vite-optional-peer-dep_stream-diffs_markstream-vue_false-B8vYMc84.js"),[])),!Wt)return null}catch{return null}try{return yield(function(x){return wn(this,null,function*(){return Bo?void 0:qt||(qt=wn(null,null,function*(){const w=globalThis?.MonacoEnvironment;w&&(typeof w.getWorker=="function"||typeof w.getWorkerUrl=="function")||typeof x?.preloadMonacoWorkers!="function"||(yield x.preloadMonacoWorkers()),Bo=!0}).finally(()=>{qt=null}),qt)})})(Wt),Ei(),Wt}catch{return null}});try{return yield _t}finally{_t=null}})}var _i=Object.defineProperty,Ui=Object.defineProperties,Ii=Object.getOwnPropertyDescriptors,Eo=Object.getOwnPropertySymbols,Vi=Object.prototype.hasOwnProperty,Ji=Object.prototype.propertyIsEnumerable,Fo=(x,M,w)=>M in x?_i(x,M,{enumerable:!0,configurable:!0,writable:!0,value:w}):x[M]=w,U=(x,M)=>{for(var w in M||(M={}))Vi.call(M,w)&&Fo(x,w,M[w]);if(Eo)for(var w of Eo(M))Ji.call(M,w)&&Fo(x,w,M[w]);return x},Ce=(x,M)=>Ui(x,Ii(M)),q=(x,M,w)=>new Promise((te,ne)=>{var we=E=>{try{r(w.next(E))}catch(z){ne(z)}},be=E=>{try{r(w.throw(E))}catch(z){ne(z)}},r=E=>E.done?te(E.value):Promise.resolve(E.value).then(we,be);r((w=w.apply(x,M)).next())});const Gi={key:0,class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},Xi={class:"flex items-center gap-0.5"},Yi=["aria-label"],Zi={class:"code-diff-stat removed"},Ki={class:"code-diff-stat added"},Qi=["aria-label"],er={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},tr={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},nr=["aria-pressed"],lr={key:3,class:"relative"},or=["aria-expanded"],ir=["disabled"],rr=["disabled"],ar=["disabled"],ur={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},sr={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},dr={class:"code-loading-placeholder"},cr={class:"sr-only","aria-live":"polite",role:"status"},fr=cl({__name:"CodeBlockShell",props:{showHeader:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},stream:{type:Boolean,default:!1},isCollapsed:{type:Boolean,default:!1},isExpanded:{type:Boolean,default:!1},copyText:{type:Boolean,default:!1},isPreviewable:{type:Boolean,default:!1},codeFontSize:{},codeFontMin:{},codeFontMax:{},defaultCodeFontSize:{},fontBaselineReady:{type:Boolean,default:!1},diffStats:{},diffStatsAriaLabel:{}},emits:["toggleCollapse","decreaseFont","resetFont","increaseFont","copy","toggleExpand","preview"],setup(x,{emit:M}){const w=x,te=M,ne=$(!1),we=$(null),be=$(null);function r(){vt(!0),ne.value=!ne.value,ne.value&&document.addEventListener("click",z,{once:!0,capture:!0})}function E(){vt(!0),ne.value=!1}function z(X){var f,O;const yt=X.target;(f=we.value)!=null&&f.contains(yt)||(O=be.value)!=null&&O.contains(yt)?document.addEventListener("click",z,{once:!0,capture:!0}):E()}const ie=k(()=>w.showFontSizeButtons&&w.enableFontSizeControl||w.showExpandButton||w.isPreviewable&&w.showPreviewButton),{t:N}=fl(),ht=k(()=>w.showTooltips!==!1);function Ve(X,f){ht.value&&ji(X.currentTarget,f,"top",!1,void 0,w.isDark)}function Be(){ht.value&&vt()}function gt(X){Ve(X,w.copyText?N("common.copied")||"Copied":N("common.copy")||"Copy")}const vl=k(()=>{var X,f;return!!Number.isFinite(w.codeFontSize)&&((X=w.codeFontSize)!=null?X:0)<=((f=w.codeFontMin)!=null?f:0)}),Vt=k(()=>!w.fontBaselineReady||w.codeFontSize===w.defaultCodeFontSize),Jt=k(()=>{var X,f;return!!Number.isFinite(w.codeFontSize)&&((X=w.codeFontSize)!=null?X:0)>=((f=w.codeFontMax)!=null?f:100)});return(X,f)=>(J(),oe(xo,null,[w.showHeader?(J(),oe("div",Gi,[pt(X.$slots,"header-left"),pt(X.$slots,"header-right",{},()=>[b("div",Xi,[x.diffStats?(J(),oe("div",{key:0,class:"code-diff-stats","aria-label":x.diffStatsAriaLabel},[b("span",Zi,"-"+Me(x.diffStats.removed),1),b("span",Ki,"+"+Me(x.diffStats.added),1)],8,Yi)):ye("",!0),w.showCopyButton?(J(),oe("button",{key:1,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":x.copyText?V(N)("common.copied")||"Copied":V(N)("common.copy")||"Copy",onClick:f[0]||(f[0]=O=>te("copy")),onMouseenter:f[1]||(f[1]=O=>gt(O)),onFocus:f[2]||(f[2]=O=>gt(O)),onMouseleave:Be,onBlur:Be},[x.copyText?(J(),oe("svg",tr,[...f[14]||(f[14]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(J(),oe("svg",er,[...f[13]||(f[13]=[b("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[b("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),b("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,Qi)):ye("",!0),w.showCollapseButton?(J(),oe("button",{key:2,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":x.isCollapsed,onClick:f[3]||(f[3]=O=>te("toggleCollapse")),onMouseenter:f[4]||(f[4]=O=>Ve(O,x.isCollapsed?V(N)("common.expand")||"Expand":V(N)("common.collapse")||"Collapse")),onFocus:f[5]||(f[5]=O=>Ve(O,x.isCollapsed?V(N)("common.expand")||"Expand":V(N)("common.collapse")||"Collapse")),onMouseleave:Be,onBlur:Be},[(J(),oe("svg",{style:Ut({rotate:x.isCollapsed?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...f[15]||(f[15]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,nr)):ye("",!0),ie.value?(J(),oe("div",lr,[b("button",{ref_key:"moreBtnRef",ref:be,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] transition-colors","aria-expanded":ne.value,"aria-haspopup":"true",onClick:zo(r,["stop"]),onMouseenter:f[6]||(f[6]=O=>Ve(O,V(N)("common.more")||"More")),onFocus:f[7]||(f[7]=O=>Ve(O,V(N)("common.more")||"More")),onMouseleave:Be,onBlur:Be},[...f[16]||(f[16]=[Ci('<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="1em" height="1em" viewBox="0 0 24 24" class="action-icon"><g fill="currentColor"><circle cx="12" cy="5" r="1.5"></circle><circle cx="12" cy="12" r="1.5"></circle><circle cx="12" cy="19" r="1.5"></circle></g></svg>',1)])],40,or),Oo(Mi,{name:"code-menu"},{default:It(()=>[ne.value?(J(),oe("div",{key:0,ref_key:"moreMenuRef",ref:we,class:"code-more-menu min-w-[10rem] p-1 bg-[hsl(var(--ms-popover))] text-[hsl(var(--ms-popover-foreground))] border border-[var(--code-border)] shadow-[var(--ms-shadow-popover)]",role:"menu"},[w.showFontSizeButtons&&w.enableFontSizeControl?(J(),oe(xo,{key:0},[b("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:vl.value,onClick:f[8]||(f[8]=O=>{V(vt)(!0),te("decreaseFont")})},[f[17]||(f[17]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),b("span",null,Me(V(N)("common.fontSmaller")||"Font size −"),1)],8,ir),b("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Vt.value,onClick:f[9]||(f[9]=O=>{V(vt)(!0),te("resetFont")})},[f[18]||(f[18]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[b("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),b("path",{d:"M3 3v5h5"})])],-1)),b("span",null,Me(V(N)("common.fontReset")||"Font size reset"),1)],8,rr),b("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Jt.value,onClick:f[10]||(f[10]=O=>{V(vt)(!0),te("increaseFont")})},[f[19]||(f[19]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),b("span",null,Me(V(N)("common.fontLarger")||"Font size +"),1)],8,ar)],64)):ye("",!0),w.showExpandButton?(J(),oe("button",{key:1,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:f[11]||(f[11]=O=>{E(),te("toggleExpand")})},[x.isExpanded?(J(),oe("svg",ur,[...f[20]||(f[20]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(J(),oe("svg",sr,[...f[21]||(f[21]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])),b("span",null,Me(x.isExpanded?V(N)("common.collapse")||"Collapse":V(N)("common.expand")||"Expand"),1)])):ye("",!0),x.isPreviewable&&w.showPreviewButton?(J(),oe("button",{key:2,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:f[12]||(f[12]=O=>{E(),te("preview")})},[f[22]||(f[22]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[b("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),b("circle",{cx:"12",cy:"12",r:"3"})])],-1)),b("span",null,Me(V(N)("common.preview")||"Preview"),1)])):ye("",!0)],512)):ye("",!0)]),_:1})])):ye("",!0)])])])):ye("",!0),sl(b("div",{class:mt(["code-block-shell-content",{"code-block-shell-content--collapsed":x.isCollapsed}])},[pt(X.$slots,"default")],2),[[dl,!!x.stream||!x.loading]]),sl(b("div",dr,[pt(X.$slots,"loading",{},()=>[f[23]||(f[23]=b("div",{class:"loading-skeleton"},[b("div",{class:"skeleton-line"}),b("div",{class:"skeleton-line"}),b("div",{class:"skeleton-line short"})],-1))])],512),[[dl,!x.stream&&x.loading]]),b("span",cr,Me(x.copyText?V(N)("common.copied")||"Copied":""),1)],64))}}),vr={class:"html-preview-frame__header"},mr={class:"html-preview-frame__title"},pr={class:"html-preview-frame__label"},hr=["sandbox","srcdoc"],gr=Ho(cl({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(x){const M=x,w=import.meta!==void 0&&!1;let te=null;const{t:ne}=fl(),we=k(()=>{const E=M.code||"",z=E.trim().toLowerCase();return z.startsWith("<!doctype")||z.startsWith("<html")||z.startsWith("<body")?E:`<!doctype html>
|
|
1
|
+
import{aR as cl,bA as wi,aZ as ul,bk as $,aU as ko,bb as Lo,bV as ae,b9 as bi,bd as $o,bf as J,aG as bn,b7 as Ut,b5 as mt,bz as V,aJ as oe,aO as Oo,aL as ki,bX as It,bm as pt,bY as sl,aF as b,aH as ye,bT as dl,bs as Me,aD as k,br as xi,b4 as j,b_ as zo,as as Si,aM as Ci,U as xo,aB as Mi}from"./ui-vendor-DlCfJccy.js";import{_ as Bi,q as Ei,o as Ho,n as Fi,y as Pi,J as fl,j as Li,s as $i,p as Oi,a as hn,D as vt,c as So,O as zi,m as gn,A as Hi,u as Ni,f as Ti,h as Ri,V as Co,N as Di,M as Ai,P as jt,C as Mo,k as ji,e as qi}from"./index-CQ3ChO2D.js";import{i as fe,t as yn}from"./safeRaf-DGuzXxDK.js";import"./xterm-C91wPeZQ.js";var wn=(x,M,w)=>new Promise((te,ne)=>{var we=E=>{try{r(w.next(E))}catch(z){ne(z)}},be=E=>{try{r(w.throw(E))}catch(z){ne(z)}},r=E=>E.done?te(E.value):Promise.resolve(E.value).then(we,be);r((w=w.apply(x,M)).next())});let Bo=!1,qt=null,Wt=null,_t=null;function Wi(){return wn(this,null,function*(){if(_t)return _t;_t=wn(null,null,function*(){if(!Wt)try{if(Wt=(function(x){const M=x;if(typeof M?.useMonaco=="function")return M;const w=x?.default;return typeof w?.useMonaco=="function"?w:null})(yield Bi(()=>import("./__vite-optional-peer-dep_stream-diffs_markstream-vue_false-B8vYMc84.js"),[])),!Wt)return null}catch{return null}try{return yield(function(x){return wn(this,null,function*(){return Bo?void 0:qt||(qt=wn(null,null,function*(){const w=globalThis?.MonacoEnvironment;w&&(typeof w.getWorker=="function"||typeof w.getWorkerUrl=="function")||typeof x?.preloadMonacoWorkers!="function"||(yield x.preloadMonacoWorkers()),Bo=!0}).finally(()=>{qt=null}),qt)})})(Wt),Ei(),Wt}catch{return null}});try{return yield _t}finally{_t=null}})}var _i=Object.defineProperty,Ui=Object.defineProperties,Ii=Object.getOwnPropertyDescriptors,Eo=Object.getOwnPropertySymbols,Vi=Object.prototype.hasOwnProperty,Ji=Object.prototype.propertyIsEnumerable,Fo=(x,M,w)=>M in x?_i(x,M,{enumerable:!0,configurable:!0,writable:!0,value:w}):x[M]=w,U=(x,M)=>{for(var w in M||(M={}))Vi.call(M,w)&&Fo(x,w,M[w]);if(Eo)for(var w of Eo(M))Ji.call(M,w)&&Fo(x,w,M[w]);return x},Ce=(x,M)=>Ui(x,Ii(M)),q=(x,M,w)=>new Promise((te,ne)=>{var we=E=>{try{r(w.next(E))}catch(z){ne(z)}},be=E=>{try{r(w.throw(E))}catch(z){ne(z)}},r=E=>E.done?te(E.value):Promise.resolve(E.value).then(we,be);r((w=w.apply(x,M)).next())});const Gi={key:0,class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},Xi={class:"flex items-center gap-0.5"},Yi=["aria-label"],Zi={class:"code-diff-stat removed"},Ki={class:"code-diff-stat added"},Qi=["aria-label"],er={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},tr={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},nr=["aria-pressed"],lr={key:3,class:"relative"},or=["aria-expanded"],ir=["disabled"],rr=["disabled"],ar=["disabled"],ur={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},sr={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},dr={class:"code-loading-placeholder"},cr={class:"sr-only","aria-live":"polite",role:"status"},fr=cl({__name:"CodeBlockShell",props:{showHeader:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},stream:{type:Boolean,default:!1},isCollapsed:{type:Boolean,default:!1},isExpanded:{type:Boolean,default:!1},copyText:{type:Boolean,default:!1},isPreviewable:{type:Boolean,default:!1},codeFontSize:{},codeFontMin:{},codeFontMax:{},defaultCodeFontSize:{},fontBaselineReady:{type:Boolean,default:!1},diffStats:{},diffStatsAriaLabel:{}},emits:["toggleCollapse","decreaseFont","resetFont","increaseFont","copy","toggleExpand","preview"],setup(x,{emit:M}){const w=x,te=M,ne=$(!1),we=$(null),be=$(null);function r(){vt(!0),ne.value=!ne.value,ne.value&&document.addEventListener("click",z,{once:!0,capture:!0})}function E(){vt(!0),ne.value=!1}function z(X){var f,O;const yt=X.target;(f=we.value)!=null&&f.contains(yt)||(O=be.value)!=null&&O.contains(yt)?document.addEventListener("click",z,{once:!0,capture:!0}):E()}const ie=k(()=>w.showFontSizeButtons&&w.enableFontSizeControl||w.showExpandButton||w.isPreviewable&&w.showPreviewButton),{t:N}=fl(),ht=k(()=>w.showTooltips!==!1);function Ve(X,f){ht.value&&ji(X.currentTarget,f,"top",!1,void 0,w.isDark)}function Be(){ht.value&&vt()}function gt(X){Ve(X,w.copyText?N("common.copied")||"Copied":N("common.copy")||"Copy")}const vl=k(()=>{var X,f;return!!Number.isFinite(w.codeFontSize)&&((X=w.codeFontSize)!=null?X:0)<=((f=w.codeFontMin)!=null?f:0)}),Vt=k(()=>!w.fontBaselineReady||w.codeFontSize===w.defaultCodeFontSize),Jt=k(()=>{var X,f;return!!Number.isFinite(w.codeFontSize)&&((X=w.codeFontSize)!=null?X:0)>=((f=w.codeFontMax)!=null?f:100)});return(X,f)=>(J(),oe(xo,null,[w.showHeader?(J(),oe("div",Gi,[pt(X.$slots,"header-left"),pt(X.$slots,"header-right",{},()=>[b("div",Xi,[x.diffStats?(J(),oe("div",{key:0,class:"code-diff-stats","aria-label":x.diffStatsAriaLabel},[b("span",Zi,"-"+Me(x.diffStats.removed),1),b("span",Ki,"+"+Me(x.diffStats.added),1)],8,Yi)):ye("",!0),w.showCopyButton?(J(),oe("button",{key:1,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":x.copyText?V(N)("common.copied")||"Copied":V(N)("common.copy")||"Copy",onClick:f[0]||(f[0]=O=>te("copy")),onMouseenter:f[1]||(f[1]=O=>gt(O)),onFocus:f[2]||(f[2]=O=>gt(O)),onMouseleave:Be,onBlur:Be},[x.copyText?(J(),oe("svg",tr,[...f[14]||(f[14]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(J(),oe("svg",er,[...f[13]||(f[13]=[b("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[b("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),b("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,Qi)):ye("",!0),w.showCollapseButton?(J(),oe("button",{key:2,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":x.isCollapsed,onClick:f[3]||(f[3]=O=>te("toggleCollapse")),onMouseenter:f[4]||(f[4]=O=>Ve(O,x.isCollapsed?V(N)("common.expand")||"Expand":V(N)("common.collapse")||"Collapse")),onFocus:f[5]||(f[5]=O=>Ve(O,x.isCollapsed?V(N)("common.expand")||"Expand":V(N)("common.collapse")||"Collapse")),onMouseleave:Be,onBlur:Be},[(J(),oe("svg",{style:Ut({rotate:x.isCollapsed?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...f[15]||(f[15]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,nr)):ye("",!0),ie.value?(J(),oe("div",lr,[b("button",{ref_key:"moreBtnRef",ref:be,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] transition-colors","aria-expanded":ne.value,"aria-haspopup":"true",onClick:zo(r,["stop"]),onMouseenter:f[6]||(f[6]=O=>Ve(O,V(N)("common.more")||"More")),onFocus:f[7]||(f[7]=O=>Ve(O,V(N)("common.more")||"More")),onMouseleave:Be,onBlur:Be},[...f[16]||(f[16]=[Ci('<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="1em" height="1em" viewBox="0 0 24 24" class="action-icon"><g fill="currentColor"><circle cx="12" cy="5" r="1.5"></circle><circle cx="12" cy="12" r="1.5"></circle><circle cx="12" cy="19" r="1.5"></circle></g></svg>',1)])],40,or),Oo(Mi,{name:"code-menu"},{default:It(()=>[ne.value?(J(),oe("div",{key:0,ref_key:"moreMenuRef",ref:we,class:"code-more-menu min-w-[10rem] p-1 bg-[hsl(var(--ms-popover))] text-[hsl(var(--ms-popover-foreground))] border border-[var(--code-border)] shadow-[var(--ms-shadow-popover)]",role:"menu"},[w.showFontSizeButtons&&w.enableFontSizeControl?(J(),oe(xo,{key:0},[b("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:vl.value,onClick:f[8]||(f[8]=O=>{V(vt)(!0),te("decreaseFont")})},[f[17]||(f[17]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),b("span",null,Me(V(N)("common.fontSmaller")||"Font size −"),1)],8,ir),b("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Vt.value,onClick:f[9]||(f[9]=O=>{V(vt)(!0),te("resetFont")})},[f[18]||(f[18]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[b("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),b("path",{d:"M3 3v5h5"})])],-1)),b("span",null,Me(V(N)("common.fontReset")||"Font size reset"),1)],8,rr),b("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Jt.value,onClick:f[10]||(f[10]=O=>{V(vt)(!0),te("increaseFont")})},[f[19]||(f[19]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),b("span",null,Me(V(N)("common.fontLarger")||"Font size +"),1)],8,ar)],64)):ye("",!0),w.showExpandButton?(J(),oe("button",{key:1,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:f[11]||(f[11]=O=>{E(),te("toggleExpand")})},[x.isExpanded?(J(),oe("svg",ur,[...f[20]||(f[20]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(J(),oe("svg",sr,[...f[21]||(f[21]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])),b("span",null,Me(x.isExpanded?V(N)("common.collapse")||"Collapse":V(N)("common.expand")||"Expand"),1)])):ye("",!0),x.isPreviewable&&w.showPreviewButton?(J(),oe("button",{key:2,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:f[12]||(f[12]=O=>{E(),te("preview")})},[f[22]||(f[22]=b("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[b("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[b("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),b("circle",{cx:"12",cy:"12",r:"3"})])],-1)),b("span",null,Me(V(N)("common.preview")||"Preview"),1)])):ye("",!0)],512)):ye("",!0)]),_:1})])):ye("",!0)])])])):ye("",!0),sl(b("div",{class:mt(["code-block-shell-content",{"code-block-shell-content--collapsed":x.isCollapsed}])},[pt(X.$slots,"default")],2),[[dl,!!x.stream||!x.loading]]),sl(b("div",dr,[pt(X.$slots,"loading",{},()=>[f[23]||(f[23]=b("div",{class:"loading-skeleton"},[b("div",{class:"skeleton-line"}),b("div",{class:"skeleton-line"}),b("div",{class:"skeleton-line short"})],-1))])],512),[[dl,!x.stream&&x.loading]]),b("span",cr,Me(x.copyText?V(N)("common.copied")||"Copied":""),1)],64))}}),vr={class:"html-preview-frame__header"},mr={class:"html-preview-frame__title"},pr={class:"html-preview-frame__label"},hr=["sandbox","srcdoc"],gr=Ho(cl({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(x){const M=x,w=import.meta!==void 0&&!1;let te=null;const{t:ne}=fl(),we=k(()=>{const E=M.code||"",z=E.trim().toLowerCase();return z.startsWith("<!doctype")||z.startsWith("<html")||z.startsWith("<body")?E:`<!doctype html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8" />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as A,_ as F}from"./index-
|
|
1
|
+
import{o as A,_ as F}from"./index-CQ3ChO2D.js";import{aR as G,bk as b,bV as S,b9 as L,bf as H,aG as J,aF as R,aO as K,bX as Q,bY as W,b7 as U,aN as Z,bs as ee,bT as te,aB as le,b5 as ae,as as ne,b4 as k}from"./ui-vendor-DlCfJccy.js";import"./xterm-C91wPeZQ.js";var B=(h,E,e)=>new Promise((o,p)=>{var i=a=>{try{d(e.next(a))}catch(c){p(c)}},y=a=>{try{d(e.throw(a))}catch(c){p(c)}},d=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,y);d((e=e.apply(h,E)).next())});const oe=["id"],ie=["data-placement"],ce=A(G({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(h){var E;const e=h,o=b(null),p=b(null),i=b({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),y=b({}),d=b((E=e.placement)!=null?E:"top"),a=b(!1);let c=null,$=null,T=null,C=null,w=null,s=0;function X(){return C?Promise.resolve(C):(w||(w=F(()=>import("./floating-ui.dom-xGUaHE3m.js"),[]).then(l=>(C=l,l)).catch(l=>{throw w=null,l})),w)}function D(){c&&(c(),c=null),$=null,T=null}function N(l){return B(this,null,function*(){const t=e.anchorEl,n=o.value;if(!e.visible||!t||!n||$===t&&T===n)return;const{autoUpdate:r}=yield X();l()&&e.visible&&e.anchorEl===t&&o.value===n&&(D(),$=t,T=n,c=r(t,n,()=>{P().catch(()=>{_()})}))})}function P(){return B(this,null,function*(){var l,t;const n=e.anchorEl,r=o.value;if(!e.visible||!n||!r)return!1;const{arrow:u,computePosition:m,flip:v,offset:f,shift:x}=yield X();if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;const g=[f((l=e.offset)!=null?l:6),v(),x({padding:6}),...p.value?[u({element:p.value,padding:4})]:[]],{x:O,y:j,placement:Y,middlewareData:V}=yield m(n,r,{placement:(t=e.placement)!=null?t:"top",middleware:g,strategy:"fixed"});if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;if(i.value.transform=`translate3d(${Math.round(O)}px, ${Math.round(j)}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=Y,V.arrow&&p.value){const{x:z,y:I}=V.arrow,q={top:"bottom",bottom:"top",left:"right",right:"left"}[Y.split("-")[0]];y.value={left:z!=null?`${z}px`:"",top:I!=null?`${I}px`:"",[q]:"-3px"}}return!0})}function _(){var l,t;const n=e.anchorEl,r=o.value;if(!n||!r)return!1;const u=n.getBoundingClientRect(),m=r.getBoundingClientRect(),v=(l=e.offset)!=null?l:6,f=(t=e.placement)!=null?t:"top";let x=u.left,g=u.top;return f==="bottom"?g=u.bottom+v:f==="left"?x=u.left-m.width-v:f==="right"?x=u.right+v:g=u.top-m.height-v,i.value.transform=`translate3d(${Math.round(Math.max(0,x))}px, ${Math.round(Math.max(0,g))}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=f,y.value={},!0}S(()=>e.visible,l=>B(null,null,function*(){const t=++s;if(l){if(a.value=!1,yield k(),t!==s||!e.visible)return;if(e.anchorEl&&o.value)try{const n=e.anchorEl,r=o.value,u=n.getBoundingClientRect();if(!(yield P())||t!==s||!e.visible||e.anchorEl!==n||o.value!==r)return;const m=i.value.transform;if(e.originX!=null&&e.originY!=null){const v=Math.abs(Number(e.originX)-u.left),f=Math.abs(Number(e.originY)-u.top);if(Math.hypot(v,f)>120){if(i.value.transform=`translate3d(${Math.round(e.originX)}px, ${Math.round(e.originY)}px, 0)`,yield k(),t!==s||!e.visible||(a.value=!0,yield k(),t!==s||!e.visible))return;i.value.transform=m}else a.value=!0}else a.value=!0;yield N(()=>t===s)}catch{if(t!==s||!e.visible)return;if(a.value=_(),e.anchorEl&&o.value)try{yield N(()=>t===s)}catch{}}else a.value=!0}else a.value=!1,D()}));let M=0;return S([()=>e.anchorEl,()=>e.placement,()=>e.content],()=>B(null,null,function*(){const l=++M;if(e.visible&&e.anchorEl&&o.value){if(yield k(),l!==M||!e.visible||!e.anchorEl||!o.value)return;try{const t=yield P();if(l!==M||!e.visible||!e.anchorEl||!o.value)return;t||_()}catch{_()}yield N(()=>l===M)}})),L(()=>{s+=1,D()}),(l,t)=>(H(),J(ne,{to:"body"},[R("div",{class:ae(["markstream-vue",{dark:h.isDark}])},[K(le,{name:"tooltip",appear:""},{default:Q(()=>[W(R("div",{id:e.id,ref_key:"tooltip",ref:o,style:U({position:"fixed",left:i.value.left,top:i.value.top,transform:i.value.transform,visibility:a.value?"visible":"hidden",pointerEvents:a.value?void 0:"none"}),class:"tooltip-element",role:"tooltip"},[Z(ee(h.content)+" ",1),R("div",{ref_key:"arrowEl",ref:p,class:"tooltip-arrow","data-placement":d.value,style:U(y.value)},null,12,ie)],12,oe),[[te,h.visible]])]),_:1})],2)]))}}),[["__scopeId","data-v-c606ee4c"]]);export{ce as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as p,r as u,d as n}from"./chunk-MOJQB5TN-
|
|
1
|
+
import{g as p,r as u,d as n}from"./chunk-MOJQB5TN-BOJ4jnHz.js";import{p as f}from"./chunk-JWPE2WC7-CoOCmswE.js";import{b as a,aE as o}from"./mermaid.core-BEKa2CjT.js";import{M as c,c as d}from"./cynefin-VYW2F7L2-whXriRIf.js";import"./index-CQ3ChO2D.js";import"./ui-vendor-DlCfJccy.js";import"./xterm-C91wPeZQ.js";var v=d().RailroadAbnf.parser.LangiumParser,i=a(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=a(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=a(e=>{if(e.includes("*")){const[t,s]=e.split("*"),m=t?parseInt(t,10):0,l=s?parseInt(s,10):1/0;return{min:m,max:l}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=a(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=a(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=a(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=a(e=>{f(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(P(r)))},"populateDb"),R={parse:a(e=>{n.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:n}},I={parser:R,db:n,renderer:u,styles:p};export{I as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bo as ln,aQ as an,H as X,ba as w,F as K,ai as un,X as y,bf as on,bb as C,aK as _,c as rn,m as t,aI as tn,j as sn,d as fn}from"./mermaid.core-
|
|
1
|
+
import{bo as ln,aQ as an,H as X,ba as w,F as K,ai as un,X as y,bf as on,bb as C,aK as _,c as rn,m as t,aI as tn,j as sn,d as fn}from"./mermaid.core-BEKa2CjT.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,q,I,v,A,O,a){var D=q-l,i=I-h,n=O-v,d=a-A,u=d*D-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*D,h+u*i]}function U(l,h,q,I,v,A,O){var a=l-q,D=h-I,i=(O?A:-A)/C(a*a+D*D),n=i*D,d=-i*a,u=l+n,s=h+d,f=q+n,c=I+d,Q=(u+f)/2,o=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,E=(g<0?-1:1)*C(tn(0,T*T*R-P*P)),F=(P*g-m*E)/R,H=(-P*m-g*E)/R,b=(P*g+m*E)/R,p=(-P*m+g*E)/R,x=F-Q,e=H-o,r=b-Q,S=p-o;return x*x+e*e>r*r+S*S&&(F=b,H=p),{cx:F,cy:H,x01:-n,y01:-d,x11:F*(v/T-1),y11:H*(v/T-1)}}function hn(){var l=cn,h=yn,q=K(0),I=null,v=gn,A=dn,O=mn,a=null,D=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,Q=rn(c-f),o=c>f;if(a||(a=n=D()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(Q>on-y)a.moveTo(s*X(f),s*w(f)),a.arc(0,0,s,f,c,!o),u>y&&(a.moveTo(u*X(c),u*w(c)),a.arc(0,0,u,c,f,o));else{var m=f,g=c,R=f,T=c,P=Q,E=Q,F=O.apply(this,arguments)/2,H=F>y&&(I?+I.apply(this,arguments):C(u*u+s*s)),b=_(rn(s-u)/2,+q.apply(this,arguments)),p=b,x=b,e,r;if(H>y){var S=sn(H/u*w(F)),G=sn(H/s*w(F));(P-=S*2)>y?(S*=o?1:-1,R+=S,T-=S):(P=0,R=T=(f+c)/2),(E-=G*2)>y?(G*=o?1:-1,m+=G,g-=G):(E=0,m=g=(f+c)/2)}var z=s*X(m),B=s*w(m),J=u*X(T),L=u*w(T);if(b>y){var M=s*X(g),N=s*w(g),V=u*X(R),W=u*w(R),j;if(Q<an)if(j=pn(z,B,V,W,M,N,J,L)){var Y=z-j[0],Z=B-j[1],$=M-j[0],k=N-j[1],nn=1/w(fn((Y*$+Z*k)/(C(Y*Y+Z*Z)*C($*$+k*k)))/2),en=C(j[0]*j[0]+j[1]*j[1]);p=_(b,(u-en)/(nn-1)),x=_(b,(s-en)/(nn+1))}else p=x=0}E>y?x>y?(e=U(V,W,z,B,s,x,o),r=U(M,N,J,L,s,x,o),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<b?a.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(r.y01,r.x01),!o):(a.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(e.y11,e.x11),!o),a.arc(0,0,s,t(e.cy+e.y11,e.cx+e.x11),t(r.cy+r.y11,r.cx+r.x11),!o),a.arc(r.cx,r.cy,x,t(r.y11,r.x11),t(r.y01,r.x01),!o))):(a.moveTo(z,B),a.arc(0,0,s,m,g,!o)):a.moveTo(z,B),!(u>y)||!(P>y)?a.lineTo(J,L):p>y?(e=U(J,L,M,N,u,-p,o),r=U(z,B,V,W,u,-p,o),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<b?a.arc(e.cx,e.cy,p,t(e.y01,e.x01),t(r.y01,r.x01),!o):(a.arc(e.cx,e.cy,p,t(e.y01,e.x01),t(e.y11,e.x11),!o),a.arc(0,0,u,t(e.cy+e.y11,e.cx+e.x11),t(r.cy+r.y11,r.cx+r.x11),o),a.arc(r.cx,r.cy,p,t(r.y11,r.x11),t(r.y01,r.x01),!o))):a.arc(0,0,u,T,R,o)}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[X(d)*n,w(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:K(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:K(+n),i):h},i.cornerRadius=function(n){return arguments.length?(q=typeof n=="function"?n:K(+n),i):q},i.padRadius=function(n){return arguments.length?(I=n==null?null:typeof n=="function"?n:K(+n),i):I},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:K(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:K(+n),i):A},i.padAngle=function(n){return arguments.length?(O=typeof n=="function"?n:K(+n),i):O},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
|