git-ai-control 0.4.13 → 0.4.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.zh-CN.md +1 -1
- package/bin/git-ai-control.js +13 -3
- package/package.json +2 -1
- package/scripts/install.mjs +41 -6
- package/server.py +8 -0
- package/static/assets/{index-4-vuUlOm.js → index-oco9luAC.js} +1 -1
- package/static/index.html +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
本项目的所有重要变更都会记录在此文件中。
|
|
4
4
|
|
|
5
|
+
## [0.4.14] - 2026-09-09
|
|
6
|
+
|
|
7
|
+
### 修复
|
|
8
|
+
|
|
9
|
+
- `npx git-ai-control` 发现正在运行的配置中心版本低于当前 npm 包时,自动安装新版并重启本机服务;旧版没有版本标记时也会自动升级。
|
|
10
|
+
|
|
11
|
+
### 变更
|
|
12
|
+
|
|
13
|
+
- npm 包补充作者元数据为 `yingyanzhitong`,保留 GitHub Actions OIDC Trusted Publishing 的供应链签名。
|
|
14
|
+
|
|
5
15
|
## [0.4.13] - 2026-09-09
|
|
6
16
|
|
|
7
17
|
### 新增
|
package/README.zh-CN.md
CHANGED
|
@@ -51,7 +51,7 @@ Windows: %USERPROFILE%\.git-ai\bin\git-ai.exe
|
|
|
51
51
|
npx git-ai-control
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
首次运行时,该命令会自动下载最新版本、安装本机服务,并打开 Git AI
|
|
54
|
+
首次运行时,该命令会自动下载最新版本、安装本机服务,并打开 Git AI 配置中心;之后若检测到正在运行的旧版本,会自动更新文件并重启本机服务,版本相同才复用现有进程。若浏览器没有自动打开,可手动访问:
|
|
55
55
|
|
|
56
56
|
```text
|
|
57
57
|
http://127.0.0.1:38742
|
package/bin/git-ai-control.js
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import {spawnSync} from "node:child_process"
|
|
4
|
+
import fs from "node:fs"
|
|
4
5
|
import path from "node:path"
|
|
5
6
|
import {fileURLToPath} from "node:url"
|
|
6
7
|
|
|
7
8
|
import {browserCommand} from "../scripts/platform-services.mjs"
|
|
8
|
-
import {
|
|
9
|
+
import {controlPanelNeedsUpdate, controlPanelStatus} from "../scripts/install.mjs"
|
|
9
10
|
|
|
10
11
|
const command = process.argv[2]
|
|
11
12
|
const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..")
|
|
12
13
|
const controlPanelUrl = "http://127.0.0.1:38742"
|
|
14
|
+
const packageVersion = JSON.parse(
|
|
15
|
+
fs.readFileSync(path.join(packageRoot, "package.json"), "utf8"),
|
|
16
|
+
).version
|
|
13
17
|
|
|
14
18
|
function printHelp() {
|
|
15
19
|
console.log(`Git AI Control Panel
|
|
@@ -37,8 +41,14 @@ try {
|
|
|
37
41
|
await uninstall()
|
|
38
42
|
process.exit(0)
|
|
39
43
|
}
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
44
|
+
const status = await controlPanelStatus()
|
|
45
|
+
if (!status) {
|
|
46
|
+
const {install} = await import("../scripts/install.mjs")
|
|
47
|
+
await install()
|
|
48
|
+
} else if (controlPanelNeedsUpdate(status.controlPanelVersion, packageVersion)) {
|
|
49
|
+
console.log(
|
|
50
|
+
`检测到新版本 ${packageVersion},正在从 ${status.controlPanelVersion || "旧版"} 更新并重启服务`,
|
|
51
|
+
)
|
|
42
52
|
const {install} = await import("../scripts/install.mjs")
|
|
43
53
|
await install()
|
|
44
54
|
} else {
|
package/package.json
CHANGED
package/scripts/install.mjs
CHANGED
|
@@ -42,6 +42,14 @@ const ROUTE_KEYS = {
|
|
|
42
42
|
}
|
|
43
43
|
const CONTROL_PANEL_STATUS_URL = "http://127.0.0.1:38742/api/status"
|
|
44
44
|
|
|
45
|
+
function packageVersion() {
|
|
46
|
+
const metadata = readJson(path.join(PROJECT_ROOT, "package.json"), {})
|
|
47
|
+
if (typeof metadata.version !== "string" || !metadata.version.trim()) {
|
|
48
|
+
throw new Error("无法识别当前 git-ai-control 版本")
|
|
49
|
+
}
|
|
50
|
+
return metadata.version.trim()
|
|
51
|
+
}
|
|
52
|
+
|
|
45
53
|
function run(command, args, options = {}) {
|
|
46
54
|
const result = spawnSync(command, args, {
|
|
47
55
|
encoding: "utf8",
|
|
@@ -207,7 +215,7 @@ function configureCustomMetrics(gitAiRoot) {
|
|
|
207
215
|
writeJsonAtomic(metricsPath, {...config, ...LOCAL_ENDPOINTS})
|
|
208
216
|
}
|
|
209
217
|
|
|
210
|
-
function copyRuntime(gitAiRoot) {
|
|
218
|
+
function copyRuntime(gitAiRoot, version) {
|
|
211
219
|
const controlPanelDir = path.join(gitAiRoot, "control-panel")
|
|
212
220
|
const filterDir = path.join(gitAiRoot, "filters")
|
|
213
221
|
fs.mkdirSync(controlPanelDir, {recursive: true})
|
|
@@ -224,6 +232,7 @@ function copyRuntime(gitAiRoot) {
|
|
|
224
232
|
fs.cpSync(path.join(PROJECT_ROOT, "static"), path.join(controlPanelDir, "static"), {
|
|
225
233
|
recursive: true,
|
|
226
234
|
})
|
|
235
|
+
writeJsonAtomic(path.join(controlPanelDir, "runtime.json"), {version})
|
|
227
236
|
if (process.platform !== "win32") {
|
|
228
237
|
fs.chmodSync(path.join(controlPanelDir, "server.py"), 0o700)
|
|
229
238
|
fs.chmodSync(path.join(filterDir, "plugin_filter_runtime.py"), 0o700)
|
|
@@ -387,13 +396,13 @@ async function waitForHttp(url, label) {
|
|
|
387
396
|
throw new Error(`${label}启动失败:${url}`)
|
|
388
397
|
}
|
|
389
398
|
|
|
390
|
-
export async function
|
|
399
|
+
export async function controlPanelStatus(url = CONTROL_PANEL_STATUS_URL) {
|
|
391
400
|
const controller = new AbortController()
|
|
392
401
|
const timeout = setTimeout(() => controller.abort(), 1_500)
|
|
393
402
|
try {
|
|
394
403
|
const response = await fetch(url, {signal: controller.signal})
|
|
395
404
|
if (!response.ok) {
|
|
396
|
-
return
|
|
405
|
+
return null
|
|
397
406
|
}
|
|
398
407
|
const status = await response.json()
|
|
399
408
|
return (
|
|
@@ -401,14 +410,39 @@ export async function controlPanelIsRunning(url = CONTROL_PANEL_STATUS_URL) {
|
|
|
401
410
|
typeof status === "object" &&
|
|
402
411
|
typeof status.distribution === "string" &&
|
|
403
412
|
typeof status.gitAiStatus === "string"
|
|
404
|
-
)
|
|
413
|
+
) ? status : null
|
|
405
414
|
} catch {
|
|
406
|
-
return
|
|
415
|
+
return null
|
|
407
416
|
} finally {
|
|
408
417
|
clearTimeout(timeout)
|
|
409
418
|
}
|
|
410
419
|
}
|
|
411
420
|
|
|
421
|
+
export async function controlPanelIsRunning(url = CONTROL_PANEL_STATUS_URL) {
|
|
422
|
+
return Boolean(await controlPanelStatus(url))
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
export function controlPanelNeedsUpdate(installedVersion, packageVersion) {
|
|
426
|
+
if (typeof installedVersion !== "string" || !installedVersion.trim()) {
|
|
427
|
+
return true
|
|
428
|
+
}
|
|
429
|
+
const parseVersion = (value) => {
|
|
430
|
+
const match = value.trim().match(/^(\d+)\.(\d+)\.(\d+)$/)
|
|
431
|
+
return match ? match.slice(1).map(Number) : null
|
|
432
|
+
}
|
|
433
|
+
const installed = parseVersion(installedVersion)
|
|
434
|
+
const available = parseVersion(packageVersion)
|
|
435
|
+
if (!installed || !available) {
|
|
436
|
+
return false
|
|
437
|
+
}
|
|
438
|
+
for (let index = 0; index < available.length; index += 1) {
|
|
439
|
+
if (available[index] !== installed[index]) {
|
|
440
|
+
return available[index] > installed[index]
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
return false
|
|
444
|
+
}
|
|
445
|
+
|
|
412
446
|
export async function install(options = {}) {
|
|
413
447
|
const platform = options.platform ?? process.platform
|
|
414
448
|
if (!["darwin", "linux", "win32"].includes(platform)) {
|
|
@@ -418,6 +452,7 @@ export async function install(options = {}) {
|
|
|
418
452
|
options.gitAiRoot ?? process.env.GIT_AI_ROOT ?? path.join(os.homedir(), ".git-ai"),
|
|
419
453
|
)
|
|
420
454
|
const pythonCommand = options.pythonCommand ?? findPython(platform)
|
|
455
|
+
const version = packageVersion()
|
|
421
456
|
const binary = gitAiBinaryCandidates(gitAiRoot, platform).find(fs.existsSync)
|
|
422
457
|
if (!binary) {
|
|
423
458
|
throw new Error(
|
|
@@ -459,7 +494,7 @@ export async function install(options = {}) {
|
|
|
459
494
|
console.log("检测到官方上游版:保留原生配置管理,不修改无效的 custom_metrics.json")
|
|
460
495
|
}
|
|
461
496
|
|
|
462
|
-
copyRuntime(gitAiRoot)
|
|
497
|
+
copyRuntime(gitAiRoot, version)
|
|
463
498
|
run(pythonCommand[0], [
|
|
464
499
|
...pythonCommand.slice(1),
|
|
465
500
|
"-m",
|
package/server.py
CHANGED
|
@@ -35,6 +35,7 @@ FILTER_HEALTH_URL = "http://127.0.0.1:38741/health"
|
|
|
35
35
|
FILTER_MAC_LABEL = "com.git-ai.skill-usage-filter"
|
|
36
36
|
FILTER_LINUX_UNIT = "git-ai-filter.service"
|
|
37
37
|
FILTER_WINDOWS_TASK = "GitAIFilter"
|
|
38
|
+
CONTROL_PANEL_RUNTIME_PATH = APP_ROOT / "runtime.json"
|
|
38
39
|
|
|
39
40
|
NATIVE_FIELDS = {
|
|
40
41
|
"git_path",
|
|
@@ -564,6 +565,12 @@ def git_ai_updated_at() -> str:
|
|
|
564
565
|
return ""
|
|
565
566
|
|
|
566
567
|
|
|
568
|
+
def control_panel_version() -> str:
|
|
569
|
+
metadata = read_json(CONTROL_PANEL_RUNTIME_PATH, {})
|
|
570
|
+
version = metadata.get("version") if isinstance(metadata, dict) else ""
|
|
571
|
+
return version if isinstance(version, str) else ""
|
|
572
|
+
|
|
573
|
+
|
|
567
574
|
@lru_cache(maxsize=1)
|
|
568
575
|
def custom_metrics_supported() -> bool:
|
|
569
576
|
binary = git_ai_binary_path()
|
|
@@ -627,6 +634,7 @@ def runtime_status() -> dict:
|
|
|
627
634
|
"platform": platform.system().lower(),
|
|
628
635
|
"gitAiVersion": git_ai_version(),
|
|
629
636
|
"gitAiUpdatedAt": git_ai_updated_at(),
|
|
637
|
+
"controlPanelVersion": control_panel_version(),
|
|
630
638
|
"paths": {
|
|
631
639
|
"nativeConfig": str(NATIVE_CONFIG_PATH),
|
|
632
640
|
"policyConfig": str(POLICY_CONFIG_PATH),
|
|
@@ -47,4 +47,4 @@ Error generating stack: `+e.message+`
|
|
|
47
47
|
.block-interactivity-${e} {pointer-events: none;}
|
|
48
48
|
.allow-interactivity-${e} {pointer-events: all;}
|
|
49
49
|
`},cs=0,ls=[];function us(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(cs++)[0],a=_.useState(Mo)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=so([e.lockRef.current],(e.shards||[]).map(as),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=_.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=rs(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Xo(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Xo(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return ns(h,t,e,h===`h`?s:c,!0)},[]),c=_.useCallback(function(e){var n=e;if(!(!ls.length||ls[ls.length-1]!==a)){var r=`deltaY`in n?is(n):rs(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&os(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(as).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=_.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:ds(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=_.useCallback(function(e){n.current=rs(e),r.current=void 0},[]),d=_.useCallback(function(t){l(t.type,is(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){l(t.type,rs(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return ls.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Go),document.addEventListener(`touchmove`,c,Go),document.addEventListener(`touchstart`,u,Go),function(){ls=ls.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Go),document.removeEventListener(`touchmove`,c,Go),document.removeEventListener(`touchstart`,u,Go)}},[]);var p=e.removeScrollBar,m=e.inert;return _.createElement(_.Fragment,null,m?_.createElement(a,{styles:ss(i)}):null,p?_.createElement(Ho,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ds(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var fs=xo(So,us),ps=_.forwardRef(function(e,t){return _.createElement(wo,ao({},e,{ref:t,sideCar:fs}))});ps.classNames=wo.classNames;var ms=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},hs=new WeakMap,gs=new WeakMap,_s={},vs=0,ys=function(e){return e&&(e.host||ys(e.parentNode))},bs=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=ys(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},xs=function(e,t,n,r){var i=bs(t,Array.isArray(e)?e:[e]);_s[n]||(_s[n]=new WeakMap);var a=_s[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(hs.get(e)||0)+1,l=(a.get(e)||0)+1;hs.set(e,c),a.set(e,l),o.push(e),c===1&&i&&gs.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),vs++,function(){o.forEach(function(e){var t=hs.get(e)-1,i=a.get(e)-1;hs.set(e,t),a.set(e,i),t||(gs.has(e)||e.removeAttribute(r),gs.delete(e)),i||e.removeAttribute(n)}),vs--,vs||(hs=new WeakMap,hs=new WeakMap,gs=new WeakMap,_s={})}},Ss=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||ms(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),xs(r,i,n,`aria-hidden`)):function(){return null}},Cs=Object.defineProperty,ws=(e,t)=>Cs(e,`name`,{value:t,configurable:!0}),Ts=`Dialog`,[Es,Ds]=_i(Ts),[Os,ks]=Es(Ts),As=ws(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=_.useRef(null),c=_.useRef(null),[l,u]=qi({prop:r,defaultProp:i??!1,onChange:a,caller:Ts}),[d,f]=_.useState(0),[p,m]=_.useState(0);return(0,S.jsx)(Os,{scope:t,triggerRef:s,contentRef:c,contentId:da(),titleId:da(),descriptionId:da(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:_.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),js=`DialogTrigger`,Ms=_.forwardRef(ws(function(e,t){let{__scopeDialog:n,...r}=e,i=ks(js,n),a=Wr(t,i.triggerRef);return(0,S.jsx)(B.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Qs(i.open),...r,ref:a,onClick:H(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),Ns=`DialogPortal`,[Ps,Fs]=Es(Ns,{forceMount:void 0}),Is=ws(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ks(Ns,t);return(0,S.jsx)(Ps,{scope:t,forceMount:n,children:_.Children.map(r,e=>(0,S.jsx)(ta,{present:n||a.open,children:(0,S.jsx)(Za,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Ls=`DialogOverlay`,Rs=_.forwardRef(ws(function(e,t){let n=Fs(Ls,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ks(Ls,e.__scopeDialog);return a.modal?(0,S.jsx)(ta,{present:r||a.open,children:(0,S.jsx)(Bs,{...i,ref:t})}):null},`DialogOverlay`)),zs=qr(`DialogOverlay.RemoveScroll`),Bs=_.forwardRef(ws(function(e,t){let{__scopeDialog:n,...r}=e,i=ks(Ls,n),a=Wr(t,Da());return(0,S.jsx)(ps,{as:zs,allowPinchZoom:!0,shards:[i.contentRef],children:(0,S.jsx)(B.div,{"data-state":Qs(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Vs=`DialogContent`,Hs=_.forwardRef(ws(function(e,t){let n=Fs(Vs,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ks(Vs,e.__scopeDialog);return(0,S.jsx)(ta,{present:r||a.open,children:a.modal?(0,S.jsx)(Us,{...i,ref:t}):(0,S.jsx)(Ws,{...i,ref:t})})},`DialogContent`)),Us=_.forwardRef(ws(function(e,t){let n=ks(Vs,e.__scopeDialog),r=_.useRef(null),i=Wr(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return Ss(e)},[]),(0,S.jsx)(Gs,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:H(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:H(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Ws=_.forwardRef(ws(function(e,t){let n=ks(Vs,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return(0,S.jsx)(Gs,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Gs=_.forwardRef(ws(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=ks(Vs,n);return ro(),(0,S.jsx)(S.Fragment,{children:(0,S.jsx)(Ra,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,S.jsx)(Ea,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Qs(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),Ks=`DialogTitle`,qs=_.forwardRef(ws(function(e,t){let{__scopeDialog:n,...r}=e,i=ks(Ks,n),{setTitleCount:a}=i;return Ri(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,S.jsx)(B.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Js=`DialogDescription`,Ys=_.forwardRef(ws(function(e,t){let{__scopeDialog:n,...r}=e,i=ks(Js,n),{setDescriptionCount:a}=i;return Ri(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,S.jsx)(B.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Xs=`DialogClose`,Zs=_.forwardRef(ws(function(e,t){let{__scopeDialog:n,...r}=e,i=ks(Xs,n);return(0,S.jsx)(B.button,{type:`button`,...r,ref:t,onClick:H(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Qs(e){return e?`open`:`closed`}ws(Qs,`getState`);var $s=Object.defineProperty,ec=(e,t)=>$s(e,`name`,{value:t,configurable:!0}),[tc,nc]=_i(`AlertDialog`,[Ds]),rc=Ds(),ic=ec(e=>{let{__scopeAlertDialog:t,...n}=e,r=rc(t);return(0,S.jsx)(As,{...r,...n,modal:!0})},`AlertDialog`),ac=_.forwardRef(ec(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=rc(n);return(0,S.jsx)(Ms,{...i,...r,ref:t})},`AlertDialogTrigger`)),oc=ec(e=>{let{__scopeAlertDialog:t,...n}=e,r=rc(t);return(0,S.jsx)(Is,{...r,...n})},`AlertDialogPortal`),sc=_.forwardRef(ec(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=rc(n);return(0,S.jsx)(Rs,{...i,...r,ref:t})},`AlertDialogOverlay`)),[cc,lc]=tc(`AlertDialogContent`),uc=_.forwardRef(ec(function(e,t){let{__scopeAlertDialog:n,children:r,...i}=e,a=rc(n),o=Wr(t,_.useRef(null)),s=_.useRef(null);return(0,S.jsx)(cc,{scope:n,cancelRef:s,children:(0,S.jsx)(Hs,{role:`alertdialog`,...a,...i,ref:o,onOpenAutoFocus:H(i.onOpenAutoFocus,e=>{e.preventDefault(),s.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),dc=_.forwardRef(ec(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=rc(n);return(0,S.jsx)(qs,{...i,...r,ref:t})},`AlertDialogTitle`)),fc=_.forwardRef(ec(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=rc(n);return(0,S.jsx)(Ys,{...i,...r,ref:t})},`AlertDialogDescription`)),pc=_.forwardRef(ec(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=rc(n);return(0,S.jsx)(Zs,{...i,...r,ref:t})},`AlertDialogAction`)),mc=`AlertDialogCancel`,hc=_.forwardRef(ec(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=lc(mc,n),a=rc(n),o=Wr(t,i);return(0,S.jsx)(Zs,{...a,...r,ref:o})},`AlertDialogCancel`)),gc=ic,_c=ac,vc=oc,yc=sc,bc=uc,xc=pc,Sc=hc,Cc=dc,wc=fc,Tc=Object.defineProperty,Ec=(e,t)=>Tc(e,`name`,{value:t,configurable:!0});function Dc(e){let[t,n]=_.useState(void 0);return Ri(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}Ec(Dc,`useSize`);var Oc=[`top`,`right`,`bottom`,`left`],kc=Math.min,Ac=Math.max,jc=Math.round,Mc=Math.floor,Nc=e=>({x:e,y:e}),Pc={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Fc(e,t,n){return Ac(e,kc(t,n))}function Ic(e,t){return typeof e==`function`?e(t):e}function Lc(e){return e.split(`-`)[0]}function W(e){return e.split(`-`)[1]}function Rc(e){return e===`x`?`y`:`x`}function zc(e){return e===`y`?`height`:`width`}function Bc(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Vc(e){return Rc(Bc(e))}function Hc(e,t,n){n===void 0&&(n=!1);let r=W(e),i=Vc(e),a=zc(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Zc(o)),[o,Zc(o)]}function Uc(e){let t=Zc(e);return[Wc(e),t,Wc(t)]}function Wc(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Gc=[`left`,`right`],Kc=[`right`,`left`],qc=[`top`,`bottom`],Jc=[`bottom`,`top`];function Yc(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Kc:Gc:t?Gc:Kc;case`left`:case`right`:return t?qc:Jc;default:return[]}}function Xc(e,t,n,r){let i=W(e),a=Yc(Lc(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Wc)))),a}function Zc(e){let t=Lc(e);return Pc[t]+e.slice(t.length)}function Qc(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function $c(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Qc(e)}function el(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function tl(e,t,n){let{reference:r,floating:i}=e,a=Bc(t),o=Vc(t),s=zc(o),c=Lc(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=W(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function nl(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Ic(t,e),p=$c(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=el(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=el(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var rl=50,il=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:nl},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=tl(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<rl&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=tl(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},al=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Ic(e,t)||{};if(l==null)return{};let d=$c(u),f={x:n,y:r},p=Vc(i),m=zc(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=kc(d[_],T),D=kc(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,ee=Fc(E,k,O),A=!c.arrow&&W(i)!=null&&k!==ee&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,te=A?k<E?k-E:k-O:0;return{[p]:f[p]+te,data:{[p]:ee,centerOffset:k-ee-te,...A&&{alignmentOffset:te}},reset:A}}}),ol=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Ic(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Lc(r),_=Bc(o),v=Lc(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Zc(o)]:Uc(o)),x=p!==`none`;!d&&x&&b.push(...Xc(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Hc(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Bc(t))||T.every(e=>Bc(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Bc(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function sl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cl(e){return Oc.some(t=>e[t]>=0)}var ll=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Ic(e,t);switch(i){case`referenceHidden`:{let e=sl(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:cl(e)}}}case`escaped`:{let e=sl(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:cl(e)}}}default:return{}}}}},ul=new Set([`left`,`top`]);async function dl(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Lc(n),s=W(n),c=Bc(n)===`y`,l=ul.has(o)?-1:1,u=a&&c?-1:1,d=Ic(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var fl=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await dl(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},pl=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Ic(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Bc(i),p=Rc(f),m=u[p],h=u[f],g=(e,t)=>Fc(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},ml=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Ic(e,t),u={x:n,y:r},d=Bc(i),f=Rc(d),p=u[f],m=u[d],h=Ic(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ul.has(Lc(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},hl=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Ic(e,t),c=await i.detectOverflow(t,s),l=Lc(n),u=W(n),d=Bc(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=kc(p-c[m],g),y=kc(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Ac(c.left,c.right):S=p-2*Ac(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function gl(){return typeof window<`u`}function _l(e){return bl(e)?(e.nodeName||``).toLowerCase():`#document`}function vl(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yl(e){return((bl(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function bl(e){return gl()?e instanceof Node||e instanceof vl(e).Node:!1}function xl(e){return gl()?e instanceof Element||e instanceof vl(e).Element:!1}function Sl(e){return gl()?e instanceof HTMLElement||e instanceof vl(e).HTMLElement:!1}function Cl(e){return!gl()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof vl(e).ShadowRoot}function wl(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Fl(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Tl(e){return/^(table|td|th)$/.test(_l(e))}function El(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Dl=/transform|translate|scale|rotate|perspective|filter/,Ol=/paint|layout|strict|content/,kl=e=>!!e&&e!==`none`,Al;function jl(e){let t=xl(e)?Fl(e):e;return kl(t.transform)||kl(t.translate)||kl(t.scale)||kl(t.rotate)||kl(t.perspective)||!Nl()&&(kl(t.backdropFilter)||kl(t.filter))||Dl.test(t.willChange||``)||Ol.test(t.contain||``)}function Ml(e){let t=Ll(e);for(;Sl(t)&&!Pl(t);){if(jl(t))return t;if(El(t))return null;t=Ll(t)}return null}function Nl(){return Al??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Al}function Pl(e){return/^(html|body|#document)$/.test(_l(e))}function Fl(e){return vl(e).getComputedStyle(e)}function Il(e){return xl(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ll(e){if(_l(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Cl(e)&&e.host||yl(e);return Cl(t)?t.host:t}function Rl(e){let t=Ll(e);return Pl(t)?(e.ownerDocument||e).body:Sl(t)&&wl(t)?t:Rl(t)}function zl(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Rl(e),i=r===e.ownerDocument?.body,a=vl(r);if(i){let e=G(a);return t.concat(a,a.visualViewport||[],wl(r)?r:[],e&&n?zl(e):[])}else return t.concat(r,zl(r,[],n))}function G(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Bl(e){let t=Fl(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Sl(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=jc(n)!==a||jc(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function K(e){return xl(e)?e:e.contextElement}function q(e){let t=K(e);if(!Sl(t))return Nc(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Bl(t),o=(a?jc(n.width):n.width)/r,s=(a?jc(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Vl=Nc(0);function Hl(e){let t=vl(e);return!Nl()||!t.visualViewport?Vl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ul(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===vl(e)}function Wl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=K(e),o=Nc(1);t&&(r?xl(r)&&(o=q(r)):o=q(e));let s=Ul(a,n,r)?Hl(a):Nc(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=vl(a),t=xl(r)?vl(r):r,n=e,i=G(n);for(;i&&t!==n;){let e=q(i),t=i.getBoundingClientRect(),r=Fl(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=vl(i),i=G(n)}}return el({width:u,height:d,x:c,y:l})}function Gl(e,t){let n=Il(e).scrollLeft;return t?t.left+n:Wl(yl(e)).left+n}function Kl(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Gl(e,n),y:n.top+t.scrollTop}}function ql(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=yl(r),s=t?El(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Nc(1),u=Nc(0),d=Sl(r);if((d||!a)&&((_l(r)!==`body`||wl(o))&&(c=Il(r)),d)){let e=Wl(r);l=q(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Kl(o,c):Nc(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Jl(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Yl(e){let t=Il(e),n=e.ownerDocument.body,r=Ac(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Ac(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Gl(e),o=-t.scrollTop;return Fl(n).direction===`rtl`&&(a+=Ac(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Xl=25;function Zl(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=vl(e),a=yl(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Nl()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Gl(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Xl&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Ql(e,t){let n=Wl(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=q(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function $l(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Zl(e,n,t);else if(t===`document`)r=Yl(yl(e));else if(xl(t))r=Ql(t,n);else{let n=Hl(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return el(r)}function eu(e,t){let n=t.get(e);if(n)return n;let r=zl(e,[],!1).filter(e=>xl(e)&&_l(e)!==`body`),i=null,a=Fl(e).position===`fixed`,o=a?Ll(e):e;for(;xl(o)&&!Pl(o);){let e=Fl(o),t=jl(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Ll(o)}return t.set(e,r),r}function tu(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?El(t)?[]:eu(t,this._c):[].concat(n),r],o=$l(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=$l(t,a[e],i);s=Ac(n.top,s),c=kc(n.right,c),l=kc(n.bottom,l),u=Ac(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function nu(e){let{width:t,height:n}=Bl(e);return{width:t,height:n}}function ru(e,t,n){let r=Sl(t),i=yl(t),a=n===`fixed`,o=Wl(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Nc(0);if((r||!a)&&((_l(t)!==`body`||wl(i))&&(s=Il(t)),r)){let e=Wl(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Gl(i));let l=i&&!r&&!a?Kl(i,s):Nc(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function iu(e){return Fl(e).position===`static`}function au(e,t){if(!Sl(e)||Fl(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return yl(e)===n&&(n=n.ownerDocument.body),n}function ou(e,t){let n=vl(e);if(El(e))return n;if(!Sl(e)){let t=Ll(e);for(;t&&!Pl(t);){if(xl(t)&&!iu(t))return t;t=Ll(t)}return n}let r=au(e,t);for(;r&&Tl(r)&&iu(r);)r=au(r,t);return r&&Pl(r)&&iu(r)&&!jl(r)?n:r||Ml(e)||n}var su=async function(e){let t=this.getOffsetParent||ou,n=this.getDimensions,r=await n(e.floating);return{reference:ru(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function cu(e){return Fl(e).direction===`rtl`}var lu={convertOffsetParentRelativeRectToViewportRelativeRect:ql,getDocumentElement:yl,getClippingRect:tu,getOffsetParent:ou,getElementRects:su,getClientRects:Jl,getDimensions:nu,getScale:q,isElement:xl,isRTL:cu};function uu(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function du(e,t,n){let r=null,i,a=yl(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Mc(d),h=Mc(a.clientWidth-(u+f)),g=Mc(a.clientHeight-(d+p)),_=Mc(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Ac(0,kc(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!uu(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=vl(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function fu(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=K(e),u=i||a?[...l?zl(l):[],...t?zl(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?du(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Wl(e):null;c&&g();function g(){let t=Wl(e);h&&!uu(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var pu=fl,mu=pl,hu=ol,gu=hl,_u=ll,vu=al,yu=ml,bu=(e,t,n)=>{let r=new Map,i=n??{},a={...lu,...i.platform,_c:r};return il(e,t,{...i,platform:a})},xu=typeof document<`u`?_.useLayoutEffect:function(){};function Su(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Su(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Su(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Cu(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function wu(e,t){let n=Cu(e);return Math.round(t*n)/n}function Tu(e){let t=_.useRef(e);return xu(()=>{t.current=e}),t}function Eu(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);Su(f,r)||p(r);let[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=_.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_.useRef(null),w=_.useRef(null),T=_.useRef(u),E=c!=null,D=Tu(c),O=Tu(i),k=Tu(l),ee=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),bu(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};A.current&&!Su(T.current,t)&&(T.current=t,or.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);xu(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=_.useRef(!1);xu(()=>(A.current=!0,()=>{A.current=!1}),[]),xu(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,ee);ee()}},[x,S,ee,D,E]);let te=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),j=_.useMemo(()=>({reference:x,floating:S}),[x,S]),M=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!j.floating)return e;let t=wu(j.floating,u.x),r=wu(j.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Cu(j.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,j.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:ee,refs:te,elements:j,floatingStyles:M}),[u,ee,te,j,M])}var Du=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:vu({element:r.current,padding:i}).fn(n):r?vu({element:r,padding:i}).fn(n):{}}}},Ou=(e,t)=>{let n=pu(e);return{name:n.name,fn:n.fn,options:[e,t]}},ku=(e,t)=>{let n=mu(e);return{name:n.name,fn:n.fn,options:[e,t]}},Au=(e,t)=>({fn:yu(e).fn,options:[e,t]}),ju=(e,t)=>{let n=hu(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mu=(e,t)=>{let n=gu(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nu=(e,t)=>{let n=_u(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pu=(e,t)=>{let n=Du(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fu=Object.defineProperty,Iu=_.forwardRef(((e,t)=>Fu(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,S.jsx)(B.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,S.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),Lu=Object.defineProperty,Ru=(e,t)=>Lu(e,`name`,{value:t,configurable:!0}),zu=`Popper`,[Bu,Vu]=_i(zu),[Hu,Uu]=Bu(zu),Wu=Ru(e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null),[a,o]=_.useState(void 0);return(0,S.jsx)(Hu,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Gu=`PopperAnchor`,Ku=_.forwardRef(Ru(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Uu(Gu,n),o=_.useRef(null),s=a.onAnchorChange,c=Wr(t,_.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=_.useRef(null);_.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&td(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,S.jsx)(B.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),qu=`PopperContent`,[J,Ju]=Bu(qu),Yu=_.forwardRef(Ru(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Uu(qu,n),[v,y]=_.useState(null),b=Wr(t,y),[x,C]=_.useState(null),w=Dc(x),T=w?.width??0,E=w?.height??0,D=r+(a===`center`?``:`-`+a),O=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},k=Array.isArray(l)?l:[l],ee=k.length>0,A={padding:O,boundary:k.filter($u),altBoundary:ee},{refs:te,floatingStyles:j,placement:M,isPositioned:ne,middlewareData:N}=Eu({strategy:`fixed`,placement:D,whileElementsMounted:Ru((...e)=>fu(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[Ou({mainAxis:i+E,alignmentAxis:o}),c&&ku({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Au():void 0,...A}),c&&ju({...A}),Mu({...A,apply:Ru(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&Pu({element:x,padding:s}),ed({arrowWidth:T,arrowHeight:E}),f&&Nu({strategy:`referenceHidden`,...A,boundary:ee?A.boundary:void 0})]}),P=g.setPlacementState;Ri(()=>(P(M),()=>{P(void 0)}),[M,P]);let[re,ie]=td(M),ae=va(m);Ri(()=>{ne&&ae?.()},[ne,ae]);let F=N.arrow?.x,I=N.arrow?.y,L=N.arrow?.centerOffset!==0,[oe,R]=_.useState();return Ri(()=>{v&&R(window.getComputedStyle(v).zIndex)},[v]),(0,S.jsx)(`div`,{ref:te.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:ne?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:oe,"--radix-popper-transform-origin":[N.transformOrigin?.x,N.transformOrigin?.y].join(` `),...N.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,S.jsx)(J,{scope:n,placedSide:re,placedAlign:ie,onArrowChange:C,arrowX:F,arrowY:I,shouldHideArrow:L,children:(0,S.jsx)(B.div,{"data-side":re,"data-align":ie,...h,ref:b,style:{...h.style,animation:ne?h.style?.animation:`none`}})})})},`PopperContent`)),Xu=`PopperArrow`,Zu={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Qu=_.forwardRef(Ru(function(e,t){let{__scopePopper:n,...r}=e,i=Ju(Xu,n),a=Zu[i.placedSide];return(0,S.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,S.jsx)(Iu,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function $u(e){return e!==null}Ru($u,`isNotNull`);var ed=Ru(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=td(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function td(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Ru(td,`getSideAndAlignFromPlacement`);var nd=Wu,rd=Ku,id=Yu,ad=Qu,od=Object.defineProperty,sd=(e,t)=>od(e,`name`,{value:t,configurable:!0}),cd=!1;function ld(){let[e,t]=_.useState(cd);return _.useEffect(()=>{cd||(cd=!0,t(!0))},[]),e}sd(ld,`useIsHydrated`);var ud=_.useSyncExternalStore;function dd(){return()=>{}}sd(dd,`subscribe`);function fd(){return ud(dd,()=>!0,()=>!1)}sd(fd,`useIsHydratedModern`);var pd=typeof ud==`function`?fd:ld,md=Object.defineProperty,hd=(e,t)=>md(e,`name`,{value:t,configurable:!0}),gd=`rovingFocusGroup.onEntryFocus`,_d={bubbles:!1,cancelable:!0},vd=`RovingFocusGroup`,[yd,bd,xd]=xi(vd),[Sd,Y]=_i(vd,[xd]),[Cd,wd]=Sd(vd),Td=_.forwardRef(hd(function(e,t){return(0,S.jsx)(yd.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,S.jsx)(yd.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,S.jsx)(Ed,{...e,ref:t})})})},`RovingFocusGroup`)),Ed=_.forwardRef(hd(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=_.useRef(null),p=Wr(t,f),m=ha(a),[h,g]=qi({prop:o,defaultProp:s??null,onChange:c,caller:vd}),[v,y]=_.useState(!1),b=va(l),x=bd(n),C=_.useRef(!1),[w,T]=_.useState(0);return _.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(gd,b),()=>e.removeEventListener(gd,b)},[b]),(0,S.jsx)(Cd,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:_.useCallback(e=>g(e),[g]),onItemShiftTab:_.useCallback(()=>y(!0),[]),onFocusableItemAdd:_.useCallback(()=>T(e=>e+1),[]),onFocusableItemRemove:_.useCallback(()=>T(e=>e-1),[]),children:(0,S.jsx)(B.div,{tabIndex:v||w===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:H(e.onMouseDown,()=>{C.current=!0}),onFocus:H(e.onFocus,e=>{let t=!C.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(gd,_d);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);Md([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}C.current=!1}),onBlur:H(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),Dd=`RovingFocusGroupItem`,Od=_.forwardRef(hd(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=da(),l=a||c,u=wd(Dd,n),d=u.currentTabStopId===l,f=bd(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=pd();return Ri(()=>{if(!(!g||!r))return p(),()=>m()},[g,r,p,m]),_.useEffect(()=>{if(!(g||!r))return p(),()=>m()},[g,r,p,m]),(0,S.jsx)(yd.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,S.jsx)(B.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:H(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:H(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:H(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=jd(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Nd(n,r+1):n.slice(r+1)}setTimeout(()=>Md(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),kd={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Ad(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}hd(Ad,`getDirectionAwareKey`);function jd(e,t,n){let r=Ad(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return kd[r]}hd(jd,`getFocusIntent`);function Md(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}hd(Md,`focusFirst`);function Nd(e,t){return e.map((n,r)=>e[(t+r)%e.length])}hd(Nd,`wrapArray`);var Pd=Td,Fd=Od,Id=Object.defineProperty,Ld=_.forwardRef(((e,t)=>Id(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,S.jsx)(B.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),Rd=Object.defineProperty,zd=(e,t)=>Rd(e,`name`,{value:t,configurable:!0}),Bd=`horizontal`,Vd=[`horizontal`,`vertical`],Hd=_.forwardRef(zd(function(e,t){let{decorative:n,orientation:r=Bd,...i}=e,a=Ud(r)?r:Bd,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,S.jsx)(B.div,{"data-orientation":a,...o,...i,ref:t})},`Separator`));function Ud(e){return Vd.includes(e)}zd(Ud,`isValidOrientation`);var Wd=Hd,Gd=Object.defineProperty,Kd=(e,t)=>Gd(e,`name`,{value:t,configurable:!0}),qd=`Switch`,[Jd,Yd]=_i(qd),[Xd,Zd]=Jd(qd);function Qd(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=qi({prop:n,defaultProp:i??!1,onChange:c,caller:qd}),[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useRef(!1),[b,x]=_.useReducer(e=>e+1,0),C={checked:f,setChecked:p,disabled:a,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:x,required:l,defaultChecked:i,isFormControl:!m||!!o||!!m.closest(`form`),bubbleInput:g,setBubbleInput:v};return(0,S.jsx)(Xd,{scope:t,...C,children:sf(d)?d(C):r})}Kd(Qd,`SwitchProvider`);var $d=`SwitchTrigger`,ef=_.forwardRef(Kd(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,form:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:m,bubbleInput:h}=Zd($d,e),g=Wr(r,u),v=_.useRef(c);return _.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=Kd(()=>d(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,S.jsx)(B.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":cf(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:g,onClick:H(t,e=>{p(),d(e=>!e),h&&m&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`SwitchTrigger`)),tf=_.forwardRef(Kd(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,S.jsx)(Qd,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(ef,{...d,ref:t,__scopeSwitch:n}),e&&(0,S.jsx)(of,{__scopeSwitch:n})]})})},`Switch`)),nf=`SwitchThumb`,rf=_.forwardRef(Kd(function(e,t){let{__scopeSwitch:n,...r}=e,i=Zd(nf,n);return(0,S.jsx)(B.span,{"data-state":cf(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),af=`SwitchBubbleInput`,of=_.forwardRef(Kd(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:m,setBubbleInput:h}=Zd(af,e),g=Wr(r,h),v=Dc(i),y=_.useRef(!1),b=_.useRef(s),x=_.useRef(o);_.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==x.current;x.current=o;let i=b.current!==s;b.current=s;let c=!(r&&a.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:c});n.call(e,s),e.dispatchEvent(t),y.current=!1}},[m,s,a,o]);let C=_.useRef(s);return(0,S.jsx)(B.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??C.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:g,onClick:H(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function sf(e){return typeof e==`function`}Kd(sf,`isFunction`);function cf(e){return e?`checked`:`unchecked`}Kd(cf,`getState`);var lf=Object.defineProperty,uf=(e,t)=>lf(e,`name`,{value:t,configurable:!0}),df=`Tabs`,[ff,pf]=_i(df,[Y]),mf=Y(),[hf,gf]=ff(df),_f=_.forwardRef(uf(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=ha(s),[d,f]=qi({prop:r,onChange:i,defaultProp:a??``,caller:df});return(0,S.jsx)(hf,{scope:n,baseId:da(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,S.jsx)(B.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),vf=`TabsList`,yf=_.forwardRef(uf(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=gf(vf,n),o=mf(n);return(0,S.jsx)(Pd,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,S.jsx)(B.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),bf=`TabsTrigger`,xf=_.forwardRef(uf(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=gf(bf,n),s=mf(n),c=wf(o.baseId,r),l=Tf(o.baseId,r),u=r===o.value;return(0,S.jsx)(Fd,{asChild:!0,...s,focusable:!i,active:u,children:(0,S.jsx)(B.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:H(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:H(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:H(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),Sf=`TabsContent`,Cf=_.forwardRef(uf(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=gf(Sf,n),c=wf(s.baseId,r),l=Tf(s.baseId,r),u=r===s.value,d=_.useRef(u);return _.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,S.jsx)(ta,{present:i||u,children:({present:n})=>(0,S.jsx)(B.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})},`TabsContent`));function wf(e,t){return`${e}-trigger-${t}`}uf(wf,`makeTriggerId`);function Tf(e,t){return`${e}-content-${t}`}uf(Tf,`makeContentId`);var Ef=_f,Df=yf,Of=xf,kf=Cf,Af=Object.defineProperty,jf=(e,t)=>Af(e,`name`,{value:t,configurable:!0}),[Mf,Nf]=_i(`Tooltip`,[Vu]),Pf=Vu(),Ff=`TooltipProvider`,If=700,Lf=`tooltip.open`,[Rf,zf]=Mf(Ff),Bf=jf(e=>{let{__scopeTooltip:t,delayDuration:n=If,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=_.useRef(!0),s=_.useRef(!1),c=_.useRef(0);return _.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,S.jsx)(Rf,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),Vf=`Tooltip`,[Hf,Uf]=Mf(Vf),Wf=jf(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=zf(Vf,e.__scopeTooltip),l=Pf(t),[u,d]=_.useState(null),[f,p]=_.useState(void 0),m=da(),h=_.useRef(0),g=o??c.disableHoverableContent,v=s??c.delayDuration,y=_.useRef(!1),[b,x]=qi({prop:r,defaultProp:i??!1,onChange:jf(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Lf))):c.onClose(),a?.(e)},`onChange`),caller:Vf}),C=_.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),w=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,x(!0)},[x]),T=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),E=_.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,x(!0),h.current=0},v)},[v,x]);_.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let D=f??m;return(0,S.jsx)(nd,{...l,children:(0,S.jsx)(Hf,{scope:t,contentId:D,setContentId:p,open:b,stateAttribute:C,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayedRef.current?E():w()},[c.isOpenDelayedRef,E,w]),onTriggerLeave:_.useCallback(()=>{g?T():(window.clearTimeout(h.current),h.current=0)},[T,g]),onOpen:w,onClose:T,disableHoverableContent:g,children:n})})},`Tooltip`),Gf=`TooltipTrigger`,Kf=_.forwardRef(jf(function(e,t){let{__scopeTooltip:n,...r}=e,i=Uf(Gf,n),a=zf(Gf,n),o=Pf(n),s=Wr(t,_.useRef(null),i.onTriggerChange),c=_.useRef(!1),l=_.useRef(!1),u=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,S.jsx)(rd,{asChild:!0,...o,children:(0,S.jsx)(B.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:H(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:H(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:H(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:H(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:H(e.onBlur,i.onClose),onClick:H(e.onClick,i.onClose)})})},`TooltipTrigger`)),qf=`TooltipPortal`,[Jf,Yf]=Mf(qf,{forceMount:void 0}),Xf=jf(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Uf(qf,t);return(0,S.jsx)(Jf,{scope:t,forceMount:n,children:(0,S.jsx)(ta,{present:n||a.open,children:(0,S.jsx)(Za,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),Zf=`TooltipContent`,Qf=_.forwardRef(jf(function(e,t){let n=Yf(Zf,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Uf(Zf,e.__scopeTooltip);return(0,S.jsx)(ta,{present:r||o.open,children:o.disableHoverableContent?(0,S.jsx)(tp,{side:i,...a,ref:t}):(0,S.jsx)($f,{side:i,...a,ref:t})})},`TooltipContent`)),$f=_.forwardRef(jf(function(e,t){let n=Uf(Zf,e.__scopeTooltip),r=zf(Zf,e.__scopeTooltip),i=_.useRef(null),a=Wr(t,i),[o,s]=_.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=ip(r,rp(r,n.getBoundingClientRect())),a=ap(t.getBoundingClientRect()),o=sp([...i,...a]);s(o),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(c&&u){let e=jf(e=>p(e,u),`handleTriggerLeave`),t=jf(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),_.useEffect(()=>{if(o){let e=jf(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!op(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,S.jsx)(tp,{...e,ref:a})},`TooltipContentHoverable`)),ep=Xr(`TooltipContent`),tp=_.forwardRef(jf(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=Uf(Zf,n),u=Pf(n),{onClose:d}=l;_.useEffect(()=>(document.addEventListener(Lf,d),()=>document.removeEventListener(Lf,d)),[d]),_.useEffect(()=>{if(l.trigger){let e=jf(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return Ri(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,S.jsx)(Ea,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,S.jsxs)(id,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,S.jsx)(ep,{children:r}),i?(0,S.jsx)(pi,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),np=_.forwardRef(jf(function(e,t){let{__scopeTooltip:n,...r}=e,i=Pf(n);return(0,S.jsx)(ad,{...i,...r,ref:t})},`TooltipArrow`));function rp(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}jf(rp,`getExitSideFromRect`);function ip(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}jf(ip,`getPaddedExitPoints`);function ap(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}jf(ap,`getPointsFromRect`);function op(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}jf(op,`isPointInPolygon`);function sp(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),cp(t)}jf(sp,`getHull`);function cp(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}jf(cp,`getHullPresorted`);var lp=Bf,up=Wf,dp=Kf,fp=Xf,pp=Qf,mp=np;function hp(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=hp(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function gp(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=hp(e))&&(r&&(r+=` `),r+=t);return r}var _p=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},vp=(e,t)=>({classGroupId:e,validator:t}),yp=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),bp=`-`,xp=[],Sp=`arbitrary..`,Cp=e=>{let t=Ep(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Tp(e);let n=e.split(bp);return wp(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?_p(i,t):t:i||xp}return n[e]||xp}}},wp=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=wp(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(bp):e.slice(t).join(bp),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Tp=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Sp+r:void 0})(),Ep=e=>{let{theme:t,classGroups:n}=e;return Dp(n,t)},Dp=(e,t)=>{let n=yp();for(let r in e){let i=e[r];Op(i,n,r,t)}return n},Op=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];kp(i,t,n,r)}},kp=(e,t,n,r)=>{if(typeof e==`string`){Ap(e,t,n);return}if(typeof e==`function`){jp(e,t,n,r);return}Mp(e,t,n,r)},Ap=(e,t,n)=>{let r=e===``?t:Np(t,e);r.classGroupId=n},jp=(e,t,n,r)=>{if(Pp(e)){Op(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(vp(n,e))},Mp=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Op(o,Np(t,a),n,r)}},Np=(e,t)=>{let n=e,r=t.split(bp),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=yp(),n.nextPart.set(t,i)),n=i}return n},Pp=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Fp=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Ip=`!`,Lp=`:`,Rp=[],zp=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Bp=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Lp){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Ip)?(c=s.slice(0,-1),l=!0):s.startsWith(Ip)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return zp(t,l,c,u)};if(t){let e=t+Lp,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):zp(Rp,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Vp=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Hp=e=>({cache:Fp(e.cacheSize),parseClassName:Bp(e),sortModifiers:Vp(e),postfixLookupClassGroupIds:Up(e),...Cp(e)}),Up=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Wp=/\s+/,Gp=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Wp),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Ip:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Kp=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=qp(n))&&(i&&(i+=` `),i+=r);return i},qp=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=qp(e[r]))&&(n&&(n+=` `),n+=t);return n},Jp=(e,...t)=>{let n,r,i,a,o=o=>(n=Hp(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Gp(e,n);return i(e,a),a};return a=o,(...e)=>a(Kp(...e))},Yp=[],Xp=e=>{let t=t=>t[e]||Yp;return t.isThemeGetter=!0,t},Zp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Qp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$p=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,em=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,tm=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,nm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,rm=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,im=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,am=e=>$p.test(e),X=e=>!!e&&!Number.isNaN(Number(e)),om=e=>!!e&&Number.isInteger(Number(e)),sm=e=>e.endsWith(`%`)&&X(e.slice(0,-1)),cm=e=>em.test(e),lm=()=>!0,um=e=>tm.test(e)&&!nm.test(e),dm=()=>!1,fm=e=>rm.test(e),pm=e=>im.test(e),mm=e=>!Z(e)&&!Q(e),hm=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),gm=e=>jm(e,Fm,dm),Z=e=>Zp.test(e),_m=e=>jm(e,Im,um),vm=e=>jm(e,Lm,X),ym=e=>jm(e,zm,lm),bm=e=>jm(e,Rm,dm),xm=e=>jm(e,Nm,dm),Sm=e=>jm(e,Pm,pm),Cm=e=>jm(e,Bm,fm),Q=e=>Qp.test(e),wm=e=>Mm(e,Im),Tm=e=>Mm(e,Rm),Em=e=>Mm(e,Nm),Dm=e=>Mm(e,Fm),Om=e=>Mm(e,Pm),km=e=>Mm(e,Bm,!0),Am=e=>Mm(e,zm,!0),jm=(e,t,n)=>{let r=Zp.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Mm=(e,t,n=!1)=>{let r=Qp.exec(e);return r?r[1]?t(r[1]):n:!1},Nm=e=>e===`position`||e===`percentage`,Pm=e=>e===`image`||e===`url`,Fm=e=>e===`length`||e===`size`||e===`bg-size`,Im=e=>e===`length`,Lm=e=>e===`number`,Rm=e=>e===`family-name`,zm=e=>e===`number`||e===`weight`,Bm=e=>e===`shadow`,Vm=Jp(()=>{let e=Xp(`color`),t=Xp(`font`),n=Xp(`text`),r=Xp(`font-weight`),i=Xp(`tracking`),a=Xp(`leading`),o=Xp(`breakpoint`),s=Xp(`container`),c=Xp(`spacing`),l=Xp(`radius`),u=Xp(`shadow`),d=Xp(`inset-shadow`),f=Xp(`text-shadow`),p=Xp(`drop-shadow`),m=Xp(`blur`),h=Xp(`perspective`),g=Xp(`aspect`),_=Xp(`ease`),v=Xp(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Q,Z],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Q,Z,c],T=()=>[am,`full`,`auto`,...w()],E=()=>[om,`none`,`subgrid`,Q,Z],D=()=>[`auto`,{span:[`full`,om,Q,Z]},om,Q,Z],O=()=>[om,`auto`,Q,Z],k=()=>[`auto`,`min`,`max`,`fr`,Q,Z],ee=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],A=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],te=()=>[`auto`,...w()],j=()=>[am,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],M=()=>[am,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ne=()=>[am,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[e,Q,Z],P=()=>[...b(),Em,xm,{position:[Q,Z]}],re=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,Dm,gm,{size:[Q,Z]}],ae=()=>[sm,wm,_m],F=()=>[``,`none`,`full`,l,Q,Z],I=()=>[``,X,wm,_m],L=()=>[`solid`,`dashed`,`dotted`,`double`],oe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],R=()=>[X,sm,Em,xm],se=()=>[``,`none`,m,Q,Z],ce=()=>[`none`,X,Q,Z],le=()=>[`none`,X,Q,Z],ue=()=>[X,Q,Z],de=()=>[am,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[cm],breakpoint:[cm],color:[lm],container:[cm],"drop-shadow":[cm],ease:[`in`,`out`,`in-out`],font:[mm],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[cm],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[cm],shadow:[cm],spacing:[`px`,X],text:[cm],"text-shadow":[cm],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,am,Z,Q,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Q,Z]}],"container-named":[hm],columns:[{columns:[X,Z,Q,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[om,`auto`,Q,Z]}],basis:[{basis:[am,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[X,am,`auto`,`initial`,`none`,Z]}],grow:[{grow:[``,X,Q,Z]}],shrink:[{shrink:[``,X,Q,Z]}],order:[{order:[om,`first`,`last`,`none`,Q,Z]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ee(),`normal`]}],"justify-items":[{"justify-items":[...A(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...A()]}],"align-content":[{content:[`normal`,...ee()]}],"align-items":[{items:[...A(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...A(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...A(),`baseline`]}],"place-self":[{"place-self":[`auto`,...A()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:te()}],mx:[{mx:te()}],my:[{my:te()}],ms:[{ms:te()}],me:[{me:te()}],mbs:[{mbs:te()}],mbe:[{mbe:te()}],mt:[{mt:te()}],mr:[{mr:te()}],mb:[{mb:te()}],ml:[{ml:te()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:j()}],"inline-size":[{inline:[`auto`,...M()]}],"min-inline-size":[{"min-inline":[`auto`,...M()]}],"max-inline-size":[{"max-inline":[`none`,...M()]}],"block-size":[{block:[`auto`,...ne()]}],"min-block-size":[{"min-block":[`auto`,...ne()]}],"max-block-size":[{"max-block":[`none`,...ne()]}],w:[{w:[s,`screen`,...j()]}],"min-w":[{"min-w":[s,`screen`,`none`,...j()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...j()]}],h:[{h:[`screen`,`lh`,...j()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...j()]}],"max-h":[{"max-h":[`screen`,`lh`,...j()]}],"font-size":[{text:[`base`,n,wm,_m]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Am,ym]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,sm,Z]}],"font-family":[{font:[Tm,bm,t]}],"font-features":[{"font-features":[Z]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Q,Z]}],"line-clamp":[{"line-clamp":[X,`none`,Q,vm]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Q,Z]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Q,Z]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...L(),`wavy`]}],"text-decoration-thickness":[{decoration:[X,`from-font`,`auto`,Q,_m]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[X,`auto`,Q,Z]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[om,Q,Z]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Q,Z]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Q,Z]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},om,Q,Z],radial:[``,Q,Z],conic:[om,Q,Z]},Om,Sm]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-bs":[{"border-bs":I()}],"border-w-be":[{"border-be":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":I()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...L(),`hidden`,`none`]}],"divide-style":[{divide:[...L(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...L(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[X,Q,Z]}],"outline-w":[{outline:[``,X,wm,_m]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`none`,u,km,Cm]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,d,km,Cm]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:I()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[X,_m]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,f,km,Cm]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[X,Q,Z]}],"mix-blend":[{"mix-blend":[...oe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":oe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[X]}],"mask-image-linear-from-pos":[{"mask-linear-from":R()}],"mask-image-linear-to-pos":[{"mask-linear-to":R()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":R()}],"mask-image-t-to-pos":[{"mask-t-to":R()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":R()}],"mask-image-r-to-pos":[{"mask-r-to":R()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":R()}],"mask-image-b-to-pos":[{"mask-b-to":R()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":R()}],"mask-image-l-to-pos":[{"mask-l-to":R()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":R()}],"mask-image-x-to-pos":[{"mask-x-to":R()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":R()}],"mask-image-y-to-pos":[{"mask-y-to":R()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[Q,Z]}],"mask-image-radial-from-pos":[{"mask-radial-from":R()}],"mask-image-radial-to-pos":[{"mask-radial-to":R()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[X]}],"mask-image-conic-from-pos":[{"mask-conic-from":R()}],"mask-image-conic-to-pos":[{"mask-conic-to":R()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Q,Z]}],filter:[{filter:[``,`none`,Q,Z]}],blur:[{blur:se()}],brightness:[{brightness:[X,Q,Z]}],contrast:[{contrast:[X,Q,Z]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,km,Cm]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,X,Q,Z]}],"hue-rotate":[{"hue-rotate":[X,Q,Z]}],invert:[{invert:[``,X,Q,Z]}],saturate:[{saturate:[X,Q,Z]}],sepia:[{sepia:[``,X,Q,Z]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Q,Z]}],"backdrop-blur":[{"backdrop-blur":se()}],"backdrop-brightness":[{"backdrop-brightness":[X,Q,Z]}],"backdrop-contrast":[{"backdrop-contrast":[X,Q,Z]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,X,Q,Z]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[X,Q,Z]}],"backdrop-invert":[{"backdrop-invert":[``,X,Q,Z]}],"backdrop-opacity":[{"backdrop-opacity":[X,Q,Z]}],"backdrop-saturate":[{"backdrop-saturate":[X,Q,Z]}],"backdrop-sepia":[{"backdrop-sepia":[``,X,Q,Z]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Q,Z]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[X,`initial`,Q,Z]}],ease:[{ease:[`linear`,`initial`,_,Q,Z]}],delay:[{delay:[X,Q,Z]}],animate:[{animate:[`none`,v,Q,Z]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Q,Z]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ce()}],"rotate-x":[{"rotate-x":ce()}],"rotate-y":[{"rotate-y":ce()}],"rotate-z":[{"rotate-z":ce()}],scale:[{scale:le()}],"scale-x":[{"scale-x":le()}],"scale-y":[{"scale-y":le()}],"scale-z":[{"scale-z":le()}],"scale-3d":[`scale-3d`],skew:[{skew:ue()}],"skew-x":[{"skew-x":ue()}],"skew-y":[{"skew-y":ue()}],transform:[{transform:[Q,Z,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:de()}],"translate-x":[{"translate-x":de()}],"translate-y":[{"translate-y":de()}],"translate-z":[{"translate-z":de()}],"translate-none":[`translate-none`],zoom:[{zoom:[om,Q,Z]}],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Q,Z]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":N()}],"scrollbar-track-color":[{"scrollbar-track":N()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Q,Z]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[X,wm,_m,vm]}],stroke:[{stroke:[`none`,...N()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function $(...e){return Vm(gp(e))}var Hm=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Um=gp,Wm=(e,t)=>n=>{if(t?.variants==null)return Um(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Hm(t)||Hm(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Um(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Gm=Wm(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function Km({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,S.jsx)(r?Jr:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:$(Gm({variant:t,size:n,className:e})),...i})}function qm({...e}){return(0,S.jsx)(gc,{"data-slot":`alert-dialog`,...e})}function Jm({...e}){return(0,S.jsx)(_c,{"data-slot":`alert-dialog-trigger`,...e})}function Ym({...e}){return(0,S.jsx)(vc,{"data-slot":`alert-dialog-portal`,...e})}function Xm({className:e,...t}){return(0,S.jsx)(yc,{"data-slot":`alert-dialog-overlay`,className:$(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function Zm({className:e,size:t=`default`,...n}){return(0,S.jsxs)(Ym,{children:[(0,S.jsx)(Xm,{}),(0,S.jsx)(bc,{"data-slot":`alert-dialog-content`,"data-size":t,className:$(`group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...n})]})}function Qm({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:$(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function $m({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:$(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function eh({className:e,...t}){return(0,S.jsx)(Cc,{"data-slot":`alert-dialog-title`,className:$(`font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function th({className:e,...t}){return(0,S.jsx)(wc,{"data-slot":`alert-dialog-description`,className:$(`text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function nh({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,S.jsx)(Km,{variant:t,size:n,asChild:!0,children:(0,S.jsx)(xc,{"data-slot":`alert-dialog-action`,className:$(e),...r})})}function rh({className:e,variant:t=`outline`,size:n=`default`,...r}){return(0,S.jsx)(Km,{variant:t,size:n,asChild:!0,children:(0,S.jsx)(Sc,{"data-slot":`alert-dialog-cancel`,className:$(e),...r})})}var ih=Wm(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function ah({className:e,variant:t=`default`,asChild:n=!1,...r}){return(0,S.jsx)(n?Jr:`span`,{"data-slot":`badge`,"data-variant":t,className:$(ih({variant:t}),e),...r})}function oh({className:e,size:t=`default`,...n}){return(0,S.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:$(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...n})}function sh({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`card-header`,className:$(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,e),...t})}function ch({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`card-title`,className:$(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function lh({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`card-description`,className:$(`text-sm text-muted-foreground`,e),...t})}function uh({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`card-content`,className:$(`px-(--card-spacing)`,e),...t})}function dh({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`card-footer`,className:$(`flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)`,e),...t})}function fh({className:e,type:t,...n}){return(0,S.jsx)(`input`,{type:t,"data-slot":`input`,className:$(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function ph({className:e,...t}){return(0,S.jsx)(Ld,{"data-slot":`label`,className:$(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function mh({...e}){return(0,S.jsx)(As,{"data-slot":`dialog`,...e})}function hh({...e}){return(0,S.jsx)(Ms,{"data-slot":`dialog-trigger`,...e})}function gh({...e}){return(0,S.jsx)(Is,{"data-slot":`dialog-portal`,...e})}function _h({className:e,...t}){return(0,S.jsx)(Rs,{"data-slot":`dialog-overlay`,className:$(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function vh({className:e,children:t,showCloseButton:n=!0,...r}){return(0,S.jsxs)(gh,{children:[(0,S.jsx)(_h,{}),(0,S.jsxs)(Hs,{"data-slot":`dialog-content`,className:$(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,S.jsx)(Zs,{"data-slot":`dialog-close`,asChild:!0,children:(0,S.jsxs)(Km,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`,children:[(0,S.jsx)(ar,{}),(0,S.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function yh({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`dialog-header`,className:$(`flex flex-col gap-2`,e),...t})}function bh({className:e,...t}){return(0,S.jsx)(qs,{"data-slot":`dialog-title`,className:$(`font-heading text-base leading-none font-medium`,e),...t})}function xh({className:e,...t}){return(0,S.jsx)(Ys,{"data-slot":`dialog-description`,className:$(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function Sh({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,S.jsx)(Wd,{"data-slot":`separator`,decorative:n,orientation:t,className:$(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...r})}function Ch({className:e,...t}){return(0,S.jsx)(`div`,{"data-slot":`skeleton`,className:$(`animate-pulse rounded-md bg-muted`,e),...t})}function wh({className:e,size:t=`default`,...n}){return(0,S.jsx)(tf,{"data-slot":`switch`,"data-size":t,className:$(`peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...n,children:(0,S.jsx)(rf,{"data-slot":`switch-thumb`,className:`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground`})})}function Th({className:e,orientation:t=`horizontal`,...n}){return(0,S.jsx)(Ef,{"data-slot":`tabs`,"data-orientation":t,className:$(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var Eh=Wm(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function Dh({className:e,variant:t=`default`,...n}){return(0,S.jsx)(Df,{"data-slot":`tabs-list`,"data-variant":t,className:$(Eh({variant:t}),e),...n})}function Oh({className:e,...t}){return(0,S.jsx)(Of,{"data-slot":`tabs-trigger`,className:$(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function kh({className:e,...t}){return(0,S.jsx)(kf,{"data-slot":`tabs-content`,className:$(`flex-1 text-sm outline-none`,e),...t})}function Ah({className:e,...t}){return(0,S.jsx)(`textarea`,{"data-slot":`textarea`,className:$(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}var jh=(e,t,n,r,i,a,o,s)=>{let c=document.documentElement,l=[`light`,`dark`];function u(t){(Array.isArray(e)?e:[e]).forEach(e=>{let n=e===`class`,r=n&&a?i.map(e=>a[e]||e):i;n?(c.classList.remove(...r),c.classList.add(a&&a[t]?a[t]:t)):c.setAttribute(e,t)}),d(t)}function d(e){s&&l.includes(e)&&(c.style.colorScheme=e)}function f(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}if(r)u(r);else try{let e=localStorage.getItem(t)||n;u(o&&e===`system`?f():e)}catch{}},Mh=[`light`,`dark`],Nh=`(prefers-color-scheme: dark)`,Ph=typeof window>`u`,Fh=_.createContext(void 0),Ih={setTheme:e=>{},themes:[]},Lh=()=>_.useContext(Fh)??Ih,Rh=e=>_.useContext(Fh)?_.createElement(_.Fragment,null,e.children):_.createElement(Bh,{...e}),zh=[`light`,`dark`],Bh=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i=`theme`,themes:a=zh,defaultTheme:o=n?`system`:`light`,attribute:s=`data-theme`,value:c,children:l,nonce:u,scriptProps:d})=>{let[f,p]=_.useState(()=>Hh(i,o)),[m,h]=_.useState(()=>f===`system`?Wh():f),g=c?Object.values(c):a,v=_.useCallback(e=>{let i=e;if(!i)return;e===`system`&&n&&(i=Wh());let a=c?c[i]:i,l=t?Uh(u):null,d=document.documentElement,f=e=>{e===`class`?(d.classList.remove(...g),a&&d.classList.add(a)):e.startsWith(`data-`)&&(a?d.setAttribute(e,a):d.removeAttribute(e))};if(Array.isArray(s)?s.forEach(f):f(s),r){let e=Mh.includes(o)?o:null,t=Mh.includes(i)?i:e;d.style.colorScheme=t}l?.()},[u]),y=_.useCallback(e=>{let t=typeof e==`function`?e(f):e;p(t);try{localStorage.setItem(i,t)}catch{}},[f]),b=_.useCallback(t=>{let r=Wh(t);h(r),f===`system`&&n&&!e&&v(`system`)},[f,e]);_.useEffect(()=>{let e=window.matchMedia(Nh);return e.addListener(b),b(e),()=>e.removeListener(b)},[b]),_.useEffect(()=>{let e=e=>{e.key===i&&(e.newValue?p(e.newValue):y(o))};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[y]),_.useEffect(()=>{v(e??f)},[e,f]);let x=_.useMemo(()=>({theme:f,setTheme:y,forcedTheme:e,resolvedTheme:f===`system`?m:f,themes:n?[...a,`system`]:a,systemTheme:n?m:void 0}),[f,y,e,m,n,a]);return _.createElement(Fh.Provider,{value:x},_.createElement(Vh,{forcedTheme:e,storageKey:i,attribute:s,enableSystem:n,enableColorScheme:r,defaultTheme:o,value:c,themes:a,nonce:u,scriptProps:d}),l)},Vh=_.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:s,nonce:c,scriptProps:l})=>{let u=JSON.stringify([n,t,a,e,s,o,r,i]).slice(1,-1);return _.createElement(`script`,{...l,suppressHydrationWarning:!0,nonce:typeof window>`u`?c:``,dangerouslySetInnerHTML:{__html:`(${jh.toString()})(${u})`}})}),Hh=(e,t)=>{if(Ph)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},Uh=e=>{let t=document.createElement(`style`);return e&&t.setAttribute(`nonce`,e),t.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`)),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},Wh=e=>(e||=window.matchMedia(Nh),e.matches?`dark`:`light`),Gh=({...e})=>{let{theme:t=`system`}=Lh();return(0,S.jsx)(Ir,{theme:t,className:`toaster group`,icons:{success:(0,S.jsx)(Vn,{className:`size-4`}),info:(0,S.jsx)(Gn,{className:`size-4`}),warning:(0,S.jsx)(ir,{className:`size-4`}),error:(0,S.jsx)(Yn,{className:`size-4`}),loading:(0,S.jsx)(Jn,{className:`size-4 animate-spin`})},style:{"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},toastOptions:{classNames:{toast:`cn-toast`}},...e})};function Kh({delayDuration:e=0,...t}){return(0,S.jsx)(lp,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function qh({...e}){return(0,S.jsx)(up,{"data-slot":`tooltip`,...e})}function Jh({...e}){return(0,S.jsx)(dp,{"data-slot":`tooltip-trigger`,...e})}function Yh({className:e,sideOffset:t=0,children:n,...r}){return(0,S.jsx)(fp,{children:(0,S.jsxs)(pp,{"data-slot":`tooltip-content`,sideOffset:t,className:$(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[n,(0,S.jsx)(mp,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}var Xh={token:`Token`,skill:`Skills`,commit:`Commit`,checkpoint:`Checkpoint`,agent:`Agent`,prompt_duration:`提示耗时`,prompt_report:`提示报告`},Zh={repository:`仓库信息`,path:`项目路径`,branch:`分支名称`},Qh=[`hosts`,`repositories`,`directories`,`branches`],$h=[`allowed_agents`,`allowed_models`,`blocked_patterns`],eg={git_path:`/usr/bin/git`,exclude_repositories:[],exclude_prompts_in_repositories:[],disable_auto_updates:!1,disable_version_checks:!1,telemetry_oss:`on`},tg=Object.fromEntries(Object.keys(Xh).map(e=>[e,!0])),ng={installed:!1,enabled:!1,action:`redact`,event_types:tg,built_in_rules:{api_key:!0,private_key:!0,credential:!0,email:!1,phone:!1},custom_patterns:[]},rg={installed:!1,enabled:!1,mode:`audit`,allowed_agents:[],allowed_models:[],blocked_patterns:[]},ig={enabled:!0,allowlist_patterns:[],blocklist_patterns:[]};function ag(e){return Array.isArray(e)?e.join(`
|
|
50
|
-
`):``}function og(e){return e.split(/\r?\n/).map(e=>e.trim()).filter(Boolean)}function sg(e,t){return`${e}:${t}`}function cg(e){return Object.fromEntries(e.flatMap(e=>Qh.map(t=>[sg(e.id,t),ag(e.match[t])])))}function lg(e){return Object.fromEntries($h.map(t=>[t,ag(e[t])]))}function ug(e,t){let n=new Map;for(let r of e)for(let e of r[t]){let t=n.get(e);t?(t.count+=1,r.timestamp>t.timestamp&&(t.timestamp=r.timestamp,t.reason=r.reason)):n.set(e,{name:e,count:1,timestamp:r.timestamp,reason:r.reason})}return[...n.values()].sort((e,t)=>t.timestamp.localeCompare(e.timestamp)||t.count-e.count)}function dg(e,t,n){let r=new Date(e);return Number.isNaN(r.getTime())?n:new Intl.DateTimeFormat(t,{month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}).format(r)}function fg(e,t,n){let r=new Date(e);return Number.isNaN(r.getTime())?n:new Intl.DateTimeFormat(t,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`}).format(r)}function pg(e,t){return e===`skill_pattern`?t(`命中 Skill 规则`):e===`recent_directory_skill_hold`?t(`新目录观察期`):e===`recent_directory_skill_blocklist`?t(`新目录黑名单`):e===`default_deny`?t(`未匹配仓库默认拦截`):e===`git_ai_paused`?t(`Git AI 已暂停`):e===`sensitive_content`?t(`命中敏感内容规则`):e===`agent_model_policy`?t(`命中 Agent / 模型规则`):e.startsWith(`plugin:`)?t(`命中仓库插件策略`):e||t(`已拦截`)}function mg(e){return`repository:${e}`}function hg(e,t){let n=[...t.plugins.map(e=>mg(e.id)),...t.skill_policy.installed?[`skill_filter`]:[],...t.sensitive_data_policy.installed?[`sensitive_data`]:[],...t.agent_model_policy.installed?[`agent_model`]:[]],r=new Set(n),i=[];for(let t of e??[])r.has(t)&&!i.includes(t)&&i.push(t);return[...i,...n.filter(e=>!i.includes(e))]}function gg(e){let t=e.skill_policy,n={...e,version:2,git_ai_enabled:e.git_ai_enabled??!0,skill_policy:{installed:e.skill_policy.installed??!0,enabled:e.skill_policy.enabled,blocked_patterns:e.skill_policy.blocked_patterns,recent_directory_guard:{...ig,...e.skill_policy.recent_directory_guard,allowlist_patterns:e.skill_policy.recent_directory_guard?.allowlist_patterns??[],blocklist_patterns:e.skill_policy.recent_directory_guard?.blocklist_patterns??[]}},plugins:e.plugins.map(e=>({...e,priority:e.priority??100,match:{all_repositories:e.match?.all_repositories??!1,hosts:e.match?.hosts??[],repositories:e.match?.repositories??[],directories:e.match?.directories??[],branches:e.match?.branches??[]},fixed_project_directory:e.fixed_project_directory??(e.id===`github`?t.fixed_project_directory??``:``)})),sensitive_data_policy:{...ng,...e.sensitive_data_policy,event_types:{...tg,...e.sensitive_data_policy?.event_types},built_in_rules:{...ng.built_in_rules,...e.sensitive_data_policy?.built_in_rules},custom_patterns:e.sensitive_data_policy?.custom_patterns??[]},agent_model_policy:{...rg,...e.agent_model_policy,allowed_agents:e.agent_model_policy?.allowed_agents??[],allowed_models:e.agent_model_policy?.allowed_models??[],blocked_patterns:e.agent_model_policy?.blocked_patterns??[]},plugin_order:[]};return n.plugin_order=hg(e.plugin_order,n),n}function _g(e){let t=1;for(;e.some(e=>e.id===`repository-${t}`);)t+=1;return`repository-${t}`}async function vg(e){let t=await e.json().catch(()=>({}));if(!e.ok||t.ok===!1)throw Error(t.message||`Request failed: ${e.status}`);return t}function yg({id:e,title:t,description:n,checked:r,onCheckedChange:i}){return(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-6 rounded-lg border p-4`,children:[(0,S.jsxs)(`div`,{className:`space-y-1`,children:[(0,S.jsx)(ph,{htmlFor:e,children:t}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n})]}),(0,S.jsx)(wh,{id:e,checked:r,onCheckedChange:i})]})}function bg({id:e,label:t,checked:n,onCheckedChange:r}){return(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border p-3`,children:[(0,S.jsx)(ph,{htmlFor:e,className:`font-normal`,children:t}),(0,S.jsx)(wh,{id:e,checked:n,onCheckedChange:r})]})}function xg(){return(0,S.jsxs)(`div`,{className:`mx-auto flex min-h-svh max-w-6xl flex-col gap-6 px-4 py-8 sm:px-6`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(Ch,{className:`h-8 w-64`}),(0,S.jsx)(Ch,{className:`h-4 w-80`})]}),(0,S.jsx)(Ch,{className:`h-8 w-28`})]}),(0,S.jsx)(Ch,{className:`h-24 w-full`}),(0,S.jsx)(Ch,{className:`h-[420px] w-full`})]})}function Sg(){let[e,t]=(0,_.useState)(()=>{try{let e=window.localStorage.getItem(`git-ai-control-language`);if(e===`zh-CN`||e===`en`)return e}catch{}return Rr()}),n=(0,_.useCallback)((t,n)=>zr(e,t,n),[e]),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(``),[p,m]=(0,_.useState)(``),[h,g]=(0,_.useState)({}),[v,y]=(0,_.useState)(``),[b,x]=(0,_.useState)(()=>lg(rg)),[C,w]=(0,_.useState)(null),[T,E]=(0,_.useState)({ok:!1}),[D,O]=(0,_.useState)([]),[k,ee]=(0,_.useState)(!1),[A,te]=(0,_.useState)(``),[j,M]=(0,_.useState)(!1),[ne,N]=(0,_.useState)(!1),[P,re]=(0,_.useState)(!1),[ie,ae]=(0,_.useState)(!1),[F,I]=(0,_.useState)(null);(0,_.useEffect)(()=>{document.documentElement.lang=e,document.title=n(`Git AI 配置中心`);try{window.localStorage.setItem(`git-ai-control-language`,e)}catch{}},[e,n]);let L=(0,_.useCallback)(async()=>{try{let e=await vg(await fetch(`/api/config`,{cache:`no-store`})),t={...eg,...e.gitAi};i(t),o(ag(t.exclude_repositories)),c(ag(t.exclude_prompts_in_repositories));let n=gg(e.policy);u(ag(n.skill_policy.blocked_patterns)),f(ag(n.skill_policy.recent_directory_guard.allowlist_patterns)),m(ag(n.skill_policy.recent_directory_guard.blocklist_patterns)),g(cg(n.plugins)),y(ag(n.sensitive_data_policy.custom_patterns)),x(lg(n.agent_model_policy)),w(n),E(e.runtime??{ok:!1}),M(!1)}catch(e){xr.error(e instanceof Error?e.message:n(`读取配置失败`))}},[n]),oe=(0,_.useCallback)(async()=>{ee(!0);try{let e=await vg(await fetch(`/api/filter-events`,{cache:`no-store`}));O(Array.isArray(e.events)?e.events:[]),te(``)}catch(e){te(e instanceof Error?e.message:n(`读取过滤记录失败`))}finally{ee(!1)}},[n]);(0,_.useEffect)(()=>{let e=window.requestAnimationFrame(()=>void L());return()=>window.cancelAnimationFrame(e)},[L]),(0,_.useEffect)(()=>{let e=window.requestAnimationFrame(()=>void oe()),t=window.setInterval(()=>void oe(),3e4);return()=>{window.cancelAnimationFrame(e),window.clearInterval(t)}},[oe]);let R=(0,_.useMemo)(()=>C?.plugins.filter(e=>e.enabled)??[],[C]),se=(0,_.useMemo)(()=>R.reduce((e,t)=>e+Object.values(t.allow).filter(Boolean).length,0),[R]),ce=(C?.plugins.length??0)+ +!!C?.skill_policy.installed+ +!!C?.sensitive_data_policy.installed+ +!!C?.agent_model_policy.installed,le=(C?.plugins.filter(e=>e.enabled).length??0)+(C?.skill_policy.installed&&C.skill_policy.enabled?1:0)+(C?.sensitive_data_policy.installed&&C.sensitive_data_policy.enabled?1:0)+(C?.agent_model_policy.installed&&C.agent_model_policy.enabled?1:0),ue=(0,_.useMemo)(()=>new Map(C?.plugin_order.map((e,t)=>[e,t])),[C?.plugin_order]),de=(0,_.useMemo)(()=>Object.fromEntries(Object.entries(Xh).map(([e,t])=>[e,n(t)])),[n]),fe=(0,_.useMemo)(()=>Object.fromEntries(Object.entries(Zh).map(([e,t])=>[e,n(t)])),[n]),pe=(0,_.useMemo)(()=>ug(D,`repositories`),[D]),me=(0,_.useMemo)(()=>ug(D,`skills`),[D]),he=(0,_.useMemo)(()=>[{title:n(`仓库`),items:pe,emptyMessage:n(`尚未拦截包含仓库信息的上报`)},{title:`Skills`,items:me,emptyMessage:n(`尚未拦截 Skill 调用`)}],[pe,me,n]),ge=T.gitAiEnabled??C?.git_ai_enabled??!0,_e=C?.git_ai_enabled!==ge,ve=T.filter?.ok===!0,ye=fg(T.gitAiUpdatedAt??``,e,n(`时间未知`)),be=fg(`2026-09-09T12:00:00+08:00`,e,n(`时间未知`)),xe=(0,_.useMemo)(()=>{let e=[];return C&&e.push(`repository`),C?.skill_policy.installed||e.push(`skill_filter`),C?.sensitive_data_policy.installed||e.push(`sensitive_data`),C?.agent_model_policy.installed||e.push(`agent_model`),e},[C]),Se=e=>{i(e),M(!0)},Ce=e=>{w(e),M(!0)},we=(e,t)=>{C&&Ce({...C,plugins:C.plugins.map(n=>n.id===e?t(n):n)})},Te=(e,t,n)=>{g(r=>({...r,[sg(e,t)]:n})),we(e,e=>({...e,match:{...e.match,[t]:og(n)}}))},Ee=e=>{if(C){if(e===`repository`){let e=_g(C.plugins);g(t=>({...t,[sg(e,`hosts`)]:`example.com`,[sg(e,`repositories`)]:``,[sg(e,`directories`)]:``,[sg(e,`branches`)]:``})),Ce({...C,plugins:[...C.plugins,{id:e,name:n(`仓库插件 {{count}}`,{count:C.plugins.length+1}),enabled:!0,priority:100,match:{all_repositories:!1,hosts:[`example.com`],repositories:[],directories:[],branches:[]},fixed_project_directory:``,allow:Object.fromEntries(Object.keys(Xh).map(e=>[e,!1])),fields:Object.fromEntries(Object.keys(Zh).map(e=>[e,!1]))}],plugin_order:[...C.plugin_order,mg(e)]})}else e===`skill_filter`?Ce({...C,skill_policy:{...C.skill_policy,installed:!0,enabled:!0},plugin_order:[...C.plugin_order,`skill_filter`]}):e===`sensitive_data`?Ce({...C,sensitive_data_policy:{...ng,installed:!0,enabled:!0},plugin_order:[...C.plugin_order,`sensitive_data`]}):e===`agent_model`&&Ce({...C,agent_model_policy:{...rg,installed:!0,enabled:!0},plugin_order:[...C.plugin_order,`agent_model`]});re(!1)}},De=e=>{C&&(g(t=>Object.fromEntries(Object.entries(t).filter(([t])=>!t.startsWith(`${e}:`)))),Ce({...C,plugins:C.plugins.filter(t=>t.id!==e),plugin_order:C.plugin_order.filter(t=>t!==mg(e))}))},Oe=()=>{C&&Ce({...C,skill_policy:{...C.skill_policy,installed:!1,enabled:!1},plugin_order:C.plugin_order.filter(e=>e!==`skill_filter`)})},ke=e=>{C&&Ce({...C,[e]:{...C[e],installed:!1,enabled:!1},plugin_order:C.plugin_order.filter(t=>t!==(e===`sensitive_data_policy`?`sensitive_data`:`agent_model`))})},Ae=async()=>{if(!(!r||!C)){N(!0);try{let e=await vg(await fetch(`/api/config`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({gitAi:r,policy:C})})),t={...eg,...e.gitAi};i(t),o(ag(t.exclude_repositories)),c(ag(t.exclude_prompts_in_repositories));let a=gg(e.policy);u(ag(a.skill_policy.blocked_patterns)),f(ag(a.skill_policy.recent_directory_guard.allowlist_patterns)),m(ag(a.skill_policy.recent_directory_guard.blocklist_patterns)),g(cg(a.plugins)),y(ag(a.sensitive_data_policy.custom_patterns)),x(lg(a.agent_model_policy)),w(a),e.runtime&&E(e.runtime),M(!1),xr.success(n(`配置已保存,下一次上报立即使用新策略`))}catch(e){xr.error(e instanceof Error?e.message:n(`保存失败`))}finally{N(!1)}}},je=async()=>{N(!0);let t=xr.loading(n(`正在验证配置`),{description:n(`检查插件策略、过滤脚本和本地服务连接…`)});try{let r=await fetch(`/api/test`,{method:`POST`}),i=await r.json().catch(()=>({}));if(!r.ok||!Array.isArray(i.checks))throw Error(i.message||`Request failed: ${r.status}`);let a=i.checks.filter(e=>!e.ok);a.length?xr.error(n(`配置验证失败`),{id:t,description:a.map(e=>e.message?`${e.name}:${e.message}`:e.name).join(e===`zh-CN`?`;`:`; `)}):xr.success(n(`配置验证通过`),{id:t,description:i.checks.map(e=>e.name).join(e===`zh-CN`?`、`:`, `)})}catch(e){xr.error(n(`配置验证失败`),{id:t,description:e instanceof Error?e.message:n(`验证请求失败`)})}finally{N(!1)}},Me=async()=>{N(!0);try{let e=await vg(await fetch(`/api/restart-filter`,{method:`POST`}));xr.success(e.message||n(`过滤服务已重启`)),window.setTimeout(()=>void L(),900)}catch(e){xr.error(e instanceof Error?e.message:n(`重启失败`))}finally{N(!1)}},Ne=async e=>{ae(!0);try{let t=await vg(await fetch(`/api/config`,{cache:`no-store`}));I(e===`gitAi`?{title:n(`当前 Git AI 原生配置`),description:n(`读取 ~/.git-ai/config.json 中由本页面管理的已保存字段,未保存更改和敏感未知字段不会显示。`),content:t.gitAi}:{title:n(`当前插件策略配置`),description:n(`读取 ~/.git-ai/filter_plugins.json 中已写入磁盘的完整插件策略,未保存更改不会显示。`),content:t.policy})}catch(e){xr.error(e instanceof Error?e.message:n(`读取当前配置失败`))}finally{ae(!1)}};return!r||!C?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(xg,{}),(0,S.jsx)(Gh,{position:`top-right`,richColors:!0,closeButton:!0,duration:5e3})]}):(0,S.jsxs)(Kh,{children:[(0,S.jsxs)(`div`,{className:`min-h-svh bg-muted/30 pb-24`,children:[(0,S.jsx)(`header`,{className:`border-b bg-background`,children:(0,S.jsxs)(`div`,{className:`mx-auto flex max-w-6xl flex-col gap-4 px-4 py-6 sm:flex-row sm:items-center sm:justify-between sm:px-6`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,S.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-lg bg-primary text-primary-foreground`,children:(0,S.jsx)(nr,{className:`size-5`})}),(0,S.jsxs)(`div`,{children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`h1`,{className:`text-xl font-semibold`,children:n(`Git AI 配置中心`)}),(0,S.jsxs)(ah,{variant:`outline`,className:`font-mono text-xs font-normal`,children:[`v`,`0.4.13`]})]}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`本机插件策略与上传权限`)})]})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`label`,{className:`sr-only`,htmlFor:`language`,children:n(`语言`)}),(0,S.jsxs)(`div`,{className:`flex h-8 items-center gap-1 rounded-md border bg-background px-2 text-sm`,children:[(0,S.jsx)(Kn,{className:`size-3.5 text-muted-foreground`}),(0,S.jsxs)(`select`,{id:`language`,"aria-label":n(`语言`),className:`bg-transparent text-sm outline-none`,value:e,onChange:e=>t(e.target.value),children:[(0,S.jsx)(`option`,{value:`zh-CN`,children:`中文`}),(0,S.jsx)(`option`,{value:`en`,children:`English`})]})]}),(0,S.jsxs)(ah,{variant:T.distribution===`upstream-oss`?`outline`:T.ok?`secondary`:`destructive`,children:[(0,S.jsx)(zn,{className:`size-3.5`}),T.distribution===`upstream-oss`?n(`上游 OSS · 原生配置`):T.ok?n(`定制版 · 过滤在线`):n(`定制版 · 过滤异常`)]})]})]})}),(0,S.jsxs)(`main`,{className:`mx-auto max-w-6xl space-y-6 px-4 py-6 sm:px-6`,children:[(0,S.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-5`,children:[(0,S.jsx)(oh,{size:`sm`,children:(0,S.jsxs)(sh,{children:[(0,S.jsx)(lh,{children:n(`已安装插件`)}),(0,S.jsxs)(ch,{className:`flex items-baseline gap-2 text-2xl`,children:[ce,(0,S.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:n(`{{count}} 个启用`,{count:le})})]})]})}),(0,S.jsx)(oh,{size:`sm`,children:(0,S.jsxs)(sh,{children:[(0,S.jsx)(lh,{children:n(`允许的数据通道`)}),(0,S.jsx)(ch,{className:`text-2xl`,children:se})]})}),(0,S.jsx)(oh,{size:`sm`,children:(0,S.jsxs)(sh,{children:[(0,S.jsx)(lh,{children:n(`配置状态`)}),(0,S.jsxs)(ch,{className:`flex items-center gap-2 text-base`,children:[(0,S.jsx)(Vn,{className:`size-4 ${j?`text-amber-600`:`text-emerald-600`}`}),n(j?`有未保存更改`:`已同步`)]})]})}),(0,S.jsx)(oh,{size:`sm`,children:(0,S.jsxs)(sh,{children:[(0,S.jsx)(lh,{children:n(`当前 Git AI 状态`)}),(0,S.jsxs)(ch,{className:`space-y-1 text-base`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(zn,{className:`size-4 ${ge?`text-emerald-600`:`text-amber-600`}`}),(0,S.jsx)(`span`,{children:_e?C.git_ai_enabled?n(`开启(待保存)`):n(`暂停(待保存)`):n(ge?`已开启`:`已暂停`)}),(0,S.jsxs)(`span`,{className:`shrink-0 font-mono text-sm font-normal text-muted-foreground`,children:[`v`,T.gitAiVersion||n(`未知`)]})]}),(0,S.jsxs)(`p`,{className:`pl-6 text-xs font-normal text-muted-foreground`,children:[n(`更新于`),` `,ye]})]})]})}),(0,S.jsx)(oh,{size:`sm`,children:(0,S.jsxs)(sh,{children:[(0,S.jsx)(lh,{children:n(`过滤服务状态`)}),(0,S.jsxs)(ch,{className:`space-y-1 text-base`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(zn,{className:`size-4 ${ve?`text-emerald-600`:`text-destructive`}`}),(0,S.jsx)(`span`,{children:n(ve?`已在线`:`已离线`)}),(0,S.jsxs)(`span`,{className:`shrink-0 font-mono text-sm font-normal text-muted-foreground`,children:[`v`,`0.4.13`]})]}),(0,S.jsxs)(`p`,{className:`pl-6 text-xs font-normal text-muted-foreground`,children:[n(`更新于`),` `,be]})]})]})})]}),(0,S.jsxs)(Th,{defaultValue:`system`,children:[(0,S.jsxs)(Dh,{className:`w-full justify-start`,children:[(0,S.jsxs)(Oh,{value:`system`,children:[(0,S.jsx)(er,{}),n(`Git AI 设置`)]}),(0,S.jsxs)(Oh,{value:`plugins`,children:[(0,S.jsx)(Zn,{}),n(`插件管理`)]})]}),(0,S.jsx)(kh,{value:`system`,className:`mt-4`,children:(0,S.jsxs)(oh,{children:[(0,S.jsxs)(sh,{className:`gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,S.jsxs)(`div`,{className:`space-y-1`,children:[(0,S.jsx)(ch,{children:n(`Git AI 原生设置`)}),(0,S.jsx)(lh,{children:n(`写入 ~/.git-ai/config.json,未知字段会原样保留。`)})]}),(0,S.jsx)(Km,{variant:`outline`,size:`sm`,onClick:()=>void Ne(`gitAi`),disabled:ie,children:n(ie?`读取中...`:`查看配置`)})]}),(0,S.jsxs)(uh,{className:`space-y-6`,children:[(0,S.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,S.jsx)(yg,{id:`git-ai-enabled`,title:`Git AI`,description:C.git_ai_enabled?n(`已开启:按当前插件策略处理并转发 Git AI 上报`):n(`已暂停:全部 Git AI 上报会在本机拦截,恢复后继续按原策略处理`),checked:C.git_ai_enabled,onCheckedChange:e=>Ce({...C,git_ai_enabled:e})}),(0,S.jsx)(yg,{id:`auto-updates`,title:n(`自动更新`),description:n(`检测到稳定版本后自动安装`),checked:!r.disable_auto_updates,onCheckedChange:e=>Se({...r,disable_auto_updates:!e})}),(0,S.jsx)(yg,{id:`version-checks`,title:n(`版本检查`),description:n(`在 fetch、pull、push 时检查版本`),checked:!r.disable_version_checks,onCheckedChange:e=>Se({...r,disable_version_checks:!e})}),(0,S.jsx)(yg,{id:`oss-telemetry`,title:n(`上游 OSS 遥测`),description:n(`控制官方版的 Sentry/PostHog 遥测,不等同于细粒度事件过滤`),checked:r.telemetry_oss!==`off`,onCheckedChange:e=>Se({...r,telemetry_oss:e?`on`:`off`})})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`git-path`,children:n(`Git 可执行文件`)}),(0,S.jsx)(fh,{id:`git-path`,className:`font-mono`,value:r.git_path,onChange:e=>Se({...r,git_path:e.target.value})})]}),(0,S.jsxs)(`div`,{className:`grid gap-6 md:grid-cols-2`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`exclude-repositories`,children:n(`排除的仓库`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`每行一个远程地址、路径或通配符。匹配后 Git AI 整体停用。`)}),(0,S.jsx)(Ah,{id:`exclude-repositories`,className:`min-h-44 font-mono text-xs`,value:a,onChange:e=>{let t=e.target.value;o(t),Se({...r,exclude_repositories:og(t)})}})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`exclude-prompts`,children:n(`不保存提示词的仓库`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`每行一个规则,只影响提示词与会话内容。`)}),(0,S.jsx)(Ah,{id:`exclude-prompts`,className:`min-h-44 font-mono text-xs`,value:s,onChange:e=>{let t=e.target.value;c(t),Se({...r,exclude_prompts_in_repositories:og(t)})}})]})]})]})]})}),(0,S.jsxs)(kh,{value:`plugins`,className:`mt-4 space-y-4`,children:[(0,S.jsx)(oh,{size:`sm`,children:(0,S.jsxs)(sh,{className:`gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,S.jsxs)(`div`,{className:`space-y-1`,children:[(0,S.jsx)(ch,{children:n(`Git AI 运行兼容性`)}),(0,S.jsx)(lh,{children:T.distribution===`upstream-oss`?n(`检测到官方上游版:原生设置生效,但官方版没有 custom_metrics 扩展点,下面的仓库和 Skill 细粒度上报规则不会接管 /worker/metrics/upload。仓库插件可以添加多个,主机规则重叠时按列表顺序使用第一个命中插件。`):n(`检测到 custom_metrics 定制版:仓库、Skill、数据类型和字段规则会在请求离开本机前执行。仓库插件可以添加多个,主机规则重叠时按列表顺序使用第一个命中插件。`)})]}),(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,S.jsx)(Km,{variant:`outline`,size:`sm`,onClick:()=>void Ne(`policy`),disabled:ie,children:n(ie?`读取中...`:`查看配置`)}),(0,S.jsx)(ah,{variant:T.granularFilterActive?`secondary`:`outline`,children:T.granularFilterActive?n(`细粒度过滤已接管`):n(`仅原生配置兼容`)})]})]})}),(0,S.jsxs)(oh,{className:`overflow-hidden`,children:[(0,S.jsxs)(sh,{className:`gap-4 border-b bg-muted/30 sm:flex-row sm:items-center sm:justify-between`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsxs)(ah,{variant:`secondary`,children:[(0,S.jsx)(zn,{}),n(`过滤观察`)]}),(0,S.jsxs)(`div`,{children:[(0,S.jsx)(ch,{children:n(`最近 24 小时的拦截记录`)}),(0,S.jsx)(lh,{children:n(`已拦截 {{count}} 次上报,按仓库和 Skill 汇总。`,{count:D.length})})]})]}),(0,S.jsxs)(Km,{variant:`outline`,size:`sm`,onClick:()=>void oe(),disabled:k,children:[(0,S.jsx)(Qn,{className:k?`animate-spin`:void 0}),n(`刷新记录`)]})]}),(0,S.jsxs)(uh,{className:`space-y-4 pt-6`,children:[A?(0,S.jsxs)(`div`,{className:`rounded-lg border border-destructive/40 bg-destructive/5 px-4 py-3 text-sm text-destructive`,children:[n(`无法读取过滤记录:`),A]}):(0,S.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:he.map(({title:t,items:r,emptyMessage:i})=>(0,S.jsxs)(`section`,{className:`overflow-hidden rounded-lg border bg-background`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between border-b bg-muted/40 px-4 py-3`,children:[(0,S.jsx)(`h3`,{className:`text-sm font-medium`,children:t}),(0,S.jsx)(ah,{variant:`outline`,children:n(`{{count}} 项`,{count:r.length})})]}),r.length?(0,S.jsx)(`ul`,{className:`divide-y`,children:r.map(t=>(0,S.jsxs)(`li`,{className:`flex items-start justify-between gap-3 px-4 py-3`,children:[(0,S.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,S.jsx)(`p`,{className:`truncate font-mono text-xs font-medium`,children:t.name}),(0,S.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[pg(t.reason,n),` · `,n(`最近`),` `,dg(t.timestamp,e,n(`时间未知`))]})]}),(0,S.jsx)(ah,{variant:`secondary`,className:`shrink-0`,children:n(`{{count}} 次`,{count:t.count})})]},t.name))}):(0,S.jsx)(`p`,{className:`px-4 py-8 text-center text-sm text-muted-foreground`,children:i})]},t))}),(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`记录仅保存在本机 24 小时,包含时间、仓库或 Skill 标识及拦截原因,不保存上报正文。`)})]})]}),(0,S.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[C.plugins.map(e=>(0,S.jsxs)(oh,{style:{order:ue.get(mg(e.id))},children:[(0,S.jsxs)(sh,{className:`gap-4 sm:flex-row sm:items-start sm:justify-between`,children:[(0,S.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,S.jsxs)(ah,{variant:`secondary`,children:[(0,S.jsx)(Wn,{}),n(`仓库插件`)]}),(0,S.jsx)(fh,{"aria-label":n(`插件名称`),className:`max-w-md text-base font-medium`,value:e.name,onChange:t=>we(e.id,e=>({...e,name:t.target.value}))}),(0,S.jsxs)(lh,{className:`font-mono`,children:[`plugin://`,e.id]})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(ph,{htmlFor:`plugin-${e.id}`,children:n(`启用`)}),(0,S.jsx)(wh,{id:`plugin-${e.id}`,checked:e.enabled,onCheckedChange:t=>we(e.id,e=>({...e,enabled:t}))})]}),(0,S.jsxs)(qm,{children:[(0,S.jsxs)(qh,{children:[(0,S.jsx)(Jh,{asChild:!0,children:(0,S.jsx)(Jm,{asChild:!0,children:(0,S.jsx)(Km,{variant:`ghost`,size:`icon`,"aria-label":n(`删除插件 {{name}}`,{name:e.name}),children:(0,S.jsx)(rr,{})})})}),(0,S.jsx)(Yh,{children:n(`删除当前插件`)})]}),(0,S.jsxs)(Zm,{children:[(0,S.jsxs)(Qm,{children:[(0,S.jsx)(eh,{children:n(`删除仓库插件?`)}),(0,S.jsx)(th,{children:n(`将删除“{{name}}”的全部配置。保存更改前不会写入磁盘。`,{name:e.name})})]}),(0,S.jsxs)($m,{children:[(0,S.jsx)(rh,{children:n(`取消`)}),(0,S.jsx)(nh,{onClick:()=>De(e.id),children:n(`删除`)})]})]})]})]})]}),(0,S.jsxs)(uh,{className:`space-y-6`,children:[(0,S.jsx)(yg,{id:`default-allow`,title:n(`未匹配主机的仓库`),description:n(`控制未命中此插件主机规则的仓库是否允许原始上报`),checked:C.default_allow_unmatched,onCheckedChange:e=>Ce({...C,default_allow_unmatched:e})}),(0,S.jsxs)(`div`,{className:`grid gap-6 md:grid-cols-2`,children:[(0,S.jsxs)(`div`,{className:`space-y-4`,children:[(0,S.jsx)(yg,{id:`global-${e.id}`,title:n(`全部仓库(全局规则)`),description:n(`全局规则始终排在所有特定仓库规则之后,适合作为默认策略。`),checked:e.match.all_repositories,onCheckedChange:t=>we(e.id,e=>({...e,match:{...e.match,all_repositories:t}}))}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`priority-${e.id}`,children:n(`特定规则优先级`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`数值越大越优先;同优先级按插件列表顺序匹配。`)}),(0,S.jsx)(fh,{id:`priority-${e.id}`,type:`number`,min:`0`,max:`1000`,value:e.priority,onChange:t=>{let n=Number.parseInt(t.target.value,10);we(e.id,e=>({...e,priority:Number.isFinite(n)?Math.min(1e3,Math.max(0,n)):0}))}})]})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`directory-${e.id}`,children:n(`Skill 上报目录`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`仅替换此插件允许上传的 Skill 路径。留空则保留原路径。`)}),(0,S.jsx)(fh,{id:`directory-${e.id}`,className:`font-mono`,value:e.fixed_project_directory,onChange:t=>we(e.id,e=>({...e,fixed_project_directory:t.target.value}))}),(0,S.jsxs)(`div`,{className:`rounded-lg border bg-muted/50 p-3`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,S.jsx)(Un,{className:`size-4`}),n(`上报目录预览`)]}),(0,S.jsx)(`p`,{className:`mt-2 break-all font-mono text-xs text-muted-foreground`,children:e.fixed_project_directory||n(`保留原路径`)})]})]})]}),!e.match.all_repositories&&(0,S.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`hosts-${e.id}`,children:n(`匹配仓库主机`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n("每行一条,可用 `github.com` 或 `*github.com*`。")}),(0,S.jsx)(Ah,{id:`hosts-${e.id}`,className:`min-h-28 font-mono text-xs`,value:h[sg(e.id,`hosts`)]??ag(e.match.hosts),onChange:t=>Te(e.id,`hosts`,t.target.value)})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`repositories-${e.id}`,children:n(`匹配仓库`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`每行一条,可填 owner/repo、远程地址或通配符。`)}),(0,S.jsx)(Ah,{id:`repositories-${e.id}`,className:`min-h-28 font-mono text-xs`,value:h[sg(e.id,`repositories`)]??ag(e.match.repositories),onChange:t=>Te(e.id,`repositories`,t.target.value)})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`directories-${e.id}`,children:n(`匹配项目目录`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n("多条件会同时生效;可用 `/work/*` 缩小范围。")}),(0,S.jsx)(Ah,{id:`directories-${e.id}`,className:`min-h-28 font-mono text-xs`,value:h[sg(e.id,`directories`)]??ag(e.match.directories),onChange:t=>Te(e.id,`directories`,t.target.value)})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`branches-${e.id}`,children:n(`匹配分支`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`每行一条,例如 main、release/* 或 feature/*。`)}),(0,S.jsx)(Ah,{id:`branches-${e.id}`,className:`min-h-28 font-mono text-xs`,value:h[sg(e.id,`branches`)]??ag(e.match.branches),onChange:t=>Te(e.id,`branches`,t.target.value)})]})]}),(0,S.jsx)(Sh,{}),(0,S.jsxs)(`div`,{className:`space-y-3`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`h3`,{className:`text-sm font-medium`,children:n(`允许上传的数据`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`每类事件可单独启用,关闭时请求会在本机被拦截。`)})]}),(0,S.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:Object.keys(Xh).map(t=>(0,S.jsx)(bg,{id:`${e.id}-event-${t}`,label:de[t],checked:e.allow[t],onCheckedChange:n=>we(e.id,e=>({...e,allow:{...e.allow,[t]:n}}))},t))})]}),(0,S.jsxs)(`div`,{className:`space-y-3`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`h3`,{className:`text-sm font-medium`,children:n(`允许保留的字段`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`关闭的仓库、目录和分支字段会在请求离开本机前删除。`)})]}),(0,S.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:Object.keys(Zh).map(t=>(0,S.jsx)(bg,{id:`${e.id}-field-${t}`,label:fe[t],checked:e.fields[t],onCheckedChange:n=>we(e.id,e=>({...e,fields:{...e.fields,[t]:n}}))},t))})]})]}),(0,S.jsxs)(dh,{className:`justify-between border-t`,children:[(0,S.jsx)(ah,{variant:e.enabled?`outline`:`secondary`,children:e.enabled?n(`{{allowed}}/7 数据类型 · {{fields}}/3 字段`,{allowed:Object.values(e.allow).filter(Boolean).length,fields:Object.values(e.fields).filter(Boolean).length}):n(`插件已停用`)}),(0,S.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.match.all_repositories?n(`全局默认策略`):n(`特定规则 · 优先级 {{priority}}`,{priority:e.priority})})]})]},e.id)),C.skill_policy.installed&&(0,S.jsxs)(oh,{style:{order:ue.get(`skill_filter`)},children:[(0,S.jsxs)(sh,{className:`gap-4 sm:flex-row sm:items-start sm:justify-between`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsxs)(ah,{variant:`secondary`,children:[(0,S.jsx)(qn,{}),n(`Skill 过滤插件`)]}),(0,S.jsx)(ch,{children:n(`Skill 关键词过滤`)}),(0,S.jsx)(lh,{children:n(`根据 Skill 名称拦截指定类型的调用。`)})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(ph,{htmlFor:`skill-enabled`,children:n(`启用`)}),(0,S.jsx)(wh,{id:`skill-enabled`,checked:C.skill_policy.enabled,onCheckedChange:e=>Ce({...C,skill_policy:{...C.skill_policy,enabled:e}})})]}),(0,S.jsxs)(qm,{children:[(0,S.jsxs)(qh,{children:[(0,S.jsx)(Jh,{asChild:!0,children:(0,S.jsx)(Jm,{asChild:!0,children:(0,S.jsx)(Km,{variant:`ghost`,size:`icon`,"aria-label":n(`删除插件 Skill 过滤插件`),children:(0,S.jsx)(rr,{})})})}),(0,S.jsx)(Yh,{children:n(`删除 Skill 过滤插件`)})]}),(0,S.jsxs)(Zm,{children:[(0,S.jsxs)(Qm,{children:[(0,S.jsx)(eh,{children:n(`删除 Skill 过滤插件?`)}),(0,S.jsx)(th,{children:n(`删除后关键词拦截将停用,现有关键词会保留,重新添加插件时可以继续使用。`)})]}),(0,S.jsxs)($m,{children:[(0,S.jsx)(rh,{children:n(`取消`)}),(0,S.jsx)(nh,{onClick:Oe,children:n(`删除`)})]})]})]})]})]}),(0,S.jsx)(uh,{children:(0,S.jsxs)(`div`,{className:`max-w-2xl space-y-6`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`blocked-patterns`,children:n(`拦截关键词 / 正则`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`每行一个,不区分大小写。命中 skillName、skill 或 name 即拦截。`)}),(0,S.jsx)(Ah,{id:`blocked-patterns`,className:`min-h-72 font-mono text-xs`,value:l,onChange:e=>{let t=e.target.value;u(t),Ce({...C,skill_policy:{...C.skill_policy,blocked_patterns:og(t)}})}})]}),(0,S.jsxs)(`div`,{className:`space-y-4 border-t pt-6`,children:[(0,S.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,S.jsxs)(`div`,{className:`space-y-1`,children:[(0,S.jsx)(ph,{htmlFor:`recent-directory-guard`,children:n(`新目录观察期`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`目录创建未满 7 天的 Skill 首次上报会拦截 24 小时;到期未处理则自动放行。`)})]}),(0,S.jsx)(wh,{id:`recent-directory-guard`,checked:C.skill_policy.recent_directory_guard.enabled,onCheckedChange:e=>Ce({...C,skill_policy:{...C.skill_policy,recent_directory_guard:{...C.skill_policy.recent_directory_guard,enabled:e}}})})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`recent-directory-allowlist`,children:n(`观察期白名单`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`每行一个 Skill 名称或正则;命中后立即放行新目录观察期。`)}),(0,S.jsx)(Ah,{id:`recent-directory-allowlist`,className:`min-h-28 font-mono text-xs`,value:d,onChange:e=>{let t=e.target.value;f(t),Ce({...C,skill_policy:{...C.skill_policy,recent_directory_guard:{...C.skill_policy.recent_directory_guard,allowlist_patterns:og(t)}}})}})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`recent-directory-blocklist`,children:n(`Skill 黑名单`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`每行一个 Skill 名称或正则;命中后持续拦截,不受 24 小时观察期限制。`)}),(0,S.jsx)(Ah,{id:`recent-directory-blocklist`,className:`min-h-28 font-mono text-xs`,value:p,onChange:e=>{let t=e.target.value;m(t),Ce({...C,skill_policy:{...C.skill_policy,recent_directory_guard:{...C.skill_policy.recent_directory_guard,blocklist_patterns:og(t)}}})}})]})]})]})}),(0,S.jsxs)(dh,{className:`justify-between border-t`,children:[(0,S.jsx)(ah,{variant:C.skill_policy.enabled?`outline`:`secondary`,children:C.skill_policy.enabled?n(`{{count}} 条拦截规则`,{count:C.skill_policy.blocked_patterns.length}):n(`插件已停用`)}),(0,S.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n(`仅处理 Skill 调用名称`)})]})]}),C.sensitive_data_policy.installed&&(0,S.jsxs)(oh,{style:{order:ue.get(`sensitive_data`)},children:[(0,S.jsxs)(sh,{className:`gap-4 sm:flex-row sm:items-start sm:justify-between`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsxs)(ah,{variant:`secondary`,children:[(0,S.jsx)(tr,{}),n(`敏感内容脱敏插件`)]}),(0,S.jsx)(ch,{children:n(`请求内容二次保护`)}),(0,S.jsx)(lh,{children:n(`在请求离开本机前检测文本。不会保存命中的原始内容。`)})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(ph,{htmlFor:`sensitive-enabled`,children:n(`启用`)}),(0,S.jsx)(wh,{id:`sensitive-enabled`,checked:C.sensitive_data_policy.enabled,onCheckedChange:e=>Ce({...C,sensitive_data_policy:{...C.sensitive_data_policy,enabled:e}})}),(0,S.jsx)(Km,{variant:`ghost`,size:`icon`,"aria-label":n(`删除敏感内容脱敏插件`),onClick:()=>ke(`sensitive_data_policy`),children:(0,S.jsx)(rr,{})})]})]}),(0,S.jsxs)(uh,{className:`space-y-6`,children:[(0,S.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`sensitive-action`,children:n(`命中后的动作`)}),(0,S.jsxs)(`select`,{id:`sensitive-action`,className:`h-9 w-full rounded-md border bg-background px-3 text-sm`,value:C.sensitive_data_policy.action,onChange:e=>Ce({...C,sensitive_data_policy:{...C.sensitive_data_policy,action:e.target.value}}),children:[(0,S.jsx)(`option`,{value:`redact`,children:n(`脱敏后继续上报`)}),(0,S.jsx)(`option`,{value:`block`,children:n(`直接阻止上报`)})]})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`sensitive-patterns`,children:n(`自定义正则`)}),(0,S.jsx)(Ah,{id:`sensitive-patterns`,className:`min-h-24 font-mono text-xs`,placeholder:n(`每行一个正则`),value:v,onChange:e=>{let t=e.target.value;y(t),Ce({...C,sensitive_data_policy:{...C.sensitive_data_policy,custom_patterns:og(t)}})}})]})]}),(0,S.jsxs)(`div`,{className:`space-y-3`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`h3`,{className:`text-sm font-medium`,children:n(`内置识别规则`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`默认启用密钥、私钥和凭据;邮箱与手机号由你决定是否纳入。`)})]}),(0,S.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-5`,children:[[`api_key`,`API Key`],[`private_key`,n(`私钥`)],[`credential`,n(`密码 / 凭据`)],[`email`,n(`邮箱`)],[`phone`,n(`手机号`)]].map(([e,t])=>(0,S.jsx)(bg,{id:`sensitive-${e}`,label:t,checked:C.sensitive_data_policy.built_in_rules[e],onCheckedChange:t=>Ce({...C,sensitive_data_policy:{...C.sensitive_data_policy,built_in_rules:{...C.sensitive_data_policy.built_in_rules,[e]:t}}})},e))})]}),(0,S.jsxs)(`div`,{className:`space-y-3`,children:[(0,S.jsx)(`h3`,{className:`text-sm font-medium`,children:n(`作用数据类型`)}),(0,S.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:Object.keys(Xh).map(e=>(0,S.jsx)(bg,{id:`sensitive-event-${e}`,label:Xh[e],checked:C.sensitive_data_policy.event_types[e],onCheckedChange:t=>Ce({...C,sensitive_data_policy:{...C.sensitive_data_policy,event_types:{...C.sensitive_data_policy.event_types,[e]:t}}})},e))})]})]})]}),C.agent_model_policy.installed&&(0,S.jsxs)(oh,{style:{order:ue.get(`agent_model`)},children:[(0,S.jsxs)(sh,{className:`gap-4 sm:flex-row sm:items-start sm:justify-between`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsxs)(ah,{variant:`secondary`,children:[(0,S.jsx)(Bn,{}),n(`Agent / 模型治理插件`)]}),(0,S.jsx)(ch,{children:n(`允许名单与阻止规则`)}),(0,S.jsx)(lh,{children:n(`允许名单支持通配符;审计模式只记录本地统计,阻止模式会拦截不合规上报。`)})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(ph,{htmlFor:`agent-model-enabled`,children:n(`启用`)}),(0,S.jsx)(wh,{id:`agent-model-enabled`,checked:C.agent_model_policy.enabled,onCheckedChange:e=>Ce({...C,agent_model_policy:{...C.agent_model_policy,enabled:e}})}),(0,S.jsx)(Km,{variant:`ghost`,size:`icon`,"aria-label":n(`删除 Agent / 模型治理插件`),onClick:()=>ke(`agent_model_policy`),children:(0,S.jsx)(rr,{})})]})]}),(0,S.jsxs)(uh,{className:`space-y-6`,children:[(0,S.jsxs)(`div`,{className:`max-w-md space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`agent-model-mode`,children:n(`治理模式`)}),(0,S.jsxs)(`select`,{id:`agent-model-mode`,className:`h-9 w-full rounded-md border bg-background px-3 text-sm`,value:C.agent_model_policy.mode,onChange:e=>Ce({...C,agent_model_policy:{...C.agent_model_policy,mode:e.target.value}}),children:[(0,S.jsx)(`option`,{value:`audit`,children:n(`仅审计,不阻止`)}),(0,S.jsx)(`option`,{value:`block`,children:n(`命中规则时阻止`)})]})]}),(0,S.jsx)(`div`,{className:`grid gap-4 md:grid-cols-3`,children:[[`allowed_agents`,n(`允许的 Agent`),n(`例如 codex、claude*`)],[`allowed_models`,n(`允许的模型`),n(`例如 gpt-5*、claude-sonnet-*`)],[`blocked_patterns`,n(`阻止正则`),n(`每行一个,不区分大小写`)]].map(([e,t,n])=>(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`agent-model-${e}`,children:t}),(0,S.jsx)(Ah,{id:`agent-model-${e}`,className:`min-h-40 font-mono text-xs`,placeholder:n,value:b[e],onChange:t=>{let n=t.target.value;x(t=>({...t,[e]:n})),Ce({...C,agent_model_policy:{...C.agent_model_policy,[e]:og(n)}})}})]},e))})]})]}),!C.plugins.length&&!C.skill_policy.installed&&!C.sensitive_data_policy.installed&&!C.agent_model_policy.installed&&(0,S.jsx)(oh,{children:(0,S.jsxs)(uh,{className:`flex min-h-40 flex-col items-center justify-center gap-2 text-center`,children:[(0,S.jsx)(Zn,{className:`size-6 text-muted-foreground`}),(0,S.jsx)(`p`,{className:`font-medium`,children:n(`还没有安装插件`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`添加插件后,这里会出现对应类型的配置模块。`)})]})})]}),(0,S.jsxs)(mh,{open:P,onOpenChange:re,children:[(0,S.jsx)(hh,{asChild:!0,children:(0,S.jsxs)(Km,{variant:`outline`,className:`w-full`,disabled:!xe.length,children:[(0,S.jsx)(Xn,{}),xe.length?n(`添加插件`):n(`所有可用插件均已添加`)]})}),(0,S.jsxs)(vh,{children:[(0,S.jsxs)(yh,{children:[(0,S.jsx)(bh,{children:n(`添加插件`)}),(0,S.jsx)(xh,{children:n(`仓库插件可以添加多个;其余插件使用独立配置表单且每种只能添加一次。新插件会追加到当前列表最后。`)})]}),(0,S.jsxs)(`div`,{className:`grid gap-2`,children:[xe.includes(`repository`)&&(0,S.jsxs)(Km,{variant:`outline`,className:`h-auto justify-start gap-3 p-4 text-left`,onClick:()=>Ee(`repository`),children:[(0,S.jsx)(Wn,{className:`size-5`}),(0,S.jsxs)(`span`,{className:`space-y-1`,children:[(0,S.jsx)(`span`,{className:`block font-medium`,children:n(`仓库插件`)}),(0,S.jsx)(`span`,{className:`block text-xs font-normal text-muted-foreground`,children:n(`配置仓库主机、上传类型、目录与字段脱敏`)})]})]}),xe.includes(`skill_filter`)&&(0,S.jsxs)(Km,{variant:`outline`,className:`h-auto justify-start gap-3 p-4 text-left`,onClick:()=>Ee(`skill_filter`),children:[(0,S.jsx)(qn,{className:`size-5`}),(0,S.jsxs)(`span`,{className:`space-y-1`,children:[(0,S.jsx)(`span`,{className:`block font-medium`,children:n(`Skill 过滤插件`)}),(0,S.jsx)(`span`,{className:`block text-xs font-normal text-muted-foreground`,children:n(`配置需要拦截的 Skill 名称关键词或正则`)})]})]}),xe.includes(`sensitive_data`)&&(0,S.jsxs)(Km,{variant:`outline`,className:`h-auto justify-start gap-3 p-4 text-left`,onClick:()=>Ee(`sensitive_data`),children:[(0,S.jsx)(tr,{className:`size-5`}),(0,S.jsxs)(`span`,{className:`space-y-1`,children:[(0,S.jsx)(`span`,{className:`block font-medium`,children:n(`敏感内容脱敏`)}),(0,S.jsx)(`span`,{className:`block text-xs font-normal text-muted-foreground`,children:n(`检测密钥、私钥、凭据等文本,可脱敏或阻止上报`)})]})]}),xe.includes(`agent_model`)&&(0,S.jsxs)(Km,{variant:`outline`,className:`h-auto justify-start gap-3 p-4 text-left`,onClick:()=>Ee(`agent_model`),children:[(0,S.jsx)(Bn,{className:`size-5`}),(0,S.jsxs)(`span`,{className:`space-y-1`,children:[(0,S.jsx)(`span`,{className:`block font-medium`,children:n(`Agent / 模型治理`)}),(0,S.jsx)(`span`,{className:`block text-xs font-normal text-muted-foreground`,children:n(`设置 Agent、模型允许名单与阻止规则`)})]})]})]})]})]})]})]})]}),(0,S.jsx)(mh,{open:!!F,onOpenChange:e=>{e||I(null)},children:(0,S.jsxs)(vh,{className:`w-[96vw] max-w-6xl sm:max-w-6xl`,children:[(0,S.jsxs)(yh,{children:[(0,S.jsx)(bh,{children:F?.title}),(0,S.jsx)(xh,{children:F?.description})]}),(0,S.jsx)(`div`,{className:`max-h-[70svh] overflow-auto rounded-lg border bg-muted/50 p-4`,children:F&&(0,S.jsx)(z,{value:F.content,collapsed:!1,displayDataTypes:!1,enableClipboard:!1,shortenTextAfterLength:0,style:On})})]})}),(0,S.jsx)(`footer`,{className:`fixed inset-x-0 bottom-0 z-20 border-t bg-background/95 backdrop-blur`,children:(0,S.jsxs)(`div`,{className:`mx-auto flex max-w-6xl flex-col gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:px-6`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,S.jsx)(Vn,{className:`size-4 ${j?`text-amber-600`:`text-emerald-600`}`}),n(j?`有未保存的更改`:`配置已同步`)]}),(0,S.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,S.jsxs)(Km,{variant:`outline`,onClick:je,disabled:ne,children:[(0,S.jsx)(Hn,{}),n(`验证配置`)]}),(0,S.jsxs)(Km,{variant:`outline`,onClick:Me,disabled:ne,children:[(0,S.jsx)(Qn,{className:ne?`animate-spin`:``}),n(`重启过滤服务`)]}),(0,S.jsxs)(Km,{onClick:Ae,disabled:ne||!j,children:[ne?(0,S.jsx)(Jn,{className:`animate-spin`}):(0,S.jsx)($n,{}),n(`保存更改`)]})]})]})})]}),(0,S.jsx)(Gh,{position:`top-right`,richColors:!0,closeButton:!0,duration:5e3})]})}(0,v.createRoot)(document.getElementById(`root`)).render((0,S.jsx)(_.StrictMode,{children:(0,S.jsx)(Rh,{attribute:`class`,defaultTheme:`light`,enableSystem:!1,children:(0,S.jsx)(Sg,{})})}));
|
|
50
|
+
`):``}function og(e){return e.split(/\r?\n/).map(e=>e.trim()).filter(Boolean)}function sg(e,t){return`${e}:${t}`}function cg(e){return Object.fromEntries(e.flatMap(e=>Qh.map(t=>[sg(e.id,t),ag(e.match[t])])))}function lg(e){return Object.fromEntries($h.map(t=>[t,ag(e[t])]))}function ug(e,t){let n=new Map;for(let r of e)for(let e of r[t]){let t=n.get(e);t?(t.count+=1,r.timestamp>t.timestamp&&(t.timestamp=r.timestamp,t.reason=r.reason)):n.set(e,{name:e,count:1,timestamp:r.timestamp,reason:r.reason})}return[...n.values()].sort((e,t)=>t.timestamp.localeCompare(e.timestamp)||t.count-e.count)}function dg(e,t,n){let r=new Date(e);return Number.isNaN(r.getTime())?n:new Intl.DateTimeFormat(t,{month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}).format(r)}function fg(e,t,n){let r=new Date(e);return Number.isNaN(r.getTime())?n:new Intl.DateTimeFormat(t,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`}).format(r)}function pg(e,t){return e===`skill_pattern`?t(`命中 Skill 规则`):e===`recent_directory_skill_hold`?t(`新目录观察期`):e===`recent_directory_skill_blocklist`?t(`新目录黑名单`):e===`default_deny`?t(`未匹配仓库默认拦截`):e===`git_ai_paused`?t(`Git AI 已暂停`):e===`sensitive_content`?t(`命中敏感内容规则`):e===`agent_model_policy`?t(`命中 Agent / 模型规则`):e.startsWith(`plugin:`)?t(`命中仓库插件策略`):e||t(`已拦截`)}function mg(e){return`repository:${e}`}function hg(e,t){let n=[...t.plugins.map(e=>mg(e.id)),...t.skill_policy.installed?[`skill_filter`]:[],...t.sensitive_data_policy.installed?[`sensitive_data`]:[],...t.agent_model_policy.installed?[`agent_model`]:[]],r=new Set(n),i=[];for(let t of e??[])r.has(t)&&!i.includes(t)&&i.push(t);return[...i,...n.filter(e=>!i.includes(e))]}function gg(e){let t=e.skill_policy,n={...e,version:2,git_ai_enabled:e.git_ai_enabled??!0,skill_policy:{installed:e.skill_policy.installed??!0,enabled:e.skill_policy.enabled,blocked_patterns:e.skill_policy.blocked_patterns,recent_directory_guard:{...ig,...e.skill_policy.recent_directory_guard,allowlist_patterns:e.skill_policy.recent_directory_guard?.allowlist_patterns??[],blocklist_patterns:e.skill_policy.recent_directory_guard?.blocklist_patterns??[]}},plugins:e.plugins.map(e=>({...e,priority:e.priority??100,match:{all_repositories:e.match?.all_repositories??!1,hosts:e.match?.hosts??[],repositories:e.match?.repositories??[],directories:e.match?.directories??[],branches:e.match?.branches??[]},fixed_project_directory:e.fixed_project_directory??(e.id===`github`?t.fixed_project_directory??``:``)})),sensitive_data_policy:{...ng,...e.sensitive_data_policy,event_types:{...tg,...e.sensitive_data_policy?.event_types},built_in_rules:{...ng.built_in_rules,...e.sensitive_data_policy?.built_in_rules},custom_patterns:e.sensitive_data_policy?.custom_patterns??[]},agent_model_policy:{...rg,...e.agent_model_policy,allowed_agents:e.agent_model_policy?.allowed_agents??[],allowed_models:e.agent_model_policy?.allowed_models??[],blocked_patterns:e.agent_model_policy?.blocked_patterns??[]},plugin_order:[]};return n.plugin_order=hg(e.plugin_order,n),n}function _g(e){let t=1;for(;e.some(e=>e.id===`repository-${t}`);)t+=1;return`repository-${t}`}async function vg(e){let t=await e.json().catch(()=>({}));if(!e.ok||t.ok===!1)throw Error(t.message||`Request failed: ${e.status}`);return t}function yg({id:e,title:t,description:n,checked:r,onCheckedChange:i}){return(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-6 rounded-lg border p-4`,children:[(0,S.jsxs)(`div`,{className:`space-y-1`,children:[(0,S.jsx)(ph,{htmlFor:e,children:t}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n})]}),(0,S.jsx)(wh,{id:e,checked:r,onCheckedChange:i})]})}function bg({id:e,label:t,checked:n,onCheckedChange:r}){return(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border p-3`,children:[(0,S.jsx)(ph,{htmlFor:e,className:`font-normal`,children:t}),(0,S.jsx)(wh,{id:e,checked:n,onCheckedChange:r})]})}function xg(){return(0,S.jsxs)(`div`,{className:`mx-auto flex min-h-svh max-w-6xl flex-col gap-6 px-4 py-8 sm:px-6`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(Ch,{className:`h-8 w-64`}),(0,S.jsx)(Ch,{className:`h-4 w-80`})]}),(0,S.jsx)(Ch,{className:`h-8 w-28`})]}),(0,S.jsx)(Ch,{className:`h-24 w-full`}),(0,S.jsx)(Ch,{className:`h-[420px] w-full`})]})}function Sg(){let[e,t]=(0,_.useState)(()=>{try{let e=window.localStorage.getItem(`git-ai-control-language`);if(e===`zh-CN`||e===`en`)return e}catch{}return Rr()}),n=(0,_.useCallback)((t,n)=>zr(e,t,n),[e]),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(``),[p,m]=(0,_.useState)(``),[h,g]=(0,_.useState)({}),[v,y]=(0,_.useState)(``),[b,x]=(0,_.useState)(()=>lg(rg)),[C,w]=(0,_.useState)(null),[T,E]=(0,_.useState)({ok:!1}),[D,O]=(0,_.useState)([]),[k,ee]=(0,_.useState)(!1),[A,te]=(0,_.useState)(``),[j,M]=(0,_.useState)(!1),[ne,N]=(0,_.useState)(!1),[P,re]=(0,_.useState)(!1),[ie,ae]=(0,_.useState)(!1),[F,I]=(0,_.useState)(null);(0,_.useEffect)(()=>{document.documentElement.lang=e,document.title=n(`Git AI 配置中心`);try{window.localStorage.setItem(`git-ai-control-language`,e)}catch{}},[e,n]);let L=(0,_.useCallback)(async()=>{try{let e=await vg(await fetch(`/api/config`,{cache:`no-store`})),t={...eg,...e.gitAi};i(t),o(ag(t.exclude_repositories)),c(ag(t.exclude_prompts_in_repositories));let n=gg(e.policy);u(ag(n.skill_policy.blocked_patterns)),f(ag(n.skill_policy.recent_directory_guard.allowlist_patterns)),m(ag(n.skill_policy.recent_directory_guard.blocklist_patterns)),g(cg(n.plugins)),y(ag(n.sensitive_data_policy.custom_patterns)),x(lg(n.agent_model_policy)),w(n),E(e.runtime??{ok:!1}),M(!1)}catch(e){xr.error(e instanceof Error?e.message:n(`读取配置失败`))}},[n]),oe=(0,_.useCallback)(async()=>{ee(!0);try{let e=await vg(await fetch(`/api/filter-events`,{cache:`no-store`}));O(Array.isArray(e.events)?e.events:[]),te(``)}catch(e){te(e instanceof Error?e.message:n(`读取过滤记录失败`))}finally{ee(!1)}},[n]);(0,_.useEffect)(()=>{let e=window.requestAnimationFrame(()=>void L());return()=>window.cancelAnimationFrame(e)},[L]),(0,_.useEffect)(()=>{let e=window.requestAnimationFrame(()=>void oe()),t=window.setInterval(()=>void oe(),3e4);return()=>{window.cancelAnimationFrame(e),window.clearInterval(t)}},[oe]);let R=(0,_.useMemo)(()=>C?.plugins.filter(e=>e.enabled)??[],[C]),se=(0,_.useMemo)(()=>R.reduce((e,t)=>e+Object.values(t.allow).filter(Boolean).length,0),[R]),ce=(C?.plugins.length??0)+ +!!C?.skill_policy.installed+ +!!C?.sensitive_data_policy.installed+ +!!C?.agent_model_policy.installed,le=(C?.plugins.filter(e=>e.enabled).length??0)+(C?.skill_policy.installed&&C.skill_policy.enabled?1:0)+(C?.sensitive_data_policy.installed&&C.sensitive_data_policy.enabled?1:0)+(C?.agent_model_policy.installed&&C.agent_model_policy.enabled?1:0),ue=(0,_.useMemo)(()=>new Map(C?.plugin_order.map((e,t)=>[e,t])),[C?.plugin_order]),de=(0,_.useMemo)(()=>Object.fromEntries(Object.entries(Xh).map(([e,t])=>[e,n(t)])),[n]),fe=(0,_.useMemo)(()=>Object.fromEntries(Object.entries(Zh).map(([e,t])=>[e,n(t)])),[n]),pe=(0,_.useMemo)(()=>ug(D,`repositories`),[D]),me=(0,_.useMemo)(()=>ug(D,`skills`),[D]),he=(0,_.useMemo)(()=>[{title:n(`仓库`),items:pe,emptyMessage:n(`尚未拦截包含仓库信息的上报`)},{title:`Skills`,items:me,emptyMessage:n(`尚未拦截 Skill 调用`)}],[pe,me,n]),ge=T.gitAiEnabled??C?.git_ai_enabled??!0,_e=C?.git_ai_enabled!==ge,ve=T.filter?.ok===!0,ye=fg(T.gitAiUpdatedAt??``,e,n(`时间未知`)),be=fg(`2026-09-09T13:00:00+08:00`,e,n(`时间未知`)),xe=(0,_.useMemo)(()=>{let e=[];return C&&e.push(`repository`),C?.skill_policy.installed||e.push(`skill_filter`),C?.sensitive_data_policy.installed||e.push(`sensitive_data`),C?.agent_model_policy.installed||e.push(`agent_model`),e},[C]),Se=e=>{i(e),M(!0)},Ce=e=>{w(e),M(!0)},we=(e,t)=>{C&&Ce({...C,plugins:C.plugins.map(n=>n.id===e?t(n):n)})},Te=(e,t,n)=>{g(r=>({...r,[sg(e,t)]:n})),we(e,e=>({...e,match:{...e.match,[t]:og(n)}}))},Ee=e=>{if(C){if(e===`repository`){let e=_g(C.plugins);g(t=>({...t,[sg(e,`hosts`)]:`example.com`,[sg(e,`repositories`)]:``,[sg(e,`directories`)]:``,[sg(e,`branches`)]:``})),Ce({...C,plugins:[...C.plugins,{id:e,name:n(`仓库插件 {{count}}`,{count:C.plugins.length+1}),enabled:!0,priority:100,match:{all_repositories:!1,hosts:[`example.com`],repositories:[],directories:[],branches:[]},fixed_project_directory:``,allow:Object.fromEntries(Object.keys(Xh).map(e=>[e,!1])),fields:Object.fromEntries(Object.keys(Zh).map(e=>[e,!1]))}],plugin_order:[...C.plugin_order,mg(e)]})}else e===`skill_filter`?Ce({...C,skill_policy:{...C.skill_policy,installed:!0,enabled:!0},plugin_order:[...C.plugin_order,`skill_filter`]}):e===`sensitive_data`?Ce({...C,sensitive_data_policy:{...ng,installed:!0,enabled:!0},plugin_order:[...C.plugin_order,`sensitive_data`]}):e===`agent_model`&&Ce({...C,agent_model_policy:{...rg,installed:!0,enabled:!0},plugin_order:[...C.plugin_order,`agent_model`]});re(!1)}},De=e=>{C&&(g(t=>Object.fromEntries(Object.entries(t).filter(([t])=>!t.startsWith(`${e}:`)))),Ce({...C,plugins:C.plugins.filter(t=>t.id!==e),plugin_order:C.plugin_order.filter(t=>t!==mg(e))}))},Oe=()=>{C&&Ce({...C,skill_policy:{...C.skill_policy,installed:!1,enabled:!1},plugin_order:C.plugin_order.filter(e=>e!==`skill_filter`)})},ke=e=>{C&&Ce({...C,[e]:{...C[e],installed:!1,enabled:!1},plugin_order:C.plugin_order.filter(t=>t!==(e===`sensitive_data_policy`?`sensitive_data`:`agent_model`))})},Ae=async()=>{if(!(!r||!C)){N(!0);try{let e=await vg(await fetch(`/api/config`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({gitAi:r,policy:C})})),t={...eg,...e.gitAi};i(t),o(ag(t.exclude_repositories)),c(ag(t.exclude_prompts_in_repositories));let a=gg(e.policy);u(ag(a.skill_policy.blocked_patterns)),f(ag(a.skill_policy.recent_directory_guard.allowlist_patterns)),m(ag(a.skill_policy.recent_directory_guard.blocklist_patterns)),g(cg(a.plugins)),y(ag(a.sensitive_data_policy.custom_patterns)),x(lg(a.agent_model_policy)),w(a),e.runtime&&E(e.runtime),M(!1),xr.success(n(`配置已保存,下一次上报立即使用新策略`))}catch(e){xr.error(e instanceof Error?e.message:n(`保存失败`))}finally{N(!1)}}},je=async()=>{N(!0);let t=xr.loading(n(`正在验证配置`),{description:n(`检查插件策略、过滤脚本和本地服务连接…`)});try{let r=await fetch(`/api/test`,{method:`POST`}),i=await r.json().catch(()=>({}));if(!r.ok||!Array.isArray(i.checks))throw Error(i.message||`Request failed: ${r.status}`);let a=i.checks.filter(e=>!e.ok);a.length?xr.error(n(`配置验证失败`),{id:t,description:a.map(e=>e.message?`${e.name}:${e.message}`:e.name).join(e===`zh-CN`?`;`:`; `)}):xr.success(n(`配置验证通过`),{id:t,description:i.checks.map(e=>e.name).join(e===`zh-CN`?`、`:`, `)})}catch(e){xr.error(n(`配置验证失败`),{id:t,description:e instanceof Error?e.message:n(`验证请求失败`)})}finally{N(!1)}},Me=async()=>{N(!0);try{let e=await vg(await fetch(`/api/restart-filter`,{method:`POST`}));xr.success(e.message||n(`过滤服务已重启`)),window.setTimeout(()=>void L(),900)}catch(e){xr.error(e instanceof Error?e.message:n(`重启失败`))}finally{N(!1)}},Ne=async e=>{ae(!0);try{let t=await vg(await fetch(`/api/config`,{cache:`no-store`}));I(e===`gitAi`?{title:n(`当前 Git AI 原生配置`),description:n(`读取 ~/.git-ai/config.json 中由本页面管理的已保存字段,未保存更改和敏感未知字段不会显示。`),content:t.gitAi}:{title:n(`当前插件策略配置`),description:n(`读取 ~/.git-ai/filter_plugins.json 中已写入磁盘的完整插件策略,未保存更改不会显示。`),content:t.policy})}catch(e){xr.error(e instanceof Error?e.message:n(`读取当前配置失败`))}finally{ae(!1)}};return!r||!C?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(xg,{}),(0,S.jsx)(Gh,{position:`top-right`,richColors:!0,closeButton:!0,duration:5e3})]}):(0,S.jsxs)(Kh,{children:[(0,S.jsxs)(`div`,{className:`min-h-svh bg-muted/30 pb-24`,children:[(0,S.jsx)(`header`,{className:`border-b bg-background`,children:(0,S.jsxs)(`div`,{className:`mx-auto flex max-w-6xl flex-col gap-4 px-4 py-6 sm:flex-row sm:items-center sm:justify-between sm:px-6`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,S.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-lg bg-primary text-primary-foreground`,children:(0,S.jsx)(nr,{className:`size-5`})}),(0,S.jsxs)(`div`,{children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`h1`,{className:`text-xl font-semibold`,children:n(`Git AI 配置中心`)}),(0,S.jsxs)(ah,{variant:`outline`,className:`font-mono text-xs font-normal`,children:[`v`,`0.4.14`]})]}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`本机插件策略与上传权限`)})]})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(`label`,{className:`sr-only`,htmlFor:`language`,children:n(`语言`)}),(0,S.jsxs)(`div`,{className:`flex h-8 items-center gap-1 rounded-md border bg-background px-2 text-sm`,children:[(0,S.jsx)(Kn,{className:`size-3.5 text-muted-foreground`}),(0,S.jsxs)(`select`,{id:`language`,"aria-label":n(`语言`),className:`bg-transparent text-sm outline-none`,value:e,onChange:e=>t(e.target.value),children:[(0,S.jsx)(`option`,{value:`zh-CN`,children:`中文`}),(0,S.jsx)(`option`,{value:`en`,children:`English`})]})]}),(0,S.jsxs)(ah,{variant:T.distribution===`upstream-oss`?`outline`:T.ok?`secondary`:`destructive`,children:[(0,S.jsx)(zn,{className:`size-3.5`}),T.distribution===`upstream-oss`?n(`上游 OSS · 原生配置`):T.ok?n(`定制版 · 过滤在线`):n(`定制版 · 过滤异常`)]})]})]})}),(0,S.jsxs)(`main`,{className:`mx-auto max-w-6xl space-y-6 px-4 py-6 sm:px-6`,children:[(0,S.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-5`,children:[(0,S.jsx)(oh,{size:`sm`,children:(0,S.jsxs)(sh,{children:[(0,S.jsx)(lh,{children:n(`已安装插件`)}),(0,S.jsxs)(ch,{className:`flex items-baseline gap-2 text-2xl`,children:[ce,(0,S.jsx)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:n(`{{count}} 个启用`,{count:le})})]})]})}),(0,S.jsx)(oh,{size:`sm`,children:(0,S.jsxs)(sh,{children:[(0,S.jsx)(lh,{children:n(`允许的数据通道`)}),(0,S.jsx)(ch,{className:`text-2xl`,children:se})]})}),(0,S.jsx)(oh,{size:`sm`,children:(0,S.jsxs)(sh,{children:[(0,S.jsx)(lh,{children:n(`配置状态`)}),(0,S.jsxs)(ch,{className:`flex items-center gap-2 text-base`,children:[(0,S.jsx)(Vn,{className:`size-4 ${j?`text-amber-600`:`text-emerald-600`}`}),n(j?`有未保存更改`:`已同步`)]})]})}),(0,S.jsx)(oh,{size:`sm`,children:(0,S.jsxs)(sh,{children:[(0,S.jsx)(lh,{children:n(`当前 Git AI 状态`)}),(0,S.jsxs)(ch,{className:`space-y-1 text-base`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(zn,{className:`size-4 ${ge?`text-emerald-600`:`text-amber-600`}`}),(0,S.jsx)(`span`,{children:_e?C.git_ai_enabled?n(`开启(待保存)`):n(`暂停(待保存)`):n(ge?`已开启`:`已暂停`)}),(0,S.jsxs)(`span`,{className:`shrink-0 font-mono text-sm font-normal text-muted-foreground`,children:[`v`,T.gitAiVersion||n(`未知`)]})]}),(0,S.jsxs)(`p`,{className:`pl-6 text-xs font-normal text-muted-foreground`,children:[n(`更新于`),` `,ye]})]})]})}),(0,S.jsx)(oh,{size:`sm`,children:(0,S.jsxs)(sh,{children:[(0,S.jsx)(lh,{children:n(`过滤服务状态`)}),(0,S.jsxs)(ch,{className:`space-y-1 text-base`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(zn,{className:`size-4 ${ve?`text-emerald-600`:`text-destructive`}`}),(0,S.jsx)(`span`,{children:n(ve?`已在线`:`已离线`)}),(0,S.jsxs)(`span`,{className:`shrink-0 font-mono text-sm font-normal text-muted-foreground`,children:[`v`,`0.4.14`]})]}),(0,S.jsxs)(`p`,{className:`pl-6 text-xs font-normal text-muted-foreground`,children:[n(`更新于`),` `,be]})]})]})})]}),(0,S.jsxs)(Th,{defaultValue:`system`,children:[(0,S.jsxs)(Dh,{className:`w-full justify-start`,children:[(0,S.jsxs)(Oh,{value:`system`,children:[(0,S.jsx)(er,{}),n(`Git AI 设置`)]}),(0,S.jsxs)(Oh,{value:`plugins`,children:[(0,S.jsx)(Zn,{}),n(`插件管理`)]})]}),(0,S.jsx)(kh,{value:`system`,className:`mt-4`,children:(0,S.jsxs)(oh,{children:[(0,S.jsxs)(sh,{className:`gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,S.jsxs)(`div`,{className:`space-y-1`,children:[(0,S.jsx)(ch,{children:n(`Git AI 原生设置`)}),(0,S.jsx)(lh,{children:n(`写入 ~/.git-ai/config.json,未知字段会原样保留。`)})]}),(0,S.jsx)(Km,{variant:`outline`,size:`sm`,onClick:()=>void Ne(`gitAi`),disabled:ie,children:n(ie?`读取中...`:`查看配置`)})]}),(0,S.jsxs)(uh,{className:`space-y-6`,children:[(0,S.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,S.jsx)(yg,{id:`git-ai-enabled`,title:`Git AI`,description:C.git_ai_enabled?n(`已开启:按当前插件策略处理并转发 Git AI 上报`):n(`已暂停:全部 Git AI 上报会在本机拦截,恢复后继续按原策略处理`),checked:C.git_ai_enabled,onCheckedChange:e=>Ce({...C,git_ai_enabled:e})}),(0,S.jsx)(yg,{id:`auto-updates`,title:n(`自动更新`),description:n(`检测到稳定版本后自动安装`),checked:!r.disable_auto_updates,onCheckedChange:e=>Se({...r,disable_auto_updates:!e})}),(0,S.jsx)(yg,{id:`version-checks`,title:n(`版本检查`),description:n(`在 fetch、pull、push 时检查版本`),checked:!r.disable_version_checks,onCheckedChange:e=>Se({...r,disable_version_checks:!e})}),(0,S.jsx)(yg,{id:`oss-telemetry`,title:n(`上游 OSS 遥测`),description:n(`控制官方版的 Sentry/PostHog 遥测,不等同于细粒度事件过滤`),checked:r.telemetry_oss!==`off`,onCheckedChange:e=>Se({...r,telemetry_oss:e?`on`:`off`})})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`git-path`,children:n(`Git 可执行文件`)}),(0,S.jsx)(fh,{id:`git-path`,className:`font-mono`,value:r.git_path,onChange:e=>Se({...r,git_path:e.target.value})})]}),(0,S.jsxs)(`div`,{className:`grid gap-6 md:grid-cols-2`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`exclude-repositories`,children:n(`排除的仓库`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`每行一个远程地址、路径或通配符。匹配后 Git AI 整体停用。`)}),(0,S.jsx)(Ah,{id:`exclude-repositories`,className:`min-h-44 font-mono text-xs`,value:a,onChange:e=>{let t=e.target.value;o(t),Se({...r,exclude_repositories:og(t)})}})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`exclude-prompts`,children:n(`不保存提示词的仓库`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`每行一个规则,只影响提示词与会话内容。`)}),(0,S.jsx)(Ah,{id:`exclude-prompts`,className:`min-h-44 font-mono text-xs`,value:s,onChange:e=>{let t=e.target.value;c(t),Se({...r,exclude_prompts_in_repositories:og(t)})}})]})]})]})]})}),(0,S.jsxs)(kh,{value:`plugins`,className:`mt-4 space-y-4`,children:[(0,S.jsx)(oh,{size:`sm`,children:(0,S.jsxs)(sh,{className:`gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,S.jsxs)(`div`,{className:`space-y-1`,children:[(0,S.jsx)(ch,{children:n(`Git AI 运行兼容性`)}),(0,S.jsx)(lh,{children:T.distribution===`upstream-oss`?n(`检测到官方上游版:原生设置生效,但官方版没有 custom_metrics 扩展点,下面的仓库和 Skill 细粒度上报规则不会接管 /worker/metrics/upload。仓库插件可以添加多个,主机规则重叠时按列表顺序使用第一个命中插件。`):n(`检测到 custom_metrics 定制版:仓库、Skill、数据类型和字段规则会在请求离开本机前执行。仓库插件可以添加多个,主机规则重叠时按列表顺序使用第一个命中插件。`)})]}),(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,S.jsx)(Km,{variant:`outline`,size:`sm`,onClick:()=>void Ne(`policy`),disabled:ie,children:n(ie?`读取中...`:`查看配置`)}),(0,S.jsx)(ah,{variant:T.granularFilterActive?`secondary`:`outline`,children:T.granularFilterActive?n(`细粒度过滤已接管`):n(`仅原生配置兼容`)})]})]})}),(0,S.jsxs)(oh,{className:`overflow-hidden`,children:[(0,S.jsxs)(sh,{className:`gap-4 border-b bg-muted/30 sm:flex-row sm:items-center sm:justify-between`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsxs)(ah,{variant:`secondary`,children:[(0,S.jsx)(zn,{}),n(`过滤观察`)]}),(0,S.jsxs)(`div`,{children:[(0,S.jsx)(ch,{children:n(`最近 24 小时的拦截记录`)}),(0,S.jsx)(lh,{children:n(`已拦截 {{count}} 次上报,按仓库和 Skill 汇总。`,{count:D.length})})]})]}),(0,S.jsxs)(Km,{variant:`outline`,size:`sm`,onClick:()=>void oe(),disabled:k,children:[(0,S.jsx)(Qn,{className:k?`animate-spin`:void 0}),n(`刷新记录`)]})]}),(0,S.jsxs)(uh,{className:`space-y-4 pt-6`,children:[A?(0,S.jsxs)(`div`,{className:`rounded-lg border border-destructive/40 bg-destructive/5 px-4 py-3 text-sm text-destructive`,children:[n(`无法读取过滤记录:`),A]}):(0,S.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:he.map(({title:t,items:r,emptyMessage:i})=>(0,S.jsxs)(`section`,{className:`overflow-hidden rounded-lg border bg-background`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between border-b bg-muted/40 px-4 py-3`,children:[(0,S.jsx)(`h3`,{className:`text-sm font-medium`,children:t}),(0,S.jsx)(ah,{variant:`outline`,children:n(`{{count}} 项`,{count:r.length})})]}),r.length?(0,S.jsx)(`ul`,{className:`divide-y`,children:r.map(t=>(0,S.jsxs)(`li`,{className:`flex items-start justify-between gap-3 px-4 py-3`,children:[(0,S.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,S.jsx)(`p`,{className:`truncate font-mono text-xs font-medium`,children:t.name}),(0,S.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[pg(t.reason,n),` · `,n(`最近`),` `,dg(t.timestamp,e,n(`时间未知`))]})]}),(0,S.jsx)(ah,{variant:`secondary`,className:`shrink-0`,children:n(`{{count}} 次`,{count:t.count})})]},t.name))}):(0,S.jsx)(`p`,{className:`px-4 py-8 text-center text-sm text-muted-foreground`,children:i})]},t))}),(0,S.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`记录仅保存在本机 24 小时,包含时间、仓库或 Skill 标识及拦截原因,不保存上报正文。`)})]})]}),(0,S.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[C.plugins.map(e=>(0,S.jsxs)(oh,{style:{order:ue.get(mg(e.id))},children:[(0,S.jsxs)(sh,{className:`gap-4 sm:flex-row sm:items-start sm:justify-between`,children:[(0,S.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,S.jsxs)(ah,{variant:`secondary`,children:[(0,S.jsx)(Wn,{}),n(`仓库插件`)]}),(0,S.jsx)(fh,{"aria-label":n(`插件名称`),className:`max-w-md text-base font-medium`,value:e.name,onChange:t=>we(e.id,e=>({...e,name:t.target.value}))}),(0,S.jsxs)(lh,{className:`font-mono`,children:[`plugin://`,e.id]})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(ph,{htmlFor:`plugin-${e.id}`,children:n(`启用`)}),(0,S.jsx)(wh,{id:`plugin-${e.id}`,checked:e.enabled,onCheckedChange:t=>we(e.id,e=>({...e,enabled:t}))})]}),(0,S.jsxs)(qm,{children:[(0,S.jsxs)(qh,{children:[(0,S.jsx)(Jh,{asChild:!0,children:(0,S.jsx)(Jm,{asChild:!0,children:(0,S.jsx)(Km,{variant:`ghost`,size:`icon`,"aria-label":n(`删除插件 {{name}}`,{name:e.name}),children:(0,S.jsx)(rr,{})})})}),(0,S.jsx)(Yh,{children:n(`删除当前插件`)})]}),(0,S.jsxs)(Zm,{children:[(0,S.jsxs)(Qm,{children:[(0,S.jsx)(eh,{children:n(`删除仓库插件?`)}),(0,S.jsx)(th,{children:n(`将删除“{{name}}”的全部配置。保存更改前不会写入磁盘。`,{name:e.name})})]}),(0,S.jsxs)($m,{children:[(0,S.jsx)(rh,{children:n(`取消`)}),(0,S.jsx)(nh,{onClick:()=>De(e.id),children:n(`删除`)})]})]})]})]})]}),(0,S.jsxs)(uh,{className:`space-y-6`,children:[(0,S.jsx)(yg,{id:`default-allow`,title:n(`未匹配主机的仓库`),description:n(`控制未命中此插件主机规则的仓库是否允许原始上报`),checked:C.default_allow_unmatched,onCheckedChange:e=>Ce({...C,default_allow_unmatched:e})}),(0,S.jsxs)(`div`,{className:`grid gap-6 md:grid-cols-2`,children:[(0,S.jsxs)(`div`,{className:`space-y-4`,children:[(0,S.jsx)(yg,{id:`global-${e.id}`,title:n(`全部仓库(全局规则)`),description:n(`全局规则始终排在所有特定仓库规则之后,适合作为默认策略。`),checked:e.match.all_repositories,onCheckedChange:t=>we(e.id,e=>({...e,match:{...e.match,all_repositories:t}}))}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`priority-${e.id}`,children:n(`特定规则优先级`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`数值越大越优先;同优先级按插件列表顺序匹配。`)}),(0,S.jsx)(fh,{id:`priority-${e.id}`,type:`number`,min:`0`,max:`1000`,value:e.priority,onChange:t=>{let n=Number.parseInt(t.target.value,10);we(e.id,e=>({...e,priority:Number.isFinite(n)?Math.min(1e3,Math.max(0,n)):0}))}})]})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`directory-${e.id}`,children:n(`Skill 上报目录`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`仅替换此插件允许上传的 Skill 路径。留空则保留原路径。`)}),(0,S.jsx)(fh,{id:`directory-${e.id}`,className:`font-mono`,value:e.fixed_project_directory,onChange:t=>we(e.id,e=>({...e,fixed_project_directory:t.target.value}))}),(0,S.jsxs)(`div`,{className:`rounded-lg border bg-muted/50 p-3`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,S.jsx)(Un,{className:`size-4`}),n(`上报目录预览`)]}),(0,S.jsx)(`p`,{className:`mt-2 break-all font-mono text-xs text-muted-foreground`,children:e.fixed_project_directory||n(`保留原路径`)})]})]})]}),!e.match.all_repositories&&(0,S.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`hosts-${e.id}`,children:n(`匹配仓库主机`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n("每行一条,可用 `github.com` 或 `*github.com*`。")}),(0,S.jsx)(Ah,{id:`hosts-${e.id}`,className:`min-h-28 font-mono text-xs`,value:h[sg(e.id,`hosts`)]??ag(e.match.hosts),onChange:t=>Te(e.id,`hosts`,t.target.value)})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`repositories-${e.id}`,children:n(`匹配仓库`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`每行一条,可填 owner/repo、远程地址或通配符。`)}),(0,S.jsx)(Ah,{id:`repositories-${e.id}`,className:`min-h-28 font-mono text-xs`,value:h[sg(e.id,`repositories`)]??ag(e.match.repositories),onChange:t=>Te(e.id,`repositories`,t.target.value)})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`directories-${e.id}`,children:n(`匹配项目目录`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n("多条件会同时生效;可用 `/work/*` 缩小范围。")}),(0,S.jsx)(Ah,{id:`directories-${e.id}`,className:`min-h-28 font-mono text-xs`,value:h[sg(e.id,`directories`)]??ag(e.match.directories),onChange:t=>Te(e.id,`directories`,t.target.value)})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`branches-${e.id}`,children:n(`匹配分支`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`每行一条,例如 main、release/* 或 feature/*。`)}),(0,S.jsx)(Ah,{id:`branches-${e.id}`,className:`min-h-28 font-mono text-xs`,value:h[sg(e.id,`branches`)]??ag(e.match.branches),onChange:t=>Te(e.id,`branches`,t.target.value)})]})]}),(0,S.jsx)(Sh,{}),(0,S.jsxs)(`div`,{className:`space-y-3`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`h3`,{className:`text-sm font-medium`,children:n(`允许上传的数据`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`每类事件可单独启用,关闭时请求会在本机被拦截。`)})]}),(0,S.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:Object.keys(Xh).map(t=>(0,S.jsx)(bg,{id:`${e.id}-event-${t}`,label:de[t],checked:e.allow[t],onCheckedChange:n=>we(e.id,e=>({...e,allow:{...e.allow,[t]:n}}))},t))})]}),(0,S.jsxs)(`div`,{className:`space-y-3`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`h3`,{className:`text-sm font-medium`,children:n(`允许保留的字段`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`关闭的仓库、目录和分支字段会在请求离开本机前删除。`)})]}),(0,S.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:Object.keys(Zh).map(t=>(0,S.jsx)(bg,{id:`${e.id}-field-${t}`,label:fe[t],checked:e.fields[t],onCheckedChange:n=>we(e.id,e=>({...e,fields:{...e.fields,[t]:n}}))},t))})]})]}),(0,S.jsxs)(dh,{className:`justify-between border-t`,children:[(0,S.jsx)(ah,{variant:e.enabled?`outline`:`secondary`,children:e.enabled?n(`{{allowed}}/7 数据类型 · {{fields}}/3 字段`,{allowed:Object.values(e.allow).filter(Boolean).length,fields:Object.values(e.fields).filter(Boolean).length}):n(`插件已停用`)}),(0,S.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.match.all_repositories?n(`全局默认策略`):n(`特定规则 · 优先级 {{priority}}`,{priority:e.priority})})]})]},e.id)),C.skill_policy.installed&&(0,S.jsxs)(oh,{style:{order:ue.get(`skill_filter`)},children:[(0,S.jsxs)(sh,{className:`gap-4 sm:flex-row sm:items-start sm:justify-between`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsxs)(ah,{variant:`secondary`,children:[(0,S.jsx)(qn,{}),n(`Skill 过滤插件`)]}),(0,S.jsx)(ch,{children:n(`Skill 关键词过滤`)}),(0,S.jsx)(lh,{children:n(`根据 Skill 名称拦截指定类型的调用。`)})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(ph,{htmlFor:`skill-enabled`,children:n(`启用`)}),(0,S.jsx)(wh,{id:`skill-enabled`,checked:C.skill_policy.enabled,onCheckedChange:e=>Ce({...C,skill_policy:{...C.skill_policy,enabled:e}})})]}),(0,S.jsxs)(qm,{children:[(0,S.jsxs)(qh,{children:[(0,S.jsx)(Jh,{asChild:!0,children:(0,S.jsx)(Jm,{asChild:!0,children:(0,S.jsx)(Km,{variant:`ghost`,size:`icon`,"aria-label":n(`删除插件 Skill 过滤插件`),children:(0,S.jsx)(rr,{})})})}),(0,S.jsx)(Yh,{children:n(`删除 Skill 过滤插件`)})]}),(0,S.jsxs)(Zm,{children:[(0,S.jsxs)(Qm,{children:[(0,S.jsx)(eh,{children:n(`删除 Skill 过滤插件?`)}),(0,S.jsx)(th,{children:n(`删除后关键词拦截将停用,现有关键词会保留,重新添加插件时可以继续使用。`)})]}),(0,S.jsxs)($m,{children:[(0,S.jsx)(rh,{children:n(`取消`)}),(0,S.jsx)(nh,{onClick:Oe,children:n(`删除`)})]})]})]})]})]}),(0,S.jsx)(uh,{children:(0,S.jsxs)(`div`,{className:`max-w-2xl space-y-6`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`blocked-patterns`,children:n(`拦截关键词 / 正则`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`每行一个,不区分大小写。命中 skillName、skill 或 name 即拦截。`)}),(0,S.jsx)(Ah,{id:`blocked-patterns`,className:`min-h-72 font-mono text-xs`,value:l,onChange:e=>{let t=e.target.value;u(t),Ce({...C,skill_policy:{...C.skill_policy,blocked_patterns:og(t)}})}})]}),(0,S.jsxs)(`div`,{className:`space-y-4 border-t pt-6`,children:[(0,S.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,S.jsxs)(`div`,{className:`space-y-1`,children:[(0,S.jsx)(ph,{htmlFor:`recent-directory-guard`,children:n(`新目录观察期`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`目录创建未满 7 天的 Skill 首次上报会拦截 24 小时;到期未处理则自动放行。`)})]}),(0,S.jsx)(wh,{id:`recent-directory-guard`,checked:C.skill_policy.recent_directory_guard.enabled,onCheckedChange:e=>Ce({...C,skill_policy:{...C.skill_policy,recent_directory_guard:{...C.skill_policy.recent_directory_guard,enabled:e}}})})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`recent-directory-allowlist`,children:n(`观察期白名单`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`每行一个 Skill 名称或正则;命中后立即放行新目录观察期。`)}),(0,S.jsx)(Ah,{id:`recent-directory-allowlist`,className:`min-h-28 font-mono text-xs`,value:d,onChange:e=>{let t=e.target.value;f(t),Ce({...C,skill_policy:{...C.skill_policy,recent_directory_guard:{...C.skill_policy.recent_directory_guard,allowlist_patterns:og(t)}}})}})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`recent-directory-blocklist`,children:n(`Skill 黑名单`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`每行一个 Skill 名称或正则;命中后持续拦截,不受 24 小时观察期限制。`)}),(0,S.jsx)(Ah,{id:`recent-directory-blocklist`,className:`min-h-28 font-mono text-xs`,value:p,onChange:e=>{let t=e.target.value;m(t),Ce({...C,skill_policy:{...C.skill_policy,recent_directory_guard:{...C.skill_policy.recent_directory_guard,blocklist_patterns:og(t)}}})}})]})]})]})}),(0,S.jsxs)(dh,{className:`justify-between border-t`,children:[(0,S.jsx)(ah,{variant:C.skill_policy.enabled?`outline`:`secondary`,children:C.skill_policy.enabled?n(`{{count}} 条拦截规则`,{count:C.skill_policy.blocked_patterns.length}):n(`插件已停用`)}),(0,S.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n(`仅处理 Skill 调用名称`)})]})]}),C.sensitive_data_policy.installed&&(0,S.jsxs)(oh,{style:{order:ue.get(`sensitive_data`)},children:[(0,S.jsxs)(sh,{className:`gap-4 sm:flex-row sm:items-start sm:justify-between`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsxs)(ah,{variant:`secondary`,children:[(0,S.jsx)(tr,{}),n(`敏感内容脱敏插件`)]}),(0,S.jsx)(ch,{children:n(`请求内容二次保护`)}),(0,S.jsx)(lh,{children:n(`在请求离开本机前检测文本。不会保存命中的原始内容。`)})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(ph,{htmlFor:`sensitive-enabled`,children:n(`启用`)}),(0,S.jsx)(wh,{id:`sensitive-enabled`,checked:C.sensitive_data_policy.enabled,onCheckedChange:e=>Ce({...C,sensitive_data_policy:{...C.sensitive_data_policy,enabled:e}})}),(0,S.jsx)(Km,{variant:`ghost`,size:`icon`,"aria-label":n(`删除敏感内容脱敏插件`),onClick:()=>ke(`sensitive_data_policy`),children:(0,S.jsx)(rr,{})})]})]}),(0,S.jsxs)(uh,{className:`space-y-6`,children:[(0,S.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`sensitive-action`,children:n(`命中后的动作`)}),(0,S.jsxs)(`select`,{id:`sensitive-action`,className:`h-9 w-full rounded-md border bg-background px-3 text-sm`,value:C.sensitive_data_policy.action,onChange:e=>Ce({...C,sensitive_data_policy:{...C.sensitive_data_policy,action:e.target.value}}),children:[(0,S.jsx)(`option`,{value:`redact`,children:n(`脱敏后继续上报`)}),(0,S.jsx)(`option`,{value:`block`,children:n(`直接阻止上报`)})]})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`sensitive-patterns`,children:n(`自定义正则`)}),(0,S.jsx)(Ah,{id:`sensitive-patterns`,className:`min-h-24 font-mono text-xs`,placeholder:n(`每行一个正则`),value:v,onChange:e=>{let t=e.target.value;y(t),Ce({...C,sensitive_data_policy:{...C.sensitive_data_policy,custom_patterns:og(t)}})}})]})]}),(0,S.jsxs)(`div`,{className:`space-y-3`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`h3`,{className:`text-sm font-medium`,children:n(`内置识别规则`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`默认启用密钥、私钥和凭据;邮箱与手机号由你决定是否纳入。`)})]}),(0,S.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-5`,children:[[`api_key`,`API Key`],[`private_key`,n(`私钥`)],[`credential`,n(`密码 / 凭据`)],[`email`,n(`邮箱`)],[`phone`,n(`手机号`)]].map(([e,t])=>(0,S.jsx)(bg,{id:`sensitive-${e}`,label:t,checked:C.sensitive_data_policy.built_in_rules[e],onCheckedChange:t=>Ce({...C,sensitive_data_policy:{...C.sensitive_data_policy,built_in_rules:{...C.sensitive_data_policy.built_in_rules,[e]:t}}})},e))})]}),(0,S.jsxs)(`div`,{className:`space-y-3`,children:[(0,S.jsx)(`h3`,{className:`text-sm font-medium`,children:n(`作用数据类型`)}),(0,S.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:Object.keys(Xh).map(e=>(0,S.jsx)(bg,{id:`sensitive-event-${e}`,label:Xh[e],checked:C.sensitive_data_policy.event_types[e],onCheckedChange:t=>Ce({...C,sensitive_data_policy:{...C.sensitive_data_policy,event_types:{...C.sensitive_data_policy.event_types,[e]:t}}})},e))})]})]})]}),C.agent_model_policy.installed&&(0,S.jsxs)(oh,{style:{order:ue.get(`agent_model`)},children:[(0,S.jsxs)(sh,{className:`gap-4 sm:flex-row sm:items-start sm:justify-between`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsxs)(ah,{variant:`secondary`,children:[(0,S.jsx)(Bn,{}),n(`Agent / 模型治理插件`)]}),(0,S.jsx)(ch,{children:n(`允许名单与阻止规则`)}),(0,S.jsx)(lh,{children:n(`允许名单支持通配符;审计模式只记录本地统计,阻止模式会拦截不合规上报。`)})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(ph,{htmlFor:`agent-model-enabled`,children:n(`启用`)}),(0,S.jsx)(wh,{id:`agent-model-enabled`,checked:C.agent_model_policy.enabled,onCheckedChange:e=>Ce({...C,agent_model_policy:{...C.agent_model_policy,enabled:e}})}),(0,S.jsx)(Km,{variant:`ghost`,size:`icon`,"aria-label":n(`删除 Agent / 模型治理插件`),onClick:()=>ke(`agent_model_policy`),children:(0,S.jsx)(rr,{})})]})]}),(0,S.jsxs)(uh,{className:`space-y-6`,children:[(0,S.jsxs)(`div`,{className:`max-w-md space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`agent-model-mode`,children:n(`治理模式`)}),(0,S.jsxs)(`select`,{id:`agent-model-mode`,className:`h-9 w-full rounded-md border bg-background px-3 text-sm`,value:C.agent_model_policy.mode,onChange:e=>Ce({...C,agent_model_policy:{...C.agent_model_policy,mode:e.target.value}}),children:[(0,S.jsx)(`option`,{value:`audit`,children:n(`仅审计,不阻止`)}),(0,S.jsx)(`option`,{value:`block`,children:n(`命中规则时阻止`)})]})]}),(0,S.jsx)(`div`,{className:`grid gap-4 md:grid-cols-3`,children:[[`allowed_agents`,n(`允许的 Agent`),n(`例如 codex、claude*`)],[`allowed_models`,n(`允许的模型`),n(`例如 gpt-5*、claude-sonnet-*`)],[`blocked_patterns`,n(`阻止正则`),n(`每行一个,不区分大小写`)]].map(([e,t,n])=>(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(ph,{htmlFor:`agent-model-${e}`,children:t}),(0,S.jsx)(Ah,{id:`agent-model-${e}`,className:`min-h-40 font-mono text-xs`,placeholder:n,value:b[e],onChange:t=>{let n=t.target.value;x(t=>({...t,[e]:n})),Ce({...C,agent_model_policy:{...C.agent_model_policy,[e]:og(n)}})}})]},e))})]})]}),!C.plugins.length&&!C.skill_policy.installed&&!C.sensitive_data_policy.installed&&!C.agent_model_policy.installed&&(0,S.jsx)(oh,{children:(0,S.jsxs)(uh,{className:`flex min-h-40 flex-col items-center justify-center gap-2 text-center`,children:[(0,S.jsx)(Zn,{className:`size-6 text-muted-foreground`}),(0,S.jsx)(`p`,{className:`font-medium`,children:n(`还没有安装插件`)}),(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`添加插件后,这里会出现对应类型的配置模块。`)})]})})]}),(0,S.jsxs)(mh,{open:P,onOpenChange:re,children:[(0,S.jsx)(hh,{asChild:!0,children:(0,S.jsxs)(Km,{variant:`outline`,className:`w-full`,disabled:!xe.length,children:[(0,S.jsx)(Xn,{}),xe.length?n(`添加插件`):n(`所有可用插件均已添加`)]})}),(0,S.jsxs)(vh,{children:[(0,S.jsxs)(yh,{children:[(0,S.jsx)(bh,{children:n(`添加插件`)}),(0,S.jsx)(xh,{children:n(`仓库插件可以添加多个;其余插件使用独立配置表单且每种只能添加一次。新插件会追加到当前列表最后。`)})]}),(0,S.jsxs)(`div`,{className:`grid gap-2`,children:[xe.includes(`repository`)&&(0,S.jsxs)(Km,{variant:`outline`,className:`h-auto justify-start gap-3 p-4 text-left`,onClick:()=>Ee(`repository`),children:[(0,S.jsx)(Wn,{className:`size-5`}),(0,S.jsxs)(`span`,{className:`space-y-1`,children:[(0,S.jsx)(`span`,{className:`block font-medium`,children:n(`仓库插件`)}),(0,S.jsx)(`span`,{className:`block text-xs font-normal text-muted-foreground`,children:n(`配置仓库主机、上传类型、目录与字段脱敏`)})]})]}),xe.includes(`skill_filter`)&&(0,S.jsxs)(Km,{variant:`outline`,className:`h-auto justify-start gap-3 p-4 text-left`,onClick:()=>Ee(`skill_filter`),children:[(0,S.jsx)(qn,{className:`size-5`}),(0,S.jsxs)(`span`,{className:`space-y-1`,children:[(0,S.jsx)(`span`,{className:`block font-medium`,children:n(`Skill 过滤插件`)}),(0,S.jsx)(`span`,{className:`block text-xs font-normal text-muted-foreground`,children:n(`配置需要拦截的 Skill 名称关键词或正则`)})]})]}),xe.includes(`sensitive_data`)&&(0,S.jsxs)(Km,{variant:`outline`,className:`h-auto justify-start gap-3 p-4 text-left`,onClick:()=>Ee(`sensitive_data`),children:[(0,S.jsx)(tr,{className:`size-5`}),(0,S.jsxs)(`span`,{className:`space-y-1`,children:[(0,S.jsx)(`span`,{className:`block font-medium`,children:n(`敏感内容脱敏`)}),(0,S.jsx)(`span`,{className:`block text-xs font-normal text-muted-foreground`,children:n(`检测密钥、私钥、凭据等文本,可脱敏或阻止上报`)})]})]}),xe.includes(`agent_model`)&&(0,S.jsxs)(Km,{variant:`outline`,className:`h-auto justify-start gap-3 p-4 text-left`,onClick:()=>Ee(`agent_model`),children:[(0,S.jsx)(Bn,{className:`size-5`}),(0,S.jsxs)(`span`,{className:`space-y-1`,children:[(0,S.jsx)(`span`,{className:`block font-medium`,children:n(`Agent / 模型治理`)}),(0,S.jsx)(`span`,{className:`block text-xs font-normal text-muted-foreground`,children:n(`设置 Agent、模型允许名单与阻止规则`)})]})]})]})]})]})]})]})]}),(0,S.jsx)(mh,{open:!!F,onOpenChange:e=>{e||I(null)},children:(0,S.jsxs)(vh,{className:`w-[96vw] max-w-6xl sm:max-w-6xl`,children:[(0,S.jsxs)(yh,{children:[(0,S.jsx)(bh,{children:F?.title}),(0,S.jsx)(xh,{children:F?.description})]}),(0,S.jsx)(`div`,{className:`max-h-[70svh] overflow-auto rounded-lg border bg-muted/50 p-4`,children:F&&(0,S.jsx)(z,{value:F.content,collapsed:!1,displayDataTypes:!1,enableClipboard:!1,shortenTextAfterLength:0,style:On})})]})}),(0,S.jsx)(`footer`,{className:`fixed inset-x-0 bottom-0 z-20 border-t bg-background/95 backdrop-blur`,children:(0,S.jsxs)(`div`,{className:`mx-auto flex max-w-6xl flex-col gap-3 px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:px-6`,children:[(0,S.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,S.jsx)(Vn,{className:`size-4 ${j?`text-amber-600`:`text-emerald-600`}`}),n(j?`有未保存的更改`:`配置已同步`)]}),(0,S.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,S.jsxs)(Km,{variant:`outline`,onClick:je,disabled:ne,children:[(0,S.jsx)(Hn,{}),n(`验证配置`)]}),(0,S.jsxs)(Km,{variant:`outline`,onClick:Me,disabled:ne,children:[(0,S.jsx)(Qn,{className:ne?`animate-spin`:``}),n(`重启过滤服务`)]}),(0,S.jsxs)(Km,{onClick:Ae,disabled:ne||!j,children:[ne?(0,S.jsx)(Jn,{className:`animate-spin`}):(0,S.jsx)($n,{}),n(`保存更改`)]})]})]})})]}),(0,S.jsx)(Gh,{position:`top-right`,richColors:!0,closeButton:!0,duration:5e3})]})}(0,v.createRoot)(document.getElementById(`root`)).render((0,S.jsx)(_.StrictMode,{children:(0,S.jsx)(Rh,{attribute:`class`,defaultTheme:`light`,enableSystem:!1,children:(0,S.jsx)(Sg,{})})}));
|
package/static/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<meta name="color-scheme" content="light" />
|
|
7
7
|
<title>Git AI 配置中心</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-oco9luAC.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-Dx-rnRk7.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|