💐 Sync 2026-10-06 12:33:44

This commit is contained in:
github-actions[bot] committed 2026-10-06 12:33:44 +08:00
1 parent 8be03ce939
commit 7fe69dbb3a
246 files changed
+50330 -3414

No files matched your search

@@ -1 +1 @@
26.275.27740~2858f8d 26.278.51687~be446e3
@@ -1 +1 @@
26.274.67354~aa3d488 26.278.51556~9c9ad92
+3 -2
View File
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-flowproxy PKG_NAME:=luci-app-flowproxy
PKG_VERSION:=1.0.4 PKG_VERSION:=1.0.4
PKG_RELEASE:=3 PKG_RELEASE:=4
LUCI_TITLE:=LuCI Support for FlowProxy Traffic Diversion LUCI_TITLE:=LuCI Support for FlowProxy Traffic Diversion
LUCI_DEPENDS:=+luci-base +nftables +kmod-nft-core +ip-full LUCI_DEPENDS:=+luci-base +nftables +kmod-nft-core +ip-full
@@ -11,7 +11,8 @@ LUCI_PKGARCH:=all
define Package/$(PKG_NAME)/postinst define Package/$(PKG_NAME)/postinst
#!/bin/sh #!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then if [ -z "$${IPKG_INSTROOT}" ]; then
/etc/init.d/rpcd restart [ -f /etc/uci-defaults/99_flowproxy ] && ( . /etc/uci-defaults/99_flowproxy ) && rm -f /etc/uci-defaults/99_flowproxy
(sleep 1; /etc/init.d/rpcd reload) >/dev/null 2>&1 &
fi fi
exit 0 exit 0
endef endef
@@ -108,6 +108,12 @@ return L.view.extend({
}, [ _('Restart') ])); }, [ _('Restart') ]));
} else { } else {
content.push(E('span', { 'style': 'color: red; font-weight: bold;' }, [ _('stopped') ])); content.push(E('span', { 'style': 'color: red; font-weight: bold;' }, [ _('stopped') ]));
content.push(' ');
content.push(E('button', {
'class': 'btn cbi-button cbi-button-apply',
'style': 'margin-left: 10px;',
'click': ui.createHandlerFn(this, 'handleRestart')
}, [ _('Restart') ]));
} }
L.dom.content(statusEl, content); L.dom.content(statusEl, content);
} }
@@ -276,7 +282,7 @@ return L.view.extend({
}; };
var selected_interface = s.formvalue(section_id, 'interface'); var selected_interface = s.formvalue(section_id, 'interface');
if (!selected_interface) return true; if (!selected_interface || selected_interface === 'auto') return true;
var target_iface = null; var target_iface = null;
for (var i = 0; i < ifaces.length; i++) { for (var i = 0; i < ifaces.length; i++) {
@@ -318,8 +324,9 @@ return L.view.extend({
o.datatype = 'port'; o.default = '5353'; o.rmempty = false; o.datatype = 'port'; o.default = '5353'; o.rmempty = false;
var iface_opt = s.taboption('settings', form.ListValue, 'interface', _('Proxy server interface')); var iface_opt = s.taboption('settings', form.ListValue, 'interface', _('Proxy server interface'));
iface_opt.value('auto', _('Auto (Detect automatically)'));
devices.forEach(function(d) { iface_opt.value(d.getName(), d.getName()); }); devices.forEach(function(d) { iface_opt.value(d.getName(), d.getName()); });
iface_opt.default = 'br-lan'; iface_opt.default = 'auto';
iface_opt.onchange = function(ev, sid, val) { iface_opt.onchange = function(ev, sid, val) {
var ip_opt = m.lookupOption('proxy_server_ip_addr', sid)[0]; var ip_opt = m.lookupOption('proxy_server_ip_addr', sid)[0];
if (ip_opt) { if (ip_opt) {
@@ -273,7 +273,5 @@ msgstr ""
msgid "Invalid IPv4 address format" msgid "Invalid IPv4 address format"
msgstr "" msgstr ""
msgid "Auto (Detect automatically)"
msgstr ""
+2 -3
View File
@@ -276,6 +276,5 @@ msgstr "启用代理分流时,代理服务器 IP 地址为必填项。"
msgid "Invalid IPv4 address format" msgid "Invalid IPv4 address format"
msgstr "无效的 IPv4 地址格式" msgstr "无效的 IPv4 地址格式"
msgid "Auto (Detect automatically)"
msgstr "自动探测"
+1 -1
View File
@@ -3,7 +3,7 @@ config flowproxy 'global'
option tcp_enabled '1' option tcp_enabled '1'
option udp_enabled '1' option udp_enabled '1'
option proxy_server_ip_addr '' option proxy_server_ip_addr ''
option interface 'br-lan' option interface 'auto'
option traffic_mark '0x666' option traffic_mark '0x666'
option routing_table '888' option routing_table '888'
option rule_priority '1000' option rule_priority '1000'
@@ -6,7 +6,20 @@
enabled=$(uci -q get flowproxy.global.enabled || echo 0) enabled=$(uci -q get flowproxy.global.enabled || echo 0)
[ "$enabled" = "1" ] || exit 0 [ "$enabled" = "1" ] || exit 0
target_iface=$(uci -q get flowproxy.global.interface || echo "br-lan") proxy_ip=$(uci -q get flowproxy.global.proxy_server_ip_addr)
[ -n "$proxy_ip" ] || exit 0
target_iface=""
if [ -f "/var/run/flowproxy.mark" ]; then
target_iface=$(cut -d':' -f4 /var/run/flowproxy.mark 2>/dev/null)
fi
if [ -z "$target_iface" ]; then
target_iface=$(uci -q get flowproxy.global.interface)
if [ -z "$target_iface" ] || [ "$target_iface" = "auto" ]; then
target_iface=$(ip route get "$proxy_ip" 2>/dev/null | awk '{for(i=1;i<=NF;i++) if($i=="dev") {print $(i+1); exit}}')
fi
fi
target_iface="${target_iface:-br-lan}"
if [ "$DEVICE" = "$target_iface" ] || [ "$INTERFACE" = "$target_iface" ]; then if [ "$DEVICE" = "$target_iface" ] || [ "$INTERFACE" = "$target_iface" ]; then
[ -x /etc/init.d/flowproxy ] && /etc/init.d/flowproxy add_route [ -x /etc/init.d/flowproxy ] && /etc/init.d/flowproxy add_route
+68 -24
View File
@@ -126,10 +126,14 @@ apply_nft_rules() {
FLOWPROXY_LOG_LEVEL="$conf_level" "$GENERATE_SCRIPT" >/dev/null 2> "$err_file" FLOWPROXY_LOG_LEVEL="$conf_level" "$GENERATE_SCRIPT" >/dev/null 2> "$err_file"
local ret=$? local ret=$?
# 将脚本的输出记录到日志 # 将脚本的输出记录到日志:成功时按 debug 输出,失败时按 error 输出
if [ -s "$err_file" ]; then if [ -s "$err_file" ]; then
while read -r line; do while read -r line; do
log_msg debug "Script: $line" if [ $ret -eq 0 ]; then
log_msg debug "Script: $line"
else
log_msg error "Generator: $line"
fi
done < "$err_file" done < "$err_file"
rm -f "$err_file" rm -f "$err_file"
fi fi
@@ -138,14 +142,16 @@ apply_nft_rules() {
log_msg info "Applying nftables rules from $NFT_CONF" log_msg info "Applying nftables rules from $NFT_CONF"
# 确保内核支持 inet 表 # 确保内核支持 inet 表
nft delete table inet flowproxy 2>/dev/null nft delete table inet flowproxy 2>/dev/null
if nft -f "$NFT_CONF"; then local nft_err
nft_err=$(nft -f "$NFT_CONF" 2>&1)
if [ $? -eq 0 ]; then
return 0 return 0
else else
log_msg error "nftables rules application failed (syntax error)" log_msg error "nftables rules application failed: $nft_err"
return 1 return 1
fi fi
else else
log_msg error "Failed to generate nftables config" log_msg error "Failed to generate nftables config (exit code: $ret)"
return 1 return 1
fi fi
else else
@@ -154,12 +160,26 @@ apply_nft_rules() {
fi fi
} }
get_proxy_interface() {
local proxy_ip="$1"
local cfg_iface=$(uci -q get "$UCI_CONFIG.global.interface")
if [ -n "$cfg_iface" ] && [ "$cfg_iface" != "auto" ]; then
echo "$cfg_iface"
return
fi
local auto_dev=""
if [ -n "$proxy_ip" ]; then
auto_dev=$(ip route get "$proxy_ip" 2>/dev/null | awk '{for(i=1;i<=NF;i++) if($i=="dev") {print $(i+1); exit}}')
fi
echo "${auto_dev:-br-lan}"
}
add_route() { add_route() {
check_config || return 1 check_config || return 1
local proxy_server_ip_addr=$(uci -q get "$UCI_CONFIG.global.proxy_server_ip_addr") local proxy_server_ip_addr=$(uci -q get "$UCI_CONFIG.global.proxy_server_ip_addr")
local interface=$(uci -q get "$UCI_CONFIG.global.interface") local interface=$(get_proxy_interface "$proxy_server_ip_addr")
interface="${interface:-br-lan}"
local traffic_mark=$(uci -q get "$UCI_CONFIG.global.traffic_mark") local traffic_mark=$(uci -q get "$UCI_CONFIG.global.traffic_mark")
traffic_mark="${traffic_mark:-0x666}" traffic_mark="${traffic_mark:-0x666}"
local routing_table=$(uci -q get "$UCI_CONFIG.global.routing_table") local routing_table=$(uci -q get "$UCI_CONFIG.global.routing_table")
@@ -170,23 +190,30 @@ add_route() {
# 1. 先尝试用旧记录清理一次,防止由于配置变更导致的残留 # 1. 先尝试用旧记录清理一次,防止由于配置变更导致的残留
delete_route "quiet" delete_route "quiet"
log_msg info "Setting up routing table $routing_table and rule for mark $traffic_mark with priority $rule_priority..." log_msg info "Setting up routing table $routing_table (dev: $interface) and rule for mark $traffic_mark with priority $rule_priority..."
# 2. 记录当前使用的标记值、路由表 ID 和优先级 # 2. 记录当前使用的标记值、路由表 ID、优先级和实际出口网卡
echo "$traffic_mark:$routing_table:$rule_priority" > "/var/run/flowproxy.mark" echo "$traffic_mark:$routing_table:$rule_priority:$interface" > "/var/run/flowproxy.mark"
# 3. 再次确保新标记和表的规则是干净的 # 3. 再次确保新标记和表的规则是干净的
while ip rule del fwmark "$traffic_mark" lookup "$routing_table" 2>/dev/null; do :; done while ip rule del fwmark "$traffic_mark" lookup "$routing_table" 2>/dev/null; do :; done
ip route flush table "$routing_table" 2>/dev/null ip route flush table "$routing_table" 2>/dev/null
# 4. 添加路由和策略 # 4. 添加路由和策略
local err local route_err rule_err
ip route add default via "$proxy_server_ip_addr" dev "$interface" table "$routing_table" 2>/dev/null route_err=$(ip route add default via "$proxy_server_ip_addr" dev "$interface" table "$routing_table" 2>&1)
err=$(ip rule add fwmark "$traffic_mark" lookup "$routing_table" priority "$rule_priority" 2>&1) if [ $? -ne 0 ]; then
log_msg error "Failed to add default route to table $routing_table via $proxy_server_ip_addr (dev: $interface): $route_err"
log_msg error "Proxy server IP $proxy_server_ip_addr is unreachable or has no valid route on interface $interface"
return 1
fi
rule_err=$(ip rule add fwmark "$traffic_mark" lookup "$routing_table" priority "$rule_priority" 2>&1)
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
log_msg info "Route added: via $proxy_server_ip_addr dev $interface table $routing_table for mark $traffic_mark with priority $rule_priority" log_msg info "Route added: via $proxy_server_ip_addr dev $interface table $routing_table for mark $traffic_mark with priority $rule_priority"
else else
log_msg error "Failed to add ip rule: $err" log_msg error "Failed to add ip rule: $rule_err"
return 1
fi fi
# 5. 禁用目标网卡的 ICMP 重定向通告,防止客户端绕行或 TCP 连接挂起 # 5. 禁用目标网卡的 ICMP 重定向通告,防止客户端绕行或 TCP 连接挂起
@@ -201,12 +228,13 @@ delete_route() {
local quiet="$1" local quiet="$1"
# 1. 获取两组清理目标:旧值(记录文件) 和 新值(当前UCI) # 1. 获取两组清理目标:旧值(记录文件) 和 新值(当前UCI)
local old_mark="" old_table="" old_prio="" local old_mark="" old_table="" old_prio="" old_iface=""
if [ -f "/var/run/flowproxy.mark" ]; then if [ -f "/var/run/flowproxy.mark" ]; then
local saved_val=$(cat "/var/run/flowproxy.mark") local saved_val=$(cat "/var/run/flowproxy.mark")
old_mark=$(echo "$saved_val" | cut -d':' -f1) old_mark=$(echo "$saved_val" | cut -d':' -f1)
old_table=$(echo "$saved_val" | cut -d':' -f2) old_table=$(echo "$saved_val" | cut -d':' -f2)
old_prio=$(echo "$saved_val" | cut -d':' -f3) old_prio=$(echo "$saved_val" | cut -d':' -f3)
old_iface=$(echo "$saved_val" | cut -d':' -f4)
[ "$quiet" != "quiet" ] && rm -f "/var/run/flowproxy.mark" [ "$quiet" != "quiet" ] && rm -f "/var/run/flowproxy.mark"
fi fi
@@ -216,8 +244,7 @@ delete_route() {
curr_table="${curr_table:-888}" curr_table="${curr_table:-888}"
local curr_prio=$(uci -q get "$UCI_CONFIG.global.rule_priority") local curr_prio=$(uci -q get "$UCI_CONFIG.global.rule_priority")
curr_prio="${curr_prio:-1000}" curr_prio="${curr_prio:-1000}"
local curr_iface=$(uci -q get "$UCI_CONFIG.global.interface") local curr_iface=$(get_proxy_interface "$(uci -q get "$UCI_CONFIG.global.proxy_server_ip_addr")")
curr_iface="${curr_iface:-br-lan}"
[ "$quiet" != "quiet" ] && log_msg info "Cleaning up FlowProxy routes (Atomic Mode)..." [ "$quiet" != "quiet" ] && log_msg info "Cleaning up FlowProxy routes (Atomic Mode)..."
@@ -249,9 +276,10 @@ delete_route() {
safe_del_rule "$curr_mark" "$curr_table" "$curr_prio" safe_del_rule "$curr_mark" "$curr_table" "$curr_prio"
# 恢复 ICMP 重定向通告 # 恢复 ICMP 重定向通告
if [ -d "/proc/sys/net/ipv4/conf/$curr_iface" ]; then [ -n "$old_iface" ] && [ -d "/proc/sys/net/ipv4/conf/$old_iface" ] && \
sysctl -w "net.ipv4.conf.$old_iface.send_redirects=1" >/dev/null 2>&1
[ -n "$curr_iface" ] && [ "$curr_iface" != "$old_iface" ] && [ -d "/proc/sys/net/ipv4/conf/$curr_iface" ] && \
sysctl -w "net.ipv4.conf.$curr_iface.send_redirects=1" >/dev/null 2>&1 sysctl -w "net.ipv4.conf.$curr_iface.send_redirects=1" >/dev/null 2>&1
fi
} }
delete_nft() { delete_nft() {
@@ -320,10 +348,14 @@ start_service() {
if [ "$enabled" -eq 0 ]; then if [ "$enabled" -eq 0 ]; then
log_msg info "FlowProxy is disabled, ensuring service is stopped" log_msg info "FlowProxy is disabled, ensuring service is stopped"
[ -x /etc/init.d/flowproxy ] && /etc/init.d/flowproxy disable 2>/dev/null
stop_service stop_service
return 0 return 0
fi fi
# 状态自愈:当 enabled=1 时,确保服务已在 rc.d 中 enable,防止 luci-reload 因未启用而静默跳过执行
[ -x /etc/init.d/flowproxy ] && /etc/init.d/flowproxy enable 2>/dev/null
log_msg info "Starting FlowProxy..." log_msg info "Starting FlowProxy..."
check_env || return 1 check_env || return 1
@@ -331,11 +363,15 @@ start_service() {
local proxy_server_ip_addr=$(uci -q get "$UCI_CONFIG.global.proxy_server_ip_addr") local proxy_server_ip_addr=$(uci -q get "$UCI_CONFIG.global.proxy_server_ip_addr")
local proxy_server_dns_port=$(uci -q get "$UCI_CONFIG.global.proxy_server_dns_port" || echo 5353) local proxy_server_dns_port=$(uci -q get "$UCI_CONFIG.global.proxy_server_dns_port" || echo 5353)
local interface=$(uci -q get "$UCI_CONFIG.global.interface" || echo "br-lan") local interface=$(get_proxy_interface "$proxy_server_ip_addr")
probe_proxy_server "$proxy_server_ip_addr" "$proxy_server_dns_port" "$interface" probe_proxy_server "$proxy_server_ip_addr" "$proxy_server_dns_port" "$interface"
apply_nft_rules || return 1 apply_nft_rules || return 1
add_route if ! add_route; then
log_msg error "Routing setup failed, aborting and cleaning up service..."
stop_service
return 1
fi
setup_dns setup_dns
touch "$STATE_FILE" touch "$STATE_FILE"
@@ -344,6 +380,10 @@ start_service() {
stop_service() { stop_service() {
log_msg info "Stopping FlowProxy..." log_msg info "Stopping FlowProxy..."
local enabled=$(uci -q get "$UCI_CONFIG.global.enabled" || echo 0)
if [ "$enabled" -eq 0 ]; then
[ -x /etc/init.d/flowproxy ] && /etc/init.d/flowproxy disable 2>/dev/null
fi
# 强制先移除标记,防止状态误报 # 强制先移除标记,防止状态误报
rm -f "$STATE_FILE" rm -f "$STATE_FILE"
delete_route delete_route
@@ -368,7 +408,11 @@ service_triggers() {
procd_add_reload_trigger "$UCI_CONFIG" procd_add_reload_trigger "$UCI_CONFIG"
# 监听防火墙重载事件,防止规则被 fw4 清空后无法自动恢复 # 监听防火墙重载事件,防止规则被 fw4 清空后无法自动恢复
procd_add_reload_trigger "firewall" procd_add_reload_trigger "firewall"
# 监听网络接口事件 # 监听网络接口事件(procd trigger 需接收 UCI 逻辑网络名,如 lan/wan)
local iface=$(uci -q get "$UCI_CONFIG.global.interface" || echo "br-lan") local dev=$(get_proxy_interface "$(uci -q get "$UCI_CONFIG.global.proxy_server_ip_addr")")
procd_add_reload_interface_trigger "$iface" local net_name=""
if command -v ubus >/dev/null 2>&1 && [ -n "$dev" ]; then
net_name=$(ubus call network.interface dump 2>/dev/null | jsonfilter -e "@.interface[@.device=\"$dev\"].interface" -e "@.interface[@.l3_device=\"$dev\"].interface" 2>/dev/null | head -n 1)
fi
procd_add_reload_interface_trigger "${net_name:-lan}"
} }
@@ -0,0 +1,23 @@
#!/bin/sh
[ ! -f "/usr/share/ucitrack/luci-app-flowproxy.json" ] && {
cat > /usr/share/ucitrack/luci-app-flowproxy.json << EEOF
{
"config": "flowproxy",
"init": "flowproxy"
}
EEOF
}
uci -q batch <<-EOF >/dev/null
delete ucitrack.@flowproxy[-1]
add ucitrack flowproxy
set ucitrack.@flowproxy[-1].init=flowproxy
commit ucitrack
EOF
/etc/init.d/flowproxy enabled || /etc/init.d/flowproxy enable 2>/dev/null
rm -f /tmp/luci-indexcache* 2>/dev/null
rm -f /tmp/luci-modulecache/* 2>/dev/null
exit 0
@@ -178,14 +178,63 @@ TCP_ENABLED=$(uci -q get "$CONFIG.global.tcp_enabled" || echo "1")
UDP_ENABLED=$(uci -q get "$CONFIG.global.udp_enabled" || echo "1") UDP_ENABLED=$(uci -q get "$CONFIG.global.udp_enabled" || echo "1")
TRAFFIC_MARK=$(uci -q get "$CONFIG.global.traffic_mark" || echo "0x666") TRAFFIC_MARK=$(uci -q get "$CONFIG.global.traffic_mark" || echo "0x666")
PROXY_SERVER_IP_ADDR=$(uci -q get "$CONFIG.global.proxy_server_ip_addr") PROXY_SERVER_IP_ADDR=$(uci -q get "$CONFIG.global.proxy_server_ip_addr")
INTERFACE=$(uci -q get "$CONFIG.global.interface") get_lan_devices() {
[ -z "$INTERFACE" ] && INTERFACE="br-lan" local dev="" devs="" nets=""
local z_idx=0
while :; do
local z_name=$(uci -q get firewall.@zone[$z_idx].name)
[ -z "$z_name" ] && break
if [ "$z_name" = "lan" ]; then
nets=$(uci -q get firewall.@zone[$z_idx].network)
break
fi
z_idx=$((z_idx + 1))
done
[ -z "$nets" ] && nets="lan"
for net in $nets; do
dev=""
if command -v ubus >/dev/null 2>&1; then
dev=$(ubus call network.interface."$net" status 2>/dev/null | jsonfilter -e "@.l3_device" 2>/dev/null)
[ -z "$dev" ] && dev=$(ubus call network.interface."$net" status 2>/dev/null | jsonfilter -e "@.device" 2>/dev/null)
fi
[ -z "$dev" ] && dev=$(uci -q get network."$net".device || uci -q get network."$net".device)
if [ -n "$dev" ]; then
case " $devs " in
*" $dev "*) ;;
*) devs="${devs}${devs:+ }$dev" ;;
esac
fi
done
echo "${devs:-br-lan}"
}
render_nft_lan_filter() {
local devs="$1"
set -- $devs
local count=$#
if [ "$count" -le 1 ]; then
echo " iifname != \"$1\" return"
else
local set_str=""
for d in "$@"; do
[ -n "$set_str" ] && set_str="${set_str}, "
set_str="${set_str}\"${d}\""
done
echo " iifname != { $set_str } return"
fi
}
LAN_DEVICES=$(get_lan_devices)
LAN_NFT_FILTER=$(render_nft_lan_filter "$LAN_DEVICES")
if [ "$TCP_ENABLED" = "1" ]; then if [ "$TCP_ENABLED" = "1" ]; then
cat >> "$OUTPUT_FILE" << EOF cat >> "$OUTPUT_FILE" << EOF
chain LAN_MARKFLOW_TCP { chain LAN_MARKFLOW_TCP {
type filter hook prerouting priority mangle; policy accept; type filter hook prerouting priority mangle; policy accept;
iifname != "$INTERFACE" return $LAN_NFT_FILTER
fib daddr type { unspec, local, anycast, multicast } counter return fib daddr type { unspec, local, anycast, multicast } counter return
EOF EOF
if [ -n "$PROXY_SERVER_IP_ADDR" ]; then if [ -n "$PROXY_SERVER_IP_ADDR" ]; then
@@ -201,7 +250,7 @@ if [ "$UDP_ENABLED" = "1" ]; then
cat >> "$OUTPUT_FILE" << EOF cat >> "$OUTPUT_FILE" << EOF
chain LAN_MARKFLOW_UDP { chain LAN_MARKFLOW_UDP {
type filter hook prerouting priority mangle; policy accept; type filter hook prerouting priority mangle; policy accept;
iifname != "$INTERFACE" return $LAN_NFT_FILTER
fib daddr type { unspec, local, anycast, multicast } counter return fib daddr type { unspec, local, anycast, multicast } counter return
EOF EOF
if [ -n "$PROXY_SERVER_IP_ADDR" ]; then if [ -n "$PROXY_SERVER_IP_ADDR" ]; then
+1 -1
View File
@@ -12,7 +12,7 @@ LUCI_DEPENDS:=+luci-base +logd +jsonfilter
LUCI_PKGARCH:=all LUCI_PKGARCH:=all
PKG_VERSION:=0.1.51 PKG_VERSION:=0.1.51
PKG_RELEASE:=61 PKG_RELEASE:=62
# Reproducible build: honor SOURCE_DATE_EPOCH from the build environment (set by docker-sdk.sh / CI). # Reproducible build: honor SOURCE_DATE_EPOCH from the build environment (set by docker-sdk.sh / CI).
ifdef SOURCE_DATE_EPOCH ifdef SOURCE_DATE_EPOCH
+1 -1
View File
@@ -29,7 +29,7 @@ LuCI **Firewall Live View** — client-side JS view polling `ubus fwlive poll` (
| `root/usr/libexec/fwlive-adaptive-cap.sh` | Layer 1 adaptive poll cap (sourced by `rpcd/fwlive`) | | `root/usr/libexec/fwlive-adaptive-cap.sh` | Layer 1 adaptive poll cap (sourced by `rpcd/fwlive`) |
| `root/usr/libexec/fwlive-logging.sh` | WAN zone logging helpers | | `root/usr/libexec/fwlive-logging.sh` | WAN zone logging helpers |
| `root/lib/upgrade/keep.d/luci-app-fwlive` | Keep `/etc/fwlive/` across sysupgrade | | `root/lib/upgrade/keep.d/luci-app-fwlive` | Keep `/etc/fwlive/` across sysupgrade |
| `/etc/fwlive/wan-log-baseline` | Written on first **Enable logging** (and best-effort on already-on enable with no baseline file, recording the current mask with fwlive's filter-log bit cleared); `prerm` restores it on uninstall. A successful disable/reload, including an already-disabled retry, drops the marker when no later fwlive toggle has taken ownership; this preserves operator changes to other log-mask bits, including staged edits. If logging is already off but the marker remains, Disable retries `fw4 reload`; pending UCI changes return `firewall_changes_pending` without reloading, and reload failure returns `firewall_reload_failed` while retaining the marker. Lock, read, or generation mismatch also keeps it for uninstall recovery. Restore is skipped (file kept; `fwlive` syslog only) when there is no WAN zone, the lock is unavailable, firewall changes are pending, the commit does not verify, reload fails, or the value after reload does not match the baseline. Disable of a pre-existing/foreign log bit is not snapshotted, so uninstall will not restore that bit. | | `/etc/fwlive/wan-log-baseline` | Written on first **Enable logging** (and best-effort on already-on enable with no baseline file, recording the current mask with fwlive's filter-log bit cleared); `prerm` restores it on uninstall. A successful disable/reload, including an already-disabled retry, drops the marker when no later fwlive toggle has taken ownership; this preserves operator changes to other log-mask bits, including staged edits. A disable commit race (`firewall_commit_raced`) is still reported as a failure, but a successful reload also retires the marker because it only tracks fwlive's own toggle. If logging is already off but the marker remains, Disable retries `/etc/init.d/firewall reload`; pending UCI changes return `firewall_changes_pending` without reloading, and reload failure returns `firewall_reload_failed` while retaining the marker. Lock, read, or generation mismatch also keeps it for uninstall recovery. Restore is skipped (file kept; `fwlive` syslog only) when there is no WAN zone, the lock is unavailable, firewall changes are pending, the commit does not verify, reload fails, or the value after reload does not match the baseline. Disable of a pre-existing/foreign log bit is not snapshotted, so uninstall will not restore that bit. |
| `root/usr/libexec/fwlive-log-filter.sh` | Server-side firewall-only filter (`isFirewallEvent` parity) | | `root/usr/libexec/fwlive-log-filter.sh` | Server-side firewall-only filter (`isFirewallEvent` parity) |
| `root/usr/libexec/fwlive-is-firewall-event.sh` | Shared filter logic (sourced by filter + tests) | | `root/usr/libexec/fwlive-is-firewall-event.sh` | Shared filter logic (sourced by filter + tests) |
| `root/usr/libexec/fwlive-is-firewall-event.awk` | **Generated** standalone classifier from `CLASSIFY_SPEC`; loaded by `fwlive-is-firewall-event.sh` | | `root/usr/libexec/fwlive-is-firewall-event.awk` | **Generated** standalone classifier from `CLASSIFY_SPEC`; loaded by `fwlive-is-firewall-event.sh` |
@@ -1045,7 +1045,7 @@ report_wan_log_after_commit() {
return 0 return 0
fi fi
if [ "$_drop_baseline" -eq 1 ]; then if [ "$_drop_baseline" -eq 1 ]; then
drop_wan_log_baseline_after_disable "$zone" "$WAN_LOG_COMMIT_GENERATION" drop_wan_log_baseline_after_disable "$3" "$WAN_LOG_COMMIT_GENERATION"
fi fi
wan_log_error_json "$zone_json" firewall_commit_raced wan_log_error_json "$zone_json" firewall_commit_raced
return 0 return 0
+1 -1
View File
@@ -41,7 +41,7 @@ LUCI_DEPENDS:= \
PKG_NAME:=luci-app-homeproxy-pro PKG_NAME:=luci-app-homeproxy-pro
PKG_VERSION:=28.10.1.14 PKG_VERSION:=28.10.1.14
PKG_RELEASE:=22 PKG_RELEASE:=23
LUCI_BASENAME:=homeproxy-pro LUCI_BASENAME:=homeproxy-pro
@@ -601,6 +601,108 @@ hp_capture_candidate() {
return 0 return 0
} }
# hp_reload_is_noop <run-dir> <good-dir> <client-enabled> <server-enabled>
# 0 when this reload would change nothing that is currently running, so the
# caller can skip the stop;start entirely.
#
# Why this exists: reload_service used to stop and start unconditionally, and
# hp_same_file was only ever used on the rollback path. Measured on the device,
# one reload costs about eight seconds (09:17:40 -> 09:17:48 in the log) and
# interrupts every connection, even when the generated configuration is
# byte-identical to the one already running. That is the common case for
# "Save & Apply" with nothing edited, for a node switch that lands on the same
# node, and for the nightly resource refresh.
#
# THE COMPARISON IS AGAINST known-good, NOT AGAINST THE CANDIDATE, and getting
# that wrong silently disables the whole mechanism. Measured on the device:
# the generator writes straight to $RUN_DIR/sing-box-c.json and
# hp_capture_candidate() copies that same file afterwards, so after a preflight
# the candidate and the live file are the SAME BYTES BY CONSTRUCTION - comparing
# them reports "unchanged" for every reload, including one that switched the main
# node. The first version of this helper did exactly that, and the only reason
# it was caught is an on-device test that switched nodes and watched the PID.
#
# known-good is the right counterpart for the same reason the rollback path uses
# it: hp_promote_known_good writes it ONLY after the health gate has passed, so
# it is by definition "the configuration that is currently running and working".
# live vs known-good answers the question this helper is actually asking - "would
# the running configuration change?" - and a missing known-good simply falls
# through to a real reload.
#
# Every condition is a *precondition for the skip being safe*, and the default
# on any doubt is to reload:
#
# [1] the service is actually running. A live file left over from a crashed
# instance is not a running service, and skipping the restart would
# report success over a dead proxy. Asked of ubus, the same source the
# status page reads.
# [2] the side has both a live file and a known-good copy to compare against.
# A side the user just enabled has neither, and that is a change, not a
# no-op.
# [3] the intercept layer is installed. A released layer (the marker
# hp_release_stale_intercept writes) means the firewall is NOT proxying
# right now even though sing-box is up. Skipping the restart would leave
# it that way and log "nothing to restart" - the exact silent state
# hp_rearm_intercept exists to undo. Reloading is what re-arms it.
hp_reload_is_noop() {
local run_dir="$1"
local good_dir="$2"
local client_enabled="$3"
local server_enabled="$4"
local live good
# [3] first, because it is the cheapest and the most dangerous to skip.
[ ! -f "$run_dir/intercept-released" ] || return 1
# [1] the instances. `command -v ubus` because this module is also sourced
# by the off-target test driver, where ubus does not exist and the honest
# answer there is "cannot prove it is a no-op".
#
# The check is on `"running": true`, NOT on the instance merely appearing
# in the list: procd keeps a stopped instance in `service list` with
# running=false, so matching the key alone reports a dead proxy as running
# and the skip then claims success over it. That was not theoretical - the
# first version of this grep did exactly that and its own test caught it.
command -v ubus > "/dev/null" 2>&1 || return 1
local svc_list
svc_list="$(ubus call service list "{\"name\":\"$CONF\"}" 2>/dev/null)"
if [ "$client_enabled" = "1" ]; then
printf '%s' "$svc_list" \
| grep -A 3 '"sing-box-c"' \
| grep -q '"running"[[:space:]]*:[[:space:]]*true' || return 1
fi
if [ "$server_enabled" = "1" ]; then
printf '%s' "$svc_list" \
| grep -A 3 '"sing-box-s"' \
| grep -q '"running"[[:space:]]*:[[:space:]]*true' || return 1
fi
# [2] and the byte comparison, per side.
# [2] and the byte comparison, per side, against what is known to be running
# rather than against the candidate (see the note at the top of this
# function - the two are the same bytes by construction).
if [ "$client_enabled" = "1" ]; then
live="$run_dir/sing-box-c.json"
good="$good_dir/sing-box-c.json"
[ -s "$live" ] && [ -s "$good" ] || return 1
cmp -s "$live" "$good" 2>"/dev/null" || return 1
fi
if [ "$server_enabled" = "1" ]; then
live="$run_dir/sing-box-s.json"
good="$good_dir/sing-box-s.json"
[ -s "$live" ] && [ -s "$good" ] || return 1
cmp -s "$live" "$good" 2>"/dev/null" || return 1
fi
return 0
}
# hp_start_generated_config <side> <hp-dir> <run-dir> <good-dir> # hp_start_generated_config <side> <hp-dir> <run-dir> <good-dir>
# The start-path transaction for one side ("c" or "s"): # The start-path transaction for one side ("c" or "s"):
# #
@@ -248,15 +248,41 @@ check_list_update() {
# china_ip4.json exists: one list with two readers, and nothing for # china_ip4.json exists: one list with two readers, and nothing for
# a cold start to download before the inbounds bind. # a cold start to download before the inbounds bind.
# #
# The sed above rewrote the file in place, so this runs after it # Normalise FIRST, generate second - and both inside this branch.
# and sees the cleaned list. `full:` prefixes and anything with a # The order is load-bearing, and it was previously wrong: the sed
# colon are gone by now; what is left is what the helper accepts. # lived in the `case "china_list"` arm, i.e. after this function had
if ucode -S "$SCRIPT_DIR/runtime/domain_ruleset.uc" \ # already returned, so the generator was handed the RAW download.
"$RESOURCES_DIR/$listtype.txt" "$RESOURCES_DIR/china-domain.json" >>"$LOG_PATH" 2>&1; then # That is not a theoretical difference. Upstream ships `full:`
log "[CHINA_LIST] DNS-side rule-set regenerated." # prefixes and the colon-carrying `regexp:` / `keyword:` forms
chown sing-box:sing-box "$RESOURCES_DIR/china-domain.json" 2>"/dev/null" # still in the file - 562 of 111,361 lines in the release measured
# here - and domain_ruleset.uc rejects every entry containing a
# colon, so 554 real domains were dropped from the DNS split and
# the only trace was a "skipped N malformed entries" line naming a
# list that was perfectly well formed.
#
# Not `sed -i`: that form is a busybox/GNU extension, and the same
# script is exercised off-device where a non-busybox sed fails it
# with "invalid command code". Edit through a temp file, the way
# the crontab helper in runtime/service.sh does.
#
# A normalisation that fails does not undo the install - the list
# on disk is the one the upstream commit vouched for, and the
# firewall renders its nft set from that very file. The generator
# is skipped instead, so the DNS side keeps the previous rule-set
# rather than being rebuilt from a list the sed only half-processed.
if sed -e "s/full://g" -e "/:/d" "$RESOURCES_DIR/$listtype.txt" \
> "$RESOURCES_DIR/$listtype.txt.hp-new" \
&& mv -f "$RESOURCES_DIR/$listtype.txt.hp-new" "$RESOURCES_DIR/$listtype.txt"; then
if ucode -S "$SCRIPT_DIR/runtime/domain_ruleset.uc" \
"$RESOURCES_DIR/$listtype.txt" "$RESOURCES_DIR/china-domain.json" >>"$LOG_PATH" 2>&1; then
log "[CHINA_LIST] DNS-side rule-set regenerated."
chown sing-box:sing-box "$RESOURCES_DIR/china-domain.json" 2>"/dev/null"
else
log "[CHINA_LIST] Warning: could not regenerate china-domain.json (list has no usable domain entry?); the DNS side keeps the previous list."
fi
else else
log "[CHINA_LIST] Warning: could not regenerate china-domain.json (list has no usable domain entry?); the DNS side keeps the previous list." rm -f "$RESOURCES_DIR/$listtype.txt.hp-new"
log "[CHINA_LIST] Warning: could not normalise the downloaded list; it is installed as downloaded and the DNS side keeps the previous rule-set."
fi fi
;; ;;
esac esac
@@ -280,10 +306,13 @@ case "$1" in
check_list_update "$1" "Loyalsoldier/v2ray-rules-dat" "release" "gfw.txt" check_list_update "$1" "Loyalsoldier/v2ray-rules-dat" "release" "gfw.txt"
;; ;;
"china_list") "china_list")
# Not `sed -i`: the bare -i form is a busybox/GNU extension, and the same # The `full:` prefixes and the colon-carrying regexp:/keyword: forms are
# script is exercised off-device where a non-busybox sed fails it with # stripped inside check_list_update, BEFORE the DNS-side rule-set is
# "invalid command code". Edit through a temp file, the way the crontab # generated from the list - domain_ruleset.uc rejects any entry containing
# helper in runtime/service.sh does. # a colon, so the order decides whether 554 real domains are in the split
# or silently skipped. See the case branch there; this arm is only the
# list's own upstream coordinates.
#
# The status has to survive the post-processing. As one &&...|| chain it # The status has to survive the post-processing. As one &&...|| chain it
# did not: when check_list_update returned 3 ("already current") or 1 # did not: when check_list_update returned 3 ("already current") or 1
# (fetch failed) the chain short-circuited into `rm -f`, whose status 0 # (fetch failed) the chain short-circuited into `rm -f`, whose status 0
@@ -293,18 +322,7 @@ case "$1" in
# Measured on the device: china_list exited 0 for both the failure and the # Measured on the device: china_list exited 0 for both the failure and the
# up-to-date case, while china_ip4 exited 1 / 3 correctly. # up-to-date case, while china_ip4 exited 1 / 3 correctly.
check_list_update "$1" "Loyalsoldier/v2ray-rules-dat" "release" "direct-list.txt" check_list_update "$1" "Loyalsoldier/v2ray-rules-dat" "release" "direct-list.txt"
rc=$? exit $?
[ "$rc" = "0" ] || exit "$rc"
# 0 means a new list was just installed; strip the `full:` prefixes and the
# colon-carrying entries before anything else reads it.
if sed -e "s/full://g" -e "/:/d" "$RESOURCES_DIR/china_list.txt" > "$RESOURCES_DIR/china_list.txt.hp-new" \
&& mv -f "$RESOURCES_DIR/china_list.txt.hp-new" "$RESOURCES_DIR/china_list.txt"; then
exit 0
fi
rm -f "$RESOURCES_DIR/china_list.txt.hp-new"
log "[CHINA_LIST] Failed to normalise the downloaded list; leaving it as downloaded."
exit 1
;; ;;
*) *)
printf '%s\n' "Usage: $0 <china_ip4 / china_ip6 / gfw_list / china_list>" printf '%s\n' "Usage: $0 <china_ip4 / china_ip6 / gfw_list / china_list>"
@@ -77,10 +77,32 @@ import { Loader } from './config/loader.uc';
* A2: the run performs exactly one uci.commit(). The Repository modules stage * A2: the run performs exactly one uci.commit(). The Repository modules stage
* mutations only. * mutations only.
* *
* UCICONFIG_DIR (homeproxy-pro.uc) is the config *directory* Loader.load() takes, * UCICONFIG_DIR (homeproxy-pro.uc) is the config *directory* this script reads
* and the sandboxed test points it at its own config instead of /etc/config * and writes, and the sandboxed test points it at its own config instead of
* (tests/ucode/test_subscription_updater_runs.sh rewrites that line in * /etc/config (tests/ucode/test_subscription_updater_runs.sh rewrites that
* homeproxy-pro.uc and fails loudly if the rewrite did not apply). */ * line in homeproxy-pro.uc and fails loudly if the rewrite did not apply).
*
* That rewrite is only half the sandbox, and the half that was missing is the
* dangerous one. `cursor()` with no argument is a cursor on the REAL
* /etc/config, not on UCICONFIG_DIR - the constant and the cursor were never
* connected. Measured on the device:
*
* cursor() -> reads infra, config, control, subscription, and the
* four live node sections
* cursor('/tmp/t8cfg') -> reads nothing
*
* So the updater was reading the live configuration whatever the test staged,
* and `uci.commit(uciconfig)` - the one commit this script performs, at the
* end of a successful run - would have written the LIVE /etc/config/homeproxy-pro.
* The committed test only ever drove a run whose fetch failed before that
* commit, which is why nothing had touched the device yet. Any future case
* that lets a fetch succeed would have committed the test's sandbox nodes over
* the user's real configuration.
*
* Hence the same `dir` injection Loader.load() already uses (loader.uc:385):
* the cursor is built on UCICONFIG_DIR, so the constant the test already
* rewrites is finally the thing that decides where both the read and the write
* land. Production is unchanged - UCICONFIG_DIR is /etc/config there. */
const CONFIG_FILE = UCICONFIG_DIR + '/homeproxy-pro'; const CONFIG_FILE = UCICONFIG_DIR + '/homeproxy-pro';
const uciconfig = 'homeproxy-pro'; const uciconfig = 'homeproxy-pro';
@@ -97,7 +119,10 @@ let uci, loaded, sub, routing_mode,
/* Read everything the run needs, under the lock. Read-only: nothing here /* Read everything the run needs, under the lock. Read-only: nothing here
* mutates, so a failure cannot leave a partial state behind. */ * mutates, so a failure cannot leave a partial state behind. */
function load_locked_state() { function load_locked_state() {
uci = cursor(); /* On UCICONFIG_DIR, not on the default. See the note on CONFIG_FILE:
* a bare cursor() here reads - and, at the end of a successful run,
* commits - the live /etc/config, no matter what the test staged. */
uci = cursor(UCICONFIG_DIR);
uci.load(uciconfig); uci.load(uciconfig);
/* The orchestrator used to hold its own /* The orchestrator used to hold its own
@@ -605,6 +605,27 @@ reload_service() {
# same way in the rollback path below. # same way in the rollback path below.
export HP_CANDIDATE_CLIENT HP_CANDIDATE_SERVER export HP_CANDIDATE_CLIENT HP_CANDIDATE_SERVER
# Nothing to do? The candidates are byte-identical to what is already
# running and the running instance is healthy, so the stop;start below
# would interrupt every connection to install a file that is already
# installed. Checked AFTER the preflight, never before: the point is to
# skip a restart, not to skip the validation - a configuration that fails
# `sing-box check` has to be reported as such whether or not it would have
# been a no-op, and the candidate has to exist for anything to compare.
#
# Every "cannot prove it is a no-op" case falls through to the normal
# reload, so the worst outcome of this helper is the behaviour that
# existed before it.
#
# `HP_CANDIDATE_CLIENT` is the same flag the preflight set, so the two
# sides cannot disagree about which configuration is being activated.
if [ "$HP_CANDIDATE_CLIENT" = "1" ] || [ "$HP_CANDIDATE_SERVER" = "1" ]; then
if hp_reload_is_noop "$RUN_DIR" "$GOOD_DIR" "$HP_CANDIDATE_CLIENT" "$HP_CANDIDATE_SERVER"; then
log "Configuration is unchanged and the service is healthy; nothing to restart."
return 0
fi
fi
# Both configurations passed `sing-box check`; now it is safe to restart. # Both configurations passed `sing-box check`; now it is safe to restart.
# start_service owns the rest of the transaction: it proves the instances # start_service owns the rest of the transaction: it proves the instances
# came up and only then records the new known-good, so the previous one # came up and only then records the new known-good, so the previous one
@@ -378,5 +378,122 @@ reset_samples
hp_wait_instance "sing-box-c" "$CFG" 1 hp_wait_instance "sing-box-c" "$CFG" 1
expect "wait_instance (compat): times out when down" "$?" "1" expect "wait_instance (compat): times out when down" "$?" "1"
# --- hp_reload_is_noop -----------------------------------------------------
# The reload short circuit. Every case below is a reason the reload must NOT
# be skipped, which is the direction that matters: a wrong skip reports success
# over a dead or half-installed proxy, while a needless reload only costs the
# eight seconds it was going to cost anyway.
#
# The comparison is live vs known-good. It is NOT candidate vs live: the
# generator writes straight to the live path and hp_capture_candidate copies
# that same file afterwards, so those two are identical by construction and
# comparing them reports "unchanged" for every reload - including one that
# switched the main node. That was a real defect, caught on the device; the
# case below pins the difference so it cannot come back.
#
# The helper reads the filesystem and ubus. ubus is stubbed on PATH so the "is
# the instance running" question has an answer off-target; the absence of that
# stub is itself one of the cases, because an environment where the state
# cannot be established has to fall through to a real reload.
CONF="$WORK/noop"
GOOD="$WORK/noop-known-good"
mkdir -p "$CONF/candidate" "$GOOD"
printf 'running bytes\n' > "$CONF/sing-box-c.json"
printf 'running bytes\n' > "$GOOD/sing-box-c.json"
# The candidate is deliberately identical to the live file: that is what a
# preflight leaves behind, and comparing against it must NOT produce a no-op.
printf 'running bytes\n' > "$CONF/candidate/sing-box-c.json"
mkdir -p "$WORK/noop-bin"
cat > "$WORK/noop-bin/ubus" <<'EOF'
#!/bin/sh
# The service list reply, in the shape the helper greps for.
cat <<JSON
{"homeproxy-pro":{"instances":{"sing-box-c":{"running":true,"pid":1234}}}}
JSON
EOF
chmod +x "$WORK/noop-bin/ubus"
# shellcheck source=/dev/null
. "$RUNTIME/service.sh"
PATH="$WORK/noop-bin:$PATH"
export PATH
hp_reload_is_noop "$CONF" "$GOOD" 1 0
expect "reload_is_noop: live matches known-good, client running, no released intercept" "$?" "0"
# The configuration changed - the one case where a reload is genuinely needed.
# This is the case the candidate-based version got wrong: the candidate is
# updated in lockstep with the live file, so only known-good tells the truth.
printf 'switched node\n' > "$CONF/sing-box-c.json"
printf 'switched node\n' > "$CONF/candidate/sing-box-c.json"
hp_reload_is_noop "$CONF" "$GOOD" 1 0
expect "reload_is_noop: live differs from known-good still reloads" "$?" "1"
expect "reload_is_noop: ...even though candidate matches live byte for byte" \
"$(cmp -s "$CONF/candidate/sing-box-c.json" "$CONF/sing-box-c.json" && echo same)" "same"
printf 'running bytes\n' > "$CONF/sing-box-c.json"
# No known-good copy: the side has never come up healthy, or this is a fresh
# install. "Cannot prove it is a no-op" has to mean reload.
mv "$GOOD/sing-box-c.json" "$GOOD/staged"
hp_reload_is_noop "$CONF" "$GOOD" 1 0
expect "reload_is_noop: no known-good copy still reloads" "$?" "1"
mv "$GOOD/staged" "$GOOD/sing-box-c.json"
# The intercept layer was released: sing-box is up but the LAN is not proxied.
# Skipping here is the silent state hp_rearm_intercept exists to undo.
: > "$CONF/intercept-released"
hp_reload_is_noop "$CONF" "$GOOD" 1 0
expect "reload_is_noop: a released intercept layer still reloads" "$?" "1"
rm -f "$CONF/intercept-released"
# An empty live file is not a running configuration.
: > "$CONF/sing-box-c.json"
hp_reload_is_noop "$CONF" "$GOOD" 1 0
expect "reload_is_noop: an empty live file still reloads" "$?" "1"
printf 'running bytes\n' > "$CONF/sing-box-c.json"
# The instance is not running. A live file left behind by a crashed process is
# not a service, and skipping the restart would report success over a dead
# proxy - so the answer has to come from the running state, not the file.
cat > "$WORK/noop-bin/ubus" <<'EOF'
#!/bin/sh
echo '{"homeproxy-pro":{"instances":{"sing-box-c":{"running":false}}}}'
EOF
chmod +x "$WORK/noop-bin/ubus"
hp_reload_is_noop "$CONF" "$GOOD" 1 0
expect "reload_is_noop: an instance that is not running still reloads" "$?" "1"
# And with no ubus at all the state cannot be established, which has to fall
# through to a real reload rather than guess.
cat > "$WORK/noop-bin/ubus" <<'EOF'
#!/bin/sh
exit 1
EOF
chmod +x "$WORK/noop-bin/ubus"
hp_reload_is_noop "$CONF" "$GOOD" 1 0
expect "reload_is_noop: an unusable ubus still reloads" "$?" "1"
# A server side is judged on its own: a client-only no-op must not let a
# changed server configuration slip through, and an enabled server with no
# known-good copy is a change, not a no-op.
cat > "$WORK/noop-bin/ubus" <<'EOF'
#!/bin/sh
cat <<JSON
{"homeproxy-pro":{"instances":{"sing-box-c":{"running":true},"sing-box-s":{"running":true}}}}
JSON
EOF
chmod +x "$WORK/noop-bin/ubus"
printf 'server v1\n' > "$CONF/sing-box-s.json"
printf 'server v2\n' > "$GOOD/sing-box-s.json"
hp_reload_is_noop "$CONF" "$GOOD" 1 1
expect "reload_is_noop: a changed server side still reloads" "$?" "1"
printf 'server v1\n' > "$GOOD/sing-box-s.json"
hp_reload_is_noop "$CONF" "$GOOD" 1 1
expect "reload_is_noop: both sides matching known-good is a no-op" "$?" "0"
rm -f "$GOOD/sing-box-s.json"
hp_reload_is_noop "$CONF" "$GOOD" 1 1
expect "reload_is_noop: an enabled server with no known-good copy still reloads" "$?" "1"
printf '%d checks, %d failures\n' "$CHECKS" "$FAILURES" printf '%d checks, %d failures\n' "$CHECKS" "$FAILURES"
exit $FAILED exit $FAILED
@@ -79,6 +79,7 @@ cat > "$WORK/bin/uclient-fetch" <<'EOF'
#!/bin/sh #!/bin/sh
url="" url=""
out="" out=""
probe=0
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case "$1" in case "$1" in
-O) out="$2"; shift 2 ;; -O) out="$2"; shift 2 ;;
@@ -87,7 +88,8 @@ while [ $# -gt 0 ]; do
--header=*) shift ;; --header=*) shift ;;
--timeout=*) shift ;; --timeout=*) shift ;;
-T) shift 2 ;; -T) shift 2 ;;
-s|--spider|-q|--quiet|-4|-6) shift ;; -s|--spider) probe=1; shift ;;
-q|--quiet|-4|-6) shift ;;
-*) printf 'uclient-fetch: unrecognized option: %s\n' "${1#-}" >&2 -*) printf 'uclient-fetch: unrecognized option: %s\n' "${1#-}" >&2
printf 'Usage: uclient-fetch [options] <URL>\n' >&2 printf 'Usage: uclient-fetch [options] <URL>\n' >&2
exit 1 ;; exit 1 ;;
@@ -107,6 +109,11 @@ case "$url" in
*api.github.com/*/commits*) emit "$(cat "$HP_T_API_COMMITS")" ;; *api.github.com/*/commits*) emit "$(cat "$HP_T_API_COMMITS")" ;;
*api.github.com/*/contents*) emit "$(cat "$HP_T_API_CONTENTS")" ;; *api.github.com/*/contents*) emit "$(cat "$HP_T_API_CONTENTS")" ;;
*) *)
# A spider probe (-s) checks reachability only, and its stdout is captured
# by pick_mirror into $base - so emitting a body here would splice the body
# into the mirror name and every later URL would be nonsense. The real
# applet prints nothing for a probe.
[ "$probe" = "0" ] || exit 0
if [ -n "${HP_T_FETCH_FAIL:-}" ]; then exit 1; fi if [ -n "${HP_T_FETCH_FAIL:-}" ]; then exit 1; fi
emit "$(cat "$HP_T_BODY")" emit "$(cat "$HP_T_BODY")"
;; ;;
@@ -135,10 +142,32 @@ EOF
# ucode: the shipped helper's contract, answered from a control file. An empty # ucode: the shipped helper's contract, answered from a control file. An empty
# control file means "cannot compute" (the helper exits 1 and prints nothing). # control file means "cannot compute" (the helper exits 1 and prints nothing).
#
# It has to tell the two callers apart, because the china_list case below is
# about the ORDER they are called in: resource_blob_sha.uc prints a digest on
# stdout, while the rule-set generators take <source> <destination> and write a
# file. A stub that answered both the same way could not observe whether the
# generator was handed the raw download or the normalised list, which is the
# whole point of that case.
cat > "$WORK/bin/ucode" <<'EOF' cat > "$WORK/bin/ucode" <<'EOF'
#!/bin/sh #!/bin/sh
[ -s "$HP_T_LOCAL_BLOB" ] || exit 1 # -S <script> [args...]
cat "$HP_T_LOCAL_BLOB" script="$2"
case "$script" in
*resource_blob_sha.uc)
[ -s "$HP_T_LOCAL_BLOB" ] || exit 1
cat "$HP_T_LOCAL_BLOB"
;;
*)
# A rule-set generator. Record the CONTENT of the source it was handed,
# not its path: the path is the same file in both the broken and the fixed
# order, so only the content can tell them apart. Copy rather than record
# the name, because the generator runs after the file has been normalised
# and re-reading it later would see the normalised bytes either way.
cat "$3" > "$HP_T_SEEN_SOURCE" 2>/dev/null
exit 0
;;
esac
EOF EOF
# uci/flock are only reached for the token and the lock; both are no-ops here. # uci/flock are only reached for the token and the lock; both are no-ops here.
@@ -190,6 +219,20 @@ printf 'OLDVERSION' > "$WORK/resources/china_ip4.ver"
export HP_T_API_COMMITS="$WORK/api-commits.json" export HP_T_API_COMMITS="$WORK/api-commits.json"
export HP_T_API_CONTENTS="$WORK/api-contents.json" export HP_T_API_CONTENTS="$WORK/api-contents.json"
export HP_T_BODY="$WORK/body.txt" export HP_T_BODY="$WORK/body.txt"
# Where the ucode stub records the source file a rule-set generator was given.
# Not a constant inside the stub: the china_list case has to reset it between
# runs, and a run in which the generator was never called has to be visible as
# an absent file rather than as the previous run's leftover.
export HP_T_SEEN_SOURCE="$WORK/seen-source"
# The digest the ucode stub answers with. Set here as well as inside run_case:
# run_case is invoked in a command substitution, so its own exports die with
# the subshell and any case that does not go through it would find the
# variable unset - which the stub reads as "cannot compute a digest" and the
# script reports as a refusal, i.e. a failure that has nothing to do with what
# the case is testing.
export HP_T_LOCAL_BLOB="$WORK/local-blob"
printf '%s' "$LOCAL_SHA" > "$HP_T_LOCAL_BLOB"
write_contents_json "$LOCAL_SHA"
run_case() { run_case() {
# run_case <local-blob-file-content> <contents-api-sha> # run_case <local-blob-file-content> <contents-api-sha>
@@ -265,6 +308,71 @@ expect "the installed list is untouched" \
expect "it says so in the log" \ expect "it says so in the log" \
"$(grep -c 'already at the latest version' "$WORK/run/homeproxy-pro.log")" "1" "$(grep -c 'already at the latest version' "$WORK/run/homeproxy-pro.log")" "1"
echo "== case 6: china_list is normalised BEFORE the rule-set is generated =="
# The regression this case exists for. Upstream ships the list with `full:`
# prefixes and the colon-carrying regexp:/keyword: forms still in it - 562 of
# 111,361 lines in the release this was measured against - and
# domain_ruleset.uc rejects every entry containing a colon. The sed that
# strips them used to live in the `case "china_list"` arm, i.e. AFTER
# check_list_update had returned, so the generator was handed the raw download
# and 554 real domains were skipped out of the DNS split. The only trace was a
# "skipped N malformed entries" line blaming a perfectly well-formed list.
#
# Asserting the CONTENT the generator received is the only version of this that
# works: both the broken and the fixed order call the generator exactly once
# and exit 0, so a "was it called" assertion passes either way.
reset_state
rm -f "$WORK/resources/china-domain.json" "$HP_T_SEEN_SOURCE"
printf 'stale\n' > "$WORK/resources/china_list.txt"
printf 'OLDVERSION' > "$WORK/resources/china_list.ver"
cat > "$WORK/body.txt" <<'BODY'
plain.example.com
full:prefixed.example.com
regexp:.+\.cn$
keyword:ads
BODY
: > "$WORK/run/homeproxy-pro.log"
rc="$("$RUN_SH" "$WORK/scripts/update_resources.sh" china_list > "$WORK/stdout" 2>&1; echo $?)"
expect "exit status 0" "$rc" "0"
expect "the installed list has no colon left" \
"$(grep -c ':' "$WORK/resources/china_list.txt" || true)" "0"
expect "the bare name survived" \
"$(grep -c '^plain.example.com$' "$WORK/resources/china_list.txt" || true)" "1"
expect "the full: prefix was stripped, not the line dropped" \
"$(grep -c '^prefixed.example.com$' "$WORK/resources/china_list.txt" || true)" "1"
expect "the generator was given the NORMALISED list" \
"$(grep -c 'full:' "$HP_T_SEEN_SOURCE" 2>/dev/null)" "0"
expect "and it was given the un-prefixed name" \
"$(grep -c '^prefixed.example.com$' "$HP_T_SEEN_SOURCE" 2>/dev/null)" "1"
expect "the .ver advanced, so the next run short-circuits" \
"$(cat "$WORK/resources/china_list.ver")" "2026-01-02 $API_SHA"
echo "== case 7: china_list surfaces the helper's failure, not success =="
# The status has to survive: the LuCI button maps rc to a message and
# update_resources_cron.sh reloads the service only on rc 0. A run that
# neither installed nor verified anything must not report either.
reset_state
# china_list has its own installed copy, and case 6 left a real one behind -
# the fixture has to be put back or "untouched" is asserted against case 6's
# output rather than against the pre-update state.
printf 'stale\n' > "$WORK/resources/china_list.txt"
printf 'OLDVERSION' > "$WORK/resources/china_list.ver"
rm -f "$HP_T_SEEN_SOURCE"
: > "$WORK/run/homeproxy-pro.log"
# The digest has to be forced to a MISMATCH for this case: the baseline set
# above matches by default, and a matching digest would install the list and
# exit 0 - the case would then be asserting the happy path under a name that
# says it is testing the refusal.
printf '%s' "$OUTPUT_SHA" > "$HP_T_LOCAL_BLOB"
write_contents_json "$LOCAL_SHA"
expect "a digest mismatch exits non-zero" \
"$("$RUN_SH" "$WORK/scripts/update_resources.sh" china_list > "$WORK/stdout" 2>&1; echo $?)" "1"
expect "the previous list is untouched" \
"$(cat "$WORK/resources/china_list.txt")" "stale"
expect "the .ver is untouched" "$(cat "$WORK/resources/china_list.ver")" "OLDVERSION"
expect "the generator was never called" \
"$([ -e "$HP_T_SEEN_SOURCE" ] && echo yes || echo no)" "no"
printf '%d checks, %d failures\n' "$CHECKS" "$FAILURES" printf '%d checks, %d failures\n' "$CHECKS" "$FAILURES"
if [ "$FAILED" != "0" ]; then if [ "$FAILED" != "0" ]; then
echo "RESOURCE UPDATE TESTS FAILED" echo "RESOURCE UPDATE TESTS FAILED"
@@ -58,6 +58,31 @@ sed -e "s#^export const RUN_DIR = '/var/run/homeproxy-pro';#export const RUN_DIR
-e "s#^export const UCICONFIG_DIR = '/etc/config';#export const UCICONFIG_DIR = '$WORK/cfg';#" \ -e "s#^export const UCICONFIG_DIR = '/etc/config';#export const UCICONFIG_DIR = '$WORK/cfg';#" \
"$ROOT/root/etc/homeproxy-pro/scripts/homeproxy-pro.uc" > "$WORK/scripts/homeproxy-pro.uc" "$ROOT/root/etc/homeproxy-pro/scripts/homeproxy-pro.uc" > "$WORK/scripts/homeproxy-pro.uc"
# validate_data. homeproxy-pro.uc validates a node's address and port by shelling
# out to /sbin/validate_data, which exists only on an OpenWrt target. Without
# it validation() returns false for everything, every node is rejected as
# "Skipping invalid vless node", and the commit case below can never reach the
# commit - it passed on the device (validate_data present) and failed on CI
# (absent), which is exactly the kind of host difference this test must not
# carry.
#
# The substitution is the one the rest of the suite already uses: the same
# HP_VALIDATE_DATA indirection tests/ucode/run.sh exports off-target, and
# tests/ucode/test_generators.sh applies while staging the generator. It
# reproduces the caller's contract (exit 0 = valid) and is deliberately a
# pinned fixture rather than an equivalent - see tests/toolchain/validate-data.sh.
if [ ! -x /sbin/validate_data ] && [ -n "${HP_VALIDATE_DATA:-}" ] && [ -x "${HP_VALIDATE_DATA}" ]; then
sed -e "s#/sbin/validate_data#${HP_VALIDATE_DATA}#g" \
"$WORK/scripts/homeproxy-pro.uc" > "$WORK/scripts/homeproxy-pro.uc.new"
mv -f "$WORK/scripts/homeproxy-pro.uc.new" "$WORK/scripts/homeproxy-pro.uc"
if ! grep -qF "$HP_VALIDATE_DATA" "$WORK/scripts/homeproxy-pro.uc"; then
echo "FAIL: could not point validation() at HP_VALIDATE_DATA (anchor moved)"
rm -rf "$WORK"
exit 1
fi
fi
# An unpatched copy would read - and on a real device write - the live # An unpatched copy would read - and on a real device write - the live
# /etc/config/homeproxy-pro. Fail here instead of silently testing the wrong file. # /etc/config/homeproxy-pro. Fail here instead of silently testing the wrong file.
if ! grep -q "^export const UCICONFIG_DIR = '$WORK/cfg';" "$WORK/scripts/homeproxy-pro.uc"; then if ! grep -q "^export const UCICONFIG_DIR = '$WORK/cfg';" "$WORK/scripts/homeproxy-pro.uc"; then
@@ -66,25 +91,36 @@ if ! grep -q "^export const UCICONFIG_DIR = '$WORK/cfg';" "$WORK/scripts/homepro
exit 1 exit 1
fi fi
# Point the updater's Loader at the sandbox config. Portable sed: write to a # The rewrite above only redirects the *constant*. It does not redirect the
# temp file and rename, so this works under both busybox and BSD sed. # cursor on its own: `cursor()` with no argument is a cursor on the real
# /etc/config, and this script's one `uci.commit()` writes through whichever
# cursor it built. So assert the wiring directly - a bare `cursor()` in the
# updater means the sandbox is a no-op and a case that lets a fetch succeed
# would commit this test's nodes over the user's real configuration.
# #
# The updater resolves the directory through homeproxy-pro.uc's UCICONFIG_DIR (see # The Loader takes the same `dir` argument (loader.uc), so a call carrying the
# the rewrite above), so this step only needs to confirm the staged copy is the # directory is the established spelling, not a test-only accommodation.
# one that was rewritten - it no longer contains a literal config path. if ! grep -q 'cursor(UCICONFIG_DIR)' "$WORK/scripts/update_subscriptions.uc"; then
if ! grep -q "^export const UCICONFIG_DIR = '$WORK/cfg';" "$WORK/scripts/homeproxy-pro.uc"; then echo "FAIL: the updater builds a bare cursor() - it would read and commit the"
echo "FAIL: the staged homeproxy-pro.uc does not point at the sandbox config" echo " live /etc/config regardless of the sandboxed UCICONFIG_DIR."
rm -rf "$WORK" rm -rf "$WORK"
exit 1 exit 1
fi fi
# And prove it behaviourally rather than by reading the source: stage a config
# whose only URL is a closed port, and check the run reports the URL *it* was
# given. A cursor on the real /etc/config would instead see the device's own
# subscription_url and try to reach that one - the difference between this test
# and a test that quietly talks to the user's router.
echo "PASS: the updater's cursor is built on the sandboxed config directory"
cat > "$WORK/cfg/homeproxy-pro" <<-EOF cat > "$WORK/cfg/homeproxy-pro" <<-EOF
config homeproxy-pro 'config' config homeproxy-pro 'config'
option routing_mode 'proxy' option routing_mode 'proxy'
option main_node 'nil' option main_node 'nil'
config homeproxy-pro 'subscription' config homeproxy-pro 'subscription'
list subscription_url 'https://127.0.0.1:1/never' list subscription_url 'https://hp-t8-canary.invalid/never'
option filter_nodes 'disabled' option filter_nodes 'disabled'
option auto_update '0' option auto_update '0'
EOF EOF
@@ -117,6 +153,30 @@ if grep -q "Successfully updated subscriptions" "$LOGFILE" 2>/dev/null; then
FAILED=1 FAILED=1
fi fi
# The behavioural half of the sandbox check, and the one that matters: the run
# above must have been driven by the config staged HERE. A cursor on the real
# /etc/config would read the device's own subscription_url and try to fetch
# that instead, so the log would name a different host - or the run would
# succeed against a subscription this test never asked for. Either way the
# test would be reaching the user's router, which is the whole hazard.
#
# The canary hostname is here so the log can be attributed to THIS config,
# and it is deliberately a name no real subscription would carry. Note what it
# does and does not prove: the URL is read through Loader.load(UCICONFIG_DIR),
# which was already sandboxed, so this assertion is about the READ path and
# says nothing about the cursor the writes go through. The write path is
# asserted structurally below, where it can actually be observed.
#
# `.invalid` is reserved by RFC 2606 and never resolves, so the fetch fails
# fast and the run cannot succeed whatever the DNS.
if grep -q "hp-t8-canary.invalid" "$LOGFILE" 2>/dev/null; then
echo "PASS: the run was driven by the sandboxed config (canary URL was fetched)"
else
echo "FAIL: the log never mentions the staged canary URL - the updater read a"
echo " configuration this test did not write."
FAILED=1
fi
# The run has to keep its own lock fresh for as long as it works: nothing # The run has to keep its own lock fresh for as long as it works: nothing
# refreshed the mtime while the fetch was in progress, so a run slower than # refreshed the mtime while the fetch was in progress, so a run slower than
# LOCK_STALE could have its lock reclaimed as stale and then race the second # LOCK_STALE could have its lock reclaimed as stale and then race the second
@@ -195,6 +255,160 @@ if [ -d "$LOCKDIR" ]; then
FAILED=1 FAILED=1
fi fi
# --- the commit path --------------------------------------------------------
# Everything above runs a fetch that FAILS, which returns before
# `uci.commit(uciconfig)` - so not one of those cases ever exercised the write.
# That is precisely why the bare cursor() went unnoticed: the only dangerous
# line in the script was on a path no test reached.
#
# This case reaches it. The fetch is satisfied by shadowing
# subscription/fetcher.uc through the -L search path, so a real subscription
# body arrives, at least one node survives it, and the run commits. What has
# to be asserted is WHERE: a commit through a bare cursor() writes the live
# /etc/config/homeproxy-pro, on a real device, with this test's node in it.
CANARY_DIR="$WORK/commit-run"
mkdir -p "$CANARY_DIR/scripts" "$CANARY_DIR/cfg" "$CANARY_DIR/run"
cp -R "$WORK/scripts/." "$CANARY_DIR/scripts/"
cp "$WORK/cfg/homeproxy-pro" "$CANARY_DIR/cfg/homeproxy-pro"
# Re-point the copy at ITS OWN directories. `cp -R` of the scripts tree brings
# the sandboxed homeproxy-pro.uc along, and that file still names the parent's
# $WORK/cfg and $WORK/run - so without this the run below reads and COMMITS the
# parent's config, writes its log into the parent's run dir, and the two
# directories this case is about never get touched. The first version of this
# case did exactly that and reported "the commit path is not being exercised"
# against an empty log, which is the symptom rather than the cause.
sed -e "s#^export const RUN_DIR = '$WORK/run';#export const RUN_DIR = '$CANARY_DIR/run';#" \
-e "s#^export const UCICONFIG_DIR = '$WORK/cfg';#export const UCICONFIG_DIR = '$CANARY_DIR/cfg';#" \
"$WORK/scripts/homeproxy-pro.uc" > "$CANARY_DIR/scripts/homeproxy-pro.uc"
for anchor in "RUN_DIR = '$CANARY_DIR/run'" "UCICONFIG_DIR = '$CANARY_DIR/cfg'"; do
if ! grep -qF "$anchor" "$CANARY_DIR/scripts/homeproxy-pro.uc"; then
echo "FAIL: could not re-point the commit sandbox at its own directories"
echo " (anchor moved: $anchor)"
rm -rf "$WORK"
exit 1
fi
done
# The stand-in for the network: one share link, so the count is non-zero and
# main() proceeds to the commit. It shadows the whole fetcher module, so the
# canary URL is never actually dialled.
#
# The body is a JSON object with a `servers` array of share-link STRINGS, which
# is the shape the decoder's own test corpus uses. Two shapes that look
# equivalent are not and both were tried here first: a bare URI list is not
# JSON and falls through to the base64 branch, and a `servers` array of
# OBJECTS decodes but yields no valid node - the run then reports "no valid
# node found" and returns before the commit, which is the failure this case
# exists to rule out.
mkdir -p "$CANARY_DIR/scripts/subscription"
cat > "$CANARY_DIR/scripts/subscription/fetcher.uc" <<'EOF'
export function fetch(url, _ua, log) {
if (url != 'https://hp-t8-canary.invalid/never')
return { content: null, error: 'unexpected url: ' + url };
return {
content: '{"servers":["vless://vless-uuid@o.example.com:443?security=tls&type=ws&host=o.example.com&path=%2Fws&sni=o.example.com#t8-committed-node"]}',
error: null
};
};
EOF
# A successful run reaches the service reload. Every case above avoided it by
# failing first, so nothing ever had to neutralise it - and a test that restarts
# the user's proxy is not a test, it is an outage.
#
# It cannot be intercepted on PATH: the updater calls the ABSOLUTE path
# `/etc/init.d/homeproxy-pro` (update_subscriptions.uc:471), so a stub earlier in
# PATH is never consulted. The staged copy is rewritten instead, which is the
# same trick the RUN_DIR / UCICONFIG_DIR rewrites above already use - and the
# anchor is asserted, because a sed that quietly stopped matching would leave
# this case reloading the real service while still reporting success.
mkdir -p "$CANARY_DIR/bin"
cat > "$CANARY_DIR/bin/homeproxy-pro-reload-stub" <<EOF
#!/bin/sh
printf '%s\n' "\$*" >> "$WORK/reload.log"
exit 0
EOF
chmod +x "$CANARY_DIR/bin/homeproxy-pro-reload-stub"
sed "s#executeCommand('/etc/init.d/homeproxy-pro'#executeCommand('$CANARY_DIR/bin/homeproxy-pro-reload-stub'#" \
"$WORK/scripts/update_subscriptions.uc" > "$CANARY_DIR/scripts/update_subscriptions.uc"
if grep -qF "executeCommand('$CANARY_DIR/bin/homeproxy-pro-reload-stub'" \
"$CANARY_DIR/scripts/update_subscriptions.uc"; then
:
else
echo "FAIL: could not redirect the reload out of the real /etc/init.d"
echo " (anchor moved) - refusing to run a case that would restart the"
echo " service on whatever machine this is running against."
rm -rf "$WORK"
exit 1
fi
# Run it exactly once: a second invocation would commit the same node again and
# make the counts below meaningless.
( cd "$CANARY_DIR/scripts" && ucode -L "$CANARY_DIR/scripts" update_subscriptions.uc ) \
> "$WORK/stdout-commit" 2>&1
if [ -f "$WORK/reload.log" ]; then
echo "PASS: the successful run asked for a reload (through the stub)"
else
echo "FAIL: the commit case never got as far as the reload - the commit path"
echo " is still not being exercised."
sed 's/^/ /' "$WORK/stdout-commit"
FAILED=1
fi
# The run's own log is the commit-run's, not the parent's: the re-point above
# gave this run its own RUN_DIR, and the updater writes nothing to stdout - it
# logs to the file. Reading $LOGFILE here (as a first cut of this case did)
# checks the parent run's log, which still describes the earlier failing fetch,
# so the assertion below was reporting on the wrong run entirely.
COMMIT_LOG="$CANARY_DIR/run/homeproxy-pro.log"
if grep -q "Successfully fetched" "$COMMIT_LOG" 2>/dev/null; then
echo "PASS: the commit run reported a successful import (not a vacuous pass)"
else
echo "FAIL: the commit run never reported a successful fetch - it is not"
echo " exercising the commit path, and the assertion above proves nothing."
sed 's/^/ /' "$COMMIT_LOG" 2>/dev/null
sed 's/^/ /' "$WORK/stdout-commit"
FAILED=1
fi
# The node from the fake body has to be in the SANDBOX config. This is the
# assertion that matters: it is the only one made after a commit, and it reads
# the file the commit was supposed to land in.
#
# The marker is deliberately NOT a substring of the canary hostname. An
# earlier version of this case grepped for "t8-canary", which the staged
# subscription_url already contains - so it passed against a run that had
# committed nothing at all, and would have passed against a commit that landed
# in the wrong file. The node label is the only thing in the sandbox config
# that can only have arrived through a successful import.
if grep -q "t8-committed-node" "$CANARY_DIR/cfg/homeproxy-pro" 2>/dev/null; then
echo "PASS: a successful run committed into the sandboxed config"
else
echo "FAIL: the committed node is not in the sandboxed config - the commit"
echo " went somewhere else, and on a device that is /etc/config/homeproxy-pro."
sed 's/^/ /' "$WORK/stdout-commit"
FAILED=1
fi
# The import has to have happened at all, or the case above is vacuous: a run
# that never reached the commit would leave the same absence. Assert the run
# reported the import rather than only that the file is missing a node.
# And the mirror image: the node must NOT have been invented anywhere else. A
# test that can write outside its sandbox is worse than one that cannot run, so
# this is checked rather than assumed.
if [ -e "$CANARY_DIR/cfg/homeproxy-pro.hp-restore" ]; then
echo "FAIL: the run left a recovery snapshot next to the config it committed"
FAILED=1
fi
rm -rf "$WORK" rm -rf "$WORK"
if [ "$FAILED" != 0 ]; then if [ "$FAILED" != 0 ]; then
+1 -1
View File
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-honk PKG_NAME:=luci-app-honk
PKG_VERSION:=1.1.4 PKG_VERSION:=1.1.4
PKG_RELEASE:=12 PKG_RELEASE:=13
LUCI_TITLE:=LuCI support for honk LUCI_TITLE:=LuCI support for honk
LUCI_PKGARCH:=all LUCI_PKGARCH:=all
File diff suppressed because it is too large. Load diff
@@ -1 +0,0 @@
import{h0 as e,fV as t,dl as a,g7 as n,bs as r,dm as s,fF as o,dx as i,fL as l,h1 as c,go as d,fT as u,h2 as p,dw as f,h3 as g,dy as b,dA as m,dE as h,dF as y,dK as v,gJ as _,dO as w,dP as k,eZ as x,s as S,y as j,at as C,gX as P,W as M,gZ as N,a3 as D,bT as K,h4 as E,L as A,h5 as z,h6 as T,aO as F,g$ as L,h7 as R,g_ as I,h8 as $,h9 as q,ha as O,c8 as G,hb as X,hc as B,aB as V,ab as W,X as U,cO as Y,cn as H,hd as J,fb as Z,R as Q,bF as ee,cZ as te,dQ as ae,c$ as ne,aP as re,bO as se,dR as oe,d0 as ie,d2 as le,d3 as ce,bZ as de,f7 as ue,eP as pe,C as fe,T as ge,he as be,hf as me,hg as he,N as ye,aS as ve,eQ as _e,hh as we,J as ke,eR as xe,hi as Se,eS as je}from"./index-CmbH0woS.js";import{r as Ce,$ as Pe,j as Me}from"./vendor-react-64fcanlc.js";import{c as Ne,d as De,$ as Ke,a as Ee}from"./Select-BcN72K3H.js";function Ae(n,r,s){const{isSelected:o}=r,{isPressed:i,buttonProps:l}=e({...n,onPress:t(r.toggle,n.onPress)},s);return{isPressed:i,isSelected:o,isDisabled:n.isDisabled||!1,buttonProps:a(l,{"aria-pressed":o})}}function ze(e,t,a){let{isDisabled:d}=e,{toolbarProps:u}=function(e,t){const{"aria-label":a,"aria-labelledby":d,orientation:u="horizontal"}=e;let[p,f]=Ce.useState(!1);n(()=>{f(!(!t.current||!t.current.parentElement?.closest('[role="toolbar"]')))});const{direction:g}=r(),b="rtl"===g&&"horizontal"===u;let m=c(t);const h=Ce.useRef(null);return{toolbarProps:{...s(e,{labelable:!0}),role:p?"group":"toolbar","aria-orientation":u,"aria-label":a,"aria-labelledby":null==a?d:void 0,onKeyDownCapture:p?void 0:e=>{if(o(e.currentTarget,i(e))){if("horizontal"===u&&"ArrowRight"===e.key||"vertical"===u&&"ArrowDown"===e.key)b?m.focusPrevious():m.focusNext();else{if(!("horizontal"===u&&"ArrowLeft"===e.key||"vertical"===u&&"ArrowUp"===e.key))return"Tab"===e.key?(h.current=l(),void(e.shiftKey?m.focusFirst():m.focusLast())):void 0;b?m.focusNext():m.focusPrevious()}e.stopPropagation(),e.preventDefault()}},onFocusCapture:p?void 0:e=>{h.current&&!o(e.currentTarget,e.relatedTarget)&&o(t.current,i(e))&&(h.current?.focus(),h.current=null)},onBlurCapture:p?void 0:e=>{o(e.currentTarget,e.relatedTarget)||h.current||(h.current=i(e))}}}}(e,a);return{groupProps:{...u,role:"single"===t.selectionMode?"radiogroup":u.role,"aria-disabled":d}}}function Te(e){let{onMoveStart:t,onMove:a,onMoveEnd:n}=e,r=Ce.useRef({didMove:!1,lastPosition:null,id:null}),{addGlobalListener:s,removeGlobalListener:o}=d(),l=Ce.useCallback((e,n,s,o)=>{0===s&&0===o||(r.current.didMove||(r.current.didMove=!0,t?.({type:"movestart",pointerType:n,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey})),a?.({type:"move",pointerType:n,deltaX:s,deltaY:o,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey}))},[t,a,r]),c=u(l),b=Ce.useCallback((e,t)=>{p(),r.current.didMove&&n?.({type:"moveend",pointerType:t,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey})},[n,r]),m=u(b);return{moveProps:Ce.useMemo(()=>{let e={},t=()=>{g(),r.current.didMove=!1};{let a=e=>{if(e.pointerId===r.current.id){let t=e.pointerType||"mouse";c(e,t,e.pageX-(r.current.lastPosition?.pageX??0),e.pageY-(r.current.lastPosition?.pageY??0)),r.current.lastPosition={pageX:e.pageX,pageY:e.pageY}}},n=e=>{if(e.pointerId===r.current.id){let t=e.pointerType||"mouse";m(e,t),r.current.id=null;let s=f(i(e));o(s,"pointermove",a,!1),o(s,"pointerup",n,!1),o(s,"pointercancel",n,!1)}};e.onPointerDown=e=>{if(0===e.button&&null==r.current.id){t(),e.stopPropagation(),e.preventDefault(),r.current.lastPosition={pageX:e.pageX,pageY:e.pageY},r.current.id=e.pointerId;let o=f(i(e));s(o,"pointermove",a,!1),s(o,"pointerup",n,!1),s(o,"pointercancel",n,!1)}}}let a=(e,a,n)=>{t(),c(e,"keyboard",a,n),m(e,"keyboard")};return e.onKeyDown=e=>{switch(e.key){case"Left":case"ArrowLeft":e.preventDefault(),e.stopPropagation(),a(e,-1,0);break;case"Right":case"ArrowRight":e.preventDefault(),e.stopPropagation(),a(e,1,0);break;case"Up":case"ArrowUp":e.preventDefault(),e.stopPropagation(),a(e,0,-1);break;case"Down":case"ArrowDown":e.preventDefault(),e.stopPropagation(),a(e,0,1)}},e},[s,o,r])}}const Fe=Ce.createContext({}),Le=Ce.createContext(null),Re=Ce.forwardRef(function(e,t){[e,t]=m(e,t,Fe);let n=function(e){let{selectionMode:t="single",disallowEmptySelection:a,isDisabled:n=!1}=e,[r,s]=b(Ce.useMemo(()=>e.selectedKeys?new Set(e.selectedKeys):void 0,[e.selectedKeys]),Ce.useMemo(()=>e.defaultSelectedKeys?new Set(e.defaultSelectedKeys):new Set,[e.defaultSelectedKeys]),e.onSelectionChange);return{selectionMode:t,isDisabled:n,selectedKeys:r,setSelectedKeys:s,toggleKey(e){let n;"multiple"===t?(n=new Set(r),n.has(e)&&(!a||n.size>1)?n.delete(e):n.add(e)):n=new Set(r.has(e)&&!a?[]:[e]),s(n)},setSelected(e,t){t!==r.has(e)&&this.toggleKey(e)}}}(e),{groupProps:r}=ze(e,n,t),o=h({...e,values:{orientation:e.orientation||"horizontal",isDisabled:n.isDisabled,state:n},defaultClassName:"react-aria-ToggleButtonGroup"}),i=s(e,{global:!0});return Pe.createElement(y.div,{...a(i,o,r),ref:t,slot:e.slot||void 0,"dataLine truncated
@@ -1 +1 @@
import{j as r}from"./vendor-react-64fcanlc.js";import{I as a}from"./index-CmbH0woS.js";function o(o){return r.jsx(a,{...o,children:r.jsx("path",{fill:"currentColor",d:"M10 1.5a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17m0 15.5a7 7 0 1 1 0-14 7 7 0 0 1 0 14m3.75-7.75h-3v-3a.75.75 0 0 0-1.5 0v3h-3a.75.75 0 0 0 0 1.5h3v3a.75.75 0 0 0 1.5 0v-3h3a.75.75 0 0 0 0-1.5"})})}export{o as A}; import{j as r}from"./vendor-react-64fcanlc.js";import{I as a}from"./index-ucpAK88B.js";function o(o){return r.jsx(a,{...o,children:r.jsx("path",{fill:"currentColor",d:"M10 1.5a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17m0 15.5a7 7 0 1 1 0-14 7 7 0 0 1 0 14m3.75-7.75h-3v-3a.75.75 0 0 0-1.5 0v3h-3a.75.75 0 0 0 0 1.5h3v3a.75.75 0 0 0 1.5 0v-3h3a.75.75 0 0 0 0-1.5"})})}export{o as A};
@@ -0,0 +1 @@
import{r as e,$ as s,j as l}from"./vendor-react-64fcanlc.js";import{cB as a,cA as n,cD as t,cC as i,fU as r,dZ as c,fV as o,cQ as d,cV as u,d3 as p,d2 as h,cU as b,eW as m,cl as f,fW as x,b7 as j,fX as v,fY as g,cn as C,bw as y,fZ as N,dh as S,f_ as k,di as A,co as P,u as M,b4 as D,f$ as w,bp as L,fr as q,g0 as I,fs as V,dj as H,fu as F,g1 as E,ft as O,T as z,I as B,bg as R,B as T,dV as $}from"./index-ucpAK88B.js";import{a as K,b as U}from"./ItemText-CtNOgl4O.js";const W=e.createContext(null),Z=e.forwardRef(function(e,l){[e,l]=d(e,l,W);let m=e.href&&!e.isDisabled?"a":"span",{linkProps:f,isPressed:x}=function(e,s){let{elementType:l="a",onPress:d,onPressStart:u,onPressEnd:p,onPressChange:h,onClick:b,isDisabled:m,...f}=e,x={};"a"!==l&&(x={role:"link",tabIndex:m?void 0:0});let{focusableProps:j}=a(e,s),{pressProps:v,isPressed:g}=n({onPress:d,onPressStart:u,onPressEnd:p,onPressChange:h,onClick:b,isDisabled:m,ref:s}),C=t(f,{labelable:!0}),y=i(j,v),N=r(),S=c(e);return{isPressed:g,linkProps:i(C,S,{...y,...x,"aria-disabled":m||void 0,"aria-current":e["aria-current"],onClick:s=>{v.onClick?.(s),o(s,N,e.href,e.routerOptions)}})}}({...e,elementType:m},l),j=u[m],{hoverProps:v,isHovered:g}=p(e),{focusProps:C,isFocused:y,isFocusVisible:N}=h(),S=b({...e,defaultClassName:"react-aria-Link",values:{isCurrent:!!e["aria-current"],isDisabled:e.isDisabled||!1,isPressed:x,isHovered:g,isFocused:y,isFocusVisible:N}}),k=t(e,{global:!0});return delete k.onClick,s.createElement(j,{ref:l,slot:e.slot||void 0,...i(k,S,f,v,C),"data-focused":y||void 0,"data-hovered":g||void 0,"data-pressed":x||void 0,"data-focus-visible":N||void 0,"data-current":!!e["aria-current"]||void 0,"data-disabled":e.isDisabled||void 0},S.children)});function _({external:e,layout:s,appearance:a,label:n,className:t,quiet:i,secondary:r,small:c,icon:o,accent:d,negative:u,size:p,...h}){const b="button"===a?m({quiet:i,secondary:r,small:c,icon:o,accent:d,negative:u}):`rp-${a}`,v=f(p);return l.jsx(Z,{target:e?"_blank":void 0,rel:e?"noreferrer":void 0,"aria-label":n,"data-layout":s,"data-size":v,...h,className:a?x(t,e=>j(b,e)):t})}const Q=e=>e>12,X=e=>s=>{if("all"===s)return;const l=[...s][0];null!=l&&e(String(l))};function Y({item:e,children:s,onAction:a}){return l.jsxs(O,{id:e.id,className:"rp-item",textValue:e.label,onAction:a,children:[l.jsx(K,{}),l.jsx(U,{i:e,children:s})]})}function G({children:s,content:a,label:n,quiet:t,small:i,size:r,chevron:c=!0,isDisabled:o,appearance:d,placement:u="bottom end",count:p,onIntent:h}){const b=p?l.jsx("span",{className:"rp-count","aria-hidden":"true",children:p}):null,x=g(o),[j,v]=e.useState(!1),M=f(r),D=e.useRef(null),w=l.jsxs(C,{ref:D,className:d?"rp-select":m({quiet:t,small:i,icon:!c}),"data-size":M,"aria-label":n,"aria-describedby":x?.id,isDisabled:o,onHoverStart:h,onFocus:h,children:[s,b,c&&l.jsx(y,{className:"rp-chev"})]});return l.jsxs(N,{children:[c&&!x?w:l.jsxs(S,{delay:400,isOpen:j,onOpenChange:v,children:[l.jsx(k,{children:l.jsx("span",{className:"rp-tipwrap",tabIndex:o?0:-1,"data-passive":o?void 0:"",onPointerDown:e=>{o&&"touch"===e.pointerType&&v(e=>!e)},children:w})}),l.jsx(A,{triggerRef:D,children:x?.text??n})]}),l.jsx(P,{className:"rp-popover rp-list-popover",placement:u,children:a})]})}function J({label:e,labelledBy:s,sections:a,headers:n=!0,focusedByCaller:t,onAction:i,searchLabel:r,actions:c=[]}){const o="function"==typeof a?a():a,d=!!r&&Q(ee(o)),u=l.jsxs(q,{"aria-label":e,"aria-labelledby":s??"",className:d?"rp-menu-scroll":void 0,autoFocus:!t&&void 0,children:[o.map(e=>l.jsxs(V,{id:e.title,"aria-label":n&&!e.hideHeader?void 0:e.title,selectionMode:e.selectionMode??"single",selectedKeys:[e.value],onSelectionChange:e.onChange&&X(e.onChange),children:[n&&!e.hideHeader&&l.jsx(H,{className:"rp-sec-h",children:e.title}),e.items.map(e=>l.jsx(Y,{item:e,onAction:i&&(()=>i(e.id))},e.id))]},e.title)),c.length>0&&l.jsx(F,{className:"rp-hrule"}),c.map((e,s)=>l.jsx(le,{id:ae(s),...e},e.label))]});return d?l.jsx(E,{label:r,children:u}):u}const ee=e=>e.reduce((e,s)=>e+s.items.length,0);function se(e,s){for(const l of e){const a=l.items.find(e=>e.id===l.value);if(a)return e.length>1&&!l.plain&&a.label!==l.title?s("ui.sectionChoice",{section:l.title,item:a.label}):a.label}return""}const le=({id:e,label:s,icon:a,onAction:n})=>l.jsxs(O,{id:e,className:"rp-item rp-subitem",textValue:s,onAction:n,shouldCloseOnSelect:!0,children:[l.jsx("span",{className:"ic",children:a}),l.jsx(z,{children:s})]}),ae=e=>`/action-${e}`,ne=({id:e,label:s,icon:a,sections:n})=>{const t=M();return l.jsxs(O,{id:e,className:"rp-item rp-subitem",textValue:s,children:[l.jsx("span",{className:"ic",children:a}),l.jsx(z,{children:s}),l.jsxs("span",{className:"desc",children:[se(n,t),l.jsx(y,{className:"rp-chev-end"})]})]})};function te({label:s,submenus:a,actions:n=[]}){const t="function"==typeof a?a():a,i=M(),r=D(w),[c,o]="rtl"===L().direction?["ArrowLeft","ArrowRight"]:["ArrowRight","ArrowLeft"],[{open:d,left:u},p]=e.useState({open:null,left:null}),h=e.useRef(null),Line truncated
@@ -1 +0,0 @@
import{r as e,j as t}from"./vendor-react-64fcanlc.js";import{C as a,E as s,hv as n,fc as l,hw as o}from"./index-CmbH0woS.js";import{u as i,bb as r,bc as c,bd as u,be as h,bf as m,bg as d,bh as p,bi as x}from"./activity-CiEWAlFW.js";import{G as f,C as M}from"./AreaCurve-DQSHOSpG.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./ActionGroup-D3mQjUsw.js";import"./Select-BcN72K3H.js";import"./array-C0VuvQyb.js";const b=[30,60,120,300,600,900,1800,3600,7200,21600,43200,86400].map(e=>1e3*e);function g(t,a){const[s,n]=e.useState([]),l=e.useRef("");return e.useLayoutEffect(()=>{const e=[a,...t].join("\0");if(e===l.current)return;l.current=e;const s=document.createElement("span");s.className="rp-area-tick",Object.assign(s.style,{position:"absolute",top:"-20000px",whiteSpace:"pre"}),document.body.appendChild(s),n(t.map(e=>{s.textContent=e;const{width:t,height:a}=s.getBoundingClientRect();return{width:t,height:a}})),s.remove()},[t,a]),s}function y({label:y,series:v,timestamps:j,fmt:w,locale:k,height:C=150,baseline:D="zero",window:N,fill:S,bare:$=!1,inset:A=2}){const E=a(),L=i(),B=e.useId(),[F,P]=s(Math.round,120),{tip:T,showAt:z,hide:G}=r(),[I,K]=e.useState(null),O=I&&I.index<j.length?I.index:null,R=N?N.until-N.since:j.length?j[j.length-1]-j[0]:0,W=N?.since,H=N?.until,_=e.useMemo(()=>void 0!==W&&void 0!==H?function(e,t){const a=t-e,s=b.find(e=>a/e<=6)??b[b.length-1],n=s>=864e5?6e4*new Date(t).getTimezoneOffset():0,l=[];for(let o=Math.ceil((e-n)/s)*s+n;o<=t;o+=s)o-e>=.04*a&&t-o>=.04*a&&l.push(o);return{ticks:l,step:s}}(W,H):void 0,[W,H]),q=_?_.step<6e4:R<18e4,J=_?_.step>=864e5:R>1296e5,Q=e.useMemo(()=>J?n(k):l(k,q),[k,q,J]),{yDomain:U,yTicks:V}=e.useMemo(()=>{const e=v.flatMap(e=>e.values.filter(e=>null!==e));let t=0,a=(e=>{const t=Math.pow(10,Math.floor(Math.log10(e))),a=e/t;return([1,1.2,1.5,2,2.5,3,4,5,6,8,10].find(e=>a<=e)??10)*t})(1.08*Math.max(1,...e));if("auto"===D&&e.length){const s=Math.min(...e),n=Math.max(...e),l=(e=>{const t=Math.pow(10,Math.floor(Math.log10(Math.max(e,1e-9)))),a=e/t;return(a<=1?.2:a<=2?.5:a<=5?1:2)*t})(Math.max(n-s,.02*n,1));t=Math.max(0,Math.floor(s/l)*l-l),a=Math.ceil(n/l)*l+l}return{yDomain:[t,a],yTicks:"auto"===D?[t,(t+a)/2,a]:[a/2,a]}},[v,D]),X=e.useMemo(()=>{const e=j.length-1;return _?_.ticks:[...new Set((q?[0,Math.round(e/2),e]:[0,Math.round(e/3),Math.round(2*e/3),e]).map(e=>j[e]))]},[_,q,j]),Y=e.useMemo(()=>void 0!==W&&void 0!==H?[W,H]:[Math.min(...j),Math.max(...j)],[W,H,j]),Z=P?.width??0,ee=P?.height??C,te=$?A:20,ae=$?2:8,se=ee-($?2:30),ne=Z-($?A:64),le=e.useMemo(()=>[Math.min(Y[0],...j),Math.max(Y[1],...j)],[Y,j]),oe=e.useCallback(e=>c(e,le,[te,ne]),[le,te,ne]),ie=e.useCallback(e=>c(e,U,[se,ae]),[U,se,ae]),re=e.useMemo(()=>j.map(oe),[j,oe]),ce=e.useMemo(()=>v.map(e=>j.map((t,a)=>null==e.values[a]?null:{x:re[a],y:ie(e.values[a])})),[v,j,re,ie]),ue={x:te,y:ae,width:ne-te,height:se-ae},he=(e,t)=>K({index:e,y:t}),me=()=>{K(null),G()};e.useLayoutEffect(()=>{null!==O&&v.some(e=>null!=e.values[O])?z({x:re[O],y:I?.y??(ae+se)/2,width:Z,bounds:$&&F.current?u(F.current):ue,label:o(k).format(j[O]),lines:v.filter(e=>null!=e.values[O]).sort((e,t)=>e.label<t.label?-1:e.label>t.label?1:0).map(e=>E("ui.valuePair",{label:e.label,value:w(e.values[O])}))}):G()});const de=h(j.length,he,me),pe=e.useMemo(()=>X.map(e=>Q.format(e)),[X,Q]),xe=e.useMemo(()=>V.map(w),[V,w]),fe=g(pe,k),Me=g(xe,k),be=_?m(X.map(oe),fe.map(e=>e.width),0,Z,16,!0):function(e,t,a){const s=a=>[e[a]-(t[a]??0)/2,e[a]+(t[a]??0)/2],n=e.length-1,l=[];let o=1/0;for(let i=n;i>=0;i--){const[t,r]=s(i);r+a>o||i>0&&i<n&&t<s(0)[1]+a||(l.unshift({index:i,position:e[i]}),o=t)}return l}(X.map(oe),fe.map(e=>e.width),8),ge=m(V.map(ie),Me.map(e=>e.height),0,ee,5,!1),ye=[...new Set([...($?V:ge.map(e=>V[e.index])).map(ie),ae,se])];return t.jsx("div",{ref:F,style:{height:C,width:"100%",flex:S?"1 0 auto":void 0,position:"relative"},onPointerLeave:de.onPointerLeave,children:j.length>0&&P&&t.jsxs(t.Fragment,{children:[t.jsx(d,{tip:T}),t.jsxs("svg",{className:"rp-activity-surface",width:Z,height:ee,viewBox:`0 0 ${Z} ${ee}`,style:{display:"block"},role:"application","aria-label":y,tabIndex:0,onFocus:de.onFocus,onBlur:de.onBlur,onKeyDown:de.onKeyDown,onPointerMove:e=>{const{x:t,y:a}=p(e,e.currentTarget,{width:Z,height:ee});if(t<te||t>ne||a<ae||a>se)return void me();const s=x(re,t);he(s,a)},children:[t.jsx("g",{className:"rp-area-grid",children:ye.map(e=>t.jsx("line",{x1:te,x2:ne,y1:e,y2:e,stroke:L["hl-med"],strokeDasharray:"2 4",fill:"none"},e))}),t.jsx("defs",{children:v.map((e,a)=>t.jsx(f,{id:B+a,color:e.color},e.label))}),v.map((e,a)=>t.jsx(M,{points:ce[a],baseline:ie(Math.max(0,U[0])),color:e.color,id:B+a,strokeWidth:2},e.label)),null!==O&&t.jsx("path",{d:`M${re[O]},${ae}L${re[O]},${se}`,stroke:L.subtle,strokeDasharray:"3 3",fill:"none",pointerEvents:"none"}),!$&&t.jsxs(t.Fragment,{children:[t.jsx("g",{children:be.map(({index:e,position:a})=>t.jsx("text",{x:a,y:se+8,className:"rp-area-tick",fill:L.subtle,textAnchor:"middle",children:t.jsx("tspan",{xLine truncated
@@ -0,0 +1 @@
import{r as e,j as t}from"./vendor-react-64fcanlc.js";import{u as a,f as s,g2 as n,dr as o,g3 as l}from"./index-ucpAK88B.js";import{a as i,aW as r,aX as c,aY as u,aZ as h,a_ as m,a$ as p,b0 as d,b1 as x}from"./activity-CbXYXdVY.js";import{G as f,C as M}from"./AreaCurve-DQSHOSpG.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./nodes-DqXrz-fh.js";import"./AppearanceControls-DmbIJj4H.js";import"./ItemText-CtNOgl4O.js";import"./logs-DjZPFUMm.js";import"./Select-2JXPV40Q.js";import"./array-C0VuvQyb.js";const g=[30,60,120,300,600,900,1800,3600,7200,21600,43200,86400].map(e=>1e3*e);function j(t,a){const[s,n]=e.useState([]),o=e.useRef("");return e.useLayoutEffect(()=>{const e=[a,...t].join("\0");if(e===o.current)return;o.current=e;const s=document.createElement("span");s.className="rp-area-tick",Object.assign(s.style,{position:"absolute",top:"-20000px",whiteSpace:"pre"}),document.body.appendChild(s),n(t.map(e=>{s.textContent=e;const{width:t,height:a}=s.getBoundingClientRect();return{width:t,height:a}})),s.remove()},[t,a]),s}function y({label:y,series:b,timestamps:v,fmt:w,locale:k,height:C=150,baseline:D="zero",window:$,fill:N,bare:S=!1,inset:A=2}){const L=a(),T=i(),B=e.useId(),[E,F]=s(Math.round,120),{tip:P,showAt:I,hide:K}=r(),[W,z]=e.useState(null),O=W&&W.index<v.length?W.index:null,R=$?$.until-$.since:v.length?v[v.length-1]-v[0]:0,_=$?.since,G=$?.until,H=e.useMemo(()=>void 0!==_&&void 0!==G?function(e,t){const a=t-e,s=g.find(e=>a/e<=6)??g[g.length-1],n=s>=864e5?6e4*new Date(t).getTimezoneOffset():0,o=[];for(let l=Math.ceil((e-n)/s)*s+n;l<=t;l+=s)l-e>=.04*a&&t-l>=.04*a&&o.push(l);return{ticks:o,step:s}}(_,G):void 0,[_,G]),X=H?H.step<6e4:R<18e4,Y=H?H.step>=864e5:R>1296e5,Z=e.useMemo(()=>Y?n(k):o(k,X),[k,X,Y]),{yDomain:q,yTicks:J}=e.useMemo(()=>{const e=b.flatMap(e=>e.values.filter(e=>null!==e));let t=0,a=(e=>{const t=Math.pow(10,Math.floor(Math.log10(e))),a=e/t;return([1,1.2,1.5,2,2.5,3,4,5,6,8,10].find(e=>a<=e)??10)*t})(1.08*Math.max(1,...e));if("auto"===D&&e.length){const s=Math.min(...e),n=Math.max(...e),o=(e=>{const t=Math.pow(10,Math.floor(Math.log10(Math.max(e,1e-9)))),a=e/t;return(a<=1?.2:a<=2?.5:a<=5?1:2)*t})(Math.max(n-s,.02*n,1));t=Math.max(0,Math.floor(s/o)*o-o),a=Math.ceil(n/o)*o+o}return{yDomain:[t,a],yTicks:"auto"===D?[t,(t+a)/2,a]:[a/2,a]}},[b,D]),Q=e.useMemo(()=>{const e=v.length-1;return H?H.ticks:[...new Set((X?[0,Math.round(e/2),e]:[0,Math.round(e/3),Math.round(2*e/3),e]).map(e=>v[e]))]},[H,X,v]),U=e.useMemo(()=>void 0!==_&&void 0!==G?[_,G]:[Math.min(...v),Math.max(...v)],[_,G,v]),V=F?.width??0,ee=F?.height??C,te=S?A:20,ae=S?2:8,se=ee-(S?2:30),ne=V-(S?A:64),oe=e.useMemo(()=>[Math.min(U[0],...v),Math.max(U[1],...v)],[U,v]),le=e.useCallback(e=>c(e,oe,[te,ne]),[oe,te,ne]),ie=e.useCallback(e=>c(e,q,[se,ae]),[q,se,ae]),re=e.useMemo(()=>v.map(le),[v,le]),ce=e.useMemo(()=>b.map(e=>v.map((t,a)=>null==e.values[a]?null:{x:re[a],y:ie(e.values[a])})),[b,v,re,ie]),ue={x:te,y:ae,width:ne-te,height:se-ae},he=(e,t)=>z({index:e,y:t}),me=()=>{z(null),K()};e.useLayoutEffect(()=>{null!==O&&b.some(e=>null!=e.values[O])?I({x:re[O],y:W?.y??(ae+se)/2,width:V,bounds:S&&E.current?u(E.current):ue,label:l(k).format(v[O]),lines:b.filter(e=>null!=e.values[O]).sort((e,t)=>e.label<t.label?-1:e.label>t.label?1:0).map(e=>L("ui.valuePair",{label:e.label,value:w(e.values[O])}))}):K()});const pe=h(v.length,he,me),de=e.useMemo(()=>Q.map(e=>Z.format(e)),[Q,Z]),xe=e.useMemo(()=>J.map(w),[J,w]),fe=j(de,k),Me=j(xe,k),ge=H?m(Q.map(le),fe.map(e=>e.width),0,V,16,!0):function(e,t,a){const s=a=>[e[a]-(t[a]??0)/2,e[a]+(t[a]??0)/2],n=e.length-1,o=[];let l=1/0;for(let i=n;i>=0;i--){const[t,r]=s(i);r+a>l||i>0&&i<n&&t<s(0)[1]+a||(o.unshift({index:i,position:e[i]}),l=t)}return o}(Q.map(le),fe.map(e=>e.width),8),je=m(J.map(ie),Me.map(e=>e.height),0,ee,5,!1),ye=[...new Set([...(S?J:je.map(e=>J[e.index])).map(ie),ae,se])];return t.jsx("div",{ref:E,style:{height:C,width:"100%",flex:N?"1 0 auto":void 0,position:"relative"},onPointerLeave:pe.onPointerLeave,children:v.length>0&&F&&t.jsxs(t.Fragment,{children:[t.jsx(p,{tip:P}),t.jsxs("svg",{className:"rp-activity-surface",width:V,height:ee,viewBox:`0 0 ${V} ${ee}`,style:{display:"block"},role:"application","aria-label":y,tabIndex:0,onFocus:pe.onFocus,onBlur:pe.onBlur,onKeyDown:pe.onKeyDown,onPointerMove:e=>{const{x:t,y:a}=d(e,e.currentTarget,{width:V,height:ee});if(t<te||t>ne||a<ae||a>se)return void me();const s=x(re,t);he(s,a)},children:[t.jsx("g",{className:"rp-area-grid",children:ye.map(e=>t.jsx("line",{x1:te,x2:ne,y1:e,y2:e,stroke:T["hl-med"],strokeDasharray:"2 4",fill:"none"},e))}),t.jsx("defs",{children:b.map((e,a)=>t.jsx(f,{id:B+a,color:e.color},e.label))}),b.map((e,a)=>t.jsx(M,{points:ce[a],baseline:ie(Math.max(0,q[0])),color:e.color,id:B+a,strokeWidth:2},e.label)),null!==O&&t.jsx("path",{d:`M${re[O]},${ae}L${re[O]},${se}`,stroke:T.subtle,strokeDasharray:"3 3",fill:"none",pointerEvents:"none"}),!S&&t.jsxs(t.Fragment,{children:[t.jsx("g",{children:ge.map(({index:e,position:a})=>t.jsx("text",{x:Line truncated
@@ -1 +1 @@
import{fT as e,gI as t,dl as i,gJ as a,dz as l,gK as s,gL as n,fG as r,fH as o,fJ as d,g7 as c,dv as u,fS as m,fI as f,du as v,dA as p,dB as g,dC as b,dL as h,dM as R,dN as I,dO as M,dP as P,dE as S,dm as y,dF as C,aY as V}from"./index-CmbH0woS.js";import{r as x,$ as E}from"./vendor-react-64fcanlc.js";function $(t,i){const a=x.useRef(!0),l=x.useRef(null);let s=e(t);x.useEffect(()=>(a.current=!0,()=>{a.current=!1}),[]),x.useEffect(()=>{let e=l.current;a.current?a.current=!1:e&&!i.some((t,i)=>!Object.is(t,e[i]))||s(),l.current=i},i)}function D(e,a,l){let{labelProps:s,inputProps:n,descriptionProps:r,errorMessageProps:o,isSelected:d,isPressed:c,isDisabled:u,isReadOnly:m,isInvalid:f,validationErrors:v,validationDetails:p}=t(e,a,l),{isIndeterminate:g}=e;return x.useEffect(()=>{l.current&&(l.current.indeterminate=!!g)}),{labelProps:i(s,x.useMemo(()=>({onMouseDown:e=>e.preventDefault()}),[])),inputProps:n,descriptionProps:r,errorMessageProps:o,isSelected:d,isPressed:c,isDisabled:u,isReadOnly:m,isInvalid:f,validationErrors:v,validationDetails:p}}const B=new WeakMap;var O;function F(e,t){let{getRowText:i=e=>t.collection.getTextValue?.(e)??t.collection.getItem(e)?.textValue}=e,a=o((l=O)&&l.__esModule?l.default:l,"@react-aria/grid");var l;let s=t.selectionManager.rawSelection,n=x.useRef(s),r=x.useCallback(()=>{if(!t.selectionManager.isFocused||s===n.current)return void(n.current=s);let e=k(s,n.current),l=k(n.current,s),r="replace"===t.selectionManager.selectionBehavior,o=[];if(1===t.selectionManager.selectedKeys.size&&r){let e=t.selectionManager.selectedKeys.keys().next().value;if(null!=e&&t.collection.getItem(e)){let t=i(e);t&&o.push(a.format("selectedItem",{item:t}))}}else if(1===e.size&&0===l.size){let t=e.keys().next().value;if(null!=t){let e=i(t);e&&o.push(a.format("selectedItem",{item:e}))}}else if(1===l.size&&0===e.size){let e=l.keys().next().value;if(null!=e&&t.collection.getItem(e)){let t=i(e);t&&o.push(a.format("deselectedItem",{item:t}))}}"multiple"===t.selectionManager.selectionMode&&(0===o.length||"all"===s||s.size>1||"all"===n.current||n.current?.size>1)&&o.push("all"===s?a.format("selectedAll"):a.format("selectedCount",{count:s.size})),o.length>0&&d(o.join(" ")),n.current=s},[s,t.selectionManager.selectedKeys,t.selectionManager.isFocused,t.selectionManager.selectionBehavior,t.selectionManager.selectionMode,t.collection,i,a]);$(()=>{if(!t.selectionManager.isFocused){let e=requestAnimationFrame(r);return()=>cancelAnimationFrame(e)}r()},[s,t.selectionManager.isFocused])}function k(e,t){let i=new Set;if("all"===e||"all"===t)return i;for(let a of e.keys())t.has(a)||i.add(a);return i}function T(e,t){let i=t?.isDisabled,[a,l]=x.useState(!1);return c(()=>{if(e?.current&&!i){let t=()=>{if(e.current){let t=u(e.current,{tabbable:!0});l(!!t.nextNode())}};t();let i=new MutationObserver(t);return i.observe(e.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{i.disconnect()}}}),!i&&a}function w(e){let t=o((i=O)&&i.__esModule?i.default:i,"@react-aria/grid");var i;let a=m(),l=("pointer"===a||"virtual"===a||null==a)&&"undefined"!=typeof window&&"ontouchstart"in window,s=x.useMemo(()=>{let i,a=e.selectionManager.selectionMode,s=e.selectionManager.selectionBehavior;return l&&(i=t.format("longPressToSelect")),"replace"===s&&"none"!==a&&e.hasItemActions?i:void 0},[e.selectionManager.selectionMode,e.selectionManager.selectionBehavior,e.hasItemActions,t,l]);return f(s)}function A(e,t){let{key:i}=e,a=t.selectionManager,l=v(),s=!t.selectionManager.canSelectItem(i),n=t.selectionManager.isSelected(i);var r;return{checkboxProps:{id:l,"aria-label":o((r=O)&&r.__esModule?r.default:r,"@react-aria/grid").format("select"),isSelected:n,isDisabled:s,onChange:()=>a.toggleSelection(i)}}}O={"ar-AE":r,"bg-BG":r,"cs-CZ":r,"da-DK":r,"de-DE":r,"el-GR":r,"en-US":{deselectedItem:e=>`${e.item} not selected.`,select:"Select",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"No items selected",one:()=>`${t.number(e.count)} item selected`,other:()=>`${t.number(e.count)} items selected`})}.`,selectedAll:"All items selected.",selectedItem:e=>`${e.item} selected.`,longPressToSelect:"Long press to enter selection mode."},"es-ES":r,"et-EE":r,"fi-FI":r,"fr-FR":r,"he-IL":r,"hr-HR":r,"hu-HU":r,"it-IT":r,"ja-JP":r,"ko-KR":r,"lt-LT":r,"lv-LV":r,"nb-NO":r,"nl-NL":r,"pl-PL":r,"pt-BR":r,"pt-PT":r,"ro-RO":r,"ru-RU":r,"sk-SK":r,"sl-SI":r,"sr-SP":r,"sv-SE":r,"tr-TR":r,"uk-UA":r,"zh-CN":{deselectedItem:e=>`未选择 ${e.item}。`,longPressToSelect:"长按以进入选择模式。",select:"选择",selectedAll:"已选择所有项目。",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"未选择项目",one:()=>`已选择 ${t.number(e.count)} 个项目`,other:()=>`已选择 ${t.number(e.count)} 个项目`})}。`,selectedItem:e=>`已选择 ${e.item}。`},"zh-TW":{deselectedItem:e=>`未選取「${e.item}」。`,longPressToSelect:"長按以進入選擇模式。",select:"選取",selectedAll:"已選取所有項目。",selectedCount:(e,t)=>Line truncated import{ez as e,g4 as t,cC as i,fj as a,cP as s,g5 as l,g6 as n,em as r,en as o,ep as d,eP as c,cL as u,ey as m,eo as f,cK as v,cQ as p,cR as g,cS as b,c$ as h,d0 as R,d1 as I,d2 as M,d3 as P,cU as y,cD as S,cV as C,aD as V}from"./index-ucpAK88B.js";import{r as x,$ as D}from"./vendor-react-64fcanlc.js";function $(t,i){const a=x.useRef(!0),s=x.useRef(null);let l=e(t);x.useEffect(()=>(a.current=!0,()=>{a.current=!1}),[]),x.useEffect(()=>{let e=s.current;a.current?a.current=!1:e&&!i.some((t,i)=>!Object.is(t,e[i]))||l(),s.current=i},i)}function E(e,a,s){let{labelProps:l,inputProps:n,descriptionProps:r,errorMessageProps:o,isSelected:d,isPressed:c,isDisabled:u,isReadOnly:m,isInvalid:f,validationErrors:v,validationDetails:p}=t(e,a,s),{isIndeterminate:g}=e;return x.useEffect(()=>{s.current&&(s.current.indeterminate=!!g)}),{labelProps:i(l,x.useMemo(()=>({onMouseDown:e=>e.preventDefault()}),[])),inputProps:n,descriptionProps:r,errorMessageProps:o,isSelected:d,isPressed:c,isDisabled:u,isReadOnly:m,isInvalid:f,validationErrors:v,validationDetails:p}}const B=new WeakMap;var O;function k(e,t){let{getRowText:i=e=>t.collection.getTextValue?.(e)??t.collection.getItem(e)?.textValue}=e,a=o((s=O)&&s.__esModule?s.default:s,"@react-aria/grid");var s;let l=t.selectionManager.rawSelection,n=x.useRef(l),r=x.useCallback(()=>{if(!t.selectionManager.isFocused||l===n.current)return void(n.current=l);let e=F(l,n.current),s=F(n.current,l),r="replace"===t.selectionManager.selectionBehavior,o=[];if(1===t.selectionManager.selectedKeys.size&&r){let e=t.selectionManager.selectedKeys.keys().next().value;if(null!=e&&t.collection.getItem(e)){let t=i(e);t&&o.push(a.format("selectedItem",{item:t}))}}else if(1===e.size&&0===s.size){let t=e.keys().next().value;if(null!=t){let e=i(t);e&&o.push(a.format("selectedItem",{item:e}))}}else if(1===s.size&&0===e.size){let e=s.keys().next().value;if(null!=e&&t.collection.getItem(e)){let t=i(e);t&&o.push(a.format("deselectedItem",{item:t}))}}"multiple"===t.selectionManager.selectionMode&&(0===o.length||"all"===l||l.size>1||"all"===n.current||n.current?.size>1)&&o.push("all"===l?a.format("selectedAll"):a.format("selectedCount",{count:l.size})),o.length>0&&d(o.join(" ")),n.current=l},[l,t.selectionManager.selectedKeys,t.selectionManager.isFocused,t.selectionManager.selectionBehavior,t.selectionManager.selectionMode,t.collection,i,a]);$(()=>{if(!t.selectionManager.isFocused){let e=requestAnimationFrame(r);return()=>cancelAnimationFrame(e)}r()},[l,t.selectionManager.isFocused])}function F(e,t){let i=new Set;if("all"===e||"all"===t)return i;for(let a of e.keys())t.has(a)||i.add(a);return i}function w(e,t){let i=t?.isDisabled,[a,s]=x.useState(!1);return c(()=>{if(e?.current&&!i){let t=()=>{if(e.current){let t=u(e.current,{tabbable:!0});s(!!t.nextNode())}};t();let i=new MutationObserver(t);return i.observe(e.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{i.disconnect()}}}),!i&&a}function T(e){let t=o((i=O)&&i.__esModule?i.default:i,"@react-aria/grid");var i;let a=m(),s=("pointer"===a||"virtual"===a||null==a)&&"undefined"!=typeof window&&"ontouchstart"in window,l=x.useMemo(()=>{let i,a=e.selectionManager.selectionMode,l=e.selectionManager.selectionBehavior;return s&&(i=t.format("longPressToSelect")),"replace"===l&&"none"!==a&&e.hasItemActions?i:void 0},[e.selectionManager.selectionMode,e.selectionManager.selectionBehavior,e.hasItemActions,t,s]);return f(l)}function z(e,t){let{key:i}=e,a=t.selectionManager,s=v(),l=!t.selectionManager.canSelectItem(i),n=t.selectionManager.isSelected(i);var r;return{checkboxProps:{id:s,"aria-label":o((r=O)&&r.__esModule?r.default:r,"@react-aria/grid").format("select"),isSelected:n,isDisabled:l,onChange:()=>a.toggleSelection(i)}}}O={"ar-AE":r,"bg-BG":r,"cs-CZ":r,"da-DK":r,"de-DE":r,"el-GR":r,"en-US":{deselectedItem:e=>`${e.item} not selected.`,select:"Select",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"No items selected",one:()=>`${t.number(e.count)} item selected`,other:()=>`${t.number(e.count)} items selected`})}.`,selectedAll:"All items selected.",selectedItem:e=>`${e.item} selected.`,longPressToSelect:"Long press to enter selection mode."},"es-ES":r,"et-EE":r,"fi-FI":r,"fr-FR":r,"he-IL":r,"hr-HR":r,"hu-HU":r,"it-IT":r,"ja-JP":r,"ko-KR":r,"lt-LT":r,"lv-LV":r,"nb-NO":r,"nl-NL":r,"pl-PL":r,"pt-BR":r,"pt-PT":r,"ro-RO":r,"ru-RU":r,"sk-SK":r,"sl-SI":r,"sr-SP":r,"sv-SE":r,"tr-TR":r,"uk-UA":r,"zh-CN":{deselectedItem:e=>`未选择 ${e.item}。`,longPressToSelect:"长按以进入选择模式。",select:"选择",selectedAll:"已选择所有项目。",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"未选择项目",one:()=>`已选择 ${t.number(e.count)} 个项目`,other:()=>`已选择 ${t.number(e.count)} 个项目`})}。`,selectedItem:e=>`已选择 ${e.item}。`},"zh-TW":{deselectedItem:e=>`未選取「${e.item}」。`,longPressToSelect:"長按以進入選擇模式。",select:"選取",selectedAll:"已選取所有項目。",selectedCount:(e,t)=>Line truncated
@@ -0,0 +1 @@
import{r as e,j as r}from"./vendor-react-64fcanlc.js";import{bN as t,gr as o,bM as n,fl as a,bq as c,u as s,df as i,B as l,fr as d,ft as p}from"./index-ucpAK88B.js";import{S as m,a as u,E as f,C as g,b,l as v,c as x,h,d as y,r as k,e as w,f as C,g as j,i as R,j as A,s as E,k as L,t as M,m as N,n as F,o as O,p as S,q as $,u as q,v as B,w as D,x as I,y as T,z as H,D as K,R as V,A as z,B as G,F as U,G as W,H as P,I as J,J as _,K as Q,L as X}from"./vendor-editor-BRV-W12m.js";import{d as Y,s as Z}from"./daeTokens-BVtuNnWZ.js";import{s as ee}from"./nodes-DqXrz-fh.js";import{M as re}from"./AppearanceControls-DmbIJj4H.js";import{A as te,n as oe}from"./logs-DjZPFUMm.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./index-DUM-iwa2.js";import"./ItemText-CtNOgl4O.js";import"./Select-2JXPV40Q.js";const ne=m.define({name:"dae",languageData:{commentTokens:{line:"#"},closeBrackets:{brackets:["(","{","'",'"']}},startState:Z,token:Y}),ae=["global","subscription","node","group","dns","routing"].map(e=>({label:e,type:"keyword"})),ce=n.map(e=>({label:e,type:"property",apply:e+": "})),se=["domain","dip","sip","dport","sport","l4proto","ipversion","pname","mac","dscp","qname","qtype","upstream"].map(e=>({label:e,type:"function",apply:e+"("})),ie=["geosite","geoip","suffix","full","keyword","regex"].map(e=>({label:e,type:"constant",apply:e+":"})),le=o.map(e=>({label:e,type:"constant"})),de=t.map(e=>({label:e,type:"keyword"})),pe=[{label:"fallback",type:"keyword",apply:"fallback: "},{label:"include",type:"keyword",apply:"include "}];function me(e){return u({override:[r=>function(e,r){const t=e.matchBefore(/[\w.-]*/);if(!t)return null;const o=e.state.doc.lineAt(e.pos),n=o.text.slice(0,e.pos-o.from),a=/->\s*[\w.-]*$/.test(n)||/^\s*fallback:\s*[\w.-]*$/.test(n);if(t.from===t.to&&!e.explicit&&!a)return null;const c=e.state.doc.sliceString(0,e.pos),{blocks:s,tokens:i}=ee(c),l=i.at(-1);if(l?.to===e.pos&&("quoted"===l.kind||"comment"===l.kind))return null;const d=s.find(r=>r.close===e.pos)?.name;let p;if(a)p=[...r().map(e=>({label:e.name,apply:e.written,type:"variable"})),...de];else if(/\b(domain|dip|sip|qname)\(\s*[\w.-]*$/.test(n))p=ie;else if(void 0===d)p=ae.map(e=>({...e,apply:(r,t,o,n)=>{const a=e.label+" {\n \n}";r.dispatch({changes:{from:o,to:n,insert:a},selection:{anchor:o+e.label.length+4}})}}));else if("routing"===d||"dns"===d)p=[...se,...pe];else if("global"===d)p=ce;else{if("group"!==d)return null;p=/\bpolicy\s*:\s*[\w.-]*$/.test(n)?le:[...le.map(e=>({...e,apply:"policy: "+e.label})),{label:"filter",type:"property",apply:"filter: "}]}return{from:t.from,options:p,validFor:/^[\w.-]*$/}}(r,e)]})}function ue(e){let r=!1;const t=r=>(r.state.readOnly&&e(),!1);return f.domEventHandlers({keydown:(e,r)=>function(e){return"Backspace"===e.key||"Delete"===e.key||"Enter"===e.key||1===[...e.key].length&&!e.ctrlKey&&!e.metaKey}(e)&&t(r),paste:(e,r)=>t(r),cut:(e,r)=>t(r),pointerdown:e=>(r="touch"===e.pointerType,!1),click:(e,o)=>r&&t(o)})}const fe=[["Completions","cm.completions"],["Find","cm.find"],["Replace","cm.replace"],["next","cm.next"],["previous","cm.previous"],["all","cm.all"],["match case","cm.matchCase"],["regexp","cm.regexp"],["by word","cm.byWord"],["replace","cm.replaceOne"],["replace all","cm.replaceAll"],["close","ui.close"],["Go to line","cm.gotoLine"],["go","cm.go"],["current match","cm.currentMatch"],["replaced $ matches","cm.replacedMatches"],["replaced match on line $","cm.replacedOnLine"],["on line","cm.onLine"],["Selection deleted","cm.selectionDeleted"],["Control character","cm.controlCharacter"]],ge=e=>b.phrases.of(Object.fromEntries(fe.map(([r,t])=>[r,e(t)]))),be=f.theme({"&":{backgroundColor:"var(--rp-base)",color:"var(--rp-text)",border:"1px solid var(--rp-hl-high)",borderRadius:"var(--rp-r-md)",fontSize:"var(--rp-text-sm)"},"&.cm-focused":{outline:"none",borderColor:"var(--rp-text)"},".cm-scroller":{fontFamily:"var(--rp-font-mono)",lineHeight:"var(--rp-line-body)",fontVariantLigatures:"none",borderRadius:"calc(var(--rp-r-md) - 1px)"},".cm-content":{padding:"var(--rp-space-2) 0",caretColor:"var(--rp-text)"},".cm-line":{padding:"0 var(--rp-space-3)"},".cm-gutters":{backgroundColor:"var(--rp-base)",color:"var(--rp-muted)",border:"none"},".cm-lineNumbers .cm-gutterElement":{padding:"0 var(--rp-space-2) 0 var(--rp-space-3)",minWidth:"40px"},".cm-activeLine, .cm-focusLine":{backgroundColor:"color-mix(in srgb, var(--rp-hl-med) 60%, transparent)"},".cm-activeLineGutter":{backgroundColor:"transparent",color:"var(--rp-text)"},".cm-selectionBackground, &.cm-focused .cm-selectionBackground, ::selection":{backgroundColor:"var(--rp-hl-high)"},".cm-cursor":{borderLeftColor:"var(--rp-text)"},".cm-matchingBracket":{backgroundColor:"color-mix(in srgb, var(--rp-accent) 20%, transparent)",outline:"none"},".cm-selectionMatch":{backgroundColor:"color-mix(in srgb, var(--rp-notice) 25%, transparent)"},".cm-gutter-lint":{width:"12px"},".cm-gutter-lint .cm-gutterElement":{padding:"0"},".cm-lint-marker":{width:"8px",height:"8px",marginLine truncated
@@ -1 +0,0 @@
import{r as e,j as s}from"./vendor-react-64fcanlc.js";import{$ as a}from"./Checkbox-f7Je53QZ.js";import{el as r,I as i,d5 as l,cT as n,J as c}from"./index-CmbH0woS.js";function d({label:i,description:l,isSelected:n,onChange:c,isDisabled:d}){const o=e.useId(),t=e.useId();return s.jsxs(a,{className:"rp-radio rp-checkbox",isSelected:n,onChange:c,isDisabled:d,"aria-labelledby":o,"aria-describedby":l?t:void 0,children:[s.jsx("span",{className:"rp-checkbox-mark",children:s.jsx(r,{})}),s.jsxs("span",{className:"rp-radio-text",children:[s.jsx("span",{id:o,children:i}),l&&s.jsx("span",{id:t,className:"rp-note",children:l})]})]})}function o(e){return s.jsx(i,{...e,children:s.jsx("path",{fill:"currentColor",d:"M17.78 1.757C16.51.716 14.555.858 13.33 2.08L3.079 12.334c-.32.32-.559.717-.69 1.15l-1.384 4.584c-.08.265-.007.552.188.747.142.143.334.22.53.22q.11 0 .217-.032l4.582-1.384c.434-.13.832-.368 1.151-.688L18.028 6.575c.648-.647.993-1.545.948-2.46s-.482-1.775-1.195-2.358M2.846 17.163l.98-3.246q.042-.135.113-.257l2.41 2.409q-.123.07-.259.114zM16.966 5.516l-9.525 9.526-2.475-2.476 9.425-9.425c.386-.387.896-.586 1.39-.586.38 0 .752.119 1.05.362.392.321.621.772.646 1.272.025.494-.161.977-.51 1.327"})})}function t({children:e}){return s.jsx("div",{className:"rp-toolbar",children:e})}function h({children:e,negate:a,onNegate:r,negateLabel:i,removeLabel:d,onRemove:o,isDisabled:h,removeDisabled:x}){return s.jsxs(l,{children:[e,s.jsxs(t,{children:[s.jsx(n,{isDisabled:h,isSelected:a,onChange:r,children:i}),s.jsx("span",{className:"rp-grow"}),s.jsx(c,{small:!0,isDisabled:h||x,onPress:o,children:d})]})]})}export{d as C,o as E,h as a,t as b};
@@ -0,0 +1 @@
import{r as s,j as e}from"./vendor-react-64fcanlc.js";import{$ as a}from"./Checkbox-eZH7dxup.js";import{C as r}from"./ItemText-CtNOgl4O.js";import{da as i,I as l,cq as n,ch as c,B as d}from"./index-ucpAK88B.js";function o({label:l,description:n,isSelected:c,onChange:d,isDisabled:o}){const t=s.useId(),h=s.useId(),x=i({isDisabled:o});return e.jsxs(a,{className:"rp-radio rp-checkbox",isSelected:c,onChange:d,isDisabled:x.isDisabled,"aria-labelledby":t,"aria-describedby":n?h:void 0,children:[e.jsx("span",{className:"rp-checkbox-mark",children:e.jsx(r,{})}),e.jsxs("span",{className:"rp-radio-text",children:[e.jsx("span",{id:t,children:l}),n&&e.jsx("span",{id:h,className:"rp-note",children:n})]})]})}function t(s){return e.jsx(l,{...s,children:e.jsx("path",{fill:"currentColor",d:"M17.78 1.757C16.51.716 14.555.858 13.33 2.08L3.079 12.334c-.32.32-.559.717-.69 1.15l-1.384 4.584c-.08.265-.007.552.188.747.142.143.334.22.53.22q.11 0 .217-.032l4.582-1.384c.434-.13.832-.368 1.151-.688L18.028 6.575c.648-.647.993-1.545.948-2.46s-.482-1.775-1.195-2.358M2.846 17.163l.98-3.246q.042-.135.113-.257l2.41 2.409q-.123.07-.259.114zM16.966 5.516l-9.525 9.526-2.475-2.476 9.425-9.425c.386-.387.896-.586 1.39-.586.38 0 .752.119 1.05.362.392.321.621.772.646 1.272.025.494-.161.977-.51 1.327"})})}function h({children:s}){return e.jsx("div",{className:"rp-toolbar",children:s})}function x({children:s,negate:a,onNegate:r,negateLabel:i,removeLabel:l,onRemove:o,isDisabled:t,removeDisabled:x}){return e.jsxs(n,{children:[s,e.jsxs(h,{children:[e.jsx(c,{isDisabled:t,isSelected:a,onChange:r,children:i}),e.jsx("span",{className:"rp-grow"}),e.jsx(d,{small:!0,isDisabled:t||x,onPress:o,children:l})]})]})}export{o as C,t as E,x as a,h as b};
@@ -0,0 +1,2 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CodeEditor-B_svr95Y.js","./vendor-react-64fcanlc.js","./_commonjsHelpers-CXUWDbkB.js","./index-ucpAK88B.js","./index-o3F3WGy0.css","./vendor-editor-BRV-W12m.js","./index-DUM-iwa2.js","./daeTokens-BVtuNnWZ.js","./nodes-DqXrz-fh.js","./AppearanceControls-DmbIJj4H.js","./ItemText-CtNOgl4O.js","./logs-DjZPFUMm.js","./Select-2JXPV40Q.js"])))=>i.map(i=>d[i]);
import{r as e,j as n}from"./vendor-react-64fcanlc.js";import{h as i,u as s,al as a,l as r,q as t,r as o,x as l,c4 as c,w as d,c6 as u,Y as g,A as f,aK as p,c2 as m,cw as h,dk as b,dl as x,a1 as v,a0 as j,a9 as y,bO as w,z as k,cv as N,dm as S,t as D,aM as C,aV as T,B as P,aA as O,E as _,bk as R,ax as E,af as M,b5 as A,cq as L,aL as F,C as I,m as H,dn as q,bF as $,bG as K,df as V,a as W,b as U,v as B,aN as z,cs as G,p as J,aD as Q,aG as Y,d9 as X,_ as Z,av as ee,T as ne}from"./index-ucpAK88B.js";import{a as ie,u as se,w as ae,e as re,c as te,H as oe,I as le,K as ce,D as de,L as ue,J as ge,S as fe}from"./logs-DjZPFUMm.js";import{T as pe}from"./Tabs-DrhG95XR.js";import{T as me}from"./Toolbar-D1_-nNpE.js";import{aL as he,a2 as be,aa as xe,aM as ve,y as je,aN as ye,a8 as we,D as ke}from"./activity-CbXYXdVY.js";import{s as Ne,N as Se,O as De,r as Ce,ag as Te,ah as Pe,ai as Oe,aj as _e,K as Re,ak as Ee}from"./nodes-DqXrz-fh.js";import{s as Me,c as Ae,r as Le,a as Fe,b as Ie,d as He,e as qe,f as $e,g as Ke,h as Ve,v as We,i as Ue,j as Be,k as ze,l as Ge,m as Je,n as Qe,o as Ye,w as Xe}from"./nav-BFM0h9zL.js";import{u as Ze,c as en}from"./flows-D8MpHTkU.js";import{d as nn}from"./files-Dt8K7QfP.js";import{D as sn}from"./Table-mJjr_XDH.js";import{T as an}from"./TimeCell-BqAcq3yb.js";import{L as rn}from"./AppearanceControls-DmbIJj4H.js";import{N as tn,t as on}from"./NumberField-Blv4W9AC.js";import{A as ln}from"./AddCircle-Dk2gnxD-.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./Select-2JXPV40Q.js";import"./ItemText-CtNOgl4O.js";import"./Checkbox-eZH7dxup.js";import"./Virtualizer-mx6Yxab_.js";function cn(e,n,s,a="main"){if(!s.daeText)return[];const{blocks:r,tokens:t}=Ne(e),o=s.globalSettings;return r.flatMap(s=>{if(s.name===o?.name){const a=r.filter(e=>e.name===o.name).indexOf(s),l=Se(e,s,t);return l.filter(e=>1===l.filter(n=>n.name===e.name).length&&o.fields.some(n=>n.key===e.name)).map(r=>({kind:s.name,from:r.from,to:r.to,label:r.name,line:e.slice(0,r.from).split("\n").length,href:i("config",{tab:"global",source:n,section:String(a),field:r.name})}))}const l=Me[s.name];return"subscription"===s.name?"main"!==a?[]:De(e).filter(e=>e.from>s.open&&e.to<=s.close).map(e=>({kind:s.name,from:e.from,to:e.to,label:e.tag,line:e.line,href:i("nodes",{editSubscriptionTag:e.tag})})):"dns"===s.name?s.children.filter(e=>"routing"===e.name).flatMap(e=>e.children.filter(e=>"request"===e.name||"response"===e.name).map(e=>({kind:s.name,from:e.from,to:e.to,label:e.name,line:e.line+1,href:l}))):l?[{kind:s.name,from:s.from,to:s.to,label:s.name,line:s.line+1,href:l}]:[]})}const dn=()=>{};const un=new Map;function gn({go:n,query:i}){const m=s(),h=a[r()],b=t(),x=b.data?.resources,v=se(o(x,"config",{whileLoading:!0})),j=function(n){const i=s(),a=ie(n),r=e.useMemo(()=>{const e=xe(a.error);return e?e.diagnostics??[]:null},[a.error]);return e.useEffect(()=>{if(a.error)if(r){const e=ve(r);f("negative",e?i("config.writeRestart",{n:e}):i("ui.writeInvalid",{n:r.filter(e=>"error"===e.level).length}))}else p(a.error,i,i("ui.writeFailed"))},[a.error,r,i]),{...a,diagnostics:r}}(v.refetch),y=e.useMemo(()=>new URLSearchParams(i),[i]),w=e.useMemo(()=>v.data?.sources??[],[v.data]),k=w.find(e=>"main"===e.kind)??null,N=w.find(e=>e.id===y.get("source"))??w[0]??null,S=N?.id??null,D=(e,s)=>n("config",d(i,{tab:"source",source:e,line:null===s?null:String(s)})),C=Number(y.get("line"))||null,T=v.data?.diagnostics??[],P=e.useMemo(()=>{const e=v.data?.diagnostics??[];return{error:e.filter(e=>"error"===e.level).length,warning:e.filter(e=>"warning"===e.level).length}},[v.data]),O=o(x,"config_validate",{whileLoading:!1})&&(x?.config_validate.modes??[]).includes("full"),_=!0===x?.config.writable,R=ae(w),E=l().data,M=e.useMemo(()=>re(E),[E]),A=Ae(!!M.globalSettings,b.data),L=N?Le(N,_,R(N),M,m):null,F=!!N&&!L,[I,H]=e.useState(un),[q,$]=e.useState(null),K=q??P.error,V=y.has("source")||void 0===k?.content?"source":"modules",W=c("validate"===y.get("tab")?d(i,{tab:"source"}):i,A.map(e=>e.id),V),U=N?{source:N,sources:w,open:D,diagnostics:T,canValidate:O&&("main"===N.kind||"include"===N.kind),canWrite:F,readOnly:L,isComplete:R,editor:j,focusLine:C,generation:v.data?.generation_id??"",focusDiagnostics:"validate"===y.get("tab"),diagnosticsChoice:I.get(N.id)??null,chooseDiagnostics:e=>H(n=>new Map(n).set(N.id,e)),reportErrors:$}:null,B=!0===x?.config.create&&!0===x.config.writable?{sources:w,refetch:v.refetch,open:e=>D(e,null)}:null;return{error:b.error??v.error,reload:()=>{b.refetch(),v.refetch()},loading:v.loading&&!v.data,ready:!!v.data,tabsReady:!!v.data||A.some(e=>"history"===e.id),metadata:v.data?Ie(v.data.revision,m):[],redacted:!!v.data?.secrets_redacted,tabs:A.map(e=>({id:e.id,label:"source"===e.id&&K?m("ui.aside",{text:m(e.titleKey),note:g(K,h)}):m(e.titleKey)})),tab:W,setTab:e=>n("config",d(u(i,e,null),{field:null})),selectedId:S??"",select:e=>n("config",d(i,{source:e,line:null})),sourceProps:U,newSourceProps:B,modulesProps:v.data?{config:v.data}:null,sourceModel:N?{...FeLine truncated
@@ -1 +0,0 @@
import{r as e,j as n}from"./vendor-react-64fcanlc.js";import{s as r,h as i,j as s,ez as a,Z as t,C as o,aF as l,P as c,W as d,Y as u,X as f,df as p,a1 as m,cE as g,w as h,d_ as b,cG as v,ai as x,eA as y,eB as j,a4 as k,e0 as w,r as S,cC as C,dd as N,eC as R,eD as D,ea as M,eE as O,am as E,al as T,at as A,ch as L,eF as P,eG as F,a3 as _,dc as q,eH as I,L as $,bT as H,bd as B,J as K,aV as V,K as W,c4 as U,A as z,aS as G,az as J,d6 as Q,bG as Y,d5 as X,ec as Z,d4 as ee,M as ne,D as re,U as ie,ek as se,c5 as ae,eI as te,eJ as oe,eK as le,eL as ce,eM as de,cj as ue,eN as fe,a0 as pe,de as me,d8 as ge,cf as he,eO as be,ce as ve,eP as xe,by as ye,eQ as je,eR as ke,eS as we,V as Se,aY as Ce,aQ as Ne,T as Re}from"./index-CmbH0woS.js";import{e as De,u as Me,L as Oe,A as Ee,M as Te,S as Ae}from"./ActionGroup-D3mQjUsw.js";import{T as Le}from"./Tabs-BzeNgTje.js";import{T as Pe}from"./Toolbar-B9K5nAyx.js";import{r as Fe,E as _e,D as qe}from"./activity-CiEWAlFW.js";import{s as Ie,c as $e,r as He,a as Be,b as Ke,d as Ve,e as We,f as Ue,g as ze,h as Ge,v as Je,i as Qe,j as Ye,k as Xe,l as Ze,m as en,n as nn,w as rn}from"./nav-M7R_HvZ0.js";import{u as sn,c as an}from"./flows-BMReQznn.js";import{d as tn}from"./files-Dt8K7QfP.js";import{D as on}from"./Table-Cfbaho6J.js";import{T as ln}from"./TimeCell-D0UB-mKs.js";import{A as cn}from"./AddCircle-JwHCi_at.js";import{S as dn,a as un,E as fn,C as pn,b as mn,l as gn,c as hn,h as bn,d as vn,r as xn,e as yn,f as jn,g as kn,i as wn,j as Sn,s as Cn,k as Nn,t as Rn,m as Dn,n as Mn,o as On,p as En,q as Tn,u as An,v as Ln,w as Pn,x as Fn,y as _n,z as qn,D as In,R as $n,A as Hn,B as Bn,F as Kn,G as Vn,H as Wn,I as Un,J as zn,K as Gn,L as Jn}from"./vendor-editor-BRV-W12m.js";import{d as Qn,s as Yn}from"./daeTokens-BVtuNnWZ.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./Select-BcN72K3H.js";import"./Checkbox-f7Je53QZ.js";import"./Virtualizer-itu1Kg0o.js";import"./index-DUM-iwa2.js";function Xn(e,n,a,t="main"){if(!a.daeText)return[];const{blocks:o,tokens:l}=r(e),c=a.globalSettings;return o.flatMap(r=>{if(r.name===c?.name){const a=o.filter(e=>e.name===c.name).indexOf(r),t=i(e,r,l);return t.filter(e=>1===t.filter(n=>n.name===e.name).length&&c.fields.some(n=>n.key===e.name)).map(i=>({kind:r.name,from:i.from,to:i.to,label:i.name,line:e.slice(0,i.from).split("\n").length,href:s("config",{tab:"global",source:n,section:String(a),field:i.name})}))}const a=Ie[r.name];return"subscription"===r.name?"main"!==t?[]:Fe(e).filter(e=>e.from>r.open&&e.to<=r.close).map(e=>({kind:r.name,from:e.from,to:e.to,label:e.tag,line:e.line,href:s("nodes",{editSubscriptionTag:e.tag})})):"dns"===r.name?r.children.filter(e=>"routing"===e.name).flatMap(e=>e.children.filter(e=>"request"===e.name||"response"===e.name).map(e=>({kind:r.name,from:e.from,to:e.to,label:e.name,line:e.line+1,href:a}))):a?[{kind:r.name,from:r.from,to:r.to,label:r.name,line:r.line+1,href:a}]:[]})}const Zn=()=>{};const er=new Map;function nr({go:n,query:r}){const i=o(),s=l[c()],a=d(),S=a.data?.resources,C=u(f(S,"config",{whileLoading:!0})),N=function(n){const r=o(),i=t(n),s=e.useMemo(()=>{const e=y(i.error);return e?e.diagnostics??[]:null},[i.error]);return e.useEffect(()=>{if(i.error)if(s){const e=j(s);k("negative",e?r("config.writeRestart",{n:e}):r("ui.writeInvalid",{n:s.filter(e=>"error"===e.level).length}))}else w(i.error,r,r("ui.writeFailed"))},[i.error,s,r]),{...i,diagnostics:s}}(C.refetch),R=e.useMemo(()=>new URLSearchParams(r),[r]),D=e.useMemo(()=>C.data?.sources??[],[C.data]),M=D.find(e=>"main"===e.kind)??null,O=D.find(e=>e.id===R.get("source"))??D[0]??null,E=O?.id??null,T=(e,i)=>n("config",h(r,{tab:"source",source:e,line:null===i?null:String(i)})),A=Number(R.get("line"))||null,L=C.data?.diagnostics??[],P=e.useMemo(()=>{const e=C.data?.diagnostics??[];return{error:e.filter(e=>"error"===e.level).length,warning:e.filter(e=>"warning"===e.level).length}},[C.data]),F=f(S,"config_validate",{whileLoading:!1})&&(S?.config_validate.modes??[]).includes("full"),_=!0===S?.config.writable,q=p(D),I=m().data,$=e.useMemo(()=>De(I),[I]),H=$e(!!$.globalSettings,a.data),B=O?He(O,_,q(O),$,i):null,K=!!O&&!B,[V,W]=e.useState(er),[U,z]=e.useState(null),G=U??P.error,J=R.has("source")||void 0===M?.content?"source":"modules",Q=g("validate"===R.get("tab")?h(r,{tab:"source"}):r,H.map(e=>e.id),J),Y=O?{source:O,sources:D,open:T,diagnostics:L,canValidate:F&&("main"===O.kind||"include"===O.kind),canWrite:K,readOnly:B,isComplete:q,editor:N,focusLine:A,generation:C.data?.generation_id??"",focusDiagnostics:"validate"===R.get("tab"),diagnosticsChoice:V.get(O.id)??null,chooseDiagnostics:e=>W(n=>new Map(n).set(O.id,e)),reportErrors:z}:null,X=!0===S?.config.create&&!0===S.config.writable?{sources:D,refetch:C.refetch,open:e=>T(e,null)}:null;return{error:a.error??C.error,reload:()=>{a.refetch(),C.refetch()},loading:C.loading&&!C.data,ready:!!C.data,tabsReady:!!C.data||H.some(e=>"history"===e.id),metadata:C.data?Ke(C.data.revision,i):[],redacted:!!C.data?.secrets_redacted,tabs:H.maLine truncated
@@ -1 +0,0 @@
import{r as e,j as n}from"./vendor-react-64fcanlc.js";import{O as t}from"./OutboundTag-DROnordp.js";import{bb as o,C as s,aF as l,P as a,al as i,o as r,aW as c,M as u,K as d,ai as p,as as m,y as b,ab as h,cu as g,aS as f,N as w,T as v,cv as y,w as x,cw as j,ae as _,cx as k,cy as C,aj as S,am as A,W as L,X as N,Y as T,ac as M,cz as R,i as F,cA as O,aB as P,a7 as W,cB as D,b_ as U,cC as q,co as E,cD as H,cE as I,cF as Q,aa as V,aG as B,cG as G,a4 as J,cH as K,bd as z,cI as X,cJ as Y,bT as Z,cK as $,c5 as ee,O as ne,J as te,cL as oe,bQ as se,aQ as le,V as ae,bG as ie}from"./index-CmbH0woS.js";import{R as re,d as ce,h as ue,c as de,u as pe,S as me,L as be,M as he}from"./ActionGroup-D3mQjUsw.js";import{T as ge}from"./Tabs-BzeNgTje.js";import{T as fe}from"./Toolbar-B9K5nAyx.js";import{u as we,D as ve,U as ye,F as xe,S as je,d as _e,B as ke,L as Ce,f as Se,h as Ae,i as Le,j as Ne,p as Te,o as Me,k as Re,l as Fe}from"./activity-CiEWAlFW.js";import{S as Oe}from"./SearchSelect-CuaWhoLz.js";import{D as Pe}from"./Table-Cfbaho6J.js";import{T as We}from"./TimeCell-D0UB-mKs.js";import{Q as De,u as Ue,r as qe,R as Ee}from"./useQuickRule-C0zoMd-O.js";import{u as He}from"./outbounds-CUyNhEhE.js";import{c as Ie,d as Qe,e as Ve}from"./files-Dt8K7QfP.js";import{w as Be}from"./labels-D8xxfRTQ.js";import{u as Ge}from"./flows-BMReQznn.js";import{c as Je}from"./nav-BO8viH9G.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./Tag-fyQjN-Xw.js";import"./Select-BcN72K3H.js";import"./Checkbox-f7Je53QZ.js";import"./SearchList-CJ8rQxgu.js";import"./Virtualizer-itu1Kg0o.js";import"./DaeCode-DEjXqvav.js";import"./daeTokens-BVtuNnWZ.js";import"./AddCircle-JwHCi_at.js";const Ke=[0,2,3,1,4,5,6,7],ze=e.memo(function({records:t,outbounds:p,latency:m,latencyError:b,retryLatency:h,truncated:g,uncounted:f,onSelect:w}){const v=s(),y=we(),x=l[a()],j=e.useCallback(e=>i(e,x),[x]),_=e.useMemo(()=>function(e,n){const t=new Map;let s=0;for(const o of e){if(null===o.upload_bytes||null===o.download_bytes){s++;continue}const e={id:o.id,up:Number(o.upload_bytes),down:Number(o.download_bytes),name:o.domain||o.dst||o.id},n=t.get(o.outbound);n?n.push(e):t.set(o.outbound,[e])}const l=[...t].map(([e,n])=>({outbound:e,points:n})).sort((e,t)=>o(n)(e.outbound??"",t.outbound??""));let a,i=-1n;for(const o of e){if(null===o.upload_bytes||null===o.download_bytes)continue;const e=BigInt(o.upload_bytes)+BigInt(o.download_bytes);e>i&&(i=e,a={id:o.id,up:Number(o.upload_bytes),down:Number(o.download_bytes),name:o.domain||o.dst||o.id,outbound:o.outbound})}return{series:l,unknown:s,heaviest:a,placed:e.length-s}}(t,x),[t,x]),k=e.useMemo(()=>{const e=p.filter(e=>"block"!==e);return _.series.map(n=>{return{id:n.outbound??"",label:r(n.outbound,v),color:(t=n.outbound,"block"===t?y.negative:y.cat[Ke[Math.max(0,e.indexOf(t))%Ke.length]]),points:n.points.map(e=>({id:e.id,x:e.up,y:e.down,name:e.name,detail:v("conn.chart.point",{download:j(e.down),upload:j(e.up)})}))};var t})},[_,p,y,v,j]),C=_.heaviest?[{label:v("conn.chart.busiest"),icon:n.jsx(c,{}),tint:"c3",value:_.heaviest.name,caption:r(_.heaviest.outbound,v)},{label:v("ui.download"),value:j(_.heaviest.down),icon:n.jsx(ve,{}),tint:"c1"},{label:v("ui.upload"),value:j(_.heaviest.up),icon:n.jsx(ye,{}),tint:"c4"}]:[],S=_.unknown?v("conn.chart.sampleUnknown",{n:t.length,unknown:_.unknown}):v("conn.chart.sample",{n:t.length});return n.jsxs("div",{className:"rp-chart-page",children:[n.jsx(xe,{facts:C,lead:!0}),n.jsxs(u,{title:v("conn.chart.title"),help:f?{title:v("conn.chart.title"),text:v("ui.trafficUncounted")}:void 0,note:S,children:[g&&n.jsx("p",{className:"rp-note",children:v("conn.truncated")}),_.placed>0&&n.jsxs(n.Fragment,{children:[n.jsx(je,{label:v("conn.chart.title"),series:k,fmt:j,onSelect:w,regions:{above:v("conn.chart.moreDown"),below:v("conn.chart.moreUp")}}),n.jsx(_e,{series:k}),n.jsx("p",{className:"rp-note",children:v("conn.chart.hint")})]})]}),m?n.jsx(Xe,{latency:m}):b&&n.jsx(u,{title:v("ui.nodeLatency"),children:n.jsx(d,{error:b,onRetry:h})})]})});function Xe({latency:e}){const t=s(),o=we(),i=e=>m(e,t),r=l[a()],c=n=>!e.chains||n?o.cat[0]:o.muted;return n.jsx(u,{title:t("ui.nodeLatency"),note:t("conn.latency.sample",{n:e.samples.length,missing:e.missing}),children:e.samples.length?n.jsxs(n.Fragment,{children:[n.jsx("p",{className:"rp-note",children:t("conn.latency.percentiles",{p50:i(e.p50),p90:i(e.p90)})}),null!==e.weightedP50&&n.jsx("p",{className:"rp-note",children:e.unplaced?t("conn.latency.weightedUnplaced",{p50:i(e.weightedP50),n:e.unplaced}):t("conn.latency.weighted",{p50:i(e.weightedP50)})}),n.jsx(ke,{label:t("ui.nodeLatency"),points:e.samples.map(e=>({id:e.node,nodeName:!0,value:e.value,color:c(e.connections>0),lines:[e.name,i(e.value),...e.connections?[t("conn.chart.sample",{n:e.connections})]:[]]})),fmt:i}),e.chains&&n.jsxs("div",{className:"rp-legend",children:[n.jsx(Ce,{swatch:c(!0),label:t("conn.latency.inUse"),value:p(e.used,r)}),n.jsx(Ce,{swatch:c(!1),label:t("conn.latency.others"),value:p(e.samples.lengLine truncated
@@ -0,0 +1 @@
import{r as e,j as n}from"./vendor-react-64fcanlc.js";import{O as t}from"./OutboundTag-DLjv1HUR.js";import{aU as o,u as s,al as l,l as a,a0 as i,o as r,aB as c,C as u,E as d,Y as p,a8 as m,s as b,M as h,bW as g,ax as f,N as w,T as v,bX as y,w as x,bY as j,U as _,bZ as k,b_ as C,Z as S,a1 as A,q as L,r as N,O as T,b$ as M,a6 as R,c0 as O,ah as P,G as F,c1 as U,b4 as W,c2 as q,bS as D,c3 as E,c4 as I,c5 as V,K as H,am as Q,c6 as B,A as K,c7 as G,aV as J,b9 as Y,c8 as Z,aM as X,c9 as z,bG as $,B as ee,ca as ne,bx as te,av as oe,p as se}from"./index-ucpAK88B.js";import{R as le,u as ae,i as ie,o as re,h as ce,c as ue,S as de,L as pe,n as me,K as be}from"./logs-DjZPFUMm.js";import{C as he}from"./AppearanceControls-DmbIJj4H.js";import{T as ge}from"./Tabs-DrhG95XR.js";import{T as fe}from"./Toolbar-D1_-nNpE.js";import{a as we,D as ve,U as ye,F as xe,S as je,c as _e,B as ke,L as Ce,t as Se,d as Ae,f as Le,g as Ne,p as Te,o as Me,k as Re,h as Oe}from"./activity-CbXYXdVY.js";import{S as Pe}from"./SearchSelect-CQDeD6gi.js";import{D as Fe}from"./Table-mJjr_XDH.js";import{T as Ue}from"./TimeCell-BqAcq3yb.js";import{Q as We,u as qe,R as De}from"./useQuickRule-BWE0DtUt.js";import{u as Ee}from"./outbounds-KqKr_Phl.js";import{c as Ie,d as Ve,e as He}from"./files-Dt8K7QfP.js";import{w as Qe}from"./labels-D8xxfRTQ.js";import{u as Be}from"./flows-D8MpHTkU.js";import{r as Ke}from"./rule-Ce4KC3th.js";import{c as Ge}from"./nav-BO8viH9G.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./Tag-C65IJXSk.js";import"./Select-2JXPV40Q.js";import"./ItemText-CtNOgl4O.js";import"./nodes-DqXrz-fh.js";import"./Checkbox-eZH7dxup.js";import"./SearchList-BxTMvuPr.js";import"./Virtualizer-mx6Yxab_.js";import"./DaeCode-DEjXqvav.js";import"./daeTokens-BVtuNnWZ.js";import"./AddCircle-Dk2gnxD-.js";const Je=[0,2,3,1,4,5,6,7],Ye=e.memo(function({records:t,outbounds:p,latency:m,latencyError:b,retryLatency:h,truncated:g,uncounted:f,onSelect:w}){const v=s(),y=we(),x=l[a()],j=e.useCallback(e=>i(e,x),[x]),_=e.useMemo(()=>function(e,n){const t=new Map;let s=0;for(const o of e){if(null===o.upload_bytes||null===o.download_bytes){s++;continue}const e={id:o.id,up:Number(o.upload_bytes),down:Number(o.download_bytes),name:o.domain||o.dst||o.id},n=t.get(o.outbound);n?n.push(e):t.set(o.outbound,[e])}const l=[...t].map(([e,n])=>({outbound:e,points:n})).sort((e,t)=>o(n)(e.outbound??"",t.outbound??""));let a,i=-1n;for(const o of e){if(null===o.upload_bytes||null===o.download_bytes)continue;const e=BigInt(o.upload_bytes)+BigInt(o.download_bytes);e>i&&(i=e,a={id:o.id,up:Number(o.upload_bytes),down:Number(o.download_bytes),name:o.domain||o.dst||o.id,outbound:o.outbound})}return{series:l,unknown:s,heaviest:a,placed:e.length-s}}(t,x),[t,x]),k=e.useMemo(()=>{const e=p.filter(e=>"block"!==e);return _.series.map(n=>{return{id:n.outbound??"",label:r(n.outbound,v),color:(t=n.outbound,"block"===t?y.negative:y.cat[Je[Math.max(0,e.indexOf(t))%Je.length]]),points:n.points.map(e=>({id:e.id,x:e.up,y:e.down,name:e.name,detail:v("conn.chart.point",{download:j(e.down),upload:j(e.up)})}))};var t})},[_,p,y,v,j]),C=_.heaviest?[{label:v("conn.chart.busiest"),icon:n.jsx(c,{}),tint:"c3",value:_.heaviest.name,caption:r(_.heaviest.outbound,v)},{label:v("ui.download"),value:j(_.heaviest.down),icon:n.jsx(ve,{}),tint:"c1"},{label:v("ui.upload"),value:j(_.heaviest.up),icon:n.jsx(ye,{}),tint:"c4"}]:[],S=_.unknown?v("conn.chart.sampleUnknown",{n:t.length,unknown:_.unknown}):v("conn.chart.sample",{n:t.length});return n.jsxs("div",{className:"rp-chart-page",children:[n.jsx(xe,{facts:C,lead:!0}),n.jsxs(u,{title:v("conn.chart.title"),help:f?{title:v("conn.chart.title"),text:v("ui.trafficUncounted")}:void 0,note:S,children:[g&&n.jsx("p",{className:"rp-note",children:v("conn.truncated")}),_.placed>0&&n.jsxs(n.Fragment,{children:[n.jsx(je,{label:v("conn.chart.title"),series:k,fmt:j,onSelect:w,regions:{above:v("conn.chart.moreDown"),below:v("conn.chart.moreUp")}}),n.jsx(_e,{series:k}),n.jsx("p",{className:"rp-note",children:v("conn.chart.hint")})]})]}),m?n.jsx(Ze,{latency:m}):b&&n.jsx(u,{title:v("ui.nodeLatency"),children:n.jsx(d,{error:b,onRetry:h})})]})});function Ze({latency:e}){const t=s(),o=we(),i=e=>m(e,t),r=l[a()],c=n=>!e.chains||n?o.cat[0]:o.muted;return n.jsx(u,{title:t("ui.nodeLatency"),note:t("conn.latency.sample",{n:e.samples.length,missing:e.missing}),children:e.samples.length?n.jsxs(n.Fragment,{children:[n.jsx("p",{className:"rp-note",children:t("conn.latency.percentiles",{p50:i(e.p50),p90:i(e.p90)})}),null!==e.weightedP50&&n.jsx("p",{className:"rp-note",children:e.unplaced?t("conn.latency.weightedUnplaced",{p50:i(e.weightedP50),n:e.unplaced}):t("conn.latency.weighted",{p50:i(e.weightedP50)})}),n.jsx(ke,{label:t("ui.nodeLatency"),points:e.samples.map(e=>({id:e.node,nodeName:!0,value:e.value,color:c(e.connections>0),lines:[e.name,i(e.value),...e.connections?[t("conn.chart.sample",{n:e.connections})]:[]]})),fmt:i}),e.chains&&n.jsxs("div",{className:"rp-legend",children:[n.jsx(Ce,{swatch:c(!0),labeLine truncated
@@ -0,0 +1 @@
import{r as c,j as r}from"./vendor-react-64fcanlc.js";import{u as s,dn as o,A as l,I as t}from"./index-ucpAK88B.js";function a(){const r=s();return c.useCallback(async c=>{const s=await o(c);l(s?"positive":"negative",r(s?"ui.recordCopied":"ui.recordCopyFailed"))},[r])}function e(c){return r.jsxs(t,{...c,children:[r.jsx("path",{fill:"currentColor",d:"m11.75,18h-7.5c-1.24023,0-2.25-1.00977-2.25-2.25v-7.5c0-1.24023,1.00977-2.25,2.25-2.25.41406,0,.75.33594.75.75s-.33594.75-.75.75c-.41309,0-.75.33691-.75.75v7.5c0,.41309.33691.75.75.75h7.5c.41309,0,.75-.33691.75-.75,0-.41406.33594-.75.75-.75s.75.33594.75.75c0,1.24023-1.00977,2.25-2.25,2.25Z"}),r.jsx("path",{fill:"currentColor",d:"m6.75,5c-.41406,0-.75-.33594-.75-.75,0-1.24023,1.00977-2.25,2.25-2.25.41406,0,.75.33594.75.75s-.33594.75-.75.75c-.41309,0-.75.33691-.75.75,0,.41406-.33594.75-.75.75Z"}),r.jsx("path",{fill:"currentColor",d:"m13,3.5h-2c-.41406,0-.75-.33594-.75-.75s.33594-.75.75-.75h2c.41406,0,.75.33594.75.75s-.33594.75-.75.75Z"}),r.jsx("path",{fill:"currentColor",d:"m13,14h-2c-.41406,0-.75-.33594-.75-.75s.33594-.75.75-.75h2c.41406,0,.75.33594.75.75s-.33594.75-.75.75Z"}),r.jsx("path",{fill:"currentColor",d:"m15.75,14c-.41406,0-.75-.33594-.75-.75s.33594-.75.75-.75c.41309,0,.75-.33691.75-.75,0-.41406.33594-.75.75-.75s.75.33594.75.75c0,1.24023-1.00977,2.25-2.25,2.25Z"}),r.jsx("path",{fill:"currentColor",d:"m17.25,5c-.41406,0-.75-.33594-.75-.75,0-.41309-.33691-.75-.75-.75-.41406,0-.75-.33594-.75-.75s.33594-.75.75-.75c1.24023,0,2.25,1.00977,2.25,2.25,0,.41406-.33594.75-.75.75Z"}),r.jsx("path",{fill:"currentColor",d:"m17.25,9.75c-.41406,0-.75-.33594-.75-.75v-2c0-.41406.33594-.75.75-.75s.75.33594.75.75v2c0,.41406-.33594.75-.75.75Z"}),r.jsx("path",{fill:"currentColor",d:"m6.75,9.75c-.41406,0-.75-.33594-.75-.75v-2c0-.41406.33594-.75.75-.75s.75.33594.75.75v2c0,.41406-.33594.75-.75.75Z"}),r.jsx("path",{fill:"currentColor",d:"m8.25,14c-1.24023,0-2.25-1.00977-2.25-2.25,0-.41406.33594-.75.75-.75s.75.33594.75.75c0,.41309.33691.75.75.75.41406,0,.75.33594.75.75s-.33594.75-.75.75Z"})]})}export{e as C,a as u};
@@ -0,0 +1 @@
import{ah as e,ak as l,U as r,u as a,T as s,p as n}from"./index-ucpAK88B.js";import{j as o}from"./vendor-react-64fcanlc.js";const t={userspace_tcp:"flow.userspaceTcp",userspace_udp:"flow.userspaceUdp",kernel_direct:"flow.kernelDirect",kernel_block:"flow.kernelBlock",dns_intercept:"flow.dnsIntercept",kernel_bypass:"flow.kernelBypass"},p={full:"flow.full",partial:"flow.partialVisibility",none:"ui.none"};function c(a,s,n){const o=Object.entries(a.coverage).filter(([,e])=>"full"!==e),c=e(a.dropped_records),i=c?s("flow.dropped",{n:c}):null;return o.length||i?{summary:o.length?s("flow.coverageSummary",{n:o.length}):null,detail:l(n,o.map(([e,l])=>s("ui.valuePair",{label:r(t,e,s),value:r(p,l,s)}))),dropped:i}:null}function i({view:e}){const l=a();return o.jsxs("div",{className:"rp-cluster",role:"group","aria-label":l("flow.coverage"),children:[e.summary&&o.jsx(s,{text:e.detail,children:o.jsx(n,{small:!0,tone:"warn",children:e.summary})}),e.dropped&&o.jsx(n,{small:!0,tone:"warn",children:e.dropped})]})}export{i as C,c};
@@ -1 +0,0 @@
import{aB as e,aE as l,ae as r,C as a,T as s,V as n}from"./index-CmbH0woS.js";import{j as o}from"./vendor-react-64fcanlc.js";const t={userspace_tcp:"flow.userspaceTcp",userspace_udp:"flow.userspaceUdp",kernel_direct:"flow.kernelDirect",kernel_block:"flow.kernelBlock",dns_intercept:"flow.dnsIntercept",kernel_bypass:"flow.kernelBypass"},c={full:"flow.full",partial:"flow.partialVisibility",none:"ui.none"};function p(a,s,n){const o=Object.entries(a.coverage).filter(([,e])=>"full"!==e),p=e(a.dropped_records),i=p?s("flow.dropped",{n:p}):null;return o.length||i?{summary:o.length?s("flow.coverageSummary",{n:o.length}):null,detail:l(n,o.map(([e,l])=>s("ui.valuePair",{label:r(t,e,s),value:r(c,l,s)}))),dropped:i}:null}function i({view:e}){const l=a();return o.jsxs("div",{className:"rp-cluster",role:"group","aria-label":l("flow.coverage"),children:[e.summary&&o.jsx(s,{text:e.detail,children:o.jsx(n,{small:!0,tone:"warn",children:e.summary})}),e.dropped&&o.jsx(n,{small:!0,tone:"warn",children:e.dropped})]})}export{i as C,p as c};
@@ -1 +1 @@
import{j as c}from"./vendor-react-64fcanlc.js";import{I as r}from"./index-CmbH0woS.js";function l(l){return c.jsxs(r,{...l,children:[c.jsx("path",{fill:"currentColor",d:"M8.249 15.021c-.4 0-.733-.317-.748-.72l-.25-6.5c-.017-.414.307-.763.72-.779H8c.4 0 .733.317.748.72l.25 6.5c.017.414-.307.763-.72.778zM11.751 15.021h-.03c-.413-.016-.737-.365-.72-.779l.25-6.5c.015-.403.348-.72.748-.72h.03c.413.016.737.365.72.779l-.25 6.5c-.015.403-.348.72-.748.72"}),c.jsx("path",{fill:"currentColor",d:"M17 4h-3.5v-.75C13.5 2.01 12.49 1 11.25 1h-2.5C7.51 1 6.5 2.01 6.5 3.25V4H3c-.414 0-.75.336-.75.75s.336.75.75.75h.52l.422 10.342C3.99 17.052 4.98 18 6.19 18h7.62c1.211 0 2.2-.948 2.248-2.158L16.48 5.5H17c.414 0 .75-.336.75-.75S17.414 4 17 4m-9-.75c0-.413.337-.75.75-.75h2.5c.413 0 .75.337.75.75V4H8zm6.56 12.531c-.017.404-.346.719-.75.719H6.19c-.404 0-.733-.315-.75-.719L5.02 5.5h9.96z"})]})}export{l as D}; import{j as c}from"./vendor-react-64fcanlc.js";import{I as r}from"./index-ucpAK88B.js";function l(l){return c.jsxs(r,{...l,children:[c.jsx("path",{fill:"currentColor",d:"M8.249 15.021c-.4 0-.733-.317-.748-.72l-.25-6.5c-.017-.414.307-.763.72-.779H8c.4 0 .733.317.748.72l.25 6.5c.017.414-.307.763-.72.778zM11.751 15.021h-.03c-.413-.016-.737-.365-.72-.779l.25-6.5c.015-.403.348-.72.748-.72h.03c.413.016.737.365.72.779l-.25 6.5c-.015.403-.348.72-.748.72"}),c.jsx("path",{fill:"currentColor",d:"M17 4h-3.5v-.75C13.5 2.01 12.49 1 11.25 1h-2.5C7.51 1 6.5 2.01 6.5 3.25V4H3c-.414 0-.75.336-.75.75s.336.75.75.75h.52l.422 10.342C3.99 17.052 4.98 18 6.19 18h7.62c1.211 0 2.2-.948 2.248-2.158L16.48 5.5H17c.414 0 .75-.336.75-.75S17.414 4 17 4m-9-.75c0-.413.337-.75.75-.75h2.5c.413 0 .75.337.75.75V4H8zm6.56 12.531c-.017.404-.346.719-.75.719H6.19c-.404 0-.733-.315-.75-.719L5.02 5.5h9.96z"})]})}export{l as D};
@@ -1 +0,0 @@
import{r as e,j as s}from"./vendor-react-64fcanlc.js";import{cg as a,u as t,ab as n,ae as r,as as l,am as i,ai as d,ad as c,aB as o,bT as u,C as m,at as h,W as p,cC as x,a3 as g,cE as y,X as f,Y as b,w as j,j as v,cG as w,aF as _,P as N,cM as T,co as S,cN as C,b_ as q,cJ as k,a4 as R,cK as M,bd as L,cO as F,cn as A,aU as E,az as D,A as P,K as W,cP as O,cQ as U,cR as H,M as B,D as K,aT as I,T as Q,bH as $,cS as G,c5 as J,cT as V,J as z,cU as X,aS as Y,bG as Z,V as ee,aQ as se,cV as ae,bQ as te,cL as ne}from"./index-CmbH0woS.js";import{D as re}from"./Delete-CQeLz6oG.js";import{s as le,q as ie,u as de,v as ce,C as oe,F as ue,B as me,L as he,W as pe,x as xe,D as ge}from"./activity-CiEWAlFW.js";import{q as ye,f as fe,j as be,k as je,S as ve,L as we,A as _e}from"./ActionGroup-D3mQjUsw.js";import{T as Ne}from"./Tabs-BzeNgTje.js";import{T as Te}from"./Toolbar-B9K5nAyx.js";import{D as Se}from"./Table-Cfbaho6J.js";import{T as Ce}from"./TimeCell-D0UB-mKs.js";import{$ as qe}from"./SearchList-CJ8rQxgu.js";import{c as ke,d as Re,e as Me}from"./files-Dt8K7QfP.js";import{d as Le}from"./nav-C4ZPdNvM.js";import{a as Fe,u as Ae,R as Ee,Q as De}from"./useQuickRule-C0zoMd-O.js";/* empty css */import"./_commonjsHelpers-CXUWDbkB.js";import"./Select-BcN72K3H.js";import"./Checkbox-f7Je53QZ.js";import"./Virtualizer-itu1Kg0o.js";import"./DaeCode-DEjXqvav.js";import"./daeTokens-BVtuNnWZ.js";import"./AddCircle-JwHCi_at.js";import"./SearchSelect-CuaWhoLz.js";import"./flows-BMReQznn.js";function Pe(e,s,a,t,r){return{domain:e,dip:null,sip:(r&&n(r))??null,outbound:null,matched:null,dns:{type:s,answers:Fe(a),upstream:t,query:{name:e,type:s}}}}const We=(e,s,a)=>({domain:null,dip:e,sip:null,outbound:null,matched:null,dns:{type:a,answers:[e],upstream:null,query:{name:s,type:a}}}),Oe={forced:"dns.route.forced","dns.routing":"dns.route.rules",default:"dns.route.default"};function Ue(e,s){return{fields:[[s("ui.state"),e.status],[s("ui.upstream"),e.upstream??"—"],[s("dns.routeSource"),r(Oe,e.route.source,s)],[s("dns.routeRule"),e.route.rule??"—"],[s("ui.elapsed"),l(e.elapsed_ms,s)]],answers:(e.answers??[]).map(e=>s("dns.answer",{name:e.name,type:e.type,ttl:e.ttl,data:e.data})),cacheText:s(e.cached?"dns.hit":"dns.miss"),cacheTone:e.cached?void 0:"warn"}}function He(e,s,a){return e?a instanceof u&&503===a.status?"unavailable":s?"ready":a?"error":"loading":"unlisted"}const Be=[{id:"full",label:"rule.kind.domain"},{id:"suffix",label:"rule.kind.domainSuffix"},{id:"keyword",label:"rule.kind.domainKeyword"},{id:"regex",label:"dns.matchRegex"}],Ke=e=>e.trim().toLowerCase().replace(/\.$/,"");function Ie(e,s){if(!s.trim())return()=>!0;if("regex"===e){const e=function(e){try{return new RegExp(e,"iu")}catch{return null}}(s);return e&&(s=>e.test(Ke(s)))}if("keyword"===e){const e=s.trim().toLowerCase();return s=>Ke(s).includes(e)}const a=Ke(s),t="suffix"===e&&a.startsWith("."),n=t?a.slice(1):a;return n?"full"===e?e=>Ke(e)===n:e=>{const s=Ke(e);return s.endsWith("."+n)||!t&&s===n}:null}function Qe({go:s,query:n}){const r=m(),l=h(),i=p(),d=e.useMemo(()=>new URLSearchParams(n),[n]),[c,o]=e.useState(d.get("domain")??""),[u,_]=e.useState(d.get("type")??"A"),[N,T]=e.useState(!1);x(d.get("domain"),e=>o(e??"")),x(d.get("type"),e=>_(e??"A"));const[S,C]=e.useState(null),{busy:q,error:k,run:R}=g({rethrow:!0}),M=i.data?.resources,L=e.useMemo(()=>function(e,s,a,t,n,r){const l=s?.dns_query.record_types??[],i="all"===a?l.length>0:l.includes(a);return{types:l,choices:[...l.map(e=>({id:e,label:e})),{id:"all",label:r("dns.allTypes")}],disabled:n||!s?.dns_query.available||!i||!t.trim(),reason:!s||n?null:s.dns_query.available?i?null:r("all"===a?"dns.noTypes":"dns.typeUnsupported"):r("dns.queryUnavailable"),showCache:!!s?.dns_cache.available,cards:e?.results.map(s=>({id:s.type,title:`${e.domain} ${s.type}`,...Ue(s,r),seed:Pe(e.domain,s.type,s.answers??[],s.upstream,null),answerSeeds:(s.answers??[]).map(a=>Fe([a]).length?{address:a.data,seed:We(a.data,e.domain,s.type)}:null)}))??[],tabs:Le(s).map(e=>({id:e.id,label:r(e.titleKey)}))}}(S,M,u,c,!!q,r),[S,M,u,c,q,r]),F=L.tabs.map(e=>e.id),A=d.has("domain")||d.has("device"),E=F.includes("log")?A?"log":"stats":F.includes("query")?"query":F[0]??"query",D=y(n,F,E),P=f(M,"config",{whileLoading:!1}),W=b("query"===D&&P&&f(M,"dns_query",{whileLoading:!1})),O=e.useMemo(()=>P?function(e,s){const n=[...new Set((e??[]).flatMap(e=>e.content?a(e.content).map(t):[]))];return n.length?[{id:"",label:s("dns.upstreamAuto")},...n.map(e=>({id:e,label:e}))]:[]}(W.data?.sources,r):[],[P,W.data,r]),[U,H]=e.useState(""),B=O.some(e=>e.id===U)?U:"";W.data&&U&&!B&&H("");const K=async(e={domain:c,type:u})=>{try{await R("query",async s=>{const a=await ye(l.dnsQuery,e.domain.trim(),"all"===e.type?L.types:[e.type],M?.dns_query.limits?.max_types_per_request??1,s,N?"bypass":"normal",B||void 0);return s.aborted||C(a),a})}catch{}},I=f(M,"dns_query",{whileLoading:!1})&&L.types.length>0,Q=Ae(s,{queryAgain:I?e=>{const a=L.types.includes(e.type)?e.type:"allLine truncated
@@ -0,0 +1 @@
import{r as e,j as s}from"./vendor-react-64fcanlc.js";import{M as a,U as t,a8 as n,a1 as r,Y as l,Q as i,ah as d,aM as c,u as o,a9 as u,q as m,c2 as h,z as p,c4 as x,r as g,w as y,h as f,c6 as b,al as j,l as v,cb as w,bS as _,cc as N,b4 as T,c8 as S,A as q,c9 as C,aV as k,cd as R,bR as M,az as L,af as A,E as F,ce as E,bh as D,cf as P,C as W,S as O,ae as U,ay as H,T as B,bu as K,bF as I,cg as Q,bG as $,ch as z,B as J,ci as V,ax as G,p as X,av as Y,bx as Z,ca as ee}from"./index-ucpAK88B.js";import{D as se}from"./Delete-BwK55moY.js";import{s as ae,l as te,a as ne,m as re,C as le,F as ie,B as de,L as ce,W as oe,n as ue,q as me,D as he}from"./activity-CbXYXdVY.js";import{u as pe,q as xe,k as ge,s as ye,t as fe,S as be,L as je,K as ve,A as we}from"./logs-DjZPFUMm.js";import{T as _e}from"./Tabs-DrhG95XR.js";import{T as Ne}from"./Toolbar-D1_-nNpE.js";import{D as Te}from"./Table-mJjr_XDH.js";import{T as Se}from"./TimeCell-BqAcq3yb.js";import{$ as qe}from"./SearchList-BxTMvuPr.js";import{c as Ce,d as ke,e as Re}from"./files-Dt8K7QfP.js";import{d as Me}from"./nav-a55OqNm6.js";import{a as Le}from"./rule-Ce4KC3th.js";import{J as Ae,u as Fe}from"./nodes-DqXrz-fh.js";import{u as Ee,R as De,Q as Pe}from"./useQuickRule-BWE0DtUt.js";import{L as We}from"./AppearanceControls-DmbIJj4H.js";/* empty css */import"./_commonjsHelpers-CXUWDbkB.js";import"./ItemText-CtNOgl4O.js";import"./Select-2JXPV40Q.js";import"./Checkbox-eZH7dxup.js";import"./Virtualizer-mx6Yxab_.js";import"./DaeCode-DEjXqvav.js";import"./daeTokens-BVtuNnWZ.js";import"./AddCircle-Dk2gnxD-.js";import"./SearchSelect-CQDeD6gi.js";import"./flows-D8MpHTkU.js";function Oe(e,s,t,n,r){return{domain:e,dip:null,sip:(r&&a(r))??null,outbound:null,matched:null,dns:{type:s,answers:Le(t),upstream:n,query:{name:e,type:s}}}}const Ue=(e,s,a)=>({domain:null,dip:e,sip:null,outbound:null,matched:null,dns:{type:a,answers:[e],upstream:null,query:{name:s,type:a}}}),He={forced:"dns.route.forced","dns.routing":"dns.route.rules",default:"dns.route.default"};function Be(e,s){return{fields:[[s("ui.state"),e.status],[s("ui.upstream"),e.upstream??"—"],[s("dns.routeSource"),t(He,e.route.source,s)],[s("dns.routeRule"),e.route.rule??"—"],[s("ui.elapsed"),n(e.elapsed_ms,s)]],answers:(e.answers??[]).map(e=>s("dns.answer",{name:e.name,type:e.type,ttl:e.ttl,data:e.data})),cacheText:s(e.cached?"dns.hit":"dns.miss"),cacheTone:e.cached?void 0:"warn"}}function Ke(e,s,a){return e?a instanceof c&&503===a.status?"unavailable":s?"ready":a?"error":"loading":"unlisted"}const Ie=[{id:"full",label:"rule.kind.domain"},{id:"suffix",label:"rule.kind.domainSuffix"},{id:"keyword",label:"rule.kind.domainKeyword"},{id:"regex",label:"dns.matchRegex"}],Qe=e=>e.trim().toLowerCase().replace(/\.$/,"");function $e(e,s){if(!s.trim())return()=>!0;if("regex"===e){const e=function(e){try{return new RegExp(e,"iu")}catch{return null}}(s);return e&&(s=>e.test(Qe(s)))}if("keyword"===e){const e=s.trim().toLowerCase();return s=>Qe(s).includes(e)}const a=Qe(s),t="suffix"===e&&a.startsWith("."),n=t?a.slice(1):a;return n?"full"===e?e=>Qe(e)===n:e=>{const s=Qe(e);return s.endsWith("."+n)||!t&&s===n}:null}function ze({go:s,query:a}){const t=o(),n=u(),r=m(),l=e.useMemo(()=>new URLSearchParams(a),[a]),[i,d]=e.useState(l.get("domain")??""),[c,j]=e.useState(l.get("type")??"A"),[v,w]=e.useState(!1);h(l.get("domain"),e=>d(e??"")),h(l.get("type"),e=>j(e??"A"));const[_,N]=e.useState(null),{busy:T,error:S,run:q}=p({rethrow:!0}),C=r.data?.resources,k=e.useMemo(()=>function(e,s,a,t,n,r){const l=s?.dns_query.record_types??[],i="all"===a?l.length>0:l.includes(a);return{types:l,choices:[...l.map(e=>({id:e,label:e})),{id:"all",label:r("dns.allTypes")}],disabled:n||!s?.dns_query.available||!i||!t.trim(),reason:!s||n?null:s.dns_query.available?i?null:r("all"===a?"dns.noTypes":"dns.typeUnsupported"):r("dns.queryUnavailable"),showCache:!!s?.dns_cache.available,cards:e?.results.map(s=>({id:s.type,title:`${e.domain} ${s.type}`,...Be(s,r),seed:Oe(e.domain,s.type,s.answers??[],s.upstream,null),answerSeeds:(s.answers??[]).map(a=>Le([a]).length?{address:a.data,seed:Ue(a.data,e.domain,s.type)}:null)}))??[],tabs:Me(s).map(e=>({id:e.id,label:r(e.titleKey)}))}}(_,C,c,i,!!T,t),[_,C,c,i,T,t]),R=k.tabs.map(e=>e.id),M=l.has("domain")||l.has("device"),L=R.includes("log")?M?"log":"stats":R.includes("query")?"query":R[0]??"query",A=x(a,R,L),F=g(C,"config",{whileLoading:!1}),E=pe("query"===A&&F&&g(C,"dns_query",{whileLoading:!1})),D=e.useMemo(()=>F?function(e,s){const a=[...new Set((e??[]).flatMap(e=>e.content?Ae(e.content).map(Fe):[]))];return a.length?[{id:"",label:s("dns.upstreamAuto")},...a.map(e=>({id:e,label:e}))]:[]}(E.data?.sources,t):[],[F,E.data,t]),[P,W]=e.useState(""),O=D.some(e=>e.id===P)?P:"";E.data&&P&&!O&&W("");const U=async(e={domain:i,type:c})=>{try{await q("query",async s=>{const a=await xe(n.dnsQuery,e.domain.trim(),"all"===e.type?k.types:[e.type],C?.dns_query.limits?.max_types_per_request??1,s,v?"bypass":"normal",O||void 0);return s.aborLine truncated
@@ -0,0 +1 @@
import{r as n,j as t}from"./vendor-react-64fcanlc.js";import{u as e,f as r}from"./index-ucpAK88B.js";import{aW as o,b4 as a,aZ as i,a$ as l}from"./activity-CbXYXdVY.js";import{w as u,c,a as s}from"./array-C0VuvQyb.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./nodes-DqXrz-fh.js";import"./AppearanceControls-DmbIJj4H.js";import"./ItemText-CtNOgl4O.js";import"./logs-DjZPFUMm.js";import"./Select-2JXPV40Q.js";const f=Math.abs,h=Math.atan2,y=Math.cos,p=Math.max,d=Math.min,x=Math.sin,g=Math.sqrt,v=1e-12,m=Math.PI,M=m/2,A=2*m;function j(n){return n>=1?M:n<=-1?-M:Math.asin(n)}function w(n){return n.innerRadius}function b(n){return n.outerRadius}function P(n){return n.startAngle}function T(n){return n.endAngle}function R(n){return n&&n.padAngle}function L(n,t,e,r,o,a,i){var l=n-e,u=t-r,c=(i?a:-a)/g(l*l+u*u),s=c*u,f=-c*l,h=n+s,y=t+f,d=e+s,x=r+f,v=(h+d)/2,m=(y+x)/2,M=d-h,A=x-y,j=M*M+A*A,w=o-a,b=h*x-d*y,P=(A<0?-1:1)*g(p(0,w*w*j-b*b)),T=(b*A-M*P)/j,R=(-b*M-A*P)/j,L=(b*A+M*P)/j,$=(-b*M+A*P)/j,I=T-v,k=R-m,B=L-v,K=$-m;return I*I+k*k>B*B+K*K&&(T=L,R=$),{cx:T,cy:R,x01:-s,y01:-f,x11:T*(o/w-1),y11:R*(o/w-1)}}function $(){var n=w,t=b,e=c(0),r=null,o=P,a=T,i=R,l=null,s=u(p);function p(){var u,c,p,w=+n.apply(this,arguments),b=+t.apply(this,arguments),P=o.apply(this,arguments)-M,T=a.apply(this,arguments)-M,R=f(T-P),$=T>P;if(l||(l=u=s()),b<w&&(c=b,b=w,w=c),b>v)if(R>A-v)l.moveTo(b*y(P),b*x(P)),l.arc(0,0,b,P,T,!$),w>v&&(l.moveTo(w*y(T),w*x(T)),l.arc(0,0,w,T,P,$));else{var I,k,B=P,K=T,N=P,S=T,D=R,E=R,F=i.apply(this,arguments)/2,q=F>v&&(r?+r.apply(this,arguments):g(w*w+b*b)),C=d(f(b-w)/2,+e.apply(this,arguments)),H=C,V=C;if(q>v){var W=j(q/w*x(F)),Z=j(q/b*x(F));(D-=2*W)>v?(N+=W*=$?1:-1,S-=W):(D=0,N=S=(P+T)/2),(E-=2*Z)>v?(B+=Z*=$?1:-1,K-=Z):(E=0,B=K=(P+T)/2)}var _=b*y(B),z=b*x(B),G=w*y(S),J=w*x(S);if(C>v){var O,Q=b*y(K),U=b*x(K),X=w*y(N),Y=w*x(N);if(R<m)if(O=function(n,t,e,r,o,a,i,l){var u=e-n,c=r-t,s=i-o,f=l-a,h=f*u-s*c;if(!(h*h<v))return[n+(h=(s*(t-a)-f*(n-o))/h)*u,t+h*c]}(_,z,X,Y,Q,U,G,J)){var nn=_-O[0],tn=z-O[1],en=Q-O[0],rn=U-O[1],on=1/x(((p=(nn*en+tn*rn)/(g(nn*nn+tn*tn)*g(en*en+rn*rn)))>1?0:p<-1?m:Math.acos(p))/2),an=g(O[0]*O[0]+O[1]*O[1]);H=d(C,(w-an)/(on-1)),V=d(C,(b-an)/(on+1))}else H=V=0}E>v?V>v?(I=L(X,Y,_,z,b,V,$),k=L(Q,U,G,J,b,V,$),l.moveTo(I.cx+I.x01,I.cy+I.y01),V<C?l.arc(I.cx,I.cy,V,h(I.y01,I.x01),h(k.y01,k.x01),!$):(l.arc(I.cx,I.cy,V,h(I.y01,I.x01),h(I.y11,I.x11),!$),l.arc(0,0,b,h(I.cy+I.y11,I.cx+I.x11),h(k.cy+k.y11,k.cx+k.x11),!$),l.arc(k.cx,k.cy,V,h(k.y11,k.x11),h(k.y01,k.x01),!$))):(l.moveTo(_,z),l.arc(0,0,b,B,K,!$)):l.moveTo(_,z),w>v&&D>v?H>v?(I=L(G,J,Q,U,w,-H,$),k=L(_,z,X,Y,w,-H,$),l.lineTo(I.cx+I.x01,I.cy+I.y01),H<C?l.arc(I.cx,I.cy,H,h(I.y01,I.x01),h(k.y01,k.x01),!$):(l.arc(I.cx,I.cy,H,h(I.y01,I.x01),h(I.y11,I.x11),!$),l.arc(0,0,w,h(I.cy+I.y11,I.cx+I.x11),h(k.cy+k.y11,k.cx+k.x11),$),l.arc(k.cx,k.cy,H,h(k.y11,k.x11),h(k.y01,k.x01),!$))):l.arc(0,0,w,S,N,$):l.lineTo(G,J)}else l.moveTo(0,0);if(l.closePath(),u)return l=null,u+""||null}return p.centroid=function(){var e=(+n.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+o.apply(this,arguments)+ +a.apply(this,arguments))/2-m/2;return[y(r)*e,x(r)*e]},p.innerRadius=function(t){return arguments.length?(n="function"==typeof t?t:c(+t),p):n},p.outerRadius=function(n){return arguments.length?(t="function"==typeof n?n:c(+n),p):t},p.cornerRadius=function(n){return arguments.length?(e="function"==typeof n?n:c(+n),p):e},p.padRadius=function(n){return arguments.length?(r=null==n?null:"function"==typeof n?n:c(+n),p):r},p.startAngle=function(n){return arguments.length?(o="function"==typeof n?n:c(+n),p):o},p.endAngle=function(n){return arguments.length?(a="function"==typeof n?n:c(+n),p):a},p.padAngle=function(n){return arguments.length?(i="function"==typeof n?n:c(+n),p):i},p.context=function(n){return arguments.length?(l=null==n?null:n,p):l},p}function I(n,t){return t<n?-1:t>n?1:t>=n?0:NaN}function k(n){return n}function B({label:u,rows:f}){const h=e(),[y,p]=r(Math.round,120),{tip:d,showAt:x,hide:g}=o(),[v,m]=n.useState(null),M=f.filter(n=>null!==n.value&&n.value>0),j=p?.width??0,w=p?.height??0,b=a(M.map(n=>n.value)),P=function(){var n=k,t=I,e=null,r=c(0),o=c(A),a=c(0);function i(i){var l,u,c,f,h,y=(i=s(i)).length,p=0,d=new Array(y),x=new Array(y),g=+r.apply(this,arguments),v=Math.min(A,Math.max(-A,o.apply(this,arguments)-g)),m=Math.min(Math.abs(v)/y,a.apply(this,arguments)),M=m*(v<0?-1:1);for(l=0;l<y;++l)(h=x[d[l]=l]=+n(i[l],l,i))>0&&(p+=h);for(null!=t?d.sort(function(n,e){return t(x[n],x[e])}):null!=e&&d.sort(function(n,t){return e(i[n],i[t])}),l=0,c=p?(v-y*M)/p:0;l<y;++l,g=f)u=d[l],f=g+((h=x[u])>0?h*c:0)+M,x[u]={data:i[u],index:l,value:h,startAngle:g,endAngle:f,padAngle:m};return x}return i.value=function(t){return arguments.length?(n="function"==typeof t?t:c(+t),i):n},i.sortValues=function(n){return arguments.length?(t=n,e=null,i):t},i.sort=function(n){return arguments.length?(e=n,t=null,i):e},i.startAngle=function(n){return arguments.length?(r="function"==typeof n?n:c(+nLine truncated
@@ -1 +0,0 @@
import{r as n,j as t}from"./vendor-react-64fcanlc.js";import{C as e,E as r}from"./index-CmbH0woS.js";import{bb as o,bj as a,be as i,bg as u}from"./activity-CiEWAlFW.js";import{w as l,c,a as s}from"./array-C0VuvQyb.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./ActionGroup-D3mQjUsw.js";import"./Select-BcN72K3H.js";const f=Math.abs,h=Math.atan2,y=Math.cos,p=Math.max,d=Math.min,x=Math.sin,g=Math.sqrt,v=1e-12,m=Math.PI,M=m/2,A=2*m;function j(n){return n>=1?M:n<=-1?-M:Math.asin(n)}function b(n){return n.innerRadius}function w(n){return n.outerRadius}function P(n){return n.startAngle}function R(n){return n.endAngle}function T(n){return n&&n.padAngle}function L(n,t,e,r,o,a,i){var u=n-e,l=t-r,c=(i?a:-a)/g(u*u+l*l),s=c*l,f=-c*u,h=n+s,y=t+f,d=e+s,x=r+f,v=(h+d)/2,m=(y+x)/2,M=d-h,A=x-y,j=M*M+A*A,b=o-a,w=h*x-d*y,P=(A<0?-1:1)*g(p(0,b*b*j-w*w)),R=(w*A-M*P)/j,T=(-w*M-A*P)/j,L=(w*A+M*P)/j,$=(-w*M+A*P)/j,B=R-v,E=T-m,I=L-v,N=$-m;return B*B+E*E>I*I+N*N&&(R=L,T=$),{cx:R,cy:T,x01:-s,y01:-f,x11:R*(o/b-1),y11:T*(o/b-1)}}function $(){var n=b,t=w,e=c(0),r=null,o=P,a=R,i=T,u=null,s=l(p);function p(){var l,c,p,b=+n.apply(this,arguments),w=+t.apply(this,arguments),P=o.apply(this,arguments)-M,R=a.apply(this,arguments)-M,T=f(R-P),$=R>P;if(u||(u=l=s()),w<b&&(c=w,w=b,b=c),w>v)if(T>A-v)u.moveTo(w*y(P),w*x(P)),u.arc(0,0,w,P,R,!$),b>v&&(u.moveTo(b*y(R),b*x(R)),u.arc(0,0,b,R,P,$));else{var B,E,I=P,N=R,S=P,k=R,C=T,D=T,F=i.apply(this,arguments)/2,K=F>v&&(r?+r.apply(this,arguments):g(b*b+w*w)),q=d(f(w-b)/2,+e.apply(this,arguments)),G=q,H=q;if(K>v){var V=j(K/b*x(F)),_=j(K/w*x(F));(C-=2*V)>v?(S+=V*=$?1:-1,k-=V):(C=0,S=k=(P+R)/2),(D-=2*_)>v?(I+=_*=$?1:-1,N-=_):(D=0,I=N=(P+R)/2)}var z=w*y(I),J=w*x(I),O=b*y(k),Q=b*x(k);if(q>v){var U,W=w*y(N),X=w*x(N),Y=b*y(S),Z=b*x(S);if(T<m)if(U=function(n,t,e,r,o,a,i,u){var l=e-n,c=r-t,s=i-o,f=u-a,h=f*l-s*c;if(!(h*h<v))return[n+(h=(s*(t-a)-f*(n-o))/h)*l,t+h*c]}(z,J,Y,Z,W,X,O,Q)){var nn=z-U[0],tn=J-U[1],en=W-U[0],rn=X-U[1],on=1/x(((p=(nn*en+tn*rn)/(g(nn*nn+tn*tn)*g(en*en+rn*rn)))>1?0:p<-1?m:Math.acos(p))/2),an=g(U[0]*U[0]+U[1]*U[1]);G=d(q,(b-an)/(on-1)),H=d(q,(w-an)/(on+1))}else G=H=0}D>v?H>v?(B=L(Y,Z,z,J,w,H,$),E=L(W,X,O,Q,w,H,$),u.moveTo(B.cx+B.x01,B.cy+B.y01),H<q?u.arc(B.cx,B.cy,H,h(B.y01,B.x01),h(E.y01,E.x01),!$):(u.arc(B.cx,B.cy,H,h(B.y01,B.x01),h(B.y11,B.x11),!$),u.arc(0,0,w,h(B.cy+B.y11,B.cx+B.x11),h(E.cy+E.y11,E.cx+E.x11),!$),u.arc(E.cx,E.cy,H,h(E.y11,E.x11),h(E.y01,E.x01),!$))):(u.moveTo(z,J),u.arc(0,0,w,I,N,!$)):u.moveTo(z,J),b>v&&C>v?G>v?(B=L(O,Q,W,X,b,-G,$),E=L(z,J,Y,Z,b,-G,$),u.lineTo(B.cx+B.x01,B.cy+B.y01),G<q?u.arc(B.cx,B.cy,G,h(B.y01,B.x01),h(E.y01,E.x01),!$):(u.arc(B.cx,B.cy,G,h(B.y01,B.x01),h(B.y11,B.x11),!$),u.arc(0,0,b,h(B.cy+B.y11,B.cx+B.x11),h(E.cy+E.y11,E.cx+E.x11),$),u.arc(E.cx,E.cy,G,h(E.y11,E.x11),h(E.y01,E.x01),!$))):u.arc(0,0,b,k,S,$):u.lineTo(O,Q)}else u.moveTo(0,0);if(u.closePath(),l)return u=null,l+""||null}return p.centroid=function(){var e=(+n.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+o.apply(this,arguments)+ +a.apply(this,arguments))/2-m/2;return[y(r)*e,x(r)*e]},p.innerRadius=function(t){return arguments.length?(n="function"==typeof t?t:c(+t),p):n},p.outerRadius=function(n){return arguments.length?(t="function"==typeof n?n:c(+n),p):t},p.cornerRadius=function(n){return arguments.length?(e="function"==typeof n?n:c(+n),p):e},p.padRadius=function(n){return arguments.length?(r=null==n?null:"function"==typeof n?n:c(+n),p):r},p.startAngle=function(n){return arguments.length?(o="function"==typeof n?n:c(+n),p):o},p.endAngle=function(n){return arguments.length?(a="function"==typeof n?n:c(+n),p):a},p.padAngle=function(n){return arguments.length?(i="function"==typeof n?n:c(+n),p):i},p.context=function(n){return arguments.length?(u=null==n?null:n,p):u},p}function B(n,t){return t<n?-1:t>n?1:t>=n?0:NaN}function E(n){return n}function I({label:l,rows:f}){const h=e(),[y,p]=r(Math.round,120),{tip:d,showAt:x,hide:g}=o(),[v,m]=n.useState(null),M=f.filter(n=>null!==n.value&&n.value>0),j=p?.width??0,b=p?.height??0,w=a(M.map(n=>n.value)),P=function(){var n=E,t=B,e=null,r=c(0),o=c(A),a=c(0);function i(i){var u,l,c,f,h,y=(i=s(i)).length,p=0,d=new Array(y),x=new Array(y),g=+r.apply(this,arguments),v=Math.min(A,Math.max(-A,o.apply(this,arguments)-g)),m=Math.min(Math.abs(v)/y,a.apply(this,arguments)),M=m*(v<0?-1:1);for(u=0;u<y;++u)(h=x[d[u]=u]=+n(i[u],u,i))>0&&(p+=h);for(null!=t?d.sort(function(n,e){return t(x[n],x[e])}):null!=e&&d.sort(function(n,t){return e(i[n],i[t])}),u=0,c=p?(v-y*M)/p:0;u<y;++u,g=f)l=d[u],f=g+((h=x[l])>0?h*c:0)+M,x[l]={data:i[l],index:u,value:h,startAngle:g,endAngle:f,padAngle:m};return x}return i.value=function(t){return arguments.length?(n="function"==typeof t?t:c(+t),i):n},i.sortValues=function(n){return arguments.length?(t=n,e=null,i):t},i.sort=function(n){return arguments.length?(e=n,t=null,i):e},i.startAngle=function(n){return arguments.length?(r="function"==typeof n?n:c(+n),i):r},i.endAngle=function(n){return arguments.length?(o="function"==typeof n?n:c(+n),i):o},Line truncated
@@ -1 +0,0 @@
import{r as e,$ as t,a as r,j as n}from"./vendor-react-64fcanlc.js";import{fS as o,gk as i,fJ as a,fF as s,dx as l,gl as d,gm as c,gn as p,fL as u,fG as g,fH as f,go as m,fI as h,gp as y,gq as D,fT as v,g7 as b,gr as w,gs as x,g8 as T,fQ as k,gt as E,bs as P,du as K,dl as O,bZ as S,aY as C,c$ as I,gd as j,aU as A,bD as R,J as M,E as B,C as L,m as F,gu as $,p as z,R as N,gv as V,gw as X,gx as Y,bJ as H,cT as U,l as q,W as J,O as G,dO as W,c9 as _,dd as Z,d6 as Q,ec as ee,gy as te,Q as re,gz as ne,gA as oe,bw as ie,gB as ae,gC as se,bR as le,gD as de,gE as ce,a4 as pe,b5 as ue}from"./index-CmbH0woS.js";import{aS as ge,aT as fe,aU as me,aV as he,aW as ye,aX as De,aY as ve,aZ as be,a_ as we,a$ as xe,b0 as Te,b1 as ke,b2 as Ee,b3 as Pe,b4 as Ke,b5 as Oe,b6 as Se,b7 as Ce,b8 as Ie,b9 as je,ba as Ae}from"./activity-CiEWAlFW.js";import{$ as Re,a as Me}from"./GridList-ByMoT8kr.js";import{k as Be}from"./Select-BcN72K3H.js";import{D as Le}from"./Delete-CQeLz6oG.js";import{S as Fe,u as $e,$ as ze}from"./ActionGroup-D3mQjUsw.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./Checkbox-f7Je53QZ.js";var Ne=function(e){return e[e.none=0]="none",e[e.cancel=0]="cancel",e[e.move=1]="move",e[e.copy=2]="copy",e[e.link=4]="link",e[e.all=7]="all",e}({});const Ve={...Ne,copyMove:3,copyLink:6,linkMove:5,all:7,uninitialized:7},Xe=Ue(Ve);Xe[7]="all";const Ye={none:"cancel",link:"link",copy:"copy",move:"move"},He=Ue(Ye);function Ue(e){let t={};for(let r in e)t[e[r]]=r;return t}const qe=new Set(["text/plain","text/uri-list","text/html"]),Je="application/vnd.react-aria.items+json",Ge="application/octet-stream",We=new WeakMap,_e=Symbol();function Ze(e){let t=new Set;for(let r of e)for(let e of Object.keys(r))t.add(e);return t}function Qe(e){return e||(e="virtual"),"pointer"===e&&(e="virtual"),"virtual"===e&&"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches&&(e="touch"),e}function et(){return Qe(o())}function tt(){return Qe(i())}class rt{constructor(e){this.types=new Set;let t=!1;for(let r of e.items)r.type!==Je&&("file"===r.kind&&(t=!0),r.type?this.types.add(r.type):this.types.add(Ge));this.includesUnknownTypes=!t&&e.types.includes("Files")}has(e){if(Array.isArray(e))return e.some(e=>this.has(e));if(this.includesUnknownTypes||e===_e&&this.types.has(Ge)||"*/*"===e)return!0;if("string"==typeof e){if(e.endsWith("/*")){for(let t of this.types)if(t.startsWith(e.slice(0,-2)))return!0;return!1}return this.types.has(e)}return!1}}function nt(e){if(!e)throw new Error("No file provided");return{kind:"file",type:e.type||Ge,name:e.name,getText:()=>{return"function"==typeof(t=e).text?t.text():new Promise((e,r)=>{let n=new FileReader;n.onload=()=>{e(n.result)},n.onerror=r,n.readAsText(t)});var t},getFile:()=>Promise.resolve(e)}}function ot(e){return{kind:"directory",name:e.name,getEntries:()=>async function*(e){let t,r=e.createReader();do{t=await new Promise((e,t)=>{r.readEntries(e,t)});for(let e of t)if(e.isFile){let t=await it(e);yield nt(t)}else e.isDirectory&&(yield ot(e))}while(t.length>0)}(e)}}function it(e){return new Promise((t,r)=>e.file(t,r))}let at,st={draggingKeys:new Set};function lt(e){st.dropCollectionRef=e}function dt(){st={draggingKeys:new Set}}function ct(e){let{draggingCollectionRef:t,dropCollectionRef:r}=st;return null!=t?.current&&t.current===(e?.current||r?.current)}function pt(e){at=e}let ut=Ne.none;function gt(e){ut=e}let ft=new Map,mt=new Map,ht=null,yt=new Set;function Dt(e){return ft.set(e.element,e),ht?.updateValidDropTargets(),()=>{ft.delete(e.element),ht?.updateValidDropTargets()}}function vt(){let[t,r]=e.useState(ht);return e.useEffect(()=>{let e=()=>r(ht);return yt.add(e),()=>{yt.delete(e)}},[]),t}function bt(){return!!ht}const wt=["pointerdown","pointermove","pointerenter","pointerleave","pointerover","pointerout","pointerup","mousedown","mousemove","mouseenter","mouseleave","mouseover","mouseout","mouseup","touchstart","touchmove","touchend","focusin","focusout"],xt=["pointerup","mouseup","touchend"],Tt={keyboard:"dragStartedKeyboard",touch:"dragStartedTouch",virtual:"dragStartedVirtual"};class kt{constructor(e,t){this.validDropTargets=[],this.currentDropTarget=null,this.currentDropItem=null,this.dropOperation=null,this.mutationObserver=null,this.restoreAriaHidden=null,this.isVirtualClick=!1,this.dragTarget=e,this.stringFormatter=t,this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),this.onClick=this.onClick.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.cancelEvent=this.cancelEvent.bind(this),this.initialFocused=!1}setup(){document.addEventListener("keydown",this.onKeyDown,!0),document.addEventListener("keyup",this.onKeyUp,!0),window.addEventListener("focus",this.onFocus,!0),window.addEventListener("blur",this.onBlur,!0),document.addEventListener("click",this.onClick,!0),document.addEventListener("pointerdown",this.onPointerDown,!0);for(let Line truncated
@@ -0,0 +1 @@
import{r as e,$ as t,a as r,j as n}from"./vendor-react-64fcanlc.js";import{ey as o,gi as i,ep as a,el as s,cN as l,gj as d,gk as c,gl as p,er as u,em as g,en as f,dv as m,eo as h,gb as y,gm as D,ez as v,eP as b,gn as w,go as x,eQ as T,ew as k,dx as E,bp as P,cK as K,cC as O,b7 as S,aD as C,cn as I,eW as j,az as A,bs as R,B as M,f as B,u as L,R as F,ch as $,q as z,d2 as N,bK as V,cw as X,df as Y,b5 as H,aL as q,gp as U,P as J,gq as W,A as _}from"./index-ucpAK88B.js";import{b5 as G,b6 as Q,b7 as Z,b8 as ee,b9 as te,ba as re,bb as ne,bc as oe,bd as ie,be as ae,bf as se,bg as le,bh as de,bi as ce,bj as pe,bk as ue,bl as ge,bm as fe,bn as me,bo as he,bp as ye,bq as De,br as ve,bs as be,bt as we,bu as xe,bv as Te,bw as ke,bx as Ee,by as Pe,bz as Ke,bA as Oe,bB as Se,bC as Ce,bD as Ie,bE as je,bF as Ae}from"./activity-CbXYXdVY.js";import{$ as Re,a as Me}from"./GridList-DW6-BWSL.js";import{m as Be}from"./Select-2JXPV40Q.js";import{D as Le}from"./Delete-BwK55moY.js";import{S as Fe,c as $e,$ as ze}from"./logs-DjZPFUMm.js";import{C as Ne}from"./AppearanceControls-DmbIJj4H.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./nodes-DqXrz-fh.js";import"./ItemText-CtNOgl4O.js";import"./Checkbox-eZH7dxup.js";var Ve=function(e){return e[e.none=0]="none",e[e.cancel=0]="cancel",e[e.move=1]="move",e[e.copy=2]="copy",e[e.link=4]="link",e[e.all=7]="all",e}({});const Xe={...Ve,copyMove:3,copyLink:6,linkMove:5,all:7,uninitialized:7},Ye=Ue(Xe);Ye[7]="all";const He={none:"cancel",link:"link",copy:"copy",move:"move"},qe=Ue(He);function Ue(e){let t={};for(let r in e)t[e[r]]=r;return t}const Je=new Set(["text/plain","text/uri-list","text/html"]),We="application/vnd.react-aria.items+json",_e="application/octet-stream",Ge=new WeakMap,Qe=Symbol();function Ze(e){let t=new Set;for(let r of e)for(let e of Object.keys(r))t.add(e);return t}function et(e){return e||(e="virtual"),"pointer"===e&&(e="virtual"),"virtual"===e&&"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches&&(e="touch"),e}function tt(){return et(o())}function rt(){return et(i())}class nt{constructor(e){this.types=new Set;let t=!1;for(let r of e.items)r.type!==We&&("file"===r.kind&&(t=!0),r.type?this.types.add(r.type):this.types.add(_e));this.includesUnknownTypes=!t&&e.types.includes("Files")}has(e){if(Array.isArray(e))return e.some(e=>this.has(e));if(this.includesUnknownTypes||e===Qe&&this.types.has(_e)||"*/*"===e)return!0;if("string"==typeof e){if(e.endsWith("/*")){for(let t of this.types)if(t.startsWith(e.slice(0,-2)))return!0;return!1}return this.types.has(e)}return!1}}function ot(e){if(!e)throw new Error("No file provided");return{kind:"file",type:e.type||_e,name:e.name,getText:()=>{return"function"==typeof(t=e).text?t.text():new Promise((e,r)=>{let n=new FileReader;n.onload=()=>{e(n.result)},n.onerror=r,n.readAsText(t)});var t},getFile:()=>Promise.resolve(e)}}function it(e){return{kind:"directory",name:e.name,getEntries:()=>async function*(e){let t,r=e.createReader();do{t=await new Promise((e,t)=>{r.readEntries(e,t)});for(let e of t)if(e.isFile){let t=await at(e);yield ot(t)}else e.isDirectory&&(yield it(e))}while(t.length>0)}(e)}}function at(e){return new Promise((t,r)=>e.file(t,r))}let st,lt={draggingKeys:new Set};function dt(e){lt.dropCollectionRef=e}function ct(){lt={draggingKeys:new Set}}function pt(e){let{draggingCollectionRef:t,dropCollectionRef:r}=lt;return null!=t?.current&&t.current===(e?.current||r?.current)}function ut(e){st=e}let gt=Ve.none;function ft(e){gt=e}let mt=new Map,ht=new Map,yt=null,Dt=new Set;function vt(e){return mt.set(e.element,e),yt?.updateValidDropTargets(),()=>{mt.delete(e.element),yt?.updateValidDropTargets()}}function bt(){let[t,r]=e.useState(yt);return e.useEffect(()=>{let e=()=>r(yt);return Dt.add(e),()=>{Dt.delete(e)}},[]),t}function wt(){return!!yt}const xt=["pointerdown","pointermove","pointerenter","pointerleave","pointerover","pointerout","pointerup","mousedown","mousemove","mouseenter","mouseleave","mouseover","mouseout","mouseup","touchstart","touchmove","touchend","focusin","focusout"],Tt=["pointerup","mouseup","touchend"],kt={keyboard:"dragStartedKeyboard",touch:"dragStartedTouch",virtual:"dragStartedVirtual"};class Et{constructor(e,t){this.validDropTargets=[],this.currentDropTarget=null,this.currentDropItem=null,this.dropOperation=null,this.mutationObserver=null,this.restoreAriaHidden=null,this.isVirtualClick=!1,this.dragTarget=e,this.stringFormatter=t,this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),this.onClick=this.onClick.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.cancelEvent=this.cancelEvent.bind(this),this.initialFocused=!1}setup(){document.addEventListener("keydown",this.onKeyDown,!0),document.addEventListener("keyup",this.onKeyUp,!0),window.addEventListener("focus",this.onFocus,!0),window.addEventListener("blur",this.onBlur,!0),document.addELine truncated
@@ -0,0 +1 @@
import{r as e,j as t}from"./vendor-react-64fcanlc.js";import{U as n,a2 as s,a4 as r,a1 as a,h as i,a9 as o,u as l,al as d,l as c,q as m,c2 as u,ab as p,ac as v,dp as h,dq as j,T as f,av as x,B as b,p as g,E as w}from"./index-ucpAK88B.js";import{L as k}from"./AppearanceControls-DmbIJj4H.js";import{d as y,O as T,K as N,L as C}from"./logs-DjZPFUMm.js";import{T as H}from"./Toolbar-D1_-nNpE.js";import{D as _}from"./Table-mJjr_XDH.js";import{d as K,e as O}from"./files-Dt8K7QfP.js";import{j as S,D as W}from"./activity-CbXYXdVY.js";import{u as L,C as M}from"./Copy-DVmMYo4E.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./ItemText-CtNOgl4O.js";import"./Select-2JXPV40Q.js";import"./nodes-DqXrz-fh.js";import"./Checkbox-eZH7dxup.js";import"./Virtualizer-mx6Yxab_.js";const R={buffer_overflow:["event.gap.overflow","event.gapHelp.overflow"],evicted:["event.gap.evicted","event.gapHelp.evicted"]};function q(e,t){const n="flow.gap"===e.event&&Object.hasOwn(R,e.data.reason)?R[e.data.reason]:void 0;return n&&{title:t(n[0]),text:t(n[1])}}function D(e,t){const n=e=>e?[{id:"flow",label:t("event.viewFlow"),href:i("flows",{tab:"records",id:e})}]:[];switch(e.event){case"flow.updated":return n(e.data.resource_id);case"flow.gap":return[...n(e.data.resource_id),{id:"recording",label:t("ui.recordingSettings"),href:S}];case"generation.changed":return[{id:"config",label:t("event.viewConfig"),href:i("config")}];default:return[]}}const F=new WeakMap;function I(e,t,i,o,l,d,c,m,u=!1,p=()=>!1){const v="without-runtime"===t||m.includes(t)?t:"all",h=e.filter(e=>"all"===v||("without-runtime"===v?"runtime.updated"!==e.event:e.event===v)).slice(0,l);return{kind:v,rows:h.map(e=>function(e,t,i,o){const l=F.get(e);if(l&&l.locale===t)return l.row;const d=o?{key:"event.lostHistory"}:r(e,i),c={id:y(e),timestamp:a(e.data.observed_at,t),iso:e.data.observed_at,kind:e.event,kindText:n(s,e.event,i),summary:i(d.key,d.params),help:q(e,i),links:D(e,i),event:e};return F.set(e,{locale:t,row:c}),c}(e,d,c,p(e))),kinds:[{id:"without-runtime",label:c("event.withoutRuntime")},{id:"all",label:c("event.allKinds")},...m.map(e=>({id:e,label:n(s,e,c)}))],status:u&&!1!==o?{tone:"err",text:c("event.disconnected")}:{tone:i?"ok":null===o?"muted":"warn",text:c(!1===o?"event.unavailable":i?"event.connected":null===o?"ui.loading":"event.reconnecting")},limitText:c("event.limit",{n:l}),shown:h}}function J(){const t=o(),n=l(),s=d[c()],r=m(),a=r.data?.resources.events.kinds,[i,f]=e.useState("without-runtime"),x="all"!==i&&"runtime.updated"!==i&&a?.includes(i),b=T("without-runtime"!==i&&!x),g=e.useMemo(()=>I(b.events,i,b.connected,b.available,j,s,n,a??[],!!b.error,h),[b.events,i,b.connected,b.available,b.error,s,n,a]);return u(g.kind,f),{...g,setKind:f,cursor:b.cursor,error:b.error,retry:()=>{p().then(()=>v(t))},loading:!b.error&&!b.connected&&!1!==b.available&&!b.events.length,export:()=>{return K(O("doona-events","json"),(e=g.shown,JSON.stringify(e,null,2)+"\n"),"application/json");var e}}}function P(){const n=l(),s=J(),r=L(),a=e.useMemo(()=>[{id:"t",label:n("ui.time"),minWidth:212,grow:0,drop:1,render:e=>t.jsx(f,{className:"rp-code",text:e.iso,children:e.timestamp})},{id:"k",label:n("event.kind"),minWidth:224,drop:2,render:e=>t.jsx(f,{text:e.kind,children:e.kindText})},{id:"m",label:n("event.summary"),minWidth:176,isRowHeader:!0,render:e=>t.jsx(x,{fill:!0,help:e.help,children:t.jsx(f,{children:e.summary})})},{id:"actions",actions:!0,label:n("ui.actions"),hideLabel:!0,minWidth:64,grow:0,render:e=>t.jsx(b,{small:!0,quiet:!0,icon:!0,label:n("ui.copyRecord"),onPress:()=>{r((e=>JSON.stringify(e,null,2))(e.event))},children:t.jsx(M,{})})}],[n,r]),i=e.useCallback(e=>t.jsxs(t.Fragment,{children:[t.jsx(N,{inline:!0,items:[[n("ui.time"),e.timestamp],[n("event.kind"),e.kindText],[n("event.summary"),e.summary]]}),e.links.length>0&&t.jsx("div",{className:"rp-cluster",children:e.links.map(e=>t.jsx(k,{appearance:"button",href:e.href,children:e.label},e.id))})]}),[n]);return t.jsxs("div",{className:"rp-page",children:[t.jsxs(H,{page:!0,children:[t.jsx(C,{label:n("event.kind"),side:!0,value:s.kind,onChange:s.setKind,items:s.kinds}),t.jsx(g,{small:!0,tone:s.status.tone,children:s.status.text}),s.cursor&&t.jsx(f,{text:s.cursor,children:t.jsx("span",{className:"rp-label",children:n("event.cursor")})}),t.jsx("span",{className:"rp-label",children:s.limitText}),t.jsx("span",{className:"rp-grow"}),t.jsxs(b,{isDisabled:!s.rows.length,onPress:s.export,children:[t.jsx(W,{}),n("event.export")]})]}),s.error&&t.jsx(w,{error:s.error,onRetry:s.retry}),t.jsx(_,{label:n("nav.events"),stream:!0,flow:!0,loading:s.loading,rows:s.rows,empty:n("event.empty"),cols:a,detail:i})]})}export{P as Events};
@@ -1 +0,0 @@
import{r as e,j as t}from"./vendor-react-64fcanlc.js";import{ae as n,an as r,ap as s,am as a,j as i,at as o,C as l,aF as d,P as c,W as m,cC as u,av as p,aw as v,fa as h,fb as f,T as x,aQ as j,bG as w,D as b,V as g,J as k,K as y}from"./index-CmbH0woS.js";import{v as T,L as C}from"./ActionGroup-D3mQjUsw.js";import{T as N}from"./Toolbar-B9K5nAyx.js";import{D as H}from"./Table-Cfbaho6J.js";import{d as _,e as D}from"./files-Dt8K7QfP.js";import{n as W,D as K}from"./activity-CiEWAlFW.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./Select-BcN72K3H.js";import"./Checkbox-f7Je53QZ.js";import"./Virtualizer-itu1Kg0o.js";const S={buffer_overflow:["event.gap.overflow","event.gapHelp.overflow"],evicted:["event.gap.evicted","event.gapHelp.evicted"]};function F(e,t){const n="flow.gap"===e.event&&Object.hasOwn(S,e.data.reason)?S[e.data.reason]:void 0;return n&&{title:t(n[0]),text:t(n[1])}}function G(e,t){const n=e=>e?[{id:"flow",label:t("event.viewFlow"),href:i("flows",{tab:"records",id:e})}]:[];switch(e.event){case"flow.updated":return n(e.data.resource_id);case"flow.gap":return[...n(e.data.resource_id),{id:"recording",label:t("ui.recordingSettings"),href:W}];case"generation.changed":return[{id:"config",label:t("event.viewConfig"),href:i("config")}];default:return[]}}const M=new WeakMap;function O(e,t,i,o,l,d,c,m,u=!1,p=()=>!1){const v="without-runtime"===t||m.includes(t)?t:"all",h=e.filter(e=>"all"===v||("without-runtime"===v?"runtime.updated"!==e.event:e.event===v)).slice(0,l);return{kind:v,rows:h.map(e=>function(e,t,i,o){const l=M.get(e);if(l&&l.locale===t)return l.row;const d=o?{key:"event.lostHistory"}:s(e,i),c={id:e.id,timestamp:a(e.data.observed_at,t),iso:e.data.observed_at,kind:e.event,kindText:n(r,e.event,i),summary:i(d.key,d.params),help:F(e,i),links:G(e,i)};return M.set(e,{locale:t,row:c}),c}(e,d,c,p(e))),kinds:[{id:"without-runtime",label:c("event.withoutRuntime")},{id:"all",label:c("event.allKinds")},...m.map(e=>({id:e,label:n(r,e,c)}))],status:u&&!1!==o?{tone:"err",text:c("event.disconnected")}:{tone:i?"ok":null===o?"muted":"warn",text:c(!1===o?"event.unavailable":i?"event.connected":null===o?"ui.loading":"event.reconnecting")},limitText:c("event.limit",{n:l}),shown:h}}function R(){const t=o(),n=l(),r=d[c()],s=m(),a=s.data?.resources.events.kinds,[i,x]=e.useState("without-runtime"),j="all"!==i&&"runtime.updated"!==i&&a?.includes(i),w=T("without-runtime"!==i&&!j),b=e.useMemo(()=>O(w.events,i,w.connected,w.available,f,r,n,a??[],!!w.error,h),[w.events,i,w.connected,w.available,w.error,r,n,a]);return u(b.kind,x),{...b,setKind:x,cursor:w.cursor,error:w.error,retry:()=>{p().then(()=>v(t))},loading:!w.error&&!w.connected&&!1!==w.available&&!w.events.length,export:()=>{return _(D("doona-events","json"),(e=b.shown,JSON.stringify(e,null,2)+"\n"),"application/json");var e}}}function J(){const n=l(),r=R(),s=e.useMemo(()=>[{id:"t",label:n("ui.time"),minWidth:212,grow:0,drop:1,render:e=>t.jsx(x,{className:"rp-code",text:e.iso,children:e.timestamp})},{id:"k",label:n("event.kind"),minWidth:224,drop:2,render:e=>t.jsx(x,{text:e.kind,children:e.kindText})},{id:"m",label:n("event.summary"),minWidth:240,isRowHeader:!0,render:e=>t.jsx(j,{fill:!0,help:e.help,children:t.jsx(x,{children:e.summary})})}],[n]),a=e.useCallback(e=>t.jsxs(t.Fragment,{children:[t.jsx(w,{inline:!0,items:[[n("ui.time"),e.timestamp],[n("event.kind"),e.kindText],[n("event.summary"),e.summary]]}),e.links.length>0&&t.jsx("div",{className:"rp-cluster",children:e.links.map(e=>t.jsx(b,{appearance:"button",small:!0,href:e.href,children:e.label},e.id))})]}),[n]);return t.jsxs("div",{className:"rp-page",children:[t.jsxs(N,{page:!0,children:[t.jsx(C,{label:n("event.kind"),side:!0,value:r.kind,onChange:r.setKind,items:r.kinds}),t.jsx(g,{small:!0,tone:r.status.tone,children:r.status.text}),r.cursor&&t.jsx(x,{text:r.cursor,children:t.jsx("span",{className:"rp-label",children:n("event.cursor")})}),t.jsx("span",{className:"rp-label",children:r.limitText}),t.jsx("span",{className:"rp-grow"}),t.jsxs(k,{isDisabled:!r.rows.length,onPress:r.export,children:[t.jsx(K,{}),n("event.export")]})]}),r.error&&t.jsx(y,{error:r.error,onRetry:r.retry}),t.jsx(H,{label:n("nav.events"),stream:!0,flow:!0,loading:r.loading,rows:r.rows,empty:n("event.empty"),cols:s,detail:a})]})}export{J as Events};
@@ -0,0 +1 @@
import{r as e,j as s}from"./vendor-react-64fcanlc.js";import{u as a,l,ct as t,al as o,dg as i,b5 as n,B as r}from"./index-ucpAK88B.js";import{S as c}from"./SearchSelect-CQDeD6gi.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./Select-2JXPV40Q.js";import"./ItemText-CtNOgl4O.js";import"./SearchList-BxTMvuPr.js";import"./Virtualizer-mx6Yxab_.js";function m({name:n,value:r,automaticFlag:m,onChange:d}){const f=a(),g=l(),p=e.useMemo(()=>t(o[g]),[g]),j=i(n),u=p.find(e=>e.flag===m),h=u?f("flags.detected",{region:u.label}):f("flags.automatic");return s.jsx("div",{className:"rp-list",children:s.jsx(c,{label:f("flags.region"),description:f(j?"flags.embedded":"flags.help"),isDisabled:j,searchLabel:f("flags.search"),value:j?"automatic":r,onChange:d,sections:[{id:"flags",items:[{id:"automatic",label:h,flag:m},{id:"none",label:f("flags.none"),flag:null},...p]}]})})}function d({name:e,onClose:l,...t}){const o=a();return s.jsxs(n,{narrow:!0,title:o("flags.edit"),isOpen:!0,onOpenChange:e=>{e||l()},footer:()=>s.jsx(r,{onPress:l,children:o("ui.close")}),children:[s.jsx("p",{className:"rp-note",children:e}),s.jsx(m,{name:e,...t})]})}export{m as FlagField,d as FlagPicker};
@@ -1 +0,0 @@
import{r as e,j as a}from"./vendor-react-64fcanlc.js";import{C as s,P as l,d9 as n,aF as o,eu as i,d6 as r,J as t}from"./index-CmbH0woS.js";import{S as c}from"./SearchSelect-CuaWhoLz.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./Select-BcN72K3H.js";import"./SearchList-CJ8rQxgu.js";import"./Virtualizer-itu1Kg0o.js";function m({name:r,value:t,automaticFlag:m,onChange:d}){const f=s(),g=l(),j=e.useMemo(()=>n(o[g]),[g]),p=i(r),u=j.find(e=>e.flag===m),h=u?f("flags.detected",{region:u.label}):f("flags.automatic");return a.jsx("div",{className:"rp-list",children:a.jsx(c,{label:f("flags.region"),description:f(p?"flags.embedded":"flags.help"),isDisabled:p,searchLabel:f("flags.search"),value:p?"automatic":t,onChange:d,sections:[{id:"flags",items:[{id:"automatic",label:h,flag:m},{id:"none",label:f("flags.none"),flag:null},...j]}]})})}function d({name:e,onClose:l,...n}){const o=s();return a.jsxs(r,{narrow:!0,title:o("flags.edit"),isOpen:!0,onOpenChange:e=>{e||l()},footer:()=>a.jsx(t,{onPress:l,children:o("ui.close")}),children:[a.jsx("p",{className:"rp-note",children:e}),a.jsx(m,{name:e,...n})]})}export{m as FlagField,d as FlagPicker};
@@ -0,0 +1 @@
import{r as e,j as t}from"./vendor-react-64fcanlc.js";import{O as n}from"./OutboundTag-DLjv1HUR.js";import{l as a,p as o,c as s,h as r,R as l,S as i,L as d,K as u}from"./logs-DjZPFUMm.js";import{a6 as c,M as p,a3 as m,H as f,G as g,c4 as w,c6 as h,w as b,bZ as v,U as j,b$ as x,c0 as y,al as k,a1 as _,h as M,ak as N,o as L,a8 as S,Y as T,u as C,l as P,i as O,B as F,N as R,b7 as E,ax as H,q,r as W,b4 as $,c8 as I,c3 as D,aG as A,E as U,T as B,aE as J,bx as K,S as Q,af as G,C as V}from"./index-ucpAK88B.js";import{h as Z,f as z,i as X,o as Y,j as ee,d as te}from"./activity-CbXYXdVY.js";import{w as ne}from"./labels-D8xxfRTQ.js";import{c as ae,C as oe}from"./Coverage-C9FbmITi.js";import{f as se}from"./nav-CeXAWPew.js";import{L as re}from"./AppearanceControls-DmbIJj4H.js";import{T as le}from"./Tabs-DrhG95XR.js";import{T as ie}from"./Toolbar-D1_-nNpE.js";import{D as de}from"./Table-mJjr_XDH.js";import{T as ue}from"./TimeCell-BqAcq3yb.js";import{a as ce,u as pe,b as me}from"./flows-D8MpHTkU.js";import{u as fe}from"./outbounds-KqKr_Phl.js";import{u as ge,Q as we,R as he}from"./useQuickRule-BWE0DtUt.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./Tag-C65IJXSk.js";import"./Select-2JXPV40Q.js";import"./ItemText-CtNOgl4O.js";import"./nodes-DqXrz-fh.js";import"./Checkbox-eZH7dxup.js";import"./Virtualizer-mx6Yxab_.js";import"./DaeCode-DEjXqvav.js";import"./daeTokens-BVtuNnWZ.js";import"./AddCircle-Dk2gnxD-.js";import"./SearchSelect-CQDeD6gi.js";import"./SearchList-BxTMvuPr.js";import"./rule-Ce4KC3th.js";const be=["client","rule","outbound","node"];function ve(e,t){if(e.rule_id)return null!==e.rule_generation_id&&e.rule_generation_id===t?e.rule_id:e.rule_id+"\0"+e.rule_expression}function je(e,t,n,a){switch(t){case"client":{const t=p(e.input?.src??void 0);return{label:t??"unknown",unknown:!t}}case"rule":return e.rule_expression?{label:e.rule_expression,unknown:!1,key:ve(e,a)}:{label:"unknown",unknown:!0};case"outbound":return e.outbound?{label:e.outbound,unknown:!1}:{label:"unknown",unknown:!0};case"node":{if(c(e.outbound))return null;const t=e.chain.at(-1)??null;return t?{label:n.get(t)??t,unknown:!1,key:t}:{label:"unknown",unknown:!0}}}}const xe=(e,t)=>z(e,t.unknown?"":t.key??t.label),ye=e=>Z(e,be)?.kind,ke=new Map;function _e(e,t,n){const a=ye(t);return a?e.filter(e=>{const o=je(e,a,ke,n?.generation_id);return null!==o&&xe(a,o)===t}):[]}function Me(e,t,n,a){const o=Z(e,be);if(!o||""===o.value)return a(null);const{kind:s,value:r}=o;return"rule"===s?r.includes("\0")?r.slice(r.indexOf("\0")+1):t.find(e=>e.rule_id===r)?.expression??r:"node"===s?n.get(r)??r:"client"===s?r:a(r)}function Ne(e,t,n,a,o="rule"){const s=(e=>new Map(e.map(e=>[e.id,e.name])))(n),r=new Map(t.map(e=>[e.id,e])),l=new Map(t.map(e=>[e.name,e])),i=new Map(n.map(e=>[e.id,e])),d=new Map,u=new Map,p=new Map,w=new Map,h=(e,t)=>{const n=e+">"+t;let a=w.get(n);return a||w.set(n,a={source:e,target:t,count:0}),a},b=(e,t,n=!1)=>{const a=xe("node",{key:e,label:t,unknown:n});let o=p.get(a);if(!o){const s=n?void 0:i.get(e),r=s&&f(s);p.set(a,o={id:a,label:t,count:0,unknown:n||void 0,latency:g(r),unavailable:"unavailable"===r?.state})}return o},v=(e,t=!1)=>{const n=xe("outbound",{label:e,unknown:t});let a=u.get(n);if(a)return a;const o=t?void 0:l.get(e),d=t?{groups:[],member:null}:m(e,o?.selection.tcp_member_id?"tcp":"udp",l,r,i),p=d.groups.map(e=>({name:e.name,kind:e.policy.kind,policy:e.policy.native})),f=d.member;return a={id:n,label:e,count:0,unknown:t||void 0,kind:t?"unknown":c(e)?e:p.length?"group":"unknown",groups:p,node:f&&b(f,s.get(f)??f).id},u.set(n,a),a.node&&h(n,a.node),a},j=(e,t,n=!1)=>{let a=d.get(e);return a||d.set(e,a={id:e,label:t,count:0,unknown:n||void 0,outbound:null,must:!1}),a};if("rule"===o)for(const c of a?.rules??[]){const e=j(xe("rule",{key:c.rule_id,label:c.expression}),c.expression);e.must=c.must,c.outbound&&(e.outbound=v(c.outbound).id,h(e.id,e.outbound))}const x=[o,"outbound","node"];for(const c of e){let e;for(const t of x){const n=je(c,t,s,a?.generation_id);if(!n)break;const o="outbound"===t?v(n.label,n.unknown):"node"===t?b(n.key??n.label,n.label,n.unknown):j(xe(t,n),n.label,n.unknown);o.count++,e&&h(e.id,o.id).count++,e=o}}for(const c of t)v(c.name);const y=new Set([...d.values()].map(e=>e.outbound)),k=new Set([...u.values()].flatMap(e=>e.groups.slice(1).map(e=>e.name))),_=[...u.values()].filter(e=>e.count||y.has(e.id)||!k.has(e.label)),M=new Set(_.map(e=>e.id)),N=[...w.values()].filter(e=>M.has(e.source)||M.has(e.target)),L=new Set(N.map(e=>e.target));return{by:o,leaves:[...d.values()],outbounds:_,nodes:[...p.values()].filter(e=>L.has(e.id)),links:N}}const Le=new WeakMap;function Se(e){const t=Le.get(e);if(t)return t;const n=new Map,a=new Map,o=new Map;for(const l of e.links){for(const[e,t]of[[n,l.source],[a,l.target]]){let n=e.get(t);n||e.set(t,n=[]),n.push(l)}(!o.has(l.source)||o.get(l.source).count<l.count)&&o.set(l.source,l)}const s=new Map;for(const l of[...e.leaves,...e.outbounds]){const e=("groups"in l?l.node:l.outbound)??oLine truncated
@@ -1 +0,0 @@
import{r as e,j as t}from"./vendor-react-64fcanlc.js";import{O as n}from"./OutboundTag-DROnordp.js";import{l as a,i as o,u as s,c as r,R as l,S as i,L as d}from"./ActionGroup-D3mQjUsw.js";import{i as u,ab as c,ao as p,a8 as m,a7 as f,cE as g,cG as w,w as h,cx as b,ae as v,cz as j,cA as x,aF as y,am as k,j as _,aE as M,o as N,as as L,ai as S,C as T,P as C,G as P,J as F,N as O,bZ as R,aS as E,W as H,X as W,b_ as q,cJ as D,cD as A,A as I,K as $,T as G,aZ as J,D as U,bQ as Q,bG as z,az as B,M as K}from"./index-CmbH0woS.js";import{l as V,i as Z,m as X,o as Y,n as ee,h as te}from"./activity-CiEWAlFW.js";import{w as ne}from"./labels-D8xxfRTQ.js";import{c as ae,C as oe}from"./Coverage-P-BXHg4t.js";import{f as se}from"./nav-Y_78QUku.js";import{T as re}from"./Tabs-BzeNgTje.js";import{T as le}from"./Toolbar-B9K5nAyx.js";import{D as ie}from"./Table-Cfbaho6J.js";import{T as de}from"./TimeCell-D0UB-mKs.js";import{a as ue,u as ce,b as pe}from"./flows-BMReQznn.js";import{u as me}from"./outbounds-CUyNhEhE.js";import{u as fe,Q as ge,R as we}from"./useQuickRule-C0zoMd-O.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./Tag-fyQjN-Xw.js";import"./Select-BcN72K3H.js";import"./Checkbox-f7Je53QZ.js";import"./Virtualizer-itu1Kg0o.js";import"./DaeCode-DEjXqvav.js";import"./daeTokens-BVtuNnWZ.js";import"./AddCircle-JwHCi_at.js";import"./SearchSelect-CuaWhoLz.js";import"./SearchList-CJ8rQxgu.js";const he=["client","rule","outbound","node"];function be(e,t){if(e.rule_id)return null!==e.rule_generation_id&&e.rule_generation_id===t?e.rule_id:e.rule_id+"\0"+e.rule_expression}function ve(e,t,n,a){switch(t){case"client":{const t=c(e.input?.src??void 0);return{label:t??"unknown",unknown:!t}}case"rule":return e.rule_expression?{label:e.rule_expression,unknown:!1,key:be(e,a)}:{label:"unknown",unknown:!0};case"outbound":return e.outbound?{label:e.outbound,unknown:!1}:{label:"unknown",unknown:!0};case"node":{if(u(e.outbound))return null;const t=e.chain.at(-1)??null;return t?{label:n.get(t)??t,unknown:!1,key:t}:{label:"unknown",unknown:!0}}}}const je=(e,t)=>Z(e,t.unknown?"":t.key??t.label),xe=e=>V(e,he)?.kind,ye=new Map;function ke(e,t,n){const a=xe(t);return a?e.filter(e=>{const o=ve(e,a,ye,n?.generation_id);return null!==o&&je(a,o)===t}):[]}function _e(e,t,n,a){const o=V(e,he);if(!o||""===o.value)return a(null);const{kind:s,value:r}=o;return"rule"===s?r.includes("\0")?r.slice(r.indexOf("\0")+1):t.find(e=>e.rule_id===r)?.expression??r:"node"===s?n.get(r)??r:"client"===s?r:a(r)}function Me(e,t,n,a,o="rule"){const s=(e=>new Map(e.map(e=>[e.id,e.name])))(n),r=new Map(t.map(e=>[e.id,e])),l=new Map(t.map(e=>[e.name,e])),i=new Map(n.map(e=>[e.id,e])),d=new Map,c=new Map,g=new Map,w=new Map,h=(e,t)=>{const n=e+">"+t;let a=w.get(n);return a||w.set(n,a={source:e,target:t,count:0}),a},b=(e,t,n=!1)=>{const a=je("node",{key:e,label:t,unknown:n});let o=g.get(a);if(!o){const s=n?void 0:i.get(e),r=s&&m(s);g.set(a,o={id:a,label:t,count:0,unknown:n||void 0,latency:f(r),unavailable:"unavailable"===r?.state})}return o},v=(e,t=!1)=>{const n=je("outbound",{label:e,unknown:t});let a=c.get(n);if(a)return a;const o=t?void 0:l.get(e),d=t?{groups:[],member:null}:p(e,o?.selection.tcp_member_id?"tcp":"udp",l,r,i),m=d.groups.map(e=>({name:e.name,kind:e.policy.kind,policy:e.policy.native})),f=d.member;return a={id:n,label:e,count:0,unknown:t||void 0,kind:t?"unknown":u(e)?e:m.length?"group":"unknown",groups:m,node:f&&b(f,s.get(f)??f).id},c.set(n,a),a.node&&h(n,a.node),a},j=(e,t,n=!1)=>{let a=d.get(e);return a||d.set(e,a={id:e,label:t,count:0,unknown:n||void 0,outbound:null,must:!1}),a};if("rule"===o)for(const u of a?.rules??[]){const e=j(je("rule",{key:u.rule_id,label:u.expression}),u.expression);e.must=u.must,u.outbound&&(e.outbound=v(u.outbound).id,h(e.id,e.outbound))}const x=[o,"outbound","node"];for(const u of e){let e;for(const t of x){const n=ve(u,t,s,a?.generation_id);if(!n)break;const o="outbound"===t?v(n.label,n.unknown):"node"===t?b(n.key??n.label,n.label,n.unknown):j(je(t,n),n.label,n.unknown);o.count++,e&&h(e.id,o.id).count++,e=o}}for(const u of t)v(u.name);const y=new Set([...d.values()].map(e=>e.outbound)),k=new Set([...c.values()].flatMap(e=>e.groups.slice(1).map(e=>e.name))),_=[...c.values()].filter(e=>e.count||y.has(e.id)||!k.has(e.label)),M=new Set(_.map(e=>e.id)),N=[...w.values()].filter(e=>M.has(e.source)||M.has(e.target)),L=new Set(N.map(e=>e.target));return{by:o,leaves:[...d.values()],outbounds:_,nodes:[...g.values()].filter(e=>L.has(e.id)),links:N}}const Ne=new WeakMap;function Le(e){const t=Ne.get(e);if(t)return t;const n=new Map,a=new Map,o=new Map;for(const l of e.links){for(const[e,t]of[[n,l.source],[a,l.target]]){let n=e.get(t);n||e.set(t,n=[]),n.push(l)}(!o.has(l.source)||o.get(l.source).count<l.count)&&o.set(l.source,l)}const s=new Map;for(const l of[...e.leaves,...e.outbounds]){const e=("groups"in l?l.node:l.outbound)??o.get(l.id)?.target;e&&s.set(l.id,e)}const r={outgoing:n,incoming:a,parents:s};return Ne.set(e,r),r}const Se={not_instrumenteLine truncated
@@ -1 +1 @@
import{gF as e,du as t,dm as r,dl as o,bs as a,gG as i,eT as l,fV as n,fW as s,fK as d,fL as c,fM as u,dv as g,fN as p,fP as f,fQ as y,dx as v,fO as b,fF as h,eY as m,gH as k,dL as D,f1 as w,dP as E,dO as P,fU as M,dE as x,dF as S,dG as A,g5 as K,dI as C,f6 as T,f$ as N,g1 as B,eZ as F,g6 as I,dA as L,e_ as R,eX as V,fE as H,g0 as O,g2 as U,dK as z,gb as $,gc as G,f5 as W}from"./index-CmbH0woS.js";import{b as _,a as j,c as q,e as Q,f as X,g as Y}from"./Checkbox-f7Je53QZ.js";import{l as Z,f as J,b as ee,m as te,g as re,i as oe,h as ae}from"./Select-BcN72K3H.js";import{r as ie,$ as le}from"./vendor-react-64fcanlc.js";const ne=new WeakMap;function se(e,t){let{id:r}=ne.get(e)??{};if(!r)throw new Error("Unknown list");return`${r}-${function(e){return"string"==typeof e?e.replace(/\s*/g,""):""+e}(t)}`}const de={ltr:"ArrowRight",rtl:"ArrowLeft"},ce={ltr:"ArrowLeft",rtl:"ArrowRight"};function ue(e,t,r){let{node:m,isVirtualized:k,focusMode:D="row",allowsArrowNavigation:w}=e,{direction:E}=a(),{onAction:P,linkBehavior:M,keyboardNavigationBehavior:x,shouldSelectOnPressUp:S}=ne.get(t),A=i(),K=ie.useRef(null),C=()=>{if(null!==r.current){if("child"===D){if(d(r.current)&&r.current!==c(u(r.current)))return;let e=g(r.current,{tabbable:!0}).firstChild();if(e)return p(e),void f(e,{containingElement:y(e)})}(null!=K.current&&m.key!==K.current||!d(r.current))&&p(r.current)}},T={},N=e.hasChildItems,B=t.selectionManager.isLink(m.key);if(null!=m&&"expandedKeys"in t){let e=t.collection.getChildren?.(m.key);N=N||[...e??[]].length>1,null==P&&!B&&"none"===t.selectionManager.selectionMode&&N&&(P=()=>t.toggleKey(m.key));let r=N?t.expandedKeys.has(m.key):void 0,o=1,a=m.index;if(m.level>=0&&null!=m?.parentKey){let e=t.collection.getItem(m.parentKey);if(e){let r=function(e,t){let r=t.getChildren?.(e.key),o=r?Array.from(r):[],a=o.length>0?o[0]:null,i=[];for(;a;)i.push(a),a=null!=a.nextKey?t.getItem(a.nextKey):null;return i}(e,t.collection);o=[...r].filter(e=>"item"===e.type).length,a>0&&"item"!==r[0].type&&(a-=1)}}else o=[...t.collection].filter(e=>0===e.level&&"item"===e.type).length;T={"aria-expanded":r,"aria-level":m.level+1,"aria-posinset":a+1,"aria-setsize":o}}let{itemProps:F,...I}=l({selectionManager:t.selectionManager,key:m.key,ref:r,isVirtualized:k,shouldSelectOnPressUp:e.shouldSelectOnPressUp||S,onAction:P||m.props?.onAction?n(m.props?.onAction,P?()=>P(m.key):void 0):void 0,focus:C,linkBehavior:M}),L=s(m.props),R=I.hasAction?L:{},V=o(F,R,{role:"row",onKeyDownCapture:"arrow"===x||w?e=>{let o=c(u(r.current));if(!h(e.currentTarget,v(e))||!r.current||!o)return;let a=g(r.current);if(a.currentNode=o,!ge(e,t,m,N,E,o,r.current,w))switch(e.key){case"ArrowLeft":if("arrow"===x){let t="rtl"===E?a.nextNode():a.previousNode();if(t)e.preventDefault(),e.stopPropagation(),p(t),f(t,{containingElement:y(r.current)});else if(e.preventDefault(),e.stopPropagation(),"rtl"===E)p(r.current),f(r.current,{containingElement:y(r.current)});else{a.currentNode=r.current;let e=pe(a);e&&(p(e),f(e,{containingElement:y(r.current)}))}}break;case"ArrowRight":if("arrow"===x){let t="rtl"===E?a.previousNode():a.nextNode();if(t)e.preventDefault(),e.stopPropagation(),p(t),f(t,{containingElement:y(r.current)});else if(e.preventDefault(),e.stopPropagation(),"ltr"===E)p(r.current),f(r.current,{containingElement:y(r.current)});else{a.currentNode=r.current;let e=pe(a);e&&(p(e),f(e,{containingElement:y(r.current)}))}}break;case"ArrowUp":case"ArrowDown":!e.altKey&&h(r.current,v(e))&&(e.stopPropagation(),e.preventDefault(),r.current.parentElement?.dispatchEvent(new KeyboardEvent(e.nativeEvent.type,e.nativeEvent)))}}:void 0,onFocus:e=>{K.current=m.key,v(e)===r.current?"child"===D&&e.relatedTarget&&h(r.current,e.relatedTarget)||requestAnimationFrame(()=>{"child"===D&&c(u(r.current))===r.current&&C()}):b()||t.selectionManager.setFocusedKey(m.key)},"aria-label":m["aria-label"]||m.textValue||void 0,"aria-selected":t.selectionManager.canSelectItem(m.key)?t.selectionManager.isSelected(m.key):void 0,"aria-disabled":t.selectionManager.isDisabled(m.key)||void 0,"aria-labelledby":A&&(m["aria-label"]||m.textValue)?`${se(t,m.key)} ${A}`:void 0,id:se(t,m.key)});"child"===D&&w&&"tab"===x&&(V.tabIndex=-1);let H=V.onKeyDown;if(V.onKeyDown=e=>{(e=>{let o=c(u(r.current));if(h(e.currentTarget,v(e))&&r.current&&o){if("tab"===x){if(v(e)!==r.current&&"Tab"!==e.key)return void e.stopPropagation();if(ge(e,t,m,N,E,o,r.current,w))return}if("Tab"===e.key&&"tab"===x){let t=g(r.current,{tabbable:!0});t.currentNode=o,(e.shiftKey?t.previousNode():t.nextNode())&&e.stopPropagation()}}})(e),e.isPropagationStopped()||H?.(e)},k){let{collection:e}=t,r=[...e];V["aria-rowindex"]=r.find(e=>"section"===e.type)?[...e.getKeys()].filter(t=>"section"!==e.getItem(t)?.type).findIndex(e=>e===m.key)+1:m.index+1}return{rowProps:{...o(V,T)},gridCellProps:{role:"gridcell","aria-colindex":1},descriptionProps:{id:A},...I}}function ge(e,t,r,o,a,i,l,n){if(!("expandedKeys"in t)||!n&&i!==l)return!1;if(e.key===de[a]&&t.selectionManager.focusLine truncated import{fG as e,cK as t,cD as r,cC as o,bp as a,fH as i,dY as l,eB as n,eC as s,eq as c,er as d,es as u,cL as p,et as g,ev as f,ew as y,cN as v,eu as b,el as h,e1 as m,fM as k,c$ as D,e6 as w,d3 as E,d2 as P,eA as M,cU as x,cV as S,cW as A,eN as K,cY as C,eb as T,eH as N,eJ as B,e2 as I,eO as F,cQ as L,e3 as R,e0 as V,ek as H,eI as U,eK as O,c_ as z,eT as $,eU as G,ea as W}from"./index-ucpAK88B.js";import{b as _,a as j,c as q,e as Y,f as J,g as Q}from"./Checkbox-eZH7dxup.js";import{k as X,f as Z,e as ee,l as te,g as re,i as oe,h as ae}from"./Select-2JXPV40Q.js";import{r as ie,$ as le}from"./vendor-react-64fcanlc.js";const ne=new WeakMap;function se(e,t){let{id:r}=ne.get(e)??{};if(!r)throw new Error("Unknown list");return`${r}-${function(e){return"string"==typeof e?e.replace(/\s*/g,""):""+e}(t)}`}const ce={ltr:"ArrowRight",rtl:"ArrowLeft"},de={ltr:"ArrowLeft",rtl:"ArrowRight"};function ue(e,t,r){let{node:m,isVirtualized:k,focusMode:D="row",allowsArrowNavigation:w}=e,{direction:E}=a(),{onAction:P,linkBehavior:M,keyboardNavigationBehavior:x,shouldSelectOnPressUp:S}=ne.get(t),A=i(),K=ie.useRef(null),C=()=>{if(null!==r.current){if("child"===D){if(c(r.current)&&r.current!==d(u(r.current)))return;let e=p(r.current,{tabbable:!0}).firstChild();if(e)return g(e),void f(e,{containingElement:y(e)})}(null!=K.current&&m.key!==K.current||!c(r.current))&&g(r.current)}},T={},N=e.hasChildItems,B=t.selectionManager.isLink(m.key);if(null!=m&&"expandedKeys"in t){let e=t.collection.getChildren?.(m.key);N=N||[...e??[]].length>1,null==P&&!B&&"none"===t.selectionManager.selectionMode&&N&&(P=()=>t.toggleKey(m.key));let r=N?t.expandedKeys.has(m.key):void 0,o=1,a=m.index;if(m.level>=0&&null!=m?.parentKey){let e=t.collection.getItem(m.parentKey);if(e){let r=function(e,t){let r=t.getChildren?.(e.key),o=r?Array.from(r):[],a=o.length>0?o[0]:null,i=[];for(;a;)i.push(a),a=null!=a.nextKey?t.getItem(a.nextKey):null;return i}(e,t.collection);o=[...r].filter(e=>"item"===e.type).length,a>0&&"item"!==r[0].type&&(a-=1)}}else o=[...t.collection].filter(e=>0===e.level&&"item"===e.type).length;T={"aria-expanded":r,"aria-level":m.level+1,"aria-posinset":a+1,"aria-setsize":o}}let{itemProps:I,...F}=l({selectionManager:t.selectionManager,key:m.key,ref:r,isVirtualized:k,shouldSelectOnPressUp:e.shouldSelectOnPressUp||S,onAction:P||m.props?.onAction?n(m.props?.onAction,P?()=>P(m.key):void 0):void 0,focus:C,linkBehavior:M}),L=s(m.props),R=F.hasAction?L:{},V=o(I,R,{role:"row",onKeyDownCapture:"arrow"===x||w?e=>{let o=d(u(r.current));if(!h(e.currentTarget,v(e))||!r.current||!o)return;let a=p(r.current);if(a.currentNode=o,!pe(e,t,m,N,E,o,r.current,w))switch(e.key){case"ArrowLeft":if("arrow"===x){let t="rtl"===E?a.nextNode():a.previousNode();if(t)e.preventDefault(),e.stopPropagation(),g(t),f(t,{containingElement:y(r.current)});else if(e.preventDefault(),e.stopPropagation(),"rtl"===E)g(r.current),f(r.current,{containingElement:y(r.current)});else{a.currentNode=r.current;let e=ge(a);e&&(g(e),f(e,{containingElement:y(r.current)}))}}break;case"ArrowRight":if("arrow"===x){let t="rtl"===E?a.previousNode():a.nextNode();if(t)e.preventDefault(),e.stopPropagation(),g(t),f(t,{containingElement:y(r.current)});else if(e.preventDefault(),e.stopPropagation(),"ltr"===E)g(r.current),f(r.current,{containingElement:y(r.current)});else{a.currentNode=r.current;let e=ge(a);e&&(g(e),f(e,{containingElement:y(r.current)}))}}break;case"ArrowUp":case"ArrowDown":!e.altKey&&h(r.current,v(e))&&(e.stopPropagation(),e.preventDefault(),r.current.parentElement?.dispatchEvent(new KeyboardEvent(e.nativeEvent.type,e.nativeEvent)))}}:void 0,onFocus:e=>{K.current=m.key,v(e)===r.current?"child"===D&&e.relatedTarget&&h(r.current,e.relatedTarget)||requestAnimationFrame(()=>{"child"===D&&d(u(r.current))===r.current&&C()}):b()||t.selectionManager.setFocusedKey(m.key)},"aria-label":m["aria-label"]||m.textValue||void 0,"aria-selected":t.selectionManager.canSelectItem(m.key)?t.selectionManager.isSelected(m.key):void 0,"aria-disabled":t.selectionManager.isDisabled(m.key)||void 0,"aria-labelledby":A&&(m["aria-label"]||m.textValue)?`${se(t,m.key)} ${A}`:void 0,id:se(t,m.key)});"child"===D&&w&&"tab"===x&&(V.tabIndex=-1);let H=V.onKeyDown;if(V.onKeyDown=e=>{(e=>{let o=d(u(r.current));if(h(e.currentTarget,v(e))&&r.current&&o){if("tab"===x){if(v(e)!==r.current&&"Tab"!==e.key)return void e.stopPropagation();if(pe(e,t,m,N,E,o,r.current,w))return}if("Tab"===e.key&&"tab"===x){let t=p(r.current,{tabbable:!0});t.currentNode=o,(e.shiftKey?t.previousNode():t.nextNode())&&e.stopPropagation()}}})(e),e.isPropagationStopped()||H?.(e)},k){let{collection:e}=t,r=[...e];V["aria-rowindex"]=r.find(e=>"section"===e.type)?[...e.getKeys()].filter(t=>"section"!==e.getItem(t)?.type).findIndex(e=>e===m.key)+1:m.index+1}return{rowProps:{...o(V,T)},gridCellProps:{role:"gridcell","aria-colindex":1},descriptionProps:{id:A},...F}}function pe(e,t,r,o,a,i,l,n){if(!("expandedKeys"in t)||!n&&i!==l)return!1;if(e.key===ce[a]&&t.selectionManager.focusLine truncated
@@ -0,0 +1 @@
import{j as s}from"./vendor-react-64fcanlc.js";import{I as e,d5 as a,N as l,T as c}from"./index-ucpAK88B.js";function r(a){return s.jsx(e,{...a,children:s.jsx("path",{fill:"currentColor",d:"M7.864 15.734c-.222 0-.433-.098-.576-.27l-3.747-4.497c-.266-.319-.222-.792.096-1.057.317-.265.79-.223 1.056.096l3.154 3.786 7.44-9.469c.255-.326.728-.382 1.052-.127.326.256.383.728.127 1.053L8.454 15.447c-.14.179-.352.284-.579.287z"})})}const t=()=>s.jsx(r,{className:"rp-check-mark"}),i=({i:e,cut:a,reserveFlag:r=!1})=>{const t="path"===a?e.label.lastIndexOf("/")+1:0;return s.jsxs("span",{className:"rp-il",children:[(e.flag||r&&void 0!==e.flag)&&s.jsx("span",{className:"rp-node-flag","data-flag":e.flag,"aria-hidden":"true"}),e.icon&&s.jsx("span",{className:"ic",children:e.icon}),e.nodeName?s.jsx(l,{name:e.label,cut:"start"===a?a:void 0}):t?s.jsxs(c,{className:"rp-path",text:e.label,children:[s.jsx("span",{className:"rp-truncate rp-truncate-start",children:s.jsx("bdi",{children:e.label.slice(0,t)})}),s.jsx("bdi",{children:e.label.slice(t)})]}):s.jsx(c,{cut:"start"===a?a:void 0,tooltipText:e.label,children:e.label})]})},n=({i:e,children:l})=>s.jsxs("span",{className:"rp-item-text",children:[s.jsx(a,{slot:"label",elementType:"span",children:s.jsx(i,{i:e,reserveFlag:!0})}),l??(e.desc&&s.jsx(a,{slot:"description",className:e.aside?"desc aside":"desc",children:e.desc}))]});export{r as C,i as I,t as a,n as b};
@@ -0,0 +1 @@
import{j as s}from"./vendor-react-64fcanlc.js";import{b7 as r}from"./index-ucpAK88B.js";function e({className:e,...o}){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:10,height:10,viewBox:"0 0 12 12","aria-hidden":"true",focusable:"false",className:r("rp-icon rp-link-out",e),...o,children:s.jsx("path",{fill:"currentColor",d:"m10.08887,1h-5.51074c-.50293,0-.91113.4082-.91113.91113s.4082.91113.91113.91113h3.31055L1.35547,9.35547c-.35645.35645-.35645.93262,0,1.28906.17773.17773.41113.2666.64453.2666s.4668-.08887.64453-.2666l6.5332-6.5332v3.31055c0,.50293.4082.91113.91113.91113s.91113-.4082.91113-.91113V1.91113c0-.50293-.4082-.91113-.91113-.91113Z"})})}export{e as L};
@@ -0,0 +1 @@
import{r as e,j as n}from"./vendor-react-64fcanlc.js";import{u as t,l as r,by as s,m as o,aM as a,bz as i,aV as l,bA as c,bB as u,bC as d,bD as p,h as m,C as g,b6 as f,E as h,bE as x,bF as k,bk as w,bG as j,B as y}from"./index-ucpAK88B.js";import{D as b,s as v,d as T,a as S,o as E}from"./auth-B7YirLMe.js";import{L as N,a as C,P as D,S as L}from"./AppearanceControls-DmbIJj4H.js";import{L as _}from"./LinkOut-L4IZJIRt.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./ItemText-CtNOgl4O.js";const A=/^[A-Za-z0-9_.-]{1,64}$/;async function q(e,n){try{return v(await T(e,n))}catch(t){if(!function(e){return e instanceof SyntaxError||e instanceof a&&(404===e.status||401===e.status&&(!e.code||"authentication_required"===e.code))}(t))throw t;return t instanceof a&&404===t.status?await S(e,n)?"token":"no-api":"token"}}function P(e,n,t){try{const{profiles:r,activeId:s}=u(),o=function(e,n,t,r){return e.some(e=>e.id===n&&p(e.api)===p(t))?e.map(e=>e.id===n?{...e,token:r.trim()}:e):null}(r,e,n,t);if(!o)return"login.stale";d({profiles:o,activeId:s})}catch{return"settings.saveError"}return null}async function I(e,n,t,r){let s;try{s=await E(n,t,r)}catch(o){return function(e){if(!(e instanceof a))return null;if("invalid_credentials"===e.code)return{key:"login.invalidCredentials"};if("setup_required"===e.code)return{key:"login.needsSetup",switchTo:"setup"};if("setup_already_completed"===e.code)return{key:"login.alreadySetUp",switchTo:"login"};if("permission_denied"===e.code)return{key:"login.setupPeer"};if("rate_limited"===e.code){const n=e.retryAfter??60;return{key:"login.rateLimited",params:{n:n},wait:n}}return null}(o)??{error:o}}try{c(e,n,s.token)}catch{return{key:"settings.saveError"}}return null}function R(e,n){const{kind:t,failure:r,attempt:s,ended:o,rejected:a}=e;return"no-api"===t?null:null!==r?{tone:"negative",text:"string"==typeof r?r:n(r.key,r.params),focus:!0,id:s}:o?{tone:"informative",text:n("login.sessionEnded"),focus:!1,id:0}:a&&"token"===t?{tone:"negative",text:n("login.rejected"),focus:!1,id:0}:null}const F=e=>"string"!=typeof e&&"login.rateLimited"===e.key;function H(n,a,c,u,d){const p=t(),m=r(),[g]=e.useState(()=>s(n,a)),[f,h]=e.useState(null),x=d?"no-api":f,[k,w]=e.useState({attempt:0,error:null});e.useEffect(()=>{if(d)return;const e=new AbortController;return q(a,e.signal).then(e=>h(e),n=>{e.signal.aborted||w(e=>({...e,error:n instanceof Error?n:new Error(String(n))}))}),()=>e.abort()},[a,k.attempt,d]);const[j,y]=e.useState(""),v=i(a),[T,S]=e.useState(v?b.username:""),[E,N]=e.useState(v?b.password:""),[C,D]=e.useState(""),[L,_]=e.useState(!1),[H,U]=e.useState(!1),[M,z]=e.useState({}),[B,O]=e.useState(null),[G,V]=e.useState(0),[Z,$]=e.useState(0),[J,K]=e.useState(Date.now);e.useEffect(()=>{if(Z<=J)return;const e=setTimeout(()=>K(Date.now()),(Z-J)%1e3||1e3);return()=>clearTimeout(e)},[Z,J]);const Q=function(e,n){return Math.max(0,Math.ceil((e-n)/1e3))}(Z,J),W=(e,n)=>t=>{n(t),M[e]&&z(({[e]:n,...t})=>t)},X=async e=>{const t=function(e,n,t,r){const s={};n?A.test(n)||(s.username="login.badUsername"):s.username="login.usernameRequired";const o=[...t].length;return o?"setup"===e&&o<8?s.password="login.passwordShort":o>128||(new TextEncoder).encode(t).length>512?s.password="login.passwordLong":"setup"===e&&t!==r&&(s.confirm="login.mismatch"):s.password="login.passwordRequired",s}(e,T,E,C);if(z(t),Object.keys(t).length)return;U(!0);const r=await I(n,a,e,{username:T,password:E});if(r)if(U(!1),"error"in r)O(p("login.failed",{error:l(r.error,p)}));else{if(r.wait){const e=Date.now();K(e),$(e+1e3*r.wait)}r.switchTo&&(h(r.switchTo),D("")),O(r)}else location.reload()},Y="setup"===x||"login"===x,ee=e=>M[e]?p(M[e]):void 0;return{kind:x,discoveryError:k.error,retryDiscovery:()=>w(e=>({attempt:e.attempt+1,error:null})),title:p("no-api"===x?"login.noApiTitle":"setup"===x?"login.setupTitle":"token"===x?"login.title":"login.passwordTitle"),note:"no-api"===x?p("login.noApiNote"):p("setup"===x?"login.setupNote":"login"===x?"login.connectedTo":"login.note",{backend:c}),demoNote:v&&"login"===x?p("login.demoNote",b):null,alert:R({kind:x,failure:B&&!Q&&F(B)?null:B,attempt:G,ended:g,rejected:u},p),busy:H,token:j,setToken:y,username:T,setUsername:W("username",S),usernameError:ee("username"),password:E,setPassword:W("password",N),passwordError:ee("password"),confirm:C,setConfirm:W("confirm",D),confirmError:ee("confirm"),submit:()=>{H||Q||null===x||"no-api"===x||(O(null),V(e=>e+1),Y?X(x):(()=>{if(!j.trim())return;const e=P(n,a,j);e?O({key:e}):location.reload()})())},canSubmit:null!==x&&"no-api"!==x&&!Q&&(Y||!!j.trim()),submitText:Q?p("login.retryIn",{n:Q}):p("setup"===x?"login.create":"login"===x?"login.signIn":"login.submit"),secretType:L?"text":"password",toggle:()=>_(e=>!e),toggleText:p(Y?L?"login.hidePassword":"login.showPassword":L?"settings.hideToken":"settings.showToken"),guideHref:o(m),requirementsHref:o(m,"no-native-api")}}function U({profileId:e,api:r,backend:s,rejected:o,missingApi:a,lang:i,pickLang:l,dark:c,themeLabel:u,toggleLine truncated
@@ -1,2 +0,0 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./LoginShowcase-BdKK3a87.js","./vendor-react-64fcanlc.js","./_commonjsHelpers-CXUWDbkB.js","./index-CmbH0woS.js","./index-suuKbZt8.css"])))=>i.map(i=>d[i]);
import{C as e,P as n,bS as t,U as r,bT as s,bU as o,bd as a,bV as i,bW as l,bX as c,bY as u,bZ as d,b_ as p,b$ as m,D as g,j as f,c0 as h,c1 as x,c2 as w,c3 as j,K as k,A as y,c4 as b,c5 as v,J as T,B as S,_ as N}from"./index-CmbH0woS.js";import{r as E,j as _}from"./vendor-react-64fcanlc.js";import{D as C,s as D,d as L,a as A,o as P}from"./auth-aj_VNWTT.js";import"./_commonjsHelpers-CXUWDbkB.js";const q=/^[A-Za-z0-9_.-]{1,64}$/;async function R(e,n){try{return D(await L(e,n))}catch(t){if(!function(e){return e instanceof SyntaxError||e instanceof s&&(404===e.status||401===e.status&&(!e.code||"authentication_required"===e.code))}(t))throw t;return t instanceof s&&404===t.status?await A(e,n)?"token":"no-api":"token"}}function I(e,n,t){try{const{profiles:r,activeId:s}=l(),o=function(e,n,t,r){return e.some(e=>e.id===n&&u(e.api)===u(t))?e.map(e=>e.id===n?{...e,token:r.trim()}:e):null}(r,e,n,t);if(!o)return"login.stale";c({profiles:o,activeId:s})}catch{return"settings.saveError"}return null}async function U(e,n,t,r){let o;try{o=await P(n,t,r)}catch(a){return function(e){if(!(e instanceof s))return null;if("invalid_credentials"===e.code)return{key:"login.invalidCredentials"};if("setup_required"===e.code)return{key:"login.needsSetup",switchTo:"setup"};if("setup_already_completed"===e.code)return{key:"login.alreadySetUp",switchTo:"login"};if("permission_denied"===e.code)return{key:"login.setupPeer"};if("rate_limited"===e.code){const n=e.retryAfter??60;return{key:"login.rateLimited",params:{n:n},wait:n}}return null}(a)??{error:a}}try{i(e,n,o.token)}catch{return{key:"settings.saveError"}}return null}function H(e,n){const{kind:t,failure:r,attempt:s,ended:o,rejected:a}=e;return"no-api"===t?null:null!==r?{tone:"negative",text:"string"==typeof r?r:n(r.key,r.params),focus:!0,id:s}:o?{tone:"informative",text:n("login.sessionEnded"),focus:!1,id:0}:a&&"token"===t?{tone:"negative",text:n("login.rejected"),focus:!1,id:0}:null}const F=e=>"string"!=typeof e&&"login.rateLimited"===e.key;function z(s,i,l,c,u){const d=e(),p=n(),[m]=E.useState(()=>t(s,i)),[g,f]=E.useState(null),h=u?"no-api":g,[x,w]=E.useState({attempt:0,error:null});E.useEffect(()=>{if(u)return;const e=new AbortController;return R(i,e.signal).then(e=>f(e),n=>{e.signal.aborted||w(e=>({...e,error:n instanceof Error?n:new Error(String(n))}))}),()=>e.abort()},[i,x.attempt,u]);const[j,k]=E.useState(""),y=o(i),[b,v]=E.useState(y?C.username:""),[T,S]=E.useState(y?C.password:""),[N,_]=E.useState(""),[D,L]=E.useState(!1),[A,P]=E.useState(!1),[z,V]=E.useState({}),[Z,B]=E.useState(null),[M,O]=E.useState(0),[$,J]=E.useState(0),[K,W]=E.useState(Date.now);E.useEffect(()=>{if($<=K)return;const e=setTimeout(()=>W(Date.now()),($-K)%1e3||1e3);return()=>clearTimeout(e)},[$,K]);const X=function(e,n){return Math.max(0,Math.ceil((e-n)/1e3))}($,K),Y=(e,n)=>t=>{n(t),z[e]&&V(({[e]:n,...t})=>t)},G=async e=>{const n=function(e,n,t,r){const s={};n?q.test(n)||(s.username="login.badUsername"):s.username="login.usernameRequired";const o=[...t].length;return o?"setup"===e&&o<8?s.password="login.passwordShort":o>128||(new TextEncoder).encode(t).length>512?s.password="login.passwordLong":"setup"===e&&t!==r&&(s.confirm="login.mismatch"):s.password="login.passwordRequired",s}(e,b,T,N);if(V(n),Object.keys(n).length)return;P(!0);const t=await U(s,i,e,{username:b,password:T});if(t)if(P(!1),"error"in t)B(d("login.failed",{error:a(t.error,d)}));else{if(t.wait){const e=Date.now();W(e),J(e+1e3*t.wait)}t.switchTo&&(f(t.switchTo),_("")),B(t)}else location.reload()},Q="setup"===h||"login"===h,ee=e=>z[e]?d(z[e]):void 0;return{kind:h,discoveryError:x.error,retryDiscovery:()=>w(e=>({attempt:e.attempt+1,error:null})),title:d("no-api"===h?"login.noApiTitle":"setup"===h?"login.setupTitle":"token"===h?"login.title":"login.passwordTitle"),note:"no-api"===h?d("login.noApiNote"):d("setup"===h?"login.setupNote":"login"===h?"login.connectedTo":"login.note",{backend:l}),demoNote:y&&"login"===h?d("login.demoNote",C):null,alert:H({kind:h,failure:Z&&!X&&F(Z)?null:Z,attempt:M,ended:m,rejected:c},d),busy:A,token:j,setToken:k,username:b,setUsername:Y("username",v),usernameError:ee("username"),password:T,setPassword:Y("password",S),passwordError:ee("password"),confirm:N,setConfirm:Y("confirm",_),confirmError:ee("confirm"),submit:()=>{A||X||null===h||"no-api"===h||(B(null),O(e=>e+1),Q?G(h):(()=>{if(!j.trim())return;const e=I(s,i,j);e?B({key:e}):location.reload()})())},canSubmit:null!==h&&"no-api"!==h&&!X&&(Q||!!j.trim()),submitText:X?d("login.retryIn",{n:X}):d("setup"===h?"login.create":"login"===h?"login.signIn":"login.submit"),secretType:D?"text":"password",toggle:()=>L(e=>!e),toggleText:d(Q?D?"login.hidePassword":"login.showPassword":D?"settings.hideToken":"settings.showToken"),guideHref:r(p),requirementsHref:r(p,"no-native-api")}}function V({className:e,...n}){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:10,height:10,viewBox:"0 0 12 12","aria-hidden":"true",focusable:"false",className:d("rp-icon rp-link-out",e),.Line truncated
@@ -1 +0,0 @@
import{j as e,r as t}from"./vendor-react-64fcanlc.js";import{bI as n,C as o,P as a,b_ as r,aF as i,aY as l}from"./index-CmbH0woS.js";import"./_commonjsHelpers-CXUWDbkB.js";function c({label:t,className:n,isDisabled:o,ref:a,canvasRef:r}){return e.jsx("button",{ref:a,type:"button",className:n,"aria-label":t,disabled:o,children:e.jsx("canvas",{ref:r})})}const s=[["ink","M657 1228c-12-4-23-14-28-26-1-4-2-4-4-4-22 4-36 3-49-3-11-6-18-16-20-27-2-11 3-23 12-34 3-3 6-6 6-6 0 0-7-1-15-1-34-2-70-7-100-14-49-12-98-36-134-67l-5-4-12 4c-20 7-36 9-60 9-21 0-43-4-57-10-13-5-25-16-30-25-5-10-4-23 3-34 4-6 16-18 24-22l6-4-3-8c-2-5-2-9-2-12 1-6 5-15 9-18 4-5 16-13 21-14 3-1 5-2 6-2 0-1-1-6-3-12-21-73-6-145 45-212l7-10-12-2c-15-1-23-3-34-7-24-9-40-29-40-49 0-19 7-34 36-72 15-21 27-39 35-54 11-19 10-17 5-28-2-4-5-11-6-14-2-8-3-32-1-43 4-28 18-59 42-90l3-5-6-4c-11-9-20-21-23-32-2-6-2-9-2-17 1-9 1-10 4-18 6-11 15-20 29-27 14-7 24-10 47-15 1 0 3-3 7-11 19-37 51-71 88-94 12-8 32-18 44-22 10-3 29-8 33-8 1 0 5-2 8-5 11-8 25-14 39-16 12-2 49-1 63 2 21 4 34 9 45 19 8 7 10 9 15 18 4 7 4 7 13 12 34 18 63 46 86 81 10 16 20 38 26 57 4 12 8 34 10 48 2 13 2 43 0 56l-1 10 6 7c8 8 14 19 18 28 3 9 4 24 2 33-3 14-14 27-29 35-9 5-19 7-31 8l-9 1 0 8c0 4 0 15 0 25 0 16-1 31-5 47l0 3 14 0c27 0 58 5 83 14 21 9 51 25 68 39 3 2 6 5 7 5 0 1 6-2 14-6 27-14 49-17 69-11 26 8 38 34 27 64-2 5-3 9-3 10 0 0 4 1 8 3 14 7 24 19 29 34 8 22 0 45-24 73l-5 6 3 9c6 26 8 63 5 89-2 14-7 33-12 48-9 22-26 52-43 72-10 13-34 36-47 46-28 22-59 39-93 52-16 7-44 16-47 16-1 0-1 1-1 3 9 31 7 61-3 81-8 16-19 27-33 34-9 4-14 5-25 5-15 0-28-4-39-13l-6-5-7 6c-9 7-18 13-26 16-9 3-27 4-35 1z"],["paper","M582 1098c-44-2-79-6-117-16-55-14-102-41-141-81-42-43-67-93-75-148-2-14-1-43 1-56 6-30 16-57 32-82 8-12 24-33 32-42 6-7 7-7 17-10 58-18 110-56 126-92 2-5 2-9 3-16 1-14-2-21-15-33-13-14-21-24-33-39-18-26-28-35-45-43-11-5-21-7-33-7-13 0-23 2-33 7-6 3-9 3-9 3-4-6-4-28-2-42 5-23 18-49 37-73 14-18 37-39 56-53 5-4 6-4 11-4 41 1 105 13 154 28 32 9 72 25 104 42 18 9 51 27 66 37 8 5 8 5 11 13 7 16 13 37 16 56 2 11 2 41 1 54-4 39-19 74-44 104-8 9-10 14-9 20 1 5 7 10 13 12 7 2 14-1 24-11 10-11 22-29 32-48 3-5 4-7 6-7 2-1 14-1 27-1 22 0 24 0 37 2 34 8 68 24 98 48 13 11 15 12 20 12 5 0 7-1 16-7 22-14 41-21 53-18 13 3 16 15 7 32-2 5-6 11-8 15-4 8-4 14 0 19 4 5 7 6 17 7 15 1 23 5 27 14 3 6 3 15 0 22-2 6-10 18-20 30-9 11-11 15-8 24 3 10 6 33 7 52 0 26-2 47-10 70-18 53-57 101-111 135-40 25-87 43-144 54-66 14-132 19-194 17z"],["ink","M517 445c-7-2-13-6-18-12-7-7-9-14-9-25 0-7 0-8 3-15 7-13 17-21 31-22 23-1 43 18 41 40-2 19-17 33-36 35-4 0-9-1-12-1z"],["yellow","M541 220c-13-3-27-7-41-9-6-1-14-3-17-3l-5-1 2-6c3-15 13-40 23-59 20-39 43-66 64-73 11-3 56-1 74 4 7 1 13 4 17 7 3 3 3 4-1 4-5 0-17 4-24 7-35 18-62 59-79 118-2 8-4 14-4 14 0 0-4-1-9-3z"],["yellow","M446 203c-4-1-19-1-35-2-16 0-29 0-29-1 0-1 6-12 12-20 22-34 53-62 87-78 10-5 32-13 33-12 0 0-2 3-6 8-19 27-38 69-47 102-1 4-1 4-5 4-3 0-7-1-10-1z"],["yellow","M569 226c13-58 39-102 70-119 14-7 21-6 40 1 53 23 96 73 113 132 9 29 11 67 7 95-71-43-149-81-230-109z"],["yellow","M780 426c-1-2-5-19-5-19 0-1 3 0 8 0 6 0 8 0 10-2 5-4 3-6-21-21-50-32-74-46-109-63-71-36-143-57-225-67-48-6-99-5-107 1-4 3-5 5-2 7 1 2 3 2 10 3l8 0-4 4c-3 3-9 8-13 12l-9 8-4-2c-6-4-13-11-16-17-3-5-4-12-3-17 2-8 11-17 22-22 22-10 60-14 101-12 63 3 121 16 167 36 71 31 145 67 214 105 17 10 27 31 23 45-1 5-6 12-10 15-6 4-15 6-25 7-8 0-10 0-10-1z"],["yellow","M251 640c-19-4-32-16-32-29 0-10 5-19 23-43 26-34 37-50 50-75 6-12 9-17 13-20 12-11 29-13 45-7 11 5 17 10 37 36 9 13 19 25 24 30 5 5 10 10 12 13 2 3 2 5 2 10 0 5-1 8-4 12-17 29-73 61-123 71-14 3-38 4-47 2z"],["yellow","M226 1028c-12-1-24-5-31-10-12-8-13-16-2-27 5-5 19-13 30-17 7-3 11-6 11-8 0-3-1-5-8-9-7-6-10-10-10-14 0-4 1-5 4-8 2-2 6-4 9-5 3-1 5-2 5-2 1 0 4 7 8 14 15 29 28 49 49 72 4 5 7 8 7 9-1 1-21 5-29 6-13 1-31 1-43-1z"],["yellow","M663 1201c-7-4-9-12-7-24 1-7 1-8 0-10-3-4-7-4-15-1-18 7-40 10-48 7-5-2-8-6-8-11 0-7 8-16 29-30l10-7 19 0c22-1 52-4 78-7 18-3 57-9 65-11 6-2 11-1 14 1 2 3 4 7 5 20 4 39-13 70-39 68-9-1-16-5-29-17-14-12-14-12-27 1-11 11-20 18-28 21-7 3-15 3-19 0z"]],u=940,d=1192,f=1.4,m=52,h=22,p=1/120,g=1500,b=48,x=Math.max(114.4,117.63333333333333),w=3e5/860,M=43.68*u/d/2,v=21.84;function y(e,t){let n=0;for(;e>=1e3&&n<t.length-1;n++)e/=1e3;return[e,n]}function k(e,t){const o=["unit.megabyte","unit.gigabyte","unit.terabyte","unit.petabyte"],[a,r]=y(e,o);return n(a,t,o[r],r?2:1)}function R(e){return e<6?[100,150,200,300,450,650][e]:[1,1.5,2.5,4,6][(e-6)%5]*Math.pow(10,3+Math.floor((e-6)/5))}function T(e){const t=Math.pow(.9,e);return{speed:w-(w-110)*t,gap:x+(205-x)*t,space:200+70*t,swing:e<6?0:34*(1-Math.pow(.8,e-5)),drift:e>=6}}function S(e,t,o){const a=t.getContext("2d");if(!a)return{setText(){},destroy(){}};const r=matchMedia("(prefers-reduced-motion: reduce)"),i=document.documentElement,l=s.map(([e,t])=>[e,new Path2D(t)]);let c,x="",w=Q(),S=1,P=0,E=0,L=0,j=0,z=0,A=0,$=0,B=[],D=0,F=0,N=0,O=0,C=0,H=!1,I=0,K=0,W=0,V=0Line truncated
@@ -0,0 +1 @@
import{r as e,j as t}from"./vendor-react-64fcanlc.js";import{bI as r,u as s,al as a,l,dr as o,bP as n,B as i,cf as c,ds as d,C as g,dt as m,U as u,a1 as p,q as h,x as f,cb as x,bT as v,T as j,p as b,bG as w,ch as y,E as M}from"./index-ucpAK88B.js";import{aO as T,a as N,F as k,aP as C,D as $}from"./activity-CbXYXdVY.js";import{C as S}from"./ItemText-CtNOgl4O.js";import{P as A,Q as O,K as P,L as R,A as W}from"./logs-DjZPFUMm.js";import{T as L}from"./Toolbar-D1_-nNpE.js";import{D}from"./Table-mJjr_XDH.js";import{d as F,e as q}from"./files-Dt8K7QfP.js";import{r as B}from"./recorder-BHyqDNp5.js";import{u as E,C as H}from"./Copy-DVmMYo4E.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./nodes-DqXrz-fh.js";import"./AppearanceControls-DmbIJj4H.js";import"./Select-2JXPV40Q.js";import"./Checkbox-eZH7dxup.js";import"./Virtualizer-mx6Yxab_.js";const I=new WeakMap;function _(e){let t=I.get(e);return void 0===t&&I.set(e,t=Date.parse(e.ts)),t}const J=[...r].reverse();function K({records:m,offered:u,minimum:p,setMinimum:h,waiting:f}){const x=s(),v=a[l()],j=N(),b=e.useMemo(()=>function(e,t,r,s=24){const a=r?J.indexOf(r):J.length-1,l=J.filter((e,r)=>t.includes(e)&&r<=a),o=e.map(_).filter(Number.isFinite);if(!o.length)return{rows:l.map(e=>({level:e,counts:[]})),buckets:[],width:0,busiest:null};const n=Math.min(...o),i=Math.max(...o),c=T(n,i,s),d=c.length>1?c[1]-c[0]:Math.max(i-n,6e4),g=new Map(l.map(e=>[e,new Array(c.length).fill(0)])),m=new Array(c.length).fill(0),u=new Array(c.length).fill(0);for(const x of e){const e=_(x),t=g.get(x.level);if(!t||!Number.isFinite(e))continue;const r=Math.min(c.length-1,Math.floor((e-c[0])/d));t[r]++,m[r]++,"error"===x.level&&u[r]++}const p=e=>e.reduce((t,r,s)=>r>e[t]?s:t,0),h=u.reduce((e,t)=>e+t,0),f=p(h?u:m);return{rows:l.map(e=>({level:e,counts:g.get(e)})),buckets:c,width:d,busiest:{start:c[f],count:h?u[f]:m[f],errors:h}}}(m,u,p),[m,u,p]),w=e.useMemo(()=>o(v),[v]),y=e.useCallback(e=>`${w.format(e)}–${w.format(e+b.width)}`,[w,b.width]),M=e.useMemo(()=>{const e=r.map(e=>{const r=x(n[e]);return[e,{text:r,label:t.jsxs(i,{quiet:!0,small:!0,className:e===p?"current":void 0,label:x(e===p?"log.chart.current":"log.chart.minimum",{level:r}),onPress:()=>h(e),children:[e===p&&t.jsx(S,{}),r]})}]});return new Map(e)},[p,h,x]),$=e.useMemo(()=>{const e={error:j.negative,warn:j.notice,info:j.info,debug:j.subtle,trace:j.muted},t=b.buckets.map(y);return{columns:b.buckets.map(e=>w.format(e)),rows:b.rows.map(r=>{const{text:s,label:a}=M.get(r.level);return{id:r.level,color:e[r.level],label:a,counts:r.counts,titles:r.counts.map((e,r)=>x("log.chart.cell",{time:t[r],level:s,n:e}))}})}},[b,y,w,M,j,x]);if(!m.length)return f?t.jsx(Q,{heads:M,levels:b.rows.map(e=>e.level),time:w.format(0)}):null;const A=b.busiest,O=A?A.errors?[{label:x("log.chart.errors"),value:x("log.chart.count",{n:A.errors}),icon:t.jsx(c,{}),tone:"negative"},{label:x("log.chart.peakErrors"),icon:t.jsx(d,{}),tint:"c1",value:y(A.start),caption:x("log.chart.count",{n:A.count})}]:[{label:x("log.chart.errors"),value:x("log.chart.count",{n:0}),icon:t.jsx(c,{}),tint:"c5"},{label:x("log.chart.peak"),icon:t.jsx(d,{}),tint:"c1",value:y(A.start),caption:x("log.chart.count",{n:A.count})}]:[];return t.jsxs("div",{className:"rp-chart-page",children:[t.jsx(k,{facts:O}),t.jsx(g,{title:x("log.chart.title"),note:x("log.chart.sample",{n:m.length}),children:t.jsx(C,{label:x("log.chart.title"),columns:$.columns,rows:$.rows})})]})}function Q({heads:e,levels:r,time:a}){const l=s(),o=[{label:l("log.chart.errors"),value:l("log.chart.count",{n:0}),icon:t.jsx(c,{}),tint:"c5"},{label:l("log.chart.peak"),icon:t.jsx(d,{}),tint:"c1",value:`${a}–${a}`,caption:l("log.chart.count",{n:0})}],n=r.map(t=>({id:t,color:"transparent",label:e.get(t).label,counts:[0],titles:[""]}));return t.jsxs("div",{className:"rp-chart-page",inert:!0,"aria-hidden":"true",children:[t.jsxs("div",{className:"rp-chart-hold",children:[t.jsx(k,{facts:o}),t.jsx(m,{})]}),t.jsxs("div",{className:"rp-chart-hold",children:[t.jsx(g,{title:l("log.chart.title"),note:l("log.chart.sample",{n:0}),children:t.jsx(C,{label:l("log.chart.title"),columns:[a],rows:n})}),t.jsx(m,{})]})]})}const U={trace:"muted",debug:"neutral",info:"info",warn:"warn",error:"err"},z=new WeakMap;function G(e,t,s,a,l,o=new Set,i){return{rows:e.flatMap(e=>{const t=function(e,t,r){const s=z.get(e);if(s&&s.locale===t)return s.row;const a={id:e.id,timestamp:p(e.ts,t),iso:e.ts,levelText:u(n,e.level,r),tone:U[e.level],target:e.target,gap:!1,record:e,message:e.message+(e.fields?" "+Object.entries(e.fields).map(([e,t])=>`${e}=${"string"==typeof t?t:JSON.stringify(t)}`).join(" "):"")};return z.set(e,{locale:t,row:a}),a}(e,a,l);return o.has(e)?[{...t,id:`gap ${e.id}`,timestamp:"",iso:"",levelText:"",target:"",gap:!0,message:l("log.gap")},t]:[t]}),levels:t.map(e=>{return{id:e,label:(t=e,i&&r.indexOf(t)<r.indexOf(i)?l("log.levelNotRecorded",{level:u(n,e,l)}):u(n,e,l))};var t}),recordedText:i?l("log.recorded",{level:u(n,i,l)}):null,exportBase:`${s||"engLine truncated
@@ -1 +0,0 @@
import{r as e,j as t}from"./vendor-react-64fcanlc.js";import{c7 as r,C as s,aF as a,P as l,fc as o,ci as n,J as i,el as c,cR as g,fd as d,M as u,ae as m,am as p,W as f,a1 as h,cM as x,cp as v,T as b,V as j,bG as w,c5 as M,cT as y,K as T}from"./index-CmbH0woS.js";import{aP as k,u as N,F as $,aQ as C,D as S}from"./activity-CiEWAlFW.js";import{w as A,x as R,L as O,A as W}from"./ActionGroup-D3mQjUsw.js";import{T as D}from"./Toolbar-B9K5nAyx.js";import{D as F}from"./Table-Cfbaho6J.js";import{d as P,e as L}from"./files-Dt8K7QfP.js";import{r as E}from"./recorder-BHyqDNp5.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./Select-BcN72K3H.js";import"./Checkbox-f7Je53QZ.js";import"./Virtualizer-itu1Kg0o.js";const G=new WeakMap;function H(e){let t=G.get(e);return void 0===t&&G.set(e,t=Date.parse(e.ts)),t}const J=[...r].reverse();function _({records:m,offered:p,minimum:f,setMinimum:h}){const x=s(),v=a[l()],b=N(),j=e.useMemo(()=>function(e,t,r,s=24){const a=r?J.indexOf(r):J.length-1,l=J.filter((e,r)=>t.includes(e)&&r<=a),o=e.map(H).filter(Number.isFinite);if(!o.length)return{rows:l.map(e=>({level:e,counts:[]})),buckets:[],width:0,busiest:null};const n=Math.min(...o),i=Math.max(...o),c=k(n,i,s),g=c.length>1?c[1]-c[0]:Math.max(i-n,6e4),d=new Map(l.map(e=>[e,new Array(c.length).fill(0)])),u=new Array(c.length).fill(0),m=new Array(c.length).fill(0);for(const x of e){const e=H(x),t=d.get(x.level);if(!t||!Number.isFinite(e))continue;const r=Math.min(c.length-1,Math.floor((e-c[0])/g));t[r]++,u[r]++,"error"===x.level&&m[r]++}const p=e=>e.reduce((t,r,s)=>r>e[t]?s:t,0),f=m.reduce((e,t)=>e+t,0),h=p(f?m:u);return{rows:l.map(e=>({level:e,counts:d.get(e)})),buckets:c,width:g,busiest:{start:c[h],count:f?m[h]:u[h],errors:f}}}(m,p,f),[m,p,f]),w=e.useMemo(()=>o(v),[v]),M=e.useCallback(e=>`${w.format(e)}–${w.format(e+j.width)}`,[w,j.width]),y=e.useMemo(()=>{const e=r.map(e=>{const r=x(n[e]);return[e,{text:r,label:t.jsxs(i,{quiet:!0,small:!0,className:e===f?"current":void 0,label:x(e===f?"log.chart.current":"log.chart.minimum",{level:r}),onPress:()=>h(e),children:[e===f&&t.jsx(c,{}),r]})}]});return new Map(e)},[f,h,x]),T=e.useMemo(()=>{const e={error:b.negative,warn:b.notice,info:b.info,debug:b.subtle,trace:b.muted},t=j.buckets.map(M);return{columns:j.buckets.map(e=>w.format(e)),rows:j.rows.map(r=>{const{text:s,label:a}=y.get(r.level);return{id:r.level,color:e[r.level],label:a,counts:r.counts,titles:r.counts.map((e,r)=>x("log.chart.cell",{time:t[r],level:s,n:e}))}})}},[j,M,w,y,b,x]);if(!m.length)return null;const S=j.busiest,A=S?S.errors?[{label:x("log.chart.errors"),value:x("log.chart.count",{n:S.errors}),icon:t.jsx(g,{}),tone:"negative"},{label:x("log.chart.peakErrors"),icon:t.jsx(d,{}),tint:"c1",value:M(S.start),caption:x("log.chart.count",{n:S.count})}]:[{label:x("log.chart.errors"),value:x("log.chart.count",{n:0}),icon:t.jsx(g,{}),tint:"c5"},{label:x("log.chart.peak"),icon:t.jsx(d,{}),tint:"c1",value:M(S.start),caption:x("log.chart.count",{n:S.count})}]:[];return t.jsxs("div",{className:"rp-chart-page",children:[t.jsx($,{facts:A}),t.jsx(u,{title:x("log.chart.title"),note:x("log.chart.sample",{n:m.length}),children:t.jsx(C,{label:x("log.chart.title"),columns:T.columns,rows:T.rows})})]})}const B={trace:"muted",debug:"neutral",info:"info",warn:"warn",error:"err"},V=new WeakMap;function q(e,t,s,a,l,o=new Set,i){return{rows:e.flatMap(e=>{const t=function(e,t,r){const s=V.get(e);if(s&&s.locale===t)return s.row;const a={id:e.id,timestamp:p(e.ts,t),iso:e.ts,levelText:m(n,e.level,r),tone:B[e.level],target:e.target,gap:!1,message:e.message+(e.fields?" "+Object.entries(e.fields).map(([e,t])=>`${e}=${"string"==typeof t?t:JSON.stringify(t)}`).join(" "):"")};return V.set(e,{locale:t,row:a}),a}(e,a,l);return o.has(e)?[{...t,id:`gap ${e.id}`,timestamp:"",iso:"",levelText:"",target:"",gap:!0,message:l("log.gap")},t]:[t]}),levels:t.map(e=>{return{id:e,label:(t=e,i&&r.indexOf(t)<r.indexOf(i)?l("log.levelNotRecorded",{level:m(n,e,l)}):m(n,e,l))};var t}),recordedText:i?l("log.recorded",{level:m(n,i,l)}):null,exportBase:`${s||"engine"}-log`}}function z(e,t,r){return r(E(e,t,{forbidden:"log.emptyForbidden",off:"log.emptyNotRecorded",filtered:"log.emptyFiltered",empty:"log.empty"}))}function K(e,t,r,s,a,l){return t?{tone:"err",text:l("log.disconnected")}:r?{tone:"neutral",text:l(s>a?"log.pausedOverflow":"log.paused",{n:Math.min(s,a)})}:{tone:e?"ok":"warn",text:l(e?"log.connected":"log.reconnecting")}}const Q=[];function U({go:t}){const r=s(),o=a[l()],n=f(),i=h(),[c,g]=e.useState("info"),d=e.useCallback(e=>g(e),[]),[u,m]=e.useState(""),[p,b]=e.useState(!1),j=n.data?.resources.logs,w=j?.filters?.includes("target")??!1,M=x(w?u.trim():""),y=function(e,t=[]){return t.includes(e)?e:t.includes("info")?"info":t[0]}(c,j?.levels),T=A({level:y,target:M,paused:p}),k=v(n.data?.resources.runtime_settings.available??!1).data,N=k?.log?.level,$=e.useMemo(()=>q(T.records,j?.levels??[],i.data?.engine.name,o,r,T.gaps,N),[T.records,T.gaps,j,i.data,o,r,N]);return{...$,empty:zLine truncated
@@ -0,0 +1 @@
import{j as e,r as n}from"./vendor-react-64fcanlc.js";import{T as a,ci as s,u as r,S as o,af as i,al as t,l,q as d,r as c,cc as u,c5 as m,E as p,a8 as g,ce as h,cf as v,C as b,ak as f,N as j,B as x,ax as y,p as k,cg as w,I as N,b4 as S,ap as P,db as A,aE as C,a as M,b as F,bG as T,dc as L,dd as G,b9 as R,A as D,aK as O,v as E,c9 as q,c2 as _,aU as I,h as B,aV as H,Y as Q,cv as U,cw as K,x as V,w as J,de as W,aa as z,c6 as $,c4 as X,cx as Y,aN as Z,ch as ee,av as ne,df as ae,b5 as se,cs as re,bF as oe,d8 as ie,aL as te}from"./index-ucpAK88B.js";import{L as le,C as de,l as ce}from"./AppearanceControls-DmbIJj4H.js";import{T as ue}from"./Tabs-DrhG95XR.js";import{h as me,c as pe,g as ge,S as he,K as ve,n as be,A as fe,L as je,z as xe,v as ye,B as ke,E as we,e as Ne,u as Se,w as Pe}from"./logs-DjZPFUMm.js";import{ad as Ae,a1 as Ce,ae as Me,af as Fe,C as Te,F as Le,ag as Ge,ah as Re,ai as De,aj as Oe,q as Ee,ak as qe,al as _e,am as Ie,an as Be,ao as He,ap as Qe,aq as Ue,ar as Ke,V as Ve,as as Je,at as We,au as ze,av as $e,aw as Xe,ax as Ye,ay as Ze,az as en,aA as nn,aB as an,aC as sn,aD as rn,aE as on,aF as tn,aG as ln,Q as dn,aH as cn,aI as un,aJ as mn,aK as pn}from"./activity-CbXYXdVY.js";import{T as gn}from"./Toolbar-D1_-nNpE.js";import{T as hn}from"./TimeCell-BqAcq3yb.js";import{a as vn,$ as bn}from"./GridList-DW6-BWSL.js";import{P as fn}from"./ProbeOptionsDialog-BzHoOnqn.js";import{D as jn,c as xn}from"./Table-mJjr_XDH.js";import{F as yn,T as kn,L as wn}from"./Tag-C65IJXSk.js";import{FlagField as Nn}from"./FlagPicker-Sl-V9aLi.js";import{S as Sn}from"./SearchSelect-CQDeD6gi.js";import{u as Pn}from"./outbounds-KqKr_Phl.js";import{aa as An,z as Cn,ab as Mn,ac as Fn,A as Tn,ad as Ln,ae as Gn,m as Rn,O as Dn,r as On,v as En,l as qn,q as _n,af as In}from"./nodes-DqXrz-fh.js";import{$ as Bn}from"./SearchList-BxTMvuPr.js";import{a as Hn,p as Qn}from"./probe-BrDCvIoc.js";import{n as Un}from"./nav-CY1W7vuj.js";import{N as Kn,t as Vn,n as Jn}from"./NumberField-Blv4W9AC.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./ItemText-CtNOgl4O.js";import"./Checkbox-eZH7dxup.js";import"./Select-2JXPV40Q.js";import"./Virtualizer-mx6Yxab_.js";function Wn({label:n,items:a,selected:s,onSelect:t,loading:l,empty:d,children:c}){const u=r();return e.jsx(bn,{className:"rp-cardview","aria-label":n,layout:"grid",items:a,dependencies:[c],selectionMode:"single",selectionBehavior:"replace",disallowEmptySelection:!0,selectedKeys:s?[s]:[],onSelectionChange:e=>{if("all"===e)return;const n=[...e][0];null!=n&&t(String(n))},renderEmptyState:()=>l?e.jsx(o,{shape:"cards",count:3,height:224,grid:!0}):e.jsx(i,{children:d??u("ui.empty")}),children:c})}function zn({id:n,title:r,titleFull:o,meta:i,actions:t,children:l}){return e.jsxs(vn,{id:n,textValue:r,className:s("rp-cardview-card"),children:[e.jsxs("div",{className:"rp-cardview-head",children:[e.jsx(a,{className:"rp-cardview-title",text:o,children:r}),t&&e.jsx("span",{className:"rp-cardview-actions",children:t})]}),i&&e.jsx("div",{className:"rp-cardview-meta",children:i}),l]})}function $n(a,s){return a.split("{names}").map((a,r)=>e.jsxs(n.Fragment,{children:[r>0&&s,a]},r))}function Xn(a,s,r,o){const i=f(s,["",""]),t=a.slice(0,6).map((a,s)=>e.jsxs(n.Fragment,{children:[s>0&&i,e.jsx(le,{appearance:"link",layout:"inline",href:o.get(a.id)??Oe([a.id]),children:e.jsx(j,{name:a.name})})]},a.id));if(a.length<=6)return t;const l=e.jsx(le,{appearance:"link",layout:"inline",href:Oe(a.map(e=>e.id)),children:r("nodes.latency.more",{n:a.length-6})});return r("nodes.latency.andMore",{names:"{names}",more:"{more}"}).split(/(\{names\}|\{more\})/).map((a,s)=>e.jsx(n.Fragment,{children:"{names}"===a?t:"{more}"===a?l:a},s))}const Yn=n=>[{label:n("nodes.latency.lowest"),icon:e.jsx(h,{}),tint:"c2",value:"",caption:" "},{label:n("nodes.latency.highest"),icon:e.jsx(Te,{}),tint:"c4",value:"",caption:" "},{label:n("ui.unavailable"),icon:e.jsx(v,{}),tint:"c5",value:""}];function Zn(){const a=r(),s=l(),{nodes:f,by:j,setBy:x,view:y,hrefs:k}=function(){const e=t[l()],a=d().data?.resources,s=me(c(a,"nodes",{whileLoading:!0})),r=pe(c(a,"groups",{whileLoading:!1})),o=ge(c(a,"providers",{whileLoading:!0})),[i,p]=n.useState("group"),g=u(),h=m(s.data,g),v=m(r.data,g),b=m(o.data,g),f=n.useMemo(()=>Ae(h??[],v,i,e),[h,v,i,e]),j=n.useMemo(()=>new Map((h??[]).map(e=>[e.id,Ce(e,b?.providers??[],!0)])),[h,b]);return{nodes:{...s,data:h},by:i,setBy:p,view:f,hrefs:j}}();if(f.error&&!f.data)return e.jsx(p,{error:f.error,onRetry:f.refetch});const w=!f.data;if(f.data&&!f.data.length)return e.jsx(i,{children:a("ui.empty")});const N=Me(y),{measured:S,down:P}=Fe(y),A=S[0],C=S.at(-1),M=A&&C?[{label:a("nodes.latency.lowest"),icon:e.jsx(h,{}),tint:"c2",value:A.name,nodeName:!0,valueRole:"name",caption:g(A.latest,a)},{label:a("nodes.latency.highest"),icon:e.jsx(Te,{}),tint:"c4",value:C.name,nodeName:!0,valueRole:"name",caption:g(C.latest,a)},{label:a("ui.unavailable"),value:a("nodes.latency.count",{n:P}),icon:e.jsx(v,{}),tint:"c5",tone:P?"negative":voidLine truncated
@@ -1 +0,0 @@
import{j as e,r as n}from"./vendor-react-64fcanlc.js";import{T as a,cU as s,C as r,A as o,az as i,aF as t,P as l,W as d,X as c,K as u,as as m,cP as p,cR as g,M as h,aE as v,D as b,N as f,bG as j,J as x,cV as y,aS as k,V as w,cS as N,I as P,b_ as S,aJ as C,em as M,aZ as A,c5 as T,en as F,eo as G,cI as L,O as R,a4 as D,e0 as O,a0 as q,cK as _,cC as E,bb as I,ep as H,j as Q,bd as B,ai as K,eq as U,e as W,d as J,bj as V,er as z,es as Y,dc as $,dd as X,a1 as Z,Y as ee,df as ne,r as ae,w as se,et as re,bf as oe,bi as ie,au as te,cG as le,cE as de,dg as ce,de as ue,cT as me,aQ as pe,d6 as ge,d8 as he,ee as ve,ec as be}from"./index-CmbH0woS.js";import{T as fe}from"./Tabs-BzeNgTje.js";import{c as je,u as xe,b as ye,S as ke,M as we,A as Ne,L as Pe,o as Se,p as Ce,r as Me,e as Ae}from"./ActionGroup-D3mQjUsw.js";import{ae as Te,a2 as Fe,af as Ge,ag as Le,C as Re,F as De,ah as Oe,ai as qe,aj as _e,ak as Ee,al as Ie,am as He,an as Qe,ao as Be,ap as Ke,aq as Ue,ar as We,as as Je,at as Ve,au as ze,_ as Ye,r as $e,av as Xe,aw as Ze,a as en,ax as nn,ay as an,az as sn,aA as rn,aB as on,aC as tn,aD as ln,aE as dn,aF as cn,aG as un,aH as mn,aI as pn,aJ as gn,aK as hn,Y as vn,aL as bn,aM as fn,aN as jn,aO as xn}from"./activity-CiEWAlFW.js";import{T as yn}from"./Toolbar-B9K5nAyx.js";import{T as kn}from"./TimeCell-D0UB-mKs.js";import{a as wn,$ as Nn}from"./GridList-ByMoT8kr.js";import{P as Pn}from"./ProbeOptionsDialog-DgWCU4Y0.js";import{D as Sn,c as Cn}from"./Table-Cfbaho6J.js";import{F as Mn,T as An,L as Tn}from"./Tag-fyQjN-Xw.js";import{FlagField as Fn}from"./FlagPicker-v8i5Q7lf.js";import{S as Gn}from"./SearchSelect-CuaWhoLz.js";import{u as Ln}from"./outbounds-CUyNhEhE.js";import{$ as Rn}from"./SearchList-CJ8rQxgu.js";import{a as Dn,p as On}from"./probe-D0sWIaS4.js";import{n as qn}from"./nav-ClMHrgx_.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./Checkbox-f7Je53QZ.js";import"./Select-BcN72K3H.js";import"./Virtualizer-itu1Kg0o.js";function _n({label:n,items:a,selected:s,onSelect:t,loading:l,empty:d,children:c}){const u=r();return e.jsx(Nn,{className:"rp-cardview","aria-label":n,layout:"grid",items:a,dependencies:[c],selectionMode:"single",selectionBehavior:"replace",disallowEmptySelection:!0,selectedKeys:s?[s]:[],onSelectionChange:e=>{if("all"===e)return;const n=[...e][0];null!=n&&t(String(n))},renderEmptyState:()=>l?e.jsx(o,{}):e.jsx(i,{children:d??u("ui.empty")}),children:c})}function En({id:n,title:r,titleFull:o,meta:i,actions:t,children:l}){return e.jsxs(wn,{id:n,textValue:r,className:s("rp-cardview-card"),children:[e.jsxs("div",{className:"rp-cardview-head",children:[e.jsx(a,{className:"rp-cardview-title",text:o,children:r}),t&&e.jsx("span",{className:"rp-cardview-actions",children:t})]}),i&&e.jsx("div",{className:"rp-cardview-meta",children:i}),l]})}function In(a,s){return a.split("{names}").map((a,r)=>e.jsxs(n.Fragment,{children:[r>0&&s,a]},r))}function Hn(a,s,r,o){const i=v(s,["",""]),t=a.slice(0,6).map((a,s)=>e.jsxs(n.Fragment,{children:[s>0&&i,e.jsx(b,{appearance:"link",layout:"inline",href:o.get(a.id)??Ee([a.id]),children:e.jsx(f,{name:a.name})})]},a.id));if(a.length<=6)return t;const l=e.jsx(b,{appearance:"link",layout:"inline",href:Ee(a.map(e=>e.id)),children:r("nodes.latency.more",{n:a.length-6})});return r("nodes.latency.andMore",{names:"{names}",more:"{more}"}).split(/(\{names\}|\{more\})/).map((a,s)=>e.jsx(n.Fragment,{children:"{names}"===a?t:"{more}"===a?l:a},s))}function Qn(){const a=r(),s=l(),{nodes:v,by:b,setBy:f,view:j,hrefs:x}=function(){const e=t[l()],a=d().data?.resources,s=je(c(a,"nodes",{whileLoading:!0})),r=xe(c(a,"groups",{whileLoading:!1})),o=ye(c(a,"providers",{whileLoading:!0})),[i,u]=n.useState("group"),m=n.useMemo(()=>Te(s.data??[],r.data,i,e),[s.data,r.data,i,e]),p=n.useMemo(()=>new Map((s.data??[]).map(e=>[e.id,Fe(e,o.data?.providers??[],!0)])),[s.data,o.data]);return{nodes:s,by:i,setBy:u,view:m,hrefs:p}}();if(v.error&&!v.data)return e.jsx(u,{error:v.error,onRetry:v.refetch});if(!v.data)return e.jsx(o,{});if(!v.data.length)return e.jsx(i,{children:a("ui.empty")});const y=Ge(j),{measured:k,down:w}=Le(j),N=k.length?[{label:a("nodes.latency.lowest"),icon:e.jsx(p,{}),tint:"c2",value:k[0].name,nodeName:!0,valueRole:"name",caption:m(k[0].latest,a)},{label:a("nodes.latency.highest"),icon:e.jsx(Re,{}),tint:"c4",value:k[k.length-1].name,nodeName:!0,valueRole:"name",caption:m(k[k.length-1].latest,a)},{label:a("ui.unavailable"),value:a("nodes.latency.count",{n:w}),icon:e.jsx(g,{}),tint:"c5",tone:w?"negative":void 0}]:[],P=e=>{const n=e.filter(e=>"unavailable"===e.state),r=e.filter(e=>"unmeasured"===e.state);return[...n.length?[In(a("nodes.latency.unavailableList",{n:n.length,names:"{names}"}),Hn(n,s,a,x))]:[],...r.length?[In(a("nodes.latency.unmeasuredList",{n:r.length,names:"{names}"}),Hn(r,s,a,x))]:[]]};return e.jsxs("div",{className:"rp-chart-page",children:[e.jsx(De,{facts:N}),e.jsx(h,{title:a("ui.nodeLatency"),note:a("nodes.latency.sample",{n:v.data.length}),aside:e.jsx(ke,{label:a("nodes.latLine truncated
@@ -0,0 +1 @@
import{r as e,a as t,$ as i,j as a}from"./vendor-react-64fcanlc.js";import{g7 as s,em as n,ez as r,g8 as l,cC as o,cN as u,fi as c,en as d,cJ as m,g9 as p,ep as v,dv as h,cK as f,fN as b,dA as g,cI as y,ga as N,ex as S,cD as x,g6 as P,cE as D,gb as w,eP as E,er as V,dw as M,dz as F,cO as R,cP as I,cQ as C,cR as B,cS as O,bp as T,cT as j,d1 as L,cU as k,cW as $,gc as U,gd as A,cX as q,eN as G,cY as K,cZ as W,cV as z,I as H,da as Y,u as Z,cl as _,d4 as X,fk as J,ge as Q,cn as ee,b7 as te,d5 as ie,gf as ae,cf as se,dC as ne}from"./index-ucpAK88B.js";const re=new RegExp("^.*\\(.*\\).*$"),le=["latn","arab","hanidec","deva","beng","fullwide"];class oe{constructor(e,t={}){this.locale=e,this.options=t}parse(e){return ce(this.locale,this.options,e).parse(e)}isValidPartialNumber(e,t,i){return ce(this.locale,this.options,e).isValidPartialNumber(e,t,i)}getNumberingSystem(e){return ce(this.locale,this.options,e).options.numberingSystem}}const ue=new Map;function ce(e,t,i){let a=de(e,t);if(!e.includes("-nu-")&&!a.isValidPartialNumber(i))for(let s of le)if(s!==a.options.numberingSystem){let a=de(e+(e.includes("-u-")?"-nu-":"-u-nu-")+s,t);if(a.isValidPartialNumber(i))return a}return a}function de(e,t){let i=e+(t?Object.entries(t).sort((e,t)=>e[0]<t[0]?-1:1).join():""),a=ue.get(i);return a||(a=new me(e,t),ue.set(i,a)),a}class me{constructor(e,t={}){this.locale=e,1!==t.roundingIncrement&&null!=t.roundingIncrement&&(null==t.maximumFractionDigits&&null==t.minimumFractionDigits?(t.maximumFractionDigits=0,t.minimumFractionDigits=0):null==t.maximumFractionDigits?t.maximumFractionDigits=t.minimumFractionDigits:null==t.minimumFractionDigits&&(t.minimumFractionDigits=t.maximumFractionDigits)),this.formatter=new Intl.NumberFormat(e,t),this.options=this.formatter.resolvedOptions(),this.symbols=function(e,t,i,a){let s=new Intl.NumberFormat(e,{...i,minimumSignificantDigits:1,maximumSignificantDigits:21,roundingIncrement:1,roundingPriority:"auto",roundingMode:"halfExpand",useGrouping:!0}),n=s.formatToParts(-10000.111),r=s.formatToParts(10000.111),l=ve.map(e=>s.formatToParts(e)),o=l.map((e,t)=>{let i=e.find(e=>"unit"===e.type);return i&&!e.some(e=>"integer"===e.type||"fraction"===e.type)?{unit:i.value,value:ve[t]}:null}).filter(e=>!!e),u=n.find(e=>"minusSign"===e.type)?.value??"-",c=r.find(e=>"plusSign"===e.type)?.value;c||"exceptZero"!==a?.signDisplay&&"always"!==a?.signDisplay||(c="+");let d=new Intl.NumberFormat(e,{...i,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001),m=d.find(e=>"decimal"===e.type)?.value,p=n.find(e=>"group"===e.type)?.value,v=n.filter(e=>!pe.has(e.type)).map(e=>fe(e.value)),h=l.flatMap(e=>e.filter(e=>!pe.has(e.type)).map(e=>fe(e.value))),f=[...new Set([...v,...h])].sort((e,t)=>t.length-e.length),b=0===f.length?new RegExp("\\p{White_Space}|\\p{Cf}","gu"):new RegExp(`${f.join("|")}|\\p{White_Space}|\\p{Cf}`,"gu"),g=[...new Intl.NumberFormat(i.locale,{useGrouping:!1}).format(9876543210)].reverse(),y=new Map(g.map((e,t)=>[e,t])),N=new RegExp(`[${g.join("")}]`,"g");return{minusSign:u,plusSign:c,decimal:m,group:p,literals:b,numeral:N,numerals:g,index:e=>String(y.get(e)),noNumeralUnits:o}}(e,this.formatter,this.options,t),"percent"===this.options.style&&((this.options.minimumFractionDigits??0)>18||(this.options.maximumFractionDigits??0)>18)&&console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.")}parse(e){let t=this.formatter.resolvedOptions().useGrouping,i=this.sanitize(e);if(!t&&this.symbols.group&&i.includes(this.symbols.group))return NaN;if(this.symbols.group&&(i=i.replaceAll(this.symbols.group,"")),this.symbols.decimal&&(i=i.replace(this.symbols.decimal,".")),this.symbols.minusSign&&(i=i.replace(this.symbols.minusSign,"-")),i=i.replace(this.symbols.numeral,this.symbols.index),"percent"===this.options.style){let e=i.indexOf("-");i=i.replace("-",""),i=i.replace("+","");let t=i.indexOf(".");-1===t&&(t=i.length),i=i.replace(".",""),i=t-2==0?`0.${i}`:t-2==-1?`0.0${i}`:t-2==-2?"0.00":`${i.slice(0,t-2)}.${i.slice(t-2)}`,e>-1&&(i=`-${i}`)}let a=i?+i:NaN;if(isNaN(a))return NaN;if("percent"===this.options.style){let e={...this.options,style:"decimal",minimumFractionDigits:Math.min((this.options.minimumFractionDigits??0)+2,20),maximumFractionDigits:Math.min((this.options.maximumFractionDigits??0)+2,20)};return new oe(this.locale,e).parse(new s(this.locale,e).format(a))}return"accounting"===this.options.currencySign&&re.test(e)&&(a*=-1),a}sanitize(e){let t=this.formatter.resolvedOptions().useGrouping;return this.symbols.noNumeralUnits.length>0&&this.symbols.noNumeralUnits.find(t=>t.unit===e)?this.symbols.noNumeralUnits.find(t=>t.unit===e).value.toString():(e=e.replace(this.symbols.literals,""),this.symbols.minusSign&&(e=e.replace("-",this.symbols.minusSign)),"arab"===this.options.numberingSystem&&(this.symbols.decimal&&(e=he(e,",",this.symbols.decimal),e=he(e,String.fromCharCode(1548),this.symbols.decimal)),this.symbols.group&&t&&(eLine truncated
@@ -0,0 +1 @@
import{j as r}from"./vendor-react-64fcanlc.js";import"./index-ucpAK88B.js";import{L as e}from"./Tag-C65IJXSk.js";function o({label:o,href:s}){return s?r.jsx(e,{href:s,children:o}):o}export{o as O};
@@ -1 +0,0 @@
import{j as r}from"./vendor-react-64fcanlc.js";import"./index-CmbH0woS.js";import{L as e}from"./Tag-fyQjN-Xw.js";function o({label:o,href:s}){return s?r.jsx(e,{href:s,children:o}):o}export{o as O};
@@ -1 +0,0 @@
import{r as e,j as t}from"./vendor-react-64fcanlc.js";import{aB as a,ad as s,bl as r,bm as i,bn as o,bp as n,am as l,al as c,aq as d,bg as p,ah as u,j as v,ai as m,C as h,P as f,aF as g,W as x,aG as b,X as j,aI as y,aH as w,a1 as k,cp as _,cq as N,V as H,K as S,D as R,bG as A,T as L,cr as C,M as I,aS as D,cs as F,az as V,aQ as W,aY as E,A as P,Q as q,J as B,ct as M}from"./index-CmbH0woS.js";import{d as G,e as O}from"./files-Dt8K7QfP.js";import{b as T,e as z,c as J,D as K}from"./activity-CiEWAlFW.js";import{e as Q,A as U}from"./ActionGroup-D3mQjUsw.js";import{D as X,t as Y}from"./Table-Cfbaho6J.js";import{D as Z}from"./DaeCode-DEjXqvav.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./Select-BcN72K3H.js";import"./Checkbox-f7Je53QZ.js";import"./Virtualizer-itu1Kg0o.js";import"./daeTokens-BVtuNnWZ.js";const $={connections:v("connections",{tab:"list"}),flows:v("flows",{tab:"records"}),routing_trace:v("rules",{tab:"trace"}),dns_query:v("dns",{tab:"query"}),dns_cache:v("dns",{tab:"cache"}),dns_log:v("dns",{tab:"log"}),events:v("events"),probes:v("nodes",{tab:"latency"}),traffic_history:v("activity"),memory_history:v("activity"),runtime_outbounds:v("activity"),logs:v("logs"),providers:v("nodes"),rules:v("rules",{tab:"list"}),config:v("config"),config_validate:v("config",{tab:"source",panel:"diagnostics"}),runtime_settings:v("settings",{card:"runtime"}),geodata:v("settings",{card:"geodata"})},ee={ebpf:"ov.v.ebpf",userspace:"ov.v.userspace",mock:"ov.v.mock",active:"ov.v.active",degraded:"ov.v.degraded",detached:"ov.v.detached",failed:"ov.v.failed",disabled:"ov.v.disabled",full:"ov.v.full",partial:"ov.v.partial",none:"ov.v.none",real:"ov.v.real",loaded:"ov.v.loaded",not_loaded:"ov.v.notLoaded",attached:"ov.v.attached",partially_attached:"ov.v.partiallyAttached",published:"ov.v.published",not_published:"ov.v.notPublished",healthy:"ov.v.healthy",ready:"ov.v.ready",error:"ov.v.error",unknown:"ov.v.unknown",ingress:"ov.v.ingress",egress:"ov.v.egress"};function te(e,t){return ee[e]?t(ee[e]):e}function ae(e,t,a,s,r=!1,i=[]){const o=e.ebpf,n=o?.maps?.conn_state,l=(e,t)=>{const s=function(e,t,a){return"degraded"===e?{title:a("ov.v.degraded"),text:a(t?"ov.degradedHelp.runtime":"ov.degradedHelp.datapath")}:"unknown"===e?{title:a("ov.v.unknown"),text:a("ov.unknownHelp")}:void 0}(t,r,a);return s?{label:a(e),value:te(t,a),help:s}:[a(e),te(t,a)]},c=o?.maps?.state??"unknown",d=o&&function(e,t,a,s){if("unknown"!==e||!t.length)return;const r=new Intl.ListFormat(s,{type:"conjunction"}).format(t);return{title:a("ov.v.notVerified"),text:a("ov.notVerifiedHelp",{hooks:r})}}(o.hooks,i,a,s);return[l("ov.f.kind",e.kind),l("ov.f.state",e.state),..."partial"===e.visibility&&o?[]:[l("ov.f.visibility",e.visibility)],...o?[l("ov.f.backend",o.backend),l("ov.f.programs",o.programs),d?{label:a("ov.f.hooks"),value:a("ov.v.notVerified"),help:d}:l("ov.f.hooks",o.hooks),l("ov.f.routing",o.routing.state),l("ov.f.health",o.health),..."partial"===c&&n&&!n.occupancy_known?[[a("ov.f.maps"),a("ov.mapCapacity",{capacity:m(n.capacity,s)})]]:[l("ov.f.maps",c),[a("ov.f.connState"),n?.occupancy_known&&null!==n.occupancy?a("ui.fraction",{part:m(n.occupancy,s),whole:m(n.capacity,s)}):n?a("ov.occupancyUnknown",{capacity:m(n.capacity,s)}):t]]]:[]]}const se={service:"ov.v.cgroupService",shared:"ov.v.cgroupShared"},re={service:"ov.cgroupHelp.service",shared:"ov.cgroupHelp.shared"};function ie(e,t,s,r=[],i=!1){const o=e.cgroup?.scope,n=e=>{const t=a(e??null);return null===t?"—":m(t,s)},l=[["ov.f.rss",c(e.process?.rss_bytes??null,s)],["ov.f.cgroupCurrent",c(e.cgroup?.current_bytes??null,s)],["ov.f.cgroupLimit",i&&null===e.cgroup?.limit_bytes?t("ov.noLimit"):c(e.cgroup?.limit_bytes??null,s)],["ov.f.cgroupScope",o&&"unknown"!==o?t(se[o]):"—"],["ov.f.oomHigh",n(e.cgroup?.events?.high)],["ov.f.oom",n(e.cgroup?.events?.oom)],["ov.f.oomKill",n(e.cgroup?.events?.oom_kill)],["ov.f.ebpfBytes",c(e.kernel?.ebpf_bytes??null,s)]],d=[...r,..."unknown"===o?["ov.f.cgroupScope"]:[],...e.kernel?[]:["ov.f.ebpfBytes"]];return l.filter(([e])=>!d.includes(e)).map(([e,a])=>"ov.f.cgroupScope"===e&&o&&"unknown"!==o?{label:t(e),value:a,help:{title:t(e),text:t("ui.valuePair",{label:a,value:t(re[o])})}}:[t(e),a])}const oe={status:"overview-status",limits:"overview-limits",datapath:"overview-datapath"};function ne(t=""){const v=h(),H=f(),S=g[H],R=x(),A=R.data?.resources,L=b(j(A,"runtime",{whileLoading:!1})),C=y(j(A,"datapath",{whileLoading:!1})),I=w(j(A,"runtime_memory",{whileLoading:!1})),D=k(),F=_(j(A,"runtime_settings",{whileLoading:!1})),V=N(L.data,R.data,L.refetch),[W,E]=e.useState(!1),P=e.useMemo(()=>({capabilities:R.data,runtime:L.data,version:D.data,memory:I.data,datapath:C.data}),[R.data,L.data,D.data,I.data,C.data]),q=e.useMemo(()=>R.data?J(R.data,D.data,v,H,F.data?.recording):[],[R.data,D.data,v,H,F.data?.recording]),B=q.length>0,M=!!C.data,K=R.loading||L.loading||D.loading||I.loading||C.loading||F.loading,U=e.useRef(null),X=new URLSearchParams(t).get("card");e.useEffect(()=>{U.currLine truncated
@@ -0,0 +1 @@
import{r as e,j as t}from"./vendor-react-64fcanlc.js";import{ah as a,Q as s,aO as r,aZ as o,a_ as i,b0 as n,a1 as l,a0 as c,a5 as d,aX as p,X as u,h as v,Y as m,u as h,l as f,al as g,q as x,am as b,r as j,ao as y,an as w,x as k,bT as _,p as N,E as H,T as S,C as L,ax as R,bU as A,af as C,av as I,aD as V,S as D,P as E,B as P,bV as W}from"./index-ucpAK88B.js";import{d as B,e as F}from"./files-Dt8K7QfP.js";import{r as q,e as M,u as O,b as T,D as K,R as U}from"./activity-CbXYXdVY.js";import{e as J,K as X,A as z}from"./logs-DjZPFUMm.js";import{L as Q}from"./AppearanceControls-DmbIJj4H.js";import{D as Y,t as Z}from"./Table-mJjr_XDH.js";import{D as G}from"./DaeCode-DEjXqvav.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./nodes-DqXrz-fh.js";import"./ItemText-CtNOgl4O.js";import"./Select-2JXPV40Q.js";import"./Checkbox-eZH7dxup.js";import"./Virtualizer-mx6Yxab_.js";import"./daeTokens-BVtuNnWZ.js";const $={connections:v("connections",{tab:"list"}),flows:v("flows",{tab:"records"}),routing_trace:v("rules",{tab:"trace"}),dns_query:v("dns",{tab:"query"}),dns_cache:v("dns",{tab:"cache"}),dns_log:v("dns",{tab:"log"}),events:v("events"),probes:v("nodes",{tab:"latency"}),traffic_history:v("activity"),memory_history:v("activity"),runtime_outbounds:v("activity"),logs:v("logs"),providers:v("nodes"),rules:v("rules",{tab:"list"}),config:v("config"),config_validate:v("config",{tab:"source",panel:"diagnostics"}),runtime_settings:v("settings",{card:"runtime"}),geodata:v("settings",{card:"geodata"})},ee={ebpf:"ov.v.ebpf",userspace:"ov.v.userspace",mock:"ov.v.mock",active:"ov.v.active",degraded:"ov.v.degraded",detached:"ov.v.detached",failed:"ov.v.failed",disabled:"ov.v.disabled",full:"ov.v.full",partial:"ov.v.partial",none:"ov.v.none",real:"ov.v.real",loaded:"ov.v.loaded",not_loaded:"ov.v.notLoaded",attached:"ov.v.attached",partially_attached:"ov.v.partiallyAttached",published:"ov.v.published",not_published:"ov.v.notPublished",healthy:"ov.v.healthy",ready:"ov.v.ready",error:"ov.v.error",unknown:"ov.v.unknown",ingress:"ov.v.ingress",egress:"ov.v.egress"};function te(e,t){return ee[e]?t(ee[e]):e}function ae(e,t,a,s,r=!1,o=[]){const i=e.ebpf,n=i?.maps?.conn_state,l=(e,t)=>{const s=function(e,t,a){return"degraded"===e?{title:a("ov.v.degraded"),text:a(t?"ov.degradedHelp.runtime":"ov.degradedHelp.datapath")}:"unknown"===e?{title:a("ov.v.unknown"),text:a("ov.unknownHelp")}:void 0}(t,r,a);return s?{label:a(e),value:te(t,a),help:s}:[a(e),te(t,a)]},c=i?.maps?.state??"unknown",d=i&&function(e,t,a,s){if("unknown"!==e||!t.length)return;const r=new Intl.ListFormat(s,{type:"conjunction"}).format(t);return{title:a("ov.v.notVerified"),text:a("ov.notVerifiedHelp",{hooks:r})}}(i.hooks,o,a,s);return[l("ov.f.kind",e.kind),l("ov.f.state",e.state),..."partial"===e.visibility&&i?[]:[l("ov.f.visibility",e.visibility)],...i?[l("ov.f.backend",i.backend),l("ov.f.programs",i.programs),d?{label:a("ov.f.hooks"),value:a("ov.v.notVerified"),help:d}:l("ov.f.hooks",i.hooks),l("ov.f.routing",i.routing.state),l("ov.f.health",i.health),..."partial"===c&&n&&!n.occupancy_known?[[a("ov.f.maps"),a("ov.mapCapacity",{capacity:m(n.capacity,s)})]]:[l("ov.f.maps",c),[a("ov.f.connState"),n?.occupancy_known&&null!==n.occupancy?a("ui.fraction",{part:m(n.occupancy,s),whole:m(n.capacity,s)}):n?a("ov.occupancyUnknown",{capacity:m(n.capacity,s)}):t]]]:[]]}const se={service:"ov.v.cgroupService",shared:"ov.v.cgroupShared"},re={service:"ov.cgroupHelp.service",shared:"ov.cgroupHelp.shared"};function oe(e,t,s,r=[],o=!1){const i=e.cgroup?.scope,n=e=>{const t=a(e??null);return null===t?"—":m(t,s)},l=[["ov.f.rss",c(e.process?.rss_bytes??null,s)],["ov.f.cgroupCurrent",c(e.cgroup?.current_bytes??null,s)],["ov.f.cgroupLimit",o&&null===e.cgroup?.limit_bytes?t("ov.noLimit"):c(e.cgroup?.limit_bytes??null,s)],["ov.f.cgroupScope",i&&"unknown"!==i?t(se[i]):"—"],["ov.f.oomHigh",n(e.cgroup?.events?.high)],["ov.f.oom",n(e.cgroup?.events?.oom)],["ov.f.oomKill",n(e.cgroup?.events?.oom_kill)],["ov.f.ebpfBytes",c(e.kernel?.ebpf_bytes??null,s)]],d=[...r,..."unknown"===i?["ov.f.cgroupScope"]:[],...e.kernel?[]:["ov.f.ebpfBytes"]];return l.filter(([e])=>!d.includes(e)).map(([e,a])=>"ov.f.cgroupScope"===e&&i&&"unknown"!==i?{label:t(e),value:a,help:{title:t(e),text:t("ui.valuePair",{label:a,value:t(re[i])})}}:[t(e),a])}const ie={status:"overview-status",limits:"overview-limits",datapath:"overview-datapath"};function ne(t=""){const v=h(),N=f(),H=g[N],S=x(),L=S.data?.resources,R=b(j(L,"runtime",{whileLoading:!1})),A=y(j(L,"datapath",{whileLoading:!1})),C=w(j(L,"runtime_memory",{whileLoading:!1})),I=k(),V=_(j(L,"runtime_settings",{whileLoading:!1})),D=O(R.data,S.data,R.refetch),[E,P]=e.useState(!1),W=e.useMemo(()=>({capabilities:S.data,runtime:R.data,version:I.data,memory:C.data,datapath:A.data}),[S.data,R.data,I.data,C.data,A.data]),K=e.useMemo(()=>S.data?T(S.data,I.data,v,N,V.data?.recording):[],[S.data,I.data,v,N,V.data?.recording]),U=K.length>0,X=!!A.data,z=S.loading||R.loading||I.loading||C.loading||A.loadiLine truncated
@@ -0,0 +1 @@
import{r as e,j as t}from"./vendor-react-64fcanlc.js";import{P as n}from"./ProbeOptionsDialog-BzHoOnqn.js";import{C as i,a as s,b as r,E as l}from"./ConditionRow-C-4K5nkB.js";import{A as o}from"./AddCircle-Dk2gnxD-.js";import{T as a,R as d,j as c,s as u,u as p,w as m,l as h,k as g,U as f,V as b,S as y,O as v,Q as x,r as j,P as k}from"./nodes-DqXrz-fh.js";import{bp as w,u as S,h as N,I as C,N as M,w as _,aV as I,cj as E,U as D,G as O,aW as P,bQ as R,ck as L,b1 as z,aU as T,Y as $,al as q,l as K,b7 as A,i as F,af as H,bG as V,ch as G,cl as U,cm as J,cn as B,bw as Q,co as Y,cp as W,B as X,aE as Z,bk as ee,cq as te,b5 as ne,cr as ie,cs as se,aA as re,bF as le,c1 as oe,a9 as ae,ct as de,cu as ce,q as ue,r as pe,cv as me,cw as he,aR as ge,t as fe,A as be,aN as ye,aq as ve,H as xe,az as je,c2 as ke,v as we,cx as Se,E as Ne,cg as Ce,aG as Me,cy as _e,C as Ie,p as Ee,T as De,cz as Oe,ax as Pe,av as Re,b as Le,a as ze}from"./index-ucpAK88B.js";import{T as Te,a as $e,L as qe}from"./Tag-C65IJXSk.js";import{D as Ke}from"./DaeCode-DEjXqvav.js";import{N as Ae,p as Fe,L as He,D as Ve,K as Ge,h as Ue,g as Je,u as Be,c as Qe,v as Ye,w as We,m as Xe,x as Ze,S as et,n as tt}from"./logs-DjZPFUMm.js";import{T as nt}from"./Toolbar-D1_-nNpE.js";import{C as it,L as st}from"./AppearanceControls-DmbIJj4H.js";import{$ as rt,S as lt}from"./SearchList-BxTMvuPr.js";import{i as ot,v as at,w as dt,x as ct,y as ut,z as pt,A as mt,E as ht,G as gt,H as ft,I as bt,J as yt,K as vt,M as xt,N as jt,O as kt,P as wt,Q as St,T as Nt,V as Ct,X as Mt,Y as _t,Z as It}from"./activity-CbXYXdVY.js";import{$ as Et,a as Dt}from"./GridList-DW6-BWSL.js";import{$ as Ot,a as Pt,b as Rt,c as Lt,d as zt}from"./Virtualizer-mx6Yxab_.js";import{$ as Tt,a as $t}from"./Select-2JXPV40Q.js";import{a as qt,b as Kt}from"./ItemText-CtNOgl4O.js";import{S as At}from"./SearchSelect-CQDeD6gi.js";import{N as Ft,t as Ht,n as Vt}from"./NumberField-Blv4W9AC.js";import{p as Gt}from"./probe-BrDCvIoc.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./Checkbox-eZH7dxup.js";import"./daeTokens-BVtuNnWZ.js";const Ut={minItemSize:new Pt(200,200),maxItemSize:new Pt(1/0,1/0),preserveAspectRatio:!1,minSpace:new Pt(18,18),maxSpace:1/0,maxColumns:1/0,dropIndicatorThickness:2,loaderHeight:48};class Jt extends Ot{shouldInvalidateLayoutOptions(e,t){return e.maxColumns!==t.maxColumns||e.dropIndicatorThickness!==t.dropIndicatorThickness||e.preserveAspectRatio!==t.preserveAspectRatio||!(e.minItemSize||Ut.minItemSize).equals(t.minItemSize||Ut.minItemSize)||!(e.maxItemSize||Ut.maxItemSize).equals(t.maxItemSize||Ut.maxItemSize)||!(e.minSpace||Ut.minSpace).equals(t.minSpace||Ut.minSpace)||e.maxHorizontalSpace!==t.maxHorizontalSpace||e.loaderHeight!==t.loaderHeight||e.direction!==t.direction}update(e){let{minItemSize:t=Ut.minItemSize,maxItemSize:n=Ut.maxItemSize,preserveAspectRatio:i=Ut.preserveAspectRatio,minSpace:s=Ut.minSpace,maxHorizontalSpace:r=Ut.maxSpace,maxColumns:l=Ut.maxColumns,dropIndicatorThickness:o=Ut.dropIndicatorThickness,loaderHeight:a=Ut.loaderHeight,direction:d="ltr"}=e.layoutOptions||{};this.dropIndicatorThickness=o,this.direction=d;let c=this.virtualizer.size.width,u=Math.min(n.width,c),p=Number.isFinite(n.height)?n.height:Math.floor(t.height/t.width*u),m=Math.floor(c/(t.width+s.width)),h=Math.max(1,Math.min(l,m));this.numColumns=h;let g=c-s.width*Math.max(0,h),f=Math.floor(g/h);f=Math.max(t.width,Math.min(u,f));let b=(f-t.width)/Math.max(1,u-t.width),y=t.height+Math.floor((p-t.height)*b);y=Math.max(t.height,Math.min(p,y));let v=Math.min(Math.max(r,s.width),Math.floor((c-h*f)/(h+1)));this.gap=new Pt(v,s.height),this.margin=Math.floor((c-h*f-v*(h+1))/2);let x=this.virtualizer.collection,j=x.size,k=x.getLastKey();for(let E=0;E<2&&null!=k;E++){let e=x.getItem(k);if("skeleton"===e?.type){j++;break}k=x.getKeyBefore(k)}let w=Math.ceil(j/h),S=x[Symbol.iterator](),N=w>0?s.height:0,C=new Map,M=null,_=0;for(let E=0;E<w;E++){let t=0,n=[];for(let s=0;s<h;s++){let r=M||S.next().value;if(!r)break;if("loader"===r.type)continue;"skeleton"===r.type&&(M=r);let l=M?`${M.key}-${_++}`:r.key,o=this.layoutInfos.get(l),a=r;M&&(a=o&&o.content.key===l?o.content:{...M,key:l});let d=v+s*(f+v)+this.margin,c=y,u=!i;o&&u&&(c=o.rect.height,u=e.layoutOptionsChanged||e.sizeChanged||o.estimatedSize||o.content!==a);let p=new Lt(d,N,f,c),m=new Rt(r.type,l,p);m.estimatedSize=u,m.allowOverflow=!0,m.content=a,C.set(l,m),n.push(m),t=Math.max(t,m.rect.height)}for(let e of n)e.rect.height=t;N+=t+s.height,M&&E===w-1&&N<this.virtualizer.size.height&&w++}let I=x.getItem(x.getLastKey());if("loader"===I?.type){(_>0||!I.props.isLoading)&&(a=0);let e=new Lt(v,N,c-2*v,a),t=new Rt("loader",I.key,e);C.set(I.key,t),N=t.rect.maxY}this.layoutInfos=C,this.contentSize=new Pt(this.virtualizer.size.width,N)}getLayoutInfo(e){return this.layoutInfos.get(e)||null}getContentSize(){return this.contentSize}getVisibleLayoutInfos(e){let t=[];for(let n of this.layoutInfos.values())(n.rect.intersects(e)||this.virtualizer.isPersistedKey(n.key)||"loadeLine truncated
@@ -1 +0,0 @@
import{r as e,j as t}from"./vendor-react-64fcanlc.js";import{P as n}from"./ProbeOptionsDialog-DgWCU4Y0.js";import{C as i,a as s,b as r,E as l}from"./ConditionRow-B2vbKntf.js";import{A as a}from"./AddCircle-JwHCi_at.js";import{bs as o,C as d,cW as c,j as u,I as p,N as m,w as h,bd as g,cX as f,ae as b,a7 as y,be as v,ck as x,cY as j,bq as k,bb as w,ai as S,aF as N,P as M,bZ as C,G as _,az as I,c5 as D,O as E,cT as O,cZ as L,c_ as P,c$ as z,bO as R,d0 as T,d1 as $,d2 as q,d3 as K,J as F,aZ as H,c4 as A,D as V,d4 as G,d5 as J,d6 as U,d7 as B,d8 as Y,aV as W,bG as X,cB as Q,at as Z,q as ee,ba as te,s as ne,u as ie,d as se,d9 as re,bf as le,da as ae,db as oe,g as de,W as ce,X as ue,Y as pe,dc as me,dd as he,b6 as ge,cm as fe,r as be,L as ye,cl as ve,a4 as xe,de as je,aO as ke,a8 as we,df as Se,aU as Ne,cC as Me,a0 as Ce,dg as _e,K as Ie,cS as De,A as Ee,dh as Oe,M as Le,V as Pe,T as ze,di as Re,aS as Te,aQ as $e}from"./index-CmbH0woS.js";import{T as qe,a as Ke,L as Fe}from"./Tag-fyQjN-Xw.js";import{D as He}from"./DaeCode-DEjXqvav.js";import{N as Ae,i as Ve,L as Ge,c as Je,b as Ue,u as Be,g as Ye,m as We,S as Xe,M as Qe}from"./ActionGroup-D3mQjUsw.js";import{T as Ze}from"./Toolbar-B9K5nAyx.js";import{$ as et,S as tt}from"./SearchList-CJ8rQxgu.js";import{m as nt,y as it,z as st,A as rt,E as lt,G as at,H as ot,I as dt,J as ct,r as ut,K as pt,M as mt,N as ht,O as gt,P as ft,Q as bt,R as yt,T as vt,V as xt,X as jt,Y as kt,Z as wt,_ as St,$ as Nt,a0 as Mt,a1 as Ct}from"./activity-CiEWAlFW.js";import{$ as _t,a as It}from"./GridList-ByMoT8kr.js";import{$ as Dt,a as Et,b as Ot,c as Lt,d as Pt}from"./Virtualizer-itu1Kg0o.js";import{$ as zt,a as Rt}from"./Select-BcN72K3H.js";import{S as Tt}from"./SearchSelect-CuaWhoLz.js";import{p as $t}from"./probe-D0sWIaS4.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./Checkbox-f7Je53QZ.js";import"./daeTokens-BVtuNnWZ.js";const qt={minItemSize:new Et(200,200),maxItemSize:new Et(1/0,1/0),preserveAspectRatio:!1,minSpace:new Et(18,18),maxSpace:1/0,maxColumns:1/0,dropIndicatorThickness:2,loaderHeight:48};class Kt extends Dt{shouldInvalidateLayoutOptions(e,t){return e.maxColumns!==t.maxColumns||e.dropIndicatorThickness!==t.dropIndicatorThickness||e.preserveAspectRatio!==t.preserveAspectRatio||!(e.minItemSize||qt.minItemSize).equals(t.minItemSize||qt.minItemSize)||!(e.maxItemSize||qt.maxItemSize).equals(t.maxItemSize||qt.maxItemSize)||!(e.minSpace||qt.minSpace).equals(t.minSpace||qt.minSpace)||e.maxHorizontalSpace!==t.maxHorizontalSpace||e.loaderHeight!==t.loaderHeight||e.direction!==t.direction}update(e){let{minItemSize:t=qt.minItemSize,maxItemSize:n=qt.maxItemSize,preserveAspectRatio:i=qt.preserveAspectRatio,minSpace:s=qt.minSpace,maxHorizontalSpace:r=qt.maxSpace,maxColumns:l=qt.maxColumns,dropIndicatorThickness:a=qt.dropIndicatorThickness,loaderHeight:o=qt.loaderHeight,direction:d="ltr"}=e.layoutOptions||{};this.dropIndicatorThickness=a,this.direction=d;let c=this.virtualizer.size.width,u=Math.min(n.width,c),p=Number.isFinite(n.height)?n.height:Math.floor(t.height/t.width*u),m=Math.floor(c/(t.width+s.width)),h=Math.max(1,Math.min(l,m));this.numColumns=h;let g=c-s.width*Math.max(0,h),f=Math.floor(g/h);f=Math.max(t.width,Math.min(u,f));let b=(f-t.width)/Math.max(1,u-t.width),y=t.height+Math.floor((p-t.height)*b);y=Math.max(t.height,Math.min(p,y));let v=Math.min(Math.max(r,s.width),Math.floor((c-h*f)/(h+1)));this.gap=new Et(v,s.height),this.margin=Math.floor((c-h*f-v*(h+1))/2);let x=this.virtualizer.collection,j=x.size,k=x.getLastKey();for(let D=0;D<2&&null!=k;D++){let e=x.getItem(k);if("skeleton"===e?.type){j++;break}k=x.getKeyBefore(k)}let w=Math.ceil(j/h),S=x[Symbol.iterator](),N=w>0?s.height:0,M=new Map,C=null,_=0;for(let D=0;D<w;D++){let t=0,n=[];for(let s=0;s<h;s++){let r=C||S.next().value;if(!r)break;if("loader"===r.type)continue;"skeleton"===r.type&&(C=r);let l=C?`${C.key}-${_++}`:r.key,a=this.layoutInfos.get(l),o=r;C&&(o=a&&a.content.key===l?a.content:{...C,key:l});let d=v+s*(f+v)+this.margin,c=y,u=!i;a&&u&&(c=a.rect.height,u=e.layoutOptionsChanged||e.sizeChanged||a.estimatedSize||a.content!==o);let p=new Lt(d,N,f,c),m=new Ot(r.type,l,p);m.estimatedSize=u,m.allowOverflow=!0,m.content=o,M.set(l,m),n.push(m),t=Math.max(t,m.rect.height)}for(let e of n)e.rect.height=t;N+=t+s.height,C&&D===w-1&&N<this.virtualizer.size.height&&w++}let I=x.getItem(x.getLastKey());if("loader"===I?.type){(_>0||!I.props.isLoading)&&(o=0);let e=new Lt(v,N,c-2*v,o),t=new Ot("loader",I.key,e);M.set(I.key,t),N=t.rect.maxY}this.layoutInfos=M,this.contentSize=new Et(this.virtualizer.size.width,N)}getLayoutInfo(e){return this.layoutInfos.get(e)||null}getContentSize(){return this.contentSize}getVisibleLayoutInfos(e){let t=[];for(let n of this.layoutInfos.values())(n.rect.intersects(e)||this.virtualizer.isPersistedKey(n.key)||"loader"===n.type)&&t.push(n);return t}updateItemSize(e,t){let n=this.layoutInfos.get(e);if(!t||!n)return!1;if(t.height!==n.rect.height){let i=n.copy();return i.rect.height=t.height,i.estimateLine truncated
@@ -0,0 +1 @@
import{r as e,j as s}from"./vendor-react-64fcanlc.js";import{u as o,b5 as i,cr as c,ch as a,B as r}from"./index-ucpAK88B.js";import{F as n,G as t,L as l}from"./logs-DjZPFUMm.js";function d({model:d}){const h=o(),m=e.useId(),p=n(),[u,b]=e.useState(t(d.choices,p.choice)?.id??""),[j,x]=e.useState(p.cold),[f,g]=e.useState(p.leaves),v=d.busy||!d.choices.some(e=>e.id===u);return s.jsx(i,{narrow:!0,isOpen:!0,onOpenChange:e=>!e&&d.close(),title:h("probe.title"),description:d.name,footer:()=>s.jsxs(s.Fragment,{children:[s.jsx(r,{onPress:d.close,children:h("ui.cancel")}),s.jsx(r,{accent:!0,type:"submit",form:m,isDisabled:v,children:h("probe.submit")})]}),children:s.jsxs(c,{id:m,onSubmit:e=>{e.preventDefault(),v||d.submit({...p,choice:u,cold:j,leaves:f})},children:[s.jsx(l,{label:h("probe.kind"),value:u,onChange:b,items:d.choices.map(e=>({id:e.id,label:h(e.label)}))}),s.jsx(a,{isSelected:j,onChange:x,children:h("probe.cold")}),d.group&&s.jsx(a,{isSelected:f,onChange:g,children:h("probe.leaves")})]})})}export{d as P};
@@ -1 +0,0 @@
import{r as e,j as s}from"./vendor-react-64fcanlc.js";import{C as o,d6 as i,d7 as a,cT as c,J as n}from"./index-CmbH0woS.js";import{s as r,t,L as l}from"./ActionGroup-D3mQjUsw.js";function d({model:d}){const m=o(),p=e.useId(),h=r(),[u,b]=e.useState(t(d.choices,h.choice)?.id??""),[j,x]=e.useState(h.cold),[f,g]=e.useState(h.leaves),v=d.busy||!d.choices.some(e=>e.id===u);return s.jsx(i,{narrow:!0,isOpen:!0,onOpenChange:e=>!e&&d.close(),title:m("probe.title"),description:d.name,footer:()=>s.jsxs(s.Fragment,{children:[s.jsx(n,{onPress:d.close,children:m("ui.cancel")}),s.jsx(n,{accent:!0,type:"submit",form:p,isDisabled:v,children:m("probe.submit")})]}),children:s.jsxs(a,{id:p,onSubmit:e=>{e.preventDefault(),v||d.submit({...h,choice:u,cold:j,leaves:f})},children:[s.jsx(l,{label:m("probe.kind"),value:u,onChange:b,items:d.choices.map(e=>({id:e.id,label:m(e.label)}))}),s.jsx(c,{isSelected:j,onChange:x,children:m("probe.cold")}),d.group&&s.jsx(c,{isSelected:f,onChange:g,children:m("probe.leaves")})]})})}export{d as P};
@@ -1 +0,0 @@
import{r as e,$ as s,j as n}from"./vendor-react-64fcanlc.js";import{dj as i,dk as r,dl as l,dm as a,dn as t,dp as o,dq as d,bs as u,dr as c,ds as p,dt as m,du as f,dv as h,dw as b,dx as g,dy as v,dz as x,dA as y,dB as k,dC as w,dD as j,dE as _,dF as N,dG as S,dH as C,dI as M,dJ as D,dK as P,dL as q,dM as R,dN as H,dO as I,dP as E,aY as L,dQ as O,dR as A,bZ as F,dS as T,s as W,u as V,cE as $,a8 as Q,as as U,aE as B,ae as G,i as K,o as J,j as Z,X as Y,dT as z,am as X,aF as ee,dU as se,dV as ne,dW as ie,dX as re,dY as le,k as ae,ai as te,w as oe,dZ as de,d_ as ue,ba as ce,d$ as pe,co as me,cC as fe,C as he,P as be,at as ge,W as ve,a3 as xe,a4 as ye,cK as ke,ao as we,e0 as je,Z as _e,dd as Ne,e1 as Se,e2 as Ce,e3 as Me,e4 as De,e5 as Pe,Y as qe,cp as Re,e6 as He,e7 as Ie,e8 as Ee,e9 as Le,r as Oe,ea as Ae,eb as Fe,a1 as Te,df as We,bT as Ve,av as $e,M as Qe,c4 as Ue,d4 as Be,cT as Ge,J as Ke,ec as Je,ed as Ze,d5 as Ye,aQ as ze,V as Xe,d7 as es,c5 as ss,ee as ns,K as is,dh as rs,aS as ls,ef as as,D as ts,aZ as os,cS as ds,T as us,cD as cs,cG as ps,A as ms,cU as fs,bG as hs}from"./index-CmbH0woS.js";import{u as bs,r as gs,a as vs,c as xs}from"./flows-BMReQznn.js";import{u as ys,c as ks,o as ws,b as js,q as _s,e as Ns,L as Ss,S as Cs,R as Ms}from"./ActionGroup-D3mQjUsw.js";import{a2 as Ds,a3 as Ps,a4 as qs,h as Rs,a5 as Hs,a6 as Is,a7 as Es,a8 as Ls,a9 as Os,aa as As,ab as Fs,ac as Ts,w as Ws,ad as Vs,s as $s}from"./activity-CiEWAlFW.js";import{c as Qs,C as Us}from"./Coverage-P-BXHg4t.js";import{w as Bs}from"./labels-D8xxfRTQ.js";import{r as Gs}from"./nav-B4reXXdB.js";import{d as Ks,b as Js,c as Zs,e as Ys,u as zs,R as Xs}from"./useQuickRule-C0zoMd-O.js";import{r as en}from"./recorder-BHyqDNp5.js";import{a as sn,p as nn}from"./probe-D0sWIaS4.js";import{T as rn}from"./Tabs-BzeNgTje.js";import{T as ln}from"./Toolbar-B9K5nAyx.js";import{D as an}from"./Table-Cfbaho6J.js";import{D as tn}from"./DaeCode-DEjXqvav.js";import{C as on,a as dn,E as un}from"./ConditionRow-B2vbKntf.js";/* empty css */import{S as cn}from"./SearchSelect-CuaWhoLz.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./Select-BcN72K3H.js";import"./AddCircle-JwHCi_at.js";import"./Checkbox-f7Je53QZ.js";import"./Virtualizer-itu1Kg0o.js";import"./daeTokens-BVtuNnWZ.js";import"./SearchList-CJ8rQxgu.js";const pn=new WeakMap;let mn=Math.round(1e10*Math.random()),fn=0;const hn=e.createContext(null),bn=e.createContext(null),gn=e.createContext(null),vn=e.forwardRef(function(n,i){[n,i]=y(n,i,hn);let{validationBehavior:r}=k(w)||{},t=n.validationBehavior??r??"native",o=function(s){let n=e.useMemo(()=>s.name||`radio-group-${mn}-${++fn}`,[s.name]),[i,r]=v(s.value,s.defaultValue??null,s.onChange),[l]=e.useState(i),[a,t]=e.useState(null),o=x({...s,value:i}),d=o.displayValidation.isInvalid;return{...o,name:n,selectedValue:i,defaultSelectedValue:void 0!==s.value?l:s.defaultValue??null,setSelectedValue:e=>{s.isReadOnly||s.isDisabled||(r(e),o.commitValidation())},lastFocusedValue:a,setLastFocusedValue:t,isDisabled:s.isDisabled||!1,isReadOnly:s.isReadOnly||!1,isRequired:s.isRequired||!1,validationState:s.validationState||(d?"invalid":null),isInvalid:d}}({...n,validationBehavior:t}),[d,q]=j(!n["aria-label"]&&!n["aria-labelledby"]),{radioGroupProps:R,labelProps:H,descriptionProps:I,errorMessageProps:E,...L}=function(e,s){let{name:n,form:i,isReadOnly:r,isRequired:t,isDisabled:o,orientation:d="vertical",validationBehavior:v="aria"}=e,{direction:x}=u(),{isInvalid:y,validationErrors:k,validationDetails:w}=s.displayValidation,{labelProps:j,fieldProps:_,descriptionProps:N,errorMessageProps:S}=c({...e,labelElementType:"span",isInvalid:s.isInvalid,errorMessage:e.errorMessage||k}),C=a(e,{labelable:!0}),{focusWithinProps:M}=p({onBlurWithin(n){e.onBlur?.(n),s.selectedValue||s.setLastFocusedValue(null)},onFocusWithin:e.onFocus,onFocusWithinChange:e.onFocusChange});function D(e,n){let i,r=h(n.currentTarget,{from:g(n),accept:e=>e instanceof b(e).HTMLInputElement&&"radio"===e.type});return"next"===e?(i=r.nextNode(),i||(r.currentNode=n.currentTarget,i=r.firstChild())):(i=r.previousNode(),i||(r.currentNode=n.currentTarget,i=r.lastChild())),!!i&&(i.focus(),s.setSelectedValue(i.value),!0)}let{keyboardProps:P}=m({shortcuts:{ArrowRight:e=>D("rtl"===x&&"vertical"!==d?"prev":"next",e),ArrowLeft:e=>D("rtl"===x&&"vertical"!==d?"next":"prev",e),ArrowDown:e=>D("next",e),ArrowUp:e=>D("prev",e)},allowRepeats:!0}),q=f(n);return pn.set(s,{name:q,form:i,descriptionId:N.id,errorMessageId:S.id,validationBehavior:v}),{radioGroupProps:l(C,{role:"radiogroup",...P,"aria-invalid":s.isInvalid||void 0,"aria-errormessage":e["aria-errormessage"],"aria-readonly":r||void 0,"aria-required":t||void 0,"aria-disabled":o||void 0,"aria-orientation":d,..._,...M}),labelProps:j,descriptionProps:N,errorMessageProps:S,isInvalid:y,validationErrors:k,validationDetails:w}}({...n,label:q,validationBehavior:t},o),O=_({...n,values:{orientation:n.orientation||"vertical",isDisabled:o.isDisabled,isReadOnly:o.isReadOnly,isReqLine truncated
@@ -0,0 +1,2 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Trace-DVb3fAQd.js","./vendor-react-64fcanlc.js","./_commonjsHelpers-CXUWDbkB.js","./index-ucpAK88B.js","./index-o3F3WGy0.css","./flows-D8MpHTkU.js","./logs-DjZPFUMm.js","./Select-2JXPV40Q.js","./ItemText-CtNOgl4O.js","./AppearanceControls-DmbIJj4H.js","./nodes-DqXrz-fh.js","./probe-BrDCvIoc.js","./useQuickRule-BWE0DtUt.js","./DaeCode-DEjXqvav.js","./daeTokens-BVtuNnWZ.js","./AddCircle-Dk2gnxD-.js","./SearchSelect-CQDeD6gi.js","./SearchList-BxTMvuPr.js","./Virtualizer-mx6Yxab_.js","./Toolbar-D1_-nNpE.js","./rule-Ce4KC3th.js","./activity-CbXYXdVY.js","./activity-7AE-iAuR.css","./NumberField-Blv4W9AC.js","./Table-mJjr_XDH.js","./Checkbox-eZH7dxup.js","./Tabs-DrhG95XR.js","./ConditionRow-C-4K5nkB.js","./Coverage-C9FbmITi.js","./labels-D8xxfRTQ.js","./nav-a45zXQGu.js","./recorder-BHyqDNp5.js","./geodataUpdate-DkW-2XPA.js","./LinkOut-L4IZJIRt.js","./impact-B8feJDtJ.css"])))=>i.map(i=>d[i]);
import{cA as e,cB as n,cC as s,cD as i,cE as l,cF as a,cG as r,bp as t,cH as o,cI as d,cJ as u,cK as c,cL as p,cM as m,cN as f,cO as b,cP as h,cQ as g,cR as v,cS as x,cT as y,cU as k,cV as w,cW as j,cX as S,cY as _,cZ as C,c_ as N,c$ as D,d0 as M,d1 as P,d2 as R,d3 as I,aD as H,d4 as q,d5 as O,b7 as E,c2 as L,c4 as A,al as F,Y as T,U as V,H as W,a8 as B,ak as $,a6 as U,o as Q,h as G,r as J,d6 as K,a1 as X,w as Y,u as Z,aK as z,cw as ee,A as ne,l as se,q as ie,bT as le,aP as ae,aQ as re,m as te,x as oe,aO as de,aM as ue,ab as ce,C as pe,bk as me,bF as fe,ch as be,B as he,aL as ge,cr as ve,cq as xe,av as ye,p as ke,d7 as we,bG as je,d8 as Se,E as _e,cy as Ce,ax as Ne,b8 as De,aE as Me,cg as Pe,T as Re,c3 as Ie,c6 as He,L as qe,aG as Oe,d9 as Ee,_ as Le}from"./index-ucpAK88B.js";import{r as Ae,$ as Fe,j as Te}from"./vendor-react-64fcanlc.js";import{_ as Ve,$ as We,a0 as Be,a1 as $e,a2 as Ue,a3 as Qe,a4 as Ge,a5 as Je,a6 as Ke,a7 as Xe,a8 as Ye,a9 as Ze,aa as ze,ab as en,ac as nn,s as sn}from"./activity-CbXYXdVY.js";import{T as ln}from"./Tabs-DrhG95XR.js";import{D as an}from"./DaeCode-DEjXqvav.js";import{L as rn}from"./AppearanceControls-DmbIJj4H.js";import{a as tn,c as on,u as dn,y as un,e as cn,w as pn,h as mn,D as fn,L as bn,S as hn}from"./logs-DjZPFUMm.js";import{T as gn}from"./Toolbar-D1_-nNpE.js";import{D as vn}from"./Table-mJjr_XDH.js";import{C as xn,a as yn,E as kn}from"./ConditionRow-C-4K5nkB.js";import{c as wn,C as jn}from"./Coverage-C9FbmITi.js";import{d as Sn,b as _n,c as Cn,e as Nn,B as Dn}from"./rule-Ce4KC3th.js";import{u as Mn,a as Pn,c as Rn}from"./flows-D8MpHTkU.js";import{W as In,s as Hn,u as qn,b as On,X as En,Y as Ln,f as An,c as Fn,Z as Tn,j as Vn,e as Wn,_ as Bn,$ as $n,a0 as Un,a1 as Qn,a2 as Gn,a3 as Jn,r as Kn,a4 as Xn,a5 as Yn,a6 as Zn,a7 as zn,d as es,D as ns,a8 as ss}from"./nodes-DqXrz-fh.js";import{w as is}from"./labels-D8xxfRTQ.js";import{r as ls}from"./nav-a45zXQGu.js";import{r as as}from"./recorder-BHyqDNp5.js";import{g as rs,a as ts,b as os}from"./geodataUpdate-DkW-2XPA.js";/* empty css */import{L as ds}from"./LinkOut-L4IZJIRt.js";import{S as us}from"./SearchSelect-CQDeD6gi.js";const cs=new WeakMap;let ps=Math.round(1e10*Math.random()),ms=0;const fs=Ae.createContext(null),bs=Ae.createContext(null),hs=Ae.createContext(null),gs=Ae.forwardRef(function(e,n){[e,n]=g(e,n,fs);let{validationBehavior:l}=v(x)||{},a=e.validationBehavior??l??"native",r=function(e){let n=Ae.useMemo(()=>e.name||`radio-group-${ps}-${++ms}`,[e.name]),[s,i]=b(e.value,e.defaultValue??null,e.onChange),[l]=Ae.useState(s),[a,r]=Ae.useState(null),t=h({...e,value:s}),o=t.displayValidation.isInvalid;return{...t,name:n,selectedValue:s,defaultSelectedValue:void 0!==e.value?l:e.defaultValue??null,setSelectedValue:n=>{e.isReadOnly||e.isDisabled||(i(n),t.commitValidation())},lastFocusedValue:a,setLastFocusedValue:r,isDisabled:e.isDisabled||!1,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1,validationState:e.validationState||(o?"invalid":null),isInvalid:o}}({...e,validationBehavior:a}),[D,M]=y(!e["aria-label"]&&!e["aria-labelledby"]),{radioGroupProps:P,labelProps:R,descriptionProps:I,errorMessageProps:H,...q}=function(e,n){let{name:l,form:a,isReadOnly:r,isRequired:b,isDisabled:h,orientation:g="vertical",validationBehavior:v="aria"}=e,{direction:x}=t(),{isInvalid:y,validationErrors:k,validationDetails:w}=n.displayValidation,{labelProps:j,fieldProps:S,descriptionProps:_,errorMessageProps:C}=o({...e,labelElementType:"span",isInvalid:n.isInvalid,errorMessage:e.errorMessage||k}),N=i(e,{labelable:!0}),{focusWithinProps:D}=d({onBlurWithin(s){e.onBlur?.(s),n.selectedValue||n.setLastFocusedValue(null)},onFocusWithin:e.onFocus,onFocusWithinChange:e.onFocusChange});function M(e,s){let i,l=p(s.currentTarget,{from:f(s),accept:e=>e instanceof m(e).HTMLInputElement&&"radio"===e.type});return"next"===e?(i=l.nextNode(),i||(l.currentNode=s.currentTarget,i=l.firstChild())):(i=l.previousNode(),i||(l.currentNode=s.currentTarget,i=l.lastChild())),!!i&&(i.focus(),n.setSelectedValue(i.value),!0)}let{keyboardProps:P}=u({shortcuts:{ArrowRight:e=>M("rtl"===x&&"vertical"!==g?"prev":"next",e),ArrowLeft:e=>M("rtl"===x&&"vertical"!==g?"next":"prev",e),ArrowDown:e=>M("next",e),ArrowUp:e=>M("prev",e)},allowRepeats:!0}),R=c(l);return cs.set(n,{name:R,form:a,descriptionId:_.id,errorMessageId:C.id,validationBehavior:v}),{radioGroupProps:s(N,{role:"radiogroup",...P,"aria-invalid":n.isInvalid||void 0,"aria-errormessage":e["aria-errormessage"],"aria-readonly":r||void 0,"aria-required":b||void 0,"aria-disabled":h||void 0,"aria-orientation":g,...S,...D}),labelProps:j,descriptionProps:_,errorMessageProps:C,isInvalid:y,validationErrors:k,validationDetails:w}}({...e,label:M,validationBehavior:a},r),O=k({...e,values:{orientation:e.orientation||"vertical",isDisabled:r.isDisabled,isReadOnly:r.isReadOnly,isRequired:r.isRequired,isInvalid:r.isInvalid,state:r},defaultClassName:"react-aria-RadioGroup"}),E=i(e,{global:!0});return Fe.createElement(w.div,Line truncated
@@ -0,0 +1 @@
import{r as e,j as t}from"./vendor-react-64fcanlc.js";import{r as s,f1 as a,w as i,f2 as r,K as n,bY as o,ak as l,U as d,Y as u,al as p,f3 as c,f4 as m,f5 as f,dH as h,u as g,l as y,q as b,x as j,f6 as v,b5 as K,eY as x,bG as w,B as M,aE as $,E as k,bE as q,af as L,dj as S}from"./index-ucpAK88B.js";import{$ as _,d as C,a as N}from"./Select-2JXPV40Q.js";import{b as E}from"./ItemText-CtNOgl4O.js";import{i as I,h as Y,c as R,g as T,u as G,e as O}from"./logs-DjZPFUMm.js";import{u as A,c as H}from"./flows-D8MpHTkU.js";import{Y as P}from"./nodes-DqXrz-fh.js";import{c as Q,o as U,p as V,q as W}from"./nav-BFM0h9zL.js";import{d as z}from"./nav-a55OqNm6.js";import{r as B,a as F}from"./nav-a45zXQGu.js";import{f as D}from"./nav-CeXAWPew.js";import{f as J,r as X,g as Z,h as ee}from"./nav-Fc_XrTSE.js";import{aT as te,a1 as se,aU as ae}from"./activity-CbXYXdVY.js";import{c as ie}from"./nav-BO8viH9G.js";import{n as re,a as ne}from"./nav-CY1W7vuj.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./AppearanceControls-DmbIJj4H.js";const oe=e=>s(e,"groups",{whileLoading:!1})&&!0===e?.config.writable?[{id:"policies:new",titleKey:"group.newGroup",parentKey:"nav.policies",route:"policies",params:{new:"1"},aliases:["group editor"]}]:[],le=e=>e.trim().toLowerCase().replace(/\s+/g," "),de=(e,t,s,a,i,r="",n)=>({hit:{id:t,label:s,description:a,route:i,query:r,...n&&{open:n}},keys:[...new Set(e.flatMap(e=>null==e?[]:[le(e)]))]}),ue=(e,t,s,a,i)=>{const{route:r,query:n}=h(i);return de(e,t,s,a,r,n)};function pe(e,t,s){const a=[{title:e(t),parent:s&&e(s)}];for(const i of c)m(i.id)&&a.push({title:f(i.id,t),parent:s&&f(i.id,s)});return a.flatMap(({title:e,parent:t})=>t?[e,t+" "+e]:[e])}function ce(e,t){let s=3;for(const a of e){if(a===t)return 0;a.startsWith(t)?s=1:3===s&&a.includes(t)&&(s=2)}return s}function me(t,m){const f=g(),h=y(),[K,x]=e.useState(""),w=b(),M=w.data?.resources,$=I(void 0,s(M,"connections",{whileLoading:!1})),k=Y(s(M,"nodes",{whileLoading:!1})),q=R(s(M,"groups",{whileLoading:!1})),L=T(s(M,"providers",{whileLoading:!1})),S=G(s(M,"config",{whileLoading:!1})),_=A(s(M,"rules",{whileLoading:!1})),C=H(s(M,"dns_rules",{whileLoading:!1})),N=[w,$,k,q,L,S,_,C],E=O(j().data),me=!!E.globalSettings,[fe,he]=e.useState(0);e.useEffect(()=>{let e=!0;for(const t of c)v(t.id).then(()=>e&&he(e=>e+1),()=>{});return()=>{e=!1}},[]);const ge=e.useMemo(()=>function(e,t,s){const n=t=>r(t,e),o=e?.resources,l=[...ie().map(e=>({path:"connections",params:{tab:e.id},titleKey:e.titleKey})),...re(o).map(e=>({path:"nodes",params:{tab:e.id},titleKey:e.titleKey})),...D(o).map(e=>({path:"flows",params:{tab:e.id},titleKey:e.titleKey})),...B(o).map(e=>({path:"rules",params:{tab:e.id},titleKey:e.titleKey})),...z(o).map(e=>({path:"dns",params:{tab:e.id},titleKey:e.titleKey})),...Q(s,e).map(e=>({path:"config",params:{tab:e.id},titleKey:e.titleKey,aliases:e.aliases})),...J(o).map(e=>({path:"settings",params:{card:e.id},titleKey:e.titleKey,aliases:e.aliases}))],d=e=>a.find(t=>t.path===e).nav.titleKey;return[...a.filter(e=>e.nav&&n(e.path)).map(e=>de(pe(t,e.nav.titleKey),`page:${e.path}?`,t(e.nav.titleKey),void 0,e.path)),...l.filter(e=>n(e.path)).map(e=>{const s=i("",e.params);return de([...pe(t,e.titleKey,d(e.path)),...e.aliases??[]],`page:${e.path}?${s}`,t(e.titleKey),t(d(e.path)),e.path,s)})]}(w.data,f,me),[w.data,f,me,fe]),ye=e.useMemo(()=>function(e,t){const s=e?.resources,a=new Map(J(s).map(e=>[e.id,e])),r=new Set(s?.runtime_settings.available?s.runtime_settings.fields??[]:[]),n=Object.entries(X).filter(([e])=>r.has(e)).map(([e,t])=>({id:e,labelKey:t,card:"runtime",aliases:void 0})),o=Z(s);return[...ee.filter(e=>!e.sources||o),...n].flatMap(e=>{const s=a.get(e.card);return s?[de([...pe(t,e.labelKey),...e.aliases??[]],`setting:${e.id}`,t(e.labelKey),t(s.titleKey),"settings",i("",{card:e.card,field:e.id}))]:[]})}(w.data,f),[w.data,f,fe]),be=e.useMemo(()=>function(e,t,a){return e&&s(t?.resources,"config",{whileLoading:!1})?e.fields.map(e=>de([...pe(a,e.label),e.key],`global:${e.key}`,a(e.label),a(U[e.group]),"config",i("",{tab:"global",field:e.key}))):[]}(E.globalSettings,w.data,f),[E.globalSettings,w.data,f,fe]),je=e.useMemo(()=>function(e,t){const s=e?.resources;return[...F(s),...oe(s),...ne(s),...V(e),...te].filter(t=>null===t.route||r(t.route,e)).map(e=>de([...pe(t,e.titleKey,e.parentKey),...(e.aliasKeys??[]).flatMap(e=>pe(t,e)),...e.aliases??[]],`feature:${e.id}`,t(e.titleKey),e.parentKey&&t(e.parentKey),e.route,i("",e.params??{}),e.open))}(w.data,f),[w.data,f,fe]),ve=e.useMemo(()=>function(e,t,s){return W(e,t,s).map(e=>ue([e.kind,e.summary],`module:${e.id}`,e.kind,e.range,e.href))}(S.data,E,f),[S.data,E,f]),Ke=e.useMemo(()=>function(e,t){return n(e).map(e=>de([e.domain,e.dst,e.src],`connection:${e.id}`,e.domain||e.dst||e.src||e.id,o(e,t),"connections",i("",{id:e.id})))}($.data,f),[$.data,f]),xe=e.useMemo(()=>function(e,t,s){const a=t?.providers??[];return(e??[]).map(e=>ue([e.name],`node:${e.id}`,e.name,l(s,e.group_ids)||void 0,se(e,a,!0)))}(k.data,L.dataLine truncated
@@ -1 +0,0 @@
import{r as e,j as t}from"./vendor-react-64fcanlc.js";import{X as s,gM as a,w as i,gN as r,gO as n,aa as o,cw as l,aE as d,ae as u,gP as c,ai as p,aF as m,dX as f,gQ as g,gR as h,gS as y,fh as b,C as v,P as j,W as K,Y as x,a1 as w,gT as M,d6 as $,gf as k,c5 as S,J as q,aZ as C,K as L,A as _,az as N,fy as R,d3 as I}from"./index-CmbH0woS.js";import{$ as O,e as P,a as A}from"./Select-BcN72K3H.js";import{d as E,c as G,u as Q,b as T,e as W}from"./ActionGroup-D3mQjUsw.js";import{u as z,c as F}from"./flows-BMReQznn.js";import{c as V,n as X,o as Y,p as H}from"./nav-M7R_HvZ0.js";import{d as J}from"./nav-C4ZPdNvM.js";import{r as Z,a as B}from"./nav-B4reXXdB.js";import{f as D}from"./nav-Y_78QUku.js";import{b as U,r as ee,g as te,d as se}from"./nav--g10gPaM.js";import{c as ae}from"./nav-BO8viH9G.js";import{n as ie,a as re}from"./nav-ClMHrgx_.js";import{a2 as ne}from"./activity-CiEWAlFW.js";import"./_commonjsHelpers-CXUWDbkB.js";const oe=e=>s(e,"groups",{whileLoading:!1})&&!0===e?.config.writable?[{id:"policies:new",titleKey:"group.newGroup",parentKey:"nav.policies",route:"policies",params:{new:"1"},aliases:["group editor"]}]:[],le=e=>e.trim().toLowerCase().replace(/\s+/g," "),de=(e,t,s,a,i,r="",n)=>({hit:{id:t,label:s,description:a,route:i,query:r,...n&&{open:n}},keys:[...new Set(e.flatMap(e=>null==e?[]:[le(e)]))]}),ue=(e,t,s,a,i)=>{const{route:r,query:n}=b(i);return de(e,t,s,a,r,n)};function ce(e,t,s){const a=[{title:e(t),parent:s&&e(s)}];for(const i of g)h(i.id)&&a.push({title:y(i.id,t),parent:s&&y(i.id,s)});return a.flatMap(({title:e,parent:t})=>t?[e,t+" "+e]:[e])}function pe(e,t){let s=3;for(const a of e){if(a===t)return 0;a.startsWith(t)?s=1:3===s&&a.includes(t)&&(s=2)}return s}function me(t,h){const y=v(),b=j(),[$,k]=e.useState(""),S=K(),q=S.data?.resources,C=E(void 0,s(q,"connections",{whileLoading:!1})),L=G(s(q,"nodes",{whileLoading:!1})),_=Q(s(q,"groups",{whileLoading:!1})),N=T(s(q,"providers",{whileLoading:!1})),R=x(s(q,"config",{whileLoading:!1})),I=z(s(q,"rules",{whileLoading:!1})),O=F(s(q,"dns_rules",{whileLoading:!1})),P=[S,C,L,_,N,R,I,O],A=W(w().data),me=!!A.globalSettings,[fe,ge]=e.useState(0);e.useEffect(()=>{let e=!0;for(const t of g)M(t.id).then(()=>e&&ge(e=>e+1),()=>{});return()=>{e=!1}},[]);const he=e.useMemo(()=>function(e,t,s){const r=t=>n(t,e),o=e?.resources,l=[...ae().map(e=>({path:"connections",params:{tab:e.id},titleKey:e.titleKey})),...ie(o).map(e=>({path:"nodes",params:{tab:e.id},titleKey:e.titleKey})),...D(o).map(e=>({path:"flows",params:{tab:e.id},titleKey:e.titleKey})),...Z(o).map(e=>({path:"rules",params:{tab:e.id},titleKey:e.titleKey})),...J(o).map(e=>({path:"dns",params:{tab:e.id},titleKey:e.titleKey})),...V(s,e).map(e=>({path:"config",params:{tab:e.id},titleKey:e.titleKey,aliases:e.aliases})),...U(o).map(e=>({path:"settings",params:{card:e.id},titleKey:e.titleKey,aliases:e.aliases}))],d=e=>a.find(t=>t.path===e).nav.titleKey;return[...a.filter(e=>e.nav&&r(e.path)).map(e=>de(ce(t,e.nav.titleKey),`page:${e.path}?`,t(e.nav.titleKey),void 0,e.path)),...l.filter(e=>r(e.path)).map(e=>{const s=i("",e.params);return de([...ce(t,e.titleKey,d(e.path)),...e.aliases??[]],`page:${e.path}?${s}`,t(e.titleKey),t(d(e.path)),e.path,s)})]}(S.data,y,me),[S.data,y,me,fe]),ye=e.useMemo(()=>function(e,t){const s=e?.resources,a=new Map(U(s).map(e=>[e.id,e])),r=new Set(s?.runtime_settings.available?s.runtime_settings.fields??[]:[]),n=Object.entries(ee).filter(([e])=>r.has(e)).map(([e,t])=>({id:e,labelKey:t,card:"runtime",aliases:void 0})),o=te(s);return[...se.filter(e=>!e.sources||o),...n].flatMap(e=>{const s=a.get(e.card);return s?[de([...ce(t,e.labelKey),...e.aliases??[]],`setting:${e.id}`,t(e.labelKey),t(s.titleKey),"settings",i("",{card:e.card,field:e.id}))]:[]})}(S.data,y),[S.data,y,fe]),be=e.useMemo(()=>function(e,t,a){return e&&s(t?.resources,"config",{whileLoading:!1})?e.fields.map(e=>de([...ce(a,e.label),e.key],`global:${e.key}`,a(e.label),a(X[e.group]),"config",i("",{tab:"global",field:e.key}))):[]}(A.globalSettings,S.data,y),[A.globalSettings,S.data,y,fe]),ve=e.useMemo(()=>function(e,t){const s=e?.resources;return[...B(s),...oe(s),...re(s),...Y(e),...r].filter(t=>null===t.route||n(t.route,e)).map(e=>de([...ce(t,e.titleKey,e.parentKey),...(e.aliasKeys??[]).flatMap(e=>ce(t,e)),...e.aliases??[]],`feature:${e.id}`,t(e.titleKey),e.parentKey&&t(e.parentKey),e.route,i("",e.params??{}),e.open))}(S.data,y),[S.data,y,fe]),je=e.useMemo(()=>function(e,t,s){return H(e,t,s).map(e=>ue([e.kind,e.summary],`module:${e.id}`,e.kind,e.range,e.href))}(R.data,A,y),[R.data,A,y]),Ke=e.useMemo(()=>function(e,t){return o(e).map(e=>de([e.domain,e.dst,e.src],`connection:${e.id}`,e.domain||e.dst||e.src||e.id,l(e,t),"connections",i("",{id:e.id})))}(C.data,y),[C.data,y]),xe=e.useMemo(()=>function(e,t,s){const a=t?.providers??[];return(e??[]).map(e=>ue([e.name],`node:${e.id}`,e.name,d(s,e.group_ids)||void 0,ne(e,a,!0)))}(L.data,N.data,b),[L.data,N.data,b]),we=e.useMemo(()=>function(e){return(e??[]).map(e=>de([e.name],`group:${e.iLine truncated
@@ -1 +1 @@
import{r as e,j as a}from"./vendor-react-64fcanlc.js";import{fE as t,ge as r,gf as s,c5 as l}from"./index-CmbH0woS.js";import{d as n,e as i}from"./Virtualizer-itu1Kg0o.js";function o(a){let r=t({usage:"search",...a}),s=e.useCallback((e,a)=>0===a.length||(e=e.normalize("NFC"),a=a.normalize("NFC"),0===r.compare(e.slice(0,a.length),a)),[r]),l=e.useCallback((e,a)=>0===a.length||(e=e.normalize("NFC"),a=a.normalize("NFC"),0===r.compare(e.slice(-a.length),a)),[r]),n=e.useCallback((e,a)=>{if(0===a.length)return!0;e=e.normalize("NFC");let t=0,s=(a=a.normalize("NFC")).length;for(;t+s<=e.length;t++){let l=e.slice(t,t+s);if(0===r.compare(a,l))return!0}return!1},[r]);return e.useMemo(()=>({startsWith:s,endsWith:l,contains:n}),[s,l,n])}function c({label:e,children:t}){const{contains:c}=o({sensitivity:"base"});return a.jsx(r,{value:null,children:a.jsxs(s,{filter:c,children:[a.jsx(l,{search:!0,label:e,autoFocus:!0,className:"rp-menu-search"}),a.jsx(n,{layout:i,layoutOptions:{estimatedRowHeight:32,estimatedHeadingHeight:26},children:t})]})})}const u=Object.freeze(Object.defineProperty({__proto__:null,SearchList:c},Symbol.toStringTag,{value:"Module"}));export{o as $,c as S,u as a}; import{r as e,j as a}from"./vendor-react-64fcanlc.js";import{ek as t,eX as r,eY as s,bG as l}from"./index-ucpAK88B.js";import{d as n,e as i}from"./Virtualizer-mx6Yxab_.js";function o(a){let r=t({usage:"search",...a}),s=e.useCallback((e,a)=>0===a.length||(e=e.normalize("NFC"),a=a.normalize("NFC"),0===r.compare(e.slice(0,a.length),a)),[r]),l=e.useCallback((e,a)=>0===a.length||(e=e.normalize("NFC"),a=a.normalize("NFC"),0===r.compare(e.slice(-a.length),a)),[r]),n=e.useCallback((e,a)=>{if(0===a.length)return!0;e=e.normalize("NFC");let t=0,s=(a=a.normalize("NFC")).length;for(;t+s<=e.length;t++){let l=e.slice(t,t+s);if(0===r.compare(a,l))return!0}return!1},[r]);return e.useMemo(()=>({startsWith:s,endsWith:l,contains:n}),[s,l,n])}function c({label:e,children:t}){const{contains:c}=o({sensitivity:"base"});return a.jsx(r,{value:null,children:a.jsxs(s,{filter:c,children:[a.jsx(l,{search:!0,label:e,autoFocus:!0,className:"rp-menu-search"}),a.jsx(n,{layout:i,layoutOptions:{estimatedRowHeight:32,estimatedHeadingHeight:26},children:t})]})})}const u=Object.freeze(Object.defineProperty({__proto__:null,SearchList:c},Symbol.toStringTag,{value:"Module"}));export{o as $,c as S,u as a};
@@ -0,0 +1 @@
import{r as s,j as e}from"./vendor-react-64fcanlc.js";import{cl as a,d4 as l,cn as r,bw as i,d5 as c,co as t,dj as d,b7 as n}from"./index-ucpAK88B.js";import{b as o,c as p,$ as m,d as j,a as x}from"./Select-2JXPV40Q.js";import{I as h,a as b,b as f}from"./ItemText-CtNOgl4O.js";import{S as u}from"./SearchList-BxTMvuPr.js";const N=s=>e.jsxs(x,{id:s.id,className:"rp-item",textValue:s.keywords?`${s.label} ${s.keywords}`:s.label,children:[e.jsx(b,{}),e.jsx(f,{i:s,children:s.desc&&e.jsx(c,{slot:"description",className:n("desc",s.tone),children:s.desc})})]},s.id);function v({label:x,searchLabel:b,sections:f,value:v,onChange:S,isDisabled:g,description:y,side:k,size:w}){const R=s.useRef(null),$=s.useRef(null),z=a(w),C=f.flatMap(s=>s.items).find(s=>s.id===v);return e.jsxs(o,{className:n("rp-picker",k?"rp-cluster":"rp-field"),selectedKey:v,onSelectionChange:s=>{null!=s&&S(String(s))},isDisabled:g,children:[e.jsxs("div",{ref:R,className:k?"rp-cluster":"rp-field",children:[e.jsx(l,{className:k?"rp-label":"lbl",children:x}),e.jsxs(r,{ref:$,className:"rp-selectbtn","data-size":z,children:[e.jsx(p,{children:()=>C?e.jsx(h,{i:C}):v}),e.jsx(i,{})]})]}),y&&e.jsx(c,{slot:"description",className:"rp-label",children:y}),e.jsx(t,{className:"rp-popover rp-search-popover",placement:"bottom start",triggerRef:k?$:R,children:e.jsx(u,{label:b,children:e.jsx(m,{className:"rp-menu-scroll rp-overlay-scroll",children:f.map(s=>s.title?e.jsxs(j,{id:s.id,children:[e.jsx(d,{className:"rp-sec-h",children:s.title}),s.items.map(N)]},s.id):s.items.map(N))})})})]})}export{v as S};
@@ -1 +0,0 @@
import{r as s,j as e}from"./vendor-react-64fcanlc.js";import{cZ as a,dQ as l,c$ as r,aP as i,bO as c,dR as d,d0 as t,fy as n,bZ as o,d2 as p,d3 as m}from"./index-CmbH0woS.js";import{c as j,d as h,$ as x,e as f,a as b}from"./Select-BcN72K3H.js";import{S as u}from"./SearchList-CJ8rQxgu.js";const N=s=>e.jsxs(b,{id:s.id,className:"rp-item",textValue:s.keywords?`${s.label} ${s.keywords}`:s.label,children:[e.jsx(p,{}),e.jsx(m,{i:s,children:s.desc&&e.jsx(d,{slot:"description",className:o("desc",s.tone),children:s.desc})})]},s.id);function v({label:p,searchLabel:m,sections:b,value:v,onChange:S,isDisabled:g,description:y,side:R,size:$}){const k=s.useRef(null),C=s.useRef(null),w=a($),z=b.flatMap(s=>s.items).find(s=>s.id===v);return e.jsxs(j,{className:o("rp-picker",R?"rp-cluster":"rp-field"),selectedKey:v,onSelectionChange:s=>{null!=s&&S(String(s))},isDisabled:g,children:[e.jsxs("div",{ref:k,className:R?"rp-cluster":"rp-field",children:[e.jsx(l,{className:R?"rp-label":"lbl",children:p}),e.jsxs(r,{ref:C,className:"rp-selectbtn","data-size":w,children:[e.jsx(h,{children:()=>z?e.jsx(i,{i:z}):v}),e.jsx(c,{})]})]}),y&&e.jsx(d,{slot:"description",className:"rp-label",children:y}),e.jsx(t,{className:"rp-popover rp-search-popover",placement:"bottom start",triggerRef:R?C:k,children:e.jsx(u,{label:m,children:e.jsx(x,{className:"rp-menu-scroll rp-overlay-scroll",children:b.map(s=>s.title?e.jsxs(f,{id:s.id,children:[e.jsx(n,{className:"rp-sec-h",children:s.title}),s.items.map(N)]},s.id):s.items.map(N))})})})]})}export{v as S};
@@ -1 +1 @@
import{bs as e,dm as t,gF as l,ds as o,du as a,hj as s,dl as i,gG as r,hk as n,eT as d,fV as c,dP as u,fO as p,eU as g,fE as f,g0 as y,hl as v,dt as m,hm as h,dr as b,fF as D,gt as P,fU as M,dn as S,dp as K,dx as E,fG as k,fX as C,fZ as F,fY as B,dA as x,e_ as I,eX as w,g3 as R,hn as A,eY as V,gH as T,dL as O,ho as U,dE as z,dF as H,dG as L,dI as N,eZ as q,g6 as W,f$ as _,f1 as j,dO as $,g2 as G,hp as Z,hq as J,dK as X,dD as Y,hr as Q,gb as ee,gc as te,f5 as le,hs as oe,dy as ae,dz as se,e$ as ie,dB as re,fH as ne,dC as de,dN as ce,dH as ue,g5 as pe,ht as ge,hu as fe,dJ as ye}from"./index-CmbH0woS.js";import{r as ve,$ as me}from"./vendor-react-64fcanlc.js";const he=new WeakMap;function be(e,l,o){let{key:a}=e,s=he.get(l),f=e.isDisabled??l.selectionManager.isDisabled(a),y=e.isSelected??l.selectionManager.isSelected(a),v=e.shouldSelectOnPressUp??s?.shouldSelectOnPressUp,m=e.shouldFocusOnHover??s?.shouldFocusOnHover,h=e.shouldUseVirtualFocus??s?.shouldUseVirtualFocus,b=e.isVirtualized??s?.isVirtualized,D=r(),P=r(),M={role:"option","aria-disabled":f||void 0,"aria-selected":"none"!==l.selectionManager.selectionMode?y:void 0,"aria-label":e["aria-label"],"aria-labelledby":D,"aria-describedby":P},S=l.collection.getItem(a);if(b){let e=Number(S?.index);M["aria-posinset"]=Number.isNaN(e)?void 0:e+1,M["aria-setsize"]=n(l.collection)}let K=s?.onAction?()=>s?.onAction?.(a):void 0,E=function(e,t){let l=he.get(e);if(!l)throw new Error("Unknown list");return`${l.id}-option-${o=t,"string"==typeof o?o.replace(/\s*/g,""):""+o}`;var o}(l,a),{itemProps:k,isPressed:C,isFocused:F,hasAction:B,allowsSelection:x}=d({selectionManager:l.selectionManager,key:a,ref:o,shouldSelectOnPressUp:v,allowsDifferentPressOrigin:v&&m,isVirtualized:b,shouldUseVirtualFocus:h,isDisabled:f,onAction:K||S?.props?.onAction?c(S?.props?.onAction,K):void 0,linkBehavior:s?.linkBehavior,UNSTABLE_itemBehavior:s?.UNSTABLE_itemBehavior,id:E}),{hoverProps:I}=u({isDisabled:f||!m,onHoverStart(){p()||(l.selectionManager.setFocused(!0),l.selectionManager.setFocusedKey(a))}}),w=t(S?.props);delete w.id;let R=g(S?.props);return{optionProps:{...M,...i(w,k,I,R),id:E},labelProps:{id:D},descriptionProps:{id:P},isFocused:F,isFocusVisible:F&&l.selectionManager.isFocused&&p(),isSelected:y,isDisabled:f,isPressed:C,allowsSelection:x,hasAction:B}}const De=new WeakMap;function Pe(e){let{state:t,triggerRef:l,label:o,name:a,form:s,isDisabled:i}=e,r=ve.useRef(null),n=ve.useRef(null),{containerProps:d,selectProps:c}=function(e,t,l){let o=De.get(t)||{},{autoComplete:a,name:s=o.name,form:i=o.form,isDisabled:r=o.isDisabled}=e,{validationBehavior:n,isRequired:d}=o,{visuallyHiddenProps:c}=M({style:{position:"fixed",top:0,left:0}});S(e.selectRef,t.defaultValue,t.setValue),K({validationBehavior:n,focus:()=>l.current?.focus()},t,e.selectRef);let u=t.setValue,p=ve.useCallback(e=>{let t=E(e);t.multiple?u(Array.from(t.selectedOptions,e=>e.value)):u(e.currentTarget.value)},[u]);return{containerProps:{...c,"aria-hidden":!0,"data-react-aria-prevent-focus":!0,"data-a11y-ignore":"aria-hidden-focus"},inputProps:{style:{display:"none"}},selectProps:{tabIndex:-1,autoComplete:a,disabled:r,multiple:"multiple"===t.selectionManager.selectionMode,required:"native"===n&&d,name:s,form:i,value:t.value??"",onChange:p,onInput:p}}}({...e,selectRef:t.collection.size<=300?r:n},t,l),u=Array.isArray(t.value)?t.value:[t.value];if(t.collection.size<=300)return me.createElement("div",{...d,"data-testid":"hidden-select-container"},me.createElement("label",null,o,me.createElement("select",{...c,ref:r},me.createElement("option",{value:"",label:" "}," "),[...t.collection.getKeys()].map(e=>{let l=t.collection.getItem(e);if(l&&"item"===l.type)return me.createElement("option",{key:l.key,value:l.key},l.textValue)}),0===t.collection.size&&a&&u.map((e,t)=>me.createElement("option",{key:t,value:e??""})))));if(a){let e=De.get(t)||{},{validationBehavior:l}=e;0===u.length&&(u=[null]);let o=u.map((e,t)=>{let o={type:"hidden",autoComplete:c.autoComplete,name:a,form:s,disabled:i,value:e??""};return"native"===l?me.createElement("input",{key:t,...o,ref:0===t?n:null,style:{display:"none"},type:"text",required:0===t&&c.required,onChange:()=>{}}):me.createElement("input",{key:t,...o,ref:0===t?n:null})});return me.createElement(me.Fragment,null,o)}return null}var Me;Me={"ar-AE":k,"bg-BG":k,"cs-CZ":k,"da-DK":k,"de-DE":k,"el-GR":k,"en-US":{selectPlaceholder:"Select an item",tableResizer:"Resizer",dropzoneLabel:"DropZone",colorSwatchPicker:"Color swatches"},"es-ES":k,"et-EE":k,"fi-FI":k,"fr-FR":k,"he-IL":k,"hr-HR":k,"hu-HU":k,"it-IT":k,"ja-JP":k,"ko-KR":k,"lt-LT":k,"lv-LV":k,"nb-NO":k,"nl-NL":k,"pl-PL":k,"pt-BR":k,"pt-PT":k,"ro-RO":k,"ru-RU":k,"sk-SK":k,"sl-SI":k,"sr-SP":k,"sv-SE":k,"tr-TR":k,"uk-UA":k,"zh-CN":{colorSwatchPicker:"颜色色板",dropzoneLabel:"放置区域",selectPlaceholder:"选择一个项目",tableResizer:"尺寸调整器"},"zh-TW":{colorSwatchPicker:"色票",dropzoneLabel:"放置區",selectPlaceholder:"選取項目",tableResizeLine truncated import{bp as e,cD as t,fG as l,cI as o,cK as a,du as s,cC as i,fH as r,fI as n,dY as c,eB as d,d3 as u,eu as p,dZ as g,ek as f,eI as y,fJ as v,cJ as m,fK as b,cH as h,el as D,dx as P,eA as M,cE as S,cF as K,cN as E,em as k,eD as C,eF as F,eE as B,cQ as x,e3 as I,e0 as R,eL as w,fL as A,e1 as V,fM as T,c$ as O,fN as U,cU as H,cV as L,cW as z,cY as N,e2 as q,eO as W,eH as _,e6 as j,d2 as $,eK as Z,fO as G,fP as J,c_ as Q,cT as Y,fQ as X,eT as ee,eU as te,ea as le,fR as oe,cO as ae,cP as se,e4 as ie,cR as re,en as ne,cS as ce,d1 as de,cX as ue,eN as pe,fS as ge,fT as fe,cZ as ye}from"./index-ucpAK88B.js";import{r as ve,$ as me}from"./vendor-react-64fcanlc.js";const be=new WeakMap;function he(e,l,o){let{key:a}=e,s=be.get(l),f=e.isDisabled??l.selectionManager.isDisabled(a),y=e.isSelected??l.selectionManager.isSelected(a),v=e.shouldSelectOnPressUp??s?.shouldSelectOnPressUp,m=e.shouldFocusOnHover??s?.shouldFocusOnHover,b=e.shouldUseVirtualFocus??s?.shouldUseVirtualFocus,h=e.isVirtualized??s?.isVirtualized,D=r(),P=r(),M={role:"option","aria-disabled":f||void 0,"aria-selected":"none"!==l.selectionManager.selectionMode?y:void 0,"aria-label":e["aria-label"],"aria-labelledby":D,"aria-describedby":P},S=l.collection.getItem(a);if(h){let e=Number(S?.index);M["aria-posinset"]=Number.isNaN(e)?void 0:e+1,M["aria-setsize"]=n(l.collection)}let K=s?.onAction?()=>s?.onAction?.(a):void 0,E=function(e,t){let l=be.get(e);if(!l)throw new Error("Unknown list");return`${l.id}-option-${o=t,"string"==typeof o?o.replace(/\s*/g,""):""+o}`;var o}(l,a),{itemProps:k,isPressed:C,isFocused:F,hasAction:B,allowsSelection:x}=c({selectionManager:l.selectionManager,key:a,ref:o,shouldSelectOnPressUp:v,allowsDifferentPressOrigin:v&&m,isVirtualized:h,shouldUseVirtualFocus:b,isDisabled:f,onAction:K||S?.props?.onAction?d(S?.props?.onAction,K):void 0,linkBehavior:s?.linkBehavior,UNSTABLE_itemBehavior:s?.UNSTABLE_itemBehavior,id:E}),{hoverProps:I}=u({isDisabled:f||!m,onHoverStart(){p()||(l.selectionManager.setFocused(!0),l.selectionManager.setFocusedKey(a))}}),R=t(S?.props);delete R.id;let w=g(S?.props);return{optionProps:{...M,...i(R,k,I,w),id:E},labelProps:{id:D},descriptionProps:{id:P},isFocused:F,isFocusVisible:F&&l.selectionManager.isFocused&&p(),isSelected:y,isDisabled:f,isPressed:C,allowsSelection:x,hasAction:B}}const De=new WeakMap;function Pe(e){let{state:t,triggerRef:l,label:o,name:a,form:s,isDisabled:i}=e,r=ve.useRef(null),n=ve.useRef(null),{containerProps:c,selectProps:d}=function(e,t,l){let o=De.get(t)||{},{autoComplete:a,name:s=o.name,form:i=o.form,isDisabled:r=o.isDisabled}=e,{validationBehavior:n,isRequired:c}=o,{visuallyHiddenProps:d}=M({style:{position:"fixed",top:0,left:0}});S(e.selectRef,t.defaultValue,t.setValue),K({validationBehavior:n,focus:()=>l.current?.focus()},t,e.selectRef);let u=t.setValue,p=ve.useCallback(e=>{let t=E(e);t.multiple?u(Array.from(t.selectedOptions,e=>e.value)):u(e.currentTarget.value)},[u]);return{containerProps:{...d,"aria-hidden":!0,"data-react-aria-prevent-focus":!0,"data-a11y-ignore":"aria-hidden-focus"},inputProps:{style:{display:"none"}},selectProps:{tabIndex:-1,autoComplete:a,disabled:r,multiple:"multiple"===t.selectionManager.selectionMode,required:"native"===n&&c,name:s,form:i,value:t.value??"",onChange:p,onInput:p}}}({...e,selectRef:t.collection.size<=300?r:n},t,l),u=Array.isArray(t.value)?t.value:[t.value];if(t.collection.size<=300)return me.createElement("div",{...c,"data-testid":"hidden-select-container"},me.createElement("label",null,o,me.createElement("select",{...d,ref:r},me.createElement("option",{value:"",label:" "}," "),[...t.collection.getKeys()].map(e=>{let l=t.collection.getItem(e);if(l&&"item"===l.type)return me.createElement("option",{key:l.key,value:l.key},l.textValue)}),0===t.collection.size&&a&&u.map((e,t)=>me.createElement("option",{key:t,value:e??""})))));if(a){let e=De.get(t)||{},{validationBehavior:l}=e;0===u.length&&(u=[null]);let o=u.map((e,t)=>{let o={type:"hidden",autoComplete:d.autoComplete,name:a,form:s,disabled:i,value:e??""};return"native"===l?me.createElement("input",{key:t,...o,ref:0===t?n:null,style:{display:"none"},type:"text",required:0===t&&d.required,onChange:()=>{}}):me.createElement("input",{key:t,...o,ref:0===t?n:null})});return me.createElement(me.Fragment,null,o)}return null}var Me;Me={"ar-AE":k,"bg-BG":k,"cs-CZ":k,"da-DK":k,"de-DE":k,"el-GR":k,"en-US":{selectPlaceholder:"Select an item",tableResizer:"Resizer",dropzoneLabel:"DropZone",colorSwatchPicker:"Color swatches"},"es-ES":k,"et-EE":k,"fi-FI":k,"fr-FR":k,"he-IL":k,"hr-HR":k,"hu-HU":k,"it-IT":k,"ja-JP":k,"ko-KR":k,"lt-LT":k,"lv-LV":k,"nb-NO":k,"nl-NL":k,"pl-PL":k,"pt-BR":k,"pt-PT":k,"ro-RO":k,"ru-RU":k,"sk-SK":k,"sl-SI":k,"sr-SP":k,"sv-SE":k,"tr-TR":k,"uk-UA":k,"zh-CN":{colorSwatchPicker:"颜色色板",dropzoneLabel:"放置区域",selectPlaceholder:"选择一个项目",tableResizer:"尺寸调整器"},"zh-TW":{colorSwatchPicker:"色票",dropzoneLabel:"放置區",selectPlaceholder:"選取項目",tableResizeLine truncated
@@ -0,0 +1 @@
.rp-swatch{border:1px solid var(--rp-line);border-radius:var(--rp-r-md);flex:none;width:120px;height:72px;display:block;position:relative;overflow:hidden}.rp-swatch>span{clip-path:polygon(0 0,100% 0,0 100%);background:var(--sw-bg);position:absolute;inset:0}.rp-swatch>span[data-dark]{transform:rotate(180deg)}.rp-swatch>span:before,.rp-swatch>span:after,.rp-swatch i,.rp-swatch i:after{content:"";position:absolute}.rp-swatch>span:before{background:color-mix(in srgb, var(--sw-bg), var(--sw-text) 10%);inset:0 85% 0 0}.rp-swatch i{background:linear-gradient(var(--sw-text) 0 0) 14% 50% / 50% 18% no-repeat var(--sw-surface);border-radius:12%/20%;inset:11% 45% 58% 20%}.rp-swatch i:after{background:var(--sw-positive);border-radius:50%;inset:36% 10% 36% 76%}.rp-swatch>span:after{border-radius:var(--rp-r-pill);background:var(--sw-accent);inset:50% 63% 41% 20%}.rp-swatch[data-look]>span{--sw-wall:radial-gradient(circle at 20% 25%, #007aff99, transparent 60%), radial-gradient(circle at 85% 20%, #ff2d558c, transparent 55%), radial-gradient(circle at 70% 95%, #ff950099, transparent 60%), linear-gradient(160deg, #e3eaf8, #f8eee2);background:var(--sw-wall)}.rp-swatch[data-look]>span[data-dark]{--sw-wall:radial-gradient(circle at 20% 25%, #0a84ff80, transparent 60%), radial-gradient(circle at 85% 20%, #ff375f66, transparent 55%), radial-gradient(circle at 70% 95%, #ff9f0a66, transparent 60%), linear-gradient(160deg, #070a17, #05131a)}.rp-swatch[data-look]>span:before{background:var(--sw-surface)}.rp-swatch[data-look=lens] i,.rp-swatch[data-look=lens]>span:after{--sw-rim:#ffffffe6;box-shadow:inset 1px 1px 0 var(--sw-rim), inset -1px -1px 0 color-mix(in srgb, var(--sw-rim), transparent 45%)}.rp-select-boxes{gap:var(--rp-space-4);display:grid}.rp-select-grid{gap:var(--rp-space-4);grid-template-columns:repeat(auto-fill,170px);display:grid}.rp-select-grid>section{display:contents}.rp-select-box-head{margin-top:var(--rp-space-1);grid-column:1/-1;font-weight:700}.rp-select-box{align-items:center;gap:var(--rp-space-1);min-width:0;padding:var(--rp-space-6) var(--rp-space-3) var(--rp-space-3);border-radius:var(--rp-r-lg);background:var(--rp-surface);box-shadow:var(--rp-shadow);text-align:center;cursor:default;transition:box-shadow var(--rp-duration) var(--rp-ease), border-color var(--rp-duration) var(--rp-ease);border:2px solid #0000;flex-direction:column;display:flex;position:relative}.rp-select-box>.rp-swatch{margin-bottom:var(--rp-space-1)}.rp-select-box:is([data-hovered],[data-selected]){box-shadow:var(--rp-elevated)}.rp-select-box[data-selected]{border-color:var(--rp-accent)}.rp-select-box-check{width:var(--rp-space-4);height:var(--rp-space-4);color:var(--rp-accent);visibility:hidden;position:absolute;inset-block-start:var(--rp-space-1);inset-inline-end:var(--rp-space-1)}.rp-select-box[data-selected] .rp-select-box-check{visibility:visible}@media (width<=599.98px){.rp-select-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@@ -1 +0,0 @@
import{r as e,a as s,j as t}from"./vendor-react-64fcanlc.js";import{al as a,aE as i,j as n,U as r,ai as l,bT as o,fe as d,ff as c,C as g,fg as u,dd as p,et as m,bY as h,bU as f,a4 as b,bW as v,fh as x,c9 as j,fi as y,bX as k,y as N,fj as w,W as _,a1 as S,aJ as C,fk as P,fl as R,fm as I,fn as D,fo as L,cK as T,aF as U,P as H,cp as F,X as E,c7 as A,ae as q,ci as M,e0 as O,M as V,K as W,D as z,ay as B,A as G,c4 as K,c5 as $,V as J,cS as Y,J as X,bl as Q,bm as Z,fp as ee,fq as se,cT as te,aV as ae,d4 as ie,bG as ne,T as re,ec as le,bO as oe,fr as de,fs as ce,ft as ge,fu as ue,fv as pe}from"./index-CmbH0woS.js";import{e as me,L as he,y as fe,u as be,s as ve,z as xe,B as je,t as ye}from"./ActionGroup-D3mQjUsw.js";import{T as ke}from"./Toolbar-B9K5nAyx.js";import{S as Ne}from"./SearchSelect-CuaWhoLz.js";import{d as we,c as _e}from"./auth-aj_VNWTT.js";import{g as Se,r as Ce,c as Pe,s as Re,a as Ie}from"./nav--g10gPaM.js";import{aR as De}from"./activity-CiEWAlFW.js";import{D as Le}from"./Table-Cfbaho6J.js";import{T as Te}from"./TimeCell-D0UB-mKs.js";import{g as Ue,v as He}from"./geodata-X0pHz03D.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./Select-BcN72K3H.js";import"./SearchList-CJ8rQxgu.js";import"./Virtualizer-itu1Kg0o.js";import"./Checkbox-f7Je53QZ.js";const Fe={record_flows:{state:"flows"},record_logs:{state:"logs"},record_dns_log:{state:"dns_log"}},Ee=Object.keys(Fe),Ae={record_flows:"settings.record.autoFlows",record_logs:"settings.record.autoLogs",record_dns_log:"settings.record.autoDnsLog"},qe={on:"settings.record.on",off:"settings.record.off"};function Me(e,s,t,a){const i=!!t&&!t.allowed;return{id:e,label:a(Ce[e]),value:s,items:["auto","on","off"].map(s=>({id:s,label:a("auto"===s?Ae[e]:qe[s])})),disabled:i,tone:i?"muted":t?.active?"ok":"neutral",status:a(i?"settings.recordingForbidden":t?.active?"settings.recordingActive":"settings.recordingIdle")}}function Oe(e,s){if(!e)return null;const t=e.grace_remaining_seconds??0;return t>0?s("settings.recordingGrace",{n:t}):e.events?s(e.events.active?"settings.recordingEvents":"settings.recordingDetached"):null}const Ve=(e,s,t)=>"auto"===e&&null!==s?t("settings.recordFlowsAuto",{n:s}):null,We={"log.buffered_records":{read:e=>e.log?.buffered_records,write:(e,s)=>{(e.log??={}).buffered_records=s}},"dns_log.max_records":{read:e=>e.dns_log?.max_records,write:(e,s)=>{(e.dns_log??={}).max_records=s}},"flows.max_flows":{read:e=>e.flows?.max_flows,write:(e,s)=>{(e.flows??={}).max_flows=s}},"flows.retention_seconds":{read:e=>e.flows?.retention_seconds,write:(e,s)=>{(e.flows??={}).retention_seconds=s}}},ze=Object.keys(We);function Be(e,s,t,a,i,n){return{id:e,value:s,label:n(Ce[e]),invalid:!/^\d+$/.test(s)||Number(s)<t||void 0!==a&&Number(s)>a,description:void 0===a?n("settings.rangeMin",{min:l(t,i)}):n("settings.range",{min:l(t,i),max:l(a,i)})}}function Ge(e,s){return e.map(e=>({id:e.kind,kind:e.kind,size:a(e.size_bytes,s),modifiedAt:e.modified_at,sha:e.sha256.slice(0,12),shaTitle:e.sha256,source:e.source_redacted??"—"}))}function Ke(e,s){return e?null:s("settings.noProfile")}function $e({busy:e,invalid:s},t){return!e&&s?t("settings.runtimeInvalid",{field:s}):null}function Je({busy:e,loaded:s,failed:t},a){return e||s||!t?null:a("settings.geodataUnread")}function Ye(e,s,t,a){const l=e?.resources;if(!l?.geodata.available||!0!==l.geodata.can_update||Se(l))return null;const o=me(s),d=o.reason("geodata",e);if("no-download-urls"!==d?.code)return null;return{text:t("settings.geodataFromConfig",{keys:i(a,d.settings.map(e=>o.settingName(e.key)))}),docs:{href:r(a,"state-db"),text:t("ov.lim.docsStateDb")},config:l.config.available?{href:n("config",{tab:"source"}),text:t("nav.config")}:void 0}}async function Xe(e,s,t,a){try{const a=await d(e,s).discovery(t);if(!a||!Number.isInteger(a.api_major)||a.api_major<1)throw new o(200,"invalid_discovery","Missing API version");return{version:String(a.api_major),password:"password"===a.auth.mode}}catch(i){const n=function(e,s,t,a,i=""){return s.aborted&&"TimeoutError"===s.reason?.name?{key:"settings.timeout"}:s.aborted?null:e instanceof o?401===e.status?{key:i?"settings.tokenRejected":"settings.unauthorized"}:"empty_response"===e.code?{key:"settings.nonJson"}:"invalid_discovery"===e.code?{key:"settings.invalidResponse"}:{key:"settings.httpError",params:{status:e.status}}:e instanceof SyntaxError?{key:"settings.nonJson"}:e instanceof TypeError&&new URL(t).origin!==a?{key:"settings.cors"}:{key:"settings.network"}}(i,t,e,a,s);return n&&{failure:n,requestId:i instanceof o?i.requestId:null}}}function Qe(e){const s=new URLSearchParams(e),t=s.get("api");return t?{api:t,token:s.get("token")??""}:null}function Ze(t,a=c){const i=g(),[n]=e.useState(u),[r,l]=e.useState(n.api??""),[o,d]=e.useState(n.token),[w,_]=e.useState(!1),[S,C]=e.useState(null),{pending:P,running:R,cancel:I,run:D}=function(){const[s,t]=e.useState(!1),a=e.useRef(null),i=e.useCallback(()=>{const e=a.current;a.current=null,e?.abort()},[]);return e.useEffect(()=>i,[i]),{pending:s,runnLine truncated
@@ -0,0 +1 @@
import{r as e,$ as t,j as s,a}from"./vendor-react-64fcanlc.js";import{du as n,bp as i,dv as r,dw as l,dx as o,cC as d,dy as c,cJ as u,cB as g,cE as p,cN as m,dz as f,cO as h,cQ as b,dA as v,cT as x,cU as j,cD as y,cW as w,cX as k,cV as N,d3 as C,cR as S,d2 as P,aD as T,c$ as _,dB as D,dC as R,dj as I,d5 as E,B as F,cl as M,d4 as V,u as L,bk as H,ch as U,dD as O,a0 as A,ak as q,h as B,m as z,Y as K,aM as $,dE as W,dF as G,dG as Y,cw as X,de as J,bD as Q,bz as Z,A as ee,bB as te,dH as se,bK as ae,dI as ne,bC as ie,dJ as re,s as le,dK as oe,q as de,x as ce,ap as ue,dL as ge,dM as pe,dN as me,dO as fe,dP as he,c9 as be,al as ve,l as xe,bT as je,r as ye,bI as we,U as ke,bP as Ne,aK as Ce,C as Se,E as Pe,ae as Te,S as _e,a as De,b as Re,bF as Ie,p as Ee,cg as Fe,df as Me,aO as Ve,aZ as Le,dQ as He,dR as Ue,aA as Oe,T as Ae,aL as qe,bG as Be,bw as ze,dS as Ke,dT as $e,dU as We,dV as Ge,w as Ye}from"./index-ucpAK88B.js";import{L as Xe}from"./AppearanceControls-DmbIJj4H.js";import{$ as Je,e as Qe,L as Ze,y as et,c as tt,D as st,K as at,F as nt,T as it,U as rt,G as lt}from"./logs-DjZPFUMm.js";import{T as ot}from"./Tabs-DrhG95XR.js";import{T as dt}from"./Toolbar-D1_-nNpE.js";import{$ as ct,d as ut,a as gt}from"./Select-2JXPV40Q.js";import{C as pt}from"./ItemText-CtNOgl4O.js";import{u as mt,s as ft,M as ht,w as bt,D as vt}from"./wallpaper-CEC7gitM.js";import{d as xt,c as jt}from"./auth-B7YirLMe.js";import{g as yt,r as wt,c as kt,s as Nt,a as Ct,b as St,d as Pt,e as Tt}from"./nav-Fc_XrTSE.js";import{N as _t,t as Dt,n as Rt}from"./NumberField-Blv4W9AC.js";import{aQ as It,aR as Et,aS as Ft}from"./activity-CbXYXdVY.js";import{D as Mt}from"./Table-mJjr_XDH.js";import{T as Vt}from"./TimeCell-BqAcq3yb.js";import{a as Lt}from"./geodataUpdate-DkW-2XPA.js";import{g as Ht,v as Ut}from"./geodata-X0pHz03D.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./nodes-DqXrz-fh.js";import"./Checkbox-eZH7dxup.js";import"./Virtualizer-mx6Yxab_.js";const Ot=new WeakMap;function At(e,t){let s=Ot.get(e);if(!s)throw new Error("Unknown slider state");return`${s.id}-${t}`}const qt=0,Bt=100,zt=1;function Kt(t){const{isDisabled:s=!1,minValue:a=qt,maxValue:n=Bt,numberFormatter:i,step:r=zt,orientation:o="horizontal"}=t;let d=e.useMemo(()=>{let e=(n-a)/10;return e=f(e,0,e+r,r),Math.max(e,r)},[r,n,a]),c=e.useCallback(e=>e?.map((t,s)=>{let i=0===s?a:e[s-1],l=s===e.length-1?n:e[s+1];return f(t,i,l,r)}),[a,n,r]),u=e.useMemo(()=>c(Wt(t.value)),[t.value,c]),g=e.useMemo(()=>c(Wt(t.defaultValue)??[a]),[t.defaultValue,a,c]),p=Gt(t.value,t.defaultValue,t.onChange),m=Gt(t.value,t.defaultValue,t.onChangeEnd);const[b,v]=h(u,g,p);let[x]=e.useState(b);const[j,y]=e.useState(new Array(b.length).fill(!1)),w=e.useRef(new Array(b.length).fill(!0)),[k,N]=e.useState(void 0),C=e.useRef(b),S=e.useRef(j);function P(e){return(e-a)/(n-a)}function T(e){return 0===e?a:b[e-1]}function _(e){return e===b.length-1?n:b[e+1]}function D(e){return w.current[e]}function R(e,t){if(s||!D(e))return;const a=T(e),n=_(e);t=f(t,a,n,r);let i=$t(C.current,e,t);var l;l=i,C.current=l,v(l)}let I=e.useRef(null);function E(e=b){switch("number"==typeof e&&(e=[e]),e.length){case 0:return"";case 1:return i.format(e[0]);case 2:return i.formatRange(e[0],e[1]);default:{let t=e.map(e=>i.format(e)),s=I.current;return s&&s.resolvedOptions().locale===i.resolvedOptions().locale||(s=I.current=new Intl.ListFormat(i.resolvedOptions().locale,{type:"unit"})),s.format(t)}}}function F(e){return l((t=e*(n-a)+a,Math.round((t-a)/r)*r+a),a,n);var t}return{values:b,defaultValues:void 0!==t.defaultValue?g:x,getThumbValue:e=>b[e],setThumbValue:R,setThumbPercent:function(e,t){R(e,F(t))},isThumbDragging:e=>j[e],setThumbDragging:function(e,t){if(s||!D(e))return;t&&(C.current=b);const a=S.current[e];var n;S.current=$t(S.current,e,t),n=S.current,S.current=n,y(n),m&&a&&!S.current.some(Boolean)&&m(C.current)},focusedThumb:k,setFocusedThumb:N,getThumbPercent:e=>P(b[e]),getValuePercent:P,getThumbValueLabel:e=>E(b[e]),getFormattedValue:E,getThumbMinValue:T,getThumbMaxValue:_,getPercentValue:F,isThumbEditable:D,setThumbEditable:function(e,t){w.current[e]=t},incrementThumb:function(e,t=1){let s=Math.max(t,r);R(e,f(b[e]+s,a,n,r))},decrementThumb:function(e,t=1){let s=Math.max(t,r);R(e,f(b[e]-s,a,n,r))},step:r,pageSize:d,orientation:o,isDisabled:s}}function $t(e,t,s){return e[t]===s?e:[...e.slice(0,t),s,...e.slice(t+1)]}function Wt(e){if(null!=e)return Array.isArray(e)?e:[e]}function Gt(e,t,s){return a=>{s?.("number"==typeof e||"number"==typeof t?a[0]:a)}}const Yt=e.createContext(null),Xt=e.createContext(null),Jt=e.createContext(null),Qt=e.createContext(null),Zt=e.forwardRef(function(s,a){[s,a]=b(s,a,Yt);let c=e.useRef(null),u=v(s.formatOptions),g=Kt({...s,numberFormatter:u}),[p,m]=x(!s["aria-label"]&&!s["aria-labelledby"]),{groupProps:f,trackProps:h,labelProps:C,outputProps:S}=function(t,s,a){let{labelProps:c,fieldProps:u}=n(t),g="vertical"===t.orientation;Ot.set(s,{id:c.id??u.id,"aria-describedby":t["aria-describedby"],"aria-details":t["Line truncated
@@ -0,0 +1 @@
import{r as t,j as e}from"./vendor-react-64fcanlc.js";import{f as s,g3 as i}from"./index-ucpAK88B.js";import{a,aW as r,aX as o,aY as l,a$ as n,b0 as h,b1 as d}from"./activity-CbXYXdVY.js";import{G as m,C as c}from"./AreaCurve-DQSHOSpG.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./nodes-DqXrz-fh.js";import"./AppearanceControls-DmbIJj4H.js";import"./ItemText-CtNOgl4O.js";import"./logs-DjZPFUMm.js";import"./Select-2JXPV40Q.js";import"./array-C0VuvQyb.js";function u({values:u,timestamps:p,color:x,fmt:j,locale:f,height:y=32,floor:g=0,inset:v=0,lines:w}){const M=t.useId(),b=a(),[k,C]=t.useState(null),[$,A]=s(Math.round,120),{tip:W,showAt:I,hide:L}=r(),P=t.useMemo(()=>u.filter(t=>null!==t),[u]),S=P.length>1,T=t.useMemo(()=>[g>0?0:.85*Math.min(...P),Math.max(1.05*Math.max(...P)||1,g)],[P,g]),B=A?.width??0,D=(A?.height??y)-2,E=t.useMemo(()=>{const t=[Math.min(...p),Math.max(...p)];return p.map(e=>o(e,t,[v,Math.max(v,B-v)]))},[p,B,v]),F=t.useCallback(t=>o(t,T,[D,2]),[T,D]),G=t.useMemo(()=>u.map((t,e)=>null===t?null:{x:E[e],y:F(t)}),[u,E,F]);return t.useLayoutEffect(()=>{null!==k&&null!=u[k]&&j&&f&&$.current&&A?I({x:E[k],y:F(u[k]),width:A.width,bounds:l($.current),label:i(f).format(p[k]),lines:w?.(k)??[j(u[k])]}):L()}),e.jsxs("div",{ref:$,style:{height:`var(--rp-spark-fill, ${y}px)`,width:"100%",position:"relative"},"aria-hidden":!!S||void 0,onPointerLeave:()=>C(null),children:[A&&!S&&e.jsx("svg",{"aria-hidden":!0,width:A.width,height:A.height,style:{display:"block",position:"absolute",inset:0},children:e.jsx("line",{x1:v,x2:A.width-v,y1:D,y2:D,stroke:b["hl-med"],strokeDasharray:"2 4"})}),S&&A&&e.jsxs(e.Fragment,{children:[e.jsx(n,{tip:W}),e.jsxs("svg",{className:"rp-activity-surface",width:A.width,height:A.height,viewBox:`0 0 ${A.width} ${A.height}`,style:{display:"block",position:"absolute",inset:0},onPointerMove:t=>{const e=h(t,t.currentTarget,A);C(e.x<0||e.x>A.width||e.y<2||e.y>A.height-2?null:d(E,e.x))},children:[e.jsx("defs",{children:e.jsx(m,{id:M,color:x})}),e.jsx(c,{points:G,baseline:F(Math.max(0,T[0])),color:x,id:M,strokeWidth:1.5}),null!==k&&null!=u[k]&&e.jsx("circle",{cx:E[k],cy:F(u[k]),r:4,fill:x,stroke:b.base,strokeWidth:2})]})]})]})}export{u as SparkPlot};
@@ -1 +0,0 @@
import{r as t,j as e}from"./vendor-react-64fcanlc.js";import{E as s,hw as i}from"./index-CmbH0woS.js";import{u as a,bb as r,bc as o,bd as l,bg as h,bh as n,bi as d}from"./activity-CiEWAlFW.js";import{G as m,C as u}from"./AreaCurve-DQSHOSpG.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./ActionGroup-D3mQjUsw.js";import"./Select-BcN72K3H.js";import"./array-C0VuvQyb.js";function c({values:c,timestamps:x,color:p,fmt:j,locale:y,height:b=32,floor:f=0,inset:g=0,lines:v}){const w=t.useId(),M=a(),[k,C]=t.useState(null),[A,$]=s(Math.round,120),{tip:E,showAt:G,hide:L}=r(),P=t.useMemo(()=>c.filter(t=>null!==t),[c]),S=P.length>1,W=t.useMemo(()=>[f>0?0:.85*Math.min(...P),Math.max(1.05*Math.max(...P)||1,f)],[P,f]),B=$?.width??0,D=($?.height??b)-2,F=t.useMemo(()=>{const t=[Math.min(...x),Math.max(...x)];return x.map(e=>o(e,t,[g,Math.max(g,B-g)]))},[x,B,g]),H=t.useCallback(t=>o(t,W,[D,2]),[W,D]),I=t.useMemo(()=>c.map((t,e)=>null===t?null:{x:F[e],y:H(t)}),[c,F,H]);return t.useLayoutEffect(()=>{null!==k&&null!=c[k]&&j&&y&&A.current&&$?G({x:F[k],y:H(c[k]),width:$.width,bounds:l(A.current),label:i(y).format(x[k]),lines:v?.(k)??[j(c[k])]}):L()}),e.jsxs("div",{ref:A,style:{height:`var(--rp-spark-fill, ${b}px)`,width:"100%",position:"relative"},"aria-hidden":!!S||void 0,onPointerLeave:()=>C(null),children:[$&&!S&&e.jsx("svg",{"aria-hidden":!0,width:$.width,height:$.height,style:{display:"block",position:"absolute",inset:0},children:e.jsx("line",{x1:g,x2:$.width-g,y1:D,y2:D,stroke:M["hl-med"],strokeDasharray:"2 4"})}),S&&$&&e.jsxs(e.Fragment,{children:[e.jsx(h,{tip:E}),e.jsxs("svg",{className:"rp-activity-surface",width:$.width,height:$.height,viewBox:`0 0 ${$.width} ${$.height}`,style:{display:"block",position:"absolute",inset:0},onPointerMove:t=>{const e=n(t,t.currentTarget,$);C(e.x<0||e.x>$.width||e.y<2||e.y>$.height-2?null:d(F,e.x))},children:[e.jsx("defs",{children:e.jsx(m,{id:w,color:p})}),e.jsx(u,{points:I,baseline:H(Math.max(0,W[0])),color:p,id:w,strokeWidth:1.5}),null!==k&&null!=c[k]&&e.jsx("circle",{cx:F[k],cy:H(c[k]),r:4,fill:p,stroke:M.base,strokeWidth:2})]})]})]})}export{c as SparkPlot};
@@ -1 +0,0 @@
import{r as e,$ as t,b as l,j as n}from"./vendor-react-64fcanlc.js";import{fz as i,fA as o,fB as r,fC as s,fD as a,fE as d,bs as u,eV as c,du as h,dm as y,fF as f,dx as p,dl as g,fG as m,fH as b,fI as w,fJ as v,eT as x,dv as k,fK as C,fL as K,fM as I,fN as S,fO as M,fP as R,fQ as E,dj as z,dk as D,fR as P,dt as N,fS as H,fT as W,fU as A,fV as T,eW as F,fW as V,fX as B,fY as L,fZ as j,dy as O,dA as $,eX as U,e_ as _,f_ as q,f$ as Y,dL as X,dM as G,f1 as Z,g0 as J,dO as Q,dE as ee,dG as te,g1 as le,g2 as ne,dK as ie,g3 as oe,g4 as re,dP as se,eY as ae,f6 as de,dF as ue,g5 as ce,eZ as he,g6 as ye,g7 as fe,g8 as pe,g9 as ge,ga as me,f3 as be,gb as we,gc as ve,f5 as xe,C as ke,G as Ce,b_ as Ke,A as Ie,az as Se,c$ as Me,gd as Re,cI as Ee,aY as ze,bO as De,bZ as Pe,T as Ne}from"./index-CmbH0woS.js";import{b as He,a as We,c as Ae,d as Te,e as Fe,f as Ve,g as Be}from"./Checkbox-f7Je53QZ.js";import{f as Le,g as je,h as Oe,i as $e,j as Ue}from"./Select-BcN72K3H.js";import{$ as _e}from"./ActionGroup-D3mQjUsw.js";import{e as qe,a as Ye,c as Xe,b as Ge,d as Ze}from"./Virtualizer-itu1Kg0o.js";class Je{constructor(e){if(this.collection=e.collection,this.disabledKeys=e.disabledKeys,this.disabledBehavior=e.disabledBehavior||"all",this.direction=e.direction,this.collator=e.collator,!e.layout&&!e.ref)throw new Error("Either a layout or a ref must be specified.");this.layoutDelegate=e.layoutDelegate||(e.layout?new Qe(e.layout):new i(e.ref)),this.focusMode=e.focusMode??"row"}isCell(e){return"cell"===e.type}isRow(e){return"row"===e.type||"item"===e.type}isDisabled(e){return"all"===this.disabledBehavior&&(e.props?.isDisabled||this.disabledKeys.has(e.key))&&"selection"!==e.props?.disabledBehavior}findPreviousKey(e,t,l=!1){let n=null!=e?this.collection.getKeyBefore(e):this.collection.getLastKey();for(;null!=n;){let e=this.collection.getItem(n);if(!e)return null;if((l||!this.isDisabled(e))&&(!t||t(e)))return n;n=this.collection.getKeyBefore(n)}return null}findNextKey(e,t,l=!1){let n=null!=e?this.collection.getKeyAfter(e):this.collection.getFirstKey();for(;null!=n;){let e=this.collection.getItem(n);if(!e)return null;if((l||!this.isDisabled(e))&&(!t||t(e)))return n;if(n=this.collection.getKeyAfter(n),null==n)return null}return null}getKeyForItemInRowByIndex(e,t=0){if(t<0)return null;let l=this.collection.getItem(e);if(!l)return null;let n=0;for(let i of o(l,this.collection)){if(i.colSpan&&i.colSpan+n>t)return i.key??null;if(i.colSpan&&(n=n+i.colSpan-1),n===t)return i.key??null;n++}return null}getKeyBelow(e,t){let l=e,n=this.collection.getItem(l);if(!n)return null;if(this.isCell(n)&&(l=n.parentKey??null),null==l)return null;if(l=this.findNextKey(l,e=>"item"===e.type,t?.includeDisabled),null!=l){if(this.isCell(n)){let e=n.colIndex?n.colIndex:n.index;return this.getKeyForItemInRowByIndex(l,e)}if("row"===this.focusMode)return l}return null}getKeyAbove(e,t){let l=e,n=this.collection.getItem(l);if(!n)return null;if(this.isCell(n)&&(l=n.parentKey??null),null==l)return null;if(l=this.findPreviousKey(l,e=>"item"===e.type,t?.includeDisabled),null!=l){if(this.isCell(n)){let e=n.colIndex?n.colIndex:n.index;return this.getKeyForItemInRowByIndex(l,e)}if("row"===this.focusMode)return l}return null}getKeyRightOf(e){let t=this.collection.getItem(e);if(!t)return null;if(this.isRow(t)){let e=o(t,this.collection);return("rtl"===this.direction?r(e)?.key:s(e)?.key)??null}if(this.isCell(t)&&null!=t.parentKey){let l=this.collection.getItem(t.parentKey);if(!l)return null;let n=o(l,this.collection),i=("rtl"===this.direction?a(n,t.index-1):a(n,t.index+1))??null;return i?i.key??null:"row"===this.focusMode?t.parentKey??null:("rtl"===this.direction?this.getFirstKey(e):this.getLastKey(e))??null}return null}getKeyLeftOf(e){let t=this.collection.getItem(e);if(!t)return null;if(this.isRow(t)){let e=o(t,this.collection);return("rtl"===this.direction?s(e)?.key:r(e)?.key)??null}if(this.isCell(t)&&null!=t.parentKey){let l=this.collection.getItem(t.parentKey);if(!l)return null;let n=o(l,this.collection),i=("rtl"===this.direction?a(n,t.index+1):a(n,t.index-1))??null;return i?i.key??null:"row"===this.focusMode?t.parentKey??null:("rtl"===this.direction?this.getLastKey(e):this.getFirstKey(e))??null}return null}getFirstKey(e,t){let l,n=e??null;if(null!=n){if(l=this.collection.getItem(n),!l)return null;if(this.isCell(l)&&!t&&null!=l.parentKey){let e=this.collection.getItem(l.parentKey);return e?s(o(e,this.collection))?.key??null:null}}if(n=this.findNextKey(void 0,e=>"item"===e.type),null!=n&&(l&&this.isCell(l)&&t||"cell"===this.focusMode)){let e=this.collection.getItem(n);if(!e)return null;n=s(o(e,this.collection))?.key??null}return n}getLastKey(e,t){let l,n=e??null;if(null!=n){if(l=this.collection.getItem(n),!l)return null;if(this.isCell(l)&&!t&&null!=l.parentKey){let e=this.collection.getItem(l.parentKey);if(!e)return null;let t=o(e,this.collection);return r(t)?.key??null}}if(n=this.findPreviousKey(void 0,e=>"item"===e.type),null!=n&&(l&&this.isCell(l)&&t||"cell"===this.focusMLine truncated
@@ -0,0 +1 @@
import{r as e,$ as t,b as l,j as n}from"./vendor-react-64fcanlc.js";import{ef as i,eg as o,eh as r,ei as s,ej as a,ek as d,bp as c,d_ as u,cK as h,cD as y,el as p,cN as f,cC as g,em as m,en as b,eo as w,ep as v,dY as x,cL as k,eq as C,er as K,es as I,et as S,eu as M,ev as R,ew as E,cA as z,cB as D,ex as P,cJ as N,ey as H,ez as W,eA as A,eB as T,d$ as F,eC as V,eD as B,eE as L,eF as j,cO as O,cQ as $,e0 as U,e3 as _,eG as q,eH as Y,c$ as X,d0 as G,e6 as J,eI as Q,d2 as Z,cU as ee,cW as te,eJ as le,eK as ne,c_ as ie,eL as oe,eM as re,d3 as se,e1 as ae,eb as de,cV as ce,eN as ue,e2 as he,eO as ye,eP as pe,eQ as fe,eR as ge,eS as me,e8 as be,eT as we,eU as ve,ea as xe,u as ke,i as Ce,b4 as Ke,eV as Ie,af as Se,cn as Me,aE as Re,b9 as Ee,aD as ze,bw as De,b7 as Pe,eW as Ne,T as He}from"./index-ucpAK88B.js";import{b as We,a as Ae,c as Te,d as Fe,e as Ve,f as Be,g as Le}from"./Checkbox-eZH7dxup.js";import{f as je,g as Oe,h as $e,i as Ue,j as _e}from"./Select-2JXPV40Q.js";import{$ as qe}from"./logs-DjZPFUMm.js";import{e as Ye,a as Xe,c as Ge,b as Je,d as Qe}from"./Virtualizer-mx6Yxab_.js";class Ze{constructor(e){if(this.collection=e.collection,this.disabledKeys=e.disabledKeys,this.disabledBehavior=e.disabledBehavior||"all",this.direction=e.direction,this.collator=e.collator,!e.layout&&!e.ref)throw new Error("Either a layout or a ref must be specified.");this.layoutDelegate=e.layoutDelegate||(e.layout?new et(e.layout):new i(e.ref)),this.focusMode=e.focusMode??"row"}isCell(e){return"cell"===e.type}isRow(e){return"row"===e.type||"item"===e.type}isDisabled(e){return"all"===this.disabledBehavior&&(e.props?.isDisabled||this.disabledKeys.has(e.key))&&"selection"!==e.props?.disabledBehavior}findPreviousKey(e,t,l=!1){let n=null!=e?this.collection.getKeyBefore(e):this.collection.getLastKey();for(;null!=n;){let e=this.collection.getItem(n);if(!e)return null;if((l||!this.isDisabled(e))&&(!t||t(e)))return n;n=this.collection.getKeyBefore(n)}return null}findNextKey(e,t,l=!1){let n=null!=e?this.collection.getKeyAfter(e):this.collection.getFirstKey();for(;null!=n;){let e=this.collection.getItem(n);if(!e)return null;if((l||!this.isDisabled(e))&&(!t||t(e)))return n;if(n=this.collection.getKeyAfter(n),null==n)return null}return null}getKeyForItemInRowByIndex(e,t=0){if(t<0)return null;let l=this.collection.getItem(e);if(!l)return null;let n=0;for(let i of o(l,this.collection)){if(i.colSpan&&i.colSpan+n>t)return i.key??null;if(i.colSpan&&(n=n+i.colSpan-1),n===t)return i.key??null;n++}return null}getKeyBelow(e,t){let l=e,n=this.collection.getItem(l);if(!n)return null;if(this.isCell(n)&&(l=n.parentKey??null),null==l)return null;if(l=this.findNextKey(l,e=>"item"===e.type,t?.includeDisabled),null!=l){if(this.isCell(n)){let e=n.colIndex?n.colIndex:n.index;return this.getKeyForItemInRowByIndex(l,e)}if("row"===this.focusMode)return l}return null}getKeyAbove(e,t){let l=e,n=this.collection.getItem(l);if(!n)return null;if(this.isCell(n)&&(l=n.parentKey??null),null==l)return null;if(l=this.findPreviousKey(l,e=>"item"===e.type,t?.includeDisabled),null!=l){if(this.isCell(n)){let e=n.colIndex?n.colIndex:n.index;return this.getKeyForItemInRowByIndex(l,e)}if("row"===this.focusMode)return l}return null}getKeyRightOf(e){let t=this.collection.getItem(e);if(!t)return null;if(this.isRow(t)){let e=o(t,this.collection);return("rtl"===this.direction?r(e)?.key:s(e)?.key)??null}if(this.isCell(t)&&null!=t.parentKey){let l=this.collection.getItem(t.parentKey);if(!l)return null;let n=o(l,this.collection),i=("rtl"===this.direction?a(n,t.index-1):a(n,t.index+1))??null;return i?i.key??null:"row"===this.focusMode?t.parentKey??null:("rtl"===this.direction?this.getFirstKey(e):this.getLastKey(e))??null}return null}getKeyLeftOf(e){let t=this.collection.getItem(e);if(!t)return null;if(this.isRow(t)){let e=o(t,this.collection);return("rtl"===this.direction?s(e)?.key:r(e)?.key)??null}if(this.isCell(t)&&null!=t.parentKey){let l=this.collection.getItem(t.parentKey);if(!l)return null;let n=o(l,this.collection),i=("rtl"===this.direction?a(n,t.index+1):a(n,t.index-1))??null;return i?i.key??null:"row"===this.focusMode?t.parentKey??null:("rtl"===this.direction?this.getLastKey(e):this.getFirstKey(e))??null}return null}getFirstKey(e,t){let l,n=e??null;if(null!=n){if(l=this.collection.getItem(n),!l)return null;if(this.isCell(l)&&!t&&null!=l.parentKey){let e=this.collection.getItem(l.parentKey);return e?s(o(e,this.collection))?.key??null:null}}if(n=this.findNextKey(void 0,e=>"item"===e.type),null!=n&&(l&&this.isCell(l)&&t||"cell"===this.focusMode)){let e=this.collection.getItem(n);if(!e)return null;n=s(o(e,this.collection))?.key??null}return n}getLastKey(e,t){let l,n=e??null;if(null!=n){if(l=this.collection.getItem(n),!l)return null;if(this.isCell(l)&&!t&&null!=l.parentKey){let e=this.collection.getItem(l.parentKey);if(!e)return null;let t=o(e,this.collection);return r(t)?.key??null}}if(n=this.findPreviousKey(void 0,e=>"item"===e.type),null!=n&&(l&&this.isCell(l)&&t||"cell"===this.focLine truncated
@@ -1 +0,0 @@
import{r as e,$ as t,j as s}from"./vendor-react-64fcanlc.js";import{eT as i,dm as l,eU as a,dk as o,dl as n,bs as r,eV as d,du as c,eW as u,dy as b,eX as f,eY as h,dL as p,dO as y,dP as v,dE as g,dF as m,eZ as K,dA as x,e_ as S,e$ as P,f0 as D,f1 as C,dB as E,dK as w,f2 as F,f3 as M,dG as N,f4 as k,f5 as j,f6 as I,f7 as L,f8 as R,f9 as T}from"./index-CmbH0woS.js";import{a as V}from"./Checkbox-f7Je53QZ.js";import{b as H}from"./Select-BcN72K3H.js";import{T as z}from"./Toolbar-B9K5nAyx.js";const A=new WeakMap;function O(e,t,s){if(!e)return"";return"string"==typeof t&&(t=t.replace(/\s+/g,"")),`${A.get(e)}-${s}-${t}`}class B{constructor(e,t,s,i=new Set){this.collection=e,this.flipDirection="rtl"===t,this.disabledKeys=i,this.tabDirection="horizontal"===s}getKeyLeftOf(e){return this.flipDirection?this.getNextKey(e):this.getPreviousKey(e)}getKeyRightOf(e){return this.flipDirection?this.getPreviousKey(e):this.getNextKey(e)}isDisabled(e){return this.disabledKeys.has(e)||!!this.collection.getItem(e)?.props?.isDisabled}getFirstKey(){let e=this.collection.getFirstKey();return null!=e&&this.isDisabled(e)&&(e=this.getNextKey(e)),e}getLastKey(){let e=this.collection.getLastKey();return null!=e&&this.isDisabled(e)&&(e=this.getPreviousKey(e)),e}getKeyAbove(e){return this.tabDirection?null:this.getPreviousKey(e)}getKeyBelow(e){return this.tabDirection?null:this.getNextKey(e)}getNextKey(e){let t=e;do{t=this.collection.getKeyAfter(t),null==t&&(t=this.collection.getFirstKey())}while(null!=t&&this.isDisabled(t)&&t!==e);return t}getPreviousKey(e){let t=e;do{t=this.collection.getKeyBefore(t),null==t&&(t=this.collection.getLastKey())}while(null!=t&&this.isDisabled(t)&&t!==e);return t}}function $(t){let s=function(t){let[s,i]=b(t.selectedKey,t.defaultSelectedKey??null,t.onSelectionChange),l=e.useMemo(()=>null!=s?[s]:[],[s]),{collection:a,disabledKeys:o,selectionManager:n}=H({...t,selectionMode:"single",disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,selectedKeys:l,onSelectionChange:e=>{if("all"===e)return;let l=e.values().next().value??null;l===s&&t.onSelectionChange&&t.onSelectionChange(l),i(l)}}),r=null!=s?a.getItem(s):null;return{collection:a,disabledKeys:o,selectionManager:n,selectedKey:s,setSelectedKey:i,selectedItem:r}}({...t,onSelectionChange:t.onSelectionChange?e=>{null!=e&&t.onSelectionChange?.(e)}:void 0,suppressTextValueWarning:!0,defaultSelectedKey:t.defaultSelectedKey??W(t.collection,t.disabledKeys?new Set(t.disabledKeys):new Set)??void 0}),{selectionManager:i,collection:l,selectedKey:a}=s,o=e.useRef(a);return e.useEffect(()=>{let e=a;null!=t.selectedKey||!i.isEmpty&&null!=e&&l.getItem(e)||(e=W(l,s.disabledKeys),null!=e&&i.setSelectedKeys([e])),(null!=e&&null==i.focusedKey||!i.isFocused&&e!==o.current)&&i.setFocusedKey(e),o.current=e}),{...s,isDisabled:t.isDisabled||!1}}function W(e,t){let s=null;if(e){for(s=e.getFirstKey();null!=s&&(t.has(s)||e.getItem(s)?.props?.isDisabled)&&s!==e.getLastKey();)s=e.getKeyAfter(s);null!=s&&(t.has(s)||e.getItem(s)?.props?.isDisabled)&&s===e.getLastKey()&&(s=e.getFirstKey())}return s}const U=e.createContext(null),G=e.createContext(null),X=e.forwardRef(function(s,i){[s,i]=x(s,i,U);let{children:l,orientation:a="horizontal"}=s;return l=e.useMemo(()=>"function"==typeof l?l({orientation:a,defaultChildren:null}):l,[l,a]),t.createElement(S,{content:l},e=>t.createElement(Y,{props:s,collection:e,tabsRef:i}))});function Y({props:s,tabsRef:i,collection:a}){let{orientation:o="horizontal"}=s,r=$({...s,collection:a,children:void 0}),{focusProps:d,isFocused:c,isFocusVisible:u}=y({within:!0}),b=e.useMemo(()=>({orientation:o,isFocusWithin:c,isFocusVisible:u}),[o,c,u]),f=g({...s,defaultClassName:"react-aria-Tabs",values:b}),h=l(s,{global:!0});return t.createElement(m.div,{...n(h,f,d),ref:i,slot:s.slot||void 0,"data-focused":c||void 0,"data-orientation":o,"data-focus-visible":u||void 0,"data-disabled":r.isDisabled||void 0},t.createElement(N,{values:[[U,s],[G,r]]},f.children))}const Z=e.forwardRef(function(s,i){return e.useContext(G)?t.createElement(_,{props:s,forwardedRef:i}):t.createElement(f,s)});function _({props:s,forwardedRef:i}){let a=e.useContext(G),{CollectionRoot:o}=e.useContext(C),{orientation:b="horizontal",keyboardActivation:f="automatic"}=E(U),h=p(i),{tabListProps:y}=function(t,s,i){let{orientation:l="horizontal",keyboardActivation:a="automatic"}=t,{collection:o,selectionManager:b,disabledKeys:f}=s,{direction:h}=r(),p=e.useMemo(()=>new B(o,h,l,f),[o,f,l,h]),{collectionProps:y}=d({ref:i,selectionManager:b,keyboardDelegate:p,selectOnFocus:"automatic"===a,disallowEmptySelection:!0,scrollRef:i,linkBehavior:"selection"}),v=c();A.set(s,v);let g=u({...t,id:v});return{tabListProps:{...n(y,g),role:"tablist","aria-orientation":l,tabIndex:void 0}}}({...s,orientation:b,keyboardActivation:f},a,h),v=g({...s,children:null,defaultClassName:"react-aria-TabList",values:{orientation:b,state:a}}),K=l(s,{global:!0});return delete K.id,t.createElement(m.div,{...n(K,v,y),ref:h,"data-orientation":b||void 0Line truncated
@@ -0,0 +1 @@
import{r as e,$ as t,j as s}from"./vendor-react-64fcanlc.js";import{dY as i,cD as l,dZ as a,cB as o,cC as n,bp as r,d_ as d,cK as c,d$ as u,cO as b,e0 as h,e1 as f,c$ as p,d2 as y,d3 as v,cU as g,cV as K,e2 as m,cQ as S,e3 as x,e4 as P,e5 as D,e6 as C,cR as E,c_ as w,e7 as F,e8 as M,cW as I,e9 as N,ea as j,eb as k,ec as R,ed as L,ee as H}from"./index-ucpAK88B.js";import{a as V}from"./Checkbox-eZH7dxup.js";import{e as T}from"./Select-2JXPV40Q.js";import{T as A}from"./Toolbar-D1_-nNpE.js";const O=new WeakMap;function $(e,t,s){if(!e)return"";return"string"==typeof t&&(t=t.replace(/\s+/g,"")),`${O.get(e)}-${s}-${t}`}class z{constructor(e,t,s,i=new Set){this.collection=e,this.flipDirection="rtl"===t,this.disabledKeys=i,this.tabDirection="horizontal"===s}getKeyLeftOf(e){return this.flipDirection?this.getNextKey(e):this.getPreviousKey(e)}getKeyRightOf(e){return this.flipDirection?this.getPreviousKey(e):this.getNextKey(e)}isDisabled(e){return this.disabledKeys.has(e)||!!this.collection.getItem(e)?.props?.isDisabled}getFirstKey(){let e=this.collection.getFirstKey();return null!=e&&this.isDisabled(e)&&(e=this.getNextKey(e)),e}getLastKey(){let e=this.collection.getLastKey();return null!=e&&this.isDisabled(e)&&(e=this.getPreviousKey(e)),e}getKeyAbove(e){return this.tabDirection?null:this.getPreviousKey(e)}getKeyBelow(e){return this.tabDirection?null:this.getNextKey(e)}getNextKey(e){let t=e;do{t=this.collection.getKeyAfter(t),null==t&&(t=this.collection.getFirstKey())}while(null!=t&&this.isDisabled(t)&&t!==e);return t}getPreviousKey(e){let t=e;do{t=this.collection.getKeyBefore(t),null==t&&(t=this.collection.getLastKey())}while(null!=t&&this.isDisabled(t)&&t!==e);return t}}function B(t){let s=function(t){let[s,i]=b(t.selectedKey,t.defaultSelectedKey??null,t.onSelectionChange),l=e.useMemo(()=>null!=s?[s]:[],[s]),{collection:a,disabledKeys:o,selectionManager:n}=T({...t,selectionMode:"single",disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,selectedKeys:l,onSelectionChange:e=>{if("all"===e)return;let l=e.values().next().value??null;l===s&&t.onSelectionChange&&t.onSelectionChange(l),i(l)}}),r=null!=s?a.getItem(s):null;return{collection:a,disabledKeys:o,selectionManager:n,selectedKey:s,setSelectedKey:i,selectedItem:r}}({...t,onSelectionChange:t.onSelectionChange?e=>{null!=e&&t.onSelectionChange?.(e)}:void 0,suppressTextValueWarning:!0,defaultSelectedKey:t.defaultSelectedKey??W(t.collection,t.disabledKeys?new Set(t.disabledKeys):new Set)??void 0}),{selectionManager:i,collection:l,selectedKey:a}=s,o=e.useRef(a);return e.useEffect(()=>{let e=a;null!=t.selectedKey||!i.isEmpty&&null!=e&&l.getItem(e)||(e=W(l,s.disabledKeys),null!=e&&i.setSelectedKeys([e])),(null!=e&&null==i.focusedKey||!i.isFocused&&e!==o.current)&&i.setFocusedKey(e),o.current=e}),{...s,isDisabled:t.isDisabled||!1}}function W(e,t){let s=null;if(e){for(s=e.getFirstKey();null!=s&&(t.has(s)||e.getItem(s)?.props?.isDisabled)&&s!==e.getLastKey();)s=e.getKeyAfter(s);null!=s&&(t.has(s)||e.getItem(s)?.props?.isDisabled)&&s===e.getLastKey()&&(s=e.getFirstKey())}return s}const U=e.createContext(null),Q=e.createContext(null),_=e.forwardRef(function(s,i){[s,i]=S(s,i,U);let{children:l,orientation:a="horizontal"}=s;return l=e.useMemo(()=>"function"==typeof l?l({orientation:a,defaultChildren:null}):l,[l,a]),t.createElement(x,{content:l},e=>t.createElement(Y,{props:s,collection:e,tabsRef:i}))});function Y({props:s,tabsRef:i,collection:a}){let{orientation:o="horizontal"}=s,r=B({...s,collection:a,children:void 0}),{focusProps:d,isFocused:c,isFocusVisible:u}=y({within:!0}),b=e.useMemo(()=>({orientation:o,isFocusWithin:c,isFocusVisible:u}),[o,c,u]),h=g({...s,defaultClassName:"react-aria-Tabs",values:b}),f=l(s,{global:!0});return t.createElement(K.div,{...n(f,h,d),ref:i,slot:s.slot||void 0,"data-focused":c||void 0,"data-orientation":o,"data-focus-visible":u||void 0,"data-disabled":r.isDisabled||void 0},t.createElement(I,{values:[[U,s],[Q,r]]},h.children))}const Z=e.forwardRef(function(s,i){return e.useContext(Q)?t.createElement(q,{props:s,forwardedRef:i}):t.createElement(h,s)});function q({props:s,forwardedRef:i}){let a=e.useContext(Q),{CollectionRoot:o}=e.useContext(C),{orientation:b="horizontal",keyboardActivation:h="automatic"}=E(U),f=p(i),{tabListProps:y}=function(t,s,i){let{orientation:l="horizontal",keyboardActivation:a="automatic"}=t,{collection:o,selectionManager:b,disabledKeys:h}=s,{direction:f}=r(),p=e.useMemo(()=>new z(o,f,l,h),[o,h,l,f]),{collectionProps:y}=d({ref:i,selectionManager:b,keyboardDelegate:p,selectOnFocus:"automatic"===a,disallowEmptySelection:!0,scrollRef:i,linkBehavior:"selection"}),v=c();O.set(s,v);let g=u({...t,id:v});return{tabListProps:{...n(y,g),role:"tablist","aria-orientation":l,tabIndex:void 0}}}({...s,orientation:b,keyboardActivation:h},a,f),v=g({...s,children:null,defaultClassName:"react-aria-TabList",values:{orientation:b,state:a}}),m=l(s,{global:!0});return delete m.id,t.createElement(K.div,{...n(m,v,y),ref:f,"data-orientation":b||void 0Line truncated
@@ -0,0 +1 @@
import{r as e,j as n,a as t}from"./vendor-react-64fcanlc.js";import{l as r,ak as l,dh as s,cn as a,di as c,b7 as o}from"./index-ucpAK88B.js";import{L as u}from"./AppearanceControls-DmbIJj4H.js";function i({children:e,tone:t,action:r}){return n.jsxs("span",{className:o("rp-tag",t),children:[n.jsx("span",{className:"rp-tag-label",children:e}),r]})}function g({label:e,children:t}){return n.jsx("div",{className:"rp-tags",role:"group","aria-label":e,children:t})}function h({href:e,children:t}){return n.jsx(u,{href:e,className:"rp-tag rp-tag-link",children:n.jsx("span",{className:"rp-tag-label",children:t})})}function d(e,n,t,r){const l=e=>e<=t+.01,s=e.reduce((e,n)=>[...e,e[e.length-1]+n+r],[0]);if(l(s[e.length]-r))return e.length;let a=e.length-1;for(;a>0&&!l(s[a]+n(e.length-a));)a--;return a}function f({count:t,label:r,names:l}){const[o,u]=e.useState(!1);return n.jsxs(s,{delay:400,isOpen:o,onOpenChange:u,shouldCloseOnPress:!1,children:[n.jsx(a,{className:"rp-tag rp-tag-more","aria-label":r,onPress:e=>u(n=>"touch"!==e.pointerType||!n),children:n.jsxs("span",{className:"rp-tag-label",children:["+",t]})}),n.jsx(c,{children:l})]})}const p=e=>n=>e.more[String(n).length-1],m=new Map;let b=null;function j(e){const n=e.filter(e=>null!==e);n.length&&t.flushSync(()=>n.forEach(e=>e()))}function x({label:t,items:s,more:a}){const c=r(),o=e.useRef(null),u=e.useRef(null),i=e.useRef(new Set),g=`${c}\n${s.map(e=>e.label).join("\n")}`,[x,y]=e.useState({key:g,count:null}),w=x.key===g?x.count:null;e.useLayoutEffect(()=>{const e=o.current;if(null!==w||!e?.getClientRects().length)return;const n=[...e.children].map(e=>e.getBoundingClientRect().width),t={key:g,tags:n.slice(0,s.length),more:n.slice(s.length),gap:Number.parseFloat(getComputedStyle(e).columnGap)||0};u.current=t,y({key:g,count:d(t.tags,p(t),e.getBoundingClientRect().width,t.gap)})},[x,g,w,s.length]),e.useLayoutEffect(()=>{const e=o.current;if(!e)return;const n=()=>y({key:g,count:null});m.set(e,{remeasure:n,read:()=>{const t=u.current;if(!e.getClientRects().length)return null;const r=[...e.children].filter(e=>!e.classList.contains("rp-tag-more"));if(t?.key!==g||r.some((e,n)=>Math.abs(e.getBoundingClientRect().width-t.tags[n])>.5))return n;const l=d(t.tags,p(t),e.getBoundingClientRect().width,t.gap);return l===w?null:()=>y({key:g,count:l})}});const t=(b||(b=new ResizeObserver(e=>{j([...new Set(e.map(e=>e.target.closest(".rp-tags[data-fit]")))].map(e=>(e&&m.get(e)?.read())??null))}),document.fonts?.addEventListener("loadingdone",()=>j([...m.values()].map(e=>e.remeasure)))),b),r=new Set([e,...e.children]);for(const l of i.current)r.has(l)||t.unobserve(l);for(const l of r)i.current.has(l)||t.observe(l);i.current=r}),e.useLayoutEffect(()=>{const e=o.current,n=i;return()=>{e&&m.delete(e);for(const e of n.current)b?.unobserve(e);n.current=new Set}},[]);const C=l(c,s.map(e=>e.label)),R=null===w?0:s.length-w,S=null===w&&s.length?Array.from({length:String(s.length).length},(e,n)=>10**(n+1)-1):[];return n.jsxs("div",{ref:o,className:"rp-tags",role:"group","aria-label":t,"data-fit":"",children:[s.slice(0,w??s.length).map(e=>n.jsx(h,{href:e.href,children:e.label},e.id)),S.map(e=>n.jsx(f,{count:e,label:a(e),names:C},e)),R>0&&n.jsx(f,{count:R,label:a(R),names:C})]})}export{x as F,h as L,g as T,i as a};
@@ -1 +0,0 @@
import{r as e,j as n,a as t}from"./vendor-react-64fcanlc.js";import{P as r,aE as l,D as s,ev as a,c$ as c,ew as o,bZ as u}from"./index-CmbH0woS.js";function i({children:e,tone:t,action:r}){return n.jsxs("span",{className:u("rp-tag",t),children:[n.jsx("span",{className:"rp-tag-label",children:e}),r]})}function g({label:e,children:t}){return n.jsx("div",{className:"rp-tags",role:"group","aria-label":e,children:t})}function h({href:e,children:t}){return n.jsx(s,{href:e,className:"rp-tag rp-tag-link",children:n.jsx("span",{className:"rp-tag-label",children:t})})}function d(e,n,t,r){const l=e=>e<=t+.01,s=e.reduce((e,n)=>[...e,e[e.length-1]+n+r],[0]);if(l(s[e.length]-r))return e.length;let a=e.length-1;for(;a>0&&!l(s[a]+n(e.length-a));)a--;return a}function f({count:t,label:r,names:l}){const[s,u]=e.useState(!1);return n.jsxs(a,{delay:400,isOpen:s,onOpenChange:u,shouldCloseOnPress:!1,children:[n.jsx(c,{className:"rp-tag rp-tag-more","aria-label":r,onPress:e=>u(n=>"touch"!==e.pointerType||!n),children:n.jsxs("span",{className:"rp-tag-label",children:["+",t]})}),n.jsx(o,{children:l})]})}const p=e=>n=>e.more[String(n).length-1],m=new Map;let b=null;function j(e){const n=e.filter(e=>null!==e);n.length&&t.flushSync(()=>n.forEach(e=>e()))}function x({label:t,items:s,more:a}){const c=r(),o=e.useRef(null),u=e.useRef(null),i=e.useRef(new Set),g=`${c}\n${s.map(e=>e.label).join("\n")}`,[x,y]=e.useState({key:g,count:null}),w=x.key===g?x.count:null;e.useLayoutEffect(()=>{const e=o.current;if(null!==w||!e?.getClientRects().length)return;const n=[...e.children].map(e=>e.getBoundingClientRect().width),t={key:g,tags:n.slice(0,s.length),more:n.slice(s.length),gap:Number.parseFloat(getComputedStyle(e).columnGap)||0};u.current=t,y({key:g,count:d(t.tags,p(t),e.getBoundingClientRect().width,t.gap)})},[x,g,w,s.length]),e.useLayoutEffect(()=>{const e=o.current;if(!e)return;const n=()=>y({key:g,count:null});m.set(e,{remeasure:n,read:()=>{const t=u.current;if(!e.getClientRects().length)return null;const r=[...e.children].filter(e=>!e.classList.contains("rp-tag-more"));if(t?.key!==g||r.some((e,n)=>Math.abs(e.getBoundingClientRect().width-t.tags[n])>.5))return n;const l=d(t.tags,p(t),e.getBoundingClientRect().width,t.gap);return l===w?null:()=>y({key:g,count:l})}});const t=(b||(b=new ResizeObserver(e=>{j([...new Set(e.map(e=>e.target.closest(".rp-tags[data-fit]")))].map(e=>(e&&m.get(e)?.read())??null))}),document.fonts?.addEventListener("loadingdone",()=>j([...m.values()].map(e=>e.remeasure)))),b),r=new Set([e,...e.children]);for(const l of i.current)r.has(l)||t.unobserve(l);for(const l of r)i.current.has(l)||t.observe(l);i.current=r}),e.useLayoutEffect(()=>{const e=o.current,n=i;return()=>{e&&m.delete(e);for(const e of n.current)b?.unobserve(e);n.current=new Set}},[]);const v=l(c,s.map(e=>e.label)),R=null===w?0:s.length-w,S=null===w&&s.length?Array.from({length:String(s.length).length},(e,n)=>10**(n+1)-1):[];return n.jsxs("div",{ref:o,className:"rp-tags",role:"group","aria-label":t,"data-fit":"",children:[s.slice(0,w??s.length).map(e=>n.jsx(h,{href:e.href,children:e.label},e.id)),S.map(e=>n.jsx(f,{count:e,label:a(e),names:v},e)),R>0&&n.jsx(f,{count:R,label:a(R),names:v})]})}export{x as F,h as L,g as T,i as a};
@@ -0,0 +1 @@
import{j as a}from"./vendor-react-64fcanlc.js";import{al as s,l as r,dR as t,T as o,dQ as e,a1 as n}from"./index-ucpAK88B.js";function d({at:d}){const i=s[r()],c=t();return a.jsx(o,{text:d?n(d,i):void 0,children:e(d,i,c)})}export{d as T};
@@ -1 +0,0 @@
import{j as a}from"./vendor-react-64fcanlc.js";import{aF as s,P as r,fq as t,T as o,fp as e,am as n}from"./index-CmbH0woS.js";function i({at:i}){const f=s[r()],m=t();return a.jsx(o,{text:i?n(i,f):void 0,children:e(i,f,m)})}export{i as T};
@@ -1 +0,0 @@
import{j as a}from"./vendor-react-64fcanlc.js";import{bZ as r}from"./index-CmbH0woS.js";function o({page:o,className:e,children:s,...t}){return a.jsx("div",{...t,className:r("rp-toolbar",e),"data-page-toolbar":o||void 0,children:s})}export{o as T};
@@ -0,0 +1 @@
import{j as a}from"./vendor-react-64fcanlc.js";import{b7 as r}from"./index-ucpAK88B.js";function o({page:o,className:e,children:s,...t}){return a.jsx("div",{...t,className:r("rp-toolbar",e),"data-page-toolbar":o||void 0,children:s})}export{o as T};
@@ -0,0 +1 @@
import{r as e,j as s}from"./vendor-react-64fcanlc.js";import{bS as r,u as a,l as i,a9 as l,q as n,r as o,z as t,A as d,c9 as u,a6 as p,a3 as m,aK as c,p as j,bF as v,cg as b,bG as h,B as _,ci as f,T as x,C as y}from"./index-ucpAK88B.js";import{u as g,r as k}from"./flows-D8MpHTkU.js";import{c as w,h as N,z as q,g as C,q as M,R as A,L,D as T,K as D}from"./logs-DjZPFUMm.js";import{e as R,t as S,c as V,n as E,d as F,q as P,a as I,b as O}from"./Rules-fWGBxpyG.js";import{a as Q,p as W}from"./probe-BrDCvIoc.js";import{u as z,R as K}from"./useQuickRule-BWE0DtUt.js";import{d as $}from"./activity-CbXYXdVY.js";import{L as H}from"./AppearanceControls-DmbIJj4H.js";import{N as B,t as G,n as J}from"./NumberField-Blv4W9AC.js";import{T as U}from"./Toolbar-D1_-nNpE.js";import{D as X}from"./Table-mJjr_XDH.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./Select-2JXPV40Q.js";import"./ItemText-CtNOgl4O.js";import"./nodes-DqXrz-fh.js";import"./Tabs-DrhG95XR.js";import"./Checkbox-eZH7dxup.js";import"./DaeCode-DEjXqvav.js";import"./daeTokens-BVtuNnWZ.js";import"./ConditionRow-C-4K5nkB.js";import"./Coverage-C9FbmITi.js";import"./rule-Ce4KC3th.js";import"./labels-D8xxfRTQ.js";import"./nav-a45zXQGu.js";import"./recorder-BHyqDNp5.js";import"./geodataUpdate-DkW-2XPA.js";/* empty css */import"./LinkOut-L4IZJIRt.js";import"./SearchSelect-CQDeD6gi.js";import"./SearchList-BxTMvuPr.js";import"./Virtualizer-mx6Yxab_.js";import"./AddCircle-Dk2gnxD-.js";const Y=e=>/^\d+$/.test(e)&&Number(e)>=1&&Number(e)<=65535,Z={none:"rule.resolveNone",live:"rule.resolveLive",query:"rule.resolveQuery"};function ee({form:s,setForm:j,advanced:v,setAdvanced:b,touched:h},_){const f=a(),x=i(),y=l(),A=n(),L=A.data?.resources,T=w(o(L,"groups",{whileLoading:!1})),D=N(o(L,"nodes",{whileLoading:!1})),K=g(o(L,"rules",{whileLoading:!1})),H=q(D.refetch),{choices:B}=H,G=z(_),J=e.useMemo(()=>new Map(T.data?.map(e=>[e.name,e])??[]),[T.data]),U=e.useMemo(()=>new Map(T.data?.map(e=>[e.id,e])??[]),[T.data]),X=e.useMemo(()=>new Map(D.data?.map(e=>[e.id,e])??[]),[D.data]),ee=e.useMemo(()=>new Map(K.data?.rules.map(e=>[e.rule_id,e])??[]),[K.data]),[se,re]=e.useState(null),ae=o(L,"providers",{whileLoading:!1}),ie=C(!!se&&ae),le=o(L,"groups",{whileLoading:!1}),{busy:ne,error:oe,run:te}=t(),de=oe??A.error,ue=e.useEffectEvent(e=>d("negative",f("rule.traceFailed"),u(e,f)));e.useEffect(()=>{de&&ue(de)},[de]);const pe=s.domain.trim()||s.dst_ip.trim()?s.dst_ip.trim()&&!r(s.dst_ip)?{field:"dst_ip",key:"ui.invalidIp"}:Y(s.dst_port)?s.src_ip.trim()&&!r(s.src_ip)?{field:"src_ip",key:"ui.invalidIp"}:s.src_port.trim()&&!Y(s.src_port)?{field:"src_port",key:"rule.invalidPort"}:!s.dscp.trim()||(me=s.dscp,/^\d+$/.test(me)&&Number(me)>=0&&Number(me)<=63)?"live"!==s.resolve&&"query"!==s.resolve||s.domain.trim()?"live"!==s.resolve&&"query"!==s.resolve||!s.dst_ip.trim()?null:{field:"dst_ip",key:"rule.invalidLive"}:{field:"domain",key:"rule.invalidLive"}:{field:"dscp",key:"rule.invalidDscp"}:{field:"dst_port",key:"rule.invalidPort"}:{field:"domain",key:"rule.invalidTarget"};var me;const ce=h?pe:null,je=A.data?.resources.routing_trace,ve=je?.resolve_modes??[],be=A.data?.resources.dns_query,he=be?.record_types,_e=e.useMemo(()=>(he??[]).filter(e=>"A"===e||"AAAA"===e),[he]),fe=be?.limits?.max_types_per_request??1,xe=[...ve,...!ve.includes("live")&&ve.includes("none")&&be?.available&&_e.length?["query"]:[]],ye=!1!==je?.available,ge=""!==s.domain.trim()&&!s.dst_ip.trim(),ke=s.resolve??(ge&&xe.includes("live")?"live":ge&&xe.includes("query")?"query":"none"),we=!pe&&ye&&xe.includes(ke),Ne=e.useCallback(async()=>{if(ne||!we)return;const e=function(e){const s=e=>r(e),a={network:e.network,dst_port:Number(e.dst_port),...e.domain.trim()?{domain:e.domain.trim()}:{dst_ip:s(e.dst_ip)}};return e.domain.trim()&&e.dst_ip.trim()&&(a.dst_ip=s(e.dst_ip)),e.src_ip.trim()&&(a.src_ip=s(e.src_ip)),e.src_port.trim()&&(a.src_port=Number(e.src_port)),e.pname.trim()&&(a.pname=e.pname.trim()),e.dscp.trim()&&(a.dscp=Number(e.dscp)),a}(s),a=await te("trace",s=>k({...y,dnsQuery:(e,r)=>M(y.dnsQuery,e,r,fe,s)},{input:e,resolve:ke,recordTypes:_e},s));re(a?{run:a,input:e}:null)},[y,ne,we,s,ke,_e,fe,te]),qe=K.data?.generation_id,Ce=e.useMemo(()=>se?.run.traces.flatMap(e=>e.evaluations.map(s=>({evaluation:s,traced:e.generation_id,current:qe===e.generation_id}))).map(({evaluation:e,traced:s,current:r},a)=>{const i=e.rules.find(e=>"matched"===e.result),l="determinate"!==e.decision&&!e.outbound&&r?(i&&ee.get(i.rule_id)?.outbound)??null:null,n=e.outbound??l,o=n&&!p(n)?m(n,se.input.network,J,U,X):null,t=R(e,a,se.input.domain??void 0,l,o,!!o?.node&&B(o.node).length>0,H.busy,f,x);return{...t,rows:t.rows.map(e=>({...e,href:$(e.id,r&&ee.has(e.id))})),links:V(o,le,ae?ie.data?.providers:[],f),seed:S(se.input,e,s)}})??[],[se,qe,ee,J,U,X,le,ae,ie.data,B,H.busy,f,x]),Me=e.useMemo(()=>se?{status:I(se.run.traces[0],se.run.query,f,x),query:se.run.query&&{...P(se.run.query,f,x),links:E(se.run.query.domain,L,f)},dns:se.run.traces.flatMap(e=>e.Line truncated
@@ -1 +1 @@
import{fA as t,bs as e,dx as i,fF as n,gg as s,gh as o,fM as r,fT as l,g7 as a,g9 as h,gi as d,f1 as u,gj as c}from"./index-CmbH0woS.js";import{r as y,$ as g,a as f}from"./vendor-react-64fcanlc.js";class p{constructor(t=0,e=0){this.x=t,this.y=e}copy(){return new p(this.x,this.y)}equals(t){return this.x===t.x&&this.y===t.y}isOrigin(){return 0===this.x&&0===this.y}}class w{constructor(t=0,e=0,i=0,n=0){this.x=t,this.y=e,this.width=i,this.height=n}get maxX(){return this.x+this.width}get maxY(){return this.y+this.height}get area(){return this.width*this.height}get topLeft(){return new p(this.x,this.y)}get topRight(){return new p(this.maxX,this.y)}get bottomLeft(){return new p(this.x,this.maxY)}get bottomRight(){return new p(this.maxX,this.maxY)}intersects(t){return this.area>0&&t.area>0&&this.x<=t.x+t.width&&t.x<=this.x+this.width&&this.y<=t.y+t.height&&t.y<=this.y+this.height}containsRect(t){return this.x<=t.x&&this.y<=t.y&&this.maxX>=t.maxX&&this.maxY>=t.maxY}containsPoint(t){return this.x<=t.x&&this.y<=t.y&&this.maxX>=t.x&&this.maxY>=t.y}getCornerInRect(t){for(let e of["topLeft","topRight","bottomLeft","bottomRight"])if(t.containsPoint(this[e]))return e;return null}equals(t){return t.x===this.x&&t.y===this.y&&t.width===this.width&&t.height===this.height}pointEquals(t){return this.x===t.x&&this.y===t.y}sizeEquals(t){return this.width===t.width&&this.height===t.height}union(t){let e=Math.min(this.x,t.x),i=Math.min(this.y,t.y),n=Math.max(this.maxX,t.maxX)-e,s=Math.max(this.maxY,t.maxY)-i;return new w(e,i,n,s)}intersection(t){if(!this.intersects(t))return new w(0,0,0,0);let e=Math.max(this.x,t.x),i=Math.max(this.y,t.y);return new w(e,i,Math.min(this.maxX,t.maxX)-e,Math.min(this.maxY,t.maxY)-i)}copy(){return new w(this.x,this.y,this.width,this.height)}}class z{constructor(t=0,e=0){this.width=Math.max(t,0),this.height=Math.max(e,0)}copy(){return new z(this.width,this.height)}equals(t){return this.width===t.width&&this.height===t.height}get area(){return this.width*this.height}}let v=0;class m{constructor(t,e){this.virtualizer=t,this.key=++v,this.viewType=e,this.children=new Set,this.reusableViews=new Map,this.layoutInfo=null,this.content=null,this.rendered=null}prepareForReuse(){this.content=null,this.rendered=null,this.layoutInfo=null}getReusableView(t){let e=this.reusableViews.get(t);return e&&e.length>0?e.shift():new b(this.virtualizer,this,t)}reuseChild(t){t.prepareForReuse();let e=this.reusableViews.get(t.viewType);e||(e=[],this.reusableViews.set(t.viewType,e)),e.push(t)}}class S extends m{constructor(t){super(t,"root")}}class b extends m{constructor(t,e,i){super(t,i),this.parent=e}}class x{setVisibleRect(t){let e=performance.now()-this.startTime;e<500&&(t.x!==this.visibleRect.x&&e>0&&(this.velocity.x=(t.x-this.visibleRect.x)/e),t.y!==this.visibleRect.y&&e>0&&(this.velocity.y=(t.y-this.visibleRect.y)/e)),this.startTime=performance.now(),this.visibleRect=t}getOverscannedRect(){let t=this.visibleRect.copy(),e=this.visibleRect.height/3;t.height+=e,this.velocity.y<0&&(t.y-=e);let i=this.visibleRect.width/3;return t.width+=i,this.velocity.x<0&&(t.x-=i),t}constructor(){this.startTime=0,this.velocity=new p(0,0),this.visibleRect=new w}}function I(t){return"x"===t?"width":"height"}function R(t,e,i,n,s){if("start"===i)return t[n]<=s;let o=I(n);return e[o]-(t[n]+t[o])<=s}function C(t,e,i,n,s,o,r,l,a,h){let d=t=>"x"===e?new w(t,a.y,a.width,a.height):new w(a.x,t,a.width,a.height);if(i){let t=function(t,e,i,n,s){let o=i(t.key);if(!o)return null;let r=o.rect[t.corner][e]-n[e]-t.offset;if(0===r)return null;let l=n[e]+r,a=I(e),h=Math.max(0,s[a]-n[a]),d=Math.max(0,Math.min(h,l));return d!==n[e]?d:null}(i,e,l,a,h);if(null!=t)return d(t)}if(n&&!s&&(!o||r>0)){let i=d(function(t,e,i,n){if("start"===t)return 0;let s=I(e);return Math.max(0,i[s]-n[s])}(t,e,h,a));return i.equals(a)?null:i}return null}class k{reset(){this.hasSnappedToEdge=!1,this.hadEstimatedVisibleItems=!1,this.wasNearAnchorEdge=!1}captureBeforeLayout(t,e,i){return t?function(t,e,i,n,s=()=>!0){let o=I(e),r=null;for(let[l,a]of n){if(!a||!s(a))continue;let n=a.rect.intersection(i)[o];if(a.rect.area>0&&n>=4){let n=a.rect.getCornerInRect(i)??"topLeft",s=a.rect[n][e]-i[e];(!r||("end"===t?s<r.offset:s>r.offset))&&(r={key:l,corner:n,offset:s})}}return r}(t.edge,t.axis,i,e,t.isAnchorable):null}resolveAfterLayout(t){let{anchorInfo:e,anchor:i,postLayoutInfos:n,previousVisibleRect:s,previousContentSize:o,contentSize:r,itemSizeChanged:l,isScrolling:a,getLayoutInfo:h}=t;if(!e)return null;let d=this.hadEstimatedVisibleItems,u=this.wasNearAnchorEdge,c=!1;for(let z of n.values())if(z.estimatedSize){c=!0;break}if(this.hadEstimatedVisibleItems=c,d||(this.wasNearAnchorEdge=R(s,o,e.edge,e.axis,e.threshold)),0===s.area)return null;let y="x"===e.axis?"width":"height",g=r[y]-o[y],f=!this.hasSnappedToEdge;if(this.hasSnappedToEdge=!0,!f&&0===g&&!l)return null;let p=f||d&&u||R(s,o,e.edge,e.axis,e.threshold);d||(this.wasNearAnchorEdge=p);let w=f||d&&u?null:i;return C(e.edge,e.axis,w,p,a,l,g,h,sLine truncated import{eg as t,bp as e,cN as i,el as n,eZ as s,e_ as o,es as r,ez as l,eP as a,eR as h,e$ as d,e6 as u,f0 as c}from"./index-ucpAK88B.js";import{r as y,$ as g,a as f}from"./vendor-react-64fcanlc.js";class p{constructor(t=0,e=0){this.x=t,this.y=e}copy(){return new p(this.x,this.y)}equals(t){return this.x===t.x&&this.y===t.y}isOrigin(){return 0===this.x&&0===this.y}}class w{constructor(t=0,e=0,i=0,n=0){this.x=t,this.y=e,this.width=i,this.height=n}get maxX(){return this.x+this.width}get maxY(){return this.y+this.height}get area(){return this.width*this.height}get topLeft(){return new p(this.x,this.y)}get topRight(){return new p(this.maxX,this.y)}get bottomLeft(){return new p(this.x,this.maxY)}get bottomRight(){return new p(this.maxX,this.maxY)}intersects(t){return this.area>0&&t.area>0&&this.x<=t.x+t.width&&t.x<=this.x+this.width&&this.y<=t.y+t.height&&t.y<=this.y+this.height}containsRect(t){return this.x<=t.x&&this.y<=t.y&&this.maxX>=t.maxX&&this.maxY>=t.maxY}containsPoint(t){return this.x<=t.x&&this.y<=t.y&&this.maxX>=t.x&&this.maxY>=t.y}getCornerInRect(t){for(let e of["topLeft","topRight","bottomLeft","bottomRight"])if(t.containsPoint(this[e]))return e;return null}equals(t){return t.x===this.x&&t.y===this.y&&t.width===this.width&&t.height===this.height}pointEquals(t){return this.x===t.x&&this.y===t.y}sizeEquals(t){return this.width===t.width&&this.height===t.height}union(t){let e=Math.min(this.x,t.x),i=Math.min(this.y,t.y),n=Math.max(this.maxX,t.maxX)-e,s=Math.max(this.maxY,t.maxY)-i;return new w(e,i,n,s)}intersection(t){if(!this.intersects(t))return new w(0,0,0,0);let e=Math.max(this.x,t.x),i=Math.max(this.y,t.y);return new w(e,i,Math.min(this.maxX,t.maxX)-e,Math.min(this.maxY,t.maxY)-i)}copy(){return new w(this.x,this.y,this.width,this.height)}}class z{constructor(t=0,e=0){this.width=Math.max(t,0),this.height=Math.max(e,0)}copy(){return new z(this.width,this.height)}equals(t){return this.width===t.width&&this.height===t.height}get area(){return this.width*this.height}}let v=0;class m{constructor(t,e){this.virtualizer=t,this.key=++v,this.viewType=e,this.children=new Set,this.reusableViews=new Map,this.layoutInfo=null,this.content=null,this.rendered=null}prepareForReuse(){this.content=null,this.rendered=null,this.layoutInfo=null}getReusableView(t){let e=this.reusableViews.get(t);return e&&e.length>0?e.shift():new b(this.virtualizer,this,t)}reuseChild(t){t.prepareForReuse();let e=this.reusableViews.get(t.viewType);e||(e=[],this.reusableViews.set(t.viewType,e)),e.push(t)}}class S extends m{constructor(t){super(t,"root")}}class b extends m{constructor(t,e,i){super(t,i),this.parent=e}}class x{setVisibleRect(t){let e=performance.now()-this.startTime;e<500&&(t.x!==this.visibleRect.x&&e>0&&(this.velocity.x=(t.x-this.visibleRect.x)/e),t.y!==this.visibleRect.y&&e>0&&(this.velocity.y=(t.y-this.visibleRect.y)/e)),this.startTime=performance.now(),this.visibleRect=t}getOverscannedRect(){let t=this.visibleRect.copy(),e=this.visibleRect.height/3;t.height+=e,this.velocity.y<0&&(t.y-=e);let i=this.visibleRect.width/3;return t.width+=i,this.velocity.x<0&&(t.x-=i),t}constructor(){this.startTime=0,this.velocity=new p(0,0),this.visibleRect=new w}}function I(t){return"x"===t?"width":"height"}function R(t,e,i,n,s){if("start"===i)return t[n]<=s;let o=I(n);return e[o]-(t[n]+t[o])<=s}function C(t,e,i,n,s,o,r,l,a,h){let d=t=>"x"===e?new w(t,a.y,a.width,a.height):new w(a.x,t,a.width,a.height);if(i){let t=function(t,e,i,n,s){let o=i(t.key);if(!o)return null;let r=o.rect[t.corner][e]-n[e]-t.offset;if(0===r)return null;let l=n[e]+r,a=I(e),h=Math.max(0,s[a]-n[a]),d=Math.max(0,Math.min(h,l));return d!==n[e]?d:null}(i,e,l,a,h);if(null!=t)return d(t)}if(n&&!s&&(!o||r>0)){let i=d(function(t,e,i,n){if("start"===t)return 0;let s=I(e);return Math.max(0,i[s]-n[s])}(t,e,h,a));return i.equals(a)?null:i}return null}class k{reset(){this.hasSnappedToEdge=!1,this.hadEstimatedVisibleItems=!1,this.wasNearAnchorEdge=!1}captureBeforeLayout(t,e,i){return t?function(t,e,i,n,s=()=>!0){let o=I(e),r=null;for(let[l,a]of n){if(!a||!s(a))continue;let n=a.rect.intersection(i)[o];if(a.rect.area>0&&n>=4){let n=a.rect.getCornerInRect(i)??"topLeft",s=a.rect[n][e]-i[e];(!r||("end"===t?s<r.offset:s>r.offset))&&(r={key:l,corner:n,offset:s})}}return r}(t.edge,t.axis,i,e,t.isAnchorable):null}resolveAfterLayout(t){let{anchorInfo:e,anchor:i,postLayoutInfos:n,previousVisibleRect:s,previousContentSize:o,contentSize:r,itemSizeChanged:l,isScrolling:a,getLayoutInfo:h}=t;if(!e)return null;let d=this.hadEstimatedVisibleItems,u=this.wasNearAnchorEdge,c=!1;for(let z of n.values())if(z.estimatedSize){c=!0;break}if(this.hadEstimatedVisibleItems=c,d||(this.wasNearAnchorEdge=R(s,o,e.edge,e.axis,e.threshold)),0===s.area)return null;let y="x"===e.axis?"width":"height",g=r[y]-o[y],f=!this.hasSnappedToEdge;if(this.hasSnappedToEdge=!0,!f&&0===g&&!l)return null;let p=f||d&&u||R(s,o,e.edge,e.axis,e.threshold);d||(this.wasNearAnchorEdge=p);let w=f||d&&u?null:i;return C(e.edge,e.axis,w,p,a,l,g,h,sLine truncated
@@ -1 +1 @@
.rp-dashboard{gap:var(--rp-space-6);flex-direction:column;display:flex}.rp-dashboard-cell{flex-direction:column;min-inline-size:0;display:flex}.rp-dashboard-cell>.rp-card,.rp-dashboard-body>.rp-card{flex:1}.rp-module-actions{gap:var(--rp-space-2);flex-wrap:wrap;align-self:flex-start;align-items:center;display:flex}.rp-module-actions>button{flex:none}.rp-module-option{gap:var(--rp-space-2) var(--rp-space-3);flex-flow:column wrap;align-items:start;display:flex}.rp-module-option>:last-child{flex:0 auto;max-inline-size:100%}.rp-module-inspector{gap:var(--rp-space-4);flex-direction:column;display:flex}.rp-dash-section{--rp-dash-gap:var(--rp-space-3);gap:var(--rp-dash-gap);grid-template-columns:minmax(0,1fr);align-items:stretch;display:grid}.rp-dash-section>*{container:rp-tile/inline-size}.rp-dash-section[data-profile=metrics],.rp-dash-section[data-profile=extensions]{grid-template-columns:repeat(2,minmax(0,1fr))}.rp-dash-section[data-profile=metrics]>:is([data-foot=end],[data-size=large]){grid-column:1/-1}@media (width<=599.98px){.rp-dash-section[data-profile=extensions]{grid-template-columns:minmax(0,1fr)}}@media (width>=600px) and (width<=1279.98px){.rp-dash-section[data-profile=extensions]>[data-size=large]{grid-column:1/-1}}@media (width>=640px){.rp-dash-section[data-profile=quick]{grid-template-columns:repeat(2,minmax(0,1fr))}.rp-dash-section[data-profile=quick]>[data-foot=lead]{grid-column:1/-1}}@media (width>=1024px){.rp-dash-section[data-profile=traffic]{grid-template-columns:minmax(0,2fr) minmax(0,1fr)}.rp-dash-section[data-profile=details]{grid-template-columns:repeat(2,minmax(0,1fr))}.rp-dash-section[data-profile=details]>:is([data-foot=end],[data-size=large]){grid-column:1/-1}}@media (width>=1100px){.rp-dash-section[data-profile=quick]{grid-template-columns:minmax(0,1.5fr) repeat(2,minmax(0,1fr))}.rp-dash-section[data-profile=quick]>[data-foot=lead]{grid-column:auto}.rp-dash-section[data-profile=metrics]{grid-template-columns:repeat(6,minmax(0,1fr))}.rp-dash-section[data-profile=metrics]>*{grid-column:span 2}.rp-dash-section[data-profile=metrics]>:is([data-foot=tail],[data-foot=end]){grid-column:span 3}.rp-dash-section[data-profile=metrics]>[data-size=large]{grid-column:span 4}}@media (width>=1280px){.rp-dash-section[data-profile=metrics]{grid-template-columns:repeat(5,minmax(0,1fr))}.rp-dash-section[data-profile=metrics]>:is(*,[data-foot]){grid-column:span 1}.rp-dash-section[data-profile=metrics]>[data-size=large]{grid-column:span 2}.rp-dash-section:is([data-profile=traffic],[data-profile=details],[data-profile=extensions]){grid-template-columns:repeat(12,minmax(0,1fr))}.rp-dash-section:is([data-profile=traffic],[data-profile=details],[data-profile=extensions])>*,.rp-dash-section[data-profile=details]>[data-foot=end]{grid-column:span 4}.rp-dash-section[data-profile=traffic]>:nth-child(odd of .rp-dashboard-cell),.rp-dash-section:is([data-profile=details],[data-profile=extensions])>[data-size=large]{grid-column:span 8}.rp-dash-section[data-profile=extensions]>[data-size=small]{grid-column:span 2}}.rp-dash-section[data-profile]>.rp-dashboard-cell[data-size=wide]{grid-column:1/-1}.rp-dash-section{--rp-dash-snap:none}@media (width>=768px){.rp-dash-section{--rp-dash-snap:6}.rp-dash-section:is([data-grid],[data-fit]){grid-template-columns:repeat(420,minmax(0,1fr));column-gap:0;margin-inline-start:calc(0px - var(--rp-dash-gap))}.rp-dash-section:is([data-grid],[data-fit])[data-profile]>.rp-dashboard-cell{grid-column:span var(--rp-chosen,var(--rp-span));margin-inline-start:var(--rp-dash-gap)}.rp-dash-section:is([data-grid],[data-fit])[data-profile]>.rp-dashboard-cell:not([data-width],[data-size=wide]){margin-inline-start:calc(var(--rp-dash-gap) * (1 - var(--rp-shift,0)));margin-inline-end:calc(var(--rp-dash-gap) * var(--rp-trim,0))}.rp-dash-section>*{--rp-span:210}.rp-dash-section:is([data-profile=traffic],[data-profile=details])>*,.rp-dash-section[data-profile=quick]>[data-foot=lead],.rp-dash-section[data-profile=metrics]>:is([data-foot=end],[data-size=large]),.rp-dash-section[data-profile=extensions]>[data-size=large]{--rp-span:420}.rp-dash-section>:is([data-width="1/5"],[data-width="1/4"],[data-width="1/3"]){--rp-chosen:140}.rp-dash-section>[data-width="1/2"]{--rp-chosen:210}.rp-dash-section>[data-width="2/3"]{--rp-chosen:280}.rp-dash-section>[data-width=full]{--rp-chosen:420}}@media (width>=1024px){.rp-dash-section[data-profile=traffic]>*{--rp-span:140}.rp-dash-section[data-profile=traffic]>:nth-child(odd of .rp-dashboard-cell){--rp-span:280}.rp-dash-section[data-profile=details]>*{--rp-span:210}.rp-dash-section[data-profile=details]>:is([data-foot=end],[data-size=large]){--rp-span:420}}@media (width>=1024px) and (width<=1279.98px){.rp-dash-section[data-profile=traffic]>:nth-child(odd of .rp-dashboard-cell){--rp-trim:1 / 3}.rp-dash-section[data-profile=traffic]>:nth-child(2n of .rp-dashboard-cell){--rp-shift:1 / 3}}@media (width>=1100px){.rp-dash-section[data-profile=quick]>*{--rp-span:120}.rp-dash-sectiLine truncated .rp-dashboard{gap:var(--rp-space-6);flex-direction:column;display:flex}.rp-dashboard-cell{flex-direction:column;min-inline-size:0;display:flex}.rp-dashboard-cell>.rp-card,.rp-dashboard-body>.rp-card{flex:1}.rp-module-actions{gap:var(--rp-space-2);flex-wrap:wrap;align-self:flex-start;align-items:center;display:flex}.rp-module-actions>button{flex:none}.rp-module-option{gap:var(--rp-space-2) var(--rp-space-3);flex-flow:column wrap;align-items:start;display:flex}.rp-module-option>:last-child{flex:0 auto;max-inline-size:100%}.rp-module-inspector{gap:var(--rp-space-4);flex-direction:column;display:flex}.rp-dash-section{--rp-dash-gap:var(--rp-space-3);gap:var(--rp-dash-gap);grid-template-columns:minmax(0,1fr);align-items:stretch;display:grid}.rp-dash-section>*{container:rp-tile/inline-size}.rp-dash-section[data-profile=metrics],.rp-dash-section[data-profile=extensions]{grid-template-columns:repeat(2,minmax(0,1fr))}.rp-dash-section[data-profile=metrics]>:is([data-foot=end],[data-size=large]){grid-column:1/-1}@media (width<=599.98px){.rp-dash-section[data-profile=extensions]{grid-template-columns:minmax(0,1fr)}}@media (width>=600px) and (width<=1279.98px){.rp-dash-section[data-profile=extensions]>[data-size=large]{grid-column:1/-1}}@media (width>=640px){.rp-dash-section[data-profile=quick]{grid-template-columns:repeat(2,minmax(0,1fr))}.rp-dash-section[data-profile=quick]>[data-foot=lead]{grid-column:1/-1}}@media (width>=1024px){.rp-dash-section[data-profile=traffic]{grid-template-columns:minmax(0,2fr) minmax(0,1fr)}.rp-dash-section[data-profile=details]{grid-template-columns:repeat(2,minmax(0,1fr))}.rp-dash-section[data-profile=details]>:is([data-foot=end],[data-size=large]){grid-column:1/-1}}@media (width>=1100px){.rp-dash-section[data-profile=quick]{grid-template-columns:minmax(0,1.5fr) repeat(2,minmax(0,1fr))}.rp-dash-section[data-profile=quick]>[data-foot=lead]{grid-column:auto}.rp-dash-section[data-profile=metrics]{grid-template-columns:repeat(6,minmax(0,1fr))}.rp-dash-section[data-profile=metrics]>*{grid-column:span 2}.rp-dash-section[data-profile=metrics]>:is([data-foot=tail],[data-foot=end]){grid-column:span 3}.rp-dash-section[data-profile=metrics]>[data-size=large]{grid-column:span 4}}@media (width>=1280px){.rp-dash-section[data-profile=metrics]{grid-template-columns:repeat(5,minmax(0,1fr))}.rp-dash-section[data-profile=metrics]>:is(*,[data-foot]){grid-column:span 1}.rp-dash-section[data-profile=metrics]>[data-size=large]{grid-column:span 2}.rp-dash-section:is([data-profile=traffic],[data-profile=details],[data-profile=extensions]){grid-template-columns:repeat(12,minmax(0,1fr))}.rp-dash-section:is([data-profile=traffic],[data-profile=details],[data-profile=extensions])>*,.rp-dash-section[data-profile=details]>[data-foot=end]{grid-column:span 4}.rp-dash-section[data-profile=traffic]>:nth-child(odd of .rp-dashboard-cell),.rp-dash-section:is([data-profile=details],[data-profile=extensions])>[data-size=large]{grid-column:span 8}.rp-dash-section[data-profile=extensions]>[data-size=small]{grid-column:span 2}}.rp-dash-section[data-profile]>.rp-dashboard-cell[data-size=wide]{grid-column:1/-1}.rp-dash-section{--rp-dash-snap:none}@media (width>=768px){.rp-dash-section{--rp-dash-snap:6}.rp-dash-section:is([data-grid],[data-fit]){grid-template-columns:repeat(420,minmax(0,1fr));column-gap:0;margin-inline-start:calc(0px - var(--rp-dash-gap))}.rp-dash-section:is([data-grid],[data-fit])[data-profile]>.rp-dashboard-cell{grid-column:span var(--rp-chosen,var(--rp-span));margin-inline-start:var(--rp-dash-gap)}.rp-dash-section:is([data-grid],[data-fit])[data-profile]>.rp-dashboard-cell:not([data-width],[data-size=wide]){margin-inline-start:calc(var(--rp-dash-gap) * (1 - var(--rp-shift,0)));margin-inline-end:calc(var(--rp-dash-gap) * var(--rp-trim,0))}.rp-dash-section>*{--rp-span:210}.rp-dash-section:is([data-profile=traffic],[data-profile=details])>*,.rp-dash-section[data-profile=quick]>[data-foot=lead],.rp-dash-section[data-profile=metrics]>:is([data-foot=end],[data-size=large]),.rp-dash-section[data-profile=extensions]>[data-size=large]{--rp-span:420}.rp-dash-section>:is([data-width="1/5"],[data-width="1/4"],[data-width="1/3"]){--rp-chosen:140}.rp-dash-section>[data-width="1/2"]{--rp-chosen:210}.rp-dash-section>[data-width="2/3"]{--rp-chosen:280}.rp-dash-section>[data-width=full]{--rp-chosen:420}}@media (width>=1024px){.rp-dash-section[data-profile=traffic]>*{--rp-span:140}.rp-dash-section[data-profile=traffic]>:nth-child(odd of .rp-dashboard-cell){--rp-span:280}.rp-dash-section[data-profile=details]>*{--rp-span:210}.rp-dash-section[data-profile=details]>:is([data-foot=end],[data-size=large]){--rp-span:420}}@media (width>=1024px) and (width<=1279.98px){.rp-dash-section[data-profile=traffic]>:nth-child(odd of .rp-dashboard-cell){--rp-trim:1 / 3}.rp-dash-section[data-profile=traffic]>:nth-child(2n of .rp-dashboard-cell){--rp-shift:1 / 3}}@media (width>=1100px){.rp-dash-section[data-profile=quick]>*{--rp-span:120}.rp-dash-sectiLine truncated
@@ -0,0 +1,2 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./AreaChart-CfbADfpV.js","./vendor-react-64fcanlc.js","./_commonjsHelpers-CXUWDbkB.js","./index-ucpAK88B.js","./index-o3F3WGy0.css","./AreaCurve-DQSHOSpG.js","./array-C0VuvQyb.js","./nodes-DqXrz-fh.js","./AppearanceControls-DmbIJj4H.js","./ItemText-CtNOgl4O.js","./logs-DjZPFUMm.js","./Select-2JXPV40Q.js","./Sparkline-BxjSV6x8.js","./Donut-Cpxfp8M4.js","./Editors-Z7PxKlO0.js","./GridList-DW6-BWSL.js","./Checkbox-eZH7dxup.js","./Delete-BwK55moY.js","./Editors-rPgk_VZK.css","./index-CESYffrj.js","./geodata-X0pHz03D.js","./auth-B88HGReK.js","./auth-B7YirLMe.js"])))=>i.map(i=>d[i]);
import{r as e,a as t,j as n}from"./vendor-react-64fcanlc.js";import{d as s,h as a,n as r,o as i,w as o,s as l,R as c,S as d,a as u,b as m,I as h,L as p,u as f,_ as g,c as b,e as x,N as v,T as y,f as j,g as w,i as k,j as N,B as M,E as _,C as S,k as C,l as E,P as L,m as z,p as R,q as O,r as P,t as A,v as q,x as I,y as T,z as D,A as H,D as F,F as B,G as $,H as V,J as W,K as U,M as G,O as K,Q as J,U as X,V as Y,W as Q,X as Z,Y as ee,Z as te,$ as ne,a0 as se,a1 as ae,a2 as re,a3 as ie,a4 as oe,a5 as le,a6 as ce,a7 as de,a8 as ue,a9 as me,aa as he,ab as pe,ac as fe,ad as ge,ae as be,af as xe,ag as ve,ah as ye,ai as je,aj as we,ak as ke,al as Ne,am as Me,an as _e,ao as Se,ap as Ce,aq as Ee,ar as Le,as as ze,at as Re,au as Oe,av as Pe,aw as Ae,ax as qe,ay as Ie,az as Te,aA as De,aB as He,aC as Fe,aD as Be,aE as $e,aF as Ve,aG as We,aH as Ue,aI as Ge,aJ as Ke,aK as Je,aL as Xe,aM as Ye,aN as Qe,aO as Ze,aP as et,aQ as tt,aR as nt,aS as st,aT as at,aU as rt,aV as it,aW as ot,aX as lt,aY as ct,aZ as dt,a_ as ut,a$ as mt,b0 as ht,b1 as pt,b2 as ft,b3 as gt,b4 as bt,b5 as xt,b6 as vt,b7 as yt,b8 as jt,b9 as wt,ba as kt,bb as Nt,bc as Mt,bd as _t,be as St,bf as Ct,bg as Et,bh as Lt,bi as zt,bj as Rt,bk as Ot,bl as Pt,bm as At,bn as qt,bo as It,bp as Tt,bq as Dt,br as Ht,bs as Ft,bt as Bt,bu as $t,bv as Vt,bw as Wt,bx as Ut}from"./index-ucpAK88B.js";import{r as Gt,c as Kt,s as Jt,h as Xt,d as Yt,i as Qt,a as Zt,b as en,e as tn,f as nn,g as sn,j as an,n as rn,u as on,k as ln,l as cn,p as dn,m as un,o as mn,q as hn,t as pn,v as fn,w as gn,x as bn,y as xn,z as vn,A as yn,B as jn}from"./nodes-DqXrz-fh.js";import{L as wn,C as kn,u as Nn,a as Mn,P as _n,S as Sn,T as Cn,b as En,c as Ln}from"./AppearanceControls-DmbIJj4H.js";import{W as zn,S as Rn,u as On,a as Pn,b as An,c as qn,e as In,d as Tn,l as Dn,f as Hn,g as Fn,h as Bn,i as $n,V as Vn,C as Wn,r as Un,K as Gn,D as Kn,j as Jn,M as Xn,$ as Yn,k as Qn,m as Zn,n as es}from"./logs-DjZPFUMm.js";import{I as ts,C as ns}from"./ItemText-CtNOgl4O.js";const ss={"missing-offline-dependency":"config.diagnostic.offlineMissing","offline-dependency-denied":"config.diagnostic.offlineDenied","invalid-offline-dependency":"config.diagnostic.offlineInvalid","unreadable-offline-dependency":"config.diagnostic.offlineUnreadable"},as=e=>Object.hasOwn(ss,e);function rs(e,t,n){return as(e.code)?{summary:t("config.diagnostic.offline",{reason:t(ss[e.code]),which:n?t("config.diagnostic.offlineGeodata",{files:n}):t("config.diagnostic.offlineUsual")})}:s(e,t)}const is=e=>[...new Set(e.flatMap(({item:e,message:t})=>e.message&&!t.includes(e.message)?[e.message]:[]))];function os(e,t){const n=e.map(e=>e.id===t?.id?t.content:e.content).flatMap(e=>void 0===e?[]:Gt(e));return[...new Map(n.map(({name:e,written:t})=>[t,{name:e,written:t}])).values()]}const ls=e=>"<redacted>"===e.path||""===e.path,cs=e=>ls(e)?"main"===e.kind?"config.dae":`${e.kind}-${e.id.slice(0,8)}.dae`:e.path.split("/").pop()||"config.dae";function ds(e,t){const n=e.find(e=>"main"===e.kind);if(!n)return null;const s=[n,...e.filter(e=>"include"===e.kind&&!ls(e))];return t&&!s.some(e=>e.id===t.id)?null:s.map(e=>({id:e.id,...ls(e)?{}:{path:e.path},content:e.id===t?.id?t.content:e.content}))}const us=e=>e.filter(e=>"error"===e.level&&"restart-required"===e.code).map(e=>({key:/\b[a-z][a-z0-9_]*(?:\.[a-z0-9_]+)+\b/.exec(e.message)?.[0]??(e.message||null),sourceId:e.source_id,line:e.line})),ms=e=>us(e).length,hs={main:"config.kind.main",include:"config.kind.include",subscription:"nodes.kind.subscription",generated:"config.kind.generated"},ps=(e,t)=>`${e}:${t}`;function fs(e,t){const n=e.indexOf(":"),s=e.slice(0,n);return n>0&&t.includes(s)?{kind:s,value:e.slice(n+1)}:null}const gs=(e,t)=>t&&e?a("rules",{tab:"list",rule:e}):void 0,bs=(e,t,n=!1)=>a("nodes",{provider:r(e,t),q:e.name,node:n?e.id??null:null});function xs(e,t){const n=e?.find(e=>e.name===t)?.id;return n?o("",{group:n}):""}function vs(e,t,n){const s=t?.find(t=>t.name===e);return s?{label:s.name,href:a("policies",{group:s.id})}:{label:i(e,n),href:null}}const ys=["network","domain","dst_ip","dst_port","src_ip","src_port","pname"],js=e=>o("",{tab:"trace",...Object.fromEntries(ys.map(t=>[t,e[t]||null]))});function ws(e){const t=new URLSearchParams(e),n=e=>t.get(e)??"";return n("domain")||n("dst_ip")?{network:"udp"===n("network")?"udp":"tcp",domain:n("domain"),dst_ip:n("dst_ip"),dst_port:n("dst_port"),src_ip:n("src_ip"),src_port:n("src_port"),pname:n("pname")}:null}const ks=a("settings",{card:"runtime"});function Ns(e,t=Kt){return e?fs(e,t):null}function Ms(e,t){const n=e.filter(e=>"main"===e.kind||"include"===e.kind);for(const s of n){const e=Jt(s.content).blocks.find(e=>e.name===t);if(e)return a("config",{tab:"source",source:s.id,line:String(e.line+1)})}return a("config",{tab:"source",source:n.find(e=>"main"===e.kind)?.id??null})}const _s=a("activity",{card:"mode"}),Ss=a("overview",{card:"limits"}),Cs=e=>a("nodes",{nodes:JSON.stringify(e)});let Es=!1;const Ls=new Set,zs={snapshot:()=>Es,set(e){Line truncated
@@ -1,2 +0,0 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./AreaChart-BzUHpDKh.js","./vendor-react-64fcanlc.js","./_commonjsHelpers-CXUWDbkB.js","./index-CmbH0woS.js","./index-suuKbZt8.css","./AreaCurve-DQSHOSpG.js","./array-C0VuvQyb.js","./ActionGroup-D3mQjUsw.js","./Select-BcN72K3H.js","./Sparkline-CZuc0EWA.js","./Donut-DQsAiHCN.js","./Editors-B0Mv3GSe.js","./GridList-ByMoT8kr.js","./Checkbox-f7Je53QZ.js","./Delete-CQeLz6oG.js","./Editors-rPgk_VZK.css","./index-1QTpRTgX.js","./geodata-X0pHz03D.js","./auth-FMvOBMnI.js","./auth-aj_VNWTT.js"])))=>i.map(i=>d[i]);
import{r as e,j as t,a as n}from"./vendor-react-64fcanlc.js";import{i as a,s as r,q as s,u as o,b as i,a as l,r as c,c as d,d as u,L as m,e as p,f as h,g as f,h as g,j as b,n as v,k as x,o as y,w,l as j,m as k,p as _,t as M,v as N,x as S,y as C,z as L,R as A,A as P,I as $,B as E,C as O,D as R,_ as z,N as T,T as H,E as D,F as I,G as q,H as B,J as F,K as W,M as G,S as U,O as V,P as K,Q as Z,U as J,V as X,W as Y,X as Q,Y as ee,Z as te,$ as ne,a0 as ae,a1 as re,a2 as se,a3 as oe,a4 as ie,a5 as le,a6 as ce,a7 as de,a8 as ue,a9 as me,aa as pe,ab as he,ac as fe,ad as ge,ae as be,af as ve,ag as xe,ah as ye,ai as we,aj as je,ak as ke,al as _e,am as Me,an as Ne,ao as Se,ap as Ce,aq as Le,ar as Ae,as as Pe,at as $e,au as Ee,av as Oe,aw as Re,ax as ze,ay as Te,az as He,aA as De,aB as Ie,aC as qe,aD as Be,aE as Fe,aF as We,aG as Ge,aH as Ue,aI as Ve,aJ as Ke,aK as Ze,aL as Je,aM as Xe,aN as Ye,aO as Qe,aP as et,aQ as tt,aR as nt,aS as at,aT as rt,aU as st,aV as ot,aW as it,aX as lt,aY as ct,aZ as dt,a_ as ut,a$ as mt,b0 as pt,b1 as ht,b2 as ft,b3 as gt,b4 as bt,b5 as vt,b6 as xt,b7 as yt,b8 as wt,b9 as jt,ba as kt,bb as _t,bc as Mt,bd as Nt,be as St,bf as Ct,bg as Lt,bh as At,bi as Pt,bj as $t,bk as Et,bl as Ot,bm as Rt,bn as zt,bo as Tt,bp as Ht,bq as Dt,br as It,bs as qt,bt as Bt,bu as Ft,bv as Wt,bw as Gt,bx as Ut,by as Vt,bz as Kt,bA as Zt,bB as Jt,bC as Xt,bD as Yt,bE as Qt,bF as en,bG as tn,bH as nn,bI as an,bJ as rn,bK as sn,bL as on,bM as ln,bN as cn,bO as dn,bP as un,bQ as mn,bR as pn}from"./index-CmbH0woS.js";import{W as hn,S as fn,u as gn,e as bn,l as vn,a as xn,b as yn,c as wn,d as jn,V as kn,C as _n,$ as Mn,f as Nn,g as Sn,M as Cn}from"./ActionGroup-D3mQjUsw.js";const Ln={blockAds:!1,blockQuic:!0,networkManagerDirect:!0},An=["# NetworkManager","pname(NetworkManager) -> direct"],Pn=["# dae presets: the LAN and multicast stay off the proxy","dip(224.0.0.0/3, 'ff00::/8') -> direct","dip(geoip:private) -> direct"],$n=["# Block UDP/443","l4proto(udp) && dport(443) -> block"],En=[...An,...Pn,...$n],On=["# Ads","domain(geosite:category-ads-all) -> block"],Rn=["# Google China services and mainland games","domain(geosite:google-cn, geosite:category-games@cn) -> direct"],zn=["# Mainland China","domain(geosite:cn) -> direct","dip(geoip:cn) -> direct"],Tn=e=>["# Telegram",`domain(geosite:telegram) -> ${e}`,`dip(geoip:telegram) -> ${e}`],Hn=e=>["# Overseas media",`domain(geosite:youtube, geosite:netflix, geosite:disney, geosite:hbo, geosite:primevideo, geosite:twitch, geosite:spotify) -> ${e}`],Dn=e=>["# GFW list",`domain(geosite:gfw) -> ${e}`],In="filter: !name('direct', 'block')",qn=(e,t,n,a=n[0])=>({name:e,label:t,lines:[`filter: group(${n.map(s).join(", ")})`,In,"policy: select",`default: ${s(a)}`]}),Bn=(e,t,n,a,r)=>({name:e,label:t,flag:n,lines:[`filter: name(regex: ${s(a)})${r?` && !name(regex: ${s(r)})`:""}`,"policy: min_moving_avg"]}),Fn={proxy:"rule.template.group.proxy",auto:"rule.template.group.auto",hk:["rule.template.group.hk","🇭🇰","港|HK|Hong Kong|HongKong"],jp:["rule.template.group.jp","🇯🇵","日|JP|Japan|Tokyo"],us:["rule.template.group.us","🇺🇸","美|US|United States|America"],tw:["rule.template.group.tw","🇹🇼","台|臺|TW|Taiwan"],sg:["rule.template.group.sg","🇸🇬","新加坡|獅城|狮城|SG|Singapore"],kr:["rule.template.group.kr","🇰🇷","韓|韩|KR|Korea"],cn:["rule.template.group.cn","🇨🇳",String.raw`(?i)回国|回國|中国|中國|大陆|大陸|(?:^|[^A-Za-z])(?:China|Mainland|CN)(?:[^A-Za-z]|$)`,String.raw`(?i)香港|澳门|澳門|台湾|台灣|臺灣|(?:^|[^A-Za-z])(?:HK|MO|TW)(?:[^A-Za-z]|$)|Hong ?Kong|Macau|Macao|Taiwan`],telegram:"rule.template.group.telegram",media:"rule.template.group.media",apple:"rule.template.group.apple",ai:"rule.template.group.ai",youtube:"rule.template.group.youtube",netflix:"rule.template.group.netflix",bahamut:"rule.template.group.bahamut"},Wn=qn("proxy",Fn.proxy,["auto"]),Gn={name:"auto",label:Fn.auto,lines:[In,"policy: min_moving_avg"]},Un=["hk","jp","us","tw","sg","kr"].map(e=>Bn(e,Fn[e][0],Fn[e][1],Fn[e][2])),Vn=[...Un,Bn("cn",...Fn.cn)],Kn=(e,t,n=["proxy","auto"],a)=>qn(e,t,n,a),Zn={global:{rules:[...En],fallback:"{group}",groups:[]},bypass:{rules:[...En,...Rn,...zn],fallback:"{group}",groups:[]},gfw:{rules:[...En,...Tn("{group}"),...Dn("{group}")],fallback:"direct",groups:[]},homebound:{rules:[...En,"# Mainland China","domain(geosite:cn) -> cn","dip(geoip:cn) -> cn"],fallback:"direct",groups:[Vn.at(-1)]},single:{rules:[...En,...Rn,...Tn("proxy"),...Hn("proxy"),...Dn("proxy"),...zn],fallback:"proxy",groups:[Wn,Gn]},services:{rules:[...En,...Rn,"# Microsoft","domain(geosite:microsoft) -> direct","# Apple","domain(geosite:apple) -> apple",...Tn("telegram"),...Hn("media"),...Dn("proxy"),...zn],fallback:"proxy",groups:[Wn,Gn,Kn("telegram",Fn.telegram),Kn("media",Fn.media),Kn("apple",Fn.apple)]},regions:{rules:[...En,...Rn,"# Microsoft","domain(geosite:microsoft) -> direct","# Apple","domain(geosite:apple) -> direct",...Tn("telegLine truncated
Loaded 100 of 246 files, more files were not shown because too many files have changed in this diff. Show more